From 0fca6eda1e9c0bc120eab95c3f79a504d9d3e316 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Sat, 14 Oct 2006 04:33:41 +0000 Subject: Initial version of a new build system for Mesa. --- debian/changelog | 6 ++ debian/compat | 1 + debian/control | 196 +++++++++++++++++++++++++++++++++++ debian/copyright | 33 ++++++ debian/libgl1-mesa-dev.install | 2 + debian/libgl1-mesa-dri.install | 1 + debian/libgl1-mesa-glx.install | 1 + debian/libgl1-mesa-swx11-dbg.install | 0 debian/libgl1-mesa-swx11-dev.install | 0 debian/libgl1-mesa-swx11.install | 0 debian/libglu1-mesa-dev.install | 2 + debian/libglu1-mesa.install | 1 + debian/libosmesa6-dev.install | 0 debian/libosmesa6.install | 0 debian/mesa-common-dev.install | 0 debian/mesa-swx11-source.install | 0 debian/rules | 93 +++++++++++++++++ debian/watch | 2 + 18 files changed, 338 insertions(+) create mode 100644 debian/changelog create mode 100644 debian/compat create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/libgl1-mesa-dev.install create mode 100644 debian/libgl1-mesa-dri.install create mode 100644 debian/libgl1-mesa-glx.install create mode 100644 debian/libgl1-mesa-swx11-dbg.install create mode 100644 debian/libgl1-mesa-swx11-dev.install create mode 100644 debian/libgl1-mesa-swx11.install create mode 100644 debian/libglu1-mesa-dev.install create mode 100644 debian/libglu1-mesa.install create mode 100644 debian/libosmesa6-dev.install create mode 100644 debian/libosmesa6.install create mode 100644 debian/mesa-common-dev.install create mode 100644 debian/mesa-swx11-source.install create mode 100755 debian/rules create mode 100644 debian/watch (limited to 'debian') diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 00000000000..c6bfbcafd9e --- /dev/null +++ b/debian/changelog @@ -0,0 +1,6 @@ +mesa (6.5.1-1) unstable; urgency=low + + * + + -- Thierry Reding Sat, 14 Oct 2006 02:09:50 +0200 + diff --git a/debian/compat b/debian/compat new file mode 100644 index 00000000000..7ed6ff82de6 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +5 diff --git a/debian/control b/debian/control new file mode 100644 index 00000000000..ed1565ebaac --- /dev/null +++ b/debian/control @@ -0,0 +1,196 @@ +Source: mesa +Section: graphics +Priority: optional +Maintainer: Debian X Strike Force +Uploaders: Thierry Reding +Standards-Version: 3.7.2 +Build-Depends: debhelper (>= 5) + +Package: libgl1-mesa-swx11 +Section: libs +Architecture: any +Depends: ${shlibs: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-dev +Section: libdevel +Architecture: any +Depends: libgl1-mesa-swx11 (= ${binary:Version}), libc6-dev, libx11-dev | xlibs-dev (>> 4.1.0), libxext6 | xlibs (>> 4.1.0), mesa-common-dev (= ${source:Version}), lesstif2-dev +Provides: libgl-dev, mesag3-widgets, mesag-widgets-dev, libglw-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 support 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 package also provides a simple 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. + . + 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: libgl1-mesa-swx11-dbg +Section: libs +Architecture: any +Depends: ${shlibs:Depends} +Conflicts: libgl1-mesa-swrast-dbg +Replaces: libgl1-mesa-swrast-dbg +Provides: libgl1-mesa-swrast-dbg +Description: A free implementation of the OpenGL API -- debugging package + This package provides a debug-enabled version of the Mesa libraries. + . + For a complete description of Mesa, please look at the libgl1-mesa-swx11 + package. + +Package: libgl1-mesa-glx +Section: libs +Architecture: any +Depends: ${shlibs:Depends} +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-dri +Section: libs +Architecture: any +Depends: ${shlibs:Depends}, libgl1-mesa-glx (= ${binary:Version}) +Conflicts: xlibmesa-dri (<< 1:7.0.0) +Replaces: xlibmesa-dri (<< 1:7.0.0) +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. + +Package: libgl1-mesa-dev +Section: libs +Architecture: any +Depends: ${shlibs:Depends}, libc6-dev, mesa-common-dev (= ${source:Version}), libgl1-mesa-glx (=${binary:Version}), libgl1-mesa-dri (= ${binary:Version}) +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 support 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: devel +Architecture: all +Replaces: xlibmesa-gl-dev (<< 1:7), xlibosmesa-dev +Description: Developer documentation for Mesa + This package includes the specifications for the Mesa-specific OpenGL + extensions, the complete set of release release notes and the + development header files common to all Mesa packages. + +Package: libosmesa6 +Section: libs +Architecture: any +Depends: ${shlibs:Depends} +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: devel +Architecture: any +Depends: libosmesa6 (= ${binary:Version}), libgl1-mesa-swx11-dev (= ${binary:Version}) +Conflicts: xlibosmesa-dev, libosmesa4-dev, libosmesa-dev +Replaces: xlibosmesa-dev, libosmesa-dev +Provides: xlibosmesa-dev, libosmesa-dev +Description: Mesa Off-screen rendering extension -- development support 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}, libgl1-mesa-glx | libgl1 +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: ${shlibs:Depends}, libglu1-mesa (= ${binary:Version}), libgl1-mesa-dev | libgl-dev +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 support 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: mesa-swx11-source +Section: libdevel +Architecture: all +Description: Mesa software rasteriser source -- development support files + This package contains the source to the Mesa software rasteriser, which + implements all of Mesa's GL support in software. It powers the X11 and + X server backends (assuming unaccelerated indirect). This package is + provided mainly for modular X servers which support GL, and need the + software rasteriser source to build the GLcore module for unaccelerated + indirect rendering. + +# vim: tw=0 diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 00000000000..1a07b1d9247 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,33 @@ +This package was debianized by Thierry Reding on +Sat, 14 Oct 2006 02:01:12 +0200. + +It was downloaded from http://mesa3d.org/download.html. + +Upstream Author: Brian Paul + +License: + + Copyright (C) 1999-2005 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. + +------------------------------------------------------------------------------ + +The Debian packaging is (C) 2006, Thierry Reding and +is licensed under the GPL, see `/usr/share/common-licenses/GPL'. + diff --git a/debian/libgl1-mesa-dev.install b/debian/libgl1-mesa-dev.install new file mode 100644 index 00000000000..c892278267c --- /dev/null +++ b/debian/libgl1-mesa-dev.install @@ -0,0 +1,2 @@ +usr/include/GL/glx*.h +usr/lib/libGL.so diff --git a/debian/libgl1-mesa-dri.install b/debian/libgl1-mesa-dri.install new file mode 100644 index 00000000000..55500c81209 --- /dev/null +++ b/debian/libgl1-mesa-dri.install @@ -0,0 +1 @@ +usr/lib/dri/*.so diff --git a/debian/libgl1-mesa-glx.install b/debian/libgl1-mesa-glx.install new file mode 100644 index 00000000000..3fc3ba6696e --- /dev/null +++ b/debian/libgl1-mesa-glx.install @@ -0,0 +1 @@ +usr/lib/libGL.so.1* diff --git a/debian/libgl1-mesa-swx11-dbg.install b/debian/libgl1-mesa-swx11-dbg.install new file mode 100644 index 00000000000..e69de29bb2d diff --git a/debian/libgl1-mesa-swx11-dev.install b/debian/libgl1-mesa-swx11-dev.install new file mode 100644 index 00000000000..e69de29bb2d diff --git a/debian/libgl1-mesa-swx11.install b/debian/libgl1-mesa-swx11.install new file mode 100644 index 00000000000..e69de29bb2d diff --git a/debian/libglu1-mesa-dev.install b/debian/libglu1-mesa-dev.install new file mode 100644 index 00000000000..f8973bf1d69 --- /dev/null +++ b/debian/libglu1-mesa-dev.install @@ -0,0 +1,2 @@ +usr/include/GL/glu.h +usr/include/GL/glu_mangle.h diff --git a/debian/libglu1-mesa.install b/debian/libglu1-mesa.install new file mode 100644 index 00000000000..d252083d81e --- /dev/null +++ b/debian/libglu1-mesa.install @@ -0,0 +1 @@ +usr/lib/libGLU.so.1* diff --git a/debian/libosmesa6-dev.install b/debian/libosmesa6-dev.install new file mode 100644 index 00000000000..e69de29bb2d diff --git a/debian/libosmesa6.install b/debian/libosmesa6.install new file mode 100644 index 00000000000..e69de29bb2d diff --git a/debian/mesa-common-dev.install b/debian/mesa-common-dev.install new file mode 100644 index 00000000000..e69de29bb2d diff --git a/debian/mesa-swx11-source.install b/debian/mesa-swx11-source.install new file mode 100644 index 00000000000..e69de29bb2d diff --git a/debian/rules b/debian/rules new file mode 100755 index 00000000000..90e176e0b83 --- /dev/null +++ b/debian/rules @@ -0,0 +1,93 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +CFLAGS = -Wall -g +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 +else + CFLAGS += -O2 +endif +ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) + INSTALL_PROGRAM += -s +endif + +DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH) +DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) +DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) +DEB_BUILD_DIR ?= $(CURDIR)/obj-$(DEB_BUILD_GNU_TYPE) + +STAMPDIR = debian/stamp + +CONFIGS = debian \ + debian-dri + +STAMP = $(STAMPDIR)/$(DEB_BUILD_GNU_TYPE)- +BUILD_STAMPS = $(addprefix $(STAMP)-build-, $(CONFIGS)) +INSTALL_STAMPS = $(addprefix $(STAMP)-install-, $(CONFIGS)) + +debian/stamp: + dh_testdir + mkdir -p debian/stamp + +build: debian/stamp $(BUILD_STAMPS) +$(STAMP)-build-%: + dh_testdir + mkdir -p $(DEB_BUILD_DIR)/$* + find $(CURDIR)/* -maxdepth 0 -not -path '$(DEB_BUILD_DIR)*' | xargs cp -rl -t $(DEB_BUILD_DIR)/$* + ln -s $* $(DEB_BUILD_DIR)/$*/configs/current + cd $(DEB_BUILD_DIR)/$* && $(MAKE) + touch $@ + +pre-install: + dh_testdir + dh_testroot + dh_clean -k --exclude ./Makefile.orig + dh_installdirs + +install: build pre-install $(INSTALL_STAMPS) + +$(STAMP)-install-%: + # Add here commands to install the package into debian/tmp + cd $(DEB_BUILD_DIR)/$* && $(MAKE) install INSTALL_DIR=$(CURDIR)/debian/tmp/usr + +clean: + dh_testdir + dh_testroot + rm -rf $(DEB_BUILD_DIR) debian/stamp + dh_clean --exclude ./Makefile.orig + +# Build architecture-independent files here. +binary-indep: build install +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot + dh_installchangelogs + dh_installdocs + dh_installexamples + dh_install --sourcedir=debian/tmp --list-missing + dh_installman + dh_link + dh_strip + dh_compress + dh_fixperms + dh_makeshlibs + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install configure + diff --git a/debian/watch b/debian/watch new file mode 100644 index 00000000000..75441ad9de1 --- /dev/null +++ b/debian/watch @@ -0,0 +1,2 @@ +version=3 +http://sf.net/mesa3d/MesaLib-(.*)\.tar\.gz -- cgit v1.2.3 From d29244d8720c95f9e9869a51360902132b4b9c7e Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Sat, 14 Oct 2006 15:11:31 +0000 Subject: Add OSMesa configurations and made fixed several issues here and there. --- configs/debian | 3 +++ configs/debian-dri-common | 7 +++++-- configs/debian-osmesa16 | 15 +++++++++++++++ configs/debian-osmesa16-static | 7 +++++++ configs/debian-osmesa32 | 15 +++++++++++++++ configs/debian-osmesa32-static | 7 +++++++ configs/debian-static | 6 ++++++ debian/libglu1-mesa-dev.install | 1 + debian/mesa-common-dev.install | 4 ++++ debian/rules | 15 ++++++++++----- 10 files changed, 73 insertions(+), 7 deletions(-) create mode 100644 configs/debian-osmesa16 create mode 100644 configs/debian-osmesa16-static create mode 100644 configs/debian-osmesa32 create mode 100644 configs/debian-osmesa32-static create mode 100644 configs/debian-static (limited to 'debian') diff --git a/configs/debian b/configs/debian index 5b3b349a416..0a50109402f 100644 --- a/configs/debian +++ b/configs/debian @@ -3,3 +3,6 @@ include $(TOP)/configs/linux CONFIG_NAME = debian +override SRC_DIRS = mesa glu +override PROGRAM_DIRS = + diff --git a/configs/debian-dri-common b/configs/debian-dri-common index 4069e2c4070..ef2cebd748d 100644 --- a/configs/debian-dri-common +++ b/configs/debian-dri-common @@ -2,7 +2,10 @@ include $(TOP)/configs/debian-common CONFIG_NAME = debian-dri-common -DRI_DRIVER_INSTALL_DIR = $(INSTALL_DIR)/lib/dri -DRI_DRIVER_SEARCH_DIR = /usr/lib/dri +override SRC_DIRS = glx/x11 mesa +override PROGRAM_DIRS = + +override DRI_DRIVER_INSTALL_DIR = $(INSTALL_DIR)/lib/dri +override DRI_DRIVER_SEARCH_DIR = /usr/lib/dri diff --git a/configs/debian-osmesa16 b/configs/debian-osmesa16 new file mode 100644 index 00000000000..93b4cdfc78d --- /dev/null +++ b/configs/debian-osmesa16 @@ -0,0 +1,15 @@ +include $(TOP)/configs/debian-common + +CONFIG_NAME = debian-osmesa16 + +DEFINES += -DCHAN_BITS=16 -DDEFAULT_SOFTWARE_DEPTH_BITS=31 + +override OSMESA_LIB = OSMesa16 +override OSMESA_LIB_NAME = lib$(OSMESA_LIB).so + +override SRC_DIRS = mesa glu +override DRIVER_DIRS = osmesa +override PROGRAM_DIRS = + +override APP_LIB_DEPS = -lOSMesa16 + diff --git a/configs/debian-osmesa16-static b/configs/debian-osmesa16-static new file mode 100644 index 00000000000..3057db7c2fa --- /dev/null +++ b/configs/debian-osmesa16-static @@ -0,0 +1,7 @@ +include $(TOP)/configs/debian-static +include $(TOP)/configs/debian-osmesa16 + +CONFIG_NAME = debian-osmesa16-static + +override OSMESA_LIB_NAME = lib$(OSMESA_LIB).a + diff --git a/configs/debian-osmesa32 b/configs/debian-osmesa32 new file mode 100644 index 00000000000..5653c3b3313 --- /dev/null +++ b/configs/debian-osmesa32 @@ -0,0 +1,15 @@ +include $(TOP)/configs/debian-common + +CONFIG_NAME = debian-osmesa32 + +DEFINES += -DCHAN_BITS=32 -DDEFAULT_SOFTWARE_DEPTH_BITS=31 + +override OSMESA_LIB = OSMesa32 +override OSMESA_LIB_NAME = lib$(OSMESA_LIB).so + +override SRC_DIRS = mesa glu +override DRIVER_DIRS = osmesa +override PROGRAM_DIRS = + +override APP_LIB_DEPS = -lOSMesa32 + diff --git a/configs/debian-osmesa32-static b/configs/debian-osmesa32-static new file mode 100644 index 00000000000..f970db81b6a --- /dev/null +++ b/configs/debian-osmesa32-static @@ -0,0 +1,7 @@ +include $(TOP)/configs/debian-static +include $(TOP)/configs/debian-osmesa32 + +CONFIG_NAME = debian-osmesa32-static + +override OSMESA_LIB_NAME = lib$(OSMESA_LIB).a + diff --git a/configs/debian-static b/configs/debian-static new file mode 100644 index 00000000000..202b8b0788c --- /dev/null +++ b/configs/debian-static @@ -0,0 +1,6 @@ +include $(TOP)/configs/debian-common + +CONFIG_NAME = debian-static + +override MKLIB_OPTIONS = -static + diff --git a/debian/libglu1-mesa-dev.install b/debian/libglu1-mesa-dev.install index f8973bf1d69..abada7c1aec 100644 --- a/debian/libglu1-mesa-dev.install +++ b/debian/libglu1-mesa-dev.install @@ -1,2 +1,3 @@ usr/include/GL/glu.h usr/include/GL/glu_mangle.h +usr/lib/libGLU.so diff --git a/debian/mesa-common-dev.install b/debian/mesa-common-dev.install index e69de29bb2d..7c104927712 100644 --- a/debian/mesa-common-dev.install +++ b/debian/mesa-common-dev.install @@ -0,0 +1,4 @@ +usr/include/GL/gl.h +usr/include/GL/glext.h +usr/include/GL/osmesa.h +usr/include/GL/gl_mangle.h diff --git a/debian/rules b/debian/rules index 90e176e0b83..093efc14a90 100755 --- a/debian/rules +++ b/debian/rules @@ -26,10 +26,15 @@ DEB_BUILD_DIR ?= $(CURDIR)/obj-$(DEB_BUILD_GNU_TYPE) STAMPDIR = debian/stamp +# build the following configurations CONFIGS = debian \ - debian-dri + debian-dri \ + debian-osmesa16 \ + debian-osmesa16-static \ + debian-osmesa32 \ + debian-osmesa32-static -STAMP = $(STAMPDIR)/$(DEB_BUILD_GNU_TYPE)- +STAMP = $(STAMPDIR)/$(DEB_BUILD_GNU_TYPE) BUILD_STAMPS = $(addprefix $(STAMP)-build-, $(CONFIGS)) INSTALL_STAMPS = $(addprefix $(STAMP)-install-, $(CONFIGS)) @@ -42,14 +47,14 @@ $(STAMP)-build-%: dh_testdir mkdir -p $(DEB_BUILD_DIR)/$* find $(CURDIR)/* -maxdepth 0 -not -path '$(DEB_BUILD_DIR)*' | xargs cp -rl -t $(DEB_BUILD_DIR)/$* - ln -s $* $(DEB_BUILD_DIR)/$*/configs/current + ln -sf $* $(DEB_BUILD_DIR)/$*/configs/current cd $(DEB_BUILD_DIR)/$* && $(MAKE) touch $@ pre-install: dh_testdir dh_testroot - dh_clean -k --exclude ./Makefile.orig + dh_clean -k --exclude ./Makefile.orig --exclude configs/CVS/Root.bak dh_installdirs install: build pre-install $(INSTALL_STAMPS) @@ -62,7 +67,7 @@ clean: dh_testdir dh_testroot rm -rf $(DEB_BUILD_DIR) debian/stamp - dh_clean --exclude ./Makefile.orig + dh_clean --exclude ./Makefile.orig --exclude configs/CVS/Root.bak # Build architecture-independent files here. binary-indep: build install -- cgit v1.2.3 From 32c7138d86f1c4823ff193e4e4fdc0abe435fd32 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Sat, 14 Oct 2006 15:42:59 +0000 Subject: Move the debian/debian-dri configurations to debian-default/debian-dri-default respectively, and use debian/debian-dri to choose an architecture specific configuration. --- configs/debian | 12 ++++++------ configs/debian-default | 8 ++++++++ configs/debian-dri | 9 ++++++--- configs/debian-dri-default | 5 +++++ debian/rules | 5 +++-- 5 files changed, 28 insertions(+), 11 deletions(-) create mode 100644 configs/debian-default create mode 100644 configs/debian-dri-default (limited to 'debian') diff --git a/configs/debian b/configs/debian index 0a50109402f..b1437e2f048 100644 --- a/configs/debian +++ b/configs/debian @@ -1,8 +1,8 @@ -include $(TOP)/configs/debian-common -include $(TOP)/configs/linux +#DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH) -CONFIG_NAME = debian - -override SRC_DIRS = mesa glu -override PROGRAM_DIRS = +ifneq ($(wildcard $(TOP)/configs/debian-$(DEB_BUILD_ARCH)),) + include $(TOP)/configs/debian-$(DEB_BUILD_ARCH) +else + include $(TOP)/configs/debian-any +endif diff --git a/configs/debian-default b/configs/debian-default new file mode 100644 index 00000000000..0a50109402f --- /dev/null +++ b/configs/debian-default @@ -0,0 +1,8 @@ +include $(TOP)/configs/debian-common +include $(TOP)/configs/linux + +CONFIG_NAME = debian + +override SRC_DIRS = mesa glu +override PROGRAM_DIRS = + diff --git a/configs/debian-dri b/configs/debian-dri index db8c74e68bb..57034200667 100644 --- a/configs/debian-dri +++ b/configs/debian-dri @@ -1,5 +1,8 @@ -include $(TOP)/configs/debian-dri-common -include $(TOP)/configs/linux-dri +#DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH) -CONFIG_NAME = debian-dri +ifneq ($(wildcard $(TOP)/configs/debian-dri-$(DEB_BUILD_ARCH)),) + include $(TOP)/configs/debian-dri-$(DEB_BUILD_ARCH) +else + include $(TOP)/configs/debian-dri-any +endif diff --git a/configs/debian-dri-default b/configs/debian-dri-default new file mode 100644 index 00000000000..db8c74e68bb --- /dev/null +++ b/configs/debian-dri-default @@ -0,0 +1,5 @@ +include $(TOP)/configs/debian-dri-common +include $(TOP)/configs/linux-dri + +CONFIG_NAME = debian-dri + diff --git a/debian/rules b/debian/rules index 093efc14a90..aa5299b36ef 100755 --- a/debian/rules +++ b/debian/rules @@ -19,11 +19,12 @@ ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) INSTALL_PROGRAM += -s endif -DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH) -DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) +DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH) DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) DEB_BUILD_DIR ?= $(CURDIR)/obj-$(DEB_BUILD_GNU_TYPE) +export DEB_BUILD_ARCH + STAMPDIR = debian/stamp # build the following configurations -- cgit v1.2.3 From 6e318e2cd1a4b9fac72376702fec61f92e57ab40 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Sat, 14 Oct 2006 17:04:02 +0000 Subject: Base the Debian OSMesa configurations on linux-osmesa* provided upstream. Add a configuration for building a static version of OSMesa with 32 bits per color channel. --- configs/debian-common | 4 ---- configs/debian-osmesa | 10 ++++++++++ configs/debian-osmesa16 | 13 +------------ configs/debian-osmesa16-static | 6 ++---- configs/debian-osmesa32 | 13 +------------ configs/debian-osmesa32-static | 6 ++---- configs/linux-osmesa32-static | 28 ++++++++++++++++++++++++++++ debian/rules | 1 + 8 files changed, 45 insertions(+), 36 deletions(-) create mode 100644 configs/debian-osmesa create mode 100644 configs/linux-osmesa32-static (limited to 'debian') diff --git a/configs/debian-common b/configs/debian-common index c45c42d75c3..98796f6cf9f 100644 --- a/configs/debian-common +++ b/configs/debian-common @@ -1,10 +1,6 @@ # Override defaults set by the Mesa configuration. -include $(TOP)/configs/default - CONFIG_NAME = debian-common -override OPT_FLAGS = -O2 -g - # vim: ft=make diff --git a/configs/debian-osmesa b/configs/debian-osmesa new file mode 100644 index 00000000000..273f5a2eabf --- /dev/null +++ b/configs/debian-osmesa @@ -0,0 +1,10 @@ +# Configuration for building OSMesa on Debian. + +include $(TOP)/configs/debian-common +include $(TOP)/configs/linux-osmesa + +CONFIG_NAME = debian-osmesa + +# vim: ft=make + + diff --git a/configs/debian-osmesa16 b/configs/debian-osmesa16 index b87178785c0..32747fac926 100644 --- a/configs/debian-osmesa16 +++ b/configs/debian-osmesa16 @@ -2,20 +2,9 @@ # channel. include $(TOP)/configs/debian-common -include $(TOP)/configs/linux-osmesa +include $(TOP)/configs/linux-osmesa16 CONFIG_NAME = debian-osmesa16 -DEFINES += -DCHAN_BITS=16 -DDEFAULT_SOFTWARE_DEPTH_BITS=31 - -override OSMESA_LIB = OSMesa16 -override OSMESA_LIB_NAME = lib$(OSMESA_LIB).so - -override SRC_DIRS = mesa glu -override DRIVER_DIRS = osmesa -override PROGRAM_DIRS = - -override APP_LIB_DEPS = -lOSMesa16 - # vim: ft=make diff --git a/configs/debian-osmesa16-static b/configs/debian-osmesa16-static index eb507a20a76..78b202c72cb 100644 --- a/configs/debian-osmesa16-static +++ b/configs/debian-osmesa16-static @@ -1,12 +1,10 @@ # Configuration for building a static version of OSMesa with support for 16 # bits per color channel. -include $(TOP)/configs/debian-static -include $(TOP)/configs/debian-osmesa16 +include $(TOP)/configs/debian-common +include $(TOP)/configs/linux-osmesa16-static CONFIG_NAME = debian-osmesa16-static -override OSMESA_LIB_NAME = lib$(OSMESA_LIB).a - # vim: ft=make diff --git a/configs/debian-osmesa32 b/configs/debian-osmesa32 index a5d5216d6d4..27171b87e3a 100644 --- a/configs/debian-osmesa32 +++ b/configs/debian-osmesa32 @@ -2,20 +2,9 @@ # channel. include $(TOP)/configs/debian-common -include $(TOP)/configs/linux-osmesa +include $(TOP)/configs/linux-osmesa32 CONFIG_NAME = debian-osmesa32 -DEFINES += -DCHAN_BITS=32 -DDEFAULT_SOFTWARE_DEPTH_BITS=31 - -override OSMESA_LIB = OSMesa32 -override OSMESA_LIB_NAME = lib$(OSMESA_LIB).so - -override SRC_DIRS = mesa glu -override DRIVER_DIRS = osmesa -override PROGRAM_DIRS = - -override APP_LIB_DEPS = -lOSMesa32 - # vim: ft=make diff --git a/configs/debian-osmesa32-static b/configs/debian-osmesa32-static index 21468edbf6f..6cf3a03ae42 100644 --- a/configs/debian-osmesa32-static +++ b/configs/debian-osmesa32-static @@ -1,12 +1,10 @@ # Configuration for building a static version of OSMesa with support for 32 # bits per color channel. -include $(TOP)/configs/debian-static -include $(TOP)/configs/debian-osmesa32 +include $(TOP)/configs/debian-common +include $(TOP)/configs/linux-osmesa32-static CONFIG_NAME = debian-osmesa32-static -override OSMESA_LIB_NAME = lib$(OSMESA_LIB).a - # vim: ft=make diff --git a/configs/linux-osmesa32-static b/configs/linux-osmesa32-static new file mode 100644 index 00000000000..6db8bc02370 --- /dev/null +++ b/configs/linux-osmesa32-static @@ -0,0 +1,28 @@ +# Configuration for 32 bits/channel OSMesa library on Linux + +include $(TOP)/configs/default + +CONFIG_NAME = linux-osmesa32-static + +# Compiler and flags +CC = gcc +CXX = g++ +CFLAGS = -O3 -ansi -pedantic -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include -DCHAN_BITS=32 -DDEFAULT_SOFTWARE_DEPTH_BITS=31 +CXXFLAGS = -O3 -ansi -pedantic -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE +MKLIB_OPTIONS = -static + + +# Library names +OSMESA_LIB = OSMesa32 +OSMESA_LIB_NAME = libOSMesa32.a + + +# Directories +SRC_DIRS = mesa glu +DRIVER_DIRS = osmesa +PROGRAM_DIRS = + + +# Dependencies +OSMESA_LIB_DEPS = -lm -lpthread +APP_LIB_DEPS = -lOSMesa32 diff --git a/debian/rules b/debian/rules index aa5299b36ef..0b0e60f3438 100755 --- a/debian/rules +++ b/debian/rules @@ -30,6 +30,7 @@ STAMPDIR = debian/stamp # build the following configurations CONFIGS = debian \ debian-dri \ + debian-osmesa \ debian-osmesa16 \ debian-osmesa16-static \ debian-osmesa32 \ -- cgit v1.2.3 From b1f8b49e8b17cffb68d8829ba7562479933bf70c Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Sun, 15 Oct 2006 00:42:25 +0000 Subject: Add build-dependency on quilt. Remove shlibs:Depends substitution variable from -dev packages, which doesn't make sense. --- debian/control | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'debian') diff --git a/debian/control b/debian/control index ed1565ebaac..b24f7b6f928 100644 --- a/debian/control +++ b/debian/control @@ -4,7 +4,7 @@ Priority: optional Maintainer: Debian X Strike Force Uploaders: Thierry Reding Standards-Version: 3.7.2 -Build-Depends: debhelper (>= 5) +Build-Depends: debhelper (>= 5), quilt Package: libgl1-mesa-swx11 Section: libs @@ -99,7 +99,7 @@ Description: A free implementation of the OpenGL API -- DRI modules Package: libgl1-mesa-dev Section: libs Architecture: any -Depends: ${shlibs:Depends}, libc6-dev, mesa-common-dev (= ${source:Version}), libgl1-mesa-glx (=${binary:Version}), libgl1-mesa-dri (= ${binary:Version}) +Depends: libc6-dev, mesa-common-dev (= ${source:Version}), libgl1-mesa-glx (=${binary:Version}), libgl1-mesa-dri (= ${binary:Version}) Conflicts: libgl-dev, libgl1-mesa-dri-dev Replaces: libgl-dev, libgl1-mesa-dri-dev Provides: libgl-dev, libgl1-mesa-dri-dev @@ -172,7 +172,7 @@ Description: The OpenGL utility library (GLU) Package: libglu1-mesa-dev Section: libdevel Architecture: any -Depends: ${shlibs:Depends}, libglu1-mesa (= ${binary:Version}), libgl1-mesa-dev | libgl-dev +Depends: libglu1-mesa (= ${binary:Version}), libgl1-mesa-dev | libgl-dev 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 -- cgit v1.2.3 From 8d02f3c68a1852de6bfe8c0b58c325224fef9743 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Sun, 15 Oct 2006 00:49:41 +0000 Subject: Add patch to fix upstream build system to correctly install libOSMesa and variants. This patch also fixes the build system not to install libGL if only the OSMesa library is built. Update *.install files to install more files. Pretty much everything except debugging and optimized libraries is now built and installed. Enable building static libraries for inclusion in the -dev packages. --- configs/debian-dri-default | 3 ++- configs/debian-osmesa | 3 +++ configs/debian-osmesa16 | 2 ++ configs/debian-osmesa16-static | 2 ++ configs/debian-osmesa32 | 2 ++ configs/debian-osmesa32-static | 2 ++ configs/debian-static | 8 ++++---- debian/libgl1-mesa-dri.install | 2 +- debian/libgl1-mesa-glx.install | 2 +- debian/libgl1-mesa-swx11-dev.install | 3 +++ debian/libgl1-mesa-swx11.install | 2 ++ debian/libglu1-mesa-dev.install | 1 + debian/libglu1-mesa.install | 2 +- debian/libosmesa6-dev.install | 4 ++++ debian/libosmesa6.install | 2 ++ debian/patches/01_fix-makefile.patch | 15 +++++++++++++++ debian/patches/series | 1 + debian/rules | 14 ++++++++++---- 18 files changed, 58 insertions(+), 12 deletions(-) create mode 100644 debian/patches/01_fix-makefile.patch create mode 100644 debian/patches/series (limited to 'debian') diff --git a/configs/debian-dri-default b/configs/debian-dri-default index 553dfcecd1a..ba4ffd92089 100644 --- a/configs/debian-dri-default +++ b/configs/debian-dri-default @@ -4,10 +4,11 @@ include $(TOP)/configs/debian-common CONFIG_NAME = debian-dri-default +override LIB_DIR = libglx override SRC_DIRS = glx/x11 mesa override PROGRAM_DIRS = -override DRI_DRIVER_INSTALL_DIR = $(INSTALL_DIR)/lib/dri +override DRI_DRIVER_INSTALL_DIR = $(INSTALL_DIR)/$(LIB_DIR)/dri override DRI_DRIVER_SEARCH_DIR = /usr/lib/dri # vim: ft=make diff --git a/configs/debian-osmesa b/configs/debian-osmesa index 273f5a2eabf..a639d59895c 100644 --- a/configs/debian-osmesa +++ b/configs/debian-osmesa @@ -5,6 +5,9 @@ include $(TOP)/configs/linux-osmesa CONFIG_NAME = debian-osmesa +override SRC_DIRS = mesa +override PROGRAM_DIRS = + # vim: ft=make diff --git a/configs/debian-osmesa16 b/configs/debian-osmesa16 index 32747fac926..3019d49fa4e 100644 --- a/configs/debian-osmesa16 +++ b/configs/debian-osmesa16 @@ -6,5 +6,7 @@ include $(TOP)/configs/linux-osmesa16 CONFIG_NAME = debian-osmesa16 +override SRC_DIRS = mesa + # vim: ft=make diff --git a/configs/debian-osmesa16-static b/configs/debian-osmesa16-static index 78b202c72cb..74396404595 100644 --- a/configs/debian-osmesa16-static +++ b/configs/debian-osmesa16-static @@ -6,5 +6,7 @@ include $(TOP)/configs/linux-osmesa16-static CONFIG_NAME = debian-osmesa16-static +override SRC_DIRS = mesa + # vim: ft=make diff --git a/configs/debian-osmesa32 b/configs/debian-osmesa32 index 27171b87e3a..468045bd438 100644 --- a/configs/debian-osmesa32 +++ b/configs/debian-osmesa32 @@ -6,5 +6,7 @@ include $(TOP)/configs/linux-osmesa32 CONFIG_NAME = debian-osmesa32 +override SRC_DIRS = mesa + # vim: ft=make diff --git a/configs/debian-osmesa32-static b/configs/debian-osmesa32-static index 6cf3a03ae42..237a632b90d 100644 --- a/configs/debian-osmesa32-static +++ b/configs/debian-osmesa32-static @@ -6,5 +6,7 @@ include $(TOP)/configs/linux-osmesa32-static CONFIG_NAME = debian-osmesa32-static +override SRC_DIRS = mesa + # vim: ft=make diff --git a/configs/debian-static b/configs/debian-static index 4253b270f45..c3e7f05b030 100644 --- a/configs/debian-static +++ b/configs/debian-static @@ -1,12 +1,12 @@ -# Override options needed to build static versions of the libraries. -# -# This configuration cannot be used standalone. +# Configuration for building static versions of the libraries. include $(TOP)/configs/debian-common +include $(TOP)/configs/linux-static CONFIG_NAME = debian-static -override MKLIB_OPTIONS = -static +override SRC_DIRS = mesa glu +override PROGRAM_DIRS = # vim: ft=make diff --git a/debian/libgl1-mesa-dri.install b/debian/libgl1-mesa-dri.install index 55500c81209..f3e8ada53ac 100644 --- a/debian/libgl1-mesa-dri.install +++ b/debian/libgl1-mesa-dri.install @@ -1 +1 @@ -usr/lib/dri/*.so +usr/libglx/dri/*.so usr/lib/dri diff --git a/debian/libgl1-mesa-glx.install b/debian/libgl1-mesa-glx.install index 3fc3ba6696e..270e569baa4 100644 --- a/debian/libgl1-mesa-glx.install +++ b/debian/libgl1-mesa-glx.install @@ -1 +1 @@ -usr/lib/libGL.so.1* +usr/libglx/libGL.so.* usr/lib diff --git a/debian/libgl1-mesa-swx11-dev.install b/debian/libgl1-mesa-swx11-dev.install index e69de29bb2d..2258776adea 100644 --- a/debian/libgl1-mesa-swx11-dev.install +++ b/debian/libgl1-mesa-swx11-dev.install @@ -0,0 +1,3 @@ +usr/include/GL/glx*.h +usr/lib/libGL.a +usr/lib/libGL.so diff --git a/debian/libgl1-mesa-swx11.install b/debian/libgl1-mesa-swx11.install index e69de29bb2d..26237d51434 100644 --- a/debian/libgl1-mesa-swx11.install +++ b/debian/libgl1-mesa-swx11.install @@ -0,0 +1,2 @@ +usr/lib/libGL.so.* +usr/lib/libOSMesa.* diff --git a/debian/libglu1-mesa-dev.install b/debian/libglu1-mesa-dev.install index abada7c1aec..78ac2b01eda 100644 --- a/debian/libglu1-mesa-dev.install +++ b/debian/libglu1-mesa-dev.install @@ -1,3 +1,4 @@ usr/include/GL/glu.h usr/include/GL/glu_mangle.h +usr/lib/libGLU.a usr/lib/libGLU.so diff --git a/debian/libglu1-mesa.install b/debian/libglu1-mesa.install index d252083d81e..9ad0953c1ca 100644 --- a/debian/libglu1-mesa.install +++ b/debian/libglu1-mesa.install @@ -1 +1 @@ -usr/lib/libGLU.so.1* +usr/lib/libGLU.so.* diff --git a/debian/libosmesa6-dev.install b/debian/libosmesa6-dev.install index e69de29bb2d..e92cc0d05bb 100644 --- a/debian/libosmesa6-dev.install +++ b/debian/libosmesa6-dev.install @@ -0,0 +1,4 @@ +usr/lib/libOSMesa16.a +usr/lib/libOSMesa16.so +usr/lib/libOSMesa32.a +usr/lib/libOSMesa32.so diff --git a/debian/libosmesa6.install b/debian/libosmesa6.install index e69de29bb2d..dbf33f54a7d 100644 --- a/debian/libosmesa6.install +++ b/debian/libosmesa6.install @@ -0,0 +1,2 @@ +usr/lib/libOSMesa16.so.* +usr/lib/libOSMesa32.so.* diff --git a/debian/patches/01_fix-makefile.patch b/debian/patches/01_fix-makefile.patch new file mode 100644 index 00000000000..f013c46e1c0 --- /dev/null +++ b/debian/patches/01_fix-makefile.patch @@ -0,0 +1,15 @@ +--- a/src/mesa/Makefile ++++ b/src/mesa/Makefile +@@ -154,7 +154,11 @@ + $(INSTALL) -d $(INSTALL_DIR)/include/GL + $(INSTALL) -d $(INSTALL_DIR)/$(LIB_DIR) + $(INSTALL) -m 644 $(TOP)/include/GL/*.h $(INSTALL_DIR)/include/GL +- $(COPY_LIBS) $(TOP)/$(LIB_DIR)/libGL.* $(INSTALL_DIR)/$(LIB_DIR) ++ @if [ "${DRIVER_DIRS}" != "osmesa" ]; then \ ++ $(COPY_LIBS) $(TOP)/$(LIB_DIR)/lib$(GL_LIB).* $(INSTALL_DIR)/$(LIB_DIR); \ ++ else \ ++ $(COPY_LIBS) $(TOP)/$(LIB_DIR)/lib$(OSMESA_LIB).* $(INSTALL_DIR)/$(LIB_DIR); \ ++ fi + @if [ "${DRIVER_DIRS}" = "dri" ] ; then \ + cd drivers/dri ; $(MAKE) install ; \ + fi diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 00000000000..6840f95c944 --- /dev/null +++ b/debian/patches/series @@ -0,0 +1 @@ +01_fix-makefile.patch diff --git a/debian/rules b/debian/rules index 0b0e60f3438..966d25ed8b8 100755 --- a/debian/rules +++ b/debian/rules @@ -9,6 +9,9 @@ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 +QUILT_STAMPFN ?= debian/stamp/patch +include /usr/share/quilt/quilt.make + CFLAGS = -Wall -g ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) CFLAGS += -O0 @@ -34,7 +37,8 @@ CONFIGS = debian \ debian-osmesa16 \ debian-osmesa16-static \ debian-osmesa32 \ - debian-osmesa32-static + debian-osmesa32-static \ + debian-static STAMP = $(STAMPDIR)/$(DEB_BUILD_GNU_TYPE) BUILD_STAMPS = $(addprefix $(STAMP)-build-, $(CONFIGS)) @@ -44,7 +48,7 @@ debian/stamp: dh_testdir mkdir -p debian/stamp -build: debian/stamp $(BUILD_STAMPS) +build: debian/stamp patch $(BUILD_STAMPS) $(STAMP)-build-%: dh_testdir mkdir -p $(DEB_BUILD_DIR)/$* @@ -57,15 +61,17 @@ pre-install: dh_testdir dh_testroot dh_clean -k --exclude ./Makefile.orig --exclude configs/CVS/Root.bak + rm -rf $(INSTALL_STAMPS) dh_installdirs install: build pre-install $(INSTALL_STAMPS) -$(STAMP)-install-%: +$(STAMP)-install-%: $(STAMP)-build-% # Add here commands to install the package into debian/tmp cd $(DEB_BUILD_DIR)/$* && $(MAKE) install INSTALL_DIR=$(CURDIR)/debian/tmp/usr + touch $@ -clean: +clean: unpatch dh_testdir dh_testroot rm -rf $(DEB_BUILD_DIR) debian/stamp -- cgit v1.2.3 From 8ef731bcd11af50e92fc1356532df44a80f7a4b0 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Sun, 15 Oct 2006 13:15:56 +0000 Subject: Add a patch (00_create-libdir) that fixes the upstream build system to make sure the LIB_DIR is created or bail out. Update the 01_fix-makefile patch to only install libGL/libOSMesa if they exist. Don't make installation dependent on which drivers are built. Build optimized versions of the swx11 libraries in addition to those that should work on the least-capable supported processor for the given architecture. Have most configurations include debian-default instead of debian-common so that INSTALL_DIR is correctly defined. debian-common can probably be dropped anyway. --- configs/debian | 9 +++------ configs/debian-any | 7 ++----- configs/debian-arch | 13 +++++++++++++ configs/debian-default | 2 ++ configs/debian-dri | 12 ++++-------- configs/debian-dri-any | 7 ++----- configs/debian-dri-arch | 13 +++++++++++++ configs/debian-dri-default | 7 +++---- configs/debian-i386 | 4 ++++ configs/debian-osmesa | 3 +-- configs/debian-osmesa16 | 2 +- configs/debian-osmesa16-static | 2 +- configs/debian-osmesa32 | 2 +- configs/debian-osmesa32-static | 2 +- configs/debian-static | 5 +---- debian/libgl1-mesa-dri.install | 2 +- debian/libgl1-mesa-glx.install | 2 +- debian/patches/00_create-libdir.patch | 11 +++++++++++ debian/patches/01_fix-makefile.patch | 7 ++++--- debian/patches/series | 1 + debian/rules | 9 +++++++-- 21 files changed, 77 insertions(+), 45 deletions(-) create mode 100644 configs/debian-arch create mode 100644 configs/debian-dri-arch create mode 100644 debian/patches/00_create-libdir.patch (limited to 'debian') diff --git a/configs/debian b/configs/debian index d6b972795e0..68b7a613288 100644 --- a/configs/debian +++ b/configs/debian @@ -1,10 +1,7 @@ -# Select the correct configuration depending on the build architecture. +# Configuration for building Mesa on the build architecture. -ifneq ($(wildcard $(TOP)/configs/debian-$(DEB_BUILD_ARCH)),) - include $(TOP)/configs/debian-$(DEB_BUILD_ARCH) -else - include $(TOP)/configs/debian-any -endif +include $(TOP)/configs/debian-default +include $(TOP)/configs/linux CONFIG_NAME = debian diff --git a/configs/debian-any b/configs/debian-any index d9c11575559..a2846015ba1 100644 --- a/configs/debian-any +++ b/configs/debian-any @@ -1,8 +1,5 @@ -# Fallback configuration for building Mesa on architectures for which no -# architecture-specific configuration is provided. - -include $(TOP)/configs/debian-default -include $(TOP)/configs/linux +# Chicken-out configuration for architectures where optimized builds are not +# supported. CONFIG_NAME = debian-any diff --git a/configs/debian-arch b/configs/debian-arch new file mode 100644 index 00000000000..a39163d45d7 --- /dev/null +++ b/configs/debian-arch @@ -0,0 +1,13 @@ +# Configuration for building a version of Mesa optimized for the build +# architecture. + +ifneq ($(wildcard $(TOP)/configs/debian-$(DEB_BUILD_ARCH)),) + include $(TOP)/configs/debian-$(DEB_BUILD_ARCH) +else + include $(TOP)/configs/debian-any +endif + +CONFIG_NAME = debian-arch + +# vim: ft=make + diff --git a/configs/debian-default b/configs/debian-default index aae6ce3ed98..8ae6b10c681 100644 --- a/configs/debian-default +++ b/configs/debian-default @@ -11,5 +11,7 @@ CONFIG_NAME = debian-default override SRC_DIRS = mesa glu override PROGRAM_DIRS = +override INSTALL_DIR = $(DESTDIR)/usr + # vim: ft=make diff --git a/configs/debian-dri b/configs/debian-dri index a26595f1ca6..48d1fc6a4fb 100644 --- a/configs/debian-dri +++ b/configs/debian-dri @@ -1,11 +1,7 @@ -# Select the correct configuration for building the DRI drivers depending on -# the build architecture. - -ifneq ($(wildcard $(TOP)/configs/debian-dri-$(DEB_BUILD_ARCH)),) - include $(TOP)/configs/debian-dri-$(DEB_BUILD_ARCH) -else - include $(TOP)/configs/debian-dri-any -endif +# Configuration for building the DRI drivers on the build architecture. + +include $(TOP)/configs/debian-dri-default +include $(TOP)/configs/linux-dri CONFIG_NAME = debian-dri diff --git a/configs/debian-dri-any b/configs/debian-dri-any index 03056bd8bb3..f6a33821bc1 100644 --- a/configs/debian-dri-any +++ b/configs/debian-dri-any @@ -1,8 +1,5 @@ -# Fallback configuration for building the DRI drivers on architectures for -# which no architecture-specific configuration is provided. - -include $(TOP)/configs/debian-dri-default -include $(TOP)/configs/linux-dri +# Chicken-out configuration for architectures where optimized builds are not +# supported. CONFIG_NAME = debian-dri-any diff --git a/configs/debian-dri-arch b/configs/debian-dri-arch new file mode 100644 index 00000000000..b5785409359 --- /dev/null +++ b/configs/debian-dri-arch @@ -0,0 +1,13 @@ +# Configuration for building a version of the DRI drivers optimized for the +# build architecture. + +ifneq ($(wildcard $(TOP)/configs/debian-dri-$(DEB_BUILD_ARCH)),) + include $(TOP)/configs/debian-dri-$(DEB_BUILD_ARCH) +else + include $(TOP)/configs/debian-dri-any +endif + +CONFIG_NAME = debian-dri-arch + +# vim: ft=make + diff --git a/configs/debian-dri-default b/configs/debian-dri-default index ba4ffd92089..22f4b63e536 100644 --- a/configs/debian-dri-default +++ b/configs/debian-dri-default @@ -1,14 +1,13 @@ # Override defaults for the DRI drivers build. -include $(TOP)/configs/debian-common +include $(TOP)/configs/debian-default CONFIG_NAME = debian-dri-default -override LIB_DIR = libglx +override LIB_DIR = lib/glx override SRC_DIRS = glx/x11 mesa -override PROGRAM_DIRS = -override DRI_DRIVER_INSTALL_DIR = $(INSTALL_DIR)/$(LIB_DIR)/dri +override DRI_DRIVER_INSTALL_DIR = $(INSTALL_DIR)/lib/dri override DRI_DRIVER_SEARCH_DIR = /usr/lib/dri # vim: ft=make diff --git a/configs/debian-i386 b/configs/debian-i386 index 1706dabd786..9d56e4a4f4f 100644 --- a/configs/debian-i386 +++ b/configs/debian-i386 @@ -5,5 +5,9 @@ include $(TOP)/configs/linux-x86 CONFIG_NAME = debian-i386 +OPT_FLAGS += -march=i686 + +override LIB_DIR = lib/i686/cmov + # vim: ft=make diff --git a/configs/debian-osmesa b/configs/debian-osmesa index a639d59895c..ebace88c7b1 100644 --- a/configs/debian-osmesa +++ b/configs/debian-osmesa @@ -1,12 +1,11 @@ # Configuration for building OSMesa on Debian. -include $(TOP)/configs/debian-common +include $(TOP)/configs/debian-default include $(TOP)/configs/linux-osmesa CONFIG_NAME = debian-osmesa override SRC_DIRS = mesa -override PROGRAM_DIRS = # vim: ft=make diff --git a/configs/debian-osmesa16 b/configs/debian-osmesa16 index 3019d49fa4e..bfe906ce160 100644 --- a/configs/debian-osmesa16 +++ b/configs/debian-osmesa16 @@ -1,7 +1,7 @@ # Configuration for building OSMesa with support for 16 bits per color # channel. -include $(TOP)/configs/debian-common +include $(TOP)/configs/debian-default include $(TOP)/configs/linux-osmesa16 CONFIG_NAME = debian-osmesa16 diff --git a/configs/debian-osmesa16-static b/configs/debian-osmesa16-static index 74396404595..4d1cf89ce26 100644 --- a/configs/debian-osmesa16-static +++ b/configs/debian-osmesa16-static @@ -1,7 +1,7 @@ # Configuration for building a static version of OSMesa with support for 16 # bits per color channel. -include $(TOP)/configs/debian-common +include $(TOP)/configs/debian-default include $(TOP)/configs/linux-osmesa16-static CONFIG_NAME = debian-osmesa16-static diff --git a/configs/debian-osmesa32 b/configs/debian-osmesa32 index 468045bd438..6ac31292c32 100644 --- a/configs/debian-osmesa32 +++ b/configs/debian-osmesa32 @@ -1,7 +1,7 @@ # Configuration for building OSMesa with support for 32 bits per color # channel. -include $(TOP)/configs/debian-common +include $(TOP)/configs/debian-default include $(TOP)/configs/linux-osmesa32 CONFIG_NAME = debian-osmesa32 diff --git a/configs/debian-osmesa32-static b/configs/debian-osmesa32-static index 237a632b90d..46fd1e4194f 100644 --- a/configs/debian-osmesa32-static +++ b/configs/debian-osmesa32-static @@ -1,7 +1,7 @@ # Configuration for building a static version of OSMesa with support for 32 # bits per color channel. -include $(TOP)/configs/debian-common +include $(TOP)/configs/debian-default include $(TOP)/configs/linux-osmesa32-static CONFIG_NAME = debian-osmesa32-static diff --git a/configs/debian-static b/configs/debian-static index c3e7f05b030..71129869eb6 100644 --- a/configs/debian-static +++ b/configs/debian-static @@ -1,12 +1,9 @@ # Configuration for building static versions of the libraries. -include $(TOP)/configs/debian-common +include $(TOP)/configs/debian-default include $(TOP)/configs/linux-static CONFIG_NAME = debian-static -override SRC_DIRS = mesa glu -override PROGRAM_DIRS = - # vim: ft=make diff --git a/debian/libgl1-mesa-dri.install b/debian/libgl1-mesa-dri.install index f3e8ada53ac..55500c81209 100644 --- a/debian/libgl1-mesa-dri.install +++ b/debian/libgl1-mesa-dri.install @@ -1 +1 @@ -usr/libglx/dri/*.so usr/lib/dri +usr/lib/dri/*.so diff --git a/debian/libgl1-mesa-glx.install b/debian/libgl1-mesa-glx.install index 270e569baa4..1a30ecd7cbd 100644 --- a/debian/libgl1-mesa-glx.install +++ b/debian/libgl1-mesa-glx.install @@ -1 +1 @@ -usr/libglx/libGL.so.* usr/lib +usr/lib/glx/libGL.so.* usr/lib diff --git a/debian/patches/00_create-libdir.patch b/debian/patches/00_create-libdir.patch new file mode 100644 index 00000000000..99f02f7bdc1 --- /dev/null +++ b/debian/patches/00_create-libdir.patch @@ -0,0 +1,11 @@ +--- a/src/Makefile ++++ b/src/Makefile +@@ -29,7 +29,7 @@ + done + + $(TOP)/$(LIB_DIR): +- -mkdir $(TOP)/$(LIB_DIR) ++ mkdir -p $(TOP)/$(LIB_DIR) + + + clean: diff --git a/debian/patches/01_fix-makefile.patch b/debian/patches/01_fix-makefile.patch index f013c46e1c0..6f8ea18c658 100644 --- a/debian/patches/01_fix-makefile.patch +++ b/debian/patches/01_fix-makefile.patch @@ -1,13 +1,14 @@ --- a/src/mesa/Makefile +++ b/src/mesa/Makefile -@@ -154,7 +154,11 @@ +@@ -154,7 +154,12 @@ $(INSTALL) -d $(INSTALL_DIR)/include/GL $(INSTALL) -d $(INSTALL_DIR)/$(LIB_DIR) $(INSTALL) -m 644 $(TOP)/include/GL/*.h $(INSTALL_DIR)/include/GL - $(COPY_LIBS) $(TOP)/$(LIB_DIR)/libGL.* $(INSTALL_DIR)/$(LIB_DIR) -+ @if [ "${DRIVER_DIRS}" != "osmesa" ]; then \ ++ @if [ -e $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) ]; then \ + $(COPY_LIBS) $(TOP)/$(LIB_DIR)/lib$(GL_LIB).* $(INSTALL_DIR)/$(LIB_DIR); \ -+ else \ ++ fi ++ @if [ -e $(TOP)/$(LIB_DIR)/$(OSMESA_LIB_NAME) ]; then \ + $(COPY_LIBS) $(TOP)/$(LIB_DIR)/lib$(OSMESA_LIB).* $(INSTALL_DIR)/$(LIB_DIR); \ + fi @if [ "${DRIVER_DIRS}" = "dri" ] ; then \ diff --git a/debian/patches/series b/debian/patches/series index 6840f95c944..9616a12dfdc 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1 +1,2 @@ +00_create-libdir.patch 01_fix-makefile.patch diff --git a/debian/rules b/debian/rules index 966d25ed8b8..e2c8bbb941c 100755 --- a/debian/rules +++ b/debian/rules @@ -32,14 +32,19 @@ STAMPDIR = debian/stamp # build the following configurations CONFIGS = debian \ + debian-arch \ debian-dri \ - debian-osmesa \ debian-osmesa16 \ debian-osmesa16-static \ debian-osmesa32 \ debian-osmesa32-static \ debian-static +# Don't build architecture-dependent DRI drivers (yet) because it's probably +# not worth the effort. For benchmarking, include the following configuration +# in the list above. +#debian-dri-arch + STAMP = $(STAMPDIR)/$(DEB_BUILD_GNU_TYPE) BUILD_STAMPS = $(addprefix $(STAMP)-build-, $(CONFIGS)) INSTALL_STAMPS = $(addprefix $(STAMP)-install-, $(CONFIGS)) @@ -68,7 +73,7 @@ install: build pre-install $(INSTALL_STAMPS) $(STAMP)-install-%: $(STAMP)-build-% # Add here commands to install the package into debian/tmp - cd $(DEB_BUILD_DIR)/$* && $(MAKE) install INSTALL_DIR=$(CURDIR)/debian/tmp/usr + cd $(DEB_BUILD_DIR)/$* && $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp touch $@ clean: unpatch -- cgit v1.2.3 From 5bcfa4c85908474774b8537f379504fb8ad9a598 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Sun, 15 Oct 2006 13:30:22 +0000 Subject: Build only optimized versions of the DRI drivers, only using no optimizations when not supported. Add configuration to build the DRI drivers on amd64. --- configs/debian-dri | 9 --------- configs/debian-dri-amd64 | 9 +++++++++ configs/debian-dri-any | 8 +++++--- debian/rules | 7 +------ 4 files changed, 15 insertions(+), 18 deletions(-) delete mode 100644 configs/debian-dri create mode 100644 configs/debian-dri-amd64 (limited to 'debian') diff --git a/configs/debian-dri b/configs/debian-dri deleted file mode 100644 index 48d1fc6a4fb..00000000000 --- a/configs/debian-dri +++ /dev/null @@ -1,9 +0,0 @@ -# Configuration for building the DRI drivers on the build architecture. - -include $(TOP)/configs/debian-dri-default -include $(TOP)/configs/linux-dri - -CONFIG_NAME = debian-dri - -# vim: ft=make - diff --git a/configs/debian-dri-amd64 b/configs/debian-dri-amd64 new file mode 100644 index 00000000000..26cae1627ef --- /dev/null +++ b/configs/debian-dri-amd64 @@ -0,0 +1,9 @@ +# Configuration for building the DRI drivers on i386. + +include $(TOP)/configs/debian-dri-default +include $(TOP)/configs/linux-dri-x86-64 + +CONFIG_NAME = debian-dri-amd64 + +# vim: ft=make + diff --git a/configs/debian-dri-any b/configs/debian-dri-any index f6a33821bc1..48d1fc6a4fb 100644 --- a/configs/debian-dri-any +++ b/configs/debian-dri-any @@ -1,7 +1,9 @@ -# Chicken-out configuration for architectures where optimized builds are not -# supported. +# Configuration for building the DRI drivers on the build architecture. -CONFIG_NAME = debian-dri-any +include $(TOP)/configs/debian-dri-default +include $(TOP)/configs/linux-dri + +CONFIG_NAME = debian-dri # vim: ft=make diff --git a/debian/rules b/debian/rules index e2c8bbb941c..269e724bcee 100755 --- a/debian/rules +++ b/debian/rules @@ -33,18 +33,13 @@ STAMPDIR = debian/stamp # build the following configurations CONFIGS = debian \ debian-arch \ - debian-dri \ + debian-dri-arch \ debian-osmesa16 \ debian-osmesa16-static \ debian-osmesa32 \ debian-osmesa32-static \ debian-static -# Don't build architecture-dependent DRI drivers (yet) because it's probably -# not worth the effort. For benchmarking, include the following configuration -# in the list above. -#debian-dri-arch - STAMP = $(STAMPDIR)/$(DEB_BUILD_GNU_TYPE) BUILD_STAMPS = $(addprefix $(STAMP)-build-, $(CONFIGS)) INSTALL_STAMPS = $(addprefix $(STAMP)-install-, $(CONFIGS)) -- cgit v1.2.3 From 87744f786b52b0d238efcae7f481042f219a22c9 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Sun, 15 Oct 2006 14:41:12 +0000 Subject: Use STAMP_DIR consistently throughout the debian/rules file. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make the BUILD_STAMPS targets depend on patch so that when they are built separately the patches will also be applied. Thanks to Michel Dänzer for catching this. Make symlinking the source tree idempotent by adding the -f option to cp. Thanks again Michel Dänzer. --- debian/rules | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'debian') diff --git a/debian/rules b/debian/rules index 269e724bcee..b3b1e133ba4 100755 --- a/debian/rules +++ b/debian/rules @@ -9,7 +9,9 @@ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 -QUILT_STAMPFN ?= debian/stamp/patch +STAMP_DIR = debian/stamp + +QUILT_STAMPFN = $(STAMP_DIR)/patch include /usr/share/quilt/quilt.make CFLAGS = -Wall -g @@ -28,8 +30,6 @@ DEB_BUILD_DIR ?= $(CURDIR)/obj-$(DEB_BUILD_GNU_TYPE) export DEB_BUILD_ARCH -STAMPDIR = debian/stamp - # build the following configurations CONFIGS = debian \ debian-arch \ @@ -40,19 +40,22 @@ CONFIGS = debian \ debian-osmesa32-static \ debian-static -STAMP = $(STAMPDIR)/$(DEB_BUILD_GNU_TYPE) +STAMP = $(STAMP_DIR)/$(DEB_BUILD_GNU_TYPE) BUILD_STAMPS = $(addprefix $(STAMP)-build-, $(CONFIGS)) INSTALL_STAMPS = $(addprefix $(STAMP)-install-, $(CONFIGS)) -debian/stamp: +$(STAMP_DIR): dh_testdir - mkdir -p debian/stamp + mkdir -p $@ + +$(QUILT_STAMPFN): $(STAMP_DIR) -build: debian/stamp patch $(BUILD_STAMPS) -$(STAMP)-build-%: +build: $(BUILD_STAMPS) +$(STAMP)-build-%: patch dh_testdir mkdir -p $(DEB_BUILD_DIR)/$* - find $(CURDIR)/* -maxdepth 0 -not -path '$(DEB_BUILD_DIR)*' | xargs cp -rl -t $(DEB_BUILD_DIR)/$* + find $(CURDIR)/* -maxdepth 0 -not -path '$(DEB_BUILD_DIR)*' | \ + xargs cp -rlf -t $(DEB_BUILD_DIR)/$* ln -sf $* $(DEB_BUILD_DIR)/$*/configs/current cd $(DEB_BUILD_DIR)/$* && $(MAKE) touch $@ @@ -74,7 +77,7 @@ $(STAMP)-install-%: $(STAMP)-build-% clean: unpatch dh_testdir dh_testroot - rm -rf $(DEB_BUILD_DIR) debian/stamp + rm -rf $(DEB_BUILD_DIR) $(STAMP_DIR) dh_clean --exclude ./Makefile.orig --exclude configs/CVS/Root.bak # Build architecture-independent files here. -- cgit v1.2.3 From 84db6912f0866a2e3e4255001024ec2de78d7d27 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Sun, 15 Oct 2006 18:02:33 +0000 Subject: Add missing build-dependencies. --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'debian') diff --git a/debian/control b/debian/control index b24f7b6f928..a49a763fae5 100644 --- a/debian/control +++ b/debian/control @@ -4,7 +4,7 @@ Priority: optional Maintainer: Debian X Strike Force Uploaders: Thierry Reding Standards-Version: 3.7.2 -Build-Depends: debhelper (>= 5), quilt +Build-Depends: debhelper (>= 5), quilt (>= 0.40), pkg-config, libdrm-dev (>= 2.0.2) [!hurd-i386], libx11-dev, xutils-dev, x11proto-gl-dev (>= 1.4.8), libxxf86vm-dev, libexpat1-dev Package: libgl1-mesa-swx11 Section: libs -- cgit v1.2.3 From 55cf480c0b017e9ac7b1792cad64d89edcbe83ec Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Mon, 16 Oct 2006 08:58:05 +0000 Subject: Drop the libgl1-mesa-swx11-dbg package until there's a decision as to whether it is really needed. Allow more than one type of optimization libraries to be built for any given architecture. Currently optimization configurations are provided for i386 [i686], alpha [ev5], amd64, powerpc [603], ppc64 and sparc [ultrasparc]. However, only i686 and amd64 are enabled for now for safety. Add the libgl1-mesa-swx11-i686 for i686 optimized libraries. Drop the debian-common configuration because it is no longer used. Don't build libGLU in all configurations, only when needed. --- configs/debian | 9 ------- configs/debian-alpha | 9 ------- configs/debian-alpha-ev5 | 11 ++++++++ configs/debian-amd64 | 2 ++ configs/debian-common | 6 ----- configs/debian-default | 10 ++------ configs/debian-i386 | 13 ---------- configs/debian-i386-i686 | 12 +++++++++ configs/debian-osmesa | 2 -- configs/debian-osmesa16 | 2 -- configs/debian-osmesa16-static | 2 -- configs/debian-osmesa32 | 2 -- configs/debian-osmesa32-static | 2 -- configs/debian-powerpc | 9 ------- configs/debian-powerpc-603 | 11 ++++++++ configs/debian-ppc64 | 2 ++ configs/debian-sparc | 9 ------- configs/debian-sparc-ultrasparc | 11 ++++++++ configs/debian-swx11+glu | 11 ++++++++ debian/changelog | 5 ++-- debian/control | 37 +++++++++++++++++---------- debian/libgl1-mesa-swx11-dbg.install | 0 debian/libgl1-mesa-swx11-i686.install | 2 ++ debian/rules | 48 +++++++++++++++++++++++++++-------- 24 files changed, 128 insertions(+), 99 deletions(-) delete mode 100644 configs/debian delete mode 100644 configs/debian-alpha create mode 100644 configs/debian-alpha-ev5 delete mode 100644 configs/debian-common delete mode 100644 configs/debian-i386 create mode 100644 configs/debian-i386-i686 delete mode 100644 configs/debian-powerpc create mode 100644 configs/debian-powerpc-603 delete mode 100644 configs/debian-sparc create mode 100644 configs/debian-sparc-ultrasparc create mode 100644 configs/debian-swx11+glu delete mode 100644 debian/libgl1-mesa-swx11-dbg.install create mode 100644 debian/libgl1-mesa-swx11-i686.install (limited to 'debian') diff --git a/configs/debian b/configs/debian deleted file mode 100644 index 68b7a613288..00000000000 --- a/configs/debian +++ /dev/null @@ -1,9 +0,0 @@ -# Configuration for building Mesa on the build architecture. - -include $(TOP)/configs/debian-default -include $(TOP)/configs/linux - -CONFIG_NAME = debian - -# vim: ft=make - diff --git a/configs/debian-alpha b/configs/debian-alpha deleted file mode 100644 index 74df4e106bd..00000000000 --- a/configs/debian-alpha +++ /dev/null @@ -1,9 +0,0 @@ -# Configuration for building Mesa on alpha. - -include $(TOP)/configs/debian-default -include $(TOP)/configs/linux-alpha - -CONFIG_NAME = debian-alpha - -# vim: ft=make - diff --git a/configs/debian-alpha-ev5 b/configs/debian-alpha-ev5 new file mode 100644 index 00000000000..a7a79d18352 --- /dev/null +++ b/configs/debian-alpha-ev5 @@ -0,0 +1,11 @@ +# Configuration for building Mesa on alpha. + +include $(TOP)/configs/debian-default +include $(TOP)/configs/linux-alpha + +CONFIG_NAME = debian-alpha + +override LIB_DIR = lib/ev5/cmov + +# vim: ft=make + diff --git a/configs/debian-amd64 b/configs/debian-amd64 index de1e495dab9..74f815efbc1 100644 --- a/configs/debian-amd64 +++ b/configs/debian-amd64 @@ -5,5 +5,7 @@ include $(TOP)/configs/linux-x86-64 CONFIG_NAME = debian-amd64 +override LIB_DIR = lib64 + # vim: ft=make diff --git a/configs/debian-common b/configs/debian-common deleted file mode 100644 index 98796f6cf9f..00000000000 --- a/configs/debian-common +++ /dev/null @@ -1,6 +0,0 @@ -# Override defaults set by the Mesa configuration. - -CONFIG_NAME = debian-common - -# vim: ft=make - diff --git a/configs/debian-default b/configs/debian-default index 8ae6b10c681..4c2a09127cd 100644 --- a/configs/debian-default +++ b/configs/debian-default @@ -1,14 +1,8 @@ -# Debian-specific defaults for the default Mesa configuration. -# -# Yes, this is somewhat confusing: this is different from debian-common in -# that debian-common only sets general compilation flags while this file -# overrides the directories that are actually built by default. - -include $(TOP)/configs/debian-common +# Define Debian-specific defaults. CONFIG_NAME = debian-default -override SRC_DIRS = mesa glu +override SRC_DIRS = mesa override PROGRAM_DIRS = override INSTALL_DIR = $(DESTDIR)/usr diff --git a/configs/debian-i386 b/configs/debian-i386 deleted file mode 100644 index 9d56e4a4f4f..00000000000 --- a/configs/debian-i386 +++ /dev/null @@ -1,13 +0,0 @@ -# Configuration for building Mesa on i386. - -include $(TOP)/configs/debian-default -include $(TOP)/configs/linux-x86 - -CONFIG_NAME = debian-i386 - -OPT_FLAGS += -march=i686 - -override LIB_DIR = lib/i686/cmov - -# vim: ft=make - diff --git a/configs/debian-i386-i686 b/configs/debian-i386-i686 new file mode 100644 index 00000000000..35fe0b5b87f --- /dev/null +++ b/configs/debian-i386-i686 @@ -0,0 +1,12 @@ +# Configuration for building Mesa on i386. + +include $(TOP)/configs/debian-default +include $(TOP)/configs/linux-x86 + +CONFIG_NAME = debian-i386 + +override ARCH_FLAGS += -mcpu=i686 +override LIB_DIR = lib/i686/cmov + +# vim: ft=make + diff --git a/configs/debian-osmesa b/configs/debian-osmesa index ebace88c7b1..bfd55198c09 100644 --- a/configs/debian-osmesa +++ b/configs/debian-osmesa @@ -5,8 +5,6 @@ include $(TOP)/configs/linux-osmesa CONFIG_NAME = debian-osmesa -override SRC_DIRS = mesa - # vim: ft=make diff --git a/configs/debian-osmesa16 b/configs/debian-osmesa16 index bfe906ce160..b232e4e81a2 100644 --- a/configs/debian-osmesa16 +++ b/configs/debian-osmesa16 @@ -6,7 +6,5 @@ include $(TOP)/configs/linux-osmesa16 CONFIG_NAME = debian-osmesa16 -override SRC_DIRS = mesa - # vim: ft=make diff --git a/configs/debian-osmesa16-static b/configs/debian-osmesa16-static index 4d1cf89ce26..c3728fe7636 100644 --- a/configs/debian-osmesa16-static +++ b/configs/debian-osmesa16-static @@ -6,7 +6,5 @@ include $(TOP)/configs/linux-osmesa16-static CONFIG_NAME = debian-osmesa16-static -override SRC_DIRS = mesa - # vim: ft=make diff --git a/configs/debian-osmesa32 b/configs/debian-osmesa32 index 6ac31292c32..0cd0261ebe2 100644 --- a/configs/debian-osmesa32 +++ b/configs/debian-osmesa32 @@ -6,7 +6,5 @@ include $(TOP)/configs/linux-osmesa32 CONFIG_NAME = debian-osmesa32 -override SRC_DIRS = mesa - # vim: ft=make diff --git a/configs/debian-osmesa32-static b/configs/debian-osmesa32-static index 46fd1e4194f..2c210e05608 100644 --- a/configs/debian-osmesa32-static +++ b/configs/debian-osmesa32-static @@ -6,7 +6,5 @@ include $(TOP)/configs/linux-osmesa32-static CONFIG_NAME = debian-osmesa32-static -override SRC_DIRS = mesa - # vim: ft=make diff --git a/configs/debian-powerpc b/configs/debian-powerpc deleted file mode 100644 index b366d4a6fe2..00000000000 --- a/configs/debian-powerpc +++ /dev/null @@ -1,9 +0,0 @@ -# Configuration for building Mesa on powerpc. - -include $(TOP)/configs/debian-default -include $(TOP)/configs/linux-ppc - -CONFIG_NAME = debian-powerpc - -# vim: ft=make - diff --git a/configs/debian-powerpc-603 b/configs/debian-powerpc-603 new file mode 100644 index 00000000000..aaa7e588207 --- /dev/null +++ b/configs/debian-powerpc-603 @@ -0,0 +1,11 @@ +# Configuration for building Mesa on powerpc. + +include $(TOP)/configs/debian-default +include $(TOP)/configs/linux-ppc + +CONFIG_NAME = debian-powerpc + +override LIB_DIR = lib/603/cmov + +# vim: ft=make + diff --git a/configs/debian-ppc64 b/configs/debian-ppc64 index 3a44a6d8f40..69d2872f411 100644 --- a/configs/debian-ppc64 +++ b/configs/debian-ppc64 @@ -4,5 +4,7 @@ include $(TOP)/configs/debian-ppc CONFIG_NAME = debian-ppc64 +override LIB_DIR = lib64 + # vim: ft=make diff --git a/configs/debian-sparc b/configs/debian-sparc deleted file mode 100644 index 38c89372104..00000000000 --- a/configs/debian-sparc +++ /dev/null @@ -1,9 +0,0 @@ -# Configuration for building Mesa on sparc. - -include $(TOP)/configs/debian-default -include $(TOP)/configs/linux-sparc - -CONFIG_NAME = debian-sparc - -# vim: ft=make - diff --git a/configs/debian-sparc-ultrasparc b/configs/debian-sparc-ultrasparc new file mode 100644 index 00000000000..9832914e5ee --- /dev/null +++ b/configs/debian-sparc-ultrasparc @@ -0,0 +1,11 @@ +# Configuration for building Mesa on sparc. + +include $(TOP)/configs/debian-default +include $(TOP)/configs/linux-sparc + +CONFIG_NAME = debian-sparc + +override LIB_DIR = lib/ultrasparc/cmov + +# vim: ft=make + diff --git a/configs/debian-swx11+glu b/configs/debian-swx11+glu new file mode 100644 index 00000000000..86b7f013b16 --- /dev/null +++ b/configs/debian-swx11+glu @@ -0,0 +1,11 @@ +# Configuration for building Mesa (swx11 and GLU) on the build architecture. + +include $(TOP)/configs/debian-default +include $(TOP)/configs/linux + +CONFIG_NAME = debian + +override SRC_DIRS = mesa glu + +# vim: ft=make + diff --git a/debian/changelog b/debian/changelog index c6bfbcafd9e..450e0eecd28 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,7 @@ mesa (6.5.1-1) unstable; urgency=low - * + * Provide i686 optimized versions in libgl1-mesa-swx11-i686. + * No longer provide the libgl1-mesa-swx11-dbg package. - -- Thierry Reding Sat, 14 Oct 2006 02:09:50 +0200 + -- Thierry Reding Sun, 15 Oct 2006 19:21:13 +0200 diff --git a/debian/control b/debian/control index a49a763fae5..76b91d4c0c5 100644 --- a/debian/control +++ b/debian/control @@ -27,6 +27,30 @@ Description: A free implementation of the OpenGL API -- runtime . On Linux, this library is also known as libGL or libGL.so.1. +Package: libgl1-mesa-swx11-i686 +Section: libs +Priority: extra +Architecture: i386 +Pre-Depends: libgl1-mesa-swx11 +Description: A free implementation of the OpenGL API -- i686 optimized 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. + . + 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 Architecture: any @@ -48,19 +72,6 @@ Description: A free implementation of the OpenGL API -- development support file a direct rendering-capable library, or one which uses GLX. For that, please see libgl1-mesa-dev. -Package: libgl1-mesa-swx11-dbg -Section: libs -Architecture: any -Depends: ${shlibs:Depends} -Conflicts: libgl1-mesa-swrast-dbg -Replaces: libgl1-mesa-swrast-dbg -Provides: libgl1-mesa-swrast-dbg -Description: A free implementation of the OpenGL API -- debugging package - This package provides a debug-enabled version of the Mesa libraries. - . - For a complete description of Mesa, please look at the libgl1-mesa-swx11 - package. - Package: libgl1-mesa-glx Section: libs Architecture: any diff --git a/debian/libgl1-mesa-swx11-dbg.install b/debian/libgl1-mesa-swx11-dbg.install deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/debian/libgl1-mesa-swx11-i686.install b/debian/libgl1-mesa-swx11-i686.install new file mode 100644 index 00000000000..53b5801a8c2 --- /dev/null +++ b/debian/libgl1-mesa-swx11-i686.install @@ -0,0 +1,2 @@ +usr/lib/i686/cmov/libGL.so.* +usr/lib/i686/cmov/libOSMesa.* diff --git a/debian/rules b/debian/rules index b3b1e133ba4..c0b75b16511 100755 --- a/debian/rules +++ b/debian/rules @@ -1,10 +1,6 @@ #!/usr/bin/make -f -# -*- makefile -*- -# Sample debian/rules that uses debhelper. -# This file was originally written by Joey Hess and Craig Small. -# As a special exception, when this file is copied by dh-make into a -# dh-make output file, you may use that output file without restriction. -# This special exception was added by Craig Small in version 0.37 of dh-make. +# debian/rules for the Debian mesa package +# Copyright © 2006 Thierry Reding # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 @@ -31,8 +27,7 @@ DEB_BUILD_DIR ?= $(CURDIR)/obj-$(DEB_BUILD_GNU_TYPE) export DEB_BUILD_ARCH # build the following configurations -CONFIGS = debian \ - debian-arch \ +CONFIGS = debian-swx11+glu \ debian-dri-arch \ debian-osmesa16 \ debian-osmesa16-static \ @@ -40,6 +35,36 @@ CONFIGS = debian \ debian-osmesa32-static \ debian-static +# additional configurations optimized for CPU's supported by the build +# architecture +ifeq ($(DEB_BUILD_ARCH), i386) + CONFIGS += debian-i386-i686 +endif + +#ifeq ($(DEB_BUILD_ARCH), alpha) +# CONFIGS += debian-alpha-ev5 +#endif + +ifeq ($(DEB_BUILD_ARCH), amd64) + CONFIGS += debian-amd64 +endif + +#ifeq ($(DEB_BUILD_ARCH), powerpc) +# CONFIGS += debian-powerpc-603 +#endif + +#ifeq ($(DEB_BUILD_ARCH), ppc64) +# CONFIGS += debian-ppc64 +#endif + +#ifeq ($(DEB_BUILD_ARCH), sparc) +# CONFIGS += debian-sparc-ultrasparc +#endif + +# Use the following to automatically build all optimized configurations +# available for the build architecture. Use with caution =) +#CONFIGS += $(subst configs/,,$(wildcard configs/debian-$(DEB_BUILD_ARCH)*)) + STAMP = $(STAMP_DIR)/$(DEB_BUILD_GNU_TYPE) BUILD_STAMPS = $(addprefix $(STAMP)-build-, $(CONFIGS)) INSTALL_STAMPS = $(addprefix $(STAMP)-install-, $(CONFIGS)) @@ -50,7 +75,9 @@ $(STAMP_DIR): $(QUILT_STAMPFN): $(STAMP_DIR) + build: $(BUILD_STAMPS) + $(STAMP)-build-%: patch dh_testdir mkdir -p $(DEB_BUILD_DIR)/$* @@ -65,9 +92,8 @@ pre-install: dh_testroot dh_clean -k --exclude ./Makefile.orig --exclude configs/CVS/Root.bak rm -rf $(INSTALL_STAMPS) - dh_installdirs -install: build pre-install $(INSTALL_STAMPS) +install: pre-install $(INSTALL_STAMPS) $(STAMP)-install-%: $(STAMP)-build-% # Add here commands to install the package into debian/tmp @@ -77,8 +103,8 @@ $(STAMP)-install-%: $(STAMP)-build-% clean: unpatch dh_testdir dh_testroot - rm -rf $(DEB_BUILD_DIR) $(STAMP_DIR) dh_clean --exclude ./Makefile.orig --exclude configs/CVS/Root.bak + rm -rf $(DEB_BUILD_DIR) $(STAMP_DIR) # Build architecture-independent files here. binary-indep: build install -- cgit v1.2.3 From 1b0d29afbcfe8eeb1eca380b6bb6462c0eaa882c Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Mon, 16 Oct 2006 09:39:59 +0000 Subject: Rename the CPU optimization configurations to make it clear that they only build swx11 and GLU. Build architecture-optimized swx11 and GLU where possible. --- configs/debian-alpha-ev5 | 11 ----------- configs/debian-amd64 | 11 ----------- configs/debian-any | 7 ------- configs/debian-arch | 13 ------------- configs/debian-dri-any | 2 +- configs/debian-i386-i686 | 12 ------------ configs/debian-powerpc-603 | 11 ----------- configs/debian-ppc64 | 10 ---------- configs/debian-sparc-ultrasparc | 11 ----------- configs/debian-swx11+glu | 11 ----------- configs/debian-swx11+glu-alpha-ev5 | 11 +++++++++++ configs/debian-swx11+glu-amd64 | 10 ++++++++++ configs/debian-swx11+glu-any | 9 +++++++++ configs/debian-swx11+glu-arch | 15 +++++++++++++++ configs/debian-swx11+glu-i386 | 10 ++++++++++ configs/debian-swx11+glu-i386-i686 | 13 +++++++++++++ configs/debian-swx11+glu-powerpc-603 | 12 ++++++++++++ configs/debian-swx11+glu-ppc64 | 11 +++++++++++ configs/debian-swx11+glu-sparc | 10 ++++++++++ configs/debian-swx11+glu-sparc-ultrasparc | 12 ++++++++++++ debian/rules | 6 +----- 21 files changed, 115 insertions(+), 103 deletions(-) delete mode 100644 configs/debian-alpha-ev5 delete mode 100644 configs/debian-amd64 delete mode 100644 configs/debian-any delete mode 100644 configs/debian-arch delete mode 100644 configs/debian-i386-i686 delete mode 100644 configs/debian-powerpc-603 delete mode 100644 configs/debian-ppc64 delete mode 100644 configs/debian-sparc-ultrasparc delete mode 100644 configs/debian-swx11+glu create mode 100644 configs/debian-swx11+glu-alpha-ev5 create mode 100644 configs/debian-swx11+glu-amd64 create mode 100644 configs/debian-swx11+glu-any create mode 100644 configs/debian-swx11+glu-arch create mode 100644 configs/debian-swx11+glu-i386 create mode 100644 configs/debian-swx11+glu-i386-i686 create mode 100644 configs/debian-swx11+glu-powerpc-603 create mode 100644 configs/debian-swx11+glu-ppc64 create mode 100644 configs/debian-swx11+glu-sparc create mode 100644 configs/debian-swx11+glu-sparc-ultrasparc (limited to 'debian') diff --git a/configs/debian-alpha-ev5 b/configs/debian-alpha-ev5 deleted file mode 100644 index a7a79d18352..00000000000 --- a/configs/debian-alpha-ev5 +++ /dev/null @@ -1,11 +0,0 @@ -# Configuration for building Mesa on alpha. - -include $(TOP)/configs/debian-default -include $(TOP)/configs/linux-alpha - -CONFIG_NAME = debian-alpha - -override LIB_DIR = lib/ev5/cmov - -# vim: ft=make - diff --git a/configs/debian-amd64 b/configs/debian-amd64 deleted file mode 100644 index 74f815efbc1..00000000000 --- a/configs/debian-amd64 +++ /dev/null @@ -1,11 +0,0 @@ -# Configuration for building Mesa on amd64. - -include $(TOP)/configs/debian-default -include $(TOP)/configs/linux-x86-64 - -CONFIG_NAME = debian-amd64 - -override LIB_DIR = lib64 - -# vim: ft=make - diff --git a/configs/debian-any b/configs/debian-any deleted file mode 100644 index a2846015ba1..00000000000 --- a/configs/debian-any +++ /dev/null @@ -1,7 +0,0 @@ -# Chicken-out configuration for architectures where optimized builds are not -# supported. - -CONFIG_NAME = debian-any - -# vim: ft=make - diff --git a/configs/debian-arch b/configs/debian-arch deleted file mode 100644 index a39163d45d7..00000000000 --- a/configs/debian-arch +++ /dev/null @@ -1,13 +0,0 @@ -# Configuration for building a version of Mesa optimized for the build -# architecture. - -ifneq ($(wildcard $(TOP)/configs/debian-$(DEB_BUILD_ARCH)),) - include $(TOP)/configs/debian-$(DEB_BUILD_ARCH) -else - include $(TOP)/configs/debian-any -endif - -CONFIG_NAME = debian-arch - -# vim: ft=make - diff --git a/configs/debian-dri-any b/configs/debian-dri-any index 48d1fc6a4fb..6e888d52b72 100644 --- a/configs/debian-dri-any +++ b/configs/debian-dri-any @@ -3,7 +3,7 @@ include $(TOP)/configs/debian-dri-default include $(TOP)/configs/linux-dri -CONFIG_NAME = debian-dri +CONFIG_NAME = debian-dri-any # vim: ft=make diff --git a/configs/debian-i386-i686 b/configs/debian-i386-i686 deleted file mode 100644 index 35fe0b5b87f..00000000000 --- a/configs/debian-i386-i686 +++ /dev/null @@ -1,12 +0,0 @@ -# Configuration for building Mesa on i386. - -include $(TOP)/configs/debian-default -include $(TOP)/configs/linux-x86 - -CONFIG_NAME = debian-i386 - -override ARCH_FLAGS += -mcpu=i686 -override LIB_DIR = lib/i686/cmov - -# vim: ft=make - diff --git a/configs/debian-powerpc-603 b/configs/debian-powerpc-603 deleted file mode 100644 index aaa7e588207..00000000000 --- a/configs/debian-powerpc-603 +++ /dev/null @@ -1,11 +0,0 @@ -# Configuration for building Mesa on powerpc. - -include $(TOP)/configs/debian-default -include $(TOP)/configs/linux-ppc - -CONFIG_NAME = debian-powerpc - -override LIB_DIR = lib/603/cmov - -# vim: ft=make - diff --git a/configs/debian-ppc64 b/configs/debian-ppc64 deleted file mode 100644 index 69d2872f411..00000000000 --- a/configs/debian-ppc64 +++ /dev/null @@ -1,10 +0,0 @@ -# Configuration for building Mesa on ppc64. - -include $(TOP)/configs/debian-ppc - -CONFIG_NAME = debian-ppc64 - -override LIB_DIR = lib64 - -# vim: ft=make - diff --git a/configs/debian-sparc-ultrasparc b/configs/debian-sparc-ultrasparc deleted file mode 100644 index 9832914e5ee..00000000000 --- a/configs/debian-sparc-ultrasparc +++ /dev/null @@ -1,11 +0,0 @@ -# Configuration for building Mesa on sparc. - -include $(TOP)/configs/debian-default -include $(TOP)/configs/linux-sparc - -CONFIG_NAME = debian-sparc - -override LIB_DIR = lib/ultrasparc/cmov - -# vim: ft=make - diff --git a/configs/debian-swx11+glu b/configs/debian-swx11+glu deleted file mode 100644 index 86b7f013b16..00000000000 --- a/configs/debian-swx11+glu +++ /dev/null @@ -1,11 +0,0 @@ -# Configuration for building Mesa (swx11 and GLU) on the build architecture. - -include $(TOP)/configs/debian-default -include $(TOP)/configs/linux - -CONFIG_NAME = debian - -override SRC_DIRS = mesa glu - -# vim: ft=make - diff --git a/configs/debian-swx11+glu-alpha-ev5 b/configs/debian-swx11+glu-alpha-ev5 new file mode 100644 index 00000000000..dd20e9266af --- /dev/null +++ b/configs/debian-swx11+glu-alpha-ev5 @@ -0,0 +1,11 @@ +# Configuration for building Mesa (swx11 and GLU) on alpha (ev5 optimized). + +include $(TOP)/configs/debian-default +include $(TOP)/configs/linux-alpha + +CONFIG_NAME = debian-swx11+glu-alpha-ev5 + +override LIB_DIR = lib/ev5/cmov + +# vim: ft=make + diff --git a/configs/debian-swx11+glu-amd64 b/configs/debian-swx11+glu-amd64 new file mode 100644 index 00000000000..080af7c357e --- /dev/null +++ b/configs/debian-swx11+glu-amd64 @@ -0,0 +1,10 @@ +# Configuration for building Mesa (swx11 and GLU) with runtime-detected +# assembler optimizations on amd64. + +include $(TOP)/configs/debian-default +include $(TOP)/configs/linux-x86-64 + +CONFIG_NAME = debian-swx11+glu-amd64 + +# vim: ft=make + diff --git a/configs/debian-swx11+glu-any b/configs/debian-swx11+glu-any new file mode 100644 index 00000000000..1269656d3ec --- /dev/null +++ b/configs/debian-swx11+glu-any @@ -0,0 +1,9 @@ +# Configuration for building Mesa (swx11 and GLU) on the build architecture. + +include $(TOP)/configs/debian-default +include $(TOP)/configs/linux + +CONFIG_NAME = debian-swx11+glu-any + +# vim: ft=make + diff --git a/configs/debian-swx11+glu-arch b/configs/debian-swx11+glu-arch new file mode 100644 index 00000000000..3c02fbe5819 --- /dev/null +++ b/configs/debian-swx11+glu-arch @@ -0,0 +1,15 @@ +# Configuration for building a version of swx11 and libGLU optimized for the +# build architecture. + +ifneq ($(wildcard $(TOP)/configs/debian-swx11+glu-$(DEB_BUILD_ARCH)),) + include $(TOP)/configs/debian-swx11+glu-$(DEB_BUILD_ARCH) +else + include $(TOP)/configs/debian-swx11+glu-any +endif + +CONFIG_NAME = debian-swx11+glu-arch + +override SRC_DIRS = mesa glu + +# vim: ft=make + diff --git a/configs/debian-swx11+glu-i386 b/configs/debian-swx11+glu-i386 new file mode 100644 index 00000000000..22242254695 --- /dev/null +++ b/configs/debian-swx11+glu-i386 @@ -0,0 +1,10 @@ +# Configuration for building Mesa (swx11 and GLU) with runtime-detected +# assembler optimizations on i386. + +include $(TOP)/configs/debian-default +include $(TOP)/configs/linux-x86 + +CONFIG_NAME = debian-swx11+glu-i386 + +# vim: ft=make + diff --git a/configs/debian-swx11+glu-i386-i686 b/configs/debian-swx11+glu-i386-i686 new file mode 100644 index 00000000000..062079f0e08 --- /dev/null +++ b/configs/debian-swx11+glu-i386-i686 @@ -0,0 +1,13 @@ +# Configuration for building Mesa (swx11 and GLU) with runtime-detected +# assembler optimizations on i386 (i686 optimized). + +include $(TOP)/configs/debian-default +include $(TOP)/configs/linux-x86 + +CONFIG_NAME = debian-swx11+glu-i386-i686 + +override ARCH_FLAGS += -mcpu=i686 +override LIB_DIR = lib/i686/cmov + +# vim: ft=make + diff --git a/configs/debian-swx11+glu-powerpc-603 b/configs/debian-swx11+glu-powerpc-603 new file mode 100644 index 00000000000..a3cdaa9ab65 --- /dev/null +++ b/configs/debian-swx11+glu-powerpc-603 @@ -0,0 +1,12 @@ +# Configuration for building Mesa (swx11 and GLU) with runtime-detected +# assembler optimizations on powerpc (603 optimized). + +include $(TOP)/configs/debian-default +include $(TOP)/configs/linux-ppc + +CONFIG_NAME = debian-swx11+glu-powerpc-603 + +override LIB_DIR = lib/603/cmov + +# vim: ft=make + diff --git a/configs/debian-swx11+glu-ppc64 b/configs/debian-swx11+glu-ppc64 new file mode 100644 index 00000000000..77fa2994313 --- /dev/null +++ b/configs/debian-swx11+glu-ppc64 @@ -0,0 +1,11 @@ +# Configuration for building Mesa (swx11 and GLU) with runtime-detected +# assembler optimizations on ppc64. + +include $(TOP)/configs/debian-ppc + +CONFIG_NAME = debian-swx11+glu-ppc64 + +override LIB_DIR = lib64 + +# vim: ft=make + diff --git a/configs/debian-swx11+glu-sparc b/configs/debian-swx11+glu-sparc new file mode 100644 index 00000000000..db74ab4cf6d --- /dev/null +++ b/configs/debian-swx11+glu-sparc @@ -0,0 +1,10 @@ +# Configuration for building Mesa (swx11 and GLU) with runtime-detected +# assembler optimizations on sparc. + +include $(TOP)/configs/debian-default +include $(TOP)/configs/linux-sparc + +CONFIG_NAME = debian-swx11+glu-sparc + +# vim: ft=make + diff --git a/configs/debian-swx11+glu-sparc-ultrasparc b/configs/debian-swx11+glu-sparc-ultrasparc new file mode 100644 index 00000000000..3dd0d4e08b0 --- /dev/null +++ b/configs/debian-swx11+glu-sparc-ultrasparc @@ -0,0 +1,12 @@ +# Configuration for building Mesa (swx11 and GLU) with runtime-detected +# assembler optimizations on sparc (ultrasparc-optimized). + +include $(TOP)/configs/debian-default +include $(TOP)/configs/linux-ultrasparc + +CONFIG_NAME = debian-swx11+glu-sparc-ultrasparc + +override LIB_DIR = lib/ultrasparc/cmov + +# vim: ft=make + diff --git a/debian/rules b/debian/rules index c0b75b16511..6abe4968d05 100755 --- a/debian/rules +++ b/debian/rules @@ -27,7 +27,7 @@ DEB_BUILD_DIR ?= $(CURDIR)/obj-$(DEB_BUILD_GNU_TYPE) export DEB_BUILD_ARCH # build the following configurations -CONFIGS = debian-swx11+glu \ +CONFIGS = debian-swx11+glu-arch \ debian-dri-arch \ debian-osmesa16 \ debian-osmesa16-static \ @@ -45,10 +45,6 @@ endif # CONFIGS += debian-alpha-ev5 #endif -ifeq ($(DEB_BUILD_ARCH), amd64) - CONFIGS += debian-amd64 -endif - #ifeq ($(DEB_BUILD_ARCH), powerpc) # CONFIGS += debian-powerpc-603 #endif -- cgit v1.2.3 From 5cef6ca36a699a37d647da19b3d1746f1d6348c1 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Mon, 16 Oct 2006 10:03:32 +0000 Subject: Move the detection of architecture-specific configurations to the debian/rules file. Add the configs target to debian/rules for checking whether the correct configurations will be built. --- configs/debian-dri-arch | 13 ----------- configs/debian-swx11+glu-arch | 15 ------------- debian/rules | 52 ++++++++++++++++++++++++++++--------------- 3 files changed, 34 insertions(+), 46 deletions(-) delete mode 100644 configs/debian-dri-arch delete mode 100644 configs/debian-swx11+glu-arch (limited to 'debian') diff --git a/configs/debian-dri-arch b/configs/debian-dri-arch deleted file mode 100644 index b5785409359..00000000000 --- a/configs/debian-dri-arch +++ /dev/null @@ -1,13 +0,0 @@ -# Configuration for building a version of the DRI drivers optimized for the -# build architecture. - -ifneq ($(wildcard $(TOP)/configs/debian-dri-$(DEB_BUILD_ARCH)),) - include $(TOP)/configs/debian-dri-$(DEB_BUILD_ARCH) -else - include $(TOP)/configs/debian-dri-any -endif - -CONFIG_NAME = debian-dri-arch - -# vim: ft=make - diff --git a/configs/debian-swx11+glu-arch b/configs/debian-swx11+glu-arch deleted file mode 100644 index 3c02fbe5819..00000000000 --- a/configs/debian-swx11+glu-arch +++ /dev/null @@ -1,15 +0,0 @@ -# Configuration for building a version of swx11 and libGLU optimized for the -# build architecture. - -ifneq ($(wildcard $(TOP)/configs/debian-swx11+glu-$(DEB_BUILD_ARCH)),) - include $(TOP)/configs/debian-swx11+glu-$(DEB_BUILD_ARCH) -else - include $(TOP)/configs/debian-swx11+glu-any -endif - -CONFIG_NAME = debian-swx11+glu-arch - -override SRC_DIRS = mesa glu - -# vim: ft=make - diff --git a/debian/rules b/debian/rules index 6abe4968d05..ef8b0fa31f0 100755 --- a/debian/rules +++ b/debian/rules @@ -26,45 +26,61 @@ DEB_BUILD_DIR ?= $(CURDIR)/obj-$(DEB_BUILD_GNU_TYPE) export DEB_BUILD_ARCH -# build the following configurations -CONFIGS = debian-swx11+glu-arch \ - debian-dri-arch \ - debian-osmesa16 \ - debian-osmesa16-static \ - debian-osmesa32 \ - debian-osmesa32-static \ - debian-static +# choose an architecture-specific configuration for building swx11 and GLU if +# one 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 # additional configurations optimized for CPU's supported by the build # architecture ifeq ($(DEB_BUILD_ARCH), i386) - CONFIGS += debian-i386-i686 + SWX11_GLU_CONFIGS += debian-swx11+glu-i386-i686 endif #ifeq ($(DEB_BUILD_ARCH), alpha) -# CONFIGS += debian-alpha-ev5 +# SWX11_GLU_CONFIGS += debian-swx11+glu-alpha-ev5 #endif #ifeq ($(DEB_BUILD_ARCH), powerpc) -# CONFIGS += debian-powerpc-603 -#endif - -#ifeq ($(DEB_BUILD_ARCH), ppc64) -# CONFIGS += debian-ppc64 +# SWX11_GLU_CONFIGS += debian-swx11+glu-powerpc-603 #endif #ifeq ($(DEB_BUILD_ARCH), sparc) -# CONFIGS += debian-sparc-ultrasparc +# SWX11_GLU_CONFIGS += debian-swx11+glu-sparc-ultrasparc #endif # Use the following to automatically build all optimized configurations # available for the build architecture. Use with caution =) -#CONFIGS += $(subst configs/,,$(wildcard configs/debian-$(DEB_BUILD_ARCH)*)) +#SWX11_GLU_CONFIGS += $(subst configs/,,$(wildcard configs/debian-swx11+glu-$(DEB_BUILD_ARCH)-*)) + +# choose an architecture-specific configuration for building the DRI-enabled +# libGL if one exists +ifneq ($(wildcard configs/debian-dri-$(DEB_BUILD_ARCH)),) + DRI_CONFIGS := debian-dri-$(DEB_BUILD_ARCH) +else + DRI_CONFIGS := debian-dri-any +endif + +# build the following configurations by default +CONFIGS = $(SWX11_GLU_CONFIGS) \ + $(DRI_CONFIGS) \ + debian-osmesa16 \ + debian-osmesa16-static \ + debian-osmesa32 \ + debian-osmesa32-static \ + debian-static STAMP = $(STAMP_DIR)/$(DEB_BUILD_GNU_TYPE) BUILD_STAMPS = $(addprefix $(STAMP)-build-, $(CONFIGS)) INSTALL_STAMPS = $(addprefix $(STAMP)-install-, $(CONFIGS)) +# list the configurations that will built +configs: + @echo Building the following configurations: $(CONFIGS) + $(STAMP_DIR): dh_testdir mkdir -p $@ @@ -127,5 +143,5 @@ binary-arch: build install dh_builddeb binary: binary-indep binary-arch -.PHONY: build clean binary-indep binary-arch binary install configure +.PHONY: configs build clean binary-indep binary-arch binary install configure -- cgit v1.2.3 From eeca642778e290a94dc953827f93878dd86e11a2 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Mon, 16 Oct 2006 11:49:46 +0000 Subject: Add versioned build-dependency on dpkg-dev (>= 1.13.19) to make sure the binary:Version and source:Version substitution variables can be used. --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'debian') diff --git a/debian/control b/debian/control index 76b91d4c0c5..55053c8f20d 100644 --- a/debian/control +++ b/debian/control @@ -4,7 +4,7 @@ Priority: optional Maintainer: Debian X Strike Force Uploaders: Thierry Reding Standards-Version: 3.7.2 -Build-Depends: debhelper (>= 5), quilt (>= 0.40), pkg-config, libdrm-dev (>= 2.0.2) [!hurd-i386], libx11-dev, xutils-dev, x11proto-gl-dev (>= 1.4.8), libxxf86vm-dev, libexpat1-dev +Build-Depends: debhelper (>= 5), quilt (>= 0.40), pkg-config, libdrm-dev (>= 2.0.2) [!hurd-i386], libx11-dev, xutils-dev, x11proto-gl-dev (>= 1.4.8), libxxf86vm-dev, libexpat1-dev, dpkg-dev (>= 1.13.19) Package: libgl1-mesa-swx11 Section: libs -- cgit v1.2.3 From c9db617e0b1764271e8a48450b356577132a82a3 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Mon, 16 Oct 2006 13:04:29 +0000 Subject: Make the debian-static a subclass of debian-swx11+glu-default, because that's what it actually is. Rename it accordingly and add it to SWX11_GLU_CONFIGS. Install the libOSMesa.so symlink and the libOSMesa static library in the libgl1-mesa-swx11-dev package. Add .shlibs files for the libgl1-mesa-swx11, libgl1-mesa-glx and libglu1-mesa packages. --- configs/debian-static | 8 +++----- debian/libgl1-mesa-glx.shlibs | 1 + debian/libgl1-mesa-swx11-dev.install | 2 ++ debian/libgl1-mesa-swx11.shlibs | 2 ++ debian/libglu1-mesa.shlibs | 1 + debian/rules | 6 ++++-- 6 files changed, 13 insertions(+), 7 deletions(-) create mode 100644 debian/libgl1-mesa-glx.shlibs create mode 100644 debian/libgl1-mesa-swx11.shlibs create mode 100644 debian/libglu1-mesa.shlibs (limited to 'debian') diff --git a/configs/debian-static b/configs/debian-static index db8cb79b060..7e2d00cc9b6 100644 --- a/configs/debian-static +++ b/configs/debian-static @@ -1,11 +1,9 @@ -# Configuration for building static versions of the libraries. +# Configuration for building static versions of the libraries (swx11 and GLU). -include $(TOP)/configs/debian-default +include $(TOP)/configs/debian-swx11+glu-default include $(TOP)/configs/linux-static -CONFIG_NAME = debian-static - -override SRC_DIRS = mesa glu +CONFIG_NAME = debian-swx11+glu-static # vim: ft=make diff --git a/debian/libgl1-mesa-glx.shlibs b/debian/libgl1-mesa-glx.shlibs new file mode 100644 index 00000000000..b8e0fbaaaa5 --- /dev/null +++ b/debian/libgl1-mesa-glx.shlibs @@ -0,0 +1 @@ +libGL 1 libgl1-mesa-glx | libgl1 diff --git a/debian/libgl1-mesa-swx11-dev.install b/debian/libgl1-mesa-swx11-dev.install index 2258776adea..9944522595f 100644 --- a/debian/libgl1-mesa-swx11-dev.install +++ b/debian/libgl1-mesa-swx11-dev.install @@ -1,3 +1,5 @@ usr/include/GL/glx*.h usr/lib/libGL.a usr/lib/libGL.so +usr/lib/libOSMesa.a +usr/lib/libOSMesa.so diff --git a/debian/libgl1-mesa-swx11.shlibs b/debian/libgl1-mesa-swx11.shlibs new file mode 100644 index 00000000000..f4b6356179c --- /dev/null +++ b/debian/libgl1-mesa-swx11.shlibs @@ -0,0 +1,2 @@ +libGL 1 libgl1-mesa-glx | libgl1 +libOSMesa 6 libgl1-mesa-swx11 | libgl1-mesa-glide3 diff --git a/debian/libglu1-mesa.shlibs b/debian/libglu1-mesa.shlibs new file mode 100644 index 00000000000..647fc5be38a --- /dev/null +++ b/debian/libglu1-mesa.shlibs @@ -0,0 +1 @@ +libGLU 1 libglu1-mesa | libglu1 diff --git a/debian/rules b/debian/rules index ef8b0fa31f0..fbf328332e8 100755 --- a/debian/rules +++ b/debian/rules @@ -56,6 +56,9 @@ endif # available for the build architecture. Use with caution =) #SWX11_GLU_CONFIGS += $(subst configs/,,$(wildcard configs/debian-swx11+glu-$(DEB_BUILD_ARCH)-*)) +# build a static version of swx11 and GLU as well +SWX11_GLU_CONFIGS += debian-swx11+glu-static + # choose an architecture-specific configuration for building the DRI-enabled # libGL if one exists ifneq ($(wildcard configs/debian-dri-$(DEB_BUILD_ARCH)),) @@ -70,8 +73,7 @@ CONFIGS = $(SWX11_GLU_CONFIGS) \ debian-osmesa16 \ debian-osmesa16-static \ debian-osmesa32 \ - debian-osmesa32-static \ - debian-static + debian-osmesa32-static STAMP = $(STAMP_DIR)/$(DEB_BUILD_GNU_TYPE) BUILD_STAMPS = $(addprefix $(STAMP)-build-, $(CONFIGS)) -- cgit v1.2.3 From 65a324062f41bbc9baff9fc0e22e76e7047a034c Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Mon, 16 Oct 2006 13:05:42 +0000 Subject: Add patches extracted from older Debian diffs but not applied yet because it's not certain yet that they are needed. --- debian/patches/02_use-ieee-fp-on-s390-and-m64k.patch | 10 ++++++++++ .../patches/03_handle-sync-and-dont-unlock-display.patch | 15 +++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 debian/patches/02_use-ieee-fp-on-s390-and-m64k.patch create mode 100644 debian/patches/03_handle-sync-and-dont-unlock-display.patch (limited to 'debian') diff --git a/debian/patches/02_use-ieee-fp-on-s390-and-m64k.patch b/debian/patches/02_use-ieee-fp-on-s390-and-m64k.patch new file mode 100644 index 00000000000..2ca05adb61f --- /dev/null +++ b/debian/patches/02_use-ieee-fp-on-s390-and-m64k.patch @@ -0,0 +1,10 @@ +--- a/src/mesa/main/imports.h ++++ b/src/mesa/main/imports.h +@@ -153,6 +153,7 @@ + defined(__mips) || defined(_MIPS_ARCH) || \ + defined(__arm__) || \ + defined(__sh__) || defined(__m32r__) || \ ++ defined(__m68k__) || defined(__s390__) || \ + (defined(__alpha__) && (defined(__IEEE_FLOAT) || !defined(VMS))) + #define USE_IEEE + #define IEEE_ONE 0x3f800000 diff --git a/debian/patches/03_handle-sync-and-dont-unlock-display.patch b/debian/patches/03_handle-sync-and-dont-unlock-display.patch new file mode 100644 index 00000000000..c9089ef86ed --- /dev/null +++ b/debian/patches/03_handle-sync-and-dont-unlock-display.patch @@ -0,0 +1,15 @@ +--- a/src/glx/x11/glxext.c ++++ b/src/glx/x11/glxext.c +@@ -1016,11 +1016,11 @@ + if (!_XReply(dpy, (xReply*) &reply, 0, False)) { + /* Something is busted. Punt. */ + UnlockDisplay(dpy); ++ SyncHandle(); + FreeScreenConfigs(priv); + return GL_FALSE; + } + +- UnlockDisplay(dpy); + if (!reply.numVisuals) { + /* This screen does not support GL rendering */ + UnlockDisplay(dpy); -- cgit v1.2.3 From 1292ec1ecf6e413fc8fd43ccea9d12e274852312 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Mon, 16 Oct 2006 13:11:51 +0000 Subject: Fix typo in the filename of the IEEE FP on s390 and m68k patch. --- debian/patches/02_use-ieee-fp-on-s390-and-m64k.patch | 10 ---------- debian/patches/02_use-ieee-fp-on-s390-and-m68k.patch | 10 ++++++++++ 2 files changed, 10 insertions(+), 10 deletions(-) delete mode 100644 debian/patches/02_use-ieee-fp-on-s390-and-m64k.patch create mode 100644 debian/patches/02_use-ieee-fp-on-s390-and-m68k.patch (limited to 'debian') diff --git a/debian/patches/02_use-ieee-fp-on-s390-and-m64k.patch b/debian/patches/02_use-ieee-fp-on-s390-and-m64k.patch deleted file mode 100644 index 2ca05adb61f..00000000000 --- a/debian/patches/02_use-ieee-fp-on-s390-and-m64k.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/src/mesa/main/imports.h -+++ b/src/mesa/main/imports.h -@@ -153,6 +153,7 @@ - defined(__mips) || defined(_MIPS_ARCH) || \ - defined(__arm__) || \ - defined(__sh__) || defined(__m32r__) || \ -+ defined(__m68k__) || defined(__s390__) || \ - (defined(__alpha__) && (defined(__IEEE_FLOAT) || !defined(VMS))) - #define USE_IEEE - #define IEEE_ONE 0x3f800000 diff --git a/debian/patches/02_use-ieee-fp-on-s390-and-m68k.patch b/debian/patches/02_use-ieee-fp-on-s390-and-m68k.patch new file mode 100644 index 00000000000..2ca05adb61f --- /dev/null +++ b/debian/patches/02_use-ieee-fp-on-s390-and-m68k.patch @@ -0,0 +1,10 @@ +--- a/src/mesa/main/imports.h ++++ b/src/mesa/main/imports.h +@@ -153,6 +153,7 @@ + defined(__mips) || defined(_MIPS_ARCH) || \ + defined(__arm__) || \ + defined(__sh__) || defined(__m32r__) || \ ++ defined(__m68k__) || defined(__s390__) || \ + (defined(__alpha__) && (defined(__IEEE_FLOAT) || !defined(VMS))) + #define USE_IEEE + #define IEEE_ONE 0x3f800000 -- cgit v1.2.3 From 55ce23b8dbacd5a7d6587a94cc63da7846c5e7b8 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Mon, 16 Oct 2006 13:34:57 +0000 Subject: Beautify IEEE floating point patch. --- debian/patches/02_use-ieee-fp-on-s390-and-m68k.patch | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'debian') diff --git a/debian/patches/02_use-ieee-fp-on-s390-and-m68k.patch b/debian/patches/02_use-ieee-fp-on-s390-and-m68k.patch index 2ca05adb61f..3a06acd0ffe 100644 --- a/debian/patches/02_use-ieee-fp-on-s390-and-m68k.patch +++ b/debian/patches/02_use-ieee-fp-on-s390-and-m68k.patch @@ -1,10 +1,13 @@ --- a/src/mesa/main/imports.h +++ b/src/mesa/main/imports.h -@@ -153,6 +153,7 @@ +@@ -146,8 +146,9 @@ + *** 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(__amd64__) || \ ++ defined(__m68k__) || \ + defined(ia64) || defined(__ia64__) || \ + defined(__hppa__) || defined(hpux) || \ defined(__mips) || defined(_MIPS_ARCH) || \ - defined(__arm__) || \ - defined(__sh__) || defined(__m32r__) || \ -+ defined(__m68k__) || defined(__s390__) || \ - (defined(__alpha__) && (defined(__IEEE_FLOAT) || !defined(VMS))) - #define USE_IEEE - #define IEEE_ONE 0x3f800000 -- cgit v1.2.3 From ec916398e7cdc7ba9792062a1c6c8bca2528a169 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Mon, 16 Oct 2006 14:43:43 +0000 Subject: Don't install libOSMesa development files in the libgl1-mesa-swx11 package. --- debian/libgl1-mesa-swx11.install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'debian') diff --git a/debian/libgl1-mesa-swx11.install b/debian/libgl1-mesa-swx11.install index 26237d51434..0332c792336 100644 --- a/debian/libgl1-mesa-swx11.install +++ b/debian/libgl1-mesa-swx11.install @@ -1,2 +1,2 @@ usr/lib/libGL.so.* -usr/lib/libOSMesa.* +usr/lib/libOSMesa.so.* -- cgit v1.2.3 From 230e79916f877f87bcf7bc6b2a3eca014e54249d Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Tue, 17 Oct 2006 19:35:35 +0000 Subject: Merge in the old Debian changelog entries and the old copyright file. --- debian/changelog | 859 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ debian/copyright | 449 +++++++++++++++++++++++++++-- 2 files changed, 1289 insertions(+), 19 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 450e0eecd28..58ba6d49ea5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,3 +5,862 @@ mesa (6.5.1-1) unstable; urgency=low -- Thierry Reding Sun, 15 Oct 2006 19:21:13 +0200 +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 diff --git a/debian/copyright b/debian/copyright index 1a07b1d9247..03ac1d5b8c6 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,30 +1,441 @@ -This package was debianized by Thierry Reding on -Sat, 14 Oct 2006 02:01:12 +0200. +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://mesa3d.org/download.html. +It was downloaded from http://www.mesa3d.org/download.html -Upstream Author: Brian Paul +For more information see: + + http://www.mesa3d.org/ + +Copyright: + +Upstream Author: Brian Paul License: - Copyright (C) 1999-2005 Brian Paul All Rights Reserved. + 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 1.1 [02/22/2000]) + +1. Definitions. + +1.1. "Additional Notice Provisions" means such additional provisions as + appear in the Notice in Original Code under the heading "Additional + Notice Provisions." + +1.2. "Covered Code" means the Original Code or Modifications, or any + combination thereof. + +1.3. "Hardware" means any physical device that accepts input, processes + input, stores the results of processing, and/or provides output. + +1.4. "Larger Work" means a work that combines Covered Code or portions + thereof with code not governed by the terms of this License. + +1.5. "Licensable" means having the right to grant, to the maximum extent + possible, whether at the time of the initial grant or subsequently + acquired, any and all of the rights conveyed herein. + +1.6. "License" means this document. + +1.7. "Licensed Patents" means patent claims Licensable by SGI that are + infringed by the use or sale of Original Code or any Modifications + provided by SGI, or any combination thereof. + +1.8. "Modifications" means any addition to or deletion from the + substance or structure of the Original Code or any previous + Modifications. When Covered Code is released as a series of files, + a Modification is: + + A. Any addition to the contents of a file containing Original Code + and/or addition to or deletion from the contents of a file + containing previous Modifications. + + B. Any new file that contains any part of the Original Code or + previous Modifications. + +1.9. "Notice" means any notice in Original Code or Covered Code, as + required by and in compliance with this License. + +1.10. "Original Code" means source code of computer software code that + is described in the source code Notice required by Exhibit A as + Original Code, and updates and error corrections specifically + thereto. + +1.11. "Recipient" means an individual or a legal entity exercising + rights under, and complying with all of the terms of, this License + or a future version of this License issued under Section 8. For + legal entities, "Recipient" includes any entity that controls, is + controlled by, or is under common control with Recipient. For + purposes of this definition, "control" of an entity means (a) the + power, direct or indirect, to direct or manage such entity, or (b) + ownership of fifty percent (50%) or more of the outstanding shares + or beneficial ownership of such entity. + +1.12. "Recipient Patents" means patent claims Licensable by a Recipient + that are infringed by the use or sale of Original Code or any + Modifications provided by SGI, or any combination thereof. + +1.13. "SGI" means Silicon Graphics, Inc. + +1.14. "SGI Patents" means patent claims Licensable by SGI other than the + Licensed Patents. + +2. License Grant and Restrictions. + +2.1. SGI License Grant. Subject to the terms of this License and any + third party intellectual property claims, for the duration of + intellectual property protections inherent in the Original Code, + SGI hereby grants Recipient a worldwide, royalty-free, + non-exclusive license, to do the following: (i) under copyrights + Licensable by SGI, to reproduce, distribute, create derivative + works from, and, to the extent applicable, display and perform the + Original Code and/or any Modifications provided by SGI alone and/or + as part of a Larger Work; and (ii) under any Licensable Patents, to + make, have made, use, sell, offer for sale, import and/or otherwise + transfer the Original Code and/or any Modifications provided by + SGI. Recipient accepts the terms and conditions of this License by + undertaking any of the aforementioned actions. The patent license + shall apply to the Covered Code if, at the time any related + Modification is added, such addition of the Modification causes + such combination to be covered by the Licensed Patents. The patent + license in Section 2.1(ii) shall not apply to any other + combinations that include the Modification. No patent license is + provided under SGI Patents for infringements of SGI Patents by + Modifications not provided by SGI or combinations of Original Code + and Modifications not provided by SGI. + +2.2. Recipient License Grant. Subject to the terms of this License and + any third party intellectual property claims, Recipient hereby + grants SGI and any other Recipients a worldwide, royalty-free, + non-exclusive license, under any Recipient Patents, to make, have + made, use, sell, offer for sale, import and/or otherwise transfer + the Original Code and/or any Modifications provided by SGI. + +2.3. No License For Hardware Implementations. The licenses granted in + Section 2.1 and 2.2 are not applicable to implementation in + Hardware of the algorithms embodied in the Original Code or any + Modifications provided by SGI . + +3. Redistributions. + +3.1. Retention of Notice/Copy of License. The Notice set forth in + Exhibit A, below, must be conspicuously retained or included in any + and all redistributions of Covered Code. For distributions of the + Covered Code in source code form, the Notice must appear in every + file that can include a text comments field; in executable form, + the Notice and a copy of this License must appear in related + documentation or collateral where the Recipient’s rights relating + to Covered Code are described. Any Additional Notice Provisions + which actually appears in the Original Code must also be retained + or included in any and all redistributions of Covered Code. + +3.2. Alternative License. Provided that Recipient is in compliance with + the terms of this License, Recipient may, so long as without + derogation of any of SGI’s rights in and to the Original Code, + distribute the source code and/or executable version(s) of Covered + Code under (1) this License; (2) a license identical to this + License but for only such changes as are necessary in order to + clarify Recipient’s role as licensor of Modifications; and/or (3) a + license of Recipient’s choosing, containing terms different from + this License, provided that the license terms include this Section + 3 and Sections 4, 6, 7, 10, 12, and 13, which terms may not be + modified or superseded by any other terms of such license. If + Recipient elects to use any license other than this License, + Recipient must make it absolutely clear that any of its terms which + differ from this License are offered by Recipient alone, and not by + SGI. It is emphasized that this License is a limited license, and, + regardless of the license form employed by Recipient in accordance + with this Section 3.2, Recipient may relicense only such rights, in + Original Code and Modifications by SGI, as it has actually been + granted by SGI in this License. + +3.3. Indemnity. Recipient hereby agrees to indemnify SGI for any + liability incurred by SGI as a result of any such alternative + license terms Recipient offers. + +4. Termination. This License and the rights granted hereunder will + terminate automatically if Recipient breaches any term herein and + fails to cure such breach within 30 days thereof. Any sublicense to + the Covered Code that is properly granted shall survive any + termination of this License, absent termination by the terms of such + sublicense. Provisions that, by their nature, must remain in effect + beyond the termination of this License, shall survive. + +5. No Trademark Or Other Rights. This License does not grant any rights + to: (i) any software apart from the Covered Code, nor shall any + other rights or licenses not expressly granted hereunder arise by + implication, estoppel or otherwise with respect to the Covered Code; + (ii) any trade name, trademark or service mark whatsoever, including + without limitation any related right for purposes of endorsement or + promotion of products derived from the Covered Code, without prior + written permission of SGI; or (iii) any title to or ownership of the + Original Code, which shall at all times remains with SGI. All rights + in the Original Code not expressly granted under this License are + reserved. + +6. Compliance with Laws; Non-Infringement. There are various worldwide + laws, regulations, and executive orders applicable to dispositions + of Covered Code, including without limitation export, re-export, and + import control laws, regulations, and executive orders, of the U.S. + government and other countries, and Recipient is reminded it is + obliged to obey such laws, regulations, and executive orders. + Recipient may not distribute Covered Code that (i) in any way + infringes (directly or contributorily) any intellectual property + rights of any kind of any other person or entity or (ii) breaches + any representation or warranty, express, implied or statutory, to + which, under any applicable law, it might be deemed to have been + subject. + +7. Claims of Infringement. If Recipient learns of any third party claim + that any disposition of Covered Code and/or functionality wholly or + partially infringes the third party's intellectual property rights, + Recipient will promptly notify SGI of such claim. + +8. Versions of the License. SGI may publish revised and/or new versions + of the License from time to time, each with a distinguishing version + number. Once Covered Code has been published under a particular + version of the License, Recipient may, for the duration of the + license, continue to use it under the terms of that version, or + choose to use such Covered Code under the terms of any subsequent + version published by SGI. Subject to the provisions of Sections 3 + and 4 of this License, only SGI may modify the terms applicable to + Covered Code created under this License. + +9. DISCLAIMER OF WARRANTY. COVERED CODE IS PROVIDED "AS IS." ALL + EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ARE DISCLAIMED, + INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND CONDITIONS + OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR + PURPOSE, AND NON-INFRINGEMENT. SGI ASSUMES NO RISK AS TO THE QUALITY + AND PERFORMANCE OF THE SOFTWARE. SHOULD THE SOFTWARE PROVE DEFECTIVE + IN ANY RESPECT, SGI ASSUMES NO COST OR LIABILITY FOR SERVICING, + REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY IS AN ESSENTIAL + PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED + HEREUNDER EXCEPT SUBJECT TO THIS DISCLAIMER. + +10. LIMITATION OF LIABILITY. UNDER NO CIRCUMSTANCES NOR LEGAL THEORY, + WHETHER TORT (INCLUDING, WITHOUT LIMITATION, NEGLIGENCE OR STRICT + LIABILITY), CONTRACT, OR OTHERWISE, SHALL SGI OR ANY SGI LICENSOR + BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR + CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT + LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, LOSS OF + DATA, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER + COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN + INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF + LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY + RESULTING FROM SGI's NEGLIGENCE TO THE EXTENT APPLICABLE LAW + PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE + EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO + THAT EXCLUSION AND LIMITATION MAY NOT APPLY TO RECIPIENT. + +11. Indemnity. Recipient shall be solely responsible for damages + arising, directly or indirectly, out of its utilization of rights + under this License. Recipient will defend, indemnify and hold + harmless Silicon Graphics, Inc. from and against any loss, + liability, damages, costs or expenses (including the payment of + reasonable attorneys fees) arising out of Recipient's use, + modification, reproduction and distribution of the Covered Code or + out of any representation or warranty made by Recipient. + +12. U.S. Government End Users. The Covered Code is a "commercial item" + consisting of "commercial computer software" as such terms are + defined in title 48 of the Code of Federal Regulations and all U.S. + Government End Users acquire only the rights set forth in this + License and are subject to the terms of this License. + +13. Miscellaneous. This License represents the complete agreement + concerning the its subject matter. If any provision of this License + is held to be unenforceable, such provision shall be reformed so as + to achieve as nearly as possible the same legal and economic effect + as the original provision and the remainder of this License will + remain in effect. This License shall be governed by and construed + in accordance with the laws of the United States and the State of + California as applied to agreements entered into and to be + performed entirely within California between California residents. + Any litigation relating to this License shall be subject to the + exclusive jurisdiction of the Federal Courts of the Northern + District of California (or, absent subject matter jurisdiction in + such courts, the courts of the State of California), with venue + lying exclusively in Santa Clara County, California, with the + losing party responsible for costs, including without limitation, + court costs and reasonable attorneys fees and expenses. The + application of the United Nations Convention on Contracts for the + International Sale of Goods is expressly excluded. Any law or + regulation that provides that the language of a contract shall be + construed against the drafter shall not apply to this License. + +Exhibit A + +License Applicability. Except to the extent portions of this file are +made subject to an alternative license as permitted in the SGI Free +Software License B, Version 1.1 (the "License"), the contents of this +file are subject only to the provisions of the License. You may not use +this file except in compliance with the License. You may obtain a copy +of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 +Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: + +http://oss.sgi.com/projects/FreeB + +Note that, as provided in the License, the Software is distributed on an +"AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS +DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND +CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A +PARTICULAR PURPOSE, AND NON-INFRINGEMENT. + +Original Code. The Original Code is: [name of software, version number, +and release date], developed by Silicon Graphics, Inc. The Original Code +is Copyright (c) [dates of first publication, as appearing in the Notice +in the Original Code] Silicon Graphics, Inc. Copyright in any portions +created by third parties is as indicated elsewhere herein. All Rights +Reserved. + +Additional Notice Provisions: [such additional provisions, if any, as +appear in the Notice in the Original Code under the heading "Additional +Notice Provisions"] + +-------------------------------------------------------------------------- + +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 - 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: + RedBook demos progs/redbook/* SGI SGI MIT-style - 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. +On Debian systems the full text of the GNU LGPL license is found in +/usr/share/common-licenses/LGPL. ------------------------------------------------------------------------------ -- cgit v1.2.3 From f20ff6213eafb9f61d8e436d78a5c737e64dc6d5 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Fri, 20 Oct 2006 07:45:39 +0000 Subject: Add a shell script to install the Mesa sources for the mesa-swx11-source package. --- debian/scripts/install-source.sh | 43 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100755 debian/scripts/install-source.sh (limited to 'debian') diff --git a/debian/scripts/install-source.sh b/debian/scripts/install-source.sh new file mode 100755 index 00000000000..f8c92134888 --- /dev/null +++ b/debian/scripts/install-source.sh @@ -0,0 +1,43 @@ +#!/bin/sh + +if [ -n "$1" ]; then + TOP="$1" +else + TOP=`pwd` +fi + +SOURCE_DIRS=' + include/GL/internal + src/glx/x11 + src/mesa/array_cache + src/mesa/drivers/common + src/mesa/drivers/dri/common + src/mesa/drivers/dri/glcore + src/mesa/drivers/x11 + src/mesa/glapi + src/mesa/main + src/mesa/math + src/mesa/ppc + src/mesa/shader + src/mesa/sparc + src/mesa/swrast_setup + src/mesa/swrast + src/mesa/tnl_dd + src/mesa/tnl + src/mesa/x86-64 + src/mesa/x86 +' + +FILTER="-not -path '*/.svn*'" +TARGET=${TOP}/debian/tmp/usr/share/mesa-source + +( + find $SOURCE_DIRS $FILTER -name '*.[ch]'; + find include/GL $FILTER -name 'xmesa*.h'; +) | \ + while read x; do + DIRNAME=`dirname "$x"` + mkdir -p "$TARGET/$DIRNAME" + cp -lf "$x" "$TARGET/$DIRNAME" + done + -- cgit v1.2.3 From f069b2812e16da4eadbbbd1b088f1b590879e690 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Fri, 20 Oct 2006 07:47:37 +0000 Subject: Add a set of files to enable an i686 optimized build of the DRI/GLX-enabled libGL and the DRI drivers. Disabled for now. --- configs/debian-dri-i386-i686 | 14 ++++++++++++ debian/control | 44 ++++++++++++++++++++++++++++++++++++- debian/libgl1-mesa-dri-i686.install | 1 + debian/libgl1-mesa-glx-i686.install | 1 + 4 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 configs/debian-dri-i386-i686 create mode 100644 debian/libgl1-mesa-dri-i686.install create mode 100644 debian/libgl1-mesa-glx-i686.install (limited to 'debian') diff --git a/configs/debian-dri-i386-i686 b/configs/debian-dri-i386-i686 new file mode 100644 index 00000000000..02a0321abb9 --- /dev/null +++ b/configs/debian-dri-i386-i686 @@ -0,0 +1,14 @@ +# Configuration for building the DRI drivers on i386. + +include $(TOP)/configs/linux-dri-x86 +include $(TOP)/configs/debian-dri-default + +CONFIG_NAME = debian-dri-i386-i686 + +ARCH_FLAGS = -march=i686 +LIB_DIR = lib/glx/i686/cmov + +DRI_DRIVER_INSTALL_DIR = $(INSTALL_DIR)/lib/dri/i686/cmov + +# vim: ft=make + diff --git a/debian/control b/debian/control index 55053c8f20d..b3cce11ecba 100644 --- a/debian/control +++ b/debian/control @@ -32,7 +32,7 @@ Section: libs Priority: extra Architecture: i386 Pre-Depends: libgl1-mesa-swx11 -Description: A free implementation of the OpenGL API -- i686 optimized runtime +Description: A free implementation of the OpenGL API -- 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 @@ -90,6 +90,27 @@ Description: A free implementation of the OpenGL API -- GLX runtime For a complete description of Mesa, please look at the libgl1-mesa-swx11 package. +#Package: libgl1-mesa-glx-i686 +#Section: libs +#Priority: extra +#Architecture: 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 Architecture: any @@ -107,6 +128,27 @@ Description: A free implementation of the OpenGL API -- DRI modules For a complete description of Mesa, please look at the libgl1-mesa-swx11 package. +#Package: libgl1-mesa-dri-i686 +#Section: libs +#Priority: extra +#Architecture: 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: libs Architecture: any diff --git a/debian/libgl1-mesa-dri-i686.install b/debian/libgl1-mesa-dri-i686.install new file mode 100644 index 00000000000..44b5c55214d --- /dev/null +++ b/debian/libgl1-mesa-dri-i686.install @@ -0,0 +1 @@ +usr/lib/dri/i686/cmov/*.so diff --git a/debian/libgl1-mesa-glx-i686.install b/debian/libgl1-mesa-glx-i686.install new file mode 100644 index 00000000000..4c8ef3b34b6 --- /dev/null +++ b/debian/libgl1-mesa-glx-i686.install @@ -0,0 +1 @@ +usr/lib/glx/i686/cmov/libGL.so.* usr/lib/i686/cmov -- cgit v1.2.3 From c7e576d6bfccc23aa4b6cfed97e97befda714d00 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Fri, 20 Oct 2006 07:56:11 +0000 Subject: No longer install the default build of libOSMesa in the libgl1-mesa-swx11 package, but in the libosmesa6 package. Modify the 01_fix-makefile patch to not build libOSMesa on stand-alone builds, so that it is only created when building OSMesa explicitly. Build libOSMesa with 8 bits per color channel (the default) in dynamic and static versions separately from the software rasterization libGL with the software rasterization code linked in statically so that libOSMesa can run in parallel with any libGL. This should fix the problem Yann Dirson mentioned a while ago. Use the install-source.sh script to install the Mesa sources needed for the mesa-swx11-source package instead of doing it in the debian/rules file itself. --- debian/libgl1-mesa-swx11-dev.install | 2 -- debian/libgl1-mesa-swx11-i686.install | 1 - debian/libgl1-mesa-swx11.install | 1 - debian/libosmesa6-dev.install | 2 ++ debian/libosmesa6.install | 1 + debian/mesa-swx11-source.install | 1 + debian/patches/01_fix-makefile.patch | 15 +++++++++++++++ debian/rules | 33 +++++++++++++++++++++------------ 8 files changed, 40 insertions(+), 16 deletions(-) (limited to 'debian') diff --git a/debian/libgl1-mesa-swx11-dev.install b/debian/libgl1-mesa-swx11-dev.install index 9944522595f..2258776adea 100644 --- a/debian/libgl1-mesa-swx11-dev.install +++ b/debian/libgl1-mesa-swx11-dev.install @@ -1,5 +1,3 @@ usr/include/GL/glx*.h usr/lib/libGL.a usr/lib/libGL.so -usr/lib/libOSMesa.a -usr/lib/libOSMesa.so diff --git a/debian/libgl1-mesa-swx11-i686.install b/debian/libgl1-mesa-swx11-i686.install index 53b5801a8c2..2177b0cf15d 100644 --- a/debian/libgl1-mesa-swx11-i686.install +++ b/debian/libgl1-mesa-swx11-i686.install @@ -1,2 +1 @@ usr/lib/i686/cmov/libGL.so.* -usr/lib/i686/cmov/libOSMesa.* diff --git a/debian/libgl1-mesa-swx11.install b/debian/libgl1-mesa-swx11.install index 0332c792336..6d70d0f9f9a 100644 --- a/debian/libgl1-mesa-swx11.install +++ b/debian/libgl1-mesa-swx11.install @@ -1,2 +1 @@ usr/lib/libGL.so.* -usr/lib/libOSMesa.so.* diff --git a/debian/libosmesa6-dev.install b/debian/libosmesa6-dev.install index e92cc0d05bb..b2ccc6b08e6 100644 --- a/debian/libosmesa6-dev.install +++ b/debian/libosmesa6-dev.install @@ -1,3 +1,5 @@ +usr/lib/libOSMesa.a +usr/lib/libOSMesa.so usr/lib/libOSMesa16.a usr/lib/libOSMesa16.so usr/lib/libOSMesa32.a diff --git a/debian/libosmesa6.install b/debian/libosmesa6.install index dbf33f54a7d..d1e25b2ffeb 100644 --- a/debian/libosmesa6.install +++ b/debian/libosmesa6.install @@ -1,2 +1,3 @@ +usr/lib/libOSMesa.so.* usr/lib/libOSMesa16.so.* usr/lib/libOSMesa32.so.* diff --git a/debian/mesa-swx11-source.install b/debian/mesa-swx11-source.install index e69de29bb2d..e96b76cde29 100644 --- a/debian/mesa-swx11-source.install +++ b/debian/mesa-swx11-source.install @@ -0,0 +1 @@ +usr/share/mesa-source/* diff --git a/debian/patches/01_fix-makefile.patch b/debian/patches/01_fix-makefile.patch index 6f8ea18c658..e3cd732aa73 100644 --- a/debian/patches/01_fix-makefile.patch +++ b/debian/patches/01_fix-makefile.patch @@ -1,5 +1,20 @@ +Do not build OSMesa for a standalone configuration, since Debian only ships +OSMesa in a separate package. + +Fix Mesa makefile to install the libGL and libOSMesa libraries when they +exist, not only depending on configuration. + --- a/src/mesa/Makefile +++ b/src/mesa/Makefile +@@ -107,7 +107,7 @@ + $(OSMESA_DRIVER_OBJECTS) + + +-stand-alone: depend subdirs $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) $(TOP)/$(LIB_DIR)/$(OSMESA_LIB_NAME) ++stand-alone: depend subdirs $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) + + osmesa-only: depend subdirs $(TOP)/$(LIB_DIR)/$(OSMESA_LIB_NAME) + @@ -154,7 +154,12 @@ $(INSTALL) -d $(INSTALL_DIR)/include/GL $(INSTALL) -d $(INSTALL_DIR)/$(LIB_DIR) diff --git a/debian/rules b/debian/rules index fbf328332e8..342cd1316e9 100755 --- a/debian/rules +++ b/debian/rules @@ -34,10 +34,22 @@ else SWX11_GLU_CONFIGS := debian-swx11+glu-any endif +# build a static version of swx11 and GLU as well +SWX11_GLU_CONFIGS += debian-swx11+glu-static + +# choose an architecture-specific configuration for building the DRI-enabled +# libGL if one exists +ifneq ($(wildcard configs/debian-dri-$(DEB_BUILD_ARCH)),) + DRI_CONFIGS := debian-dri-$(DEB_BUILD_ARCH) +else + DRI_CONFIGS := debian-dri-any +endif + # additional configurations optimized for CPU's supported by the build # architecture ifeq ($(DEB_BUILD_ARCH), i386) SWX11_GLU_CONFIGS += debian-swx11+glu-i386-i686 +# DRI_CONFIGS += debian-dri-i386-i686 endif #ifeq ($(DEB_BUILD_ARCH), alpha) @@ -56,20 +68,11 @@ endif # available for the build architecture. Use with caution =) #SWX11_GLU_CONFIGS += $(subst configs/,,$(wildcard configs/debian-swx11+glu-$(DEB_BUILD_ARCH)-*)) -# build a static version of swx11 and GLU as well -SWX11_GLU_CONFIGS += debian-swx11+glu-static - -# choose an architecture-specific configuration for building the DRI-enabled -# libGL if one exists -ifneq ($(wildcard configs/debian-dri-$(DEB_BUILD_ARCH)),) - DRI_CONFIGS := debian-dri-$(DEB_BUILD_ARCH) -else - DRI_CONFIGS := debian-dri-any -endif - # build the following configurations by default CONFIGS = $(SWX11_GLU_CONFIGS) \ $(DRI_CONFIGS) \ + debian-osmesa \ + debian-osmesa-static \ debian-osmesa16 \ debian-osmesa16-static \ debian-osmesa32 \ @@ -77,7 +80,8 @@ CONFIGS = $(SWX11_GLU_CONFIGS) \ STAMP = $(STAMP_DIR)/$(DEB_BUILD_GNU_TYPE) BUILD_STAMPS = $(addprefix $(STAMP)-build-, $(CONFIGS)) -INSTALL_STAMPS = $(addprefix $(STAMP)-install-, $(CONFIGS)) +INSTALL_STAMPS = $(addprefix $(STAMP)-install-, $(CONFIGS)) \ + $(STAMP_DIR)/install-source # list the configurations that will built configs: @@ -114,6 +118,11 @@ $(STAMP)-install-%: $(STAMP)-build-% cd $(DEB_BUILD_DIR)/$* && $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp touch $@ +$(STAMP_DIR)/install-source: + # install Mesa source for mesa-swx11-source package + debian/scripts/install-source.sh + touch $@ + clean: unpatch dh_testdir dh_testroot -- cgit v1.2.3 From ae41f3a3ee89f43fc7987a450739f7757f81d9a6 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Fri, 20 Oct 2006 12:06:20 +0000 Subject: Don't make libgl1-mesa-swx11-dev depend on lesstif2-dev anymore because we don't ship anything related to LessTif in that package. --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'debian') diff --git a/debian/control b/debian/control index b3cce11ecba..05bffdd1c3a 100644 --- a/debian/control +++ b/debian/control @@ -54,7 +54,7 @@ Description: A free implementation of the OpenGL API -- runtime [i686 optimized] Package: libgl1-mesa-swx11-dev Section: libdevel Architecture: any -Depends: libgl1-mesa-swx11 (= ${binary:Version}), libc6-dev, libx11-dev | xlibs-dev (>> 4.1.0), libxext6 | xlibs (>> 4.1.0), mesa-common-dev (= ${source:Version}), lesstif2-dev +Depends: libgl1-mesa-swx11 (= ${binary:Version}), libc6-dev, libx11-dev | xlibs-dev (>> 4.1.0), libxext6 | xlibs (>> 4.1.0), mesa-common-dev (= ${source:Version}) Provides: libgl-dev, mesag3-widgets, mesag-widgets-dev, libglw-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 -- cgit v1.2.3 From ccffaef60361392807d2fefc1173bd2201febfbc Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Fri, 20 Oct 2006 12:15:29 +0000 Subject: Build architecture-specific static libraries where available. --- configs/debian-swx11+glu-static | 9 --------- configs/debian-swx11+glu-static-amd64 | 10 ++++++++++ configs/debian-swx11+glu-static-any | 10 ++++++++++ configs/debian-swx11+glu-static-i386 | 10 ++++++++++ configs/debian-swx11+glu-static-ppc64 | 11 +++++++++++ debian/rules | 19 +++++++++---------- 6 files changed, 50 insertions(+), 19 deletions(-) delete mode 100644 configs/debian-swx11+glu-static create mode 100644 configs/debian-swx11+glu-static-amd64 create mode 100644 configs/debian-swx11+glu-static-any create mode 100644 configs/debian-swx11+glu-static-i386 create mode 100644 configs/debian-swx11+glu-static-ppc64 (limited to 'debian') diff --git a/configs/debian-swx11+glu-static b/configs/debian-swx11+glu-static deleted file mode 100644 index a819311d4b4..00000000000 --- a/configs/debian-swx11+glu-static +++ /dev/null @@ -1,9 +0,0 @@ -# Configuration for building static versions of the libraries (swx11 and GLU). - -include $(TOP)/configs/linux-static -include $(TOP)/configs/debian-swx11+glu-default - -CONFIG_NAME = debian-swx11+glu-static - -# vim: ft=make - diff --git a/configs/debian-swx11+glu-static-amd64 b/configs/debian-swx11+glu-static-amd64 new file mode 100644 index 00000000000..2976fbe66f3 --- /dev/null +++ b/configs/debian-swx11+glu-static-amd64 @@ -0,0 +1,10 @@ +# Configuration for building static versions of the libraries (swx11 and GLU) +# on amd64. + +include $(TOP)/configs/linux-x86-64-static +include $(TOP)/configs/debian-swx11+glu-default + +CONFIG_NAME = debian-swx11+glu-static-amd64 + +# vim: ft=make + diff --git a/configs/debian-swx11+glu-static-any b/configs/debian-swx11+glu-static-any new file mode 100644 index 00000000000..82f794d28df --- /dev/null +++ b/configs/debian-swx11+glu-static-any @@ -0,0 +1,10 @@ +# Configuration for building static versions of the libraries (swx11 and GLU) +# on the build architecture. + +include $(TOP)/configs/linux-static +include $(TOP)/configs/debian-swx11+glu-default + +CONFIG_NAME = debian-swx11+glu-static-any + +# vim: ft=make + diff --git a/configs/debian-swx11+glu-static-i386 b/configs/debian-swx11+glu-static-i386 new file mode 100644 index 00000000000..62859e42548 --- /dev/null +++ b/configs/debian-swx11+glu-static-i386 @@ -0,0 +1,10 @@ +# Configuration for building static versions of the libraries (swx11 and GLU) +# on i386. + +include $(TOP)/configs/linux-x86-static +include $(TOP)/configs/debian-swx11+glu-default + +CONFIG_NAME = debian-swx11+glu-static-i386 + +# vim: ft=make + diff --git a/configs/debian-swx11+glu-static-ppc64 b/configs/debian-swx11+glu-static-ppc64 new file mode 100644 index 00000000000..a9ea4a95b31 --- /dev/null +++ b/configs/debian-swx11+glu-static-ppc64 @@ -0,0 +1,11 @@ +# Configuration for building static versions of the libraries (swx11 and GLU) +# on ppc64. + +include $(TOP)/configs/debian-swx11+glu-static-any + +CONFIG_NAME = debian-swx11+glu-static-ppc64 + +LIB_DIR = lib64 + +# vim: ft=make + diff --git a/debian/rules b/debian/rules index 342cd1316e9..02ecb099edc 100755 --- a/debian/rules +++ b/debian/rules @@ -26,19 +26,22 @@ DEB_BUILD_DIR ?= $(CURDIR)/obj-$(DEB_BUILD_GNU_TYPE) export DEB_BUILD_ARCH -# choose an architecture-specific configuration for building swx11 and GLU if -# one exists +# 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 -# build a static version of swx11 and GLU as well -SWX11_GLU_CONFIGS += debian-swx11+glu-static +# 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 -# choose an architecture-specific configuration for building the DRI-enabled -# libGL if one exists +# and for the GLX/DRI-enabled libGL ifneq ($(wildcard configs/debian-dri-$(DEB_BUILD_ARCH)),) DRI_CONFIGS := debian-dri-$(DEB_BUILD_ARCH) else @@ -64,10 +67,6 @@ endif # SWX11_GLU_CONFIGS += debian-swx11+glu-sparc-ultrasparc #endif -# Use the following to automatically build all optimized configurations -# available for the build architecture. Use with caution =) -#SWX11_GLU_CONFIGS += $(subst configs/,,$(wildcard configs/debian-swx11+glu-$(DEB_BUILD_ARCH)-*)) - # build the following configurations by default CONFIGS = $(SWX11_GLU_CONFIGS) \ $(DRI_CONFIGS) \ -- cgit v1.2.3 From ce5a39559e735ca254ff99dd84ed1bf316f4f144 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Fri, 20 Oct 2006 17:51:36 +0000 Subject: Install several documents from the docs subdirectory into the mesa-common-dev package. --- debian/mesa-common-dev.docs | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 debian/mesa-common-dev.docs (limited to 'debian') diff --git a/debian/mesa-common-dev.docs b/debian/mesa-common-dev.docs new file mode 100644 index 00000000000..457acbf84c4 --- /dev/null +++ b/debian/mesa-common-dev.docs @@ -0,0 +1,7 @@ +docs/bugs.html +docs/debugging.html +docs/envvars.html +docs/faq.html +docs/osmesa.html +docs/RELNOTES-* +docs/*.spec -- cgit v1.2.3 From b1630fcbe8dfda9f096c947f237c66227a3c2a65 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Fri, 20 Oct 2006 19:17:34 +0000 Subject: Add build-dependency on lesstif2-dev needed to build the GLw libraries. --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'debian') diff --git a/debian/control b/debian/control index 05bffdd1c3a..96f7a84f047 100644 --- a/debian/control +++ b/debian/control @@ -4,7 +4,7 @@ Priority: optional Maintainer: Debian X Strike Force Uploaders: Thierry Reding Standards-Version: 3.7.2 -Build-Depends: debhelper (>= 5), quilt (>= 0.40), pkg-config, libdrm-dev (>= 2.0.2) [!hurd-i386], libx11-dev, xutils-dev, x11proto-gl-dev (>= 1.4.8), libxxf86vm-dev, libexpat1-dev, dpkg-dev (>= 1.13.19) +Build-Depends: debhelper (>= 5), quilt (>= 0.40), pkg-config, libdrm-dev (>= 2.0.2) [!hurd-i386], libx11-dev, xutils-dev, x11proto-gl-dev (>= 1.4.8), libxxf86vm-dev, libexpat1-dev, lesstif2-dev, dpkg-dev (>= 1.13.19) Package: libgl1-mesa-swx11 Section: libs -- cgit v1.2.3 From 4e183c66e98860fb75fb08c931025f63ebf75867 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Fri, 20 Oct 2006 19:41:00 +0000 Subject: Add comments to patches and enable the previously disabled patches. --- debian/patches/00_create-libdir.patch | 6 ++++++ debian/patches/01_fix-makefile.patch | 3 +++ debian/patches/02_use-ieee-fp-on-s390-and-m68k.patch | 4 ++++ debian/patches/03_handle-sync-and-dont-unlock-display.patch | 5 +++++ debian/patches/series | 2 ++ 5 files changed, 20 insertions(+) (limited to 'debian') diff --git a/debian/patches/00_create-libdir.patch b/debian/patches/00_create-libdir.patch index 99f02f7bdc1..cc59325ac74 100644 --- a/debian/patches/00_create-libdir.patch +++ b/debian/patches/00_create-libdir.patch @@ -1,3 +1,9 @@ +Patch that allows the Mesa makefile to create a LIB_DIR that is more than one +level below TOP. + +This patch by Thierry Reding. +Not submitted to Mesa. + --- a/src/Makefile +++ b/src/Makefile @@ -29,7 +29,7 @@ diff --git a/debian/patches/01_fix-makefile.patch b/debian/patches/01_fix-makefile.patch index e3cd732aa73..f599d8438e1 100644 --- a/debian/patches/01_fix-makefile.patch +++ b/debian/patches/01_fix-makefile.patch @@ -4,6 +4,9 @@ OSMesa in a separate package. Fix Mesa makefile to install the libGL and libOSMesa libraries when they exist, not only depending on configuration. +This patch by Thierry Reding. +Hunk #2 submitted to Mesa and applied (post 6.5.1). + --- a/src/mesa/Makefile +++ b/src/mesa/Makefile @@ -107,7 +107,7 @@ diff --git a/debian/patches/02_use-ieee-fp-on-s390-and-m68k.patch b/debian/patches/02_use-ieee-fp-on-s390-and-m68k.patch index 3a06acd0ffe..d219de8f267 100644 --- a/debian/patches/02_use-ieee-fp-on-s390-and-m68k.patch +++ b/debian/patches/02_use-ieee-fp-on-s390-and-m68k.patch @@ -1,3 +1,7 @@ +Patch that fixes Debian bug #349437. + +This patch by David Nusinow. + --- a/src/mesa/main/imports.h +++ b/src/mesa/main/imports.h @@ -146,8 +146,9 @@ diff --git a/debian/patches/03_handle-sync-and-dont-unlock-display.patch b/debian/patches/03_handle-sync-and-dont-unlock-display.patch index c9089ef86ed..d29769e4330 100644 --- a/debian/patches/03_handle-sync-and-dont-unlock-display.patch +++ b/debian/patches/03_handle-sync-and-dont-unlock-display.patch @@ -1,3 +1,8 @@ +Patch that fixes Debian bug #391681. + +This patch by Josh Triplett. +Submitted to Mesa and applied (post 6.5.1). + --- a/src/glx/x11/glxext.c +++ b/src/glx/x11/glxext.c @@ -1016,11 +1016,11 @@ diff --git a/debian/patches/series b/debian/patches/series index 9616a12dfdc..31078561786 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,2 +1,4 @@ 00_create-libdir.patch 01_fix-makefile.patch +02_use-ieee-fp-on-s390-and-m68k.patch +03_handle-sync-and-dont-unlock-display.patch -- cgit v1.2.3 From 9d914e68097d6f6c80324dee64d55ce6b7fe0004 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Fri, 20 Oct 2006 20:56:41 +0000 Subject: Make sure the install-source.sh script is executable before trying to run it. --- debian/rules | 1 + 1 file changed, 1 insertion(+) (limited to 'debian') diff --git a/debian/rules b/debian/rules index 02ecb099edc..0747f86049b 100755 --- a/debian/rules +++ b/debian/rules @@ -119,6 +119,7 @@ $(STAMP)-install-%: $(STAMP)-build-% $(STAMP_DIR)/install-source: # install Mesa source for mesa-swx11-source package + chmod a+x debian/scripts/install-source.sh debian/scripts/install-source.sh touch $@ -- cgit v1.2.3 From b6e637106f50752eca75e8642841667c3a7010ac Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Mon, 23 Oct 2006 08:23:27 +0000 Subject: Add the static libGLw and the corresponding headers to the libgl1-mesa-swx11-dev package again. --- debian/libgl1-mesa-swx11-dev.install | 2 ++ 1 file changed, 2 insertions(+) (limited to 'debian') diff --git a/debian/libgl1-mesa-swx11-dev.install b/debian/libgl1-mesa-swx11-dev.install index 2258776adea..d61e4be70e8 100644 --- a/debian/libgl1-mesa-swx11-dev.install +++ b/debian/libgl1-mesa-swx11-dev.install @@ -1,3 +1,5 @@ usr/include/GL/glx*.h +usr/include/GL/GLw*A.h usr/lib/libGL.a usr/lib/libGL.so +usr/lib/libGLw.a -- cgit v1.2.3 From c46becc9b390caeec516c5fe253a9893e74ffc0c Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Mon, 23 Oct 2006 08:30:53 +0000 Subject: Move the libOSMesa shlibs entry from libgl1-mesa-swx11 to libosmesa6 because that's where libOSMesa is now installed. --- debian/libgl1-mesa-swx11.shlibs | 1 - debian/libosmesa6.shlibs | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 debian/libosmesa6.shlibs (limited to 'debian') diff --git a/debian/libgl1-mesa-swx11.shlibs b/debian/libgl1-mesa-swx11.shlibs index f4b6356179c..b8e0fbaaaa5 100644 --- a/debian/libgl1-mesa-swx11.shlibs +++ b/debian/libgl1-mesa-swx11.shlibs @@ -1,2 +1 @@ libGL 1 libgl1-mesa-glx | libgl1 -libOSMesa 6 libgl1-mesa-swx11 | libgl1-mesa-glide3 diff --git a/debian/libosmesa6.shlibs b/debian/libosmesa6.shlibs new file mode 100644 index 00000000000..f4d3f753196 --- /dev/null +++ b/debian/libosmesa6.shlibs @@ -0,0 +1 @@ +libOSMesa 6 libosmesa6 | libgl1-mesa-glide3 -- cgit v1.2.3 From 910c32c0e9610d8bd6d6cf2ba64e4b7d9fe59bcf Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Mon, 23 Oct 2006 16:02:22 +0000 Subject: Install the osmesa.h header in the libosmesa6-dev package where it belongs, now that all OSMesa libraries have been split off into libosmesa6{,-dev}. Don't make libosmesa6-dev depend on libgl1-mesa-swx11-dev anymore because it no longer needs a libGL, only the gl.h header provided by mesa-common-dev. --- debian/changelog | 6 +++++- debian/control | 2 +- debian/libosmesa6-dev.install | 1 + debian/mesa-common-dev.install | 1 - 4 files changed, 7 insertions(+), 3 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 58ba6d49ea5..bd56faefb6f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,8 +2,12 @@ mesa (6.5.1-1) unstable; urgency=low * Provide i686 optimized versions in libgl1-mesa-swx11-i686. * No longer provide the libgl1-mesa-swx11-dbg package. + * Statically link libOSMesa with the software rasterization code from libGL + so that it works independently of the installed libGL. + * Make libosmesa6-dev depend on mesa-common-dev because it only needs the + gl.h header file and no libGL anymore. - -- Thierry Reding Sun, 15 Oct 2006 19:21:13 +0200 + -- Thierry Reding Mon, 23 Oct 2006 17:57:01 +0200 mesa (6.5.1-0.2) unstable; urgency=low diff --git a/debian/control b/debian/control index 96f7a84f047..ed185017a76 100644 --- a/debian/control +++ b/debian/control @@ -191,7 +191,7 @@ Description: Mesa Off-screen rendering extension Package: libosmesa6-dev Section: devel Architecture: any -Depends: libosmesa6 (= ${binary:Version}), libgl1-mesa-swx11-dev (= ${binary:Version}) +Depends: libosmesa6 (= ${binary:Version}), mesa-common-dev (= ${binary:Version}) Conflicts: xlibosmesa-dev, libosmesa4-dev, libosmesa-dev Replaces: xlibosmesa-dev, libosmesa-dev Provides: xlibosmesa-dev, libosmesa-dev diff --git a/debian/libosmesa6-dev.install b/debian/libosmesa6-dev.install index b2ccc6b08e6..149a1bd7891 100644 --- a/debian/libosmesa6-dev.install +++ b/debian/libosmesa6-dev.install @@ -1,3 +1,4 @@ +usr/include/GL/osmesa.h usr/lib/libOSMesa.a usr/lib/libOSMesa.so usr/lib/libOSMesa16.a diff --git a/debian/mesa-common-dev.install b/debian/mesa-common-dev.install index 7c104927712..40b38f55cb6 100644 --- a/debian/mesa-common-dev.install +++ b/debian/mesa-common-dev.install @@ -1,4 +1,3 @@ usr/include/GL/gl.h usr/include/GL/glext.h -usr/include/GL/osmesa.h usr/include/GL/gl_mangle.h -- cgit v1.2.3 From b57341a78b630e93e649ad83e548f2f3ceae29fb Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Mon, 23 Oct 2006 16:43:41 +0000 Subject: Move the glx*.h headers from libgl1-mesa(-swx11)-dev into mesa-common-dev because both packages provide identical files. --- debian/changelog | 4 +++- debian/libgl1-mesa-dev.install | 1 - debian/libgl1-mesa-swx11-dev.install | 1 - debian/mesa-common-dev.install | 1 + 4 files changed, 4 insertions(+), 3 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index bd56faefb6f..156b60349da 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,8 +6,10 @@ mesa (6.5.1-1) unstable; urgency=low so that it works independently of the installed libGL. * 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. - -- Thierry Reding Mon, 23 Oct 2006 17:57:01 +0200 + -- Thierry Reding Mon, 23 Oct 2006 18:42:47 +0200 mesa (6.5.1-0.2) unstable; urgency=low diff --git a/debian/libgl1-mesa-dev.install b/debian/libgl1-mesa-dev.install index c892278267c..e1d3bffe3d7 100644 --- a/debian/libgl1-mesa-dev.install +++ b/debian/libgl1-mesa-dev.install @@ -1,2 +1 @@ -usr/include/GL/glx*.h usr/lib/libGL.so diff --git a/debian/libgl1-mesa-swx11-dev.install b/debian/libgl1-mesa-swx11-dev.install index d61e4be70e8..86f5b3e4cb1 100644 --- a/debian/libgl1-mesa-swx11-dev.install +++ b/debian/libgl1-mesa-swx11-dev.install @@ -1,4 +1,3 @@ -usr/include/GL/glx*.h usr/include/GL/GLw*A.h usr/lib/libGL.a usr/lib/libGL.so diff --git a/debian/mesa-common-dev.install b/debian/mesa-common-dev.install index 40b38f55cb6..487825f8eb6 100644 --- a/debian/mesa-common-dev.install +++ b/debian/mesa-common-dev.install @@ -1,3 +1,4 @@ usr/include/GL/gl.h usr/include/GL/glext.h usr/include/GL/gl_mangle.h +usr/include/GL/glx*.h -- cgit v1.2.3 From 5e38f566f2c642a6a8feab5cb0f007cb0be49d04 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Mon, 23 Oct 2006 16:45:00 +0000 Subject: Provide libgl-dev as alternative to the mesa-common-dev dependency of the libosmesa6-dev package. --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'debian') diff --git a/debian/control b/debian/control index ed185017a76..c3841bbef7e 100644 --- a/debian/control +++ b/debian/control @@ -191,7 +191,7 @@ Description: Mesa Off-screen rendering extension Package: libosmesa6-dev Section: devel Architecture: any -Depends: libosmesa6 (= ${binary:Version}), mesa-common-dev (= ${binary:Version}) +Depends: libosmesa6 (= ${binary:Version}), mesa-common-dev (= ${binary:Version}) | libgl-dev Conflicts: xlibosmesa-dev, libosmesa4-dev, libosmesa-dev Replaces: xlibosmesa-dev, libosmesa-dev Provides: xlibosmesa-dev, libosmesa-dev -- cgit v1.2.3 From 9d74c1ef2a2a17dda25b345d0ed527971d7eff28 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Tue, 24 Oct 2006 10:31:28 +0000 Subject: -fno-strict-aliasing actually *does* fix #394311 according to the submitter. --- debian/changelog | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 156b60349da..3489f074543 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,8 +8,9 @@ mesa (6.5.1-1) unstable; urgency=low 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. + * Build with -fno-strict-aliasing. (Closes: #394311) - -- Thierry Reding Mon, 23 Oct 2006 18:42:47 +0200 + -- Thierry Reding Tue, 24 Oct 2006 12:29:27 +0200 mesa (6.5.1-0.2) unstable; urgency=low -- cgit v1.2.3 From 83def94db5ccd1be0e24135a450d0d900aef9faf Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Tue, 24 Oct 2006 12:16:16 +0000 Subject: Make libgl1-mesa-dev Architecture: all, because all we ship with it is a symbolic link. Make it binNMU-safe by making it depend on libgl1-mesa-glx and libgl1-mesa-dri both >= ${Source-Version} instead of exact versions. Add packages containing debugging symbols for libgl1-mesa-swx11, libgl1-mesa-glx and libgl1-mesa-dri. --- debian/changelog | 4 +++- debian/control | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-- debian/rules | 3 +++ 3 files changed, 67 insertions(+), 3 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 3489f074543..f055caf3b15 100644 --- a/debian/changelog +++ b/debian/changelog @@ -9,8 +9,10 @@ mesa (6.5.1-1) unstable; urgency=low * Move glx*.h headers from libgl1-mesa(-swx11)-dev into mesa-common-dev because both packages provide identical files. * Build with -fno-strict-aliasing. (Closes: #394311) + * Add debugging symbol packages for libgl1-mesa-swx11, libgl1-mesa-glx and + libgl1-mesa-dri. - -- Thierry Reding Tue, 24 Oct 2006 12:29:27 +0200 + -- Thierry Reding Tue, 24 Oct 2006 14:13:01 +0200 mesa (6.5.1-0.2) unstable; urgency=low diff --git a/debian/control b/debian/control index c3841bbef7e..a010d4bac56 100644 --- a/debian/control +++ b/debian/control @@ -27,6 +27,30 @@ Description: A free implementation of the OpenGL API -- runtime . On Linux, this library is also known as libGL or libGL.so.1. +Package: libgl1-mesa-swx11-dbg +Section: libs +Priority: extra +Architecture: any +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 @@ -90,6 +114,24 @@ Description: A free implementation of the OpenGL API -- GLX runtime For a complete description of Mesa, please look at the libgl1-mesa-swx11 package. +Package: libgl1-mesa-glx-dbg +Section: libs +Priority: extra +Architecture: any +Description: A free implementation of the OpenGL API -- GLX runtime -- debugging symbols + 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 @@ -128,6 +170,23 @@ Description: A free implementation of the OpenGL API -- DRI modules For a complete description of Mesa, please look at the libgl1-mesa-swx11 package. +Package: libgl1-mesa-dri-dbg +Section: libs +Priority: extra +Architecture: any +Description: A free implementation of the OpenGL API -- DRI modules -- debugging symbols + 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-i686 #Section: libs #Priority: extra @@ -151,8 +210,8 @@ Description: A free implementation of the OpenGL API -- DRI modules Package: libgl1-mesa-dev Section: libs -Architecture: any -Depends: libc6-dev, mesa-common-dev (= ${source:Version}), libgl1-mesa-glx (=${binary:Version}), libgl1-mesa-dri (= ${binary:Version}) +Architecture: all +Depends: libc6-dev, mesa-common-dev (= ${source:Version}), libgl1-mesa-glx (>= ${Source-Version}), libgl1-mesa-dri (>= ${Source-Version}) Conflicts: libgl-dev, libgl1-mesa-dri-dev Replaces: libgl-dev, libgl1-mesa-dri-dev Provides: libgl-dev, libgl1-mesa-dri-dev diff --git a/debian/rules b/debian/rules index 0747f86049b..adcf06f183d 100755 --- a/debian/rules +++ b/debian/rules @@ -143,6 +143,9 @@ binary-arch: build install dh_install --sourcedir=debian/tmp --list-missing dh_installman dh_link + 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 dh_compress dh_fixperms -- cgit v1.2.3 From 4e5d870f72d5f612cc2fecd50fdb131fe591bd4e Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Tue, 24 Oct 2006 14:29:11 +0000 Subject: Make libosmesa6-dev binNMU-safe again (mesa-common-dev is Architecture: all). --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'debian') diff --git a/debian/control b/debian/control index a010d4bac56..c14f638762d 100644 --- a/debian/control +++ b/debian/control @@ -250,7 +250,7 @@ Description: Mesa Off-screen rendering extension Package: libosmesa6-dev Section: devel Architecture: any -Depends: libosmesa6 (= ${binary:Version}), mesa-common-dev (= ${binary:Version}) | libgl-dev +Depends: libosmesa6 (= ${binary:Version}), mesa-common-dev (= ${source:Version}) | libgl-dev Conflicts: xlibosmesa-dev, libosmesa4-dev, libosmesa-dev Replaces: xlibosmesa-dev, libosmesa-dev Provides: xlibosmesa-dev, libosmesa-dev -- cgit v1.2.3 From 35bc4b82ff1605358a7b666c5383ce911853969e Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Tue, 24 Oct 2006 14:33:30 +0000 Subject: Since the original tarball is repackaged to include the three upstream tarballs (MesaDemos, MesaGLUT and MesaLib), remove files that are not supposed to be there. Note that when importing initially, some files were not even added to the SVN repository because SVN ignored them. These were configs/diffs~ and docs/RELNOTES-6.1~. I removed those from the tarball as well. --- configs/CVS/Entries | 92 -------------------------------------------------- configs/CVS/Repository | 1 - configs/CVS/Root | 1 - configs/CVS/Root.bak | 1 - configs/CVS/Template | 0 debian/rules | 2 +- 6 files changed, 1 insertion(+), 96 deletions(-) delete mode 100644 configs/CVS/Entries delete mode 100644 configs/CVS/Repository delete mode 100644 configs/CVS/Root delete mode 100644 configs/CVS/Root.bak delete mode 100644 configs/CVS/Template (limited to 'debian') diff --git a/configs/CVS/Entries b/configs/CVS/Entries deleted file mode 100644 index 15b3dddb230..00000000000 --- a/configs/CVS/Entries +++ /dev/null @@ -1,92 +0,0 @@ -/linux-osmesa16-static/1.1/Fri Mar 26 15:16:35 2004// -/linux-ppc/1.3/Fri Jul 15 22:18:52 2005// -/linux-ppc-static/1.3/Fri Jul 15 22:18:52 2005// -/linux-static/1.3/Fri Jul 15 22:18:52 2005// -/linux-x86-32/1.4/Fri Jul 15 22:18:52 2005// -/linux-solo-ia64/1.8/Thu Aug 11 14:15:58 2005// -/linux-dri-ppc/1.3/Fri Aug 19 22:03:05 2005// -/freebsd-dri-amd64/1.3/Mon Sep 12 15:03:11 2005// -/freebsd-dri-x86/1.2/Mon Sep 12 15:03:11 2005// -/linux-dri-x86/1.12/Mon Sep 12 15:03:11 2005// -/linux-solo-x86/1.9/Mon Sep 12 15:03:11 2005// -/linux-x86-64-debug/1.4/Sat Nov 12 17:56:59 2005// -/linux-x86-debug/1.4/Sat Nov 12 17:56:59 2005// -/sunos5-64-gcc/1.1/Mon Apr 3 16:09:53 2006// -/darwin-static/1.3/Tue Apr 11 20:47:33 2006// -/darwin-static-x86ppc/1.2/Fri Apr 21 01:03:51 2006// -/linux-x86/1.7/Sat Apr 22 00:21:52 2006// -/aix/1.5/Thu Jun 22 22:24:33 2006// -/aix-64/1.5/Thu Jul 13 02:43:20 2006// -/aix-64-static/1.3/Thu Jul 13 02:43:20 2006// -/aix-gcc/1.4/Thu Jul 13 02:43:20 2006// -/aix-static/1.3/Thu Jul 13 02:43:20 2006// -/beos/1.7/Thu Jul 13 02:43:20 2006// -/darwin/1.6/Thu Jul 13 02:43:20 2006// -/darwin-x86ppc/1.3/Thu Jul 13 02:43:20 2006// -/hpux10-gcc/1.2/Thu Jul 13 02:43:20 2006// -/irix6-64/1.6/Thu Jul 13 02:43:20 2006// -/irix6-64-static/1.6/Thu Jul 13 02:43:20 2006// -/irix6-n32/1.6/Thu Jul 13 02:43:20 2006// -/irix6-n32-static/1.6/Thu Jul 13 02:43:20 2006// -/irix6-o32/1.5/Thu Jul 13 02:43:20 2006// -/irix6-o32-static/1.6/Thu Jul 13 02:43:20 2006// -/linux-alpha/1.3/Thu Jul 13 02:43:20 2006// -/linux-alpha-static/1.3/Thu Jul 13 02:43:20 2006// -/linux-directfb/1.4/Thu Jul 13 02:43:20 2006// -/linux-dri-x86-64/1.21/Thu Jul 13 02:43:20 2006// -/linux-glide/1.4/Thu Jul 13 02:43:20 2006// -/linux-ia64-icc/1.2/Thu Jul 13 02:43:20 2006// -/linux-ia64-icc-static/1.2/Thu Jul 13 02:43:20 2006// -/linux-icc/1.5/Thu Jul 13 02:43:20 2006// -/linux-icc-static/1.6/Thu Jul 13 02:43:20 2006// -/linux-osmesa/1.3/Thu Jul 13 02:43:20 2006// -/linux-osmesa16/1.3/Thu Jul 13 02:43:20 2006// -/linux-osmesa32/1.3/Thu Jul 13 02:43:20 2006// -/linux-profile/1.3/Thu Jul 13 02:43:20 2006// -/linux-x86-64/1.11/Thu Jul 13 02:43:20 2006// -/linux-x86-64-static/1.8/Thu Jul 13 02:43:20 2006// -/linux-x86-glide/1.6/Thu Jul 13 02:43:20 2006// -/linux-x86-static/1.7/Thu Jul 13 02:43:20 2006// -/netbsd/1.2/Thu Jul 13 02:43:20 2006// -/openbsd/1.3/Thu Jul 13 02:43:20 2006// -/osf1/1.5/Thu Jul 13 02:43:20 2006// -/osf1-static/1.2/Thu Jul 13 02:43:20 2006// -/solaris-x86/1.3/Thu Jul 13 02:43:20 2006// -/solaris-x86-gcc/1.6/Thu Jul 13 02:43:20 2006// -/solaris-x86-gcc-static/1.3/Thu Jul 13 02:43:20 2006// -/sunos4/1.2/Thu Jul 13 02:43:20 2006// -/sunos4-gcc/1.2/Thu Jul 13 02:43:20 2006// -/sunos4-static/1.3/Thu Jul 13 02:43:20 2006// -/sunos5/1.3/Thu Jul 13 02:43:20 2006// -/sunos5-gcc/1.6/Thu Jul 13 02:43:20 2006// -/sunos5-smp/1.3/Thu Jul 13 02:43:20 2006// -/sunos5-v8/1.2/Thu Jul 13 02:43:20 2006// -/sunos5-v8-static/1.2/Thu Jul 13 02:43:20 2006// -/sunos5-v9/1.3/Thu Jul 13 02:43:20 2006// -/sunos5-v9-static/1.3/Thu Jul 13 02:43:20 2006// -/ultrix-gcc/1.3/Thu Jul 13 02:43:20 2006// -/linux-debug/1.9/Thu Jul 13 02:43:26 2006// -/freebsd/1.8/Thu Aug 17 14:09:02 2006// -/freebsd-dri/1.21/Thu Aug 17 14:09:02 2006// -/linux-dri/1.44/Thu Aug 17 14:09:02 2006// -/linux-dri-xcb/1.4/Thu Aug 17 14:09:02 2006// -/linux-indirect/1.6/Thu Aug 17 14:09:02 2006// -/linux-solo/1.25/Thu Aug 17 14:09:02 2006// -/linux-fbdev/1.5/Mon Aug 21 16:03:34 2006// -/linux/1.8/Thu Aug 24 23:37:59 2006// -/linux-sparc/1.6/Thu Aug 24 23:37:59 2006// -/linux-sparc5/1.5/Thu Aug 24 23:37:59 2006// -/linux-ultrasparc/1.4/Thu Aug 24 23:37:59 2006// -/default/1.27/Mon Sep 11 21:35:46 2006// -/hpux10/1.3/Mon Sep 11 21:35:46 2006// -/hpux10-static/1.4/Mon Sep 11 21:35:46 2006// -/hpux11-32/1.4/Mon Sep 11 21:35:46 2006// -/hpux11-32-static/1.4/Mon Sep 11 21:35:46 2006// -/hpux11-32-static-nothreads/1.2/Mon Sep 11 21:35:46 2006// -/hpux11-64/1.4/Mon Sep 11 21:35:46 2006// -/hpux11-64-static/1.4/Mon Sep 11 21:35:46 2006// -/hpux11-ia64/1.3/Mon Sep 11 21:35:46 2006// -/hpux11-ia64-static/1.3/Mon Sep 11 21:35:46 2006// -/hpux9/1.3/Mon Sep 11 21:35:46 2006// -/hpux9-gcc/1.3/Mon Sep 11 21:35:46 2006// -D diff --git a/configs/CVS/Repository b/configs/CVS/Repository deleted file mode 100644 index 467347235d9..00000000000 --- a/configs/CVS/Repository +++ /dev/null @@ -1 +0,0 @@ -Mesa/configs diff --git a/configs/CVS/Root b/configs/CVS/Root deleted file mode 100644 index 231303aae3e..00000000000 --- a/configs/CVS/Root +++ /dev/null @@ -1 +0,0 @@ -:ext:brianp@cvs.freedesktop.org:/cvs/mesa diff --git a/configs/CVS/Root.bak b/configs/CVS/Root.bak deleted file mode 100644 index eba07540827..00000000000 --- a/configs/CVS/Root.bak +++ /dev/null @@ -1 +0,0 @@ -:ext:brianp@pdx.freedesktop.org:/cvs/mesa diff --git a/configs/CVS/Template b/configs/CVS/Template deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/debian/rules b/debian/rules index adcf06f183d..307088a54de 100755 --- a/debian/rules +++ b/debian/rules @@ -126,7 +126,7 @@ $(STAMP_DIR)/install-source: clean: unpatch dh_testdir dh_testroot - dh_clean --exclude ./Makefile.orig --exclude configs/CVS/Root.bak + dh_clean --exclude ./Makefile.orig rm -rf $(DEB_BUILD_DIR) $(STAMP_DIR) # Build architecture-independent files here. -- cgit v1.2.3 From 5bed38974e7b7ce240b4aa141988f9d6a107370c Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Tue, 24 Oct 2006 14:45:18 +0000 Subject: Close 392715 because we now ship the contents of the three Mesa tarballs in the original source. --- debian/changelog | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index f055caf3b15..c67bffc9900 100644 --- a/debian/changelog +++ b/debian/changelog @@ -11,8 +11,10 @@ mesa (6.5.1-1) unstable; urgency=low * Build with -fno-strict-aliasing. (Closes: #394311) * 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) - -- Thierry Reding Tue, 24 Oct 2006 14:13:01 +0200 + -- Thierry Reding Tue, 24 Oct 2006 16:42:33 +0200 mesa (6.5.1-0.2) unstable; urgency=low -- cgit v1.2.3 From e076cd42f04a643644b180eb24813e5fe07cf4ad Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Wed, 25 Oct 2006 00:17:42 +0000 Subject: Bug #387706 should also be closed because we move libOSMesa to libosmesa6 and statically link in the software rasterization code. --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index c67bffc9900..a2e40900f7c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,7 +3,7 @@ mesa (6.5.1-1) unstable; urgency=low * Provide i686 optimized versions in libgl1-mesa-swx11-i686. * No longer provide the libgl1-mesa-swx11-dbg package. * Statically link libOSMesa with the software rasterization code from libGL - so that it works independently of the installed 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 @@ -14,7 +14,7 @@ mesa (6.5.1-1) unstable; urgency=low * Repack the contents of the three Mesa tarballs (MesaDemos, MesaGLUT and MesaLib) as the original source tarball. (Closes: #392715) - -- Thierry Reding Tue, 24 Oct 2006 16:42:33 +0200 + -- Thierry Reding Wed, 25 Oct 2006 02:16:26 +0200 mesa (6.5.1-0.2) unstable; urgency=low -- cgit v1.2.3 From 143dfcc904a52291862833fc54a38bf57a1e04e2 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Wed, 1 Nov 2006 07:54:40 +0000 Subject: Make mesa-common-dev depend on libx11-dev to provide Xlib.h and Xutil.h needed by the GLX headers. --- debian/changelog | 3 ++- debian/control | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index a2e40900f7c..a3debbd91c8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -13,8 +13,9 @@ mesa (6.5.1-1) unstable; urgency=low 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. (Closes: #396498) - -- Thierry Reding Wed, 25 Oct 2006 02:16:26 +0200 + -- Thierry Reding Wed, 1 Nov 2006 08:52:53 +0100 mesa (6.5.1-0.2) unstable; urgency=low diff --git a/debian/control b/debian/control index c14f638762d..fb44a2b0667 100644 --- a/debian/control +++ b/debian/control @@ -230,6 +230,7 @@ Package: mesa-common-dev Section: devel Architecture: all Replaces: xlibmesa-gl-dev (<< 1:7), xlibosmesa-dev +Depends: libx11-dev Description: Developer documentation for Mesa This package includes the specifications for the Mesa-specific OpenGL extensions, the complete set of release release notes and the -- cgit v1.2.3 From 5d23a7905cde2f1d62032a3ae4ef3bc1367006fc Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Thu, 2 Nov 2006 21:05:29 +0000 Subject: Add code to provide a mesa-utils package since those utilities are shipped in the MesaDemos tarball. --- configs/debian-default | 1 + configs/debian-utils | 17 ++++++++ debian/control | 10 +++++ debian/mesa-utils.install | 4 ++ debian/patches/04_optional-progs-and-install.patch | 45 ++++++++++++++++++++++ debian/patches/series | 1 + debian/rules | 3 +- 7 files changed, 80 insertions(+), 1 deletion(-) create mode 100644 configs/debian-utils create mode 100644 debian/mesa-utils.install create mode 100644 debian/patches/04_optional-progs-and-install.patch (limited to 'debian') diff --git a/configs/debian-default b/configs/debian-default index 3412bb351d1..b64a6806bad 100644 --- a/configs/debian-default +++ b/configs/debian-default @@ -8,6 +8,7 @@ SRC_DIRS = mesa PROGRAM_DIRS = INSTALL_DIR = $(DESTDIR)/usr +INSTALL = /usr/bin/install # vim: ft=make diff --git a/configs/debian-utils b/configs/debian-utils new file mode 100644 index 00000000000..1705802c79e --- /dev/null +++ b/configs/debian-utils @@ -0,0 +1,17 @@ +# Configuration defaults for building Mesa (swx11 and GLU). + +include $(TOP)/configs/debian-default + +CONFIG_NAME = debian-utils + +SRC_DIRS = +PROGRAM_DIRS = xdemos +PROGS = glxdemo \ + glxgears \ + glxheads \ + glxinfo + +APP_LIB_DEPS = -lGL + +# vim: ft=make + diff --git a/debian/control b/debian/control index fb44a2b0667..697d819ebe9 100644 --- a/debian/control +++ b/debian/control @@ -306,4 +306,14 @@ Description: Mesa software rasteriser source -- development support files software rasteriser source to build the GLcore module for unaccelerated indirect rendering. +Package: mesa-utils +Section: x11 +Priority: optional +Architecture: any +Depends: ${shlibs:Depends} +Replaces: xbase-clients (<< 6.8.2-38) +Description: Miscellaneous Mesa GL utilities + This package provides several basic GL utilities built by Mesa, including + glxinfo and glxgears. + # vim: tw=0 diff --git a/debian/mesa-utils.install b/debian/mesa-utils.install new file mode 100644 index 00000000000..4d4d07e3f00 --- /dev/null +++ b/debian/mesa-utils.install @@ -0,0 +1,4 @@ +usr/bin/glxdemo +usr/bin/glxgears +usr/bin/glxheads +usr/bin/glxinfo diff --git a/debian/patches/04_optional-progs-and-install.patch b/debian/patches/04_optional-progs-and-install.patch new file mode 100644 index 00000000000..66a4771003b --- /dev/null +++ b/debian/patches/04_optional-progs-and-install.patch @@ -0,0 +1,45 @@ +Allow the programs that are to be built to be defined in the build +configuration. + +Provide an install target for installing the programs in $(INSTALL_DIR)/bin. + +This patch by Thierry Reding. +Not submitted to Mesa. + +--- a/progs/xdemos/Makefile ++++ b/progs/xdemos/Makefile +@@ -8,7 +8,7 @@ + + LIB_DEP = $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) $(TOP)/$(LIB_DIR)/$(GLU_LIB_NAME) + +-PROGS = glthreads \ ++PROGS ?= glthreads \ + glxdemo \ + glxgears \ + glxgears_fbconfig \ +@@ -44,6 +44,9 @@ + + default: $(PROGS) + ++install: $(PROGS) ++ $(INSTALL) -d $(INSTALL_DIR)/bin ++ $(INSTALL) -m 755 $(PROGS) $(INSTALL_DIR)/bin + + clean: + -rm -f $(PROGS) +--- a/progs/Makefile ++++ b/progs/Makefile +@@ -21,8 +21,12 @@ + fi \ + done + +-# Dummy install target + install: ++ @for dir in $(SUBDIRS) ; do \ ++ if [ -d $$dir ] ; then \ ++ (cd $$dir ; $(MAKE) install) ; \ ++ fi \ ++ done + + clean: + @for dir in $(SUBDIRS) tests ; do \ diff --git a/debian/patches/series b/debian/patches/series index 31078561786..327a78f2151 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -2,3 +2,4 @@ 01_fix-makefile.patch 02_use-ieee-fp-on-s390-and-m68k.patch 03_handle-sync-and-dont-unlock-display.patch +04_optional-progs-and-install.patch diff --git a/debian/rules b/debian/rules index 307088a54de..bb2f35c061d 100755 --- a/debian/rules +++ b/debian/rules @@ -75,7 +75,8 @@ CONFIGS = $(SWX11_GLU_CONFIGS) \ debian-osmesa16 \ debian-osmesa16-static \ debian-osmesa32 \ - debian-osmesa32-static + debian-osmesa32-static \ + debian-utils STAMP = $(STAMP_DIR)/$(DEB_BUILD_GNU_TYPE) BUILD_STAMPS = $(addprefix $(STAMP)-build-, $(CONFIGS)) -- cgit v1.2.3 From 336beba81ba636890e5a76569ad640feea398d93 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Thu, 2 Nov 2006 21:20:33 +0000 Subject: Update Debian changelog. --- debian/changelog | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index a3debbd91c8..260c5319268 100644 --- a/debian/changelog +++ b/debian/changelog @@ -14,8 +14,10 @@ mesa (6.5.1-1) unstable; urgency=low * 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. (Closes: #396498) + * 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 Wed, 1 Nov 2006 08:52:53 +0100 + -- Thierry Reding Thu, 2 Nov 2006 22:14:58 +0100 mesa (6.5.1-0.2) unstable; urgency=low -- cgit v1.2.3 From d5ef77353b6691e4e4e205f836d95b6bda182bdf Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Fri, 10 Nov 2006 08:40:03 +0000 Subject: Build Mesa utility programs (glxdemo, glxgears, glxheads, glxinfo) together with the DRI/GLX-enabled libGL. Don't build the utilities on CPU-optimized configurations. --- configs/debian-dri-default | 9 ++++++++- configs/debian-dri-i386-i686 | 2 +- configs/debian-dri-optimized-default | 13 +++++++++++++ configs/debian-utils | 17 ----------------- debian/rules | 3 +-- 5 files changed, 23 insertions(+), 21 deletions(-) create mode 100644 configs/debian-dri-optimized-default delete mode 100644 configs/debian-utils (limited to 'debian') diff --git a/configs/debian-dri-default b/configs/debian-dri-default index 5fe6d787b33..31e90479c4a 100644 --- a/configs/debian-dri-default +++ b/configs/debian-dri-default @@ -7,8 +7,13 @@ CONFIG_NAME = debian-dri-default OPT_FLAGS = -O3 -g -SRC_DIRS = glx/x11 mesa +SRC_DIRS = glx/x11 mesa progs DRIVER_DIRS = dri +PROGRAM_DIRS = xdemos +PROGS = glxdemo \ + glxgears \ + glxheads \ + glxinfo LIB_DIR = lib/glx @@ -27,5 +32,7 @@ ifeq ($(DEB_BUILD_ARCH), sparc) DRI_DIRS += ffb endif +APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) + # vim: ft=make diff --git a/configs/debian-dri-i386-i686 b/configs/debian-dri-i386-i686 index 02a0321abb9..b15cd77a03d 100644 --- a/configs/debian-dri-i386-i686 +++ b/configs/debian-dri-i386-i686 @@ -1,7 +1,7 @@ # Configuration for building the DRI drivers on i386. include $(TOP)/configs/linux-dri-x86 -include $(TOP)/configs/debian-dri-default +include $(TOP)/configs/debian-dri-optimized-default CONFIG_NAME = debian-dri-i386-i686 diff --git a/configs/debian-dri-optimized-default b/configs/debian-dri-optimized-default new file mode 100644 index 00000000000..9c3f68dde7a --- /dev/null +++ b/configs/debian-dri-optimized-default @@ -0,0 +1,13 @@ +# Configuration defaults for CPU-optimized builds of the DRI drivers and +# DRI/GLX-enabled libGL. + +include $(TOP)/configs/debian-dri-default + +CONFIG_NAME = debian-dri-optimized-default + +# override so that the utility programs are not rebuilt with CPU-specific +# optimizations +SRC_DIRS = glx/x11 mesa + +# vim: ft=make + diff --git a/configs/debian-utils b/configs/debian-utils deleted file mode 100644 index 1705802c79e..00000000000 --- a/configs/debian-utils +++ /dev/null @@ -1,17 +0,0 @@ -# Configuration defaults for building Mesa (swx11 and GLU). - -include $(TOP)/configs/debian-default - -CONFIG_NAME = debian-utils - -SRC_DIRS = -PROGRAM_DIRS = xdemos -PROGS = glxdemo \ - glxgears \ - glxheads \ - glxinfo - -APP_LIB_DEPS = -lGL - -# vim: ft=make - diff --git a/debian/rules b/debian/rules index bb2f35c061d..307088a54de 100755 --- a/debian/rules +++ b/debian/rules @@ -75,8 +75,7 @@ CONFIGS = $(SWX11_GLU_CONFIGS) \ debian-osmesa16 \ debian-osmesa16-static \ debian-osmesa32 \ - debian-osmesa32-static \ - debian-utils + debian-osmesa32-static STAMP = $(STAMP_DIR)/$(DEB_BUILD_GNU_TYPE) BUILD_STAMPS = $(addprefix $(STAMP)-build-, $(CONFIGS)) -- cgit v1.2.3 From b6caed527ccdcce15cfdf31aa77813e52c0faab4 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Fri, 10 Nov 2006 08:50:35 +0000 Subject: Also add release notes of version 6.5.1 and the release notes index. --- debian/mesa-common-dev.docs | 1 + 1 file changed, 1 insertion(+) (limited to 'debian') diff --git a/debian/mesa-common-dev.docs b/debian/mesa-common-dev.docs index 457acbf84c4..834e887e4fa 100644 --- a/debian/mesa-common-dev.docs +++ b/debian/mesa-common-dev.docs @@ -4,4 +4,5 @@ docs/envvars.html docs/faq.html docs/osmesa.html docs/RELNOTES-* +docs/relnotes* docs/*.spec -- cgit v1.2.3 From 50faa32ce32fe5f7409705bffb73efceb0b20354 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Fri, 10 Nov 2006 09:00:00 +0000 Subject: Move the code to choose which configurations to build to a separate script in order to keep debian/rules cleaner. --- debian/rules | 43 ++++------------------------------- debian/scripts/choose-configs | 52 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 39 deletions(-) create mode 100644 debian/scripts/choose-configs (limited to 'debian') diff --git a/debian/rules b/debian/rules index 307088a54de..7d3196ff7dc 100755 --- a/debian/rules +++ b/debian/rules @@ -26,46 +26,11 @@ DEB_BUILD_DIR ?= $(CURDIR)/obj-$(DEB_BUILD_GNU_TYPE) export DEB_BUILD_ARCH -# 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 - -# and for the GLX/DRI-enabled libGL -ifneq ($(wildcard configs/debian-dri-$(DEB_BUILD_ARCH)),) - DRI_CONFIGS := debian-dri-$(DEB_BUILD_ARCH) -else - DRI_CONFIGS := debian-dri-any -endif - -# additional configurations optimized for CPU's supported by the build -# architecture -ifeq ($(DEB_BUILD_ARCH), i386) - SWX11_GLU_CONFIGS += debian-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 +# choose which configurations to build +SWX11_GLU_CONFIGS = +DRI_CONFIGS = -#ifeq ($(DEB_BUILD_ARCH), sparc) -# SWX11_GLU_CONFIGS += debian-swx11+glu-sparc-ultrasparc -#endif +include debian/scripts/choose-configs # build the following configurations by default CONFIGS = $(SWX11_GLU_CONFIGS) \ diff --git a/debian/scripts/choose-configs b/debian/scripts/choose-configs new file mode 100644 index 00000000000..3f5f9868e51 --- /dev/null +++ b/debian/scripts/choose-configs @@ -0,0 +1,52 @@ +# 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 + +# and for the GLX/DRI-enabled libGL +ifneq ($(wildcard configs/debian-dri-$(DEB_BUILD_ARCH)),) + DRI_CONFIGS := debian-dri-$(DEB_BUILD_ARCH) +else + DRI_CONFIGS := debian-dri-any +endif + +############################################################################## +## CPU-optimized configurations ############################################## + +ifeq ($(DEB_BUILD_ARCH), i386) + SWX11_GLU_CONFIGS += debian-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 + -- cgit v1.2.3 From b5a5062176ffae31566f55db4eee6099d15ccf1f Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Sat, 18 Nov 2006 17:50:44 +0000 Subject: Target the mesa package at experimental until etch is released. --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 260c5319268..16f6303982c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -mesa (6.5.1-1) unstable; urgency=low +mesa (6.5.1-1) experimental; urgency=low * Provide i686 optimized versions in libgl1-mesa-swx11-i686. * No longer provide the libgl1-mesa-swx11-dbg package. @@ -17,7 +17,7 @@ mesa (6.5.1-1) unstable; urgency=low * 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 Thu, 2 Nov 2006 22:14:58 +0100 + -- Thierry Reding Sat, 18 Nov 2006 18:50:07 +0100 mesa (6.5.1-0.2) unstable; urgency=low -- cgit v1.2.3 From bb44a8ae1f392d44b2f588c831101c865485bcfd Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Sat, 18 Nov 2006 17:59:25 +0000 Subject: Update to latest upstream release candidate. Update patches. --- Makefile | 9 +- bin/minstall | 88 + bin/mklib | 15 +- configs/aix | 1 - configs/default | 5 +- configs/freebsd | 3 - configs/freebsd-dri | 10 +- configs/linux-dri | 5 +- configs/linux-dri-xcb | 5 +- configs/linux-indirect | 1 + debian/changelog | 9 + debian/patches/01_fix-makefile.patch | 18 - .../03_handle-sync-and-dont-unlock-display.patch | 20 - debian/patches/03_optional-progs-and-install.patch | 45 + debian/patches/04_optional-progs-and-install.patch | 45 - debian/patches/series | 3 +- descrip.mms | 2 +- docs/RELNOTES-6.4 | 50 - docs/RELNOTES-6.4.1 | 47 - docs/RELNOTES-6.4.2 | 47 - docs/RELNOTES-6.5 | 97 - docs/contents.html | 2 +- docs/devinfo.html | 14 +- docs/dispatch.html | 274 + docs/mangling.html | 8 +- docs/news.html | 85 +- docs/relnotes-6.4.1.html | 68 + docs/relnotes-6.4.2.html | 75 + docs/relnotes-6.4.html | 90 + docs/relnotes-6.5.1.html | 74 +- docs/relnotes-6.5.2.html | 111 + docs/relnotes-6.5.html | 131 + docs/relnotes.html | 24 +- docs/sourcedocs.html | 17 +- docs/versions.html | 175 +- include/GL/gl.h | 4 +- include/GL/glx_mangle.h | 58 +- progs/demos/Makefile | 2 + progs/demos/cubemap.c | 1 + progs/demos/fslight.c | 334 + progs/demos/readpix.c | 31 +- progs/demos/streaming_rect.c | 322 + progs/demos/texdown.c | 133 +- progs/osdemos/osdemo.c | 45 +- progs/xdemos/wincopy.c | 35 +- src/glu/Makefile | 2 +- src/glut/fbdev/Makefile | 2 +- src/glut/fbdev/cursor.c | 6 +- src/glut/fbdev/fbdev.c | 71 +- src/glut/fbdev/gamemode.c | 1 - src/glut/fbdev/input.c | 125 +- src/glut/glx/Makefile | 2 +- src/glut/glx/glut_cmap.c | 24 +- src/glut/glx/glut_win.c | 17 + src/glut/mini/models.c | 16 +- src/glw/Makefile | 2 +- src/glx/x11/glxext.c | 262 +- src/glx/x11/indirect.c | 8236 ++++++++++++-------- src/glx/x11/indirect.h | 23 +- src/glx/x11/indirect_init.c | 406 +- src/glx/x11/indirect_size.c | 446 +- src/glx/x11/indirect_vertex_array.c | 6 +- src/glx/x11/singlepix.c | 87 + src/mesa/Makefile | 15 +- src/mesa/drivers/common/driverfuncs.c | 3 + src/mesa/drivers/directfb/idirectfbgl_mesa.c | 24 +- src/mesa/drivers/dri/Makefile.template | 9 +- src/mesa/drivers/dri/common/dri_bufmgr.c | 493 ++ src/mesa/drivers/dri/common/dri_bufmgr.h | 99 + src/mesa/drivers/dri/common/dri_bufpool.h | 86 + src/mesa/drivers/dri/common/dri_drmpool.c | 227 + src/mesa/drivers/dri/common/dri_util.c | 12 +- src/mesa/drivers/dri/common/dri_util.h | 15 +- src/mesa/drivers/dri/common/drirenderbuffer.h | 7 +- src/mesa/drivers/dri/common/extension_helper.h | 894 ++- src/mesa/drivers/dri/common/utils.c | 13 + src/mesa/drivers/dri/common/utils.h | 2 + src/mesa/drivers/dri/common/vblank.c | 129 +- src/mesa/drivers/dri/common/vblank.h | 9 +- src/mesa/drivers/dri/common/xmlpool/options.h | 5 + src/mesa/drivers/dri/common/xmlpool/t_options.h | 5 + src/mesa/drivers/dri/fb/fb_dri.c | 1 - src/mesa/drivers/dri/fb/fb_egl.c | 1 - src/mesa/drivers/dri/ffb/ffb_clear.c | 44 +- src/mesa/drivers/dri/ffb/ffb_clear.h | 5 +- src/mesa/drivers/dri/ffb/ffb_xmesa.c | 3 +- src/mesa/drivers/dri/gamma/gamma_dd.c | 23 +- src/mesa/drivers/dri/gamma/gamma_state.c | 5 +- src/mesa/drivers/dri/i810/i810context.c | 1 - src/mesa/drivers/dri/i810/i810ioctl.c | 17 +- src/mesa/drivers/dri/i810/i810state.c | 15 - src/mesa/drivers/dri/i915/i830_metaops.c | 14 +- src/mesa/drivers/dri/i915/i830_state.c | 2 +- src/mesa/drivers/dri/i915/i915_context.c | 3 + src/mesa/drivers/dri/i915/i915_fragprog.c | 27 +- src/mesa/drivers/dri/i915/i915_metaops.c | 22 +- src/mesa/drivers/dri/i915/i915_program.c | 5 +- src/mesa/drivers/dri/i915/i915_state.c | 2 +- src/mesa/drivers/dri/i915/i915_texprog.c | 5 + src/mesa/drivers/dri/i915/i915_vtbl.c | 4 +- src/mesa/drivers/dri/i915/intel_batchbuffer.c | 235 +- src/mesa/drivers/dri/i915/intel_context.c | 78 +- src/mesa/drivers/dri/i915/intel_context.h | 14 + src/mesa/drivers/dri/i915/intel_ioctl.c | 9 +- src/mesa/drivers/dri/i915/intel_ioctl.h | 3 +- src/mesa/drivers/dri/i915/intel_pixel.c | 9 - src/mesa/drivers/dri/i915/intel_tris.c | 221 +- src/mesa/drivers/dri/i915/server/i830_common.h | 15 + src/mesa/drivers/dri/i915tex/Makefile | 66 + src/mesa/drivers/dri/i915tex/i830_context.c | 104 + src/mesa/drivers/dri/i915tex/i830_context.h | 208 + src/mesa/drivers/dri/i915tex/i830_metaops.c | 485 ++ src/mesa/drivers/dri/i915tex/i830_reg.h | 641 ++ src/mesa/drivers/dri/i915tex/i830_state.c | 1113 +++ src/mesa/drivers/dri/i915tex/i830_tex.c | 100 + src/mesa/drivers/dri/i915tex/i830_texblend.c | 463 ++ src/mesa/drivers/dri/i915tex/i830_texstate.c | 316 + src/mesa/drivers/dri/i915tex/i830_vtbl.c | 606 ++ src/mesa/drivers/dri/i915tex/i915_context.c | 175 + src/mesa/drivers/dri/i915tex/i915_context.h | 367 + src/mesa/drivers/dri/i915tex/i915_debug.c | 334 + src/mesa/drivers/dri/i915tex/i915_fragprog.c | 1083 +++ src/mesa/drivers/dri/i915tex/i915_metaops.c | 509 ++ src/mesa/drivers/dri/i915tex/i915_program.c | 515 ++ src/mesa/drivers/dri/i915tex/i915_program.h | 160 + src/mesa/drivers/dri/i915tex/i915_reg.h | 841 ++ src/mesa/drivers/dri/i915tex/i915_state.c | 1019 +++ src/mesa/drivers/dri/i915tex/i915_tex.c | 113 + src/mesa/drivers/dri/i915tex/i915_tex_layout.c | 380 + src/mesa/drivers/dri/i915tex/i915_texstate.c | 338 + src/mesa/drivers/dri/i915tex/i915_vtbl.c | 550 ++ src/mesa/drivers/dri/i915tex/intel_batchbuffer.c | 342 + src/mesa/drivers/dri/i915tex/intel_batchbuffer.h | 124 + src/mesa/drivers/dri/i915tex/intel_batchpool.c | 418 + src/mesa/drivers/dri/i915tex/intel_blit.c | 552 ++ src/mesa/drivers/dri/i915tex/intel_blit.h | 61 + .../drivers/dri/i915tex/intel_buffer_objects.c | 250 + .../drivers/dri/i915tex/intel_buffer_objects.h | 86 + src/mesa/drivers/dri/i915tex/intel_buffers.c | 928 +++ src/mesa/drivers/dri/i915tex/intel_buffers.h | 56 + src/mesa/drivers/dri/i915tex/intel_context.c | 714 ++ src/mesa/drivers/dri/i915tex/intel_context.h | 502 ++ src/mesa/drivers/dri/i915tex/intel_depthstencil.c | 282 + src/mesa/drivers/dri/i915tex/intel_depthstencil.h | 14 + src/mesa/drivers/dri/i915tex/intel_fbo.c | 622 ++ src/mesa/drivers/dri/i915tex/intel_fbo.h | 80 + src/mesa/drivers/dri/i915tex/intel_ioctl.c | 138 + src/mesa/drivers/dri/i915tex/intel_ioctl.h | 40 + src/mesa/drivers/dri/i915tex/intel_mipmap_tree.c | 347 + src/mesa/drivers/dri/i915tex/intel_mipmap_tree.h | 198 + src/mesa/drivers/dri/i915tex/intel_pixel.c | 119 + src/mesa/drivers/dri/i915tex/intel_pixel.h | 63 + src/mesa/drivers/dri/i915tex/intel_pixel_bitmap.c | 350 + src/mesa/drivers/dri/i915tex/intel_pixel_copy.c | 380 + src/mesa/drivers/dri/i915tex/intel_pixel_draw.c | 365 + src/mesa/drivers/dri/i915tex/intel_pixel_read.c | 317 + src/mesa/drivers/dri/i915tex/intel_reg.h | 84 + src/mesa/drivers/dri/i915tex/intel_regions.c | 466 ++ src/mesa/drivers/dri/i915tex/intel_regions.h | 141 + src/mesa/drivers/dri/i915tex/intel_render.c | 242 + src/mesa/drivers/dri/i915tex/intel_rotate.c | 237 + src/mesa/drivers/dri/i915tex/intel_rotate.h | 39 + src/mesa/drivers/dri/i915tex/intel_screen.c | 864 ++ src/mesa/drivers/dri/i915tex/intel_screen.h | 132 + src/mesa/drivers/dri/i915tex/intel_span.c | 409 + src/mesa/drivers/dri/i915tex/intel_span.h | 38 + src/mesa/drivers/dri/i915tex/intel_state.c | 363 + src/mesa/drivers/dri/i915tex/intel_structs.h | 132 + src/mesa/drivers/dri/i915tex/intel_tex.c | 192 + src/mesa/drivers/dri/i915tex/intel_tex.h | 148 + src/mesa/drivers/dri/i915tex/intel_tex_copy.c | 301 + src/mesa/drivers/dri/i915tex/intel_tex_format.c | 172 + src/mesa/drivers/dri/i915tex/intel_tex_image.c | 685 ++ src/mesa/drivers/dri/i915tex/intel_tex_subimage.c | 183 + src/mesa/drivers/dri/i915tex/intel_tex_validate.c | 256 + src/mesa/drivers/dri/i915tex/intel_tris.c | 1149 +++ src/mesa/drivers/dri/i915tex/intel_tris.h | 69 + src/mesa/drivers/dri/i915tex/server/i830_common.h | 212 + src/mesa/drivers/dri/i915tex/server/i830_dri.h | 73 + src/mesa/drivers/dri/i915tex/server/intel.h | 328 + src/mesa/drivers/dri/i915tex/server/intel_dri.c | 1282 +++ src/mesa/drivers/dri/i965/Makefile | 2 + src/mesa/drivers/dri/i965/brw_aub_playback.c | 6 +- src/mesa/drivers/dri/i965/brw_draw.c | 54 +- src/mesa/drivers/dri/i965/brw_draw_upload.c | 1 + src/mesa/drivers/dri/i965/brw_exec_api.c | 2 +- src/mesa/drivers/dri/i965/brw_misc_state.c | 15 +- src/mesa/drivers/dri/i965/brw_tex.c | 49 +- src/mesa/drivers/dri/i965/brw_tex_layout.c | 7 +- src/mesa/drivers/dri/i965/brw_util.c | 2 + src/mesa/drivers/dri/i965/brw_vs.c | 7 +- src/mesa/drivers/dri/i965/brw_vs.h | 3 +- src/mesa/drivers/dri/i965/brw_vs_emit.c | 40 +- src/mesa/drivers/dri/i965/brw_vs_tnl.c | 1 + src/mesa/drivers/dri/i965/brw_wm.h | 1 + src/mesa/drivers/dri/i965/brw_wm_debug.c | 62 +- src/mesa/drivers/dri/i965/brw_wm_fp.c | 61 +- src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 12 +- src/mesa/drivers/dri/i965/bufmgr.h | 2 + src/mesa/drivers/dri/i965/bufmgr_fake.c | 16 +- src/mesa/drivers/dri/i965/intel_batchbuffer.c | 20 +- src/mesa/drivers/dri/i965/intel_batchbuffer.h | 2 +- src/mesa/drivers/dri/i965/intel_blit.c | 132 +- src/mesa/drivers/dri/i965/intel_blit.h | 14 +- src/mesa/drivers/dri/i965/intel_buffers.c | 46 +- src/mesa/drivers/dri/i965/intel_context.c | 50 +- src/mesa/drivers/dri/i965/intel_context.h | 45 +- src/mesa/drivers/dri/i965/intel_ioctl.c | 33 +- src/mesa/drivers/dri/i965/intel_ioctl.h | 6 +- src/mesa/drivers/dri/i965/intel_pixel_bitmap.c | 350 + src/mesa/drivers/dri/i965/intel_pixel_copy.c | 240 + src/mesa/drivers/dri/i965/intel_screen.c | 4 +- src/mesa/drivers/dri/i965/intel_span.c | 11 + src/mesa/drivers/dri/i965/intel_state.c | 35 - src/mesa/drivers/dri/i965/intel_structs.h | 132 + src/mesa/drivers/dri/i965/intel_tex_validate.c | 9 +- src/mesa/drivers/dri/mach64/mach64_context.c | 3 +- src/mesa/drivers/dri/mach64/mach64_dd.c | 1 - src/mesa/drivers/dri/mach64/mach64_ioctl.c | 50 +- src/mesa/drivers/dri/mach64/mach64_ioctl.h | 2 +- src/mesa/drivers/dri/mach64/mach64_screen.c | 2 +- src/mesa/drivers/dri/mach64/mach64_state.c | 15 - src/mesa/drivers/dri/mach64/mach64_texmem.c | 16 +- src/mesa/drivers/dri/mga/mga_xmesa.c | 4 +- src/mesa/drivers/dri/mga/mgacontext.h | 7 - src/mesa/drivers/dri/mga/mgadd.c | 20 +- src/mesa/drivers/dri/mga/mgaioctl.c | 16 +- src/mesa/drivers/dri/mga/mgapixel.c | 9 +- src/mesa/drivers/dri/mga/mgaspan.c | 4 +- src/mesa/drivers/dri/mga/mgastate.c | 71 +- src/mesa/drivers/dri/r128/r128_context.c | 3 +- src/mesa/drivers/dri/r128/r128_dd.c | 1 - src/mesa/drivers/dri/r128/r128_ioctl.c | 20 +- src/mesa/drivers/dri/r128/r128_span.c | 8 +- src/mesa/drivers/dri/r128/r128_state.c | 15 - src/mesa/drivers/dri/r200/r200_cmdbuf.c | 2 +- src/mesa/drivers/dri/r200/r200_context.c | 21 +- src/mesa/drivers/dri/r200/r200_context.h | 38 +- src/mesa/drivers/dri/r200/r200_fragshader.c | 6 +- src/mesa/drivers/dri/r200/r200_ioctl.c | 23 +- src/mesa/drivers/dri/r200/r200_maos_arrays.c | 84 +- src/mesa/drivers/dri/r200/r200_pixel.c | 8 - src/mesa/drivers/dri/r200/r200_reg.h | 24 +- src/mesa/drivers/dri/r200/r200_state.c | 114 +- src/mesa/drivers/dri/r200/r200_state_init.c | 40 +- src/mesa/drivers/dri/r200/r200_swtcl.c | 20 +- src/mesa/drivers/dri/r200/r200_tcl.c | 53 +- src/mesa/drivers/dri/r200/r200_tex.c | 47 +- src/mesa/drivers/dri/r200/r200_texmem.c | 4 + src/mesa/drivers/dri/r200/r200_texstate.c | 147 +- src/mesa/drivers/dri/r200/r200_vertprog.c | 377 +- src/mesa/drivers/dri/r200/r200_vertprog.h | 2 + src/mesa/drivers/dri/r300/r200_context.h | 822 -- src/mesa/drivers/dri/r300/r200_ioctl.h | 204 - src/mesa/drivers/dri/r300/r200_reg.h | 1423 ---- src/mesa/drivers/dri/r300/r200_state.h | 58 - src/mesa/drivers/dri/r300/r300_fragprog.c | 271 +- src/mesa/drivers/dri/r300/r300_fragprog.h | 3 +- src/mesa/drivers/dri/r300/r300_ioctl.c | 22 +- src/mesa/drivers/dri/r300/r300_ioctl.h | 1 - src/mesa/drivers/dri/r300/r300_reg.h | 2 + src/mesa/drivers/dri/r300/r300_state.c | 12 +- src/mesa/drivers/dri/r300/r300_tex.c | 40 +- src/mesa/drivers/dri/r300/r300_texstate.c | 67 +- src/mesa/drivers/dri/r300/radeon_context.c | 47 +- src/mesa/drivers/dri/r300/radeon_context.h | 10 +- src/mesa/drivers/dri/r300/radeon_ioctl.c | 26 +- src/mesa/drivers/dri/r300/radeon_lock.c | 82 +- src/mesa/drivers/dri/r300/radeon_mm.c | 2 +- src/mesa/drivers/dri/r300/radeon_state.c | 62 +- src/mesa/drivers/dri/r300/radeon_state.h | 2 +- src/mesa/drivers/dri/radeon/radeon_context.c | 33 +- src/mesa/drivers/dri/radeon/radeon_context.h | 11 +- src/mesa/drivers/dri/radeon/radeon_ioctl.c | 19 +- src/mesa/drivers/dri/radeon/radeon_lock.c | 14 +- src/mesa/drivers/dri/radeon/radeon_screen.c | 3 + src/mesa/drivers/dri/radeon/radeon_state.c | 36 +- src/mesa/drivers/dri/radeon/radeon_texstate.c | 41 +- src/mesa/drivers/dri/s3v/s3v_dd.c | 22 +- src/mesa/drivers/dri/s3v/s3v_state.c | 13 +- src/mesa/drivers/dri/savage/savage_init.h | 13 +- src/mesa/drivers/dri/savage/savage_xmesa.c | 63 +- src/mesa/drivers/dri/savage/savagedd.c | 20 +- src/mesa/drivers/dri/savage/savageioctl.c | 13 +- src/mesa/drivers/dri/savage/savagespan.c | 9 +- src/mesa/drivers/dri/savage/savagestate.c | 26 +- src/mesa/drivers/dri/sis/sis6326_clear.c | 25 +- src/mesa/drivers/dri/sis/sis6326_state.c | 18 - src/mesa/drivers/dri/sis/sis_clear.c | 33 +- src/mesa/drivers/dri/sis/sis_screen.c | 2 +- src/mesa/drivers/dri/sis/sis_state.c | 14 +- src/mesa/drivers/dri/sis/sis_state.h | 6 +- src/mesa/drivers/dri/tdfx/tdfx_context.c | 28 +- src/mesa/drivers/dri/tdfx/tdfx_context.h | 12 +- src/mesa/drivers/dri/tdfx/tdfx_dd.c | 135 +- src/mesa/drivers/dri/tdfx/tdfx_lock.c | 23 +- src/mesa/drivers/dri/tdfx/tdfx_pixels.c | 12 +- src/mesa/drivers/dri/tdfx/tdfx_render.c | 9 +- src/mesa/drivers/dri/tdfx/tdfx_screen.c | 14 +- src/mesa/drivers/dri/tdfx/tdfx_span.c | 29 +- src/mesa/drivers/dri/tdfx/tdfx_state.c | 13 +- src/mesa/drivers/dri/tdfx/tdfx_tex.c | 15 +- src/mesa/drivers/dri/tdfx/tdfx_texstate.c | 5 +- src/mesa/drivers/dri/trident/trident_context.c | 1 + src/mesa/drivers/dri/trident/trident_dd.c | 23 +- src/mesa/drivers/dri/trident/trident_state.c | 28 +- src/mesa/drivers/dri/unichrome/via_context.c | 170 +- src/mesa/drivers/dri/unichrome/via_context.h | 33 +- src/mesa/drivers/dri/unichrome/via_ioctl.c | 48 +- src/mesa/drivers/dri/unichrome/via_screen.c | 10 +- src/mesa/drivers/dri/unichrome/via_span.c | 10 +- src/mesa/drivers/dri/unichrome/via_state.c | 37 +- src/mesa/drivers/dri/unichrome/via_tex.c | 8 + src/mesa/drivers/fbdev/glfbdev.c | 20 +- src/mesa/drivers/ggi/ggimesa.c | 22 +- src/mesa/drivers/glide/fxdd.c | 21 +- src/mesa/drivers/osmesa/osmesa.c | 213 +- src/mesa/drivers/svga/svgamesa.c | 14 +- src/mesa/drivers/svga/svgamesa15.c | 12 +- src/mesa/drivers/svga/svgamesa16.c | 12 +- src/mesa/drivers/svga/svgamesa24.c | 12 +- src/mesa/drivers/svga/svgamesa32.c | 12 +- src/mesa/drivers/svga/svgamesa8.c | 12 +- src/mesa/drivers/windows/gdi/wmesa.c | 17 +- src/mesa/drivers/x11/fakeglx.c | 11 +- src/mesa/drivers/x11/glxapi.c | 37 +- src/mesa/drivers/x11/xm_api.c | 674 +- src/mesa/drivers/x11/xm_buffer.c | 216 +- src/mesa/drivers/x11/xm_dd.c | 364 +- src/mesa/drivers/x11/xm_span.c | 8 +- src/mesa/drivers/x11/xmesaP.h | 115 +- src/mesa/glapi/dispatch.h | 961 +-- src/mesa/glapi/glapi.c | 14 +- src/mesa/glapi/glapioffsets.h | 766 +- src/mesa/glapi/glapitable.h | 725 +- src/mesa/glapi/glapitemp.h | 1065 ++- src/mesa/glapi/glprocs.h | 2212 +++--- src/mesa/glapi/glthread.h | 8 +- src/mesa/main/accum.c | 6 +- src/mesa/main/attrib.c | 5 + src/mesa/main/blend.c | 31 + src/mesa/main/blend.h | 9 +- src/mesa/main/bufferobj.c | 9 +- src/mesa/main/buffers.c | 47 +- src/mesa/main/buffers.h | 2 + src/mesa/main/colortab.c | 330 +- src/mesa/main/colortab.h | 14 +- src/mesa/main/config.h | 8 +- src/mesa/main/context.c | 44 +- src/mesa/main/context.h | 8 + src/mesa/main/convolve.c | 35 +- src/mesa/main/dd.h | 54 +- src/mesa/main/descrip.mms | 3 + src/mesa/main/dlist.c | 22 +- src/mesa/main/enums.c | 5937 +++++++------- src/mesa/main/extensions.c | 5 +- src/mesa/main/fbobject.c | 33 +- src/mesa/main/framebuffer.c | 9 +- src/mesa/main/get.c | 39 +- src/mesa/main/getstring.c | 25 +- src/mesa/main/histogram.c | 4 +- src/mesa/main/image.c | 448 +- src/mesa/main/image.h | 42 +- src/mesa/main/imports.h | 13 +- src/mesa/main/light.c | 1 + src/mesa/main/macros.h | 24 +- src/mesa/main/mipmap.c | 1147 +++ src/mesa/main/mipmap.h | 52 + src/mesa/main/mm.c | 2 - src/mesa/main/mtypes.h | 88 +- src/mesa/main/pixel.c | 790 +- src/mesa/main/pixel.h | 42 +- src/mesa/main/rastpos.c | 1 + src/mesa/main/state.c | 67 +- src/mesa/main/state.h | 6 + src/mesa/main/stencil.c | 19 +- src/mesa/main/texcompress.c | 1 + src/mesa/main/texcompress_fxt1.c | 1 + src/mesa/main/texcompress_s3tc.c | 6 +- src/mesa/main/texenvprogram.c | 55 +- src/mesa/main/texformat_tmp.h | 119 +- src/mesa/main/teximage.c | 1088 +-- src/mesa/main/teximage.h | 21 +- src/mesa/main/texobj.c | 39 +- src/mesa/main/texobj.h | 4 + src/mesa/main/texstate.c | 125 +- src/mesa/main/texstore.c | 1742 ++--- src/mesa/main/texstore.h | 21 - src/mesa/main/version.h | 6 +- src/mesa/shader/arbprogparse.c | 14 +- src/mesa/shader/arbprogram.c | 33 +- src/mesa/shader/arbprogram.h | 8 +- src/mesa/shader/grammar/grammar.c | 49 +- src/mesa/shader/nvfragparse.c | 2 +- src/mesa/shader/nvprogram.c | 33 +- src/mesa/shader/nvvertexec.c | 351 +- src/mesa/shader/nvvertexec.h | 34 +- src/mesa/shader/nvvertparse.c | 12 +- src/mesa/shader/program.c | 231 +- src/mesa/shader/program.h | 11 +- src/mesa/shader/program_instruction.h | 2 +- src/mesa/shader/programopt.c | 196 +- src/mesa/shader/programopt.h | 2 +- src/mesa/shader/shaderobjects.c | 1723 ++-- src/mesa/shader/shaderobjects.h | 75 + src/mesa/shader/shaderobjects_3dlabs.c | 2620 ++++--- src/mesa/shader/slang/library/gc_to_bin.c | 41 +- .../shader/slang/library/slang_pp_directives_syn.h | 239 + .../shader/slang/library/slang_pp_expression_syn.h | 179 + src/mesa/shader/slang/library/slang_shader_syn.h | 3 + src/mesa/shader/slang/slang_analyse.c | 4 +- src/mesa/shader/slang/slang_assemble.c | 2479 +++--- src/mesa/shader/slang/slang_compile.c | 34 +- src/mesa/shader/slang/slang_execute_x86.c | 1114 +-- src/mesa/shader/slang/slang_link.c | 1178 +-- src/mesa/shader/slang/slang_link.h | 383 +- src/mesa/shader/slang/slang_preprocess.c | 1098 ++- src/mesa/shader/slang/slang_preprocess.h | 5 +- src/mesa/shader/slang/slang_utility.c | 95 +- src/mesa/shader/slang/slang_utility.h | 38 +- src/mesa/sources | 3 +- src/mesa/sparc/glapi_sparc.S | 242 +- src/mesa/sparc/sparc.c | 2 +- src/mesa/swrast/s_aaline.c | 2 +- src/mesa/swrast/s_aatritemp.h | 10 +- src/mesa/swrast/s_accum.c | 47 +- src/mesa/swrast/s_alpha.c | 270 +- src/mesa/swrast/s_alpha.h | 2 +- src/mesa/swrast/s_arbshader.c | 52 +- src/mesa/swrast/s_arbshader.h | 2 +- src/mesa/swrast/s_atifragshader.c | 108 +- src/mesa/swrast/s_atifragshader.h | 2 +- src/mesa/swrast/s_bitmap.c | 43 +- src/mesa/swrast/s_blend.c | 1023 +-- src/mesa/swrast/s_blend.h | 9 +- src/mesa/swrast/s_buffers.c | 100 +- src/mesa/swrast/s_context.c | 69 +- src/mesa/swrast/s_context.h | 78 +- src/mesa/swrast/s_copypix.c | 331 +- src/mesa/swrast/s_depth.c | 8 +- src/mesa/swrast/s_depth.h | 4 +- src/mesa/swrast/s_drawpix.c | 687 +- src/mesa/swrast/s_fog.c | 241 +- src/mesa/swrast/s_fog.h | 4 +- src/mesa/swrast/s_imaging.c | 8 +- src/mesa/swrast/s_lines.c | 2 +- src/mesa/swrast/s_linetemp.h | 2 +- src/mesa/swrast/s_logic.c | 110 +- src/mesa/swrast/s_logic.h | 8 +- src/mesa/swrast/s_masking.c | 158 +- src/mesa/swrast/s_masking.h | 23 +- src/mesa/swrast/s_nvfragprog.c | 567 +- src/mesa/swrast/s_nvfragprog.h | 2 +- src/mesa/swrast/s_pointtemp.h | 20 +- src/mesa/swrast/s_readpix.c | 235 +- src/mesa/swrast/s_span.c | 1088 ++- src/mesa/swrast/s_span.h | 23 +- src/mesa/swrast/s_stencil.c | 6 +- src/mesa/swrast/s_stencil.h | 2 +- src/mesa/swrast/s_texcombine.c | 10 +- src/mesa/swrast/s_texcombine.h | 2 +- src/mesa/swrast/s_texfilter.c | 6 +- src/mesa/swrast/s_texstore.c | 77 +- src/mesa/swrast/s_triangle.c | 29 +- src/mesa/swrast/s_tritemp.h | 2 +- src/mesa/swrast/s_zoom.c | 137 +- src/mesa/swrast/s_zoom.h | 10 +- src/mesa/swrast/swrast.h | 14 +- src/mesa/tnl/t_array_api.c | 20 +- src/mesa/tnl/t_array_import.c | 5 +- src/mesa/tnl/t_context.c | 5 +- src/mesa/tnl/t_context.h | 1 + src/mesa/tnl/t_vb_arbprogram.c | 3 +- src/mesa/tnl/t_vb_cliptmp.h | 17 +- src/mesa/tnl/t_vb_program.c | 14 +- src/mesa/tnl/t_vtx_api.c | 25 +- src/mesa/x86-64/glapi_x86-64.S | 5775 +++++++------- src/mesa/x86-64/matypes.h | 24 +- src/mesa/x86-64/x86-64.c | 7 +- src/mesa/x86/glapi_x86.S | 295 +- src/mesa/x86/matypes.h | 24 +- src/mesa/x86/mmx.h | 21 +- windows/VC6/mesa/mesa/mesa.dsp | 4 + windows/VC7/mesa/mesa/mesa.vcproj | 3 + 484 files changed, 63548 insertions(+), 29288 deletions(-) create mode 100755 bin/minstall delete mode 100644 debian/patches/03_handle-sync-and-dont-unlock-display.patch create mode 100644 debian/patches/03_optional-progs-and-install.patch delete mode 100644 debian/patches/04_optional-progs-and-install.patch delete mode 100644 docs/RELNOTES-6.4 delete mode 100644 docs/RELNOTES-6.4.1 delete mode 100644 docs/RELNOTES-6.4.2 delete mode 100644 docs/RELNOTES-6.5 create mode 100644 docs/dispatch.html create mode 100644 docs/relnotes-6.4.1.html create mode 100644 docs/relnotes-6.4.2.html create mode 100644 docs/relnotes-6.4.html create mode 100644 docs/relnotes-6.5.2.html create mode 100644 docs/relnotes-6.5.html create mode 100644 progs/demos/fslight.c create mode 100644 progs/demos/streaming_rect.c create mode 100644 src/mesa/drivers/dri/common/dri_bufmgr.c create mode 100644 src/mesa/drivers/dri/common/dri_bufmgr.h create mode 100644 src/mesa/drivers/dri/common/dri_bufpool.h create mode 100644 src/mesa/drivers/dri/common/dri_drmpool.c create mode 100644 src/mesa/drivers/dri/i915tex/Makefile create mode 100644 src/mesa/drivers/dri/i915tex/i830_context.c create mode 100644 src/mesa/drivers/dri/i915tex/i830_context.h create mode 100644 src/mesa/drivers/dri/i915tex/i830_metaops.c create mode 100644 src/mesa/drivers/dri/i915tex/i830_reg.h create mode 100644 src/mesa/drivers/dri/i915tex/i830_state.c create mode 100644 src/mesa/drivers/dri/i915tex/i830_tex.c create mode 100644 src/mesa/drivers/dri/i915tex/i830_texblend.c create mode 100644 src/mesa/drivers/dri/i915tex/i830_texstate.c create mode 100644 src/mesa/drivers/dri/i915tex/i830_vtbl.c create mode 100644 src/mesa/drivers/dri/i915tex/i915_context.c create mode 100644 src/mesa/drivers/dri/i915tex/i915_context.h create mode 100644 src/mesa/drivers/dri/i915tex/i915_debug.c create mode 100644 src/mesa/drivers/dri/i915tex/i915_fragprog.c create mode 100644 src/mesa/drivers/dri/i915tex/i915_metaops.c create mode 100644 src/mesa/drivers/dri/i915tex/i915_program.c create mode 100644 src/mesa/drivers/dri/i915tex/i915_program.h create mode 100644 src/mesa/drivers/dri/i915tex/i915_reg.h create mode 100644 src/mesa/drivers/dri/i915tex/i915_state.c create mode 100644 src/mesa/drivers/dri/i915tex/i915_tex.c create mode 100644 src/mesa/drivers/dri/i915tex/i915_tex_layout.c create mode 100644 src/mesa/drivers/dri/i915tex/i915_texstate.c create mode 100644 src/mesa/drivers/dri/i915tex/i915_vtbl.c create mode 100644 src/mesa/drivers/dri/i915tex/intel_batchbuffer.c create mode 100644 src/mesa/drivers/dri/i915tex/intel_batchbuffer.h create mode 100644 src/mesa/drivers/dri/i915tex/intel_batchpool.c create mode 100644 src/mesa/drivers/dri/i915tex/intel_blit.c create mode 100644 src/mesa/drivers/dri/i915tex/intel_blit.h create mode 100644 src/mesa/drivers/dri/i915tex/intel_buffer_objects.c create mode 100644 src/mesa/drivers/dri/i915tex/intel_buffer_objects.h create mode 100644 src/mesa/drivers/dri/i915tex/intel_buffers.c create mode 100644 src/mesa/drivers/dri/i915tex/intel_buffers.h create mode 100644 src/mesa/drivers/dri/i915tex/intel_context.c create mode 100644 src/mesa/drivers/dri/i915tex/intel_context.h create mode 100644 src/mesa/drivers/dri/i915tex/intel_depthstencil.c create mode 100644 src/mesa/drivers/dri/i915tex/intel_depthstencil.h create mode 100644 src/mesa/drivers/dri/i915tex/intel_fbo.c create mode 100644 src/mesa/drivers/dri/i915tex/intel_fbo.h create mode 100644 src/mesa/drivers/dri/i915tex/intel_ioctl.c create mode 100644 src/mesa/drivers/dri/i915tex/intel_ioctl.h create mode 100644 src/mesa/drivers/dri/i915tex/intel_mipmap_tree.c create mode 100644 src/mesa/drivers/dri/i915tex/intel_mipmap_tree.h create mode 100644 src/mesa/drivers/dri/i915tex/intel_pixel.c create mode 100644 src/mesa/drivers/dri/i915tex/intel_pixel.h create mode 100644 src/mesa/drivers/dri/i915tex/intel_pixel_bitmap.c create mode 100644 src/mesa/drivers/dri/i915tex/intel_pixel_copy.c create mode 100644 src/mesa/drivers/dri/i915tex/intel_pixel_draw.c create mode 100644 src/mesa/drivers/dri/i915tex/intel_pixel_read.c create mode 100644 src/mesa/drivers/dri/i915tex/intel_reg.h create mode 100644 src/mesa/drivers/dri/i915tex/intel_regions.c create mode 100644 src/mesa/drivers/dri/i915tex/intel_regions.h create mode 100644 src/mesa/drivers/dri/i915tex/intel_render.c create mode 100644 src/mesa/drivers/dri/i915tex/intel_rotate.c create mode 100644 src/mesa/drivers/dri/i915tex/intel_rotate.h create mode 100644 src/mesa/drivers/dri/i915tex/intel_screen.c create mode 100644 src/mesa/drivers/dri/i915tex/intel_screen.h create mode 100644 src/mesa/drivers/dri/i915tex/intel_span.c create mode 100644 src/mesa/drivers/dri/i915tex/intel_span.h create mode 100644 src/mesa/drivers/dri/i915tex/intel_state.c create mode 100644 src/mesa/drivers/dri/i915tex/intel_structs.h create mode 100644 src/mesa/drivers/dri/i915tex/intel_tex.c create mode 100644 src/mesa/drivers/dri/i915tex/intel_tex.h create mode 100644 src/mesa/drivers/dri/i915tex/intel_tex_copy.c create mode 100644 src/mesa/drivers/dri/i915tex/intel_tex_format.c create mode 100644 src/mesa/drivers/dri/i915tex/intel_tex_image.c create mode 100644 src/mesa/drivers/dri/i915tex/intel_tex_subimage.c create mode 100644 src/mesa/drivers/dri/i915tex/intel_tex_validate.c create mode 100644 src/mesa/drivers/dri/i915tex/intel_tris.c create mode 100644 src/mesa/drivers/dri/i915tex/intel_tris.h create mode 100644 src/mesa/drivers/dri/i915tex/server/i830_common.h create mode 100644 src/mesa/drivers/dri/i915tex/server/i830_dri.h create mode 100644 src/mesa/drivers/dri/i915tex/server/intel.h create mode 100644 src/mesa/drivers/dri/i915tex/server/intel_dri.c create mode 100644 src/mesa/drivers/dri/i965/intel_pixel_bitmap.c create mode 100644 src/mesa/drivers/dri/i965/intel_pixel_copy.c create mode 100644 src/mesa/drivers/dri/i965/intel_structs.h delete mode 100644 src/mesa/drivers/dri/r300/r200_context.h delete mode 100644 src/mesa/drivers/dri/r300/r200_ioctl.h delete mode 100644 src/mesa/drivers/dri/r300/r200_reg.h delete mode 100644 src/mesa/drivers/dri/r300/r200_state.h create mode 100644 src/mesa/main/mipmap.c create mode 100644 src/mesa/main/mipmap.h create mode 100644 src/mesa/shader/slang/library/slang_pp_directives_syn.h create mode 100644 src/mesa/shader/slang/library/slang_pp_expression_syn.h (limited to 'debian') diff --git a/Makefile b/Makefile index 2fd8d35af9b..b280298daf5 100644 --- a/Makefile +++ b/Makefile @@ -154,16 +154,17 @@ ultrix-gcc: # Rules for making release tarballs -DIRECTORY = Mesa-6.5.1 -LIB_NAME = MesaLib-6.5.1 -DEMO_NAME = MesaDemos-6.5.1 -GLUT_NAME = MesaGLUT-6.5.1 +DIRECTORY = Mesa-6.5.2 +LIB_NAME = MesaLib-6.5.2 +DEMO_NAME = MesaDemos-6.5.2 +GLUT_NAME = MesaGLUT-6.5.2 MAIN_FILES = \ $(DIRECTORY)/Makefile* \ $(DIRECTORY)/descrip.mms \ $(DIRECTORY)/mms-config. \ $(DIRECTORY)/bin/mklib \ + $(DIRECTORY)/bin/minstall \ $(DIRECTORY)/configs/[a-z]* \ $(DIRECTORY)/docs/*.html \ $(DIRECTORY)/docs/COPYING \ diff --git a/bin/minstall b/bin/minstall new file mode 100755 index 00000000000..9795263f9f1 --- /dev/null +++ b/bin/minstall @@ -0,0 +1,88 @@ +#!/bin/sh + + +# A minimal replacement for 'install' that supports installing symbolic links. +# Only a limited number of options are supported: +# -d dir Create a directory +# -m mode Sets a file's mode when installing + + +# If these commands aren't portable, we'll need some "if (arch)" type stuff +SYMLINK="ln -s" +MKDIR="mkdir -p" +RM="rm -f" + +MODE="" + +if [ "$1" = "-d" ] ; then + # make a directory path + $MKDIR "$2" + exit 0 +fi + +if [ "$1" = "-m" ] ; then + # set file mode + MODE=$2 + shift 2 +fi + +# install file(s) into destination +if [ $# -ge 2 ] ; then + + # Last cmd line arg is the dest dir + for FILE in $@ ; do + DEST="$FILE" + done + + # Loop over args, moving them to DEST directory + I=1 + for FILE in $@ ; do + if [ $I = $# ] ; then + # stop, don't want to install $DEST into $DEST + exit 0 + fi + + # determine file's type + if [ -h "$FILE" ] ; then + #echo $FILE is a symlink + # Unfortunately, cp -d isn't universal so we have to + # use a work-around. + + # Use ls -l to find the target that the link points to + LL=`ls -l "$FILE"` + for L in $LL ; do + TARGET=$L + done + #echo $FILE is a symlink pointing to $TARGET + + FILE=`basename "$FILE"` + # Go to $DEST and make the link + PWDSAVE="$PWD" + cd "$DEST" # pushd + $RM "$FILE" + $SYMLINK "$TARGET" "$FILE" + cd "$PWDSAVE" # popd + + elif [ -f "$FILE" ] ; then + #echo "$FILE" is a regular file + cp "$FILE" "$DEST" + if [ $MODE ] ; then + FILE=`basename "$FILE"` + chmod $MODE "$DEST/$FILE" + fi + else + echo "Unknown type of argument: " "$FILE" + exit 1 + fi + + I=`expr $I + 1` + done + + exit 0 +fi + +# If we get here, we didn't find anything to do +echo "Usage:" +echo " install -d dir Create named directory" +echo " install [-m mode] file [...] dest Install files in destination" + diff --git a/bin/mklib b/bin/mklib index 0637662ff7c..7d468b12e77 100755 --- a/bin/mklib +++ b/bin/mklib @@ -283,7 +283,9 @@ case $ARCH in ar -ruv ${LIBNAME} ${OBJECTS} FINAL_LIBS=${LIBNAME} else - LIBNAME="lib${LIBNAME}.so" + if [ $NOPREFIX = 0 ] ; then + LIBNAME="lib${LIBNAME}.so" + fi echo "mklib: Making SunOS shared library: " ${LIBNAME} if [ "x$LINK" = "x" ] ; then @@ -333,9 +335,14 @@ case $ARCH in # for debug: #echo "mklib: linker is" ${LINK} ${OPTS} - rm -f ${LIBNAME}.${MAJOR} ${LIBNAME} - ${LINK} ${OPTS} -o ${LIBNAME}.${MAJOR} ${OBJECTS} ${DEPS} - ln -s ${LIBNAME}.${MAJOR} ${LIBNAME} + if [ $NOPREFIX = 1 ] ; then + rm -f ${LIBNAME} + ${LINK} ${OPTS} -o ${LIBNAME} ${OBJECTS} ${DEPS} + else + rm -f ${LIBNAME}.${MAJOR} ${LIBNAME} + ${LINK} ${OPTS} -o ${LIBNAME}.${MAJOR} ${OBJECTS} ${DEPS} + ln -s ${LIBNAME}.${MAJOR} ${LIBNAME} + fi FINAL_LIBS="${LIBNAME}.${MAJOR} ${LIBNAME}" fi ;; diff --git a/configs/aix b/configs/aix index 313d4c4fdb3..ebbf5837455 100644 --- a/configs/aix +++ b/configs/aix @@ -13,7 +13,6 @@ CXXFLAGS = -O -DAIXV3 -DPTHREADS # Misc tools and flags MKLIB_OPTIONS = -COPY_LIBS = cp -f -h # Library names (actual file names) GL_LIB_NAME = libGL.a diff --git a/configs/default b/configs/default index 23d7aedfbf5..e805925701a 100644 --- a/configs/default +++ b/configs/default @@ -10,7 +10,7 @@ CONFIG_NAME = default # Version info MESA_MAJOR=6 MESA_MINOR=5 -MESA_TINY=1 +MESA_TINY=2 # external projects. This should be useless now that we use libdrm. DRM_SOURCE_PATH=$(TOP)/../drm @@ -27,8 +27,7 @@ MKLIB_OPTIONS = MKDEP = makedepend MKDEP_OPTIONS = -fdepend MAKE = make -INSTALL = install -COPY_LIBS = cp -f -d +INSTALL = $(TOP)/bin/minstall # Python and flags (generally only needed by the developers) PYTHON2 = python diff --git a/configs/freebsd b/configs/freebsd index 38806ab946d..db7dd3b78a0 100644 --- a/configs/freebsd +++ b/configs/freebsd @@ -9,9 +9,6 @@ CC = cc CXX = c++ MAKE = gmake -# cp -d not supported on FreeBSD (see bug 4435) -COPY_LIBS = cp -f - OPT_FLAGS = -O2 PIC_FLAGS = -fPIC diff --git a/configs/freebsd-dri b/configs/freebsd-dri index 104e242289c..68877c612e7 100644 --- a/configs/freebsd-dri +++ b/configs/freebsd-dri @@ -14,22 +14,24 @@ OPT_FLAGS = -O EXPAT_INCLUDES = -I/usr/local/include X11_INCLUDES = -I/usr/X11R6/include DEFINES = -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER \ - -DGLX_DIRECT_RENDERING -DHAVE_ALIAS -DHAVE_POSIX_MEMALIGN + -DGLX_DIRECT_RENDERING -DGLX_INDIRECT_RENDERING \ + -DHAVE_ALIAS -DHAVE_POSIX_MEMALIGN -CFLAGS = -Wmissing-prototypes -g -std=c99 -Wundef -fPIC -ffast-math \ +CFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) -Wmissing-prototypes -std=c99 -Wundef -ffast-math \ $(ASM_FLAGS) $(X11_INCLUDES) $(DEFINES) -CXXFLAGS = $(DEFINES) -Wall -g -ansi -pedantic -fPIC +CXXFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(DEFINES) -Wall -ansi -pedantic $(ASM_FLAGS) $(X11_INCLUDES) ASM_SOURCES = # Library/program dependencies +LIBDRM_CFLAGS = `pkg-config --cflags libdrm` LIBDRM_LIB = `pkg-config --libs libdrm` DRI_LIB_DEPS = -L/usr/local/lib -lm -lpthread -lexpat $(LIBDRM_LIB) GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lXxf86vm -lm -lpthread $(LIBDRM_LIB) GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -L/usr/X11R6/lib -lGLU -lGL -lX11 -lXmu -lXt -lXi -lm -GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -L/usr/X11R6/lib -lGL -lXt -lXm -lX11 +GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -L/usr/X11R6/lib -lGL -lXt -lX11 # Directories diff --git a/configs/linux-dri b/configs/linux-dri index 1c3b404cf3a..7e822e2eb61 100644 --- a/configs/linux-dri +++ b/configs/linux-dri @@ -22,7 +22,8 @@ ARCH_FLAGS ?= DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \ -D_BSD_SOURCE -D_GNU_SOURCE \ -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER \ - -DGLX_DIRECT_RENDERING -DHAVE_ALIAS -DHAVE_POSIX_MEMALIGN + -DGLX_DIRECT_RENDERING -DGLX_INDIRECT_RENDERING \ + -DHAVE_ALIAS -DHAVE_POSIX_MEMALIGN X11_INCLUDES = -I/usr/X11R6/include @@ -64,5 +65,5 @@ WINDOW_SYSTEM=dri # gamma are missing because they have not been converted to use the new # interface. -DRI_DIRS = i810 i915 i965 mach64 mga r128 r200 r300 radeon s3v \ +DRI_DIRS = i810 i915tex i915 i965 mach64 mga r128 r200 r300 radeon s3v \ savage sis tdfx trident unichrome ffb diff --git a/configs/linux-dri-xcb b/configs/linux-dri-xcb index 68acb2f2b16..cb327fa60f9 100644 --- a/configs/linux-dri-xcb +++ b/configs/linux-dri-xcb @@ -24,7 +24,7 @@ DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \ -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER \ -DGLX_DIRECT_RENDERING -DHAVE_ALIAS -DUSE_XCB -DHAVE_POSIX_MEMALIGN -X11_INCLUDES = `pkg-config --cflags-only-I x11` `pkg-config --cflags-only-I xcb` `pkg-config --cflags-only-I xcb-glx` +X11_INCLUDES = `pkg-config --cflags-only-I x11` `pkg-config --cflags-only-I xcb` `pkg-config --cflags-only-I x11-xcb` `pkg-config --cflags-only-I xcb-glx` CFLAGS = -Wall -Wmissing-prototypes $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) \ $(DEFINES) $(ASM_FLAGS) -std=c99 -ffast-math @@ -37,10 +37,11 @@ ASM_SOURCES = # Library/program dependencies EXTRA_LIB_PATH=`pkg-config --libs-only-L x11` +LIBDRM_CFLAGS = `pkg-config --cflags libdrm` LIBDRM_LIB = `pkg-config --libs libdrm` DRI_LIB_DEPS = $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl $(LIBDRM_LIB) GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lm -lpthread -ldl \ - $(LIBDRM_LIB) `pkg-config --libs xcb` `pkg-config --libs xcb-glx` + $(LIBDRM_LIB) `pkg-config --libs xcb` `pkg-config --libs x11-xcb` `pkg-config --libs xcb-glx` # This is now 0 by default since it seems to confuse the hell out of people diff --git a/configs/linux-indirect b/configs/linux-indirect index b764515786d..bd33345ed70 100644 --- a/configs/linux-indirect +++ b/configs/linux-indirect @@ -23,6 +23,7 @@ ARCH_FLAGS ?= DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \ -D_BSD_SOURCE -D_GNU_SOURCE \ + -DGLX_INDIRECT_RENDERING \ -DPTHREADS -DHAVE_ALIAS -DHAVE_POSIX_MEMALIGN X11_INCLUDES = -I/usr/X11R6/include diff --git a/debian/changelog b/debian/changelog index 16f6303982c..59de3401145 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +mesa (6.5.2~rc1-1) experimental; urgency=low + + * 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. + + -- Thierry Reding Sat, 18 Nov 2006 18:52:55 +0100 + mesa (6.5.1-1) experimental; urgency=low * Provide i686 optimized versions in libgl1-mesa-swx11-i686. diff --git a/debian/patches/01_fix-makefile.patch b/debian/patches/01_fix-makefile.patch index f599d8438e1..6711d2fe5cd 100644 --- a/debian/patches/01_fix-makefile.patch +++ b/debian/patches/01_fix-makefile.patch @@ -1,11 +1,7 @@ Do not build OSMesa for a standalone configuration, since Debian only ships OSMesa in a separate package. -Fix Mesa makefile to install the libGL and libOSMesa libraries when they -exist, not only depending on configuration. - This patch by Thierry Reding. -Hunk #2 submitted to Mesa and applied (post 6.5.1). --- a/src/mesa/Makefile +++ b/src/mesa/Makefile @@ -18,17 +14,3 @@ Hunk #2 submitted to Mesa and applied (post 6.5.1). osmesa-only: depend subdirs $(TOP)/$(LIB_DIR)/$(OSMESA_LIB_NAME) -@@ -154,7 +154,12 @@ - $(INSTALL) -d $(INSTALL_DIR)/include/GL - $(INSTALL) -d $(INSTALL_DIR)/$(LIB_DIR) - $(INSTALL) -m 644 $(TOP)/include/GL/*.h $(INSTALL_DIR)/include/GL -- $(COPY_LIBS) $(TOP)/$(LIB_DIR)/libGL.* $(INSTALL_DIR)/$(LIB_DIR) -+ @if [ -e $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) ]; then \ -+ $(COPY_LIBS) $(TOP)/$(LIB_DIR)/lib$(GL_LIB).* $(INSTALL_DIR)/$(LIB_DIR); \ -+ fi -+ @if [ -e $(TOP)/$(LIB_DIR)/$(OSMESA_LIB_NAME) ]; then \ -+ $(COPY_LIBS) $(TOP)/$(LIB_DIR)/lib$(OSMESA_LIB).* $(INSTALL_DIR)/$(LIB_DIR); \ -+ fi - @if [ "${DRIVER_DIRS}" = "dri" ] ; then \ - cd drivers/dri ; $(MAKE) install ; \ - fi diff --git a/debian/patches/03_handle-sync-and-dont-unlock-display.patch b/debian/patches/03_handle-sync-and-dont-unlock-display.patch deleted file mode 100644 index d29769e4330..00000000000 --- a/debian/patches/03_handle-sync-and-dont-unlock-display.patch +++ /dev/null @@ -1,20 +0,0 @@ -Patch that fixes Debian bug #391681. - -This patch by Josh Triplett. -Submitted to Mesa and applied (post 6.5.1). - ---- a/src/glx/x11/glxext.c -+++ b/src/glx/x11/glxext.c -@@ -1016,11 +1016,11 @@ - if (!_XReply(dpy, (xReply*) &reply, 0, False)) { - /* Something is busted. Punt. */ - UnlockDisplay(dpy); -+ SyncHandle(); - FreeScreenConfigs(priv); - return GL_FALSE; - } - -- UnlockDisplay(dpy); - if (!reply.numVisuals) { - /* This screen does not support GL rendering */ - UnlockDisplay(dpy); diff --git a/debian/patches/03_optional-progs-and-install.patch b/debian/patches/03_optional-progs-and-install.patch new file mode 100644 index 00000000000..66a4771003b --- /dev/null +++ b/debian/patches/03_optional-progs-and-install.patch @@ -0,0 +1,45 @@ +Allow the programs that are to be built to be defined in the build +configuration. + +Provide an install target for installing the programs in $(INSTALL_DIR)/bin. + +This patch by Thierry Reding. +Not submitted to Mesa. + +--- a/progs/xdemos/Makefile ++++ b/progs/xdemos/Makefile +@@ -8,7 +8,7 @@ + + LIB_DEP = $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) $(TOP)/$(LIB_DIR)/$(GLU_LIB_NAME) + +-PROGS = glthreads \ ++PROGS ?= glthreads \ + glxdemo \ + glxgears \ + glxgears_fbconfig \ +@@ -44,6 +44,9 @@ + + default: $(PROGS) + ++install: $(PROGS) ++ $(INSTALL) -d $(INSTALL_DIR)/bin ++ $(INSTALL) -m 755 $(PROGS) $(INSTALL_DIR)/bin + + clean: + -rm -f $(PROGS) +--- a/progs/Makefile ++++ b/progs/Makefile +@@ -21,8 +21,12 @@ + fi \ + done + +-# Dummy install target + install: ++ @for dir in $(SUBDIRS) ; do \ ++ if [ -d $$dir ] ; then \ ++ (cd $$dir ; $(MAKE) install) ; \ ++ fi \ ++ done + + clean: + @for dir in $(SUBDIRS) tests ; do \ diff --git a/debian/patches/04_optional-progs-and-install.patch b/debian/patches/04_optional-progs-and-install.patch deleted file mode 100644 index 66a4771003b..00000000000 --- a/debian/patches/04_optional-progs-and-install.patch +++ /dev/null @@ -1,45 +0,0 @@ -Allow the programs that are to be built to be defined in the build -configuration. - -Provide an install target for installing the programs in $(INSTALL_DIR)/bin. - -This patch by Thierry Reding. -Not submitted to Mesa. - ---- a/progs/xdemos/Makefile -+++ b/progs/xdemos/Makefile -@@ -8,7 +8,7 @@ - - LIB_DEP = $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) $(TOP)/$(LIB_DIR)/$(GLU_LIB_NAME) - --PROGS = glthreads \ -+PROGS ?= glthreads \ - glxdemo \ - glxgears \ - glxgears_fbconfig \ -@@ -44,6 +44,9 @@ - - default: $(PROGS) - -+install: $(PROGS) -+ $(INSTALL) -d $(INSTALL_DIR)/bin -+ $(INSTALL) -m 755 $(PROGS) $(INSTALL_DIR)/bin - - clean: - -rm -f $(PROGS) ---- a/progs/Makefile -+++ b/progs/Makefile -@@ -21,8 +21,12 @@ - fi \ - done - --# Dummy install target - install: -+ @for dir in $(SUBDIRS) ; do \ -+ if [ -d $$dir ] ; then \ -+ (cd $$dir ; $(MAKE) install) ; \ -+ fi \ -+ done - - clean: - @for dir in $(SUBDIRS) tests ; do \ diff --git a/debian/patches/series b/debian/patches/series index 327a78f2151..b370d514349 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,5 +1,4 @@ 00_create-libdir.patch 01_fix-makefile.patch 02_use-ieee-fp-on-s390-and-m68k.patch -03_handle-sync-and-dont-unlock-display.patch -04_optional-progs-and-install.patch +03_optional-progs-and-install.patch diff --git a/descrip.mms b/descrip.mms index 11d94988916..f2f84349130 100644 --- a/descrip.mms +++ b/descrip.mms @@ -19,4 +19,4 @@ all : $(MMS)$(MMSQUALIFIERS) set default [-.xdemos] $(MMS)$(MMSQUALIFIERS) - if f$search("[-]test.DIR") .nes. "" then pipe set default [-.test] ; $(MMS)$(MMSQUALIFIERS) + if f$search("[-]tests.DIR") .nes. "" then pipe set default [-.tests] ; $(MMS)$(MMSQUALIFIERS) diff --git a/docs/RELNOTES-6.4 b/docs/RELNOTES-6.4 deleted file mode 100644 index a12600c3c83..00000000000 --- a/docs/RELNOTES-6.4 +++ /dev/null @@ -1,50 +0,0 @@ - - Mesa 6.4 Release Notes - - October 24, 2005 - - - -Introduction ------------- - -Mesa uses an even/odd version number scheme like the Linux kernel. -Odd numbered versions (such as 6.3) designate new developmental releases. -Even numbered versions (such as 6.4) designate stable releases. - - -6.4 is a bug-fix release. See the VERSIONS file for details. - - - -GLUT tarball ------------- - -Starting with 6.4, the GLUT library sources are distributed in a separate -tarball. This was done at the request of Linux distro vendors who prefer -to use freeglut. - - - - -Driver Status ----------------------- ---------------------- -DRI drivers varies with the driver -XMesa (Xlib) implements OpenGL 1.5 -OSMesa (off-screen) implements OpenGL 1.5 -Windows/Win32 implements OpenGL 1.5 -Glide (3dfx Voodoo1/2) requires updates -SVGA requires updates -DJGPP requires updates -GGI requires updates -BeOS requires updates -Allegro requires updates -D3D requires updates - -The drivers which require updates mostly need to be updated to work -with the new gl_renderbuffer / gl_framebuffer infrastructure introduced -in Mesa 6.3. - - ----------------------------------------------------------------------- -$Id: RELNOTES-6.4,v 3.1 2005/10/24 23:33:27 brianp Exp $ diff --git a/docs/RELNOTES-6.4.1 b/docs/RELNOTES-6.4.1 deleted file mode 100644 index 4a867e77825..00000000000 --- a/docs/RELNOTES-6.4.1 +++ /dev/null @@ -1,47 +0,0 @@ - - Mesa 6.4.1 Release Notes - - -Introduction ------------- - -Mesa uses an even/odd version number scheme like the Linux kernel. -Odd numbered versions (such as 6.3) designate new developmental releases. -Even numbered versions (such as 6.4) designate stable releases. - - -6.4.1 is a bug-fix release. See the VERSIONS file for details. - - - -GLUT tarball ------------- - -Starting with 6.4, the GLUT library sources are distributed in a separate -tarball. This was done at the request of Linux distro vendors who prefer -to use freeglut. - - - - -Driver Status ----------------------- ---------------------- -DRI drivers varies with the driver -XMesa (Xlib) implements OpenGL 1.5 -OSMesa (off-screen) implements OpenGL 1.5 -Windows/Win32 implements OpenGL 1.5 -Glide (3dfx Voodoo1/2) requires updates -SVGA requires updates -DJGPP requires updates -GGI requires updates -BeOS requires updates -Allegro requires updates -D3D requires updates - -The drivers which require updates mostly need to be updated to work -with the new gl_renderbuffer / gl_framebuffer infrastructure introduced -in Mesa 6.3. - - ----------------------------------------------------------------------- -$Id: RELNOTES-6.4.1,v 3.1 2006/02/03 17:21:54 brianp Exp $ diff --git a/docs/RELNOTES-6.4.2 b/docs/RELNOTES-6.4.2 deleted file mode 100644 index f9312157b1a..00000000000 --- a/docs/RELNOTES-6.4.2 +++ /dev/null @@ -1,47 +0,0 @@ - - Mesa 6.4.2 Release Notes - - -Introduction ------------- - -Mesa uses an even/odd version number scheme like the Linux kernel. -Odd numbered versions (such as 6.3) designate new developmental releases. -Even numbered versions (such as 6.4) designate stable releases. - - -6.4.2 is a minor bug-fix release. See the VERSIONS file for details. - - - -GLUT tarball ------------- - -Starting with 6.4, the GLUT library sources are distributed in a separate -tarball. This was done at the request of Linux distro vendors who prefer -to use freeglut. - - - - -Driver Status ----------------------- ---------------------- -DRI drivers varies with the driver -XMesa (Xlib) implements OpenGL 1.5 -OSMesa (off-screen) implements OpenGL 1.5 -Windows/Win32 implements OpenGL 1.5 -Glide (3dfx Voodoo1/2) requires updates -SVGA requires updates -DJGPP requires updates -GGI requires updates -BeOS requires updates -Allegro requires updates -D3D requires updates - -The drivers which require updates mostly need to be updated to work -with the new gl_renderbuffer / gl_framebuffer infrastructure introduced -in Mesa 6.3. - - ----------------------------------------------------------------------- -$Id: RELNOTES-6.4.2,v 3.1 2006/02/03 17:21:54 brianp Exp $ diff --git a/docs/RELNOTES-6.5 b/docs/RELNOTES-6.5 deleted file mode 100644 index f51b1bde386..00000000000 --- a/docs/RELNOTES-6.5 +++ /dev/null @@ -1,97 +0,0 @@ - - Mesa 6.5 Release Notes - - - -Introduction ------------- - -Mesa uses an even/odd version number scheme like the Linux kernel. -Odd numbered versions (such as 6.5) designate new developmental releases. -Even numbered versions (such as 6.4) designate stable releases. - - - -New Features ------------- - -OpenGL Shading language support - This includes the GL_ARB_shader_objects, GL_ARB_shading_language_100, - GL_ARB_vertex_shader and GL_ARB_fragment_shader extensions. Most of - the work was done by Michal Krol. - There's probably a fair number of bugs since this is a pretty large, - complicated body of code. - - The OpenGL 2.0 interface to these features will be implemented in a - future version of Mesa, - -GL_EXT_timer_query - Used to measure the time of OpenGL operations at high precision. - Only supported in the software/Xlib driver at this time. - -GL_EXT_packed_depth_stencil - Defines a new GL_DEPTH_STENCIL_EXT pixel format. - -GL_EXT_framebuffer_blit - A simplified glCopyPixels-like feature for copying pixel rectangles. - -GL_ARB_half_float_pixel - Adds a new half-precision floating point format for image transfers, - such as for glDrawPixels, glReadPixels, glTexImage, etc. - - - -Removed Extensions ------------------- - -The following extensions have been removed: - - GL_HP_occlusion_test - this is superceded by GL_ARB_occlusion_query. - - - -Known Issues ------------- - -Rendering to depth textures will not work. Rendering to GL_DEPTH_STENCIL -textures should work. - - - -Driver Interface Changes ------------------------- - -Stencil: The Driver.StencilOp/Func/Mask() functions have been replaced by -the two-sided versions: Driver.Stencil*Separate(). - -Render-to-texture: The functions for rendering to textures have changed. - - - -To Do (someday) items ---------------------- - Switch to freeglut - Increase MAX_DRAWBUFFERS - Fix linux-glide target/driver. - Fix lambda calculation for frag progs. - - - -Driver Status ----------------------- ---------------------- -DRI drivers varies with the driver -XMesa/GLX (on Xlib) implements OpenGL 1.5 -OSMesa (off-screen) implements OpenGL 1.5 -Glide (3dfx Voodoo1/2) implements OpenGL 1.3 -SVGA implements OpenGL 1.3 -Wind River UGL implements OpenGL 1.3 -Windows/Win32 implements OpenGL 1.5 -DJGPP implements OpenGL 1.5 -GGI implements OpenGL 1.3 -BeOS implements OpenGL 1.5 -Allegro needs updating -D3D needs updating - - ----------------------------------------------------------------------- -$Id: RELNOTES-6.5,v 3.4 2006/03/29 04:53:02 brianp Exp $ diff --git a/docs/contents.html b/docs/contents.html index 40cefa26e7a..9f09df97374 100644 --- a/docs/contents.html +++ b/docs/contents.html @@ -28,7 +28,6 @@ a:visited {
  • Platforms and Drivers
  • License & Copyright
  • FAQ -
  • Version History
  • Release Notes
  • Acknowledgements
  • Conformance Testing @@ -74,6 +73,7 @@ a:visited {
  • fbdev/DRI Environment
  • glFBDev Driver
  • Custom Development +
  • GL Dispatch Links diff --git a/docs/devinfo.html b/docs/devinfo.html index 4d4730be757..cce14d73a36 100644 --- a/docs/devinfo.html +++ b/docs/devinfo.html @@ -34,11 +34,15 @@ To add a new GL extension to Mesa you have to do at least the following. corresponding Python scripts.
  • - Find an existing extension that's similar to the new one and search - the sources for code related to that extension. - Implement new code as needed. - In general, new state variables will be added to mtypes.h. If the - extension is rather large, try to implement it in a new source file. + Add a new entry to the gl_extensions struct in mtypes.h +
  • +
  • + Update the extensions.c file. +
  • +
  • + From this point, the best way to proceed is to find another extension, + similar to the new one, that's already implemented in Mesa and use it + as an example.
  • If the new extension adds new GL state, the functions in get.c, enable.c diff --git a/docs/dispatch.html b/docs/dispatch.html new file mode 100644 index 00000000000..b9ea8822e60 --- /dev/null +++ b/docs/dispatch.html @@ -0,0 +1,274 @@ + + +GL Dispatch in Mesa + + + + +

    GL Dispatch in Mesa

    + +

    Several factors combine to make efficient dispatch of OpenGL functions +fairly complicated. This document attempts to explain some of the issues +and introduce the reader to Mesa's implementation. Readers already familiar +with the issues around GL dispatch can safely skip ahead to the overview of Mesa's implementation.

    + +

    1. Complexity of GL Dispatch

    + +

    Every GL application has at least one object called a GL context. +This object, which is an implicit parameter to ever GL function, stores all +of the GL related state for the application. Every texture, every buffer +object, every enable, and much, much more is stored in the context. Since +an application can have more than one context, the context to be used is +selected by a window-system dependent function such as +glXMakeContextCurrent.

    + +

    In environments that implement OpenGL with X-Windows using GLX, every GL +function, including the pointers returned by glXGetProcAddress, are +context independent. This means that no matter what context is +currently active, the same glVertex3fv function is used.

    + +

    This creates the first bit of dispatch complexity. An application can +have two GL contexts. One context is a direct rendering context where +function calls are routed directly to a driver loaded within the +application's address space. The other context is an indirect rendering +context where function calls are converted to GLX protocol and sent to a +server. The same glVertex3fv has to do the right thing depending +on which context is current.

    + +

    Highly optimized drivers or GLX protocol implementations may want to +change the behavior of GL functions depending on current state. For +example, glFogCoordf may operate differently depending on whether +or not fog is enabled.

    + +

    In multi-threaded environments, it is possible for each thread to have a +differnt GL context current. This means that poor old glVertex3fv +has to know which GL context is current in the thread where it is being +called.

    + + +

    2. Overview of Mesa's Implementation

    + +

    Mesa uses two per-thread pointers. The first pointer stores the address +of the context current in the thread, and the second pointer stores the +address of the dispatch table associated with that context. The +dispatch table stores pointers to functions that actually implement +specific GL functions. Each time a new context is made current in a thread, +these pointers a updated.

    + +

    The implementation of functions such as glVertex3fv becomes +conceptually simple:

    + +
      +
    • Fetch the current dispatch table pointer.
    • +
    • Fetch the pointer to the real glVertex3fv function from the +table.
    • +
    • Call the real function.
    • +
    + +

    This can be implemented in just a few lines of C code. The file +src/mesa/glapi/glapitemp.h contains code very similar to this.

    + +
    + + +
    +void glVertex3f(GLfloat x, GLfloat y, GLfloat z)
    +{
    +    const struct _glapi_table * const dispatch = GET_DISPATCH();
    +    
    +    (*dispatch->Vertex3f)(x, y, z);
    +}
    Sample dispatch function
    +
    + +

    The problem with this simple implementation is the large amount of +overhead that it adds to every GL function call.

    + +

    In a multithreaded environment, a niave implementation of +GET_DISPATCH involves a call to pthread_getspecific or a +similar function. Mesa provides a wrapper function called +_glapi_get_dispatch that is used by default.

    + +

    3. Optimizations

    + +

    A number of optimizations have been made over the years to diminish the +performance hit imposed by GL dispatch. This section describes these +optimizations. The benefits of each optimization and the situations where +each can or cannot be used are listed.

    + +

    3.1. Dual dispatch table pointers

    + +

    The vast majority of OpenGL applications use the API in a single threaded +manner. That is, the application has only one thread that makes calls into +the GL. In these cases, not only do the calls to +pthread_getspecific hurt performance, but they are completely +unnecessary! It is possible to detect this common case and avoid these +calls.

    + +

    Each time a new dispatch table is set, Mesa examines and records the ID +of the executing thread. If the same thread ID is always seen, Mesa knows +that the application is, from OpenGL's point of view, single threaded.

    + +

    As long as an application is single threaded, Mesa stores a pointer to +the dispatch table in a global variable called _glapi_Dispatch. +The pointer is also stored in a per-thread location via +pthread_setspecific. When Mesa detects that an application has +become multithreaded, NULL is stored in _glapi_Dispatch.

    + +

    Using this simple mechanism the dispatch functions can detect the +multithreaded case by comparing _glapi_Dispatch to NULL. +The resulting implementation of GET_DISPATCH is slightly more +complex, but it avoids the expensive pthread_getspecific call in +the common case.

    + +
    + + +
    +#define GET_DISPATCH() \
    +    (_glapi_Dispatch != NULL) \
    +        ? _glapi_Dispatch : pthread_getspecific(&_glapi_Dispatch_key)
    +
    Improved GET_DISPATCH Implementation
    +
    + +

    3.2. ELF TLS

    + +

    Starting with the 2.4.20 Linux kernel, each thread is allocated an area +of per-thread, global storage. Variables can be put in this area using some +extensions to GCC. By storing the dispatch table pointer in this area, the +expensive call to pthread_getspecific and the test of +_glapi_Dispatch can be avoided.

    + +

    The dispatch table pointer is stored in a new variable called +_glapi_tls_Dispatch. A new variable name is used so that a single +libGL can implement both interfaces. This allows the libGL to operate with +direct rendering drivers that use either interface. Once the pointer is +properly declared, GET_DISPACH becomes a simple variable +reference.

    + +
    + + +
    +extern __thread struct _glapi_table *_glapi_tls_Dispatch
    +    __attribute__((tls_model("initial-exec")));
    +
    +#define GET_DISPATCH() _glapi_tls_Dispatch
    +
    TLS GET_DISPATCH Implementation
    +
    + +

    Use of this path is controlled by the preprocessor define +GLX_USE_TLS. Any platform capable of using TLS should use this as +the default dispatch method.

    + +

    3.3. Assembly Language Dispatch Stubs

    + +

    Many platforms has difficulty properly optimizing the tail-call in the +dispatch stubs. Platforms like x86 that pass parameters on the stack seem +to have even more difficulty optimizing these routines. All of the dispatch +routines are very short, and it is trivial to create optimal assembly +language versions. The amount of optimization provided by using assembly +stubs varies from platform to platform and application to application. +However, by using the assembly stubs, many platforms can use an additional +space optimization (see below).

    + +

    The biggest hurdle to creating assembly stubs is handling the various +ways that the dispatch table pointer can be accessed. There are four +different methods that can be used:

    + +
      +
    1. Using _glapi_Dispatch directly in builds for non-multithreaded +environments.
    2. +
    3. Using _glapi_Dispatch and _glapi_get_dispatch in +multithreaded environments.
    4. +
    5. Using _glapi_Dispatch and pthread_getspecific in +multithreaded environments.
    6. +
    7. Using _glapi_tls_Dispatch directly in TLS enabled +multithreaded environments.
    8. +
    + +

    People wishing to implement assembly stubs for new platforms should focus +on #4 if the new platform supports TLS. Otherwise, implement #2 followed by +#3. Environments that do not support multithreading are uncommon and not +terribly relevant.

    + +

    Selection of the dispatch table pointer access method is controlled by a +few preprocessor defines.

    + +
      +
    • If GLX_USE_TLS is defined, method #4 is used.
    • +
    • If PTHREADS is defined, method #3 is used.
    • +
    • If any of PTHREADS, USE_XTHREADS, +SOLARIS_THREADS, WIN32_THREADS, or BEOS_THREADS +is defined, method #2 is used.
    • +
    • If none of the preceeding are defined, method #1 is used.
    • +
    + +

    Two different techniques are used to handle the various different cases. +On x86 and SPARC, a macro called GL_STUB is used. In the preamble +of the assembly source file different implementations of the macro are +selected based on the defined preprocessor variables. The assmebly code +then consists of a series of invocations of the macros such as: + +

    + + +
    +GL_STUB(Color3fv, _gloffset_Color3fv)
    +
    SPARC Assembly Implementation of glColor3fv
    +
    + +

    The benefit of this technique is that changes to the calling pattern +(i.e., addition of a new dispatch table pointer access method) require fewer +changed lines in the assembly code.

    + +

    However, this technique can only be used on platforms where the function +implementation does not change based on the parameters passed to the +function. For example, since x86 passes all parameters on the stack, no +additional code is needed to save and restore function parameters around a +call to pthread_getspecific. Since x86-64 passes parameters in +registers, varying amounts of code needs to be inserted around the call to +pthread_getspecific to save and restore the GL function's +parameters.

    + +

    The other technique, used by platforms like x86-64 that cannot use the +first technique, is to insert #ifdef within the assembly +implementation of each function. This makes the assembly file considerably +larger (e.g., 29,332 lines for glapi_x86-64.S versus 1,155 lines for +glapi_x86.S) and causes simple changes to the function +implementation to generate many lines of diffs. Since the assmebly files +are typically generated by scripts (see below), this +isn't a significant problem.

    + +

    Once a new assembly file is created, it must be inserted in the build +system. There are two steps to this. The file must first be added to +src/mesa/sources. That gets the file built and linked. The second +step is to add the correct #ifdef magic to +src/mesa/main/dispatch.c to prevent the C version of the dispatch +functions from being built.

    + + +

    3.4. Fixed-Length Dispatch Stubs

    + +

    To implement glXGetProcAddress, Mesa stores a table that +associates function names with pointers to those functions. This table is +stored in src/mesa/glapi/glprocs.h. For different reasons on +different platforms, storing all of those pointers is inefficient. On most +platforms, including all known platforms that support TLS, we can avoid this +added overhead.

    + +

    If the assembly stubs are all the same size, the pointer need not be +stored for every function. The location of the function can instead be +calculated by multiplying the size of the dispatch stub by the offset of the +function in the table. This value is then added to the address of the first +dispatch stub.

    + +

    This path is activated by adding the correct #ifdef magic to +src/mesa/glapi/glapi.c just before glprocs.h is +included.

    + +
    +

    4. Automatic Generation of Dispatch Stubs

    + + + diff --git a/docs/mangling.html b/docs/mangling.html index cb19e7568a5..3f550ba5ec6 100644 --- a/docs/mangling.html +++ b/docs/mangling.html @@ -9,8 +9,8 @@

    Function Name Mangling

    -If you want to use Mesa and native OpenGL in the same application at -the same time you may find it useful to compile Mesa with +If you want to use both Mesa and another OpenGL library in the same +application at the same time you may find it useful to compile Mesa with name mangling. This results in all the Mesa functions being prefixed with mgl instead of gl. @@ -18,9 +18,7 @@ This results in all the Mesa functions being prefixed with

    To do this, recompile Mesa with the compiler flag -DUSE_MGL_NAMESPACE. -Add the flag to the other compiler flags in Make-config (if using the -old-style build system) or in src/Makefile if using GNU autoconf/ -automake to build Mesa. +Add the flag to CFLAGS in the configuration file which you want to use.

    diff --git a/docs/news.html b/docs/news.html index 0c77ad5d30f..9cd622fe227 100644 --- a/docs/news.html +++ b/docs/news.html @@ -13,100 +13,37 @@

    September 15, 2006

    -Mesa 6.5.1 has been released. This is a new development release. +Mesa 6.5.1 has been released. +This is a new development release.

    -Changes in version 6.5.1 -

    -The MD5 checksums are: -

    -
    -TBD
    -

    March 31, 2006

    -Mesa 6.5 has been released. This is a new development release. +Mesa 6.5 has been released. +This is a new development release.

    -Changes in version 6.5 -

    -The MD5 checksums are: -

    -
    -657be3b92f6dabc78a67ed9cb8d67813  MesaLib-6.5.tar.gz
    -61beda590bfc5b4a12e979d5f2d70d7a  MesaLib-6.5.tar.bz2
    -19d48b872d579d4f91466060804a59ac  MesaLib-6.5.zip
    -694ad3a7007010c7418a9c72d1cba5b7  MesaDemos-6.5.tar.gz
    -ab95b590dcd640726a2d89e62068c66e  MesaDemos-6.5.tar.bz2
    -b792c303fefd87294488e2b7eab976e5  MesaDemos-6.5.zip
    -ac1d585483617db0c91e5c15cb5ec3a3  MesaGLUT-6.5.tar.gz
    -59f0bf2b2ffb67fe23ee479f9b044f31  MesaGLUT-6.5.tar.bz2
    -005decb2136718e22222ac1c4805cd15  MesaGLUT-6.5.zip
    -

    February 2, 2006

    -Mesa 6.4.2 has been released. This is primarily a bug-fix release. -

    -Changes in version 6.4.2 -

    -The MD5 checksums are: +Mesa 6.4.2 has been released. +This is stable, bug-fix release.

    -
    -cb0d745d520fa7c2bb9178058b763544  MesaLib-6.4.2.tar.gz
    -7674d2c603b5834259e4e5a820cefd5b  MesaLib-6.4.2.tar.bz2
    -d224e1325b33ff71a0f3893fc6b4d594  MesaLib-6.4.2.zip
    -d4b345d4588fc750cd3d34f3ac26673e  MesaDemos-6.4.2.tar.gz
    -9cae1ab874af533ce356bd7dfe2e0bb0  MesaDemos-6.4.2.tar.bz2
    -2da6e1d1245e441d27813595c6ba50de  MesaDemos-6.4.2.zip
    -84427d18c3453f0ea52388eeba7169b5  MesaGLUT-6.4.2.tar.gz
    -b157ba8ad1ea63260cf5339132e7aac6  MesaGLUT-6.4.2.tar.bz2
    -fe1523744fc05edc3811dfc6a1bf4181  MesaGLUT-6.4.2.zip
    -

    November 29, 2005

    -Mesa 6.4.1 has been released. This is a stable, bug-fix release. +Mesa 6.4.1 has been released. +This is stable, bug-fix release.

    -Changes in version 6.4.1 -

    -The MD5 checksums are: -

    -
    -698ceb574cf882b0226761f5913c0da9  MesaLib-6.4.1.tar.gz
    -ea148c828ec6f645526451db1b8556f1  MesaLib-6.4.1.tar.bz2
    -42e93279468975ed2bf3111b8721e5d9  MesaLib-6.4.1.zip
    -e3b0d50807fd2bdcd1a95aaddd786f13  MesaDemos-6.4.1.tar.gz
    -99df1fdcb98d391666b476ca6f1dda8a  MesaDemos-6.4.1.tar.bz2
    -b999d2c6d92fb4b7740a3dbd889348e3  MesaDemos-6.4.1.zip
    -eadfe01fe5ddfb1eb8227dd567b31635  MesaGLUT-6.4.1.tar.gz
    -bd003bb4f981a4f91dee4c38644d4f3f  MesaGLUT-6.4.1.tar.bz2
    -71c401c037088bf688a88afdaeb3420f  MesaGLUT-6.4.1.zip
    -
    -

    October 24, 2005

    -Mesa 6.4 has been released. This is a stable, bug-fix release. -

    -Changes in version 6.4 -

    -The MD5 checksums are: +Mesa 6.4 has been released. +This is stable, bug-fix release.

    -
    -1cce0c1eb4fd15e9dfe837a1ce0c9812  MesaLib-6.4.tar.gz
    -85a84e47a3f718f752f306b9e0954ef6  MesaLib-6.4.tar.bz2
    -b976fea4f3ee06354c53f91b6e3f2ffc  MesaLib-6.4.zip
    -d8734f2c69bcf7ef9f5ae454a85743ba  MesaDemos-6.4.tar.gz
    -1a8c4d4fc699233f5fdb902b8753099e  MesaDemos-6.4.tar.bz2
    -607ab7c7a7de0cc5febbdde2bfa03098  MesaDemos-6.4.zip
    -3260156f66174322a092be0767962d34  MesaGLUT-6.4.tar.gz
    -0465d053f83775f44a12dec4050dfd78  MesaGLUT-6.4.tar.bz2
    -02abfcdcdf72ba938ae00f6e3b70fbe0  MesaGLUT-6.4.zip
    -

    August 19, 2005

    @@ -1133,6 +1070,6 @@ source code.


    -$Id: news.html,v 3.30 2006/09/16 04:13:20 brianp Exp $ +$Id: news.html,v 3.32 2006/09/21 22:51:16 brianp Exp $ diff --git a/docs/relnotes-6.4.1.html b/docs/relnotes-6.4.1.html new file mode 100644 index 00000000000..3d6ff1c4fe4 --- /dev/null +++ b/docs/relnotes-6.4.1.html @@ -0,0 +1,68 @@ + + +Mesa Release Notes + + + + + + + +

    Mesa 6.4.1 / November 29, 2006

    + +

    +Mesa 6.4.1 is a stable, bug-fix release. +

    + + +

    MD5 checksums

    +
    +698ceb574cf882b0226761f5913c0da9  MesaLib-6.4.1.tar.gz
    +ea148c828ec6f645526451db1b8556f1  MesaLib-6.4.1.tar.bz2
    +42e93279468975ed2bf3111b8721e5d9  MesaLib-6.4.1.zip
    +e3b0d50807fd2bdcd1a95aaddd786f13  MesaDemos-6.4.1.tar.gz
    +99df1fdcb98d391666b476ca6f1dda8a  MesaDemos-6.4.1.tar.bz2
    +b999d2c6d92fb4b7740a3dbd889348e3  MesaDemos-6.4.1.zip
    +eadfe01fe5ddfb1eb8227dd567b31635  MesaGLUT-6.4.1.tar.gz
    +bd003bb4f981a4f91dee4c38644d4f3f  MesaGLUT-6.4.1.tar.bz2
    +71c401c037088bf688a88afdaeb3420f  MesaGLUT-6.4.1.zip
    +
    + + +

    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 +
    + + +

    Driver Status

    + +
    +Driver			Status
    +----------------------	----------------------
    +DRI drivers		varies with the driver
    +XMesa (Xlib)		implements OpenGL 1.5
    +OSMesa (off-screen)	implements OpenGL 1.5
    +Windows/Win32		implements OpenGL 1.5
    +Glide (3dfx Voodoo1/2)  requires updates	
    +SVGA			requires updates
    +DJGPP			requires updates
    +GGI			requires updates
    +BeOS			requires updates
    +Allegro			requires updates
    +D3D			requires updates
    +
    + + + diff --git a/docs/relnotes-6.4.2.html b/docs/relnotes-6.4.2.html new file mode 100644 index 00000000000..f5a658f99b5 --- /dev/null +++ b/docs/relnotes-6.4.2.html @@ -0,0 +1,75 @@ + + +Mesa Release Notes + + + + + + + +

    Mesa 6.4.2 / February 2, 2006

    + +

    +Mesa 6.4.2 is a stable, bug-fix release. +

    + + +

    MD5 checksums

    +
    +cb0d745d520fa7c2bb9178058b763544  MesaLib-6.4.2.tar.gz
    +7674d2c603b5834259e4e5a820cefd5b  MesaLib-6.4.2.tar.bz2
    +d224e1325b33ff71a0f3893fc6b4d594  MesaLib-6.4.2.zip
    +d4b345d4588fc750cd3d34f3ac26673e  MesaDemos-6.4.2.tar.gz
    +9cae1ab874af533ce356bd7dfe2e0bb0  MesaDemos-6.4.2.tar.bz2
    +2da6e1d1245e441d27813595c6ba50de  MesaDemos-6.4.2.zip
    +84427d18c3453f0ea52388eeba7169b5  MesaGLUT-6.4.2.tar.gz
    +b157ba8ad1ea63260cf5339132e7aac6  MesaGLUT-6.4.2.tar.bz2
    +fe1523744fc05edc3811dfc6a1bf4181  MesaGLUT-6.4.2.zip
    +
    + + +

    New features

    +
      +
    • added OSMesaColorClamp() function/feature +
    • added wglGetExtensionStringARB() function +
    + +

    Changes

    +
      +
    • GLUT tarball +
      +Starting with 6.4, the GLUT library sources are distributed in a separate +tarball. This was done at the request of Linux distro vendors who prefer +to use freeglut. +
    + +

    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) +
    + + +

    Driver Status

    + +
    +Driver			Status
    +----------------------	----------------------
    +DRI drivers		varies with the driver
    +XMesa (Xlib)		implements OpenGL 1.5
    +OSMesa (off-screen)	implements OpenGL 1.5
    +Windows/Win32		implements OpenGL 1.5
    +Glide (3dfx Voodoo1/2)  requires updates	
    +SVGA			requires updates
    +DJGPP			requires updates
    +GGI			requires updates
    +BeOS			requires updates
    +Allegro			requires updates
    +D3D			requires updates
    +
    + + + diff --git a/docs/relnotes-6.4.html b/docs/relnotes-6.4.html new file mode 100644 index 00000000000..1fffa27f6f8 --- /dev/null +++ b/docs/relnotes-6.4.html @@ -0,0 +1,90 @@ + + +Mesa Release Notes + + + + + + + +

    Mesa 6.4 / October 24, 2005

    + +

    +Mesa 6.4 is a stable, bug-fix release. +

    + + +

    MD5 checksums

    +
    +1cce0c1eb4fd15e9dfe837a1ce0c9812  MesaLib-6.4.tar.gz
    +85a84e47a3f718f752f306b9e0954ef6  MesaLib-6.4.tar.bz2
    +b976fea4f3ee06354c53f91b6e3f2ffc  MesaLib-6.4.zip
    +d8734f2c69bcf7ef9f5ae454a85743ba  MesaDemos-6.4.tar.gz
    +1a8c4d4fc699233f5fdb902b8753099e  MesaDemos-6.4.tar.bz2
    +607ab7c7a7de0cc5febbdde2bfa03098  MesaDemos-6.4.zip
    +3260156f66174322a092be0767962d34  MesaGLUT-6.4.tar.gz
    +0465d053f83775f44a12dec4050dfd78  MesaGLUT-6.4.tar.bz2
    +02abfcdcdf72ba938ae00f6e3b70fbe0  MesaGLUT-6.4.zip
    +
    + + +

    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 +
    + + +

    Driver Status

    + +
    +Driver			Status
    +----------------------	----------------------
    +DRI drivers		varies with the driver
    +XMesa (Xlib)		implements OpenGL 1.5
    +OSMesa (off-screen)	implements OpenGL 1.5
    +Windows/Win32		implements OpenGL 1.5
    +Glide (3dfx Voodoo1/2)  requires updates	
    +SVGA			requires updates
    +DJGPP			requires updates
    +GGI			requires updates
    +BeOS			requires updates
    +Allegro			requires updates
    +D3D			requires updates
    +
    + + + diff --git a/docs/relnotes-6.5.1.html b/docs/relnotes-6.5.1.html index 0640e992bba..b053203f72a 100644 --- a/docs/relnotes-6.5.1.html +++ b/docs/relnotes-6.5.1.html @@ -8,17 +8,7 @@ -

    Mesa 6.5.1 Release Notes

    - - - -

    Introduction

    - -

    -Mesa uses an even/odd version number scheme like the Linux kernel. -Odd numbered versions (such as 6.5) designate new developmental releases. -Even numbered versions (such as 6.4) designate stable releases. -

    +

    Mesa 6.5.1 Release Notes / September 15, 2006

    Mesa 6.5.1 is a 6.5 follow-on development release mostly consisting of @@ -26,8 +16,21 @@ Mesa 6.5.1 is a 6.5 follow-on development release mostly consisting of

    -

    New Features

    +

    MD5 checksums

    +
    +d9a555297319bb932a3192952d53d073  MesaLib-6.5.1.tar.gz
    +c46f2c6646a270911b791dd8e1c2d977  MesaLib-6.5.1.tar.bz2
    +939eaaff33322bfeafac784402b45f4f  MesaLib-6.5.1.zip
    +9e4bbe83c007bfbaa67449a81cc3d36a  MesaDemos-6.5.1.tar.gz
    +0f2794baf7a9d98b22caea9f78c6942d  MesaDemos-6.5.1.tar.bz2
    +14c77eab9cc7a265c331abf239927c1c  MesaDemos-6.5.1.zip
    +c5f87c23aaf4eaf1bda0d007ea98366c  MesaGLUT-6.5.1.tar.gz
    +2525642fe7f454e3e1a1aad01359b406  MesaGLUT-6.5.1.tar.bz2
    +e33b165c22551e23b58ede8767378543  MesaGLUT-6.5.1.zip
    +
    + +

    New Features

    • Intel i965 "broadwater" DRI driver @@ -38,6 +41,53 @@ Mesa 6.5.1 is a 6.5 follow-on development release mostly consisting of
    • GL_EXT_gpu_program_parameters - addes a few new functions for setting multiple vertex/fragment program parameters with one call. +
    • "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() +
    • The GL_ARB_vertex_program attribute vertex.weight is now + accepted by the parser, even though the GL_ARB_vertex_blend and + GL_EXT_vertex_weighting extensions aren't supported. + Allows Warcraft to run. +
    + +

    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 +
    • fixed a number of build issues on HP-UX (Christopher Bell) +
    • accum buffer didn't work with OSMesa interface
    diff --git a/docs/relnotes-6.5.2.html b/docs/relnotes-6.5.2.html new file mode 100644 index 00000000000..1ba936413a8 --- /dev/null +++ b/docs/relnotes-6.5.2.html @@ -0,0 +1,111 @@ + + +Mesa Release Notes + + + + + + + +

    Mesa 6.5.2 Release Notes / (in progress)

    + +

    +Mesa 6.5.2 is a 6.5 follow-on development release mostly consisting of +bug fixes. +

    + + +

    MD5 checksums

    +
    +TBD
    +
    + + +

    New features

    +
      +
    • New DRI memory manager system. Currently used by the i915tex driver. +Other DRI drivers will be updated to use the new memory manager in coming +months. +
      +To use the new driver you'll need the most recent DRM library and drivers +(version 2.2 or later) and a recent xf86-video-intel driver module from X.org. +
      +New features resulting from this work include: +
        +
      • EXT_framebuffer_objects, render to texture +
      • ARB_pixel_buffer_objects +
      • Accelerated CopyTexSubimage, DrawPixels, ReadPixels, CopyPixels +
      • Accelerated texture uploads from pixel buffer objects +
      • Potentially texturing directly from the pixel buffer object (zero +copy texturing). +
      +
    • New Intel i965 DRI driver +
    • New minstall script to replace normal install program +
    • Faster fragment program execution in software +
    • Added (or fixed) support for + GLX_SGI_make_current_read to the following drivers:
    • +
        +
      • radeon
      • +
      • savage
      • +
      • mga
      • +
      +
    + +

    Bug fixes

    +
      +
    • fixed invalid memory read while rendering textured points (bug 8320) +
    • fixed problems with freebsd-dri configuration (bug 8344) +
    • Mesa's fake glxGetCurrentContext() wasn't thread-aware +
    • OPTION NV_position_invariant didn't work in NV vertex programs +
    • glDrawPixels into a user-created framebuffer object could crash Xlib driver +
    • Line clipping was broken in some circumstances +
    • fragment.fogcoord register didn't always contain the correct value +
    • RGBA logicops didn't work reliably in some DRI drivers +
    • Fixed broken RGBA LogicOps in Intel DRI drivers +
    • Fixed some fragment program bugs in Intel i915 DRI driver +
    • Fixed glGetVertexAttribfvARB bug 8883 +
    • Implemented glGetUniform[fi]vARB() functions +
    + + +

    Internal code changes

    + +
      +
    • The device driver functions ResizeBuffers and GetBufferSize have been +decprecated. +
    • OpenGL 2.0 and 2.1 support is nearly done. We need to do quite a bit +more testing of the shading language functions. +
    + + +

    To Do (someday) items

    +
      +
    • Switch to freeglut +
    • Increase MAX_DRAWBUFFERS +
    • Fix linux-glide target/driver. +
    • Improved lambda and derivative calculation for frag progs. +
    + + +

    Driver Status

    + +
    +Driver			Status
    +----------------------	----------------------
    +DRI drivers		varies with the driver
    +XMesa/GLX (on Xlib)	implements OpenGL 1.5
    +OSMesa (off-screen)	implements OpenGL 1.5
    +Glide (3dfx Voodoo1/2)	implements OpenGL 1.3
    +SVGA			implements OpenGL 1.3
    +Wind River UGL		implements OpenGL 1.3
    +Windows/Win32		implements OpenGL 1.5
    +DJGPP			implements OpenGL 1.5
    +GGI			implements OpenGL 1.3
    +BeOS			implements OpenGL 1.5
    +Allegro			needs updating
    +D3D			needs updating
    +
    + + + diff --git a/docs/relnotes-6.5.html b/docs/relnotes-6.5.html new file mode 100644 index 00000000000..9d1d6691e9d --- /dev/null +++ b/docs/relnotes-6.5.html @@ -0,0 +1,131 @@ + + +Mesa Release Notes + + + + + + + +

    Mesa 6.5 Release Notes / March 31, 2006

    + +

    +Mesa 6.5 is a new development release. +

    + + +

    MD5 checksums

    +
    +657be3b92f6dabc78a67ed9cb8d67813  MesaLib-6.5.tar.gz
    +61beda590bfc5b4a12e979d5f2d70d7a  MesaLib-6.5.tar.bz2
    +19d48b872d579d4f91466060804a59ac  MesaLib-6.5.zip
    +694ad3a7007010c7418a9c72d1cba5b7  MesaDemos-6.5.tar.gz
    +ab95b590dcd640726a2d89e62068c66e  MesaDemos-6.5.tar.bz2
    +b792c303fefd87294488e2b7eab976e5  MesaDemos-6.5.zip
    +ac1d585483617db0c91e5c15cb5ec3a3  MesaGLUT-6.5.tar.gz
    +59f0bf2b2ffb67fe23ee479f9b044f31  MesaGLUT-6.5.tar.bz2
    +005decb2136718e22222ac1c4805cd15  MesaGLUT-6.5.zip
    +
    + + + +

    New Features

    +
      +
    • OpenGL Shading language support +
      + This includes the GL_ARB_shader_objects, GL_ARB_shading_language_100, + GL_ARB_vertex_shader and GL_ARB_fragment_shader extensions. Most of + the work was done by Michal Krol. + There's probably a fair number of bugs since this is a pretty large, + complicated body of code. +
      + The OpenGL 2.0 interface to these features will be implemented in a + future version of Mesa, + +
    • GL_EXT_timer_query +
      + Used to measure the time of OpenGL operations at high precision. + Only supported in the software/Xlib driver at this time. + +
    • GL_EXT_packed_depth_stencil +
      + Defines a new GL_DEPTH_STENCIL_EXT pixel format. + +
    • GL_EXT_framebuffer_blit +
      + A simplified glCopyPixels-like feature for copying pixel rectangles. + +
    • GL_ARB_half_float_pixel +
      + Adds a new half-precision floating point format for image transfers, + such as for glDrawPixels, glReadPixels, glTexImage, etc. +
    + +

    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 +
    + + +

    Known Issues

    +
      +
    • Rendering to depth textures will not work. Rendering to GL_DEPTH_STENCIL +textures should work. +
    + + +

    Driver Interface Changes

    +
      +
    • Stencil: The Driver.StencilOp/Func/Mask() functions have been replaced by +the two-sided versions: Driver.Stencil*Separate(). +
    • Render-to-texture: The functions for rendering to textures have changed. +
    + + +

    To Do (someday) items

    +
      +
    • Switch to freeglut +
    • Increase MAX_DRAWBUFFERS +
    • Fix linux-glide target/driver. +
    • Fix lambda calculation for frag progs. +
    + + +

    Driver Status

    + +
    +Driver			Status
    +----------------------	----------------------
    +DRI drivers		varies with the driver
    +XMesa/GLX (on Xlib)	implements OpenGL 1.5
    +OSMesa (off-screen)	implements OpenGL 1.5
    +Glide (3dfx Voodoo1/2)	implements OpenGL 1.3
    +SVGA			implements OpenGL 1.3
    +Wind River UGL		implements OpenGL 1.3
    +Windows/Win32		implements OpenGL 1.5
    +DJGPP			implements OpenGL 1.5
    +GGI			implements OpenGL 1.3
    +BeOS			implements OpenGL 1.5
    +Allegro			needs updating
    +D3D			needs updating
    +
    + + + diff --git a/docs/relnotes.html b/docs/relnotes.html index 7383f02098f..9165c9f1492 100644 --- a/docs/relnotes.html +++ b/docs/relnotes.html @@ -8,16 +8,32 @@

    Release Notes

    +

    +Mesa uses an even/odd version number scheme like the Linux kernel. +Odd numbered versions (such as 6.5) designate new developmental releases. +Even numbered versions (such as 6.4) designate stable releases. +

    + +

    The release notes summarize what's new or changed in each Mesa release.

    +Versions of Mesa prior to 6.4 are summarized in the +versions file and the following release notes. +

    + +
    • RELNOTES-6.3.2
    • RELNOTES-6.3
    • RELNOTES-6.2.1 diff --git a/docs/sourcedocs.html b/docs/sourcedocs.html index a5248d988d7..90538af5cf0 100644 --- a/docs/sourcedocs.html +++ b/docs/sourcedocs.html @@ -11,11 +11,22 @@

      Doxygen is used to automatically -produce cross-referenced documentation from the Mesa sources. -This is not included in the normal Mesa distribution. -Download Mesa from CVS if interested. +produce cross-referenced documentation from the Mesa source code. +

      + +

      +The Doxygen configuration files and generated files are not included +in the normal Mesa distribution (they're very large). +To generate Doxygen documentation, download Mesa from CVS, change to +the doxygen directory and run make.

      +

      +For an example of Doxygen usage in Mesa, see a recent source file +such as bufferobj.c. +

      + +

      If you're reading this page from your local copy of Mesa, and have run the doxygen scripts, you can read the documentation diff --git a/docs/versions.html b/docs/versions.html index ad31a548dd3..84b40fd2158 100644 --- a/docs/versions.html +++ b/docs/versions.html @@ -8,6 +8,11 @@ + +NOTE: Changes for Mesa 6.4 and later are documented in the corresponding +release notes file. + +

      Mesa Version History

      @@ -1641,172 +1646,10 @@ Bug 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 September 15, 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() -
    • The GL_ARB_vertex_program attribute vertex.weight is now - accepted by the parser, even though the GL_ARB_vertex_blend and - GL_EXT_vertex_weighting extensions aren't supported. - Allows Warcraft to run. -
    -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 -
    + +NOTE: Changes for Mesa 6.4 and later are documented in the corresponding +
    release notes file. + diff --git a/include/GL/gl.h b/include/GL/gl.h index 6d706d67298..5b30e3f3865 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -2162,8 +2162,8 @@ typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLsh #define GL_DEBUG_ASSERT_MESA 0x875B GLAPI GLhandleARB APIENTRY glCreateDebugObjectMESA (void); -GLAPI GLvoid APIENTRY glClearDebugLogMESA (GLhandleARB obj, GLenum logType, GLenum shaderType); -GLAPI GLvoid APIENTRY glGetDebugLogMESA (GLhandleARB obj, GLenum logType, GLenum shaderType, GLsizei maxLength, +GLAPI void APIENTRY glClearDebugLogMESA (GLhandleARB obj, GLenum logType, GLenum shaderType); +GLAPI void APIENTRY glGetDebugLogMESA (GLhandleARB obj, GLenum logType, GLenum shaderType, GLsizei maxLength, GLsizei *length, GLcharARB *debugLog); GLAPI GLsizei APIENTRY glGetDebugLogLengthMESA (GLhandleARB obj, GLenum logType, GLenum shaderType); diff --git a/include/GL/glx_mangle.h b/include/GL/glx_mangle.h index d0b47d94e73..4439a96b5d2 100644 --- a/include/GL/glx_mangle.h +++ b/include/GL/glx_mangle.h @@ -1,21 +1,25 @@ /* * Mesa 3-D graphics library - * Version: 4.1 - * Copyright (C) 1995-1998 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * Version: 6.5 + * + * Copyright (C) 1999-2006 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. */ @@ -48,6 +52,28 @@ #define glXGetVideoSyncSGI mglXGetVideoSyncSGI #define glXWaitVideoSyncSGI mglXWaitVideoSyncSGI +/* GLX 1.2 */ +#define glXGetCurrentDisplay mglXGetCurrentDisplay + +/* GLX 1.3 */ +#define glXChooseFBConfig mglXChooseFBConfig +#define glXGetFBConfigAttrib mglXGetFBConfigAttrib +#define glXGetFBConfigs mglXGetFBConfigs +#define glXGetVisualFromFBConfig mglXGetVisualFromFBConfig +#define glXCreateWindow mglXCreateWindow +#define glXDestroyWindow mglXDestroyWindow +#define glXCreatePixmap mglXCreatePixmap +#define glXDestroyPixmap mglXDestroyPixmap +#define glXCreatePbuffer mglXCreatePbuffer +#define glXDestroyPbuffer mglXDestroyPbuffer +#define glXQueryDrawable mglXQueryDrawable +#define glXCreateNewContext mglXCreateNewContext +#define glXMakeContextCurrent mglXMakeContextCurrent +#define glXGetCurrentReadDrawable mglXGetCurrentReadDrawable +#define glXQueryContext mglXQueryContext +#define glXSelectEvent mglXSelectEvent +#define glXGetSelectedEvent mglXGetSelectedEvent + /* GLX 1.4 */ #define glXGetProcAddress mglXGetProcAddress diff --git a/progs/demos/Makefile b/progs/demos/Makefile index 43d0f17c85f..4623d6c8d91 100644 --- a/progs/demos/Makefile +++ b/progs/demos/Makefile @@ -25,6 +25,7 @@ PROGS = \ fire \ fogcoord \ fplight \ + fslight \ gamma \ gearbox \ gears \ @@ -47,6 +48,7 @@ PROGS = \ renormal \ shadowtex \ singlebuffer \ + streaming_rect \ spectex \ spriteblast \ stex3d \ diff --git a/progs/demos/cubemap.c b/progs/demos/cubemap.c index 0a59b989835..ef5d2355509 100644 --- a/progs/demos/cubemap.c +++ b/progs/demos/cubemap.c @@ -454,6 +454,7 @@ static void usage(void) int main( int argc, char *argv[] ) { + glutInit(&argc, argv); glutInitWindowPosition(0, 0); glutInitWindowSize(600, 500); glutInitDisplayMode( GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE ); diff --git a/progs/demos/fslight.c b/progs/demos/fslight.c new file mode 100644 index 00000000000..1c016cc75e9 --- /dev/null +++ b/progs/demos/fslight.c @@ -0,0 +1,334 @@ +/** + * Test OpenGL 2.0 vertex/fragment shaders. + * Brian Paul + * 1 November 2006 + * + * Based on ARB version by: + * Michal Krol + * 20 February 2006 + * + * Based on the original demo by: + * Brian Paul + * 17 April 2003 + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +static GLfloat diffuse[4] = { 0.5f, 0.5f, 1.0f, 1.0f }; +static GLfloat specular[4] = { 0.8f, 0.8f, 0.8f, 1.0f }; +static GLfloat lightPos[4] = { 0.0f, 10.0f, 20.0f, 1.0f }; +static GLfloat delta = 1.0f; + +static GLuint fragShader; +static GLuint vertShader; +static GLuint program; + +static GLint uLightPos; +static GLint uDiffuse; +static GLint uSpecular; + +static GLint win = 0; +static GLboolean anim = GL_TRUE; +static GLboolean wire = GL_FALSE; +static GLboolean pixelLight = GL_TRUE; + +static GLint t0 = 0; +static GLint frames = 0; + +static GLfloat xRot = 0.0f, yRot = 0.0f; + +static PFNGLCREATESHADERPROC glCreateShader_func = NULL; +static PFNGLSHADERSOURCEPROC glShaderSource_func = NULL; +static PFNGLGETSHADERSOURCEPROC glGetShaderSource_func = NULL; +static PFNGLCOMPILESHADERPROC glCompileShader_func = NULL; +static PFNGLCREATEPROGRAMPROC glCreateProgram_func = NULL; +static PFNGLDELETEPROGRAMPROC glDeleteProgram_func = NULL; +static PFNGLDELETESHADERPROC glDeleteShader_func = NULL; +static PFNGLATTACHSHADERPROC glAttachShader_func = NULL; +static PFNGLLINKPROGRAMPROC glLinkProgram_func = NULL; +static PFNGLUSEPROGRAMPROC glUseProgram_func = NULL; +static PFNGLGETUNIFORMLOCATIONPROC glGetUniformLocation_func = NULL; +static PFNGLISPROGRAMPROC glIsProgram_func = NULL; +static PFNGLISSHADERPROC glIsShader_func = NULL; +static PFNGLUNIFORM3FVPROC glUniform3fv_func = NULL; +static PFNGLUNIFORM3FVPROC glUniform4fv_func = NULL; + + + +static void +normalize(GLfloat *dst, const GLfloat *src) +{ + GLfloat len = sqrtf(src[0] * src[0] + src[1] * src[1] + src[2] * src[2]); + dst[0] = src[0] / len; + dst[1] = src[1] / len; + dst[2] = src[2] / len; +} + + +static void +Redisplay(void) +{ + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + + if (pixelLight) { + GLfloat vec[3]; + glUseProgram_func(program); + normalize(vec, lightPos); + glUniform3fv_func(uLightPos, 1, vec); + glDisable(GL_LIGHTING); + } + else { + glUseProgram_func(0); + glLightfv(GL_LIGHT0, GL_POSITION, lightPos); + glEnable(GL_LIGHTING); + } + + glPushMatrix(); + glRotatef(xRot, 1.0f, 0.0f, 0.0f); + glRotatef(yRot, 0.0f, 1.0f, 0.0f); + glutSolidSphere(2.0, 10, 5); + glPopMatrix(); + + glutSwapBuffers(); + frames++; + + if (anim) { + GLint t = glutGet(GLUT_ELAPSED_TIME); + if (t - t0 >= 5000) { + GLfloat seconds =(GLfloat)(t - t0) / 1000.0f; + GLfloat fps = frames / seconds; + printf("%d frames in %6.3f seconds = %6.3f FPS\n", + frames, seconds, fps); + t0 = t; + frames = 0; + } + } +} + + +static void +Idle(void) +{ + lightPos[0] += delta; + if (lightPos[0] > 25.0f || lightPos[0] < -25.0f) + delta = -delta; + glutPostRedisplay(); +} + + +static void +Reshape(int width, int height) +{ + glViewport(0, 0, width, height); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + glFrustum(-1.0, 1.0, -1.0, 1.0, 5.0, 25.0); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + glTranslatef(0.0f, 0.0f, -15.0f); +} + + +static void +CleanUp(void) +{ + glDeleteShader_func(fragShader); + glDeleteShader_func(vertShader); + glDeleteProgram_func(program); + glutDestroyWindow(win); +} + + +static void +Key(unsigned char key, int x, int y) +{ + (void) x; + (void) y; + + switch(key) { + case ' ': + case 'a': + anim = !anim; + if (anim) + glutIdleFunc(Idle); + else + glutIdleFunc(NULL); + break; + case 'x': + lightPos[0] -= 1.0f; + break; + case 'X': + lightPos[0] += 1.0f; + break; + case 'w': + wire = !wire; + if (wire) + glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); + else + glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); + break; + case 'p': + pixelLight = !pixelLight; + if (pixelLight) + printf("Per-pixel lighting\n"); + else + printf("Conventional lighting\n"); + break; + case 27: + CleanUp(); + exit(0); + break; + } + glutPostRedisplay(); +} + + +static void +SpecialKey(int key, int x, int y) +{ + const GLfloat step = 3.0f; + + (void) x; + (void) y; + + switch(key) { + case GLUT_KEY_UP: + xRot -= step; + break; + case GLUT_KEY_DOWN: + xRot += step; + break; + case GLUT_KEY_LEFT: + yRot -= step; + break; + case GLUT_KEY_RIGHT: + yRot += step; + break; + } + glutPostRedisplay(); +} + + +static void +Init(void) +{ + static const char *fragShaderText = + "uniform vec3 lightPos;\n" + "uniform vec4 diffuse;\n" + "uniform vec4 specular;\n" + "varying vec3 normal;\n" + "void main() {\n" + " // Compute dot product of light direction and normal vector\n" + " float dotProd = max(dot(lightPos, normalize(normal)), 0.0);\n" + " // Compute diffuse and specular contributions\n" + " gl_FragColor = diffuse * dotProd + specular * pow(dotProd, 20.0);\n" + "}\n"; + static const char *vertShaderText = + "varying vec3 normal;\n" + "void main() {\n" + " gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\n" + " normal = gl_NormalMatrix * gl_Normal;\n" + "}\n"; + + + const char *version; + + version = (const char *) glGetString(GL_VERSION); + if (version[0] != '2' || version[1] != '.') { + printf("Warning: this program expects OpenGL 2.0\n"); + /*exit(1);*/ + } + + + glCreateShader_func = (PFNGLCREATESHADERPROC) glutGetProcAddress("glCreateShader"); + glDeleteShader_func = (PFNGLDELETESHADERPROC) glutGetProcAddress("glDeleteShader"); + glDeleteProgram_func = (PFNGLDELETEPROGRAMPROC) glutGetProcAddress("glDeleteProgram"); + glShaderSource_func = (PFNGLSHADERSOURCEPROC) glutGetProcAddress("glShaderSource"); + glGetShaderSource_func = (PFNGLGETSHADERSOURCEPROC) glutGetProcAddress("glGetShaderSource"); + glCompileShader_func = (PFNGLCOMPILESHADERPROC) glutGetProcAddress("glCompileShader"); + glCreateProgram_func = (PFNGLCREATEPROGRAMPROC) glutGetProcAddress("glCreateProgram"); + glAttachShader_func = (PFNGLATTACHSHADERPROC) glutGetProcAddress("glAttachShader"); + glLinkProgram_func = (PFNGLLINKPROGRAMPROC) glutGetProcAddress("glLinkProgram"); + glUseProgram_func = (PFNGLUSEPROGRAMPROC) glutGetProcAddress("glUseProgram"); + glGetUniformLocation_func = (PFNGLGETUNIFORMLOCATIONPROC) glutGetProcAddress("glGetUniformLocation"); + glIsProgram_func = (PFNGLISPROGRAMPROC) glutGetProcAddress("glIsProgram"); + glIsShader_func = (PFNGLISSHADERPROC) glutGetProcAddress("glIsShader"); + glUniform3fv_func = (PFNGLUNIFORM3FVPROC) glutGetProcAddress("glUniform3fv"); + glUniform4fv_func = (PFNGLUNIFORM3FVPROC) glutGetProcAddress("glUniform4fv"); + + fragShader = glCreateShader_func(GL_FRAGMENT_SHADER); + glShaderSource_func(fragShader, 1, &fragShaderText, NULL); + glCompileShader_func(fragShader); + + vertShader = glCreateShader_func(GL_VERTEX_SHADER); + glShaderSource_func(vertShader, 1, &vertShaderText, NULL); + glCompileShader_func(vertShader); + + program = glCreateProgram_func(); + glAttachShader_func(program, fragShader); + glAttachShader_func(program, vertShader); + glLinkProgram_func(program); + glUseProgram_func(program); + + uLightPos = glGetUniformLocation_func(program, "lightPos"); + uDiffuse = glGetUniformLocation_func(program, "diffuse"); + uSpecular = glGetUniformLocation_func(program, "specular"); + + glUniform4fv_func(uDiffuse, 1, diffuse); + glUniform4fv_func(uSpecular, 1, specular); + + glClearColor(0.3f, 0.3f, 0.3f, 0.0f); + glEnable(GL_DEPTH_TEST); + glEnable(GL_LIGHT0); + glEnable(GL_LIGHTING); + glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, diffuse); + glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, specular); + glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, 20.0f); + + printf("GL_RENDERER = %s\n",(const char *) glGetString(GL_RENDERER)); + printf("Press p to toggle between per-pixel and per-vertex lighting\n"); + + /* test glGetShaderSource() */ + { + GLsizei len = strlen(fragShaderText) + 1; + GLsizei lenOut; + GLchar *src =(GLchar *) malloc(len * sizeof(GLchar)); + glGetShaderSource_func(fragShader, 0, NULL, src); + glGetShaderSource_func(fragShader, len, &lenOut, src); + assert(len == lenOut + 1); + assert(strcmp(src, fragShaderText) == 0); + free(src); + } + + assert(glIsProgram_func(program)); + assert(glIsShader_func(fragShader)); + assert(glIsShader_func(vertShader)); +} + + +int +main(int argc, char *argv[]) +{ + glutInit(&argc, argv); + glutInitWindowPosition( 0, 0); + glutInitWindowSize(200, 200); + glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH); + win = glutCreateWindow(argv[0]); + glutReshapeFunc(Reshape); + glutKeyboardFunc(Key); + glutSpecialFunc(SpecialKey); + glutDisplayFunc(Redisplay); + if (anim) + glutIdleFunc(Idle); + Init(); + glutMainLoop(); + return 0; +} + diff --git a/progs/demos/readpix.c b/progs/demos/readpix.c index 75ba45c1e5f..c0aac2272f7 100644 --- a/progs/demos/readpix.c +++ b/progs/demos/readpix.c @@ -29,33 +29,32 @@ static GLboolean ScaleAndBias = GL_FALSE; static GLboolean Benchmark = GL_FALSE; static GLubyte *TempImage = NULL; -#if 0 +#define COMBO 1 +#if COMBO == 0 #define ReadFormat ImgFormat #define ReadType GL_UNSIGNED_BYTE -#endif -#if 1 +#elif COMBO == 1 static GLenum ReadFormat = GL_RGBA; static GLenum ReadType = GL_UNSIGNED_BYTE; -#endif -#if 0 +#elif COMBO == 2 static GLenum ReadFormat = GL_RGB; static GLenum ReadType = GL_UNSIGNED_BYTE; -#endif -#if 0 +#elif COMBO == 3 static GLenum ReadFormat = GL_RGB; static GLenum ReadType = GL_UNSIGNED_SHORT_5_6_5; -#endif -#if 0 +#elif COMBO == 4 static GLenum ReadFormat = GL_RGBA; static GLenum ReadType = GL_UNSIGNED_SHORT_1_5_5_5_REV; -#endif -#if 0 +#elif COMBO == 5 static GLenum ReadFormat = GL_BGRA; static GLenum ReadType = GL_UNSIGNED_SHORT_5_5_5_1; -#endif -#if 0 +#elif COMBO == 6 static GLenum ReadFormat = GL_BGRA; static GLenum ReadType = GL_UNSIGNED_SHORT_4_4_4_4_REV; +#elif COMBO == 7 +static GLenum ReadFormat = GL_RGBA; +static GLenum ReadType = GL_HALF_FLOAT_ARB; +#undef GL_OES_read_format #endif @@ -313,8 +312,10 @@ Init( GLboolean ciMode ) Reset(); - /* allocate an extra 1KB in case we're tinkering with pack alignment */ - TempImage = (GLubyte *) malloc(ImgWidth * ImgHeight * 4 * sizeof(GLubyte) + /* allocate large TempImage to store and image data type, plus an + * extra 1KB in case we're tinkering with pack alignment. + */ + TempImage = (GLubyte *) malloc(ImgWidth * ImgHeight * 4 * 4 + 1000); assert(TempImage); } diff --git a/progs/demos/streaming_rect.c b/progs/demos/streaming_rect.c new file mode 100644 index 00000000000..86e00803c01 --- /dev/null +++ b/progs/demos/streaming_rect.c @@ -0,0 +1,322 @@ + +/* + * GL_ARB_multitexture demo + * + * Command line options: + * -info print GL implementation information + * + * + * Brian Paul November 1998 This program is in the public domain. + * Modified on 12 Feb 2002 for > 2 texture units. + */ + +#define GL_GLEXT_PROTOTYPES + +#include +#include +#include +#include +#include + +#include "readtex.h" + + +#define ANIMATE 10 +#define PBO 11 +#define QUIT 100 + +static GLboolean Animate = GL_TRUE; +static GLboolean use_pbo = 1; +static GLboolean whole_rect = 1; + +static GLfloat Drift = 0.0; +static GLfloat drift_increment = 1/255.0; +static GLfloat Xrot = 20.0, Yrot = 30.0; + +static GLuint Width = 1024; +static GLuint Height = 512; + + +static void Idle( void ) +{ + if (Animate) { + + Drift += drift_increment; + if (Drift >= 1.0) + Drift = 0.0; + + glutPostRedisplay(); + } +} + +static int max( int a, int b ) { return a > b ? a : b; } +static int min( int a, int b ) { return a < b ? a : b; } + +static void DrawObject() +{ + GLint size = Width * Height * 4; + + if (use_pbo) { + /* XXX: This is extremely important - semantically makes the buffer + * contents undefined, but in practice means that the driver can + * release the old copy of the texture and allocate a new one + * without waiting for outstanding rendering to complete. + */ + glBufferDataARB(GL_PIXEL_UNPACK_BUFFER_EXT, size, NULL, GL_STREAM_DRAW_ARB); + + { + char *image = glMapBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT, GL_WRITE_ONLY_ARB); + + printf("char %d\n", (unsigned char)(Drift * 255)); + + memset(image, size, (unsigned char)(Drift * 255)); + + glUnmapBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT); + } + + + /* BGRA is required for most hardware paths: + */ + glTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, GL_RGBA, Width, Height, 0, + GL_BGRA, GL_UNSIGNED_BYTE, NULL); + } + else { + static char *image = NULL; + + if (image == NULL) + image = malloc(size); + + memset(image, size, (unsigned char)(Drift * 255)); + + /* BGRA should be the fast path for regular uploads as well. + */ + glTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, GL_RGBA, Width, Height, 0, + GL_BGRA, GL_UNSIGNED_BYTE, image); + } + + { + int x,y,w,h; + + if (whole_rect) { + x = y = 0; + w = Width; + h = Height; + } + else { + x = y = 0; + w = min(10, Width); + h = min(10, Height); + } + + glBegin(GL_QUADS); + + glTexCoord2f( x, y); + glVertex2f( x, y ); + + glTexCoord2f( x, y + h); + glVertex2f( x, y + h); + + glTexCoord2f( x + w + .5, y + h); + glVertex2f( x + w, y + h ); + + glTexCoord2f( x + w, y + .5); + glVertex2f( x + w, y ); + + glEnd(); + } +} + + + +static void Display( void ) +{ + static GLint T0 = 0; + static GLint Frames = 0; + GLint t; + + glClear( GL_COLOR_BUFFER_BIT ); + + glPushMatrix(); + DrawObject(); + glPopMatrix(); + + glutSwapBuffers(); + + Frames++; + + t = glutGet(GLUT_ELAPSED_TIME); + if (t - T0 >= 1000) { + GLfloat seconds = (t - T0) / 1000.0; + + GLfloat fps = Frames / seconds; + printf("%d frames in %6.3f seconds = %6.3f FPS\n", Frames, seconds, fps); + + drift_increment = 2.2 * seconds / Frames; + T0 = t; + Frames = 0; + } +} + + +static void Reshape( int width, int height ) +{ + glViewport( 0, 0, width, height ); + glMatrixMode( GL_PROJECTION ); + glLoadIdentity(); +/* glFrustum( -1.0, 1.0, -1.0, 1.0, 10.0, 100.0 ); */ + gluOrtho2D( 0, width, height, 0 ); + glMatrixMode( GL_MODELVIEW ); + glLoadIdentity(); + glTranslatef(0.375, 0.375, 0); +} + + +static void ModeMenu(int entry) +{ + if (entry==ANIMATE) { + Animate = !Animate; + } + else if (entry==PBO) { + use_pbo = !use_pbo; + } + else if (entry==QUIT) { + exit(0); + } + + glutPostRedisplay(); +} + + +static void Key( unsigned char key, int x, int y ) +{ + (void) x; + (void) y; + switch (key) { + case 27: + exit(0); + break; + } + glutPostRedisplay(); +} + + +static void SpecialKey( int key, int x, int y ) +{ + float step = 3.0; + (void) x; + (void) y; + + switch (key) { + case GLUT_KEY_UP: + Xrot += step; + break; + case GLUT_KEY_DOWN: + Xrot -= step; + break; + case GLUT_KEY_LEFT: + Yrot += step; + break; + case GLUT_KEY_RIGHT: + Yrot -= step; + break; + } + glutPostRedisplay(); +} + + +static void Init( int argc, char *argv[] ) +{ + const char *exten = (const char *) glGetString(GL_EXTENSIONS); + GLuint texObj, DrawPBO; + GLint size; + + + if (!strstr(exten, "GL_ARB_multitexture")) { + printf("Sorry, GL_ARB_multitexture not supported by this renderer.\n"); + exit(1); + } + + glGetIntegerv(GL_MAX_TEXTURE_SIZE, &size); + printf("%d x %d max texture size\n", size, size); + + glPixelStorei(GL_UNPACK_ALIGNMENT, 1); + + /* allocate two texture objects */ + glGenTextures(1, &texObj); + + /* setup the texture objects */ + glActiveTextureARB(GL_TEXTURE0_ARB); + glBindTexture(GL_TEXTURE_RECTANGLE_ARB, texObj); + + glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + + glGenBuffersARB(1, &DrawPBO); + + glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT, DrawPBO); + glBufferDataARB(GL_PIXEL_UNPACK_BUFFER_EXT, + Width * Height * 4, NULL, GL_STREAM_DRAW); + + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); + + glEnable(GL_TEXTURE_RECTANGLE_ARB); + + glShadeModel(GL_SMOOTH); + glClearColor(0.3, 0.3, 0.4, 1.0); + + if (argc > 1 && strcmp(argv[1], "-info")==0) { + printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); + printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); + printf("GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR)); + printf("GL_EXTENSIONS = %s\n", (char *) glGetString(GL_EXTENSIONS)); + } +} + + +int main( int argc, char *argv[] ) +{ + GLint i; + + glutInit( &argc, argv ); + + for (i = 1; i < argc; i++) { + if (strcmp(argv[i], "-w") == 0) { + Width = atoi(argv[i+1]); + if (Width <= 0) { + printf("Error, bad width\n"); + exit(1); + } + i++; + } + else if (strcmp(argv[i], "-h") == 0) { + Height = atoi(argv[i+1]); + if (Height <= 0) { + printf("Error, bad height\n"); + exit(1); + } + i++; + } + } + + glutInitWindowSize( Width, Height ); + glutInitWindowPosition( 0, 0 ); + glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE ); + glutCreateWindow(argv[0] ); + + Init( argc, argv ); + + glutReshapeFunc( Reshape ); + glutKeyboardFunc( Key ); + glutSpecialFunc( SpecialKey ); + glutDisplayFunc( Display ); + glutIdleFunc( Idle ); + + glutCreateMenu(ModeMenu); + glutAddMenuEntry("Toggle Animation", ANIMATE); + glutAddMenuEntry("Toggle PBO", PBO); + glutAddMenuEntry("Quit", QUIT); + glutAttachMenu(GLUT_RIGHT_BUTTON); + + glutMainLoop(); + return 0; +} diff --git a/progs/demos/texdown.c b/progs/demos/texdown.c index 79525a0395e..fc98fddb310 100644 --- a/progs/demos/texdown.c +++ b/progs/demos/texdown.c @@ -38,8 +38,8 @@ #include -static GLsizei MaxSize = 1024; -static GLsizei TexWidth = 256, TexHeight = 256, TexBorder = 0; +static GLsizei MaxSize = 2048; +static GLsizei TexWidth = 1024, TexHeight = 1024, TexBorder = 0; static GLboolean ScaleAndBias = GL_FALSE; static GLboolean SubImage = GL_FALSE; static GLdouble DownloadRate = 0.0; /* texels/sec */ @@ -47,6 +47,32 @@ static GLdouble DownloadRate = 0.0; /* texels/sec */ static GLuint Mode = 0; +/* Try and avoid L2 cache effects by cycling through a small number of + * textures. + * + * At the initial size of 1024x1024x4 == 4mbyte, say 8 textures will + * keep us out of most caches at 32mb total. + * + * This turns into a fairly interesting question of what exactly you + * expect to be in cache in normal usage, and what you think should be + * outside. There's no rules for this, no reason to favour one usage + * over another except what the application you care about happens to + * resemble most closely. + * + * - Should the client texture image be in L2 cache? Has it just been + * generated or read from disk? + * - Does the application really use >1 texture, or is it constantly + * updating one image in-place? + * + * Different answers will favour different texture upload mechanisms. + * To upload an image that is purely outside of cache, a DMA-based + * upload will probably win, whereas for small, in-cache textures, + * copying looks good. + */ +#define NR_TEXOBJ 4 +static GLuint TexObj[NR_TEXOBJ]; + + struct FormatRec { GLenum Format; GLenum Type; @@ -116,25 +142,57 @@ TypeStr(GLenum type) } } +/* On x86, there is a performance cliff for memcpy to texture memory + * for sources below 64 byte alignment. We do our best with this in + * the driver, but it is better if the images are correctly aligned to + * start with: + */ +#define ALIGN (1<<12) + +static unsigned align(unsigned value, unsigned a) +{ + return (value + a - 1) & ~(a-1); +} + +static int MIN2(int a, int b) +{ + return a < b ? a : b; +} static void MeasureDownloadRate(void) { const int w = TexWidth + 2 * TexBorder; const int h = TexHeight + 2 * TexBorder; - const int bytes = w * h * BytesPerTexel(Format); + const int image_bytes = align(w * h * BytesPerTexel(Format), ALIGN); + const int bytes = image_bytes * NR_TEXOBJ; + GLubyte *orig_texImage, *orig_getImage; GLubyte *texImage, *getImage; GLdouble t0, t1, time; int count; int i; + int offset = 0; + GLdouble total = 0; /* ints will tend to overflow */ + + printf("allocating %d bytes for %d %dx%d images\n", + bytes, NR_TEXOBJ, w, h); - texImage = (GLubyte *) malloc(bytes); - getImage = (GLubyte *) malloc(bytes); - if (!texImage || !getImage) { + orig_texImage = (GLubyte *) malloc(bytes + ALIGN); + orig_getImage = (GLubyte *) malloc(image_bytes + ALIGN); + if (!orig_texImage || !orig_getImage) { DownloadRate = 0.0; return; } + printf("alloc %p %p\n", orig_texImage, orig_getImage); + + texImage = (GLubyte *)align((unsigned)orig_texImage, ALIGN); + getImage = (GLubyte *)align((unsigned)orig_getImage, ALIGN); + + for (i = 1; !(((unsigned)texImage) & i); i<<=1) + ; + printf("texture image alignment: %d bytes (%p)\n", i, texImage); + for (i = 0; i < bytes; i++) { texImage[i] = i & 0xff; } @@ -166,16 +224,50 @@ MeasureDownloadRate(void) count = 0; t0 = glutGet(GLUT_ELAPSED_TIME) * 0.001; do { + int img = count%NR_TEXOBJ; + GLubyte *img_ptr = texImage + img * image_bytes; + + glBindTexture(GL_TEXTURE_2D, TexObj[img]); + if (SubImage && count > 0) { - glTexSubImage2D(GL_TEXTURE_2D, 0, -TexBorder, -TexBorder, w, h, + /* Only update a portion of the image each iteration. This + * is presumably why you'd want to use texsubimage, otherwise + * you may as well just call teximage again. + * + * A bigger question is whether to use a pointer that moves + * with each call, ie does the incoming data come from L2 + * cache under normal circumstances, or is it pulled from + * uncached memory? + * + * There's a good argument to say L2 cache, ie you'd expect + * the data to have been recently generated. It's possible + * that it could have come from a file read, which may or may + * not have gone through the cpu. + */ + glTexSubImage2D(GL_TEXTURE_2D, 0, + -TexBorder, + -TexBorder + offset * h/8, + w, + h/8, FormatTable[Format].Format, - FormatTable[Format].Type, texImage); + FormatTable[Format].Type, +#if 1 + texImage /* likely in L2$ */ +#else + img_ptr + offset * bytes/8 /* unlikely in L2$ */ +#endif + ); + offset += 1; + offset %= 8; + total += w * h / 8; } else { glTexImage2D(GL_TEXTURE_2D, 0, FormatTable[Format].IntFormat, w, h, TexBorder, FormatTable[Format].Format, - FormatTable[Format].Type, texImage); + FormatTable[Format].Type, + img_ptr); + total += w*h; } /* draw a tiny polygon to force texture into texram */ @@ -192,25 +284,12 @@ MeasureDownloadRate(void) glDisable(GL_TEXTURE_2D); - printf("w*h=%d count=%d time=%f\n", w*h, count, time); - DownloadRate = w * h * count / time; - -#if 0 - if (!ScaleAndBias) { - /* verify texture readback */ - glGetTexImage(GL_TEXTURE_2D, 0, - FormatTable[Format].Format, - FormatTable[Format].Type, getImage); - for (i = 0; i < w * h; i++) { - if (texImage[i] != getImage[i]) { - printf("[%d] %d != %d\n", i, texImage[i], getImage[i]); - } - } - } -#endif + printf("total texels=%f time=%f\n", total, time); + DownloadRate = total / time; + - free(texImage); - free(getImage); + free(orig_texImage); + free(orig_getImage); { GLint err = glGetError(); diff --git a/progs/osdemos/osdemo.c b/progs/osdemos/osdemo.c index f7ce121f702..bc0168fb97b 100644 --- a/progs/osdemos/osdemo.c +++ b/progs/osdemos/osdemo.c @@ -4,7 +4,7 @@ * See Mesa/include/GL/osmesa.h for documentation of the OSMesa functions. * * If you want to render BIG images you'll probably have to increase - * MAX_WIDTH and MAX_HEIGHT in src/config.h. + * MAX_WIDTH and MAX_Height in src/config.h. * * This program is in the public domain. * @@ -27,8 +27,8 @@ #define SAVE_TARGA -#define WIDTH 400 -#define HEIGHT 400 +static int Width = 400; +static int Height = 400; static void @@ -175,10 +175,10 @@ write_targa(const char *filename, const GLubyte *buffer, int width, int height) fputc (0x00, f); fputc (0x00, f); /* Y-origin of Image */ fputc (0x00, f); - fputc (WIDTH & 0xff, f); /* Image Width */ - fputc ((WIDTH>>8) & 0xff, f); - fputc (HEIGHT & 0xff, f); /* Image Height */ - fputc ((HEIGHT>>8) & 0xff, f); + fputc (Width & 0xff, f); /* Image Width */ + fputc ((Width>>8) & 0xff, f); + fputc (Height & 0xff, f); /* Image Height */ + fputc ((Height>>8) & 0xff, f); fputc (0x18, f); /* Pixel Depth, 0x18 => 24 Bits */ fputc (0x20, f); /* Image Descriptor */ fclose(f); @@ -248,36 +248,43 @@ write_ppm(const char *filename, const GLubyte *buffer, int width, int height) int main(int argc, char *argv[]) { + OSMesaContext ctx; void *buffer; - int i; char *filename = NULL; + if (argc < 2) { + fprintf(stderr, "Usage:\n"); + fprintf(stderr, " osdemo filename [width height]\n"); + return 0; + } + + filename = argv[1]; + if (argc == 4) { + Width = atoi(argv[2]); + Height = atoi(argv[3]); + } + /* Create an RGBA-mode context */ #if OSMESA_MAJOR_VERSION * 100 + OSMESA_MINOR_VERSION >= 305 /* specify Z, stencil, accum sizes */ - OSMesaContext ctx = OSMesaCreateContextExt( OSMESA_RGBA, 16, 0, 0, NULL ); + ctx = OSMesaCreateContextExt( OSMESA_RGBA, 16, 0, 0, NULL ); #else - OSMesaContext ctx = OSMesaCreateContext( OSMESA_RGBA, NULL ); + ctx = OSMesaCreateContext( OSMESA_RGBA, NULL ); #endif if (!ctx) { printf("OSMesaCreateContext failed!\n"); return 0; } - for (i = 1; i < argc; i++) { - if (argv[i][0] != '-') - filename = argv[i]; - } - /* Allocate the image buffer */ - buffer = malloc( WIDTH * HEIGHT * 4 * sizeof(GLubyte) ); + buffer = malloc( Width * Height * 4 * sizeof(GLubyte) ); if (!buffer) { printf("Alloc image buffer failed!\n"); return 0; } /* Bind the buffer to the context and make it current */ - if (!OSMesaMakeCurrent( ctx, buffer, GL_UNSIGNED_BYTE, WIDTH, HEIGHT )) { + if (!OSMesaMakeCurrent( ctx, buffer, GL_UNSIGNED_BYTE, Width, Height )) { printf("OSMesaMakeCurrent failed!\n"); return 0; } @@ -295,9 +302,9 @@ main(int argc, char *argv[]) if (filename != NULL) { #ifdef SAVE_TARGA - write_targa(filename, buffer, WIDTH, HEIGHT); + write_targa(filename, buffer, Width, Height); #else - write_ppm(filename, buffer, WIDTH, HEIGHT); + write_ppm(filename, buffer, Width, Height); #endif } else { diff --git a/progs/xdemos/wincopy.c b/progs/xdemos/wincopy.c index 3ec67dc6724..f670983a0f7 100644 --- a/progs/xdemos/wincopy.c +++ b/progs/xdemos/wincopy.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.1 + * Version: 6.5.2 * - * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2006 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"), @@ -32,6 +32,7 @@ */ +#define GL_GLEXT_PROTOTYPES #define GLX_GLXEXT_PROTOTYPES #include #include @@ -50,7 +51,7 @@ static int ScrNum; static GLXContext Context; static Window Win[2]; /* Win[0] = source, Win[1] = dest */ static GLint Width[2], Height[2]; - +static GLboolean TestClipping = GL_FALSE; static GLfloat Angle = 0.0; static GLboolean DrawFront = GL_FALSE; @@ -123,7 +124,7 @@ Redraw(void) glMatrixMode(GL_MODELVIEW); glShadeModel(GL_FLAT); - glClearColor(0.5, 0.5, 0.5, 1.0); + glClearColor(0.5, 0.5, 0.5, 0.0); glClear(GL_COLOR_BUFFER_BIT); /* draw blue quad */ @@ -150,22 +151,18 @@ Redraw(void) return; } - /* raster pos setup */ - glViewport(0, 0, Width[1], Height[1]); - glPushMatrix(); - glLoadIdentity(); - glMatrixMode(GL_PROJECTION); - glPushMatrix(); - glLoadIdentity(); - glOrtho(-1, 1, -1, 1, -1, 1); - glRasterPos2f(-1, -1); - /* copy the image between windows */ - glCopyPixels(0, 0, Width[0], Height[0], GL_COLOR); + glClearColor(0.0, 0.0, 0.0, 0.0); + glClear(GL_COLOR_BUFFER_BIT); - glPopMatrix(); - glMatrixMode(GL_MODELVIEW); - glPopMatrix(); + if (TestClipping) { + glWindowPos2iARB(-2, -2); + glCopyPixels(-2, -2, Width[0] + 4, Height[0] + 4, GL_COLOR); + } + else { + glWindowPos2iARB(0, 0); + glCopyPixels(0, 0, Width[0], Height[0], GL_COLOR); + } if (DrawFront) glFinish(); @@ -309,6 +306,8 @@ Init(void) int main(int argc, char *argv[]) { + if (argc > 1 && strcmp(argv[1], "-clip") == 0) + TestClipping = GL_TRUE; Init(); EventLoop(); return 0; diff --git a/src/glu/Makefile b/src/glu/Makefile index ca9ad39442c..5ddc50946aa 100644 --- a/src/glu/Makefile +++ b/src/glu/Makefile @@ -15,7 +15,7 @@ default: $(TOP)/configs/current install: $(INSTALL) -d $(INSTALL_DIR)/$(LIB_DIR) - $(COPY_LIBS) $(TOP)/$(LIB_DIR)/libGLU.* $(INSTALL_DIR)/$(LIB_DIR) + $(INSTALL) $(TOP)/$(LIB_DIR)/libGLU.* $(INSTALL_DIR)/$(LIB_DIR) clean: @for dir in $(SUBDIRS) ; do \ diff --git a/src/glut/fbdev/Makefile b/src/glut/fbdev/Makefile index 11d95665adb..254ff8c098f 100644 --- a/src/glut/fbdev/Makefile +++ b/src/glut/fbdev/Makefile @@ -72,7 +72,7 @@ install: $(INSTALL) -d $(INSTALL_DIR)/include/GL $(INSTALL) -d $(INSTALL_DIR)/$(LIB_DIR) $(INSTALL) -m 644 $(TOP)/include/GL/glut.h $(INSTALL_DIR)/include/GL - $(COPY_LIBS) $(TOP)/$(LIB_DIR)/libglut* $(INSTALL_DIR)/$(LIB_DIR) + $(INSTALL) $(TOP)/$(LIB_DIR)/libglut* $(INSTALL_DIR)/$(LIB_DIR) # Run 'make -f Makefile.solo dep' to update the dependencies if you change # what's included by any source file. diff --git a/src/glut/fbdev/cursor.c b/src/glut/fbdev/cursor.c index 9254e125593..88386956a44 100644 --- a/src/glut/fbdev/cursor.c +++ b/src/glut/fbdev/cursor.c @@ -257,8 +257,12 @@ void glutSetCursor(int cursor) { if(cursor == GLUT_CURSOR_FULL_CROSSHAIR) cursor = GLUT_CURSOR_CROSSHAIR; + + if(CurrentCursor >= 0 && CurrentCursor < NUM_CURSORS) + EraseCursor(); + CurrentCursor = cursor; + MouseEnabled = 1; - EraseCursor(); SwapCursor(); } diff --git a/src/glut/fbdev/fbdev.c b/src/glut/fbdev/fbdev.c index 1c6cea0434e..ce6419816dd 100644 --- a/src/glut/fbdev/fbdev.c +++ b/src/glut/fbdev/fbdev.c @@ -103,6 +103,9 @@ void TestVisible(void) { static void Cleanup(void) { + /* do not handle this signal when cleaning up */ + signal(SIGWINCH, SIG_IGN); + if(GameMode) glutLeaveGameMode(); @@ -236,6 +239,7 @@ void glutInit (int *argcp, char **argv) signal(SIGSEGV, CrashHandler); signal(SIGINT, CrashHandler); signal(SIGTERM, CrashHandler); + signal(SIGABRT, CrashHandler); if(nomouse == 0) InitializeMouse(); @@ -271,7 +275,7 @@ void glutInit (int *argcp, char **argv) exit(0); } - /* Get the fixed screen info */ + /* get the fixed screen info */ if (ioctl(FrameBufferFD, FBIOGET_FSCREENINFO, &FixedInfo)) { sprintf(exiterror, "error: ioctl(FBIOGET_FSCREENINFO) failed: %s\n", strerror(errno)); @@ -410,10 +414,10 @@ void glutInitWindowSize (int width, int height) static void ProcessTimers(void) { - if(GlutTimers && GlutTimers->time < glutGet(GLUT_ELAPSED_TIME)) { + while(GlutTimers && GlutTimers->time <= glutGet(GLUT_ELAPSED_TIME)) { struct GlutTimer *timer = GlutTimers; - timer->func(timer->value); GlutTimers = timer->next; + timer->func(timer->value); free(timer); } } @@ -669,6 +673,47 @@ void CreateVisual(void) } } +static void ResizeVisual(void) +{ + if(!glFBDevMakeCurrent( Context, Buffer, Buffer )) { + sprintf(exiterror, "Failure to Make Current\n"); + exit(0); + } + + InitializeMenus(); + + if(ReshapeFunc) + ReshapeFunc(VarInfo.xres, VarInfo.yres); + Redisplay = 1; +} + +static void SignalWinch(int arg) +{ + /* we can't change bitdepth without destroying the visual */ + int bits_per_pixel = VarInfo.bits_per_pixel; + struct fb_bitfield red = VarInfo.red, green = VarInfo.green, + blue = VarInfo.blue, transp = VarInfo.transp; + + /* get the variable screen info */ + if (ioctl(FrameBufferFD, FBIOGET_VSCREENINFO, &VarInfo)) { + sprintf(exiterror, "error: ioctl(FBIOGET_VSCREENINFO) failed: %s\n", + strerror(errno)); + exit(0); + } + + /* restore bitdepth and color masks only */ + VarInfo.bits_per_pixel = bits_per_pixel; + VarInfo.red = red; + VarInfo.green = green; + VarInfo.blue = blue; + VarInfo.transp = transp; + + SetVideoMode(); + CreateBuffer(); + + ResizeVisual(); +} + int glutCreateWindow (const char *title) { if(Initialized == 0) { @@ -713,6 +758,8 @@ int glutCreateWindow (const char *title) glutSetWindowTitle(title); + signal(SIGWINCH, SignalWinch); + Visible = 1; VisibleSwitch = 1; Redisplay = 1; @@ -787,19 +834,13 @@ void glutReshapeWindow(int width, int height) if(!ParseFBModes(width, width, height, height, 0, MAX_VSYNC)) return; + signal(SIGWINCH, SIG_IGN); + SetVideoMode(); CreateBuffer(); - - if(!glFBDevMakeCurrent( Context, Buffer, Buffer )) { - sprintf(exiterror, "Failure to Make Current\n"); - exit(0); - } - InitializeMenus(); - - if(ReshapeFunc) - ReshapeFunc(VarInfo.xres, VarInfo.yres); - Redisplay = 1; + ResizeVisual(); + signal(SIGWINCH, SignalWinch); } void glutFullScreen(void) @@ -836,6 +877,9 @@ static void UnIconifyWindow(int sig) strerror(errno)); exit(0); } + + RestoreColorMap(); + Redisplay = 1; VisibleSwitch = 1; Visible = 1; @@ -848,6 +892,7 @@ void glutIconifyWindow(void) if (ioctl(FrameBufferFD, FBIOPUT_VSCREENINFO, &OrigVarInfo)) fprintf(stderr, "ioctl(FBIOPUT_VSCREENINFO failed): %s\n", strerror(errno)); + raise(SIGSTOP); } diff --git a/src/glut/fbdev/gamemode.c b/src/glut/fbdev/gamemode.c index f6d6e4044ef..9f32d9d7e82 100644 --- a/src/glut/fbdev/gamemode.c +++ b/src/glut/fbdev/gamemode.c @@ -263,7 +263,6 @@ void glutLeaveGameMode(void) KeyboardFunc = KeyFuncs[0]; KeyboardUpFunc = KeyFuncs[1]; - DisplayFunc = NormFuncs[0]; ReshapeFunc = NormFuncs[1]; MouseFunc = NormFuncs[2]; diff --git a/src/glut/fbdev/input.c b/src/glut/fbdev/input.c index b1362245f2f..2528a74a105 100644 --- a/src/glut/fbdev/input.c +++ b/src/glut/fbdev/input.c @@ -90,66 +90,67 @@ static int kbdpipe[2]; vts and kill it without Alt-SysRq hack */ static void KeyboardHandler(int sig) { - int release, labelval; unsigned char code; - struct kbentry entry; - static int lalt; /* only left alt does vt switch */ - if(read(ConsoleFD, &code, 1) != 1) - return; - - release = code & 0x80; - - entry.kb_index = code & 0x7F; - entry.kb_table = 0; - - if (ioctl(ConsoleFD, KDGKBENT, &entry) < 0) { - sprintf(exiterror, "ioctl(KDGKBENT) failed.\n"); - exit(0); - } - - labelval = entry.kb_value; - - switch(labelval) { - case K_SHIFT: - case K_SHIFTL: - MODIFIER(GLUT_ACTIVE_SHIFT); - return; - case K_CTRL: - MODIFIER(GLUT_ACTIVE_CTRL); - return; - case K_ALT: - lalt = !release; - case K_ALTGR: - MODIFIER(GLUT_ACTIVE_ALT); - return; - } + while(read(ConsoleFD, &code, 1) == 1) { - if(lalt && !release) { - /* VT switch, we must do it */ - int vt = -1; - struct vt_stat st; - if(labelval >= K_F1 && labelval <= K_F12) - vt = labelval - K_F1 + 1; + int release, labelval; + struct kbentry entry; + static int lalt; /* only left alt does vt switch */ - if(labelval == K_LEFT) - if(ioctl(ConsoleFD, VT_GETSTATE, &st) >= 0) - vt = st.v_active - 1; + release = code & 0x80; + + entry.kb_index = code & 0x7F; + entry.kb_table = 0; + + if (ioctl(ConsoleFD, KDGKBENT, &entry) < 0) { + sprintf(exiterror, "ioctl(KDGKBENT) failed.\n"); + exit(0); + } - if(labelval == K_RIGHT) - if(ioctl(ConsoleFD, VT_GETSTATE, &st) >= 0) - vt = st.v_active + 1; + labelval = entry.kb_value; + + switch(labelval) { + case K_SHIFT: + case K_SHIFTL: + MODIFIER(GLUT_ACTIVE_SHIFT); + continue; + case K_CTRL: + MODIFIER(GLUT_ACTIVE_CTRL); + continue; + case K_ALT: + lalt = !release; + case K_ALTGR: + MODIFIER(GLUT_ACTIVE_ALT); + continue; + } - if(vt != -1) { - if(Swapping) - VTSwitch = vt; - else - if(ioctl(ConsoleFD, VT_ACTIVATE, vt) < 0) - sprintf(exiterror, "Error switching console\n"); - return; + if(lalt && !release) { + /* VT switch, we must do it */ + int vt = -1; + struct vt_stat st; + if(labelval >= K_F1 && labelval <= K_F12) + vt = labelval - K_F1 + 1; + + if(labelval == K_LEFT) + if(ioctl(ConsoleFD, VT_GETSTATE, &st) >= 0) + vt = st.v_active - 1; + + if(labelval == K_RIGHT) + if(ioctl(ConsoleFD, VT_GETSTATE, &st) >= 0) + vt = st.v_active + 1; + + if(vt != -1) { + if(Swapping) + VTSwitch = vt; + else + if(ioctl(ConsoleFD, VT_ACTIVATE, vt) < 0) + sprintf(exiterror, "Error switching console\n"); + continue; + } } + write(kbdpipe[1], &code, 1); } - write(kbdpipe[1], &code, 1); } static void LedModifier(int led, int release) @@ -239,7 +240,7 @@ static int ReadKey(void) goto altset; } } - stdkey: + if(specialkey) { if(SpecialFunc) SpecialFunc(specialkey, MouseX, MouseY); @@ -253,6 +254,7 @@ static int ReadKey(void) || (code == 95) || (code >= 123 && code <= 126)) KeyboardModifiers |= GLUT_ACTIVE_SHIFT; + stdkey: if(KeyboardFunc) KeyboardFunc(code, MouseX, MouseY); } @@ -341,7 +343,7 @@ static int ReadKey(void) break; case K_ENTER: case K_ENTER - 1: /* keypad enter */ - labelval = '\n'; break; + labelval = '\r'; break; } /* dispatch callback */ @@ -600,6 +602,10 @@ void InitializeVT(int usestdin) close(fd); } + /* if we close with the modifier set in glutIconifyWindow, we won't + get the signal when they are released, so set to zero here */ + KeyboardModifiers = 0; + /* open the console tty */ sprintf(console, "/dev/tty%d", CurrentVT); ConsoleFD = open(console, O_RDWR | O_NDELAY, 0); @@ -660,13 +666,13 @@ void InitializeVT(int usestdin) if(ioctl(ConsoleFD, KDSETMODE, KD_GRAPHICS) < 0) sprintf(exiterror,"Warning: Failed to set terminal to graphics\n"); - if (ioctl(ConsoleFD, KDSKBMODE, K_MEDIUMRAW) < 0) { + if(ioctl(ConsoleFD, KDSKBMODE, K_MEDIUMRAW) < 0) { sprintf(exiterror, "ioctl KDSKBMODE failed!\n"); tcsetattr(0, TCSANOW, &OldTermios); exit(0); } - if( ioctl(ConsoleFD, KDGKBLED, &KeyboardLedState) < 0) { + if(ioctl(ConsoleFD, KDGKBLED, &KeyboardLedState) < 0) { sprintf(exiterror, "ioctl KDGKBLED failed!\n"); exit(0); } @@ -686,10 +692,8 @@ void RestoreVT(void) GpmMouse || #endif ConsoleFD == 0) - if(ioctl(ConsoleFD, KDSETMODE, KD_GRAPHICS) < 0) { - sprintf(exiterror,"Warning: Failed to set terminal to graphics\n"); + if(ioctl(ConsoleFD, KDSETMODE, KD_GRAPHICS) < 0) goto skipioctl; /* no need to fail twice */ - } if(ioctl(ConsoleFD, KDSETMODE, OldMode) < 0) fprintf(stderr, "ioctl KDSETMODE failed!\n"); @@ -707,6 +711,9 @@ void RestoreVT(void) fprintf(stderr, "ioctl KDSKBMODE failed!\n"); close(ConsoleFD); + + close(kbdpipe[0]); + close(kbdpipe[1]); } void InitializeMouse(void) diff --git a/src/glut/glx/Makefile b/src/glut/glx/Makefile index 6fac92fa0cb..7e1d56b3278 100644 --- a/src/glut/glx/Makefile +++ b/src/glut/glx/Makefile @@ -100,7 +100,7 @@ install: $(INSTALL) -d $(INSTALL_DIR)/include/GL $(INSTALL) -d $(INSTALL_DIR)/$(LIB_DIR) $(INSTALL) -m 644 $(TOP)/include/GL/glut.h $(INSTALL_DIR)/include/GL - $(COPY_LIBS) $(TOP)/$(LIB_DIR)/libglut* $(INSTALL_DIR)/$(LIB_DIR) + $(INSTALL) $(TOP)/$(LIB_DIR)/libglut* $(INSTALL_DIR)/$(LIB_DIR) clean: diff --git a/src/glut/glx/glut_cmap.c b/src/glut/glx/glut_cmap.c index 1c496ad66da..e8d9e1f01bf 100644 --- a/src/glut/glx/glut_cmap.c +++ b/src/glut/glx/glut_cmap.c @@ -177,7 +177,6 @@ __glutSetupColormap(XVisualInfo * vi, GLUTcolormap ** colormap, Colormap * cmap) } break; case TrueColor: - case DirectColor: *colormap = NULL; /* NULL if RGBA */ /* Hewlett-Packard supports a feature called "HP Color @@ -250,10 +249,31 @@ __glutSetupColormap(XVisualInfo * vi, GLUTcolormap ** colormap, Colormap * cmap) private one. */ /* XXX Should do a better job of internal sharing for privately allocated TrueColor colormaps. */ - /* XXX DirectColor probably needs ramps hand initialized! */ *cmap = XCreateColormap(__glutDisplay, __glutRoot, vi->visual, AllocNone); break; + case DirectColor: + *colormap = NULL; /* NULL if RGBA */ + *cmap = XCreateColormap(__glutDisplay, __glutRoot, + vi->visual, AllocAll); + if (vi->depth == 24) { + /* init the red, green, blue maps to linear ramps */ + XColor xc[256]; + int i; + for (i = 0; i < 256; i++) { + xc[i].pixel = (i << 16) | (i << 8) | i; + xc[i].red = (i << 8) | i; + xc[i].green = (i << 8) | i; + xc[i].blue = (i << 8) | i; + xc[i].flags = DoRed | DoGreen | DoBlue; + } + XStoreColors(__glutDisplay, *cmap, xc, 256); + } + else { + fprintf(stderr, "GLUT Error: DirectColor visuals other than 24-bits " + "not fully supported.\n"); + } + break; case StaticColor: case StaticGray: case GrayScale: diff --git a/src/glut/glx/glut_win.c b/src/glut/glx/glut_win.c index 9b9e6e30225..0f48e0ba339 100644 --- a/src/glut/glx/glut_win.c +++ b/src/glut/glx/glut_win.c @@ -349,13 +349,30 @@ getVisualInfoRGB(unsigned int mode) __glutScreen, list); } +static XVisualInfo * +getVisualInfoID(int id) +{ + XVisualInfo temp; + int count; + temp.visualid = id; + return XGetVisualInfo(__glutDisplay, VisualIDMask, &temp, &count); +} + + XVisualInfo * __glutGetVisualInfo(unsigned int mode) { + char *visStr; /* XXX GLUT_LUMINANCE not implemented for GLUT 3.0. */ if (GLUT_WIND_IS_LUMINANCE(mode)) return NULL; + visStr = getenv("GLUT_FORCE_VISUAL"); + if (visStr) { + int id = atoi(visStr); + return getVisualInfoID(id); + } + if (GLUT_WIND_IS_RGB(mode)) return getVisualInfoRGB(mode); else diff --git a/src/glut/mini/models.c b/src/glut/mini/models.c index 57f45a262ce..3f955b88ff6 100644 --- a/src/glut/mini/models.c +++ b/src/glut/mini/models.c @@ -152,7 +152,7 @@ drawBox(GLfloat size, GLenum type) for (i = 5; i >= 0; i--) { glBegin(type); -/* glNormal3fv(&n[i][0]); */ + glNormal3fv(&n[i][0]); glVertex3fv(&v[faces[i][0]][0]); glVertex3fv(&v[faces[i][1]][0]); glVertex3fv(&v[faces[i][2]][0]); @@ -205,9 +205,9 @@ doughnut(GLfloat r, GLfloat R, GLint nsides, GLint rings) sinPhi = sin(phi); dist = R + r * cosPhi; -/* glNormal3f(cosTheta1 * cosPhi, -sinTheta1 * cosPhi, sinPhi); */ + glNormal3f(cosTheta1 * cosPhi, -sinTheta1 * cosPhi, sinPhi); glVertex3f(cosTheta1 * dist, -sinTheta1 * dist, r * sinPhi); -/* glNormal3f(cosTheta * cosPhi, -sinTheta * cosPhi, sinPhi); */ + glNormal3f(cosTheta * cosPhi, -sinTheta * cosPhi, sinPhi); glVertex3f(cosTheta * dist, -sinTheta * dist, r * sinPhi); } glEnd(); @@ -222,10 +222,10 @@ void APIENTRY glutWireTorus(GLdouble innerRadius, GLdouble outerRadius, GLint nsides, GLint rings) { -/* glPushAttrib(GL_POLYGON_BIT); */ -/* glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); */ + glPushAttrib(GL_POLYGON_BIT); + glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); doughnut(innerRadius, outerRadius, nsides, rings); -/* glPopAttrib(); */ + glPopAttrib(); } void APIENTRY @@ -318,7 +318,7 @@ pentagon(int a, int b, int c, int d, int e, GLenum shadeType) normalize(n0); glBegin(shadeType); -/* glNormal3fv(n0); */ + glNormal3fv(n0); glVertex3fv(&dodec[a][0]); glVertex3fv(&dodec[b][0]); glVertex3fv(&dodec[c][0]); @@ -377,7 +377,7 @@ recorditem(GLfloat * n1, GLfloat * n2, GLfloat * n3, normalize(q1); glBegin(shadeType); -/* glNormal3fv(q1); */ + glNormal3fv(q1); glVertex3fv(n1); glVertex3fv(n2); glVertex3fv(n3); diff --git a/src/glw/Makefile b/src/glw/Makefile index 356351a1ced..5228cbbb721 100644 --- a/src/glw/Makefile +++ b/src/glw/Makefile @@ -29,7 +29,7 @@ install: $(INSTALL) -d $(INSTALL_DIR)/include/GL $(INSTALL) -d $(INSTALL_DIR)/$(LIB_DIR) $(INSTALL) -m 644 *.h $(INSTALL_DIR)/include/GL - $(COPY_LIBS) $(TOP)/$(LIB_DIR)/libGLw.* $(INSTALL_DIR)/$(LIB_DIR) + $(INSTALL) $(TOP)/$(LIB_DIR)/libGLw.* $(INSTALL_DIR)/$(LIB_DIR) clean: -rm depend depend.bak diff --git a/src/glx/x11/glxext.c b/src/glx/x11/glxext.c index 5b756c26aff..8bec2c34c60 100644 --- a/src/glx/x11/glxext.c +++ b/src/glx/x11/glxext.c @@ -64,9 +64,9 @@ #endif #ifdef USE_XCB -#include -#include -#include +#include +#include +#include #endif #include @@ -723,6 +723,7 @@ static const __DRIinterfaceMethods interface_methods = { }; + /** * Perform the required libGL-side initialization and call the client-side * driver's \c __driCreateNewScreen function. @@ -773,7 +774,8 @@ CallCreateNewScreen(Display *dpy, int scrn, __DRIscreen *psc, framebuffer.dev_priv = NULL; if (XF86DRIOpenConnection(dpy, scrn, &hSAREA, &BusID)) { - fd = drmOpen(NULL,BusID); + int newlyopened; + fd = drmOpenOnce(NULL,BusID, &newlyopened); Xfree(BusID); /* No longer needed */ err_msg = "open DRM"; @@ -800,7 +802,7 @@ CallCreateNewScreen(Display *dpy, int scrn, __DRIscreen *psc, } err_msg = "XF86DRIAuthConnection"; - if (XF86DRIAuthConnection(dpy, scrn, magic)) { + if (!newlyopened || XF86DRIAuthConnection(dpy, scrn, magic)) { char *driverName; /* @@ -904,7 +906,7 @@ CallCreateNewScreen(Display *dpy, int scrn, __DRIscreen *psc, } if ( fd >= 0 ) { - (void)drmClose(fd); + (void)drmCloseOnce(fd); } (void)XF86DRICloseConnection(dpy, scrn); @@ -1016,11 +1018,11 @@ static Bool AllocAndFetchScreenConfigs(Display *dpy, __GLXdisplayPrivate *priv) if (!_XReply(dpy, (xReply*) &reply, 0, False)) { /* Something is busted. Punt. */ UnlockDisplay(dpy); + SyncHandle(); FreeScreenConfigs(priv); return GL_FALSE; } - UnlockDisplay(dpy); if (!reply.numVisuals) { /* This screen does not support GL rendering */ UnlockDisplay(dpy); @@ -1284,7 +1286,7 @@ GLubyte *__glXFlushRenderBuffer(__GLXcontext *ctx, GLubyte *pc) { Display * const dpy = ctx->currentDpy; #ifdef USE_XCB - XCBConnection *c = XCBConnectionOfDisplay(dpy); + xcb_connection_t *c = XGetXCBConnection(dpy); #else xGLXRenderReq *req; #endif /* USE_XCB */ @@ -1292,7 +1294,7 @@ GLubyte *__glXFlushRenderBuffer(__GLXcontext *ctx, GLubyte *pc) if ( (dpy != NULL) && (size > 0) ) { #ifdef USE_XCB - XCBGlxRender(c, ctx->currentContextTag, size, (char *)ctx->buf); + xcb_glx_render(c, ctx->currentContextTag, size, (char *)ctx->buf); #else /* Send the entire buffer as an X request */ LockDisplay(dpy); @@ -1335,8 +1337,8 @@ void __glXSendLargeChunk(__GLXcontext *gc, GLint requestNumber, { Display *dpy = gc->currentDpy; #ifdef USE_XCB - XCBConnection *c = XCBConnectionOfDisplay(dpy); - XCBGlxRenderLarge(c, gc->currentContextTag, requestNumber, totalRequests, dataLen, data); + xcb_connection_t *c = XGetXCBConnection(dpy); + xcb_glx_render_large(c, gc->currentContextTag, requestNumber, totalRequests, dataLen, data); #else xGLXRenderLargeReq *req; @@ -1480,12 +1482,17 @@ static Bool SendMakeCurrentRequest( Display *dpy, CARD8 opcode, * \warning * This function assumes that \c dpy is locked with \c LockDisplay on entry. */ -static Bool SendMakeCurrentRequest( Display *dpy, CARD8 opcode, - GLXContextID gc_id, GLXContextTag gc_tag, - GLXDrawable draw, GLXDrawable read, - xGLXMakeCurrentReply * reply ) +static Bool SendMakeCurrentRequest(Display *dpy, CARD8 opcode, + GLXContextID gc_id, GLXContextTag gc_tag, + GLXDrawable draw, GLXDrawable read, + xGLXMakeCurrentReply *reply) { - if ( draw == read ) { + Bool ret; + + + LockDisplay(dpy); + + if (draw == read) { xGLXMakeCurrentReq *req; GetReq(GLXMakeCurrent,req); @@ -1503,7 +1510,7 @@ static Bool SendMakeCurrentRequest( Display *dpy, CARD8 opcode, * not the SGI extension. */ - if ( (priv->majorVersion > 1) || (priv->minorVersion >= 3) ) { + if ((priv->majorVersion > 1) || (priv->minorVersion >= 3)) { xGLXMakeContextCurrentReq *req; GetReq(GLXMakeContextCurrent,req); @@ -1531,7 +1538,12 @@ static Bool SendMakeCurrentRequest( Display *dpy, CARD8 opcode, } } - return _XReply(dpy, (xReply*) reply, 0, False); + ret = _XReply(dpy, (xReply*) reply, 0, False); + + UnlockDisplay(dpy); + SyncHandle(); + + return ret; } @@ -1554,161 +1566,93 @@ static Bool UnbindContextWrapper( GLXContext gc ) #endif /* GLX_DIRECT_RENDERING */ -/* -** Make a particular context current. -** NOTE: this is in this file so that it can access dummyContext. -*/ +/** + * Make a particular context current. + * + * \note This is in this file so that it can access dummyContext. + */ USED static Bool MakeContextCurrent(Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext gc) { xGLXMakeCurrentReply reply; - GLXContext oldGC; - CARD8 opcode, oldOpcode; - Bool sentRequestToOldDpy = False; - Bool bindReturnValue = True; + const GLXContext oldGC = __glXGetCurrentContext(); + const CARD8 opcode = __glXSetupForCommand(dpy); + const CARD8 oldOpcode = ((gc == oldGC) || (oldGC == &dummyContext)) + ? opcode : __glXSetupForCommand(oldGC->currentDpy); + Bool bindReturnValue; + - opcode = __glXSetupForCommand(dpy); - if (!opcode) { + if (!opcode || !oldOpcode) { return GL_FALSE; } - /* - ** Make sure that the new context has a nonzero ID. In the request, - ** a zero context ID is used only to mean that we bind to no current - ** context. - */ + /* Make sure that the new context has a nonzero ID. In the request, + * a zero context ID is used only to mean that we bind to no current + * context. + */ if ((gc != NULL) && (gc->xid == None)) { return GL_FALSE; } - oldGC = __glXGetCurrentContext(); - oldOpcode = (gc == oldGC) ? opcode : __glXSetupForCommand(dpy); - if (!oldOpcode) { +#ifndef GLX_DIRECT_RENDERING + if (gc && gc->isDirect) { return GL_FALSE; } - - if ((dpy != oldGC->currentDpy || (gc && gc->isDirect)) && - !oldGC->isDirect && oldGC != &dummyContext) { - /* - ** We are either switching from one dpy to another and have to - ** send a request to the previous dpy to unbind the previous - ** context, or we are switching away from a indirect context to - ** a direct context and have to send a request to the dpy to - ** unbind the previous context. - */ - sentRequestToOldDpy = True; - LockDisplay(oldGC->currentDpy); - if ( ! SendMakeCurrentRequest( oldGC->currentDpy, oldOpcode, None, - oldGC->currentContextTag, None, None, - &reply ) ) { - /* The make current failed. Just return GL_FALSE. */ - UnlockDisplay(oldGC->currentDpy); - SyncHandle(); - return GL_FALSE; - } - - oldGC->currentContextTag = 0; - } +#endif _glapi_check_multithread(); #ifdef GLX_DIRECT_RENDERING - /* Unbind the old direct rendering context */ - if (oldGC->isDirect) { - if (oldGC->driContext.private) { - if (! UnbindContextWrapper( oldGC )) { - /* The make current failed. Just return GL_FALSE. */ - return GL_FALSE; - } - } - oldGC->currentContextTag = 0; - } - /* Bind the direct rendering context to the drawable */ if (gc && gc->isDirect) { - if (gc->driContext.private) { - bindReturnValue = BindContextWrapper( dpy, gc, draw, read ); - } - } else { + bindReturnValue = (gc->driContext.private) + ? BindContextWrapper(dpy, gc, draw, read) + : False; + } else #endif + { /* Send a glXMakeCurrent request to bind the new context. */ - LockDisplay(dpy); - - bindReturnValue = SendMakeCurrentRequest( dpy, opcode, - gc ? gc->xid : None, - oldGC->currentContextTag, - draw, read, &reply ); - UnlockDisplay(dpy); -#ifdef GLX_DIRECT_RENDERING + bindReturnValue = + SendMakeCurrentRequest(dpy, opcode, gc ? gc->xid : None, + ((dpy != oldGC->currentDpy) || oldGC->isDirect) + ? None : oldGC->currentContextTag, + draw, read, &reply); } -#endif if (!bindReturnValue) { - /* The make current failed. */ - if (gc && !gc->isDirect) { - SyncHandle(); - } + return False; + } + + if ((dpy != oldGC->currentDpy || (gc && gc->isDirect)) && + !oldGC->isDirect && oldGC != &dummyContext) { + xGLXMakeCurrentReply dummy_reply; + /* We are either switching from one dpy to another and have to + * send a request to the previous dpy to unbind the previous + * context, or we are switching away from a indirect context to + * a direct context and have to send a request to the dpy to + * unbind the previous context. + */ + (void) SendMakeCurrentRequest(oldGC->currentDpy, oldOpcode, None, + oldGC->currentContextTag, None, None, + & dummy_reply); + } #ifdef GLX_DIRECT_RENDERING - /* If the old context was direct rendering, then re-bind to it. */ - if (oldGC->isDirect) { - if (oldGC->driContext.private) { - if (! BindContextWrapper( oldGC->currentDpy, oldGC, - oldGC->currentDrawable, - oldGC->currentReadable )) { - /* - ** The request failed; this cannot happen with the - ** current API. If in the future the API is - ** extended to allow context sharing between - ** clients, then this may fail (because another - ** client may have grabbed the context); in that - ** case, we cannot undo the previous request, and - ** cannot adhere to the "no-op" behavior. - */ - } - } - } else -#endif - /* - ** If we had just sent a request to a previous dpy, we have to - ** undo that request (because if a command fails, it should act - ** like a no-op) by making current to the previous context and - ** drawable. - */ - if (sentRequestToOldDpy) { - if ( !SendMakeCurrentRequest( oldGC->currentDpy, oldOpcode, - oldGC->xid, 0, - oldGC->currentDrawable, - oldGC->currentReadable, &reply ) ) { - UnlockDisplay(oldGC->currentDpy); - SyncHandle(); - /* - ** The request failed; this cannot happen with the - ** current API. If in the future the API is extended to - ** allow context sharing between clients, then this may - ** fail (because another client may have grabbed the - ** context); in that case, we cannot undo the previous - ** request, and cannot adhere to the "no-op" behavior. - */ - } - else { - UnlockDisplay(oldGC->currentDpy); - } - oldGC->currentContextTag = reply.contextTag; - } - return GL_FALSE; + else if (oldGC->isDirect && oldGC->driContext.private) { + (void) UnbindContextWrapper(oldGC); } +#endif + /* Update our notion of what is current */ __glXLock(); if (gc == oldGC) { - /* - ** Even though the contexts are the same the drawable might have - ** changed. Note that gc cannot be the dummy, and that oldGC - ** cannot be NULL, therefore if they are the same, gc is not - ** NULL and not the dummy. - */ + /* Even though the contexts are the same the drawable might have + * changed. Note that gc cannot be the dummy, and that oldGC + * cannot be NULL, therefore if they are the same, gc is not + * NULL and not the dummy. + */ gc->currentDrawable = draw; gc->currentReadable = read; } else { @@ -1720,11 +1664,10 @@ USED static Bool MakeContextCurrent(Display *dpy, GLXDrawable draw, oldGC->currentContextTag = 0; if (oldGC->xid == None) { - /* - ** We are switching away from a context that was - ** previously destroyed, so we need to free the memory - ** for the old handle. - */ + /* We are switching away from a context that was + * previously destroyed, so we need to free the memory + * for the old handle. + */ #ifdef GLX_DIRECT_RENDERING /* Destroy the old direct rendering context */ if (oldGC->isDirect) { @@ -1740,35 +1683,30 @@ USED static Bool MakeContextCurrent(Display *dpy, GLXDrawable draw, } if (gc) { __glXSetCurrentContext(gc); -#ifdef GLX_DIRECT_RENDERING + + gc->currentDpy = dpy; + gc->currentDrawable = draw; + gc->currentReadable = read; + if (!gc->isDirect) { if (!IndirectAPI) IndirectAPI = __glXNewIndirectAPI(); _glapi_set_dispatch(IndirectAPI); -# ifdef GLX_USE_APPLEGL + +#ifdef GLX_USE_APPLEGL do { extern void XAppleDRIUseIndirectDispatch(void); XAppleDRIUseIndirectDispatch(); } while (0); -# endif - } -#else - /* if not direct rendering, always need indirect dispatch */ - if (!IndirectAPI) - IndirectAPI = __glXNewIndirectAPI(); - _glapi_set_dispatch(IndirectAPI); #endif - gc->currentDpy = dpy; - gc->currentDrawable = draw; - gc->currentReadable = read; - if ( ! gc->isDirect ) { - __GLXattribute * state = (__GLXattribute *)(gc->client_state_private); + __GLXattribute *state = + (__GLXattribute *)(gc->client_state_private); gc->currentContextTag = reply.contextTag; - if ( state->array_state == NULL ) { - (void) glGetString( GL_EXTENSIONS ); - (void) glGetString( GL_VERSION ); + if (state->array_state == NULL) { + (void) glGetString(GL_EXTENSIONS); + (void) glGetString(GL_VERSION); __glXInitVertexArrayState(gc); } } diff --git a/src/glx/x11/indirect.c b/src/glx/x11/indirect.c index 54cea1419ef..b5c306c562d 100644 --- a/src/glx/x11/indirect.c +++ b/src/glx/x11/indirect.c @@ -30,11 +30,14 @@ #include "indirect.h" #include "glxclient.h" #include "indirect_size.h" +#include "dispatch.h" +#include "glapi.h" +#include "glthread.h" #include #ifdef USE_XCB -#include -#include -#include +#include +#include +#include #endif /* USE_XCB */ #define __GLX_PAD(n) (((n) + 3) & ~3) @@ -63,24 +66,24 @@ *((int *)(dest)) = temp.i; } while(0) NOINLINE CARD32 -__glXReadReply( Display *dpy, size_t size, void * dest, GLboolean reply_is_always_array ) +__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 bytes = (reply_is_always_array) + ? (4 * reply.length) : (reply.size * size); const GLint extra = 4 - (bytes & 3); _XRead(dpy, dest, bytes); - if ( extra < 4 ) { + if (extra < 4) { _XEatData(dpy, extra); } - } - else { - (void) memcpy( dest, &(reply.pad3), size); + } else { + (void) memcpy(dest, &(reply.pad3), size); } } @@ -88,37 +91,40 @@ __glXReadReply( Display *dpy, size_t size, void * dest, GLboolean reply_is_alway } NOINLINE void -__glXReadPixelReply( Display *dpy, __GLXcontext * gc, unsigned max_dim, - GLint width, GLint height, GLint depth, GLenum format, GLenum type, - void * dest, GLboolean dimensions_in_reply ) +__glXReadPixelReply(Display * dpy, __GLXcontext * 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; + 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; } + 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 ); + void *buf = Xmalloc(size); - if ( buf == NULL ) { + if (buf == NULL) { _XEatData(dpy, size); __glXSetError(gc, GL_OUT_OF_MEMORY); - } - else { + } else { const GLint extra = 4 - (size & 3); _XRead(dpy, buf, size); - if ( extra < 4 ) { + if (extra < 4) { _XEatData(dpy, extra); } @@ -132,10 +138,10 @@ __glXReadPixelReply( Display *dpy, __GLXcontext * gc, unsigned max_dim, #define X_GLXSingle 0 NOINLINE FASTCALL GLubyte * -__glXSetupSingleRequest( __GLXcontext * gc, GLint sop, GLint cmdlen ) +__glXSetupSingleRequest(__GLXcontext * gc, GLint sop, GLint cmdlen) { - xGLXSingleReq * req; - Display * const dpy = gc->currentDpy; + xGLXSingleReq *req; + Display *const dpy = gc->currentDpy; (void) __glXFlushRenderBuffer(gc, gc->pc); LockDisplay(dpy); @@ -143,14 +149,15 @@ __glXSetupSingleRequest( __GLXcontext * gc, GLint sop, GLint cmdlen ) req->reqType = gc->majorOpcode; req->contextTag = gc->currentContextTag; req->glxCode = sop; - return (GLubyte *)(req) + sz_xGLXSingleReq; + return (GLubyte *) (req) + sz_xGLXSingleReq; } NOINLINE FASTCALL GLubyte * -__glXSetupVendorRequest( __GLXcontext * gc, GLint code, GLint vop, GLint cmdlen ) +__glXSetupVendorRequest(__GLXcontext * gc, GLint code, GLint vop, + GLint cmdlen) { - xGLXVendorPrivateReq * req; - Display * const dpy = gc->currentDpy; + xGLXVendorPrivateReq *req; + Display *const dpy = gc->currentDpy; (void) __glXFlushRenderBuffer(gc, gc->pc); LockDisplay(dpy); @@ -159,7 +166,7 @@ __glXSetupVendorRequest( __GLXcontext * gc, GLint code, GLint vop, GLint cmdlen req->glxCode = code; req->vendorCode = vop; req->contextTag = gc->currentContextTag; - return (GLubyte *)(req) + sz_xGLXVendorPrivateReq; + return (GLubyte *) (req) + sz_xGLXVendorPrivateReq; } const GLuint __glXDefaultPixelStore[9] = { 0, 0, 0, 0, 0, 0, 0, 0, 1 }; @@ -176,118 +183,136 @@ const GLuint __glXDefaultPixelStore[9] = { 0, 0, 0, 0, 0, 0, 0, 0, 1 }; #define default_pixel_store_4D_size 36 static FASTCALL NOINLINE void -generic_3_byte( GLint rop, const void * ptr ) +generic_3_byte(GLint rop, const void *ptr) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, rop, cmdlen); - (void) memcpy((void *)(gc->pc + 4), ptr, 4); + (void) memcpy((void *) (gc->pc + 4), ptr, 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } static FASTCALL NOINLINE void -generic_4_byte( GLint rop, const void * ptr ) +generic_4_byte(GLint rop, const void *ptr) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, rop, cmdlen); - (void) memcpy((void *)(gc->pc + 4), ptr, 4); + (void) memcpy((void *) (gc->pc + 4), ptr, 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } static FASTCALL NOINLINE void -generic_6_byte( GLint rop, const void * ptr ) +generic_6_byte(GLint rop, const void *ptr) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, rop, cmdlen); - (void) memcpy((void *)(gc->pc + 4), ptr, 8); + (void) memcpy((void *) (gc->pc + 4), ptr, 8); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } static FASTCALL NOINLINE void -generic_8_byte( GLint rop, const void * ptr ) +generic_8_byte(GLint rop, const void *ptr) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, rop, cmdlen); - (void) memcpy((void *)(gc->pc + 4), ptr, 8); + (void) memcpy((void *) (gc->pc + 4), ptr, 8); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } static FASTCALL NOINLINE void -generic_12_byte( GLint rop, const void * ptr ) +generic_12_byte(GLint rop, const void *ptr) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, rop, cmdlen); - (void) memcpy((void *)(gc->pc + 4), ptr, 12); + (void) memcpy((void *) (gc->pc + 4), ptr, 12); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } static FASTCALL NOINLINE void -generic_16_byte( GLint rop, const void * ptr ) +generic_16_byte(GLint rop, const void *ptr) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, rop, cmdlen); - (void) memcpy((void *)(gc->pc + 4), ptr, 16); + (void) memcpy((void *) (gc->pc + 4), ptr, 16); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } static FASTCALL NOINLINE void -generic_24_byte( GLint rop, const void * ptr ) +generic_24_byte(GLint rop, const void *ptr) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 28; emit_header(gc->pc, rop, cmdlen); - (void) memcpy((void *)(gc->pc + 4), ptr, 24); + (void) memcpy((void *) (gc->pc + 4), ptr, 24); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } static FASTCALL NOINLINE void -generic_32_byte( GLint rop, const void * ptr ) +generic_32_byte(GLint rop, const void *ptr) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 36; emit_header(gc->pc, rop, cmdlen); - (void) memcpy((void *)(gc->pc + 4), ptr, 32); + (void) memcpy((void *) (gc->pc + 4), ptr, 32); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLsop_NewList 101 void __indirect_glNewList(GLuint list, GLenum mode) { - __GLXcontext * const gc = __glXGetCurrentContext(); - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; const GLuint cmdlen = 8; if (__builtin_expect(dpy != NULL, 1)) { #ifdef USE_XCB - XCBConnection *c = XCBConnectionOfDisplay(dpy); + xcb_connection_t *c = XGetXCBConnection(dpy); (void) __glXFlushRenderBuffer(gc, gc->pc); - XCBGlxNewList(c, gc->currentContextTag, list, mode); + xcb_glx_new_list(c, gc->currentContextTag, list, mode); #else - GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_NewList, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&list), 4); - (void) memcpy((void *)(pc + 4), (void *)(&mode), 4); - UnlockDisplay(dpy); SyncHandle(); + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_NewList, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&list), 4); + (void) memcpy((void *) (pc + 4), (void *) (&mode), 4); + UnlockDisplay(dpy); + SyncHandle(); #endif /* USE_XCB */ } return; @@ -297,17 +322,18 @@ __indirect_glNewList(GLuint list, GLenum mode) void __indirect_glEndList(void) { - __GLXcontext * const gc = __glXGetCurrentContext(); - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; const GLuint cmdlen = 0; if (__builtin_expect(dpy != NULL, 1)) { #ifdef USE_XCB - XCBConnection *c = XCBConnectionOfDisplay(dpy); + xcb_connection_t *c = XGetXCBConnection(dpy); (void) __glXFlushRenderBuffer(gc, gc->pc); - XCBGlxEndList(c, gc->currentContextTag); + xcb_glx_end_list(c, gc->currentContextTag); #else (void) __glXSetupSingleRequest(gc, X_GLsop_EndList, cmdlen); - UnlockDisplay(dpy); SyncHandle(); + UnlockDisplay(dpy); + SyncHandle(); #endif /* USE_XCB */ } return; @@ -317,41 +343,45 @@ __indirect_glEndList(void) void __indirect_glCallList(GLuint list) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_CallList, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&list), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&list), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_CallLists 2 void __indirect_glCallLists(GLsizei n, GLenum type, const GLvoid * lists) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint compsize = __glCallLists_size(type); const GLuint cmdlen = 12 + __GLX_PAD((compsize * n)); if (__builtin_expect((n >= 0) && (gc->currentDpy != NULL), 1)) { if (cmdlen <= gc->maxSmallRenderCommandSize) { - if ( (gc->pc + cmdlen) > gc->bufEnd ) { + if ((gc->pc + cmdlen) > gc->bufEnd) { (void) __glXFlushRenderBuffer(gc, gc->pc); } emit_header(gc->pc, X_GLrop_CallLists, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&n), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&type), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(lists), (compsize * n)); + (void) memcpy((void *) (gc->pc + 4), (void *) (&n), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&type), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (lists), + (compsize * n)); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } - } - else { + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + } else { const GLint op = X_GLrop_CallLists; const GLuint cmdlenLarge = cmdlen + 4; - GLubyte * const pc = __glXFlushRenderBuffer(gc, gc->pc); - (void) memcpy((void *)(pc + 0), (void *)(&cmdlenLarge), 4); - (void) memcpy((void *)(pc + 4), (void *)(&op), 4); - (void) memcpy((void *)(pc + 8), (void *)(&n), 4); - (void) memcpy((void *)(pc + 12), (void *)(&type), 4); + GLubyte *const pc = __glXFlushRenderBuffer(gc, gc->pc); + (void) memcpy((void *) (pc + 0), (void *) (&cmdlenLarge), 4); + (void) memcpy((void *) (pc + 4), (void *) (&op), 4); + (void) memcpy((void *) (pc + 8), (void *) (&n), 4); + (void) memcpy((void *) (pc + 12), (void *) (&type), 4); __glXSendLargeCommand(gc, pc, 16, lists, (compsize * n)); } } @@ -361,19 +391,21 @@ __indirect_glCallLists(GLsizei n, GLenum type, const GLvoid * lists) void __indirect_glDeleteLists(GLuint list, GLsizei range) { - __GLXcontext * const gc = __glXGetCurrentContext(); - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; const GLuint cmdlen = 8; if (__builtin_expect(dpy != NULL, 1)) { #ifdef USE_XCB - XCBConnection *c = XCBConnectionOfDisplay(dpy); + xcb_connection_t *c = XGetXCBConnection(dpy); (void) __glXFlushRenderBuffer(gc, gc->pc); - XCBGlxDeleteLists(c, gc->currentContextTag, list, range); + xcb_glx_delete_lists(c, gc->currentContextTag, list, range); #else - GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_DeleteLists, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&list), 4); - (void) memcpy((void *)(pc + 4), (void *)(&range), 4); - UnlockDisplay(dpy); SyncHandle(); + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_DeleteLists, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&list), 4); + (void) memcpy((void *) (pc + 4), (void *) (&range), 4); + UnlockDisplay(dpy); + SyncHandle(); #endif /* USE_XCB */ } return; @@ -383,22 +415,28 @@ __indirect_glDeleteLists(GLuint list, GLsizei range) GLuint __indirect_glGenLists(GLsizei range) { - __GLXcontext * const gc = __glXGetCurrentContext(); - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; GLuint retval = (GLuint) 0; const GLuint cmdlen = 4; if (__builtin_expect(dpy != NULL, 1)) { #ifdef USE_XCB - XCBConnection *c = XCBConnectionOfDisplay(dpy); + xcb_connection_t *c = XGetXCBConnection(dpy); (void) __glXFlushRenderBuffer(gc, gc->pc); - XCBGlxGenListsRep *reply = XCBGlxGenListsReply(c, XCBGlxGenLists(c, gc->currentContextTag, range), NULL); + xcb_glx_gen_lists_reply_t *reply = + xcb_glx_gen_lists_reply(c, + xcb_glx_gen_lists(c, + gc->currentContextTag, + range), NULL); retval = reply->ret_val; free(reply); #else - GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GenLists, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&range), 4); + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GenLists, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&range), 4); retval = (GLuint) __glXReadReply(dpy, 0, NULL, GL_FALSE); - UnlockDisplay(dpy); SyncHandle(); + UnlockDisplay(dpy); + SyncHandle(); #endif /* USE_XCB */ } return retval; @@ -408,67 +446,79 @@ __indirect_glGenLists(GLsizei range) void __indirect_glListBase(GLuint base) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_ListBase, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&base), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&base), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Begin 4 void __indirect_glBegin(GLenum mode) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_Begin, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&mode), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&mode), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Bitmap 5 void -__indirect_glBitmap(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte * bitmap) +__indirect_glBitmap(GLsizei width, GLsizei height, GLfloat xorig, + GLfloat yorig, GLfloat xmove, GLfloat ymove, + const GLubyte * bitmap) { - __GLXcontext * const gc = __glXGetCurrentContext(); - const GLuint compsize = (bitmap != NULL) ? __glImageSize(width, height, 1, GL_COLOR_INDEX, GL_BITMAP, 0) : 0; + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint compsize = + (bitmap != NULL) ? __glImageSize(width, height, 1, GL_COLOR_INDEX, + GL_BITMAP, 0) : 0; const GLuint cmdlen = 48 + __GLX_PAD(compsize); if (__builtin_expect(gc->currentDpy != NULL, 1)) { if (cmdlen <= gc->maxSmallRenderCommandSize) { - if ( (gc->pc + cmdlen) > gc->bufEnd ) { + if ((gc->pc + cmdlen) > gc->bufEnd) { (void) __glXFlushRenderBuffer(gc, gc->pc); } emit_header(gc->pc, X_GLrop_Bitmap, cmdlen); - (void) memcpy((void *)(gc->pc + 24), (void *)(&width), 4); - (void) memcpy((void *)(gc->pc + 28), (void *)(&height), 4); - (void) memcpy((void *)(gc->pc + 32), (void *)(&xorig), 4); - (void) memcpy((void *)(gc->pc + 36), (void *)(&yorig), 4); - (void) memcpy((void *)(gc->pc + 40), (void *)(&xmove), 4); - (void) memcpy((void *)(gc->pc + 44), (void *)(&ymove), 4); + (void) memcpy((void *) (gc->pc + 24), (void *) (&width), 4); + (void) memcpy((void *) (gc->pc + 28), (void *) (&height), 4); + (void) memcpy((void *) (gc->pc + 32), (void *) (&xorig), 4); + (void) memcpy((void *) (gc->pc + 36), (void *) (&yorig), 4); + (void) memcpy((void *) (gc->pc + 40), (void *) (&xmove), 4); + (void) memcpy((void *) (gc->pc + 44), (void *) (&ymove), 4); if (compsize > 0) { - (*gc->fillImage)(gc, 2, width, height, 1, GL_COLOR_INDEX, GL_BITMAP, bitmap, gc->pc + 48, gc->pc + 4); - } - else { - (void) memcpy( gc->pc + 4, default_pixel_store_2D, default_pixel_store_2D_size ); + (*gc->fillImage) (gc, 2, width, height, 1, GL_COLOR_INDEX, + GL_BITMAP, bitmap, gc->pc + 48, gc->pc + 4); + } else { + (void) memcpy(gc->pc + 4, default_pixel_store_2D, + default_pixel_store_2D_size); } gc->pc += cmdlen; - if (gc->pc > gc->limit) { (void) __glXFlushRenderBuffer(gc, gc->pc); } - } - else { + if (gc->pc > gc->limit) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + } else { const GLint op = X_GLrop_Bitmap; const GLuint cmdlenLarge = cmdlen + 4; - GLubyte * const pc = __glXFlushRenderBuffer(gc, gc->pc); - (void) memcpy((void *)(pc + 0), (void *)(&cmdlenLarge), 4); - (void) memcpy((void *)(pc + 4), (void *)(&op), 4); - (void) memcpy((void *)(pc + 28), (void *)(&width), 4); - (void) memcpy((void *)(pc + 32), (void *)(&height), 4); - (void) memcpy((void *)(pc + 36), (void *)(&xorig), 4); - (void) memcpy((void *)(pc + 40), (void *)(&yorig), 4); - (void) memcpy((void *)(pc + 44), (void *)(&xmove), 4); - (void) memcpy((void *)(pc + 48), (void *)(&ymove), 4); - __glXSendLargeImage(gc, compsize, 2, width, height, 1, GL_COLOR_INDEX, GL_BITMAP, bitmap, pc + 52, pc + 8); + GLubyte *const pc = __glXFlushRenderBuffer(gc, gc->pc); + (void) memcpy((void *) (pc + 0), (void *) (&cmdlenLarge), 4); + (void) memcpy((void *) (pc + 4), (void *) (&op), 4); + (void) memcpy((void *) (pc + 28), (void *) (&width), 4); + (void) memcpy((void *) (pc + 32), (void *) (&height), 4); + (void) memcpy((void *) (pc + 36), (void *) (&xorig), 4); + (void) memcpy((void *) (pc + 40), (void *) (&yorig), 4); + (void) memcpy((void *) (pc + 44), (void *) (&xmove), 4); + (void) memcpy((void *) (pc + 48), (void *) (&ymove), 4); + __glXSendLargeImage(gc, compsize, 2, width, height, 1, + GL_COLOR_INDEX, GL_BITMAP, bitmap, pc + 52, + pc + 8); } } } @@ -477,2736 +527,3083 @@ __indirect_glBitmap(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, void __indirect_glColor3b(GLbyte red, GLbyte green, GLbyte blue) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_Color3bv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&red), 1); - (void) memcpy((void *)(gc->pc + 5), (void *)(&green), 1); - (void) memcpy((void *)(gc->pc + 6), (void *)(&blue), 1); + (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 1); + (void) memcpy((void *) (gc->pc + 5), (void *) (&green), 1); + (void) memcpy((void *) (gc->pc + 6), (void *) (&blue), 1); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Color3bv 6 void __indirect_glColor3bv(const GLbyte * v) { - generic_3_byte( X_GLrop_Color3bv, v ); + generic_3_byte(X_GLrop_Color3bv, v); } #define X_GLrop_Color3dv 7 void __indirect_glColor3d(GLdouble red, GLdouble green, GLdouble blue) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 28; emit_header(gc->pc, X_GLrop_Color3dv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&red), 8); - (void) memcpy((void *)(gc->pc + 12), (void *)(&green), 8); - (void) memcpy((void *)(gc->pc + 20), (void *)(&blue), 8); + (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 8); + (void) memcpy((void *) (gc->pc + 12), (void *) (&green), 8); + (void) memcpy((void *) (gc->pc + 20), (void *) (&blue), 8); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Color3dv 7 void __indirect_glColor3dv(const GLdouble * v) { - generic_24_byte( X_GLrop_Color3dv, v ); + generic_24_byte(X_GLrop_Color3dv, v); } #define X_GLrop_Color3fv 8 void __indirect_glColor3f(GLfloat red, GLfloat green, GLfloat blue) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_Color3fv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&red), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&green), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&blue), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&green), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&blue), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Color3fv 8 void __indirect_glColor3fv(const GLfloat * v) { - generic_12_byte( X_GLrop_Color3fv, v ); + generic_12_byte(X_GLrop_Color3fv, v); } #define X_GLrop_Color3iv 9 void __indirect_glColor3i(GLint red, GLint green, GLint blue) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_Color3iv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&red), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&green), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&blue), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&green), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&blue), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Color3iv 9 void __indirect_glColor3iv(const GLint * v) { - generic_12_byte( X_GLrop_Color3iv, v ); + generic_12_byte(X_GLrop_Color3iv, v); } #define X_GLrop_Color3sv 10 void __indirect_glColor3s(GLshort red, GLshort green, GLshort blue) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_Color3sv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&red), 2); - (void) memcpy((void *)(gc->pc + 6), (void *)(&green), 2); - (void) memcpy((void *)(gc->pc + 8), (void *)(&blue), 2); + (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 2); + (void) memcpy((void *) (gc->pc + 6), (void *) (&green), 2); + (void) memcpy((void *) (gc->pc + 8), (void *) (&blue), 2); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Color3sv 10 void __indirect_glColor3sv(const GLshort * v) { - generic_6_byte( X_GLrop_Color3sv, v ); + generic_6_byte(X_GLrop_Color3sv, v); } #define X_GLrop_Color3ubv 11 void __indirect_glColor3ub(GLubyte red, GLubyte green, GLubyte blue) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_Color3ubv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&red), 1); - (void) memcpy((void *)(gc->pc + 5), (void *)(&green), 1); - (void) memcpy((void *)(gc->pc + 6), (void *)(&blue), 1); + (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 1); + (void) memcpy((void *) (gc->pc + 5), (void *) (&green), 1); + (void) memcpy((void *) (gc->pc + 6), (void *) (&blue), 1); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Color3ubv 11 void __indirect_glColor3ubv(const GLubyte * v) { - generic_3_byte( X_GLrop_Color3ubv, v ); + generic_3_byte(X_GLrop_Color3ubv, v); } #define X_GLrop_Color3uiv 12 void __indirect_glColor3ui(GLuint red, GLuint green, GLuint blue) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_Color3uiv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&red), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&green), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&blue), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&green), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&blue), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Color3uiv 12 void __indirect_glColor3uiv(const GLuint * v) { - generic_12_byte( X_GLrop_Color3uiv, v ); + generic_12_byte(X_GLrop_Color3uiv, v); } #define X_GLrop_Color3usv 13 void __indirect_glColor3us(GLushort red, GLushort green, GLushort blue) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_Color3usv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&red), 2); - (void) memcpy((void *)(gc->pc + 6), (void *)(&green), 2); - (void) memcpy((void *)(gc->pc + 8), (void *)(&blue), 2); + (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 2); + (void) memcpy((void *) (gc->pc + 6), (void *) (&green), 2); + (void) memcpy((void *) (gc->pc + 8), (void *) (&blue), 2); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Color3usv 13 void __indirect_glColor3usv(const GLushort * v) { - generic_6_byte( X_GLrop_Color3usv, v ); + generic_6_byte(X_GLrop_Color3usv, v); } #define X_GLrop_Color4bv 14 void __indirect_glColor4b(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_Color4bv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&red), 1); - (void) memcpy((void *)(gc->pc + 5), (void *)(&green), 1); - (void) memcpy((void *)(gc->pc + 6), (void *)(&blue), 1); - (void) memcpy((void *)(gc->pc + 7), (void *)(&alpha), 1); + (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 1); + (void) memcpy((void *) (gc->pc + 5), (void *) (&green), 1); + (void) memcpy((void *) (gc->pc + 6), (void *) (&blue), 1); + (void) memcpy((void *) (gc->pc + 7), (void *) (&alpha), 1); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Color4bv 14 void __indirect_glColor4bv(const GLbyte * v) { - generic_4_byte( X_GLrop_Color4bv, v ); + generic_4_byte(X_GLrop_Color4bv, v); } #define X_GLrop_Color4dv 15 void -__indirect_glColor4d(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha) +__indirect_glColor4d(GLdouble red, GLdouble green, GLdouble blue, + GLdouble alpha) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 36; emit_header(gc->pc, X_GLrop_Color4dv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&red), 8); - (void) memcpy((void *)(gc->pc + 12), (void *)(&green), 8); - (void) memcpy((void *)(gc->pc + 20), (void *)(&blue), 8); - (void) memcpy((void *)(gc->pc + 28), (void *)(&alpha), 8); + (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 8); + (void) memcpy((void *) (gc->pc + 12), (void *) (&green), 8); + (void) memcpy((void *) (gc->pc + 20), (void *) (&blue), 8); + (void) memcpy((void *) (gc->pc + 28), (void *) (&alpha), 8); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Color4dv 15 void __indirect_glColor4dv(const GLdouble * v) { - generic_32_byte( X_GLrop_Color4dv, v ); + generic_32_byte(X_GLrop_Color4dv, v); } #define X_GLrop_Color4fv 16 void __indirect_glColor4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_Color4fv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&red), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&green), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&blue), 4); - (void) memcpy((void *)(gc->pc + 16), (void *)(&alpha), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&green), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&blue), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&alpha), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Color4fv 16 void __indirect_glColor4fv(const GLfloat * v) { - generic_16_byte( X_GLrop_Color4fv, v ); + generic_16_byte(X_GLrop_Color4fv, v); } #define X_GLrop_Color4iv 17 void __indirect_glColor4i(GLint red, GLint green, GLint blue, GLint alpha) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_Color4iv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&red), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&green), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&blue), 4); - (void) memcpy((void *)(gc->pc + 16), (void *)(&alpha), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&green), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&blue), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&alpha), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Color4iv 17 void __indirect_glColor4iv(const GLint * v) { - generic_16_byte( X_GLrop_Color4iv, v ); + generic_16_byte(X_GLrop_Color4iv, v); } #define X_GLrop_Color4sv 18 void __indirect_glColor4s(GLshort red, GLshort green, GLshort blue, GLshort alpha) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_Color4sv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&red), 2); - (void) memcpy((void *)(gc->pc + 6), (void *)(&green), 2); - (void) memcpy((void *)(gc->pc + 8), (void *)(&blue), 2); - (void) memcpy((void *)(gc->pc + 10), (void *)(&alpha), 2); + (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 2); + (void) memcpy((void *) (gc->pc + 6), (void *) (&green), 2); + (void) memcpy((void *) (gc->pc + 8), (void *) (&blue), 2); + (void) memcpy((void *) (gc->pc + 10), (void *) (&alpha), 2); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Color4sv 18 void __indirect_glColor4sv(const GLshort * v) { - generic_8_byte( X_GLrop_Color4sv, v ); + generic_8_byte(X_GLrop_Color4sv, v); } #define X_GLrop_Color4ubv 19 void __indirect_glColor4ub(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_Color4ubv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&red), 1); - (void) memcpy((void *)(gc->pc + 5), (void *)(&green), 1); - (void) memcpy((void *)(gc->pc + 6), (void *)(&blue), 1); - (void) memcpy((void *)(gc->pc + 7), (void *)(&alpha), 1); + (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 1); + (void) memcpy((void *) (gc->pc + 5), (void *) (&green), 1); + (void) memcpy((void *) (gc->pc + 6), (void *) (&blue), 1); + (void) memcpy((void *) (gc->pc + 7), (void *) (&alpha), 1); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Color4ubv 19 void __indirect_glColor4ubv(const GLubyte * v) { - generic_4_byte( X_GLrop_Color4ubv, v ); + generic_4_byte(X_GLrop_Color4ubv, v); } #define X_GLrop_Color4uiv 20 void __indirect_glColor4ui(GLuint red, GLuint green, GLuint blue, GLuint alpha) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_Color4uiv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&red), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&green), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&blue), 4); - (void) memcpy((void *)(gc->pc + 16), (void *)(&alpha), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&green), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&blue), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&alpha), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Color4uiv 20 void __indirect_glColor4uiv(const GLuint * v) { - generic_16_byte( X_GLrop_Color4uiv, v ); + generic_16_byte(X_GLrop_Color4uiv, v); } #define X_GLrop_Color4usv 21 void -__indirect_glColor4us(GLushort red, GLushort green, GLushort blue, GLushort alpha) +__indirect_glColor4us(GLushort red, GLushort green, GLushort blue, + GLushort alpha) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_Color4usv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&red), 2); - (void) memcpy((void *)(gc->pc + 6), (void *)(&green), 2); - (void) memcpy((void *)(gc->pc + 8), (void *)(&blue), 2); - (void) memcpy((void *)(gc->pc + 10), (void *)(&alpha), 2); + (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 2); + (void) memcpy((void *) (gc->pc + 6), (void *) (&green), 2); + (void) memcpy((void *) (gc->pc + 8), (void *) (&blue), 2); + (void) memcpy((void *) (gc->pc + 10), (void *) (&alpha), 2); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Color4usv 21 void __indirect_glColor4usv(const GLushort * v) { - generic_8_byte( X_GLrop_Color4usv, v ); + generic_8_byte(X_GLrop_Color4usv, v); } #define X_GLrop_EdgeFlagv 22 void __indirect_glEdgeFlag(GLboolean flag) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_EdgeFlagv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&flag), 1); + (void) memcpy((void *) (gc->pc + 4), (void *) (&flag), 1); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_EdgeFlagv 22 void __indirect_glEdgeFlagv(const GLboolean * flag) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_EdgeFlagv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(flag), 1); + (void) memcpy((void *) (gc->pc + 4), (void *) (flag), 1); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_End 23 void __indirect_glEnd(void) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 4; emit_header(gc->pc, X_GLrop_End, cmdlen); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Indexdv 24 void __indirect_glIndexd(GLdouble c) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_Indexdv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&c), 8); + (void) memcpy((void *) (gc->pc + 4), (void *) (&c), 8); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Indexdv 24 void __indirect_glIndexdv(const GLdouble * c) { - generic_8_byte( X_GLrop_Indexdv, c ); + generic_8_byte(X_GLrop_Indexdv, c); } #define X_GLrop_Indexfv 25 void __indirect_glIndexf(GLfloat c) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_Indexfv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&c), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&c), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Indexfv 25 void __indirect_glIndexfv(const GLfloat * c) { - generic_4_byte( X_GLrop_Indexfv, c ); + generic_4_byte(X_GLrop_Indexfv, c); } #define X_GLrop_Indexiv 26 void __indirect_glIndexi(GLint c) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_Indexiv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&c), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&c), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Indexiv 26 void __indirect_glIndexiv(const GLint * c) { - generic_4_byte( X_GLrop_Indexiv, c ); + generic_4_byte(X_GLrop_Indexiv, c); } #define X_GLrop_Indexsv 27 void __indirect_glIndexs(GLshort c) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_Indexsv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&c), 2); + (void) memcpy((void *) (gc->pc + 4), (void *) (&c), 2); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Indexsv 27 void __indirect_glIndexsv(const GLshort * c) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_Indexsv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(c), 2); + (void) memcpy((void *) (gc->pc + 4), (void *) (c), 2); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Normal3bv 28 void __indirect_glNormal3b(GLbyte nx, GLbyte ny, GLbyte nz) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_Normal3bv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&nx), 1); - (void) memcpy((void *)(gc->pc + 5), (void *)(&ny), 1); - (void) memcpy((void *)(gc->pc + 6), (void *)(&nz), 1); + (void) memcpy((void *) (gc->pc + 4), (void *) (&nx), 1); + (void) memcpy((void *) (gc->pc + 5), (void *) (&ny), 1); + (void) memcpy((void *) (gc->pc + 6), (void *) (&nz), 1); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Normal3bv 28 void __indirect_glNormal3bv(const GLbyte * v) { - generic_3_byte( X_GLrop_Normal3bv, v ); + generic_3_byte(X_GLrop_Normal3bv, v); } #define X_GLrop_Normal3dv 29 void __indirect_glNormal3d(GLdouble nx, GLdouble ny, GLdouble nz) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 28; emit_header(gc->pc, X_GLrop_Normal3dv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&nx), 8); - (void) memcpy((void *)(gc->pc + 12), (void *)(&ny), 8); - (void) memcpy((void *)(gc->pc + 20), (void *)(&nz), 8); + (void) memcpy((void *) (gc->pc + 4), (void *) (&nx), 8); + (void) memcpy((void *) (gc->pc + 12), (void *) (&ny), 8); + (void) memcpy((void *) (gc->pc + 20), (void *) (&nz), 8); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Normal3dv 29 void __indirect_glNormal3dv(const GLdouble * v) { - generic_24_byte( X_GLrop_Normal3dv, v ); + generic_24_byte(X_GLrop_Normal3dv, v); } #define X_GLrop_Normal3fv 30 void __indirect_glNormal3f(GLfloat nx, GLfloat ny, GLfloat nz) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_Normal3fv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&nx), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&ny), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&nz), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&nx), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&ny), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&nz), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Normal3fv 30 void __indirect_glNormal3fv(const GLfloat * v) { - generic_12_byte( X_GLrop_Normal3fv, v ); + generic_12_byte(X_GLrop_Normal3fv, v); } #define X_GLrop_Normal3iv 31 void __indirect_glNormal3i(GLint nx, GLint ny, GLint nz) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_Normal3iv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&nx), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&ny), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&nz), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&nx), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&ny), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&nz), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Normal3iv 31 void __indirect_glNormal3iv(const GLint * v) { - generic_12_byte( X_GLrop_Normal3iv, v ); + generic_12_byte(X_GLrop_Normal3iv, v); } #define X_GLrop_Normal3sv 32 void __indirect_glNormal3s(GLshort nx, GLshort ny, GLshort nz) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_Normal3sv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&nx), 2); - (void) memcpy((void *)(gc->pc + 6), (void *)(&ny), 2); - (void) memcpy((void *)(gc->pc + 8), (void *)(&nz), 2); + (void) memcpy((void *) (gc->pc + 4), (void *) (&nx), 2); + (void) memcpy((void *) (gc->pc + 6), (void *) (&ny), 2); + (void) memcpy((void *) (gc->pc + 8), (void *) (&nz), 2); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Normal3sv 32 void __indirect_glNormal3sv(const GLshort * v) { - generic_6_byte( X_GLrop_Normal3sv, v ); + generic_6_byte(X_GLrop_Normal3sv, v); } #define X_GLrop_RasterPos2dv 33 void __indirect_glRasterPos2d(GLdouble x, GLdouble y) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_RasterPos2dv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&x), 8); - (void) memcpy((void *)(gc->pc + 12), (void *)(&y), 8); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 8); + (void) memcpy((void *) (gc->pc + 12), (void *) (&y), 8); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_RasterPos2dv 33 void __indirect_glRasterPos2dv(const GLdouble * v) { - generic_16_byte( X_GLrop_RasterPos2dv, v ); + generic_16_byte(X_GLrop_RasterPos2dv, v); } #define X_GLrop_RasterPos2fv 34 void __indirect_glRasterPos2f(GLfloat x, GLfloat y) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_RasterPos2fv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&x), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&y), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&y), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_RasterPos2fv 34 void __indirect_glRasterPos2fv(const GLfloat * v) { - generic_8_byte( X_GLrop_RasterPos2fv, v ); + generic_8_byte(X_GLrop_RasterPos2fv, v); } #define X_GLrop_RasterPos2iv 35 void __indirect_glRasterPos2i(GLint x, GLint y) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_RasterPos2iv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&x), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&y), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&y), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_RasterPos2iv 35 void __indirect_glRasterPos2iv(const GLint * v) { - generic_8_byte( X_GLrop_RasterPos2iv, v ); + generic_8_byte(X_GLrop_RasterPos2iv, v); } #define X_GLrop_RasterPos2sv 36 void __indirect_glRasterPos2s(GLshort x, GLshort y) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_RasterPos2sv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&x), 2); - (void) memcpy((void *)(gc->pc + 6), (void *)(&y), 2); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 2); + (void) memcpy((void *) (gc->pc + 6), (void *) (&y), 2); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_RasterPos2sv 36 void __indirect_glRasterPos2sv(const GLshort * v) { - generic_4_byte( X_GLrop_RasterPos2sv, v ); + generic_4_byte(X_GLrop_RasterPos2sv, v); } #define X_GLrop_RasterPos3dv 37 void __indirect_glRasterPos3d(GLdouble x, GLdouble y, GLdouble z) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 28; emit_header(gc->pc, X_GLrop_RasterPos3dv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&x), 8); - (void) memcpy((void *)(gc->pc + 12), (void *)(&y), 8); - (void) memcpy((void *)(gc->pc + 20), (void *)(&z), 8); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 8); + (void) memcpy((void *) (gc->pc + 12), (void *) (&y), 8); + (void) memcpy((void *) (gc->pc + 20), (void *) (&z), 8); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_RasterPos3dv 37 void __indirect_glRasterPos3dv(const GLdouble * v) { - generic_24_byte( X_GLrop_RasterPos3dv, v ); + generic_24_byte(X_GLrop_RasterPos3dv, v); } #define X_GLrop_RasterPos3fv 38 void __indirect_glRasterPos3f(GLfloat x, GLfloat y, GLfloat z) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_RasterPos3fv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&x), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&y), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&z), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&y), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&z), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_RasterPos3fv 38 void __indirect_glRasterPos3fv(const GLfloat * v) { - generic_12_byte( X_GLrop_RasterPos3fv, v ); + generic_12_byte(X_GLrop_RasterPos3fv, v); } #define X_GLrop_RasterPos3iv 39 void __indirect_glRasterPos3i(GLint x, GLint y, GLint z) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_RasterPos3iv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&x), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&y), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&z), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&y), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&z), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_RasterPos3iv 39 void __indirect_glRasterPos3iv(const GLint * v) { - generic_12_byte( X_GLrop_RasterPos3iv, v ); + generic_12_byte(X_GLrop_RasterPos3iv, v); } #define X_GLrop_RasterPos3sv 40 void __indirect_glRasterPos3s(GLshort x, GLshort y, GLshort z) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_RasterPos3sv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&x), 2); - (void) memcpy((void *)(gc->pc + 6), (void *)(&y), 2); - (void) memcpy((void *)(gc->pc + 8), (void *)(&z), 2); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 2); + (void) memcpy((void *) (gc->pc + 6), (void *) (&y), 2); + (void) memcpy((void *) (gc->pc + 8), (void *) (&z), 2); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_RasterPos3sv 40 void __indirect_glRasterPos3sv(const GLshort * v) { - generic_6_byte( X_GLrop_RasterPos3sv, v ); + generic_6_byte(X_GLrop_RasterPos3sv, v); } #define X_GLrop_RasterPos4dv 41 void __indirect_glRasterPos4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 36; emit_header(gc->pc, X_GLrop_RasterPos4dv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&x), 8); - (void) memcpy((void *)(gc->pc + 12), (void *)(&y), 8); - (void) memcpy((void *)(gc->pc + 20), (void *)(&z), 8); - (void) memcpy((void *)(gc->pc + 28), (void *)(&w), 8); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 8); + (void) memcpy((void *) (gc->pc + 12), (void *) (&y), 8); + (void) memcpy((void *) (gc->pc + 20), (void *) (&z), 8); + (void) memcpy((void *) (gc->pc + 28), (void *) (&w), 8); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_RasterPos4dv 41 void __indirect_glRasterPos4dv(const GLdouble * v) { - generic_32_byte( X_GLrop_RasterPos4dv, v ); + generic_32_byte(X_GLrop_RasterPos4dv, v); } #define X_GLrop_RasterPos4fv 42 void __indirect_glRasterPos4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_RasterPos4fv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&x), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&y), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&z), 4); - (void) memcpy((void *)(gc->pc + 16), (void *)(&w), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&y), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&z), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&w), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_RasterPos4fv 42 void __indirect_glRasterPos4fv(const GLfloat * v) { - generic_16_byte( X_GLrop_RasterPos4fv, v ); + generic_16_byte(X_GLrop_RasterPos4fv, v); } #define X_GLrop_RasterPos4iv 43 void __indirect_glRasterPos4i(GLint x, GLint y, GLint z, GLint w) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_RasterPos4iv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&x), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&y), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&z), 4); - (void) memcpy((void *)(gc->pc + 16), (void *)(&w), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&y), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&z), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&w), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_RasterPos4iv 43 void __indirect_glRasterPos4iv(const GLint * v) { - generic_16_byte( X_GLrop_RasterPos4iv, v ); + generic_16_byte(X_GLrop_RasterPos4iv, v); } #define X_GLrop_RasterPos4sv 44 void __indirect_glRasterPos4s(GLshort x, GLshort y, GLshort z, GLshort w) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_RasterPos4sv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&x), 2); - (void) memcpy((void *)(gc->pc + 6), (void *)(&y), 2); - (void) memcpy((void *)(gc->pc + 8), (void *)(&z), 2); - (void) memcpy((void *)(gc->pc + 10), (void *)(&w), 2); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 2); + (void) memcpy((void *) (gc->pc + 6), (void *) (&y), 2); + (void) memcpy((void *) (gc->pc + 8), (void *) (&z), 2); + (void) memcpy((void *) (gc->pc + 10), (void *) (&w), 2); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_RasterPos4sv 44 void __indirect_glRasterPos4sv(const GLshort * v) { - generic_8_byte( X_GLrop_RasterPos4sv, v ); + generic_8_byte(X_GLrop_RasterPos4sv, v); } #define X_GLrop_Rectdv 45 void __indirect_glRectd(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 36; emit_header(gc->pc, X_GLrop_Rectdv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&x1), 8); - (void) memcpy((void *)(gc->pc + 12), (void *)(&y1), 8); - (void) memcpy((void *)(gc->pc + 20), (void *)(&x2), 8); - (void) memcpy((void *)(gc->pc + 28), (void *)(&y2), 8); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x1), 8); + (void) memcpy((void *) (gc->pc + 12), (void *) (&y1), 8); + (void) memcpy((void *) (gc->pc + 20), (void *) (&x2), 8); + (void) memcpy((void *) (gc->pc + 28), (void *) (&y2), 8); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Rectdv 45 void __indirect_glRectdv(const GLdouble * v1, const GLdouble * v2) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 36; emit_header(gc->pc, X_GLrop_Rectdv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(v1), 16); - (void) memcpy((void *)(gc->pc + 20), (void *)(v2), 16); + (void) memcpy((void *) (gc->pc + 4), (void *) (v1), 16); + (void) memcpy((void *) (gc->pc + 20), (void *) (v2), 16); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Rectfv 46 void __indirect_glRectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_Rectfv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&x1), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&y1), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&x2), 4); - (void) memcpy((void *)(gc->pc + 16), (void *)(&y2), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x1), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&y1), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&x2), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&y2), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Rectfv 46 void __indirect_glRectfv(const GLfloat * v1, const GLfloat * v2) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_Rectfv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(v1), 8); - (void) memcpy((void *)(gc->pc + 12), (void *)(v2), 8); + (void) memcpy((void *) (gc->pc + 4), (void *) (v1), 8); + (void) memcpy((void *) (gc->pc + 12), (void *) (v2), 8); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Rectiv 47 void __indirect_glRecti(GLint x1, GLint y1, GLint x2, GLint y2) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_Rectiv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&x1), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&y1), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&x2), 4); - (void) memcpy((void *)(gc->pc + 16), (void *)(&y2), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x1), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&y1), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&x2), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&y2), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Rectiv 47 void __indirect_glRectiv(const GLint * v1, const GLint * v2) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_Rectiv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(v1), 8); - (void) memcpy((void *)(gc->pc + 12), (void *)(v2), 8); + (void) memcpy((void *) (gc->pc + 4), (void *) (v1), 8); + (void) memcpy((void *) (gc->pc + 12), (void *) (v2), 8); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Rectsv 48 void __indirect_glRects(GLshort x1, GLshort y1, GLshort x2, GLshort y2) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_Rectsv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&x1), 2); - (void) memcpy((void *)(gc->pc + 6), (void *)(&y1), 2); - (void) memcpy((void *)(gc->pc + 8), (void *)(&x2), 2); - (void) memcpy((void *)(gc->pc + 10), (void *)(&y2), 2); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x1), 2); + (void) memcpy((void *) (gc->pc + 6), (void *) (&y1), 2); + (void) memcpy((void *) (gc->pc + 8), (void *) (&x2), 2); + (void) memcpy((void *) (gc->pc + 10), (void *) (&y2), 2); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Rectsv 48 void __indirect_glRectsv(const GLshort * v1, const GLshort * v2) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_Rectsv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(v1), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(v2), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (v1), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v2), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_TexCoord1dv 49 void __indirect_glTexCoord1d(GLdouble s) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_TexCoord1dv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&s), 8); + (void) memcpy((void *) (gc->pc + 4), (void *) (&s), 8); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_TexCoord1dv 49 void __indirect_glTexCoord1dv(const GLdouble * v) { - generic_8_byte( X_GLrop_TexCoord1dv, v ); + generic_8_byte(X_GLrop_TexCoord1dv, v); } #define X_GLrop_TexCoord1fv 50 void __indirect_glTexCoord1f(GLfloat s) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_TexCoord1fv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&s), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&s), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_TexCoord1fv 50 void __indirect_glTexCoord1fv(const GLfloat * v) { - generic_4_byte( X_GLrop_TexCoord1fv, v ); + generic_4_byte(X_GLrop_TexCoord1fv, v); } #define X_GLrop_TexCoord1iv 51 void __indirect_glTexCoord1i(GLint s) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_TexCoord1iv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&s), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&s), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_TexCoord1iv 51 void __indirect_glTexCoord1iv(const GLint * v) { - generic_4_byte( X_GLrop_TexCoord1iv, v ); + generic_4_byte(X_GLrop_TexCoord1iv, v); } #define X_GLrop_TexCoord1sv 52 void __indirect_glTexCoord1s(GLshort s) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_TexCoord1sv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&s), 2); + (void) memcpy((void *) (gc->pc + 4), (void *) (&s), 2); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_TexCoord1sv 52 void __indirect_glTexCoord1sv(const GLshort * v) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_TexCoord1sv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(v), 2); + (void) memcpy((void *) (gc->pc + 4), (void *) (v), 2); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_TexCoord2dv 53 void __indirect_glTexCoord2d(GLdouble s, GLdouble t) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_TexCoord2dv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&s), 8); - (void) memcpy((void *)(gc->pc + 12), (void *)(&t), 8); + (void) memcpy((void *) (gc->pc + 4), (void *) (&s), 8); + (void) memcpy((void *) (gc->pc + 12), (void *) (&t), 8); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_TexCoord2dv 53 void __indirect_glTexCoord2dv(const GLdouble * v) { - generic_16_byte( X_GLrop_TexCoord2dv, v ); + generic_16_byte(X_GLrop_TexCoord2dv, v); } #define X_GLrop_TexCoord2fv 54 void __indirect_glTexCoord2f(GLfloat s, GLfloat t) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_TexCoord2fv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&s), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&t), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&s), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&t), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_TexCoord2fv 54 void __indirect_glTexCoord2fv(const GLfloat * v) { - generic_8_byte( X_GLrop_TexCoord2fv, v ); + generic_8_byte(X_GLrop_TexCoord2fv, v); } #define X_GLrop_TexCoord2iv 55 void __indirect_glTexCoord2i(GLint s, GLint t) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_TexCoord2iv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&s), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&t), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&s), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&t), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_TexCoord2iv 55 void __indirect_glTexCoord2iv(const GLint * v) { - generic_8_byte( X_GLrop_TexCoord2iv, v ); + generic_8_byte(X_GLrop_TexCoord2iv, v); } #define X_GLrop_TexCoord2sv 56 void __indirect_glTexCoord2s(GLshort s, GLshort t) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_TexCoord2sv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&s), 2); - (void) memcpy((void *)(gc->pc + 6), (void *)(&t), 2); + (void) memcpy((void *) (gc->pc + 4), (void *) (&s), 2); + (void) memcpy((void *) (gc->pc + 6), (void *) (&t), 2); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_TexCoord2sv 56 void __indirect_glTexCoord2sv(const GLshort * v) { - generic_4_byte( X_GLrop_TexCoord2sv, v ); + generic_4_byte(X_GLrop_TexCoord2sv, v); } #define X_GLrop_TexCoord3dv 57 void __indirect_glTexCoord3d(GLdouble s, GLdouble t, GLdouble r) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 28; emit_header(gc->pc, X_GLrop_TexCoord3dv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&s), 8); - (void) memcpy((void *)(gc->pc + 12), (void *)(&t), 8); - (void) memcpy((void *)(gc->pc + 20), (void *)(&r), 8); + (void) memcpy((void *) (gc->pc + 4), (void *) (&s), 8); + (void) memcpy((void *) (gc->pc + 12), (void *) (&t), 8); + (void) memcpy((void *) (gc->pc + 20), (void *) (&r), 8); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_TexCoord3dv 57 void __indirect_glTexCoord3dv(const GLdouble * v) { - generic_24_byte( X_GLrop_TexCoord3dv, v ); + generic_24_byte(X_GLrop_TexCoord3dv, v); } #define X_GLrop_TexCoord3fv 58 void __indirect_glTexCoord3f(GLfloat s, GLfloat t, GLfloat r) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_TexCoord3fv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&s), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&t), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&r), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&s), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&t), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&r), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_TexCoord3fv 58 void __indirect_glTexCoord3fv(const GLfloat * v) { - generic_12_byte( X_GLrop_TexCoord3fv, v ); + generic_12_byte(X_GLrop_TexCoord3fv, v); } #define X_GLrop_TexCoord3iv 59 void __indirect_glTexCoord3i(GLint s, GLint t, GLint r) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_TexCoord3iv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&s), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&t), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&r), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&s), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&t), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&r), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_TexCoord3iv 59 void __indirect_glTexCoord3iv(const GLint * v) { - generic_12_byte( X_GLrop_TexCoord3iv, v ); + generic_12_byte(X_GLrop_TexCoord3iv, v); } #define X_GLrop_TexCoord3sv 60 void __indirect_glTexCoord3s(GLshort s, GLshort t, GLshort r) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_TexCoord3sv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&s), 2); - (void) memcpy((void *)(gc->pc + 6), (void *)(&t), 2); - (void) memcpy((void *)(gc->pc + 8), (void *)(&r), 2); + (void) memcpy((void *) (gc->pc + 4), (void *) (&s), 2); + (void) memcpy((void *) (gc->pc + 6), (void *) (&t), 2); + (void) memcpy((void *) (gc->pc + 8), (void *) (&r), 2); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_TexCoord3sv 60 void __indirect_glTexCoord3sv(const GLshort * v) { - generic_6_byte( X_GLrop_TexCoord3sv, v ); + generic_6_byte(X_GLrop_TexCoord3sv, v); } #define X_GLrop_TexCoord4dv 61 void __indirect_glTexCoord4d(GLdouble s, GLdouble t, GLdouble r, GLdouble q) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 36; emit_header(gc->pc, X_GLrop_TexCoord4dv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&s), 8); - (void) memcpy((void *)(gc->pc + 12), (void *)(&t), 8); - (void) memcpy((void *)(gc->pc + 20), (void *)(&r), 8); - (void) memcpy((void *)(gc->pc + 28), (void *)(&q), 8); + (void) memcpy((void *) (gc->pc + 4), (void *) (&s), 8); + (void) memcpy((void *) (gc->pc + 12), (void *) (&t), 8); + (void) memcpy((void *) (gc->pc + 20), (void *) (&r), 8); + (void) memcpy((void *) (gc->pc + 28), (void *) (&q), 8); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_TexCoord4dv 61 void __indirect_glTexCoord4dv(const GLdouble * v) { - generic_32_byte( X_GLrop_TexCoord4dv, v ); + generic_32_byte(X_GLrop_TexCoord4dv, v); } #define X_GLrop_TexCoord4fv 62 void __indirect_glTexCoord4f(GLfloat s, GLfloat t, GLfloat r, GLfloat q) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_TexCoord4fv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&s), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&t), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&r), 4); - (void) memcpy((void *)(gc->pc + 16), (void *)(&q), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&s), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&t), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&r), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&q), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_TexCoord4fv 62 void __indirect_glTexCoord4fv(const GLfloat * v) { - generic_16_byte( X_GLrop_TexCoord4fv, v ); + generic_16_byte(X_GLrop_TexCoord4fv, v); } #define X_GLrop_TexCoord4iv 63 void __indirect_glTexCoord4i(GLint s, GLint t, GLint r, GLint q) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_TexCoord4iv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&s), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&t), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&r), 4); - (void) memcpy((void *)(gc->pc + 16), (void *)(&q), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&s), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&t), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&r), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&q), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_TexCoord4iv 63 void __indirect_glTexCoord4iv(const GLint * v) { - generic_16_byte( X_GLrop_TexCoord4iv, v ); + generic_16_byte(X_GLrop_TexCoord4iv, v); } #define X_GLrop_TexCoord4sv 64 void __indirect_glTexCoord4s(GLshort s, GLshort t, GLshort r, GLshort q) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_TexCoord4sv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&s), 2); - (void) memcpy((void *)(gc->pc + 6), (void *)(&t), 2); - (void) memcpy((void *)(gc->pc + 8), (void *)(&r), 2); - (void) memcpy((void *)(gc->pc + 10), (void *)(&q), 2); + (void) memcpy((void *) (gc->pc + 4), (void *) (&s), 2); + (void) memcpy((void *) (gc->pc + 6), (void *) (&t), 2); + (void) memcpy((void *) (gc->pc + 8), (void *) (&r), 2); + (void) memcpy((void *) (gc->pc + 10), (void *) (&q), 2); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_TexCoord4sv 64 void __indirect_glTexCoord4sv(const GLshort * v) { - generic_8_byte( X_GLrop_TexCoord4sv, v ); + generic_8_byte(X_GLrop_TexCoord4sv, v); } #define X_GLrop_Vertex2dv 65 void __indirect_glVertex2d(GLdouble x, GLdouble y) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_Vertex2dv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&x), 8); - (void) memcpy((void *)(gc->pc + 12), (void *)(&y), 8); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 8); + (void) memcpy((void *) (gc->pc + 12), (void *) (&y), 8); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Vertex2dv 65 void __indirect_glVertex2dv(const GLdouble * v) { - generic_16_byte( X_GLrop_Vertex2dv, v ); + generic_16_byte(X_GLrop_Vertex2dv, v); } #define X_GLrop_Vertex2fv 66 void __indirect_glVertex2f(GLfloat x, GLfloat y) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_Vertex2fv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&x), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&y), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&y), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Vertex2fv 66 void __indirect_glVertex2fv(const GLfloat * v) { - generic_8_byte( X_GLrop_Vertex2fv, v ); + generic_8_byte(X_GLrop_Vertex2fv, v); } #define X_GLrop_Vertex2iv 67 void __indirect_glVertex2i(GLint x, GLint y) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_Vertex2iv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&x), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&y), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&y), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Vertex2iv 67 void __indirect_glVertex2iv(const GLint * v) { - generic_8_byte( X_GLrop_Vertex2iv, v ); + generic_8_byte(X_GLrop_Vertex2iv, v); } #define X_GLrop_Vertex2sv 68 void __indirect_glVertex2s(GLshort x, GLshort y) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_Vertex2sv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&x), 2); - (void) memcpy((void *)(gc->pc + 6), (void *)(&y), 2); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 2); + (void) memcpy((void *) (gc->pc + 6), (void *) (&y), 2); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Vertex2sv 68 void __indirect_glVertex2sv(const GLshort * v) { - generic_4_byte( X_GLrop_Vertex2sv, v ); + generic_4_byte(X_GLrop_Vertex2sv, v); } #define X_GLrop_Vertex3dv 69 void __indirect_glVertex3d(GLdouble x, GLdouble y, GLdouble z) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 28; emit_header(gc->pc, X_GLrop_Vertex3dv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&x), 8); - (void) memcpy((void *)(gc->pc + 12), (void *)(&y), 8); - (void) memcpy((void *)(gc->pc + 20), (void *)(&z), 8); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 8); + (void) memcpy((void *) (gc->pc + 12), (void *) (&y), 8); + (void) memcpy((void *) (gc->pc + 20), (void *) (&z), 8); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Vertex3dv 69 void __indirect_glVertex3dv(const GLdouble * v) { - generic_24_byte( X_GLrop_Vertex3dv, v ); + generic_24_byte(X_GLrop_Vertex3dv, v); } #define X_GLrop_Vertex3fv 70 void __indirect_glVertex3f(GLfloat x, GLfloat y, GLfloat z) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_Vertex3fv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&x), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&y), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&z), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&y), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&z), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Vertex3fv 70 void __indirect_glVertex3fv(const GLfloat * v) { - generic_12_byte( X_GLrop_Vertex3fv, v ); + generic_12_byte(X_GLrop_Vertex3fv, v); } #define X_GLrop_Vertex3iv 71 void __indirect_glVertex3i(GLint x, GLint y, GLint z) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_Vertex3iv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&x), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&y), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&z), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&y), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&z), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Vertex3iv 71 void __indirect_glVertex3iv(const GLint * v) { - generic_12_byte( X_GLrop_Vertex3iv, v ); + generic_12_byte(X_GLrop_Vertex3iv, v); } #define X_GLrop_Vertex3sv 72 void __indirect_glVertex3s(GLshort x, GLshort y, GLshort z) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_Vertex3sv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&x), 2); - (void) memcpy((void *)(gc->pc + 6), (void *)(&y), 2); - (void) memcpy((void *)(gc->pc + 8), (void *)(&z), 2); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 2); + (void) memcpy((void *) (gc->pc + 6), (void *) (&y), 2); + (void) memcpy((void *) (gc->pc + 8), (void *) (&z), 2); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Vertex3sv 72 void __indirect_glVertex3sv(const GLshort * v) { - generic_6_byte( X_GLrop_Vertex3sv, v ); + generic_6_byte(X_GLrop_Vertex3sv, v); } #define X_GLrop_Vertex4dv 73 void __indirect_glVertex4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 36; emit_header(gc->pc, X_GLrop_Vertex4dv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&x), 8); - (void) memcpy((void *)(gc->pc + 12), (void *)(&y), 8); - (void) memcpy((void *)(gc->pc + 20), (void *)(&z), 8); - (void) memcpy((void *)(gc->pc + 28), (void *)(&w), 8); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 8); + (void) memcpy((void *) (gc->pc + 12), (void *) (&y), 8); + (void) memcpy((void *) (gc->pc + 20), (void *) (&z), 8); + (void) memcpy((void *) (gc->pc + 28), (void *) (&w), 8); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Vertex4dv 73 void __indirect_glVertex4dv(const GLdouble * v) { - generic_32_byte( X_GLrop_Vertex4dv, v ); + generic_32_byte(X_GLrop_Vertex4dv, v); } #define X_GLrop_Vertex4fv 74 void __indirect_glVertex4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_Vertex4fv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&x), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&y), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&z), 4); - (void) memcpy((void *)(gc->pc + 16), (void *)(&w), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&y), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&z), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&w), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Vertex4fv 74 void __indirect_glVertex4fv(const GLfloat * v) { - generic_16_byte( X_GLrop_Vertex4fv, v ); + generic_16_byte(X_GLrop_Vertex4fv, v); } #define X_GLrop_Vertex4iv 75 void __indirect_glVertex4i(GLint x, GLint y, GLint z, GLint w) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_Vertex4iv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&x), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&y), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&z), 4); - (void) memcpy((void *)(gc->pc + 16), (void *)(&w), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&y), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&z), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&w), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Vertex4iv 75 void __indirect_glVertex4iv(const GLint * v) { - generic_16_byte( X_GLrop_Vertex4iv, v ); + generic_16_byte(X_GLrop_Vertex4iv, v); } #define X_GLrop_Vertex4sv 76 void __indirect_glVertex4s(GLshort x, GLshort y, GLshort z, GLshort w) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_Vertex4sv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&x), 2); - (void) memcpy((void *)(gc->pc + 6), (void *)(&y), 2); - (void) memcpy((void *)(gc->pc + 8), (void *)(&z), 2); - (void) memcpy((void *)(gc->pc + 10), (void *)(&w), 2); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 2); + (void) memcpy((void *) (gc->pc + 6), (void *) (&y), 2); + (void) memcpy((void *) (gc->pc + 8), (void *) (&z), 2); + (void) memcpy((void *) (gc->pc + 10), (void *) (&w), 2); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Vertex4sv 76 void __indirect_glVertex4sv(const GLshort * v) { - generic_8_byte( X_GLrop_Vertex4sv, v ); + generic_8_byte(X_GLrop_Vertex4sv, v); } #define X_GLrop_ClipPlane 77 void __indirect_glClipPlane(GLenum plane, const GLdouble * equation) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 40; emit_header(gc->pc, X_GLrop_ClipPlane, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(equation), 32); - (void) memcpy((void *)(gc->pc + 36), (void *)(&plane), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (equation), 32); + (void) memcpy((void *) (gc->pc + 36), (void *) (&plane), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_ColorMaterial 78 void __indirect_glColorMaterial(GLenum face, GLenum mode) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_ColorMaterial, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&face), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&mode), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&face), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&mode), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_CullFace 79 void __indirect_glCullFace(GLenum mode) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_CullFace, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&mode), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&mode), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Fogf 80 void __indirect_glFogf(GLenum pname, GLfloat param) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_Fogf, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&pname), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(¶m), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (¶m), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Fogfv 81 void __indirect_glFogfv(GLenum pname, const GLfloat * params) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint compsize = __glFogfv_size(pname); const GLuint cmdlen = 8 + __GLX_PAD((compsize * 4)); emit_header(gc->pc, X_GLrop_Fogfv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&pname), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(params), (compsize * 4)); + (void) memcpy((void *) (gc->pc + 4), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (params), (compsize * 4)); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Fogi 82 void __indirect_glFogi(GLenum pname, GLint param) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_Fogi, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&pname), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(¶m), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (¶m), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Fogiv 83 void __indirect_glFogiv(GLenum pname, const GLint * params) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint compsize = __glFogiv_size(pname); const GLuint cmdlen = 8 + __GLX_PAD((compsize * 4)); emit_header(gc->pc, X_GLrop_Fogiv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&pname), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(params), (compsize * 4)); + (void) memcpy((void *) (gc->pc + 4), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (params), (compsize * 4)); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_FrontFace 84 void __indirect_glFrontFace(GLenum mode) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_FrontFace, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&mode), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&mode), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Hint 85 void __indirect_glHint(GLenum target, GLenum mode) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_Hint, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&mode), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&mode), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Lightf 86 void __indirect_glLightf(GLenum light, GLenum pname, GLfloat param) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_Lightf, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&light), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(¶m), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&light), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (¶m), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Lightfv 87 void __indirect_glLightfv(GLenum light, GLenum pname, const GLfloat * params) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint compsize = __glLightfv_size(pname); const GLuint cmdlen = 12 + __GLX_PAD((compsize * 4)); emit_header(gc->pc, X_GLrop_Lightfv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&light), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(params), (compsize * 4)); + (void) memcpy((void *) (gc->pc + 4), (void *) (&light), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (params), (compsize * 4)); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Lighti 88 void __indirect_glLighti(GLenum light, GLenum pname, GLint param) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_Lighti, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&light), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(¶m), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&light), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (¶m), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Lightiv 89 void __indirect_glLightiv(GLenum light, GLenum pname, const GLint * params) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint compsize = __glLightiv_size(pname); const GLuint cmdlen = 12 + __GLX_PAD((compsize * 4)); emit_header(gc->pc, X_GLrop_Lightiv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&light), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(params), (compsize * 4)); + (void) memcpy((void *) (gc->pc + 4), (void *) (&light), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (params), (compsize * 4)); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_LightModelf 90 void __indirect_glLightModelf(GLenum pname, GLfloat param) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_LightModelf, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&pname), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(¶m), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (¶m), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_LightModelfv 91 void __indirect_glLightModelfv(GLenum pname, const GLfloat * params) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint compsize = __glLightModelfv_size(pname); const GLuint cmdlen = 8 + __GLX_PAD((compsize * 4)); emit_header(gc->pc, X_GLrop_LightModelfv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&pname), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(params), (compsize * 4)); + (void) memcpy((void *) (gc->pc + 4), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (params), (compsize * 4)); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_LightModeli 92 void __indirect_glLightModeli(GLenum pname, GLint param) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_LightModeli, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&pname), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(¶m), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (¶m), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_LightModeliv 93 void __indirect_glLightModeliv(GLenum pname, const GLint * params) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint compsize = __glLightModeliv_size(pname); const GLuint cmdlen = 8 + __GLX_PAD((compsize * 4)); emit_header(gc->pc, X_GLrop_LightModeliv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&pname), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(params), (compsize * 4)); + (void) memcpy((void *) (gc->pc + 4), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (params), (compsize * 4)); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_LineStipple 94 void __indirect_glLineStipple(GLint factor, GLushort pattern) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_LineStipple, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&factor), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&pattern), 2); + (void) memcpy((void *) (gc->pc + 4), (void *) (&factor), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&pattern), 2); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_LineWidth 95 void __indirect_glLineWidth(GLfloat width) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_LineWidth, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&width), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&width), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Materialf 96 void __indirect_glMaterialf(GLenum face, GLenum pname, GLfloat param) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_Materialf, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&face), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(¶m), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&face), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (¶m), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Materialfv 97 void __indirect_glMaterialfv(GLenum face, GLenum pname, const GLfloat * params) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint compsize = __glMaterialfv_size(pname); const GLuint cmdlen = 12 + __GLX_PAD((compsize * 4)); emit_header(gc->pc, X_GLrop_Materialfv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&face), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(params), (compsize * 4)); + (void) memcpy((void *) (gc->pc + 4), (void *) (&face), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (params), (compsize * 4)); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Materiali 98 void __indirect_glMateriali(GLenum face, GLenum pname, GLint param) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_Materiali, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&face), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(¶m), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&face), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (¶m), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Materialiv 99 void __indirect_glMaterialiv(GLenum face, GLenum pname, const GLint * params) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint compsize = __glMaterialiv_size(pname); const GLuint cmdlen = 12 + __GLX_PAD((compsize * 4)); emit_header(gc->pc, X_GLrop_Materialiv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&face), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(params), (compsize * 4)); + (void) memcpy((void *) (gc->pc + 4), (void *) (&face), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (params), (compsize * 4)); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_PointSize 100 void __indirect_glPointSize(GLfloat size) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_PointSize, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&size), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&size), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_PolygonMode 101 void __indirect_glPolygonMode(GLenum face, GLenum mode) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_PolygonMode, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&face), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&mode), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&face), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&mode), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_PolygonStipple 102 void __indirect_glPolygonStipple(const GLubyte * mask) { - __GLXcontext * const gc = __glXGetCurrentContext(); - const GLuint compsize = (mask != NULL) ? __glImageSize(32, 32, 1, GL_COLOR_INDEX, GL_BITMAP, 0) : 0; + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint compsize = + (mask != NULL) ? __glImageSize(32, 32, 1, GL_COLOR_INDEX, GL_BITMAP, + 0) : 0; const GLuint cmdlen = 24 + __GLX_PAD(compsize); emit_header(gc->pc, X_GLrop_PolygonStipple, cmdlen); if (compsize > 0) { - (*gc->fillImage)(gc, 2, 32, 32, 1, GL_COLOR_INDEX, GL_BITMAP, mask, gc->pc + 24, gc->pc + 4); - } - else { - (void) memcpy( gc->pc + 4, default_pixel_store_2D, default_pixel_store_2D_size ); + (*gc->fillImage) (gc, 2, 32, 32, 1, GL_COLOR_INDEX, GL_BITMAP, mask, + gc->pc + 24, gc->pc + 4); + } else { + (void) memcpy(gc->pc + 4, default_pixel_store_2D, + default_pixel_store_2D_size); } gc->pc += cmdlen; - if (gc->pc > gc->limit) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (gc->pc > gc->limit) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Scissor 103 void __indirect_glScissor(GLint x, GLint y, GLsizei width, GLsizei height) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_Scissor, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&x), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&y), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&width), 4); - (void) memcpy((void *)(gc->pc + 16), (void *)(&height), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&y), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&width), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&height), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_ShadeModel 104 void __indirect_glShadeModel(GLenum mode) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_ShadeModel, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&mode), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&mode), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_TexParameterf 105 void __indirect_glTexParameterf(GLenum target, GLenum pname, GLfloat param) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_TexParameterf, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(¶m), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (¶m), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_TexParameterfv 106 void -__indirect_glTexParameterfv(GLenum target, GLenum pname, const GLfloat * params) +__indirect_glTexParameterfv(GLenum target, GLenum pname, + const GLfloat * params) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint compsize = __glTexParameterfv_size(pname); const GLuint cmdlen = 12 + __GLX_PAD((compsize * 4)); emit_header(gc->pc, X_GLrop_TexParameterfv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(params), (compsize * 4)); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (params), (compsize * 4)); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_TexParameteri 107 void __indirect_glTexParameteri(GLenum target, GLenum pname, GLint param) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_TexParameteri, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(¶m), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (¶m), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_TexParameteriv 108 void __indirect_glTexParameteriv(GLenum target, GLenum pname, const GLint * params) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint compsize = __glTexParameteriv_size(pname); const GLuint cmdlen = 12 + __GLX_PAD((compsize * 4)); emit_header(gc->pc, X_GLrop_TexParameteriv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(params), (compsize * 4)); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (params), (compsize * 4)); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } -} + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} static void -__glx_TexImage_1D2D( unsigned opcode, unsigned dim, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid * pixels ) -{ - __GLXcontext * const gc = __glXGetCurrentContext(); - const GLuint compsize = __glImageSize(width, height, 1, format, type, target); +__glx_TexImage_1D2D(unsigned opcode, unsigned dim, GLenum target, GLint level, + GLint internalformat, GLsizei width, GLsizei height, + GLint border, GLenum format, GLenum type, + const GLvoid * pixels) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint compsize = + __glImageSize(width, height, 1, format, type, target); const GLuint cmdlen = 56 + __GLX_PAD(compsize); if (__builtin_expect(gc->currentDpy != NULL, 1)) { if (cmdlen <= gc->maxSmallRenderCommandSize) { - if ( (gc->pc + cmdlen) > gc->bufEnd ) { + if ((gc->pc + cmdlen) > gc->bufEnd) { (void) __glXFlushRenderBuffer(gc, gc->pc); } emit_header(gc->pc, opcode, cmdlen); - (void) memcpy((void *)(gc->pc + 24), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 28), (void *)(&level), 4); - (void) memcpy((void *)(gc->pc + 32), (void *)(&internalformat), 4); - (void) memcpy((void *)(gc->pc + 36), (void *)(&width), 4); - (void) memcpy((void *)(gc->pc + 40), (void *)(&height), 4); - (void) memcpy((void *)(gc->pc + 44), (void *)(&border), 4); - (void) memcpy((void *)(gc->pc + 48), (void *)(&format), 4); - (void) memcpy((void *)(gc->pc + 52), (void *)(&type), 4); + (void) memcpy((void *) (gc->pc + 24), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 28), (void *) (&level), 4); + (void) memcpy((void *) (gc->pc + 32), (void *) (&internalformat), + 4); + (void) memcpy((void *) (gc->pc + 36), (void *) (&width), 4); + (void) memcpy((void *) (gc->pc + 40), (void *) (&height), 4); + (void) memcpy((void *) (gc->pc + 44), (void *) (&border), 4); + (void) memcpy((void *) (gc->pc + 48), (void *) (&format), 4); + (void) memcpy((void *) (gc->pc + 52), (void *) (&type), 4); if ((compsize > 0) && (pixels != NULL)) { - (*gc->fillImage)(gc, dim, width, height, 1, format, type, pixels, gc->pc + 56, gc->pc + 4); - } - else { - (void) memcpy( gc->pc + 4, default_pixel_store_2D, default_pixel_store_2D_size ); + (*gc->fillImage) (gc, dim, width, height, 1, format, type, + pixels, gc->pc + 56, gc->pc + 4); + } else { + (void) memcpy(gc->pc + 4, default_pixel_store_2D, + default_pixel_store_2D_size); } gc->pc += cmdlen; - if (gc->pc > gc->limit) { (void) __glXFlushRenderBuffer(gc, gc->pc); } - } - else { + if (gc->pc > gc->limit) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + } else { const GLint op = opcode; const GLuint cmdlenLarge = cmdlen + 4; - GLubyte * const pc = __glXFlushRenderBuffer(gc, gc->pc); - (void) memcpy((void *)(pc + 0), (void *)(&cmdlenLarge), 4); - (void) memcpy((void *)(pc + 4), (void *)(&op), 4); - (void) memcpy((void *)(pc + 28), (void *)(&target), 4); - (void) memcpy((void *)(pc + 32), (void *)(&level), 4); - (void) memcpy((void *)(pc + 36), (void *)(&internalformat), 4); - (void) memcpy((void *)(pc + 40), (void *)(&width), 4); - (void) memcpy((void *)(pc + 44), (void *)(&height), 4); - (void) memcpy((void *)(pc + 48), (void *)(&border), 4); - (void) memcpy((void *)(pc + 52), (void *)(&format), 4); - (void) memcpy((void *)(pc + 56), (void *)(&type), 4); - __glXSendLargeImage(gc, compsize, dim, width, height, 1, format, type, pixels, pc + 60, pc + 8); + GLubyte *const pc = __glXFlushRenderBuffer(gc, gc->pc); + (void) memcpy((void *) (pc + 0), (void *) (&cmdlenLarge), 4); + (void) memcpy((void *) (pc + 4), (void *) (&op), 4); + (void) memcpy((void *) (pc + 28), (void *) (&target), 4); + (void) memcpy((void *) (pc + 32), (void *) (&level), 4); + (void) memcpy((void *) (pc + 36), (void *) (&internalformat), 4); + (void) memcpy((void *) (pc + 40), (void *) (&width), 4); + (void) memcpy((void *) (pc + 44), (void *) (&height), 4); + (void) memcpy((void *) (pc + 48), (void *) (&border), 4); + (void) memcpy((void *) (pc + 52), (void *) (&format), 4); + (void) memcpy((void *) (pc + 56), (void *) (&type), 4); + __glXSendLargeImage(gc, compsize, dim, width, height, 1, format, + type, pixels, pc + 60, pc + 8); } } } #define X_GLrop_TexImage1D 109 void -__indirect_glTexImage1D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid * pixels) +__indirect_glTexImage1D(GLenum target, GLint level, GLint internalformat, + GLsizei width, GLint border, GLenum format, + GLenum type, const GLvoid * pixels) { - __glx_TexImage_1D2D(X_GLrop_TexImage1D, 1, target, level, internalformat, width, 1, border, format, type, pixels ); + __glx_TexImage_1D2D(X_GLrop_TexImage1D, 1, target, level, internalformat, + width, 1, border, format, type, pixels); } #define X_GLrop_TexImage2D 110 void -__indirect_glTexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid * pixels) +__indirect_glTexImage2D(GLenum target, GLint level, GLint internalformat, + GLsizei width, GLsizei height, GLint border, + GLenum format, GLenum type, const GLvoid * pixels) { - __glx_TexImage_1D2D(X_GLrop_TexImage2D, 2, target, level, internalformat, width, height, border, format, type, pixels ); + __glx_TexImage_1D2D(X_GLrop_TexImage2D, 2, target, level, internalformat, + width, height, border, format, type, pixels); } #define X_GLrop_TexEnvf 111 void __indirect_glTexEnvf(GLenum target, GLenum pname, GLfloat param) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_TexEnvf, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(¶m), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (¶m), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_TexEnvfv 112 void __indirect_glTexEnvfv(GLenum target, GLenum pname, const GLfloat * params) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint compsize = __glTexEnvfv_size(pname); const GLuint cmdlen = 12 + __GLX_PAD((compsize * 4)); emit_header(gc->pc, X_GLrop_TexEnvfv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(params), (compsize * 4)); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (params), (compsize * 4)); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_TexEnvi 113 void __indirect_glTexEnvi(GLenum target, GLenum pname, GLint param) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_TexEnvi, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(¶m), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (¶m), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_TexEnviv 114 void __indirect_glTexEnviv(GLenum target, GLenum pname, const GLint * params) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint compsize = __glTexEnviv_size(pname); const GLuint cmdlen = 12 + __GLX_PAD((compsize * 4)); emit_header(gc->pc, X_GLrop_TexEnviv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(params), (compsize * 4)); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (params), (compsize * 4)); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_TexGend 115 void __indirect_glTexGend(GLenum coord, GLenum pname, GLdouble param) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_TexGend, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(¶m), 8); - (void) memcpy((void *)(gc->pc + 12), (void *)(&coord), 4); - (void) memcpy((void *)(gc->pc + 16), (void *)(&pname), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (¶m), 8); + (void) memcpy((void *) (gc->pc + 12), (void *) (&coord), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&pname), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_TexGendv 116 void __indirect_glTexGendv(GLenum coord, GLenum pname, const GLdouble * params) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint compsize = __glTexGendv_size(pname); const GLuint cmdlen = 12 + __GLX_PAD((compsize * 8)); emit_header(gc->pc, X_GLrop_TexGendv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&coord), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(params), (compsize * 8)); + (void) memcpy((void *) (gc->pc + 4), (void *) (&coord), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (params), (compsize * 8)); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_TexGenf 117 void __indirect_glTexGenf(GLenum coord, GLenum pname, GLfloat param) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_TexGenf, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&coord), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(¶m), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&coord), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (¶m), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_TexGenfv 118 void __indirect_glTexGenfv(GLenum coord, GLenum pname, const GLfloat * params) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint compsize = __glTexGenfv_size(pname); const GLuint cmdlen = 12 + __GLX_PAD((compsize * 4)); emit_header(gc->pc, X_GLrop_TexGenfv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&coord), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(params), (compsize * 4)); + (void) memcpy((void *) (gc->pc + 4), (void *) (&coord), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (params), (compsize * 4)); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_TexGeni 119 void __indirect_glTexGeni(GLenum coord, GLenum pname, GLint param) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_TexGeni, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&coord), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(¶m), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&coord), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (¶m), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_TexGeniv 120 void __indirect_glTexGeniv(GLenum coord, GLenum pname, const GLint * params) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint compsize = __glTexGeniv_size(pname); const GLuint cmdlen = 12 + __GLX_PAD((compsize * 4)); emit_header(gc->pc, X_GLrop_TexGeniv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&coord), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(params), (compsize * 4)); + (void) memcpy((void *) (gc->pc + 4), (void *) (&coord), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (params), (compsize * 4)); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_InitNames 121 void __indirect_glInitNames(void) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 4; emit_header(gc->pc, X_GLrop_InitNames, cmdlen); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_LoadName 122 void __indirect_glLoadName(GLuint name) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_LoadName, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&name), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&name), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_PassThrough 123 void __indirect_glPassThrough(GLfloat token) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_PassThrough, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&token), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&token), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_PopName 124 void __indirect_glPopName(void) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 4; emit_header(gc->pc, X_GLrop_PopName, cmdlen); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_PushName 125 void __indirect_glPushName(GLuint name) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_PushName, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&name), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&name), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_DrawBuffer 126 void __indirect_glDrawBuffer(GLenum mode) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_DrawBuffer, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&mode), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&mode), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Clear 127 void __indirect_glClear(GLbitfield mask) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_Clear, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&mask), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&mask), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_ClearAccum 128 void -__indirect_glClearAccum(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) +__indirect_glClearAccum(GLfloat red, GLfloat green, GLfloat blue, + GLfloat alpha) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_ClearAccum, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&red), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&green), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&blue), 4); - (void) memcpy((void *)(gc->pc + 16), (void *)(&alpha), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&green), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&blue), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&alpha), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_ClearIndex 129 void __indirect_glClearIndex(GLfloat c) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_ClearIndex, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&c), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&c), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_ClearColor 130 void -__indirect_glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) +__indirect_glClearColor(GLclampf red, GLclampf green, GLclampf blue, + GLclampf alpha) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_ClearColor, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&red), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&green), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&blue), 4); - (void) memcpy((void *)(gc->pc + 16), (void *)(&alpha), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&green), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&blue), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&alpha), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_ClearStencil 131 void __indirect_glClearStencil(GLint s) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_ClearStencil, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&s), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&s), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_ClearDepth 132 void __indirect_glClearDepth(GLclampd depth) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_ClearDepth, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&depth), 8); + (void) memcpy((void *) (gc->pc + 4), (void *) (&depth), 8); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_StencilMask 133 void __indirect_glStencilMask(GLuint mask) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_StencilMask, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&mask), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&mask), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_ColorMask 134 void -__indirect_glColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha) +__indirect_glColorMask(GLboolean red, GLboolean green, GLboolean blue, + GLboolean alpha) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_ColorMask, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&red), 1); - (void) memcpy((void *)(gc->pc + 5), (void *)(&green), 1); - (void) memcpy((void *)(gc->pc + 6), (void *)(&blue), 1); - (void) memcpy((void *)(gc->pc + 7), (void *)(&alpha), 1); + (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 1); + (void) memcpy((void *) (gc->pc + 5), (void *) (&green), 1); + (void) memcpy((void *) (gc->pc + 6), (void *) (&blue), 1); + (void) memcpy((void *) (gc->pc + 7), (void *) (&alpha), 1); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_DepthMask 135 void __indirect_glDepthMask(GLboolean flag) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_DepthMask, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&flag), 1); + (void) memcpy((void *) (gc->pc + 4), (void *) (&flag), 1); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_IndexMask 136 void __indirect_glIndexMask(GLuint mask) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_IndexMask, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&mask), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&mask), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Accum 137 void __indirect_glAccum(GLenum op, GLfloat value) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_Accum, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&op), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&value), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&op), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&value), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_PopAttrib 141 void __indirect_glPopAttrib(void) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 4; emit_header(gc->pc, X_GLrop_PopAttrib, cmdlen); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_PushAttrib 142 void __indirect_glPushAttrib(GLbitfield mask) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_PushAttrib, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&mask), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&mask), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_MapGrid1d 147 void __indirect_glMapGrid1d(GLint un, GLdouble u1, GLdouble u2) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 24; emit_header(gc->pc, X_GLrop_MapGrid1d, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&u1), 8); - (void) memcpy((void *)(gc->pc + 12), (void *)(&u2), 8); - (void) memcpy((void *)(gc->pc + 20), (void *)(&un), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&u1), 8); + (void) memcpy((void *) (gc->pc + 12), (void *) (&u2), 8); + (void) memcpy((void *) (gc->pc + 20), (void *) (&un), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_MapGrid1f 148 void __indirect_glMapGrid1f(GLint un, GLfloat u1, GLfloat u2) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_MapGrid1f, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&un), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&u1), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&u2), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&un), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&u1), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&u2), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_MapGrid2d 149 void -__indirect_glMapGrid2d(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2) +__indirect_glMapGrid2d(GLint un, GLdouble u1, GLdouble u2, GLint vn, + GLdouble v1, GLdouble v2) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 44; emit_header(gc->pc, X_GLrop_MapGrid2d, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&u1), 8); - (void) memcpy((void *)(gc->pc + 12), (void *)(&u2), 8); - (void) memcpy((void *)(gc->pc + 20), (void *)(&v1), 8); - (void) memcpy((void *)(gc->pc + 28), (void *)(&v2), 8); - (void) memcpy((void *)(gc->pc + 36), (void *)(&un), 4); - (void) memcpy((void *)(gc->pc + 40), (void *)(&vn), 4); - gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + (void) memcpy((void *) (gc->pc + 4), (void *) (&u1), 8); + (void) memcpy((void *) (gc->pc + 12), (void *) (&u2), 8); + (void) memcpy((void *) (gc->pc + 20), (void *) (&v1), 8); + (void) memcpy((void *) (gc->pc + 28), (void *) (&v2), 8); + (void) memcpy((void *) (gc->pc + 36), (void *) (&un), 4); + (void) memcpy((void *) (gc->pc + 40), (void *) (&vn), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_MapGrid2f 150 void -__indirect_glMapGrid2f(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2) +__indirect_glMapGrid2f(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, + GLfloat v2) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 28; emit_header(gc->pc, X_GLrop_MapGrid2f, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&un), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&u1), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&u2), 4); - (void) memcpy((void *)(gc->pc + 16), (void *)(&vn), 4); - (void) memcpy((void *)(gc->pc + 20), (void *)(&v1), 4); - (void) memcpy((void *)(gc->pc + 24), (void *)(&v2), 4); - gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + (void) memcpy((void *) (gc->pc + 4), (void *) (&un), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&u1), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&u2), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&vn), 4); + (void) memcpy((void *) (gc->pc + 20), (void *) (&v1), 4); + (void) memcpy((void *) (gc->pc + 24), (void *) (&v2), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_EvalCoord1dv 151 void __indirect_glEvalCoord1d(GLdouble u) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_EvalCoord1dv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&u), 8); + (void) memcpy((void *) (gc->pc + 4), (void *) (&u), 8); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_EvalCoord1dv 151 void __indirect_glEvalCoord1dv(const GLdouble * u) { - generic_8_byte( X_GLrop_EvalCoord1dv, u ); + generic_8_byte(X_GLrop_EvalCoord1dv, u); } #define X_GLrop_EvalCoord1fv 152 void __indirect_glEvalCoord1f(GLfloat u) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_EvalCoord1fv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&u), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&u), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_EvalCoord1fv 152 void __indirect_glEvalCoord1fv(const GLfloat * u) { - generic_4_byte( X_GLrop_EvalCoord1fv, u ); + generic_4_byte(X_GLrop_EvalCoord1fv, u); } #define X_GLrop_EvalCoord2dv 153 void __indirect_glEvalCoord2d(GLdouble u, GLdouble v) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_EvalCoord2dv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&u), 8); - (void) memcpy((void *)(gc->pc + 12), (void *)(&v), 8); + (void) memcpy((void *) (gc->pc + 4), (void *) (&u), 8); + (void) memcpy((void *) (gc->pc + 12), (void *) (&v), 8); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_EvalCoord2dv 153 void __indirect_glEvalCoord2dv(const GLdouble * u) { - generic_16_byte( X_GLrop_EvalCoord2dv, u ); + generic_16_byte(X_GLrop_EvalCoord2dv, u); } #define X_GLrop_EvalCoord2fv 154 void __indirect_glEvalCoord2f(GLfloat u, GLfloat v) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_EvalCoord2fv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&u), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&v), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&u), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&v), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_EvalCoord2fv 154 void __indirect_glEvalCoord2fv(const GLfloat * u) { - generic_8_byte( X_GLrop_EvalCoord2fv, u ); + generic_8_byte(X_GLrop_EvalCoord2fv, u); } #define X_GLrop_EvalMesh1 155 void __indirect_glEvalMesh1(GLenum mode, GLint i1, GLint i2) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_EvalMesh1, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&mode), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&i1), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&i2), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&mode), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&i1), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&i2), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_EvalPoint1 156 void __indirect_glEvalPoint1(GLint i) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_EvalPoint1, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&i), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&i), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_EvalMesh2 157 void __indirect_glEvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 24; emit_header(gc->pc, X_GLrop_EvalMesh2, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&mode), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&i1), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&i2), 4); - (void) memcpy((void *)(gc->pc + 16), (void *)(&j1), 4); - (void) memcpy((void *)(gc->pc + 20), (void *)(&j2), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&mode), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&i1), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&i2), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&j1), 4); + (void) memcpy((void *) (gc->pc + 20), (void *) (&j2), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_EvalPoint2 158 void __indirect_glEvalPoint2(GLint i, GLint j) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_EvalPoint2, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&i), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&j), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&i), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&j), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_AlphaFunc 159 void __indirect_glAlphaFunc(GLenum func, GLclampf ref) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_AlphaFunc, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&func), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&ref), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&func), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&ref), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_BlendFunc 160 void __indirect_glBlendFunc(GLenum sfactor, GLenum dfactor) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_BlendFunc, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&sfactor), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&dfactor), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&sfactor), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&dfactor), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_LogicOp 161 void __indirect_glLogicOp(GLenum opcode) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_LogicOp, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&opcode), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&opcode), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_StencilFunc 162 void __indirect_glStencilFunc(GLenum func, GLint ref, GLuint mask) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_StencilFunc, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&func), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&ref), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&mask), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&func), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&ref), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&mask), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_StencilOp 163 void __indirect_glStencilOp(GLenum fail, GLenum zfail, GLenum zpass) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_StencilOp, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&fail), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&zfail), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&zpass), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&fail), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&zfail), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&zpass), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_DepthFunc 164 void __indirect_glDepthFunc(GLenum func) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_DepthFunc, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&func), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&func), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_PixelZoom 165 void __indirect_glPixelZoom(GLfloat xfactor, GLfloat yfactor) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_PixelZoom, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&xfactor), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&yfactor), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&xfactor), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&yfactor), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_PixelTransferf 166 void __indirect_glPixelTransferf(GLenum pname, GLfloat param) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_PixelTransferf, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&pname), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(¶m), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (¶m), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_PixelTransferi 167 void __indirect_glPixelTransferi(GLenum pname, GLint param) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_PixelTransferi, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&pname), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(¶m), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (¶m), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_PixelMapfv 168 void __indirect_glPixelMapfv(GLenum map, GLsizei mapsize, const GLfloat * values) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12 + __GLX_PAD((mapsize * 4)); if (__builtin_expect((mapsize >= 0) && (gc->currentDpy != NULL), 1)) { if (cmdlen <= gc->maxSmallRenderCommandSize) { - if ( (gc->pc + cmdlen) > gc->bufEnd ) { + if ((gc->pc + cmdlen) > gc->bufEnd) { (void) __glXFlushRenderBuffer(gc, gc->pc); } emit_header(gc->pc, X_GLrop_PixelMapfv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&map), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&mapsize), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(values), (mapsize * 4)); + (void) memcpy((void *) (gc->pc + 4), (void *) (&map), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&mapsize), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (values), + (mapsize * 4)); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } - } - else { + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + } else { const GLint op = X_GLrop_PixelMapfv; const GLuint cmdlenLarge = cmdlen + 4; - GLubyte * const pc = __glXFlushRenderBuffer(gc, gc->pc); - (void) memcpy((void *)(pc + 0), (void *)(&cmdlenLarge), 4); - (void) memcpy((void *)(pc + 4), (void *)(&op), 4); - (void) memcpy((void *)(pc + 8), (void *)(&map), 4); - (void) memcpy((void *)(pc + 12), (void *)(&mapsize), 4); + GLubyte *const pc = __glXFlushRenderBuffer(gc, gc->pc); + (void) memcpy((void *) (pc + 0), (void *) (&cmdlenLarge), 4); + (void) memcpy((void *) (pc + 4), (void *) (&op), 4); + (void) memcpy((void *) (pc + 8), (void *) (&map), 4); + (void) memcpy((void *) (pc + 12), (void *) (&mapsize), 4); __glXSendLargeCommand(gc, pc, 16, values, (mapsize * 4)); } } @@ -3216,28 +3613,30 @@ __indirect_glPixelMapfv(GLenum map, GLsizei mapsize, const GLfloat * values) void __indirect_glPixelMapuiv(GLenum map, GLsizei mapsize, const GLuint * values) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12 + __GLX_PAD((mapsize * 4)); if (__builtin_expect((mapsize >= 0) && (gc->currentDpy != NULL), 1)) { if (cmdlen <= gc->maxSmallRenderCommandSize) { - if ( (gc->pc + cmdlen) > gc->bufEnd ) { + if ((gc->pc + cmdlen) > gc->bufEnd) { (void) __glXFlushRenderBuffer(gc, gc->pc); } emit_header(gc->pc, X_GLrop_PixelMapuiv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&map), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&mapsize), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(values), (mapsize * 4)); + (void) memcpy((void *) (gc->pc + 4), (void *) (&map), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&mapsize), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (values), + (mapsize * 4)); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } - } - else { + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + } else { const GLint op = X_GLrop_PixelMapuiv; const GLuint cmdlenLarge = cmdlen + 4; - GLubyte * const pc = __glXFlushRenderBuffer(gc, gc->pc); - (void) memcpy((void *)(pc + 0), (void *)(&cmdlenLarge), 4); - (void) memcpy((void *)(pc + 4), (void *)(&op), 4); - (void) memcpy((void *)(pc + 8), (void *)(&map), 4); - (void) memcpy((void *)(pc + 12), (void *)(&mapsize), 4); + GLubyte *const pc = __glXFlushRenderBuffer(gc, gc->pc); + (void) memcpy((void *) (pc + 0), (void *) (&cmdlenLarge), 4); + (void) memcpy((void *) (pc + 4), (void *) (&op), 4); + (void) memcpy((void *) (pc + 8), (void *) (&map), 4); + (void) memcpy((void *) (pc + 12), (void *) (&mapsize), 4); __glXSendLargeCommand(gc, pc, 16, values, (mapsize * 4)); } } @@ -3247,28 +3646,30 @@ __indirect_glPixelMapuiv(GLenum map, GLsizei mapsize, const GLuint * values) void __indirect_glPixelMapusv(GLenum map, GLsizei mapsize, const GLushort * values) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12 + __GLX_PAD((mapsize * 2)); if (__builtin_expect((mapsize >= 0) && (gc->currentDpy != NULL), 1)) { if (cmdlen <= gc->maxSmallRenderCommandSize) { - if ( (gc->pc + cmdlen) > gc->bufEnd ) { + if ((gc->pc + cmdlen) > gc->bufEnd) { (void) __glXFlushRenderBuffer(gc, gc->pc); } emit_header(gc->pc, X_GLrop_PixelMapusv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&map), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&mapsize), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(values), (mapsize * 2)); + (void) memcpy((void *) (gc->pc + 4), (void *) (&map), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&mapsize), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (values), + (mapsize * 2)); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } - } - else { + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + } else { const GLint op = X_GLrop_PixelMapusv; const GLuint cmdlenLarge = cmdlen + 4; - GLubyte * const pc = __glXFlushRenderBuffer(gc, gc->pc); - (void) memcpy((void *)(pc + 0), (void *)(&cmdlenLarge), 4); - (void) memcpy((void *)(pc + 4), (void *)(&op), 4); - (void) memcpy((void *)(pc + 8), (void *)(&map), 4); - (void) memcpy((void *)(pc + 12), (void *)(&mapsize), 4); + GLubyte *const pc = __glXFlushRenderBuffer(gc, gc->pc); + (void) memcpy((void *) (pc + 0), (void *) (&cmdlenLarge), 4); + (void) memcpy((void *) (pc + 4), (void *) (&op), 4); + (void) memcpy((void *) (pc + 8), (void *) (&map), 4); + (void) memcpy((void *) (pc + 12), (void *) (&mapsize), 4); __glXSendLargeCommand(gc, pc, 16, values, (mapsize * 2)); } } @@ -3278,57 +3679,77 @@ __indirect_glPixelMapusv(GLenum map, GLsizei mapsize, const GLushort * values) void __indirect_glReadBuffer(GLenum mode) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_ReadBuffer, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&mode), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&mode), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_CopyPixels 172 void -__indirect_glCopyPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type) +__indirect_glCopyPixels(GLint x, GLint y, GLsizei width, GLsizei height, + GLenum type) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 24; emit_header(gc->pc, X_GLrop_CopyPixels, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&x), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&y), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&width), 4); - (void) memcpy((void *)(gc->pc + 16), (void *)(&height), 4); - (void) memcpy((void *)(gc->pc + 20), (void *)(&type), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&y), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&width), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&height), 4); + (void) memcpy((void *) (gc->pc + 20), (void *) (&type), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLsop_ReadPixels 111 void -__indirect_glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid * pixels) +__indirect_glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, + GLenum format, GLenum type, GLvoid * pixels) { - __GLXcontext * const gc = __glXGetCurrentContext(); - const __GLXattribute * const state = gc->client_state_private; - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + const __GLXattribute *const state = gc->client_state_private; + Display *const dpy = gc->currentDpy; const GLuint cmdlen = 28; if (__builtin_expect(dpy != NULL, 1)) { #ifdef USE_XCB - XCBConnection *c = XCBConnectionOfDisplay(dpy); + xcb_connection_t *c = XGetXCBConnection(dpy); (void) __glXFlushRenderBuffer(gc, gc->pc); - XCBGlxReadPixelsRep *reply = XCBGlxReadPixelsReply(c, XCBGlxReadPixels(c, gc->currentContextTag, x, y, width, height, format, type, state->storePack.swapEndian, 0), NULL); - (void)memcpy(pixels, XCBGlxReadPixelsData(reply), XCBGlxReadPixelsDataLength(reply) * sizeof(GLvoid)); + xcb_glx_read_pixels_reply_t *reply = + xcb_glx_read_pixels_reply(c, + xcb_glx_read_pixels(c, + gc-> + currentContextTag, + x, y, width, height, + format, type, + state->storePack. + swapEndian, 0), + NULL); + (void) memcpy(pixels, xcb_glx_read_pixels_data(reply), + xcb_glx_read_pixels_data_length(reply) * + sizeof(GLvoid)); free(reply); #else - GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_ReadPixels, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&x), 4); - (void) memcpy((void *)(pc + 4), (void *)(&y), 4); - (void) memcpy((void *)(pc + 8), (void *)(&width), 4); - (void) memcpy((void *)(pc + 12), (void *)(&height), 4); - (void) memcpy((void *)(pc + 16), (void *)(&format), 4); - (void) memcpy((void *)(pc + 20), (void *)(&type), 4); - *(int32_t *)(pc + 24) = 0; - * (int8_t *)(pc + 24) = state->storePack.swapEndian; - __glXReadPixelReply(dpy, gc, 2, width, height, 1, format, type, pixels, GL_FALSE); - UnlockDisplay(dpy); SyncHandle(); + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_ReadPixels, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&x), 4); + (void) memcpy((void *) (pc + 4), (void *) (&y), 4); + (void) memcpy((void *) (pc + 8), (void *) (&width), 4); + (void) memcpy((void *) (pc + 12), (void *) (&height), 4); + (void) memcpy((void *) (pc + 16), (void *) (&format), 4); + (void) memcpy((void *) (pc + 20), (void *) (&type), 4); + *(int32_t *) (pc + 24) = 0; + *(int8_t *) (pc + 24) = state->storePack.swapEndian; + __glXReadPixelReply(dpy, gc, 2, width, height, 1, format, type, + pixels, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); #endif /* USE_XCB */ } return; @@ -3336,41 +3757,47 @@ __indirect_glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum #define X_GLrop_DrawPixels 173 void -__indirect_glDrawPixels(GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels) +__indirect_glDrawPixels(GLsizei width, GLsizei height, GLenum format, + GLenum type, const GLvoid * pixels) { - __GLXcontext * const gc = __glXGetCurrentContext(); - const GLuint compsize = (pixels != NULL) ? __glImageSize(width, height, 1, format, type, 0) : 0; + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint compsize = + (pixels != NULL) ? __glImageSize(width, height, 1, format, type, + 0) : 0; const GLuint cmdlen = 40 + __GLX_PAD(compsize); if (__builtin_expect(gc->currentDpy != NULL, 1)) { if (cmdlen <= gc->maxSmallRenderCommandSize) { - if ( (gc->pc + cmdlen) > gc->bufEnd ) { + if ((gc->pc + cmdlen) > gc->bufEnd) { (void) __glXFlushRenderBuffer(gc, gc->pc); } emit_header(gc->pc, X_GLrop_DrawPixels, cmdlen); - (void) memcpy((void *)(gc->pc + 24), (void *)(&width), 4); - (void) memcpy((void *)(gc->pc + 28), (void *)(&height), 4); - (void) memcpy((void *)(gc->pc + 32), (void *)(&format), 4); - (void) memcpy((void *)(gc->pc + 36), (void *)(&type), 4); + (void) memcpy((void *) (gc->pc + 24), (void *) (&width), 4); + (void) memcpy((void *) (gc->pc + 28), (void *) (&height), 4); + (void) memcpy((void *) (gc->pc + 32), (void *) (&format), 4); + (void) memcpy((void *) (gc->pc + 36), (void *) (&type), 4); if (compsize > 0) { - (*gc->fillImage)(gc, 2, width, height, 1, format, type, pixels, gc->pc + 40, gc->pc + 4); - } - else { - (void) memcpy( gc->pc + 4, default_pixel_store_2D, default_pixel_store_2D_size ); + (*gc->fillImage) (gc, 2, width, height, 1, format, type, + pixels, gc->pc + 40, gc->pc + 4); + } else { + (void) memcpy(gc->pc + 4, default_pixel_store_2D, + default_pixel_store_2D_size); } gc->pc += cmdlen; - if (gc->pc > gc->limit) { (void) __glXFlushRenderBuffer(gc, gc->pc); } - } - else { + if (gc->pc > gc->limit) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + } else { const GLint op = X_GLrop_DrawPixels; const GLuint cmdlenLarge = cmdlen + 4; - GLubyte * const pc = __glXFlushRenderBuffer(gc, gc->pc); - (void) memcpy((void *)(pc + 0), (void *)(&cmdlenLarge), 4); - (void) memcpy((void *)(pc + 4), (void *)(&op), 4); - (void) memcpy((void *)(pc + 28), (void *)(&width), 4); - (void) memcpy((void *)(pc + 32), (void *)(&height), 4); - (void) memcpy((void *)(pc + 36), (void *)(&format), 4); - (void) memcpy((void *)(pc + 40), (void *)(&type), 4); - __glXSendLargeImage(gc, compsize, 2, width, height, 1, format, type, pixels, pc + 44, pc + 8); + GLubyte *const pc = __glXFlushRenderBuffer(gc, gc->pc); + (void) memcpy((void *) (pc + 0), (void *) (&cmdlenLarge), 4); + (void) memcpy((void *) (pc + 4), (void *) (&op), 4); + (void) memcpy((void *) (pc + 28), (void *) (&width), 4); + (void) memcpy((void *) (pc + 32), (void *) (&height), 4); + (void) memcpy((void *) (pc + 36), (void *) (&format), 4); + (void) memcpy((void *) (pc + 40), (void *) (&type), 4); + __glXSendLargeImage(gc, compsize, 2, width, height, 1, format, + type, pixels, pc + 44, pc + 8); } } } @@ -3379,21 +3806,30 @@ __indirect_glDrawPixels(GLsizei width, GLsizei height, GLenum format, GLenum typ void __indirect_glGetClipPlane(GLenum plane, GLdouble * equation) { - __GLXcontext * const gc = __glXGetCurrentContext(); - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; const GLuint cmdlen = 4; if (__builtin_expect(dpy != NULL, 1)) { #ifdef USE_XCB - XCBConnection *c = XCBConnectionOfDisplay(dpy); + xcb_connection_t *c = XGetXCBConnection(dpy); (void) __glXFlushRenderBuffer(gc, gc->pc); - XCBGlxGetClipPlaneRep *reply = XCBGlxGetClipPlaneReply(c, XCBGlxGetClipPlane(c, gc->currentContextTag, plane), NULL); - (void)memcpy(equation, XCBGlxGetClipPlaneData(reply), XCBGlxGetClipPlaneDataLength(reply) * sizeof(GLdouble)); + xcb_glx_get_clip_plane_reply_t *reply = + xcb_glx_get_clip_plane_reply(c, + xcb_glx_get_clip_plane(c, + gc-> + currentContextTag, + plane), NULL); + (void) memcpy(equation, xcb_glx_get_clip_plane_data(reply), + xcb_glx_get_clip_plane_data_length(reply) * + sizeof(GLdouble)); free(reply); #else - GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetClipPlane, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&plane), 4); + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetClipPlane, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&plane), 4); (void) __glXReadReply(dpy, 8, equation, GL_TRUE); - UnlockDisplay(dpy); SyncHandle(); + UnlockDisplay(dpy); + SyncHandle(); #endif /* USE_XCB */ } return; @@ -3403,25 +3839,35 @@ __indirect_glGetClipPlane(GLenum plane, GLdouble * equation) void __indirect_glGetLightfv(GLenum light, GLenum pname, GLfloat * params) { - __GLXcontext * const gc = __glXGetCurrentContext(); - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; const GLuint cmdlen = 8; if (__builtin_expect(dpy != NULL, 1)) { #ifdef USE_XCB - XCBConnection *c = XCBConnectionOfDisplay(dpy); + xcb_connection_t *c = XGetXCBConnection(dpy); (void) __glXFlushRenderBuffer(gc, gc->pc); - XCBGlxGetLightfvRep *reply = XCBGlxGetLightfvReply(c, XCBGlxGetLightfv(c, gc->currentContextTag, light, pname), NULL); - if (XCBGlxGetLightfvDataLength(reply) == 0) - (void)memcpy(params, &reply->datum, sizeof(reply->datum)); + xcb_glx_get_lightfv_reply_t *reply = + xcb_glx_get_lightfv_reply(c, + xcb_glx_get_lightfv(c, + gc-> + currentContextTag, + light, pname), + NULL); + if (xcb_glx_get_lightfv_data_length(reply) == 0) + (void) memcpy(params, &reply->datum, sizeof(reply->datum)); else - (void)memcpy(params, XCBGlxGetLightfvData(reply), XCBGlxGetLightfvDataLength(reply) * sizeof(GLfloat)); + (void) memcpy(params, xcb_glx_get_lightfv_data(reply), + xcb_glx_get_lightfv_data_length(reply) * + sizeof(GLfloat)); free(reply); #else - GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetLightfv, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&light), 4); - (void) memcpy((void *)(pc + 4), (void *)(&pname), 4); + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetLightfv, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&light), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); (void) __glXReadReply(dpy, 4, params, GL_FALSE); - UnlockDisplay(dpy); SyncHandle(); + UnlockDisplay(dpy); + SyncHandle(); #endif /* USE_XCB */ } return; @@ -3431,25 +3877,35 @@ __indirect_glGetLightfv(GLenum light, GLenum pname, GLfloat * params) void __indirect_glGetLightiv(GLenum light, GLenum pname, GLint * params) { - __GLXcontext * const gc = __glXGetCurrentContext(); - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; const GLuint cmdlen = 8; if (__builtin_expect(dpy != NULL, 1)) { #ifdef USE_XCB - XCBConnection *c = XCBConnectionOfDisplay(dpy); + xcb_connection_t *c = XGetXCBConnection(dpy); (void) __glXFlushRenderBuffer(gc, gc->pc); - XCBGlxGetLightivRep *reply = XCBGlxGetLightivReply(c, XCBGlxGetLightiv(c, gc->currentContextTag, light, pname), NULL); - if (XCBGlxGetLightivDataLength(reply) == 0) - (void)memcpy(params, &reply->datum, sizeof(reply->datum)); + xcb_glx_get_lightiv_reply_t *reply = + xcb_glx_get_lightiv_reply(c, + xcb_glx_get_lightiv(c, + gc-> + currentContextTag, + light, pname), + NULL); + if (xcb_glx_get_lightiv_data_length(reply) == 0) + (void) memcpy(params, &reply->datum, sizeof(reply->datum)); else - (void)memcpy(params, XCBGlxGetLightivData(reply), XCBGlxGetLightivDataLength(reply) * sizeof(GLint)); + (void) memcpy(params, xcb_glx_get_lightiv_data(reply), + xcb_glx_get_lightiv_data_length(reply) * + sizeof(GLint)); free(reply); #else - GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetLightiv, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&light), 4); - (void) memcpy((void *)(pc + 4), (void *)(&pname), 4); + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetLightiv, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&light), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); (void) __glXReadReply(dpy, 4, params, GL_FALSE); - UnlockDisplay(dpy); SyncHandle(); + UnlockDisplay(dpy); + SyncHandle(); #endif /* USE_XCB */ } return; @@ -3459,25 +3915,33 @@ __indirect_glGetLightiv(GLenum light, GLenum pname, GLint * params) void __indirect_glGetMapdv(GLenum target, GLenum query, GLdouble * v) { - __GLXcontext * const gc = __glXGetCurrentContext(); - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; const GLuint cmdlen = 8; if (__builtin_expect(dpy != NULL, 1)) { #ifdef USE_XCB - XCBConnection *c = XCBConnectionOfDisplay(dpy); + xcb_connection_t *c = XGetXCBConnection(dpy); (void) __glXFlushRenderBuffer(gc, gc->pc); - XCBGlxGetMapdvRep *reply = XCBGlxGetMapdvReply(c, XCBGlxGetMapdv(c, gc->currentContextTag, target, query), NULL); - if (XCBGlxGetMapdvDataLength(reply) == 0) - (void)memcpy(v, &reply->datum, sizeof(reply->datum)); + xcb_glx_get_mapdv_reply_t *reply = + xcb_glx_get_mapdv_reply(c, + xcb_glx_get_mapdv(c, + gc->currentContextTag, + target, query), NULL); + if (xcb_glx_get_mapdv_data_length(reply) == 0) + (void) memcpy(v, &reply->datum, sizeof(reply->datum)); else - (void)memcpy(v, XCBGlxGetMapdvData(reply), XCBGlxGetMapdvDataLength(reply) * sizeof(GLdouble)); + (void) memcpy(v, xcb_glx_get_mapdv_data(reply), + xcb_glx_get_mapdv_data_length(reply) * + sizeof(GLdouble)); free(reply); #else - GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetMapdv, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&target), 4); - (void) memcpy((void *)(pc + 4), (void *)(&query), 4); + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetMapdv, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&query), 4); (void) __glXReadReply(dpy, 8, v, GL_FALSE); - UnlockDisplay(dpy); SyncHandle(); + UnlockDisplay(dpy); + SyncHandle(); #endif /* USE_XCB */ } return; @@ -3487,25 +3951,33 @@ __indirect_glGetMapdv(GLenum target, GLenum query, GLdouble * v) void __indirect_glGetMapfv(GLenum target, GLenum query, GLfloat * v) { - __GLXcontext * const gc = __glXGetCurrentContext(); - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; const GLuint cmdlen = 8; if (__builtin_expect(dpy != NULL, 1)) { #ifdef USE_XCB - XCBConnection *c = XCBConnectionOfDisplay(dpy); + xcb_connection_t *c = XGetXCBConnection(dpy); (void) __glXFlushRenderBuffer(gc, gc->pc); - XCBGlxGetMapfvRep *reply = XCBGlxGetMapfvReply(c, XCBGlxGetMapfv(c, gc->currentContextTag, target, query), NULL); - if (XCBGlxGetMapfvDataLength(reply) == 0) - (void)memcpy(v, &reply->datum, sizeof(reply->datum)); + xcb_glx_get_mapfv_reply_t *reply = + xcb_glx_get_mapfv_reply(c, + xcb_glx_get_mapfv(c, + gc->currentContextTag, + target, query), NULL); + if (xcb_glx_get_mapfv_data_length(reply) == 0) + (void) memcpy(v, &reply->datum, sizeof(reply->datum)); else - (void)memcpy(v, XCBGlxGetMapfvData(reply), XCBGlxGetMapfvDataLength(reply) * sizeof(GLfloat)); + (void) memcpy(v, xcb_glx_get_mapfv_data(reply), + xcb_glx_get_mapfv_data_length(reply) * + sizeof(GLfloat)); free(reply); #else - GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetMapfv, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&target), 4); - (void) memcpy((void *)(pc + 4), (void *)(&query), 4); + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetMapfv, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&query), 4); (void) __glXReadReply(dpy, 4, v, GL_FALSE); - UnlockDisplay(dpy); SyncHandle(); + UnlockDisplay(dpy); + SyncHandle(); #endif /* USE_XCB */ } return; @@ -3515,25 +3987,33 @@ __indirect_glGetMapfv(GLenum target, GLenum query, GLfloat * v) void __indirect_glGetMapiv(GLenum target, GLenum query, GLint * v) { - __GLXcontext * const gc = __glXGetCurrentContext(); - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; const GLuint cmdlen = 8; if (__builtin_expect(dpy != NULL, 1)) { #ifdef USE_XCB - XCBConnection *c = XCBConnectionOfDisplay(dpy); + xcb_connection_t *c = XGetXCBConnection(dpy); (void) __glXFlushRenderBuffer(gc, gc->pc); - XCBGlxGetMapivRep *reply = XCBGlxGetMapivReply(c, XCBGlxGetMapiv(c, gc->currentContextTag, target, query), NULL); - if (XCBGlxGetMapivDataLength(reply) == 0) - (void)memcpy(v, &reply->datum, sizeof(reply->datum)); + xcb_glx_get_mapiv_reply_t *reply = + xcb_glx_get_mapiv_reply(c, + xcb_glx_get_mapiv(c, + gc->currentContextTag, + target, query), NULL); + if (xcb_glx_get_mapiv_data_length(reply) == 0) + (void) memcpy(v, &reply->datum, sizeof(reply->datum)); else - (void)memcpy(v, XCBGlxGetMapivData(reply), XCBGlxGetMapivDataLength(reply) * sizeof(GLint)); + (void) memcpy(v, xcb_glx_get_mapiv_data(reply), + xcb_glx_get_mapiv_data_length(reply) * + sizeof(GLint)); free(reply); #else - GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetMapiv, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&target), 4); - (void) memcpy((void *)(pc + 4), (void *)(&query), 4); + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetMapiv, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&query), 4); (void) __glXReadReply(dpy, 4, v, GL_FALSE); - UnlockDisplay(dpy); SyncHandle(); + UnlockDisplay(dpy); + SyncHandle(); #endif /* USE_XCB */ } return; @@ -3543,25 +4023,35 @@ __indirect_glGetMapiv(GLenum target, GLenum query, GLint * v) void __indirect_glGetMaterialfv(GLenum face, GLenum pname, GLfloat * params) { - __GLXcontext * const gc = __glXGetCurrentContext(); - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; const GLuint cmdlen = 8; if (__builtin_expect(dpy != NULL, 1)) { #ifdef USE_XCB - XCBConnection *c = XCBConnectionOfDisplay(dpy); + xcb_connection_t *c = XGetXCBConnection(dpy); (void) __glXFlushRenderBuffer(gc, gc->pc); - XCBGlxGetMaterialfvRep *reply = XCBGlxGetMaterialfvReply(c, XCBGlxGetMaterialfv(c, gc->currentContextTag, face, pname), NULL); - if (XCBGlxGetMaterialfvDataLength(reply) == 0) - (void)memcpy(params, &reply->datum, sizeof(reply->datum)); + xcb_glx_get_materialfv_reply_t *reply = + xcb_glx_get_materialfv_reply(c, + xcb_glx_get_materialfv(c, + gc-> + currentContextTag, + face, pname), + NULL); + if (xcb_glx_get_materialfv_data_length(reply) == 0) + (void) memcpy(params, &reply->datum, sizeof(reply->datum)); else - (void)memcpy(params, XCBGlxGetMaterialfvData(reply), XCBGlxGetMaterialfvDataLength(reply) * sizeof(GLfloat)); + (void) memcpy(params, xcb_glx_get_materialfv_data(reply), + xcb_glx_get_materialfv_data_length(reply) * + sizeof(GLfloat)); free(reply); #else - GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetMaterialfv, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&face), 4); - (void) memcpy((void *)(pc + 4), (void *)(&pname), 4); + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetMaterialfv, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&face), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); (void) __glXReadReply(dpy, 4, params, GL_FALSE); - UnlockDisplay(dpy); SyncHandle(); + UnlockDisplay(dpy); + SyncHandle(); #endif /* USE_XCB */ } return; @@ -3571,25 +4061,35 @@ __indirect_glGetMaterialfv(GLenum face, GLenum pname, GLfloat * params) void __indirect_glGetMaterialiv(GLenum face, GLenum pname, GLint * params) { - __GLXcontext * const gc = __glXGetCurrentContext(); - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; const GLuint cmdlen = 8; if (__builtin_expect(dpy != NULL, 1)) { #ifdef USE_XCB - XCBConnection *c = XCBConnectionOfDisplay(dpy); + xcb_connection_t *c = XGetXCBConnection(dpy); (void) __glXFlushRenderBuffer(gc, gc->pc); - XCBGlxGetMaterialivRep *reply = XCBGlxGetMaterialivReply(c, XCBGlxGetMaterialiv(c, gc->currentContextTag, face, pname), NULL); - if (XCBGlxGetMaterialivDataLength(reply) == 0) - (void)memcpy(params, &reply->datum, sizeof(reply->datum)); + xcb_glx_get_materialiv_reply_t *reply = + xcb_glx_get_materialiv_reply(c, + xcb_glx_get_materialiv(c, + gc-> + currentContextTag, + face, pname), + NULL); + if (xcb_glx_get_materialiv_data_length(reply) == 0) + (void) memcpy(params, &reply->datum, sizeof(reply->datum)); else - (void)memcpy(params, XCBGlxGetMaterialivData(reply), XCBGlxGetMaterialivDataLength(reply) * sizeof(GLint)); + (void) memcpy(params, xcb_glx_get_materialiv_data(reply), + xcb_glx_get_materialiv_data_length(reply) * + sizeof(GLint)); free(reply); #else - GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetMaterialiv, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&face), 4); - (void) memcpy((void *)(pc + 4), (void *)(&pname), 4); + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetMaterialiv, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&face), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); (void) __glXReadReply(dpy, 4, params, GL_FALSE); - UnlockDisplay(dpy); SyncHandle(); + UnlockDisplay(dpy); + SyncHandle(); #endif /* USE_XCB */ } return; @@ -3599,24 +4099,33 @@ __indirect_glGetMaterialiv(GLenum face, GLenum pname, GLint * params) void __indirect_glGetPixelMapfv(GLenum map, GLfloat * values) { - __GLXcontext * const gc = __glXGetCurrentContext(); - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; const GLuint cmdlen = 4; if (__builtin_expect(dpy != NULL, 1)) { #ifdef USE_XCB - XCBConnection *c = XCBConnectionOfDisplay(dpy); + xcb_connection_t *c = XGetXCBConnection(dpy); (void) __glXFlushRenderBuffer(gc, gc->pc); - XCBGlxGetPixelMapfvRep *reply = XCBGlxGetPixelMapfvReply(c, XCBGlxGetPixelMapfv(c, gc->currentContextTag, map), NULL); - if (XCBGlxGetPixelMapfvDataLength(reply) == 0) - (void)memcpy(values, &reply->datum, sizeof(reply->datum)); + xcb_glx_get_pixel_mapfv_reply_t *reply = + xcb_glx_get_pixel_mapfv_reply(c, + xcb_glx_get_pixel_mapfv(c, + gc-> + currentContextTag, + map), NULL); + if (xcb_glx_get_pixel_mapfv_data_length(reply) == 0) + (void) memcpy(values, &reply->datum, sizeof(reply->datum)); else - (void)memcpy(values, XCBGlxGetPixelMapfvData(reply), XCBGlxGetPixelMapfvDataLength(reply) * sizeof(GLfloat)); + (void) memcpy(values, xcb_glx_get_pixel_mapfv_data(reply), + xcb_glx_get_pixel_mapfv_data_length(reply) * + sizeof(GLfloat)); free(reply); #else - GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetPixelMapfv, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&map), 4); + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetPixelMapfv, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&map), 4); (void) __glXReadReply(dpy, 4, values, GL_FALSE); - UnlockDisplay(dpy); SyncHandle(); + UnlockDisplay(dpy); + SyncHandle(); #endif /* USE_XCB */ } return; @@ -3626,24 +4135,34 @@ __indirect_glGetPixelMapfv(GLenum map, GLfloat * values) void __indirect_glGetPixelMapuiv(GLenum map, GLuint * values) { - __GLXcontext * const gc = __glXGetCurrentContext(); - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; const GLuint cmdlen = 4; if (__builtin_expect(dpy != NULL, 1)) { #ifdef USE_XCB - XCBConnection *c = XCBConnectionOfDisplay(dpy); + xcb_connection_t *c = XGetXCBConnection(dpy); (void) __glXFlushRenderBuffer(gc, gc->pc); - XCBGlxGetPixelMapuivRep *reply = XCBGlxGetPixelMapuivReply(c, XCBGlxGetPixelMapuiv(c, gc->currentContextTag, map), NULL); - if (XCBGlxGetPixelMapuivDataLength(reply) == 0) - (void)memcpy(values, &reply->datum, sizeof(reply->datum)); + xcb_glx_get_pixel_mapuiv_reply_t *reply = + xcb_glx_get_pixel_mapuiv_reply(c, + xcb_glx_get_pixel_mapuiv(c, + gc-> + currentContextTag, + map), + NULL); + if (xcb_glx_get_pixel_mapuiv_data_length(reply) == 0) + (void) memcpy(values, &reply->datum, sizeof(reply->datum)); else - (void)memcpy(values, XCBGlxGetPixelMapuivData(reply), XCBGlxGetPixelMapuivDataLength(reply) * sizeof(GLuint)); + (void) memcpy(values, xcb_glx_get_pixel_mapuiv_data(reply), + xcb_glx_get_pixel_mapuiv_data_length(reply) * + sizeof(GLuint)); free(reply); #else - GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetPixelMapuiv, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&map), 4); + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetPixelMapuiv, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&map), 4); (void) __glXReadReply(dpy, 4, values, GL_FALSE); - UnlockDisplay(dpy); SyncHandle(); + UnlockDisplay(dpy); + SyncHandle(); #endif /* USE_XCB */ } return; @@ -3653,24 +4172,34 @@ __indirect_glGetPixelMapuiv(GLenum map, GLuint * values) void __indirect_glGetPixelMapusv(GLenum map, GLushort * values) { - __GLXcontext * const gc = __glXGetCurrentContext(); - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; const GLuint cmdlen = 4; if (__builtin_expect(dpy != NULL, 1)) { #ifdef USE_XCB - XCBConnection *c = XCBConnectionOfDisplay(dpy); + xcb_connection_t *c = XGetXCBConnection(dpy); (void) __glXFlushRenderBuffer(gc, gc->pc); - XCBGlxGetPixelMapusvRep *reply = XCBGlxGetPixelMapusvReply(c, XCBGlxGetPixelMapusv(c, gc->currentContextTag, map), NULL); - if (XCBGlxGetPixelMapusvDataLength(reply) == 0) - (void)memcpy(values, &reply->datum, sizeof(reply->datum)); + xcb_glx_get_pixel_mapusv_reply_t *reply = + xcb_glx_get_pixel_mapusv_reply(c, + xcb_glx_get_pixel_mapusv(c, + gc-> + currentContextTag, + map), + NULL); + if (xcb_glx_get_pixel_mapusv_data_length(reply) == 0) + (void) memcpy(values, &reply->datum, sizeof(reply->datum)); else - (void)memcpy(values, XCBGlxGetPixelMapusvData(reply), XCBGlxGetPixelMapusvDataLength(reply) * sizeof(GLushort)); + (void) memcpy(values, xcb_glx_get_pixel_mapusv_data(reply), + xcb_glx_get_pixel_mapusv_data_length(reply) * + sizeof(GLushort)); free(reply); #else - GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetPixelMapusv, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&map), 4); + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetPixelMapusv, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&map), 4); (void) __glXReadReply(dpy, 2, values, GL_FALSE); - UnlockDisplay(dpy); SyncHandle(); + UnlockDisplay(dpy); + SyncHandle(); #endif /* USE_XCB */ } return; @@ -3680,22 +4209,33 @@ __indirect_glGetPixelMapusv(GLenum map, GLushort * values) void __indirect_glGetPolygonStipple(GLubyte * mask) { - __GLXcontext * const gc = __glXGetCurrentContext(); - const __GLXattribute * const state = gc->client_state_private; - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + const __GLXattribute *const state = gc->client_state_private; + Display *const dpy = gc->currentDpy; const GLuint cmdlen = 4; if (__builtin_expect(dpy != NULL, 1)) { #ifdef USE_XCB - XCBConnection *c = XCBConnectionOfDisplay(dpy); + xcb_connection_t *c = XGetXCBConnection(dpy); (void) __glXFlushRenderBuffer(gc, gc->pc); - XCBGlxGetPolygonStippleRep *reply = XCBGlxGetPolygonStippleReply(c, XCBGlxGetPolygonStipple(c, gc->currentContextTag, 0), NULL); - (void)memcpy(mask, XCBGlxGetPolygonStippleData(reply), XCBGlxGetPolygonStippleDataLength(reply) * sizeof(GLubyte)); + xcb_glx_get_polygon_stipple_reply_t *reply = + xcb_glx_get_polygon_stipple_reply(c, + xcb_glx_get_polygon_stipple(c, + gc-> + currentContextTag, + 0), + NULL); + (void) memcpy(mask, xcb_glx_get_polygon_stipple_data(reply), + xcb_glx_get_polygon_stipple_data_length(reply) * + sizeof(GLubyte)); free(reply); #else - GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetPolygonStipple, cmdlen); - *(int32_t *)(pc + 0) = 0; - __glXReadPixelReply(dpy, gc, 2, 32, 32, 1, GL_COLOR_INDEX, GL_BITMAP, mask, GL_FALSE); - UnlockDisplay(dpy); SyncHandle(); + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetPolygonStipple, cmdlen); + *(int32_t *) (pc + 0) = 0; + __glXReadPixelReply(dpy, gc, 2, 32, 32, 1, GL_COLOR_INDEX, GL_BITMAP, + mask, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); #endif /* USE_XCB */ } return; @@ -3705,25 +4245,35 @@ __indirect_glGetPolygonStipple(GLubyte * mask) void __indirect_glGetTexEnvfv(GLenum target, GLenum pname, GLfloat * params) { - __GLXcontext * const gc = __glXGetCurrentContext(); - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; const GLuint cmdlen = 8; if (__builtin_expect(dpy != NULL, 1)) { #ifdef USE_XCB - XCBConnection *c = XCBConnectionOfDisplay(dpy); + xcb_connection_t *c = XGetXCBConnection(dpy); (void) __glXFlushRenderBuffer(gc, gc->pc); - XCBGlxGetTexEnvfvRep *reply = XCBGlxGetTexEnvfvReply(c, XCBGlxGetTexEnvfv(c, gc->currentContextTag, target, pname), NULL); - if (XCBGlxGetTexEnvfvDataLength(reply) == 0) - (void)memcpy(params, &reply->datum, sizeof(reply->datum)); + xcb_glx_get_tex_envfv_reply_t *reply = + xcb_glx_get_tex_envfv_reply(c, + xcb_glx_get_tex_envfv(c, + gc-> + currentContextTag, + target, pname), + NULL); + if (xcb_glx_get_tex_envfv_data_length(reply) == 0) + (void) memcpy(params, &reply->datum, sizeof(reply->datum)); else - (void)memcpy(params, XCBGlxGetTexEnvfvData(reply), XCBGlxGetTexEnvfvDataLength(reply) * sizeof(GLfloat)); + (void) memcpy(params, xcb_glx_get_tex_envfv_data(reply), + xcb_glx_get_tex_envfv_data_length(reply) * + sizeof(GLfloat)); free(reply); #else - GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetTexEnvfv, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&target), 4); - (void) memcpy((void *)(pc + 4), (void *)(&pname), 4); + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetTexEnvfv, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); (void) __glXReadReply(dpy, 4, params, GL_FALSE); - UnlockDisplay(dpy); SyncHandle(); + UnlockDisplay(dpy); + SyncHandle(); #endif /* USE_XCB */ } return; @@ -3733,25 +4283,35 @@ __indirect_glGetTexEnvfv(GLenum target, GLenum pname, GLfloat * params) void __indirect_glGetTexEnviv(GLenum target, GLenum pname, GLint * params) { - __GLXcontext * const gc = __glXGetCurrentContext(); - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; const GLuint cmdlen = 8; if (__builtin_expect(dpy != NULL, 1)) { #ifdef USE_XCB - XCBConnection *c = XCBConnectionOfDisplay(dpy); + xcb_connection_t *c = XGetXCBConnection(dpy); (void) __glXFlushRenderBuffer(gc, gc->pc); - XCBGlxGetTexEnvivRep *reply = XCBGlxGetTexEnvivReply(c, XCBGlxGetTexEnviv(c, gc->currentContextTag, target, pname), NULL); - if (XCBGlxGetTexEnvivDataLength(reply) == 0) - (void)memcpy(params, &reply->datum, sizeof(reply->datum)); + xcb_glx_get_tex_enviv_reply_t *reply = + xcb_glx_get_tex_enviv_reply(c, + xcb_glx_get_tex_enviv(c, + gc-> + currentContextTag, + target, pname), + NULL); + if (xcb_glx_get_tex_enviv_data_length(reply) == 0) + (void) memcpy(params, &reply->datum, sizeof(reply->datum)); else - (void)memcpy(params, XCBGlxGetTexEnvivData(reply), XCBGlxGetTexEnvivDataLength(reply) * sizeof(GLint)); + (void) memcpy(params, xcb_glx_get_tex_enviv_data(reply), + xcb_glx_get_tex_enviv_data_length(reply) * + sizeof(GLint)); free(reply); #else - GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetTexEnviv, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&target), 4); - (void) memcpy((void *)(pc + 4), (void *)(&pname), 4); + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetTexEnviv, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); (void) __glXReadReply(dpy, 4, params, GL_FALSE); - UnlockDisplay(dpy); SyncHandle(); + UnlockDisplay(dpy); + SyncHandle(); #endif /* USE_XCB */ } return; @@ -3761,25 +4321,35 @@ __indirect_glGetTexEnviv(GLenum target, GLenum pname, GLint * params) void __indirect_glGetTexGendv(GLenum coord, GLenum pname, GLdouble * params) { - __GLXcontext * const gc = __glXGetCurrentContext(); - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; const GLuint cmdlen = 8; if (__builtin_expect(dpy != NULL, 1)) { #ifdef USE_XCB - XCBConnection *c = XCBConnectionOfDisplay(dpy); + xcb_connection_t *c = XGetXCBConnection(dpy); (void) __glXFlushRenderBuffer(gc, gc->pc); - XCBGlxGetTexGendvRep *reply = XCBGlxGetTexGendvReply(c, XCBGlxGetTexGendv(c, gc->currentContextTag, coord, pname), NULL); - if (XCBGlxGetTexGendvDataLength(reply) == 0) - (void)memcpy(params, &reply->datum, sizeof(reply->datum)); + xcb_glx_get_tex_gendv_reply_t *reply = + xcb_glx_get_tex_gendv_reply(c, + xcb_glx_get_tex_gendv(c, + gc-> + currentContextTag, + coord, pname), + NULL); + if (xcb_glx_get_tex_gendv_data_length(reply) == 0) + (void) memcpy(params, &reply->datum, sizeof(reply->datum)); else - (void)memcpy(params, XCBGlxGetTexGendvData(reply), XCBGlxGetTexGendvDataLength(reply) * sizeof(GLdouble)); + (void) memcpy(params, xcb_glx_get_tex_gendv_data(reply), + xcb_glx_get_tex_gendv_data_length(reply) * + sizeof(GLdouble)); free(reply); #else - GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetTexGendv, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&coord), 4); - (void) memcpy((void *)(pc + 4), (void *)(&pname), 4); + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetTexGendv, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&coord), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); (void) __glXReadReply(dpy, 8, params, GL_FALSE); - UnlockDisplay(dpy); SyncHandle(); + UnlockDisplay(dpy); + SyncHandle(); #endif /* USE_XCB */ } return; @@ -3789,25 +4359,35 @@ __indirect_glGetTexGendv(GLenum coord, GLenum pname, GLdouble * params) void __indirect_glGetTexGenfv(GLenum coord, GLenum pname, GLfloat * params) { - __GLXcontext * const gc = __glXGetCurrentContext(); - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; const GLuint cmdlen = 8; if (__builtin_expect(dpy != NULL, 1)) { #ifdef USE_XCB - XCBConnection *c = XCBConnectionOfDisplay(dpy); + xcb_connection_t *c = XGetXCBConnection(dpy); (void) __glXFlushRenderBuffer(gc, gc->pc); - XCBGlxGetTexGenfvRep *reply = XCBGlxGetTexGenfvReply(c, XCBGlxGetTexGenfv(c, gc->currentContextTag, coord, pname), NULL); - if (XCBGlxGetTexGenfvDataLength(reply) == 0) - (void)memcpy(params, &reply->datum, sizeof(reply->datum)); + xcb_glx_get_tex_genfv_reply_t *reply = + xcb_glx_get_tex_genfv_reply(c, + xcb_glx_get_tex_genfv(c, + gc-> + currentContextTag, + coord, pname), + NULL); + if (xcb_glx_get_tex_genfv_data_length(reply) == 0) + (void) memcpy(params, &reply->datum, sizeof(reply->datum)); else - (void)memcpy(params, XCBGlxGetTexGenfvData(reply), XCBGlxGetTexGenfvDataLength(reply) * sizeof(GLfloat)); + (void) memcpy(params, xcb_glx_get_tex_genfv_data(reply), + xcb_glx_get_tex_genfv_data_length(reply) * + sizeof(GLfloat)); free(reply); #else - GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetTexGenfv, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&coord), 4); - (void) memcpy((void *)(pc + 4), (void *)(&pname), 4); + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetTexGenfv, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&coord), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); (void) __glXReadReply(dpy, 4, params, GL_FALSE); - UnlockDisplay(dpy); SyncHandle(); + UnlockDisplay(dpy); + SyncHandle(); #endif /* USE_XCB */ } return; @@ -3817,25 +4397,35 @@ __indirect_glGetTexGenfv(GLenum coord, GLenum pname, GLfloat * params) void __indirect_glGetTexGeniv(GLenum coord, GLenum pname, GLint * params) { - __GLXcontext * const gc = __glXGetCurrentContext(); - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; const GLuint cmdlen = 8; if (__builtin_expect(dpy != NULL, 1)) { #ifdef USE_XCB - XCBConnection *c = XCBConnectionOfDisplay(dpy); + xcb_connection_t *c = XGetXCBConnection(dpy); (void) __glXFlushRenderBuffer(gc, gc->pc); - XCBGlxGetTexGenivRep *reply = XCBGlxGetTexGenivReply(c, XCBGlxGetTexGeniv(c, gc->currentContextTag, coord, pname), NULL); - if (XCBGlxGetTexGenivDataLength(reply) == 0) - (void)memcpy(params, &reply->datum, sizeof(reply->datum)); + xcb_glx_get_tex_geniv_reply_t *reply = + xcb_glx_get_tex_geniv_reply(c, + xcb_glx_get_tex_geniv(c, + gc-> + currentContextTag, + coord, pname), + NULL); + if (xcb_glx_get_tex_geniv_data_length(reply) == 0) + (void) memcpy(params, &reply->datum, sizeof(reply->datum)); else - (void)memcpy(params, XCBGlxGetTexGenivData(reply), XCBGlxGetTexGenivDataLength(reply) * sizeof(GLint)); + (void) memcpy(params, xcb_glx_get_tex_geniv_data(reply), + xcb_glx_get_tex_geniv_data_length(reply) * + sizeof(GLint)); free(reply); #else - GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetTexGeniv, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&coord), 4); - (void) memcpy((void *)(pc + 4), (void *)(&pname), 4); + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetTexGeniv, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&coord), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); (void) __glXReadReply(dpy, 4, params, GL_FALSE); - UnlockDisplay(dpy); SyncHandle(); + UnlockDisplay(dpy); + SyncHandle(); #endif /* USE_XCB */ } return; @@ -3843,29 +4433,45 @@ __indirect_glGetTexGeniv(GLenum coord, GLenum pname, GLint * params) #define X_GLsop_GetTexImage 135 void -__indirect_glGetTexImage(GLenum target, GLint level, GLenum format, GLenum type, GLvoid * pixels) +__indirect_glGetTexImage(GLenum target, GLint level, GLenum format, + GLenum type, GLvoid * pixels) { - __GLXcontext * const gc = __glXGetCurrentContext(); - const __GLXattribute * const state = gc->client_state_private; - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + const __GLXattribute *const state = gc->client_state_private; + Display *const dpy = gc->currentDpy; const GLuint cmdlen = 20; if (__builtin_expect(dpy != NULL, 1)) { #ifdef USE_XCB - XCBConnection *c = XCBConnectionOfDisplay(dpy); + xcb_connection_t *c = XGetXCBConnection(dpy); (void) __glXFlushRenderBuffer(gc, gc->pc); - XCBGlxGetTexImageRep *reply = XCBGlxGetTexImageReply(c, XCBGlxGetTexImage(c, gc->currentContextTag, target, level, format, type, state->storePack.swapEndian), NULL); - (void)memcpy(pixels, XCBGlxGetTexImageData(reply), XCBGlxGetTexImageDataLength(reply) * sizeof(GLvoid)); + xcb_glx_get_tex_image_reply_t *reply = + xcb_glx_get_tex_image_reply(c, + xcb_glx_get_tex_image(c, + gc-> + currentContextTag, + target, level, + format, type, + state-> + storePack. + swapEndian), + NULL); + (void) memcpy(pixels, xcb_glx_get_tex_image_data(reply), + xcb_glx_get_tex_image_data_length(reply) * + sizeof(GLvoid)); free(reply); #else - GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetTexImage, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&target), 4); - (void) memcpy((void *)(pc + 4), (void *)(&level), 4); - (void) memcpy((void *)(pc + 8), (void *)(&format), 4); - (void) memcpy((void *)(pc + 12), (void *)(&type), 4); - *(int32_t *)(pc + 16) = 0; - * (int8_t *)(pc + 16) = state->storePack.swapEndian; - __glXReadPixelReply(dpy, gc, 3, 0, 0, 0, format, type, pixels, GL_TRUE); - UnlockDisplay(dpy); SyncHandle(); + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetTexImage, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&level), 4); + (void) memcpy((void *) (pc + 8), (void *) (&format), 4); + (void) memcpy((void *) (pc + 12), (void *) (&type), 4); + *(int32_t *) (pc + 16) = 0; + *(int8_t *) (pc + 16) = state->storePack.swapEndian; + __glXReadPixelReply(dpy, gc, 3, 0, 0, 0, format, type, pixels, + GL_TRUE); + UnlockDisplay(dpy); + SyncHandle(); #endif /* USE_XCB */ } return; @@ -3875,25 +4481,36 @@ __indirect_glGetTexImage(GLenum target, GLint level, GLenum format, GLenum type, void __indirect_glGetTexParameterfv(GLenum target, GLenum pname, GLfloat * params) { - __GLXcontext * const gc = __glXGetCurrentContext(); - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; const GLuint cmdlen = 8; if (__builtin_expect(dpy != NULL, 1)) { #ifdef USE_XCB - XCBConnection *c = XCBConnectionOfDisplay(dpy); + xcb_connection_t *c = XGetXCBConnection(dpy); (void) __glXFlushRenderBuffer(gc, gc->pc); - XCBGlxGetTexParameterfvRep *reply = XCBGlxGetTexParameterfvReply(c, XCBGlxGetTexParameterfv(c, gc->currentContextTag, target, pname), NULL); - if (XCBGlxGetTexParameterfvDataLength(reply) == 0) - (void)memcpy(params, &reply->datum, sizeof(reply->datum)); + xcb_glx_get_tex_parameterfv_reply_t *reply = + xcb_glx_get_tex_parameterfv_reply(c, + xcb_glx_get_tex_parameterfv(c, + gc-> + currentContextTag, + target, + pname), + NULL); + if (xcb_glx_get_tex_parameterfv_data_length(reply) == 0) + (void) memcpy(params, &reply->datum, sizeof(reply->datum)); else - (void)memcpy(params, XCBGlxGetTexParameterfvData(reply), XCBGlxGetTexParameterfvDataLength(reply) * sizeof(GLfloat)); + (void) memcpy(params, xcb_glx_get_tex_parameterfv_data(reply), + xcb_glx_get_tex_parameterfv_data_length(reply) * + sizeof(GLfloat)); free(reply); #else - GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetTexParameterfv, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&target), 4); - (void) memcpy((void *)(pc + 4), (void *)(&pname), 4); + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetTexParameterfv, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); (void) __glXReadReply(dpy, 4, params, GL_FALSE); - UnlockDisplay(dpy); SyncHandle(); + UnlockDisplay(dpy); + SyncHandle(); #endif /* USE_XCB */ } return; @@ -3903,25 +4520,36 @@ __indirect_glGetTexParameterfv(GLenum target, GLenum pname, GLfloat * params) void __indirect_glGetTexParameteriv(GLenum target, GLenum pname, GLint * params) { - __GLXcontext * const gc = __glXGetCurrentContext(); - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; const GLuint cmdlen = 8; if (__builtin_expect(dpy != NULL, 1)) { #ifdef USE_XCB - XCBConnection *c = XCBConnectionOfDisplay(dpy); + xcb_connection_t *c = XGetXCBConnection(dpy); (void) __glXFlushRenderBuffer(gc, gc->pc); - XCBGlxGetTexParameterivRep *reply = XCBGlxGetTexParameterivReply(c, XCBGlxGetTexParameteriv(c, gc->currentContextTag, target, pname), NULL); - if (XCBGlxGetTexParameterivDataLength(reply) == 0) - (void)memcpy(params, &reply->datum, sizeof(reply->datum)); + xcb_glx_get_tex_parameteriv_reply_t *reply = + xcb_glx_get_tex_parameteriv_reply(c, + xcb_glx_get_tex_parameteriv(c, + gc-> + currentContextTag, + target, + pname), + NULL); + if (xcb_glx_get_tex_parameteriv_data_length(reply) == 0) + (void) memcpy(params, &reply->datum, sizeof(reply->datum)); else - (void)memcpy(params, XCBGlxGetTexParameterivData(reply), XCBGlxGetTexParameterivDataLength(reply) * sizeof(GLint)); + (void) memcpy(params, xcb_glx_get_tex_parameteriv_data(reply), + xcb_glx_get_tex_parameteriv_data_length(reply) * + sizeof(GLint)); free(reply); #else - GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetTexParameteriv, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&target), 4); - (void) memcpy((void *)(pc + 4), (void *)(&pname), 4); + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetTexParameteriv, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); (void) __glXReadReply(dpy, 4, params, GL_FALSE); - UnlockDisplay(dpy); SyncHandle(); + UnlockDisplay(dpy); + SyncHandle(); #endif /* USE_XCB */ } return; @@ -3929,28 +4557,40 @@ __indirect_glGetTexParameteriv(GLenum target, GLenum pname, GLint * params) #define X_GLsop_GetTexLevelParameterfv 138 void -__indirect_glGetTexLevelParameterfv(GLenum target, GLint level, GLenum pname, GLfloat * params) +__indirect_glGetTexLevelParameterfv(GLenum target, GLint level, GLenum pname, + GLfloat * params) { - __GLXcontext * const gc = __glXGetCurrentContext(); - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; const GLuint cmdlen = 12; if (__builtin_expect(dpy != NULL, 1)) { #ifdef USE_XCB - XCBConnection *c = XCBConnectionOfDisplay(dpy); + xcb_connection_t *c = XGetXCBConnection(dpy); (void) __glXFlushRenderBuffer(gc, gc->pc); - XCBGlxGetTexLevelParameterfvRep *reply = XCBGlxGetTexLevelParameterfvReply(c, XCBGlxGetTexLevelParameterfv(c, gc->currentContextTag, target, level, pname), NULL); - if (XCBGlxGetTexLevelParameterfvDataLength(reply) == 0) - (void)memcpy(params, &reply->datum, sizeof(reply->datum)); + xcb_glx_get_tex_level_parameterfv_reply_t *reply = + xcb_glx_get_tex_level_parameterfv_reply(c, + xcb_glx_get_tex_level_parameterfv + (c, gc->currentContextTag, + target, level, pname), + NULL); + if (xcb_glx_get_tex_level_parameterfv_data_length(reply) == 0) + (void) memcpy(params, &reply->datum, sizeof(reply->datum)); else - (void)memcpy(params, XCBGlxGetTexLevelParameterfvData(reply), XCBGlxGetTexLevelParameterfvDataLength(reply) * sizeof(GLfloat)); + (void) memcpy(params, + xcb_glx_get_tex_level_parameterfv_data(reply), + xcb_glx_get_tex_level_parameterfv_data_length(reply) + * sizeof(GLfloat)); free(reply); #else - GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetTexLevelParameterfv, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&target), 4); - (void) memcpy((void *)(pc + 4), (void *)(&level), 4); - (void) memcpy((void *)(pc + 8), (void *)(&pname), 4); + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetTexLevelParameterfv, + cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&level), 4); + (void) memcpy((void *) (pc + 8), (void *) (&pname), 4); (void) __glXReadReply(dpy, 4, params, GL_FALSE); - UnlockDisplay(dpy); SyncHandle(); + UnlockDisplay(dpy); + SyncHandle(); #endif /* USE_XCB */ } return; @@ -3958,28 +4598,40 @@ __indirect_glGetTexLevelParameterfv(GLenum target, GLint level, GLenum pname, GL #define X_GLsop_GetTexLevelParameteriv 139 void -__indirect_glGetTexLevelParameteriv(GLenum target, GLint level, GLenum pname, GLint * params) +__indirect_glGetTexLevelParameteriv(GLenum target, GLint level, GLenum pname, + GLint * params) { - __GLXcontext * const gc = __glXGetCurrentContext(); - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; const GLuint cmdlen = 12; if (__builtin_expect(dpy != NULL, 1)) { #ifdef USE_XCB - XCBConnection *c = XCBConnectionOfDisplay(dpy); + xcb_connection_t *c = XGetXCBConnection(dpy); (void) __glXFlushRenderBuffer(gc, gc->pc); - XCBGlxGetTexLevelParameterivRep *reply = XCBGlxGetTexLevelParameterivReply(c, XCBGlxGetTexLevelParameteriv(c, gc->currentContextTag, target, level, pname), NULL); - if (XCBGlxGetTexLevelParameterivDataLength(reply) == 0) - (void)memcpy(params, &reply->datum, sizeof(reply->datum)); + xcb_glx_get_tex_level_parameteriv_reply_t *reply = + xcb_glx_get_tex_level_parameteriv_reply(c, + xcb_glx_get_tex_level_parameteriv + (c, gc->currentContextTag, + target, level, pname), + NULL); + if (xcb_glx_get_tex_level_parameteriv_data_length(reply) == 0) + (void) memcpy(params, &reply->datum, sizeof(reply->datum)); else - (void)memcpy(params, XCBGlxGetTexLevelParameterivData(reply), XCBGlxGetTexLevelParameterivDataLength(reply) * sizeof(GLint)); + (void) memcpy(params, + xcb_glx_get_tex_level_parameteriv_data(reply), + xcb_glx_get_tex_level_parameteriv_data_length(reply) + * sizeof(GLint)); free(reply); #else - GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetTexLevelParameteriv, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&target), 4); - (void) memcpy((void *)(pc + 4), (void *)(&level), 4); - (void) memcpy((void *)(pc + 8), (void *)(&pname), 4); + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetTexLevelParameteriv, + cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&level), 4); + (void) memcpy((void *) (pc + 8), (void *) (&pname), 4); (void) __glXReadReply(dpy, 4, params, GL_FALSE); - UnlockDisplay(dpy); SyncHandle(); + UnlockDisplay(dpy); + SyncHandle(); #endif /* USE_XCB */ } return; @@ -3989,22 +4641,27 @@ __indirect_glGetTexLevelParameteriv(GLenum target, GLint level, GLenum pname, GL GLboolean __indirect_glIsList(GLuint list) { - __GLXcontext * const gc = __glXGetCurrentContext(); - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; GLboolean retval = (GLboolean) 0; const GLuint cmdlen = 4; if (__builtin_expect(dpy != NULL, 1)) { #ifdef USE_XCB - XCBConnection *c = XCBConnectionOfDisplay(dpy); + xcb_connection_t *c = XGetXCBConnection(dpy); (void) __glXFlushRenderBuffer(gc, gc->pc); - XCBGlxIsListRep *reply = XCBGlxIsListReply(c, XCBGlxIsList(c, gc->currentContextTag, list), NULL); + xcb_glx_is_list_reply_t *reply = + xcb_glx_is_list_reply(c, + xcb_glx_is_list(c, gc->currentContextTag, + list), NULL); retval = reply->ret_val; free(reply); #else - GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_IsList, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&list), 4); + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_IsList, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&list), 4); retval = (GLboolean) __glXReadReply(dpy, 0, NULL, GL_FALSE); - UnlockDisplay(dpy); SyncHandle(); + UnlockDisplay(dpy); + SyncHandle(); #endif /* USE_XCB */ } return retval; @@ -4014,1881 +4671,2779 @@ __indirect_glIsList(GLuint list) void __indirect_glDepthRange(GLclampd zNear, GLclampd zFar) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_DepthRange, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&zNear), 8); - (void) memcpy((void *)(gc->pc + 12), (void *)(&zFar), 8); + (void) memcpy((void *) (gc->pc + 4), (void *) (&zNear), 8); + (void) memcpy((void *) (gc->pc + 12), (void *) (&zFar), 8); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Frustum 175 void -__indirect_glFrustum(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar) +__indirect_glFrustum(GLdouble left, GLdouble right, GLdouble bottom, + GLdouble top, GLdouble zNear, GLdouble zFar) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 52; emit_header(gc->pc, X_GLrop_Frustum, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&left), 8); - (void) memcpy((void *)(gc->pc + 12), (void *)(&right), 8); - (void) memcpy((void *)(gc->pc + 20), (void *)(&bottom), 8); - (void) memcpy((void *)(gc->pc + 28), (void *)(&top), 8); - (void) memcpy((void *)(gc->pc + 36), (void *)(&zNear), 8); - (void) memcpy((void *)(gc->pc + 44), (void *)(&zFar), 8); - gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + (void) memcpy((void *) (gc->pc + 4), (void *) (&left), 8); + (void) memcpy((void *) (gc->pc + 12), (void *) (&right), 8); + (void) memcpy((void *) (gc->pc + 20), (void *) (&bottom), 8); + (void) memcpy((void *) (gc->pc + 28), (void *) (&top), 8); + (void) memcpy((void *) (gc->pc + 36), (void *) (&zNear), 8); + (void) memcpy((void *) (gc->pc + 44), (void *) (&zFar), 8); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_LoadIdentity 176 void __indirect_glLoadIdentity(void) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 4; emit_header(gc->pc, X_GLrop_LoadIdentity, cmdlen); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_LoadMatrixf 177 void __indirect_glLoadMatrixf(const GLfloat * m) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 68; emit_header(gc->pc, X_GLrop_LoadMatrixf, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(m), 64); + (void) memcpy((void *) (gc->pc + 4), (void *) (m), 64); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_LoadMatrixd 178 void __indirect_glLoadMatrixd(const GLdouble * m) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 132; emit_header(gc->pc, X_GLrop_LoadMatrixd, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(m), 128); + (void) memcpy((void *) (gc->pc + 4), (void *) (m), 128); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_MatrixMode 179 void __indirect_glMatrixMode(GLenum mode) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_MatrixMode, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&mode), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&mode), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_MultMatrixf 180 void __indirect_glMultMatrixf(const GLfloat * m) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 68; emit_header(gc->pc, X_GLrop_MultMatrixf, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(m), 64); + (void) memcpy((void *) (gc->pc + 4), (void *) (m), 64); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_MultMatrixd 181 void __indirect_glMultMatrixd(const GLdouble * m) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 132; emit_header(gc->pc, X_GLrop_MultMatrixd, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(m), 128); + (void) memcpy((void *) (gc->pc + 4), (void *) (m), 128); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Ortho 182 void -__indirect_glOrtho(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar) +__indirect_glOrtho(GLdouble left, GLdouble right, GLdouble bottom, + GLdouble top, GLdouble zNear, GLdouble zFar) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 52; emit_header(gc->pc, X_GLrop_Ortho, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&left), 8); - (void) memcpy((void *)(gc->pc + 12), (void *)(&right), 8); - (void) memcpy((void *)(gc->pc + 20), (void *)(&bottom), 8); - (void) memcpy((void *)(gc->pc + 28), (void *)(&top), 8); - (void) memcpy((void *)(gc->pc + 36), (void *)(&zNear), 8); - (void) memcpy((void *)(gc->pc + 44), (void *)(&zFar), 8); - gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + (void) memcpy((void *) (gc->pc + 4), (void *) (&left), 8); + (void) memcpy((void *) (gc->pc + 12), (void *) (&right), 8); + (void) memcpy((void *) (gc->pc + 20), (void *) (&bottom), 8); + (void) memcpy((void *) (gc->pc + 28), (void *) (&top), 8); + (void) memcpy((void *) (gc->pc + 36), (void *) (&zNear), 8); + (void) memcpy((void *) (gc->pc + 44), (void *) (&zFar), 8); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_PopMatrix 183 void __indirect_glPopMatrix(void) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 4; emit_header(gc->pc, X_GLrop_PopMatrix, cmdlen); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_PushMatrix 184 void __indirect_glPushMatrix(void) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 4; emit_header(gc->pc, X_GLrop_PushMatrix, cmdlen); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Rotated 185 void __indirect_glRotated(GLdouble angle, GLdouble x, GLdouble y, GLdouble z) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 36; emit_header(gc->pc, X_GLrop_Rotated, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&angle), 8); - (void) memcpy((void *)(gc->pc + 12), (void *)(&x), 8); - (void) memcpy((void *)(gc->pc + 20), (void *)(&y), 8); - (void) memcpy((void *)(gc->pc + 28), (void *)(&z), 8); + (void) memcpy((void *) (gc->pc + 4), (void *) (&angle), 8); + (void) memcpy((void *) (gc->pc + 12), (void *) (&x), 8); + (void) memcpy((void *) (gc->pc + 20), (void *) (&y), 8); + (void) memcpy((void *) (gc->pc + 28), (void *) (&z), 8); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Rotatef 186 void __indirect_glRotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_Rotatef, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&angle), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&x), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&y), 4); - (void) memcpy((void *)(gc->pc + 16), (void *)(&z), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&angle), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&y), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&z), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Scaled 187 void __indirect_glScaled(GLdouble x, GLdouble y, GLdouble z) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 28; emit_header(gc->pc, X_GLrop_Scaled, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&x), 8); - (void) memcpy((void *)(gc->pc + 12), (void *)(&y), 8); - (void) memcpy((void *)(gc->pc + 20), (void *)(&z), 8); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 8); + (void) memcpy((void *) (gc->pc + 12), (void *) (&y), 8); + (void) memcpy((void *) (gc->pc + 20), (void *) (&z), 8); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Scalef 188 void __indirect_glScalef(GLfloat x, GLfloat y, GLfloat z) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_Scalef, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&x), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&y), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&z), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&y), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&z), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Translated 189 void __indirect_glTranslated(GLdouble x, GLdouble y, GLdouble z) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 28; emit_header(gc->pc, X_GLrop_Translated, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&x), 8); - (void) memcpy((void *)(gc->pc + 12), (void *)(&y), 8); - (void) memcpy((void *)(gc->pc + 20), (void *)(&z), 8); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 8); + (void) memcpy((void *) (gc->pc + 12), (void *) (&y), 8); + (void) memcpy((void *) (gc->pc + 20), (void *) (&z), 8); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Translatef 190 void __indirect_glTranslatef(GLfloat x, GLfloat y, GLfloat z) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_Translatef, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&x), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&y), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&z), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&y), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&z), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Viewport 191 void __indirect_glViewport(GLint x, GLint y, GLsizei width, GLsizei height) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_Viewport, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&x), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&y), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&width), 4); - (void) memcpy((void *)(gc->pc + 16), (void *)(&height), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&y), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&width), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&height), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_BindTexture 4117 void __indirect_glBindTexture(GLenum target, GLuint texture) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_BindTexture, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&texture), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&texture), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Indexubv 194 void __indirect_glIndexub(GLubyte c) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_Indexubv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&c), 1); + (void) memcpy((void *) (gc->pc + 4), (void *) (&c), 1); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Indexubv 194 void __indirect_glIndexubv(const GLubyte * c) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_Indexubv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(c), 1); + (void) memcpy((void *) (gc->pc + 4), (void *) (c), 1); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_PolygonOffset 192 void __indirect_glPolygonOffset(GLfloat factor, GLfloat units) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_PolygonOffset, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&factor), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&units), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&factor), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&units), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLsop_AreTexturesResident 143 GLboolean -__indirect_glAreTexturesResident(GLsizei n, const GLuint * textures, GLboolean * residences) +__indirect_glAreTexturesResident(GLsizei n, const GLuint * textures, + GLboolean * residences) { - __GLXcontext * const gc = __glXGetCurrentContext(); - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; GLboolean retval = (GLboolean) 0; const GLuint cmdlen = 4 + __GLX_PAD((n * 4)); if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) { #ifdef USE_XCB - XCBConnection *c = XCBConnectionOfDisplay(dpy); + xcb_connection_t *c = XGetXCBConnection(dpy); (void) __glXFlushRenderBuffer(gc, gc->pc); - XCBGlxAreTexturesResidentRep *reply = XCBGlxAreTexturesResidentReply(c, XCBGlxAreTexturesResident(c, gc->currentContextTag, n, textures), NULL); - (void)memcpy(residences, XCBGlxAreTexturesResidentData(reply), XCBGlxAreTexturesResidentDataLength(reply) * sizeof(GLboolean)); + xcb_glx_are_textures_resident_reply_t *reply = + xcb_glx_are_textures_resident_reply(c, + xcb_glx_are_textures_resident + (c, gc->currentContextTag, n, + textures), NULL); + (void) memcpy(residences, xcb_glx_are_textures_resident_data(reply), + xcb_glx_are_textures_resident_data_length(reply) * + sizeof(GLboolean)); retval = reply->ret_val; free(reply); #else - GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_AreTexturesResident, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&n), 4); - (void) memcpy((void *)(pc + 4), (void *)(textures), (n * 4)); + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_AreTexturesResident, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&n), 4); + (void) memcpy((void *) (pc + 4), (void *) (textures), (n * 4)); retval = (GLboolean) __glXReadReply(dpy, 1, residences, GL_TRUE); - UnlockDisplay(dpy); SyncHandle(); + UnlockDisplay(dpy); + SyncHandle(); #endif /* USE_XCB */ } return retval; } +#define X_GLvop_AreTexturesResidentEXT 11 +GLboolean +glAreTexturesResidentEXT(GLsizei n, const GLuint * textures, + GLboolean * residences) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + + if (gc->isDirect) { + return CALL_AreTexturesResident(GET_DISPATCH(), + (n, textures, residences)); + } else { + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; + GLboolean retval = (GLboolean) 0; + const GLuint cmdlen = 4 + __GLX_PAD((n * 4)); + if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) { + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_AreTexturesResidentEXT, + cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&n), 4); + (void) memcpy((void *) (pc + 4), (void *) (textures), (n * 4)); + retval = (GLboolean) __glXReadReply(dpy, 1, residences, GL_TRUE); + UnlockDisplay(dpy); + SyncHandle(); + } + return retval; + } +} + #define X_GLrop_CopyTexImage1D 4119 void -__indirect_glCopyTexImage1D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border) +__indirect_glCopyTexImage1D(GLenum target, GLint level, GLenum internalformat, + GLint x, GLint y, GLsizei width, GLint border) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 32; emit_header(gc->pc, X_GLrop_CopyTexImage1D, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&level), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&internalformat), 4); - (void) memcpy((void *)(gc->pc + 16), (void *)(&x), 4); - (void) memcpy((void *)(gc->pc + 20), (void *)(&y), 4); - (void) memcpy((void *)(gc->pc + 24), (void *)(&width), 4); - (void) memcpy((void *)(gc->pc + 28), (void *)(&border), 4); - gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&level), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&internalformat), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 20), (void *) (&y), 4); + (void) memcpy((void *) (gc->pc + 24), (void *) (&width), 4); + (void) memcpy((void *) (gc->pc + 28), (void *) (&border), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_CopyTexImage2D 4120 void -__indirect_glCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) +__indirect_glCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, + GLint x, GLint y, GLsizei width, GLsizei height, + GLint border) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 36; emit_header(gc->pc, X_GLrop_CopyTexImage2D, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&level), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&internalformat), 4); - (void) memcpy((void *)(gc->pc + 16), (void *)(&x), 4); - (void) memcpy((void *)(gc->pc + 20), (void *)(&y), 4); - (void) memcpy((void *)(gc->pc + 24), (void *)(&width), 4); - (void) memcpy((void *)(gc->pc + 28), (void *)(&height), 4); - (void) memcpy((void *)(gc->pc + 32), (void *)(&border), 4); - gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&level), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&internalformat), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 20), (void *) (&y), 4); + (void) memcpy((void *) (gc->pc + 24), (void *) (&width), 4); + (void) memcpy((void *) (gc->pc + 28), (void *) (&height), 4); + (void) memcpy((void *) (gc->pc + 32), (void *) (&border), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_CopyTexSubImage1D 4121 void -__indirect_glCopyTexSubImage1D(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width) +__indirect_glCopyTexSubImage1D(GLenum target, GLint level, GLint xoffset, + GLint x, GLint y, GLsizei width) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 28; emit_header(gc->pc, X_GLrop_CopyTexSubImage1D, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&level), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&xoffset), 4); - (void) memcpy((void *)(gc->pc + 16), (void *)(&x), 4); - (void) memcpy((void *)(gc->pc + 20), (void *)(&y), 4); - (void) memcpy((void *)(gc->pc + 24), (void *)(&width), 4); - gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&level), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&xoffset), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 20), (void *) (&y), 4); + (void) memcpy((void *) (gc->pc + 24), (void *) (&width), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_CopyTexSubImage2D 4122 void -__indirect_glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) +__indirect_glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, + GLint yoffset, GLint x, GLint y, GLsizei width, + GLsizei height) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 36; emit_header(gc->pc, X_GLrop_CopyTexSubImage2D, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&level), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&xoffset), 4); - (void) memcpy((void *)(gc->pc + 16), (void *)(&yoffset), 4); - (void) memcpy((void *)(gc->pc + 20), (void *)(&x), 4); - (void) memcpy((void *)(gc->pc + 24), (void *)(&y), 4); - (void) memcpy((void *)(gc->pc + 28), (void *)(&width), 4); - (void) memcpy((void *)(gc->pc + 32), (void *)(&height), 4); - gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&level), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&xoffset), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&yoffset), 4); + (void) memcpy((void *) (gc->pc + 20), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 24), (void *) (&y), 4); + (void) memcpy((void *) (gc->pc + 28), (void *) (&width), 4); + (void) memcpy((void *) (gc->pc + 32), (void *) (&height), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } -#define X_GLvop_DeleteTextures 12 +#define X_GLsop_DeleteTextures 144 void __indirect_glDeleteTextures(GLsizei n, const GLuint * textures) { - __GLXcontext * const gc = __glXGetCurrentContext(); - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; const GLuint cmdlen = 4 + __GLX_PAD((n * 4)); if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) { - GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivate, X_GLvop_DeleteTextures, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&n), 4); - (void) memcpy((void *)(pc + 4), (void *)(textures), (n * 4)); - UnlockDisplay(dpy); SyncHandle(); +#ifdef USE_XCB + xcb_connection_t *c = XGetXCBConnection(dpy); + (void) __glXFlushRenderBuffer(gc, gc->pc); + xcb_glx_delete_textures(c, gc->currentContextTag, n, textures); +#else + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_DeleteTextures, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&n), 4); + (void) memcpy((void *) (pc + 4), (void *) (textures), (n * 4)); + UnlockDisplay(dpy); + SyncHandle(); +#endif /* USE_XCB */ } return; } +#define X_GLvop_DeleteTexturesEXT 12 +void +glDeleteTexturesEXT(GLsizei n, const GLuint * textures) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + + if (gc->isDirect) { + CALL_DeleteTextures(GET_DISPATCH(), (n, textures)); + } else { + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; + const GLuint cmdlen = 4 + __GLX_PAD((n * 4)); + if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) { + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivate, + X_GLvop_DeleteTexturesEXT, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&n), 4); + (void) memcpy((void *) (pc + 4), (void *) (textures), (n * 4)); + UnlockDisplay(dpy); + SyncHandle(); + } + return; + } +} + #define X_GLsop_GenTextures 145 void __indirect_glGenTextures(GLsizei n, GLuint * textures) { - __GLXcontext * const gc = __glXGetCurrentContext(); - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; const GLuint cmdlen = 4; if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) { #ifdef USE_XCB - XCBConnection *c = XCBConnectionOfDisplay(dpy); + xcb_connection_t *c = XGetXCBConnection(dpy); (void) __glXFlushRenderBuffer(gc, gc->pc); - XCBGlxGenTexturesRep *reply = XCBGlxGenTexturesReply(c, XCBGlxGenTextures(c, gc->currentContextTag, n), NULL); - (void)memcpy(textures, XCBGlxGenTexturesData(reply), XCBGlxGenTexturesDataLength(reply) * sizeof(GLuint)); + xcb_glx_gen_textures_reply_t *reply = + xcb_glx_gen_textures_reply(c, + xcb_glx_gen_textures(c, + gc-> + currentContextTag, + n), NULL); + (void) memcpy(textures, xcb_glx_gen_textures_data(reply), + xcb_glx_gen_textures_data_length(reply) * + sizeof(GLuint)); free(reply); #else - GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GenTextures, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&n), 4); + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GenTextures, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&n), 4); (void) __glXReadReply(dpy, 4, textures, GL_TRUE); - UnlockDisplay(dpy); SyncHandle(); + UnlockDisplay(dpy); + SyncHandle(); #endif /* USE_XCB */ } return; } +#define X_GLvop_GenTexturesEXT 13 +void +glGenTexturesEXT(GLsizei n, GLuint * textures) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + + if (gc->isDirect) { + CALL_GenTextures(GET_DISPATCH(), (n, textures)); + } else { + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; + const GLuint cmdlen = 4; + if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) { + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_GenTexturesEXT, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&n), 4); + (void) __glXReadReply(dpy, 4, textures, GL_TRUE); + UnlockDisplay(dpy); + SyncHandle(); + } + return; + } +} + #define X_GLsop_IsTexture 146 GLboolean __indirect_glIsTexture(GLuint texture) { - __GLXcontext * const gc = __glXGetCurrentContext(); - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; GLboolean retval = (GLboolean) 0; const GLuint cmdlen = 4; if (__builtin_expect(dpy != NULL, 1)) { #ifdef USE_XCB - XCBConnection *c = XCBConnectionOfDisplay(dpy); + xcb_connection_t *c = XGetXCBConnection(dpy); (void) __glXFlushRenderBuffer(gc, gc->pc); - XCBGlxIsTextureRep *reply = XCBGlxIsTextureReply(c, XCBGlxIsTexture(c, gc->currentContextTag, texture), NULL); + xcb_glx_is_texture_reply_t *reply = + xcb_glx_is_texture_reply(c, + xcb_glx_is_texture(c, + gc->currentContextTag, + texture), NULL); retval = reply->ret_val; free(reply); #else - GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_IsTexture, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&texture), 4); + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_IsTexture, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&texture), 4); retval = (GLboolean) __glXReadReply(dpy, 0, NULL, GL_FALSE); - UnlockDisplay(dpy); SyncHandle(); + UnlockDisplay(dpy); + SyncHandle(); #endif /* USE_XCB */ } return retval; } +#define X_GLvop_IsTextureEXT 14 +GLboolean +glIsTextureEXT(GLuint texture) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + + if (gc->isDirect) { + return CALL_IsTexture(GET_DISPATCH(), (texture)); + } else { + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; + GLboolean retval = (GLboolean) 0; + const GLuint cmdlen = 4; + if (__builtin_expect(dpy != NULL, 1)) { + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_IsTextureEXT, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&texture), 4); + retval = (GLboolean) __glXReadReply(dpy, 0, NULL, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); + } + return retval; + } +} + #define X_GLrop_PrioritizeTextures 4118 void -__indirect_glPrioritizeTextures(GLsizei n, const GLuint * textures, const GLclampf * priorities) +__indirect_glPrioritizeTextures(GLsizei n, const GLuint * textures, + const GLclampf * priorities) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8 + __GLX_PAD((n * 4)) + __GLX_PAD((n * 4)); if (__builtin_expect(n >= 0, 1)) { emit_header(gc->pc, X_GLrop_PrioritizeTextures, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&n), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(textures), (n * 4)); - (void) memcpy((void *)(gc->pc + 8 + (n * 4)), (void *)(priorities), (n * 4)); + (void) memcpy((void *) (gc->pc + 4), (void *) (&n), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (textures), (n * 4)); + (void) memcpy((void *) (gc->pc + 8 + (n * 4)), (void *) (priorities), + (n * 4)); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } } static void -__glx_TexSubImage_1D2D( unsigned opcode, unsigned dim, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels ) -{ - __GLXcontext * const gc = __glXGetCurrentContext(); - const GLuint compsize = (pixels != NULL) ? __glImageSize(width, height, 1, format, type, target) : 0; +__glx_TexSubImage_1D2D(unsigned opcode, unsigned dim, GLenum target, + GLint level, GLint xoffset, GLint yoffset, + GLsizei width, GLsizei height, GLenum format, + GLenum type, const GLvoid * pixels) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint compsize = + (pixels != NULL) ? __glImageSize(width, height, 1, format, type, + target) : 0; const GLuint cmdlen = 60 + __GLX_PAD(compsize); if (__builtin_expect(gc->currentDpy != NULL, 1)) { if (cmdlen <= gc->maxSmallRenderCommandSize) { - if ( (gc->pc + cmdlen) > gc->bufEnd ) { + if ((gc->pc + cmdlen) > gc->bufEnd) { (void) __glXFlushRenderBuffer(gc, gc->pc); } emit_header(gc->pc, opcode, cmdlen); - (void) memcpy((void *)(gc->pc + 24), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 28), (void *)(&level), 4); - (void) memcpy((void *)(gc->pc + 32), (void *)(&xoffset), 4); - (void) memcpy((void *)(gc->pc + 36), (void *)(&yoffset), 4); - (void) memcpy((void *)(gc->pc + 40), (void *)(&width), 4); - (void) memcpy((void *)(gc->pc + 44), (void *)(&height), 4); - (void) memcpy((void *)(gc->pc + 48), (void *)(&format), 4); - (void) memcpy((void *)(gc->pc + 52), (void *)(&type), 4); - (void) memcpy((void *)(gc->pc + 56), (void *)((pixels == NULL) ? one : zero), 4); + (void) memcpy((void *) (gc->pc + 24), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 28), (void *) (&level), 4); + (void) memcpy((void *) (gc->pc + 32), (void *) (&xoffset), 4); + (void) memcpy((void *) (gc->pc + 36), (void *) (&yoffset), 4); + (void) memcpy((void *) (gc->pc + 40), (void *) (&width), 4); + (void) memcpy((void *) (gc->pc + 44), (void *) (&height), 4); + (void) memcpy((void *) (gc->pc + 48), (void *) (&format), 4); + (void) memcpy((void *) (gc->pc + 52), (void *) (&type), 4); + (void) memcpy((void *) (gc->pc + 56), + (void *) ((pixels == NULL) ? one : zero), 4); if (compsize > 0) { - (*gc->fillImage)(gc, dim, width, height, 1, format, type, pixels, gc->pc + 60, gc->pc + 4); - } - else { - (void) memcpy( gc->pc + 4, default_pixel_store_2D, default_pixel_store_2D_size ); + (*gc->fillImage) (gc, dim, width, height, 1, format, type, + pixels, gc->pc + 60, gc->pc + 4); + } else { + (void) memcpy(gc->pc + 4, default_pixel_store_2D, + default_pixel_store_2D_size); } gc->pc += cmdlen; - if (gc->pc > gc->limit) { (void) __glXFlushRenderBuffer(gc, gc->pc); } - } - else { + if (gc->pc > gc->limit) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + } else { const GLint op = opcode; const GLuint cmdlenLarge = cmdlen + 4; - GLubyte * const pc = __glXFlushRenderBuffer(gc, gc->pc); - (void) memcpy((void *)(pc + 0), (void *)(&cmdlenLarge), 4); - (void) memcpy((void *)(pc + 4), (void *)(&op), 4); - (void) memcpy((void *)(pc + 28), (void *)(&target), 4); - (void) memcpy((void *)(pc + 32), (void *)(&level), 4); - (void) memcpy((void *)(pc + 36), (void *)(&xoffset), 4); - (void) memcpy((void *)(pc + 40), (void *)(&yoffset), 4); - (void) memcpy((void *)(pc + 44), (void *)(&width), 4); - (void) memcpy((void *)(pc + 48), (void *)(&height), 4); - (void) memcpy((void *)(pc + 52), (void *)(&format), 4); - (void) memcpy((void *)(pc + 56), (void *)(&type), 4); - (void) memcpy((void *)(pc + 60), zero, 4); - __glXSendLargeImage(gc, compsize, dim, width, height, 1, format, type, pixels, pc + 64, pc + 8); + GLubyte *const pc = __glXFlushRenderBuffer(gc, gc->pc); + (void) memcpy((void *) (pc + 0), (void *) (&cmdlenLarge), 4); + (void) memcpy((void *) (pc + 4), (void *) (&op), 4); + (void) memcpy((void *) (pc + 28), (void *) (&target), 4); + (void) memcpy((void *) (pc + 32), (void *) (&level), 4); + (void) memcpy((void *) (pc + 36), (void *) (&xoffset), 4); + (void) memcpy((void *) (pc + 40), (void *) (&yoffset), 4); + (void) memcpy((void *) (pc + 44), (void *) (&width), 4); + (void) memcpy((void *) (pc + 48), (void *) (&height), 4); + (void) memcpy((void *) (pc + 52), (void *) (&format), 4); + (void) memcpy((void *) (pc + 56), (void *) (&type), 4); + (void) memcpy((void *) (pc + 60), zero, 4); + __glXSendLargeImage(gc, compsize, dim, width, height, 1, format, + type, pixels, pc + 64, pc + 8); } } } #define X_GLrop_TexSubImage1D 4099 void -__indirect_glTexSubImage1D(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid * pixels) +__indirect_glTexSubImage1D(GLenum target, GLint level, GLint xoffset, + GLsizei width, GLenum format, GLenum type, + const GLvoid * pixels) { - __glx_TexSubImage_1D2D(X_GLrop_TexSubImage1D, 1, target, level, xoffset, 1, width, 1, format, type, pixels ); + __glx_TexSubImage_1D2D(X_GLrop_TexSubImage1D, 1, target, level, xoffset, + 1, width, 1, format, type, pixels); } #define X_GLrop_TexSubImage2D 4100 void -__indirect_glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels) +__indirect_glTexSubImage2D(GLenum target, GLint level, GLint xoffset, + GLint yoffset, GLsizei width, GLsizei height, + GLenum format, GLenum type, const GLvoid * pixels) { - __glx_TexSubImage_1D2D(X_GLrop_TexSubImage2D, 2, target, level, xoffset, yoffset, width, height, format, type, pixels ); + __glx_TexSubImage_1D2D(X_GLrop_TexSubImage2D, 2, target, level, xoffset, + yoffset, width, height, format, type, pixels); } #define X_GLrop_BlendColor 4096 void -__indirect_glBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) +__indirect_glBlendColor(GLclampf red, GLclampf green, GLclampf blue, + GLclampf alpha) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_BlendColor, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&red), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&green), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&blue), 4); - (void) memcpy((void *)(gc->pc + 16), (void *)(&alpha), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&green), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&blue), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&alpha), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_BlendEquation 4097 void __indirect_glBlendEquation(GLenum mode) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_BlendEquation, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&mode), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&mode), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_ColorTable 2053 void -__indirect_glColorTable(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * table) +__indirect_glColorTable(GLenum target, GLenum internalformat, GLsizei width, + GLenum format, GLenum type, const GLvoid * table) { - __GLXcontext * const gc = __glXGetCurrentContext(); - const GLuint compsize = (table != NULL) ? __glImageSize(width, 1, 1, format, type, target) : 0; + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint compsize = + (table != NULL) ? __glImageSize(width, 1, 1, format, type, + target) : 0; const GLuint cmdlen = 44 + __GLX_PAD(compsize); if (__builtin_expect(gc->currentDpy != NULL, 1)) { if (cmdlen <= gc->maxSmallRenderCommandSize) { - if ( (gc->pc + cmdlen) > gc->bufEnd ) { + if ((gc->pc + cmdlen) > gc->bufEnd) { (void) __glXFlushRenderBuffer(gc, gc->pc); } emit_header(gc->pc, X_GLrop_ColorTable, cmdlen); - (void) memcpy((void *)(gc->pc + 24), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 28), (void *)(&internalformat), 4); - (void) memcpy((void *)(gc->pc + 32), (void *)(&width), 4); - (void) memcpy((void *)(gc->pc + 36), (void *)(&format), 4); - (void) memcpy((void *)(gc->pc + 40), (void *)(&type), 4); + (void) memcpy((void *) (gc->pc + 24), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 28), (void *) (&internalformat), + 4); + (void) memcpy((void *) (gc->pc + 32), (void *) (&width), 4); + (void) memcpy((void *) (gc->pc + 36), (void *) (&format), 4); + (void) memcpy((void *) (gc->pc + 40), (void *) (&type), 4); if (compsize > 0) { - (*gc->fillImage)(gc, 1, width, 1, 1, format, type, table, gc->pc + 44, gc->pc + 4); - } - else { - (void) memcpy( gc->pc + 4, default_pixel_store_1D, default_pixel_store_1D_size ); + (*gc->fillImage) (gc, 1, width, 1, 1, format, type, table, + gc->pc + 44, gc->pc + 4); + } else { + (void) memcpy(gc->pc + 4, default_pixel_store_1D, + default_pixel_store_1D_size); } gc->pc += cmdlen; - if (gc->pc > gc->limit) { (void) __glXFlushRenderBuffer(gc, gc->pc); } - } - else { + if (gc->pc > gc->limit) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + } else { const GLint op = X_GLrop_ColorTable; const GLuint cmdlenLarge = cmdlen + 4; - GLubyte * const pc = __glXFlushRenderBuffer(gc, gc->pc); - (void) memcpy((void *)(pc + 0), (void *)(&cmdlenLarge), 4); - (void) memcpy((void *)(pc + 4), (void *)(&op), 4); - (void) memcpy((void *)(pc + 28), (void *)(&target), 4); - (void) memcpy((void *)(pc + 32), (void *)(&internalformat), 4); - (void) memcpy((void *)(pc + 36), (void *)(&width), 4); - (void) memcpy((void *)(pc + 40), (void *)(&format), 4); - (void) memcpy((void *)(pc + 44), (void *)(&type), 4); - __glXSendLargeImage(gc, compsize, 1, width, 1, 1, format, type, table, pc + 48, pc + 8); + GLubyte *const pc = __glXFlushRenderBuffer(gc, gc->pc); + (void) memcpy((void *) (pc + 0), (void *) (&cmdlenLarge), 4); + (void) memcpy((void *) (pc + 4), (void *) (&op), 4); + (void) memcpy((void *) (pc + 28), (void *) (&target), 4); + (void) memcpy((void *) (pc + 32), (void *) (&internalformat), 4); + (void) memcpy((void *) (pc + 36), (void *) (&width), 4); + (void) memcpy((void *) (pc + 40), (void *) (&format), 4); + (void) memcpy((void *) (pc + 44), (void *) (&type), 4); + __glXSendLargeImage(gc, compsize, 1, width, 1, 1, format, type, + table, pc + 48, pc + 8); } } } #define X_GLrop_ColorTableParameterfv 2054 void -__indirect_glColorTableParameterfv(GLenum target, GLenum pname, const GLfloat * params) +__indirect_glColorTableParameterfv(GLenum target, GLenum pname, + const GLfloat * params) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint compsize = __glColorTableParameterfv_size(pname); const GLuint cmdlen = 12 + __GLX_PAD((compsize * 4)); emit_header(gc->pc, X_GLrop_ColorTableParameterfv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(params), (compsize * 4)); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (params), (compsize * 4)); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_ColorTableParameteriv 2055 void -__indirect_glColorTableParameteriv(GLenum target, GLenum pname, const GLint * params) +__indirect_glColorTableParameteriv(GLenum target, GLenum pname, + const GLint * params) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint compsize = __glColorTableParameteriv_size(pname); const GLuint cmdlen = 12 + __GLX_PAD((compsize * 4)); emit_header(gc->pc, X_GLrop_ColorTableParameteriv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(params), (compsize * 4)); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (params), (compsize * 4)); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_CopyColorTable 2056 void -__indirect_glCopyColorTable(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width) +__indirect_glCopyColorTable(GLenum target, GLenum internalformat, GLint x, + GLint y, GLsizei width) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 24; emit_header(gc->pc, X_GLrop_CopyColorTable, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&internalformat), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&x), 4); - (void) memcpy((void *)(gc->pc + 16), (void *)(&y), 4); - (void) memcpy((void *)(gc->pc + 20), (void *)(&width), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&internalformat), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&y), 4); + (void) memcpy((void *) (gc->pc + 20), (void *) (&width), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLsop_GetColorTable 147 void -__indirect_glGetColorTable(GLenum target, GLenum format, GLenum type, GLvoid * table) +__indirect_glGetColorTable(GLenum target, GLenum format, GLenum type, + GLvoid * table) { - __GLXcontext * const gc = __glXGetCurrentContext(); - const __GLXattribute * const state = gc->client_state_private; - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + const __GLXattribute *const state = gc->client_state_private; + Display *const dpy = gc->currentDpy; const GLuint cmdlen = 16; if (__builtin_expect(dpy != NULL, 1)) { #ifdef USE_XCB - XCBConnection *c = XCBConnectionOfDisplay(dpy); + xcb_connection_t *c = XGetXCBConnection(dpy); (void) __glXFlushRenderBuffer(gc, gc->pc); - XCBGlxGetColorTableRep *reply = XCBGlxGetColorTableReply(c, XCBGlxGetColorTable(c, gc->currentContextTag, target, format, type, state->storePack.swapEndian), NULL); - (void)memcpy(table, XCBGlxGetColorTableData(reply), XCBGlxGetColorTableDataLength(reply) * sizeof(GLvoid)); + xcb_glx_get_color_table_reply_t *reply = + xcb_glx_get_color_table_reply(c, + xcb_glx_get_color_table(c, + gc-> + currentContextTag, + target, + format, + type, + state-> + storePack. + swapEndian), + NULL); + (void) memcpy(table, xcb_glx_get_color_table_data(reply), + xcb_glx_get_color_table_data_length(reply) * + sizeof(GLvoid)); free(reply); #else - GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetColorTable, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&target), 4); - (void) memcpy((void *)(pc + 4), (void *)(&format), 4); - (void) memcpy((void *)(pc + 8), (void *)(&type), 4); - *(int32_t *)(pc + 12) = 0; - * (int8_t *)(pc + 12) = state->storePack.swapEndian; - __glXReadPixelReply(dpy, gc, 1, 0, 0, 0, format, type, table, GL_TRUE); - UnlockDisplay(dpy); SyncHandle(); + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetColorTable, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&format), 4); + (void) memcpy((void *) (pc + 8), (void *) (&type), 4); + *(int32_t *) (pc + 12) = 0; + *(int8_t *) (pc + 12) = state->storePack.swapEndian; + __glXReadPixelReply(dpy, gc, 1, 0, 0, 0, format, type, table, + GL_TRUE); + UnlockDisplay(dpy); + SyncHandle(); #endif /* USE_XCB */ } return; } +#define X_GLvop_GetColorTableSGI 4098 +void +glGetColorTableEXT(GLenum target, GLenum format, GLenum type, GLvoid * table) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + + if (gc->isDirect) { + CALL_GetColorTable(GET_DISPATCH(), (target, format, type, table)); + } else { + __GLXcontext *const gc = __glXGetCurrentContext(); + const __GLXattribute *const state = gc->client_state_private; + Display *const dpy = gc->currentDpy; + const GLuint cmdlen = 16; + if (__builtin_expect(dpy != NULL, 1)) { + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_GetColorTableSGI, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&format), 4); + (void) memcpy((void *) (pc + 8), (void *) (&type), 4); + *(int32_t *) (pc + 12) = 0; + *(int8_t *) (pc + 12) = state->storePack.swapEndian; + __glXReadPixelReply(dpy, gc, 1, 0, 0, 0, format, type, table, + GL_TRUE); + UnlockDisplay(dpy); + SyncHandle(); + } + return; + } +} + #define X_GLsop_GetColorTableParameterfv 148 void -__indirect_glGetColorTableParameterfv(GLenum target, GLenum pname, GLfloat * params) +__indirect_glGetColorTableParameterfv(GLenum target, GLenum pname, + GLfloat * params) { - __GLXcontext * const gc = __glXGetCurrentContext(); - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; const GLuint cmdlen = 8; if (__builtin_expect(dpy != NULL, 1)) { #ifdef USE_XCB - XCBConnection *c = XCBConnectionOfDisplay(dpy); + xcb_connection_t *c = XGetXCBConnection(dpy); (void) __glXFlushRenderBuffer(gc, gc->pc); - XCBGlxGetColorTableParameterfvRep *reply = XCBGlxGetColorTableParameterfvReply(c, XCBGlxGetColorTableParameterfv(c, gc->currentContextTag, target, pname), NULL); - if (XCBGlxGetColorTableParameterfvDataLength(reply) == 0) - (void)memcpy(params, &reply->datum, sizeof(reply->datum)); + xcb_glx_get_color_table_parameterfv_reply_t *reply = + xcb_glx_get_color_table_parameterfv_reply(c, + xcb_glx_get_color_table_parameterfv + (c, + gc->currentContextTag, + target, pname), NULL); + if (xcb_glx_get_color_table_parameterfv_data_length(reply) == 0) + (void) memcpy(params, &reply->datum, sizeof(reply->datum)); else - (void)memcpy(params, XCBGlxGetColorTableParameterfvData(reply), XCBGlxGetColorTableParameterfvDataLength(reply) * sizeof(GLfloat)); + (void) memcpy(params, + xcb_glx_get_color_table_parameterfv_data(reply), + xcb_glx_get_color_table_parameterfv_data_length + (reply) * sizeof(GLfloat)); free(reply); #else - GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetColorTableParameterfv, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&target), 4); - (void) memcpy((void *)(pc + 4), (void *)(&pname), 4); + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetColorTableParameterfv, + cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); (void) __glXReadReply(dpy, 4, params, GL_FALSE); - UnlockDisplay(dpy); SyncHandle(); + UnlockDisplay(dpy); + SyncHandle(); #endif /* USE_XCB */ } return; } +#define X_GLvop_GetColorTableParameterfvSGI 4099 +void +glGetColorTableParameterfvEXT(GLenum target, GLenum pname, GLfloat * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + + if (gc->isDirect) { + CALL_GetColorTableParameterfv(GET_DISPATCH(), + (target, pname, params)); + } else { + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; + const GLuint cmdlen = 8; + if (__builtin_expect(dpy != NULL, 1)) { + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_GetColorTableParameterfvSGI, + cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); + (void) __glXReadReply(dpy, 4, params, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); + } + return; + } +} + #define X_GLsop_GetColorTableParameteriv 149 void -__indirect_glGetColorTableParameteriv(GLenum target, GLenum pname, GLint * params) +__indirect_glGetColorTableParameteriv(GLenum target, GLenum pname, + GLint * params) { - __GLXcontext * const gc = __glXGetCurrentContext(); - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; const GLuint cmdlen = 8; if (__builtin_expect(dpy != NULL, 1)) { #ifdef USE_XCB - XCBConnection *c = XCBConnectionOfDisplay(dpy); + xcb_connection_t *c = XGetXCBConnection(dpy); (void) __glXFlushRenderBuffer(gc, gc->pc); - XCBGlxGetColorTableParameterivRep *reply = XCBGlxGetColorTableParameterivReply(c, XCBGlxGetColorTableParameteriv(c, gc->currentContextTag, target, pname), NULL); - if (XCBGlxGetColorTableParameterivDataLength(reply) == 0) - (void)memcpy(params, &reply->datum, sizeof(reply->datum)); + xcb_glx_get_color_table_parameteriv_reply_t *reply = + xcb_glx_get_color_table_parameteriv_reply(c, + xcb_glx_get_color_table_parameteriv + (c, + gc->currentContextTag, + target, pname), NULL); + if (xcb_glx_get_color_table_parameteriv_data_length(reply) == 0) + (void) memcpy(params, &reply->datum, sizeof(reply->datum)); else - (void)memcpy(params, XCBGlxGetColorTableParameterivData(reply), XCBGlxGetColorTableParameterivDataLength(reply) * sizeof(GLint)); + (void) memcpy(params, + xcb_glx_get_color_table_parameteriv_data(reply), + xcb_glx_get_color_table_parameteriv_data_length + (reply) * sizeof(GLint)); free(reply); #else - GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetColorTableParameteriv, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&target), 4); - (void) memcpy((void *)(pc + 4), (void *)(&pname), 4); + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetColorTableParameteriv, + cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); (void) __glXReadReply(dpy, 4, params, GL_FALSE); - UnlockDisplay(dpy); SyncHandle(); + UnlockDisplay(dpy); + SyncHandle(); #endif /* USE_XCB */ } return; } +#define X_GLvop_GetColorTableParameterivSGI 4100 +void +glGetColorTableParameterivEXT(GLenum target, GLenum pname, GLint * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + + if (gc->isDirect) { + CALL_GetColorTableParameteriv(GET_DISPATCH(), + (target, pname, params)); + } else { + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; + const GLuint cmdlen = 8; + if (__builtin_expect(dpy != NULL, 1)) { + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_GetColorTableParameterivSGI, + cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); + (void) __glXReadReply(dpy, 4, params, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); + } + return; + } +} + #define X_GLrop_ColorSubTable 195 void -__indirect_glColorSubTable(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid * data) +__indirect_glColorSubTable(GLenum target, GLsizei start, GLsizei count, + GLenum format, GLenum type, const GLvoid * data) { - __GLXcontext * const gc = __glXGetCurrentContext(); - const GLuint compsize = (data != NULL) ? __glImageSize(count, 1, 1, format, type, target) : 0; + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint compsize = + (data != NULL) ? __glImageSize(count, 1, 1, format, type, target) : 0; const GLuint cmdlen = 44 + __GLX_PAD(compsize); if (__builtin_expect(gc->currentDpy != NULL, 1)) { if (cmdlen <= gc->maxSmallRenderCommandSize) { - if ( (gc->pc + cmdlen) > gc->bufEnd ) { + if ((gc->pc + cmdlen) > gc->bufEnd) { (void) __glXFlushRenderBuffer(gc, gc->pc); } emit_header(gc->pc, X_GLrop_ColorSubTable, cmdlen); - (void) memcpy((void *)(gc->pc + 24), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 28), (void *)(&start), 4); - (void) memcpy((void *)(gc->pc + 32), (void *)(&count), 4); - (void) memcpy((void *)(gc->pc + 36), (void *)(&format), 4); - (void) memcpy((void *)(gc->pc + 40), (void *)(&type), 4); + (void) memcpy((void *) (gc->pc + 24), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 28), (void *) (&start), 4); + (void) memcpy((void *) (gc->pc + 32), (void *) (&count), 4); + (void) memcpy((void *) (gc->pc + 36), (void *) (&format), 4); + (void) memcpy((void *) (gc->pc + 40), (void *) (&type), 4); if (compsize > 0) { - (*gc->fillImage)(gc, 1, count, 1, 1, format, type, data, gc->pc + 44, gc->pc + 4); - } - else { - (void) memcpy( gc->pc + 4, default_pixel_store_1D, default_pixel_store_1D_size ); + (*gc->fillImage) (gc, 1, count, 1, 1, format, type, data, + gc->pc + 44, gc->pc + 4); + } else { + (void) memcpy(gc->pc + 4, default_pixel_store_1D, + default_pixel_store_1D_size); } gc->pc += cmdlen; - if (gc->pc > gc->limit) { (void) __glXFlushRenderBuffer(gc, gc->pc); } - } - else { + if (gc->pc > gc->limit) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + } else { const GLint op = X_GLrop_ColorSubTable; const GLuint cmdlenLarge = cmdlen + 4; - GLubyte * const pc = __glXFlushRenderBuffer(gc, gc->pc); - (void) memcpy((void *)(pc + 0), (void *)(&cmdlenLarge), 4); - (void) memcpy((void *)(pc + 4), (void *)(&op), 4); - (void) memcpy((void *)(pc + 28), (void *)(&target), 4); - (void) memcpy((void *)(pc + 32), (void *)(&start), 4); - (void) memcpy((void *)(pc + 36), (void *)(&count), 4); - (void) memcpy((void *)(pc + 40), (void *)(&format), 4); - (void) memcpy((void *)(pc + 44), (void *)(&type), 4); - __glXSendLargeImage(gc, compsize, 1, count, 1, 1, format, type, data, pc + 48, pc + 8); + GLubyte *const pc = __glXFlushRenderBuffer(gc, gc->pc); + (void) memcpy((void *) (pc + 0), (void *) (&cmdlenLarge), 4); + (void) memcpy((void *) (pc + 4), (void *) (&op), 4); + (void) memcpy((void *) (pc + 28), (void *) (&target), 4); + (void) memcpy((void *) (pc + 32), (void *) (&start), 4); + (void) memcpy((void *) (pc + 36), (void *) (&count), 4); + (void) memcpy((void *) (pc + 40), (void *) (&format), 4); + (void) memcpy((void *) (pc + 44), (void *) (&type), 4); + __glXSendLargeImage(gc, compsize, 1, count, 1, 1, format, type, + data, pc + 48, pc + 8); } } } #define X_GLrop_CopyColorSubTable 196 void -__indirect_glCopyColorSubTable(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width) +__indirect_glCopyColorSubTable(GLenum target, GLsizei start, GLint x, GLint y, + GLsizei width) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 24; emit_header(gc->pc, X_GLrop_CopyColorSubTable, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&start), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&x), 4); - (void) memcpy((void *)(gc->pc + 16), (void *)(&y), 4); - (void) memcpy((void *)(gc->pc + 20), (void *)(&width), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&start), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&y), 4); + (void) memcpy((void *) (gc->pc + 20), (void *) (&width), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } static void -__glx_ConvolutionFilter_1D2D( unsigned opcode, unsigned dim, GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * image ) -{ - __GLXcontext * const gc = __glXGetCurrentContext(); - const GLuint compsize = (image != NULL) ? __glImageSize(width, height, 1, format, type, target) : 0; +__glx_ConvolutionFilter_1D2D(unsigned opcode, unsigned dim, GLenum target, + GLenum internalformat, GLsizei width, + GLsizei height, GLenum format, GLenum type, + const GLvoid * image) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint compsize = + (image != NULL) ? __glImageSize(width, height, 1, format, type, + target) : 0; const GLuint cmdlen = 48 + __GLX_PAD(compsize); if (__builtin_expect(gc->currentDpy != NULL, 1)) { if (cmdlen <= gc->maxSmallRenderCommandSize) { - if ( (gc->pc + cmdlen) > gc->bufEnd ) { + if ((gc->pc + cmdlen) > gc->bufEnd) { (void) __glXFlushRenderBuffer(gc, gc->pc); } emit_header(gc->pc, opcode, cmdlen); - (void) memcpy((void *)(gc->pc + 24), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 28), (void *)(&internalformat), 4); - (void) memcpy((void *)(gc->pc + 32), (void *)(&width), 4); - (void) memcpy((void *)(gc->pc + 36), (void *)(&height), 4); - (void) memcpy((void *)(gc->pc + 40), (void *)(&format), 4); - (void) memcpy((void *)(gc->pc + 44), (void *)(&type), 4); + (void) memcpy((void *) (gc->pc + 24), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 28), (void *) (&internalformat), + 4); + (void) memcpy((void *) (gc->pc + 32), (void *) (&width), 4); + (void) memcpy((void *) (gc->pc + 36), (void *) (&height), 4); + (void) memcpy((void *) (gc->pc + 40), (void *) (&format), 4); + (void) memcpy((void *) (gc->pc + 44), (void *) (&type), 4); if (compsize > 0) { - (*gc->fillImage)(gc, dim, width, height, 1, format, type, image, gc->pc + 48, gc->pc + 4); - } - else { - (void) memcpy( gc->pc + 4, default_pixel_store_2D, default_pixel_store_2D_size ); + (*gc->fillImage) (gc, dim, width, height, 1, format, type, + image, gc->pc + 48, gc->pc + 4); + } else { + (void) memcpy(gc->pc + 4, default_pixel_store_2D, + default_pixel_store_2D_size); } gc->pc += cmdlen; - if (gc->pc > gc->limit) { (void) __glXFlushRenderBuffer(gc, gc->pc); } - } - else { + if (gc->pc > gc->limit) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + } else { const GLint op = opcode; const GLuint cmdlenLarge = cmdlen + 4; - GLubyte * const pc = __glXFlushRenderBuffer(gc, gc->pc); - (void) memcpy((void *)(pc + 0), (void *)(&cmdlenLarge), 4); - (void) memcpy((void *)(pc + 4), (void *)(&op), 4); - (void) memcpy((void *)(pc + 28), (void *)(&target), 4); - (void) memcpy((void *)(pc + 32), (void *)(&internalformat), 4); - (void) memcpy((void *)(pc + 36), (void *)(&width), 4); - (void) memcpy((void *)(pc + 40), (void *)(&height), 4); - (void) memcpy((void *)(pc + 44), (void *)(&format), 4); - (void) memcpy((void *)(pc + 48), (void *)(&type), 4); - __glXSendLargeImage(gc, compsize, dim, width, height, 1, format, type, image, pc + 52, pc + 8); + GLubyte *const pc = __glXFlushRenderBuffer(gc, gc->pc); + (void) memcpy((void *) (pc + 0), (void *) (&cmdlenLarge), 4); + (void) memcpy((void *) (pc + 4), (void *) (&op), 4); + (void) memcpy((void *) (pc + 28), (void *) (&target), 4); + (void) memcpy((void *) (pc + 32), (void *) (&internalformat), 4); + (void) memcpy((void *) (pc + 36), (void *) (&width), 4); + (void) memcpy((void *) (pc + 40), (void *) (&height), 4); + (void) memcpy((void *) (pc + 44), (void *) (&format), 4); + (void) memcpy((void *) (pc + 48), (void *) (&type), 4); + __glXSendLargeImage(gc, compsize, dim, width, height, 1, format, + type, image, pc + 52, pc + 8); } } } #define X_GLrop_ConvolutionFilter1D 4101 void -__indirect_glConvolutionFilter1D(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * image) +__indirect_glConvolutionFilter1D(GLenum target, GLenum internalformat, + GLsizei width, GLenum format, GLenum type, + const GLvoid * image) { - __glx_ConvolutionFilter_1D2D(X_GLrop_ConvolutionFilter1D, 1, target, internalformat, width, 1, format, type, image ); + __glx_ConvolutionFilter_1D2D(X_GLrop_ConvolutionFilter1D, 1, target, + internalformat, width, 1, format, type, + image); } #define X_GLrop_ConvolutionFilter2D 4102 void -__indirect_glConvolutionFilter2D(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * image) +__indirect_glConvolutionFilter2D(GLenum target, GLenum internalformat, + GLsizei width, GLsizei height, GLenum format, + GLenum type, const GLvoid * image) { - __glx_ConvolutionFilter_1D2D(X_GLrop_ConvolutionFilter2D, 2, target, internalformat, width, height, format, type, image ); + __glx_ConvolutionFilter_1D2D(X_GLrop_ConvolutionFilter2D, 2, target, + internalformat, width, height, format, type, + image); } #define X_GLrop_ConvolutionParameterf 4103 void -__indirect_glConvolutionParameterf(GLenum target, GLenum pname, GLfloat params) +__indirect_glConvolutionParameterf(GLenum target, GLenum pname, + GLfloat params) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_ConvolutionParameterf, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(¶ms), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (¶ms), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_ConvolutionParameterfv 4104 void -__indirect_glConvolutionParameterfv(GLenum target, GLenum pname, const GLfloat * params) +__indirect_glConvolutionParameterfv(GLenum target, GLenum pname, + const GLfloat * params) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint compsize = __glConvolutionParameterfv_size(pname); const GLuint cmdlen = 12 + __GLX_PAD((compsize * 4)); emit_header(gc->pc, X_GLrop_ConvolutionParameterfv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(params), (compsize * 4)); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (params), (compsize * 4)); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_ConvolutionParameteri 4105 void __indirect_glConvolutionParameteri(GLenum target, GLenum pname, GLint params) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_ConvolutionParameteri, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(¶ms), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (¶ms), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_ConvolutionParameteriv 4106 void -__indirect_glConvolutionParameteriv(GLenum target, GLenum pname, const GLint * params) +__indirect_glConvolutionParameteriv(GLenum target, GLenum pname, + const GLint * params) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint compsize = __glConvolutionParameteriv_size(pname); const GLuint cmdlen = 12 + __GLX_PAD((compsize * 4)); emit_header(gc->pc, X_GLrop_ConvolutionParameteriv, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(params), (compsize * 4)); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (params), (compsize * 4)); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_CopyConvolutionFilter1D 4107 void -__indirect_glCopyConvolutionFilter1D(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width) +__indirect_glCopyConvolutionFilter1D(GLenum target, GLenum internalformat, + GLint x, GLint y, GLsizei width) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 24; emit_header(gc->pc, X_GLrop_CopyConvolutionFilter1D, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&internalformat), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&x), 4); - (void) memcpy((void *)(gc->pc + 16), (void *)(&y), 4); - (void) memcpy((void *)(gc->pc + 20), (void *)(&width), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&internalformat), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&y), 4); + (void) memcpy((void *) (gc->pc + 20), (void *) (&width), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_CopyConvolutionFilter2D 4108 void -__indirect_glCopyConvolutionFilter2D(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height) +__indirect_glCopyConvolutionFilter2D(GLenum target, GLenum internalformat, + GLint x, GLint y, GLsizei width, + GLsizei height) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 28; emit_header(gc->pc, X_GLrop_CopyConvolutionFilter2D, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&internalformat), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&x), 4); - (void) memcpy((void *)(gc->pc + 16), (void *)(&y), 4); - (void) memcpy((void *)(gc->pc + 20), (void *)(&width), 4); - (void) memcpy((void *)(gc->pc + 24), (void *)(&height), 4); - gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&internalformat), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&y), 4); + (void) memcpy((void *) (gc->pc + 20), (void *) (&width), 4); + (void) memcpy((void *) (gc->pc + 24), (void *) (&height), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLsop_GetConvolutionFilter 150 void -__indirect_glGetConvolutionFilter(GLenum target, GLenum format, GLenum type, GLvoid * image) +__indirect_glGetConvolutionFilter(GLenum target, GLenum format, GLenum type, + GLvoid * image) { - __GLXcontext * const gc = __glXGetCurrentContext(); - const __GLXattribute * const state = gc->client_state_private; - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + const __GLXattribute *const state = gc->client_state_private; + Display *const dpy = gc->currentDpy; const GLuint cmdlen = 16; if (__builtin_expect(dpy != NULL, 1)) { #ifdef USE_XCB - XCBConnection *c = XCBConnectionOfDisplay(dpy); + xcb_connection_t *c = XGetXCBConnection(dpy); (void) __glXFlushRenderBuffer(gc, gc->pc); - XCBGlxGetConvolutionFilterRep *reply = XCBGlxGetConvolutionFilterReply(c, XCBGlxGetConvolutionFilter(c, gc->currentContextTag, target, format, type, state->storePack.swapEndian), NULL); - (void)memcpy(image, XCBGlxGetConvolutionFilterData(reply), XCBGlxGetConvolutionFilterDataLength(reply) * sizeof(GLvoid)); + xcb_glx_get_convolution_filter_reply_t *reply = + xcb_glx_get_convolution_filter_reply(c, + xcb_glx_get_convolution_filter + (c, gc->currentContextTag, + target, format, type, + state->storePack. + swapEndian), NULL); + (void) memcpy(image, xcb_glx_get_convolution_filter_data(reply), + xcb_glx_get_convolution_filter_data_length(reply) * + sizeof(GLvoid)); free(reply); #else - GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetConvolutionFilter, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&target), 4); - (void) memcpy((void *)(pc + 4), (void *)(&format), 4); - (void) memcpy((void *)(pc + 8), (void *)(&type), 4); - *(int32_t *)(pc + 12) = 0; - * (int8_t *)(pc + 12) = state->storePack.swapEndian; - __glXReadPixelReply(dpy, gc, 2, 0, 0, 0, format, type, image, GL_TRUE); - UnlockDisplay(dpy); SyncHandle(); + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetConvolutionFilter, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&format), 4); + (void) memcpy((void *) (pc + 8), (void *) (&type), 4); + *(int32_t *) (pc + 12) = 0; + *(int8_t *) (pc + 12) = state->storePack.swapEndian; + __glXReadPixelReply(dpy, gc, 2, 0, 0, 0, format, type, image, + GL_TRUE); + UnlockDisplay(dpy); + SyncHandle(); #endif /* USE_XCB */ } return; } +#define X_GLvop_GetConvolutionFilterEXT 1 +void +gl_dispatch_stub_356(GLenum target, GLenum format, GLenum type, + GLvoid * image) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + + if (gc->isDirect) { + CALL_GetConvolutionFilter(GET_DISPATCH(), + (target, format, type, image)); + } else { + __GLXcontext *const gc = __glXGetCurrentContext(); + const __GLXattribute *const state = gc->client_state_private; + Display *const dpy = gc->currentDpy; + const GLuint cmdlen = 16; + if (__builtin_expect(dpy != NULL, 1)) { + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_GetConvolutionFilterEXT, + cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&format), 4); + (void) memcpy((void *) (pc + 8), (void *) (&type), 4); + *(int32_t *) (pc + 12) = 0; + *(int8_t *) (pc + 12) = state->storePack.swapEndian; + __glXReadPixelReply(dpy, gc, 2, 0, 0, 0, format, type, image, + GL_TRUE); + UnlockDisplay(dpy); + SyncHandle(); + } + return; + } +} + #define X_GLsop_GetConvolutionParameterfv 151 void -__indirect_glGetConvolutionParameterfv(GLenum target, GLenum pname, GLfloat * params) +__indirect_glGetConvolutionParameterfv(GLenum target, GLenum pname, + GLfloat * params) { - __GLXcontext * const gc = __glXGetCurrentContext(); - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; const GLuint cmdlen = 8; if (__builtin_expect(dpy != NULL, 1)) { #ifdef USE_XCB - XCBConnection *c = XCBConnectionOfDisplay(dpy); + xcb_connection_t *c = XGetXCBConnection(dpy); (void) __glXFlushRenderBuffer(gc, gc->pc); - XCBGlxGetConvolutionParameterfvRep *reply = XCBGlxGetConvolutionParameterfvReply(c, XCBGlxGetConvolutionParameterfv(c, gc->currentContextTag, target, pname), NULL); - if (XCBGlxGetConvolutionParameterfvDataLength(reply) == 0) - (void)memcpy(params, &reply->datum, sizeof(reply->datum)); + xcb_glx_get_convolution_parameterfv_reply_t *reply = + xcb_glx_get_convolution_parameterfv_reply(c, + xcb_glx_get_convolution_parameterfv + (c, + gc->currentContextTag, + target, pname), NULL); + if (xcb_glx_get_convolution_parameterfv_data_length(reply) == 0) + (void) memcpy(params, &reply->datum, sizeof(reply->datum)); else - (void)memcpy(params, XCBGlxGetConvolutionParameterfvData(reply), XCBGlxGetConvolutionParameterfvDataLength(reply) * sizeof(GLfloat)); + (void) memcpy(params, + xcb_glx_get_convolution_parameterfv_data(reply), + xcb_glx_get_convolution_parameterfv_data_length + (reply) * sizeof(GLfloat)); free(reply); #else - GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetConvolutionParameterfv, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&target), 4); - (void) memcpy((void *)(pc + 4), (void *)(&pname), 4); + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetConvolutionParameterfv, + cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); (void) __glXReadReply(dpy, 4, params, GL_FALSE); - UnlockDisplay(dpy); SyncHandle(); + UnlockDisplay(dpy); + SyncHandle(); #endif /* USE_XCB */ } return; } +#define X_GLvop_GetConvolutionParameterfvEXT 2 +void +gl_dispatch_stub_357(GLenum target, GLenum pname, GLfloat * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + + if (gc->isDirect) { + CALL_GetConvolutionParameterfv(GET_DISPATCH(), + (target, pname, params)); + } else { + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; + const GLuint cmdlen = 8; + if (__builtin_expect(dpy != NULL, 1)) { + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_GetConvolutionParameterfvEXT, + cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); + (void) __glXReadReply(dpy, 4, params, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); + } + return; + } +} + #define X_GLsop_GetConvolutionParameteriv 152 void -__indirect_glGetConvolutionParameteriv(GLenum target, GLenum pname, GLint * params) +__indirect_glGetConvolutionParameteriv(GLenum target, GLenum pname, + GLint * params) { - __GLXcontext * const gc = __glXGetCurrentContext(); - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; const GLuint cmdlen = 8; if (__builtin_expect(dpy != NULL, 1)) { #ifdef USE_XCB - XCBConnection *c = XCBConnectionOfDisplay(dpy); + xcb_connection_t *c = XGetXCBConnection(dpy); (void) __glXFlushRenderBuffer(gc, gc->pc); - XCBGlxGetConvolutionParameterivRep *reply = XCBGlxGetConvolutionParameterivReply(c, XCBGlxGetConvolutionParameteriv(c, gc->currentContextTag, target, pname), NULL); - if (XCBGlxGetConvolutionParameterivDataLength(reply) == 0) - (void)memcpy(params, &reply->datum, sizeof(reply->datum)); + xcb_glx_get_convolution_parameteriv_reply_t *reply = + xcb_glx_get_convolution_parameteriv_reply(c, + xcb_glx_get_convolution_parameteriv + (c, + gc->currentContextTag, + target, pname), NULL); + if (xcb_glx_get_convolution_parameteriv_data_length(reply) == 0) + (void) memcpy(params, &reply->datum, sizeof(reply->datum)); else - (void)memcpy(params, XCBGlxGetConvolutionParameterivData(reply), XCBGlxGetConvolutionParameterivDataLength(reply) * sizeof(GLint)); + (void) memcpy(params, + xcb_glx_get_convolution_parameteriv_data(reply), + xcb_glx_get_convolution_parameteriv_data_length + (reply) * sizeof(GLint)); free(reply); #else - GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetConvolutionParameteriv, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&target), 4); - (void) memcpy((void *)(pc + 4), (void *)(&pname), 4); + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetConvolutionParameteriv, + cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); (void) __glXReadReply(dpy, 4, params, GL_FALSE); - UnlockDisplay(dpy); SyncHandle(); + UnlockDisplay(dpy); + SyncHandle(); #endif /* USE_XCB */ } return; } +#define X_GLvop_GetConvolutionParameterivEXT 3 +void +gl_dispatch_stub_358(GLenum target, GLenum pname, GLint * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + + if (gc->isDirect) { + CALL_GetConvolutionParameteriv(GET_DISPATCH(), + (target, pname, params)); + } else { + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; + const GLuint cmdlen = 8; + if (__builtin_expect(dpy != NULL, 1)) { + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_GetConvolutionParameterivEXT, + cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); + (void) __glXReadReply(dpy, 4, params, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); + } + return; + } +} + #define X_GLsop_GetHistogram 154 void -__indirect_glGetHistogram(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values) +__indirect_glGetHistogram(GLenum target, GLboolean reset, GLenum format, + GLenum type, GLvoid * values) { - __GLXcontext * const gc = __glXGetCurrentContext(); - const __GLXattribute * const state = gc->client_state_private; - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + const __GLXattribute *const state = gc->client_state_private; + Display *const dpy = gc->currentDpy; const GLuint cmdlen = 16; if (__builtin_expect(dpy != NULL, 1)) { #ifdef USE_XCB - XCBConnection *c = XCBConnectionOfDisplay(dpy); + xcb_connection_t *c = XGetXCBConnection(dpy); (void) __glXFlushRenderBuffer(gc, gc->pc); - XCBGlxGetHistogramRep *reply = XCBGlxGetHistogramReply(c, XCBGlxGetHistogram(c, gc->currentContextTag, target, reset, format, type, state->storePack.swapEndian), NULL); - (void)memcpy(values, XCBGlxGetHistogramData(reply), XCBGlxGetHistogramDataLength(reply) * sizeof(GLvoid)); + xcb_glx_get_histogram_reply_t *reply = + xcb_glx_get_histogram_reply(c, + xcb_glx_get_histogram(c, + gc-> + currentContextTag, + target, reset, + format, type, + state-> + storePack. + swapEndian), + NULL); + (void) memcpy(values, xcb_glx_get_histogram_data(reply), + xcb_glx_get_histogram_data_length(reply) * + sizeof(GLvoid)); free(reply); #else - GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetHistogram, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&target), 4); - (void) memcpy((void *)(pc + 4), (void *)(&format), 4); - (void) memcpy((void *)(pc + 8), (void *)(&type), 4); - *(int32_t *)(pc + 12) = 0; - * (int8_t *)(pc + 12) = state->storePack.swapEndian; - * (int8_t *)(pc + 13) = reset; - __glXReadPixelReply(dpy, gc, 1, 0, 0, 0, format, type, values, GL_TRUE); - UnlockDisplay(dpy); SyncHandle(); + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetHistogram, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&format), 4); + (void) memcpy((void *) (pc + 8), (void *) (&type), 4); + *(int32_t *) (pc + 12) = 0; + *(int8_t *) (pc + 12) = state->storePack.swapEndian; + *(int8_t *) (pc + 13) = reset; + __glXReadPixelReply(dpy, gc, 1, 0, 0, 0, format, type, values, + GL_TRUE); + UnlockDisplay(dpy); + SyncHandle(); #endif /* USE_XCB */ } return; } +#define X_GLvop_GetHistogramEXT 5 +void +gl_dispatch_stub_361(GLenum target, GLboolean reset, GLenum format, + GLenum type, GLvoid * values) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + + if (gc->isDirect) { + CALL_GetHistogram(GET_DISPATCH(), + (target, reset, format, type, values)); + } else { + __GLXcontext *const gc = __glXGetCurrentContext(); + const __GLXattribute *const state = gc->client_state_private; + Display *const dpy = gc->currentDpy; + const GLuint cmdlen = 16; + if (__builtin_expect(dpy != NULL, 1)) { + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_GetHistogramEXT, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&format), 4); + (void) memcpy((void *) (pc + 8), (void *) (&type), 4); + *(int32_t *) (pc + 12) = 0; + *(int8_t *) (pc + 12) = state->storePack.swapEndian; + *(int8_t *) (pc + 13) = reset; + __glXReadPixelReply(dpy, gc, 1, 0, 0, 0, format, type, values, + GL_TRUE); + UnlockDisplay(dpy); + SyncHandle(); + } + return; + } +} + #define X_GLsop_GetHistogramParameterfv 155 void -__indirect_glGetHistogramParameterfv(GLenum target, GLenum pname, GLfloat * params) +__indirect_glGetHistogramParameterfv(GLenum target, GLenum pname, + GLfloat * params) { - __GLXcontext * const gc = __glXGetCurrentContext(); - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; const GLuint cmdlen = 8; if (__builtin_expect(dpy != NULL, 1)) { #ifdef USE_XCB - XCBConnection *c = XCBConnectionOfDisplay(dpy); + xcb_connection_t *c = XGetXCBConnection(dpy); (void) __glXFlushRenderBuffer(gc, gc->pc); - XCBGlxGetHistogramParameterfvRep *reply = XCBGlxGetHistogramParameterfvReply(c, XCBGlxGetHistogramParameterfv(c, gc->currentContextTag, target, pname), NULL); - if (XCBGlxGetHistogramParameterfvDataLength(reply) == 0) - (void)memcpy(params, &reply->datum, sizeof(reply->datum)); + xcb_glx_get_histogram_parameterfv_reply_t *reply = + xcb_glx_get_histogram_parameterfv_reply(c, + xcb_glx_get_histogram_parameterfv + (c, gc->currentContextTag, + target, pname), NULL); + if (xcb_glx_get_histogram_parameterfv_data_length(reply) == 0) + (void) memcpy(params, &reply->datum, sizeof(reply->datum)); else - (void)memcpy(params, XCBGlxGetHistogramParameterfvData(reply), XCBGlxGetHistogramParameterfvDataLength(reply) * sizeof(GLfloat)); + (void) memcpy(params, + xcb_glx_get_histogram_parameterfv_data(reply), + xcb_glx_get_histogram_parameterfv_data_length(reply) + * sizeof(GLfloat)); free(reply); #else - GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetHistogramParameterfv, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&target), 4); - (void) memcpy((void *)(pc + 4), (void *)(&pname), 4); + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetHistogramParameterfv, + cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); (void) __glXReadReply(dpy, 4, params, GL_FALSE); - UnlockDisplay(dpy); SyncHandle(); + UnlockDisplay(dpy); + SyncHandle(); #endif /* USE_XCB */ } return; } +#define X_GLvop_GetHistogramParameterfvEXT 6 +void +gl_dispatch_stub_362(GLenum target, GLenum pname, GLfloat * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + + if (gc->isDirect) { + CALL_GetHistogramParameterfv(GET_DISPATCH(), (target, pname, params)); + } else { + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; + const GLuint cmdlen = 8; + if (__builtin_expect(dpy != NULL, 1)) { + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_GetHistogramParameterfvEXT, + cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); + (void) __glXReadReply(dpy, 4, params, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); + } + return; + } +} + #define X_GLsop_GetHistogramParameteriv 156 void -__indirect_glGetHistogramParameteriv(GLenum target, GLenum pname, GLint * params) +__indirect_glGetHistogramParameteriv(GLenum target, GLenum pname, + GLint * params) { - __GLXcontext * const gc = __glXGetCurrentContext(); - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; const GLuint cmdlen = 8; if (__builtin_expect(dpy != NULL, 1)) { #ifdef USE_XCB - XCBConnection *c = XCBConnectionOfDisplay(dpy); + xcb_connection_t *c = XGetXCBConnection(dpy); (void) __glXFlushRenderBuffer(gc, gc->pc); - XCBGlxGetHistogramParameterivRep *reply = XCBGlxGetHistogramParameterivReply(c, XCBGlxGetHistogramParameteriv(c, gc->currentContextTag, target, pname), NULL); - if (XCBGlxGetHistogramParameterivDataLength(reply) == 0) - (void)memcpy(params, &reply->datum, sizeof(reply->datum)); + xcb_glx_get_histogram_parameteriv_reply_t *reply = + xcb_glx_get_histogram_parameteriv_reply(c, + xcb_glx_get_histogram_parameteriv + (c, gc->currentContextTag, + target, pname), NULL); + if (xcb_glx_get_histogram_parameteriv_data_length(reply) == 0) + (void) memcpy(params, &reply->datum, sizeof(reply->datum)); else - (void)memcpy(params, XCBGlxGetHistogramParameterivData(reply), XCBGlxGetHistogramParameterivDataLength(reply) * sizeof(GLint)); + (void) memcpy(params, + xcb_glx_get_histogram_parameteriv_data(reply), + xcb_glx_get_histogram_parameteriv_data_length(reply) + * sizeof(GLint)); free(reply); #else - GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetHistogramParameteriv, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&target), 4); - (void) memcpy((void *)(pc + 4), (void *)(&pname), 4); + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetHistogramParameteriv, + cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); (void) __glXReadReply(dpy, 4, params, GL_FALSE); - UnlockDisplay(dpy); SyncHandle(); + UnlockDisplay(dpy); + SyncHandle(); #endif /* USE_XCB */ } return; } +#define X_GLvop_GetHistogramParameterivEXT 7 +void +gl_dispatch_stub_363(GLenum target, GLenum pname, GLint * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + + if (gc->isDirect) { + CALL_GetHistogramParameteriv(GET_DISPATCH(), (target, pname, params)); + } else { + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; + const GLuint cmdlen = 8; + if (__builtin_expect(dpy != NULL, 1)) { + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_GetHistogramParameterivEXT, + cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); + (void) __glXReadReply(dpy, 4, params, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); + } + return; + } +} + #define X_GLsop_GetMinmax 157 void -__indirect_glGetMinmax(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values) +__indirect_glGetMinmax(GLenum target, GLboolean reset, GLenum format, + GLenum type, GLvoid * values) { - __GLXcontext * const gc = __glXGetCurrentContext(); - const __GLXattribute * const state = gc->client_state_private; - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + const __GLXattribute *const state = gc->client_state_private; + Display *const dpy = gc->currentDpy; const GLuint cmdlen = 16; if (__builtin_expect(dpy != NULL, 1)) { #ifdef USE_XCB - XCBConnection *c = XCBConnectionOfDisplay(dpy); + xcb_connection_t *c = XGetXCBConnection(dpy); (void) __glXFlushRenderBuffer(gc, gc->pc); - XCBGlxGetMinmaxRep *reply = XCBGlxGetMinmaxReply(c, XCBGlxGetMinmax(c, gc->currentContextTag, target, reset, format, type, state->storePack.swapEndian), NULL); - (void)memcpy(values, XCBGlxGetMinmaxData(reply), XCBGlxGetMinmaxDataLength(reply) * sizeof(GLvoid)); + xcb_glx_get_minmax_reply_t *reply = + xcb_glx_get_minmax_reply(c, + xcb_glx_get_minmax(c, + gc->currentContextTag, + target, reset, format, + type, + state->storePack. + swapEndian), NULL); + (void) memcpy(values, xcb_glx_get_minmax_data(reply), + xcb_glx_get_minmax_data_length(reply) * sizeof(GLvoid)); free(reply); #else - GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetMinmax, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&target), 4); - (void) memcpy((void *)(pc + 4), (void *)(&format), 4); - (void) memcpy((void *)(pc + 8), (void *)(&type), 4); - *(int32_t *)(pc + 12) = 0; - * (int8_t *)(pc + 12) = state->storePack.swapEndian; - * (int8_t *)(pc + 13) = reset; - __glXReadPixelReply(dpy, gc, 1, 2, 1, 1, format, type, values, GL_FALSE); - UnlockDisplay(dpy); SyncHandle(); + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetMinmax, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&format), 4); + (void) memcpy((void *) (pc + 8), (void *) (&type), 4); + *(int32_t *) (pc + 12) = 0; + *(int8_t *) (pc + 12) = state->storePack.swapEndian; + *(int8_t *) (pc + 13) = reset; + __glXReadPixelReply(dpy, gc, 1, 2, 1, 1, format, type, values, + GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); #endif /* USE_XCB */ } return; } +#define X_GLvop_GetMinmaxEXT 8 +void +gl_dispatch_stub_364(GLenum target, GLboolean reset, GLenum format, + GLenum type, GLvoid * values) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + + if (gc->isDirect) { + CALL_GetMinmax(GET_DISPATCH(), (target, reset, format, type, values)); + } else { + __GLXcontext *const gc = __glXGetCurrentContext(); + const __GLXattribute *const state = gc->client_state_private; + Display *const dpy = gc->currentDpy; + const GLuint cmdlen = 16; + if (__builtin_expect(dpy != NULL, 1)) { + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_GetMinmaxEXT, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&format), 4); + (void) memcpy((void *) (pc + 8), (void *) (&type), 4); + *(int32_t *) (pc + 12) = 0; + *(int8_t *) (pc + 12) = state->storePack.swapEndian; + *(int8_t *) (pc + 13) = reset; + __glXReadPixelReply(dpy, gc, 1, 2, 1, 1, format, type, values, + GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); + } + return; + } +} + #define X_GLsop_GetMinmaxParameterfv 158 void -__indirect_glGetMinmaxParameterfv(GLenum target, GLenum pname, GLfloat * params) +__indirect_glGetMinmaxParameterfv(GLenum target, GLenum pname, + GLfloat * params) { - __GLXcontext * const gc = __glXGetCurrentContext(); - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; const GLuint cmdlen = 8; if (__builtin_expect(dpy != NULL, 1)) { #ifdef USE_XCB - XCBConnection *c = XCBConnectionOfDisplay(dpy); + xcb_connection_t *c = XGetXCBConnection(dpy); (void) __glXFlushRenderBuffer(gc, gc->pc); - XCBGlxGetMinmaxParameterfvRep *reply = XCBGlxGetMinmaxParameterfvReply(c, XCBGlxGetMinmaxParameterfv(c, gc->currentContextTag, target, pname), NULL); - if (XCBGlxGetMinmaxParameterfvDataLength(reply) == 0) - (void)memcpy(params, &reply->datum, sizeof(reply->datum)); + xcb_glx_get_minmax_parameterfv_reply_t *reply = + xcb_glx_get_minmax_parameterfv_reply(c, + xcb_glx_get_minmax_parameterfv + (c, gc->currentContextTag, + target, pname), NULL); + if (xcb_glx_get_minmax_parameterfv_data_length(reply) == 0) + (void) memcpy(params, &reply->datum, sizeof(reply->datum)); else - (void)memcpy(params, XCBGlxGetMinmaxParameterfvData(reply), XCBGlxGetMinmaxParameterfvDataLength(reply) * sizeof(GLfloat)); + (void) memcpy(params, xcb_glx_get_minmax_parameterfv_data(reply), + xcb_glx_get_minmax_parameterfv_data_length(reply) * + sizeof(GLfloat)); free(reply); #else - GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetMinmaxParameterfv, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&target), 4); - (void) memcpy((void *)(pc + 4), (void *)(&pname), 4); + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetMinmaxParameterfv, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); (void) __glXReadReply(dpy, 4, params, GL_FALSE); - UnlockDisplay(dpy); SyncHandle(); + UnlockDisplay(dpy); + SyncHandle(); #endif /* USE_XCB */ } return; } +#define X_GLvop_GetMinmaxParameterfvEXT 9 +void +gl_dispatch_stub_365(GLenum target, GLenum pname, GLfloat * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + + if (gc->isDirect) { + CALL_GetMinmaxParameterfv(GET_DISPATCH(), (target, pname, params)); + } else { + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; + const GLuint cmdlen = 8; + if (__builtin_expect(dpy != NULL, 1)) { + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_GetMinmaxParameterfvEXT, + cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); + (void) __glXReadReply(dpy, 4, params, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); + } + return; + } +} + #define X_GLsop_GetMinmaxParameteriv 159 void __indirect_glGetMinmaxParameteriv(GLenum target, GLenum pname, GLint * params) { - __GLXcontext * const gc = __glXGetCurrentContext(); - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; const GLuint cmdlen = 8; if (__builtin_expect(dpy != NULL, 1)) { #ifdef USE_XCB - XCBConnection *c = XCBConnectionOfDisplay(dpy); + xcb_connection_t *c = XGetXCBConnection(dpy); (void) __glXFlushRenderBuffer(gc, gc->pc); - XCBGlxGetMinmaxParameterivRep *reply = XCBGlxGetMinmaxParameterivReply(c, XCBGlxGetMinmaxParameteriv(c, gc->currentContextTag, target, pname), NULL); - if (XCBGlxGetMinmaxParameterivDataLength(reply) == 0) - (void)memcpy(params, &reply->datum, sizeof(reply->datum)); + xcb_glx_get_minmax_parameteriv_reply_t *reply = + xcb_glx_get_minmax_parameteriv_reply(c, + xcb_glx_get_minmax_parameteriv + (c, gc->currentContextTag, + target, pname), NULL); + if (xcb_glx_get_minmax_parameteriv_data_length(reply) == 0) + (void) memcpy(params, &reply->datum, sizeof(reply->datum)); else - (void)memcpy(params, XCBGlxGetMinmaxParameterivData(reply), XCBGlxGetMinmaxParameterivDataLength(reply) * sizeof(GLint)); + (void) memcpy(params, xcb_glx_get_minmax_parameteriv_data(reply), + xcb_glx_get_minmax_parameteriv_data_length(reply) * + sizeof(GLint)); free(reply); #else - GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetMinmaxParameteriv, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&target), 4); - (void) memcpy((void *)(pc + 4), (void *)(&pname), 4); + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetMinmaxParameteriv, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); (void) __glXReadReply(dpy, 4, params, GL_FALSE); - UnlockDisplay(dpy); SyncHandle(); + UnlockDisplay(dpy); + SyncHandle(); #endif /* USE_XCB */ } return; } +#define X_GLvop_GetMinmaxParameterivEXT 10 +void +gl_dispatch_stub_366(GLenum target, GLenum pname, GLint * params) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + + if (gc->isDirect) { + CALL_GetMinmaxParameteriv(GET_DISPATCH(), (target, pname, params)); + } else { + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; + const GLuint cmdlen = 8; + if (__builtin_expect(dpy != NULL, 1)) { + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_GetMinmaxParameterivEXT, + cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); + (void) __glXReadReply(dpy, 4, params, GL_FALSE); + UnlockDisplay(dpy); + SyncHandle(); + } + return; + } +} + #define X_GLrop_Histogram 4110 void -__indirect_glHistogram(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink) +__indirect_glHistogram(GLenum target, GLsizei width, GLenum internalformat, + GLboolean sink) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_Histogram, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&width), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&internalformat), 4); - (void) memcpy((void *)(gc->pc + 16), (void *)(&sink), 1); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&width), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&internalformat), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&sink), 1); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_Minmax 4111 void __indirect_glMinmax(GLenum target, GLenum internalformat, GLboolean sink) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_Minmax, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&internalformat), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&sink), 1); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&internalformat), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&sink), 1); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_ResetHistogram 4112 void __indirect_glResetHistogram(GLenum target) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_ResetHistogram, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_ResetMinmax 4113 void __indirect_glResetMinmax(GLenum target) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_ResetMinmax, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } static void -__glx_TexImage_3D4D( unsigned opcode, unsigned dim, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLint border, GLenum format, GLenum type, const GLvoid * pixels ) -{ - __GLXcontext * const gc = __glXGetCurrentContext(); - const GLuint compsize = (pixels != NULL) ? __glImageSize(width, height, depth, format, type, target) : 0; +__glx_TexImage_3D4D(unsigned opcode, unsigned dim, GLenum target, GLint level, + GLint internalformat, GLsizei width, GLsizei height, + GLsizei depth, GLsizei extent, GLint border, + GLenum format, GLenum type, const GLvoid * pixels) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint compsize = + (pixels != NULL) ? __glImageSize(width, height, depth, format, type, + target) : 0; const GLuint cmdlen = 84 + __GLX_PAD(compsize); if (__builtin_expect(gc->currentDpy != NULL, 1)) { if (cmdlen <= gc->maxSmallRenderCommandSize) { - if ( (gc->pc + cmdlen) > gc->bufEnd ) { + if ((gc->pc + cmdlen) > gc->bufEnd) { (void) __glXFlushRenderBuffer(gc, gc->pc); } emit_header(gc->pc, opcode, cmdlen); - (void) memcpy((void *)(gc->pc + 40), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 44), (void *)(&level), 4); - (void) memcpy((void *)(gc->pc + 48), (void *)(&internalformat), 4); - (void) memcpy((void *)(gc->pc + 52), (void *)(&width), 4); - (void) memcpy((void *)(gc->pc + 56), (void *)(&height), 4); - (void) memcpy((void *)(gc->pc + 60), (void *)(&depth), 4); - (void) memcpy((void *)(gc->pc + 64), (void *)(&extent), 4); - (void) memcpy((void *)(gc->pc + 68), (void *)(&border), 4); - (void) memcpy((void *)(gc->pc + 72), (void *)(&format), 4); - (void) memcpy((void *)(gc->pc + 76), (void *)(&type), 4); - (void) memcpy((void *)(gc->pc + 80), (void *)((pixels == NULL) ? one : zero), 4); + (void) memcpy((void *) (gc->pc + 40), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 44), (void *) (&level), 4); + (void) memcpy((void *) (gc->pc + 48), (void *) (&internalformat), + 4); + (void) memcpy((void *) (gc->pc + 52), (void *) (&width), 4); + (void) memcpy((void *) (gc->pc + 56), (void *) (&height), 4); + (void) memcpy((void *) (gc->pc + 60), (void *) (&depth), 4); + (void) memcpy((void *) (gc->pc + 64), (void *) (&extent), 4); + (void) memcpy((void *) (gc->pc + 68), (void *) (&border), 4); + (void) memcpy((void *) (gc->pc + 72), (void *) (&format), 4); + (void) memcpy((void *) (gc->pc + 76), (void *) (&type), 4); + (void) memcpy((void *) (gc->pc + 80), + (void *) ((pixels == NULL) ? one : zero), 4); if (compsize > 0) { - (*gc->fillImage)(gc, dim, width, height, depth, format, type, pixels, gc->pc + 84, gc->pc + 4); - } - else { - (void) memcpy( gc->pc + 4, default_pixel_store_4D, default_pixel_store_4D_size ); + (*gc->fillImage) (gc, dim, width, height, depth, format, type, + pixels, gc->pc + 84, gc->pc + 4); + } else { + (void) memcpy(gc->pc + 4, default_pixel_store_4D, + default_pixel_store_4D_size); } gc->pc += cmdlen; - if (gc->pc > gc->limit) { (void) __glXFlushRenderBuffer(gc, gc->pc); } - } - else { + if (gc->pc > gc->limit) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + } else { const GLint op = opcode; const GLuint cmdlenLarge = cmdlen + 4; - GLubyte * const pc = __glXFlushRenderBuffer(gc, gc->pc); - (void) memcpy((void *)(pc + 0), (void *)(&cmdlenLarge), 4); - (void) memcpy((void *)(pc + 4), (void *)(&op), 4); - (void) memcpy((void *)(pc + 44), (void *)(&target), 4); - (void) memcpy((void *)(pc + 48), (void *)(&level), 4); - (void) memcpy((void *)(pc + 52), (void *)(&internalformat), 4); - (void) memcpy((void *)(pc + 56), (void *)(&width), 4); - (void) memcpy((void *)(pc + 60), (void *)(&height), 4); - (void) memcpy((void *)(pc + 64), (void *)(&depth), 4); - (void) memcpy((void *)(pc + 68), (void *)(&extent), 4); - (void) memcpy((void *)(pc + 72), (void *)(&border), 4); - (void) memcpy((void *)(pc + 76), (void *)(&format), 4); - (void) memcpy((void *)(pc + 80), (void *)(&type), 4); - (void) memcpy((void *)(pc + 84), zero, 4); - __glXSendLargeImage(gc, compsize, dim, width, height, depth, format, type, pixels, pc + 88, pc + 8); + GLubyte *const pc = __glXFlushRenderBuffer(gc, gc->pc); + (void) memcpy((void *) (pc + 0), (void *) (&cmdlenLarge), 4); + (void) memcpy((void *) (pc + 4), (void *) (&op), 4); + (void) memcpy((void *) (pc + 44), (void *) (&target), 4); + (void) memcpy((void *) (pc + 48), (void *) (&level), 4); + (void) memcpy((void *) (pc + 52), (void *) (&internalformat), 4); + (void) memcpy((void *) (pc + 56), (void *) (&width), 4); + (void) memcpy((void *) (pc + 60), (void *) (&height), 4); + (void) memcpy((void *) (pc + 64), (void *) (&depth), 4); + (void) memcpy((void *) (pc + 68), (void *) (&extent), 4); + (void) memcpy((void *) (pc + 72), (void *) (&border), 4); + (void) memcpy((void *) (pc + 76), (void *) (&format), 4); + (void) memcpy((void *) (pc + 80), (void *) (&type), 4); + (void) memcpy((void *) (pc + 84), zero, 4); + __glXSendLargeImage(gc, compsize, dim, width, height, depth, + format, type, pixels, pc + 88, pc + 8); } } } #define X_GLrop_TexImage3D 4114 void -__indirect_glTexImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid * pixels) +__indirect_glTexImage3D(GLenum target, GLint level, GLint internalformat, + GLsizei width, GLsizei height, GLsizei depth, + GLint border, GLenum format, GLenum type, + const GLvoid * pixels) { - __glx_TexImage_3D4D(X_GLrop_TexImage3D, 3, target, level, internalformat, width, height, depth, 1, border, format, type, pixels ); + __glx_TexImage_3D4D(X_GLrop_TexImage3D, 3, target, level, internalformat, + width, height, depth, 1, border, format, type, + pixels); } static void -__glx_TexSubImage_3D4D( unsigned opcode, unsigned dim, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLenum format, GLenum type, const GLvoid * pixels ) -{ - __GLXcontext * const gc = __glXGetCurrentContext(); - const GLuint compsize = (pixels != NULL) ? __glImageSize(width, height, depth, format, type, target) : 0; +__glx_TexSubImage_3D4D(unsigned opcode, unsigned dim, GLenum target, + GLint level, GLint xoffset, GLint yoffset, + GLint zoffset, GLint woffset, GLsizei width, + GLsizei height, GLsizei depth, GLsizei extent, + GLenum format, GLenum type, const GLvoid * pixels) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint compsize = + (pixels != NULL) ? __glImageSize(width, height, depth, format, type, + target) : 0; const GLuint cmdlen = 92 + __GLX_PAD(compsize); if (__builtin_expect(gc->currentDpy != NULL, 1)) { if (cmdlen <= gc->maxSmallRenderCommandSize) { - if ( (gc->pc + cmdlen) > gc->bufEnd ) { + if ((gc->pc + cmdlen) > gc->bufEnd) { (void) __glXFlushRenderBuffer(gc, gc->pc); } emit_header(gc->pc, opcode, cmdlen); - (void) memcpy((void *)(gc->pc + 40), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 44), (void *)(&level), 4); - (void) memcpy((void *)(gc->pc + 48), (void *)(&xoffset), 4); - (void) memcpy((void *)(gc->pc + 52), (void *)(&yoffset), 4); - (void) memcpy((void *)(gc->pc + 56), (void *)(&zoffset), 4); - (void) memcpy((void *)(gc->pc + 60), (void *)(&woffset), 4); - (void) memcpy((void *)(gc->pc + 64), (void *)(&width), 4); - (void) memcpy((void *)(gc->pc + 68), (void *)(&height), 4); - (void) memcpy((void *)(gc->pc + 72), (void *)(&depth), 4); - (void) memcpy((void *)(gc->pc + 76), (void *)(&extent), 4); - (void) memcpy((void *)(gc->pc + 80), (void *)(&format), 4); - (void) memcpy((void *)(gc->pc + 84), (void *)(&type), 4); - (void) memcpy((void *)(gc->pc + 88), (void *)((pixels == NULL) ? one : zero), 4); + (void) memcpy((void *) (gc->pc + 40), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 44), (void *) (&level), 4); + (void) memcpy((void *) (gc->pc + 48), (void *) (&xoffset), 4); + (void) memcpy((void *) (gc->pc + 52), (void *) (&yoffset), 4); + (void) memcpy((void *) (gc->pc + 56), (void *) (&zoffset), 4); + (void) memcpy((void *) (gc->pc + 60), (void *) (&woffset), 4); + (void) memcpy((void *) (gc->pc + 64), (void *) (&width), 4); + (void) memcpy((void *) (gc->pc + 68), (void *) (&height), 4); + (void) memcpy((void *) (gc->pc + 72), (void *) (&depth), 4); + (void) memcpy((void *) (gc->pc + 76), (void *) (&extent), 4); + (void) memcpy((void *) (gc->pc + 80), (void *) (&format), 4); + (void) memcpy((void *) (gc->pc + 84), (void *) (&type), 4); + (void) memcpy((void *) (gc->pc + 88), + (void *) ((pixels == NULL) ? one : zero), 4); if (compsize > 0) { - (*gc->fillImage)(gc, dim, width, height, depth, format, type, pixels, gc->pc + 92, gc->pc + 4); - } - else { - (void) memcpy( gc->pc + 4, default_pixel_store_4D, default_pixel_store_4D_size ); + (*gc->fillImage) (gc, dim, width, height, depth, format, type, + pixels, gc->pc + 92, gc->pc + 4); + } else { + (void) memcpy(gc->pc + 4, default_pixel_store_4D, + default_pixel_store_4D_size); } gc->pc += cmdlen; - if (gc->pc > gc->limit) { (void) __glXFlushRenderBuffer(gc, gc->pc); } - } - else { + if (gc->pc > gc->limit) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + } else { const GLint op = opcode; const GLuint cmdlenLarge = cmdlen + 4; - GLubyte * const pc = __glXFlushRenderBuffer(gc, gc->pc); - (void) memcpy((void *)(pc + 0), (void *)(&cmdlenLarge), 4); - (void) memcpy((void *)(pc + 4), (void *)(&op), 4); - (void) memcpy((void *)(pc + 44), (void *)(&target), 4); - (void) memcpy((void *)(pc + 48), (void *)(&level), 4); - (void) memcpy((void *)(pc + 52), (void *)(&xoffset), 4); - (void) memcpy((void *)(pc + 56), (void *)(&yoffset), 4); - (void) memcpy((void *)(pc + 60), (void *)(&zoffset), 4); - (void) memcpy((void *)(pc + 64), (void *)(&woffset), 4); - (void) memcpy((void *)(pc + 68), (void *)(&width), 4); - (void) memcpy((void *)(pc + 72), (void *)(&height), 4); - (void) memcpy((void *)(pc + 76), (void *)(&depth), 4); - (void) memcpy((void *)(pc + 80), (void *)(&extent), 4); - (void) memcpy((void *)(pc + 84), (void *)(&format), 4); - (void) memcpy((void *)(pc + 88), (void *)(&type), 4); - (void) memcpy((void *)(pc + 92), zero, 4); - __glXSendLargeImage(gc, compsize, dim, width, height, depth, format, type, pixels, pc + 96, pc + 8); + GLubyte *const pc = __glXFlushRenderBuffer(gc, gc->pc); + (void) memcpy((void *) (pc + 0), (void *) (&cmdlenLarge), 4); + (void) memcpy((void *) (pc + 4), (void *) (&op), 4); + (void) memcpy((void *) (pc + 44), (void *) (&target), 4); + (void) memcpy((void *) (pc + 48), (void *) (&level), 4); + (void) memcpy((void *) (pc + 52), (void *) (&xoffset), 4); + (void) memcpy((void *) (pc + 56), (void *) (&yoffset), 4); + (void) memcpy((void *) (pc + 60), (void *) (&zoffset), 4); + (void) memcpy((void *) (pc + 64), (void *) (&woffset), 4); + (void) memcpy((void *) (pc + 68), (void *) (&width), 4); + (void) memcpy((void *) (pc + 72), (void *) (&height), 4); + (void) memcpy((void *) (pc + 76), (void *) (&depth), 4); + (void) memcpy((void *) (pc + 80), (void *) (&extent), 4); + (void) memcpy((void *) (pc + 84), (void *) (&format), 4); + (void) memcpy((void *) (pc + 88), (void *) (&type), 4); + (void) memcpy((void *) (pc + 92), zero, 4); + __glXSendLargeImage(gc, compsize, dim, width, height, depth, + format, type, pixels, pc + 96, pc + 8); } } } #define X_GLrop_TexSubImage3D 4115 void -__indirect_glTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid * pixels) +__indirect_glTexSubImage3D(GLenum target, GLint level, GLint xoffset, + GLint yoffset, GLint zoffset, GLsizei width, + GLsizei height, GLsizei depth, GLenum format, + GLenum type, const GLvoid * pixels) { - __glx_TexSubImage_3D4D(X_GLrop_TexSubImage3D, 3, target, level, xoffset, yoffset, zoffset, 1, width, height, depth, 1, format, type, pixels ); + __glx_TexSubImage_3D4D(X_GLrop_TexSubImage3D, 3, target, level, xoffset, + yoffset, zoffset, 1, width, height, depth, 1, + format, type, pixels); } #define X_GLrop_CopyTexSubImage3D 4123 void -__indirect_glCopyTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) +__indirect_glCopyTexSubImage3D(GLenum target, GLint level, GLint xoffset, + GLint yoffset, GLint zoffset, GLint x, GLint y, + GLsizei width, GLsizei height) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 40; emit_header(gc->pc, X_GLrop_CopyTexSubImage3D, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&level), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&xoffset), 4); - (void) memcpy((void *)(gc->pc + 16), (void *)(&yoffset), 4); - (void) memcpy((void *)(gc->pc + 20), (void *)(&zoffset), 4); - (void) memcpy((void *)(gc->pc + 24), (void *)(&x), 4); - (void) memcpy((void *)(gc->pc + 28), (void *)(&y), 4); - (void) memcpy((void *)(gc->pc + 32), (void *)(&width), 4); - (void) memcpy((void *)(gc->pc + 36), (void *)(&height), 4); - gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&level), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&xoffset), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&yoffset), 4); + (void) memcpy((void *) (gc->pc + 20), (void *) (&zoffset), 4); + (void) memcpy((void *) (gc->pc + 24), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 28), (void *) (&y), 4); + (void) memcpy((void *) (gc->pc + 32), (void *) (&width), 4); + (void) memcpy((void *) (gc->pc + 36), (void *) (&height), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_ActiveTextureARB 197 void __indirect_glActiveTextureARB(GLenum texture) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_ActiveTextureARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&texture), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&texture), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_MultiTexCoord1dvARB 198 void __indirect_glMultiTexCoord1dARB(GLenum target, GLdouble s) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_MultiTexCoord1dvARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&s), 8); - (void) memcpy((void *)(gc->pc + 12), (void *)(&target), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&s), 8); + (void) memcpy((void *) (gc->pc + 12), (void *) (&target), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_MultiTexCoord1dvARB 198 void __indirect_glMultiTexCoord1dvARB(GLenum target, const GLdouble * v) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_MultiTexCoord1dvARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(v), 8); - (void) memcpy((void *)(gc->pc + 12), (void *)(&target), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (v), 8); + (void) memcpy((void *) (gc->pc + 12), (void *) (&target), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_MultiTexCoord1fvARB 199 void __indirect_glMultiTexCoord1fARB(GLenum target, GLfloat s) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_MultiTexCoord1fvARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&s), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&s), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_MultiTexCoord1fvARB 199 void __indirect_glMultiTexCoord1fvARB(GLenum target, const GLfloat * v) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_MultiTexCoord1fvARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(v), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_MultiTexCoord1ivARB 200 void __indirect_glMultiTexCoord1iARB(GLenum target, GLint s) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_MultiTexCoord1ivARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&s), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&s), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_MultiTexCoord1ivARB 200 void __indirect_glMultiTexCoord1ivARB(GLenum target, const GLint * v) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_MultiTexCoord1ivARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(v), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_MultiTexCoord1svARB 201 void __indirect_glMultiTexCoord1sARB(GLenum target, GLshort s) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_MultiTexCoord1svARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&s), 2); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&s), 2); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_MultiTexCoord1svARB 201 void __indirect_glMultiTexCoord1svARB(GLenum target, const GLshort * v) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_MultiTexCoord1svARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(v), 2); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 2); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_MultiTexCoord2dvARB 202 void __indirect_glMultiTexCoord2dARB(GLenum target, GLdouble s, GLdouble t) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 24; emit_header(gc->pc, X_GLrop_MultiTexCoord2dvARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&s), 8); - (void) memcpy((void *)(gc->pc + 12), (void *)(&t), 8); - (void) memcpy((void *)(gc->pc + 20), (void *)(&target), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&s), 8); + (void) memcpy((void *) (gc->pc + 12), (void *) (&t), 8); + (void) memcpy((void *) (gc->pc + 20), (void *) (&target), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_MultiTexCoord2dvARB 202 void __indirect_glMultiTexCoord2dvARB(GLenum target, const GLdouble * v) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 24; emit_header(gc->pc, X_GLrop_MultiTexCoord2dvARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(v), 16); - (void) memcpy((void *)(gc->pc + 20), (void *)(&target), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (v), 16); + (void) memcpy((void *) (gc->pc + 20), (void *) (&target), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_MultiTexCoord2fvARB 203 void __indirect_glMultiTexCoord2fARB(GLenum target, GLfloat s, GLfloat t) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_MultiTexCoord2fvARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&s), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&t), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&s), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&t), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_MultiTexCoord2fvARB 203 void __indirect_glMultiTexCoord2fvARB(GLenum target, const GLfloat * v) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_MultiTexCoord2fvARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(v), 8); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 8); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_MultiTexCoord2ivARB 204 void __indirect_glMultiTexCoord2iARB(GLenum target, GLint s, GLint t) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_MultiTexCoord2ivARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&s), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&t), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&s), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&t), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_MultiTexCoord2ivARB 204 void __indirect_glMultiTexCoord2ivARB(GLenum target, const GLint * v) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_MultiTexCoord2ivARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(v), 8); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 8); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_MultiTexCoord2svARB 205 void __indirect_glMultiTexCoord2sARB(GLenum target, GLshort s, GLshort t) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_MultiTexCoord2svARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&s), 2); - (void) memcpy((void *)(gc->pc + 10), (void *)(&t), 2); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&s), 2); + (void) memcpy((void *) (gc->pc + 10), (void *) (&t), 2); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_MultiTexCoord2svARB 205 void __indirect_glMultiTexCoord2svARB(GLenum target, const GLshort * v) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_MultiTexCoord2svARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(v), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_MultiTexCoord3dvARB 206 void -__indirect_glMultiTexCoord3dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r) +__indirect_glMultiTexCoord3dARB(GLenum target, GLdouble s, GLdouble t, + GLdouble r) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 32; emit_header(gc->pc, X_GLrop_MultiTexCoord3dvARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&s), 8); - (void) memcpy((void *)(gc->pc + 12), (void *)(&t), 8); - (void) memcpy((void *)(gc->pc + 20), (void *)(&r), 8); - (void) memcpy((void *)(gc->pc + 28), (void *)(&target), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&s), 8); + (void) memcpy((void *) (gc->pc + 12), (void *) (&t), 8); + (void) memcpy((void *) (gc->pc + 20), (void *) (&r), 8); + (void) memcpy((void *) (gc->pc + 28), (void *) (&target), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_MultiTexCoord3dvARB 206 void __indirect_glMultiTexCoord3dvARB(GLenum target, const GLdouble * v) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 32; emit_header(gc->pc, X_GLrop_MultiTexCoord3dvARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(v), 24); - (void) memcpy((void *)(gc->pc + 28), (void *)(&target), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (v), 24); + (void) memcpy((void *) (gc->pc + 28), (void *) (&target), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_MultiTexCoord3fvARB 207 void -__indirect_glMultiTexCoord3fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r) +__indirect_glMultiTexCoord3fARB(GLenum target, GLfloat s, GLfloat t, + GLfloat r) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_MultiTexCoord3fvARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&s), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&t), 4); - (void) memcpy((void *)(gc->pc + 16), (void *)(&r), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&s), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&t), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&r), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_MultiTexCoord3fvARB 207 void __indirect_glMultiTexCoord3fvARB(GLenum target, const GLfloat * v) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_MultiTexCoord3fvARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(v), 12); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 12); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_MultiTexCoord3ivARB 208 void __indirect_glMultiTexCoord3iARB(GLenum target, GLint s, GLint t, GLint r) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_MultiTexCoord3ivARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&s), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&t), 4); - (void) memcpy((void *)(gc->pc + 16), (void *)(&r), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&s), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&t), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&r), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_MultiTexCoord3ivARB 208 void __indirect_glMultiTexCoord3ivARB(GLenum target, const GLint * v) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_MultiTexCoord3ivARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(v), 12); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 12); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_MultiTexCoord3svARB 209 void -__indirect_glMultiTexCoord3sARB(GLenum target, GLshort s, GLshort t, GLshort r) +__indirect_glMultiTexCoord3sARB(GLenum target, GLshort s, GLshort t, + GLshort r) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_MultiTexCoord3svARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&s), 2); - (void) memcpy((void *)(gc->pc + 10), (void *)(&t), 2); - (void) memcpy((void *)(gc->pc + 12), (void *)(&r), 2); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&s), 2); + (void) memcpy((void *) (gc->pc + 10), (void *) (&t), 2); + (void) memcpy((void *) (gc->pc + 12), (void *) (&r), 2); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_MultiTexCoord3svARB 209 void __indirect_glMultiTexCoord3svARB(GLenum target, const GLshort * v) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_MultiTexCoord3svARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(v), 6); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 6); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_MultiTexCoord4dvARB 210 void -__indirect_glMultiTexCoord4dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q) +__indirect_glMultiTexCoord4dARB(GLenum target, GLdouble s, GLdouble t, + GLdouble r, GLdouble q) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 40; emit_header(gc->pc, X_GLrop_MultiTexCoord4dvARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&s), 8); - (void) memcpy((void *)(gc->pc + 12), (void *)(&t), 8); - (void) memcpy((void *)(gc->pc + 20), (void *)(&r), 8); - (void) memcpy((void *)(gc->pc + 28), (void *)(&q), 8); - (void) memcpy((void *)(gc->pc + 36), (void *)(&target), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&s), 8); + (void) memcpy((void *) (gc->pc + 12), (void *) (&t), 8); + (void) memcpy((void *) (gc->pc + 20), (void *) (&r), 8); + (void) memcpy((void *) (gc->pc + 28), (void *) (&q), 8); + (void) memcpy((void *) (gc->pc + 36), (void *) (&target), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_MultiTexCoord4dvARB 210 void __indirect_glMultiTexCoord4dvARB(GLenum target, const GLdouble * v) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 40; emit_header(gc->pc, X_GLrop_MultiTexCoord4dvARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(v), 32); - (void) memcpy((void *)(gc->pc + 36), (void *)(&target), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (v), 32); + (void) memcpy((void *) (gc->pc + 36), (void *) (&target), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_MultiTexCoord4fvARB 211 void -__indirect_glMultiTexCoord4fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q) +__indirect_glMultiTexCoord4fARB(GLenum target, GLfloat s, GLfloat t, + GLfloat r, GLfloat q) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 24; emit_header(gc->pc, X_GLrop_MultiTexCoord4fvARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&s), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&t), 4); - (void) memcpy((void *)(gc->pc + 16), (void *)(&r), 4); - (void) memcpy((void *)(gc->pc + 20), (void *)(&q), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&s), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&t), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&r), 4); + (void) memcpy((void *) (gc->pc + 20), (void *) (&q), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_MultiTexCoord4fvARB 211 void __indirect_glMultiTexCoord4fvARB(GLenum target, const GLfloat * v) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 24; emit_header(gc->pc, X_GLrop_MultiTexCoord4fvARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(v), 16); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 16); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_MultiTexCoord4ivARB 212 void -__indirect_glMultiTexCoord4iARB(GLenum target, GLint s, GLint t, GLint r, GLint q) +__indirect_glMultiTexCoord4iARB(GLenum target, GLint s, GLint t, GLint r, + GLint q) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 24; emit_header(gc->pc, X_GLrop_MultiTexCoord4ivARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&s), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&t), 4); - (void) memcpy((void *)(gc->pc + 16), (void *)(&r), 4); - (void) memcpy((void *)(gc->pc + 20), (void *)(&q), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&s), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&t), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&r), 4); + (void) memcpy((void *) (gc->pc + 20), (void *) (&q), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_MultiTexCoord4ivARB 212 void __indirect_glMultiTexCoord4ivARB(GLenum target, const GLint * v) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 24; emit_header(gc->pc, X_GLrop_MultiTexCoord4ivARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(v), 16); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 16); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_MultiTexCoord4svARB 213 void -__indirect_glMultiTexCoord4sARB(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q) +__indirect_glMultiTexCoord4sARB(GLenum target, GLshort s, GLshort t, + GLshort r, GLshort q) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_MultiTexCoord4svARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&s), 2); - (void) memcpy((void *)(gc->pc + 10), (void *)(&t), 2); - (void) memcpy((void *)(gc->pc + 12), (void *)(&r), 2); - (void) memcpy((void *)(gc->pc + 14), (void *)(&q), 2); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&s), 2); + (void) memcpy((void *) (gc->pc + 10), (void *) (&t), 2); + (void) memcpy((void *) (gc->pc + 12), (void *) (&r), 2); + (void) memcpy((void *) (gc->pc + 14), (void *) (&q), 2); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_MultiTexCoord4svARB 213 void __indirect_glMultiTexCoord4svARB(GLenum target, const GLshort * v) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_MultiTexCoord4svARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(v), 8); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 8); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_SampleCoverageARB 229 void __indirect_glSampleCoverageARB(GLclampf value, GLboolean invert) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_SampleCoverageARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&value), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&invert), 1); + (void) memcpy((void *) (gc->pc + 4), (void *) (&value), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&invert), 1); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLvop_GetProgramStringARB 1308 void __indirect_glGetProgramStringARB(GLenum target, GLenum pname, GLvoid * string) { - __GLXcontext * const gc = __glXGetCurrentContext(); - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; const GLuint cmdlen = 8; if (__builtin_expect(dpy != NULL, 1)) { - GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetProgramStringARB, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&target), 4); - (void) memcpy((void *)(pc + 4), (void *)(&pname), 4); + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_GetProgramStringARB, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); (void) __glXReadReply(dpy, 1, string, GL_TRUE); - UnlockDisplay(dpy); SyncHandle(); + UnlockDisplay(dpy); + SyncHandle(); } return; } @@ -5897,171 +7452,202 @@ __indirect_glGetProgramStringARB(GLenum target, GLenum pname, GLvoid * string) void __indirect_glGetProgramivARB(GLenum target, GLenum pname, GLint * params) { - __GLXcontext * const gc = __glXGetCurrentContext(); - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; const GLuint cmdlen = 8; if (__builtin_expect(dpy != NULL, 1)) { - GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetProgramivARB, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&target), 4); - (void) memcpy((void *)(pc + 4), (void *)(&pname), 4); + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_GetProgramivARB, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); (void) __glXReadReply(dpy, 4, params, GL_FALSE); - UnlockDisplay(dpy); SyncHandle(); + UnlockDisplay(dpy); + SyncHandle(); } return; } #define X_GLrop_ProgramEnvParameter4dvARB 4185 void -__indirect_glProgramEnvParameter4dARB(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) +__indirect_glProgramEnvParameter4dARB(GLenum target, GLuint index, GLdouble x, + GLdouble y, GLdouble z, GLdouble w) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 44; emit_header(gc->pc, X_GLrop_ProgramEnvParameter4dvARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&x), 8); - (void) memcpy((void *)(gc->pc + 20), (void *)(&y), 8); - (void) memcpy((void *)(gc->pc + 28), (void *)(&z), 8); - (void) memcpy((void *)(gc->pc + 36), (void *)(&w), 8); - gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&x), 8); + (void) memcpy((void *) (gc->pc + 20), (void *) (&y), 8); + (void) memcpy((void *) (gc->pc + 28), (void *) (&z), 8); + (void) memcpy((void *) (gc->pc + 36), (void *) (&w), 8); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_ProgramEnvParameter4dvARB 4185 void -__indirect_glProgramEnvParameter4dvARB(GLenum target, GLuint index, const GLdouble * params) +__indirect_glProgramEnvParameter4dvARB(GLenum target, GLuint index, + const GLdouble * params) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 44; emit_header(gc->pc, X_GLrop_ProgramEnvParameter4dvARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(params), 32); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (params), 32); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_ProgramEnvParameter4fvARB 4184 void -__indirect_glProgramEnvParameter4fARB(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) +__indirect_glProgramEnvParameter4fARB(GLenum target, GLuint index, GLfloat x, + GLfloat y, GLfloat z, GLfloat w) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 28; emit_header(gc->pc, X_GLrop_ProgramEnvParameter4fvARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&x), 4); - (void) memcpy((void *)(gc->pc + 16), (void *)(&y), 4); - (void) memcpy((void *)(gc->pc + 20), (void *)(&z), 4); - (void) memcpy((void *)(gc->pc + 24), (void *)(&w), 4); - gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&y), 4); + (void) memcpy((void *) (gc->pc + 20), (void *) (&z), 4); + (void) memcpy((void *) (gc->pc + 24), (void *) (&w), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_ProgramEnvParameter4fvARB 4184 void -__indirect_glProgramEnvParameter4fvARB(GLenum target, GLuint index, const GLfloat * params) +__indirect_glProgramEnvParameter4fvARB(GLenum target, GLuint index, + const GLfloat * params) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 28; emit_header(gc->pc, X_GLrop_ProgramEnvParameter4fvARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(params), 16); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (params), 16); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_ProgramLocalParameter4dvARB 4216 void -__indirect_glProgramLocalParameter4dARB(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) +__indirect_glProgramLocalParameter4dARB(GLenum target, GLuint index, + GLdouble x, GLdouble y, GLdouble z, + GLdouble w) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 44; emit_header(gc->pc, X_GLrop_ProgramLocalParameter4dvARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&x), 8); - (void) memcpy((void *)(gc->pc + 20), (void *)(&y), 8); - (void) memcpy((void *)(gc->pc + 28), (void *)(&z), 8); - (void) memcpy((void *)(gc->pc + 36), (void *)(&w), 8); - gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&x), 8); + (void) memcpy((void *) (gc->pc + 20), (void *) (&y), 8); + (void) memcpy((void *) (gc->pc + 28), (void *) (&z), 8); + (void) memcpy((void *) (gc->pc + 36), (void *) (&w), 8); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_ProgramLocalParameter4dvARB 4216 void -__indirect_glProgramLocalParameter4dvARB(GLenum target, GLuint index, const GLdouble * params) +__indirect_glProgramLocalParameter4dvARB(GLenum target, GLuint index, + const GLdouble * params) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 44; emit_header(gc->pc, X_GLrop_ProgramLocalParameter4dvARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(params), 32); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (params), 32); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_ProgramLocalParameter4fvARB 4215 void -__indirect_glProgramLocalParameter4fARB(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) +__indirect_glProgramLocalParameter4fARB(GLenum target, GLuint index, + GLfloat x, GLfloat y, GLfloat z, + GLfloat w) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 28; emit_header(gc->pc, X_GLrop_ProgramLocalParameter4fvARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&x), 4); - (void) memcpy((void *)(gc->pc + 16), (void *)(&y), 4); - (void) memcpy((void *)(gc->pc + 20), (void *)(&z), 4); - (void) memcpy((void *)(gc->pc + 24), (void *)(&w), 4); - gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&y), 4); + (void) memcpy((void *) (gc->pc + 20), (void *) (&z), 4); + (void) memcpy((void *) (gc->pc + 24), (void *) (&w), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_ProgramLocalParameter4fvARB 4215 void -__indirect_glProgramLocalParameter4fvARB(GLenum target, GLuint index, const GLfloat * params) +__indirect_glProgramLocalParameter4fvARB(GLenum target, GLuint index, + const GLfloat * params) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 28; emit_header(gc->pc, X_GLrop_ProgramLocalParameter4fvARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(params), 16); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (params), 16); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_ProgramStringARB 4217 void -__indirect_glProgramStringARB(GLenum target, GLenum format, GLsizei len, const GLvoid * string) +__indirect_glProgramStringARB(GLenum target, GLenum format, GLsizei len, + const GLvoid * string) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16 + __GLX_PAD(len); if (__builtin_expect((len >= 0) && (gc->currentDpy != NULL), 1)) { if (cmdlen <= gc->maxSmallRenderCommandSize) { - if ( (gc->pc + cmdlen) > gc->bufEnd ) { + if ((gc->pc + cmdlen) > gc->bufEnd) { (void) __glXFlushRenderBuffer(gc, gc->pc); } emit_header(gc->pc, X_GLrop_ProgramStringARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&format), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&len), 4); - (void) memcpy((void *)(gc->pc + 16), (void *)(string), len); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&format), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&len), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (string), len); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } - } - else { + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + } else { const GLint op = X_GLrop_ProgramStringARB; const GLuint cmdlenLarge = cmdlen + 4; - GLubyte * const pc = __glXFlushRenderBuffer(gc, gc->pc); - (void) memcpy((void *)(pc + 0), (void *)(&cmdlenLarge), 4); - (void) memcpy((void *)(pc + 4), (void *)(&op), 4); - (void) memcpy((void *)(pc + 8), (void *)(&target), 4); - (void) memcpy((void *)(pc + 12), (void *)(&format), 4); - (void) memcpy((void *)(pc + 16), (void *)(&len), 4); + GLubyte *const pc = __glXFlushRenderBuffer(gc, gc->pc); + (void) memcpy((void *) (pc + 0), (void *) (&cmdlenLarge), 4); + (void) memcpy((void *) (pc + 4), (void *) (&op), 4); + (void) memcpy((void *) (pc + 8), (void *) (&target), 4); + (void) memcpy((void *) (pc + 12), (void *) (&format), 4); + (void) memcpy((void *) (pc + 16), (void *) (&len), 4); __glXSendLargeCommand(gc, pc, 20, string, len); } } @@ -6071,521 +7657,602 @@ __indirect_glProgramStringARB(GLenum target, GLenum format, GLsizei len, const G void __indirect_glVertexAttrib1dARB(GLuint index, GLdouble x) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_VertexAttrib1dvARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&x), 8); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&x), 8); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_VertexAttrib1dvARB 4197 void __indirect_glVertexAttrib1dvARB(GLuint index, const GLdouble * v) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_VertexAttrib1dvARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(v), 8); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 8); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_VertexAttrib1fvARB 4193 void __indirect_glVertexAttrib1fARB(GLuint index, GLfloat x) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_VertexAttrib1fvARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&x), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&x), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_VertexAttrib1fvARB 4193 void __indirect_glVertexAttrib1fvARB(GLuint index, const GLfloat * v) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_VertexAttrib1fvARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(v), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_VertexAttrib1svARB 4189 void __indirect_glVertexAttrib1sARB(GLuint index, GLshort x) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_VertexAttrib1svARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&x), 2); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&x), 2); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_VertexAttrib1svARB 4189 void __indirect_glVertexAttrib1svARB(GLuint index, const GLshort * v) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_VertexAttrib1svARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(v), 2); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 2); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_VertexAttrib2dvARB 4198 void __indirect_glVertexAttrib2dARB(GLuint index, GLdouble x, GLdouble y) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 24; emit_header(gc->pc, X_GLrop_VertexAttrib2dvARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&x), 8); - (void) memcpy((void *)(gc->pc + 16), (void *)(&y), 8); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&x), 8); + (void) memcpy((void *) (gc->pc + 16), (void *) (&y), 8); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_VertexAttrib2dvARB 4198 void __indirect_glVertexAttrib2dvARB(GLuint index, const GLdouble * v) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 24; emit_header(gc->pc, X_GLrop_VertexAttrib2dvARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(v), 16); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 16); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_VertexAttrib2fvARB 4194 void __indirect_glVertexAttrib2fARB(GLuint index, GLfloat x, GLfloat y) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_VertexAttrib2fvARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&x), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&y), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&y), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_VertexAttrib2fvARB 4194 void __indirect_glVertexAttrib2fvARB(GLuint index, const GLfloat * v) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_VertexAttrib2fvARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(v), 8); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 8); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_VertexAttrib2svARB 4190 void __indirect_glVertexAttrib2sARB(GLuint index, GLshort x, GLshort y) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_VertexAttrib2svARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&x), 2); - (void) memcpy((void *)(gc->pc + 10), (void *)(&y), 2); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&x), 2); + (void) memcpy((void *) (gc->pc + 10), (void *) (&y), 2); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_VertexAttrib2svARB 4190 void __indirect_glVertexAttrib2svARB(GLuint index, const GLshort * v) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_VertexAttrib2svARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(v), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_VertexAttrib3dvARB 4199 void -__indirect_glVertexAttrib3dARB(GLuint index, GLdouble x, GLdouble y, GLdouble z) +__indirect_glVertexAttrib3dARB(GLuint index, GLdouble x, GLdouble y, + GLdouble z) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 32; emit_header(gc->pc, X_GLrop_VertexAttrib3dvARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&x), 8); - (void) memcpy((void *)(gc->pc + 16), (void *)(&y), 8); - (void) memcpy((void *)(gc->pc + 24), (void *)(&z), 8); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&x), 8); + (void) memcpy((void *) (gc->pc + 16), (void *) (&y), 8); + (void) memcpy((void *) (gc->pc + 24), (void *) (&z), 8); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_VertexAttrib3dvARB 4199 void __indirect_glVertexAttrib3dvARB(GLuint index, const GLdouble * v) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 32; emit_header(gc->pc, X_GLrop_VertexAttrib3dvARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(v), 24); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 24); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_VertexAttrib3fvARB 4195 void __indirect_glVertexAttrib3fARB(GLuint index, GLfloat x, GLfloat y, GLfloat z) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_VertexAttrib3fvARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&x), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&y), 4); - (void) memcpy((void *)(gc->pc + 16), (void *)(&z), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&y), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&z), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_VertexAttrib3fvARB 4195 void __indirect_glVertexAttrib3fvARB(GLuint index, const GLfloat * v) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_VertexAttrib3fvARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(v), 12); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 12); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_VertexAttrib3svARB 4191 void __indirect_glVertexAttrib3sARB(GLuint index, GLshort x, GLshort y, GLshort z) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_VertexAttrib3svARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&x), 2); - (void) memcpy((void *)(gc->pc + 10), (void *)(&y), 2); - (void) memcpy((void *)(gc->pc + 12), (void *)(&z), 2); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&x), 2); + (void) memcpy((void *) (gc->pc + 10), (void *) (&y), 2); + (void) memcpy((void *) (gc->pc + 12), (void *) (&z), 2); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_VertexAttrib3svARB 4191 void __indirect_glVertexAttrib3svARB(GLuint index, const GLshort * v) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_VertexAttrib3svARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(v), 6); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 6); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_VertexAttrib4NbvARB 4235 void __indirect_glVertexAttrib4NbvARB(GLuint index, const GLbyte * v) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_VertexAttrib4NbvARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(v), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_VertexAttrib4NivARB 4237 void __indirect_glVertexAttrib4NivARB(GLuint index, const GLint * v) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 24; emit_header(gc->pc, X_GLrop_VertexAttrib4NivARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(v), 16); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 16); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_VertexAttrib4NsvARB 4236 void __indirect_glVertexAttrib4NsvARB(GLuint index, const GLshort * v) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_VertexAttrib4NsvARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(v), 8); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 8); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_VertexAttrib4NubvARB 4201 void -__indirect_glVertexAttrib4NubARB(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w) +__indirect_glVertexAttrib4NubARB(GLuint index, GLubyte x, GLubyte y, + GLubyte z, GLubyte w) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_VertexAttrib4NubvARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&x), 1); - (void) memcpy((void *)(gc->pc + 9), (void *)(&y), 1); - (void) memcpy((void *)(gc->pc + 10), (void *)(&z), 1); - (void) memcpy((void *)(gc->pc + 11), (void *)(&w), 1); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&x), 1); + (void) memcpy((void *) (gc->pc + 9), (void *) (&y), 1); + (void) memcpy((void *) (gc->pc + 10), (void *) (&z), 1); + (void) memcpy((void *) (gc->pc + 11), (void *) (&w), 1); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_VertexAttrib4NubvARB 4201 void __indirect_glVertexAttrib4NubvARB(GLuint index, const GLubyte * v) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_VertexAttrib4NubvARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(v), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_VertexAttrib4NuivARB 4239 void __indirect_glVertexAttrib4NuivARB(GLuint index, const GLuint * v) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 24; emit_header(gc->pc, X_GLrop_VertexAttrib4NuivARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(v), 16); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 16); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_VertexAttrib4NusvARB 4238 void __indirect_glVertexAttrib4NusvARB(GLuint index, const GLushort * v) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_VertexAttrib4NusvARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(v), 8); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 8); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_VertexAttrib4bvARB 4230 void __indirect_glVertexAttrib4bvARB(GLuint index, const GLbyte * v) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_VertexAttrib4bvARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(v), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_VertexAttrib4dvARB 4200 void -__indirect_glVertexAttrib4dARB(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) +__indirect_glVertexAttrib4dARB(GLuint index, GLdouble x, GLdouble y, + GLdouble z, GLdouble w) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 40; emit_header(gc->pc, X_GLrop_VertexAttrib4dvARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&x), 8); - (void) memcpy((void *)(gc->pc + 16), (void *)(&y), 8); - (void) memcpy((void *)(gc->pc + 24), (void *)(&z), 8); - (void) memcpy((void *)(gc->pc + 32), (void *)(&w), 8); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&x), 8); + (void) memcpy((void *) (gc->pc + 16), (void *) (&y), 8); + (void) memcpy((void *) (gc->pc + 24), (void *) (&z), 8); + (void) memcpy((void *) (gc->pc + 32), (void *) (&w), 8); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_VertexAttrib4dvARB 4200 void __indirect_glVertexAttrib4dvARB(GLuint index, const GLdouble * v) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 40; emit_header(gc->pc, X_GLrop_VertexAttrib4dvARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(v), 32); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 32); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_VertexAttrib4fvARB 4196 void -__indirect_glVertexAttrib4fARB(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) +__indirect_glVertexAttrib4fARB(GLuint index, GLfloat x, GLfloat y, GLfloat z, + GLfloat w) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 24; emit_header(gc->pc, X_GLrop_VertexAttrib4fvARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&x), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&y), 4); - (void) memcpy((void *)(gc->pc + 16), (void *)(&z), 4); - (void) memcpy((void *)(gc->pc + 20), (void *)(&w), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&y), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&z), 4); + (void) memcpy((void *) (gc->pc + 20), (void *) (&w), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_VertexAttrib4fvARB 4196 void __indirect_glVertexAttrib4fvARB(GLuint index, const GLfloat * v) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 24; emit_header(gc->pc, X_GLrop_VertexAttrib4fvARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(v), 16); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 16); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_VertexAttrib4ivARB 4231 void __indirect_glVertexAttrib4ivARB(GLuint index, const GLint * v) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 24; emit_header(gc->pc, X_GLrop_VertexAttrib4ivARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(v), 16); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 16); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_VertexAttrib4svARB 4192 void -__indirect_glVertexAttrib4sARB(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w) +__indirect_glVertexAttrib4sARB(GLuint index, GLshort x, GLshort y, GLshort z, + GLshort w) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_VertexAttrib4svARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&x), 2); - (void) memcpy((void *)(gc->pc + 10), (void *)(&y), 2); - (void) memcpy((void *)(gc->pc + 12), (void *)(&z), 2); - (void) memcpy((void *)(gc->pc + 14), (void *)(&w), 2); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&x), 2); + (void) memcpy((void *) (gc->pc + 10), (void *) (&y), 2); + (void) memcpy((void *) (gc->pc + 12), (void *) (&z), 2); + (void) memcpy((void *) (gc->pc + 14), (void *) (&w), 2); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_VertexAttrib4svARB 4192 void __indirect_glVertexAttrib4svARB(GLuint index, const GLshort * v) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_VertexAttrib4svARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(v), 8); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 8); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_VertexAttrib4ubvARB 4232 void __indirect_glVertexAttrib4ubvARB(GLuint index, const GLubyte * v) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_VertexAttrib4ubvARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(v), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_VertexAttrib4uivARB 4234 void __indirect_glVertexAttrib4uivARB(GLuint index, const GLuint * v) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 24; emit_header(gc->pc, X_GLrop_VertexAttrib4uivARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(v), 16); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 16); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_VertexAttrib4usvARB 4233 void __indirect_glVertexAttrib4usvARB(GLuint index, const GLushort * v) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_VertexAttrib4usvARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(v), 8); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 8); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_BeginQueryARB 231 void __indirect_glBeginQueryARB(GLenum target, GLuint id) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_BeginQueryARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&id), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&id), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLsop_DeleteQueriesARB 161 void __indirect_glDeleteQueriesARB(GLsizei n, const GLuint * ids) { - __GLXcontext * const gc = __glXGetCurrentContext(); - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; const GLuint cmdlen = 4 + __GLX_PAD((n * 4)); if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) { #ifdef USE_XCB - XCBConnection *c = XCBConnectionOfDisplay(dpy); + xcb_connection_t *c = XGetXCBConnection(dpy); (void) __glXFlushRenderBuffer(gc, gc->pc); - XCBGlxDeleteQueriesARB(c, gc->currentContextTag, n, ids); + xcb_glx_delete_queries_arb(c, gc->currentContextTag, n, ids); #else - GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_DeleteQueriesARB, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&n), 4); - (void) memcpy((void *)(pc + 4), (void *)(ids), (n * 4)); - UnlockDisplay(dpy); SyncHandle(); + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_DeleteQueriesARB, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&n), 4); + (void) memcpy((void *) (pc + 4), (void *) (ids), (n * 4)); + UnlockDisplay(dpy); + SyncHandle(); #endif /* USE_XCB */ } return; @@ -6595,33 +8262,44 @@ __indirect_glDeleteQueriesARB(GLsizei n, const GLuint * ids) void __indirect_glEndQueryARB(GLenum target) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_EndQueryARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLsop_GenQueriesARB 162 void __indirect_glGenQueriesARB(GLsizei n, GLuint * ids) { - __GLXcontext * const gc = __glXGetCurrentContext(); - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; const GLuint cmdlen = 4; if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) { #ifdef USE_XCB - XCBConnection *c = XCBConnectionOfDisplay(dpy); + xcb_connection_t *c = XGetXCBConnection(dpy); (void) __glXFlushRenderBuffer(gc, gc->pc); - XCBGlxGenQueriesARBRep *reply = XCBGlxGenQueriesARBReply(c, XCBGlxGenQueriesARB(c, gc->currentContextTag, n), NULL); - (void)memcpy(ids, XCBGlxGenQueriesARBData(reply), XCBGlxGenQueriesARBDataLength(reply) * sizeof(GLuint)); + xcb_glx_gen_queries_arb_reply_t *reply = + xcb_glx_gen_queries_arb_reply(c, + xcb_glx_gen_queries_arb(c, + gc-> + currentContextTag, + n), NULL); + (void) memcpy(ids, xcb_glx_gen_queries_arb_data(reply), + xcb_glx_gen_queries_arb_data_length(reply) * + sizeof(GLuint)); free(reply); #else - GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GenQueriesARB, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&n), 4); + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GenQueriesARB, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&n), 4); (void) __glXReadReply(dpy, 4, ids, GL_TRUE); - UnlockDisplay(dpy); SyncHandle(); + UnlockDisplay(dpy); + SyncHandle(); #endif /* USE_XCB */ } return; @@ -6631,25 +8309,33 @@ __indirect_glGenQueriesARB(GLsizei n, GLuint * ids) void __indirect_glGetQueryObjectivARB(GLuint id, GLenum pname, GLint * params) { - __GLXcontext * const gc = __glXGetCurrentContext(); - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; const GLuint cmdlen = 8; if (__builtin_expect(dpy != NULL, 1)) { #ifdef USE_XCB - XCBConnection *c = XCBConnectionOfDisplay(dpy); + xcb_connection_t *c = XGetXCBConnection(dpy); (void) __glXFlushRenderBuffer(gc, gc->pc); - XCBGlxGetQueryObjectivARBRep *reply = XCBGlxGetQueryObjectivARBReply(c, XCBGlxGetQueryObjectivARB(c, gc->currentContextTag, id, pname), NULL); - if (XCBGlxGetQueryObjectivARBDataLength(reply) == 0) - (void)memcpy(params, &reply->datum, sizeof(reply->datum)); + xcb_glx_get_query_objectiv_arb_reply_t *reply = + xcb_glx_get_query_objectiv_arb_reply(c, + xcb_glx_get_query_objectiv_arb + (c, gc->currentContextTag, + id, pname), NULL); + if (xcb_glx_get_query_objectiv_arb_data_length(reply) == 0) + (void) memcpy(params, &reply->datum, sizeof(reply->datum)); else - (void)memcpy(params, XCBGlxGetQueryObjectivARBData(reply), XCBGlxGetQueryObjectivARBDataLength(reply) * sizeof(GLint)); + (void) memcpy(params, xcb_glx_get_query_objectiv_arb_data(reply), + xcb_glx_get_query_objectiv_arb_data_length(reply) * + sizeof(GLint)); free(reply); #else - GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetQueryObjectivARB, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&id), 4); - (void) memcpy((void *)(pc + 4), (void *)(&pname), 4); + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetQueryObjectivARB, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&id), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); (void) __glXReadReply(dpy, 4, params, GL_FALSE); - UnlockDisplay(dpy); SyncHandle(); + UnlockDisplay(dpy); + SyncHandle(); #endif /* USE_XCB */ } return; @@ -6659,25 +8345,33 @@ __indirect_glGetQueryObjectivARB(GLuint id, GLenum pname, GLint * params) void __indirect_glGetQueryObjectuivARB(GLuint id, GLenum pname, GLuint * params) { - __GLXcontext * const gc = __glXGetCurrentContext(); - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; const GLuint cmdlen = 8; if (__builtin_expect(dpy != NULL, 1)) { #ifdef USE_XCB - XCBConnection *c = XCBConnectionOfDisplay(dpy); + xcb_connection_t *c = XGetXCBConnection(dpy); (void) __glXFlushRenderBuffer(gc, gc->pc); - XCBGlxGetQueryObjectuivARBRep *reply = XCBGlxGetQueryObjectuivARBReply(c, XCBGlxGetQueryObjectuivARB(c, gc->currentContextTag, id, pname), NULL); - if (XCBGlxGetQueryObjectuivARBDataLength(reply) == 0) - (void)memcpy(params, &reply->datum, sizeof(reply->datum)); + xcb_glx_get_query_objectuiv_arb_reply_t *reply = + xcb_glx_get_query_objectuiv_arb_reply(c, + xcb_glx_get_query_objectuiv_arb + (c, gc->currentContextTag, + id, pname), NULL); + if (xcb_glx_get_query_objectuiv_arb_data_length(reply) == 0) + (void) memcpy(params, &reply->datum, sizeof(reply->datum)); else - (void)memcpy(params, XCBGlxGetQueryObjectuivARBData(reply), XCBGlxGetQueryObjectuivARBDataLength(reply) * sizeof(GLuint)); + (void) memcpy(params, xcb_glx_get_query_objectuiv_arb_data(reply), + xcb_glx_get_query_objectuiv_arb_data_length(reply) * + sizeof(GLuint)); free(reply); #else - GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetQueryObjectuivARB, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&id), 4); - (void) memcpy((void *)(pc + 4), (void *)(&pname), 4); + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetQueryObjectuivARB, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&id), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); (void) __glXReadReply(dpy, 4, params, GL_FALSE); - UnlockDisplay(dpy); SyncHandle(); + UnlockDisplay(dpy); + SyncHandle(); #endif /* USE_XCB */ } return; @@ -6687,25 +8381,36 @@ __indirect_glGetQueryObjectuivARB(GLuint id, GLenum pname, GLuint * params) void __indirect_glGetQueryivARB(GLenum target, GLenum pname, GLint * params) { - __GLXcontext * const gc = __glXGetCurrentContext(); - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; const GLuint cmdlen = 8; if (__builtin_expect(dpy != NULL, 1)) { #ifdef USE_XCB - XCBConnection *c = XCBConnectionOfDisplay(dpy); + xcb_connection_t *c = XGetXCBConnection(dpy); (void) __glXFlushRenderBuffer(gc, gc->pc); - XCBGlxGetQueryivARBRep *reply = XCBGlxGetQueryivARBReply(c, XCBGlxGetQueryivARB(c, gc->currentContextTag, target, pname), NULL); - if (XCBGlxGetQueryivARBDataLength(reply) == 0) - (void)memcpy(params, &reply->datum, sizeof(reply->datum)); + xcb_glx_get_queryiv_arb_reply_t *reply = + xcb_glx_get_queryiv_arb_reply(c, + xcb_glx_get_queryiv_arb(c, + gc-> + currentContextTag, + target, + pname), + NULL); + if (xcb_glx_get_queryiv_arb_data_length(reply) == 0) + (void) memcpy(params, &reply->datum, sizeof(reply->datum)); else - (void)memcpy(params, XCBGlxGetQueryivARBData(reply), XCBGlxGetQueryivARBDataLength(reply) * sizeof(GLint)); + (void) memcpy(params, xcb_glx_get_queryiv_arb_data(reply), + xcb_glx_get_queryiv_arb_data_length(reply) * + sizeof(GLint)); free(reply); #else - GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetQueryivARB, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&target), 4); - (void) memcpy((void *)(pc + 4), (void *)(&pname), 4); + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_GetQueryivARB, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); (void) __glXReadReply(dpy, 4, params, GL_FALSE); - UnlockDisplay(dpy); SyncHandle(); + UnlockDisplay(dpy); + SyncHandle(); #endif /* USE_XCB */ } return; @@ -6715,22 +8420,29 @@ __indirect_glGetQueryivARB(GLenum target, GLenum pname, GLint * params) GLboolean __indirect_glIsQueryARB(GLuint id) { - __GLXcontext * const gc = __glXGetCurrentContext(); - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; GLboolean retval = (GLboolean) 0; const GLuint cmdlen = 4; if (__builtin_expect(dpy != NULL, 1)) { #ifdef USE_XCB - XCBConnection *c = XCBConnectionOfDisplay(dpy); + xcb_connection_t *c = XGetXCBConnection(dpy); (void) __glXFlushRenderBuffer(gc, gc->pc); - XCBGlxIsQueryARBRep *reply = XCBGlxIsQueryARBReply(c, XCBGlxIsQueryARB(c, gc->currentContextTag, id), NULL); + xcb_glx_is_query_arb_reply_t *reply = + xcb_glx_is_query_arb_reply(c, + xcb_glx_is_query_arb(c, + gc-> + currentContextTag, + id), NULL); retval = reply->ret_val; free(reply); #else - GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_IsQueryARB, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&id), 4); + GLubyte const *pc = + __glXSetupSingleRequest(gc, X_GLsop_IsQueryARB, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&id), 4); retval = (GLboolean) __glXReadReply(dpy, 0, NULL, GL_FALSE); - UnlockDisplay(dpy); SyncHandle(); + UnlockDisplay(dpy); + SyncHandle(); #endif /* USE_XCB */ } return retval; @@ -6740,445 +8452,377 @@ __indirect_glIsQueryARB(GLuint id) void __indirect_glDrawBuffersARB(GLsizei n, const GLenum * bufs) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8 + __GLX_PAD((n * 4)); if (__builtin_expect((n >= 0) && (gc->currentDpy != NULL), 1)) { if (cmdlen <= gc->maxSmallRenderCommandSize) { - if ( (gc->pc + cmdlen) > gc->bufEnd ) { + if ((gc->pc + cmdlen) > gc->bufEnd) { (void) __glXFlushRenderBuffer(gc, gc->pc); } emit_header(gc->pc, X_GLrop_DrawBuffersARB, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&n), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(bufs), (n * 4)); + (void) memcpy((void *) (gc->pc + 4), (void *) (&n), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (bufs), (n * 4)); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } - } - else { + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } + } else { const GLint op = X_GLrop_DrawBuffersARB; const GLuint cmdlenLarge = cmdlen + 4; - GLubyte * const pc = __glXFlushRenderBuffer(gc, gc->pc); - (void) memcpy((void *)(pc + 0), (void *)(&cmdlenLarge), 4); - (void) memcpy((void *)(pc + 4), (void *)(&op), 4); - (void) memcpy((void *)(pc + 8), (void *)(&n), 4); + GLubyte *const pc = __glXFlushRenderBuffer(gc, gc->pc); + (void) memcpy((void *) (pc + 0), (void *) (&cmdlenLarge), 4); + (void) memcpy((void *) (pc + 4), (void *) (&op), 4); + (void) memcpy((void *) (pc + 8), (void *) (&n), 4); __glXSendLargeCommand(gc, pc, 12, bufs, (n * 4)); } } } -#define X_GLvop_GetColorTableParameterfvSGI 4099 -void -__indirect_glGetColorTableParameterfvSGI(GLenum target, GLenum pname, GLfloat * params) -{ - __GLXcontext * const gc = __glXGetCurrentContext(); - Display * const dpy = gc->currentDpy; - const GLuint cmdlen = 8; - if (__builtin_expect(dpy != NULL, 1)) { - GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetColorTableParameterfvSGI, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&target), 4); - (void) memcpy((void *)(pc + 4), (void *)(&pname), 4); - (void) __glXReadReply(dpy, 4, params, GL_FALSE); - UnlockDisplay(dpy); SyncHandle(); - } - return; -} - -#define X_GLvop_GetColorTableParameterivSGI 4100 -void -__indirect_glGetColorTableParameterivSGI(GLenum target, GLenum pname, GLint * params) -{ - __GLXcontext * const gc = __glXGetCurrentContext(); - Display * const dpy = gc->currentDpy; - const GLuint cmdlen = 8; - if (__builtin_expect(dpy != NULL, 1)) { - GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetColorTableParameterivSGI, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&target), 4); - (void) memcpy((void *)(pc + 4), (void *)(&pname), 4); - (void) __glXReadReply(dpy, 4, params, GL_FALSE); - UnlockDisplay(dpy); SyncHandle(); - } - return; -} - -#define X_GLvop_GetColorTableSGI 4098 -void -__indirect_glGetColorTableSGI(GLenum target, GLenum format, GLenum type, GLvoid * table) -{ - __GLXcontext * const gc = __glXGetCurrentContext(); - const __GLXattribute * const state = gc->client_state_private; - Display * const dpy = gc->currentDpy; - const GLuint cmdlen = 16; - if (__builtin_expect(dpy != NULL, 1)) { - GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetColorTableSGI, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&target), 4); - (void) memcpy((void *)(pc + 4), (void *)(&format), 4); - (void) memcpy((void *)(pc + 8), (void *)(&type), 4); - *(int32_t *)(pc + 12) = 0; - * (int8_t *)(pc + 12) = state->storePack.swapEndian; - __glXReadPixelReply(dpy, gc, 1, 0, 0, 0, format, type, table, GL_TRUE); - UnlockDisplay(dpy); SyncHandle(); - } - return; -} - -#define X_GLvop_AreTexturesResidentEXT 11 -GLboolean -__indirect_glAreTexturesResidentEXT(GLsizei n, const GLuint * textures, GLboolean * residences) -{ - __GLXcontext * const gc = __glXGetCurrentContext(); - Display * const dpy = gc->currentDpy; - GLboolean retval = (GLboolean) 0; - const GLuint cmdlen = 4 + __GLX_PAD((n * 4)); - if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) { - GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_AreTexturesResidentEXT, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&n), 4); - (void) memcpy((void *)(pc + 4), (void *)(textures), (n * 4)); - retval = (GLboolean) __glXReadReply(dpy, 1, residences, GL_TRUE); - UnlockDisplay(dpy); SyncHandle(); - } - return retval; -} - -#define X_GLvop_GenTexturesEXT 13 -void -__indirect_glGenTexturesEXT(GLsizei n, GLuint * textures) -{ - __GLXcontext * const gc = __glXGetCurrentContext(); - Display * const dpy = gc->currentDpy; - const GLuint cmdlen = 4; - if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) { - GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GenTexturesEXT, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&n), 4); - (void) __glXReadReply(dpy, 4, textures, GL_TRUE); - UnlockDisplay(dpy); SyncHandle(); - } - return; -} - -#define X_GLvop_IsTextureEXT 14 -GLboolean -__indirect_glIsTextureEXT(GLuint texture) -{ - __GLXcontext * const gc = __glXGetCurrentContext(); - Display * const dpy = gc->currentDpy; - GLboolean retval = (GLboolean) 0; - const GLuint cmdlen = 4; - if (__builtin_expect(dpy != NULL, 1)) { - GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_IsTextureEXT, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&texture), 4); - retval = (GLboolean) __glXReadReply(dpy, 0, NULL, GL_FALSE); - UnlockDisplay(dpy); SyncHandle(); - } - return retval; -} - #define X_GLrop_SampleMaskSGIS 2048 void __indirect_glSampleMaskSGIS(GLclampf value, GLboolean invert) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_SampleMaskSGIS, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&value), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&invert), 1); + (void) memcpy((void *) (gc->pc + 4), (void *) (&value), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&invert), 1); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_SamplePatternSGIS 2049 void __indirect_glSamplePatternSGIS(GLenum pattern) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_SamplePatternSGIS, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&pattern), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&pattern), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_PointParameterfEXT 2065 void __indirect_glPointParameterfEXT(GLenum pname, GLfloat param) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_PointParameterfEXT, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&pname), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(¶m), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (¶m), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_PointParameterfvEXT 2066 void __indirect_glPointParameterfvEXT(GLenum pname, const GLfloat * params) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint compsize = __glPointParameterfvEXT_size(pname); const GLuint cmdlen = 8 + __GLX_PAD((compsize * 4)); emit_header(gc->pc, X_GLrop_PointParameterfvEXT, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&pname), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(params), (compsize * 4)); + (void) memcpy((void *) (gc->pc + 4), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (params), (compsize * 4)); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_SecondaryColor3bvEXT 4126 void __indirect_glSecondaryColor3bEXT(GLbyte red, GLbyte green, GLbyte blue) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_SecondaryColor3bvEXT, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&red), 1); - (void) memcpy((void *)(gc->pc + 5), (void *)(&green), 1); - (void) memcpy((void *)(gc->pc + 6), (void *)(&blue), 1); + (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 1); + (void) memcpy((void *) (gc->pc + 5), (void *) (&green), 1); + (void) memcpy((void *) (gc->pc + 6), (void *) (&blue), 1); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_SecondaryColor3bvEXT 4126 void __indirect_glSecondaryColor3bvEXT(const GLbyte * v) { - generic_3_byte( X_GLrop_SecondaryColor3bvEXT, v ); + generic_3_byte(X_GLrop_SecondaryColor3bvEXT, v); } #define X_GLrop_SecondaryColor3dvEXT 4130 void __indirect_glSecondaryColor3dEXT(GLdouble red, GLdouble green, GLdouble blue) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 28; emit_header(gc->pc, X_GLrop_SecondaryColor3dvEXT, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&red), 8); - (void) memcpy((void *)(gc->pc + 12), (void *)(&green), 8); - (void) memcpy((void *)(gc->pc + 20), (void *)(&blue), 8); + (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 8); + (void) memcpy((void *) (gc->pc + 12), (void *) (&green), 8); + (void) memcpy((void *) (gc->pc + 20), (void *) (&blue), 8); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_SecondaryColor3dvEXT 4130 void __indirect_glSecondaryColor3dvEXT(const GLdouble * v) { - generic_24_byte( X_GLrop_SecondaryColor3dvEXT, v ); + generic_24_byte(X_GLrop_SecondaryColor3dvEXT, v); } #define X_GLrop_SecondaryColor3fvEXT 4129 void __indirect_glSecondaryColor3fEXT(GLfloat red, GLfloat green, GLfloat blue) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_SecondaryColor3fvEXT, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&red), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&green), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&blue), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&green), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&blue), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_SecondaryColor3fvEXT 4129 void __indirect_glSecondaryColor3fvEXT(const GLfloat * v) { - generic_12_byte( X_GLrop_SecondaryColor3fvEXT, v ); + generic_12_byte(X_GLrop_SecondaryColor3fvEXT, v); } #define X_GLrop_SecondaryColor3ivEXT 4128 void __indirect_glSecondaryColor3iEXT(GLint red, GLint green, GLint blue) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_SecondaryColor3ivEXT, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&red), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&green), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&blue), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&green), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&blue), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_SecondaryColor3ivEXT 4128 void __indirect_glSecondaryColor3ivEXT(const GLint * v) { - generic_12_byte( X_GLrop_SecondaryColor3ivEXT, v ); + generic_12_byte(X_GLrop_SecondaryColor3ivEXT, v); } #define X_GLrop_SecondaryColor3svEXT 4127 void __indirect_glSecondaryColor3sEXT(GLshort red, GLshort green, GLshort blue) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_SecondaryColor3svEXT, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&red), 2); - (void) memcpy((void *)(gc->pc + 6), (void *)(&green), 2); - (void) memcpy((void *)(gc->pc + 8), (void *)(&blue), 2); + (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 2); + (void) memcpy((void *) (gc->pc + 6), (void *) (&green), 2); + (void) memcpy((void *) (gc->pc + 8), (void *) (&blue), 2); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_SecondaryColor3svEXT 4127 void __indirect_glSecondaryColor3svEXT(const GLshort * v) { - generic_6_byte( X_GLrop_SecondaryColor3svEXT, v ); + generic_6_byte(X_GLrop_SecondaryColor3svEXT, v); } #define X_GLrop_SecondaryColor3ubvEXT 4131 void __indirect_glSecondaryColor3ubEXT(GLubyte red, GLubyte green, GLubyte blue) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_SecondaryColor3ubvEXT, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&red), 1); - (void) memcpy((void *)(gc->pc + 5), (void *)(&green), 1); - (void) memcpy((void *)(gc->pc + 6), (void *)(&blue), 1); + (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 1); + (void) memcpy((void *) (gc->pc + 5), (void *) (&green), 1); + (void) memcpy((void *) (gc->pc + 6), (void *) (&blue), 1); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_SecondaryColor3ubvEXT 4131 void __indirect_glSecondaryColor3ubvEXT(const GLubyte * v) { - generic_3_byte( X_GLrop_SecondaryColor3ubvEXT, v ); + generic_3_byte(X_GLrop_SecondaryColor3ubvEXT, v); } #define X_GLrop_SecondaryColor3uivEXT 4133 void __indirect_glSecondaryColor3uiEXT(GLuint red, GLuint green, GLuint blue) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_SecondaryColor3uivEXT, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&red), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&green), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&blue), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&green), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&blue), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_SecondaryColor3uivEXT 4133 void __indirect_glSecondaryColor3uivEXT(const GLuint * v) { - generic_12_byte( X_GLrop_SecondaryColor3uivEXT, v ); + generic_12_byte(X_GLrop_SecondaryColor3uivEXT, v); } #define X_GLrop_SecondaryColor3usvEXT 4132 void __indirect_glSecondaryColor3usEXT(GLushort red, GLushort green, GLushort blue) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_SecondaryColor3usvEXT, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&red), 2); - (void) memcpy((void *)(gc->pc + 6), (void *)(&green), 2); - (void) memcpy((void *)(gc->pc + 8), (void *)(&blue), 2); + (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 2); + (void) memcpy((void *) (gc->pc + 6), (void *) (&green), 2); + (void) memcpy((void *) (gc->pc + 8), (void *) (&blue), 2); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_SecondaryColor3usvEXT 4132 void __indirect_glSecondaryColor3usvEXT(const GLushort * v) { - generic_6_byte( X_GLrop_SecondaryColor3usvEXT, v ); + generic_6_byte(X_GLrop_SecondaryColor3usvEXT, v); } #define X_GLrop_FogCoorddvEXT 4125 void __indirect_glFogCoorddEXT(GLdouble coord) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_FogCoorddvEXT, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&coord), 8); + (void) memcpy((void *) (gc->pc + 4), (void *) (&coord), 8); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_FogCoorddvEXT 4125 void __indirect_glFogCoorddvEXT(const GLdouble * coord) { - generic_8_byte( X_GLrop_FogCoorddvEXT, coord ); + generic_8_byte(X_GLrop_FogCoorddvEXT, coord); } #define X_GLrop_FogCoordfvEXT 4124 void __indirect_glFogCoordfEXT(GLfloat coord) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_FogCoordfvEXT, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&coord), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&coord), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_FogCoordfvEXT 4124 void __indirect_glFogCoordfvEXT(const GLfloat * coord) { - generic_4_byte( X_GLrop_FogCoordfvEXT, coord ); + generic_4_byte(X_GLrop_FogCoordfvEXT, coord); } #define X_GLrop_BlendFuncSeparateEXT 4134 void -__indirect_glBlendFuncSeparateEXT(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha) +__indirect_glBlendFuncSeparateEXT(GLenum sfactorRGB, GLenum dfactorRGB, + GLenum sfactorAlpha, GLenum dfactorAlpha) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_BlendFuncSeparateEXT, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&sfactorRGB), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&dfactorRGB), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&sfactorAlpha), 4); - (void) memcpy((void *)(gc->pc + 16), (void *)(&dfactorAlpha), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&sfactorRGB), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&dfactorRGB), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&sfactorAlpha), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&dfactorAlpha), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_WindowPos3fvMESA 230 void __indirect_glWindowPos3fMESA(GLfloat x, GLfloat y, GLfloat z) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_WindowPos3fvMESA, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&x), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&y), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&z), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&y), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&z), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_WindowPos3fvMESA 230 void __indirect_glWindowPos3fvMESA(const GLfloat * v) { - generic_12_byte( X_GLrop_WindowPos3fvMESA, v ); + generic_12_byte(X_GLrop_WindowPos3fvMESA, v); } #define X_GLvop_AreProgramsResidentNV 1293 GLboolean -__indirect_glAreProgramsResidentNV(GLsizei n, const GLuint * ids, GLboolean * residences) +__indirect_glAreProgramsResidentNV(GLsizei n, const GLuint * ids, + GLboolean * residences) { - __GLXcontext * const gc = __glXGetCurrentContext(); - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; GLboolean retval = (GLboolean) 0; const GLuint cmdlen = 4 + __GLX_PAD((n * 4)); if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) { - GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_AreProgramsResidentNV, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&n), 4); - (void) memcpy((void *)(pc + 4), (void *)(ids), (n * 4)); + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_AreProgramsResidentNV, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&n), 4); + (void) memcpy((void *) (pc + 4), (void *) (ids), (n * 4)); retval = (GLboolean) __glXReadReply(dpy, 1, residences, GL_FALSE); - UnlockDisplay(dpy); SyncHandle(); + UnlockDisplay(dpy); + SyncHandle(); } return retval; } @@ -7187,93 +8831,112 @@ __indirect_glAreProgramsResidentNV(GLsizei n, const GLuint * ids, GLboolean * re void __indirect_glBindProgramNV(GLenum target, GLuint program) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_BindProgramNV, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&program), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&program), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLvop_DeleteProgramsNV 1294 void __indirect_glDeleteProgramsNV(GLsizei n, const GLuint * programs) { - __GLXcontext * const gc = __glXGetCurrentContext(); - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; const GLuint cmdlen = 4 + __GLX_PAD((n * 4)); if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) { - GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivate, X_GLvop_DeleteProgramsNV, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&n), 4); - (void) memcpy((void *)(pc + 4), (void *)(programs), (n * 4)); - UnlockDisplay(dpy); SyncHandle(); + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivate, + X_GLvop_DeleteProgramsNV, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&n), 4); + (void) memcpy((void *) (pc + 4), (void *) (programs), (n * 4)); + UnlockDisplay(dpy); + SyncHandle(); } return; } #define X_GLrop_ExecuteProgramNV 4181 void -__indirect_glExecuteProgramNV(GLenum target, GLuint id, const GLfloat * params) +__indirect_glExecuteProgramNV(GLenum target, GLuint id, + const GLfloat * params) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 28; emit_header(gc->pc, X_GLrop_ExecuteProgramNV, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&id), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(params), 16); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&id), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (params), 16); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLvop_GenProgramsNV 1295 void __indirect_glGenProgramsNV(GLsizei n, GLuint * programs) { - __GLXcontext * const gc = __glXGetCurrentContext(); - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; const GLuint cmdlen = 4; if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) { - GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GenProgramsNV, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&n), 4); + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_GenProgramsNV, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&n), 4); (void) __glXReadReply(dpy, 4, programs, GL_TRUE); - UnlockDisplay(dpy); SyncHandle(); + UnlockDisplay(dpy); + SyncHandle(); } return; } #define X_GLvop_GetProgramParameterdvNV 1297 void -__indirect_glGetProgramParameterdvNV(GLenum target, GLuint index, GLenum pname, GLdouble * params) +__indirect_glGetProgramParameterdvNV(GLenum target, GLuint index, + GLenum pname, GLdouble * params) { - __GLXcontext * const gc = __glXGetCurrentContext(); - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; const GLuint cmdlen = 12; if (__builtin_expect(dpy != NULL, 1)) { - GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetProgramParameterdvNV, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&target), 4); - (void) memcpy((void *)(pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(pc + 8), (void *)(&pname), 4); + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_GetProgramParameterdvNV, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (pc + 8), (void *) (&pname), 4); (void) __glXReadReply(dpy, 8, params, GL_FALSE); - UnlockDisplay(dpy); SyncHandle(); + UnlockDisplay(dpy); + SyncHandle(); } return; } #define X_GLvop_GetProgramParameterfvNV 1296 void -__indirect_glGetProgramParameterfvNV(GLenum target, GLuint index, GLenum pname, GLfloat * params) +__indirect_glGetProgramParameterfvNV(GLenum target, GLuint index, + GLenum pname, GLfloat * params) { - __GLXcontext * const gc = __glXGetCurrentContext(); - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; const GLuint cmdlen = 12; if (__builtin_expect(dpy != NULL, 1)) { - GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetProgramParameterfvNV, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&target), 4); - (void) memcpy((void *)(pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(pc + 8), (void *)(&pname), 4); + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_GetProgramParameterfvNV, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (pc + 8), (void *) (&pname), 4); (void) __glXReadReply(dpy, 4, params, GL_FALSE); - UnlockDisplay(dpy); SyncHandle(); + UnlockDisplay(dpy); + SyncHandle(); } return; } @@ -7282,15 +8945,18 @@ __indirect_glGetProgramParameterfvNV(GLenum target, GLuint index, GLenum pname, void __indirect_glGetProgramStringNV(GLuint id, GLenum pname, GLubyte * program) { - __GLXcontext * const gc = __glXGetCurrentContext(); - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; const GLuint cmdlen = 8; if (__builtin_expect(dpy != NULL, 1)) { - GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetProgramStringNV, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&id), 4); - (void) memcpy((void *)(pc + 4), (void *)(&pname), 4); + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_GetProgramStringNV, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&id), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); (void) __glXReadReply(dpy, 1, program, GL_TRUE); - UnlockDisplay(dpy); SyncHandle(); + UnlockDisplay(dpy); + SyncHandle(); } return; } @@ -7299,50 +8965,61 @@ __indirect_glGetProgramStringNV(GLuint id, GLenum pname, GLubyte * program) void __indirect_glGetProgramivNV(GLuint id, GLenum pname, GLint * params) { - __GLXcontext * const gc = __glXGetCurrentContext(); - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; const GLuint cmdlen = 8; if (__builtin_expect(dpy != NULL, 1)) { - GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetProgramivNV, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&id), 4); - (void) memcpy((void *)(pc + 4), (void *)(&pname), 4); + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_GetProgramivNV, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&id), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); (void) __glXReadReply(dpy, 4, params, GL_FALSE); - UnlockDisplay(dpy); SyncHandle(); + UnlockDisplay(dpy); + SyncHandle(); } return; } #define X_GLvop_GetTrackMatrixivNV 1300 void -__indirect_glGetTrackMatrixivNV(GLenum target, GLuint address, GLenum pname, GLint * params) +__indirect_glGetTrackMatrixivNV(GLenum target, GLuint address, GLenum pname, + GLint * params) { - __GLXcontext * const gc = __glXGetCurrentContext(); - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; const GLuint cmdlen = 12; if (__builtin_expect(dpy != NULL, 1)) { - GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetTrackMatrixivNV, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&target), 4); - (void) memcpy((void *)(pc + 4), (void *)(&address), 4); - (void) memcpy((void *)(pc + 8), (void *)(&pname), 4); + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_GetTrackMatrixivNV, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&address), 4); + (void) memcpy((void *) (pc + 8), (void *) (&pname), 4); (void) __glXReadReply(dpy, 4, params, GL_FALSE); - UnlockDisplay(dpy); SyncHandle(); + UnlockDisplay(dpy); + SyncHandle(); } return; } #define X_GLvop_GetVertexAttribdvNV 1301 void -__indirect_glGetVertexAttribdvNV(GLuint index, GLenum pname, GLdouble * params) +__indirect_glGetVertexAttribdvNV(GLuint index, GLenum pname, + GLdouble * params) { - __GLXcontext * const gc = __glXGetCurrentContext(); - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; const GLuint cmdlen = 8; if (__builtin_expect(dpy != NULL, 1)) { - GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetVertexAttribdvNV, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&index), 4); - (void) memcpy((void *)(pc + 4), (void *)(&pname), 4); + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_GetVertexAttribdvNV, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&index), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); (void) __glXReadReply(dpy, 8, params, GL_FALSE); - UnlockDisplay(dpy); SyncHandle(); + UnlockDisplay(dpy); + SyncHandle(); } return; } @@ -7351,15 +9028,18 @@ __indirect_glGetVertexAttribdvNV(GLuint index, GLenum pname, GLdouble * params) void __indirect_glGetVertexAttribfvNV(GLuint index, GLenum pname, GLfloat * params) { - __GLXcontext * const gc = __glXGetCurrentContext(); - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; const GLuint cmdlen = 8; if (__builtin_expect(dpy != NULL, 1)) { - GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetVertexAttribfvNV, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&index), 4); - (void) memcpy((void *)(pc + 4), (void *)(&pname), 4); + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_GetVertexAttribfvNV, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&index), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); (void) __glXReadReply(dpy, 4, params, GL_FALSE); - UnlockDisplay(dpy); SyncHandle(); + UnlockDisplay(dpy); + SyncHandle(); } return; } @@ -7368,15 +9048,18 @@ __indirect_glGetVertexAttribfvNV(GLuint index, GLenum pname, GLfloat * params) void __indirect_glGetVertexAttribivNV(GLuint index, GLenum pname, GLint * params) { - __GLXcontext * const gc = __glXGetCurrentContext(); - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; const GLuint cmdlen = 8; if (__builtin_expect(dpy != NULL, 1)) { - GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetVertexAttribivNV, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&index), 4); - (void) memcpy((void *)(pc + 4), (void *)(&pname), 4); + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_GetVertexAttribivNV, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&index), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); (void) __glXReadReply(dpy, 4, params, GL_FALSE); - UnlockDisplay(dpy); SyncHandle(); + UnlockDisplay(dpy); + SyncHandle(); } return; } @@ -7385,129 +9068,153 @@ __indirect_glGetVertexAttribivNV(GLuint index, GLenum pname, GLint * params) GLboolean __indirect_glIsProgramNV(GLuint program) { - __GLXcontext * const gc = __glXGetCurrentContext(); - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; GLboolean retval = (GLboolean) 0; const GLuint cmdlen = 4; if (__builtin_expect(dpy != NULL, 1)) { - GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_IsProgramNV, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&program), 4); + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_IsProgramNV, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&program), 4); retval = (GLboolean) __glXReadReply(dpy, 0, NULL, GL_FALSE); - UnlockDisplay(dpy); SyncHandle(); + UnlockDisplay(dpy); + SyncHandle(); } return retval; } #define X_GLrop_LoadProgramNV 4183 void -__indirect_glLoadProgramNV(GLenum target, GLuint id, GLsizei len, const GLubyte * program) +__indirect_glLoadProgramNV(GLenum target, GLuint id, GLsizei len, + const GLubyte * program) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16 + __GLX_PAD(len); if (__builtin_expect(len >= 0, 1)) { emit_header(gc->pc, X_GLrop_LoadProgramNV, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&id), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&len), 4); - (void) memcpy((void *)(gc->pc + 16), (void *)(program), len); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&id), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&len), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (program), len); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } } #define X_GLrop_ProgramParameter4dvNV 4185 void -__indirect_glProgramParameter4dNV(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) +__indirect_glProgramParameter4dNV(GLenum target, GLuint index, GLdouble x, + GLdouble y, GLdouble z, GLdouble w) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 44; emit_header(gc->pc, X_GLrop_ProgramParameter4dvNV, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&x), 8); - (void) memcpy((void *)(gc->pc + 20), (void *)(&y), 8); - (void) memcpy((void *)(gc->pc + 28), (void *)(&z), 8); - (void) memcpy((void *)(gc->pc + 36), (void *)(&w), 8); - gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&x), 8); + (void) memcpy((void *) (gc->pc + 20), (void *) (&y), 8); + (void) memcpy((void *) (gc->pc + 28), (void *) (&z), 8); + (void) memcpy((void *) (gc->pc + 36), (void *) (&w), 8); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_ProgramParameter4dvNV 4185 void -__indirect_glProgramParameter4dvNV(GLenum target, GLuint index, const GLdouble * params) +__indirect_glProgramParameter4dvNV(GLenum target, GLuint index, + const GLdouble * params) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 44; emit_header(gc->pc, X_GLrop_ProgramParameter4dvNV, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(params), 32); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (params), 32); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_ProgramParameter4fvNV 4184 void -__indirect_glProgramParameter4fNV(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) +__indirect_glProgramParameter4fNV(GLenum target, GLuint index, GLfloat x, + GLfloat y, GLfloat z, GLfloat w) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 28; emit_header(gc->pc, X_GLrop_ProgramParameter4fvNV, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&x), 4); - (void) memcpy((void *)(gc->pc + 16), (void *)(&y), 4); - (void) memcpy((void *)(gc->pc + 20), (void *)(&z), 4); - (void) memcpy((void *)(gc->pc + 24), (void *)(&w), 4); - gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&y), 4); + (void) memcpy((void *) (gc->pc + 20), (void *) (&z), 4); + (void) memcpy((void *) (gc->pc + 24), (void *) (&w), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_ProgramParameter4fvNV 4184 void -__indirect_glProgramParameter4fvNV(GLenum target, GLuint index, const GLfloat * params) +__indirect_glProgramParameter4fvNV(GLenum target, GLuint index, + const GLfloat * params) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 28; emit_header(gc->pc, X_GLrop_ProgramParameter4fvNV, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(params), 16); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (params), 16); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_ProgramParameters4dvNV 4187 void -__indirect_glProgramParameters4dvNV(GLenum target, GLuint index, GLuint num, const GLdouble * params) +__indirect_glProgramParameters4dvNV(GLenum target, GLuint index, GLuint num, + const GLdouble * params) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16 + __GLX_PAD((num * 32)); if (__builtin_expect(num >= 0, 1)) { emit_header(gc->pc, X_GLrop_ProgramParameters4dvNV, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&num), 4); - (void) memcpy((void *)(gc->pc + 16), (void *)(params), (num * 32)); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&num), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (params), (num * 32)); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } } #define X_GLrop_ProgramParameters4fvNV 4186 void -__indirect_glProgramParameters4fvNV(GLenum target, GLuint index, GLuint num, const GLfloat * params) +__indirect_glProgramParameters4fvNV(GLenum target, GLuint index, GLuint num, + const GLfloat * params) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16 + __GLX_PAD((num * 16)); if (__builtin_expect(num >= 0, 1)) { emit_header(gc->pc, X_GLrop_ProgramParameters4fvNV, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&num), 4); - (void) memcpy((void *)(gc->pc + 16), (void *)(params), (num * 16)); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&num), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (params), (num * 16)); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } } @@ -7515,404 +9222,468 @@ __indirect_glProgramParameters4fvNV(GLenum target, GLuint index, GLuint num, con void __indirect_glRequestResidentProgramsNV(GLsizei n, const GLuint * ids) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8 + __GLX_PAD((n * 4)); if (__builtin_expect(n >= 0, 1)) { emit_header(gc->pc, X_GLrop_RequestResidentProgramsNV, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&n), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(ids), (n * 4)); + (void) memcpy((void *) (gc->pc + 4), (void *) (&n), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (ids), (n * 4)); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } } #define X_GLrop_TrackMatrixNV 4188 void -__indirect_glTrackMatrixNV(GLenum target, GLuint address, GLenum matrix, GLenum transform) +__indirect_glTrackMatrixNV(GLenum target, GLuint address, GLenum matrix, + GLenum transform) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_TrackMatrixNV, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&address), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&matrix), 4); - (void) memcpy((void *)(gc->pc + 16), (void *)(&transform), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&address), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&matrix), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&transform), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_VertexAttrib1dvNV 4273 void __indirect_glVertexAttrib1dNV(GLuint index, GLdouble x) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_VertexAttrib1dvNV, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&x), 8); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&x), 8); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_VertexAttrib1dvNV 4273 void __indirect_glVertexAttrib1dvNV(GLuint index, const GLdouble * v) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_VertexAttrib1dvNV, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(v), 8); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 8); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_VertexAttrib1fvNV 4269 void __indirect_glVertexAttrib1fNV(GLuint index, GLfloat x) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_VertexAttrib1fvNV, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&x), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&x), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_VertexAttrib1fvNV 4269 void __indirect_glVertexAttrib1fvNV(GLuint index, const GLfloat * v) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_VertexAttrib1fvNV, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(v), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_VertexAttrib1svNV 4265 void __indirect_glVertexAttrib1sNV(GLuint index, GLshort x) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_VertexAttrib1svNV, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&x), 2); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&x), 2); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_VertexAttrib1svNV 4265 void __indirect_glVertexAttrib1svNV(GLuint index, const GLshort * v) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_VertexAttrib1svNV, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(v), 2); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 2); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_VertexAttrib2dvNV 4274 void __indirect_glVertexAttrib2dNV(GLuint index, GLdouble x, GLdouble y) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 24; emit_header(gc->pc, X_GLrop_VertexAttrib2dvNV, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&x), 8); - (void) memcpy((void *)(gc->pc + 16), (void *)(&y), 8); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&x), 8); + (void) memcpy((void *) (gc->pc + 16), (void *) (&y), 8); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_VertexAttrib2dvNV 4274 void __indirect_glVertexAttrib2dvNV(GLuint index, const GLdouble * v) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 24; emit_header(gc->pc, X_GLrop_VertexAttrib2dvNV, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(v), 16); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 16); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_VertexAttrib2fvNV 4270 void __indirect_glVertexAttrib2fNV(GLuint index, GLfloat x, GLfloat y) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_VertexAttrib2fvNV, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&x), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&y), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&y), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_VertexAttrib2fvNV 4270 void __indirect_glVertexAttrib2fvNV(GLuint index, const GLfloat * v) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_VertexAttrib2fvNV, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(v), 8); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 8); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_VertexAttrib2svNV 4266 void __indirect_glVertexAttrib2sNV(GLuint index, GLshort x, GLshort y) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_VertexAttrib2svNV, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&x), 2); - (void) memcpy((void *)(gc->pc + 10), (void *)(&y), 2); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&x), 2); + (void) memcpy((void *) (gc->pc + 10), (void *) (&y), 2); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_VertexAttrib2svNV 4266 void __indirect_glVertexAttrib2svNV(GLuint index, const GLshort * v) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_VertexAttrib2svNV, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(v), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_VertexAttrib3dvNV 4275 void -__indirect_glVertexAttrib3dNV(GLuint index, GLdouble x, GLdouble y, GLdouble z) +__indirect_glVertexAttrib3dNV(GLuint index, GLdouble x, GLdouble y, + GLdouble z) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 32; emit_header(gc->pc, X_GLrop_VertexAttrib3dvNV, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&x), 8); - (void) memcpy((void *)(gc->pc + 16), (void *)(&y), 8); - (void) memcpy((void *)(gc->pc + 24), (void *)(&z), 8); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&x), 8); + (void) memcpy((void *) (gc->pc + 16), (void *) (&y), 8); + (void) memcpy((void *) (gc->pc + 24), (void *) (&z), 8); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_VertexAttrib3dvNV 4275 void __indirect_glVertexAttrib3dvNV(GLuint index, const GLdouble * v) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 32; emit_header(gc->pc, X_GLrop_VertexAttrib3dvNV, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(v), 24); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 24); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_VertexAttrib3fvNV 4271 void __indirect_glVertexAttrib3fNV(GLuint index, GLfloat x, GLfloat y, GLfloat z) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_VertexAttrib3fvNV, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&x), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&y), 4); - (void) memcpy((void *)(gc->pc + 16), (void *)(&z), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&y), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&z), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_VertexAttrib3fvNV 4271 void __indirect_glVertexAttrib3fvNV(GLuint index, const GLfloat * v) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_VertexAttrib3fvNV, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(v), 12); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 12); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_VertexAttrib3svNV 4267 void __indirect_glVertexAttrib3sNV(GLuint index, GLshort x, GLshort y, GLshort z) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_VertexAttrib3svNV, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&x), 2); - (void) memcpy((void *)(gc->pc + 10), (void *)(&y), 2); - (void) memcpy((void *)(gc->pc + 12), (void *)(&z), 2); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&x), 2); + (void) memcpy((void *) (gc->pc + 10), (void *) (&y), 2); + (void) memcpy((void *) (gc->pc + 12), (void *) (&z), 2); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_VertexAttrib3svNV 4267 void __indirect_glVertexAttrib3svNV(GLuint index, const GLshort * v) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_VertexAttrib3svNV, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(v), 6); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 6); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_VertexAttrib4dvNV 4276 void -__indirect_glVertexAttrib4dNV(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) +__indirect_glVertexAttrib4dNV(GLuint index, GLdouble x, GLdouble y, + GLdouble z, GLdouble w) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 40; emit_header(gc->pc, X_GLrop_VertexAttrib4dvNV, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&x), 8); - (void) memcpy((void *)(gc->pc + 16), (void *)(&y), 8); - (void) memcpy((void *)(gc->pc + 24), (void *)(&z), 8); - (void) memcpy((void *)(gc->pc + 32), (void *)(&w), 8); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&x), 8); + (void) memcpy((void *) (gc->pc + 16), (void *) (&y), 8); + (void) memcpy((void *) (gc->pc + 24), (void *) (&z), 8); + (void) memcpy((void *) (gc->pc + 32), (void *) (&w), 8); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_VertexAttrib4dvNV 4276 void __indirect_glVertexAttrib4dvNV(GLuint index, const GLdouble * v) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 40; emit_header(gc->pc, X_GLrop_VertexAttrib4dvNV, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(v), 32); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 32); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_VertexAttrib4fvNV 4272 void -__indirect_glVertexAttrib4fNV(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) +__indirect_glVertexAttrib4fNV(GLuint index, GLfloat x, GLfloat y, GLfloat z, + GLfloat w) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 24; emit_header(gc->pc, X_GLrop_VertexAttrib4fvNV, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&x), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&y), 4); - (void) memcpy((void *)(gc->pc + 16), (void *)(&z), 4); - (void) memcpy((void *)(gc->pc + 20), (void *)(&w), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&y), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&z), 4); + (void) memcpy((void *) (gc->pc + 20), (void *) (&w), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_VertexAttrib4fvNV 4272 void __indirect_glVertexAttrib4fvNV(GLuint index, const GLfloat * v) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 24; emit_header(gc->pc, X_GLrop_VertexAttrib4fvNV, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(v), 16); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 16); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_VertexAttrib4svNV 4268 void -__indirect_glVertexAttrib4sNV(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w) +__indirect_glVertexAttrib4sNV(GLuint index, GLshort x, GLshort y, GLshort z, + GLshort w) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_VertexAttrib4svNV, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&x), 2); - (void) memcpy((void *)(gc->pc + 10), (void *)(&y), 2); - (void) memcpy((void *)(gc->pc + 12), (void *)(&z), 2); - (void) memcpy((void *)(gc->pc + 14), (void *)(&w), 2); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&x), 2); + (void) memcpy((void *) (gc->pc + 10), (void *) (&y), 2); + (void) memcpy((void *) (gc->pc + 12), (void *) (&z), 2); + (void) memcpy((void *) (gc->pc + 14), (void *) (&w), 2); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_VertexAttrib4svNV 4268 void __indirect_glVertexAttrib4svNV(GLuint index, const GLshort * v) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_VertexAttrib4svNV, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(v), 8); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 8); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_VertexAttrib4ubvNV 4277 void -__indirect_glVertexAttrib4ubNV(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w) +__indirect_glVertexAttrib4ubNV(GLuint index, GLubyte x, GLubyte y, GLubyte z, + GLubyte w) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_VertexAttrib4ubvNV, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&x), 1); - (void) memcpy((void *)(gc->pc + 9), (void *)(&y), 1); - (void) memcpy((void *)(gc->pc + 10), (void *)(&z), 1); - (void) memcpy((void *)(gc->pc + 11), (void *)(&w), 1); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&x), 1); + (void) memcpy((void *) (gc->pc + 9), (void *) (&y), 1); + (void) memcpy((void *) (gc->pc + 10), (void *) (&z), 1); + (void) memcpy((void *) (gc->pc + 11), (void *) (&w), 1); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_VertexAttrib4ubvNV 4277 void __indirect_glVertexAttrib4ubvNV(GLuint index, const GLubyte * v) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_VertexAttrib4ubvNV, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(v), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (v), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_VertexAttribs1dvNV 4210 void __indirect_glVertexAttribs1dvNV(GLuint index, GLsizei n, const GLdouble * v) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12 + __GLX_PAD((n * 8)); if (__builtin_expect(n >= 0, 1)) { emit_header(gc->pc, X_GLrop_VertexAttribs1dvNV, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&n), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(v), (n * 8)); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&n), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (v), (n * 8)); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } } @@ -7920,15 +9691,17 @@ __indirect_glVertexAttribs1dvNV(GLuint index, GLsizei n, const GLdouble * v) void __indirect_glVertexAttribs1fvNV(GLuint index, GLsizei n, const GLfloat * v) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12 + __GLX_PAD((n * 4)); if (__builtin_expect(n >= 0, 1)) { emit_header(gc->pc, X_GLrop_VertexAttribs1fvNV, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&n), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(v), (n * 4)); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&n), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (v), (n * 4)); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } } @@ -7936,15 +9709,17 @@ __indirect_glVertexAttribs1fvNV(GLuint index, GLsizei n, const GLfloat * v) void __indirect_glVertexAttribs1svNV(GLuint index, GLsizei n, const GLshort * v) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12 + __GLX_PAD((n * 2)); if (__builtin_expect(n >= 0, 1)) { emit_header(gc->pc, X_GLrop_VertexAttribs1svNV, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&n), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(v), (n * 2)); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&n), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (v), (n * 2)); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } } @@ -7952,15 +9727,17 @@ __indirect_glVertexAttribs1svNV(GLuint index, GLsizei n, const GLshort * v) void __indirect_glVertexAttribs2dvNV(GLuint index, GLsizei n, const GLdouble * v) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12 + __GLX_PAD((n * 16)); if (__builtin_expect(n >= 0, 1)) { emit_header(gc->pc, X_GLrop_VertexAttribs2dvNV, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&n), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(v), (n * 16)); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&n), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (v), (n * 16)); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } } @@ -7968,15 +9745,17 @@ __indirect_glVertexAttribs2dvNV(GLuint index, GLsizei n, const GLdouble * v) void __indirect_glVertexAttribs2fvNV(GLuint index, GLsizei n, const GLfloat * v) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12 + __GLX_PAD((n * 8)); if (__builtin_expect(n >= 0, 1)) { emit_header(gc->pc, X_GLrop_VertexAttribs2fvNV, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&n), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(v), (n * 8)); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&n), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (v), (n * 8)); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } } @@ -7984,15 +9763,17 @@ __indirect_glVertexAttribs2fvNV(GLuint index, GLsizei n, const GLfloat * v) void __indirect_glVertexAttribs2svNV(GLuint index, GLsizei n, const GLshort * v) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12 + __GLX_PAD((n * 4)); if (__builtin_expect(n >= 0, 1)) { emit_header(gc->pc, X_GLrop_VertexAttribs2svNV, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&n), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(v), (n * 4)); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&n), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (v), (n * 4)); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } } @@ -8000,15 +9781,17 @@ __indirect_glVertexAttribs2svNV(GLuint index, GLsizei n, const GLshort * v) void __indirect_glVertexAttribs3dvNV(GLuint index, GLsizei n, const GLdouble * v) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12 + __GLX_PAD((n * 24)); if (__builtin_expect(n >= 0, 1)) { emit_header(gc->pc, X_GLrop_VertexAttribs3dvNV, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&n), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(v), (n * 24)); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&n), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (v), (n * 24)); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } } @@ -8016,15 +9799,17 @@ __indirect_glVertexAttribs3dvNV(GLuint index, GLsizei n, const GLdouble * v) void __indirect_glVertexAttribs3fvNV(GLuint index, GLsizei n, const GLfloat * v) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12 + __GLX_PAD((n * 12)); if (__builtin_expect(n >= 0, 1)) { emit_header(gc->pc, X_GLrop_VertexAttribs3fvNV, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&n), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(v), (n * 12)); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&n), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (v), (n * 12)); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } } @@ -8032,15 +9817,17 @@ __indirect_glVertexAttribs3fvNV(GLuint index, GLsizei n, const GLfloat * v) void __indirect_glVertexAttribs3svNV(GLuint index, GLsizei n, const GLshort * v) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12 + __GLX_PAD((n * 6)); if (__builtin_expect(n >= 0, 1)) { emit_header(gc->pc, X_GLrop_VertexAttribs3svNV, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&n), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(v), (n * 6)); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&n), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (v), (n * 6)); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } } @@ -8048,15 +9835,17 @@ __indirect_glVertexAttribs3svNV(GLuint index, GLsizei n, const GLshort * v) void __indirect_glVertexAttribs4dvNV(GLuint index, GLsizei n, const GLdouble * v) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12 + __GLX_PAD((n * 32)); if (__builtin_expect(n >= 0, 1)) { emit_header(gc->pc, X_GLrop_VertexAttribs4dvNV, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&n), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(v), (n * 32)); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&n), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (v), (n * 32)); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } } @@ -8064,15 +9853,17 @@ __indirect_glVertexAttribs4dvNV(GLuint index, GLsizei n, const GLdouble * v) void __indirect_glVertexAttribs4fvNV(GLuint index, GLsizei n, const GLfloat * v) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12 + __GLX_PAD((n * 16)); if (__builtin_expect(n >= 0, 1)) { emit_header(gc->pc, X_GLrop_VertexAttribs4fvNV, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&n), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(v), (n * 16)); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&n), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (v), (n * 16)); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } } @@ -8080,15 +9871,17 @@ __indirect_glVertexAttribs4fvNV(GLuint index, GLsizei n, const GLfloat * v) void __indirect_glVertexAttribs4svNV(GLuint index, GLsizei n, const GLshort * v) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12 + __GLX_PAD((n * 8)); if (__builtin_expect(n >= 0, 1)) { emit_header(gc->pc, X_GLrop_VertexAttribs4svNV, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&n), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(v), (n * 8)); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&n), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (v), (n * 8)); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } } @@ -8096,15 +9889,17 @@ __indirect_glVertexAttribs4svNV(GLuint index, GLsizei n, const GLshort * v) void __indirect_glVertexAttribs4ubvNV(GLuint index, GLsizei n, const GLubyte * v) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12 + __GLX_PAD((n * 4)); if (__builtin_expect(n >= 0, 1)) { emit_header(gc->pc, X_GLrop_VertexAttribs4ubvNV, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&n), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(v), (n * 4)); + (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&n), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (v), (n * 4)); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } } @@ -8112,148 +9907,182 @@ __indirect_glVertexAttribs4ubvNV(GLuint index, GLsizei n, const GLubyte * v) void __indirect_glPointParameteriNV(GLenum pname, GLint param) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_PointParameteriNV, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&pname), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(¶m), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (¶m), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_PointParameterivNV 4222 void __indirect_glPointParameterivNV(GLenum pname, const GLint * params) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint compsize = __glPointParameterivNV_size(pname); const GLuint cmdlen = 8 + __GLX_PAD((compsize * 4)); emit_header(gc->pc, X_GLrop_PointParameterivNV, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&pname), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(params), (compsize * 4)); + (void) memcpy((void *) (gc->pc + 4), (void *) (&pname), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (params), (compsize * 4)); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_ActiveStencilFaceEXT 4220 void __indirect_glActiveStencilFaceEXT(GLenum face) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_ActiveStencilFaceEXT, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&face), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&face), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLvop_GetProgramNamedParameterdvNV 1311 void -__indirect_glGetProgramNamedParameterdvNV(GLuint id, GLsizei len, const GLubyte * name, GLdouble * params) +__indirect_glGetProgramNamedParameterdvNV(GLuint id, GLsizei len, + const GLubyte * name, + GLdouble * params) { - __GLXcontext * const gc = __glXGetCurrentContext(); - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; const GLuint cmdlen = 8 + __GLX_PAD(len); if (__builtin_expect((len >= 0) && (dpy != NULL), 1)) { - GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetProgramNamedParameterdvNV, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&id), 4); - (void) memcpy((void *)(pc + 4), (void *)(&len), 4); - (void) memcpy((void *)(pc + 8), (void *)(name), len); + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_GetProgramNamedParameterdvNV, + cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&id), 4); + (void) memcpy((void *) (pc + 4), (void *) (&len), 4); + (void) memcpy((void *) (pc + 8), (void *) (name), len); (void) __glXReadReply(dpy, 8, params, GL_TRUE); - UnlockDisplay(dpy); SyncHandle(); + UnlockDisplay(dpy); + SyncHandle(); } return; } #define X_GLvop_GetProgramNamedParameterfvNV 1310 void -__indirect_glGetProgramNamedParameterfvNV(GLuint id, GLsizei len, const GLubyte * name, GLfloat * params) +__indirect_glGetProgramNamedParameterfvNV(GLuint id, GLsizei len, + const GLubyte * name, + GLfloat * params) { - __GLXcontext * const gc = __glXGetCurrentContext(); - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; const GLuint cmdlen = 8 + __GLX_PAD(len); if (__builtin_expect((len >= 0) && (dpy != NULL), 1)) { - GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetProgramNamedParameterfvNV, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&id), 4); - (void) memcpy((void *)(pc + 4), (void *)(&len), 4); - (void) memcpy((void *)(pc + 8), (void *)(name), len); + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_GetProgramNamedParameterfvNV, + cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&id), 4); + (void) memcpy((void *) (pc + 4), (void *) (&len), 4); + (void) memcpy((void *) (pc + 8), (void *) (name), len); (void) __glXReadReply(dpy, 4, params, GL_TRUE); - UnlockDisplay(dpy); SyncHandle(); + UnlockDisplay(dpy); + SyncHandle(); } return; } #define X_GLrop_ProgramNamedParameter4dvNV 4219 void -__indirect_glProgramNamedParameter4dNV(GLuint id, GLsizei len, const GLubyte * name, GLdouble x, GLdouble y, GLdouble z, GLdouble w) +__indirect_glProgramNamedParameter4dNV(GLuint id, GLsizei len, + const GLubyte * name, GLdouble x, + GLdouble y, GLdouble z, GLdouble w) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 44 + __GLX_PAD(len); if (__builtin_expect(len >= 0, 1)) { emit_header(gc->pc, X_GLrop_ProgramNamedParameter4dvNV, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&x), 8); - (void) memcpy((void *)(gc->pc + 12), (void *)(&y), 8); - (void) memcpy((void *)(gc->pc + 20), (void *)(&z), 8); - (void) memcpy((void *)(gc->pc + 28), (void *)(&w), 8); - (void) memcpy((void *)(gc->pc + 36), (void *)(&id), 4); - (void) memcpy((void *)(gc->pc + 40), (void *)(&len), 4); - (void) memcpy((void *)(gc->pc + 44), (void *)(name), len); + (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 8); + (void) memcpy((void *) (gc->pc + 12), (void *) (&y), 8); + (void) memcpy((void *) (gc->pc + 20), (void *) (&z), 8); + (void) memcpy((void *) (gc->pc + 28), (void *) (&w), 8); + (void) memcpy((void *) (gc->pc + 36), (void *) (&id), 4); + (void) memcpy((void *) (gc->pc + 40), (void *) (&len), 4); + (void) memcpy((void *) (gc->pc + 44), (void *) (name), len); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } } #define X_GLrop_ProgramNamedParameter4dvNV 4219 void -__indirect_glProgramNamedParameter4dvNV(GLuint id, GLsizei len, const GLubyte * name, const GLdouble * v) +__indirect_glProgramNamedParameter4dvNV(GLuint id, GLsizei len, + const GLubyte * name, + const GLdouble * v) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 44 + __GLX_PAD(len); if (__builtin_expect(len >= 0, 1)) { emit_header(gc->pc, X_GLrop_ProgramNamedParameter4dvNV, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(v), 32); - (void) memcpy((void *)(gc->pc + 36), (void *)(&id), 4); - (void) memcpy((void *)(gc->pc + 40), (void *)(&len), 4); - (void) memcpy((void *)(gc->pc + 44), (void *)(name), len); + (void) memcpy((void *) (gc->pc + 4), (void *) (v), 32); + (void) memcpy((void *) (gc->pc + 36), (void *) (&id), 4); + (void) memcpy((void *) (gc->pc + 40), (void *) (&len), 4); + (void) memcpy((void *) (gc->pc + 44), (void *) (name), len); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } } #define X_GLrop_ProgramNamedParameter4fvNV 4218 void -__indirect_glProgramNamedParameter4fNV(GLuint id, GLsizei len, const GLubyte * name, GLfloat x, GLfloat y, GLfloat z, GLfloat w) +__indirect_glProgramNamedParameter4fNV(GLuint id, GLsizei len, + const GLubyte * name, GLfloat x, + GLfloat y, GLfloat z, GLfloat w) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 28 + __GLX_PAD(len); if (__builtin_expect(len >= 0, 1)) { emit_header(gc->pc, X_GLrop_ProgramNamedParameter4fvNV, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&id), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&len), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&x), 4); - (void) memcpy((void *)(gc->pc + 16), (void *)(&y), 4); - (void) memcpy((void *)(gc->pc + 20), (void *)(&z), 4); - (void) memcpy((void *)(gc->pc + 24), (void *)(&w), 4); - (void) memcpy((void *)(gc->pc + 28), (void *)(name), len); + (void) memcpy((void *) (gc->pc + 4), (void *) (&id), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&len), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&x), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&y), 4); + (void) memcpy((void *) (gc->pc + 20), (void *) (&z), 4); + (void) memcpy((void *) (gc->pc + 24), (void *) (&w), 4); + (void) memcpy((void *) (gc->pc + 28), (void *) (name), len); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } } #define X_GLrop_ProgramNamedParameter4fvNV 4218 void -__indirect_glProgramNamedParameter4fvNV(GLuint id, GLsizei len, const GLubyte * name, const GLfloat * v) +__indirect_glProgramNamedParameter4fvNV(GLuint id, GLsizei len, + const GLubyte * name, + const GLfloat * v) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 28 + __GLX_PAD(len); if (__builtin_expect(len >= 0, 1)) { emit_header(gc->pc, X_GLrop_ProgramNamedParameter4fvNV, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&id), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&len), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(v), 16); - (void) memcpy((void *)(gc->pc + 28), (void *)(name), len); + (void) memcpy((void *) (gc->pc + 4), (void *) (&id), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&len), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (v), 16); + (void) memcpy((void *) (gc->pc + 28), (void *) (name), len); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } } @@ -8261,54 +10090,64 @@ __indirect_glProgramNamedParameter4fvNV(GLuint id, GLsizei len, const GLubyte * void __indirect_glBlendEquationSeparateEXT(GLenum modeRGB, GLenum modeA) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_BlendEquationSeparateEXT, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&modeRGB), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&modeA), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&modeRGB), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&modeA), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_BindFramebufferEXT 4319 void __indirect_glBindFramebufferEXT(GLenum target, GLuint framebuffer) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_BindFramebufferEXT, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&framebuffer), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&framebuffer), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_BindRenderbufferEXT 4316 void __indirect_glBindRenderbufferEXT(GLenum target, GLuint renderbuffer) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_BindRenderbufferEXT, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&renderbuffer), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&renderbuffer), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLvop_CheckFramebufferStatusEXT 1427 GLenum __indirect_glCheckFramebufferStatusEXT(GLenum target) { - __GLXcontext * const gc = __glXGetCurrentContext(); - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; GLenum retval = (GLenum) 0; const GLuint cmdlen = 4; if (__builtin_expect(dpy != NULL, 1)) { - GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_CheckFramebufferStatusEXT, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&target), 4); + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_CheckFramebufferStatusEXT, + cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); retval = (GLenum) __glXReadReply(dpy, 0, NULL, GL_FALSE); - UnlockDisplay(dpy); SyncHandle(); + UnlockDisplay(dpy); + SyncHandle(); } return retval; } @@ -8317,14 +10156,17 @@ __indirect_glCheckFramebufferStatusEXT(GLenum target) void __indirect_glDeleteFramebuffersEXT(GLsizei n, const GLuint * framebuffers) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8 + __GLX_PAD((n * 4)); if (__builtin_expect(n >= 0, 1)) { emit_header(gc->pc, X_GLrop_DeleteFramebuffersEXT, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&n), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(framebuffers), (n * 4)); + (void) memcpy((void *) (gc->pc + 4), (void *) (&n), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (framebuffers), + (n * 4)); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } } @@ -8332,93 +10174,115 @@ __indirect_glDeleteFramebuffersEXT(GLsizei n, const GLuint * framebuffers) void __indirect_glDeleteRenderbuffersEXT(GLsizei n, const GLuint * renderbuffers) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8 + __GLX_PAD((n * 4)); if (__builtin_expect(n >= 0, 1)) { emit_header(gc->pc, X_GLrop_DeleteRenderbuffersEXT, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&n), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(renderbuffers), (n * 4)); + (void) memcpy((void *) (gc->pc + 4), (void *) (&n), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (renderbuffers), + (n * 4)); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } } #define X_GLrop_FramebufferRenderbufferEXT 4324 void -__indirect_glFramebufferRenderbufferEXT(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) +__indirect_glFramebufferRenderbufferEXT(GLenum target, GLenum attachment, + GLenum renderbuffertarget, + GLuint renderbuffer) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_FramebufferRenderbufferEXT, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&attachment), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&renderbuffertarget), 4); - (void) memcpy((void *)(gc->pc + 16), (void *)(&renderbuffer), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&attachment), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&renderbuffertarget), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&renderbuffer), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_FramebufferTexture1DEXT 4321 void -__indirect_glFramebufferTexture1DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) +__indirect_glFramebufferTexture1DEXT(GLenum target, GLenum attachment, + GLenum textarget, GLuint texture, + GLint level) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 24; emit_header(gc->pc, X_GLrop_FramebufferTexture1DEXT, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&attachment), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&textarget), 4); - (void) memcpy((void *)(gc->pc + 16), (void *)(&texture), 4); - (void) memcpy((void *)(gc->pc + 20), (void *)(&level), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&attachment), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&textarget), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&texture), 4); + (void) memcpy((void *) (gc->pc + 20), (void *) (&level), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_FramebufferTexture2DEXT 4322 void -__indirect_glFramebufferTexture2DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) +__indirect_glFramebufferTexture2DEXT(GLenum target, GLenum attachment, + GLenum textarget, GLuint texture, + GLint level) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 24; emit_header(gc->pc, X_GLrop_FramebufferTexture2DEXT, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&attachment), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&textarget), 4); - (void) memcpy((void *)(gc->pc + 16), (void *)(&texture), 4); - (void) memcpy((void *)(gc->pc + 20), (void *)(&level), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&attachment), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&textarget), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&texture), 4); + (void) memcpy((void *) (gc->pc + 20), (void *) (&level), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLrop_FramebufferTexture3DEXT 4323 void -__indirect_glFramebufferTexture3DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset) +__indirect_glFramebufferTexture3DEXT(GLenum target, GLenum attachment, + GLenum textarget, GLuint texture, + GLint level, GLint zoffset) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 28; emit_header(gc->pc, X_GLrop_FramebufferTexture3DEXT, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&attachment), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&textarget), 4); - (void) memcpy((void *)(gc->pc + 16), (void *)(&texture), 4); - (void) memcpy((void *)(gc->pc + 20), (void *)(&level), 4); - (void) memcpy((void *)(gc->pc + 24), (void *)(&zoffset), 4); - gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&attachment), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&textarget), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&texture), 4); + (void) memcpy((void *) (gc->pc + 20), (void *) (&level), 4); + (void) memcpy((void *) (gc->pc + 24), (void *) (&zoffset), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLvop_GenFramebuffersEXT 1426 void __indirect_glGenFramebuffersEXT(GLsizei n, GLuint * framebuffers) { - __GLXcontext * const gc = __glXGetCurrentContext(); - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; const GLuint cmdlen = 4; if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) { - GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GenFramebuffersEXT, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&n), 4); + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_GenFramebuffersEXT, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&n), 4); (void) __glXReadReply(dpy, 4, framebuffers, GL_TRUE); - UnlockDisplay(dpy); SyncHandle(); + UnlockDisplay(dpy); + SyncHandle(); } return; } @@ -8427,14 +10291,17 @@ __indirect_glGenFramebuffersEXT(GLsizei n, GLuint * framebuffers) void __indirect_glGenRenderbuffersEXT(GLsizei n, GLuint * renderbuffers) { - __GLXcontext * const gc = __glXGetCurrentContext(); - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; const GLuint cmdlen = 4; if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) { - GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GenRenderbuffersEXT, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&n), 4); + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_GenRenderbuffersEXT, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&n), 4); (void) __glXReadReply(dpy, 4, renderbuffers, GL_TRUE); - UnlockDisplay(dpy); SyncHandle(); + UnlockDisplay(dpy); + SyncHandle(); } return; } @@ -8443,45 +10310,59 @@ __indirect_glGenRenderbuffersEXT(GLsizei n, GLuint * renderbuffers) void __indirect_glGenerateMipmapEXT(GLenum target) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_GenerateMipmapEXT, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } #define X_GLvop_GetFramebufferAttachmentParameterivEXT 1428 void -__indirect_glGetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment, GLenum pname, GLint * params) +__indirect_glGetFramebufferAttachmentParameterivEXT(GLenum target, + GLenum attachment, + GLenum pname, + GLint * params) { - __GLXcontext * const gc = __glXGetCurrentContext(); - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; const GLuint cmdlen = 12; if (__builtin_expect(dpy != NULL, 1)) { - GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetFramebufferAttachmentParameterivEXT, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&target), 4); - (void) memcpy((void *)(pc + 4), (void *)(&attachment), 4); - (void) memcpy((void *)(pc + 8), (void *)(&pname), 4); + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_GetFramebufferAttachmentParameterivEXT, + cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&attachment), 4); + (void) memcpy((void *) (pc + 8), (void *) (&pname), 4); (void) __glXReadReply(dpy, 4, params, GL_FALSE); - UnlockDisplay(dpy); SyncHandle(); + UnlockDisplay(dpy); + SyncHandle(); } return; } #define X_GLvop_GetRenderbufferParameterivEXT 1424 void -__indirect_glGetRenderbufferParameterivEXT(GLenum target, GLenum pname, GLint * params) +__indirect_glGetRenderbufferParameterivEXT(GLenum target, GLenum pname, + GLint * params) { - __GLXcontext * const gc = __glXGetCurrentContext(); - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; const GLuint cmdlen = 8; if (__builtin_expect(dpy != NULL, 1)) { - GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetRenderbufferParameterivEXT, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&target), 4); - (void) memcpy((void *)(pc + 4), (void *)(&pname), 4); + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_GetRenderbufferParameterivEXT, + cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&pname), 4); (void) __glXReadReply(dpy, 4, params, GL_FALSE); - UnlockDisplay(dpy); SyncHandle(); + UnlockDisplay(dpy); + SyncHandle(); } return; } @@ -8490,15 +10371,18 @@ __indirect_glGetRenderbufferParameterivEXT(GLenum target, GLenum pname, GLint * GLboolean __indirect_glIsFramebufferEXT(GLuint framebuffer) { - __GLXcontext * const gc = __glXGetCurrentContext(); - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; GLboolean retval = (GLboolean) 0; const GLuint cmdlen = 4; if (__builtin_expect(dpy != NULL, 1)) { - GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_IsFramebufferEXT, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&framebuffer), 4); + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_IsFramebufferEXT, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&framebuffer), 4); retval = (GLboolean) __glXReadReply(dpy, 0, NULL, GL_FALSE); - UnlockDisplay(dpy); SyncHandle(); + UnlockDisplay(dpy); + SyncHandle(); } return retval; } @@ -8507,32 +10391,38 @@ __indirect_glIsFramebufferEXT(GLuint framebuffer) GLboolean __indirect_glIsRenderbufferEXT(GLuint renderbuffer) { - __GLXcontext * const gc = __glXGetCurrentContext(); - Display * const dpy = gc->currentDpy; + __GLXcontext *const gc = __glXGetCurrentContext(); + Display *const dpy = gc->currentDpy; GLboolean retval = (GLboolean) 0; const GLuint cmdlen = 4; if (__builtin_expect(dpy != NULL, 1)) { - GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_IsRenderbufferEXT, cmdlen); - (void) memcpy((void *)(pc + 0), (void *)(&renderbuffer), 4); + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_IsRenderbufferEXT, cmdlen); + (void) memcpy((void *) (pc + 0), (void *) (&renderbuffer), 4); retval = (GLboolean) __glXReadReply(dpy, 0, NULL, GL_FALSE); - UnlockDisplay(dpy); SyncHandle(); + UnlockDisplay(dpy); + SyncHandle(); } return retval; } #define X_GLrop_RenderbufferStorageEXT 4318 void -__indirect_glRenderbufferStorageEXT(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) +__indirect_glRenderbufferStorageEXT(GLenum target, GLenum internalformat, + GLsizei width, GLsizei height) { - __GLXcontext * const gc = __glXGetCurrentContext(); + __GLXcontext *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_RenderbufferStorageEXT, cmdlen); - (void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4); - (void) memcpy((void *)(gc->pc + 8), (void *)(&internalformat), 4); - (void) memcpy((void *)(gc->pc + 12), (void *)(&width), 4); - (void) memcpy((void *)(gc->pc + 16), (void *)(&height), 4); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&internalformat), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&width), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&height), 4); gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } } diff --git a/src/glx/x11/indirect.h b/src/glx/x11/indirect.h index 2e953ca011c..e5b1fadf2b9 100644 --- a/src/glx/x11/indirect.h +++ b/src/glx/x11/indirect.h @@ -392,14 +392,18 @@ extern HIDDEN void __indirect_glPolygonOffset(GLfloat factor, GLfloat units); extern HIDDEN void __indirect_glTexCoordPointer(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); extern HIDDEN void __indirect_glVertexPointer(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); extern HIDDEN GLboolean __indirect_glAreTexturesResident(GLsizei n, const GLuint * textures, GLboolean * residences); +GLAPI GLboolean GLAPIENTRY glAreTexturesResidentEXT(GLsizei n, const GLuint * textures, GLboolean * residences); extern HIDDEN void __indirect_glCopyTexImage1D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); extern HIDDEN void __indirect_glCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); extern HIDDEN void __indirect_glCopyTexSubImage1D(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); extern HIDDEN void __indirect_glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); extern HIDDEN void __indirect_glDeleteTextures(GLsizei n, const GLuint * textures); +GLAPI void GLAPIENTRY glDeleteTexturesEXT(GLsizei n, const GLuint * textures); extern HIDDEN void __indirect_glGenTextures(GLsizei n, GLuint * textures); +GLAPI void GLAPIENTRY glGenTexturesEXT(GLsizei n, GLuint * textures); extern HIDDEN void __indirect_glGetPointerv(GLenum pname, GLvoid ** params); extern HIDDEN GLboolean __indirect_glIsTexture(GLuint texture); +GLAPI GLboolean GLAPIENTRY glIsTextureEXT(GLuint texture); extern HIDDEN void __indirect_glPrioritizeTextures(GLsizei n, const GLuint * textures, const GLclampf * priorities); extern HIDDEN void __indirect_glTexSubImage1D(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid * pixels); extern HIDDEN void __indirect_glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels); @@ -413,8 +417,11 @@ extern HIDDEN void __indirect_glColorTableParameterfv(GLenum target, GLenum pnam extern HIDDEN void __indirect_glColorTableParameteriv(GLenum target, GLenum pname, const GLint * params); extern HIDDEN void __indirect_glCopyColorTable(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); extern HIDDEN void __indirect_glGetColorTable(GLenum target, GLenum format, GLenum type, GLvoid * table); +GLAPI void GLAPIENTRY glGetColorTableEXT(GLenum target, GLenum format, GLenum type, GLvoid * table); extern HIDDEN void __indirect_glGetColorTableParameterfv(GLenum target, GLenum pname, GLfloat * params); +GLAPI void GLAPIENTRY glGetColorTableParameterfvEXT(GLenum target, GLenum pname, GLfloat * params); extern HIDDEN void __indirect_glGetColorTableParameteriv(GLenum target, GLenum pname, GLint * params); +GLAPI void GLAPIENTRY glGetColorTableParameterivEXT(GLenum target, GLenum pname, GLint * params); extern HIDDEN void __indirect_glColorSubTable(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid * data); extern HIDDEN void __indirect_glCopyColorSubTable(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); extern HIDDEN void __indirect_glConvolutionFilter1D(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * image); @@ -426,16 +433,26 @@ extern HIDDEN void __indirect_glConvolutionParameteriv(GLenum target, GLenum pna extern HIDDEN void __indirect_glCopyConvolutionFilter1D(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); extern HIDDEN void __indirect_glCopyConvolutionFilter2D(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); extern HIDDEN void __indirect_glGetConvolutionFilter(GLenum target, GLenum format, GLenum type, GLvoid * image); +extern HIDDEN void gl_dispatch_stub_356(GLenum target, GLenum format, GLenum type, GLvoid * image); extern HIDDEN void __indirect_glGetConvolutionParameterfv(GLenum target, GLenum pname, GLfloat * params); +extern HIDDEN void gl_dispatch_stub_357(GLenum target, GLenum pname, GLfloat * params); extern HIDDEN void __indirect_glGetConvolutionParameteriv(GLenum target, GLenum pname, GLint * params); +extern HIDDEN void gl_dispatch_stub_358(GLenum target, GLenum pname, GLint * params); extern HIDDEN void __indirect_glGetSeparableFilter(GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span); +extern HIDDEN void gl_dispatch_stub_359(GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span); extern HIDDEN void __indirect_glSeparableFilter2D(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * row, const GLvoid * column); extern HIDDEN void __indirect_glGetHistogram(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values); +extern HIDDEN void gl_dispatch_stub_361(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values); extern HIDDEN void __indirect_glGetHistogramParameterfv(GLenum target, GLenum pname, GLfloat * params); +extern HIDDEN void gl_dispatch_stub_362(GLenum target, GLenum pname, GLfloat * params); extern HIDDEN void __indirect_glGetHistogramParameteriv(GLenum target, GLenum pname, GLint * params); +extern HIDDEN void gl_dispatch_stub_363(GLenum target, GLenum pname, GLint * params); extern HIDDEN void __indirect_glGetMinmax(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values); +extern HIDDEN void gl_dispatch_stub_364(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values); extern HIDDEN void __indirect_glGetMinmaxParameterfv(GLenum target, GLenum pname, GLfloat * params); +extern HIDDEN void gl_dispatch_stub_365(GLenum target, GLenum pname, GLfloat * params); extern HIDDEN void __indirect_glGetMinmaxParameteriv(GLenum target, GLenum pname, GLint * params); +extern HIDDEN void gl_dispatch_stub_366(GLenum target, GLenum pname, GLint * params); extern HIDDEN void __indirect_glHistogram(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); extern HIDDEN void __indirect_glMinmax(GLenum target, GLenum internalformat, GLboolean sink); extern HIDDEN void __indirect_glResetHistogram(GLenum target); @@ -555,12 +572,6 @@ extern HIDDEN void __indirect_glGetQueryObjectuivARB(GLuint id, GLenum pname, GL extern HIDDEN void __indirect_glGetQueryivARB(GLenum target, GLenum pname, GLint * params); extern HIDDEN GLboolean __indirect_glIsQueryARB(GLuint id); extern HIDDEN void __indirect_glDrawBuffersARB(GLsizei n, const GLenum * bufs); -extern HIDDEN void __indirect_glGetColorTableParameterfvSGI(GLenum target, GLenum pname, GLfloat * params); -extern HIDDEN void __indirect_glGetColorTableParameterivSGI(GLenum target, GLenum pname, GLint * params); -extern HIDDEN void __indirect_glGetColorTableSGI(GLenum target, GLenum format, GLenum type, GLvoid * table); -extern HIDDEN GLboolean __indirect_glAreTexturesResidentEXT(GLsizei n, const GLuint * textures, GLboolean * residences); -extern HIDDEN void __indirect_glGenTexturesEXT(GLsizei n, GLuint * textures); -extern HIDDEN GLboolean __indirect_glIsTextureEXT(GLuint texture); extern HIDDEN void __indirect_glSampleMaskSGIS(GLclampf value, GLboolean invert); extern HIDDEN void __indirect_glSamplePatternSGIS(GLenum pattern); extern HIDDEN void __indirect_glColorPointerEXT(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); diff --git a/src/glx/x11/indirect_init.c b/src/glx/x11/indirect_init.c index ddbd8955220..aaa70c8796a 100644 --- a/src/glx/x11/indirect_init.c +++ b/src/glx/x11/indirect_init.c @@ -74,15 +74,20 @@ __GLapi * __glXNewIndirectAPI( void ) /* 1.0 */ - glAPI->NewList = __indirect_glNewList; - glAPI->EndList = __indirect_glEndList; - glAPI->CallList = __indirect_glCallList; - glAPI->CallLists = __indirect_glCallLists; - glAPI->DeleteLists = __indirect_glDeleteLists; - glAPI->GenLists = __indirect_glGenLists; - glAPI->ListBase = __indirect_glListBase; + glAPI->Accum = __indirect_glAccum; + glAPI->AlphaFunc = __indirect_glAlphaFunc; glAPI->Begin = __indirect_glBegin; glAPI->Bitmap = __indirect_glBitmap; + glAPI->BlendFunc = __indirect_glBlendFunc; + glAPI->CallList = __indirect_glCallList; + glAPI->CallLists = __indirect_glCallLists; + glAPI->Clear = __indirect_glClear; + glAPI->ClearAccum = __indirect_glClearAccum; + glAPI->ClearColor = __indirect_glClearColor; + glAPI->ClearDepth = __indirect_glClearDepth; + glAPI->ClearIndex = __indirect_glClearIndex; + glAPI->ClearStencil = __indirect_glClearStencil; + glAPI->ClipPlane = __indirect_glClipPlane; glAPI->Color3b = __indirect_glColor3b; glAPI->Color3bv = __indirect_glColor3bv; glAPI->Color3d = __indirect_glColor3d; @@ -115,9 +120,74 @@ __GLapi * __glXNewIndirectAPI( void ) glAPI->Color4uiv = __indirect_glColor4uiv; glAPI->Color4us = __indirect_glColor4us; glAPI->Color4usv = __indirect_glColor4usv; + glAPI->ColorMask = __indirect_glColorMask; + glAPI->ColorMaterial = __indirect_glColorMaterial; + glAPI->CopyPixels = __indirect_glCopyPixels; + glAPI->CullFace = __indirect_glCullFace; + glAPI->DeleteLists = __indirect_glDeleteLists; + glAPI->DepthFunc = __indirect_glDepthFunc; + glAPI->DepthMask = __indirect_glDepthMask; + glAPI->DepthRange = __indirect_glDepthRange; + glAPI->Disable = __indirect_glDisable; + glAPI->DrawBuffer = __indirect_glDrawBuffer; + glAPI->DrawPixels = __indirect_glDrawPixels; glAPI->EdgeFlag = __indirect_glEdgeFlag; glAPI->EdgeFlagv = __indirect_glEdgeFlagv; + glAPI->Enable = __indirect_glEnable; glAPI->End = __indirect_glEnd; + glAPI->EndList = __indirect_glEndList; + glAPI->EvalCoord1d = __indirect_glEvalCoord1d; + glAPI->EvalCoord1dv = __indirect_glEvalCoord1dv; + glAPI->EvalCoord1f = __indirect_glEvalCoord1f; + glAPI->EvalCoord1fv = __indirect_glEvalCoord1fv; + glAPI->EvalCoord2d = __indirect_glEvalCoord2d; + glAPI->EvalCoord2dv = __indirect_glEvalCoord2dv; + glAPI->EvalCoord2f = __indirect_glEvalCoord2f; + glAPI->EvalCoord2fv = __indirect_glEvalCoord2fv; + glAPI->EvalMesh1 = __indirect_glEvalMesh1; + glAPI->EvalMesh2 = __indirect_glEvalMesh2; + glAPI->EvalPoint1 = __indirect_glEvalPoint1; + glAPI->EvalPoint2 = __indirect_glEvalPoint2; + glAPI->FeedbackBuffer = __indirect_glFeedbackBuffer; + glAPI->Finish = __indirect_glFinish; + glAPI->Flush = __indirect_glFlush; + glAPI->Fogf = __indirect_glFogf; + glAPI->Fogfv = __indirect_glFogfv; + glAPI->Fogi = __indirect_glFogi; + glAPI->Fogiv = __indirect_glFogiv; + glAPI->FrontFace = __indirect_glFrontFace; + glAPI->Frustum = __indirect_glFrustum; + glAPI->GenLists = __indirect_glGenLists; + glAPI->GetBooleanv = __indirect_glGetBooleanv; + glAPI->GetClipPlane = __indirect_glGetClipPlane; + glAPI->GetDoublev = __indirect_glGetDoublev; + glAPI->GetError = __indirect_glGetError; + glAPI->GetFloatv = __indirect_glGetFloatv; + glAPI->GetIntegerv = __indirect_glGetIntegerv; + glAPI->GetLightfv = __indirect_glGetLightfv; + glAPI->GetLightiv = __indirect_glGetLightiv; + glAPI->GetMapdv = __indirect_glGetMapdv; + glAPI->GetMapfv = __indirect_glGetMapfv; + glAPI->GetMapiv = __indirect_glGetMapiv; + glAPI->GetMaterialfv = __indirect_glGetMaterialfv; + glAPI->GetMaterialiv = __indirect_glGetMaterialiv; + glAPI->GetPixelMapfv = __indirect_glGetPixelMapfv; + glAPI->GetPixelMapuiv = __indirect_glGetPixelMapuiv; + glAPI->GetPixelMapusv = __indirect_glGetPixelMapusv; + glAPI->GetPolygonStipple = __indirect_glGetPolygonStipple; + glAPI->GetString = __indirect_glGetString; + glAPI->GetTexEnvfv = __indirect_glGetTexEnvfv; + glAPI->GetTexEnviv = __indirect_glGetTexEnviv; + glAPI->GetTexGendv = __indirect_glGetTexGendv; + glAPI->GetTexGenfv = __indirect_glGetTexGenfv; + glAPI->GetTexGeniv = __indirect_glGetTexGeniv; + glAPI->GetTexImage = __indirect_glGetTexImage; + glAPI->GetTexLevelParameterfv = __indirect_glGetTexLevelParameterfv; + glAPI->GetTexLevelParameteriv = __indirect_glGetTexLevelParameteriv; + glAPI->GetTexParameterfv = __indirect_glGetTexParameterfv; + glAPI->GetTexParameteriv = __indirect_glGetTexParameteriv; + glAPI->Hint = __indirect_glHint; + glAPI->IndexMask = __indirect_glIndexMask; glAPI->Indexd = __indirect_glIndexd; glAPI->Indexdv = __indirect_glIndexdv; glAPI->Indexf = __indirect_glIndexf; @@ -126,6 +196,41 @@ __GLapi * __glXNewIndirectAPI( void ) glAPI->Indexiv = __indirect_glIndexiv; glAPI->Indexs = __indirect_glIndexs; glAPI->Indexsv = __indirect_glIndexsv; + glAPI->InitNames = __indirect_glInitNames; + glAPI->IsEnabled = __indirect_glIsEnabled; + glAPI->IsList = __indirect_glIsList; + glAPI->LightModelf = __indirect_glLightModelf; + glAPI->LightModelfv = __indirect_glLightModelfv; + glAPI->LightModeli = __indirect_glLightModeli; + glAPI->LightModeliv = __indirect_glLightModeliv; + glAPI->Lightf = __indirect_glLightf; + glAPI->Lightfv = __indirect_glLightfv; + glAPI->Lighti = __indirect_glLighti; + glAPI->Lightiv = __indirect_glLightiv; + glAPI->LineStipple = __indirect_glLineStipple; + glAPI->LineWidth = __indirect_glLineWidth; + glAPI->ListBase = __indirect_glListBase; + glAPI->LoadIdentity = __indirect_glLoadIdentity; + glAPI->LoadMatrixd = __indirect_glLoadMatrixd; + glAPI->LoadMatrixf = __indirect_glLoadMatrixf; + glAPI->LoadName = __indirect_glLoadName; + glAPI->LogicOp = __indirect_glLogicOp; + glAPI->Map1d = __indirect_glMap1d; + glAPI->Map1f = __indirect_glMap1f; + glAPI->Map2d = __indirect_glMap2d; + glAPI->Map2f = __indirect_glMap2f; + glAPI->MapGrid1d = __indirect_glMapGrid1d; + glAPI->MapGrid1f = __indirect_glMapGrid1f; + glAPI->MapGrid2d = __indirect_glMapGrid2d; + glAPI->MapGrid2f = __indirect_glMapGrid2f; + glAPI->Materialf = __indirect_glMaterialf; + glAPI->Materialfv = __indirect_glMaterialfv; + glAPI->Materiali = __indirect_glMateriali; + glAPI->Materialiv = __indirect_glMaterialiv; + glAPI->MatrixMode = __indirect_glMatrixMode; + glAPI->MultMatrixd = __indirect_glMultMatrixd; + glAPI->MultMatrixf = __indirect_glMultMatrixf; + glAPI->NewList = __indirect_glNewList; glAPI->Normal3b = __indirect_glNormal3b; glAPI->Normal3bv = __indirect_glNormal3bv; glAPI->Normal3d = __indirect_glNormal3d; @@ -136,6 +241,25 @@ __GLapi * __glXNewIndirectAPI( void ) glAPI->Normal3iv = __indirect_glNormal3iv; glAPI->Normal3s = __indirect_glNormal3s; glAPI->Normal3sv = __indirect_glNormal3sv; + glAPI->Ortho = __indirect_glOrtho; + glAPI->PassThrough = __indirect_glPassThrough; + glAPI->PixelMapfv = __indirect_glPixelMapfv; + glAPI->PixelMapuiv = __indirect_glPixelMapuiv; + glAPI->PixelMapusv = __indirect_glPixelMapusv; + glAPI->PixelStoref = __indirect_glPixelStoref; + glAPI->PixelStorei = __indirect_glPixelStorei; + glAPI->PixelTransferf = __indirect_glPixelTransferf; + glAPI->PixelTransferi = __indirect_glPixelTransferi; + glAPI->PixelZoom = __indirect_glPixelZoom; + glAPI->PointSize = __indirect_glPointSize; + glAPI->PolygonMode = __indirect_glPolygonMode; + glAPI->PolygonStipple = __indirect_glPolygonStipple; + glAPI->PopAttrib = __indirect_glPopAttrib; + glAPI->PopMatrix = __indirect_glPopMatrix; + glAPI->PopName = __indirect_glPopName; + glAPI->PushAttrib = __indirect_glPushAttrib; + glAPI->PushMatrix = __indirect_glPushMatrix; + glAPI->PushName = __indirect_glPushName; glAPI->RasterPos2d = __indirect_glRasterPos2d; glAPI->RasterPos2dv = __indirect_glRasterPos2dv; glAPI->RasterPos2f = __indirect_glRasterPos2f; @@ -160,6 +284,8 @@ __GLapi * __glXNewIndirectAPI( void ) glAPI->RasterPos4iv = __indirect_glRasterPos4iv; glAPI->RasterPos4s = __indirect_glRasterPos4s; glAPI->RasterPos4sv = __indirect_glRasterPos4sv; + glAPI->ReadBuffer = __indirect_glReadBuffer; + glAPI->ReadPixels = __indirect_glReadPixels; glAPI->Rectd = __indirect_glRectd; glAPI->Rectdv = __indirect_glRectdv; glAPI->Rectf = __indirect_glRectf; @@ -168,6 +294,17 @@ __GLapi * __glXNewIndirectAPI( void ) glAPI->Rectiv = __indirect_glRectiv; glAPI->Rects = __indirect_glRects; glAPI->Rectsv = __indirect_glRectsv; + glAPI->RenderMode = __indirect_glRenderMode; + glAPI->Rotated = __indirect_glRotated; + glAPI->Rotatef = __indirect_glRotatef; + glAPI->Scaled = __indirect_glScaled; + glAPI->Scalef = __indirect_glScalef; + glAPI->Scissor = __indirect_glScissor; + glAPI->SelectBuffer = __indirect_glSelectBuffer; + glAPI->ShadeModel = __indirect_glShadeModel; + glAPI->StencilFunc = __indirect_glStencilFunc; + glAPI->StencilMask = __indirect_glStencilMask; + glAPI->StencilOp = __indirect_glStencilOp; glAPI->TexCoord1d = __indirect_glTexCoord1d; glAPI->TexCoord1dv = __indirect_glTexCoord1dv; glAPI->TexCoord1f = __indirect_glTexCoord1f; @@ -200,6 +337,24 @@ __GLapi * __glXNewIndirectAPI( void ) glAPI->TexCoord4iv = __indirect_glTexCoord4iv; glAPI->TexCoord4s = __indirect_glTexCoord4s; glAPI->TexCoord4sv = __indirect_glTexCoord4sv; + glAPI->TexEnvf = __indirect_glTexEnvf; + glAPI->TexEnvfv = __indirect_glTexEnvfv; + glAPI->TexEnvi = __indirect_glTexEnvi; + glAPI->TexEnviv = __indirect_glTexEnviv; + glAPI->TexGend = __indirect_glTexGend; + glAPI->TexGendv = __indirect_glTexGendv; + glAPI->TexGenf = __indirect_glTexGenf; + glAPI->TexGenfv = __indirect_glTexGenfv; + glAPI->TexGeni = __indirect_glTexGeni; + glAPI->TexGeniv = __indirect_glTexGeniv; + glAPI->TexImage1D = __indirect_glTexImage1D; + glAPI->TexImage2D = __indirect_glTexImage2D; + glAPI->TexParameterf = __indirect_glTexParameterf; + glAPI->TexParameterfv = __indirect_glTexParameterfv; + glAPI->TexParameteri = __indirect_glTexParameteri; + glAPI->TexParameteriv = __indirect_glTexParameteriv; + glAPI->Translated = __indirect_glTranslated; + glAPI->Translatef = __indirect_glTranslatef; glAPI->Vertex2d = __indirect_glVertex2d; glAPI->Vertex2dv = __indirect_glVertex2dv; glAPI->Vertex2f = __indirect_glVertex2f; @@ -224,239 +379,94 @@ __GLapi * __glXNewIndirectAPI( void ) glAPI->Vertex4iv = __indirect_glVertex4iv; glAPI->Vertex4s = __indirect_glVertex4s; glAPI->Vertex4sv = __indirect_glVertex4sv; - glAPI->ClipPlane = __indirect_glClipPlane; - glAPI->ColorMaterial = __indirect_glColorMaterial; - glAPI->CullFace = __indirect_glCullFace; - glAPI->Fogf = __indirect_glFogf; - glAPI->Fogfv = __indirect_glFogfv; - glAPI->Fogi = __indirect_glFogi; - glAPI->Fogiv = __indirect_glFogiv; - glAPI->FrontFace = __indirect_glFrontFace; - glAPI->Hint = __indirect_glHint; - glAPI->Lightf = __indirect_glLightf; - glAPI->Lightfv = __indirect_glLightfv; - glAPI->Lighti = __indirect_glLighti; - glAPI->Lightiv = __indirect_glLightiv; - glAPI->LightModelf = __indirect_glLightModelf; - glAPI->LightModelfv = __indirect_glLightModelfv; - glAPI->LightModeli = __indirect_glLightModeli; - glAPI->LightModeliv = __indirect_glLightModeliv; - glAPI->LineStipple = __indirect_glLineStipple; - glAPI->LineWidth = __indirect_glLineWidth; - glAPI->Materialf = __indirect_glMaterialf; - glAPI->Materialfv = __indirect_glMaterialfv; - glAPI->Materiali = __indirect_glMateriali; - glAPI->Materialiv = __indirect_glMaterialiv; - glAPI->PointSize = __indirect_glPointSize; - glAPI->PolygonMode = __indirect_glPolygonMode; - glAPI->PolygonStipple = __indirect_glPolygonStipple; - glAPI->Scissor = __indirect_glScissor; - glAPI->ShadeModel = __indirect_glShadeModel; - glAPI->TexParameterf = __indirect_glTexParameterf; - glAPI->TexParameterfv = __indirect_glTexParameterfv; - glAPI->TexParameteri = __indirect_glTexParameteri; - glAPI->TexParameteriv = __indirect_glTexParameteriv; - glAPI->TexImage1D = __indirect_glTexImage1D; - glAPI->TexImage2D = __indirect_glTexImage2D; - glAPI->TexEnvf = __indirect_glTexEnvf; - glAPI->TexEnvfv = __indirect_glTexEnvfv; - glAPI->TexEnvi = __indirect_glTexEnvi; - glAPI->TexEnviv = __indirect_glTexEnviv; - glAPI->TexGend = __indirect_glTexGend; - glAPI->TexGendv = __indirect_glTexGendv; - glAPI->TexGenf = __indirect_glTexGenf; - glAPI->TexGenfv = __indirect_glTexGenfv; - glAPI->TexGeni = __indirect_glTexGeni; - glAPI->TexGeniv = __indirect_glTexGeniv; - glAPI->FeedbackBuffer = __indirect_glFeedbackBuffer; - glAPI->SelectBuffer = __indirect_glSelectBuffer; - glAPI->RenderMode = __indirect_glRenderMode; - glAPI->InitNames = __indirect_glInitNames; - glAPI->LoadName = __indirect_glLoadName; - glAPI->PassThrough = __indirect_glPassThrough; - glAPI->PopName = __indirect_glPopName; - glAPI->PushName = __indirect_glPushName; - glAPI->DrawBuffer = __indirect_glDrawBuffer; - glAPI->Clear = __indirect_glClear; - glAPI->ClearAccum = __indirect_glClearAccum; - glAPI->ClearIndex = __indirect_glClearIndex; - glAPI->ClearColor = __indirect_glClearColor; - glAPI->ClearStencil = __indirect_glClearStencil; - glAPI->ClearDepth = __indirect_glClearDepth; - glAPI->StencilMask = __indirect_glStencilMask; - glAPI->ColorMask = __indirect_glColorMask; - glAPI->DepthMask = __indirect_glDepthMask; - glAPI->IndexMask = __indirect_glIndexMask; - glAPI->Accum = __indirect_glAccum; - glAPI->Disable = __indirect_glDisable; - glAPI->Enable = __indirect_glEnable; - glAPI->Finish = __indirect_glFinish; - glAPI->Flush = __indirect_glFlush; - glAPI->PopAttrib = __indirect_glPopAttrib; - glAPI->PushAttrib = __indirect_glPushAttrib; - glAPI->Map1d = __indirect_glMap1d; - glAPI->Map1f = __indirect_glMap1f; - glAPI->Map2d = __indirect_glMap2d; - glAPI->Map2f = __indirect_glMap2f; - glAPI->MapGrid1d = __indirect_glMapGrid1d; - glAPI->MapGrid1f = __indirect_glMapGrid1f; - glAPI->MapGrid2d = __indirect_glMapGrid2d; - glAPI->MapGrid2f = __indirect_glMapGrid2f; - glAPI->EvalCoord1d = __indirect_glEvalCoord1d; - glAPI->EvalCoord1dv = __indirect_glEvalCoord1dv; - glAPI->EvalCoord1f = __indirect_glEvalCoord1f; - glAPI->EvalCoord1fv = __indirect_glEvalCoord1fv; - glAPI->EvalCoord2d = __indirect_glEvalCoord2d; - glAPI->EvalCoord2dv = __indirect_glEvalCoord2dv; - glAPI->EvalCoord2f = __indirect_glEvalCoord2f; - glAPI->EvalCoord2fv = __indirect_glEvalCoord2fv; - glAPI->EvalMesh1 = __indirect_glEvalMesh1; - glAPI->EvalPoint1 = __indirect_glEvalPoint1; - glAPI->EvalMesh2 = __indirect_glEvalMesh2; - glAPI->EvalPoint2 = __indirect_glEvalPoint2; - glAPI->AlphaFunc = __indirect_glAlphaFunc; - glAPI->BlendFunc = __indirect_glBlendFunc; - glAPI->LogicOp = __indirect_glLogicOp; - glAPI->StencilFunc = __indirect_glStencilFunc; - glAPI->StencilOp = __indirect_glStencilOp; - glAPI->DepthFunc = __indirect_glDepthFunc; - glAPI->PixelZoom = __indirect_glPixelZoom; - glAPI->PixelTransferf = __indirect_glPixelTransferf; - glAPI->PixelTransferi = __indirect_glPixelTransferi; - glAPI->PixelStoref = __indirect_glPixelStoref; - glAPI->PixelStorei = __indirect_glPixelStorei; - glAPI->PixelMapfv = __indirect_glPixelMapfv; - glAPI->PixelMapuiv = __indirect_glPixelMapuiv; - glAPI->PixelMapusv = __indirect_glPixelMapusv; - glAPI->ReadBuffer = __indirect_glReadBuffer; - glAPI->CopyPixels = __indirect_glCopyPixels; - glAPI->ReadPixels = __indirect_glReadPixels; - glAPI->DrawPixels = __indirect_glDrawPixels; - glAPI->GetBooleanv = __indirect_glGetBooleanv; - glAPI->GetClipPlane = __indirect_glGetClipPlane; - glAPI->GetDoublev = __indirect_glGetDoublev; - glAPI->GetError = __indirect_glGetError; - glAPI->GetFloatv = __indirect_glGetFloatv; - glAPI->GetIntegerv = __indirect_glGetIntegerv; - glAPI->GetLightfv = __indirect_glGetLightfv; - glAPI->GetLightiv = __indirect_glGetLightiv; - glAPI->GetMapdv = __indirect_glGetMapdv; - glAPI->GetMapfv = __indirect_glGetMapfv; - glAPI->GetMapiv = __indirect_glGetMapiv; - glAPI->GetMaterialfv = __indirect_glGetMaterialfv; - glAPI->GetMaterialiv = __indirect_glGetMaterialiv; - glAPI->GetPixelMapfv = __indirect_glGetPixelMapfv; - glAPI->GetPixelMapuiv = __indirect_glGetPixelMapuiv; - glAPI->GetPixelMapusv = __indirect_glGetPixelMapusv; - glAPI->GetPolygonStipple = __indirect_glGetPolygonStipple; - glAPI->GetString = __indirect_glGetString; - glAPI->GetTexEnvfv = __indirect_glGetTexEnvfv; - glAPI->GetTexEnviv = __indirect_glGetTexEnviv; - glAPI->GetTexGendv = __indirect_glGetTexGendv; - glAPI->GetTexGenfv = __indirect_glGetTexGenfv; - glAPI->GetTexGeniv = __indirect_glGetTexGeniv; - glAPI->GetTexImage = __indirect_glGetTexImage; - glAPI->GetTexParameterfv = __indirect_glGetTexParameterfv; - glAPI->GetTexParameteriv = __indirect_glGetTexParameteriv; - glAPI->GetTexLevelParameterfv = __indirect_glGetTexLevelParameterfv; - glAPI->GetTexLevelParameteriv = __indirect_glGetTexLevelParameteriv; - glAPI->IsEnabled = __indirect_glIsEnabled; - glAPI->IsList = __indirect_glIsList; - glAPI->DepthRange = __indirect_glDepthRange; - glAPI->Frustum = __indirect_glFrustum; - glAPI->LoadIdentity = __indirect_glLoadIdentity; - glAPI->LoadMatrixf = __indirect_glLoadMatrixf; - glAPI->LoadMatrixd = __indirect_glLoadMatrixd; - glAPI->MatrixMode = __indirect_glMatrixMode; - glAPI->MultMatrixf = __indirect_glMultMatrixf; - glAPI->MultMatrixd = __indirect_glMultMatrixd; - glAPI->Ortho = __indirect_glOrtho; - glAPI->PopMatrix = __indirect_glPopMatrix; - glAPI->PushMatrix = __indirect_glPushMatrix; - glAPI->Rotated = __indirect_glRotated; - glAPI->Rotatef = __indirect_glRotatef; - glAPI->Scaled = __indirect_glScaled; - glAPI->Scalef = __indirect_glScalef; - glAPI->Translated = __indirect_glTranslated; - glAPI->Translatef = __indirect_glTranslatef; glAPI->Viewport = __indirect_glViewport; /* 1.1 */ + glAPI->AreTexturesResident = __indirect_glAreTexturesResident; glAPI->ArrayElement = __indirect_glArrayElement; glAPI->BindTexture = __indirect_glBindTexture; glAPI->ColorPointer = __indirect_glColorPointer; + glAPI->CopyTexImage1D = __indirect_glCopyTexImage1D; + glAPI->CopyTexImage2D = __indirect_glCopyTexImage2D; + glAPI->CopyTexSubImage1D = __indirect_glCopyTexSubImage1D; + glAPI->CopyTexSubImage2D = __indirect_glCopyTexSubImage2D; + glAPI->DeleteTextures = __indirect_glDeleteTextures; glAPI->DisableClientState = __indirect_glDisableClientState; glAPI->DrawArrays = __indirect_glDrawArrays; glAPI->DrawElements = __indirect_glDrawElements; glAPI->EdgeFlagPointer = __indirect_glEdgeFlagPointer; glAPI->EnableClientState = __indirect_glEnableClientState; + glAPI->GenTextures = __indirect_glGenTextures; + glAPI->GetPointerv = __indirect_glGetPointerv; glAPI->IndexPointer = __indirect_glIndexPointer; glAPI->Indexub = __indirect_glIndexub; glAPI->Indexubv = __indirect_glIndexubv; glAPI->InterleavedArrays = __indirect_glInterleavedArrays; + glAPI->IsTexture = __indirect_glIsTexture; glAPI->NormalPointer = __indirect_glNormalPointer; glAPI->PolygonOffset = __indirect_glPolygonOffset; - glAPI->TexCoordPointer = __indirect_glTexCoordPointer; - glAPI->VertexPointer = __indirect_glVertexPointer; - glAPI->AreTexturesResident = __indirect_glAreTexturesResident; - glAPI->CopyTexImage1D = __indirect_glCopyTexImage1D; - glAPI->CopyTexImage2D = __indirect_glCopyTexImage2D; - glAPI->CopyTexSubImage1D = __indirect_glCopyTexSubImage1D; - glAPI->CopyTexSubImage2D = __indirect_glCopyTexSubImage2D; - glAPI->DeleteTextures = __indirect_glDeleteTextures; - glAPI->GenTextures = __indirect_glGenTextures; - glAPI->GetPointerv = __indirect_glGetPointerv; - glAPI->IsTexture = __indirect_glIsTexture; + glAPI->PopClientAttrib = __indirect_glPopClientAttrib; glAPI->PrioritizeTextures = __indirect_glPrioritizeTextures; + glAPI->PushClientAttrib = __indirect_glPushClientAttrib; + glAPI->TexCoordPointer = __indirect_glTexCoordPointer; glAPI->TexSubImage1D = __indirect_glTexSubImage1D; glAPI->TexSubImage2D = __indirect_glTexSubImage2D; - glAPI->PopClientAttrib = __indirect_glPopClientAttrib; - glAPI->PushClientAttrib = __indirect_glPushClientAttrib; + glAPI->VertexPointer = __indirect_glVertexPointer; /* 1.2 */ glAPI->BlendColor = __indirect_glBlendColor; glAPI->BlendEquation = __indirect_glBlendEquation; - glAPI->DrawRangeElements = __indirect_glDrawRangeElements; + glAPI->ColorSubTable = __indirect_glColorSubTable; glAPI->ColorTable = __indirect_glColorTable; glAPI->ColorTableParameterfv = __indirect_glColorTableParameterfv; glAPI->ColorTableParameteriv = __indirect_glColorTableParameteriv; - glAPI->CopyColorTable = __indirect_glCopyColorTable; - glAPI->GetColorTable = __indirect_glGetColorTable; - glAPI->GetColorTableParameterfv = __indirect_glGetColorTableParameterfv; - glAPI->GetColorTableParameteriv = __indirect_glGetColorTableParameteriv; - glAPI->ColorSubTable = __indirect_glColorSubTable; - glAPI->CopyColorSubTable = __indirect_glCopyColorSubTable; glAPI->ConvolutionFilter1D = __indirect_glConvolutionFilter1D; glAPI->ConvolutionFilter2D = __indirect_glConvolutionFilter2D; glAPI->ConvolutionParameterf = __indirect_glConvolutionParameterf; glAPI->ConvolutionParameterfv = __indirect_glConvolutionParameterfv; glAPI->ConvolutionParameteri = __indirect_glConvolutionParameteri; glAPI->ConvolutionParameteriv = __indirect_glConvolutionParameteriv; + glAPI->CopyColorSubTable = __indirect_glCopyColorSubTable; + glAPI->CopyColorTable = __indirect_glCopyColorTable; glAPI->CopyConvolutionFilter1D = __indirect_glCopyConvolutionFilter1D; glAPI->CopyConvolutionFilter2D = __indirect_glCopyConvolutionFilter2D; + glAPI->CopyTexSubImage3D = __indirect_glCopyTexSubImage3D; + glAPI->DrawRangeElements = __indirect_glDrawRangeElements; + glAPI->GetColorTable = __indirect_glGetColorTable; + glAPI->GetColorTableParameterfv = __indirect_glGetColorTableParameterfv; + glAPI->GetColorTableParameteriv = __indirect_glGetColorTableParameteriv; glAPI->GetConvolutionFilter = __indirect_glGetConvolutionFilter; glAPI->GetConvolutionParameterfv = __indirect_glGetConvolutionParameterfv; glAPI->GetConvolutionParameteriv = __indirect_glGetConvolutionParameteriv; - glAPI->GetSeparableFilter = __indirect_glGetSeparableFilter; - glAPI->SeparableFilter2D = __indirect_glSeparableFilter2D; glAPI->GetHistogram = __indirect_glGetHistogram; glAPI->GetHistogramParameterfv = __indirect_glGetHistogramParameterfv; glAPI->GetHistogramParameteriv = __indirect_glGetHistogramParameteriv; glAPI->GetMinmax = __indirect_glGetMinmax; glAPI->GetMinmaxParameterfv = __indirect_glGetMinmaxParameterfv; glAPI->GetMinmaxParameteriv = __indirect_glGetMinmaxParameteriv; + glAPI->GetSeparableFilter = __indirect_glGetSeparableFilter; glAPI->Histogram = __indirect_glHistogram; glAPI->Minmax = __indirect_glMinmax; glAPI->ResetHistogram = __indirect_glResetHistogram; glAPI->ResetMinmax = __indirect_glResetMinmax; + glAPI->SeparableFilter2D = __indirect_glSeparableFilter2D; glAPI->TexImage3D = __indirect_glTexImage3D; glAPI->TexSubImage3D = __indirect_glTexSubImage3D; - glAPI->CopyTexSubImage3D = __indirect_glCopyTexSubImage3D; /* 1. GL_ARB_multitexture */ + glAPI->ActiveTextureARB = __indirect_glActiveTextureARB; + glAPI->ClientActiveTextureARB = __indirect_glClientActiveTextureARB; + glAPI->MultiTexCoord1dARB = __indirect_glMultiTexCoord1dARB; + glAPI->MultiTexCoord1dvARB = __indirect_glMultiTexCoord1dvARB; + glAPI->MultiTexCoord1fARB = __indirect_glMultiTexCoord1fARB; + glAPI->MultiTexCoord1fvARB = __indirect_glMultiTexCoord1fvARB; + glAPI->MultiTexCoord1iARB = __indirect_glMultiTexCoord1iARB; + glAPI->MultiTexCoord1ivARB = __indirect_glMultiTexCoord1ivARB; + glAPI->MultiTexCoord1sARB = __indirect_glMultiTexCoord1sARB; + glAPI->MultiTexCoord1svARB = __indirect_glMultiTexCoord1svARB; glAPI->MultiTexCoord2dARB = __indirect_glMultiTexCoord2dARB; glAPI->MultiTexCoord2dvARB = __indirect_glMultiTexCoord2dvARB; glAPI->MultiTexCoord2fARB = __indirect_glMultiTexCoord2fARB; @@ -481,16 +491,6 @@ __GLapi * __glXNewIndirectAPI( void ) glAPI->MultiTexCoord4ivARB = __indirect_glMultiTexCoord4ivARB; glAPI->MultiTexCoord4sARB = __indirect_glMultiTexCoord4sARB; glAPI->MultiTexCoord4svARB = __indirect_glMultiTexCoord4svARB; - glAPI->ActiveTextureARB = __indirect_glActiveTextureARB; - glAPI->ClientActiveTextureARB = __indirect_glClientActiveTextureARB; - glAPI->MultiTexCoord1dARB = __indirect_glMultiTexCoord1dARB; - glAPI->MultiTexCoord1dvARB = __indirect_glMultiTexCoord1dvARB; - glAPI->MultiTexCoord1fARB = __indirect_glMultiTexCoord1fARB; - glAPI->MultiTexCoord1fvARB = __indirect_glMultiTexCoord1fvARB; - glAPI->MultiTexCoord1iARB = __indirect_glMultiTexCoord1iARB; - glAPI->MultiTexCoord1ivARB = __indirect_glMultiTexCoord1ivARB; - glAPI->MultiTexCoord1sARB = __indirect_glMultiTexCoord1sARB; - glAPI->MultiTexCoord1svARB = __indirect_glMultiTexCoord1svARB; /* 3. GL_ARB_transpose_matrix */ @@ -588,18 +588,6 @@ __GLapi * __glXNewIndirectAPI( void ) glAPI->DrawBuffersARB = __indirect_glDrawBuffersARB; - /* 14. GL_SGI_color_table */ - - glAPI->GetColorTableParameterfvSGI = __indirect_glGetColorTableParameterfvSGI; - glAPI->GetColorTableParameterivSGI = __indirect_glGetColorTableParameterivSGI; - glAPI->GetColorTableSGI = __indirect_glGetColorTableSGI; - - /* 20. GL_EXT_texture_object */ - - glAPI->AreTexturesResidentEXT = __indirect_glAreTexturesResidentEXT; - glAPI->GenTexturesEXT = __indirect_glGenTexturesEXT; - glAPI->IsTextureEXT = __indirect_glIsTextureEXT; - /* 25. GL_SGIS_multisample */ glAPI->SampleMaskSGIS = __indirect_glSampleMaskSGIS; @@ -646,11 +634,11 @@ __GLapi * __glXNewIndirectAPI( void ) /* 149. GL_EXT_fog_coord */ + glAPI->FogCoordPointerEXT = __indirect_glFogCoordPointerEXT; + glAPI->FogCoorddEXT = __indirect_glFogCoorddEXT; glAPI->FogCoorddvEXT = __indirect_glFogCoorddvEXT; glAPI->FogCoordfEXT = __indirect_glFogCoordfEXT; glAPI->FogCoordfvEXT = __indirect_glFogCoordfvEXT; - glAPI->FogCoordPointerEXT = __indirect_glFogCoordPointerEXT; - glAPI->FogCoorddEXT = __indirect_glFogCoorddEXT; /* 173. GL_EXT_blend_func_separate */ diff --git a/src/glx/x11/indirect_size.c b/src/glx/x11/indirect_size.c index 79d57d55b68..12214d7fe40 100644 --- a/src/glx/x11/indirect_size.c +++ b/src/glx/x11/indirect_size.c @@ -64,307 +64,319 @@ INTERNAL PURE FASTCALL GLint -__glCallLists_size( GLenum e ) +__glCallLists_size(GLenum e) { - switch( e ) { - case GL_BYTE: - case GL_UNSIGNED_BYTE: - return 1; - case GL_SHORT: - case GL_UNSIGNED_SHORT: - case GL_2_BYTES: - return 2; - case GL_3_BYTES: - return 3; - case GL_INT: - case GL_UNSIGNED_INT: - case GL_FLOAT: - case GL_4_BYTES: - return 4; - default: return 0; + switch (e) { + case GL_BYTE: + case GL_UNSIGNED_BYTE: + return 1; + case GL_SHORT: + case GL_UNSIGNED_SHORT: + case GL_2_BYTES: + return 2; + case GL_3_BYTES: + return 3; + case GL_INT: + case GL_UNSIGNED_INT: + case GL_FLOAT: + case GL_4_BYTES: + return 4; + default: + return 0; } } INTERNAL PURE FASTCALL GLint -__glFogfv_size( GLenum e ) +__glFogfv_size(GLenum e) { - switch( e ) { - case GL_FOG_INDEX: - case GL_FOG_DENSITY: - case GL_FOG_START: - case GL_FOG_END: - case GL_FOG_MODE: - case GL_FOG_OFFSET_VALUE_SGIX: - case GL_FOG_DISTANCE_MODE_NV: - return 1; - case GL_FOG_COLOR: - return 4; - default: return 0; + switch (e) { + case GL_FOG_INDEX: + case GL_FOG_DENSITY: + case GL_FOG_START: + case GL_FOG_END: + case GL_FOG_MODE: + case GL_FOG_OFFSET_VALUE_SGIX: + case GL_FOG_DISTANCE_MODE_NV: + return 1; + case GL_FOG_COLOR: + return 4; + default: + return 0; } } INTERNAL PURE FASTCALL GLint -__glLightfv_size( GLenum e ) +__glLightfv_size(GLenum e) { - switch( e ) { - case GL_SPOT_EXPONENT: - case GL_SPOT_CUTOFF: - case GL_CONSTANT_ATTENUATION: - case GL_LINEAR_ATTENUATION: - case GL_QUADRATIC_ATTENUATION: - return 1; - case GL_SPOT_DIRECTION: - return 3; - case GL_AMBIENT: - case GL_DIFFUSE: - case GL_SPECULAR: - case GL_POSITION: - return 4; - default: return 0; + switch (e) { + case GL_SPOT_EXPONENT: + case GL_SPOT_CUTOFF: + case GL_CONSTANT_ATTENUATION: + case GL_LINEAR_ATTENUATION: + case GL_QUADRATIC_ATTENUATION: + return 1; + case GL_SPOT_DIRECTION: + return 3; + case GL_AMBIENT: + case GL_DIFFUSE: + case GL_SPECULAR: + case GL_POSITION: + return 4; + default: + return 0; } } INTERNAL PURE FASTCALL GLint -__glLightModelfv_size( GLenum e ) +__glLightModelfv_size(GLenum e) { - switch( e ) { - case GL_LIGHT_MODEL_LOCAL_VIEWER: - case GL_LIGHT_MODEL_TWO_SIDE: - case GL_LIGHT_MODEL_COLOR_CONTROL: + switch (e) { + case GL_LIGHT_MODEL_LOCAL_VIEWER: + case GL_LIGHT_MODEL_TWO_SIDE: + case GL_LIGHT_MODEL_COLOR_CONTROL: /* case GL_LIGHT_MODEL_COLOR_CONTROL_EXT:*/ - return 1; - case GL_LIGHT_MODEL_AMBIENT: - return 4; - default: return 0; + return 1; + case GL_LIGHT_MODEL_AMBIENT: + return 4; + default: + return 0; } } INTERNAL PURE FASTCALL GLint -__glMaterialfv_size( GLenum e ) +__glMaterialfv_size(GLenum e) { - switch( e ) { - case GL_SHININESS: - return 1; - case GL_COLOR_INDEXES: - return 3; - case GL_AMBIENT: - case GL_DIFFUSE: - case GL_SPECULAR: - case GL_EMISSION: - case GL_AMBIENT_AND_DIFFUSE: - return 4; - default: return 0; + switch (e) { + case GL_SHININESS: + return 1; + case GL_COLOR_INDEXES: + return 3; + case GL_AMBIENT: + case GL_DIFFUSE: + case GL_SPECULAR: + case GL_EMISSION: + case GL_AMBIENT_AND_DIFFUSE: + return 4; + default: + return 0; } } INTERNAL PURE FASTCALL GLint -__glTexParameterfv_size( GLenum e ) +__glTexParameterfv_size(GLenum e) { - switch( e ) { - case GL_TEXTURE_MAG_FILTER: - case GL_TEXTURE_MIN_FILTER: - case GL_TEXTURE_WRAP_S: - case GL_TEXTURE_WRAP_T: - case GL_TEXTURE_PRIORITY: - case GL_TEXTURE_WRAP_R: - case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB: + switch (e) { + case GL_TEXTURE_MAG_FILTER: + case GL_TEXTURE_MIN_FILTER: + case GL_TEXTURE_WRAP_S: + case GL_TEXTURE_WRAP_T: + case GL_TEXTURE_PRIORITY: + case GL_TEXTURE_WRAP_R: + case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB: /* case GL_SHADOW_AMBIENT_SGIX:*/ - case GL_TEXTURE_MIN_LOD: - case GL_TEXTURE_MAX_LOD: - case GL_TEXTURE_BASE_LEVEL: - case GL_TEXTURE_MAX_LEVEL: - case GL_TEXTURE_CLIPMAP_FRAME_SGIX: - case GL_TEXTURE_LOD_BIAS_S_SGIX: - case GL_TEXTURE_LOD_BIAS_T_SGIX: - case GL_TEXTURE_LOD_BIAS_R_SGIX: - case GL_GENERATE_MIPMAP: + case GL_TEXTURE_MIN_LOD: + case GL_TEXTURE_MAX_LOD: + case GL_TEXTURE_BASE_LEVEL: + case GL_TEXTURE_MAX_LEVEL: + case GL_TEXTURE_CLIPMAP_FRAME_SGIX: + case GL_TEXTURE_LOD_BIAS_S_SGIX: + case GL_TEXTURE_LOD_BIAS_T_SGIX: + case GL_TEXTURE_LOD_BIAS_R_SGIX: + case GL_GENERATE_MIPMAP: /* case GL_GENERATE_MIPMAP_SGIS:*/ - case GL_TEXTURE_COMPARE_SGIX: - case GL_TEXTURE_COMPARE_OPERATOR_SGIX: - case GL_TEXTURE_MAX_CLAMP_S_SGIX: - case GL_TEXTURE_MAX_CLAMP_T_SGIX: - case GL_TEXTURE_MAX_CLAMP_R_SGIX: - case GL_TEXTURE_MAX_ANISOTROPY_EXT: - case GL_TEXTURE_LOD_BIAS: + case GL_TEXTURE_COMPARE_SGIX: + case GL_TEXTURE_COMPARE_OPERATOR_SGIX: + case GL_TEXTURE_MAX_CLAMP_S_SGIX: + case GL_TEXTURE_MAX_CLAMP_T_SGIX: + case GL_TEXTURE_MAX_CLAMP_R_SGIX: + case GL_TEXTURE_MAX_ANISOTROPY_EXT: + case GL_TEXTURE_LOD_BIAS: /* case GL_TEXTURE_LOD_BIAS_EXT:*/ - case GL_DEPTH_TEXTURE_MODE: + case GL_DEPTH_TEXTURE_MODE: /* case GL_DEPTH_TEXTURE_MODE_ARB:*/ - case GL_TEXTURE_COMPARE_MODE: + case GL_TEXTURE_COMPARE_MODE: /* case GL_TEXTURE_COMPARE_MODE_ARB:*/ - case GL_TEXTURE_COMPARE_FUNC: + case GL_TEXTURE_COMPARE_FUNC: /* case GL_TEXTURE_COMPARE_FUNC_ARB:*/ - case GL_TEXTURE_UNSIGNED_REMAP_MODE_NV: - return 1; - case GL_TEXTURE_CLIPMAP_CENTER_SGIX: - case GL_TEXTURE_CLIPMAP_OFFSET_SGIX: - return 2; - case GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX: - return 3; - case GL_TEXTURE_BORDER_COLOR: - case GL_POST_TEXTURE_FILTER_BIAS_SGIX: - case GL_POST_TEXTURE_FILTER_SCALE_SGIX: - return 4; - default: return 0; + case GL_TEXTURE_UNSIGNED_REMAP_MODE_NV: + return 1; + case GL_TEXTURE_CLIPMAP_CENTER_SGIX: + case GL_TEXTURE_CLIPMAP_OFFSET_SGIX: + return 2; + case GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX: + return 3; + case GL_TEXTURE_BORDER_COLOR: + case GL_POST_TEXTURE_FILTER_BIAS_SGIX: + case GL_POST_TEXTURE_FILTER_SCALE_SGIX: + return 4; + default: + return 0; } } INTERNAL PURE FASTCALL GLint -__glTexEnvfv_size( GLenum e ) +__glTexEnvfv_size(GLenum e) { - switch( e ) { - case GL_ALPHA_SCALE: - case GL_TEXTURE_ENV_MODE: - case GL_TEXTURE_LOD_BIAS: - case GL_COMBINE_RGB: - case GL_COMBINE_ALPHA: - case GL_RGB_SCALE: - case GL_SOURCE0_RGB: - case GL_SOURCE1_RGB: - case GL_SOURCE2_RGB: - case GL_SOURCE3_RGB_NV: - case GL_SOURCE0_ALPHA: - case GL_SOURCE1_ALPHA: - case GL_SOURCE2_ALPHA: - case GL_SOURCE3_ALPHA_NV: - case GL_OPERAND0_RGB: - case GL_OPERAND1_RGB: - case GL_OPERAND2_RGB: - case GL_OPERAND3_RGB_NV: - case GL_OPERAND0_ALPHA: - case GL_OPERAND1_ALPHA: - case GL_OPERAND2_ALPHA: - case GL_OPERAND3_ALPHA_NV: - case GL_COORD_REPLACE_ARB: + switch (e) { + case GL_ALPHA_SCALE: + case GL_TEXTURE_ENV_MODE: + case GL_TEXTURE_LOD_BIAS: + case GL_COMBINE_RGB: + case GL_COMBINE_ALPHA: + case GL_RGB_SCALE: + case GL_SOURCE0_RGB: + case GL_SOURCE1_RGB: + case GL_SOURCE2_RGB: + case GL_SOURCE3_RGB_NV: + case GL_SOURCE0_ALPHA: + case GL_SOURCE1_ALPHA: + case GL_SOURCE2_ALPHA: + case GL_SOURCE3_ALPHA_NV: + case GL_OPERAND0_RGB: + case GL_OPERAND1_RGB: + case GL_OPERAND2_RGB: + case GL_OPERAND3_RGB_NV: + case GL_OPERAND0_ALPHA: + case GL_OPERAND1_ALPHA: + case GL_OPERAND2_ALPHA: + case GL_OPERAND3_ALPHA_NV: + case GL_COORD_REPLACE_ARB: /* case GL_COORD_REPLACE_NV:*/ - return 1; - case GL_TEXTURE_ENV_COLOR: - return 4; - default: return 0; + return 1; + case GL_TEXTURE_ENV_COLOR: + return 4; + default: + return 0; } } INTERNAL PURE FASTCALL GLint -__glTexGendv_size( GLenum e ) +__glTexGendv_size(GLenum e) { - switch( e ) { - case GL_TEXTURE_GEN_MODE: - return 1; - case GL_OBJECT_PLANE: - case GL_EYE_PLANE: - return 4; - default: return 0; + switch (e) { + case GL_TEXTURE_GEN_MODE: + return 1; + case GL_OBJECT_PLANE: + case GL_EYE_PLANE: + return 4; + default: + return 0; } } INTERNAL PURE FASTCALL GLint -__glMap1d_size( GLenum e ) +__glMap1d_size(GLenum e) { - switch( e ) { - case GL_MAP1_INDEX: - case GL_MAP1_TEXTURE_COORD_1: - return 1; - case GL_MAP1_TEXTURE_COORD_2: - return 2; - case GL_MAP1_NORMAL: - case GL_MAP1_TEXTURE_COORD_3: - case GL_MAP1_VERTEX_3: - return 3; - case GL_MAP1_COLOR_4: - case GL_MAP1_TEXTURE_COORD_4: - case GL_MAP1_VERTEX_4: - return 4; - default: return 0; + switch (e) { + case GL_MAP1_INDEX: + case GL_MAP1_TEXTURE_COORD_1: + return 1; + case GL_MAP1_TEXTURE_COORD_2: + return 2; + case GL_MAP1_NORMAL: + case GL_MAP1_TEXTURE_COORD_3: + case GL_MAP1_VERTEX_3: + return 3; + case GL_MAP1_COLOR_4: + case GL_MAP1_TEXTURE_COORD_4: + case GL_MAP1_VERTEX_4: + return 4; + default: + return 0; } } INTERNAL PURE FASTCALL GLint -__glMap2d_size( GLenum e ) +__glMap2d_size(GLenum e) { - switch( e ) { - case GL_MAP2_INDEX: - case GL_MAP2_TEXTURE_COORD_1: - return 1; - case GL_MAP2_TEXTURE_COORD_2: - return 2; - case GL_MAP2_NORMAL: - case GL_MAP2_TEXTURE_COORD_3: - case GL_MAP2_VERTEX_3: - return 3; - case GL_MAP2_COLOR_4: - case GL_MAP2_TEXTURE_COORD_4: - case GL_MAP2_VERTEX_4: - return 4; - default: return 0; + switch (e) { + case GL_MAP2_INDEX: + case GL_MAP2_TEXTURE_COORD_1: + return 1; + case GL_MAP2_TEXTURE_COORD_2: + return 2; + case GL_MAP2_NORMAL: + case GL_MAP2_TEXTURE_COORD_3: + case GL_MAP2_VERTEX_3: + return 3; + case GL_MAP2_COLOR_4: + case GL_MAP2_TEXTURE_COORD_4: + case GL_MAP2_VERTEX_4: + return 4; + default: + return 0; } } INTERNAL PURE FASTCALL GLint -__glColorTableParameterfv_size( GLenum e ) +__glColorTableParameterfv_size(GLenum e) { - switch( e ) { - case GL_COLOR_TABLE_SCALE: - case GL_COLOR_TABLE_BIAS: - return 4; - default: return 0; + switch (e) { + case GL_COLOR_TABLE_SCALE: + case GL_COLOR_TABLE_BIAS: + return 4; + default: + return 0; } } INTERNAL PURE FASTCALL GLint -__glConvolutionParameterfv_size( GLenum e ) +__glConvolutionParameterfv_size(GLenum e) { - switch( e ) { - case GL_CONVOLUTION_BORDER_MODE: + switch (e) { + case GL_CONVOLUTION_BORDER_MODE: /* case GL_CONVOLUTION_BORDER_MODE_EXT:*/ - return 1; - case GL_CONVOLUTION_FILTER_SCALE: + return 1; + case GL_CONVOLUTION_FILTER_SCALE: /* case GL_CONVOLUTION_FILTER_SCALE_EXT:*/ - case GL_CONVOLUTION_FILTER_BIAS: + case GL_CONVOLUTION_FILTER_BIAS: /* case GL_CONVOLUTION_FILTER_BIAS_EXT:*/ - case GL_CONVOLUTION_BORDER_COLOR: + case GL_CONVOLUTION_BORDER_COLOR: /* case GL_CONVOLUTION_BORDER_COLOR_HP:*/ - return 4; - default: return 0; + return 4; + default: + return 0; } } INTERNAL PURE FASTCALL GLint -__glPointParameterfvEXT_size( GLenum e ) +__glPointParameterfvEXT_size(GLenum e) { - switch( e ) { - case GL_POINT_SIZE_MIN: + switch (e) { + case GL_POINT_SIZE_MIN: /* case GL_POINT_SIZE_MIN_ARB:*/ /* case GL_POINT_SIZE_MIN_SGIS:*/ - case GL_POINT_SIZE_MAX: + case GL_POINT_SIZE_MAX: /* case GL_POINT_SIZE_MAX_ARB:*/ /* case GL_POINT_SIZE_MAX_SGIS:*/ - case GL_POINT_FADE_THRESHOLD_SIZE: + case GL_POINT_FADE_THRESHOLD_SIZE: /* case GL_POINT_FADE_THRESHOLD_SIZE_ARB:*/ /* case GL_POINT_FADE_THRESHOLD_SIZE_SGIS:*/ - case GL_POINT_SPRITE_R_MODE_NV: - case GL_POINT_SPRITE_COORD_ORIGIN: - return 1; - case GL_POINT_DISTANCE_ATTENUATION: + case GL_POINT_SPRITE_R_MODE_NV: + case GL_POINT_SPRITE_COORD_ORIGIN: + return 1; + case GL_POINT_DISTANCE_ATTENUATION: /* case GL_POINT_DISTANCE_ATTENUATION_ARB:*/ /* case GL_POINT_DISTANCE_ATTENUATION_SGIS:*/ - return 3; - default: return 0; + return 3; + default: + return 0; } } -ALIAS( Fogiv, Fogfv ) -ALIAS( Lightiv, Lightfv ) -ALIAS( LightModeliv, LightModelfv ) -ALIAS( Materialiv, Materialfv ) -ALIAS( TexParameteriv, TexParameterfv ) -ALIAS( TexEnviv, TexEnvfv ) -ALIAS( TexGenfv, TexGendv ) -ALIAS( TexGeniv, TexGendv ) -ALIAS( Map1f, Map1d ) -ALIAS( Map2f, Map2d ) -ALIAS( ColorTableParameteriv, ColorTableParameterfv ) -ALIAS( ConvolutionParameteriv, ConvolutionParameterfv ) -ALIAS( PointParameterivNV, PointParameterfvEXT ) - +ALIAS(Fogiv, Fogfv) + ALIAS(Lightiv, Lightfv) + ALIAS(LightModeliv, LightModelfv) + ALIAS(Materialiv, Materialfv) + ALIAS(TexParameteriv, TexParameterfv) + ALIAS(TexEnviv, TexEnvfv) + ALIAS(TexGenfv, TexGendv) + ALIAS(TexGeniv, TexGendv) + ALIAS(Map1f, Map1d) + ALIAS(Map2f, Map2d) + ALIAS(ColorTableParameteriv, ColorTableParameterfv) + ALIAS(ConvolutionParameteriv, ConvolutionParameterfv) + ALIAS(PointParameterivNV, PointParameterfvEXT) # undef PURE # undef FASTCALL # undef INTERNAL diff --git a/src/glx/x11/indirect_vertex_array.c b/src/glx/x11/indirect_vertex_array.c index 5a5cd6697ea..429b52ae635 100644 --- a/src/glx/x11/indirect_vertex_array.c +++ b/src/glx/x11/indirect_vertex_array.c @@ -123,10 +123,8 @@ __glXInitVertexArrayState( __GLXcontext * gc ) struct array_state_vector * arrays; unsigned array_count; - unsigned texture_units = 1; - unsigned i; - unsigned j; - unsigned vertex_program_attribs = 0; + int texture_units = 1, vertex_program_attribs = 0; + unsigned i, j; GLboolean got_fog = GL_FALSE; GLboolean got_secondary_color = GL_FALSE; diff --git a/src/glx/x11/singlepix.c b/src/glx/x11/singlepix.c index 4a10083b8fe..a7b5b798707 100644 --- a/src/glx/x11/singlepix.c +++ b/src/glx/x11/singlepix.c @@ -36,6 +36,11 @@ #include "packsingle.h" #include "indirect.h" +#include "dispatch.h" +#include "glapi.h" +#include "glthread.h" +#include "glapioffsets.h" +#include void __indirect_glGetSeparableFilter(GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span) @@ -103,3 +108,85 @@ void __indirect_glGetSeparableFilter(GLenum target, GLenum format, GLenum type, __GLX_SINGLE_END(); } + + +#define CONCAT(a,b) a ## b +#define NAME(o) CONCAT(gl_dispatch_stub_, o) + +void NAME(_gloffset_GetSeparableFilter)(GLenum target, GLenum format, GLenum type, + GLvoid *row, GLvoid *column, GLvoid *span) +{ + __GLXcontext * const gc = __glXGetCurrentContext(); + + if (gc->isDirect) { + CALL_GetSeparableFilter(GET_DISPATCH(), + (target, format, type, row, column, span)); + return; + } + else { + Display *const dpy = gc->currentDpy; + const GLuint cmdlen = __GLX_PAD(13); + + if (dpy != NULL) { + const __GLXattribute * const state = gc->client_state_private; + xGLXGetSeparableFilterReply reply; + GLubyte const *pc = + __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, + X_GLvop_GetSeparableFilterEXT, cmdlen); + unsigned compsize; + + + (void) memcpy((void *) (pc + 0), (void *) (&target), 4); + (void) memcpy((void *) (pc + 4), (void *) (&format), 4); + (void) memcpy((void *) (pc + 8), (void *) (&type), 4); + *(int8_t *) (pc + 12) = state->storePack.swapEndian; + + (void) _XReply(dpy, (xReply *) & reply, 0, False); + + compsize = reply.length << 2; + + if (compsize != 0) { + const GLint width = reply.width; + const GLint height = reply.height; + const GLint widthsize = + __glImageSize(width, 1, 1, format, type, 0); + const GLint heightsize = + __glImageSize(height, 1, 1, format, type, 0); + GLubyte * const buf = + (GLubyte*) Xmalloc((widthsize > heightsize) ? widthsize : heightsize); + + if (buf == NULL) { + /* Throw data away */ + _XEatData(dpy, compsize); + __glXSetError(gc, GL_OUT_OF_MEMORY); + + UnlockDisplay(dpy); + SyncHandle(); + return; + } else { + int extra; + + extra = 4 - (widthsize & 3); + _XRead(dpy, (char *)buf, widthsize); + if (extra < 4) { + _XEatData(dpy, extra); + } + + __glEmptyImage(gc, 1, width, 1, 1, format, type, buf, + row); + + extra = 4 - (heightsize & 3); + _XRead(dpy, (char *)buf, heightsize); + if (extra < 4) { + _XEatData(dpy, extra); + } + + __glEmptyImage(gc, 1, height, 1, 1, format, type, buf, + column); + + Xfree((char*) buf); + } + } + } + } +} diff --git a/src/mesa/Makefile b/src/mesa/Makefile index d4645606f7f..3f65ecf5cc9 100644 --- a/src/mesa/Makefile +++ b/src/mesa/Makefile @@ -141,7 +141,7 @@ $(TOP)/$(LIB_DIR)/$(OSMESA_LIB_NAME): $(OSMESA_DRIVER_OBJECTS) $(OSMESA16_OBJECT depend: $(ALL_SOURCES) @ echo "running $(MKDEP)" @ touch depend - $(MKDEP) $(MKDEP_OPTIONS) $(DEFINES) $(INCLUDE_DIRS) $(ALL_SOURCES) \ + @$(MKDEP) $(MKDEP_OPTIONS) $(DEFINES) $(INCLUDE_DIRS) $(ALL_SOURCES) \ > /dev/null @@ -154,14 +154,19 @@ install: default $(INSTALL) -d $(INSTALL_DIR)/include/GL $(INSTALL) -d $(INSTALL_DIR)/$(LIB_DIR) $(INSTALL) -m 644 $(TOP)/include/GL/*.h $(INSTALL_DIR)/include/GL - $(COPY_LIBS) $(TOP)/$(LIB_DIR)/libGL.* $(INSTALL_DIR)/$(LIB_DIR) + @if [ -e $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) ]; then \ + $(INSTALL) $(TOP)/$(LIB_DIR)/libGL* $(INSTALL_DIR)/$(LIB_DIR); \ + fi + @if [ -e $(TOP)/$(LIB_DIR)/$(OSMESA_LIB_NAME) ]; then \ + $(INSTALL) $(TOP)/$(LIB_DIR)/libOSMesa* $(INSTALL_DIR)/$(LIB_DIR); \ + fi @if [ "${DRIVER_DIRS}" = "dri" ] ; then \ cd drivers/dri ; $(MAKE) install ; \ fi - ## NOT YET: - ## $(INSTALL) -d $(INSTALL_DIR)/include/GLES - ## $(INSTALL) -m 644 include/GLES/*.h $(INSTALL_DIR)/include/GLES +## NOT INSTALLED YET: +## $(INSTALL) -d $(INSTALL_DIR)/include/GLES +## $(INSTALL) -m 644 include/GLES/*.h $(INSTALL_DIR)/include/GLES # Emacs tags diff --git a/src/mesa/drivers/common/driverfuncs.c b/src/mesa/drivers/common/driverfuncs.c index 3ccbe54817a..1e44904b930 100644 --- a/src/mesa/drivers/common/driverfuncs.c +++ b/src/mesa/drivers/common/driverfuncs.c @@ -126,6 +126,9 @@ _mesa_init_driver_functions(struct dd_function_table *driver) driver->BindProgram = NULL; driver->NewProgram = _mesa_new_program; driver->DeleteProgram = _mesa_delete_program; +#if FEATURE_MESA_program_debug + driver->GetFragmentProgramRegister = _swrast_get_program_register; +#endif /* FEATURE_MESA_program_debug */ /* simple state commands */ driver->AlphaFunc = NULL; diff --git a/src/mesa/drivers/directfb/idirectfbgl_mesa.c b/src/mesa/drivers/directfb/idirectfbgl_mesa.c index d11241b2b21..323cdd67913 100644 --- a/src/mesa/drivers/directfb/idirectfbgl_mesa.c +++ b/src/mesa/drivers/directfb/idirectfbgl_mesa.c @@ -214,7 +214,8 @@ IDirectFBGL_Mesa_Lock( IDirectFBGL *thiz ) if (data->width != width || data->height != height) { data->width = width; data->height = height; - _mesa_ResizeBuffersMESA(); + _mesa_resize_framebuffer(&data->context, + &data->framebuffer, width, height); } data->locked = DFB_TRUE; @@ -355,17 +356,30 @@ dfbGetBufferSize( GLframebuffer *buffer, GLuint *width, GLuint *height ) *height = (GLuint) data->height; } +/** + * We only implement this function as a mechanism to check if the + * framebuffer size has changed (and update corresponding state). + */ static void dfbSetViewport( GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h ) { - _mesa_ResizeBuffersMESA(); + GLuint newWidth, newHeight; + GLframebuffer *buffer = ctx->WinSysDrawBuffer; + dfbGetBufferSize( buffer, &newWidth, &newHeight ); + if (buffer->Width != newWidth || buffer->Height != newHeight) { + _mesa_resize_framebuffer(ctx, buffer, newWidth, newHeight ); + } } static void -dfbClear( GLcontext *ctx, GLbitfield mask, GLboolean all, - GLint x, GLint y, GLint width, GLint height ) +dfbClear( GLcontext *ctx, GLbitfield mask ) { IDirectFBGL_data *data = (IDirectFBGL_data*) ctx->DriverCtx; + int x = ctx->DrawBuffer->_Xmin; + int y = ctx->DrawBuffer->_Ymin; + int width = ctx->DrawBuffer->_Xmax - x; + int height = ctx->DrawBuffer->_Ymax - y; + GLboolean all = (width == ctx->DrawBuffer->Width && height == ctx->DrawBuffer->height) if (mask & BUFFER_BIT_FRONT_LEFT && ctx->Color.ColorMask[0] && @@ -410,7 +424,7 @@ dfbClear( GLcontext *ctx, GLbitfield mask, GLboolean all, } if (mask) - _swrast_Clear( ctx, mask, all, x, y, width, height ); + _swrast_Clear( ctx, mask ); } diff --git a/src/mesa/drivers/dri/Makefile.template b/src/mesa/drivers/dri/Makefile.template index 58912730fdd..5261a4b55d1 100644 --- a/src/mesa/drivers/dri/Makefile.template +++ b/src/mesa/drivers/dri/Makefile.template @@ -9,7 +9,12 @@ COMMON_SOURCES = \ ../common/vblank.c \ ../common/dri_util.c \ ../common/xmlconfig.c \ - ../common/drirenderbuffer.c + ../common/drirenderbuffer.c + +COMMON_BM_SOURCES = \ + ../common/dri_bufmgr.c \ + ../common/dri_drmpool.c + ifeq ($(WINDOW_SYSTEM),dri) WINOBJ= @@ -85,7 +90,7 @@ $(TOP)/$(LIB_DIR)/$(LIBNAME): $(LIBNAME) depend: $(C_SOURCES) $(ASM_SOURCES) $(SYMLINKS) touch depend $(MKDEP) $(MKDEP_OPTIONS) $(DRIVER_DEFINES) $(INCLUDES) $(C_SOURCES) \ - $(ASM_SOURCES) > /dev/null + $(ASM_SOURCES) 2>&1 /dev/null # Emacs tags diff --git a/src/mesa/drivers/dri/common/dri_bufmgr.c b/src/mesa/drivers/dri/common/dri_bufmgr.c new file mode 100644 index 00000000000..370b56c3a36 --- /dev/null +++ b/src/mesa/drivers/dri/common/dri_bufmgr.c @@ -0,0 +1,493 @@ +/************************************************************************** + * + * Copyright 2006 Tungsten Graphics, Inc., Bismarck, ND., USA + * 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. + * + * + **************************************************************************/ +/* + * Authors: Thomas Hellström + * Keith Whitwell + */ + +#include +#include +#include "glthread.h" +#include "errno.h" +#include "dri_bufmgr.h" +#include "string.h" +#include "imports.h" +#include "dri_bufpool.h" + +_glthread_DECLARE_STATIC_MUTEX(bmMutex); + +/* + * TODO: Introduce fence pools in the same way as + * buffer object pools. + */ + + + +typedef struct _DriFenceObject +{ + int fd; + _glthread_Mutex mutex; + int refCount; + const char *name; + drmFence fence; +} DriFenceObject; + +typedef struct _DriBufferObject +{ + DriBufferPool *pool; + _glthread_Mutex mutex; + int refCount; + const char *name; + unsigned flags; + unsigned hint; + unsigned alignment; + void *private; +} DriBufferObject; + + +void +bmError(int val, const char *file, const char *function, int line) +{ + _mesa_printf("Fatal video memory manager error \"%s\".\n" + "Check kernel logs or set the LIBGL_DEBUG\n" + "environment variable to \"verbose\" for more info.\n" + "Detected in file %s, line %d, function %s.\n", + strerror(-val), file, line, function); +#ifndef NDEBUG + abort(); +#else + abort(); +#endif +} + +DriFenceObject * +driFenceBuffers(int fd, char *name, unsigned flags) +{ + DriFenceObject *fence = (DriFenceObject *) malloc(sizeof(*fence)); + int ret; + + if (!fence) + BM_CKFATAL(-EINVAL); + + _glthread_LOCK_MUTEX(bmMutex); + fence->refCount = 1; + fence->name = name; + fence->fd = fd; + _glthread_INIT_MUTEX(fence->mutex); + ret = drmFenceBuffers(fd, flags, &fence->fence); + _glthread_UNLOCK_MUTEX(bmMutex); + if (ret) { + free(fence); + BM_CKFATAL(ret); + } + return fence; +} + + +unsigned +driFenceType(DriFenceObject * fence) +{ + unsigned ret; + + _glthread_LOCK_MUTEX(bmMutex); + ret = fence->fence.flags; + _glthread_UNLOCK_MUTEX(bmMutex); + + return ret; +} + + +DriFenceObject * +driFenceReference(DriFenceObject * fence) +{ + _glthread_LOCK_MUTEX(bmMutex); + ++fence->refCount; + _glthread_UNLOCK_MUTEX(bmMutex); + return fence; +} + +void +driFenceUnReference(DriFenceObject * fence) +{ + if (!fence) + return; + + _glthread_LOCK_MUTEX(bmMutex); + if (--fence->refCount == 0) { + drmFenceDestroy(fence->fd, &fence->fence); + free(fence); + } + _glthread_UNLOCK_MUTEX(bmMutex); +} + +void +driFenceFinish(DriFenceObject * fence, unsigned type, int lazy) +{ + int ret; + unsigned flags = (lazy) ? DRM_FENCE_FLAG_WAIT_LAZY : 0; + + _glthread_LOCK_MUTEX(fence->mutex); + ret = drmFenceWait(fence->fd, flags, &fence->fence, type); + _glthread_UNLOCK_MUTEX(fence->mutex); + BM_CKFATAL(ret); +} + +int +driFenceSignaled(DriFenceObject * fence, unsigned type) +{ + int signaled; + int ret; + + if (fence == NULL) + return GL_TRUE; + + _glthread_LOCK_MUTEX(fence->mutex); + ret = drmFenceSignaled(fence->fd, &fence->fence, type, &signaled); + _glthread_UNLOCK_MUTEX(fence->mutex); + BM_CKFATAL(ret); + return signaled; +} + + +extern drmBO * +driBOKernel(struct _DriBufferObject *buf) +{ + drmBO *ret; + + assert(buf->private != NULL); + ret = buf->pool->kernel(buf->pool, buf->private); + if (!ret) + BM_CKFATAL(-EINVAL); + + return ret; +} + +void +driBOWaitIdle(struct _DriBufferObject *buf, int lazy) +{ + assert(buf->private != NULL); + + _glthread_LOCK_MUTEX(buf->mutex); + BM_CKFATAL(buf->pool->waitIdle(buf->pool, buf->private, lazy)); + _glthread_UNLOCK_MUTEX(buf->mutex); +} + +void * +driBOMap(struct _DriBufferObject *buf, unsigned flags, unsigned hint) +{ + void *virtual; + + assert(buf->private != NULL); + + _glthread_LOCK_MUTEX(buf->mutex); + BM_CKFATAL(buf->pool->map(buf->pool, buf->private, flags, hint, &virtual)); + _glthread_UNLOCK_MUTEX(buf->mutex); + return virtual; +} + +void +driBOUnmap(struct _DriBufferObject *buf) +{ + assert(buf->private != NULL); + + buf->pool->unmap(buf->pool, buf->private); +} + +unsigned long +driBOOffset(struct _DriBufferObject *buf) +{ + unsigned long ret; + + assert(buf->private != NULL); + + _glthread_LOCK_MUTEX(buf->mutex); + ret = buf->pool->offset(buf->pool, buf->private); + _glthread_UNLOCK_MUTEX(buf->mutex); + return ret; +} + +unsigned +driBOFlags(struct _DriBufferObject *buf) +{ + unsigned ret; + + assert(buf->private != NULL); + + _glthread_LOCK_MUTEX(buf->mutex); + ret = buf->pool->flags(buf->pool, buf->private); + _glthread_UNLOCK_MUTEX(buf->mutex); + return ret; +} + +struct _DriBufferObject * +driBOReference(struct _DriBufferObject *buf) +{ + _glthread_LOCK_MUTEX(bmMutex); + if (++buf->refCount == 1) { + BM_CKFATAL(-EINVAL); + } + _glthread_UNLOCK_MUTEX(bmMutex); + return buf; +} + +void +driBOUnReference(struct _DriBufferObject *buf) +{ + int tmp; + + if (!buf) + return; + + _glthread_LOCK_MUTEX(bmMutex); + tmp = --buf->refCount; + _glthread_UNLOCK_MUTEX(bmMutex); + if (!tmp) { + buf->pool->destroy(buf->pool, buf->private); + free(buf); + } +} + +void +driBOData(struct _DriBufferObject *buf, + unsigned size, const void *data, unsigned flags) +{ + void *virtual; + int newBuffer; + struct _DriBufferPool *pool; + + _glthread_LOCK_MUTEX(buf->mutex); + pool = buf->pool; + if (!pool->create) { + _mesa_error(NULL, GL_INVALID_OPERATION, + "driBOData called on invalid buffer\n"); + BM_CKFATAL(-EINVAL); + } + newBuffer = !buf->private || (pool->size(pool, buf->private) < size) || + pool->map(pool, buf->private, DRM_BO_FLAG_WRITE, + DRM_BO_HINT_DONT_BLOCK, &virtual); + + if (newBuffer) { + if (buf->private) + pool->destroy(pool, buf->private); + if (!flags) + flags = buf->flags; + buf->private = pool->create(pool, size, flags, 0, buf->alignment); + if (!buf->private) + BM_CKFATAL(-ENOMEM); + BM_CKFATAL(pool->map(pool, buf->private, + DRM_BO_FLAG_WRITE, + DRM_BO_HINT_DONT_BLOCK, &virtual)); + } + + if (data != NULL) + memcpy(virtual, data, size); + + BM_CKFATAL(pool->unmap(pool, buf->private)); + _glthread_UNLOCK_MUTEX(buf->mutex); +} + +void +driBOSubData(struct _DriBufferObject *buf, + unsigned long offset, unsigned long size, const void *data) +{ + void *virtual; + + _glthread_LOCK_MUTEX(buf->mutex); + if (size && data) { + BM_CKFATAL(buf->pool->map(buf->pool, buf->private, + DRM_BO_FLAG_WRITE, 0, &virtual)); + memcpy((unsigned char *) virtual + offset, data, size); + BM_CKFATAL(buf->pool->unmap(buf->pool, buf->private)); + } + _glthread_UNLOCK_MUTEX(buf->mutex); +} + +void +driBOGetSubData(struct _DriBufferObject *buf, + unsigned long offset, unsigned long size, void *data) +{ + void *virtual; + + _glthread_LOCK_MUTEX(buf->mutex); + if (size && data) { + BM_CKFATAL(buf->pool->map(buf->pool, buf->private, + DRM_BO_FLAG_READ, 0, &virtual)); + memcpy(data, (unsigned char *) virtual + offset, size); + BM_CKFATAL(buf->pool->unmap(buf->pool, buf->private)); + } + _glthread_UNLOCK_MUTEX(buf->mutex); +} + +void +driBOSetStatic(struct _DriBufferObject *buf, + unsigned long offset, + unsigned long size, void *virtual, unsigned flags) +{ + _glthread_LOCK_MUTEX(buf->mutex); + if (buf->private != NULL) { + _mesa_error(NULL, GL_INVALID_OPERATION, + "Invalid buffer for setStatic\n"); + BM_CKFATAL(-EINVAL); + } + if (buf->pool->setstatic == NULL) { + _mesa_error(NULL, GL_INVALID_OPERATION, + "Invalid buffer pool for setStatic\n"); + BM_CKFATAL(-EINVAL); + } + + if (!flags) + flags = buf->flags; + + buf->private = buf->pool->setstatic(buf->pool, offset, size, + virtual, flags); + if (!buf->private) { + _mesa_error(NULL, GL_OUT_OF_MEMORY, + "Invalid buffer pool for setStatic\n"); + BM_CKFATAL(-ENOMEM); + } + _glthread_UNLOCK_MUTEX(buf->mutex); +} + + + +void +driGenBuffers(struct _DriBufferPool *pool, + const char *name, + unsigned n, + struct _DriBufferObject *buffers[], + unsigned alignment, unsigned flags, unsigned hint) +{ + struct _DriBufferObject *buf; + int i; + + flags = (flags) ? flags : DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_MEM_VRAM | + DRM_BO_FLAG_MEM_LOCAL | DRM_BO_FLAG_READ | DRM_BO_FLAG_WRITE; + + + for (i = 0; i < n; ++i) { + buf = (struct _DriBufferObject *) calloc(1, sizeof(*buf)); + if (!buf) + BM_CKFATAL(-ENOMEM); + + _glthread_INIT_MUTEX(buf->mutex); + _glthread_LOCK_MUTEX(buf->mutex); + _glthread_LOCK_MUTEX(bmMutex); + buf->refCount = 1; + _glthread_UNLOCK_MUTEX(bmMutex); + buf->flags = flags; + buf->hint = hint; + buf->name = name; + buf->alignment = alignment; + buf->pool = pool; + _glthread_UNLOCK_MUTEX(buf->mutex); + buffers[i] = buf; + } +} + +void +driDeleteBuffers(unsigned n, struct _DriBufferObject *buffers[]) +{ + int i; + + for (i = 0; i < n; ++i) { + driBOUnReference(buffers[i]); + } +} + + +void +driInitBufMgr(int fd) +{ + ; +} + + +void +driBOCreateList(int target, drmBOList * list) +{ + _glthread_LOCK_MUTEX(bmMutex); + BM_CKFATAL(drmBOCreateList(20, list)); + _glthread_UNLOCK_MUTEX(bmMutex); +} + +void +driBOResetList(drmBOList * list) +{ + _glthread_LOCK_MUTEX(bmMutex); + BM_CKFATAL(drmBOResetList(list)); + _glthread_UNLOCK_MUTEX(bmMutex); +} + +void +driBOAddListItem(drmBOList * list, struct _DriBufferObject *buf, + unsigned flags, unsigned mask) +{ + int newItem; + + _glthread_LOCK_MUTEX(buf->mutex); + _glthread_LOCK_MUTEX(bmMutex); + BM_CKFATAL(drmAddValidateItem(list, driBOKernel(buf), + flags, mask, &newItem)); + _glthread_UNLOCK_MUTEX(bmMutex); + + /* + * Tell userspace pools to validate the buffer. This should be a + * noop if the pool is already validated. + * FIXME: We should have a list for this as well. + */ + + if (buf->pool->validate) { + BM_CKFATAL(buf->pool->validate(buf->pool, buf->private)); + } + + _glthread_UNLOCK_MUTEX(buf->mutex); +} + +void +driBOFence(struct _DriBufferObject *buf, struct _DriFenceObject *fence) +{ + _glthread_LOCK_MUTEX(buf->mutex); + BM_CKFATAL(buf->pool->fence(buf->pool, buf->private, fence)); + _glthread_UNLOCK_MUTEX(buf->mutex); + +} + +void +driBOValidateList(int fd, drmBOList * list) +{ + _glthread_LOCK_MUTEX(bmMutex); + BM_CKFATAL(drmBOValidateList(fd, list)); + _glthread_UNLOCK_MUTEX(bmMutex); +} + +void +driPoolTakeDown(struct _DriBufferPool *pool) +{ + pool->takeDown(pool); + +} diff --git a/src/mesa/drivers/dri/common/dri_bufmgr.h b/src/mesa/drivers/dri/common/dri_bufmgr.h new file mode 100644 index 00000000000..01f149ae4ed --- /dev/null +++ b/src/mesa/drivers/dri/common/dri_bufmgr.h @@ -0,0 +1,99 @@ +/************************************************************************** + * + * Copyright 2006 Tungsten Graphics, Inc., Bismarck, ND., USA + * 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. + * + * + **************************************************************************/ +/* + * Authors: Thomas Hellström + * Keith Whitwell + */ + +#ifndef _DRI_BUFMGR_H_ +#define _DRI_BUFMGR_H_ +#include + + +struct _DriFenceObject; +struct _DriBufferObject; +struct _DriBufferPool; + +extern struct _DriFenceObject *driFenceBuffers(int fd, char *name, + unsigned flags); + +extern struct _DriFenceObject *driFenceReference(struct _DriFenceObject *fence); + +extern void driFenceUnReference(struct _DriFenceObject *fence); + +extern void +driFenceFinish(struct _DriFenceObject *fence, unsigned type, int lazy); + +extern int driFenceSignaled(struct _DriFenceObject *fence, unsigned type); +extern unsigned driFenceType(struct _DriFenceObject *fence); + +/* + * Return a pointer to the libdrm buffer object this DriBufferObject + * uses. + */ + +extern drmBO *driBOKernel(struct _DriBufferObject *buf); +extern void *driBOMap(struct _DriBufferObject *buf, unsigned flags, + unsigned hint); +extern void driBOUnmap(struct _DriBufferObject *buf); +extern unsigned long driBOOffset(struct _DriBufferObject *buf); +extern unsigned driBOFlags(struct _DriBufferObject *buf); +extern struct _DriBufferObject *driBOReference(struct _DriBufferObject *buf); +extern void driBOUnReference(struct _DriBufferObject *buf); +extern void driBOData(struct _DriBufferObject *r_buf, + unsigned size, const void *data, unsigned flags); +extern void driBOSubData(struct _DriBufferObject *buf, + unsigned long offset, unsigned long size, + const void *data); +extern void driBOGetSubData(struct _DriBufferObject *buf, + unsigned long offset, unsigned long size, + void *data); +extern void driGenBuffers(struct _DriBufferPool *pool, + const char *name, + unsigned n, + struct _DriBufferObject *buffers[], + unsigned alignment, unsigned flags, unsigned hint); +extern void driDeleteBuffers(unsigned n, struct _DriBufferObject *buffers[]); +extern void driInitBufMgr(int fd); +extern void driBOCreateList(int target, drmBOList * list); +extern void driBOResetList(drmBOList * list); +extern void driBOAddListItem(drmBOList * list, struct _DriBufferObject *buf, + unsigned flags, unsigned mask); +extern void driBOValidateList(int fd, drmBOList * list); + +extern void driBOFence(struct _DriBufferObject *buf, + struct _DriFenceObject *fence); + +extern void driPoolTakeDown(struct _DriBufferPool *pool); +extern void driBOSetStatic(struct _DriBufferObject *buf, + unsigned long offset, + unsigned long size, void *virtual, unsigned flags); +extern void driBOWaitIdle(struct _DriBufferObject *buf, int lazy); +extern void driPoolTakeDown(struct _DriBufferPool *pool); + +#endif diff --git a/src/mesa/drivers/dri/common/dri_bufpool.h b/src/mesa/drivers/dri/common/dri_bufpool.h new file mode 100644 index 00000000000..c6fb2c3ce01 --- /dev/null +++ b/src/mesa/drivers/dri/common/dri_bufpool.h @@ -0,0 +1,86 @@ +/************************************************************************** + * + * Copyright 2006 Tungsten Graphics, Inc., Bismarck, ND., USA + * 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. + * + * + **************************************************************************/ +/* + * Authors: Thomas Hellström + */ + +#ifndef _DRI_BUFPOOL_H_ +#define _DRI_BUFPOOL_H_ + +#include +struct _DriFenceObject; + +typedef struct _DriBufferPool +{ + int fd; + int (*map) (struct _DriBufferPool * pool, void *private, + unsigned flags, int hint, void **virtual); + int (*unmap) (struct _DriBufferPool * pool, void *private); + int (*destroy) (struct _DriBufferPool * pool, void *private); + unsigned long (*offset) (struct _DriBufferPool * pool, void *private); + unsigned (*flags) (struct _DriBufferPool * pool, void *private); + unsigned long (*size) (struct _DriBufferPool * pool, void *private); + void *(*create) (struct _DriBufferPool * pool, unsigned long size, + unsigned flags, unsigned hint, unsigned alignment); + int (*fence) (struct _DriBufferPool * pool, void *private, + struct _DriFenceObject * fence); + drmBO *(*kernel) (struct _DriBufferPool * pool, void *private); + int (*validate) (struct _DriBufferPool * pool, void *private); + void *(*setstatic) (struct _DriBufferPool * pool, unsigned long offset, + unsigned long size, void *virtual, unsigned flags); + int (*waitIdle) (struct _DriBufferPool *pool, void *private, + int lazy); + void (*takeDown) (struct _DriBufferPool * pool); + void *data; +} DriBufferPool; + +extern void bmError(int val, const char *file, const char *function, + int line); +#define BM_CKFATAL(val) \ + do{ \ + int tstVal = (val); \ + if (tstVal) \ + bmError(tstVal, __FILE__, __FUNCTION__, __LINE__); \ + } while(0); + + + + + +/* + * Builtin pools. + */ + +/* + * Kernel buffer objects. Size in multiples of page size. Page size aligned. + */ + +extern struct _DriBufferPool *driDRMPoolInit(int fd); +extern struct _DriBufferPool *driDRMStaticPoolInit(int fd); + +#endif diff --git a/src/mesa/drivers/dri/common/dri_drmpool.c b/src/mesa/drivers/dri/common/dri_drmpool.c new file mode 100644 index 00000000000..b5b324be500 --- /dev/null +++ b/src/mesa/drivers/dri/common/dri_drmpool.c @@ -0,0 +1,227 @@ +/************************************************************************** + * + * Copyright 2006 Tungsten Graphics, Inc., Bismarck, ND., USA + * 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. + * + * + **************************************************************************/ +/* + * Authors: Thomas Hellström + */ + +#include +#include +#include +#include "dri_bufpool.h" + +/* + * Buffer pool implementation using DRM buffer objects as DRI buffer objects. + */ + +static void * +pool_create(struct _DriBufferPool *pool, + unsigned long size, unsigned flags, unsigned hint, + unsigned alignment) +{ + drmBO *buf = (drmBO *) malloc(sizeof(*buf)); + int ret; + unsigned pageSize = getpagesize(); + + if (!buf) + return NULL; + + if ((alignment > pageSize) && (alignment % pageSize)) { + return NULL; + } + + ret = drmBOCreate(pool->fd, 0, size, alignment / pageSize, + NULL, drm_bo_type_dc, + flags, hint, buf); + if (ret) { + free(buf); + return NULL; + } + + return (void *) buf; +} + +static int +pool_destroy(struct _DriBufferPool *pool, void *private) +{ + int ret; + drmBO *buf = (drmBO *) private; + ret = drmBODestroy(pool->fd, buf); + free(buf); + return ret; +} + +static int +pool_map(struct _DriBufferPool *pool, void *private, unsigned flags, + int hint, void **virtual) +{ + drmBO *buf = (drmBO *) private; + + return drmBOMap(pool->fd, buf, flags, hint, virtual); +} + +static int +pool_unmap(struct _DriBufferPool *pool, void *private) +{ + drmBO *buf = (drmBO *) private; + return drmBOUnmap(pool->fd, buf); +} + +static unsigned long +pool_offset(struct _DriBufferPool *pool, void *private) +{ + drmBO *buf = (drmBO *) private; + return buf->offset; +} + +static unsigned +pool_flags(struct _DriBufferPool *pool, void *private) +{ + drmBO *buf = (drmBO *) private; + return buf->flags; +} + + +static unsigned long +pool_size(struct _DriBufferPool *pool, void *private) +{ + drmBO *buf = (drmBO *) private; + return buf->size; +} + +static int +pool_fence(struct _DriBufferPool *pool, void *private, + struct _DriFenceObject *fence) +{ + /* + * Noop. The kernel handles all fencing. + */ + + return 0; +} + +static drmBO * +pool_kernel(struct _DriBufferPool *pool, void *private) +{ + return (drmBO *) private; +} + +static int +pool_waitIdle(struct _DriBufferPool *pool, void *private, int lazy) +{ + drmBO *buf = (drmBO *) private; + return drmBOWaitIdle(pool->fd, buf, (lazy) ? DRM_BO_HINT_WAIT_LAZY:0); +} + + +static void +pool_takedown(struct _DriBufferPool *pool) +{ + free(pool); +} + + +struct _DriBufferPool * +driDRMPoolInit(int fd) +{ + struct _DriBufferPool *pool; + + pool = (struct _DriBufferPool *) malloc(sizeof(*pool)); + + if (!pool) + return NULL; + + pool->fd = fd; + pool->map = &pool_map; + pool->unmap = &pool_unmap; + pool->destroy = &pool_destroy; + pool->offset = &pool_offset; + pool->flags = &pool_flags; + pool->size = &pool_size; + pool->create = &pool_create; + pool->fence = &pool_fence; + pool->kernel = &pool_kernel; + pool->validate = NULL; + pool->setstatic = NULL; + pool->waitIdle = &pool_waitIdle; + pool->takeDown = &pool_takedown; + pool->data = NULL; + return pool; +} + + +static void * +pool_setstatic(struct _DriBufferPool *pool, unsigned long offset, + unsigned long size, void *virtual, unsigned flags) +{ + drmBO *buf = (drmBO *) malloc(sizeof(*buf)); + int ret; + + if (!buf) + return NULL; + + ret = drmBOCreate(pool->fd, offset, size, 0, NULL, drm_bo_type_fake, + flags, 0, buf); + + if (ret) { + free(buf); + return NULL; + } + + buf->virtual = virtual; + + return (void *) buf; +} + + +struct _DriBufferPool * +driDRMStaticPoolInit(int fd) +{ + struct _DriBufferPool *pool; + + pool = (struct _DriBufferPool *) malloc(sizeof(*pool)); + + if (!pool) + return NULL; + + pool->fd = fd; + pool->map = &pool_map; + pool->unmap = &pool_unmap; + pool->destroy = &pool_destroy; + pool->offset = &pool_offset; + pool->flags = &pool_flags; + pool->size = &pool_size; + pool->create = NULL; + pool->fence = &pool_fence; + pool->kernel = &pool_kernel; + pool->validate = NULL; + pool->setstatic = &pool_setstatic; + pool->waitIdle = &pool_waitIdle; + pool->takeDown = &pool_takedown; + pool->data = NULL; + return pool; +} diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c index b5c20a066a5..e7f07569f4e 100644 --- a/src/mesa/drivers/dri/common/dri_util.c +++ b/src/mesa/drivers/dri/common/dri_util.c @@ -323,6 +323,7 @@ static GLboolean DoBindContext(__DRInativeDisplay *dpy, /* Bind the drawable to the context */ pcp->driDrawablePriv = pdp; + pcp->driReadablePriv = prp; pdp->driContextPriv = pcp; pdp->refcount++; if ( pdp != prp ) { @@ -339,6 +340,12 @@ static GLboolean DoBindContext(__DRInativeDisplay *dpy, DRM_SPINUNLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID); } + if ((pdp != prp) && (!pdp->pStamp || *pdp->pStamp != pdp->lastStamp)) { + DRM_SPINLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID); + __driUtilUpdateDrawableInfo(prp); + DRM_SPINUNLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID); + } + /* Call device-specific MakeCurrent */ (*psp->DriverAPI.MakeCurrent)(pcp, pdp, prp); @@ -402,7 +409,8 @@ __driUtilUpdateDrawableInfo(__DRIdrawablePrivate *pdp) __DRIscreenPrivate *psp; __DRIcontextPrivate *pcp = pdp->driContextPriv; - if (!pcp || (pdp != pcp->driDrawablePriv)) { + if (!pcp + || ((pdp != pcp->driDrawablePriv) && (pdp != pcp->driReadablePriv))) { /* ERROR!!! */ return; } @@ -841,7 +849,7 @@ static void driDestroyScreen(__DRInativeDisplay *dpy, int scrn, void *screenPriv (void)drmUnmap((drmAddress)psp->pSAREA, SAREA_MAX); (void)drmUnmap((drmAddress)psp->pFB, psp->fbSize); _mesa_free(psp->pDevPriv); - (void)drmClose(psp->fd); + (void)drmCloseOnce(psp->fd); if ( psp->modes != NULL ) { (*dri_interface->destroyContextModes)( psp->modes ); } diff --git a/src/mesa/drivers/dri/common/dri_util.h b/src/mesa/drivers/dri/common/dri_util.h index 14c24a0efaa..e43e6532500 100644 --- a/src/mesa/drivers/dri/common/dri_util.h +++ b/src/mesa/drivers/dri/common/dri_util.h @@ -87,15 +87,15 @@ typedef struct __DRIutilversionRec2 __DRIutilversion2; #define DRI_VALIDATE_DRAWABLE_INFO(psp, pdp) \ do { \ while (*(pdp->pStamp) != pdp->lastStamp) { \ - DRM_UNLOCK(psp->fd, &psp->pSAREA->lock, \ - pdp->driContextPriv->hHWContext); \ + register unsigned int hwContext = psp->pSAREA->lock.lock & \ + ~(DRM_LOCK_HELD | DRM_LOCK_CONT); \ + DRM_UNLOCK(psp->fd, &psp->pSAREA->lock, hwContext); \ \ DRM_SPINLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID); \ DRI_VALIDATE_DRAWABLE_INFO_ONCE(pdp); \ DRM_SPINUNLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID); \ \ - DRM_LIGHT_LOCK(psp->fd, &psp->pSAREA->lock, \ - pdp->driContextPriv->hHWContext); \ + DRM_LIGHT_LOCK(psp->fd, &psp->pSAREA->lock, hwContext); \ } \ } while (0) @@ -355,10 +355,15 @@ struct __DRIcontextPrivateRec { __DRInativeDisplay *display; /** - * Pointer to drawable currently bound to this context. + * Pointer to drawable currently bound to this context for drawing. */ __DRIdrawablePrivate *driDrawablePriv; + /** + * Pointer to drawable currently bound to this context for reading. + */ + __DRIdrawablePrivate *driReadablePriv; + /** * Pointer to screen on which this context was created. */ diff --git a/src/mesa/drivers/dri/common/drirenderbuffer.h b/src/mesa/drivers/dri/common/drirenderbuffer.h index cd73b781741..747f92fcdbe 100644 --- a/src/mesa/drivers/dri/common/drirenderbuffer.h +++ b/src/mesa/drivers/dri/common/drirenderbuffer.h @@ -52,8 +52,11 @@ typedef struct { */ GLboolean depthHasSurface; - /* XXX this is for s3v only. A handy flag to know if this is the back - * color buffer. + /** + * A handy flag to know if this is the back color buffer. + * + * \note + * This is currently only used by s3v and tdfx. */ GLboolean backBuffer; } driRenderbuffer; diff --git a/src/mesa/drivers/dri/common/extension_helper.h b/src/mesa/drivers/dri/common/extension_helper.h index 0f762837a4f..d6d51cdd165 100644 --- a/src/mesa/drivers/dri/common/extension_helper.h +++ b/src/mesa/drivers/dri/common/extension_helper.h @@ -32,9 +32,10 @@ # define NULL 0 #endif -#if defined(need_GL_ARB_shader_objects) +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) static const char UniformMatrix3fvARB_names[] = "iiip\0" /* Parameter signature */ + "glUniformMatrix3fv\0" "glUniformMatrix3fvARB\0" ""; #endif @@ -78,6 +79,13 @@ static const char PointParameteriNV_names[] = ""; #endif +#if defined(need_GL_VERSION_2_0) +static const char GetProgramiv_names[] = + "iip\0" /* Parameter signature */ + "glGetProgramiv\0" + ""; +#endif + #if defined(need_GL_VERSION_1_3) static const char MultiTexCoord3sARB_names[] = "iiii\0" /* Parameter signature */ @@ -132,14 +140,6 @@ static const char VertexAttrib4ubvNV_names[] = ""; #endif -#if defined(need_GL_SGI_color_table) || defined(need_GL_EXT_paletted_texture) -static const char GetColorTableParameterfvSGI_names[] = - "iip\0" /* Parameter signature */ - "glGetColorTableParameterfvSGI\0" - "glGetColorTableParameterfvEXT\0" - ""; -#endif - #if defined(need_GL_NV_fragment_program) static const char GetProgramNamedParameterdvNV_names[] = "iipp\0" /* Parameter signature */ @@ -239,16 +239,17 @@ static const char TexCoord2fColor4ubVertex3fvSUN_names[] = ""; #endif -#if defined(need_GL_ARB_vertex_program) -static const char ProgramEnvParameter4dvARB_names[] = - "iip\0" /* Parameter signature */ - "glProgramEnvParameter4dvARB\0" +#if defined(need_GL_VERSION_2_0) +static const char AttachShader_names[] = + "ii\0" /* Parameter signature */ + "glAttachShader\0" ""; #endif -#if defined(need_GL_ARB_vertex_program) +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) static const char VertexAttrib2fARB_names[] = "iff\0" /* Parameter signature */ + "glVertexAttrib2f\0" "glVertexAttrib2fARB\0" ""; #endif @@ -260,16 +261,10 @@ static const char GetDebugLogLengthMESA_names[] = ""; #endif -#if defined(need_GL_EXT_histogram) -static const char GetHistogramParameterivEXT_names[] = - "iip\0" /* Parameter signature */ - "glGetHistogramParameterivEXT\0" - ""; -#endif - -#if defined(need_GL_ARB_vertex_program) +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) static const char VertexAttrib3fARB_names[] = "ifff\0" /* Parameter signature */ + "glVertexAttrib3f\0" "glVertexAttrib3fARB\0" ""; #endif @@ -320,16 +315,25 @@ static const char CompressedTexSubImage2DARB_names[] = ""; #endif -#if defined(need_GL_ARB_shader_objects) +#if defined(need_GL_NV_register_combiners) +static const char CombinerOutputNV_names[] = + "iiiiiiiiii\0" /* Parameter signature */ + "glCombinerOutputNV\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) static const char Uniform2fARB_names[] = "iff\0" /* Parameter signature */ + "glUniform2f\0" "glUniform2fARB\0" ""; #endif -#if defined(need_GL_ARB_vertex_program) +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) static const char VertexAttrib1svARB_names[] = "ip\0" /* Parameter signature */ + "glVertexAttrib1sv\0" "glVertexAttrib1svARB\0" ""; #endif @@ -341,9 +345,10 @@ static const char VertexAttribs1dvNV_names[] = ""; #endif -#if defined(need_GL_ARB_shader_objects) +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) static const char Uniform2ivARB_names[] = "iip\0" /* Parameter signature */ + "glUniform2iv\0" "glUniform2ivARB\0" ""; #endif @@ -362,6 +367,13 @@ static const char WeightubvARB_names[] = ""; #endif +#if defined(need_GL_NV_vertex_program) +static const char VertexAttrib1fvNV_names[] = + "ip\0" /* Parameter signature */ + "glVertexAttrib1fvNV\0" + ""; +#endif + #if defined(need_GL_EXT_convolution) static const char CopyConvolutionFilter1D_names[] = "iiiii\0" /* Parameter signature */ @@ -392,9 +404,10 @@ static const char BlendColor_names[] = ""; #endif -#if defined(need_GL_ARB_shader_objects) +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) static const char UniformMatrix4fvARB_names[] = "iiip\0" /* Parameter signature */ + "glUniformMatrix4fv\0" "glUniformMatrix4fvARB\0" ""; #endif @@ -413,6 +426,13 @@ static const char ReadInstrumentsSGIX_names[] = ""; #endif +#if defined(need_GL_VERSION_2_1) +static const char UniformMatrix2x4fv_names[] = + "iiip\0" /* Parameter signature */ + "glUniformMatrix2x4fv\0" + ""; +#endif + #if defined(need_GL_SUN_vertex) static const char Color4ubVertex3fvSUN_names[] = "pp\0" /* Parameter signature */ @@ -427,9 +447,10 @@ static const char GetListParameterivSGIX_names[] = ""; #endif -#if defined(need_GL_ARB_vertex_program) +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) static const char VertexAttrib4NusvARB_names[] = "ip\0" /* Parameter signature */ + "glVertexAttrib4Nusv\0" "glVertexAttrib4NusvARB\0" ""; #endif @@ -455,10 +476,10 @@ static const char FragmentLightModelivSGIX_names[] = ""; #endif -#if defined(need_GL_ATI_fragment_shader) -static const char ColorFragmentOp3ATI_names[] = - "iiiiiiiiiiiii\0" /* Parameter signature */ - "glColorFragmentOp3ATI\0" +#if defined(need_GL_VERSION_2_1) +static const char UniformMatrix4x3fv_names[] = + "iiip\0" /* Parameter signature */ + "glUniformMatrix4x3fv\0" ""; #endif @@ -551,9 +572,10 @@ static const char ProgramParameter4dvNV_names[] = ""; #endif -#if defined(need_GL_ARB_vertex_program) +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) static const char DisableVertexAttribArrayARB_names[] = "i\0" /* Parameter signature */ + "glDisableVertexAttribArray\0" "glDisableVertexAttribArrayARB\0" ""; #endif @@ -580,9 +602,18 @@ static const char CompressedTexImage3DARB_names[] = ""; #endif -#if defined(need_GL_ARB_vertex_program) +#if defined(need_GL_EXT_convolution) +static const char GetConvolutionParameteriv_names[] = + "iip\0" /* Parameter signature */ + "glGetConvolutionParameteriv\0" + "glGetConvolutionParameterivEXT\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) static const char VertexAttrib1fARB_names[] = "if\0" /* Parameter signature */ + "glVertexAttrib1f\0" "glVertexAttrib1fARB\0" ""; #endif @@ -695,16 +726,25 @@ static const char VertexAttrib2dNV_names[] = ""; #endif -#if defined(need_GL_ARB_vertex_program) +#if defined(need_GL_VERSION_2_0) +static const char GetProgramInfoLog_names[] = + "iipp\0" /* Parameter signature */ + "glGetProgramInfoLog\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) static const char VertexAttrib4NbvARB_names[] = "ip\0" /* Parameter signature */ + "glVertexAttrib4Nbv\0" "glVertexAttrib4NbvARB\0" ""; #endif -#if defined(need_GL_ARB_vertex_shader) +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_shader) static const char GetActiveAttribARB_names[] = "iiipppp\0" /* Parameter signature */ + "glGetActiveAttrib\0" "glGetActiveAttribARB\0" ""; #endif @@ -723,13 +763,6 @@ static const char TexCoord2fColor4fNormal3fVertex3fSUN_names[] = ""; #endif -#if defined(need_GL_EXT_histogram) -static const char GetMinmaxEXT_names[] = - "iiiip\0" /* Parameter signature */ - "glGetMinmaxEXT\0" - ""; -#endif - #if defined(need_GL_NV_register_combiners) static const char CombinerParameterfvNV_names[] = "ip\0" /* Parameter signature */ @@ -877,9 +910,10 @@ static const char ReplacementCodeubvSUN_names[] = ""; #endif -#if defined(need_GL_ARB_shader_objects) +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) static const char Uniform3iARB_names[] = "iiii\0" /* Parameter signature */ + "glUniform3i\0" "glUniform3iARB\0" ""; #endif @@ -891,10 +925,10 @@ static const char GetFragmentMaterialfvSGIX_names[] = ""; #endif -#if defined(need_GL_EXT_coordinate_frame) -static const char Binormal3fEXT_names[] = - "fff\0" /* Parameter signature */ - "glBinormal3fEXT\0" +#if defined(need_GL_VERSION_2_0) +static const char GetShaderInfoLog_names[] = + "iipp\0" /* Parameter signature */ + "glGetShaderInfoLog\0" ""; #endif @@ -1012,9 +1046,10 @@ static const char TexSubImage1D_names[] = ""; #endif -#if defined(need_GL_ARB_vertex_program) +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) static const char VertexAttrib1sARB_names[] = "ii\0" /* Parameter signature */ + "glVertexAttrib1s\0" "glVertexAttrib1sARB\0" ""; #endif @@ -1026,13 +1061,6 @@ static const char FinalCombinerInputNV_names[] = ""; #endif -#if defined(need_GL_EXT_histogram) -static const char GetHistogramParameterfvEXT_names[] = - "iip\0" /* Parameter signature */ - "glGetHistogramParameterfvEXT\0" - ""; -#endif - #if defined(need_GL_SGIX_flush_raster) static const char FlushRasterSGIX_names[] = "\0" /* Parameter signature */ @@ -1047,13 +1075,22 @@ static const char ReplacementCodeuiTexCoord2fVertex3fSUN_names[] = ""; #endif -#if defined(need_GL_ARB_shader_objects) +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) static const char Uniform1fARB_names[] = "if\0" /* Parameter signature */ + "glUniform1f\0" "glUniform1fARB\0" ""; #endif +#if defined(need_GL_EXT_texture_object) +static const char AreTexturesResident_names[] = + "ipp\0" /* Parameter signature */ + "glAreTexturesResident\0" + "glAreTexturesResidentEXT\0" + ""; +#endif + #if defined(need_GL_EXT_framebuffer_object) static const char IsRenderbufferEXT_names[] = "i\0" /* Parameter signature */ @@ -1119,13 +1156,6 @@ static const char SecondaryColor3bvEXT_names[] = ""; #endif -#if defined(need_GL_EXT_histogram) -static const char GetHistogramEXT_names[] = - "iiiip\0" /* Parameter signature */ - "glGetHistogramEXT\0" - ""; -#endif - #if defined(need_GL_IBM_vertex_array_lists) static const char VertexPointerListIBM_names[] = "iiipi\0" /* Parameter signature */ @@ -1182,9 +1212,10 @@ static const char GetFragmentLightivSGIX_names[] = ""; #endif -#if defined(need_GL_ARB_shader_objects) +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) static const char UniformMatrix2fvARB_names[] = "iiip\0" /* Parameter signature */ + "glUniformMatrix2fv\0" "glUniformMatrix2fvARB\0" ""; #endif @@ -1228,9 +1259,10 @@ static const char MapParameterfvNV_names[] = ""; #endif -#if defined(need_GL_ARB_vertex_program) +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) static const char VertexAttrib3dvARB_names[] = "ip\0" /* Parameter signature */ + "glVertexAttrib3dv\0" "glVertexAttrib3dvARB\0" ""; #endif @@ -1321,9 +1353,10 @@ static const char GetAttachedObjectsARB_names[] = ""; #endif -#if defined(need_GL_ARB_shader_objects) +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) static const char Uniform3fvARB_names[] = "iip\0" /* Parameter signature */ + "glUniform3fv\0" "glUniform3fvARB\0" ""; #endif @@ -1364,9 +1397,10 @@ static const char GetHandleARB_names[] = ""; #endif -#if defined(need_GL_ARB_vertex_program) +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) static const char GetVertexAttribivARB_names[] = "iip\0" /* Parameter signature */ + "glGetVertexAttribiv\0" "glGetVertexAttribivARB\0" ""; #endif @@ -1378,10 +1412,10 @@ static const char GetCombinerInputParameterfvNV_names[] = ""; #endif -#if defined(need_GL_SUN_vertex) -static const char ReplacementCodeuiNormal3fVertex3fvSUN_names[] = - "ppp\0" /* Parameter signature */ - "glReplacementCodeuiNormal3fVertex3fvSUN\0" +#if defined(need_GL_VERSION_2_0) +static const char CreateProgram_names[] = + "\0" /* Parameter signature */ + "glCreateProgram\0" ""; #endif @@ -1393,6 +1427,14 @@ static const char LoadTransposeMatrixdARB_names[] = ""; #endif +#if defined(need_GL_EXT_histogram) +static const char GetMinmax_names[] = + "iiiip\0" /* Parameter signature */ + "glGetMinmax\0" + "glGetMinmaxEXT\0" + ""; +#endif + #if defined(need_GL_VERSION_2_0) static const char StencilFuncSeparate_names[] = "iiii\0" /* Parameter signature */ @@ -1551,13 +1593,6 @@ static const char AlphaFragmentOp2ATI_names[] = ""; #endif -#if defined(need_GL_EXT_convolution) -static const char GetSeparableFilterEXT_names[] = - "iiippp\0" /* Parameter signature */ - "glGetSeparableFilterEXT\0" - ""; -#endif - #if defined(need_GL_VERSION_1_3) static const char MultiTexCoord4sARB_names[] = "iiiii\0" /* Parameter signature */ @@ -1618,9 +1653,10 @@ static const char VertexAttrib3dNV_names[] = ""; #endif -#if defined(need_GL_ARB_vertex_program) +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) static const char VertexAttrib3dARB_names[] = "iddd\0" /* Parameter signature */ + "glVertexAttrib3d\0" "glVertexAttrib3dARB\0" ""; #endif @@ -1632,9 +1668,10 @@ static const char ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN_names[] ""; #endif -#if defined(need_GL_ARB_vertex_program) +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) static const char VertexAttrib4fARB_names[] = "iffff\0" /* Parameter signature */ + "glVertexAttrib4f\0" "glVertexAttrib4fARB\0" ""; #endif @@ -1683,9 +1720,10 @@ static const char SecondaryColorPointerEXT_names[] = ""; #endif -#if defined(need_GL_ARB_vertex_program) +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) static const char VertexAttrib4fvARB_names[] = "ip\0" /* Parameter signature */ + "glVertexAttrib4fv\0" "glVertexAttrib4fvARB\0" ""; #endif @@ -1697,9 +1735,10 @@ static const char ColorPointerListIBM_names[] = ""; #endif -#if defined(need_GL_ARB_shader_objects) +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) static const char GetActiveUniformARB_names[] = "iiipppp\0" /* Parameter signature */ + "glGetActiveUniform\0" "glGetActiveUniformARB\0" ""; #endif @@ -1741,6 +1780,13 @@ static const char DeformationMap3dSGIX_names[] = ""; #endif +#if defined(need_GL_VERSION_2_0) +static const char IsShader_names[] = + "i\0" /* Parameter signature */ + "glIsShader\0" + ""; +#endif + #if defined(need_GL_HP_image_transform) static const char GetImageTransformParameterivHP_names[] = "iip\0" /* Parameter signature */ @@ -1785,9 +1831,10 @@ static const char ResizeBuffersMESA_names[] = ""; #endif -#if defined(need_GL_ARB_shader_objects) +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) static const char GetUniformivARB_names[] = "iip\0" /* Parameter signature */ + "glGetUniformiv\0" "glGetUniformivARB\0" ""; #endif @@ -1879,10 +1926,10 @@ static const char MultiTexCoord3iARB_names[] = ""; #endif -#if defined(need_GL_EXT_convolution) -static const char GetConvolutionFilterEXT_names[] = - "iiip\0" /* Parameter signature */ - "glGetConvolutionFilterEXT\0" +#if defined(need_GL_VERSION_2_0) +static const char IsProgram_names[] = + "i\0" /* Parameter signature */ + "glIsProgram\0" ""; #endif @@ -1921,6 +1968,14 @@ static const char VertexAttrib1dvNV_names[] = ""; #endif +#if defined(need_GL_EXT_texture_object) +static const char GenTextures_names[] = + "ip\0" /* Parameter signature */ + "glGenTextures\0" + "glGenTexturesEXT\0" + ""; +#endif + #if defined(need_GL_NV_fence) static const char SetFenceNV_names[] = "ii\0" /* Parameter signature */ @@ -2016,9 +2071,10 @@ static const char PointParameterivNV_names[] = ""; #endif -#if defined(need_GL_ARB_shader_objects) +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) static const char Uniform2fvARB_names[] = "iip\0" /* Parameter signature */ + "glUniform2fv\0" "glUniform2fvARB\0" ""; #endif @@ -2045,10 +2101,10 @@ static const char DeleteObjectARB_names[] = ""; #endif -#if defined(need_GL_ARB_shader_objects) -static const char UseProgramObjectARB_names[] = - "i\0" /* Parameter signature */ - "glUseProgramObjectARB\0" +#if defined(need_GL_ARB_matrix_palette) +static const char MatrixIndexPointerARB_names[] = + "iiip\0" /* Parameter signature */ + "glMatrixIndexPointerARB\0" ""; #endif @@ -2073,10 +2129,18 @@ static const char BindFramebufferEXT_names[] = ""; #endif -#if defined(need_GL_ARB_vertex_program) -static const char VertexAttrib4usvARB_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib4usvARB\0" +#if defined(need_GL_SGIX_reference_plane) +static const char ReferencePlaneSGIX_names[] = + "p\0" /* Parameter signature */ + "glReferencePlaneSGIX\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) +static const char ValidateProgramARB_names[] = + "i\0" /* Parameter signature */ + "glValidateProgram\0" + "glValidateProgramARB\0" ""; #endif @@ -2118,9 +2182,10 @@ static const char CopyTexSubImage3D_names[] = ""; #endif -#if defined(need_GL_ARB_vertex_program) +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) static const char VertexAttrib2dARB_names[] = "idd\0" /* Parameter signature */ + "glVertexAttrib2d\0" "glVertexAttrib2dARB\0" ""; #endif @@ -2132,6 +2197,15 @@ static const char TextureColorMaskSGIS_names[] = ""; #endif +#if defined(need_GL_SGI_color_table) || defined(need_GL_EXT_paletted_texture) +static const char GetColorTable_names[] = + "iiip\0" /* Parameter signature */ + "glGetColorTable\0" + "glGetColorTableSGI\0" + "glGetColorTableEXT\0" + ""; +#endif + #if defined(need_GL_SGI_color_table) static const char CopyColorTable_names[] = "iiiii\0" /* Parameter signature */ @@ -2140,6 +2214,14 @@ static const char CopyColorTable_names[] = ""; #endif +#if defined(need_GL_EXT_histogram) +static const char GetHistogramParameterfv_names[] = + "iip\0" /* Parameter signature */ + "glGetHistogramParameterfv\0" + "glGetHistogramParameterfvEXT\0" + ""; +#endif + #if defined(need_GL_INTEL_parallel_arrays) static const char ColorPointervINTEL_names[] = "iip\0" /* Parameter signature */ @@ -2170,9 +2252,10 @@ static const char MultiTexCoord2sARB_names[] = ""; #endif -#if defined(need_GL_ARB_vertex_program) +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) static const char VertexAttrib1dvARB_names[] = "ip\0" /* Parameter signature */ + "glVertexAttrib1dv\0" "glVertexAttrib1dvARB\0" ""; #endif @@ -2227,9 +2310,10 @@ static const char DeformSGIX_names[] = ""; #endif -#if defined(need_GL_ARB_vertex_program) +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) static const char GetVertexAttribfvARB_names[] = "iip\0" /* Parameter signature */ + "glGetVertexAttribfv\0" "glGetVertexAttribfvARB\0" ""; #endif @@ -2242,6 +2326,13 @@ static const char SecondaryColor3ivEXT_names[] = ""; #endif +#if defined(need_GL_VERSION_2_1) +static const char UniformMatrix4x2fv_names[] = + "iiip\0" /* Parameter signature */ + "glUniformMatrix4x2fv\0" + ""; +#endif + #if defined(need_GL_SGIS_detail_texture) static const char GetDetailTexFuncSGIS_names[] = "ip\0" /* Parameter signature */ @@ -2256,6 +2347,13 @@ static const char GetCombinerStageParameterfvNV_names[] = ""; #endif +#if defined(need_GL_EXT_coordinate_frame) +static const char Binormal3fEXT_names[] = + "fff\0" /* Parameter signature */ + "glBinormal3fEXT\0" + ""; +#endif + #if defined(need_GL_SUN_vertex) static const char Color4ubVertex2fvSUN_names[] = "pp\0" /* Parameter signature */ @@ -2278,9 +2376,10 @@ static const char SampleMaskSGIS_names[] = ""; #endif -#if defined(need_GL_ARB_vertex_shader) +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_shader) static const char GetAttribLocationARB_names[] = "ip\0" /* Parameter signature */ + "glGetAttribLocation\0" "glGetAttribLocationARB\0" ""; #endif @@ -2329,9 +2428,10 @@ static const char ProgramEnvParameter4fARB_names[] = ""; #endif -#if defined(need_GL_ARB_shader_objects) +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) static const char Uniform3ivARB_names[] = "iip\0" /* Parameter signature */ + "glUniform3iv\0" "glUniform3ivARB\0" ""; #endif @@ -2366,10 +2466,10 @@ static const char MultiTexCoord4ivARB_names[] = ""; #endif -#if defined(need_GL_EXT_gpu_program_parameters) -static const char ProgramLocalParameters4fvEXT_names[] = - "iiip\0" /* Parameter signature */ - "glProgramLocalParameters4fvEXT\0" +#if defined(need_GL_VERSION_2_0) +static const char GetVertexAttribPointervARB_names[] = + "iip\0" /* Parameter signature */ + "glGetVertexAttribPointerv\0" ""; #endif @@ -2380,9 +2480,10 @@ static const char GetMapAttribParameterfvNV_names[] = ""; #endif -#if defined(need_GL_ARB_vertex_program) +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) static const char VertexAttrib4sARB_names[] = "iiiii\0" /* Parameter signature */ + "glVertexAttrib4s\0" "glVertexAttrib4sARB\0" ""; #endif @@ -2409,23 +2510,10 @@ static const char GenRenderbuffersEXT_names[] = ""; #endif -#if defined(need_GL_EXT_convolution) -static const char GetConvolutionParameterfvEXT_names[] = - "iip\0" /* Parameter signature */ - "glGetConvolutionParameterfvEXT\0" - ""; -#endif - -#if defined(need_GL_EXT_histogram) -static const char GetMinmaxParameterfvEXT_names[] = - "iip\0" /* Parameter signature */ - "glGetMinmaxParameterfvEXT\0" - ""; -#endif - -#if defined(need_GL_ARB_vertex_program) +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) static const char VertexAttrib2dvARB_names[] = "ip\0" /* Parameter signature */ + "glVertexAttrib2dv\0" "glVertexAttrib2dvARB\0" ""; #endif @@ -2451,9 +2539,10 @@ static const char WeightbvARB_names[] = ""; #endif -#if defined(need_GL_ARB_vertex_program) +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) static const char VertexAttrib2fvARB_names[] = "ip\0" /* Parameter signature */ + "glVertexAttrib2fv\0" "glVertexAttrib2fvARB\0" ""; #endif @@ -2487,17 +2576,18 @@ static const char InstrumentsBufferSGIX_names[] = ""; #endif -#if defined(need_GL_ARB_vertex_program) +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) static const char VertexAttrib4NivARB_names[] = "ip\0" /* Parameter signature */ + "glVertexAttrib4Niv\0" "glVertexAttrib4NivARB\0" ""; #endif -#if defined(need_GL_SUN_triangle_list) -static const char ReplacementCodeuivSUN_names[] = - "p\0" /* Parameter signature */ - "glReplacementCodeuivSUN\0" +#if defined(need_GL_VERSION_2_0) +static const char GetAttachedShaders_names[] = + "iipp\0" /* Parameter signature */ + "glGetAttachedShaders\0" ""; #endif @@ -2515,6 +2605,13 @@ static const char ProgramEnvParameters4fvEXT_names[] = ""; #endif +#if defined(need_GL_SUN_vertex) +static const char TexCoord2fColor4fNormal3fVertex3fvSUN_names[] = + "pppp\0" /* Parameter signature */ + "glTexCoord2fColor4fNormal3fVertex3fvSUN\0" + ""; +#endif + #if defined(need_GL_VERSION_1_4) || defined(need_GL_ARB_window_pos) || defined(need_GL_MESA_window_pos) static const char WindowPos2iMESA_names[] = "ii\0" /* Parameter signature */ @@ -2554,17 +2651,26 @@ static const char GetProgramStringARB_names[] = ""; #endif -#if defined(need_GL_ARB_shader_objects) +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) static const char CompileShaderARB_names[] = "i\0" /* Parameter signature */ + "glCompileShader\0" "glCompileShaderARB\0" ""; #endif -#if defined(need_GL_NV_register_combiners) -static const char CombinerOutputNV_names[] = - "iiiiiiiiii\0" /* Parameter signature */ - "glCombinerOutputNV\0" +#if defined(need_GL_VERSION_2_0) +static const char DeleteShader_names[] = + "i\0" /* Parameter signature */ + "glDeleteShader\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) +static const char Uniform3fARB_names[] = + "ifff\0" /* Parameter signature */ + "glUniform3f\0" + "glUniform3fARB\0" ""; #endif @@ -2626,9 +2732,10 @@ static const char WindowPos4sMESA_names[] = ""; #endif -#if defined(need_GL_ARB_vertex_program) +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) static const char VertexAttrib4NuivARB_names[] = "ip\0" /* Parameter signature */ + "glVertexAttrib4Nuiv\0" "glVertexAttrib4NuivARB\0" ""; #endif @@ -2655,9 +2762,10 @@ static const char ReplacementCodeusvSUN_names[] = ""; #endif -#if defined(need_GL_ARB_shader_objects) +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) static const char Uniform4fARB_names[] = "iffff\0" /* Parameter signature */ + "glUniform4f\0" "glUniform4fARB\0" ""; #endif @@ -2713,6 +2821,14 @@ static const char Binormal3bvEXT_names[] = ""; #endif +#if defined(need_GL_EXT_texture_object) +static const char IsTexture_names[] = + "i\0" /* Parameter signature */ + "glIsTexture\0" + "glIsTextureEXT\0" + ""; +#endif + #if defined(need_GL_EXT_vertex_weighting) static const char VertexWeightfvEXT_names[] = "p\0" /* Parameter signature */ @@ -2720,9 +2836,10 @@ static const char VertexWeightfvEXT_names[] = ""; #endif -#if defined(need_GL_ARB_vertex_program) +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) static const char VertexAttrib1dARB_names[] = "id\0" /* Parameter signature */ + "glVertexAttrib1d\0" "glVertexAttrib1dARB\0" ""; #endif @@ -2763,13 +2880,6 @@ static const char CurrentPaletteMatrixARB_names[] = ""; #endif -#if defined(need_GL_NV_vertex_program) -static const char VertexAttrib4sNV_names[] = - "iiiii\0" /* Parameter signature */ - "glVertexAttrib4sNV\0" - ""; -#endif - #if defined(need_GL_SGIS_multisample) || defined(need_GL_EXT_multisample) static const char SamplePatternSGIS_names[] = "i\0" /* Parameter signature */ @@ -2793,9 +2903,17 @@ static const char ReplacementCodeuiColor4ubVertex3fSUN_names[] = ""; #endif -#if defined(need_GL_ARB_shader_objects) +#if defined(need_GL_ARB_vertex_program) +static const char VertexAttrib4usvARB_names[] = + "ip\0" /* Parameter signature */ + "glVertexAttrib4usvARB\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) static const char LinkProgramARB_names[] = "i\0" /* Parameter signature */ + "glLinkProgram\0" "glLinkProgramARB\0" ""; #endif @@ -2807,9 +2925,10 @@ static const char VertexAttrib2fNV_names[] = ""; #endif -#if defined(need_GL_ARB_shader_objects) +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) static const char ShaderSourceARB_names[] = "iipp\0" /* Parameter signature */ + "glShaderSource\0" "glShaderSourceARB\0" ""; #endif @@ -2821,9 +2940,10 @@ static const char FragmentMaterialiSGIX_names[] = ""; #endif -#if defined(need_GL_ARB_vertex_program) +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) static const char VertexAttrib3svARB_names[] = "ip\0" /* Parameter signature */ + "glVertexAttrib3sv\0" "glVertexAttrib3svARB\0" ""; #endif @@ -2852,20 +2972,30 @@ static const char IsFramebufferEXT_names[] = ""; #endif -#if defined(need_GL_ARB_shader_objects) +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) static const char Uniform4ivARB_names[] = "iip\0" /* Parameter signature */ + "glUniform4iv\0" "glUniform4ivARB\0" ""; #endif -#if defined(need_GL_ARB_vertex_program) +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) static const char GetVertexAttribdvARB_names[] = "iip\0" /* Parameter signature */ + "glGetVertexAttribdv\0" "glGetVertexAttribdvARB\0" ""; #endif +#if defined(need_GL_EXT_convolution) +static const char GetSeparableFilter_names[] = + "iiippp\0" /* Parameter signature */ + "glGetSeparableFilter\0" + "glGetSeparableFilterEXT\0" + ""; +#endif + #if defined(need_GL_EXT_coordinate_frame) static const char Binormal3dEXT_names[] = "ddd\0" /* Parameter signature */ @@ -2916,9 +3046,10 @@ static const char MultiDrawElementsEXT_names[] = ""; #endif -#if defined(need_GL_ARB_shader_objects) +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) static const char Uniform1ivARB_names[] = "iip\0" /* Parameter signature */ + "glUniform1iv\0" "glUniform1ivARB\0" ""; #endif @@ -2962,16 +3093,18 @@ static const char SecondaryColor3ubvEXT_names[] = ""; #endif -#if defined(need_GL_ARB_vertex_program) +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) static const char VertexAttrib4dvARB_names[] = "ip\0" /* Parameter signature */ + "glVertexAttrib4dv\0" "glVertexAttrib4dvARB\0" ""; #endif -#if defined(need_GL_ARB_vertex_shader) +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_shader) static const char BindAttribLocationARB_names[] = "iip\0" /* Parameter signature */ + "glBindAttribLocation\0" "glBindAttribLocationARB\0" ""; #endif @@ -2998,14 +3131,6 @@ static const char LightEnviSGIX_names[] = ""; #endif -#if defined(need_GL_SGI_color_table) || defined(need_GL_EXT_paletted_texture) -static const char GetColorTableParameterivSGI_names[] = - "iip\0" /* Parameter signature */ - "glGetColorTableParameterivSGI\0" - "glGetColorTableParameterivEXT\0" - ""; -#endif - #if defined(need_GL_SUN_triangle_list) static const char ReplacementCodeuiSUN_names[] = "i\0" /* Parameter signature */ @@ -3027,6 +3152,13 @@ static const char VertexAttribPointerNV_names[] = ""; #endif +#if defined(need_GL_EXT_gpu_program_parameters) +static const char ProgramLocalParameters4fvEXT_names[] = + "iiip\0" /* Parameter signature */ + "glProgramLocalParameters4fvEXT\0" + ""; +#endif + #if defined(need_GL_EXT_framebuffer_object) static const char GetFramebufferAttachmentParameterivEXT_names[] = "iiip\0" /* Parameter signature */ @@ -3049,13 +3181,6 @@ static const char PixelTransformParameteriEXT_names[] = ""; #endif -#if defined(need_GL_ARB_shader_objects) -static const char ValidateProgramARB_names[] = - "i\0" /* Parameter signature */ - "glValidateProgramARB\0" - ""; -#endif - #if defined(need_GL_SUN_vertex) static const char TexCoord2fColor4ubVertex3fSUN_names[] = "ffiiiifff\0" /* Parameter signature */ @@ -3063,16 +3188,18 @@ static const char TexCoord2fColor4ubVertex3fSUN_names[] = ""; #endif -#if defined(need_GL_ARB_shader_objects) +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) static const char Uniform1iARB_names[] = "ii\0" /* Parameter signature */ + "glUniform1i\0" "glUniform1iARB\0" ""; #endif -#if defined(need_GL_ARB_vertex_program) +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) static const char VertexAttribPointerARB_names[] = "iiiiip\0" /* Parameter signature */ + "glVertexAttribPointer\0" "glVertexAttribPointerARB\0" ""; #endif @@ -3092,6 +3219,13 @@ static const char MultiTexCoord4fvARB_names[] = ""; #endif +#if defined(need_GL_VERSION_2_1) +static const char UniformMatrix2x3fv_names[] = + "iiip\0" /* Parameter signature */ + "glUniformMatrix2x3fv\0" + ""; +#endif + #if defined(need_GL_NV_vertex_program) static const char TrackMatrixNV_names[] = "iiii\0" /* Parameter signature */ @@ -3134,16 +3268,18 @@ static const char Normal3fVertex3fvSUN_names[] = ""; #endif -#if defined(need_GL_ARB_vertex_program) +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) static const char VertexAttrib4NsvARB_names[] = "ip\0" /* Parameter signature */ + "glVertexAttrib4Nsv\0" "glVertexAttrib4NsvARB\0" ""; #endif -#if defined(need_GL_ARB_vertex_program) +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) static const char VertexAttrib3fvARB_names[] = "ip\0" /* Parameter signature */ + "glVertexAttrib3fv\0" "glVertexAttrib3fvARB\0" ""; #endif @@ -3206,10 +3342,19 @@ static const char PixelTexGenParameterfSGIS_names[] = ""; #endif -#if defined(need_GL_SUN_vertex) -static const char TexCoord2fColor4fNormal3fVertex3fvSUN_names[] = - "pppp\0" /* Parameter signature */ - "glTexCoord2fColor4fNormal3fVertex3fvSUN\0" +#if defined(need_GL_VERSION_2_0) +static const char CreateShader_names[] = + "i\0" /* Parameter signature */ + "glCreateShader\0" + ""; +#endif + +#if defined(need_GL_SGI_color_table) || defined(need_GL_EXT_paletted_texture) +static const char GetColorTableParameterfv_names[] = + "iip\0" /* Parameter signature */ + "glGetColorTableParameterfv\0" + "glGetColorTableParameterfvSGI\0" + "glGetColorTableParameterfvEXT\0" ""; #endif @@ -3263,16 +3408,17 @@ static const char FragmentLightfvSGIX_names[] = ""; #endif -#if defined(need_GL_NV_vertex_program) -static const char VertexAttrib3sNV_names[] = - "iiii\0" /* Parameter signature */ - "glVertexAttrib3sNV\0" +#if defined(need_GL_VERSION_2_0) +static const char DetachShader_names[] = + "ii\0" /* Parameter signature */ + "glDetachShader\0" ""; #endif -#if defined(need_GL_ARB_vertex_program) +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) static const char VertexAttrib4NubARB_names[] = "iiiii\0" /* Parameter signature */ + "glVertexAttrib4Nub\0" "glVertexAttrib4NubARB\0" ""; #endif @@ -3298,9 +3444,10 @@ static const char VertexAttrib3svNV_names[] = ""; #endif -#if defined(need_GL_ARB_shader_objects) +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) static const char Uniform4fvARB_names[] = "iip\0" /* Parameter signature */ + "glUniform4fv\0" "glUniform4fvARB\0" ""; #endif @@ -3320,9 +3467,10 @@ static const char ColorFragmentOp1ATI_names[] = ""; #endif -#if defined(need_GL_ARB_shader_objects) +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) static const char GetUniformfvARB_names[] = "iip\0" /* Parameter signature */ + "glGetUniformfv\0" "glGetUniformfvARB\0" ""; #endif @@ -3416,6 +3564,14 @@ static const char GetProgramivNV_names[] = ""; #endif +#if defined(need_GL_EXT_histogram) +static const char GetMinmaxParameteriv_names[] = + "iip\0" /* Parameter signature */ + "glGetMinmaxParameteriv\0" + "glGetMinmaxParameterivEXT\0" + ""; +#endif + #if defined(need_GL_EXT_copy_texture) static const char CopyTexImage1D_names[] = "iiiiiii\0" /* Parameter signature */ @@ -3459,9 +3615,10 @@ static const char GetMapParameterivNV_names[] = ""; #endif -#if defined(need_GL_ARB_shader_objects) +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) static const char Uniform4iARB_names[] = "iiiii\0" /* Parameter signature */ + "glUniform4i\0" "glUniform4iARB\0" ""; #endif @@ -3489,6 +3646,22 @@ static const char ConvolutionParameterf_names[] = ""; #endif +#if defined(need_GL_SGI_color_table) || defined(need_GL_EXT_paletted_texture) +static const char GetColorTableParameteriv_names[] = + "iip\0" /* Parameter signature */ + "glGetColorTableParameteriv\0" + "glGetColorTableParameterivSGI\0" + "glGetColorTableParameterivEXT\0" + ""; +#endif + +#if defined(need_GL_ARB_vertex_program) +static const char ProgramEnvParameter4dvARB_names[] = + "iip\0" /* Parameter signature */ + "glProgramEnvParameter4dvARB\0" + ""; +#endif + #if defined(need_GL_NV_vertex_program) static const char VertexAttribs2fvNV_names[] = "iip\0" /* Parameter signature */ @@ -3496,10 +3669,11 @@ static const char VertexAttribs2fvNV_names[] = ""; #endif -#if defined(need_GL_ARB_matrix_palette) -static const char MatrixIndexPointerARB_names[] = - "iiip\0" /* Parameter signature */ - "glMatrixIndexPointerARB\0" +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) +static const char UseProgramObjectARB_names[] = + "i\0" /* Parameter signature */ + "glUseProgram\0" + "glUseProgramObjectARB\0" ""; #endif @@ -3517,10 +3691,10 @@ static const char PassTexCoordATI_names[] = ""; #endif -#if defined(need_GL_NV_vertex_program) -static const char VertexAttrib1fvNV_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib1fvNV\0" +#if defined(need_GL_VERSION_2_0) +static const char DeleteProgram_names[] = + "i\0" /* Parameter signature */ + "glDeleteProgram\0" ""; #endif @@ -3569,14 +3743,6 @@ static const char MultiTexCoord4dARB_names[] = ""; #endif -#if defined(need_GL_SGI_color_table) || defined(need_GL_EXT_paletted_texture) -static const char GetColorTableSGI_names[] = - "iiip\0" /* Parameter signature */ - "glGetColorTableSGI\0" - "glGetColorTableEXT\0" - ""; -#endif - #if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_secondary_color) static const char SecondaryColor3usEXT_names[] = "iii\0" /* Parameter signature */ @@ -3631,20 +3797,14 @@ static const char MultiTexCoord1dvARB_names[] = ""; #endif -#if defined(need_GL_ARB_shader_objects) +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) static const char Uniform2iARB_names[] = "iii\0" /* Parameter signature */ + "glUniform2i\0" "glUniform2iARB\0" ""; #endif -#if defined(need_GL_EXT_convolution) -static const char GetConvolutionParameterivEXT_names[] = - "iip\0" /* Parameter signature */ - "glGetConvolutionParameterivEXT\0" - ""; -#endif - #if defined(need_GL_NV_vertex_program) static const char GetProgramStringNV_names[] = "iip\0" /* Parameter signature */ @@ -3703,13 +3863,6 @@ static const char ResetMinmax_names[] = ""; #endif -#if defined(need_GL_EXT_texture_object) -static const char GenTexturesEXT_names[] = - "ip\0" /* Parameter signature */ - "glGenTexturesEXT\0" - ""; -#endif - #if defined(need_GL_SGIX_sprite) static const char SpriteParameterfSGIX_names[] = "if\0" /* Parameter signature */ @@ -3717,10 +3870,18 @@ static const char SpriteParameterfSGIX_names[] = ""; #endif -#if defined(need_GL_EXT_histogram) -static const char GetMinmaxParameterivEXT_names[] = +#if defined(need_GL_NV_vertex_program) +static const char VertexAttrib4sNV_names[] = + "iiiii\0" /* Parameter signature */ + "glVertexAttrib4sNV\0" + ""; +#endif + +#if defined(need_GL_EXT_convolution) +static const char GetConvolutionParameterfv_names[] = "iip\0" /* Parameter signature */ - "glGetMinmaxParameterivEXT\0" + "glGetConvolutionParameterfv\0" + "glGetConvolutionParameterfvEXT\0" ""; #endif @@ -3731,9 +3892,10 @@ static const char VertexAttribs4dvNV_names[] = ""; #endif -#if defined(need_GL_ARB_vertex_program) +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) static const char VertexAttrib4dARB_names[] = "idddd\0" /* Parameter signature */ + "glVertexAttrib4d\0" "glVertexAttrib4dARB\0" ""; #endif @@ -3827,6 +3989,14 @@ static const char GetProgramLocalParameterdvARB_names[] = ""; #endif +#if defined(need_GL_EXT_histogram) +static const char GetHistogramParameteriv_names[] = + "iip\0" /* Parameter signature */ + "glGetHistogramParameteriv\0" + "glGetHistogramParameterivEXT\0" + ""; +#endif + #if defined(need_GL_VERSION_1_3) static const char MultiTexCoord1iARB_names[] = "ii\0" /* Parameter signature */ @@ -3835,6 +4005,14 @@ static const char MultiTexCoord1iARB_names[] = ""; #endif +#if defined(need_GL_EXT_convolution) +static const char GetConvolutionFilter_names[] = + "iiip\0" /* Parameter signature */ + "glGetConvolutionFilter\0" + "glGetConvolutionFilterEXT\0" + ""; +#endif + #if defined(need_GL_ARB_vertex_program) static const char GetProgramivARB_names[] = "iip\0" /* Parameter signature */ @@ -3879,10 +4057,10 @@ static const char Binormal3dvEXT_names[] = ""; #endif -#if defined(need_GL_EXT_texture_object) -static const char AreTexturesResidentEXT_names[] = - "ipp\0" /* Parameter signature */ - "glAreTexturesResidentEXT\0" +#if defined(need_GL_NV_fence) +static const char FinishFenceNV_names[] = + "i\0" /* Parameter signature */ + "glFinishFenceNV\0" ""; #endif @@ -3893,9 +4071,10 @@ static const char GetFogFuncSGIS_names[] = ""; #endif -#if defined(need_GL_ARB_shader_objects) +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) static const char GetUniformLocationARB_names[] = "ip\0" /* Parameter signature */ + "glGetUniformLocation\0" "glGetUniformLocationARB\0" ""; #endif @@ -3915,13 +4094,21 @@ static const char CombinerInputNV_names[] = ""; #endif -#if defined(need_GL_ARB_vertex_program) +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) static const char VertexAttrib3sARB_names[] = "iiii\0" /* Parameter signature */ + "glVertexAttrib3s\0" "glVertexAttrib3sARB\0" ""; #endif +#if defined(need_GL_SUN_vertex) +static const char ReplacementCodeuiNormal3fVertex3fvSUN_names[] = + "ppp\0" /* Parameter signature */ + "glReplacementCodeuiNormal3fVertex3fvSUN\0" + ""; +#endif + #if defined(need_GL_ARB_vertex_program) static const char ProgramStringARB_names[] = "iiip\0" /* Parameter signature */ @@ -3936,6 +4123,13 @@ static const char TexCoord4fVertex4fvSUN_names[] = ""; #endif +#if defined(need_GL_NV_vertex_program) +static const char VertexAttrib3sNV_names[] = + "iiii\0" /* Parameter signature */ + "glVertexAttrib3sNV\0" + ""; +#endif + #if defined(need_GL_NV_vertex_program) static const char VertexAttrib1fNV_names[] = "if\0" /* Parameter signature */ @@ -3965,6 +4159,14 @@ static const char VertexWeightPointerEXT_names[] = ""; #endif +#if defined(need_GL_EXT_histogram) +static const char GetHistogram_names[] = + "iiiip\0" /* Parameter signature */ + "glGetHistogram\0" + "glGetHistogramEXT\0" + ""; +#endif + #if defined(need_GL_EXT_stencil_two_side) static const char ActiveStencilFaceEXT_names[] = "i\0" /* Parameter signature */ @@ -3972,9 +4174,10 @@ static const char ActiveStencilFaceEXT_names[] = ""; #endif -#if defined(need_GL_ARB_shader_objects) +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) static const char GetShaderSourceARB_names[] = "iipp\0" /* Parameter signature */ + "glGetShaderSource\0" "glGetShaderSourceARB\0" ""; #endif @@ -4089,9 +4292,10 @@ static const char WeightsvARB_names[] = ""; #endif -#if defined(need_GL_ARB_shader_objects) +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) static const char Uniform1fvARB_names[] = "iip\0" /* Parameter signature */ + "glUniform1fv\0" "glUniform1fvARB\0" ""; #endif @@ -4134,9 +4338,17 @@ static const char VertexAttribs3svNV_names[] = ""; #endif -#if defined(need_GL_ARB_vertex_program) +#if defined(need_GL_SUN_triangle_list) +static const char ReplacementCodeuivSUN_names[] = + "p\0" /* Parameter signature */ + "glReplacementCodeuivSUN\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) static const char EnableVertexAttribArrayARB_names[] = "i\0" /* Parameter signature */ + "glEnableVertexAttribArray\0" "glEnableVertexAttribArrayARB\0" ""; #endif @@ -4165,13 +4377,6 @@ static const char WindowPos3ivMESA_names[] = ""; #endif -#if defined(need_GL_NV_fence) -static const char FinishFenceNV_names[] = - "i\0" /* Parameter signature */ - "glFinishFenceNV\0" - ""; -#endif - #if defined(need_GL_VERSION_1_5) || defined(need_GL_ARB_vertex_buffer_object) static const char IsBufferARB_names[] = "i\0" /* Parameter signature */ @@ -4201,10 +4406,10 @@ static const char Tangent3bvEXT_names[] = ""; #endif -#if defined(need_GL_SGIX_reference_plane) -static const char ReferencePlaneSGIX_names[] = - "p\0" /* Parameter signature */ - "glReferencePlaneSGIX\0" +#if defined(need_GL_VERSION_2_1) +static const char UniformMatrix3x4fv_names[] = + "iiip\0" /* Parameter signature */ + "glUniformMatrix3x4fv\0" ""; #endif @@ -4215,13 +4420,6 @@ static const char Binormal3fvEXT_names[] = ""; #endif -#if defined(need_GL_EXT_texture_object) -static const char IsTextureEXT_names[] = - "i\0" /* Parameter signature */ - "glIsTextureEXT\0" - ""; -#endif - #if defined(need_GL_INTEL_parallel_arrays) static const char TexCoordPointervINTEL_names[] = "iip\0" /* Parameter signature */ @@ -4297,9 +4495,10 @@ static const char BindProgramNV_names[] = ""; #endif -#if defined(need_GL_ARB_vertex_program) +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) static const char VertexAttrib4svARB_names[] = "ip\0" /* Parameter signature */ + "glVertexAttrib4sv\0" "glVertexAttrib4svARB\0" ""; #endif @@ -4311,10 +4510,10 @@ static const char CreateDebugObjectMESA_names[] = ""; #endif -#if defined(need_GL_ARB_shader_objects) -static const char Uniform3fARB_names[] = - "ifff\0" /* Parameter signature */ - "glUniform3fARB\0" +#if defined(need_GL_VERSION_2_0) +static const char GetShaderiv_names[] = + "iip\0" /* Parameter signature */ + "glGetShaderiv\0" ""; #endif @@ -4370,9 +4569,17 @@ static const char GetFinalCombinerInputParameterfvNV_names[] = ""; #endif -#if defined(need_GL_ARB_vertex_program) +#if defined(need_GL_ATI_fragment_shader) +static const char ColorFragmentOp3ATI_names[] = + "iiiiiiiiiiiii\0" /* Parameter signature */ + "glColorFragmentOp3ATI\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) static const char VertexAttrib2svARB_names[] = "ip\0" /* Parameter signature */ + "glVertexAttrib2sv\0" "glVertexAttrib2svARB\0" ""; #endif @@ -4415,9 +4622,10 @@ static const char PollInstrumentsSGIX_names[] = ""; #endif -#if defined(need_GL_ARB_vertex_program) +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) static const char VertexAttrib4NubvARB_names[] = "ip\0" /* Parameter signature */ + "glVertexAttrib4Nubv\0" "glVertexAttrib4NubvARB\0" ""; #endif @@ -4522,9 +4730,10 @@ static const char WeightuivARB_names[] = ""; #endif -#if defined(need_GL_ARB_vertex_program) +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) static const char VertexAttrib2sARB_names[] = "iii\0" /* Parameter signature */ + "glVertexAttrib2s\0" "glVertexAttrib2sARB\0" ""; #endif @@ -4572,9 +4781,25 @@ static const char EdgeFlagPointerListIBM_names[] = ""; #endif -#if defined(need_GL_ARB_vertex_program) +#if defined(need_GL_VERSION_2_1) +static const char UniformMatrix3x2fv_names[] = + "iiip\0" /* Parameter signature */ + "glUniformMatrix3x2fv\0" + ""; +#endif + +#if defined(need_GL_EXT_histogram) +static const char GetMinmaxParameterfv_names[] = + "iip\0" /* Parameter signature */ + "glGetMinmaxParameterfv\0" + "glGetMinmaxParameterfvEXT\0" + ""; +#endif + +#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) static const char VertexAttrib1fvARB_names[] = "ip\0" /* Parameter signature */ + "glVertexAttrib1fv\0" "glVertexAttrib1fvARB\0" ""; #endif @@ -4681,9 +4906,9 @@ static const struct dri_extension_function GL_ARB_draw_buffers_functions[] = { static const struct dri_extension_function GL_ARB_matrix_palette_functions[] = { { MatrixIndexusvARB_names, MatrixIndexusvARB_remap_index, -1 }, { MatrixIndexuivARB_names, MatrixIndexuivARB_remap_index, -1 }, + { MatrixIndexPointerARB_names, MatrixIndexPointerARB_remap_index, -1 }, { CurrentPaletteMatrixARB_names, CurrentPaletteMatrixARB_remap_index, -1 }, { MatrixIndexubvARB_names, MatrixIndexubvARB_remap_index, -1 }, - { MatrixIndexPointerARB_names, MatrixIndexPointerARB_remap_index, -1 }, { NULL, 0, 0 } }; #endif @@ -4736,26 +4961,26 @@ static const struct dri_extension_function GL_ARB_shader_objects_functions[] = { { GetUniformivARB_names, GetUniformivARB_remap_index, -1 }, { Uniform2fvARB_names, Uniform2fvARB_remap_index, -1 }, { DeleteObjectARB_names, DeleteObjectARB_remap_index, -1 }, - { UseProgramObjectARB_names, UseProgramObjectARB_remap_index, -1 }, + { ValidateProgramARB_names, ValidateProgramARB_remap_index, -1 }, { Uniform3ivARB_names, Uniform3ivARB_remap_index, -1 }, { CompileShaderARB_names, CompileShaderARB_remap_index, -1 }, + { Uniform3fARB_names, Uniform3fARB_remap_index, -1 }, { Uniform4fARB_names, Uniform4fARB_remap_index, -1 }, { LinkProgramARB_names, LinkProgramARB_remap_index, -1 }, { ShaderSourceARB_names, ShaderSourceARB_remap_index, -1 }, { Uniform4ivARB_names, Uniform4ivARB_remap_index, -1 }, { Uniform1ivARB_names, Uniform1ivARB_remap_index, -1 }, - { ValidateProgramARB_names, ValidateProgramARB_remap_index, -1 }, { Uniform1iARB_names, Uniform1iARB_remap_index, -1 }, { Uniform4fvARB_names, Uniform4fvARB_remap_index, -1 }, { GetUniformfvARB_names, GetUniformfvARB_remap_index, -1 }, { DetachObjectARB_names, DetachObjectARB_remap_index, -1 }, { Uniform4iARB_names, Uniform4iARB_remap_index, -1 }, + { UseProgramObjectARB_names, UseProgramObjectARB_remap_index, -1 }, { Uniform2iARB_names, Uniform2iARB_remap_index, -1 }, { GetObjectParameterivARB_names, GetObjectParameterivARB_remap_index, -1 }, { GetUniformLocationARB_names, GetUniformLocationARB_remap_index, -1 }, { GetShaderSourceARB_names, GetShaderSourceARB_remap_index, -1 }, { Uniform1fvARB_names, Uniform1fvARB_remap_index, -1 }, - { Uniform3fARB_names, Uniform3fARB_remap_index, -1 }, { GetObjectParameterfvARB_names, GetObjectParameterfvARB_remap_index, -1 }, { GetInfoLogARB_names, GetInfoLogARB_remap_index, -1 }, { NULL, 0, 0 } @@ -4820,7 +5045,6 @@ static const struct dri_extension_function GL_ARB_vertex_buffer_object_functions #if defined(need_GL_ARB_vertex_program) static const struct dri_extension_function GL_ARB_vertex_program_functions[] = { - { ProgramEnvParameter4dvARB_names, ProgramEnvParameter4dvARB_remap_index, -1 }, { VertexAttrib2fARB_names, VertexAttrib2fARB_remap_index, -1 }, { VertexAttrib3fARB_names, VertexAttrib3fARB_remap_index, -1 }, { VertexAttrib1svARB_names, VertexAttrib1svARB_remap_index, -1 }, @@ -4840,7 +5064,6 @@ static const struct dri_extension_function GL_ARB_vertex_program_functions[] = { { VertexAttrib4fARB_names, VertexAttrib4fARB_remap_index, -1 }, { VertexAttrib4fvARB_names, VertexAttrib4fvARB_remap_index, -1 }, { ProgramLocalParameter4dvARB_names, ProgramLocalParameter4dvARB_remap_index, -1 }, - { VertexAttrib4usvARB_names, VertexAttrib4usvARB_remap_index, -1 }, { VertexAttrib2dARB_names, VertexAttrib2dARB_remap_index, -1 }, { VertexAttrib1dvARB_names, VertexAttrib1dvARB_remap_index, -1 }, { GetVertexAttribfvARB_names, GetVertexAttribfvARB_remap_index, -1 }, @@ -4855,6 +5078,7 @@ static const struct dri_extension_function GL_ARB_vertex_program_functions[] = { { IsProgramNV_names, IsProgramNV_remap_index, -1 }, { ProgramEnvParameter4dARB_names, ProgramEnvParameter4dARB_remap_index, -1 }, { VertexAttrib1dARB_names, VertexAttrib1dARB_remap_index, -1 }, + { VertexAttrib4usvARB_names, VertexAttrib4usvARB_remap_index, -1 }, { VertexAttrib3svARB_names, VertexAttrib3svARB_remap_index, -1 }, { GetVertexAttribdvARB_names, GetVertexAttribdvARB_remap_index, -1 }, { VertexAttrib4dvARB_names, VertexAttrib4dvARB_remap_index, -1 }, @@ -4863,6 +5087,7 @@ static const struct dri_extension_function GL_ARB_vertex_program_functions[] = { { VertexAttrib3fvARB_names, VertexAttrib3fvARB_remap_index, -1 }, { VertexAttrib4NubARB_names, VertexAttrib4NubARB_remap_index, -1 }, { GetProgramEnvParameterfvARB_names, GetProgramEnvParameterfvARB_remap_index, -1 }, + { ProgramEnvParameter4dvARB_names, ProgramEnvParameter4dvARB_remap_index, -1 }, { ProgramLocalParameter4fvARB_names, ProgramLocalParameter4fvARB_remap_index, -1 }, { DeleteProgramsNV_names, DeleteProgramsNV_remap_index, -1 }, { GetVertexAttribPointervNV_names, GetVertexAttribPointervNV_remap_index, -1 }, @@ -4933,7 +5158,6 @@ static const struct dri_extension_function GL_ATI_draw_buffers_functions[] = { #if defined(need_GL_ATI_fragment_shader) static const struct dri_extension_function GL_ATI_fragment_shader_functions[] = { - { ColorFragmentOp3ATI_names, ColorFragmentOp3ATI_remap_index, -1 }, { ColorFragmentOp2ATI_names, ColorFragmentOp2ATI_remap_index, -1 }, { DeleteFragmentShaderATI_names, DeleteFragmentShaderATI_remap_index, -1 }, { SetFragmentShaderConstantATI_names, SetFragmentShaderConstantATI_remap_index, -1 }, @@ -4945,6 +5169,7 @@ static const struct dri_extension_function GL_ATI_fragment_shader_functions[] = { PassTexCoordATI_names, PassTexCoordATI_remap_index, -1 }, { BeginFragmentShaderATI_names, BeginFragmentShaderATI_remap_index, -1 }, { BindFragmentShaderATI_names, BindFragmentShaderATI_remap_index, -1 }, + { ColorFragmentOp3ATI_names, ColorFragmentOp3ATI_remap_index, -1 }, { GenFragmentShadersATI_names, GenFragmentShadersATI_remap_index, -1 }, { EndFragmentShaderATI_names, EndFragmentShaderATI_remap_index, -1 }, { NULL, 0, 0 } @@ -4999,16 +5224,16 @@ static const struct dri_extension_function GL_EXT_compiled_vertex_array_function static const struct dri_extension_function GL_EXT_convolution_functions[] = { { ConvolutionFilter1D_names, -1, 348 }, { CopyConvolutionFilter1D_names, -1, 354 }, + { GetConvolutionParameteriv_names, -1, 358 }, { ConvolutionFilter2D_names, -1, 349 }, { ConvolutionParameteriv_names, -1, 353 }, { ConvolutionParameterfv_names, -1, 351 }, - { GetSeparableFilterEXT_names, GetSeparableFilterEXT_remap_index, -1 }, - { GetConvolutionFilterEXT_names, GetConvolutionFilterEXT_remap_index, -1 }, - { GetConvolutionParameterfvEXT_names, GetConvolutionParameterfvEXT_remap_index, -1 }, + { GetSeparableFilter_names, -1, 359 }, { SeparableFilter2D_names, -1, 360 }, { ConvolutionParameteri_names, -1, 352 }, { ConvolutionParameterf_names, -1, 350 }, - { GetConvolutionParameterivEXT_names, GetConvolutionParameterivEXT_remap_index, -1 }, + { GetConvolutionParameterfv_names, -1, 357 }, + { GetConvolutionFilter_names, -1, 356 }, { CopyConvolutionFilter2D_names, -1, 355 }, { NULL, 0, 0 } }; @@ -5016,11 +5241,11 @@ static const struct dri_extension_function GL_EXT_convolution_functions[] = { #if defined(need_GL_EXT_coordinate_frame) static const struct dri_extension_function GL_EXT_coordinate_frame_functions[] = { - { Binormal3fEXT_names, Binormal3fEXT_remap_index, -1 }, { TangentPointerEXT_names, TangentPointerEXT_remap_index, -1 }, { Binormal3ivEXT_names, Binormal3ivEXT_remap_index, -1 }, { Tangent3sEXT_names, Tangent3sEXT_remap_index, -1 }, { Tangent3fvEXT_names, Tangent3fvEXT_remap_index, -1 }, + { Binormal3fEXT_names, Binormal3fEXT_remap_index, -1 }, { Tangent3dvEXT_names, Tangent3dvEXT_remap_index, -1 }, { Binormal3bvEXT_names, Binormal3bvEXT_remap_index, -1 }, { Binormal3dEXT_names, Binormal3dEXT_remap_index, -1 }, @@ -5118,8 +5343,8 @@ static const struct dri_extension_function GL_EXT_framebuffer_object_functions[] #if defined(need_GL_EXT_gpu_program_parameters) static const struct dri_extension_function GL_EXT_gpu_program_parameters_functions[] = { - { ProgramLocalParameters4fvEXT_names, ProgramLocalParameters4fvEXT_remap_index, -1 }, { ProgramEnvParameters4fvEXT_names, ProgramEnvParameters4fvEXT_remap_index, -1 }, + { ProgramLocalParameters4fvEXT_names, ProgramLocalParameters4fvEXT_remap_index, -1 }, { NULL, 0, 0 } }; #endif @@ -5127,15 +5352,15 @@ static const struct dri_extension_function GL_EXT_gpu_program_parameters_functio #if defined(need_GL_EXT_histogram) static const struct dri_extension_function GL_EXT_histogram_functions[] = { { Histogram_names, -1, 367 }, - { GetHistogramParameterivEXT_names, GetHistogramParameterivEXT_remap_index, -1 }, { ResetHistogram_names, -1, 369 }, - { GetMinmaxEXT_names, GetMinmaxEXT_remap_index, -1 }, - { GetHistogramParameterfvEXT_names, GetHistogramParameterfvEXT_remap_index, -1 }, - { GetHistogramEXT_names, GetHistogramEXT_remap_index, -1 }, - { GetMinmaxParameterfvEXT_names, GetMinmaxParameterfvEXT_remap_index, -1 }, + { GetMinmax_names, -1, 364 }, + { GetHistogramParameterfv_names, -1, 362 }, + { GetMinmaxParameteriv_names, -1, 366 }, { ResetMinmax_names, -1, 370 }, - { GetMinmaxParameterivEXT_names, GetMinmaxParameterivEXT_remap_index, -1 }, + { GetHistogramParameteriv_names, -1, 363 }, + { GetHistogram_names, -1, 361 }, { Minmax_names, -1, 368 }, + { GetMinmaxParameterfv_names, -1, 365 }, { NULL, 0, 0 } }; #endif @@ -5181,10 +5406,10 @@ static const struct dri_extension_function GL_EXT_multisample_functions[] = { #if defined(need_GL_EXT_paletted_texture) static const struct dri_extension_function GL_EXT_paletted_texture_functions[] = { - { GetColorTableParameterfvSGI_names, GetColorTableParameterfvSGI_remap_index, -1 }, { ColorTable_names, -1, 339 }, - { GetColorTableParameterivSGI_names, GetColorTableParameterivSGI_remap_index, -1 }, - { GetColorTableSGI_names, GetColorTableSGI_remap_index, -1 }, + { GetColorTable_names, -1, 343 }, + { GetColorTableParameterfv_names, -1, 344 }, + { GetColorTableParameteriv_names, -1, 345 }, { NULL, 0, 0 } }; #endif @@ -5263,11 +5488,11 @@ static const struct dri_extension_function GL_EXT_texture3D_functions[] = { #if defined(need_GL_EXT_texture_object) static const struct dri_extension_function GL_EXT_texture_object_functions[] = { { PrioritizeTextures_names, -1, 331 }, + { AreTexturesResident_names, -1, 322 }, + { GenTextures_names, -1, 328 }, { DeleteTextures_names, -1, 327 }, - { GenTexturesEXT_names, GenTexturesEXT_remap_index, -1 }, - { AreTexturesResidentEXT_names, AreTexturesResidentEXT_remap_index, -1 }, + { IsTexture_names, -1, 330 }, { BindTexture_names, -1, 307 }, - { IsTextureEXT_names, IsTextureEXT_remap_index, -1 }, { NULL, 0, 0 } }; #endif @@ -5459,12 +5684,12 @@ static const struct dri_extension_function GL_NV_point_sprite_functions[] = { #if defined(need_GL_NV_register_combiners) static const struct dri_extension_function GL_NV_register_combiners_functions[] = { + { CombinerOutputNV_names, CombinerOutputNV_remap_index, -1 }, { CombinerParameterfvNV_names, CombinerParameterfvNV_remap_index, -1 }, { GetCombinerOutputParameterfvNV_names, GetCombinerOutputParameterfvNV_remap_index, -1 }, { FinalCombinerInputNV_names, FinalCombinerInputNV_remap_index, -1 }, { GetCombinerInputParameterfvNV_names, GetCombinerInputParameterfvNV_remap_index, -1 }, { GetCombinerOutputParameterivNV_names, GetCombinerOutputParameterivNV_remap_index, -1 }, - { CombinerOutputNV_names, CombinerOutputNV_remap_index, -1 }, { CombinerParameteriNV_names, CombinerParameteriNV_remap_index, -1 }, { GetFinalCombinerInputParameterivNV_names, GetFinalCombinerInputParameterivNV_remap_index, -1 }, { CombinerInputNV_names, CombinerInputNV_remap_index, -1 }, @@ -5498,6 +5723,7 @@ static const struct dri_extension_function GL_NV_vertex_program_functions[] = { { VertexAttrib4ubvNV_names, VertexAttrib4ubvNV_remap_index, -1 }, { VertexAttrib4svNV_names, VertexAttrib4svNV_remap_index, -1 }, { VertexAttribs1dvNV_names, VertexAttribs1dvNV_remap_index, -1 }, + { VertexAttrib1fvNV_names, VertexAttrib1fvNV_remap_index, -1 }, { ProgramParameter4dvNV_names, ProgramParameter4dvNV_remap_index, -1 }, { VertexAttrib4fNV_names, VertexAttrib4fNV_remap_index, -1 }, { VertexAttrib2dNV_names, VertexAttrib2dNV_remap_index, -1 }, @@ -5524,14 +5750,12 @@ static const struct dri_extension_function GL_NV_vertex_program_functions[] = { { VertexAttrib2svNV_names, VertexAttrib2svNV_remap_index, -1 }, { VertexAttribs1fvNV_names, VertexAttribs1fvNV_remap_index, -1 }, { IsProgramNV_names, IsProgramNV_remap_index, -1 }, - { VertexAttrib4sNV_names, VertexAttrib4sNV_remap_index, -1 }, { VertexAttrib2fNV_names, VertexAttrib2fNV_remap_index, -1 }, { RequestResidentProgramsNV_names, RequestResidentProgramsNV_remap_index, -1 }, { ExecuteProgramNV_names, ExecuteProgramNV_remap_index, -1 }, { VertexAttribPointerNV_names, VertexAttribPointerNV_remap_index, -1 }, { TrackMatrixNV_names, TrackMatrixNV_remap_index, -1 }, { GetProgramParameterdvNV_names, GetProgramParameterdvNV_remap_index, -1 }, - { VertexAttrib3sNV_names, VertexAttrib3sNV_remap_index, -1 }, { GetTrackMatrixivNV_names, GetTrackMatrixivNV_remap_index, -1 }, { VertexAttrib3svNV_names, VertexAttrib3svNV_remap_index, -1 }, { ProgramParameters4fvNV_names, ProgramParameters4fvNV_remap_index, -1 }, @@ -5539,12 +5763,13 @@ static const struct dri_extension_function GL_NV_vertex_program_functions[] = { { GetVertexAttribdvNV_names, GetVertexAttribdvNV_remap_index, -1 }, { VertexAttrib3fvNV_names, VertexAttrib3fvNV_remap_index, -1 }, { VertexAttribs2fvNV_names, VertexAttribs2fvNV_remap_index, -1 }, - { VertexAttrib1fvNV_names, VertexAttrib1fvNV_remap_index, -1 }, { DeleteProgramsNV_names, DeleteProgramsNV_remap_index, -1 }, { GetVertexAttribPointervNV_names, GetVertexAttribPointervNV_remap_index, -1 }, { GetProgramStringNV_names, GetProgramStringNV_remap_index, -1 }, + { VertexAttrib4sNV_names, VertexAttrib4sNV_remap_index, -1 }, { VertexAttribs4dvNV_names, VertexAttribs4dvNV_remap_index, -1 }, { ProgramParameters4dvNV_names, ProgramParameters4dvNV_remap_index, -1 }, + { VertexAttrib3sNV_names, VertexAttrib3sNV_remap_index, -1 }, { VertexAttrib1fNV_names, VertexAttrib1fNV_remap_index, -1 }, { VertexAttrib4dNV_names, VertexAttrib4dNV_remap_index, -1 }, { VertexAttribs4ubvNV_names, VertexAttribs4ubvNV_remap_index, -1 }, @@ -5768,13 +5993,13 @@ static const struct dri_extension_function GL_SGIX_tag_sample_buffer_functions[] #if defined(need_GL_SGI_color_table) static const struct dri_extension_function GL_SGI_color_table_functions[] = { - { GetColorTableParameterfvSGI_names, GetColorTableParameterfvSGI_remap_index, -1 }, { ColorTableParameteriv_names, -1, 341 }, { ColorTable_names, -1, 339 }, + { GetColorTable_names, -1, 343 }, { CopyColorTable_names, -1, 342 }, { ColorTableParameterfv_names, -1, 340 }, - { GetColorTableParameterivSGI_names, GetColorTableParameterivSGI_remap_index, -1 }, - { GetColorTableSGI_names, GetColorTableSGI_remap_index, -1 }, + { GetColorTableParameterfv_names, -1, 344 }, + { GetColorTableParameteriv_names, -1, 345 }, { NULL, 0, 0 } }; #endif @@ -5811,11 +6036,11 @@ static const struct dri_extension_function GL_SUN_mesh_array_functions[] = { static const struct dri_extension_function GL_SUN_triangle_list_functions[] = { { ReplacementCodeubSUN_names, ReplacementCodeubSUN_remap_index, -1 }, { ReplacementCodeubvSUN_names, ReplacementCodeubvSUN_remap_index, -1 }, - { ReplacementCodeuivSUN_names, ReplacementCodeuivSUN_remap_index, -1 }, { ReplacementCodeusvSUN_names, ReplacementCodeusvSUN_remap_index, -1 }, { ReplacementCodePointerSUN_names, ReplacementCodePointerSUN_remap_index, -1 }, { ReplacementCodeusSUN_names, ReplacementCodeusSUN_remap_index, -1 }, { ReplacementCodeuiSUN_names, ReplacementCodeuiSUN_remap_index, -1 }, + { ReplacementCodeuivSUN_names, ReplacementCodeuivSUN_remap_index, -1 }, { NULL, 0, 0 } }; #endif @@ -5837,7 +6062,6 @@ static const struct dri_extension_function GL_SUN_vertex_functions[] = { { ReplacementCodeuiTexCoord2fVertex3fSUN_names, ReplacementCodeuiTexCoord2fVertex3fSUN_remap_index, -1 }, { TexCoord2fNormal3fVertex3fSUN_names, TexCoord2fNormal3fVertex3fSUN_remap_index, -1 }, { Color3fVertex3fSUN_names, Color3fVertex3fSUN_remap_index, -1 }, - { ReplacementCodeuiNormal3fVertex3fvSUN_names, ReplacementCodeuiNormal3fVertex3fvSUN_remap_index, -1 }, { Color3fVertex3fvSUN_names, Color3fVertex3fvSUN_remap_index, -1 }, { Color4fNormal3fVertex3fvSUN_names, Color4fNormal3fVertex3fvSUN_remap_index, -1 }, { ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN_names, ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN_remap_index, -1 }, @@ -5848,18 +6072,19 @@ static const struct dri_extension_function GL_SUN_vertex_functions[] = { { Color4ubVertex2fvSUN_names, Color4ubVertex2fvSUN_remap_index, -1 }, { Normal3fVertex3fSUN_names, Normal3fVertex3fSUN_remap_index, -1 }, { ReplacementCodeuiColor4fNormal3fVertex3fSUN_names, ReplacementCodeuiColor4fNormal3fVertex3fSUN_remap_index, -1 }, + { TexCoord2fColor4fNormal3fVertex3fvSUN_names, TexCoord2fColor4fNormal3fVertex3fvSUN_remap_index, -1 }, { TexCoord2fVertex3fvSUN_names, TexCoord2fVertex3fvSUN_remap_index, -1 }, { Color4ubVertex2fSUN_names, Color4ubVertex2fSUN_remap_index, -1 }, { ReplacementCodeuiColor4ubVertex3fSUN_names, ReplacementCodeuiColor4ubVertex3fSUN_remap_index, -1 }, { TexCoord2fColor4ubVertex3fSUN_names, TexCoord2fColor4ubVertex3fSUN_remap_index, -1 }, { Normal3fVertex3fvSUN_names, Normal3fVertex3fvSUN_remap_index, -1 }, { Color4fNormal3fVertex3fSUN_names, Color4fNormal3fVertex3fSUN_remap_index, -1 }, - { TexCoord2fColor4fNormal3fVertex3fvSUN_names, TexCoord2fColor4fNormal3fVertex3fvSUN_remap_index, -1 }, { ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN_names, ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN_remap_index, -1 }, { ReplacementCodeuiColor4ubVertex3fvSUN_names, ReplacementCodeuiColor4ubVertex3fvSUN_remap_index, -1 }, { ReplacementCodeuiColor3fVertex3fSUN_names, ReplacementCodeuiColor3fVertex3fSUN_remap_index, -1 }, { TexCoord4fVertex4fSUN_names, TexCoord4fVertex4fSUN_remap_index, -1 }, { TexCoord2fColor3fVertex3fvSUN_names, TexCoord2fColor3fVertex3fvSUN_remap_index, -1 }, + { ReplacementCodeuiNormal3fVertex3fvSUN_names, ReplacementCodeuiNormal3fVertex3fvSUN_remap_index, -1 }, { TexCoord4fVertex4fvSUN_names, TexCoord4fVertex4fvSUN_remap_index, -1 }, { ReplacementCodeuiVertex3fSUN_names, ReplacementCodeuiVertex3fSUN_remap_index, -1 }, { NULL, 0, 0 } @@ -5996,11 +6221,106 @@ static const struct dri_extension_function GL_VERSION_1_5_functions[] = { #if defined(need_GL_VERSION_2_0) static const struct dri_extension_function GL_VERSION_2_0_functions[] = { + { UniformMatrix3fvARB_names, UniformMatrix3fvARB_remap_index, -1 }, + { GetProgramiv_names, GetProgramiv_remap_index, -1 }, { BlendEquationSeparateEXT_names, BlendEquationSeparateEXT_remap_index, -1 }, + { AttachShader_names, AttachShader_remap_index, -1 }, + { VertexAttrib2fARB_names, VertexAttrib2fARB_remap_index, -1 }, + { VertexAttrib3fARB_names, VertexAttrib3fARB_remap_index, -1 }, + { Uniform2fARB_names, Uniform2fARB_remap_index, -1 }, + { VertexAttrib1svARB_names, VertexAttrib1svARB_remap_index, -1 }, + { Uniform2ivARB_names, Uniform2ivARB_remap_index, -1 }, + { UniformMatrix4fvARB_names, UniformMatrix4fvARB_remap_index, -1 }, + { VertexAttrib4NusvARB_names, VertexAttrib4NusvARB_remap_index, -1 }, + { DisableVertexAttribArrayARB_names, DisableVertexAttribArrayARB_remap_index, -1 }, { StencilMaskSeparate_names, StencilMaskSeparate_remap_index, -1 }, + { VertexAttrib1fARB_names, VertexAttrib1fARB_remap_index, -1 }, + { GetProgramInfoLog_names, GetProgramInfoLog_remap_index, -1 }, + { VertexAttrib4NbvARB_names, VertexAttrib4NbvARB_remap_index, -1 }, + { GetActiveAttribARB_names, GetActiveAttribARB_remap_index, -1 }, + { Uniform3iARB_names, Uniform3iARB_remap_index, -1 }, + { GetShaderInfoLog_names, GetShaderInfoLog_remap_index, -1 }, + { VertexAttrib1sARB_names, VertexAttrib1sARB_remap_index, -1 }, + { Uniform1fARB_names, Uniform1fARB_remap_index, -1 }, { StencilOpSeparate_names, StencilOpSeparate_remap_index, -1 }, + { UniformMatrix2fvARB_names, UniformMatrix2fvARB_remap_index, -1 }, + { VertexAttrib3dvARB_names, VertexAttrib3dvARB_remap_index, -1 }, + { Uniform3fvARB_names, Uniform3fvARB_remap_index, -1 }, + { GetVertexAttribivARB_names, GetVertexAttribivARB_remap_index, -1 }, + { CreateProgram_names, CreateProgram_remap_index, -1 }, { StencilFuncSeparate_names, StencilFuncSeparate_remap_index, -1 }, + { VertexAttrib3dARB_names, VertexAttrib3dARB_remap_index, -1 }, + { VertexAttrib4fARB_names, VertexAttrib4fARB_remap_index, -1 }, + { VertexAttrib4fvARB_names, VertexAttrib4fvARB_remap_index, -1 }, + { GetActiveUniformARB_names, GetActiveUniformARB_remap_index, -1 }, + { IsShader_names, IsShader_remap_index, -1 }, + { GetUniformivARB_names, GetUniformivARB_remap_index, -1 }, + { IsProgram_names, IsProgram_remap_index, -1 }, + { Uniform2fvARB_names, Uniform2fvARB_remap_index, -1 }, + { ValidateProgramARB_names, ValidateProgramARB_remap_index, -1 }, + { VertexAttrib2dARB_names, VertexAttrib2dARB_remap_index, -1 }, + { VertexAttrib1dvARB_names, VertexAttrib1dvARB_remap_index, -1 }, + { GetVertexAttribfvARB_names, GetVertexAttribfvARB_remap_index, -1 }, + { GetAttribLocationARB_names, GetAttribLocationARB_remap_index, -1 }, + { Uniform3ivARB_names, Uniform3ivARB_remap_index, -1 }, + { GetVertexAttribPointervARB_names, GetVertexAttribPointervARB_remap_index, -1 }, + { VertexAttrib4sARB_names, VertexAttrib4sARB_remap_index, -1 }, + { VertexAttrib2dvARB_names, VertexAttrib2dvARB_remap_index, -1 }, + { VertexAttrib2fvARB_names, VertexAttrib2fvARB_remap_index, -1 }, + { VertexAttrib4NivARB_names, VertexAttrib4NivARB_remap_index, -1 }, + { GetAttachedShaders_names, GetAttachedShaders_remap_index, -1 }, + { CompileShaderARB_names, CompileShaderARB_remap_index, -1 }, + { DeleteShader_names, DeleteShader_remap_index, -1 }, + { Uniform3fARB_names, Uniform3fARB_remap_index, -1 }, + { VertexAttrib4NuivARB_names, VertexAttrib4NuivARB_remap_index, -1 }, + { Uniform4fARB_names, Uniform4fARB_remap_index, -1 }, + { VertexAttrib1dARB_names, VertexAttrib1dARB_remap_index, -1 }, + { LinkProgramARB_names, LinkProgramARB_remap_index, -1 }, + { ShaderSourceARB_names, ShaderSourceARB_remap_index, -1 }, + { VertexAttrib3svARB_names, VertexAttrib3svARB_remap_index, -1 }, + { Uniform4ivARB_names, Uniform4ivARB_remap_index, -1 }, + { GetVertexAttribdvARB_names, GetVertexAttribdvARB_remap_index, -1 }, + { Uniform1ivARB_names, Uniform1ivARB_remap_index, -1 }, + { VertexAttrib4dvARB_names, VertexAttrib4dvARB_remap_index, -1 }, + { BindAttribLocationARB_names, BindAttribLocationARB_remap_index, -1 }, + { Uniform1iARB_names, Uniform1iARB_remap_index, -1 }, + { VertexAttribPointerARB_names, VertexAttribPointerARB_remap_index, -1 }, + { VertexAttrib4NsvARB_names, VertexAttrib4NsvARB_remap_index, -1 }, + { VertexAttrib3fvARB_names, VertexAttrib3fvARB_remap_index, -1 }, + { CreateShader_names, CreateShader_remap_index, -1 }, + { DetachShader_names, DetachShader_remap_index, -1 }, + { VertexAttrib4NubARB_names, VertexAttrib4NubARB_remap_index, -1 }, + { Uniform4fvARB_names, Uniform4fvARB_remap_index, -1 }, + { GetUniformfvARB_names, GetUniformfvARB_remap_index, -1 }, + { Uniform4iARB_names, Uniform4iARB_remap_index, -1 }, + { UseProgramObjectARB_names, UseProgramObjectARB_remap_index, -1 }, + { DeleteProgram_names, DeleteProgram_remap_index, -1 }, + { Uniform2iARB_names, Uniform2iARB_remap_index, -1 }, + { VertexAttrib4dARB_names, VertexAttrib4dARB_remap_index, -1 }, + { GetUniformLocationARB_names, GetUniformLocationARB_remap_index, -1 }, + { VertexAttrib3sARB_names, VertexAttrib3sARB_remap_index, -1 }, + { GetShaderSourceARB_names, GetShaderSourceARB_remap_index, -1 }, { DrawBuffersARB_names, DrawBuffersARB_remap_index, -1 }, + { Uniform1fvARB_names, Uniform1fvARB_remap_index, -1 }, + { EnableVertexAttribArrayARB_names, EnableVertexAttribArrayARB_remap_index, -1 }, + { VertexAttrib4svARB_names, VertexAttrib4svARB_remap_index, -1 }, + { GetShaderiv_names, GetShaderiv_remap_index, -1 }, + { VertexAttrib2svARB_names, VertexAttrib2svARB_remap_index, -1 }, + { VertexAttrib4NubvARB_names, VertexAttrib4NubvARB_remap_index, -1 }, + { VertexAttrib2sARB_names, VertexAttrib2sARB_remap_index, -1 }, + { VertexAttrib1fvARB_names, VertexAttrib1fvARB_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + +#if defined(need_GL_VERSION_2_1) +static const struct dri_extension_function GL_VERSION_2_1_functions[] = { + { UniformMatrix2x4fv_names, UniformMatrix2x4fv_remap_index, -1 }, + { UniformMatrix4x3fv_names, UniformMatrix4x3fv_remap_index, -1 }, + { UniformMatrix4x2fv_names, UniformMatrix4x2fv_remap_index, -1 }, + { UniformMatrix2x3fv_names, UniformMatrix2x3fv_remap_index, -1 }, + { UniformMatrix3x4fv_names, UniformMatrix3x4fv_remap_index, -1 }, + { UniformMatrix3x2fv_names, UniformMatrix3x2fv_remap_index, -1 }, { NULL, 0, 0 } }; #endif diff --git a/src/mesa/drivers/dri/common/utils.c b/src/mesa/drivers/dri/common/utils.c index 74ed299a628..6a189e72858 100644 --- a/src/mesa/drivers/dri/common/utils.c +++ b/src/mesa/drivers/dri/common/utils.c @@ -421,6 +421,19 @@ driCheckDriDdxDrmVersions2(const char * driver_name, +GLint +driIntersectArea( drm_clip_rect_t rect1, drm_clip_rect_t rect2 ) +{ + if (rect2.x1 > rect1.x1) rect1.x1 = rect2.x1; + if (rect2.x2 < rect1.x2) rect1.x2 = rect2.x2; + if (rect2.y1 > rect1.y1) rect1.y1 = rect2.y1; + if (rect2.y2 < rect1.y2) rect1.y2 = rect2.y2; + + if (rect1.x1 > rect1.x2 || rect1.y1 > rect1.y2) return 0; + + return (rect1.x2 - rect1.x1) * (rect1.y2 - rect1.y1); +} + GLboolean driClipRectToFramebuffer( const GLframebuffer *buffer, GLint *x, GLint *y, GLsizei *width, GLsizei *height ) diff --git a/src/mesa/drivers/dri/common/utils.h b/src/mesa/drivers/dri/common/utils.h index 26d178f7478..b2bab86e66c 100644 --- a/src/mesa/drivers/dri/common/utils.h +++ b/src/mesa/drivers/dri/common/utils.h @@ -106,6 +106,8 @@ extern GLboolean driCheckDriDdxDrmVersions3(const char * driver_name, const __DRIversion * ddxActual, const __DRIutilversion2 * ddxExpected, const __DRIversion * drmActual, const __DRIversion * drmExpected); +extern GLint driIntersectArea( drm_clip_rect_t rect1, drm_clip_rect_t rect2 ); + extern GLboolean driClipRectToFramebuffer( const GLframebuffer *buffer, GLint *x, GLint *y, GLsizei *width, GLsizei *height ); diff --git a/src/mesa/drivers/dri/common/vblank.c b/src/mesa/drivers/dri/common/vblank.c index eebe42d96a1..e7ed545f13c 100644 --- a/src/mesa/drivers/dri/common/vblank.c +++ b/src/mesa/drivers/dri/common/vblank.c @@ -208,20 +208,6 @@ GLuint driGetDefaultVBlankFlags( const driOptionCache *optionCache ) } -/****************************************************************************/ -/** - * Sets the default swap interval when the drawable is first bound to a - * direct rendering context. - */ - -void driDrawableInitVBlank( __DRIdrawablePrivate *priv, GLuint flags ) -{ - if ( priv->pdraw->swap_interval == (unsigned)-1 ) { - priv->pdraw->swap_interval = (flags & VBLANK_FLAG_THROTTLE) != 0 ? 1 : 0; - } -} - - /****************************************************************************/ /** * Wrapper to call \c drmWaitVBlank. The main purpose of this function is to @@ -260,6 +246,71 @@ static int do_wait( drmVBlank * vbl, GLuint * vbl_seq, int fd ) } +/****************************************************************************/ +/** + * Sets the default swap interval when the drawable is first bound to a + * direct rendering context. + */ + +void driDrawableInitVBlank( __DRIdrawablePrivate *priv, GLuint flags, + GLuint *vbl_seq ) +{ + if ( priv->pdraw->swap_interval == (unsigned)-1 ) { + /* Get current vertical blank sequence */ + drmVBlank vbl = { .request={ .type = DRM_VBLANK_RELATIVE, .sequence = 0 } }; + do_wait( &vbl, vbl_seq, priv->driScreenPriv->fd ); + + priv->pdraw->swap_interval = (flags & (VBLANK_FLAG_THROTTLE | + VBLANK_FLAG_SYNC)) != 0 ? 1 : 0; + } +} + + +/****************************************************************************/ +/** + * Returns the current swap interval of the given drawable. + */ + +unsigned +driGetVBlankInterval( const __DRIdrawablePrivate *priv, GLuint flags ) +{ + if ( (flags & VBLANK_FLAG_INTERVAL) != 0 ) { + /* this must have been initialized when the drawable was first bound + * to a direct rendering context. */ + assert ( priv->pdraw->swap_interval != (unsigned)-1 ); + + return priv->pdraw->swap_interval; + } + else if ( (flags & (VBLANK_FLAG_THROTTLE | VBLANK_FLAG_SYNC)) != 0 ) { + return 1; + } + else { + return 0; + } +} + + +/****************************************************************************/ +/** + * Returns the current vertical blank sequence number of the given drawable. + */ + +void +driGetCurrentVBlank( const __DRIdrawablePrivate *priv, GLuint flags, + GLuint *vbl_seq ) +{ + drmVBlank vbl; + + vbl.request.type = DRM_VBLANK_RELATIVE; + if ( flags & VBLANK_FLAG_SECONDARY ) { + vbl.request.type |= DRM_VBLANK_SECONDARY; + } + vbl.request.sequence = 0; + + (void) do_wait( &vbl, vbl_seq, priv->driScreenPriv->fd ); +} + + /****************************************************************************/ /** * Waits for the vertical blank for use with glXSwapBuffers. @@ -282,7 +333,7 @@ driWaitForVBlank( const __DRIdrawablePrivate *priv, GLuint * vbl_seq, unsigned original_seq; unsigned deadline; unsigned interval; - + unsigned diff; *missed_deadline = GL_FALSE; if ( (flags & (VBLANK_FLAG_INTERVAL | @@ -304,44 +355,40 @@ driWaitForVBlank( const __DRIdrawablePrivate *priv, GLuint * vbl_seq, */ original_seq = *vbl_seq; + interval = driGetVBlankInterval(priv, flags); + deadline = original_seq + interval; - vbl.request.sequence = ((flags & VBLANK_FLAG_SYNC) != 0) ? 1 : 0; vbl.request.type = DRM_VBLANK_RELATIVE; - + if ( flags & VBLANK_FLAG_SECONDARY ) { + vbl.request.type |= DRM_VBLANK_SECONDARY; + } + vbl.request.sequence = ((flags & VBLANK_FLAG_SYNC) != 0) ? 1 : 0; + if ( do_wait( & vbl, vbl_seq, priv->driScreenPriv->fd ) != 0 ) { return -1; } - - vbl.request.type = DRM_VBLANK_ABSOLUTE; + diff = *vbl_seq - deadline; - if ( (flags & VBLANK_FLAG_INTERVAL) != 0 ) { - interval = priv->pdraw->swap_interval; - /* this must have been initialized when the drawable was first bound - * to a direct rendering context. */ - assert ( interval != (unsigned)-1 ); - } - else if ( (flags & VBLANK_FLAG_THROTTLE) != 0 ) { - interval = 1; - } - else { - interval = 0; + /* No need to wait again if we've already reached the target */ + if (diff <= (1 << 23)) { + *missed_deadline = (flags & VBLANK_FLAG_SYNC) ? (diff > 0) : GL_TRUE; + return 0; } + /* Wait until the target vertical blank. */ + vbl.request.type = DRM_VBLANK_ABSOLUTE; + if ( flags & VBLANK_FLAG_SECONDARY ) { + vbl.request.type |= DRM_VBLANK_SECONDARY; + } + vbl.request.sequence = deadline; - /* Wait until the next vertical blank. If the interval is zero, then - * the deadline is one vertical blank after the previous wait. - */ - - vbl.request.sequence = original_seq + interval; - if ( *vbl_seq < vbl.request.sequence ) { - if ( do_wait( & vbl, vbl_seq, priv->driScreenPriv->fd ) != 0 ) { - return -1; - } + if ( do_wait( & vbl, vbl_seq, priv->driScreenPriv->fd ) != 0 ) { + return -1; } - deadline = original_seq + ((interval == 0) ? 1 : interval); - *missed_deadline = ( *vbl_seq > deadline ); + diff = *vbl_seq - deadline; + *missed_deadline = diff > 0 && diff <= (1 << 23); return 0; } diff --git a/src/mesa/drivers/dri/common/vblank.h b/src/mesa/drivers/dri/common/vblank.h index 3dc965def1a..ec83adc78dd 100644 --- a/src/mesa/drivers/dri/common/vblank.h +++ b/src/mesa/drivers/dri/common/vblank.h @@ -42,12 +42,19 @@ */ #define VBLANK_FLAG_NO_IRQ (1U << 7) /* DRM has no IRQ to wait on. */ +#define VBLANK_FLAG_SECONDARY (1U << 8) /* Wait for secondary vblank. + */ extern int driGetMSC32( __DRIscreenPrivate * priv, int64_t * count ); extern int driWaitForMSC32( __DRIdrawablePrivate *priv, int64_t target_msc, int64_t divisor, int64_t remainder, int64_t * msc ); extern GLuint driGetDefaultVBlankFlags( const driOptionCache *optionCache ); -extern void driDrawableInitVBlank ( __DRIdrawablePrivate *priv, GLuint flags ); +extern void driDrawableInitVBlank ( __DRIdrawablePrivate *priv, GLuint flags, + GLuint *vbl_seq ); +extern unsigned driGetVBlankInterval( const __DRIdrawablePrivate *priv, + GLuint flags ); +extern void driGetCurrentVBlank( const __DRIdrawablePrivate *priv, + GLuint flags, GLuint *vbl_seq ); extern int driWaitForVBlank( const __DRIdrawablePrivate *priv, GLuint * vbl_seq, GLuint flags, GLboolean * missed_deadline ); diff --git a/src/mesa/drivers/dri/common/xmlpool/options.h b/src/mesa/drivers/dri/common/xmlpool/options.h index a0d617c3444..5cef72867b1 100644 --- a/src/mesa/drivers/dri/common/xmlpool/options.h +++ b/src/mesa/drivers/dri/common/xmlpool/options.h @@ -88,6 +88,11 @@ DRI_CONF_SECTION_BEGIN \ DRI_CONF_DESC(nl,"Beeldkwaliteit") \ DRI_CONF_DESC(fr,"Qualité d'image") +#define DRI_CONF_EXCESS_MIPMAP(def) \ +DRI_CONF_OPT_BEGIN(excess_mipmap,bool,def) \ + DRI_CONF_DESC(en,"Enable extra mipmap level") \ +DRI_CONF_OPT_END + #define DRI_CONF_TEXTURE_DEPTH_FB 0 #define DRI_CONF_TEXTURE_DEPTH_32 1 #define DRI_CONF_TEXTURE_DEPTH_16 2 diff --git a/src/mesa/drivers/dri/common/xmlpool/t_options.h b/src/mesa/drivers/dri/common/xmlpool/t_options.h index 0330f7560ef..4df1916aad0 100644 --- a/src/mesa/drivers/dri/common/xmlpool/t_options.h +++ b/src/mesa/drivers/dri/common/xmlpool/t_options.h @@ -68,6 +68,11 @@ DRI_CONF_OPT_END DRI_CONF_SECTION_BEGIN \ DRI_CONF_DESC(en,gettext("Image Quality")) +#define DRI_CONF_EXCESS_MIPMAP(def) \ +DRI_CONF_OPT_BEGIN(excess_mipmap,bool,def) \ + DRI_CONF_DESC(en,"Enable extra mipmap level") \ +DRI_CONF_OPT_END + #define DRI_CONF_TEXTURE_DEPTH_FB 0 #define DRI_CONF_TEXTURE_DEPTH_32 1 #define DRI_CONF_TEXTURE_DEPTH_16 2 diff --git a/src/mesa/drivers/dri/fb/fb_dri.c b/src/mesa/drivers/dri/fb/fb_dri.c index 6bbe49021bb..d6ba23bc6e6 100644 --- a/src/mesa/drivers/dri/fb/fb_dri.c +++ b/src/mesa/drivers/dri/fb/fb_dri.c @@ -137,7 +137,6 @@ init_core_functions( struct dd_function_table *functions ) { functions->GetString = get_string; functions->UpdateState = update_state; - functions->ResizeBuffers = _mesa_resize_framebuffer; functions->GetBufferSize = get_buffer_size; functions->Viewport = viewport; diff --git a/src/mesa/drivers/dri/fb/fb_egl.c b/src/mesa/drivers/dri/fb/fb_egl.c index 1b38b26c42d..5c74b0b0f47 100644 --- a/src/mesa/drivers/dri/fb/fb_egl.c +++ b/src/mesa/drivers/dri/fb/fb_egl.c @@ -429,7 +429,6 @@ init_core_functions( struct dd_function_table *functions ) { functions->GetString = get_string; functions->UpdateState = update_state; - functions->ResizeBuffers = _mesa_resize_framebuffer; functions->GetBufferSize = get_buffer_size; functions->Viewport = viewport; diff --git a/src/mesa/drivers/dri/ffb/ffb_clear.c b/src/mesa/drivers/dri/ffb/ffb_clear.c index c63179149a7..e8dfcbe2543 100644 --- a/src/mesa/drivers/dri/ffb/ffb_clear.c +++ b/src/mesa/drivers/dri/ffb/ffb_clear.c @@ -123,16 +123,22 @@ CreatorComputePageFillFixups(struct ff_fixups *fixups, } static void -ffb_do_clear(ffbContextPtr fmesa, __DRIdrawablePrivate *dPriv, - GLboolean all, GLint cx, GLint cy, GLint cwidth, - GLint cheight) +ffb_do_clear(GLcontext *ctx, __DRIdrawablePrivate *dPriv) { + ffbContextPtr fmesa = FFB_CONTEXT(ctx); FFBDRIPtr gDRIPriv = (FFBDRIPtr) fmesa->driScreen->pDevPriv; ffb_fbcPtr ffb = fmesa->regs; drm_clip_rect_t *box = dPriv->pClipRects; int nc = dPriv->numClipRects; + GLint cx, cy, cw, ch; + + /* compute region after locking: */ + cx = ctx->DrawBuffer->_Xmin; + cy = ctx->DrawBuffer->_Ymin; + cw = ctx->DrawBuffer->_Xmax - cx; + ch = ctx->DrawBuffer->_Ymax - cy; - cy = dPriv->h - cy - cheight; + cy = dPriv->h - cy - ch; cx += dPriv->x; cy += dPriv->y; @@ -145,25 +151,6 @@ ffb_do_clear(ffbContextPtr fmesa, __DRIdrawablePrivate *dPriv, int paligned_h, paligned_w = 0; int extra_work; - if (!all) { - if (x < cx) { - width -= cx - x; - x = cx; - } - if (y < cy) { - height -= cy - y; - y = cy; - } - if (x + width > cx + cwidth) - width = cx + cwidth - x; - if (y + height > cy + cheight) - height = cy + cheight - y; - if (width <= 0) - continue; - if (height <= 0) - continue; - } - if (BOX_AREA(width, height) < gDRIPriv->fastfill_small_area) { FFBFifo(fmesa, 5); ffb->drawop = FFB_DRAWOP_RECTANGLE; @@ -262,17 +249,14 @@ ffb_do_clear(ffbContextPtr fmesa, __DRIdrawablePrivate *dPriv, } } -void ffbDDClear(GLcontext *ctx, GLbitfield mask, GLboolean all, - GLint cx, GLint cy, GLint cwidth, GLint cheight) +void ffbDDClear(GLcontext *ctx, GLbitfield mask) { ffbContextPtr fmesa = FFB_CONTEXT(ctx); __DRIdrawablePrivate *dPriv = fmesa->driDrawable; unsigned int stcmask = BUFFER_BIT_STENCIL; #ifdef CLEAR_TRACE - fprintf(stderr, "ffbDDClear: mask(%08x) all(%d) " - "[x(%x)y(%x)w(%x)h(%x)]\n", - mask, (int) all, cx, cy, cwidth, cheight); + fprintf(stderr, "ffbDDClear: mask(%08x) \n", mask); #endif if (!(fmesa->ffb_sarea->flags & FFB_DRI_FFB2PLUS)) stcmask = 0; @@ -328,7 +312,7 @@ void ffbDDClear(GLcontext *ctx, GLbitfield mask, GLboolean all, if (mask & stcmask) ffb->consty = fmesa->clear_stencil; - ffb_do_clear(fmesa, dPriv, all, cx, cy, cwidth, cheight); + ffb_do_clear(ctx, dPriv); FFBFifo(fmesa, 6); ffb->ppc = fmesa->ppc; @@ -349,6 +333,6 @@ void ffbDDClear(GLcontext *ctx, GLbitfield mask, GLboolean all, } if (mask) - _swrast_Clear(ctx, mask, all, cx, cy, cwidth, cheight); + _swrast_Clear(ctx, mask); } diff --git a/src/mesa/drivers/dri/ffb/ffb_clear.h b/src/mesa/drivers/dri/ffb/ffb_clear.h index 4b707f19b2a..c3b8ce714b3 100644 --- a/src/mesa/drivers/dri/ffb/ffb_clear.h +++ b/src/mesa/drivers/dri/ffb/ffb_clear.h @@ -1,9 +1,6 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_clear.h,v 1.2 2002/02/22 21:32:58 dawes Exp $ */ - #ifndef _FFB_CLEAR_H #define _FFB_CLEAR_H -extern void ffbDDClear(GLcontext *ctx, GLbitfield mask, GLboolean all, - GLint cx, GLint cy, GLint cwidth, GLint cheight); +extern void ffbDDClear(GLcontext *ctx, GLbitfield mask); #endif /* !(_FFB_CLEAR_H) */ diff --git a/src/mesa/drivers/dri/ffb/ffb_xmesa.c b/src/mesa/drivers/dri/ffb/ffb_xmesa.c index ab2a6688bab..99256d76b6e 100644 --- a/src/mesa/drivers/dri/ffb/ffb_xmesa.c +++ b/src/mesa/drivers/dri/ffb/ffb_xmesa.c @@ -568,8 +568,7 @@ ffbMakeCurrent(__DRIcontextPrivate *driContextPriv, */ ffbDDClear(fmesa->glCtx, (BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT | - BUFFER_BIT_DEPTH | BUFFER_BIT_STENCIL), - 1, 0, 0, 0, 0); + BUFFER_BIT_DEPTH | BUFFER_BIT_STENCIL)); } } else { _mesa_make_current(NULL, NULL, NULL); diff --git a/src/mesa/drivers/dri/gamma/gamma_dd.c b/src/mesa/drivers/dri/gamma/gamma_dd.c index cca382d8926..63e3ab8fa5d 100644 --- a/src/mesa/drivers/dri/gamma/gamma_dd.c +++ b/src/mesa/drivers/dri/gamma/gamma_dd.c @@ -104,25 +104,6 @@ void gammaDDInitExtensions( GLcontext *ctx ) */ void gammaDDInitDriverFuncs( GLcontext *ctx ) { - ctx->Driver.GetBufferSize = gammaDDGetBufferSize; - ctx->Driver.ResizeBuffers = _swrast_alloc_buffers; - ctx->Driver.GetString = gammaDDGetString; - - ctx->Driver.Error = NULL; - - /* Pixel path fallbacks - */ - ctx->Driver.Accum = _swrast_Accum; - ctx->Driver.Bitmap = _swrast_Bitmap; - ctx->Driver.CopyPixels = _swrast_CopyPixels; - ctx->Driver.DrawPixels = _swrast_DrawPixels; - ctx->Driver.ReadPixels = _swrast_ReadPixels; - ctx->Driver.ResizeBuffers = _swrast_alloc_buffers; - - /* Swrast hooks for imaging extensions: - */ - ctx->Driver.CopyColorTable = _swrast_CopyColorTable; - ctx->Driver.CopyColorSubTable = _swrast_CopyColorSubTable; - ctx->Driver.CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D; - ctx->Driver.CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D; + ctx->Driver.GetBufferSize = gammaDDGetBufferSize; + ctx->Driver.GetString = gammaDDGetString; } diff --git a/src/mesa/drivers/dri/gamma/gamma_state.c b/src/mesa/drivers/dri/gamma/gamma_state.c index 026ff5efbff..08749bf5d39 100644 --- a/src/mesa/drivers/dri/gamma/gamma_state.c +++ b/src/mesa/drivers/dri/gamma/gamma_state.c @@ -205,8 +205,7 @@ static void gammaDDBlendFuncSeparate( GLcontext *ctx, * Buffer clear */ -static void gammaDDClear( GLcontext *ctx, GLbitfield mask, GLboolean all, - GLint cx, GLint cy, GLint cw, GLint ch ) +static void gammaDDClear( GLcontext *ctx, GLbitfield mask ) { gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); GLINTDRIPtr gDRIPriv = (GLINTDRIPtr)gmesa->driScreen->pDevPriv; @@ -410,7 +409,7 @@ static void gammaDDClear( GLcontext *ctx, GLbitfield mask, GLboolean all, #endif if ( mask ) - _swrast_Clear( ctx, mask, all, cx, cy, cw, ch ); + _swrast_Clear( ctx, mask ); } /* ============================================================= diff --git a/src/mesa/drivers/dri/i810/i810context.c b/src/mesa/drivers/dri/i810/i810context.c index 23373ef73b1..c0f4efd7a31 100644 --- a/src/mesa/drivers/dri/i810/i810context.c +++ b/src/mesa/drivers/dri/i810/i810context.c @@ -277,7 +277,6 @@ i810CreateContext( const __GLcontextModes *mesaVis, ctx->Const.PointSizeGranularity = 1.0; ctx->Driver.GetBufferSize = i810BufferSize; - ctx->Driver.ResizeBuffers = _mesa_resize_framebuffer; ctx->Driver.GetString = i810GetString; /* Who owns who? diff --git a/src/mesa/drivers/dri/i810/i810ioctl.c b/src/mesa/drivers/dri/i810/i810ioctl.c index ba651555a67..57c84193faf 100644 --- a/src/mesa/drivers/dri/i810/i810ioctl.c +++ b/src/mesa/drivers/dri/i810/i810ioctl.c @@ -48,8 +48,7 @@ static drmBufPtr i810_get_buffer_ioctl( i810ContextPtr imesa ) #define DEPTH_SCALE ((1<<16)-1) -static void i810Clear( GLcontext *ctx, GLbitfield mask, GLboolean all, - GLint cx, GLint cy, GLint cw, GLint ch ) +static void i810Clear( GLcontext *ctx, GLbitfield mask ) { i810ContextPtr imesa = I810_CONTEXT( ctx ); __DRIdrawablePrivate *dPriv = imesa->driDrawable; @@ -80,8 +79,16 @@ static void i810Clear( GLcontext *ctx, GLbitfield mask, GLboolean all, } if (clear.flags) { + GLint cx, cy, cw, ch; + LOCK_HARDWARE( imesa ); + /* compute region after locking: */ + cx = ctx->DrawBuffer->_Xmin; + cy = ctx->DrawBuffer->_Ymin; + cw = ctx->DrawBuffer->_Xmax - cx; + ch = ctx->DrawBuffer->_Ymax - cy; + /* flip top to bottom */ cy = dPriv->h-cy-ch; cx += imesa->drawX; @@ -94,7 +101,8 @@ static void i810Clear( GLcontext *ctx, GLbitfield mask, GLboolean all, drm_clip_rect_t *b = (drm_clip_rect_t *)imesa->sarea->boxes; int n = 0; - if (!all) { + if (cw != dPriv->w || ch != dPriv->h) { + /* clear sub region */ for ( ; i < nr ; i++) { GLint x = box[i].x1; GLint y = box[i].y1; @@ -116,6 +124,7 @@ static void i810Clear( GLcontext *ctx, GLbitfield mask, GLboolean all, n++; } } else { + /* clear whole buffer */ for ( ; i < nr ; i++) { *b++ = box[i]; n++; @@ -132,7 +141,7 @@ static void i810Clear( GLcontext *ctx, GLbitfield mask, GLboolean all, } if (mask) - _swrast_Clear( ctx, mask, all, cx, cy, cw, ch ); + _swrast_Clear( ctx, mask ); } diff --git a/src/mesa/drivers/dri/i810/i810state.c b/src/mesa/drivers/dri/i810/i810state.c index 680b818d286..6f9d4b5bd47 100644 --- a/src/mesa/drivers/dri/i810/i810state.c +++ b/src/mesa/drivers/dri/i810/i810state.c @@ -995,19 +995,4 @@ void i810InitStateFuncs(GLcontext *ctx) } else { ctx->Driver.LightModelfv = i810LightModelfv; } - - /* Pixel path fallbacks. - */ - ctx->Driver.Accum = _swrast_Accum; - ctx->Driver.Bitmap = _swrast_Bitmap; - ctx->Driver.CopyPixels = _swrast_CopyPixels; - ctx->Driver.DrawPixels = _swrast_DrawPixels; - ctx->Driver.ReadPixels = _swrast_ReadPixels; - - /* Swrast hooks for imaging extensions: - */ - ctx->Driver.CopyColorTable = _swrast_CopyColorTable; - ctx->Driver.CopyColorSubTable = _swrast_CopyColorSubTable; - ctx->Driver.CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D; - ctx->Driver.CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D; } diff --git a/src/mesa/drivers/dri/i915/i830_metaops.c b/src/mesa/drivers/dri/i915/i830_metaops.c index 17fde2f4804..dbf5f043498 100644 --- a/src/mesa/drivers/dri/i915/i830_metaops.c +++ b/src/mesa/drivers/dri/i915/i830_metaops.c @@ -395,13 +395,15 @@ static void draw_poly(i830ContextPtr i830, void i830ClearWithTris(intelContextPtr intel, GLbitfield mask, - GLboolean all, - GLint cx, GLint cy, GLint cw, GLint ch) + GLboolean allFoo, + GLint cxFoo, GLint cyFoo, GLint cwFoo, GLint chFoo) { i830ContextPtr i830 = I830_CONTEXT( intel ); __DRIdrawablePrivate *dPriv = intel->driDrawable; intelScreenPrivate *screen = intel->intelScreen; int x0, y0, x1, y1; + GLint cx, cy, cw, ch; + GLboolean all; INTEL_FIREVERTICES(intel); SET_STATE( i830, meta ); @@ -411,6 +413,14 @@ i830ClearWithTris(intelContextPtr intel, GLbitfield mask, LOCK_HARDWARE(intel); + /* get clear bounds after locking */ + cx = intel->ctx.DrawBuffer->_Xmin; + cy = intel->ctx.DrawBuffer->_Ymin; + cw = intel->ctx.DrawBuffer->_Xmax - cx; + ch = intel->ctx.DrawBuffer->_Ymax - cy; + all = (cw == intel->ctx.DrawBuffer->Width && + ch == intel->ctx.DrawBuffer->Height); + if(!all) { x0 = cx; y0 = cy; diff --git a/src/mesa/drivers/dri/i915/i830_state.c b/src/mesa/drivers/dri/i915/i830_state.c index ec9dca6231e..95125190108 100644 --- a/src/mesa/drivers/dri/i915/i830_state.c +++ b/src/mesa/drivers/dri/i915/i830_state.c @@ -225,7 +225,7 @@ static void i830EvalLogicOpBlendState(GLcontext *ctx) I830_STATECHANGE(i830, I830_UPLOAD_CTX); - if (ctx->Color._LogicOpEnabled) { + if (RGBA_LOGICOP_ENABLED(ctx)) { i830->state.Ctx[I830_CTXREG_ENABLES_1] &= ~(ENABLE_COLOR_BLEND | ENABLE_LOGIC_OP_MASK); i830->state.Ctx[I830_CTXREG_ENABLES_1] |= (DISABLE_COLOR_BLEND | diff --git a/src/mesa/drivers/dri/i915/i915_context.c b/src/mesa/drivers/dri/i915/i915_context.c index 8c99d0e1d67..2f78fd60b21 100644 --- a/src/mesa/drivers/dri/i915/i915_context.c +++ b/src/mesa/drivers/dri/i915/i915_context.c @@ -50,6 +50,7 @@ static const struct dri_extension i915_extensions[] = { "GL_ARB_depth_texture", NULL }, { "GL_ARB_fragment_program", NULL }, { "GL_ARB_shadow", NULL }, + { "GL_ARB_texture_env_crossbar", NULL }, { "GL_EXT_shadow_funcs", NULL }, /* ARB extn won't work if not enabled */ { "GL_SGIX_depth_texture", NULL }, @@ -165,6 +166,8 @@ GLboolean i915CreateContext( const __GLcontextModes *mesaVis, I915_MAX_TEX_INSN); ctx->Const.FragmentProgram.MaxNativeTexIndirections = I915_MAX_TEX_INDIRECT; ctx->Const.FragmentProgram.MaxNativeAddressRegs = 0; /* I don't think we have one */ + ctx->_MaintainTexEnvProgram = 1; + ctx->_UseTexEnvProgram = 1; driInitExtensions( ctx, i915_extensions, GL_FALSE ); diff --git a/src/mesa/drivers/dri/i915/i915_fragprog.c b/src/mesa/drivers/dri/i915/i915_fragprog.c index b0cc59c3063..ef14f3eef7c 100644 --- a/src/mesa/drivers/dri/i915/i915_fragprog.c +++ b/src/mesa/drivers/dri/i915/i915_fragprog.c @@ -29,6 +29,7 @@ #include "macros.h" #include "enums.h" +#include "tnl/tnl.h" #include "tnl/t_context.h" #include "intel_batchbuffer.h" @@ -38,6 +39,7 @@ #include "program_instruction.h" #include "program.h" +#include "programopt.h" @@ -122,6 +124,7 @@ static GLuint src_vector( struct i915_fragment_program *p, p, p->ctx->FragmentProgram.Parameters[source->Index]); break; + case PROGRAM_CONSTANT: case PROGRAM_STATE_VAR: case PROGRAM_NAMED_PARAM: src = i915_emit_param4fv( @@ -936,7 +939,15 @@ static void i915ProgramStringNotify( GLcontext *ctx, */ ctx->Driver.Enable( ctx, GL_FRAGMENT_PROGRAM_ARB, ctx->FragmentProgram.Enabled ); + + if (p->FragProg.FogOption) { + /* add extra instructions to do fog, then turn off FogOption field */ + _mesa_append_fog_code(ctx, &p->FragProg); + p->FragProg.FogOption = GL_NONE; + } } + + _tnl_program_string(ctx, target, prog); } @@ -955,6 +966,17 @@ void i915ValidateFragmentProgram( i915ContextPtr i915 ) GLuint s2 = S2_TEXCOORD_NONE; int i, offset = 0; + if (i915->current_program != p) + { + if (i915->current_program) { + i915->current_program->on_hardware = 0; + i915->current_program->params_uptodate = 0; + } + + i915->current_program = p; + } + + /* Important: */ VB->AttribPtr[VERT_ATTRIB_POS] = VB->NdcPtr; @@ -996,7 +1018,10 @@ void i915ValidateFragmentProgram( i915ContextPtr i915 ) EMIT_PAD( 1 ); } -#if 0 + /* XXX this was disabled, but enabling this code helped fix the Glean + * tfragprog1 fog tests. + */ +#if 1 if ((inputsRead & FRAG_BIT_FOGC) || i915->vertex_fog != I915_FOG_NONE) { EMIT_ATTR( _TNL_ATTRIB_FOG, EMIT_1F, S4_VFMT_FOG_PARAM, 4 ); } diff --git a/src/mesa/drivers/dri/i915/i915_metaops.c b/src/mesa/drivers/dri/i915/i915_metaops.c index 3ab5dbfd685..1be7ac4c485 100644 --- a/src/mesa/drivers/dri/i915/i915_metaops.c +++ b/src/mesa/drivers/dri/i915/i915_metaops.c @@ -493,14 +493,16 @@ static void draw_poly(i915ContextPtr i915, void -i915ClearWithTris(intelContextPtr intel, GLbitfield mask, - GLboolean all, - GLint cx, GLint cy, GLint cw, GLint ch) +i915ClearWithTris(intelContextPtr intel, GLbitfield buffers, + GLboolean allFoo, + GLint cxFoo, GLint cyFoo, GLint cwFoo, GLint chFoo) { i915ContextPtr i915 = I915_CONTEXT( intel ); __DRIdrawablePrivate *dPriv = intel->driDrawable; intelScreenPrivate *screen = intel->intelScreen; int x0, y0, x1, y1; + GLint cx, cy, cw, ch; + GLboolean all; SET_STATE( i915, meta ); set_initial_state( i915 ); @@ -509,6 +511,14 @@ i915ClearWithTris(intelContextPtr intel, GLbitfield mask, LOCK_HARDWARE(intel); + /* get clear bounds after locking */ + cx = intel->ctx.DrawBuffer->_Xmin; + cy = intel->ctx.DrawBuffer->_Ymin; + cw = intel->ctx.DrawBuffer->_Xmax - cx; + ch = intel->ctx.DrawBuffer->_Ymax - cy; + all = (cw == intel->ctx.DrawBuffer->Width && + ch == intel->ctx.DrawBuffer->Height); + if (!all) { x0 = cx; y0 = cy; @@ -525,7 +535,7 @@ i915ClearWithTris(intelContextPtr intel, GLbitfield mask, * The active cliprects will be applied as for any other geometry. */ - if (mask & BUFFER_BIT_FRONT_LEFT) { + if (buffers & BUFFER_BIT_FRONT_LEFT) { set_no_depth_stencil_write( i915 ); set_color_mask( i915, GL_TRUE ); set_draw_region( i915, &screen->front ); @@ -536,7 +546,7 @@ i915ClearWithTris(intelContextPtr intel, GLbitfield mask, 0, 0, 0, 0); } - if (mask & BUFFER_BIT_BACK_LEFT) { + if (buffers & BUFFER_BIT_BACK_LEFT) { set_no_depth_stencil_write( i915 ); set_color_mask( i915, GL_TRUE ); set_draw_region( i915, &screen->back ); @@ -547,7 +557,7 @@ i915ClearWithTris(intelContextPtr intel, GLbitfield mask, 0, 0, 0, 0); } - if (mask & BUFFER_BIT_STENCIL) { + if (buffers & BUFFER_BIT_STENCIL) { set_stencil_replace( i915, intel->ctx.Stencil.WriteMask[0], intel->ctx.Stencil.Clear); diff --git a/src/mesa/drivers/dri/i915/i915_program.c b/src/mesa/drivers/dri/i915/i915_program.c index 0faadb4f1a7..9c13290d118 100644 --- a/src/mesa/drivers/dri/i915/i915_program.c +++ b/src/mesa/drivers/dri/i915/i915_program.c @@ -369,10 +369,7 @@ GLuint i915_emit_param4fv( struct i915_fragment_program *p, void i915_program_error( struct i915_fragment_program *p, const char *msg ) { - /* XXX we shouldn't print anything to stdout, record GL error or - * call _mesa_problem() - */ - fprintf(stderr, "%s\n", msg); + _mesa_problem(NULL, "i915_program_error: %s", msg); p->error = 1; } diff --git a/src/mesa/drivers/dri/i915/i915_state.c b/src/mesa/drivers/dri/i915/i915_state.c index db5bb9ddc78..3cec6a2ddfc 100644 --- a/src/mesa/drivers/dri/i915/i915_state.c +++ b/src/mesa/drivers/dri/i915/i915_state.c @@ -141,7 +141,7 @@ static void i915EvalLogicOpBlendState(GLcontext *ctx) I915_STATECHANGE(i915, I915_UPLOAD_CTX); - if (ctx->Color._LogicOpEnabled) { + if (RGBA_LOGICOP_ENABLED(ctx)) { i915->state.Ctx[I915_CTXREG_LIS5] |= S5_LOGICOP_ENABLE; i915->state.Ctx[I915_CTXREG_LIS6] &= ~S6_CBUF_BLEND_ENABLE; } else { diff --git a/src/mesa/drivers/dri/i915/i915_texprog.c b/src/mesa/drivers/dri/i915/i915_texprog.c index 4fbce34ba21..f6a8b0205a6 100644 --- a/src/mesa/drivers/dri/i915/i915_texprog.c +++ b/src/mesa/drivers/dri/i915/i915_texprog.c @@ -591,6 +591,11 @@ void i915ValidateTextureProgram( i915ContextPtr i915 ) intel->specoffset = 0; offset = 0; + if (i915->current_program) { + i915->current_program->on_hardware = 0; + i915->current_program->params_uptodate = 0; + } + if (i915->vertex_fog == I915_FOG_PIXEL) { EMIT_ATTR( _TNL_ATTRIB_POS, EMIT_4F_VIEWPORT, S4_VFMT_XYZW, 16 ); RENDERINPUTS_CLEAR( index_bitset, _TNL_ATTRIB_FOG ); diff --git a/src/mesa/drivers/dri/i915/i915_vtbl.c b/src/mesa/drivers/dri/i915/i915_vtbl.c index 9ec54de23c5..2936a0fb721 100644 --- a/src/mesa/drivers/dri/i915/i915_vtbl.c +++ b/src/mesa/drivers/dri/i915/i915_vtbl.c @@ -48,8 +48,10 @@ static void i915_render_start( intelContextPtr intel ) if (ctx->FragmentProgram._Active) i915ValidateFragmentProgram( i915 ); - else + else { + assert(!ctx->_MaintainTexEnvProgram); i915ValidateTextureProgram( i915 ); + } } diff --git a/src/mesa/drivers/dri/i915/intel_batchbuffer.c b/src/mesa/drivers/dri/i915/intel_batchbuffer.c index dd754c67d44..803b41b2567 100644 --- a/src/mesa/drivers/dri/i915/intel_batchbuffer.c +++ b/src/mesa/drivers/dri/i915/intel_batchbuffer.c @@ -368,6 +368,7 @@ void intelCopyBuffer( const __DRIdrawablePrivate *dPriv, const drm_clip_rect_t *rect) { intelContextPtr intel; + const intelScreenPrivate *intelScreen; GLboolean missed_target; int64_t ust; @@ -382,97 +383,134 @@ void intelCopyBuffer( const __DRIdrawablePrivate *dPriv, intelFlush( &intel->ctx ); - intelWaitForFrameCompletion( intel ); - LOCK_HARDWARE( intel ); + intelScreen = intel->intelScreen; + + if (!rect && !intel->swap_scheduled && intelScreen->drmMinor >= 6 && + !(intel->vblank_flags & VBLANK_FLAG_NO_IRQ) && + intelScreen->current_rotation == 0) { + unsigned int interval = driGetVBlankInterval(dPriv, intel->vblank_flags); + unsigned int target; + drm_i915_vblank_swap_t swap; + + swap.drawable = dPriv->hHWDrawable; + swap.seqtype = DRM_VBLANK_ABSOLUTE; + target = swap.sequence = intel->vbl_seq + interval; + + if (intel->vblank_flags & VBLANK_FLAG_SYNC) { + swap.seqtype |= DRM_VBLANK_NEXTONMISS; + } else if (interval == 0) { + goto noschedule; + } - if (!rect) - { - UNLOCK_HARDWARE( intel ); - driWaitForVBlank( dPriv, &intel->vbl_seq, intel->vblank_flags, & missed_target ); - LOCK_HARDWARE( intel ); - } - { - const intelScreenPrivate *intelScreen = intel->intelScreen; - const __DRIdrawablePrivate *dPriv = intel->driDrawable; - const int nbox = dPriv->numClipRects; - const drm_clip_rect_t *pbox = dPriv->pClipRects; - drm_clip_rect_t box; - const int cpp = intelScreen->cpp; - const int pitch = intelScreen->front.pitch; /* in bytes */ - int i; - GLuint CMD, BR13; - BATCH_LOCALS; - - switch(cpp) { - case 2: - BR13 = (pitch) | (0xCC << 16) | (1<<24); - CMD = XY_SRC_COPY_BLT_CMD; - break; - case 4: - BR13 = (pitch) | (0xCC << 16) | (1<<24) | (1<<25); - CMD = (XY_SRC_COPY_BLT_CMD | XY_SRC_COPY_BLT_WRITE_ALPHA | - XY_SRC_COPY_BLT_WRITE_RGB); - break; - default: - BR13 = (pitch) | (0xCC << 16) | (1<<24); - CMD = XY_SRC_COPY_BLT_CMD; - break; + if ( intel->vblank_flags & VBLANK_FLAG_SECONDARY ) { + swap.seqtype |= DRM_VBLANK_SECONDARY; } - - if (0) - intel_draw_performance_boxes( intel ); - for (i = 0 ; i < nbox; i++, pbox++) - { - if (pbox->x1 > pbox->x2 || - pbox->y1 > pbox->y2 || - pbox->x2 > intelScreen->width || - pbox->y2 > intelScreen->height) { - _mesa_warning(&intel->ctx, "Bad cliprect in intelCopyBuffer()"); - continue; - } + if (!drmCommandWriteRead(intel->driFd, DRM_I915_VBLANK_SWAP, &swap, + sizeof(swap))) { + intel->swap_scheduled = 1; + intel->vbl_seq = swap.sequence; + swap.sequence -= target; + missed_target = swap.sequence > 0 && swap.sequence <= (1 << 23); + } + } else { + intel->swap_scheduled = 0; + } +noschedule: - box = *pbox; + if (!intel->swap_scheduled) { + intelWaitForFrameCompletion( intel ); + LOCK_HARDWARE( intel ); - if (rect) - { - if (rect->x1 > box.x1) - box.x1 = rect->x1; - if (rect->y1 > box.y1) - box.y1 = rect->y1; - if (rect->x2 < box.x2) - box.x2 = rect->x2; - if (rect->y2 < box.y2) - box.y2 = rect->y2; - - if (box.x1 > box.x2 || box.y1 > box.y2) - continue; + if (!rect) + { + UNLOCK_HARDWARE( intel ); + driWaitForVBlank( dPriv, &intel->vbl_seq, intel->vblank_flags, & missed_target ); + LOCK_HARDWARE( intel ); + } + { + const intelScreenPrivate *intelScreen = intel->intelScreen; + const __DRIdrawablePrivate *dPriv = intel->driDrawable; + const int nbox = dPriv->numClipRects; + const drm_clip_rect_t *pbox = dPriv->pClipRects; + drm_clip_rect_t box; + const int cpp = intelScreen->cpp; + const int pitch = intelScreen->front.pitch; /* in bytes */ + int i; + GLuint CMD, BR13; + BATCH_LOCALS; + + switch(cpp) { + case 2: + BR13 = (pitch) | (0xCC << 16) | (1<<24); + CMD = XY_SRC_COPY_BLT_CMD; + break; + case 4: + BR13 = (pitch) | (0xCC << 16) | (1<<24) | (1<<25); + CMD = (XY_SRC_COPY_BLT_CMD | XY_SRC_COPY_BLT_WRITE_ALPHA | + XY_SRC_COPY_BLT_WRITE_RGB); + break; + default: + BR13 = (pitch) | (0xCC << 16) | (1<<24); + CMD = XY_SRC_COPY_BLT_CMD; + break; } + + if (0) + intel_draw_performance_boxes( intel ); - BEGIN_BATCH( 8); - OUT_BATCH( CMD ); - OUT_BATCH( BR13 ); - OUT_BATCH( (box.y1 << 16) | box.x1 ); - OUT_BATCH( (box.y2 << 16) | box.x2 ); + for (i = 0 ; i < nbox; i++, pbox++) + { + if (pbox->x1 > pbox->x2 || + pbox->y1 > pbox->y2 || + pbox->x2 > intelScreen->width || + pbox->y2 > intelScreen->height) { + _mesa_warning(&intel->ctx, "Bad cliprect in intelCopyBuffer()"); + continue; + } + + box = *pbox; + + if (rect) + { + if (rect->x1 > box.x1) + box.x1 = rect->x1; + if (rect->y1 > box.y1) + box.y1 = rect->y1; + if (rect->x2 < box.x2) + box.x2 = rect->x2; + if (rect->y2 < box.y2) + box.y2 = rect->y2; + + if (box.x1 > box.x2 || box.y1 > box.y2) + continue; + } + + BEGIN_BATCH( 8); + OUT_BATCH( CMD ); + OUT_BATCH( BR13 ); + OUT_BATCH( (box.y1 << 16) | box.x1 ); + OUT_BATCH( (box.y2 << 16) | box.x2 ); - if (intel->sarea->pf_current_page == 0) - OUT_BATCH( intelScreen->front.offset ); - else - OUT_BATCH( intelScreen->back.offset ); + if (intel->sarea->pf_current_page == 0) + OUT_BATCH( intelScreen->front.offset ); + else + OUT_BATCH( intelScreen->back.offset ); - OUT_BATCH( (box.y1 << 16) | box.x1 ); - OUT_BATCH( BR13 & 0xffff ); + OUT_BATCH( (box.y1 << 16) | box.x1 ); + OUT_BATCH( BR13 & 0xffff ); - if (intel->sarea->pf_current_page == 0) - OUT_BATCH( intelScreen->back.offset ); - else - OUT_BATCH( intelScreen->front.offset ); + if (intel->sarea->pf_current_page == 0) + OUT_BATCH( intelScreen->back.offset ); + else + OUT_BATCH( intelScreen->front.offset ); - ADVANCE_BATCH(); + ADVANCE_BATCH(); + } } + intelFlushBatchLocked( intel, GL_TRUE, GL_TRUE, GL_TRUE ); + UNLOCK_HARDWARE( intel ); } - intelFlushBatchLocked( intel, GL_TRUE, GL_TRUE, GL_TRUE ); - UNLOCK_HARDWARE( intel ); if (!rect) { @@ -583,13 +621,14 @@ void intelEmitCopyBlitLocked( intelContextPtr intel, -void intelClearWithBlit(GLcontext *ctx, GLbitfield flags, GLboolean all, - GLint cx1, GLint cy1, GLint cw, GLint ch) +void intelClearWithBlit(GLcontext *ctx, GLbitfield buffers, GLboolean allFoo, + GLint cx1Foo, GLint cy1Foo, GLint cwFoo, GLint chFoo) { intelContextPtr intel = INTEL_CONTEXT( ctx ); intelScreenPrivate *intelScreen = intel->intelScreen; GLuint clear_depth, clear_color; - GLint cx, cy; + GLint cx, cy, cw, ch; + GLboolean all; GLint pitch; GLint cpp = intelScreen->cpp; GLint i; @@ -599,16 +638,24 @@ void intelClearWithBlit(GLcontext *ctx, GLbitfield flags, GLboolean all, intelFlush( &intel->ctx ); LOCK_HARDWARE( intel ); + /* get clear bounds after locking */ + cx = intel->ctx.DrawBuffer->_Xmin; + cy = intel->ctx.DrawBuffer->_Ymin; + cw = intel->ctx.DrawBuffer->_Xmax - cx; + ch = intel->ctx.DrawBuffer->_Ymax - cy; + all = (cw == intel->ctx.DrawBuffer->Width && + ch == intel->ctx.DrawBuffer->Height); + pitch = intelScreen->front.pitch; clear_color = intel->ClearColor; clear_depth = 0; - if (flags & BUFFER_BIT_DEPTH) { + if (buffers & BUFFER_BIT_DEPTH) { clear_depth = (GLuint)(ctx->Depth.Clear * intel->ClearDepth); } - if (flags & BUFFER_BIT_STENCIL) { + if (buffers & BUFFER_BIT_STENCIL) { clear_depth |= (ctx->Stencil.Clear & 0xff) << 24; } @@ -623,8 +670,8 @@ void intelClearWithBlit(GLcontext *ctx, GLbitfield flags, GLboolean all, XY_COLOR_BLT_WRITE_ALPHA | XY_COLOR_BLT_WRITE_RGB); D_CMD = XY_COLOR_BLT_CMD; - if (flags & BUFFER_BIT_DEPTH) D_CMD |= XY_COLOR_BLT_WRITE_RGB; - if (flags & BUFFER_BIT_STENCIL) D_CMD |= XY_COLOR_BLT_WRITE_ALPHA; + if (buffers & BUFFER_BIT_DEPTH) D_CMD |= XY_COLOR_BLT_WRITE_RGB; + if (buffers & BUFFER_BIT_STENCIL) D_CMD |= XY_COLOR_BLT_WRITE_ALPHA; break; default: BR13 = (0xF0 << 16) | (pitch) | (1<<24); @@ -634,17 +681,17 @@ void intelClearWithBlit(GLcontext *ctx, GLbitfield flags, GLboolean all, { /* flip top to bottom */ - cy = intel->driDrawable->h-cy1-ch; - cx = cx1 + intel->drawX; + cy = intel->driDrawable->h - cy - ch; + cx = cx + intel->drawX; cy += intel->drawY; /* adjust for page flipping */ if ( intel->sarea->pf_current_page == 1 ) { - GLuint tmp = flags; + GLuint tmp = buffers; - flags &= ~(BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT); - if ( tmp & BUFFER_BIT_FRONT_LEFT ) flags |= BUFFER_BIT_BACK_LEFT; - if ( tmp & BUFFER_BIT_BACK_LEFT ) flags |= BUFFER_BIT_FRONT_LEFT; + buffers &= ~(BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT); + if ( tmp & BUFFER_BIT_FRONT_LEFT ) buffers |= BUFFER_BIT_BACK_LEFT; + if ( tmp & BUFFER_BIT_BACK_LEFT ) buffers |= BUFFER_BIT_FRONT_LEFT; } for (i = 0 ; i < intel->numClipRects ; i++) @@ -680,7 +727,7 @@ void intelClearWithBlit(GLcontext *ctx, GLbitfield flags, GLboolean all, b.y2 > intelScreen->height) continue; - if ( flags & BUFFER_BIT_FRONT_LEFT ) { + if ( buffers & BUFFER_BIT_FRONT_LEFT ) { BEGIN_BATCH( 6); OUT_BATCH( CMD ); OUT_BATCH( BR13 ); @@ -691,7 +738,7 @@ void intelClearWithBlit(GLcontext *ctx, GLbitfield flags, GLboolean all, ADVANCE_BATCH(); } - if ( flags & BUFFER_BIT_BACK_LEFT ) { + if ( buffers & BUFFER_BIT_BACK_LEFT ) { BEGIN_BATCH( 6); OUT_BATCH( CMD ); OUT_BATCH( BR13 ); @@ -702,7 +749,7 @@ void intelClearWithBlit(GLcontext *ctx, GLbitfield flags, GLboolean all, ADVANCE_BATCH(); } - if ( flags & (BUFFER_BIT_STENCIL | BUFFER_BIT_DEPTH) ) { + if ( buffers & (BUFFER_BIT_STENCIL | BUFFER_BIT_DEPTH) ) { BEGIN_BATCH( 6); OUT_BATCH( D_CMD ); OUT_BATCH( BR13 ); diff --git a/src/mesa/drivers/dri/i915/intel_context.c b/src/mesa/drivers/dri/i915/intel_context.c index 770b330d0a3..0a2e33ffd53 100644 --- a/src/mesa/drivers/dri/i915/intel_context.c +++ b/src/mesa/drivers/dri/i915/intel_context.c @@ -92,7 +92,7 @@ int prevLockLine; * Mesa's Driver Functions ***************************************/ -#define DRIVER_DATE "20050225" +#define DRIVER_DATE "20061017" const GLubyte *intelGetString( GLcontext *ctx, GLenum name ) { @@ -134,27 +134,6 @@ const GLubyte *intelGetString( GLcontext *ctx, GLenum name ) } } -static void intelBufferSize(GLframebuffer *buffer, - GLuint *width, GLuint *height) -{ - GET_CURRENT_CONTEXT(ctx); - intelContextPtr intel = INTEL_CONTEXT(ctx); - /* Need to lock to make sure the driDrawable is uptodate. This - * information is used to resize Mesa's software buffers, so it has - * to be correct. - */ - LOCK_HARDWARE(intel); - if (intel->driDrawable) { - *width = intel->driDrawable->w; - *height = intel->driDrawable->h; - } - else { - *width = 0; - *height = 0; - } - UNLOCK_HARDWARE(intel); -} - /** * Extension strings exported by the intel driver. @@ -263,14 +242,8 @@ void intelInitDriverFunctions( struct dd_function_table *functions ) functions->Clear = intelClear; functions->Flush = intelglFlush; functions->Finish = intelFinish; - functions->GetBufferSize = intelBufferSize; - functions->ResizeBuffers = _mesa_resize_framebuffer; functions->GetString = intelGetString; functions->UpdateState = intelInvalidateState; - functions->CopyColorTable = _swrast_CopyColorTable; - functions->CopyColorSubTable = _swrast_CopyColorSubTable; - functions->CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D; - functions->CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D; intelInitTextureFuncs( functions ); intelInitPixelFuncs( functions ); @@ -543,14 +516,14 @@ void intelSetBackClipRects( intelContextPtr intel ) void intelWindowMoved( intelContextPtr intel ) { __DRIdrawablePrivate *dPriv = intel->driDrawable; + GLframebuffer *drawFb = (GLframebuffer *) dPriv->driverPrivate; if (!intel->ctx.DrawBuffer) { intelSetFrontClipRects( intel ); } else { - driUpdateFramebufferSize(&intel->ctx, intel->driDrawable); - - switch (intel->ctx.DrawBuffer->_ColorDrawBufferMask[0]) { + driUpdateFramebufferSize(&intel->ctx, dPriv); + switch (drawFb->_ColorDrawBufferMask[0]) { case BUFFER_BIT_FRONT_LEFT: intelSetFrontClipRects( intel ); break; @@ -563,15 +536,47 @@ void intelWindowMoved( intelContextPtr intel ) } } - _mesa_resize_framebuffer(&intel->ctx, - (GLframebuffer*)dPriv->driverPrivate, - dPriv->w, dPriv->h); - + if (drawFb->Width != dPriv->w || drawFb->Height != dPriv->h) { + /* update Mesa's notion of framebuffer/window size */ + _mesa_resize_framebuffer(&intel->ctx, drawFb, dPriv->w, dPriv->h); + drawFb->Initialized = GL_TRUE; /* XXX remove someday */ + } + /* Set state we know depends on drawable parameters: */ { GLcontext *ctx = &intel->ctx; + if (intel->intelScreen->driScrnPriv->ddxMinor >= 7) { + drmI830Sarea *sarea = intel->sarea; + drm_clip_rect_t drw_rect = { .x1 = dPriv->x, .x2 = dPriv->x + dPriv->w, + .y1 = dPriv->y, .y2 = dPriv->y + dPriv->h }; + drm_clip_rect_t pipeA_rect = { .x1 = sarea->pipeA_x, + .x2 = sarea->pipeA_x + sarea->pipeA_w, + .y1 = sarea->pipeA_y, + .y2 = sarea->pipeA_y + sarea->pipeA_h }; + drm_clip_rect_t pipeB_rect = { .x1 = sarea->pipeB_x, + .x2 = sarea->pipeB_x + sarea->pipeB_w, + .y1 = sarea->pipeB_y, + .y2 = sarea->pipeB_y + sarea->pipeB_h }; + GLint areaA = driIntersectArea( drw_rect, pipeA_rect ); + GLint areaB = driIntersectArea( drw_rect, pipeB_rect ); + GLuint flags = intel->vblank_flags; + + if (areaB > areaA || (areaA > 0 && areaB > 0)) { + flags = intel->vblank_flags | VBLANK_FLAG_SECONDARY; + } else { + flags = intel->vblank_flags & ~VBLANK_FLAG_SECONDARY; + } + + if (flags != intel->vblank_flags) { + intel->vblank_flags = flags; + driGetCurrentVBlank(dPriv, intel->vblank_flags, &intel->vbl_seq); + } + } else { + intel->vblank_flags &= ~VBLANK_FLAG_SECONDARY; + } + ctx->Driver.Scissor( ctx, ctx->Scissor.X, ctx->Scissor.Y, ctx->Scissor.Width, ctx->Scissor.Height ); @@ -596,7 +601,8 @@ GLboolean intelMakeCurrent(__DRIcontextPrivate *driContextPriv, if ( intel->driDrawable != driDrawPriv ) { /* Shouldn't the readbuffer be stored also? */ - driDrawableInitVBlank( driDrawPriv, intel->vblank_flags ); + driDrawableInitVBlank( driDrawPriv, intel->vblank_flags, + &intel->vbl_seq ); intel->driDrawable = driDrawPriv; intelWindowMoved( intel ); diff --git a/src/mesa/drivers/dri/i915/intel_context.h b/src/mesa/drivers/dri/i915/intel_context.h index 0ca8ff268de..05195e76d65 100644 --- a/src/mesa/drivers/dri/i915/intel_context.h +++ b/src/mesa/drivers/dri/i915/intel_context.h @@ -34,6 +34,7 @@ #include "drm.h" #include "mm.h" #include "texmem.h" +#include "vblank.h" #include "intel_screen.h" #include "i915_drm.h" @@ -261,6 +262,8 @@ struct intel_context GLuint swap_count; GLuint swap_missed_count; + + GLuint swap_scheduled; }; @@ -321,6 +324,17 @@ do { \ char __ret=0; \ DEBUG_CHECK_LOCK(); \ assert(!(intel)->locked); \ + if ((intel)->swap_scheduled) { \ + drmVBlank vbl; \ + vbl.request.type = DRM_VBLANK_ABSOLUTE; \ + if ((intel)->vblank_flags & \ + VBLANK_FLAG_SECONDARY) { \ + vbl.request.type |= DRM_VBLANK_SECONDARY; \ + } \ + vbl.request.sequence = (intel)->vbl_seq; \ + drmWaitVBlank((intel)->driFd, &vbl); \ + (intel)->swap_scheduled = 0; \ + } \ DRM_CAS((intel)->driHwLock, (intel)->hHWContext, \ (DRM_LOCK_HELD|(intel)->hHWContext), __ret); \ if (__ret) \ diff --git a/src/mesa/drivers/dri/i915/intel_ioctl.c b/src/mesa/drivers/dri/i915/intel_ioctl.c index d8530367664..ede3b6378fe 100644 --- a/src/mesa/drivers/dri/i915/intel_ioctl.c +++ b/src/mesa/drivers/dri/i915/intel_ioctl.c @@ -375,8 +375,7 @@ void intelFinish( GLcontext *ctx ) } -void intelClear(GLcontext *ctx, GLbitfield mask, GLboolean all, - GLint cx, GLint cy, GLint cw, GLint ch) +void intelClear(GLcontext *ctx, GLbitfield mask) { intelContextPtr intel = INTEL_CONTEXT( ctx ); const GLuint colorMask = *((GLuint *) &ctx->Color.ColorMask); @@ -429,13 +428,13 @@ void intelClear(GLcontext *ctx, GLbitfield mask, GLboolean all, swrast_mask |= (mask & BUFFER_BIT_ACCUM); if (blit_mask) - intelClearWithBlit( ctx, blit_mask, all, cx, cy, cw, ch ); + intelClearWithBlit( ctx, blit_mask, 0, 0, 0, 0, 0); if (tri_mask) - intel->vtbl.clear_with_tris( intel, tri_mask, all, cx, cy, cw, ch); + intel->vtbl.clear_with_tris( intel, tri_mask, 0, 0, 0, 0, 0); if (swrast_mask) - _swrast_Clear( ctx, swrast_mask, all, cx, cy, cw, ch ); + _swrast_Clear( ctx, swrast_mask ); } diff --git a/src/mesa/drivers/dri/i915/intel_ioctl.h b/src/mesa/drivers/dri/i915/intel_ioctl.h index 099a7e1a44e..6ea47e462e1 100644 --- a/src/mesa/drivers/dri/i915/intel_ioctl.h +++ b/src/mesa/drivers/dri/i915/intel_ioctl.h @@ -32,8 +32,7 @@ extern void intelWaitAgeLocked( intelContextPtr intel, int age, GLboolean unlock ); -extern void intelClear(GLcontext *ctx, GLbitfield mask, GLboolean all, - GLint cx, GLint cy, GLint cw, GLint ch); +extern void intelClear(GLcontext *ctx, GLbitfield mask); extern void intelPageFlip( const __DRIdrawablePrivate *dpriv ); diff --git a/src/mesa/drivers/dri/i915/intel_pixel.c b/src/mesa/drivers/dri/i915/intel_pixel.c index 2af38541d9c..535cbfcb26e 100644 --- a/src/mesa/drivers/dri/i915/intel_pixel.c +++ b/src/mesa/drivers/dri/i915/intel_pixel.c @@ -494,18 +494,9 @@ intelCopyPixels( GLcontext *ctx, void intelInitPixelFuncs( struct dd_function_table *functions ) { - /* Pixel path fallbacks. - */ - functions->Accum = _swrast_Accum; - functions->Bitmap = _swrast_Bitmap; functions->CopyPixels = intelCopyPixels; - if (!getenv("INTEL_NO_BLITS")) { functions->ReadPixels = intelReadPixels; functions->DrawPixels = intelDrawPixels; } - else { - functions->ReadPixels = _swrast_ReadPixels; - functions->DrawPixels = _swrast_DrawPixels; - } } diff --git a/src/mesa/drivers/dri/i915/intel_tris.c b/src/mesa/drivers/dri/i915/intel_tris.c index cf1673b429a..b2787ee60ac 100644 --- a/src/mesa/drivers/dri/i915/intel_tris.c +++ b/src/mesa/drivers/dri/i915/intel_tris.c @@ -43,6 +43,12 @@ #include "intel_reg.h" #include "intel_span.h" +/* XXX we shouldn't include these headers in this file, but we need them + * for fallbackStrings, below. + */ +#include "i830_context.h" +#include "i915_context.h" + static void intelRenderPrimitive( GLcontext *ctx, GLenum prim ); static void intelRasterPrimitive( GLcontext *ctx, GLenum rprim, GLuint hwprim ); @@ -792,104 +798,123 @@ static void intelRasterPrimitive( GLcontext *ctx, GLenum rprim, GLuint hwprim ) } - /* - */ - static void intelRenderPrimitive( GLcontext *ctx, GLenum prim ) - { - intelContextPtr intel = INTEL_CONTEXT(ctx); - - if (0) - fprintf(stderr, "%s %s\n", __FUNCTION__, _mesa_lookup_enum_by_nr(prim)); - - /* Let some clipping routines know which primitive they're dealing - * with. - */ - intel->render_primitive = prim; - - /* Shortcircuit this when called from t_dd_rendertmp.h for unfilled - * triangles. The rasterized primitive will always be reset by - * lower level functions in that case, potentially pingponging the - * state: - */ - if (reduced_prim[prim] == GL_TRIANGLES && - (ctx->_TriangleCaps & DD_TRI_UNFILLED)) - return; - - /* Set some primitive-dependent state and Start? a new primitive. - */ - intelRasterPrimitive( ctx, reduced_prim[prim], hw_prim[prim] ); - } - - - /**********************************************************************/ - /* Transition to/from hardware rasterization. */ - /**********************************************************************/ - - static char *fallbackStrings[] = { - "Texture", - "Draw buffer", - "Read buffer", - "Color mask", - "Render mode", - "Stencil", - "Stipple", - "User disable" - }; - - - static char *getFallbackString(GLuint bit) - { - int i = 0; - while (bit > 1) { - i++; - bit >>= 1; - } - return fallbackStrings[i]; - } - - - - void intelFallback( intelContextPtr intel, GLuint bit, GLboolean mode ) - { - GLcontext *ctx = &intel->ctx; - TNLcontext *tnl = TNL_CONTEXT(ctx); - GLuint oldfallback = intel->Fallback; - - if (mode) { - intel->Fallback |= bit; - if (oldfallback == 0) { - intelFlush(ctx); - if (INTEL_DEBUG & DEBUG_FALLBACKS) - fprintf(stderr, "ENTER FALLBACK %x: %s\n", - bit, getFallbackString( bit )); - _swsetup_Wakeup( ctx ); - intel->RenderIndex = ~0; - } - } - else { - intel->Fallback &= ~bit; - if (oldfallback == bit) { - _swrast_flush( ctx ); - if (INTEL_DEBUG & DEBUG_FALLBACKS) - fprintf(stderr, "LEAVE FALLBACK %s\n", getFallbackString( bit )); - tnl->Driver.Render.Start = intelRenderStart; - tnl->Driver.Render.PrimitiveNotify = intelRenderPrimitive; - tnl->Driver.Render.Finish = intelRenderFinish; - tnl->Driver.Render.BuildVertices = _tnl_build_vertices; - tnl->Driver.Render.CopyPV = _tnl_copy_pv; - tnl->Driver.Render.Interp = _tnl_interp; - - _tnl_invalidate_vertex_state( ctx, ~0 ); - _tnl_invalidate_vertices( ctx, ~0 ); - _tnl_install_attrs( ctx, - intel->vertex_attrs, - intel->vertex_attr_count, - intel->ViewportMatrix.m, 0 ); - - intel->NewGLState |= _INTEL_NEW_RENDERSTATE; - } - } - } +/* + */ +static void intelRenderPrimitive( GLcontext *ctx, GLenum prim ) +{ + intelContextPtr intel = INTEL_CONTEXT(ctx); + + if (0) + fprintf(stderr, "%s %s\n", __FUNCTION__, _mesa_lookup_enum_by_nr(prim)); + + /* Let some clipping routines know which primitive they're dealing + * with. + */ + intel->render_primitive = prim; + + /* Shortcircuit this when called from t_dd_rendertmp.h for unfilled + * triangles. The rasterized primitive will always be reset by + * lower level functions in that case, potentially pingponging the + * state: + */ + if (reduced_prim[prim] == GL_TRIANGLES && + (ctx->_TriangleCaps & DD_TRI_UNFILLED)) + return; + + /* Set some primitive-dependent state and Start? a new primitive. + */ + intelRasterPrimitive( ctx, reduced_prim[prim], hw_prim[prim] ); +} + + +/**********************************************************************/ +/* Transition to/from hardware rasterization. */ +/**********************************************************************/ + +static struct { + GLuint bit; + const char *str; +} fallbackStrings[] = { + { INTEL_FALLBACK_DRAW_BUFFER, "Draw buffer" }, + { INTEL_FALLBACK_READ_BUFFER, "Read buffer" }, + { INTEL_FALLBACK_USER, "User" }, + { INTEL_FALLBACK_NO_BATCHBUFFER, "No Batchbuffer" }, + { INTEL_FALLBACK_NO_TEXMEM, "No Texmem" }, + { INTEL_FALLBACK_RENDERMODE, "Rendermode" }, + + { I830_FALLBACK_TEXTURE, "i830 texture" }, + { I830_FALLBACK_COLORMASK, "i830 colormask" }, + { I830_FALLBACK_STENCIL, "i830 stencil" }, + { I830_FALLBACK_STIPPLE, "i830 stipple" }, + { I830_FALLBACK_LOGICOP, "i830 logicop" }, + + { I915_FALLBACK_TEXTURE, "i915 texture" }, + { I915_FALLBACK_COLORMASK, "i915 colormask" }, + { I915_FALLBACK_STENCIL, "i915 stencil" }, + { I915_FALLBACK_STIPPLE, "i915 stipple" }, + { I915_FALLBACK_PROGRAM, "i915 program" }, + { I915_FALLBACK_LOGICOP, "i915 logicop" }, + { I915_FALLBACK_POLYGON_SMOOTH, "i915 polygon smooth" }, + { I915_FALLBACK_POINT_SMOOTH, "i915 point smooth" }, + + { 0, NULL } +}; + + +static const char * +getFallbackString(GLuint bit) +{ + int i; + for (i = 0; fallbackStrings[i].bit; i++) { + if (fallbackStrings[i].bit == bit) + return fallbackStrings[i].str; + } + return "unknown fallback bit"; +} + + +void intelFallback( intelContextPtr intel, GLuint bit, GLboolean mode ) +{ + GLcontext *ctx = &intel->ctx; + TNLcontext *tnl = TNL_CONTEXT(ctx); + GLuint oldfallback = intel->Fallback; + + if (mode) { + intel->Fallback |= bit; + if (oldfallback == 0) { + intelFlush(ctx); + if (INTEL_DEBUG & DEBUG_FALLBACKS) + fprintf(stderr, "ENTER FALLBACK 0x%x: %s\n", + bit, getFallbackString(bit)); + _swsetup_Wakeup( ctx ); + intel->RenderIndex = ~0; + } + } + else { + intel->Fallback &= ~bit; + if (oldfallback == bit) { + _swrast_flush( ctx ); + if (INTEL_DEBUG & DEBUG_FALLBACKS) + fprintf(stderr, "LEAVE FALLBACK 0x%x: %s\n", + bit, getFallbackString(bit)); + tnl->Driver.Render.Start = intelRenderStart; + tnl->Driver.Render.PrimitiveNotify = intelRenderPrimitive; + tnl->Driver.Render.Finish = intelRenderFinish; + tnl->Driver.Render.BuildVertices = _tnl_build_vertices; + tnl->Driver.Render.CopyPV = _tnl_copy_pv; + tnl->Driver.Render.Interp = _tnl_interp; + + _tnl_invalidate_vertex_state( ctx, ~0 ); + _tnl_invalidate_vertices( ctx, ~0 ); + _tnl_install_attrs( ctx, + intel->vertex_attrs, + intel->vertex_attr_count, + intel->ViewportMatrix.m, 0 ); + + intel->NewGLState |= _INTEL_NEW_RENDERSTATE; + } + } +} diff --git a/src/mesa/drivers/dri/i915/server/i830_common.h b/src/mesa/drivers/dri/i915/server/i830_common.h index 41b5cc3c01b..fb6ceaa52d4 100644 --- a/src/mesa/drivers/dri/i915/server/i830_common.h +++ b/src/mesa/drivers/dri/i915/server/i830_common.h @@ -112,6 +112,21 @@ typedef struct { int rotated_size; int rotated_pitch; int virtualX, virtualY; + + unsigned int front_tiled; + unsigned int back_tiled; + unsigned int depth_tiled; + unsigned int rotated_tiled; + unsigned int rotated2_tiled; + + int pipeA_x; + int pipeA_y; + int pipeA_w; + int pipeA_h; + int pipeB_x; + int pipeB_y; + int pipeB_w; + int pipeB_h; } drmI830Sarea; /* Flags for perf_boxes diff --git a/src/mesa/drivers/dri/i915tex/Makefile b/src/mesa/drivers/dri/i915tex/Makefile new file mode 100644 index 00000000000..94879d209f7 --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/Makefile @@ -0,0 +1,66 @@ + +TOP = ../../../../.. +include $(TOP)/configs/current + +LIBNAME = i915tex_dri.so + +MINIGLX_SOURCES = server/intel_dri.c + +DRIVER_SOURCES = \ + i830_context.c \ + i830_metaops.c \ + i830_state.c \ + i830_texblend.c \ + i830_tex.c \ + i830_texstate.c \ + i830_vtbl.c \ + intel_render.c \ + intel_regions.c \ + intel_buffer_objects.c \ + intel_batchbuffer.c \ + intel_mipmap_tree.c \ + i915_tex_layout.c \ + intel_tex_image.c \ + intel_tex_subimage.c \ + intel_tex_copy.c \ + intel_tex_validate.c \ + intel_tex_format.c \ + intel_tex.c \ + intel_pixel.c \ + intel_pixel_copy.c \ + intel_pixel_read.c \ + intel_pixel_draw.c \ + intel_buffers.c \ + intel_blit.c \ + i915_tex.c \ + i915_texstate.c \ + i915_context.c \ + i915_debug.c \ + i915_fragprog.c \ + i915_metaops.c \ + i915_program.c \ + i915_state.c \ + i915_vtbl.c \ + intel_context.c \ + intel_ioctl.c \ + intel_rotate.c \ + intel_screen.c \ + intel_span.c \ + intel_state.c \ + intel_tris.c \ + intel_fbo.c \ + intel_depthstencil.c \ + intel_batchpool.c + +C_SOURCES = \ + $(COMMON_SOURCES) \ + $(COMMON_BM_SOURCES) \ + $(DRIVER_SOURCES) + +ASM_SOURCES = + + + +include ../Makefile.template + +symlinks: diff --git a/src/mesa/drivers/dri/i915tex/i830_context.c b/src/mesa/drivers/dri/i915tex/i830_context.c new file mode 100644 index 00000000000..2ff8621c42f --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/i830_context.c @@ -0,0 +1,104 @@ +/************************************************************************** + * + * Copyright 2003 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. + * + **************************************************************************/ + +#include "i830_context.h" +#include "imports.h" +#include "texmem.h" +#include "intel_tex.h" +#include "tnl/tnl.h" +#include "tnl/t_vertex.h" +#include "tnl/t_context.h" +#include "utils.h" + +/*************************************** + * Mesa's Driver Functions + ***************************************/ + +static const struct dri_extension i830_extensions[] = { + {"GL_ARB_texture_env_crossbar", NULL}, + {NULL, NULL} +}; + + +static void +i830InitDriverFunctions(struct dd_function_table *functions) +{ + intelInitDriverFunctions(functions); + i830InitStateFuncs(functions); + i830InitTextureFuncs(functions); +} + + +GLboolean +i830CreateContext(const __GLcontextModes * mesaVis, + __DRIcontextPrivate * driContextPriv, + void *sharedContextPrivate) +{ + struct dd_function_table functions; + struct i830_context *i830 = CALLOC_STRUCT(i830_context); + struct intel_context *intel = &i830->intel; + GLcontext *ctx = &intel->ctx; + if (!i830) + return GL_FALSE; + + i830InitVtbl(i830); + i830InitDriverFunctions(&functions); + + if (!intelInitContext(intel, mesaVis, driContextPriv, + sharedContextPrivate, &functions)) { + FREE(i830); + return GL_FALSE; + } + + intel->ctx.Const.MaxTextureUnits = I830_TEX_UNITS; + intel->ctx.Const.MaxTextureImageUnits = I830_TEX_UNITS; + intel->ctx.Const.MaxTextureCoordUnits = I830_TEX_UNITS; + + /* Advertise the full hardware capabilities. The new memory + * manager should cope much better with overload situations: + */ + ctx->Const.MaxTextureLevels = 12; + ctx->Const.Max3DTextureLevels = 9; + ctx->Const.MaxCubeTextureLevels = 11; + ctx->Const.MaxTextureRectSize = (1 << 11); + ctx->Const.MaxTextureUnits = I830_TEX_UNITS; + + _tnl_init_vertices(ctx, ctx->Const.MaxArrayLockSize + 12, + 18 * sizeof(GLfloat)); + + intel->verts = TNL_CONTEXT(ctx)->clipspace.vertex_buf; + + driInitExtensions(ctx, i830_extensions, GL_FALSE); + + i830InitState(i830); + i830InitMetaFuncs(i830); + + _tnl_allow_vertex_fog(ctx, 1); + _tnl_allow_pixel_fog(ctx, 0); + + return GL_TRUE; +} diff --git a/src/mesa/drivers/dri/i915tex/i830_context.h b/src/mesa/drivers/dri/i915tex/i830_context.h new file mode 100644 index 00000000000..e5377b300aa --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/i830_context.h @@ -0,0 +1,208 @@ +/************************************************************************** + * + * Copyright 2003 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. + * + **************************************************************************/ + +#ifndef I830CONTEXT_INC +#define I830CONTEXT_INC + +#include "intel_context.h" + +#define I830_FALLBACK_TEXTURE 0x1000 +#define I830_FALLBACK_COLORMASK 0x2000 +#define I830_FALLBACK_STENCIL 0x4000 +#define I830_FALLBACK_STIPPLE 0x8000 +#define I830_FALLBACK_LOGICOP 0x10000 + +#define I830_UPLOAD_CTX 0x1 +#define I830_UPLOAD_BUFFERS 0x2 +#define I830_UPLOAD_STIPPLE 0x4 +#define I830_UPLOAD_INVARIENT 0x8 +#define I830_UPLOAD_TEX(i) (0x10<<(i)) +#define I830_UPLOAD_TEXBLEND(i) (0x100<<(i)) +#define I830_UPLOAD_TEX_ALL (0x0f0) +#define I830_UPLOAD_TEXBLEND_ALL (0xf00) + +/* State structure offsets - these will probably disappear. + */ +#define I830_DESTREG_CBUFADDR0 0 +#define I830_DESTREG_CBUFADDR1 1 +#define I830_DESTREG_DBUFADDR0 2 +#define I830_DESTREG_DBUFADDR1 3 +#define I830_DESTREG_DV0 4 +#define I830_DESTREG_DV1 5 +#define I830_DESTREG_SENABLE 6 +#define I830_DESTREG_SR0 7 +#define I830_DESTREG_SR1 8 +#define I830_DESTREG_SR2 9 +#define I830_DEST_SETUP_SIZE 10 + +#define I830_CTXREG_STATE1 0 +#define I830_CTXREG_STATE2 1 +#define I830_CTXREG_STATE3 2 +#define I830_CTXREG_STATE4 3 +#define I830_CTXREG_STATE5 4 +#define I830_CTXREG_IALPHAB 5 +#define I830_CTXREG_STENCILTST 6 +#define I830_CTXREG_ENABLES_1 7 +#define I830_CTXREG_ENABLES_2 8 +#define I830_CTXREG_AA 9 +#define I830_CTXREG_FOGCOLOR 10 +#define I830_CTXREG_BLENDCOLOR0 11 +#define I830_CTXREG_BLENDCOLOR1 12 +#define I830_CTXREG_VF 13 +#define I830_CTXREG_VF2 14 +#define I830_CTXREG_MCSB0 15 +#define I830_CTXREG_MCSB1 16 +#define I830_CTX_SETUP_SIZE 17 + +#define I830_STPREG_ST0 0 +#define I830_STPREG_ST1 1 +#define I830_STP_SETUP_SIZE 2 + +#define I830_TEXREG_TM0LI 0 /* load immediate 2 texture map n */ +#define I830_TEXREG_TM0S1 1 +#define I830_TEXREG_TM0S2 2 +#define I830_TEXREG_TM0S3 3 +#define I830_TEXREG_TM0S4 4 +#define I830_TEXREG_MCS 5 /* _3DSTATE_MAP_COORD_SETS */ +#define I830_TEXREG_CUBE 6 /* _3DSTATE_MAP_SUBE */ +#define I830_TEX_SETUP_SIZE 7 + +#define I830_TEXBLEND_SIZE 12 /* (4 args + op) * 2 + COLOR_FACTOR */ + +struct i830_texture_object +{ + struct intel_texture_object intel; + GLuint Setup[I830_TEX_SETUP_SIZE]; +}; + +#define I830_TEX_UNITS 4 + +struct i830_hw_state +{ + GLuint Ctx[I830_CTX_SETUP_SIZE]; + GLuint Buffer[I830_DEST_SETUP_SIZE]; + GLuint Stipple[I830_STP_SETUP_SIZE]; + GLuint Tex[I830_TEX_UNITS][I830_TEX_SETUP_SIZE]; + GLuint TexBlend[I830_TEX_UNITS][I830_TEXBLEND_SIZE]; + GLuint TexBlendWordsUsed[I830_TEX_UNITS]; + + struct intel_region *draw_region; + struct intel_region *depth_region; + + /* Regions aren't actually that appropriate here as the memory may + * be from a PBO or FBO. Just use the buffer id. Will have to do + * this for draw and depth for FBO's... + */ + struct _DriBufferObject *tex_buffer[I830_TEX_UNITS]; + GLuint tex_offset[I830_TEX_UNITS]; + + GLuint emitted; /* I810_UPLOAD_* */ + GLuint active; +}; + +struct i830_context +{ + struct intel_context intel; + + GLuint lodbias_tm0s3[MAX_TEXTURE_UNITS]; + DECLARE_RENDERINPUTS(last_index_bitset); + + struct i830_hw_state meta, initial, state, *current; +}; + + + + +#define I830_STATECHANGE(i830, flag) \ +do { \ + INTEL_FIREVERTICES( &i830->intel ); \ + i830->state.emitted &= ~flag; \ +} while (0) + +#define I830_ACTIVESTATE(i830, flag, mode) \ +do { \ + INTEL_FIREVERTICES( &i830->intel ); \ + if (mode) \ + i830->state.active |= flag; \ + else \ + i830->state.active &= ~flag; \ +} while (0) + +/* i830_vtbl.c + */ +extern void i830InitVtbl(struct i830_context *i830); + +/* i830_context.c + */ +extern GLboolean +i830CreateContext(const __GLcontextModes * mesaVis, + __DRIcontextPrivate * driContextPriv, + void *sharedContextPrivate); + +/* i830_tex.c, i830_texstate.c + */ +extern void i830UpdateTextureState(struct intel_context *intel); + +extern void i830InitTextureFuncs(struct dd_function_table *functions); + +/* i830_texblend.c + */ +extern GLuint i830SetTexEnvCombine(struct i830_context *i830, + const struct gl_tex_env_combine_state + *combine, GLint blendUnit, GLuint texel_op, + GLuint * state, const GLfloat * factor); + +extern void i830EmitTextureBlend(struct i830_context *i830); + + +/* i830_state.c + */ +extern void i830InitStateFuncs(struct dd_function_table *functions); + +extern void i830EmitState(struct i830_context *i830); + +extern void i830InitState(struct i830_context *i830); + +/* i830_metaops.c + */ +extern void i830InitMetaFuncs(struct i830_context *i830); + +extern void +i830RotateWindow(struct intel_context *intel, __DRIdrawablePrivate * dPriv, + GLuint srcBuf); + +/*====================================================================== + * Inline conversion functions. These are better-typed than the + * macros used previously: + */ +static INLINE struct i830_context * +i830_context(GLcontext * ctx) +{ + return (struct i830_context *) ctx; +} + +#endif diff --git a/src/mesa/drivers/dri/i915tex/i830_metaops.c b/src/mesa/drivers/dri/i915tex/i830_metaops.c new file mode 100644 index 00000000000..c90f5022229 --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/i830_metaops.c @@ -0,0 +1,485 @@ +/************************************************************************** + * + * Copyright 2003 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. + * + **************************************************************************/ + +#include "glheader.h" +#include "enums.h" +#include "mtypes.h" +#include "macros.h" +#include "utils.h" + +#include "intel_screen.h" +#include "intel_batchbuffer.h" +#include "intel_ioctl.h" +#include "intel_regions.h" + +#include "i830_context.h" +#include "i830_reg.h" + +/* A large amount of state doesn't need to be uploaded. + */ +#define ACTIVE (I830_UPLOAD_INVARIENT | \ + I830_UPLOAD_CTX | \ + I830_UPLOAD_BUFFERS | \ + I830_UPLOAD_STIPPLE | \ + I830_UPLOAD_TEXBLEND(0) | \ + I830_UPLOAD_TEX(0)) + + +#define SET_STATE( i830, STATE ) \ +do { \ + i830->current->emitted &= ~ACTIVE; \ + i830->current = &i830->STATE; \ + i830->current->emitted &= ~ACTIVE; \ +} while (0) + + +static void +set_no_stencil_write(struct intel_context *intel) +{ + struct i830_context *i830 = i830_context(&intel->ctx); + + /* ctx->Driver.Enable( ctx, GL_STENCIL_TEST, GL_FALSE ) + */ + i830->meta.Ctx[I830_CTXREG_ENABLES_1] &= ~ENABLE_STENCIL_TEST; + i830->meta.Ctx[I830_CTXREG_ENABLES_2] &= ~ENABLE_STENCIL_WRITE; + i830->meta.Ctx[I830_CTXREG_ENABLES_1] |= DISABLE_STENCIL_TEST; + i830->meta.Ctx[I830_CTXREG_ENABLES_2] |= DISABLE_STENCIL_WRITE; + + i830->meta.emitted &= ~I830_UPLOAD_CTX; +} + +static void +set_no_depth_write(struct intel_context *intel) +{ + struct i830_context *i830 = i830_context(&intel->ctx); + + /* ctx->Driver.Enable( ctx, GL_DEPTH_TEST, GL_FALSE ) + */ + i830->meta.Ctx[I830_CTXREG_ENABLES_1] &= ~ENABLE_DIS_DEPTH_TEST_MASK; + i830->meta.Ctx[I830_CTXREG_ENABLES_2] &= ~ENABLE_DIS_DEPTH_WRITE_MASK; + i830->meta.Ctx[I830_CTXREG_ENABLES_1] |= DISABLE_DEPTH_TEST; + i830->meta.Ctx[I830_CTXREG_ENABLES_2] |= DISABLE_DEPTH_WRITE; + + i830->meta.emitted &= ~I830_UPLOAD_CTX; +} + +/* Set depth unit to replace. + */ +static void +set_depth_replace(struct intel_context *intel) +{ + struct i830_context *i830 = i830_context(&intel->ctx); + + /* ctx->Driver.Enable( ctx, GL_DEPTH_TEST, GL_FALSE ) + * ctx->Driver.DepthMask( ctx, GL_TRUE ) + */ + i830->meta.Ctx[I830_CTXREG_ENABLES_1] &= ~ENABLE_DIS_DEPTH_TEST_MASK; + i830->meta.Ctx[I830_CTXREG_ENABLES_2] &= ~ENABLE_DIS_DEPTH_WRITE_MASK; + i830->meta.Ctx[I830_CTXREG_ENABLES_1] |= ENABLE_DEPTH_TEST; + i830->meta.Ctx[I830_CTXREG_ENABLES_2] |= ENABLE_DEPTH_WRITE; + + /* ctx->Driver.DepthFunc( ctx, GL_ALWAYS ) + */ + i830->meta.Ctx[I830_CTXREG_STATE3] &= ~DEPTH_TEST_FUNC_MASK; + i830->meta.Ctx[I830_CTXREG_STATE3] |= (ENABLE_DEPTH_TEST_FUNC | + DEPTH_TEST_FUNC + (COMPAREFUNC_ALWAYS)); + + i830->meta.emitted &= ~I830_UPLOAD_CTX; +} + + +/* Set stencil unit to replace always with the reference value. + */ +static void +set_stencil_replace(struct intel_context *intel, + GLuint s_mask, GLuint s_clear) +{ + struct i830_context *i830 = i830_context(&intel->ctx); + + /* ctx->Driver.Enable( ctx, GL_STENCIL_TEST, GL_TRUE ) + */ + i830->meta.Ctx[I830_CTXREG_ENABLES_1] |= ENABLE_STENCIL_TEST; + i830->meta.Ctx[I830_CTXREG_ENABLES_2] |= ENABLE_STENCIL_WRITE; + + /* ctx->Driver.StencilMask( ctx, s_mask ) + */ + i830->meta.Ctx[I830_CTXREG_STATE4] &= ~MODE4_ENABLE_STENCIL_WRITE_MASK; + i830->meta.Ctx[I830_CTXREG_STATE4] |= (ENABLE_STENCIL_WRITE_MASK | + STENCIL_WRITE_MASK((s_mask & + 0xff))); + + /* ctx->Driver.StencilOp( ctx, GL_REPLACE, GL_REPLACE, GL_REPLACE ) + */ + i830->meta.Ctx[I830_CTXREG_STENCILTST] &= ~(STENCIL_OPS_MASK); + i830->meta.Ctx[I830_CTXREG_STENCILTST] |= + (ENABLE_STENCIL_PARMS | + STENCIL_FAIL_OP(STENCILOP_REPLACE) | + STENCIL_PASS_DEPTH_FAIL_OP(STENCILOP_REPLACE) | + STENCIL_PASS_DEPTH_PASS_OP(STENCILOP_REPLACE)); + + /* ctx->Driver.StencilFunc( ctx, GL_ALWAYS, s_clear, ~0 ) + */ + i830->meta.Ctx[I830_CTXREG_STATE4] &= ~MODE4_ENABLE_STENCIL_TEST_MASK; + i830->meta.Ctx[I830_CTXREG_STATE4] |= (ENABLE_STENCIL_TEST_MASK | + STENCIL_TEST_MASK(0xff)); + + i830->meta.Ctx[I830_CTXREG_STENCILTST] &= ~(STENCIL_REF_VALUE_MASK | + ENABLE_STENCIL_TEST_FUNC_MASK); + i830->meta.Ctx[I830_CTXREG_STENCILTST] |= + (ENABLE_STENCIL_REF_VALUE | + ENABLE_STENCIL_TEST_FUNC | + STENCIL_REF_VALUE((s_clear & 0xff)) | + STENCIL_TEST_FUNC(COMPAREFUNC_ALWAYS)); + + + + i830->meta.emitted &= ~I830_UPLOAD_CTX; +} + + +static void +set_color_mask(struct intel_context *intel, GLboolean state) +{ + struct i830_context *i830 = i830_context(&intel->ctx); + + const GLuint mask = ((1 << WRITEMASK_RED_SHIFT) | + (1 << WRITEMASK_GREEN_SHIFT) | + (1 << WRITEMASK_BLUE_SHIFT) | + (1 << WRITEMASK_ALPHA_SHIFT)); + + i830->meta.Ctx[I830_CTXREG_ENABLES_2] &= ~mask; + + if (state) { + i830->meta.Ctx[I830_CTXREG_ENABLES_2] |= + (i830->state.Ctx[I830_CTXREG_ENABLES_2] & mask); + } + + i830->meta.emitted &= ~I830_UPLOAD_CTX; +} + +/* Installs a one-stage passthrough texture blend pipeline. Is there + * more that can be done to turn off texturing? + */ +static void +set_no_texture(struct intel_context *intel) +{ + struct i830_context *i830 = i830_context(&intel->ctx); + static const struct gl_tex_env_combine_state comb = { + GL_NONE, GL_NONE, + {GL_TEXTURE, 0, 0,}, {GL_TEXTURE, 0, 0,}, + {GL_SRC_COLOR, 0, 0}, {GL_SRC_ALPHA, 0, 0}, + 0, 0, 0, 0 + }; + + i830->meta.TexBlendWordsUsed[0] = + i830SetTexEnvCombine(i830, &comb, 0, TEXBLENDARG_TEXEL0, + i830->meta.TexBlend[0], NULL); + + i830->meta.TexBlend[0][0] |= TEXOP_LAST_STAGE; + i830->meta.emitted &= ~I830_UPLOAD_TEXBLEND(0); +} + +/* Set up a single element blend stage for 'replace' texturing with no + * funny ops. + */ +static void +set_texture_blend_replace(struct intel_context *intel) +{ + struct i830_context *i830 = i830_context(&intel->ctx); + static const struct gl_tex_env_combine_state comb = { + GL_REPLACE, GL_REPLACE, + {GL_TEXTURE, GL_TEXTURE, GL_TEXTURE,}, {GL_TEXTURE, GL_TEXTURE, + GL_TEXTURE,}, + {GL_SRC_COLOR, GL_SRC_COLOR, GL_SRC_COLOR}, {GL_SRC_ALPHA, GL_SRC_ALPHA, + GL_SRC_ALPHA}, + 0, 0, 1, 1 + }; + + i830->meta.TexBlendWordsUsed[0] = + i830SetTexEnvCombine(i830, &comb, 0, TEXBLENDARG_TEXEL0, + i830->meta.TexBlend[0], NULL); + + i830->meta.TexBlend[0][0] |= TEXOP_LAST_STAGE; + i830->meta.emitted &= ~I830_UPLOAD_TEXBLEND(0); + +/* fprintf(stderr, "%s: TexBlendWordsUsed[0]: %d\n", */ +/* __FUNCTION__, i830->meta.TexBlendWordsUsed[0]); */ +} + + + +/* Set up an arbitary piece of memory as a rectangular texture + * (including the front or back buffer). + */ +static GLboolean +set_tex_rect_source(struct intel_context *intel, + struct _DriBufferObject *buffer, + GLuint offset, + GLuint pitch, GLuint height, GLenum format, GLenum type) +{ + struct i830_context *i830 = i830_context(&intel->ctx); + GLuint *setup = i830->meta.Tex[0]; + GLint numLevels = 1; + GLuint textureFormat; + GLuint cpp; + + /* A full implementation of this would do the upload through + * glTexImage2d, and get all the conversion operations at that + * point. We are restricted, but still at least have access to the + * fragment program swizzle. + */ + switch (format) { + case GL_BGRA: + switch (type) { + case GL_UNSIGNED_INT_8_8_8_8_REV: + case GL_UNSIGNED_BYTE: + textureFormat = (MAPSURF_32BIT | MT_32BIT_ARGB8888); + cpp = 4; + break; + default: + return GL_FALSE; + } + break; + case GL_RGBA: + switch (type) { + case GL_UNSIGNED_INT_8_8_8_8_REV: + case GL_UNSIGNED_BYTE: + textureFormat = (MAPSURF_32BIT | MT_32BIT_ABGR8888); + cpp = 4; + break; + default: + return GL_FALSE; + } + break; + case GL_BGR: + switch (type) { + case GL_UNSIGNED_SHORT_5_6_5_REV: + textureFormat = (MAPSURF_16BIT | MT_16BIT_RGB565); + cpp = 2; + break; + default: + return GL_FALSE; + } + break; + case GL_RGB: + switch (type) { + case GL_UNSIGNED_SHORT_5_6_5: + textureFormat = (MAPSURF_16BIT | MT_16BIT_RGB565); + cpp = 2; + break; + default: + return GL_FALSE; + } + break; + + default: + return GL_FALSE; + } + + i830->meta.tex_buffer[0] = buffer; + i830->meta.tex_offset[0] = offset; + + setup[I830_TEXREG_TM0LI] = (_3DSTATE_LOAD_STATE_IMMEDIATE_2 | + (LOAD_TEXTURE_MAP0 << 0) | 4); + setup[I830_TEXREG_TM0S1] = (((height - 1) << TM0S1_HEIGHT_SHIFT) | + ((pitch - 1) << TM0S1_WIDTH_SHIFT) | + textureFormat); + setup[I830_TEXREG_TM0S2] = + (((((pitch * cpp) / 4) - + 1) << TM0S2_PITCH_SHIFT) | TM0S2_CUBE_FACE_ENA_MASK); + + setup[I830_TEXREG_TM0S3] = + ((((numLevels - + 1) * + 4) << TM0S3_MIN_MIP_SHIFT) | (FILTER_NEAREST << + TM0S3_MIN_FILTER_SHIFT) | + (MIPFILTER_NONE << TM0S3_MIP_FILTER_SHIFT) | (FILTER_NEAREST << + TM0S3_MAG_FILTER_SHIFT)); + + setup[I830_TEXREG_CUBE] = (_3DSTATE_MAP_CUBE | MAP_UNIT(0)); + + setup[I830_TEXREG_MCS] = (_3DSTATE_MAP_COORD_SET_CMD | + MAP_UNIT(0) | + ENABLE_TEXCOORD_PARAMS | + TEXCOORDS_ARE_IN_TEXELUNITS | + TEXCOORDTYPE_CARTESIAN | + ENABLE_ADDR_V_CNTL | + TEXCOORD_ADDR_V_MODE(TEXCOORDMODE_WRAP) | + ENABLE_ADDR_U_CNTL | + TEXCOORD_ADDR_U_MODE(TEXCOORDMODE_WRAP)); + + i830->meta.emitted &= ~I830_UPLOAD_TEX(0); + return GL_TRUE; +} + + +static void +set_vertex_format(struct intel_context *intel) +{ + struct i830_context *i830 = i830_context(&intel->ctx); + i830->meta.Ctx[I830_CTXREG_VF] = (_3DSTATE_VFT0_CMD | + VFT0_TEX_COUNT(1) | + VFT0_DIFFUSE | VFT0_XYZ); + i830->meta.Ctx[I830_CTXREG_VF2] = (_3DSTATE_VFT1_CMD | + VFT1_TEX0_FMT(TEXCOORDFMT_2D) | + VFT1_TEX1_FMT(TEXCOORDFMT_2D) | + VFT1_TEX2_FMT(TEXCOORDFMT_2D) | + VFT1_TEX3_FMT(TEXCOORDFMT_2D)); + i830->meta.emitted &= ~I830_UPLOAD_CTX; +} + + +static void +meta_import_pixel_state(struct intel_context *intel) +{ + struct i830_context *i830 = i830_context(&intel->ctx); + + i830->meta.Ctx[I830_CTXREG_STATE1] = i830->state.Ctx[I830_CTXREG_STATE1]; + i830->meta.Ctx[I830_CTXREG_STATE2] = i830->state.Ctx[I830_CTXREG_STATE2]; + i830->meta.Ctx[I830_CTXREG_STATE3] = i830->state.Ctx[I830_CTXREG_STATE3]; + i830->meta.Ctx[I830_CTXREG_STATE4] = i830->state.Ctx[I830_CTXREG_STATE4]; + i830->meta.Ctx[I830_CTXREG_STATE5] = i830->state.Ctx[I830_CTXREG_STATE5]; + i830->meta.Ctx[I830_CTXREG_IALPHAB] = i830->state.Ctx[I830_CTXREG_IALPHAB]; + i830->meta.Ctx[I830_CTXREG_STENCILTST] = + i830->state.Ctx[I830_CTXREG_STENCILTST]; + i830->meta.Ctx[I830_CTXREG_ENABLES_1] = + i830->state.Ctx[I830_CTXREG_ENABLES_1]; + i830->meta.Ctx[I830_CTXREG_ENABLES_2] = + i830->state.Ctx[I830_CTXREG_ENABLES_2]; + i830->meta.Ctx[I830_CTXREG_AA] = i830->state.Ctx[I830_CTXREG_AA]; + i830->meta.Ctx[I830_CTXREG_FOGCOLOR] = + i830->state.Ctx[I830_CTXREG_FOGCOLOR]; + i830->meta.Ctx[I830_CTXREG_BLENDCOLOR0] = + i830->state.Ctx[I830_CTXREG_BLENDCOLOR0]; + i830->meta.Ctx[I830_CTXREG_BLENDCOLOR1] = + i830->state.Ctx[I830_CTXREG_BLENDCOLOR1]; + i830->meta.Ctx[I830_CTXREG_MCSB0] = i830->state.Ctx[I830_CTXREG_MCSB0]; + i830->meta.Ctx[I830_CTXREG_MCSB1] = i830->state.Ctx[I830_CTXREG_MCSB1]; + + + i830->meta.Ctx[I830_CTXREG_STATE3] &= ~CULLMODE_MASK; + i830->meta.Stipple[I830_STPREG_ST1] &= ~ST1_ENABLE; + i830->meta.emitted &= ~I830_UPLOAD_CTX; + + + i830->meta.Buffer[I830_DESTREG_SENABLE] = + i830->state.Buffer[I830_DESTREG_SENABLE]; + i830->meta.Buffer[I830_DESTREG_SR1] = i830->state.Buffer[I830_DESTREG_SR1]; + i830->meta.Buffer[I830_DESTREG_SR2] = i830->state.Buffer[I830_DESTREG_SR2]; + i830->meta.emitted &= ~I830_UPLOAD_BUFFERS; +} + + + +/* Select between front and back draw buffers. + */ +static void +meta_draw_region(struct intel_context *intel, + struct intel_region *draw_region, + struct intel_region *depth_region) +{ + struct i830_context *i830 = i830_context(&intel->ctx); + GLuint format; + GLuint depth_format = DEPTH_FRMT_16_FIXED; + + intel_region_release(&i830->meta.draw_region); + intel_region_reference(&i830->meta.draw_region, draw_region); + + intel_region_release(&i830->meta.depth_region); + intel_region_reference(&i830->meta.depth_region, depth_region); + + /* XXX FBO: grab code from i915 meta_draw_region */ + + /* XXX: 555 support? + */ + if (draw_region->cpp == 2) + format = DV_PF_565; + else + format = DV_PF_8888; + + if (depth_region) { + if (depth_region->cpp == 2) + depth_format = DEPTH_FRMT_16_FIXED; + else + depth_format = DEPTH_FRMT_24_FIXED_8_OTHER; + } + + i830->meta.Buffer[I830_DESTREG_DV1] = (DSTORG_HORT_BIAS(0x8) | /* .5 */ + DSTORG_VERT_BIAS(0x8) | /* .5 */ + format | DEPTH_IS_Z | depth_format); + + i830->meta.emitted &= ~I830_UPLOAD_BUFFERS; +} + + +/* Operations where the 3D engine is decoupled temporarily from the + * current GL state and used for other purposes than simply rendering + * incoming triangles. + */ +static void +install_meta_state(struct intel_context *intel) +{ + struct i830_context *i830 = i830_context(&intel->ctx); + memcpy(&i830->meta, &i830->initial, sizeof(i830->meta)); + + i830->meta.active = ACTIVE; + i830->meta.emitted = 0; + + SET_STATE(i830, meta); + set_vertex_format(intel); + set_no_texture(intel); +} + +static void +leave_meta_state(struct intel_context *intel) +{ + struct i830_context *i830 = i830_context(&intel->ctx); + intel_region_release(&i830->meta.draw_region); + intel_region_release(&i830->meta.depth_region); +/* intel_region_release(intel, &i830->meta.tex_region[0]); */ + SET_STATE(i830, state); +} + + + +void +i830InitMetaFuncs(struct i830_context *i830) +{ + i830->intel.vtbl.install_meta_state = install_meta_state; + i830->intel.vtbl.leave_meta_state = leave_meta_state; + i830->intel.vtbl.meta_no_depth_write = set_no_depth_write; + i830->intel.vtbl.meta_no_stencil_write = set_no_stencil_write; + i830->intel.vtbl.meta_stencil_replace = set_stencil_replace; + i830->intel.vtbl.meta_depth_replace = set_depth_replace; + i830->intel.vtbl.meta_color_mask = set_color_mask; + i830->intel.vtbl.meta_no_texture = set_no_texture; + i830->intel.vtbl.meta_texture_blend_replace = set_texture_blend_replace; + i830->intel.vtbl.meta_tex_rect_source = set_tex_rect_source; + i830->intel.vtbl.meta_draw_region = meta_draw_region; + i830->intel.vtbl.meta_import_pixel_state = meta_import_pixel_state; +} diff --git a/src/mesa/drivers/dri/i915tex/i830_reg.h b/src/mesa/drivers/dri/i915tex/i830_reg.h new file mode 100644 index 00000000000..24ac5245005 --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/i830_reg.h @@ -0,0 +1,641 @@ +/************************************************************************** + * + * Copyright 2003 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. + * + **************************************************************************/ + + +#ifndef _I830_REG_H_ +#define _I830_REG_H_ + + +#include "intel_reg.h" + +#define I830_SET_FIELD( var, mask, value ) (var &= ~(mask), var |= value) + +#define _3DSTATE_AA_CMD (CMD_3D | (0x06<<24)) +#define AA_LINE_ECAAR_WIDTH_ENABLE (1<<16) +#define AA_LINE_ECAAR_WIDTH_0_5 0 +#define AA_LINE_ECAAR_WIDTH_1_0 (1<<14) +#define AA_LINE_ECAAR_WIDTH_2_0 (2<<14) +#define AA_LINE_ECAAR_WIDTH_4_0 (3<<14) +#define AA_LINE_REGION_WIDTH_ENABLE (1<<8) +#define AA_LINE_REGION_WIDTH_0_5 0 +#define AA_LINE_REGION_WIDTH_1_0 (1<<6) +#define AA_LINE_REGION_WIDTH_2_0 (2<<6) +#define AA_LINE_REGION_WIDTH_4_0 (3<<6) +#define AA_LINE_ENABLE ((1<<1) | 1) +#define AA_LINE_DISABLE (1<<1) + +#define _3DSTATE_BUF_INFO_CMD (CMD_3D | (0x1d<<24) | (0x8e<<16) | 1) +/* Dword 1 */ +#define BUF_3D_ID_COLOR_BACK (0x3<<24) +#define BUF_3D_ID_DEPTH (0x7<<24) +#define BUF_3D_USE_FENCE (1<<23) +#define BUF_3D_TILED_SURFACE (1<<22) +#define BUF_3D_TILE_WALK_X 0 +#define BUF_3D_TILE_WALK_Y (1<<21) +#define BUF_3D_PITCH(x) (((x)/4)<<2) +/* Dword 2 */ +#define BUF_3D_ADDR(x) ((x) & ~0x3) + + +#define _3DSTATE_COLOR_FACTOR_CMD (CMD_3D | (0x1d<<24) | (0x1<<16)) + +#define _3DSTATE_COLOR_FACTOR_N_CMD(stage) (CMD_3D | (0x1d<<24) | \ + ((0x90+(stage))<<16)) + +#define _3DSTATE_CONST_BLEND_COLOR_CMD (CMD_3D | (0x1d<<24) | (0x88<<16)) + +#define _3DSTATE_DFLT_DIFFUSE_CMD (CMD_3D | (0x1d<<24) | (0x99<<16)) + +#define _3DSTATE_DFLT_SPEC_CMD (CMD_3D | (0x1d<<24) | (0x9a<<16)) + +#define _3DSTATE_DFLT_Z_CMD (CMD_3D | (0x1d<<24) | (0x98<<16)) + + +#define _3DSTATE_DST_BUF_VARS_CMD (CMD_3D | (0x1d<<24) | (0x85<<16)) +/* Dword 1 */ +#define DSTORG_HORT_BIAS(x) ((x)<<20) +#define DSTORG_VERT_BIAS(x) ((x)<<16) +#define COLOR_4_2_2_CHNL_WRT_ALL 0 +#define COLOR_4_2_2_CHNL_WRT_Y (1<<12) +#define COLOR_4_2_2_CHNL_WRT_CR (2<<12) +#define COLOR_4_2_2_CHNL_WRT_CB (3<<12) +#define COLOR_4_2_2_CHNL_WRT_CRCB (4<<12) +#define COLR_BUF_8BIT 0 +#define COLR_BUF_RGB555 (1<<8) +#define COLR_BUF_RGB565 (2<<8) +#define COLR_BUF_ARGB8888 (3<<8) +#define DEPTH_IS_Z 0 +#define DEPTH_IS_W (1<<6) +#define DEPTH_FRMT_16_FIXED 0 +#define DEPTH_FRMT_16_FLOAT (1<<2) +#define DEPTH_FRMT_24_FIXED_8_OTHER (2<<2) +#define DEPTH_FRMT_24_FLOAT_8_OTHER (3<<2) +#define VERT_LINE_STRIDE_1 (1<<1) +#define VERT_LINE_STRIDE_0 0 +#define VERT_LINE_STRIDE_OFS_1 1 +#define VERT_LINE_STRIDE_OFS_0 0 + + +#define _3DSTATE_DRAW_RECT_CMD (CMD_3D|(0x1d<<24)|(0x80<<16)|3) +/* Dword 1 */ +#define DRAW_RECT_DIS_DEPTH_OFS (1<<30) +#define DRAW_DITHER_OFS_X(x) ((x)<<26) +#define DRAW_DITHER_OFS_Y(x) ((x)<<24) +/* Dword 2 */ +#define DRAW_YMIN(x) ((x)<<16) +#define DRAW_XMIN(x) (x) +/* Dword 3 */ +#define DRAW_YMAX(x) ((x)<<16) +#define DRAW_XMAX(x) (x) +/* Dword 4 */ +#define DRAW_YORG(x) ((x)<<16) +#define DRAW_XORG(x) (x) + + +#define _3DSTATE_ENABLES_1_CMD (CMD_3D|(0x3<<24)) +#define ENABLE_LOGIC_OP_MASK ((1<<23)|(1<<22)) +#define ENABLE_LOGIC_OP ((1<<23)|(1<<22)) +#define DISABLE_LOGIC_OP (1<<23) +#define ENABLE_STENCIL_TEST ((1<<21)|(1<<20)) +#define DISABLE_STENCIL_TEST (1<<21) +#define ENABLE_DEPTH_BIAS ((1<<11)|(1<<10)) +#define DISABLE_DEPTH_BIAS (1<<11) +#define ENABLE_SPEC_ADD_MASK ((1<<9)|(1<<8)) +#define ENABLE_SPEC_ADD ((1<<9)|(1<<8)) +#define DISABLE_SPEC_ADD (1<<9) +#define ENABLE_DIS_FOG_MASK ((1<<7)|(1<<6)) +#define ENABLE_FOG ((1<<7)|(1<<6)) +#define DISABLE_FOG (1<<7) +#define ENABLE_DIS_ALPHA_TEST_MASK ((1<<5)|(1<<4)) +#define ENABLE_ALPHA_TEST ((1<<5)|(1<<4)) +#define DISABLE_ALPHA_TEST (1<<5) +#define ENABLE_DIS_CBLEND_MASK ((1<<3)|(1<<2)) +#define ENABLE_COLOR_BLEND ((1<<3)|(1<<2)) +#define DISABLE_COLOR_BLEND (1<<3) +#define ENABLE_DIS_DEPTH_TEST_MASK ((1<<1)|1) +#define ENABLE_DEPTH_TEST ((1<<1)|1) +#define DISABLE_DEPTH_TEST (1<<1) + +/* _3DSTATE_ENABLES_2, p138 */ +#define _3DSTATE_ENABLES_2_CMD (CMD_3D|(0x4<<24)) +#define ENABLE_STENCIL_WRITE ((1<<21)|(1<<20)) +#define DISABLE_STENCIL_WRITE (1<<21) +#define ENABLE_TEX_CACHE ((1<<17)|(1<<16)) +#define DISABLE_TEX_CACHE (1<<17) +#define ENABLE_DITHER ((1<<9)|(1<<8)) +#define DISABLE_DITHER (1<<9) +#define ENABLE_COLOR_MASK (1<<10) +#define WRITEMASK_ALPHA (1<<7) +#define WRITEMASK_ALPHA_SHIFT 7 +#define WRITEMASK_RED (1<<6) +#define WRITEMASK_RED_SHIFT 6 +#define WRITEMASK_GREEN (1<<5) +#define WRITEMASK_GREEN_SHIFT 5 +#define WRITEMASK_BLUE (1<<4) +#define WRITEMASK_BLUE_SHIFT 4 +#define WRITEMASK_MASK ((1<<4)|(1<<5)|(1<<6)|(1<<7)) +#define ENABLE_COLOR_WRITE ((1<<3)|(1<<2)) +#define DISABLE_COLOR_WRITE (1<<3) +#define ENABLE_DIS_DEPTH_WRITE_MASK 0x3 +#define ENABLE_DEPTH_WRITE ((1<<1)|1) +#define DISABLE_DEPTH_WRITE (1<<1) + +/* _3DSTATE_FOG_COLOR, p139 */ +#define _3DSTATE_FOG_COLOR_CMD (CMD_3D|(0x15<<24)) +#define FOG_COLOR_RED(x) ((x)<<16) +#define FOG_COLOR_GREEN(x) ((x)<<8) +#define FOG_COLOR_BLUE(x) (x) + +/* _3DSTATE_FOG_MODE, p140 */ +#define _3DSTATE_FOG_MODE_CMD (CMD_3D|(0x1d<<24)|(0x89<<16)|2) +/* Dword 1 */ +#define FOGFUNC_ENABLE (1<<31) +#define FOGFUNC_VERTEX 0 +#define FOGFUNC_PIXEL_EXP (1<<28) +#define FOGFUNC_PIXEL_EXP2 (2<<28) +#define FOGFUNC_PIXEL_LINEAR (3<<28) +#define FOGSRC_INDEX_Z (1<<27) +#define FOGSRC_INDEX_W ((1<<27)|(1<<25)) +#define FOG_LINEAR_CONST (1<<24) +#define FOG_CONST_1(x) ((x)<<4) +#define ENABLE_FOG_DENSITY (1<<23) +/* Dword 2 */ +#define FOG_CONST_2(x) (x) +/* Dword 3 */ +#define FOG_DENSITY(x) (x) + +/* _3DSTATE_INDEPENDENT_ALPHA_BLEND, p142 */ +#define _3DSTATE_INDPT_ALPHA_BLEND_CMD (CMD_3D|(0x0b<<24)) +#define ENABLE_INDPT_ALPHA_BLEND ((1<<23)|(1<<22)) +#define DISABLE_INDPT_ALPHA_BLEND (1<<23) +#define ALPHA_BLENDFUNC_MASK 0x3f0000 +#define ENABLE_ALPHA_BLENDFUNC (1<<21) +#define ABLENDFUNC_ADD 0 +#define ABLENDFUNC_SUB (1<<16) +#define ABLENDFUNC_RVSE_SUB (2<<16) +#define ABLENDFUNC_MIN (3<<16) +#define ABLENDFUNC_MAX (4<<16) +#define SRC_DST_ABLEND_MASK 0xfff +#define ENABLE_SRC_ABLEND_FACTOR (1<<11) +#define SRC_ABLEND_FACT(x) ((x)<<6) +#define ENABLE_DST_ABLEND_FACTOR (1<<5) +#define DST_ABLEND_FACT(x) (x) + + +/* _3DSTATE_MAP_BLEND_ARG, p152 */ +#define _3DSTATE_MAP_BLEND_ARG_CMD(stage) (CMD_3D|(0x0e<<24)|((stage)<<20)) + +#define TEXPIPE_COLOR 0 +#define TEXPIPE_ALPHA (1<<18) +#define TEXPIPE_KILL (2<<18) +#define TEXBLEND_ARG0 0 +#define TEXBLEND_ARG1 (1<<15) +#define TEXBLEND_ARG2 (2<<15) +#define TEXBLEND_ARG3 (3<<15) +#define TEXBLENDARG_MODIFY_PARMS (1<<6) +#define TEXBLENDARG_REPLICATE_ALPHA (1<<5) +#define TEXBLENDARG_INV_ARG (1<<4) +#define TEXBLENDARG_ONE 0 +#define TEXBLENDARG_FACTOR 0x01 +#define TEXBLENDARG_ACCUM 0x02 +#define TEXBLENDARG_DIFFUSE 0x03 +#define TEXBLENDARG_SPEC 0x04 +#define TEXBLENDARG_CURRENT 0x05 +#define TEXBLENDARG_TEXEL0 0x06 +#define TEXBLENDARG_TEXEL1 0x07 +#define TEXBLENDARG_TEXEL2 0x08 +#define TEXBLENDARG_TEXEL3 0x09 +#define TEXBLENDARG_FACTOR_N 0x0e + +/* _3DSTATE_MAP_BLEND_OP, p155 */ +#define _3DSTATE_MAP_BLEND_OP_CMD(stage) (CMD_3D|(0x0d<<24)|((stage)<<20)) +#if 0 +# define TEXPIPE_COLOR 0 +# define TEXPIPE_ALPHA (1<<18) +# define TEXPIPE_KILL (2<<18) +#endif +#define ENABLE_TEXOUTPUT_WRT_SEL (1<<17) +#define TEXOP_OUTPUT_CURRENT 0 +#define TEXOP_OUTPUT_ACCUM (1<<15) +#define ENABLE_TEX_CNTRL_STAGE ((1<<12)|(1<<11)) +#define DISABLE_TEX_CNTRL_STAGE (1<<12) +#define TEXOP_SCALE_SHIFT 9 +#define TEXOP_SCALE_1X (0 << TEXOP_SCALE_SHIFT) +#define TEXOP_SCALE_2X (1 << TEXOP_SCALE_SHIFT) +#define TEXOP_SCALE_4X (2 << TEXOP_SCALE_SHIFT) +#define TEXOP_MODIFY_PARMS (1<<8) +#define TEXOP_LAST_STAGE (1<<7) +#define TEXBLENDOP_KILLPIXEL 0x02 +#define TEXBLENDOP_ARG1 0x01 +#define TEXBLENDOP_ARG2 0x02 +#define TEXBLENDOP_MODULATE 0x03 +#define TEXBLENDOP_ADD 0x06 +#define TEXBLENDOP_ADDSIGNED 0x07 +#define TEXBLENDOP_BLEND 0x08 +#define TEXBLENDOP_BLEND_AND_ADD 0x09 +#define TEXBLENDOP_SUBTRACT 0x0a +#define TEXBLENDOP_DOT3 0x0b +#define TEXBLENDOP_DOT4 0x0c +#define TEXBLENDOP_MODULATE_AND_ADD 0x0d +#define TEXBLENDOP_MODULATE_2X_AND_ADD 0x0e +#define TEXBLENDOP_MODULATE_4X_AND_ADD 0x0f + +/* _3DSTATE_MAP_BUMP_TABLE, p160 TODO */ +/* _3DSTATE_MAP_COLOR_CHROMA_KEY, p161 TODO */ + +#define _3DSTATE_MAP_COORD_TRANSFORM ((3<<29)|(0x1d<<24)|(0x8c<<16)) +#define DISABLE_TEX_TRANSFORM (1<<28) +#define TEXTURE_SET(x) (x<<29) + +#define _3DSTATE_VERTEX_TRANSFORM ((3<<29)|(0x1d<<24)|(0x8b<<16)) +#define DISABLE_VIEWPORT_TRANSFORM (1<<31) +#define DISABLE_PERSPECTIVE_DIVIDE (1<<29) + + +/* _3DSTATE_MAP_COORD_SET_BINDINGS, p162 */ +#define _3DSTATE_MAP_COORD_SETBIND_CMD (CMD_3D|(0x1d<<24)|(0x02<<16)) +#define TEXBIND_MASK3 ((1<<15)|(1<<14)|(1<<13)|(1<<12)) +#define TEXBIND_MASK2 ((1<<11)|(1<<10)|(1<<9)|(1<<8)) +#define TEXBIND_MASK1 ((1<<7)|(1<<6)|(1<<5)|(1<<4)) +#define TEXBIND_MASK0 ((1<<3)|(1<<2)|(1<<1)|1) + +#define TEXBIND_SET3(x) ((x)<<12) +#define TEXBIND_SET2(x) ((x)<<8) +#define TEXBIND_SET1(x) ((x)<<4) +#define TEXBIND_SET0(x) (x) + +#define TEXCOORDSRC_KEEP 0 +#define TEXCOORDSRC_DEFAULT 0x01 +#define TEXCOORDSRC_VTXSET_0 0x08 +#define TEXCOORDSRC_VTXSET_1 0x09 +#define TEXCOORDSRC_VTXSET_2 0x0a +#define TEXCOORDSRC_VTXSET_3 0x0b +#define TEXCOORDSRC_VTXSET_4 0x0c +#define TEXCOORDSRC_VTXSET_5 0x0d +#define TEXCOORDSRC_VTXSET_6 0x0e +#define TEXCOORDSRC_VTXSET_7 0x0f + +#define MAP_UNIT(unit) ((unit)<<16) +#define MAP_UNIT_MASK (0x7<<16) + +/* _3DSTATE_MAP_COORD_SETS, p164 */ +#define _3DSTATE_MAP_COORD_SET_CMD (CMD_3D|(0x1c<<24)|(0x01<<19)) +#define ENABLE_TEXCOORD_PARAMS (1<<15) +#define TEXCOORDS_ARE_NORMAL (1<<14) +#define TEXCOORDS_ARE_IN_TEXELUNITS 0 +#define TEXCOORDTYPE_CARTESIAN 0 +#define TEXCOORDTYPE_HOMOGENEOUS (1<<11) +#define TEXCOORDTYPE_VECTOR (2<<11) +#define TEXCOORDTYPE_MASK (0x7<<11) +#define ENABLE_ADDR_V_CNTL (1<<7) +#define ENABLE_ADDR_U_CNTL (1<<3) +#define TEXCOORD_ADDR_V_MODE(x) ((x)<<4) +#define TEXCOORD_ADDR_U_MODE(x) (x) +#define TEXCOORDMODE_WRAP 0 +#define TEXCOORDMODE_MIRROR 1 +#define TEXCOORDMODE_CLAMP 2 +#define TEXCOORDMODE_WRAP_SHORTEST 3 +#define TEXCOORDMODE_CLAMP_BORDER 4 +#define TEXCOORD_ADDR_V_MASK 0x70 +#define TEXCOORD_ADDR_U_MASK 0x7 + +/* _3DSTATE_MAP_CUBE, p168 TODO */ +#define _3DSTATE_MAP_CUBE (CMD_3D|(0x1c<<24)|(0x0a<<19)) +#define CUBE_NEGX_ENABLE (1<<5) +#define CUBE_POSX_ENABLE (1<<4) +#define CUBE_NEGY_ENABLE (1<<3) +#define CUBE_POSY_ENABLE (1<<2) +#define CUBE_NEGZ_ENABLE (1<<1) +#define CUBE_POSZ_ENABLE (1<<0) + + +/* _3DSTATE_MODES_1, p190 */ +#define _3DSTATE_MODES_1_CMD (CMD_3D|(0x08<<24)) +#define BLENDFUNC_MASK 0x3f0000 +#define ENABLE_COLR_BLND_FUNC (1<<21) +#define BLENDFUNC_ADD 0 +#define BLENDFUNC_SUB (1<<16) +#define BLENDFUNC_RVRSE_SUB (2<<16) +#define BLENDFUNC_MIN (3<<16) +#define BLENDFUNC_MAX (4<<16) +#define SRC_DST_BLND_MASK 0xfff +#define ENABLE_SRC_BLND_FACTOR (1<<11) +#define ENABLE_DST_BLND_FACTOR (1<<5) +#define SRC_BLND_FACT(x) ((x)<<6) +#define DST_BLND_FACT(x) (x) + + +/* _3DSTATE_MODES_2, p192 */ +#define _3DSTATE_MODES_2_CMD (CMD_3D|(0x0f<<24)) +#define ENABLE_GLOBAL_DEPTH_BIAS (1<<22) +#define GLOBAL_DEPTH_BIAS(x) ((x)<<14) +#define ENABLE_ALPHA_TEST_FUNC (1<<13) +#define ENABLE_ALPHA_REF_VALUE (1<<8) +#define ALPHA_TEST_FUNC(x) ((x)<<9) +#define ALPHA_REF_VALUE(x) (x) + +#define ALPHA_TEST_REF_MASK 0x3fff + +/* _3DSTATE_MODES_3, p193 */ +#define _3DSTATE_MODES_3_CMD (CMD_3D|(0x02<<24)) +#define DEPTH_TEST_FUNC_MASK 0x1f0000 +#define ENABLE_DEPTH_TEST_FUNC (1<<20) +/* Uses COMPAREFUNC */ +#define DEPTH_TEST_FUNC(x) ((x)<<16) +#define ENABLE_ALPHA_SHADE_MODE (1<<11) +#define ENABLE_FOG_SHADE_MODE (1<<9) +#define ENABLE_SPEC_SHADE_MODE (1<<7) +#define ENABLE_COLOR_SHADE_MODE (1<<5) +#define ALPHA_SHADE_MODE(x) ((x)<<10) +#define FOG_SHADE_MODE(x) ((x)<<8) +#define SPEC_SHADE_MODE(x) ((x)<<6) +#define COLOR_SHADE_MODE(x) ((x)<<4) +#define CULLMODE_MASK 0xf +#define ENABLE_CULL_MODE (1<<3) +#define CULLMODE_BOTH 0 +#define CULLMODE_NONE 1 +#define CULLMODE_CW 2 +#define CULLMODE_CCW 3 + +#define SHADE_MODE_LINEAR 0 +#define SHADE_MODE_FLAT 0x1 + +/* _3DSTATE_MODES_4, p195 */ +#define _3DSTATE_MODES_4_CMD (CMD_3D|(0x16<<24)) +#define ENABLE_LOGIC_OP_FUNC (1<<23) +#define LOGIC_OP_FUNC(x) ((x)<<18) +#define LOGICOP_MASK ((1<<18)|(1<<19)|(1<<20)|(1<<21)) +#define LOGICOP_CLEAR 0 +#define LOGICOP_NOR 0x1 +#define LOGICOP_AND_INV 0x2 +#define LOGICOP_COPY_INV 0x3 +#define LOGICOP_AND_RVRSE 0x4 +#define LOGICOP_INV 0x5 +#define LOGICOP_XOR 0x6 +#define LOGICOP_NAND 0x7 +#define LOGICOP_AND 0x8 +#define LOGICOP_EQUIV 0x9 +#define LOGICOP_NOOP 0xa +#define LOGICOP_OR_INV 0xb +#define LOGICOP_COPY 0xc +#define LOGICOP_OR_RVRSE 0xd +#define LOGICOP_OR 0xe +#define LOGICOP_SET 0xf +#define MODE4_ENABLE_STENCIL_TEST_MASK ((1<<17)|(0xff00)) +#define ENABLE_STENCIL_TEST_MASK (1<<17) +#define STENCIL_TEST_MASK(x) (((x)&0xff)<<8) +#define MODE4_ENABLE_STENCIL_WRITE_MASK ((1<<16)|(0x00ff)) +#define ENABLE_STENCIL_WRITE_MASK (1<<16) +#define STENCIL_WRITE_MASK(x) ((x)&0xff) + +/* _3DSTATE_MODES_5, p196 */ +#define _3DSTATE_MODES_5_CMD (CMD_3D|(0x0c<<24)) +#define ENABLE_SPRITE_POINT_TEX (1<<23) +#define SPRITE_POINT_TEX_ON (1<<22) +#define SPRITE_POINT_TEX_OFF 0 +#define FLUSH_RENDER_CACHE (1<<18) +#define FLUSH_TEXTURE_CACHE (1<<16) +#define FIXED_LINE_WIDTH_MASK 0xfc00 +#define ENABLE_FIXED_LINE_WIDTH (1<<15) +#define FIXED_LINE_WIDTH(x) ((x)<<10) +#define FIXED_POINT_WIDTH_MASK 0x3ff +#define ENABLE_FIXED_POINT_WIDTH (1<<9) +#define FIXED_POINT_WIDTH(x) (x) + +/* _3DSTATE_RASTERIZATION_RULES, p198 */ +#define _3DSTATE_RASTER_RULES_CMD (CMD_3D|(0x07<<24)) +#define ENABLE_POINT_RASTER_RULE (1<<15) +#define OGL_POINT_RASTER_RULE (1<<13) +#define ENABLE_LINE_STRIP_PROVOKE_VRTX (1<<8) +#define ENABLE_TRI_FAN_PROVOKE_VRTX (1<<5) +#define ENABLE_TRI_STRIP_PROVOKE_VRTX (1<<2) +#define LINE_STRIP_PROVOKE_VRTX(x) ((x)<<6) +#define TRI_FAN_PROVOKE_VRTX(x) ((x)<<3) +#define TRI_STRIP_PROVOKE_VRTX(x) (x) + +/* _3DSTATE_SCISSOR_ENABLE, p200 */ +#define _3DSTATE_SCISSOR_ENABLE_CMD (CMD_3D|(0x1c<<24)|(0x10<<19)) +#define ENABLE_SCISSOR_RECT ((1<<1) | 1) +#define DISABLE_SCISSOR_RECT (1<<1) + +/* _3DSTATE_SCISSOR_RECTANGLE_0, p201 */ +#define _3DSTATE_SCISSOR_RECT_0_CMD (CMD_3D|(0x1d<<24)|(0x81<<16)|1) +/* Dword 1 */ +#define SCISSOR_RECT_0_YMIN(x) ((x)<<16) +#define SCISSOR_RECT_0_XMIN(x) (x) +/* Dword 2 */ +#define SCISSOR_RECT_0_YMAX(x) ((x)<<16) +#define SCISSOR_RECT_0_XMAX(x) (x) + +/* _3DSTATE_STENCIL_TEST, p202 */ +#define _3DSTATE_STENCIL_TEST_CMD (CMD_3D|(0x09<<24)) +#define ENABLE_STENCIL_PARMS (1<<23) +#define STENCIL_OPS_MASK (0xffc000) +#define STENCIL_FAIL_OP(x) ((x)<<20) +#define STENCIL_PASS_DEPTH_FAIL_OP(x) ((x)<<17) +#define STENCIL_PASS_DEPTH_PASS_OP(x) ((x)<<14) + +#define ENABLE_STENCIL_TEST_FUNC_MASK ((1<<13)|(1<<12)|(1<<11)|(1<<10)|(1<<9)) +#define ENABLE_STENCIL_TEST_FUNC (1<<13) +/* Uses COMPAREFUNC */ +#define STENCIL_TEST_FUNC(x) ((x)<<9) +#define STENCIL_REF_VALUE_MASK ((1<<8)|0xff) +#define ENABLE_STENCIL_REF_VALUE (1<<8) +#define STENCIL_REF_VALUE(x) (x) + +/* _3DSTATE_VERTEX_FORMAT, p204 */ +#define _3DSTATE_VFT0_CMD (CMD_3D|(0x05<<24)) +#define VFT0_POINT_WIDTH (1<<12) +#define VFT0_TEX_COUNT_MASK (7<<8) +#define VFT0_TEX_COUNT_SHIFT 8 +#define VFT0_TEX_COUNT(x) ((x)<<8) +#define VFT0_SPEC (1<<7) +#define VFT0_DIFFUSE (1<<6) +#define VFT0_DEPTH_OFFSET (1<<5) +#define VFT0_XYZ (1<<1) +#define VFT0_XYZW (2<<1) +#define VFT0_XY (3<<1) +#define VFT0_XYW (4<<1) +#define VFT0_XYZW_MASK (7<<1) + +/* _3DSTATE_VERTEX_FORMAT_2, p206 */ +#define _3DSTATE_VFT1_CMD (CMD_3D|(0x0a<<24)) +#define VFT1_TEX7_FMT(x) ((x)<<14) +#define VFT1_TEX6_FMT(x) ((x)<<12) +#define VFT1_TEX5_FMT(x) ((x)<<10) +#define VFT1_TEX4_FMT(x) ((x)<<8) +#define VFT1_TEX3_FMT(x) ((x)<<6) +#define VFT1_TEX2_FMT(x) ((x)<<4) +#define VFT1_TEX1_FMT(x) ((x)<<2) +#define VFT1_TEX0_FMT(x) (x) +#define VFT1_TEX0_MASK 3 +#define VFT1_TEX1_SHIFT 2 +#define TEXCOORDFMT_2D 0 +#define TEXCOORDFMT_3D 1 +#define TEXCOORDFMT_4D 2 +#define TEXCOORDFMT_1D 3 + +/*New stuff picked up along the way */ + +#define MLC_LOD_BIAS_MASK ((1<<7)-1) + + +/* _3DSTATE_VERTEX_TRANSFORM, p207 */ +#define _3DSTATE_VERTEX_TRANS_CMD (CMD_3D|(0x1d<<24)|(0x8b<<16)|0) +#define _3DSTATE_VERTEX_TRANS_MTX_CMD (CMD_3D|(0x1d<<24)|(0x8b<<16)|6) +/* Dword 1 */ +#define ENABLE_VIEWPORT_TRANSFORM ((1<<31)|(1<<30)) +#define DISABLE_VIEWPORT_TRANSFORM (1<<31) +#define ENABLE_PERSP_DIVIDE ((1<<29)|(1<<28)) +#define DISABLE_PERSP_DIVIDE (1<<29) +#define VRTX_TRANS_LOAD_MATRICES 0x7421 +#define VRTX_TRANS_NO_LOAD_MATRICES 0x0000 +/* Dword 2 -> 7 are matrix elements */ + +/* _3DSTATE_W_STATE, p209 */ +#define _3DSTATE_W_STATE_CMD (CMD_3D|(0x1d<<24)|(0x8d<<16)|1) +/* Dword 1 */ +#define MAGIC_W_STATE_DWORD1 0x00000008 +/* Dword 2 */ +#define WFAR_VALUE(x) (x) + + +/* Stipple command, carried over from the i810, apparently: + */ +#define _3DSTATE_STIPPLE ((0x3<<29)|(0x1d<<24)|(0x83<<16)) +#define ST1_ENABLE (1<<16) +#define ST1_MASK (0xffff) + + + +#define _3DSTATE_LOAD_STATE_IMMEDIATE_2 ((0x3<<29)|(0x1d<<24)|(0x03<<16)) +#define LOAD_TEXTURE_MAP0 (1<<11) +#define LOAD_GLOBAL_COLOR_FACTOR (1<<6) + +#define TM0S0_ADDRESS_MASK 0xfffffffc +#define TM0S0_USE_FENCE (1<<1) + +#define TM0S1_HEIGHT_SHIFT 21 +#define TM0S1_WIDTH_SHIFT 10 +#define TM0S1_PALETTE_SELECT (1<<9) +#define TM0S1_MAPSURF_FORMAT_MASK (0x7 << 6) +#define TM0S1_MAPSURF_FORMAT_SHIFT 6 +#define MAPSURF_8BIT_INDEXED (0<<6) +#define MAPSURF_8BIT (1<<6) +#define MAPSURF_16BIT (2<<6) +#define MAPSURF_32BIT (3<<6) +#define MAPSURF_411 (4<<6) +#define MAPSURF_422 (5<<6) +#define MAPSURF_COMPRESSED (6<<6) +#define MAPSURF_4BIT_INDEXED (7<<6) +#define TM0S1_MT_FORMAT_MASK (0x7 << 3) +#define TM0S1_MT_FORMAT_SHIFT 3 +#define MT_4BIT_IDX_ARGB8888 (7<<3) /* SURFACE_4BIT_INDEXED */ +#define MT_8BIT_IDX_RGB565 (0<<3) /* SURFACE_8BIT_INDEXED */ +#define MT_8BIT_IDX_ARGB1555 (1<<3) +#define MT_8BIT_IDX_ARGB4444 (2<<3) +#define MT_8BIT_IDX_AY88 (3<<3) +#define MT_8BIT_IDX_ABGR8888 (4<<3) +#define MT_8BIT_IDX_BUMP_88DVDU (5<<3) +#define MT_8BIT_IDX_BUMP_655LDVDU (6<<3) +#define MT_8BIT_IDX_ARGB8888 (7<<3) +#define MT_8BIT_I8 (0<<3) /* SURFACE_8BIT */ +#define MT_8BIT_L8 (1<<3) +#define MT_16BIT_RGB565 (0<<3) /* SURFACE_16BIT */ +#define MT_16BIT_ARGB1555 (1<<3) +#define MT_16BIT_ARGB4444 (2<<3) +#define MT_16BIT_AY88 (3<<3) +#define MT_16BIT_DIB_ARGB1555_8888 (4<<3) +#define MT_16BIT_BUMP_88DVDU (5<<3) +#define MT_16BIT_BUMP_655LDVDU (6<<3) +#define MT_16BIT_DIB_RGB565_8888 (7<<3) +#define MT_32BIT_ARGB8888 (0<<3) /* SURFACE_32BIT */ +#define MT_32BIT_ABGR8888 (1<<3) +#define MT_32BIT_BUMP_XLDVDU_8888 (6<<3) +#define MT_32BIT_DIB_8888 (7<<3) +#define MT_411_YUV411 (0<<3) /* SURFACE_411 */ +#define MT_422_YCRCB_SWAPY (0<<3) /* SURFACE_422 */ +#define MT_422_YCRCB_NORMAL (1<<3) +#define MT_422_YCRCB_SWAPUV (2<<3) +#define MT_422_YCRCB_SWAPUVY (3<<3) +#define MT_COMPRESS_DXT1 (0<<3) /* SURFACE_COMPRESSED */ +#define MT_COMPRESS_DXT2_3 (1<<3) +#define MT_COMPRESS_DXT4_5 (2<<3) +#define MT_COMPRESS_FXT1 (3<<3) +#define TM0S1_COLORSPACE_CONVERSION (1 << 2) +#define TM0S1_TILED_SURFACE (1 << 1) +#define TM0S1_TILE_WALK (1 << 0) + +#define TM0S2_PITCH_SHIFT 21 +#define TM0S2_CUBE_FACE_ENA_SHIFT 15 +#define TM0S2_CUBE_FACE_ENA_MASK (1<<15) +#define TM0S2_MAP_FORMAT (1<<14) +#define TM0S2_VERTICAL_LINE_STRIDE (1<<13) +#define TM0S2_VERITCAL_LINE_STRIDE_OFF (1<<12) +#define TM0S2_OUTPUT_CHAN_SHIFT 10 +#define TM0S2_OUTPUT_CHAN_MASK (3<<10) + +#define TM0S3_MIP_FILTER_MASK (0x3<<30) +#define TM0S3_MIP_FILTER_SHIFT 30 +#define MIPFILTER_NONE 0 +#define MIPFILTER_NEAREST 1 +#define MIPFILTER_LINEAR 3 +#define TM0S3_MAG_FILTER_MASK (0x3<<28) +#define TM0S3_MAG_FILTER_SHIFT 28 +#define TM0S3_MIN_FILTER_MASK (0x3<<26) +#define TM0S3_MIN_FILTER_SHIFT 26 +#define FILTER_NEAREST 0 +#define FILTER_LINEAR 1 +#define FILTER_ANISOTROPIC 2 + +#define TM0S3_LOD_BIAS_SHIFT 17 +#define TM0S3_LOD_BIAS_MASK (0x1ff<<17) +#define TM0S3_MAX_MIP_SHIFT 9 +#define TM0S3_MAX_MIP_MASK (0xff<<9) +#define TM0S3_MIN_MIP_SHIFT 3 +#define TM0S3_MIN_MIP_MASK (0x3f<<3) +#define TM0S3_KILL_PIXEL (1<<2) +#define TM0S3_KEYED_FILTER (1<<1) +#define TM0S3_CHROMA_KEY (1<<0) + + +/* _3DSTATE_MAP_TEXEL_STREAM, p188 */ +#define _3DSTATE_MAP_TEX_STREAM_CMD (CMD_3D|(0x1c<<24)|(0x05<<19)) +#define DISABLE_TEX_STREAM_BUMP (1<<12) +#define ENABLE_TEX_STREAM_BUMP ((1<<12)|(1<<11)) +#define TEX_MODIFY_UNIT_0 0 +#define TEX_MODIFY_UNIT_1 (1<<8) +#define ENABLE_TEX_STREAM_COORD_SET (1<<7) +#define TEX_STREAM_COORD_SET(x) ((x)<<4) +#define ENABLE_TEX_STREAM_MAP_IDX (1<<3) +#define TEX_STREAM_MAP_IDX(x) (x) + + +#define MI_FLUSH ((0<<29)|(4<<23)) +#define FLUSH_MAP_CACHE (1<<0) + +#endif diff --git a/src/mesa/drivers/dri/i915tex/i830_state.c b/src/mesa/drivers/dri/i915tex/i830_state.c new file mode 100644 index 00000000000..c0673363f32 --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/i830_state.c @@ -0,0 +1,1113 @@ +/************************************************************************** + * + * Copyright 2003 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. + * + **************************************************************************/ + + +#include "glheader.h" +#include "context.h" +#include "macros.h" +#include "enums.h" +#include "dd.h" + +#include "texmem.h" + +#include "intel_screen.h" +#include "intel_batchbuffer.h" +#include "intel_fbo.h" + +#include "i830_context.h" +#include "i830_reg.h" + +#define FILE_DEBUG_FLAG DEBUG_STATE + +static void +i830StencilFuncSeparate(GLcontext * ctx, GLenum face, GLenum func, GLint ref, + GLuint mask) +{ + struct i830_context *i830 = i830_context(ctx); + int test = intel_translate_compare_func(func); + + mask = mask & 0xff; + + DBG("%s : func: %s, ref : 0x%x, mask: 0x%x\n", __FUNCTION__, + _mesa_lookup_enum_by_nr(func), ref, mask); + + + I830_STATECHANGE(i830, I830_UPLOAD_CTX); + i830->state.Ctx[I830_CTXREG_STATE4] &= ~MODE4_ENABLE_STENCIL_TEST_MASK; + i830->state.Ctx[I830_CTXREG_STATE4] |= (ENABLE_STENCIL_TEST_MASK | + STENCIL_TEST_MASK(mask)); + i830->state.Ctx[I830_CTXREG_STENCILTST] &= ~(STENCIL_REF_VALUE_MASK | + ENABLE_STENCIL_TEST_FUNC_MASK); + i830->state.Ctx[I830_CTXREG_STENCILTST] |= (ENABLE_STENCIL_REF_VALUE | + ENABLE_STENCIL_TEST_FUNC | + STENCIL_REF_VALUE(ref) | + STENCIL_TEST_FUNC(test)); +} + +static void +i830StencilMaskSeparate(GLcontext * ctx, GLenum face, GLuint mask) +{ + struct i830_context *i830 = i830_context(ctx); + + DBG("%s : mask 0x%x\n", __FUNCTION__, mask); + + mask = mask & 0xff; + + I830_STATECHANGE(i830, I830_UPLOAD_CTX); + i830->state.Ctx[I830_CTXREG_STATE4] &= ~MODE4_ENABLE_STENCIL_WRITE_MASK; + i830->state.Ctx[I830_CTXREG_STATE4] |= (ENABLE_STENCIL_WRITE_MASK | + STENCIL_WRITE_MASK(mask)); +} + +static void +i830StencilOpSeparate(GLcontext * ctx, GLenum face, GLenum fail, GLenum zfail, + GLenum zpass) +{ + struct i830_context *i830 = i830_context(ctx); + int fop, dfop, dpop; + + DBG("%s: fail : %s, zfail: %s, zpass : %s\n", __FUNCTION__, + _mesa_lookup_enum_by_nr(fail), + _mesa_lookup_enum_by_nr(zfail), + _mesa_lookup_enum_by_nr(zpass)); + + fop = 0; + dfop = 0; + dpop = 0; + + switch (fail) { + case GL_KEEP: + fop = STENCILOP_KEEP; + break; + case GL_ZERO: + fop = STENCILOP_ZERO; + break; + case GL_REPLACE: + fop = STENCILOP_REPLACE; + break; + case GL_INCR: + fop = STENCILOP_INCRSAT; + break; + case GL_DECR: + fop = STENCILOP_DECRSAT; + break; + case GL_INCR_WRAP: + fop = STENCILOP_INCR; + break; + case GL_DECR_WRAP: + fop = STENCILOP_DECR; + break; + case GL_INVERT: + fop = STENCILOP_INVERT; + break; + default: + break; + } + switch (zfail) { + case GL_KEEP: + dfop = STENCILOP_KEEP; + break; + case GL_ZERO: + dfop = STENCILOP_ZERO; + break; + case GL_REPLACE: + dfop = STENCILOP_REPLACE; + break; + case GL_INCR: + dfop = STENCILOP_INCRSAT; + break; + case GL_DECR: + dfop = STENCILOP_DECRSAT; + break; + case GL_INCR_WRAP: + dfop = STENCILOP_INCR; + break; + case GL_DECR_WRAP: + dfop = STENCILOP_DECR; + break; + case GL_INVERT: + dfop = STENCILOP_INVERT; + break; + default: + break; + } + switch (zpass) { + case GL_KEEP: + dpop = STENCILOP_KEEP; + break; + case GL_ZERO: + dpop = STENCILOP_ZERO; + break; + case GL_REPLACE: + dpop = STENCILOP_REPLACE; + break; + case GL_INCR: + dpop = STENCILOP_INCRSAT; + break; + case GL_DECR: + dpop = STENCILOP_DECRSAT; + break; + case GL_INCR_WRAP: + dpop = STENCILOP_INCR; + break; + case GL_DECR_WRAP: + dpop = STENCILOP_DECR; + break; + case GL_INVERT: + dpop = STENCILOP_INVERT; + break; + default: + break; + } + + + I830_STATECHANGE(i830, I830_UPLOAD_CTX); + i830->state.Ctx[I830_CTXREG_STENCILTST] &= ~(STENCIL_OPS_MASK); + i830->state.Ctx[I830_CTXREG_STENCILTST] |= (ENABLE_STENCIL_PARMS | + STENCIL_FAIL_OP(fop) | + STENCIL_PASS_DEPTH_FAIL_OP + (dfop) | + STENCIL_PASS_DEPTH_PASS_OP + (dpop)); +} + +static void +i830AlphaFunc(GLcontext * ctx, GLenum func, GLfloat ref) +{ + struct i830_context *i830 = i830_context(ctx); + int test = intel_translate_compare_func(func); + GLubyte refByte; + GLuint refInt; + + UNCLAMPED_FLOAT_TO_UBYTE(refByte, ref); + refInt = (GLuint) refByte; + + I830_STATECHANGE(i830, I830_UPLOAD_CTX); + i830->state.Ctx[I830_CTXREG_STATE2] &= ~ALPHA_TEST_REF_MASK; + i830->state.Ctx[I830_CTXREG_STATE2] |= (ENABLE_ALPHA_TEST_FUNC | + ENABLE_ALPHA_REF_VALUE | + ALPHA_TEST_FUNC(test) | + ALPHA_REF_VALUE(refInt)); +} + +/** + * Makes sure that the proper enables are set for LogicOp, Independant Alpha + * Blend, and Blending. It needs to be called from numerous places where we + * could change the LogicOp or Independant Alpha Blend without subsequent + * calls to glEnable. + * + * \todo + * This function is substantially different from the old i830-specific driver. + * I'm not sure which is correct. + */ +static void +i830EvalLogicOpBlendState(GLcontext * ctx) +{ + struct i830_context *i830 = i830_context(ctx); + + I830_STATECHANGE(i830, I830_UPLOAD_CTX); + + if (RGBA_LOGICOP_ENABLED(ctx)) { + i830->state.Ctx[I830_CTXREG_ENABLES_1] &= ~(ENABLE_COLOR_BLEND | + ENABLE_LOGIC_OP_MASK); + i830->state.Ctx[I830_CTXREG_ENABLES_1] |= (DISABLE_COLOR_BLEND | + ENABLE_LOGIC_OP); + } + else if (ctx->Color.BlendEnabled) { + i830->state.Ctx[I830_CTXREG_ENABLES_1] &= ~(ENABLE_COLOR_BLEND | + ENABLE_LOGIC_OP_MASK); + i830->state.Ctx[I830_CTXREG_ENABLES_1] |= (ENABLE_COLOR_BLEND | + DISABLE_LOGIC_OP); + } + else { + i830->state.Ctx[I830_CTXREG_ENABLES_1] &= ~(ENABLE_COLOR_BLEND | + ENABLE_LOGIC_OP_MASK); + i830->state.Ctx[I830_CTXREG_ENABLES_1] |= (DISABLE_COLOR_BLEND | + DISABLE_LOGIC_OP); + } +} + +static void +i830BlendColor(GLcontext * ctx, const GLfloat color[4]) +{ + struct i830_context *i830 = i830_context(ctx); + GLubyte r, g, b, a; + + DBG("%s\n", __FUNCTION__); + + UNCLAMPED_FLOAT_TO_UBYTE(r, color[RCOMP]); + UNCLAMPED_FLOAT_TO_UBYTE(g, color[GCOMP]); + UNCLAMPED_FLOAT_TO_UBYTE(b, color[BCOMP]); + UNCLAMPED_FLOAT_TO_UBYTE(a, color[ACOMP]); + + I830_STATECHANGE(i830, I830_UPLOAD_CTX); + i830->state.Ctx[I830_CTXREG_BLENDCOLOR1] = + (a << 24) | (r << 16) | (g << 8) | b; +} + +/** + * Sets both the blend equation (called "function" in i830 docs) and the + * blend function (called "factor" in i830 docs). This is done in a single + * function because some blend equations (i.e., \c GL_MIN and \c GL_MAX) + * change the interpretation of the blend function. + */ +static void +i830_set_blend_state(GLcontext * ctx) +{ + struct i830_context *i830 = i830_context(ctx); + int funcA; + int funcRGB; + int eqnA; + int eqnRGB; + int iab; + int s1; + + + funcRGB = + SRC_BLND_FACT(intel_translate_blend_factor(ctx->Color.BlendSrcRGB)) + | DST_BLND_FACT(intel_translate_blend_factor(ctx->Color.BlendDstRGB)); + + switch (ctx->Color.BlendEquationRGB) { + case GL_FUNC_ADD: + eqnRGB = BLENDFUNC_ADD; + break; + case GL_MIN: + eqnRGB = BLENDFUNC_MIN; + funcRGB = SRC_BLND_FACT(BLENDFACT_ONE) | DST_BLND_FACT(BLENDFACT_ONE); + break; + case GL_MAX: + eqnRGB = BLENDFUNC_MAX; + funcRGB = SRC_BLND_FACT(BLENDFACT_ONE) | DST_BLND_FACT(BLENDFACT_ONE); + break; + case GL_FUNC_SUBTRACT: + eqnRGB = BLENDFUNC_SUB; + break; + case GL_FUNC_REVERSE_SUBTRACT: + eqnRGB = BLENDFUNC_RVRSE_SUB; + break; + default: + fprintf(stderr, "[%s:%u] Invalid RGB blend equation (0x%04x).\n", + __FUNCTION__, __LINE__, ctx->Color.BlendEquationRGB); + return; + } + + + funcA = SRC_ABLEND_FACT(intel_translate_blend_factor(ctx->Color.BlendSrcA)) + | DST_ABLEND_FACT(intel_translate_blend_factor(ctx->Color.BlendDstA)); + + switch (ctx->Color.BlendEquationA) { + case GL_FUNC_ADD: + eqnA = BLENDFUNC_ADD; + break; + case GL_MIN: + eqnA = BLENDFUNC_MIN; + funcA = SRC_BLND_FACT(BLENDFACT_ONE) | DST_BLND_FACT(BLENDFACT_ONE); + break; + case GL_MAX: + eqnA = BLENDFUNC_MAX; + funcA = SRC_BLND_FACT(BLENDFACT_ONE) | DST_BLND_FACT(BLENDFACT_ONE); + break; + case GL_FUNC_SUBTRACT: + eqnA = BLENDFUNC_SUB; + break; + case GL_FUNC_REVERSE_SUBTRACT: + eqnA = BLENDFUNC_RVRSE_SUB; + break; + default: + fprintf(stderr, "[%s:%u] Invalid alpha blend equation (0x%04x).\n", + __FUNCTION__, __LINE__, ctx->Color.BlendEquationA); + return; + } + + iab = eqnA | funcA + | _3DSTATE_INDPT_ALPHA_BLEND_CMD + | ENABLE_SRC_ABLEND_FACTOR | ENABLE_DST_ABLEND_FACTOR + | ENABLE_ALPHA_BLENDFUNC; + s1 = eqnRGB | funcRGB + | _3DSTATE_MODES_1_CMD + | ENABLE_SRC_BLND_FACTOR | ENABLE_DST_BLND_FACTOR + | ENABLE_COLR_BLND_FUNC; + + if ((eqnA | funcA) != (eqnRGB | funcRGB)) + iab |= ENABLE_INDPT_ALPHA_BLEND; + else + iab |= DISABLE_INDPT_ALPHA_BLEND; + + if (iab != i830->state.Ctx[I830_CTXREG_IALPHAB] || + s1 != i830->state.Ctx[I830_CTXREG_STATE1]) { + I830_STATECHANGE(i830, I830_UPLOAD_CTX); + i830->state.Ctx[I830_CTXREG_IALPHAB] = iab; + i830->state.Ctx[I830_CTXREG_STATE1] = s1; + } + + /* This will catch a logicop blend equation. It will also ensure + * independant alpha blend is really in the correct state (either enabled + * or disabled) if blending is already enabled. + */ + + i830EvalLogicOpBlendState(ctx); + + if (0) { + fprintf(stderr, + "[%s:%u] STATE1: 0x%08x IALPHAB: 0x%08x blend is %sabled\n", + __FUNCTION__, __LINE__, i830->state.Ctx[I830_CTXREG_STATE1], + i830->state.Ctx[I830_CTXREG_IALPHAB], + (ctx->Color.BlendEnabled) ? "en" : "dis"); + } +} + + +static void +i830BlendEquationSeparate(GLcontext * ctx, GLenum modeRGB, GLenum modeA) +{ + DBG("%s -> %s, %s\n", __FUNCTION__, + _mesa_lookup_enum_by_nr(modeRGB), + _mesa_lookup_enum_by_nr(modeA)); + + (void) modeRGB; + (void) modeA; + i830_set_blend_state(ctx); +} + + +static void +i830BlendFuncSeparate(GLcontext * ctx, GLenum sfactorRGB, + GLenum dfactorRGB, GLenum sfactorA, GLenum dfactorA) +{ + DBG("%s -> RGB(%s, %s) A(%s, %s)\n", __FUNCTION__, + _mesa_lookup_enum_by_nr(sfactorRGB), + _mesa_lookup_enum_by_nr(dfactorRGB), + _mesa_lookup_enum_by_nr(sfactorA), + _mesa_lookup_enum_by_nr(dfactorA)); + + (void) sfactorRGB; + (void) dfactorRGB; + (void) sfactorA; + (void) dfactorA; + i830_set_blend_state(ctx); +} + + + +static void +i830DepthFunc(GLcontext * ctx, GLenum func) +{ + struct i830_context *i830 = i830_context(ctx); + int test = intel_translate_compare_func(func); + + DBG("%s\n", __FUNCTION__); + + I830_STATECHANGE(i830, I830_UPLOAD_CTX); + i830->state.Ctx[I830_CTXREG_STATE3] &= ~DEPTH_TEST_FUNC_MASK; + i830->state.Ctx[I830_CTXREG_STATE3] |= (ENABLE_DEPTH_TEST_FUNC | + DEPTH_TEST_FUNC(test)); +} + +static void +i830DepthMask(GLcontext * ctx, GLboolean flag) +{ + struct i830_context *i830 = i830_context(ctx); + + DBG("%s flag (%d)\n", __FUNCTION__, flag); + + I830_STATECHANGE(i830, I830_UPLOAD_CTX); + + i830->state.Ctx[I830_CTXREG_ENABLES_2] &= ~ENABLE_DIS_DEPTH_WRITE_MASK; + + if (flag && ctx->Depth.Test) + i830->state.Ctx[I830_CTXREG_ENABLES_2] |= ENABLE_DEPTH_WRITE; + else + i830->state.Ctx[I830_CTXREG_ENABLES_2] |= DISABLE_DEPTH_WRITE; +} + +/* ============================================================= + * Polygon stipple + * + * The i830 supports a 4x4 stipple natively, GL wants 32x32. + * Fortunately stipple is usually a repeating pattern. + */ +static void +i830PolygonStipple(GLcontext * ctx, const GLubyte * mask) +{ + struct i830_context *i830 = i830_context(ctx); + const GLubyte *m = mask; + GLubyte p[4]; + int i, j, k; + int active = (ctx->Polygon.StippleFlag && + i830->intel.reduced_primitive == GL_TRIANGLES); + GLuint newMask; + + if (active) { + I830_STATECHANGE(i830, I830_UPLOAD_STIPPLE); + i830->state.Stipple[I830_STPREG_ST1] &= ~ST1_ENABLE; + } + + p[0] = mask[12] & 0xf; + p[0] |= p[0] << 4; + p[1] = mask[8] & 0xf; + p[1] |= p[1] << 4; + p[2] = mask[4] & 0xf; + p[2] |= p[2] << 4; + p[3] = mask[0] & 0xf; + p[3] |= p[3] << 4; + + for (k = 0; k < 8; k++) + for (j = 3; j >= 0; j--) + for (i = 0; i < 4; i++, m++) + if (*m != p[j]) { + i830->intel.hw_stipple = 0; + return; + } + + newMask = (((p[0] & 0xf) << 0) | + ((p[1] & 0xf) << 4) | + ((p[2] & 0xf) << 8) | ((p[3] & 0xf) << 12)); + + + if (newMask == 0xffff || newMask == 0x0) { + /* this is needed to make conform pass */ + i830->intel.hw_stipple = 0; + return; + } + + i830->state.Stipple[I830_STPREG_ST1] &= ~0xffff; + i830->state.Stipple[I830_STPREG_ST1] |= newMask; + i830->intel.hw_stipple = 1; + + if (active) + i830->state.Stipple[I830_STPREG_ST1] |= ST1_ENABLE; +} + + +/* ============================================================= + * Hardware clipping + */ +static void +i830Scissor(GLcontext * ctx, GLint x, GLint y, GLsizei w, GLsizei h) +{ + struct i830_context *i830 = i830_context(ctx); + int x1, y1, x2, y2; + + if (!ctx->DrawBuffer) + return; + + DBG("%s %d,%d %dx%d\n", __FUNCTION__, x, y, w, h); + + if (ctx->DrawBuffer->Name == 0) { + x1 = x; + y1 = ctx->DrawBuffer->Height - (y + h); + x2 = x + w - 1; + y2 = y1 + h - 1; + DBG("%s %d..%d,%d..%d (inverted)\n", __FUNCTION__, x1, x2, y1, y2); + } + else { + /* FBO - not inverted + */ + x1 = x; + y1 = y; + x2 = x + w - 1; + y2 = y + h - 1; + DBG("%s %d..%d,%d..%d (not inverted)\n", __FUNCTION__, x1, x2, y1, y2); + } + + x1 = CLAMP(x1, 0, ctx->DrawBuffer->Width - 1); + y1 = CLAMP(y1, 0, ctx->DrawBuffer->Height - 1); + x2 = CLAMP(x2, 0, ctx->DrawBuffer->Width - 1); + y2 = CLAMP(y2, 0, ctx->DrawBuffer->Height - 1); + + DBG("%s %d..%d,%d..%d (clamped)\n", __FUNCTION__, x1, x2, y1, y2); + + I830_STATECHANGE(i830, I830_UPLOAD_BUFFERS); + i830->state.Buffer[I830_DESTREG_SR1] = (y1 << 16) | (x1 & 0xffff); + i830->state.Buffer[I830_DESTREG_SR2] = (y2 << 16) | (x2 & 0xffff); +} + +static void +i830LogicOp(GLcontext * ctx, GLenum opcode) +{ + struct i830_context *i830 = i830_context(ctx); + int tmp = intel_translate_logic_op(opcode); + + DBG("%s\n", __FUNCTION__); + + I830_STATECHANGE(i830, I830_UPLOAD_CTX); + i830->state.Ctx[I830_CTXREG_STATE4] &= ~LOGICOP_MASK; + i830->state.Ctx[I830_CTXREG_STATE4] |= LOGIC_OP_FUNC(tmp); +} + + + +static void +i830CullFaceFrontFace(GLcontext * ctx, GLenum unused) +{ + struct i830_context *i830 = i830_context(ctx); + GLuint mode; + + DBG("%s\n", __FUNCTION__); + + if (!ctx->Polygon.CullFlag) { + mode = CULLMODE_NONE; + } + else if (ctx->Polygon.CullFaceMode != GL_FRONT_AND_BACK) { + mode = CULLMODE_CW; + + if (ctx->Polygon.CullFaceMode == GL_FRONT) + mode ^= (CULLMODE_CW ^ CULLMODE_CCW); + if (ctx->Polygon.FrontFace != GL_CCW) + mode ^= (CULLMODE_CW ^ CULLMODE_CCW); + } + else { + mode = CULLMODE_BOTH; + } + + I830_STATECHANGE(i830, I830_UPLOAD_CTX); + i830->state.Ctx[I830_CTXREG_STATE3] &= ~CULLMODE_MASK; + i830->state.Ctx[I830_CTXREG_STATE3] |= ENABLE_CULL_MODE | mode; +} + +static void +i830LineWidth(GLcontext * ctx, GLfloat widthf) +{ + struct i830_context *i830 = i830_context(ctx); + int width; + int state5; + + DBG("%s\n", __FUNCTION__); + + width = (int) (widthf * 2); + CLAMP_SELF(width, 1, 15); + + state5 = i830->state.Ctx[I830_CTXREG_STATE5] & ~FIXED_LINE_WIDTH_MASK; + state5 |= (ENABLE_FIXED_LINE_WIDTH | FIXED_LINE_WIDTH(width)); + + if (state5 != i830->state.Ctx[I830_CTXREG_STATE5]) { + I830_STATECHANGE(i830, I830_UPLOAD_CTX); + i830->state.Ctx[I830_CTXREG_STATE5] = state5; + } +} + +static void +i830PointSize(GLcontext * ctx, GLfloat size) +{ + struct i830_context *i830 = i830_context(ctx); + GLint point_size = (int) size; + + DBG("%s\n", __FUNCTION__); + + CLAMP_SELF(point_size, 1, 256); + I830_STATECHANGE(i830, I830_UPLOAD_CTX); + i830->state.Ctx[I830_CTXREG_STATE5] &= ~FIXED_POINT_WIDTH_MASK; + i830->state.Ctx[I830_CTXREG_STATE5] |= (ENABLE_FIXED_POINT_WIDTH | + FIXED_POINT_WIDTH(point_size)); +} + + +/* ============================================================= + * Color masks + */ + +static void +i830ColorMask(GLcontext * ctx, + GLboolean r, GLboolean g, GLboolean b, GLboolean a) +{ + struct i830_context *i830 = i830_context(ctx); + GLuint tmp = 0; + + DBG("%s r(%d) g(%d) b(%d) a(%d)\n", __FUNCTION__, r, g, b, a); + + tmp = ((i830->state.Ctx[I830_CTXREG_ENABLES_2] & ~WRITEMASK_MASK) | + ENABLE_COLOR_MASK | + ENABLE_COLOR_WRITE | + ((!r) << WRITEMASK_RED_SHIFT) | + ((!g) << WRITEMASK_GREEN_SHIFT) | + ((!b) << WRITEMASK_BLUE_SHIFT) | ((!a) << WRITEMASK_ALPHA_SHIFT)); + + if (tmp != i830->state.Ctx[I830_CTXREG_ENABLES_2]) { + I830_STATECHANGE(i830, I830_UPLOAD_CTX); + i830->state.Ctx[I830_CTXREG_ENABLES_2] = tmp; + } +} + +static void +update_specular(GLcontext * ctx) +{ + struct i830_context *i830 = i830_context(ctx); + + I830_STATECHANGE(i830, I830_UPLOAD_CTX); + i830->state.Ctx[I830_CTXREG_ENABLES_1] &= ~ENABLE_SPEC_ADD_MASK; + + if (NEED_SECONDARY_COLOR(ctx)) + i830->state.Ctx[I830_CTXREG_ENABLES_1] |= ENABLE_SPEC_ADD; + else + i830->state.Ctx[I830_CTXREG_ENABLES_1] |= DISABLE_SPEC_ADD; +} + +static void +i830LightModelfv(GLcontext * ctx, GLenum pname, const GLfloat * param) +{ + DBG("%s\n", __FUNCTION__); + + if (pname == GL_LIGHT_MODEL_COLOR_CONTROL) { + update_specular(ctx); + } +} + +/* In Mesa 3.5 we can reliably do native flatshading. + */ +static void +i830ShadeModel(GLcontext * ctx, GLenum mode) +{ + struct i830_context *i830 = i830_context(ctx); + I830_STATECHANGE(i830, I830_UPLOAD_CTX); + + +#define SHADE_MODE_MASK ((1<<10)|(1<<8)|(1<<6)|(1<<4)) + + i830->state.Ctx[I830_CTXREG_STATE3] &= ~SHADE_MODE_MASK; + + if (mode == GL_FLAT) { + i830->state.Ctx[I830_CTXREG_STATE3] |= + (ALPHA_SHADE_MODE(SHADE_MODE_FLAT) | FOG_SHADE_MODE(SHADE_MODE_FLAT) + | SPEC_SHADE_MODE(SHADE_MODE_FLAT) | + COLOR_SHADE_MODE(SHADE_MODE_FLAT)); + } + else { + i830->state.Ctx[I830_CTXREG_STATE3] |= + (ALPHA_SHADE_MODE(SHADE_MODE_LINEAR) | + FOG_SHADE_MODE(SHADE_MODE_LINEAR) | + SPEC_SHADE_MODE(SHADE_MODE_LINEAR) | + COLOR_SHADE_MODE(SHADE_MODE_LINEAR)); + } +} + +/* ============================================================= + * Fog + */ +static void +i830Fogfv(GLcontext * ctx, GLenum pname, const GLfloat * param) +{ + struct i830_context *i830 = i830_context(ctx); + + DBG("%s\n", __FUNCTION__); + + if (pname == GL_FOG_COLOR) { + GLuint color = (((GLubyte) (ctx->Fog.Color[0] * 255.0F) << 16) | + ((GLubyte) (ctx->Fog.Color[1] * 255.0F) << 8) | + ((GLubyte) (ctx->Fog.Color[2] * 255.0F) << 0)); + + I830_STATECHANGE(i830, I830_UPLOAD_CTX); + i830->state.Ctx[I830_CTXREG_FOGCOLOR] = + (_3DSTATE_FOG_COLOR_CMD | color); + } +} + +/* ============================================================= + */ + +static void +i830Enable(GLcontext * ctx, GLenum cap, GLboolean state) +{ + struct i830_context *i830 = i830_context(ctx); + + switch (cap) { + case GL_LIGHTING: + case GL_COLOR_SUM: + update_specular(ctx); + break; + + case GL_ALPHA_TEST: + I830_STATECHANGE(i830, I830_UPLOAD_CTX); + i830->state.Ctx[I830_CTXREG_ENABLES_1] &= ~ENABLE_DIS_ALPHA_TEST_MASK; + if (state) + i830->state.Ctx[I830_CTXREG_ENABLES_1] |= ENABLE_ALPHA_TEST; + else + i830->state.Ctx[I830_CTXREG_ENABLES_1] |= DISABLE_ALPHA_TEST; + + break; + + case GL_BLEND: + i830EvalLogicOpBlendState(ctx); + break; + + case GL_COLOR_LOGIC_OP: + i830EvalLogicOpBlendState(ctx); + + /* Logicop doesn't seem to work at 16bpp: + */ + if (i830->intel.intelScreen->cpp == 2) + FALLBACK(&i830->intel, I830_FALLBACK_LOGICOP, state); + break; + + case GL_DITHER: + I830_STATECHANGE(i830, I830_UPLOAD_CTX); + i830->state.Ctx[I830_CTXREG_ENABLES_2] &= ~ENABLE_DITHER; + + if (state) + i830->state.Ctx[I830_CTXREG_ENABLES_2] |= ENABLE_DITHER; + else + i830->state.Ctx[I830_CTXREG_ENABLES_2] |= DISABLE_DITHER; + break; + + case GL_DEPTH_TEST: + I830_STATECHANGE(i830, I830_UPLOAD_CTX); + i830->state.Ctx[I830_CTXREG_ENABLES_1] &= ~ENABLE_DIS_DEPTH_TEST_MASK; + + if (state) + i830->state.Ctx[I830_CTXREG_ENABLES_1] |= ENABLE_DEPTH_TEST; + else + i830->state.Ctx[I830_CTXREG_ENABLES_1] |= DISABLE_DEPTH_TEST; + + /* Also turn off depth writes when GL_DEPTH_TEST is disabled: + */ + i830DepthMask(ctx, ctx->Depth.Mask); + break; + + case GL_SCISSOR_TEST: + I830_STATECHANGE(i830, I830_UPLOAD_BUFFERS); + + if (state) + i830->state.Buffer[I830_DESTREG_SENABLE] = + (_3DSTATE_SCISSOR_ENABLE_CMD | ENABLE_SCISSOR_RECT); + else + i830->state.Buffer[I830_DESTREG_SENABLE] = + (_3DSTATE_SCISSOR_ENABLE_CMD | DISABLE_SCISSOR_RECT); + + break; + + case GL_LINE_SMOOTH: + I830_STATECHANGE(i830, I830_UPLOAD_CTX); + + i830->state.Ctx[I830_CTXREG_AA] &= ~AA_LINE_ENABLE; + if (state) + i830->state.Ctx[I830_CTXREG_AA] |= AA_LINE_ENABLE; + else + i830->state.Ctx[I830_CTXREG_AA] |= AA_LINE_DISABLE; + break; + + case GL_FOG: + I830_STATECHANGE(i830, I830_UPLOAD_CTX); + i830->state.Ctx[I830_CTXREG_ENABLES_1] &= ~ENABLE_DIS_FOG_MASK; + if (state) + i830->state.Ctx[I830_CTXREG_ENABLES_1] |= ENABLE_FOG; + else + i830->state.Ctx[I830_CTXREG_ENABLES_1] |= DISABLE_FOG; + break; + + case GL_CULL_FACE: + i830CullFaceFrontFace(ctx, 0); + break; + + case GL_TEXTURE_2D: + break; + + case GL_STENCIL_TEST: + { + GLboolean hw_stencil = GL_FALSE; + if (ctx->DrawBuffer) { + struct intel_renderbuffer *irbStencil + = intel_get_renderbuffer(ctx->DrawBuffer, BUFFER_STENCIL); + hw_stencil = (irbStencil && irbStencil->region); + } + if (hw_stencil) { + I830_STATECHANGE(i830, I830_UPLOAD_CTX); + + if (state) { + i830->state.Ctx[I830_CTXREG_ENABLES_1] |= ENABLE_STENCIL_TEST; + i830->state.Ctx[I830_CTXREG_ENABLES_2] |= ENABLE_STENCIL_WRITE; + } + else { + i830->state.Ctx[I830_CTXREG_ENABLES_1] &= ~ENABLE_STENCIL_TEST; + i830->state.Ctx[I830_CTXREG_ENABLES_2] &= + ~ENABLE_STENCIL_WRITE; + i830->state.Ctx[I830_CTXREG_ENABLES_1] |= DISABLE_STENCIL_TEST; + i830->state.Ctx[I830_CTXREG_ENABLES_2] |= + DISABLE_STENCIL_WRITE; + } + } + else { + FALLBACK(&i830->intel, I830_FALLBACK_STENCIL, state); + } + } + break; + + case GL_POLYGON_STIPPLE: + /* The stipple command worked on my 855GM box, but not my 845G. + * I'll do more testing later to find out exactly which hardware + * supports it. Disabled for now. + */ + if (i830->intel.hw_stipple && + i830->intel.reduced_primitive == GL_TRIANGLES) { + I830_STATECHANGE(i830, I830_UPLOAD_STIPPLE); + i830->state.Stipple[I830_STPREG_ST1] &= ~ST1_ENABLE; + if (state) + i830->state.Stipple[I830_STPREG_ST1] |= ST1_ENABLE; + } + break; + + default: + ; + } +} + + +static void +i830_init_packets(struct i830_context *i830) +{ + intelScreenPrivate *screen = i830->intel.intelScreen; + + /* Zero all state */ + memset(&i830->state, 0, sizeof(i830->state)); + + /* Set default blend state */ + i830->state.TexBlend[0][0] = (_3DSTATE_MAP_BLEND_OP_CMD(0) | + TEXPIPE_COLOR | + ENABLE_TEXOUTPUT_WRT_SEL | + TEXOP_OUTPUT_CURRENT | + DISABLE_TEX_CNTRL_STAGE | + TEXOP_SCALE_1X | + TEXOP_MODIFY_PARMS | + TEXOP_LAST_STAGE | TEXBLENDOP_ARG1); + i830->state.TexBlend[0][1] = (_3DSTATE_MAP_BLEND_OP_CMD(0) | + TEXPIPE_ALPHA | + ENABLE_TEXOUTPUT_WRT_SEL | + TEXOP_OUTPUT_CURRENT | + TEXOP_SCALE_1X | + TEXOP_MODIFY_PARMS | TEXBLENDOP_ARG1); + i830->state.TexBlend[0][2] = (_3DSTATE_MAP_BLEND_ARG_CMD(0) | + TEXPIPE_COLOR | + TEXBLEND_ARG1 | + TEXBLENDARG_MODIFY_PARMS | + TEXBLENDARG_DIFFUSE); + i830->state.TexBlend[0][3] = (_3DSTATE_MAP_BLEND_ARG_CMD(0) | + TEXPIPE_ALPHA | + TEXBLEND_ARG1 | + TEXBLENDARG_MODIFY_PARMS | + TEXBLENDARG_DIFFUSE); + + i830->state.TexBlendWordsUsed[0] = 4; + + + i830->state.Ctx[I830_CTXREG_VF] = 0; + i830->state.Ctx[I830_CTXREG_VF2] = 0; + + i830->state.Ctx[I830_CTXREG_AA] = (_3DSTATE_AA_CMD | + AA_LINE_ECAAR_WIDTH_ENABLE | + AA_LINE_ECAAR_WIDTH_1_0 | + AA_LINE_REGION_WIDTH_ENABLE | + AA_LINE_REGION_WIDTH_1_0 | + AA_LINE_DISABLE); + + i830->state.Ctx[I830_CTXREG_ENABLES_1] = (_3DSTATE_ENABLES_1_CMD | + DISABLE_LOGIC_OP | + DISABLE_STENCIL_TEST | + DISABLE_DEPTH_BIAS | + DISABLE_SPEC_ADD | + DISABLE_FOG | + DISABLE_ALPHA_TEST | + DISABLE_COLOR_BLEND | + DISABLE_DEPTH_TEST); + +#if 000 /* XXX all the stencil enable state is set in i830Enable(), right? */ + if (i830->intel.hw_stencil) { + i830->state.Ctx[I830_CTXREG_ENABLES_2] = (_3DSTATE_ENABLES_2_CMD | + ENABLE_STENCIL_WRITE | + ENABLE_TEX_CACHE | + ENABLE_DITHER | + ENABLE_COLOR_MASK | + /* set no color comps disabled */ + ENABLE_COLOR_WRITE | + ENABLE_DEPTH_WRITE); + } + else +#endif + { + i830->state.Ctx[I830_CTXREG_ENABLES_2] = (_3DSTATE_ENABLES_2_CMD | + DISABLE_STENCIL_WRITE | + ENABLE_TEX_CACHE | + ENABLE_DITHER | + ENABLE_COLOR_MASK | + /* set no color comps disabled */ + ENABLE_COLOR_WRITE | + ENABLE_DEPTH_WRITE); + } + + i830->state.Ctx[I830_CTXREG_STATE1] = (_3DSTATE_MODES_1_CMD | + ENABLE_COLR_BLND_FUNC | + BLENDFUNC_ADD | + ENABLE_SRC_BLND_FACTOR | + SRC_BLND_FACT(BLENDFACT_ONE) | + ENABLE_DST_BLND_FACTOR | + DST_BLND_FACT(BLENDFACT_ZERO)); + + i830->state.Ctx[I830_CTXREG_STATE2] = (_3DSTATE_MODES_2_CMD | + ENABLE_GLOBAL_DEPTH_BIAS | + GLOBAL_DEPTH_BIAS(0) | + ENABLE_ALPHA_TEST_FUNC | + ALPHA_TEST_FUNC(COMPAREFUNC_ALWAYS) + | ALPHA_REF_VALUE(0)); + + i830->state.Ctx[I830_CTXREG_STATE3] = (_3DSTATE_MODES_3_CMD | + ENABLE_DEPTH_TEST_FUNC | + DEPTH_TEST_FUNC(COMPAREFUNC_LESS) | + ENABLE_ALPHA_SHADE_MODE | + ALPHA_SHADE_MODE(SHADE_MODE_LINEAR) + | ENABLE_FOG_SHADE_MODE | + FOG_SHADE_MODE(SHADE_MODE_LINEAR) | + ENABLE_SPEC_SHADE_MODE | + SPEC_SHADE_MODE(SHADE_MODE_LINEAR) | + ENABLE_COLOR_SHADE_MODE | + COLOR_SHADE_MODE(SHADE_MODE_LINEAR) + | ENABLE_CULL_MODE | CULLMODE_NONE); + + i830->state.Ctx[I830_CTXREG_STATE4] = (_3DSTATE_MODES_4_CMD | + ENABLE_LOGIC_OP_FUNC | + LOGIC_OP_FUNC(LOGICOP_COPY) | + ENABLE_STENCIL_TEST_MASK | + STENCIL_TEST_MASK(0xff) | + ENABLE_STENCIL_WRITE_MASK | + STENCIL_WRITE_MASK(0xff)); + + i830->state.Ctx[I830_CTXREG_STENCILTST] = (_3DSTATE_STENCIL_TEST_CMD | + ENABLE_STENCIL_PARMS | + STENCIL_FAIL_OP(STENCILOP_KEEP) + | + STENCIL_PASS_DEPTH_FAIL_OP + (STENCILOP_KEEP) | + STENCIL_PASS_DEPTH_PASS_OP + (STENCILOP_KEEP) | + ENABLE_STENCIL_TEST_FUNC | + STENCIL_TEST_FUNC + (COMPAREFUNC_ALWAYS) | + ENABLE_STENCIL_REF_VALUE | + STENCIL_REF_VALUE(0)); + + i830->state.Ctx[I830_CTXREG_STATE5] = (_3DSTATE_MODES_5_CMD | FLUSH_TEXTURE_CACHE | ENABLE_SPRITE_POINT_TEX | SPRITE_POINT_TEX_OFF | ENABLE_FIXED_LINE_WIDTH | FIXED_LINE_WIDTH(0x2) | /* 1.0 */ + ENABLE_FIXED_POINT_WIDTH | + FIXED_POINT_WIDTH(1)); + + i830->state.Ctx[I830_CTXREG_IALPHAB] = (_3DSTATE_INDPT_ALPHA_BLEND_CMD | + DISABLE_INDPT_ALPHA_BLEND | + ENABLE_ALPHA_BLENDFUNC | + ABLENDFUNC_ADD); + + i830->state.Ctx[I830_CTXREG_FOGCOLOR] = (_3DSTATE_FOG_COLOR_CMD | + FOG_COLOR_RED(0) | + FOG_COLOR_GREEN(0) | + FOG_COLOR_BLUE(0)); + + i830->state.Ctx[I830_CTXREG_BLENDCOLOR0] = _3DSTATE_CONST_BLEND_COLOR_CMD; + i830->state.Ctx[I830_CTXREG_BLENDCOLOR1] = 0; + + i830->state.Ctx[I830_CTXREG_MCSB0] = _3DSTATE_MAP_COORD_SETBIND_CMD; + i830->state.Ctx[I830_CTXREG_MCSB1] = (TEXBIND_SET3(TEXCOORDSRC_VTXSET_3) | + TEXBIND_SET2(TEXCOORDSRC_VTXSET_2) | + TEXBIND_SET1(TEXCOORDSRC_VTXSET_1) | + TEXBIND_SET0(TEXCOORDSRC_VTXSET_0)); + + + i830->state.Stipple[I830_STPREG_ST0] = _3DSTATE_STIPPLE; + + i830->state.Buffer[I830_DESTREG_CBUFADDR0] = _3DSTATE_BUF_INFO_CMD; + i830->state.Buffer[I830_DESTREG_CBUFADDR1] = (BUF_3D_ID_COLOR_BACK | BUF_3D_PITCH(screen->front.pitch) | /* pitch in bytes */ + BUF_3D_USE_FENCE); + + + i830->state.Buffer[I830_DESTREG_DBUFADDR0] = _3DSTATE_BUF_INFO_CMD; + i830->state.Buffer[I830_DESTREG_DBUFADDR1] = (BUF_3D_ID_DEPTH | BUF_3D_PITCH(screen->depth.pitch) | /* pitch in bytes */ + BUF_3D_USE_FENCE); + + i830->state.Buffer[I830_DESTREG_DV0] = _3DSTATE_DST_BUF_VARS_CMD; + + switch (screen->fbFormat) { + case DV_PF_565: + i830->state.Buffer[I830_DESTREG_DV1] = (DSTORG_HORT_BIAS(0x8) | /* .5 */ + DSTORG_VERT_BIAS(0x8) | /* .5 */ + screen->fbFormat | + DEPTH_IS_Z | + DEPTH_FRMT_16_FIXED); + break; + case DV_PF_8888: + i830->state.Buffer[I830_DESTREG_DV1] = (DSTORG_HORT_BIAS(0x8) | /* .5 */ + DSTORG_VERT_BIAS(0x8) | /* .5 */ + screen->fbFormat | + DEPTH_IS_Z | + DEPTH_FRMT_24_FIXED_8_OTHER); + break; + } + + i830->state.Buffer[I830_DESTREG_SENABLE] = (_3DSTATE_SCISSOR_ENABLE_CMD | + DISABLE_SCISSOR_RECT); + i830->state.Buffer[I830_DESTREG_SR0] = _3DSTATE_SCISSOR_RECT_0_CMD; + i830->state.Buffer[I830_DESTREG_SR1] = 0; + i830->state.Buffer[I830_DESTREG_SR2] = 0; +} + + +void +i830InitStateFuncs(struct dd_function_table *functions) +{ + functions->AlphaFunc = i830AlphaFunc; + functions->BlendColor = i830BlendColor; + functions->BlendEquationSeparate = i830BlendEquationSeparate; + functions->BlendFuncSeparate = i830BlendFuncSeparate; + functions->ColorMask = i830ColorMask; + functions->CullFace = i830CullFaceFrontFace; + functions->DepthFunc = i830DepthFunc; + functions->DepthMask = i830DepthMask; + functions->Enable = i830Enable; + functions->Fogfv = i830Fogfv; + functions->FrontFace = i830CullFaceFrontFace; + functions->LightModelfv = i830LightModelfv; + functions->LineWidth = i830LineWidth; + functions->LogicOpcode = i830LogicOp; + functions->PointSize = i830PointSize; + functions->PolygonStipple = i830PolygonStipple; + functions->Scissor = i830Scissor; + functions->ShadeModel = i830ShadeModel; + functions->StencilFuncSeparate = i830StencilFuncSeparate; + functions->StencilMaskSeparate = i830StencilMaskSeparate; + functions->StencilOpSeparate = i830StencilOpSeparate; +} + +void +i830InitState(struct i830_context *i830) +{ + GLcontext *ctx = &i830->intel.ctx; + + i830_init_packets(i830); + + intelInitState(ctx); + + memcpy(&i830->initial, &i830->state, sizeof(i830->state)); + + i830->current = &i830->state; + i830->state.emitted = 0; + i830->state.active = (I830_UPLOAD_INVARIENT | + I830_UPLOAD_TEXBLEND(0) | + I830_UPLOAD_STIPPLE | + I830_UPLOAD_CTX | I830_UPLOAD_BUFFERS); +} diff --git a/src/mesa/drivers/dri/i915tex/i830_tex.c b/src/mesa/drivers/dri/i915tex/i830_tex.c new file mode 100644 index 00000000000..fed464d1aac --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/i830_tex.c @@ -0,0 +1,100 @@ +/************************************************************************** + * + * Copyright 2003 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. + * + **************************************************************************/ + +#include "glheader.h" +#include "mtypes.h" +#include "imports.h" +#include "simple_list.h" +#include "enums.h" +#include "image.h" +#include "texstore.h" +#include "texformat.h" +#include "texmem.h" +#include "swrast/swrast.h" + +#include "mm.h" + +#include "intel_ioctl.h" + +#include "i830_context.h" +#include "i830_reg.h" + + + +static void +i830TexEnv(GLcontext * ctx, GLenum target, + GLenum pname, const GLfloat * param) +{ + + switch (pname) { + case GL_TEXTURE_ENV_COLOR: + case GL_TEXTURE_ENV_MODE: + case GL_COMBINE_RGB: + case GL_COMBINE_ALPHA: + case GL_SOURCE0_RGB: + case GL_SOURCE1_RGB: + case GL_SOURCE2_RGB: + case GL_SOURCE0_ALPHA: + case GL_SOURCE1_ALPHA: + case GL_SOURCE2_ALPHA: + case GL_OPERAND0_RGB: + case GL_OPERAND1_RGB: + case GL_OPERAND2_RGB: + case GL_OPERAND0_ALPHA: + case GL_OPERAND1_ALPHA: + case GL_OPERAND2_ALPHA: + case GL_RGB_SCALE: + case GL_ALPHA_SCALE: + break; + + case GL_TEXTURE_LOD_BIAS:{ + struct i830_context *i830 = i830_context(ctx); + GLuint unit = ctx->Texture.CurrentUnit; + int b = (int) ((*param) * 16.0); + if (b > 63) + b = 63; + if (b < -64) + b = -64; + I830_STATECHANGE(i830, I830_UPLOAD_TEX(unit)); + i830->lodbias_tm0s3[unit] = + ((b << TM0S3_LOD_BIAS_SHIFT) & TM0S3_LOD_BIAS_MASK); + break; + } + + default: + break; + } +} + + + + +void +i830InitTextureFuncs(struct dd_function_table *functions) +{ + functions->TexEnv = i830TexEnv; +} diff --git a/src/mesa/drivers/dri/i915tex/i830_texblend.c b/src/mesa/drivers/dri/i915tex/i830_texblend.c new file mode 100644 index 00000000000..58f220eb7ce --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/i830_texblend.c @@ -0,0 +1,463 @@ +/************************************************************************** + * + * Copyright 2003 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. + * + **************************************************************************/ + +#include "glheader.h" +#include "macros.h" +#include "mtypes.h" +#include "simple_list.h" +#include "enums.h" +#include "texformat.h" +#include "texstore.h" + +#include "mm.h" + +#include "intel_screen.h" +#include "intel_ioctl.h" +#include "intel_tex.h" + +#include "i830_context.h" +#include "i830_reg.h" + + +/* ================================================================ + * Texture combine functions + */ +static GLuint +pass_through(GLuint * state, GLuint blendUnit) +{ + state[0] = (_3DSTATE_MAP_BLEND_OP_CMD(blendUnit) | + TEXPIPE_COLOR | + ENABLE_TEXOUTPUT_WRT_SEL | + TEXOP_OUTPUT_CURRENT | + DISABLE_TEX_CNTRL_STAGE | + TEXOP_SCALE_1X | TEXOP_MODIFY_PARMS | TEXBLENDOP_ARG1); + state[1] = (_3DSTATE_MAP_BLEND_OP_CMD(blendUnit) | + TEXPIPE_ALPHA | + ENABLE_TEXOUTPUT_WRT_SEL | + TEXOP_OUTPUT_CURRENT | + TEXOP_SCALE_1X | TEXOP_MODIFY_PARMS | TEXBLENDOP_ARG1); + state[2] = (_3DSTATE_MAP_BLEND_ARG_CMD(blendUnit) | + TEXPIPE_COLOR | + TEXBLEND_ARG1 | + TEXBLENDARG_MODIFY_PARMS | TEXBLENDARG_CURRENT); + state[3] = (_3DSTATE_MAP_BLEND_ARG_CMD(blendUnit) | + TEXPIPE_ALPHA | + TEXBLEND_ARG1 | + TEXBLENDARG_MODIFY_PARMS | TEXBLENDARG_CURRENT); + + return 4; +} + +static GLuint +emit_factor(GLuint blendUnit, GLuint * state, GLuint count, + const GLfloat * factor) +{ + GLubyte r, g, b, a; + GLuint col; + + if (0) + fprintf(stderr, "emit constant %d: %.2f %.2f %.2f %.2f\n", + blendUnit, factor[0], factor[1], factor[2], factor[3]); + + UNCLAMPED_FLOAT_TO_UBYTE(r, factor[0]); + UNCLAMPED_FLOAT_TO_UBYTE(g, factor[1]); + UNCLAMPED_FLOAT_TO_UBYTE(b, factor[2]); + UNCLAMPED_FLOAT_TO_UBYTE(a, factor[3]); + + col = ((a << 24) | (r << 16) | (g << 8) | b); + + state[count++] = _3DSTATE_COLOR_FACTOR_N_CMD(blendUnit); + state[count++] = col; + + return count; +} + + +static INLINE GLuint +GetTexelOp(GLint unit) +{ + switch (unit) { + case 0: + return TEXBLENDARG_TEXEL0; + case 1: + return TEXBLENDARG_TEXEL1; + case 2: + return TEXBLENDARG_TEXEL2; + case 3: + return TEXBLENDARG_TEXEL3; + default: + return TEXBLENDARG_TEXEL0; + } +} + + +/** + * Calculate the hardware instuctions to setup the current texture enviromnemt + * settings. Since \c gl_texture_unit::_CurrentCombine is used, both + * "classic" texture enviroments and GL_ARB_texture_env_combine type texture + * environments are treated identically. + * + * \todo + * This function should return \c GLboolean. When \c GL_FALSE is returned, + * it means that an environment is selected that the hardware cannot do. This + * is the way the Radeon and R200 drivers work. + * + * \todo + * Looking at i830_3d_regs.h, it seems the i830 can do part of + * GL_ATI_texture_env_combine3. It can handle using \c GL_ONE and + * \c GL_ZERO as combine inputs (which the code already supports). It can + * also handle the \c GL_MODULATE_ADD_ATI mode. Is it worth investigating + * partial support for the extension? + */ +GLuint +i830SetTexEnvCombine(struct i830_context * i830, + const struct gl_tex_env_combine_state * combine, + GLint blendUnit, + GLuint texel_op, GLuint * state, const GLfloat * factor) +{ + const GLuint numColorArgs = combine->_NumArgsRGB; + const GLuint numAlphaArgs = combine->_NumArgsA; + + GLuint blendop; + GLuint ablendop; + GLuint args_RGB[3]; + GLuint args_A[3]; + GLuint rgb_shift; + GLuint alpha_shift; + GLboolean need_factor = 0; + int i; + unsigned used; + static const GLuint tex_blend_rgb[3] = { + TEXPIPE_COLOR | TEXBLEND_ARG1 | TEXBLENDARG_MODIFY_PARMS, + TEXPIPE_COLOR | TEXBLEND_ARG2 | TEXBLENDARG_MODIFY_PARMS, + TEXPIPE_COLOR | TEXBLEND_ARG0 | TEXBLENDARG_MODIFY_PARMS, + }; + static const GLuint tex_blend_a[3] = { + TEXPIPE_ALPHA | TEXBLEND_ARG1 | TEXBLENDARG_MODIFY_PARMS, + TEXPIPE_ALPHA | TEXBLEND_ARG2 | TEXBLENDARG_MODIFY_PARMS, + TEXPIPE_ALPHA | TEXBLEND_ARG0 | TEXBLENDARG_MODIFY_PARMS, + }; + + if (INTEL_DEBUG & DEBUG_TEXTURE) + fprintf(stderr, "%s\n", __FUNCTION__); + + + /* The EXT version of the DOT3 extension does not support the + * scale factor, but the ARB version (and the version in OpenGL + * 1.3) does. + */ + switch (combine->ModeRGB) { + case GL_DOT3_RGB_EXT: + alpha_shift = combine->ScaleShiftA; + rgb_shift = 0; + break; + + case GL_DOT3_RGBA_EXT: + alpha_shift = 0; + rgb_shift = 0; + break; + + default: + rgb_shift = combine->ScaleShiftRGB; + alpha_shift = combine->ScaleShiftA; + break; + } + + + switch (combine->ModeRGB) { + case GL_REPLACE: + blendop = TEXBLENDOP_ARG1; + break; + case GL_MODULATE: + blendop = TEXBLENDOP_MODULATE; + break; + case GL_ADD: + blendop = TEXBLENDOP_ADD; + break; + case GL_ADD_SIGNED: + blendop = TEXBLENDOP_ADDSIGNED; + break; + case GL_INTERPOLATE: + blendop = TEXBLENDOP_BLEND; + break; + case GL_SUBTRACT: + blendop = TEXBLENDOP_SUBTRACT; + break; + case GL_DOT3_RGB_EXT: + case GL_DOT3_RGB: + blendop = TEXBLENDOP_DOT3; + break; + case GL_DOT3_RGBA_EXT: + case GL_DOT3_RGBA: + blendop = TEXBLENDOP_DOT3; + break; + default: + return pass_through(state, blendUnit); + } + + blendop |= (rgb_shift << TEXOP_SCALE_SHIFT); + + + /* Handle RGB args */ + for (i = 0; i < 3; i++) { + switch (combine->SourceRGB[i]) { + case GL_TEXTURE: + args_RGB[i] = texel_op; + break; + case GL_TEXTURE0: + case GL_TEXTURE1: + case GL_TEXTURE2: + case GL_TEXTURE3: + args_RGB[i] = GetTexelOp(combine->SourceRGB[i] - GL_TEXTURE0); + break; + case GL_CONSTANT: + args_RGB[i] = TEXBLENDARG_FACTOR_N; + need_factor = 1; + break; + case GL_PRIMARY_COLOR: + args_RGB[i] = TEXBLENDARG_DIFFUSE; + break; + case GL_PREVIOUS: + args_RGB[i] = TEXBLENDARG_CURRENT; + break; + default: + return pass_through(state, blendUnit); + } + + switch (combine->OperandRGB[i]) { + case GL_SRC_COLOR: + args_RGB[i] |= 0; + break; + case GL_ONE_MINUS_SRC_COLOR: + args_RGB[i] |= TEXBLENDARG_INV_ARG; + break; + case GL_SRC_ALPHA: + args_RGB[i] |= TEXBLENDARG_REPLICATE_ALPHA; + break; + case GL_ONE_MINUS_SRC_ALPHA: + args_RGB[i] |= (TEXBLENDARG_REPLICATE_ALPHA | TEXBLENDARG_INV_ARG); + break; + default: + return pass_through(state, blendUnit); + } + } + + + /* Need to knobble the alpha calculations of TEXBLENDOP_DOT4 to + * match the spec. Can't use DOT3 as it won't propogate values + * into alpha as required: + * + * Note - the global factor is set up with alpha == .5, so + * the alpha part of the DOT4 calculation should be zero. + */ + if (combine->ModeRGB == GL_DOT3_RGBA_EXT || + combine->ModeRGB == GL_DOT3_RGBA) { + ablendop = TEXBLENDOP_DOT4; + args_A[0] = TEXBLENDARG_FACTOR; /* the global factor */ + args_A[1] = TEXBLENDARG_FACTOR; + args_A[2] = TEXBLENDARG_FACTOR; + } + else { + switch (combine->ModeA) { + case GL_REPLACE: + ablendop = TEXBLENDOP_ARG1; + break; + case GL_MODULATE: + ablendop = TEXBLENDOP_MODULATE; + break; + case GL_ADD: + ablendop = TEXBLENDOP_ADD; + break; + case GL_ADD_SIGNED: + ablendop = TEXBLENDOP_ADDSIGNED; + break; + case GL_INTERPOLATE: + ablendop = TEXBLENDOP_BLEND; + break; + case GL_SUBTRACT: + ablendop = TEXBLENDOP_SUBTRACT; + break; + default: + return pass_through(state, blendUnit); + } + + + ablendop |= (alpha_shift << TEXOP_SCALE_SHIFT); + + /* Handle A args */ + for (i = 0; i < 3; i++) { + switch (combine->SourceA[i]) { + case GL_TEXTURE: + args_A[i] = texel_op; + break; + case GL_TEXTURE0: + case GL_TEXTURE1: + case GL_TEXTURE2: + case GL_TEXTURE3: + args_A[i] = GetTexelOp(combine->SourceA[i] - GL_TEXTURE0); + break; + case GL_CONSTANT: + args_A[i] = TEXBLENDARG_FACTOR_N; + need_factor = 1; + break; + case GL_PRIMARY_COLOR: + args_A[i] = TEXBLENDARG_DIFFUSE; + break; + case GL_PREVIOUS: + args_A[i] = TEXBLENDARG_CURRENT; + break; + default: + return pass_through(state, blendUnit); + } + + switch (combine->OperandA[i]) { + case GL_SRC_ALPHA: + args_A[i] |= 0; + break; + case GL_ONE_MINUS_SRC_ALPHA: + args_A[i] |= TEXBLENDARG_INV_ARG; + break; + default: + return pass_through(state, blendUnit); + } + } + } + + + + /* Native Arg1 == Arg0 in GL_EXT_texture_env_combine spec */ + /* Native Arg2 == Arg1 in GL_EXT_texture_env_combine spec */ + /* Native Arg0 == Arg2 in GL_EXT_texture_env_combine spec */ + + /* When we render we need to figure out which is the last really enabled + * tex unit, and put last stage on it + */ + + + /* Build color & alpha pipelines */ + + used = 0; + state[used++] = (_3DSTATE_MAP_BLEND_OP_CMD(blendUnit) | + TEXPIPE_COLOR | + ENABLE_TEXOUTPUT_WRT_SEL | + TEXOP_OUTPUT_CURRENT | + DISABLE_TEX_CNTRL_STAGE | TEXOP_MODIFY_PARMS | blendop); + state[used++] = (_3DSTATE_MAP_BLEND_OP_CMD(blendUnit) | + TEXPIPE_ALPHA | + ENABLE_TEXOUTPUT_WRT_SEL | + TEXOP_OUTPUT_CURRENT | TEXOP_MODIFY_PARMS | ablendop); + + for (i = 0; i < numColorArgs; i++) { + state[used++] = (_3DSTATE_MAP_BLEND_ARG_CMD(blendUnit) | + tex_blend_rgb[i] | args_RGB[i]); + } + + for (i = 0; i < numAlphaArgs; i++) { + state[used++] = (_3DSTATE_MAP_BLEND_ARG_CMD(blendUnit) | + tex_blend_a[i] | args_A[i]); + } + + + if (need_factor) + return emit_factor(blendUnit, state, used, factor); + else + return used; +} + + +static void +emit_texblend(struct i830_context *i830, GLuint unit, GLuint blendUnit, + GLboolean last_stage) +{ + struct gl_texture_unit *texUnit = &i830->intel.ctx.Texture.Unit[unit]; + GLuint tmp[I830_TEXBLEND_SIZE], tmp_sz; + + + if (0) + fprintf(stderr, "%s unit %d\n", __FUNCTION__, unit); + + /* Update i830->state.TexBlend + */ + tmp_sz = i830SetTexEnvCombine(i830, texUnit->_CurrentCombine, blendUnit, + GetTexelOp(unit), tmp, texUnit->EnvColor); + + if (last_stage) + tmp[0] |= TEXOP_LAST_STAGE; + + if (tmp_sz != i830->state.TexBlendWordsUsed[blendUnit] || + memcmp(tmp, i830->state.TexBlend[blendUnit], + tmp_sz * sizeof(GLuint))) { + + I830_STATECHANGE(i830, I830_UPLOAD_TEXBLEND(blendUnit)); + memcpy(i830->state.TexBlend[blendUnit], tmp, tmp_sz * sizeof(GLuint)); + i830->state.TexBlendWordsUsed[blendUnit] = tmp_sz; + } + + I830_ACTIVESTATE(i830, I830_UPLOAD_TEXBLEND(blendUnit), GL_TRUE); +} + +static void +emit_passthrough(struct i830_context *i830) +{ + GLuint tmp[I830_TEXBLEND_SIZE], tmp_sz; + GLuint unit = 0; + + tmp_sz = pass_through(tmp, unit); + tmp[0] |= TEXOP_LAST_STAGE; + + if (tmp_sz != i830->state.TexBlendWordsUsed[unit] || + memcmp(tmp, i830->state.TexBlend[unit], tmp_sz * sizeof(GLuint))) { + + I830_STATECHANGE(i830, I830_UPLOAD_TEXBLEND(unit)); + memcpy(i830->state.TexBlend[unit], tmp, tmp_sz * sizeof(GLuint)); + i830->state.TexBlendWordsUsed[unit] = tmp_sz; + } + + I830_ACTIVESTATE(i830, I830_UPLOAD_TEXBLEND(unit), GL_TRUE); +} + +void +i830EmitTextureBlend(struct i830_context *i830) +{ + GLcontext *ctx = &i830->intel.ctx; + GLuint unit, last_stage = 0, blendunit = 0; + + I830_ACTIVESTATE(i830, I830_UPLOAD_TEXBLEND_ALL, GL_FALSE); + + if (ctx->Texture._EnabledUnits) { + for (unit = 0; unit < ctx->Const.MaxTextureUnits; unit++) + if (ctx->Texture.Unit[unit]._ReallyEnabled) + last_stage = unit; + + for (unit = 0; unit < ctx->Const.MaxTextureUnits; unit++) + if (ctx->Texture.Unit[unit]._ReallyEnabled) + emit_texblend(i830, unit, blendunit++, last_stage == unit); + } + else { + emit_passthrough(i830); + } +} diff --git a/src/mesa/drivers/dri/i915tex/i830_texstate.c b/src/mesa/drivers/dri/i915tex/i830_texstate.c new file mode 100644 index 00000000000..ba79cf94599 --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/i830_texstate.c @@ -0,0 +1,316 @@ +/************************************************************************** + * + * Copyright 2003 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. + * + **************************************************************************/ + +#include "glheader.h" +#include "macros.h" +#include "mtypes.h" +#include "simple_list.h" +#include "enums.h" +#include "texformat.h" +#include "texstore.h" + +#include "mm.h" + +#include "intel_screen.h" +#include "intel_ioctl.h" +#include "intel_tex.h" +#include "intel_mipmap_tree.h" +#include "intel_regions.h" + +#include "i830_context.h" +#include "i830_reg.h" + + + +static GLuint +translate_texture_format(GLuint mesa_format) +{ + switch (mesa_format) { + case MESA_FORMAT_L8: + return MAPSURF_8BIT | MT_8BIT_L8; + case MESA_FORMAT_I8: + return MAPSURF_8BIT | MT_8BIT_I8; + case MESA_FORMAT_A8: + return MAPSURF_8BIT | MT_8BIT_I8; /* Kludge! */ + case MESA_FORMAT_AL88: + return MAPSURF_16BIT | MT_16BIT_AY88; + case MESA_FORMAT_RGB565: + return MAPSURF_16BIT | MT_16BIT_RGB565; + case MESA_FORMAT_ARGB1555: + return MAPSURF_16BIT | MT_16BIT_ARGB1555; + case MESA_FORMAT_ARGB4444: + return MAPSURF_16BIT | MT_16BIT_ARGB4444; + case MESA_FORMAT_ARGB8888: + return MAPSURF_32BIT | MT_32BIT_ARGB8888; + case MESA_FORMAT_YCBCR_REV: + return (MAPSURF_422 | MT_422_YCRCB_NORMAL); + case MESA_FORMAT_YCBCR: + return (MAPSURF_422 | MT_422_YCRCB_SWAPY); + case MESA_FORMAT_RGB_FXT1: + case MESA_FORMAT_RGBA_FXT1: + return (MAPSURF_COMPRESSED | MT_COMPRESS_FXT1); + case MESA_FORMAT_RGBA_DXT1: + case MESA_FORMAT_RGB_DXT1: + return (MAPSURF_COMPRESSED | MT_COMPRESS_DXT1); + case MESA_FORMAT_RGBA_DXT3: + return (MAPSURF_COMPRESSED | MT_COMPRESS_DXT2_3); + case MESA_FORMAT_RGBA_DXT5: + return (MAPSURF_COMPRESSED | MT_COMPRESS_DXT4_5); + default: + fprintf(stderr, "%s: bad image format %x\n", __FUNCTION__, mesa_format); + abort(); + return 0; + } +} + + + + +/* The i915 (and related graphics cores) do not support GL_CLAMP. The + * Intel drivers for "other operating systems" implement GL_CLAMP as + * GL_CLAMP_TO_EDGE, so the same is done here. + */ +static GLuint +translate_wrap_mode(GLenum wrap) +{ + switch (wrap) { + case GL_REPEAT: + return TEXCOORDMODE_WRAP; + case GL_CLAMP: + case GL_CLAMP_TO_EDGE: + return TEXCOORDMODE_CLAMP; /* not really correct */ + case GL_CLAMP_TO_BORDER: + return TEXCOORDMODE_CLAMP_BORDER; + case GL_MIRRORED_REPEAT: + return TEXCOORDMODE_MIRROR; + default: + return TEXCOORDMODE_WRAP; + } +} + + +/* Recalculate all state from scratch. Perhaps not the most + * efficient, but this has gotten complex enough that we need + * something which is understandable and reliable. + */ +static GLboolean +i830_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) +{ + GLcontext *ctx = &intel->ctx; + struct i830_context *i830 = i830_context(ctx); + struct gl_texture_object *tObj = ctx->Texture.Unit[unit]._Current; + struct intel_texture_object *intelObj = intel_texture_object(tObj); + struct gl_texture_image *firstImage; + GLuint *state = i830->state.Tex[unit]; + + memset(state, 0, sizeof(state)); + + if (!intel_finalize_mipmap_tree(intel, unit)) + return GL_FALSE; + + /* Get first image here, since intelObj->firstLevel will get set in + * the intel_finalize_mipmap_tree() call above. + */ + firstImage = tObj->Image[0][intelObj->firstLevel]; + + i830->state.tex_buffer[unit] = intelObj->mt->region->buffer; + i830->state.tex_offset[unit] = intel_miptree_image_offset(intelObj->mt, 0, + intelObj-> + firstLevel); + + + state[I830_TEXREG_TM0LI] = (_3DSTATE_LOAD_STATE_IMMEDIATE_2 | + (LOAD_TEXTURE_MAP0 << unit) | 4); + +/* state[I830_TEXREG_TM0S0] = (TM0S0_USE_FENCE | */ +/* t->intel.TextureOffset); */ + + + state[I830_TEXREG_TM0S1] = + (((firstImage->Height - 1) << TM0S1_HEIGHT_SHIFT) | + ((firstImage->Width - 1) << TM0S1_WIDTH_SHIFT) | + translate_texture_format(firstImage->TexFormat->MesaFormat)); + + state[I830_TEXREG_TM0S2] = + (((((intelObj->mt->pitch * intelObj->mt->cpp) / 4) - + 1) << TM0S2_PITCH_SHIFT) | TM0S2_CUBE_FACE_ENA_MASK); + + { + if (tObj->Target == GL_TEXTURE_CUBE_MAP) + state[I830_TEXREG_CUBE] = (_3DSTATE_MAP_CUBE | MAP_UNIT(unit) | + CUBE_NEGX_ENABLE | + CUBE_POSX_ENABLE | + CUBE_NEGY_ENABLE | + CUBE_POSY_ENABLE | + CUBE_NEGZ_ENABLE | CUBE_POSZ_ENABLE); + else + state[I830_TEXREG_CUBE] = (_3DSTATE_MAP_CUBE | MAP_UNIT(unit)); + } + + + + + { + GLuint minFilt, mipFilt, magFilt; + + switch (tObj->MinFilter) { + case GL_NEAREST: + minFilt = FILTER_NEAREST; + mipFilt = MIPFILTER_NONE; + break; + case GL_LINEAR: + minFilt = FILTER_LINEAR; + mipFilt = MIPFILTER_NONE; + break; + case GL_NEAREST_MIPMAP_NEAREST: + minFilt = FILTER_NEAREST; + mipFilt = MIPFILTER_NEAREST; + break; + case GL_LINEAR_MIPMAP_NEAREST: + minFilt = FILTER_LINEAR; + mipFilt = MIPFILTER_NEAREST; + break; + case GL_NEAREST_MIPMAP_LINEAR: + minFilt = FILTER_NEAREST; + mipFilt = MIPFILTER_LINEAR; + break; + case GL_LINEAR_MIPMAP_LINEAR: + minFilt = FILTER_LINEAR; + mipFilt = MIPFILTER_LINEAR; + break; + default: + return GL_FALSE; + } + + if (tObj->MaxAnisotropy > 1.0) { + minFilt = FILTER_ANISOTROPIC; + magFilt = FILTER_ANISOTROPIC; + } + else { + switch (tObj->MagFilter) { + case GL_NEAREST: + magFilt = FILTER_NEAREST; + break; + case GL_LINEAR: + magFilt = FILTER_LINEAR; + break; + default: + return GL_FALSE; + } + } + + state[I830_TEXREG_TM0S3] = i830->lodbias_tm0s3[unit]; + +#if 0 + /* YUV conversion: + */ + if (firstImage->TexFormat->MesaFormat == MESA_FORMAT_YCBCR || + firstImage->TexFormat->MesaFormat == MESA_FORMAT_YCBCR_REV) + state[I830_TEXREG_TM0S3] |= SS2_COLORSPACE_CONVERSION; +#endif + + state[I830_TEXREG_TM0S3] |= ((intelObj->lastLevel - + intelObj->firstLevel) * + 4) << TM0S3_MIN_MIP_SHIFT; + + state[I830_TEXREG_TM0S3] |= ((minFilt << TM0S3_MIN_FILTER_SHIFT) | + (mipFilt << TM0S3_MIP_FILTER_SHIFT) | + (magFilt << TM0S3_MAG_FILTER_SHIFT)); + } + + { + GLenum ws = tObj->WrapS; + GLenum wt = tObj->WrapT; + + + /* 3D textures not available on i830 + */ + if (tObj->Target == GL_TEXTURE_3D) + return GL_FALSE; + + state[I830_TEXREG_MCS] = (_3DSTATE_MAP_COORD_SET_CMD | + MAP_UNIT(unit) | + ENABLE_TEXCOORD_PARAMS | + ss3 | + ENABLE_ADDR_V_CNTL | + TEXCOORD_ADDR_V_MODE(translate_wrap_mode(wt)) + | ENABLE_ADDR_U_CNTL | + TEXCOORD_ADDR_U_MODE(translate_wrap_mode + (ws))); + } + + + state[I830_TEXREG_TM0S4] = INTEL_PACKCOLOR8888(tObj->_BorderChan[0], + tObj->_BorderChan[1], + tObj->_BorderChan[2], + tObj->_BorderChan[3]); + + + I830_ACTIVESTATE(i830, I830_UPLOAD_TEX(unit), GL_TRUE); + /* memcmp was already disabled, but definitely won't work as the + * region might now change and that wouldn't be detected: + */ + I830_STATECHANGE(i830, I830_UPLOAD_TEX(unit)); + return GL_TRUE; +} + + + + +void +i830UpdateTextureState(struct intel_context *intel) +{ + struct i830_context *i830 = i830_context(&intel->ctx); + GLboolean ok = GL_TRUE; + GLuint i; + + for (i = 0; i < I830_TEX_UNITS && ok; i++) { + switch (intel->ctx.Texture.Unit[i]._ReallyEnabled) { + case TEXTURE_1D_BIT: + case TEXTURE_2D_BIT: + case TEXTURE_CUBE_BIT: + ok = i830_update_tex_unit(intel, i, TEXCOORDS_ARE_NORMAL); + break; + case TEXTURE_RECT_BIT: + ok = i830_update_tex_unit(intel, i, TEXCOORDS_ARE_IN_TEXELUNITS); + break; + case 0: + if (i830->state.active & I830_UPLOAD_TEX(i)) + I830_ACTIVESTATE(i830, I830_UPLOAD_TEX(i), GL_FALSE); + break; + case TEXTURE_3D_BIT: + default: + ok = GL_FALSE; + break; + } + } + + FALLBACK(intel, I830_FALLBACK_TEXTURE, !ok); + + if (ok) + i830EmitTextureBlend(i830); +} diff --git a/src/mesa/drivers/dri/i915tex/i830_vtbl.c b/src/mesa/drivers/dri/i915tex/i830_vtbl.c new file mode 100644 index 00000000000..45502da290a --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/i830_vtbl.c @@ -0,0 +1,606 @@ +/************************************************************************** + * + * Copyright 2003 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. + * + **************************************************************************/ + + +#include "i830_context.h" +#include "i830_reg.h" +#include "intel_batchbuffer.h" +#include "intel_regions.h" +#include "tnl/t_context.h" +#include "tnl/t_vertex.h" + +#define FILE_DEBUG_FLAG DEBUG_STATE + +static GLboolean i830_check_vertex_size(struct intel_context *intel, + GLuint expected); + +#define SZ_TO_HW(sz) ((sz-2)&0x3) +#define EMIT_SZ(sz) (EMIT_1F + (sz) - 1) +#define EMIT_ATTR( ATTR, STYLE, V0 ) \ +do { \ + intel->vertex_attrs[intel->vertex_attr_count].attrib = (ATTR); \ + intel->vertex_attrs[intel->vertex_attr_count].format = (STYLE); \ + intel->vertex_attr_count++; \ + v0 |= V0; \ +} while (0) + +#define EMIT_PAD( N ) \ +do { \ + intel->vertex_attrs[intel->vertex_attr_count].attrib = 0; \ + intel->vertex_attrs[intel->vertex_attr_count].format = EMIT_PAD; \ + intel->vertex_attrs[intel->vertex_attr_count].offset = (N); \ + intel->vertex_attr_count++; \ +} while (0) + + +#define VRTX_TEX_SET_FMT(n, x) ((x)<<((n)*2)) +#define TEXBIND_SET(n, x) ((x)<<((n)*4)) + +static void +i830_render_start(struct intel_context *intel) +{ + GLcontext *ctx = &intel->ctx; + struct i830_context *i830 = i830_context(ctx); + TNLcontext *tnl = TNL_CONTEXT(ctx); + struct vertex_buffer *VB = &tnl->vb; + DECLARE_RENDERINPUTS(index_bitset); + GLuint v0 = _3DSTATE_VFT0_CMD; + GLuint v2 = _3DSTATE_VFT1_CMD; + GLuint mcsb1 = 0; + + RENDERINPUTS_COPY(index_bitset, tnl->render_inputs_bitset); + + /* Important: + */ + VB->AttribPtr[VERT_ATTRIB_POS] = VB->NdcPtr; + intel->vertex_attr_count = 0; + + /* EMIT_ATTR's must be in order as they tell t_vertex.c how to + * build up a hardware vertex. + */ + if (RENDERINPUTS_TEST_RANGE(index_bitset, _TNL_FIRST_TEX, _TNL_LAST_TEX)) { + EMIT_ATTR(_TNL_ATTRIB_POS, EMIT_4F_VIEWPORT, VFT0_XYZW); + intel->coloroffset = 4; + } + else { + EMIT_ATTR(_TNL_ATTRIB_POS, EMIT_3F_VIEWPORT, VFT0_XYZ); + intel->coloroffset = 3; + } + + if (RENDERINPUTS_TEST(index_bitset, _TNL_ATTRIB_POINTSIZE)) { + EMIT_ATTR(_TNL_ATTRIB_POINTSIZE, EMIT_1F, VFT0_POINT_WIDTH); + } + + EMIT_ATTR(_TNL_ATTRIB_COLOR0, EMIT_4UB_4F_BGRA, VFT0_DIFFUSE); + + intel->specoffset = 0; + if (RENDERINPUTS_TEST(index_bitset, _TNL_ATTRIB_COLOR1) || + RENDERINPUTS_TEST(index_bitset, _TNL_ATTRIB_FOG)) { + if (RENDERINPUTS_TEST(index_bitset, _TNL_ATTRIB_COLOR1)) { + intel->specoffset = intel->coloroffset + 1; + EMIT_ATTR(_TNL_ATTRIB_COLOR1, EMIT_3UB_3F_BGR, VFT0_SPEC); + } + else + EMIT_PAD(3); + + if (RENDERINPUTS_TEST(index_bitset, _TNL_ATTRIB_FOG)) + EMIT_ATTR(_TNL_ATTRIB_FOG, EMIT_1UB_1F, VFT0_SPEC); + else + EMIT_PAD(1); + } + + if (RENDERINPUTS_TEST_RANGE(index_bitset, _TNL_FIRST_TEX, _TNL_LAST_TEX)) { + int i, count = 0; + + for (i = 0; i < I830_TEX_UNITS; i++) { + if (RENDERINPUTS_TEST(index_bitset, _TNL_ATTRIB_TEX(i))) { + GLuint sz = VB->TexCoordPtr[i]->size; + GLuint emit; + GLuint mcs = (i830->state.Tex[i][I830_TEXREG_MCS] & + ~TEXCOORDTYPE_MASK); + + switch (sz) { + case 1: + case 2: + emit = EMIT_2F; + sz = 2; + mcs |= TEXCOORDTYPE_CARTESIAN; + break; + case 3: + emit = EMIT_3F; + sz = 3; + mcs |= TEXCOORDTYPE_VECTOR; + break; + case 4: + emit = EMIT_3F_XYW; + sz = 3; + mcs |= TEXCOORDTYPE_HOMOGENEOUS; + break; + default: + continue; + }; + + + EMIT_ATTR(_TNL_ATTRIB_TEX0 + i, emit, 0); + v2 |= VRTX_TEX_SET_FMT(count, SZ_TO_HW(sz)); + mcsb1 |= (count + 8) << (i * 4); + + if (mcs != i830->state.Tex[i][I830_TEXREG_MCS]) { + I830_STATECHANGE(i830, I830_UPLOAD_TEX(i)); + i830->state.Tex[i][I830_TEXREG_MCS] = mcs; + } + + count++; + } + } + + v0 |= VFT0_TEX_COUNT(count); + } + + /* Only need to change the vertex emit code if there has been a + * statechange to a new hardware vertex format: + */ + if (v0 != i830->state.Ctx[I830_CTXREG_VF] || + v2 != i830->state.Ctx[I830_CTXREG_VF2] || + mcsb1 != i830->state.Ctx[I830_CTXREG_MCSB1] || + !RENDERINPUTS_EQUAL(index_bitset, i830->last_index_bitset)) { + int k; + + I830_STATECHANGE(i830, I830_UPLOAD_CTX); + + /* Must do this *after* statechange, so as not to affect + * buffered vertices reliant on the old state: + */ + intel->vertex_size = + _tnl_install_attrs(ctx, + intel->vertex_attrs, + intel->vertex_attr_count, + intel->ViewportMatrix.m, 0); + + intel->vertex_size >>= 2; + + i830->state.Ctx[I830_CTXREG_VF] = v0; + i830->state.Ctx[I830_CTXREG_VF2] = v2; + i830->state.Ctx[I830_CTXREG_MCSB1] = mcsb1; + RENDERINPUTS_COPY(i830->last_index_bitset, index_bitset); + + k = i830_check_vertex_size(intel, intel->vertex_size); + assert(k); + } +} + +static void +i830_reduced_primitive_state(struct intel_context *intel, GLenum rprim) +{ + struct i830_context *i830 = i830_context(&intel->ctx); + GLuint st1 = i830->state.Stipple[I830_STPREG_ST1]; + + st1 &= ~ST1_ENABLE; + + switch (rprim) { + case GL_TRIANGLES: + if (intel->ctx.Polygon.StippleFlag && intel->hw_stipple) + st1 |= ST1_ENABLE; + break; + case GL_LINES: + case GL_POINTS: + default: + break; + } + + i830->intel.reduced_primitive = rprim; + + if (st1 != i830->state.Stipple[I830_STPREG_ST1]) { + INTEL_FIREVERTICES(intel); + + I830_STATECHANGE(i830, I830_UPLOAD_STIPPLE); + i830->state.Stipple[I830_STPREG_ST1] = st1; + } +} + +/* Pull apart the vertex format registers and figure out how large a + * vertex is supposed to be. + */ +static GLboolean +i830_check_vertex_size(struct intel_context *intel, GLuint expected) +{ + struct i830_context *i830 = i830_context(&intel->ctx); + int vft0 = i830->current->Ctx[I830_CTXREG_VF]; + int vft1 = i830->current->Ctx[I830_CTXREG_VF2]; + int nrtex = (vft0 & VFT0_TEX_COUNT_MASK) >> VFT0_TEX_COUNT_SHIFT; + int i, sz = 0; + + switch (vft0 & VFT0_XYZW_MASK) { + case VFT0_XY: + sz = 2; + break; + case VFT0_XYZ: + sz = 3; + break; + case VFT0_XYW: + sz = 3; + break; + case VFT0_XYZW: + sz = 4; + break; + default: + fprintf(stderr, "no xyzw specified\n"); + return 0; + } + + if (vft0 & VFT0_SPEC) + sz++; + if (vft0 & VFT0_DIFFUSE) + sz++; + if (vft0 & VFT0_DEPTH_OFFSET) + sz++; + if (vft0 & VFT0_POINT_WIDTH) + sz++; + + for (i = 0; i < nrtex; i++) { + switch (vft1 & VFT1_TEX0_MASK) { + case TEXCOORDFMT_2D: + sz += 2; + break; + case TEXCOORDFMT_3D: + sz += 3; + break; + case TEXCOORDFMT_4D: + sz += 4; + break; + case TEXCOORDFMT_1D: + sz += 1; + break; + } + vft1 >>= VFT1_TEX1_SHIFT; + } + + if (sz != expected) + fprintf(stderr, "vertex size mismatch %d/%d\n", sz, expected); + + return sz == expected; +} + +static void +i830_emit_invarient_state(struct intel_context *intel) +{ + BATCH_LOCALS; + + BEGIN_BATCH(40, 0); + + OUT_BATCH(_3DSTATE_DFLT_DIFFUSE_CMD); + OUT_BATCH(0); + + OUT_BATCH(_3DSTATE_DFLT_SPEC_CMD); + OUT_BATCH(0); + + OUT_BATCH(_3DSTATE_DFLT_Z_CMD); + OUT_BATCH(0); + + OUT_BATCH(_3DSTATE_FOG_MODE_CMD); + OUT_BATCH(FOGFUNC_ENABLE | + FOG_LINEAR_CONST | FOGSRC_INDEX_Z | ENABLE_FOG_DENSITY); + OUT_BATCH(0); + OUT_BATCH(0); + + + OUT_BATCH(_3DSTATE_MAP_TEX_STREAM_CMD | + MAP_UNIT(0) | + DISABLE_TEX_STREAM_BUMP | + ENABLE_TEX_STREAM_COORD_SET | + TEX_STREAM_COORD_SET(0) | + ENABLE_TEX_STREAM_MAP_IDX | TEX_STREAM_MAP_IDX(0)); + OUT_BATCH(_3DSTATE_MAP_TEX_STREAM_CMD | + MAP_UNIT(1) | + DISABLE_TEX_STREAM_BUMP | + ENABLE_TEX_STREAM_COORD_SET | + TEX_STREAM_COORD_SET(1) | + ENABLE_TEX_STREAM_MAP_IDX | TEX_STREAM_MAP_IDX(1)); + OUT_BATCH(_3DSTATE_MAP_TEX_STREAM_CMD | + MAP_UNIT(2) | + DISABLE_TEX_STREAM_BUMP | + ENABLE_TEX_STREAM_COORD_SET | + TEX_STREAM_COORD_SET(2) | + ENABLE_TEX_STREAM_MAP_IDX | TEX_STREAM_MAP_IDX(2)); + OUT_BATCH(_3DSTATE_MAP_TEX_STREAM_CMD | + MAP_UNIT(3) | + DISABLE_TEX_STREAM_BUMP | + ENABLE_TEX_STREAM_COORD_SET | + TEX_STREAM_COORD_SET(3) | + ENABLE_TEX_STREAM_MAP_IDX | TEX_STREAM_MAP_IDX(3)); + + OUT_BATCH(_3DSTATE_MAP_COORD_TRANSFORM); + OUT_BATCH(DISABLE_TEX_TRANSFORM | TEXTURE_SET(0)); + OUT_BATCH(_3DSTATE_MAP_COORD_TRANSFORM); + OUT_BATCH(DISABLE_TEX_TRANSFORM | TEXTURE_SET(1)); + OUT_BATCH(_3DSTATE_MAP_COORD_TRANSFORM); + OUT_BATCH(DISABLE_TEX_TRANSFORM | TEXTURE_SET(2)); + OUT_BATCH(_3DSTATE_MAP_COORD_TRANSFORM); + OUT_BATCH(DISABLE_TEX_TRANSFORM | TEXTURE_SET(3)); + + OUT_BATCH(_3DSTATE_RASTER_RULES_CMD | + ENABLE_POINT_RASTER_RULE | + OGL_POINT_RASTER_RULE | + ENABLE_LINE_STRIP_PROVOKE_VRTX | + ENABLE_TRI_FAN_PROVOKE_VRTX | + ENABLE_TRI_STRIP_PROVOKE_VRTX | + LINE_STRIP_PROVOKE_VRTX(1) | + TRI_FAN_PROVOKE_VRTX(2) | TRI_STRIP_PROVOKE_VRTX(2)); + + OUT_BATCH(_3DSTATE_VERTEX_TRANSFORM); + OUT_BATCH(DISABLE_VIEWPORT_TRANSFORM | DISABLE_PERSPECTIVE_DIVIDE); + + OUT_BATCH(_3DSTATE_W_STATE_CMD); + OUT_BATCH(MAGIC_W_STATE_DWORD1); + OUT_BATCH(0x3f800000 /* 1.0 in IEEE float */ ); + + + OUT_BATCH(_3DSTATE_COLOR_FACTOR_CMD); + OUT_BATCH(0x80808080); /* .5 required in alpha for GL_DOT3_RGBA_EXT */ + + ADVANCE_BATCH(); +} + + +#define emit( intel, state, size ) \ +do { \ + int k; \ + BEGIN_BATCH(size / sizeof(GLuint), 0); \ + for (k = 0 ; k < size / sizeof(GLuint) ; k++) { \ + if (0) _mesa_printf(" 0x%08x\n", state[k]); \ + OUT_BATCH(state[k]); \ + } \ + ADVANCE_BATCH(); \ +} while (0) + +static GLuint +get_state_size(struct i830_hw_state *state) +{ + GLuint dirty = state->active & ~state->emitted; + GLuint sz = 0; + GLuint i; + + if (dirty & I830_UPLOAD_INVARIENT) + sz += 40 * sizeof(int); + + if (dirty & I830_UPLOAD_CTX) + sz += sizeof(state->Ctx); + + if (dirty & I830_UPLOAD_BUFFERS) + sz += sizeof(state->Buffer); + + if (dirty & I830_UPLOAD_STIPPLE) + sz += sizeof(state->Stipple); + + for (i = 0; i < I830_TEX_UNITS; i++) { + if ((dirty & I830_UPLOAD_TEX(i))) + sz += sizeof(state->Tex[i]); + + if (dirty & I830_UPLOAD_TEXBLEND(i)) + sz += state->TexBlendWordsUsed[i] * 4; + } + + return sz; +} + + +/* Push the state into the sarea and/or texture memory. + */ +static void +i830_emit_state(struct intel_context *intel) +{ + struct i830_context *i830 = i830_context(&intel->ctx); + struct i830_hw_state *state = i830->current; + int i; + GLuint dirty; + BATCH_LOCALS; + + /* We don't hold the lock at this point, so want to make sure that + * there won't be a buffer wrap. + * + * It might be better to talk about explicit places where + * scheduling is allowed, rather than assume that it is whenever a + * batchbuffer fills up. + */ + intel_batchbuffer_require_space(intel->batch, get_state_size(state), 0); + + /* Do this here as we may have flushed the batchbuffer above, + * causing more state to be dirty! + */ + dirty = state->active & ~state->emitted; + + if (dirty & I830_UPLOAD_INVARIENT) { + DBG("I830_UPLOAD_INVARIENT:\n"); + i830_emit_invarient_state(intel); + } + + if (dirty & I830_UPLOAD_CTX) { + DBG("I830_UPLOAD_CTX:\n"); + emit(i830, state->Ctx, sizeof(state->Ctx)); + + } + + if (dirty & I830_UPLOAD_BUFFERS) { + DBG("I830_UPLOAD_BUFFERS:\n"); + BEGIN_BATCH(I830_DEST_SETUP_SIZE + 2, 0); + OUT_BATCH(state->Buffer[I830_DESTREG_CBUFADDR0]); + OUT_BATCH(state->Buffer[I830_DESTREG_CBUFADDR1]); + OUT_RELOC(state->draw_region->buffer, + DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_WRITE, + DRM_BO_MASK_MEM | DRM_BO_FLAG_WRITE, 0); + + if (state->depth_region) { + OUT_BATCH(state->Buffer[I830_DESTREG_DBUFADDR0]); + OUT_BATCH(state->Buffer[I830_DESTREG_DBUFADDR1]); + OUT_RELOC(state->depth_region->buffer, + DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_WRITE, + DRM_BO_MASK_MEM | DRM_BO_FLAG_WRITE, 0); + } + + OUT_BATCH(state->Buffer[I830_DESTREG_DV0]); + OUT_BATCH(state->Buffer[I830_DESTREG_DV1]); + OUT_BATCH(state->Buffer[I830_DESTREG_SENABLE]); + OUT_BATCH(state->Buffer[I830_DESTREG_SR0]); + OUT_BATCH(state->Buffer[I830_DESTREG_SR1]); + OUT_BATCH(state->Buffer[I830_DESTREG_SR2]); + ADVANCE_BATCH(); + } + + if (dirty & I830_UPLOAD_STIPPLE) { + DBG("I830_UPLOAD_STIPPLE:\n"); + emit(i830, state->Stipple, sizeof(state->Stipple)); + } + + for (i = 0; i < I830_TEX_UNITS; i++) { + if ((dirty & I830_UPLOAD_TEX(i))) { + DBG("I830_UPLOAD_TEX(%d):\n", i); + + BEGIN_BATCH(I830_TEX_SETUP_SIZE + 1, 0); + OUT_BATCH(state->Tex[i][I830_TEXREG_TM0LI]); + + if (state->tex_buffer[i]) { + OUT_RELOC(state->tex_buffer[i], + DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_READ, + DRM_BO_MASK_MEM | DRM_BO_FLAG_READ, + state->tex_offset[i] | TM0S0_USE_FENCE); + } + else { + assert(i == 0); + assert(state == &i830->meta); + OUT_BATCH(0); + } + + OUT_BATCH(state->Tex[i][I830_TEXREG_TM0S1]); + OUT_BATCH(state->Tex[i][I830_TEXREG_TM0S2]); + OUT_BATCH(state->Tex[i][I830_TEXREG_TM0S3]); + OUT_BATCH(state->Tex[i][I830_TEXREG_TM0S4]); + OUT_BATCH(state->Tex[i][I830_TEXREG_MCS]); + OUT_BATCH(state->Tex[i][I830_TEXREG_CUBE]); + } + + if (dirty & I830_UPLOAD_TEXBLEND(i)) { + DBG("I830_UPLOAD_TEXBLEND(%d): %d words\n", i, + state->TexBlendWordsUsed[i]); + emit(i830, state->TexBlend[i], state->TexBlendWordsUsed[i] * 4); + } + } + + state->emitted |= dirty; +} + +static void +i830_destroy_context(struct intel_context *intel) +{ + _tnl_free_vertices(&intel->ctx); +} + +static void +i830_set_draw_region(struct intel_context *intel, + struct intel_region *draw_region, + struct intel_region *depth_region) +{ + struct i830_context *i830 = i830_context(&intel->ctx); + + intel_region_release(&i830->state.draw_region); + intel_region_release(&i830->state.depth_region); + intel_region_reference(&i830->state.draw_region, draw_region); + intel_region_reference(&i830->state.depth_region, depth_region); + + /* XXX FBO: Need code from i915_set_draw_region() */ + + I830_STATECHANGE(i830, I830_UPLOAD_BUFFERS); + I830_STATECHANGE(i830, I830_UPLOAD_BUFFERS); + i830->state.Buffer[I830_DESTREG_CBUFADDR1] = + (BUF_3D_ID_COLOR_BACK | BUF_3D_PITCH(draw_region->pitch) | + BUF_3D_USE_FENCE); + i830->state.Buffer[I830_DESTREG_DBUFADDR1] = + (BUF_3D_ID_DEPTH | BUF_3D_PITCH(depth_region->pitch) | + BUF_3D_USE_FENCE); +} + +#if 0 +static void +i830_update_color_z_regions(intelContextPtr intel, + const intelRegion * colorRegion, + const intelRegion * depthRegion) +{ + i830ContextPtr i830 = I830_CONTEXT(intel); + + i830->state.Buffer[I830_DESTREG_CBUFADDR1] = + (BUF_3D_ID_COLOR_BACK | BUF_3D_PITCH(colorRegion->pitch) | + BUF_3D_USE_FENCE); + i830->state.Buffer[I830_DESTREG_CBUFADDR2] = colorRegion->offset; + + i830->state.Buffer[I830_DESTREG_DBUFADDR1] = + (BUF_3D_ID_DEPTH | BUF_3D_PITCH(depthRegion->pitch) | BUF_3D_USE_FENCE); + i830->state.Buffer[I830_DESTREG_DBUFADDR2] = depthRegion->offset; +} +#endif + + +/* This isn't really handled at the moment. + */ +static void +i830_lost_hardware(struct intel_context *intel) +{ + struct i830_context *i830 = i830_context(&intel->ctx); + i830->state.emitted = 0; +} + + + +static GLuint +i830_flush_cmd(void) +{ + return MI_FLUSH | FLUSH_MAP_CACHE; +} + + +static void +i830_assert_not_dirty( struct intel_context *intel ) +{ + struct i830_context *i830 = i830_context(&intel->ctx); + struct i830_hw_state *state = i830->current; + GLuint dirty = state->active & ~state->emitted; + assert(!dirty); +} + + +void +i830InitVtbl(struct i830_context *i830) +{ + i830->intel.vtbl.check_vertex_size = i830_check_vertex_size; + i830->intel.vtbl.destroy = i830_destroy_context; + i830->intel.vtbl.emit_state = i830_emit_state; + i830->intel.vtbl.lost_hardware = i830_lost_hardware; + i830->intel.vtbl.reduced_primitive_state = i830_reduced_primitive_state; + i830->intel.vtbl.set_draw_region = i830_set_draw_region; + i830->intel.vtbl.update_texture_state = i830UpdateTextureState; + i830->intel.vtbl.flush_cmd = i830_flush_cmd; + i830->intel.vtbl.render_start = i830_render_start; + i830->intel.vtbl.assert_not_dirty = i830_assert_not_dirty; +} diff --git a/src/mesa/drivers/dri/i915tex/i915_context.c b/src/mesa/drivers/dri/i915tex/i915_context.c new file mode 100644 index 00000000000..4cbe29d79d6 --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/i915_context.c @@ -0,0 +1,175 @@ +/************************************************************************** + * + * Copyright 2003 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. + * + **************************************************************************/ + +#include "i915_context.h" +#include "imports.h" +#include "intel_tex.h" +#include "intel_tris.h" +#include "tnl/t_context.h" +#include "tnl/t_pipeline.h" +#include "tnl/t_vertex.h" + +#include "swrast/swrast.h" +#include "swrast_setup/swrast_setup.h" +#include "tnl/tnl.h" +#include "array_cache/acache.h" + +#include "utils.h" +#include "i915_reg.h" + +#include "intel_regions.h" +#include "intel_batchbuffer.h" + +/*************************************** + * Mesa's Driver Functions + ***************************************/ + +static const struct dri_extension i915_extensions[] = { + {"GL_ARB_depth_texture", NULL}, + {"GL_ARB_fragment_program", NULL}, + {"GL_ARB_shadow", NULL}, + {"GL_ARB_texture_env_crossbar", NULL}, + {"GL_ARB_texture_non_power_of_two", NULL}, + {"GL_EXT_shadow_funcs", NULL}, + /* ARB extn won't work if not enabled */ + {"GL_SGIX_depth_texture", NULL}, + {NULL, NULL} +}; + +/* Override intel default. + */ +static void +i915InvalidateState(GLcontext * ctx, GLuint new_state) +{ + _swrast_InvalidateState(ctx, new_state); + _swsetup_InvalidateState(ctx, new_state); + _ac_InvalidateState(ctx, new_state); + _tnl_InvalidateState(ctx, new_state); + _tnl_invalidate_vertex_state(ctx, new_state); + intel_context(ctx)->NewGLState |= new_state; + + /* Todo: gather state values under which tracked parameters become + * invalidated, add callbacks for things like + * ProgramLocalParameters, etc. + */ + { + struct i915_fragment_program *p = + (struct i915_fragment_program *) ctx->FragmentProgram._Current; + if (p && p->nr_params) + p->params_uptodate = 0; + } + + if (new_state & (_NEW_FOG | _NEW_HINT | _NEW_PROGRAM)) + i915_update_fog(ctx); +} + + +static void +i915InitDriverFunctions(struct dd_function_table *functions) +{ + intelInitDriverFunctions(functions); + i915InitStateFunctions(functions); + i915InitTextureFuncs(functions); + i915InitFragProgFuncs(functions); + functions->UpdateState = i915InvalidateState; +} + + + +GLboolean +i915CreateContext(const __GLcontextModes * mesaVis, + __DRIcontextPrivate * driContextPriv, + void *sharedContextPrivate) +{ + struct dd_function_table functions; + struct i915_context *i915 = + (struct i915_context *) CALLOC_STRUCT(i915_context); + struct intel_context *intel = &i915->intel; + GLcontext *ctx = &intel->ctx; + + if (!i915) + return GL_FALSE; + + if (0) + _mesa_printf("\ntexmem-0-3 branch\n\n"); + + i915InitVtbl(i915); + i915InitMetaFuncs(i915); + + i915InitDriverFunctions(&functions); + + if (!intelInitContext(intel, mesaVis, driContextPriv, + sharedContextPrivate, &functions)) { + FREE(i915); + return GL_FALSE; + } + + ctx->Const.MaxTextureUnits = I915_TEX_UNITS; + ctx->Const.MaxTextureImageUnits = I915_TEX_UNITS; + ctx->Const.MaxTextureCoordUnits = I915_TEX_UNITS; + + + /* Advertise the full hardware capabilities. The new memory + * manager should cope much better with overload situations: + */ + ctx->Const.MaxTextureLevels = 12; + ctx->Const.Max3DTextureLevels = 9; + ctx->Const.MaxCubeTextureLevels = 12; + ctx->Const.MaxTextureRectSize = (1 << 11); + ctx->Const.MaxTextureUnits = I915_TEX_UNITS; + + /* GL_ARB_fragment_program limits - don't think Mesa actually + * validates programs against these, and in any case one ARB + * instruction can translate to more than one HW instruction, so + * we'll still have to check and fallback each time. + */ + ctx->Const.FragmentProgram.MaxNativeTemps = I915_MAX_TEMPORARY; + ctx->Const.FragmentProgram.MaxNativeAttribs = 11; /* 8 tex, 2 color, fog */ + ctx->Const.FragmentProgram.MaxNativeParameters = I915_MAX_CONSTANT; + ctx->Const.FragmentProgram.MaxNativeAluInstructions = I915_MAX_ALU_INSN; + ctx->Const.FragmentProgram.MaxNativeTexInstructions = I915_MAX_TEX_INSN; + ctx->Const.FragmentProgram.MaxNativeInstructions = (I915_MAX_ALU_INSN + + I915_MAX_TEX_INSN); + ctx->Const.FragmentProgram.MaxNativeTexIndirections = + I915_MAX_TEX_INDIRECT; + ctx->Const.FragmentProgram.MaxNativeAddressRegs = 0; /* I don't think we have one */ + + ctx->_MaintainTexEnvProgram = 1; + ctx->_UseTexEnvProgram = 1; + + driInitExtensions(ctx, i915_extensions, GL_FALSE); + + + _tnl_init_vertices(ctx, ctx->Const.MaxArrayLockSize + 12, + 36 * sizeof(GLfloat)); + + intel->verts = TNL_CONTEXT(ctx)->clipspace.vertex_buf; + + i915InitState(i915); + + return GL_TRUE; +} diff --git a/src/mesa/drivers/dri/i915tex/i915_context.h b/src/mesa/drivers/dri/i915tex/i915_context.h new file mode 100644 index 00000000000..5ae76fcd185 --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/i915_context.h @@ -0,0 +1,367 @@ + /************************************************************************** + * + * Copyright 2003 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. + * + **************************************************************************/ + +#ifndef I915CONTEXT_INC +#define I915CONTEXT_INC + +#include "intel_context.h" + +#define I915_FALLBACK_TEXTURE 0x1000 +#define I915_FALLBACK_COLORMASK 0x2000 +#define I915_FALLBACK_STENCIL 0x4000 +#define I915_FALLBACK_STIPPLE 0x8000 +#define I915_FALLBACK_PROGRAM 0x10000 +#define I915_FALLBACK_LOGICOP 0x20000 +#define I915_FALLBACK_POLYGON_SMOOTH 0x40000 +#define I915_FALLBACK_POINT_SMOOTH 0x80000 + +#define I915_UPLOAD_CTX 0x1 +#define I915_UPLOAD_BUFFERS 0x2 +#define I915_UPLOAD_STIPPLE 0x4 +#define I915_UPLOAD_PROGRAM 0x8 +#define I915_UPLOAD_CONSTANTS 0x10 +#define I915_UPLOAD_FOG 0x20 +#define I915_UPLOAD_INVARIENT 0x40 +#define I915_UPLOAD_DEFAULTS 0x80 +#define I915_UPLOAD_TEX(i) (0x00010000<<(i)) +#define I915_UPLOAD_TEX_ALL (0x00ff0000) +#define I915_UPLOAD_TEX_0_SHIFT 16 + + +/* State structure offsets - these will probably disappear. + */ +#define I915_DESTREG_CBUFADDR0 0 +#define I915_DESTREG_CBUFADDR1 1 +#define I915_DESTREG_DBUFADDR0 3 +#define I915_DESTREG_DBUFADDR1 4 +#define I915_DESTREG_DV0 6 +#define I915_DESTREG_DV1 7 +#define I915_DESTREG_SENABLE 8 +#define I915_DESTREG_SR0 9 +#define I915_DESTREG_SR1 10 +#define I915_DESTREG_SR2 11 +#define I915_DEST_SETUP_SIZE 12 + +#define I915_CTXREG_STATE4 0 +#define I915_CTXREG_LI 1 +#define I915_CTXREG_LIS2 2 +#define I915_CTXREG_LIS4 3 +#define I915_CTXREG_LIS5 4 +#define I915_CTXREG_LIS6 5 +#define I915_CTXREG_IAB 6 +#define I915_CTXREG_BLENDCOLOR0 7 +#define I915_CTXREG_BLENDCOLOR1 8 +#define I915_CTX_SETUP_SIZE 9 + +#define I915_FOGREG_COLOR 0 +#define I915_FOGREG_MODE0 1 +#define I915_FOGREG_MODE1 2 +#define I915_FOGREG_MODE2 3 +#define I915_FOGREG_MODE3 4 +#define I915_FOG_SETUP_SIZE 5 + +#define I915_STPREG_ST0 0 +#define I915_STPREG_ST1 1 +#define I915_STP_SETUP_SIZE 2 + +#define I915_TEXREG_MS3 1 +#define I915_TEXREG_MS4 2 +#define I915_TEXREG_SS2 3 +#define I915_TEXREG_SS3 4 +#define I915_TEXREG_SS4 5 +#define I915_TEX_SETUP_SIZE 6 + +#define I915_DEFREG_C0 0 +#define I915_DEFREG_C1 1 +#define I915_DEFREG_S0 2 +#define I915_DEFREG_S1 3 +#define I915_DEFREG_Z0 4 +#define I915_DEFREG_Z1 5 +#define I915_DEF_SETUP_SIZE 6 + + +#define I915_MAX_CONSTANT 32 +#define I915_CONSTANT_SIZE (2+(4*I915_MAX_CONSTANT)) + + +#define I915_PROGRAM_SIZE 192 + + +/* Hardware version of a parsed fragment program. "Derived" from the + * mesa fragment_program struct. + */ +struct i915_fragment_program +{ + struct gl_fragment_program FragProg; + + GLboolean translated; + GLboolean params_uptodate; + GLboolean on_hardware; + GLboolean error; /* If program is malformed for any reason. */ + + GLuint nr_tex_indirect; + GLuint nr_tex_insn; + GLuint nr_alu_insn; + GLuint nr_decl_insn; + + + + + /* TODO: split between the stored representation of a program and + * the state used to build that representation. + */ + GLcontext *ctx; + + GLuint declarations[I915_PROGRAM_SIZE]; + GLuint program[I915_PROGRAM_SIZE]; + + GLfloat constant[I915_MAX_CONSTANT][4]; + GLuint constant_flags[I915_MAX_CONSTANT]; + GLuint nr_constants; + + GLuint *csr; /* Cursor, points into program. + */ + + GLuint *decl; /* Cursor, points into declarations. + */ + + GLuint decl_s; /* flags for which s regs need to be decl'd */ + GLuint decl_t; /* flags for which t regs need to be decl'd */ + + GLuint temp_flag; /* Tracks temporary regs which are in + * use. + */ + + GLuint utemp_flag; /* Tracks TYPE_U temporary regs which are in + * use. + */ + + + + /* Helpers for i915_fragprog.c: + */ + GLuint wpos_tex; + GLboolean depth_written; + + struct + { + GLuint reg; /* Hardware constant idx */ + const GLfloat *values; /* Pointer to tracked values */ + } param[I915_MAX_CONSTANT]; + GLuint nr_params; + + + /* Helpers for i915_texprog.c: + */ + GLuint src_texture; /* Reg containing sampled texture color, + * else UREG_BAD. + */ + + GLuint src_previous; /* Reg containing color from previous + * stage. May need to be decl'd. + */ + + GLuint last_tex_stage; /* Number of last enabled texture unit */ + + struct vertex_buffer *VB; +}; + + + + + + + +#define I915_TEX_UNITS 8 + + +struct i915_hw_state +{ + GLuint Ctx[I915_CTX_SETUP_SIZE]; + GLuint Buffer[I915_DEST_SETUP_SIZE]; + GLuint Stipple[I915_STP_SETUP_SIZE]; + GLuint Fog[I915_FOG_SETUP_SIZE]; + GLuint Defaults[I915_DEF_SETUP_SIZE]; + GLuint Tex[I915_TEX_UNITS][I915_TEX_SETUP_SIZE]; + GLuint Constant[I915_CONSTANT_SIZE]; + GLuint ConstantSize; + GLuint Program[I915_PROGRAM_SIZE]; + GLuint ProgramSize; + + /* Region pointers for relocation: + */ + struct intel_region *draw_region; + struct intel_region *depth_region; +/* struct intel_region *tex_region[I915_TEX_UNITS]; */ + + /* Regions aren't actually that appropriate here as the memory may + * be from a PBO or FBO. Just use the buffer id. Will have to do + * this for draw and depth for FBO's... + */ + struct _DriBufferObject *tex_buffer[I915_TEX_UNITS]; + GLuint tex_offset[I915_TEX_UNITS]; + + + GLuint active; /* I915_UPLOAD_* */ + GLuint emitted; /* I915_UPLOAD_* */ +}; + +#define I915_FOG_PIXEL 2 +#define I915_FOG_VERTEX 1 +#define I915_FOG_NONE 0 + +struct i915_context +{ + struct intel_context intel; + + GLuint last_ReallyEnabled; + GLuint vertex_fog; + GLuint lodbias_ss2[MAX_TEXTURE_UNITS]; + + + struct i915_fragment_program tex_program; + struct i915_fragment_program *current_program; + + struct i915_hw_state meta, initial, state, *current; +}; + + +#define I915_STATECHANGE(i915, flag) \ +do { \ + INTEL_FIREVERTICES( &(i915)->intel ); \ + (i915)->state.emitted &= ~(flag); \ +} while (0) + +#define I915_ACTIVESTATE(i915, flag, mode) \ +do { \ + INTEL_FIREVERTICES( &(i915)->intel ); \ + if (mode) \ + (i915)->state.active |= (flag); \ + else \ + (i915)->state.active &= ~(flag); \ +} while (0) + + +/*====================================================================== + * i915_vtbl.c + */ +extern void i915InitVtbl(struct i915_context *i915); + +extern void +i915_state_draw_region(struct intel_context *intel, + struct i915_hw_state *state, + struct intel_region *color_region, + struct intel_region *depth_region); + + + +#define SZ_TO_HW(sz) ((sz-2)&0x3) +#define EMIT_SZ(sz) (EMIT_1F + (sz) - 1) +#define EMIT_ATTR( ATTR, STYLE, S4, SZ ) \ +do { \ + intel->vertex_attrs[intel->vertex_attr_count].attrib = (ATTR); \ + intel->vertex_attrs[intel->vertex_attr_count].format = (STYLE); \ + s4 |= S4; \ + intel->vertex_attr_count++; \ + offset += (SZ); \ +} while (0) + +#define EMIT_PAD( N ) \ +do { \ + intel->vertex_attrs[intel->vertex_attr_count].attrib = 0; \ + intel->vertex_attrs[intel->vertex_attr_count].format = EMIT_PAD; \ + intel->vertex_attrs[intel->vertex_attr_count].offset = (N); \ + intel->vertex_attr_count++; \ + offset += (N); \ +} while (0) + + + +/*====================================================================== + * i915_context.c + */ +extern GLboolean i915CreateContext(const __GLcontextModes * mesaVis, + __DRIcontextPrivate * driContextPriv, + void *sharedContextPrivate); + + +/*====================================================================== + * i915_texprog.c + */ +extern void i915ValidateTextureProgram(struct i915_context *i915); + + +/*====================================================================== + * i915_debug.c + */ +extern void i915_disassemble_program(const GLuint * program, GLuint sz); +extern void i915_print_ureg(const char *msg, GLuint ureg); + + +/*====================================================================== + * i915_state.c + */ +extern void i915InitStateFunctions(struct dd_function_table *functions); +extern void i915InitState(struct i915_context *i915); +extern void i915_update_fog(GLcontext * ctx); + + +/*====================================================================== + * i915_tex.c + */ +extern void i915UpdateTextureState(struct intel_context *intel); +extern void i915InitTextureFuncs(struct dd_function_table *functions); + +/*====================================================================== + * i915_metaops.c + */ +void i915InitMetaFuncs(struct i915_context *i915); + + +/*====================================================================== + * i915_fragprog.c + */ +extern void i915ValidateFragmentProgram(struct i915_context *i915); +extern void i915InitFragProgFuncs(struct dd_function_table *functions); + +/*====================================================================== + * Inline conversion functions. These are better-typed than the + * macros used previously: + */ +static INLINE struct i915_context * +i915_context(GLcontext * ctx) +{ + return (struct i915_context *) ctx; +} + + + +#define I915_CONTEXT(ctx) i915_context(ctx) + + + +#endif diff --git a/src/mesa/drivers/dri/i915tex/i915_debug.c b/src/mesa/drivers/dri/i915tex/i915_debug.c new file mode 100644 index 00000000000..974527e14cc --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/i915_debug.c @@ -0,0 +1,334 @@ +/************************************************************************** + * + * Copyright 2003 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. + * + **************************************************************************/ + +#include "i915_reg.h" +#include "i915_context.h" +#include + + +static const char *opcodes[0x20] = { + "NOP", + "ADD", + "MOV", + "MUL", + "MAD", + "DP2ADD", + "DP3", + "DP4", + "FRC", + "RCP", + "RSQ", + "EXP", + "LOG", + "CMP", + "MIN", + "MAX", + "FLR", + "MOD", + "TRC", + "SGE", + "SLT", + "TEXLD", + "TEXLDP", + "TEXLDB", + "TEXKILL", + "DCL", + "0x1a", + "0x1b", + "0x1c", + "0x1d", + "0x1e", + "0x1f", +}; + + +static const int args[0x20] = { + 0, /* 0 nop */ + 2, /* 1 add */ + 1, /* 2 mov */ + 2, /* 3 m ul */ + 3, /* 4 mad */ + 3, /* 5 dp2add */ + 2, /* 6 dp3 */ + 2, /* 7 dp4 */ + 1, /* 8 frc */ + 1, /* 9 rcp */ + 1, /* a rsq */ + 1, /* b exp */ + 1, /* c log */ + 3, /* d cmp */ + 2, /* e min */ + 2, /* f max */ + 1, /* 10 flr */ + 1, /* 11 mod */ + 1, /* 12 trc */ + 2, /* 13 sge */ + 2, /* 14 slt */ + 1, + 1, + 1, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, +}; + + +static const char *regname[0x8] = { + "R", + "T", + "CONST", + "S", + "OC", + "OD", + "U", + "UNKNOWN", +}; + +static void +print_reg_type_nr(GLuint type, GLuint nr) +{ + switch (type) { + case REG_TYPE_T: + switch (nr) { + case T_DIFFUSE: + fprintf(stderr, "T_DIFFUSE"); + return; + case T_SPECULAR: + fprintf(stderr, "T_SPECULAR"); + return; + case T_FOG_W: + fprintf(stderr, "T_FOG_W"); + return; + default: + fprintf(stderr, "T_TEX%d", nr); + return; + } + case REG_TYPE_OC: + if (nr == 0) { + fprintf(stderr, "oC"); + return; + } + break; + case REG_TYPE_OD: + if (nr == 0) { + fprintf(stderr, "oD"); + return; + } + break; + default: + break; + } + + fprintf(stderr, "%s[%d]", regname[type], nr); +} + +#define REG_SWIZZLE_MASK 0x7777 +#define REG_NEGATE_MASK 0x8888 + +#define REG_SWIZZLE_XYZW ((SRC_X << A2_SRC2_CHANNEL_X_SHIFT) | \ + (SRC_Y << A2_SRC2_CHANNEL_Y_SHIFT) | \ + (SRC_Z << A2_SRC2_CHANNEL_Z_SHIFT) | \ + (SRC_W << A2_SRC2_CHANNEL_W_SHIFT)) + + +static void +print_reg_neg_swizzle(GLuint reg) +{ + int i; + + if ((reg & REG_SWIZZLE_MASK) == REG_SWIZZLE_XYZW && + (reg & REG_NEGATE_MASK) == 0) + return; + + fprintf(stderr, "."); + + for (i = 3; i >= 0; i--) { + if (reg & (1 << ((i * 4) + 3))) + fprintf(stderr, "-"); + + switch ((reg >> (i * 4)) & 0x7) { + case 0: + fprintf(stderr, "x"); + break; + case 1: + fprintf(stderr, "y"); + break; + case 2: + fprintf(stderr, "z"); + break; + case 3: + fprintf(stderr, "w"); + break; + case 4: + fprintf(stderr, "0"); + break; + case 5: + fprintf(stderr, "1"); + break; + default: + fprintf(stderr, "?"); + break; + } + } +} + + +static void +print_src_reg(GLuint dword) +{ + GLuint nr = (dword >> A2_SRC2_NR_SHIFT) & REG_NR_MASK; + GLuint type = (dword >> A2_SRC2_TYPE_SHIFT) & REG_TYPE_MASK; + print_reg_type_nr(type, nr); + print_reg_neg_swizzle(dword); +} + +void +i915_print_ureg(const char *msg, GLuint ureg) +{ + fprintf(stderr, "%s: ", msg); + print_src_reg(ureg >> 8); + fprintf(stderr, "\n"); +} + +static void +print_dest_reg(GLuint dword) +{ + GLuint nr = (dword >> A0_DEST_NR_SHIFT) & REG_NR_MASK; + GLuint type = (dword >> A0_DEST_TYPE_SHIFT) & REG_TYPE_MASK; + print_reg_type_nr(type, nr); + if ((dword & A0_DEST_CHANNEL_ALL) == A0_DEST_CHANNEL_ALL) + return; + fprintf(stderr, "."); + if (dword & A0_DEST_CHANNEL_X) + fprintf(stderr, "x"); + if (dword & A0_DEST_CHANNEL_Y) + fprintf(stderr, "y"); + if (dword & A0_DEST_CHANNEL_Z) + fprintf(stderr, "z"); + if (dword & A0_DEST_CHANNEL_W) + fprintf(stderr, "w"); +} + + +#define GET_SRC0_REG(r0, r1) ((r0<<14)|(r1>>A1_SRC0_CHANNEL_W_SHIFT)) +#define GET_SRC1_REG(r0, r1) ((r0<<8)|(r1>>A2_SRC1_CHANNEL_W_SHIFT)) +#define GET_SRC2_REG(r) (r) + + +static void +print_arith_op(GLuint opcode, const GLuint * program) +{ + if (opcode != A0_NOP) { + print_dest_reg(program[0]); + if (program[0] & A0_DEST_SATURATE) + fprintf(stderr, " = SATURATE "); + else + fprintf(stderr, " = "); + } + + fprintf(stderr, "%s ", opcodes[opcode]); + + print_src_reg(GET_SRC0_REG(program[0], program[1])); + if (args[opcode] == 1) { + fprintf(stderr, "\n"); + return; + } + + fprintf(stderr, ", "); + print_src_reg(GET_SRC1_REG(program[1], program[2])); + if (args[opcode] == 2) { + fprintf(stderr, "\n"); + return; + } + + fprintf(stderr, ", "); + print_src_reg(GET_SRC2_REG(program[2])); + fprintf(stderr, "\n"); + return; +} + + +static void +print_tex_op(GLuint opcode, const GLuint * program) +{ + print_dest_reg(program[0] | A0_DEST_CHANNEL_ALL); + fprintf(stderr, " = "); + + fprintf(stderr, "%s ", opcodes[opcode]); + + fprintf(stderr, "S[%d],", program[0] & T0_SAMPLER_NR_MASK); + + print_reg_type_nr((program[1] >> T1_ADDRESS_REG_TYPE_SHIFT) & + REG_TYPE_MASK, + (program[1] >> T1_ADDRESS_REG_NR_SHIFT) & REG_NR_MASK); + fprintf(stderr, "\n"); +} + +static void +print_dcl_op(GLuint opcode, const GLuint * program) +{ + fprintf(stderr, "%s ", opcodes[opcode]); + print_dest_reg(program[0] | A0_DEST_CHANNEL_ALL); + fprintf(stderr, "\n"); +} + + +void +i915_disassemble_program(const GLuint * program, GLuint sz) +{ + GLuint size = program[0] & 0x1ff; + GLint i; + + fprintf(stderr, "BEGIN\n"); + + if (size + 2 != sz) { + fprintf(stderr, "%s: program size mismatch %d/%d\n", __FUNCTION__, + size + 2, sz); + exit(1); + } + + program++; + for (i = 1; i < sz; i += 3, program += 3) { + GLuint opcode = program[0] & (0x1f << 24); + + if ((GLint) opcode >= A0_NOP && opcode <= A0_SLT) + print_arith_op(opcode >> 24, program); + else if (opcode >= T0_TEXLD && opcode <= T0_TEXKILL) + print_tex_op(opcode >> 24, program); + else if (opcode == D0_DCL) + print_dcl_op(opcode >> 24, program); + else + fprintf(stderr, "Unknown opcode 0x%x\n", opcode); + } + + fprintf(stderr, "END\n\n"); +} diff --git a/src/mesa/drivers/dri/i915tex/i915_fragprog.c b/src/mesa/drivers/dri/i915tex/i915_fragprog.c new file mode 100644 index 00000000000..8772e702307 --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/i915_fragprog.c @@ -0,0 +1,1083 @@ +/************************************************************************** + * + * Copyright 2003 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. + * + **************************************************************************/ + +#include "glheader.h" +#include "macros.h" +#include "enums.h" + +#include "tnl/tnl.h" +#include "tnl/t_context.h" +#include "intel_batchbuffer.h" + +#include "i915_reg.h" +#include "i915_context.h" +#include "i915_program.h" + +#include "program_instruction.h" +#include "program.h" +#include "programopt.h" + + + +/* 1, -1/3!, 1/5!, -1/7! */ +static const GLfloat sin_constants[4] = { 1.0, + -1.0 / (3 * 2 * 1), + 1.0 / (5 * 4 * 3 * 2 * 1), + -1.0 / (7 * 6 * 5 * 4 * 3 * 2 * 1) +}; + +/* 1, -1/2!, 1/4!, -1/6! */ +static const GLfloat cos_constants[4] = { 1.0, + -1.0 / (2 * 1), + 1.0 / (4 * 3 * 2 * 1), + -1.0 / (6 * 5 * 4 * 3 * 2 * 1) +}; + +/** + * Retrieve a ureg for the given source register. Will emit + * constants, apply swizzling and negation as needed. + */ +static GLuint +src_vector(struct i915_fragment_program *p, + const struct prog_src_register *source, + const struct gl_fragment_program *program) +{ + GLuint src; + + switch (source->File) { + + /* Registers: + */ + case PROGRAM_TEMPORARY: + if (source->Index >= I915_MAX_TEMPORARY) { + i915_program_error(p, "Exceeded max temporary reg"); + return 0; + } + src = UREG(REG_TYPE_R, source->Index); + break; + case PROGRAM_INPUT: + switch (source->Index) { + case FRAG_ATTRIB_WPOS: + src = i915_emit_decl(p, REG_TYPE_T, p->wpos_tex, D0_CHANNEL_ALL); + break; + case FRAG_ATTRIB_COL0: + src = i915_emit_decl(p, REG_TYPE_T, T_DIFFUSE, D0_CHANNEL_ALL); + break; + case FRAG_ATTRIB_COL1: + src = i915_emit_decl(p, REG_TYPE_T, T_SPECULAR, D0_CHANNEL_XYZ); + src = swizzle(src, X, Y, Z, ONE); + break; + case FRAG_ATTRIB_FOGC: + src = i915_emit_decl(p, REG_TYPE_T, T_FOG_W, D0_CHANNEL_W); + src = swizzle(src, W, W, W, W); + break; + case FRAG_ATTRIB_TEX0: + case FRAG_ATTRIB_TEX1: + case FRAG_ATTRIB_TEX2: + case FRAG_ATTRIB_TEX3: + case FRAG_ATTRIB_TEX4: + case FRAG_ATTRIB_TEX5: + case FRAG_ATTRIB_TEX6: + case FRAG_ATTRIB_TEX7: + src = i915_emit_decl(p, REG_TYPE_T, + T_TEX0 + (source->Index - FRAG_ATTRIB_TEX0), + D0_CHANNEL_ALL); + break; + + default: + i915_program_error(p, "Bad source->Index"); + return 0; + } + break; + + /* Various paramters and env values. All emitted to + * hardware as program constants. + */ + case PROGRAM_LOCAL_PARAM: + src = i915_emit_param4fv(p, program->Base.LocalParams[source->Index]); + break; + + case PROGRAM_ENV_PARAM: + src = + i915_emit_param4fv(p, + p->ctx->FragmentProgram.Parameters[source-> + Index]); + break; + + case PROGRAM_CONSTANT: + case PROGRAM_STATE_VAR: + case PROGRAM_NAMED_PARAM: + src = + i915_emit_param4fv(p, + program->Base.Parameters->ParameterValues[source-> + Index]); + break; + + default: + i915_program_error(p, "Bad source->File"); + return 0; + } + + src = swizzle(src, + GET_SWZ(source->Swizzle, 0), + GET_SWZ(source->Swizzle, 1), + GET_SWZ(source->Swizzle, 2), GET_SWZ(source->Swizzle, 3)); + + if (source->NegateBase) + src = negate(src, + GET_BIT(source->NegateBase, 0), + GET_BIT(source->NegateBase, 1), + GET_BIT(source->NegateBase, 2), + GET_BIT(source->NegateBase, 3)); + + return src; +} + + +static GLuint +get_result_vector(struct i915_fragment_program *p, + const struct prog_instruction *inst) +{ + switch (inst->DstReg.File) { + case PROGRAM_OUTPUT: + switch (inst->DstReg.Index) { + case FRAG_RESULT_COLR: + return UREG(REG_TYPE_OC, 0); + case FRAG_RESULT_DEPR: + p->depth_written = 1; + return UREG(REG_TYPE_OD, 0); + default: + i915_program_error(p, "Bad inst->DstReg.Index"); + return 0; + } + case PROGRAM_TEMPORARY: + return UREG(REG_TYPE_R, inst->DstReg.Index); + default: + i915_program_error(p, "Bad inst->DstReg.File"); + return 0; + } +} + +static GLuint +get_result_flags(const struct prog_instruction *inst) +{ + GLuint flags = 0; + + if (inst->SaturateMode == SATURATE_ZERO_ONE) + flags |= A0_DEST_SATURATE; + if (inst->DstReg.WriteMask & WRITEMASK_X) + flags |= A0_DEST_CHANNEL_X; + if (inst->DstReg.WriteMask & WRITEMASK_Y) + flags |= A0_DEST_CHANNEL_Y; + if (inst->DstReg.WriteMask & WRITEMASK_Z) + flags |= A0_DEST_CHANNEL_Z; + if (inst->DstReg.WriteMask & WRITEMASK_W) + flags |= A0_DEST_CHANNEL_W; + + return flags; +} + +static GLuint +translate_tex_src_target(struct i915_fragment_program *p, GLubyte bit) +{ + switch (bit) { + case TEXTURE_1D_INDEX: + return D0_SAMPLE_TYPE_2D; + case TEXTURE_2D_INDEX: + return D0_SAMPLE_TYPE_2D; + case TEXTURE_RECT_INDEX: + return D0_SAMPLE_TYPE_2D; + case TEXTURE_3D_INDEX: + return D0_SAMPLE_TYPE_VOLUME; + case TEXTURE_CUBE_INDEX: + return D0_SAMPLE_TYPE_CUBE; + default: + i915_program_error(p, "TexSrcBit"); + return 0; + } +} + +#define EMIT_TEX( OP ) \ +do { \ + GLuint dim = translate_tex_src_target( p, inst->TexSrcTarget ); \ + GLuint sampler = i915_emit_decl(p, REG_TYPE_S, \ + inst->TexSrcUnit, dim); \ + GLuint coord = src_vector( p, &inst->SrcReg[0], program); \ + /* Texel lookup */ \ + \ + i915_emit_texld( p, \ + get_result_vector( p, inst ), \ + get_result_flags( inst ), \ + sampler, \ + coord, \ + OP); \ +} while (0) + +#define EMIT_ARITH( OP, N ) \ +do { \ + i915_emit_arith( p, \ + OP, \ + get_result_vector( p, inst ), \ + get_result_flags( inst ), 0, \ + (N<1)?0:src_vector( p, &inst->SrcReg[0], program), \ + (N<2)?0:src_vector( p, &inst->SrcReg[1], program), \ + (N<3)?0:src_vector( p, &inst->SrcReg[2], program)); \ +} while (0) + +#define EMIT_1ARG_ARITH( OP ) EMIT_ARITH( OP, 1 ) +#define EMIT_2ARG_ARITH( OP ) EMIT_ARITH( OP, 2 ) +#define EMIT_3ARG_ARITH( OP ) EMIT_ARITH( OP, 3 ) + + +/* Possible concerns: + * + * SIN, COS -- could use another taylor step? + * LIT -- results seem a little different to sw mesa + * LOG -- different to mesa on negative numbers, but this is conformant. + * + * Parse failures -- Mesa doesn't currently give a good indication + * internally whether a particular program string parsed or not. This + * can lead to confusion -- hopefully we cope with it ok now. + * + */ +static void +upload_program(struct i915_fragment_program *p) +{ + const struct gl_fragment_program *program = + p->ctx->FragmentProgram._Current; + const struct prog_instruction *inst = program->Base.Instructions; + +/* _mesa_debug_fp_inst(program->Base.NumInstructions, inst); */ + + /* Is this a parse-failed program? Ensure a valid program is + * loaded, as the flagging of an error isn't sufficient to stop + * this being uploaded to hardware. + */ + if (inst[0].Opcode == OPCODE_END) { + GLuint tmp = i915_get_utemp(p); + i915_emit_arith(p, + A0_MOV, + UREG(REG_TYPE_OC, 0), + A0_DEST_CHANNEL_ALL, 0, + swizzle(tmp, ONE, ZERO, ONE, ONE), 0, 0); + return; + } + + while (1) { + GLuint src0, src1, src2, flags; + GLuint tmp = 0; + + switch (inst->Opcode) { + case OPCODE_ABS: + src0 = src_vector(p, &inst->SrcReg[0], program); + i915_emit_arith(p, + A0_MAX, + get_result_vector(p, inst), + get_result_flags(inst), 0, + src0, negate(src0, 1, 1, 1, 1), 0); + break; + + case OPCODE_ADD: + EMIT_2ARG_ARITH(A0_ADD); + break; + + case OPCODE_CMP: + src0 = src_vector(p, &inst->SrcReg[0], program); + src1 = src_vector(p, &inst->SrcReg[1], program); + src2 = src_vector(p, &inst->SrcReg[2], program); + i915_emit_arith(p, A0_CMP, get_result_vector(p, inst), get_result_flags(inst), 0, src0, src2, src1); /* NOTE: order of src2, src1 */ + break; + + case OPCODE_COS: + src0 = src_vector(p, &inst->SrcReg[0], program); + tmp = i915_get_utemp(p); + + i915_emit_arith(p, + A0_MUL, + tmp, A0_DEST_CHANNEL_X, 0, + src0, i915_emit_const1f(p, 1.0 / (M_PI * 2)), 0); + + i915_emit_arith(p, A0_MOD, tmp, A0_DEST_CHANNEL_X, 0, tmp, 0, 0); + + /* By choosing different taylor constants, could get rid of this mul: + */ + i915_emit_arith(p, + A0_MUL, + tmp, A0_DEST_CHANNEL_X, 0, + tmp, i915_emit_const1f(p, (M_PI * 2)), 0); + + /* + * t0.xy = MUL x.xx11, x.x1111 ; x^2, x, 1, 1 + * t0 = MUL t0.xyxy t0.xx11 ; x^4, x^3, x^2, 1 + * t0 = MUL t0.xxz1 t0.z111 ; x^6 x^4 x^2 1 + * result = DP4 t0, cos_constants + */ + i915_emit_arith(p, + A0_MUL, + tmp, A0_DEST_CHANNEL_XY, 0, + swizzle(tmp, X, X, ONE, ONE), + swizzle(tmp, X, ONE, ONE, ONE), 0); + + i915_emit_arith(p, + A0_MUL, + tmp, A0_DEST_CHANNEL_XYZ, 0, + swizzle(tmp, X, Y, X, ONE), + swizzle(tmp, X, X, ONE, ONE), 0); + + i915_emit_arith(p, + A0_MUL, + tmp, A0_DEST_CHANNEL_XYZ, 0, + swizzle(tmp, X, X, Z, ONE), + swizzle(tmp, Z, ONE, ONE, ONE), 0); + + i915_emit_arith(p, + A0_DP4, + get_result_vector(p, inst), + get_result_flags(inst), 0, + swizzle(tmp, ONE, Z, Y, X), + i915_emit_const4fv(p, cos_constants), 0); + + break; + + case OPCODE_DP3: + EMIT_2ARG_ARITH(A0_DP3); + break; + + case OPCODE_DP4: + EMIT_2ARG_ARITH(A0_DP4); + break; + + case OPCODE_DPH: + src0 = src_vector(p, &inst->SrcReg[0], program); + src1 = src_vector(p, &inst->SrcReg[1], program); + + i915_emit_arith(p, + A0_DP4, + get_result_vector(p, inst), + get_result_flags(inst), 0, + swizzle(src0, X, Y, Z, ONE), src1, 0); + break; + + case OPCODE_DST: + src0 = src_vector(p, &inst->SrcReg[0], program); + src1 = src_vector(p, &inst->SrcReg[1], program); + + /* result[0] = 1 * 1; + * result[1] = a[1] * b[1]; + * result[2] = a[2] * 1; + * result[3] = 1 * b[3]; + */ + i915_emit_arith(p, + A0_MUL, + get_result_vector(p, inst), + get_result_flags(inst), 0, + swizzle(src0, ONE, Y, Z, ONE), + swizzle(src1, ONE, Y, ONE, W), 0); + break; + + case OPCODE_EX2: + src0 = src_vector(p, &inst->SrcReg[0], program); + + i915_emit_arith(p, + A0_EXP, + get_result_vector(p, inst), + get_result_flags(inst), 0, + swizzle(src0, X, X, X, X), 0, 0); + break; + + case OPCODE_FLR: + EMIT_1ARG_ARITH(A0_FLR); + break; + + case OPCODE_FRC: + EMIT_1ARG_ARITH(A0_FRC); + break; + + case OPCODE_KIL: + src0 = src_vector(p, &inst->SrcReg[0], program); + tmp = i915_get_utemp(p); + + i915_emit_texld(p, tmp, A0_DEST_CHANNEL_ALL, /* use a dummy dest reg */ + 0, src0, T0_TEXKILL); + break; + + case OPCODE_LG2: + src0 = src_vector(p, &inst->SrcReg[0], program); + + i915_emit_arith(p, + A0_LOG, + get_result_vector(p, inst), + get_result_flags(inst), 0, + swizzle(src0, X, X, X, X), 0, 0); + break; + + case OPCODE_LIT: + src0 = src_vector(p, &inst->SrcReg[0], program); + tmp = i915_get_utemp(p); + + /* tmp = max( a.xyzw, a.00zw ) + * XXX: Clamp tmp.w to -128..128 + * tmp.y = log(tmp.y) + * tmp.y = tmp.w * tmp.y + * tmp.y = exp(tmp.y) + * result = cmp (a.11-x1, a.1x01, a.1xy1 ) + */ + i915_emit_arith(p, A0_MAX, tmp, A0_DEST_CHANNEL_ALL, 0, + src0, swizzle(src0, ZERO, ZERO, Z, W), 0); + + i915_emit_arith(p, A0_LOG, tmp, A0_DEST_CHANNEL_Y, 0, + swizzle(tmp, Y, Y, Y, Y), 0, 0); + + i915_emit_arith(p, A0_MUL, tmp, A0_DEST_CHANNEL_Y, 0, + swizzle(tmp, ZERO, Y, ZERO, ZERO), + swizzle(tmp, ZERO, W, ZERO, ZERO), 0); + + i915_emit_arith(p, A0_EXP, tmp, A0_DEST_CHANNEL_Y, 0, + swizzle(tmp, Y, Y, Y, Y), 0, 0); + + i915_emit_arith(p, A0_CMP, + get_result_vector(p, inst), + get_result_flags(inst), 0, + negate(swizzle(tmp, ONE, ONE, X, ONE), 0, 0, 1, 0), + swizzle(tmp, ONE, X, ZERO, ONE), + swizzle(tmp, ONE, X, Y, ONE)); + + break; + + case OPCODE_LRP: + src0 = src_vector(p, &inst->SrcReg[0], program); + src1 = src_vector(p, &inst->SrcReg[1], program); + src2 = src_vector(p, &inst->SrcReg[2], program); + flags = get_result_flags(inst); + tmp = i915_get_utemp(p); + + /* b*a + c*(1-a) + * + * b*a + c - ca + * + * tmp = b*a + c, + * result = (-c)*a + tmp + */ + i915_emit_arith(p, A0_MAD, tmp, + flags & A0_DEST_CHANNEL_ALL, 0, src1, src0, src2); + + i915_emit_arith(p, A0_MAD, + get_result_vector(p, inst), + flags, 0, negate(src2, 1, 1, 1, 1), src0, tmp); + break; + + case OPCODE_MAD: + EMIT_3ARG_ARITH(A0_MAD); + break; + + case OPCODE_MAX: + EMIT_2ARG_ARITH(A0_MAX); + break; + + case OPCODE_MIN: + src0 = src_vector(p, &inst->SrcReg[0], program); + src1 = src_vector(p, &inst->SrcReg[1], program); + tmp = i915_get_utemp(p); + flags = get_result_flags(inst); + + i915_emit_arith(p, + A0_MAX, + tmp, flags & A0_DEST_CHANNEL_ALL, 0, + negate(src0, 1, 1, 1, 1), + negate(src1, 1, 1, 1, 1), 0); + + i915_emit_arith(p, + A0_MOV, + get_result_vector(p, inst), + flags, 0, negate(tmp, 1, 1, 1, 1), 0, 0); + break; + + case OPCODE_MOV: + EMIT_1ARG_ARITH(A0_MOV); + break; + + case OPCODE_MUL: + EMIT_2ARG_ARITH(A0_MUL); + break; + + case OPCODE_POW: + src0 = src_vector(p, &inst->SrcReg[0], program); + src1 = src_vector(p, &inst->SrcReg[1], program); + tmp = i915_get_utemp(p); + flags = get_result_flags(inst); + + /* XXX: masking on intermediate values, here and elsewhere. + */ + i915_emit_arith(p, + A0_LOG, + tmp, A0_DEST_CHANNEL_X, 0, + swizzle(src0, X, X, X, X), 0, 0); + + i915_emit_arith(p, A0_MUL, tmp, A0_DEST_CHANNEL_X, 0, tmp, src1, 0); + + + i915_emit_arith(p, + A0_EXP, + get_result_vector(p, inst), + flags, 0, swizzle(tmp, X, X, X, X), 0, 0); + + break; + + case OPCODE_RCP: + src0 = src_vector(p, &inst->SrcReg[0], program); + + i915_emit_arith(p, + A0_RCP, + get_result_vector(p, inst), + get_result_flags(inst), 0, + swizzle(src0, X, X, X, X), 0, 0); + break; + + case OPCODE_RSQ: + + src0 = src_vector(p, &inst->SrcReg[0], program); + + i915_emit_arith(p, + A0_RSQ, + get_result_vector(p, inst), + get_result_flags(inst), 0, + swizzle(src0, X, X, X, X), 0, 0); + break; + + case OPCODE_SCS: + src0 = src_vector(p, &inst->SrcReg[0], program); + tmp = i915_get_utemp(p); + + /* + * t0.xy = MUL x.xx11, x.x1111 ; x^2, x, 1, 1 + * t0 = MUL t0.xyxy t0.xx11 ; x^4, x^3, x^2, x + * t1 = MUL t0.xyyw t0.yz11 ; x^7 x^5 x^3 x + * scs.x = DP4 t1, sin_constants + * t1 = MUL t0.xxz1 t0.z111 ; x^6 x^4 x^2 1 + * scs.y = DP4 t1, cos_constants + */ + i915_emit_arith(p, + A0_MUL, + tmp, A0_DEST_CHANNEL_XY, 0, + swizzle(src0, X, X, ONE, ONE), + swizzle(src0, X, ONE, ONE, ONE), 0); + + i915_emit_arith(p, + A0_MUL, + tmp, A0_DEST_CHANNEL_ALL, 0, + swizzle(tmp, X, Y, X, Y), + swizzle(tmp, X, X, ONE, ONE), 0); + + if (inst->DstReg.WriteMask & WRITEMASK_Y) { + GLuint tmp1; + + if (inst->DstReg.WriteMask & WRITEMASK_X) + tmp1 = i915_get_utemp(p); + else + tmp1 = tmp; + + i915_emit_arith(p, + A0_MUL, + tmp1, A0_DEST_CHANNEL_ALL, 0, + swizzle(tmp, X, Y, Y, W), + swizzle(tmp, X, Z, ONE, ONE), 0); + + i915_emit_arith(p, + A0_DP4, + get_result_vector(p, inst), + A0_DEST_CHANNEL_Y, 0, + swizzle(tmp1, W, Z, Y, X), + i915_emit_const4fv(p, sin_constants), 0); + } + + if (inst->DstReg.WriteMask & WRITEMASK_X) { + i915_emit_arith(p, + A0_MUL, + tmp, A0_DEST_CHANNEL_XYZ, 0, + swizzle(tmp, X, X, Z, ONE), + swizzle(tmp, Z, ONE, ONE, ONE), 0); + + i915_emit_arith(p, + A0_DP4, + get_result_vector(p, inst), + A0_DEST_CHANNEL_X, 0, + swizzle(tmp, ONE, Z, Y, X), + i915_emit_const4fv(p, cos_constants), 0); + } + break; + + case OPCODE_SGE: + EMIT_2ARG_ARITH(A0_SGE); + break; + + case OPCODE_SIN: + src0 = src_vector(p, &inst->SrcReg[0], program); + tmp = i915_get_utemp(p); + + i915_emit_arith(p, + A0_MUL, + tmp, A0_DEST_CHANNEL_X, 0, + src0, i915_emit_const1f(p, 1.0 / (M_PI * 2)), 0); + + i915_emit_arith(p, A0_MOD, tmp, A0_DEST_CHANNEL_X, 0, tmp, 0, 0); + + /* By choosing different taylor constants, could get rid of this mul: + */ + i915_emit_arith(p, + A0_MUL, + tmp, A0_DEST_CHANNEL_X, 0, + tmp, i915_emit_const1f(p, (M_PI * 2)), 0); + + /* + * t0.xy = MUL x.xx11, x.x1111 ; x^2, x, 1, 1 + * t0 = MUL t0.xyxy t0.xx11 ; x^4, x^3, x^2, x + * t1 = MUL t0.xyyw t0.yz11 ; x^7 x^5 x^3 x + * result = DP4 t1.wzyx, sin_constants + */ + i915_emit_arith(p, + A0_MUL, + tmp, A0_DEST_CHANNEL_XY, 0, + swizzle(tmp, X, X, ONE, ONE), + swizzle(tmp, X, ONE, ONE, ONE), 0); + + i915_emit_arith(p, + A0_MUL, + tmp, A0_DEST_CHANNEL_ALL, 0, + swizzle(tmp, X, Y, X, Y), + swizzle(tmp, X, X, ONE, ONE), 0); + + i915_emit_arith(p, + A0_MUL, + tmp, A0_DEST_CHANNEL_ALL, 0, + swizzle(tmp, X, Y, Y, W), + swizzle(tmp, X, Z, ONE, ONE), 0); + + i915_emit_arith(p, + A0_DP4, + get_result_vector(p, inst), + get_result_flags(inst), 0, + swizzle(tmp, W, Z, Y, X), + i915_emit_const4fv(p, sin_constants), 0); + break; + + case OPCODE_SLT: + EMIT_2ARG_ARITH(A0_SLT); + break; + + case OPCODE_SUB: + src0 = src_vector(p, &inst->SrcReg[0], program); + src1 = src_vector(p, &inst->SrcReg[1], program); + + i915_emit_arith(p, + A0_ADD, + get_result_vector(p, inst), + get_result_flags(inst), 0, + src0, negate(src1, 1, 1, 1, 1), 0); + break; + + case OPCODE_SWZ: + EMIT_1ARG_ARITH(A0_MOV); /* extended swizzle handled natively */ + break; + + case OPCODE_TEX: + EMIT_TEX(T0_TEXLD); + break; + + case OPCODE_TXB: + EMIT_TEX(T0_TEXLDB); + break; + + case OPCODE_TXP: + EMIT_TEX(T0_TEXLDP); + break; + + case OPCODE_XPD: + /* Cross product: + * result.x = src0.y * src1.z - src0.z * src1.y; + * result.y = src0.z * src1.x - src0.x * src1.z; + * result.z = src0.x * src1.y - src0.y * src1.x; + * result.w = undef; + */ + src0 = src_vector(p, &inst->SrcReg[0], program); + src1 = src_vector(p, &inst->SrcReg[1], program); + tmp = i915_get_utemp(p); + + i915_emit_arith(p, + A0_MUL, + tmp, A0_DEST_CHANNEL_ALL, 0, + swizzle(src0, Z, X, Y, ONE), + swizzle(src1, Y, Z, X, ONE), 0); + + i915_emit_arith(p, + A0_MAD, + get_result_vector(p, inst), + get_result_flags(inst), 0, + swizzle(src0, Y, Z, X, ONE), + swizzle(src1, Z, X, Y, ONE), + negate(tmp, 1, 1, 1, 0)); + break; + + case OPCODE_END: + return; + + default: + i915_program_error(p, "bad opcode"); + return; + } + + inst++; + i915_release_utemps(p); + } +} + +/* Rather than trying to intercept and jiggle depth writes during + * emit, just move the value into its correct position at the end of + * the program: + */ +static void +fixup_depth_write(struct i915_fragment_program *p) +{ + if (p->depth_written) { + GLuint depth = UREG(REG_TYPE_OD, 0); + + i915_emit_arith(p, + A0_MOV, + depth, A0_DEST_CHANNEL_W, 0, + swizzle(depth, X, Y, Z, Z), 0, 0); + } +} + + +#define FRAG_BIT_TEX(n) (FRAG_BIT_TEX0 << (n)) + + +static void +check_wpos(struct i915_fragment_program *p) +{ + GLuint inputs = p->FragProg.Base.InputsRead; + GLint i; + + p->wpos_tex = -1; + + for (i = 0; i < p->ctx->Const.MaxTextureCoordUnits; i++) { + if (inputs & FRAG_BIT_TEX(i)) + continue; + else if (inputs & FRAG_BIT_WPOS) { + p->wpos_tex = i; + inputs &= ~FRAG_BIT_WPOS; + } + } + + if (inputs & FRAG_BIT_WPOS) { + i915_program_error(p, "No free texcoord for wpos value"); + } +} + + +static void +translate_program(struct i915_fragment_program *p) +{ + struct i915_context *i915 = I915_CONTEXT(p->ctx); + + i915_init_program(i915, p); + check_wpos(p); + upload_program(p); + fixup_depth_write(p); + i915_fini_program(p); + + p->translated = 1; +} + + +static void +track_params(struct i915_fragment_program *p) +{ + GLint i; + + if (p->nr_params) + _mesa_load_state_parameters(p->ctx, p->FragProg.Base.Parameters); + + for (i = 0; i < p->nr_params; i++) { + GLint reg = p->param[i].reg; + COPY_4V(p->constant[reg], p->param[i].values); + } + + p->params_uptodate = 1; + p->on_hardware = 0; /* overkill */ +} + + +static void +i915BindProgram(GLcontext * ctx, GLenum target, struct gl_program *prog) +{ + if (target == GL_FRAGMENT_PROGRAM_ARB) { + struct i915_context *i915 = I915_CONTEXT(ctx); + struct i915_fragment_program *p = (struct i915_fragment_program *) prog; + + if (i915->current_program == p) + return; + + if (i915->current_program) { + i915->current_program->on_hardware = 0; + i915->current_program->params_uptodate = 0; + } + + i915->current_program = p; + + assert(p->on_hardware == 0); + assert(p->params_uptodate == 0); + + /* Hack: make sure fog is correctly enabled according to this + * fragment program's fog options. + */ + ctx->Driver.Enable(ctx, GL_FRAGMENT_PROGRAM_ARB, + ctx->FragmentProgram.Enabled); + } +} + +static struct gl_program * +i915NewProgram(GLcontext * ctx, GLenum target, GLuint id) +{ + switch (target) { + case GL_VERTEX_PROGRAM_ARB: + return _mesa_init_vertex_program(ctx, CALLOC_STRUCT(gl_vertex_program), + target, id); + + case GL_FRAGMENT_PROGRAM_ARB:{ + struct i915_fragment_program *prog = + CALLOC_STRUCT(i915_fragment_program); + if (prog) { + i915_init_program(I915_CONTEXT(ctx), prog); + + return _mesa_init_fragment_program(ctx, &prog->FragProg, + target, id); + } + else + return NULL; + } + + default: + /* Just fallback: + */ + return _mesa_new_program(ctx, target, id); + } +} + +static void +i915DeleteProgram(GLcontext * ctx, struct gl_program *prog) +{ + if (prog->Target == GL_FRAGMENT_PROGRAM_ARB) { + struct i915_context *i915 = I915_CONTEXT(ctx); + struct i915_fragment_program *p = (struct i915_fragment_program *) prog; + + if (i915->current_program == p) + i915->current_program = 0; + } + + _mesa_delete_program(ctx, prog); +} + + +static GLboolean +i915IsProgramNative(GLcontext * ctx, GLenum target, struct gl_program *prog) +{ + if (target == GL_FRAGMENT_PROGRAM_ARB) { + struct i915_fragment_program *p = (struct i915_fragment_program *) prog; + + if (!p->translated) + translate_program(p); + + return !p->error; + } + else + return GL_TRUE; +} + +static void +i915ProgramStringNotify(GLcontext * ctx, + GLenum target, struct gl_program *prog) +{ + if (target == GL_FRAGMENT_PROGRAM_ARB) { + struct i915_fragment_program *p = (struct i915_fragment_program *) prog; + p->translated = 0; + + /* Hack: make sure fog is correctly enabled according to this + * fragment program's fog options. + */ + ctx->Driver.Enable(ctx, GL_FRAGMENT_PROGRAM_ARB, + ctx->FragmentProgram.Enabled); + + if (p->FragProg.FogOption) { + /* add extra instructions to do fog, then turn off FogOption field */ + _mesa_append_fog_code(ctx, &p->FragProg); + p->FragProg.FogOption = GL_NONE; + } + } + + _tnl_program_string(ctx, target, prog); +} + + +void +i915ValidateFragmentProgram(struct i915_context *i915) +{ + GLcontext *ctx = &i915->intel.ctx; + struct intel_context *intel = intel_context(ctx); + TNLcontext *tnl = TNL_CONTEXT(ctx); + struct vertex_buffer *VB = &tnl->vb; + + struct i915_fragment_program *p = + (struct i915_fragment_program *) ctx->FragmentProgram._Current; + + const GLuint inputsRead = p->FragProg.Base.InputsRead; + GLuint s4 = i915->state.Ctx[I915_CTXREG_LIS4] & ~S4_VFMT_MASK; + GLuint s2 = S2_TEXCOORD_NONE; + int i, offset = 0; + + if (i915->current_program != p) { + if (i915->current_program) { + i915->current_program->on_hardware = 0; + i915->current_program->params_uptodate = 0; + } + + i915->current_program = p; + } + + + /* Important: + */ + VB->AttribPtr[VERT_ATTRIB_POS] = VB->NdcPtr; + + if (!p->translated) + translate_program(p); + + intel->vertex_attr_count = 0; + intel->wpos_offset = 0; + intel->wpos_size = 0; + intel->coloroffset = 0; + intel->specoffset = 0; + + if (inputsRead & FRAG_BITS_TEX_ANY) { + EMIT_ATTR(_TNL_ATTRIB_POS, EMIT_4F_VIEWPORT, S4_VFMT_XYZW, 16); + } + else { + EMIT_ATTR(_TNL_ATTRIB_POS, EMIT_3F_VIEWPORT, S4_VFMT_XYZ, 12); + } + + if (inputsRead & FRAG_BIT_COL0) { + intel->coloroffset = offset / 4; + EMIT_ATTR(_TNL_ATTRIB_COLOR0, EMIT_4UB_4F_BGRA, S4_VFMT_COLOR, 4); + } + + if ((inputsRead & (FRAG_BIT_COL1 | FRAG_BIT_FOGC)) || + i915->vertex_fog != I915_FOG_NONE) { + + if (inputsRead & FRAG_BIT_COL1) { + intel->specoffset = offset / 4; + EMIT_ATTR(_TNL_ATTRIB_COLOR1, EMIT_3UB_3F_BGR, S4_VFMT_SPEC_FOG, 3); + } + else + EMIT_PAD(3); + + if ((inputsRead & FRAG_BIT_FOGC) || i915->vertex_fog != I915_FOG_NONE) + EMIT_ATTR(_TNL_ATTRIB_FOG, EMIT_1UB_1F, S4_VFMT_SPEC_FOG, 1); + else + EMIT_PAD(1); + } + + /* XXX this was disabled, but enabling this code helped fix the Glean + * tfragprog1 fog tests. + */ +#if 1 + if ((inputsRead & FRAG_BIT_FOGC) || i915->vertex_fog != I915_FOG_NONE) { + EMIT_ATTR(_TNL_ATTRIB_FOG, EMIT_1F, S4_VFMT_FOG_PARAM, 4); + } +#endif + + for (i = 0; i < p->ctx->Const.MaxTextureCoordUnits; i++) { + if (inputsRead & FRAG_BIT_TEX(i)) { + int sz = VB->TexCoordPtr[i]->size; + + s2 &= ~S2_TEXCOORD_FMT(i, S2_TEXCOORD_FMT0_MASK); + s2 |= S2_TEXCOORD_FMT(i, SZ_TO_HW(sz)); + + EMIT_ATTR(_TNL_ATTRIB_TEX0 + i, EMIT_SZ(sz), 0, sz * 4); + } + else if (i == p->wpos_tex) { + + /* If WPOS is required, duplicate the XYZ position data in an + * unused texture coordinate: + */ + s2 &= ~S2_TEXCOORD_FMT(i, S2_TEXCOORD_FMT0_MASK); + s2 |= S2_TEXCOORD_FMT(i, SZ_TO_HW(3)); + + intel->wpos_offset = offset; + intel->wpos_size = 3 * sizeof(GLuint); + + EMIT_PAD(intel->wpos_size); + } + } + + if (s2 != i915->state.Ctx[I915_CTXREG_LIS2] || + s4 != i915->state.Ctx[I915_CTXREG_LIS4]) { + int k; + + I915_STATECHANGE(i915, I915_UPLOAD_CTX); + + /* Must do this *after* statechange, so as not to affect + * buffered vertices reliant on the old state: + */ + intel->vertex_size = _tnl_install_attrs(&intel->ctx, + intel->vertex_attrs, + intel->vertex_attr_count, + intel->ViewportMatrix.m, 0); + + intel->vertex_size >>= 2; + + i915->state.Ctx[I915_CTXREG_LIS2] = s2; + i915->state.Ctx[I915_CTXREG_LIS4] = s4; + + k = intel->vtbl.check_vertex_size(intel, intel->vertex_size); + assert(k); + } + + if (!p->params_uptodate) + track_params(p); + + if (!p->on_hardware) + i915_upload_program(i915, p); +} + +void +i915InitFragProgFuncs(struct dd_function_table *functions) +{ + functions->BindProgram = i915BindProgram; + functions->NewProgram = i915NewProgram; + functions->DeleteProgram = i915DeleteProgram; + functions->IsProgramNative = i915IsProgramNative; + functions->ProgramStringNotify = i915ProgramStringNotify; +} diff --git a/src/mesa/drivers/dri/i915tex/i915_metaops.c b/src/mesa/drivers/dri/i915tex/i915_metaops.c new file mode 100644 index 00000000000..3ab62bc806b --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/i915_metaops.c @@ -0,0 +1,509 @@ +/************************************************************************** + * + * Copyright 2003 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. + * + **************************************************************************/ + +#include "glheader.h" +#include "enums.h" +#include "mtypes.h" +#include "macros.h" +#include "utils.h" + +#include "intel_screen.h" +#include "intel_batchbuffer.h" +#include "intel_ioctl.h" +#include "intel_regions.h" +#include "intel_rotate.h" + +#include "i915_context.h" +#include "i915_reg.h" + +/* We touch almost everything: + */ +#define ACTIVE (I915_UPLOAD_INVARIENT | \ + I915_UPLOAD_CTX | \ + I915_UPLOAD_BUFFERS | \ + I915_UPLOAD_STIPPLE | \ + I915_UPLOAD_PROGRAM | \ + I915_UPLOAD_FOG | \ + I915_UPLOAD_TEX(0)) + +#define SET_STATE( i915, STATE ) \ +do { \ + i915->current->emitted &= ~ACTIVE; \ + i915->current = &i915->STATE; \ + i915->current->emitted &= ~ACTIVE; \ +} while (0) + + +static void +meta_no_stencil_write(struct intel_context *intel) +{ + struct i915_context *i915 = i915_context(&intel->ctx); + + /* ctx->Driver.Enable( ctx, GL_STENCIL_TEST, GL_FALSE ) + */ + i915->meta.Ctx[I915_CTXREG_LIS5] &= ~(S5_STENCIL_TEST_ENABLE | + S5_STENCIL_WRITE_ENABLE); + + i915->meta.emitted &= ~I915_UPLOAD_CTX; +} + +static void +meta_no_depth_write(struct intel_context *intel) +{ + struct i915_context *i915 = i915_context(&intel->ctx); + + /* ctx->Driver.Enable( ctx, GL_DEPTH_TEST, GL_FALSE ) + */ + i915->meta.Ctx[I915_CTXREG_LIS6] &= ~(S6_DEPTH_TEST_ENABLE | + S6_DEPTH_WRITE_ENABLE); + + i915->meta.emitted &= ~I915_UPLOAD_CTX; +} + +static void +meta_depth_replace(struct intel_context *intel) +{ + struct i915_context *i915 = i915_context(&intel->ctx); + + /* ctx->Driver.Enable( ctx, GL_DEPTH_TEST, GL_TRUE ) + * ctx->Driver.DepthMask( ctx, GL_TRUE ) + */ + i915->meta.Ctx[I915_CTXREG_LIS6] |= (S6_DEPTH_TEST_ENABLE | + S6_DEPTH_WRITE_ENABLE); + + /* ctx->Driver.DepthFunc( ctx, GL_REPLACE ) + */ + i915->meta.Ctx[I915_CTXREG_LIS6] &= ~S6_DEPTH_TEST_FUNC_MASK; + i915->meta.Ctx[I915_CTXREG_LIS6] |= + COMPAREFUNC_ALWAYS << S6_DEPTH_TEST_FUNC_SHIFT; + + i915->meta.emitted &= ~I915_UPLOAD_CTX; +} + + +/* Set stencil unit to replace always with the reference value. + */ +static void +meta_stencil_replace(struct intel_context *intel, + GLuint s_mask, GLuint s_clear) +{ + struct i915_context *i915 = i915_context(&intel->ctx); + GLuint op = STENCILOP_REPLACE; + GLuint func = COMPAREFUNC_ALWAYS; + + /* ctx->Driver.Enable( ctx, GL_STENCIL_TEST, GL_TRUE ) + */ + i915->meta.Ctx[I915_CTXREG_LIS5] |= (S5_STENCIL_TEST_ENABLE | + S5_STENCIL_WRITE_ENABLE); + + /* ctx->Driver.StencilMask( ctx, s_mask ) + */ + i915->meta.Ctx[I915_CTXREG_STATE4] &= ~MODE4_ENABLE_STENCIL_WRITE_MASK; + + i915->meta.Ctx[I915_CTXREG_STATE4] |= (ENABLE_STENCIL_WRITE_MASK | + STENCIL_WRITE_MASK(s_mask)); + + /* ctx->Driver.StencilOp( ctx, GL_REPLACE, GL_REPLACE, GL_REPLACE ) + */ + i915->meta.Ctx[I915_CTXREG_LIS5] &= ~(S5_STENCIL_FAIL_MASK | + S5_STENCIL_PASS_Z_FAIL_MASK | + S5_STENCIL_PASS_Z_PASS_MASK); + + i915->meta.Ctx[I915_CTXREG_LIS5] |= ((op << S5_STENCIL_FAIL_SHIFT) | + (op << S5_STENCIL_PASS_Z_FAIL_SHIFT) | + (op << S5_STENCIL_PASS_Z_PASS_SHIFT)); + + + /* ctx->Driver.StencilFunc( ctx, GL_ALWAYS, s_ref, ~0 ) + */ + i915->meta.Ctx[I915_CTXREG_STATE4] &= ~MODE4_ENABLE_STENCIL_TEST_MASK; + i915->meta.Ctx[I915_CTXREG_STATE4] |= (ENABLE_STENCIL_TEST_MASK | + STENCIL_TEST_MASK(0xff)); + + i915->meta.Ctx[I915_CTXREG_LIS5] &= ~(S5_STENCIL_REF_MASK | + S5_STENCIL_TEST_FUNC_MASK); + + i915->meta.Ctx[I915_CTXREG_LIS5] |= ((s_clear << S5_STENCIL_REF_SHIFT) | + (func << S5_STENCIL_TEST_FUNC_SHIFT)); + + + i915->meta.emitted &= ~I915_UPLOAD_CTX; +} + + +static void +meta_color_mask(struct intel_context *intel, GLboolean state) +{ + struct i915_context *i915 = i915_context(&intel->ctx); + const GLuint mask = (S5_WRITEDISABLE_RED | + S5_WRITEDISABLE_GREEN | + S5_WRITEDISABLE_BLUE | S5_WRITEDISABLE_ALPHA); + + /* Copy colormask state from "regular" hw context. + */ + if (state) { + i915->meta.Ctx[I915_CTXREG_LIS5] &= ~mask; + i915->meta.Ctx[I915_CTXREG_LIS5] |= + (i915->state.Ctx[I915_CTXREG_LIS5] & mask); + } + else + i915->meta.Ctx[I915_CTXREG_LIS5] |= mask; + + i915->meta.emitted &= ~I915_UPLOAD_CTX; +} + + + +static void +meta_import_pixel_state(struct intel_context *intel) +{ + struct i915_context *i915 = i915_context(&intel->ctx); + memcpy(i915->meta.Fog, i915->state.Fog, I915_FOG_SETUP_SIZE * 4); + + i915->meta.Ctx[I915_CTXREG_LIS5] = i915->state.Ctx[I915_CTXREG_LIS5]; + i915->meta.Ctx[I915_CTXREG_LIS6] = i915->state.Ctx[I915_CTXREG_LIS6]; + i915->meta.Ctx[I915_CTXREG_STATE4] = i915->state.Ctx[I915_CTXREG_STATE4]; + i915->meta.Ctx[I915_CTXREG_BLENDCOLOR1] = + i915->state.Ctx[I915_CTXREG_BLENDCOLOR1]; + i915->meta.Ctx[I915_CTXREG_IAB] = i915->state.Ctx[I915_CTXREG_IAB]; + + i915->meta.Buffer[I915_DESTREG_SENABLE] = + i915->state.Buffer[I915_DESTREG_SENABLE]; + i915->meta.Buffer[I915_DESTREG_SR1] = i915->state.Buffer[I915_DESTREG_SR1]; + i915->meta.Buffer[I915_DESTREG_SR2] = i915->state.Buffer[I915_DESTREG_SR2]; + + i915->meta.emitted &= ~I915_UPLOAD_FOG; + i915->meta.emitted &= ~I915_UPLOAD_BUFFERS; + i915->meta.emitted &= ~I915_UPLOAD_CTX; +} + + + + +#define REG( type, nr ) (((type)<<5)|(nr)) + +#define REG_R(x) REG(REG_TYPE_R, x) +#define REG_T(x) REG(REG_TYPE_T, x) +#define REG_CONST(x) REG(REG_TYPE_CONST, x) +#define REG_S(x) REG(REG_TYPE_S, x) +#define REG_OC REG(REG_TYPE_OC, 0) +#define REG_OD REG(REG_TYPE_OD, 0) +#define REG_U(x) REG(REG_TYPE_U, x) + +#define REG_T_DIFFUSE REG(REG_TYPE_T, T_DIFFUSE) +#define REG_T_SPECULAR REG(REG_TYPE_T, T_SPECULAR) +#define REG_T_FOG_W REG(REG_TYPE_T, T_FOG_W) +#define REG_T_TEX(x) REG(REG_TYPE_T, x) + + +#define A0_DEST_REG( reg ) ( (reg) << A0_DEST_NR_SHIFT ) +#define A0_SRC0_REG( reg ) ( (reg) << A0_SRC0_NR_SHIFT ) +#define A1_SRC1_REG( reg ) ( (reg) << A1_SRC1_NR_SHIFT ) +#define A1_SRC2_REG( reg ) ( (reg) << A1_SRC2_NR_SHIFT ) +#define A2_SRC2_REG( reg ) ( (reg) << A2_SRC2_NR_SHIFT ) +#define D0_DECL_REG( reg ) ( (reg) << D0_NR_SHIFT ) +#define T0_DEST_REG( reg ) ( (reg) << T0_DEST_NR_SHIFT ) + +#define T0_SAMPLER( unit ) ((unit)<ctx); + + static const GLuint prog[] = { + _3DSTATE_PIXEL_SHADER_PROGRAM, + + /* Declare incoming diffuse color: + */ + (D0_DCL | D0_DECL_REG(REG_T_DIFFUSE) | D0_CHANNEL_ALL), + D1_MBZ, + D2_MBZ, + + /* output-color = mov(t_diffuse) + */ + (A0_MOV | + A0_DEST_REG(REG_OC) | + A0_DEST_CHANNEL_ALL | A0_SRC0_REG(REG_T_DIFFUSE)), + (A1_SRC0_XYZW), + 0, + }; + + + memcpy(i915->meta.Program, prog, sizeof(prog)); + i915->meta.ProgramSize = sizeof(prog) / sizeof(*prog); + i915->meta.Program[0] |= i915->meta.ProgramSize - 2; + i915->meta.emitted &= ~I915_UPLOAD_PROGRAM; +} + +static void +meta_texture_blend_replace(struct intel_context *intel) +{ + struct i915_context *i915 = i915_context(&intel->ctx); + + static const GLuint prog[] = { + _3DSTATE_PIXEL_SHADER_PROGRAM, + + /* Declare the sampler: + */ + (D0_DCL | D0_DECL_REG(REG_S(0)) | D0_SAMPLE_TYPE_2D | D0_CHANNEL_NONE), + D1_MBZ, + D2_MBZ, + + /* Declare the interpolated texture coordinate: + */ + (D0_DCL | D0_DECL_REG(REG_T_TEX(0)) | D0_CHANNEL_ALL), + D1_MBZ, + D2_MBZ, + + /* output-color = texld(sample0, texcoord0) + */ + (T0_TEXLD | T0_DEST_REG(REG_OC) | T0_SAMPLER(0)), + T1_ADDRESS_REG(REG_TYPE_T, 0), + T2_MBZ + }; + + memcpy(i915->meta.Program, prog, sizeof(prog)); + i915->meta.ProgramSize = sizeof(prog) / sizeof(*prog); + i915->meta.Program[0] |= i915->meta.ProgramSize - 2; + i915->meta.emitted &= ~I915_UPLOAD_PROGRAM; +} + + + + + +/* Set up an arbitary piece of memory as a rectangular texture + * (including the front or back buffer). + */ +static GLboolean +meta_tex_rect_source(struct intel_context *intel, + struct _DriBufferObject *buffer, + GLuint offset, + GLuint pitch, GLuint height, GLenum format, GLenum type) +{ + struct i915_context *i915 = i915_context(&intel->ctx); + GLuint unit = 0; + GLint numLevels = 1; + GLuint *state = i915->meta.Tex[0]; + GLuint textureFormat; + GLuint cpp; + + /* A full implementation of this would do the upload through + * glTexImage2d, and get all the conversion operations at that + * point. We are restricted, but still at least have access to the + * fragment program swizzle. + */ + switch (format) { + case GL_BGRA: + switch (type) { + case GL_UNSIGNED_INT_8_8_8_8_REV: + case GL_UNSIGNED_BYTE: + textureFormat = (MAPSURF_32BIT | MT_32BIT_ARGB8888); + cpp = 4; + break; + default: + return GL_FALSE; + } + break; + case GL_RGBA: + switch (type) { + case GL_UNSIGNED_INT_8_8_8_8_REV: + case GL_UNSIGNED_BYTE: + textureFormat = (MAPSURF_32BIT | MT_32BIT_ABGR8888); + cpp = 4; + break; + default: + return GL_FALSE; + } + break; + case GL_BGR: + switch (type) { + case GL_UNSIGNED_SHORT_5_6_5_REV: + textureFormat = (MAPSURF_16BIT | MT_16BIT_RGB565); + cpp = 2; + break; + default: + return GL_FALSE; + } + break; + case GL_RGB: + switch (type) { + case GL_UNSIGNED_SHORT_5_6_5: + textureFormat = (MAPSURF_16BIT | MT_16BIT_RGB565); + cpp = 2; + break; + default: + return GL_FALSE; + } + break; + + default: + return GL_FALSE; + } + + + if ((pitch * cpp) & 3) { + _mesa_printf("%s: texture is not dword pitch\n", __FUNCTION__); + return GL_FALSE; + } + +/* intel_region_release(&i915->meta.tex_region[0]); */ +/* intel_region_reference(&i915->meta.tex_region[0], region); */ + i915->meta.tex_buffer[0] = buffer; + i915->meta.tex_offset[0] = offset; + + state[I915_TEXREG_MS3] = (((height - 1) << MS3_HEIGHT_SHIFT) | + ((pitch - 1) << MS3_WIDTH_SHIFT) | + textureFormat | MS3_USE_FENCE_REGS); + + state[I915_TEXREG_MS4] = (((((pitch * cpp) / 4) - 1) << MS4_PITCH_SHIFT) | + MS4_CUBE_FACE_ENA_MASK | + ((((numLevels - 1) * 4)) << MS4_MAX_LOD_SHIFT)); + + state[I915_TEXREG_SS2] = ((FILTER_NEAREST << SS2_MIN_FILTER_SHIFT) | + (MIPFILTER_NONE << SS2_MIP_FILTER_SHIFT) | + (FILTER_NEAREST << SS2_MAG_FILTER_SHIFT)); + + state[I915_TEXREG_SS3] = ((TEXCOORDMODE_WRAP << SS3_TCX_ADDR_MODE_SHIFT) | + (TEXCOORDMODE_WRAP << SS3_TCY_ADDR_MODE_SHIFT) | + (TEXCOORDMODE_WRAP << SS3_TCZ_ADDR_MODE_SHIFT) | + (unit << SS3_TEXTUREMAP_INDEX_SHIFT)); + + state[I915_TEXREG_SS4] = 0; + + i915->meta.emitted &= ~I915_UPLOAD_TEX(0); + return GL_TRUE; +} + + +/** + * Set the color and depth drawing region for meta ops. + */ +static void +meta_draw_region(struct intel_context *intel, + struct intel_region *color_region, + struct intel_region *depth_region) +{ + struct i915_context *i915 = i915_context(&intel->ctx); + i915_state_draw_region(intel, &i915->meta, color_region, depth_region); +} + + +static void +set_vertex_format(struct intel_context *intel) +{ + struct i915_context *i915 = i915_context(&intel->ctx); + + i915->meta.Ctx[I915_CTXREG_LIS2] = + (S2_TEXCOORD_FMT(0, TEXCOORDFMT_2D) | + S2_TEXCOORD_FMT(1, TEXCOORDFMT_NOT_PRESENT) | + S2_TEXCOORD_FMT(2, TEXCOORDFMT_NOT_PRESENT) | + S2_TEXCOORD_FMT(3, TEXCOORDFMT_NOT_PRESENT) | + S2_TEXCOORD_FMT(4, TEXCOORDFMT_NOT_PRESENT) | + S2_TEXCOORD_FMT(5, TEXCOORDFMT_NOT_PRESENT) | + S2_TEXCOORD_FMT(6, TEXCOORDFMT_NOT_PRESENT) | + S2_TEXCOORD_FMT(7, TEXCOORDFMT_NOT_PRESENT)); + + i915->meta.Ctx[I915_CTXREG_LIS4] &= ~S4_VFMT_MASK; + + i915->meta.Ctx[I915_CTXREG_LIS4] |= (S4_VFMT_COLOR | S4_VFMT_XYZ); + + i915->meta.emitted &= ~I915_UPLOAD_CTX; +} + + + +/* Operations where the 3D engine is decoupled temporarily from the + * current GL state and used for other purposes than simply rendering + * incoming triangles. + */ +static void +install_meta_state(struct intel_context *intel) +{ + struct i915_context *i915 = i915_context(&intel->ctx); + memcpy(&i915->meta, &i915->initial, sizeof(i915->meta)); + i915->meta.active = ACTIVE; + i915->meta.emitted = 0; + + SET_STATE(i915, meta); + set_vertex_format(intel); + meta_no_texture(intel); +} + +static void +leave_meta_state(struct intel_context *intel) +{ + struct i915_context *i915 = i915_context(&intel->ctx); + intel_region_release(&i915->meta.draw_region); + intel_region_release(&i915->meta.depth_region); +/* intel_region_release(&i915->meta.tex_region[0]); */ + SET_STATE(i915, state); +} + + + +void +i915InitMetaFuncs(struct i915_context *i915) +{ + i915->intel.vtbl.install_meta_state = install_meta_state; + i915->intel.vtbl.leave_meta_state = leave_meta_state; + i915->intel.vtbl.meta_no_depth_write = meta_no_depth_write; + i915->intel.vtbl.meta_no_stencil_write = meta_no_stencil_write; + i915->intel.vtbl.meta_stencil_replace = meta_stencil_replace; + i915->intel.vtbl.meta_depth_replace = meta_depth_replace; + i915->intel.vtbl.meta_color_mask = meta_color_mask; + i915->intel.vtbl.meta_no_texture = meta_no_texture; + i915->intel.vtbl.meta_texture_blend_replace = meta_texture_blend_replace; + i915->intel.vtbl.meta_tex_rect_source = meta_tex_rect_source; + i915->intel.vtbl.meta_draw_region = meta_draw_region; + i915->intel.vtbl.meta_import_pixel_state = meta_import_pixel_state; +} diff --git a/src/mesa/drivers/dri/i915tex/i915_program.c b/src/mesa/drivers/dri/i915tex/i915_program.c new file mode 100644 index 00000000000..0be89d33206 --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/i915_program.c @@ -0,0 +1,515 @@ +/************************************************************************** + * + * Copyright 2003 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. + * + **************************************************************************/ + +#include + +#include "glheader.h" +#include "macros.h" +#include "enums.h" + +#include "tnl/t_context.h" +#include "intel_batchbuffer.h" + +#include "i915_reg.h" +#include "i915_context.h" +#include "i915_program.h" + + +#define A0_DEST( reg ) (((reg)&UREG_TYPE_NR_MASK)>>UREG_A0_DEST_SHIFT_LEFT) +#define D0_DEST( reg ) (((reg)&UREG_TYPE_NR_MASK)>>UREG_A0_DEST_SHIFT_LEFT) +#define T0_DEST( reg ) (((reg)&UREG_TYPE_NR_MASK)>>UREG_A0_DEST_SHIFT_LEFT) +#define A0_SRC0( reg ) (((reg)&UREG_MASK)>>UREG_A0_SRC0_SHIFT_LEFT) +#define A1_SRC0( reg ) (((reg)&UREG_MASK)<>UREG_A1_SRC1_SHIFT_LEFT) +#define A2_SRC1( reg ) (((reg)&UREG_MASK)<>UREG_A2_SRC2_SHIFT_LEFT) + +/* These are special, and don't have swizzle/negate bits. + */ +#define T0_SAMPLER( reg ) (GET_UREG_NR(reg)<temp_flag); + if (!bit) { + fprintf(stderr, "%s: out of temporaries\n", __FILE__); + exit(1); + } + + p->temp_flag |= 1 << (bit - 1); + return UREG(REG_TYPE_R, (bit - 1)); +} + + +GLuint +i915_get_utemp(struct i915_fragment_program * p) +{ + int bit = ffs(~p->utemp_flag); + if (!bit) { + fprintf(stderr, "%s: out of temporaries\n", __FILE__); + exit(1); + } + + p->utemp_flag |= 1 << (bit - 1); + return UREG(REG_TYPE_U, (bit - 1)); +} + +void +i915_release_utemps(struct i915_fragment_program *p) +{ + p->utemp_flag = ~0x7; +} + + +GLuint +i915_emit_decl(struct i915_fragment_program *p, + GLuint type, GLuint nr, GLuint d0_flags) +{ + GLuint reg = UREG(type, nr); + + if (type == REG_TYPE_T) { + if (p->decl_t & (1 << nr)) + return reg; + + p->decl_t |= (1 << nr); + } + else if (type == REG_TYPE_S) { + if (p->decl_s & (1 << nr)) + return reg; + + p->decl_s |= (1 << nr); + } + else + return reg; + + *(p->decl++) = (D0_DCL | D0_DEST(reg) | d0_flags); + *(p->decl++) = D1_MBZ; + *(p->decl++) = D2_MBZ; + + p->nr_decl_insn++; + return reg; +} + +GLuint +i915_emit_arith(struct i915_fragment_program * p, + GLuint op, + GLuint dest, + GLuint mask, + GLuint saturate, GLuint src0, GLuint src1, GLuint src2) +{ + GLuint c[3]; + GLuint nr_const = 0; + + assert(GET_UREG_TYPE(dest) != REG_TYPE_CONST); + dest = UREG(GET_UREG_TYPE(dest), GET_UREG_NR(dest)); + assert(dest); + + if (GET_UREG_TYPE(src0) == REG_TYPE_CONST) + c[nr_const++] = 0; + if (GET_UREG_TYPE(src1) == REG_TYPE_CONST) + c[nr_const++] = 1; + if (GET_UREG_TYPE(src2) == REG_TYPE_CONST) + c[nr_const++] = 2; + + /* Recursively call this function to MOV additional const values + * into temporary registers. Use utemp registers for this - + * currently shouldn't be possible to run out, but keep an eye on + * this. + */ + if (nr_const > 1) { + GLuint s[3], first, i, old_utemp_flag; + + s[0] = src0; + s[1] = src1; + s[2] = src2; + old_utemp_flag = p->utemp_flag; + + first = GET_UREG_NR(s[c[0]]); + for (i = 1; i < nr_const; i++) { + if (GET_UREG_NR(s[c[i]]) != first) { + GLuint tmp = i915_get_utemp(p); + + i915_emit_arith(p, A0_MOV, tmp, A0_DEST_CHANNEL_ALL, 0, + s[c[i]], 0, 0); + s[c[i]] = tmp; + } + } + + src0 = s[0]; + src1 = s[1]; + src2 = s[2]; + p->utemp_flag = old_utemp_flag; /* restore */ + } + + *(p->csr++) = (op | A0_DEST(dest) | mask | saturate | A0_SRC0(src0)); + *(p->csr++) = (A1_SRC0(src0) | A1_SRC1(src1)); + *(p->csr++) = (A2_SRC1(src1) | A2_SRC2(src2)); + + p->nr_alu_insn++; + return dest; +} + +GLuint i915_emit_texld( struct i915_fragment_program *p, + GLuint dest, + GLuint destmask, + GLuint sampler, + GLuint coord, + GLuint op ) +{ + if (coord != UREG(GET_UREG_TYPE(coord), GET_UREG_NR(coord))) { + /* No real way to work around this in the general case - need to + * allocate and declare a new temporary register (a utemp won't + * do). Will fallback for now. + */ + i915_program_error(p, "Can't (yet) swizzle TEX arguments"); + return 0; + } + + /* Don't worry about saturate as we only support + */ + if (destmask != A0_DEST_CHANNEL_ALL) { + GLuint tmp = i915_get_utemp(p); + i915_emit_texld( p, tmp, A0_DEST_CHANNEL_ALL, sampler, coord, op ); + i915_emit_arith( p, A0_MOV, dest, destmask, 0, tmp, 0, 0 ); + return dest; + } + else { + assert(GET_UREG_TYPE(dest) != REG_TYPE_CONST); + assert(dest = UREG(GET_UREG_TYPE(dest), GET_UREG_NR(dest))); + + if (GET_UREG_TYPE(coord) != REG_TYPE_T) { + p->nr_tex_indirect++; + } + + *(p->csr++) = (op | + T0_DEST( dest ) | + T0_SAMPLER( sampler )); + + *(p->csr++) = T1_ADDRESS_REG( coord ); + *(p->csr++) = T2_MBZ; + + p->nr_tex_insn++; + return dest; + } +} + + +GLuint +i915_emit_const1f(struct i915_fragment_program * p, GLfloat c0) +{ + GLint reg, idx; + + if (c0 == 0.0) + return swizzle(UREG(REG_TYPE_R, 0), ZERO, ZERO, ZERO, ZERO); + if (c0 == 1.0) + return swizzle(UREG(REG_TYPE_R, 0), ONE, ONE, ONE, ONE); + + for (reg = 0; reg < I915_MAX_CONSTANT; reg++) { + if (p->constant_flags[reg] == I915_CONSTFLAG_PARAM) + continue; + for (idx = 0; idx < 4; idx++) { + if (!(p->constant_flags[reg] & (1 << idx)) || + p->constant[reg][idx] == c0) { + p->constant[reg][idx] = c0; + p->constant_flags[reg] |= 1 << idx; + if (reg + 1 > p->nr_constants) + p->nr_constants = reg + 1; + return swizzle(UREG(REG_TYPE_CONST, reg), idx, ZERO, ZERO, ONE); + } + } + } + + fprintf(stderr, "%s: out of constants\n", __FUNCTION__); + p->error = 1; + return 0; +} + +GLuint +i915_emit_const2f(struct i915_fragment_program * p, GLfloat c0, GLfloat c1) +{ + GLint reg, idx; + + if (c0 == 0.0) + return swizzle(i915_emit_const1f(p, c1), ZERO, X, Z, W); + if (c0 == 1.0) + return swizzle(i915_emit_const1f(p, c1), ONE, X, Z, W); + + if (c1 == 0.0) + return swizzle(i915_emit_const1f(p, c0), X, ZERO, Z, W); + if (c1 == 1.0) + return swizzle(i915_emit_const1f(p, c0), X, ONE, Z, W); + + for (reg = 0; reg < I915_MAX_CONSTANT; reg++) { + if (p->constant_flags[reg] == 0xf || + p->constant_flags[reg] == I915_CONSTFLAG_PARAM) + continue; + for (idx = 0; idx < 3; idx++) { + if (!(p->constant_flags[reg] & (3 << idx))) { + p->constant[reg][idx] = c0; + p->constant[reg][idx + 1] = c1; + p->constant_flags[reg] |= 3 << idx; + if (reg + 1 > p->nr_constants) + p->nr_constants = reg + 1; + return swizzle(UREG(REG_TYPE_CONST, reg), idx, idx + 1, ZERO, + ONE); + } + } + } + + fprintf(stderr, "%s: out of constants\n", __FUNCTION__); + p->error = 1; + return 0; +} + + + +GLuint +i915_emit_const4f(struct i915_fragment_program * p, + GLfloat c0, GLfloat c1, GLfloat c2, GLfloat c3) +{ + GLint reg; + + for (reg = 0; reg < I915_MAX_CONSTANT; reg++) { + if (p->constant_flags[reg] == 0xf && + p->constant[reg][0] == c0 && + p->constant[reg][1] == c1 && + p->constant[reg][2] == c2 && p->constant[reg][3] == c3) { + return UREG(REG_TYPE_CONST, reg); + } + else if (p->constant_flags[reg] == 0) { + p->constant[reg][0] = c0; + p->constant[reg][1] = c1; + p->constant[reg][2] = c2; + p->constant[reg][3] = c3; + p->constant_flags[reg] = 0xf; + if (reg + 1 > p->nr_constants) + p->nr_constants = reg + 1; + return UREG(REG_TYPE_CONST, reg); + } + } + + fprintf(stderr, "%s: out of constants\n", __FUNCTION__); + p->error = 1; + return 0; +} + + +GLuint +i915_emit_const4fv(struct i915_fragment_program * p, const GLfloat * c) +{ + return i915_emit_const4f(p, c[0], c[1], c[2], c[3]); +} + + +GLuint +i915_emit_param4fv(struct i915_fragment_program * p, const GLfloat * values) +{ + GLint reg, i; + + for (i = 0; i < p->nr_params; i++) { + if (p->param[i].values == values) + return UREG(REG_TYPE_CONST, p->param[i].reg); + } + + + for (reg = 0; reg < I915_MAX_CONSTANT; reg++) { + if (p->constant_flags[reg] == 0) { + p->constant_flags[reg] = I915_CONSTFLAG_PARAM; + i = p->nr_params++; + + p->param[i].values = values; + p->param[i].reg = reg; + p->params_uptodate = 0; + + if (reg + 1 > p->nr_constants) + p->nr_constants = reg + 1; + return UREG(REG_TYPE_CONST, reg); + } + } + + fprintf(stderr, "%s: out of constants\n", __FUNCTION__); + p->error = 1; + return 0; +} + + + +void +i915_program_error(struct i915_fragment_program *p, const char *msg) +{ + _mesa_problem(NULL, "i915_program_error: %s", msg); + p->error = 1; +} + + +void +i915_init_program(struct i915_context *i915, struct i915_fragment_program *p) +{ + GLcontext *ctx = &i915->intel.ctx; + TNLcontext *tnl = TNL_CONTEXT(ctx); + + p->translated = 0; + p->params_uptodate = 0; + p->on_hardware = 0; + p->error = 0; + + p->nr_tex_indirect = 1; /* correct? */ + p->nr_tex_insn = 0; + p->nr_alu_insn = 0; + p->nr_decl_insn = 0; + + p->ctx = ctx; + memset(p->constant_flags, 0, sizeof(p->constant_flags)); + + p->nr_constants = 0; + p->csr = p->program; + p->decl = p->declarations; + p->decl_s = 0; + p->decl_t = 0; + p->temp_flag = 0xffff000; + p->utemp_flag = ~0x7; + p->wpos_tex = -1; + p->depth_written = 0; + p->nr_params = 0; + + p->src_texture = UREG_BAD; + p->src_previous = UREG(REG_TYPE_T, T_DIFFUSE); + p->last_tex_stage = 0; + p->VB = &tnl->vb; + + *(p->decl++) = _3DSTATE_PIXEL_SHADER_PROGRAM; +} + + +void +i915_fini_program(struct i915_fragment_program *p) +{ + GLuint program_size = p->csr - p->program; + GLuint decl_size = p->decl - p->declarations; + + if (p->nr_tex_indirect > I915_MAX_TEX_INDIRECT) + i915_program_error(p, "Exceeded max nr indirect texture lookups"); + + if (p->nr_tex_insn > I915_MAX_TEX_INSN) + i915_program_error(p, "Exceeded max TEX instructions"); + + if (p->nr_alu_insn > I915_MAX_ALU_INSN) + i915_program_error(p, "Exceeded max ALU instructions"); + + if (p->nr_decl_insn > I915_MAX_DECL_INSN) + i915_program_error(p, "Exceeded max DECL instructions"); + + if (p->error) { + p->FragProg.Base.NumNativeInstructions = 0; + p->FragProg.NumNativeAluInstructions = 0; + p->FragProg.NumNativeTexInstructions = 0; + p->FragProg.NumNativeTexIndirections = 0; + } + else { + p->FragProg.Base.NumNativeInstructions = (p->nr_alu_insn + + p->nr_tex_insn + + p->nr_decl_insn); + p->FragProg.NumNativeAluInstructions = p->nr_alu_insn; + p->FragProg.NumNativeTexInstructions = p->nr_tex_insn; + p->FragProg.NumNativeTexIndirections = p->nr_tex_indirect; + } + + p->declarations[0] |= program_size + decl_size - 2; +} + +void +i915_upload_program(struct i915_context *i915, + struct i915_fragment_program *p) +{ + GLuint program_size = p->csr - p->program; + GLuint decl_size = p->decl - p->declarations; + + FALLBACK(&i915->intel, I915_FALLBACK_PROGRAM, p->error); + + /* Could just go straight to the batchbuffer from here: + */ + if (i915->state.ProgramSize != (program_size + decl_size) || + memcmp(i915->state.Program + decl_size, p->program, + program_size * sizeof(int)) != 0) { + I915_STATECHANGE(i915, I915_UPLOAD_PROGRAM); + memcpy(i915->state.Program, p->declarations, decl_size * sizeof(int)); + memcpy(i915->state.Program + decl_size, p->program, + program_size * sizeof(int)); + i915->state.ProgramSize = decl_size + program_size; + } + + /* Always seemed to get a failure if I used memcmp() to + * shortcircuit this state upload. Needs further investigation? + */ + if (p->nr_constants) { + GLuint nr = p->nr_constants; + + I915_ACTIVESTATE(i915, I915_UPLOAD_CONSTANTS, 1); + I915_STATECHANGE(i915, I915_UPLOAD_CONSTANTS); + + i915->state.Constant[0] = _3DSTATE_PIXEL_SHADER_CONSTANTS | ((nr) * 4); + i915->state.Constant[1] = (1 << (nr - 1)) | ((1 << (nr - 1)) - 1); + + memcpy(&i915->state.Constant[2], p->constant, 4 * sizeof(int) * (nr)); + i915->state.ConstantSize = 2 + (nr) * 4; + + if (0) { + GLuint i; + for (i = 0; i < nr; i++) { + fprintf(stderr, "const[%d]: %f %f %f %f\n", i, + p->constant[i][0], + p->constant[i][1], p->constant[i][2], p->constant[i][3]); + } + } + } + else { + I915_ACTIVESTATE(i915, I915_UPLOAD_CONSTANTS, 0); + } + + p->on_hardware = 1; +} diff --git a/src/mesa/drivers/dri/i915tex/i915_program.h b/src/mesa/drivers/dri/i915tex/i915_program.h new file mode 100644 index 00000000000..3c12b34f163 --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/i915_program.h @@ -0,0 +1,160 @@ +/************************************************************************** + * + * Copyright 2003 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. + * + **************************************************************************/ + + +#ifndef I915_PROGRAM_H +#define I915_PROGRAM_H + +#include "i915_context.h" +#include "i915_reg.h" + + + +/* Having zero and one in here makes the definition of swizzle a lot + * easier. + */ +#define UREG_TYPE_SHIFT 29 +#define UREG_NR_SHIFT 24 +#define UREG_CHANNEL_X_NEGATE_SHIFT 23 +#define UREG_CHANNEL_X_SHIFT 20 +#define UREG_CHANNEL_Y_NEGATE_SHIFT 19 +#define UREG_CHANNEL_Y_SHIFT 16 +#define UREG_CHANNEL_Z_NEGATE_SHIFT 15 +#define UREG_CHANNEL_Z_SHIFT 12 +#define UREG_CHANNEL_W_NEGATE_SHIFT 11 +#define UREG_CHANNEL_W_SHIFT 8 +#define UREG_CHANNEL_ZERO_NEGATE_MBZ 5 +#define UREG_CHANNEL_ZERO_SHIFT 4 +#define UREG_CHANNEL_ONE_NEGATE_MBZ 1 +#define UREG_CHANNEL_ONE_SHIFT 0 + +#define UREG_BAD 0xffffffff /* not a valid ureg */ + +#define X SRC_X +#define Y SRC_Y +#define Z SRC_Z +#define W SRC_W +#define ZERO SRC_ZERO +#define ONE SRC_ONE + +/* Construct a ureg: + */ +#define UREG( type, nr ) (((type)<< UREG_TYPE_SHIFT) | \ + ((nr) << UREG_NR_SHIFT) | \ + (X << UREG_CHANNEL_X_SHIFT) | \ + (Y << UREG_CHANNEL_Y_SHIFT) | \ + (Z << UREG_CHANNEL_Z_SHIFT) | \ + (W << UREG_CHANNEL_W_SHIFT) | \ + (ZERO << UREG_CHANNEL_ZERO_SHIFT) | \ + (ONE << UREG_CHANNEL_ONE_SHIFT)) + +#define GET_CHANNEL_SRC( reg, channel ) ((reg<<(channel*4)) & (0xf<<20)) +#define CHANNEL_SRC( src, channel ) (src>>(channel*4)) + +#define GET_UREG_TYPE(reg) (((reg)>>UREG_TYPE_SHIFT)®_TYPE_MASK) +#define GET_UREG_NR(reg) (((reg)>>UREG_NR_SHIFT)®_NR_MASK) + + + +#define UREG_XYZW_CHANNEL_MASK 0x00ffff00 + +/* One neat thing about the UREG representation: + */ +static INLINE int +swizzle(int reg, int x, int y, int z, int w) +{ + return ((reg & ~UREG_XYZW_CHANNEL_MASK) | + CHANNEL_SRC(GET_CHANNEL_SRC(reg, x), 0) | + CHANNEL_SRC(GET_CHANNEL_SRC(reg, y), 1) | + CHANNEL_SRC(GET_CHANNEL_SRC(reg, z), 2) | + CHANNEL_SRC(GET_CHANNEL_SRC(reg, w), 3)); +} + +/* Another neat thing about the UREG representation: + */ +static INLINE int +negate(int reg, int x, int y, int z, int w) +{ + return reg ^ (((x & 1) << UREG_CHANNEL_X_NEGATE_SHIFT) | + ((y & 1) << UREG_CHANNEL_Y_NEGATE_SHIFT) | + ((z & 1) << UREG_CHANNEL_Z_NEGATE_SHIFT) | + ((w & 1) << UREG_CHANNEL_W_NEGATE_SHIFT)); +} + + +extern GLuint i915_get_temp(struct i915_fragment_program *p); +extern GLuint i915_get_utemp(struct i915_fragment_program *p); +extern void i915_release_utemps(struct i915_fragment_program *p); + + +extern GLuint i915_emit_texld(struct i915_fragment_program *p, + GLuint dest, + GLuint destmask, + GLuint sampler, GLuint coord, GLuint op); + +extern GLuint i915_emit_arith(struct i915_fragment_program *p, + GLuint op, + GLuint dest, + GLuint mask, + GLuint saturate, + GLuint src0, GLuint src1, GLuint src2); + +extern GLuint i915_emit_decl(struct i915_fragment_program *p, + GLuint type, GLuint nr, GLuint d0_flags); + + +extern GLuint i915_emit_const1f(struct i915_fragment_program *p, GLfloat c0); + +extern GLuint i915_emit_const2f(struct i915_fragment_program *p, + GLfloat c0, GLfloat c1); + +extern GLuint i915_emit_const4fv(struct i915_fragment_program *p, + const GLfloat * c); + +extern GLuint i915_emit_const4f(struct i915_fragment_program *p, + GLfloat c0, GLfloat c1, + GLfloat c2, GLfloat c3); + + +extern GLuint i915_emit_param4fv(struct i915_fragment_program *p, + const GLfloat * values); + +extern void i915_program_error(struct i915_fragment_program *p, + const char *msg); + +extern void i915_init_program(struct i915_context *i915, + struct i915_fragment_program *p); + +extern void i915_upload_program(struct i915_context *i915, + struct i915_fragment_program *p); + +extern void i915_fini_program(struct i915_fragment_program *p); + + + + +#endif diff --git a/src/mesa/drivers/dri/i915tex/i915_reg.h b/src/mesa/drivers/dri/i915tex/i915_reg.h new file mode 100644 index 00000000000..04b199905c1 --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/i915_reg.h @@ -0,0 +1,841 @@ +/************************************************************************** + * + * Copyright 2003 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. + * + **************************************************************************/ + + +#ifndef _I915_REG_H_ +#define _I915_REG_H_ + + +#include "intel_reg.h" + +#define I915_SET_FIELD( var, mask, value ) (var &= ~(mask), var |= value) + +#define CMD_3D (0x3<<29) + +#define PRIM3D_INLINE (CMD_3D | (0x1f<<24)) +#define PRIM3D_TRILIST (0x0<<18) +#define PRIM3D_TRISTRIP (0x1<<18) +#define PRIM3D_TRISTRIP_RVRSE (0x2<<18) +#define PRIM3D_TRIFAN (0x3<<18) +#define PRIM3D_POLY (0x4<<18) +#define PRIM3D_LINELIST (0x5<<18) +#define PRIM3D_LINESTRIP (0x6<<18) +#define PRIM3D_RECTLIST (0x7<<18) +#define PRIM3D_POINTLIST (0x8<<18) +#define PRIM3D_DIB (0x9<<18) +#define PRIM3D_CLEAR_RECT (0xa<<18) +#define PRIM3D_ZONE_INIT (0xd<<18) +#define PRIM3D_MASK (0x1f<<18) + +/* p137 */ +#define _3DSTATE_AA_CMD (CMD_3D | (0x06<<24)) +#define AA_LINE_ECAAR_WIDTH_ENABLE (1<<16) +#define AA_LINE_ECAAR_WIDTH_0_5 0 +#define AA_LINE_ECAAR_WIDTH_1_0 (1<<14) +#define AA_LINE_ECAAR_WIDTH_2_0 (2<<14) +#define AA_LINE_ECAAR_WIDTH_4_0 (3<<14) +#define AA_LINE_REGION_WIDTH_ENABLE (1<<8) +#define AA_LINE_REGION_WIDTH_0_5 0 +#define AA_LINE_REGION_WIDTH_1_0 (1<<6) +#define AA_LINE_REGION_WIDTH_2_0 (2<<6) +#define AA_LINE_REGION_WIDTH_4_0 (3<<6) + +/* 3DSTATE_BACKFACE_STENCIL_OPS, p138*/ +#define _3DSTATE_BACKFACE_STENCIL_OPS (CMD_3D | (0x8<<24)) +#define BFO_ENABLE_STENCIL_REF (1<<23) +#define BFO_STENCIL_REF_SHIFT 15 +#define BFO_STENCIL_REF_MASK (0xff<<15) +#define BFO_ENABLE_STENCIL_FUNCS (1<<14) +#define BFO_STENCIL_TEST_SHIFT 11 +#define BFO_STENCIL_TEST_MASK (0x7<<11) +#define BFO_STENCIL_FAIL_SHIFT 8 +#define BFO_STENCIL_FAIL_MASK (0x7<<8) +#define BFO_STENCIL_PASS_Z_FAIL_SHIFT 5 +#define BFO_STENCIL_PASS_Z_FAIL_MASK (0x7<<5) +#define BFO_STENCIL_PASS_Z_PASS_SHIFT 2 +#define BFO_STENCIL_PASS_Z_PASS_MASK (0x7<<2) +#define BFO_ENABLE_STENCIL_TWO_SIDE (1<<1) +#define BFO_STENCIL_TWO_SIDE (1<<0) + + +/* 3DSTATE_BACKFACE_STENCIL_MASKS, p140 */ +#define _3DSTATE_BACKFACE_STENCIL_MASKS (CMD_3D | (0x9<<24)) +#define BFM_ENABLE_STENCIL_TEST_MASK (1<<17) +#define BFM_ENABLE_STENCIL_WRITE_MASK (1<<16) +#define BFM_STENCIL_TEST_MASK_SHIFT 8 +#define BFM_STENCIL_TEST_MASK_MASK (0xff<<8) +#define BFM_STENCIL_WRITE_MASK_SHIFT 0 +#define BFM_STENCIL_WRITE_MASK_MASK (0xff<<0) + + + +/* 3DSTATE_BIN_CONTROL p141 */ + +/* p143 */ +#define _3DSTATE_BUF_INFO_CMD (CMD_3D | (0x1d<<24) | (0x8e<<16) | 1) +/* Dword 1 */ +#define BUF_3D_ID_COLOR_BACK (0x3<<24) +#define BUF_3D_ID_DEPTH (0x7<<24) +#define BUF_3D_USE_FENCE (1<<23) +#define BUF_3D_TILED_SURFACE (1<<22) +#define BUF_3D_TILE_WALK_X 0 +#define BUF_3D_TILE_WALK_Y (1<<21) +#define BUF_3D_PITCH(x) (((x)/4)<<2) +/* Dword 2 */ +#define BUF_3D_ADDR(x) ((x) & ~0x3) + + +/* 3DSTATE_CHROMA_KEY */ + +/* 3DSTATE_CLEAR_PARAMETERS, p150 */ + +/* 3DSTATE_CONSTANT_BLEND_COLOR, p153 */ +#define _3DSTATE_CONST_BLEND_COLOR_CMD (CMD_3D | (0x1d<<24) | (0x88<<16)) + + + +/* 3DSTATE_COORD_SET_BINDINGS, p154 */ +#define _3DSTATE_COORD_SET_BINDINGS (CMD_3D | (0x16<<24)) +#define CSB_TCB(iunit, eunit) ((eunit)<<(iunit*3)) + +/* p156 */ +#define _3DSTATE_DFLT_DIFFUSE_CMD (CMD_3D | (0x1d<<24) | (0x99<<16)) + +/* p157 */ +#define _3DSTATE_DFLT_SPEC_CMD (CMD_3D | (0x1d<<24) | (0x9a<<16)) + +/* p158 */ +#define _3DSTATE_DFLT_Z_CMD (CMD_3D | (0x1d<<24) | (0x98<<16)) + + +/* 3DSTATE_DEPTH_OFFSET_SCALE, p159 */ +#define _3DSTATE_DEPTH_OFFSET_SCALE (CMD_3D | (0x1d<<24) | (0x97<<16)) +/* scale in dword 1 */ + + +/* 3DSTATE_DEPTH_SUBRECT_DISABLE, p160 */ +#define _3DSTATE_DEPTH_SUBRECT_DISABLE (CMD_3D | (0x1c<<24) | (0x11<19) | 0x2) + +/* p161 */ +#define _3DSTATE_DST_BUF_VARS_CMD (CMD_3D | (0x1d<<24) | (0x85<<16)) +/* Dword 1 */ +#define TEX_DEFAULT_COLOR_OGL (0<<30) +#define TEX_DEFAULT_COLOR_D3D (1<<30) +#define ZR_EARLY_DEPTH (1<<29) +#define LOD_PRECLAMP_OGL (1<<28) +#define LOD_PRECLAMP_D3D (0<<28) +#define DITHER_FULL_ALWAYS (0<<26) +#define DITHER_FULL_ON_FB_BLEND (1<<26) +#define DITHER_CLAMPED_ALWAYS (2<<26) +#define LINEAR_GAMMA_BLEND_32BPP (1<<25) +#define DEBUG_DISABLE_ENH_DITHER (1<<24) +#define DSTORG_HORT_BIAS(x) ((x)<<20) +#define DSTORG_VERT_BIAS(x) ((x)<<16) +#define COLOR_4_2_2_CHNL_WRT_ALL 0 +#define COLOR_4_2_2_CHNL_WRT_Y (1<<12) +#define COLOR_4_2_2_CHNL_WRT_CR (2<<12) +#define COLOR_4_2_2_CHNL_WRT_CB (3<<12) +#define COLOR_4_2_2_CHNL_WRT_CRCB (4<<12) +#define COLR_BUF_8BIT 0 +#define COLR_BUF_RGB555 (1<<8) +#define COLR_BUF_RGB565 (2<<8) +#define COLR_BUF_ARGB8888 (3<<8) +#define DEPTH_FRMT_16_FIXED 0 +#define DEPTH_FRMT_16_FLOAT (1<<2) +#define DEPTH_FRMT_24_FIXED_8_OTHER (2<<2) +#define VERT_LINE_STRIDE_1 (1<<1) +#define VERT_LINE_STRIDE_0 (0<<1) +#define VERT_LINE_STRIDE_OFS_1 1 +#define VERT_LINE_STRIDE_OFS_0 0 + +/* p166 */ +#define _3DSTATE_DRAW_RECT_CMD (CMD_3D|(0x1d<<24)|(0x80<<16)|3) +/* Dword 1 */ +#define DRAW_RECT_DIS_DEPTH_OFS (1<<30) +#define DRAW_DITHER_OFS_X(x) ((x)<<26) +#define DRAW_DITHER_OFS_Y(x) ((x)<<24) +/* Dword 2 */ +#define DRAW_YMIN(x) ((x)<<16) +#define DRAW_XMIN(x) (x) +/* Dword 3 */ +#define DRAW_YMAX(x) ((x)<<16) +#define DRAW_XMAX(x) (x) +/* Dword 4 */ +#define DRAW_YORG(x) ((x)<<16) +#define DRAW_XORG(x) (x) + + +/* 3DSTATE_FILTER_COEFFICIENTS_4X4, p170 */ + +/* 3DSTATE_FILTER_COEFFICIENTS_6X5, p172 */ + + +/* _3DSTATE_FOG_COLOR, p173 */ +#define _3DSTATE_FOG_COLOR_CMD (CMD_3D|(0x15<<24)) +#define FOG_COLOR_RED(x) ((x)<<16) +#define FOG_COLOR_GREEN(x) ((x)<<8) +#define FOG_COLOR_BLUE(x) (x) + +/* _3DSTATE_FOG_MODE, p174 */ +#define _3DSTATE_FOG_MODE_CMD (CMD_3D|(0x1d<<24)|(0x89<<16)|2) +/* Dword 1 */ +#define FMC1_FOGFUNC_MODIFY_ENABLE (1<<31) +#define FMC1_FOGFUNC_VERTEX (0<<28) +#define FMC1_FOGFUNC_PIXEL_EXP (1<<28) +#define FMC1_FOGFUNC_PIXEL_EXP2 (2<<28) +#define FMC1_FOGFUNC_PIXEL_LINEAR (3<<28) +#define FMC1_FOGFUNC_MASK (3<<28) +#define FMC1_FOGINDEX_MODIFY_ENABLE (1<<27) +#define FMC1_FOGINDEX_Z (0<<25) +#define FMC1_FOGINDEX_W (1<<25) +#define FMC1_C1_C2_MODIFY_ENABLE (1<<24) +#define FMC1_DENSITY_MODIFY_ENABLE (1<<23) +#define FMC1_C1_ONE (1<<13) +#define FMC1_C1_MASK (0xffff<<4) +/* Dword 2 */ +#define FMC2_C2_ONE (1<<16) +/* Dword 3 */ +#define FMC3_D_ONE (1<<16) + + + +/* _3DSTATE_INDEPENDENT_ALPHA_BLEND, p177 */ +#define _3DSTATE_INDEPENDENT_ALPHA_BLEND_CMD (CMD_3D|(0x0b<<24)) +#define IAB_MODIFY_ENABLE (1<<23) +#define IAB_ENABLE (1<<22) +#define IAB_MODIFY_FUNC (1<<21) +#define IAB_FUNC_SHIFT 16 +#define IAB_MODIFY_SRC_FACTOR (1<<11) +#define IAB_SRC_FACTOR_SHIFT 6 +#define IAB_SRC_FACTOR_MASK (BLENDFACT_MASK<<6) +#define IAB_MODIFY_DST_FACTOR (1<<5) +#define IAB_DST_FACTOR_SHIFT 0 +#define IAB_DST_FACTOR_MASK (BLENDFACT_MASK<<0) + + +#define BLENDFUNC_ADD 0x0 +#define BLENDFUNC_SUBTRACT 0x1 +#define BLENDFUNC_REVERSE_SUBTRACT 0x2 +#define BLENDFUNC_MIN 0x3 +#define BLENDFUNC_MAX 0x4 +#define BLENDFUNC_MASK 0x7 + +/* 3DSTATE_LOAD_INDIRECT, p180 */ + +#define _3DSTATE_LOAD_INDIRECT (CMD_3D|(0x1d<<24)|(0x7<<16)) +#define LI0_STATE_STATIC_INDIRECT (0x01<<8) +#define LI0_STATE_DYNAMIC_INDIRECT (0x02<<8) +#define LI0_STATE_SAMPLER (0x04<<8) +#define LI0_STATE_MAP (0x08<<8) +#define LI0_STATE_PROGRAM (0x10<<8) +#define LI0_STATE_CONSTANTS (0x20<<8) + +#define SIS0_BUFFER_ADDRESS(x) ((x)&~0x3) +#define SIS0_FORCE_LOAD (1<<1) +#define SIS0_BUFFER_VALID (1<<0) +#define SIS1_BUFFER_LENGTH(x) ((x)&0xff) + +#define DIS0_BUFFER_ADDRESS(x) ((x)&~0x3) +#define DIS0_BUFFER_RESET (1<<1) +#define DIS0_BUFFER_VALID (1<<0) + +#define SSB0_BUFFER_ADDRESS(x) ((x)&~0x3) +#define SSB0_FORCE_LOAD (1<<1) +#define SSB0_BUFFER_VALID (1<<0) +#define SSB1_BUFFER_LENGTH(x) ((x)&0xff) + +#define MSB0_BUFFER_ADDRESS(x) ((x)&~0x3) +#define MSB0_FORCE_LOAD (1<<1) +#define MSB0_BUFFER_VALID (1<<0) +#define MSB1_BUFFER_LENGTH(x) ((x)&0xff) + +#define PSP0_BUFFER_ADDRESS(x) ((x)&~0x3) +#define PSP0_FORCE_LOAD (1<<1) +#define PSP0_BUFFER_VALID (1<<0) +#define PSP1_BUFFER_LENGTH(x) ((x)&0xff) + +#define PSC0_BUFFER_ADDRESS(x) ((x)&~0x3) +#define PSC0_FORCE_LOAD (1<<1) +#define PSC0_BUFFER_VALID (1<<0) +#define PSC1_BUFFER_LENGTH(x) ((x)&0xff) + + + + + +/* _3DSTATE_RASTERIZATION_RULES */ +#define _3DSTATE_RASTER_RULES_CMD (CMD_3D|(0x07<<24)) +#define ENABLE_POINT_RASTER_RULE (1<<15) +#define OGL_POINT_RASTER_RULE (1<<13) +#define ENABLE_TEXKILL_3D_4D (1<<10) +#define TEXKILL_3D (0<<9) +#define TEXKILL_4D (1<<9) +#define ENABLE_LINE_STRIP_PROVOKE_VRTX (1<<8) +#define ENABLE_TRI_FAN_PROVOKE_VRTX (1<<5) +#define LINE_STRIP_PROVOKE_VRTX(x) ((x)<<6) +#define TRI_FAN_PROVOKE_VRTX(x) ((x)<<3) + +/* _3DSTATE_SCISSOR_ENABLE, p256 */ +#define _3DSTATE_SCISSOR_ENABLE_CMD (CMD_3D|(0x1c<<24)|(0x10<<19)) +#define ENABLE_SCISSOR_RECT ((1<<1) | 1) +#define DISABLE_SCISSOR_RECT (1<<1) + +/* _3DSTATE_SCISSOR_RECTANGLE_0, p257 */ +#define _3DSTATE_SCISSOR_RECT_0_CMD (CMD_3D|(0x1d<<24)|(0x81<<16)|1) +/* Dword 1 */ +#define SCISSOR_RECT_0_YMIN(x) ((x)<<16) +#define SCISSOR_RECT_0_XMIN(x) (x) +/* Dword 2 */ +#define SCISSOR_RECT_0_YMAX(x) ((x)<<16) +#define SCISSOR_RECT_0_XMAX(x) (x) + +/* p189 */ +#define _3DSTATE_LOAD_STATE_IMMEDIATE_1 ((0x3<<29)|(0x1d<<24)|(0x04<<16)) +#define I1_LOAD_S(n) (1<<(4+n)) + +#define S0_VB_OFFSET_MASK 0xffffffc +#define S0_AUTO_CACHE_INV_DISABLE (1<<0) + +#define S1_VERTEX_WIDTH_SHIFT 24 +#define S1_VERTEX_WIDTH_MASK (0x3f<<24) +#define S1_VERTEX_PITCH_SHIFT 16 +#define S1_VERTEX_PITCH_MASK (0x3f<<16) + +#define TEXCOORDFMT_2D 0x0 +#define TEXCOORDFMT_3D 0x1 +#define TEXCOORDFMT_4D 0x2 +#define TEXCOORDFMT_1D 0x3 +#define TEXCOORDFMT_2D_16 0x4 +#define TEXCOORDFMT_4D_16 0x5 +#define TEXCOORDFMT_NOT_PRESENT 0xf +#define S2_TEXCOORD_FMT0_MASK 0xf +#define S2_TEXCOORD_FMT1_SHIFT 4 +#define S2_TEXCOORD_FMT(unit, type) ((type)<<(unit*4)) +#define S2_TEXCOORD_NONE (~0) + +/* S3 not interesting */ + +#define S4_POINT_WIDTH_SHIFT 23 +#define S4_POINT_WIDTH_MASK (0x1ff<<23) +#define S4_LINE_WIDTH_SHIFT 19 +#define S4_LINE_WIDTH_ONE (0x2<<19) +#define S4_LINE_WIDTH_MASK (0xf<<19) +#define S4_FLATSHADE_ALPHA (1<<18) +#define S4_FLATSHADE_FOG (1<<17) +#define S4_FLATSHADE_SPECULAR (1<<16) +#define S4_FLATSHADE_COLOR (1<<15) +#define S4_CULLMODE_BOTH (0<<13) +#define S4_CULLMODE_NONE (1<<13) +#define S4_CULLMODE_CW (2<<13) +#define S4_CULLMODE_CCW (3<<13) +#define S4_CULLMODE_MASK (3<<13) +#define S4_VFMT_POINT_WIDTH (1<<12) +#define S4_VFMT_SPEC_FOG (1<<11) +#define S4_VFMT_COLOR (1<<10) +#define S4_VFMT_DEPTH_OFFSET (1<<9) +#define S4_VFMT_XYZ (1<<6) +#define S4_VFMT_XYZW (2<<6) +#define S4_VFMT_XY (3<<6) +#define S4_VFMT_XYW (4<<6) +#define S4_VFMT_XYZW_MASK (7<<6) +#define S4_FORCE_DEFAULT_DIFFUSE (1<<5) +#define S4_FORCE_DEFAULT_SPECULAR (1<<4) +#define S4_LOCAL_DEPTH_OFFSET_ENABLE (1<<3) +#define S4_VFMT_FOG_PARAM (1<<2) +#define S4_SPRITE_POINT_ENABLE (1<<1) +#define S4_LINE_ANTIALIAS_ENABLE (1<<0) + +#define S4_VFMT_MASK (S4_VFMT_POINT_WIDTH | \ + S4_VFMT_SPEC_FOG | \ + S4_VFMT_COLOR | \ + S4_VFMT_DEPTH_OFFSET | \ + S4_VFMT_XYZW_MASK | \ + S4_VFMT_FOG_PARAM) + + +#define S5_WRITEDISABLE_ALPHA (1<<31) +#define S5_WRITEDISABLE_RED (1<<30) +#define S5_WRITEDISABLE_GREEN (1<<29) +#define S5_WRITEDISABLE_BLUE (1<<28) +#define S5_WRITEDISABLE_MASK (0xf<<28) +#define S5_FORCE_DEFAULT_POINT_SIZE (1<<27) +#define S5_LAST_PIXEL_ENABLE (1<<26) +#define S5_GLOBAL_DEPTH_OFFSET_ENABLE (1<<25) +#define S5_FOG_ENABLE (1<<24) +#define S5_STENCIL_REF_SHIFT 16 +#define S5_STENCIL_REF_MASK (0xff<<16) +#define S5_STENCIL_TEST_FUNC_SHIFT 13 +#define S5_STENCIL_TEST_FUNC_MASK (0x7<<13) +#define S5_STENCIL_FAIL_SHIFT 10 +#define S5_STENCIL_FAIL_MASK (0x7<<10) +#define S5_STENCIL_PASS_Z_FAIL_SHIFT 7 +#define S5_STENCIL_PASS_Z_FAIL_MASK (0x7<<7) +#define S5_STENCIL_PASS_Z_PASS_SHIFT 4 +#define S5_STENCIL_PASS_Z_PASS_MASK (0x7<<4) +#define S5_STENCIL_WRITE_ENABLE (1<<3) +#define S5_STENCIL_TEST_ENABLE (1<<2) +#define S5_COLOR_DITHER_ENABLE (1<<1) +#define S5_LOGICOP_ENABLE (1<<0) + + +#define S6_ALPHA_TEST_ENABLE (1<<31) +#define S6_ALPHA_TEST_FUNC_SHIFT 28 +#define S6_ALPHA_TEST_FUNC_MASK (0x7<<28) +#define S6_ALPHA_REF_SHIFT 20 +#define S6_ALPHA_REF_MASK (0xff<<20) +#define S6_DEPTH_TEST_ENABLE (1<<19) +#define S6_DEPTH_TEST_FUNC_SHIFT 16 +#define S6_DEPTH_TEST_FUNC_MASK (0x7<<16) +#define S6_CBUF_BLEND_ENABLE (1<<15) +#define S6_CBUF_BLEND_FUNC_SHIFT 12 +#define S6_CBUF_BLEND_FUNC_MASK (0x7<<12) +#define S6_CBUF_SRC_BLEND_FACT_SHIFT 8 +#define S6_CBUF_SRC_BLEND_FACT_MASK (0xf<<8) +#define S6_CBUF_DST_BLEND_FACT_SHIFT 4 +#define S6_CBUF_DST_BLEND_FACT_MASK (0xf<<4) +#define S6_DEPTH_WRITE_ENABLE (1<<3) +#define S6_COLOR_WRITE_ENABLE (1<<2) +#define S6_TRISTRIP_PV_SHIFT 0 +#define S6_TRISTRIP_PV_MASK (0x3<<0) + +#define S7_DEPTH_OFFSET_CONST_MASK ~0 + +/* 3DSTATE_MAP_DEINTERLACER_PARAMETERS */ + +/* 3DSTATE_MAP_PALETTE_LOAD_32, p206 */ +#define _3DSTATE_MAP_PALETTE_LOAD_32 (CMD_3D|(0x1d<<24)|(0x8f<<16)) +/* subsequent dwords up to length (max 16) are ARGB8888 color values */ + +/* _3DSTATE_MODES_4, p218 */ +#define _3DSTATE_MODES_4_CMD (CMD_3D|(0x0d<<24)) +#define ENABLE_LOGIC_OP_FUNC (1<<23) +#define LOGIC_OP_FUNC(x) ((x)<<18) +#define LOGICOP_MASK (0xf<<18) +#define MODE4_ENABLE_STENCIL_TEST_MASK ((1<<17)|(0xff00)) +#define ENABLE_STENCIL_TEST_MASK (1<<17) +#define STENCIL_TEST_MASK(x) (((x)&0xff)<<8) +#define MODE4_ENABLE_STENCIL_WRITE_MASK ((1<<16)|(0x00ff)) +#define ENABLE_STENCIL_WRITE_MASK (1<<16) +#define STENCIL_WRITE_MASK(x) ((x)&0xff) + +/* _3DSTATE_MODES_5, p220 */ +#define _3DSTATE_MODES_5_CMD (CMD_3D|(0x0c<<24)) +#define PIPELINE_FLUSH_RENDER_CACHE (1<<18) +#define PIPELINE_FLUSH_TEXTURE_CACHE (1<<16) + + +/* p221 */ +#define _3DSTATE_PIXEL_SHADER_CONSTANTS (CMD_3D|(0x1d<<24)|(0x6<<16)) +#define PS1_REG(n) (1<<(n)) +#define PS2_CONST_X(n) (n) +#define PS3_CONST_Y(n) (n) +#define PS4_CONST_Z(n) (n) +#define PS5_CONST_W(n) (n) + +/* p222 */ + + +#define I915_MAX_TEX_INDIRECT 4 +#define I915_MAX_TEX_INSN 32 +#define I915_MAX_ALU_INSN 64 +#define I915_MAX_DECL_INSN 27 +#define I915_MAX_TEMPORARY 16 + + +/* Each instruction is 3 dwords long, though most don't require all + * this space. Maximum of 123 instructions. Smaller maxes per insn + * type. + */ +#define _3DSTATE_PIXEL_SHADER_PROGRAM (CMD_3D|(0x1d<<24)|(0x5<<16)) + +#define REG_TYPE_R 0 /* temporary regs, no need to + * dcl, must be written before + * read -- Preserved between + * phases. + */ +#define REG_TYPE_T 1 /* Interpolated values, must be + * dcl'ed before use. + * + * 0..7: texture coord, + * 8: diffuse spec, + * 9: specular color, + * 10: fog parameter in w. + */ +#define REG_TYPE_CONST 2 /* Restriction: only one const + * can be referenced per + * instruction, though it may be + * selected for multiple inputs. + * Constants not initialized + * default to zero. + */ +#define REG_TYPE_S 3 /* sampler */ +#define REG_TYPE_OC 4 /* output color (rgba) */ +#define REG_TYPE_OD 5 /* output depth (w), xyz are + * temporaries. If not written, + * interpolated depth is used? + */ +#define REG_TYPE_U 6 /* unpreserved temporaries */ +#define REG_TYPE_MASK 0x7 +#define REG_NR_MASK 0xf + + +/* REG_TYPE_T: + */ +#define T_TEX0 0 +#define T_TEX1 1 +#define T_TEX2 2 +#define T_TEX3 3 +#define T_TEX4 4 +#define T_TEX5 5 +#define T_TEX6 6 +#define T_TEX7 7 +#define T_DIFFUSE 8 +#define T_SPECULAR 9 +#define T_FOG_W 10 /* interpolated fog is in W coord */ + +/* Arithmetic instructions */ + +/* .replicate_swizzle == selection and replication of a particular + * scalar channel, ie., .xxxx, .yyyy, .zzzz or .wwww + */ +#define A0_NOP (0x0<<24) /* no operation */ +#define A0_ADD (0x1<<24) /* dst = src0 + src1 */ +#define A0_MOV (0x2<<24) /* dst = src0 */ +#define A0_MUL (0x3<<24) /* dst = src0 * src1 */ +#define A0_MAD (0x4<<24) /* dst = src0 * src1 + src2 */ +#define A0_DP2ADD (0x5<<24) /* dst.xyzw = src0.xy dot src1.xy + src2.replicate_swizzle */ +#define A0_DP3 (0x6<<24) /* dst.xyzw = src0.xyz dot src1.xyz */ +#define A0_DP4 (0x7<<24) /* dst.xyzw = src0.xyzw dot src1.xyzw */ +#define A0_FRC (0x8<<24) /* dst = src0 - floor(src0) */ +#define A0_RCP (0x9<<24) /* dst.xyzw = 1/(src0.replicate_swizzle) */ +#define A0_RSQ (0xa<<24) /* dst.xyzw = 1/(sqrt(abs(src0.replicate_swizzle))) */ +#define A0_EXP (0xb<<24) /* dst.xyzw = exp2(src0.replicate_swizzle) */ +#define A0_LOG (0xc<<24) /* dst.xyzw = log2(abs(src0.replicate_swizzle)) */ +#define A0_CMP (0xd<<24) /* dst = (src0 >= 0.0) ? src1 : src2 */ +#define A0_MIN (0xe<<24) /* dst = (src0 < src1) ? src0 : src1 */ +#define A0_MAX (0xf<<24) /* dst = (src0 >= src1) ? src0 : src1 */ +#define A0_FLR (0x10<<24) /* dst = floor(src0) */ +#define A0_MOD (0x11<<24) /* dst = src0 fmod 1.0 */ +#define A0_TRC (0x12<<24) /* dst = int(src0) */ +#define A0_SGE (0x13<<24) /* dst = src0 >= src1 ? 1.0 : 0.0 */ +#define A0_SLT (0x14<<24) /* dst = src0 < src1 ? 1.0 : 0.0 */ +#define A0_DEST_SATURATE (1<<22) +#define A0_DEST_TYPE_SHIFT 19 +/* Allow: R, OC, OD, U */ +#define A0_DEST_NR_SHIFT 14 +/* Allow R: 0..15, OC,OD: 0..0, U: 0..2 */ +#define A0_DEST_CHANNEL_X (1<<10) +#define A0_DEST_CHANNEL_Y (2<<10) +#define A0_DEST_CHANNEL_Z (4<<10) +#define A0_DEST_CHANNEL_W (8<<10) +#define A0_DEST_CHANNEL_ALL (0xf<<10) +#define A0_DEST_CHANNEL_SHIFT 10 +#define A0_SRC0_TYPE_SHIFT 7 +#define A0_SRC0_NR_SHIFT 2 + +#define A0_DEST_CHANNEL_XY (A0_DEST_CHANNEL_X|A0_DEST_CHANNEL_Y) +#define A0_DEST_CHANNEL_XYZ (A0_DEST_CHANNEL_XY|A0_DEST_CHANNEL_Z) + + +#define SRC_X 0 +#define SRC_Y 1 +#define SRC_Z 2 +#define SRC_W 3 +#define SRC_ZERO 4 +#define SRC_ONE 5 + +#define A1_SRC0_CHANNEL_X_NEGATE (1<<31) +#define A1_SRC0_CHANNEL_X_SHIFT 28 +#define A1_SRC0_CHANNEL_Y_NEGATE (1<<27) +#define A1_SRC0_CHANNEL_Y_SHIFT 24 +#define A1_SRC0_CHANNEL_Z_NEGATE (1<<23) +#define A1_SRC0_CHANNEL_Z_SHIFT 20 +#define A1_SRC0_CHANNEL_W_NEGATE (1<<19) +#define A1_SRC0_CHANNEL_W_SHIFT 16 +#define A1_SRC1_TYPE_SHIFT 13 +#define A1_SRC1_NR_SHIFT 8 +#define A1_SRC1_CHANNEL_X_NEGATE (1<<7) +#define A1_SRC1_CHANNEL_X_SHIFT 4 +#define A1_SRC1_CHANNEL_Y_NEGATE (1<<3) +#define A1_SRC1_CHANNEL_Y_SHIFT 0 + +#define A2_SRC1_CHANNEL_Z_NEGATE (1<<31) +#define A2_SRC1_CHANNEL_Z_SHIFT 28 +#define A2_SRC1_CHANNEL_W_NEGATE (1<<27) +#define A2_SRC1_CHANNEL_W_SHIFT 24 +#define A2_SRC2_TYPE_SHIFT 21 +#define A2_SRC2_NR_SHIFT 16 +#define A2_SRC2_CHANNEL_X_NEGATE (1<<15) +#define A2_SRC2_CHANNEL_X_SHIFT 12 +#define A2_SRC2_CHANNEL_Y_NEGATE (1<<11) +#define A2_SRC2_CHANNEL_Y_SHIFT 8 +#define A2_SRC2_CHANNEL_Z_NEGATE (1<<7) +#define A2_SRC2_CHANNEL_Z_SHIFT 4 +#define A2_SRC2_CHANNEL_W_NEGATE (1<<3) +#define A2_SRC2_CHANNEL_W_SHIFT 0 + + + +/* Texture instructions */ +#define T0_TEXLD (0x15<<24) /* Sample texture using predeclared + * sampler and address, and output + * filtered texel data to destination + * register */ +#define T0_TEXLDP (0x16<<24) /* Same as texld but performs a + * perspective divide of the texture + * coordinate .xyz values by .w before + * sampling. */ +#define T0_TEXLDB (0x17<<24) /* Same as texld but biases the + * computed LOD by w. Only S4.6 two's + * comp is used. This implies that a + * float to fixed conversion is + * done. */ +#define T0_TEXKILL (0x18<<24) /* Does not perform a sampling + * operation. Simply kills the pixel + * if any channel of the address + * register is < 0.0. */ +#define T0_DEST_TYPE_SHIFT 19 +/* Allow: R, OC, OD, U */ +/* Note: U (unpreserved) regs do not retain their values between + * phases (cannot be used for feedback) + * + * Note: oC and OD registers can only be used as the destination of a + * texture instruction once per phase (this is an implementation + * restriction). + */ +#define T0_DEST_NR_SHIFT 14 +/* Allow R: 0..15, OC,OD: 0..0, U: 0..2 */ +#define T0_SAMPLER_NR_SHIFT 0 /* This field ignored for TEXKILL */ +#define T0_SAMPLER_NR_MASK (0xf<<0) + +#define T1_ADDRESS_REG_TYPE_SHIFT 24 /* Reg to use as texture coord */ +/* Allow R, T, OC, OD -- R, OC, OD are 'dependent' reads, new program phase */ +#define T1_ADDRESS_REG_NR_SHIFT 17 +#define T2_MBZ 0 + +/* Declaration instructions */ +#define D0_DCL (0x19<<24) /* Declare a t (interpolated attrib) + * register or an s (sampler) + * register. */ +#define D0_SAMPLE_TYPE_SHIFT 22 +#define D0_SAMPLE_TYPE_2D (0x0<<22) +#define D0_SAMPLE_TYPE_CUBE (0x1<<22) +#define D0_SAMPLE_TYPE_VOLUME (0x2<<22) +#define D0_SAMPLE_TYPE_MASK (0x3<<22) + +#define D0_TYPE_SHIFT 19 +/* Allow: T, S */ +#define D0_NR_SHIFT 14 +/* Allow T: 0..10, S: 0..15 */ +#define D0_CHANNEL_X (1<<10) +#define D0_CHANNEL_Y (2<<10) +#define D0_CHANNEL_Z (4<<10) +#define D0_CHANNEL_W (8<<10) +#define D0_CHANNEL_ALL (0xf<<10) +#define D0_CHANNEL_NONE (0<<10) + +#define D0_CHANNEL_XY (D0_CHANNEL_X|D0_CHANNEL_Y) +#define D0_CHANNEL_XYZ (D0_CHANNEL_XY|D0_CHANNEL_Z) + +/* I915 Errata: Do not allow (xz), (xw), (xzw) combinations for diffuse + * or specular declarations. + * + * For T dcls, only allow: (x), (xy), (xyz), (w), (xyzw) + * + * Must be zero for S (sampler) dcls + */ +#define D1_MBZ 0 +#define D2_MBZ 0 + + + +/* p207 */ +#define _3DSTATE_MAP_STATE (CMD_3D|(0x1d<<24)|(0x0<<16)) + +#define MS1_MAPMASK_SHIFT 0 +#define MS1_MAPMASK_MASK (0x8fff<<0) + +#define MS2_UNTRUSTED_SURFACE (1<<31) +#define MS2_ADDRESS_MASK 0xfffffffc +#define MS2_VERTICAL_LINE_STRIDE (1<<1) +#define MS2_VERTICAL_OFFSET (1<<1) + +#define MS3_HEIGHT_SHIFT 21 +#define MS3_WIDTH_SHIFT 10 +#define MS3_PALETTE_SELECT (1<<9) +#define MS3_MAPSURF_FORMAT_SHIFT 7 +#define MS3_MAPSURF_FORMAT_MASK (0x7<<7) +#define MAPSURF_8BIT (1<<7) +#define MAPSURF_16BIT (2<<7) +#define MAPSURF_32BIT (3<<7) +#define MAPSURF_422 (5<<7) +#define MAPSURF_COMPRESSED (6<<7) +#define MAPSURF_4BIT_INDEXED (7<<7) +#define MS3_MT_FORMAT_MASK (0x7 << 3) +#define MS3_MT_FORMAT_SHIFT 3 +#define MT_4BIT_IDX_ARGB8888 (7<<3) /* SURFACE_4BIT_INDEXED */ +#define MT_8BIT_I8 (0<<3) /* SURFACE_8BIT */ +#define MT_8BIT_L8 (1<<3) +#define MT_8BIT_A8 (4<<3) +#define MT_8BIT_MONO8 (5<<3) +#define MT_16BIT_RGB565 (0<<3) /* SURFACE_16BIT */ +#define MT_16BIT_ARGB1555 (1<<3) +#define MT_16BIT_ARGB4444 (2<<3) +#define MT_16BIT_AY88 (3<<3) +#define MT_16BIT_88DVDU (5<<3) +#define MT_16BIT_BUMP_655LDVDU (6<<3) +#define MT_16BIT_I16 (7<<3) +#define MT_16BIT_L16 (8<<3) +#define MT_16BIT_A16 (9<<3) +#define MT_32BIT_ARGB8888 (0<<3) /* SURFACE_32BIT */ +#define MT_32BIT_ABGR8888 (1<<3) +#define MT_32BIT_XRGB8888 (2<<3) +#define MT_32BIT_XBGR8888 (3<<3) +#define MT_32BIT_QWVU8888 (4<<3) +#define MT_32BIT_AXVU8888 (5<<3) +#define MT_32BIT_LXVU8888 (6<<3) +#define MT_32BIT_XLVU8888 (7<<3) +#define MT_32BIT_ARGB2101010 (8<<3) +#define MT_32BIT_ABGR2101010 (9<<3) +#define MT_32BIT_AWVU2101010 (0xA<<3) +#define MT_32BIT_GR1616 (0xB<<3) +#define MT_32BIT_VU1616 (0xC<<3) +#define MT_32BIT_xI824 (0xD<<3) +#define MT_32BIT_xA824 (0xE<<3) +#define MT_32BIT_xL824 (0xF<<3) +#define MT_422_YCRCB_SWAPY (0<<3) /* SURFACE_422 */ +#define MT_422_YCRCB_NORMAL (1<<3) +#define MT_422_YCRCB_SWAPUV (2<<3) +#define MT_422_YCRCB_SWAPUVY (3<<3) +#define MT_COMPRESS_DXT1 (0<<3) /* SURFACE_COMPRESSED */ +#define MT_COMPRESS_DXT2_3 (1<<3) +#define MT_COMPRESS_DXT4_5 (2<<3) +#define MT_COMPRESS_FXT1 (3<<3) +#define MT_COMPRESS_DXT1_RGB (4<<3) +#define MS3_USE_FENCE_REGS (1<<2) +#define MS3_TILED_SURFACE (1<<1) +#define MS3_TILE_WALK (1<<0) + +#define MS4_PITCH_SHIFT 21 +#define MS4_CUBE_FACE_ENA_NEGX (1<<20) +#define MS4_CUBE_FACE_ENA_POSX (1<<19) +#define MS4_CUBE_FACE_ENA_NEGY (1<<18) +#define MS4_CUBE_FACE_ENA_POSY (1<<17) +#define MS4_CUBE_FACE_ENA_NEGZ (1<<16) +#define MS4_CUBE_FACE_ENA_POSZ (1<<15) +#define MS4_CUBE_FACE_ENA_MASK (0x3f<<15) +#define MS4_MAX_LOD_SHIFT 9 +#define MS4_MAX_LOD_MASK (0x3f<<9) +#define MS4_MIP_LAYOUT_LEGACY (0<<8) +#define MS4_MIP_LAYOUT_BELOW_LPT (0<<8) +#define MS4_MIP_LAYOUT_RIGHT_LPT (1<<8) +#define MS4_VOLUME_DEPTH_SHIFT 0 +#define MS4_VOLUME_DEPTH_MASK (0xff<<0) + +/* p244 */ +#define _3DSTATE_SAMPLER_STATE (CMD_3D|(0x1d<<24)|(0x1<<16)) + +#define SS1_MAPMASK_SHIFT 0 +#define SS1_MAPMASK_MASK (0x8fff<<0) + +#define SS2_REVERSE_GAMMA_ENABLE (1<<31) +#define SS2_PACKED_TO_PLANAR_ENABLE (1<<30) +#define SS2_COLORSPACE_CONVERSION (1<<29) +#define SS2_CHROMAKEY_SHIFT 27 +#define SS2_BASE_MIP_LEVEL_SHIFT 22 +#define SS2_BASE_MIP_LEVEL_MASK (0x1f<<22) +#define SS2_MIP_FILTER_SHIFT 20 +#define SS2_MIP_FILTER_MASK (0x3<<20) +#define MIPFILTER_NONE 0 +#define MIPFILTER_NEAREST 1 +#define MIPFILTER_LINEAR 3 +#define SS2_MAG_FILTER_SHIFT 17 +#define SS2_MAG_FILTER_MASK (0x7<<17) +#define FILTER_NEAREST 0 +#define FILTER_LINEAR 1 +#define FILTER_ANISOTROPIC 2 +#define FILTER_4X4_1 3 +#define FILTER_4X4_2 4 +#define FILTER_4X4_FLAT 5 +#define FILTER_6X5_MONO 6 /* XXX - check */ +#define SS2_MIN_FILTER_SHIFT 14 +#define SS2_MIN_FILTER_MASK (0x7<<14) +#define SS2_LOD_BIAS_SHIFT 5 +#define SS2_LOD_BIAS_ONE (0x10<<5) +#define SS2_LOD_BIAS_MASK (0x1ff<<5) +/* Shadow requires: + * MT_X8{I,L,A}24 or MT_{I,L,A}16 texture format + * FILTER_4X4_x MIN and MAG filters + */ +#define SS2_SHADOW_ENABLE (1<<4) +#define SS2_MAX_ANISO_MASK (1<<3) +#define SS2_MAX_ANISO_2 (0<<3) +#define SS2_MAX_ANISO_4 (1<<3) +#define SS2_SHADOW_FUNC_SHIFT 0 +#define SS2_SHADOW_FUNC_MASK (0x7<<0) +/* SS2_SHADOW_FUNC values: see COMPAREFUNC_* */ + +#define SS3_MIN_LOD_SHIFT 24 +#define SS3_MIN_LOD_ONE (0x10<<24) +#define SS3_MIN_LOD_MASK (0xff<<24) +#define SS3_KILL_PIXEL_ENABLE (1<<17) +#define SS3_TCX_ADDR_MODE_SHIFT 12 +#define SS3_TCX_ADDR_MODE_MASK (0x7<<12) +#define TEXCOORDMODE_WRAP 0 +#define TEXCOORDMODE_MIRROR 1 +#define TEXCOORDMODE_CLAMP_EDGE 2 +#define TEXCOORDMODE_CUBE 3 +#define TEXCOORDMODE_CLAMP_BORDER 4 +#define TEXCOORDMODE_MIRROR_ONCE 5 +#define SS3_TCY_ADDR_MODE_SHIFT 9 +#define SS3_TCY_ADDR_MODE_MASK (0x7<<9) +#define SS3_TCZ_ADDR_MODE_SHIFT 6 +#define SS3_TCZ_ADDR_MODE_MASK (0x7<<6) +#define SS3_NORMALIZED_COORDS (1<<5) +#define SS3_TEXTUREMAP_INDEX_SHIFT 1 +#define SS3_TEXTUREMAP_INDEX_MASK (0xf<<1) +#define SS3_DEINTERLACER_ENABLE (1<<0) + +#define SS4_BORDER_COLOR_MASK (~0) + +/* 3DSTATE_SPAN_STIPPLE, p258 + */ +#define _3DSTATE_STIPPLE ((0x3<<29)|(0x1d<<24)|(0x83<<16)) +#define ST1_ENABLE (1<<16) +#define ST1_MASK (0xffff) + +#define _3DSTATE_DEFAULT_Z ((0x3<<29)|(0x1d<<24)|(0x98<<16)) +#define _3DSTATE_DEFAULT_DIFFUSE ((0x3<<29)|(0x1d<<24)|(0x99<<16)) +#define _3DSTATE_DEFAULT_SPECULAR ((0x3<<29)|(0x1d<<24)|(0x9a<<16)) + + +#define MI_FLUSH ((0<<29)|(4<<23)) +#define FLUSH_MAP_CACHE (1<<0) +#define INHIBIT_FLUSH_RENDER_CACHE (1<<2) + + +#endif diff --git a/src/mesa/drivers/dri/i915tex/i915_state.c b/src/mesa/drivers/dri/i915tex/i915_state.c new file mode 100644 index 00000000000..2f5a30787ee --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/i915_state.c @@ -0,0 +1,1019 @@ +/************************************************************************** + * + * Copyright 2003 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. + * + **************************************************************************/ + + +#include "glheader.h" +#include "context.h" +#include "macros.h" +#include "enums.h" +#include "dd.h" +#include "tnl/tnl.h" +#include "tnl/t_context.h" + +#include "texmem.h" + +#include "intel_fbo.h" +#include "intel_screen.h" +#include "intel_batchbuffer.h" + +#include "i915_context.h" +#include "i915_reg.h" + +#define FILE_DEBUG_FLAG DEBUG_STATE + +static void +i915StencilFuncSeparate(GLcontext * ctx, GLenum face, GLenum func, GLint ref, + GLuint mask) +{ + struct i915_context *i915 = I915_CONTEXT(ctx); + int test = intel_translate_compare_func(func); + + mask = mask & 0xff; + + DBG("%s : func: %s, ref : 0x%x, mask: 0x%x\n", __FUNCTION__, + _mesa_lookup_enum_by_nr(func), ref, mask); + + + I915_STATECHANGE(i915, I915_UPLOAD_CTX); + i915->state.Ctx[I915_CTXREG_STATE4] &= ~MODE4_ENABLE_STENCIL_TEST_MASK; + i915->state.Ctx[I915_CTXREG_STATE4] |= (ENABLE_STENCIL_TEST_MASK | + STENCIL_TEST_MASK(mask)); + + i915->state.Ctx[I915_CTXREG_LIS5] &= ~(S5_STENCIL_REF_MASK | + S5_STENCIL_TEST_FUNC_MASK); + + i915->state.Ctx[I915_CTXREG_LIS5] |= ((ref << S5_STENCIL_REF_SHIFT) | + (test << + S5_STENCIL_TEST_FUNC_SHIFT)); +} + +static void +i915StencilMaskSeparate(GLcontext * ctx, GLenum face, GLuint mask) +{ + struct i915_context *i915 = I915_CONTEXT(ctx); + + DBG("%s : mask 0x%x\n", __FUNCTION__, mask); + + mask = mask & 0xff; + + I915_STATECHANGE(i915, I915_UPLOAD_CTX); + i915->state.Ctx[I915_CTXREG_STATE4] &= ~MODE4_ENABLE_STENCIL_WRITE_MASK; + i915->state.Ctx[I915_CTXREG_STATE4] |= (ENABLE_STENCIL_WRITE_MASK | + STENCIL_WRITE_MASK(mask)); +} + + +static void +i915StencilOpSeparate(GLcontext * ctx, GLenum face, GLenum fail, GLenum zfail, + GLenum zpass) +{ + struct i915_context *i915 = I915_CONTEXT(ctx); + int fop = intel_translate_stencil_op(fail); + int dfop = intel_translate_stencil_op(zfail); + int dpop = intel_translate_stencil_op(zpass); + + + DBG("%s: fail : %s, zfail: %s, zpass : %s\n", __FUNCTION__, + _mesa_lookup_enum_by_nr(fail), + _mesa_lookup_enum_by_nr(zfail), _mesa_lookup_enum_by_nr(zpass)); + + I915_STATECHANGE(i915, I915_UPLOAD_CTX); + + i915->state.Ctx[I915_CTXREG_LIS5] &= ~(S5_STENCIL_FAIL_MASK | + S5_STENCIL_PASS_Z_FAIL_MASK | + S5_STENCIL_PASS_Z_PASS_MASK); + + i915->state.Ctx[I915_CTXREG_LIS5] |= ((fop << S5_STENCIL_FAIL_SHIFT) | + (dfop << + S5_STENCIL_PASS_Z_FAIL_SHIFT) | + (dpop << + S5_STENCIL_PASS_Z_PASS_SHIFT)); +} + +static void +i915AlphaFunc(GLcontext * ctx, GLenum func, GLfloat ref) +{ + struct i915_context *i915 = I915_CONTEXT(ctx); + int test = intel_translate_compare_func(func); + GLubyte refByte; + + UNCLAMPED_FLOAT_TO_UBYTE(refByte, ref); + + I915_STATECHANGE(i915, I915_UPLOAD_CTX); + i915->state.Ctx[I915_CTXREG_LIS6] &= ~(S6_ALPHA_TEST_FUNC_MASK | + S6_ALPHA_REF_MASK); + i915->state.Ctx[I915_CTXREG_LIS6] |= ((test << S6_ALPHA_TEST_FUNC_SHIFT) | + (((GLuint) refByte) << + S6_ALPHA_REF_SHIFT)); +} + +/* This function makes sure that the proper enables are + * set for LogicOp, Independant Alpha Blend, and Blending. + * It needs to be called from numerous places where we + * could change the LogicOp or Independant Alpha Blend without subsequent + * calls to glEnable. + */ +static void +i915EvalLogicOpBlendState(GLcontext * ctx) +{ + struct i915_context *i915 = I915_CONTEXT(ctx); + + I915_STATECHANGE(i915, I915_UPLOAD_CTX); + + if (RGBA_LOGICOP_ENABLED(ctx)) { + i915->state.Ctx[I915_CTXREG_LIS5] |= S5_LOGICOP_ENABLE; + i915->state.Ctx[I915_CTXREG_LIS6] &= ~S6_CBUF_BLEND_ENABLE; + } + else { + i915->state.Ctx[I915_CTXREG_LIS5] &= ~S5_LOGICOP_ENABLE; + + if (ctx->Color.BlendEnabled) { + i915->state.Ctx[I915_CTXREG_LIS6] |= S6_CBUF_BLEND_ENABLE; + } + else { + i915->state.Ctx[I915_CTXREG_LIS6] &= ~S6_CBUF_BLEND_ENABLE; + } + } +} + +static void +i915BlendColor(GLcontext * ctx, const GLfloat color[4]) +{ + struct i915_context *i915 = I915_CONTEXT(ctx); + GLubyte r, g, b, a; + + DBG("%s\n", __FUNCTION__); + + UNCLAMPED_FLOAT_TO_UBYTE(r, color[RCOMP]); + UNCLAMPED_FLOAT_TO_UBYTE(g, color[GCOMP]); + UNCLAMPED_FLOAT_TO_UBYTE(b, color[BCOMP]); + UNCLAMPED_FLOAT_TO_UBYTE(a, color[ACOMP]); + + I915_STATECHANGE(i915, I915_UPLOAD_CTX); + i915->state.Ctx[I915_CTXREG_BLENDCOLOR1] = + (a << 24) | (r << 16) | (g << 8) | b; +} + + +#define DST_BLND_FACT(f) ((f)<state.Ctx[I915_CTXREG_IAB] & + ~(IAB_SRC_FACTOR_MASK | + IAB_DST_FACTOR_MASK | + (BLENDFUNC_MASK << IAB_FUNC_SHIFT) | IAB_ENABLE)); + + GLuint lis6 = (i915->state.Ctx[I915_CTXREG_LIS6] & + ~(S6_CBUF_SRC_BLEND_FACT_MASK | + S6_CBUF_DST_BLEND_FACT_MASK | S6_CBUF_BLEND_FUNC_MASK)); + + GLuint eqRGB = ctx->Color.BlendEquationRGB; + GLuint eqA = ctx->Color.BlendEquationA; + GLuint srcRGB = ctx->Color.BlendSrcRGB; + GLuint dstRGB = ctx->Color.BlendDstRGB; + GLuint srcA = ctx->Color.BlendSrcA; + GLuint dstA = ctx->Color.BlendDstA; + + if (eqRGB == GL_MIN || eqRGB == GL_MAX) { + srcRGB = dstRGB = GL_ONE; + } + + if (eqA == GL_MIN || eqA == GL_MAX) { + srcA = dstA = GL_ONE; + } + + lis6 |= SRC_BLND_FACT(intel_translate_blend_factor(srcRGB)); + lis6 |= DST_BLND_FACT(intel_translate_blend_factor(dstRGB)); + lis6 |= translate_blend_equation(eqRGB) << S6_CBUF_BLEND_FUNC_SHIFT; + + iab |= SRC_ABLND_FACT(intel_translate_blend_factor(srcA)); + iab |= DST_ABLND_FACT(intel_translate_blend_factor(dstA)); + iab |= translate_blend_equation(eqA) << IAB_FUNC_SHIFT; + + if (srcA != srcRGB || dstA != dstRGB || eqA != eqRGB) + iab |= IAB_ENABLE; + + if (iab != i915->state.Ctx[I915_CTXREG_IAB] || + lis6 != i915->state.Ctx[I915_CTXREG_LIS6]) { + I915_STATECHANGE(i915, I915_UPLOAD_CTX); + i915->state.Ctx[I915_CTXREG_IAB] = iab; + i915->state.Ctx[I915_CTXREG_LIS6] = lis6; + } + + /* This will catch a logicop blend equation */ + i915EvalLogicOpBlendState(ctx); +} + + +static void +i915BlendFuncSeparate(GLcontext * ctx, GLenum srcRGB, + GLenum dstRGB, GLenum srcA, GLenum dstA) +{ + i915UpdateBlendState(ctx); +} + + +static void +i915BlendEquationSeparate(GLcontext * ctx, GLenum eqRGB, GLenum eqA) +{ + i915UpdateBlendState(ctx); +} + + +static void +i915DepthFunc(GLcontext * ctx, GLenum func) +{ + struct i915_context *i915 = I915_CONTEXT(ctx); + int test = intel_translate_compare_func(func); + + DBG("%s\n", __FUNCTION__); + + I915_STATECHANGE(i915, I915_UPLOAD_CTX); + i915->state.Ctx[I915_CTXREG_LIS6] &= ~S6_DEPTH_TEST_FUNC_MASK; + i915->state.Ctx[I915_CTXREG_LIS6] |= test << S6_DEPTH_TEST_FUNC_SHIFT; +} + +static void +i915DepthMask(GLcontext * ctx, GLboolean flag) +{ + struct i915_context *i915 = I915_CONTEXT(ctx); + + DBG("%s flag (%d)\n", __FUNCTION__, flag); + + I915_STATECHANGE(i915, I915_UPLOAD_CTX); + + if (flag && ctx->Depth.Test) + i915->state.Ctx[I915_CTXREG_LIS6] |= S6_DEPTH_WRITE_ENABLE; + else + i915->state.Ctx[I915_CTXREG_LIS6] &= ~S6_DEPTH_WRITE_ENABLE; +} + +/* ============================================================= + * Polygon stipple + * + * The i915 supports a 4x4 stipple natively, GL wants 32x32. + * Fortunately stipple is usually a repeating pattern. + */ +static void +i915PolygonStipple(GLcontext * ctx, const GLubyte * mask) +{ + struct i915_context *i915 = I915_CONTEXT(ctx); + const GLubyte *m = mask; + GLubyte p[4]; + int i, j, k; + int active = (ctx->Polygon.StippleFlag && + i915->intel.reduced_primitive == GL_TRIANGLES); + GLuint newMask; + + if (active) { + I915_STATECHANGE(i915, I915_UPLOAD_STIPPLE); + i915->state.Stipple[I915_STPREG_ST1] &= ~ST1_ENABLE; + } + + p[0] = mask[12] & 0xf; + p[0] |= p[0] << 4; + p[1] = mask[8] & 0xf; + p[1] |= p[1] << 4; + p[2] = mask[4] & 0xf; + p[2] |= p[2] << 4; + p[3] = mask[0] & 0xf; + p[3] |= p[3] << 4; + + for (k = 0; k < 8; k++) + for (j = 3; j >= 0; j--) + for (i = 0; i < 4; i++, m++) + if (*m != p[j]) { + i915->intel.hw_stipple = 0; + return; + } + + newMask = (((p[0] & 0xf) << 0) | + ((p[1] & 0xf) << 4) | + ((p[2] & 0xf) << 8) | ((p[3] & 0xf) << 12)); + + + if (newMask == 0xffff || newMask == 0x0) { + /* this is needed to make conform pass */ + i915->intel.hw_stipple = 0; + return; + } + + i915->state.Stipple[I915_STPREG_ST1] &= ~0xffff; + i915->state.Stipple[I915_STPREG_ST1] |= newMask; + i915->intel.hw_stipple = 1; + + if (active) + i915->state.Stipple[I915_STPREG_ST1] |= ST1_ENABLE; +} + + +/* ============================================================= + * Hardware clipping + */ +static void +i915Scissor(GLcontext * ctx, GLint x, GLint y, GLsizei w, GLsizei h) +{ + struct i915_context *i915 = I915_CONTEXT(ctx); + int x1, y1, x2, y2; + + if (!ctx->DrawBuffer) + return; + + DBG("%s %d,%d %dx%d\n", __FUNCTION__, x, y, w, h); + + if (ctx->DrawBuffer->Name == 0) { + x1 = x; + y1 = ctx->DrawBuffer->Height - (y + h); + x2 = x + w - 1; + y2 = y1 + h - 1; + DBG("%s %d..%d,%d..%d (inverted)\n", __FUNCTION__, x1, x2, y1, y2); + } + else { + /* FBO - not inverted + */ + x1 = x; + y1 = y; + x2 = x + w - 1; + y2 = y + h - 1; + DBG("%s %d..%d,%d..%d (not inverted)\n", __FUNCTION__, x1, x2, y1, y2); + } + + x1 = CLAMP(x1, 0, ctx->DrawBuffer->Width - 1); + y1 = CLAMP(y1, 0, ctx->DrawBuffer->Height - 1); + x2 = CLAMP(x2, 0, ctx->DrawBuffer->Width - 1); + y2 = CLAMP(y2, 0, ctx->DrawBuffer->Height - 1); + + DBG("%s %d..%d,%d..%d (clamped)\n", __FUNCTION__, x1, x2, y1, y2); + + I915_STATECHANGE(i915, I915_UPLOAD_BUFFERS); + i915->state.Buffer[I915_DESTREG_SR1] = (y1 << 16) | (x1 & 0xffff); + i915->state.Buffer[I915_DESTREG_SR2] = (y2 << 16) | (x2 & 0xffff); +} + +static void +i915LogicOp(GLcontext * ctx, GLenum opcode) +{ + struct i915_context *i915 = I915_CONTEXT(ctx); + int tmp = intel_translate_logic_op(opcode); + + DBG("%s\n", __FUNCTION__); + + I915_STATECHANGE(i915, I915_UPLOAD_CTX); + i915->state.Ctx[I915_CTXREG_STATE4] &= ~LOGICOP_MASK; + i915->state.Ctx[I915_CTXREG_STATE4] |= LOGIC_OP_FUNC(tmp); +} + + + +static void +i915CullFaceFrontFace(GLcontext * ctx, GLenum unused) +{ + struct i915_context *i915 = I915_CONTEXT(ctx); + GLuint mode; + + DBG("%s %d\n", __FUNCTION__, + ctx->DrawBuffer ? ctx->DrawBuffer->Name : 0); + + if (!ctx->Polygon.CullFlag) { + mode = S4_CULLMODE_NONE; + } + else if (ctx->Polygon.CullFaceMode != GL_FRONT_AND_BACK) { + mode = S4_CULLMODE_CW; + + if (ctx->DrawBuffer && ctx->DrawBuffer->Name != 0) + mode ^= (S4_CULLMODE_CW ^ S4_CULLMODE_CCW); + if (ctx->Polygon.CullFaceMode == GL_FRONT) + mode ^= (S4_CULLMODE_CW ^ S4_CULLMODE_CCW); + if (ctx->Polygon.FrontFace != GL_CCW) + mode ^= (S4_CULLMODE_CW ^ S4_CULLMODE_CCW); + } + else { + mode = S4_CULLMODE_BOTH; + } + + I915_STATECHANGE(i915, I915_UPLOAD_CTX); + i915->state.Ctx[I915_CTXREG_LIS4] &= ~S4_CULLMODE_MASK; + i915->state.Ctx[I915_CTXREG_LIS4] |= mode; +} + +static void +i915LineWidth(GLcontext * ctx, GLfloat widthf) +{ + struct i915_context *i915 = I915_CONTEXT(ctx); + int lis4 = i915->state.Ctx[I915_CTXREG_LIS4] & ~S4_LINE_WIDTH_MASK; + int width; + + DBG("%s\n", __FUNCTION__); + + width = (int) (widthf * 2); + CLAMP_SELF(width, 1, 0xf); + lis4 |= width << S4_LINE_WIDTH_SHIFT; + + if (lis4 != i915->state.Ctx[I915_CTXREG_LIS4]) { + I915_STATECHANGE(i915, I915_UPLOAD_CTX); + i915->state.Ctx[I915_CTXREG_LIS4] = lis4; + } +} + +static void +i915PointSize(GLcontext * ctx, GLfloat size) +{ + struct i915_context *i915 = I915_CONTEXT(ctx); + int lis4 = i915->state.Ctx[I915_CTXREG_LIS4] & ~S4_POINT_WIDTH_MASK; + GLint point_size = (int) size; + + DBG("%s\n", __FUNCTION__); + + CLAMP_SELF(point_size, 1, 255); + lis4 |= point_size << S4_POINT_WIDTH_SHIFT; + + if (lis4 != i915->state.Ctx[I915_CTXREG_LIS4]) { + I915_STATECHANGE(i915, I915_UPLOAD_CTX); + i915->state.Ctx[I915_CTXREG_LIS4] = lis4; + } +} + + +/* ============================================================= + * Color masks + */ + +static void +i915ColorMask(GLcontext * ctx, + GLboolean r, GLboolean g, GLboolean b, GLboolean a) +{ + struct i915_context *i915 = I915_CONTEXT(ctx); + GLuint tmp = i915->state.Ctx[I915_CTXREG_LIS5] & ~S5_WRITEDISABLE_MASK; + + DBG("%s r(%d) g(%d) b(%d) a(%d)\n", __FUNCTION__, r, g, b, + a); + + if (!r) + tmp |= S5_WRITEDISABLE_RED; + if (!g) + tmp |= S5_WRITEDISABLE_GREEN; + if (!b) + tmp |= S5_WRITEDISABLE_BLUE; + if (!a) + tmp |= S5_WRITEDISABLE_ALPHA; + + if (tmp != i915->state.Ctx[I915_CTXREG_LIS5]) { + I915_STATECHANGE(i915, I915_UPLOAD_CTX); + i915->state.Ctx[I915_CTXREG_LIS5] = tmp; + } +} + +static void +update_specular(GLcontext * ctx) +{ + /* A hack to trigger the rebuild of the fragment program. + */ + intel_context(ctx)->NewGLState |= _NEW_TEXTURE; + I915_CONTEXT(ctx)->tex_program.translated = 0; +} + +static void +i915LightModelfv(GLcontext * ctx, GLenum pname, const GLfloat * param) +{ + DBG("%s\n", __FUNCTION__); + + if (pname == GL_LIGHT_MODEL_COLOR_CONTROL) { + update_specular(ctx); + } +} + +static void +i915ShadeModel(GLcontext * ctx, GLenum mode) +{ + struct i915_context *i915 = I915_CONTEXT(ctx); + I915_STATECHANGE(i915, I915_UPLOAD_CTX); + + if (mode == GL_SMOOTH) { + i915->state.Ctx[I915_CTXREG_LIS4] &= ~(S4_FLATSHADE_ALPHA | + S4_FLATSHADE_COLOR | + S4_FLATSHADE_SPECULAR); + } + else { + i915->state.Ctx[I915_CTXREG_LIS4] |= (S4_FLATSHADE_ALPHA | + S4_FLATSHADE_COLOR | + S4_FLATSHADE_SPECULAR); + } +} + +/* ============================================================= + * Fog + */ +void +i915_update_fog(GLcontext * ctx) +{ + struct i915_context *i915 = I915_CONTEXT(ctx); + GLenum mode; + GLboolean enabled; + GLboolean try_pixel_fog; + + if (ctx->FragmentProgram._Active) { + /* Pull in static fog state from program */ + + mode = ctx->FragmentProgram._Current->FogOption; + enabled = (mode != GL_NONE); + try_pixel_fog = 0; + } + else { + enabled = ctx->Fog.Enabled; + mode = ctx->Fog.Mode; + + try_pixel_fog = (ctx->Fog.FogCoordinateSource == GL_FRAGMENT_DEPTH_EXT && ctx->Hint.Fog == GL_NICEST && 0); /* XXX - DISABLE -- Need ortho fallback */ + } + + if (!enabled) { + i915->vertex_fog = I915_FOG_NONE; + } + else if (try_pixel_fog) { + + I915_STATECHANGE(i915, I915_UPLOAD_FOG); + i915->state.Fog[I915_FOGREG_MODE1] &= ~FMC1_FOGFUNC_MASK; + i915->vertex_fog = I915_FOG_PIXEL; + + switch (mode) { + case GL_LINEAR: + if (ctx->Fog.End <= ctx->Fog.Start) { + /* XXX - this won't work with fragment programs. Need to + * either fallback or append fog instructions to end of + * program in the case of linear fog. + */ + i915->state.Fog[I915_FOGREG_MODE1] |= FMC1_FOGFUNC_VERTEX; + i915->vertex_fog = I915_FOG_VERTEX; + } + else { + GLfloat c1 = ctx->Fog.End / (ctx->Fog.End - ctx->Fog.Start); + GLfloat c2 = 1.0 / (ctx->Fog.End - ctx->Fog.Start); + + i915->state.Fog[I915_FOGREG_MODE1] &= ~FMC1_C1_MASK; + i915->state.Fog[I915_FOGREG_MODE1] |= FMC1_FOGFUNC_PIXEL_LINEAR; + i915->state.Fog[I915_FOGREG_MODE1] |= + ((GLuint) (c1 * FMC1_C1_ONE)) & FMC1_C1_MASK; + + if (i915->state.Fog[I915_FOGREG_MODE1] & FMC1_FOGINDEX_Z) { + i915->state.Fog[I915_FOGREG_MODE2] = + (GLuint) (c2 * FMC2_C2_ONE); + } + else { + union + { + float f; + int i; + } fi; + fi.f = c2; + i915->state.Fog[I915_FOGREG_MODE2] = fi.i; + } + } + break; + case GL_EXP: + i915->state.Fog[I915_FOGREG_MODE1] |= FMC1_FOGFUNC_PIXEL_EXP; + break; + case GL_EXP2: + i915->state.Fog[I915_FOGREG_MODE1] |= FMC1_FOGFUNC_PIXEL_EXP2; + break; + default: + break; + } + } + else { /* if (i915->vertex_fog != I915_FOG_VERTEX) */ + + I915_STATECHANGE(i915, I915_UPLOAD_FOG); + i915->state.Fog[I915_FOGREG_MODE1] &= ~FMC1_FOGFUNC_MASK; + i915->state.Fog[I915_FOGREG_MODE1] |= FMC1_FOGFUNC_VERTEX; + i915->vertex_fog = I915_FOG_VERTEX; + } + + { + I915_STATECHANGE(i915, I915_UPLOAD_CTX); + I915_ACTIVESTATE(i915, I915_UPLOAD_FOG, enabled); + if (enabled) + i915->state.Ctx[I915_CTXREG_LIS5] |= S5_FOG_ENABLE; + else + i915->state.Ctx[I915_CTXREG_LIS5] &= ~S5_FOG_ENABLE; + } + + if (enabled) { + _tnl_allow_vertex_fog(ctx, (i915->vertex_fog == I915_FOG_VERTEX)); + _tnl_allow_pixel_fog(ctx, (i915->vertex_fog != I915_FOG_VERTEX)); + } +} + +static void +i915Fogfv(GLcontext * ctx, GLenum pname, const GLfloat * param) +{ + struct i915_context *i915 = I915_CONTEXT(ctx); + + switch (pname) { + case GL_FOG_COORDINATE_SOURCE_EXT: + case GL_FOG_MODE: + case GL_FOG_START: + case GL_FOG_END: + break; + + case GL_FOG_DENSITY: + I915_STATECHANGE(i915, I915_UPLOAD_FOG); + + if (i915->state.Fog[I915_FOGREG_MODE1] & FMC1_FOGINDEX_Z) { + i915->state.Fog[I915_FOGREG_MODE3] = (GLuint) (ctx->Fog.Density * + FMC3_D_ONE); + } + else { + union + { + float f; + int i; + } fi; + fi.f = ctx->Fog.Density; + i915->state.Fog[I915_FOGREG_MODE3] = fi.i; + } + break; + + case GL_FOG_COLOR: + I915_STATECHANGE(i915, I915_UPLOAD_FOG); + i915->state.Fog[I915_FOGREG_COLOR] = + (_3DSTATE_FOG_COLOR_CMD | + ((GLubyte) (ctx->Fog.Color[0] * 255.0F) << 16) | + ((GLubyte) (ctx->Fog.Color[1] * 255.0F) << 8) | + ((GLubyte) (ctx->Fog.Color[2] * 255.0F) << 0)); + break; + + default: + break; + } +} + +static void +i915Hint(GLcontext * ctx, GLenum target, GLenum state) +{ + switch (target) { + case GL_FOG_HINT: + break; + default: + break; + } +} + +/* ============================================================= + */ + +static void +i915Enable(GLcontext * ctx, GLenum cap, GLboolean state) +{ + struct i915_context *i915 = I915_CONTEXT(ctx); + + switch (cap) { + case GL_TEXTURE_2D: + break; + + case GL_LIGHTING: + case GL_COLOR_SUM: + update_specular(ctx); + break; + + case GL_ALPHA_TEST: + I915_STATECHANGE(i915, I915_UPLOAD_CTX); + if (state) + i915->state.Ctx[I915_CTXREG_LIS6] |= S6_ALPHA_TEST_ENABLE; + else + i915->state.Ctx[I915_CTXREG_LIS6] &= ~S6_ALPHA_TEST_ENABLE; + break; + + case GL_BLEND: + i915EvalLogicOpBlendState(ctx); + break; + + case GL_COLOR_LOGIC_OP: + i915EvalLogicOpBlendState(ctx); + + /* Logicop doesn't seem to work at 16bpp: + */ + if (i915->intel.intelScreen->cpp == 2) /* XXX FBO fix */ + FALLBACK(&i915->intel, I915_FALLBACK_LOGICOP, state); + break; + + case GL_FRAGMENT_PROGRAM_ARB: + break; + + case GL_DITHER: + I915_STATECHANGE(i915, I915_UPLOAD_CTX); + if (state) + i915->state.Ctx[I915_CTXREG_LIS5] |= S5_COLOR_DITHER_ENABLE; + else + i915->state.Ctx[I915_CTXREG_LIS5] &= ~S5_COLOR_DITHER_ENABLE; + break; + + case GL_DEPTH_TEST: + I915_STATECHANGE(i915, I915_UPLOAD_CTX); + if (state) + i915->state.Ctx[I915_CTXREG_LIS6] |= S6_DEPTH_TEST_ENABLE; + else + i915->state.Ctx[I915_CTXREG_LIS6] &= ~S6_DEPTH_TEST_ENABLE; + + i915DepthMask(ctx, ctx->Depth.Mask); + break; + + case GL_SCISSOR_TEST: + I915_STATECHANGE(i915, I915_UPLOAD_BUFFERS); + if (state) + i915->state.Buffer[I915_DESTREG_SENABLE] = + (_3DSTATE_SCISSOR_ENABLE_CMD | ENABLE_SCISSOR_RECT); + else + i915->state.Buffer[I915_DESTREG_SENABLE] = + (_3DSTATE_SCISSOR_ENABLE_CMD | DISABLE_SCISSOR_RECT); + break; + + case GL_LINE_SMOOTH: + I915_STATECHANGE(i915, I915_UPLOAD_CTX); + if (state) + i915->state.Ctx[I915_CTXREG_LIS4] |= S4_LINE_ANTIALIAS_ENABLE; + else + i915->state.Ctx[I915_CTXREG_LIS4] &= ~S4_LINE_ANTIALIAS_ENABLE; + break; + + case GL_FOG: + break; + + case GL_CULL_FACE: + i915CullFaceFrontFace(ctx, 0); + break; + + case GL_STENCIL_TEST: + { + GLboolean hw_stencil = GL_FALSE; + if (ctx->DrawBuffer) { + struct intel_renderbuffer *irbStencil + = intel_get_renderbuffer(ctx->DrawBuffer, BUFFER_STENCIL); + hw_stencil = (irbStencil && irbStencil->region); + } + if (hw_stencil) { + I915_STATECHANGE(i915, I915_UPLOAD_CTX); + if (state) + i915->state.Ctx[I915_CTXREG_LIS5] |= (S5_STENCIL_TEST_ENABLE | + S5_STENCIL_WRITE_ENABLE); + else + i915->state.Ctx[I915_CTXREG_LIS5] &= ~(S5_STENCIL_TEST_ENABLE | + S5_STENCIL_WRITE_ENABLE); + } + else { + FALLBACK(&i915->intel, I915_FALLBACK_STENCIL, state); + } + } + break; + + case GL_POLYGON_STIPPLE: + /* The stipple command worked on my 855GM box, but not my 845G. + * I'll do more testing later to find out exactly which hardware + * supports it. Disabled for now. + */ + if (i915->intel.hw_stipple && + i915->intel.reduced_primitive == GL_TRIANGLES) { + I915_STATECHANGE(i915, I915_UPLOAD_STIPPLE); + if (state) + i915->state.Stipple[I915_STPREG_ST1] |= ST1_ENABLE; + else + i915->state.Stipple[I915_STPREG_ST1] &= ~ST1_ENABLE; + } + break; + + case GL_POLYGON_SMOOTH: + break; + + case GL_POINT_SMOOTH: + break; + + default: + ; + } +} + + +static void +i915_init_packets(struct i915_context *i915) +{ + intelScreenPrivate *screen = i915->intel.intelScreen; + + /* Zero all state */ + memset(&i915->state, 0, sizeof(i915->state)); + + + { + I915_STATECHANGE(i915, I915_UPLOAD_CTX); + /* Probably don't want to upload all this stuff every time one + * piece changes. + */ + i915->state.Ctx[I915_CTXREG_LI] = (_3DSTATE_LOAD_STATE_IMMEDIATE_1 | + I1_LOAD_S(2) | + I1_LOAD_S(4) | + I1_LOAD_S(5) | I1_LOAD_S(6) | (4)); + i915->state.Ctx[I915_CTXREG_LIS2] = 0; + i915->state.Ctx[I915_CTXREG_LIS4] = 0; + i915->state.Ctx[I915_CTXREG_LIS5] = 0; + + if (screen->cpp == 2) /* XXX FBO fix */ + i915->state.Ctx[I915_CTXREG_LIS5] |= S5_COLOR_DITHER_ENABLE; + + + i915->state.Ctx[I915_CTXREG_LIS6] = (S6_COLOR_WRITE_ENABLE | + (2 << S6_TRISTRIP_PV_SHIFT)); + + i915->state.Ctx[I915_CTXREG_STATE4] = (_3DSTATE_MODES_4_CMD | + ENABLE_LOGIC_OP_FUNC | + LOGIC_OP_FUNC(LOGICOP_COPY) | + ENABLE_STENCIL_TEST_MASK | + STENCIL_TEST_MASK(0xff) | + ENABLE_STENCIL_WRITE_MASK | + STENCIL_WRITE_MASK(0xff)); + + i915->state.Ctx[I915_CTXREG_IAB] = + (_3DSTATE_INDEPENDENT_ALPHA_BLEND_CMD | IAB_MODIFY_ENABLE | + IAB_MODIFY_FUNC | IAB_MODIFY_SRC_FACTOR | IAB_MODIFY_DST_FACTOR); + + i915->state.Ctx[I915_CTXREG_BLENDCOLOR0] = + _3DSTATE_CONST_BLEND_COLOR_CMD; + i915->state.Ctx[I915_CTXREG_BLENDCOLOR1] = 0; + + } + + { + I915_STATECHANGE(i915, I915_UPLOAD_STIPPLE); + i915->state.Stipple[I915_STPREG_ST0] = _3DSTATE_STIPPLE; + } + + + { + I915_STATECHANGE(i915, I915_UPLOAD_FOG); + i915->state.Fog[I915_FOGREG_MODE0] = _3DSTATE_FOG_MODE_CMD; + i915->state.Fog[I915_FOGREG_MODE1] = (FMC1_FOGFUNC_MODIFY_ENABLE | + FMC1_FOGFUNC_VERTEX | + FMC1_FOGINDEX_MODIFY_ENABLE | + FMC1_FOGINDEX_W | + FMC1_C1_C2_MODIFY_ENABLE | + FMC1_DENSITY_MODIFY_ENABLE); + i915->state.Fog[I915_FOGREG_COLOR] = _3DSTATE_FOG_COLOR_CMD; + } + + + { + I915_STATECHANGE(i915, I915_UPLOAD_BUFFERS); + /* color buffer offset/stride */ + i915->state.Buffer[I915_DESTREG_CBUFADDR0] = _3DSTATE_BUF_INFO_CMD; + /* XXX FBO: remove this? Also get set in i915_set_draw_region() */ + i915->state.Buffer[I915_DESTREG_CBUFADDR1] = (BUF_3D_ID_COLOR_BACK | BUF_3D_PITCH(screen->front.pitch) | /* pitch in bytes */ + BUF_3D_USE_FENCE); + + i915->state.Buffer[I915_DESTREG_DBUFADDR0] = _3DSTATE_BUF_INFO_CMD; + /* XXX FBO: remove this? Also get set in i915_set_draw_region() */ + i915->state.Buffer[I915_DESTREG_DBUFADDR1] = (BUF_3D_ID_DEPTH | BUF_3D_PITCH(screen->depth.pitch) | /* pitch in bytes */ + BUF_3D_USE_FENCE); + + i915->state.Buffer[I915_DESTREG_DV0] = _3DSTATE_DST_BUF_VARS_CMD; + + /* XXX FBO: remove this? Also get set in i915_set_draw_region() */ +#if 0 /* seems we don't need this */ + switch (screen->fbFormat) { + case DV_PF_565: + i915->state.Buffer[I915_DESTREG_DV1] = (DSTORG_HORT_BIAS(0x8) | /* .5 */ + DSTORG_VERT_BIAS(0x8) | /* .5 */ + LOD_PRECLAMP_OGL | + TEX_DEFAULT_COLOR_OGL | + DITHER_FULL_ALWAYS | + screen->fbFormat | + DEPTH_FRMT_16_FIXED); + break; + case DV_PF_8888: + i915->state.Buffer[I915_DESTREG_DV1] = (DSTORG_HORT_BIAS(0x8) | /* .5 */ + DSTORG_VERT_BIAS(0x8) | /* .5 */ + LOD_PRECLAMP_OGL | + TEX_DEFAULT_COLOR_OGL | + screen->fbFormat | + DEPTH_FRMT_24_FIXED_8_OTHER); + break; + } +#endif + + + /* scissor */ + i915->state.Buffer[I915_DESTREG_SENABLE] = + (_3DSTATE_SCISSOR_ENABLE_CMD | DISABLE_SCISSOR_RECT); + i915->state.Buffer[I915_DESTREG_SR0] = _3DSTATE_SCISSOR_RECT_0_CMD; + i915->state.Buffer[I915_DESTREG_SR1] = 0; + i915->state.Buffer[I915_DESTREG_SR2] = 0; + } + + +#if 0 + { + I915_STATECHANGE(i915, I915_UPLOAD_DEFAULTS); + i915->state.Default[I915_DEFREG_C0] = _3DSTATE_DEFAULT_DIFFUSE; + i915->state.Default[I915_DEFREG_C1] = 0; + i915->state.Default[I915_DEFREG_S0] = _3DSTATE_DEFAULT_SPECULAR; + i915->state.Default[I915_DEFREG_S1] = 0; + i915->state.Default[I915_DEFREG_Z0] = _3DSTATE_DEFAULT_Z; + i915->state.Default[I915_DEFREG_Z1] = 0; + } +#endif + + + /* These will be emitted every at the head of every buffer, unless + * we get hardware contexts working. + */ + i915->state.active = (I915_UPLOAD_PROGRAM | + I915_UPLOAD_STIPPLE | + I915_UPLOAD_CTX | + I915_UPLOAD_BUFFERS | I915_UPLOAD_INVARIENT); +} + +void +i915InitStateFunctions(struct dd_function_table *functions) +{ + functions->AlphaFunc = i915AlphaFunc; + functions->BlendColor = i915BlendColor; + functions->BlendEquationSeparate = i915BlendEquationSeparate; + functions->BlendFuncSeparate = i915BlendFuncSeparate; + functions->ColorMask = i915ColorMask; + functions->CullFace = i915CullFaceFrontFace; + functions->DepthFunc = i915DepthFunc; + functions->DepthMask = i915DepthMask; + functions->Enable = i915Enable; + functions->Fogfv = i915Fogfv; + functions->FrontFace = i915CullFaceFrontFace; + functions->Hint = i915Hint; + functions->LightModelfv = i915LightModelfv; + functions->LineWidth = i915LineWidth; + functions->LogicOpcode = i915LogicOp; + functions->PointSize = i915PointSize; + functions->PolygonStipple = i915PolygonStipple; + functions->Scissor = i915Scissor; + functions->ShadeModel = i915ShadeModel; + functions->StencilFuncSeparate = i915StencilFuncSeparate; + functions->StencilMaskSeparate = i915StencilMaskSeparate; + functions->StencilOpSeparate = i915StencilOpSeparate; +} + + +void +i915InitState(struct i915_context *i915) +{ + GLcontext *ctx = &i915->intel.ctx; + + i915_init_packets(i915); + + intelInitState(ctx); + + memcpy(&i915->initial, &i915->state, sizeof(i915->state)); + i915->current = &i915->state; +} diff --git a/src/mesa/drivers/dri/i915tex/i915_tex.c b/src/mesa/drivers/dri/i915tex/i915_tex.c new file mode 100644 index 00000000000..a53abe9a92f --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/i915_tex.c @@ -0,0 +1,113 @@ +/************************************************************************** + * + * Copyright 2003 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. + * + **************************************************************************/ + +#include "glheader.h" +#include "mtypes.h" +#include "imports.h" +#include "simple_list.h" +#include "enums.h" +#include "image.h" +#include "texstore.h" +#include "texformat.h" +#include "texmem.h" +#include "swrast/swrast.h" + +#include "mm.h" + +#include "intel_ioctl.h" + +#include "i915_context.h" +#include "i915_reg.h" + + + +static void +i915TexEnv(GLcontext * ctx, GLenum target, + GLenum pname, const GLfloat * param) +{ + struct i915_context *i915 = I915_CONTEXT(ctx); + + switch (pname) { + case GL_TEXTURE_ENV_COLOR: /* Should be a tracked param */ + case GL_TEXTURE_ENV_MODE: + case GL_COMBINE_RGB: + case GL_COMBINE_ALPHA: + case GL_SOURCE0_RGB: + case GL_SOURCE1_RGB: + case GL_SOURCE2_RGB: + case GL_SOURCE0_ALPHA: + case GL_SOURCE1_ALPHA: + case GL_SOURCE2_ALPHA: + case GL_OPERAND0_RGB: + case GL_OPERAND1_RGB: + case GL_OPERAND2_RGB: + case GL_OPERAND0_ALPHA: + case GL_OPERAND1_ALPHA: + case GL_OPERAND2_ALPHA: + case GL_RGB_SCALE: + case GL_ALPHA_SCALE: + i915->tex_program.translated = 0; + break; + + case GL_TEXTURE_LOD_BIAS:{ + GLuint unit = ctx->Texture.CurrentUnit; + GLint b = (int) ((*param) * 16.0); + if (b > 255) + b = 255; + if (b < -256) + b = -256; + I915_STATECHANGE(i915, I915_UPLOAD_TEX(unit)); + i915->lodbias_ss2[unit] = + ((b << SS2_LOD_BIAS_SHIFT) & SS2_LOD_BIAS_MASK); + break; + } + + default: + break; + } +} + + +static void +i915BindTexture(GLcontext * ctx, GLenum target, + struct gl_texture_object *texobj) +{ + /* Need this if image format changes between bound textures. + * Could try and shortcircuit by checking for differences in + * state between incoming and outgoing textures: + */ + I915_CONTEXT(ctx)->tex_program.translated = 0; +} + + + +void +i915InitTextureFuncs(struct dd_function_table *functions) +{ + functions->BindTexture = i915BindTexture; + functions->TexEnv = i915TexEnv; +} diff --git a/src/mesa/drivers/dri/i915tex/i915_tex_layout.c b/src/mesa/drivers/dri/i915tex/i915_tex_layout.c new file mode 100644 index 00000000000..e9360ecea83 --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/i915_tex_layout.c @@ -0,0 +1,380 @@ +/************************************************************************** + * + * Copyright 2006 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. + * + **************************************************************************/ + +/* Code to layout images in a mipmap tree for i915 and i945 + * respectively. + */ + +#include "intel_mipmap_tree.h" +#include "macros.h" +#include "intel_context.h" + +#define FILE_DEBUG_FLAG DEBUG_TEXTURE + +static GLint initial_offsets[6][2] = { {0, 0}, +{0, 2}, +{1, 0}, +{1, 2}, +{1, 1}, +{1, 3} +}; + + +static GLint step_offsets[6][2] = { {0, 2}, +{0, 2}, +{-1, 2}, +{-1, 2}, +{-1, 1}, +{-1, 1} +}; + +static GLuint +minify(GLuint d) +{ + return MAX2(1, d >> 1); +} + +GLboolean +i915_miptree_layout(struct intel_mipmap_tree * mt) +{ + GLint level; + + switch (mt->target) { + case GL_TEXTURE_CUBE_MAP:{ + const GLuint dim = mt->width0; + GLuint face; + + /* double pitch for cube layouts */ + mt->pitch = ((dim * mt->cpp * 2 + 3) & ~3) / mt->cpp; + mt->total_height = dim * 4; + + for (level = mt->first_level; level <= mt->last_level; level++) + intel_miptree_set_level_info(mt, level, 6, + 0, 0, + mt->pitch, mt->total_height, 1); + + for (face = 0; face < 6; face++) { + GLuint x = initial_offsets[face][0] * dim; + GLuint y = initial_offsets[face][1] * dim; + GLuint d = dim; + + for (level = mt->first_level; level <= mt->last_level; level++) { + intel_miptree_set_image_offset(mt, level, face, x, y); + + if (d == 0) + _mesa_printf("cube mipmap %d/%d (%d..%d) is 0x0\n", + face, level, mt->first_level, mt->last_level); + + d >>= 1; + x += step_offsets[face][0] * d; + y += step_offsets[face][1] * d; + } + } + break; + } + case GL_TEXTURE_3D:{ + GLuint width = mt->width0; + GLuint height = mt->height0; + GLuint depth = mt->depth0; + GLuint stack_height = 0; + + /* Calculate the size of a single slice. + */ + mt->pitch = ((mt->width0 * mt->cpp + 3) & ~3) / mt->cpp; + + /* XXX: hardware expects/requires 9 levels at minimum. + */ + for (level = mt->first_level; level <= MAX2(8, mt->last_level); + level++) { + intel_miptree_set_level_info(mt, level, 1, 0, mt->total_height, + width, height, depth); + + + stack_height += MAX2(2, height); + + width = minify(width); + height = minify(height); + depth = minify(depth); + } + + /* Fixup depth image_offsets: + */ + depth = mt->depth0; + for (level = mt->first_level; level <= mt->last_level; level++) { + GLuint i; + for (i = 0; i < depth; i++) + intel_miptree_set_image_offset(mt, level, i, + 0, i * stack_height); + + depth = minify(depth); + } + + + /* Multiply slice size by texture depth for total size. It's + * remarkable how wasteful of memory the i915 texture layouts + * are. They are largely fixed in the i945. + */ + mt->total_height = stack_height * mt->depth0; + break; + } + + default:{ + GLuint width = mt->width0; + GLuint height = mt->height0; + GLuint img_height; + + mt->pitch = ((mt->width0 * mt->cpp + 3) & ~3) / mt->cpp; + mt->total_height = 0; + + for (level = mt->first_level; level <= mt->last_level; level++) { + intel_miptree_set_level_info(mt, level, 1, + 0, mt->total_height, + width, height, 1); + + if (mt->compressed) + img_height = MAX2(1, height / 4); + else + img_height = MAX2(2, height); + + mt->total_height += img_height; + mt->total_height += 1; + mt->total_height &= ~1; + + width = minify(width); + height = minify(height); + } + break; + } + } + DBG("%s: %dx%dx%d - sz 0x%x\n", __FUNCTION__, + mt->pitch, + mt->total_height, mt->cpp, mt->pitch * mt->total_height * mt->cpp); + + return GL_TRUE; +} + + +GLboolean +i945_miptree_layout(struct intel_mipmap_tree * mt) +{ + GLint level; + + switch (mt->target) { + case GL_TEXTURE_CUBE_MAP:{ + const GLuint dim = mt->width0; + GLuint face; + + /* Depending on the size of the largest images, pitch can be + * determined either by the old-style packing of cubemap faces, + * or the final row of 4x4, 2x2 and 1x1 faces below this. + */ + if (dim > 32) + mt->pitch = ((dim * mt->cpp * 2 + 3) & ~3) / mt->cpp; + else + mt->pitch = 14 * 8; + + mt->total_height = dim * 4 + 4; + + /* Set all the levels to effectively occupy the whole rectangular region. + */ + for (level = mt->first_level; level <= mt->last_level; level++) + intel_miptree_set_level_info(mt, level, 6, + 0, 0, + mt->pitch, mt->total_height, 1); + + + + for (face = 0; face < 6; face++) { + GLuint x = initial_offsets[face][0] * dim; + GLuint y = initial_offsets[face][1] * dim; + GLuint d = dim; + + if (dim == 4 && face >= 4) { + y = mt->total_height - 4; + x = (face - 4) * 8; + } + else if (dim < 4) { + y = mt->total_height - 4; + x = face * 8; + } + + for (level = mt->first_level; level <= mt->last_level; level++) { + intel_miptree_set_image_offset(mt, level, face, x, y); + + d >>= 1; + + switch (d) { + case 4: + switch (face) { + case FACE_POS_X: + case FACE_NEG_X: + x += step_offsets[face][0] * d; + y += step_offsets[face][1] * d; + break; + case FACE_POS_Y: + case FACE_NEG_Y: + y += 12; + x -= 8; + break; + case FACE_POS_Z: + case FACE_NEG_Z: + y = mt->total_height - 4; + x = (face - 4) * 8; + break; + } + + case 2: + y = mt->total_height - 4; + x = 16 + face * 8; + break; + + case 1: + x += 48; + break; + + default: + x += step_offsets[face][0] * d; + y += step_offsets[face][1] * d; + break; + } + } + } + break; + } + case GL_TEXTURE_3D:{ + GLuint width = mt->width0; + GLuint height = mt->height0; + GLuint depth = mt->depth0; + GLuint pack_x_pitch, pack_x_nr; + GLuint pack_y_pitch; + GLuint level; + + mt->pitch = ((mt->width0 * mt->cpp + 3) & ~3) / mt->cpp; + mt->total_height = 0; + + pack_y_pitch = MAX2(mt->height0, 2); + pack_x_pitch = mt->pitch; + pack_x_nr = 1; + + for (level = mt->first_level; level <= mt->last_level; level++) { + GLuint nr_images = mt->target == GL_TEXTURE_3D ? depth : 6; + GLint x = 0; + GLint y = 0; + GLint q, j; + + intel_miptree_set_level_info(mt, level, nr_images, + 0, mt->total_height, + width, height, depth); + + for (q = 0; q < nr_images;) { + for (j = 0; j < pack_x_nr && q < nr_images; j++, q++) { + intel_miptree_set_image_offset(mt, level, q, x, y); + x += pack_x_pitch; + } + + x = 0; + y += pack_y_pitch; + } + + + mt->total_height += y; + + if (pack_x_pitch > 4) { + pack_x_pitch >>= 1; + pack_x_nr <<= 1; + assert(pack_x_pitch * pack_x_nr <= mt->pitch); + } + + if (pack_y_pitch > 2) { + pack_y_pitch >>= 1; + } + + width = minify(width); + height = minify(height); + depth = minify(depth); + } + break; + } + + case GL_TEXTURE_1D: + case GL_TEXTURE_2D: + case GL_TEXTURE_RECTANGLE_ARB:{ + GLuint x = 0; + GLuint y = 0; + GLuint width = mt->width0; + GLuint height = mt->height0; + GLint align_h = 2; + + mt->pitch = ((mt->width0 * mt->cpp + 3) & ~3) / mt->cpp; + mt->total_height = 0; + + for (level = mt->first_level; level <= mt->last_level; level++) { + GLuint img_height; + + intel_miptree_set_level_info(mt, level, 1, + x, y, + width, + mt->compressed ? height/4 : height, 1); + + + if (mt->compressed) + img_height = MAX2(1, height / 4); + else + img_height = MAX2(align_h, height); + + /* LPT change: step right after second mipmap. + */ + if (level == mt->first_level + 1) { + x += mt->pitch / 2; + x = (x + 3) & ~3; + } + else { + y += img_height; + y += align_h - 1; + y &= ~(align_h - 1); + } + + /* Because the images are packed better, the final offset + * might not be the maximal one: + */ + mt->total_height = MAX2(mt->total_height, y); + + width = minify(width); + height = minify(height); + } + break; + } + default: + _mesa_problem(NULL, "Unexpected tex target in i945_miptree_layout()"); + } + + DBG("%s: %dx%dx%d - sz 0x%x\n", __FUNCTION__, + mt->pitch, + mt->total_height, mt->cpp, mt->pitch * mt->total_height * mt->cpp); + + return GL_TRUE; +} diff --git a/src/mesa/drivers/dri/i915tex/i915_texstate.c b/src/mesa/drivers/dri/i915tex/i915_texstate.c new file mode 100644 index 00000000000..e0ecdfde24a --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/i915_texstate.c @@ -0,0 +1,338 @@ +/************************************************************************** + * + * Copyright 2003 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. + * + **************************************************************************/ + +#include "mtypes.h" +#include "enums.h" +#include "texformat.h" +#include "dri_bufmgr.h" + +#include "intel_mipmap_tree.h" +#include "intel_tex.h" + +#include "i915_context.h" +#include "i915_reg.h" + + +static GLuint +translate_texture_format(GLuint mesa_format) +{ + switch (mesa_format) { + case MESA_FORMAT_L8: + return MAPSURF_8BIT | MT_8BIT_L8; + case MESA_FORMAT_I8: + return MAPSURF_8BIT | MT_8BIT_I8; + case MESA_FORMAT_A8: + return MAPSURF_8BIT | MT_8BIT_A8; + case MESA_FORMAT_AL88: + return MAPSURF_16BIT | MT_16BIT_AY88; + case MESA_FORMAT_RGB565: + return MAPSURF_16BIT | MT_16BIT_RGB565; + case MESA_FORMAT_ARGB1555: + return MAPSURF_16BIT | MT_16BIT_ARGB1555; + case MESA_FORMAT_ARGB4444: + return MAPSURF_16BIT | MT_16BIT_ARGB4444; + case MESA_FORMAT_ARGB8888: + return MAPSURF_32BIT | MT_32BIT_ARGB8888; + case MESA_FORMAT_YCBCR_REV: + return (MAPSURF_422 | MT_422_YCRCB_NORMAL); + case MESA_FORMAT_YCBCR: + return (MAPSURF_422 | MT_422_YCRCB_SWAPY); + case MESA_FORMAT_RGB_FXT1: + case MESA_FORMAT_RGBA_FXT1: + return (MAPSURF_COMPRESSED | MT_COMPRESS_FXT1); + case MESA_FORMAT_Z16: + return (MAPSURF_16BIT | MT_16BIT_L16); + case MESA_FORMAT_RGBA_DXT1: + case MESA_FORMAT_RGB_DXT1: + return (MAPSURF_COMPRESSED | MT_COMPRESS_DXT1); + case MESA_FORMAT_RGBA_DXT3: + return (MAPSURF_COMPRESSED | MT_COMPRESS_DXT2_3); + case MESA_FORMAT_RGBA_DXT5: + return (MAPSURF_COMPRESSED | MT_COMPRESS_DXT4_5); + case MESA_FORMAT_Z24_S8: + return (MAPSURF_32BIT | MT_32BIT_xL824); + default: + fprintf(stderr, "%s: bad image format %x\n", __FUNCTION__, mesa_format); + abort(); + return 0; + } +} + + + + +/* The i915 (and related graphics cores) do not support GL_CLAMP. The + * Intel drivers for "other operating systems" implement GL_CLAMP as + * GL_CLAMP_TO_EDGE, so the same is done here. + */ +static GLuint +translate_wrap_mode(GLenum wrap) +{ + switch (wrap) { + case GL_REPEAT: + return TEXCOORDMODE_WRAP; + case GL_CLAMP: + return TEXCOORDMODE_CLAMP_EDGE; /* not quite correct */ + case GL_CLAMP_TO_EDGE: + return TEXCOORDMODE_CLAMP_EDGE; + case GL_CLAMP_TO_BORDER: + return TEXCOORDMODE_CLAMP_BORDER; + case GL_MIRRORED_REPEAT: + return TEXCOORDMODE_MIRROR; + default: + return TEXCOORDMODE_WRAP; + } +} + + + +/* Recalculate all state from scratch. Perhaps not the most + * efficient, but this has gotten complex enough that we need + * something which is understandable and reliable. + */ +static GLboolean +i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) +{ + GLcontext *ctx = &intel->ctx; + struct i915_context *i915 = i915_context(ctx); + struct gl_texture_object *tObj = ctx->Texture.Unit[unit]._Current; + struct intel_texture_object *intelObj = intel_texture_object(tObj); + struct gl_texture_image *firstImage; + GLuint *state = i915->state.Tex[unit]; + + memset(state, 0, sizeof(state)); + + /*We need to refcount these. */ + + if (i915->state.tex_buffer[unit] != NULL) { + driBOUnReference(i915->state.tex_buffer[unit]); + i915->state.tex_buffer[unit] = NULL; + } + + if (!intel_finalize_mipmap_tree(intel, unit)) + return GL_FALSE; + + /* Get first image here, since intelObj->firstLevel will get set in + * the intel_finalize_mipmap_tree() call above. + */ + firstImage = tObj->Image[0][intelObj->firstLevel]; + + i915->state.tex_buffer[unit] = driBOReference(intelObj->mt->region->buffer); + i915->state.tex_offset[unit] = intel_miptree_image_offset(intelObj->mt, 0, + intelObj-> + firstLevel); + + state[I915_TEXREG_MS3] = + (((firstImage->Height - 1) << MS3_HEIGHT_SHIFT) | + ((firstImage->Width - 1) << MS3_WIDTH_SHIFT) | + translate_texture_format(firstImage->TexFormat->MesaFormat) | + MS3_USE_FENCE_REGS); + + state[I915_TEXREG_MS4] = + (((((intelObj->mt->pitch * intelObj->mt->cpp) / 4) - + 1) << MS4_PITCH_SHIFT) | MS4_CUBE_FACE_ENA_MASK | + ((((intelObj->lastLevel - + intelObj->firstLevel) * + 4)) << MS4_MAX_LOD_SHIFT) | ((firstImage->Depth - + 1) << MS4_VOLUME_DEPTH_SHIFT)); + + + { + GLuint minFilt, mipFilt, magFilt; + + switch (tObj->MinFilter) { + case GL_NEAREST: + minFilt = FILTER_NEAREST; + mipFilt = MIPFILTER_NONE; + break; + case GL_LINEAR: + minFilt = FILTER_LINEAR; + mipFilt = MIPFILTER_NONE; + break; + case GL_NEAREST_MIPMAP_NEAREST: + minFilt = FILTER_NEAREST; + mipFilt = MIPFILTER_NEAREST; + break; + case GL_LINEAR_MIPMAP_NEAREST: + minFilt = FILTER_LINEAR; + mipFilt = MIPFILTER_NEAREST; + break; + case GL_NEAREST_MIPMAP_LINEAR: + minFilt = FILTER_NEAREST; + mipFilt = MIPFILTER_LINEAR; + break; + case GL_LINEAR_MIPMAP_LINEAR: + minFilt = FILTER_LINEAR; + mipFilt = MIPFILTER_LINEAR; + break; + default: + return GL_FALSE; + } + + if (tObj->MaxAnisotropy > 1.0) { + minFilt = FILTER_ANISOTROPIC; + magFilt = FILTER_ANISOTROPIC; + } + else { + switch (tObj->MagFilter) { + case GL_NEAREST: + magFilt = FILTER_NEAREST; + break; + case GL_LINEAR: + magFilt = FILTER_LINEAR; + break; + default: + return GL_FALSE; + } + } + + state[I915_TEXREG_SS2] = i915->lodbias_ss2[unit]; + + /* YUV conversion: + */ + if (firstImage->TexFormat->MesaFormat == MESA_FORMAT_YCBCR || + firstImage->TexFormat->MesaFormat == MESA_FORMAT_YCBCR_REV) + state[I915_TEXREG_SS2] |= SS2_COLORSPACE_CONVERSION; + + /* Shadow: + */ + if (tObj->CompareMode == GL_COMPARE_R_TO_TEXTURE_ARB && + tObj->Target != GL_TEXTURE_3D) { + + state[I915_TEXREG_SS2] |= + (SS2_SHADOW_ENABLE | + intel_translate_compare_func(tObj->CompareFunc)); + + minFilt = FILTER_4X4_FLAT; + magFilt = FILTER_4X4_FLAT; + } + + state[I915_TEXREG_SS2] |= ((minFilt << SS2_MIN_FILTER_SHIFT) | + (mipFilt << SS2_MIP_FILTER_SHIFT) | + (magFilt << SS2_MAG_FILTER_SHIFT)); + } + + { + GLenum ws = tObj->WrapS; + GLenum wt = tObj->WrapT; + GLenum wr = tObj->WrapR; + + + /* 3D textures don't seem to respect the border color. + * Fallback if there's ever a danger that they might refer to + * it. + * + * Effectively this means fallback on 3D clamp or + * clamp_to_border. + */ + if (tObj->Target == GL_TEXTURE_3D && + (tObj->MinFilter != GL_NEAREST || + tObj->MagFilter != GL_NEAREST) && + (ws == GL_CLAMP || + wt == GL_CLAMP || + wr == GL_CLAMP || + ws == GL_CLAMP_TO_BORDER || + wt == GL_CLAMP_TO_BORDER || wr == GL_CLAMP_TO_BORDER)) + return GL_FALSE; + + + state[I915_TEXREG_SS3] = ss3; /* SS3_NORMALIZED_COORDS */ + + state[I915_TEXREG_SS3] |= + ((translate_wrap_mode(ws) << SS3_TCX_ADDR_MODE_SHIFT) | + (translate_wrap_mode(wt) << SS3_TCY_ADDR_MODE_SHIFT) | + (translate_wrap_mode(wr) << SS3_TCZ_ADDR_MODE_SHIFT)); + + state[I915_TEXREG_SS3] |= (unit << SS3_TEXTUREMAP_INDEX_SHIFT); + } + + + state[I915_TEXREG_SS4] = INTEL_PACKCOLOR8888(tObj->_BorderChan[0], + tObj->_BorderChan[1], + tObj->_BorderChan[2], + tObj->_BorderChan[3]); + + + I915_ACTIVESTATE(i915, I915_UPLOAD_TEX(unit), GL_TRUE); + /* memcmp was already disabled, but definitely won't work as the + * region might now change and that wouldn't be detected: + */ + I915_STATECHANGE(i915, I915_UPLOAD_TEX(unit)); + + +#if 0 + DBG(TEXTURE, "state[I915_TEXREG_SS2] = 0x%x\n", state[I915_TEXREG_SS2]); + DBG(TEXTURE, "state[I915_TEXREG_SS3] = 0x%x\n", state[I915_TEXREG_SS3]); + DBG(TEXTURE, "state[I915_TEXREG_SS4] = 0x%x\n", state[I915_TEXREG_SS4]); + DBG(TEXTURE, "state[I915_TEXREG_MS2] = 0x%x\n", state[I915_TEXREG_MS2]); + DBG(TEXTURE, "state[I915_TEXREG_MS3] = 0x%x\n", state[I915_TEXREG_MS3]); + DBG(TEXTURE, "state[I915_TEXREG_MS4] = 0x%x\n", state[I915_TEXREG_MS4]); +#endif + + return GL_TRUE; +} + + + + +void +i915UpdateTextureState(struct intel_context *intel) +{ + GLboolean ok = GL_TRUE; + GLuint i; + + for (i = 0; i < I915_TEX_UNITS && ok; i++) { + switch (intel->ctx.Texture.Unit[i]._ReallyEnabled) { + case TEXTURE_1D_BIT: + case TEXTURE_2D_BIT: + case TEXTURE_CUBE_BIT: + case TEXTURE_3D_BIT: + ok = i915_update_tex_unit(intel, i, SS3_NORMALIZED_COORDS); + break; + case TEXTURE_RECT_BIT: + ok = i915_update_tex_unit(intel, i, 0); + break; + case 0:{ + struct i915_context *i915 = i915_context(&intel->ctx); + if (i915->state.active & I915_UPLOAD_TEX(i)) + I915_ACTIVESTATE(i915, I915_UPLOAD_TEX(i), GL_FALSE); + + if (i915->state.tex_buffer[i] != NULL) { + driBOUnReference(i915->state.tex_buffer[i]); + i915->state.tex_buffer[i] = NULL; + } + + break; + } + default: + ok = GL_FALSE; + break; + } + } + + FALLBACK(intel, I915_FALLBACK_TEXTURE, !ok); +} diff --git a/src/mesa/drivers/dri/i915tex/i915_vtbl.c b/src/mesa/drivers/dri/i915tex/i915_vtbl.c new file mode 100644 index 00000000000..52db9a95e6b --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/i915_vtbl.c @@ -0,0 +1,550 @@ +/************************************************************************** + * + * Copyright 2003 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. + * + **************************************************************************/ + + + +#include "glheader.h" +#include "mtypes.h" +#include "imports.h" +#include "macros.h" +#include "colormac.h" + +#include "tnl/t_context.h" +#include "tnl/t_vertex.h" + +#include "intel_batchbuffer.h" +#include "intel_tex.h" +#include "intel_regions.h" + +#include "i915_reg.h" +#include "i915_context.h" + +static void +i915_render_start(struct intel_context *intel) +{ + struct i915_context *i915 = i915_context(&intel->ctx); + + i915ValidateFragmentProgram(i915); +} + + +static void +i915_reduced_primitive_state(struct intel_context *intel, GLenum rprim) +{ + struct i915_context *i915 = i915_context(&intel->ctx); + GLuint st1 = i915->state.Stipple[I915_STPREG_ST1]; + + st1 &= ~ST1_ENABLE; + + switch (rprim) { + case GL_TRIANGLES: + if (intel->ctx.Polygon.StippleFlag && intel->hw_stipple) + st1 |= ST1_ENABLE; + break; + case GL_LINES: + case GL_POINTS: + default: + break; + } + + i915->intel.reduced_primitive = rprim; + + if (st1 != i915->state.Stipple[I915_STPREG_ST1]) { + INTEL_FIREVERTICES(intel); + + I915_STATECHANGE(i915, I915_UPLOAD_STIPPLE); + i915->state.Stipple[I915_STPREG_ST1] = st1; + } +} + + +/* Pull apart the vertex format registers and figure out how large a + * vertex is supposed to be. + */ +static GLboolean +i915_check_vertex_size(struct intel_context *intel, GLuint expected) +{ + struct i915_context *i915 = i915_context(&intel->ctx); + int lis2 = i915->current->Ctx[I915_CTXREG_LIS2]; + int lis4 = i915->current->Ctx[I915_CTXREG_LIS4]; + int i, sz = 0; + + switch (lis4 & S4_VFMT_XYZW_MASK) { + case S4_VFMT_XY: + sz = 2; + break; + case S4_VFMT_XYZ: + sz = 3; + break; + case S4_VFMT_XYW: + sz = 3; + break; + case S4_VFMT_XYZW: + sz = 4; + break; + default: + fprintf(stderr, "no xyzw specified\n"); + return 0; + } + + if (lis4 & S4_VFMT_SPEC_FOG) + sz++; + if (lis4 & S4_VFMT_COLOR) + sz++; + if (lis4 & S4_VFMT_DEPTH_OFFSET) + sz++; + if (lis4 & S4_VFMT_POINT_WIDTH) + sz++; + if (lis4 & S4_VFMT_FOG_PARAM) + sz++; + + for (i = 0; i < 8; i++) { + switch (lis2 & S2_TEXCOORD_FMT0_MASK) { + case TEXCOORDFMT_2D: + sz += 2; + break; + case TEXCOORDFMT_3D: + sz += 3; + break; + case TEXCOORDFMT_4D: + sz += 4; + break; + case TEXCOORDFMT_1D: + sz += 1; + break; + case TEXCOORDFMT_2D_16: + sz += 1; + break; + case TEXCOORDFMT_4D_16: + sz += 2; + break; + case TEXCOORDFMT_NOT_PRESENT: + break; + default: + fprintf(stderr, "bad texcoord fmt %d\n", i); + return GL_FALSE; + } + lis2 >>= S2_TEXCOORD_FMT1_SHIFT; + } + + if (sz != expected) + fprintf(stderr, "vertex size mismatch %d/%d\n", sz, expected); + + return sz == expected; +} + + +static void +i915_emit_invarient_state(struct intel_context *intel) +{ + BATCH_LOCALS; + + BEGIN_BATCH(200, 0); + + OUT_BATCH(_3DSTATE_AA_CMD | + AA_LINE_ECAAR_WIDTH_ENABLE | + AA_LINE_ECAAR_WIDTH_1_0 | + AA_LINE_REGION_WIDTH_ENABLE | AA_LINE_REGION_WIDTH_1_0); + + OUT_BATCH(_3DSTATE_DFLT_DIFFUSE_CMD); + OUT_BATCH(0); + + OUT_BATCH(_3DSTATE_DFLT_SPEC_CMD); + OUT_BATCH(0); + + OUT_BATCH(_3DSTATE_DFLT_Z_CMD); + OUT_BATCH(0); + + /* Don't support texture crossbar yet */ + OUT_BATCH(_3DSTATE_COORD_SET_BINDINGS | + CSB_TCB(0, 0) | + CSB_TCB(1, 1) | + CSB_TCB(2, 2) | + CSB_TCB(3, 3) | + CSB_TCB(4, 4) | CSB_TCB(5, 5) | CSB_TCB(6, 6) | CSB_TCB(7, 7)); + + OUT_BATCH(_3DSTATE_RASTER_RULES_CMD | + ENABLE_POINT_RASTER_RULE | + OGL_POINT_RASTER_RULE | + ENABLE_LINE_STRIP_PROVOKE_VRTX | + ENABLE_TRI_FAN_PROVOKE_VRTX | + LINE_STRIP_PROVOKE_VRTX(1) | + TRI_FAN_PROVOKE_VRTX(2) | ENABLE_TEXKILL_3D_4D | TEXKILL_4D); + + /* Need to initialize this to zero. + */ + OUT_BATCH(_3DSTATE_LOAD_STATE_IMMEDIATE_1 | I1_LOAD_S(3) | (1)); + OUT_BATCH(0); + + /* XXX: Use this */ + OUT_BATCH(_3DSTATE_SCISSOR_ENABLE_CMD | DISABLE_SCISSOR_RECT); + + OUT_BATCH(_3DSTATE_SCISSOR_RECT_0_CMD); + OUT_BATCH(0); + OUT_BATCH(0); + + OUT_BATCH(_3DSTATE_DEPTH_SUBRECT_DISABLE); + + OUT_BATCH(_3DSTATE_LOAD_INDIRECT | 0); /* disable indirect state */ + OUT_BATCH(0); + + + /* Don't support twosided stencil yet */ + OUT_BATCH(_3DSTATE_BACKFACE_STENCIL_OPS | BFO_ENABLE_STENCIL_TWO_SIDE | 0); + + ADVANCE_BATCH(); +} + + +#define emit(intel, state, size ) \ + intel_batchbuffer_data(intel->batch, state, size, 0 ) + +static GLuint +get_dirty(struct i915_hw_state *state) +{ + GLuint dirty; + + /* Workaround the multitex hang - if one texture unit state is + * modified, emit all texture units. + */ + dirty = state->active & ~state->emitted; + if (dirty & I915_UPLOAD_TEX_ALL) + state->emitted &= ~I915_UPLOAD_TEX_ALL; + dirty = state->active & ~state->emitted; + return dirty; +} + + +static GLuint +get_state_size(struct i915_hw_state *state) +{ + GLuint dirty = get_dirty(state); + GLuint i; + GLuint sz = 0; + + if (dirty & I915_UPLOAD_CTX) + sz += sizeof(state->Ctx); + + if (dirty & I915_UPLOAD_BUFFERS) + sz += sizeof(state->Buffer); + + if (dirty & I915_UPLOAD_STIPPLE) + sz += sizeof(state->Stipple); + + if (dirty & I915_UPLOAD_FOG) + sz += sizeof(state->Fog); + + if (dirty & I915_UPLOAD_TEX_ALL) { + int nr = 0; + for (i = 0; i < I915_TEX_UNITS; i++) + if (dirty & I915_UPLOAD_TEX(i)) + nr++; + + sz += (2 + nr * 3) * sizeof(GLuint) * 2; + } + + if (dirty & I915_UPLOAD_CONSTANTS) + sz += state->ConstantSize * sizeof(GLuint); + + if (dirty & I915_UPLOAD_PROGRAM) + sz += state->ProgramSize * sizeof(GLuint); + + return sz; +} + + +/* Push the state into the sarea and/or texture memory. + */ +static void +i915_emit_state(struct intel_context *intel) +{ + struct i915_context *i915 = i915_context(&intel->ctx); + struct i915_hw_state *state = i915->current; + int i; + GLuint dirty; + BATCH_LOCALS; + + /* We don't hold the lock at this point, so want to make sure that + * there won't be a buffer wrap. + * + * It might be better to talk about explicit places where + * scheduling is allowed, rather than assume that it is whenever a + * batchbuffer fills up. + */ + intel_batchbuffer_require_space(intel->batch, get_state_size(state), 0); + + /* Do this here as we may have flushed the batchbuffer above, + * causing more state to be dirty! + */ + dirty = get_dirty(state); + + if (INTEL_DEBUG & DEBUG_STATE) + fprintf(stderr, "%s dirty: %x\n", __FUNCTION__, dirty); + + if (dirty & I915_UPLOAD_INVARIENT) { + if (INTEL_DEBUG & DEBUG_STATE) + fprintf(stderr, "I915_UPLOAD_INVARIENT:\n"); + i915_emit_invarient_state(intel); + } + + if (dirty & I915_UPLOAD_CTX) { + if (INTEL_DEBUG & DEBUG_STATE) + fprintf(stderr, "I915_UPLOAD_CTX:\n"); + + emit(intel, state->Ctx, sizeof(state->Ctx)); + } + + if (dirty & I915_UPLOAD_BUFFERS) { + if (INTEL_DEBUG & DEBUG_STATE) + fprintf(stderr, "I915_UPLOAD_BUFFERS:\n"); + BEGIN_BATCH(I915_DEST_SETUP_SIZE + 2, 0); + OUT_BATCH(state->Buffer[I915_DESTREG_CBUFADDR0]); + OUT_BATCH(state->Buffer[I915_DESTREG_CBUFADDR1]); + OUT_RELOC(state->draw_region->buffer, + DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_WRITE, + DRM_BO_MASK_MEM | DRM_BO_FLAG_WRITE, + state->draw_region->draw_offset); + + if (state->depth_region) { + OUT_BATCH(state->Buffer[I915_DESTREG_DBUFADDR0]); + OUT_BATCH(state->Buffer[I915_DESTREG_DBUFADDR1]); + OUT_RELOC(state->depth_region->buffer, + DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_WRITE, + DRM_BO_MASK_MEM | DRM_BO_FLAG_WRITE, + state->depth_region->draw_offset); + } + + OUT_BATCH(state->Buffer[I915_DESTREG_DV0]); + OUT_BATCH(state->Buffer[I915_DESTREG_DV1]); + OUT_BATCH(state->Buffer[I915_DESTREG_SENABLE]); + OUT_BATCH(state->Buffer[I915_DESTREG_SR0]); + OUT_BATCH(state->Buffer[I915_DESTREG_SR1]); + OUT_BATCH(state->Buffer[I915_DESTREG_SR2]); + ADVANCE_BATCH(); + } + + if (dirty & I915_UPLOAD_STIPPLE) { + if (INTEL_DEBUG & DEBUG_STATE) + fprintf(stderr, "I915_UPLOAD_STIPPLE:\n"); + emit(intel, state->Stipple, sizeof(state->Stipple)); + } + + if (dirty & I915_UPLOAD_FOG) { + if (INTEL_DEBUG & DEBUG_STATE) + fprintf(stderr, "I915_UPLOAD_FOG:\n"); + emit(intel, state->Fog, sizeof(state->Fog)); + } + + /* Combine all the dirty texture state into a single command to + * avoid lockups on I915 hardware. + */ + if (dirty & I915_UPLOAD_TEX_ALL) { + int nr = 0; + + for (i = 0; i < I915_TEX_UNITS; i++) + if (dirty & I915_UPLOAD_TEX(i)) + nr++; + + BEGIN_BATCH(2 + nr * 3, 0); + OUT_BATCH(_3DSTATE_MAP_STATE | (3 * nr)); + OUT_BATCH((dirty & I915_UPLOAD_TEX_ALL) >> I915_UPLOAD_TEX_0_SHIFT); + for (i = 0; i < I915_TEX_UNITS; i++) + if (dirty & I915_UPLOAD_TEX(i)) { + + if (state->tex_buffer[i]) { + OUT_RELOC(state->tex_buffer[i], + DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_READ, + DRM_BO_MASK_MEM | DRM_BO_FLAG_READ, + state->tex_offset[i]); + } + else { + assert(i == 0); + assert(state == &i915->meta); + OUT_BATCH(0); + } + + OUT_BATCH(state->Tex[i][I915_TEXREG_MS3]); + OUT_BATCH(state->Tex[i][I915_TEXREG_MS4]); + } + ADVANCE_BATCH(); + + BEGIN_BATCH(2 + nr * 3, 0); + OUT_BATCH(_3DSTATE_SAMPLER_STATE | (3 * nr)); + OUT_BATCH((dirty & I915_UPLOAD_TEX_ALL) >> I915_UPLOAD_TEX_0_SHIFT); + for (i = 0; i < I915_TEX_UNITS; i++) + if (dirty & I915_UPLOAD_TEX(i)) { + OUT_BATCH(state->Tex[i][I915_TEXREG_SS2]); + OUT_BATCH(state->Tex[i][I915_TEXREG_SS3]); + OUT_BATCH(state->Tex[i][I915_TEXREG_SS4]); + } + ADVANCE_BATCH(); + } + + if (dirty & I915_UPLOAD_CONSTANTS) { + if (INTEL_DEBUG & DEBUG_STATE) + fprintf(stderr, "I915_UPLOAD_CONSTANTS:\n"); + emit(intel, state->Constant, state->ConstantSize * sizeof(GLuint)); + } + + if (dirty & I915_UPLOAD_PROGRAM) { + if (INTEL_DEBUG & DEBUG_STATE) + fprintf(stderr, "I915_UPLOAD_PROGRAM:\n"); + + assert((state->Program[0] & 0x1ff) + 2 == state->ProgramSize); + + emit(intel, state->Program, state->ProgramSize * sizeof(GLuint)); + if (INTEL_DEBUG & DEBUG_STATE) + i915_disassemble_program(state->Program, state->ProgramSize); + } + + state->emitted |= dirty; +} + +static void +i915_destroy_context(struct intel_context *intel) +{ + _tnl_free_vertices(&intel->ctx); +} + + +/** + * Set the drawing regions for the color and depth/stencil buffers. + * This involves setting the pitch, cpp and buffer ID/location. + * Also set pixel format for color and Z rendering + * Used for setting both regular and meta state. + */ +void +i915_state_draw_region(struct intel_context *intel, + struct i915_hw_state *state, + struct intel_region *color_region, + struct intel_region *depth_region) +{ + struct i915_context *i915 = i915_context(&intel->ctx); + GLuint value; + + ASSERT(state == &i915->state || state == &i915->meta); + + if (state->draw_region != color_region) { + intel_region_release(&state->draw_region); + intel_region_reference(&state->draw_region, color_region); + } + if (state->depth_region != depth_region) { + intel_region_release(&state->depth_region); + intel_region_reference(&state->depth_region, depth_region); + } + + /* + * Set stride/cpp values + */ + if (color_region) { + state->Buffer[I915_DESTREG_CBUFADDR0] = _3DSTATE_BUF_INFO_CMD; + state->Buffer[I915_DESTREG_CBUFADDR1] = + (BUF_3D_ID_COLOR_BACK | + BUF_3D_PITCH(color_region->pitch * color_region->cpp) | + BUF_3D_USE_FENCE); + } + + if (depth_region) { + state->Buffer[I915_DESTREG_DBUFADDR0] = _3DSTATE_BUF_INFO_CMD; + state->Buffer[I915_DESTREG_DBUFADDR1] = + (BUF_3D_ID_DEPTH | + BUF_3D_PITCH(depth_region->pitch * depth_region->cpp) | + BUF_3D_USE_FENCE); + } + + /* + * Compute/set I915_DESTREG_DV1 value + */ + value = (DSTORG_HORT_BIAS(0x8) | /* .5 */ + DSTORG_VERT_BIAS(0x8) | /* .5 */ + LOD_PRECLAMP_OGL | TEX_DEFAULT_COLOR_OGL); + if (color_region && color_region->cpp == 4) { + value |= DV_PF_8888; + } + else { + value |= (DITHER_FULL_ALWAYS | DV_PF_565); + } + if (depth_region && depth_region->cpp == 4) { + value |= DEPTH_FRMT_24_FIXED_8_OTHER; + } + else { + value |= DEPTH_FRMT_16_FIXED; + } + state->Buffer[I915_DESTREG_DV1] = value; + + I915_STATECHANGE(i915, I915_UPLOAD_BUFFERS); +} + + +static void +i915_set_draw_region(struct intel_context *intel, + struct intel_region *color_region, + struct intel_region *depth_region) +{ + struct i915_context *i915 = i915_context(&intel->ctx); + i915_state_draw_region(intel, &i915->state, color_region, depth_region); +} + + + +static void +i915_lost_hardware(struct intel_context *intel) +{ + struct i915_context *i915 = i915_context(&intel->ctx); + i915->state.emitted = 0; +} + +static GLuint +i915_flush_cmd(void) +{ + return MI_FLUSH | FLUSH_MAP_CACHE; +} + +static void +i915_assert_not_dirty( struct intel_context *intel ) +{ + struct i915_context *i915 = i915_context(&intel->ctx); + struct i915_hw_state *state = i915->current; + GLuint dirty = get_dirty(state); + assert(!dirty); +} + + +void +i915InitVtbl(struct i915_context *i915) +{ + i915->intel.vtbl.check_vertex_size = i915_check_vertex_size; + i915->intel.vtbl.destroy = i915_destroy_context; + i915->intel.vtbl.emit_state = i915_emit_state; + i915->intel.vtbl.lost_hardware = i915_lost_hardware; + i915->intel.vtbl.reduced_primitive_state = i915_reduced_primitive_state; + i915->intel.vtbl.render_start = i915_render_start; + i915->intel.vtbl.set_draw_region = i915_set_draw_region; + i915->intel.vtbl.update_texture_state = i915UpdateTextureState; + i915->intel.vtbl.flush_cmd = i915_flush_cmd; + i915->intel.vtbl.assert_not_dirty = i915_assert_not_dirty; +} diff --git a/src/mesa/drivers/dri/i915tex/intel_batchbuffer.c b/src/mesa/drivers/dri/i915tex/intel_batchbuffer.c new file mode 100644 index 00000000000..b4e0b74f161 --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/intel_batchbuffer.c @@ -0,0 +1,342 @@ +/************************************************************************** + * + * Copyright 2006 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. + * + **************************************************************************/ + +#include "intel_batchbuffer.h" +#include "intel_ioctl.h" + +/* Relocations in kernel space: + * - pass dma buffer seperately + * - memory manager knows how to patch + * - pass list of dependent buffers + * - pass relocation list + * + * Either: + * - get back an offset for buffer to fire + * - memory manager knows how to fire buffer + * + * Really want the buffer to be AGP and pinned. + * + */ + +/* Cliprect fence: The highest fence protecting a dma buffer + * containing explicit cliprect information. Like the old drawable + * lock but irq-driven. X server must wait for this fence to expire + * before changing cliprects [and then doing sw rendering?]. For + * other dma buffers, the scheduler will grab current cliprect info + * and mix into buffer. X server must hold the lock while changing + * cliprects??? Make per-drawable. Need cliprects in shared memory + * -- beats storing them with every cmd buffer in the queue. + * + * ==> X server must wait for this fence to expire before touching the + * framebuffer with new cliprects. + * + * ==> Cliprect-dependent buffers associated with a + * cliprect-timestamp. All of the buffers associated with a timestamp + * must go to hardware before any buffer with a newer timestamp. + * + * ==> Dma should be queued per-drawable for correct X/GL + * synchronization. Or can fences be used for this? + * + * Applies to: Blit operations, metaops, X server operations -- X + * server automatically waits on its own dma to complete before + * modifying cliprects ??? + */ + +static void +intel_dump_batchbuffer(GLuint offset, GLuint * ptr, GLuint count) +{ + int i; + fprintf(stderr, "\n\n\nSTART BATCH (%d dwords):\n", count / 4); + for (i = 0; i < count / 4; i += 4) + fprintf(stderr, "0x%x:\t0x%08x 0x%08x 0x%08x 0x%08x\n", + offset + i * 4, ptr[i], ptr[i + 1], ptr[i + 2], ptr[i + 3]); + fprintf(stderr, "END BATCH\n\n\n"); +} + +void +intel_batchbuffer_reset(struct intel_batchbuffer *batch) +{ + + int i; + + /* + * Get a new, free batchbuffer. + */ + + batch->size = batch->intel->intelScreen->maxBatchSize; + driBOData(batch->buffer, batch->size, NULL, 0); + + driBOResetList(&batch->list); + + /* + * Unreference buffers previously on the relocation list. + */ + + for (i = 0; i < batch->nr_relocs; i++) { + struct buffer_reloc *r = &batch->reloc[i]; + driBOUnReference(r->buf); + } + + batch->list_count = 0; + batch->nr_relocs = 0; + batch->flags = 0; + + /* + * We don't refcount the batchbuffer itself since we can't destroy it + * while it's on the list. + */ + + + driBOAddListItem(&batch->list, batch->buffer, + DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_EXE, + DRM_BO_MASK_MEM | DRM_BO_FLAG_EXE); + + + batch->map = driBOMap(batch->buffer, DRM_BO_FLAG_WRITE, 0); + batch->ptr = batch->map; +} + +/*====================================================================== + * Public functions + */ +struct intel_batchbuffer * +intel_batchbuffer_alloc(struct intel_context *intel) +{ + struct intel_batchbuffer *batch = calloc(sizeof(*batch), 1); + + batch->intel = intel; + + driGenBuffers(intel->intelScreen->batchPool, "batchbuffer", 1, + &batch->buffer, 4096, + DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_EXE, 0); + batch->last_fence = NULL; + driBOCreateList(20, &batch->list); + intel_batchbuffer_reset(batch); + return batch; +} + +void +intel_batchbuffer_free(struct intel_batchbuffer *batch) +{ + if (batch->last_fence) { + driFenceFinish(batch->last_fence, + DRM_FENCE_TYPE_EXE | DRM_I915_FENCE_TYPE_RW, GL_FALSE); + driFenceUnReference(batch->last_fence); + batch->last_fence = NULL; + } + if (batch->map) { + driBOUnmap(batch->buffer); + batch->map = NULL; + } + driBOUnReference(batch->buffer); + batch->buffer = NULL; + free(batch); +} + +/* TODO: Push this whole function into bufmgr. + */ +static void +do_flush_locked(struct intel_batchbuffer *batch, + GLuint used, + GLboolean ignore_cliprects, GLboolean allow_unlock) +{ + GLuint *ptr; + GLuint i; + struct intel_context *intel = batch->intel; + unsigned fenceFlags; + struct _DriFenceObject *fo; + + driBOValidateList(batch->intel->driFd, &batch->list); + + /* Apply the relocations. This nasty map indicates to me that the + * whole task should be done internally by the memory manager, and + * that dma buffers probably need to be pinned within agp space. + */ + ptr = (GLuint *) driBOMap(batch->buffer, DRM_BO_FLAG_WRITE, + DRM_BO_HINT_ALLOW_UNFENCED_MAP); + + + for (i = 0; i < batch->nr_relocs; i++) { + struct buffer_reloc *r = &batch->reloc[i]; + + ptr[r->offset / 4] = driBOOffset(r->buf) + r->delta; + } + + if (INTEL_DEBUG & DEBUG_BATCH) + intel_dump_batchbuffer(0, ptr, used); + + driBOUnmap(batch->buffer); + batch->map = NULL; + + /* Throw away non-effective packets. Won't work once we have + * hardware contexts which would preserve statechanges beyond a + * single buffer. + */ + + if (!(intel->numClipRects == 0 && !ignore_cliprects)) { + intel_batch_ioctl(batch->intel, + driBOOffset(batch->buffer), + used, ignore_cliprects, allow_unlock); + } + + + /* + * Kernel fencing. The flags tells the kernel that we've + * programmed an MI_FLUSH. + */ + + fenceFlags = DRM_I915_FENCE_FLAG_FLUSHED; + fo = driFenceBuffers(batch->intel->driFd, + "Batch fence", fenceFlags); + + /* + * User space fencing. + */ + + driBOFence(batch->buffer, fo); + + if (driFenceType(fo) == DRM_FENCE_TYPE_EXE) { + + /* + * Oops. We only validated a batch buffer. This means we + * didn't do any proper rendering. Discard this fence object. + */ + + driFenceUnReference(fo); + } else { + driFenceUnReference(batch->last_fence); + batch->last_fence = fo; + for (i = 0; i < batch->nr_relocs; i++) { + struct buffer_reloc *r = &batch->reloc[i]; + driBOFence(r->buf, fo); + } + } + + if (intel->numClipRects == 0 && !ignore_cliprects) { + if (allow_unlock) { + UNLOCK_HARDWARE(intel); + sched_yield(); + LOCK_HARDWARE(intel); + } + intel->vtbl.lost_hardware(intel); + } +} + + +struct _DriFenceObject * +intel_batchbuffer_flush(struct intel_batchbuffer *batch) +{ + struct intel_context *intel = batch->intel; + GLuint used = batch->ptr - batch->map; + + if (used == 0) + return batch->last_fence; + + /* Add the MI_BATCH_BUFFER_END. Always add an MI_FLUSH - this is a + * performance drain that we would like to avoid. + */ + if (used & 4) { + ((int *) batch->ptr)[0] = intel->vtbl.flush_cmd(); + ((int *) batch->ptr)[1] = 0; + ((int *) batch->ptr)[2] = MI_BATCH_BUFFER_END; + used += 12; + } + else { + ((int *) batch->ptr)[0] = intel->vtbl.flush_cmd(); + ((int *) batch->ptr)[1] = MI_BATCH_BUFFER_END; + used += 8; + } + + driBOUnmap(batch->buffer); + batch->ptr = NULL; + batch->map = NULL; + + /* TODO: Just pass the relocation list and dma buffer up to the + * kernel. + */ + if (!intel->locked) { + assert(!(batch->flags & INTEL_BATCH_NO_CLIPRECTS)); + + LOCK_HARDWARE(intel); + do_flush_locked(batch, used, GL_FALSE, GL_TRUE); + UNLOCK_HARDWARE(intel); + } + else { + GLboolean ignore_cliprects = !(batch->flags & INTEL_BATCH_CLIPRECTS); + do_flush_locked(batch, used, ignore_cliprects, GL_FALSE); + } + + /* Reset the buffer: + */ + intel_batchbuffer_reset(batch); + return batch->last_fence; +} + +void +intel_batchbuffer_finish(struct intel_batchbuffer *batch) +{ + struct _DriFenceObject *fence = intel_batchbuffer_flush(batch); + driFenceReference(fence); + driFenceFinish(fence, 3, GL_FALSE); + driFenceUnReference(fence); +} + + +/* This is the only way buffers get added to the validate list. + */ +GLboolean +intel_batchbuffer_emit_reloc(struct intel_batchbuffer *batch, + struct _DriBufferObject *buffer, + GLuint flags, GLuint mask, GLuint delta) +{ + assert(batch->nr_relocs <= MAX_RELOCS); + + driBOAddListItem(&batch->list, buffer, flags, mask); + + { + struct buffer_reloc *r = &batch->reloc[batch->nr_relocs++]; + driBOReference(buffer); + r->buf = buffer; + r->offset = batch->ptr - batch->map; + r->delta = delta; + } + + batch->ptr += 4; + return GL_TRUE; +} + + + +void +intel_batchbuffer_data(struct intel_batchbuffer *batch, + const void *data, GLuint bytes, GLuint flags) +{ + assert((bytes & 3) == 0); + intel_batchbuffer_require_space(batch, bytes, flags); + __memcpy(batch->ptr, data, bytes); + batch->ptr += bytes; +} diff --git a/src/mesa/drivers/dri/i915tex/intel_batchbuffer.h b/src/mesa/drivers/dri/i915tex/intel_batchbuffer.h new file mode 100644 index 00000000000..a83dbf423df --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/intel_batchbuffer.h @@ -0,0 +1,124 @@ +#ifndef INTEL_BATCHBUFFER_H +#define INTEL_BATCHBUFFER_H + +#include "mtypes.h" +#include "dri_bufmgr.h" + +struct intel_context; + +#define BATCH_SZ 16384 +#define BATCH_RESERVED 16 + +#define MAX_RELOCS 100 + +#define INTEL_BATCH_NO_CLIPRECTS 0x1 +#define INTEL_BATCH_CLIPRECTS 0x2 + +struct buffer_reloc +{ + struct _DriBufferObject *buf; + GLuint offset; + GLuint delta; /* not needed? */ +}; + +struct intel_batchbuffer +{ + struct bufmgr *bm; + struct intel_context *intel; + + struct _DriBufferObject *buffer; + struct _DriFenceObject *last_fence; + GLuint flags; + + drmBOList list; + GLuint list_count; + GLubyte *map; + GLubyte *ptr; + + struct buffer_reloc reloc[MAX_RELOCS]; + GLuint nr_relocs; + GLuint size; +}; + +struct intel_batchbuffer *intel_batchbuffer_alloc(struct intel_context + *intel); + +void intel_batchbuffer_free(struct intel_batchbuffer *batch); + + +void intel_batchbuffer_finish(struct intel_batchbuffer *batch); + +struct _DriFenceObject *intel_batchbuffer_flush(struct intel_batchbuffer + *batch); + +void intel_batchbuffer_reset(struct intel_batchbuffer *batch); + + +/* Unlike bmBufferData, this currently requires the buffer be mapped. + * Consider it a convenience function wrapping multple + * intel_buffer_dword() calls. + */ +void intel_batchbuffer_data(struct intel_batchbuffer *batch, + const void *data, GLuint bytes, GLuint flags); + +void intel_batchbuffer_release_space(struct intel_batchbuffer *batch, + GLuint bytes); + +GLboolean intel_batchbuffer_emit_reloc(struct intel_batchbuffer *batch, + struct _DriBufferObject *buffer, + GLuint flags, + GLuint mask, GLuint offset); + +/* Inline functions - might actually be better off with these + * non-inlined. Certainly better off switching all command packets to + * be passed as structs rather than dwords, but that's a little bit of + * work... + */ +static INLINE GLuint +intel_batchbuffer_space(struct intel_batchbuffer *batch) +{ + return (batch->size - BATCH_RESERVED) - (batch->ptr - batch->map); +} + + +static INLINE void +intel_batchbuffer_emit_dword(struct intel_batchbuffer *batch, GLuint dword) +{ + assert(batch->map); + assert(intel_batchbuffer_space(batch) >= 4); + *(GLuint *) (batch->ptr) = dword; + batch->ptr += 4; +} + +static INLINE void +intel_batchbuffer_require_space(struct intel_batchbuffer *batch, + GLuint sz, GLuint flags) +{ + assert(sz < batch->size - 8); + if (intel_batchbuffer_space(batch) < sz || + (batch->flags != 0 && flags != 0 && batch->flags != flags)) + intel_batchbuffer_flush(batch); + + batch->flags |= flags; +} + +/* Here are the crusty old macros, to be removed: + */ +#define BATCH_LOCALS + +#define BEGIN_BATCH(n, flags) do { \ + assert(!intel->prim.flush); \ + intel_batchbuffer_require_space(intel->batch, (n)*4, flags); \ +} while (0) + +#define OUT_BATCH(d) intel_batchbuffer_emit_dword(intel->batch, d) + +#define OUT_RELOC(buf,flags,mask,delta) do { \ + assert((delta) >= 0); \ + intel_batchbuffer_emit_reloc(intel->batch, buf, flags, mask, delta); \ +} while (0) + +#define ADVANCE_BATCH() do { } while(0) + + +#endif diff --git a/src/mesa/drivers/dri/i915tex/intel_batchpool.c b/src/mesa/drivers/dri/i915tex/intel_batchpool.c new file mode 100644 index 00000000000..3c17c50204b --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/intel_batchpool.c @@ -0,0 +1,418 @@ +/************************************************************************** + * + * Copyright 2006 Tungsten Graphics, Inc., Bismarck, ND., USA + * 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. + * + * + **************************************************************************/ +/* + * Authors: Thomas Hellström + */ + +#include +#include +#include +#include "imports.h" +#include "glthread.h" +#include "dri_bufpool.h" +#include "dri_bufmgr.h" +#include "intel_screen.h" + +typedef struct +{ + drmMMListHead head; + struct _BPool *parent; + struct _DriFenceObject *fence; + unsigned long start; + int unfenced; + int mapped; +} BBuf; + +typedef struct _BPool +{ + _glthread_Mutex mutex; + unsigned long bufSize; + unsigned poolSize; + unsigned numFree; + unsigned numTot; + unsigned numDelayed; + unsigned checkDelayed; + drmMMListHead free; + drmMMListHead delayed; + drmMMListHead head; + drmBO kernelBO; + void *virtual; + BBuf *bufs; +} BPool; + + +static BPool * +createBPool(int fd, unsigned long bufSize, unsigned numBufs, unsigned flags, + unsigned checkDelayed) +{ + BPool *p = (BPool *) malloc(sizeof(*p)); + BBuf *buf; + int i; + + if (!p) + return NULL; + + p->bufs = (BBuf *) malloc(numBufs * sizeof(*p->bufs)); + if (!p->bufs) { + free(p); + return NULL; + } + + DRMINITLISTHEAD(&p->free); + DRMINITLISTHEAD(&p->head); + DRMINITLISTHEAD(&p->delayed); + + p->numTot = numBufs; + p->numFree = numBufs; + p->bufSize = bufSize; + p->numDelayed = 0; + p->checkDelayed = checkDelayed; + + _glthread_INIT_MUTEX(p->mutex); + + if (drmBOCreate(fd, 0, numBufs * bufSize, 0, NULL, drm_bo_type_dc, + flags, 0, &p->kernelBO)) { + free(p->bufs); + free(p); + return NULL; + } + if (drmBOMap(fd, &p->kernelBO, DRM_BO_FLAG_READ | DRM_BO_FLAG_WRITE, 0, + &p->virtual)) { + drmBODestroy(fd, &p->kernelBO); + free(p->bufs); + free(p); + return NULL; + } + + /* + * We unmap the buffer so that we can validate it later. Note that this is + * just a synchronizing operation. The buffer will have a virtual mapping + * until it is destroyed. + */ + + drmBOUnmap(fd, &p->kernelBO); + + buf = p->bufs; + for (i = 0; i < numBufs; ++i) { + buf->parent = p; + buf->fence = NULL; + buf->start = i * bufSize; + buf->mapped = 0; + buf->unfenced = 0; + DRMLISTADDTAIL(&buf->head, &p->free); + buf++; + } + + return p; +} + + +static void +pool_checkFree(BPool * p, int wait) +{ + drmMMListHead *list, *prev; + BBuf *buf; + int signaled = 0; + int i; + + list = p->delayed.next; + + if (p->numDelayed > 3) { + for (i = 0; i < p->numDelayed; i += 3) { + list = list->next; + } + } + + prev = list->prev; + for (; list != &p->delayed; list = prev, prev = list->prev) { + + buf = DRMLISTENTRY(BBuf, list, head); + + if (!signaled) { + if (wait) { + driFenceFinish(buf->fence, DRM_FENCE_TYPE_EXE, 1); + signaled = 1; + } + else { + signaled = driFenceSignaled(buf->fence, DRM_FENCE_TYPE_EXE); + } + } + + if (!signaled) + break; + + driFenceUnReference(buf->fence); + buf->fence = NULL; + DRMLISTDEL(list); + p->numDelayed--; + DRMLISTADD(list, &p->free); + p->numFree++; + } +} + +static void * +pool_create(struct _DriBufferPool *pool, + unsigned long size, unsigned flags, unsigned hint, + unsigned alignment) +{ + BPool *p = (BPool *) pool->data; + + drmMMListHead *item; + + if (alignment && (alignment != 4096)) + return NULL; + + _glthread_LOCK_MUTEX(p->mutex); + + if (p->numFree == 0) + pool_checkFree(p, GL_TRUE); + + if (p->numFree == 0) { + fprintf(stderr, "Out of fixed size buffer objects\n"); + BM_CKFATAL(-ENOMEM); + } + + item = p->free.next; + + if (item == &p->free) { + fprintf(stderr, "Fixed size buffer pool corruption\n"); + } + + DRMLISTDEL(item); + --p->numFree; + + _glthread_UNLOCK_MUTEX(p->mutex); + return (void *) DRMLISTENTRY(BBuf, item, head); +} + + +static int +pool_destroy(struct _DriBufferPool *pool, void *private) +{ + BBuf *buf = (BBuf *) private; + BPool *p = buf->parent; + + _glthread_LOCK_MUTEX(p->mutex); + + if (buf->fence) { + DRMLISTADDTAIL(&buf->head, &p->delayed); + p->numDelayed++; + } + else { + buf->unfenced = 0; + DRMLISTADD(&buf->head, &p->free); + p->numFree++; + } + + if ((p->numDelayed % p->checkDelayed) == 0) + pool_checkFree(p, 0); + + _glthread_UNLOCK_MUTEX(p->mutex); + return 0; +} + + +static int +pool_map(struct _DriBufferPool *pool, void *private, unsigned flags, + int hint, void **virtual) +{ + + BBuf *buf = (BBuf *) private; + BPool *p = buf->parent; + + _glthread_LOCK_MUTEX(p->mutex); + + /* + * Currently Mesa doesn't have any condition variables to resolve this + * cleanly in a multithreading environment. + * We bail out instead. + */ + + if (buf->mapped) { + fprintf(stderr, "Trying to map already mapped buffer object\n"); + BM_CKFATAL(-EINVAL); + } + +#if 0 + if (buf->unfenced && !(hint & DRM_BO_HINT_ALLOW_UNFENCED_MAP)) { + fprintf(stderr, "Trying to map an unfenced buffer object 0x%08x" + " 0x%08x %d\n", hint, flags, buf->start); + BM_CKFATAL(-EINVAL); + } + +#endif + + if (buf->fence) { + _glthread_UNLOCK_MUTEX(p->mutex); + return -EBUSY; + } + + buf->mapped = GL_TRUE; + *virtual = (unsigned char *) p->virtual + buf->start; + _glthread_UNLOCK_MUTEX(p->mutex); + return 0; +} + +static int +pool_waitIdle(struct _DriBufferPool *pool, void *private, int lazy) +{ + BBuf *buf = (BBuf *) private; + driFenceFinish(buf->fence, 0, lazy); + return 0; +} + +static int +pool_unmap(struct _DriBufferPool *pool, void *private) +{ + BBuf *buf = (BBuf *) private; + + buf->mapped = 0; + return 0; +} + +static unsigned long +pool_offset(struct _DriBufferPool *pool, void *private) +{ + BBuf *buf = (BBuf *) private; + BPool *p = buf->parent; + + return p->kernelBO.offset + buf->start; +} + +static unsigned +pool_flags(struct _DriBufferPool *pool, void *private) +{ + BPool *p = (BPool *) pool->data; + + return p->kernelBO.flags; +} + +static unsigned long +pool_size(struct _DriBufferPool *pool, void *private) +{ + BPool *p = (BPool *) pool->data; + + return p->bufSize; +} + + +static int +pool_fence(struct _DriBufferPool *pool, void *private, + struct _DriFenceObject *fence) +{ + BBuf *buf = (BBuf *) private; + BPool *p = buf->parent; + + _glthread_LOCK_MUTEX(p->mutex); + if (buf->fence) { + driFenceUnReference(buf->fence); + } + buf->fence = fence; + buf->unfenced = 0; + driFenceReference(buf->fence); + _glthread_UNLOCK_MUTEX(p->mutex); + + return 0; +} + +static drmBO * +pool_kernel(struct _DriBufferPool *pool, void *private) +{ + BBuf *buf = (BBuf *) private; + BPool *p = buf->parent; + + return &p->kernelBO; +} + +static int +pool_validate(struct _DriBufferPool *pool, void *private) +{ + BBuf *buf = (BBuf *) private; + BPool *p = buf->parent; + _glthread_LOCK_MUTEX(p->mutex); + buf->unfenced = GL_TRUE; + _glthread_UNLOCK_MUTEX(p->mutex); + return 0; +} + +static void +pool_takedown(struct _DriBufferPool *pool) +{ + BPool *p = (BPool *) pool->data; + + /* + * Wait on outstanding fences. + */ + + _glthread_LOCK_MUTEX(p->mutex); + while ((p->numFree < p->numTot) && p->numDelayed) { + _glthread_UNLOCK_MUTEX(p->mutex); + sched_yield(); + pool_checkFree(p, GL_TRUE); + _glthread_LOCK_MUTEX(p->mutex); + } + + drmBODestroy(pool->fd, &p->kernelBO); + free(p->bufs); + _glthread_UNLOCK_MUTEX(p->mutex); + free(p); + free(pool); +} + + +struct _DriBufferPool * +driBatchPoolInit(int fd, unsigned flags, + unsigned long bufSize, + unsigned numBufs, unsigned checkDelayed) +{ + struct _DriBufferPool *pool; + + pool = (struct _DriBufferPool *) malloc(sizeof(*pool)); + if (!pool) + return NULL; + + pool->data = createBPool(fd, bufSize, numBufs, flags, checkDelayed); + if (!pool->data) + return NULL; + + pool->fd = fd; + pool->map = &pool_map; + pool->unmap = &pool_unmap; + pool->destroy = &pool_destroy; + pool->offset = &pool_offset; + pool->flags = &pool_flags; + pool->size = &pool_size; + pool->create = &pool_create; + pool->fence = &pool_fence; + pool->kernel = &pool_kernel; + pool->validate = &pool_validate; + pool->waitIdle = &pool_waitIdle; + pool->setstatic = NULL; + pool->takeDown = &pool_takedown; + return pool; +} diff --git a/src/mesa/drivers/dri/i915tex/intel_blit.c b/src/mesa/drivers/dri/i915tex/intel_blit.c new file mode 100644 index 00000000000..b6b65439087 --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/intel_blit.c @@ -0,0 +1,552 @@ +/************************************************************************** + * + * Copyright 2003 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. + * + **************************************************************************/ + + +#include +#include + +#include "mtypes.h" +#include "context.h" +#include "enums.h" + +#include "intel_batchbuffer.h" +#include "intel_blit.h" +#include "intel_buffers.h" +#include "intel_context.h" +#include "intel_fbo.h" +#include "intel_reg.h" +#include "intel_regions.h" +#include "vblank.h" + +#define FILE_DEBUG_FLAG DEBUG_BLIT + +/** + * Copy the back color buffer to the front color buffer. + * Used for SwapBuffers(). + */ +void +intelCopyBuffer(const __DRIdrawablePrivate * dPriv, + const drm_clip_rect_t * rect) +{ + + struct intel_context *intel; + const intelScreenPrivate *intelScreen; + GLboolean missed_target; + int64_t ust; + + DBG("%s\n", __FUNCTION__); + + assert(dPriv); + + intel = intelScreenContext(dPriv->driScreenPriv->private); + if (!intel) + return; + + intelScreen = intel->intelScreen; + + if (!rect && !intel->swap_scheduled && intelScreen->drmMinor >= 6 && + !(intel->vblank_flags & VBLANK_FLAG_NO_IRQ) && + intelScreen->current_rotation == 0) { + unsigned int interval = driGetVBlankInterval(dPriv, intel->vblank_flags); + unsigned int target; + drm_i915_vblank_swap_t swap; + + swap.drawable = dPriv->hHWDrawable; + swap.seqtype = DRM_VBLANK_ABSOLUTE; + target = swap.sequence = intel->vbl_seq + interval; + + if (intel->vblank_flags & VBLANK_FLAG_SYNC) { + swap.seqtype |= DRM_VBLANK_NEXTONMISS; + } else if (interval == 0) { + goto noschedule; + } + + if ( intel->vblank_flags & VBLANK_FLAG_SECONDARY ) { + swap.seqtype |= DRM_VBLANK_SECONDARY; + } + + intel_batchbuffer_flush(intel->batch); + + if (!drmCommandWriteRead(intel->driFd, DRM_I915_VBLANK_SWAP, &swap, + sizeof(swap))) { + intel->swap_scheduled = 1; + intel->vbl_seq = swap.sequence; + swap.sequence -= target; + missed_target = swap.sequence > 0 && swap.sequence <= (1 << 23); + } + } else { + intel->swap_scheduled = 0; + } +noschedule: + + if (intel->last_swap_fence) { + driFenceFinish(intel->last_swap_fence, DRM_FENCE_TYPE_EXE, GL_TRUE); + driFenceUnReference(intel->last_swap_fence); + intel->last_swap_fence = NULL; + } + intel->last_swap_fence = intel->first_swap_fence; + intel->first_swap_fence = NULL; + + if (!intel->swap_scheduled) { + if (!rect) { + driWaitForVBlank(dPriv, &intel->vbl_seq, intel->vblank_flags, + &missed_target); + } + + + /* The LOCK_HARDWARE is required for the cliprects. Buffer offsets + * should work regardless. + */ + LOCK_HARDWARE(intel); + + if (intel->driDrawable && intel->driDrawable->numClipRects) { + const intelScreenPrivate *intelScreen = intel->intelScreen; + struct gl_framebuffer *fb + = (struct gl_framebuffer *) dPriv->driverPrivate; + const struct intel_region *frontRegion + = intel_get_rb_region(fb, BUFFER_FRONT_LEFT); + const struct intel_region *backRegion + = intel_get_rb_region(fb, BUFFER_BACK_LEFT); + const int nbox = dPriv->numClipRects; + const drm_clip_rect_t *pbox = dPriv->pClipRects; + const int pitch = frontRegion->pitch; + const int cpp = frontRegion->cpp; + int BR13, CMD; + int i; + + ASSERT(fb); + ASSERT(fb->Name == 0); /* Not a user-created FBO */ + ASSERT(frontRegion); + ASSERT(backRegion); + ASSERT(frontRegion->pitch == backRegion->pitch); + ASSERT(frontRegion->cpp == backRegion->cpp); + + if (cpp == 2) { + BR13 = (pitch * cpp) | (0xCC << 16) | (1 << 24); + CMD = XY_SRC_COPY_BLT_CMD; + } + else { + BR13 = (pitch * cpp) | (0xCC << 16) | (1 << 24) | (1 << 25); + CMD = (XY_SRC_COPY_BLT_CMD | XY_SRC_COPY_BLT_WRITE_ALPHA | + XY_SRC_COPY_BLT_WRITE_RGB); + } + + for (i = 0; i < nbox; i++, pbox++) { + drm_clip_rect_t box; + + if (pbox->x1 > pbox->x2 || + pbox->y1 > pbox->y2 || + pbox->x2 > intelScreen->width || pbox->y2 > intelScreen->height) + continue; + + box = *pbox; + + if (rect) { + if (rect->x1 > box.x1) + box.x1 = rect->x1; + if (rect->y1 > box.y1) + box.y1 = rect->y1; + if (rect->x2 < box.x2) + box.x2 = rect->x2; + if (rect->y2 < box.y2) + box.y2 = rect->y2; + + if (box.x1 > box.x2 || box.y1 > box.y2) + continue; + } + + BEGIN_BATCH(8, INTEL_BATCH_NO_CLIPRECTS); + OUT_BATCH(CMD); + OUT_BATCH(BR13); + OUT_BATCH((pbox->y1 << 16) | pbox->x1); + OUT_BATCH((pbox->y2 << 16) | pbox->x2); + + if (intel->sarea->pf_current_page == 0) + OUT_RELOC(frontRegion->buffer, + DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_WRITE, + DRM_BO_MASK_MEM | DRM_BO_FLAG_WRITE, 0); + else + OUT_RELOC(backRegion->buffer, + DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_WRITE, + DRM_BO_MASK_MEM | DRM_BO_FLAG_WRITE, 0); + OUT_BATCH((pbox->y1 << 16) | pbox->x1); + OUT_BATCH(BR13 & 0xffff); + + if (intel->sarea->pf_current_page == 0) + OUT_RELOC(backRegion->buffer, + DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_READ, + DRM_BO_MASK_MEM | DRM_BO_FLAG_READ, 0); + else + OUT_RELOC(frontRegion->buffer, + DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_READ, + DRM_BO_MASK_MEM | DRM_BO_FLAG_READ, 0); + + ADVANCE_BATCH(); + } + + if (intel->first_swap_fence) + driFenceUnReference(intel->first_swap_fence); + intel->first_swap_fence = intel_batchbuffer_flush(intel->batch); + driFenceReference(intel->first_swap_fence); + } + + UNLOCK_HARDWARE(intel); + } + + if (!rect) { + intel->swap_count++; + (*dri_interface->getUST) (&ust); + if (missed_target) { + intel->swap_missed_count++; + intel->swap_missed_ust = ust - intel->swap_ust; + } + + intel->swap_ust = ust; + } +} + + + + +void +intelEmitFillBlit(struct intel_context *intel, + GLuint cpp, + GLshort dst_pitch, + struct _DriBufferObject *dst_buffer, + GLuint dst_offset, + GLshort x, GLshort y, GLshort w, GLshort h, GLuint color) +{ + GLuint BR13, CMD; + BATCH_LOCALS; + + dst_pitch *= cpp; + + switch (cpp) { + case 1: + case 2: + case 3: + BR13 = dst_pitch | (0xF0 << 16) | (1 << 24); + CMD = XY_COLOR_BLT_CMD; + break; + case 4: + BR13 = dst_pitch | (0xF0 << 16) | (1 << 24) | (1 << 25); + CMD = (XY_COLOR_BLT_CMD | XY_COLOR_BLT_WRITE_ALPHA | + XY_COLOR_BLT_WRITE_RGB); + break; + default: + return; + } + + DBG("%s dst:buf(%p)/%d+%d %d,%d sz:%dx%d\n", + __FUNCTION__, dst_buffer, dst_pitch, dst_offset, x, y, w, h); + + + BEGIN_BATCH(6, INTEL_BATCH_NO_CLIPRECTS); + OUT_BATCH(CMD); + OUT_BATCH(BR13); + OUT_BATCH((y << 16) | x); + OUT_BATCH(((y + h) << 16) | (x + w)); + OUT_RELOC(dst_buffer, DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_WRITE, + DRM_BO_MASK_MEM | DRM_BO_FLAG_WRITE, dst_offset); + OUT_BATCH(color); + ADVANCE_BATCH(); +} + + +/* Copy BitBlt + */ +void +intelEmitCopyBlit(struct intel_context *intel, + GLuint cpp, + GLshort src_pitch, + struct _DriBufferObject *src_buffer, + GLuint src_offset, + GLshort dst_pitch, + struct _DriBufferObject *dst_buffer, + GLuint dst_offset, + GLshort src_x, GLshort src_y, + GLshort dst_x, GLshort dst_y, GLshort w, GLshort h) +{ + GLuint CMD, BR13; + int dst_y2 = dst_y + h; + int dst_x2 = dst_x + w; + BATCH_LOCALS; + + + DBG("%s src:buf(%p)/%d+%d %d,%d dst:buf(%p)/%d+%d %d,%d sz:%dx%d\n", + __FUNCTION__, + src_buffer, src_pitch, src_offset, src_x, src_y, + dst_buffer, dst_pitch, dst_offset, dst_x, dst_y, w, h); + + src_pitch *= cpp; + dst_pitch *= cpp; + + switch (cpp) { + case 1: + case 2: + case 3: + BR13 = (((GLint) dst_pitch) & 0xffff) | (0xCC << 16) | (1 << 24); + CMD = XY_SRC_COPY_BLT_CMD; + break; + case 4: + BR13 = + (((GLint) dst_pitch) & 0xffff) | (0xCC << 16) | (1 << 24) | (1 << + 25); + CMD = + (XY_SRC_COPY_BLT_CMD | XY_SRC_COPY_BLT_WRITE_ALPHA | + XY_SRC_COPY_BLT_WRITE_RGB); + break; + default: + return; + } + + if (dst_y2 < dst_y || dst_x2 < dst_x) { + return; + } + + /* Initial y values don't seem to work with negative pitches. If + * we adjust the offsets manually (below), it seems to work fine. + * + * On the other hand, if we always adjust, the hardware doesn't + * know which blit directions to use, so overlapping copypixels get + * the wrong result. + */ + if (dst_pitch > 0 && src_pitch > 0) { + BEGIN_BATCH(8, INTEL_BATCH_NO_CLIPRECTS); + OUT_BATCH(CMD); + OUT_BATCH(BR13); + OUT_BATCH((dst_y << 16) | dst_x); + OUT_BATCH((dst_y2 << 16) | dst_x2); + OUT_RELOC(dst_buffer, DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_WRITE, + DRM_BO_MASK_MEM | DRM_BO_FLAG_WRITE, dst_offset); + OUT_BATCH((src_y << 16) | src_x); + OUT_BATCH(((GLint) src_pitch & 0xffff)); + OUT_RELOC(src_buffer, DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_READ, + DRM_BO_MASK_MEM | DRM_BO_FLAG_READ, src_offset); + ADVANCE_BATCH(); + } + else { + BEGIN_BATCH(8, INTEL_BATCH_NO_CLIPRECTS); + OUT_BATCH(CMD); + OUT_BATCH(BR13); + OUT_BATCH((0 << 16) | dst_x); + OUT_BATCH((h << 16) | dst_x2); + OUT_RELOC(dst_buffer, DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_WRITE, + DRM_BO_MASK_MEM | DRM_BO_FLAG_WRITE, + dst_offset + dst_y * dst_pitch); + OUT_BATCH((0 << 16) | src_x); + OUT_BATCH(((GLint) src_pitch & 0xffff)); + OUT_RELOC(src_buffer, DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_READ, + DRM_BO_MASK_MEM | DRM_BO_FLAG_READ, + src_offset + src_y * src_pitch); + ADVANCE_BATCH(); + } +} + + +/** + * Use blitting to clear the renderbuffers named by 'flags'. + * Note: we can't use the ctx->DrawBuffer->_ColorDrawBufferMask field + * since that might include software renderbuffers or renderbuffers + * which we're clearing with triangles. + * \param mask bitmask of BUFFER_BIT_* values indicating buffers to clear + */ +void +intelClearWithBlit(GLcontext * ctx, GLbitfield mask) +{ + struct intel_context *intel = intel_context(ctx); + GLuint clear_depth; + GLbitfield skipBuffers = 0; + BATCH_LOCALS; + + DBG("%s %x\n", __FUNCTION__, mask); + + /* + * Compute values for clearing the buffers. + */ + clear_depth = 0; + if (mask & BUFFER_BIT_DEPTH) { + clear_depth = (GLuint) (ctx->DrawBuffer->_DepthMax * ctx->Depth.Clear); + } + if (mask & BUFFER_BIT_STENCIL) { + clear_depth |= (ctx->Stencil.Clear & 0xff) << 24; + } + + /* If clearing both depth and stencil, skip BUFFER_BIT_STENCIL in + * the loop below. + */ + if ((mask & BUFFER_BIT_DEPTH) && (mask & BUFFER_BIT_STENCIL)) { + skipBuffers = BUFFER_BIT_STENCIL; + } + + /* XXX Move this flush/lock into the following conditional? */ + intelFlush(&intel->ctx); + LOCK_HARDWARE(intel); + + if (intel->numClipRects) { + GLint cx, cy, cw, ch; + drm_clip_rect_t clear; + int i; + + /* Get clear bounds after locking */ + cx = ctx->DrawBuffer->_Xmin; + cy = ctx->DrawBuffer->_Ymin; + cw = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin; + ch = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin; + + if (intel->ctx.DrawBuffer->Name == 0) { + /* clearing a window */ + + /* flip top to bottom */ + clear.x1 = cx + intel->drawX; + clear.y1 = intel->driDrawable->y + intel->driDrawable->h - cy - ch; + clear.x2 = clear.x1 + cw; + clear.y2 = clear.y1 + ch; + + /* adjust for page flipping */ + if (intel->sarea->pf_current_page == 1) { + const GLuint tmp = mask; + mask &= ~(BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT); + if (tmp & BUFFER_BIT_FRONT_LEFT) + mask |= BUFFER_BIT_BACK_LEFT; + if (tmp & BUFFER_BIT_BACK_LEFT) + mask |= BUFFER_BIT_FRONT_LEFT; + } + } + else { + /* clearing FBO */ + assert(intel->numClipRects == 1); + assert(intel->pClipRects == &intel->fboRect); + clear.x1 = cx; + clear.y1 = cy; + clear.x2 = clear.x1 + cw; + clear.y2 = clear.y1 + ch; + /* no change to mask */ + } + + for (i = 0; i < intel->numClipRects; i++) { + const drm_clip_rect_t *box = &intel->pClipRects[i]; + drm_clip_rect_t b; + GLuint buf; + GLuint clearMask = mask; /* use copy, since we modify it below */ + GLboolean all = (cw == ctx->DrawBuffer->Width && + ch == ctx->DrawBuffer->Height); + + if (!all) { + intel_intersect_cliprects(&b, &clear, box); + } + else { + b = *box; + } + + if (0) + _mesa_printf("clear %d,%d..%d,%d, mask %x\n", + b.x1, b.y1, b.x2, b.y2, mask); + + /* Loop over all renderbuffers */ + for (buf = 0; buf < BUFFER_COUNT && clearMask; buf++) { + const GLbitfield bufBit = 1 << buf; + if ((clearMask & bufBit) && !(bufBit & skipBuffers)) { + /* OK, clear this renderbuffer */ + const struct intel_renderbuffer *irb + = intel_renderbuffer(ctx->DrawBuffer-> + Attachment[buf].Renderbuffer); + struct _DriBufferObject *write_buffer = + intel_region_buffer(intel->intelScreen, irb->region, + all ? INTEL_WRITE_FULL : + INTEL_WRITE_PART); + + GLuint clearVal; + GLint pitch, cpp; + GLuint BR13, CMD; + + ASSERT(irb); + ASSERT(irb->region); + + pitch = irb->region->pitch; + cpp = irb->region->cpp; + + DBG("%s dst:buf(%p)/%d+%d %d,%d sz:%dx%d\n", + __FUNCTION__, + irb->region->buffer, (pitch * cpp), + irb->region->draw_offset, + b.x1, b.y1, b.x2 - b.x1, b.y2 - b.y1); + + + /* Setup the blit command */ + if (cpp == 4) { + BR13 = (0xF0 << 16) | (pitch * cpp) | (1 << 24) | (1 << 25); + if (buf == BUFFER_DEPTH || buf == BUFFER_STENCIL) { + CMD = XY_COLOR_BLT_CMD; + if (clearMask & BUFFER_BIT_DEPTH) + CMD |= XY_COLOR_BLT_WRITE_RGB; + if (clearMask & BUFFER_BIT_STENCIL) + CMD |= XY_COLOR_BLT_WRITE_ALPHA; + } + else { + /* clearing RGBA */ + CMD = (XY_COLOR_BLT_CMD | + XY_COLOR_BLT_WRITE_ALPHA | + XY_COLOR_BLT_WRITE_RGB); + } + } + else { + ASSERT(cpp == 2 || cpp == 0); + BR13 = (0xF0 << 16) | (pitch * cpp) | (1 << 24); + CMD = XY_COLOR_BLT_CMD; + } + + if (buf == BUFFER_DEPTH || buf == BUFFER_STENCIL) { + clearVal = clear_depth; + } + else { + clearVal = (cpp == 4) + ? intel->ClearColor8888 : intel->ClearColor565; + } + /* + _mesa_debug(ctx, "hardware blit clear buf %d rb id %d\n", + buf, irb->Base.Name); + */ + BEGIN_BATCH(6, INTEL_BATCH_NO_CLIPRECTS); + OUT_BATCH(CMD); + OUT_BATCH(BR13); + OUT_BATCH((b.y1 << 16) | b.x1); + OUT_BATCH((b.y2 << 16) | b.x2); + OUT_RELOC(write_buffer, DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_WRITE, + DRM_BO_MASK_MEM | DRM_BO_FLAG_WRITE, + irb->region->draw_offset); + OUT_BATCH(clearVal); + ADVANCE_BATCH(); + clearMask &= ~bufBit; /* turn off bit, for faster loop exit */ + } + } + } + intel_batchbuffer_flush(intel->batch); + } + + UNLOCK_HARDWARE(intel); +} diff --git a/src/mesa/drivers/dri/i915tex/intel_blit.h b/src/mesa/drivers/dri/i915tex/intel_blit.h new file mode 100644 index 00000000000..ee85c626334 --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/intel_blit.h @@ -0,0 +1,61 @@ +/************************************************************************** + * + * Copyright 2003 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. + * + **************************************************************************/ + +#ifndef INTEL_BLIT_H +#define INTEL_BLIT_H + +#include "intel_context.h" +#include "intel_ioctl.h" +#include "dri_bufmgr.h" + +extern void intelCopyBuffer(const __DRIdrawablePrivate * dpriv, + const drm_clip_rect_t * rect); + +extern void intelClearWithBlit(GLcontext * ctx, GLbitfield mask); + +extern void intelEmitCopyBlit(struct intel_context *intel, + GLuint cpp, + GLshort src_pitch, + struct _DriBufferObject *src_buffer, + GLuint src_offset, + GLshort dst_pitch, + struct _DriBufferObject *dst_buffer, + GLuint dst_offset, + GLshort srcx, GLshort srcy, + GLshort dstx, GLshort dsty, + GLshort w, GLshort h); + +extern void intelEmitFillBlit(struct intel_context *intel, + GLuint cpp, + GLshort dst_pitch, + struct _DriBufferObject *dst_buffer, + GLuint dst_offset, + GLshort x, GLshort y, + GLshort w, GLshort h, GLuint color); + + +#endif diff --git a/src/mesa/drivers/dri/i915tex/intel_buffer_objects.c b/src/mesa/drivers/dri/i915tex/intel_buffer_objects.c new file mode 100644 index 00000000000..31c41d86857 --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/intel_buffer_objects.c @@ -0,0 +1,250 @@ +/************************************************************************** + * + * Copyright 2003 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. + * + **************************************************************************/ + + +#include "imports.h" +#include "mtypes.h" +#include "bufferobj.h" + +#include "intel_context.h" +#include "intel_buffer_objects.h" +#include "intel_regions.h" +#include "dri_bufmgr.h" + +/** + * There is some duplication between mesa's bufferobjects and our + * bufmgr buffers. Both have an integer handle and a hashtable to + * lookup an opaque structure. It would be nice if the handles and + * internal structure where somehow shared. + */ +static struct gl_buffer_object * +intel_bufferobj_alloc(GLcontext * ctx, GLuint name, GLenum target) +{ + struct intel_context *intel = intel_context(ctx); + struct intel_buffer_object *obj = CALLOC_STRUCT(intel_buffer_object); + + _mesa_initialize_buffer_object(&obj->Base, name, target); + + driGenBuffers(intel->intelScreen->regionPool, + "bufferobj", 1, &obj->buffer, 64, 0, 0); + + return &obj->Base; +} + + +/* Break the COW tie to the region. The region gets to keep the data. + */ +void +intel_bufferobj_release_region(struct intel_context *intel, + struct intel_buffer_object *intel_obj) +{ + assert(intel_obj->region->buffer == intel_obj->buffer); + intel_obj->region->pbo = NULL; + intel_obj->region = NULL; + driBOUnReference(intel_obj->buffer); + intel_obj->buffer = NULL; + + /* This leads to a large number of buffer deletion/creation events. + * Currently the drm doesn't like that: + */ + driGenBuffers(intel->intelScreen->regionPool, + "buffer object", 1, &intel_obj->buffer, 64, 0, 0); + driBOData(intel_obj->buffer, intel_obj->Base.Size, NULL, 0); +} + +/* Break the COW tie to the region. Both the pbo and the region end + * up with a copy of the data. + */ +void +intel_bufferobj_cow(struct intel_context *intel, + struct intel_buffer_object *intel_obj) +{ + assert(intel_obj->region); + intel_region_cow(intel->intelScreen, intel_obj->region); +} + + +/** + * Deallocate/free a vertex/pixel buffer object. + * Called via glDeleteBuffersARB(). + */ +static void +intel_bufferobj_free(GLcontext * ctx, struct gl_buffer_object *obj) +{ + struct intel_context *intel = intel_context(ctx); + struct intel_buffer_object *intel_obj = intel_buffer_object(obj); + + assert(intel_obj); + + if (intel_obj->region) { + intel_bufferobj_release_region(intel, intel_obj); + } + else if (intel_obj->buffer) { + driDeleteBuffers(1, &intel_obj->buffer); + } + + _mesa_free(intel_obj); +} + + + +/** + * Allocate space for and store data in a buffer object. Any data that was + * previously stored in the buffer object is lost. If data is NULL, + * memory will be allocated, but no copy will occur. + * Called via glBufferDataARB(). + */ +static void +intel_bufferobj_data(GLcontext * ctx, + GLenum target, + GLsizeiptrARB size, + const GLvoid * data, + GLenum usage, struct gl_buffer_object *obj) +{ + struct intel_context *intel = intel_context(ctx); + struct intel_buffer_object *intel_obj = intel_buffer_object(obj); + + intel_obj->Base.Size = size; + intel_obj->Base.Usage = usage; + + if (intel_obj->region) + intel_bufferobj_release_region(intel, intel_obj); + + driBOData(intel_obj->buffer, size, data, 0); +} + + +/** + * Replace data in a subrange of buffer object. If the data range + * specified by size + offset extends beyond the end of the buffer or + * if data is NULL, no copy is performed. + * Called via glBufferSubDataARB(). + */ +static void +intel_bufferobj_subdata(GLcontext * ctx, + GLenum target, + GLintptrARB offset, + GLsizeiptrARB size, + const GLvoid * data, struct gl_buffer_object *obj) +{ + struct intel_context *intel = intel_context(ctx); + struct intel_buffer_object *intel_obj = intel_buffer_object(obj); + + assert(intel_obj); + + if (intel_obj->region) + intel_bufferobj_cow(intel, intel_obj); + + driBOSubData(intel_obj->buffer, offset, size, data); +} + + +/** + * Called via glGetBufferSubDataARB(). + */ +static void +intel_bufferobj_get_subdata(GLcontext * ctx, + GLenum target, + GLintptrARB offset, + GLsizeiptrARB size, + GLvoid * data, struct gl_buffer_object *obj) +{ + struct intel_buffer_object *intel_obj = intel_buffer_object(obj); + + assert(intel_obj); + driBOGetSubData(intel_obj->buffer, offset, size, data); +} + + + +/** + * Called via glMapBufferARB(). + */ +static void * +intel_bufferobj_map(GLcontext * ctx, + GLenum target, + GLenum access, struct gl_buffer_object *obj) +{ + struct intel_context *intel = intel_context(ctx); + struct intel_buffer_object *intel_obj = intel_buffer_object(obj); + + /* XXX: Translate access to flags arg below: + */ + assert(intel_obj); + + if (intel_obj->region) + intel_bufferobj_cow(intel, intel_obj); + + obj->Pointer = driBOMap(intel_obj->buffer, + DRM_BO_FLAG_READ | DRM_BO_FLAG_WRITE, 0); + return obj->Pointer; +} + + +/** + * Called via glMapBufferARB(). + */ +static GLboolean +intel_bufferobj_unmap(GLcontext * ctx, + GLenum target, struct gl_buffer_object *obj) +{ + struct intel_buffer_object *intel_obj = intel_buffer_object(obj); + + assert(intel_obj); + assert(obj->Pointer); + driBOUnmap(intel_obj->buffer); + obj->Pointer = NULL; + return GL_TRUE; +} + +struct _DriBufferObject * +intel_bufferobj_buffer(struct intel_context *intel, + struct intel_buffer_object *intel_obj, GLuint flag) +{ + if (intel_obj->region) { + if (flag == INTEL_WRITE_PART) + intel_bufferobj_cow(intel, intel_obj); + else if (flag == INTEL_WRITE_FULL) + intel_bufferobj_release_region(intel, intel_obj); + } + + return intel_obj->buffer; +} + +void +intel_bufferobj_init(struct intel_context *intel) +{ + GLcontext *ctx = &intel->ctx; + + ctx->Driver.NewBufferObject = intel_bufferobj_alloc; + ctx->Driver.DeleteBuffer = intel_bufferobj_free; + ctx->Driver.BufferData = intel_bufferobj_data; + ctx->Driver.BufferSubData = intel_bufferobj_subdata; + ctx->Driver.GetBufferSubData = intel_bufferobj_get_subdata; + ctx->Driver.MapBuffer = intel_bufferobj_map; + ctx->Driver.UnmapBuffer = intel_bufferobj_unmap; +} diff --git a/src/mesa/drivers/dri/i915tex/intel_buffer_objects.h b/src/mesa/drivers/dri/i915tex/intel_buffer_objects.h new file mode 100644 index 00000000000..afe9b2f7cf2 --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/intel_buffer_objects.h @@ -0,0 +1,86 @@ + /************************************************************************** + * + * Copyright 2005 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. + * + **************************************************************************/ + +#ifndef INTEL_BUFFEROBJ_H +#define INTEL_BUFFEROBJ_H + +#include "mtypes.h" + +struct intel_context; +struct intel_region; +struct gl_buffer_object; + + +/** + * Intel vertex/pixel buffer object, derived from Mesa's gl_buffer_object. + */ +struct intel_buffer_object +{ + struct gl_buffer_object Base; + struct _DriBufferObject *buffer; /* the low-level buffer manager's buffer handle */ + + struct intel_region *region; /* Is there a zero-copy texture + associated with this (pixel) + buffer object? */ +}; + + +/* Get the bm buffer associated with a GL bufferobject: + */ +struct _DriBufferObject *intel_bufferobj_buffer(struct intel_context *intel, + struct intel_buffer_object + *obj, GLuint flag); + +/* Hook the bufferobject implementation into mesa: + */ +void intel_bufferobj_init(struct intel_context *intel); + + + +/* Are the obj->Name tests necessary? Unfortunately yes, mesa + * allocates a couple of gl_buffer_object structs statically, and + * the Name == 0 test is the only way to identify them and avoid + * casting them erroneously to our structs. + */ +static INLINE struct intel_buffer_object * +intel_buffer_object(struct gl_buffer_object *obj) +{ + if (obj->Name) + return (struct intel_buffer_object *) obj; + else + return NULL; +} + +/* Helpers for zerocopy image uploads. See also intel_regions.h: + */ +void intel_bufferobj_cow(struct intel_context *intel, + struct intel_buffer_object *intel_obj); +void intel_bufferobj_release_region(struct intel_context *intel, + struct intel_buffer_object *intel_obj); + + +#endif diff --git a/src/mesa/drivers/dri/i915tex/intel_buffers.c b/src/mesa/drivers/dri/i915tex/intel_buffers.c new file mode 100644 index 00000000000..a6b32986233 --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/intel_buffers.c @@ -0,0 +1,928 @@ +/************************************************************************** + * + * Copyright 2003 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. + * + **************************************************************************/ + +#include "intel_screen.h" +#include "intel_context.h" +#include "intel_blit.h" +#include "intel_buffers.h" +#include "intel_depthstencil.h" +#include "intel_fbo.h" +#include "intel_tris.h" +#include "intel_regions.h" +#include "intel_batchbuffer.h" +#include "context.h" +#include "utils.h" +#include "framebuffer.h" +#include "swrast/swrast.h" +#include "vblank.h" + + +/** + * XXX move this into a new dri/common/cliprects.c file. + */ +GLboolean +intel_intersect_cliprects(drm_clip_rect_t * dst, + const drm_clip_rect_t * a, + const drm_clip_rect_t * b) +{ + GLint bx = b->x1; + GLint by = b->y1; + GLint bw = b->x2 - bx; + GLint bh = b->y2 - by; + + if (bx < a->x1) + bw -= a->x1 - bx, bx = a->x1; + if (by < a->y1) + bh -= a->y1 - by, by = a->y1; + if (bx + bw > a->x2) + bw = a->x2 - bx; + if (by + bh > a->y2) + bh = a->y2 - by; + if (bw <= 0) + return GL_FALSE; + if (bh <= 0) + return GL_FALSE; + + dst->x1 = bx; + dst->y1 = by; + dst->x2 = bx + bw; + dst->y2 = by + bh; + + return GL_TRUE; +} + +/** + * Return pointer to current color drawing region, or NULL. + */ +struct intel_region * +intel_drawbuf_region(struct intel_context *intel) +{ + struct intel_renderbuffer *irbColor = + intel_renderbuffer(intel->ctx.DrawBuffer->_ColorDrawBuffers[0][0]); + if (irbColor) + return irbColor->region; + else + return NULL; +} + +/** + * Return pointer to current color reading region, or NULL. + */ +struct intel_region * +intel_readbuf_region(struct intel_context *intel) +{ + struct intel_renderbuffer *irb + = intel_renderbuffer(intel->ctx.ReadBuffer->_ColorReadBuffer); + if (irb) + return irb->region; + else + return NULL; +} + + + +/** + * Update the following fields for rendering to a user-created FBO: + * intel->numClipRects + * intel->pClipRects + * intel->drawX + * intel->drawY + */ +static void +intelSetRenderbufferClipRects(struct intel_context *intel) +{ + assert(intel->ctx.DrawBuffer->Width > 0); + assert(intel->ctx.DrawBuffer->Height > 0); + intel->fboRect.x1 = 0; + intel->fboRect.y1 = 0; + intel->fboRect.x2 = intel->ctx.DrawBuffer->Width; + intel->fboRect.y2 = intel->ctx.DrawBuffer->Height; + intel->numClipRects = 1; + intel->pClipRects = &intel->fboRect; + intel->drawX = 0; + intel->drawY = 0; +} + + +/** + * As above, but for rendering to front buffer of a window. + * \sa intelSetRenderbufferClipRects + */ +static void +intelSetFrontClipRects(struct intel_context *intel) +{ + __DRIdrawablePrivate *dPriv = intel->driDrawable; + + if (!dPriv) + return; + + intel->numClipRects = dPriv->numClipRects; + intel->pClipRects = dPriv->pClipRects; + intel->drawX = dPriv->x; + intel->drawY = dPriv->y; +} + + +/** + * As above, but for rendering to back buffer of a window. + */ +static void +intelSetBackClipRects(struct intel_context *intel) +{ + __DRIdrawablePrivate *dPriv = intel->driDrawable; + + if (!dPriv) + return; + + if (intel->sarea->pf_enabled == 0 && dPriv->numBackClipRects == 0) { + /* use the front clip rects */ + intel->numClipRects = dPriv->numClipRects; + intel->pClipRects = dPriv->pClipRects; + intel->drawX = dPriv->x; + intel->drawY = dPriv->y; + } + else { + /* use the back clip rects */ + intel->numClipRects = dPriv->numBackClipRects; + intel->pClipRects = dPriv->pBackClipRects; + intel->drawX = dPriv->backX; + intel->drawY = dPriv->backY; + } +} + + +/** + * This will be called whenever the currently bound window is moved/resized. + * XXX: actually, it seems to NOT be called when the window is only moved (BP). + */ +void +intelWindowMoved(struct intel_context *intel) +{ + GLcontext *ctx = &intel->ctx; + + if (!intel->ctx.DrawBuffer) { + /* when would this happen? -BP */ + intelSetFrontClipRects(intel); + } + else if (intel->ctx.DrawBuffer->Name != 0) { + /* drawing to user-created FBO - do nothing */ + /* Cliprects would be set from intelDrawBuffer() */ + } + else { + /* drawing to a window */ + switch (intel->ctx.DrawBuffer->_ColorDrawBufferMask[0]) { + case BUFFER_BIT_FRONT_LEFT: + intelSetFrontClipRects(intel); + break; + case BUFFER_BIT_BACK_LEFT: + intelSetBackClipRects(intel); + break; + default: + /* glDrawBuffer(GL_NONE or GL_FRONT_AND_BACK): software fallback */ + intelSetFrontClipRects(intel); + } + } + + /* this update Mesa's notion of window size */ + if (ctx->WinSysDrawBuffer) { + _mesa_resize_framebuffer(ctx, ctx->WinSysDrawBuffer, + intel->driDrawable->w, intel->driDrawable->h); + } + + if (intel->intelScreen->driScrnPriv->ddxMinor >= 7 && intel->driDrawable) { + __DRIdrawablePrivate *dPriv = intel->driDrawable; + drmI830Sarea *sarea = intel->sarea; + drm_clip_rect_t drw_rect = { .x1 = dPriv->x, .x2 = dPriv->x + dPriv->w, + .y1 = dPriv->y, .y2 = dPriv->y + dPriv->h }; + drm_clip_rect_t pipeA_rect = { .x1 = sarea->pipeA_x, .y1 = sarea->pipeA_y, + .x2 = sarea->pipeA_x + sarea->pipeA_w, + .y2 = sarea->pipeA_y + sarea->pipeA_h }; + drm_clip_rect_t pipeB_rect = { .x1 = sarea->pipeB_x, .y1 = sarea->pipeB_y, + .x2 = sarea->pipeB_x + sarea->pipeB_w, + .y2 = sarea->pipeB_y + sarea->pipeB_h }; + GLint areaA = driIntersectArea( drw_rect, pipeA_rect ); + GLint areaB = driIntersectArea( drw_rect, pipeB_rect ); + GLuint flags = intel->vblank_flags; + + if (areaB > areaA || (areaA == areaB && areaB > 0)) { + flags = intel->vblank_flags | VBLANK_FLAG_SECONDARY; + } else { + flags = intel->vblank_flags & ~VBLANK_FLAG_SECONDARY; + } + + if (flags != intel->vblank_flags) { + intel->vblank_flags = flags; + driGetCurrentVBlank(dPriv, intel->vblank_flags, &intel->vbl_seq); + } + } else { + intel->vblank_flags &= ~VBLANK_FLAG_SECONDARY; + } + + /* Update hardware scissor */ + ctx->Driver.Scissor(ctx, ctx->Scissor.X, ctx->Scissor.Y, + ctx->Scissor.Width, ctx->Scissor.Height); +} + + + +/* A true meta version of this would be very simple and additionally + * machine independent. Maybe we'll get there one day. + */ +static void +intelClearWithTris(struct intel_context *intel, GLbitfield mask) +{ + GLcontext *ctx = &intel->ctx; + drm_clip_rect_t clear; + + if (INTEL_DEBUG & DEBUG_BLIT) + _mesa_printf("%s 0x%x\n", __FUNCTION__, mask); + + LOCK_HARDWARE(intel); + + /* XXX FBO: was: intel->driDrawable->numClipRects */ + if (intel->numClipRects) { + GLint cx, cy, cw, ch; + GLuint buf; + + intel->vtbl.install_meta_state(intel); + + /* Get clear bounds after locking */ + cx = ctx->DrawBuffer->_Xmin; + cy = ctx->DrawBuffer->_Ymin; + ch = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin; + cw = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin; + + /* note: regardless of 'all', cx, cy, cw, ch are now correct */ + clear.x1 = cx; + clear.y1 = cy; + clear.x2 = cx + cw; + clear.y2 = cy + ch; + + /* Back and stencil cliprects are the same. Try and do both + * buffers at once: + */ + if (mask & + (BUFFER_BIT_BACK_LEFT | BUFFER_BIT_STENCIL | BUFFER_BIT_DEPTH)) { + struct intel_region *backRegion = + intel_get_rb_region(ctx->DrawBuffer, BUFFER_BACK_LEFT); + struct intel_region *depthRegion = + intel_get_rb_region(ctx->DrawBuffer, BUFFER_DEPTH); + const GLuint clearColor = (backRegion && backRegion->cpp == 4) + ? intel->ClearColor8888 : intel->ClearColor565; + + intel->vtbl.meta_draw_region(intel, backRegion, depthRegion); + + if (mask & BUFFER_BIT_BACK_LEFT) + intel->vtbl.meta_color_mask(intel, GL_TRUE); + else + intel->vtbl.meta_color_mask(intel, GL_FALSE); + + if (mask & BUFFER_BIT_STENCIL) + intel->vtbl.meta_stencil_replace(intel, + intel->ctx.Stencil.WriteMask[0], + intel->ctx.Stencil.Clear); + else + intel->vtbl.meta_no_stencil_write(intel); + + if (mask & BUFFER_BIT_DEPTH) + intel->vtbl.meta_depth_replace(intel); + else + intel->vtbl.meta_no_depth_write(intel); + + /* XXX: Using INTEL_BATCH_NO_CLIPRECTS here is dangerous as the + * drawing origin may not be correctly emitted. + */ + intel_meta_draw_quad(intel, clear.x1, clear.x2, clear.y1, clear.y2, intel->ctx.Depth.Clear, clearColor, 0, 0, 0, 0); /* texcoords */ + + mask &= + ~(BUFFER_BIT_BACK_LEFT | BUFFER_BIT_STENCIL | BUFFER_BIT_DEPTH); + } + + /* clear the remaining (color) renderbuffers */ + for (buf = 0; buf < BUFFER_COUNT && mask; buf++) { + const GLuint bufBit = 1 << buf; + if (mask & bufBit) { + struct intel_renderbuffer *irbColor = + intel_renderbuffer(ctx->DrawBuffer-> + Attachment[buf].Renderbuffer); + GLuint color = (irbColor->region->cpp == 4) + ? intel->ClearColor8888 : intel->ClearColor565; + + ASSERT(irbColor); + + intel->vtbl.meta_no_depth_write(intel); + intel->vtbl.meta_no_stencil_write(intel); + intel->vtbl.meta_color_mask(intel, GL_TRUE); + intel->vtbl.meta_draw_region(intel, irbColor->region, NULL); + + /* XXX: Using INTEL_BATCH_NO_CLIPRECTS here is dangerous as the + * drawing origin may not be correctly emitted. + */ + intel_meta_draw_quad(intel, clear.x1, clear.x2, clear.y1, clear.y2, 0, /* depth clear val */ + color, 0, 0, 0, 0); /* texcoords */ + + mask &= ~bufBit; + } + } + + intel->vtbl.leave_meta_state(intel); + intel_batchbuffer_flush(intel->batch); + } + UNLOCK_HARDWARE(intel); +} + + + + +/** + * Copy the window contents named by dPriv to the rotated (or reflected) + * color buffer. + * srcBuf is BUFFER_BIT_FRONT_LEFT or BUFFER_BIT_BACK_LEFT to indicate the source. + */ +void +intelRotateWindow(struct intel_context *intel, + __DRIdrawablePrivate * dPriv, GLuint srcBuf) +{ + intelScreenPrivate *screen = intel->intelScreen; + drm_clip_rect_t fullRect; + struct intel_region *src; + const drm_clip_rect_t *clipRects; + int numClipRects; + int i; + GLenum format, type; + + int xOrig, yOrig; + int origNumClipRects; + drm_clip_rect_t *origRects; + + /* + * set up hardware state + */ + intelFlush(&intel->ctx); + + LOCK_HARDWARE(intel); + + if (!intel->numClipRects) { + UNLOCK_HARDWARE(intel); + return; + } + + intel->vtbl.install_meta_state(intel); + + intel->vtbl.meta_no_depth_write(intel); + intel->vtbl.meta_no_stencil_write(intel); + intel->vtbl.meta_color_mask(intel, GL_FALSE); + + + /* save current drawing origin and cliprects (restored at end) */ + xOrig = intel->drawX; + yOrig = intel->drawY; + origNumClipRects = intel->numClipRects; + origRects = intel->pClipRects; + + /* + * set drawing origin, cliprects for full-screen access to rotated screen + */ + fullRect.x1 = 0; + fullRect.y1 = 0; + fullRect.x2 = screen->rotatedWidth; + fullRect.y2 = screen->rotatedHeight; + intel->drawX = 0; + intel->drawY = 0; + intel->numClipRects = 1; + intel->pClipRects = &fullRect; + + intel->vtbl.meta_draw_region(intel, screen->rotated_region, NULL); /* ? */ + + if (srcBuf == BUFFER_BIT_FRONT_LEFT) { + src = intel->intelScreen->front_region; + clipRects = dPriv->pClipRects; + numClipRects = dPriv->numClipRects; + } + else { + src = intel->intelScreen->back_region; + clipRects = dPriv->pBackClipRects; + numClipRects = dPriv->numBackClipRects; + } + + if (src->cpp == 4) { + format = GL_BGRA; + type = GL_UNSIGNED_BYTE; + } + else { + format = GL_BGR; + type = GL_UNSIGNED_SHORT_5_6_5_REV; + } + + /* set the whole screen up as a texture to avoid alignment issues */ + intel->vtbl.meta_tex_rect_source(intel, + src->buffer, + screen->width, + screen->height, src->pitch, format, type); + + intel->vtbl.meta_texture_blend_replace(intel); + + /* + * loop over the source window's cliprects + */ + for (i = 0; i < numClipRects; i++) { + int srcX0 = clipRects[i].x1; + int srcY0 = clipRects[i].y1; + int srcX1 = clipRects[i].x2; + int srcY1 = clipRects[i].y2; + GLfloat verts[4][2], tex[4][2]; + int j; + + /* build vertices for four corners of clip rect */ + verts[0][0] = srcX0; + verts[0][1] = srcY0; + verts[1][0] = srcX1; + verts[1][1] = srcY0; + verts[2][0] = srcX1; + verts[2][1] = srcY1; + verts[3][0] = srcX0; + verts[3][1] = srcY1; + + /* .. and texcoords */ + tex[0][0] = srcX0; + tex[0][1] = srcY0; + tex[1][0] = srcX1; + tex[1][1] = srcY0; + tex[2][0] = srcX1; + tex[2][1] = srcY1; + tex[3][0] = srcX0; + tex[3][1] = srcY1; + + /* transform coords to rotated screen coords */ + + for (j = 0; j < 4; j++) { + matrix23TransformCoordf(&screen->rotMatrix, + &verts[j][0], &verts[j][1]); + } + + /* draw polygon to map source image to dest region */ + intel_meta_draw_poly(intel, 4, verts, 0, 0, tex); + + } /* cliprect loop */ + + intel->vtbl.leave_meta_state(intel); + intel_batchbuffer_flush(intel->batch); + + /* restore original drawing origin and cliprects */ + intel->drawX = xOrig; + intel->drawY = yOrig; + intel->numClipRects = origNumClipRects; + intel->pClipRects = origRects; + + UNLOCK_HARDWARE(intel); +} + + +/** + * Called by ctx->Driver.Clear. + */ +static void +intelClear(GLcontext *ctx, GLbitfield mask) +{ + struct intel_context *intel = intel_context(ctx); + const GLuint colorMask = *((GLuint *) & ctx->Color.ColorMask); + GLbitfield tri_mask = 0; + GLbitfield blit_mask = 0; + GLbitfield swrast_mask = 0; + GLuint i; + + if (0) + fprintf(stderr, "%s\n", __FUNCTION__); + + /* HW color buffers (front, back, aux, generic FBO, etc) */ + if (colorMask == ~0) { + /* clear all R,G,B,A */ + /* XXX FBO: need to check if colorbuffers are software RBOs! */ + blit_mask |= (mask & BUFFER_BITS_COLOR); + } + else { + /* glColorMask in effect */ + tri_mask |= (mask & BUFFER_BITS_COLOR); + } + + /* HW stencil */ + if (mask & BUFFER_BIT_STENCIL) { + const struct intel_region *stencilRegion + = intel_get_rb_region(ctx->DrawBuffer, BUFFER_STENCIL); + if (stencilRegion) { + /* have hw stencil */ + if ((ctx->Stencil.WriteMask[0] & 0xff) != 0xff) { + /* not clearing all stencil bits, so use triangle clearing */ + tri_mask |= BUFFER_BIT_STENCIL; + } + else { + /* clearing all stencil bits, use blitting */ + blit_mask |= BUFFER_BIT_STENCIL; + } + } + } + + /* HW depth */ + if (mask & BUFFER_BIT_DEPTH) { + /* clear depth with whatever method is used for stencil (see above) */ + if (tri_mask & BUFFER_BIT_STENCIL) + tri_mask |= BUFFER_BIT_DEPTH; + else + blit_mask |= BUFFER_BIT_DEPTH; + } + + /* SW fallback clearing */ + swrast_mask = mask & ~tri_mask & ~blit_mask; + + for (i = 0; i < BUFFER_COUNT; i++) { + GLuint bufBit = 1 << i; + if ((blit_mask | tri_mask) & bufBit) { + if (!ctx->DrawBuffer->Attachment[i].Renderbuffer->ClassID) { + blit_mask &= ~bufBit; + tri_mask &= ~bufBit; + swrast_mask |= bufBit; + } + } + } + + + intelFlush(ctx); /* XXX intelClearWithBlit also does this */ + + if (blit_mask) + intelClearWithBlit(ctx, blit_mask); + + if (tri_mask) + intelClearWithTris(intel, tri_mask); + + if (swrast_mask) + _swrast_Clear(ctx, swrast_mask); +} + + + +/* Flip the front & back buffers + */ +static void +intelPageFlip(const __DRIdrawablePrivate * dPriv) +{ +#if 0 + struct intel_context *intel; + int tmp, ret; + + if (INTEL_DEBUG & DEBUG_IOCTL) + fprintf(stderr, "%s\n", __FUNCTION__); + + assert(dPriv); + assert(dPriv->driContextPriv); + assert(dPriv->driContextPriv->driverPrivate); + + intel = (struct intel_context *) dPriv->driContextPriv->driverPrivate; + + intelFlush(&intel->ctx); + LOCK_HARDWARE(intel); + + if (dPriv->pClipRects) { + *(drm_clip_rect_t *) intel->sarea->boxes = dPriv->pClipRects[0]; + intel->sarea->nbox = 1; + } + + ret = drmCommandNone(intel->driFd, DRM_I830_FLIP); + if (ret) { + fprintf(stderr, "%s: %d\n", __FUNCTION__, ret); + UNLOCK_HARDWARE(intel); + exit(1); + } + + tmp = intel->sarea->last_enqueue; + intelRefillBatchLocked(intel); + UNLOCK_HARDWARE(intel); + + + intelSetDrawBuffer(&intel->ctx, intel->ctx.Color.DriverDrawBuffer); +#endif +} + +#if 0 +void +intelSwapBuffers(__DRIdrawablePrivate * dPriv) +{ + if (dPriv->driverPrivate) { + const struct gl_framebuffer *fb + = (struct gl_framebuffer *) dPriv->driverPrivate; + if (fb->Visual.doubleBufferMode) { + GET_CURRENT_CONTEXT(ctx); + if (ctx && ctx->DrawBuffer == fb) { + _mesa_notifySwapBuffers(ctx); /* flush pending rendering */ + } + if (0 /*intel->doPageFlip */ ) { /* doPageFlip is never set !!! */ + intelPageFlip(dPriv); + } + else { + intelCopyBuffer(dPriv); + } + } + } + else { + _mesa_problem(NULL, + "dPriv has no gl_framebuffer pointer in intelSwapBuffers"); + } +} +#else +/* Trunk version: + */ +void +intelSwapBuffers(__DRIdrawablePrivate * dPriv) +{ + if (dPriv->driContextPriv && dPriv->driContextPriv->driverPrivate) { + GET_CURRENT_CONTEXT(ctx); + struct intel_context *intel; + + if (ctx == NULL) + return; + + intel = intel_context(ctx); + + if (ctx->Visual.doubleBufferMode) { + intelScreenPrivate *screen = intel->intelScreen; + _mesa_notifySwapBuffers(ctx); /* flush pending rendering comands */ + if (0 /*intel->doPageFlip */ ) { /* doPageFlip is never set !!! */ + intelPageFlip(dPriv); + } + else { + intelCopyBuffer(dPriv, NULL); + } + if (screen->current_rotation != 0) { + intelRotateWindow(intel, dPriv, BUFFER_BIT_FRONT_LEFT); + } + } + } + else { + /* XXX this shouldn't be an error but we can't handle it for now */ + fprintf(stderr, "%s: drawable has no context!\n", __FUNCTION__); + } +} +#endif + +void +intelCopySubBuffer(__DRIdrawablePrivate * dPriv, int x, int y, int w, int h) +{ + if (dPriv->driContextPriv && dPriv->driContextPriv->driverPrivate) { + struct intel_context *intel = + (struct intel_context *) dPriv->driContextPriv->driverPrivate; + GLcontext *ctx = &intel->ctx; + + if (ctx->Visual.doubleBufferMode) { + drm_clip_rect_t rect; + rect.x1 = x + dPriv->x; + rect.y1 = (dPriv->h - y - h) + dPriv->y; + rect.x2 = rect.x1 + w; + rect.y2 = rect.y1 + h; + _mesa_notifySwapBuffers(ctx); /* flush pending rendering comands */ + intelCopyBuffer(dPriv, &rect); + } + } + else { + /* XXX this shouldn't be an error but we can't handle it for now */ + fprintf(stderr, "%s: drawable has no context!\n", __FUNCTION__); + } +} + + +/** + * Update the hardware state for drawing into a window or framebuffer object. + * + * Called by glDrawBuffer, glBindFramebufferEXT, MakeCurrent, and other + * places within the driver. + * + * Basically, this needs to be called any time the current framebuffer + * changes, the renderbuffers change, or we need to draw into different + * color buffers. + */ +void +intel_draw_buffer(GLcontext * ctx, struct gl_framebuffer *fb) +{ + struct intel_context *intel = intel_context(ctx); + struct intel_region *colorRegion, *depthRegion = NULL; + struct intel_renderbuffer *irbDepth = NULL, *irbStencil = NULL; + int front = 0; /* drawing to front color buffer? */ + + if (!fb) { + /* this can happen during the initial context initialization */ + return; + } + + /* Do this here, note core Mesa, since this function is called from + * many places within the driver. + */ + if (ctx->NewState & (_NEW_BUFFERS | _NEW_COLOR | _NEW_PIXEL)) { + /* this updates the DrawBuffer->_NumColorDrawBuffers fields, etc */ + _mesa_update_framebuffer(ctx); + /* this updates the DrawBuffer's Width/Height if it's a FBO */ + _mesa_update_draw_buffer_bounds(ctx); + } + + if (fb->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) { + /* this may occur when we're called by glBindFrameBuffer() during + * the process of someone setting up renderbuffers, etc. + */ + /*_mesa_debug(ctx, "DrawBuffer: incomplete user FBO\n");*/ + return; + } + + if (fb->Name) + intel_validate_paired_depth_stencil(ctx, fb); + + /* + * How many color buffers are we drawing into? + */ + if (fb->_NumColorDrawBuffers[0] != 1 +#if 0 + /* XXX FBO temporary - always use software rendering */ + || 1 +#endif + ) { + /* writing to 0 or 2 or 4 color buffers */ + /*_mesa_debug(ctx, "Software rendering\n");*/ + FALLBACK(intel, INTEL_FALLBACK_DRAW_BUFFER, GL_TRUE); + front = 1; /* might not have back color buffer */ + } + else { + /* draw to exactly one color buffer */ + /*_mesa_debug(ctx, "Hardware rendering\n");*/ + FALLBACK(intel, INTEL_FALLBACK_DRAW_BUFFER, GL_FALSE); + if (fb->_ColorDrawBufferMask[0] == BUFFER_BIT_FRONT_LEFT) { + front = 1; + } + } + + /* + * Get the intel_renderbuffer for the colorbuffer we're drawing into. + * And set up cliprects. + */ + if (fb->Name == 0) { + /* drawing to window system buffer */ + if (intel->sarea->pf_current_page == 1) { + /* page flipped back/front */ + front ^= 1; + } + if (front) { + intelSetFrontClipRects(intel); + colorRegion = intel_get_rb_region(fb, BUFFER_FRONT_LEFT); + } + else { + intelSetBackClipRects(intel); + colorRegion = intel_get_rb_region(fb, BUFFER_BACK_LEFT); + } + } + else { + /* drawing to user-created FBO */ + struct intel_renderbuffer *irb; + intelSetRenderbufferClipRects(intel); + irb = intel_renderbuffer(fb->_ColorDrawBuffers[0][0]); + colorRegion = (irb && irb->region) ? irb->region : NULL; + } + + /* Update culling direction which changes depending on the + * orientation of the buffer: + */ + if (ctx->Driver.FrontFace) + ctx->Driver.FrontFace(ctx, ctx->Polygon.FrontFace); + else + ctx->NewState |= _NEW_POLYGON; + + if (!colorRegion) { + FALLBACK(intel, INTEL_FALLBACK_DRAW_BUFFER, GL_TRUE); + } + else { + FALLBACK(intel, INTEL_FALLBACK_DRAW_BUFFER, GL_FALSE); + } + + /*** + *** Get depth buffer region and check if we need a software fallback. + *** Note that the depth buffer is usually a DEPTH_STENCIL buffer. + ***/ + if (fb->_DepthBuffer && fb->_DepthBuffer->Wrapped) { + irbDepth = intel_renderbuffer(fb->_DepthBuffer->Wrapped); + if (irbDepth && irbDepth->region) { + FALLBACK(intel, INTEL_FALLBACK_DEPTH_BUFFER, GL_FALSE); + depthRegion = irbDepth->region; + } + else { + FALLBACK(intel, INTEL_FALLBACK_DEPTH_BUFFER, GL_TRUE); + depthRegion = NULL; + } + } + else { + /* not using depth buffer */ + FALLBACK(intel, INTEL_FALLBACK_DEPTH_BUFFER, GL_FALSE); + depthRegion = NULL; + } + + /*** + *** Stencil buffer + *** This can only be hardware accelerated if we're using a + *** combined DEPTH_STENCIL buffer (for now anyway). + ***/ + if (fb->_StencilBuffer && fb->_StencilBuffer->Wrapped) { + irbStencil = intel_renderbuffer(fb->_StencilBuffer->Wrapped); + if (irbStencil && irbStencil->region) { + ASSERT(irbStencil->Base._ActualFormat == GL_DEPTH24_STENCIL8_EXT); + FALLBACK(intel, INTEL_FALLBACK_STENCIL_BUFFER, GL_FALSE); + /* need to re-compute stencil hw state */ + ctx->Driver.Enable(ctx, GL_STENCIL_TEST, ctx->Stencil.Enabled); + if (!depthRegion) + depthRegion = irbStencil->region; + } + else { + FALLBACK(intel, INTEL_FALLBACK_STENCIL_BUFFER, GL_TRUE); + } + } + else { + /* XXX FBO: instead of FALSE, pass ctx->Stencil.Enabled ??? */ + FALLBACK(intel, INTEL_FALLBACK_STENCIL_BUFFER, GL_FALSE); + /* need to re-compute stencil hw state */ + ctx->Driver.Enable(ctx, GL_STENCIL_TEST, ctx->Stencil.Enabled); + } + + + /** + ** Release old regions, reference new regions + **/ +#if 0 /* XXX FBO: this seems to be redundant with i915_state_draw_region() */ + if (intel->draw_region != colorRegion) { + intel_region_release(&intel->draw_region); + intel_region_reference(&intel->draw_region, colorRegion); + } + if (intel->intelScreen->depth_region != depthRegion) { + intel_region_release(&intel->intelScreen->depth_region); + intel_region_reference(&intel->intelScreen->depth_region, depthRegion); + } +#endif + + intel->vtbl.set_draw_region(intel, colorRegion, depthRegion); + + /* update viewport since it depends on window size */ + ctx->Driver.Viewport(ctx, ctx->Viewport.X, ctx->Viewport.Y, + ctx->Viewport.Width, ctx->Viewport.Height); + + /* Update hardware scissor */ + ctx->Driver.Scissor(ctx, ctx->Scissor.X, ctx->Scissor.Y, + ctx->Scissor.Width, ctx->Scissor.Height); +} + + +static void +intelDrawBuffer(GLcontext * ctx, GLenum mode) +{ + intel_draw_buffer(ctx, ctx->DrawBuffer); +} + + +static void +intelReadBuffer(GLcontext * ctx, GLenum mode) +{ + if (ctx->ReadBuffer == ctx->DrawBuffer) { + /* This will update FBO completeness status. + * A framebuffer will be incomplete if the GL_READ_BUFFER setting + * refers to a missing renderbuffer. Calling glReadBuffer can set + * that straight and can make the drawing buffer complete. + */ + intel_draw_buffer(ctx, ctx->DrawBuffer); + } + /* Generally, functions which read pixels (glReadPixels, glCopyPixels, etc) + * reference ctx->ReadBuffer and do appropriate state checks. + */ +} + + +void +intelInitBufferFuncs(struct dd_function_table *functions) +{ + functions->Clear = intelClear; + functions->DrawBuffer = intelDrawBuffer; + functions->ReadBuffer = intelReadBuffer; +} diff --git a/src/mesa/drivers/dri/i915tex/intel_buffers.h b/src/mesa/drivers/dri/i915tex/intel_buffers.h new file mode 100644 index 00000000000..0faf0553474 --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/intel_buffers.h @@ -0,0 +1,56 @@ +/************************************************************************** + * + * Copyright 2006 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. + * + **************************************************************************/ + +#ifndef INTEL_BUFFERS_H +#define INTEL_BUFFERS_H + + +struct intel_context; + + +extern GLboolean +intel_intersect_cliprects(drm_clip_rect_t * dest, + const drm_clip_rect_t * a, + const drm_clip_rect_t * b); + +extern struct intel_region *intel_readbuf_region(struct intel_context *intel); + +extern struct intel_region *intel_drawbuf_region(struct intel_context *intel); + +extern void intelSwapBuffers(__DRIdrawablePrivate * dPriv); + +extern void intelWindowMoved(struct intel_context *intel); + +extern void intel_draw_buffer(GLcontext * ctx, struct gl_framebuffer *fb); + +extern void intelInitBufferFuncs(struct dd_function_table *functions); + +extern void +intelRotateWindow(struct intel_context *intel, + __DRIdrawablePrivate * dPriv, GLuint srcBuf); + +#endif /* INTEL_BUFFERS_H */ diff --git a/src/mesa/drivers/dri/i915tex/intel_context.c b/src/mesa/drivers/dri/i915tex/intel_context.c new file mode 100644 index 00000000000..c77d365360d --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/intel_context.c @@ -0,0 +1,714 @@ +/************************************************************************** + * + * Copyright 2003 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. + * + **************************************************************************/ + + +#include "glheader.h" +#include "context.h" +#include "matrix.h" +#include "simple_list.h" +#include "extensions.h" +#include "framebuffer.h" +#include "imports.h" + +#include "swrast/swrast.h" +#include "swrast_setup/swrast_setup.h" +#include "tnl/tnl.h" +#include "array_cache/acache.h" + +#include "tnl/t_pipeline.h" +#include "tnl/t_vertex.h" + +#include "drivers/common/driverfuncs.h" + +#include "intel_screen.h" + +#include "i830_dri.h" + +#include "intel_buffers.h" +#include "intel_tex.h" +#include "intel_span.h" +#include "intel_tris.h" +#include "intel_ioctl.h" +#include "intel_batchbuffer.h" +#include "intel_blit.h" +#include "intel_pixel.h" +#include "intel_regions.h" +#include "intel_buffer_objects.h" +#include "intel_fbo.h" + +#include "vblank.h" +#include "utils.h" +#include "xmlpool.h" /* for symbolic values of enum-type options */ +#ifndef INTEL_DEBUG +int INTEL_DEBUG = (0); +#endif + +#define need_GL_ARB_multisample +#define need_GL_ARB_point_parameters +#define need_GL_ARB_texture_compression +#define need_GL_ARB_vertex_buffer_object +#define need_GL_ARB_vertex_program +#define need_GL_ARB_window_pos +#define need_GL_EXT_blend_color +#define need_GL_EXT_blend_equation_separate +#define need_GL_EXT_blend_func_separate +#define need_GL_EXT_blend_minmax +#define need_GL_EXT_cull_vertex +#define need_GL_EXT_fog_coord +#define need_GL_EXT_framebuffer_object +#define need_GL_EXT_multi_draw_arrays +#define need_GL_EXT_secondary_color +#define need_GL_NV_vertex_program +#include "extension_helper.h" + + +#define DRIVER_DATE "20061102" + +_glthread_Mutex lockMutex; +static GLboolean lockMutexInit = GL_FALSE; + + +static const GLubyte * +intelGetString(GLcontext * ctx, GLenum name) +{ + const char *chipset; + static char buffer[128]; + + switch (name) { + case GL_VENDOR: + return (GLubyte *) "Tungsten Graphics, Inc"; + break; + + case GL_RENDERER: + switch (intel_context(ctx)->intelScreen->deviceID) { + case PCI_CHIP_845_G: + chipset = "Intel(R) 845G"; + break; + case PCI_CHIP_I830_M: + chipset = "Intel(R) 830M"; + break; + case PCI_CHIP_I855_GM: + chipset = "Intel(R) 852GM/855GM"; + break; + case PCI_CHIP_I865_G: + chipset = "Intel(R) 865G"; + break; + case PCI_CHIP_I915_G: + chipset = "Intel(R) 915G"; + break; + case PCI_CHIP_I915_GM: + chipset = "Intel(R) 915GM"; + break; + case PCI_CHIP_I945_G: + chipset = "Intel(R) 945G"; + break; + case PCI_CHIP_I945_GM: + chipset = "Intel(R) 945GM"; + break; + default: + chipset = "Unknown Intel Chipset"; + break; + } + + (void) driGetRendererString(buffer, chipset, DRIVER_DATE, 0); + return (GLubyte *) buffer; + + default: + return NULL; + } +} + + +/** + * Extension strings exported by the intel driver. + * + * \note + * It appears that ARB_texture_env_crossbar has "disappeared" compared to the + * old i830-specific driver. + */ +const struct dri_extension card_extensions[] = { + {"GL_ARB_multisample", GL_ARB_multisample_functions}, + {"GL_ARB_multitexture", NULL}, + {"GL_ARB_point_parameters", GL_ARB_point_parameters_functions}, + {"GL_ARB_texture_border_clamp", NULL}, + {"GL_ARB_texture_compression", GL_ARB_texture_compression_functions}, + {"GL_ARB_texture_cube_map", NULL}, + {"GL_ARB_texture_env_add", NULL}, + {"GL_ARB_texture_env_combine", NULL}, + {"GL_ARB_texture_env_dot3", NULL}, + {"GL_ARB_texture_mirrored_repeat", NULL}, + {"GL_ARB_texture_rectangle", NULL}, + {"GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions}, + {"GL_ARB_pixel_buffer_object", NULL}, + {"GL_ARB_vertex_program", GL_ARB_vertex_program_functions}, + {"GL_ARB_window_pos", GL_ARB_window_pos_functions}, + {"GL_EXT_blend_color", GL_EXT_blend_color_functions}, + {"GL_EXT_blend_equation_separate", + GL_EXT_blend_equation_separate_functions}, + {"GL_EXT_blend_func_separate", GL_EXT_blend_func_separate_functions}, + {"GL_EXT_blend_minmax", GL_EXT_blend_minmax_functions}, + {"GL_EXT_blend_subtract", NULL}, + {"GL_EXT_cull_vertex", GL_EXT_cull_vertex_functions}, + {"GL_EXT_fog_coord", GL_EXT_fog_coord_functions}, + {"GL_EXT_framebuffer_object", GL_EXT_framebuffer_object_functions}, + {"GL_EXT_multi_draw_arrays", GL_EXT_multi_draw_arrays_functions}, +#if 1 /* XXX FBO temporary? */ + {"GL_EXT_packed_depth_stencil", NULL}, +#endif + {"GL_EXT_secondary_color", GL_EXT_secondary_color_functions}, + {"GL_EXT_stencil_wrap", NULL}, + {"GL_EXT_texture_edge_clamp", NULL}, + {"GL_EXT_texture_env_combine", NULL}, + {"GL_EXT_texture_env_dot3", NULL}, + {"GL_EXT_texture_filter_anisotropic", NULL}, + {"GL_EXT_texture_lod_bias", NULL}, + {"GL_3DFX_texture_compression_FXT1", NULL}, + {"GL_APPLE_client_storage", NULL}, + {"GL_MESA_pack_invert", NULL}, + {"GL_MESA_ycbcr_texture", NULL}, + {"GL_NV_blend_square", NULL}, + {"GL_NV_vertex_program", GL_NV_vertex_program_functions}, + {"GL_NV_vertex_program1_1", NULL}, +/* { "GL_SGIS_generate_mipmap", NULL }, */ + {NULL, NULL} +}; + +extern const struct tnl_pipeline_stage _intel_render_stage; + +static const struct tnl_pipeline_stage *intel_pipeline[] = { + &_tnl_vertex_transform_stage, + &_tnl_vertex_cull_stage, + &_tnl_normal_transform_stage, + &_tnl_lighting_stage, + &_tnl_fog_coordinate_stage, + &_tnl_texgen_stage, + &_tnl_texture_transform_stage, + &_tnl_point_attenuation_stage, + &_tnl_arb_vertex_program_stage, + &_tnl_vertex_program_stage, +#if 1 + &_intel_render_stage, /* ADD: unclipped rastersetup-to-dma */ +#endif + &_tnl_render_stage, + 0, +}; + + +static const struct dri_debug_control debug_control[] = { + {"tex", DEBUG_TEXTURE}, + {"state", DEBUG_STATE}, + {"ioctl", DEBUG_IOCTL}, + {"blit", DEBUG_BLIT}, + {"mip", DEBUG_MIPTREE}, + {"fall", DEBUG_FALLBACKS}, + {"verb", DEBUG_VERBOSE}, + {"bat", DEBUG_BATCH}, + {"pix", DEBUG_PIXEL}, + {"buf", DEBUG_BUFMGR}, + {"reg", DEBUG_REGION}, + {"fbo", DEBUG_FBO}, + {"lock", DEBUG_LOCK}, + {NULL, 0} +}; + + +static void +intelInvalidateState(GLcontext * ctx, GLuint new_state) +{ + _swrast_InvalidateState(ctx, new_state); + _swsetup_InvalidateState(ctx, new_state); + _ac_InvalidateState(ctx, new_state); + _tnl_InvalidateState(ctx, new_state); + _tnl_invalidate_vertex_state(ctx, new_state); + intel_context(ctx)->NewGLState |= new_state; +} + + +void +intelFlush(GLcontext * ctx) +{ + struct intel_context *intel = intel_context(ctx); + + if (intel->Fallback) + _swrast_flush(ctx); + + INTEL_FIREVERTICES(intel); + + if (intel->batch->map != intel->batch->ptr) + intel_batchbuffer_flush(intel->batch); + + /* XXX: Need to do an MI_FLUSH here. + */ +} + + +/** + * Check if we need to rotate/warp the front color buffer to the + * rotated screen. We generally need to do this when we get a glFlush + * or glFinish after drawing to the front color buffer. + */ +static void +intelCheckFrontRotate(GLcontext * ctx) +{ + struct intel_context *intel = intel_context(ctx); + if (intel->ctx.DrawBuffer->_ColorDrawBufferMask[0] == + BUFFER_BIT_FRONT_LEFT) { + intelScreenPrivate *screen = intel->intelScreen; + if (screen->current_rotation != 0) { + __DRIdrawablePrivate *dPriv = intel->driDrawable; + intelRotateWindow(intel, dPriv, BUFFER_BIT_FRONT_LEFT); + } + } +} + + +/** + * Called via glFlush. + */ +static void +intelglFlush(GLcontext * ctx) +{ + intelFlush(ctx); + intelCheckFrontRotate(ctx); +} + +void +intelFinish(GLcontext * ctx) +{ + struct intel_context *intel = intel_context(ctx); + intelFlush(ctx); + if (intel->batch->last_fence) { + driFenceFinish(intel->batch->last_fence, + 0, GL_FALSE); + driFenceUnReference(intel->batch->last_fence); + intel->batch->last_fence = NULL; + } + intelCheckFrontRotate(ctx); +} + + +void +intelInitDriverFunctions(struct dd_function_table *functions) +{ + _mesa_init_driver_functions(functions); + + functions->Flush = intelglFlush; + functions->Finish = intelFinish; + functions->GetString = intelGetString; + functions->UpdateState = intelInvalidateState; + functions->CopyColorTable = _swrast_CopyColorTable; + functions->CopyColorSubTable = _swrast_CopyColorSubTable; + functions->CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D; + functions->CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D; + + intelInitTextureFuncs(functions); + intelInitPixelFuncs(functions); + intelInitStateFuncs(functions); + intelInitBufferFuncs(functions); +} + + +GLboolean +intelInitContext(struct intel_context *intel, + const __GLcontextModes * mesaVis, + __DRIcontextPrivate * driContextPriv, + void *sharedContextPrivate, + struct dd_function_table *functions) +{ + GLcontext *ctx = &intel->ctx; + GLcontext *shareCtx = (GLcontext *) sharedContextPrivate; + __DRIscreenPrivate *sPriv = driContextPriv->driScreenPriv; + intelScreenPrivate *intelScreen = (intelScreenPrivate *) sPriv->private; + drmI830Sarea *saPriv = (drmI830Sarea *) + (((GLubyte *) sPriv->pSAREA) + intelScreen->sarea_priv_offset); + int fthrottle_mode; + + if (!_mesa_initialize_context(&intel->ctx, + mesaVis, shareCtx, + functions, (void *) intel)) + return GL_FALSE; + + driContextPriv->driverPrivate = intel; + intel->intelScreen = intelScreen; + intel->driScreen = sPriv; + intel->sarea = saPriv; + + if (!lockMutexInit) { + lockMutexInit = GL_TRUE; + _glthread_INIT_MUTEX(lockMutex); + } + + driParseConfigFiles(&intel->optionCache, &intelScreen->optionCache, + intel->driScreen->myNum, "i915"); + + ctx->Const.MaxTextureMaxAnisotropy = 2.0; + + /* This doesn't yet catch all non-conformant rendering, but it's a + * start. + */ + if (getenv("INTEL_STRICT_CONFORMANCE")) { + intel->strict_conformance = 1; + } + + ctx->Const.MinLineWidth = 1.0; + ctx->Const.MinLineWidthAA = 1.0; + ctx->Const.MaxLineWidth = 3.0; + ctx->Const.MaxLineWidthAA = 3.0; + ctx->Const.LineWidthGranularity = 1.0; + + ctx->Const.MinPointSize = 1.0; + ctx->Const.MinPointSizeAA = 1.0; + ctx->Const.MaxPointSize = 255.0; + ctx->Const.MaxPointSizeAA = 3.0; + ctx->Const.PointSizeGranularity = 1.0; + + ctx->Const.MaxColorAttachments = 4; /* XXX FBO: review this */ + + /* Initialize the software rasterizer and helper modules. */ + _swrast_CreateContext(ctx); + _ac_CreateContext(ctx); + _tnl_CreateContext(ctx); + _swsetup_CreateContext(ctx); + + /* Install the customized pipeline: */ + _tnl_destroy_pipeline(ctx); + _tnl_install_pipeline(ctx, intel_pipeline); + + /* Configure swrast to match hardware characteristics: */ + _swrast_allow_pixel_fog(ctx, GL_FALSE); + _swrast_allow_vertex_fog(ctx, GL_TRUE); + + /* Dri stuff */ + intel->hHWContext = driContextPriv->hHWContext; + intel->driFd = sPriv->fd; + intel->driHwLock = (drmLock *) & sPriv->pSAREA->lock; + + intel->hw_stipple = 1; + + /* XXX FBO: this doesn't seem to be used anywhere */ + switch (mesaVis->depthBits) { + case 0: /* what to do in this case? */ + case 16: + intel->polygon_offset_scale = 1.0 / 0xffff; + break; + case 24: + intel->polygon_offset_scale = 2.0 / 0xffffff; /* req'd to pass glean */ + break; + default: + assert(0); + break; + } + + /* Initialize swrast, tnl driver tables: */ + intelInitSpanFuncs(ctx); + intelInitTriFuncs(ctx); + + + intel->RenderIndex = ~0; + + fthrottle_mode = driQueryOptioni(&intel->optionCache, "fthrottle_mode"); + intel->iw.irq_seq = -1; + intel->irqsEmitted = 0; + + intel->do_irqs = (intel->intelScreen->irq_active && + fthrottle_mode == DRI_CONF_FTHROTTLE_IRQS); + + intel->do_usleeps = (fthrottle_mode == DRI_CONF_FTHROTTLE_USLEEPS); + + intel->vblank_flags = (intel->intelScreen->irq_active != 0) + ? driGetDefaultVBlankFlags(&intel->optionCache) : VBLANK_FLAG_NO_IRQ; + + (*dri_interface->getUST) (&intel->swap_ust); + _math_matrix_ctr(&intel->ViewportMatrix); + + /* Disable imaging extension until convolution is working in + * teximage paths: + */ + driInitExtensions(ctx, card_extensions, +/* GL_TRUE, */ + GL_FALSE); + + + intel->batch = intel_batchbuffer_alloc(intel); + intel->last_swap_fence = NULL; + intel->first_swap_fence = NULL; + + intel_bufferobj_init(intel); + intel_fbo_init(intel); + + if (intel->ctx.Mesa_DXTn) { + _mesa_enable_extension(ctx, "GL_EXT_texture_compression_s3tc"); + _mesa_enable_extension(ctx, "GL_S3_s3tc"); + } + else if (driQueryOptionb(&intel->optionCache, "force_s3tc_enable")) { + _mesa_enable_extension(ctx, "GL_EXT_texture_compression_s3tc"); + } + + intel->prim.primitive = ~0; + + +#if DO_DEBUG + INTEL_DEBUG = driParseDebugString(getenv("INTEL_DEBUG"), debug_control); +#endif + + if (getenv("INTEL_NO_RAST")) { + fprintf(stderr, "disabling 3D rasterization\n"); + FALLBACK(intel, INTEL_FALLBACK_USER, 1); + } + + return GL_TRUE; +} + +void +intelDestroyContext(__DRIcontextPrivate * driContextPriv) +{ + struct intel_context *intel = + (struct intel_context *) driContextPriv->driverPrivate; + + assert(intel); /* should never be null */ + if (intel) { + GLboolean release_texture_heaps; + + INTEL_FIREVERTICES(intel); + + intel->vtbl.destroy(intel); + + release_texture_heaps = (intel->ctx.Shared->RefCount == 1); + _swsetup_DestroyContext(&intel->ctx); + _tnl_DestroyContext(&intel->ctx); + _ac_DestroyContext(&intel->ctx); + + _swrast_DestroyContext(&intel->ctx); + intel->Fallback = 0; /* don't call _swrast_Flush later */ + + intel_batchbuffer_free(intel->batch); + + if (intel->last_swap_fence) { + driFenceFinish(intel->last_swap_fence, DRM_FENCE_TYPE_EXE, GL_TRUE); + driFenceUnReference(intel->last_swap_fence); + intel->last_swap_fence = NULL; + } + if (intel->first_swap_fence) { + driFenceFinish(intel->first_swap_fence, DRM_FENCE_TYPE_EXE, GL_TRUE); + driFenceUnReference(intel->first_swap_fence); + intel->first_swap_fence = NULL; + } + + + if (release_texture_heaps) { + /* This share group is about to go away, free our private + * texture object data. + */ + if (INTEL_DEBUG & DEBUG_TEXTURE) + fprintf(stderr, "do something to free texture heaps\n"); + } + + /* free the Mesa context */ + _mesa_free_context_data(&intel->ctx); + } +} + +GLboolean +intelUnbindContext(__DRIcontextPrivate * driContextPriv) +{ + return GL_TRUE; +} + +GLboolean +intelMakeCurrent(__DRIcontextPrivate * driContextPriv, + __DRIdrawablePrivate * driDrawPriv, + __DRIdrawablePrivate * driReadPriv) +{ + + if (driContextPriv) { + struct intel_context *intel = + (struct intel_context *) driContextPriv->driverPrivate; + GLframebuffer *drawFb = (GLframebuffer *) driDrawPriv->driverPrivate; + GLframebuffer *readFb = (GLframebuffer *) driReadPriv->driverPrivate; + + + /* XXX FBO temporary fix-ups! */ + /* if the renderbuffers don't have regions, init them from the context */ + { + struct intel_renderbuffer *irbFront + = intel_get_renderbuffer(drawFb, BUFFER_FRONT_LEFT); + struct intel_renderbuffer *irbBack + = intel_get_renderbuffer(drawFb, BUFFER_BACK_LEFT); + struct intel_renderbuffer *irbDepth + = intel_get_renderbuffer(drawFb, BUFFER_DEPTH); + struct intel_renderbuffer *irbStencil + = intel_get_renderbuffer(drawFb, BUFFER_STENCIL); + + if (irbFront && !irbFront->region) { + intel_region_reference(&irbFront->region, intel->intelScreen->front_region); + } + if (irbBack && !irbBack->region) { + intel_region_reference(&irbBack->region, intel->intelScreen->back_region); + } + if (irbDepth && !irbDepth->region) { + intel_region_reference(&irbDepth->region, intel->intelScreen->depth_region); + } + if (irbStencil && !irbStencil->region) { + intel_region_reference(&irbStencil->region, intel->intelScreen->depth_region); + } + } + + /* set initial GLframebuffer size to match window, if needed */ + if (drawFb->Width == 0 && driDrawPriv->w) { + _mesa_resize_framebuffer(&intel->ctx, drawFb, + driDrawPriv->w, driDrawPriv->h); + } + if (readFb->Width == 0 && driReadPriv->w) { + _mesa_resize_framebuffer(&intel->ctx, readFb, + driReadPriv->w, driReadPriv->h); + } + + _mesa_make_current(&intel->ctx, drawFb, readFb); + + /* The drawbuffer won't always be updated by _mesa_make_current: + */ + if (intel->ctx.DrawBuffer == drawFb) { + + if (intel->driDrawable != driDrawPriv) { + driDrawableInitVBlank(driDrawPriv, intel->vblank_flags, &intel->vbl_seq); + intel->driDrawable = driDrawPriv; + intelWindowMoved(intel); + } + + intel_draw_buffer(&intel->ctx, drawFb); + } + } + else { + _mesa_make_current(NULL, NULL, NULL); + } + + return GL_TRUE; +} + +static void +intelContendedLock(struct intel_context *intel, GLuint flags) +{ + __DRIdrawablePrivate *dPriv = intel->driDrawable; + __DRIscreenPrivate *sPriv = intel->driScreen; + intelScreenPrivate *intelScreen = (intelScreenPrivate *) sPriv->private; + drmI830Sarea *sarea = intel->sarea; + + drmGetLock(intel->driFd, intel->hHWContext, flags); + + if (INTEL_DEBUG & DEBUG_LOCK) + _mesa_printf("%s - got contended lock\n", __progname); + + /* If the window moved, may need to set a new cliprect now. + * + * NOTE: This releases and regains the hw lock, so all state + * checking must be done *after* this call: + */ + if (dPriv) + DRI_VALIDATE_DRAWABLE_INFO(sPriv, dPriv); + + if (sarea->width != intelScreen->width || + sarea->height != intelScreen->height || + sarea->rotation != intelScreen->current_rotation) { + + intelUpdateScreenRotation(sPriv, sarea); + + /* + * This will drop the outstanding batchbuffer on the floor + * FIXME: This should be done for all contexts? + */ + + intel_batchbuffer_reset(intel->batch); + + /* lose all primitives */ + intel->prim.primitive = ~0; + intel->prim.start_ptr = 0; + intel->prim.flush = 0; + + /* re-emit all state */ + intel->vtbl.lost_hardware(intel); + + /* force window update */ + intel->lastStamp = 0; + } + + + /* Drawable changed? + */ + if (dPriv && intel->lastStamp != dPriv->lastStamp) { + intelWindowMoved(intel); + intel->lastStamp = dPriv->lastStamp; + } +} + + +/* Lock the hardware and validate our state. + */ +void LOCK_HARDWARE( struct intel_context *intel ) +{ + char __ret=0; + + _glthread_LOCK_MUTEX(lockMutex); + assert(!intel->locked); + + if (intel->swap_scheduled) { + drmVBlank vbl; + vbl.request.type = DRM_VBLANK_ABSOLUTE; + if ( intel->vblank_flags & VBLANK_FLAG_SECONDARY ) { + vbl.request.type |= DRM_VBLANK_SECONDARY; + } + vbl.request.sequence = intel->vbl_seq; + drmWaitVBlank(intel->driFd, &vbl); + intel->swap_scheduled = 0; + } + + DRM_CAS(intel->driHwLock, intel->hHWContext, + (DRM_LOCK_HELD|intel->hHWContext), __ret); + + if (__ret) + intelContendedLock( intel, 0 ); + + if (INTEL_DEBUG & DEBUG_LOCK) + _mesa_printf("%s - locked\n", __progname); + + intel->locked = 1; +} + + + /* Unlock the hardware using the global current context + */ +void UNLOCK_HARDWARE( struct intel_context *intel ) +{ + intel->locked = 0; + + DRM_UNLOCK(intel->driFd, intel->driHwLock, intel->hHWContext); + + _glthread_UNLOCK_MUTEX(lockMutex); + + if (INTEL_DEBUG & DEBUG_LOCK) + _mesa_printf("%s - unlocked\n", __progname); +} + diff --git a/src/mesa/drivers/dri/i915tex/intel_context.h b/src/mesa/drivers/dri/i915tex/intel_context.h new file mode 100644 index 00000000000..7654e4ecd51 --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/intel_context.h @@ -0,0 +1,502 @@ +/************************************************************************** + * + * Copyright 2003 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. + * + **************************************************************************/ + +#ifndef INTELCONTEXT_INC +#define INTELCONTEXT_INC + + + +#include "mtypes.h" +#include "drm.h" +#include "mm.h" +#include "texmem.h" + +#include "intel_screen.h" +#include "i915_drm.h" +#include "i830_common.h" +#include "tnl/t_vertex.h" + +#define TAG(x) intel##x +#include "tnl_dd/t_dd_vertex.h" +#undef TAG + +#define DV_PF_555 (1<<8) +#define DV_PF_565 (2<<8) +#define DV_PF_8888 (3<<8) + +struct intel_region; +struct intel_context; +struct _DriBufferObject; + +typedef void (*intel_tri_func) (struct intel_context *, intelVertex *, + intelVertex *, intelVertex *); +typedef void (*intel_line_func) (struct intel_context *, intelVertex *, + intelVertex *); +typedef void (*intel_point_func) (struct intel_context *, intelVertex *); + +#define INTEL_FALLBACK_DRAW_BUFFER 0x1 +#define INTEL_FALLBACK_READ_BUFFER 0x2 +#define INTEL_FALLBACK_DEPTH_BUFFER 0x4 +#define INTEL_FALLBACK_STENCIL_BUFFER 0x8 +#define INTEL_FALLBACK_USER 0x10 +#define INTEL_FALLBACK_RENDERMODE 0x20 + +extern void intelFallback(struct intel_context *intel, GLuint bit, + GLboolean mode); +#define FALLBACK( intel, bit, mode ) intelFallback( intel, bit, mode ) + + +#define INTEL_WRITE_PART 0x1 +#define INTEL_WRITE_FULL 0x2 +#define INTEL_READ 0x4 + +struct intel_texture_object +{ + struct gl_texture_object base; /* The "parent" object */ + + /* The mipmap tree must include at least these levels once + * validated: + */ + GLuint firstLevel; + GLuint lastLevel; + + /* Offset for firstLevel image: + */ + GLuint textureOffset; + + /* On validation any active images held in main memory or in other + * regions will be copied to this region and the old storage freed. + */ + struct intel_mipmap_tree *mt; +}; + + + +struct intel_texture_image +{ + struct gl_texture_image base; + + /* These aren't stored in gl_texture_image + */ + GLuint level; + GLuint face; + + /* If intelImage->mt != NULL, image data is stored here. + * Else if intelImage->base.Data != NULL, image is stored there. + * Else there is no image data. + */ + struct intel_mipmap_tree *mt; +}; + + +#define INTEL_MAX_FIXUP 64 + +struct intel_context +{ + GLcontext ctx; /* the parent class */ + + struct + { + void (*destroy) (struct intel_context * intel); + void (*emit_state) (struct intel_context * intel); + void (*lost_hardware) (struct intel_context * intel); + void (*update_texture_state) (struct intel_context * intel); + + void (*render_start) (struct intel_context * intel); + void (*set_draw_region) (struct intel_context * intel, + struct intel_region * draw_region, + struct intel_region * depth_region); + + GLuint(*flush_cmd) (void); + + void (*reduced_primitive_state) (struct intel_context * intel, + GLenum rprim); + + GLboolean(*check_vertex_size) (struct intel_context * intel, + GLuint expected); + + + /* Metaops: + */ + void (*install_meta_state) (struct intel_context * intel); + void (*leave_meta_state) (struct intel_context * intel); + + void (*meta_draw_region) (struct intel_context * intel, + struct intel_region * draw_region, + struct intel_region * depth_region); + + void (*meta_color_mask) (struct intel_context * intel, GLboolean); + + void (*meta_stencil_replace) (struct intel_context * intel, + GLuint mask, GLuint clear); + + void (*meta_depth_replace) (struct intel_context * intel); + + void (*meta_texture_blend_replace) (struct intel_context * intel); + + void (*meta_no_stencil_write) (struct intel_context * intel); + void (*meta_no_depth_write) (struct intel_context * intel); + void (*meta_no_texture) (struct intel_context * intel); + + void (*meta_import_pixel_state) (struct intel_context * intel); + + GLboolean(*meta_tex_rect_source) (struct intel_context * intel, + struct _DriBufferObject * buffer, + GLuint offset, + GLuint pitch, + GLuint height, + GLenum format, GLenum type); + void (*rotate_window) (struct intel_context * intel, + __DRIdrawablePrivate * dPriv, GLuint srcBuf); + + void (*assert_not_dirty) (struct intel_context *intel); + + } vtbl; + + GLint refcount; + GLuint Fallback; + GLuint NewGLState; + + struct _DriFenceObject *last_swap_fence; + struct _DriFenceObject *first_swap_fence; + + struct intel_batchbuffer *batch; + + struct + { + GLuint id; + GLuint primitive; + GLubyte *start_ptr; + void (*flush) (struct intel_context *); + } prim; + + GLboolean locked; + char *prevLockFile; + int prevLockLine; + + GLuint ClearColor565; + GLuint ClearColor8888; + + /* Offsets of fields within the current vertex: + */ + GLuint coloroffset; + GLuint specoffset; + GLuint wpos_offset; + GLuint wpos_size; + + struct tnl_attr_map vertex_attrs[VERT_ATTRIB_MAX]; + GLuint vertex_attr_count; + + GLfloat polygon_offset_scale; /* dependent on depth_scale, bpp */ + + GLboolean hw_stipple; + GLboolean strict_conformance; + + /* AGP memory buffer manager: + */ + struct bufmgr *bm; + + + /* State for intelvb.c and inteltris.c. + */ + GLuint RenderIndex; + GLmatrix ViewportMatrix; + GLenum render_primitive; + GLenum reduced_primitive; + GLuint vertex_size; + GLubyte *verts; /* points to tnl->clipspace.vertex_buf */ + +#if 0 + struct intel_region *front_region; /* XXX FBO: obsolete */ + struct intel_region *rotated_region; /* XXX FBO: obsolete */ + struct intel_region *back_region; /* XXX FBO: obsolete */ + struct intel_region *draw_region; /* XXX FBO: rename to color_region */ + struct intel_region *depth_region; /**< currently bound depth/Z region */ +#endif + + /* Fallback rasterization functions + */ + intel_point_func draw_point; + intel_line_func draw_line; + intel_tri_func draw_tri; + + /* These refer to the current drawing buffer: + */ + int drawX, drawY; /**< origin of drawing area within region */ + GLuint numClipRects; /**< cliprects for drawing */ + drm_clip_rect_t *pClipRects; + drm_clip_rect_t fboRect; /**< cliprect for FBO rendering */ + + int perf_boxes; + + GLuint do_usleeps; + int do_irqs; + GLuint irqsEmitted; + drm_i915_irq_wait_t iw; + + drm_context_t hHWContext; + drmLock *driHwLock; + int driFd; + + __DRIdrawablePrivate *driDrawable; + __DRIscreenPrivate *driScreen; + intelScreenPrivate *intelScreen; + drmI830Sarea *sarea; + + GLuint lastStamp; + + /** + * Configuration cache + */ + driOptionCache optionCache; + + /* VBI + */ + GLuint vbl_seq; + GLuint vblank_flags; + + int64_t swap_ust; + int64_t swap_missed_ust; + + GLuint swap_count; + GLuint swap_missed_count; + + GLuint swap_scheduled; +}; + +/* These are functions now: + */ +void LOCK_HARDWARE( struct intel_context *intel ); +void UNLOCK_HARDWARE( struct intel_context *intel ); + +extern char *__progname; + + +#define SUBPIXEL_X 0.125 +#define SUBPIXEL_Y 0.125 + +#define INTEL_FIREVERTICES(intel) \ +do { \ + if ((intel)->prim.flush) \ + (intel)->prim.flush(intel); \ +} while (0) + +/* ================================================================ + * Color packing: + */ + +#define INTEL_PACKCOLOR4444(r,g,b,a) \ + ((((a) & 0xf0) << 8) | (((r) & 0xf0) << 4) | ((g) & 0xf0) | ((b) >> 4)) + +#define INTEL_PACKCOLOR1555(r,g,b,a) \ + ((((r) & 0xf8) << 7) | (((g) & 0xf8) << 2) | (((b) & 0xf8) >> 3) | \ + ((a) ? 0x8000 : 0)) + +#define INTEL_PACKCOLOR565(r,g,b) \ + ((((r) & 0xf8) << 8) | (((g) & 0xfc) << 3) | (((b) & 0xf8) >> 3)) + +#define INTEL_PACKCOLOR8888(r,g,b,a) \ + ((a<<24) | (r<<16) | (g<<8) | b) + + + +/* ================================================================ + * From linux kernel i386 header files, copes with odd sizes better + * than COPY_DWORDS would: + * XXX Put this in src/mesa/main/imports.h ??? + */ +#if defined(i386) || defined(__i386__) +static INLINE void * +__memcpy(void *to, const void *from, size_t n) +{ + int d0, d1, d2; + __asm__ __volatile__("rep ; movsl\n\t" + "testb $2,%b4\n\t" + "je 1f\n\t" + "movsw\n" + "1:\ttestb $1,%b4\n\t" + "je 2f\n\t" + "movsb\n" "2:":"=&c"(d0), "=&D"(d1), "=&S"(d2) + :"0"(n / 4), "q"(n), "1"((long) to), "2"((long) from) + :"memory"); + return (to); +} +#else +#define __memcpy(a,b,c) memcpy(a,b,c) +#endif + + + +/* ================================================================ + * Debugging: + */ +#define DO_DEBUG 0 +#if DO_DEBUG +extern int INTEL_DEBUG; +#else +#define INTEL_DEBUG 0 +#endif + +#define DEBUG_TEXTURE 0x1 +#define DEBUG_STATE 0x2 +#define DEBUG_IOCTL 0x4 +#define DEBUG_BLIT 0x8 +#define DEBUG_MIPTREE 0x10 +#define DEBUG_FALLBACKS 0x20 +#define DEBUG_VERBOSE 0x40 +#define DEBUG_BATCH 0x80 +#define DEBUG_PIXEL 0x100 +#define DEBUG_BUFMGR 0x200 +#define DEBUG_REGION 0x400 +#define DEBUG_FBO 0x800 +#define DEBUG_LOCK 0x1000 + +#define DBG(...) do { if (INTEL_DEBUG & FILE_DEBUG_FLAG) _mesa_printf(__VA_ARGS__); } while(0) + + +#define PCI_CHIP_845_G 0x2562 +#define PCI_CHIP_I830_M 0x3577 +#define PCI_CHIP_I855_GM 0x3582 +#define PCI_CHIP_I865_G 0x2572 +#define PCI_CHIP_I915_G 0x2582 +#define PCI_CHIP_I915_GM 0x2592 +#define PCI_CHIP_I945_G 0x2772 +#define PCI_CHIP_I945_GM 0x27A2 + + +/* ================================================================ + * intel_context.c: + */ + +extern GLboolean intelInitContext(struct intel_context *intel, + const __GLcontextModes * mesaVis, + __DRIcontextPrivate * driContextPriv, + void *sharedContextPrivate, + struct dd_function_table *functions); + +extern void intelGetLock(struct intel_context *intel, GLuint flags); + +extern void intelInitState(GLcontext * ctx); +extern void intelFinish(GLcontext * ctx); +extern void intelFlush(GLcontext * ctx); + +extern void intelInitDriverFunctions(struct dd_function_table *functions); + + +/* ================================================================ + * intel_state.c: + */ +extern void intelInitStateFuncs(struct dd_function_table *functions); + +#define COMPAREFUNC_ALWAYS 0 +#define COMPAREFUNC_NEVER 0x1 +#define COMPAREFUNC_LESS 0x2 +#define COMPAREFUNC_EQUAL 0x3 +#define COMPAREFUNC_LEQUAL 0x4 +#define COMPAREFUNC_GREATER 0x5 +#define COMPAREFUNC_NOTEQUAL 0x6 +#define COMPAREFUNC_GEQUAL 0x7 + +#define STENCILOP_KEEP 0 +#define STENCILOP_ZERO 0x1 +#define STENCILOP_REPLACE 0x2 +#define STENCILOP_INCRSAT 0x3 +#define STENCILOP_DECRSAT 0x4 +#define STENCILOP_INCR 0x5 +#define STENCILOP_DECR 0x6 +#define STENCILOP_INVERT 0x7 + +#define LOGICOP_CLEAR 0 +#define LOGICOP_NOR 0x1 +#define LOGICOP_AND_INV 0x2 +#define LOGICOP_COPY_INV 0x3 +#define LOGICOP_AND_RVRSE 0x4 +#define LOGICOP_INV 0x5 +#define LOGICOP_XOR 0x6 +#define LOGICOP_NAND 0x7 +#define LOGICOP_AND 0x8 +#define LOGICOP_EQUIV 0x9 +#define LOGICOP_NOOP 0xa +#define LOGICOP_OR_INV 0xb +#define LOGICOP_COPY 0xc +#define LOGICOP_OR_RVRSE 0xd +#define LOGICOP_OR 0xe +#define LOGICOP_SET 0xf + +#define BLENDFACT_ZERO 0x01 +#define BLENDFACT_ONE 0x02 +#define BLENDFACT_SRC_COLR 0x03 +#define BLENDFACT_INV_SRC_COLR 0x04 +#define BLENDFACT_SRC_ALPHA 0x05 +#define BLENDFACT_INV_SRC_ALPHA 0x06 +#define BLENDFACT_DST_ALPHA 0x07 +#define BLENDFACT_INV_DST_ALPHA 0x08 +#define BLENDFACT_DST_COLR 0x09 +#define BLENDFACT_INV_DST_COLR 0x0a +#define BLENDFACT_SRC_ALPHA_SATURATE 0x0b +#define BLENDFACT_CONST_COLOR 0x0c +#define BLENDFACT_INV_CONST_COLOR 0x0d +#define BLENDFACT_CONST_ALPHA 0x0e +#define BLENDFACT_INV_CONST_ALPHA 0x0f +#define BLENDFACT_MASK 0x0f + +#define MI_BATCH_BUFFER_END (0xA<<23) + + +extern int intel_translate_compare_func(GLenum func); +extern int intel_translate_stencil_op(GLenum op); +extern int intel_translate_blend_factor(GLenum factor); +extern int intel_translate_logic_op(GLenum opcode); + + +/*====================================================================== + * Inline conversion functions. + * These are better-typed than the macros used previously: + */ +static INLINE struct intel_context * +intel_context(GLcontext * ctx) +{ + return (struct intel_context *) ctx; +} + +static INLINE struct intel_texture_object * +intel_texture_object(struct gl_texture_object *obj) +{ + return (struct intel_texture_object *) obj; +} + +static INLINE struct intel_texture_image * +intel_texture_image(struct gl_texture_image *img) +{ + return (struct intel_texture_image *) img; +} + +extern struct intel_renderbuffer *intel_renderbuffer(struct gl_renderbuffer + *rb); + + +#endif diff --git a/src/mesa/drivers/dri/i915tex/intel_depthstencil.c b/src/mesa/drivers/dri/i915tex/intel_depthstencil.c new file mode 100644 index 00000000000..d269a85a3c9 --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/intel_depthstencil.c @@ -0,0 +1,282 @@ +/************************************************************************** + * + * Copyright 2006 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. + * + **************************************************************************/ + +#include "glheader.h" +#include "imports.h" +#include "context.h" +#include "depthstencil.h" +#include "fbobject.h" +#include "framebuffer.h" +#include "hash.h" +#include "mtypes.h" +#include "renderbuffer.h" + +#include "intel_context.h" +#include "intel_fbo.h" +#include "intel_depthstencil.h" +#include "intel_regions.h" + + +/** + * The GL_EXT_framebuffer_object allows the user to create their own + * framebuffer objects consisting of color renderbuffers (0 or more), + * depth renderbuffers (0 or 1) and stencil renderbuffers (0 or 1). + * + * The spec considers depth and stencil renderbuffers to be totally independent + * buffers. In reality, most graphics hardware today uses a combined + * depth+stencil buffer (one 32-bit pixel = 24 bits of Z + 8 bits of stencil). + * + * This causes difficulty because the user may create some number of depth + * renderbuffers and some number of stencil renderbuffers and bind them + * together in framebuffers in any combination. + * + * This code manages all that. + * + * 1. Depth renderbuffers are always allocated in hardware as 32bpp + * GL_DEPTH24_STENCIL8 buffers. + * + * 2. Stencil renderbuffers are initially allocated in software as 8bpp + * GL_STENCIL_INDEX8 buffers. + * + * 3. Depth and Stencil renderbuffers use the PairedStencil and PairedDepth + * fields (respectively) to indicate if the buffer's currently paired + * with another stencil or depth buffer (respectively). + * + * 4. When a depth and stencil buffer are initially both attached to the + * current framebuffer, we merge the stencil buffer values into the + * depth buffer (really a depth+stencil buffer). The then hardware uses + * the combined buffer. + * + * 5. Whenever a depth or stencil buffer is reallocated (with + * glRenderbufferStorage) we undo the pairing and copy the stencil values + * from the combined depth/stencil buffer back to the stencil-only buffer. + * + * 6. We also undo the pairing when we find a change in buffer bindings. + * + * 7. If a framebuffer is only using a depth renderbuffer (no stencil), we + * just use the combined depth/stencil buffer and ignore the stencil values. + * + * 8. If a framebuffer is only using a stencil renderbuffer (no depth) we have + * to promote the 8bpp software stencil buffer to a 32bpp hardware + * depth+stencil buffer. + * + */ + + + +static void +map_regions(GLcontext * ctx, + struct intel_renderbuffer *depthRb, + struct intel_renderbuffer *stencilRb) +{ + struct intel_context *intel = intel_context(ctx); + if (depthRb && depthRb->region) { + intel_region_map(intel->intelScreen, depthRb->region); + depthRb->pfMap = depthRb->region->map; + depthRb->pfPitch = depthRb->region->pitch; + } + if (stencilRb && stencilRb->region) { + intel_region_map(intel->intelScreen, stencilRb->region); + stencilRb->pfMap = stencilRb->region->map; + stencilRb->pfPitch = stencilRb->region->pitch; + } +} + +static void +unmap_regions(GLcontext * ctx, + struct intel_renderbuffer *depthRb, + struct intel_renderbuffer *stencilRb) +{ + struct intel_context *intel = intel_context(ctx); + if (depthRb && depthRb->region) { + intel_region_unmap(intel->intelScreen, depthRb->region); + depthRb->pfMap = NULL; + depthRb->pfPitch = 0; + } + if (stencilRb && stencilRb->region) { + intel_region_unmap(intel->intelScreen, stencilRb->region); + stencilRb->pfMap = NULL; + stencilRb->pfPitch = 0; + } +} + + + +/** + * Undo the pairing/interleaving between depth and stencil buffers. + * irb should be a depth/stencil or stencil renderbuffer. + */ +void +intel_unpair_depth_stencil(GLcontext * ctx, struct intel_renderbuffer *irb) +{ + if (irb->PairedStencil) { + /* irb is a depth/stencil buffer */ + struct gl_renderbuffer *stencilRb; + struct intel_renderbuffer *stencilIrb; + + ASSERT(irb->Base._ActualFormat == GL_DEPTH24_STENCIL8_EXT); + + stencilRb = _mesa_lookup_renderbuffer(ctx, irb->PairedStencil); + stencilIrb = intel_renderbuffer(stencilRb); + if (stencilIrb) { + /* need to extract stencil values from the depth buffer */ + ASSERT(stencilIrb->PairedDepth == irb->Base.Name); + map_regions(ctx, irb, stencilIrb); + _mesa_extract_stencil(ctx, &irb->Base, &stencilIrb->Base); + unmap_regions(ctx, irb, stencilIrb); + stencilIrb->PairedDepth = 0; + } + irb->PairedStencil = 0; + } + else if (irb->PairedDepth) { + /* irb is a stencil buffer */ + struct gl_renderbuffer *depthRb; + struct intel_renderbuffer *depthIrb; + + ASSERT(irb->Base._ActualFormat == GL_STENCIL_INDEX8_EXT || + irb->Base._ActualFormat == GL_DEPTH24_STENCIL8_EXT); + + depthRb = _mesa_lookup_renderbuffer(ctx, irb->PairedDepth); + depthIrb = intel_renderbuffer(depthRb); + if (depthIrb) { + /* need to extract stencil values from the depth buffer */ + ASSERT(depthIrb->PairedStencil == irb->Base.Name); + map_regions(ctx, depthIrb, irb); + _mesa_extract_stencil(ctx, &depthIrb->Base, &irb->Base); + unmap_regions(ctx, depthIrb, irb); + depthIrb->PairedStencil = 0; + } + irb->PairedDepth = 0; + } + else { + _mesa_problem(ctx, "Problem in undo_depth_stencil_pairing"); + } + + ASSERT(irb->PairedStencil == 0); + ASSERT(irb->PairedDepth == 0); +} + + +/** + * Examine the depth and stencil renderbuffers which are attached to the + * framebuffer. If both depth and stencil are attached, make sure that the + * renderbuffers are 'paired' (combined). If only depth or only stencil is + * attached, undo any previous pairing. + * + * Must be called if NewState & _NEW_BUFFER (when renderbuffer attachments + * change, for example). + */ +void +intel_validate_paired_depth_stencil(GLcontext * ctx, + struct gl_framebuffer *fb) +{ + struct intel_renderbuffer *depthRb, *stencilRb; + + depthRb = intel_get_renderbuffer(fb, BUFFER_DEPTH); + stencilRb = intel_get_renderbuffer(fb, BUFFER_STENCIL); + + if (depthRb && stencilRb) { + if (depthRb == stencilRb) { + /* Using a user-created combined depth/stencil buffer. + * Nothing to do. + */ + ASSERT(depthRb->Base._BaseFormat == GL_DEPTH_STENCIL_EXT); + ASSERT(depthRb->Base._ActualFormat == GL_DEPTH24_STENCIL8_EXT); + } + else { + /* Separate depth/stencil buffers, need to interleave now */ + ASSERT(depthRb->Base._BaseFormat == GL_DEPTH_COMPONENT); + ASSERT(stencilRb->Base._BaseFormat == GL_STENCIL_INDEX); + /* may need to interleave depth/stencil now */ + if (depthRb->PairedStencil == stencilRb->Base.Name) { + /* OK, the depth and stencil buffers are already interleaved */ + ASSERT(stencilRb->PairedDepth == depthRb->Base.Name); + } + else { + /* need to setup new pairing/interleaving */ + if (depthRb->PairedStencil) { + intel_unpair_depth_stencil(ctx, depthRb); + } + if (stencilRb->PairedDepth) { + intel_unpair_depth_stencil(ctx, stencilRb); + } + + ASSERT(depthRb->Base._ActualFormat == GL_DEPTH24_STENCIL8_EXT); + ASSERT(stencilRb->Base._ActualFormat == GL_STENCIL_INDEX8_EXT || + stencilRb->Base._ActualFormat == GL_DEPTH24_STENCIL8_EXT); + + /* establish new pairing: interleave stencil into depth buffer */ + map_regions(ctx, depthRb, stencilRb); + _mesa_insert_stencil(ctx, &depthRb->Base, &stencilRb->Base); + unmap_regions(ctx, depthRb, stencilRb); + depthRb->PairedStencil = stencilRb->Base.Name; + stencilRb->PairedDepth = depthRb->Base.Name; + } + + } + } + else if (depthRb) { + /* Depth buffer but no stencil buffer. + * We'll use a GL_DEPTH24_STENCIL8 buffer and ignore the stencil bits. + */ + /* can't assert this until storage is allocated: + ASSERT(depthRb->Base._ActualFormat == GL_DEPTH24_STENCIL8_EXT); + */ + /* intel_undo any previous pairing */ + if (depthRb->PairedStencil) { + intel_unpair_depth_stencil(ctx, depthRb); + } + } + else if (stencilRb) { + /* Stencil buffer but no depth buffer. + * Since h/w doesn't typically support just 8bpp stencil w/out Z, + * we'll use a GL_DEPTH24_STENCIL8 buffer and ignore the depth bits. + */ + /* undo any previous pairing */ + if (stencilRb->PairedDepth) { + intel_unpair_depth_stencil(ctx, stencilRb); + } + if (stencilRb->Base._ActualFormat == GL_STENCIL_INDEX8_EXT) { + /* promote buffer to GL_DEPTH24_STENCIL8 for hw rendering */ + _mesa_promote_stencil(ctx, &stencilRb->Base); + ASSERT(stencilRb->Base._ActualFormat == GL_DEPTH24_STENCIL8_EXT); + } + } + + /* Finally, update the fb->_DepthBuffer and fb->_StencilBuffer fields */ + _mesa_update_depth_buffer(ctx, fb, BUFFER_DEPTH); + if (depthRb && depthRb->PairedStencil) + _mesa_update_stencil_buffer(ctx, fb, BUFFER_DEPTH); + else + _mesa_update_stencil_buffer(ctx, fb, BUFFER_STENCIL); + + + /* The hardware should use fb->Attachment[BUFFER_DEPTH].Renderbuffer + * first, if present, then fb->Attachment[BUFFER_STENCIL].Renderbuffer + * if present. + */ +} diff --git a/src/mesa/drivers/dri/i915tex/intel_depthstencil.h b/src/mesa/drivers/dri/i915tex/intel_depthstencil.h new file mode 100644 index 00000000000..2d3fc48b3a3 --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/intel_depthstencil.h @@ -0,0 +1,14 @@ + +#ifndef INTEL_DEPTH_STENCIL_H +#define INTEL_DEPTH_STENCIL_H + + +extern void +intel_unpair_depth_stencil(GLcontext * ctx, struct intel_renderbuffer *irb); + +extern void +intel_validate_paired_depth_stencil(GLcontext * ctx, + struct gl_framebuffer *fb); + + +#endif /* INTEL_DEPTH_STENCIL_H */ diff --git a/src/mesa/drivers/dri/i915tex/intel_fbo.c b/src/mesa/drivers/dri/i915tex/intel_fbo.c new file mode 100644 index 00000000000..ab0e569bd94 --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/intel_fbo.c @@ -0,0 +1,622 @@ +/************************************************************************** + * + * Copyright 2006 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. + * + **************************************************************************/ + + +#include "imports.h" +#include "mtypes.h" +#include "fbobject.h" +#include "framebuffer.h" +#include "renderbuffer.h" +#include "context.h" +#include "texformat.h" +#include "texrender.h" + +#include "intel_context.h" +#include "intel_buffers.h" +#include "intel_depthstencil.h" +#include "intel_fbo.h" +#include "intel_mipmap_tree.h" +#include "intel_regions.h" +#include "intel_span.h" + + +#define FILE_DEBUG_FLAG DEBUG_FBO + +#define INTEL_RB_CLASS 0x12345678 + + +/* XXX FBO: move this to intel_context.h (inlined) */ +/** + * Return a gl_renderbuffer ptr casted to intel_renderbuffer. + * NULL will be returned if the rb isn't really an intel_renderbuffer. + * This is determiend by checking the ClassID. + */ +struct intel_renderbuffer * +intel_renderbuffer(struct gl_renderbuffer *rb) +{ + struct intel_renderbuffer *irb = (struct intel_renderbuffer *) rb; + if (irb && irb->Base.ClassID == INTEL_RB_CLASS) { + /*_mesa_warning(NULL, "Returning non-intel Rb\n");*/ + return irb; + } + else + return NULL; +} + + +struct intel_renderbuffer * +intel_get_renderbuffer(struct gl_framebuffer *fb, GLuint attIndex) +{ + return intel_renderbuffer(fb->Attachment[attIndex].Renderbuffer); +} + + +struct intel_region * +intel_get_rb_region(struct gl_framebuffer *fb, GLuint attIndex) +{ + struct intel_renderbuffer *irb + = intel_renderbuffer(fb->Attachment[attIndex].Renderbuffer); + if (irb) + return irb->region; + else + return NULL; +} + + + +/** + * Create a new framebuffer object. + */ +static struct gl_framebuffer * +intel_new_framebuffer(GLcontext * ctx, GLuint name) +{ + /* there's no intel_framebuffer at this time, just use Mesa's class */ + return _mesa_new_framebuffer(ctx, name); +} + + +static void +intel_delete_renderbuffer(struct gl_renderbuffer *rb) +{ + GET_CURRENT_CONTEXT(ctx); + struct intel_context *intel = intel_context(ctx); + struct intel_renderbuffer *irb = intel_renderbuffer(rb); + + ASSERT(irb); + + if (irb->PairedStencil || irb->PairedDepth) { + intel_unpair_depth_stencil(ctx, irb); + } + + if (intel && irb->region) { + intel_region_release(&irb->region); + } + + _mesa_free(irb); +} + + + +/** + * Return a pointer to a specific pixel in a renderbuffer. + */ +static void * +intel_get_pointer(GLcontext * ctx, struct gl_renderbuffer *rb, + GLint x, GLint y) +{ + /* By returning NULL we force all software rendering to go through + * the span routines. + */ + return NULL; +} + + + +/** + * Called via glRenderbufferStorageEXT() to set the format and allocate + * storage for a user-created renderbuffer. + */ +static GLboolean +intel_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb, + GLenum internalFormat, + GLuint width, GLuint height) +{ + struct intel_context *intel = intel_context(ctx); + struct intel_renderbuffer *irb = intel_renderbuffer(rb); + GLboolean softwareBuffer = GL_FALSE; + int cpp; + + ASSERT(rb->Name != 0); + + switch (internalFormat) { + case GL_R3_G3_B2: + case GL_RGB4: + case GL_RGB5: + rb->_ActualFormat = GL_RGB5; + rb->DataType = GL_UNSIGNED_BYTE; + rb->RedBits = 5; + rb->GreenBits = 6; + rb->BlueBits = 5; + cpp = 2; + break; + case GL_RGB: + case GL_RGB8: + case GL_RGB10: + case GL_RGB12: + case GL_RGB16: + case GL_RGBA: + case GL_RGBA2: + case GL_RGBA4: + case GL_RGB5_A1: + case GL_RGBA8: + case GL_RGB10_A2: + case GL_RGBA12: + case GL_RGBA16: + rb->_ActualFormat = GL_RGBA8; + rb->DataType = GL_UNSIGNED_BYTE; + rb->RedBits = 8; + rb->GreenBits = 8; + rb->BlueBits = 8; + rb->AlphaBits = 8; + cpp = 4; + break; + case GL_STENCIL_INDEX: + case GL_STENCIL_INDEX1_EXT: + case GL_STENCIL_INDEX4_EXT: + case GL_STENCIL_INDEX8_EXT: + case GL_STENCIL_INDEX16_EXT: + /* alloc a depth+stencil buffer */ + rb->_ActualFormat = GL_DEPTH24_STENCIL8_EXT; + rb->DataType = GL_UNSIGNED_INT_24_8_EXT; + rb->StencilBits = 8; + cpp = 4; + break; + case GL_DEPTH_COMPONENT16: + rb->_ActualFormat = GL_DEPTH_COMPONENT16; + rb->DataType = GL_UNSIGNED_SHORT; + rb->DepthBits = 16; + cpp = 2; + break; + case GL_DEPTH_COMPONENT: + case GL_DEPTH_COMPONENT24: + case GL_DEPTH_COMPONENT32: + rb->_ActualFormat = GL_DEPTH24_STENCIL8_EXT; + rb->DataType = GL_UNSIGNED_INT_24_8_EXT; + rb->DepthBits = 24; + cpp = 4; + break; + case GL_DEPTH_STENCIL_EXT: + case GL_DEPTH24_STENCIL8_EXT: + rb->_ActualFormat = GL_DEPTH24_STENCIL8_EXT; + rb->DataType = GL_UNSIGNED_INT_24_8_EXT; + rb->DepthBits = 24; + rb->StencilBits = 8; + cpp = 4; + break; + default: + _mesa_problem(ctx, + "Unexpected format in intel_alloc_renderbuffer_storage"); + return GL_FALSE; + } + + intelFlush(ctx); + + /* free old region */ + if (irb->region) { + intel_region_release(&irb->region); + } + + /* allocate new memory region/renderbuffer */ + if (softwareBuffer) { + return _mesa_soft_renderbuffer_storage(ctx, rb, internalFormat, + width, height); + } + else { + /* Choose a pitch to match hardware requirements: + */ + GLuint pitch = ((cpp * width + 63) & ~63) / cpp; + + /* alloc hardware renderbuffer */ + DBG("Allocating %d x %d Intel RBO (pitch %d)\n", width, + height, pitch); + + irb->region = intel_region_alloc(intel->intelScreen, cpp, pitch, height); + if (!irb->region) + return GL_FALSE; /* out of memory? */ + + ASSERT(irb->region->buffer); + + rb->Width = width; + rb->Height = height; + + /* This sets the Get/PutRow/Value functions */ + intel_set_span_functions(&irb->Base); + + return GL_TRUE; + } +} + + + +/** + * Called for each hardware renderbuffer when a _window_ is resized. + * Just update fields. + * Not used for user-created renderbuffers! + */ +static GLboolean +intel_alloc_window_storage(GLcontext * ctx, struct gl_renderbuffer *rb, + GLenum internalFormat, GLuint width, GLuint height) +{ + ASSERT(rb->Name == 0); + rb->Width = width; + rb->Height = height; + rb->_ActualFormat = internalFormat; + return GL_TRUE; +} + + +static GLboolean +intel_nop_alloc_storage(GLcontext * ctx, struct gl_renderbuffer *rb, + GLenum internalFormat, GLuint width, GLuint height) +{ + _mesa_problem(ctx, "intel_op_alloc_storage should never be called."); + return GL_FALSE; +} + + + +/** + * Create a new intel_renderbuffer which corresponds to an on-screen window, + * not a user-created renderbuffer. + * \param width the screen width + * \param height the screen height + */ +struct intel_renderbuffer * +intel_create_renderbuffer(GLenum intFormat, GLsizei width, GLsizei height, + int offset, int pitch, int cpp, void *map) +{ + GET_CURRENT_CONTEXT(ctx); + + struct intel_renderbuffer *irb; + const GLuint name = 0; + + irb = CALLOC_STRUCT(intel_renderbuffer); + if (!irb) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "creating renderbuffer"); + return NULL; + } + + _mesa_init_renderbuffer(&irb->Base, name); + irb->Base.ClassID = INTEL_RB_CLASS; + + switch (intFormat) { + case GL_RGB5: + irb->Base._ActualFormat = GL_RGB5; + irb->Base._BaseFormat = GL_RGBA; + irb->Base.RedBits = 5; + irb->Base.GreenBits = 6; + irb->Base.BlueBits = 5; + irb->Base.DataType = GL_UNSIGNED_BYTE; + cpp = 2; + break; + case GL_RGBA8: + irb->Base._ActualFormat = GL_RGBA8; + irb->Base._BaseFormat = GL_RGBA; + irb->Base.RedBits = 8; + irb->Base.GreenBits = 8; + irb->Base.BlueBits = 8; + irb->Base.AlphaBits = 8; + irb->Base.DataType = GL_UNSIGNED_BYTE; + cpp = 4; + break; + case GL_STENCIL_INDEX8_EXT: + irb->Base._ActualFormat = GL_STENCIL_INDEX8_EXT; + irb->Base._BaseFormat = GL_STENCIL_INDEX; + irb->Base.StencilBits = 8; + irb->Base.DataType = GL_UNSIGNED_BYTE; + cpp = 1; + break; + case GL_DEPTH_COMPONENT16: + irb->Base._ActualFormat = GL_DEPTH_COMPONENT16; + irb->Base._BaseFormat = GL_DEPTH_COMPONENT; + irb->Base.DepthBits = 16; + irb->Base.DataType = GL_UNSIGNED_SHORT; + cpp = 2; + break; + case GL_DEPTH_COMPONENT24: + irb->Base._ActualFormat = GL_DEPTH24_STENCIL8_EXT; + irb->Base._BaseFormat = GL_DEPTH_COMPONENT; + irb->Base.DepthBits = 24; + irb->Base.DataType = GL_UNSIGNED_INT; + cpp = 4; + break; + case GL_DEPTH24_STENCIL8_EXT: + irb->Base._ActualFormat = GL_DEPTH24_STENCIL8_EXT; + irb->Base._BaseFormat = GL_DEPTH_STENCIL_EXT; + irb->Base.DepthBits = 24; + irb->Base.StencilBits = 8; + irb->Base.DataType = GL_UNSIGNED_INT_24_8_EXT; + cpp = 4; + break; + default: + _mesa_problem(NULL, + "Unexpected intFormat in intel_create_renderbuffer"); + return NULL; + } + + irb->Base.InternalFormat = intFormat; + + /* intel-specific methods */ + irb->Base.Delete = intel_delete_renderbuffer; + irb->Base.AllocStorage = intel_alloc_window_storage; + irb->Base.GetPointer = intel_get_pointer; + /* This sets the Get/PutRow/Value functions */ + intel_set_span_functions(&irb->Base); + + irb->pfMap = map; + irb->pfPitch = pitch / cpp; /* in pixels */ + +#if 00 + irb->region = intel_region_create_static(intel, + DRM_MM_TT, + offset, map, cpp, width, height); +#endif + + return irb; +} + + +/** + * Create a new renderbuffer object. + * Typically called via glBindRenderbufferEXT(). + */ +static struct gl_renderbuffer * +intel_new_renderbuffer(GLcontext * ctx, GLuint name) +{ + /*struct intel_context *intel = intel_context(ctx); */ + struct intel_renderbuffer *irb; + + irb = CALLOC_STRUCT(intel_renderbuffer); + if (!irb) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "creating renderbuffer"); + return NULL; + } + + _mesa_init_renderbuffer(&irb->Base, name); + irb->Base.ClassID = INTEL_RB_CLASS; + + /* intel-specific methods */ + irb->Base.Delete = intel_delete_renderbuffer; + irb->Base.AllocStorage = intel_alloc_renderbuffer_storage; + irb->Base.GetPointer = intel_get_pointer; + /* span routines set in alloc_storage function */ + + return &irb->Base; +} + + +/** + * Called via glBindFramebufferEXT(). + */ +static void +intel_bind_framebuffer(GLcontext * ctx, GLenum target, + struct gl_framebuffer *fb) +{ + if (target == GL_FRAMEBUFFER_EXT || target == GL_DRAW_FRAMEBUFFER_EXT) { + intel_draw_buffer(ctx, fb); + /* Integer depth range depends on depth buffer bits */ + ctx->Driver.DepthRange(ctx, ctx->Viewport.Near, ctx->Viewport.Far); + } + else { + /* don't need to do anything if target == GL_READ_FRAMEBUFFER_EXT */ + } +} + + +/** + * Called via glFramebufferRenderbufferEXT(). + */ +static void +intel_framebuffer_renderbuffer(GLcontext * ctx, + struct gl_framebuffer *fb, + GLenum attachment, struct gl_renderbuffer *rb) +{ + DBG("Intel FramebufferRenderbuffer %u %u\n", fb->Name, rb ? rb->Name : 0); + + intelFlush(ctx); + + _mesa_framebuffer_renderbuffer(ctx, fb, attachment, rb); + intel_draw_buffer(ctx, fb); +} + + +/** + * When glFramebufferTexture[123]D is called this function sets up the + * gl_renderbuffer wrapp around the texture image. + * This will have the region info needed for hardware rendering. + */ +static struct intel_renderbuffer * +intel_wrap_texture(GLcontext * ctx, struct gl_texture_image *texImage) +{ + const GLuint name = ~0; /* not significant, but distinct for debugging */ + struct intel_renderbuffer *irb; + + /* make an intel_renderbuffer to wrap the texture image */ + irb = CALLOC_STRUCT(intel_renderbuffer); + if (!irb) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glFramebufferTexture"); + return NULL; + } + + _mesa_init_renderbuffer(&irb->Base, name); + irb->Base.ClassID = INTEL_RB_CLASS; + + if (texImage->TexFormat == &_mesa_texformat_argb8888) { + irb->Base._ActualFormat = GL_RGBA8; + irb->Base._BaseFormat = GL_RGBA; + DBG("Render to RGBA8 texture OK\n"); + } + else if (texImage->TexFormat == &_mesa_texformat_rgb565) { + irb->Base._ActualFormat = GL_RGB5; + irb->Base._BaseFormat = GL_RGB; + DBG("Render to RGB5 texture OK\n"); + } + else if (texImage->TexFormat == &_mesa_texformat_z16) { + irb->Base._ActualFormat = GL_DEPTH_COMPONENT16; + irb->Base._BaseFormat = GL_DEPTH_COMPONENT; + DBG("Render to DEPTH16 texture OK\n"); + } + else { + DBG("Render to texture BAD FORMAT %d\n", + texImage->TexFormat->MesaFormat); + _mesa_free(irb); + return NULL; + } + + irb->Base.InternalFormat = irb->Base._ActualFormat; + irb->Base.Width = texImage->Width; + irb->Base.Height = texImage->Height; + irb->Base.DataType = GL_UNSIGNED_BYTE; /* FBO XXX fix */ + irb->Base.RedBits = texImage->TexFormat->RedBits; + irb->Base.GreenBits = texImage->TexFormat->GreenBits; + irb->Base.BlueBits = texImage->TexFormat->BlueBits; + irb->Base.AlphaBits = texImage->TexFormat->AlphaBits; + irb->Base.DepthBits = texImage->TexFormat->DepthBits; + + irb->Base.Delete = intel_delete_renderbuffer; + irb->Base.AllocStorage = intel_nop_alloc_storage; + intel_set_span_functions(&irb->Base); + + irb->RenderToTexture = GL_TRUE; + + return irb; +} + + +/** + * Called by glFramebufferTexture[123]DEXT() (and other places) to + * prepare for rendering into texture memory. This might be called + * many times to choose different texture levels, cube faces, etc + * before intel_finish_render_texture() is ever called. + */ +static void +intel_render_texture(GLcontext * ctx, + struct gl_framebuffer *fb, + struct gl_renderbuffer_attachment *att) +{ + struct gl_texture_image *newImage + = att->Texture->Image[att->CubeMapFace][att->TextureLevel]; + struct intel_renderbuffer *irb = intel_renderbuffer(att->Renderbuffer); + struct intel_texture_image *intel_image; + GLuint imageOffset; + + (void) fb; + + ASSERT(newImage); + + if (!irb) { + irb = intel_wrap_texture(ctx, newImage); + if (irb) { + /* bind the wrapper to the attachment point */ + att->Renderbuffer = &irb->Base; + } + else { + /* fallback to software rendering */ + _mesa_render_texture(ctx, fb, att); + return; + } + } + + DBG("Begin render texture tid %x tex=%u w=%d h=%d refcount=%d\n", + _glthread_GetID(), + att->Texture->Name, newImage->Width, newImage->Height, + irb->Base.RefCount); + + /* point the renderbufer's region to the texture image region */ + intel_image = intel_texture_image(newImage); + if (irb->region != intel_image->mt->region) { + if (irb->region) + intel_region_release(&irb->region); + intel_region_reference(&irb->region, intel_image->mt->region); + } + + /* compute offset of the particular 2D image within the texture region */ + imageOffset = intel_miptree_image_offset(intel_image->mt, + att->CubeMapFace, + att->TextureLevel); + + if (att->Texture->Target == GL_TEXTURE_3D) { + const GLuint *offsets = intel_miptree_depth_offsets(intel_image->mt, + att->TextureLevel); + imageOffset += offsets[att->Zoffset]; + } + + /* store that offset in the region */ + intel_image->mt->region->draw_offset = imageOffset; + + /* update drawing region, etc */ + intel_draw_buffer(ctx, fb); +} + + +/** + * Called by Mesa when rendering to a texture is done. + */ +static void +intel_finish_render_texture(GLcontext * ctx, + struct gl_renderbuffer_attachment *att) +{ + struct intel_renderbuffer *irb = intel_renderbuffer(att->Renderbuffer); + + DBG("End render texture (tid %x) tex %u\n", _glthread_GetID(), att->Texture->Name); + + if (irb) { + /* just release the region */ + intel_region_release(&irb->region); + } + else if (att->Renderbuffer) { + /* software fallback */ + _mesa_finish_render_texture(ctx, att); + /* XXX FBO: Need to unmap the buffer (or in intelSpanRenderStart???) */ + } +} + + +/** + * Do one-time context initializations related to GL_EXT_framebuffer_object. + * Hook in device driver functions. + */ +void +intel_fbo_init(struct intel_context *intel) +{ + intel->ctx.Driver.NewFramebuffer = intel_new_framebuffer; + intel->ctx.Driver.NewRenderbuffer = intel_new_renderbuffer; + intel->ctx.Driver.BindFramebuffer = intel_bind_framebuffer; + intel->ctx.Driver.FramebufferRenderbuffer = intel_framebuffer_renderbuffer; + intel->ctx.Driver.RenderTexture = intel_render_texture; + intel->ctx.Driver.FinishRenderTexture = intel_finish_render_texture; +} diff --git a/src/mesa/drivers/dri/i915tex/intel_fbo.h b/src/mesa/drivers/dri/i915tex/intel_fbo.h new file mode 100644 index 00000000000..221f09b39ab --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/intel_fbo.h @@ -0,0 +1,80 @@ +/************************************************************************** + * + * Copyright 2006 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. + * + **************************************************************************/ + +#ifndef INTEL_FBO_H +#define INTEL_FBO_H + + +struct intel_context; +struct intel_region; + + +/** + * Intel renderbuffer, derived from gl_renderbuffer. + * Note: The PairedDepth and PairedStencil fields use renderbuffer IDs, + * not pointers because in some circumstances a deleted renderbuffer could + * result in a dangling pointer here. + */ +struct intel_renderbuffer +{ + struct gl_renderbuffer Base; + struct intel_region *region; + void *pfMap; /* possibly paged flipped map pointer */ + GLuint pfPitch; /* possibly paged flipped pitch */ + GLboolean RenderToTexture; /* RTT? */ + + GLuint PairedDepth; /**< only used if this is a depth renderbuffer */ + GLuint PairedStencil; /**< only used if this is a stencil renderbuffer */ +}; + + +extern struct intel_renderbuffer *intel_create_renderbuffer(GLenum intFormat, + GLsizei width, + GLsizei height, + int offset, + int pitch, + int cpp, + void *map); + + +extern void intel_fbo_init(struct intel_context *intel); + + +/* XXX make inline or macro */ +extern struct intel_renderbuffer *intel_get_renderbuffer(struct gl_framebuffer + *fb, + GLuint attIndex); + + +/* XXX make inline or macro */ +extern struct intel_region *intel_get_rb_region(struct gl_framebuffer *fb, + GLuint attIndex); + + + + +#endif /* INTEL_FBO_H */ diff --git a/src/mesa/drivers/dri/i915tex/intel_ioctl.c b/src/mesa/drivers/dri/i915tex/intel_ioctl.c new file mode 100644 index 00000000000..3250c6b3a9c --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/intel_ioctl.c @@ -0,0 +1,138 @@ +/************************************************************************** + * + * Copyright 2003 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. + * + **************************************************************************/ + + +#include +#include +#include +#include + +#include "mtypes.h" +#include "context.h" +#include "swrast/swrast.h" + +#include "intel_context.h" +#include "intel_ioctl.h" +#include "intel_batchbuffer.h" +#include "intel_blit.h" +#include "intel_regions.h" +#include "drm.h" + +#define FILE_DEBUG_FLAG DEBUG_IOCTL + +int +intelEmitIrqLocked(struct intel_context *intel) +{ + drmI830IrqEmit ie; + int ret, seq; + + assert(((*(int *) intel->driHwLock) & ~DRM_LOCK_CONT) == + (DRM_LOCK_HELD | intel->hHWContext)); + + ie.irq_seq = &seq; + + ret = drmCommandWriteRead(intel->driFd, DRM_I830_IRQ_EMIT, + &ie, sizeof(ie)); + if (ret) { + fprintf(stderr, "%s: drmI830IrqEmit: %d\n", __FUNCTION__, ret); + exit(1); + } + + DBG("%s --> %d\n", __FUNCTION__, seq); + + return seq; +} + +void +intelWaitIrq(struct intel_context *intel, int seq) +{ + int ret; + + DBG("%s %d\n", __FUNCTION__, seq); + + intel->iw.irq_seq = seq; + + do { + ret = + drmCommandWrite(intel->driFd, DRM_I830_IRQ_WAIT, &intel->iw, + sizeof(intel->iw)); + } while (ret == -EAGAIN || ret == -EINTR); + + if (ret) { + fprintf(stderr, "%s: drmI830IrqWait: %d\n", __FUNCTION__, ret); + exit(1); + } +} + + +void +intel_batch_ioctl(struct intel_context *intel, + GLuint start_offset, + GLuint used, + GLboolean ignore_cliprects, GLboolean allow_unlock) +{ + drmI830BatchBuffer batch; + + assert(intel->locked); + assert(used); + + DBG("%s used %d offset %x..%x ignore_cliprects %d\n", + __FUNCTION__, + used, start_offset, start_offset + used, ignore_cliprects); + + /* Throw away non-effective packets. Won't work once we have + * hardware contexts which would preserve statechanges beyond a + * single buffer. + */ + + + + batch.start = start_offset; + batch.used = used; + batch.cliprects = intel->pClipRects; + batch.num_cliprects = ignore_cliprects ? 0 : intel->numClipRects; + batch.DR1 = 0; + batch.DR4 = ((((GLuint) intel->drawX) & 0xffff) | + (((GLuint) intel->drawY) << 16)); + + DBG("%s: 0x%x..0x%x DR4: %x cliprects: %d\n", + __FUNCTION__, + batch.start, + batch.start + batch.used * 4, batch.DR4, batch.num_cliprects); + + if (drmCommandWrite(intel->driFd, DRM_I830_BATCHBUFFER, &batch, + sizeof(batch))) { + fprintf(stderr, "DRM_I830_BATCHBUFFER: %d\n", -errno); + UNLOCK_HARDWARE(intel); + exit(1); + } + + /* FIXME: use hardware contexts to avoid 'losing' hardware after + * each buffer flush. + */ + intel->vtbl.lost_hardware(intel); +} diff --git a/src/mesa/drivers/dri/i915tex/intel_ioctl.h b/src/mesa/drivers/dri/i915tex/intel_ioctl.h new file mode 100644 index 00000000000..e8d07de893e --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/intel_ioctl.h @@ -0,0 +1,40 @@ +/************************************************************************** + * + * Copyright 2003 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. + * + **************************************************************************/ + +#ifndef INTEL_IOCTL_H +#define INTEL_IOCTL_H + +#include "intel_context.h" + +void intelWaitIrq(struct intel_context *intel, int seq); +int intelEmitIrqLocked(struct intel_context *intel); + +void intel_batch_ioctl(struct intel_context *intel, + GLuint start_offset, + GLuint used, + GLboolean ignore_cliprects, GLboolean allow_unlock); +#endif diff --git a/src/mesa/drivers/dri/i915tex/intel_mipmap_tree.c b/src/mesa/drivers/dri/i915tex/intel_mipmap_tree.c new file mode 100644 index 00000000000..2b1077aee0d --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/intel_mipmap_tree.c @@ -0,0 +1,347 @@ +/************************************************************************** + * + * Copyright 2006 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. + * + **************************************************************************/ + +#include "intel_context.h" +#include "intel_mipmap_tree.h" +#include "intel_regions.h" +#include "enums.h" + +#define FILE_DEBUG_FLAG DEBUG_MIPTREE + +static GLenum +target_to_target(GLenum target) +{ + switch (target) { + case GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB: + case GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB: + case GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB: + return GL_TEXTURE_CUBE_MAP_ARB; + default: + return target; + } +} + +struct intel_mipmap_tree * +intel_miptree_create(struct intel_context *intel, + GLenum target, + GLenum internal_format, + GLuint first_level, + GLuint last_level, + GLuint width0, + GLuint height0, + GLuint depth0, GLuint cpp, GLuint compress_byte) +{ + GLboolean ok; + struct intel_mipmap_tree *mt = calloc(sizeof(*mt), 1); + + DBG("%s target %s format %s level %d..%d\n", __FUNCTION__, + _mesa_lookup_enum_by_nr(target), + _mesa_lookup_enum_by_nr(internal_format), first_level, last_level); + + mt->target = target_to_target(target); + mt->internal_format = internal_format; + mt->first_level = first_level; + mt->last_level = last_level; + mt->width0 = width0; + mt->height0 = height0; + mt->depth0 = depth0; + mt->cpp = compress_byte ? compress_byte : cpp; + mt->compressed = compress_byte ? 1 : 0; + mt->refcount = 1; + + switch (intel->intelScreen->deviceID) { + case PCI_CHIP_I945_G: + case PCI_CHIP_I945_GM: + ok = i945_miptree_layout(mt); + break; + case PCI_CHIP_I915_G: + case PCI_CHIP_I915_GM: + case PCI_CHIP_I830_M: + case PCI_CHIP_I855_GM: + case PCI_CHIP_I865_G: + default: + /* All the i830 chips and the i915 use this layout: + */ + ok = i915_miptree_layout(mt); + break; + } + + if (ok) + mt->region = intel_region_alloc(intel->intelScreen, + mt->cpp, mt->pitch, mt->total_height); + + if (!mt->region) { + free(mt); + return NULL; + } + + return mt; +} + + +void +intel_miptree_reference(struct intel_mipmap_tree **dst, + struct intel_mipmap_tree *src) +{ + src->refcount++; + *dst = src; + DBG("%s %p refcount now %d\n", __FUNCTION__, src, src->refcount); +} + +void +intel_miptree_release(struct intel_context *intel, + struct intel_mipmap_tree **mt) +{ + if (!*mt) + return; + + DBG("%s %p refcount will be %d\n", __FUNCTION__, *mt, (*mt)->refcount - 1); + if (--(*mt)->refcount <= 0) { + GLuint i; + + DBG("%s deleting %p\n", __FUNCTION__, *mt); + + intel_region_release(&((*mt)->region)); + + for (i = 0; i < MAX_TEXTURE_LEVELS; i++) + if ((*mt)->level[i].image_offset) + free((*mt)->level[i].image_offset); + + free(*mt); + } + *mt = NULL; +} + + + + +/* Can the image be pulled into a unified mipmap tree. This mirrors + * the completeness test in a lot of ways. + * + * Not sure whether I want to pass gl_texture_image here. + */ +GLboolean +intel_miptree_match_image(struct intel_mipmap_tree *mt, + struct gl_texture_image *image, + GLuint face, GLuint level) +{ + /* Images with borders are never pulled into mipmap trees. + */ + if (image->Border) + return GL_FALSE; + + if (image->InternalFormat != mt->internal_format || + image->IsCompressed != mt->compressed) + return GL_FALSE; + + /* Test image dimensions against the base level image adjusted for + * minification. This will also catch images not present in the + * tree, changed targets, etc. + */ + if (image->Width != mt->level[level].width || + image->Height != mt->level[level].height || + image->Depth != mt->level[level].depth) + return GL_FALSE; + + return GL_TRUE; +} + + +void +intel_miptree_set_level_info(struct intel_mipmap_tree *mt, + GLuint level, + GLuint nr_images, + GLuint x, GLuint y, GLuint w, GLuint h, GLuint d) +{ + + mt->level[level].width = w; + mt->level[level].height = h; + mt->level[level].depth = d; + mt->level[level].level_offset = (x + y * mt->pitch) * mt->cpp; + mt->level[level].nr_images = nr_images; + + DBG("%s level %d size: %d,%d,%d offset %d,%d (0x%x)\n", __FUNCTION__, + level, w, h, d, x, y, mt->level[level].level_offset); + + /* Not sure when this would happen, but anyway: + */ + if (mt->level[level].image_offset) { + free(mt->level[level].image_offset); + mt->level[level].image_offset = NULL; + } + + assert(nr_images); + + mt->level[level].image_offset = malloc(nr_images * sizeof(GLuint)); + mt->level[level].image_offset[0] = 0; +} + + + +void +intel_miptree_set_image_offset(struct intel_mipmap_tree *mt, + GLuint level, GLuint img, GLuint x, GLuint y) +{ + if (img == 0 && level == 0) + assert(x == 0 && y == 0); + + assert(img < mt->level[level].nr_images); + + mt->level[level].image_offset[img] = (x + y * mt->pitch); + + DBG("%s level %d img %d pos %d,%d image_offset %x\n", + __FUNCTION__, level, img, x, y, mt->level[level].image_offset[img]); +} + + +/* Although we use the image_offset[] array to store relative offsets + * to cube faces, Mesa doesn't know anything about this and expects + * each cube face to be treated as a separate image. + * + * These functions present that view to mesa: + */ +const GLuint * +intel_miptree_depth_offsets(struct intel_mipmap_tree *mt, GLuint level) +{ + static const GLuint zero = 0; + + if (mt->target != GL_TEXTURE_3D || mt->level[level].nr_images == 1) + return &zero; + else + return mt->level[level].image_offset; +} + + +GLuint +intel_miptree_image_offset(struct intel_mipmap_tree * mt, + GLuint face, GLuint level) +{ + if (mt->target == GL_TEXTURE_CUBE_MAP_ARB) + return (mt->level[level].level_offset + + mt->level[level].image_offset[face] * mt->cpp); + else + return mt->level[level].level_offset; +} + + + +/** + * Map a teximage in a mipmap tree. + * \param row_stride returns row stride in bytes + * \param image_stride returns image stride in bytes (for 3D textures). + * \return address of mapping + */ +GLubyte * +intel_miptree_image_map(struct intel_context * intel, + struct intel_mipmap_tree * mt, + GLuint face, + GLuint level, + GLuint * row_stride, GLuint * image_offsets) +{ + DBG("%s \n", __FUNCTION__); + + if (row_stride) + *row_stride = mt->pitch * mt->cpp; + + if (image_offsets) + memcpy(image_offsets, mt->level[level].image_offset, + mt->level[level].depth * sizeof(GLuint)); + + return (intel_region_map(intel->intelScreen, mt->region) + + intel_miptree_image_offset(mt, face, level)); +} + +void +intel_miptree_image_unmap(struct intel_context *intel, + struct intel_mipmap_tree *mt) +{ + DBG("%s\n", __FUNCTION__); + intel_region_unmap(intel->intelScreen, mt->region); +} + + + +/* Upload data for a particular image. + */ +void +intel_miptree_image_data(struct intel_context *intel, + struct intel_mipmap_tree *dst, + GLuint face, + GLuint level, + void *src, + GLuint src_row_pitch, GLuint src_image_pitch) +{ + GLuint depth = dst->level[level].depth; + GLuint dst_offset = intel_miptree_image_offset(dst, face, level); + const GLuint *dst_depth_offset = intel_miptree_depth_offsets(dst, level); + GLuint i; + GLuint height = 0; + + DBG("%s\n", __FUNCTION__); + for (i = 0; i < depth; i++) { + height = dst->level[level].height; + if(dst->compressed) + height /= 4; + intel_region_data(intel->intelScreen, dst->region, dst_offset + dst_depth_offset[i], 0, 0, src, src_row_pitch, 0, 0, /* source x,y */ + dst->level[level].width, height); + + src += src_image_pitch; + } +} + +/* Copy mipmap image between trees + */ +void +intel_miptree_image_copy(struct intel_context *intel, + struct intel_mipmap_tree *dst, + GLuint face, GLuint level, + struct intel_mipmap_tree *src) +{ + GLuint width = src->level[level].width; + GLuint height = src->level[level].height; + GLuint depth = src->level[level].depth; + GLuint dst_offset = intel_miptree_image_offset(dst, face, level); + GLuint src_offset = intel_miptree_image_offset(src, face, level); + const GLuint *dst_depth_offset = intel_miptree_depth_offsets(dst, level); + const GLuint *src_depth_offset = intel_miptree_depth_offsets(src, level); + GLuint i; + + if (dst->compressed) + height /= 4; + for (i = 0; i < depth; i++) { + intel_region_copy(intel->intelScreen, + dst->region, dst_offset + dst_depth_offset[i], + 0, + 0, + src->region, src_offset + src_depth_offset[i], + 0, 0, width, height); + } + +} diff --git a/src/mesa/drivers/dri/i915tex/intel_mipmap_tree.h b/src/mesa/drivers/dri/i915tex/intel_mipmap_tree.h new file mode 100644 index 00000000000..ecdb7be244f --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/intel_mipmap_tree.h @@ -0,0 +1,198 @@ +/************************************************************************** + * + * Copyright 2006 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. + * + **************************************************************************/ + +#ifndef INTEL_MIPMAP_TREE_H +#define INTEL_MIPMAP_TREE_H + +#include "intel_regions.h" + +/* A layer on top of the intel_regions code which adds: + * + * - Code to size and layout a region to hold a set of mipmaps. + * - Query to determine if a new image fits in an existing tree. + * - More refcounting + * - maybe able to remove refcounting from intel_region? + * - ? + * + * The fixed mipmap layout of intel hardware where one offset + * specifies the position of all images in a mipmap hierachy + * complicates the implementation of GL texture image commands, + * compared to hardware where each image is specified with an + * independent offset. + * + * In an ideal world, each texture object would be associated with a + * single bufmgr buffer or 2d intel_region, and all the images within + * the texture object would slot into the tree as they arrive. The + * reality can be a little messier, as images can arrive from the user + * with sizes that don't fit in the existing tree, or in an order + * where the tree layout cannot be guessed immediately. + * + * This structure encodes an idealized mipmap tree. The GL image + * commands build these where possible, otherwise store the images in + * temporary system buffers. + */ + + +/** + * Describes the location of each texture image within a texture region. + */ +struct intel_mipmap_level +{ + GLuint level_offset; + GLuint width; + GLuint height; + GLuint depth; + GLuint nr_images; + + /* Explicitly store the offset of each image for each cube face or + * depth value. Pretty much have to accept that hardware formats + * are going to be so diverse that there is no unified way to + * compute the offsets of depth/cube images within a mipmap level, + * so have to store them as a lookup table: + */ + GLuint *image_offset; +}; + +struct intel_mipmap_tree +{ + /* Effectively the key: + */ + GLenum target; + GLenum internal_format; + + GLuint first_level; + GLuint last_level; + + GLuint width0, height0, depth0; /**< Level zero image dimensions */ + GLuint cpp; + GLboolean compressed; + + /* Derived from the above: + */ + GLuint pitch; + GLuint depth_pitch; /* per-image on i945? */ + GLuint total_height; + + /* Includes image offset tables: + */ + struct intel_mipmap_level level[MAX_TEXTURE_LEVELS]; + + /* The data is held here: + */ + struct intel_region *region; + + /* These are also refcounted: + */ + GLuint refcount; +}; + + + +struct intel_mipmap_tree *intel_miptree_create(struct intel_context *intel, + GLenum target, + GLenum internal_format, + GLuint first_level, + GLuint last_level, + GLuint width0, + GLuint height0, + GLuint depth0, + GLuint cpp, + GLuint compress_byte); + +void intel_miptree_reference(struct intel_mipmap_tree **dst, + struct intel_mipmap_tree *src); + +void intel_miptree_release(struct intel_context *intel, + struct intel_mipmap_tree **mt); + +/* Check if an image fits an existing mipmap tree layout + */ +GLboolean intel_miptree_match_image(struct intel_mipmap_tree *mt, + struct gl_texture_image *image, + GLuint face, GLuint level); + +/* Return a pointer to an image within a tree. Return image stride as + * well. + */ +GLubyte *intel_miptree_image_map(struct intel_context *intel, + struct intel_mipmap_tree *mt, + GLuint face, + GLuint level, + GLuint * row_stride, GLuint * image_stride); + +void intel_miptree_image_unmap(struct intel_context *intel, + struct intel_mipmap_tree *mt); + + +/* Return the linear offset of an image relative to the start of the + * tree: + */ +GLuint intel_miptree_image_offset(struct intel_mipmap_tree *mt, + GLuint face, GLuint level); + +/* Return pointers to each 2d slice within an image. Indexed by depth + * value. + */ +const GLuint *intel_miptree_depth_offsets(struct intel_mipmap_tree *mt, + GLuint level); + + +void intel_miptree_set_level_info(struct intel_mipmap_tree *mt, + GLuint level, + GLuint nr_images, + GLuint x, GLuint y, + GLuint w, GLuint h, GLuint d); + +void intel_miptree_set_image_offset(struct intel_mipmap_tree *mt, + GLuint level, + GLuint img, GLuint x, GLuint y); + + +/* Upload an image into a tree + */ +void intel_miptree_image_data(struct intel_context *intel, + struct intel_mipmap_tree *dst, + GLuint face, + GLuint level, + void *src, + GLuint src_row_pitch, GLuint src_image_pitch); + +/* Copy an image between two trees + */ +void intel_miptree_image_copy(struct intel_context *intel, + struct intel_mipmap_tree *dst, + GLuint face, GLuint level, + struct intel_mipmap_tree *src); + +/* i915_mipmap_tree.c: + */ +GLboolean i915_miptree_layout(struct intel_mipmap_tree *mt); +GLboolean i945_miptree_layout(struct intel_mipmap_tree *mt); + + + +#endif diff --git a/src/mesa/drivers/dri/i915tex/intel_pixel.c b/src/mesa/drivers/dri/i915tex/intel_pixel.c new file mode 100644 index 00000000000..4fe128deea1 --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/intel_pixel.c @@ -0,0 +1,119 @@ +/************************************************************************** + * + * Copyright 2006 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 portionsalloc + * 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. + * + **************************************************************************/ + +#include "enums.h" +#include "state.h" +#include "swrast/swrast.h" + +#include "intel_context.h" +#include "intel_pixel.h" +#include "intel_regions.h" + + +/** + * Check if any fragment operations are in effect which might effect + * glDraw/CopyPixels. + */ +GLboolean +intel_check_blit_fragment_ops(GLcontext * ctx) +{ + if (ctx->NewState) + _mesa_update_state(ctx); + + /* XXX Note: Scissor could be done with the blitter: + */ + return !(ctx->_ImageTransferState || + ctx->Color.AlphaEnabled || + ctx->Depth.Test || + ctx->Fog.Enabled || + ctx->Scissor.Enabled || + ctx->Stencil.Enabled || + !ctx->Color.ColorMask[0] || + !ctx->Color.ColorMask[1] || + !ctx->Color.ColorMask[2] || + !ctx->Color.ColorMask[3] || + ctx->Color.ColorLogicOpEnabled || + ctx->Texture._EnabledUnits || ctx->FragmentProgram._Enabled); +} + + +GLboolean +intel_check_meta_tex_fragment_ops(GLcontext * ctx) +{ + if (ctx->NewState) + _mesa_update_state(ctx); + + /* Some of _ImageTransferState (scale, bias) could be done with + * fragment programs on i915. + */ + return !(ctx->_ImageTransferState || ctx->Fog.Enabled || /* not done yet */ + ctx->Texture._EnabledUnits || ctx->FragmentProgram._Enabled); +} + +/* The intel_region struct doesn't really do enough to capture the + * format of the pixels in the region. For now this code assumes that + * the region is a display surface and hence is either ARGB8888 or + * RGB565. + * XXX FBO: If we'd pass in the intel_renderbuffer instead of region, we'd + * know the buffer's pixel format. + * + * \param format as given to glDraw/ReadPixels + * \param type as given to glDraw/ReadPixels + */ +GLboolean +intel_check_blit_format(struct intel_region * region, + GLenum format, GLenum type) +{ + if (region->cpp == 4 && + (type == GL_UNSIGNED_INT_8_8_8_8_REV || + type == GL_UNSIGNED_BYTE) && format == GL_BGRA) { + return GL_TRUE; + } + + if (region->cpp == 2 && + type == GL_UNSIGNED_SHORT_5_6_5_REV && format == GL_BGR) { + return GL_TRUE; + } + + if (INTEL_DEBUG & DEBUG_PIXEL) + fprintf(stderr, "%s: bad format for blit (cpp %d, type %s format %s)\n", + __FUNCTION__, region->cpp, + _mesa_lookup_enum_by_nr(type), _mesa_lookup_enum_by_nr(format)); + + return GL_FALSE; +} + + +void +intelInitPixelFuncs(struct dd_function_table *functions) +{ + functions->Accum = _swrast_Accum; + functions->Bitmap = _swrast_Bitmap; + functions->CopyPixels = intelCopyPixels; + functions->ReadPixels = intelReadPixels; + functions->DrawPixels = intelDrawPixels; +} diff --git a/src/mesa/drivers/dri/i915tex/intel_pixel.h b/src/mesa/drivers/dri/i915tex/intel_pixel.h new file mode 100644 index 00000000000..a6fcf90ce03 --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/intel_pixel.h @@ -0,0 +1,63 @@ +/************************************************************************** + * + * Copyright 2006 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. + * + **************************************************************************/ + +#ifndef INTEL_PIXEL_H +#define INTEL_PIXEL_H + +#include "mtypes.h" + +void intelInitPixelFuncs(struct dd_function_table *functions); + +GLboolean intel_check_blit_fragment_ops(GLcontext * ctx); + +GLboolean intel_check_meta_tex_fragment_ops(GLcontext * ctx); + +GLboolean intel_check_blit_format(struct intel_region *region, + GLenum format, GLenum type); + + +void intelReadPixels(GLcontext * ctx, + GLint x, GLint y, + GLsizei width, GLsizei height, + GLenum format, GLenum type, + const struct gl_pixelstore_attrib *pack, + GLvoid * pixels); + +void intelDrawPixels(GLcontext * ctx, + GLint x, GLint y, + GLsizei width, GLsizei height, + GLenum format, + GLenum type, + const struct gl_pixelstore_attrib *unpack, + const GLvoid * pixels); + +void intelCopyPixels(GLcontext * ctx, + GLint srcx, GLint srcy, + GLsizei width, GLsizei height, + GLint destx, GLint desty, GLenum type); + +#endif diff --git a/src/mesa/drivers/dri/i915tex/intel_pixel_bitmap.c b/src/mesa/drivers/dri/i915tex/intel_pixel_bitmap.c new file mode 100644 index 00000000000..65bf338589e --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/intel_pixel_bitmap.c @@ -0,0 +1,350 @@ +/************************************************************************** + * + * Copyright 2006 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 portionsalloc + * 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. + * + **************************************************************************/ + +#include "glheader.h" +#include "enums.h" +#include "image.h" +#include "colormac.h" +#include "mtypes.h" +#include "macros.h" +#include "bufferobj.h" +#include "swrast/swrast.h" + +#include "intel_screen.h" +#include "intel_context.h" +#include "intel_ioctl.h" +#include "intel_batchbuffer.h" +#include "intel_blit.h" +#include "intel_regions.h" +#include "intel_buffer_objects.h" + + + +#define FILE_DEBUG_FLAG DEBUG_PIXEL + + +/* Unlike the other intel_pixel_* functions, the expectation here is + * that the incoming data is not in a PBO. With the XY_TEXT blit + * method, there's no benefit haveing it in a PBO, but we could + * implement a path based on XY_MONO_SRC_COPY_BLIT which might benefit + * PBO bitmaps. I think they are probably pretty rare though - I + * wonder if Xgl uses them? + */ +static const GLubyte *map_pbo( GLcontext *ctx, + GLsizei width, GLsizei height, + const struct gl_pixelstore_attrib *unpack, + const GLubyte *bitmap ) +{ + GLubyte *buf; + + if (!_mesa_validate_pbo_access(2, unpack, width, height, 1, + GL_COLOR_INDEX, GL_BITMAP, + (GLvoid *) bitmap)) { + _mesa_error(ctx, GL_INVALID_OPERATION,"glBitmap(invalid PBO access)"); + return NULL; + } + + buf = (GLubyte *) ctx->Driver.MapBuffer(ctx, GL_PIXEL_UNPACK_BUFFER_EXT, + GL_READ_ONLY_ARB, + unpack->BufferObj); + if (!buf) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glBitmap(PBO is mapped)"); + return NULL; + } + + return ADD_POINTERS(buf, bitmap); +} + +static GLboolean test_bit( const GLubyte *src, + GLuint bit ) +{ + return (src[bit/8] & (1<<(bit % 8))) ? 1 : 0; +} + +static void set_bit( GLubyte *dest, + GLuint bit ) +{ + dest[bit/8] |= 1 << (bit % 8); +} + +static int align(int x, int align) +{ + return (x + align - 1) & ~(align - 1); +} + +/* Extract a rectangle's worth of data from the bitmap. Called + * per-cliprect. + */ +static GLuint get_bitmap_rect(GLsizei width, GLsizei height, + const struct gl_pixelstore_attrib *unpack, + const GLubyte *bitmap, + GLuint x, GLuint y, + GLuint w, GLuint h, + GLubyte *dest, + GLuint row_align, + GLboolean invert) +{ + GLuint src_offset = (x + unpack->SkipPixels) & 0x7; + GLuint mask = unpack->LsbFirst ? 0 : 7; + GLuint bit = 0; + GLint row, col; + GLint first, last; + GLint incr; + GLuint count = 0; + + if (INTEL_DEBUG & DEBUG_PIXEL) + _mesa_printf("%s %d,%d %dx%d bitmap %dx%d skip %d src_offset %d mask %d\n", + __FUNCTION__, x,y,w,h,width,height,unpack->SkipPixels, src_offset, mask); + + if (invert) { + first = h-1; + last = 0; + incr = -1; + } + else { + first = 0; + last = h-1; + incr = 1; + } + + /* Require that dest be pre-zero'd. + */ + for (row = first; row != (last+incr); row += incr) { + const GLubyte *rowsrc = _mesa_image_address2d(unpack, bitmap, + width, height, + GL_COLOR_INDEX, GL_BITMAP, + y + row, x); + + for (col = 0; col < w; col++, bit++) { + if (test_bit(rowsrc, (col + src_offset) ^ mask)) { + set_bit(dest, bit ^ 7); + count++; + } + } + + if (row_align) + bit = (bit + row_align - 1) & ~(row_align - 1); + } + + return count; +} + + + + +/* + * Render a bitmap. + */ +static GLboolean +do_blit_bitmap( GLcontext *ctx, + GLint dstx, GLint dsty, + GLsizei width, GLsizei height, + const struct gl_pixelstore_attrib *unpack, + const GLubyte *bitmap ) +{ + struct intel_context *intel = intel_context(ctx); + struct intel_region *dst = intel_drawbuf_region(intel); + + union { + GLuint ui; + GLubyte ub[4]; + } color; + + + if (unpack->BufferObj->Name) { + bitmap = map_pbo(ctx, width, height, unpack, bitmap); + if (bitmap == NULL) + return GL_TRUE; /* even though this is an error, we're done */ + } + + UNCLAMPED_FLOAT_TO_CHAN(color.ub[0], ctx->Current.RasterColor[2]); + UNCLAMPED_FLOAT_TO_CHAN(color.ub[1], ctx->Current.RasterColor[1]); + UNCLAMPED_FLOAT_TO_CHAN(color.ub[2], ctx->Current.RasterColor[0]); + UNCLAMPED_FLOAT_TO_CHAN(color.ub[3], ctx->Current.RasterColor[3]); + + /* Does zoom apply to bitmaps? + */ + if (!intel_check_blit_fragment_ops(ctx) || + ctx->Pixel.ZoomX != 1.0F || + ctx->Pixel.ZoomY != 1.0F) + return GL_FALSE; + + LOCK_HARDWARE(intel); + + if (intel->driDrawable->numClipRects) { + __DRIdrawablePrivate *dPriv = intel->driDrawable; + drm_clip_rect_t *box = dPriv->pClipRects; + drm_clip_rect_t dest_rect; + GLint nbox = dPriv->numClipRects; + GLint srcx = 0, srcy = 0; + GLint orig_screen_x1, orig_screen_y2; + GLuint i; + + + orig_screen_x1 = dPriv->x + dstx; + orig_screen_y2 = dPriv->y + (dPriv->h - dsty); + + /* Do scissoring in GL coordinates: + */ +x if (ctx->Scissor.Enabled) + { + GLint x = ctx->Scissor.X; + GLint y = ctx->Scissor.Y; + GLuint w = ctx->Scissor.Width; + GLuint h = ctx->Scissor.Height; + + if (!_mesa_clip_to_region(x, y, x+w-1, y+h-1, &dstx, &dsty, &width, &height)) + goto out; + } + + /* Convert from GL to hardware coordinates: + */ + dsty = dPriv->y + (dPriv->h - dsty - height); + dstx = dPriv->x + dstx; + + dest_rect.x1 = dstx; + dest_rect.y1 = dsty; + dest_rect.x2 = dstx + width; + dest_rect.y2 = dsty + height; + + for (i = 0; i < nbox; i++) { + drm_clip_rect_t rect; + int box_w, box_h; + GLint px, py; + GLuint stipple[32]; + + if (!intel_intersect_cliprects(&rect, &dest_rect, &box[i])) + continue; + + /* Now go back to GL coordinates to figure out what subset of + * the bitmap we are uploading for this cliprect: + */ + box_w = rect.x2 - rect.x1; + box_h = rect.y2 - rect.y1; + srcx = rect.x1 - orig_screen_x1; + srcy = orig_screen_y2 - rect.y2; + + +#define DY 32 +#define DX 32 + + /* Then, finally, chop it all into chunks that can be + * digested by hardware: + */ + for (py = 0; py < box_h; py += DY) { + for (px = 0; px < box_w; px += DX) { + int h = MIN2(DY, box_h - py); + int w = MIN2(DX, box_w - px); + GLuint sz = align(align(w,8) * h, 64)/8; + + assert(sz <= sizeof(stipple)); + memset(stipple, 0, sz); + + /* May need to adjust this when padding has been introduced in + * sz above: + */ + if (get_bitmap_rect(width, height, unpack, + bitmap, + srcx + px, srcy + py, w, h, + (GLubyte *)stipple, + 8, + GL_TRUE) == 0) + continue; + + /* + */ + intelEmitImmediateColorExpandBlit( intel, + dst->cpp, + (GLubyte *)stipple, + sz, + color.ui, + dst->pitch, + dst->buffer, + 0, + dst->tiled, + rect.x1 + px, + rect.y2 - (py + h), + w, h); + } + } + } + intel->need_flush = GL_TRUE; + out: + intel_batchbuffer_flush(intel->batch); + } + UNLOCK_HARDWARE(intel); + + + if (unpack->BufferObj->Name) { + /* done with PBO so unmap it now */ + ctx->Driver.UnmapBuffer(ctx, GL_PIXEL_UNPACK_BUFFER_EXT, + unpack->BufferObj); + } + + return GL_TRUE; +} + + + + + +/* There are a large number of possible ways to implement bitmap on + * this hardware, most of them have some sort of drawback. Here are a + * few that spring to mind: + * + * Blit: + * - XY_MONO_SRC_BLT_CMD + * - use XY_SETUP_CLIP_BLT for cliprect clipping. + * - XY_TEXT_BLT + * - XY_TEXT_IMMEDIATE_BLT + * - blit per cliprect, subject to maximum immediate data size. + * - XY_COLOR_BLT + * - per pixel or run of pixels + * - XY_PIXEL_BLT + * - good for sparse bitmaps + * + * 3D engine: + * - Point per pixel + * - Translate bitmap to an alpha texture and render as a quad + * - Chop bitmap up into 32x32 squares and render w/polygon stipple. + */ +void +intelBitmap(GLcontext * ctx, + GLint x, GLint y, + GLsizei width, GLsizei height, + const struct gl_pixelstore_attrib *unpack, + const GLubyte * pixels) +{ + if (do_blit_bitmap(ctx, x, y, width, height, + unpack, pixels)) + return; + + if (INTEL_DEBUG & DEBUG_PIXEL) + _mesa_printf("%s: fallback to swrast\n", __FUNCTION__); + + _swrast_Bitmap(ctx, x, y, width, height, unpack, pixels); +} diff --git a/src/mesa/drivers/dri/i915tex/intel_pixel_copy.c b/src/mesa/drivers/dri/i915tex/intel_pixel_copy.c new file mode 100644 index 00000000000..5eb021f008b --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/intel_pixel_copy.c @@ -0,0 +1,380 @@ +/************************************************************************** + * + * Copyright 2003 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. + * + **************************************************************************/ + +#include "glheader.h" +#include "enums.h" +#include "image.h" +#include "state.h" +#include "mtypes.h" +#include "macros.h" +#include "swrast/swrast.h" + +#include "intel_screen.h" +#include "intel_context.h" +#include "intel_ioctl.h" +#include "intel_batchbuffer.h" +#include "intel_buffers.h" +#include "intel_blit.h" +#include "intel_regions.h" +#include "intel_tris.h" +#include "intel_pixel.h" + +#define FILE_DEBUG_FLAG DEBUG_PIXEL + +static struct intel_region * +copypix_src_region(struct intel_context *intel, GLenum type) +{ + switch (type) { + case GL_COLOR: + return intel_readbuf_region(intel); + case GL_DEPTH: + /* Don't think this is really possible execpt at 16bpp, when we have no stencil. + */ + if (intel->intelScreen->depth_region && + intel->intelScreen->depth_region->cpp == 2) + return intel->intelScreen->depth_region; + case GL_STENCIL: + /* Don't think this is really possible. + */ + break; + case GL_DEPTH_STENCIL_EXT: + /* Does it matter whether it is stencil/depth or depth/stencil? + */ + return intel->intelScreen->depth_region; + default: + break; + } + + return NULL; +} + + +/** + * Check if any fragment operations are in effect which might effect + * glCopyPixels. Differs from intel_check_blit_fragment_ops in that + * we allow Scissor. + */ +static GLboolean +intel_check_copypixel_blit_fragment_ops(GLcontext * ctx) +{ + if (ctx->NewState) + _mesa_update_state(ctx); + + /* Could do logicop with the blitter: + */ + return !(ctx->_ImageTransferState || + ctx->Color.AlphaEnabled || + ctx->Depth.Test || + ctx->Fog.Enabled || + ctx->Stencil.Enabled || + !ctx->Color.ColorMask[0] || + !ctx->Color.ColorMask[1] || + !ctx->Color.ColorMask[2] || + !ctx->Color.ColorMask[3] || + ctx->Color.ColorLogicOpEnabled || + ctx->Texture._EnabledUnits || + ctx->FragmentProgram._Enabled); +} + +/* Doesn't work for overlapping regions. Could do a double copy or + * just fallback. + */ +static GLboolean +do_texture_copypixels(GLcontext * ctx, + GLint srcx, GLint srcy, + GLsizei width, GLsizei height, + GLint dstx, GLint dsty, GLenum type) +{ + struct intel_context *intel = intel_context(ctx); + struct intel_region *dst = intel_drawbuf_region(intel); + struct intel_region *src = copypix_src_region(intel, type); + GLenum src_format; + GLenum src_type; + + DBG("%s %d,%d %dx%d --> %d,%d\n", __FUNCTION__, + srcx, srcy, width, height, dstx, dsty); + + if (!src || !dst || type != GL_COLOR) + return GL_FALSE; + + /* Can't handle overlapping regions. Don't have sufficient control + * over rasterization to pull it off in-place. Punt on these for + * now. + * + * XXX: do a copy to a temporary. + */ + if (src->buffer == dst->buffer) { + drm_clip_rect_t srcbox; + drm_clip_rect_t dstbox; + drm_clip_rect_t tmp; + + srcbox.x1 = srcx; + srcbox.y1 = srcy; + srcbox.x2 = srcx + width; + srcbox.y2 = srcy + height; + + dstbox.x1 = dstx; + dstbox.y1 = dsty; + dstbox.x2 = dstx + width * ctx->Pixel.ZoomX; + dstbox.y2 = dsty + height * ctx->Pixel.ZoomY; + + DBG("src %d,%d %d,%d\n", srcbox.x1, srcbox.y1, srcbox.x2, srcbox.y2); + DBG("dst %d,%d %d,%d (%dx%d) (%f,%f)\n", dstbox.x1, dstbox.y1, dstbox.x2, dstbox.y2, + width, height, ctx->Pixel.ZoomX, ctx->Pixel.ZoomY); + + if (intel_intersect_cliprects(&tmp, &srcbox, &dstbox)) { + DBG("%s: regions overlap\n", __FUNCTION__); + return GL_FALSE; + } + } + + intelFlush(&intel->ctx); + + intel->vtbl.install_meta_state(intel); + + /* Is this true? Also will need to turn depth testing on according + * to state: + */ + intel->vtbl.meta_no_stencil_write(intel); + intel->vtbl.meta_no_depth_write(intel); + + /* Set the 3d engine to draw into the destination region: + */ + intel->vtbl.meta_draw_region(intel, dst, intel->intelScreen->depth_region); + + intel->vtbl.meta_import_pixel_state(intel); + + if (src->cpp == 2) { + src_format = GL_RGB; + src_type = GL_UNSIGNED_SHORT_5_6_5; + } + else { + src_format = GL_BGRA; + src_type = GL_UNSIGNED_BYTE; + } + + /* Set the frontbuffer up as a large rectangular texture. + */ + if (!intel->vtbl.meta_tex_rect_source(intel, src->buffer, 0, + src->pitch, + src->height, src_format, src_type)) { + intel->vtbl.leave_meta_state(intel); + return GL_FALSE; + } + + + intel->vtbl.meta_texture_blend_replace(intel); + + LOCK_HARDWARE(intel); + + if (intel->driDrawable->numClipRects) { + __DRIdrawablePrivate *dPriv = intel->driDrawable; + + + srcy = dPriv->h - srcy - height; /* convert from gl to hardware coords */ + + srcx += dPriv->x; + srcy += dPriv->y; + + /* Clip against the source region. This is the only source + * clipping we do. XXX: Just set the texcord wrap mode to clamp + * or similar. + * + */ + if (0) { + GLint orig_x = srcx; + GLint orig_y = srcy; + + if (!_mesa_clip_to_region(0, 0, src->pitch, src->height, + &srcx, &srcy, &width, &height)) + goto out; + + dstx += srcx - orig_x; + dsty += (srcy - orig_y) * ctx->Pixel.ZoomY; + } + + /* Just use the regular cliprect mechanism... Does this need to + * even hold the lock??? + */ + intel_meta_draw_quad(intel, + dstx, + dstx + width * ctx->Pixel.ZoomX, + dPriv->h - (dsty + height * ctx->Pixel.ZoomY), + dPriv->h - (dsty), 0, /* XXX: what z value? */ + 0x00ff00ff, + srcx, srcx + width, srcy, srcy + height); + + out: + intel->vtbl.leave_meta_state(intel); + intel_batchbuffer_flush(intel->batch); + } + UNLOCK_HARDWARE(intel); + + DBG("%s: success\n", __FUNCTION__); + return GL_TRUE; +} + + + + + +/** + * CopyPixels with the blitter. Don't support zooming, pixel transfer, etc. + */ +static GLboolean +do_blit_copypixels(GLcontext * ctx, + GLint srcx, GLint srcy, + GLsizei width, GLsizei height, + GLint dstx, GLint dsty, GLenum type) +{ + struct intel_context *intel = intel_context(ctx); + struct intel_region *dst = intel_drawbuf_region(intel); + struct intel_region *src = copypix_src_region(intel, type); + + /* Copypixels can be more than a straight copy. Ensure all the + * extra operations are disabled: + */ + if (!intel_check_copypixel_blit_fragment_ops(ctx) || + ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F) + return GL_FALSE; + + if (!src || !dst) + return GL_FALSE; + + + + intelFlush(&intel->ctx); + + LOCK_HARDWARE(intel); + + if (intel->driDrawable->numClipRects) { + __DRIdrawablePrivate *dPriv = intel->driDrawable; + drm_clip_rect_t *box = dPriv->pClipRects; + drm_clip_rect_t dest_rect; + GLint nbox = dPriv->numClipRects; + GLint delta_x = 0; + GLint delta_y = 0; + GLuint i; + + /* Do scissoring in GL coordinates: + */ + if (ctx->Scissor.Enabled) + { + GLint x = ctx->Scissor.X; + GLint y = ctx->Scissor.Y; + GLuint w = ctx->Scissor.Width; + GLuint h = ctx->Scissor.Height; + GLint dx = dstx - srcx; + GLint dy = dsty - srcy; + + if (!_mesa_clip_to_region(x, y, x+w-1, y+h-1, &dstx, &dsty, &width, &height)) + goto out; + + srcx = dstx - dx; + srcy = dsty - dy; + } + + /* Convert from GL to hardware coordinates: + */ + dsty = dPriv->h - dsty - height; + srcy = dPriv->h - srcy - height; + dstx += dPriv->x; + dsty += dPriv->y; + srcx += dPriv->x; + srcy += dPriv->y; + + /* Clip against the source region. This is the only source + * clipping we do. Dst is clipped with cliprects below. + */ + { + delta_x = srcx - dstx; + delta_y = srcy - dsty; + + if (!_mesa_clip_to_region(0, 0, src->pitch, src->height, + &srcx, &srcy, &width, &height)) + goto out; + + dstx = srcx - delta_x; + dsty = srcy - delta_y; + } + + dest_rect.x1 = dstx; + dest_rect.y1 = dsty; + dest_rect.x2 = dstx + width; + dest_rect.y2 = dsty + height; + + /* Could do slightly more clipping: Eg, take the intersection of + * the existing set of cliprects and those cliprects translated + * by delta_x, delta_y: + * + * This code will not overwrite other windows, but will + * introduce garbage when copying from obscured window regions. + */ + for (i = 0; i < nbox; i++) { + drm_clip_rect_t rect; + + if (!intel_intersect_cliprects(&rect, &dest_rect, &box[i])) + continue; + + + intelEmitCopyBlit(intel, dst->cpp, + src->pitch, src->buffer, 0, + dst->pitch, dst->buffer, 0, + rect.x1 + delta_x, rect.y1 + delta_y, /* srcx, srcy */ + rect.x1, rect.y1, /* dstx, dsty */ + rect.x2 - rect.x1, rect.y2 - rect.y1); + } + + out: + intel_batchbuffer_flush(intel->batch); + } + UNLOCK_HARDWARE(intel); + + DBG("%s: success\n", __FUNCTION__); + return GL_TRUE; +} + + +void +intelCopyPixels(GLcontext * ctx, + GLint srcx, GLint srcy, + GLsizei width, GLsizei height, + GLint destx, GLint desty, GLenum type) +{ + if (INTEL_DEBUG & DEBUG_PIXEL) + fprintf(stderr, "%s\n", __FUNCTION__); + + if (do_blit_copypixels(ctx, srcx, srcy, width, height, destx, desty, type)) + return; + + if (do_texture_copypixels(ctx, srcx, srcy, width, height, destx, desty, type)) + return; + + DBG("fallback to _swrast_CopyPixels\n"); + + _swrast_CopyPixels(ctx, srcx, srcy, width, height, destx, desty, type); +} diff --git a/src/mesa/drivers/dri/i915tex/intel_pixel_draw.c b/src/mesa/drivers/dri/i915tex/intel_pixel_draw.c new file mode 100644 index 00000000000..616101aef99 --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/intel_pixel_draw.c @@ -0,0 +1,365 @@ +/************************************************************************** + * + * Copyright 2006 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 portionsalloc + * 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. + * + **************************************************************************/ + +#include "glheader.h" +#include "enums.h" +#include "image.h" +#include "mtypes.h" +#include "macros.h" +#include "bufferobj.h" +#include "swrast/swrast.h" + +#include "intel_screen.h" +#include "intel_context.h" +#include "intel_ioctl.h" +#include "intel_batchbuffer.h" +#include "intel_blit.h" +#include "intel_buffers.h" +#include "intel_regions.h" +#include "intel_pixel.h" +#include "intel_buffer_objects.h" +#include "intel_tris.h" + + + +static GLboolean +do_texture_drawpixels(GLcontext * ctx, + GLint x, GLint y, + GLsizei width, GLsizei height, + GLenum format, GLenum type, + const struct gl_pixelstore_attrib *unpack, + const GLvoid * pixels) +{ + struct intel_context *intel = intel_context(ctx); + struct intel_region *dst = intel_drawbuf_region(intel); + struct intel_buffer_object *src = intel_buffer_object(unpack->BufferObj); + GLuint rowLength = unpack->RowLength ? unpack->RowLength : width; + GLuint src_offset; + + if (INTEL_DEBUG & DEBUG_PIXEL) + fprintf(stderr, "%s\n", __FUNCTION__); + + intelFlush(&intel->ctx); + intel->vtbl.render_start(intel); + intel->vtbl.emit_state(intel); + + if (!dst) + return GL_FALSE; + + if (src) { + if (!_mesa_validate_pbo_access(2, unpack, width, height, 1, + format, type, pixels)) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glDrawPixels"); + return GL_TRUE; + } + } + else { + /* PBO only for now: + */ +/* _mesa_printf("%s - not PBO\n", __FUNCTION__); */ + return GL_FALSE; + } + + /* There are a couple of things we can't do yet, one of which is + * set the correct state for pixel operations when GL texturing is + * enabled. That's a pretty rare state and probably not worth the + * effort. A completely device-independent version of this may do + * more. + * + * Similarly, we make no attempt to merge metaops processing with + * an enabled fragment program, though it would certainly be + * possible. + */ + if (!intel_check_meta_tex_fragment_ops(ctx)) { + if (INTEL_DEBUG & DEBUG_PIXEL) + _mesa_printf("%s - bad GL fragment state for metaops texture\n", + __FUNCTION__); + return GL_FALSE; + } + + intel->vtbl.install_meta_state(intel); + + + /* Is this true? Also will need to turn depth testing on according + * to state: + */ + intel->vtbl.meta_no_stencil_write(intel); + intel->vtbl.meta_no_depth_write(intel); + + /* Set the 3d engine to draw into the destination region: + */ + intel->vtbl.meta_draw_region(intel, dst, intel->intelScreen->depth_region); + + intel->vtbl.meta_import_pixel_state(intel); + + src_offset = (GLuint) _mesa_image_address(2, unpack, pixels, width, height, + format, type, 0, 0, 0); + + + /* Setup the pbo up as a rectangular texture, if possible. + * + * TODO: This is almost always possible if the i915 fragment + * program is adjusted to correctly swizzle the sampled colors. + * The major exception is any 24bit texture, like RGB888, for which + * there is no hardware support. + */ + if (!intel->vtbl.meta_tex_rect_source(intel, src->buffer, src_offset, + rowLength, height, format, type)) { + intel->vtbl.leave_meta_state(intel); + return GL_FALSE; + } + + intel->vtbl.meta_texture_blend_replace(intel); + + + LOCK_HARDWARE(intel); + + if (intel->driDrawable->numClipRects) { + __DRIdrawablePrivate *dPriv = intel->driDrawable; + GLint srcx, srcy; + GLint dstx, dsty; + + dstx = x; + dsty = dPriv->h - (y + height); + + srcx = 0; /* skiprows/pixels already done */ + srcy = 0; + + if (0) { + const GLint orig_x = dstx; + const GLint orig_y = dsty; + + if (!_mesa_clip_to_region(0, 0, dst->pitch, dst->height, + &dstx, &dsty, &width, &height)) + goto out; + + srcx += dstx - orig_x; + srcy += dsty - orig_y; + } + + + if (INTEL_DEBUG & DEBUG_PIXEL) + _mesa_printf("draw %d,%d %dx%d\n", dstx, dsty, width, height); + + /* Must use the regular cliprect mechanism in order to get the + * drawing origin set correctly. Otherwise scissor state is in + * incorrect coordinate space. Does this even need to hold the + * lock??? + */ + intel_meta_draw_quad(intel, + dstx, dstx + width * ctx->Pixel.ZoomX, + dPriv->h - (y + height * ctx->Pixel.ZoomY), + dPriv->h - (y), + -ctx->Current.RasterPos[2] * .5, + 0x00ff00ff, + srcx, srcx + width, srcy + height, srcy); + out: + intel->vtbl.leave_meta_state(intel); + intel_batchbuffer_flush(intel->batch); + } + UNLOCK_HARDWARE(intel); + return GL_TRUE; +} + + + + + +/* Pros: + * - no waiting for idle before updating framebuffer. + * + * Cons: + * - if upload is by memcpy, this may actually be slower than fallback path. + * - uploads the whole image even if destination is clipped + * + * Need to benchmark. + * + * Given the questions about performance, implement for pbo's only. + * This path is definitely a win if the pbo is already in agp. If it + * turns out otherwise, we can add the code necessary to upload client + * data to agp space before performing the blit. (Though it may turn + * out to be better/simpler just to use the texture engine). + */ +static GLboolean +do_blit_drawpixels(GLcontext * ctx, + GLint x, GLint y, + GLsizei width, GLsizei height, + GLenum format, GLenum type, + const struct gl_pixelstore_attrib *unpack, + const GLvoid * pixels) +{ + struct intel_context *intel = intel_context(ctx); + struct intel_region *dest = intel_drawbuf_region(intel); + struct intel_buffer_object *src = intel_buffer_object(unpack->BufferObj); + GLuint src_offset; + GLuint rowLength; + struct _DriFenceObject *fence = NULL; + + if (INTEL_DEBUG & DEBUG_PIXEL) + _mesa_printf("%s\n", __FUNCTION__); + + + if (!dest) { + if (INTEL_DEBUG & DEBUG_PIXEL) + _mesa_printf("%s - no dest\n", __FUNCTION__); + return GL_FALSE; + } + + if (src) { + /* This validation should be done by core mesa: + */ + if (!_mesa_validate_pbo_access(2, unpack, width, height, 1, + format, type, pixels)) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glDrawPixels"); + return GL_TRUE; + } + } + else { + /* PBO only for now: + */ + if (INTEL_DEBUG & DEBUG_PIXEL) + _mesa_printf("%s - not PBO\n", __FUNCTION__); + return GL_FALSE; + } + + if (!intel_check_blit_format(dest, format, type)) { + if (INTEL_DEBUG & DEBUG_PIXEL) + _mesa_printf("%s - bad format for blit\n", __FUNCTION__); + return GL_FALSE; + } + + if (!intel_check_meta_tex_fragment_ops(ctx)) { + if (INTEL_DEBUG & DEBUG_PIXEL) + _mesa_printf("%s - bad GL fragment state for meta tex\n", + __FUNCTION__); + return GL_FALSE; + } + + if (ctx->Pixel.ZoomX != 1.0F) { + if (INTEL_DEBUG & DEBUG_PIXEL) + _mesa_printf("%s - bad PixelZoomX for blit\n", __FUNCTION__); + return GL_FALSE; + } + + + if (unpack->RowLength > 0) + rowLength = unpack->RowLength; + else + rowLength = width; + + if (ctx->Pixel.ZoomY == -1.0F) { + if (INTEL_DEBUG & DEBUG_PIXEL) + _mesa_printf("%s - bad PixelZoomY for blit\n", __FUNCTION__); + return GL_FALSE; /* later */ + y -= height; + } + else if (ctx->Pixel.ZoomY == 1.0F) { + rowLength = -rowLength; + } + else { + if (INTEL_DEBUG & DEBUG_PIXEL) + _mesa_printf("%s - bad PixelZoomY for blit\n", __FUNCTION__); + return GL_FALSE; + } + + src_offset = (GLuint) _mesa_image_address(2, unpack, pixels, width, height, + format, type, 0, 0, 0); + + intelFlush(&intel->ctx); + LOCK_HARDWARE(intel); + + if (intel->driDrawable->numClipRects) { + __DRIdrawablePrivate *dPriv = intel->driDrawable; + int nbox = dPriv->numClipRects; + drm_clip_rect_t *box = dPriv->pClipRects; + drm_clip_rect_t rect; + drm_clip_rect_t dest_rect; + struct _DriBufferObject *src_buffer = + intel_bufferobj_buffer(intel, src, INTEL_READ); + int i; + + dest_rect.x1 = dPriv->x + x; + dest_rect.y1 = dPriv->y + dPriv->h - (y + height); + dest_rect.x2 = dest_rect.x1 + width; + dest_rect.y2 = dest_rect.y1 + height; + + for (i = 0; i < nbox; i++) { + if (!intel_intersect_cliprects(&rect, &dest_rect, &box[i])) + continue; + + intelEmitCopyBlit(intel, + dest->cpp, + rowLength, + src_buffer, src_offset, + dest->pitch, + dest->buffer, 0, + rect.x1 - dest_rect.x1, + rect.y2 - dest_rect.y2, + rect.x1, + rect.y1, rect.x2 - rect.x1, rect.y2 - rect.y1); + } + fence = intel_batchbuffer_flush(intel->batch); + driFenceReference(fence); + } + UNLOCK_HARDWARE(intel); + + if (intel->driDrawable->numClipRects) + driFenceFinish(fence, DRM_FENCE_TYPE_EXE | DRM_I915_FENCE_TYPE_RW, GL_FALSE); + + driFenceUnReference(fence); + + if (INTEL_DEBUG & DEBUG_PIXEL) + _mesa_printf("%s - DONE\n", __FUNCTION__); + + return GL_TRUE; +} + + + +void +intelDrawPixels(GLcontext * ctx, + GLint x, GLint y, + GLsizei width, GLsizei height, + GLenum format, + GLenum type, + const struct gl_pixelstore_attrib *unpack, + const GLvoid * pixels) +{ + if (do_blit_drawpixels(ctx, x, y, width, height, format, type, + unpack, pixels)) + return; + + if (do_texture_drawpixels(ctx, x, y, width, height, format, type, + unpack, pixels)) + return; + + + if (INTEL_DEBUG & DEBUG_PIXEL) + _mesa_printf("%s: fallback to swrast\n", __FUNCTION__); + + _swrast_DrawPixels(ctx, x, y, width, height, format, type, unpack, pixels); +} diff --git a/src/mesa/drivers/dri/i915tex/intel_pixel_read.c b/src/mesa/drivers/dri/i915tex/intel_pixel_read.c new file mode 100644 index 00000000000..c1cc65674d1 --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/intel_pixel_read.c @@ -0,0 +1,317 @@ +/************************************************************************** + * + * Copyright 2003 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. + * + **************************************************************************/ + +#include "glheader.h" +#include "enums.h" +#include "mtypes.h" +#include "macros.h" +#include "image.h" +#include "bufferobj.h" +#include "swrast/swrast.h" + +#include "intel_screen.h" +#include "intel_context.h" +#include "intel_ioctl.h" +#include "intel_batchbuffer.h" +#include "intel_blit.h" +#include "intel_buffers.h" +#include "intel_regions.h" +#include "intel_pixel.h" +#include "intel_buffer_objects.h" + +/* For many applications, the new ability to pull the source buffers + * back out of the GTT and then do the packing/conversion operations + * in software will be as much of an improvement as trying to get the + * blitter and/or texture engine to do the work. + * + * This step is gated on private backbuffers. + * + * Obviously the frontbuffer can't be pulled back, so that is either + * an argument for blit/texture readpixels, or for blitting to a + * temporary and then pulling that back. + * + * When the destination is a pbo, however, it's not clear if it is + * ever going to be pulled to main memory (though the access param + * will be a good hint). So it sounds like we do want to be able to + * choose between blit/texture implementation on the gpu and pullback + * and cpu-based copying. + * + * Unless you can magically turn client memory into a PBO for the + * duration of this call, there will be a cpu-based copying step in + * any case. + */ + + +static GLboolean +do_texture_readpixels(GLcontext * ctx, + GLint x, GLint y, GLsizei width, GLsizei height, + GLenum format, GLenum type, + const struct gl_pixelstore_attrib *pack, + struct intel_region *dest_region) +{ +#if 0 + struct intel_context *intel = intel_context(ctx); + intelScreenPrivate *screen = intel->intelScreen; + GLint pitch = pack->RowLength ? pack->RowLength : width; + __DRIdrawablePrivate *dPriv = intel->driDrawable; + int textureFormat; + GLenum glTextureFormat; + int destFormat, depthFormat, destPitch; + drm_clip_rect_t tmp; + + if (INTEL_DEBUG & DEBUG_PIXEL) + fprintf(stderr, "%s\n", __FUNCTION__); + + + if (ctx->_ImageTransferState || + pack->SwapBytes || pack->LsbFirst || !pack->Invert) { + if (INTEL_DEBUG & DEBUG_PIXEL) + fprintf(stderr, "%s: check_color failed\n", __FUNCTION__); + return GL_FALSE; + } + + intel->vtbl.meta_texrect_source(intel, intel_readbuf_region(intel)); + + if (!intel->vtbl.meta_render_dest(intel, dest_region, type, format)) { + if (INTEL_DEBUG & DEBUG_PIXEL) + fprintf(stderr, "%s: couldn't set dest %s/%s\n", + __FUNCTION__, + _mesa_lookup_enum_by_nr(type), + _mesa_lookup_enum_by_nr(format)); + return GL_FALSE; + } + + LOCK_HARDWARE(intel); + + if (intel->driDrawable->numClipRects) { + intel->vtbl.install_meta_state(intel); + intel->vtbl.meta_no_depth_write(intel); + intel->vtbl.meta_no_stencil_write(intel); + + if (!driClipRectToFramebuffer(ctx->ReadBuffer, &x, &y, &width, &height)) { + UNLOCK_HARDWARE(intel); + SET_STATE(i830, state); + if (INTEL_DEBUG & DEBUG_PIXEL) + fprintf(stderr, "%s: cliprect failed\n", __FUNCTION__); + return GL_TRUE; + } + + y = dPriv->h - y - height; + x += dPriv->x; + y += dPriv->y; + + + /* Set the frontbuffer up as a large rectangular texture. + */ + intel->vtbl.meta_tex_rect_source(intel, src_region, textureFormat); + + + intel->vtbl.meta_texture_blend_replace(i830, glTextureFormat); + + + /* Set the 3d engine to draw into the destination region: + */ + + intel->vtbl.meta_draw_region(intel, dest_region); + intel->vtbl.meta_draw_format(intel, destFormat, depthFormat); /* ?? */ + + + /* Draw a single quad, no cliprects: + */ + intel->vtbl.meta_disable_cliprects(intel); + + intel->vtbl.draw_quad(intel, + 0, width, 0, height, + 0x00ff00ff, x, x + width, y, y + height); + + intel->vtbl.leave_meta_state(intel); + } + UNLOCK_HARDWARE(intel); + + intel_region_wait_fence(ctx, dest_region); /* required by GL */ + return GL_TRUE; +#endif + + return GL_FALSE; +} + + + + +static GLboolean +do_blit_readpixels(GLcontext * ctx, + GLint x, GLint y, GLsizei width, GLsizei height, + GLenum format, GLenum type, + const struct gl_pixelstore_attrib *pack, GLvoid * pixels) +{ + struct intel_context *intel = intel_context(ctx); + struct intel_region *src = intel_readbuf_region(intel); + struct intel_buffer_object *dst = intel_buffer_object(pack->BufferObj); + GLuint dst_offset; + GLuint rowLength; + struct _DriFenceObject *fence = NULL; + + if (INTEL_DEBUG & DEBUG_PIXEL) + _mesa_printf("%s\n", __FUNCTION__); + + if (!src) + return GL_FALSE; + + if (dst) { + /* XXX This validation should be done by core mesa: + */ + if (!_mesa_validate_pbo_access(2, pack, width, height, 1, + format, type, pixels)) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glDrawPixels"); + return GL_TRUE; + } + } + else { + /* PBO only for now: + */ + if (INTEL_DEBUG & DEBUG_PIXEL) + _mesa_printf("%s - not PBO\n", __FUNCTION__); + return GL_FALSE; + } + + + if (ctx->_ImageTransferState || + !intel_check_blit_format(src, format, type)) { + if (INTEL_DEBUG & DEBUG_PIXEL) + _mesa_printf("%s - bad format for blit\n", __FUNCTION__); + return GL_FALSE; + } + + if (pack->Alignment != 1 || pack->SwapBytes || pack->LsbFirst) { + if (INTEL_DEBUG & DEBUG_PIXEL) + _mesa_printf("%s: bad packing params\n", __FUNCTION__); + return GL_FALSE; + } + + if (pack->RowLength > 0) + rowLength = pack->RowLength; + else + rowLength = width; + + if (pack->Invert) { + if (INTEL_DEBUG & DEBUG_PIXEL) + _mesa_printf("%s: MESA_PACK_INVERT not done yet\n", __FUNCTION__); + return GL_FALSE; + } + else { + rowLength = -rowLength; + } + + /* XXX 64-bit cast? */ + dst_offset = (GLuint) _mesa_image_address(2, pack, pixels, width, height, + format, type, 0, 0, 0); + + + /* Although the blits go on the command buffer, need to do this and + * fire with lock held to guarentee cliprects are correct. + */ + intelFlush(&intel->ctx); + LOCK_HARDWARE(intel); + + if (intel->driDrawable->numClipRects) { + GLboolean all = (width * height * src->cpp == dst->Base.Size && + x == 0 && dst_offset == 0); + + struct _DriBufferObject *dst_buffer = + intel_bufferobj_buffer(intel, dst, all ? INTEL_WRITE_FULL : + INTEL_WRITE_PART); + __DRIdrawablePrivate *dPriv = intel->driDrawable; + int nbox = dPriv->numClipRects; + drm_clip_rect_t *box = dPriv->pClipRects; + drm_clip_rect_t rect; + drm_clip_rect_t src_rect; + int i; + + src_rect.x1 = dPriv->x + x; + src_rect.y1 = dPriv->y + dPriv->h - (y + height); + src_rect.x2 = src_rect.x1 + width; + src_rect.y2 = src_rect.y1 + height; + + + + for (i = 0; i < nbox; i++) { + if (!intel_intersect_cliprects(&rect, &src_rect, &box[i])) + continue; + + intelEmitCopyBlit(intel, + src->cpp, + src->pitch, src->buffer, 0, + rowLength, + dst_buffer, dst_offset, + rect.x1, + rect.y1, + rect.x1 - src_rect.x1, + rect.y2 - src_rect.y2, + rect.x2 - rect.x1, rect.y2 - rect.y1); + } + + fence = intel_batchbuffer_flush(intel->batch); + driFenceReference(fence); + + } + UNLOCK_HARDWARE(intel); + + if (intel->driDrawable->numClipRects) + driFenceFinish(fence, DRM_FENCE_TYPE_EXE | DRM_I915_FENCE_TYPE_RW, + GL_FALSE); + + driFenceUnReference(fence); + if (INTEL_DEBUG & DEBUG_PIXEL) + _mesa_printf("%s - DONE\n", __FUNCTION__); + + return GL_TRUE; +} + +void +intelReadPixels(GLcontext * ctx, + GLint x, GLint y, GLsizei width, GLsizei height, + GLenum format, GLenum type, + const struct gl_pixelstore_attrib *pack, GLvoid * pixels) +{ + if (INTEL_DEBUG & DEBUG_PIXEL) + fprintf(stderr, "%s\n", __FUNCTION__); + + intelFlush(ctx); + + if (do_blit_readpixels + (ctx, x, y, width, height, format, type, pack, pixels)) + return; + + if (do_texture_readpixels + (ctx, x, y, width, height, format, type, pack, pixels)) + return; + + if (INTEL_DEBUG & DEBUG_PIXEL) + _mesa_printf("%s: fallback to swrast\n", __FUNCTION__); + + _swrast_ReadPixels(ctx, x, y, width, height, format, type, pack, pixels); +} diff --git a/src/mesa/drivers/dri/i915tex/intel_reg.h b/src/mesa/drivers/dri/i915tex/intel_reg.h new file mode 100644 index 00000000000..1ec153266c7 --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/intel_reg.h @@ -0,0 +1,84 @@ +/************************************************************************** + * + * Copyright 2003 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. + * + **************************************************************************/ + + +#ifndef _INTEL_REG_H_ +#define _INTEL_REG_H_ + + + +#define CMD_3D (0x3<<29) + + +#define _3DPRIMITIVE ((0x3<<29)|(0x1f<<24)) +#define PRIM_INDIRECT (1<<23) +#define PRIM_INLINE (0<<23) +#define PRIM_INDIRECT_SEQUENTIAL (0<<17) +#define PRIM_INDIRECT_ELTS (1<<17) + +#define PRIM3D_TRILIST (0x0<<18) +#define PRIM3D_TRISTRIP (0x1<<18) +#define PRIM3D_TRISTRIP_RVRSE (0x2<<18) +#define PRIM3D_TRIFAN (0x3<<18) +#define PRIM3D_POLY (0x4<<18) +#define PRIM3D_LINELIST (0x5<<18) +#define PRIM3D_LINESTRIP (0x6<<18) +#define PRIM3D_RECTLIST (0x7<<18) +#define PRIM3D_POINTLIST (0x8<<18) +#define PRIM3D_DIB (0x9<<18) +#define PRIM3D_MASK (0x1f<<18) + +#define I915PACKCOLOR4444(r,g,b,a) \ + ((((a) & 0xf0) << 8) | (((r) & 0xf0) << 4) | ((g) & 0xf0) | ((b) >> 4)) + +#define I915PACKCOLOR1555(r,g,b,a) \ + ((((r) & 0xf8) << 7) | (((g) & 0xf8) << 2) | (((b) & 0xf8) >> 3) | \ + ((a) ? 0x8000 : 0)) + +#define I915PACKCOLOR565(r,g,b) \ + ((((r) & 0xf8) << 8) | (((g) & 0xfc) << 3) | (((b) & 0xf8) >> 3)) + +#define I915PACKCOLOR8888(r,g,b,a) \ + ((a<<24) | (r<<16) | (g<<8) | b) + + + + +#define BR00_BITBLT_CLIENT 0x40000000 +#define BR00_OP_COLOR_BLT 0x10000000 +#define BR00_OP_SRC_COPY_BLT 0x10C00000 +#define BR13_SOLID_PATTERN 0x80000000 + +#define XY_COLOR_BLT_CMD ((2<<29)|(0x50<<22)|0x4) +#define XY_COLOR_BLT_WRITE_ALPHA (1<<21) +#define XY_COLOR_BLT_WRITE_RGB (1<<20) + +#define XY_SRC_COPY_BLT_CMD ((2<<29)|(0x53<<22)|6) +#define XY_SRC_COPY_BLT_WRITE_ALPHA (1<<21) +#define XY_SRC_COPY_BLT_WRITE_RGB (1<<20) + +#endif diff --git a/src/mesa/drivers/dri/i915tex/intel_regions.c b/src/mesa/drivers/dri/i915tex/intel_regions.c new file mode 100644 index 00000000000..064a34cda81 --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/intel_regions.c @@ -0,0 +1,466 @@ +/************************************************************************** + * + * Copyright 2006 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. + * + **************************************************************************/ + +/* Provide additional functionality on top of bufmgr buffers: + * - 2d semantics and blit operations + * - refcounting of buffers for multiple images in a buffer. + * - refcounting of buffer mappings. + * - some logic for moving the buffers to the best memory pools for + * given operations. + * + * Most of this is to make it easier to implement the fixed-layout + * mipmap tree required by intel hardware in the face of GL's + * programming interface where each image can be specifed in random + * order and it isn't clear what layout the tree should have until the + * last moment. + */ + +#include "intel_context.h" +#include "intel_regions.h" +#include "intel_blit.h" +#include "intel_buffer_objects.h" +#include "dri_bufmgr.h" +#include "intel_batchbuffer.h" + +#define FILE_DEBUG_FLAG DEBUG_REGION + +void +intel_region_idle(intelScreenPrivate *intelScreen, struct intel_region *region) +{ + DBG("%s\n", __FUNCTION__); + if (region && region->buffer) + driBOWaitIdle(region->buffer, GL_FALSE); +} + +/* XXX: Thread safety? + */ +GLubyte * +intel_region_map(intelScreenPrivate *intelScreen, struct intel_region *region) +{ + DBG("%s\n", __FUNCTION__); + if (!region->map_refcount++) { + if (region->pbo) + intel_region_cow(intelScreen, region); + + region->map = driBOMap(region->buffer, + DRM_BO_FLAG_READ | DRM_BO_FLAG_WRITE, 0); + } + + return region->map; +} + +void +intel_region_unmap(intelScreenPrivate *intelScreen, struct intel_region *region) +{ + DBG("%s\n", __FUNCTION__); + if (!--region->map_refcount) { + driBOUnmap(region->buffer); + region->map = NULL; + } +} + +#undef TEST_CACHED_TEXTURES + +struct intel_region * +intel_region_alloc(intelScreenPrivate *intelScreen, + GLuint cpp, GLuint pitch, GLuint height) +{ + struct intel_region *region = calloc(sizeof(*region), 1); + + DBG("%s\n", __FUNCTION__); + + region->cpp = cpp; + region->pitch = pitch; + region->height = height; /* needed? */ + region->refcount = 1; + + driGenBuffers(intelScreen->regionPool, + "region", 1, ®ion->buffer, 64, +#ifdef TEST_CACHED_TEXTURES + DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_BIND_CACHED | + DRM_BO_FLAG_READ | DRM_BO_FLAG_WRITE, +#else + 0, +#endif + 0); + driBOData(region->buffer, pitch * cpp * height, NULL, 0); + return region; +} + +void +intel_region_reference(struct intel_region **dst, struct intel_region *src) +{ + assert(*dst == NULL); + if (src) { + src->refcount++; + *dst = src; + } +} + +void +intel_region_release(struct intel_region **region) +{ + if (!*region) + return; + + DBG("%s %d\n", __FUNCTION__, (*region)->refcount - 1); + + ASSERT((*region)->refcount > 0); + (*region)->refcount--; + + if ((*region)->refcount == 0) { + assert((*region)->map_refcount == 0); + + if ((*region)->pbo) + (*region)->pbo->region = NULL; + (*region)->pbo = NULL; + driBOUnReference((*region)->buffer); + free(*region); + } + *region = NULL; +} + + +struct intel_region * +intel_region_create_static(intelScreenPrivate *intelScreen, + GLuint mem_type, + GLuint offset, + void *virtual, + GLuint cpp, GLuint pitch, GLuint height) +{ + struct intel_region *region = calloc(sizeof(*region), 1); + DBG("%s\n", __FUNCTION__); + + region->cpp = cpp; + region->pitch = pitch; + region->height = height; /* needed? */ + region->refcount = 1; + + /* + * We use a "shared" buffer type to indicate buffers created and + * shared by others. + */ + + driGenBuffers(intelScreen->staticPool, "static region", 1, + ®ion->buffer, 64, + DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_NO_MOVE | + DRM_BO_FLAG_READ | DRM_BO_FLAG_WRITE, 0); + driBOSetStatic(region->buffer, offset, pitch * cpp * height, virtual, 0); + + return region; +} + + + +void +intel_region_update_static(intelScreenPrivate *intelScreen, + struct intel_region *region, + GLuint mem_type, + GLuint offset, + void *virtual, + GLuint cpp, GLuint pitch, GLuint height) +{ + DBG("%s\n", __FUNCTION__); + + region->cpp = cpp; + region->pitch = pitch; + region->height = height; /* needed? */ + + /* + * We use a "shared" buffer type to indicate buffers created and + * shared by others. + */ + + driDeleteBuffers(1, ®ion->buffer); + driGenBuffers(intelScreen->staticPool, "static region", 1, + ®ion->buffer, 64, + DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_NO_MOVE | + DRM_BO_FLAG_READ | DRM_BO_FLAG_WRITE, 0); + driBOSetStatic(region->buffer, offset, pitch * cpp * height, virtual, 0); + +} + + + +/* + * XXX Move this into core Mesa? + */ +static void +_mesa_copy_rect(GLubyte * dst, + GLuint cpp, + GLuint dst_pitch, + GLuint dst_x, + GLuint dst_y, + GLuint width, + GLuint height, + GLubyte * src, GLuint src_pitch, GLuint src_x, GLuint src_y) +{ + GLuint i; + + dst_pitch *= cpp; + src_pitch *= cpp; + dst += dst_x * cpp; + src += src_x * cpp; + dst += dst_y * dst_pitch; + src += src_y * dst_pitch; + width *= cpp; + + if (width == dst_pitch && width == src_pitch) + memcpy(dst, src, height * width); + else { + for (i = 0; i < height; i++) { + memcpy(dst, src, width); + dst += dst_pitch; + src += src_pitch; + } + } +} + + +/* Upload data to a rectangular sub-region. Lots of choices how to do this: + * + * - memcpy by span to current destination + * - upload data as new buffer and blit + * + * Currently always memcpy. + */ +void +intel_region_data(intelScreenPrivate *intelScreen, + struct intel_region *dst, + GLuint dst_offset, + GLuint dstx, GLuint dsty, + void *src, GLuint src_pitch, + GLuint srcx, GLuint srcy, GLuint width, GLuint height) +{ + struct intel_context *intel = intelScreenContext(intelScreen); + + DBG("%s\n", __FUNCTION__); + + if (intel == NULL) + return; + + if (dst->pbo) { + if (dstx == 0 && + dsty == 0 && width == dst->pitch && height == dst->height) + intel_region_release_pbo(intelScreen, dst); + else + intel_region_cow(intelScreen, dst); + } + + + LOCK_HARDWARE(intel); + + _mesa_copy_rect(intel_region_map(intelScreen, dst) + dst_offset, + dst->cpp, + dst->pitch, + dstx, dsty, width, height, src, src_pitch, srcx, srcy); + + intel_region_unmap(intelScreen, dst); + + UNLOCK_HARDWARE(intel); + +} + +/* Copy rectangular sub-regions. Need better logic about when to + * push buffers into AGP - will currently do so whenever possible. + */ +void +intel_region_copy(intelScreenPrivate *intelScreen, + struct intel_region *dst, + GLuint dst_offset, + GLuint dstx, GLuint dsty, + struct intel_region *src, + GLuint src_offset, + GLuint srcx, GLuint srcy, GLuint width, GLuint height) +{ + struct intel_context *intel = intelScreenContext(intelScreen); + + DBG("%s\n", __FUNCTION__); + + if (intel == NULL) + return; + + if (dst->pbo) { + if (dstx == 0 && + dsty == 0 && width == dst->pitch && height == dst->height) + intel_region_release_pbo(intelScreen, dst); + else + intel_region_cow(intelScreen, dst); + } + + assert(src->cpp == dst->cpp); + + intelEmitCopyBlit(intel, + dst->cpp, + src->pitch, src->buffer, src_offset, + dst->pitch, dst->buffer, dst_offset, + srcx, srcy, dstx, dsty, width, height); +} + +/* Fill a rectangular sub-region. Need better logic about when to + * push buffers into AGP - will currently do so whenever possible. + */ +void +intel_region_fill(intelScreenPrivate *intelScreen, + struct intel_region *dst, + GLuint dst_offset, + GLuint dstx, GLuint dsty, + GLuint width, GLuint height, GLuint color) +{ + struct intel_context *intel = intelScreenContext(intelScreen); + + DBG("%s\n", __FUNCTION__); + + if (intel == NULL) + return; + + if (dst->pbo) { + if (dstx == 0 && + dsty == 0 && width == dst->pitch && height == dst->height) + intel_region_release_pbo(intelScreen, dst); + else + intel_region_cow(intelScreen, dst); + } + + intelEmitFillBlit(intel, + dst->cpp, + dst->pitch, dst->buffer, dst_offset, + dstx, dsty, width, height, color); +} + +/* Attach to a pbo, discarding our data. Effectively zero-copy upload + * the pbo's data. + */ +void +intel_region_attach_pbo(intelScreenPrivate *intelScreen, + struct intel_region *region, + struct intel_buffer_object *pbo) +{ + if (region->pbo == pbo) + return; + + /* If there is already a pbo attached, break the cow tie now. + * Don't call intel_region_release_pbo() as that would + * unnecessarily allocate a new buffer we would have to immediately + * discard. + */ + if (region->pbo) { + region->pbo->region = NULL; + region->pbo = NULL; + } + + if (region->buffer) { + driDeleteBuffers(1, ®ion->buffer); + region->buffer = NULL; + } + + region->pbo = pbo; + region->pbo->region = region; + region->buffer = driBOReference(pbo->buffer); +} + + +/* Break the COW tie to the pbo. The pbo gets to keep the data. + */ +void +intel_region_release_pbo(intelScreenPrivate *intelScreen, + struct intel_region *region) +{ + assert(region->buffer == region->pbo->buffer); + region->pbo->region = NULL; + region->pbo = NULL; + driBOUnReference(region->buffer); + region->buffer = NULL; + + driGenBuffers(intelScreen->regionPool, + "region", 1, ®ion->buffer, 64, 0, 0); + driBOData(region->buffer, + region->cpp * region->pitch * region->height, NULL, 0); +} + +/* Break the COW tie to the pbo. Both the pbo and the region end up + * with a copy of the data. + */ +void +intel_region_cow(intelScreenPrivate *intelScreen, struct intel_region *region) +{ + struct intel_context *intel = intelScreenContext(intelScreen); + struct intel_buffer_object *pbo = region->pbo; + + if (intel == NULL) + return; + + intel_region_release_pbo(intelScreen, region); + + assert(region->cpp * region->pitch * region->height == pbo->Base.Size); + + DBG("%s (%d bytes)\n", __FUNCTION__, pbo->Base.Size); + + /* Now blit from the texture buffer to the new buffer: + */ + + intel_batchbuffer_flush(intel->batch); + + if (!intel->locked) { + LOCK_HARDWARE(intel); + intelEmitCopyBlit(intel, + region->cpp, + region->pitch, + region->buffer, 0, + region->pitch, + pbo->buffer, 0, + 0, 0, 0, 0, region->pitch, region->height); + + intel_batchbuffer_flush(intel->batch); + UNLOCK_HARDWARE(intel); + } + else { + intelEmitCopyBlit(intel, + region->cpp, + region->pitch, + region->buffer, 0, + region->pitch, + pbo->buffer, 0, + 0, 0, 0, 0, region->pitch, region->height); + + intel_batchbuffer_flush(intel->batch); + } +} + +struct _DriBufferObject * +intel_region_buffer(intelScreenPrivate *intelScreen, + struct intel_region *region, GLuint flag) +{ + if (region->pbo) { + if (flag == INTEL_WRITE_PART) + intel_region_cow(intelScreen, region); + else if (flag == INTEL_WRITE_FULL) + intel_region_release_pbo(intelScreen, region); + } + + return region->buffer; +} diff --git a/src/mesa/drivers/dri/i915tex/intel_regions.h b/src/mesa/drivers/dri/i915tex/intel_regions.h new file mode 100644 index 00000000000..1415bace690 --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/intel_regions.h @@ -0,0 +1,141 @@ +/************************************************************************** + * + * Copyright 2006 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. + * + **************************************************************************/ + +#ifndef INTEL_REGIONS_H +#define INTEL_REGIONS_H + +#include "mtypes.h" +#include "intel_screen.h" + +struct intel_context; +struct intel_buffer_object; + +/** + * A layer on top of the bufmgr buffers that adds a few useful things: + * + * - Refcounting for local buffer references. + * - Refcounting for buffer maps + * - Buffer dimensions - pitch and height. + * - Blitter commands for copying 2D regions between buffers. (really???) + */ +struct intel_region +{ + struct _DriBufferObject *buffer; /**< buffer manager's buffer ID */ + GLuint refcount; /**< Reference count for region */ + GLuint cpp; /**< bytes per pixel */ + GLuint pitch; /**< in pixels */ + GLuint height; /**< in pixels */ + GLubyte *map; /**< only non-NULL when region is actually mapped */ + GLuint map_refcount; /**< Reference count for mapping */ + + GLuint draw_offset; /**< Offset of drawing address within the region */ + + struct intel_buffer_object *pbo; /* zero-copy uploads */ +}; + + +/* Allocate a refcounted region. Pointers to regions should only be + * copied by calling intel_reference_region(). + */ +struct intel_region *intel_region_alloc(intelScreenPrivate *intelScreen, + GLuint cpp, + GLuint pitch, GLuint height); + +void intel_region_reference(struct intel_region **dst, + struct intel_region *src); + +void intel_region_release(struct intel_region **ib); + +extern struct intel_region +*intel_region_create_static(intelScreenPrivate *intelScreen, + GLuint mem_type, + GLuint offset, + void *virtual, + GLuint cpp, + GLuint pitch, GLuint height); +extern void +intel_region_update_static(intelScreenPrivate *intelScreen, + struct intel_region *region, + GLuint mem_type, + GLuint offset, + void *virtual, + GLuint cpp, GLuint pitch, GLuint height); + + +void intel_region_idle(intelScreenPrivate *intelScreen, + struct intel_region *ib); + +/* Map/unmap regions. This is refcounted also: + */ +GLubyte *intel_region_map(intelScreenPrivate *intelScreen, + struct intel_region *ib); + +void intel_region_unmap(intelScreenPrivate *intelScreen, struct intel_region *ib); + + +/* Upload data to a rectangular sub-region + */ +void intel_region_data(intelScreenPrivate *intelScreen, + struct intel_region *dest, + GLuint dest_offset, + GLuint destx, GLuint desty, + void *src, GLuint src_stride, + GLuint srcx, GLuint srcy, GLuint width, GLuint height); + +/* Copy rectangular sub-regions + */ +void intel_region_copy(intelScreenPrivate *intelScreen, + struct intel_region *dest, + GLuint dest_offset, + GLuint destx, GLuint desty, + struct intel_region *src, + GLuint src_offset, + GLuint srcx, GLuint srcy, GLuint width, GLuint height); + +/* Fill a rectangular sub-region + */ +void intel_region_fill(intelScreenPrivate *intelScreen, + struct intel_region *dest, + GLuint dest_offset, + GLuint destx, GLuint desty, + GLuint width, GLuint height, GLuint color); + +/* Helpers for zerocopy uploads, particularly texture image uploads: + */ +void intel_region_attach_pbo(intelScreenPrivate *intelScreen, + struct intel_region *region, + struct intel_buffer_object *pbo); +void intel_region_release_pbo(intelScreenPrivate *intelScreen, + struct intel_region *region); +void intel_region_cow(intelScreenPrivate *intelScreen, + struct intel_region *region); + +struct _DriBufferObject *intel_region_buffer(intelScreenPrivate *intelScreen, + struct intel_region *region, + GLuint flag); + +#endif diff --git a/src/mesa/drivers/dri/i915tex/intel_render.c b/src/mesa/drivers/dri/i915tex/intel_render.c new file mode 100644 index 00000000000..f9fa55051ea --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/intel_render.c @@ -0,0 +1,242 @@ +/************************************************************************** + * + * Copyright 2003 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. + * + **************************************************************************/ + +/* + * Render unclipped vertex buffers by emitting vertices directly to + * dma buffers. Use strip/fan hardware acceleration where possible. + * + */ +#include "glheader.h" +#include "context.h" +#include "macros.h" +#include "imports.h" +#include "mtypes.h" +#include "enums.h" + +#include "tnl/t_context.h" +#include "tnl/t_vertex.h" + +#include "intel_screen.h" +#include "intel_context.h" +#include "intel_tris.h" +#include "intel_batchbuffer.h" +#include "intel_reg.h" + +/* + * Render unclipped vertex buffers by emitting vertices directly to + * dma buffers. Use strip/fan hardware primitives where possible. + * Try to simulate missing primitives with indexed vertices. + */ +#define HAVE_POINTS 0 /* Has it, but can't use because subpixel has to + * be adjusted for points on the INTEL/I845G + */ +#define HAVE_LINES 1 +#define HAVE_LINE_STRIPS 1 +#define HAVE_TRIANGLES 1 +#define HAVE_TRI_STRIPS 1 +#define HAVE_TRI_STRIP_1 0 /* has it, template can't use it yet */ +#define HAVE_TRI_FANS 1 +#define HAVE_POLYGONS 1 +#define HAVE_QUADS 0 +#define HAVE_QUAD_STRIPS 0 + +#define HAVE_ELTS 0 + +static GLuint hw_prim[GL_POLYGON + 1] = { + 0, + PRIM3D_LINELIST, + PRIM3D_LINESTRIP, + PRIM3D_LINESTRIP, + PRIM3D_TRILIST, + PRIM3D_TRISTRIP, + PRIM3D_TRIFAN, + 0, + 0, + PRIM3D_POLY +}; + +static const GLenum reduced_prim[GL_POLYGON + 1] = { + GL_POINTS, + GL_LINES, + GL_LINES, + GL_LINES, + GL_TRIANGLES, + GL_TRIANGLES, + GL_TRIANGLES, + GL_TRIANGLES, + GL_TRIANGLES, + GL_TRIANGLES +}; + +static const int scale_prim[GL_POLYGON + 1] = { + 0, /* fallback case */ + 1, + 2, + 2, + 1, + 3, + 3, + 0, /* fallback case */ + 0, /* fallback case */ + 3 +}; + + +static void +intelDmaPrimitive(struct intel_context *intel, GLenum prim) +{ + if (0) + fprintf(stderr, "%s %s\n", __FUNCTION__, _mesa_lookup_enum_by_nr(prim)); + INTEL_FIREVERTICES(intel); + intel->vtbl.reduced_primitive_state(intel, reduced_prim[prim]); + intelStartInlinePrimitive(intel, hw_prim[prim], INTEL_BATCH_CLIPRECTS); +} + + +#define LOCAL_VARS struct intel_context *intel = intel_context(ctx) +#define INIT( prim ) \ +do { \ + intelDmaPrimitive( intel, prim ); \ +} while (0) + +#define FLUSH() INTEL_FIREVERTICES(intel) + +#define GET_SUBSEQUENT_VB_MAX_VERTS() \ + ((intel->batch->size - 1500) / (intel->vertex_size*4)) +#define GET_CURRENT_VB_MAX_VERTS() GET_SUBSEQUENT_VB_MAX_VERTS() + +#define ALLOC_VERTS( nr ) \ + intelExtendInlinePrimitive( intel, (nr) * intel->vertex_size ) + +#define EMIT_VERTS( ctx, j, nr, buf ) \ + _tnl_emit_vertices_to_buffer(ctx, j, (j)+(nr), buf ) + +#define TAG(x) intel_##x +#include "tnl_dd/t_dd_dmatmp.h" + + +/**********************************************************************/ +/* Render pipeline stage */ +/**********************************************************************/ + +/* Heuristic to choose between the two render paths: + */ +static GLboolean +choose_render(struct intel_context *intel, struct vertex_buffer *VB) +{ + int vertsz = intel->vertex_size; + int cost_render = 0; + int cost_fallback = 0; + int nr_prims = 0; + int nr_rprims = 0; + int nr_rverts = 0; + int rprim = intel->reduced_primitive; + int i = 0; + + for (i = 0; i < VB->PrimitiveCount; i++) { + GLuint prim = VB->Primitive[i].mode; + GLuint length = VB->Primitive[i].count; + + if (!length) + continue; + + nr_prims++; + nr_rverts += length * scale_prim[prim & PRIM_MODE_MASK]; + + if (reduced_prim[prim & PRIM_MODE_MASK] != rprim) { + nr_rprims++; + rprim = reduced_prim[prim & PRIM_MODE_MASK]; + } + } + + /* One point for each generated primitive: + */ + cost_render = nr_prims; + cost_fallback = nr_rprims; + + /* One point for every 1024 dwords (4k) of dma: + */ + cost_render += (vertsz * i) / 1024; + cost_fallback += (vertsz * nr_rverts) / 1024; + + if (0) + fprintf(stderr, "cost render: %d fallback: %d\n", + cost_render, cost_fallback); + + if (cost_render > cost_fallback) + return GL_FALSE; + + return GL_TRUE; +} + + +static GLboolean +intel_run_render(GLcontext * ctx, struct tnl_pipeline_stage *stage) +{ + struct intel_context *intel = intel_context(ctx); + TNLcontext *tnl = TNL_CONTEXT(ctx); + struct vertex_buffer *VB = &tnl->vb; + GLuint i; + + /* Don't handle clipping or indexed vertices. + */ + if (intel->RenderIndex != 0 || + !intel_validate_render(ctx, VB) || !choose_render(intel, VB)) { + return GL_TRUE; + } + + tnl->clipspace.new_inputs |= VERT_BIT_POS; + + tnl->Driver.Render.Start(ctx); + + for (i = 0; i < VB->PrimitiveCount; i++) { + GLuint prim = VB->Primitive[i].mode; + GLuint start = VB->Primitive[i].start; + GLuint length = VB->Primitive[i].count; + + if (!length) + continue; + + intel_render_tab_verts[prim & PRIM_MODE_MASK] (ctx, start, + start + length, prim); + } + + tnl->Driver.Render.Finish(ctx); + + INTEL_FIREVERTICES(intel); + + return GL_FALSE; /* finished the pipe */ +} + +const struct tnl_pipeline_stage _intel_render_stage = { + "intel render", + NULL, + NULL, + NULL, + NULL, + intel_run_render /* run */ +}; diff --git a/src/mesa/drivers/dri/i915tex/intel_rotate.c b/src/mesa/drivers/dri/i915tex/intel_rotate.c new file mode 100644 index 00000000000..12d98c4ad2f --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/intel_rotate.c @@ -0,0 +1,237 @@ + +/** + * Routines for simple 2D->2D transformations for rotated, flipped screens. + * + * XXX This code is not intel-specific. Move it into a common/utility + * someday. + */ + +#include "intel_rotate.h" + +#define MIN2(A, B) ( ((A) < (B)) ? (A) : (B) ) + +#define ABS(A) ( ((A) < 0) ? -(A) : (A) ) + + +void +matrix23Set(struct matrix23 *m, + int m00, int m01, int m02, int m10, int m11, int m12) +{ + m->m00 = m00; + m->m01 = m01; + m->m02 = m02; + m->m10 = m10; + m->m11 = m11; + m->m12 = m12; +} + + +/* + * Transform (x,y) coordinate by the given matrix. + */ +void +matrix23TransformCoordf(const struct matrix23 *m, float *x, float *y) +{ + const float x0 = *x; + const float y0 = *y; + + *x = m->m00 * x0 + m->m01 * y0 + m->m02; + *y = m->m10 * x0 + m->m11 * y0 + m->m12; +} + + +void +matrix23TransformCoordi(const struct matrix23 *m, int *x, int *y) +{ + const int x0 = *x; + const int y0 = *y; + + *x = m->m00 * x0 + m->m01 * y0 + m->m02; + *y = m->m10 * x0 + m->m11 * y0 + m->m12; +} + + +/* + * Transform a width and height by the given matrix. + * XXX this could be optimized quite a bit. + */ +void +matrix23TransformDistance(const struct matrix23 *m, int *xDist, int *yDist) +{ + int x0 = 0, y0 = 0; + int x1 = *xDist, y1 = 0; + int x2 = 0, y2 = *yDist; + matrix23TransformCoordi(m, &x0, &y0); + matrix23TransformCoordi(m, &x1, &y1); + matrix23TransformCoordi(m, &x2, &y2); + + *xDist = (x1 - x0) + (x2 - x0); + *yDist = (y1 - y0) + (y2 - y0); + + if (*xDist < 0) + *xDist = -*xDist; + if (*yDist < 0) + *yDist = -*yDist; +} + + +/** + * Transform the rect defined by (x, y, w, h) by m. + */ +void +matrix23TransformRect(const struct matrix23 *m, int *x, int *y, int *w, + int *h) +{ + int x0 = *x, y0 = *y; + int x1 = *x + *w, y1 = *y; + int x2 = *x + *w, y2 = *y + *h; + int x3 = *x, y3 = *y + *h; + matrix23TransformCoordi(m, &x0, &y0); + matrix23TransformCoordi(m, &x1, &y1); + matrix23TransformCoordi(m, &x2, &y2); + matrix23TransformCoordi(m, &x3, &y3); + *w = ABS(x1 - x0) + ABS(x2 - x1); + /**w = ABS(*w);*/ + *h = ABS(y1 - y0) + ABS(y2 - y1); + /**h = ABS(*h);*/ + *x = MIN2(x0, x1); + *x = MIN2(*x, x2); + *y = MIN2(y0, y1); + *y = MIN2(*y, y2); +} + + +/* + * Make rotation matrix for width X height screen. + */ +void +matrix23Rotate(struct matrix23 *m, int width, int height, int angle) +{ + switch (angle) { + case 0: + matrix23Set(m, 1, 0, 0, 0, 1, 0); + break; + case 90: + matrix23Set(m, 0, 1, 0, -1, 0, width); + break; + case 180: + matrix23Set(m, -1, 0, width, 0, -1, height); + break; + case 270: + matrix23Set(m, 0, -1, height, 1, 0, 0); + break; + default: + /*abort() */ ; + } +} + + +/* + * Make flip/reflection matrix for width X height screen. + */ +void +matrix23Flip(struct matrix23 *m, int width, int height, int xflip, int yflip) +{ + if (xflip) { + m->m00 = -1; + m->m01 = 0; + m->m02 = width - 1; + } + else { + m->m00 = 1; + m->m01 = 0; + m->m02 = 0; + } + if (yflip) { + m->m10 = 0; + m->m11 = -1; + m->m12 = height - 1; + } + else { + m->m10 = 0; + m->m11 = 1; + m->m12 = 0; + } +} + + +/* + * result = a * b + */ +void +matrix23Multiply(struct matrix23 *result, + const struct matrix23 *a, const struct matrix23 *b) +{ + result->m00 = a->m00 * b->m00 + a->m01 * b->m10; + result->m01 = a->m00 * b->m01 + a->m01 * b->m11; + result->m02 = a->m00 * b->m02 + a->m01 * b->m12 + a->m02; + + result->m10 = a->m10 * b->m00 + a->m11 * b->m10; + result->m11 = a->m10 * b->m01 + a->m11 * b->m11; + result->m12 = a->m10 * b->m02 + a->m11 * b->m12 + a->m12; +} + + +#if 000 + +#include + +int +main(int argc, char *argv[]) +{ + int width = 500, height = 400; + int rot; + int fx = 0, fy = 0; /* flip x and/or y ? */ + int coords[4][2]; + + /* four corner coords to test with */ + coords[0][0] = 0; + coords[0][1] = 0; + coords[1][0] = width - 1; + coords[1][1] = 0; + coords[2][0] = width - 1; + coords[2][1] = height - 1; + coords[3][0] = 0; + coords[3][1] = height - 1; + + + for (rot = 0; rot < 360; rot += 90) { + struct matrix23 rotate, flip, m; + int i; + + printf("Rot %d, xFlip %d, yFlip %d:\n", rot, fx, fy); + + /* make transformation matrix 'm' */ + matrix23Rotate(&rotate, width, height, rot); + matrix23Flip(&flip, width, height, fx, fy); + matrix23Multiply(&m, &rotate, &flip); + + /* xform four coords */ + for (i = 0; i < 4; i++) { + int x = coords[i][0]; + int y = coords[i][1]; + matrix23TransformCoordi(&m, &x, &y); + printf(" %d, %d -> %d %d\n", coords[i][0], coords[i][1], x, y); + } + + /* xform width, height */ + { + int x = width; + int y = height; + matrix23TransformDistance(&m, &x, &y); + printf(" %d x %d -> %d x %d\n", width, height, x, y); + } + + /* xform rect */ + { + int x = 50, y = 10, w = 200, h = 100; + matrix23TransformRect(&m, &x, &y, &w, &h); + printf(" %d,%d %d x %d -> %d, %d %d x %d\n", 50, 10, 200, 100, + x, y, w, h); + } + + } + + return 0; +} +#endif diff --git a/src/mesa/drivers/dri/i915tex/intel_rotate.h b/src/mesa/drivers/dri/i915tex/intel_rotate.h new file mode 100644 index 00000000000..9c8802ca477 --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/intel_rotate.h @@ -0,0 +1,39 @@ +#ifndef INTEL_ROTATE_H +#define INTEL_ROTATE_H 1 + +struct matrix23 +{ + int m00, m01, m02; + int m10, m11, m12; +}; + + + +extern void +matrix23Set(struct matrix23 *m, + int m00, int m01, int m02, int m10, int m11, int m12); + +extern void matrix23TransformCoordi(const struct matrix23 *m, int *x, int *y); + +extern void +matrix23TransformCoordf(const struct matrix23 *m, float *x, float *y); + +extern void +matrix23TransformDistance(const struct matrix23 *m, int *xDist, int *yDist); + +extern void +matrix23TransformRect(const struct matrix23 *m, + int *x, int *y, int *w, int *h); + +extern void +matrix23Rotate(struct matrix23 *m, int width, int height, int angle); + +extern void +matrix23Flip(struct matrix23 *m, int width, int height, int xflip, int yflip); + +extern void +matrix23Multiply(struct matrix23 *result, + const struct matrix23 *a, const struct matrix23 *b); + + +#endif /* INTEL_ROTATE_H */ diff --git a/src/mesa/drivers/dri/i915tex/intel_screen.c b/src/mesa/drivers/dri/i915tex/intel_screen.c new file mode 100644 index 00000000000..9bbfabbb8c3 --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/intel_screen.c @@ -0,0 +1,864 @@ +/************************************************************************** + * + * Copyright 2003 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. + * + **************************************************************************/ + +#include "glheader.h" +#include "context.h" +#include "framebuffer.h" +#include "matrix.h" +#include "renderbuffer.h" +#include "simple_list.h" +#include "utils.h" +#include "vblank.h" +#include "xmlpool.h" + + +#include "intel_screen.h" + +#include "intel_buffers.h" +#include "intel_tex.h" +#include "intel_span.h" +#include "intel_tris.h" +#include "intel_ioctl.h" +#include "intel_fbo.h" + +#include "i830_dri.h" +#include "dri_bufpool.h" +#include "intel_regions.h" +#include "intel_batchbuffer.h" + +PUBLIC const char __driConfigOptions[] = + DRI_CONF_BEGIN DRI_CONF_SECTION_PERFORMANCE + DRI_CONF_FTHROTTLE_MODE(DRI_CONF_FTHROTTLE_IRQS) + DRI_CONF_VBLANK_MODE(DRI_CONF_VBLANK_DEF_INTERVAL_0) + DRI_CONF_SECTION_END DRI_CONF_SECTION_QUALITY + DRI_CONF_FORCE_S3TC_ENABLE(false) + DRI_CONF_ALLOW_LARGE_TEXTURES(1) + DRI_CONF_SECTION_END DRI_CONF_END; + const GLuint __driNConfigOptions = 4; + +#ifdef USE_NEW_INTERFACE + static PFNGLXCREATECONTEXTMODES create_context_modes = NULL; +#endif /*USE_NEW_INTERFACE */ + + extern const struct dri_extension card_extensions[]; + +/** + * Map all the memory regions described by the screen. + * \return GL_TRUE if success, GL_FALSE if error. + */ +GLboolean +intelMapScreenRegions(__DRIscreenPrivate * sPriv) +{ + intelScreenPrivate *intelScreen = (intelScreenPrivate *) sPriv->private; + + if (intelScreen->front.handle) { + if (drmMap(sPriv->fd, + intelScreen->front.handle, + intelScreen->front.size, + (drmAddress *) & intelScreen->front.map) != 0) { + _mesa_problem(NULL, "drmMap(frontbuffer) failed!"); + return GL_FALSE; + } + } + else { + _mesa_warning(NULL, "no front buffer handle in intelMapScreenRegions!"); + } + + if (0) + _mesa_printf("Back 0x%08x ", intelScreen->back.handle); + if (drmMap(sPriv->fd, + intelScreen->back.handle, + intelScreen->back.size, + (drmAddress *) & intelScreen->back.map) != 0) { + intelUnmapScreenRegions(intelScreen); + return GL_FALSE; + } + + if (0) + _mesa_printf("Depth 0x%08x ", intelScreen->depth.handle); + if (drmMap(sPriv->fd, + intelScreen->depth.handle, + intelScreen->depth.size, + (drmAddress *) & intelScreen->depth.map) != 0) { + intelUnmapScreenRegions(intelScreen); + return GL_FALSE; + } + +#if 0 + _mesa_printf("TEX 0x%08x ", intelScreen->tex.handle); + if (drmMap(sPriv->fd, + intelScreen->tex.handle, + intelScreen->tex.size, + (drmAddress *) & intelScreen->tex.map) != 0) { + intelUnmapScreenRegions(intelScreen); + return GL_FALSE; + } +#endif + if (0) + printf("Mappings: front: %p back: %p depth: %p tex: %p\n", + intelScreen->front.map, + intelScreen->back.map, + intelScreen->depth.map, intelScreen->tex.map); + return GL_TRUE; +} + + +static struct intel_region * +intel_recreate_static(intelScreenPrivate *intelScreen, + struct intel_region *region, + GLuint mem_type, + GLuint offset, + void *virtual, + GLuint cpp, GLuint pitch, GLuint height) +{ + if (region) { + intel_region_update_static(intelScreen, region, mem_type, offset, + virtual, cpp, pitch, height); + } else { + region = intel_region_create_static(intelScreen, mem_type, offset, + virtual, cpp, pitch, height); + } + return region; +} + + +/* Create intel_region structs to describe the static front,back,depth + * buffers created by the xserver. + * + * Although FBO's mean we now no longer use these as render targets in + * all circumstances, they won't go away until the back and depth + * buffers become private, and the front and rotated buffers will + * remain even then. + * + * Note that these don't allocate video memory, just describe + * allocations alread made by the X server. + */ +static void +intel_recreate_static_regions(intelScreenPrivate *intelScreen) +{ + intelScreen->front_region = + intel_recreate_static(intelScreen, + intelScreen->front_region, + DRM_BO_FLAG_MEM_TT, + intelScreen->front.offset, + intelScreen->front.map, + intelScreen->cpp, + intelScreen->front.pitch / intelScreen->cpp, + intelScreen->height); + + intelScreen->rotated_region = + intel_recreate_static(intelScreen, + intelScreen->rotated_region, + DRM_BO_FLAG_MEM_TT, + intelScreen->rotated.offset, + intelScreen->rotated.map, + intelScreen->cpp, + intelScreen->rotated.pitch / + intelScreen->cpp, intelScreen->height); + + + intelScreen->back_region = + intel_recreate_static(intelScreen, + intelScreen->back_region, + DRM_BO_FLAG_MEM_TT, + intelScreen->back.offset, + intelScreen->back.map, + intelScreen->cpp, + intelScreen->back.pitch / intelScreen->cpp, + intelScreen->height); + + /* Still assuming front.cpp == depth.cpp + */ + intelScreen->depth_region = + intel_recreate_static(intelScreen, + intelScreen->depth_region, + DRM_BO_FLAG_MEM_TT, + intelScreen->depth.offset, + intelScreen->depth.map, + intelScreen->cpp, + intelScreen->depth.pitch / intelScreen->cpp, + intelScreen->height); +} + +/** + * Use the information in the sarea to update the screen parameters + * related to screen rotation. Needs to be called locked. + */ +void +intelUpdateScreenRotation(__DRIscreenPrivate * sPriv, drmI830Sarea * sarea) +{ + intelScreenPrivate *intelScreen = (intelScreenPrivate *) sPriv->private; + + intelUnmapScreenRegions(intelScreen); + intelUpdateScreenFromSAREA(intelScreen, sarea); + if (!intelMapScreenRegions(sPriv)) { + fprintf(stderr, "ERROR Remapping screen regions!!!\n"); + } + intel_recreate_static_regions(intelScreen); +} + + +void +intelUnmapScreenRegions(intelScreenPrivate * intelScreen) +{ +#define REALLY_UNMAP 1 + if (intelScreen->front.map) { +#if REALLY_UNMAP + if (drmUnmap(intelScreen->front.map, intelScreen->front.size) != 0) + printf("drmUnmap front failed!\n"); +#endif + intelScreen->front.map = NULL; + } + if (intelScreen->back.map) { +#if REALLY_UNMAP + if (drmUnmap(intelScreen->back.map, intelScreen->back.size) != 0) + printf("drmUnmap back failed!\n"); +#endif + intelScreen->back.map = NULL; + } + if (intelScreen->depth.map) { +#if REALLY_UNMAP + drmUnmap(intelScreen->depth.map, intelScreen->depth.size); + intelScreen->depth.map = NULL; +#endif + } + if (intelScreen->tex.map) { +#if REALLY_UNMAP + drmUnmap(intelScreen->tex.map, intelScreen->tex.size); + intelScreen->tex.map = NULL; +#endif + } +} + + +static void +intelPrintDRIInfo(intelScreenPrivate * intelScreen, + __DRIscreenPrivate * sPriv, I830DRIPtr gDRIPriv) +{ + fprintf(stderr, "*** Front size: 0x%x offset: 0x%x pitch: %d\n", + intelScreen->front.size, intelScreen->front.offset, + intelScreen->front.pitch); + fprintf(stderr, "*** Back size: 0x%x offset: 0x%x pitch: %d\n", + intelScreen->back.size, intelScreen->back.offset, + intelScreen->back.pitch); + fprintf(stderr, "*** Depth size: 0x%x offset: 0x%x pitch: %d\n", + intelScreen->depth.size, intelScreen->depth.offset, + intelScreen->depth.pitch); + fprintf(stderr, "*** Rotated size: 0x%x offset: 0x%x pitch: %d\n", + intelScreen->rotated.size, intelScreen->rotated.offset, + intelScreen->rotated.pitch); + fprintf(stderr, "*** Texture size: 0x%x offset: 0x%x\n", + intelScreen->tex.size, intelScreen->tex.offset); + fprintf(stderr, "*** Memory : 0x%x\n", gDRIPriv->mem); +} + + +static void +intelPrintSAREA(const drmI830Sarea * sarea) +{ + fprintf(stderr, "SAREA: sarea width %d height %d\n", sarea->width, + sarea->height); + fprintf(stderr, "SAREA: pitch: %d\n", sarea->pitch); + fprintf(stderr, + "SAREA: front offset: 0x%08x size: 0x%x handle: 0x%x\n", + sarea->front_offset, sarea->front_size, + (unsigned) sarea->front_handle); + fprintf(stderr, + "SAREA: back offset: 0x%08x size: 0x%x handle: 0x%x\n", + sarea->back_offset, sarea->back_size, + (unsigned) sarea->back_handle); + fprintf(stderr, "SAREA: depth offset: 0x%08x size: 0x%x handle: 0x%x\n", + sarea->depth_offset, sarea->depth_size, + (unsigned) sarea->depth_handle); + fprintf(stderr, "SAREA: tex offset: 0x%08x size: 0x%x handle: 0x%x\n", + sarea->tex_offset, sarea->tex_size, (unsigned) sarea->tex_handle); + fprintf(stderr, "SAREA: rotation: %d\n", sarea->rotation); + fprintf(stderr, + "SAREA: rotated offset: 0x%08x size: 0x%x\n", + sarea->rotated_offset, sarea->rotated_size); + fprintf(stderr, "SAREA: rotated pitch: %d\n", sarea->rotated_pitch); +} + + +/** + * A number of the screen parameters are obtained/computed from + * information in the SAREA. This function updates those parameters. + */ +void +intelUpdateScreenFromSAREA(intelScreenPrivate * intelScreen, + drmI830Sarea * sarea) +{ + intelScreen->width = sarea->width; + intelScreen->height = sarea->height; + + intelScreen->front.offset = sarea->front_offset; + intelScreen->front.pitch = sarea->pitch * intelScreen->cpp; + intelScreen->front.handle = sarea->front_handle; + intelScreen->front.size = sarea->front_size; + + intelScreen->back.offset = sarea->back_offset; + intelScreen->back.pitch = sarea->pitch * intelScreen->cpp; + intelScreen->back.handle = sarea->back_handle; + intelScreen->back.size = sarea->back_size; + + intelScreen->depth.offset = sarea->depth_offset; + intelScreen->depth.pitch = sarea->pitch * intelScreen->cpp; + intelScreen->depth.handle = sarea->depth_handle; + intelScreen->depth.size = sarea->depth_size; + + intelScreen->tex.offset = sarea->tex_offset; + intelScreen->logTextureGranularity = sarea->log_tex_granularity; + intelScreen->tex.handle = sarea->tex_handle; + intelScreen->tex.size = sarea->tex_size; + + intelScreen->rotated.offset = sarea->rotated_offset; + intelScreen->rotated.pitch = sarea->rotated_pitch * intelScreen->cpp; + intelScreen->rotated.size = sarea->rotated_size; + intelScreen->current_rotation = sarea->rotation; + matrix23Rotate(&intelScreen->rotMatrix, + sarea->width, sarea->height, sarea->rotation); + intelScreen->rotatedWidth = sarea->virtualX; + intelScreen->rotatedHeight = sarea->virtualY; + + if (0) + intelPrintSAREA(sarea); +} + + +static GLboolean +intelInitDriver(__DRIscreenPrivate * sPriv) +{ + intelScreenPrivate *intelScreen; + I830DRIPtr gDRIPriv = (I830DRIPtr) sPriv->pDevPriv; + drmI830Sarea *sarea; + unsigned batchPoolSize = 1024*1024; + + PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension = + (PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface-> + getProcAddress("glxEnableExtension")); + void *const psc = sPriv->psc->screenConfigs; + + if (sPriv->devPrivSize != sizeof(I830DRIRec)) { + fprintf(stderr, + "\nERROR! sizeof(I830DRIRec) does not match passed size from device driver\n"); + return GL_FALSE; + } + + /* Allocate the private area */ + intelScreen = (intelScreenPrivate *) CALLOC(sizeof(intelScreenPrivate)); + if (!intelScreen) { + fprintf(stderr, "\nERROR! Allocating private area failed\n"); + return GL_FALSE; + } + /* parse information in __driConfigOptions */ + driParseOptionInfo(&intelScreen->optionCache, + __driConfigOptions, __driNConfigOptions); + + intelScreen->driScrnPriv = sPriv; + sPriv->private = (void *) intelScreen; + intelScreen->sarea_priv_offset = gDRIPriv->sarea_priv_offset; + sarea = (drmI830Sarea *) + (((GLubyte *) sPriv->pSAREA) + intelScreen->sarea_priv_offset); + + intelScreen->maxBatchSize = BATCH_SZ; + intelScreen->deviceID = gDRIPriv->deviceID; + if (intelScreen->deviceID == PCI_CHIP_I865_G) + intelScreen->maxBatchSize = 4096; + batchPoolSize /= intelScreen->maxBatchSize; + + intelScreen->mem = gDRIPriv->mem; + intelScreen->cpp = gDRIPriv->cpp; + + switch (gDRIPriv->bitsPerPixel) { + case 16: + intelScreen->fbFormat = DV_PF_565; + break; + case 32: + intelScreen->fbFormat = DV_PF_8888; + break; + default: + exit(1); + break; + } + + intelUpdateScreenFromSAREA(intelScreen, sarea); + + if (!intelMapScreenRegions(sPriv)) { + fprintf(stderr, "\nERROR! mapping regions\n"); + _mesa_free(intelScreen); + sPriv->private = NULL; + return GL_FALSE; + } + +#if 0 + + /* + * FIXME: Remove this code and its references. + */ + + intelScreen->tex.offset = gDRIPriv->textureOffset; + intelScreen->logTextureGranularity = gDRIPriv->logTextureGranularity; + intelScreen->tex.handle = gDRIPriv->textures; + intelScreen->tex.size = gDRIPriv->textureSize; + +#else + intelScreen->tex.offset = 0; + intelScreen->logTextureGranularity = 0; + intelScreen->tex.handle = 0; + intelScreen->tex.size = 0; +#endif + + intelScreen->sarea_priv_offset = gDRIPriv->sarea_priv_offset; + + if (0) + intelPrintDRIInfo(intelScreen, sPriv, gDRIPriv); + + intelScreen->drmMinor = sPriv->drmMinor; + + /* Determine if IRQs are active? */ + { + int ret; + drmI830GetParam gp; + + gp.param = I830_PARAM_IRQ_ACTIVE; + gp.value = &intelScreen->irq_active; + + ret = drmCommandWriteRead(sPriv->fd, DRM_I830_GETPARAM, + &gp, sizeof(gp)); + if (ret) { + fprintf(stderr, "drmI830GetParam: %d\n", ret); + return GL_FALSE; + } + } + + /* Determine if batchbuffers are allowed */ + { + int ret; + drmI830GetParam gp; + + gp.param = I830_PARAM_ALLOW_BATCHBUFFER; + gp.value = &intelScreen->allow_batchbuffer; + + ret = drmCommandWriteRead(sPriv->fd, DRM_I830_GETPARAM, + &gp, sizeof(gp)); + if (ret) { + fprintf(stderr, "drmI830GetParam: (%d) %d\n", gp.param, ret); + return GL_FALSE; + } + } + + if (glx_enable_extension != NULL) { + (*glx_enable_extension) (psc, "GLX_SGI_swap_control"); + (*glx_enable_extension) (psc, "GLX_SGI_video_sync"); + (*glx_enable_extension) (psc, "GLX_MESA_swap_control"); + (*glx_enable_extension) (psc, "GLX_MESA_swap_frame_usage"); + (*glx_enable_extension) (psc, "GLX_SGI_make_current_read"); + } + + intelScreen->regionPool = driDRMPoolInit(sPriv->fd); + + if (!intelScreen->regionPool) + return GL_FALSE; + + intelScreen->staticPool = driDRMStaticPoolInit(sPriv->fd); + + if (!intelScreen->staticPool) + return GL_FALSE; + + intelScreen->texPool = intelScreen->regionPool; + + intelScreen->batchPool = driBatchPoolInit(sPriv->fd, + DRM_BO_FLAG_EXE | + DRM_BO_FLAG_MEM_TT | + DRM_BO_FLAG_MEM_LOCAL, + intelScreen->maxBatchSize, + batchPoolSize, 5); + if (!intelScreen->batchPool) { + fprintf(stderr, "Failed to initialize batch pool - possible incorrect agpgart installed\n"); + return GL_FALSE; + } + + intel_recreate_static_regions(intelScreen); + + return GL_TRUE; +} + + +static void +intelDestroyScreen(__DRIscreenPrivate * sPriv) +{ + intelScreenPrivate *intelScreen = (intelScreenPrivate *) sPriv->private; + + intelUnmapScreenRegions(intelScreen); + + driPoolTakeDown(intelScreen->regionPool); + driPoolTakeDown(intelScreen->staticPool); + driPoolTakeDown(intelScreen->batchPool); + FREE(intelScreen); + sPriv->private = NULL; +} + + +/** + * This is called when we need to set up GL rendering to a new X window. + */ +static GLboolean +intelCreateBuffer(__DRIscreenPrivate * driScrnPriv, + __DRIdrawablePrivate * driDrawPriv, + const __GLcontextModes * mesaVis, GLboolean isPixmap) +{ + intelScreenPrivate *screen = (intelScreenPrivate *) driScrnPriv->private; + + if (isPixmap) { + return GL_FALSE; /* not implemented */ + } + else { + GLboolean swStencil = (mesaVis->stencilBits > 0 && + mesaVis->depthBits != 24); + GLenum rgbFormat = (mesaVis->redBits == 5 ? GL_RGB5 : GL_RGBA8); + + struct gl_framebuffer *fb = _mesa_create_framebuffer(mesaVis); + + /* setup the hardware-based renderbuffers */ + { + struct intel_renderbuffer *frontRb + = intel_create_renderbuffer(rgbFormat, + screen->width, screen->height, + screen->front.offset, + screen->front.pitch, + screen->cpp, + screen->front.map); + intel_set_span_functions(&frontRb->Base); + _mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &frontRb->Base); + } + + if (mesaVis->doubleBufferMode) { + struct intel_renderbuffer *backRb + = intel_create_renderbuffer(rgbFormat, + screen->width, screen->height, + screen->back.offset, + screen->back.pitch, + screen->cpp, + screen->back.map); + intel_set_span_functions(&backRb->Base); + _mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &backRb->Base); + } + + if (mesaVis->depthBits == 24 && mesaVis->stencilBits == 8) { + /* combined depth/stencil buffer */ + struct intel_renderbuffer *depthStencilRb + = intel_create_renderbuffer(GL_DEPTH24_STENCIL8_EXT, + screen->width, screen->height, + screen->depth.offset, + screen->depth.pitch, + screen->cpp, /* 4! */ + screen->depth.map); + intel_set_span_functions(&depthStencilRb->Base); + /* note: bind RB to two attachment points */ + _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthStencilRb->Base); + _mesa_add_renderbuffer(fb, BUFFER_STENCIL, &depthStencilRb->Base); + } + else if (mesaVis->depthBits == 16) { + /* just 16-bit depth buffer, no hw stencil */ + struct intel_renderbuffer *depthRb + = intel_create_renderbuffer(GL_DEPTH_COMPONENT16, + screen->width, screen->height, + screen->depth.offset, + screen->depth.pitch, + screen->cpp, /* 2! */ + screen->depth.map); + intel_set_span_functions(&depthRb->Base); + _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base); + } + + /* now add any/all software-based renderbuffers we may need */ + _mesa_add_soft_renderbuffers(fb, GL_FALSE, /* never sw color */ + GL_FALSE, /* never sw depth */ + swStencil, mesaVis->accumRedBits > 0, GL_FALSE, /* never sw alpha */ + GL_FALSE /* never sw aux */ ); + driDrawPriv->driverPrivate = (void *) fb; + + return (driDrawPriv->driverPrivate != NULL); + } +} + +static void +intelDestroyBuffer(__DRIdrawablePrivate * driDrawPriv) +{ + _mesa_destroy_framebuffer((GLframebuffer *) (driDrawPriv->driverPrivate)); +} + + +/** + * Get information about previous buffer swaps. + */ +static int +intelGetSwapInfo(__DRIdrawablePrivate * dPriv, __DRIswapInfo * sInfo) +{ + struct intel_context *intel; + + if ((dPriv == NULL) || (dPriv->driContextPriv == NULL) + || (dPriv->driContextPriv->driverPrivate == NULL) + || (sInfo == NULL)) { + return -1; + } + + intel = dPriv->driContextPriv->driverPrivate; + sInfo->swap_count = intel->swap_count; + sInfo->swap_ust = intel->swap_ust; + sInfo->swap_missed_count = intel->swap_missed_count; + + sInfo->swap_missed_usage = (sInfo->swap_missed_count != 0) + ? driCalculateSwapUsage(dPriv, 0, intel->swap_missed_ust) + : 0.0; + + return 0; +} + + +/* There are probably better ways to do this, such as an + * init-designated function to register chipids and createcontext + * functions. + */ +extern GLboolean i830CreateContext(const __GLcontextModes * mesaVis, + __DRIcontextPrivate * driContextPriv, + void *sharedContextPrivate); + +extern GLboolean i915CreateContext(const __GLcontextModes * mesaVis, + __DRIcontextPrivate * driContextPriv, + void *sharedContextPrivate); + + + + +static GLboolean +intelCreateContext(const __GLcontextModes * mesaVis, + __DRIcontextPrivate * driContextPriv, + void *sharedContextPrivate) +{ + __DRIscreenPrivate *sPriv = driContextPriv->driScreenPriv; + intelScreenPrivate *intelScreen = (intelScreenPrivate *) sPriv->private; + + switch (intelScreen->deviceID) { + /* Don't deal with i830 until texture work complete: + */ + case PCI_CHIP_845_G: + case PCI_CHIP_I830_M: + case PCI_CHIP_I855_GM: + case PCI_CHIP_I865_G: + return i830CreateContext(mesaVis, driContextPriv, sharedContextPrivate); + + case PCI_CHIP_I915_G: + case PCI_CHIP_I915_GM: + case PCI_CHIP_I945_G: + case PCI_CHIP_I945_GM: + return i915CreateContext(mesaVis, driContextPriv, sharedContextPrivate); + + default: + fprintf(stderr, "Unrecognized deviceID %x\n", intelScreen->deviceID); + return GL_FALSE; + } +} + + +static const struct __DriverAPIRec intelAPI = { + .InitDriver = intelInitDriver, + .DestroyScreen = intelDestroyScreen, + .CreateContext = intelCreateContext, + .DestroyContext = intelDestroyContext, + .CreateBuffer = intelCreateBuffer, + .DestroyBuffer = intelDestroyBuffer, + .SwapBuffers = intelSwapBuffers, + .MakeCurrent = intelMakeCurrent, + .UnbindContext = intelUnbindContext, + .GetSwapInfo = intelGetSwapInfo, + .GetMSC = driGetMSC32, + .WaitForMSC = driWaitForMSC32, + .WaitForSBC = NULL, + .SwapBuffersMSC = NULL, + .CopySubBuffer = intelCopySubBuffer +}; + + +static __GLcontextModes * +intelFillInModes(unsigned pixel_bits, unsigned depth_bits, + unsigned stencil_bits, GLboolean have_back_buffer) +{ + __GLcontextModes *modes; + __GLcontextModes *m; + unsigned num_modes; + unsigned depth_buffer_factor; + unsigned back_buffer_factor; + GLenum fb_format; + GLenum fb_type; + + /* GLX_SWAP_COPY_OML is only supported because the Intel driver doesn't + * support pageflipping at all. + */ + static const GLenum back_buffer_modes[] = { + GLX_NONE, GLX_SWAP_UNDEFINED_OML, GLX_SWAP_COPY_OML + }; + + u_int8_t depth_bits_array[3]; + u_int8_t stencil_bits_array[3]; + + + depth_bits_array[0] = 0; + depth_bits_array[1] = depth_bits; + depth_bits_array[2] = 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. + */ + stencil_bits_array[0] = 0; + stencil_bits_array[1] = 0; + stencil_bits_array[2] = (stencil_bits == 0) ? 8 : stencil_bits; + + depth_buffer_factor = ((depth_bits != 0) || (stencil_bits != 0)) ? 3 : 1; + back_buffer_factor = (have_back_buffer) ? 3 : 1; + + num_modes = depth_buffer_factor * back_buffer_factor * 4; + + if (pixel_bits == 16) { + fb_format = GL_RGB; + fb_type = GL_UNSIGNED_SHORT_5_6_5; + } + else { + fb_format = GL_BGRA; + fb_type = GL_UNSIGNED_INT_8_8_8_8_REV; + } + + modes = + (*dri_interface->createContextModes) (num_modes, + sizeof(__GLcontextModes)); + m = modes; + if (!driFillInModes(&m, fb_format, fb_type, + depth_bits_array, stencil_bits_array, + depth_buffer_factor, back_buffer_modes, + back_buffer_factor, GLX_TRUE_COLOR)) { + fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__, + __LINE__); + return NULL; + } + if (!driFillInModes(&m, fb_format, fb_type, + depth_bits_array, stencil_bits_array, + depth_buffer_factor, back_buffer_modes, + back_buffer_factor, GLX_DIRECT_COLOR)) { + fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__, + __LINE__); + return NULL; + } + + /* Mark the visual as slow if there are "fake" stencil bits. + */ + for (m = modes; m != NULL; m = m->next) { + if ((m->stencilBits != 0) && (m->stencilBits != stencil_bits)) { + m->visualRating = GLX_SLOW_CONFIG; + } + } + + return modes; +} + + +/** + * This is the bootstrap function for the driver. libGL supplies all of the + * requisite information about the system, and the driver initializes itself. + * This routine also fills in the linked list pointed to by \c driver_modes + * with the \c __GLcontextModes that the driver can support for windows or + * pbuffers. + * + * \return A pointer to a \c __DRIscreenPrivate on success, or \c NULL on + * failure. + */ +PUBLIC void * +__driCreateNewScreen_20050727(__DRInativeDisplay * dpy, int scrn, + __DRIscreen * psc, + const __GLcontextModes * modes, + const __DRIversion * ddx_version, + const __DRIversion * dri_version, + const __DRIversion * drm_version, + const __DRIframebuffer * frame_buffer, + drmAddress pSAREA, int fd, + int internal_api_version, + const __DRIinterfaceMethods * interface, + __GLcontextModes ** driver_modes) +{ + __DRIscreenPrivate *psp; + static const __DRIversion ddx_expected = { 1, 5, 0 }; + static const __DRIversion dri_expected = { 4, 0, 0 }; + static const __DRIversion drm_expected = { 1, 7, 0 }; + + dri_interface = interface; + + if (!driCheckDriDdxDrmVersions2("i915", + dri_version, &dri_expected, + ddx_version, &ddx_expected, + drm_version, &drm_expected)) { + return NULL; + } + + psp = __driUtilCreateNewScreen(dpy, scrn, psc, NULL, + ddx_version, dri_version, drm_version, + frame_buffer, pSAREA, fd, + internal_api_version, &intelAPI); + if (psp != NULL) { + I830DRIPtr dri_priv = (I830DRIPtr) psp->pDevPriv; + *driver_modes = intelFillInModes(dri_priv->cpp * 8, + (dri_priv->cpp == 2) ? 16 : 24, + (dri_priv->cpp == 2) ? 0 : 8, 1); + + /* Calling driInitExtensions here, with a NULL context pointer, does not actually + * enable the extensions. It just makes sure that all the dispatch offsets for all + * the extensions that *might* be enables are known. This is needed because the + * dispatch offsets need to be known when _mesa_context_create is called, but we can't + * enable the extensions until we have a context pointer. + * + * Hello chicken. Hello egg. How are you two today? + */ + driInitExtensions(NULL, card_extensions, GL_FALSE); + } + + return (void *) psp; +} + +struct intel_context *intelScreenContext(intelScreenPrivate *intelScreen) +{ + /* + * This should probably change to have the screen allocate a dummy + * context at screen creation. For now just use the current context. + */ + + GET_CURRENT_CONTEXT(ctx); + if (ctx == NULL) { + _mesa_problem(NULL, "No current context in intelScreenContext\n"); + return NULL; + } + return intel_context(ctx); +} + diff --git a/src/mesa/drivers/dri/i915tex/intel_screen.h b/src/mesa/drivers/dri/i915tex/intel_screen.h new file mode 100644 index 00000000000..17698773f3d --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/intel_screen.h @@ -0,0 +1,132 @@ +/************************************************************************** + * + * Copyright 2003 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. + * + **************************************************************************/ + +#ifndef _INTEL_INIT_H_ +#define _INTEL_INIT_H_ + +#include +#include "dri_util.h" +#include "intel_rotate.h" +#include "i830_common.h" +#include "xmlconfig.h" +#include "dri_bufpool.h" + +/* XXX: change name or eliminate to avoid conflict with "struct + * intel_region"!!! + */ +typedef struct +{ + drm_handle_t handle; + drmSize size; /* region size in bytes */ + char *map; /* memory map */ + int offset; /* from start of video mem, in bytes */ + int pitch; /* row stride, in bytes */ +} intelRegion; + +typedef struct +{ + intelRegion front; + intelRegion back; + intelRegion rotated; + intelRegion depth; + intelRegion tex; + + struct intel_region *front_region; + struct intel_region *back_region; + struct intel_region *depth_region; + struct intel_region *rotated_region; + + int deviceID; + int width; + int height; + int mem; /* unused */ + + int cpp; /* for front and back buffers */ +/* int bitsPerPixel; */ + int fbFormat; /* XXX FBO: this is obsolete - remove after i830 updates */ + + int logTextureGranularity; + + __DRIscreenPrivate *driScrnPriv; + unsigned int sarea_priv_offset; + + int drmMinor; + + int irq_active; + int allow_batchbuffer; + + struct matrix23 rotMatrix; + + int current_rotation; /* 0, 90, 180 or 270 */ + int rotatedWidth, rotatedHeight; + + /** + * Configuration cache with default values for all contexts + */ + driOptionCache optionCache; + struct _DriBufferPool *batchPool; + struct _DriBufferPool *texPool; + struct _DriBufferPool *regionPool; + struct _DriBufferPool *staticPool; + unsigned int maxBatchSize; +} intelScreenPrivate; + + + +extern GLboolean intelMapScreenRegions(__DRIscreenPrivate * sPriv); + +extern void intelUnmapScreenRegions(intelScreenPrivate * intelScreen); + +extern void +intelUpdateScreenFromSAREA(intelScreenPrivate * intelScreen, + drmI830Sarea * sarea); + +extern void intelDestroyContext(__DRIcontextPrivate * driContextPriv); + +extern GLboolean intelUnbindContext(__DRIcontextPrivate * driContextPriv); + +extern GLboolean +intelMakeCurrent(__DRIcontextPrivate * driContextPriv, + __DRIdrawablePrivate * driDrawPriv, + __DRIdrawablePrivate * driReadPriv); + +extern void intelSwapBuffers(__DRIdrawablePrivate * dPriv); + +extern void +intelCopySubBuffer(__DRIdrawablePrivate * dPriv, int x, int y, int w, int h); + +extern struct _DriBufferPool *driBatchPoolInit(int fd, unsigned flags, + unsigned long bufSize, + unsigned numBufs, + unsigned checkDelayed); + +extern struct intel_context *intelScreenContext(intelScreenPrivate *intelScreen); + +extern void +intelUpdateScreenRotation(__DRIscreenPrivate * sPriv, drmI830Sarea * sarea); + +#endif diff --git a/src/mesa/drivers/dri/i915tex/intel_span.c b/src/mesa/drivers/dri/i915tex/intel_span.c new file mode 100644 index 00000000000..ab0874e4fd6 --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/intel_span.c @@ -0,0 +1,409 @@ +/************************************************************************** + * + * Copyright 2003 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. + * + **************************************************************************/ + +#include "glheader.h" +#include "macros.h" +#include "mtypes.h" +#include "colormac.h" + +#include "intel_fbo.h" +#include "intel_screen.h" +#include "intel_span.h" +#include "intel_regions.h" +#include "intel_ioctl.h" +#include "intel_tex.h" + +#include "swrast/swrast.h" + +/* + break intelWriteRGBASpan_ARGB8888 +*/ + +#undef DBG +#define DBG 0 + +#define LOCAL_VARS \ + struct intel_context *intel = intel_context(ctx); \ + struct intel_renderbuffer *irb = intel_renderbuffer(rb); \ + const GLint yScale = irb->RenderToTexture ? 1 : -1; \ + const GLint yBias = irb->RenderToTexture ? 0 : irb->Base.Height - 1; \ + GLubyte *buf = (GLubyte *) irb->pfMap \ + + (intel->drawY * irb->pfPitch + intel->drawX) * irb->region->cpp;\ + GLuint p; \ + assert(irb->pfMap);\ + (void) p; + +/* XXX FBO: this is identical to the macro in spantmp2.h except we get + * the cliprect info from the context, not the driDrawable. + * Move this into spantmp2.h someday. + */ +#define HW_CLIPLOOP() \ + do { \ + int _nc = intel->numClipRects; \ + while ( _nc-- ) { \ + int minx = intel->pClipRects[_nc].x1 - intel->drawX; \ + int miny = intel->pClipRects[_nc].y1 - intel->drawY; \ + int maxx = intel->pClipRects[_nc].x2 - intel->drawX; \ + int maxy = intel->pClipRects[_nc].y2 - intel->drawY; + + + + +#define Y_FLIP(_y) ((_y) * yScale + yBias) + +#define HW_LOCK() + +#define HW_UNLOCK() + +/* 16 bit, RGB565 color spanline and pixel functions + */ +#define SPANTMP_PIXEL_FMT GL_RGB +#define SPANTMP_PIXEL_TYPE GL_UNSIGNED_SHORT_5_6_5 + +#define TAG(x) intel##x##_RGB565 +#define TAG2(x,y) intel##x##_RGB565##y +#define GET_PTR(X,Y) (buf + ((Y) * irb->pfPitch + (X)) * 2) +#include "spantmp2.h" + +/* 32 bit, ARGB8888 color spanline and pixel functions + */ +#define SPANTMP_PIXEL_FMT GL_BGRA +#define SPANTMP_PIXEL_TYPE GL_UNSIGNED_INT_8_8_8_8_REV + +#define TAG(x) intel##x##_ARGB8888 +#define TAG2(x,y) intel##x##_ARGB8888##y +#define GET_PTR(X,Y) (buf + ((Y) * irb->pfPitch + (X)) * 4) +#include "spantmp2.h" + + +#define LOCAL_DEPTH_VARS \ + struct intel_context *intel = intel_context(ctx); \ + struct intel_renderbuffer *irb = intel_renderbuffer(rb); \ + const GLuint pitch = irb->pfPitch/***XXX region->pitch*/; /* in pixels */ \ + const GLint yScale = irb->RenderToTexture ? 1 : -1; \ + const GLint yBias = irb->RenderToTexture ? 0 : irb->Base.Height - 1; \ + char *buf = (char *) irb->pfMap/*XXX use region->map*/ + \ + (intel->drawY * pitch + intel->drawX) * irb->region->cpp; + + +#define LOCAL_STENCIL_VARS LOCAL_DEPTH_VARS + +/** + ** 16-bit depthbuffer functions. + **/ +#define WRITE_DEPTH( _x, _y, d ) \ + ((GLushort *)buf)[(_x) + (_y) * pitch] = d; + +#define READ_DEPTH( d, _x, _y ) \ + d = ((GLushort *)buf)[(_x) + (_y) * pitch]; + + +#define TAG(x) intel##x##_z16 +#include "depthtmp.h" + + +/** + ** 24/8-bit interleaved depth/stencil functions + ** Note: we're actually reading back combined depth+stencil values. + ** The wrappers in main/depthstencil.c are used to extract the depth + ** and stencil values. + **/ +/* Change ZZZS -> SZZZ */ +#define WRITE_DEPTH( _x, _y, d ) { \ + GLuint tmp = ((d) >> 8) | ((d) << 24); \ + ((GLuint *)buf)[(_x) + (_y) * pitch] = tmp; \ +} + +/* Change SZZZ -> ZZZS */ +#define READ_DEPTH( d, _x, _y ) { \ + GLuint tmp = ((GLuint *)buf)[(_x) + (_y) * pitch]; \ + d = (tmp << 8) | (tmp >> 24); \ +} + +#define TAG(x) intel##x##_z24_s8 +#include "depthtmp.h" + + +/** + ** 8-bit stencil function (XXX FBO: This is obsolete) + **/ +#define WRITE_STENCIL( _x, _y, d ) { \ + GLuint tmp = ((GLuint *)buf)[(_x) + (_y) * pitch]; \ + tmp &= 0xffffff; \ + tmp |= ((d) << 24); \ + ((GLuint *) buf)[(_x) + (_y) * pitch] = tmp; \ +} + +#define READ_STENCIL( d, _x, _y ) \ + d = ((GLuint *)buf)[(_x) + (_y) * pitch] >> 24; + +#define TAG(x) intel##x##_z24_s8 +#include "stenciltmp.h" + + + +/** + * Map or unmap all the renderbuffers which we may need during + * software rendering. + * XXX in the future, we could probably convey extra information to + * reduce the number of mappings needed. I.e. if doing a glReadPixels + * from the depth buffer, we really only need one mapping. + * + * XXX Rewrite this function someday. + * We can probably just loop over all the renderbuffer attachments, + * map/unmap all of them, and not worry about the _ColorDrawBuffers + * _ColorReadBuffer, _DepthBuffer or _StencilBuffer fields. + */ +static void +intel_map_unmap_buffers(struct intel_context *intel, GLboolean map) +{ + GLcontext *ctx = &intel->ctx; + GLuint i, j; + struct intel_renderbuffer *irb; + + /* color draw buffers */ + for (i = 0; i < ctx->Const.MaxDrawBuffers; i++) { + for (j = 0; j < ctx->DrawBuffer->_NumColorDrawBuffers[i]; j++) { + struct gl_renderbuffer *rb = + ctx->DrawBuffer->_ColorDrawBuffers[i][j]; + irb = intel_renderbuffer(rb); + if (irb) { + /* this is a user-created intel_renderbuffer */ + if (irb->region) { + if (map) + intel_region_map(intel->intelScreen, irb->region); + else + intel_region_unmap(intel->intelScreen, irb->region); + } + irb->pfMap = irb->region->map; + irb->pfPitch = irb->region->pitch; + } + } + } + + /* check for render to textures */ + for (i = 0; i < BUFFER_COUNT; i++) { + struct gl_renderbuffer_attachment *att = + ctx->DrawBuffer->Attachment + i; + struct gl_texture_object *tex = att->Texture; + if (tex) { + /* render to texture */ + ASSERT(att->Renderbuffer); + if (map) { + struct gl_texture_image *texImg; + texImg = tex->Image[att->CubeMapFace][att->TextureLevel]; + intel_tex_map_images(intel, intel_texture_object(tex)); + } + else { + intel_tex_unmap_images(intel, intel_texture_object(tex)); + } + } + } + + /* color read buffers */ + irb = intel_renderbuffer(ctx->ReadBuffer->_ColorReadBuffer); + if (irb && irb->region) { + if (map) + intel_region_map(intel->intelScreen, irb->region); + else + intel_region_unmap(intel->intelScreen, irb->region); + irb->pfMap = irb->region->map; + irb->pfPitch = irb->region->pitch; + } + + /* Account for front/back color page flipping. + * The span routines use the pfMap and pfPitch fields which will + * swap the front/back region map/pitch if we're page flipped. + * Do this after mapping, above, so the map field is valid. + */ +#if 0 + if (map && ctx->DrawBuffer->Name == 0) { + struct intel_renderbuffer *irbFront + = intel_get_renderbuffer(ctx->DrawBuffer, BUFFER_FRONT_LEFT); + struct intel_renderbuffer *irbBack + = intel_get_renderbuffer(ctx->DrawBuffer, BUFFER_BACK_LEFT); + if (irbBack) { + /* double buffered */ + if (intel->sarea->pf_current_page == 0) { + irbFront->pfMap = irbFront->region->map; + irbFront->pfPitch = irbFront->region->pitch; + irbBack->pfMap = irbBack->region->map; + irbBack->pfPitch = irbBack->region->pitch; + } + else { + irbFront->pfMap = irbBack->region->map; + irbFront->pfPitch = irbBack->region->pitch; + irbBack->pfMap = irbFront->region->map; + irbBack->pfPitch = irbFront->region->pitch; + } + } + } +#endif + + /* depth buffer (Note wrapper!) */ + if (ctx->DrawBuffer->_DepthBuffer) { + irb = intel_renderbuffer(ctx->DrawBuffer->_DepthBuffer->Wrapped); + if (irb && irb->region && irb->Base.Name != 0) { + if (map) { + intel_region_map(intel->intelScreen, irb->region); + irb->pfMap = irb->region->map; + irb->pfPitch = irb->region->pitch; + } + else { + intel_region_unmap(intel->intelScreen, irb->region); + irb->pfMap = NULL; + irb->pfPitch = 0; + } + } + } + + /* stencil buffer (Note wrapper!) */ + if (ctx->DrawBuffer->_StencilBuffer) { + irb = intel_renderbuffer(ctx->DrawBuffer->_StencilBuffer->Wrapped); + if (irb && irb->region && irb->Base.Name != 0) { + if (map) { + intel_region_map(intel->intelScreen, irb->region); + irb->pfMap = irb->region->map; + irb->pfPitch = irb->region->pitch; + } + else { + intel_region_unmap(intel->intelScreen, irb->region); + irb->pfMap = NULL; + irb->pfPitch = 0; + } + } + } +} + + + +/** + * Prepare for softare rendering. Map current read/draw framebuffers' + * renderbuffes and all currently bound texture objects. + * + * Old note: Moved locking out to get reasonable span performance. + */ +void +intelSpanRenderStart(GLcontext * ctx) +{ + struct intel_context *intel = intel_context(ctx); + GLuint i; + + intelFinish(&intel->ctx); + LOCK_HARDWARE(intel); + +#if 0 + /* Just map the framebuffer and all textures. Bufmgr code will + * take care of waiting on the necessary fences: + */ + intel_region_map(intel->intelScreen, intel->front_region); + intel_region_map(intel->intelScreen, intel->back_region); + intel_region_map(intel->intelScreen, intel->intelScreen->depth_region); +#endif + + for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) { + if (ctx->Texture.Unit[i]._ReallyEnabled) { + struct gl_texture_object *texObj = ctx->Texture.Unit[i]._Current; + intel_tex_map_images(intel, intel_texture_object(texObj)); + } + } + + intel_map_unmap_buffers(intel, GL_TRUE); +} + +/** + * Called when done softare rendering. Unmap the buffers we mapped in + * the above function. + */ +void +intelSpanRenderFinish(GLcontext * ctx) +{ + struct intel_context *intel = intel_context(ctx); + GLuint i; + + _swrast_flush(ctx); + + /* Now unmap the framebuffer: + */ +#if 0 + intel_region_unmap(intel, intel->front_region); + intel_region_unmap(intel, intel->back_region); + intel_region_unmap(intel, intel->intelScreen->depth_region); +#endif + + for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) { + if (ctx->Texture.Unit[i]._ReallyEnabled) { + struct gl_texture_object *texObj = ctx->Texture.Unit[i]._Current; + intel_tex_unmap_images(intel, intel_texture_object(texObj)); + } + } + + intel_map_unmap_buffers(intel, GL_FALSE); + + UNLOCK_HARDWARE(intel); +} + + +void +intelInitSpanFuncs(GLcontext * ctx) +{ + struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference(ctx); + swdd->SpanRenderStart = intelSpanRenderStart; + swdd->SpanRenderFinish = intelSpanRenderFinish; +} + + +/** + * Plug in appropriate span read/write functions for the given renderbuffer. + * These are used for the software fallbacks. + */ +void +intel_set_span_functions(struct gl_renderbuffer *rb) +{ + if (rb->_ActualFormat == GL_RGB5) { + /* 565 RGB */ + intelInitPointers_RGB565(rb); + } + else if (rb->_ActualFormat == GL_RGBA8) { + /* 8888 RGBA */ + intelInitPointers_ARGB8888(rb); + } + else if (rb->_ActualFormat == GL_DEPTH_COMPONENT16) { + intelInitDepthPointers_z16(rb); + } + else if (rb->_ActualFormat == GL_DEPTH_COMPONENT24 || /* XXX FBO remove */ + rb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT) { + intelInitDepthPointers_z24_s8(rb); + } + else if (rb->_ActualFormat == GL_STENCIL_INDEX8_EXT) { /* XXX FBO remove */ + intelInitStencilPointers_z24_s8(rb); + } + else { + _mesa_problem(NULL, + "Unexpected _ActualFormat in intelSetSpanFunctions"); + } +} diff --git a/src/mesa/drivers/dri/i915tex/intel_span.h b/src/mesa/drivers/dri/i915tex/intel_span.h new file mode 100644 index 00000000000..5201f6d6c6e --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/intel_span.h @@ -0,0 +1,38 @@ +/************************************************************************** + * + * Copyright 2003 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. + * + **************************************************************************/ + +#ifndef _INTEL_SPAN_H +#define _INTEL_SPAN_H + +extern void intelInitSpanFuncs(GLcontext * ctx); + +extern void intelSpanRenderFinish(GLcontext * ctx); +extern void intelSpanRenderStart(GLcontext * ctx); + +extern void intel_set_span_functions(struct gl_renderbuffer *rb); + +#endif diff --git a/src/mesa/drivers/dri/i915tex/intel_state.c b/src/mesa/drivers/dri/i915tex/intel_state.c new file mode 100644 index 00000000000..f85d8ef8353 --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/intel_state.c @@ -0,0 +1,363 @@ +/************************************************************************** + * + * Copyright 2003 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. + * + **************************************************************************/ + + +#include "glheader.h" +#include "context.h" +#include "macros.h" +#include "enums.h" +#include "colormac.h" +#include "dd.h" + +#include "intel_screen.h" +#include "intel_context.h" +#include "intel_fbo.h" +#include "intel_regions.h" +#include "swrast/swrast.h" + +int +intel_translate_compare_func(GLenum func) +{ + switch (func) { + case GL_NEVER: + return COMPAREFUNC_NEVER; + case GL_LESS: + return COMPAREFUNC_LESS; + case GL_LEQUAL: + return COMPAREFUNC_LEQUAL; + case GL_GREATER: + return COMPAREFUNC_GREATER; + case GL_GEQUAL: + return COMPAREFUNC_GEQUAL; + case GL_NOTEQUAL: + return COMPAREFUNC_NOTEQUAL; + case GL_EQUAL: + return COMPAREFUNC_EQUAL; + case GL_ALWAYS: + return COMPAREFUNC_ALWAYS; + } + + fprintf(stderr, "Unknown value in %s: %x\n", __FUNCTION__, func); + return COMPAREFUNC_ALWAYS; +} + +int +intel_translate_stencil_op(GLenum op) +{ + switch (op) { + case GL_KEEP: + return STENCILOP_KEEP; + case GL_ZERO: + return STENCILOP_ZERO; + case GL_REPLACE: + return STENCILOP_REPLACE; + case GL_INCR: + return STENCILOP_INCRSAT; + case GL_DECR: + return STENCILOP_DECRSAT; + case GL_INCR_WRAP: + return STENCILOP_INCR; + case GL_DECR_WRAP: + return STENCILOP_DECR; + case GL_INVERT: + return STENCILOP_INVERT; + default: + return STENCILOP_ZERO; + } +} + +int +intel_translate_blend_factor(GLenum factor) +{ + switch (factor) { + case GL_ZERO: + return BLENDFACT_ZERO; + case GL_SRC_ALPHA: + return BLENDFACT_SRC_ALPHA; + case GL_ONE: + return BLENDFACT_ONE; + case GL_SRC_COLOR: + return BLENDFACT_SRC_COLR; + case GL_ONE_MINUS_SRC_COLOR: + return BLENDFACT_INV_SRC_COLR; + case GL_DST_COLOR: + return BLENDFACT_DST_COLR; + case GL_ONE_MINUS_DST_COLOR: + return BLENDFACT_INV_DST_COLR; + case GL_ONE_MINUS_SRC_ALPHA: + return BLENDFACT_INV_SRC_ALPHA; + case GL_DST_ALPHA: + return BLENDFACT_DST_ALPHA; + case GL_ONE_MINUS_DST_ALPHA: + return BLENDFACT_INV_DST_ALPHA; + case GL_SRC_ALPHA_SATURATE: + return BLENDFACT_SRC_ALPHA_SATURATE; + case GL_CONSTANT_COLOR: + return BLENDFACT_CONST_COLOR; + case GL_ONE_MINUS_CONSTANT_COLOR: + return BLENDFACT_INV_CONST_COLOR; + case GL_CONSTANT_ALPHA: + return BLENDFACT_CONST_ALPHA; + case GL_ONE_MINUS_CONSTANT_ALPHA: + return BLENDFACT_INV_CONST_ALPHA; + } + + fprintf(stderr, "Unknown value in %s: %x\n", __FUNCTION__, factor); + return BLENDFACT_ZERO; +} + +int +intel_translate_logic_op(GLenum opcode) +{ + switch (opcode) { + case GL_CLEAR: + return LOGICOP_CLEAR; + case GL_AND: + return LOGICOP_AND; + case GL_AND_REVERSE: + return LOGICOP_AND_RVRSE; + case GL_COPY: + return LOGICOP_COPY; + case GL_COPY_INVERTED: + return LOGICOP_COPY_INV; + case GL_AND_INVERTED: + return LOGICOP_AND_INV; + case GL_NOOP: + return LOGICOP_NOOP; + case GL_XOR: + return LOGICOP_XOR; + case GL_OR: + return LOGICOP_OR; + case GL_OR_INVERTED: + return LOGICOP_OR_INV; + case GL_NOR: + return LOGICOP_NOR; + case GL_EQUIV: + return LOGICOP_EQUIV; + case GL_INVERT: + return LOGICOP_INV; + case GL_OR_REVERSE: + return LOGICOP_OR_RVRSE; + case GL_NAND: + return LOGICOP_NAND; + case GL_SET: + return LOGICOP_SET; + default: + return LOGICOP_SET; + } +} + + +static void +intelClearColor(GLcontext * ctx, const GLfloat color[4]) +{ + struct intel_context *intel = intel_context(ctx); + GLubyte clear[4]; + + CLAMPED_FLOAT_TO_UBYTE(clear[0], color[0]); + CLAMPED_FLOAT_TO_UBYTE(clear[1], color[1]); + CLAMPED_FLOAT_TO_UBYTE(clear[2], color[2]); + CLAMPED_FLOAT_TO_UBYTE(clear[3], color[3]); + + /* compute both 32 and 16-bit clear values */ + intel->ClearColor8888 = INTEL_PACKCOLOR8888(clear[0], clear[1], + clear[2], clear[3]); + intel->ClearColor565 = INTEL_PACKCOLOR565(clear[0], clear[1], clear[2]); +} + + +/** + * Update the viewport transformation matrix. Depends on: + * - viewport pos/size + * - depthrange + * - window pos/size or FBO size + */ +static void +intelCalcViewport(GLcontext * ctx) +{ + struct intel_context *intel = intel_context(ctx); + const GLfloat *v = ctx->Viewport._WindowMap.m; + const GLfloat depthScale = 1.0F / ctx->DrawBuffer->_DepthMaxF; + GLfloat *m = intel->ViewportMatrix.m; + GLfloat yScale, yBias; + + if (ctx->DrawBuffer->Name) { + /* User created FBO */ + struct intel_renderbuffer *irb + = intel_renderbuffer(ctx->DrawBuffer->_ColorDrawBuffers[0][0]); + if (irb && !irb->RenderToTexture) { + /* y=0=top */ + yScale = -1.0; + yBias = irb->Base.Height; + } + else { + /* y=0=bottom */ + yScale = 1.0; + yBias = 0.0; + } + } + else { + /* window buffer, y=0=top */ + yScale = -1.0; + yBias = (intel->driDrawable) ? intel->driDrawable->h : 0.0F; + } + + m[MAT_SX] = v[MAT_SX]; + m[MAT_TX] = v[MAT_TX] + SUBPIXEL_X; + + m[MAT_SY] = v[MAT_SY] * yScale; + m[MAT_TY] = v[MAT_TY] * yScale + yBias + SUBPIXEL_Y; + + m[MAT_SZ] = v[MAT_SZ] * depthScale; + m[MAT_TZ] = v[MAT_TZ] * depthScale; +} + +static void +intelViewport(GLcontext * ctx, + GLint x, GLint y, GLsizei width, GLsizei height) +{ + intelCalcViewport(ctx); +} + +static void +intelDepthRange(GLcontext * ctx, GLclampd nearval, GLclampd farval) +{ + intelCalcViewport(ctx); +} + +/* Fallback to swrast for select and feedback. + */ +static void +intelRenderMode(GLcontext * ctx, GLenum mode) +{ + struct intel_context *intel = intel_context(ctx); + FALLBACK(intel, INTEL_FALLBACK_RENDERMODE, (mode != GL_RENDER)); +} + + +void +intelInitStateFuncs(struct dd_function_table *functions) +{ + functions->RenderMode = intelRenderMode; + functions->Viewport = intelViewport; + functions->DepthRange = intelDepthRange; + functions->ClearColor = intelClearColor; +} + + + + +void +intelInitState(GLcontext * ctx) +{ + /* Mesa should do this for us: + */ + ctx->Driver.AlphaFunc(ctx, ctx->Color.AlphaFunc, ctx->Color.AlphaRef); + + ctx->Driver.BlendColor(ctx, ctx->Color.BlendColor); + + ctx->Driver.BlendEquationSeparate(ctx, + ctx->Color.BlendEquationRGB, + ctx->Color.BlendEquationA); + + ctx->Driver.BlendFuncSeparate(ctx, + ctx->Color.BlendSrcRGB, + ctx->Color.BlendDstRGB, + ctx->Color.BlendSrcA, ctx->Color.BlendDstA); + + ctx->Driver.ColorMask(ctx, + ctx->Color.ColorMask[RCOMP], + ctx->Color.ColorMask[GCOMP], + ctx->Color.ColorMask[BCOMP], + ctx->Color.ColorMask[ACOMP]); + + ctx->Driver.CullFace(ctx, ctx->Polygon.CullFaceMode); + ctx->Driver.DepthFunc(ctx, ctx->Depth.Func); + ctx->Driver.DepthMask(ctx, ctx->Depth.Mask); + + ctx->Driver.Enable(ctx, GL_ALPHA_TEST, ctx->Color.AlphaEnabled); + ctx->Driver.Enable(ctx, GL_BLEND, ctx->Color.BlendEnabled); + ctx->Driver.Enable(ctx, GL_COLOR_LOGIC_OP, ctx->Color.ColorLogicOpEnabled); + ctx->Driver.Enable(ctx, GL_COLOR_SUM, ctx->Fog.ColorSumEnabled); + ctx->Driver.Enable(ctx, GL_CULL_FACE, ctx->Polygon.CullFlag); + ctx->Driver.Enable(ctx, GL_DEPTH_TEST, ctx->Depth.Test); + ctx->Driver.Enable(ctx, GL_DITHER, ctx->Color.DitherFlag); + ctx->Driver.Enable(ctx, GL_FOG, ctx->Fog.Enabled); + ctx->Driver.Enable(ctx, GL_LIGHTING, ctx->Light.Enabled); + ctx->Driver.Enable(ctx, GL_LINE_SMOOTH, ctx->Line.SmoothFlag); + ctx->Driver.Enable(ctx, GL_POLYGON_STIPPLE, ctx->Polygon.StippleFlag); + ctx->Driver.Enable(ctx, GL_SCISSOR_TEST, ctx->Scissor.Enabled); + ctx->Driver.Enable(ctx, GL_STENCIL_TEST, ctx->Stencil.Enabled); + ctx->Driver.Enable(ctx, GL_TEXTURE_1D, GL_FALSE); + ctx->Driver.Enable(ctx, GL_TEXTURE_2D, GL_FALSE); + ctx->Driver.Enable(ctx, GL_TEXTURE_RECTANGLE_NV, GL_FALSE); + ctx->Driver.Enable(ctx, GL_TEXTURE_3D, GL_FALSE); + ctx->Driver.Enable(ctx, GL_TEXTURE_CUBE_MAP, GL_FALSE); + + ctx->Driver.Fogfv(ctx, GL_FOG_COLOR, ctx->Fog.Color); + ctx->Driver.Fogfv(ctx, GL_FOG_MODE, 0); + ctx->Driver.Fogfv(ctx, GL_FOG_DENSITY, &ctx->Fog.Density); + ctx->Driver.Fogfv(ctx, GL_FOG_START, &ctx->Fog.Start); + ctx->Driver.Fogfv(ctx, GL_FOG_END, &ctx->Fog.End); + + ctx->Driver.FrontFace(ctx, ctx->Polygon.FrontFace); + + { + GLfloat f = (GLfloat) ctx->Light.Model.ColorControl; + ctx->Driver.LightModelfv(ctx, GL_LIGHT_MODEL_COLOR_CONTROL, &f); + } + + ctx->Driver.LineWidth(ctx, ctx->Line.Width); + ctx->Driver.LogicOpcode(ctx, ctx->Color.LogicOp); + ctx->Driver.PointSize(ctx, ctx->Point.Size); + ctx->Driver.PolygonStipple(ctx, (const GLubyte *) ctx->PolygonStipple); + ctx->Driver.Scissor(ctx, ctx->Scissor.X, ctx->Scissor.Y, + ctx->Scissor.Width, ctx->Scissor.Height); + ctx->Driver.ShadeModel(ctx, ctx->Light.ShadeModel); + ctx->Driver.StencilFuncSeparate(ctx, GL_FRONT, + ctx->Stencil.Function[0], + ctx->Stencil.Ref[0], + ctx->Stencil.ValueMask[0]); + ctx->Driver.StencilFuncSeparate(ctx, GL_BACK, + ctx->Stencil.Function[1], + ctx->Stencil.Ref[1], + ctx->Stencil.ValueMask[1]); + ctx->Driver.StencilMaskSeparate(ctx, GL_FRONT, ctx->Stencil.WriteMask[0]); + ctx->Driver.StencilMaskSeparate(ctx, GL_BACK, ctx->Stencil.WriteMask[1]); + ctx->Driver.StencilOpSeparate(ctx, GL_FRONT, + ctx->Stencil.FailFunc[0], + ctx->Stencil.ZFailFunc[0], + ctx->Stencil.ZPassFunc[0]); + ctx->Driver.StencilOpSeparate(ctx, GL_BACK, + ctx->Stencil.FailFunc[1], + ctx->Stencil.ZFailFunc[1], + ctx->Stencil.ZPassFunc[1]); + + + /* XXX this isn't really needed */ + ctx->Driver.DrawBuffer(ctx, ctx->Color.DrawBuffer[0]); +} diff --git a/src/mesa/drivers/dri/i915tex/intel_structs.h b/src/mesa/drivers/dri/i915tex/intel_structs.h new file mode 100644 index 00000000000..522e3bd92c2 --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/intel_structs.h @@ -0,0 +1,132 @@ +#ifndef INTEL_STRUCTS_H +#define INTEL_STRUCTS_H + +struct br0 { + GLuint length:8; + GLuint pad0:3; + GLuint dst_tiled:1; + GLuint pad1:8; + GLuint write_rgb:1; + GLuint write_alpha:1; + GLuint opcode:7; + GLuint client:3; +}; + + +struct br13 { + GLint dest_pitch:16; + GLuint rop:8; + GLuint color_depth:2; + GLuint pad1:3; + GLuint mono_source_transparency:1; + GLuint clipping_enable:1; + GLuint pad0:1; +}; + + + +/* This is an attempt to move some of the 2D interaction in this + * driver to using structs for packets rather than a bunch of #defines + * and dwords. + */ +struct xy_color_blit { + struct br0 br0; + struct br13 br13; + + struct { + GLuint dest_x1:16; + GLuint dest_y1:16; + } dw2; + + struct { + GLuint dest_x2:16; + GLuint dest_y2:16; + } dw3; + + GLuint dest_base_addr; + GLuint color; +}; + +struct xy_src_copy_blit { + struct br0 br0; + struct br13 br13; + + struct { + GLuint dest_x1:16; + GLuint dest_y1:16; + } dw2; + + struct { + GLuint dest_x2:16; + GLuint dest_y2:16; + } dw3; + + GLuint dest_base_addr; + + struct { + GLuint src_x1:16; + GLuint src_y1:16; + } dw5; + + struct { + GLint src_pitch:16; + GLuint pad:16; + } dw6; + + GLuint src_base_addr; +}; + +struct xy_setup_blit { + struct br0 br0; + struct br13 br13; + + struct { + GLuint clip_x1:16; + GLuint clip_y1:16; + } dw2; + + struct { + GLuint clip_x2:16; + GLuint clip_y2:16; + } dw3; + + GLuint dest_base_addr; + GLuint background_color; + GLuint foreground_color; + GLuint pattern_base_addr; +}; + + +struct xy_text_immediate_blit { + struct { + GLuint length:8; + GLuint pad2:3; + GLuint dst_tiled:1; + GLuint pad1:4; + GLuint byte_packed:1; + GLuint pad0:5; + GLuint opcode:7; + GLuint client:3; + } dw0; + + struct { + GLuint dest_x1:16; + GLuint dest_y1:16; + } dw1; + + struct { + GLuint dest_x2:16; + GLuint dest_y2:16; + } dw2; + + /* Src bitmap data follows as inline dwords. + */ +}; + + +#define CLIENT_2D 0x2 +#define OPCODE_XY_SETUP_BLT 0x1 +#define OPCODE_XY_COLOR_BLT 0x50 +#define OPCODE_XY_TEXT_IMMEDIATE_BLT 0x31 + +#endif diff --git a/src/mesa/drivers/dri/i915tex/intel_tex.c b/src/mesa/drivers/dri/i915tex/intel_tex.c new file mode 100644 index 00000000000..b08dee43bc1 --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/intel_tex.c @@ -0,0 +1,192 @@ +#include "texobj.h" +#include "intel_context.h" +#include "intel_mipmap_tree.h" +#include "intel_tex.h" + +#define FILE_DEBUG_FLAG DEBUG_TEXTURE + +static GLboolean +intelIsTextureResident(GLcontext * ctx, struct gl_texture_object *texObj) +{ +#if 0 + struct intel_context *intel = intel_context(ctx); + struct intel_texture_object *intelObj = intel_texture_object(texObj); + + return + intelObj->mt && + intelObj->mt->region && + intel_is_region_resident(intel, intelObj->mt->region); +#endif + return 1; +} + + + +static struct gl_texture_image * +intelNewTextureImage(GLcontext * ctx) +{ + DBG("%s\n", __FUNCTION__); + (void) ctx; + return (struct gl_texture_image *) CALLOC_STRUCT(intel_texture_image); +} + + +static struct gl_texture_object * +intelNewTextureObject(GLcontext * ctx, GLuint name, GLenum target) +{ + struct intel_texture_object *obj = CALLOC_STRUCT(intel_texture_object); + + DBG("%s\n", __FUNCTION__); + _mesa_initialize_texture_object(&obj->base, name, target); + + return &obj->base; +} + +static void +intelDeleteTextureObject(GLcontext *ctx, + struct gl_texture_object *texObj) +{ + struct intel_context *intel = intel_context(ctx); + struct intel_texture_object *intelObj = intel_texture_object(texObj); + + if (intelObj->mt) + intel_miptree_release(intel, &intelObj->mt); + + _mesa_delete_texture_object(ctx, texObj); +} + + +static void +intelFreeTextureImageData(GLcontext * ctx, struct gl_texture_image *texImage) +{ + struct intel_context *intel = intel_context(ctx); + struct intel_texture_image *intelImage = intel_texture_image(texImage); + + DBG("%s\n", __FUNCTION__); + + if (intelImage->mt) { + intel_miptree_release(intel, &intelImage->mt); + } + + if (texImage->Data) { + free(texImage->Data); + texImage->Data = NULL; + } +} + + +/* The system memcpy (at least on ubuntu 5.10) has problems copying + * to agp (writecombined) memory from a source which isn't 64-byte + * aligned - there is a 4x performance falloff. + * + * The x86 __memcpy is immune to this but is slightly slower + * (10%-ish) than the system memcpy. + * + * The sse_memcpy seems to have a slight cliff at 64/32 bytes, but + * isn't much faster than x86_memcpy for agp copies. + * + * TODO: switch dynamically. + */ +static void * +do_memcpy(void *dest, const void *src, size_t n) +{ + if ((((unsigned) src) & 63) || (((unsigned) dest) & 63)) { + return __memcpy(dest, src, n); + } + else + return memcpy(dest, src, n); +} + + +#if DO_DEBUG + +#ifndef __x86_64__ +static unsigned +fastrdtsc(void) +{ + unsigned eax; + __asm__ volatile ("\t" + "pushl %%ebx\n\t" + "cpuid\n\t" ".byte 0x0f, 0x31\n\t" + "popl %%ebx\n":"=a" (eax) + :"0"(0) + :"ecx", "edx", "cc"); + + return eax; +} +#else +static unsigned +fastrdtsc(void) +{ + unsigned eax; + __asm__ volatile ("\t" "cpuid\n\t" ".byte 0x0f, 0x31\n\t":"=a" (eax) + :"0"(0) + :"ecx", "edx", "ebx", "cc"); + + return eax; +} +#endif + +static unsigned +time_diff(unsigned t, unsigned t2) +{ + return ((t < t2) ? t2 - t : 0xFFFFFFFFU - (t - t2 - 1)); +} + + +static void * +timed_memcpy(void *dest, const void *src, size_t n) +{ + void *ret; + unsigned t1, t2; + double rate; + + if ((((unsigned) src) & 63) || (((unsigned) dest) & 63)) + _mesa_printf("Warning - non-aligned texture copy!\n"); + + t1 = fastrdtsc(); + ret = do_memcpy(dest, src, n); + t2 = fastrdtsc(); + + rate = time_diff(t1, t2); + rate /= (double) n; + _mesa_printf("timed_memcpy: %u %u --> %f clocks/byte\n", t1, t2, rate); + return ret; +} +#endif /* DO_DEBUG */ + + +void +intelInitTextureFuncs(struct dd_function_table *functions) +{ + functions->ChooseTextureFormat = intelChooseTextureFormat; + functions->TexImage1D = intelTexImage1D; + functions->TexImage2D = intelTexImage2D; + functions->TexImage3D = intelTexImage3D; + functions->TexSubImage1D = intelTexSubImage1D; + functions->TexSubImage2D = intelTexSubImage2D; + functions->TexSubImage3D = intelTexSubImage3D; + functions->CopyTexImage1D = intelCopyTexImage1D; + functions->CopyTexImage2D = intelCopyTexImage2D; + functions->CopyTexSubImage1D = intelCopyTexSubImage1D; + functions->CopyTexSubImage2D = intelCopyTexSubImage2D; + functions->GetTexImage = intelGetTexImage; + + /* compressed texture functions */ + functions->CompressedTexImage2D = intelCompressedTexImage2D; + functions->GetCompressedTexImage = intelGetCompressedTexImage; + + functions->NewTextureObject = intelNewTextureObject; + functions->NewTextureImage = intelNewTextureImage; + functions->DeleteTexture = intelDeleteTextureObject; + functions->FreeTexImageData = intelFreeTextureImageData; + functions->UpdateTexturePalette = 0; + functions->IsTextureResident = intelIsTextureResident; + +#if DO_DEBUG + if (INTEL_DEBUG & DEBUG_BUFMGR) + functions->TextureMemCpy = timed_memcpy; + else +#endif + functions->TextureMemCpy = do_memcpy; +} diff --git a/src/mesa/drivers/dri/i915tex/intel_tex.h b/src/mesa/drivers/dri/i915tex/intel_tex.h new file mode 100644 index 00000000000..6e9938fe534 --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/intel_tex.h @@ -0,0 +1,148 @@ +/************************************************************************** + * + * Copyright 2003 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. + * + **************************************************************************/ + +#ifndef INTELTEX_INC +#define INTELTEX_INC + +#include "mtypes.h" +#include "intel_context.h" +#include "texmem.h" + + +void intelInitTextureFuncs(struct dd_function_table *functions); + +const struct gl_texture_format *intelChooseTextureFormat(GLcontext * ctx, + GLint internalFormat, + GLenum format, + GLenum type); + + +void intelTexImage3D(GLcontext * ctx, + GLenum target, GLint level, + GLint internalFormat, + GLint width, GLint height, GLint depth, + GLint border, + GLenum format, GLenum type, const void *pixels, + const struct gl_pixelstore_attrib *packing, + struct gl_texture_object *texObj, + struct gl_texture_image *texImage); + +void intelTexSubImage3D(GLcontext * ctx, + GLenum target, + GLint level, + GLint xoffset, GLint yoffset, GLint zoffset, + GLsizei width, GLsizei height, GLsizei depth, + GLenum format, GLenum type, + const GLvoid * pixels, + const struct gl_pixelstore_attrib *packing, + struct gl_texture_object *texObj, + struct gl_texture_image *texImage); + +void intelTexImage2D(GLcontext * ctx, + GLenum target, GLint level, + GLint internalFormat, + GLint width, GLint height, GLint border, + GLenum format, GLenum type, const void *pixels, + const struct gl_pixelstore_attrib *packing, + struct gl_texture_object *texObj, + struct gl_texture_image *texImage); + +void intelTexSubImage2D(GLcontext * ctx, + GLenum target, + GLint level, + GLint xoffset, GLint yoffset, + GLsizei width, GLsizei height, + GLenum format, GLenum type, + const GLvoid * pixels, + const struct gl_pixelstore_attrib *packing, + struct gl_texture_object *texObj, + struct gl_texture_image *texImage); + +void intelTexImage1D(GLcontext * ctx, + GLenum target, GLint level, + GLint internalFormat, + GLint width, GLint border, + GLenum format, GLenum type, const void *pixels, + const struct gl_pixelstore_attrib *packing, + struct gl_texture_object *texObj, + struct gl_texture_image *texImage); + +void intelTexSubImage1D(GLcontext * ctx, + GLenum target, + GLint level, + GLint xoffset, + GLsizei width, + GLenum format, GLenum type, + const GLvoid * pixels, + const struct gl_pixelstore_attrib *packing, + struct gl_texture_object *texObj, + struct gl_texture_image *texImage); + +void intelCopyTexImage1D(GLcontext * ctx, GLenum target, GLint level, + GLenum internalFormat, + GLint x, GLint y, GLsizei width, GLint border); + +void intelCopyTexImage2D(GLcontext * ctx, GLenum target, GLint level, + GLenum internalFormat, + GLint x, GLint y, GLsizei width, GLsizei height, + GLint border); + +void intelCopyTexSubImage1D(GLcontext * ctx, GLenum target, GLint level, + GLint xoffset, GLint x, GLint y, GLsizei width); + +void intelCopyTexSubImage2D(GLcontext * ctx, GLenum target, GLint level, + GLint xoffset, GLint yoffset, + GLint x, GLint y, GLsizei width, GLsizei height); + +void intelGetTexImage(GLcontext * ctx, GLenum target, GLint level, + GLenum format, GLenum type, GLvoid * pixels, + struct gl_texture_object *texObj, + struct gl_texture_image *texImage); + +void intelCompressedTexImage2D( GLcontext *ctx, GLenum target, GLint level, + GLint internalFormat, + GLint width, GLint height, GLint border, + GLsizei imageSize, const GLvoid *data, + struct gl_texture_object *texObj, + struct gl_texture_image *texImage ); + +void intelGetCompressedTexImage(GLcontext *ctx, GLenum target, GLint level, + GLvoid *pixels, + const struct gl_texture_object *texObj, + const struct gl_texture_image *texImage); + +GLuint intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit); + +void intel_tex_map_images(struct intel_context *intel, + struct intel_texture_object *intelObj); + +void intel_tex_unmap_images(struct intel_context *intel, + struct intel_texture_object *intelObj); + +int intel_compressed_num_bytes(GLuint mesaFormat); + +#endif diff --git a/src/mesa/drivers/dri/i915tex/intel_tex_copy.c b/src/mesa/drivers/dri/i915tex/intel_tex_copy.c new file mode 100644 index 00000000000..88b62e781c0 --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/intel_tex_copy.c @@ -0,0 +1,301 @@ +/************************************************************************** + * + * Copyright 2003 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. + * + **************************************************************************/ + +#include "mtypes.h" +#include "enums.h" +#include "image.h" +#include "teximage.h" +#include "swrast/swrast.h" + +#include "intel_screen.h" +#include "intel_context.h" +#include "intel_batchbuffer.h" +#include "intel_buffers.h" +#include "intel_mipmap_tree.h" +#include "intel_regions.h" +#include "intel_fbo.h" +#include "intel_tex.h" +#include "intel_blit.h" +#include "intel_pixel.h" + +#define FILE_DEBUG_FLAG DEBUG_TEXTURE + +/** + * Get the intel_region which is the source for any glCopyTex[Sub]Image call. + * + * Do the best we can using the blitter. A future project is to use + * the texture engine and fragment programs for these copies. + */ +static const struct intel_region * +get_teximage_source(struct intel_context *intel, GLenum internalFormat) +{ + struct intel_renderbuffer *irb; + + DBG("%s %s\n", __FUNCTION__, + _mesa_lookup_enum_by_nr(internalFormat)); + + switch (internalFormat) { + case GL_DEPTH_COMPONENT: + case GL_DEPTH_COMPONENT16_ARB: + irb = intel_get_renderbuffer(intel->ctx.ReadBuffer, BUFFER_DEPTH); + if (irb && irb->region && irb->region->cpp == 2) + return irb->region; + return NULL; + case GL_DEPTH24_STENCIL8_EXT: + case GL_DEPTH_STENCIL_EXT: + irb = intel_get_renderbuffer(intel->ctx.ReadBuffer, BUFFER_DEPTH); + if (irb && irb->region && irb->region->cpp == 4) + return irb->region; + return NULL; + case GL_RGBA: + case GL_RGBA8: + return intel_readbuf_region(intel); + case GL_RGB: + if (intel->intelScreen->cpp == 2) + return intel_readbuf_region(intel); + return NULL; + default: + return NULL; + } +} + + +static GLboolean +do_copy_texsubimage(struct intel_context *intel, + struct intel_texture_image *intelImage, + GLenum internalFormat, + GLint dstx, GLint dsty, + GLint x, GLint y, GLsizei width, GLsizei height) +{ + GLcontext *ctx = &intel->ctx; + const struct intel_region *src = + get_teximage_source(intel, internalFormat); + + if (!intelImage->mt || !src) { + DBG("%s fail %p %p\n", __FUNCTION__, intelImage->mt, src); + return GL_FALSE; + } + + intelFlush(ctx); + LOCK_HARDWARE(intel); + { + GLuint image_offset = intel_miptree_image_offset(intelImage->mt, + intelImage->face, + intelImage->level); + const GLint orig_x = x; + const GLint orig_y = y; + const struct gl_framebuffer *fb = ctx->DrawBuffer; + + if (_mesa_clip_to_region(fb->_Xmin, fb->_Ymin, fb->_Xmax, fb->_Ymax, + &x, &y, &width, &height)) { + /* Update dst for clipped src. Need to also clip the source rect. + */ + dstx += x - orig_x; + dsty += y - orig_y; + + if (ctx->ReadBuffer->Name == 0) { + /* reading from a window, adjust x, y */ + __DRIdrawablePrivate *dPriv = intel->driDrawable; + GLuint window_y; + /* window_y = position of window on screen if y=0=bottom */ + window_y = intel->intelScreen->height - (dPriv->y + dPriv->h); + y = window_y + y; + x += dPriv->x; + } + else { + /* reading from a FBO */ + /* invert Y */ + y = ctx->ReadBuffer->Height - y - 1; + } + + + /* A bit of fiddling to get the blitter to work with -ve + * pitches. But we get a nice inverted blit this way, so it's + * worth it: + */ + intelEmitCopyBlit(intel, + intelImage->mt->cpp, + -src->pitch, + src->buffer, + src->height * src->pitch * src->cpp, + intelImage->mt->pitch, + intelImage->mt->region->buffer, + image_offset, + x, y + height, dstx, dsty, width, height); + + intel_batchbuffer_flush(intel->batch); + } + } + + + UNLOCK_HARDWARE(intel); + +#if 0 + /* GL_SGIS_generate_mipmap -- this can be accelerated now. + * XXX Add a ctx->Driver.GenerateMipmaps() function? + */ + if (level == texObj->BaseLevel && texObj->GenerateMipmap) { + intel_generate_mipmap(ctx, target, + &ctx->Texture.Unit[ctx->Texture.CurrentUnit], + texObj); + } +#endif + + return GL_TRUE; +} + + + + + +void +intelCopyTexImage1D(GLcontext * ctx, GLenum target, GLint level, + GLenum internalFormat, + GLint x, GLint y, GLsizei width, GLint border) +{ + struct gl_texture_unit *texUnit = + &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; + struct gl_texture_object *texObj = + _mesa_select_tex_object(ctx, texUnit, target); + struct gl_texture_image *texImage = + _mesa_select_tex_image(ctx, texObj, target, level); + + if (border) + goto fail; + + /* Setup or redefine the texture object, mipmap tree and texture + * image. Don't populate yet. + */ + ctx->Driver.TexImage1D(ctx, target, level, internalFormat, + width, border, + GL_RGBA, CHAN_TYPE, NULL, + &ctx->DefaultPacking, texObj, texImage); + + if (!do_copy_texsubimage(intel_context(ctx), + intel_texture_image(texImage), + internalFormat, 0, 0, x, y, width, 1)) + goto fail; + + return; + + fail: + _swrast_copy_teximage1d(ctx, target, level, internalFormat, x, y, + width, border); +} + +void +intelCopyTexImage2D(GLcontext * ctx, GLenum target, GLint level, + GLenum internalFormat, + GLint x, GLint y, GLsizei width, GLsizei height, + GLint border) +{ + struct gl_texture_unit *texUnit = + &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; + struct gl_texture_object *texObj = + _mesa_select_tex_object(ctx, texUnit, target); + struct gl_texture_image *texImage = + _mesa_select_tex_image(ctx, texObj, target, level); + + if (border) + goto fail; + + /* Setup or redefine the texture object, mipmap tree and texture + * image. Don't populate yet. + */ + ctx->Driver.TexImage2D(ctx, target, level, internalFormat, + width, height, border, + GL_RGBA, CHAN_TYPE, NULL, + &ctx->DefaultPacking, texObj, texImage); + + + if (!do_copy_texsubimage(intel_context(ctx), + intel_texture_image(texImage), + internalFormat, 0, 0, x, y, width, height)) + goto fail; + + return; + + fail: + _swrast_copy_teximage2d(ctx, target, level, internalFormat, x, y, + width, height, border); +} + + +void +intelCopyTexSubImage1D(GLcontext * ctx, GLenum target, GLint level, + GLint xoffset, GLint x, GLint y, GLsizei width) +{ + struct gl_texture_unit *texUnit = + &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; + struct gl_texture_object *texObj = + _mesa_select_tex_object(ctx, texUnit, target); + struct gl_texture_image *texImage = + _mesa_select_tex_image(ctx, texObj, target, level); + GLenum internalFormat = texImage->InternalFormat; + + /* XXX need to check as in above function? */ + + /* Need to check texture is compatible with source format. + */ + + if (!do_copy_texsubimage(intel_context(ctx), + intel_texture_image(texImage), + internalFormat, xoffset, 0, x, y, width, 1)) { + _swrast_copy_texsubimage1d(ctx, target, level, xoffset, x, y, width); + } +} + + + +void +intelCopyTexSubImage2D(GLcontext * ctx, GLenum target, GLint level, + GLint xoffset, GLint yoffset, + GLint x, GLint y, GLsizei width, GLsizei height) +{ + struct gl_texture_unit *texUnit = + &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; + struct gl_texture_object *texObj = + _mesa_select_tex_object(ctx, texUnit, target); + struct gl_texture_image *texImage = + _mesa_select_tex_image(ctx, texObj, target, level); + GLenum internalFormat = texImage->InternalFormat; + + + /* Need to check texture is compatible with source format. + */ + + if (!do_copy_texsubimage(intel_context(ctx), + intel_texture_image(texImage), + internalFormat, + xoffset, yoffset, x, y, width, height)) { + + DBG("%s - fallback to swrast\n", __FUNCTION__); + + _swrast_copy_texsubimage2d(ctx, target, level, + xoffset, yoffset, x, y, width, height); + } +} diff --git a/src/mesa/drivers/dri/i915tex/intel_tex_format.c b/src/mesa/drivers/dri/i915tex/intel_tex_format.c new file mode 100644 index 00000000000..6e058dff69f --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/intel_tex_format.c @@ -0,0 +1,172 @@ +#include "intel_context.h" +#include "intel_tex.h" +#include "texformat.h" +#include "enums.h" + +/* It works out that this function is fine for all the supported + * hardware. However, there is still a need to map the formats onto + * hardware descriptors. + */ +/* Note that the i915 can actually support many more formats than + * these if we take the step of simply swizzling the colors + * immediately after sampling... + */ +const struct gl_texture_format * +intelChooseTextureFormat(GLcontext * ctx, GLint internalFormat, + GLenum format, GLenum type) +{ + struct intel_context *intel = intel_context(ctx); + const GLboolean do32bpt = (intel->intelScreen->cpp == 4); + + switch (internalFormat) { + case 4: + case GL_RGBA: + case GL_COMPRESSED_RGBA: + if (format == GL_BGRA) { + if (type == GL_UNSIGNED_BYTE || type == GL_UNSIGNED_INT_8_8_8_8_REV) { + return &_mesa_texformat_argb8888; + } + else if (type == GL_UNSIGNED_SHORT_4_4_4_4_REV) { + return &_mesa_texformat_argb4444; + } + else if (type == GL_UNSIGNED_SHORT_1_5_5_5_REV) { + return &_mesa_texformat_argb1555; + } + } + return do32bpt ? &_mesa_texformat_argb8888 : &_mesa_texformat_argb4444; + + case 3: + case GL_RGB: + case GL_COMPRESSED_RGB: + if (format == GL_RGB && type == GL_UNSIGNED_SHORT_5_6_5) { + return &_mesa_texformat_rgb565; + } + return do32bpt ? &_mesa_texformat_argb8888 : &_mesa_texformat_rgb565; + + case GL_RGBA8: + case GL_RGB10_A2: + case GL_RGBA12: + case GL_RGBA16: + return do32bpt ? &_mesa_texformat_argb8888 : &_mesa_texformat_argb4444; + + case GL_RGBA4: + case GL_RGBA2: + return &_mesa_texformat_argb4444; + + case GL_RGB5_A1: + return &_mesa_texformat_argb1555; + + case GL_RGB8: + case GL_RGB10: + case GL_RGB12: + case GL_RGB16: + return &_mesa_texformat_argb8888; + + case GL_RGB5: + case GL_RGB4: + case GL_R3_G3_B2: + return &_mesa_texformat_rgb565; + + case GL_ALPHA: + case GL_ALPHA4: + case GL_ALPHA8: + case GL_ALPHA12: + case GL_ALPHA16: + case GL_COMPRESSED_ALPHA: + return &_mesa_texformat_a8; + + case 1: + case GL_LUMINANCE: + case GL_LUMINANCE4: + case GL_LUMINANCE8: + case GL_LUMINANCE12: + case GL_LUMINANCE16: + case GL_COMPRESSED_LUMINANCE: + return &_mesa_texformat_l8; + + case 2: + case GL_LUMINANCE_ALPHA: + case GL_LUMINANCE4_ALPHA4: + case GL_LUMINANCE6_ALPHA2: + case GL_LUMINANCE8_ALPHA8: + case GL_LUMINANCE12_ALPHA4: + case GL_LUMINANCE12_ALPHA12: + case GL_LUMINANCE16_ALPHA16: + case GL_COMPRESSED_LUMINANCE_ALPHA: + return &_mesa_texformat_al88; + + case GL_INTENSITY: + case GL_INTENSITY4: + case GL_INTENSITY8: + case GL_INTENSITY12: + case GL_INTENSITY16: + case GL_COMPRESSED_INTENSITY: + return &_mesa_texformat_i8; + + case GL_YCBCR_MESA: + if (type == GL_UNSIGNED_SHORT_8_8_MESA || type == GL_UNSIGNED_BYTE) + return &_mesa_texformat_ycbcr; + else + return &_mesa_texformat_ycbcr_rev; + + case GL_COMPRESSED_RGB_FXT1_3DFX: + return &_mesa_texformat_rgb_fxt1; + case GL_COMPRESSED_RGBA_FXT1_3DFX: + return &_mesa_texformat_rgba_fxt1; + + case GL_RGB_S3TC: + case GL_RGB4_S3TC: + case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: + return &_mesa_texformat_rgb_dxt1; + + case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: + return &_mesa_texformat_rgba_dxt1; + + case GL_RGBA_S3TC: + case GL_RGBA4_S3TC: + case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT: + return &_mesa_texformat_rgba_dxt3; + + case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT: + return &_mesa_texformat_rgba_dxt5; + + case GL_DEPTH_COMPONENT: + case GL_DEPTH_COMPONENT16: + case GL_DEPTH_COMPONENT24: + case GL_DEPTH_COMPONENT32: + return &_mesa_texformat_z16; + + case GL_DEPTH_STENCIL_EXT: + case GL_DEPTH24_STENCIL8_EXT: + return &_mesa_texformat_z24_s8; + + default: + fprintf(stderr, "unexpected texture format %s in %s\n", + _mesa_lookup_enum_by_nr(internalFormat), __FUNCTION__); + return NULL; + } + + return NULL; /* never get here */ +} + +int intel_compressed_num_bytes(GLuint mesaFormat) +{ + int bytes = 0; + switch(mesaFormat) { + + case MESA_FORMAT_RGB_FXT1: + case MESA_FORMAT_RGBA_FXT1: + case MESA_FORMAT_RGB_DXT1: + case MESA_FORMAT_RGBA_DXT1: + bytes = 2; + break; + + case MESA_FORMAT_RGBA_DXT3: + case MESA_FORMAT_RGBA_DXT5: + bytes = 4; + default: + break; + } + + return bytes; +} diff --git a/src/mesa/drivers/dri/i915tex/intel_tex_image.c b/src/mesa/drivers/dri/i915tex/intel_tex_image.c new file mode 100644 index 00000000000..79f377a4b72 --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/intel_tex_image.c @@ -0,0 +1,685 @@ + +#include +#include + +#include "glheader.h" +#include "macros.h" +#include "mtypes.h" +#include "enums.h" +#include "colortab.h" +#include "convolve.h" +#include "context.h" +#include "simple_list.h" +#include "texcompress.h" +#include "texformat.h" +#include "texobj.h" +#include "texstore.h" + +#include "intel_context.h" +#include "intel_mipmap_tree.h" +#include "intel_buffer_objects.h" +#include "intel_batchbuffer.h" +#include "intel_tex.h" +#include "intel_ioctl.h" +#include "intel_blit.h" + +#define FILE_DEBUG_FLAG DEBUG_TEXTURE + +/* Functions to store texture images. Where possible, mipmap_tree's + * will be created or further instantiated with image data, otherwise + * images will be stored in malloc'd memory. A validation step is + * required to pull those images into a mipmap tree, or otherwise + * decide a fallback is required. + */ + + +static int +logbase2(int n) +{ + GLint i = 1; + GLint log2 = 0; + + while (n > i) { + i *= 2; + log2++; + } + + return log2; +} + + +/* Otherwise, store it in memory if (Border != 0) or (any dimension == + * 1). + * + * Otherwise, if max_level >= level >= min_level, create tree with + * space for textures from min_level down to max_level. + * + * Otherwise, create tree with space for textures from (level + * 0)..(1x1). Consider pruning this tree at a validation if the + * saving is worth it. + */ +static void +guess_and_alloc_mipmap_tree(struct intel_context *intel, + struct intel_texture_object *intelObj, + struct intel_texture_image *intelImage) +{ + GLuint firstLevel; + GLuint lastLevel; + GLuint width = intelImage->base.Width; + GLuint height = intelImage->base.Height; + GLuint depth = intelImage->base.Depth; + GLuint l2width, l2height, l2depth; + GLuint i, comp_byte = 0; + + DBG("%s\n", __FUNCTION__); + + if (intelImage->base.Border) + return; + + if (intelImage->level > intelObj->base.BaseLevel && + (intelImage->base.Width == 1 || + (intelObj->base.Target != GL_TEXTURE_1D && + intelImage->base.Height == 1) || + (intelObj->base.Target == GL_TEXTURE_3D && + intelImage->base.Depth == 1))) + return; + + /* If this image disrespects BaseLevel, allocate from level zero. + * Usually BaseLevel == 0, so it's unlikely to happen. + */ + if (intelImage->level < intelObj->base.BaseLevel) + firstLevel = 0; + else + firstLevel = intelObj->base.BaseLevel; + + + /* Figure out image dimensions at start level. + */ + for (i = intelImage->level; i > firstLevel; i--) { + width <<= 1; + if (height != 1) + height <<= 1; + if (depth != 1) + depth <<= 1; + } + + /* Guess a reasonable value for lastLevel. This is probably going + * to be wrong fairly often and might mean that we have to look at + * resizable buffers, or require that buffers implement lazy + * pagetable arrangements. + */ + if ((intelObj->base.MinFilter == GL_NEAREST || + intelObj->base.MinFilter == GL_LINEAR) && + intelImage->level == firstLevel) { + lastLevel = firstLevel; + } + else { + l2width = logbase2(width); + l2height = logbase2(height); + l2depth = logbase2(depth); + lastLevel = firstLevel + MAX2(MAX2(l2width, l2height), l2depth); + } + + assert(!intelObj->mt); + if (intelImage->base.IsCompressed) + comp_byte = intel_compressed_num_bytes(intelImage->base.TexFormat->MesaFormat); + intelObj->mt = intel_miptree_create(intel, + intelObj->base.Target, + intelImage->base.InternalFormat, + firstLevel, + lastLevel, + width, + height, + depth, + intelImage->base.TexFormat->TexelBytes, + comp_byte); + + DBG("%s - success\n", __FUNCTION__); +} + + + + +static GLuint +target_to_face(GLenum target) +{ + switch (target) { + case GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB: + case GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB: + case GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB: + return ((GLuint) target - (GLuint) GL_TEXTURE_CUBE_MAP_POSITIVE_X); + default: + return 0; + } +} + +/* There are actually quite a few combinations this will work for, + * more than what I've listed here. + */ +static GLboolean +check_pbo_format(GLint internalFormat, + GLenum format, GLenum type, + const struct gl_texture_format *mesa_format) +{ + switch (internalFormat) { + case 4: + case GL_RGBA: + return (format == GL_BGRA && + (type == GL_UNSIGNED_BYTE || + type == GL_UNSIGNED_INT_8_8_8_8_REV) && + mesa_format == &_mesa_texformat_argb8888); + case 3: + case GL_RGB: + return (format == GL_RGB && + type == GL_UNSIGNED_SHORT_5_6_5 && + mesa_format == &_mesa_texformat_rgb565); + case GL_YCBCR_MESA: + return (type == GL_UNSIGNED_SHORT_8_8_MESA || type == GL_UNSIGNED_BYTE); + default: + return GL_FALSE; + } +} + + +/* XXX: Do this for TexSubImage also: + */ +static GLboolean +try_pbo_upload(struct intel_context *intel, + struct intel_texture_image *intelImage, + const struct gl_pixelstore_attrib *unpack, + GLint internalFormat, + GLint width, GLint height, + GLenum format, GLenum type, const void *pixels) +{ + struct intel_buffer_object *pbo = intel_buffer_object(unpack->BufferObj); + GLuint src_offset, src_stride; + GLuint dst_offset, dst_stride; + + if (!pbo || + intel->ctx._ImageTransferState || + unpack->SkipPixels || unpack->SkipRows) { + _mesa_printf("%s: failure 1\n", __FUNCTION__); + return GL_FALSE; + } + + src_offset = (GLuint) pixels; + + if (unpack->RowLength > 0) + src_stride = unpack->RowLength; + else + src_stride = width; + + dst_offset = intel_miptree_image_offset(intelImage->mt, + intelImage->face, + intelImage->level); + + dst_stride = intelImage->mt->pitch; + + intelFlush(&intel->ctx); + LOCK_HARDWARE(intel); + { + struct _DriBufferObject *src_buffer = + intel_bufferobj_buffer(intel, pbo, INTEL_READ); + struct _DriBufferObject *dst_buffer = + intel_region_buffer(intel->intelScreen, intelImage->mt->region, + INTEL_WRITE_FULL); + + + intelEmitCopyBlit(intel, + intelImage->mt->cpp, + src_stride, src_buffer, src_offset, + dst_stride, dst_buffer, dst_offset, + 0, 0, 0, 0, width, height); + + intel_batchbuffer_flush(intel->batch); + } + UNLOCK_HARDWARE(intel); + + return GL_TRUE; +} + + + +static GLboolean +try_pbo_zcopy(struct intel_context *intel, + struct intel_texture_image *intelImage, + const struct gl_pixelstore_attrib *unpack, + GLint internalFormat, + GLint width, GLint height, + GLenum format, GLenum type, const void *pixels) +{ + struct intel_buffer_object *pbo = intel_buffer_object(unpack->BufferObj); + GLuint src_offset, src_stride; + GLuint dst_offset, dst_stride; + + if (!pbo || + intel->ctx._ImageTransferState || + unpack->SkipPixels || unpack->SkipRows) { + _mesa_printf("%s: failure 1\n", __FUNCTION__); + return GL_FALSE; + } + + src_offset = (GLuint) pixels; + + if (unpack->RowLength > 0) + src_stride = unpack->RowLength; + else + src_stride = width; + + dst_offset = intel_miptree_image_offset(intelImage->mt, + intelImage->face, + intelImage->level); + + dst_stride = intelImage->mt->pitch; + + if (src_stride != dst_stride || dst_offset != 0 || src_offset != 0) { + _mesa_printf("%s: failure 2\n", __FUNCTION__); + return GL_FALSE; + } + + intel_region_attach_pbo(intel->intelScreen, intelImage->mt->region, pbo); + + return GL_TRUE; +} + + + + + + +static void +intelTexImage(GLcontext * ctx, + GLint dims, + GLenum target, GLint level, + GLint internalFormat, + GLint width, GLint height, GLint depth, + GLint border, + GLenum format, GLenum type, const void *pixels, + const struct gl_pixelstore_attrib *unpack, + struct gl_texture_object *texObj, + struct gl_texture_image *texImage, GLsizei imageSize, int compressed) +{ + struct intel_context *intel = intel_context(ctx); + struct intel_texture_object *intelObj = intel_texture_object(texObj); + struct intel_texture_image *intelImage = intel_texture_image(texImage); + GLint postConvWidth = width; + GLint postConvHeight = height; + GLint texelBytes, sizeInBytes; + GLuint dstRowStride; + + + DBG("%s target %s level %d %dx%dx%d border %d\n", __FUNCTION__, + _mesa_lookup_enum_by_nr(target), level, width, height, depth, border); + + intelFlush(ctx); + + intelImage->face = target_to_face(target); + intelImage->level = level; + + if (ctx->_ImageTransferState & IMAGE_CONVOLUTION_BIT) { + _mesa_adjust_image_for_convolution(ctx, dims, &postConvWidth, + &postConvHeight); + } + + /* choose the texture format */ + texImage->TexFormat = intelChooseTextureFormat(ctx, internalFormat, + format, type); + + assert(texImage->TexFormat); + + switch (dims) { + case 1: + texImage->FetchTexelc = texImage->TexFormat->FetchTexel1D; + texImage->FetchTexelf = texImage->TexFormat->FetchTexel1Df; + break; + case 2: + texImage->FetchTexelc = texImage->TexFormat->FetchTexel2D; + texImage->FetchTexelf = texImage->TexFormat->FetchTexel2Df; + break; + case 3: + texImage->FetchTexelc = texImage->TexFormat->FetchTexel3D; + texImage->FetchTexelf = texImage->TexFormat->FetchTexel3Df; + break; + default: + assert(0); + break; + } + + if (texImage->TexFormat->TexelBytes == 0) { + /* must be a compressed format */ + texelBytes = 0; + texImage->IsCompressed = GL_TRUE; + texImage->CompressedSize = + ctx->Driver.CompressedTextureSize(ctx, texImage->Width, + texImage->Height, texImage->Depth, + texImage->TexFormat->MesaFormat); + } else { + texelBytes = texImage->TexFormat->TexelBytes; + + /* Minimum pitch of 32 bytes */ + if (postConvWidth * texelBytes < 32) { + postConvWidth = 32 / texelBytes; + texImage->RowStride = postConvWidth; + } + + assert(texImage->RowStride == postConvWidth); + } + + /* Release the reference to a potentially orphaned buffer. + * Release any old malloced memory. + */ + if (intelImage->mt) { + intel_miptree_release(intel, &intelImage->mt); + assert(!texImage->Data); + } + else if (texImage->Data) { + _mesa_align_free(texImage->Data); + } + + /* If this is the only texture image in the tree, could call + * bmBufferData with NULL data to free the old block and avoid + * waiting on any outstanding fences. + */ + if (intelObj->mt && + intelObj->mt->first_level == level && + intelObj->mt->last_level == level && + intelObj->mt->target != GL_TEXTURE_CUBE_MAP_ARB && + !intel_miptree_match_image(intelObj->mt, &intelImage->base, + intelImage->face, intelImage->level)) { + + DBG("release it\n"); + intel_miptree_release(intel, &intelObj->mt); + assert(!intelObj->mt); + } + + if (!intelObj->mt) { + guess_and_alloc_mipmap_tree(intel, intelObj, intelImage); + if (!intelObj->mt) { + DBG("guess_and_alloc_mipmap_tree: failed\n"); + } + } + + + assert(!intelImage->mt); + + if (intelObj->mt && + intel_miptree_match_image(intelObj->mt, &intelImage->base, + intelImage->face, intelImage->level)) { + + intel_miptree_reference(&intelImage->mt, intelObj->mt); + assert(intelImage->mt); + } + + if (!intelImage->mt) + DBG("XXX: Image did not fit into tree - storing in local memory!\n"); + + /* PBO fastpaths: + */ + if (dims <= 2 && + intelImage->mt && + intel_buffer_object(unpack->BufferObj) && + check_pbo_format(internalFormat, format, + type, intelImage->base.TexFormat)) { + + DBG("trying pbo upload\n"); + + /* Attempt to texture directly from PBO data (zero copy upload). + * + * Currently disable as it can lead to worse as well as better + * performance (in particular when intel_region_cow() is + * required). + */ + if (intelObj->mt == intelImage->mt && + intelObj->mt->first_level == level && + intelObj->mt->last_level == level) { + + if (try_pbo_zcopy(intel, intelImage, unpack, + internalFormat, + width, height, format, type, pixels)) { + + DBG("pbo zcopy upload succeeded\n"); + return; + } + } + + + /* Otherwise, attempt to use the blitter for PBO image uploads. + */ + if (try_pbo_upload(intel, intelImage, unpack, + internalFormat, + width, height, format, type, pixels)) { + DBG("pbo upload succeeded\n"); + return; + } + + DBG("pbo upload failed\n"); + } + + + + /* intelCopyTexImage calls this function with pixels == NULL, with + * the expectation that the mipmap tree will be set up but nothing + * more will be done. This is where those calls return: + */ + if (compressed) { + pixels = _mesa_validate_pbo_compressed_teximage(ctx, imageSize, pixels, + unpack, + "glCompressedTexImage"); + } else { + pixels = _mesa_validate_pbo_teximage(ctx, dims, width, height, 1, + format, type, + pixels, unpack, "glTexImage"); + } + if (!pixels) + return; + + + if (intelImage->mt) + intel_region_idle(intel->intelScreen, intelImage->mt->region); + + LOCK_HARDWARE(intel); + + if (intelImage->mt) { + texImage->Data = intel_miptree_image_map(intel, + intelImage->mt, + intelImage->face, + intelImage->level, + &dstRowStride, + intelImage->base.ImageOffsets); + } + else { + /* Allocate regular memory and store the image there temporarily. */ + if (texImage->IsCompressed) { + sizeInBytes = texImage->CompressedSize; + dstRowStride = + _mesa_compressed_row_stride(texImage->TexFormat->MesaFormat, width); + assert(dims != 3); + } + else { + dstRowStride = postConvWidth * texelBytes; + sizeInBytes = depth * dstRowStride * postConvHeight; + } + + texImage->Data = malloc(sizeInBytes); + } + + DBG("Upload image %dx%dx%d row_len %x " + "pitch %x\n", + width, height, depth, width * texelBytes, dstRowStride); + + /* Copy data. Would like to know when it's ok for us to eg. use + * the blitter to copy. Or, use the hardware to do the format + * conversion and copy: + */ + if (compressed) { + memcpy(texImage->Data, pixels, imageSize); + } else if (!texImage->TexFormat->StoreImage(ctx, dims, + texImage->_BaseFormat, + texImage->TexFormat, + texImage->Data, 0, 0, 0, /* dstX/Y/Zoffset */ + dstRowStride, + texImage->ImageOffsets, + width, height, depth, + format, type, pixels, unpack)) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage"); + } + + _mesa_unmap_teximage_pbo(ctx, unpack); + + if (intelImage->mt) { + intel_miptree_image_unmap(intel, intelImage->mt); + texImage->Data = NULL; + } + + UNLOCK_HARDWARE(intel); + +#if 0 + /* GL_SGIS_generate_mipmap -- this can be accelerated now. + */ + if (level == texObj->BaseLevel && texObj->GenerateMipmap) { + intel_generate_mipmap(ctx, target, + &ctx->Texture.Unit[ctx->Texture.CurrentUnit], + texObj); + } +#endif +} + +void +intelTexImage3D(GLcontext * ctx, + GLenum target, GLint level, + GLint internalFormat, + GLint width, GLint height, GLint depth, + GLint border, + GLenum format, GLenum type, const void *pixels, + const struct gl_pixelstore_attrib *unpack, + struct gl_texture_object *texObj, + struct gl_texture_image *texImage) +{ + intelTexImage(ctx, 3, target, level, + internalFormat, width, height, depth, border, + format, type, pixels, unpack, texObj, texImage, 0, 0); +} + + +void +intelTexImage2D(GLcontext * ctx, + GLenum target, GLint level, + GLint internalFormat, + GLint width, GLint height, GLint border, + GLenum format, GLenum type, const void *pixels, + const struct gl_pixelstore_attrib *unpack, + struct gl_texture_object *texObj, + struct gl_texture_image *texImage) +{ + intelTexImage(ctx, 2, target, level, + internalFormat, width, height, 1, border, + format, type, pixels, unpack, texObj, texImage, 0, 0); +} + +void +intelTexImage1D(GLcontext * ctx, + GLenum target, GLint level, + GLint internalFormat, + GLint width, GLint border, + GLenum format, GLenum type, const void *pixels, + const struct gl_pixelstore_attrib *unpack, + struct gl_texture_object *texObj, + struct gl_texture_image *texImage) +{ + intelTexImage(ctx, 1, target, level, + internalFormat, width, 1, 1, border, + format, type, pixels, unpack, texObj, texImage, 0, 0); +} + +void intelCompressedTexImage2D( GLcontext *ctx, GLenum target, GLint level, + GLint internalFormat, + GLint width, GLint height, GLint border, + GLsizei imageSize, const GLvoid *data, + struct gl_texture_object *texObj, + struct gl_texture_image *texImage ) +{ + intelTexImage(ctx, 2, target, level, + internalFormat, width, height, 1, border, + 0, 0, data, &ctx->Unpack, texObj, texImage, imageSize, 1); +} + +/** + * Need to map texture image into memory before copying image data, + * then unmap it. + */ +static void +intel_get_tex_image(GLcontext * ctx, GLenum target, GLint level, + GLenum format, GLenum type, GLvoid * pixels, + struct gl_texture_object *texObj, + struct gl_texture_image *texImage, int compressed) +{ + struct intel_context *intel = intel_context(ctx); + struct intel_texture_image *intelImage = intel_texture_image(texImage); + + /* Map */ + if (intelImage->mt) { + /* Image is stored in hardware format in a buffer managed by the + * kernel. Need to explicitly map and unmap it. + */ + intelImage->base.Data = + intel_miptree_image_map(intel, + intelImage->mt, + intelImage->face, + intelImage->level, + &intelImage->base.RowStride, + intelImage->base.ImageOffsets); + } + else { + /* Otherwise, the image should actually be stored in + * intelImage->base.Data. This is pretty confusing for + * everybody, I'd much prefer to separate the two functions of + * texImage->Data - storage for texture images in main memory + * and access (ie mappings) of images. In other words, we'd + * create a new texImage->Map field and leave Data simply for + * storage. + */ + assert(intelImage->base.Data); + } + + + if (compressed) { + _mesa_get_compressed_teximage(ctx, target, level, pixels, + texObj, texImage); + } else { + _mesa_get_teximage(ctx, target, level, format, type, pixels, + texObj, texImage); + } + + + /* Unmap */ + if (intelImage->mt) { + intel_miptree_image_unmap(intel, intelImage->mt); + intelImage->base.Data = NULL; + } +} + +void +intelGetTexImage(GLcontext * ctx, GLenum target, GLint level, + GLenum format, GLenum type, GLvoid * pixels, + struct gl_texture_object *texObj, + struct gl_texture_image *texImage) +{ + intel_get_tex_image(ctx, target, level, format, type, pixels, + texObj, texImage, 0); + + +} + +void +intelGetCompressedTexImage(GLcontext *ctx, GLenum target, GLint level, + GLvoid *pixels, + const struct gl_texture_object *texObj, + const struct gl_texture_image *texImage) +{ + intel_get_tex_image(ctx, target, level, 0, 0, pixels, + texObj, texImage, 1); + +} diff --git a/src/mesa/drivers/dri/i915tex/intel_tex_subimage.c b/src/mesa/drivers/dri/i915tex/intel_tex_subimage.c new file mode 100644 index 00000000000..25a2dca6857 --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/intel_tex_subimage.c @@ -0,0 +1,183 @@ + +/************************************************************************** + * + * Copyright 2003 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. + * + **************************************************************************/ + +#include "mtypes.h" +#include "texobj.h" +#include "texstore.h" +#include "enums.h" + +#include "intel_context.h" +#include "intel_tex.h" +#include "intel_mipmap_tree.h" + +#define FILE_DEBUG_FLAG DEBUG_TEXTURE + +static void +intelTexSubimage(GLcontext * ctx, + GLint dims, + GLenum target, GLint level, + GLint xoffset, GLint yoffset, GLint zoffset, + GLint width, GLint height, GLint depth, + GLenum format, GLenum type, const void *pixels, + const struct gl_pixelstore_attrib *packing, + struct gl_texture_object *texObj, + struct gl_texture_image *texImage) +{ + struct intel_context *intel = intel_context(ctx); + struct intel_texture_image *intelImage = intel_texture_image(texImage); + GLuint dstImageStride; + GLuint dstRowStride; + + DBG("%s target %s level %d offset %d,%d %dx%d\n", __FUNCTION__, + _mesa_lookup_enum_by_nr(target), + level, xoffset, yoffset, width, height); + + intelFlush(ctx); + + pixels = + _mesa_validate_pbo_teximage(ctx, dims, width, height, depth, format, + type, pixels, packing, "glTexSubImage2D"); + if (!pixels) + return; + + if (intelImage->mt) + intel_region_idle(intel->intelScreen, intelImage->mt->region); + + LOCK_HARDWARE(intel); + + /* Map buffer if necessary. Need to lock to prevent other contexts + * from uploading the buffer under us. + */ + if (intelImage->mt) + texImage->Data = intel_miptree_image_map(intel, + intelImage->mt, + intelImage->face, + intelImage->level, + &dstRowStride, + &dstImageStride); + + assert(dstRowStride); + + if (!texImage->TexFormat->StoreImage(ctx, dims, texImage->_BaseFormat, + texImage->TexFormat, + texImage->Data, + xoffset, yoffset, zoffset, + dstRowStride, + texImage->ImageOffsets, + width, height, depth, + format, type, pixels, packing)) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "intelTexSubImage"); + } + +#if 0 + /* GL_SGIS_generate_mipmap */ + if (level == texObj->BaseLevel && texObj->GenerateMipmap) { + _mesa_generate_mipmap(ctx, target, + &ctx->Texture.Unit[ctx->Texture.CurrentUnit], + texObj); + } +#endif + + _mesa_unmap_teximage_pbo(ctx, packing); + + if (intelImage->mt) { + intel_miptree_image_unmap(intel, intelImage->mt); + texImage->Data = NULL; + } + + UNLOCK_HARDWARE(intel); +} + + + + + +void +intelTexSubImage3D(GLcontext * ctx, + GLenum target, + GLint level, + GLint xoffset, GLint yoffset, GLint zoffset, + GLsizei width, GLsizei height, GLsizei depth, + GLenum format, GLenum type, + const GLvoid * pixels, + const struct gl_pixelstore_attrib *packing, + struct gl_texture_object *texObj, + struct gl_texture_image *texImage) +{ + + intelTexSubimage(ctx, 3, + target, level, + xoffset, yoffset, zoffset, + width, height, depth, + format, type, pixels, packing, texObj, texImage); + +} + + + +void +intelTexSubImage2D(GLcontext * ctx, + GLenum target, + GLint level, + GLint xoffset, GLint yoffset, + GLsizei width, GLsizei height, + GLenum format, GLenum type, + const GLvoid * pixels, + const struct gl_pixelstore_attrib *packing, + struct gl_texture_object *texObj, + struct gl_texture_image *texImage) +{ + + intelTexSubimage(ctx, 2, + target, level, + xoffset, yoffset, 0, + width, height, 1, + format, type, pixels, packing, texObj, texImage); + +} + + +void +intelTexSubImage1D(GLcontext * ctx, + GLenum target, + GLint level, + GLint xoffset, + GLsizei width, + GLenum format, GLenum type, + const GLvoid * pixels, + const struct gl_pixelstore_attrib *packing, + struct gl_texture_object *texObj, + struct gl_texture_image *texImage) +{ + intelTexSubimage(ctx, 1, + target, level, + xoffset, 0, 0, + width, 1, 1, + format, type, pixels, packing, texObj, texImage); + +} diff --git a/src/mesa/drivers/dri/i915tex/intel_tex_validate.c b/src/mesa/drivers/dri/i915tex/intel_tex_validate.c new file mode 100644 index 00000000000..5f82dfa19e6 --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/intel_tex_validate.c @@ -0,0 +1,256 @@ +#include "mtypes.h" +#include "macros.h" + +#include "intel_context.h" +#include "intel_mipmap_tree.h" +#include "intel_tex.h" + +#define FILE_DEBUG_FLAG DEBUG_TEXTURE + +/** + * Compute which mipmap levels that really need to be sent to the hardware. + * This depends on the base image size, GL_TEXTURE_MIN_LOD, + * GL_TEXTURE_MAX_LOD, GL_TEXTURE_BASE_LEVEL, and GL_TEXTURE_MAX_LEVEL. + */ +static void +intel_calculate_first_last_level(struct intel_texture_object *intelObj) +{ + struct gl_texture_object *tObj = &intelObj->base; + const struct gl_texture_image *const baseImage = + tObj->Image[0][tObj->BaseLevel]; + + /* These must be signed values. MinLod and MaxLod can be negative numbers, + * and having firstLevel and lastLevel as signed prevents the need for + * extra sign checks. + */ + int firstLevel; + int lastLevel; + + /* Yes, this looks overly complicated, but it's all needed. + */ + switch (tObj->Target) { + case GL_TEXTURE_1D: + case GL_TEXTURE_2D: + case GL_TEXTURE_3D: + case GL_TEXTURE_CUBE_MAP: + if (tObj->MinFilter == GL_NEAREST || tObj->MinFilter == GL_LINEAR) { + /* GL_NEAREST and GL_LINEAR only care about GL_TEXTURE_BASE_LEVEL. + */ + firstLevel = lastLevel = tObj->BaseLevel; + } + else { + firstLevel = tObj->BaseLevel + (GLint) (tObj->MinLod + 0.5); + firstLevel = MAX2(firstLevel, tObj->BaseLevel); + lastLevel = tObj->BaseLevel + (GLint) (tObj->MaxLod + 0.5); + lastLevel = MAX2(lastLevel, tObj->BaseLevel); + lastLevel = MIN2(lastLevel, tObj->BaseLevel + baseImage->MaxLog2); + lastLevel = MIN2(lastLevel, tObj->MaxLevel); + lastLevel = MAX2(firstLevel, lastLevel); /* need at least one level */ + } + break; + case GL_TEXTURE_RECTANGLE_NV: + case GL_TEXTURE_4D_SGIS: + firstLevel = lastLevel = 0; + break; + default: + return; + } + + /* save these values */ + intelObj->firstLevel = firstLevel; + intelObj->lastLevel = lastLevel; +} + +static void +copy_image_data_to_tree(struct intel_context *intel, + struct intel_texture_object *intelObj, + struct intel_texture_image *intelImage) +{ + if (intelImage->mt) { + /* Copy potentially with the blitter: + */ + intel_miptree_image_copy(intel, + intelObj->mt, + intelImage->face, + intelImage->level, intelImage->mt); + + intel_miptree_release(intel, &intelImage->mt); + } + else { + assert(intelImage->base.Data != NULL); + + /* More straightforward upload. + */ + intel_miptree_image_data(intel, + intelObj->mt, + intelImage->face, + intelImage->level, + intelImage->base.Data, + intelImage->base.RowStride, + intelImage->base.RowStride * + intelImage->base.Height); + _mesa_align_free(intelImage->base.Data); + intelImage->base.Data = NULL; + } + + intel_miptree_reference(&intelImage->mt, intelObj->mt); +} + + +/* + */ +GLuint +intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit) +{ + struct gl_texture_object *tObj = intel->ctx.Texture.Unit[unit]._Current; + struct intel_texture_object *intelObj = intel_texture_object(tObj); + + GLuint face, i; + GLuint nr_faces = 0; + struct intel_texture_image *firstImage; + + /* We know/require this is true by now: + */ + assert(intelObj->base.Complete); + + /* What levels must the tree include at a minimum? + */ + intel_calculate_first_last_level(intelObj); + firstImage = + intel_texture_image(intelObj->base.Image[0][intelObj->firstLevel]); + + /* Fallback case: + */ + if (firstImage->base.Border) { + if (intelObj->mt) { + intel_miptree_release(intel, &intelObj->mt); + } + return GL_FALSE; + } + + + /* If both firstImage and intelObj have a tree which can contain + * all active images, favour firstImage. Note that because of the + * completeness requirement, we know that the image dimensions + * will match. + */ + if (firstImage->mt && + firstImage->mt != intelObj->mt && + firstImage->mt->first_level <= intelObj->firstLevel && + firstImage->mt->last_level >= intelObj->lastLevel) { + + if (intelObj->mt) + intel_miptree_release(intel, &intelObj->mt); + + intel_miptree_reference(&intelObj->mt, firstImage->mt); + } + + /* Check tree can hold all active levels. Check tree matches + * target, imageFormat, etc. + * + * XXX: For some layouts (eg i945?), the test might have to be + * first_level == firstLevel, as the tree isn't valid except at the + * original start level. Hope to get around this by + * programming minLod, maxLod, baseLevel into the hardware and + * leaving the tree alone. + */ + if (intelObj->mt && + ((intelObj->mt->first_level > intelObj->firstLevel) || + (intelObj->mt->last_level < intelObj->lastLevel) || + (intelObj->mt->internal_format != firstImage->base.InternalFormat))) { + intel_miptree_release(intel, &intelObj->mt); + } + + + /* May need to create a new tree: + */ + if (!intelObj->mt) { + int comp_byte = 0; + + if (firstImage->base.IsCompressed) + comp_byte = intel_compressed_num_bytes(firstImage->base.TexFormat->MesaFormat); + intelObj->mt = intel_miptree_create(intel, + intelObj->base.Target, + firstImage->base.InternalFormat, + intelObj->firstLevel, + intelObj->lastLevel, + firstImage->base.Width, + firstImage->base.Height, + firstImage->base.Depth, + firstImage->base.TexFormat-> + TexelBytes, + comp_byte); + } + + /* Pull in any images not in the object's tree: + */ + nr_faces = (intelObj->base.Target == GL_TEXTURE_CUBE_MAP) ? 6 : 1; + for (face = 0; face < nr_faces; face++) { + for (i = intelObj->firstLevel; i <= intelObj->lastLevel; i++) { + struct intel_texture_image *intelImage = + intel_texture_image(intelObj->base.Image[face][i]); + + /* Need to import images in main memory or held in other trees. + */ + if (intelObj->mt != intelImage->mt) { + copy_image_data_to_tree(intel, intelObj, intelImage); + } + } + } + + return GL_TRUE; +} + + + +void +intel_tex_map_images(struct intel_context *intel, + struct intel_texture_object *intelObj) +{ + GLuint nr_faces = (intelObj->base.Target == GL_TEXTURE_CUBE_MAP) ? 6 : 1; + GLuint face, i; + + DBG("%s\n", __FUNCTION__); + + for (face = 0; face < nr_faces; face++) { + for (i = intelObj->firstLevel; i <= intelObj->lastLevel; i++) { + struct intel_texture_image *intelImage = + intel_texture_image(intelObj->base.Image[face][i]); + + if (intelImage->mt) { + intelImage->base.Data = + intel_miptree_image_map(intel, + intelImage->mt, + intelImage->face, + intelImage->level, + &intelImage->base.RowStride, + intelImage->base.ImageOffsets); + /* convert stride to texels, not bytes */ + intelImage->base.RowStride /= intelImage->mt->cpp; +/* intelImage->base.ImageStride /= intelImage->mt->cpp; */ + } + } + } +} + + + +void +intel_tex_unmap_images(struct intel_context *intel, + struct intel_texture_object *intelObj) +{ + GLuint nr_faces = (intelObj->base.Target == GL_TEXTURE_CUBE_MAP) ? 6 : 1; + GLuint face, i; + + for (face = 0; face < nr_faces; face++) { + for (i = intelObj->firstLevel; i <= intelObj->lastLevel; i++) { + struct intel_texture_image *intelImage = + intel_texture_image(intelObj->base.Image[face][i]); + + if (intelImage->mt) { + intel_miptree_image_unmap(intel, intelImage->mt); + intelImage->base.Data = NULL; + } + } + } +} diff --git a/src/mesa/drivers/dri/i915tex/intel_tris.c b/src/mesa/drivers/dri/i915tex/intel_tris.c new file mode 100644 index 00000000000..1ba49d8f6ec --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/intel_tris.c @@ -0,0 +1,1149 @@ +/************************************************************************** + * + * Copyright 2003 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. + * + **************************************************************************/ + +#include "glheader.h" +#include "context.h" +#include "macros.h" +#include "enums.h" +#include "texobj.h" +#include "state.h" +#include "dd.h" + +#include "swrast/swrast.h" +#include "swrast_setup/swrast_setup.h" +#include "tnl/t_context.h" +#include "tnl/t_pipeline.h" +#include "tnl/t_vertex.h" + +#include "intel_screen.h" +#include "intel_context.h" +#include "intel_tris.h" +#include "intel_batchbuffer.h" +#include "intel_reg.h" +#include "intel_span.h" +#include "intel_tex.h" + +static void intelRenderPrimitive(GLcontext * ctx, GLenum prim); +static void intelRasterPrimitive(GLcontext * ctx, GLenum rprim, + GLuint hwprim); + +/* + */ +static void +intel_flush_inline_primitive(struct intel_context *intel) +{ + GLuint used = intel->batch->ptr - intel->prim.start_ptr; + + assert(intel->prim.primitive != ~0); + +/* _mesa_printf("/\n"); */ + + if (used < 8) + goto do_discard; + + *(int *) intel->prim.start_ptr = (_3DPRIMITIVE | + intel->prim.primitive | (used / 4 - 2)); + + goto finished; + + do_discard: + intel->batch->ptr -= used; + + finished: + intel->prim.primitive = ~0; + intel->prim.start_ptr = 0; + intel->prim.flush = 0; +} + + +/* Emit a primitive referencing vertices in a vertex buffer. + */ +void +intelStartInlinePrimitive(struct intel_context *intel, + GLuint prim, GLuint batch_flags) +{ + BATCH_LOCALS; + + intel->vtbl.emit_state(intel); + + /* Need to make sure at the very least that we don't wrap + * batchbuffers in BEGIN_BATCH below, otherwise the primitive will + * be emitted to a batchbuffer missing the required full-state + * preamble. + */ + if (intel_batchbuffer_space(intel->batch) < 100) { + intel_batchbuffer_flush(intel->batch); + intel->vtbl.emit_state(intel); + } + +/* _mesa_printf("%s *", __progname); */ + + /* Emit a slot which will be filled with the inline primitive + * command later. + */ + BEGIN_BATCH(2, batch_flags); + OUT_BATCH(0); + + intel->prim.start_ptr = intel->batch->ptr; + intel->prim.primitive = prim; + intel->prim.flush = intel_flush_inline_primitive; + + OUT_BATCH(0); + ADVANCE_BATCH(); + +/* _mesa_printf(">"); */ +} + + +void +intelWrapInlinePrimitive(struct intel_context *intel) +{ + GLuint prim = intel->prim.primitive; + GLuint batchflags = intel->batch->flags; + + intel_flush_inline_primitive(intel); + intel_batchbuffer_flush(intel->batch); + intelStartInlinePrimitive(intel, prim, batchflags); /* ??? */ +} + +GLuint * +intelExtendInlinePrimitive(struct intel_context *intel, GLuint dwords) +{ + GLuint sz = dwords * sizeof(GLuint); + GLuint *ptr; + + assert(intel->prim.flush == intel_flush_inline_primitive); + + if (intel_batchbuffer_space(intel->batch) < sz) + intelWrapInlinePrimitive(intel); + +/* _mesa_printf("."); */ + + intel->vtbl.assert_not_dirty(intel); + + ptr = (GLuint *) intel->batch->ptr; + intel->batch->ptr += sz; + + return ptr; +} + + + +/*********************************************************************** + * Emit primitives as inline vertices * + ***********************************************************************/ + +#ifdef __i386__ +#define COPY_DWORDS( j, vb, vertsize, v ) \ +do { \ + int __tmp; \ + __asm__ __volatile__( "rep ; movsl" \ + : "=%c" (j), "=D" (vb), "=S" (__tmp) \ + : "0" (vertsize), \ + "D" ((long)vb), \ + "S" ((long)v) ); \ +} while (0) +#else +#define COPY_DWORDS( j, vb, vertsize, v ) \ +do { \ + for ( j = 0 ; j < vertsize ; j++ ) { \ + vb[j] = ((GLuint *)v)[j]; \ + } \ + vb += vertsize; \ +} while (0) +#endif + +static void +intel_draw_quad(struct intel_context *intel, + intelVertexPtr v0, + intelVertexPtr v1, intelVertexPtr v2, intelVertexPtr v3) +{ + GLuint vertsize = intel->vertex_size; + GLuint *vb = intelExtendInlinePrimitive(intel, 6 * vertsize); + int j; + + COPY_DWORDS(j, vb, vertsize, v0); + COPY_DWORDS(j, vb, vertsize, v1); + + /* If smooth shading, draw like a trifan which gives better + * rasterization. Otherwise draw as two triangles with provoking + * vertex in third position as required for flat shading. + */ + if (intel->ctx.Light.ShadeModel == GL_FLAT) { + COPY_DWORDS(j, vb, vertsize, v3); + COPY_DWORDS(j, vb, vertsize, v1); + } + else { + COPY_DWORDS(j, vb, vertsize, v2); + COPY_DWORDS(j, vb, vertsize, v0); + } + + COPY_DWORDS(j, vb, vertsize, v2); + COPY_DWORDS(j, vb, vertsize, v3); +} + +static void +intel_draw_triangle(struct intel_context *intel, + intelVertexPtr v0, intelVertexPtr v1, intelVertexPtr v2) +{ + GLuint vertsize = intel->vertex_size; + GLuint *vb = intelExtendInlinePrimitive(intel, 3 * vertsize); + int j; + + COPY_DWORDS(j, vb, vertsize, v0); + COPY_DWORDS(j, vb, vertsize, v1); + COPY_DWORDS(j, vb, vertsize, v2); +} + + +static void +intel_draw_line(struct intel_context *intel, + intelVertexPtr v0, intelVertexPtr v1) +{ + GLuint vertsize = intel->vertex_size; + GLuint *vb = intelExtendInlinePrimitive(intel, 2 * vertsize); + int j; + + COPY_DWORDS(j, vb, vertsize, v0); + COPY_DWORDS(j, vb, vertsize, v1); +} + + +static void +intel_draw_point(struct intel_context *intel, intelVertexPtr v0) +{ + GLuint vertsize = intel->vertex_size; + GLuint *vb = intelExtendInlinePrimitive(intel, vertsize); + int j; + + /* Adjust for sub pixel position -- still required for conform. */ + *(float *) &vb[0] = v0->v.x - 0.125; + *(float *) &vb[1] = v0->v.y - 0.125; + for (j = 2; j < vertsize; j++) + vb[j] = v0->ui[j]; +} + + + +/*********************************************************************** + * Fixup for ARB_point_parameters * + ***********************************************************************/ + +/* Currently not working - VERT_ATTRIB_POINTSIZE isn't correctly + * represented in the fragment program InputsRead field. + */ +static void +intel_atten_point(struct intel_context *intel, intelVertexPtr v0) +{ + GLcontext *ctx = &intel->ctx; + GLfloat psz[4], col[4], restore_psz, restore_alpha; + + _tnl_get_attr(ctx, v0, _TNL_ATTRIB_POINTSIZE, psz); + _tnl_get_attr(ctx, v0, _TNL_ATTRIB_COLOR0, col); + + restore_psz = psz[0]; + restore_alpha = col[3]; + + if (psz[0] >= ctx->Point.Threshold) { + psz[0] = MIN2(psz[0], ctx->Point.MaxSize); + } + else { + GLfloat dsize = psz[0] / ctx->Point.Threshold; + psz[0] = MAX2(ctx->Point.Threshold, ctx->Point.MinSize); + col[3] *= dsize * dsize; + } + + if (psz[0] < 1.0) + psz[0] = 1.0; + + if (restore_psz != psz[0] || restore_alpha != col[3]) { + _tnl_set_attr(ctx, v0, _TNL_ATTRIB_POINTSIZE, psz); + _tnl_set_attr(ctx, v0, _TNL_ATTRIB_COLOR0, col); + + intel_draw_point(intel, v0); + + psz[0] = restore_psz; + col[3] = restore_alpha; + + _tnl_set_attr(ctx, v0, _TNL_ATTRIB_POINTSIZE, psz); + _tnl_set_attr(ctx, v0, _TNL_ATTRIB_COLOR0, col); + } + else + intel_draw_point(intel, v0); +} + + + + + +/*********************************************************************** + * Fixup for I915 WPOS texture coordinate * + ***********************************************************************/ + + + +static void +intel_wpos_triangle(struct intel_context *intel, + intelVertexPtr v0, intelVertexPtr v1, intelVertexPtr v2) +{ + GLuint offset = intel->wpos_offset; + GLuint size = intel->wpos_size; + + __memcpy(((char *) v0) + offset, v0, size); + __memcpy(((char *) v1) + offset, v1, size); + __memcpy(((char *) v2) + offset, v2, size); + + intel_draw_triangle(intel, v0, v1, v2); +} + + +static void +intel_wpos_line(struct intel_context *intel, + intelVertexPtr v0, intelVertexPtr v1) +{ + GLuint offset = intel->wpos_offset; + GLuint size = intel->wpos_size; + + __memcpy(((char *) v0) + offset, v0, size); + __memcpy(((char *) v1) + offset, v1, size); + + intel_draw_line(intel, v0, v1); +} + + +static void +intel_wpos_point(struct intel_context *intel, intelVertexPtr v0) +{ + GLuint offset = intel->wpos_offset; + GLuint size = intel->wpos_size; + + __memcpy(((char *) v0) + offset, v0, size); + + intel_draw_point(intel, v0); +} + + + + + + +/*********************************************************************** + * Macros for t_dd_tritmp.h to draw basic primitives * + ***********************************************************************/ + +#define TRI( a, b, c ) \ +do { \ + if (DO_FALLBACK) \ + intel->draw_tri( intel, a, b, c ); \ + else \ + intel_draw_triangle( intel, a, b, c ); \ +} while (0) + +#define QUAD( a, b, c, d ) \ +do { \ + if (DO_FALLBACK) { \ + intel->draw_tri( intel, a, b, d ); \ + intel->draw_tri( intel, b, c, d ); \ + } else \ + intel_draw_quad( intel, a, b, c, d ); \ +} while (0) + +#define LINE( v0, v1 ) \ +do { \ + if (DO_FALLBACK) \ + intel->draw_line( intel, v0, v1 ); \ + else \ + intel_draw_line( intel, v0, v1 ); \ +} while (0) + +#define POINT( v0 ) \ +do { \ + if (DO_FALLBACK) \ + intel->draw_point( intel, v0 ); \ + else \ + intel_draw_point( intel, v0 ); \ +} while (0) + + +/*********************************************************************** + * Build render functions from dd templates * + ***********************************************************************/ + +#define INTEL_OFFSET_BIT 0x01 +#define INTEL_TWOSIDE_BIT 0x02 +#define INTEL_UNFILLED_BIT 0x04 +#define INTEL_FALLBACK_BIT 0x08 +#define INTEL_MAX_TRIFUNC 0x10 + + +static struct +{ + tnl_points_func points; + tnl_line_func line; + tnl_triangle_func triangle; + tnl_quad_func quad; +} rast_tab[INTEL_MAX_TRIFUNC]; + + +#define DO_FALLBACK (IND & INTEL_FALLBACK_BIT) +#define DO_OFFSET (IND & INTEL_OFFSET_BIT) +#define DO_UNFILLED (IND & INTEL_UNFILLED_BIT) +#define DO_TWOSIDE (IND & INTEL_TWOSIDE_BIT) +#define DO_FLAT 0 +#define DO_TRI 1 +#define DO_QUAD 1 +#define DO_LINE 1 +#define DO_POINTS 1 +#define DO_FULL_QUAD 1 + +#define HAVE_RGBA 1 +#define HAVE_SPEC 1 +#define HAVE_BACK_COLORS 0 +#define HAVE_HW_FLATSHADE 1 +#define VERTEX intelVertex +#define TAB rast_tab + +/* Only used to pull back colors into vertices (ie, we know color is + * floating point). + */ +#define INTEL_COLOR( dst, src ) \ +do { \ + UNCLAMPED_FLOAT_TO_UBYTE((dst)[0], (src)[2]); \ + UNCLAMPED_FLOAT_TO_UBYTE((dst)[1], (src)[1]); \ + UNCLAMPED_FLOAT_TO_UBYTE((dst)[2], (src)[0]); \ + UNCLAMPED_FLOAT_TO_UBYTE((dst)[3], (src)[3]); \ +} while (0) + +#define INTEL_SPEC( dst, src ) \ +do { \ + UNCLAMPED_FLOAT_TO_UBYTE((dst)[0], (src)[2]); \ + UNCLAMPED_FLOAT_TO_UBYTE((dst)[1], (src)[1]); \ + UNCLAMPED_FLOAT_TO_UBYTE((dst)[2], (src)[0]); \ +} while (0) + + +#define DEPTH_SCALE intel->polygon_offset_scale +#define UNFILLED_TRI unfilled_tri +#define UNFILLED_QUAD unfilled_quad +#define VERT_X(_v) _v->v.x +#define VERT_Y(_v) _v->v.y +#define VERT_Z(_v) _v->v.z +#define AREA_IS_CCW( a ) (a > 0) +#define GET_VERTEX(e) (intel->verts + (e * intel->vertex_size * sizeof(GLuint))) + +#define VERT_SET_RGBA( v, c ) if (coloroffset) INTEL_COLOR( v->ub4[coloroffset], c ) +#define VERT_COPY_RGBA( v0, v1 ) if (coloroffset) v0->ui[coloroffset] = v1->ui[coloroffset] +#define VERT_SAVE_RGBA( idx ) if (coloroffset) color[idx] = v[idx]->ui[coloroffset] +#define VERT_RESTORE_RGBA( idx ) if (coloroffset) v[idx]->ui[coloroffset] = color[idx] + +#define VERT_SET_SPEC( v, c ) if (specoffset) INTEL_SPEC( v->ub4[specoffset], c ) +#define VERT_COPY_SPEC( v0, v1 ) if (specoffset) COPY_3V(v0->ub4[specoffset], v1->ub4[specoffset]) +#define VERT_SAVE_SPEC( idx ) if (specoffset) spec[idx] = v[idx]->ui[specoffset] +#define VERT_RESTORE_SPEC( idx ) if (specoffset) v[idx]->ui[specoffset] = spec[idx] + +#define LOCAL_VARS(n) \ + struct intel_context *intel = intel_context(ctx); \ + GLuint color[n], spec[n]; \ + GLuint coloroffset = intel->coloroffset; \ + GLboolean specoffset = intel->specoffset; \ + (void) color; (void) spec; (void) coloroffset; (void) specoffset; + + +/*********************************************************************** + * Helpers for rendering unfilled primitives * + ***********************************************************************/ + +static const GLuint hw_prim[GL_POLYGON + 1] = { + PRIM3D_POINTLIST, + PRIM3D_LINELIST, + PRIM3D_LINELIST, + PRIM3D_LINELIST, + PRIM3D_TRILIST, + PRIM3D_TRILIST, + PRIM3D_TRILIST, + PRIM3D_TRILIST, + PRIM3D_TRILIST, + PRIM3D_TRILIST +}; + +#define RASTERIZE(x) intelRasterPrimitive( ctx, x, hw_prim[x] ) +#define RENDER_PRIMITIVE intel->render_primitive +#define TAG(x) x +#define IND INTEL_FALLBACK_BIT +#include "tnl_dd/t_dd_unfilled.h" +#undef IND + +/*********************************************************************** + * Generate GL render functions * + ***********************************************************************/ + +#define IND (0) +#define TAG(x) x +#include "tnl_dd/t_dd_tritmp.h" + +#define IND (INTEL_OFFSET_BIT) +#define TAG(x) x##_offset +#include "tnl_dd/t_dd_tritmp.h" + +#define IND (INTEL_TWOSIDE_BIT) +#define TAG(x) x##_twoside +#include "tnl_dd/t_dd_tritmp.h" + +#define IND (INTEL_TWOSIDE_BIT|INTEL_OFFSET_BIT) +#define TAG(x) x##_twoside_offset +#include "tnl_dd/t_dd_tritmp.h" + +#define IND (INTEL_UNFILLED_BIT) +#define TAG(x) x##_unfilled +#include "tnl_dd/t_dd_tritmp.h" + +#define IND (INTEL_OFFSET_BIT|INTEL_UNFILLED_BIT) +#define TAG(x) x##_offset_unfilled +#include "tnl_dd/t_dd_tritmp.h" + +#define IND (INTEL_TWOSIDE_BIT|INTEL_UNFILLED_BIT) +#define TAG(x) x##_twoside_unfilled +#include "tnl_dd/t_dd_tritmp.h" + +#define IND (INTEL_TWOSIDE_BIT|INTEL_OFFSET_BIT|INTEL_UNFILLED_BIT) +#define TAG(x) x##_twoside_offset_unfilled +#include "tnl_dd/t_dd_tritmp.h" + +#define IND (INTEL_FALLBACK_BIT) +#define TAG(x) x##_fallback +#include "tnl_dd/t_dd_tritmp.h" + +#define IND (INTEL_OFFSET_BIT|INTEL_FALLBACK_BIT) +#define TAG(x) x##_offset_fallback +#include "tnl_dd/t_dd_tritmp.h" + +#define IND (INTEL_TWOSIDE_BIT|INTEL_FALLBACK_BIT) +#define TAG(x) x##_twoside_fallback +#include "tnl_dd/t_dd_tritmp.h" + +#define IND (INTEL_TWOSIDE_BIT|INTEL_OFFSET_BIT|INTEL_FALLBACK_BIT) +#define TAG(x) x##_twoside_offset_fallback +#include "tnl_dd/t_dd_tritmp.h" + +#define IND (INTEL_UNFILLED_BIT|INTEL_FALLBACK_BIT) +#define TAG(x) x##_unfilled_fallback +#include "tnl_dd/t_dd_tritmp.h" + +#define IND (INTEL_OFFSET_BIT|INTEL_UNFILLED_BIT|INTEL_FALLBACK_BIT) +#define TAG(x) x##_offset_unfilled_fallback +#include "tnl_dd/t_dd_tritmp.h" + +#define IND (INTEL_TWOSIDE_BIT|INTEL_UNFILLED_BIT|INTEL_FALLBACK_BIT) +#define TAG(x) x##_twoside_unfilled_fallback +#include "tnl_dd/t_dd_tritmp.h" + +#define IND (INTEL_TWOSIDE_BIT|INTEL_OFFSET_BIT|INTEL_UNFILLED_BIT| \ + INTEL_FALLBACK_BIT) +#define TAG(x) x##_twoside_offset_unfilled_fallback +#include "tnl_dd/t_dd_tritmp.h" + + +static void +init_rast_tab(void) +{ + init(); + init_offset(); + init_twoside(); + init_twoside_offset(); + init_unfilled(); + init_offset_unfilled(); + init_twoside_unfilled(); + init_twoside_offset_unfilled(); + init_fallback(); + init_offset_fallback(); + init_twoside_fallback(); + init_twoside_offset_fallback(); + init_unfilled_fallback(); + init_offset_unfilled_fallback(); + init_twoside_unfilled_fallback(); + init_twoside_offset_unfilled_fallback(); +} + + +/*********************************************************************** + * Rasterization fallback helpers * + ***********************************************************************/ + + +/* This code is hit only when a mix of accelerated and unaccelerated + * primitives are being drawn, and only for the unaccelerated + * primitives. + */ +static void +intel_fallback_tri(struct intel_context *intel, + intelVertex * v0, intelVertex * v1, intelVertex * v2) +{ + GLcontext *ctx = &intel->ctx; + SWvertex v[3]; + + if (0) + fprintf(stderr, "\n%s\n", __FUNCTION__); + + INTEL_FIREVERTICES(intel); + + _swsetup_Translate(ctx, v0, &v[0]); + _swsetup_Translate(ctx, v1, &v[1]); + _swsetup_Translate(ctx, v2, &v[2]); + intelSpanRenderStart(ctx); + _swrast_Triangle(ctx, &v[0], &v[1], &v[2]); + intelSpanRenderFinish(ctx); +} + + +static void +intel_fallback_line(struct intel_context *intel, + intelVertex * v0, intelVertex * v1) +{ + GLcontext *ctx = &intel->ctx; + SWvertex v[2]; + + if (0) + fprintf(stderr, "\n%s\n", __FUNCTION__); + + INTEL_FIREVERTICES(intel); + + _swsetup_Translate(ctx, v0, &v[0]); + _swsetup_Translate(ctx, v1, &v[1]); + intelSpanRenderStart(ctx); + _swrast_Line(ctx, &v[0], &v[1]); + intelSpanRenderFinish(ctx); +} + +static void +intel_fallback_point(struct intel_context *intel, + intelVertex * v0) +{ + GLcontext *ctx = &intel->ctx; + SWvertex v[1]; + + if (0) + fprintf(stderr, "\n%s\n", __FUNCTION__); + + INTEL_FIREVERTICES(intel); + + _swsetup_Translate(ctx, v0, &v[0]); + intelSpanRenderStart(ctx); + _swrast_Point(ctx, &v[0]); + intelSpanRenderFinish(ctx); +} + + +/**********************************************************************/ +/* Render unclipped begin/end objects */ +/**********************************************************************/ + +#define IND 0 +#define V(x) (intelVertex *)(vertptr + ((x)*vertsize*sizeof(GLuint))) +#define RENDER_POINTS( start, count ) \ + for ( ; start < count ; start++) POINT( V(ELT(start)) ); +#define RENDER_LINE( v0, v1 ) LINE( V(v0), V(v1) ) +#define RENDER_TRI( v0, v1, v2 ) TRI( V(v0), V(v1), V(v2) ) +#define RENDER_QUAD( v0, v1, v2, v3 ) QUAD( V(v0), V(v1), V(v2), V(v3) ) +#define INIT(x) intelRenderPrimitive( ctx, x ) +#undef LOCAL_VARS +#define LOCAL_VARS \ + struct intel_context *intel = intel_context(ctx); \ + GLubyte *vertptr = (GLubyte *)intel->verts; \ + const GLuint vertsize = intel->vertex_size; \ + const GLuint * const elt = TNL_CONTEXT(ctx)->vb.Elts; \ + (void) elt; +#define RESET_STIPPLE +#define RESET_OCCLUSION +#define PRESERVE_VB_DEFS +#define ELT(x) x +#define TAG(x) intel_##x##_verts +#include "tnl/t_vb_rendertmp.h" +#undef ELT +#undef TAG +#define TAG(x) intel_##x##_elts +#define ELT(x) elt[x] +#include "tnl/t_vb_rendertmp.h" + +/**********************************************************************/ +/* Render clipped primitives */ +/**********************************************************************/ + + + +static void +intelRenderClippedPoly(GLcontext * ctx, const GLuint * elts, GLuint n) +{ + struct intel_context *intel = intel_context(ctx); + TNLcontext *tnl = TNL_CONTEXT(ctx); + struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; + GLuint prim = intel->render_primitive; + + /* Render the new vertices as an unclipped polygon. + */ + { + GLuint *tmp = VB->Elts; + VB->Elts = (GLuint *) elts; + tnl->Driver.Render.PrimTabElts[GL_POLYGON] (ctx, 0, n, + PRIM_BEGIN | PRIM_END); + VB->Elts = tmp; + } + + /* Restore the render primitive + */ + if (prim != GL_POLYGON) + tnl->Driver.Render.PrimitiveNotify(ctx, prim); +} + +static void +intelRenderClippedLine(GLcontext * ctx, GLuint ii, GLuint jj) +{ + TNLcontext *tnl = TNL_CONTEXT(ctx); + + tnl->Driver.Render.Line(ctx, ii, jj); +} + +static void +intelFastRenderClippedPoly(GLcontext * ctx, const GLuint * elts, GLuint n) +{ + struct intel_context *intel = intel_context(ctx); + const GLuint vertsize = intel->vertex_size; + GLuint *vb = intelExtendInlinePrimitive(intel, (n - 2) * 3 * vertsize); + GLubyte *vertptr = (GLubyte *) intel->verts; + const GLuint *start = (const GLuint *) V(elts[0]); + int i, j; + + for (i = 2; i < n; i++) { + COPY_DWORDS(j, vb, vertsize, V(elts[i - 1])); + COPY_DWORDS(j, vb, vertsize, V(elts[i])); + COPY_DWORDS(j, vb, vertsize, start); + } +} + +/**********************************************************************/ +/* Choose render functions */ +/**********************************************************************/ + + + + +#define ANY_FALLBACK_FLAGS (DD_LINE_STIPPLE | DD_TRI_STIPPLE | DD_POINT_ATTEN | DD_POINT_SMOOTH | DD_TRI_SMOOTH) +#define ANY_RASTER_FLAGS (DD_TRI_LIGHT_TWOSIDE | DD_TRI_OFFSET | DD_TRI_UNFILLED) + +void +intelChooseRenderState(GLcontext * ctx) +{ + TNLcontext *tnl = TNL_CONTEXT(ctx); + struct intel_context *intel = intel_context(ctx); + GLuint flags = ctx->_TriangleCaps; + const struct gl_fragment_program *fprog = ctx->FragmentProgram._Current; + GLboolean have_wpos = (fprog && (fprog->Base.InputsRead & FRAG_BIT_WPOS)); + GLuint index = 0; + + if (INTEL_DEBUG & DEBUG_STATE) + fprintf(stderr, "\n%s\n", __FUNCTION__); + + if ((flags & (ANY_FALLBACK_FLAGS | ANY_RASTER_FLAGS)) || have_wpos) { + + if (flags & ANY_RASTER_FLAGS) { + if (flags & DD_TRI_LIGHT_TWOSIDE) + index |= INTEL_TWOSIDE_BIT; + if (flags & DD_TRI_OFFSET) + index |= INTEL_OFFSET_BIT; + if (flags & DD_TRI_UNFILLED) + index |= INTEL_UNFILLED_BIT; + } + + if (have_wpos) { + intel->draw_point = intel_wpos_point; + intel->draw_line = intel_wpos_line; + intel->draw_tri = intel_wpos_triangle; + + /* Make sure these get called: + */ + index |= INTEL_FALLBACK_BIT; + } + else { + intel->draw_point = intel_draw_point; + intel->draw_line = intel_draw_line; + intel->draw_tri = intel_draw_triangle; + } + + /* Hook in fallbacks for specific primitives. + */ + if (flags & ANY_FALLBACK_FLAGS) { + if (flags & DD_LINE_STIPPLE) + intel->draw_line = intel_fallback_line; + + if ((flags & DD_TRI_STIPPLE) && !intel->hw_stipple) + intel->draw_tri = intel_fallback_tri; + + if (flags & DD_TRI_SMOOTH) { + if (intel->strict_conformance) + intel->draw_tri = intel_fallback_tri; + } + + if (flags & DD_POINT_ATTEN) { + if (0) + intel->draw_point = intel_atten_point; + else + intel->draw_point = intel_fallback_point; + } + + if (flags & DD_POINT_SMOOTH) { + if (intel->strict_conformance) + intel->draw_point = intel_fallback_point; + } + + index |= INTEL_FALLBACK_BIT; + } + } + + if (intel->RenderIndex != index) { + intel->RenderIndex = index; + + tnl->Driver.Render.Points = rast_tab[index].points; + tnl->Driver.Render.Line = rast_tab[index].line; + tnl->Driver.Render.Triangle = rast_tab[index].triangle; + tnl->Driver.Render.Quad = rast_tab[index].quad; + + if (index == 0) { + tnl->Driver.Render.PrimTabVerts = intel_render_tab_verts; + tnl->Driver.Render.PrimTabElts = intel_render_tab_elts; + tnl->Driver.Render.ClippedLine = line; /* from tritmp.h */ + tnl->Driver.Render.ClippedPolygon = intelFastRenderClippedPoly; + } + else { + tnl->Driver.Render.PrimTabVerts = _tnl_render_tab_verts; + tnl->Driver.Render.PrimTabElts = _tnl_render_tab_elts; + tnl->Driver.Render.ClippedLine = intelRenderClippedLine; + tnl->Driver.Render.ClippedPolygon = intelRenderClippedPoly; + } + } +} + +static const GLenum reduced_prim[GL_POLYGON + 1] = { + GL_POINTS, + GL_LINES, + GL_LINES, + GL_LINES, + GL_TRIANGLES, + GL_TRIANGLES, + GL_TRIANGLES, + GL_TRIANGLES, + GL_TRIANGLES, + GL_TRIANGLES +}; + + +/**********************************************************************/ +/* High level hooks for t_vb_render.c */ +/**********************************************************************/ + + + + +static void +intelRunPipeline(GLcontext * ctx) +{ + struct intel_context *intel = intel_context(ctx); + + _mesa_lock_context_textures(ctx); + + if (ctx->NewState) + _mesa_update_state_locked(ctx); + + if (intel->NewGLState) { + if (intel->NewGLState & _NEW_TEXTURE) { + intel->vtbl.update_texture_state(intel); + } + + if (!intel->Fallback) { + if (intel->NewGLState & _INTEL_NEW_RENDERSTATE) + intelChooseRenderState(ctx); + } + + intel->NewGLState = 0; + } + + _tnl_run_pipeline(ctx); + + _mesa_unlock_context_textures(ctx); +} + +static void +intelRenderStart(GLcontext * ctx) +{ + struct intel_context *intel = intel_context(ctx); + + intel->vtbl.render_start(intel_context(ctx)); + intel->vtbl.emit_state(intel); +} + +static void +intelRenderFinish(GLcontext * ctx) +{ + struct intel_context *intel = intel_context(ctx); + + if (intel->RenderIndex & INTEL_FALLBACK_BIT) + _swrast_flush(ctx); + + INTEL_FIREVERTICES(intel); +} + + + + + /* System to flush dma and emit state changes based on the rasterized + * primitive. + */ +static void +intelRasterPrimitive(GLcontext * ctx, GLenum rprim, GLuint hwprim) +{ + struct intel_context *intel = intel_context(ctx); + + if (0) + fprintf(stderr, "%s %s %x\n", __FUNCTION__, + _mesa_lookup_enum_by_nr(rprim), hwprim); + + intel->vtbl.reduced_primitive_state(intel, rprim); + + /* Start a new primitive. Arrange to have it flushed later on. + */ + if (hwprim != intel->prim.primitive) { + INTEL_FIREVERTICES(intel); + + intelStartInlinePrimitive(intel, hwprim, INTEL_BATCH_CLIPRECTS); + } +} + + + /* + */ +static void +intelRenderPrimitive(GLcontext * ctx, GLenum prim) +{ + struct intel_context *intel = intel_context(ctx); + + if (0) + fprintf(stderr, "%s %s\n", __FUNCTION__, _mesa_lookup_enum_by_nr(prim)); + + /* Let some clipping routines know which primitive they're dealing + * with. + */ + intel->render_primitive = prim; + + /* Shortcircuit this when called from t_dd_rendertmp.h for unfilled + * triangles. The rasterized primitive will always be reset by + * lower level functions in that case, potentially pingponging the + * state: + */ + if (reduced_prim[prim] == GL_TRIANGLES && + (ctx->_TriangleCaps & DD_TRI_UNFILLED)) + return; + + /* Set some primitive-dependent state and Start? a new primitive. + */ + intelRasterPrimitive(ctx, reduced_prim[prim], hw_prim[prim]); +} + + + /**********************************************************************/ + /* Transition to/from hardware rasterization. */ + /**********************************************************************/ + +static char *fallbackStrings[] = { + [0] = "Draw buffer", + [1] = "Read buffer", + [2] = "Depth buffer", + [3] = "Stencil buffer", + [4] = "User disable", + [5] = "Render mode", + + [12] = "Texture", + [13] = "Color mask", + [14] = "Stencil", + [15] = "Stipple", + [16] = "Program", + [17] = "Logic op", + [18] = "Smooth polygon", + [19] = "Smooth point", +}; + + +static char * +getFallbackString(GLuint bit) +{ + int i = 0; + while (bit > 1) { + i++; + bit >>= 1; + } + return fallbackStrings[i]; +} + + + +void +intelFallback(struct intel_context *intel, GLuint bit, GLboolean mode) +{ + GLcontext *ctx = &intel->ctx; + TNLcontext *tnl = TNL_CONTEXT(ctx); + GLuint oldfallback = intel->Fallback; + + if (mode) { + intel->Fallback |= bit; + if (oldfallback == 0) { + intelFlush(ctx); + if (INTEL_DEBUG & DEBUG_FALLBACKS) + fprintf(stderr, "ENTER FALLBACK %x: %s\n", + bit, getFallbackString(bit)); + _swsetup_Wakeup(ctx); + intel->RenderIndex = ~0; + } + } + else { + intel->Fallback &= ~bit; + if (oldfallback == bit) { + _swrast_flush(ctx); + if (INTEL_DEBUG & DEBUG_FALLBACKS) + fprintf(stderr, "LEAVE FALLBACK %s\n", getFallbackString(bit)); + tnl->Driver.Render.Start = intelRenderStart; + tnl->Driver.Render.PrimitiveNotify = intelRenderPrimitive; + tnl->Driver.Render.Finish = intelRenderFinish; + tnl->Driver.Render.BuildVertices = _tnl_build_vertices; + tnl->Driver.Render.CopyPV = _tnl_copy_pv; + tnl->Driver.Render.Interp = _tnl_interp; + + _tnl_invalidate_vertex_state(ctx, ~0); + _tnl_invalidate_vertices(ctx, ~0); + _tnl_install_attrs(ctx, + intel->vertex_attrs, + intel->vertex_attr_count, + intel->ViewportMatrix.m, 0); + + intel->NewGLState |= _INTEL_NEW_RENDERSTATE; + } + } +} + +union fi +{ + GLfloat f; + GLint i; +}; + + +/**********************************************************************/ +/* Used only with the metaops callbacks. */ +/**********************************************************************/ +void +intel_meta_draw_poly(struct intel_context *intel, + GLuint n, + GLfloat xy[][2], + GLfloat z, GLuint color, GLfloat tex[][2]) +{ + union fi *vb; + GLint i; + + /* All 3d primitives should be emitted with INTEL_BATCH_CLIPRECTS, + * otherwise the drawing origin (DR4) might not be set correctly. + */ + intelStartInlinePrimitive(intel, PRIM3D_TRIFAN, INTEL_BATCH_CLIPRECTS); + vb = (union fi *) intelExtendInlinePrimitive(intel, n * 6); + + for (i = 0; i < n; i++) { + vb[0].f = xy[i][0]; + vb[1].f = xy[i][1]; + vb[2].f = z; + vb[3].i = color; + vb[4].f = tex[i][0]; + vb[5].f = tex[i][1]; + vb += 6; + } + + INTEL_FIREVERTICES(intel); +} + +void +intel_meta_draw_quad(struct intel_context *intel, + GLfloat x0, GLfloat x1, + GLfloat y0, GLfloat y1, + GLfloat z, + GLuint color, + GLfloat s0, GLfloat s1, GLfloat t0, GLfloat t1) +{ + GLfloat xy[4][2]; + GLfloat tex[4][2]; + + xy[0][0] = x0; + xy[0][1] = y0; + xy[1][0] = x1; + xy[1][1] = y0; + xy[2][0] = x1; + xy[2][1] = y1; + xy[3][0] = x0; + xy[3][1] = y1; + + tex[0][0] = s0; + tex[0][1] = t0; + tex[1][0] = s1; + tex[1][1] = t0; + tex[2][0] = s1; + tex[2][1] = t1; + tex[3][0] = s0; + tex[3][1] = t1; + + intel_meta_draw_poly(intel, 4, xy, z, color, tex); +} + + + +/**********************************************************************/ +/* Initialization. */ +/**********************************************************************/ + + +void +intelInitTriFuncs(GLcontext * ctx) +{ + TNLcontext *tnl = TNL_CONTEXT(ctx); + static int firsttime = 1; + + if (firsttime) { + init_rast_tab(); + firsttime = 0; + } + + tnl->Driver.RunPipeline = intelRunPipeline; + tnl->Driver.Render.Start = intelRenderStart; + tnl->Driver.Render.Finish = intelRenderFinish; + tnl->Driver.Render.PrimitiveNotify = intelRenderPrimitive; + tnl->Driver.Render.ResetLineStipple = _swrast_ResetLineStipple; + tnl->Driver.Render.BuildVertices = _tnl_build_vertices; + tnl->Driver.Render.CopyPV = _tnl_copy_pv; + tnl->Driver.Render.Interp = _tnl_interp; +} diff --git a/src/mesa/drivers/dri/i915tex/intel_tris.h b/src/mesa/drivers/dri/i915tex/intel_tris.h new file mode 100644 index 00000000000..b7bae8cd3bc --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/intel_tris.h @@ -0,0 +1,69 @@ +/************************************************************************** + * + * Copyright 2003 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. + * + **************************************************************************/ + +#ifndef INTELTRIS_INC +#define INTELTRIS_INC + +#include "mtypes.h" + + + +#define _INTEL_NEW_RENDERSTATE (_DD_NEW_LINE_STIPPLE | \ + _DD_NEW_TRI_UNFILLED | \ + _DD_NEW_TRI_LIGHT_TWOSIDE | \ + _DD_NEW_TRI_OFFSET | \ + _DD_NEW_TRI_STIPPLE | \ + _NEW_PROGRAM | \ + _NEW_POLYGONSTIPPLE) + +extern void intelInitTriFuncs(GLcontext * ctx); + +extern void intelChooseRenderState(GLcontext * ctx); + +extern void intelStartInlinePrimitive(struct intel_context *intel, + GLuint prim, GLuint flags); +extern void intelWrapInlinePrimitive(struct intel_context *intel); + +GLuint *intelExtendInlinePrimitive(struct intel_context *intel, + GLuint dwords); + + +void intel_meta_draw_quad(struct intel_context *intel, + GLfloat x0, GLfloat x1, + GLfloat y0, GLfloat y1, + GLfloat z, + GLuint color, + GLfloat s0, GLfloat s1, GLfloat t0, GLfloat t1); + +void intel_meta_draw_poly(struct intel_context *intel, + GLuint n, + GLfloat xy[][2], + GLfloat z, GLuint color, GLfloat tex[][2]); + + + +#endif diff --git a/src/mesa/drivers/dri/i915tex/server/i830_common.h b/src/mesa/drivers/dri/i915tex/server/i830_common.h new file mode 100644 index 00000000000..fb6ceaa52d4 --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/server/i830_common.h @@ -0,0 +1,212 @@ +/************************************************************************** + +Copyright 2001 VA Linux Systems Inc., Fremont, California. +Copyright 2002 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 +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 +ATI, VA LINUX SYSTEMS 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. + +**************************************************************************/ + +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i830_common.h,v 1.1 2002/09/11 00:29:32 dawes Exp $ */ + +#ifndef _I830_COMMON_H_ +#define _I830_COMMON_H_ + + +#define I830_NR_TEX_REGIONS 255 /* maximum due to use of chars for next/prev */ +#define I830_LOG_MIN_TEX_REGION_SIZE 14 + + +/* Driver specific DRM command indices + * NOTE: these are not OS specific, but they are driver specific + */ +#define DRM_I830_INIT 0x00 +#define DRM_I830_FLUSH 0x01 +#define DRM_I830_FLIP 0x02 +#define DRM_I830_BATCHBUFFER 0x03 +#define DRM_I830_IRQ_EMIT 0x04 +#define DRM_I830_IRQ_WAIT 0x05 +#define DRM_I830_GETPARAM 0x06 +#define DRM_I830_SETPARAM 0x07 +#define DRM_I830_ALLOC 0x08 +#define DRM_I830_FREE 0x09 +#define DRM_I830_INIT_HEAP 0x0a +#define DRM_I830_CMDBUFFER 0x0b +#define DRM_I830_DESTROY_HEAP 0x0c + +typedef struct { + enum { + I830_INIT_DMA = 0x01, + I830_CLEANUP_DMA = 0x02, + I830_RESUME_DMA = 0x03 + } func; + unsigned int mmio_offset; + int sarea_priv_offset; + unsigned int ring_start; + unsigned int ring_end; + unsigned int ring_size; + unsigned int front_offset; + unsigned int back_offset; + unsigned int depth_offset; + unsigned int w; + unsigned int h; + unsigned int pitch; + unsigned int pitch_bits; + unsigned int back_pitch; + unsigned int depth_pitch; + unsigned int cpp; + unsigned int chipset; +} drmI830Init; + +typedef struct { + drmTextureRegion texList[I830_NR_TEX_REGIONS+1]; + int last_upload; /* last time texture was uploaded */ + int last_enqueue; /* last time a buffer was enqueued */ + int last_dispatch; /* age of the most recently dispatched buffer */ + int ctxOwner; /* last context to upload state */ + int texAge; + int pf_enabled; /* is pageflipping allowed? */ + int pf_active; + int pf_current_page; /* which buffer is being displayed? */ + int perf_boxes; /* performance boxes to be displayed */ + int width, height; /* screen size in pixels */ + + drm_handle_t front_handle; + int front_offset; + int front_size; + + drm_handle_t back_handle; + int back_offset; + int back_size; + + drm_handle_t depth_handle; + int depth_offset; + int depth_size; + + drm_handle_t tex_handle; + int tex_offset; + int tex_size; + int log_tex_granularity; + int pitch; + int rotation; /* 0, 90, 180 or 270 */ + int rotated_offset; + int rotated_size; + int rotated_pitch; + int virtualX, virtualY; + + unsigned int front_tiled; + unsigned int back_tiled; + unsigned int depth_tiled; + unsigned int rotated_tiled; + unsigned int rotated2_tiled; + + int pipeA_x; + int pipeA_y; + int pipeA_w; + int pipeA_h; + int pipeB_x; + int pipeB_y; + int pipeB_w; + int pipeB_h; +} drmI830Sarea; + +/* Flags for perf_boxes + */ +#define I830_BOX_RING_EMPTY 0x1 /* populated by kernel */ +#define I830_BOX_FLIP 0x2 /* populated by kernel */ +#define I830_BOX_WAIT 0x4 /* populated by kernel & client */ +#define I830_BOX_TEXTURE_LOAD 0x8 /* populated by kernel */ +#define I830_BOX_LOST_CONTEXT 0x10 /* populated by client */ + + +typedef struct { + int start; /* agp offset */ + int used; /* nr bytes in use */ + int DR1; /* hw flags for GFX_OP_DRAWRECT_INFO */ + int DR4; /* window origin for GFX_OP_DRAWRECT_INFO*/ + int num_cliprects; /* mulitpass with multiple cliprects? */ + drm_clip_rect_t *cliprects; /* pointer to userspace cliprects */ +} drmI830BatchBuffer; + +typedef struct { + char *buf; /* agp offset */ + int sz; /* nr bytes in use */ + int DR1; /* hw flags for GFX_OP_DRAWRECT_INFO */ + int DR4; /* window origin for GFX_OP_DRAWRECT_INFO*/ + int num_cliprects; /* mulitpass with multiple cliprects? */ + drm_clip_rect_t *cliprects; /* pointer to userspace cliprects */ +} drmI830CmdBuffer; + +typedef struct { + int *irq_seq; +} drmI830IrqEmit; + +typedef struct { + int irq_seq; +} drmI830IrqWait; + +typedef struct { + int param; + int *value; +} drmI830GetParam; + +#define I830_PARAM_IRQ_ACTIVE 1 +#define I830_PARAM_ALLOW_BATCHBUFFER 2 + +typedef struct { + int param; + int value; +} drmI830SetParam; + +#define I830_SETPARAM_USE_MI_BATCHBUFFER_START 1 +#define I830_SETPARAM_TEX_LRU_LOG_GRANULARITY 2 +#define I830_SETPARAM_ALLOW_BATCHBUFFER 3 + + +/* A memory manager for regions of shared memory: + */ +#define I830_MEM_REGION_AGP 1 + +typedef struct { + int region; + int alignment; + int size; + int *region_offset; /* offset from start of fb or agp */ +} drmI830MemAlloc; + +typedef struct { + int region; + int region_offset; +} drmI830MemFree; + +typedef struct { + int region; + int size; + int start; +} drmI830MemInitHeap; + +typedef struct { + int region; +} drmI830MemDestroyHeap; + + +#endif /* _I830_DRM_H_ */ diff --git a/src/mesa/drivers/dri/i915tex/server/i830_dri.h b/src/mesa/drivers/dri/i915tex/server/i830_dri.h new file mode 100644 index 00000000000..6c9a7090215 --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/server/i830_dri.h @@ -0,0 +1,73 @@ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i830_dri.h,v 1.4 2002/10/30 12:52:18 alanh Exp $ */ + +#ifndef _I830_DRI_H +#define _I830_DRI_H + +#include "xf86drm.h" +#include "i830_common.h" + +#define I830_MAX_DRAWABLES 256 + +#define I830_MAJOR_VERSION 1 +#define I830_MINOR_VERSION 3 +#define I830_PATCHLEVEL 0 + +#define I830_REG_SIZE 0x80000 + +typedef struct _I830DRIRec { + drm_handle_t regs; + drmSize regsSize; + + drmSize backbufferSize; + drm_handle_t backbuffer; + + drmSize depthbufferSize; + drm_handle_t depthbuffer; + + drmSize rotatedSize; + drm_handle_t rotatedbuffer; + + drm_handle_t textures; + int textureSize; + + drm_handle_t agp_buffers; + drmSize agp_buf_size; + + int deviceID; + int width; + int height; + int mem; + int cpp; + int bitsPerPixel; + + int fbOffset; + int fbStride; + + int backOffset; + int backPitch; + + int depthOffset; + int depthPitch; + + int rotatedOffset; + int rotatedPitch; + + int logTextureGranularity; + int textureOffset; + + int irq; + int sarea_priv_offset; +} I830DRIRec, *I830DRIPtr; + +typedef struct { + /* Nothing here yet */ + int dummy; +} I830ConfigPrivRec, *I830ConfigPrivPtr; + +typedef struct { + /* Nothing here yet */ + int dummy; +} I830DRIContextRec, *I830DRIContextPtr; + + +#endif diff --git a/src/mesa/drivers/dri/i915tex/server/intel.h b/src/mesa/drivers/dri/i915tex/server/intel.h new file mode 100644 index 00000000000..d7858a20c8d --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/server/intel.h @@ -0,0 +1,328 @@ +#ifndef _INTEL_H_ +#define _INTEL_H_ + +#include "xf86drm.h" /* drm_handle_t, etc */ + +/* Intel */ +#ifndef PCI_CHIP_I810 +#define PCI_CHIP_I810 0x7121 +#define PCI_CHIP_I810_DC100 0x7123 +#define PCI_CHIP_I810_E 0x7125 +#define PCI_CHIP_I815 0x1132 +#define PCI_CHIP_I810_BRIDGE 0x7120 +#define PCI_CHIP_I810_DC100_BRIDGE 0x7122 +#define PCI_CHIP_I810_E_BRIDGE 0x7124 +#define PCI_CHIP_I815_BRIDGE 0x1130 +#endif + +#define PCI_CHIP_845_G 0x2562 +#define PCI_CHIP_I830_M 0x3577 + +#ifndef PCI_CHIP_I855_GM +#define PCI_CHIP_I855_GM 0x3582 +#define PCI_CHIP_I855_GM_BRIDGE 0x3580 +#endif + +#ifndef PCI_CHIP_I865_G +#define PCI_CHIP_I865_G 0x2572 +#define PCI_CHIP_I865_G_BRIDGE 0x2570 +#endif + +#ifndef PCI_CHIP_I915_G +#define PCI_CHIP_I915_G 0x2582 +#define PCI_CHIP_I915_G_BRIDGE 0x2580 +#endif + +#ifndef PCI_CHIP_I915_GM +#define PCI_CHIP_I915_GM 0x2592 +#define PCI_CHIP_I915_GM_BRIDGE 0x2590 +#endif + +#ifndef PCI_CHIP_E7221_G +#define PCI_CHIP_E7221_G 0x258A +/* Same as I915_G_BRIDGE */ +#define PCI_CHIP_E7221_G_BRIDGE 0x2580 +#endif + +#ifndef PCI_CHIP_I945_G +#define PCI_CHIP_I945_G 0x2772 +#define PCI_CHIP_I945_G_BRIDGE 0x2770 +#endif + +#ifndef PCI_CHIP_I945_GM +#define PCI_CHIP_I945_GM 0x27A2 +#define PCI_CHIP_I945_GM_BRIDGE 0x27A0 +#endif + +#define IS_I810(pI810) (pI810->Chipset == PCI_CHIP_I810 || \ + pI810->Chipset == PCI_CHIP_I810_DC100 || \ + pI810->Chipset == PCI_CHIP_I810_E) +#define IS_I815(pI810) (pI810->Chipset == PCI_CHIP_I815) +#define IS_I830(pI810) (pI810->Chipset == PCI_CHIP_I830_M) +#define IS_845G(pI810) (pI810->Chipset == PCI_CHIP_845_G) +#define IS_I85X(pI810) (pI810->Chipset == PCI_CHIP_I855_GM) +#define IS_I852(pI810) (pI810->Chipset == PCI_CHIP_I855_GM && (pI810->variant == I852_GM || pI810->variant == I852_GME)) +#define IS_I855(pI810) (pI810->Chipset == PCI_CHIP_I855_GM && (pI810->variant == I855_GM || pI810->variant == I855_GME)) +#define IS_I865G(pI810) (pI810->Chipset == PCI_CHIP_I865_G) + +#define IS_I915G(pI810) (pI810->Chipset == PCI_CHIP_I915_G || pI810->Chipset == PCI_CHIP_E7221_G) +#define IS_I915GM(pI810) (pI810->Chipset == PCI_CHIP_I915_GM) +#define IS_I945G(pI810) (pI810->Chipset == PCI_CHIP_I945_G) +#define IS_I945GM(pI810) (pI810->Chipset == PCI_CHIP_I945_GM) +#define IS_I9XX(pI810) (IS_I915G(pI810) || IS_I915GM(pI810) || IS_I945G(pI810) || IS_I945GM(pI810)) + +#define IS_MOBILE(pI810) (IS_I830(pI810) || IS_I85X(pI810) || IS_I915GM(pI810) || IS_I945GM(pI810)) + +#define I830_GMCH_CTRL 0x52 + + +#define I830_GMCH_GMS_MASK 0x70 +#define I830_GMCH_GMS_DISABLED 0x00 +#define I830_GMCH_GMS_LOCAL 0x10 +#define I830_GMCH_GMS_STOLEN_512 0x20 +#define I830_GMCH_GMS_STOLEN_1024 0x30 +#define I830_GMCH_GMS_STOLEN_8192 0x40 + +#define I855_GMCH_GMS_MASK (0x7 << 4) +#define I855_GMCH_GMS_DISABLED 0x00 +#define I855_GMCH_GMS_STOLEN_1M (0x1 << 4) +#define I855_GMCH_GMS_STOLEN_4M (0x2 << 4) +#define I855_GMCH_GMS_STOLEN_8M (0x3 << 4) +#define I855_GMCH_GMS_STOLEN_16M (0x4 << 4) +#define I855_GMCH_GMS_STOLEN_32M (0x5 << 4) +#define I915G_GMCH_GMS_STOLEN_48M (0x6 << 4) +#define I915G_GMCH_GMS_STOLEN_64M (0x7 << 4) + +typedef unsigned char Bool; +#define TRUE 1 +#define FALSE 0 + +#define PIPE_NONE 0<<0 +#define PIPE_CRT 1<<0 +#define PIPE_TV 1<<1 +#define PIPE_DFP 1<<2 +#define PIPE_LFP 1<<3 +#define PIPE_CRT2 1<<4 +#define PIPE_TV2 1<<5 +#define PIPE_DFP2 1<<6 +#define PIPE_LFP2 1<<7 + +typedef struct _I830MemPool *I830MemPoolPtr; +typedef struct _I830MemRange *I830MemRangePtr; +typedef struct _I830MemRange { + long Start; + long End; + long Size; + unsigned long Physical; + unsigned long Offset; /* Offset of AGP-allocated portion */ + unsigned long Alignment; + drm_handle_t Key; + unsigned long Pitch; // add pitch + I830MemPoolPtr Pool; +} I830MemRange; + +typedef struct _I830MemPool { + I830MemRange Total; + I830MemRange Free; + I830MemRange Fixed; + I830MemRange Allocated; +} I830MemPool; + +typedef struct { + int tail_mask; + I830MemRange mem; + unsigned char *virtual_start; + int head; + int tail; + int space; +} I830RingBuffer; + +typedef struct _I830Rec { + unsigned char *MMIOBase; + unsigned char *FbBase; + int cpp; + + unsigned int bios_version; + + /* These are set in PreInit and never changed. */ + long FbMapSize; + long TotalVideoRam; + I830MemRange StolenMemory; /* pre-allocated memory */ + long BIOSMemorySize; /* min stolen pool size */ + int BIOSMemSizeLoc; + + /* These change according to what has been allocated. */ + long FreeMemory; + I830MemRange MemoryAperture; + I830MemPool StolenPool; + long allocatedMemory; + + /* Regions allocated either from the above pools, or from agpgart. */ + /* for single and dual head configurations */ + I830MemRange FrontBuffer; + I830MemRange FrontBuffer2; + I830MemRange Scratch; + I830MemRange Scratch2; + + I830RingBuffer *LpRing; + + I830MemRange BackBuffer; + I830MemRange DepthBuffer; + I830MemRange TexMem; + int TexGranularity; + I830MemRange ContextMem; + int drmMinor; + Bool have3DWindows; + + Bool NeedRingBufferLow; + Bool allowPageFlip; + Bool disableTiling; + + int Chipset; + unsigned long LinearAddr; + unsigned long MMIOAddr; + + drmSize registerSize; /**< \brief MMIO register map size */ + drm_handle_t registerHandle; /**< \brief MMIO register map handle */ + // IOADDRESS ioBase; + int irq; /**< \brief IRQ number */ + int GttBound; + + drm_handle_t ring_map; + unsigned int Fence[8]; + +} I830Rec; + +/* + * 12288 is set as the maximum, chosen because it is enough for + * 1920x1440@32bpp with a 2048 pixel line pitch with some to spare. + */ +#define I830_MAXIMUM_VBIOS_MEM 12288 +#define I830_DEFAULT_VIDEOMEM_2D (MB(32) / 1024) +#define I830_DEFAULT_VIDEOMEM_3D (MB(64) / 1024) + +/* Flags for memory allocation function */ +#define FROM_ANYWHERE 0x00000000 +#define FROM_POOL_ONLY 0x00000001 +#define FROM_NEW_ONLY 0x00000002 +#define FROM_MASK 0x0000000f + +#define ALLOCATE_AT_TOP 0x00000010 +#define ALLOCATE_AT_BOTTOM 0x00000020 +#define FORCE_GAPS 0x00000040 + +#define NEED_PHYSICAL_ADDR 0x00000100 +#define ALIGN_BOTH_ENDS 0x00000200 +#define FORCE_LOW 0x00000400 + +#define ALLOC_NO_TILING 0x00001000 +#define ALLOC_INITIAL 0x00002000 + +#define ALLOCATE_DRY_RUN 0x80000000 + +/* Chipset registers for VIDEO BIOS memory RW access */ +#define _855_DRAM_RW_CONTROL 0x58 +#define _845_DRAM_RW_CONTROL 0x90 +#define DRAM_WRITE 0x33330000 + +#define KB(x) ((x) * 1024) +#define MB(x) ((x) * KB(1024)) + +#define GTT_PAGE_SIZE KB(4) +#define ROUND_TO(x, y) (((x) + (y) - 1) / (y) * (y)) +#define ROUND_DOWN_TO(x, y) ((x) / (y) * (y)) +#define ROUND_TO_PAGE(x) ROUND_TO((x), GTT_PAGE_SIZE) +#define ROUND_TO_MB(x) ROUND_TO((x), MB(1)) +#define PRIMARY_RINGBUFFER_SIZE KB(128) + + +/* Ring buffer registers, p277, overview p19 + */ +#define LP_RING 0x2030 +#define HP_RING 0x2040 + +#define RING_TAIL 0x00 +#define TAIL_ADDR 0x000FFFF8 +#define I830_TAIL_MASK 0x001FFFF8 + +#define RING_HEAD 0x04 +#define HEAD_WRAP_COUNT 0xFFE00000 +#define HEAD_WRAP_ONE 0x00200000 +#define HEAD_ADDR 0x001FFFFC +#define I830_HEAD_MASK 0x001FFFFC + +#define RING_START 0x08 +#define START_ADDR 0x03FFFFF8 +#define I830_RING_START_MASK 0xFFFFF000 + +#define RING_LEN 0x0C +#define RING_NR_PAGES 0x001FF000 +#define I830_RING_NR_PAGES 0x001FF000 +#define RING_REPORT_MASK 0x00000006 +#define RING_REPORT_64K 0x00000002 +#define RING_REPORT_128K 0x00000004 +#define RING_NO_REPORT 0x00000000 +#define RING_VALID_MASK 0x00000001 +#define RING_VALID 0x00000001 +#define RING_INVALID 0x00000000 + + +/* Fence/Tiling ranges [0..7] + */ +#define FENCE 0x2000 +#define FENCE_NR 8 + +#define I915G_FENCE_START_MASK 0x0ff00000 + +#define I830_FENCE_START_MASK 0x07f80000 + +#define FENCE_START_MASK 0x03F80000 +#define FENCE_X_MAJOR 0x00000000 +#define FENCE_Y_MAJOR 0x00001000 +#define FENCE_SIZE_MASK 0x00000700 +#define FENCE_SIZE_512K 0x00000000 +#define FENCE_SIZE_1M 0x00000100 +#define FENCE_SIZE_2M 0x00000200 +#define FENCE_SIZE_4M 0x00000300 +#define FENCE_SIZE_8M 0x00000400 +#define FENCE_SIZE_16M 0x00000500 +#define FENCE_SIZE_32M 0x00000600 +#define FENCE_SIZE_64M 0x00000700 +#define I915G_FENCE_SIZE_1M 0x00000000 +#define I915G_FENCE_SIZE_2M 0x00000100 +#define I915G_FENCE_SIZE_4M 0x00000200 +#define I915G_FENCE_SIZE_8M 0x00000300 +#define I915G_FENCE_SIZE_16M 0x00000400 +#define I915G_FENCE_SIZE_32M 0x00000500 +#define I915G_FENCE_SIZE_64M 0x00000600 +#define I915G_FENCE_SIZE_128M 0x00000700 +#define FENCE_PITCH_1 0x00000000 +#define FENCE_PITCH_2 0x00000010 +#define FENCE_PITCH_4 0x00000020 +#define FENCE_PITCH_8 0x00000030 +#define FENCE_PITCH_16 0x00000040 +#define FENCE_PITCH_32 0x00000050 +#define FENCE_PITCH_64 0x00000060 +#define FENCE_VALID 0x00000001 + +#include + +# define MMIO_IN8(base, offset) \ + *(volatile unsigned char *)(((unsigned char*)(base)) + (offset)) +# define MMIO_IN32(base, offset) \ + read_MMIO_LE32(base, offset) +# define MMIO_OUT8(base, offset, val) \ + *(volatile unsigned char *)(((unsigned char*)(base)) + (offset)) = (val) +# define MMIO_OUT32(base, offset, val) \ + *(volatile unsigned int *)(void *)(((unsigned char*)(base)) + (offset)) = CPU_TO_LE32(val) + + + /* Memory mapped register access macros */ +#define INREG8(addr) MMIO_IN8(MMIO, addr) +#define INREG(addr) MMIO_IN32(MMIO, addr) +#define OUTREG8(addr, val) MMIO_OUT8(MMIO, addr, val) +#define OUTREG(addr, val) MMIO_OUT32(MMIO, addr, val) + +#define DSPABASE 0x70184 + +#endif diff --git a/src/mesa/drivers/dri/i915tex/server/intel_dri.c b/src/mesa/drivers/dri/i915tex/server/intel_dri.c new file mode 100644 index 00000000000..169fdbece30 --- /dev/null +++ b/src/mesa/drivers/dri/i915tex/server/intel_dri.c @@ -0,0 +1,1282 @@ +/** + * \file server/intel_dri.c + * \brief File to perform the device-specific initialization tasks typically + * done in the X server. + * + * Here they are converted to run in the client (or perhaps a standalone + * process), and to work with the frame buffer device rather than the X + * server infrastructure. + * + * Copyright (C) 2006 Dave Airlie (airlied@linux.ie) + + 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 THE 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. +*/ + +#include +#include +#include +#include +#include + +#include "driver.h" +#include "drm.h" + +#include "intel.h" +#include "i830_dri.h" + +#include "memops.h" +#include "pciaccess.h" + +static size_t drm_page_size; +static int nextTile = 0; +#define xf86DrvMsg(...) do {} while(0) + +static const int pitches[] = { + 128 * 8, + 128 * 16, + 128 * 32, + 128 * 64, + 0 +}; + +static Bool I830DRIDoMappings(DRIDriverContext *ctx, I830Rec *pI830, drmI830Sarea *sarea); + +static unsigned long +GetBestTileAlignment(unsigned long size) +{ + unsigned long i; + + for (i = KB(512); i < size; i <<= 1) + ; + + if (i > MB(64)) + i = MB(64); + + return i; +} + +static void SetFenceRegs(const DRIDriverContext *ctx, I830Rec *pI830) +{ + int i; + unsigned char *MMIO = ctx->MMIOAddress; + + for (i = 0; i < 8; i++) { + OUTREG(FENCE + i * 4, pI830->Fence[i]); + // if (I810_DEBUG & DEBUG_VERBOSE_VGA) + fprintf(stderr,"Fence Register : %x\n", pI830->Fence[i]); + } +} + +/* Tiled memory is good... really, really good... + * + * Need to make it less likely that we miss out on this - probably + * need to move the frontbuffer away from the 'guarenteed' alignment + * of the first memory segment, or perhaps allocate a discontigous + * framebuffer to get more alignment 'sweet spots'. + */ +static void +SetFence(const DRIDriverContext *ctx, I830Rec *pI830, + int nr, unsigned int start, unsigned int pitch, + unsigned int size) +{ + unsigned int val; + unsigned int fence_mask = 0; + unsigned int fence_pitch; + + if (nr < 0 || nr > 7) { + fprintf(stderr, + "SetFence: fence %d out of range\n",nr); + return; + } + + pI830->Fence[nr] = 0; + + if (IS_I9XX(pI830)) + fence_mask = ~I915G_FENCE_START_MASK; + else + fence_mask = ~I830_FENCE_START_MASK; + + if (start & fence_mask) { + fprintf(stderr, + "SetFence: %d: start (0x%08x) is not %s aligned\n", + nr, start, (IS_I9XX(pI830)) ? "1MB" : "512k"); + return; + } + + if (start % size) { + fprintf(stderr, + "SetFence: %d: start (0x%08x) is not size (%dk) aligned\n", + nr, start, size / 1024); + return; + } + + if (pitch & 127) { + fprintf(stderr, + "SetFence: %d: pitch (%d) not a multiple of 128 bytes\n", + nr, pitch); + return; + } + + val = (start | FENCE_X_MAJOR | FENCE_VALID); + + if (IS_I9XX(pI830)) { + switch (size) { + case MB(1): + val |= I915G_FENCE_SIZE_1M; + break; + case MB(2): + val |= I915G_FENCE_SIZE_2M; + break; + case MB(4): + val |= I915G_FENCE_SIZE_4M; + break; + case MB(8): + val |= I915G_FENCE_SIZE_8M; + break; + case MB(16): + val |= I915G_FENCE_SIZE_16M; + break; + case MB(32): + val |= I915G_FENCE_SIZE_32M; + break; + case MB(64): + val |= I915G_FENCE_SIZE_64M; + break; + default: + fprintf(stderr, + "SetFence: %d: illegal size (%d kByte)\n", nr, size / 1024); + return; + } + } else { + switch (size) { + case KB(512): + val |= FENCE_SIZE_512K; + break; + case MB(1): + val |= FENCE_SIZE_1M; + break; + case MB(2): + val |= FENCE_SIZE_2M; + break; + case MB(4): + val |= FENCE_SIZE_4M; + break; + case MB(8): + val |= FENCE_SIZE_8M; + break; + case MB(16): + val |= FENCE_SIZE_16M; + break; + case MB(32): + val |= FENCE_SIZE_32M; + break; + case MB(64): + val |= FENCE_SIZE_64M; + break; + default: + fprintf(stderr, + "SetFence: %d: illegal size (%d kByte)\n", nr, size / 1024); + return; + } + } + + if (IS_I9XX(pI830)) + fence_pitch = pitch / 512; + else + fence_pitch = pitch / 128; + + switch (fence_pitch) { + case 1: + val |= FENCE_PITCH_1; + break; + case 2: + val |= FENCE_PITCH_2; + break; + case 4: + val |= FENCE_PITCH_4; + break; + case 8: + val |= FENCE_PITCH_8; + break; + case 16: + val |= FENCE_PITCH_16; + break; + case 32: + val |= FENCE_PITCH_32; + break; + case 64: + val |= FENCE_PITCH_64; + break; + default: + fprintf(stderr, + "SetFence: %d: illegal pitch (%d)\n", nr, pitch); + return; + } + + pI830->Fence[nr] = val; +} + +static Bool +MakeTiles(const DRIDriverContext *ctx, I830Rec *pI830, I830MemRange *pMem) +{ + int pitch, ntiles, i; + + pitch = pMem->Pitch * ctx->cpp; + /* + * Simply try to break the region up into at most four pieces of size + * equal to the alignment. + */ + ntiles = ROUND_TO(pMem->Size, pMem->Alignment) / pMem->Alignment; + if (ntiles >= 4) { + return FALSE; + } + + for (i = 0; i < ntiles; i++, nextTile++) { + SetFence(ctx, pI830, nextTile, pMem->Start + i * pMem->Alignment, + pitch, pMem->Alignment); + } + return TRUE; +} + +static void I830SetupMemoryTiling(const DRIDriverContext *ctx, I830Rec *pI830) +{ + int i; + + /* Clear out */ + for (i = 0; i < 8; i++) + pI830->Fence[i] = 0; + + nextTile = 0; + + if (pI830->BackBuffer.Alignment >= KB(512)) { + if (MakeTiles(ctx, pI830, &(pI830->BackBuffer))) { + fprintf(stderr, + "Activating tiled memory for the back buffer.\n"); + } else { + fprintf(stderr, + "MakeTiles failed for the back buffer.\n"); + pI830->allowPageFlip = FALSE; + } + } + + if (pI830->DepthBuffer.Alignment >= KB(512)) { + if (MakeTiles(ctx, pI830, &(pI830->DepthBuffer))) { + fprintf(stderr, + "Activating tiled memory for the depth buffer.\n"); + } else { + fprintf(stderr, + "MakeTiles failed for the depth buffer.\n"); + } + } + + return; +} + +static int I830DetectMemory(const DRIDriverContext *ctx, I830Rec *pI830) +{ + struct pci_device host_bridge; + uint32_t gmch_ctrl; + int memsize = 0; + int range; + + memset(&host_bridge, 0, sizeof(host_bridge)); + + pci_device_cfg_read_u32(&host_bridge, &gmch_ctrl, I830_GMCH_CTRL); + + /* We need to reduce the stolen size, by the GTT and the popup. + * The GTT varying according the the FbMapSize and the popup is 4KB */ + range = (ctx->shared.fbSize / (1024*1024)) + 4; + + if (IS_I85X(pI830) || IS_I865G(pI830) || IS_I9XX(pI830)) { + switch (gmch_ctrl & I830_GMCH_GMS_MASK) { + case I855_GMCH_GMS_STOLEN_1M: + memsize = MB(1) - KB(range); + break; + case I855_GMCH_GMS_STOLEN_4M: + memsize = MB(4) - KB(range); + break; + case I855_GMCH_GMS_STOLEN_8M: + memsize = MB(8) - KB(range); + break; + case I855_GMCH_GMS_STOLEN_16M: + memsize = MB(16) - KB(range); + break; + case I855_GMCH_GMS_STOLEN_32M: + memsize = MB(32) - KB(range); + break; + case I915G_GMCH_GMS_STOLEN_48M: + if (IS_I9XX(pI830)) + memsize = MB(48) - KB(range); + break; + case I915G_GMCH_GMS_STOLEN_64M: + if (IS_I9XX(pI830)) + memsize = MB(64) - KB(range); + break; + } + } else { + switch (gmch_ctrl & I830_GMCH_GMS_MASK) { + case I830_GMCH_GMS_STOLEN_512: + memsize = KB(512) - KB(range); + break; + case I830_GMCH_GMS_STOLEN_1024: + memsize = MB(1) - KB(range); + break; + case I830_GMCH_GMS_STOLEN_8192: + memsize = MB(8) - KB(range); + break; + case I830_GMCH_GMS_LOCAL: + memsize = 0; + xf86DrvMsg(pScrn->scrnIndex, X_WARNING, + "Local memory found, but won't be used.\n"); + break; + } + } + if (memsize > 0) { + fprintf(stderr, + "detected %d kB stolen memory.\n", memsize / 1024); + } else { + fprintf(stderr, + "no video memory detected.\n"); + } + return memsize; +} + +static int AgpInit(const DRIDriverContext *ctx, I830Rec *info) +{ + unsigned long mode = 0x4; + + if (drmAgpAcquire(ctx->drmFD) < 0) { + fprintf(stderr, "[gart] AGP not available\n"); + return 0; + } + + if (drmAgpEnable(ctx->drmFD, mode) < 0) { + fprintf(stderr, "[gart] AGP not enabled\n"); + drmAgpRelease(ctx->drmFD); + return 0; + } + else + fprintf(stderr, "[gart] AGP enabled at %dx\n", ctx->agpmode); + + return 1; +} + +/* + * Allocate memory from the given pool. Grow the pool if needed and if + * possible. + */ +static unsigned long +AllocFromPool(const DRIDriverContext *ctx, I830Rec *pI830, + I830MemRange *result, I830MemPool *pool, + long size, unsigned long alignment, int flags) +{ + long needed, start, end; + + if (!result || !pool || !size) + return 0; + + /* Calculate how much space is needed. */ + if (alignment <= GTT_PAGE_SIZE) + needed = size; + else { + start = ROUND_TO(pool->Free.Start, alignment); + end = ROUND_TO(start + size, alignment); + needed = end - pool->Free.Start; + } + if (needed > pool->Free.Size) { + return 0; + } + + result->Start = ROUND_TO(pool->Free.Start, alignment); + pool->Free.Start += needed; + result->End = pool->Free.Start; + + pool->Free.Size = pool->Free.End - pool->Free.Start; + result->Size = result->End - result->Start; + result->Pool = pool; + result->Alignment = alignment; + return needed; +} + +static unsigned long AllocFromAGP(const DRIDriverContext *ctx, I830Rec *pI830, long size, unsigned long alignment, I830MemRange *result) +{ + unsigned long start, end; + unsigned long newApStart, newApEnd; + int ret; + if (!result || !size) + return 0; + + if (!alignment) + alignment = 4; + + start = ROUND_TO(pI830->MemoryAperture.Start, alignment); + end = ROUND_TO(start + size, alignment); + newApStart = end; + newApEnd = pI830->MemoryAperture.End; + + ret=drmAgpAlloc(ctx->drmFD, size, 0, &(result->Physical), (drm_handle_t *)&(result->Key)); + + if (ret) + { + fprintf(stderr,"drmAgpAlloc failed %d\n", ret); + return 0; + } + pI830->allocatedMemory += size; + pI830->MemoryAperture.Start = newApStart; + pI830->MemoryAperture.End = newApEnd; + pI830->MemoryAperture.Size = newApEnd - newApStart; + // pI830->FreeMemory -= size; + result->Start = start; + result->End = start + size; + result->Size = size; + result->Offset = start; + result->Alignment = alignment; + result->Pool = NULL; + + return size; +} + +unsigned long +I830AllocVidMem(const DRIDriverContext *ctx, I830Rec *pI830, I830MemRange *result, I830MemPool *pool, long size, unsigned long alignment, int flags) +{ + int ret; + + if (!result) + return 0; + + /* Make sure these are initialised. */ + result->Size = 0; + result->Key = -1; + + if (!size) { + return 0; + } + + if (pool->Free.Size < size) + return AllocFromAGP(ctx, pI830, size, alignment, result); + else + { + ret = AllocFromPool(ctx, pI830, result, pool, size, alignment, flags); + + if (ret==0) + return AllocFromAGP(ctx, pI830, size, alignment, result); + return ret; + } +} + +static Bool BindAgpRange(const DRIDriverContext *ctx, I830MemRange *mem) +{ + if (!mem) + return FALSE; + + if (mem->Key == -1) + return TRUE; + + return !drmAgpBind(ctx->drmFD, mem->Key, mem->Offset); +} + +/* simple memory allocation routines needed */ +/* put ring buffer in low memory */ +/* need to allocate front, back, depth buffers aligned correctly, + allocate ring buffer, +*/ + +/* */ +static Bool +I830AllocateMemory(const DRIDriverContext *ctx, I830Rec *pI830) +{ + unsigned long size, ret; + unsigned long lines, lineSize, align; + + /* allocate ring buffer */ + memset(pI830->LpRing, 0, sizeof(I830RingBuffer)); + pI830->LpRing->mem.Key = -1; + + size = PRIMARY_RINGBUFFER_SIZE; + + ret = I830AllocVidMem(ctx, pI830, &pI830->LpRing->mem, &pI830->StolenPool, size, 0x1000, 0); + + if (ret != size) + { + fprintf(stderr,"unable to allocate ring buffer %ld\n", ret); + return FALSE; + } + + pI830->LpRing->tail_mask = pI830->LpRing->mem.Size - 1; + + + /* allocate front buffer */ + memset(&(pI830->FrontBuffer), 0, sizeof(pI830->FrontBuffer)); + pI830->FrontBuffer.Key = -1; + pI830->FrontBuffer.Pitch = ctx->shared.virtualWidth; + + align = KB(512); + + lineSize = ctx->shared.virtualWidth * ctx->cpp; + lines = (ctx->shared.virtualHeight + 15) / 16 * 16; + size = lineSize * lines; + size = ROUND_TO_PAGE(size); + + align = GetBestTileAlignment(size); + + ret = I830AllocVidMem(ctx, pI830, &pI830->FrontBuffer, &pI830->StolenPool, size, align, 0); + if (ret < size) + { + fprintf(stderr,"unable to allocate front buffer %ld\n", ret); + return FALSE; + } + + memset(&(pI830->BackBuffer), 0, sizeof(pI830->BackBuffer)); + pI830->BackBuffer.Key = -1; + pI830->BackBuffer.Pitch = ctx->shared.virtualWidth; + + ret = I830AllocVidMem(ctx, pI830, &pI830->BackBuffer, &pI830->StolenPool, size, align, 0); + if (ret < size) + { + fprintf(stderr,"unable to allocate back buffer %ld\n", ret); + return FALSE; + } + + memset(&(pI830->DepthBuffer), 0, sizeof(pI830->DepthBuffer)); + pI830->DepthBuffer.Key = -1; + pI830->DepthBuffer.Pitch = ctx->shared.virtualWidth; + + ret = I830AllocVidMem(ctx, pI830, &pI830->DepthBuffer, &pI830->StolenPool, size, align, 0); + if (ret < size) + { + fprintf(stderr,"unable to allocate depth buffer %ld\n", ret); + return FALSE; + } + + memset(&(pI830->ContextMem), 0, sizeof(pI830->ContextMem)); + pI830->ContextMem.Key = -1; + size = KB(32); + + ret = I830AllocVidMem(ctx, pI830, &pI830->ContextMem, &pI830->StolenPool, size, align, 0); + if (ret < size) + { + fprintf(stderr,"unable to allocate context buffer %ld\n", ret); + return FALSE; + } + + memset(&(pI830->TexMem), 0, sizeof(pI830->TexMem)); + pI830->TexMem.Key = -1; + + size = 32768 * 1024; + ret = AllocFromAGP(ctx, pI830, size, align, &pI830->TexMem); + if (ret < size) + { + fprintf(stderr,"unable to allocate texture memory %ld\n", ret); + return FALSE; + } + + return TRUE; +} + +static Bool +I830BindMemory(const DRIDriverContext *ctx, I830Rec *pI830) +{ + if (!BindAgpRange(ctx, &pI830->LpRing->mem)) + return FALSE; + if (!BindAgpRange(ctx, &pI830->FrontBuffer)) + return FALSE; + if (!BindAgpRange(ctx, &pI830->BackBuffer)) + return FALSE; + if (!BindAgpRange(ctx, &pI830->DepthBuffer)) + return FALSE; + if (!BindAgpRange(ctx, &pI830->ContextMem)) + return FALSE; + if (!BindAgpRange(ctx, &pI830->TexMem)) + return FALSE; + + return TRUE; +} + +static Bool +I830CleanupDma(const DRIDriverContext *ctx) +{ + drmI830Init info; + + memset(&info, 0, sizeof(drmI830Init)); + info.func = I830_CLEANUP_DMA; + + if (drmCommandWrite(ctx->drmFD, DRM_I830_INIT, + &info, sizeof(drmI830Init))) { + fprintf(stderr, "I830 Dma Cleanup Failed\n"); + return FALSE; + } + + return TRUE; +} + +static Bool +I830InitDma(const DRIDriverContext *ctx, I830Rec *pI830) +{ + I830RingBuffer *ring = pI830->LpRing; + drmI830Init info; + + memset(&info, 0, sizeof(drmI830Init)); + info.func = I830_INIT_DMA; + + info.ring_start = ring->mem.Start + pI830->LinearAddr; + info.ring_end = ring->mem.End + pI830->LinearAddr; + info.ring_size = ring->mem.Size; + + info.mmio_offset = (unsigned int)ctx->MMIOStart; + + info.sarea_priv_offset = sizeof(drm_sarea_t); + + info.front_offset = pI830->FrontBuffer.Start; + info.back_offset = pI830->BackBuffer.Start; + info.depth_offset = pI830->DepthBuffer.Start; + info.w = ctx->shared.virtualWidth; + info.h = ctx->shared.virtualHeight; + info.pitch = ctx->shared.virtualWidth; + info.back_pitch = pI830->BackBuffer.Pitch; + info.depth_pitch = pI830->DepthBuffer.Pitch; + info.cpp = ctx->cpp; + + if (drmCommandWrite(ctx->drmFD, DRM_I830_INIT, + &info, sizeof(drmI830Init))) { + fprintf(stderr, + "I830 Dma Initialization Failed\n"); + return FALSE; + } + + return TRUE; +} + +static int I830CheckDRMVersion( const DRIDriverContext *ctx, + I830Rec *pI830 ) +{ + drmVersionPtr version; + + version = drmGetVersion(ctx->drmFD); + + if (version) { + int req_minor, req_patch; + + req_minor = 4; + req_patch = 0; + + if (version->version_major != 1 || + version->version_minor < req_minor || + (version->version_minor == req_minor && + version->version_patchlevel < req_patch)) { + /* Incompatible drm version */ + fprintf(stderr, + "[dri] I830DRIScreenInit failed because of a version " + "mismatch.\n" + "[dri] i915.o kernel module version is %d.%d.%d " + "but version 1.%d.%d or newer is needed.\n" + "[dri] Disabling DRI.\n", + version->version_major, + version->version_minor, + version->version_patchlevel, + req_minor, + req_patch); + drmFreeVersion(version); + return 0; + } + + pI830->drmMinor = version->version_minor; + drmFreeVersion(version); + } + return 1; +} + +static void +I830SetRingRegs(const DRIDriverContext *ctx, I830Rec *pI830) +{ + unsigned int itemp; + unsigned char *MMIO = ctx->MMIOAddress; + + OUTREG(LP_RING + RING_LEN, 0); + OUTREG(LP_RING + RING_TAIL, 0); + OUTREG(LP_RING + RING_HEAD, 0); + + if ((long)(pI830->LpRing->mem.Start & I830_RING_START_MASK) != + pI830->LpRing->mem.Start) { + fprintf(stderr, + "I830SetRingRegs: Ring buffer start (%lx) violates its " + "mask (%x)\n", pI830->LpRing->mem.Start, I830_RING_START_MASK); + } + /* Don't care about the old value. Reserved bits must be zero anyway. */ + itemp = pI830->LpRing->mem.Start & I830_RING_START_MASK; + OUTREG(LP_RING + RING_START, itemp); + + if (((pI830->LpRing->mem.Size - 4096) & I830_RING_NR_PAGES) != + pI830->LpRing->mem.Size - 4096) { + fprintf(stderr, + "I830SetRingRegs: Ring buffer size - 4096 (%lx) violates its " + "mask (%x)\n", pI830->LpRing->mem.Size - 4096, + I830_RING_NR_PAGES); + } + /* Don't care about the old value. Reserved bits must be zero anyway. */ + itemp = (pI830->LpRing->mem.Size - 4096) & I830_RING_NR_PAGES; + itemp |= (RING_NO_REPORT | RING_VALID); + OUTREG(LP_RING + RING_LEN, itemp); + + pI830->LpRing->head = INREG(LP_RING + RING_HEAD) & I830_HEAD_MASK; + pI830->LpRing->tail = INREG(LP_RING + RING_TAIL); + pI830->LpRing->space = pI830->LpRing->head - (pI830->LpRing->tail + 8); + if (pI830->LpRing->space < 0) + pI830->LpRing->space += pI830->LpRing->mem.Size; + + SetFenceRegs(ctx, pI830); + + /* RESET THE DISPLAY PIPE TO POINT TO THE FRONTBUFFER - hacky + hacky hacky */ + OUTREG(DSPABASE, pI830->FrontBuffer.Start + pI830->LinearAddr); + +} + +static Bool +I830SetParam(const DRIDriverContext *ctx, int param, int value) +{ + drmI830SetParam sp; + + memset(&sp, 0, sizeof(sp)); + sp.param = param; + sp.value = value; + + if (drmCommandWrite(ctx->drmFD, DRM_I830_SETPARAM, &sp, sizeof(sp))) { + fprintf(stderr, "I830 SetParam Failed\n"); + return FALSE; + } + + return TRUE; +} + +static Bool +I830DRIMapScreenRegions(DRIDriverContext *ctx, I830Rec *pI830, drmI830Sarea *sarea) +{ + fprintf(stderr, + "[drm] Mapping front buffer\n"); + + if (drmAddMap(ctx->drmFD, + (drm_handle_t)(sarea->front_offset + pI830->LinearAddr), + sarea->front_size, + DRM_FRAME_BUFFER, /*DRM_AGP,*/ + 0, + &sarea->front_handle) < 0) { + fprintf(stderr, + "[drm] drmAddMap(front_handle) failed. Disabling DRI\n"); + return FALSE; + } + ctx->shared.hFrameBuffer = sarea->front_handle; + ctx->shared.fbSize = sarea->front_size; + fprintf(stderr, "[drm] Front Buffer = 0x%08x\n", + sarea->front_handle); + + if (drmAddMap(ctx->drmFD, + (drm_handle_t)(sarea->back_offset), + sarea->back_size, DRM_AGP, 0, + &sarea->back_handle) < 0) { + fprintf(stderr, + "[drm] drmAddMap(back_handle) failed. Disabling DRI\n"); + return FALSE; + } + fprintf(stderr, "[drm] Back Buffer = 0x%08x\n", + sarea->back_handle); + + if (drmAddMap(ctx->drmFD, + (drm_handle_t)sarea->depth_offset, + sarea->depth_size, DRM_AGP, 0, + &sarea->depth_handle) < 0) { + fprintf(stderr, + "[drm] drmAddMap(depth_handle) failed. Disabling DRI\n"); + return FALSE; + } + fprintf(stderr, "[drm] Depth Buffer = 0x%08x\n", + sarea->depth_handle); + + if (drmAddMap(ctx->drmFD, + (drm_handle_t)sarea->tex_offset, + sarea->tex_size, DRM_AGP, 0, + &sarea->tex_handle) < 0) { + fprintf(stderr, + "[drm] drmAddMap(tex_handle) failed. Disabling DRI\n"); + return FALSE; + } + fprintf(stderr, "[drm] textures = 0x%08x\n", + sarea->tex_handle); + + return TRUE; +} + + +static void +I830DRIUnmapScreenRegions(const DRIDriverContext *ctx, I830Rec *pI830, drmI830Sarea *sarea) +{ +#if 1 + if (sarea->front_handle) { + drmRmMap(ctx->drmFD, sarea->front_handle); + sarea->front_handle = 0; + } +#endif + if (sarea->back_handle) { + drmRmMap(ctx->drmFD, sarea->back_handle); + sarea->back_handle = 0; + } + if (sarea->depth_handle) { + drmRmMap(ctx->drmFD, sarea->depth_handle); + sarea->depth_handle = 0; + } + if (sarea->tex_handle) { + drmRmMap(ctx->drmFD, sarea->tex_handle); + sarea->tex_handle = 0; + } +} + +static void +I830InitTextureHeap(const DRIDriverContext *ctx, I830Rec *pI830, drmI830Sarea *sarea) +{ + /* Start up the simple memory manager for agp space */ + drmI830MemInitHeap drmHeap; + drmHeap.region = I830_MEM_REGION_AGP; + drmHeap.start = 0; + drmHeap.size = sarea->tex_size; + + if (drmCommandWrite(ctx->drmFD, DRM_I830_INIT_HEAP, + &drmHeap, sizeof(drmHeap))) { + fprintf(stderr, + "[drm] Failed to initialized agp heap manager\n"); + } else { + fprintf(stderr, + "[drm] Initialized kernel agp heap manager, %d\n", + sarea->tex_size); + + I830SetParam(ctx, I830_SETPARAM_TEX_LRU_LOG_GRANULARITY, + sarea->log_tex_granularity); + } +} + +static Bool +I830DRIDoMappings(DRIDriverContext *ctx, I830Rec *pI830, drmI830Sarea *sarea) +{ + if (drmAddMap(ctx->drmFD, + (drm_handle_t)pI830->LpRing->mem.Start, + pI830->LpRing->mem.Size, DRM_AGP, 0, + &pI830->ring_map) < 0) { + fprintf(stderr, + "[drm] drmAddMap(ring_map) failed. Disabling DRI\n"); + return FALSE; + } + fprintf(stderr, "[drm] ring buffer = 0x%08x\n", + pI830->ring_map); + + if (I830InitDma(ctx, pI830) == FALSE) { + return FALSE; + } + + /* init to zero to be safe */ + + I830DRIMapScreenRegions(ctx, pI830, sarea); + I830InitTextureHeap(ctx, pI830, sarea); + + if (ctx->pciDevice != PCI_CHIP_845_G && + ctx->pciDevice != PCI_CHIP_I830_M) { + I830SetParam(ctx, I830_SETPARAM_USE_MI_BATCHBUFFER_START, 1 ); + } + + /* Okay now initialize the dma engine */ + { + pI830->irq = drmGetInterruptFromBusID(ctx->drmFD, + ctx->pciBus, + ctx->pciDevice, + ctx->pciFunc); + + if (drmCtlInstHandler(ctx->drmFD, pI830->irq)) { + fprintf(stderr, + "[drm] failure adding irq handler\n"); + pI830->irq = 0; + return FALSE; + } + else + fprintf(stderr, + "[drm] dma control initialized, using IRQ %d\n", + pI830->irq); + } + + fprintf(stderr, "[dri] visual configs initialized\n"); + + return TRUE; +} + +static Bool +I830ClearScreen(DRIDriverContext *ctx, I830Rec *pI830, drmI830Sarea *sarea) +{ + /* need to drmMap front and back buffers and zero them */ + drmAddress map_addr; + int ret; + + ret = drmMap(ctx->drmFD, + sarea->front_handle, + sarea->front_size, + &map_addr); + + if (ret) + { + fprintf(stderr, "Unable to map front buffer\n"); + return FALSE; + } + + drimemsetio((char *)map_addr, + 0, + sarea->front_size); + drmUnmap(map_addr, sarea->front_size); + + + ret = drmMap(ctx->drmFD, + sarea->back_handle, + sarea->back_size, + &map_addr); + + if (ret) + { + fprintf(stderr, "Unable to map back buffer\n"); + return FALSE; + } + + drimemsetio((char *)map_addr, + 0, + sarea->back_size); + drmUnmap(map_addr, sarea->back_size); + + return TRUE; +} + +static Bool +I830ScreenInit(DRIDriverContext *ctx, I830Rec *pI830) + +{ + I830DRIPtr pI830DRI; + drmI830Sarea *pSAREAPriv; + int err; + + drm_page_size = getpagesize(); + + pI830->registerSize = ctx->MMIOSize; + /* This is a hack for now. We have to have more than a 4k page here + * because of the size of the state. However, the state should be + * in a per-context mapping. This will be added in the Mesa 3.5 port + * of the I830 driver. + */ + ctx->shared.SAREASize = SAREA_MAX; + + /* Note that drmOpen will try to load the kernel module, if needed. */ + ctx->drmFD = drmOpen("i915", NULL ); + if (ctx->drmFD < 0) { + fprintf(stderr, "[drm] drmOpen failed\n"); + return 0; + } + + if ((err = drmSetBusid(ctx->drmFD, ctx->pciBusID)) < 0) { + fprintf(stderr, "[drm] drmSetBusid failed (%d, %s), %s\n", + ctx->drmFD, ctx->pciBusID, strerror(-err)); + return 0; + } + + if (drmAddMap( ctx->drmFD, + 0, + ctx->shared.SAREASize, + DRM_SHM, + DRM_CONTAINS_LOCK, + &ctx->shared.hSAREA) < 0) + { + fprintf(stderr, "[drm] drmAddMap failed\n"); + return 0; + } + + fprintf(stderr, "[drm] added %d byte SAREA at 0x%08x\n", + ctx->shared.SAREASize, ctx->shared.hSAREA); + + if (drmMap( ctx->drmFD, + ctx->shared.hSAREA, + ctx->shared.SAREASize, + (drmAddressPtr)(&ctx->pSAREA)) < 0) + { + fprintf(stderr, "[drm] drmMap failed\n"); + return 0; + + } + + memset(ctx->pSAREA, 0, ctx->shared.SAREASize); + fprintf(stderr, "[drm] mapped SAREA 0x%08x to %p, size %d\n", + ctx->shared.hSAREA, ctx->pSAREA, ctx->shared.SAREASize); + + + if (drmAddMap(ctx->drmFD, + ctx->MMIOStart, + ctx->MMIOSize, + DRM_REGISTERS, + DRM_READ_ONLY, + &pI830->registerHandle) < 0) { + fprintf(stderr, "[drm] drmAddMap mmio failed\n"); + return 0; + } + fprintf(stderr, + "[drm] register handle = 0x%08x\n", pI830->registerHandle); + + + if (!I830CheckDRMVersion(ctx, pI830)) { + return FALSE; + } + + /* Create a 'server' context so we can grab the lock for + * initialization ioctls. + */ + if ((err = drmCreateContext(ctx->drmFD, &ctx->serverContext)) != 0) { + fprintf(stderr, "%s: drmCreateContext failed %d\n", __FUNCTION__, err); + return 0; + } + + DRM_LOCK(ctx->drmFD, ctx->pSAREA, ctx->serverContext, 0); + + /* Initialize the SAREA private data structure */ + pSAREAPriv = (drmI830Sarea *)(((char*)ctx->pSAREA) + + sizeof(drm_sarea_t)); + memset(pSAREAPriv, 0, sizeof(*pSAREAPriv)); + + pI830->StolenMemory.Size = I830DetectMemory(ctx, pI830); + pI830->StolenMemory.Start = 0; + pI830->StolenMemory.End = pI830->StolenMemory.Size; + + pI830->MemoryAperture.Start = pI830->StolenMemory.End; + pI830->MemoryAperture.End = KB(40000); + pI830->MemoryAperture.Size = pI830->MemoryAperture.End - pI830->MemoryAperture.Start; + + pI830->StolenPool.Fixed = pI830->StolenMemory; + pI830->StolenPool.Total = pI830->StolenMemory; + pI830->StolenPool.Free = pI830->StolenPool.Total; + pI830->FreeMemory = pI830->StolenPool.Total.Size; + + if (!AgpInit(ctx, pI830)) + return FALSE; + + if (I830AllocateMemory(ctx, pI830) == FALSE) + { + return FALSE; + } + + if (I830BindMemory(ctx, pI830) == FALSE) + { + return FALSE; + } + + pSAREAPriv->front_offset = pI830->FrontBuffer.Start; + pSAREAPriv->front_size = pI830->FrontBuffer.Size; + pSAREAPriv->width = ctx->shared.virtualWidth; + pSAREAPriv->height = ctx->shared.virtualHeight; + pSAREAPriv->pitch = ctx->shared.virtualWidth; + pSAREAPriv->virtualX = ctx->shared.virtualWidth; + pSAREAPriv->virtualY = ctx->shared.virtualHeight; + pSAREAPriv->back_offset = pI830->BackBuffer.Start; + pSAREAPriv->back_size = pI830->BackBuffer.Size; + pSAREAPriv->depth_offset = pI830->DepthBuffer.Start; + pSAREAPriv->depth_size = pI830->DepthBuffer.Size; + pSAREAPriv->tex_offset = pI830->TexMem.Start; + pSAREAPriv->tex_size = pI830->TexMem.Size; + pSAREAPriv->log_tex_granularity = pI830->TexGranularity; + + ctx->driverClientMsg = malloc(sizeof(I830DRIRec)); + ctx->driverClientMsgSize = sizeof(I830DRIRec); + pI830DRI = (I830DRIPtr)ctx->driverClientMsg; + pI830DRI->deviceID = pI830->Chipset; + pI830DRI->regsSize = I830_REG_SIZE; + pI830DRI->width = ctx->shared.virtualWidth; + pI830DRI->height = ctx->shared.virtualHeight; + pI830DRI->mem = ctx->shared.fbSize; + pI830DRI->cpp = ctx->cpp; + pI830DRI->backOffset = pI830->BackBuffer.Start; + pI830DRI->backPitch = pI830->BackBuffer.Pitch; + + pI830DRI->depthOffset = pI830->DepthBuffer.Start; + pI830DRI->depthPitch = pI830->DepthBuffer.Pitch; + + pI830DRI->fbOffset = pI830->FrontBuffer.Start; + pI830DRI->fbStride = pI830->FrontBuffer.Pitch; + + pI830DRI->bitsPerPixel = ctx->bpp; + pI830DRI->sarea_priv_offset = sizeof(drm_sarea_t); + + err = I830DRIDoMappings(ctx, pI830, pSAREAPriv); + if (err == FALSE) + return FALSE; + + I830SetupMemoryTiling(ctx, pI830); + + /* Quick hack to clear the front & back buffers. Could also use + * the clear ioctl to do this, but would need to setup hw state + * first. + */ + I830ClearScreen(ctx, pI830, pSAREAPriv); + + I830SetRingRegs(ctx, pI830); + + return TRUE; +} + + +/** + * \brief Validate the fbdev mode. + * + * \param ctx display handle. + * + * \return one on success, or zero on failure. + * + * Saves some registers and returns 1. + * + * \sa radeonValidateMode(). + */ +static int i830ValidateMode( const DRIDriverContext *ctx ) +{ + return 1; +} + +/** + * \brief Examine mode returned by fbdev. + * + * \param ctx display handle. + * + * \return one on success, or zero on failure. + * + * Restores registers that fbdev has clobbered and returns 1. + * + * \sa i810ValidateMode(). + */ +static int i830PostValidateMode( const DRIDriverContext *ctx ) +{ + I830Rec *pI830 = ctx->driverPrivate; + + I830SetRingRegs(ctx, pI830); + return 1; +} + + +/** + * \brief Initialize the framebuffer device mode + * + * \param ctx display handle. + * + * \return one on success, or zero on failure. + * + * Fills in \p info with some default values and some information from \p ctx + * and then calls I810ScreenInit() for the screen initialization. + * + * Before exiting clears the framebuffer memory accessing it directly. + */ +static int i830InitFBDev( DRIDriverContext *ctx ) +{ + I830Rec *pI830 = calloc(1, sizeof(I830Rec)); + int i; + + { + int dummy = ctx->shared.virtualWidth; + + switch (ctx->bpp / 8) { + case 1: dummy = (ctx->shared.virtualWidth + 127) & ~127; break; + case 2: dummy = (ctx->shared.virtualWidth + 31) & ~31; break; + case 3: + case 4: dummy = (ctx->shared.virtualWidth + 15) & ~15; break; + } + + ctx->shared.virtualWidth = dummy; + ctx->shared.Width = ctx->shared.virtualWidth; + } + + + for (i = 0; pitches[i] != 0; i++) { + if (pitches[i] >= ctx->shared.virtualWidth) { + ctx->shared.virtualWidth = pitches[i]; + break; + } + } + + ctx->driverPrivate = (void *)pI830; + + pI830->LpRing = calloc(1, sizeof(I830RingBuffer)); + pI830->Chipset = ctx->chipset; + pI830->LinearAddr = ctx->FBStart; + + if (!I830ScreenInit( ctx, pI830 )) + return 0; + + + return 1; +} + + +/** + * \brief The screen is being closed, so clean up any state and free any + * resources used by the DRI. + * + * \param ctx display handle. + * + * Unmaps the SAREA, closes the DRM device file descriptor and frees the driver + * private data. + */ +static void i830HaltFBDev( DRIDriverContext *ctx ) +{ + drmI830Sarea *pSAREAPriv; + I830Rec *pI830 = ctx->driverPrivate; + + if (pI830->irq) { + drmCtlUninstHandler(ctx->drmFD); + pI830->irq = 0; } + + I830CleanupDma(ctx); + + pSAREAPriv = (drmI830Sarea *)(((char*)ctx->pSAREA) + + sizeof(drm_sarea_t)); + + I830DRIUnmapScreenRegions(ctx, pI830, pSAREAPriv); + drmUnmap( ctx->pSAREA, ctx->shared.SAREASize ); + drmClose(ctx->drmFD); + + if (ctx->driverPrivate) { + free(ctx->driverPrivate); + ctx->driverPrivate = 0; + } +} + + +extern void i810NotifyFocus( int ); + +/** + * \brief Exported driver interface for Mini GLX. + * + * \sa DRIDriverRec. + */ +const struct DRIDriverRec __driDriver = { + i830ValidateMode, + i830PostValidateMode, + i830InitFBDev, + i830HaltFBDev, + NULL,//I830EngineShutdown, + NULL, //I830EngineRestore, +#ifndef _EMBEDDED + 0, +#else + i810NotifyFocus, +#endif +}; diff --git a/src/mesa/drivers/dri/i965/Makefile b/src/mesa/drivers/dri/i965/Makefile index e4fb451cc09..213eac895cb 100644 --- a/src/mesa/drivers/dri/i965/Makefile +++ b/src/mesa/drivers/dri/i965/Makefile @@ -16,6 +16,8 @@ DRIVER_SOURCES = \ intel_regions.c \ intel_screen.c \ intel_span.c \ + intel_pixel_copy.c \ + intel_pixel_bitmap.c \ intel_state.c \ intel_tex.c \ intel_tex_validate.c \ diff --git a/src/mesa/drivers/dri/i965/brw_aub_playback.c b/src/mesa/drivers/dri/i965/brw_aub_playback.c index 49cc967716e..2433d50c116 100644 --- a/src/mesa/drivers/dri/i965/brw_aub_playback.c +++ b/src/mesa/drivers/dri/i965/brw_aub_playback.c @@ -39,7 +39,7 @@ static void flush_and_fence( struct aub_state *s ) buf[0] = intel->vtbl.flush_cmd(); buf[1] = 0; - intel_cmd_ioctl(intel, (char *)&buf, sizeof(buf), GL_TRUE); + intel_cmd_ioctl(intel, (char *)&buf, sizeof(buf)); intelWaitIrq( intel, intelEmitIrqLocked( intel )); } @@ -64,7 +64,7 @@ static void flush_cmds( struct aub_state *s, * This differs slightly from how the stream was executed * initially as this would have been a batchbuffer. */ - intel_cmd_ioctl(s->intel, (void *)data, len, GL_TRUE); + intel_cmd_ioctl(s->intel, (void *)data, len); if (1) flush_and_fence(s); @@ -345,7 +345,7 @@ static int parse_block_header( struct aub_state *s ) } case BH_COMMAND_WRITE: #if 0 - intel_cmd_ioctl(s->intel, (void *)data, len, GL_TRUE); + intel_cmd_ioctl(s->intel, (void *)data, len); #else if (parse_commands(s, data, len) != 0) _mesa_printf("parse_commands failed\n"); diff --git a/src/mesa/drivers/dri/i965/brw_draw.c b/src/mesa/drivers/dri/i965/brw_draw.c index f12fb4c7f3e..5c0c5da7eaa 100644 --- a/src/mesa/drivers/dri/i965/brw_draw.c +++ b/src/mesa/drivers/dri/i965/brw_draw.c @@ -123,6 +123,23 @@ static GLuint trim(GLenum prim, GLuint length) } +static void brw_emit_cliprect( struct brw_context *brw, + const drm_clip_rect_t *rect ) +{ + struct brw_drawrect bdr; + + bdr.header.opcode = CMD_DRAW_RECT; + bdr.header.length = sizeof(bdr)/4 - 2; + bdr.xmin = rect->x1; + bdr.xmax = rect->x2 - 1; + bdr.ymin = rect->y1; + bdr.ymax = rect->y2 - 1; + bdr.xorg = brw->intel.drawX; + bdr.yorg = brw->intel.drawY; + + intel_batchbuffer_data( brw->intel.batch, &bdr, sizeof(bdr), + INTEL_BATCH_NO_CLIPRECTS); +} static void brw_emit_prim( struct brw_context *brw, @@ -149,7 +166,7 @@ static void brw_emit_prim( struct brw_context *brw, if (prim_packet.verts_per_instance) { intel_batchbuffer_data( brw->intel.batch, &prim_packet, sizeof(prim_packet), - INTEL_BATCH_CLIPRECTS); + INTEL_BATCH_NO_CLIPRECTS); } } @@ -277,7 +294,7 @@ static GLboolean brw_try_draw_prims( GLcontext *ctx, struct intel_context *intel = intel_context(ctx); struct brw_context *brw = brw_context(ctx); GLboolean retval = GL_FALSE; - GLuint i; + GLuint i, j; if (ctx->NewState) _mesa_update_state( ctx ); @@ -294,8 +311,17 @@ static GLboolean brw_try_draw_prims( GLcontext *ctx, */ LOCK_HARDWARE(intel); + + if (brw->intel.numClipRects == 0) { + assert(intel->batch->ptr == intel->batch->map + intel->batch->offset); + UNLOCK_HARDWARE(intel); + return GL_TRUE; + } + { assert(intel->locked); + + /* Set the first primitive early, ahead of validate_state: */ @@ -322,12 +348,28 @@ static GLboolean brw_try_draw_prims( GLcontext *ctx, goto out; } - /* Emit prims to batchbuffer: + /* For single cliprect, state is already emitted: */ - for (i = 0; i < nr_prims; i++) { - brw_emit_prim(brw, &prim[i]); + if (brw->intel.numClipRects == 1) { + for (i = 0; i < nr_prims; i++) { + brw_emit_prim(brw, &prim[i]); + } + } + else { + /* Otherwise, explicitly do the cliprects at this point: + */ + for (j = 0; j < brw->intel.numClipRects; j++) { + brw_emit_cliprect(brw, &brw->intel.pClipRects[j]); + + /* Emit prims to batchbuffer: + */ + for (i = 0; i < nr_prims; i++) { + brw_emit_prim(brw, &prim[i]); + } + } } + intel->need_flush = GL_TRUE; retval = GL_TRUE; } @@ -400,7 +442,7 @@ GLboolean brw_draw_prims( GLcontext *ctx, retval = brw_try_draw_prims(ctx, arrays, prim, nr_prims, ib, min_index, max_index, flags); } - if (intel->aub_file) { + if (intel->aub_file && (INTEL_DEBUG & DEBUG_SYNC)) { intelFinish( &intel->ctx ); intel->aub_wrap = 1; } diff --git a/src/mesa/drivers/dri/i965/brw_draw_upload.c b/src/mesa/drivers/dri/i965/brw_draw_upload.c index 8c6b5a6d2c4..cde0aa6481b 100644 --- a/src/mesa/drivers/dri/i965/brw_draw_upload.c +++ b/src/mesa/drivers/dri/i965/brw_draw_upload.c @@ -435,6 +435,7 @@ GLboolean brw_upload_vertices( struct brw_context *brw, ptr = input->glarray->Ptr; } else if (interleave != input->glarray->StrideB || + (const char *)input->glarray->Ptr - (const char *)ptr < 0 || (const char *)input->glarray->Ptr - (const char *)ptr > interleave) { interleave = 0; } diff --git a/src/mesa/drivers/dri/i965/brw_exec_api.c b/src/mesa/drivers/dri/i965/brw_exec_api.c index ca012dbcd8a..470fa6f4177 100644 --- a/src/mesa/drivers/dri/i965/brw_exec_api.c +++ b/src/mesa/drivers/dri/i965/brw_exec_api.c @@ -394,7 +394,7 @@ static void GLAPIENTRY brw_exec_EvalCoord1f( GLfloat u ) for (i = 0 ; i <= BRW_ATTRIB_INDEX ; i++) { if (exec->eval.map1[i].map) - if (exec->vtx.attrsz[i] != exec->eval.map1[i].sz) + if (exec->vtx.active_sz[i] != exec->eval.map1[i].sz) brw_exec_fixup_vertex( ctx, i, exec->eval.map1[i].sz ); } } diff --git a/src/mesa/drivers/dri/i965/brw_misc_state.c b/src/mesa/drivers/dri/i965/brw_misc_state.c index 29296c17e9e..6a6c4503c74 100644 --- a/src/mesa/drivers/dri/i965/brw_misc_state.c +++ b/src/mesa/drivers/dri/i965/brw_misc_state.c @@ -74,7 +74,6 @@ const struct brw_tracked_state brw_blend_constant_color = { /*********************************************************************** * Drawing rectangle -- Need for AUB file only. */ - static void upload_drawing_rect(struct brw_context *brw) { struct intel_context *intel = &brw->intel; @@ -83,13 +82,12 @@ static void upload_drawing_rect(struct brw_context *brw) int x1, y1; int x2, y2; - if (!brw->intel.aub_file) + /* If there is a single cliprect, set it here. Otherwise iterate + * over them in brw_draw_prim(). + */ + if (brw->intel.numClipRects > 1) return; - /* Basically calculate a single cliprect for the whole window. - * Don't bother iterating over cliprects at the moment. - */ - x1 = dPriv->x; y1 = dPriv->y; x2 = dPriv->x + dPriv->w; @@ -110,7 +108,10 @@ static void upload_drawing_rect(struct brw_context *brw) bdr.xorg = dPriv->x; bdr.yorg = dPriv->y; - BRW_CACHED_BATCH_STRUCT(brw, &bdr); + /* Can't use BRW_CACHED_BATCH_STRUCT because this is also emitted + * uncached in brw_draw.c: + */ + BRW_BATCH_STRUCT(brw, &bdr); } const struct brw_tracked_state brw_drawing_rect = { diff --git a/src/mesa/drivers/dri/i965/brw_tex.c b/src/mesa/drivers/dri/i965/brw_tex.c index d70b2ea87a5..8332d869e1d 100644 --- a/src/mesa/drivers/dri/i965/brw_tex.c +++ b/src/mesa/drivers/dri/i965/brw_tex.c @@ -49,34 +49,57 @@ static const struct gl_texture_format * brwChooseTextureFormat( GLcontext *ctx, GLint internalFormat, - GLenum format, GLenum type ) + GLenum srcFormat, GLenum srcType ) { switch ( internalFormat ) { case 4: case GL_RGBA: case GL_COMPRESSED_RGBA: + if (srcFormat == GL_BGRA && srcType == GL_UNSIGNED_SHORT_4_4_4_4_REV) + return &_mesa_texformat_argb4444; + else if (srcFormat == GL_BGRA && srcType == GL_UNSIGNED_SHORT_1_5_5_5_REV) + return &_mesa_texformat_argb1555; + else if ((srcFormat == GL_RGBA && srcType == GL_UNSIGNED_INT_8_8_8_8_REV) || + (srcFormat == GL_RGBA && srcType == GL_UNSIGNED_BYTE) || + (srcFormat == GL_ABGR_EXT && srcType == GL_UNSIGNED_INT_8_8_8_8)) + return &_mesa_texformat_rgba8888_rev; + else + return &_mesa_texformat_argb8888; + case GL_RGBA8: case GL_RGB10_A2: case GL_RGBA12: case GL_RGBA16: - case GL_RGBA4: - case GL_RGBA2: - case GL_RGB5_A1: return &_mesa_texformat_argb8888; -/* return &_mesa_texformat_rgba8888_rev; */ - case 3: - case GL_RGB: - case GL_COMPRESSED_RGB: case GL_RGB8: case GL_RGB10: case GL_RGB12: case GL_RGB16: + /* Broadwater doesn't support RGB888 textures, so these must be + * stored as ARGB. + */ + return &_mesa_texformat_argb8888; + + case 3: + case GL_COMPRESSED_RGB: + case GL_RGB: + if (srcFormat == GL_RGB && + srcType == GL_UNSIGNED_SHORT_5_6_5) + return &_mesa_texformat_rgb565; + else + return &_mesa_texformat_argb8888; + + case GL_RGB5: - case GL_RGB4: + case GL_RGB5_A1: + return &_mesa_texformat_argb1555; + case GL_R3_G3_B2: -/* return &_mesa_texformat_rgb888; */ - return &_mesa_texformat_argb8888; + case GL_RGBA2: + case GL_RGBA4: + case GL_RGB4: + return &_mesa_texformat_argb4444; case GL_ALPHA: case GL_ALPHA4: @@ -115,8 +138,8 @@ brwChooseTextureFormat( GLcontext *ctx, GLint internalFormat, return &_mesa_texformat_i8; case GL_YCBCR_MESA: - if (type == GL_UNSIGNED_SHORT_8_8_MESA || - type == GL_UNSIGNED_BYTE) + if (srcType == GL_UNSIGNED_SHORT_8_8_MESA || + srcType == GL_UNSIGNED_BYTE) return &_mesa_texformat_ycbcr; else return &_mesa_texformat_ycbcr_rev; diff --git a/src/mesa/drivers/dri/i965/brw_tex_layout.c b/src/mesa/drivers/dri/i965/brw_tex_layout.c index f8aa068241b..1353325afff 100644 --- a/src/mesa/drivers/dri/i965/brw_tex_layout.c +++ b/src/mesa/drivers/dri/i965/brw_tex_layout.c @@ -138,13 +138,16 @@ GLboolean brw_miptree_layout( struct intel_mipmap_tree *mt ) /* Layout_below: step right after second mipmap. */ - if (level == mt->first_level + 1) + if (level == mt->first_level + 1) { x += mt->pitch / 2; + x = (x + 3) & ~ 3; + } else { y += img_height; + y += align_h - 1; + y &= ~(align_h - 1); } - width = minify(width); height = minify(height); } diff --git a/src/mesa/drivers/dri/i965/brw_util.c b/src/mesa/drivers/dri/i965/brw_util.c index 5957b717218..9d12c26486d 100644 --- a/src/mesa/drivers/dri/i965/brw_util.c +++ b/src/mesa/drivers/dri/i965/brw_util.c @@ -98,6 +98,8 @@ static GLuint brw_parameter_state_flags(const enum state_index state[]) switch (state[1]) { case STATE_NORMAL_SCALE: return _NEW_MODELVIEW; + case STATE_TEXRECT_SCALE: + return _NEW_TEXTURE; default: assert(0); return 0; diff --git a/src/mesa/drivers/dri/i965/brw_vs.c b/src/mesa/drivers/dri/i965/brw_vs.c index 2a94ac64965..e5a28b96e32 100644 --- a/src/mesa/drivers/dri/i965/brw_vs.c +++ b/src/mesa/drivers/dri/i965/brw_vs.c @@ -105,6 +105,11 @@ static void brw_upload_vs_prog( struct brw_context *brw ) key.copy_edgeflag = (brw->attribs.Polygon->FrontMode != GL_FILL || brw->attribs.Polygon->BackMode != GL_FILL); + /* BRW_NEW_METAOPS + */ + if (brw->metaops.active) + key.know_w_is_one = 1; + /* Make an early check for the key. */ if (brw_search_cache(&brw->cache[BRW_VS_PROG], @@ -122,7 +127,7 @@ static void brw_upload_vs_prog( struct brw_context *brw ) const struct brw_tracked_state brw_vs_prog = { .dirty = { .mesa = _NEW_TRANSFORM | _NEW_POLYGON, - .brw = BRW_NEW_VERTEX_PROGRAM, + .brw = BRW_NEW_VERTEX_PROGRAM | BRW_NEW_METAOPS, .cache = 0 }, .update = brw_upload_vs_prog diff --git a/src/mesa/drivers/dri/i965/brw_vs.h b/src/mesa/drivers/dri/i965/brw_vs.h index d355681b5ea..fdb5785d67d 100644 --- a/src/mesa/drivers/dri/i965/brw_vs.h +++ b/src/mesa/drivers/dri/i965/brw_vs.h @@ -43,7 +43,8 @@ struct brw_vs_prog_key { GLuint program_string_id; GLuint nr_userclip:4; GLuint copy_edgeflag:1; - GLuint pad:27; + GLuint know_w_is_one:1; + GLuint pad:26; }; diff --git a/src/mesa/drivers/dri/i965/brw_vs_emit.c b/src/mesa/drivers/dri/i965/brw_vs_emit.c index a22740084d3..da9d3bacb0e 100644 --- a/src/mesa/drivers/dri/i965/brw_vs_emit.c +++ b/src/mesa/drivers/dri/i965/brw_vs_emit.c @@ -797,13 +797,21 @@ static void emit_vertex_write( struct brw_vs_compile *c) /* Build ndc coords? TODO: Shortcircuit when w is known to be one. */ - ndc = get_tmp(c); - emit_math1(c, BRW_MATH_FUNCTION_INV, ndc, brw_swizzle1(pos, 3), BRW_MATH_PRECISION_FULL); - brw_MUL(p, brw_writemask(ndc, WRITEMASK_XYZ), pos, ndc); + if (!c->key.know_w_is_one) { + ndc = get_tmp(c); + emit_math1(c, BRW_MATH_FUNCTION_INV, ndc, brw_swizzle1(pos, 3), BRW_MATH_PRECISION_FULL); + brw_MUL(p, brw_writemask(ndc, WRITEMASK_XYZ), pos, ndc); + } + else { + ndc = pos; + } /* This includes the workaround for -ve rhw, so is no longer an * optional step: */ + if ((c->prog_data.outputs_written & (1<key.nr_userclip || + !c->key.know_w_is_one) { struct brw_reg header1 = retype(get_tmp(c), BRW_REGISTER_TYPE_UD); GLuint i; @@ -836,20 +844,17 @@ static void emit_vertex_write( struct brw_vs_compile *c) * Later, clipping will detect ucp[6] and ensure the primitive is * clipped against all fixed planes. */ - brw_CMP(p, - vec8(brw_null_reg()), - BRW_CONDITIONAL_L, - brw_swizzle1(ndc, 3), - brw_imm_f(0)); + if (!c->key.know_w_is_one) { + brw_CMP(p, + vec8(brw_null_reg()), + BRW_CONDITIONAL_L, + brw_swizzle1(ndc, 3), + brw_imm_f(0)); - brw_OR(p, brw_writemask(header1, WRITEMASK_W), header1, brw_imm_ud(1<<6)); - brw_MOV(p, ndc, brw_imm_f(0)); - brw_set_predicate_control(p, BRW_PREDICATE_NONE); - - - - - + brw_OR(p, brw_writemask(header1, WRITEMASK_W), header1, brw_imm_ud(1<<6)); + brw_MOV(p, ndc, brw_imm_f(0)); + brw_set_predicate_control(p, BRW_PREDICATE_NONE); + } brw_set_access_mode(p, BRW_ALIGN_1); /* why? */ brw_MOV(p, retype(brw_message_reg(1), BRW_REGISTER_TYPE_UD), header1); @@ -857,6 +862,9 @@ static void emit_vertex_write( struct brw_vs_compile *c) release_tmp(c, header1); } + else { + brw_MOV(p, retype(brw_message_reg(1), BRW_REGISTER_TYPE_UD), brw_imm_ud(0)); + } /* Emit the (interleaved) headers for the two vertices - an 8-reg diff --git a/src/mesa/drivers/dri/i965/brw_vs_tnl.c b/src/mesa/drivers/dri/i965/brw_vs_tnl.c index c1099d4c676..1df111f6457 100644 --- a/src/mesa/drivers/dri/i965/brw_vs_tnl.c +++ b/src/mesa/drivers/dri/i965/brw_vs_tnl.c @@ -535,6 +535,7 @@ static void emit_op3fn(struct tnl_program *p, { struct prog_instruction *inst = &p->program->Base.Instructions[nr]; + memset(inst, 0, sizeof(*inst)); inst->Opcode = op; inst->StringPos = 0; inst->Data = 0; diff --git a/src/mesa/drivers/dri/i965/brw_wm.h b/src/mesa/drivers/dri/i965/brw_wm.h index 74c3bbe2047..ec6ad6105ca 100644 --- a/src/mesa/drivers/dri/i965/brw_wm.h +++ b/src/mesa/drivers/dri/i965/brw_wm.h @@ -167,6 +167,7 @@ struct brw_wm_instruction { #define WM_CINTERP (MAX_OPCODE + 5) #define WM_WPOSXY (MAX_OPCODE + 6) #define WM_FB_WRITE (MAX_OPCODE + 7) +#define MAX_WM_OPCODE (MAX_OPCODE + 8) #define PROGRAM_PAYLOAD (PROGRAM_FILE_MAX) #define PAYLOAD_DEPTH (FRAG_ATTRIB_MAX) diff --git a/src/mesa/drivers/dri/i965/brw_wm_debug.c b/src/mesa/drivers/dri/i965/brw_wm_debug.c index 6b0096eca58..9a6154b3336 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_debug.c +++ b/src/mesa/drivers/dri/i965/brw_wm_debug.c @@ -36,66 +36,6 @@ #include "shader/arbprogparse.h" #include "shader/program_instruction.h" -static const char *fp_opcode_string[] = { - "ABS", /* ARB_f_p only */ - "ADD", - "CMP", /* ARB_f_p only */ - "COS", - "DDX", /* NV_f_p only */ - "DDY", /* NV_f_p only */ - "DP3", - "DP4", - "DPH", /* ARB_f_p only */ - "DST", - "END", /* private opcode */ - "EX2", - "FLR", - "FRC", - "KIL", /* ARB_f_p only */ - "KIL_NV", /* NV_f_p only */ - "LG2", - "LIT", - "LRP", - "MAD", - "MAX", - "MIN", - "MOV", - "MUL", - "PK2H", /* NV_f_p only */ - "PK2US", /* NV_f_p only */ - "PK4B", /* NV_f_p only */ - "PK4UB", /* NV_f_p only */ - "POW", - "PRINT", /* Mesa only */ - "RCP", - "RFL", /* NV_f_p only */ - "RSQ", - "SCS", /* ARB_f_p only */ - "SEQ", /* NV_f_p only */ - "SFL", /* NV_f_p only */ - "SGE", /* NV_f_p only */ - "SGT", /* NV_f_p only */ - "SIN", - "SLE", /* NV_f_p only */ - "SLT", - "SNE", /* NV_f_p only */ - "STR", /* NV_f_p only */ - "SUB", - "SWZ", /* ARB_f_p only */ - "TEX", - "TXB", /* ARB_f_p only */ - "TXD", /* NV_f_p only */ - "TXP", /* ARB_f_p only */ - "TXP_NV", /* NV_f_p only */ - "UP2H", /* NV_f_p only */ - "UP2US", /* NV_f_p only */ - "UP4B", /* NV_f_p only */ - "UP4UB", /* NV_f_p only */ - "X2D", /* NV_f_p only - 2d mat mul */ - "XPD", /* ARB_f_p only - cross product */ -}; - - void brw_wm_print_value( struct brw_wm_compile *c, struct brw_wm_value *value ) @@ -194,7 +134,7 @@ void brw_wm_print_insn( struct brw_wm_compile *c, _mesa_printf(" = FB_WRITE"); break; default: - _mesa_printf(" = %s", fp_opcode_string[inst->opcode]); + _mesa_printf(" = %s", _mesa_opcode_string(inst->opcode)); break; } diff --git a/src/mesa/drivers/dri/i965/brw_wm_fp.c b/src/mesa/drivers/dri/i965/brw_wm_fp.c index 203eeead0f3..04c7555b9b8 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_fp.c +++ b/src/mesa/drivers/dri/i965/brw_wm_fp.c @@ -60,9 +60,11 @@ static const char *wm_opcode_strings[] = { "FB_WRITE" }; +#if 0 static const char *wm_file_strings[] = { "PAYLOAD" }; +#endif /*********************************************************************** @@ -520,6 +522,35 @@ static void precalc_lit( struct brw_wm_compile *c, static void precalc_tex( struct brw_wm_compile *c, const struct prog_instruction *inst ) { + struct prog_src_register coord; + struct prog_dst_register tmpcoord; + + if (inst->TexSrcTarget == TEXTURE_RECT_INDEX) { + struct prog_src_register scale = + search_or_add_param6( c, + STATE_INTERNAL, + STATE_TEXRECT_SCALE, + inst->TexSrcUnit, + 0,0,0 ); + + tmpcoord = get_temp(c); + + /* coord.xy = MUL inst->SrcReg[0], { 1/width, 1/height } + */ + emit_op(c, + OPCODE_MUL, + tmpcoord, + 0, 0, 0, + inst->SrcReg[0], + scale, + src_undef()); + + coord = src_reg_from_dst(tmpcoord); + } + else { + coord = inst->SrcReg[0]; + } + /* Need to emit YUV texture conversions by hand. Probably need to * do this here - the alternative is in brw_wm_emit.c, but the * conversion requires allocating a temporary variable which we @@ -532,7 +563,7 @@ static void precalc_tex( struct brw_wm_compile *c, inst->SaturateMode, inst->TexSrcUnit, inst->TexSrcTarget, - inst->SrcReg[0], + coord, src_undef(), src_undef()); } @@ -604,7 +635,12 @@ static void precalc_tex( struct brw_wm_compile *c, src_swizzle1(tmpsrc, Z), src_swizzle1(C1, W), src_swizzle1(src_reg_from_dst(dst), Y)); + + release_temp(c, tmp); } + + if (inst->TexSrcTarget == GL_TEXTURE_RECTANGLE_NV) + release_temp(c, tmpcoord); } @@ -769,6 +805,27 @@ static void validate_src_regs( struct brw_wm_compile *c, +static void print_insns( const struct prog_instruction *insn, + GLuint nr ) +{ + GLuint i; + for (i = 0; i < nr; i++, insn++) { + _mesa_printf("%3d: ", i); + if (insn->Opcode < MAX_OPCODE) + _mesa_print_instruction(insn); + else if (insn->Opcode < MAX_WM_OPCODE) { + GLuint idx = insn->Opcode - MAX_OPCODE; + + _mesa_print_alu_instruction(insn, + wm_opcode_strings[idx], + 3); + } + else + _mesa_printf("UNKNOWN\n"); + + } +} + void brw_wm_pass_fp( struct brw_wm_compile *c ) { struct brw_fragment_program *fp = c->fp; @@ -867,7 +924,7 @@ void brw_wm_pass_fp( struct brw_wm_compile *c ) if (INTEL_DEBUG & DEBUG_WM) { _mesa_printf("\n\n\npass_fp:\n"); -/* _mesa_debug_fp_inst(c->nr_fp_insns, c->prog_instructions, wm_opcode_strings, wm_file_strings); */ + print_insns( c->prog_instructions, c->nr_fp_insns ); _mesa_printf("\n"); } } diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c index 6ccf56e41a2..5c7dc500cab 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c @@ -85,7 +85,8 @@ static GLuint translate_tex_format( GLuint mesa_format ) return BRW_SURFACEFORMAT_L8A8_UNORM; case MESA_FORMAT_RGB888: - return BRW_SURFACEFORMAT_R8G8B8_UNORM; + assert(0); /* not supported for sampling */ + return BRW_SURFACEFORMAT_R8G8B8_UNORM; case MESA_FORMAT_ARGB8888: return BRW_SURFACEFORMAT_B8G8R8A8_UNORM; @@ -93,6 +94,15 @@ static GLuint translate_tex_format( GLuint mesa_format ) case MESA_FORMAT_RGBA8888_REV: return BRW_SURFACEFORMAT_R8G8B8A8_UNORM; + case MESA_FORMAT_RGB565: + return BRW_SURFACEFORMAT_B5G6R5_UNORM; + + case MESA_FORMAT_ARGB1555: + return BRW_SURFACEFORMAT_B5G5R5A1_UNORM; + + case MESA_FORMAT_ARGB4444: + return BRW_SURFACEFORMAT_B4G4R4A4_UNORM; + case MESA_FORMAT_YCBCR_REV: return BRW_SURFACEFORMAT_YCRCB_NORMAL; diff --git a/src/mesa/drivers/dri/i965/bufmgr.h b/src/mesa/drivers/dri/i965/bufmgr.h index 83a810cc6dd..6932522d3d3 100644 --- a/src/mesa/drivers/dri/i965/bufmgr.h +++ b/src/mesa/drivers/dri/i965/bufmgr.h @@ -182,6 +182,8 @@ void bmUnmapBufferAUB( struct intel_context *, int bmValidateBuffers( struct intel_context * ); void bmReleaseBuffers( struct intel_context * ); +GLuint bmCtxId( struct intel_context *intel ); + GLboolean bmError( struct intel_context * ); void bmEvictAll( struct intel_context * ); diff --git a/src/mesa/drivers/dri/i965/bufmgr_fake.c b/src/mesa/drivers/dri/i965/bufmgr_fake.c index 8f182f3d877..ed88ab3797a 100644 --- a/src/mesa/drivers/dri/i965/bufmgr_fake.c +++ b/src/mesa/drivers/dri/i965/bufmgr_fake.c @@ -117,6 +117,7 @@ struct bufmgr { struct block fenced; /* after bmFenceBuffers (mi_flush, emit irq, write dword) */ /* then to pool->lru or free() */ + unsigned ctxId; unsigned last_fence; unsigned free_on_hardware; @@ -578,6 +579,12 @@ struct bufmgr *bm_fake_intel_Attach( struct intel_context *intel ) make_empty_list(&bm.referenced); make_empty_list(&bm.fenced); make_empty_list(&bm.on_hardware); + + /* The context id of any of the share group. This won't be used + * in communication with the kernel, so it doesn't matter if + * this context is eventually deleted. + */ + bm.ctxId = intel->hHWContext; } nr_attach++; @@ -1242,7 +1249,6 @@ void bmReleaseBuffers( struct intel_context *intel ) LOCK(bm); { struct block *block, *tmp; - assert(intel->locked); foreach_s (block, tmp, &bm->referenced) { @@ -1301,7 +1307,7 @@ unsigned bmSetFence( struct intel_context *intel ) GLuint dword[2]; dword[0] = intel->vtbl.flush_cmd(); dword[1] = 0; - intel_cmd_ioctl(intel, (char *)&dword, sizeof(dword), GL_TRUE); + intel_cmd_ioctl(intel, (char *)&dword, sizeof(dword)); intel->bm->last_fence = intelEmitIrqLocked( intel ); @@ -1432,3 +1438,9 @@ GLboolean bmError( struct intel_context *intel ) return retval; } + + +GLuint bmCtxId( struct intel_context *intel ) +{ + return intel->bm->ctxId; +} diff --git a/src/mesa/drivers/dri/i965/intel_batchbuffer.c b/src/mesa/drivers/dri/i965/intel_batchbuffer.c index 598ce08735d..64885ed9b4b 100644 --- a/src/mesa/drivers/dri/i965/intel_batchbuffer.c +++ b/src/mesa/drivers/dri/i965/intel_batchbuffer.c @@ -128,7 +128,6 @@ GLboolean intel_batchbuffer_flush( struct intel_batchbuffer *batch ) struct intel_context *intel = batch->intel; GLuint used = batch->ptr - (batch->map + batch->offset); GLuint offset; - GLboolean ignore_cliprects = (batch->flags & INTEL_BATCH_CLIPRECTS) ? GL_FALSE : GL_TRUE; GLint retval = GL_TRUE; assert(intel->locked); @@ -138,22 +137,6 @@ GLboolean intel_batchbuffer_flush( struct intel_batchbuffer *batch ) return GL_TRUE; } - /* Throw away non-effective packets. - */ - if (intel->numClipRects == 0 && !ignore_cliprects) { - batch->ptr = batch->map + batch->offset; - bmReleaseBuffers( batch->intel ); - intel->vtbl.lost_hardware(intel); - batch->flags = 0; - - UNLOCK_HARDWARE(intel); - sched_yield(); - LOCK_HARDWARE(intel); - - return GL_TRUE; - } - - /* Add the MI_BATCH_BUFFER_END. Always add an MI_FLUSH - this is a * performance drain that we would like to avoid. */ @@ -204,8 +187,7 @@ GLboolean intel_batchbuffer_flush( struct intel_batchbuffer *batch ) */ intel_batch_ioctl(batch->intel, offset + batch->offset, - used, - ignore_cliprects); + used); if (intel->aub_file && intel->ctx.DrawBuffer->_ColorDrawBufferMask[0] == BUFFER_BIT_FRONT_LEFT) diff --git a/src/mesa/drivers/dri/i965/intel_batchbuffer.h b/src/mesa/drivers/dri/i965/intel_batchbuffer.h index 7a9ead3e373..25e0a65e99f 100644 --- a/src/mesa/drivers/dri/i965/intel_batchbuffer.h +++ b/src/mesa/drivers/dri/i965/intel_batchbuffer.h @@ -46,7 +46,7 @@ struct intel_batchbuffer { struct buffer *buffer; GLuint flags; - GLuint offset; + unsigned long offset; GLubyte *map; GLubyte *ptr; diff --git a/src/mesa/drivers/dri/i965/intel_blit.c b/src/mesa/drivers/dri/i965/intel_blit.c index 2191dd585e1..0974f1f80ad 100644 --- a/src/mesa/drivers/dri/i965/intel_blit.c +++ b/src/mesa/drivers/dri/i965/intel_blit.c @@ -39,6 +39,7 @@ #include "intel_context.h" #include "intel_blit.h" #include "intel_regions.h" +#include "intel_structs.h" #include "bufmgr.h" @@ -74,9 +75,6 @@ void intelCopyBuffer( const __DRIdrawablePrivate *dPriv, if (!rect) { - /* This is a really crappy way to do wait-for-vblank. I guess - * it sortof works in the single-application case. - */ UNLOCK_HARDWARE( intel ); driWaitForVBlank( dPriv, &intel->vbl_seq, intel->vblank_flags, & missed_target ); LOCK_HARDWARE( intel ); @@ -291,8 +289,12 @@ void intelEmitCopyBlit( struct intel_context *intel, /* Initial y values don't seem to work with negative pitches. If * we adjust the offsets manually (below), it seems to work fine. + * + * On the other hand, if we always adjust, the hardware doesn't + * know which blit directions to use, so overlapping copypixels get + * the wrong result. */ - if (0) { + if (dst_pitch > 0 && src_pitch > 0) { BEGIN_BATCH(8, INTEL_BATCH_NO_CLIPRECTS); OUT_BATCH( CMD ); OUT_BATCH( dst_pitch | BR13 ); @@ -320,14 +322,14 @@ void intelEmitCopyBlit( struct intel_context *intel, -void intelClearWithBlit(GLcontext *ctx, GLbitfield flags, GLboolean all, - GLint cx1, GLint cy1, GLint cw, GLint ch) +void intelClearWithBlit(GLcontext *ctx, GLbitfield flags) { struct intel_context *intel = intel_context( ctx ); intelScreenPrivate *intelScreen = intel->intelScreen; GLuint clear_depth, clear_color; - GLint cx, cy; + GLint cx, cy, cw, ch; GLint cpp = intelScreen->cpp; + GLboolean all; GLint i; struct intel_region *front = intel->front_region; struct intel_region *back = intel->back_region; @@ -374,21 +376,16 @@ void intelClearWithBlit(GLcontext *ctx, GLbitfield flags, GLboolean all, intelFlush( &intel->ctx ); LOCK_HARDWARE( intel ); { - /* Refresh the cx/y/w/h values as they may have been invalidated - * by a new window position or size picked up when we did - * LOCK_HARDWARE above. The values passed by mesa are not - * reliable. - */ - { - cx = ctx->DrawBuffer->_Xmin; - cy = ctx->DrawBuffer->_Ymin; - ch = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin; - cw = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin; - } + /* get clear bounds after locking */ + cx = ctx->DrawBuffer->_Xmin; + cy = ctx->DrawBuffer->_Ymin; + ch = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin; + cw = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin; + all = (cw == ctx->DrawBuffer->Width && ch == ctx->DrawBuffer->Height); /* flip top to bottom */ - cy = intel->driDrawable->h-cy1-ch; - cx = cx1 + intel->drawX; + cy = intel->driDrawable->h - cy - ch; + cx = cx + intel->drawX; cy += intel->drawY; /* adjust for page flipping */ @@ -492,3 +489,98 @@ void intelClearWithBlit(GLcontext *ctx, GLbitfield flags, GLboolean all, } + +#define BR13_565 0x1 +#define BR13_8888 0x3 + + +void +intelEmitImmediateColorExpandBlit(struct intel_context *intel, + GLuint cpp, + GLubyte *src_bits, GLuint src_size, + GLuint fg_color, + GLshort dst_pitch, + struct buffer *dst_buffer, + GLuint dst_offset, + GLboolean dst_tiled, + GLshort x, GLshort y, + GLshort w, GLshort h) +{ + struct xy_setup_blit setup; + struct xy_text_immediate_blit text; + int dwords = ((src_size + 7) & ~7) / 4; + + + if (w < 0 || h < 0) + return; + + dst_pitch *= cpp; + + if (dst_tiled) + dst_pitch /= 4; + + DBG("%s dst:buf(%p)/%d+%d %d,%d sz:%dx%d, %d bytes %d dwords\n", + __FUNCTION__, + dst_buffer, dst_pitch, dst_offset, x, y, w, h, src_size, dwords); + + memset(&setup, 0, sizeof(setup)); + + setup.br0.client = CLIENT_2D; + setup.br0.opcode = OPCODE_XY_SETUP_BLT; + setup.br0.write_alpha = (cpp == 4); + setup.br0.write_rgb = (cpp == 4); + setup.br0.dst_tiled = dst_tiled; + setup.br0.length = (sizeof(setup) / sizeof(int)) - 2; + + setup.br13.dest_pitch = dst_pitch; + setup.br13.rop = 0xcc; + setup.br13.color_depth = (cpp == 4) ? BR13_8888 : BR13_565; + setup.br13.clipping_enable = 0; + setup.br13.mono_source_transparency = 1; + + setup.dw2.clip_y1 = 0; + setup.dw2.clip_x1 = 0; + setup.dw3.clip_y2 = 100; + setup.dw3.clip_x2 = 100; + + setup.dest_base_addr = bmBufferOffset(intel, dst_buffer) + dst_offset; + setup.background_color = 0; + setup.foreground_color = fg_color; + setup.pattern_base_addr = 0; + + memset(&text, 0, sizeof(text)); + text.dw0.client = CLIENT_2D; + text.dw0.opcode = OPCODE_XY_TEXT_IMMEDIATE_BLT; + text.dw0.pad0 = 0; + text.dw0.byte_packed = 1; /* ?maybe? */ + text.dw0.pad1 = 0; + text.dw0.dst_tiled = dst_tiled; + text.dw0.pad2 = 0; + text.dw0.length = (sizeof(text)/sizeof(int)) - 2 + dwords; + text.dw1.dest_y1 = y; /* duplicates info in setup blit */ + text.dw1.dest_x1 = x; + text.dw2.dest_y2 = y + h; + text.dw2.dest_x2 = x + w; + + intel_batchbuffer_require_space( intel->batch, + sizeof(setup) + + sizeof(text) + + dwords, + INTEL_BATCH_NO_CLIPRECTS ); + + intel_batchbuffer_data( intel->batch, + &setup, + sizeof(setup), + INTEL_BATCH_NO_CLIPRECTS ); + + intel_batchbuffer_data( intel->batch, + &text, + sizeof(text), + INTEL_BATCH_NO_CLIPRECTS ); + + intel_batchbuffer_data( intel->batch, + src_bits, + dwords * 4, + INTEL_BATCH_NO_CLIPRECTS ); +} + diff --git a/src/mesa/drivers/dri/i965/intel_blit.h b/src/mesa/drivers/dri/i965/intel_blit.h index 357ceb4c512..b15fb1c2b7f 100644 --- a/src/mesa/drivers/dri/i965/intel_blit.h +++ b/src/mesa/drivers/dri/i965/intel_blit.h @@ -35,8 +35,7 @@ struct buffer; extern void intelCopyBuffer( const __DRIdrawablePrivate *dpriv, const drm_clip_rect_t *rect ); -extern void intelClearWithBlit(GLcontext *ctx, GLbitfield mask, GLboolean all, - GLint cx1, GLint cy1, GLint cw, GLint ch); +extern void intelClearWithBlit(GLcontext *ctx, GLbitfield mask); extern void intelEmitCopyBlit( struct intel_context *intel, GLuint cpp, @@ -62,5 +61,16 @@ extern void intelEmitFillBlit( struct intel_context *intel, GLshort w, GLshort h, GLuint color ); +void +intelEmitImmediateColorExpandBlit(struct intel_context *intel, + GLuint cpp, + GLubyte *src_bits, GLuint src_size, + GLuint fg_color, + GLshort dst_pitch, + struct buffer *dst_buffer, + GLuint dst_offset, + GLboolean dst_tiled, + GLshort dst_x, GLshort dst_y, + GLshort w, GLshort h); #endif diff --git a/src/mesa/drivers/dri/i965/intel_buffers.c b/src/mesa/drivers/dri/i965/intel_buffers.c index 853956671ce..d155c039d77 100644 --- a/src/mesa/drivers/dri/i965/intel_buffers.c +++ b/src/mesa/drivers/dri/i965/intel_buffers.c @@ -210,6 +210,12 @@ void intelWindowMoved( struct intel_context *intel ) intel->NewGLState |= _NEW_SCISSOR; } + + /* This works because the lock is always grabbed before emitting + * commands and commands are always flushed prior to releasing + * the lock. + */ + intel->NewGLState |= _NEW_WINDOW_POS; } @@ -218,12 +224,11 @@ void intelWindowMoved( struct intel_context *intel ) * machine independent. Maybe we'll get there one day. */ static void intelClearWithTris(struct intel_context *intel, - GLbitfield mask, - GLboolean all, - GLint cx, GLint cy, - GLint cw, GLint ch) + GLbitfield mask) { + GLcontext *ctx = &intel->ctx; drm_clip_rect_t clear; + GLint cx, cy, cw, ch; if (INTEL_DEBUG & DEBUG_DRI) _mesa_printf("%s %x\n", __FUNCTION__, mask); @@ -232,18 +237,11 @@ static void intelClearWithTris(struct intel_context *intel, intel->vtbl.install_meta_state(intel); - /* Refresh the cx/y/w/h values as they may have been invalidated - * by a new window position or size picked up when we did - * LOCK_HARDWARE above. The values passed by mesa are not - * reliable. - */ - { - GLcontext *ctx = &intel->ctx; - cx = ctx->DrawBuffer->_Xmin; - cy = ctx->DrawBuffer->_Ymin; - ch = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin; - cw = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin; - } + /* Get clear bounds after locking */ + cx = ctx->DrawBuffer->_Xmin; + cy = ctx->DrawBuffer->_Ymin; + cw = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin; + ch = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin; clear.x1 = cx; clear.y1 = cy; @@ -321,11 +319,7 @@ static void intelClearWithTris(struct intel_context *intel, -static void intelClear(GLcontext *ctx, - GLbitfield mask, - GLboolean all, - GLint cx, GLint cy, - GLint cw, GLint ch) +static void intelClear(GLcontext *ctx, GLbitfield mask) { struct intel_context *intel = intel_context( ctx ); const GLuint colorMask = *((GLuint *) &ctx->Color.ColorMask); @@ -334,8 +328,7 @@ static void intelClear(GLcontext *ctx, GLbitfield swrast_mask = 0; if (INTEL_DEBUG & DEBUG_DRI) - fprintf(stderr, "%s %x all %d dims %d,%d %dx%d\n", __FUNCTION__, - mask, all, cx, cy, cw, ch); + fprintf(stderr, "%s %x\n", __FUNCTION__, mask); if (mask & BUFFER_BIT_FRONT_LEFT) { @@ -386,13 +379,13 @@ static void intelClear(GLcontext *ctx, intelFlush( ctx ); if (blit_mask) - intelClearWithBlit( ctx, blit_mask, all, cx, cy, cw, ch ); + intelClearWithBlit( ctx, blit_mask ); if (tri_mask) - intelClearWithTris( intel, tri_mask, all, cx, cy, cw, ch); + intelClearWithTris( intel, tri_mask ); if (swrast_mask) - _swrast_Clear( ctx, swrast_mask, all, cx, cy, cw, ch ); + _swrast_Clear( ctx, swrast_mask ); } @@ -549,7 +542,6 @@ void intelInitBufferFuncs( struct dd_function_table *functions ) { functions->Clear = intelClear; functions->GetBufferSize = intelBufferSize; - functions->ResizeBuffers = _mesa_resize_framebuffer; functions->DrawBuffer = intelDrawBuffer; functions->ReadBuffer = intelReadBuffer; } diff --git a/src/mesa/drivers/dri/i965/intel_context.c b/src/mesa/drivers/dri/i965/intel_context.c index 59fc8073eee..36edd7db7f5 100644 --- a/src/mesa/drivers/dri/i965/intel_context.c +++ b/src/mesa/drivers/dri/i965/intel_context.c @@ -149,6 +149,10 @@ const struct dri_extension card_extensions[] = { "GL_ARB_texture_env_combine", NULL }, { "GL_ARB_texture_env_dot3", NULL }, { "GL_ARB_texture_mirrored_repeat", NULL }, + { "GL_ARB_texture_non_power_of_two", NULL }, + { "GL_ARB_texture_rectangle", NULL }, + { "GL_NV_texture_rectangle", NULL }, + { "GL_EXT_texture_rectangle", NULL }, { "GL_ARB_texture_rectangle", NULL }, { "GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions }, { "GL_ARB_vertex_program", GL_ARB_vertex_program_functions }, @@ -246,18 +250,14 @@ void intelInitDriverFunctions( struct dd_function_table *functions ) functions->Finish = intelFinish; functions->GetString = intelGetString; functions->UpdateState = intelInvalidateState; - functions->CopyColorTable = _swrast_CopyColorTable; - functions->CopyColorSubTable = _swrast_CopyColorSubTable; - functions->CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D; - functions->CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D; - /* Pixel path fallbacks. + /* CopyPixels can be accelerated even with the current memory + * manager: */ - functions->Accum = _swrast_Accum; - functions->Bitmap = _swrast_Bitmap; - functions->CopyPixels = _swrast_CopyPixels; - functions->ReadPixels = _swrast_ReadPixels; - functions->DrawPixels = _swrast_DrawPixels; + if (!getenv("INTEL_NO_BLIT")) { + functions->CopyPixels = intelCopyPixels; + functions->Bitmap = intelBitmap; + } intelInitTextureFuncs( functions ); intelInitStateFuncs( functions ); @@ -370,8 +370,6 @@ GLboolean intelInitContext( struct intel_context *intel, exit(1); } - _math_matrix_ctr (&intel->ViewportMatrix); - driInitExtensions( ctx, card_extensions, GL_TRUE ); @@ -446,8 +444,6 @@ GLboolean intelInitContext( struct intel_context *intel, /* DRI_TEXMGR_DO_TEXTURE_RECT ); */ - intel->prim.primitive = ~0; - if (getenv("INTEL_NO_RAST")) { fprintf(stderr, "disabling 3D rasterization\n"); intel->no_rast = 1; @@ -537,18 +533,13 @@ GLboolean intelMakeCurrent(__DRIcontextPrivate *driContextPriv, } -static void lost_hardware( struct intel_context *intel ) -{ - bm_fake_NotifyContendedLockTake( intel ); - intel->vtbl.lost_hardware( intel ); -} - static void intelContendedLock( struct intel_context *intel, GLuint flags ) { __DRIdrawablePrivate *dPriv = intel->driDrawable; __DRIscreenPrivate *sPriv = intel->driScreen; volatile drmI830Sarea * sarea = intel->sarea; int me = intel->hHWContext; + int my_bufmgr = bmCtxId(intel); drmGetLock(intel->driFd, intel->hHWContext, flags); @@ -562,12 +553,23 @@ static void intelContendedLock( struct intel_context *intel, GLuint flags ) intel->locked = 1; + intel->need_flush = 1; /* Lost context? */ if (sarea->ctxOwner != me) { + DBG("Lost Context: sarea->ctxOwner %x me %x\n", sarea->ctxOwner, me); sarea->ctxOwner = me; - lost_hardware(intel); + intel->vtbl.lost_hardware( intel ); + } + + /* As above, but don't evict the texture data on transitions + * between contexts which all share a local buffer manager. + */ + if (sarea->texAge != my_bufmgr) { + DBG("Lost Textures: sarea->texAge %x my_bufmgr %x\n", sarea->ctxOwner, my_bufmgr); + sarea->texAge = my_bufmgr; + bm_fake_NotifyContendedLockTake( intel ); } /* Drawable changed? @@ -575,12 +577,6 @@ static void intelContendedLock( struct intel_context *intel, GLuint flags ) if (dPriv && intel->lastStamp != dPriv->lastStamp) { intelWindowMoved( intel ); intel->lastStamp = dPriv->lastStamp; - - /* This works because the lock is always grabbed before emitting - * commands and commands are always flushed prior to releasing - * the lock. - */ - intel->NewGLState |= _NEW_WINDOW_POS; } } diff --git a/src/mesa/drivers/dri/i965/intel_context.h b/src/mesa/drivers/dri/i965/intel_context.h index 0328cb900a8..2df8faef28e 100644 --- a/src/mesa/drivers/dri/i965/intel_context.h +++ b/src/mesa/drivers/dri/i965/intel_context.h @@ -176,16 +176,6 @@ struct intel_context struct intel_batchbuffer *batch; - struct { - GLuint id; - GLuint primitive; - GLubyte *start_ptr; - void (*flush)( struct intel_context * ); - } prim; - - GLboolean locked; - GLboolean strict_conformance; - GLubyte clear_chan[4]; GLuint ClearColor; GLuint ClearDepth; @@ -201,6 +191,10 @@ struct intel_context GLboolean no_hw; GLboolean no_rast; GLboolean thrashing; + GLboolean locked; + GLboolean strict_conformance; + GLboolean need_flush; + /* AGP memory buffer manager: @@ -210,26 +204,14 @@ struct intel_context /* State for intelvb.c and inteltris.c. */ - GLuint RenderIndex; - GLmatrix ViewportMatrix; GLenum render_primitive; GLenum reduced_primitive; - GLuint vertex_size; - GLubyte *verts; /* points to tnl->clipspace.vertex_buf */ - struct intel_region *front_region; struct intel_region *back_region; struct intel_region *draw_region; struct intel_region *depth_region; - - /* Fallback rasterization functions - */ - intel_point_func draw_point; - intel_line_func draw_line; - intel_tri_func draw_tri; - /* These refer to the current draw (front vs. back) buffer: */ int drawX; /* origin of drawable in draw buffer */ @@ -347,8 +329,8 @@ static inline void * __memcpy(void * to, const void * from, size_t n) */ static inline void *do_memcpy( void *dest, const void *src, size_t n ) { - if ( (((unsigned)src) & 63) || - (((unsigned)dest) & 63)) { + if ( (((unsigned long)src) & 63) || + (((unsigned long)dest) & 63)) { return __memcpy(dest, src, n); } else @@ -496,6 +478,21 @@ extern GLboolean intel_intersect_cliprects( drm_clip_rect_t *dest, const drm_clip_rect_t *b ); +/* ================================================================ + * intel_pixel_copy.c: + */ +void intelCopyPixels(GLcontext * ctx, + GLint srcx, GLint srcy, + GLsizei width, GLsizei height, + GLint destx, GLint desty, GLenum type); + +GLboolean intel_check_blit_fragment_ops(GLcontext * ctx); + +void intelBitmap(GLcontext * ctx, + GLint x, GLint y, + GLsizei width, GLsizei height, + const struct gl_pixelstore_attrib *unpack, + const GLubyte * pixels); #define _NEW_WINDOW_POS 0x40000000 diff --git a/src/mesa/drivers/dri/i965/intel_ioctl.c b/src/mesa/drivers/dri/i965/intel_ioctl.c index 9297543f82b..d1f2e3f27ca 100644 --- a/src/mesa/drivers/dri/i965/intel_ioctl.c +++ b/src/mesa/drivers/dri/i965/intel_ioctl.c @@ -105,8 +105,7 @@ void intelWaitIrq( struct intel_context *intel, int seq ) void intel_batch_ioctl( struct intel_context *intel, GLuint start_offset, - GLuint used, - GLboolean ignore_cliprects) + GLuint used) { drmI830BatchBuffer batch; @@ -114,27 +113,24 @@ void intel_batch_ioctl( struct intel_context *intel, assert(used); if (0) - fprintf(stderr, "%s used %d offset %x..%x ignore_cliprects %d\n", + fprintf(stderr, "%s used %d offset %x..%x\n", __FUNCTION__, used, start_offset, - start_offset + used, - ignore_cliprects); + start_offset + used); batch.start = start_offset; batch.used = used; - batch.cliprects = intel->pClipRects; - batch.num_cliprects = ignore_cliprects ? 0 : intel->numClipRects; + batch.cliprects = NULL; + batch.num_cliprects = 0; batch.DR1 = 0; - batch.DR4 = ((((GLuint)intel->drawX) & 0xffff) | - (((GLuint)intel->drawY) << 16)); + batch.DR4 = 0; if (INTEL_DEBUG & DEBUG_DMA) - fprintf(stderr, "%s: 0x%x..0x%x DR4: %x cliprects: %d\n", + fprintf(stderr, "%s: 0x%x..0x%x\n", __FUNCTION__, batch.start, - batch.start + batch.used * 4, - batch.DR4, batch.num_cliprects); + batch.start + batch.used * 4); if (!intel->no_hw) { if (drmCommandWrite (intel->driFd, DRM_I830_BATCHBUFFER, &batch, @@ -148,8 +144,7 @@ void intel_batch_ioctl( struct intel_context *intel, void intel_cmd_ioctl( struct intel_context *intel, char *buf, - GLuint used, - GLboolean ignore_cliprects) + GLuint used) { drmI830CmdBuffer cmd; @@ -159,17 +154,15 @@ void intel_cmd_ioctl( struct intel_context *intel, cmd.buf = buf; cmd.sz = used; cmd.cliprects = intel->pClipRects; - cmd.num_cliprects = ignore_cliprects ? 0 : intel->numClipRects; + cmd.num_cliprects = 0; cmd.DR1 = 0; - cmd.DR4 = ((((GLuint)intel->drawX) & 0xffff) | - (((GLuint)intel->drawY) << 16)); + cmd.DR4 = 0; if (INTEL_DEBUG & DEBUG_DMA) - fprintf(stderr, "%s: 0x%x..0x%x DR4: %x cliprects: %d\n", + fprintf(stderr, "%s: 0x%x..0x%x\n", __FUNCTION__, 0, - 0 + cmd.sz, - cmd.DR4, cmd.num_cliprects); + 0 + cmd.sz); if (!intel->no_hw) { if (drmCommandWrite (intel->driFd, DRM_I830_CMDBUFFER, &cmd, diff --git a/src/mesa/drivers/dri/i965/intel_ioctl.h b/src/mesa/drivers/dri/i965/intel_ioctl.h index dcebcb06d1d..df276593626 100644 --- a/src/mesa/drivers/dri/i965/intel_ioctl.h +++ b/src/mesa/drivers/dri/i965/intel_ioctl.h @@ -35,12 +35,10 @@ int intelEmitIrqLocked( struct intel_context *intel ); void intel_batch_ioctl( struct intel_context *intel, GLuint start_offset, - GLuint used, - GLboolean ignore_cliprects); + GLuint used); void intel_cmd_ioctl( struct intel_context *intel, char *buf, - GLuint used, - GLboolean ignore_cliprects); + GLuint used); #endif diff --git a/src/mesa/drivers/dri/i965/intel_pixel_bitmap.c b/src/mesa/drivers/dri/i965/intel_pixel_bitmap.c new file mode 100644 index 00000000000..5841afaa3ef --- /dev/null +++ b/src/mesa/drivers/dri/i965/intel_pixel_bitmap.c @@ -0,0 +1,350 @@ +/************************************************************************** + * + * Copyright 2006 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 portionsalloc + * 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. + * + **************************************************************************/ + +#include "glheader.h" +#include "enums.h" +#include "image.h" +#include "colormac.h" +#include "mtypes.h" +#include "macros.h" +#include "bufferobj.h" +#include "swrast/swrast.h" + +#include "intel_screen.h" +#include "intel_context.h" +#include "intel_ioctl.h" +#include "intel_batchbuffer.h" +#include "intel_blit.h" +#include "intel_regions.h" +#include "intel_buffer_objects.h" + + + +#define FILE_DEBUG_FLAG DEBUG_PIXEL + + +/* Unlike the other intel_pixel_* functions, the expectation here is + * that the incoming data is not in a PBO. With the XY_TEXT blit + * method, there's no benefit haveing it in a PBO, but we could + * implement a path based on XY_MONO_SRC_COPY_BLIT which might benefit + * PBO bitmaps. I think they are probably pretty rare though - I + * wonder if Xgl uses them? + */ +static const GLubyte *map_pbo( GLcontext *ctx, + GLsizei width, GLsizei height, + const struct gl_pixelstore_attrib *unpack, + const GLubyte *bitmap ) +{ + GLubyte *buf; + + if (!_mesa_validate_pbo_access(2, unpack, width, height, 1, + GL_COLOR_INDEX, GL_BITMAP, + (GLvoid *) bitmap)) { + _mesa_error(ctx, GL_INVALID_OPERATION,"glBitmap(invalid PBO access)"); + return NULL; + } + + buf = (GLubyte *) ctx->Driver.MapBuffer(ctx, GL_PIXEL_UNPACK_BUFFER_EXT, + GL_READ_ONLY_ARB, + unpack->BufferObj); + if (!buf) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glBitmap(PBO is mapped)"); + return NULL; + } + + return ADD_POINTERS(buf, bitmap); +} + +static GLboolean test_bit( const GLubyte *src, + GLuint bit ) +{ + return (src[bit/8] & (1<<(bit % 8))) ? 1 : 0; +} + +static void set_bit( GLubyte *dest, + GLuint bit ) +{ + dest[bit/8] |= 1 << (bit % 8); +} + +static int align(int x, int align) +{ + return (x + align - 1) & ~(align - 1); +} + +/* Extract a rectangle's worth of data from the bitmap. Called + * per-cliprect. + */ +static GLuint get_bitmap_rect(GLsizei width, GLsizei height, + const struct gl_pixelstore_attrib *unpack, + const GLubyte *bitmap, + GLuint x, GLuint y, + GLuint w, GLuint h, + GLubyte *dest, + GLuint row_align, + GLboolean invert) +{ + GLuint src_offset = (x + unpack->SkipPixels) & 0x7; + GLuint mask = unpack->LsbFirst ? 0 : 7; + GLuint bit = 0; + GLint row, col; + GLint first, last; + GLint incr; + GLuint count = 0; + + if (INTEL_DEBUG & DEBUG_PIXEL) + _mesa_printf("%s %d,%d %dx%d bitmap %dx%d skip %d src_offset %d mask %d\n", + __FUNCTION__, x,y,w,h,width,height,unpack->SkipPixels, src_offset, mask); + + if (invert) { + first = h-1; + last = 0; + incr = -1; + } + else { + first = 0; + last = h-1; + incr = 1; + } + + /* Require that dest be pre-zero'd. + */ + for (row = first; row != (last+incr); row += incr) { + const GLubyte *rowsrc = _mesa_image_address2d(unpack, bitmap, + width, height, + GL_COLOR_INDEX, GL_BITMAP, + y + row, x); + + for (col = 0; col < w; col++, bit++) { + if (test_bit(rowsrc, (col + src_offset) ^ mask)) { + set_bit(dest, bit ^ 7); + count++; + } + } + + if (row_align) + bit = (bit + row_align - 1) & ~(row_align - 1); + } + + return count; +} + + + + +/* + * Render a bitmap. + */ +static GLboolean +do_blit_bitmap( GLcontext *ctx, + GLint dstx, GLint dsty, + GLsizei width, GLsizei height, + const struct gl_pixelstore_attrib *unpack, + const GLubyte *bitmap ) +{ + struct intel_context *intel = intel_context(ctx); + struct intel_region *dst = intel_drawbuf_region(intel); + + union { + GLuint ui; + GLubyte ub[4]; + } color; + + + if (unpack->BufferObj->Name) { + bitmap = map_pbo(ctx, width, height, unpack, bitmap); + if (bitmap == NULL) + return GL_TRUE; /* even though this is an error, we're done */ + } + + UNCLAMPED_FLOAT_TO_CHAN(color.ub[0], ctx->Current.RasterColor[2]); + UNCLAMPED_FLOAT_TO_CHAN(color.ub[1], ctx->Current.RasterColor[1]); + UNCLAMPED_FLOAT_TO_CHAN(color.ub[2], ctx->Current.RasterColor[0]); + UNCLAMPED_FLOAT_TO_CHAN(color.ub[3], ctx->Current.RasterColor[3]); + + /* Does zoom apply to bitmaps? + */ + if (!intel_check_blit_fragment_ops(ctx) || + ctx->Pixel.ZoomX != 1.0F || + ctx->Pixel.ZoomY != 1.0F) + return GL_FALSE; + + LOCK_HARDWARE(intel); + + if (intel->driDrawable->numClipRects) { + __DRIdrawablePrivate *dPriv = intel->driDrawable; + drm_clip_rect_t *box = dPriv->pClipRects; + drm_clip_rect_t dest_rect; + GLint nbox = dPriv->numClipRects; + GLint srcx = 0, srcy = 0; + GLint orig_screen_x1, orig_screen_y2; + GLuint i; + + + orig_screen_x1 = dPriv->x + dstx; + orig_screen_y2 = dPriv->y + (dPriv->h - dsty); + + /* Do scissoring in GL coordinates: + */ + if (ctx->Scissor.Enabled) + { + GLint x = ctx->Scissor.X; + GLint y = ctx->Scissor.Y; + GLuint w = ctx->Scissor.Width; + GLuint h = ctx->Scissor.Height; + + if (!_mesa_clip_to_region(x, y, x+w-1, y+h-1, &dstx, &dsty, &width, &height)) + goto out; + } + + /* Convert from GL to hardware coordinates: + */ + dsty = dPriv->y + (dPriv->h - dsty - height); + dstx = dPriv->x + dstx; + + dest_rect.x1 = dstx; + dest_rect.y1 = dsty; + dest_rect.x2 = dstx + width; + dest_rect.y2 = dsty + height; + + for (i = 0; i < nbox; i++) { + drm_clip_rect_t rect; + int box_w, box_h; + GLint px, py; + GLuint stipple[32]; + + if (!intel_intersect_cliprects(&rect, &dest_rect, &box[i])) + continue; + + /* Now go back to GL coordinates to figure out what subset of + * the bitmap we are uploading for this cliprect: + */ + box_w = rect.x2 - rect.x1; + box_h = rect.y2 - rect.y1; + srcx = rect.x1 - orig_screen_x1; + srcy = orig_screen_y2 - rect.y2; + + +#define DY 32 +#define DX 32 + + /* Then, finally, chop it all into chunks that can be + * digested by hardware: + */ + for (py = 0; py < box_h; py += DY) { + for (px = 0; px < box_w; px += DX) { + int h = MIN2(DY, box_h - py); + int w = MIN2(DX, box_w - px); + GLuint sz = align(align(w,8) * h, 64)/8; + + assert(sz <= sizeof(stipple)); + memset(stipple, 0, sz); + + /* May need to adjust this when padding has been introduced in + * sz above: + */ + if (get_bitmap_rect(width, height, unpack, + bitmap, + srcx + px, srcy + py, w, h, + (GLubyte *)stipple, + 8, + GL_TRUE) == 0) + continue; + + /* + */ + intelEmitImmediateColorExpandBlit( intel, + dst->cpp, + (GLubyte *)stipple, + sz, + color.ui, + dst->pitch, + dst->buffer, + 0, + dst->tiled, + rect.x1 + px, + rect.y2 - (py + h), + w, h); + } + } + } + intel->need_flush = GL_TRUE; + out: + intel_batchbuffer_flush(intel->batch); + } + UNLOCK_HARDWARE(intel); + + + if (unpack->BufferObj->Name) { + /* done with PBO so unmap it now */ + ctx->Driver.UnmapBuffer(ctx, GL_PIXEL_UNPACK_BUFFER_EXT, + unpack->BufferObj); + } + + return GL_TRUE; +} + + + + + +/* There are a large number of possible ways to implement bitmap on + * this hardware, most of them have some sort of drawback. Here are a + * few that spring to mind: + * + * Blit: + * - XY_MONO_SRC_BLT_CMD + * - use XY_SETUP_CLIP_BLT for cliprect clipping. + * - XY_TEXT_BLT + * - XY_TEXT_IMMEDIATE_BLT + * - blit per cliprect, subject to maximum immediate data size. + * - XY_COLOR_BLT + * - per pixel or run of pixels + * - XY_PIXEL_BLT + * - good for sparse bitmaps + * + * 3D engine: + * - Point per pixel + * - Translate bitmap to an alpha texture and render as a quad + * - Chop bitmap up into 32x32 squares and render w/polygon stipple. + */ +void +intelBitmap(GLcontext * ctx, + GLint x, GLint y, + GLsizei width, GLsizei height, + const struct gl_pixelstore_attrib *unpack, + const GLubyte * pixels) +{ + if (do_blit_bitmap(ctx, x, y, width, height, + unpack, pixels)) + return; + + if (INTEL_DEBUG & DEBUG_PIXEL) + _mesa_printf("%s: fallback to swrast\n", __FUNCTION__); + + _swrast_Bitmap(ctx, x, y, width, height, unpack, pixels); +} diff --git a/src/mesa/drivers/dri/i965/intel_pixel_copy.c b/src/mesa/drivers/dri/i965/intel_pixel_copy.c new file mode 100644 index 00000000000..d5d48994529 --- /dev/null +++ b/src/mesa/drivers/dri/i965/intel_pixel_copy.c @@ -0,0 +1,240 @@ +/************************************************************************** + * + * Copyright 2003 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. + * + **************************************************************************/ + +#include "glheader.h" +#include "enums.h" +#include "image.h" +#include "mtypes.h" +#include "macros.h" +#include "state.h" +#include "swrast/swrast.h" + +#include "intel_screen.h" +#include "intel_context.h" +#include "intel_ioctl.h" +#include "intel_batchbuffer.h" +#include "intel_blit.h" +#include "intel_regions.h" + + +static struct intel_region * +copypix_src_region(struct intel_context *intel, GLenum type) +{ + switch (type) { + case GL_COLOR: + return intel_readbuf_region(intel); + case GL_DEPTH: + /* Don't think this is really possible execpt at 16bpp, when we have no stencil. + */ + if (intel->depth_region && intel->depth_region->cpp == 2) + return intel->depth_region; + case GL_STENCIL: + /* Don't think this is really possible. + */ + break; + case GL_DEPTH_STENCIL_EXT: + /* Does it matter whether it is stencil/depth or depth/stencil? + */ + return intel->depth_region; + default: + break; + } + + return NULL; +} + + + + +/** + * Check if any fragment operations are in effect which might effect + * glDraw/CopyPixels. + */ +GLboolean +intel_check_blit_fragment_ops(GLcontext * ctx) +{ + if (ctx->NewState) + _mesa_update_state(ctx); + + /* Could do logicop with the blitter: + */ + return !(ctx->_ImageTransferState || + ctx->RenderMode != GL_RENDER || + ctx->Color.AlphaEnabled || + ctx->Depth.Test || + ctx->Fog.Enabled || + ctx->Stencil.Enabled || + !ctx->Color.ColorMask[0] || + !ctx->Color.ColorMask[1] || + !ctx->Color.ColorMask[2] || + !ctx->Color.ColorMask[3] || /* can do this! */ + ctx->Color.ColorLogicOpEnabled || /* can do this! */ + ctx->Texture._EnabledUnits || + ctx->FragmentProgram._Enabled); +} + + + +/** + * CopyPixels with the blitter. Don't support zooming, pixel transfer, etc. + */ +static GLboolean +do_blit_copypixels(GLcontext * ctx, + GLint srcx, GLint srcy, + GLsizei width, GLsizei height, + GLint dstx, GLint dsty, GLenum type) +{ + struct intel_context *intel = intel_context(ctx); + struct intel_region *dst = intel_drawbuf_region(intel); + struct intel_region *src = copypix_src_region(intel, type); + + /* Copypixels can be more than a straight copy. Ensure all the + * extra operations are disabled: + */ + if (!intel_check_blit_fragment_ops(ctx) || + ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F) + return GL_FALSE; + + if (!src || !dst) + return GL_FALSE; + + + + intelFlush(&intel->ctx); + +/* intel->vtbl.render_start(intel); */ +/* intel->vtbl.emit_state(intel); */ + + LOCK_HARDWARE(intel); + + if (intel->driDrawable->numClipRects) { + __DRIdrawablePrivate *dPriv = intel->driDrawable; + drm_clip_rect_t *box = dPriv->pClipRects; + drm_clip_rect_t dest_rect; + GLint nbox = dPriv->numClipRects; + GLint delta_x = 0; + GLint delta_y = 0; + GLuint i; + + /* Do scissoring in GL coordinates: + */ + if (ctx->Scissor.Enabled) + { + GLint x = ctx->Scissor.X; + GLint y = ctx->Scissor.Y; + GLuint w = ctx->Scissor.Width; + GLuint h = ctx->Scissor.Height; + GLint dx = dstx - srcx; + GLint dy = dsty - srcy; + + if (!_mesa_clip_to_region(x, y, x+w-1, y+h-1, &dstx, &dsty, &width, &height)) + goto out; + + srcx = dstx - dx; + srcy = dsty - dy; + } + + /* Convert from GL to hardware coordinates: + */ + dsty = dPriv->h - dsty - height; + srcy = dPriv->h - srcy - height; + dstx += dPriv->x; + dsty += dPriv->y; + srcx += dPriv->x; + srcy += dPriv->y; + + /* Clip against the source region. This is the only source + * clipping we do. Dst is clipped with cliprects below. + */ + { + delta_x = srcx - dstx; + delta_y = srcy - dsty; + + if (!_mesa_clip_to_region(0, 0, src->pitch, src->height, + &srcx, &srcy, &width, &height)) + goto out; + + dstx = srcx - delta_x; + dsty = srcy - delta_y; + } + + dest_rect.x1 = dstx; + dest_rect.y1 = dsty; + dest_rect.x2 = dstx + width; + dest_rect.y2 = dsty + height; + +/* intel->vtbl.emit_flush(intel, 0); */ + + /* Could do slightly more clipping: Eg, take the intersection of + * the existing set of cliprects and those cliprects translated + * by delta_x, delta_y: + * + * This code will not overwrite other windows, but will + * introduce garbage when copying from obscured window regions. + */ + for (i = 0; i < nbox; i++) { + drm_clip_rect_t rect; + + if (!intel_intersect_cliprects(&rect, &dest_rect, &box[i])) + continue; + + + intelEmitCopyBlit(intel, + dst->cpp, + src->pitch, src->buffer, 0, src->tiled, + dst->pitch, dst->buffer, 0, dst->tiled, + rect.x1 + delta_x, + rect.y1 + delta_y, /* srcx, srcy */ + rect.x1, rect.y1, /* dstx, dsty */ + rect.x2 - rect.x1, rect.y2 - rect.y1); + } + + intel->need_flush = GL_TRUE; + out: + intel_batchbuffer_flush(intel->batch); + } + UNLOCK_HARDWARE(intel); + return GL_TRUE; +} + +void +intelCopyPixels(GLcontext * ctx, + GLint srcx, GLint srcy, + GLsizei width, GLsizei height, + GLint destx, GLint desty, GLenum type) +{ + if (INTEL_DEBUG & DEBUG_PIXEL) + fprintf(stderr, "%s\n", __FUNCTION__); + + if (do_blit_copypixels(ctx, srcx, srcy, width, height, destx, desty, type)) + return; + + if (INTEL_DEBUG & DEBUG_PIXEL) + _mesa_printf("fallback to _swrast_CopyPixels\n"); + + _swrast_CopyPixels(ctx, srcx, srcy, width, height, destx, desty, type); +} diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c index 14b461b1ee7..56e6a792fa2 100644 --- a/src/mesa/drivers/dri/i965/intel_screen.c +++ b/src/mesa/drivers/dri/i965/intel_screen.c @@ -87,7 +87,7 @@ intelMapScreenRegions(__DRIscreenPrivate *sPriv) * the renderbuffer address to point to the beginning of the * renderbuffer. */ - intelScreen->front.map = sPriv->pFB; + intelScreen->front.map = (char *)sPriv->pFB; if (intelScreen->front.map == NULL) { fprintf(stderr, "Failed to find framebuffer mapping\n"); return GL_FALSE; @@ -272,7 +272,7 @@ static GLboolean intelInitDriver(__DRIscreenPrivate *sPriv) volatile drmI830Sarea *sarea; if (sPriv->devPrivSize != sizeof(I830DRIRec)) { - fprintf(stderr,"\nERROR! sizeof(I830DRIRec) (%d) does not match passed size from device driver (%d)\n", sizeof(I830DRIRec), sPriv->devPrivSize); + fprintf(stderr,"\nERROR! sizeof(I830DRIRec) (%ld) does not match passed size from device driver (%d)\n", (unsigned long)sizeof(I830DRIRec), sPriv->devPrivSize); return GL_FALSE; } diff --git a/src/mesa/drivers/dri/i965/intel_span.c b/src/mesa/drivers/dri/i965/intel_span.c index c68def5a9f9..60fbeccdc54 100644 --- a/src/mesa/drivers/dri/i965/intel_span.c +++ b/src/mesa/drivers/dri/i965/intel_span.c @@ -35,6 +35,7 @@ #include "intel_span.h" #include "intel_ioctl.h" #include "intel_tex.h" +#include "intel_batchbuffer.h" #include "swrast/swrast.h" #undef DBG @@ -207,6 +208,16 @@ void intelSpanRenderStart( GLcontext *ctx ) { struct intel_context *intel = intel_context(ctx); + if (intel->need_flush) { + LOCK_HARDWARE(intel); + intel->vtbl.emit_flush(intel, 0); + intel_batchbuffer_flush(intel->batch); + intel->need_flush = 0; + UNLOCK_HARDWARE(intel); + intelFinish(&intel->ctx); + } + + LOCK_HARDWARE(intel); /* Just map the framebuffer and all textures. Bufmgr code will diff --git a/src/mesa/drivers/dri/i965/intel_state.c b/src/mesa/drivers/dri/i965/intel_state.c index a471f67c510..ec6e0465d4a 100644 --- a/src/mesa/drivers/dri/i965/intel_state.c +++ b/src/mesa/drivers/dri/i965/intel_state.c @@ -182,39 +182,6 @@ static void intelClearColor(GLcontext *ctx, const GLfloat color[4]) } -static void intelCalcViewport( GLcontext *ctx ) -{ - struct intel_context *intel = intel_context(ctx); - const GLfloat *v = ctx->Viewport._WindowMap.m; - GLfloat *m = intel->ViewportMatrix.m; - GLint h = 0; - - if (intel->driDrawable) - h = intel->driDrawable->h + SUBPIXEL_Y; - - /* See also intel_translate_vertex. SUBPIXEL adjustments can be done - * via state vars, too. - */ - m[MAT_SX] = v[MAT_SX]; - m[MAT_TX] = v[MAT_TX] + SUBPIXEL_X; - m[MAT_SY] = - v[MAT_SY]; - m[MAT_TY] = - v[MAT_TY] + h; - m[MAT_SZ] = v[MAT_SZ] * intel->depth_scale; - m[MAT_TZ] = v[MAT_TZ] * intel->depth_scale; -} - -static void intelViewport( GLcontext *ctx, - GLint x, GLint y, - GLsizei width, GLsizei height ) -{ - intelCalcViewport( ctx ); -} - -static void intelDepthRange( GLcontext *ctx, - GLclampd nearval, GLclampd farval ) -{ - intelCalcViewport( ctx ); -} /* Fallback to swrast for select and feedback. */ @@ -228,8 +195,6 @@ static void intelRenderMode( GLcontext *ctx, GLenum mode ) void intelInitStateFuncs( struct dd_function_table *functions ) { functions->RenderMode = intelRenderMode; - functions->Viewport = intelViewport; - functions->DepthRange = intelDepthRange; functions->ClearColor = intelClearColor; } diff --git a/src/mesa/drivers/dri/i965/intel_structs.h b/src/mesa/drivers/dri/i965/intel_structs.h new file mode 100644 index 00000000000..522e3bd92c2 --- /dev/null +++ b/src/mesa/drivers/dri/i965/intel_structs.h @@ -0,0 +1,132 @@ +#ifndef INTEL_STRUCTS_H +#define INTEL_STRUCTS_H + +struct br0 { + GLuint length:8; + GLuint pad0:3; + GLuint dst_tiled:1; + GLuint pad1:8; + GLuint write_rgb:1; + GLuint write_alpha:1; + GLuint opcode:7; + GLuint client:3; +}; + + +struct br13 { + GLint dest_pitch:16; + GLuint rop:8; + GLuint color_depth:2; + GLuint pad1:3; + GLuint mono_source_transparency:1; + GLuint clipping_enable:1; + GLuint pad0:1; +}; + + + +/* This is an attempt to move some of the 2D interaction in this + * driver to using structs for packets rather than a bunch of #defines + * and dwords. + */ +struct xy_color_blit { + struct br0 br0; + struct br13 br13; + + struct { + GLuint dest_x1:16; + GLuint dest_y1:16; + } dw2; + + struct { + GLuint dest_x2:16; + GLuint dest_y2:16; + } dw3; + + GLuint dest_base_addr; + GLuint color; +}; + +struct xy_src_copy_blit { + struct br0 br0; + struct br13 br13; + + struct { + GLuint dest_x1:16; + GLuint dest_y1:16; + } dw2; + + struct { + GLuint dest_x2:16; + GLuint dest_y2:16; + } dw3; + + GLuint dest_base_addr; + + struct { + GLuint src_x1:16; + GLuint src_y1:16; + } dw5; + + struct { + GLint src_pitch:16; + GLuint pad:16; + } dw6; + + GLuint src_base_addr; +}; + +struct xy_setup_blit { + struct br0 br0; + struct br13 br13; + + struct { + GLuint clip_x1:16; + GLuint clip_y1:16; + } dw2; + + struct { + GLuint clip_x2:16; + GLuint clip_y2:16; + } dw3; + + GLuint dest_base_addr; + GLuint background_color; + GLuint foreground_color; + GLuint pattern_base_addr; +}; + + +struct xy_text_immediate_blit { + struct { + GLuint length:8; + GLuint pad2:3; + GLuint dst_tiled:1; + GLuint pad1:4; + GLuint byte_packed:1; + GLuint pad0:5; + GLuint opcode:7; + GLuint client:3; + } dw0; + + struct { + GLuint dest_x1:16; + GLuint dest_y1:16; + } dw1; + + struct { + GLuint dest_x2:16; + GLuint dest_y2:16; + } dw2; + + /* Src bitmap data follows as inline dwords. + */ +}; + + +#define CLIENT_2D 0x2 +#define OPCODE_XY_SETUP_BLT 0x1 +#define OPCODE_XY_COLOR_BLT 0x50 +#define OPCODE_XY_TEXT_IMMEDIATE_BLT 0x31 + +#endif diff --git a/src/mesa/drivers/dri/i965/intel_tex_validate.c b/src/mesa/drivers/dri/i965/intel_tex_validate.c index 5f65242458a..91ae0970a04 100644 --- a/src/mesa/drivers/dri/i965/intel_tex_validate.c +++ b/src/mesa/drivers/dri/i965/intel_tex_validate.c @@ -166,12 +166,15 @@ GLuint intel_finalize_mipmap_tree( struct intel_context *intel, * target, imageFormat, etc. */ if (intelObj->mt && - (intelObj->mt->first_level != intelObj->firstLevel || - intelObj->mt->last_level != intelObj->lastLevel || + (intelObj->mt->target != intelObj->base.Target || intelObj->mt->internal_format != firstImage->InternalFormat || + intelObj->mt->first_level != intelObj->firstLevel || + intelObj->mt->last_level != intelObj->lastLevel || intelObj->mt->width0 != firstImage->Width || intelObj->mt->height0 != firstImage->Height || - intelObj->mt->depth0 != firstImage->Depth)) + intelObj->mt->depth0 != firstImage->Depth || + intelObj->mt->cpp != firstImage->TexFormat->TexelBytes || + intelObj->mt->compressed != firstImage->IsCompressed)) { intel_miptree_destroy(intel, intelObj->mt); intelObj->mt = NULL; diff --git a/src/mesa/drivers/dri/mach64/mach64_context.c b/src/mesa/drivers/dri/mach64/mach64_context.c index 717b9b9e8d8..03ec96a222e 100644 --- a/src/mesa/drivers/dri/mach64/mach64_context.c +++ b/src/mesa/drivers/dri/mach64/mach64_context.c @@ -308,7 +308,8 @@ mach64MakeCurrent( __DRIcontextPrivate *driContextPriv, } - driDrawableInitVBlank( driDrawPriv, newMach64Ctx->vblank_flags ); + driDrawableInitVBlank( driDrawPriv, newMach64Ctx->vblank_flags, + &newMach64Ctx->vbl_seq ); if ( newMach64Ctx->driDrawable != driDrawPriv ) { newMach64Ctx->driDrawable = driDrawPriv; diff --git a/src/mesa/drivers/dri/mach64/mach64_dd.c b/src/mesa/drivers/dri/mach64/mach64_dd.c index 7c27c5856a2..17e8d74d9fa 100644 --- a/src/mesa/drivers/dri/mach64/mach64_dd.c +++ b/src/mesa/drivers/dri/mach64/mach64_dd.c @@ -127,7 +127,6 @@ static void mach64DDFinish( GLcontext *ctx ) void mach64InitDriverFuncs( struct dd_function_table *functions ) { functions->GetBufferSize = mach64DDGetBufferSize; - functions->ResizeBuffers = _mesa_resize_framebuffer; functions->GetString = mach64DDGetString; functions->Finish = mach64DDFinish; functions->Flush = mach64DDFlush; diff --git a/src/mesa/drivers/dri/mach64/mach64_ioctl.c b/src/mesa/drivers/dri/mach64/mach64_ioctl.c index 1889dc2b93c..36e7d3c5d3d 100644 --- a/src/mesa/drivers/dri/mach64/mach64_ioctl.c +++ b/src/mesa/drivers/dri/mach64/mach64_ioctl.c @@ -105,7 +105,7 @@ void mach64FlushVerticesLocked( mach64ContextPtr mmesa ) int prim = mmesa->hw_primitive; int fd = mmesa->driScreen->fd; drm_mach64_vertex_t vertex; - int i, ret; + int i; mmesa->num_verts = 0; mmesa->vert_used = 0; @@ -123,6 +123,9 @@ void mach64FlushVerticesLocked( mach64ContextPtr mmesa ) mmesa->dirty |= MACH64_UPLOAD_CLIPRECTS; if ( !count || !(mmesa->dirty & MACH64_UPLOAD_CLIPRECTS) ) { + int to = 0; + int ret; + /* FIXME: Is this really necessary */ if ( nbox == 1 ) mmesa->sarea->nbox = 0; @@ -133,7 +136,10 @@ void mach64FlushVerticesLocked( mach64ContextPtr mmesa ) vertex.buf = buffer; vertex.used = count; vertex.discard = 1; - ret = drmCommandWrite( fd, DRM_MACH64_VERTEX, &vertex, sizeof(drm_mach64_vertex_t) ); + do { + ret = drmCommandWrite( fd, DRM_MACH64_VERTEX, + &vertex, sizeof(drm_mach64_vertex_t) ); + } while ( ( ret == -EAGAIN ) && ( to++ < MACH64_TIMEOUT ) ); if ( ret ) { UNLOCK_HARDWARE( mmesa ); fprintf( stderr, "Error flushing vertex buffer: return = %d\n", ret ); @@ -146,6 +152,8 @@ void mach64FlushVerticesLocked( mach64ContextPtr mmesa ) int nr = MIN2( i + MACH64_NR_SAREA_CLIPRECTS, nbox ); drm_clip_rect_t *b = mmesa->sarea->boxes; int discard = 0; + int to = 0; + int ret; mmesa->sarea->nbox = nr - i; for ( ; i < nr ; i++ ) { @@ -164,7 +172,10 @@ void mach64FlushVerticesLocked( mach64ContextPtr mmesa ) vertex.buf = buffer; vertex.used = count; vertex.discard = discard; - ret = drmCommandWrite( fd, DRM_MACH64_VERTEX, &vertex, sizeof(drm_mach64_vertex_t) ); + do { + ret = drmCommandWrite( fd, DRM_MACH64_VERTEX, + &vertex, sizeof(drm_mach64_vertex_t) ); + } while ( ( ret == -EAGAIN ) && ( to++ < MACH64_TIMEOUT ) ); if ( ret ) { UNLOCK_HARDWARE( mmesa ); fprintf( stderr, "Error flushing vertex buffer: return = %d\n", ret ); @@ -180,14 +191,15 @@ void mach64FlushVerticesLocked( mach64ContextPtr mmesa ) * Texture uploads */ -void mach64FireBlitLocked( mach64ContextPtr mmesa, drmBufPtr buffer, +void mach64FireBlitLocked( mach64ContextPtr mmesa, void *buffer, GLint offset, GLint pitch, GLint format, GLint x, GLint y, GLint width, GLint height ) { drm_mach64_blit_t blit; - GLint ret; + int to = 0; + int ret; - blit.idx = buffer->idx; + blit.buf = buffer; blit.offset = offset; blit.pitch = pitch; blit.format = format; @@ -196,8 +208,10 @@ void mach64FireBlitLocked( mach64ContextPtr mmesa, drmBufPtr buffer, blit.width = width; blit.height = height; - ret = drmCommandWrite( mmesa->driFd, DRM_MACH64_BLIT, - &blit, sizeof(drm_mach64_blit_t) ); + do { + ret = drmCommandWrite( mmesa->driFd, DRM_MACH64_BLIT, + &blit, sizeof(drm_mach64_blit_t) ); + } while ( ( ret == -EAGAIN ) && ( to++ < MACH64_TIMEOUT ) ); if ( ret ) { UNLOCK_HARDWARE( mmesa ); @@ -651,8 +665,7 @@ void mach64PerformanceBoxesLocked( mach64ContextPtr mmesa ) * Buffer clear */ -static void mach64DDClear( GLcontext *ctx, GLbitfield mask, GLboolean all, - GLint cx, GLint cy, GLint cw, GLint ch ) +static void mach64DDClear( GLcontext *ctx, GLbitfield mask ) { mach64ContextPtr mmesa = MACH64_CONTEXT( ctx ); __DRIdrawablePrivate *dPriv = mmesa->driDrawable; @@ -660,10 +673,10 @@ static void mach64DDClear( GLcontext *ctx, GLbitfield mask, GLboolean all, GLuint flags = 0; GLint i; GLint ret; + GLint cx, cy, cw, ch; if ( MACH64_DEBUG & DEBUG_VERBOSE_API ) { - fprintf( stderr, "%s: all=%d %d,%d %dx%d\n", - __FUNCTION__, all, cx, cy, cw, ch ); + fprintf( stderr, "mach64DDClear\n"); } #if ENABLE_PERF_BOXES @@ -699,14 +712,19 @@ static void mach64DDClear( GLcontext *ctx, GLbitfield mask, GLboolean all, } if ( mask ) - _swrast_Clear( ctx, mask, all, cx, cy, cw, ch ); + _swrast_Clear( ctx, mask ); if ( !flags ) return; LOCK_HARDWARE( mmesa ); - /* This needs to be in the locked region, so updated drawable origin is used */ + /* compute region after locking: */ + cx = ctx->DrawBuffer->_Xmin; + cy = ctx->DrawBuffer->_Ymin; + cw = ctx->DrawBuffer->_Xmax - cx; + ch = ctx->DrawBuffer->_Ymax - cy; + /* Flip top to bottom */ cx += mmesa->drawX; cy = mmesa->drawY + dPriv->h - cy - ch; @@ -723,7 +741,8 @@ static void mach64DDClear( GLcontext *ctx, GLbitfield mask, GLboolean all, drm_clip_rect_t *b = mmesa->sarea->boxes; GLint n = 0; - if ( !all ) { + if (cw != dPriv->w || ch != dPriv->h) { + /* clear subregion */ for ( ; i < nr ; i++ ) { GLint x = box[i].x1; GLint y = box[i].y1; @@ -745,6 +764,7 @@ static void mach64DDClear( GLcontext *ctx, GLbitfield mask, GLboolean all, n++; } } else { + /* clear whole window */ for ( ; i < nr ; i++ ) { *b++ = box[i]; n++; diff --git a/src/mesa/drivers/dri/mach64/mach64_ioctl.h b/src/mesa/drivers/dri/mach64/mach64_ioctl.h index 8bd958531c1..52fe8634845 100644 --- a/src/mesa/drivers/dri/mach64/mach64_ioctl.h +++ b/src/mesa/drivers/dri/mach64/mach64_ioctl.h @@ -74,7 +74,7 @@ static __inline void *mach64AllocDmaLocked( mach64ContextPtr mmesa, int bytes ) return head; } -extern void mach64FireBlitLocked( mach64ContextPtr mmesa, drmBufPtr buffer, +extern void mach64FireBlitLocked( mach64ContextPtr mmesa, void *buffer, GLint offset, GLint pitch, GLint format, GLint x, GLint y, GLint width, GLint height ); diff --git a/src/mesa/drivers/dri/mach64/mach64_screen.c b/src/mesa/drivers/dri/mach64/mach64_screen.c index 60055e5c9f8..b17de01acc5 100644 --- a/src/mesa/drivers/dri/mach64/mach64_screen.c +++ b/src/mesa/drivers/dri/mach64/mach64_screen.c @@ -520,7 +520,7 @@ void * __driCreateNewScreen_20050727( __DRInativeDisplay *dpy, int scrn, __DRIsc __DRIscreenPrivate *psp; static const __DRIversion ddx_expected = { 6, 4, 0 }; static const __DRIversion dri_expected = { 4, 0, 0 }; - static const __DRIversion drm_expected = { 1, 0, 0 }; + static const __DRIversion drm_expected = { 2, 0, 0 }; dri_interface = interface; diff --git a/src/mesa/drivers/dri/mach64/mach64_state.c b/src/mesa/drivers/dri/mach64/mach64_state.c index b9881cd941d..d4804a2c550 100644 --- a/src/mesa/drivers/dri/mach64/mach64_state.c +++ b/src/mesa/drivers/dri/mach64/mach64_state.c @@ -1186,19 +1186,4 @@ void mach64DDInitStateFuncs( GLcontext *ctx ) ctx->Driver.DepthRange = mach64DepthRange; ctx->Driver.Viewport = mach64Viewport; - - /* Pixel path fallbacks. - */ - ctx->Driver.Accum = _swrast_Accum; - ctx->Driver.Bitmap = _swrast_Bitmap; - ctx->Driver.CopyPixels = _swrast_CopyPixels; - ctx->Driver.DrawPixels = _swrast_DrawPixels; - ctx->Driver.ReadPixels = _swrast_ReadPixels; - - /* Swrast hooks for imaging extensions: - */ - ctx->Driver.CopyColorTable = _swrast_CopyColorTable; - ctx->Driver.CopyColorSubTable = _swrast_CopyColorSubTable; - ctx->Driver.CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D; - ctx->Driver.CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D; } diff --git a/src/mesa/drivers/dri/mach64/mach64_texmem.c b/src/mesa/drivers/dri/mach64/mach64_texmem.c index f771818c898..017fd3535d5 100644 --- a/src/mesa/drivers/dri/mach64/mach64_texmem.c +++ b/src/mesa/drivers/dri/mach64/mach64_texmem.c @@ -569,27 +569,17 @@ static void mach64UploadLocalSubImage( mach64ContextPtr mmesa, remaining > 0 ; remaining -= rows, y += rows, i++ ) { - drmBufPtr buffer; - CARD32 *dst; - height = MIN2(remaining, rows); - /* Grab the dma buffer for the texture blit */ - buffer = mach64GetBufferLocked( mmesa ); - - dst = (CARD32 *)((char *)buffer->address + MACH64_HOSTDATA_BLIT_OFFSET); - assert(image->Data); { const GLubyte *src = (const GLubyte *) image->Data + (y * image->Width + x) * image->TexFormat->TexelBytes; - const GLuint bytes = width * height * image->TexFormat->TexelBytes; - memcpy(dst, src, bytes); - } - mach64FireBlitLocked( mmesa, buffer, offset, pitch, format, - x, y, width, height ); + mach64FireBlitLocked( mmesa, (void *)src, offset, pitch, format, + x, y, width, height ); + } } diff --git a/src/mesa/drivers/dri/mga/mga_xmesa.c b/src/mesa/drivers/dri/mga/mga_xmesa.c index 6450340a48c..f02913c6af2 100644 --- a/src/mesa/drivers/dri/mga/mga_xmesa.c +++ b/src/mesa/drivers/dri/mga/mga_xmesa.c @@ -878,11 +878,11 @@ mgaMakeCurrent(__DRIcontextPrivate *driContextPriv, mgaContextPtr mmesa = (mgaContextPtr) driContextPriv->driverPrivate; if (mmesa->driDrawable != driDrawPriv) { - driDrawableInitVBlank( driDrawPriv, mmesa->vblank_flags ); + driDrawableInitVBlank( driDrawPriv, mmesa->vblank_flags, + &mmesa->vbl_seq ); mmesa->driDrawable = driDrawPriv; mmesa->dirty = ~0; mmesa->dirty_cliprects = (MGA_FRONT|MGA_BACK); - mmesa->mesa_drawable = driDrawPriv; } mmesa->driReadable = driReadPriv; diff --git a/src/mesa/drivers/dri/mga/mgacontext.h b/src/mesa/drivers/dri/mga/mgacontext.h index 81348b6c7f9..2124006ade6 100644 --- a/src/mesa/drivers/dri/mga/mgacontext.h +++ b/src/mesa/drivers/dri/mga/mgacontext.h @@ -303,13 +303,6 @@ struct mga_context_t { __DRIdrawablePrivate *driDrawable; __DRIdrawablePrivate *driReadable; - /** - * Drawable used by Mesa for software fallbacks for reading and - * writing. It is set by Mesa's \c SetBuffer callback, and will always be - * either \c mga_context_t::driDrawable or \c mga_context_t::driReadable. - */ - __DRIdrawablePrivate *mesa_drawable; - __DRIscreenPrivate *driScreen; struct mga_screen_private_s *mgaScreen; drm_mga_sarea_t *sarea; diff --git a/src/mesa/drivers/dri/mga/mgadd.c b/src/mesa/drivers/dri/mga/mgadd.c index 8532ea95f10..b1d5e0c48fc 100644 --- a/src/mesa/drivers/dri/mga/mgadd.c +++ b/src/mesa/drivers/dri/mga/mgadd.c @@ -41,7 +41,7 @@ #include "mga_xmesa.h" #include "utils.h" -#define DRIVER_DATE "20050609" +#define DRIVER_DATE "20061030" /*************************************** @@ -74,25 +74,7 @@ static const GLubyte *mgaGetString( GLcontext *ctx, GLenum name ) } -static void mgaBufferSize(GLframebuffer *buffer, GLuint *width, GLuint *height) -{ - GET_CURRENT_CONTEXT(ctx); - mgaContextPtr mmesa = MGA_CONTEXT(ctx); - - /* Need to lock to make sure the driDrawable is uptodate. This - * information is used to resize Mesa's software buffers, so it has - * to be correct. - */ - LOCK_HARDWARE( mmesa ); - *width = mmesa->driDrawable->w; - *height = mmesa->driDrawable->h; - UNLOCK_HARDWARE( mmesa ); -} - - void mgaInitDriverFuncs( struct dd_function_table *functions ) { - functions->GetBufferSize = mgaBufferSize; - functions->ResizeBuffers = _mesa_resize_framebuffer; functions->GetString = mgaGetString; } diff --git a/src/mesa/drivers/dri/mga/mgaioctl.c b/src/mesa/drivers/dri/mga/mgaioctl.c index 6e653f8c73d..f8587fc541e 100644 --- a/src/mesa/drivers/dri/mga/mgaioctl.c +++ b/src/mesa/drivers/dri/mga/mgaioctl.c @@ -204,8 +204,7 @@ drmBufPtr mga_get_buffer_ioctl( mgaContextPtr mmesa ) static void -mgaClear( GLcontext *ctx, GLbitfield mask, GLboolean all, - GLint cx, GLint cy, GLint cw, GLint ch ) +mgaClear( GLcontext *ctx, GLbitfield mask ) { mgaContextPtr mmesa = MGA_CONTEXT(ctx); __DRIdrawablePrivate *dPriv = mmesa->driDrawable; @@ -218,6 +217,7 @@ mgaClear( GLcontext *ctx, GLbitfield mask, GLboolean all, int i; static int nrclears; drm_mga_clear_t clear; + GLint cx, cy, cw, ch; FLUSH_BATCH( mmesa ); @@ -250,6 +250,12 @@ mgaClear( GLcontext *ctx, GLbitfield mask, GLboolean all, if ( flags ) { LOCK_HARDWARE( mmesa ); + /* compute region after locking: */ + cx = ctx->DrawBuffer->_Xmin; + cy = ctx->DrawBuffer->_Ymin; + cw = ctx->DrawBuffer->_Xmax - cx; + ch = ctx->DrawBuffer->_Ymax - cy; + if ( mmesa->dirty_cliprects ) mgaUpdateRects( mmesa, (MGA_FRONT | MGA_BACK) ); @@ -269,7 +275,8 @@ mgaClear( GLcontext *ctx, GLbitfield mask, GLboolean all, drm_clip_rect_t *b = mmesa->sarea->boxes; int n = 0; - if (!all) { + if (cw != dPriv->w || ch != dPriv->h) { + /* clear subregion */ for ( ; i < nr ; i++) { GLint x = box[i].x1; GLint y = box[i].y1; @@ -291,6 +298,7 @@ mgaClear( GLcontext *ctx, GLbitfield mask, GLboolean all, n++; } } else { + /* clear whole window */ for ( ; i < nr ; i++) { *b++ = box[i]; n++; @@ -325,7 +333,7 @@ mgaClear( GLcontext *ctx, GLbitfield mask, GLboolean all, } if (mask) - _swrast_Clear( ctx, mask, all, cx, cy, cw, ch ); + _swrast_Clear( ctx, mask ); } diff --git a/src/mesa/drivers/dri/mga/mgapixel.c b/src/mesa/drivers/dri/mga/mgapixel.c index 38577f05edd..2b9da8c1813 100644 --- a/src/mesa/drivers/dri/mga/mgapixel.c +++ b/src/mesa/drivers/dri/mga/mgapixel.c @@ -646,15 +646,8 @@ mgaDDDrawPixels( GLcontext *ctx, */ void mgaDDInitPixelFuncs( GLcontext *ctx ) { - /* Pixel path fallbacks. - */ - ctx->Driver.Accum = _swrast_Accum; - ctx->Driver.Bitmap = _swrast_Bitmap; - ctx->Driver.CopyPixels = _swrast_CopyPixels; - ctx->Driver.DrawPixels = _swrast_DrawPixels; - ctx->Driver.ReadPixels = _swrast_ReadPixels; - #if 0 + /* evidently, these functions don't always work */ if (getenv("MGA_BLIT_PIXELS")) { ctx->Driver.ReadPixels = mgaDDReadPixels; /* requires agp dest */ ctx->Driver.DrawPixels = mgaDDDrawPixels; /* works with agp/normal mem */ diff --git a/src/mesa/drivers/dri/mga/mgaspan.c b/src/mesa/drivers/dri/mga/mgaspan.c index dbc7fc884ce..05dcbb85263 100644 --- a/src/mesa/drivers/dri/mga/mgaspan.c +++ b/src/mesa/drivers/dri/mga/mgaspan.c @@ -36,9 +36,9 @@ #define LOCAL_VARS \ mgaContextPtr mmesa = MGA_CONTEXT(ctx); \ - __DRIdrawablePrivate *dPriv = mmesa->mesa_drawable; \ __DRIscreenPrivate *sPriv = mmesa->driScreen; \ driRenderbuffer *drb = (driRenderbuffer *) rb; \ + const __DRIdrawablePrivate *dPriv = drb->dPriv; \ GLuint pitch = drb->pitch; \ GLuint height = dPriv->h; \ char *buf = (char *)(sPriv->pFB + \ @@ -52,9 +52,9 @@ #define LOCAL_DEPTH_VARS \ mgaContextPtr mmesa = MGA_CONTEXT(ctx); \ - __DRIdrawablePrivate *dPriv = mmesa->mesa_drawable; \ __DRIscreenPrivate *sPriv = mmesa->driScreen; \ driRenderbuffer *drb = (driRenderbuffer *) rb; \ + const __DRIdrawablePrivate *dPriv = drb->dPriv; \ GLuint pitch = drb->pitch; \ GLuint height = dPriv->h; \ char *buf = (char *)(sPriv->pFB + \ diff --git a/src/mesa/drivers/dri/mga/mgastate.c b/src/mesa/drivers/dri/mga/mgastate.c index de3654bacb3..075fd348cf4 100644 --- a/src/mesa/drivers/dri/mga/mgastate.c +++ b/src/mesa/drivers/dri/mga/mgastate.c @@ -24,7 +24,6 @@ * Authors: * Keith Whitwell */ -/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgastate.c,v 1.13 2002/10/30 12:51:36 alanh Exp $ */ #include "mtypes.h" @@ -49,6 +48,8 @@ #include "swrast_setup/swrast_setup.h" #include "xmlpool.h" +#include "drirenderbuffer.h" + static void updateSpecularLighting( GLcontext *ctx ); @@ -113,14 +114,15 @@ static void mgaDDAlphaFunc(GLcontext *ctx, GLenum func, GLfloat ref) static void updateBlendLogicOp(GLcontext *ctx) { mgaContextPtr mmesa = MGA_CONTEXT(ctx); + GLboolean logicOp = RGBA_LOGICOP_ENABLED(ctx); MGA_STATECHANGE( mmesa, MGA_UPLOAD_CONTEXT ); mmesa->hw.blend_func_enable = - (ctx->Color.BlendEnabled && !ctx->Color._LogicOpEnabled) ? ~0 : 0; + (ctx->Color.BlendEnabled && !logicOp) ? ~0 : 0; FALLBACK( ctx, MGA_FALLBACK_BLEND, - ctx->Color.BlendEnabled && !ctx->Color._LogicOpEnabled && + ctx->Color.BlendEnabled && !logicOp && mmesa->hw.blend_func == (AC_src_src_alpha_sat | AC_dst_zero) ); } @@ -195,7 +197,7 @@ static void mgaDDBlendFuncSeparate( GLcontext *ctx, GLenum sfactorRGB, mmesa->hw.blend_func = (src | dst); FALLBACK( ctx, MGA_FALLBACK_BLEND, - ctx->Color.BlendEnabled && !ctx->Color._LogicOpEnabled && + ctx->Color.BlendEnabled && !RGBA_LOGICOP_ENABLED(ctx) && mmesa->hw.blend_func == (AC_src_src_alpha_sat | AC_dst_zero) ); } @@ -744,32 +746,12 @@ static void mgaDDLogicOp( GLcontext *ctx, GLenum opcode ) } -static void mgaXMesaSetFrontClipRects( mgaContextPtr mmesa ) -{ - __DRIdrawablePrivate *driDrawable = mmesa->driDrawable; - - if (driDrawable->numClipRects == 0) { - static drm_clip_rect_t zeroareacliprect = {0,0,0,0}; - mmesa->numClipRects = 1; - mmesa->pClipRects = &zeroareacliprect; - } else { - mmesa->numClipRects = driDrawable->numClipRects; - mmesa->pClipRects = driDrawable->pClipRects; - } - mmesa->drawX = driDrawable->x; - mmesa->drawY = driDrawable->y; - - mmesa->setup.dstorg = mmesa->drawOffset; - mmesa->dirty |= MGA_UPLOAD_CONTEXT | MGA_UPLOAD_CLIPRECTS; -} - - -static void mgaXMesaSetBackClipRects( mgaContextPtr mmesa ) +static void mga_set_cliprects(mgaContextPtr mmesa) { __DRIdrawablePrivate *driDrawable = mmesa->driDrawable; - if (driDrawable->numBackClipRects == 0) - { + if ((mmesa->draw_buffer != MGA_FRONT) + || (driDrawable->numBackClipRects == 0)) { if (driDrawable->numClipRects == 0) { static drm_clip_rect_t zeroareacliprect = {0,0,0,0}; mmesa->numClipRects = 1; @@ -794,25 +776,25 @@ static void mgaXMesaSetBackClipRects( mgaContextPtr mmesa ) void mgaUpdateRects( mgaContextPtr mmesa, GLuint buffers ) { - __DRIdrawablePrivate *driDrawable = mmesa->driDrawable; + __DRIdrawablePrivate *const driDrawable = mmesa->driDrawable; + __DRIdrawablePrivate *const driReadable = mmesa->driReadable; drm_mga_sarea_t *sarea = mmesa->sarea; - DRI_VALIDATE_DRAWABLE_INFO(mmesa->driScreen, driDrawable); mmesa->dirty_cliprects = 0; - if (mmesa->draw_buffer == MGA_FRONT) - mgaXMesaSetFrontClipRects( mmesa ); - else - mgaXMesaSetBackClipRects( mmesa ); + driUpdateFramebufferSize(mmesa->glCtx, driDrawable); + if (driDrawable != driReadable) { + driUpdateFramebufferSize(mmesa->glCtx, driReadable); + } + + mga_set_cliprects(mmesa); sarea->req_drawable = driDrawable->draw; sarea->req_draw_buffer = mmesa->draw_buffer; mgaUpdateClipping( mmesa->glCtx ); mgaCalcViewport( mmesa->glCtx ); - - mmesa->dirty |= MGA_UPLOAD_CLIPRECTS; } @@ -828,23 +810,21 @@ static void mgaDDDrawBuffer(GLcontext *ctx, GLenum mode ) switch ( ctx->DrawBuffer->_ColorDrawBufferMask[0] ) { case BUFFER_BIT_FRONT_LEFT: mmesa->setup.dstorg = mmesa->mgaScreen->frontOffset; - mmesa->dirty |= MGA_UPLOAD_CONTEXT; mmesa->draw_buffer = MGA_FRONT; - mgaXMesaSetFrontClipRects( mmesa ); - FALLBACK( ctx, MGA_FALLBACK_DRAW_BUFFER, GL_FALSE ); break; case BUFFER_BIT_BACK_LEFT: mmesa->setup.dstorg = mmesa->mgaScreen->backOffset; mmesa->draw_buffer = MGA_BACK; - mmesa->dirty |= MGA_UPLOAD_CONTEXT; - mgaXMesaSetBackClipRects( mmesa ); - FALLBACK( ctx, MGA_FALLBACK_DRAW_BUFFER, GL_FALSE ); break; default: /* GL_NONE or GL_FRONT_AND_BACK or stereo left&right, etc */ FALLBACK( ctx, MGA_FALLBACK_DRAW_BUFFER, GL_TRUE ); return; } + + mmesa->dirty |= MGA_UPLOAD_CONTEXT; + mga_set_cliprects(mmesa); + FALLBACK(ctx, MGA_FALLBACK_DRAW_BUFFER, GL_FALSE); } @@ -987,7 +967,7 @@ void mgaEmitHwStateLocked( mgaContextPtr mmesa ) ? mmesa->hw.zmode : (DC_zmode_nozcmp | DC_atype_i); mmesa->setup.dwgctl &= DC_bop_MASK; - mmesa->setup.dwgctl |= (ctx->Color._LogicOpEnabled) + mmesa->setup.dwgctl |= RGBA_LOGICOP_ENABLED(ctx) ? mmesa->hw.rop : mgarop_NoBLK[ GL_COPY & 0x0f ]; mmesa->setup.alphactrl &= AC_src_MASK & AC_dst_MASK & AC_atmode_MASK @@ -1221,12 +1201,5 @@ void mgaDDInitStateFuncs( GLcontext *ctx ) ctx->Driver.ClearIndex = 0; ctx->Driver.IndexMask = 0; - /* Swrast hooks for imaging extensions: - */ - ctx->Driver.CopyColorTable = _swrast_CopyColorTable; - ctx->Driver.CopyColorSubTable = _swrast_CopyColorSubTable; - ctx->Driver.CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D; - ctx->Driver.CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D; - TNL_CONTEXT(ctx)->Driver.RunPipeline = mgaRunPipeline; } diff --git a/src/mesa/drivers/dri/r128/r128_context.c b/src/mesa/drivers/dri/r128/r128_context.c index 2f30bd253bf..8ec027542ad 100644 --- a/src/mesa/drivers/dri/r128/r128_context.c +++ b/src/mesa/drivers/dri/r128/r128_context.c @@ -345,7 +345,8 @@ r128MakeCurrent( __DRIcontextPrivate *driContextPriv, newR128Ctx->dirty = R128_UPLOAD_ALL; } - driDrawableInitVBlank( driDrawPriv, newR128Ctx->vblank_flags ); + driDrawableInitVBlank( driDrawPriv, newR128Ctx->vblank_flags, + &newR128Ctx->vbl_seq ); newR128Ctx->driDrawable = driDrawPriv; _mesa_make_current( newR128Ctx->glCtx, diff --git a/src/mesa/drivers/dri/r128/r128_dd.c b/src/mesa/drivers/dri/r128/r128_dd.c index 4f0bb4761cd..54f2b21b5d0 100644 --- a/src/mesa/drivers/dri/r128/r128_dd.c +++ b/src/mesa/drivers/dri/r128/r128_dd.c @@ -141,7 +141,6 @@ static void r128Finish( GLcontext *ctx ) void r128InitDriverFuncs( struct dd_function_table *functions ) { functions->GetBufferSize = r128GetBufferSize; - functions->ResizeBuffers = _mesa_resize_framebuffer; functions->GetString = r128GetString; functions->Finish = r128Finish; functions->Flush = r128Flush; diff --git a/src/mesa/drivers/dri/r128/r128_ioctl.c b/src/mesa/drivers/dri/r128/r128_ioctl.c index 3b34d9fbb2d..b0dba7d04e1 100644 --- a/src/mesa/drivers/dri/r128/r128_ioctl.c +++ b/src/mesa/drivers/dri/r128/r128_ioctl.c @@ -399,8 +399,7 @@ void r128PageFlip( const __DRIdrawablePrivate *dPriv ) * Buffer clear */ -static void r128Clear( GLcontext *ctx, GLbitfield mask, GLboolean all, - GLint cx, GLint cy, GLint cw, GLint ch ) +static void r128Clear( GLcontext *ctx, GLbitfield mask ) { r128ContextPtr rmesa = R128_CONTEXT(ctx); __DRIdrawablePrivate *dPriv = rmesa->driDrawable; @@ -409,6 +408,7 @@ static void r128Clear( GLcontext *ctx, GLbitfield mask, GLboolean all, GLint i; GLint ret; GLuint depthmask = 0; + GLint cx, cy, cw, ch; if ( R128_DEBUG & DEBUG_VERBOSE_API ) { fprintf( stderr, "%s:\n", __FUNCTION__ ); @@ -453,12 +453,18 @@ static void r128Clear( GLcontext *ctx, GLbitfield mask, GLboolean all, if ( flags ) { + LOCK_HARDWARE( rmesa ); + + /* compute region after locking: */ + cx = ctx->DrawBuffer->_Xmin; + cy = ctx->DrawBuffer->_Ymin; + cw = ctx->DrawBuffer->_Xmax - cx; + ch = ctx->DrawBuffer->_Ymax - cy; + /* Flip top to bottom */ cx += dPriv->x; cy = dPriv->y + dPriv->h - cy - ch; - LOCK_HARDWARE( rmesa ); - /* FIXME: Do we actually need this? */ if ( rmesa->dirty & ~R128_UPLOAD_CLIPRECTS ) { @@ -471,7 +477,8 @@ static void r128Clear( GLcontext *ctx, GLbitfield mask, GLboolean all, drm_clip_rect_t *b = rmesa->sarea->boxes; GLint n = 0; - if ( !all ) { + if (cw != dPriv->w || ch != dPriv->h) { + /* clear subregion */ for ( ; i < nr ; i++ ) { GLint x = box[i].x1; GLint y = box[i].y1; @@ -493,6 +500,7 @@ static void r128Clear( GLcontext *ctx, GLbitfield mask, GLboolean all, n++; } } else { + /* clear whole window */ for ( ; i < nr ; i++ ) { *b++ = box[i]; n++; @@ -532,7 +540,7 @@ static void r128Clear( GLcontext *ctx, GLbitfield mask, GLboolean all, } if ( mask ) - _swrast_Clear( ctx, mask, all, cx, cy, cw, ch ); + _swrast_Clear( ctx, mask ); } diff --git a/src/mesa/drivers/dri/r128/r128_span.c b/src/mesa/drivers/dri/r128/r128_span.c index 25e57133cc3..85798c16013 100644 --- a/src/mesa/drivers/dri/r128/r128_span.c +++ b/src/mesa/drivers/dri/r128/r128_span.c @@ -209,7 +209,7 @@ do { \ */ #define WRITE_DEPTH_SPAN() \ do { \ - GLint buf[n]; \ + GLuint buf[n]; \ GLint i; \ GLuint *readbuf = (GLuint *)((GLubyte *)sPriv->pFB + \ r128scrn->spanOffset); \ @@ -228,7 +228,7 @@ do { \ #define WRITE_DEPTH_PIXELS() \ do { \ - GLint buf[n]; \ + GLuint buf[n]; \ GLint ox[MAX_WIDTH]; \ GLint oy[MAX_WIDTH]; \ GLuint *readbuf = (GLuint *)((GLubyte *)sPriv->pFB + \ @@ -309,7 +309,7 @@ do { \ */ #define WRITE_STENCIL_SPAN() \ do { \ - GLint buf[n]; \ + GLuint buf[n]; \ GLint i; \ GLuint *readbuf = (GLuint *)((GLubyte *)sPriv->pFB + \ r128scrn->spanOffset); \ @@ -328,7 +328,7 @@ do { \ #define WRITE_STENCIL_PIXELS() \ do { \ - GLint buf[n]; \ + GLuint buf[n]; \ GLint ox[MAX_WIDTH]; \ GLint oy[MAX_WIDTH]; \ GLuint *readbuf = (GLuint *)((GLubyte *)sPriv->pFB + \ diff --git a/src/mesa/drivers/dri/r128/r128_state.c b/src/mesa/drivers/dri/r128/r128_state.c index 491f288ffb2..1bfd3709377 100644 --- a/src/mesa/drivers/dri/r128/r128_state.c +++ b/src/mesa/drivers/dri/r128/r128_state.c @@ -1434,19 +1434,4 @@ void r128DDInitStateFuncs( GLcontext *ctx ) ctx->Driver.DepthRange = r128DepthRange; ctx->Driver.Viewport = r128Viewport; - - /* Pixel path fallbacks. - */ - ctx->Driver.Accum = _swrast_Accum; - ctx->Driver.Bitmap = _swrast_Bitmap; - ctx->Driver.CopyPixels = _swrast_CopyPixels; - ctx->Driver.DrawPixels = _swrast_DrawPixels; - ctx->Driver.ReadPixels = _swrast_ReadPixels; - - /* Swrast hooks for imaging extensions: - */ - ctx->Driver.CopyColorTable = _swrast_CopyColorTable; - ctx->Driver.CopyColorSubTable = _swrast_CopyColorSubTable; - ctx->Driver.CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D; - ctx->Driver.CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D; } diff --git a/src/mesa/drivers/dri/r200/r200_cmdbuf.c b/src/mesa/drivers/dri/r200/r200_cmdbuf.c index 91737d2d33c..2920ceafd30 100644 --- a/src/mesa/drivers/dri/r200/r200_cmdbuf.c +++ b/src/mesa/drivers/dri/r200/r200_cmdbuf.c @@ -107,8 +107,8 @@ void r200SetUpAtomList( r200ContextPtr rmesa ) insert_at_tail( &rmesa->hw.atomlist, &rmesa->hw.mtl[i] ); for (i = 0; i < 6; ++i) insert_at_tail( &rmesa->hw.atomlist, &rmesa->hw.ucp[i] ); - /* FIXME: is this a good place to insert that atom ? */ insert_at_tail( &rmesa->hw.atomlist, &rmesa->hw.spr ); + insert_at_tail( &rmesa->hw.atomlist, &rmesa->hw.ptp ); insert_at_tail( &rmesa->hw.atomlist, &rmesa->hw.prf ); insert_at_tail( &rmesa->hw.atomlist, &rmesa->hw.pvs ); insert_at_tail( &rmesa->hw.atomlist, &rmesa->hw.vpp[0] ); diff --git a/src/mesa/drivers/dri/r200/r200_context.c b/src/mesa/drivers/dri/r200/r200_context.c index 7a8f270160f..06b2a152d9f 100644 --- a/src/mesa/drivers/dri/r200/r200_context.c +++ b/src/mesa/drivers/dri/r200/r200_context.c @@ -75,6 +75,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define need_GL_EXT_blend_equation_separate #define need_GL_EXT_blend_func_separate #define need_GL_NV_vertex_program +#define need_GL_ARB_point_parameters #include "extension_helper.h" #define DRIVER_DATE "20060602" @@ -170,7 +171,7 @@ const struct dri_extension blend_extensions[] = { { "GL_EXT_blend_func_separate", GL_EXT_blend_func_separate_functions }, { NULL, NULL } }; - + const struct dri_extension ARB_vp_extension[] = { { "GL_ARB_vertex_program", GL_ARB_vertex_program_functions } }; @@ -183,6 +184,12 @@ const struct dri_extension ATI_fs_extension[] = { { "GL_ATI_fragment_shader", GL_ATI_fragment_shader_functions } }; +const struct dri_extension point_extensions[] = { + { "GL_ARB_point_sprite", NULL }, + { "GL_ARB_point_parameters", GL_ARB_point_parameters_functions }, + { NULL, NULL } +}; + extern const struct tnl_pipeline_stage _r200_render_stage; extern const struct tnl_pipeline_stage _r200_tcl_stage; @@ -200,9 +207,9 @@ static const struct tnl_pipeline_stage *r200_pipeline[] = { &_tnl_fog_coordinate_stage, &_tnl_texgen_stage, &_tnl_texture_transform_stage, + &_tnl_point_attenuation_stage, &_tnl_arb_vertex_program_stage, &_tnl_vertex_program_stage, - /* Try again to go to tcl? * - no good for asymmetric-twoside (do with multipass) * - no good for asymmetric-unfilled (do with multipass) @@ -227,12 +234,7 @@ static const struct tnl_pipeline_stage *r200_pipeline[] = { static void r200InitDriverFuncs( struct dd_function_table *functions ) { functions->GetBufferSize = r200GetBufferSize; - functions->ResizeBuffers = _mesa_resize_framebuffer; functions->GetString = r200GetString; - - functions->Error = NULL; - functions->DrawPixels = NULL; - functions->Bitmap = NULL; } static const struct dri_debug_control debug_control[] = @@ -485,6 +487,8 @@ GLboolean r200CreateContext( const __GLcontextModes *glVisual, if ((ctx->Const.MaxTextureUnits == 6) && rmesa->r200Screen->drmSupportsFragShader) driInitSingleExtension( ctx, ATI_fs_extension ); + if (rmesa->r200Screen->drmSupportsPointSprites) + driInitExtensions( ctx, point_extensions, GL_FALSE ); #if 0 r200InitDriverFuncs( ctx ); r200InitIoctlFuncs( ctx ); @@ -694,7 +698,8 @@ r200MakeCurrent( __DRIcontextPrivate *driContextPriv, fprintf(stderr, "%s ctx %p\n", __FUNCTION__, (void *)newCtx->glCtx); if ( newCtx->dri.drawable != driDrawPriv ) { - driDrawableInitVBlank( driDrawPriv, newCtx->vblank_flags ); + driDrawableInitVBlank( driDrawPriv, newCtx->vblank_flags, + &newCtx->vbl_seq ); newCtx->dri.drawable = driDrawPriv; r200UpdateWindow( newCtx->glCtx ); r200UpdateViewportOffset( newCtx->glCtx ); diff --git a/src/mesa/drivers/dri/r200/r200_context.h b/src/mesa/drivers/dri/r200/r200_context.h index b7ee33aa6c9..c6910f5238a 100644 --- a/src/mesa/drivers/dri/r200/r200_context.h +++ b/src/mesa/drivers/dri/r200/r200_context.h @@ -102,10 +102,14 @@ typedef void (*r200_point_func)( r200ContextPtr, struct r200_vertex_program { struct gl_vertex_program mesa_program; /* Must be first */ int translated; - VERTEX_SHADER_INSTRUCTION instr[R200_VSF_MAX_INST + 3]; + /* need excess instr: 1 for late loop checking, 2 for + additional instr due to instr/attr, 3 for fog */ + VERTEX_SHADER_INSTRUCTION instr[R200_VSF_MAX_INST + 6]; int pos_end; int inputs[VERT_ATTRIB_MAX]; int native; + int fogpidx; + int fogmode; }; struct r200_colorbuffer_state { @@ -445,9 +449,29 @@ struct r200_state_atom { /* SPR - point sprite state */ -#define SPR_CMD_0 0 -#define SPR_POINT_SPRITE_CNTL 1 -#define SPR_STATE_SIZE 2 +#define SPR_CMD_0 0 +#define SPR_POINT_SPRITE_CNTL 1 +#define SPR_STATE_SIZE 2 + +#define PTP_CMD_0 0 +#define PTP_VPORT_SCALE_0 1 +#define PTP_VPORT_SCALE_1 2 +#define PTP_VPORT_SCALE_PTSIZE 3 +#define PTP_VPORT_SCALE_3 4 +#define PTP_CMD_1 5 +#define PTP_ATT_CONST_QUAD 6 +#define PTP_ATT_CONST_LIN 7 +#define PTP_ATT_CONST_CON 8 +#define PTP_ATT_CONST_3 9 +#define PTP_EYE_X 10 +#define PTP_EYE_Y 11 +#define PTP_EYE_Z 12 +#define PTP_EYE_3 13 +#define PTP_CLAMP_MIN 14 +#define PTP_CLAMP_MAX 15 +#define PTP_CLAMP_2 16 +#define PTP_CLAMP_3 17 +#define PTP_STATE_SIZE 18 #define VTX_COLOR(v,n) (((v)>>(R200_VTX_COLOR_0_SHIFT+(n)*2))&\ R200_VTX_COLOR_MASK) @@ -614,6 +638,7 @@ struct r200_hw_state { struct r200_state_atom vpp[2]; struct r200_state_atom atf; struct r200_state_atom spr; + struct r200_state_atom ptp; int max_state_size; /* Number of bytes necessary for a full state emit. */ GLboolean is_dirty, all_dirty; @@ -700,8 +725,8 @@ struct r200_tcl_info { GLint last_offset; GLuint hw_primitive; -/* FIXME: what's the maximum number of components? */ - struct r200_dma_region *aos_components[11]; +/* hw can handle 12 components max */ + struct r200_dma_region *aos_components[12]; GLuint nr_aos_components; GLuint *Elts; @@ -713,6 +738,7 @@ struct r200_tcl_info { struct r200_dma_region fog; struct r200_dma_region tex[R200_MAX_TEXTURE_UNITS]; struct r200_dma_region norm; + struct r200_dma_region generic[16]; }; diff --git a/src/mesa/drivers/dri/r200/r200_fragshader.c b/src/mesa/drivers/dri/r200/r200_fragshader.c index 7993e3015a4..c350b9aaf3f 100644 --- a/src/mesa/drivers/dri/r200/r200_fragshader.c +++ b/src/mesa/drivers/dri/r200/r200_fragshader.c @@ -132,10 +132,10 @@ static void r200UpdateFSArith( GLcontext *ctx ) R200_STATECHANGE( rmesa, afs[1] ); if (shader->NumPasses < 2) { - afs_cmd = rmesa->hw.afs[1].cmd; + afs_cmd = (GLuint *) rmesa->hw.afs[1].cmd; } else { - afs_cmd = rmesa->hw.afs[0].cmd; + afs_cmd = (GLuint *) rmesa->hw.afs[0].cmd; } for (pass = 0; pass < shader->NumPasses; pass++) { GLuint opnum = 0; @@ -317,7 +317,7 @@ static void r200UpdateFSArith( GLcontext *ctx ) SET_INST(opnum, 1), SET_INST_2(opnum, 1));*/ opnum++; } - afs_cmd = rmesa->hw.afs[1].cmd; + afs_cmd = (GLuint *) rmesa->hw.afs[1].cmd; } rmesa->afs_loaded = ctx->ATIFragmentShader.Current; } diff --git a/src/mesa/drivers/dri/r200/r200_ioctl.c b/src/mesa/drivers/dri/r200/r200_ioctl.c index 650d7cfdf2b..463bd64415b 100644 --- a/src/mesa/drivers/dri/r200/r200_ioctl.c +++ b/src/mesa/drivers/dri/r200/r200_ioctl.c @@ -605,18 +605,17 @@ void r200PageFlip( const __DRIdrawablePrivate *dPriv ) /* ================================================================ * Buffer clear */ -static void r200Clear( GLcontext *ctx, GLbitfield mask, GLboolean all, - GLint cx, GLint cy, GLint cw, GLint ch ) +static void r200Clear( GLcontext *ctx, GLbitfield mask ) { r200ContextPtr rmesa = R200_CONTEXT(ctx); __DRIdrawablePrivate *dPriv = rmesa->dri.drawable; GLuint flags = 0; GLuint color_mask = 0; GLint ret, i; + GLint cx, cy, cw, ch; if ( R200_DEBUG & DEBUG_IOCTL ) { - fprintf( stderr, "%s: all=%d cx=%d cy=%d cw=%d ch=%d\n", - __FUNCTION__, all, cx, cy, cw, ch ); + fprintf( stderr, "r200Clear\n"); } { @@ -653,7 +652,7 @@ static void r200Clear( GLcontext *ctx, GLbitfield mask, GLboolean all, if ( mask ) { if (R200_DEBUG & DEBUG_FALLBACKS) fprintf(stderr, "%s: swrast clear, mask: %x\n", __FUNCTION__, mask); - _swrast_Clear( ctx, mask, all, cx, cy, cw, ch ); + _swrast_Clear( ctx, mask ); } if ( !flags ) @@ -670,12 +669,18 @@ static void r200Clear( GLcontext *ctx, GLbitfield mask, GLboolean all, } } + LOCK_HARDWARE( rmesa ); + + /* compute region after locking: */ + cx = ctx->DrawBuffer->_Xmin; + cy = ctx->DrawBuffer->_Ymin; + cw = ctx->DrawBuffer->_Xmax - cx; + ch = ctx->DrawBuffer->_Ymax - cy; + /* Flip top to bottom */ cx += dPriv->x; cy = dPriv->y + dPriv->h - cy - ch; - LOCK_HARDWARE( rmesa ); - /* Throttle the number of clear ioctls we do. */ while ( 1 ) { @@ -717,7 +722,8 @@ static void r200Clear( GLcontext *ctx, GLbitfield mask, GLboolean all, drm_radeon_clear_rect_t depth_boxes[RADEON_NR_SAREA_CLIPRECTS]; GLint n = 0; - if ( !all ) { + if (cw != dPriv->w || ch != dPriv->h) { + /* clear subregion */ for ( ; i < nr ; i++ ) { GLint x = box[i].x1; GLint y = box[i].y1; @@ -739,6 +745,7 @@ static void r200Clear( GLcontext *ctx, GLbitfield mask, GLboolean all, n++; } } else { + /* clear whole window */ for ( ; i < nr ; i++ ) { *b++ = box[i]; n++; diff --git a/src/mesa/drivers/dri/r200/r200_maos_arrays.c b/src/mesa/drivers/dri/r200/r200_maos_arrays.c index 12ea462a400..f6ab2f00746 100644 --- a/src/mesa/drivers/dri/r200/r200_maos_arrays.c +++ b/src/mesa/drivers/dri/r200/r200_maos_arrays.c @@ -385,8 +385,8 @@ void r200EmitArrays( GLcontext *ctx, GLuint inputs ) GLuint vfmt0 = 0, vfmt1 = 0; GLuint count = VB->Count; GLuint i; - - if (1) { + + if (inputs & VERT_BIT_POS) { if (!rmesa->tcl.obj.buf) emit_vector( ctx, &rmesa->tcl.obj, @@ -404,7 +404,6 @@ void r200EmitArrays( GLcontext *ctx, GLuint inputs ) } component[nr++] = &rmesa->tcl.obj; } - if (inputs & VERT_BIT_NORMAL) { if (!rmesa->tcl.norm.buf) @@ -420,12 +419,21 @@ void r200EmitArrays( GLcontext *ctx, GLuint inputs ) } if (inputs & VERT_BIT_FOG) { - if (!rmesa->tcl.fog.buf) - emit_vecfog( ctx, - &(rmesa->tcl.fog), - (char *)VB->FogCoordPtr->data, - VB->FogCoordPtr->stride, - count); + if (!rmesa->tcl.fog.buf) { + if (ctx->VertexProgram._Enabled) + emit_vector( ctx, + &(rmesa->tcl.fog), + (char *)VB->FogCoordPtr->data, + 1, + VB->FogCoordPtr->stride, + count); + else + emit_vecfog( ctx, + &(rmesa->tcl.fog), + (char *)VB->FogCoordPtr->data, + VB->FogCoordPtr->stride, + count); + } vfmt0 |= R200_VTX_DISCRETE_FOG; component[nr++] = &rmesa->tcl.fog; @@ -472,7 +480,7 @@ void r200EmitArrays( GLcontext *ctx, GLuint inputs ) vfmt0 |= R200_VTX_FP_RGB << R200_VTX_COLOR_1_SHIFT; component[nr++] = &rmesa->tcl.spec; } - + for ( i = 0 ; i < ctx->Const.MaxTextureUnits ; i++ ) { if (inputs & (VERT_BIT_TEX0 << i)) { if (!rmesa->tcl.tex[i].buf) @@ -488,6 +496,50 @@ void r200EmitArrays( GLcontext *ctx, GLuint inputs ) } } + if (ctx->VertexProgram._Enabled) { + int *vp_inputs = rmesa->curr_vp_hw->inputs; + for ( i = VERT_ATTRIB_GENERIC0; i < VERT_ATTRIB_MAX; i++ ) { + if (inputs & (1 << i)) { + int geninput = i - VERT_ATTRIB_GENERIC0; + if (!rmesa->tcl.generic[geninput].buf) { + emit_vector( ctx, + &(rmesa->tcl.generic[geninput]), + (char *)VB->AttribPtr[i]->data, + 4, + VB->AttribPtr[i]->stride, + count ); + } + component[nr++] = &rmesa->tcl.generic[geninput]; + switch (vp_inputs[i]) { + case 0: + vfmt0 |= R200_VTX_W0 | R200_VTX_Z0; + break; + case 2: + case 3: + case 4: + case 5: + vfmt0 |= R200_VTX_FP_RGBA << (R200_VTX_COLOR_0_SHIFT + (vp_inputs[i] - 2) * 2); + break; + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + vfmt1 |= 4 << (R200_VTX_TEX0_COMP_CNT_SHIFT + (vp_inputs[i] - 6) * 3); + break; + case 13: + vfmt0 |= R200_VTX_XY1 | R200_VTX_Z1 | R200_VTX_W1; + break; + case 1: + case 12: + default: + assert(0); + } + } + } + } + if (vfmt0 != rmesa->hw.vtx.cmd[VTX_VTXFMT_0] || vfmt1 != rmesa->hw.vtx.cmd[VTX_VTXFMT_1]) { R200_STATECHANGE( rmesa, vtx ); @@ -513,7 +565,7 @@ void r200ReleaseArrays( GLcontext *ctx, GLuint newinputs ) if (newinputs & VERT_BIT_NORMAL) r200ReleaseDmaRegion( rmesa, &rmesa->tcl.norm, __FUNCTION__ ); - + if (newinputs & VERT_BIT_FOG) r200ReleaseDmaRegion( rmesa, &rmesa->tcl.fog, __FUNCTION__ ); @@ -527,4 +579,14 @@ void r200ReleaseArrays( GLcontext *ctx, GLuint newinputs ) if (newinputs & VERT_BIT_TEX(unit)) r200ReleaseDmaRegion( rmesa, &rmesa->tcl.tex[unit], __FUNCTION__ ); } + + if (ctx->VertexProgram._Enabled) { + int i; + for (i = VERT_ATTRIB_GENERIC0; i < VERT_ATTRIB_MAX; i++) { + if (newinputs & (1 << i)) + r200ReleaseDmaRegion( rmesa, + &rmesa->tcl.generic[i - VERT_ATTRIB_GENERIC0], __FUNCTION__ ); + } + } + } diff --git a/src/mesa/drivers/dri/r200/r200_pixel.c b/src/mesa/drivers/dri/r200/r200_pixel.c index 1f711bbee5a..7b060f9cf0d 100644 --- a/src/mesa/drivers/dri/r200/r200_pixel.c +++ b/src/mesa/drivers/dri/r200/r200_pixel.c @@ -482,14 +482,6 @@ r200Bitmap( GLcontext *ctx, GLint px, GLint py, void r200InitPixelFuncs( GLcontext *ctx ) { - /* Pixel path fallbacks. - */ - ctx->Driver.Accum = _swrast_Accum; - ctx->Driver.Bitmap = _swrast_Bitmap; - ctx->Driver.CopyPixels = _swrast_CopyPixels; - ctx->Driver.DrawPixels = _swrast_DrawPixels; - ctx->Driver.ReadPixels = _swrast_ReadPixels; - if (!getenv("R200_NO_BLITS")) { ctx->Driver.ReadPixels = r200ReadPixels; ctx->Driver.DrawPixels = r200DrawPixels; diff --git a/src/mesa/drivers/dri/r200/r200_reg.h b/src/mesa/drivers/dri/r200/r200_reg.h index dab08a9eb73..a88ea4cec26 100644 --- a/src/mesa/drivers/dri/r200/r200_reg.h +++ b/src/mesa/drivers/dri/r200/r200_reg.h @@ -250,6 +250,10 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define R200_ZBIAS_ENABLE_LINE (1 << 17) #define R200_ZBIAS_ENABLE_TRI (1 << 18) #define R200_WIDELINE_ENABLE (1 << 20) +#define R200_DISC_FOG_SHADE_SOLID (0 << 24) +#define R200_DISC_FOG_SHADE_FLAT (1 << 24) +#define R200_DISC_FOG_SHADE_GOURAUD (2 << 24) +#define R200_DISC_FOG_SHADE_MASK (3 << 24) #define R200_VTX_PIX_CENTER_D3D (0 << 27) #define R200_VTX_PIX_CENTER_OGL (1 << 27) #define R200_ROUND_MODE_TRUNC (0 << 28) @@ -659,7 +663,25 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define R200_CULL_FRONT (1<<29) #define R200_CULL_BACK (1<<30) #define R200_SE_TCL_POINT_SPRITE_CNTL 0x22c4 -#define R200_POINTSIZE_SEL_STATE (1<<16) +#define R200_PS_MULT_PVATTENCONST (0<<0) +#define R200_PS_MULT_PVATTEN (1<<0) +#define R200_PS_MULT_ATTENCONST (2<<0) +#define R200_PS_MULT_PVCONST (3<<0) +#define R200_PS_MULT_CONST (4<<0) +#define R200_PS_MULT_MASK (7<<0) +#define R200_PS_LIN_ATT_ZERO (1<<3) +#define R200_PS_USE_MODEL_EYE_VEC (1<<4) +#define R200_PS_ATT_ALPHA (1<<5) +#define R200_PS_UCP_MODE_MASK (3<<6) +#define R200_PS_GEN_TEX_0 (1<<8) +#define R200_PS_GEN_TEX_1 (1<<9) +#define R200_PS_GEN_TEX_2 (1<<10) +#define R200_PS_GEN_TEX_3 (1<<11) +#define R200_PS_GEN_TEX_4 (1<<12) +#define R200_PS_GEN_TEX_5 (1<<13) +#define R200_PS_GEN_TEX_0_SHIFT (8) +#define R200_PS_GEN_TEX_MASK (0x3f<<8) +#define R200_PS_SE_SEL_STATE (1<<16) /* gap */ /* taken from r300, see comments there */ #define R200_VAP_PVS_CNTL_1 0x22d0 diff --git a/src/mesa/drivers/dri/r200/r200_state.c b/src/mesa/drivers/dri/r200/r200_state.c index ac9e20e28ad..097fbc868a4 100644 --- a/src/mesa/drivers/dri/r200/r200_state.c +++ b/src/mesa/drivers/dri/r200/r200_state.c @@ -490,7 +490,7 @@ static void r200Fogfv( GLcontext *ctx, GLenum pname, const GLfloat *param ) GLuint fog = rmesa->hw.ctx.cmd[CTX_PP_FOG_COLOR]; fog &= ~R200_FOG_USE_MASK; - if ( ctx->Fog.FogCoordinateSource == GL_FOG_COORD ) { + if ( ctx->Fog.FogCoordinateSource == GL_FOG_COORD || ctx->VertexProgram.Enabled) { fog |= R200_FOG_USE_VTX_FOG; out_0 |= R200_VTX_DISCRETE_FOG; } @@ -686,10 +686,80 @@ static void r200FrontFace( GLcontext *ctx, GLenum mode ) static void r200PointSize( GLcontext *ctx, GLfloat size ) { r200ContextPtr rmesa = R200_CONTEXT(ctx); + GLfloat *fcmd = (GLfloat *)rmesa->hw.ptp.cmd; R200_STATECHANGE( rmesa, cst ); + R200_STATECHANGE( rmesa, ptp ); rmesa->hw.cst.cmd[CST_RE_POINTSIZE] &= ~0xffff; rmesa->hw.cst.cmd[CST_RE_POINTSIZE] |= ((GLuint)(ctx->Point.Size * 16.0)); +/* this is the size param of the point size calculation (point size reg value + is not used when calculation is active). */ + fcmd[PTP_VPORT_SCALE_PTSIZE] = ctx->Point.Size; +} + +static void r200PointParameter( GLcontext *ctx, GLenum pname, const GLfloat *params) +{ + r200ContextPtr rmesa = R200_CONTEXT(ctx); + GLfloat *fcmd = (GLfloat *)rmesa->hw.ptp.cmd; + + switch (pname) { + case GL_POINT_SIZE_MIN: + /* Can clamp both in tcl and setup - just set both (as does fglrx) */ + R200_STATECHANGE( rmesa, lin ); + R200_STATECHANGE( rmesa, ptp ); + rmesa->hw.lin.cmd[LIN_SE_LINE_WIDTH] &= 0xffff; + rmesa->hw.lin.cmd[LIN_SE_LINE_WIDTH] |= (GLuint)(ctx->Point.MinSize * 16.0) << 16; + fcmd[PTP_CLAMP_MIN] = ctx->Point.MinSize; + break; + case GL_POINT_SIZE_MAX: + R200_STATECHANGE( rmesa, cst ); + R200_STATECHANGE( rmesa, ptp ); + rmesa->hw.cst.cmd[CST_RE_POINTSIZE] &= 0xffff; + rmesa->hw.cst.cmd[CST_RE_POINTSIZE] |= (GLuint)(ctx->Point.MaxSize * 16.0) << 16; + fcmd[PTP_CLAMP_MAX] = ctx->Point.MaxSize; + break; + case GL_POINT_DISTANCE_ATTENUATION: + R200_STATECHANGE( rmesa, vtx ); + R200_STATECHANGE( rmesa, spr ); + R200_STATECHANGE( rmesa, ptp ); + GLfloat *fcmd = (GLfloat *)rmesa->hw.ptp.cmd; + rmesa->hw.spr.cmd[SPR_POINT_SPRITE_CNTL] &= + ~(R200_PS_MULT_MASK | R200_PS_LIN_ATT_ZERO | R200_PS_SE_SEL_STATE); + /* can't rely on ctx->Point._Attenuated here and test for NEW_POINT in + r200ValidateState looks like overkill */ + if (ctx->Point.Params[0] != 1.0 || + ctx->Point.Params[1] != 0.0 || + ctx->Point.Params[2] != 0.0 || + (ctx->VertexProgram.Enabled && ctx->VertexProgram.PointSizeEnabled)) { + /* all we care for vp would be the ps_se_sel_state setting */ + fcmd[PTP_ATT_CONST_QUAD] = ctx->Point.Params[2]; + fcmd[PTP_ATT_CONST_LIN] = ctx->Point.Params[1]; + fcmd[PTP_ATT_CONST_CON] = ctx->Point.Params[0]; + rmesa->hw.spr.cmd[SPR_POINT_SPRITE_CNTL] |= R200_PS_MULT_ATTENCONST; + if (ctx->Point.Params[1] == 0.0) + rmesa->hw.spr.cmd[SPR_POINT_SPRITE_CNTL] |= R200_PS_LIN_ATT_ZERO; +/* FIXME: setting this here doesn't look quite ok - we only want to do + that if we're actually drawing points probably */ + rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_COMPSEL] |= R200_OUTPUT_PT_SIZE; + rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_VTXFMT_0] |= R200_VTX_POINT_SIZE; + } + else { + rmesa->hw.spr.cmd[SPR_POINT_SPRITE_CNTL] |= + R200_PS_SE_SEL_STATE | R200_PS_MULT_CONST; + rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_COMPSEL] &= ~R200_OUTPUT_PT_SIZE; + rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_VTXFMT_0] &= ~R200_VTX_POINT_SIZE; + } + break; + case GL_POINT_FADE_THRESHOLD_SIZE: + /* don't support multisampling, so doesn't matter. */ + break; + /* can't do these but don't need them. + case GL_POINT_SPRITE_R_MODE_NV: + case GL_POINT_SPRITE_COORD_ORIGIN: */ + default: + fprintf(stderr, "bad pname parameter in r200PointParameter\n"); + return; + } } /* ============================================================= @@ -1382,20 +1452,23 @@ static void r200ShadeModel( GLcontext *ctx, GLenum mode ) s &= ~(R200_DIFFUSE_SHADE_MASK | R200_ALPHA_SHADE_MASK | R200_SPECULAR_SHADE_MASK | - R200_FOG_SHADE_MASK); + R200_FOG_SHADE_MASK | + R200_DISC_FOG_SHADE_MASK); switch ( mode ) { case GL_FLAT: s |= (R200_DIFFUSE_SHADE_FLAT | R200_ALPHA_SHADE_FLAT | R200_SPECULAR_SHADE_FLAT | - R200_FOG_SHADE_FLAT); + R200_FOG_SHADE_FLAT | + R200_DISC_FOG_SHADE_FLAT); break; case GL_SMOOTH: s |= (R200_DIFFUSE_SHADE_GOURAUD | R200_ALPHA_SHADE_GOURAUD | R200_SPECULAR_SHADE_GOURAUD | - R200_FOG_SHADE_GOURAUD); + R200_FOG_SHADE_GOURAUD | + R200_DISC_FOG_SHADE_GOURAUD); break; default: return; @@ -2032,6 +2105,19 @@ static void r200Enable( GLcontext *ctx, GLenum cap, GLboolean state ) break; #endif + case GL_POINT_SPRITE_ARB: + R200_STATECHANGE( rmesa, spr ); + if ( state ) { + int i; + for (i = 0; i < 6; i++) { + rmesa->hw.spr.cmd[SPR_POINT_SPRITE_CNTL] |= + ctx->Point.CoordReplace[i] << (R200_PS_GEN_TEX_0_SHIFT + i); + } + } else { + rmesa->hw.spr.cmd[SPR_POINT_SPRITE_CNTL] &= ~R200_PS_GEN_TEX_MASK; + } + break; + case GL_POLYGON_OFFSET_FILL: R200_STATECHANGE( rmesa, set ); if ( state ) { @@ -2133,10 +2219,9 @@ static void r200Enable( GLcontext *ctx, GLenum cap, GLboolean state ) rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] &= ~(R200_UCP_ENABLE_0 << i); }*/ } - /* FIXME: ugly as hell. need to call everything which might change tcl_output_vtxfmt0/1 and compsel */ + /* ugly. Need to call everything which might change compsel. */ r200UpdateSpecular( ctx ); - r200Fogfv( ctx, GL_FOG_COORD_SRC, NULL ); -#if 1 +#if 0 /* shouldn't be necessary, as it's picked up anyway in r200ValidateState (_NEW_PROGRAM), but without it doom3 locks up at always the same places. Why? */ /* FIXME: This can (and should) be replaced by a call to the TCL_STATE_FLUSH reg before @@ -2165,6 +2250,13 @@ static void r200Enable( GLcontext *ctx, GLenum cap, GLboolean state ) else { /* picked up later */ } + /* call functions which change hw state based on ARB_vp enabled or not. */ + r200PointParameter( ctx, GL_POINT_DISTANCE_ATTENUATION, NULL ); + r200Fogfv( ctx, GL_FOG_COORD_SRC, NULL ); + break; + + case GL_VERTEX_PROGRAM_POINT_SIZE_ARB: + r200PointParameter( ctx, GL_POINT_DISTANCE_ATTENUATION, NULL ); break; case GL_FRAGMENT_SHADER_ATI: @@ -2516,6 +2608,7 @@ void r200InitStateFuncs( struct dd_function_table *functions ) functions->PolygonMode = r200PolygonMode; functions->PolygonOffset = r200PolygonOffset; functions->PolygonStipple = r200PolygonStipple; + functions->PointParameterfv = r200PointParameter; functions->PointSize = r200PointSize; functions->RenderMode = r200RenderMode; functions->Scissor = r200Scissor; @@ -2524,13 +2617,6 @@ void r200InitStateFuncs( struct dd_function_table *functions ) functions->StencilMaskSeparate = r200StencilMaskSeparate; functions->StencilOpSeparate = r200StencilOpSeparate; functions->Viewport = r200Viewport; - - /* Swrast hooks for imaging extensions: - */ - functions->CopyColorTable = _swrast_CopyColorTable; - functions->CopyColorSubTable = _swrast_CopyColorSubTable; - functions->CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D; - functions->CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D; } diff --git a/src/mesa/drivers/dri/r200/r200_state_init.c b/src/mesa/drivers/dri/r200/r200_state_init.c index ffca7ea5fa1..d95a80c7bbc 100644 --- a/src/mesa/drivers/dri/r200/r200_state_init.c +++ b/src/mesa/drivers/dri/r200/r200_state_init.c @@ -398,10 +398,14 @@ void r200InitState( r200ContextPtr rmesa ) else { ALLOC_STATE( prf, never, PRF_STATE_SIZE, "PRF/performance-tri", 0 ); } - if (rmesa->r200Screen->drmSupportsPointSprites) + if (rmesa->r200Screen->drmSupportsPointSprites) { ALLOC_STATE( spr, always, SPR_STATE_SIZE, "SPR/pointsprite", 0 ); - else + ALLOC_STATE( ptp, tcl, PTP_STATE_SIZE, "PTP/pointparams", 0 ); + } + else { ALLOC_STATE (spr, never, SPR_STATE_SIZE, "SPR/pointsprite", 0 ); + ALLOC_STATE (ptp, never, PTP_STATE_SIZE, "PTP/pointparams", 0 ); + } r200SetUpAtomList( rmesa ); @@ -546,6 +550,11 @@ void r200InitState( r200ContextPtr rmesa ) cmdvec( R200_VS_UCP_ADDR + i, 1, 4 ); } + rmesa->hw.ptp.cmd[PTP_CMD_0] = + cmdvec( R200_VS_PNT_SPRITE_VPORT_SCALE, 1, 4 ); + rmesa->hw.ptp.cmd[PTP_CMD_1] = + cmdvec( R200_VS_PNT_SPRITE_ATT_CONST, 1, 12 ); + /* Initial Harware state: */ rmesa->hw.ctx.cmd[CTX_PP_MISC] = (R200_ALPHA_TEST_PASS @@ -653,6 +662,7 @@ void r200InitState( r200ContextPtr rmesa ) R200_ALPHA_SHADE_GOURAUD | R200_SPECULAR_SHADE_GOURAUD | R200_FOG_SHADE_GOURAUD | + R200_DISC_FOG_SHADE_GOURAUD | R200_VTX_PIX_CENTER_OGL | R200_ROUND_MODE_TRUNC | R200_ROUND_PREC_8TH_PIX); @@ -931,7 +941,31 @@ void r200InitState( r200ContextPtr rmesa ) rmesa->hw.eye.cmd[EYE_Z] = IEEE_ONE; rmesa->hw.eye.cmd[EYE_RESCALE_FACTOR] = IEEE_ONE; - rmesa->hw.spr.cmd[SPR_POINT_SPRITE_CNTL] = R200_POINTSIZE_SEL_STATE; + rmesa->hw.spr.cmd[SPR_POINT_SPRITE_CNTL] = + R200_PS_SE_SEL_STATE | R200_PS_MULT_CONST; + + /* ptp_eye is presumably used to calculate the attenuation wrt a different + location? In any case, since point attenuation triggers _needeyecoords, + it is constant. Probably ignored as long as R200_PS_USE_MODEL_EYE_VEC + isn't set */ + rmesa->hw.ptp.cmd[PTP_EYE_X] = 0; + rmesa->hw.ptp.cmd[PTP_EYE_Y] = 0; + rmesa->hw.ptp.cmd[PTP_EYE_Z] = IEEE_ONE | 0x80000000; /* -1.0 */ + rmesa->hw.ptp.cmd[PTP_EYE_3] = 0; + /* no idea what the ptp_vport_scale values are good for, except the + PTSIZE one - hopefully doesn't matter */ + rmesa->hw.ptp.cmd[PTP_VPORT_SCALE_0] = IEEE_ONE; + rmesa->hw.ptp.cmd[PTP_VPORT_SCALE_1] = IEEE_ONE; + rmesa->hw.ptp.cmd[PTP_VPORT_SCALE_PTSIZE] = IEEE_ONE; + rmesa->hw.ptp.cmd[PTP_VPORT_SCALE_3] = IEEE_ONE; + rmesa->hw.ptp.cmd[PTP_ATT_CONST_QUAD] = 0; + rmesa->hw.ptp.cmd[PTP_ATT_CONST_LIN] = 0; + rmesa->hw.ptp.cmd[PTP_ATT_CONST_CON] = IEEE_ONE; + rmesa->hw.ptp.cmd[PTP_ATT_CONST_3] = 0; + rmesa->hw.ptp.cmd[PTP_CLAMP_MIN] = IEEE_ONE; + rmesa->hw.ptp.cmd[PTP_CLAMP_MAX] = 0x44ffe000; /* 2047 */ + rmesa->hw.ptp.cmd[PTP_CLAMP_2] = 0; + rmesa->hw.ptp.cmd[PTP_CLAMP_3] = 0; r200LightingSpaceChange( ctx ); diff --git a/src/mesa/drivers/dri/r200/r200_swtcl.c b/src/mesa/drivers/dri/r200/r200_swtcl.c index aa78f382868..c14a275f7a3 100644 --- a/src/mesa/drivers/dri/r200/r200_swtcl.c +++ b/src/mesa/drivers/dri/r200/r200_swtcl.c @@ -117,6 +117,11 @@ static void r200SetVertexFormat( GLcontext *ctx ) offset = 3; } + if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_POINTSIZE )) { + EMIT_ATTR( _TNL_ATTRIB_POINTSIZE, EMIT_1F, R200_VTX_POINT_SIZE ); + offset += 1; + } + rmesa->swtcl.coloroffset = offset; #if MESA_LITTLE_ENDIAN EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4UB_4F_RGBA, (R200_VTX_PK_RGBA << R200_VTX_COLOR_0_SHIFT) ); @@ -349,7 +354,9 @@ static INLINE GLuint reduced_hw_prim( GLcontext *ctx, GLuint prim) { switch (prim) { case GL_POINTS: - return (ctx->_TriangleCaps & DD_POINT_SIZE) ? + return (ctx->Point.PointSprite || + ((ctx->_TriangleCaps & (DD_POINT_SIZE | DD_POINT_ATTEN)) && + !(ctx->_TriangleCaps & (DD_POINT_SMOOTH)))) ? R200_VF_PRIM_POINT_SPRITES : R200_VF_PRIM_POINTS; case GL_LINES: /* fallthrough */ @@ -632,6 +639,17 @@ static void r200RasterPrimitive( GLcontext *ctx, GLuint hwprim ) r200ContextPtr rmesa = R200_CONTEXT(ctx); if (rmesa->swtcl.hw_primitive != hwprim) { + /* need to disable perspective-correct texturing for point sprites */ + if ((hwprim & 0xf) == R200_VF_PRIM_POINT_SPRITES && ctx->Point.PointSprite) { + if (rmesa->hw.set.cmd[SET_RE_CNTL] & R200_PERSPECTIVE_ENABLE) { + R200_STATECHANGE( rmesa, set ); + rmesa->hw.set.cmd[SET_RE_CNTL] &= ~R200_PERSPECTIVE_ENABLE; + } + } + else if (!(rmesa->hw.set.cmd[SET_RE_CNTL] & R200_PERSPECTIVE_ENABLE)) { + R200_STATECHANGE( rmesa, set ); + rmesa->hw.set.cmd[SET_RE_CNTL] |= R200_PERSPECTIVE_ENABLE; + } R200_NEWPRIM( rmesa ); rmesa->swtcl.hw_primitive = hwprim; } diff --git a/src/mesa/drivers/dri/r200/r200_tcl.c b/src/mesa/drivers/dri/r200/r200_tcl.c index 18b5458a97b..86edf7132ce 100644 --- a/src/mesa/drivers/dri/r200/r200_tcl.c +++ b/src/mesa/drivers/dri/r200/r200_tcl.c @@ -68,7 +68,9 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define HAVE_ELTS 1 -#define HW_POINTS ((ctx->_TriangleCaps & DD_POINT_SIZE) ? \ +#define HW_POINTS ((ctx->Point.PointSprite || \ + ((ctx->_TriangleCaps & (DD_POINT_SIZE | DD_POINT_ATTEN)) && \ + !(ctx->_TriangleCaps & (DD_POINT_SMOOTH)))) ? \ R200_VF_PRIM_POINT_SPRITES : R200_VF_PRIM_POINTS) #define HW_LINES R200_VF_PRIM_LINES #define HW_LINE_LOOP 0 @@ -268,6 +270,17 @@ void r200TclPrimitive( GLcontext *ctx, if (newprim != rmesa->tcl.hw_primitive || !discrete_prim[hw_prim&0xf]) { + /* need to disable perspective-correct texturing for point sprites */ + if ((prim & PRIM_MODE_MASK) == GL_POINTS && ctx->Point.PointSprite) { + if (rmesa->hw.set.cmd[SET_RE_CNTL] & R200_PERSPECTIVE_ENABLE) { + R200_STATECHANGE( rmesa, set ); + rmesa->hw.set.cmd[SET_RE_CNTL] &= ~R200_PERSPECTIVE_ENABLE; + } + } + else if (!(rmesa->hw.set.cmd[SET_RE_CNTL] & R200_PERSPECTIVE_ENABLE)) { + R200_STATECHANGE( rmesa, set ); + rmesa->hw.set.cmd[SET_RE_CNTL] |= R200_PERSPECTIVE_ENABLE; + } R200_NEWPRIM( rmesa ); rmesa->tcl.hw_primitive = newprim; } @@ -371,7 +384,7 @@ static GLboolean r200_run_tcl_render( GLcontext *ctx, r200ContextPtr rmesa = R200_CONTEXT(ctx); TNLcontext *tnl = TNL_CONTEXT(ctx); struct vertex_buffer *VB = &tnl->vb; - GLuint inputs = VERT_BIT_POS | VERT_BIT_COLOR0; + GLuint inputs = 0; GLuint i; /* TODO: separate this from the swtnl pipeline @@ -391,6 +404,7 @@ static GLboolean r200_run_tcl_render( GLcontext *ctx, r200ValidateState( ctx ); if (!ctx->VertexProgram._Enabled) { + inputs = VERT_BIT_POS | VERT_BIT_COLOR0; /* NOTE: inputs != tnl->render_inputs - these are the untransformed * inputs. */ @@ -416,60 +430,43 @@ static GLboolean r200_run_tcl_render( GLcontext *ctx, } } else { - GLuint out_vtxfmt0 = 0; - GLuint out_vtxfmt1 = 0; + /* vtx_tcl_output_vtxfmt_0/1 need to match configuration of "fragment + part", since using some vertex interpolator later which is not in + out_vtxfmt0/1 will lock up. It seems to be ok to write in vertex + prog to a not enabled output however, so just don't mess with it. + We only need to change compsel. */ GLuint out_compsel = 0; GLuint vp_out = rmesa->curr_vp_hw->mesa_program.Base.OutputsWritten; +#if 0 /* can't handle other inputs, generic attribs etc. currently - should never arrive here */ assert ((rmesa->curr_vp_hw->mesa_program.Base.InputsRead & ~(VERT_BIT_POS | VERT_BIT_NORMAL | VERT_BIT_COLOR0 | VERT_BIT_COLOR1 | VERT_BIT_FOG | VERT_BIT_TEX0 | VERT_BIT_TEX1 | VERT_BIT_TEX2 | VERT_BIT_TEX3 | VERT_BIT_TEX4 | VERT_BIT_TEX5)) == 0); +#endif inputs |= rmesa->curr_vp_hw->mesa_program.Base.InputsRead; - /* FIXME: this is a mess. Not really sure how to set up TCL_OUTPUT_VTXFMT - in "undefined" cases (e.g. output needed later but not written by vertex program or vice versa) - - however misconfiguration here will almost certainly lock up the chip. - I think at the very least we need to enable tcl outputs which we write to. Maybe even need to - fix up a vertex program so an output needed later always gets written? - For now just set the compsel and output_vtxfmt to the outputs written. - However, for simplicity we assume always all 4 values are written which may not be correct - (but I don't know if it could lead to lockups). */ assert(vp_out & (1 << VERT_RESULT_HPOS)); - out_vtxfmt0 = R200_VTX_XY | R200_VTX_Z0 | R200_VTX_W0; - /* FIXME: need to always enable color_0 otherwise doom3's shadow vp (?) will lock up (?) */ - out_vtxfmt0 |= R200_VTX_FP_RGBA << R200_VTX_COLOR_0_SHIFT; out_compsel = R200_OUTPUT_XYZW; if (vp_out & (1 << VERT_RESULT_COL0)) { - out_vtxfmt0 |= R200_VTX_FP_RGBA << R200_VTX_COLOR_0_SHIFT; out_compsel |= R200_OUTPUT_COLOR_0; } if (vp_out & (1 << VERT_RESULT_COL1)) { - out_vtxfmt0 |= R200_VTX_FP_RGBA << R200_VTX_COLOR_1_SHIFT; out_compsel |= R200_OUTPUT_COLOR_1; } - /* FIXME: probably not everything is set up for fogc and psiz to work correctly */ if (vp_out & (1 << VERT_RESULT_FOGC)) { - out_vtxfmt0 |= R200_VTX_DISCRETE_FOG; out_compsel |= R200_OUTPUT_DISCRETE_FOG; } if (vp_out & (1 << VERT_RESULT_PSIZ)) { - out_vtxfmt0 |= R200_VTX_POINT_SIZE; out_compsel |= R200_OUTPUT_PT_SIZE; } for (i = VERT_RESULT_TEX0; i < VERT_RESULT_TEX6; i++) { if (vp_out & (1 << i)) { - out_vtxfmt1 |= 4 << ((i - VERT_RESULT_TEX0) * 3); out_compsel |= R200_OUTPUT_TEX_0 << (i - VERT_RESULT_TEX0); } } - if ((rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_VTXFMT_0] != out_vtxfmt0) || - (rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_VTXFMT_1] != out_vtxfmt1) || - (rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_COMPSEL] != out_compsel)) { + if (rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_COMPSEL] != out_compsel) { R200_STATECHANGE( rmesa, vtx ); - rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_VTXFMT_0] = out_vtxfmt0; - rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_VTXFMT_1] = out_vtxfmt1; rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_COMPSEL] = out_compsel; - /* FIXME: should restore this when disabling vertex programs maybe? */ } } @@ -583,7 +580,7 @@ static void transition_to_hwtnl( GLcontext *ctx ) rmesa->hw.ctx.cmd[CTX_PP_FOG_COLOR] &= ~R200_FOG_USE_MASK; rmesa->hw.ctx.cmd[CTX_PP_FOG_COLOR] |= R200_FOG_USE_VTX_FOG; } - + R200_STATECHANGE( rmesa, vte ); rmesa->hw.vte.cmd[VTE_SE_VTE_CNTL] &= ~(R200_VTX_XY_FMT|R200_VTX_Z_FMT); rmesa->hw.vte.cmd[VTE_SE_VTE_CNTL] |= R200_VTX_W0_FMT; diff --git a/src/mesa/drivers/dri/r200/r200_tex.c b/src/mesa/drivers/dri/r200/r200_tex.c index 3d259c2ca66..6c6450c681f 100644 --- a/src/mesa/drivers/dri/r200/r200_tex.c +++ b/src/mesa/drivers/dri/r200/r200_tex.c @@ -115,7 +115,7 @@ static void r200SetTexWrap( r200TexObjPtr t, GLenum swrap, GLenum twrap, GLenum t->pp_txfilter |= R200_CLAMP_T_CLAMP_LAST; break; case GL_CLAMP_TO_BORDER: - t->pp_txfilter |= R200_CLAMP_T_CLAMP_GL | R200_BORDER_MODE_D3D; + t->pp_txfilter |= R200_CLAMP_T_CLAMP_GL; is_clamp_to_border = GL_TRUE; break; case GL_MIRRORED_REPEAT: @@ -305,6 +305,27 @@ static r200TexObjPtr r200AllocTexObj( struct gl_texture_object *texObj ) return t; } +/* try to find a format which will only need a memcopy */ +static const struct gl_texture_format * +r200Choose8888TexFormat( GLenum srcFormat, GLenum srcType ) +{ + const GLuint ui = 1; + const GLubyte littleEndian = *((const GLubyte *) &ui); + + if ((srcFormat == GL_RGBA && srcType == GL_UNSIGNED_INT_8_8_8_8) || + (srcFormat == GL_RGBA && srcType == GL_UNSIGNED_BYTE && !littleEndian) || + (srcFormat == GL_ABGR_EXT && srcType == GL_UNSIGNED_INT_8_8_8_8_REV) || + (srcFormat == GL_ABGR_EXT && srcType == GL_UNSIGNED_BYTE && littleEndian)) { + return &_mesa_texformat_rgba8888; + } + else if ((srcFormat == GL_RGBA && srcType == GL_UNSIGNED_INT_8_8_8_8_REV) || + (srcFormat == GL_RGBA && srcType == GL_UNSIGNED_BYTE && littleEndian) || + (srcFormat == GL_ABGR_EXT && srcType == GL_UNSIGNED_INT_8_8_8_8) || + (srcFormat == GL_ABGR_EXT && srcType == GL_UNSIGNED_BYTE && !littleEndian)) { + return &_mesa_texformat_rgba8888_rev; + } + else return _dri_texformat_argb8888; +} static const struct gl_texture_format * r200ChooseTextureFormat( GLcontext *ctx, GLint internalFormat, @@ -332,7 +353,8 @@ r200ChooseTextureFormat( GLcontext *ctx, GLint internalFormat, case GL_UNSIGNED_SHORT_1_5_5_5_REV: return _dri_texformat_argb1555; default: - return do32bpt ? _dri_texformat_rgba8888 : _dri_texformat_argb4444; + return do32bpt ? + r200Choose8888TexFormat(format, type) : _dri_texformat_argb4444; } case 3: @@ -349,7 +371,7 @@ r200ChooseTextureFormat( GLcontext *ctx, GLint internalFormat, case GL_UNSIGNED_SHORT_5_6_5_REV: return _dri_texformat_rgb565; default: - return do32bpt ? _dri_texformat_rgba8888 : _dri_texformat_rgb565; + return do32bpt ? _dri_texformat_argb8888 : _dri_texformat_rgb565; } case GL_RGBA8: @@ -357,7 +379,7 @@ r200ChooseTextureFormat( GLcontext *ctx, GLint internalFormat, case GL_RGBA12: case GL_RGBA16: return !force16bpt ? - _dri_texformat_rgba8888 : _dri_texformat_argb4444; + r200Choose8888TexFormat(format, type) : _dri_texformat_argb4444; case GL_RGBA4: case GL_RGBA2: @@ -370,7 +392,7 @@ r200ChooseTextureFormat( GLcontext *ctx, GLint internalFormat, case GL_RGB10: case GL_RGB12: case GL_RGB16: - return !force16bpt ? _dri_texformat_rgba8888 : _dri_texformat_rgb565; + return !force16bpt ? _dri_texformat_argb8888 : _dri_texformat_rgb565; case GL_RGB5: case GL_RGB4: @@ -383,7 +405,9 @@ r200ChooseTextureFormat( GLcontext *ctx, GLint internalFormat, case GL_ALPHA12: case GL_ALPHA16: case GL_COMPRESSED_ALPHA: - return _dri_texformat_a8; + /* can't use a8 format since interpreting hw I8 as a8 would result + in wrong rgb values (same as alpha value instead of 0). */ + return _dri_texformat_al88; case 1: case GL_LUMINANCE: @@ -983,7 +1007,16 @@ static void r200TexEnv( GLcontext *ctx, GLenum target, } break; } - + case GL_COORD_REPLACE_ARB: + if (ctx->Point.PointSprite) { + R200_STATECHANGE( rmesa, spr ); + if ((GLenum)param[0]) { + rmesa->hw.spr.cmd[SPR_POINT_SPRITE_CNTL] |= R200_PS_GEN_TEX_0 << unit; + } else { + rmesa->hw.spr.cmd[SPR_POINT_SPRITE_CNTL] &= ~(R200_PS_GEN_TEX_0 << unit); + } + } + break; default: return; } diff --git a/src/mesa/drivers/dri/r200/r200_texmem.c b/src/mesa/drivers/dri/r200/r200_texmem.c index 14ee8238ad8..28988c97556 100644 --- a/src/mesa/drivers/dri/r200/r200_texmem.c +++ b/src/mesa/drivers/dri/r200/r200_texmem.c @@ -374,6 +374,10 @@ static void uploadSubImage( r200ContextPtr rmesa, r200TexObjPtr t, tex.height = imageHeight; tex.width = imageWidth; tex.format = t->pp_txformat & R200_TXFORMAT_FORMAT_MASK; + if (tex.format == R200_TXFORMAT_ABGR8888) { + /* drm will refuse abgr8888 textures. */ + tex.format = R200_TXFORMAT_ARGB8888; + } tex.pitch = MAX2((texImage->Width * texImage->TexFormat->TexelBytes) / 64, 1); tex.offset += tmp.x & ~1023; tmp.x = tmp.x % 1024; diff --git a/src/mesa/drivers/dri/r200/r200_texstate.c b/src/mesa/drivers/dri/r200/r200_texstate.c index 433bc67e3f3..875d3bab73f 100644 --- a/src/mesa/drivers/dri/r200/r200_texstate.c +++ b/src/mesa/drivers/dri/r200/r200_texstate.c @@ -71,14 +71,14 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define _INVALID(f) \ [ MESA_FORMAT_ ## f ] = { 0xffffffff, 0 } #define VALID_FORMAT(f) ( ((f) <= MESA_FORMAT_RGBA_DXT5) \ - && (tx_table[f].format != 0xffffffff) ) + && (tx_table_le[f].format != 0xffffffff) ) static const struct { GLuint format, filter; } -tx_table[] = +tx_table_be[] = { - _ALPHA(RGBA8888), + [ MESA_FORMAT_RGBA8888 ] = { R200_TXFORMAT_ABGR8888 | R200_TXFORMAT_ALPHA_IN_MAP, 0 }, _ALPHA_REV(RGBA8888), _ALPHA(ARGB8888), _ALPHA_REV(ARGB8888), @@ -105,6 +105,38 @@ tx_table[] = _ALPHA(RGBA_DXT5), }; +static const struct { + GLuint format, filter; +} +tx_table_le[] = +{ + _ALPHA(RGBA8888), + [ MESA_FORMAT_RGBA8888_REV ] = { R200_TXFORMAT_ABGR8888 | R200_TXFORMAT_ALPHA_IN_MAP, 0 }, + _ALPHA(ARGB8888), + _ALPHA_REV(ARGB8888), + _INVALID(RGB888), + _COLOR(RGB565), + _COLOR_REV(RGB565), + _ALPHA(ARGB4444), + _ALPHA_REV(ARGB4444), + _ALPHA(ARGB1555), + _ALPHA_REV(ARGB1555), + _ALPHA(AL88), + _ALPHA_REV(AL88), + _ALPHA(A8), + _COLOR(L8), + _ALPHA(I8), + _INVALID(CI8), + _YUV(YCBCR), + _YUV(YCBCR_REV), + _INVALID(RGB_FXT1), + _INVALID(RGBA_FXT1), + _COLOR(RGB_DXT1), + _ALPHA(RGBA_DXT1), + _ALPHA(RGBA_DXT3), + _ALPHA(RGBA_DXT5), +}; + #undef _COLOR #undef _ALPHA #undef _INVALID @@ -129,6 +161,8 @@ static void r200SetTexImages( r200ContextPtr rmesa, GLint i, texelBytes; GLint numLevels; GLint log2Width, log2Height, log2Depth; + const GLuint ui = 1; + const GLubyte littleEndian = *((const GLubyte *) &ui); /* Set the hardware texture format */ @@ -138,8 +172,14 @@ static void r200SetTexImages( r200ContextPtr rmesa, t->pp_txfilter &= ~R200_YUV_TO_RGB; if ( VALID_FORMAT( baseImage->TexFormat->MesaFormat ) ) { - t->pp_txformat |= tx_table[ baseImage->TexFormat->MesaFormat ].format; - t->pp_txfilter |= tx_table[ baseImage->TexFormat->MesaFormat ].filter; + if (littleEndian) { + t->pp_txformat |= tx_table_le[ baseImage->TexFormat->MesaFormat ].format; + t->pp_txfilter |= tx_table_le[ baseImage->TexFormat->MesaFormat ].filter; + } + else { + t->pp_txformat |= tx_table_be[ baseImage->TexFormat->MesaFormat ].format; + t->pp_txfilter |= tx_table_be[ baseImage->TexFormat->MesaFormat ].filter; + } } else { _mesa_problem(NULL, "unexpected texture format in %s", __FUNCTION__); @@ -1138,7 +1178,7 @@ static void import_tex_obj_state( r200ContextPtr rmesa, r200TexObjPtr texobj ) { /* do not use RADEON_DB_STATE to avoid stale texture caches */ - GLuint *cmd = &rmesa->hw.tex[unit].cmd[TEX_CMD_0]; + int *cmd = &rmesa->hw.tex[unit].cmd[TEX_CMD_0]; R200_STATECHANGE( rmesa, tex[unit] ); @@ -1159,7 +1199,7 @@ static void import_tex_obj_state( r200ContextPtr rmesa, } if (texobj->base.tObj->Target == GL_TEXTURE_CUBE_MAP) { - GLuint *cube_cmd = &rmesa->hw.cube[unit].cmd[CUBE_CMD_0]; + int *cube_cmd = &rmesa->hw.cube[unit].cmd[CUBE_CMD_0]; GLuint bytesPerFace = texobj->base.totalSize / 6; ASSERT(texobj->base.totalSize % 6 == 0); @@ -1216,6 +1256,47 @@ static void set_texgen_matrix( r200ContextPtr rmesa, } +static GLuint r200_need_dis_texgen(const GLbitfield texGenEnabled, + const GLfloat *planeS, + const GLfloat *planeT, + const GLfloat *planeR, + const GLfloat *planeQ) +{ + GLuint needtgenable = 0; + + if (!(texGenEnabled & S_BIT)) { + if (((texGenEnabled & T_BIT) && planeT[0] != 0.0) || + ((texGenEnabled & R_BIT) && planeR[0] != 0.0) || + ((texGenEnabled & Q_BIT) && planeQ[0] != 0.0)) { + needtgenable |= S_BIT; + } + } + if (!(texGenEnabled & T_BIT)) { + if (((texGenEnabled & S_BIT) && planeS[1] != 0.0) || + ((texGenEnabled & R_BIT) && planeR[1] != 0.0) || + ((texGenEnabled & Q_BIT) && planeQ[1] != 0.0)) { + needtgenable |= T_BIT; + } + } + if (!(texGenEnabled & R_BIT)) { + if (((texGenEnabled & S_BIT) && planeS[2] != 0.0) || + ((texGenEnabled & T_BIT) && planeT[2] != 0.0) || + ((texGenEnabled & Q_BIT) && planeQ[2] != 0.0)) { + needtgenable |= R_BIT; + } + } + if (!(texGenEnabled & Q_BIT)) { + if (((texGenEnabled & S_BIT) && planeS[3] != 0.0) || + ((texGenEnabled & T_BIT) && planeT[3] != 0.0) || + ((texGenEnabled & R_BIT) && planeR[3] != 0.0)) { + needtgenable |= Q_BIT; + } + } + + return needtgenable; +} + + /* * Returns GL_FALSE if fallback required. */ @@ -1285,28 +1366,72 @@ static GLboolean r200_validate_texgen( GLcontext *ctx, GLuint unit ) return GL_FALSE; } +/* we CANNOT do mixed mode if the texgen mode requires a plane where the input + is not enabled for texgen, since the planes are concatenated into texmat, + and thus the input will come from texcoord rather than tex gen equation! + Either fallback or just hope that those texcoords aren't really needed... + Assuming the former will cause lots of unnecessary fallbacks, the latter will + generate bogus results sometimes - it's pretty much impossible to really know + when a fallback is needed, depends on texmat and what sort of texture is bound + etc, - for now fallback if we're missing either S or T bits, there's a high + probability we need the texcoords in that case. + That's a lot of work for some obscure texgen mixed mode fixup - why oh why + doesn't the chip just directly accept the plane parameters :-(. */ switch (mode) { - case GL_OBJECT_LINEAR: + case GL_OBJECT_LINEAR: { + GLuint needtgenable = r200_need_dis_texgen( texUnit->TexGenEnabled, + texUnit->ObjectPlaneS, texUnit->ObjectPlaneT, + texUnit->ObjectPlaneR, texUnit->ObjectPlaneQ ); + if (needtgenable & (S_BIT | T_BIT)) { + if (R200_DEBUG & DEBUG_FALLBACKS) + fprintf(stderr, "fallback mixed texgen / obj plane, 0x%x\n", + texUnit->TexGenEnabled); + return GL_FALSE; + } + if (needtgenable & (R_BIT)) { + tgcm &= ~(R200_TEXGEN_COMP_R << (unit * 4)); + } + if (needtgenable & (Q_BIT)) { + tgcm &= ~(R200_TEXGEN_COMP_Q << (unit * 4)); + } + tgi |= R200_TEXGEN_INPUT_OBJ << inputshift; set_texgen_matrix( rmesa, unit, (texUnit->TexGenEnabled & S_BIT) ? texUnit->ObjectPlaneS : I, (texUnit->TexGenEnabled & T_BIT) ? texUnit->ObjectPlaneT : I + 4, (texUnit->TexGenEnabled & R_BIT) ? texUnit->ObjectPlaneR : I + 8, (texUnit->TexGenEnabled & Q_BIT) ? texUnit->ObjectPlaneQ : I + 12); + } break; - case GL_EYE_LINEAR: + case GL_EYE_LINEAR: { + GLuint needtgenable = r200_need_dis_texgen( texUnit->TexGenEnabled, + texUnit->EyePlaneS, texUnit->EyePlaneT, + texUnit->EyePlaneR, texUnit->EyePlaneQ ); + if (needtgenable & (S_BIT | T_BIT)) { + if (R200_DEBUG & DEBUG_FALLBACKS) + fprintf(stderr, "fallback mixed texgen / eye plane, 0x%x\n", + texUnit->TexGenEnabled); + return GL_FALSE; + } + if (needtgenable & (R_BIT)) { + tgcm &= ~(R200_TEXGEN_COMP_R << (unit * 4)); + } + if (needtgenable & (Q_BIT)) { + tgcm &= ~(R200_TEXGEN_COMP_Q << (unit * 4)); + } tgi |= R200_TEXGEN_INPUT_EYE << inputshift; - set_texgen_matrix( rmesa, unit, + set_texgen_matrix( rmesa, unit, (texUnit->TexGenEnabled & S_BIT) ? texUnit->EyePlaneS : I, (texUnit->TexGenEnabled & T_BIT) ? texUnit->EyePlaneT : I + 4, (texUnit->TexGenEnabled & R_BIT) ? texUnit->EyePlaneR : I + 8, (texUnit->TexGenEnabled & Q_BIT) ? texUnit->EyePlaneQ : I + 12); + } break; case GL_REFLECTION_MAP_NV: rmesa->TexGenNeedNormals[unit] = GL_TRUE; - tgi |= R200_TEXGEN_INPUT_EYE_REFLECT<Light.Enabled) set_texgen_matrix( rmesa, unit, diff --git a/src/mesa/drivers/dri/r200/r200_vertprog.c b/src/mesa/drivers/dri/r200/r200_vertprog.c index cf0c15093fd..b5afe51d824 100644 --- a/src/mesa/drivers/dri/r200/r200_vertprog.c +++ b/src/mesa/drivers/dri/r200/r200_vertprog.c @@ -40,6 +40,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "r200_ioctl.h" #include "r200_tcl.h" #include "program_instruction.h" +#include "programopt.h" #include "tnl/tnl.h" #if SWIZZLE_X != VSF_IN_COMPONENT_X || \ @@ -387,16 +388,12 @@ static unsigned long op_operands(enum prog_opcode opcode) #define UNUSED_SRC_2 ((o_inst->src2 & ~15) | 9) -/* DP4 version seems to trigger some hw peculiarity - fglrx does this on r200 however */ -#define PREFER_DP4 - - /** * Generate an R200 vertex program from Mesa's internal representation. * * \return GL_TRUE for success, GL_FALSE for failure. */ -static GLboolean r200_translate_vertex_program(struct r200_vertex_program *vp) +static GLboolean r200_translate_vertex_program(GLcontext *ctx, struct r200_vertex_program *vp) { struct gl_vertex_program *mesa_vp = &vp->mesa_program; struct prog_instruction *vpi; @@ -405,13 +402,19 @@ static GLboolean r200_translate_vertex_program(struct r200_vertex_program *vp) unsigned long operands; int are_srcs_scalar; unsigned long hw_op; + int dofogfix = 0; + int fog_temp_i = 0; + int free_inputs; + int array_count = 0; vp->native = GL_FALSE; vp->translated = GL_TRUE; + vp->fogmode = ctx->Fog.Mode; if (mesa_vp->Base.NumInstructions == 0) return GL_FALSE; +#if 0 if ((mesa_vp->Base.InputsRead & ~(VERT_BIT_POS | VERT_BIT_NORMAL | VERT_BIT_COLOR0 | VERT_BIT_COLOR1 | VERT_BIT_FOG | VERT_BIT_TEX0 | VERT_BIT_TEX1 | VERT_BIT_TEX2 | @@ -422,6 +425,7 @@ static GLboolean r200_translate_vertex_program(struct r200_vertex_program *vp) } return GL_FALSE; } +#endif if ((mesa_vp->Base.OutputsWritten & ~((1 << VERT_RESULT_HPOS) | (1 << VERT_RESULT_COL0) | (1 << VERT_RESULT_COL1) | @@ -445,96 +449,22 @@ static GLboolean r200_translate_vertex_program(struct r200_vertex_program *vp) Smart enough to realize that it doesnt need it? */ int u_temp_i = R200_VSF_MAX_TEMPS - 1; struct prog_src_register src[3]; + struct prog_dst_register dst; /* FIXME: is changing the prog safe to do here? */ - if (mesa_vp->IsPositionInvariant) { - struct gl_program_parameter_list *paramList; - GLint tokens[6] = { STATE_MATRIX, STATE_MVP, 0, 0, 0, STATE_MATRIX }; - -#ifdef PREFER_DP4 - tokens[5] = STATE_MATRIX; -#else - tokens[5] = STATE_MATRIX_TRANSPOSE; -#endif - paramList = mesa_vp->Base.Parameters; - - vpi = malloc((mesa_vp->Base.NumInstructions + 4) * sizeof(struct prog_instruction)); - memset(vpi, 0, 4 * sizeof(struct prog_instruction)); - - /* emit four dot product instructions to do MVP transformation */ - for (i=0; i < 4; i++) { - GLint idx; - tokens[3] = tokens[4] = i; - idx = _mesa_add_state_reference(paramList, tokens); -#ifdef PREFER_DP4 - vpi[i].Opcode = OPCODE_DP4; - vpi[i].StringPos = 0; - vpi[i].Data = 0; - - vpi[i].DstReg.File = PROGRAM_OUTPUT; - vpi[i].DstReg.Index = VERT_RESULT_HPOS; - vpi[i].DstReg.WriteMask = 1 << i; - vpi[i].DstReg.CondMask = COND_TR; - - vpi[i].SrcReg[0].File = PROGRAM_STATE_VAR; - vpi[i].SrcReg[0].Index = idx; - vpi[i].SrcReg[0].Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_W); - - vpi[i].SrcReg[1].File = PROGRAM_INPUT; - vpi[i].SrcReg[1].Index = VERT_ATTRIB_POS; - vpi[i].SrcReg[1].Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_W); -#else - if (i == 0) - vpi[i].Opcode = OPCODE_MUL; - else - vpi[i].Opcode = OPCODE_MAD; - - vpi[i].StringPos = 0; - vpi[i].Data = 0; - - if (i == 3) - vpi[i].DstReg.File = PROGRAM_OUTPUT; - else - vpi[i].DstReg.File = PROGRAM_TEMPORARY; - vpi[i].DstReg.Index = 0; - vpi[i].DstReg.WriteMask = 0xf; - vpi[i].DstReg.CondMask = COND_TR; - - vpi[i].SrcReg[0].File = PROGRAM_STATE_VAR; - vpi[i].SrcReg[0].Index = idx; - vpi[i].SrcReg[0].Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_W); - - vpi[i].SrcReg[1].File = PROGRAM_INPUT; - vpi[i].SrcReg[1].Index = VERT_ATTRIB_POS; - vpi[i].SrcReg[1].Swizzle = MAKE_SWIZZLE4(i, i, i, i); - - if (i > 0) { - vpi[i].SrcReg[2].File = PROGRAM_TEMPORARY; - vpi[i].SrcReg[2].Index = 0; - vpi[i].SrcReg[2].Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_W); - } -#endif + if (mesa_vp->IsPositionInvariant && + /* make sure we only do this once */ + !(mesa_vp->Base.OutputsWritten & (1 << VERT_RESULT_HPOS))) { + _mesa_insert_mvp_code(ctx, mesa_vp); } - /* now append original program after our new instructions */ - memcpy(&vpi[i], mesa_vp->Base.Instructions, mesa_vp->Base.NumInstructions * sizeof(struct prog_instruction)); - - /* deallocate original program */ - free(mesa_vp->Base.Instructions); - - /* install new program */ - mesa_vp->Base.Instructions = vpi; - - mesa_vp->Base.NumInstructions += 4; - vpi = &mesa_vp->Base.Instructions[mesa_vp->Base.NumInstructions-1]; - - assert(vpi->Opcode == OPCODE_END); - - mesa_vp->Base.InputsRead |= (1 << VERT_ATTRIB_POS); - mesa_vp->Base.OutputsWritten |= (1 << VERT_RESULT_HPOS); - - //fprintf(stderr, "IsPositionInvariant is set!\n"); - //_mesa_print_program(&mesa_vp->Base); + /* for fogc, can't change mesa_vp, as it would hose swtnl, and exp with + base e isn't directly available neither. */ + if (mesa_vp->Base.OutputsWritten & VERT_RESULT_FOGC && !vp->fogpidx) { + struct gl_program_parameter_list *paramList; + GLint tokens[6] = { STATE_FOG_PARAMS, 0, 0, 0, 0, 0 }; + paramList = mesa_vp->Base.Parameters; + vp->fogpidx = _mesa_add_state_reference(paramList, tokens); } vp->pos_end = 0; @@ -544,35 +474,85 @@ static GLboolean r200_translate_vertex_program(struct r200_vertex_program *vp) else mesa_vp->Base.NumNativeParameters = 0; - for(i=0; i < VERT_ATTRIB_MAX; i++) + for(i = 0; i < VERT_ATTRIB_MAX; i++) vp->inputs[i] = -1; + free_inputs = 0x2ffd; + /* fglrx uses fixed inputs as follows for conventional attribs. - generic attribs use non-fixed assignment, fglrx will always use the lowest attrib values available. - There are 12 generic attribs possible, corresponding to attrib 0, 2-11 and 13 in a hw vertex prog. - attr 1 and 12 are not available for generic attribs as those cannot be made vec4 (correspond to - vertex normal/weight) + generic attribs use non-fixed assignment, fglrx will always use the + lowest attrib values available. We'll just do the same. + There are 12 generic attribs possible, corresponding to attrib 0, 2-11 + and 13 in a hw vertex prog. + attr 1 and 12 aren't used for generic attribs as those cannot be made vec4 + (correspond to vertex normal/weight - maybe weight actually could be made vec4). + Additionally, not more than 12 arrays in total are possible I think. attr 0 is pos, R200_VTX_XY1|R200_VTX_Z1|R200_VTX_W1 in R200_SE_VTX_FMT_0 attr 2-5 use colors 0-3 (R200_VTX_FP_RGBA << R200_VTX_COLOR_0/1/2/3_SHIFT in R200_SE_VTX_FMT_0) attr 6-11 use tex 0-5 (4 << R200_VTX_TEX0/1/2/3/4/5_COMP_CNT_SHIFT in R200_SE_VTX_FMT_1) attr 13 uses vtx1 pos (R200_VTX_XY1|R200_VTX_Z1|R200_VTX_W1 in R200_SE_VTX_FMT_0) - generic attribs would require some more work (dma regions, renaming). */ +*/ -/* may look different when using idx buf / input_route instead of se_vtx_fmt? */ - vp->inputs[VERT_ATTRIB_POS] = 0; - vp->inputs[VERT_ATTRIB_WEIGHT] = 12; - vp->inputs[VERT_ATTRIB_NORMAL] = 1; - vp->inputs[VERT_ATTRIB_COLOR0] = 2; - vp->inputs[VERT_ATTRIB_COLOR1] = 3; - vp->inputs[VERT_ATTRIB_FOG] = 15; - vp->inputs[VERT_ATTRIB_TEX0] = 6; - vp->inputs[VERT_ATTRIB_TEX1] = 7; - vp->inputs[VERT_ATTRIB_TEX2] = 8; - vp->inputs[VERT_ATTRIB_TEX3] = 9; - vp->inputs[VERT_ATTRIB_TEX4] = 10; - vp->inputs[VERT_ATTRIB_TEX5] = 11; /* attr 4,5 and 13 are only used with generic attribs. Haven't seen attr 14 used, maybe that's for the hw pointsize vec1 (which is not possibe to use with vertex progs as it is lacking in vert prog specification) */ +/* may look different when using idx buf / input_route instead of se_vtx_fmt? */ + if (mesa_vp->Base.InputsRead & VERT_BIT_POS) { + vp->inputs[VERT_ATTRIB_POS] = 0; + free_inputs &= ~(1 << 0); + array_count++; + } + if (mesa_vp->Base.InputsRead & VERT_BIT_WEIGHT) { + /* we don't actually handle that later. Then again, we don't have to... */ + vp->inputs[VERT_ATTRIB_WEIGHT] = 12; + array_count++; + } + if (mesa_vp->Base.InputsRead & VERT_BIT_NORMAL) { + vp->inputs[VERT_ATTRIB_NORMAL] = 1; + array_count++; + } + if (mesa_vp->Base.InputsRead & VERT_BIT_COLOR0) { + vp->inputs[VERT_ATTRIB_COLOR0] = 2; + free_inputs &= ~(1 << 2); + array_count++; + } + if (mesa_vp->Base.InputsRead & VERT_BIT_COLOR1) { + vp->inputs[VERT_ATTRIB_COLOR1] = 3; + free_inputs &= ~(1 << 3); + array_count++; + } + if (mesa_vp->Base.InputsRead & VERT_BIT_FOG) { + vp->inputs[VERT_ATTRIB_FOG] = 15; array_count++; + } + for (i = VERT_ATTRIB_TEX0; i <= VERT_ATTRIB_TEX5; i++) { + if (mesa_vp->Base.InputsRead & (1 << i)) { + vp->inputs[i] = i - VERT_ATTRIB_TEX0 + 6; + free_inputs &= ~(1 << (i - VERT_ATTRIB_TEX0 + 6)); + array_count++; + } + } + /* using VERT_ATTRIB_TEX6/7 would be illegal */ + /* completely ignore aliasing? */ + for (i = VERT_ATTRIB_GENERIC0; i < VERT_ATTRIB_MAX; i++) { + int j; + /* completely ignore aliasing? */ + if (mesa_vp->Base.InputsRead & (1 << i)) { + array_count++; + if (array_count > 12) { + if (R200_DEBUG & DEBUG_FALLBACKS) { + fprintf(stderr, "more than 12 attribs used in vert prog\n"); + } + return GL_FALSE; + } + for (j = 0; j < 14; j++) { + /* will always find one due to limited array_count */ + if (free_inputs & (1 << j)) { + free_inputs &= ~(1 << j); + vp->inputs[i] = j; + break; + } + } + } + } if (!(mesa_vp->Base.OutputsWritten & (1 << VERT_RESULT_HPOS))) { if (R200_DEBUG & DEBUG_FALLBACKS) { @@ -580,15 +560,59 @@ static GLboolean r200_translate_vertex_program(struct r200_vertex_program *vp) } return GL_FALSE; } + if (free_inputs & 1) { + if (R200_DEBUG & DEBUG_FALLBACKS) { + fprintf(stderr, "can't handle vert prog without position input\n"); + } + return GL_FALSE; + } o_inst = vp->instr; - for(vpi = mesa_vp->Base.Instructions; vpi->Opcode != OPCODE_END; vpi++, o_inst++){ + for (vpi = mesa_vp->Base.Instructions; vpi->Opcode != OPCODE_END; vpi++, o_inst++){ operands = op_operands(vpi->Opcode); are_srcs_scalar = operands & SCALAR_FLAG; operands &= OP_MASK; - for(i = 0; i < operands; i++) + for(i = 0; i < operands; i++) { src[i] = vpi->SrcReg[i]; + /* hack up default attrib values as per spec as swizzling. + normal, fog, secondary color. Crazy? + May need more if we don't submit vec4 elements? */ + if (src[i].File == PROGRAM_INPUT) { + if (src[i].Index == VERT_ATTRIB_NORMAL) { + int j; + for (j = 0; j < 4; j++) { + if (GET_SWZ(src[i].Swizzle, j) == SWIZZLE_W) { + src[i].Swizzle &= ~(SWIZZLE_W << (j*3)); + src[i].Swizzle |= SWIZZLE_ONE << (j*3); + } + } + } + else if (src[i].Index == VERT_ATTRIB_COLOR1) { + int j; + for (j = 0; j < 4; j++) { + if (GET_SWZ(src[i].Swizzle, j) == SWIZZLE_W) { + src[i].Swizzle &= ~(SWIZZLE_W << (j*3)); + src[i].Swizzle |= SWIZZLE_ZERO << (j*3); + } + } + } + else if (src[i].Index == VERT_ATTRIB_FOG) { + int j; + for (j = 0; j < 4; j++) { + if (GET_SWZ(src[i].Swizzle, j) == SWIZZLE_W) { + src[i].Swizzle &= ~(SWIZZLE_W << (j*3)); + src[i].Swizzle |= SWIZZLE_ONE << (j*3); + } + else if ((GET_SWZ(src[i].Swizzle, j) == SWIZZLE_Y) || + GET_SWZ(src[i].Swizzle, j) == SWIZZLE_Z) { + src[i].Swizzle &= ~(SWIZZLE_W << (j*3)); + src[i].Swizzle |= SWIZZLE_ZERO << (j*3); + } + } + } + } + } if(operands == 3){ if( CMP_SRCS(src[1], src[2]) || CMP_SRCS(src[0], src[2]) ){ @@ -634,6 +658,17 @@ static GLboolean r200_translate_vertex_program(struct r200_vertex_program *vp) } } + dst = vpi->DstReg; + if (dst.File == PROGRAM_OUTPUT && + dst.Index == VERT_RESULT_FOGC && + dst.WriteMask & WRITEMASK_X) { + fog_temp_i = u_temp_i; + dst.File = PROGRAM_TEMPORARY; + dst.Index = fog_temp_i; + dofogfix = 1; + u_temp_i--; + } + /* These ops need special handling. */ switch(vpi->Opcode){ case OPCODE_POW: @@ -641,8 +676,8 @@ static GLboolean r200_translate_vertex_program(struct r200_vertex_program *vp) So may need to insert additional instruction */ if ((src[0].File == src[1].File) && (src[0].Index == src[1].Index)) { - o_inst->op = MAKE_VSF_OP(R200_VPI_OUT_OP_POW, t_dst(&vpi->DstReg), - t_dst_mask(vpi->DstReg.WriteMask)); + o_inst->op = MAKE_VSF_OP(R200_VPI_OUT_OP_POW, t_dst(&dst), + t_dst_mask(dst.WriteMask)); o_inst->src0 = MAKE_VSF_SOURCE(t_src_index(vp, &src[0]), t_swizzle(GET_SWZ(src[0].Swizzle, 0)), SWIZZLE_ZERO, @@ -670,8 +705,8 @@ static GLboolean r200_translate_vertex_program(struct r200_vertex_program *vp) o_inst->src2 = UNUSED_SRC_1; o_inst++; - o_inst->op = MAKE_VSF_OP(R200_VPI_OUT_OP_POW, t_dst(&vpi->DstReg), - t_dst_mask(vpi->DstReg.WriteMask)); + o_inst->op = MAKE_VSF_OP(R200_VPI_OUT_OP_POW, t_dst(&dst), + t_dst_mask(dst.WriteMask)); o_inst->src0 = MAKE_VSF_SOURCE(u_temp_i, VSF_IN_COMPONENT_X, VSF_IN_COMPONENT_Y, @@ -687,8 +722,8 @@ static GLboolean r200_translate_vertex_program(struct r200_vertex_program *vp) case OPCODE_MOV://ADD RESULT 1.X Y Z W PARAM 0{} {X Y Z W} PARAM 0{} {ZERO ZERO ZERO ZERO} case OPCODE_SWZ: - o_inst->op = MAKE_VSF_OP(R200_VPI_OUT_OP_ADD, t_dst(&vpi->DstReg), - t_dst_mask(vpi->DstReg.WriteMask)); + o_inst->op = MAKE_VSF_OP(R200_VPI_OUT_OP_ADD, t_dst(&dst), + t_dst_mask(dst.WriteMask)); o_inst->src0 = t_src(vp, &src[0]); o_inst->src1 = ZERO_SRC_0; o_inst->src2 = UNUSED_SRC_1; @@ -699,8 +734,8 @@ static GLboolean r200_translate_vertex_program(struct r200_vertex_program *vp) src[1].File == PROGRAM_TEMPORARY && src[2].File == PROGRAM_TEMPORARY) ? R200_VPI_OUT_OP_MAD_2 : R200_VPI_OUT_OP_MAD; - o_inst->op = MAKE_VSF_OP(hw_op, t_dst(&vpi->DstReg), - t_dst_mask(vpi->DstReg.WriteMask)); + o_inst->op = MAKE_VSF_OP(hw_op, t_dst(&dst), + t_dst_mask(dst.WriteMask)); o_inst->src0 = t_src(vp, &src[0]); #if 0 if ((o_inst - vp->instr) == 31) { @@ -725,8 +760,8 @@ else { goto next; case OPCODE_DP3://DOT RESULT 1.X Y Z W PARAM 0{} {X Y Z ZERO} PARAM 0{} {X Y Z ZERO} - o_inst->op = MAKE_VSF_OP(R200_VPI_OUT_OP_DOT, t_dst(&vpi->DstReg), - t_dst_mask(vpi->DstReg.WriteMask)); + o_inst->op = MAKE_VSF_OP(R200_VPI_OUT_OP_DOT, t_dst(&dst), + t_dst_mask(dst.WriteMask)); o_inst->src0 = MAKE_VSF_SOURCE(t_src_index(vp, &src[0]), t_swizzle(GET_SWZ(src[0].Swizzle, 0)), @@ -748,8 +783,8 @@ else { goto next; case OPCODE_DPH://DOT RESULT 1.X Y Z W PARAM 0{} {X Y Z ONE} PARAM 0{} {X Y Z W} - o_inst->op = MAKE_VSF_OP(R200_VPI_OUT_OP_DOT, t_dst(&vpi->DstReg), - t_dst_mask(vpi->DstReg.WriteMask)); + o_inst->op = MAKE_VSF_OP(R200_VPI_OUT_OP_DOT, t_dst(&dst), + t_dst_mask(dst.WriteMask)); o_inst->src0 = MAKE_VSF_SOURCE(t_src_index(vp, &src[0]), t_swizzle(GET_SWZ(src[0].Swizzle, 0)), @@ -763,8 +798,8 @@ else { goto next; case OPCODE_SUB://ADD RESULT 1.X Y Z W TMP 0{} {X Y Z W} PARAM 1{X Y Z W } {X Y Z W} neg Xneg Yneg Zneg W - o_inst->op = MAKE_VSF_OP(R200_VPI_OUT_OP_ADD, t_dst(&vpi->DstReg), - t_dst_mask(vpi->DstReg.WriteMask)); + o_inst->op = MAKE_VSF_OP(R200_VPI_OUT_OP_ADD, t_dst(&dst), + t_dst_mask(dst.WriteMask)); o_inst->src0 = t_src(vp, &src[0]); o_inst->src1 = MAKE_VSF_SOURCE(t_src_index(vp, &src[1]), @@ -778,8 +813,8 @@ else { goto next; case OPCODE_ABS://MAX RESULT 1.X Y Z W PARAM 0{} {X Y Z W} PARAM 0{X Y Z W } {X Y Z W} neg Xneg Yneg Zneg W - o_inst->op=MAKE_VSF_OP(R200_VPI_OUT_OP_MAX, t_dst(&vpi->DstReg), - t_dst_mask(vpi->DstReg.WriteMask)); + o_inst->op=MAKE_VSF_OP(R200_VPI_OUT_OP_MAX, t_dst(&dst), + t_dst_mask(dst.WriteMask)); o_inst->src0=t_src(vp, &src[0]); o_inst->src1=MAKE_VSF_SOURCE(t_src_index(vp, &src[0]), @@ -798,15 +833,15 @@ else { o_inst->op = MAKE_VSF_OP(R200_VPI_OUT_OP_FRC, (u_temp_i << R200_VPI_OUT_REG_INDEX_SHIFT) | R200_VSF_OUT_CLASS_TMP, - t_dst_mask(vpi->DstReg.WriteMask)); + t_dst_mask(dst.WriteMask)); o_inst->src0 = t_src(vp, &src[0]); o_inst->src1 = UNUSED_SRC_0; o_inst->src2 = UNUSED_SRC_1; o_inst++; - o_inst->op = MAKE_VSF_OP(R200_VPI_OUT_OP_ADD, t_dst(&vpi->DstReg), - t_dst_mask(vpi->DstReg.WriteMask)); + o_inst->op = MAKE_VSF_OP(R200_VPI_OUT_OP_ADD, t_dst(&dst), + t_dst_mask(dst.WriteMask)); o_inst->src0 = t_src(vp, &src[0]); o_inst->src1 = MAKE_VSF_SOURCE(u_temp_i, @@ -830,7 +865,7 @@ else { o_inst->op = MAKE_VSF_OP(R200_VPI_OUT_OP_MUL, (u_temp_i << R200_VPI_OUT_REG_INDEX_SHIFT) | R200_VSF_OUT_CLASS_TMP, - t_dst_mask(vpi->DstReg.WriteMask)); + t_dst_mask(dst.WriteMask)); o_inst->src0 = MAKE_VSF_SOURCE(t_src_index(vp, &src[0]), t_swizzle(GET_SWZ(src[0].Swizzle, 1)), // y @@ -852,8 +887,8 @@ else { o_inst++; u_temp_i--; - o_inst->op = MAKE_VSF_OP(R200_VPI_OUT_OP_MAD, t_dst(&vpi->DstReg), - t_dst_mask(vpi->DstReg.WriteMask)); + o_inst->op = MAKE_VSF_OP(R200_VPI_OUT_OP_MAD, t_dst(&dst), + t_dst_mask(dst.WriteMask)); o_inst->src0 = MAKE_VSF_SOURCE(t_src_index(vp, &src[1]), t_swizzle(GET_SWZ(src[1].Swizzle, 1)), // y @@ -886,8 +921,8 @@ else { break; } - o_inst->op = MAKE_VSF_OP(t_opcode(vpi->Opcode), t_dst(&vpi->DstReg), - t_dst_mask(vpi->DstReg.WriteMask)); + o_inst->op = MAKE_VSF_OP(t_opcode(vpi->Opcode), t_dst(&dst), + t_dst_mask(dst.WriteMask)); if(are_srcs_scalar){ switch(operands){ @@ -941,6 +976,67 @@ else { } } next: + + if (dofogfix) { + o_inst++; + if (vp->fogmode == GL_EXP) { + o_inst->op = MAKE_VSF_OP(R200_VPI_OUT_OP_MUL, + (fog_temp_i << R200_VPI_OUT_REG_INDEX_SHIFT) | R200_VSF_OUT_CLASS_TMP, + VSF_FLAG_X); + o_inst->src0 = EASY_VSF_SOURCE(fog_temp_i, X, X, X, X, TMP, NONE); + o_inst->src1 = EASY_VSF_SOURCE(vp->fogpidx, X, X, X, X, PARAM, NONE); + o_inst->src2 = UNUSED_SRC_1; + o_inst++; + o_inst->op = MAKE_VSF_OP(R200_VPI_OUT_OP_EXP_E, + R200_VSF_OUT_CLASS_RESULT_FOGC, + VSF_FLAG_X); + o_inst->src0 = EASY_VSF_SOURCE(fog_temp_i, X, X, X, X, TMP, ALL); + o_inst->src1 = UNUSED_SRC_0; + o_inst->src2 = UNUSED_SRC_1; + } + else if (vp->fogmode == GL_EXP2) { + o_inst->op = MAKE_VSF_OP(R200_VPI_OUT_OP_MUL, + (fog_temp_i << R200_VPI_OUT_REG_INDEX_SHIFT) | R200_VSF_OUT_CLASS_TMP, + VSF_FLAG_X); + o_inst->src0 = EASY_VSF_SOURCE(fog_temp_i, X, X, X, X, TMP, NONE); + o_inst->src1 = EASY_VSF_SOURCE(vp->fogpidx, X, X, X, X, PARAM, NONE); + o_inst->src2 = UNUSED_SRC_1; + o_inst++; + o_inst->op = MAKE_VSF_OP(R200_VPI_OUT_OP_MUL, + (fog_temp_i << R200_VPI_OUT_REG_INDEX_SHIFT) | R200_VSF_OUT_CLASS_TMP, + VSF_FLAG_X); + o_inst->src0 = EASY_VSF_SOURCE(fog_temp_i, X, X, X, X, TMP, NONE); + o_inst->src1 = EASY_VSF_SOURCE(fog_temp_i, X, X, X, X, TMP, NONE); + o_inst->src2 = UNUSED_SRC_1; + o_inst++; + o_inst->op = MAKE_VSF_OP(R200_VPI_OUT_OP_EXP_E, + R200_VSF_OUT_CLASS_RESULT_FOGC, + VSF_FLAG_X); + o_inst->src0 = EASY_VSF_SOURCE(fog_temp_i, X, X, X, X, TMP, ALL); + o_inst->src1 = UNUSED_SRC_0; + o_inst->src2 = UNUSED_SRC_1; + } + else { /* fogmode == GL_LINEAR */ + /* could do that with single op (dot) if using params like + with fixed function pipeline fog */ + o_inst->op = MAKE_VSF_OP(R200_VPI_OUT_OP_ADD, + (fog_temp_i << R200_VPI_OUT_REG_INDEX_SHIFT) | R200_VSF_OUT_CLASS_TMP, + VSF_FLAG_X); + o_inst->src0 = EASY_VSF_SOURCE(fog_temp_i, X, X, X, X, TMP, ALL); + o_inst->src1 = EASY_VSF_SOURCE(vp->fogpidx, Z, Z, Z, Z, PARAM, NONE); + o_inst->src2 = UNUSED_SRC_1; + o_inst++; + o_inst->op = MAKE_VSF_OP(R200_VPI_OUT_OP_MUL, + R200_VSF_OUT_CLASS_RESULT_FOGC, + VSF_FLAG_X); + o_inst->src0 = EASY_VSF_SOURCE(fog_temp_i, X, X, X, X, TMP, NONE); + o_inst->src1 = EASY_VSF_SOURCE(vp->fogpidx, W, W, W, W, PARAM, NONE); + o_inst->src2 = UNUSED_SRC_1; + + } + dofogfix = 0; + } + if (mesa_vp->Base.NumNativeTemporaries < (mesa_vp->Base.NumTemporaries + (R200_VSF_MAX_TEMPS - 1 - u_temp_i))) { mesa_vp->Base.NumNativeTemporaries = @@ -981,9 +1077,9 @@ void r200SetupVertexProg( GLcontext *ctx ) { GLboolean fallback; GLint i; - if (!vp->translated) { + if (!vp->translated || (ctx->Fog.Enabled && ctx->Fog.Mode != vp->fogmode)) { rmesa->curr_vp_hw = NULL; - r200_translate_vertex_program(vp); + r200_translate_vertex_program(ctx, vp); } /* could optimize setting up vertex progs away for non-tcl hw */ fallback = !(vp->native && r200VertexProgUpdateParams(ctx, vp) && @@ -1104,8 +1200,9 @@ r200ProgramStringNotify(GLcontext *ctx, GLenum target, struct gl_program *prog) switch(target) { case GL_VERTEX_PROGRAM_ARB: vp->translated = GL_FALSE; + vp->fogpidx = 0; /* memset(&vp->translated, 0, sizeof(struct r200_vertex_program) - sizeof(struct gl_vertex_program));*/ - r200_translate_vertex_program(vp); + r200_translate_vertex_program(ctx, vp); rmesa->curr_vp_hw = NULL; break; } @@ -1122,7 +1219,7 @@ r200IsProgramNative(GLcontext *ctx, GLenum target, struct gl_program *prog) case GL_VERTEX_STATE_PROGRAM_NV: case GL_VERTEX_PROGRAM_ARB: if (!vp->translated) { - r200_translate_vertex_program(vp); + r200_translate_vertex_program(ctx, vp); } /* does not take parameters etc. into account */ return vp->native; diff --git a/src/mesa/drivers/dri/r200/r200_vertprog.h b/src/mesa/drivers/dri/r200/r200_vertprog.h index 0fbe5eec7d9..938237680ce 100644 --- a/src/mesa/drivers/dri/r200/r200_vertprog.h +++ b/src/mesa/drivers/dri/r200/r200_vertprog.h @@ -89,6 +89,8 @@ extern void r200SetupVertexProg( GLcontext *ctx ); #define R200_VPI_OUT_OP_EXP (65 << 0) #define R200_VPI_OUT_OP_LOG (66 << 0) +/* base e exp. Useful for fog. */ +#define R200_VPI_OUT_OP_EXP_E (67 << 0) #define R200_VPI_OUT_OP_LIT (68 << 0) #define R200_VPI_OUT_OP_POW (69 << 0) diff --git a/src/mesa/drivers/dri/r300/r200_context.h b/src/mesa/drivers/dri/r300/r200_context.h deleted file mode 100644 index a06d7152d78..00000000000 --- a/src/mesa/drivers/dri/r300/r200_context.h +++ /dev/null @@ -1,822 +0,0 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_context.h,v 1.2 2002/12/16 16:18:54 dawes Exp $ */ -/* -Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. - -The Weather Channel (TM) funded Tungsten Graphics to develop the -initial release of the Radeon 8500 driver under the XFree86 license. -This notice must be preserved. - -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 COPYRIGHT OWNER(S) 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: - * Keith Whitwell - */ - -#ifndef __R200_CONTEXT_H__ -#define __R200_CONTEXT_H__ - -#ifdef GLX_DIRECT_RENDERING - -#include "tnl/t_vertex.h" -#include "drm.h" -#include "radeon_drm.h" -#include "dri_util.h" -#include "texmem.h" - -#include "macros.h" -#include "mtypes.h" -#include "colormac.h" -#include "r200_reg.h" -#include "radeon_context.h" - -#define ENABLE_HW_3D_TEXTURE 1 /* XXX this is temporary! */ - -struct r200_context; -typedef struct r200_context r200ContextRec; -typedef struct r200_context *r200ContextPtr; - -#include "mm.h" - -/* The blit width for texture uploads - */ -#define BLIT_WIDTH_BYTES 1024 - -/* Use the templated vertex format: - */ -#define COLOR_IS_RGBA -#define TAG(x) r200##x -#include "tnl_dd/t_dd_vertex.h" -#undef TAG - -typedef void (*r200_tri_func) (r200ContextPtr, - r200Vertex *, r200Vertex *, r200Vertex *); - -typedef void (*r200_line_func) (r200ContextPtr, r200Vertex *, r200Vertex *); - -typedef void (*r200_point_func) (r200ContextPtr, r200Vertex *); - -struct r200_depthbuffer_state { - GLfloat scale; -}; - -struct r200_stencilbuffer_state { - GLboolean hwBuffer; - GLuint clear; /* rb3d_stencilrefmask value */ -}; - -struct r200_stipple_state { - GLuint mask[32]; -}; - -typedef struct r200_tex_obj r200TexObj, *r200TexObjPtr; - -/* Texture object in locally shared texture space. - */ -struct r200_tex_obj { - driTextureObject base; - - GLuint bufAddr; /* Offset to start of locally - shared texture block */ - - GLuint dirty_state; /* Flags (1 per texunit) for - whether or not this texobj - has dirty hardware state - (pp_*) that needs to be - brought into the - texunit. */ - - drm_radeon_tex_image_t image[6][RADEON_MAX_TEXTURE_LEVELS]; - /* Six, for the cube faces */ - - GLuint pp_txfilter; /* hardware register values */ - GLuint pp_txformat; - GLuint pp_txformat_x; - GLuint pp_txoffset; /* Image location in texmem. - All cube faces follow. */ - GLuint pp_txsize; /* npot only */ - GLuint pp_txpitch; /* npot only */ - GLuint pp_border_color; - GLuint pp_cubic_faces; /* cube face 1,2,3,4 log2 sizes */ - - GLboolean border_fallback; -}; - -struct r200_texture_env_state { - r200TexObjPtr texobj; - GLenum format; - GLenum envMode; -}; - -#define R200_MAX_TEXTURE_UNITS 6 - -struct r200_texture_state { - struct r200_texture_env_state unit[R200_MAX_TEXTURE_UNITS]; -}; - -struct r200_state_atom { - struct r200_state_atom *next, *prev; - const char *name; /* for debug */ - int cmd_size; /* size in bytes */ - GLuint idx; - int *cmd; /* one or more cmd's */ - int *lastcmd; /* one or more cmd's */ - int *savedcmd; /* one or more cmd's */ - GLboolean dirty; - GLboolean(*check) (GLcontext *, int); /* is this state active? */ -}; - -/* Trying to keep these relatively short as the variables are becoming - * extravagently long. Drop the driver name prefix off the front of - * everything - I think we know which driver we're in by now, and keep the - * prefix to 3 letters unless absolutely impossible. - */ - -#define CTX_CMD_0 0 -#define CTX_PP_MISC 1 -#define CTX_PP_FOG_COLOR 2 -#define CTX_RE_SOLID_COLOR 3 -#define CTX_RB3D_BLENDCNTL 4 -#define CTX_RB3D_DEPTHOFFSET 5 -#define CTX_RB3D_DEPTHPITCH 6 -#define CTX_RB3D_ZSTENCILCNTL 7 -#define CTX_CMD_1 8 -#define CTX_PP_CNTL 9 -#define CTX_RB3D_CNTL 10 -#define CTX_RB3D_COLOROFFSET 11 -#define CTX_CMD_2 12 /* why */ -#define CTX_RB3D_COLORPITCH 13 /* why */ -#define CTX_STATE_SIZE_OLDDRM 14 -#define CTX_CMD_3 14 -#define CTX_RB3D_BLENDCOLOR 15 -#define CTX_RB3D_ABLENDCNTL 16 -#define CTX_RB3D_CBLENDCNTL 17 -#define CTX_STATE_SIZE_NEWDRM 18 - -#define SET_CMD_0 0 -#define SET_SE_CNTL 1 -#define SET_RE_CNTL 2 /* replace se_coord_fmt */ -#define SET_STATE_SIZE 3 - -#define VTE_CMD_0 0 -#define VTE_SE_VTE_CNTL 1 -#define VTE_STATE_SIZE 2 - -#define LIN_CMD_0 0 -#define LIN_RE_LINE_PATTERN 1 -#define LIN_RE_LINE_STATE 2 -#define LIN_CMD_1 3 -#define LIN_SE_LINE_WIDTH 4 -#define LIN_STATE_SIZE 5 - -#define MSK_CMD_0 0 -#define MSK_RB3D_STENCILREFMASK 1 -#define MSK_RB3D_ROPCNTL 2 -#define MSK_RB3D_PLANEMASK 3 -#define MSK_STATE_SIZE 4 - -#define VPT_CMD_0 0 -#define VPT_SE_VPORT_XSCALE 1 -#define VPT_SE_VPORT_XOFFSET 2 -#define VPT_SE_VPORT_YSCALE 3 -#define VPT_SE_VPORT_YOFFSET 4 -#define VPT_SE_VPORT_ZSCALE 5 -#define VPT_SE_VPORT_ZOFFSET 6 -#define VPT_STATE_SIZE 7 - -#define ZBS_CMD_0 0 -#define ZBS_SE_ZBIAS_FACTOR 1 -#define ZBS_SE_ZBIAS_CONSTANT 2 -#define ZBS_STATE_SIZE 3 - -#define MSC_CMD_0 0 -#define MSC_RE_MISC 1 -#define MSC_STATE_SIZE 2 - -#define TAM_CMD_0 0 -#define TAM_DEBUG3 1 -#define TAM_STATE_SIZE 2 - -#define TEX_CMD_0 0 -#define TEX_PP_TXFILTER 1 /*2c00 */ -#define TEX_PP_TXFORMAT 2 /*2c04 */ -#define TEX_PP_TXFORMAT_X 3 /*2c08 */ -#define TEX_PP_TXSIZE 4 /*2c0c */ -#define TEX_PP_TXPITCH 5 /*2c10 */ -#define TEX_PP_BORDER_COLOR 6 /*2c14 */ -#define TEX_CMD_1 7 -#define TEX_PP_TXOFFSET 8 /*2d00 */ -#define TEX_STATE_SIZE 9 - -#define CUBE_CMD_0 0 /* 1 register follows */ -#define CUBE_PP_CUBIC_FACES 1 /* 0x2c18 */ -#define CUBE_CMD_1 2 /* 5 registers follow */ -#define CUBE_PP_CUBIC_OFFSET_F1 3 /* 0x2d04 */ -#define CUBE_PP_CUBIC_OFFSET_F2 4 /* 0x2d08 */ -#define CUBE_PP_CUBIC_OFFSET_F3 5 /* 0x2d0c */ -#define CUBE_PP_CUBIC_OFFSET_F4 6 /* 0x2d10 */ -#define CUBE_PP_CUBIC_OFFSET_F5 7 /* 0x2d14 */ -#define CUBE_STATE_SIZE 8 - -#define PIX_CMD_0 0 -#define PIX_PP_TXCBLEND 1 -#define PIX_PP_TXCBLEND2 2 -#define PIX_PP_TXABLEND 3 -#define PIX_PP_TXABLEND2 4 -#define PIX_STATE_SIZE 5 - -#define TF_CMD_0 0 -#define TF_TFACTOR_0 1 -#define TF_TFACTOR_1 2 -#define TF_TFACTOR_2 3 -#define TF_TFACTOR_3 4 -#define TF_TFACTOR_4 5 -#define TF_TFACTOR_5 6 -#define TF_STATE_SIZE 7 - -#define TCL_CMD_0 0 -#define TCL_LIGHT_MODEL_CTL_0 1 -#define TCL_LIGHT_MODEL_CTL_1 2 -#define TCL_PER_LIGHT_CTL_0 3 -#define TCL_PER_LIGHT_CTL_1 4 -#define TCL_PER_LIGHT_CTL_2 5 -#define TCL_PER_LIGHT_CTL_3 6 -#define TCL_CMD_1 7 -#define TCL_UCP_VERT_BLEND_CTL 8 -#define TCL_STATE_SIZE 9 - -#define MSL_CMD_0 0 -#define MSL_MATRIX_SELECT_0 1 -#define MSL_MATRIX_SELECT_1 2 -#define MSL_MATRIX_SELECT_2 3 -#define MSL_MATRIX_SELECT_3 4 -#define MSL_MATRIX_SELECT_4 5 -#define MSL_STATE_SIZE 6 - -#define TCG_CMD_0 0 -#define TCG_TEX_PROC_CTL_2 1 -#define TCG_TEX_PROC_CTL_3 2 -#define TCG_TEX_PROC_CTL_0 3 -#define TCG_TEX_PROC_CTL_1 4 -#define TCG_TEX_CYL_WRAP_CTL 5 -#define TCG_STATE_SIZE 6 - -#define MTL_CMD_0 0 -#define MTL_EMMISSIVE_RED 1 -#define MTL_EMMISSIVE_GREEN 2 -#define MTL_EMMISSIVE_BLUE 3 -#define MTL_EMMISSIVE_ALPHA 4 -#define MTL_AMBIENT_RED 5 -#define MTL_AMBIENT_GREEN 6 -#define MTL_AMBIENT_BLUE 7 -#define MTL_AMBIENT_ALPHA 8 -#define MTL_DIFFUSE_RED 9 -#define MTL_DIFFUSE_GREEN 10 -#define MTL_DIFFUSE_BLUE 11 -#define MTL_DIFFUSE_ALPHA 12 -#define MTL_SPECULAR_RED 13 -#define MTL_SPECULAR_GREEN 14 -#define MTL_SPECULAR_BLUE 15 -#define MTL_SPECULAR_ALPHA 16 -#define MTL_CMD_1 17 -#define MTL_SHININESS 18 -#define MTL_STATE_SIZE 19 - -#define VAP_CMD_0 0 -#define VAP_SE_VAP_CNTL 1 -#define VAP_STATE_SIZE 2 - -/* Replaces a lot of packet info from radeon - */ -#define VTX_CMD_0 0 -#define VTX_VTXFMT_0 1 -#define VTX_VTXFMT_1 2 -#define VTX_TCL_OUTPUT_VTXFMT_0 3 -#define VTX_TCL_OUTPUT_VTXFMT_1 4 -#define VTX_CMD_1 5 -#define VTX_TCL_OUTPUT_COMPSEL 6 -#define VTX_CMD_2 7 -#define VTX_STATE_CNTL 8 -#define VTX_STATE_SIZE 9 - -#define VTX_COLOR(v,n) (((v)>>(R200_VTX_COLOR_0_SHIFT+(n)*2))&\ - R200_VTX_COLOR_MASK) - -/** - * Given the \c R200_SE_VTX_FMT_1 for the current vertex state, determine - * how many components are in texture coordinate \c n. - */ -#define VTX_TEXn_COUNT(v,n) (((v) >> (3 * n)) & 0x07) - -#define MAT_CMD_0 0 -#define MAT_ELT_0 1 -#define MAT_STATE_SIZE 17 - -#define GRD_CMD_0 0 -#define GRD_VERT_GUARD_CLIP_ADJ 1 -#define GRD_VERT_GUARD_DISCARD_ADJ 2 -#define GRD_HORZ_GUARD_CLIP_ADJ 3 -#define GRD_HORZ_GUARD_DISCARD_ADJ 4 -#define GRD_STATE_SIZE 5 - -/* position changes frequently when lighting in modelpos - separate - * out to new state item? - */ -#define LIT_CMD_0 0 -#define LIT_AMBIENT_RED 1 -#define LIT_AMBIENT_GREEN 2 -#define LIT_AMBIENT_BLUE 3 -#define LIT_AMBIENT_ALPHA 4 -#define LIT_DIFFUSE_RED 5 -#define LIT_DIFFUSE_GREEN 6 -#define LIT_DIFFUSE_BLUE 7 -#define LIT_DIFFUSE_ALPHA 8 -#define LIT_SPECULAR_RED 9 -#define LIT_SPECULAR_GREEN 10 -#define LIT_SPECULAR_BLUE 11 -#define LIT_SPECULAR_ALPHA 12 -#define LIT_POSITION_X 13 -#define LIT_POSITION_Y 14 -#define LIT_POSITION_Z 15 -#define LIT_POSITION_W 16 -#define LIT_DIRECTION_X 17 -#define LIT_DIRECTION_Y 18 -#define LIT_DIRECTION_Z 19 -#define LIT_DIRECTION_W 20 -#define LIT_ATTEN_QUADRATIC 21 -#define LIT_ATTEN_LINEAR 22 -#define LIT_ATTEN_CONST 23 -#define LIT_ATTEN_XXX 24 -#define LIT_CMD_1 25 -#define LIT_SPOT_DCD 26 -#define LIT_SPOT_DCM 27 -#define LIT_SPOT_EXPONENT 28 -#define LIT_SPOT_CUTOFF 29 -#define LIT_SPECULAR_THRESH 30 -#define LIT_RANGE_CUTOFF 31 /* ? */ -#define LIT_ATTEN_CONST_INV 32 -#define LIT_STATE_SIZE 33 - -/* Fog - */ -#define FOG_CMD_0 0 -#define FOG_R 1 -#define FOG_C 2 -#define FOG_D 3 -#define FOG_PAD 4 -#define FOG_STATE_SIZE 5 - -/* UCP - */ -#define UCP_CMD_0 0 -#define UCP_X 1 -#define UCP_Y 2 -#define UCP_Z 3 -#define UCP_W 4 -#define UCP_STATE_SIZE 5 - -/* GLT - Global ambient - */ -#define GLT_CMD_0 0 -#define GLT_RED 1 -#define GLT_GREEN 2 -#define GLT_BLUE 3 -#define GLT_ALPHA 4 -#define GLT_STATE_SIZE 5 - -/* EYE - */ -#define EYE_CMD_0 0 -#define EYE_X 1 -#define EYE_Y 2 -#define EYE_Z 3 -#define EYE_RESCALE_FACTOR 4 -#define EYE_STATE_SIZE 5 - -/* CST - constant state - */ -#define CST_CMD_0 0 -#define CST_PP_CNTL_X 1 -#define CST_CMD_1 2 -#define CST_RB3D_DEPTHXY_OFFSET 3 -#define CST_CMD_2 4 -#define CST_RE_AUX_SCISSOR_CNTL 5 -#define CST_CMD_3 6 -#define CST_RE_SCISSOR_TL_0 7 -#define CST_RE_SCISSOR_BR_0 8 -#define CST_CMD_4 9 -#define CST_SE_VAP_CNTL_STATUS 10 -#define CST_CMD_5 11 -#define CST_RE_POINTSIZE 12 -#define CST_CMD_6 13 -#define CST_SE_TCL_INPUT_VTX_0 14 -#define CST_SE_TCL_INPUT_VTX_1 15 -#define CST_SE_TCL_INPUT_VTX_2 16 -#define CST_SE_TCL_INPUT_VTX_3 17 -#define CST_STATE_SIZE 18 - -struct r200_hw_state { - /* Head of the linked list of state atoms. */ - struct r200_state_atom atomlist; - - /* Hardware state, stored as cmdbuf commands: - * -- Need to doublebuffer for - * - reviving state after loss of context - * - eliding noop statechange loops? (except line stipple count) - */ - struct r200_state_atom ctx; - struct r200_state_atom set; - struct r200_state_atom vte; - struct r200_state_atom lin; - struct r200_state_atom msk; - struct r200_state_atom vpt; - struct r200_state_atom vap; - struct r200_state_atom vtx; - struct r200_state_atom tcl; - struct r200_state_atom msl; - struct r200_state_atom tcg; - struct r200_state_atom msc; - struct r200_state_atom cst; - struct r200_state_atom tam; - struct r200_state_atom tf; - struct r200_state_atom tex[6]; - struct r200_state_atom cube[6]; - struct r200_state_atom zbs; - struct r200_state_atom mtl[2]; - struct r200_state_atom mat[9]; - struct r200_state_atom lit[8]; /* includes vec, scl commands */ - struct r200_state_atom ucp[6]; - struct r200_state_atom pix[6]; /* pixshader stages */ - struct r200_state_atom eye; /* eye pos */ - struct r200_state_atom grd; /* guard band clipping */ - struct r200_state_atom fog; - struct r200_state_atom glt; - - int max_state_size; /* Number of bytes necessary for a full state emit. */ - GLboolean is_dirty, all_dirty; -}; - -struct r200_colorbuffer_state { - int roundEnable; -}; - -struct r200_state { - /* Derived state for internal purposes: - */ - struct r200_colorbuffer_state color; - struct r200_depthbuffer_state depth; - struct r200_stencilbuffer_state stencil; - struct r200_stipple_state stipple; - struct r200_texture_state texture; -}; - -/* Need refcounting on dma buffers: - */ -struct r200_dma_buffer { - int refcount; /* the number of retained regions in buf */ - drmBufPtr buf; -}; - -#define GET_START(rvb) (rmesa->radeon.radeonScreen->gart_buffer_offset + \ - (rvb)->address - rmesa->dma.buf0_address + \ - (rvb)->start) - -/* A retained region, eg vertices for indexed vertices. - */ -struct r200_dma_region { - struct r200_dma_buffer *buf; - char *address; /* == buf->address */ - int start, end, ptr; /* offsets from start of buf */ - int aos_start; - int aos_stride; - int aos_size; -}; - -struct r200_dma { - /* Active dma region. Allocations for vertices and retained - * regions come from here. Also used for emitting random vertices, - * these may be flushed by calling flush_current(); - */ - struct r200_dma_region current; - - void (*flush) (r200ContextPtr); - - char *buf0_address; /* start of buf[0], for index calcs */ - GLuint nr_released_bufs; /* flush after so many buffers released */ -}; - -#define R200_CMD_BUF_SZ (8*1024) - -struct r200_store { - GLuint statenr; - GLuint primnr; - char cmd_buf[R200_CMD_BUF_SZ]; - int cmd_used; - int elts_start; -}; - -/* r200_tcl.c - */ -struct r200_tcl_info { - GLuint vertex_format; - GLint last_offset; - GLuint hw_primitive; - - struct r200_dma_region *aos_components[8]; - GLuint nr_aos_components; - - GLuint *Elts; - - struct r200_dma_region indexed_verts; - struct r200_dma_region obj; - struct r200_dma_region rgba; - struct r200_dma_region spec; - struct r200_dma_region fog; - struct r200_dma_region tex[R200_MAX_TEXTURE_UNITS]; - struct r200_dma_region norm; -}; - -/* r200_swtcl.c - */ -struct r200_swtcl_info { - GLuint RenderIndex; - - /** - * Size of a hardware vertex. This is calculated when \c ::vertex_attrs is - * installed in the Mesa state vector. - */ - GLuint vertex_size; - - /** - * Attributes instructing the Mesa TCL pipeline where / how to put vertex - * data in the hardware buffer. - */ - struct tnl_attr_map vertex_attrs[VERT_ATTRIB_MAX]; - - /** - * Number of elements of \c ::vertex_attrs that are actually used. - */ - GLuint vertex_attr_count; - - /** - * Cached pointer to the buffer where Mesa will store vertex data. - */ - GLubyte *verts; - - /* Fallback rasterization functions - */ - r200_point_func draw_point; - r200_line_func draw_line; - r200_tri_func draw_tri; - - GLuint hw_primitive; - GLenum render_primitive; - GLuint numverts; - - /** - * Offset of the 4UB color data within a hardware (swtcl) vertex. - */ - GLuint coloroffset; - - /** - * Offset of the 3UB specular color data within a hardware (swtcl) vertex. - */ - GLuint specoffset; - - /** - * Should Mesa project vertex data or will the hardware do it? - */ - GLboolean needproj; - - struct r200_dma_region indexed_verts; -}; - -struct r200_ioctl { - GLuint vertex_offset; - GLuint vertex_size; -}; - -#define R200_MAX_PRIMS 64 - -/* Want to keep a cache of these around. Each is parameterized by - * only a single value which has only a small range. Only expect a - * few, so just rescan the list each time? - */ -struct dynfn { - struct dynfn *next, *prev; - int key[2]; - char *code; -}; - -struct dfn_lists { - struct dynfn Vertex2f; - struct dynfn Vertex2fv; - struct dynfn Vertex3f; - struct dynfn Vertex3fv; - struct dynfn Color4ub; - struct dynfn Color4ubv; - struct dynfn Color3ub; - struct dynfn Color3ubv; - struct dynfn Color4f; - struct dynfn Color4fv; - struct dynfn Color3f; - struct dynfn Color3fv; - struct dynfn SecondaryColor3ubEXT; - struct dynfn SecondaryColor3ubvEXT; - struct dynfn SecondaryColor3fEXT; - struct dynfn SecondaryColor3fvEXT; - struct dynfn Normal3f; - struct dynfn Normal3fv; - struct dynfn TexCoord3f; - struct dynfn TexCoord3fv; - struct dynfn TexCoord2f; - struct dynfn TexCoord2fv; - struct dynfn TexCoord1f; - struct dynfn TexCoord1fv; - struct dynfn MultiTexCoord3fARB; - struct dynfn MultiTexCoord3fvARB; - struct dynfn MultiTexCoord2fARB; - struct dynfn MultiTexCoord2fvARB; - struct dynfn MultiTexCoord1fARB; - struct dynfn MultiTexCoord1fvARB; -}; - -struct dfn_generators { - struct dynfn *(*Vertex2f) (GLcontext *, const int *); - struct dynfn *(*Vertex2fv) (GLcontext *, const int *); - struct dynfn *(*Vertex3f) (GLcontext *, const int *); - struct dynfn *(*Vertex3fv) (GLcontext *, const int *); - struct dynfn *(*Color4ub) (GLcontext *, const int *); - struct dynfn *(*Color4ubv) (GLcontext *, const int *); - struct dynfn *(*Color3ub) (GLcontext *, const int *); - struct dynfn *(*Color3ubv) (GLcontext *, const int *); - struct dynfn *(*Color4f) (GLcontext *, const int *); - struct dynfn *(*Color4fv) (GLcontext *, const int *); - struct dynfn *(*Color3f) (GLcontext *, const int *); - struct dynfn *(*Color3fv) (GLcontext *, const int *); - struct dynfn *(*SecondaryColor3ubEXT) (GLcontext *, const int *); - struct dynfn *(*SecondaryColor3ubvEXT) (GLcontext *, const int *); - struct dynfn *(*SecondaryColor3fEXT) (GLcontext *, const int *); - struct dynfn *(*SecondaryColor3fvEXT) (GLcontext *, const int *); - struct dynfn *(*Normal3f) (GLcontext *, const int *); - struct dynfn *(*Normal3fv) (GLcontext *, const int *); - struct dynfn *(*TexCoord3f) (GLcontext *, const int *); - struct dynfn *(*TexCoord3fv) (GLcontext *, const int *); - struct dynfn *(*TexCoord2f) (GLcontext *, const int *); - struct dynfn *(*TexCoord2fv) (GLcontext *, const int *); - struct dynfn *(*TexCoord1f) (GLcontext *, const int *); - struct dynfn *(*TexCoord1fv) (GLcontext *, const int *); - struct dynfn *(*MultiTexCoord3fARB) (GLcontext *, const int *); - struct dynfn *(*MultiTexCoord3fvARB) (GLcontext *, const int *); - struct dynfn *(*MultiTexCoord2fARB) (GLcontext *, const int *); - struct dynfn *(*MultiTexCoord2fvARB) (GLcontext *, const int *); - struct dynfn *(*MultiTexCoord1fARB) (GLcontext *, const int *); - struct dynfn *(*MultiTexCoord1fvARB) (GLcontext *, const int *); -}; - -struct r200_prim { - GLuint start; - GLuint end; - GLuint prim; -}; - - /* A maximum total of 29 elements per vertex: 3 floats for position, 3 - * floats for normal, 4 floats for color, 4 bytes for secondary color, - * 3 floats for each texture unit (18 floats total). - * - * we maybe need add. 4 to prevent segfault if someone specifies - * GL_TEXTURE6/GL_TEXTURE7 (esp. for the codegen-path) (FIXME: ) - * - * The position data is never actually stored here, so 3 elements could be - * trimmed out of the buffer. - */ - -#define R200_MAX_VERTEX_SIZE ((3*6)+11) - -struct r200_vbinfo { - GLint counter, initial_counter; - GLint *dmaptr; - void (*notify) (void); - GLint vertex_size; - - union { - float f; - int i; - r200_color_t color; - } vertex[R200_MAX_VERTEX_SIZE]; - - GLfloat *normalptr; - GLfloat *floatcolorptr; - r200_color_t *colorptr; - GLfloat *floatspecptr; - r200_color_t *specptr; - GLfloat *texcoordptr[8]; /* 6 (TMU) + 2 for r200_vtxfmt_c.c when GL_TEXTURE6/7 */ - - GLenum *prim; /* &ctx->Driver.CurrentExecPrimitive */ - GLuint primflags; - GLboolean enabled; /* *_NO_VTXFMT / *_NO_TCL env vars */ - GLboolean installed; - GLboolean fell_back; - GLboolean recheck; - GLint nrverts; - GLuint vtxfmt_0, vtxfmt_1; - - GLuint installed_vertex_format; - GLuint installed_color_3f_sz; - - struct r200_prim primlist[R200_MAX_PRIMS]; - int nrprims; - - struct dfn_lists dfn_cache; - struct dfn_generators codegen; - GLvertexformat vtxfmt; -}; - -/** - * R200 context structure. - */ -struct r200_context { - struct radeon_context radeon; /* parent class, must be first */ - - /* Driver and hardware state management - */ - struct r200_hw_state hw; - struct r200_state state; - - /* Texture object bookkeeping - */ - unsigned nr_heaps; - driTexHeap *texture_heaps[RADEON_NR_TEX_HEAPS]; - driTextureObject swapped; - int texture_depth; - float initialMaxAnisotropy; - - /* Rasterization and vertex state: - */ - GLuint NewGLState; - - /* Vertex buffers - */ - struct r200_ioctl ioctl; - struct r200_dma dma; - struct r200_store store; - GLboolean save_on_next_unlock; - - /* Clientdata textures; - */ - GLuint prefer_gart_client_texturing; - - /* TCL stuff - */ - GLmatrix TexGenMatrix[R200_MAX_TEXTURE_UNITS]; - GLboolean recheck_texgen[R200_MAX_TEXTURE_UNITS]; - GLboolean TexGenNeedNormals[R200_MAX_TEXTURE_UNITS]; - GLuint TexMatEnabled; - GLuint TexMatCompSel; - GLuint TexGenEnabled; - GLuint TexGenInputs; - GLuint TexGenCompSel; - GLmatrix tmpmat; - - /* r200_tcl.c - */ - struct r200_tcl_info tcl; - - /* r200_swtcl.c - */ - struct r200_swtcl_info swtcl; - - /* r200_vtxfmt.c - */ - struct r200_vbinfo vb; -}; - -#define R200_CONTEXT(ctx) ((r200ContextPtr)(ctx->DriverCtx)) - -extern void r200DestroyContext(__DRIcontextPrivate * driContextPriv); -extern GLboolean r200CreateContext(const __GLcontextModes * glVisual, - __DRIcontextPrivate * driContextPriv, - void *sharedContextPrivate); - -#endif -#endif /* __R200_CONTEXT_H__ */ diff --git a/src/mesa/drivers/dri/r300/r200_ioctl.h b/src/mesa/drivers/dri/r300/r200_ioctl.h deleted file mode 100644 index db7bd7697f1..00000000000 --- a/src/mesa/drivers/dri/r300/r200_ioctl.h +++ /dev/null @@ -1,204 +0,0 @@ -/* -Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. - -The Weather Channel (TM) funded Tungsten Graphics to develop the -initial release of the Radeon 8500 driver under the XFree86 license. -This notice must be preserved. - -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 COPYRIGHT OWNER(S) 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: - * Keith Whitwell - */ - -#ifndef __R200_IOCTL_H__ -#define __R200_IOCTL_H__ - -#include "simple_list.h" -#include "radeon_dri.h" -#include "radeon_lock.h" - -#include "xf86drm.h" -#include "drm.h" -#include "r200_context.h" -#include "radeon_drm.h" - -extern void r200EmitState(r200ContextPtr rmesa); -extern void r200EmitVertexAOS(r200ContextPtr rmesa, - GLuint vertex_size, GLuint offset); - -extern void r200EmitVbufPrim(r200ContextPtr rmesa, - GLuint primitive, GLuint vertex_nr); - -extern void r200FlushElts(r200ContextPtr rmesa); - -extern GLushort *r200AllocEltsOpenEnded(r200ContextPtr rmesa, - GLuint primitive, GLuint min_nr); - -extern void r200EmitAOS(r200ContextPtr rmesa, - struct r200_dma_region **regions, - GLuint n, GLuint offset); - -extern void r200EmitBlit(r200ContextPtr rmesa, - GLuint color_fmt, - GLuint src_pitch, - GLuint src_offset, - GLuint dst_pitch, - GLuint dst_offset, - GLint srcx, GLint srcy, - GLint dstx, GLint dsty, GLuint w, GLuint h); - -extern void r200EmitWait(r200ContextPtr rmesa, GLuint flags); - -extern void r200FlushCmdBuf(r200ContextPtr rmesa, const char *); -extern int r200FlushCmdBufLocked(r200ContextPtr rmesa, const char *caller); -extern void r200Flush(GLcontext * ctx); - -extern void r200RefillCurrentDmaRegion(r200ContextPtr rmesa); - -extern void r200AllocDmaRegion(r200ContextPtr rmesa, - struct r200_dma_region *region, - int bytes, int alignment); - -extern void r200AllocDmaRegionVerts(r200ContextPtr rmesa, - struct r200_dma_region *region, - int numverts, int vertsize, int alignment); - -extern void r200ReleaseDmaRegion(r200ContextPtr rmesa, - struct r200_dma_region *region, - const char *caller); - -extern void r200WaitForVBlank(r200ContextPtr rmesa); -extern void r200InitIoctlFuncs(struct dd_function_table *functions); - -extern void *r200AllocateMemoryMESA(__DRInativeDisplay * dpy, int scrn, - GLsizei size, GLfloat readfreq, - GLfloat writefreq, GLfloat priority); -extern void r200FreeMemoryMESA(__DRInativeDisplay * dpy, int scrn, - GLvoid * pointer); -extern GLuint r200GetMemoryOffsetMESA(__DRInativeDisplay * dpy, int scrn, - const GLvoid * pointer); - -extern GLboolean r200IsGartMemory(r200ContextPtr rmesa, const GLvoid * pointer, - GLint size); - -extern GLuint r200GartOffsetFromVirtual(r200ContextPtr rmesa, - const GLvoid * pointer); - -void r200SaveHwState(r200ContextPtr radeon); -void r200SetUpAtomList(r200ContextPtr rmesa); - -/* ================================================================ - * Helper macros: - */ - -/* Close off the last primitive, if it exists. - */ -#define R200_NEWPRIM( rmesa ) \ -do { \ - if ( rmesa->dma.flush ) \ - rmesa->dma.flush( rmesa ); \ -} while (0) - -/* Can accomodate several state changes and primitive changes without - * actually firing the buffer. - */ -#define R200_STATECHANGE( rmesa, ATOM ) \ -do { \ - R200_NEWPRIM( rmesa ); \ - rmesa->hw.ATOM.dirty = GL_TRUE; \ - rmesa->hw.is_dirty = GL_TRUE; \ -} while (0) - -#define R200_DB_STATE( ATOM ) \ - memcpy( rmesa->hw.ATOM.lastcmd, rmesa->hw.ATOM.cmd, \ - rmesa->hw.ATOM.cmd_size * 4) - -static __inline int R200_DB_STATECHANGE(r200ContextPtr rmesa, - struct r200_state_atom *atom) -{ - if (memcmp(atom->cmd, atom->lastcmd, atom->cmd_size * 4)) { - int *tmp; - R200_NEWPRIM(rmesa); - atom->dirty = GL_TRUE; - rmesa->hw.is_dirty = GL_TRUE; - tmp = atom->cmd; - atom->cmd = atom->lastcmd; - atom->lastcmd = tmp; - return 1; - } else - return 0; -} - -/* Fire the buffered vertices no matter what. - */ -#define R200_FIREVERTICES( r200 ) \ -do { \ - if ( (r200)->store.cmd_used || (r200)->dma.flush ) { \ - radeonFlush( (r200)->radeon.glCtx ); \ - } \ -} while (0) - -/* Command lengths. Note that any time you ensure ELTS_BUFSZ or VBUF_BUFSZ - * are available, you will also be adding an rmesa->state.max_state_size because - * r200EmitState is called from within r200EmitVbufPrim and r200FlushElts. - */ -#define AOS_BUFSZ(nr) ((3 + ((nr / 2) * 3) + ((nr & 1) * 2)) * sizeof(int)) -#define VERT_AOS_BUFSZ (5 * sizeof(int)) -#define ELTS_BUFSZ(nr) (12 + nr * 2) -#define VBUF_BUFSZ (3 * sizeof(int)) - -/* Ensure that a minimum amount of space is available in the command buffer. - * This is used to ensure atomicity of state updates with the rendering requests - * that rely on them. - * - * An alternative would be to implement a "soft lock" such that when the buffer - * wraps at an inopportune time, we grab the lock, flush the current buffer, - * and hang on to the lock until the critical section is finished and we flush - * the buffer again and unlock. - */ -static __inline void r200EnsureCmdBufSpace(r200ContextPtr rmesa, int bytes) -{ - if (rmesa->store.cmd_used + bytes > R200_CMD_BUF_SZ) - r200FlushCmdBuf(rmesa, __FUNCTION__); - assert(bytes <= R200_CMD_BUF_SZ); -} - -/* Alloc space in the command buffer - */ -static __inline char *r200AllocCmdBuf(r200ContextPtr rmesa, - int bytes, const char *where) -{ - char *head; - - if (rmesa->store.cmd_used + bytes > R200_CMD_BUF_SZ) - r200FlushCmdBuf(rmesa, where); - - head = rmesa->store.cmd_buf + rmesa->store.cmd_used; - rmesa->store.cmd_used += bytes; - assert(rmesa->store.cmd_used <= R200_CMD_BUF_SZ); - return head; -} - -#endif /* __R200_IOCTL_H__ */ diff --git a/src/mesa/drivers/dri/r300/r200_reg.h b/src/mesa/drivers/dri/r300/r200_reg.h deleted file mode 100644 index 1336e961ac6..00000000000 --- a/src/mesa/drivers/dri/r300/r200_reg.h +++ /dev/null @@ -1,1423 +0,0 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_reg.h,v 1.2 2002/12/16 16:18:54 dawes Exp $ */ -/* -Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. - -The Weather Channel (TM) funded Tungsten Graphics to develop the -initial release of the Radeon 8500 driver under the XFree86 license. -This notice must be preserved. - -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 COPYRIGHT OWNER(S) 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. -*/ - -#ifndef _R200_REG_H_ -#define _R200_REG_H_ - -#define R200_PP_MISC 0x1c14 -#define R200_REF_ALPHA_MASK 0x000000ff -#define R200_ALPHA_TEST_FAIL (0 << 8) -#define R200_ALPHA_TEST_LESS (1 << 8) -#define R200_ALPHA_TEST_LEQUAL (2 << 8) -#define R200_ALPHA_TEST_EQUAL (3 << 8) -#define R200_ALPHA_TEST_GEQUAL (4 << 8) -#define R200_ALPHA_TEST_GREATER (5 << 8) -#define R200_ALPHA_TEST_NEQUAL (6 << 8) -#define R200_ALPHA_TEST_PASS (7 << 8) -#define R200_ALPHA_TEST_OP_MASK (7 << 8) -#define R200_CHROMA_FUNC_FAIL (0 << 16) -#define R200_CHROMA_FUNC_PASS (1 << 16) -#define R200_CHROMA_FUNC_NEQUAL (2 << 16) -#define R200_CHROMA_FUNC_EQUAL (3 << 16) -#define R200_CHROMA_KEY_NEAREST (0 << 18) -#define R200_CHROMA_KEY_ZERO (1 << 18) -#define R200_RIGHT_HAND_CUBE_D3D (0 << 24) -#define R200_RIGHT_HAND_CUBE_OGL (1 << 24) -#define R200_PP_FOG_COLOR 0x1c18 -#define R200_FOG_COLOR_MASK 0x00ffffff -#define R200_FOG_VERTEX (0 << 24) -#define R200_FOG_TABLE (1 << 24) -#define R200_FOG_USE_DEPTH (0 << 25) -#define R200_FOG_USE_W (1 << 25) -#define R200_FOG_USE_DIFFUSE_ALPHA (2 << 25) -#define R200_FOG_USE_SPEC_ALPHA (3 << 25) -#define R200_FOG_USE_VTX_FOG (4 << 25) -#define R200_FOG_USE_MASK (7 << 25) -#define R200_RE_SOLID_COLOR 0x1c1c -#define R200_RB3D_BLENDCNTL 0x1c20 -#define R200_COMB_FCN_MASK (7 << 12) -#define R200_COMB_FCN_ADD_CLAMP (0 << 12) -#define R200_COMB_FCN_ADD_NOCLAMP (1 << 12) -#define R200_COMB_FCN_SUB_CLAMP (2 << 12) -#define R200_COMB_FCN_SUB_NOCLAMP (3 << 12) -#define R200_COMB_FCN_MIN (4 << 12) -#define R200_COMB_FCN_MAX (5 << 12) -#define R200_COMB_FCN_RSUB_CLAMP (6 << 12) -#define R200_COMB_FCN_RSUB_NOCLAMP (7 << 12) -#define R200_BLEND_GL_ZERO (32) -#define R200_BLEND_GL_ONE (33) -#define R200_BLEND_GL_SRC_COLOR (34) -#define R200_BLEND_GL_ONE_MINUS_SRC_COLOR (35) -#define R200_BLEND_GL_DST_COLOR (36) -#define R200_BLEND_GL_ONE_MINUS_DST_COLOR (37) -#define R200_BLEND_GL_SRC_ALPHA (38) -#define R200_BLEND_GL_ONE_MINUS_SRC_ALPHA (39) -#define R200_BLEND_GL_DST_ALPHA (40) -#define R200_BLEND_GL_ONE_MINUS_DST_ALPHA (41) -#define R200_BLEND_GL_SRC_ALPHA_SATURATE (42) /* src factor only */ -#define R200_BLEND_GL_CONST_COLOR (43) -#define R200_BLEND_GL_ONE_MINUS_CONST_COLOR (44) -#define R200_BLEND_GL_CONST_ALPHA (45) -#define R200_BLEND_GL_ONE_MINUS_CONST_ALPHA (46) -#define R200_BLEND_MASK (63) -#define R200_SRC_BLEND_SHIFT (16) -#define R200_DST_BLEND_SHIFT (24) -#define R200_RB3D_DEPTHOFFSET 0x1c24 -#define R200_RB3D_DEPTHPITCH 0x1c28 -#define R200_DEPTHPITCH_MASK 0x00001ff8 -#define R200_DEPTH_ENDIAN_NO_SWAP (0 << 18) -#define R200_DEPTH_ENDIAN_WORD_SWAP (1 << 18) -#define R200_DEPTH_ENDIAN_DWORD_SWAP (2 << 18) -#define R200_RB3D_ZSTENCILCNTL 0x1c2c -#define R200_DEPTH_FORMAT_MASK (0xf << 0) -#define R200_DEPTH_FORMAT_16BIT_INT_Z (0 << 0) -#define R200_DEPTH_FORMAT_24BIT_INT_Z (2 << 0) -#define R200_DEPTH_FORMAT_24BIT_FLOAT_Z (3 << 0) -#define R200_DEPTH_FORMAT_32BIT_INT_Z (4 << 0) -#define R200_DEPTH_FORMAT_32BIT_FLOAT_Z (5 << 0) -#define R200_DEPTH_FORMAT_24BIT_FLOAT_W (9 << 0) -#define R200_DEPTH_FORMAT_32BIT_FLOAT_W (11 << 0) -#define R200_Z_TEST_NEVER (0 << 4) -#define R200_Z_TEST_LESS (1 << 4) -#define R200_Z_TEST_LEQUAL (2 << 4) -#define R200_Z_TEST_EQUAL (3 << 4) -#define R200_Z_TEST_GEQUAL (4 << 4) -#define R200_Z_TEST_GREATER (5 << 4) -#define R200_Z_TEST_NEQUAL (6 << 4) -#define R200_Z_TEST_ALWAYS (7 << 4) -#define R200_Z_TEST_MASK (7 << 4) -#define R200_STENCIL_TEST_NEVER (0 << 12) -#define R200_STENCIL_TEST_LESS (1 << 12) -#define R200_STENCIL_TEST_LEQUAL (2 << 12) -#define R200_STENCIL_TEST_EQUAL (3 << 12) -#define R200_STENCIL_TEST_GEQUAL (4 << 12) -#define R200_STENCIL_TEST_GREATER (5 << 12) -#define R200_STENCIL_TEST_NEQUAL (6 << 12) -#define R200_STENCIL_TEST_ALWAYS (7 << 12) -#define R200_STENCIL_TEST_MASK (0x7 << 12) -#define R200_STENCIL_FAIL_KEEP (0 << 16) -#define R200_STENCIL_FAIL_ZERO (1 << 16) -#define R200_STENCIL_FAIL_REPLACE (2 << 16) -#define R200_STENCIL_FAIL_INC (3 << 16) -#define R200_STENCIL_FAIL_DEC (4 << 16) -#define R200_STENCIL_FAIL_INVERT (5 << 16) -#define R200_STENCIL_FAIL_INC_WRAP (6 << 16) -#define R200_STENCIL_FAIL_DEC_WRAP (7 << 16) -#define R200_STENCIL_FAIL_MASK (0x7 << 16) -#define R200_STENCIL_ZPASS_KEEP (0 << 20) -#define R200_STENCIL_ZPASS_ZERO (1 << 20) -#define R200_STENCIL_ZPASS_REPLACE (2 << 20) -#define R200_STENCIL_ZPASS_INC (3 << 20) -#define R200_STENCIL_ZPASS_DEC (4 << 20) -#define R200_STENCIL_ZPASS_INVERT (5 << 20) -#define R200_STENCIL_ZPASS_INC_WRAP (6 << 20) -#define R200_STENCIL_ZPASS_DEC_WRAP (7 << 20) -#define R200_STENCIL_ZPASS_MASK (0x7 << 20) -#define R200_STENCIL_ZFAIL_KEEP (0 << 24) -#define R200_STENCIL_ZFAIL_ZERO (1 << 24) -#define R200_STENCIL_ZFAIL_REPLACE (2 << 24) -#define R200_STENCIL_ZFAIL_INC (3 << 24) -#define R200_STENCIL_ZFAIL_DEC (4 << 24) -#define R200_STENCIL_ZFAIL_INVERT (5 << 24) -#define R200_STENCIL_ZFAIL_INC_WRAP (6 << 24) -#define R200_STENCIL_ZFAIL_DEC_WRAP (7 << 24) -#define R200_STENCIL_ZFAIL_MASK (0x7 << 24) -#define R200_Z_WRITE_ENABLE (1 << 30) -/*gap*/ -#define R200_PP_CNTL 0x1c38 -#define R200_TEX_0_ENABLE 0x00000010 -#define R200_TEX_1_ENABLE 0x00000020 -#define R200_TEX_2_ENABLE 0x00000040 -#define R200_TEX_3_ENABLE 0x00000080 -#define R200_TEX_4_ENABLE 0x00000100 -#define R200_TEX_5_ENABLE 0x00000200 -#define R200_TEX_ENABLE_MASK 0x000003f0 -#define R200_FILTER_ROUND_MODE_MASK 0x00000400 -#define R200_TEX_BLEND_7_ENABLE 0x00000800 -#define R200_TEX_BLEND_0_ENABLE 0x00001000 -#define R200_TEX_BLEND_1_ENABLE 0x00002000 -#define R200_TEX_BLEND_2_ENABLE 0x00004000 -#define R200_TEX_BLEND_3_ENABLE 0x00008000 -#define R200_TEX_BLEND_4_ENABLE 0x00010000 -#define R200_TEX_BLEND_5_ENABLE 0x00020000 -#define R200_TEX_BLEND_6_ENABLE 0x00040000 -#define R200_MULTI_PASS_ENABLE 0x00080000 -#define R200_SPECULAR_ENABLE 0x00200000 -#define R200_FOG_ENABLE 0x00400000 -#define R200_ALPHA_TEST_ENABLE 0x00800000 -#define R200_ANTI_ALIAS_NONE 0x00000000 -#define R200_ANTI_ALIAS_LINE 0x01000000 -#define R200_ANTI_ALIAS_POLY 0x02000000 -#define R200_ANTI_ALIAS_MASK 0x03000000 -#define R200_RB3D_CNTL 0x1c3c -#define R200_ALPHA_BLEND_ENABLE (1 << 0) -#define R200_PLANE_MASK_ENABLE (1 << 1) -#define R200_DITHER_ENABLE (1 << 2) -#define R200_ROUND_ENABLE (1 << 3) -#define R200_SCALE_DITHER_ENABLE (1 << 4) -#define R200_DITHER_INIT (1 << 5) -#define R200_ROP_ENABLE (1 << 6) -#define R200_STENCIL_ENABLE (1 << 7) -#define R200_Z_ENABLE (1 << 8) -#define R200_DEPTH_XZ_OFFEST_ENABLE (1 << 9) -#define R200_COLOR_FORMAT_ARGB1555 (3 << 10) -#define R200_COLOR_FORMAT_RGB565 (4 << 10) -#define R200_COLOR_FORMAT_ARGB8888 (6 << 10) -#define R200_COLOR_FORMAT_RGB332 (7 << 10) -#define R200_COLOR_FORMAT_Y8 (8 << 10) -#define R200_COLOR_FORMAT_RGB8 (9 << 10) -#define R200_COLOR_FORMAT_YUV422_VYUY (11 << 10) -#define R200_COLOR_FORMAT_YUV422_YVYU (12 << 10) -#define R200_COLOR_FORMAT_aYUV444 (14 << 10) -#define R200_COLOR_FORMAT_ARGB4444 (15 << 10) -#define R200_CLRCMP_FLIP_ENABLE (1 << 14) -#define R200_SEPARATE_ALPHA_ENABLE (1 << 16) -#define R200_RB3D_COLOROFFSET 0x1c40 -#define R200_COLOROFFSET_MASK 0xfffffff0 -#define R200_RE_WIDTH_HEIGHT 0x1c44 -#define R200_RE_WIDTH_SHIFT 0 -#define R200_RE_HEIGHT_SHIFT 16 -#define R200_RB3D_COLORPITCH 0x1c48 -#define R200_COLORPITCH_MASK 0x000001ff8 -#define R200_COLOR_ENDIAN_NO_SWAP (0 << 18) -#define R200_COLOR_ENDIAN_WORD_SWAP (1 << 18) -#define R200_COLOR_ENDIAN_DWORD_SWAP (2 << 18) -#define R200_SE_CNTL 0x1c4c -#define R200_FFACE_CULL_CW (0 << 0) -#define R200_FFACE_CULL_CCW (1 << 0) -#define R200_FFACE_CULL_DIR_MASK (1 << 0) -#define R200_BFACE_CULL (0 << 1) -#define R200_BFACE_SOLID (3 << 1) -#define R200_FFACE_CULL (0 << 3) -#define R200_FFACE_SOLID (3 << 3) -#define R200_FFACE_CULL_MASK (3 << 3) -#define R200_FLAT_SHADE_VTX_0 (0 << 6) -#define R200_FLAT_SHADE_VTX_1 (1 << 6) -#define R200_FLAT_SHADE_VTX_2 (2 << 6) -#define R200_FLAT_SHADE_VTX_LAST (3 << 6) -#define R200_DIFFUSE_SHADE_SOLID (0 << 8) -#define R200_DIFFUSE_SHADE_FLAT (1 << 8) -#define R200_DIFFUSE_SHADE_GOURAUD (2 << 8) -#define R200_DIFFUSE_SHADE_MASK (3 << 8) -#define R200_ALPHA_SHADE_SOLID (0 << 10) -#define R200_ALPHA_SHADE_FLAT (1 << 10) -#define R200_ALPHA_SHADE_GOURAUD (2 << 10) -#define R200_ALPHA_SHADE_MASK (3 << 10) -#define R200_SPECULAR_SHADE_SOLID (0 << 12) -#define R200_SPECULAR_SHADE_FLAT (1 << 12) -#define R200_SPECULAR_SHADE_GOURAUD (2 << 12) -#define R200_SPECULAR_SHADE_MASK (3 << 12) -#define R200_FOG_SHADE_SOLID (0 << 14) -#define R200_FOG_SHADE_FLAT (1 << 14) -#define R200_FOG_SHADE_GOURAUD (2 << 14) -#define R200_FOG_SHADE_MASK (3 << 14) -#define R200_ZBIAS_ENABLE_POINT (1 << 16) -#define R200_ZBIAS_ENABLE_LINE (1 << 17) -#define R200_ZBIAS_ENABLE_TRI (1 << 18) -#define R200_WIDELINE_ENABLE (1 << 20) -#define R200_VTX_PIX_CENTER_D3D (0 << 27) -#define R200_VTX_PIX_CENTER_OGL (1 << 27) -#define R200_ROUND_MODE_TRUNC (0 << 28) -#define R200_ROUND_MODE_ROUND (1 << 28) -#define R200_ROUND_MODE_ROUND_EVEN (2 << 28) -#define R200_ROUND_MODE_ROUND_ODD (3 << 28) -#define R200_ROUND_PREC_16TH_PIX (0 << 30) -#define R200_ROUND_PREC_8TH_PIX (1 << 30) -#define R200_ROUND_PREC_4TH_PIX (2 << 30) -#define R200_ROUND_PREC_HALF_PIX (3 << 30) -#define R200_RE_CNTL 0x1c50 -#define R200_STIPPLE_ENABLE 0x1 -#define R200_SCISSOR_ENABLE 0x2 -#define R200_PATTERN_ENABLE 0x4 -#define R200_PERSPECTIVE_ENABLE 0x8 -#define R200_POINT_SMOOTH 0x20 -#define R200_VTX_STQ0_D3D 0x00010000 -#define R200_VTX_STQ1_D3D 0x00040000 -#define R200_VTX_STQ2_D3D 0x00100000 -#define R200_VTX_STQ3_D3D 0x00400000 -#define R200_VTX_STQ4_D3D 0x01000000 -#define R200_VTX_STQ5_D3D 0x04000000 -/* gap */ -#define R200_RE_STIPPLE_ADDR 0x1cc8 -#define R200_RE_STIPPLE_DATA 0x1ccc -#define R200_RE_LINE_PATTERN 0x1cd0 -#define R200_LINE_PATTERN_MASK 0x0000ffff -#define R200_LINE_REPEAT_COUNT_SHIFT 16 -#define R200_LINE_PATTERN_START_SHIFT 24 -#define R200_LINE_PATTERN_LITTLE_BIT_ORDER (0 << 28) -#define R200_LINE_PATTERN_BIG_BIT_ORDER (1 << 28) -#define R200_LINE_PATTERN_AUTO_RESET (1 << 29) -#define R200_RE_LINE_STATE 0x1cd4 -#define R200_LINE_CURRENT_PTR_SHIFT 0 -#define R200_LINE_CURRENT_COUNT_SHIFT 8 -#define R200_RE_SCISSOR_TL_0 0x1cd8 -#define R200_RE_SCISSOR_BR_0 0x1cdc -#define R200_RE_SCISSOR_TL_1 0x1ce0 -#define R200_RE_SCISSOR_BR_1 0x1ce4 -#define R200_RE_SCISSOR_TL_2 0x1ce8 -#define R200_RE_SCISSOR_BR_2 0x1cec -/* gap */ -#define R200_RB3D_DEPTHXY_OFFSET 0x1d60 -#define R200_DEPTHX_SHIFT 0 -#define R200_DEPTHY_SHIFT 16 -/* gap */ -#define R200_RB3D_STENCILREFMASK 0x1d7c -#define R200_STENCIL_REF_SHIFT 0 -#define R200_STENCIL_REF_MASK (0xff << 0) -#define R200_STENCIL_MASK_SHIFT 16 -#define R200_STENCIL_VALUE_MASK (0xff << 16) -#define R200_STENCIL_WRITEMASK_SHIFT 24 -#define R200_STENCIL_WRITE_MASK (0xff << 24) -#define R200_RB3D_ROPCNTL 0x1d80 -#define R200_ROP_MASK (15 << 8) -#define R200_ROP_CLEAR (0 << 8) -#define R200_ROP_NOR (1 << 8) -#define R200_ROP_AND_INVERTED (2 << 8) -#define R200_ROP_COPY_INVERTED (3 << 8) -#define R200_ROP_AND_REVERSE (4 << 8) -#define R200_ROP_INVERT (5 << 8) -#define R200_ROP_XOR (6 << 8) -#define R200_ROP_NAND (7 << 8) -#define R200_ROP_AND (8 << 8) -#define R200_ROP_EQUIV (9 << 8) -#define R200_ROP_NOOP (10 << 8) -#define R200_ROP_OR_INVERTED (11 << 8) -#define R200_ROP_COPY (12 << 8) -#define R200_ROP_OR_REVERSE (13 << 8) -#define R200_ROP_OR (14 << 8) -#define R200_ROP_SET (15 << 8) -#define R200_RB3D_PLANEMASK 0x1d84 -/* gap */ -#define R200_SE_VPORT_XSCALE 0x1d98 -#define R200_SE_VPORT_XOFFSET 0x1d9c -#define R200_SE_VPORT_YSCALE 0x1da0 -#define R200_SE_VPORT_YOFFSET 0x1da4 -#define R200_SE_VPORT_ZSCALE 0x1da8 -#define R200_SE_VPORT_ZOFFSET 0x1dac -#define R200_SE_ZBIAS_FACTOR 0x1db0 -#define R200_SE_ZBIAS_CONSTANT 0x1db4 -#define R200_SE_LINE_WIDTH 0x1db8 -#define R200_LINE_WIDTH_SHIFT 0x00000000 -#define R200_MINPOINTSIZE_SHIFT 0x00000010 -/* gap */ -#define R200_SE_VAP_CNTL 0x2080 -#define R200_VAP_TCL_ENABLE 0x00000001 -#define R200_VAP_SINGLE_BUF_STATE_ENABLE 0x00000010 -#define R200_VAP_FORCE_W_TO_ONE 0x00010000 -#define R200_VAP_D3D_TEX_DEFAULT 0x00020000 -#define R200_VAP_VF_MAX_VTX_NUM__SHIFT 18 -#define R200_VAP_DX_CLIP_SPACE_DEF 0x00400000 -#define R200_SE_VF_CNTL 0x2084 -#define R200_VF_PRIM_NONE 0x00000000 -#define R200_VF_PRIM_POINTS 0x00000001 -#define R200_VF_PRIM_LINES 0x00000002 -#define R200_VF_PRIM_LINE_STRIP 0x00000003 -#define R200_VF_PRIM_TRIANGLES 0x00000004 -#define R200_VF_PRIM_TRIANGLE_FAN 0x00000005 -#define R200_VF_PRIM_TRIANGLE_STRIP 0x00000006 -#define R200_VF_PRIM_RECT_LIST 0x00000008 -#define R200_VF_PRIM_3VRT_POINTS 0x00000009 -#define R200_VF_PRIM_3VRT_LINES 0x0000000a -#define R200_VF_PRIM_POINT_SPRITES 0x0000000b -#define R200_VF_PRIM_LINE_LOOP 0x0000000c -#define R200_VF_PRIM_QUADS 0x0000000d -#define R200_VF_PRIM_QUAD_STRIP 0x0000000e -#define R200_VF_PRIM_POLYGON 0x0000000f -#define R200_VF_PRIM_MASK 0x0000000f -#define R200_VF_PRIM_WALK_IND 0x00000010 -#define R200_VF_PRIM_WALK_LIST 0x00000020 -#define R200_VF_PRIM_WALK_RING 0x00000030 -#define R200_VF_PRIM_WALK_MASK 0x00000030 -#define R200_VF_COLOR_ORDER_RGBA 0x00000040 -#define R200_VF_TCL_OUTPUT_VTX_ENABLE 0x00000200 -#define R200_VF_INDEX_SZ_4 0x00000800 -#define R200_VF_VERTEX_NUMBER_MASK 0xffff0000 -#define R200_VF_VERTEX_NUMBER_SHIFT 16 -#define R200_SE_VTX_FMT_0 0x2088 -#define R200_VTX_XY 0 /* always have xy */ -#define R200_VTX_Z0 (1<<0) -#define R200_VTX_W0 (1<<1) -#define R200_VTX_WEIGHT_COUNT_SHIFT (2) -#define R200_VTX_PV_MATRIX_SEL (1<<5) -#define R200_VTX_N0 (1<<6) -#define R200_VTX_POINT_SIZE (1<<7) -#define R200_VTX_DISCRETE_FOG (1<<8) -#define R200_VTX_SHININESS_0 (1<<9) -#define R200_VTX_SHININESS_1 (1<<10) -#define R200_VTX_COLOR_NOT_PRESENT 0 -#define R200_VTX_PK_RGBA 1 -#define R200_VTX_FP_RGB 2 -#define R200_VTX_FP_RGBA 3 -#define R200_VTX_COLOR_MASK 3 -#define R200_VTX_COLOR_0_SHIFT 11 -#define R200_VTX_COLOR_1_SHIFT 13 -#define R200_VTX_COLOR_2_SHIFT 15 -#define R200_VTX_COLOR_3_SHIFT 17 -#define R200_VTX_COLOR_4_SHIFT 19 -#define R200_VTX_COLOR_5_SHIFT 21 -#define R200_VTX_COLOR_6_SHIFT 23 -#define R200_VTX_COLOR_7_SHIFT 25 -#define R200_VTX_XY1 (1<<28) -#define R200_VTX_Z1 (1<<29) -#define R200_VTX_W1 (1<<30) -#define R200_VTX_N1 (1<<31) -#define R200_SE_VTX_FMT_1 0x208c -#define R200_VTX_TEX0_COMP_CNT_SHIFT 0 -#define R200_VTX_TEX1_COMP_CNT_SHIFT 3 -#define R200_VTX_TEX2_COMP_CNT_SHIFT 6 -#define R200_VTX_TEX3_COMP_CNT_SHIFT 9 -#define R200_VTX_TEX4_COMP_CNT_SHIFT 12 -#define R200_VTX_TEX5_COMP_CNT_SHIFT 15 -#define R200_SE_TCL_OUTPUT_VTX_FMT_0 0x2090 -#define R200_SE_TCL_OUTPUT_VTX_FMT_1 0x2094 -/* gap */ -#define R200_SE_VTE_CNTL 0x20b0 -#define R200_VPORT_X_SCALE_ENA 0x00000001 -#define R200_VPORT_X_OFFSET_ENA 0x00000002 -#define R200_VPORT_Y_SCALE_ENA 0x00000004 -#define R200_VPORT_Y_OFFSET_ENA 0x00000008 -#define R200_VPORT_Z_SCALE_ENA 0x00000010 -#define R200_VPORT_Z_OFFSET_ENA 0x00000020 -#define R200_VTX_XY_FMT 0x00000100 -#define R200_VTX_Z_FMT 0x00000200 -#define R200_VTX_W0_FMT 0x00000400 -#define R200_VTX_W0_NORMALIZE 0x00000800 -#define R200_VTX_ST_DENORMALIZED 0x00001000 -/* gap */ -#define R200_SE_VTX_NUM_ARRAYS 0x20c0 -#define R200_SE_VTX_AOS_ATTR01 0x20c4 -#define R200_SE_VTX_AOS_ADDR0 0x20c8 -#define R200_SE_VTX_AOS_ADDR1 0x20cc -#define R200_SE_VTX_AOS_ATTR23 0x20d0 -#define R200_SE_VTX_AOS_ADDR2 0x20d4 -#define R200_SE_VTX_AOS_ADDR3 0x20d8 -#define R200_SE_VTX_AOS_ATTR45 0x20dc -#define R200_SE_VTX_AOS_ADDR4 0x20e0 -#define R200_SE_VTX_AOS_ADDR5 0x20e4 -#define R200_SE_VTX_AOS_ATTR67 0x20e8 -#define R200_SE_VTX_AOS_ADDR6 0x20ec -#define R200_SE_VTX_AOS_ADDR7 0x20f0 -#define R200_SE_VTX_AOS_ATTR89 0x20f4 -#define R200_SE_VTX_AOS_ADDR8 0x20f8 -#define R200_SE_VTX_AOS_ADDR9 0x20fc -#define R200_SE_VTX_AOS_ATTR1011 0x2100 -#define R200_SE_VTX_AOS_ADDR10 0x2104 -#define R200_SE_VTX_AOS_ADDR11 0x2108 -#define R200_SE_VF_MAX_VTX_INDX 0x210c -#define R200_SE_VF_MIN_VTX_INDX 0x2110 -/* gap */ -#define R200_SE_VAP_CNTL_STATUS 0x2140 -#define R200_VC_NO_SWAP (0 << 0) -#define R200_VC_16BIT_SWAP (1 << 0) -#define R200_VC_32BIT_SWAP (2 << 0) -/* gap */ -#define R200_SE_VTX_STATE_CNTL 0x2180 -#define R200_VSC_COLOR_0_ASSEMBLY_CNTL_SHIFT 0x00000000 -#define R200_VSC_COLOR_1_ASSEMBLY_CNTL_SHIFT 0x00000002 -#define R200_VSC_COLOR_2_ASSEMBLY_CNTL_SHIFT 0x00000004 -#define R200_VSC_COLOR_3_ASSEMBLY_CNTL_SHIFT 0x00000006 -#define R200_VSC_COLOR_4_ASSEMBLY_CNTL_SHIFT 0x00000008 -#define R200_VSC_COLOR_5_ASSEMBLY_CNTL_SHIFT 0x0000000a -#define R200_VSC_COLOR_6_ASSEMBLY_CNTL_SHIFT 0x0000000c -#define R200_VSC_COLOR_7_ASSEMBLY_CNTL_SHIFT 0x0000000e -#define R200_VSC_UPDATE_USER_COLOR_0_ENABLE 0x00010000 -#define R200_VSC_UPDATE_USER_COLOR_1_ENABLE 0x00020000 -/* gap */ -#define R200_SE_TCL_VECTOR_INDX_REG 0x2200 -#define R200_SE_TCL_VECTOR_DATA_REG 0x2204 -#define R200_SE_TCL_SCALAR_INDX_REG 0x2208 -#define R200_SE_TCL_SCALAR_DATA_REG 0x220c -/* gap */ -#define R200_SE_TCL_MATRIX_SEL_0 0x2230 -#define R200_MODELVIEW_0_SHIFT (0) -#define R200_MODELVIEW_1_SHIFT (8) -#define R200_MODELVIEW_2_SHIFT (16) -#define R200_MODELVIEW_3_SHIFT (24) -#define R200_SE_TCL_MATRIX_SEL_1 0x2234 -#define R200_IT_MODELVIEW_0_SHIFT (0) -#define R200_IT_MODELVIEW_1_SHIFT (8) -#define R200_IT_MODELVIEW_2_SHIFT (16) -#define R200_IT_MODELVIEW_3_SHIFT (24) -#define R200_SE_TCL_MATRIX_SEL_2 0x2238 -#define R200_MODELPROJECT_0_SHIFT (0) -#define R200_MODELPROJECT_1_SHIFT (8) -#define R200_MODELPROJECT_2_SHIFT (16) -#define R200_MODELPROJECT_3_SHIFT (24) -#define R200_SE_TCL_MATRIX_SEL_3 0x223c -#define R200_TEXMAT_0_SHIFT 0 -#define R200_TEXMAT_1_SHIFT 8 -#define R200_TEXMAT_2_SHIFT 16 -#define R200_TEXMAT_3_SHIFT 24 -#define R200_SE_TCL_MATRIX_SEL_4 0x2240 -#define R200_TEXMAT_4_SHIFT 0 -#define R200_TEXMAT_5_SHIFT 8 -/* gap */ -#define R200_SE_TCL_OUTPUT_VTX_COMP_SEL 0x2250 -#define R200_OUTPUT_XYZW (1<<0) -#define R200_OUTPUT_COLOR_0 (1<<8) -#define R200_OUTPUT_COLOR_1 (1<<9) -#define R200_OUTPUT_TEX_0 (1<<16) -#define R200_OUTPUT_TEX_1 (1<<17) -#define R200_OUTPUT_TEX_2 (1<<18) -#define R200_OUTPUT_TEX_3 (1<<19) -#define R200_OUTPUT_TEX_4 (1<<20) -#define R200_OUTPUT_TEX_5 (1<<21) -#define R200_OUTPUT_TEX_MASK (0x3f<<16) -#define R200_OUTPUT_DISCRETE_FOG (1<<24) -#define R200_OUTPUT_PT_SIZE (1<<25) -#define R200_FORCE_INORDER_PROC (1<<31) -#define R200_SE_TCL_INPUT_VTX_VECTOR_ADDR_0 0x2254 -#define R200_VERTEX_POSITION_ADDR__SHIFT 0x00000000 -#define R200_SE_TCL_INPUT_VTX_VECTOR_ADDR_1 0x2258 -#define R200_VTX_COLOR_0_ADDR__SHIFT 0x00000000 -#define R200_VTX_COLOR_1_ADDR__SHIFT 0x00000008 -#define R200_SE_TCL_INPUT_VTX_VECTOR_ADDR_2 0x225c -#define R200_VTX_TEX_0_ADDR__SHIFT 0x00000000 -#define R200_VTX_TEX_1_ADDR__SHIFT 0x00000008 -#define R200_VTX_TEX_2_ADDR__SHIFT 0x00000010 -#define R200_VTX_TEX_3_ADDR__SHIFT 0x00000018 -#define R200_SE_TCL_INPUT_VTX_VECTOR_ADDR_3 0x2260 -#define R200_VTX_TEX_4_ADDR__SHIFT 0x00000000 -#define R200_VTX_TEX_5_ADDR__SHIFT 0x00000008 - -/* gap */ -#define R200_SE_TCL_LIGHT_MODEL_CTL_0 0x2268 -#define R200_LIGHTING_ENABLE (1<<0) -#define R200_LIGHT_IN_MODELSPACE (1<<1) -#define R200_LOCAL_VIEWER (1<<2) -#define R200_NORMALIZE_NORMALS (1<<3) -#define R200_RESCALE_NORMALS (1<<4) -#define R200_SPECULAR_LIGHTS (1<<5) -#define R200_DIFFUSE_SPECULAR_COMBINE (1<<6) -#define R200_LIGHT_ALPHA (1<<7) -#define R200_LOCAL_LIGHT_VEC_GL (1<<8) -#define R200_LIGHT_NO_NORMAL_AMBIENT_ONLY (1<<9) -#define R200_LIGHT_TWOSIDE (1<<10) -#define R200_FRONT_SHININESS_SOURCE_SHIFT (0xb) -#define R200_BACK_SHININESS_SOURCE_SHIFT (0xd) -#define R200_LM0_SOURCE_MATERIAL_0 (0) -#define R200_LM0_SOURCE_MATERIAL_1 (1) -#define R200_LM0_SOURCE_VERTEX_SHININESS_0 (2) -#define R200_LM0_SOURCE_VERTEX_SHININESS_1 (3) -#define R200_SE_TCL_LIGHT_MODEL_CTL_1 0x226c -#define R200_LM1_SOURCE_LIGHT_PREMULT (0) -#define R200_LM1_SOURCE_MATERIAL_0 (1) -#define R200_LM1_SOURCE_VERTEX_COLOR_0 (2) -#define R200_LM1_SOURCE_VERTEX_COLOR_1 (3) -#define R200_LM1_SOURCE_VERTEX_COLOR_2 (4) -#define R200_LM1_SOURCE_VERTEX_COLOR_3 (5) -#define R200_LM1_SOURCE_VERTEX_COLOR_4 (6) -#define R200_LM1_SOURCE_VERTEX_COLOR_5 (7) -#define R200_LM1_SOURCE_VERTEX_COLOR_6 (8) -#define R200_LM1_SOURCE_VERTEX_COLOR_7 (9) -#define R200_LM1_SOURCE_MATERIAL_1 (0xf) -#define R200_FRONT_EMISSIVE_SOURCE_SHIFT (0) -#define R200_FRONT_AMBIENT_SOURCE_SHIFT (4) -#define R200_FRONT_DIFFUSE_SOURCE_SHIFT (8) -#define R200_FRONT_SPECULAR_SOURCE_SHIFT (12) -#define R200_BACK_EMISSIVE_SOURCE_SHIFT (16) -#define R200_BACK_AMBIENT_SOURCE_SHIFT (20) -#define R200_BACK_DIFFUSE_SOURCE_SHIFT (24) -#define R200_BACK_SPECULAR_SOURCE_SHIFT (28) -#define R200_SE_TCL_PER_LIGHT_CTL_0 0x2270 -#define R200_LIGHT_0_ENABLE (1<<0) -#define R200_LIGHT_0_ENABLE_AMBIENT (1<<1) -#define R200_LIGHT_0_ENABLE_SPECULAR (1<<2) -#define R200_LIGHT_0_IS_LOCAL (1<<3) -#define R200_LIGHT_0_IS_SPOT (1<<4) -#define R200_LIGHT_0_DUAL_CONE (1<<5) -#define R200_LIGHT_0_ENABLE_RANGE_ATTEN (1<<6) -#define R200_LIGHT_0_CONSTANT_RANGE_ATTEN (1<<7) -#define R200_LIGHT_1_ENABLE (1<<16) -#define R200_LIGHT_1_ENABLE_AMBIENT (1<<17) -#define R200_LIGHT_1_ENABLE_SPECULAR (1<<18) -#define R200_LIGHT_1_IS_LOCAL (1<<19) -#define R200_LIGHT_1_IS_SPOT (1<<20) -#define R200_LIGHT_1_DUAL_CONE (1<<21) -#define R200_LIGHT_1_ENABLE_RANGE_ATTEN (1<<22) -#define R200_LIGHT_1_CONSTANT_RANGE_ATTEN (1<<23) -#define R200_LIGHT_0_SHIFT (0) -#define R200_LIGHT_1_SHIFT (16) -#define R200_SE_TCL_PER_LIGHT_CTL_1 0x2274 -#define R200_LIGHT_2_SHIFT (0) -#define R200_LIGHT_3_SHIFT (16) -#define R200_SE_TCL_PER_LIGHT_CTL_2 0x2278 -#define R200_LIGHT_4_SHIFT (0) -#define R200_LIGHT_5_SHIFT (16) -#define R200_SE_TCL_PER_LIGHT_CTL_3 0x227c -#define R200_LIGHT_6_SHIFT (0) -#define R200_LIGHT_7_SHIFT (16) -/* gap */ -#define R200_SE_TCL_TEX_PROC_CTL_2 0x22a8 -#define R200_TEXGEN_0_COMP_MASK_SHIFT (0) -#define R200_TEXGEN_1_COMP_MASK_SHIFT (4) -#define R200_TEXGEN_2_COMP_MASK_SHIFT (8) -#define R200_TEXGEN_3_COMP_MASK_SHIFT (12) -#define R200_TEXGEN_4_COMP_MASK_SHIFT (16) -#define R200_TEXGEN_5_COMP_MASK_SHIFT (20) -#define R200_SE_TCL_TEX_PROC_CTL_3 0x22ac -#define R200_TEXGEN_0_INPUT_TEX_SHIFT (0) -#define R200_TEXGEN_1_INPUT_TEX_SHIFT (4) -#define R200_TEXGEN_2_INPUT_TEX_SHIFT (8) -#define R200_TEXGEN_3_INPUT_TEX_SHIFT (12) -#define R200_TEXGEN_4_INPUT_TEX_SHIFT (16) -#define R200_TEXGEN_5_INPUT_TEX_SHIFT (20) -#define R200_SE_TCL_TEX_PROC_CTL_0 0x22b0 -#define R200_TEXGEN_TEXMAT_0_ENABLE (1<<0) -#define R200_TEXGEN_TEXMAT_1_ENABLE (1<<1) -#define R200_TEXGEN_TEXMAT_2_ENABLE (1<<2) -#define R200_TEXGEN_TEXMAT_3_ENABLE (1<<3) -#define R200_TEXGEN_TEXMAT_4_ENABLE (1<<4) -#define R200_TEXGEN_TEXMAT_5_ENABLE (1<<5) -#define R200_TEXMAT_0_ENABLE (1<<8) -#define R200_TEXMAT_1_ENABLE (1<<9) -#define R200_TEXMAT_2_ENABLE (1<<10) -#define R200_TEXMAT_3_ENABLE (1<<11) -#define R200_TEXMAT_4_ENABLE (1<<12) -#define R200_TEXMAT_5_ENABLE (1<<13) -#define R200_TEXGEN_FORCE_W_TO_ONE (1<<16) -#define R200_SE_TCL_TEX_PROC_CTL_1 0x22b4 -#define R200_TEXGEN_INPUT_MASK (0xf) -#define R200_TEXGEN_INPUT_TEXCOORD_0 (0) -#define R200_TEXGEN_INPUT_TEXCOORD_1 (1) -#define R200_TEXGEN_INPUT_TEXCOORD_2 (2) -#define R200_TEXGEN_INPUT_TEXCOORD_3 (3) -#define R200_TEXGEN_INPUT_TEXCOORD_4 (4) -#define R200_TEXGEN_INPUT_TEXCOORD_5 (5) -#define R200_TEXGEN_INPUT_OBJ (8) -#define R200_TEXGEN_INPUT_EYE (9) -#define R200_TEXGEN_INPUT_EYE_NORMAL (0xa) -#define R200_TEXGEN_INPUT_EYE_REFLECT (0xb) -#define R200_TEXGEN_INPUT_SPHERE (0xd) -#define R200_TEXGEN_0_INPUT_SHIFT (0) -#define R200_TEXGEN_1_INPUT_SHIFT (4) -#define R200_TEXGEN_2_INPUT_SHIFT (8) -#define R200_TEXGEN_3_INPUT_SHIFT (12) -#define R200_TEXGEN_4_INPUT_SHIFT (16) -#define R200_TEXGEN_5_INPUT_SHIFT (20) -#define R200_SE_TC_TEX_CYL_WRAP_CTL 0x22b8 -/* gap */ -#define R200_SE_TCL_UCP_VERT_BLEND_CTL 0x22c0 -#define R200_UCP_IN_CLIP_SPACE (1<<0) -#define R200_UCP_IN_MODEL_SPACE (1<<1) -#define R200_UCP_ENABLE_0 (1<<2) -#define R200_UCP_ENABLE_1 (1<<3) -#define R200_UCP_ENABLE_2 (1<<4) -#define R200_UCP_ENABLE_3 (1<<5) -#define R200_UCP_ENABLE_4 (1<<6) -#define R200_UCP_ENABLE_5 (1<<7) -#define R200_TCL_FOG_MASK (3<<8) -#define R200_TCL_FOG_DISABLE (0<<8) -#define R200_TCL_FOG_EXP (1<<8) -#define R200_TCL_FOG_EXP2 (2<<8) -#define R200_TCL_FOG_LINEAR (3<<8) -#define R200_RNG_BASED_FOG (1<<10) -#define R200_CLIP_DISABLE (1<<11) -#define R200_CULL_FRONT_IS_CW (0<<28) -#define R200_CULL_FRONT_IS_CCW (1<<28) -#define R200_CULL_FRONT (1<<29) -#define R200_CULL_BACK (1<<30) -#define R200_SE_TCL_POINT_SPRITE_CNTL 0x22c4 -/* gap */ -#define R200_SE_VTX_ST_POS_0_X_4 0x2300 -#define R200_SE_VTX_ST_POS_0_Y_4 0x2304 -#define R200_SE_VTX_ST_POS_0_Z_4 0x2308 -#define R200_SE_VTX_ST_POS_0_W_4 0x230c -#define R200_SE_VTX_ST_NORM_0_X 0x2310 -#define R200_SE_VTX_ST_NORM_0_Y 0x2314 -#define R200_SE_VTX_ST_NORM_0_Z 0x2318 -#define R200_SE_VTX_ST_PVMS 0x231c -#define R200_SE_VTX_ST_CLR_0_R 0x2320 -#define R200_SE_VTX_ST_CLR_0_G 0x2324 -#define R200_SE_VTX_ST_CLR_0_B 0x2328 -#define R200_SE_VTX_ST_CLR_0_A 0x232c -#define R200_SE_VTX_ST_CLR_1_R 0x2330 -#define R200_SE_VTX_ST_CLR_1_G 0x2334 -#define R200_SE_VTX_ST_CLR_1_B 0x2338 -#define R200_SE_VTX_ST_CLR_1_A 0x233c -#define R200_SE_VTX_ST_CLR_2_R 0x2340 -#define R200_SE_VTX_ST_CLR_2_G 0x2344 -#define R200_SE_VTX_ST_CLR_2_B 0x2348 -#define R200_SE_VTX_ST_CLR_2_A 0x234c -#define R200_SE_VTX_ST_CLR_3_R 0x2350 -#define R200_SE_VTX_ST_CLR_3_G 0x2354 -#define R200_SE_VTX_ST_CLR_3_B 0x2358 -#define R200_SE_VTX_ST_CLR_3_A 0x235c -#define R200_SE_VTX_ST_CLR_4_R 0x2360 -#define R200_SE_VTX_ST_CLR_4_G 0x2364 -#define R200_SE_VTX_ST_CLR_4_B 0x2368 -#define R200_SE_VTX_ST_CLR_4_A 0x236c -#define R200_SE_VTX_ST_CLR_5_R 0x2370 -#define R200_SE_VTX_ST_CLR_5_G 0x2374 -#define R200_SE_VTX_ST_CLR_5_B 0x2378 -#define R200_SE_VTX_ST_CLR_5_A 0x237c -#define R200_SE_VTX_ST_CLR_6_R 0x2380 -#define R200_SE_VTX_ST_CLR_6_G 0x2384 -#define R200_SE_VTX_ST_CLR_6_B 0x2388 -#define R200_SE_VTX_ST_CLR_6_A 0x238c -#define R200_SE_VTX_ST_CLR_7_R 0x2390 -#define R200_SE_VTX_ST_CLR_7_G 0x2394 -#define R200_SE_VTX_ST_CLR_7_B 0x2398 -#define R200_SE_VTX_ST_CLR_7_A 0x239c -#define R200_SE_VTX_ST_TEX_0_S 0x23a0 -#define R200_SE_VTX_ST_TEX_0_T 0x23a4 -#define R200_SE_VTX_ST_TEX_0_R 0x23a8 -#define R200_SE_VTX_ST_TEX_0_Q 0x23ac -#define R200_SE_VTX_ST_TEX_1_S 0x23b0 -#define R200_SE_VTX_ST_TEX_1_T 0x23b4 -#define R200_SE_VTX_ST_TEX_1_R 0x23b8 -#define R200_SE_VTX_ST_TEX_1_Q 0x23bc -#define R200_SE_VTX_ST_TEX_2_S 0x23c0 -#define R200_SE_VTX_ST_TEX_2_T 0x23c4 -#define R200_SE_VTX_ST_TEX_2_R 0x23c8 -#define R200_SE_VTX_ST_TEX_2_Q 0x23cc -#define R200_SE_VTX_ST_TEX_3_S 0x23d0 -#define R200_SE_VTX_ST_TEX_3_T 0x23d4 -#define R200_SE_VTX_ST_TEX_3_R 0x23d8 -#define R200_SE_VTX_ST_TEX_3_Q 0x23dc -#define R200_SE_VTX_ST_TEX_4_S 0x23e0 -#define R200_SE_VTX_ST_TEX_4_T 0x23e4 -#define R200_SE_VTX_ST_TEX_4_R 0x23e8 -#define R200_SE_VTX_ST_TEX_4_Q 0x23ec -#define R200_SE_VTX_ST_TEX_5_S 0x23f0 -#define R200_SE_VTX_ST_TEX_5_T 0x23f4 -#define R200_SE_VTX_ST_TEX_5_R 0x23f8 -#define R200_SE_VTX_ST_TEX_5_Q 0x23fc -#define R200_SE_VTX_ST_PNT_SPRT_SZ 0x2400 -#define R200_SE_VTX_ST_DISC_FOG 0x2404 -#define R200_SE_VTX_ST_SHININESS_0 0x2408 -#define R200_SE_VTX_ST_SHININESS_1 0x240c -#define R200_SE_VTX_ST_BLND_WT_0 0x2410 -#define R200_SE_VTX_ST_BLND_WT_1 0x2414 -#define R200_SE_VTX_ST_BLND_WT_2 0x2418 -#define R200_SE_VTX_ST_BLND_WT_3 0x241c -#define R200_SE_VTX_ST_POS_1_X 0x2420 -#define R200_SE_VTX_ST_POS_1_Y 0x2424 -#define R200_SE_VTX_ST_POS_1_Z 0x2428 -#define R200_SE_VTX_ST_POS_1_W 0x242c -#define R200_SE_VTX_ST_NORM_1_X 0x2430 -#define R200_SE_VTX_ST_NORM_1_Y 0x2434 -#define R200_SE_VTX_ST_NORM_1_Z 0x2438 -#define R200_SE_VTX_ST_USR_CLR_0_R 0x2440 -#define R200_SE_VTX_ST_USR_CLR_0_G 0x2444 -#define R200_SE_VTX_ST_USR_CLR_0_B 0x2448 -#define R200_SE_VTX_ST_USR_CLR_0_A 0x244c -#define R200_SE_VTX_ST_USR_CLR_1_R 0x2450 -#define R200_SE_VTX_ST_USR_CLR_1_G 0x2454 -#define R200_SE_VTX_ST_USR_CLR_1_B 0x2458 -#define R200_SE_VTX_ST_USR_CLR_1_A 0x245c -#define R200_SE_VTX_ST_CLR_0_PKD 0x2460 -#define R200_SE_VTX_ST_CLR_1_PKD 0x2464 -#define R200_SE_VTX_ST_CLR_2_PKD 0x2468 -#define R200_SE_VTX_ST_CLR_3_PKD 0x246c -#define R200_SE_VTX_ST_CLR_4_PKD 0x2470 -#define R200_SE_VTX_ST_CLR_5_PKD 0x2474 -#define R200_SE_VTX_ST_CLR_6_PKD 0x2478 -#define R200_SE_VTX_ST_CLR_7_PKD 0x247c -#define R200_SE_VTX_ST_POS_0_X_2 0x2480 -#define R200_SE_VTX_ST_POS_0_Y_2 0x2484 -#define R200_SE_VTX_ST_PAR_CLR_LD 0x2488 -#define R200_SE_VTX_ST_USR_CLR_PKD 0x248c -#define R200_SE_VTX_ST_POS_0_X_3 0x2490 -#define R200_SE_VTX_ST_POS_0_Y_3 0x2494 -#define R200_SE_VTX_ST_POS_0_Z_3 0x2498 -#define R200_SE_VTX_ST_END_OF_PKT 0x249c -/* gap */ -#define R200_RE_POINTSIZE 0x2648 -#define R200_POINTSIZE_SHIFT 0 -#define R200_MAXPOINTSIZE_SHIFT 16 -/* gap */ -#define R200_RE_TOP_LEFT 0x26c0 -#define R200_RE_LEFT_SHIFT 0 -#define R200_RE_TOP_SHIFT 16 -#define R200_RE_MISC 0x26c4 -#define R200_STIPPLE_COORD_MASK 0x1f -#define R200_STIPPLE_X_OFFSET_SHIFT 0 -#define R200_STIPPLE_X_OFFSET_MASK (0x1f << 0) -#define R200_STIPPLE_Y_OFFSET_SHIFT 8 -#define R200_STIPPLE_Y_OFFSET_MASK (0x1f << 8) -#define R200_STIPPLE_LITTLE_BIT_ORDER (0 << 16) -#define R200_STIPPLE_BIG_BIT_ORDER (1 << 16) -/* gap */ -#define R200_RE_AUX_SCISSOR_CNTL 0x26f0 -#define R200_EXCLUSIVE_SCISSOR_0 0x01000000 -#define R200_EXCLUSIVE_SCISSOR_1 0x02000000 -#define R200_EXCLUSIVE_SCISSOR_2 0x04000000 -#define R200_SCISSOR_ENABLE_0 0x10000000 -#define R200_SCISSOR_ENABLE_1 0x20000000 -#define R200_SCISSOR_ENABLE_2 0x40000000 -/* gap */ -#define R200_PP_TXFILTER_0 0x2c00 -#define R200_MAG_FILTER_NEAREST (0 << 0) -#define R200_MAG_FILTER_LINEAR (1 << 0) -#define R200_MAG_FILTER_MASK (1 << 0) -#define R200_MIN_FILTER_NEAREST (0 << 1) -#define R200_MIN_FILTER_LINEAR (1 << 1) -#define R200_MIN_FILTER_NEAREST_MIP_NEAREST (2 << 1) -#define R200_MIN_FILTER_NEAREST_MIP_LINEAR (3 << 1) -#define R200_MIN_FILTER_LINEAR_MIP_NEAREST (6 << 1) -#define R200_MIN_FILTER_LINEAR_MIP_LINEAR (7 << 1) -#define R200_MIN_FILTER_ANISO_NEAREST (8 << 1) -#define R200_MIN_FILTER_ANISO_LINEAR (9 << 1) -#define R200_MIN_FILTER_ANISO_NEAREST_MIP_NEAREST (10 << 1) -#define R200_MIN_FILTER_ANISO_NEAREST_MIP_LINEAR (11 << 1) -#define R200_MIN_FILTER_MASK (15 << 1) -#define R200_MAX_ANISO_1_TO_1 (0 << 5) -#define R200_MAX_ANISO_2_TO_1 (1 << 5) -#define R200_MAX_ANISO_4_TO_1 (2 << 5) -#define R200_MAX_ANISO_8_TO_1 (3 << 5) -#define R200_MAX_ANISO_16_TO_1 (4 << 5) -#define R200_MAX_ANISO_MASK (7 << 5) -#define R200_MAX_MIP_LEVEL_MASK (0x0f << 16) -#define R200_MAX_MIP_LEVEL_SHIFT 16 -#define R200_YUV_TO_RGB (1 << 20) -#define R200_YUV_TEMPERATURE_COOL (0 << 21) -#define R200_YUV_TEMPERATURE_HOT (1 << 21) -#define R200_YUV_TEMPERATURE_MASK (1 << 21) -#define R200_WRAPEN_S (1 << 22) -#define R200_CLAMP_S_WRAP (0 << 23) -#define R200_CLAMP_S_MIRROR (1 << 23) -#define R200_CLAMP_S_CLAMP_LAST (2 << 23) -#define R200_CLAMP_S_MIRROR_CLAMP_LAST (3 << 23) -#define R200_CLAMP_S_CLAMP_BORDER (4 << 23) -#define R200_CLAMP_S_MIRROR_CLAMP_BORDER (5 << 23) -#define R200_CLAMP_S_CLAMP_GL (6 << 23) -#define R200_CLAMP_S_MIRROR_CLAMP_GL (7 << 23) -#define R200_CLAMP_S_MASK (7 << 23) -#define R200_WRAPEN_T (1 << 26) -#define R200_CLAMP_T_WRAP (0 << 27) -#define R200_CLAMP_T_MIRROR (1 << 27) -#define R200_CLAMP_T_CLAMP_LAST (2 << 27) -#define R200_CLAMP_T_MIRROR_CLAMP_LAST (3 << 27) -#define R200_CLAMP_T_CLAMP_BORDER (4 << 27) -#define R200_CLAMP_T_MIRROR_CLAMP_BORDER (5 << 27) -#define R200_CLAMP_T_CLAMP_GL (6 << 27) -#define R200_CLAMP_T_MIRROR_CLAMP_GL (7 << 27) -#define R200_CLAMP_T_MASK (7 << 27) -#define R200_KILL_LT_ZERO (1 << 30) -#define R200_BORDER_MODE_OGL (0 << 31) -#define R200_BORDER_MODE_D3D (1 << 31) -#define R200_PP_TXFORMAT_0 0x2c04 -#define R200_TXFORMAT_I8 (0 << 0) -#define R200_TXFORMAT_AI88 (1 << 0) -#define R200_TXFORMAT_RGB332 (2 << 0) -#define R200_TXFORMAT_ARGB1555 (3 << 0) -#define R200_TXFORMAT_RGB565 (4 << 0) -#define R200_TXFORMAT_ARGB4444 (5 << 0) -#define R200_TXFORMAT_ARGB8888 (6 << 0) -#define R200_TXFORMAT_RGBA8888 (7 << 0) -#define R200_TXFORMAT_Y8 (8 << 0) -#define R200_TXFORMAT_AVYU4444 (9 << 0) -#define R200_TXFORMAT_VYUY422 (10 << 0) -#define R200_TXFORMAT_YVYU422 (11 << 0) -#define R200_TXFORMAT_DXT1 (12 << 0) -#define R200_TXFORMAT_DXT23 (14 << 0) -#define R200_TXFORMAT_DXT45 (15 << 0) -#define R200_TXFORMAT_FORMAT_MASK (31 << 0) -#define R200_TXFORMAT_FORMAT_SHIFT 0 -#define R200_TXFORMAT_ALPHA_IN_MAP (1 << 6) -#define R200_TXFORMAT_NON_POWER2 (1 << 7) -#define R200_TXFORMAT_WIDTH_MASK (15 << 8) -#define R200_TXFORMAT_WIDTH_SHIFT 8 -#define R200_TXFORMAT_HEIGHT_MASK (15 << 12) -#define R200_TXFORMAT_HEIGHT_SHIFT 12 -#define R200_TXFORMAT_F5_WIDTH_MASK (15 << 16) /* cube face 5 */ -#define R200_TXFORMAT_F5_WIDTH_SHIFT 16 -#define R200_TXFORMAT_F5_HEIGHT_MASK (15 << 20) -#define R200_TXFORMAT_F5_HEIGHT_SHIFT 20 -#define R200_TXFORMAT_ST_ROUTE_STQ0 (0 << 24) -#define R200_TXFORMAT_ST_ROUTE_STQ1 (1 << 24) -#define R200_TXFORMAT_ST_ROUTE_STQ2 (2 << 24) -#define R200_TXFORMAT_ST_ROUTE_STQ3 (3 << 24) -#define R200_TXFORMAT_ST_ROUTE_STQ4 (4 << 24) -#define R200_TXFORMAT_ST_ROUTE_STQ5 (5 << 24) -#define R200_TXFORMAT_ST_ROUTE_MASK (7 << 24) -#define R200_TXFORMAT_ST_ROUTE_SHIFT 24 -#define R200_TXFORMAT_ALPHA_MASK_ENABLE (1 << 28) -#define R200_TXFORMAT_CHROMA_KEY_ENABLE (1 << 29) -#define R200_TXFORMAT_CUBIC_MAP_ENABLE (1 << 30) -#define R200_PP_TXFORMAT_X_0 0x2c08 -#define R200_DEPTH_LOG2_MASK (0xf << 0) -#define R200_DEPTH_LOG2_SHIFT 0 -#define R200_VOLUME_FILTER_SHIFT 4 -#define R200_VOLUME_FILTER_MASK (1 << 4) -#define R200_VOLUME_FILTER_NEAREST (0 << 4) -#define R200_VOLUME_FILTER_LINEAR (1 << 4) -#define R200_WRAPEN_Q (1 << 8) -#define R200_CLAMP_Q_WRAP (0 << 9) -#define R200_CLAMP_Q_MIRROR (1 << 9) -#define R200_CLAMP_Q_CLAMP_LAST (2 << 9) -#define R200_CLAMP_Q_MIRROR_CLAMP_LAST (3 << 9) -#define R200_CLAMP_Q_CLAMP_BORDER (4 << 9) -#define R200_CLAMP_Q_MIRROR_CLAMP_BORDER (5 << 9) -#define R200_CLAMP_Q_CLAMP_GL (6 << 9) -#define R200_CLAMP_Q_MIRROR_CLAMP_GL (7 << 9) -#define R200_CLAMP_Q_MASK (7 << 9) -#define R200_MIN_MIP_LEVEL_MASK (0xff << 12) -#define R200_MIN_MIP_LEVEL_SHIFT 12 -#define R200_TEXCOORD_NONPROJ (0 << 16) -#define R200_TEXCOORD_CUBIC_ENV (1 << 16) -#define R200_TEXCOORD_VOLUME (2 << 16) -#define R200_TEXCOORD_PROJ (3 << 16) -#define R200_TEXCOORD_DEPTH (4 << 16) -#define R200_TEXCOORD_1D_PROJ (5 << 16) -#define R200_TEXCOORD_1D (6 << 16) -#define R200_TEXCOORD_ZERO (7 << 16) -#define R200_TEXCOORD_MASK (7 << 16) -#define R200_LOD_BIAS_MASK (0xfff80000) -#define R200_LOD_BIAS_SHIFT 19 -#define R200_PP_TXSIZE_0 0x2c0c /* NPOT only */ -#define R200_PP_TXPITCH_0 0x2c10 /* NPOT only */ -#define R200_PP_BORDER_COLOR_0 0x2c14 -#define R200_PP_CUBIC_FACES_0 0x2c18 -#define R200_FACE_WIDTH_1_SHIFT 0 -#define R200_FACE_HEIGHT_1_SHIFT 4 -#define R200_FACE_WIDTH_1_MASK (0xf << 0) -#define R200_FACE_HEIGHT_1_MASK (0xf << 4) -#define R200_FACE_WIDTH_2_SHIFT 8 -#define R200_FACE_HEIGHT_2_SHIFT 12 -#define R200_FACE_WIDTH_2_MASK (0xf << 8) -#define R200_FACE_HEIGHT_2_MASK (0xf << 12) -#define R200_FACE_WIDTH_3_SHIFT 16 -#define R200_FACE_HEIGHT_3_SHIFT 20 -#define R200_FACE_WIDTH_3_MASK (0xf << 16) -#define R200_FACE_HEIGHT_3_MASK (0xf << 20) -#define R200_FACE_WIDTH_4_SHIFT 24 -#define R200_FACE_HEIGHT_4_SHIFT 28 -#define R200_FACE_WIDTH_4_MASK (0xf << 24) -#define R200_FACE_HEIGHT_4_MASK (0xf << 28) -#define R200_PP_TXFILTER_1 0x2c20 -#define R200_PP_TXFORMAT_1 0x2c24 -#define R200_PP_TXFORMAT_X_1 0x2c28 -#define R200_PP_TXSIZE_1 0x2c2c -#define R200_PP_TXPITCH_1 0x2c30 -#define R200_PP_BORDER_COLOR_1 0x2c34 -#define R200_PP_CUBIC_FACES_1 0x2c38 -#define R200_PP_TXFILTER_2 0x2c40 -#define R200_PP_TXFORMAT_2 0x2c44 -#define R200_PP_TXSIZE_2 0x2c4c -#define R200_PP_TXFORMAT_X_2 0x2c48 -#define R200_PP_TXPITCH_2 0x2c50 -#define R200_PP_BORDER_COLOR_2 0x2c54 -#define R200_PP_CUBIC_FACES_2 0x2c58 -#define R200_PP_TXFILTER_3 0x2c60 -#define R200_PP_TXFORMAT_3 0x2c64 -#define R200_PP_TXSIZE_3 0x2c6c -#define R200_PP_TXFORMAT_X_3 0x2c68 -#define R200_PP_TXPITCH_3 0x2c70 -#define R200_PP_BORDER_COLOR_3 0x2c74 -#define R200_PP_CUBIC_FACES_3 0x2c78 -#define R200_PP_TXFILTER_4 0x2c80 -#define R200_PP_TXFORMAT_4 0x2c84 -#define R200_PP_TXSIZE_4 0x2c8c -#define R200_PP_TXFORMAT_X_4 0x2c88 -#define R200_PP_TXPITCH_4 0x2c90 -#define R200_PP_BORDER_COLOR_4 0x2c94 -#define R200_PP_CUBIC_FACES_4 0x2c98 -#define R200_PP_TXFILTER_5 0x2ca0 -#define R200_PP_TXFORMAT_5 0x2ca4 -#define R200_PP_TXSIZE_5 0x2cac -#define R200_PP_TXFORMAT_X_5 0x2ca8 -#define R200_PP_TXPITCH_5 0x2cb0 -#define R200_PP_BORDER_COLOR_5 0x2cb4 -#define R200_PP_CUBIC_FACES_5 0x2cb8 -/* gap */ -#define R200_PP_CNTL_X 0x2cc4 -/* gap */ -#define R200_PP_TXOFFSET_0 0x2d00 -#define R200_TXO_ENDIAN_NO_SWAP (0 << 0) -#define R200_TXO_ENDIAN_BYTE_SWAP (1 << 0) -#define R200_TXO_ENDIAN_WORD_SWAP (2 << 0) -#define R200_TXO_ENDIAN_HALFDW_SWAP (3 << 0) -#define R200_TXO_OFFSET_MASK 0xffffffe0 -#define R200_TXO_OFFSET_SHIFT 5 -#define R200_PP_CUBIC_OFFSET_F1_0 0x2d04 -#define R200_PP_CUBIC_OFFSET_F2_0 0x2d08 -#define R200_PP_CUBIC_OFFSET_F3_0 0x2d0c -#define R200_PP_CUBIC_OFFSET_F4_0 0x2d10 -#define R200_PP_CUBIC_OFFSET_F5_0 0x2d14 -#define R200_PP_TXOFFSET_1 0x2d18 -#define R200_PP_CUBIC_OFFSET_F1_1 0x2d1c -#define R200_PP_CUBIC_OFFSET_F2_1 0x2d20 -#define R200_PP_CUBIC_OFFSET_F3_1 0x2d24 -#define R200_PP_CUBIC_OFFSET_F4_1 0x2d28 -#define R200_PP_CUBIC_OFFSET_F5_1 0x2d2c -#define R200_PP_TXOFFSET_2 0x2d30 -#define R200_PP_CUBIC_OFFSET_F1_2 0x2d34 -#define R200_PP_CUBIC_OFFSET_F2_2 0x2d38 -#define R200_PP_CUBIC_OFFSET_F3_2 0x2d3c -#define R200_PP_CUBIC_OFFSET_F4_2 0x2d40 -#define R200_PP_CUBIC_OFFSET_F5_2 0x2d44 -#define R200_PP_TXOFFSET_3 0x2d48 -#define R200_PP_CUBIC_OFFSET_F1_3 0x2d4c -#define R200_PP_CUBIC_OFFSET_F2_3 0x2d50 -#define R200_PP_CUBIC_OFFSET_F3_3 0x2d54 -#define R200_PP_CUBIC_OFFSET_F4_3 0x2d58 -#define R200_PP_CUBIC_OFFSET_F5_3 0x2d5c -#define R200_PP_TXOFFSET_4 0x2d60 -#define R200_PP_CUBIC_OFFSET_F1_4 0x2d64 -#define R200_PP_CUBIC_OFFSET_F2_4 0x2d68 -#define R200_PP_CUBIC_OFFSET_F3_4 0x2d6c -#define R200_PP_CUBIC_OFFSET_F4_4 0x2d70 -#define R200_PP_CUBIC_OFFSET_F5_4 0x2d74 -#define R200_PP_TXOFFSET_5 0x2d78 -#define R200_PP_CUBIC_OFFSET_F1_5 0x2d7c -#define R200_PP_CUBIC_OFFSET_F2_5 0x2d80 -#define R200_PP_CUBIC_OFFSET_F3_5 0x2d84 -#define R200_PP_CUBIC_OFFSET_F4_5 0x2d88 -#define R200_PP_CUBIC_OFFSET_F5_5 0x2d8c -/* gap */ -#define R200_PP_TAM_DEBUG3 0x2d9c -/* gap */ -#define R200_PP_TFACTOR_0 0x2ee0 -#define R200_PP_TFACTOR_1 0x2ee4 -#define R200_PP_TFACTOR_2 0x2ee8 -#define R200_PP_TFACTOR_3 0x2eec -#define R200_PP_TFACTOR_4 0x2ef0 -#define R200_PP_TFACTOR_5 0x2ef4 -/* gap */ -#define R200_PP_TXCBLEND_0 0x2f00 -#define R200_TXC_ARG_A_ZERO (0) -#define R200_TXC_ARG_A_CURRENT_COLOR (2) -#define R200_TXC_ARG_A_CURRENT_ALPHA (3) -#define R200_TXC_ARG_A_DIFFUSE_COLOR (4) -#define R200_TXC_ARG_A_DIFFUSE_ALPHA (5) -#define R200_TXC_ARG_A_SPECULAR_COLOR (6) -#define R200_TXC_ARG_A_SPECULAR_ALPHA (7) -#define R200_TXC_ARG_A_TFACTOR_COLOR (8) -#define R200_TXC_ARG_A_TFACTOR_ALPHA (9) -#define R200_TXC_ARG_A_R0_COLOR (10) -#define R200_TXC_ARG_A_R0_ALPHA (11) -#define R200_TXC_ARG_A_R1_COLOR (12) -#define R200_TXC_ARG_A_R1_ALPHA (13) -#define R200_TXC_ARG_A_R2_COLOR (14) -#define R200_TXC_ARG_A_R2_ALPHA (15) -#define R200_TXC_ARG_A_R3_COLOR (16) -#define R200_TXC_ARG_A_R3_ALPHA (17) -#define R200_TXC_ARG_A_R4_COLOR (18) -#define R200_TXC_ARG_A_R4_ALPHA (19) -#define R200_TXC_ARG_A_R5_COLOR (20) -#define R200_TXC_ARG_A_R5_ALPHA (21) -#define R200_TXC_ARG_A_TFACTOR1_COLOR (26) -#define R200_TXC_ARG_A_TFACTOR1_ALPHA (27) -#define R200_TXC_ARG_A_MASK (31 << 0) -#define R200_TXC_ARG_A_SHIFT 0 -#define R200_TXC_ARG_B_ZERO (0<<5) -#define R200_TXC_ARG_B_CURRENT_COLOR (2<<5) -#define R200_TXC_ARG_B_CURRENT_ALPHA (3<<5) -#define R200_TXC_ARG_B_DIFFUSE_COLOR (4<<5) -#define R200_TXC_ARG_B_DIFFUSE_ALPHA (5<<5) -#define R200_TXC_ARG_B_SPECULAR_COLOR (6<<5) -#define R200_TXC_ARG_B_SPECULAR_ALPHA (7<<5) -#define R200_TXC_ARG_B_TFACTOR_COLOR (8<<5) -#define R200_TXC_ARG_B_TFACTOR_ALPHA (9<<5) -#define R200_TXC_ARG_B_R0_COLOR (10<<5) -#define R200_TXC_ARG_B_R0_ALPHA (11<<5) -#define R200_TXC_ARG_B_R1_COLOR (12<<5) -#define R200_TXC_ARG_B_R1_ALPHA (13<<5) -#define R200_TXC_ARG_B_R2_COLOR (14<<5) -#define R200_TXC_ARG_B_R2_ALPHA (15<<5) -#define R200_TXC_ARG_B_R3_COLOR (16<<5) -#define R200_TXC_ARG_B_R3_ALPHA (17<<5) -#define R200_TXC_ARG_B_R4_COLOR (18<<5) -#define R200_TXC_ARG_B_R4_ALPHA (19<<5) -#define R200_TXC_ARG_B_R5_COLOR (20<<5) -#define R200_TXC_ARG_B_R5_ALPHA (21<<5) -#define R200_TXC_ARG_B_TFACTOR1_COLOR (26<<5) -#define R200_TXC_ARG_B_TFACTOR1_ALPHA (27<<5) -#define R200_TXC_ARG_B_MASK (31 << 5) -#define R200_TXC_ARG_B_SHIFT 5 -#define R200_TXC_ARG_C_ZERO (0<<10) -#define R200_TXC_ARG_C_CURRENT_COLOR (2<<10) -#define R200_TXC_ARG_C_CURRENT_ALPHA (3<<10) -#define R200_TXC_ARG_C_DIFFUSE_COLOR (4<<10) -#define R200_TXC_ARG_C_DIFFUSE_ALPHA (5<<10) -#define R200_TXC_ARG_C_SPECULAR_COLOR (6<<10) -#define R200_TXC_ARG_C_SPECULAR_ALPHA (7<<10) -#define R200_TXC_ARG_C_TFACTOR_COLOR (8<<10) -#define R200_TXC_ARG_C_TFACTOR_ALPHA (9<<10) -#define R200_TXC_ARG_C_R0_COLOR (10<<10) -#define R200_TXC_ARG_C_R0_ALPHA (11<<10) -#define R200_TXC_ARG_C_R1_COLOR (12<<10) -#define R200_TXC_ARG_C_R1_ALPHA (13<<10) -#define R200_TXC_ARG_C_R2_COLOR (14<<10) -#define R200_TXC_ARG_C_R2_ALPHA (15<<10) -#define R200_TXC_ARG_C_R3_COLOR (16<<10) -#define R200_TXC_ARG_C_R3_ALPHA (17<<10) -#define R200_TXC_ARG_C_R4_COLOR (18<<10) -#define R200_TXC_ARG_C_R4_ALPHA (19<<10) -#define R200_TXC_ARG_C_R5_COLOR (20<<10) -#define R200_TXC_ARG_C_R5_ALPHA (21<<10) -#define R200_TXC_ARG_C_TFACTOR1_COLOR (26<<10) -#define R200_TXC_ARG_C_TFACTOR1_ALPHA (27<<10) -#define R200_TXC_ARG_C_MASK (31 << 10) -#define R200_TXC_ARG_C_SHIFT 10 -#define R200_TXC_COMP_ARG_A (1 << 16) -#define R200_TXC_COMP_ARG_A_SHIFT (16) -#define R200_TXC_BIAS_ARG_A (1 << 17) -#define R200_TXC_SCALE_ARG_A (1 << 18) -#define R200_TXC_NEG_ARG_A (1 << 19) -#define R200_TXC_COMP_ARG_B (1 << 20) -#define R200_TXC_COMP_ARG_B_SHIFT (20) -#define R200_TXC_BIAS_ARG_B (1 << 21) -#define R200_TXC_SCALE_ARG_B (1 << 22) -#define R200_TXC_NEG_ARG_B (1 << 23) -#define R200_TXC_COMP_ARG_C (1 << 24) -#define R200_TXC_COMP_ARG_C_SHIFT (24) -#define R200_TXC_BIAS_ARG_C (1 << 25) -#define R200_TXC_SCALE_ARG_C (1 << 26) -#define R200_TXC_NEG_ARG_C (1 << 27) -#define R200_TXC_OP_MADD (0 << 28) -#define R200_TXC_OP_CND0 (2 << 28) -#define R200_TXC_OP_LERP (3 << 28) -#define R200_TXC_OP_DOT3 (4 << 28) -#define R200_TXC_OP_DOT4 (5 << 28) -#define R200_TXC_OP_CONDITIONAL (6 << 28) -#define R200_TXC_OP_DOT2_ADD (7 << 28) -#define R200_TXC_OP_MASK (7 << 28) -#define R200_PP_TXCBLEND2_0 0x2f04 -#define R200_TXC_TFACTOR_SEL_SHIFT 0 -#define R200_TXC_TFACTOR_SEL_MASK 0x7 -#define R200_TXC_TFACTOR1_SEL_SHIFT 4 -#define R200_TXC_TFACTOR1_SEL_MASK (0x7 << 4) -#define R200_TXC_SCALE_SHIFT 8 -#define R200_TXC_SCALE_MASK (7 << 8) -#define R200_TXC_SCALE_1X (0 << 8) -#define R200_TXC_SCALE_2X (1 << 8) -#define R200_TXC_SCALE_4X (2 << 8) -#define R200_TXC_SCALE_8X (3 << 8) -#define R200_TXC_SCALE_INV2 (5 << 8) -#define R200_TXC_SCALE_INV4 (6 << 8) -#define R200_TXC_SCALE_INV8 (7 << 8) -#define R200_TXC_CLAMP_SHIFT 12 -#define R200_TXC_CLAMP_MASK (3 << 12) -#define R200_TXC_CLAMP_WRAP (0 << 12) -#define R200_TXC_CLAMP_0_1 (1 << 12) -#define R200_TXC_CLAMP_8_8 (2 << 12) -#define R200_TXC_OUTPUT_REG_MASK (7 << 16) -#define R200_TXC_OUTPUT_REG_NONE (0 << 16) -#define R200_TXC_OUTPUT_REG_R0 (1 << 16) -#define R200_TXC_OUTPUT_REG_R1 (2 << 16) -#define R200_TXC_OUTPUT_REG_R2 (3 << 16) -#define R200_TXC_OUTPUT_REG_R3 (4 << 16) -#define R200_TXC_OUTPUT_REG_R4 (5 << 16) -#define R200_TXC_OUTPUT_REG_R5 (6 << 16) -#define R200_TXC_OUTPUT_MASK_MASK (7 << 20) -#define R200_TXC_OUTPUT_MASK_RGB (0 << 20) -#define R200_TXC_OUTPUT_MASK_RG (1 << 20) -#define R200_TXC_OUTPUT_MASK_RB (2 << 20) -#define R200_TXC_OUTPUT_MASK_R (3 << 20) -#define R200_TXC_OUTPUT_MASK_GB (4 << 20) -#define R200_TXC_OUTPUT_MASK_G (5 << 20) -#define R200_TXC_OUTPUT_MASK_B (6 << 20) -#define R200_TXC_OUTPUT_MASK_NONE (7 << 20) -#define R200_TXC_REPL_NORMAL 0 -#define R200_TXC_REPL_RED 1 -#define R200_TXC_REPL_GREEN 2 -#define R200_TXC_REPL_BLUE 3 -#define R200_TXC_REPL_ARG_A_SHIFT 26 -#define R200_TXC_REPL_ARG_A_MASK (3 << 26) -#define R200_TXC_REPL_ARG_B_SHIFT 28 -#define R200_TXC_REPL_ARG_B_MASK (3 << 28) -#define R200_TXC_REPL_ARG_C_SHIFT 30 -#define R200_TXC_REPL_ARG_C_MASK (3 << 30) -#define R200_PP_TXABLEND_0 0x2f08 -#define R200_TXA_ARG_A_ZERO (0) -#define R200_TXA_ARG_A_CURRENT_ALPHA (2) /* guess */ -#define R200_TXA_ARG_A_CURRENT_BLUE (3) /* guess */ -#define R200_TXA_ARG_A_DIFFUSE_ALPHA (4) -#define R200_TXA_ARG_A_DIFFUSE_BLUE (5) -#define R200_TXA_ARG_A_SPECULAR_ALPHA (6) -#define R200_TXA_ARG_A_SPECULAR_BLUE (7) -#define R200_TXA_ARG_A_TFACTOR_ALPHA (8) -#define R200_TXA_ARG_A_TFACTOR_BLUE (9) -#define R200_TXA_ARG_A_R0_ALPHA (10) -#define R200_TXA_ARG_A_R0_BLUE (11) -#define R200_TXA_ARG_A_R1_ALPHA (12) -#define R200_TXA_ARG_A_R1_BLUE (13) -#define R200_TXA_ARG_A_R2_ALPHA (14) -#define R200_TXA_ARG_A_R2_BLUE (15) -#define R200_TXA_ARG_A_R3_ALPHA (16) -#define R200_TXA_ARG_A_R3_BLUE (17) -#define R200_TXA_ARG_A_R4_ALPHA (18) -#define R200_TXA_ARG_A_R4_BLUE (19) -#define R200_TXA_ARG_A_R5_ALPHA (20) -#define R200_TXA_ARG_A_R5_BLUE (21) -#define R200_TXA_ARG_A_TFACTOR1_ALPHA (26) -#define R200_TXA_ARG_A_TFACTOR1_BLUE (27) -#define R200_TXA_ARG_A_MASK (31 << 0) -#define R200_TXA_ARG_A_SHIFT 0 -#define R200_TXA_ARG_B_ZERO (0<<5) -#define R200_TXA_ARG_B_CURRENT_ALPHA (2<<5) /* guess */ -#define R200_TXA_ARG_B_CURRENT_BLUE (3<<5) /* guess */ -#define R200_TXA_ARG_B_DIFFUSE_ALPHA (4<<5) -#define R200_TXA_ARG_B_DIFFUSE_BLUE (5<<5) -#define R200_TXA_ARG_B_SPECULAR_ALPHA (6<<5) -#define R200_TXA_ARG_B_SPECULAR_BLUE (7<<5) -#define R200_TXA_ARG_B_TFACTOR_ALPHA (8<<5) -#define R200_TXA_ARG_B_TFACTOR_BLUE (9<<5) -#define R200_TXA_ARG_B_R0_ALPHA (10<<5) -#define R200_TXA_ARG_B_R0_BLUE (11<<5) -#define R200_TXA_ARG_B_R1_ALPHA (12<<5) -#define R200_TXA_ARG_B_R1_BLUE (13<<5) -#define R200_TXA_ARG_B_R2_ALPHA (14<<5) -#define R200_TXA_ARG_B_R2_BLUE (15<<5) -#define R200_TXA_ARG_B_R3_ALPHA (16<<5) -#define R200_TXA_ARG_B_R3_BLUE (17<<5) -#define R200_TXA_ARG_B_R4_ALPHA (18<<5) -#define R200_TXA_ARG_B_R4_BLUE (19<<5) -#define R200_TXA_ARG_B_R5_ALPHA (20<<5) -#define R200_TXA_ARG_B_R5_BLUE (21<<5) -#define R200_TXA_ARG_B_TFACTOR1_ALPHA (26<<5) -#define R200_TXA_ARG_B_TFACTOR1_BLUE (27<<5) -#define R200_TXA_ARG_B_MASK (31 << 5) -#define R200_TXA_ARG_B_SHIFT 5 -#define R200_TXA_ARG_C_ZERO (0<<10) -#define R200_TXA_ARG_C_CURRENT_ALPHA (2<<10) /* guess */ -#define R200_TXA_ARG_C_CURRENT_BLUE (3<<10) /* guess */ -#define R200_TXA_ARG_C_DIFFUSE_ALPHA (4<<10) -#define R200_TXA_ARG_C_DIFFUSE_BLUE (5<<10) -#define R200_TXA_ARG_C_SPECULAR_ALPHA (6<<10) -#define R200_TXA_ARG_C_SPECULAR_BLUE (7<<10) -#define R200_TXA_ARG_C_TFACTOR_ALPHA (8<<10) -#define R200_TXA_ARG_C_TFACTOR_BLUE (9<<10) -#define R200_TXA_ARG_C_R0_ALPHA (10<<10) -#define R200_TXA_ARG_C_R0_BLUE (11<<10) -#define R200_TXA_ARG_C_R1_ALPHA (12<<10) -#define R200_TXA_ARG_C_R1_BLUE (13<<10) -#define R200_TXA_ARG_C_R2_ALPHA (14<<10) -#define R200_TXA_ARG_C_R2_BLUE (15<<10) -#define R200_TXA_ARG_C_R3_ALPHA (16<<10) -#define R200_TXA_ARG_C_R3_BLUE (17<<10) -#define R200_TXA_ARG_C_R4_ALPHA (18<<10) -#define R200_TXA_ARG_C_R4_BLUE (19<<10) -#define R200_TXA_ARG_C_R5_ALPHA (20<<10) -#define R200_TXA_ARG_C_R5_BLUE (21<<10) -#define R200_TXA_ARG_C_TFACTOR1_ALPHA (26<<10) -#define R200_TXA_ARG_C_TFACTOR1_BLUE (27<<10) -#define R200_TXA_ARG_C_MASK (31 << 10) -#define R200_TXA_ARG_C_SHIFT 10 -#define R200_TXA_COMP_ARG_A (1 << 16) -#define R200_TXA_COMP_ARG_A_SHIFT (16) -#define R200_TXA_BIAS_ARG_A (1 << 17) -#define R200_TXA_SCALE_ARG_A (1 << 18) -#define R200_TXA_NEG_ARG_A (1 << 19) -#define R200_TXA_COMP_ARG_B (1 << 20) -#define R200_TXA_COMP_ARG_B_SHIFT (20) -#define R200_TXA_BIAS_ARG_B (1 << 21) -#define R200_TXA_SCALE_ARG_B (1 << 22) -#define R200_TXA_NEG_ARG_B (1 << 23) -#define R200_TXA_COMP_ARG_C (1 << 24) -#define R200_TXA_COMP_ARG_C_SHIFT (24) -#define R200_TXA_BIAS_ARG_C (1 << 25) -#define R200_TXA_SCALE_ARG_C (1 << 26) -#define R200_TXA_NEG_ARG_C (1 << 27) -#define R200_TXA_OP_MADD (0 << 28) -#define R200_TXA_OP_CND0 (2 << 28) -#define R200_TXA_OP_LERP (3 << 28) -#define R200_TXA_OP_CONDITIONAL (6 << 28) -#define R200_TXA_OP_MASK (7 << 28) -#define R200_PP_TXABLEND2_0 0x2f0c -#define R200_TXA_TFACTOR_SEL_SHIFT 0 -#define R200_TXA_TFACTOR_SEL_MASK 0x7 -#define R200_TXA_TFACTOR1_SEL_SHIFT 4 -#define R200_TXA_TFACTOR1_SEL_MASK (0x7 << 4) -#define R200_TXA_SCALE_SHIFT 8 -#define R200_TXA_SCALE_MASK (7 << 8) -#define R200_TXA_SCALE_1X (0 << 8) -#define R200_TXA_SCALE_2X (1 << 8) -#define R200_TXA_SCALE_4X (2 << 8) -#define R200_TXA_SCALE_8X (3 << 8) -#define R200_TXA_SCALE_INV2 (5 << 8) -#define R200_TXA_SCALE_INV4 (6 << 8) -#define R200_TXA_SCALE_INV8 (7 << 8) -#define R200_TXA_CLAMP_SHIFT 12 -#define R200_TXA_CLAMP_MASK (3 << 12) -#define R200_TXA_CLAMP_WRAP (0 << 12) -#define R200_TXA_CLAMP_0_1 (1 << 12) -#define R200_TXA_CLAMP_8_8 (2 << 12) -#define R200_TXA_OUTPUT_REG_MASK (7 << 16) -#define R200_TXA_OUTPUT_REG_NONE (0 << 16) -#define R200_TXA_OUTPUT_REG_R0 (1 << 16) -#define R200_TXA_OUTPUT_REG_R1 (2 << 16) -#define R200_TXA_OUTPUT_REG_R2 (3 << 16) -#define R200_TXA_OUTPUT_REG_R3 (4 << 16) -#define R200_TXA_OUTPUT_REG_R4 (5 << 16) -#define R200_TXA_OUTPUT_REG_R5 (6 << 16) -#define R200_TXA_DOT_ALPHA (1 << 20) -#define R200_TXA_REPL_NORMAL 0 -#define R200_TXA_REPL_RED 1 -#define R200_TXA_REPL_GREEN 2 -#define R200_TXA_REPL_ARG_A_SHIFT 26 -#define R200_TXA_REPL_ARG_A_MASK (3 << 26) -#define R200_TXA_REPL_ARG_B_SHIFT 28 -#define R200_TXA_REPL_ARG_B_MASK (3 << 28) -#define R200_TXA_REPL_ARG_C_SHIFT 30 -#define R200_TXA_REPL_ARG_C_MASK (3 << 30) -#define R200_PP_TXCBLEND_1 0x2f10 -#define R200_PP_TXCBLEND2_1 0x2f14 -#define R200_PP_TXABLEND_1 0x2f18 -#define R200_PP_TXABLEND2_1 0x2f1c -#define R200_PP_TXCBLEND_2 0x2f20 -#define R200_PP_TXCBLEND2_2 0x2f24 -#define R200_PP_TXABLEND_2 0x2f28 -#define R200_PP_TXABLEND2_2 0x2f2c -#define R200_PP_TXCBLEND_3 0x2f30 -#define R200_PP_TXCBLEND2_3 0x2f34 -#define R200_PP_TXABLEND_3 0x2f38 -#define R200_PP_TXABLEND2_3 0x2f3c -#define R200_PP_TXCBLEND_4 0x2f40 -#define R200_PP_TXCBLEND2_4 0x2f44 -#define R200_PP_TXABLEND_4 0x2f48 -#define R200_PP_TXABLEND2_4 0x2f4c -#define R200_PP_TXCBLEND_5 0x2f50 -#define R200_PP_TXCBLEND2_5 0x2f54 -#define R200_PP_TXABLEND_5 0x2f58 -#define R200_PP_TXABLEND2_5 0x2f5c -#define R200_PP_TXCBLEND_6 0x2f60 -#define R200_PP_TXCBLEND2_6 0x2f64 -#define R200_PP_TXABLEND_6 0x2f68 -#define R200_PP_TXABLEND2_6 0x2f6c -#define R200_PP_TXCBLEND_7 0x2f70 -#define R200_PP_TXCBLEND2_7 0x2f74 -#define R200_PP_TXABLEND_7 0x2f78 -#define R200_PP_TXABLEND2_7 0x2f7c -/* gap */ -#define R200_RB3D_BLENDCOLOR 0x3218 /* ARGB 8888 */ -#define R200_RB3D_ABLENDCNTL 0x321C /* see BLENDCTL */ -#define R200_RB3D_CBLENDCNTL 0x3220 /* see BLENDCTL */ - -/* - * Offsets in TCL vector state. NOTE: Hardwiring matrix positions. - * Multiple contexts could collaberate to eliminate state bouncing. - */ -#define R200_VS_LIGHT_AMBIENT_ADDR 0x00000028 -#define R200_VS_LIGHT_DIFFUSE_ADDR 0x00000030 -#define R200_VS_LIGHT_SPECULAR_ADDR 0x00000038 -#define R200_VS_LIGHT_DIRPOS_ADDR 0x00000040 -#define R200_VS_LIGHT_HWVSPOT_ADDR 0x00000048 -#define R200_VS_LIGHT_ATTENUATION_ADDR 0x00000050 -#define R200_VS_SPOT_DUAL_CONE 0x00000058 -#define R200_VS_GLOBAL_AMBIENT_ADDR 0x0000005C -#define R200_VS_FOG_PARAM_ADDR 0x0000005D -#define R200_VS_EYE_VECTOR_ADDR 0x0000005E -#define R200_VS_UCP_ADDR 0x00000060 -#define R200_VS_PNT_SPRITE_VPORT_SCALE 0x00000068 -#define R200_VS_MATRIX_0_MV 0x00000080 -#define R200_VS_MATRIX_1_INV_MV 0x00000084 -#define R200_VS_MATRIX_2_MVP 0x00000088 -#define R200_VS_MATRIX_3_TEX0 0x0000008C -#define R200_VS_MATRIX_4_TEX1 0x00000090 -#define R200_VS_MATRIX_5_TEX2 0x00000094 -#define R200_VS_MATRIX_6_TEX3 0x00000098 -#define R200_VS_MATRIX_7_TEX4 0x0000009C -#define R200_VS_MATRIX_8_TEX5 0x000000A0 -#define R200_VS_MAT_0_EMISS 0x000000B0 -#define R200_VS_MAT_0_AMB 0x000000B1 -#define R200_VS_MAT_0_DIF 0x000000B2 -#define R200_VS_MAT_0_SPEC 0x000000B3 -#define R200_VS_MAT_1_EMISS 0x000000B4 -#define R200_VS_MAT_1_AMB 0x000000B5 -#define R200_VS_MAT_1_DIF 0x000000B6 -#define R200_VS_MAT_1_SPEC 0x000000B7 -#define R200_VS_EYE2CLIP_MTX 0x000000B8 -#define R200_VS_PNT_SPRITE_ATT_CONST 0x000000BC -#define R200_VS_PNT_SPRITE_EYE_IN_MODEL 0x000000BD -#define R200_VS_PNT_SPRITE_CLAMP 0x000000BE -#define R200_VS_MAX 0x000001C0 - -/* - * Offsets in TCL scalar state - */ -#define R200_SS_LIGHT_DCD_ADDR 0x00000000 -#define R200_SS_LIGHT_DCM_ADDR 0x00000008 -#define R200_SS_LIGHT_SPOT_EXPONENT_ADDR 0x00000010 -#define R200_SS_LIGHT_SPOT_CUTOFF_ADDR 0x00000018 -#define R200_SS_LIGHT_SPECULAR_THRESH_ADDR 0x00000020 -#define R200_SS_LIGHT_RANGE_CUTOFF_SQRD 0x00000028 -#define R200_SS_LIGHT_RANGE_ATT_CONST 0x00000030 -#define R200_SS_VERT_GUARD_CLIP_ADJ_ADDR 0x00000080 -#define R200_SS_VERT_GUARD_DISCARD_ADJ_ADDR 0x00000081 -#define R200_SS_HORZ_GUARD_CLIP_ADJ_ADDR 0x00000082 -#define R200_SS_HORZ_GUARD_DISCARD_ADJ_ADDR 0x00000083 -#define R200_SS_MAT_0_SHININESS 0x00000100 -#define R200_SS_MAT_1_SHININESS 0x00000101 - -/* - * Matrix indices - */ -#define R200_MTX_MV 0 -#define R200_MTX_IMV 1 -#define R200_MTX_MVP 2 -#define R200_MTX_TEX0 3 -#define R200_MTX_TEX1 4 -#define R200_MTX_TEX2 5 -#define R200_MTX_TEX3 6 -#define R200_MTX_TEX4 7 -#define R200_MTX_TEX5 8 - -/* Color formats for 2d packets - */ -#define R200_CP_COLOR_FORMAT_CI8 2 -#define R200_CP_COLOR_FORMAT_ARGB1555 3 -#define R200_CP_COLOR_FORMAT_RGB565 4 -#define R200_CP_COLOR_FORMAT_ARGB8888 6 -#define R200_CP_COLOR_FORMAT_RGB332 7 -#define R200_CP_COLOR_FORMAT_RGB8 9 -#define R200_CP_COLOR_FORMAT_ARGB4444 15 - -/* - * CP type-3 packets - */ -#define R200_CP_CMD_NOP 0xC0001000 -#define R200_CP_CMD_NEXT_CHAR 0xC0001900 -#define R200_CP_CMD_PLY_NEXTSCAN 0xC0001D00 -#define R200_CP_CMD_SET_SCISSORS 0xC0001E00 -#define R200_CP_CMD_LOAD_MICROCODE 0xC0002400 -#define R200_CP_CMD_WAIT_FOR_IDLE 0xC0002600 -#define R200_CP_CMD_3D_DRAW_VBUF 0xC0002800 -#define R200_CP_CMD_3D_DRAW_IMMD 0xC0002900 -#define R200_CP_CMD_3D_DRAW_INDX 0xC0002A00 -#define R200_CP_CMD_LOAD_PALETTE 0xC0002C00 -#define R200_CP_CMD_3D_LOAD_VBPNTR 0xC0002F00 -#define R200_CP_CMD_INDX_BUFFER 0xC0003300 -#define R200_CP_CMD_3D_DRAW_VBUF_2 0xC0003400 -#define R200_CP_CMD_3D_DRAW_IMMD_2 0xC0003500 -#define R200_CP_CMD_3D_DRAW_INDX_2 0xC0003600 -#define R200_CP_CMD_PAINT 0xC0009100 -#define R200_CP_CMD_BITBLT 0xC0009200 -#define R200_CP_CMD_SMALLTEXT 0xC0009300 -#define R200_CP_CMD_HOSTDATA_BLT 0xC0009400 -#define R200_CP_CMD_POLYLINE 0xC0009500 -#define R200_CP_CMD_POLYSCANLINES 0xC0009800 -#define R200_CP_CMD_PAINT_MULTI 0xC0009A00 -#define R200_CP_CMD_BITBLT_MULTI 0xC0009B00 -#define R200_CP_CMD_TRANS_BITBLT 0xC0009C00 - -#endif diff --git a/src/mesa/drivers/dri/r300/r200_state.h b/src/mesa/drivers/dri/r300/r200_state.h deleted file mode 100644 index 3e1a9c8ba19..00000000000 --- a/src/mesa/drivers/dri/r300/r200_state.h +++ /dev/null @@ -1,58 +0,0 @@ -/* -Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. - -The Weather Channel (TM) funded Tungsten Graphics to develop the -initial release of the Radeon 8500 driver under the XFree86 license. -This notice must be preserved. - -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 COPYRIGHT OWNER(S) 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: - * Keith Whitwell - */ - -#ifndef __R200_STATE_H__ -#define __R200_STATE_H__ - -#ifdef GLX_DIRECT_RENDERING - -#include "r200_context.h" - -extern void r200InitState(r200ContextPtr rmesa); -extern void r200InitStateFuncs(struct dd_function_table *functions); -extern void r200InitTnlFuncs(GLcontext * ctx); - -extern void r200UpdateMaterial(GLcontext * ctx); - -extern void r200UpdateViewportOffset(GLcontext * ctx); -extern void r200UpdateWindow(GLcontext * ctx); - -extern void r200ValidateState(GLcontext * ctx); - -extern void r200PrintDirty(r200ContextPtr rmesa, const char *msg); - -extern void r200LightingSpaceChange(GLcontext * ctx); - -#endif -#endif diff --git a/src/mesa/drivers/dri/r300/r300_fragprog.c b/src/mesa/drivers/dri/r300/r300_fragprog.c index 2d947dea3af..7793c5eb2e3 100644 --- a/src/mesa/drivers/dri/r300/r300_fragprog.c +++ b/src/mesa/drivers/dri/r300/r300_fragprog.c @@ -28,14 +28,14 @@ /* * Authors: * Ben Skeggs + * Jerome Glisse */ /*TODO'S * - * - COS/SIN/SCS/LIT instructions + * - COS/SIN/SCS instructions * - Depth write, WPOS/FOGC inputs * - FogOption - * - Negate on individual components (implement in swizzle code?) * - Verify results of opcodes for accuracy, I've only checked them * in specific cases. * - and more... @@ -82,7 +82,8 @@ static const struct { { "LG2", 1, R300_FPI0_OUTC_REPL_ALPHA, R300_FPI2_OUTA_LG2 }, { "RCP", 1, R300_FPI0_OUTC_REPL_ALPHA, R300_FPI2_OUTA_RCP }, { "RSQ", 1, R300_FPI0_OUTC_REPL_ALPHA, R300_FPI2_OUTA_RSQ }, - { "REPL_ALPHA", 1, R300_FPI0_OUTC_REPL_ALPHA, PFS_INVAL } + { "REPL_ALPHA", 1, R300_FPI0_OUTC_REPL_ALPHA, PFS_INVAL }, + { "CMPH", 3, R300_FPI0_OUTC_CMPH, PFS_INVAL }, }; #define MAKE_SWZ3(x, y, z) (MAKE_SWIZZLE4(SWIZZLE_##x, \ @@ -180,7 +181,7 @@ static const pfs_reg_t undef = { valid: GL_FALSE }; -/* constant zero source */ +/* constant one source */ static const pfs_reg_t pfs_one = { type: REG_TYPE_CONST, index: 0, @@ -189,7 +190,16 @@ static const pfs_reg_t pfs_one = { valid: GL_TRUE }; -/* constant one source */ +/* constant half source */ +static const pfs_reg_t pfs_half = { + type: REG_TYPE_CONST, + index: 0, + v_swz: SWIZZLE_HHH, + s_swz: SWIZZLE_HALF, + valid: GL_TRUE +}; + +/* constant zero source */ static const pfs_reg_t pfs_zero = { type: REG_TYPE_CONST, index: 0, @@ -319,7 +329,6 @@ static pfs_reg_t emit_param4fv(struct r300_fragment_program *rp, return r; } -#if 0 static pfs_reg_t emit_const4fv(struct r300_fragment_program *rp, GLfloat *cp) { pfs_reg_t r = undef; @@ -330,13 +339,11 @@ static pfs_reg_t emit_const4fv(struct r300_fragment_program *rp, GLfloat *cp) ERROR("Out of hw constants!\n"); return r; } - - COPY_4V(rp->constant[r.index], cp); + COPY_4V(rp->constant[r.index], cp); r.valid = GL_TRUE; return r; } -#endif static __inline pfs_reg_t negate(pfs_reg_t r) { @@ -496,9 +503,6 @@ static pfs_reg_t t_src(struct r300_fragment_program *rp, struct prog_src_register fpsrc) { pfs_reg_t r = undef; -#if 0 - pfs_reg_t n = undef; -#endif switch (fpsrc.File) { case PROGRAM_TEMPORARY: @@ -531,40 +535,6 @@ static pfs_reg_t t_src(struct r300_fragment_program *rp, /* no point swizzling ONE/ZERO/HALF constants... */ if (r.v_swz < SWIZZLE_111 || r.s_swz < SWIZZLE_ZERO) r = do_swizzle(rp, r, fpsrc.Swizzle, fpsrc.NegateBase); -#if 0 - /* WRONG! Need to be able to do individual component negation, - * should probably handle this in the swizzling code unless - * all components are negated, then we can do this natively */ - if ((fpsrc.NegateBase & 0xf) == 0xf) - r.negate = GL_TRUE; - - r.negate_s = (fpsrc.NegateBase >> 3) & 1; - - if ((fpsrc.NegateBase & 0x7) == 0x0) { - r.negate_v = 0; - } else if ((fpsrc.NegateBase & 0x7) == 0x7) { - r.negate_v = 1; - } else { - if (r.type != REG_TYPE_TEMP) { - n = get_temp_reg(rp); - emit_arith(rp, PFS_OP_MAD, n, 0x7 ^ fpsrc.NegateBase, - keep(r), pfs_one, pfs_zero, 0); - r.negate_v = 1; - emit_arith(rp, PFS_OP_MAD, n, - fpsrc.NegateBase & 0x7 | WRITEMASK_W, - r, pfs_one, pfs_zero, 0); - r.negate_v = 0; - r = n; - } else { - r.negate_v = 1; - emit_arith(rp, PFS_OP_MAD, r, - fpsrc.NegateBase & 0x7 | WRITEMASK_W, - r, pfs_one, pfs_zero, 0); - r.negate_v = 0; - } - } -#endif - return r; } @@ -573,6 +543,8 @@ static pfs_reg_t t_scalar_src(struct r300_fragment_program *rp, { struct prog_src_register src = fpsrc; int sc = GET_SWZ(fpsrc.Swizzle, 0); /* X */ + + printf("sc %d\n",sc); src.Swizzle = ((sc<<0)|(sc<<3)|(sc<<6)|(sc<<9)); @@ -773,13 +745,15 @@ static void emit_tex(struct r300_fragment_program *rp, cs->dest_in_node = 0; } - if (rp->cur_node == 0) rp->first_node_has_tex = 1; + if (rp->cur_node == 0) + rp->first_node_has_tex = 1; - rp->tex.inst[rp->tex.length++] = 0 - | (hwsrc << R300_FPITX_SRC_SHIFT) - | (hwdest << R300_FPITX_DST_SHIFT) - | (unit << R300_FPITX_IMAGE_SHIFT) - | (opcode << R300_FPITX_OPCODE_SHIFT); /* not entirely sure about this */ + rp->tex.inst[rp->tex.length++] = 0 + | (hwsrc << R300_FPITX_SRC_SHIFT) + | (hwdest << R300_FPITX_DST_SHIFT) + | (unit << R300_FPITX_IMAGE_SHIFT) + /* not entirely sure about this */ + | (opcode << R300_FPITX_OPCODE_SHIFT); cs->dest_in_node |= (1 << hwdest); if (coord.type != REG_TYPE_CONST) @@ -884,7 +858,7 @@ static void emit_arith(struct r300_fragment_program *rp, int op, vop = r300_fpop[op].v_op; sop = r300_fpop[op].s_op; - argc = r300_fpop[op].argc; + argc = r300_fpop[op].argc; if ((mask & WRITEMASK_XYZ) || vop == R300_FPI0_OUTC_DP3) emit_vop = GL_TRUE; @@ -1039,7 +1013,9 @@ static GLboolean parse_program(struct r300_fragment_program *rp) const struct prog_instruction *inst = mp->Base.Instructions; struct prog_instruction *fpi; pfs_reg_t src[3], dest, temp; + pfs_reg_t cnst; int flags, mask = 0; + GLfloat cnstv[4] = {0.0, 0.0, 0.0, 0.0}; if (!inst || inst[0].Opcode == OPCODE_END) { ERROR("empty program?\n"); @@ -1083,7 +1059,64 @@ static GLboolean parse_program(struct r300_fragment_program *rp) flags); break; case OPCODE_COS: - ERROR("COS not implemented\n"); + /* + * cos using taylor serie: + * cos(x) = 1 - x^2/2! + x^4/4! - x^6/6! + */ + temp = get_temp_reg(rp); + cnstv[0] = 0.5; + cnstv[1] = 0.041666667; + cnstv[2] = 0.001388889; + cnstv[4] = 0.0; + cnst = emit_const4fv(rp, cnstv); + src[0] = t_scalar_src(rp, fpi->SrcReg[0]); + + emit_arith(rp, PFS_OP_MAD, temp, + WRITEMASK_XYZ, + src[0], + src[0], + pfs_zero, + flags); + emit_arith(rp, PFS_OP_MAD, temp, + WRITEMASK_Y | WRITEMASK_Z, + temp, temp, + pfs_zero, + flags); + emit_arith(rp, PFS_OP_MAD, temp, + WRITEMASK_Z, + temp, + swizzle(temp, X, X, X, W), + pfs_zero, + flags); + emit_arith(rp, PFS_OP_MAD, temp, + WRITEMASK_XYZ, + temp, cnst, + pfs_zero, + flags); + emit_arith(rp, PFS_OP_MAD, temp, + WRITEMASK_X, + pfs_one, + pfs_one, + negate(temp), + flags); + emit_arith(rp, PFS_OP_MAD, temp, + WRITEMASK_X, + temp, + pfs_one, + swizzle(temp, Y, Y, Y, W), + flags); + emit_arith(rp, PFS_OP_MAD, temp, + WRITEMASK_X, + temp, + pfs_one, + negate(swizzle(temp, Z, Z, Z, W)), + flags); + emit_arith(rp, PFS_OP_MAD, dest, mask, + swizzle(temp, X, X, X, X), + pfs_one, + pfs_zero, + flags); + free_temp(rp, temp); break; case OPCODE_DP3: src[0] = t_src(rp, fpi->SrcReg[0]); @@ -1179,7 +1212,66 @@ static GLboolean parse_program(struct r300_fragment_program *rp) flags); break; case OPCODE_LIT: - ERROR("LIT not implemented\n"); + /* LIT + * if (s.x < 0) t.x = 0; else t.x = s.x; + * if (s.y < 0) t.y = 0; else t.y = s.y; + * if (s.w > 128.0) t.w = 128.0; else t.w = s.w; + * if (s.w < -128.0) t.w = -128.0; else t.w = s.w; + * r.x = 1.0 + * if (t.x > 0) r.y = pow(t.y, t.w); else r.y = 0; + * Also r.y = 0 if t.y < 0 + * For the t.x > 0 FGLRX use the CMPH opcode which + * change the compare to (t.x + 0.5) > 0.5 we may + * save one instruction by doing CMP -t.x + */ + cnstv[0] = cnstv[1] = cnstv[2] = cnstv[4] = 0.50001; + src[0] = t_src(rp, fpi->SrcReg[0]); + temp = get_temp_reg(rp); + cnst = emit_const4fv(rp, cnstv); + emit_arith(rp, PFS_OP_CMP, temp, + WRITEMASK_X | WRITEMASK_Y, + src[0], pfs_zero, src[0], flags); + emit_arith(rp, PFS_OP_MIN, temp, WRITEMASK_Z, + swizzle(keep(src[0]), W, W, W, W), + cnst, undef, flags); + emit_arith(rp, PFS_OP_LG2, temp, WRITEMASK_W, + swizzle(temp, Y, Y, Y, Y), + undef, undef, flags); + emit_arith(rp, PFS_OP_MAX, temp, WRITEMASK_Z, + temp, negate(cnst), undef, flags); + emit_arith(rp, PFS_OP_MAD, temp, WRITEMASK_W, + temp, swizzle(temp, Z, Z, Z, Z), + pfs_zero, flags); + emit_arith(rp, PFS_OP_EX2, temp, WRITEMASK_W, + temp, undef, undef, flags); + emit_arith(rp, PFS_OP_MAD, dest, WRITEMASK_Y, + swizzle(keep(temp), X, X, X, X), + pfs_one, pfs_zero, flags); +#if 0 + emit_arith(rp, PFS_OP_MAD, temp, WRITEMASK_X, + temp, pfs_one, pfs_half, flags); + emit_arith(rp, PFS_OP_CMPH, temp, WRITEMASK_Z, + swizzle(keep(temp), W, W, W, W), + pfs_zero, swizzle(keep(temp), X, X, X, X), + flags); +#else + emit_arith(rp, PFS_OP_CMP, temp, WRITEMASK_Z, + pfs_zero, + swizzle(keep(temp), W, W, W, W), + negate(swizzle(keep(temp), X, X, X, X)), + flags); +#endif + emit_arith(rp, PFS_OP_CMP, dest, WRITEMASK_Z, + pfs_zero, temp, + negate(swizzle(keep(temp), Y, Y, Y, Y)), + flags); + emit_arith(rp, PFS_OP_MAD, dest, + WRITEMASK_X | WRITEMASK_W, + pfs_one, + pfs_one, + pfs_zero, + flags); + free_temp(rp, temp); break; case OPCODE_LRP: src[0] = t_src(rp, fpi->SrcReg[0]); @@ -1281,7 +1373,70 @@ static GLboolean parse_program(struct r300_fragment_program *rp) free_temp(rp, temp); break; case OPCODE_SIN: - ERROR("SIN not implemented\n"); + /* + * sin using taylor serie: + * sin(x) = x - x^3/3! + x^5/5! - x^7/7! + */ + temp = get_temp_reg(rp); + cnstv[0] = 0.333333333; + cnstv[1] = 0.008333333; + cnstv[2] = 0.000198413; + cnstv[4] = 0.0; + cnst = emit_const4fv(rp, cnstv); + src[0] = t_scalar_src(rp, fpi->SrcReg[0]); + + emit_arith(rp, PFS_OP_MAD, temp, + WRITEMASK_XYZ, + src[0], + src[0], + pfs_zero, + flags); + emit_arith(rp, PFS_OP_MAD, temp, + WRITEMASK_Y | WRITEMASK_Z, + temp, temp, + pfs_zero, + flags); + emit_arith(rp, PFS_OP_MAD, temp, + WRITEMASK_Z, + temp, + swizzle(temp, X, X, X, W), + pfs_zero, + flags); + emit_arith(rp, PFS_OP_MAD, temp, + WRITEMASK_XYZ, + src[0], + temp, + pfs_zero, + flags); + emit_arith(rp, PFS_OP_MAD, temp, + WRITEMASK_XYZ, + temp, cnst, + pfs_zero, + flags); + emit_arith(rp, PFS_OP_MAD, temp, + WRITEMASK_X, + src[0], + pfs_one, + negate(temp), + flags); + emit_arith(rp, PFS_OP_MAD, temp, + WRITEMASK_X, + temp, + pfs_one, + swizzle(temp, Y, Y, Y, W), + flags); + emit_arith(rp, PFS_OP_MAD, temp, + WRITEMASK_X, + temp, + pfs_one, + negate(swizzle(temp, Z, Z, Z, W)), + flags); + emit_arith(rp, PFS_OP_MAD, dest, mask, + swizzle(temp, X, X, X, X), + pfs_one, + pfs_zero, + flags); + free_temp(rp, temp); break; case OPCODE_SLT: src[0] = t_src(rp, fpi->SrcReg[0]); @@ -1345,7 +1500,7 @@ static GLboolean parse_program(struct r300_fragment_program *rp) return GL_FALSE; } - + return GL_TRUE; } @@ -1508,7 +1663,7 @@ void r300_translate_fragment_shader(struct r300_fragment_program *rp) assert(rp->alu_end >= 0); rp->translated = GL_TRUE; - if (0) dump_program(rp); + if (1) dump_program(rp); } update_params(rp); diff --git a/src/mesa/drivers/dri/r300/r300_fragprog.h b/src/mesa/drivers/dri/r300/r300_fragprog.h index e7dbaf973e2..4bbaa07e012 100644 --- a/src/mesa/drivers/dri/r300/r300_fragprog.h +++ b/src/mesa/drivers/dri/r300/r300_fragprog.h @@ -78,7 +78,8 @@ typedef struct r300_fragment_program_swizzle { #define PFS_OP_RCP 9 #define PFS_OP_RSQ 10 #define PFS_OP_REPL_ALPHA 11 -#define MAX_PFS_OP 11 +#define PFS_OP_CMPH 12 +#define MAX_PFS_OP 12 #define PFS_FLAG_SAT (1 << 0) #define PFS_FLAG_ABS (1 << 1) diff --git a/src/mesa/drivers/dri/r300/r300_ioctl.c b/src/mesa/drivers/dri/r300/r300_ioctl.c index d0d2def8648..0774a2af6b4 100644 --- a/src/mesa/drivers/dri/r300/r300_ioctl.c +++ b/src/mesa/drivers/dri/r300/r300_ioctl.c @@ -477,8 +477,7 @@ static void r300EmitClearState(GLcontext * ctx) /** * Buffer clear */ -static void r300Clear(GLcontext * ctx, GLbitfield mask, GLboolean all, - GLint cx, GLint cy, GLint cw, GLint ch) +static void r300Clear(GLcontext * ctx, GLbitfield mask) { r300ContextPtr r300 = R300_CONTEXT(ctx); __DRIdrawablePrivate *dPriv = r300->radeon.dri.drawable; @@ -487,8 +486,7 @@ static void r300Clear(GLcontext * ctx, GLbitfield mask, GLboolean all, int swapped; if (RADEON_DEBUG & DEBUG_IOCTL) - fprintf(stderr, "%s: all=%d cx=%d cy=%d cw=%d ch=%d\n", - __FUNCTION__, all, cx, cy, cw, ch); + fprintf(stderr, "r300Clear\n"); { LOCK_HARDWARE(&r300->radeon); @@ -521,7 +519,7 @@ static void r300Clear(GLcontext * ctx, GLbitfield mask, GLboolean all, if (RADEON_DEBUG & DEBUG_FALLBACKS) fprintf(stderr, "%s: swrast clear, mask: %x\n", __FUNCTION__, mask); - _swrast_Clear(ctx, mask, all, cx, cy, cw, ch); + _swrast_Clear(ctx, mask); } swapped = r300->radeon.doPageFlip && (r300->radeon.sarea->pfCurrentPage == 1); @@ -572,9 +570,10 @@ void r300Flush(GLcontext * ctx) #ifdef USER_BUFFERS #include "radeon_mm.h" -void r300RefillCurrentDmaRegion(r300ContextPtr rmesa) +void r300RefillCurrentDmaRegion(r300ContextPtr rmesa, int size) { struct r300_dma_buffer *dmabuf; + size = MAX2(size, RADEON_BUFFER_SIZE*16); if (RADEON_DEBUG & (DEBUG_IOCTL | DEBUG_DMA)) fprintf(stderr, "%s\n", __FUNCTION__); @@ -593,20 +592,20 @@ void r300RefillCurrentDmaRegion(r300ContextPtr rmesa) dmabuf->buf = (void *)1; /* hack */ dmabuf->refcount = 1; - dmabuf->id = radeon_mm_alloc(rmesa, 4, RADEON_BUFFER_SIZE*16); + dmabuf->id = radeon_mm_alloc(rmesa, 4, size); if (dmabuf->id == 0) { LOCK_HARDWARE(&rmesa->radeon); /* no need to validate */ r300FlushCmdBufLocked(rmesa, __FUNCTION__); radeonWaitForIdleLocked(&rmesa->radeon); - dmabuf->id = radeon_mm_alloc(rmesa, 4, RADEON_BUFFER_SIZE*16); + dmabuf->id = radeon_mm_alloc(rmesa, 4, size); #ifdef HW_VBOS if (dmabuf->id == 0) { /* Just kick all */ r300_evict_vbos(rmesa->radeon.glCtx, /*RADEON_BUFFER_SIZE*16*/1<<30); - dmabuf->id = radeon_mm_alloc(rmesa, 4, RADEON_BUFFER_SIZE*16); + dmabuf->id = radeon_mm_alloc(rmesa, 4, size); } #endif UNLOCK_HARDWARE(&rmesa->radeon); @@ -619,7 +618,7 @@ void r300RefillCurrentDmaRegion(r300ContextPtr rmesa) rmesa->dma.current.buf = dmabuf; rmesa->dma.current.address = radeon_mm_ptr(rmesa, dmabuf->id); - rmesa->dma.current.end = RADEON_BUFFER_SIZE*16; + rmesa->dma.current.end = size; rmesa->dma.current.start = 0; rmesa->dma.current.ptr = 0; } @@ -667,7 +666,8 @@ void r300AllocDmaRegion(r300ContextPtr rmesa, (rmesa->dma.current.ptr + alignment) & ~alignment; if (rmesa->dma.current.ptr + bytes > rmesa->dma.current.end) - r300RefillCurrentDmaRegion(rmesa); + r300RefillCurrentDmaRegion(rmesa, + (bytes + 0x7) & ~0x7); region->start = rmesa->dma.current.start; region->ptr = rmesa->dma.current.start; diff --git a/src/mesa/drivers/dri/r300/r300_ioctl.h b/src/mesa/drivers/dri/r300/r300_ioctl.h index 5514214cc6b..52325646e9f 100644 --- a/src/mesa/drivers/dri/r300/r300_ioctl.h +++ b/src/mesa/drivers/dri/r300/r300_ioctl.h @@ -50,7 +50,6 @@ extern GLuint r300GartOffsetFromVirtual(r300ContextPtr rmesa, extern void r300Flush(GLcontext * ctx); -extern void r300RefillCurrentDmaRegion(r300ContextPtr rmesa); extern void r300ReleaseDmaRegion(r300ContextPtr rmesa, struct r300_dma_region *region, const char *caller); extern void r300AllocDmaRegion(r300ContextPtr rmesa, diff --git a/src/mesa/drivers/dri/r300/r300_reg.h b/src/mesa/drivers/dri/r300/r300_reg.h index f3d8fa60f5b..9f636ec1d2e 100644 --- a/src/mesa/drivers/dri/r300/r300_reg.h +++ b/src/mesa/drivers/dri/r300/r300_reg.h @@ -1001,6 +1001,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. * - DP4: Use OUTC_DP4, OUTA_DP4 * - DP3: Use OUTC_DP3, OUTA_DP4, appropriate alpha operands * - DPH: Use OUTC_DP4, OUTA_DP4, appropriate alpha operands + * - CMPH: If ARG2 > 0.5, return ARG0, else return ARG1 * - CMP: If ARG2 < 0, return ARG1, else return ARG0 * - FLR: use FRC+MAD * - XPD: use MAD+MAD @@ -1138,6 +1139,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. # define R300_FPI0_OUTC_DP4 (2 << 23) # define R300_FPI0_OUTC_MIN (4 << 23) # define R300_FPI0_OUTC_MAX (5 << 23) +# define R300_FPI0_OUTC_CMPH (7 << 23) # define R300_FPI0_OUTC_CMP (8 << 23) # define R300_FPI0_OUTC_FRC (9 << 23) # define R300_FPI0_OUTC_REPL_ALPHA (10 << 23) diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index bac1bef9681..b06336457de 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -206,7 +206,7 @@ static void r300_set_blend_state(GLcontext * ctx) (R300_BLEND_GL_ZERO << R300_DST_BLEND_SHIFT); int eqnA = R300_COMB_FCN_ADD_CLAMP; - if (ctx->Color._LogicOpEnabled || !ctx->Color.BlendEnabled) { + if (RGBA_LOGICOP_ENABLED(ctx) || !ctx->Color.BlendEnabled) { r300_set_blend_cntl(r300, func, eqn, 0, func, eqn); @@ -460,7 +460,6 @@ static void update_depth(GLcontext* ctx) static void r300Enable(GLcontext* ctx, GLenum cap, GLboolean state) { r300ContextPtr r300 = R300_CONTEXT(ctx); - uint32_t newval; if (RADEON_DEBUG & DEBUG_STATE) fprintf(stderr, "%s( %s = %s )\n", __FUNCTION__, @@ -1910,11 +1909,10 @@ void r300ResetHwState(r300ContextPtr r300) r300->hw.unk2134.cmd[1] = 0x00FFFFFF; r300->hw.unk2134.cmd[2] = 0x00000000; -#ifdef MESA_BIG_ENDIAN - r300->hw.unk2140.cmd[1] = 0x00000002; -#else - r300->hw.unk2140.cmd[1] = 0x00000000; -#endif + if (_mesa_little_endian()) + r300->hw.unk2140.cmd[1] = 0x00000000; + else + r300->hw.unk2140.cmd[1] = 0x00000002; #if 0 /* Done in setup routing */ ((drm_r300_cmd_header_t*)r300->hw.vir[0].cmd)->packet0.count = 1; diff --git a/src/mesa/drivers/dri/r300/r300_tex.c b/src/mesa/drivers/dri/r300/r300_tex.c index efa072c2651..6348ba1982a 100644 --- a/src/mesa/drivers/dri/r300/r300_tex.c +++ b/src/mesa/drivers/dri/r300/r300_tex.c @@ -297,6 +297,38 @@ static r300TexObjPtr r300AllocTexObj(struct gl_texture_object *texObj) return t; } +/* try to find a format which will only need a memcopy */ +static const struct gl_texture_format *r300Choose8888TexFormat( GLenum srcFormat, + GLenum srcType ) +{ + const GLuint ui = 1; + const GLubyte littleEndian = *((const GLubyte *) &ui); + + if ((srcFormat == GL_RGBA && srcType == GL_UNSIGNED_INT_8_8_8_8) || + (srcFormat == GL_RGBA && srcType == GL_UNSIGNED_BYTE && !littleEndian) || + (srcFormat == GL_ABGR_EXT && srcType == GL_UNSIGNED_INT_8_8_8_8_REV) || + (srcFormat == GL_ABGR_EXT && srcType == GL_UNSIGNED_BYTE && littleEndian)) { + return &_mesa_texformat_rgba8888; + } + else if ((srcFormat == GL_RGBA && srcType == GL_UNSIGNED_INT_8_8_8_8_REV) || + (srcFormat == GL_RGBA && srcType == GL_UNSIGNED_BYTE && littleEndian) || + (srcFormat == GL_ABGR_EXT && srcType == GL_UNSIGNED_INT_8_8_8_8) || + (srcFormat == GL_ABGR_EXT && srcType == GL_UNSIGNED_BYTE && !littleEndian)) { + return &_mesa_texformat_rgba8888_rev; + } + else if (srcFormat == GL_BGRA && + ((srcType == GL_UNSIGNED_BYTE && !littleEndian) || + srcType == GL_UNSIGNED_INT_8_8_8_8)) { + return &_mesa_texformat_argb8888_rev; + } + else if (srcFormat == GL_BGRA && + ((srcType == GL_UNSIGNED_BYTE && littleEndian) || + srcType == GL_UNSIGNED_INT_8_8_8_8_REV)) { + return &_mesa_texformat_argb8888; + } + else return _dri_texformat_argb8888; +} + static const struct gl_texture_format *r300ChooseTextureFormat(GLcontext * ctx, GLint internalFormat, @@ -335,7 +367,7 @@ static const struct gl_texture_format *r300ChooseTextureFormat(GLcontext * ctx, case GL_UNSIGNED_SHORT_1_5_5_5_REV: return _dri_texformat_argb1555; default: - return do32bpt ? _dri_texformat_rgba8888 : + return do32bpt ? r300Choose8888TexFormat(format, type) : _dri_texformat_argb4444; } @@ -353,7 +385,7 @@ static const struct gl_texture_format *r300ChooseTextureFormat(GLcontext * ctx, case GL_UNSIGNED_SHORT_5_6_5_REV: return _dri_texformat_rgb565; default: - return do32bpt ? _dri_texformat_rgba8888 : + return do32bpt ? _dri_texformat_argb8888 : _dri_texformat_rgb565; } @@ -362,7 +394,7 @@ static const struct gl_texture_format *r300ChooseTextureFormat(GLcontext * ctx, case GL_RGBA12: case GL_RGBA16: return !force16bpt ? - _dri_texformat_rgba8888 : _dri_texformat_argb4444; + r300Choose8888TexFormat(format, type) : _dri_texformat_argb4444; case GL_RGBA4: case GL_RGBA2: @@ -375,7 +407,7 @@ static const struct gl_texture_format *r300ChooseTextureFormat(GLcontext * ctx, case GL_RGB10: case GL_RGB12: case GL_RGB16: - return !force16bpt ? _dri_texformat_rgba8888 : + return !force16bpt ? _dri_texformat_argb8888 : _dri_texformat_rgb565; case GL_RGB5: diff --git a/src/mesa/drivers/dri/r300/r300_texstate.c b/src/mesa/drivers/dri/r300/r300_texstate.c index c4a1bf01b4c..cc356afb230 100644 --- a/src/mesa/drivers/dri/r300/r300_texstate.c +++ b/src/mesa/drivers/dri/r300/r300_texstate.c @@ -51,14 +51,14 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define VALID_FORMAT(f) ( ((f) <= MESA_FORMAT_RGBA_DXT5 \ || ((f) >= MESA_FORMAT_RGBA_FLOAT32 && \ (f) <= MESA_FORMAT_INTENSITY_FLOAT16)) \ - && tx_table[f].flag ) + && tx_table_le[f].flag ) #define _ASSIGN(entry, format) \ [ MESA_FORMAT_ ## entry ] = { format, 0, 1} static const struct { GLuint format, filter, flag; -} tx_table[] = { +} tx_table_be[] = { /* * Note that the _REV formats are the same as the non-REV formats. * This is because the REV and non-REV formats are identical as a @@ -68,9 +68,9 @@ static const struct { * byte-swapping), the R300 sees the REV and non-REV formats * identically. -- paulus */ - _ASSIGN(RGBA8888, R300_EASY_TX_FORMAT(Y, Z, W, X, W8Z8Y8X8)), + _ASSIGN(RGBA8888, R300_EASY_TX_FORMAT(Z, Y, X, W, W8Z8Y8X8)), _ASSIGN(RGBA8888_REV, R300_EASY_TX_FORMAT(Y, Z, W, X, W8Z8Y8X8)), - _ASSIGN(ARGB8888, R300_EASY_TX_FORMAT(X, Y, Z, W, W8Z8Y8X8)), + _ASSIGN(ARGB8888, R300_EASY_TX_FORMAT(W, Z, Y, X, W8Z8Y8X8)), _ASSIGN(ARGB8888_REV, R300_EASY_TX_FORMAT(X, Y, Z, W, W8Z8Y8X8)), _ASSIGN(RGB888, 0xffffffff), _ASSIGN(RGB565, R300_EASY_TX_FORMAT(X, Y, Z, ONE, Z5Y6X5)), @@ -106,6 +106,47 @@ static const struct { _ASSIGN(INTENSITY_FLOAT16, R300_EASY_TX_FORMAT(X, X, X, X, FL_I16)), }; +static const struct { + GLuint format, filter, flag; +} tx_table_le[] = { + _ASSIGN(RGBA8888, R300_EASY_TX_FORMAT(Y, Z, W, X, W8Z8Y8X8)), + _ASSIGN(RGBA8888_REV, R300_EASY_TX_FORMAT(Z, Y, X, W, W8Z8Y8X8)), + _ASSIGN(ARGB8888, R300_EASY_TX_FORMAT(X, Y, Z, W, W8Z8Y8X8)), + _ASSIGN(ARGB8888_REV, R300_EASY_TX_FORMAT(W, Z, Y, X, W8Z8Y8X8)), + _ASSIGN(RGB888, 0xffffffff), + _ASSIGN(RGB565, R300_EASY_TX_FORMAT(X, Y, Z, ONE, Z5Y6X5)), + _ASSIGN(RGB565_REV, R300_EASY_TX_FORMAT(X, Y, Z, ONE, Z5Y6X5)), + _ASSIGN(ARGB4444, R300_EASY_TX_FORMAT(X, Y, Z, W, W4Z4Y4X4)), + _ASSIGN(ARGB4444_REV, R300_EASY_TX_FORMAT(X, Y, Z, W, W4Z4Y4X4)), + _ASSIGN(ARGB1555, R300_EASY_TX_FORMAT(X, Y, Z, W, W1Z5Y5X5)), + _ASSIGN(ARGB1555_REV, R300_EASY_TX_FORMAT(X, Y, Z, W, W1Z5Y5X5)), + _ASSIGN(AL88, R300_EASY_TX_FORMAT(X, X, X, Y, Y8X8)), + _ASSIGN(AL88_REV, R300_EASY_TX_FORMAT(X, X, X, Y, Y8X8)), + _ASSIGN(RGB332, R300_EASY_TX_FORMAT(X, Y, Z, ONE, Z3Y3X2)), + _ASSIGN(A8, R300_EASY_TX_FORMAT(ZERO, ZERO, ZERO, X, X8)), + _ASSIGN(L8, R300_EASY_TX_FORMAT(X, X, X, ONE, X8)), + _ASSIGN(I8, R300_EASY_TX_FORMAT(X, X, X, X, X8)), + _ASSIGN(CI8, R300_EASY_TX_FORMAT(X, X, X, X, X8)), + _ASSIGN(YCBCR, R300_EASY_TX_FORMAT(X, Y, Z, ONE, G8R8_G8B8)|R300_TX_FORMAT_YUV_MODE ), + _ASSIGN(YCBCR_REV, R300_EASY_TX_FORMAT(X, Y, Z, ONE, G8R8_G8B8)|R300_TX_FORMAT_YUV_MODE), + _ASSIGN(RGB_DXT1, R300_EASY_TX_FORMAT(X, Y, Z, ONE, DXT1)), + _ASSIGN(RGBA_DXT1, R300_EASY_TX_FORMAT(X, Y, Z, W, DXT1)), + _ASSIGN(RGBA_DXT3, R300_EASY_TX_FORMAT(X, Y, Z, W, DXT3)), + _ASSIGN(RGBA_DXT5, R300_EASY_TX_FORMAT(Y, Z, W, X, DXT5)), + _ASSIGN(RGBA_FLOAT32, R300_EASY_TX_FORMAT(Z, Y, X, W, FL_R32G32B32A32)), + _ASSIGN(RGBA_FLOAT16, R300_EASY_TX_FORMAT(Z, Y, X, W, FL_R16G16B16A16)), + _ASSIGN(RGB_FLOAT32, 0xffffffff), + _ASSIGN(RGB_FLOAT16, 0xffffffff), + _ASSIGN(ALPHA_FLOAT32, R300_EASY_TX_FORMAT(ZERO, ZERO, ZERO, X, FL_I32)), + _ASSIGN(ALPHA_FLOAT16, R300_EASY_TX_FORMAT(ZERO, ZERO, ZERO, X, FL_I16)), + _ASSIGN(LUMINANCE_FLOAT32, R300_EASY_TX_FORMAT(X, X, X, ONE, FL_I32)), + _ASSIGN(LUMINANCE_FLOAT16, R300_EASY_TX_FORMAT(X, X, X, ONE, FL_I16)), + _ASSIGN(LUMINANCE_ALPHA_FLOAT32, R300_EASY_TX_FORMAT(X, X, X, Y, FL_I32A32)), + _ASSIGN(LUMINANCE_ALPHA_FLOAT16, R300_EASY_TX_FORMAT(X, X, X, Y, FL_I16A16)), + _ASSIGN(INTENSITY_FLOAT32, R300_EASY_TX_FORMAT(X, X, X, X, FL_I32)), + _ASSIGN(INTENSITY_FLOAT16, R300_EASY_TX_FORMAT(X, X, X, X, FL_I16)), + }; + #undef _ASSIGN @@ -133,12 +174,18 @@ static void r300SetTexImages(r300ContextPtr rmesa, /* Set the hardware texture format */ - if (VALID_FORMAT(baseImage->TexFormat->MesaFormat) && - tx_table[baseImage->TexFormat->MesaFormat].flag) { - t->format = - tx_table[baseImage->TexFormat->MesaFormat].format; - t->filter |= - tx_table[baseImage->TexFormat->MesaFormat].filter; + if (VALID_FORMAT(baseImage->TexFormat->MesaFormat)) { + if (_mesa_little_endian()) { + t->format = + tx_table_le[baseImage->TexFormat->MesaFormat].format; + t->filter |= + tx_table_le[baseImage->TexFormat->MesaFormat].filter; + } else { + t->format = + tx_table_be[baseImage->TexFormat->MesaFormat].format; + t->filter |= + tx_table_be[baseImage->TexFormat->MesaFormat].filter; + } } else { _mesa_problem(NULL, "unexpected texture format in %s", __FUNCTION__); diff --git a/src/mesa/drivers/dri/r300/radeon_context.c b/src/mesa/drivers/dri/r300/radeon_context.c index e824a923aca..3a6bde8fc31 100644 --- a/src/mesa/drivers/dri/r300/radeon_context.c +++ b/src/mesa/drivers/dri/r300/radeon_context.c @@ -47,11 +47,9 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "swrast/swrast.h" #include "radeon_screen.h" -#include "r200_context.h" #include "radeon_ioctl.h" #include "radeon_macros.h" #include "radeon_reg.h" -#include "r200_state.h" #include "r300_state.h" @@ -100,28 +98,10 @@ static const GLubyte *radeonGetString(GLcontext * ctx, GLenum name) } } - -/* Return the width and height of the given buffer. - */ -static void radeonGetBufferSize(GLframebuffer * buffer, - GLuint * width, GLuint * height) -{ - GET_CURRENT_CONTEXT(ctx); - radeonContextPtr radeon = RADEON_CONTEXT(ctx); - - LOCK_HARDWARE(radeon); - *width = radeon->dri.drawable->w; - *height = radeon->dri.drawable->h; - UNLOCK_HARDWARE(radeon); -} - - /* Initialize the driver's misc functions. */ static void radeonInitDriverFuncs(struct dd_function_table *functions) { - functions->GetBufferSize = radeonGetBufferSize; - functions->ResizeBuffers = _mesa_resize_framebuffer; functions->GetString = radeonGetString; } @@ -161,7 +141,8 @@ GLboolean radeonInitContext(radeonContextPtr radeon, /* DRI fields */ radeon->dri.context = driContextPriv; radeon->dri.screen = sPriv; - radeon->dri.drawable = NULL; /* Set by XMesaMakeCurrent */ + radeon->dri.drawable = NULL; + radeon->dri.readable = NULL; radeon->dri.hwContext = driContextPriv->hHWContext; radeon->dri.hwLock = &sPriv->pSAREA->lock; radeon->dri.fd = sPriv->fd; @@ -287,17 +268,17 @@ GLboolean radeonMakeCurrent(__DRIcontextPrivate * driContextPriv, if (radeon->dri.drawable != driDrawPriv) { driDrawableInitVBlank(driDrawPriv, - radeon->vblank_flags); + radeon->vblank_flags, + &radeon->vbl_seq); + } + + if (radeon->dri.drawable != driDrawPriv || + radeon->dri.readable != driReadPriv) { radeon->dri.drawable = driDrawPriv; - + radeon->dri.readable = driReadPriv; + r300UpdateWindow(radeon->glCtx); r300UpdateViewportOffset(radeon->glCtx); -#if R200_MERGED - if (IS_R200_CLASS(radeon->radeonScreen)) { - r200UpdateWindow(radeon->glCtx); - r200UpdateViewportOffset(radeon->glCtx); - } -#endif } _mesa_make_current(radeon->glCtx, @@ -311,13 +292,7 @@ GLboolean radeonMakeCurrent(__DRIcontextPrivate * driContextPriv, driDrawPriv->w, driDrawPriv->h); } - _mesa_update_state(radeon->glCtx); - -#if R200_MERGED - if (IS_R200_CLASS(radeon->radeonScreen)) - r200ValidateState(radeon->glCtx); -#endif - + _mesa_update_state(radeon->glCtx); } else { if (RADEON_DEBUG & DEBUG_DRI) fprintf(stderr, "%s ctx is null\n", __FUNCTION__); diff --git a/src/mesa/drivers/dri/r300/radeon_context.h b/src/mesa/drivers/dri/r300/radeon_context.h index 0ec6466e441..07a0c7cbd6d 100644 --- a/src/mesa/drivers/dri/r300/radeon_context.h +++ b/src/mesa/drivers/dri/r300/radeon_context.h @@ -120,7 +120,15 @@ extern void radeonTclFallback(GLcontext * ctx, GLuint bit, GLboolean mode); struct radeon_dri_mirror { __DRIcontextPrivate *context; /* DRI context */ __DRIscreenPrivate *screen; /* DRI screen */ - __DRIdrawablePrivate *drawable; /* DRI drawable bound to this ctx */ + /** + * DRI drawable bound to this context for drawing. + */ + __DRIdrawablePrivate *drawable; + + /** + * DRI drawable bound to this context for reading. + */ + __DRIdrawablePrivate *readable; drm_context_t hwContext; drm_hw_lock_t *hwLock; diff --git a/src/mesa/drivers/dri/r300/radeon_ioctl.c b/src/mesa/drivers/dri/r300/radeon_ioctl.c index d5b53194189..0b8656b9c1d 100644 --- a/src/mesa/drivers/dri/r300/radeon_ioctl.c +++ b/src/mesa/drivers/dri/r300/radeon_ioctl.c @@ -40,16 +40,9 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "macros.h" #include "context.h" #include "swrast/swrast.h" -#include "r200_context.h" #include "r300_context.h" -#include "r200_state.h" #include "radeon_ioctl.h" -#include "r200_ioctl.h" #include "r300_ioctl.h" -#if R200_MERGED -#include "r200_tcl.h" -#include "r200_sanity.h" -#endif #include "r300_state.h" #include "radeon_reg.h" @@ -245,10 +238,7 @@ void radeonCopyBuffer(const __DRIdrawablePrivate * dPriv, UNLOCK_HARDWARE(radeon); if (!rect) { - if (IS_R200_CLASS(radeon->radeonScreen)) - ((r200ContextPtr)radeon)->hw.all_dirty = GL_TRUE; - else - ((r300ContextPtr)radeon)->hw.all_dirty = GL_TRUE; + ((r300ContextPtr)radeon)->hw.all_dirty = GL_TRUE; radeon->swap_count++; (*dri_interface->getUST) (&ust); @@ -334,14 +324,6 @@ void radeonPageFlip(const __DRIdrawablePrivate * dPriv) radeon->state.color.drawPitch = radeon->radeonScreen->backPitch; } - if (IS_R200_CLASS(radeon->radeonScreen)) { - r200ContextPtr r200 = (r200ContextPtr)radeon; - - R200_STATECHANGE(r200, ctx); - r200->hw.ctx.cmd[CTX_RB3D_COLOROFFSET] = radeon->state.color.drawOffset - + radeon->radeonScreen->fbLocation; - r200->hw.ctx.cmd[CTX_RB3D_COLORPITCH] = radeon->state.color.drawPitch; - } if (IS_R300_CLASS(radeon->radeonScreen)) { r300ContextPtr r300 = (r300ContextPtr)radeon; R300_STATECHANGE(r300, cb); @@ -372,7 +354,7 @@ void radeonWaitForIdleLocked(radeonContextPtr radeon) if (ret < 0) { UNLOCK_HARDWARE(radeon); - fprintf(stderr, "Error: R200 timed out... exiting\n"); + fprintf(stderr, "Error: R300 timed out... exiting\n"); exit(-1); } } @@ -390,10 +372,6 @@ void radeonFlush(GLcontext * ctx) if (IS_R300_CLASS(radeon->radeonScreen)) r300Flush(ctx); -#if R200_MERGED - else - r200Flush(ctx); -#endif } diff --git a/src/mesa/drivers/dri/r300/radeon_lock.c b/src/mesa/drivers/dri/r300/radeon_lock.c index edf26183148..a00da6c8bc3 100644 --- a/src/mesa/drivers/dri/r300/radeon_lock.c +++ b/src/mesa/drivers/dri/r300/radeon_lock.c @@ -33,12 +33,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include -#include "r200_context.h" #include "radeon_lock.h" -#if R200_MERGED -#include "r200_tex.h" -#endif -#include "r200_state.h" #include "radeon_ioctl.h" #include "radeon_state.h" #include "r300_context.h" @@ -79,64 +74,31 @@ static void radeonUpdatePageFlipping(radeonContextPtr radeon) /** * Called by radeonGetLock() after the lock has been obtained. */ -#if R200_MERGED -static void r200RegainedLock(r200ContextPtr r200) -{ - __DRIdrawablePrivate *dPriv = r200->radeon.dri.drawable; - int i; - - if (r200->radeon.lastStamp != dPriv->lastStamp) { - radeonUpdatePageFlipping(&r200->radeon); - R200_STATECHANGE(r200, ctx); - r200->hw.ctx.cmd[CTX_RB3D_COLOROFFSET] = - r200->radeon.state.color.drawOffset - + r200->radeon.radeonScreen->fbLocation; - r200->hw.ctx.cmd[CTX_RB3D_COLORPITCH] = - r200->radeon.state.color.drawPitch; - - if (r200->radeon.glCtx->DrawBuffer->_ColorDrawBufferMask[0] == BUFFER_BIT_BACK_LEFT) - radeonSetCliprects(&r200->radeon, GL_BACK_LEFT); - else - radeonSetCliprects(&r200->radeon, GL_FRONT_LEFT); - r200UpdateViewportOffset(r200->radeon.glCtx); - r200->radeon.lastStamp = dPriv->lastStamp; - } - - for (i = 0; i < r200->nr_heaps; i++) { - DRI_AGE_TEXTURES(r200->texture_heaps[i]); - } -} -#endif - static void r300RegainedLock(radeonContextPtr radeon) -{ - __DRIdrawablePrivate *dPriv = radeon->dri.drawable; +{ int i; + __DRIdrawablePrivate *const drawable = radeon->dri.drawable; r300ContextPtr r300 = (r300ContextPtr)radeon; + drm_radeon_sarea_t *sarea = radeon->sarea; - if (radeon->lastStamp != dPriv->lastStamp) { - _mesa_resize_framebuffer(radeon->glCtx, - (GLframebuffer*)dPriv->driverPrivate, - dPriv->w, dPriv->h); - + if ( radeon->lastStamp != drawable->lastStamp ) { radeonUpdatePageFlipping(radeon); - - if (radeon->glCtx->DrawBuffer->_ColorDrawBufferMask[0] == BUFFER_BIT_BACK_LEFT) - radeonSetCliprects(radeon, GL_BACK_LEFT); - else - radeonSetCliprects(radeon, GL_FRONT_LEFT); - + radeonSetCliprects(radeon); #if 1 r300UpdateViewportOffset( radeon->glCtx ); - driUpdateFramebufferSize(radeon->glCtx, dPriv); + driUpdateFramebufferSize(radeon->glCtx, drawable); #else radeonUpdateScissor(radeon->glCtx); #endif - radeon->lastStamp = dPriv->lastStamp; + radeon->lastStamp = drawable->lastStamp; } - for (i = 0; i < r300->nr_heaps; i++) { - DRI_AGE_TEXTURES(r300->texture_heaps[i]); + if (sarea->ctx_owner != radeon->dri.hwContext) { + sarea->ctx_owner = radeon->dri.hwContext; + + for (i = 0; i < r300->nr_heaps; i++) { + DRI_AGE_TEXTURES(r300->texture_heaps[i]); + } } } @@ -150,11 +112,11 @@ static void r300RegainedLock(radeonContextPtr radeon) */ void radeonGetLock(radeonContextPtr radeon, GLuint flags) { - __DRIdrawablePrivate *dPriv = radeon->dri.drawable; + __DRIdrawablePrivate *const drawable = radeon->dri.drawable; + __DRIdrawablePrivate *const readable = radeon->dri.readable; __DRIscreenPrivate *sPriv = radeon->dri.screen; - drm_radeon_sarea_t *sarea = radeon->sarea; - assert (dPriv != NULL); + assert (drawable != NULL); drmGetLock(radeon->dri.fd, radeon->dri.hwContext, flags); @@ -166,17 +128,13 @@ void radeonGetLock(radeonContextPtr radeon, GLuint flags) * Since the hardware state depends on having the latest drawable * clip rects, all state checking must be done _after_ this call. */ - DRI_VALIDATE_DRAWABLE_INFO(sPriv, dPriv); - - if (sarea->ctx_owner != radeon->dri.hwContext) - sarea->ctx_owner = radeon->dri.hwContext; + DRI_VALIDATE_DRAWABLE_INFO( sPriv, drawable ); + if (drawable != readable) { + DRI_VALIDATE_DRAWABLE_INFO( sPriv, readable ); + } if (IS_R300_CLASS(radeon->radeonScreen)) r300RegainedLock(radeon); -#if R200_MERGED - else - r200RegainedLock((r200ContextPtr)radeon); -#endif radeon->lost_context = GL_TRUE; } diff --git a/src/mesa/drivers/dri/r300/radeon_mm.c b/src/mesa/drivers/dri/r300/radeon_mm.c index 7595d2144f7..f86a1b4e72e 100644 --- a/src/mesa/drivers/dri/r300/radeon_mm.c +++ b/src/mesa/drivers/dri/r300/radeon_mm.c @@ -213,7 +213,7 @@ int radeon_mm_alloc(r300ContextPtr rmesa, int alignment, int size) } goto again; #else - WARN_ONCE("Ran out of GART memory!\nPlease consider adjusting GARTSize option.\n"); + WARN_ONCE("Ran out of GART memory (for %d)!\nPlease consider adjusting GARTSize option.\n", size); return 0; #endif } diff --git a/src/mesa/drivers/dri/r300/radeon_state.c b/src/mesa/drivers/dri/r300/radeon_state.c index a6375ff878f..0ceaf7ebb7d 100644 --- a/src/mesa/drivers/dri/r300/radeon_state.c +++ b/src/mesa/drivers/dri/r300/radeon_state.c @@ -46,12 +46,10 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "tnl/t_pipeline.h" #include "swrast_setup/swrast_setup.h" -#include "r200_context.h" #include "radeon_ioctl.h" #include "radeon_state.h" -#include "r200_state.h" #include "r300_ioctl.h" - +#include "framebuffer.h" /* ============================================================= * Scissoring @@ -136,12 +134,9 @@ void radeonUpdateScissor(GLcontext* ctx) static void radeonScissor(GLcontext* ctx, GLint x, GLint y, GLsizei w, GLsizei h) { - radeonContextPtr radeon = RADEON_CONTEXT(ctx); - if (ctx->Scissor.Enabled) { /* We don't pipeline cliprect changes */ r300Flush(ctx); - radeonUpdateScissor(ctx); } } @@ -150,31 +145,42 @@ static void radeonScissor(GLcontext* ctx, GLint x, GLint y, GLsizei w, GLsizei h /** * Update cliprects and scissors. */ -void radeonSetCliprects(radeonContextPtr radeon, GLenum mode) +void radeonSetCliprects(radeonContextPtr radeon) { - __DRIdrawablePrivate *dPriv = radeon->dri.drawable; - - switch (mode) { - case GL_FRONT_LEFT: - radeon->numClipRects = dPriv->numClipRects; - radeon->pClipRects = dPriv->pClipRects; - break; - case GL_BACK_LEFT: - /* Can't ignore 2d windows if we are page flipping. - */ - if (dPriv->numBackClipRects == 0 || radeon->doPageFlip) { - radeon->numClipRects = dPriv->numClipRects; - radeon->pClipRects = dPriv->pClipRects; + __DRIdrawablePrivate *const drawable = radeon->dri.drawable; + __DRIdrawablePrivate *const readable = radeon->dri.readable; + GLframebuffer *const draw_fb = (GLframebuffer*)drawable->driverPrivate; + GLframebuffer *const read_fb = (GLframebuffer*)readable->driverPrivate; + + if (draw_fb->_ColorDrawBufferMask[0] == BUFFER_BIT_BACK_LEFT) { + /* Can't ignore 2d windows if we are page flipping. */ + if (drawable->numBackClipRects == 0 || radeon->doPageFlip) { + radeon->numClipRects = drawable->numClipRects; + radeon->pClipRects = drawable->pClipRects; } else { - radeon->numClipRects = dPriv->numBackClipRects; - radeon->pClipRects = dPriv->pBackClipRects; + radeon->numClipRects = drawable->numBackClipRects; + radeon->pClipRects = drawable->pBackClipRects; + } + } else { + /* front buffer (or none, or multiple buffers */ + radeon->numClipRects = drawable->numClipRects; + radeon->pClipRects = drawable->pClipRects; + } + + if ((draw_fb->Width != drawable->w) || + (draw_fb->Height != drawable->h)) { + _mesa_resize_framebuffer(radeon->glCtx, draw_fb, + drawable->w, drawable->h); + draw_fb->Initialized = GL_TRUE; + } + + if (drawable != readable) { + if ((read_fb->Width != readable->w) || + (read_fb->Height != readable->h)) { + _mesa_resize_framebuffer(radeon->glCtx, read_fb, + readable->w, readable->h); + read_fb->Initialized = GL_TRUE; } - break; - default: - fprintf(stderr, "bad mode in radeonSetCliprects\n"); - radeon->numClipRects = 0; - radeon->pClipRects = 0; - return; } if (radeon->state.scissor.enabled) diff --git a/src/mesa/drivers/dri/r300/radeon_state.h b/src/mesa/drivers/dri/r300/radeon_state.h index 636bf5d0086..c2d041eb4ae 100644 --- a/src/mesa/drivers/dri/r300/radeon_state.h +++ b/src/mesa/drivers/dri/r300/radeon_state.h @@ -34,7 +34,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "radeon_context.h" extern void radeonRecalcScissorRects(radeonContextPtr radeon); -extern void radeonSetCliprects(radeonContextPtr radeon, GLenum mode); +extern void radeonSetCliprects(radeonContextPtr radeon); extern void radeonUpdateScissor(GLcontext* ctx); extern void radeonEnable(GLcontext* ctx, GLenum cap, GLboolean state); diff --git a/src/mesa/drivers/dri/radeon/radeon_context.c b/src/mesa/drivers/dri/radeon/radeon_context.c index 2167e7afe82..8b92e3fe65f 100644 --- a/src/mesa/drivers/dri/radeon/radeon_context.c +++ b/src/mesa/drivers/dri/radeon/radeon_context.c @@ -70,7 +70,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define need_GL_EXT_secondary_color #include "extension_helper.h" -#define DRIVER_DATE "20060327" +#define DRIVER_DATE "20061018" #include "vblank.h" #include "utils.h" @@ -80,21 +80,6 @@ int RADEON_DEBUG = (0); #endif -/* Return the width and height of the given buffer. - */ -static void radeonGetBufferSize( GLframebuffer *buffer, - GLuint *width, GLuint *height ) -{ - GET_CURRENT_CONTEXT(ctx); - radeonContextPtr rmesa = RADEON_CONTEXT(ctx); - - LOCK_HARDWARE( rmesa ); - *width = rmesa->dri.drawable->w; - *height = rmesa->dri.drawable->h; - - UNLOCK_HARDWARE( rmesa ); -} - /* Return various strings for glGetString(). */ static const GLubyte *radeonGetString( GLcontext *ctx, GLenum name ) @@ -186,8 +171,6 @@ static const struct tnl_pipeline_stage *radeon_pipeline[] = { */ static void radeonInitDriverFuncs( struct dd_function_table *functions ) { - functions->GetBufferSize = radeonGetBufferSize; - functions->ResizeBuffers = _mesa_resize_framebuffer; functions->GetString = radeonGetString; } @@ -281,7 +264,8 @@ radeonCreateContext( const __GLcontextModes *glVisual, /* Init radeon context data */ rmesa->dri.context = driContextPriv; rmesa->dri.screen = sPriv; - rmesa->dri.drawable = NULL; /* Set by XMesaMakeCurrent */ + rmesa->dri.drawable = NULL; + rmesa->dri.readable = NULL; rmesa->dri.hwContext = driContextPriv->hHWContext; rmesa->dri.hwLock = &sPriv->pSAREA->lock; rmesa->dri.fd = sPriv->fd; @@ -620,12 +604,19 @@ radeonMakeCurrent( __DRIcontextPrivate *driContextPriv, if ( newCtx->dri.drawable != driDrawPriv ) { /* XXX we may need to validate the drawable here!!! */ - driDrawableInitVBlank( driDrawPriv, newCtx->vblank_flags ); + driDrawableInitVBlank( driDrawPriv, newCtx->vblank_flags, + &newCtx->vbl_seq ); + } + + if ( (newCtx->dri.drawable != driDrawPriv) + || (newCtx->dri.readable != driReadPriv) ) { newCtx->dri.drawable = driDrawPriv; + newCtx->dri.readable = driReadPriv; + radeonUpdateWindow( newCtx->glCtx ); radeonUpdateViewportOffset( newCtx->glCtx ); } - + _mesa_make_current( newCtx->glCtx, (GLframebuffer *) driDrawPriv->driverPrivate, (GLframebuffer *) driReadPriv->driverPrivate ); diff --git a/src/mesa/drivers/dri/radeon/radeon_context.h b/src/mesa/drivers/dri/radeon/radeon_context.h index 9902e60c595..0a7c3b2f544 100644 --- a/src/mesa/drivers/dri/radeon/radeon_context.h +++ b/src/mesa/drivers/dri/radeon/radeon_context.h @@ -496,7 +496,16 @@ struct radeon_dma { struct radeon_dri_mirror { __DRIcontextPrivate *context; /* DRI context */ __DRIscreenPrivate *screen; /* DRI screen */ - __DRIdrawablePrivate *drawable; /* DRI drawable bound to this ctx */ + + /** + * DRI drawable bound to this context for drawing. + */ + __DRIdrawablePrivate *drawable; + + /** + * DRI drawable bound to this context for reading. + */ + __DRIdrawablePrivate *readable; drm_context_t hwContext; drm_hw_lock_t *hwLock; diff --git a/src/mesa/drivers/dri/radeon/radeon_ioctl.c b/src/mesa/drivers/dri/radeon/radeon_ioctl.c index aee849e13bf..737490fcde0 100644 --- a/src/mesa/drivers/dri/radeon/radeon_ioctl.c +++ b/src/mesa/drivers/dri/radeon/radeon_ioctl.c @@ -1021,8 +1021,7 @@ void radeonPageFlip( const __DRIdrawablePrivate *dPriv ) */ #define RADEON_MAX_CLEARS 256 -static void radeonClear( GLcontext *ctx, GLbitfield mask, GLboolean all, - GLint cx, GLint cy, GLint cw, GLint ch ) +static void radeonClear( GLcontext *ctx, GLbitfield mask ) { radeonContextPtr rmesa = RADEON_CONTEXT(ctx); __DRIdrawablePrivate *dPriv = rmesa->dri.drawable; @@ -1031,10 +1030,10 @@ static void radeonClear( GLcontext *ctx, GLbitfield mask, GLboolean all, GLuint flags = 0; GLuint color_mask = 0; GLint ret, i; + GLint cx, cy, cw, ch; if ( RADEON_DEBUG & DEBUG_IOCTL ) { - fprintf( stderr, "%s: all=%d cx=%d cy=%d cw=%d ch=%d\n", - __FUNCTION__, all, cx, cy, cw, ch ); + fprintf( stderr, "radeonClear\n"); } { @@ -1071,7 +1070,7 @@ static void radeonClear( GLcontext *ctx, GLbitfield mask, GLboolean all, if ( mask ) { if (RADEON_DEBUG & DEBUG_FALLBACKS) fprintf(stderr, "%s: swrast clear, mask: %x\n", __FUNCTION__, mask); - _swrast_Clear( ctx, mask, all, cx, cy, cw, ch ); + _swrast_Clear( ctx, mask ); } if ( !flags ) @@ -1094,6 +1093,12 @@ static void radeonClear( GLcontext *ctx, GLbitfield mask, GLboolean all, LOCK_HARDWARE( rmesa ); + /* compute region after locking: */ + cx = ctx->DrawBuffer->_Xmin; + cy = ctx->DrawBuffer->_Ymin; + cw = ctx->DrawBuffer->_Xmax - cx; + ch = ctx->DrawBuffer->_Ymax - cy; + /* Throttle the number of clear ioctls we do. */ while ( 1 ) { @@ -1132,7 +1137,8 @@ static void radeonClear( GLcontext *ctx, GLbitfield mask, GLboolean all, drm_radeon_clear_rect_t depth_boxes[RADEON_NR_SAREA_CLIPRECTS]; GLint n = 0; - if ( !all ) { + if (cw != dPriv->w || ch != dPriv->h) { + /* clear subregion */ for ( ; i < nr ; i++ ) { GLint x = box[i].x1; GLint y = box[i].y1; @@ -1154,6 +1160,7 @@ static void radeonClear( GLcontext *ctx, GLbitfield mask, GLboolean all, n++; } } else { + /* clear whole buffer */ for ( ; i < nr ; i++ ) { *b++ = box[i]; n++; diff --git a/src/mesa/drivers/dri/radeon/radeon_lock.c b/src/mesa/drivers/dri/radeon/radeon_lock.c index ba87271f2f5..e6ab6af4562 100644 --- a/src/mesa/drivers/dri/radeon/radeon_lock.c +++ b/src/mesa/drivers/dri/radeon/radeon_lock.c @@ -71,7 +71,8 @@ radeonUpdatePageFlipping( radeonContextPtr rmesa ) */ void radeonGetLock( radeonContextPtr rmesa, GLuint flags ) { - __DRIdrawablePrivate *dPriv = rmesa->dri.drawable; + __DRIdrawablePrivate *const drawable = rmesa->dri.drawable; + __DRIdrawablePrivate *const readable = rmesa->dri.readable; __DRIscreenPrivate *sPriv = rmesa->dri.screen; drm_radeon_sarea_t *sarea = rmesa->sarea; @@ -85,14 +86,17 @@ void radeonGetLock( radeonContextPtr rmesa, GLuint flags ) * Since the hardware state depends on having the latest drawable * clip rects, all state checking must be done _after_ this call. */ - DRI_VALIDATE_DRAWABLE_INFO( sPriv, dPriv ); + DRI_VALIDATE_DRAWABLE_INFO( sPriv, drawable ); + if (drawable != readable) { + DRI_VALIDATE_DRAWABLE_INFO( sPriv, readable ); + } - if ( rmesa->lastStamp != dPriv->lastStamp ) { + if ( rmesa->lastStamp != drawable->lastStamp ) { radeonUpdatePageFlipping( rmesa ); radeonSetCliprects( rmesa ); radeonUpdateViewportOffset( rmesa->glCtx ); - driUpdateFramebufferSize(rmesa->glCtx, dPriv); - rmesa->lastStamp = dPriv->lastStamp; + driUpdateFramebufferSize(rmesa->glCtx, drawable); + rmesa->lastStamp = drawable->lastStamp; } RADEON_STATECHANGE( rmesa, ctx ); diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.c b/src/mesa/drivers/dri/radeon/radeon_screen.c index 140d848d9ae..279357ab590 100644 --- a/src/mesa/drivers/dri/radeon/radeon_screen.c +++ b/src/mesa/drivers/dri/radeon/radeon_screen.c @@ -130,6 +130,7 @@ extern const struct dri_extension blend_extensions[]; extern const struct dri_extension ARB_vp_extension[]; extern const struct dri_extension NV_vp_extension[]; extern const struct dri_extension ATI_fs_extension[]; +extern const struct dri_extension point_extensions[]; #elif RADEON_COMMON && defined(RADEON_COMMON_FOR_R300) @@ -726,6 +727,7 @@ radeonCreateScreen( __DRIscreenPrivate *sPriv ) (*glx_enable_extension)( psc, "GLX_MESA_allocate_memory" ); (*glx_enable_extension)( psc, "GLX_MESA_copy_sub_buffer" ); + (*glx_enable_extension)( psc, "GLX_SGI_make_current_read" ); } #if RADEON_COMMON && defined(RADEON_COMMON_FOR_R200) @@ -1042,6 +1044,7 @@ __driCreateNewScreen_20050727( __DRInativeDisplay *dpy, driInitSingleExtension( NULL, ARB_vp_extension ); driInitSingleExtension( NULL, NV_vp_extension ); driInitSingleExtension( NULL, ATI_fs_extension ); + driInitExtensions( NULL, point_extensions, GL_FALSE ); #endif } diff --git a/src/mesa/drivers/dri/radeon/radeon_state.c b/src/mesa/drivers/dri/radeon/radeon_state.c index 449c63eb7a2..216d7dca174 100644 --- a/src/mesa/drivers/dri/radeon/radeon_state.c +++ b/src/mesa/drivers/dri/radeon/radeon_state.c @@ -40,6 +40,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "light.h" #include "state.h" #include "context.h" +#include "framebuffer.h" #include "array_cache/acache.h" #include "tnl/tnl.h" @@ -1635,25 +1636,42 @@ static void radeonLogicOpCode( GLcontext *ctx, GLenum opcode ) */ void radeonSetCliprects( radeonContextPtr rmesa ) { - __DRIdrawablePrivate *dPriv = rmesa->dri.drawable; + __DRIdrawablePrivate *const drawable = rmesa->dri.drawable; + __DRIdrawablePrivate *const readable = rmesa->dri.readable; + GLframebuffer *const draw_fb = (GLframebuffer*) drawable->driverPrivate; + GLframebuffer *const read_fb = (GLframebuffer*) readable->driverPrivate; - if (rmesa->glCtx->DrawBuffer->_ColorDrawBufferMask[0] + if (draw_fb->_ColorDrawBufferMask[0] == BUFFER_BIT_BACK_LEFT) { /* Can't ignore 2d windows if we are page flipping. */ - if ( dPriv->numBackClipRects == 0 || rmesa->doPageFlip ) { - rmesa->numClipRects = dPriv->numClipRects; - rmesa->pClipRects = dPriv->pClipRects; + if ( drawable->numBackClipRects == 0 || rmesa->doPageFlip ) { + rmesa->numClipRects = drawable->numClipRects; + rmesa->pClipRects = drawable->pClipRects; } else { - rmesa->numClipRects = dPriv->numBackClipRects; - rmesa->pClipRects = dPriv->pBackClipRects; + rmesa->numClipRects = drawable->numBackClipRects; + rmesa->pClipRects = drawable->pBackClipRects; } } else { /* front buffer (or none, or multiple buffers */ - rmesa->numClipRects = dPriv->numClipRects; - rmesa->pClipRects = dPriv->pClipRects; + rmesa->numClipRects = drawable->numClipRects; + rmesa->pClipRects = drawable->pClipRects; + } + + if ((draw_fb->Width != drawable->w) || (draw_fb->Height != drawable->h)) { + _mesa_resize_framebuffer(rmesa->glCtx, draw_fb, + drawable->w, drawable->h); + draw_fb->Initialized = GL_TRUE; + } + + if (drawable != readable) { + if ((read_fb->Width != readable->w) || (read_fb->Height != readable->h)) { + _mesa_resize_framebuffer(rmesa->glCtx, read_fb, + readable->w, readable->h); + read_fb->Initialized = GL_TRUE; + } } if (rmesa->state.scissor.enabled) diff --git a/src/mesa/drivers/dri/radeon/radeon_texstate.c b/src/mesa/drivers/dri/radeon/radeon_texstate.c index 1e3a3951e2d..37bb749223a 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texstate.c +++ b/src/mesa/drivers/dri/radeon/radeon_texstate.c @@ -523,9 +523,10 @@ static GLboolean radeonUpdateTextureEnv( GLcontext *ctx, int unit ) /* Set the texture environment state. Isn't this nice and clean? * The chip will automagically set the texture alpha to 0xff when - * the texture format does not include an alpha component. This + * the texture format does not include an alpha component. This * reduces the amount of special-casing we have to do, alpha-only - * textures being a notable exception. + * textures being a notable exception. Doesn't work for luminance + * textures realized with I8 and ALPHA_IN_MAP not set neither (on r100). */ /* Don't cache these results. */ @@ -555,7 +556,10 @@ static GLboolean radeonUpdateTextureEnv( GLcontext *ctx, int unit ) assert(op <= 3); switch ( srcRGBi ) { case GL_TEXTURE: - color_arg[i] = radeon_texture_color[op][unit]; + if (texUnit->_Current->Image[0][0]->_BaseFormat == GL_ALPHA) + color_arg[i] = radeon_zero_color[op]; + else + color_arg[i] = radeon_texture_color[op][unit]; break; case GL_CONSTANT: color_arg[i] = radeon_tfactor_color[op]; @@ -574,12 +578,17 @@ static GLboolean radeonUpdateTextureEnv( GLcontext *ctx, int unit ) break; case GL_TEXTURE0: case GL_TEXTURE1: - case GL_TEXTURE2: + case GL_TEXTURE2: { + GLuint txunit = srcRGBi - GL_TEXTURE0; + if (ctx->Texture.Unit[txunit]._Current->Image[0][0]->_BaseFormat == GL_ALPHA) + color_arg[i] = radeon_zero_color[op]; + else /* implement ogl 1.4/1.5 core spec here, not specification of * GL_ARB_texture_env_crossbar (which would require disabling blending * instead of undefined results when referencing not enabled texunit) */ - color_arg[i] = radeon_texture_color[op][srcRGBi - GL_TEXTURE0]; - break; + color_arg[i] = radeon_texture_color[op][txunit]; + } + break; default: return GL_FALSE; } @@ -592,7 +601,10 @@ static GLboolean radeonUpdateTextureEnv( GLcontext *ctx, int unit ) assert(op <= 1); switch ( srcAi ) { case GL_TEXTURE: - alpha_arg[i] = radeon_texture_alpha[op][unit]; + if (texUnit->_Current->Image[0][0]->_BaseFormat == GL_LUMINANCE) + alpha_arg[i] = radeon_zero_alpha[op+1]; + else + alpha_arg[i] = radeon_texture_alpha[op][unit]; break; case GL_CONSTANT: alpha_arg[i] = radeon_tfactor_alpha[op]; @@ -611,9 +623,14 @@ static GLboolean radeonUpdateTextureEnv( GLcontext *ctx, int unit ) break; case GL_TEXTURE0: case GL_TEXTURE1: - case GL_TEXTURE2: - alpha_arg[i] = radeon_texture_alpha[op][srcAi - GL_TEXTURE0]; - break; + case GL_TEXTURE2: { + GLuint txunit = srcAi - GL_TEXTURE0; + if (ctx->Texture.Unit[txunit]._Current->Image[0][0]->_BaseFormat == GL_LUMINANCE) + alpha_arg[i] = radeon_zero_alpha[op+1]; + else + alpha_arg[i] = radeon_texture_alpha[op][txunit]; + } + break; default: return GL_FALSE; } @@ -848,7 +865,7 @@ static void import_tex_obj_state( radeonContextPtr rmesa, radeonTexObjPtr texobj ) { /* do not use RADEON_DB_STATE to avoid stale texture caches */ - GLuint *cmd = &rmesa->hw.tex[unit].cmd[TEX_CMD_0]; + int *cmd = &rmesa->hw.tex[unit].cmd[TEX_CMD_0]; GLuint se_coord_fmt = rmesa->hw.set.cmd[SET_SE_COORDFMT]; RADEON_STATECHANGE( rmesa, tex[unit] ); @@ -871,7 +888,7 @@ static void import_tex_obj_state( radeonContextPtr rmesa, se_coord_fmt &= ~(RADEON_VTX_ST0_NONPARAMETRIC << unit); if (texobj->base.tObj->Target == GL_TEXTURE_CUBE_MAP) { - GLuint *cube_cmd = &rmesa->hw.cube[unit].cmd[CUBE_CMD_0]; + int *cube_cmd = &rmesa->hw.cube[unit].cmd[CUBE_CMD_0]; GLuint bytesPerFace = texobj->base.totalSize / 6; ASSERT(texobj->base.totalSize % 6 == 0); diff --git a/src/mesa/drivers/dri/s3v/s3v_dd.c b/src/mesa/drivers/dri/s3v/s3v_dd.c index 2c8e230f3ef..1cbe890319a 100644 --- a/src/mesa/drivers/dri/s3v/s3v_dd.c +++ b/src/mesa/drivers/dri/s3v/s3v_dd.c @@ -85,24 +85,6 @@ void s3vInitExtensions( GLcontext *ctx ) */ void s3vInitDriverFuncs( GLcontext *ctx ) { - ctx->Driver.GetBufferSize = s3vDDGetBufferSize; - ctx->Driver.GetString = s3vDDGetString; - - ctx->Driver.Error = NULL; - - /* Pixel path fallbacks - */ - ctx->Driver.Accum = _swrast_Accum; - ctx->Driver.Bitmap = _swrast_Bitmap; - ctx->Driver.CopyPixels = _swrast_CopyPixels; - ctx->Driver.DrawPixels = _swrast_DrawPixels; - ctx->Driver.ReadPixels = _swrast_ReadPixels; - ctx->Driver.ResizeBuffers = _mesa_resize_framebuffer; - - /* Swrast hooks for imaging extensions: - */ - ctx->Driver.CopyColorTable = _swrast_CopyColorTable; - ctx->Driver.CopyColorSubTable = _swrast_CopyColorSubTable; - ctx->Driver.CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D; - ctx->Driver.CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D; + ctx->Driver.GetBufferSize = s3vDDGetBufferSize; + ctx->Driver.GetString = s3vDDGetString; } diff --git a/src/mesa/drivers/dri/s3v/s3v_state.c b/src/mesa/drivers/dri/s3v/s3v_state.c index e692f20e8a9..fcea901c1c9 100644 --- a/src/mesa/drivers/dri/s3v/s3v_state.c +++ b/src/mesa/drivers/dri/s3v/s3v_state.c @@ -73,11 +73,16 @@ static void s3vDDBlendFunc( GLcontext *ctx, GLenum sfactor, GLenum dfactor ) * Buffer clear */ -static void s3vDDClear( GLcontext *ctx, GLbitfield mask, GLboolean all, - GLint cx, GLint cy, GLint cw, GLint ch ) +static void s3vDDClear( GLcontext *ctx, GLbitfield mask ) { s3vContextPtr vmesa = S3V_CONTEXT(ctx); unsigned int _stride; + GLint cx = ctx->DrawBuffer->_Xmin; + GLint cy = ctx->DrawBuffer->_Ymin; + GLint cw = ctx->DrawBuffer->_Xmax - cx; + GLint ch = ctx->DrawBuffer->_Ymax - cy; + + /* XXX FIX ME: the cx,cy,cw,ch vars are currently ignored! */ vmesa->restore_primitive = -1; @@ -120,7 +125,7 @@ static void s3vDDClear( GLcontext *ctx, GLbitfield mask, GLboolean all, if (mask & BUFFER_BIT_DEPTH) { /* depth */ DEBUG(("BUFFER_BIT_DEPTH\n")); - _stride = ((cw+31)&~31) * 2; + _stride = ((cw+31)&~31) * 2; /* XXX cw or Buffer->Width??? */ DMAOUT_CHECK(BITBLT_SRC_BASE, 15); DMAOUT(0); @@ -157,7 +162,7 @@ static void s3vDDClear( GLcontext *ctx, GLbitfield mask, GLboolean all, if ( mask ) DEBUG(("still masked ;3(\n")); */ /* yes */ #else - _swrast_Clear( ctx, mask, all, cx, cy, cw, ch ); + _swrast_Clear( ctx, mask ); #endif } diff --git a/src/mesa/drivers/dri/savage/savage_init.h b/src/mesa/drivers/dri/savage/savage_init.h index 0dec397b7ba..43fb969c693 100644 --- a/src/mesa/drivers/dri/savage/savage_init.h +++ b/src/mesa/drivers/dri/savage/savage_init.h @@ -80,21 +80,10 @@ typedef struct { } savageScreenPrivate; -/** - * savageRenderbuffer, derived from Mesa's gl_renderbuffer - */ -typedef struct { - struct gl_renderbuffer Base; - /* XXX per-window info should go here */ - int foo, bar; -} savageRenderbuffer; - - #include "savagecontext.h" extern void savageGetLock( savageContextPtr imesa, GLuint flags ); -extern void savageXMesaSetBackClipRects( savageContextPtr imesa ); -extern void savageXMesaSetFrontClipRects( savageContextPtr imesa ); +extern void savageXMesaSetClipRects(savageContextPtr imesa); #define GET_DISPATCH_AGE( imesa ) imesa->sarea->last_dispatch diff --git a/src/mesa/drivers/dri/savage/savage_xmesa.c b/src/mesa/drivers/dri/savage/savage_xmesa.c index aaba58ed33e..f51e321a4a6 100644 --- a/src/mesa/drivers/dri/savage/savage_xmesa.c +++ b/src/mesa/drivers/dri/savage/savage_xmesa.c @@ -173,6 +173,9 @@ savageInitDriver(__DRIscreenPrivate *sPriv) { savageScreenPrivate *savageScreen; SAVAGEDRIPtr gDRIPriv = (SAVAGEDRIPtr)sPriv->pDevPriv; + PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension = + (PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension")); + if (sPriv->devPrivSize != sizeof(SAVAGEDRIRec)) { fprintf(stderr,"\nERROR! sizeof(SAVAGEDRIRec) does not match passed size from device driver\n"); @@ -260,6 +263,11 @@ savageInitDriver(__DRIscreenPrivate *sPriv) driParseOptionInfo (&savageScreen->optionCache, __driConfigOptions, __driNConfigOptions); + if (glx_enable_extension != NULL) { + (*glx_enable_extension)(sPriv->psc->screenConfigs, + "GLX_SGI_make_current_read"); + } + #if 0 savageDDFastPathInit(); savageDDTrifuncInit(); @@ -716,34 +724,18 @@ void XMesaSwapBuffers(__DRIdrawablePrivate *driDrawPriv) } #endif -void savageXMesaSetFrontClipRects( savageContextPtr imesa ) -{ - __DRIdrawablePrivate *dPriv = imesa->driDrawable; - - imesa->numClipRects = dPriv->numClipRects; - imesa->pClipRects = dPriv->pClipRects; - imesa->drawX = dPriv->x; - imesa->drawY = dPriv->y; - savageCalcViewport( imesa->glCtx ); -} - - -void savageXMesaSetBackClipRects( savageContextPtr imesa ) +void savageXMesaSetClipRects(savageContextPtr imesa) { __DRIdrawablePrivate *dPriv = imesa->driDrawable; - if (dPriv->numBackClipRects == 0) - { - - + if ((dPriv->numBackClipRects == 0) + || (imesa->glCtx->DrawBuffer->_ColorDrawBufferMask[0] == BUFFER_BIT_FRONT_LEFT)) { imesa->numClipRects = dPriv->numClipRects; imesa->pClipRects = dPriv->pClipRects; imesa->drawX = dPriv->x; imesa->drawY = dPriv->y; } else { - - imesa->numClipRects = dPriv->numBackClipRects; imesa->pClipRects = dPriv->pBackClipRects; imesa->drawX = dPriv->backX; @@ -756,18 +748,17 @@ void savageXMesaSetBackClipRects( savageContextPtr imesa ) static void savageXMesaWindowMoved( savageContextPtr imesa ) { + __DRIdrawablePrivate *const drawable = imesa->driDrawable; + __DRIdrawablePrivate *const readable = imesa->driReadable; + if (0) fprintf(stderr, "savageXMesaWindowMoved\n\n"); - switch (imesa->glCtx->DrawBuffer->_ColorDrawBufferMask[0]) { - case BUFFER_BIT_FRONT_LEFT: - savageXMesaSetFrontClipRects( imesa ); - break; - case BUFFER_BIT_BACK_LEFT: - savageXMesaSetBackClipRects( imesa ); - break; - default: - break; + savageXMesaSetClipRects(imesa); + + driUpdateFramebufferSize(imesa->glCtx, drawable); + if (drawable != readable) { + driUpdateFramebufferSize(imesa->glCtx, readable); } } @@ -858,11 +849,12 @@ savageMakeCurrent(__DRIcontextPrivate *driContextPriv, void savageGetLock( savageContextPtr imesa, GLuint flags ) { - __DRIdrawablePrivate *dPriv = imesa->driDrawable; + __DRIdrawablePrivate *const drawable = imesa->driDrawable; + __DRIdrawablePrivate *const readable = imesa->driReadable; __DRIscreenPrivate *sPriv = imesa->driScreen; drm_savage_sarea_t *sarea = imesa->sarea; int me = imesa->hHWContext; - int stamp = dPriv->lastStamp; + int stamp = drawable->lastStamp; int heap; unsigned int timestamp = 0; @@ -882,10 +874,11 @@ void savageGetLock( savageContextPtr imesa, GLuint flags ) * NOTE: This releases and regains the hw lock, so all state * checking must be done *after* this call: */ - DRI_VALIDATE_DRAWABLE_INFO(sPriv, dPriv); - + DRI_VALIDATE_DRAWABLE_INFO(sPriv, drawable); + if (drawable != readable) { + DRI_VALIDATE_DRAWABLE_INFO(sPriv, readable); + } - /* If we lost context, need to dump all registers to hardware. * Note that we don't care about 2d contexts, even if they perform @@ -916,8 +909,8 @@ void savageGetLock( savageContextPtr imesa, GLuint flags ) DRI_AGE_TEXTURES( imesa->textureHeaps[heap] ); } - if (dPriv->lastStamp != stamp) { - driUpdateFramebufferSize(imesa->glCtx, dPriv); + if (drawable->lastStamp != stamp) { + driUpdateFramebufferSize(imesa->glCtx, drawable); savageXMesaWindowMoved( imesa ); } } diff --git a/src/mesa/drivers/dri/savage/savagedd.c b/src/mesa/drivers/dri/savage/savagedd.c index ced44e562f7..a5c5310e287 100644 --- a/src/mesa/drivers/dri/savage/savagedd.c +++ b/src/mesa/drivers/dri/savage/savagedd.c @@ -42,7 +42,7 @@ #include "utils.h" -#define DRIVER_DATE "20050829" +#define DRIVER_DATE "20061110" /*************************************** * Mesa's Driver Functions @@ -95,25 +95,7 @@ static GLint savageGetParameteri(const GLcontext *ctx, GLint param) #endif -static void savageBufferSize(GLframebuffer *buffer, GLuint *width, GLuint *height) -{ - GET_CURRENT_CONTEXT(ctx); - savageContextPtr imesa = SAVAGE_CONTEXT(ctx); - - /* Need to lock to make sure the driDrawable is uptodate. This - * information is used to resize Mesa's software buffers, so it has - * to be correct. - */ - LOCK_HARDWARE(imesa); - *width = imesa->driDrawable->w; - *height = imesa->driDrawable->h; - UNLOCK_HARDWARE(imesa); -} - - void savageDDInitDriverFuncs( GLcontext *ctx ) { - ctx->Driver.GetBufferSize = savageBufferSize; - ctx->Driver.ResizeBuffers = _mesa_resize_framebuffer; ctx->Driver.GetString = savageDDGetString; } diff --git a/src/mesa/drivers/dri/savage/savageioctl.c b/src/mesa/drivers/dri/savage/savageioctl.c index 244959d64f9..4eac1fb3498 100644 --- a/src/mesa/drivers/dri/savage/savageioctl.c +++ b/src/mesa/drivers/dri/savage/savageioctl.c @@ -327,11 +327,16 @@ static GLuint savageIntersectClipRects(drm_clip_rect_t *dest, } -static void savageDDClear( GLcontext *ctx, GLbitfield mask, GLboolean all, - GLint cx, GLint cy, GLint cw, GLint ch ) +static void savageDDClear( GLcontext *ctx, GLbitfield mask ) { - savageContextPtr imesa = SAVAGE_CONTEXT( ctx ); + savageContextPtr imesa = SAVAGE_CONTEXT( ctx ); GLuint colorMask, depthMask, clearColor, clearDepth, flags; + GLint cx = ctx->DrawBuffer->_Xmin; + GLint cy = ctx->DrawBuffer->_Ymin; + GLint cw = ctx->DrawBuffer->_Xmax - cx; + GLint ch = ctx->DrawBuffer->_Ymax - cy; + + /* XXX FIX ME: the cx,cy,cw,ch vars are currently ignored! */ if (SAVAGE_DEBUG & DEBUG_VERBOSE_MSG) fprintf (stderr, "%s\n", __FUNCTION__); @@ -420,7 +425,7 @@ static void savageDDClear( GLcontext *ctx, GLbitfield mask, GLboolean all, } if (mask) - _swrast_Clear( ctx, mask, all, cx, cy, cw, ch ); + _swrast_Clear( ctx, mask ); } /* diff --git a/src/mesa/drivers/dri/savage/savagespan.c b/src/mesa/drivers/dri/savage/savagespan.c index 606c7d50c7e..2fe991a6b99 100644 --- a/src/mesa/drivers/dri/savage/savagespan.c +++ b/src/mesa/drivers/dri/savage/savagespan.c @@ -34,8 +34,8 @@ #define LOCAL_VARS \ savageContextPtr imesa = SAVAGE_CONTEXT(ctx); \ - __DRIdrawablePrivate *dPriv = imesa->driDrawable; \ driRenderbuffer *drb = (driRenderbuffer *) rb; \ + __DRIdrawablePrivate *const dPriv = drb->dPriv; \ GLuint cpp = drb->cpp; \ GLuint pitch = drb->pitch; \ GLuint height = dPriv->h; \ @@ -45,8 +45,8 @@ #define LOCAL_DEPTH_VARS \ savageContextPtr imesa = SAVAGE_CONTEXT(ctx); \ - __DRIdrawablePrivate *dPriv = imesa->driDrawable; \ driRenderbuffer *drb = (driRenderbuffer *) rb; \ + __DRIdrawablePrivate *const dPriv = drb->dPriv; \ GLuint zpp = drb->cpp; \ GLuint pitch = drb->pitch; \ GLuint height = dPriv->h; \ @@ -234,10 +234,7 @@ void savageDDInitSpanFuncs( GLcontext *ctx ) struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference(ctx); swdd->SpanRenderStart = savageSpanRenderStart; - /* Pixel path fallbacks. - */ - ctx->Driver.Accum = _swrast_Accum; - ctx->Driver.Bitmap = _swrast_Bitmap; + /* XXX these should probably be plugged in elsewhere */ ctx->Driver.CopyPixels = savageCopyPixels; ctx->Driver.DrawPixels = savageDrawPixels; ctx->Driver.ReadPixels = savageReadPixels; diff --git a/src/mesa/drivers/dri/savage/savagestate.c b/src/mesa/drivers/dri/savage/savagestate.c index 3a267e025c9..2f20dc23b6e 100644 --- a/src/mesa/drivers/dri/savage/savagestate.c +++ b/src/mesa/drivers/dri/savage/savagestate.c @@ -647,23 +647,20 @@ static void savageDDDrawBuffer(GLcontext *ctx, GLenum mode ) case BUFFER_BIT_FRONT_LEFT: imesa->IsDouble = GL_FALSE; imesa->regs.s4.destCtrl.ni.offset = imesa->savageScreen->frontOffset>>11; - - imesa->NotFirstFrame = GL_FALSE; - savageXMesaSetFrontClipRects( imesa ); - FALLBACK( ctx, SAVAGE_FALLBACK_DRAW_BUFFER, GL_FALSE ); break; case BUFFER_BIT_BACK_LEFT: imesa->IsDouble = GL_TRUE; imesa->regs.s4.destCtrl.ni.offset = imesa->savageScreen->backOffset>>11; - imesa->NotFirstFrame = GL_FALSE; - savageXMesaSetBackClipRects( imesa ); - FALLBACK( ctx, SAVAGE_FALLBACK_DRAW_BUFFER, GL_FALSE ); break; default: FALLBACK( ctx, SAVAGE_FALLBACK_DRAW_BUFFER, GL_TRUE ); return; } + imesa->NotFirstFrame = GL_FALSE; + savageXMesaSetClipRects(imesa); + FALLBACK(ctx, SAVAGE_FALLBACK_DRAW_BUFFER, GL_FALSE); + if (destCtrl != imesa->regs.s4.destCtrl.ui) imesa->dirty |= SAVAGE_UPLOAD_GLOBAL; } @@ -1695,11 +1692,6 @@ void savageDDInitStateFuncs(GLcontext *ctx) ctx->Driver.CullFace = 0; ctx->Driver.FrontFace = 0; #endif /* end #if HW_CULL */ - ctx->Driver.PolygonMode=NULL; - ctx->Driver.PolygonStipple = 0; - ctx->Driver.LineStipple = 0; - ctx->Driver.LineWidth = 0; - ctx->Driver.LogicOpcode = 0; ctx->Driver.DrawBuffer = savageDDDrawBuffer; ctx->Driver.ReadBuffer = savageDDReadBuffer; ctx->Driver.ClearColor = savageDDClearColor; @@ -1708,9 +1700,6 @@ void savageDDInitStateFuncs(GLcontext *ctx) ctx->Driver.Viewport = savageViewport; ctx->Driver.RenderMode = savageRenderMode; - ctx->Driver.ClearIndex = 0; - ctx->Driver.IndexMask = 0; - if (SAVAGE_CONTEXT( ctx )->savageScreen->chipset >= S3_SAVAGE4) { ctx->Driver.Enable = savageDDEnable_s4; ctx->Driver.AlphaFunc = savageDDAlphaFunc_s4; @@ -1736,11 +1725,4 @@ void savageDDInitStateFuncs(GLcontext *ctx) ctx->Driver.StencilMaskSeparate = NULL; ctx->Driver.StencilOpSeparate = NULL; } - - /* Swrast hooks for imaging extensions: - */ - ctx->Driver.CopyColorTable = _swrast_CopyColorTable; - ctx->Driver.CopyColorSubTable = _swrast_CopyColorSubTable; - ctx->Driver.CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D; - ctx->Driver.CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D; } diff --git a/src/mesa/drivers/dri/sis/sis6326_clear.c b/src/mesa/drivers/dri/sis/sis6326_clear.c index be5addb7cf2..48db19566c6 100644 --- a/src/mesa/drivers/dri/sis/sis6326_clear.c +++ b/src/mesa/drivers/dri/sis/sis6326_clear.c @@ -69,25 +69,18 @@ sis6326UpdateZPattern(sisContextPtr smesa, GLclampd z) } void -sis6326DDClear(GLcontext *ctx, GLbitfield mask, GLboolean all, - GLint x, GLint y, GLint width, GLint height) +sis6326DDClear(GLcontext *ctx, GLbitfield mask) { sisContextPtr smesa = SIS_CONTEXT(ctx); GLint x1, y1, width1, height1; - if (all) { - GLframebuffer *buffer = ctx->DrawBuffer; - - x1 = 0; - y1 = 0; - width1 = buffer->Width; - height1 = buffer->Height; - } else { - x1 = x; - y1 = Y_FLIP(y+height-1); - width1 = width; - height1 = height; - } + /* get region after locking: */ + x1 = ctx->DrawBuffer->_Xmin; + y1 = ctx->DrawBuffer->_Ymin; + width1 = ctx->DrawBuffer->_Xmax - x1; + height1 = ctx->DrawBuffer->_Ymax - y1; + y1 = Y_FLIP(y1 + height1 - 1); + /* XXX: Scissoring */ fprintf(stderr, "Clear\n"); @@ -116,7 +109,7 @@ sis6326DDClear(GLcontext *ctx, GLbitfield mask, GLboolean all, UNLOCK_HARDWARE(); if (mask != 0) - _swrast_Clear(ctx, mask, all, x1, y1, width, height); + _swrast_Clear(ctx, mask); } diff --git a/src/mesa/drivers/dri/sis/sis6326_state.c b/src/mesa/drivers/dri/sis/sis6326_state.c index be229d019f5..6bc2c6de3bf 100644 --- a/src/mesa/drivers/dri/sis/sis6326_state.c +++ b/src/mesa/drivers/dri/sis/sis6326_state.c @@ -727,27 +727,9 @@ void sis6326DDInitStateFuncs( GLcontext *ctx ) ctx->Driver.Enable = sis6326DDEnable; ctx->Driver.FrontFace = sis6326DDFrontFace; ctx->Driver.Fogfv = sis6326DDFogfv; - ctx->Driver.Hint = NULL; - ctx->Driver.Lightfv = NULL; ctx->Driver.LogicOpcode = sis6326DDLogicOpCode; - ctx->Driver.PolygonMode = NULL; - ctx->Driver.PolygonStipple = NULL; - ctx->Driver.RenderMode = NULL; ctx->Driver.Scissor = sis6326DDScissor; ctx->Driver.ShadeModel = sis6326DDShadeModel; ctx->Driver.LightModelfv = sis6326DDLightModelfv; ctx->Driver.Viewport = sis6326DDViewport; - - /* Pixel path fallbacks. */ - ctx->Driver.Accum = _swrast_Accum; - ctx->Driver.Bitmap = _swrast_Bitmap; - ctx->Driver.CopyPixels = _swrast_CopyPixels; - ctx->Driver.DrawPixels = _swrast_DrawPixels; - ctx->Driver.ReadPixels = _swrast_ReadPixels; - - /* Swrast hooks for imaging extensions: */ - ctx->Driver.CopyColorTable = _swrast_CopyColorTable; - ctx->Driver.CopyColorSubTable = _swrast_CopyColorSubTable; - ctx->Driver.CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D; - ctx->Driver.CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D; } diff --git a/src/mesa/drivers/dri/sis/sis_clear.c b/src/mesa/drivers/dri/sis/sis_clear.c index 637d502381e..fb92d06c735 100644 --- a/src/mesa/drivers/dri/sis/sis_clear.c +++ b/src/mesa/drivers/dri/sis/sis_clear.c @@ -95,27 +95,18 @@ sisUpdateZStencilPattern( sisContextPtr smesa, GLclampd z, GLint stencil ) } void -sisDDClear( GLcontext * ctx, GLbitfield mask, GLboolean all, - GLint x, GLint y, GLint width, GLint height ) +sisDDClear( GLcontext * ctx, GLbitfield mask ) { - sisContextPtr smesa = SIS_CONTEXT(ctx); - - GLint x1, y1, width1, height1; + sisContextPtr smesa = SIS_CONTEXT(ctx); - if (all) { - GLframebuffer *buffer = ctx->DrawBuffer; + GLint x1, y1, width1, height1; - x1 = 0; - y1 = 0; - width1 = buffer->Width; - height1 = buffer->Height; - } else { - x1 = x; - y1 = Y_FLIP(y+height-1); - width1 = width; - height1 = height; - } - /* XXX: Scissoring */ + /* get region after locking: */ + x1 = ctx->DrawBuffer->_Xmin; + y1 = ctx->DrawBuffer->_Ymin; + width1 = ctx->DrawBuffer->_Xmax - x1; + height1 = ctx->DrawBuffer->_Ymax - y1; + y1 = Y_FLIP(y1 + height1 - 1); /* Mask out any non-existent buffers */ if (ctx->Visual.depthBits == 0 || !ctx->Depth.Mask) @@ -153,7 +144,7 @@ sisDDClear( GLcontext * ctx, GLbitfield mask, GLboolean all, UNLOCK_HARDWARE(); if (mask != 0) - _swrast_Clear( ctx, mask, all, x1, y1, width, height ); + _swrast_Clear( ctx, mask); } @@ -337,9 +328,7 @@ sis_clear_color_buffer( GLcontext *ctx, GLenum mask, GLint x, GLint y, GLint width, GLint height ) { sisContextPtr smesa = SIS_CONTEXT(ctx); - int count; - GLuint depth = smesa->bytesPerPixel; drm_clip_rect_t *pExtents = NULL; GLint xx, yy; GLint x0, y0, width0, height0; @@ -387,8 +376,6 @@ sis_clear_color_buffer( GLcontext *ctx, GLenum mask, GLint x, GLint y, if (width <= 0 || height <= 0) continue; - int cmd; - mWait3DCmdQueue (8); MMIO(REG_SRC_PITCH, (smesa->bytesPerPixel == 4) ? BLIT_DEPTH_32 : BLIT_DEPTH_16); diff --git a/src/mesa/drivers/dri/sis/sis_screen.c b/src/mesa/drivers/dri/sis/sis_screen.c index 4fd692ec240..8f52cfe098e 100644 --- a/src/mesa/drivers/dri/sis/sis_screen.c +++ b/src/mesa/drivers/dri/sis/sis_screen.c @@ -209,7 +209,7 @@ sisCreateBuffer( __DRIscreenPrivate *driScrnPriv, const __GLcontextModes *mesaVis, GLboolean isPixmap ) { - sisScreenPtr screen = (sisScreenPtr) driScrnPriv->private; + /*sisScreenPtr screen = (sisScreenPtr) driScrnPriv->private;*/ struct gl_framebuffer *fb; if (isPixmap) diff --git a/src/mesa/drivers/dri/sis/sis_state.c b/src/mesa/drivers/dri/sis/sis_state.c index a30001c7462..2a10a5fbf62 100644 --- a/src/mesa/drivers/dri/sis/sis_state.c +++ b/src/mesa/drivers/dri/sis/sis_state.c @@ -861,18 +861,6 @@ void sisDDInitStateFuncs( GLcontext *ctx ) ctx->Driver.LightModelfv = sisDDLightModelfv; ctx->Driver.Viewport = sisDDViewport; - /* Pixel path fallbacks. */ - ctx->Driver.Accum = _swrast_Accum; - ctx->Driver.Bitmap = _swrast_Bitmap; - ctx->Driver.CopyPixels = _swrast_CopyPixels; - ctx->Driver.DrawPixels = _swrast_DrawPixels; - ctx->Driver.ReadPixels = _swrast_ReadPixels; - + /* XXX this should go away */ ctx->Driver.ResizeBuffers = sisReAllocateBuffers; - /* Swrast hooks for imaging extensions: - */ - ctx->Driver.CopyColorTable = _swrast_CopyColorTable; - ctx->Driver.CopyColorSubTable = _swrast_CopyColorSubTable; - ctx->Driver.CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D; - ctx->Driver.CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D; } diff --git a/src/mesa/drivers/dri/sis/sis_state.h b/src/mesa/drivers/dri/sis/sis_state.h index 580a522bf34..8f7e2acb92d 100644 --- a/src/mesa/drivers/dri/sis/sis_state.h +++ b/src/mesa/drivers/dri/sis/sis_state.h @@ -35,15 +35,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "sis_context.h" /* sis6326_clear.c */ -extern void sis6326DDClear( GLcontext *ctx, GLbitfield mask, GLboolean all, - GLint x, GLint y, GLint width, GLint height ); +extern void sis6326DDClear( GLcontext *ctx, GLbitfield mask ); extern void sis6326DDClearColor( GLcontext * ctx, const GLfloat color[4] ); extern void sis6326DDClearDepth( GLcontext * ctx, GLclampd d ); extern void sis6326UpdateZPattern(sisContextPtr smesa, GLclampd z); /* sis_clear.c */ -extern void sisDDClear( GLcontext *ctx, GLbitfield mask, GLboolean all, - GLint x, GLint y, GLint width, GLint height ); +extern void sisDDClear( GLcontext *ctx, GLbitfield mask ); extern void sisDDClearColor( GLcontext * ctx, const GLfloat color[4] ); extern void sisDDClearDepth( GLcontext * ctx, GLclampd d ); extern void sisDDClearStencil( GLcontext * ctx, GLint s ); diff --git a/src/mesa/drivers/dri/tdfx/tdfx_context.c b/src/mesa/drivers/dri/tdfx/tdfx_context.c index dd40544d490..bd9dade89b5 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_context.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_context.c @@ -23,19 +23,14 @@ * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_context.c,v 1.12 2003/05/08 09:25:35 herrb Exp $ */ -/* - * New fixes: - * Daniel Borca , 19 Jul 2004 - * - * Original rewrite: - * Gareth Hughes , 29 Sep - 1 Oct 2000 - * - * Authors: - * Gareth Hughes - * Brian Paul +/** + * \file tdfx_context.c + * Context management functions for 3Dfx hardware. * + * \author Gareth Hughes (original rewrite 29 Sep - 1 Oct 2000) + * \author Brian Paul + * \author Daniel Borca (new fixes 19 Jul 2004) */ #include @@ -65,6 +60,7 @@ #define need_GL_ARB_multisample /* #define need_GL_ARB_point_parameters */ +#define need_GL_ARB_occlusion_query #define need_GL_ARB_texture_compression #define need_GL_ARB_vertex_buffer_object /* #define need_GL_ARB_vertex_program */ @@ -87,6 +83,7 @@ const struct dri_extension card_extensions[] = { { "GL_ARB_multisample", GL_ARB_multisample_functions }, + { "GL_ARB_occlusion_query", GL_ARB_occlusion_query_functions }, { "GL_ARB_texture_mirrored_repeat", NULL }, { "GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions }, @@ -660,8 +657,10 @@ tdfxMakeCurrent( __DRIcontextPrivate *driContextPriv, GLcontext *newCtx = newFx->glCtx; GET_CURRENT_CONTEXT(curCtx); - if ( newFx->driDrawable != driDrawPriv ) { + if ((newFx->driDrawable != driDrawPriv) + || (newFx->driReadable != driReadPriv)) { newFx->driDrawable = driDrawPriv; + newFx->driReadable = driReadPriv; newFx->dirty = ~0; } else { @@ -679,6 +678,11 @@ tdfxMakeCurrent( __DRIcontextPrivate *driContextPriv, newFx->dirty = ~0; } + driUpdateFramebufferSize(newCtx, driDrawPriv); + if (driDrawPriv != driReadPriv) { + driUpdateFramebufferSize(newCtx, driReadPriv); + } + if ( !newFx->Glide.Initialized ) { if ( !tdfxInitContext( driDrawPriv, newFx ) ) return GL_FALSE; diff --git a/src/mesa/drivers/dri/tdfx/tdfx_context.h b/src/mesa/drivers/dri/tdfx/tdfx_context.h index b8349fec73b..89a7a9d6c4e 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_context.h +++ b/src/mesa/drivers/dri/tdfx/tdfx_context.h @@ -895,7 +895,17 @@ struct tdfx_context { /* stuff added for DRI */ __DRIscreenPrivate *driScreen; __DRIcontextPrivate *driContext; - __DRIdrawablePrivate *driDrawable; + + /** + * DRI drawable bound to this context for drawing. + */ + __DRIdrawablePrivate *driDrawable; + + /** + * DRI drawable bound to this context for reading. + */ + __DRIdrawablePrivate *driReadable; + drm_context_t hHWContext; drm_hw_lock_t *driHwLock; int driFd; diff --git a/src/mesa/drivers/dri/tdfx/tdfx_dd.c b/src/mesa/drivers/dri/tdfx/tdfx_dd.c index 3dbd24d49b7..adbe0c0f33f 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_dd.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_dd.c @@ -23,16 +23,13 @@ * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_dd.c,v 1.10 2002/10/30 12:52:00 alanh Exp $ */ -/* - * Original rewrite: - * Gareth Hughes , 29 Sep - 1 Oct 2000 - * - * Authors: - * Gareth Hughes - * Brian Paul - * +/** + * \file tdfx_dd.c + * Device driver interface functions for 3Dfx based cards. + * + * \author Gareth Hughes (Original rewrite 29 Sep - 1 Oct 2000) + * \author Brian Paul */ #include "tdfx_context.h" @@ -41,6 +38,7 @@ #include "tdfx_vb.h" #include "tdfx_pixels.h" +#include "utils.h" #include "context.h" #include "enums.h" #include "framebuffer.h" @@ -50,7 +48,7 @@ #endif -#define TDFX_DATE "20040719" +#define DRIVER_DATE "20061113" /* These are used in calls to FX_grColorMaskv() */ @@ -67,67 +65,40 @@ static const GLubyte *tdfxDDGetString( GLcontext *ctx, GLenum name ) { tdfxContextPtr fxMesa = (tdfxContextPtr) ctx->DriverCtx; - switch ( name ) { + switch (name) { case GL_RENDERER: { /* The renderer string must be per-context state to handle * multihead correctly. */ - char *buffer = fxMesa->rendererString; - char hardware[100]; + char *const buffer = fxMesa->rendererString; + char hardware[64]; LOCK_HARDWARE(fxMesa); - strcpy( hardware, fxMesa->Glide.grGetString(GR_HARDWARE) ); + strncpy(hardware, fxMesa->Glide.grGetString(GR_HARDWARE), + sizeof(hardware)); + hardware[sizeof(hardware) - 1] = '\0'; UNLOCK_HARDWARE(fxMesa); - strcpy( buffer, "Mesa DRI " ); - strcat( buffer, TDFX_DATE ); - strcat( buffer, " " ); - - if ( strcmp( hardware, "Voodoo3 (tm)" ) == 0 ) { - strcat( buffer, "Voodoo3" ); - } - else if ( strcmp( hardware, "Voodoo Banshee (tm)" ) == 0 ) { - strcat( buffer, "VoodooBanshee" ); + if ((strncmp(hardware, "Voodoo3", 7) == 0) + || (strncmp(hardware, "Voodoo4", 7) == 0) + || (strncmp(hardware, "Voodoo5", 7) == 0)) { + hardware[7] = '\0'; } - else if ( strcmp( hardware, "Voodoo4 (tm)" ) == 0 ) { - strcat( buffer, "Voodoo4" ); - } - else if ( strcmp( hardware, "Voodoo5 (tm)" ) == 0 ) { - strcat( buffer, "Voodoo5" ); + else if (strncmp(hardware, "Voodoo Banshee", 14) == 0) { + strcpy(&hardware[6], "Banshee"); } else { /* unexpected result: replace spaces with hyphens */ int i; - for ( i = 0 ; hardware[i] && i < 60 ; i++ ) { - if ( hardware[i] == ' ' || hardware[i] == '\t' ) + for (i = 0; hardware[i] && (i < sizeof(hardware)); i++) { + if (hardware[i] == ' ' || hardware[i] == '\t') { hardware[i] = '-'; + } } - strcat( buffer, hardware ); } - /* Append any CPU-specific information. - */ -#ifdef USE_X86_ASM - if ( _mesa_x86_cpu_features ) { - strncat( buffer, " x86", 4 ); - } -#endif -#ifdef USE_MMX_ASM - if ( cpu_has_mmx ) { - strncat( buffer, "/MMX", 4 ); - } -#endif -#ifdef USE_3DNOW_ASM - if ( cpu_has_3dnow ) { - strncat( buffer, "/3DNow!", 7 ); - } -#endif -#ifdef USE_SSE_ASM - if ( cpu_has_xmm ) { - strncat( buffer, "/SSE", 4 ); - } -#endif + (void) driGetRendererString(buffer, hardware, DRIVER_DATE, 0); return (const GLubyte *) buffer; } case GL_VENDOR: @@ -138,18 +109,52 @@ static const GLubyte *tdfxDDGetString( GLcontext *ctx, GLenum name ) } -/* Return uptodate buffer size information. - */ -static void tdfxDDGetBufferSize( GLframebuffer *buffer, - GLuint *width, GLuint *height ) +static void +tdfxBeginQuery(GLcontext *ctx, GLenum target, struct gl_query_object *q) +{ + tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx); + + (void) q; + + if (target == GL_SAMPLES_PASSED_ARB) { + LOCK_HARDWARE(fxMesa); + fxMesa->Glide.grFinish(); + fxMesa->Glide.grReset(GR_STATS_PIXELS); + UNLOCK_HARDWARE(fxMesa); + } +} + + +static void +tdfxEndQuery(GLcontext *ctx, GLenum target, struct gl_query_object *q) { - GET_CURRENT_CONTEXT(ctx); tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx); + FxI32 total_pixels; + FxI32 z_fail_pixels; + - LOCK_HARDWARE( fxMesa ); - *width = fxMesa->width; - *height = fxMesa->height; - UNLOCK_HARDWARE( fxMesa ); + if (target == GL_SAMPLES_PASSED_ARB) { + LOCK_HARDWARE(fxMesa); + fxMesa->Glide.grFinish(); + + fxMesa->Glide.grGet(GR_STATS_PIXELS_DEPTHFUNC_FAIL, sizeof(FxI32), + &z_fail_pixels); + fxMesa->Glide.grGet(GR_STATS_PIXELS_IN, sizeof(FxI32), &total_pixels); + + q->Result = total_pixels - z_fail_pixels; + + /* Apparently, people have seen z_fail_pixels > total_pixels under + * some conditions on some 3Dfx hardware. The occlusion query spec + * requires that we clamp to 0. + */ + if (q->Result < 0) { + q->Result = 0; + } + + q->Ready = GL_TRUE; + + UNLOCK_HARDWARE(fxMesa); + } } @@ -166,9 +171,9 @@ void tdfxDDInitDriverFuncs( const __GLcontextModes *visual, fprintf( stderr, "tdfx: %s()\n", __FUNCTION__ ); } - functions->GetString = tdfxDDGetString; - functions->GetBufferSize = tdfxDDGetBufferSize; - functions->ResizeBuffers = _mesa_resize_framebuffer; + functions->GetString = tdfxDDGetString; + functions->BeginQuery = tdfxBeginQuery; + functions->EndQuery = tdfxEndQuery; /* Accelerated paths */ diff --git a/src/mesa/drivers/dri/tdfx/tdfx_lock.c b/src/mesa/drivers/dri/tdfx/tdfx_lock.c index ae3ba1a8321..a20c91d030a 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_lock.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_lock.c @@ -47,16 +47,20 @@ void tdfxGetLock( tdfxContextPtr fxMesa ) { __DRIcontextPrivate *cPriv = fxMesa->driContext; - __DRIdrawablePrivate *dPriv = cPriv->driDrawablePriv; - __DRIscreenPrivate *sPriv = dPriv->driScreenPriv; + __DRIdrawablePrivate *const drawable = cPriv->driDrawablePriv; + __DRIdrawablePrivate *const readable = cPriv->driReadablePriv; + __DRIscreenPrivate *sPriv = drawable->driScreenPriv; TDFXSAREAPriv *saPriv = (TDFXSAREAPriv *) (((char *) sPriv->pSAREA) + fxMesa->fxScreen->sarea_priv_offset); - unsigned int stamp = dPriv->lastStamp; + unsigned int stamp = drawable->lastStamp; drmGetLock( fxMesa->driFd, fxMesa->hHWContext, 0 ); - /* This macro will update dPriv's cliprects if needed */ - DRI_VALIDATE_DRAWABLE_INFO( sPriv, dPriv ); + /* This macro will update drawable's cliprects if needed */ + DRI_VALIDATE_DRAWABLE_INFO(sPriv, drawable); + if (drawable != readable) { + DRI_VALIDATE_DRAWABLE_INFO(sPriv, readable); + } if ( saPriv->fifoOwner != fxMesa->hHWContext ) { fxMesa->Glide.grDRIImportFifo( saPriv->fifoPtr, saPriv->fifoRead ); @@ -83,10 +87,15 @@ void tdfxGetLock( tdfxContextPtr fxMesa ) } #endif - if ( *dPriv->pStamp != stamp || saPriv->ctxOwner != fxMesa->hHWContext ) { + if ((*drawable->pStamp != stamp) + || (saPriv->ctxOwner != fxMesa->hHWContext)) { + driUpdateFramebufferSize(fxMesa->glCtx, drawable); + if (drawable != readable) { + driUpdateFramebufferSize(fxMesa->glCtx, readable); + } + tdfxUpdateClipping(fxMesa->glCtx); tdfxUploadClipping(fxMesa); - driUpdateFramebufferSize(fxMesa->glCtx, dPriv); } DEBUG_LOCK(); diff --git a/src/mesa/drivers/dri/tdfx/tdfx_pixels.c b/src/mesa/drivers/dri/tdfx/tdfx_pixels.c index 1a5a2b11090..732270b2bd3 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_pixels.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_pixels.c @@ -496,9 +496,9 @@ tdfx_readpixels_R5G6B5(GLcontext * ctx, GLint x, GLint y, { tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx); GrLfbInfo_t info; - - const GLint winX = fxMesa->x_offset; - const GLint winY = fxMesa->y_offset + fxMesa->height - 1; + __DRIdrawablePrivate *const readable = fxMesa->driReadable; + const GLint winX = readable->x; + const GLint winY = readable->y + readable->h - 1; const GLint scrX = winX + x; const GLint scrY = winY - y; @@ -554,9 +554,9 @@ tdfx_readpixels_R8G8B8A8(GLcontext * ctx, GLint x, GLint y, { tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx); GrLfbInfo_t info; - - const GLint winX = fxMesa->x_offset; - const GLint winY = fxMesa->y_offset + fxMesa->height - 1; + __DRIdrawablePrivate *const readable = fxMesa->driReadable; + const GLint winX = readable->x; + const GLint winY = readable->y + readable->h - 1; const GLint scrX = winX + x; const GLint scrY = winY - y; diff --git a/src/mesa/drivers/dri/tdfx/tdfx_render.c b/src/mesa/drivers/dri/tdfx/tdfx_render.c index a30ec78a558..f36c97bfebe 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_render.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_render.c @@ -46,9 +46,7 @@ /* Clear the color and/or depth buffers. */ -static void tdfxClear( GLcontext *ctx, - GLbitfield mask, GLboolean all, - GLint x, GLint y, GLint width, GLint height ) +static void tdfxClear( GLcontext *ctx, GLbitfield mask ) { tdfxContextPtr fxMesa = (tdfxContextPtr) ctx->DriverCtx; GLbitfield softwareMask = mask & (BUFFER_BIT_ACCUM); @@ -56,8 +54,7 @@ static void tdfxClear( GLcontext *ctx, fxMesa->haveHwStencil ? fxMesa->glCtx->Visual.stencilBits : 0; if ( TDFX_DEBUG & DEBUG_VERBOSE_API ) { - fprintf( stderr, "%s( %d, %d, %d, %d )\n", - __FUNCTION__, (int) x, (int) y, (int) width, (int) height ); + fprintf( stderr, "tdfxClear(0x%x)\n", mask); } /* Need this check to respond to glScissor and clipping updates */ @@ -313,7 +310,7 @@ static void tdfxClear( GLcontext *ctx, } if (softwareMask) - _swrast_Clear( ctx, softwareMask, all, x, y, width, height ); + _swrast_Clear(ctx, softwareMask); } diff --git a/src/mesa/drivers/dri/tdfx/tdfx_screen.c b/src/mesa/drivers/dri/tdfx/tdfx_screen.c index 0a4499cfae7..646f5126eb0 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_screen.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_screen.c @@ -73,6 +73,9 @@ tdfxCreateScreen( __DRIscreenPrivate *sPriv ) { tdfxScreenPrivate *fxScreen; TDFXDRIPtr fxDRIPriv = (TDFXDRIPtr) sPriv->pDevPriv; + PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension = + (PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension")); + void *const psc = sPriv->psc->screenConfigs; if (sPriv->devPrivSize != sizeof(TDFXDRIRec)) { fprintf(stderr,"\nERROR! sizeof(TDFXDRIRec) does not match passed size from device driver\n"); @@ -113,6 +116,10 @@ tdfxCreateScreen( __DRIscreenPrivate *sPriv ) return GL_FALSE; } + if (glx_enable_extension != NULL) { + (*glx_enable_extension)(psc, "GLX_SGI_make_current_read"); + } + return GL_TRUE; } @@ -180,6 +187,7 @@ tdfxCreateBuffer( __DRIscreenPrivate *driScrnPriv, driDrawPriv); tdfxSetSpanFunctions(backRb, mesaVis); _mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &backRb->Base); + backRb->backBuffer = GL_TRUE; } if (mesaVis->depthBits == 16) { @@ -265,7 +273,9 @@ tdfxSwapBuffers( __DRIdrawablePrivate *driDrawPriv ) return; LOCK_HARDWARE( fxMesa ); fxMesa->Glide.grSstSelect( fxMesa->Glide.Board ); +#ifdef DEBUG printf("SwapBuf SetState 1\n"); +#endif fxMesa->Glide.grGlideSetState(fxMesa->Glide.State ); } } @@ -325,7 +335,9 @@ tdfxSwapBuffers( __DRIdrawablePrivate *driDrawPriv ) if (ctx->DriverCtx != fxMesa) { fxMesa = TDFX_CONTEXT(ctx); fxMesa->Glide.grSstSelect( fxMesa->Glide.Board ); +#ifdef DEBUG printf("SwapBuf SetState 2\n"); +#endif fxMesa->Glide.grGlideSetState(fxMesa->Glide.State ); } UNLOCK_HARDWARE( fxMesa ); @@ -393,7 +405,7 @@ static __GLcontextModes *tdfxFillInModes(unsigned pixel_bits, m->accumRedBits = accum ? 16 : 0; m->accumGreenBits = accum ? 16 : 0; m->accumBlueBits = accum ? 16 : 0; - m->accumAlphaBits = accum ? 16 : 0; + m->accumAlphaBits = (accum && deep) ? 16 : 0; m->stencilBits = stencil ? 8 : 0; m->depthBits = deep ? (depth ? 24 : 0) diff --git a/src/mesa/drivers/dri/tdfx/tdfx_span.c b/src/mesa/drivers/dri/tdfx/tdfx_span.c index ce895f82542..d9d52d2b6f5 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_span.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_span.c @@ -47,21 +47,19 @@ #define LOCAL_VARS \ - __DRIdrawablePrivate *dPriv = fxMesa->driDrawable; \ - tdfxScreenPrivate *fxPriv = fxMesa->fxScreen; \ - GLboolean isFront = (ctx->DrawBuffer->_ColorDrawBufferMask[0] \ - == BUFFER_BIT_FRONT_LEFT); \ - GLuint pitch = isFront ? (fxMesa->screen_width * BYTESPERPIXEL) \ - : info.strideInBytes; \ - GLuint height = fxMesa->height; \ + driRenderbuffer *drb = (driRenderbuffer *) rb; \ + __DRIdrawablePrivate *const dPriv = drb->dPriv; \ + GLuint pitch = drb->backBuffer ? info.strideInBytes \ + : (drb->pitch * drb->cpp); \ + const GLuint bottom = dPriv->h - 1; \ char *buf = (char *)((char *)info.lfbPtr + \ - dPriv->x * fxPriv->cpp + \ - dPriv->y * pitch); \ + (dPriv->x * drb->cpp) + \ + (dPriv->y * pitch)); \ GLuint p; \ (void) buf; (void) p; -#define Y_FLIP(_y) (height - _y - 1) +#define Y_FLIP(_y) (bottom - _y) #define HW_WRITE_LOCK() \ @@ -71,10 +69,9 @@ UNLOCK_HARDWARE( fxMesa ); \ LOCK_HARDWARE( fxMesa ); \ info.size = sizeof(GrLfbInfo_t); \ - if ( fxMesa->Glide.grLfbLock( GR_LFB_WRITE_ONLY, \ - fxMesa->DrawBuffer, LFB_MODE, \ - GR_ORIGIN_UPPER_LEFT, FXFALSE, &info ) ) \ - { + if (fxMesa->Glide.grLfbLock(GR_LFB_WRITE_ONLY, fxMesa->DrawBuffer, \ + LFB_MODE, GR_ORIGIN_UPPER_LEFT, FXFALSE, \ + &info)) { #define HW_WRITE_UNLOCK() \ fxMesa->Glide.grLfbUnlock( GR_LFB_WRITE_ONLY, fxMesa->DrawBuffer );\ @@ -976,7 +973,7 @@ tdfxDDWriteDepthPixels(GLcontext * ctx, struct gl_renderbuffer *rb, GetFbParams(fxMesa, &info, &backBufferInfo, &ReadParams, sizeof(GLushort)); for (i = 0; i < n; i++) { - if (mask[i] && visible_pixel(fxMesa, x[i], y[i])) { + if ((!mask || mask[i]) && visible_pixel(fxMesa, x[i], y[i])) { xpos = x[i] + fxMesa->x_offset; ypos = bottom - y[i]; d16 = depth[i]; @@ -1000,7 +997,7 @@ tdfxDDWriteDepthPixels(GLcontext * ctx, struct gl_renderbuffer *rb, GetFbParams(fxMesa, &info, &backBufferInfo, &ReadParams, sizeof(GLuint)); for (i = 0; i < n; i++) { - if (mask[i]) { + if (!mask || mask[i]) { if (visible_pixel(fxMesa, x[i], y[i])) { xpos = x[i] + fxMesa->x_offset; ypos = bottom - y[i]; diff --git a/src/mesa/drivers/dri/tdfx/tdfx_state.c b/src/mesa/drivers/dri/tdfx/tdfx_state.c index a389273b2f0..59e6549e5ef 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_state.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_state.c @@ -1400,19 +1400,15 @@ void tdfxDDInitStateFuncs( GLcontext *ctx ) ctx->Driver.UpdateState = tdfxDDInvalidateState; - - /* State notification callbacks: - */ ctx->Driver.ClearColor = tdfxDDClearColor; ctx->Driver.DrawBuffer = tdfxDDDrawBuffer; ctx->Driver.ReadBuffer = tdfxDDReadBuffer; - ctx->Driver.ColorMask = tdfxDDColorMask; - ctx->Driver.AlphaFunc = tdfxDDAlphaFunc; ctx->Driver.BlendEquationSeparate = tdfxDDBlendEquationSeparate; ctx->Driver.BlendFuncSeparate = tdfxDDBlendFuncSeparate; ctx->Driver.ClearDepth = tdfxDDClearDepth; + ctx->Driver.ColorMask = tdfxDDColorMask; ctx->Driver.CullFace = tdfxDDCullFace; ctx->Driver.FrontFace = tdfxDDFrontFace; ctx->Driver.DepthFunc = tdfxDDDepthFunc; @@ -1434,11 +1430,4 @@ void tdfxDDInitStateFuncs( GLcontext *ctx ) } ctx->Driver.Viewport = tdfxDDViewport; - - /* Swrast hooks for imaging extensions: - */ - ctx->Driver.CopyColorTable = _swrast_CopyColorTable; - ctx->Driver.CopyColorSubTable = _swrast_CopyColorSubTable; - ctx->Driver.CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D; - ctx->Driver.CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D; } diff --git a/src/mesa/drivers/dri/tdfx/tdfx_tex.c b/src/mesa/drivers/dri/tdfx/tdfx_tex.c index 862c7dacf1f..89865d96379 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_tex.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_tex.c @@ -41,6 +41,7 @@ #include "enums.h" #include "image.h" +#include "mipmap.h" #include "texcompress.h" #include "texformat.h" #include "teximage.h" @@ -593,13 +594,11 @@ tdfxIsTextureResident(GLcontext *ctx, struct gl_texture_object *tObj) static GrTexTable_t convertPalette(FxU32 data[256], const struct gl_color_table *table) { - const GLubyte *tableUB = (const GLubyte *) table->Table; + const GLubyte *tableUB = table->TableUB; GLint width = table->Size; FxU32 r, g, b, a; GLint i; - ASSERT(table->Type == GL_UNSIGNED_BYTE); - switch (table->_BaseFormat) { case GL_INTENSITY: for (i = 0; i < width; i++) { @@ -671,7 +670,7 @@ tdfxUpdateTexturePalette(GLcontext * ctx, struct gl_texture_object *tObj) tdfxTexInfo *ti; /* This might be a proxy texture. */ - if (!tObj->Palette.Table) + if (!tObj->Palette.TableUB) return; if (!tObj->DriverData) @@ -1405,7 +1404,6 @@ tdfxTexImage2D(GLcontext *ctx, GLenum target, GLint level, GLint mipWidth, mipHeight; tdfxMipMapLevel *mip; struct gl_texture_image *mipImage; - const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; const GLint maxLevels = _mesa_max_texture_levels(ctx, texObj->Target); assert(!texImage->IsCompressed); @@ -1426,7 +1424,7 @@ tdfxTexImage2D(GLcontext *ctx, GLenum target, GLint level, mipWidth, mipHeight, border, format, type, NULL); - mipImage = _mesa_select_tex_image(ctx, texUnit, target, level); + mipImage = _mesa_select_tex_image(ctx, texObj, target, level); mip = TDFX_TEXIMAGE_DATA(mipImage); _mesa_halve2x2_teximage2d(ctx, texImage, @@ -1515,7 +1513,6 @@ tdfxTexSubImage2D(GLcontext *ctx, GLenum target, GLint level, GLint mipWidth, mipHeight; tdfxMipMapLevel *mip; struct gl_texture_image *mipImage; - const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; const GLint maxLevels = _mesa_max_texture_levels(ctx, texObj->Target); assert(!texImage->IsCompressed); @@ -1535,7 +1532,7 @@ tdfxTexSubImage2D(GLcontext *ctx, GLenum target, GLint level, break; } ++level; - mipImage = _mesa_select_tex_image(ctx, texUnit, target, level); + mipImage = _mesa_select_tex_image(ctx, texObj, target, level); mip = TDFX_TEXIMAGE_DATA(mipImage); _mesa_halve2x2_teximage2d(ctx, texImage, @@ -1758,7 +1755,7 @@ tdfxCompressedTexSubImage2D( GLcontext *ctx, GLenum target, for (i = 0; i < rows; i++) { MEMCPY(dest, data, srcRowStride); dest += destRowStride; - data = (GLvoid *)((GLuint)data + (GLuint)srcRowStride); + data = (GLvoid *)((intptr_t)data + (intptr_t)srcRowStride); } /* [dBorca] Hack alert: diff --git a/src/mesa/drivers/dri/tdfx/tdfx_texstate.c b/src/mesa/drivers/dri/tdfx/tdfx_texstate.c index f5f385fad7c..fda9ce56849 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_texstate.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_texstate.c @@ -1015,9 +1015,12 @@ SetupSingleTexEnvVoodoo3(GLcontext *ctx, int unit, } break; - default: + default: { + (void) memcpy(&colorComb, &fxMesa->ColorCombine, sizeof(colorComb)); + (void) memcpy(&alphaComb, &fxMesa->AlphaCombine, sizeof(alphaComb)); _mesa_problem(ctx, "bad texture env mode in %s", __FUNCTION__); } + } if (colorComb.Function != fxMesa->ColorCombine.Function || colorComb.Factor != fxMesa->ColorCombine.Factor || diff --git a/src/mesa/drivers/dri/trident/trident_context.c b/src/mesa/drivers/dri/trident/trident_context.c index 9c8f7ef01f3..d3806586475 100644 --- a/src/mesa/drivers/dri/trident/trident_context.c +++ b/src/mesa/drivers/dri/trident/trident_context.c @@ -50,6 +50,7 @@ #include "drivers/common/driverfuncs.h" #include "dri_util.h" +#include "utils.h" static const struct tnl_pipeline_stage *trident_pipeline[] = { &_tnl_vertex_transform_stage, diff --git a/src/mesa/drivers/dri/trident/trident_dd.c b/src/mesa/drivers/dri/trident/trident_dd.c index 8c3af200166..4639b3a15e7 100644 --- a/src/mesa/drivers/dri/trident/trident_dd.c +++ b/src/mesa/drivers/dri/trident/trident_dd.c @@ -104,24 +104,7 @@ void tridentDDInitExtensions( GLcontext *ctx ) */ void tridentDDInitDriverFuncs( GLcontext *ctx ) { - ctx->Driver.GetBufferSize = tridentDDGetBufferSize; - ctx->Driver.GetString = tridentDDGetString; - - ctx->Driver.Error = NULL; - - /* Pixel path fallbacks - */ - ctx->Driver.Accum = _swrast_Accum; - ctx->Driver.Bitmap = _swrast_Bitmap; - ctx->Driver.CopyPixels = _swrast_CopyPixels; - ctx->Driver.DrawPixels = _swrast_DrawPixels; - ctx->Driver.ReadPixels = _swrast_ReadPixels; - ctx->Driver.ResizeBuffers = _mesa_resize_framebuffer; - - /* Swrast hooks for imaging extensions: - */ - ctx->Driver.CopyColorTable = _swrast_CopyColorTable; - ctx->Driver.CopyColorSubTable = _swrast_CopyColorSubTable; - ctx->Driver.CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D; - ctx->Driver.CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D; + ctx->Driver.GetBufferSize = tridentDDGetBufferSize; + ctx->Driver.GetString = tridentDDGetString; + ctx->Driver.Error = NULL; } diff --git a/src/mesa/drivers/dri/trident/trident_state.c b/src/mesa/drivers/dri/trident/trident_state.c index e0b7a452243..037cce5f862 100644 --- a/src/mesa/drivers/dri/trident/trident_state.c +++ b/src/mesa/drivers/dri/trident/trident_state.c @@ -150,14 +150,14 @@ void tridentCopyBuffer( const __DRIdrawablePrivate *dPriv ) } -static void tridentDDClear( GLcontext *ctx, GLbitfield mask, GLboolean all, - GLint cx, GLint cy, GLint cw, GLint ch ) +static void tridentDDClear( GLcontext *ctx, GLbitfield mask ) { tridentContextPtr tmesa = TRIDENT_CONTEXT(ctx); unsigned char *MMIO = tmesa->tridentScreen->mmio.map; int busy; GLuint flags = 0; GLint i; + GLint cx, cy, cw, ch; #define DRM_TRIDENT_FRONT 0x01 #define DRM_TRIDENT_BACK 0x02 @@ -183,6 +183,12 @@ static void tridentDDClear( GLcontext *ctx, GLbitfield mask, GLboolean all, LOCK_HARDWARE(tmesa); + /* get region after locking: */ + cx = ctx->DrawBuffer->_Xmin; + cy = ctx->DrawBuffer->_Ymin; + cw = ctx->DrawBuffer->_Xmax - cx; + ch = ctx->DrawBuffer->_Ymax - cy; + if ( flags ) { cx += tmesa->drawX; @@ -290,7 +296,7 @@ if (flags & DRM_TRIDENT_FRONT) { UNLOCK_HARDWARE(tmesa); if ( mask ) - _swrast_Clear( ctx, mask, all, cx, cy, cw, ch ); + _swrast_Clear( ctx, mask ); } static void tridentDDShadeModel( GLcontext *ctx, GLenum mode ) @@ -539,20 +545,4 @@ void tridentDDInitStateFuncs( GLcontext *ctx ) ctx->Driver.DepthRange = tridentDDDepthRange; ctx->Driver.ShadeModel = tridentDDShadeModel; ctx->Driver.Viewport = tridentDDViewport; - - /* Pixel path fallbacks. - */ - ctx->Driver.Accum = _swrast_Accum; - ctx->Driver.Bitmap = _swrast_Bitmap; - ctx->Driver.CopyPixels = _swrast_CopyPixels; - ctx->Driver.DrawPixels = _swrast_DrawPixels; - ctx->Driver.ReadPixels = _swrast_ReadPixels; - ctx->Driver.ResizeBuffers = _mesa_resize_framebuffer; - - /* Swrast hooks for imaging extensions: - */ - ctx->Driver.CopyColorTable = _swrast_CopyColorTable; - ctx->Driver.CopyColorSubTable = _swrast_CopyColorSubTable; - ctx->Driver.CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D; - ctx->Driver.CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D; } diff --git a/src/mesa/drivers/dri/unichrome/via_context.c b/src/mesa/drivers/dri/unichrome/via_context.c index ffde1b66b76..49c24656551 100644 --- a/src/mesa/drivers/dri/unichrome/via_context.c +++ b/src/mesa/drivers/dri/unichrome/via_context.c @@ -147,10 +147,13 @@ viaRenderbufferStorage(GLcontext *ctx, struct gl_renderbuffer *rb, static void -viaInitRenderbuffer(struct gl_renderbuffer *rb, GLenum format) +viaInitRenderbuffer(struct via_renderbuffer *vrb, GLenum format, + __DRIdrawablePrivate *dPriv) { const GLuint name = 0; + struct gl_renderbuffer *rb = & vrb->Base; + vrb->dPriv = dPriv; _mesa_init_renderbuffer(rb, name); /* Make sure we're using a null-valued GetPointer routine */ @@ -198,8 +201,9 @@ viaInitRenderbuffer(struct gl_renderbuffer *rb, GLenum format) * \sa AllocateBuffer */ static GLboolean -calculate_buffer_parameters( struct via_context *vmesa, - struct gl_framebuffer *fb ) +calculate_buffer_parameters(struct via_context *vmesa, + struct gl_framebuffer *fb, + __DRIdrawablePrivate *dPriv) { const unsigned shift = vmesa->viaScreen->bitsPerPixel / 16; const unsigned extra = 32; @@ -215,26 +219,28 @@ calculate_buffer_parameters( struct via_context *vmesa, if (!vmesa->front.Base.InternalFormat) { /* do one-time init for the renderbuffers */ - viaInitRenderbuffer(&vmesa->front.Base, GL_RGBA); + viaInitRenderbuffer(&vmesa->front, GL_RGBA, dPriv); viaSetSpanFunctions(&vmesa->front, &fb->Visual); _mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &vmesa->front.Base); if (fb->Visual.doubleBufferMode) { - viaInitRenderbuffer(&vmesa->back.Base, GL_RGBA); + viaInitRenderbuffer(&vmesa->back, GL_RGBA, dPriv); viaSetSpanFunctions(&vmesa->back, &fb->Visual); _mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &vmesa->back.Base); } if (vmesa->glCtx->Visual.depthBits > 0) { - viaInitRenderbuffer(&vmesa->depth.Base, + viaInitRenderbuffer(&vmesa->depth, (vmesa->glCtx->Visual.depthBits == 16 - ? GL_DEPTH_COMPONENT16 : GL_DEPTH_COMPONENT24)); + ? GL_DEPTH_COMPONENT16 : GL_DEPTH_COMPONENT24), + dPriv); viaSetSpanFunctions(&vmesa->depth, &fb->Visual); _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &vmesa->depth.Base); } if (vmesa->glCtx->Visual.stencilBits > 0) { - viaInitRenderbuffer(&vmesa->stencil.Base, GL_STENCIL_INDEX8_EXT); + viaInitRenderbuffer(&vmesa->stencil, GL_STENCIL_INDEX8_EXT, + dPriv); viaSetSpanFunctions(&vmesa->stencil, &fb->Visual); _mesa_add_renderbuffer(fb, BUFFER_STENCIL, &vmesa->stencil.Base); } @@ -243,11 +249,9 @@ calculate_buffer_parameters( struct via_context *vmesa, assert(vmesa->front.Base.InternalFormat); assert(vmesa->front.Base.AllocStorage); if (fb->Visual.doubleBufferMode) { - assert(fb->Attachment[BUFFER_BACK_LEFT].Renderbuffer); - assert(vmesa->front.Base.AllocStorage); + assert(vmesa->back.Base.AllocStorage); } if (fb->Visual.depthBits) { - assert(fb->Attachment[BUFFER_DEPTH].Renderbuffer); assert(vmesa->depth.Base.AllocStorage); } @@ -352,19 +356,11 @@ void viaReAllocateBuffers(GLcontext *ctx, GLframebuffer *drawbuffer, { struct via_context *vmesa = VIA_CONTEXT(ctx); - calculate_buffer_parameters( vmesa, drawbuffer ); + calculate_buffer_parameters(vmesa, drawbuffer, vmesa->driDrawable); _mesa_resize_framebuffer(ctx, drawbuffer, width, height); } -static void viaBufferSize(GLframebuffer *buffer, GLuint *width, GLuint *height) -{ - GET_CURRENT_CONTEXT(ctx); - struct via_context *vmesa = VIA_CONTEXT(ctx); - *width = vmesa->driDrawable->w; - *height = vmesa->driDrawable->h; -} - /* Extension strings exported by the Unichrome driver. */ const struct dri_extension card_extensions[] = @@ -481,7 +477,7 @@ viaCreateContext(const __GLcontextModes *visual, /* Parse configuration files. */ driParseConfigFiles (&vmesa->optionCache, &viaScreen->optionCache, - sPriv->myNum, "via"); + sPriv->myNum, "unichrome"); /* pick back buffer */ vmesa->hasBack = visual->doubleBufferMode; @@ -557,8 +553,12 @@ viaCreateContext(const __GLcontextModes *visual, driContextPriv->driverPrivate = vmesa; ctx = vmesa->glCtx; - - ctx->Const.MaxTextureLevels = 10; + + if (driQueryOptionb(&vmesa->optionCache, "excess_mipmap")) + ctx->Const.MaxTextureLevels = 11; + else + ctx->Const.MaxTextureLevels = 10; + ctx->Const.MaxTextureUnits = 2; ctx->Const.MaxTextureImageUnits = ctx->Const.MaxTextureUnits; ctx->Const.MaxTextureCoordUnits = ctx->Const.MaxTextureUnits; @@ -575,8 +575,6 @@ viaCreateContext(const __GLcontextModes *visual, ctx->Const.MaxPointSizeAA = 1.0; ctx->Const.PointSizeGranularity = 1.0; - ctx->Driver.GetBufferSize = viaBufferSize; -/* ctx->Driver.ResizeBuffers = _swrast_alloc_buffers; *//* FIXME ?? */ ctx->Driver.GetString = viaGetString; ctx->DriverCtx = (void *)vmesa; @@ -657,20 +655,14 @@ viaCreateContext(const __GLcontextModes *visual, VIA_DEBUG = driParseDebugString( getenv( "VIA_DEBUG" ), debug_control ); - if (getenv("VIA_NO_RAST")) + if (getenv("VIA_NO_RAST") || + driQueryOptionb(&vmesa->optionCache, "no_rast")) FALLBACK(vmesa, VIA_FALLBACK_USER_DISABLE, 1); - /* I don't understand why this isn't working: - */ vmesa->vblank_flags = vmesa->viaScreen->irqEnabled ? driGetDefaultVBlankFlags(&vmesa->optionCache) : VBLANK_FLAG_NO_IRQ; - /* Hack this up in its place: - */ - vmesa->vblank_flags = (getenv("VIA_VSYNC") ? - VBLANK_FLAG_SYNC : VBLANK_FLAG_NO_IRQ); - if (getenv("VIA_PAGEFLIP")) vmesa->allowPageFlip = 1; @@ -728,57 +720,81 @@ viaDestroyContext(__DRIcontextPrivate *driContextPriv) assert (is_empty_list(&vmesa->tex_image_list[VIA_MEM_SYSTEM])); assert (is_empty_list(&vmesa->freed_tex_buffers)); - FREE(vmesa); + driDestroyOptionCache(&vmesa->optionCache); + + FREE(vmesa); } } void viaXMesaWindowMoved(struct via_context *vmesa) { - __DRIdrawablePrivate *dPriv = vmesa->driDrawable; + __DRIdrawablePrivate *const drawable = vmesa->driDrawable; + __DRIdrawablePrivate *const readable = vmesa->driReadable; + struct via_renderbuffer *const draw_buffer = + (struct via_renderbuffer *) drawable->driverPrivate; + struct via_renderbuffer *const read_buffer = + (struct via_renderbuffer *) readable->driverPrivate; GLuint bytePerPixel = vmesa->viaScreen->bitsPerPixel >> 3; - if (!dPriv) + if (!drawable) return; switch (vmesa->glCtx->DrawBuffer->_ColorDrawBufferMask[0]) { case BUFFER_BIT_BACK_LEFT: - if (dPriv->numBackClipRects == 0) { - vmesa->numClipRects = dPriv->numClipRects; - vmesa->pClipRects = dPriv->pClipRects; + if (drawable->numBackClipRects == 0) { + vmesa->numClipRects = drawable->numClipRects; + vmesa->pClipRects = drawable->pClipRects; } else { - vmesa->numClipRects = dPriv->numBackClipRects; - vmesa->pClipRects = dPriv->pBackClipRects; + vmesa->numClipRects = drawable->numBackClipRects; + vmesa->pClipRects = drawable->pBackClipRects; } break; case BUFFER_BIT_FRONT_LEFT: - vmesa->numClipRects = dPriv->numClipRects; - vmesa->pClipRects = dPriv->pClipRects; + vmesa->numClipRects = drawable->numClipRects; + vmesa->pClipRects = drawable->pClipRects; break; default: vmesa->numClipRects = 0; break; } - if (vmesa->drawW != dPriv->w || - vmesa->drawH != dPriv->h) - calculate_buffer_parameters( vmesa, vmesa->glCtx->DrawBuffer ); + if ((draw_buffer->drawW != drawable->w) + || (draw_buffer->drawH != drawable->h)) { + calculate_buffer_parameters(vmesa, vmesa->glCtx->DrawBuffer, + drawable); + } - vmesa->drawXoff = (GLuint)(((dPriv->x * bytePerPixel) & 0x1f) / + draw_buffer->drawXoff = (GLuint)(((drawable->x * bytePerPixel) & 0x1f) / bytePerPixel); - vmesa->drawX = dPriv->x - vmesa->drawXoff; - vmesa->drawY = dPriv->y; - vmesa->drawW = dPriv->w; - vmesa->drawH = dPriv->h; + draw_buffer->drawX = drawable->x - draw_buffer->drawXoff; + draw_buffer->drawY = drawable->y; + draw_buffer->drawW = drawable->w; + draw_buffer->drawH = drawable->h; + + if (drawable != readable) { + if ((read_buffer->drawW != readable->w) + || (read_buffer->drawH != readable->h)) { + calculate_buffer_parameters(vmesa, vmesa->glCtx->ReadBuffer, + readable); + } + + read_buffer->drawXoff = (GLuint)(((readable->x * bytePerPixel) & 0x1f) / + bytePerPixel); + read_buffer->drawX = readable->x - read_buffer->drawXoff; + read_buffer->drawY = readable->y; + read_buffer->drawW = readable->w; + read_buffer->drawH = readable->h; + } vmesa->front.orig = (vmesa->front.offset + - vmesa->drawY * vmesa->front.pitch + - vmesa->drawX * bytePerPixel); + draw_buffer->drawY * vmesa->front.pitch + + draw_buffer->drawX * bytePerPixel); vmesa->front.origMap = (vmesa->front.map + - vmesa->drawY * vmesa->front.pitch + - vmesa->drawX * bytePerPixel); + draw_buffer->drawY * vmesa->front.pitch + + draw_buffer->drawX * bytePerPixel); vmesa->back.orig = vmesa->back.offset; vmesa->depth.orig = vmesa->depth.offset; @@ -814,14 +830,41 @@ viaMakeCurrent(__DRIcontextPrivate *driContextPriv, drawBuffer = (GLframebuffer *)driDrawPriv->driverPrivate; readBuffer = (GLframebuffer *)driReadPriv->driverPrivate; - if ( vmesa->driDrawable != driDrawPriv ) { - driDrawableInitVBlank( driDrawPriv, vmesa->vblank_flags ); - vmesa->driDrawable = driDrawPriv; - if ( ! calculate_buffer_parameters( vmesa, drawBuffer ) ) { - return GL_FALSE; - } + if (vmesa->driDrawable != driDrawPriv) { + driDrawableInitVBlank(driDrawPriv, vmesa->vblank_flags, + &vmesa->vbl_seq); } + if ((vmesa->driDrawable != driDrawPriv) + || (vmesa->driReadable != driReadPriv)) { + vmesa->driDrawable = driDrawPriv; + vmesa->driReadable = driReadPriv; + + if ((drawBuffer->Width != driDrawPriv->w) + || (drawBuffer->Height != driDrawPriv->h)) { + _mesa_resize_framebuffer(ctx, drawBuffer, + driDrawPriv->w, driDrawPriv->h); + drawBuffer->Initialized = GL_TRUE; + } + + if (!calculate_buffer_parameters(vmesa, drawBuffer, driDrawPriv)) { + return GL_FALSE; + } + + if (driDrawPriv != driReadPriv) { + if ((readBuffer->Width != driReadPriv->w) + || (readBuffer->Height != driReadPriv->h)) { + _mesa_resize_framebuffer(ctx, readBuffer, + driReadPriv->w, driReadPriv->h); + readBuffer->Initialized = GL_TRUE; + } + + if (!calculate_buffer_parameters(vmesa, readBuffer, driReadPriv)) { + return GL_FALSE; + } + } + } + _mesa_make_current(vmesa->glCtx, drawBuffer, readBuffer); ctx->Driver.DrawBuffer( ctx, ctx->Color.DrawBuffer[0] ); @@ -847,7 +890,10 @@ void viaGetLock(struct via_context *vmesa, GLuint flags) drmGetLock(vmesa->driFd, vmesa->hHWContext, flags); - DRI_VALIDATE_DRAWABLE_INFO( sPriv, dPriv ); + DRI_VALIDATE_DRAWABLE_INFO(sPriv, dPriv); + if (dPriv != vmesa->driReadable) { + DRI_VALIDATE_DRAWABLE_INFO(sPriv, vmesa->driReadable); + } if (vmesa->sarea->ctxOwner != vmesa->hHWContext) { vmesa->sarea->ctxOwner = vmesa->hHWContext; diff --git a/src/mesa/drivers/dri/unichrome/via_context.h b/src/mesa/drivers/dri/unichrome/via_context.h index 9d7a0e6cb64..77161a8d5df 100644 --- a/src/mesa/drivers/dri/unichrome/via_context.h +++ b/src/mesa/drivers/dri/unichrome/via_context.h @@ -98,6 +98,18 @@ struct via_renderbuffer { * at (drawX,drawY) in screen space. */ char *origMap; + + int drawX; /* origin of drawable in draw buffer */ + int drawY; + int drawW; + int drawH; + + int drawXoff; /* drawX is 32byte aligned - this is + * the delta to the real origin, in + * pixel units. + */ + + __DRIdrawablePrivate *dPriv; }; @@ -272,16 +284,6 @@ struct via_context { struct via_renderbuffer *drawBuffer; - int drawX; /* origin of drawable in draw buffer */ - int drawY; - int drawW; - int drawH; - - int drawXoff; /* drawX is 32byte aligned - this is - * the delta to the real origin, in - * pixel units. - */ - GLuint numClipRects; /* cliprects for that buffer */ drm_clip_rect_t *pClipRects; @@ -294,7 +296,16 @@ struct via_context { int driFd; __DRInativeDisplay *display; - __DRIdrawablePrivate *driDrawable; + /** + * DRI drawable bound to this context for drawing. + */ + __DRIdrawablePrivate *driDrawable; + + /** + * DRI drawable bound to this context for reading. + */ + __DRIdrawablePrivate *driReadable; + __DRIscreenPrivate *driScreen; viaScreenPrivate *viaScreen; drm_via_sarea_t *sarea; diff --git a/src/mesa/drivers/dri/unichrome/via_ioctl.c b/src/mesa/drivers/dri/unichrome/via_ioctl.c index c8c6dc01933..5d102de93ed 100644 --- a/src/mesa/drivers/dri/unichrome/via_ioctl.c +++ b/src/mesa/drivers/dri/unichrome/via_ioctl.c @@ -182,8 +182,8 @@ static void viaFillBuffer(struct via_context *vmesa, GLuint i; for (i = 0; i < nboxes ; i++) { - int x = pbox[i].x1 - vmesa->drawX; - int y = pbox[i].y1 - vmesa->drawY; + int x = pbox[i].x1 - buffer->drawX; + int y = pbox[i].y1 - buffer->drawY; int w = pbox[i].x2 - pbox[i].x1; int h = pbox[i].y2 - pbox[i].y1; @@ -202,11 +202,12 @@ static void viaFillBuffer(struct via_context *vmesa, -static void viaClear(GLcontext *ctx, GLbitfield mask, GLboolean all, - GLint cx, GLint cy, GLint cw, GLint ch) +static void viaClear(GLcontext *ctx, GLbitfield mask) { struct via_context *vmesa = VIA_CONTEXT(ctx); __DRIdrawablePrivate *dPriv = vmesa->driDrawable; + struct via_renderbuffer *const vrb = + (struct via_renderbuffer *) dPriv->driverPrivate; int flag = 0; GLuint i = 0; GLuint clear_depth_mask = 0xf << 28; @@ -261,13 +262,22 @@ static void viaClear(GLcontext *ctx, GLbitfield mask, GLboolean all, if (flag) { drm_clip_rect_t *boxes, *tmp_boxes = 0; int nr = 0; + GLint cx, cy, cw, ch; + GLboolean all; LOCK_HARDWARE(vmesa); + /* get region after locking: */ + cx = ctx->DrawBuffer->_Xmin; + cy = ctx->DrawBuffer->_Ymin; + cw = ctx->DrawBuffer->_Xmax - cx; + ch = ctx->DrawBuffer->_Ymax - cy; + all = (cw == ctx->DrawBuffer->Width && ch == ctx->DrawBuffer->Height); + /* flip top to bottom */ cy = dPriv->h - cy - ch; - cx += vmesa->drawX + vmesa->drawXoff; - cy += vmesa->drawY; + cx += vrb->drawX + vrb->drawXoff; + cy += vrb->drawY; if (!all) { drm_clip_rect_t *b = vmesa->pClipRects; @@ -328,7 +338,7 @@ static void viaClear(GLcontext *ctx, GLbitfield mask, GLboolean all, } if (mask) - _swrast_Clear(ctx, mask, all, cx, cy, cw, ch); + _swrast_Clear(ctx, mask); } @@ -344,8 +354,8 @@ static void viaDoSwapBuffers(struct via_context *vmesa, GLuint i; for (i = 0; i < nbox; i++, b++) { - GLint x = b->x1 - vmesa->drawX; - GLint y = b->y1 - vmesa->drawY; + GLint x = b->x1 - back->drawX; + GLint y = b->y1 - back->drawY; GLint w = b->x2 - b->x1; GLint h = b->y2 - b->y1; @@ -758,7 +768,7 @@ static void via_emit_cliprect(struct via_context *vmesa, vb[4] = (HC_SubA_HDBBasL << 24) | (offset & 0xFFFFFF); vb[5] = (HC_SubA_HDBBasH << 24) | ((offset & 0xFF000000) >> 24); - vb[6] = (HC_SubA_HSPXYOS << 24) | ((31-vmesa->drawXoff) << HC_HSPXOS_SHIFT); + vb[6] = (HC_SubA_HSPXYOS << 24) | ((31 - buffer->drawXoff) << HC_HSPXOS_SHIFT); vb[7] = (HC_SubA_HDBFM << 24) | HC_HDBLoc_Local | format | pitch; } @@ -873,21 +883,25 @@ void viaFlushDmaLocked(struct via_context *vmesa, GLuint flags) } else if (vmesa->numClipRects) { drm_clip_rect_t *pbox = vmesa->pClipRects; - + __DRIdrawablePrivate *dPriv = vmesa->driDrawable; + struct via_renderbuffer *const vrb = + (struct via_renderbuffer *) dPriv->driverPrivate; + + for (i = 0; i < vmesa->numClipRects; i++) { drm_clip_rect_t b; - b.x1 = pbox[i].x1 - (vmesa->drawX + vmesa->drawXoff); - b.x2 = pbox[i].x2 - (vmesa->drawX + vmesa->drawXoff); - b.y1 = pbox[i].y1 - vmesa->drawY; - b.y2 = pbox[i].y2 - vmesa->drawY; + b.x1 = pbox[i].x1 - (vrb->drawX + vrb->drawXoff); + b.x2 = pbox[i].x2 - (vrb->drawX + vrb->drawXoff); + b.y1 = pbox[i].y1 - vrb->drawY; + b.y2 = pbox[i].y2 - vrb->drawY; if (vmesa->scissor && !intersect_rect(&b, &b, &vmesa->scissorRect)) continue; - b.x1 += vmesa->drawXoff; - b.x2 += vmesa->drawXoff; + b.x1 += vrb->drawXoff; + b.x2 += vrb->drawXoff; via_emit_cliprect(vmesa, &b); diff --git a/src/mesa/drivers/dri/unichrome/via_screen.c b/src/mesa/drivers/dri/unichrome/via_screen.c index 4f137c8ceb8..28e1f9451e6 100644 --- a/src/mesa/drivers/dri/unichrome/via_screen.c +++ b/src/mesa/drivers/dri/unichrome/via_screen.c @@ -46,16 +46,16 @@ #include "GL/internal/dri_interface.h" #include "drirenderbuffer.h" -/* Radeon configuration - */ #include "xmlpool.h" const char __driConfigOptions[] = DRI_CONF_BEGIN DRI_CONF_SECTION_PERFORMANCE - DRI_CONF_FTHROTTLE_MODE(DRI_CONF_FTHROTTLE_IRQS) DRI_CONF_VBLANK_MODE(DRI_CONF_VBLANK_DEF_INTERVAL_0) DRI_CONF_SECTION_END + DRI_CONF_SECTION_QUALITY + DRI_CONF_EXCESS_MIPMAP(false) + DRI_CONF_SECTION_END DRI_CONF_SECTION_DEBUG DRI_CONF_NO_RAST(false) DRI_CONF_SECTION_END @@ -131,7 +131,6 @@ viaInitDriver(__DRIscreenPrivate *sPriv) viaScreen->fbOffset = 0; viaScreen->fbSize = gDRIPriv->fbSize; viaScreen->irqEnabled = gDRIPriv->irqEnabled; - viaScreen->irqEnabled = 1; if (VIA_DEBUG & DEBUG_DRI) { fprintf(stderr, "deviceID = %08x\n", viaScreen->deviceID); @@ -183,6 +182,7 @@ viaInitDriver(__DRIscreenPrivate *sPriv) (*glx_enable_extension)( psc, "GLX_MESA_swap_control" ); } + (*glx_enable_extension)( psc, "GLX_SGI_make_current_read" ); (*glx_enable_extension)( psc, "GLX_MESA_swap_frame_usage" ); } @@ -201,6 +201,8 @@ viaDestroyScreen(__DRIscreenPrivate *sPriv) via_free_empty_buffers(viaScreen->bufs); + driDestroyOptionInfo(&viaScreen->optionCache); + FREE(viaScreen); sPriv->private = NULL; } diff --git a/src/mesa/drivers/dri/unichrome/via_span.c b/src/mesa/drivers/dri/unichrome/via_span.c index 6ff95cc444c..f1ed98036bf 100644 --- a/src/mesa/drivers/dri/unichrome/via_span.c +++ b/src/mesa/drivers/dri/unichrome/via_span.c @@ -41,13 +41,12 @@ #undef LOCAL_VARS #define LOCAL_VARS \ - struct via_context *vmesa = VIA_CONTEXT(ctx); \ - __DRIdrawablePrivate *dPriv = vmesa->driDrawable; \ struct via_renderbuffer *vrb = (struct via_renderbuffer *) rb; \ + __DRIdrawablePrivate *dPriv = vrb->dPriv; \ GLuint pitch = vrb->pitch; \ GLuint height = dPriv->h; \ GLint p = 0; \ - char *buf = (char *)(vrb->origMap + vmesa->drawXoff * vrb->bpp); \ + char *buf = (char *)(vrb->origMap + vrb->drawXoff * vrb->bpp); \ (void) p; /* ================================================================ @@ -79,12 +78,11 @@ /* 16 bit depthbuffer functions. */ #define LOCAL_DEPTH_VARS \ - struct via_context *vmesa = VIA_CONTEXT(ctx); \ - __DRIdrawablePrivate *dPriv = vmesa->driDrawable; \ struct via_renderbuffer *vrb = (struct via_renderbuffer *) rb; \ + __DRIdrawablePrivate *dPriv = vrb->dPriv; \ GLuint depth_pitch = vrb->pitch; \ GLuint height = dPriv->h; \ - char *buf = (char *)(vrb->map + (vmesa->drawXoff * vrb->bpp/8)) + char *buf = (char *)(vrb->map + (vrb->drawXoff * vrb->bpp/8)) #define LOCAL_STENCIL_VARS LOCAL_DEPTH_VARS diff --git a/src/mesa/drivers/dri/unichrome/via_state.c b/src/mesa/drivers/dri/unichrome/via_state.c index 6a2a99df3bc..2c9cfca522e 100644 --- a/src/mesa/drivers/dri/unichrome/via_state.c +++ b/src/mesa/drivers/dri/unichrome/via_state.c @@ -328,8 +328,8 @@ void viaEmitState(struct via_context *vmesa) /* KW: This test never succeeds: */ if (t->regTexFM == HC_HTXnFM_Index8) { - struct gl_color_table *table = &texObj->Palette; - GLfloat *tableF = (GLfloat *)table->Table; + const struct gl_color_table *table = &texObj->Palette; + const GLfloat *tableF = table->TableF; BEGIN_RING(2 + table->Size); OUT_RING( HC_HEADER2 ); @@ -453,8 +453,8 @@ void viaEmitState(struct via_context *vmesa) /* KW: This test never succeeds: */ if (t->regTexFM == HC_HTXnFM_Index8) { - struct gl_color_table *table = &texObj->Palette; - GLfloat *tableF = (GLfloat *)table->Table; + const struct gl_color_table *table = &texObj->Palette; + const GLfloat *tableF = table->TableF; BEGIN_RING(2 + table->Size); OUT_RING( HC_HEADER2 ); @@ -476,6 +476,9 @@ void viaEmitState(struct via_context *vmesa) */ if (ctx->Polygon.StippleFlag) { GLuint *stipple = &ctx->PolygonStipple[0]; + __DRIdrawablePrivate *dPriv = vmesa->driDrawable; + struct via_renderbuffer *const vrb = + (struct via_renderbuffer *) dPriv->driverPrivate; GLint i; BEGIN_RING(38); @@ -498,9 +501,9 @@ void viaEmitState(struct via_context *vmesa) OUT_RING( HC_HEADER2 ); OUT_RING( (HC_ParaType_NotTex << 16) ); OUT_RING( (HC_SubA_HSPXYOS << 24) | - (((32- vmesa->drawXoff) & 0x1f) << HC_HSPXOS_SHIFT)); + (((32- vrb->drawXoff) & 0x1f) << HC_HSPXOS_SHIFT)); OUT_RING( (HC_SubA_HSPXYOS << 24) | - (((32 - vmesa->drawXoff) & 0x1f) << HC_HSPXOS_SHIFT)); + (((32 - vrb->drawXoff) & 0x1f) << HC_HSPXOS_SHIFT)); ADVANCE_RING(); } @@ -720,15 +723,18 @@ static void viaColorMask(GLcontext *ctx, void viaCalcViewport(GLcontext *ctx) { struct via_context *vmesa = VIA_CONTEXT(ctx); + __DRIdrawablePrivate *dPriv = vmesa->driDrawable; + struct via_renderbuffer *const vrb = + (struct via_renderbuffer *) dPriv->driverPrivate; const GLfloat *v = ctx->Viewport._WindowMap.m; GLfloat *m = vmesa->ViewportMatrix.m; /* See also via_translate_vertex. */ m[MAT_SX] = v[MAT_SX]; - m[MAT_TX] = v[MAT_TX] + SUBPIXEL_X + vmesa->drawXoff; + m[MAT_TX] = v[MAT_TX] + SUBPIXEL_X + vrb->drawXoff; m[MAT_SY] = - v[MAT_SY]; - m[MAT_TY] = - v[MAT_TY] + vmesa->driDrawable->h + SUBPIXEL_Y; + m[MAT_TY] = - v[MAT_TY] + dPriv->h + SUBPIXEL_Y; m[MAT_SZ] = v[MAT_SZ] * (1.0 / vmesa->depth_max); m[MAT_TZ] = v[MAT_TZ] * (1.0 / vmesa->depth_max); } @@ -1524,19 +1530,6 @@ void viaInitStateFuncs(GLcontext *ctx) ctx->Driver.Viewport = viaViewport; ctx->Driver.Enable = viaEnable; - /* Pixel path fallbacks. - */ - ctx->Driver.Accum = _swrast_Accum; - ctx->Driver.Bitmap = _swrast_Bitmap; - ctx->Driver.CopyPixels = _swrast_CopyPixels; - ctx->Driver.DrawPixels = _swrast_DrawPixels; - ctx->Driver.ReadPixels = _swrast_ReadPixels; + /* XXX this should go away */ ctx->Driver.ResizeBuffers = viaReAllocateBuffers; - - /* Swrast hooks for imaging extensions: - */ - ctx->Driver.CopyColorTable = _swrast_CopyColorTable; - ctx->Driver.CopyColorSubTable = _swrast_CopyColorSubTable; - ctx->Driver.CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D; - ctx->Driver.CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D; } diff --git a/src/mesa/drivers/dri/unichrome/via_tex.c b/src/mesa/drivers/dri/unichrome/via_tex.c index b344c009318..0261a3ff177 100644 --- a/src/mesa/drivers/dri/unichrome/via_tex.c +++ b/src/mesa/drivers/dri/unichrome/via_tex.c @@ -33,6 +33,7 @@ #include "colortab.h" #include "convolve.h" #include "context.h" +#include "mipmap.h" #include "simple_list.h" #include "texcompress.h" #include "texformat.h" @@ -512,6 +513,13 @@ static GLboolean viaSetTexImages(GLcontext *ctx, numLevels = lastLevel - firstLevel + 1; + /* The hardware supports only 10 mipmap levels; ignore higher levels. + */ + if ((numLevels > 10) && (ctx->Const.MaxTextureLevels > 10)) { + lastLevel -= numLevels - 10; + numLevels = 10; + } + /* save these values, check if they effect the residency of the * texture: */ diff --git a/src/mesa/drivers/fbdev/glfbdev.c b/src/mesa/drivers/fbdev/glfbdev.c index 3a6b452065b..bd9d3ac0ad9 100644 --- a/src/mesa/drivers/fbdev/glfbdev.c +++ b/src/mesa/drivers/fbdev/glfbdev.c @@ -157,11 +157,27 @@ get_buffer_size( GLframebuffer *buffer, GLuint *width, GLuint *height ) } +/** + * We only implement this function as a mechanism to check if the + * framebuffer size has changed (and update corresponding state). + */ static void viewport(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h) { - /* poll for window size change and realloc software Z/stencil/etc if needed */ - _mesa_ResizeBuffersMESA(); + GLuint newWidth, newHeight; + GLframebuffer *buffer; + + buffer = ctx->WinSysDrawBuffer; + get_buffer_size( buffer, &newWidth, &newHeight ); + if (buffer->Width != newWidth || buffer->Height != newHeight) { + _mesa_resize_framebuffer(ctx, buffer, newWidth, newHeight ); + } + + buffer = ctx->WinSysReadBuffer; + get_buffer_size( buffer, &newWidth, &newHeight ); + if (buffer->Width != newWidth || buffer->Height != newHeight) { + _mesa_resize_framebuffer(ctx, buffer, newWidth, newHeight ); + } } diff --git a/src/mesa/drivers/ggi/ggimesa.c b/src/mesa/drivers/ggi/ggimesa.c index 64312204c54..47d7f2bdb99 100644 --- a/src/mesa/drivers/ggi/ggimesa.c +++ b/src/mesa/drivers/ggi/ggimesa.c @@ -257,10 +257,18 @@ static void gl_ggiGetSize(GLframebuffer *fb, GLuint *width, GLuint *height) printf("returning %d, %d\n", *width, *height); } +/** + * We only implement this function as a mechanism to check if the + * framebuffer size has changed (and update corresponding state). + */ static void gl_ggiViewport(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h) { - /* poll for window size change and realloc software Z/stencil/etc if needed */ - _mesa_ResizeBuffersMESA(); + GLuint newWidth, newHeight; + GLframebuffer *buffer = ctx->WinSysDrawBuffer; + gl_ggiGetSize( buffer, &newWidth, &newHeight ); + if (buffer->Width != newWidth || buffer->Height != newHeight) { + _mesa_resize_framebuffer(ctx, buffer, newWidth, newHeight ); + } } @@ -305,10 +313,14 @@ static void gl_ggiSetClearColor(GLcontext *ctx, const GLfloat color[4]) ggi_ctx->clearcolor = col; } -static void gl_ggiClear(GLcontext *ctx, GLbitfield mask, GLboolean all, - GLint x, GLint y, GLint width, GLint height) +static void gl_ggiClear(GLcontext *ctx, GLbitfield mask) { ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; + int x = ctx->DrawBuffer->_Xmin; + int y = ctx->DrawBuffer->_Ymin; + int w = ctx->DrawBuffer->_Xmax - x; + int h = ctx->DrawBuffer->_Ymax - y; + GLboolean all = (w == ctx->DrawBuffer->Width && h == ctx->DrawBuffer->height) GGIMESADPRINT_CORE("gl_ggiClear() called\n"); @@ -328,7 +340,7 @@ static void gl_ggiClear(GLcontext *ctx, GLbitfield mask, GLboolean all, mask &= ~(DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT); } - _swrast_Clear(ctx, mask, all, x, y, width, height); + _swrast_Clear(ctx, mask); } diff --git a/src/mesa/drivers/glide/fxdd.c b/src/mesa/drivers/glide/fxdd.c index 1614a7a43a7..ef60602c832 100644 --- a/src/mesa/drivers/glide/fxdd.c +++ b/src/mesa/drivers/glide/fxdd.c @@ -123,11 +123,19 @@ fxDDGetBufferSize(GLframebuffer *buffer, GLuint *width, GLuint *height) } +/** + * We only implement this function as a mechanism to check if the + * framebuffer size has changed (and update corresponding state). + */ static void fxDDViewport(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h) { - /* poll for window size change and realloc software Z/stencil/etc if needed */ - _mesa_ResizeBuffersMESA(); + GLuint newWidth, newHeight; + GLframebuffer *buffer = ctx->WinSysDrawBuffer; + fxDDGetBufferSize( buffer, &newWidth, &newHeight ); + if (buffer->Width != newWidth || buffer->Height != newHeight) { + _mesa_resize_framebuffer(ctx, buffer, newWidth, newHeight ); + } } @@ -154,9 +162,7 @@ fxDDClearColor(GLcontext * ctx, const GLfloat color[4]) /* Clear the color and/or depth buffers */ -static void fxDDClear( GLcontext *ctx, - GLbitfield mask, GLboolean all, - GLint x, GLint y, GLint width, GLint height ) +static void fxDDClear( GLcontext *ctx, GLbitfield mask ) { fxMesaContext fxMesa = FX_CONTEXT(ctx); GLbitfield softwareMask = mask & (BUFFER_BIT_ACCUM); @@ -165,8 +171,7 @@ static void fxDDClear( GLcontext *ctx, const FxU8 clearS = (FxU8) (ctx->Stencil.Clear & 0xff); if ( TDFX_DEBUG & MESA_VERBOSE ) { - fprintf( stderr, "fxDDClear( %d, %d, %d, %d )\n", - (int) x, (int) y, (int) width, (int) height ); + fprintf( stderr, "fxDDClear\n"); } /* we can't clear accum buffers nor stereo */ @@ -381,7 +386,7 @@ static void fxDDClear( GLcontext *ctx, grRenderBuffer(fxMesa->currentFB); if (softwareMask) - _swrast_Clear( ctx, softwareMask, all, x, y, width, height ); + _swrast_Clear( ctx, softwareMask ); } diff --git a/src/mesa/drivers/osmesa/osmesa.c b/src/mesa/drivers/osmesa/osmesa.c index 942692c8bb0..0b027eddec5 100644 --- a/src/mesa/drivers/osmesa/osmesa.c +++ b/src/mesa/drivers/osmesa/osmesa.c @@ -64,8 +64,6 @@ struct osmesa_context struct gl_renderbuffer *rb; /*< The user's colorbuffer */ GLframebuffer *gl_buffer; /*< The framebuffer, containing user's rb */ GLenum format; /*< User-specified context format */ - GLint width, height; /*< size of image buffer */ - GLint rowlength; /*< number of pixels per row */ GLint userRowLength; /*< user-specified number of pixels per row */ GLint rInd, gInd, bInd, aInd;/*< index offsets for RGBA formats */ GLvoid *rowaddr[MAX_HEIGHT]; /*< address of first pixel in each image row */ @@ -117,23 +115,6 @@ osmesa_update_state( GLcontext *ctx, GLuint new_state ) } -/** - * Just return the current buffer size. - * There's no window to track the size of. - */ -static void -get_buffer_size( GLframebuffer *buffer, GLuint *width, GLuint *height ) -{ - /* don't use GET_CURRENT_CONTEXT(ctx) here - it's a problem on Windows */ - GLcontext *ctx = (GLcontext *) _glapi_get_context(); - (void) buffer; - if (ctx) { - OSMesaContext osmesa = OSMESA_CONTEXT(ctx); - *width = osmesa->width; - *height = osmesa->height; - } -} - /**********************************************************************/ /***** Read/write spans/arrays of pixels *****/ @@ -597,7 +578,9 @@ osmesa_choose_line_function( GLcontext *ctx ) const OSMesaContext osmesa = OSMESA_CONTEXT(ctx); const SWcontext *swrast = SWRAST_CONTEXT(ctx); - if (CHAN_BITS != 8) return NULL; + if (osmesa->rb->DataType != GL_UNSIGNED_BYTE) + return NULL; + if (ctx->RenderMode != GL_RENDER) return NULL; if (ctx->Line.SmoothFlag) return NULL; if (ctx->Texture._EnabledUnits) return NULL; @@ -706,7 +689,9 @@ osmesa_choose_triangle_function( GLcontext *ctx ) const OSMesaContext osmesa = OSMESA_CONTEXT(ctx); const SWcontext *swrast = SWRAST_CONTEXT(ctx); - if (CHAN_BITS != 8) return (swrast_tri_func) NULL; + if (osmesa->rb->DataType != GL_UNSIGNED_BYTE) + return (swrast_tri_func) NULL; + if (ctx->RenderMode != GL_RENDER) return (swrast_tri_func) NULL; if (ctx->Polygon.SmoothFlag) return (swrast_tri_func) NULL; if (ctx->Polygon.StippleFlag) return (swrast_tri_func) NULL; @@ -759,6 +744,72 @@ osmesa_choose_line( GLcontext *ctx ) } + +/** + * Recompute the values of the context's rowaddr array. + */ +static void +compute_row_addresses( OSMesaContext osmesa ) +{ + GLint bytesPerPixel, bytesPerRow, i; + GLubyte *origin = (GLubyte *) osmesa->rb->Data; + GLint bpc; /* bytes per channel */ + GLint rowlength; /* in pixels */ + GLint height = osmesa->rb->Height; + + if (osmesa->userRowLength) + rowlength = osmesa->userRowLength; + else + rowlength = osmesa->rb->Width; + + if (osmesa->rb->DataType == GL_UNSIGNED_BYTE) + bpc = 1; + else if (osmesa->rb->DataType == GL_UNSIGNED_SHORT) + bpc = 2; + else if (osmesa->rb->DataType == GL_FLOAT) + bpc = 4; + else { + _mesa_problem(&osmesa->mesa, + "Unexpected datatype in osmesa::compute_row_addresses"); + return; + } + + if (osmesa->format == OSMESA_COLOR_INDEX) { + /* CI mode */ + bytesPerPixel = 1 * sizeof(GLubyte); + } + else if ((osmesa->format == OSMESA_RGB) || (osmesa->format == OSMESA_BGR)) { + /* RGB mode */ + bytesPerPixel = 3 * bpc; + } + else if (osmesa->format == OSMESA_RGB_565) { + /* 5/6/5 RGB pixel in 16 bits */ + bytesPerPixel = 2; + } + else { + /* RGBA mode */ + bytesPerPixel = 4 * bpc; + } + + bytesPerRow = rowlength * bytesPerPixel; + + if (osmesa->yup) { + /* Y=0 is bottom line of window */ + for (i = 0; i < height; i++) { + osmesa->rowaddr[i] = (GLvoid *) ((GLubyte *) origin + i * bytesPerRow); + } + } + else { + /* Y=0 is top line of window */ + for (i = 0; i < height; i++) { + GLint j = height - i - 1; + osmesa->rowaddr[i] = (GLvoid *) ((GLubyte *) origin + j * bytesPerRow); + } + } +} + + + /** * Don't use _mesa_delete_renderbuffer since we can't free rb->Data. */ @@ -788,6 +839,11 @@ osmesa_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb, else bpc = 32; + rb->RedBits = + rb->GreenBits = + rb->BlueBits = + rb->AlphaBits = bpc; + /* Note: we can ignoring internalFormat for "window-system" renderbuffers */ (void) internalFormat; @@ -970,6 +1026,8 @@ osmesa_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb, rb->Width = width; rb->Height = height; + compute_row_addresses( osmesa ); + return GL_TRUE; } @@ -1003,65 +1061,6 @@ new_osmesa_renderbuffer(GLcontext *ctx, GLenum format, GLenum type) } - -/** - * Recompute the values of the context's rowaddr array. - */ -static void -compute_row_addresses( OSMesaContext osmesa ) -{ - GLint bytesPerPixel, bytesPerRow, i; - GLubyte *origin = (GLubyte *) osmesa->rb->Data; - GLint bpc; /* bytes per channel */ - - if (osmesa->rb->DataType == GL_UNSIGNED_BYTE) - bpc = 1; - else if (osmesa->rb->DataType == GL_UNSIGNED_SHORT) - bpc = 2; - else if (osmesa->rb->DataType == GL_FLOAT) - bpc = 4; - else { - _mesa_problem(&osmesa->mesa, - "Unexpected datatype in osmesa::compute_row_addresses"); - return; - } - - if (osmesa->format == OSMESA_COLOR_INDEX) { - /* CI mode */ - bytesPerPixel = 1 * sizeof(GLubyte); - } - else if ((osmesa->format == OSMESA_RGB) || (osmesa->format == OSMESA_BGR)) { - /* RGB mode */ - bytesPerPixel = 3 * bpc; - } - else if (osmesa->format == OSMESA_RGB_565) { - /* 5/6/5 RGB pixel in 16 bits */ - bytesPerPixel = 2; - } - else { - /* RGBA mode */ - bytesPerPixel = 4 * bpc; - } - - bytesPerRow = osmesa->rowlength * bytesPerPixel; - - if (osmesa->yup) { - /* Y=0 is bottom line of window */ - for (i = 0; i < MAX_HEIGHT; i++) { - osmesa->rowaddr[i] = (GLvoid *) ((GLubyte *) origin + i * bytesPerRow); - } - } - else { - /* Y=0 is top line of window */ - for (i = 0; i < MAX_HEIGHT; i++) { - GLint j = osmesa->height - i - 1; - osmesa->rowaddr[i] = (GLvoid *) ((GLubyte *) origin + j * bytesPerRow); - } - } -} - - - /**********************************************************************/ /***** Public Functions *****/ /**********************************************************************/ @@ -1210,7 +1209,7 @@ OSMesaCreateContextExt( GLenum format, GLint depthBits, GLint stencilBits, /* override with our functions */ functions.GetString = get_string; functions.UpdateState = osmesa_update_state; - functions.GetBufferSize = get_buffer_size; + functions.GetBufferSize = NULL; if (!_mesa_initialize_context(&osmesa->mesa, osmesa->gl_visual, @@ -1248,10 +1247,7 @@ OSMesaCreateContextExt( GLenum format, GLint depthBits, GLint stencilBits, GL_FALSE /* aux */ ); osmesa->format = format; - osmesa->width = 0; - osmesa->height = 0; osmesa->userRowLength = 0; - osmesa->rowlength = 0; osmesa->yup = GL_TRUE; osmesa->rInd = rind; osmesa->gInd = gind; @@ -1354,20 +1350,14 @@ OSMesaMakeCurrent( OSMesaContext osmesa, void *buffer, GLenum type, return GL_FALSE; } +#if 0 if (!(type == GL_UNSIGNED_BYTE || (type == GL_UNSIGNED_SHORT && CHAN_BITS >= 16) || (type == GL_FLOAT && CHAN_BITS == 32))) { /* i.e. is sizeof(type) * 8 > CHAN_BITS? */ return GL_FALSE; } - - /* Need to set these before calling _mesa_make_current() since the first - * time the context is bound, _mesa_make_current() will call our - * get_buffer_size() function to initialize the viewport. These are the - * values returned by get_buffer_size(): - */ - osmesa->width = width; - osmesa->height = height; +#endif osmesa_update_state( &osmesa->mesa, 0 ); @@ -1376,23 +1366,23 @@ OSMesaMakeCurrent( OSMesaContext osmesa, void *buffer, GLenum type, */ _glapi_check_multithread(); - _mesa_make_current( &osmesa->mesa, osmesa->gl_buffer, osmesa->gl_buffer ); - - if (osmesa->userRowLength) - osmesa->rowlength = osmesa->userRowLength; - else - osmesa->rowlength = width; - + /* Set renderbuffer fields. Set width/height = 0 to force + * osmesa_renderbuffer_storage() being called by _mesa_resize_framebuffer() + */ osmesa->rb->Data = buffer; osmesa->rb->DataType = type; - compute_row_addresses( osmesa ); + osmesa->rb->Width = osmesa->rb->Height = 0; + + /* Set the framebuffer's size. This causes the + * osmesa_renderbuffer_storage() function to get called. + */ + _mesa_resize_framebuffer(&osmesa->mesa, osmesa->gl_buffer, width, height); + osmesa->gl_buffer->Initialized = GL_TRUE; /* XXX TEMPORARY? */ - /* update the color renderbuffer's format, type, width, height */ - osmesa_renderbuffer_storage(&osmesa->mesa, osmesa->rb, - osmesa->rb->InternalFormat, width, height); + _mesa_make_current( &osmesa->mesa, osmesa->gl_buffer, osmesa->gl_buffer ); /* Remove renderbuffer attachment, then re-add. This installs the - * renderbuffer adaptor/wrapper if needed. + * renderbuffer adaptor/wrapper if needed (for bpp conversion). */ _mesa_remove_renderbuffer(osmesa->gl_buffer, BUFFER_FRONT_LEFT); _mesa_add_renderbuffer(osmesa->gl_buffer, BUFFER_FRONT_LEFT, osmesa->rb); @@ -1434,7 +1424,6 @@ OSMesaPixelStore( GLint pname, GLint value ) return; } osmesa->userRowLength = value; - osmesa->rowlength = value ? value : osmesa->width; break; case OSMESA_Y_UP: osmesa->yup = value ? GL_TRUE : GL_FALSE; @@ -1455,10 +1444,16 @@ OSMesaGetIntegerv( GLint pname, GLint *value ) switch (pname) { case OSMESA_WIDTH: - *value = osmesa->width; + if (osmesa->gl_buffer) + *value = osmesa->gl_buffer->Width; + else + *value = 0; return; case OSMESA_HEIGHT: - *value = osmesa->height; + if (osmesa->gl_buffer) + *value = osmesa->gl_buffer->Height; + else + *value = 0; return; case OSMESA_FORMAT: *value = osmesa->format; @@ -1516,8 +1511,8 @@ OSMesaGetDepthBuffer( OSMesaContext c, GLint *width, GLint *height, return GL_FALSE; } else { - *width = c->gl_buffer->Width; - *height = c->gl_buffer->Height; + *width = rb->Width; + *height = rb->Height; if (c->gl_visual->depthBits <= 16) *bytesPerValue = sizeof(GLushort); else diff --git a/src/mesa/drivers/svga/svgamesa.c b/src/mesa/drivers/svga/svgamesa.c index 09330e78ab5..0dd9a144fe8 100644 --- a/src/mesa/drivers/svga/svgamesa.c +++ b/src/mesa/drivers/svga/svgamesa.c @@ -1,4 +1,4 @@ -/* $Id: svgamesa.c,v 1.26 2005/09/07 23:26:01 brianp Exp $ */ +/* $Id: svgamesa.c,v 1.27 2006/10/15 18:51:22 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -213,10 +213,18 @@ static void get_buffer_size( GLframebuffer *buffer, GLuint *width, GLuint *heigh *height = SVGAMesa->height = vga_getydim(); } +/** + * We only implement this function as a mechanism to check if the + * framebuffer size has changed (and update corresponding state). + */ static void viewport(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h) { - /* poll for window size change and realloc software Z/stencil/etc if needed */ - _mesa_ResizeBuffersMESA(); + GLuint newWidth, newHeight; + GLframebuffer *buffer = ctx->WinSysDrawBuffer; + get_buffer_size( buffer, &newWidth, &newHeight ); + if (buffer->Width != newWidth || buffer->Height != newHeight) { + _mesa_resize_framebuffer(ctx, buffer, newWidth, newHeight ); + } } static void set_buffer( GLcontext *ctx, GLframebuffer *colorBuffer, diff --git a/src/mesa/drivers/svga/svgamesa15.c b/src/mesa/drivers/svga/svgamesa15.c index 54b6c977a7b..a4c0901e38f 100644 --- a/src/mesa/drivers/svga/svgamesa15.c +++ b/src/mesa/drivers/svga/svgamesa15.c @@ -1,4 +1,4 @@ -/* $Id: svgamesa15.c,v 1.11 2002/11/11 18:42:39 brianp Exp $ */ +/* $Id: svgamesa15.c,v 1.12 2006/11/01 19:35:23 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -66,10 +66,14 @@ void __clear_color15( GLcontext *ctx, const GLfloat color[4] ) /* SVGAMesa->clear_hicolor=(red)<<10 | (green)<<5 | (blue);*/ } -void __clear15( GLcontext *ctx, GLbitfield mask, GLboolean all, - GLint x, GLint y, GLint width, GLint height ) +void __clear15( GLcontext *ctx, GLbitfield mask ) { int i, j; + int x = ctx->DrawBuffer->_Xmin; + int y = ctx->DrawBuffer->_Ymin; + int width = ctx->DrawBuffer->_Xmax - x; + int height = ctx->DrawBuffer->_Ymax - y; + GLboolean all = (width == ctx->DrawBuffer->Width && height == ctx->DrawBuffer->height) if (mask & DD_FRONT_LEFT_BIT) { GLshort *shortBuffer=(void *)SVGABuffer.FrontBuffer; @@ -105,7 +109,7 @@ void __clear15( GLcontext *ctx, GLbitfield mask, GLboolean all, } if (mask) - _swrast_Clear( ctx, mask, all, x, y, width, height ); + _swrast_Clear( ctx, mask ); } void __write_rgba_span15( const GLcontext *ctx, GLuint n, GLint x, GLint y, diff --git a/src/mesa/drivers/svga/svgamesa16.c b/src/mesa/drivers/svga/svgamesa16.c index 72ac8183294..999c6331c9c 100644 --- a/src/mesa/drivers/svga/svgamesa16.c +++ b/src/mesa/drivers/svga/svgamesa16.c @@ -1,4 +1,4 @@ -/* $Id: svgamesa16.c,v 1.11 2002/11/11 18:42:40 brianp Exp $ */ +/* $Id: svgamesa16.c,v 1.12 2006/11/01 19:35:23 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -69,10 +69,14 @@ void __clear_color16( GLcontext *ctx, const GLfloat color[4] ) /* SVGAMesa->clear_hicolor=(red)<<11 | (green)<<5 | (blue); */ } -void __clear16( GLcontext *ctx, GLbitfield mask, GLboolean all, - GLint x, GLint y, GLint width, GLint height ) +void __clear16( GLcontext *ctx, GLbitfield mask ) { int i,j; + int x = ctx->DrawBuffer->_Xmin; + int y = ctx->DrawBuffer->_Ymin; + int width = ctx->DrawBuffer->_Xmax - x; + int height = ctx->DrawBuffer->_Ymax - y; + GLboolean all = (width == ctx->DrawBuffer->Width && height == ctx->DrawBuffer->height) if (mask & DD_FRONT_LEFT_BIT) { if (all) { @@ -108,7 +112,7 @@ void __clear16( GLcontext *ctx, GLbitfield mask, GLboolean all, } if (mask) - _swrast_Clear( ctx, mask, all, x, y, width, height ); + _swrast_Clear( ctx, mask ); } void __write_rgba_span16( const GLcontext *ctx, GLuint n, GLint x, GLint y, diff --git a/src/mesa/drivers/svga/svgamesa24.c b/src/mesa/drivers/svga/svgamesa24.c index 07491cc67ac..93c84167ebb 100644 --- a/src/mesa/drivers/svga/svgamesa24.c +++ b/src/mesa/drivers/svga/svgamesa24.c @@ -1,4 +1,4 @@ -/* $Id: svgamesa24.c,v 1.12 2002/11/11 18:42:41 brianp Exp $ */ +/* $Id: svgamesa24.c,v 1.13 2006/11/01 19:35:23 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -91,10 +91,14 @@ void __clear_color24( GLcontext *ctx, const GLfloat color[4] ) /* SVGAMesa->clear_truecolor = red<<16 | green<<8 | blue; */ } -void __clear24( GLcontext *ctx, GLbitfield mask, GLboolean all, - GLint x, GLint y, GLint width, GLint height ) +void __clear24( GLcontext *ctx, GLbitfield mask ) { int i,j; + int x = ctx->DrawBuffer->_Xmin; + int y = ctx->DrawBuffer->_Ymin; + int width = ctx->DrawBuffer->_Xmax - x; + int height = ctx->DrawBuffer->_Ymax - y; + GLboolean all = (width == ctx->DrawBuffer->Width && height == ctx->DrawBuffer->height) if (mask & DD_FRONT_LEFT_BIT) { if (all) { @@ -140,7 +144,7 @@ void __clear24( GLcontext *ctx, GLbitfield mask, GLboolean all, } if (mask) - _swrast_Clear( ctx, mask, all, x, y, width, height ); + _swrast_Clear( ctx, mask ); } void __write_rgba_span24( const GLcontext *ctx, GLuint n, GLint x, GLint y, diff --git a/src/mesa/drivers/svga/svgamesa32.c b/src/mesa/drivers/svga/svgamesa32.c index 8a366998d6b..5a3a6776ce7 100644 --- a/src/mesa/drivers/svga/svgamesa32.c +++ b/src/mesa/drivers/svga/svgamesa32.c @@ -1,4 +1,4 @@ -/* $Id: svgamesa32.c,v 1.12 2002/11/11 18:42:42 brianp Exp $ */ +/* $Id: svgamesa32.c,v 1.13 2006/11/01 19:35:23 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -85,10 +85,14 @@ void __clear_color32( GLcontext *ctx, const GLfloat color[4] ) SVGAMesa->clear_truecolor = (col[0] << 16) | (col[1] << 8) | col[2]; } -void __clear32( GLcontext *ctx, GLbitfield mask, GLboolean all, - GLint x, GLint y, GLint width, GLint height ) +void __clear32( GLcontext *ctx, GLbitfield mask ) { int i,j; + int x = ctx->DrawBuffer->_Xmin; + int y = ctx->DrawBuffer->_Ymin; + int width = ctx->DrawBuffer->_Xmax - x; + int height = ctx->DrawBuffer->_Ymax - y; + GLboolean all = (width == ctx->DrawBuffer->Width && height == ctx->DrawBuffer->height) if (mask & DD_FRONT_LEFT_BIT) { if (all) { @@ -124,7 +128,7 @@ void __clear32( GLcontext *ctx, GLbitfield mask, GLboolean all, } if (mask) - _swrast_Clear( ctx, mask, all, x, y, width, height ); + _swrast_Clear( ctx, mask ); } void __write_rgba_span32( const GLcontext *ctx, GLuint n, GLint x, GLint y, diff --git a/src/mesa/drivers/svga/svgamesa8.c b/src/mesa/drivers/svga/svgamesa8.c index fd880ef85ad..e3f5eaebf6a 100644 --- a/src/mesa/drivers/svga/svgamesa8.c +++ b/src/mesa/drivers/svga/svgamesa8.c @@ -1,4 +1,4 @@ -/* $Id: svgamesa8.c,v 1.9 2005/05/04 20:11:39 brianp Exp $ */ +/* $Id: svgamesa8.c,v 1.10 2006/11/01 19:35:23 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -60,10 +60,14 @@ void __clear_index8( GLcontext *ctx, GLuint index ) SVGAMesa->clear_index = index; } -void __clear8( GLcontext *ctx, GLbitfield mask, GLboolean all, - GLint x, GLint y, GLint width, GLint height ) +void __clear8( GLcontext *ctx, GLbitfield mask ) { int i,j; + int x = ctx->DrawBuffer->_Xmin; + int y = ctx->DrawBuffer->_Ymin; + int width = ctx->DrawBuffer->_Xmax - x; + int height = ctx->DrawBuffer->_Ymax - y; + GLboolean all = (width == ctx->DrawBuffer->Width && height == ctx->DrawBuffer->height) if (mask & DD_FRONT_LEFT_BIT) { if (all) { @@ -95,7 +99,7 @@ void __clear8( GLcontext *ctx, GLbitfield mask, GLboolean all, } if (mask) - _swrast_Clear( ctx, mask, all, x, y, width, height ); + _swrast_Clear( ctx, mask ); } void __write_ci32_span8( const GLcontext *ctx, struct gl_renderbuffer *rb, diff --git a/src/mesa/drivers/windows/gdi/wmesa.c b/src/mesa/drivers/windows/gdi/wmesa.c index 78e3d9ec8d1..8c3229ab14c 100644 --- a/src/mesa/drivers/windows/gdi/wmesa.c +++ b/src/mesa/drivers/windows/gdi/wmesa.c @@ -281,13 +281,13 @@ static void clear_color(GLcontext *ctx, const GLfloat color[4]) * Clearing of the other non-color buffers is left to the swrast. */ -static void clear(GLcontext *ctx, - GLbitfield mask, - GLboolean all, - GLint x, GLint y, - GLint width, GLint height) +static void clear(GLcontext *ctx, GLbitfield mask) { #define FLIP(Y) (ctx->DrawBuffer->Height - (Y) - 1) + const GLint x = ctx->DrawBuffer->_Xmin; + const GLint y = ctx->DrawBuffer->_Ymin; + const GLint height = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin; + const GLint width = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin; WMesaContext pwc = wmesa_context(ctx); WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer); @@ -299,7 +299,7 @@ static void clear(GLcontext *ctx, ctx->Color.ColorMask[1] != 0xff || ctx->Color.ColorMask[2] != 0xff || ctx->Color.ColorMask[3] != 0xff) { - _swrast_Clear(ctx, mask, all, x, y, width, height); + _swrast_Clear(ctx, mask); return; } @@ -318,7 +318,8 @@ static void clear(GLcontext *ctx, /* Try for a fast clear - clearing entire buffer with a single * byte value. */ - if (all) { /* entire buffer */ + if (width == ctx->DrawBuffer->Width && + height == ctx->DrawBuffer->Height) { /* entire buffer */ /* Now check for an easy clear value */ switch (bytesPerPixel) { case 1: @@ -431,7 +432,7 @@ static void clear(GLcontext *ctx, /* Call swrast if there is anything left to clear (like DEPTH) */ if (mask) - _swrast_Clear(ctx, mask, all, x, y, width, height); + _swrast_Clear(ctx, mask); #undef FLIP } diff --git a/src/mesa/drivers/x11/fakeglx.c b/src/mesa/drivers/x11/fakeglx.c index bc779a94a9e..eecd52aa32b 100644 --- a/src/mesa/drivers/x11/fakeglx.c +++ b/src/mesa/drivers/x11/fakeglx.c @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.5.1 + * Version: 6.5.2 * * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. * @@ -1388,7 +1388,7 @@ Fake_glXCreateContext( Display *dpy, XVisualInfo *visinfo, xmvis = create_glx_visual( dpy, visinfo ); if (!xmvis) { /* unusable visual */ - FREE(glxCtx); + _mesa_free(glxCtx); return NULL; } } @@ -1396,7 +1396,7 @@ Fake_glXCreateContext( Display *dpy, XVisualInfo *visinfo, glxCtx->xmesaContext = XMesaCreateContext(xmvis, shareCtx ? shareCtx->xmesaContext : NULL); if (!glxCtx->xmesaContext) { - FREE(glxCtx); + _mesa_free(glxCtx); return NULL; } @@ -1617,6 +1617,7 @@ Fake_glXDestroyContext( Display *dpy, GLXContext ctx ) MakeCurrent_PrevReadBuffer = 0; XMesaDestroyContext( glxCtx->xmesaContext ); XMesaGarbageCollect(); + _mesa_free(glxCtx); } @@ -2277,7 +2278,7 @@ Fake_glXCreateNewContext( Display *dpy, GLXFBConfig config, glxCtx->xmesaContext = XMesaCreateContext(xmvis, shareCtx ? shareCtx->xmesaContext : NULL); if (!glxCtx->xmesaContext) { - FREE(glxCtx); + _mesa_free(glxCtx); return NULL; } @@ -2500,7 +2501,7 @@ Fake_glXCreateContextWithConfigSGIX(Display *dpy, GLXFBConfigSGIX config, int re glxCtx->xmesaContext = XMesaCreateContext(xmvis, shareCtx ? shareCtx->xmesaContext : NULL); if (!glxCtx->xmesaContext) { - FREE(glxCtx); + _mesa_free(glxCtx); return NULL; } diff --git a/src/mesa/drivers/x11/glxapi.c b/src/mesa/drivers/x11/glxapi.c index 4f3dca8f484..7945f1c5b06 100644 --- a/src/mesa/drivers/x11/glxapi.c +++ b/src/mesa/drivers/x11/glxapi.c @@ -124,9 +124,30 @@ get_dispatch(Display *dpy) -/* Set by glXMakeCurrent() and glXMakeContextCurrent() only */ +/** + * GLX API current context. + */ +#if defined(GLX_USE_TLS) +PUBLIC __thread void * CurrentContext + __attribute__((tls_model("initial-exec"))); +#elif defined(THREADS) +static _glthread_TSD ContextTSD; /**< Per-thread context pointer */ +#else static GLXContext CurrentContext = 0; -#define __glXGetCurrentContext() CurrentContext; +#endif + + +static void +SetCurrentContext(GLXContext c) +{ +#if defined(GLX_USE_TLS) + CurrentContext = context; +#elif defined(THREADS) + _glthread_SetTSD(&ContextTSD, c); +#else + CurrentContext = c; +#endif +} /* @@ -186,6 +207,8 @@ glXDestroyContext(Display *dpy, GLXContext ctx) GET_DISPATCH(dpy, t); if (!t) return; + if (glXGetCurrentContext() == ctx) + SetCurrentContext(NULL); (t->DestroyContext)(dpy, ctx); } @@ -215,7 +238,13 @@ glXGetConfig(Display *dpy, XVisualInfo *visinfo, int attrib, int *value) GLXContext PUBLIC glXGetCurrentContext(void) { +#if defined(GLX_USE_TLS) return CurrentContext; +#elif defined(THREADS) + return _glthread_GetTSD(&ContextTSD); +#else + return CurrentContext; +#endif } @@ -249,7 +278,7 @@ glXMakeCurrent(Display *dpy, GLXDrawable drawable, GLXContext ctx) } b = (*t->MakeCurrent)(dpy, drawable, ctx); if (b) { - CurrentContext = ctx; + SetCurrentContext(ctx); } return b; } @@ -524,7 +553,7 @@ glXMakeContextCurrent(Display *dpy, GLXDrawable draw, GLXDrawable read, GLXConte return False; b = (t->MakeContextCurrent)(dpy, draw, read, ctx); if (b) { - CurrentContext = ctx; + SetCurrentContext(ctx); } return b; } diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c index dea23fcf59b..b50c4757afc 100644 --- a/src/mesa/drivers/x11/xm_api.c +++ b/src/mesa/drivers/x11/xm_api.c @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.5.1 + * Version: 6.5.2 * * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. * @@ -22,8 +22,10 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/* - * This file contains the implementations of all the XMesa* functions. +/** + * \file xm_api.c + * + * All the XMesa* API functions. * * * NOTES: @@ -68,13 +70,8 @@ #include "framebuffer.h" #include "glthread.h" #include "imports.h" -#include "matrix.h" -#include "mtypes.h" #include "macros.h" #include "renderbuffer.h" -#include "texformat.h" -#include "texobj.h" -#include "texstore.h" #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" #include "array_cache/acache.h" @@ -87,14 +84,14 @@ #include #endif -/* +/** * Global X driver lock */ _glthread_Mutex _xmesa_lock; -/* +/** * Lookup tables for HPCR pixel format: */ static short hpcr_rgbTbl[3][256] = { @@ -161,7 +158,7 @@ static short hpcr_rgbTbl[3][256] = { /**********************************************************************/ -/* +/** * Return the host's byte order as LSBFirst or MSBFirst ala X. */ #ifndef XFree86Server @@ -174,23 +171,7 @@ static int host_byte_order( void ) #endif -/* - * Error handling. - */ -#ifndef XFree86Server -static volatile int mesaXErrorFlag = 0; - -static int mesaHandleXError( XMesaDisplay *dpy, XErrorEvent *event ) -{ - (void) dpy; - (void) event; - mesaXErrorFlag = 1; - return 0; -} -#endif - - -/* +/** * Check if the X Shared Memory extension is available. * Return: 0 = not available * 1 = shared XImage support available @@ -222,11 +203,12 @@ static int check_for_xshm( XMesaDisplay *display ) } -/* +/** * Apply gamma correction to an intensity value in [0..max]. Return the * new intensity value. */ -static GLint gamma_adjust( GLfloat gamma, GLint value, GLint max ) +static GLint +gamma_adjust( GLfloat gamma, GLint value, GLint max ) { if (gamma == 1.0) { return value; @@ -239,7 +221,7 @@ static GLint gamma_adjust( GLfloat gamma, GLint value, GLint max ) -/* +/** * Return the true number of bits per pixel for XImages. * For example, if we request a 24-bit deep visual we may actually need/get * 32bpp XImages. This function returns the appropriate bpp. @@ -247,10 +229,10 @@ static GLint gamma_adjust( GLfloat gamma, GLint value, GLint max ) * visinfo - desribes the visual to be used for XImages * Return: true number of bits per pixel for XImages */ -#ifdef XFree86Server - -static int bits_per_pixel( XMesaVisual xmv ) +static int +bits_per_pixel( XMesaVisual xmv ) { +#ifdef XFree86Server const int depth = xmv->nplanes; int i; assert(depth > 0); @@ -259,12 +241,7 @@ static int bits_per_pixel( XMesaVisual xmv ) return screenInfo.formats[i].bitsPerPixel; } return depth; /* should never get here, but this should be safe */ -} - #else - -static int bits_per_pixel( XMesaVisual xmv ) -{ XMesaDisplay *dpy = xmv->display; XMesaVisualInfo visinfo = xmv->visinfo; XMesaImage *img; @@ -285,8 +262,8 @@ static int bits_per_pixel( XMesaVisual xmv ) img->data = NULL; XMesaDestroyImage( img ); return bitsPerPixel; -} #endif +} @@ -325,6 +302,45 @@ static GLboolean window_exists( XMesaDisplay *dpy, Window win ) +/** + * Return the size of the window (or pixmap) that corresponds to the + * given XMesaBuffer. + * \param width returns width in pixels + * \param height returns height in pixels + */ +void +xmesa_get_window_size(XMesaDisplay *dpy, XMesaBuffer b, + GLuint *width, GLuint *height) +{ +#ifdef XFree86Server + *width = MIN2(b->frontxrb->drawable->width, MAX_WIDTH); + *height = MIN2(b->frontxrb->drawable->height, MAX_HEIGHT); +#else + Window root; + Status stat; + int xpos, ypos; + unsigned int w, h, bw, depth; + + _glthread_LOCK_MUTEX(_xmesa_lock); + XSync(b->xm_visual->display, 0); /* added for Chromium */ + stat = XGetGeometry(dpy, b->frontxrb->pixmap, &root, &xpos, &ypos, + &w, &h, &bw, &depth); + _glthread_UNLOCK_MUTEX(_xmesa_lock); + + if (stat) { + *width = w; + *height = h; + } + else { + /* probably querying a window that's recently been destroyed */ + _mesa_warning(NULL, "XGetGeometry failed!\n"); + *width = *height = 1; + } +#endif +} + + + /**********************************************************************/ /***** Linked list of XMesaBuffers *****/ /**********************************************************************/ @@ -333,80 +349,110 @@ static XMesaBuffer XMesaBufferList = NULL; /** - * Allocate a new XMesaBuffer, initialize basic fields and add to - * the list of all buffers. + * Allocate a new XMesaBuffer object which corresponds to the given drawable. + * Note that XMesaBuffer is derived from GLframebuffer. + * The new XMesaBuffer will not have any size (Width=Height=0). + * + * \param d the corresponding X drawable (window or pixmap) + * \param type either WINDOW, PIXMAP or PBUFFER, describing d + * \param vis the buffer's visual + * \param cmap the window's colormap, if known. + * \return new XMesaBuffer or NULL if any problem */ static XMesaBuffer -alloc_xmesa_buffer(XMesaVisual vis, BufferType type, XMesaColormap cmap) +create_xmesa_buffer(XMesaDrawable d, BufferType type, + XMesaVisual vis, XMesaColormap cmap) { - XMesaBuffer b = (XMesaBuffer) CALLOC_STRUCT(xmesa_buffer); - if (b) { - GLboolean swAlpha; + GLboolean swAlpha; + XMesaBuffer b; + + ASSERT(type == WINDOW || type == PIXMAP || type == PBUFFER); - b->display = vis->display; - b->xm_visual = vis; - b->type = type; - b->cmap = cmap; + b = (XMesaBuffer) CALLOC_STRUCT(xmesa_buffer); + if (!b) + return NULL; - _mesa_initialize_framebuffer(&b->mesa_buffer, &vis->mesa_visual); + b->display = vis->display; + b->xm_visual = vis; + b->type = type; + b->cmap = cmap; - /* Allocate the framebuffer's renderbuffers */ - assert(!b->mesa_buffer.Attachment[BUFFER_FRONT_LEFT].Renderbuffer); - assert(!b->mesa_buffer.Attachment[BUFFER_BACK_LEFT].Renderbuffer); + _mesa_initialize_framebuffer(&b->mesa_buffer, &vis->mesa_visual); - /* front renderbuffer */ - b->frontxrb = xmesa_new_renderbuffer(NULL, 0, &vis->mesa_visual, + /* + * Front renderbuffer + */ + b->frontxrb = xmesa_new_renderbuffer(NULL, 0, &vis->mesa_visual, GL_FALSE); - _mesa_add_renderbuffer(&b->mesa_buffer, BUFFER_FRONT_LEFT, - &b->frontxrb->Base); - - /* back renderbuffer */ - if (vis->mesa_visual.doubleBufferMode) { - b->backxrb = xmesa_new_renderbuffer(NULL, 0, &vis->mesa_visual, - GL_TRUE); - /* determine back buffer implementation */ - b->db_mode = vis->ximage_flag ? BACK_XIMAGE : BACK_PIXMAP; - - _mesa_add_renderbuffer(&b->mesa_buffer, BUFFER_BACK_LEFT, - &b->backxrb->Base); - } + if (!b->frontxrb) { + _mesa_free(b); + return NULL; + } + b->frontxrb->Parent = b; + b->frontxrb->drawable = d; + b->frontxrb->pixmap = (XMesaPixmap) d; + _mesa_add_renderbuffer(&b->mesa_buffer, BUFFER_FRONT_LEFT, + &b->frontxrb->Base); - /* determine if we need software alpha planes */ - if (vis->mesa_visual.alphaBits > 0 - && vis->undithered_pf != PF_8A8B8G8R - && vis->undithered_pf != PF_8A8R8G8B) { - /* Visual has alpha, but pixel format doesn't support it. - * We'll use an alpha renderbuffer wrapper. - */ - swAlpha = GL_TRUE; - } - else { - swAlpha = GL_FALSE; + /* + * Back renderbuffer + */ + if (vis->mesa_visual.doubleBufferMode) { + b->backxrb = xmesa_new_renderbuffer(NULL, 0, &vis->mesa_visual, + GL_TRUE); + if (!b->backxrb) { + /* XXX free front xrb too */ + _mesa_free(b); + return NULL; } + b->backxrb->Parent = b; + /* determine back buffer implementation */ + b->db_mode = vis->ximage_flag ? BACK_XIMAGE : BACK_PIXMAP; + + _mesa_add_renderbuffer(&b->mesa_buffer, BUFFER_BACK_LEFT, + &b->backxrb->Base); + } - _mesa_add_soft_renderbuffers(&b->mesa_buffer, - GL_FALSE, /* color */ - vis->mesa_visual.haveDepthBuffer, - vis->mesa_visual.haveStencilBuffer, - vis->mesa_visual.haveAccumBuffer, - swAlpha, - vis->mesa_visual.numAuxBuffers > 0 ); - - /* insert into linked list */ - b->Next = XMesaBufferList; - XMesaBufferList = b; + /* + * Software alpha planes + */ + if (vis->mesa_visual.alphaBits > 0 + && vis->undithered_pf != PF_8A8B8G8R + && vis->undithered_pf != PF_8A8R8G8B) { + /* Visual has alpha, but pixel format doesn't support it. + * We'll use an alpha renderbuffer wrapper. + */ + swAlpha = GL_TRUE; + } + else { + swAlpha = GL_FALSE; } + + /* + * Other renderbuffer (depth, stencil, etc) + */ + _mesa_add_soft_renderbuffers(&b->mesa_buffer, + GL_FALSE, /* color */ + vis->mesa_visual.haveDepthBuffer, + vis->mesa_visual.haveStencilBuffer, + vis->mesa_visual.haveAccumBuffer, + swAlpha, + vis->mesa_visual.numAuxBuffers > 0 ); + + /* insert buffer into linked list */ + b->Next = XMesaBufferList; + XMesaBufferList = b; + return b; } -/* +/** * Find an XMesaBuffer by matching X display and colormap but NOT matching * the notThis buffer. */ -static XMesaBuffer find_xmesa_buffer(XMesaDisplay *dpy, - XMesaColormap cmap, - XMesaBuffer notThis) +static XMesaBuffer +find_xmesa_buffer(XMesaDisplay *dpy, XMesaColormap cmap, XMesaBuffer notThis) { XMesaBuffer b; for (b=XMesaBufferList; b; b=b->Next) { @@ -418,11 +464,12 @@ static XMesaBuffer find_xmesa_buffer(XMesaDisplay *dpy, } -/* +/** * Free an XMesaBuffer, remove from linked list, perhaps free X colormap * entries. */ -static void free_xmesa_buffer(int client, XMesaBuffer buffer) +static void +free_xmesa_buffer(int client, XMesaBuffer buffer) { XMesaBuffer prev = NULL, b; (void) client; @@ -461,8 +508,11 @@ static void free_xmesa_buffer(int client, XMesaBuffer buffer) } -/* Copy X color table stuff from one XMesaBuffer to another. */ -static void copy_colortable_info(XMesaBuffer dst, const XMesaBuffer src) +/** + * Copy X color table stuff from one XMesaBuffer to another. + */ +static void +copy_colortable_info(XMesaBuffer dst, const XMesaBuffer src) { MEMCPY(dst->color_table, src->color_table, sizeof(src->color_table)); MEMCPY(dst->pixel_to_r, src->pixel_to_r, sizeof(src->pixel_to_r)); @@ -481,198 +531,6 @@ static void copy_colortable_info(XMesaBuffer dst, const XMesaBuffer src) /** - * Allocate a shared memory XImage back buffer for the given XMesaBuffer. - * Return: GL_TRUE if success, GL_FALSE if error - */ -#ifndef XFree86Server -static GLboolean -alloc_shm_back_buffer(XMesaBuffer b, GLuint width, GLuint height) -{ -#ifdef USE_XSHM - /* - * We have to do a _lot_ of error checking here to be sure we can - * really use the XSHM extension. It seems different servers trigger - * errors at different points if the extension won't work. Therefore - * we have to be very careful... - */ - GC gc; - int (*old_handler)( XMesaDisplay *, XErrorEvent * ); - - if (width == 0 || height == 0) { - /* this will be true the first time we're called on 'b' */ - return GL_FALSE; - } - - b->backxrb->ximage = XShmCreateImage(b->xm_visual->display, - b->xm_visual->visinfo->visual, - b->xm_visual->visinfo->depth, - ZPixmap, NULL, &b->shminfo, - width, height); - if (b->backxrb->ximage == NULL) { - _mesa_warning(NULL, "alloc_back_buffer: Shared memory error (XShmCreateImage), disabling.\n"); - b->shm = 0; - return GL_FALSE; - } - - b->shminfo.shmid = shmget( IPC_PRIVATE, b->backxrb->ximage->bytes_per_line - * b->backxrb->ximage->height, IPC_CREAT|0777 ); - if (b->shminfo.shmid < 0) { - _mesa_warning(NULL, "shmget failed while allocating back buffer.\n"); - XDestroyImage( b->backxrb->ximage ); - b->backxrb->ximage = NULL; - _mesa_warning(NULL, "alloc_back_buffer: Shared memory error (shmget), disabling.\n"); - b->shm = 0; - return GL_FALSE; - } - - b->shminfo.shmaddr = b->backxrb->ximage->data - = (char*)shmat( b->shminfo.shmid, 0, 0 ); - if (b->shminfo.shmaddr == (char *) -1) { - _mesa_warning(NULL, "shmat() failed while allocating back buffer.\n"); - XDestroyImage( b->backxrb->ximage ); - shmctl( b->shminfo.shmid, IPC_RMID, 0 ); - b->backxrb->ximage = NULL; - _mesa_warning(NULL, "alloc_back_buffer: Shared memory error (shmat), disabling.\n"); - b->shm = 0; - return GL_FALSE; - } - - b->shminfo.readOnly = False; - mesaXErrorFlag = 0; - old_handler = XSetErrorHandler( mesaHandleXError ); - /* This may trigger the X protocol error we're ready to catch: */ - XShmAttach( b->xm_visual->display, &b->shminfo ); - XSync( b->xm_visual->display, False ); - - if (mesaXErrorFlag) { - /* we are on a remote display, this error is normal, don't print it */ - XFlush( b->xm_visual->display ); - mesaXErrorFlag = 0; - XDestroyImage( b->backxrb->ximage ); - shmdt( b->shminfo.shmaddr ); - shmctl( b->shminfo.shmid, IPC_RMID, 0 ); - b->backxrb->ximage = NULL; - b->shm = 0; - (void) XSetErrorHandler( old_handler ); - return GL_FALSE; - } - - shmctl( b->shminfo.shmid, IPC_RMID, 0 ); /* nobody else needs it */ - - /* Finally, try an XShmPutImage to be really sure the extension works */ - gc = XCreateGC( b->xm_visual->display, b->frontxrb->drawable, 0, NULL ); - XShmPutImage( b->xm_visual->display, b->frontxrb->drawable, gc, - b->backxrb->ximage, 0, 0, 0, 0, 1, 1 /*one pixel*/, False ); - XSync( b->xm_visual->display, False ); - XFreeGC( b->xm_visual->display, gc ); - (void) XSetErrorHandler( old_handler ); - if (mesaXErrorFlag) { - XFlush( b->xm_visual->display ); - mesaXErrorFlag = 0; - XDestroyImage( b->backxrb->ximage ); - shmdt( b->shminfo.shmaddr ); - shmctl( b->shminfo.shmid, IPC_RMID, 0 ); - b->backxrb->ximage = NULL; - b->shm = 0; - return GL_FALSE; - } - - return GL_TRUE; -#else - /* Can't compile XSHM support */ - return GL_FALSE; -#endif -} -#endif - - - - -/* - * Setup an off-screen pixmap or Ximage to use as the back buffer. - * Input: b - the X/Mesa buffer - */ -void -xmesa_alloc_back_buffer( XMesaBuffer b, GLuint width, GLuint height ) -{ - if (width == 0 || height == 0) - return; - - if (b->db_mode == BACK_XIMAGE) { - /* Deallocate the old backxrb->ximage, if any */ - if (b->backxrb->ximage) { -#if defined(USE_XSHM) && !defined(XFree86Server) - if (b->shm) { - XShmDetach( b->xm_visual->display, &b->shminfo ); - XDestroyImage( b->backxrb->ximage ); - shmdt( b->shminfo.shmaddr ); - } - else -#endif - XMesaDestroyImage( b->backxrb->ximage ); - b->backxrb->ximage = NULL; - } - - /* Allocate new back buffer */ -#ifdef XFree86Server - /* Allocate a regular XImage for the back buffer. */ - b->backxrb->ximage = XMesaCreateImage(b->xm_visual->BitsPerPixel, - width, height, NULL); - { -#else - if (b->shm == 0 || !alloc_shm_back_buffer(b, width, height)) { - /* Allocate a regular XImage for the back buffer. */ - b->backxrb->ximage = XCreateImage( b->xm_visual->display, - b->xm_visual->visinfo->visual, - GET_VISUAL_DEPTH(b->xm_visual), - ZPixmap, 0, /* format, offset */ - NULL, - width, height, - 8, 0 ); /* pad, bytes_per_line */ -#endif - if (!b->backxrb->ximage) { - _mesa_warning(NULL, "alloc_back_buffer: XCreateImage failed.\n"); - return; - } - b->backxrb->ximage->data = (char *) MALLOC( b->backxrb->ximage->height - * b->backxrb->ximage->bytes_per_line ); - if (!b->backxrb->ximage->data) { - _mesa_warning(NULL, "alloc_back_buffer: MALLOC failed.\n"); - XMesaDestroyImage( b->backxrb->ximage ); - b->backxrb->ximage = NULL; - } - else { - /* this call just updates the width/origin fields in the xrb */ - b->backxrb->Base.AllocStorage(NULL, &b->backxrb->Base, - b->backxrb->Base.InternalFormat, - b->backxrb->ximage->width, - b->backxrb->ximage->height); - } - } - b->backxrb->pixmap = None; - } - else if (b->db_mode == BACK_PIXMAP) { - if (!width) - width = 1; - if (!height) - height = 1; - - /* Free the old back pixmap */ - if (b->backxrb->pixmap) { - XMesaFreePixmap( b->xm_visual->display, b->backxrb->pixmap ); - } - /* Allocate new back pixmap */ - b->backxrb->pixmap = XMesaCreatePixmap( b->xm_visual->display, - b->frontxrb->drawable, - width, height, - GET_VISUAL_DEPTH(b->xm_visual) ); - b->backxrb->ximage = NULL; - } -} - - - -/* * A replacement for XAllocColor. This function should never * fail to allocate a color. When XAllocColor fails, we return * the nearest matching color. If we have to allocate many colors @@ -715,10 +573,11 @@ noFaultXAllocColor( int client, if (AllocColor(cmap, &color->red, &color->green, &color->blue, &color->pixel, - client) == Success) { + client) == Success) #else - if (XAllocColor(dpy, cmap, color)) { + if (XAllocColor(dpy, cmap, color)) #endif + { *exact = 1; *alloced = 1; return; @@ -808,13 +667,13 @@ noFaultXAllocColor( int client, - -/* +/** * Do setup for PF_GRAYSCALE pixel format. * Note that buffer may be NULL. */ -static GLboolean setup_grayscale( int client, XMesaVisual v, - XMesaBuffer buffer, XMesaColormap cmap ) +static GLboolean +setup_grayscale(int client, XMesaVisual v, + XMesaBuffer buffer, XMesaColormap cmap) { if (GET_VISUAL_DEPTH(v)<4 || GET_VISUAL_DEPTH(v)>16) { return GL_FALSE; @@ -893,7 +752,7 @@ static GLboolean setup_grayscale( int client, XMesaVisual v, -/* +/** * Setup RGB rendering for a window with a PseudoColor, StaticColor, * or 8-bit TrueColor visual visual. We try to allocate a palette of 225 * colors (5 red, 9 green, 5 blue) and dither to approximate a 24-bit RGB @@ -901,8 +760,9 @@ static GLboolean setup_grayscale( int client, XMesaVisual v, * visuals, it has also proven to work from 4-bit up to 16-bit visuals. * Dithering code contributed by Bob Mercier. */ -static GLboolean setup_dithered_color( int client, XMesaVisual v, - XMesaBuffer buffer, XMesaColormap cmap ) +static GLboolean +setup_dithered_color(int client, XMesaVisual v, + XMesaBuffer buffer, XMesaColormap cmap) { if (GET_VISUAL_DEPTH(v)<4 || GET_VISUAL_DEPTH(v)>16) { return GL_FALSE; @@ -972,12 +832,13 @@ static GLboolean setup_dithered_color( int client, XMesaVisual v, } -/* +/** * Setup for Hewlett Packard Color Recovery 8-bit TrueColor mode. * HPCR simulates 24-bit color fidelity with an 8-bit frame buffer. * Special dithering tables have to be initialized. */ -static void setup_8bit_hpcr( XMesaVisual v ) +static void +setup_8bit_hpcr(XMesaVisual v) { /* HP Color Recovery contributed by: Alex De Bruyn (ad@lms.be) * To work properly, the atom _HP_RGB_SMOOTH_MAP_LIST must be defined @@ -1027,11 +888,11 @@ static void setup_8bit_hpcr( XMesaVisual v ) } -/* +/** * Setup RGB rendering for a window with a True/DirectColor visual. */ -static void setup_truecolor( XMesaVisual v, XMesaBuffer buffer, - XMesaColormap cmap ) +static void +setup_truecolor(XMesaVisual v, XMesaBuffer buffer, XMesaColormap cmap) { unsigned long rmask, gmask, bmask; (void) buffer; @@ -1171,10 +1032,11 @@ static void setup_truecolor( XMesaVisual v, XMesaBuffer buffer, -/* +/** * Setup RGB rendering for a window with a monochrome visual. */ -static void setup_monochrome( XMesaVisual v, XMesaBuffer b ) +static void +setup_monochrome( XMesaVisual v, XMesaBuffer b ) { (void) b; v->dithered_pf = v->undithered_pf = PF_1Bit; @@ -1184,46 +1046,28 @@ static void setup_monochrome( XMesaVisual v, XMesaBuffer b ) -/* - * When a context is "made current" for the first time, we can finally - * finish initializing the context's visual and buffer information. - * Input: v - the XMesaVisual to initialize - * b - the XMesaBuffer to initialize (may be NULL) - * rgb_flag - TRUE = RGBA mode, FALSE = color index mode - * window - the window/pixmap we're rendering into - * cmap - the colormap associated with the window/pixmap - * Return: GL_TRUE=success, GL_FALSE=failure +/** + * When a context is bound for the first time, we can finally finish + * initializing the context's visual and buffer information. + * \param v the XMesaVisual to initialize + * \param b the XMesaBuffer to initialize (may be NULL) + * \param rgb_flag TRUE = RGBA mode, FALSE = color index mode + * \param window the window/pixmap we're rendering into + * \param cmap the colormap associated with the window/pixmap + * \return GL_TRUE=success, GL_FALSE=failure */ -static GLboolean initialize_visual_and_buffer( int client, - XMesaVisual v, - XMesaBuffer b, - GLboolean rgb_flag, - XMesaDrawable window, - XMesaColormap cmap ) +static GLboolean +initialize_visual_and_buffer(int client, XMesaVisual v, XMesaBuffer b, + GLboolean rgb_flag, XMesaDrawable window, + XMesaColormap cmap) { - struct xmesa_renderbuffer *front_xrb, *back_xrb; -#ifndef XFree86Server - XGCValues gcvalues; -#endif - - if (b) { - assert(b->xm_visual == v); - } - - if (b) { - front_xrb = b->frontxrb; - back_xrb = b->backxrb; - } - else { - front_xrb = back_xrb = NULL; - } + ASSERT(!b || b->xm_visual == v); /* Save true bits/pixel */ v->BitsPerPixel = bits_per_pixel(v); assert(v->BitsPerPixel > 0); - - if (rgb_flag==GL_FALSE) { + if (rgb_flag == GL_FALSE) { /* COLOR-INDEXED WINDOW: * Even if the visual is TrueColor or DirectColor we treat it as * being color indexed. This is weird but might be useful to someone. @@ -1236,18 +1080,18 @@ static GLboolean initialize_visual_and_buffer( int client, * We support RGB rendering into almost any kind of visual. */ const int xclass = v->mesa_visual.visualType; - if (xclass==GLX_TRUE_COLOR || xclass==GLX_DIRECT_COLOR) { + if (xclass == GLX_TRUE_COLOR || xclass == GLX_DIRECT_COLOR) { setup_truecolor( v, b, cmap ); } - else if (xclass==GLX_STATIC_GRAY && GET_VISUAL_DEPTH(v)==1) { + else if (xclass == GLX_STATIC_GRAY && GET_VISUAL_DEPTH(v) == 1) { setup_monochrome( v, b ); } - else if (xclass==GLX_GRAY_SCALE || xclass==GLX_STATIC_GRAY) { + else if (xclass == GLX_GRAY_SCALE || xclass == GLX_STATIC_GRAY) { if (!setup_grayscale( client, v, b, cmap )) { return GL_FALSE; } } - else if ((xclass==GLX_PSEUDO_COLOR || xclass==GLX_STATIC_COLOR) + else if ((xclass == GLX_PSEUDO_COLOR || xclass == GLX_STATIC_COLOR) && GET_VISUAL_DEPTH(v)>=4 && GET_VISUAL_DEPTH(v)<=16) { if (!setup_dithered_color( client, v, b, cmap )) { return GL_FALSE; @@ -1282,14 +1126,14 @@ static GLboolean initialize_visual_and_buffer( int client, if (b && window) { /* Do window-specific initializations */ - b->frontxrb->drawable = window; - b->frontxrb->pixmap = (XMesaPixmap) window; + /* these should have been set in create_xmesa_buffer */ + ASSERT(b->frontxrb->drawable == window); + ASSERT(b->frontxrb->pixmap == (XMesaPixmap) window); /* Setup for single/double buffering */ if (v->mesa_visual.doubleBufferMode) { /* Double buffered */ b->shm = check_for_xshm( v->display ); - xmesa_alloc_back_buffer(b, b->mesa_buffer.Width, b->mesa_buffer.Height); } /* X11 graphics contexts */ @@ -1320,9 +1164,12 @@ static GLboolean initialize_visual_and_buffer( int client, dixChangeGC(NullClient, b->swapgc, GCGraphicsExposures, v, NULL); } #else - gcvalues.graphics_exposures = False; - b->swapgc = XCreateGC( v->display, window, - GCGraphicsExposures, &gcvalues); + { + XGCValues gcvalues; + gcvalues.graphics_exposures = False; + b->swapgc = XCreateGC(v->display, window, + GCGraphicsExposures, &gcvalues); + } #endif XMesaSetFunction( v->display, b->swapgc, GXcopy ); /* @@ -1331,17 +1178,16 @@ static GLboolean initialize_visual_and_buffer( int client, * Initialize whole stuff * Patch contributed by Jacques Leroy March 8, 1998. */ - if (v->hpcr_clear_flag && back_xrb->pixmap) { - int i; - for (i=0; i<16; i++) - { - XMesaPutPixel(v->hpcr_clear_ximage, i, 0, 0); - XMesaPutPixel(v->hpcr_clear_ximage, i, 1, 0); - } - XMesaPutImage(b->display, (XMesaDrawable) v->hpcr_clear_pixmap, - b->cleargc, v->hpcr_clear_ximage, 0, 0, 0, 0, 16, 2); - XMesaSetFillStyle( v->display, b->cleargc, FillTiled); - XMesaSetTile( v->display, b->cleargc, v->hpcr_clear_pixmap ); + if (v->hpcr_clear_flag && b->backxrb && b->backxrb->pixmap) { + int i; + for (i = 0; i < 16; i++) { + XMesaPutPixel(v->hpcr_clear_ximage, i, 0, 0); + XMesaPutPixel(v->hpcr_clear_ximage, i, 1, 0); + } + XMesaPutImage(b->display, (XMesaDrawable) v->hpcr_clear_pixmap, + b->cleargc, v->hpcr_clear_ximage, 0, 0, 0, 0, 16, 2); + XMesaSetFillStyle( v->display, b->cleargc, FillTiled); + XMesaSetTile( v->display, b->cleargc, v->hpcr_clear_pixmap ); } /* Initialize the row buffer XImage for use in write_color_span() */ @@ -1504,18 +1350,16 @@ XMesaVisual XMesaCreateVisual( XMesaDisplay *display, XMesaVisual v; GLint red_bits, green_bits, blue_bits, alpha_bits; +#ifndef XFree86Server /* For debugging only */ if (_mesa_getenv("MESA_XSYNC")) { /* This makes debugging X easier. * In your debugger, set a breakpoint on _XError to stop when an * X protocol error is generated. */ -#ifdef XFree86Server - /* NOT_NEEDED */ -#else XSynchronize( display, 1 ); -#endif } +#endif v = (XMesaVisual) CALLOC_STRUCT(xmesa_visual); if (!v) { @@ -1592,7 +1436,7 @@ XMesaVisual XMesaCreateVisual( XMesaDisplay *display, { const int xclass = v->mesa_visual.visualType; - if (xclass==GLX_TRUE_COLOR || xclass==GLX_DIRECT_COLOR) { + if (xclass == GLX_TRUE_COLOR || xclass == GLX_DIRECT_COLOR) { red_bits = _mesa_bitcount(GET_REDMASK(v)); green_bits = _mesa_bitcount(GET_GREENMASK(v)); blue_bits = _mesa_bitcount(GET_BLUEMASK(v)); @@ -1750,13 +1594,13 @@ void XMesaDestroyContext( XMesaContext c ) -/* - * XXX this isn't a public function! It's a hack for the 3Dfx driver. - * Create a new XMesaBuffer from an X window. - * Input: v - the XMesaVisual - * w - the window - * c - the context - * Return: new XMesaBuffer or NULL if error +/** + * Private function for creating an XMesaBuffer which corresponds to an + * X window or pixmap. + * \param v the window's XMesaVisual + * \param w the window we're wrapping + * \param c context used to initialize the buffer if 3Dfx mode in use. + * \return new XMesaBuffer or NULL if error */ XMesaBuffer XMesaCreateWindowBuffer2(XMesaVisual v, XMesaWindow w, XMesaContext c) @@ -1772,6 +1616,7 @@ XMesaCreateWindowBuffer2(XMesaVisual v, XMesaWindow w, XMesaContext c) XMesaColormap cmap; assert(v); + assert(w); (void) c; /* Check that window depth matches visual depth */ @@ -1808,10 +1653,9 @@ XMesaCreateWindowBuffer2(XMesaVisual v, XMesaWindow w, XMesaContext c) } #endif - b = alloc_xmesa_buffer(v, WINDOW, cmap); - if (!b) { + b = create_xmesa_buffer((XMesaDrawable) w, WINDOW, v, cmap); + if (!b) return NULL; - } if (!initialize_visual_and_buffer( client, v, b, v->mesa_visual.rgbMode, (XMesaDrawable) w, cmap )) { @@ -1926,10 +1770,9 @@ XMesaCreatePixmapBuffer(XMesaVisual v, XMesaPixmap p, XMesaColormap cmap) assert(v); - b = alloc_xmesa_buffer(v, PIXMAP, cmap); - if (!b) { + b = create_xmesa_buffer((XMesaDrawable) p, PIXMAP, v, cmap); + if (!b) return NULL; - } #ifdef XFree86Server client = CLIENT_ID(((XMesaDrawable)p)->id); @@ -1958,14 +1801,16 @@ XMesaCreatePBuffer(XMesaVisual v, XMesaColormap cmap, XMesaDrawable drawable; /* X Pixmap Drawable */ XMesaBuffer b; - b = alloc_xmesa_buffer(v, PBUFFER, cmap); - if (!b) { - return NULL; - } - /* allocate pixmap for front buffer */ root = RootWindow( v->display, v->visinfo->screen ); - drawable = XCreatePixmap( v->display, root, width, height, v->visinfo->depth ); + drawable = XCreatePixmap(v->display, root, width, height, + v->visinfo->depth); + if (!drawable) + return NULL; + + b = create_xmesa_buffer(drawable, PBUFFER, v, cmap); + if (!b) + return NULL; if (!initialize_visual_and_buffer(client, v, b, v->mesa_visual.rgbMode, drawable, cmap)) { @@ -2027,6 +1872,27 @@ void XMesaDestroyBuffer( XMesaBuffer b ) } +/** + * Query the current window size and update the corresponding GLframebuffer + * and all attached renderbuffers. + * Called when: + * 1. the first time a buffer is bound to a context. + * 2. from glViewport to poll for window size changes + * 3. from the XMesaResizeBuffers() API function. + */ +void +xmesa_check_and_update_buffer_size(XMesaContext xmctx, XMesaBuffer drawBuffer) +{ + GLuint width, height; + xmesa_get_window_size(xmctx->display, drawBuffer, &width, &height); + if (drawBuffer->mesa_buffer.Width != width || + drawBuffer->mesa_buffer.Height != height) { + _mesa_resize_framebuffer(&(xmctx->mesa), + &(drawBuffer->mesa_buffer), width, height); + } + drawBuffer->mesa_buffer.Initialized = GL_TRUE; /* XXX TEMPORARY? */ +} + /* * Bind buffer b to context c and make c the current rendering context. @@ -2059,7 +1925,7 @@ GLboolean XMesaMakeCurrent2( XMesaContext c, XMesaBuffer drawBuffer, if (&(c->mesa) == _mesa_get_current_context() && c->mesa.DrawBuffer == &drawBuffer->mesa_buffer && c->mesa.ReadBuffer == &readBuffer->mesa_buffer - && ((XMesaBuffer) c->mesa.DrawBuffer)->wasCurrent) { + && XMESA_BUFFER(c->mesa.DrawBuffer)->wasCurrent) { /* same context and buffer, do nothing */ return GL_TRUE; } @@ -2071,6 +1937,10 @@ GLboolean XMesaMakeCurrent2( XMesaContext c, XMesaBuffer drawBuffer, */ _glapi_check_multithread(); + xmesa_check_and_update_buffer_size(c, drawBuffer); + if (readBuffer != drawBuffer) + xmesa_check_and_update_buffer_size(c, readBuffer); + _mesa_make_current(&(c->mesa), &drawBuffer->mesa_buffer, &readBuffer->mesa_buffer); @@ -2141,7 +2011,7 @@ XMesaBuffer XMesaGetCurrentReadBuffer( void ) { GET_CURRENT_CONTEXT(ctx); if (ctx) { - return (XMesaBuffer) (ctx->ReadBuffer); + return XMESA_BUFFER(ctx->ReadBuffer); } else { return 0; @@ -2230,9 +2100,7 @@ static void FXgetImage( XMesaBuffer b ) GET_CURRENT_CONTEXT(ctx); static unsigned short pixbuf[MAX_WIDTH]; GLuint x, y; - int xpos, ypos; - XMesaWindow root; - unsigned int bw, depth, width, height; + GLuint width, height; XMesaContext xmesa = XMESA_CONTEXT(ctx); #ifdef XFree86Server @@ -2242,15 +2110,14 @@ static void FXgetImage( XMesaBuffer b ) height = b->frontxrb->pixmap->height; depth = b->frontxrb->pixmap->depth; #else - XGetGeometry( b->xm_visual->display, b->frontxrb->pixmap, - &root, &xpos, &ypos, &width, &height, &bw, &depth); + xmesa_get_window_size(b->display, b, &width, &height); + x = y = 0; #endif if (b->mesa_buffer.Width != width || b->mesa_buffer.Height != height) { b->mesa_buffer.Width = MIN2((int)width, b->FXctx->width); b->mesa_buffer.Height = MIN2((int)height, b->FXctx->height); if (b->mesa_buffer.Width & 1) b->mesa_buffer.Width--; /* prevent odd width */ - xmesa_alloc_back_buffer(b, b->mesa_buffer.Width, b->mesa_buffer.Height); } /* [dBorca] we're always in the right GR_COLORFORMAT... aren't we? */ @@ -2664,24 +2531,11 @@ unsigned long XMesaDitherColor( XMesaContext xmesa, GLint x, GLint y, * This is typically called when the window size changes and we need * to reallocate the buffer's back/depth/stencil/accum buffers. */ -void XMesaResizeBuffers( XMesaBuffer b ) +void +XMesaResizeBuffers( XMesaBuffer b ) { -#ifdef XFree86Server - GLuint winwidth, winheight; GET_CURRENT_CONTEXT(ctx); - - winwidth = MIN2(b->frontxrb->drawable->width, MAX_WIDTH); - winheight = MIN2(b->frontxrb->drawable->height, MAX_HEIGHT); - - xmesa_resize_buffers(ctx, &(b->mesa_buffer), winwidth, winheight); -#else - Window root; - int xpos, ypos; - unsigned int width, height, bw, depth; - GET_CURRENT_CONTEXT(ctx); - XGetGeometry( b->xm_visual->display, b->frontxrb->pixmap, - &root, &xpos, &ypos, &width, &height, &bw, &depth); - xmesa_resize_buffers(ctx, &(b->mesa_buffer), width, height); -#endif + XMesaContext xmctx = XMESA_CONTEXT(ctx); + xmesa_check_and_update_buffer_size(xmctx, b); } diff --git a/src/mesa/drivers/x11/xm_buffer.c b/src/mesa/drivers/x11/xm_buffer.c index 2a44e126f78..490c4796767 100644 --- a/src/mesa/drivers/x11/xm_buffer.c +++ b/src/mesa/drivers/x11/xm_buffer.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.5 + * Version: 6.5.2 * - * Copyright (C) 1999-2005 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2006 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"), @@ -23,6 +23,12 @@ */ +/** + * \file xm_buffer.h + * Framebuffer and renderbuffer-related functions. + */ + + #include "glxheader.h" #include "GL/xmesa.h" #include "xmesaP.h" @@ -30,6 +36,206 @@ #include "renderbuffer.h" +#ifndef XFree86Server +static volatile int mesaXErrorFlag = 0; + +/** + * Catches potential Xlib errors. + */ +static int +mesaHandleXError(XMesaDisplay *dpy, XErrorEvent *event) +{ + (void) dpy; + (void) event; + mesaXErrorFlag = 1; + return 0; +} +#endif + + +/** + * Allocate a shared memory XImage back buffer for the given XMesaBuffer. + * Return: GL_TRUE if success, GL_FALSE if error + */ +#ifndef XFree86Server +static GLboolean +alloc_back_shm_ximage(XMesaBuffer b, GLuint width, GLuint height) +{ +#ifdef USE_XSHM + /* + * We have to do a _lot_ of error checking here to be sure we can + * really use the XSHM extension. It seems different servers trigger + * errors at different points if the extension won't work. Therefore + * we have to be very careful... + */ + GC gc; + int (*old_handler)(XMesaDisplay *, XErrorEvent *); + + if (width == 0 || height == 0) { + /* this will be true the first time we're called on 'b' */ + return GL_FALSE; + } + + b->backxrb->ximage = XShmCreateImage(b->xm_visual->display, + b->xm_visual->visinfo->visual, + b->xm_visual->visinfo->depth, + ZPixmap, NULL, &b->shminfo, + width, height); + if (b->backxrb->ximage == NULL) { + _mesa_warning(NULL, "alloc_back_buffer: Shared memory error (XShmCreateImage), disabling.\n"); + b->shm = 0; + return GL_FALSE; + } + + b->shminfo.shmid = shmget(IPC_PRIVATE, b->backxrb->ximage->bytes_per_line + * b->backxrb->ximage->height, IPC_CREAT|0777); + if (b->shminfo.shmid < 0) { + _mesa_warning(NULL, "shmget failed while allocating back buffer.\n"); + XDestroyImage(b->backxrb->ximage); + b->backxrb->ximage = NULL; + _mesa_warning(NULL, "alloc_back_buffer: Shared memory error (shmget), disabling.\n"); + b->shm = 0; + return GL_FALSE; + } + + b->shminfo.shmaddr = b->backxrb->ximage->data + = (char*)shmat(b->shminfo.shmid, 0, 0); + if (b->shminfo.shmaddr == (char *) -1) { + _mesa_warning(NULL, "shmat() failed while allocating back buffer.\n"); + XDestroyImage(b->backxrb->ximage); + shmctl(b->shminfo.shmid, IPC_RMID, 0); + b->backxrb->ximage = NULL; + _mesa_warning(NULL, "alloc_back_buffer: Shared memory error (shmat), disabling.\n"); + b->shm = 0; + return GL_FALSE; + } + + b->shminfo.readOnly = False; + mesaXErrorFlag = 0; + old_handler = XSetErrorHandler(mesaHandleXError); + /* This may trigger the X protocol error we're ready to catch: */ + XShmAttach(b->xm_visual->display, &b->shminfo); + XSync(b->xm_visual->display, False); + + if (mesaXErrorFlag) { + /* we are on a remote display, this error is normal, don't print it */ + XFlush(b->xm_visual->display); + mesaXErrorFlag = 0; + XDestroyImage(b->backxrb->ximage); + shmdt(b->shminfo.shmaddr); + shmctl(b->shminfo.shmid, IPC_RMID, 0); + b->backxrb->ximage = NULL; + b->shm = 0; + (void) XSetErrorHandler(old_handler); + return GL_FALSE; + } + + shmctl(b->shminfo.shmid, IPC_RMID, 0); /* nobody else needs it */ + + /* Finally, try an XShmPutImage to be really sure the extension works */ + gc = XCreateGC(b->xm_visual->display, b->frontxrb->drawable, 0, NULL); + XShmPutImage(b->xm_visual->display, b->frontxrb->drawable, gc, + b->backxrb->ximage, 0, 0, 0, 0, 1, 1 /*one pixel*/, False); + XSync(b->xm_visual->display, False); + XFreeGC(b->xm_visual->display, gc); + (void) XSetErrorHandler(old_handler); + if (mesaXErrorFlag) { + XFlush(b->xm_visual->display); + mesaXErrorFlag = 0; + XDestroyImage(b->backxrb->ximage); + shmdt(b->shminfo.shmaddr); + shmctl(b->shminfo.shmid, IPC_RMID, 0); + b->backxrb->ximage = NULL; + b->shm = 0; + return GL_FALSE; + } + + return GL_TRUE; +#else + /* Can't compile XSHM support */ + return GL_FALSE; +#endif +} +#endif + + + +/** + * Setup an off-screen pixmap or Ximage to use as the back buffer. + * Input: b - the X/Mesa buffer + */ +static void +alloc_back_buffer(XMesaBuffer b, GLuint width, GLuint height) +{ + if (width == 0 || height == 0) + return; + + if (b->db_mode == BACK_XIMAGE) { + /* Deallocate the old backxrb->ximage, if any */ + if (b->backxrb->ximage) { +#if defined(USE_XSHM) && !defined(XFree86Server) + if (b->shm) { + XShmDetach(b->xm_visual->display, &b->shminfo); + XDestroyImage(b->backxrb->ximage); + shmdt(b->shminfo.shmaddr); + } + else +#endif + XMesaDestroyImage(b->backxrb->ximage); + b->backxrb->ximage = NULL; + } + + /* Allocate new back buffer */ +#ifdef XFree86Server + /* Allocate a regular XImage for the back buffer. */ + b->backxrb->ximage = XMesaCreateImage(b->xm_visual->BitsPerPixel, + width, height, NULL); + { +#else + if (b->shm == 0 || !alloc_back_shm_ximage(b, width, height)) { + /* Allocate a regular XImage for the back buffer. */ + b->backxrb->ximage = XCreateImage(b->xm_visual->display, + b->xm_visual->visinfo->visual, + GET_VISUAL_DEPTH(b->xm_visual), + ZPixmap, 0, /* format, offset */ + NULL, + width, height, + 8, 0); /* pad, bytes_per_line */ +#endif + if (!b->backxrb->ximage) { + _mesa_warning(NULL, "alloc_back_buffer: XCreateImage failed.\n"); + return; + } + b->backxrb->ximage->data = (char *) MALLOC(b->backxrb->ximage->height + * b->backxrb->ximage->bytes_per_line); + if (!b->backxrb->ximage->data) { + _mesa_warning(NULL, "alloc_back_buffer: MALLOC failed.\n"); + XMesaDestroyImage(b->backxrb->ximage); + b->backxrb->ximage = NULL; + } + } + b->backxrb->pixmap = None; + } + else if (b->db_mode == BACK_PIXMAP) { + if (!width) + width = 1; + if (!height) + height = 1; + + /* Free the old back pixmap */ + if (b->backxrb->pixmap) { + XMesaFreePixmap(b->xm_visual->display, b->backxrb->pixmap); + } + /* Allocate new back pixmap */ + b->backxrb->pixmap = XMesaCreatePixmap(b->xm_visual->display, + b->frontxrb->drawable, + width, height, + GET_VISUAL_DEPTH(b->xm_visual)); + b->backxrb->ximage = NULL; + } +} + + static void xmesa_delete_renderbuffer(struct gl_renderbuffer *rb) { @@ -68,7 +274,6 @@ xmesa_alloc_front_storage(GLcontext *ctx, struct gl_renderbuffer *rb, /** * Reallocate renderbuffer storage for back color buffer. - * XXX we should resize the back pixmap/ximage here. */ static GLboolean xmesa_alloc_back_storage(GLcontext *ctx, struct gl_renderbuffer *rb, @@ -76,7 +281,12 @@ xmesa_alloc_back_storage(GLcontext *ctx, struct gl_renderbuffer *rb, { struct xmesa_renderbuffer *xrb = xmesa_renderbuffer(rb); + /* reallocate the back buffer XImage or Pixmap */ + assert(xrb->Parent); + alloc_back_buffer(xrb->Parent, width, height); + /* same as front buffer */ + /* XXX why is this here? */ (void) xmesa_alloc_front_storage(ctx, rb, internalFormat, width, height); /* plus... */ diff --git a/src/mesa/drivers/x11/xm_dd.c b/src/mesa/drivers/x11/xm_dd.c index 11d323082e6..d272630d18a 100644 --- a/src/mesa/drivers/x11/xm_dd.c +++ b/src/mesa/drivers/x11/xm_dd.c @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.5.1 + * Version: 6.5.2 * * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. * @@ -23,6 +23,11 @@ */ +/** + * \file xm_dd.h + * General device driver functions for Xlib driver. + */ + #include "glxheader.h" #include "bufferobj.h" #include "buffers.h" @@ -89,50 +94,6 @@ const int xmesa_kernel1[16] = { }; -/* - * Return the size (width, height) of the X window for the given GLframebuffer. - * Output: width - width of buffer in pixels. - * height - height of buffer in pixels. - */ -static void -get_buffer_size( GLframebuffer *buffer, GLuint *width, GLuint *height ) -{ - /* We can do this cast because the first field in the XMesaBuffer - * struct is a GLframebuffer struct. If this weren't true, we'd - * need a pointer from the GLframebuffer to the XMesaBuffer. - */ - const XMesaBuffer xmBuffer = (XMesaBuffer) buffer; - unsigned int winwidth, winheight; -#ifdef XFree86Server - /* XFree86 GLX renderer */ - winwidth = MIN2(xmBuffer->frontxrb->drawable->width, MAX_WIDTH); - winheight = MIN2(xmBuffer->frontxrb->drawable->height, MAX_HEIGHT); -#else - Window root; - Status stat; - int winx, winy; - unsigned int bw, d; - - _glthread_LOCK_MUTEX(_xmesa_lock); - XSync(xmBuffer->xm_visual->display, 0); /* added for Chromium */ - - stat = XGetGeometry( xmBuffer->xm_visual->display, xmBuffer->frontxrb->pixmap, - &root, &winx, &winy, &winwidth, &winheight, &bw, &d ); - _glthread_UNLOCK_MUTEX(_xmesa_lock); - - if (!stat) { - /* probably querying a window that's recently been destroyed */ - _mesa_warning(NULL, "XGetGeometry failed!\n"); - *width = *height = 1; - return; - } -#endif - - *width = winwidth; - *height = winheight; -} - - static void finish_or_flush( GLcontext *ctx ) { @@ -250,7 +211,7 @@ color_mask(GLcontext *ctx, * Clear the front or back color buffer, if it's implemented with a pixmap. */ static void -clear_pixmap(GLcontext *ctx, struct xmesa_renderbuffer *xrb, GLboolean all, +clear_pixmap(GLcontext *ctx, struct xmesa_renderbuffer *xrb, GLint x, GLint y, GLint width, GLint height) { const XMesaContext xmesa = XMESA_CONTEXT(ctx); @@ -263,92 +224,41 @@ clear_pixmap(GLcontext *ctx, struct xmesa_renderbuffer *xrb, GLboolean all, assert(xrb->pixmap); assert(xmbuf->cleargc); - if (all) { - XMesaFillRectangle( xmesa->display, xrb->pixmap, xmbuf->cleargc, - 0, 0, xrb->Base.Width + 1, xrb->Base.Height + 1 ); - } - else { - XMesaFillRectangle( xmesa->display, xrb->pixmap, xmbuf->cleargc, - x, xrb->Base.Height - y - height, - width, height ); - } + XMesaFillRectangle( xmesa->display, xrb->pixmap, xmbuf->cleargc, + x, xrb->Base.Height - y - height, + width, height ); } static void clear_8bit_ximage( GLcontext *ctx, struct xmesa_renderbuffer *xrb, - GLboolean all, GLint x, GLint y, GLint width, GLint height ) + GLint x, GLint y, GLint width, GLint height ) { const XMesaContext xmesa = XMESA_CONTEXT(ctx); - - if (all) { - const size_t n = xrb->ximage->bytes_per_line * xrb->Base.Height; - MEMSET( xrb->ximage->data, xmesa->clearpixel, n ); - } - else { - GLint i; - for (i=0;iclearpixel, width ); - } + GLint i; + for (i = 0; i < height; i++) { + GLubyte *ptr = PIXEL_ADDR1(xrb, x, y + i); + MEMSET( ptr, xmesa->clearpixel, width ); } } static void clear_HPCR_ximage( GLcontext *ctx, struct xmesa_renderbuffer *xrb, - GLboolean all, GLint x, GLint y, GLint width, GLint height ) + GLint x, GLint y, GLint width, GLint height ) { const XMesaContext xmesa = XMESA_CONTEXT(ctx); - - if (all) { - const GLuint c16 = xrb->ximage->bytes_per_line & ~0xf; - GLuint i; - GLubyte *ptr = (GLubyte *) xrb->ximage->data; - for (i = 0; i < xrb->Base.Height; i++) { - GLuint j; - const GLubyte *sptr = xmesa->xm_visual->hpcr_clear_ximage_pattern[0]; - if (i&1) { - sptr += 16; - } - for (j=0; jximage->bytes_per_line; j++) { - *ptr = sptr[j&15]; - ptr++; - } + GLint i; + for (i = y; i < y + height; i++) { + GLubyte *ptr = PIXEL_ADDR1( xrb, x, i ); + int j; + const GLubyte *sptr = xmesa->xm_visual->hpcr_clear_ximage_pattern[0]; + if (i & 1) { + sptr += 16; } - } - else { - GLint i; - for (i=y; ixm_visual->hpcr_clear_ximage_pattern[0]; - if (i&1) { - sptr += 16; - } - for (j=x; jclearpixel; + GLuint pixel = (GLuint) xmesa->clearpixel; + GLint i, j; if (xmesa->swapbytes) { pixel = ((pixel >> 8) & 0x00ff) | ((pixel << 8) & 0xff00); } - if (all) { - GLuint *ptr4 = (GLuint *) xrb->ximage->data; - if ((pixel & 0xff) == ((pixel >> 8) & 0xff)) { - /* low and high bytes are equal so use memset() */ - const GLuint n = xrb->ximage->bytes_per_line * xrb->Base.Height; - MEMSET( ptr4, pixel & 0xff, n ); - } - else { - const GLuint n = xrb->ximage->bytes_per_line * xrb->Base.Height / 4; - GLuint i; - pixel = pixel | (pixel<<16); - for (i = 0; i < n; i++) { - ptr4[i] = pixel; - } - ptr4 += n; - /* might be one last GLushort to set */ - if ((xrb->ximage->bytes_per_line * xrb->Base.Height) & 0x2) - *(GLushort *)ptr4 = pixel & 0xffff; - } - } - else { - GLint i, j; - for (j=0;j */ static void clear_24bit_ximage(GLcontext *ctx, struct xmesa_renderbuffer *xrb, - GLboolean all, GLint x, GLint y, GLint width, GLint height) + GLint x, GLint y, GLint width, GLint height) { const XMesaContext xmesa = XMESA_CONTEXT(ctx); const GLubyte r = xmesa->clearcolor[0]; const GLubyte g = xmesa->clearcolor[1]; const GLubyte b = xmesa->clearcolor[2]; - if (all) { - if (r == g && g == b) { - /* same value for all three components (gray) */ - const GLint w3 = xrb->Base.Width * 3; - const GLint h = xrb->Base.Height; - GLint i; - for (i = 0; i < h; i++) { - bgr_t *ptr3 = PIXEL_ADDR3(xrb, 0, i); - MEMSET(ptr3, r, w3); - } - } - else { - /* the usual case */ - const GLint w = xrb->Base.Width; - const GLint h = xrb->Base.Height; - GLint i, j; - for (i = 0; i < h; i++) { - bgr_t *ptr3 = PIXEL_ADDR3(xrb, 0, i); - for (j = 0; j < w; j++) { - ptr3->r = r; - ptr3->g = g; - ptr3->b = b; - ptr3++; - } - } + if (r == g && g == b) { + /* same value for all three components (gray) */ + GLint j; + for (j = 0; j < height; j++) { + bgr_t *ptr3 = PIXEL_ADDR3(xrb, x, y + j); + MEMSET(ptr3, r, 3 * width); } } else { - /* only clear subrect of color buffer */ - if (r == g && g == b) { - /* same value for all three components (gray) */ - GLint j; - for (j=0;jr = r; - ptr3->g = g; - ptr3->b = b; - ptr3++; - } + /* non-gray clear color */ + GLint i, j; + for (j = 0; j < height; j++) { + bgr_t *ptr3 = PIXEL_ADDR3(xrb, x, y + j); + for (i = 0; i < width; i++) { + ptr3->r = r; + ptr3->g = g; + ptr3->b = b; + ptr3++; } } } @@ -463,7 +321,7 @@ clear_24bit_ximage(GLcontext *ctx, struct xmesa_renderbuffer *xrb, static void clear_32bit_ximage(GLcontext *ctx, struct xmesa_renderbuffer *xrb, - GLboolean all, GLint x, GLint y, GLint width, GLint height) + GLint x, GLint y, GLint width, GLint height) { const XMesaContext xmesa = XMESA_CONTEXT(ctx); register GLuint pixel = (GLuint) xmesa->clearpixel; @@ -478,10 +336,12 @@ clear_32bit_ximage(GLcontext *ctx, struct xmesa_renderbuffer *xrb, | ((pixel << 24) & 0xff000000); } - if (all) { + if (width == xrb->Base.Width && height == xrb->Base.Height) { + /* clearing whole buffer */ const GLuint n = xrb->Base.Width * xrb->Base.Height; GLuint *ptr4 = (GLuint *) xrb->ximage->data; if (pixel == 0) { + /* common case */ _mesa_memset(ptr4, pixel, 4 * n); } else { @@ -491,6 +351,7 @@ clear_32bit_ximage(GLcontext *ctx, struct xmesa_renderbuffer *xrb, } } else { + /* clearing scissored region */ GLint i, j; for (j = 0; j < height; j++) { GLuint *ptr4 = PIXEL_ADDR4(xrb, x, y + j); @@ -504,15 +365,12 @@ clear_32bit_ximage(GLcontext *ctx, struct xmesa_renderbuffer *xrb, static void clear_nbit_ximage(GLcontext *ctx, struct xmesa_renderbuffer *xrb, - GLboolean all, GLint x, GLint y, GLint width, GLint height) + GLint x, GLint y, GLint width, GLint height) { const XMesaContext xmesa = XMESA_CONTEXT(ctx); XMesaImage *img = xrb->ximage; GLint i, j; - /* We can ignore 'all' here - x, y, width, height are always right */ - (void) all; - /* TODO: optimize this */ y = YFLIP(xrb, y); for (j = 0; j < height; j++) { @@ -525,65 +383,46 @@ clear_nbit_ximage(GLcontext *ctx, struct xmesa_renderbuffer *xrb, static void -clear_buffers( GLcontext *ctx, GLbitfield mask, - GLboolean all, GLint x, GLint y, GLint width, GLint height ) +clear_buffers(GLcontext *ctx, GLbitfield buffers) { if (ctx->DrawBuffer->Name == 0) { /* this is a window system framebuffer */ const GLuint *colorMask = (GLuint *) &ctx->Color.ColorMask; XMesaBuffer b = XMESA_BUFFER(ctx->DrawBuffer); + const GLint x = ctx->DrawBuffer->_Xmin; + const GLint y = ctx->DrawBuffer->_Ymin; + const GLint width = ctx->DrawBuffer->_Xmax - x; + const GLint height = ctx->DrawBuffer->_Ymax - y; /* we can't handle color or index masking */ if (*colorMask == 0xffffffff && ctx->Color.IndexMask == 0xffffffff) { - if (mask & BUFFER_BIT_FRONT_LEFT) { + if (buffers & BUFFER_BIT_FRONT_LEFT) { /* clear front color buffer */ struct gl_renderbuffer *frontRb = ctx->DrawBuffer->Attachment[BUFFER_FRONT_LEFT].Renderbuffer; if (b->frontxrb == xmesa_renderbuffer(frontRb)) { /* renderbuffer is not wrapped - great! */ - b->frontxrb->clearFunc(ctx, b->frontxrb, all, x, y, - width, height); - mask &= ~BUFFER_BIT_FRONT_LEFT; + b->frontxrb->clearFunc(ctx, b->frontxrb, x, y, width, height); + buffers &= ~BUFFER_BIT_FRONT_LEFT; } else { /* we can't directly clear an alpha-wrapped color buffer */ } } - if (mask & BUFFER_BIT_BACK_LEFT) { + if (buffers & BUFFER_BIT_BACK_LEFT) { /* clear back color buffer */ struct gl_renderbuffer *backRb = ctx->DrawBuffer->Attachment[BUFFER_BACK_LEFT].Renderbuffer; if (b->backxrb == xmesa_renderbuffer(backRb)) { /* renderbuffer is not wrapped - great! */ - b->backxrb->clearFunc(ctx, b->backxrb, all, x, y, - width, height); - mask &= ~BUFFER_BIT_BACK_LEFT; + b->backxrb->clearFunc(ctx, b->backxrb, x, y, width, height); + buffers &= ~BUFFER_BIT_BACK_LEFT; } } } } - if (mask) - _swrast_Clear( ctx, mask, all, x, y, width, height ); -} - - -/** - * Called by ctx->Driver.ResizeBuffers() - * Resize the front/back colorbuffers to match the latest window size. - */ -void -xmesa_resize_buffers(GLcontext *ctx, GLframebuffer *buffer, - GLuint width, GLuint height) -{ - /* We can do this cast because the first field in the XMesaBuffer - * struct is a GLframebuffer struct. If this weren't true, we'd - * need a pointer from the GLframebuffer to the XMesaBuffer. - */ - XMesaBuffer xmBuffer = (XMesaBuffer) buffer; - - xmesa_alloc_back_buffer(xmBuffer, width, height); - - _mesa_resize_framebuffer(ctx, buffer, width, height); + if (buffers) + _swrast_Clear(ctx, buffers); } @@ -602,37 +441,38 @@ xmesa_DrawPixels_8R8G8B( GLcontext *ctx, const struct gl_pixelstore_attrib *unpack, const GLvoid *pixels ) { - struct xmesa_renderbuffer *xrb - = (struct xmesa_renderbuffer *) ctx->DrawBuffer->_ColorDrawBuffers[0][0]->Wrapped; - - const XMesaContext xmesa = XMESA_CONTEXT(ctx); const SWcontext *swrast = SWRAST_CONTEXT( ctx ); - XMesaDisplay *dpy = xmesa->xm_visual->display; - XMesaBuffer xmbuf = XMESA_BUFFER(ctx->DrawBuffer); - const XMesaGC gc = xmbuf->gc; - - ASSERT(dpy); - ASSERT(gc); - ASSERT(xmesa->xm_visual->dithered_pf == PF_8R8G8B); - ASSERT(xmesa->xm_visual->undithered_pf == PF_8R8G8B); + struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[0][0]; + struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb->Wrapped; if (swrast->NewState) _swrast_validate_derived( ctx ); - if (xrb->pixmap && - xrb->Base.AlphaBits == 0 && + if (ctx->DrawBuffer->Name == 0 && format == GL_BGRA && type == GL_UNSIGNED_BYTE && (swrast->_RasterMask & ~CLIP_BIT) == 0 && /* no blend, z-test, etc */ ctx->_ImageTransferState == 0 && /* no color tables, scale/bias, etc */ ctx->Pixel.ZoomX == 1.0 && /* no zooming */ - ctx->Pixel.ZoomY == 1.0) { + ctx->Pixel.ZoomY == 1.0 && + xrb->pixmap && + xrb->Base.AlphaBits == 0) + { + const XMesaContext xmesa = XMESA_CONTEXT(ctx); + XMesaBuffer xmbuf = XMESA_BUFFER(ctx->DrawBuffer); + XMesaDisplay *dpy = xmesa->xm_visual->display; + const XMesaGC gc = xmbuf->gc; int dstX = x; int dstY = y; int w = width; int h = height; struct gl_pixelstore_attrib clippedUnpack = *unpack; + ASSERT(xmesa->xm_visual->dithered_pf == PF_8R8G8B); + ASSERT(xmesa->xm_visual->undithered_pf == PF_8R8G8B); + ASSERT(dpy); + ASSERT(gc); + if (unpack->BufferObj->Name) { /* unpack from PBO */ GLubyte *buf; @@ -1119,33 +959,6 @@ choose_tex_format( GLcontext *ctx, GLint internalFormat, } -/** - * Get the current drawing (and reading) window's size and update the - * corresponding gl_framebuffer(s) if needed. - */ -static void -update_framebuffer_size(GLcontext *ctx) -{ - struct gl_framebuffer *fb = ctx->WinSysDrawBuffer; - GLuint newWidth, newHeight; - get_buffer_size(fb, &newWidth, &newHeight); - if (newWidth != fb->Width || newHeight != fb->Height) { - xmesa_resize_buffers(ctx, fb, newWidth, newHeight); - } - - if (ctx->WinSysReadBuffer != ctx->WinSysDrawBuffer) { - /* Update readbuffer's size */ - struct gl_framebuffer *fb = ctx->WinSysReadBuffer; - GLuint newWidth, newHeight; - get_buffer_size(fb, &newWidth, &newHeight); - if (newWidth != fb->Width || newHeight != fb->Height) { - xmesa_resize_buffers(ctx, fb, newWidth, newHeight); - ctx->NewState |= _NEW_BUFFERS; - } - } -} - - /** * Called by glViewport. * This is a good time for us to poll the current X window size and adjust @@ -1160,11 +973,15 @@ update_framebuffer_size(GLcontext *ctx) static void xmesa_viewport(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h) { + XMesaContext xmctx = XMESA_CONTEXT(ctx); + XMesaBuffer xmdrawbuf = XMESA_BUFFER(ctx->WinSysDrawBuffer); + XMesaBuffer xmreadbuf = XMESA_BUFFER(ctx->WinSysReadBuffer); + xmesa_check_and_update_buffer_size(xmctx, xmdrawbuf); + xmesa_check_and_update_buffer_size(xmctx, xmreadbuf); (void) x; (void) y; (void) w; (void) h; - update_framebuffer_size(ctx); } @@ -1248,7 +1065,7 @@ xmesa_init_driver_functions( XMesaVisual xmvisual, { driver->GetString = get_string; driver->UpdateState = xmesa_update_state; - driver->GetBufferSize = get_buffer_size; + driver->GetBufferSize = NULL; /* OBSOLETE */ driver->Flush = finish_or_flush; driver->Finish = finish_or_flush; driver->ClearIndex = clear_index; @@ -1257,7 +1074,6 @@ xmesa_init_driver_functions( XMesaVisual xmvisual, driver->ColorMask = color_mask; driver->Enable = enable; driver->Clear = clear_buffers; - driver->ResizeBuffers = xmesa_resize_buffers; driver->Viewport = xmesa_viewport; #ifndef XFree86Server driver->CopyPixels = xmesa_CopyPixels; diff --git a/src/mesa/drivers/x11/xm_span.c b/src/mesa/drivers/x11/xm_span.c index ff0557800ae..a24966b3aeb 100644 --- a/src/mesa/drivers/x11/xm_span.c +++ b/src/mesa/drivers/x11/xm_span.c @@ -1453,7 +1453,7 @@ static void put_row_8R8G8B24_ximage( PUT_ROW_ARGS ) pixel &= 0x00ffffff; pixel |= rgba[i][BCOMP] << 24; *ptr4++ = pixel; - pixel = *ptr4 && 0xffff0000; + pixel = *ptr4 & 0xffff0000; pixel |= rgba[i][GCOMP]; pixel |= rgba[i][RCOMP] << 8; *ptr4 = pixel; @@ -1463,7 +1463,7 @@ static void put_row_8R8G8B24_ximage( PUT_ROW_ARGS ) pixel |= rgba[i][BCOMP] << 16; pixel |= rgba[i][GCOMP] << 24; *ptr4++ = pixel; - pixel = *ptr4 && 0xffffff00; + pixel = *ptr4 & 0xffffff00; pixel |= rgba[i][RCOMP]; *ptr4 = pixel; break; @@ -1493,7 +1493,7 @@ static void put_row_8R8G8B24_ximage( PUT_ROW_ARGS ) pixel &= 0x00ffffff; pixel |= rgba[i][BCOMP] << 24; *ptr4++ = pixel; - pixel = *ptr4 && 0xffff0000; + pixel = *ptr4 & 0xffff0000; pixel |= rgba[i][GCOMP]; pixel |= rgba[i++][RCOMP] << 8; *ptr4 = pixel; @@ -1504,7 +1504,7 @@ static void put_row_8R8G8B24_ximage( PUT_ROW_ARGS ) pixel |= rgba[i][BCOMP] << 16; pixel |= rgba[i][GCOMP] << 24; *ptr4++ = pixel; - pixel = *ptr4 && 0xffffff00; + pixel = *ptr4 & 0xffffff00; pixel |= rgba[i++][RCOMP]; *ptr4 = pixel; if (0 == --w) diff --git a/src/mesa/drivers/x11/xmesaP.h b/src/mesa/drivers/x11/xmesaP.h index 4db0872621f..e332fb5480c 100644 --- a/src/mesa/drivers/x11/xmesaP.h +++ b/src/mesa/drivers/x11/xmesaP.h @@ -56,8 +56,7 @@ struct xmesa_renderbuffer; /* Function pointer for clearing color buffers */ typedef void (*ClearFunc)( GLcontext *ctx, struct xmesa_renderbuffer *xrb, - GLboolean all, GLint x, GLint y, - GLint width, GLint height ); + GLint x, GLint y, GLint width, GLint height ); @@ -81,8 +80,9 @@ enum pixel_format { }; -/* - * "Derived" from GLvisual. Basically corresponds to an XVisualInfo. +/** + * Visual inforation, derived from GLvisual. + * Basically corresponds to an XVisualInfo. */ struct xmesa_visual { GLvisual mesa_visual; /* Device independent visual parameters */ @@ -127,8 +127,9 @@ struct xmesa_visual { }; -/* - * "Derived" from __GLcontextRec. Basically corresponds to a GLXContext. +/** + * Context info, dDerived from GLcontext. + * Basically corresponds to a GLXContext. */ struct xmesa_context { GLcontext mesa; /* the core library context (containment) */ @@ -146,7 +147,9 @@ struct xmesa_context { }; - +/** + * Types of X/GLX drawables we might render into. + */ typedef enum { WINDOW, /* An X window */ GLXWINDOW, /* GLX window */ @@ -155,9 +158,11 @@ typedef enum { } BufferType; -/* Values for db_mode: */ +/** Values for db_mode: */ +/*@{*/ #define BACK_PIXMAP 1 #define BACK_XIMAGE 2 +/*@}*/ /** @@ -175,6 +180,7 @@ struct xmesa_renderbuffer { struct gl_renderbuffer Base; /* Base class */ + XMesaBuffer Parent; /**< The XMesaBuffer this renderbuffer belongs to */ XMesaDrawable drawable; /* Usually the X window ID */ XMesaPixmap pixmap; /* Back color buffer */ XMesaImage *ximage; /* The back buffer, if not using a Pixmap */ @@ -194,8 +200,9 @@ struct xmesa_renderbuffer }; -/* - * "Derived" from GLframebuffer. Basically corresponds to a GLXDrawable. +/** + * Framebuffer information, derived from. + * Basically corresponds to a GLXDrawable. */ struct xmesa_buffer { GLframebuffer mesa_buffer; /* depth, stencil, accum, etc buffers */ @@ -264,7 +271,7 @@ struct xmesa_buffer { }; -/* +/** * If pixelformat==PF_TRUECOLOR: */ #define PACK_TRUECOLOR( PIXEL, R, G, B ) \ @@ -273,7 +280,7 @@ struct xmesa_buffer { | xmesa->xm_visual->BtoPixel[B]; \ -/* +/** * If pixelformat==PF_TRUEDITHER: */ #define PACK_TRUEDITHER( PIXEL, X, Y, R, G, B ) \ @@ -286,14 +293,14 @@ struct xmesa_buffer { -/* +/** * If pixelformat==PF_8A8B8G8R: */ #define PACK_8A8B8G8R( R, G, B, A ) \ ( ((A) << 24) | ((B) << 16) | ((G) << 8) | (R) ) -/* +/** * Like PACK_8A8B8G8R() but don't use alpha. This is usually an acceptable * shortcut. */ @@ -301,19 +308,19 @@ struct xmesa_buffer { -/* +/** * If pixelformat==PF_8R8G8B: */ #define PACK_8R8G8B( R, G, B) ( ((R) << 16) | ((G) << 8) | (B) ) -/* +/** * If pixelformat==PF_5R6G5B: */ #define PACK_5R6G5B( R, G, B) ( (((R) & 0xf8) << 8) | (((G) & 0xfc) << 3) | ((B) >> 3) ) -/* +/** * If pixelformat==PF_8A8R8G8B: */ #define PACK_8A8R8G8B( R, G, B, A ) \ @@ -321,7 +328,7 @@ struct xmesa_buffer { -/* +/** * If pixelformat==PF_DITHER: * * Improved 8-bit RGB dithering code contributed by Bob Mercier @@ -398,7 +405,7 @@ extern const int xmesa_kernel8[DITH_DY * DITH_DX]; -/* +/** * If pixelformat==PF_LOOKUP: */ #define _dither_lookup(C, c) (((unsigned)((DITH_N * (C - 1) + 1) * c)) >> 12) @@ -412,8 +419,7 @@ extern const int xmesa_kernel8[DITH_DY * DITH_DX]; _dither_lookup(DITH_B, (B)))] - -/* +/** * If pixelformat==PF_HPCR: * * HP Color Recovery dithering (ad@lms.be 30/08/95) @@ -433,7 +439,7 @@ extern const short xmesa_HPCR_DRGB[3][2][16]; -/* +/** * If pixelformat==PF_1BIT: */ extern const int xmesa_kernel1[16]; @@ -444,20 +450,20 @@ extern const int xmesa_kernel1[16]; -/* +/** * If pixelformat==PF_GRAYSCALE: */ #define GRAY_RGB( R, G, B ) XMESA_BUFFER(ctx->DrawBuffer)->color_table[((R) + (G) + (B))/3] -/* +/** * Converts a GL window Y coord to an X window Y coord: */ #define YFLIP(XRB, Y) ((XRB)->bottom - (Y)) -/* +/** * Return the address of a 1, 2 or 4-byte pixel in the buffer's XImage: * X==0 is left, Y==0 is bottom. */ @@ -475,23 +481,6 @@ extern const int xmesa_kernel1[16]; - -/* - * Return pointer to XMesaContext corresponding to a Mesa GLcontext. - * Since we're using structure containment, it's just a cast!. - * XXX should use inlined function for better type safety. - */ -#define XMESA_CONTEXT(MESACTX) ((XMesaContext) (MESACTX)) - -/* - * Return pointer to XMesaBuffer corresponding to a Mesa GLframebuffer. - * Since we're using structure containment, it's just a cast!. - * XXX should use inlined function for better type safety. - */ -#define XMESA_BUFFER(MESABUFF) ((XMesaBuffer) (MESABUFF)) - - - /* * External functions: */ @@ -506,21 +495,25 @@ xmesa_color_to_pixel( GLcontext *ctx, GLuint pixelFormat ); extern void -xmesa_alloc_back_buffer(XMesaBuffer b, GLuint width, GLuint height); +xmesa_get_window_size(XMesaDisplay *dpy, XMesaBuffer b, + GLuint *width, GLuint *height); -extern void xmesa_resize_buffers(GLcontext *ctx, GLframebuffer *buffer, - GLuint width, GLuint height); +extern void +xmesa_check_and_update_buffer_size(XMesaContext xmctx, XMesaBuffer drawBuffer); -extern void xmesa_init_driver_functions( XMesaVisual xmvisual, - struct dd_function_table *driver ); +extern void +xmesa_init_driver_functions( XMesaVisual xmvisual, + struct dd_function_table *driver ); -extern void xmesa_update_state( GLcontext *ctx, GLbitfield new_state ); +extern void +xmesa_update_state( GLcontext *ctx, GLbitfield new_state ); extern void xmesa_set_renderbuffer_funcs(struct xmesa_renderbuffer *xrb, enum pixel_format pixelformat, GLint depth); -extern void xmesa_destroy_buffers_on_display(XMesaDisplay *dpy); +extern void +xmesa_destroy_buffers_on_display(XMesaDisplay *dpy); /** @@ -533,6 +526,30 @@ xmesa_renderbuffer(struct gl_renderbuffer *rb) } +/** + * Return pointer to XMesaContext corresponding to a Mesa GLcontext. + * Since we're using structure containment, it's just a cast!. + * XXX should use inlined function for better type safety. + */ +static INLINE XMesaContext +XMESA_CONTEXT(GLcontext *ctx) +{ + return (XMesaContext) ctx; +} + + +/** + * Return pointer to XMesaBuffer corresponding to a Mesa GLframebuffer. + * Since we're using structure containment, it's just a cast!. + * XXX should use inlined function for better type safety. + */ +static INLINE XMesaBuffer +XMESA_BUFFER(GLframebuffer *b) +{ + return (XMesaBuffer) b; +} + + /* Plugged into the software rasterizer. Try to use internal * swrast-style point, line and triangle functions. */ diff --git a/src/mesa/glapi/dispatch.h b/src/mesa/glapi/dispatch.h index 98553a2263c..a128164323a 100644 --- a/src/mesa/glapi/dispatch.h +++ b/src/mesa/glapi/dispatch.h @@ -1282,6 +1282,45 @@ #if !defined(IN_DRI_DRIVER) +#define CALL_AttachShader(disp, parameters) (*((disp)->AttachShader)) parameters +#define GET_AttachShader(disp) ((disp)->AttachShader) +#define SET_AttachShader(disp, fn) ((disp)->AttachShader = fn) +#define CALL_CreateProgram(disp, parameters) (*((disp)->CreateProgram)) parameters +#define GET_CreateProgram(disp) ((disp)->CreateProgram) +#define SET_CreateProgram(disp, fn) ((disp)->CreateProgram = fn) +#define CALL_CreateShader(disp, parameters) (*((disp)->CreateShader)) parameters +#define GET_CreateShader(disp) ((disp)->CreateShader) +#define SET_CreateShader(disp, fn) ((disp)->CreateShader = fn) +#define CALL_DeleteProgram(disp, parameters) (*((disp)->DeleteProgram)) parameters +#define GET_DeleteProgram(disp) ((disp)->DeleteProgram) +#define SET_DeleteProgram(disp, fn) ((disp)->DeleteProgram = fn) +#define CALL_DeleteShader(disp, parameters) (*((disp)->DeleteShader)) parameters +#define GET_DeleteShader(disp) ((disp)->DeleteShader) +#define SET_DeleteShader(disp, fn) ((disp)->DeleteShader = fn) +#define CALL_DetachShader(disp, parameters) (*((disp)->DetachShader)) parameters +#define GET_DetachShader(disp) ((disp)->DetachShader) +#define SET_DetachShader(disp, fn) ((disp)->DetachShader = fn) +#define CALL_GetAttachedShaders(disp, parameters) (*((disp)->GetAttachedShaders)) parameters +#define GET_GetAttachedShaders(disp) ((disp)->GetAttachedShaders) +#define SET_GetAttachedShaders(disp, fn) ((disp)->GetAttachedShaders = fn) +#define CALL_GetProgramInfoLog(disp, parameters) (*((disp)->GetProgramInfoLog)) parameters +#define GET_GetProgramInfoLog(disp) ((disp)->GetProgramInfoLog) +#define SET_GetProgramInfoLog(disp, fn) ((disp)->GetProgramInfoLog = fn) +#define CALL_GetProgramiv(disp, parameters) (*((disp)->GetProgramiv)) parameters +#define GET_GetProgramiv(disp) ((disp)->GetProgramiv) +#define SET_GetProgramiv(disp, fn) ((disp)->GetProgramiv = fn) +#define CALL_GetShaderInfoLog(disp, parameters) (*((disp)->GetShaderInfoLog)) parameters +#define GET_GetShaderInfoLog(disp) ((disp)->GetShaderInfoLog) +#define SET_GetShaderInfoLog(disp, fn) ((disp)->GetShaderInfoLog = fn) +#define CALL_GetShaderiv(disp, parameters) (*((disp)->GetShaderiv)) parameters +#define GET_GetShaderiv(disp) ((disp)->GetShaderiv) +#define SET_GetShaderiv(disp, fn) ((disp)->GetShaderiv = fn) +#define CALL_IsProgram(disp, parameters) (*((disp)->IsProgram)) parameters +#define GET_IsProgram(disp) ((disp)->IsProgram) +#define SET_IsProgram(disp, fn) ((disp)->IsProgram = fn) +#define CALL_IsShader(disp, parameters) (*((disp)->IsShader)) parameters +#define GET_IsShader(disp) ((disp)->IsShader) +#define SET_IsShader(disp, fn) ((disp)->IsShader = fn) #define CALL_StencilFuncSeparate(disp, parameters) (*((disp)->StencilFuncSeparate)) parameters #define GET_StencilFuncSeparate(disp) ((disp)->StencilFuncSeparate) #define SET_StencilFuncSeparate(disp, fn) ((disp)->StencilFuncSeparate = fn) @@ -1291,6 +1330,24 @@ #define CALL_StencilOpSeparate(disp, parameters) (*((disp)->StencilOpSeparate)) parameters #define GET_StencilOpSeparate(disp) ((disp)->StencilOpSeparate) #define SET_StencilOpSeparate(disp, fn) ((disp)->StencilOpSeparate = fn) +#define CALL_UniformMatrix2x3fv(disp, parameters) (*((disp)->UniformMatrix2x3fv)) parameters +#define GET_UniformMatrix2x3fv(disp) ((disp)->UniformMatrix2x3fv) +#define SET_UniformMatrix2x3fv(disp, fn) ((disp)->UniformMatrix2x3fv = fn) +#define CALL_UniformMatrix2x4fv(disp, parameters) (*((disp)->UniformMatrix2x4fv)) parameters +#define GET_UniformMatrix2x4fv(disp) ((disp)->UniformMatrix2x4fv) +#define SET_UniformMatrix2x4fv(disp, fn) ((disp)->UniformMatrix2x4fv = fn) +#define CALL_UniformMatrix3x2fv(disp, parameters) (*((disp)->UniformMatrix3x2fv)) parameters +#define GET_UniformMatrix3x2fv(disp) ((disp)->UniformMatrix3x2fv) +#define SET_UniformMatrix3x2fv(disp, fn) ((disp)->UniformMatrix3x2fv = fn) +#define CALL_UniformMatrix3x4fv(disp, parameters) (*((disp)->UniformMatrix3x4fv)) parameters +#define GET_UniformMatrix3x4fv(disp) ((disp)->UniformMatrix3x4fv) +#define SET_UniformMatrix3x4fv(disp, fn) ((disp)->UniformMatrix3x4fv = fn) +#define CALL_UniformMatrix4x2fv(disp, parameters) (*((disp)->UniformMatrix4x2fv)) parameters +#define GET_UniformMatrix4x2fv(disp) ((disp)->UniformMatrix4x2fv) +#define SET_UniformMatrix4x2fv(disp, fn) ((disp)->UniformMatrix4x2fv = fn) +#define CALL_UniformMatrix4x3fv(disp, parameters) (*((disp)->UniformMatrix4x3fv)) parameters +#define GET_UniformMatrix4x3fv(disp) ((disp)->UniformMatrix4x3fv) +#define SET_UniformMatrix4x3fv(disp, fn) ((disp)->UniformMatrix4x3fv = fn) #define CALL_LoadTransposeMatrixdARB(disp, parameters) (*((disp)->LoadTransposeMatrixdARB)) parameters #define GET_LoadTransposeMatrixdARB(disp) ((disp)->LoadTransposeMatrixdARB) #define SET_LoadTransposeMatrixdARB(disp, fn) ((disp)->LoadTransposeMatrixdARB = fn) @@ -1687,45 +1744,6 @@ #define CALL_PolygonOffsetEXT(disp, parameters) (*((disp)->PolygonOffsetEXT)) parameters #define GET_PolygonOffsetEXT(disp) ((disp)->PolygonOffsetEXT) #define SET_PolygonOffsetEXT(disp, fn) ((disp)->PolygonOffsetEXT = fn) -#define CALL_GetHistogramEXT(disp, parameters) (*((disp)->GetHistogramEXT)) parameters -#define GET_GetHistogramEXT(disp) ((disp)->GetHistogramEXT) -#define SET_GetHistogramEXT(disp, fn) ((disp)->GetHistogramEXT = fn) -#define CALL_GetHistogramParameterfvEXT(disp, parameters) (*((disp)->GetHistogramParameterfvEXT)) parameters -#define GET_GetHistogramParameterfvEXT(disp) ((disp)->GetHistogramParameterfvEXT) -#define SET_GetHistogramParameterfvEXT(disp, fn) ((disp)->GetHistogramParameterfvEXT = fn) -#define CALL_GetHistogramParameterivEXT(disp, parameters) (*((disp)->GetHistogramParameterivEXT)) parameters -#define GET_GetHistogramParameterivEXT(disp) ((disp)->GetHistogramParameterivEXT) -#define SET_GetHistogramParameterivEXT(disp, fn) ((disp)->GetHistogramParameterivEXT = fn) -#define CALL_GetMinmaxEXT(disp, parameters) (*((disp)->GetMinmaxEXT)) parameters -#define GET_GetMinmaxEXT(disp) ((disp)->GetMinmaxEXT) -#define SET_GetMinmaxEXT(disp, fn) ((disp)->GetMinmaxEXT = fn) -#define CALL_GetMinmaxParameterfvEXT(disp, parameters) (*((disp)->GetMinmaxParameterfvEXT)) parameters -#define GET_GetMinmaxParameterfvEXT(disp) ((disp)->GetMinmaxParameterfvEXT) -#define SET_GetMinmaxParameterfvEXT(disp, fn) ((disp)->GetMinmaxParameterfvEXT = fn) -#define CALL_GetMinmaxParameterivEXT(disp, parameters) (*((disp)->GetMinmaxParameterivEXT)) parameters -#define GET_GetMinmaxParameterivEXT(disp) ((disp)->GetMinmaxParameterivEXT) -#define SET_GetMinmaxParameterivEXT(disp, fn) ((disp)->GetMinmaxParameterivEXT = fn) -#define CALL_GetConvolutionFilterEXT(disp, parameters) (*((disp)->GetConvolutionFilterEXT)) parameters -#define GET_GetConvolutionFilterEXT(disp) ((disp)->GetConvolutionFilterEXT) -#define SET_GetConvolutionFilterEXT(disp, fn) ((disp)->GetConvolutionFilterEXT = fn) -#define CALL_GetConvolutionParameterfvEXT(disp, parameters) (*((disp)->GetConvolutionParameterfvEXT)) parameters -#define GET_GetConvolutionParameterfvEXT(disp) ((disp)->GetConvolutionParameterfvEXT) -#define SET_GetConvolutionParameterfvEXT(disp, fn) ((disp)->GetConvolutionParameterfvEXT = fn) -#define CALL_GetConvolutionParameterivEXT(disp, parameters) (*((disp)->GetConvolutionParameterivEXT)) parameters -#define GET_GetConvolutionParameterivEXT(disp) ((disp)->GetConvolutionParameterivEXT) -#define SET_GetConvolutionParameterivEXT(disp, fn) ((disp)->GetConvolutionParameterivEXT = fn) -#define CALL_GetSeparableFilterEXT(disp, parameters) (*((disp)->GetSeparableFilterEXT)) parameters -#define GET_GetSeparableFilterEXT(disp) ((disp)->GetSeparableFilterEXT) -#define SET_GetSeparableFilterEXT(disp, fn) ((disp)->GetSeparableFilterEXT = fn) -#define CALL_GetColorTableParameterfvSGI(disp, parameters) (*((disp)->GetColorTableParameterfvSGI)) parameters -#define GET_GetColorTableParameterfvSGI(disp) ((disp)->GetColorTableParameterfvSGI) -#define SET_GetColorTableParameterfvSGI(disp, fn) ((disp)->GetColorTableParameterfvSGI = fn) -#define CALL_GetColorTableParameterivSGI(disp, parameters) (*((disp)->GetColorTableParameterivSGI)) parameters -#define GET_GetColorTableParameterivSGI(disp) ((disp)->GetColorTableParameterivSGI) -#define SET_GetColorTableParameterivSGI(disp, fn) ((disp)->GetColorTableParameterivSGI = fn) -#define CALL_GetColorTableSGI(disp, parameters) (*((disp)->GetColorTableSGI)) parameters -#define GET_GetColorTableSGI(disp) ((disp)->GetColorTableSGI) -#define SET_GetColorTableSGI(disp, fn) ((disp)->GetColorTableSGI = fn) #define CALL_GetPixelTexGenParameterfvSGIS(disp, parameters) (*((disp)->GetPixelTexGenParameterfvSGIS)) parameters #define GET_GetPixelTexGenParameterfvSGIS(disp) ((disp)->GetPixelTexGenParameterfvSGIS) #define SET_GetPixelTexGenParameterfvSGIS(disp, fn) ((disp)->GetPixelTexGenParameterfvSGIS = fn) @@ -1744,15 +1762,6 @@ #define CALL_PixelTexGenParameterivSGIS(disp, parameters) (*((disp)->PixelTexGenParameterivSGIS)) parameters #define GET_PixelTexGenParameterivSGIS(disp) ((disp)->PixelTexGenParameterivSGIS) #define SET_PixelTexGenParameterivSGIS(disp, fn) ((disp)->PixelTexGenParameterivSGIS = fn) -#define CALL_AreTexturesResidentEXT(disp, parameters) (*((disp)->AreTexturesResidentEXT)) parameters -#define GET_AreTexturesResidentEXT(disp) ((disp)->AreTexturesResidentEXT) -#define SET_AreTexturesResidentEXT(disp, fn) ((disp)->AreTexturesResidentEXT = fn) -#define CALL_GenTexturesEXT(disp, parameters) (*((disp)->GenTexturesEXT)) parameters -#define GET_GenTexturesEXT(disp) ((disp)->GenTexturesEXT) -#define SET_GenTexturesEXT(disp, fn) ((disp)->GenTexturesEXT = fn) -#define CALL_IsTextureEXT(disp, parameters) (*((disp)->IsTextureEXT)) parameters -#define GET_IsTextureEXT(disp) ((disp)->IsTextureEXT) -#define SET_IsTextureEXT(disp, fn) ((disp)->IsTextureEXT = fn) #define CALL_SampleMaskSGIS(disp, parameters) (*((disp)->SampleMaskSGIS)) parameters #define GET_SampleMaskSGIS(disp) ((disp)->SampleMaskSGIS) #define SET_SampleMaskSGIS(disp, fn) ((disp)->SampleMaskSGIS = fn) @@ -2338,12 +2347,6 @@ #define CALL_GetFramebufferAttachmentParameterivEXT(disp, parameters) (*((disp)->GetFramebufferAttachmentParameterivEXT)) parameters #define GET_GetFramebufferAttachmentParameterivEXT(disp) ((disp)->GetFramebufferAttachmentParameterivEXT) #define SET_GetFramebufferAttachmentParameterivEXT(disp, fn) ((disp)->GetFramebufferAttachmentParameterivEXT = fn) -#define CALL_GetQueryObjecti64vEXT(disp, parameters) (*((disp)->GetQueryObjecti64vEXT)) parameters -#define GET_GetQueryObjecti64vEXT(disp) ((disp)->GetQueryObjecti64vEXT) -#define SET_GetQueryObjecti64vEXT(disp, fn) ((disp)->GetQueryObjecti64vEXT = fn) -#define CALL_GetQueryObjectui64vEXT(disp, parameters) (*((disp)->GetQueryObjectui64vEXT)) parameters -#define GET_GetQueryObjectui64vEXT(disp) ((disp)->GetQueryObjectui64vEXT) -#define SET_GetQueryObjectui64vEXT(disp, fn) ((disp)->GetQueryObjectui64vEXT = fn) #define CALL_GetRenderbufferParameterivEXT(disp, parameters) (*((disp)->GetRenderbufferParameterivEXT)) parameters #define GET_GetRenderbufferParameterivEXT(disp) ((disp)->GetRenderbufferParameterivEXT) #define SET_GetRenderbufferParameterivEXT(disp, fn) ((disp)->GetRenderbufferParameterivEXT = fn) @@ -2365,374 +2368,422 @@ #define CALL_ProgramLocalParameters4fvEXT(disp, parameters) (*((disp)->ProgramLocalParameters4fvEXT)) parameters #define GET_ProgramLocalParameters4fvEXT(disp) ((disp)->ProgramLocalParameters4fvEXT) #define SET_ProgramLocalParameters4fvEXT(disp, fn) ((disp)->ProgramLocalParameters4fvEXT = fn) +#define CALL_GetQueryObjecti64vEXT(disp, parameters) (*((disp)->GetQueryObjecti64vEXT)) parameters +#define GET_GetQueryObjecti64vEXT(disp) ((disp)->GetQueryObjecti64vEXT) +#define SET_GetQueryObjecti64vEXT(disp, fn) ((disp)->GetQueryObjecti64vEXT = fn) +#define CALL_GetQueryObjectui64vEXT(disp, parameters) (*((disp)->GetQueryObjectui64vEXT)) parameters +#define GET_GetQueryObjectui64vEXT(disp) ((disp)->GetQueryObjectui64vEXT) +#define SET_GetQueryObjectui64vEXT(disp, fn) ((disp)->GetQueryObjectui64vEXT = fn) #else -#define driDispatchRemapTable_size 361 +#define driDispatchRemapTable_size 364 extern int driDispatchRemapTable[ driDispatchRemapTable_size ]; -#define StencilFuncSeparate_remap_index 0 -#define StencilMaskSeparate_remap_index 1 -#define StencilOpSeparate_remap_index 2 -#define LoadTransposeMatrixdARB_remap_index 3 -#define LoadTransposeMatrixfARB_remap_index 4 -#define MultTransposeMatrixdARB_remap_index 5 -#define MultTransposeMatrixfARB_remap_index 6 -#define SampleCoverageARB_remap_index 7 -#define CompressedTexImage1DARB_remap_index 8 -#define CompressedTexImage2DARB_remap_index 9 -#define CompressedTexImage3DARB_remap_index 10 -#define CompressedTexSubImage1DARB_remap_index 11 -#define CompressedTexSubImage2DARB_remap_index 12 -#define CompressedTexSubImage3DARB_remap_index 13 -#define GetCompressedTexImageARB_remap_index 14 -#define DisableVertexAttribArrayARB_remap_index 15 -#define EnableVertexAttribArrayARB_remap_index 16 -#define GetProgramEnvParameterdvARB_remap_index 17 -#define GetProgramEnvParameterfvARB_remap_index 18 -#define GetProgramLocalParameterdvARB_remap_index 19 -#define GetProgramLocalParameterfvARB_remap_index 20 -#define GetProgramStringARB_remap_index 21 -#define GetProgramivARB_remap_index 22 -#define GetVertexAttribdvARB_remap_index 23 -#define GetVertexAttribfvARB_remap_index 24 -#define GetVertexAttribivARB_remap_index 25 -#define ProgramEnvParameter4dARB_remap_index 26 -#define ProgramEnvParameter4dvARB_remap_index 27 -#define ProgramEnvParameter4fARB_remap_index 28 -#define ProgramEnvParameter4fvARB_remap_index 29 -#define ProgramLocalParameter4dARB_remap_index 30 -#define ProgramLocalParameter4dvARB_remap_index 31 -#define ProgramLocalParameter4fARB_remap_index 32 -#define ProgramLocalParameter4fvARB_remap_index 33 -#define ProgramStringARB_remap_index 34 -#define VertexAttrib1dARB_remap_index 35 -#define VertexAttrib1dvARB_remap_index 36 -#define VertexAttrib1fARB_remap_index 37 -#define VertexAttrib1fvARB_remap_index 38 -#define VertexAttrib1sARB_remap_index 39 -#define VertexAttrib1svARB_remap_index 40 -#define VertexAttrib2dARB_remap_index 41 -#define VertexAttrib2dvARB_remap_index 42 -#define VertexAttrib2fARB_remap_index 43 -#define VertexAttrib2fvARB_remap_index 44 -#define VertexAttrib2sARB_remap_index 45 -#define VertexAttrib2svARB_remap_index 46 -#define VertexAttrib3dARB_remap_index 47 -#define VertexAttrib3dvARB_remap_index 48 -#define VertexAttrib3fARB_remap_index 49 -#define VertexAttrib3fvARB_remap_index 50 -#define VertexAttrib3sARB_remap_index 51 -#define VertexAttrib3svARB_remap_index 52 -#define VertexAttrib4NbvARB_remap_index 53 -#define VertexAttrib4NivARB_remap_index 54 -#define VertexAttrib4NsvARB_remap_index 55 -#define VertexAttrib4NubARB_remap_index 56 -#define VertexAttrib4NubvARB_remap_index 57 -#define VertexAttrib4NuivARB_remap_index 58 -#define VertexAttrib4NusvARB_remap_index 59 -#define VertexAttrib4bvARB_remap_index 60 -#define VertexAttrib4dARB_remap_index 61 -#define VertexAttrib4dvARB_remap_index 62 -#define VertexAttrib4fARB_remap_index 63 -#define VertexAttrib4fvARB_remap_index 64 -#define VertexAttrib4ivARB_remap_index 65 -#define VertexAttrib4sARB_remap_index 66 -#define VertexAttrib4svARB_remap_index 67 -#define VertexAttrib4ubvARB_remap_index 68 -#define VertexAttrib4uivARB_remap_index 69 -#define VertexAttrib4usvARB_remap_index 70 -#define VertexAttribPointerARB_remap_index 71 -#define BindBufferARB_remap_index 72 -#define BufferDataARB_remap_index 73 -#define BufferSubDataARB_remap_index 74 -#define DeleteBuffersARB_remap_index 75 -#define GenBuffersARB_remap_index 76 -#define GetBufferParameterivARB_remap_index 77 -#define GetBufferPointervARB_remap_index 78 -#define GetBufferSubDataARB_remap_index 79 -#define IsBufferARB_remap_index 80 -#define MapBufferARB_remap_index 81 -#define UnmapBufferARB_remap_index 82 -#define BeginQueryARB_remap_index 83 -#define DeleteQueriesARB_remap_index 84 -#define EndQueryARB_remap_index 85 -#define GenQueriesARB_remap_index 86 -#define GetQueryObjectivARB_remap_index 87 -#define GetQueryObjectuivARB_remap_index 88 -#define GetQueryivARB_remap_index 89 -#define IsQueryARB_remap_index 90 -#define AttachObjectARB_remap_index 91 -#define CompileShaderARB_remap_index 92 -#define CreateProgramObjectARB_remap_index 93 -#define CreateShaderObjectARB_remap_index 94 -#define DeleteObjectARB_remap_index 95 -#define DetachObjectARB_remap_index 96 -#define GetActiveUniformARB_remap_index 97 -#define GetAttachedObjectsARB_remap_index 98 -#define GetHandleARB_remap_index 99 -#define GetInfoLogARB_remap_index 100 -#define GetObjectParameterfvARB_remap_index 101 -#define GetObjectParameterivARB_remap_index 102 -#define GetShaderSourceARB_remap_index 103 -#define GetUniformLocationARB_remap_index 104 -#define GetUniformfvARB_remap_index 105 -#define GetUniformivARB_remap_index 106 -#define LinkProgramARB_remap_index 107 -#define ShaderSourceARB_remap_index 108 -#define Uniform1fARB_remap_index 109 -#define Uniform1fvARB_remap_index 110 -#define Uniform1iARB_remap_index 111 -#define Uniform1ivARB_remap_index 112 -#define Uniform2fARB_remap_index 113 -#define Uniform2fvARB_remap_index 114 -#define Uniform2iARB_remap_index 115 -#define Uniform2ivARB_remap_index 116 -#define Uniform3fARB_remap_index 117 -#define Uniform3fvARB_remap_index 118 -#define Uniform3iARB_remap_index 119 -#define Uniform3ivARB_remap_index 120 -#define Uniform4fARB_remap_index 121 -#define Uniform4fvARB_remap_index 122 -#define Uniform4iARB_remap_index 123 -#define Uniform4ivARB_remap_index 124 -#define UniformMatrix2fvARB_remap_index 125 -#define UniformMatrix3fvARB_remap_index 126 -#define UniformMatrix4fvARB_remap_index 127 -#define UseProgramObjectARB_remap_index 128 -#define ValidateProgramARB_remap_index 129 -#define BindAttribLocationARB_remap_index 130 -#define GetActiveAttribARB_remap_index 131 -#define GetAttribLocationARB_remap_index 132 -#define DrawBuffersARB_remap_index 133 -#define PolygonOffsetEXT_remap_index 134 -#define GetHistogramEXT_remap_index 135 -#define GetHistogramParameterfvEXT_remap_index 136 -#define GetHistogramParameterivEXT_remap_index 137 -#define GetMinmaxEXT_remap_index 138 -#define GetMinmaxParameterfvEXT_remap_index 139 -#define GetMinmaxParameterivEXT_remap_index 140 -#define GetConvolutionFilterEXT_remap_index 141 -#define GetConvolutionParameterfvEXT_remap_index 142 -#define GetConvolutionParameterivEXT_remap_index 143 -#define GetSeparableFilterEXT_remap_index 144 -#define GetColorTableParameterfvSGI_remap_index 145 -#define GetColorTableParameterivSGI_remap_index 146 -#define GetColorTableSGI_remap_index 147 -#define GetPixelTexGenParameterfvSGIS_remap_index 148 -#define GetPixelTexGenParameterivSGIS_remap_index 149 -#define PixelTexGenParameterfSGIS_remap_index 150 -#define PixelTexGenParameterfvSGIS_remap_index 151 -#define PixelTexGenParameteriSGIS_remap_index 152 -#define PixelTexGenParameterivSGIS_remap_index 153 -#define AreTexturesResidentEXT_remap_index 154 -#define GenTexturesEXT_remap_index 155 -#define IsTextureEXT_remap_index 156 -#define SampleMaskSGIS_remap_index 157 -#define SamplePatternSGIS_remap_index 158 -#define ColorPointerEXT_remap_index 159 -#define EdgeFlagPointerEXT_remap_index 160 -#define IndexPointerEXT_remap_index 161 -#define NormalPointerEXT_remap_index 162 -#define TexCoordPointerEXT_remap_index 163 -#define VertexPointerEXT_remap_index 164 -#define PointParameterfEXT_remap_index 165 -#define PointParameterfvEXT_remap_index 166 -#define LockArraysEXT_remap_index 167 -#define UnlockArraysEXT_remap_index 168 -#define CullParameterdvEXT_remap_index 169 -#define CullParameterfvEXT_remap_index 170 -#define SecondaryColor3bEXT_remap_index 171 -#define SecondaryColor3bvEXT_remap_index 172 -#define SecondaryColor3dEXT_remap_index 173 -#define SecondaryColor3dvEXT_remap_index 174 -#define SecondaryColor3fEXT_remap_index 175 -#define SecondaryColor3fvEXT_remap_index 176 -#define SecondaryColor3iEXT_remap_index 177 -#define SecondaryColor3ivEXT_remap_index 178 -#define SecondaryColor3sEXT_remap_index 179 -#define SecondaryColor3svEXT_remap_index 180 -#define SecondaryColor3ubEXT_remap_index 181 -#define SecondaryColor3ubvEXT_remap_index 182 -#define SecondaryColor3uiEXT_remap_index 183 -#define SecondaryColor3uivEXT_remap_index 184 -#define SecondaryColor3usEXT_remap_index 185 -#define SecondaryColor3usvEXT_remap_index 186 -#define SecondaryColorPointerEXT_remap_index 187 -#define MultiDrawArraysEXT_remap_index 188 -#define MultiDrawElementsEXT_remap_index 189 -#define FogCoordPointerEXT_remap_index 190 -#define FogCoorddEXT_remap_index 191 -#define FogCoorddvEXT_remap_index 192 -#define FogCoordfEXT_remap_index 193 -#define FogCoordfvEXT_remap_index 194 -#define PixelTexGenSGIX_remap_index 195 -#define BlendFuncSeparateEXT_remap_index 196 -#define FlushVertexArrayRangeNV_remap_index 197 -#define VertexArrayRangeNV_remap_index 198 -#define CombinerInputNV_remap_index 199 -#define CombinerOutputNV_remap_index 200 -#define CombinerParameterfNV_remap_index 201 -#define CombinerParameterfvNV_remap_index 202 -#define CombinerParameteriNV_remap_index 203 -#define CombinerParameterivNV_remap_index 204 -#define FinalCombinerInputNV_remap_index 205 -#define GetCombinerInputParameterfvNV_remap_index 206 -#define GetCombinerInputParameterivNV_remap_index 207 -#define GetCombinerOutputParameterfvNV_remap_index 208 -#define GetCombinerOutputParameterivNV_remap_index 209 -#define GetFinalCombinerInputParameterfvNV_remap_index 210 -#define GetFinalCombinerInputParameterivNV_remap_index 211 -#define ResizeBuffersMESA_remap_index 212 -#define WindowPos2dMESA_remap_index 213 -#define WindowPos2dvMESA_remap_index 214 -#define WindowPos2fMESA_remap_index 215 -#define WindowPos2fvMESA_remap_index 216 -#define WindowPos2iMESA_remap_index 217 -#define WindowPos2ivMESA_remap_index 218 -#define WindowPos2sMESA_remap_index 219 -#define WindowPos2svMESA_remap_index 220 -#define WindowPos3dMESA_remap_index 221 -#define WindowPos3dvMESA_remap_index 222 -#define WindowPos3fMESA_remap_index 223 -#define WindowPos3fvMESA_remap_index 224 -#define WindowPos3iMESA_remap_index 225 -#define WindowPos3ivMESA_remap_index 226 -#define WindowPos3sMESA_remap_index 227 -#define WindowPos3svMESA_remap_index 228 -#define WindowPos4dMESA_remap_index 229 -#define WindowPos4dvMESA_remap_index 230 -#define WindowPos4fMESA_remap_index 231 -#define WindowPos4fvMESA_remap_index 232 -#define WindowPos4iMESA_remap_index 233 -#define WindowPos4ivMESA_remap_index 234 -#define WindowPos4sMESA_remap_index 235 -#define WindowPos4svMESA_remap_index 236 -#define MultiModeDrawArraysIBM_remap_index 237 -#define MultiModeDrawElementsIBM_remap_index 238 -#define DeleteFencesNV_remap_index 239 -#define FinishFenceNV_remap_index 240 -#define GenFencesNV_remap_index 241 -#define GetFenceivNV_remap_index 242 -#define IsFenceNV_remap_index 243 -#define SetFenceNV_remap_index 244 -#define TestFenceNV_remap_index 245 -#define AreProgramsResidentNV_remap_index 246 -#define BindProgramNV_remap_index 247 -#define DeleteProgramsNV_remap_index 248 -#define ExecuteProgramNV_remap_index 249 -#define GenProgramsNV_remap_index 250 -#define GetProgramParameterdvNV_remap_index 251 -#define GetProgramParameterfvNV_remap_index 252 -#define GetProgramStringNV_remap_index 253 -#define GetProgramivNV_remap_index 254 -#define GetTrackMatrixivNV_remap_index 255 -#define GetVertexAttribPointervNV_remap_index 256 -#define GetVertexAttribdvNV_remap_index 257 -#define GetVertexAttribfvNV_remap_index 258 -#define GetVertexAttribivNV_remap_index 259 -#define IsProgramNV_remap_index 260 -#define LoadProgramNV_remap_index 261 -#define ProgramParameter4dNV_remap_index 262 -#define ProgramParameter4dvNV_remap_index 263 -#define ProgramParameter4fNV_remap_index 264 -#define ProgramParameter4fvNV_remap_index 265 -#define ProgramParameters4dvNV_remap_index 266 -#define ProgramParameters4fvNV_remap_index 267 -#define RequestResidentProgramsNV_remap_index 268 -#define TrackMatrixNV_remap_index 269 -#define VertexAttrib1dNV_remap_index 270 -#define VertexAttrib1dvNV_remap_index 271 -#define VertexAttrib1fNV_remap_index 272 -#define VertexAttrib1fvNV_remap_index 273 -#define VertexAttrib1sNV_remap_index 274 -#define VertexAttrib1svNV_remap_index 275 -#define VertexAttrib2dNV_remap_index 276 -#define VertexAttrib2dvNV_remap_index 277 -#define VertexAttrib2fNV_remap_index 278 -#define VertexAttrib2fvNV_remap_index 279 -#define VertexAttrib2sNV_remap_index 280 -#define VertexAttrib2svNV_remap_index 281 -#define VertexAttrib3dNV_remap_index 282 -#define VertexAttrib3dvNV_remap_index 283 -#define VertexAttrib3fNV_remap_index 284 -#define VertexAttrib3fvNV_remap_index 285 -#define VertexAttrib3sNV_remap_index 286 -#define VertexAttrib3svNV_remap_index 287 -#define VertexAttrib4dNV_remap_index 288 -#define VertexAttrib4dvNV_remap_index 289 -#define VertexAttrib4fNV_remap_index 290 -#define VertexAttrib4fvNV_remap_index 291 -#define VertexAttrib4sNV_remap_index 292 -#define VertexAttrib4svNV_remap_index 293 -#define VertexAttrib4ubNV_remap_index 294 -#define VertexAttrib4ubvNV_remap_index 295 -#define VertexAttribPointerNV_remap_index 296 -#define VertexAttribs1dvNV_remap_index 297 -#define VertexAttribs1fvNV_remap_index 298 -#define VertexAttribs1svNV_remap_index 299 -#define VertexAttribs2dvNV_remap_index 300 -#define VertexAttribs2fvNV_remap_index 301 -#define VertexAttribs2svNV_remap_index 302 -#define VertexAttribs3dvNV_remap_index 303 -#define VertexAttribs3fvNV_remap_index 304 -#define VertexAttribs3svNV_remap_index 305 -#define VertexAttribs4dvNV_remap_index 306 -#define VertexAttribs4fvNV_remap_index 307 -#define VertexAttribs4svNV_remap_index 308 -#define VertexAttribs4ubvNV_remap_index 309 -#define AlphaFragmentOp1ATI_remap_index 310 -#define AlphaFragmentOp2ATI_remap_index 311 -#define AlphaFragmentOp3ATI_remap_index 312 -#define BeginFragmentShaderATI_remap_index 313 -#define BindFragmentShaderATI_remap_index 314 -#define ColorFragmentOp1ATI_remap_index 315 -#define ColorFragmentOp2ATI_remap_index 316 -#define ColorFragmentOp3ATI_remap_index 317 -#define DeleteFragmentShaderATI_remap_index 318 -#define EndFragmentShaderATI_remap_index 319 -#define GenFragmentShadersATI_remap_index 320 -#define PassTexCoordATI_remap_index 321 -#define SampleMapATI_remap_index 322 -#define SetFragmentShaderConstantATI_remap_index 323 -#define PointParameteriNV_remap_index 324 -#define PointParameterivNV_remap_index 325 -#define ActiveStencilFaceEXT_remap_index 326 -#define BindVertexArrayAPPLE_remap_index 327 -#define DeleteVertexArraysAPPLE_remap_index 328 -#define GenVertexArraysAPPLE_remap_index 329 -#define IsVertexArrayAPPLE_remap_index 330 -#define GetProgramNamedParameterdvNV_remap_index 331 -#define GetProgramNamedParameterfvNV_remap_index 332 -#define ProgramNamedParameter4dNV_remap_index 333 -#define ProgramNamedParameter4dvNV_remap_index 334 -#define ProgramNamedParameter4fNV_remap_index 335 -#define ProgramNamedParameter4fvNV_remap_index 336 -#define DepthBoundsEXT_remap_index 337 -#define BlendEquationSeparateEXT_remap_index 338 -#define BindFramebufferEXT_remap_index 339 -#define BindRenderbufferEXT_remap_index 340 -#define CheckFramebufferStatusEXT_remap_index 341 -#define DeleteFramebuffersEXT_remap_index 342 -#define DeleteRenderbuffersEXT_remap_index 343 -#define FramebufferRenderbufferEXT_remap_index 344 -#define FramebufferTexture1DEXT_remap_index 345 -#define FramebufferTexture2DEXT_remap_index 346 -#define FramebufferTexture3DEXT_remap_index 347 -#define GenFramebuffersEXT_remap_index 348 -#define GenRenderbuffersEXT_remap_index 349 -#define GenerateMipmapEXT_remap_index 350 -#define GetFramebufferAttachmentParameterivEXT_remap_index 351 -#define GetQueryObjecti64vEXT_remap_index 352 -#define GetQueryObjectui64vEXT_remap_index 353 -#define GetRenderbufferParameterivEXT_remap_index 354 -#define IsFramebufferEXT_remap_index 355 -#define IsRenderbufferEXT_remap_index 356 -#define RenderbufferStorageEXT_remap_index 357 -#define BlitFramebufferEXT_remap_index 358 -#define ProgramEnvParameters4fvEXT_remap_index 359 -#define ProgramLocalParameters4fvEXT_remap_index 360 +#define AttachShader_remap_index 0 +#define CreateProgram_remap_index 1 +#define CreateShader_remap_index 2 +#define DeleteProgram_remap_index 3 +#define DeleteShader_remap_index 4 +#define DetachShader_remap_index 5 +#define GetAttachedShaders_remap_index 6 +#define GetProgramInfoLog_remap_index 7 +#define GetProgramiv_remap_index 8 +#define GetShaderInfoLog_remap_index 9 +#define GetShaderiv_remap_index 10 +#define IsProgram_remap_index 11 +#define IsShader_remap_index 12 +#define StencilFuncSeparate_remap_index 13 +#define StencilMaskSeparate_remap_index 14 +#define StencilOpSeparate_remap_index 15 +#define UniformMatrix2x3fv_remap_index 16 +#define UniformMatrix2x4fv_remap_index 17 +#define UniformMatrix3x2fv_remap_index 18 +#define UniformMatrix3x4fv_remap_index 19 +#define UniformMatrix4x2fv_remap_index 20 +#define UniformMatrix4x3fv_remap_index 21 +#define LoadTransposeMatrixdARB_remap_index 22 +#define LoadTransposeMatrixfARB_remap_index 23 +#define MultTransposeMatrixdARB_remap_index 24 +#define MultTransposeMatrixfARB_remap_index 25 +#define SampleCoverageARB_remap_index 26 +#define CompressedTexImage1DARB_remap_index 27 +#define CompressedTexImage2DARB_remap_index 28 +#define CompressedTexImage3DARB_remap_index 29 +#define CompressedTexSubImage1DARB_remap_index 30 +#define CompressedTexSubImage2DARB_remap_index 31 +#define CompressedTexSubImage3DARB_remap_index 32 +#define GetCompressedTexImageARB_remap_index 33 +#define DisableVertexAttribArrayARB_remap_index 34 +#define EnableVertexAttribArrayARB_remap_index 35 +#define GetProgramEnvParameterdvARB_remap_index 36 +#define GetProgramEnvParameterfvARB_remap_index 37 +#define GetProgramLocalParameterdvARB_remap_index 38 +#define GetProgramLocalParameterfvARB_remap_index 39 +#define GetProgramStringARB_remap_index 40 +#define GetProgramivARB_remap_index 41 +#define GetVertexAttribdvARB_remap_index 42 +#define GetVertexAttribfvARB_remap_index 43 +#define GetVertexAttribivARB_remap_index 44 +#define ProgramEnvParameter4dARB_remap_index 45 +#define ProgramEnvParameter4dvARB_remap_index 46 +#define ProgramEnvParameter4fARB_remap_index 47 +#define ProgramEnvParameter4fvARB_remap_index 48 +#define ProgramLocalParameter4dARB_remap_index 49 +#define ProgramLocalParameter4dvARB_remap_index 50 +#define ProgramLocalParameter4fARB_remap_index 51 +#define ProgramLocalParameter4fvARB_remap_index 52 +#define ProgramStringARB_remap_index 53 +#define VertexAttrib1dARB_remap_index 54 +#define VertexAttrib1dvARB_remap_index 55 +#define VertexAttrib1fARB_remap_index 56 +#define VertexAttrib1fvARB_remap_index 57 +#define VertexAttrib1sARB_remap_index 58 +#define VertexAttrib1svARB_remap_index 59 +#define VertexAttrib2dARB_remap_index 60 +#define VertexAttrib2dvARB_remap_index 61 +#define VertexAttrib2fARB_remap_index 62 +#define VertexAttrib2fvARB_remap_index 63 +#define VertexAttrib2sARB_remap_index 64 +#define VertexAttrib2svARB_remap_index 65 +#define VertexAttrib3dARB_remap_index 66 +#define VertexAttrib3dvARB_remap_index 67 +#define VertexAttrib3fARB_remap_index 68 +#define VertexAttrib3fvARB_remap_index 69 +#define VertexAttrib3sARB_remap_index 70 +#define VertexAttrib3svARB_remap_index 71 +#define VertexAttrib4NbvARB_remap_index 72 +#define VertexAttrib4NivARB_remap_index 73 +#define VertexAttrib4NsvARB_remap_index 74 +#define VertexAttrib4NubARB_remap_index 75 +#define VertexAttrib4NubvARB_remap_index 76 +#define VertexAttrib4NuivARB_remap_index 77 +#define VertexAttrib4NusvARB_remap_index 78 +#define VertexAttrib4bvARB_remap_index 79 +#define VertexAttrib4dARB_remap_index 80 +#define VertexAttrib4dvARB_remap_index 81 +#define VertexAttrib4fARB_remap_index 82 +#define VertexAttrib4fvARB_remap_index 83 +#define VertexAttrib4ivARB_remap_index 84 +#define VertexAttrib4sARB_remap_index 85 +#define VertexAttrib4svARB_remap_index 86 +#define VertexAttrib4ubvARB_remap_index 87 +#define VertexAttrib4uivARB_remap_index 88 +#define VertexAttrib4usvARB_remap_index 89 +#define VertexAttribPointerARB_remap_index 90 +#define BindBufferARB_remap_index 91 +#define BufferDataARB_remap_index 92 +#define BufferSubDataARB_remap_index 93 +#define DeleteBuffersARB_remap_index 94 +#define GenBuffersARB_remap_index 95 +#define GetBufferParameterivARB_remap_index 96 +#define GetBufferPointervARB_remap_index 97 +#define GetBufferSubDataARB_remap_index 98 +#define IsBufferARB_remap_index 99 +#define MapBufferARB_remap_index 100 +#define UnmapBufferARB_remap_index 101 +#define BeginQueryARB_remap_index 102 +#define DeleteQueriesARB_remap_index 103 +#define EndQueryARB_remap_index 104 +#define GenQueriesARB_remap_index 105 +#define GetQueryObjectivARB_remap_index 106 +#define GetQueryObjectuivARB_remap_index 107 +#define GetQueryivARB_remap_index 108 +#define IsQueryARB_remap_index 109 +#define AttachObjectARB_remap_index 110 +#define CompileShaderARB_remap_index 111 +#define CreateProgramObjectARB_remap_index 112 +#define CreateShaderObjectARB_remap_index 113 +#define DeleteObjectARB_remap_index 114 +#define DetachObjectARB_remap_index 115 +#define GetActiveUniformARB_remap_index 116 +#define GetAttachedObjectsARB_remap_index 117 +#define GetHandleARB_remap_index 118 +#define GetInfoLogARB_remap_index 119 +#define GetObjectParameterfvARB_remap_index 120 +#define GetObjectParameterivARB_remap_index 121 +#define GetShaderSourceARB_remap_index 122 +#define GetUniformLocationARB_remap_index 123 +#define GetUniformfvARB_remap_index 124 +#define GetUniformivARB_remap_index 125 +#define LinkProgramARB_remap_index 126 +#define ShaderSourceARB_remap_index 127 +#define Uniform1fARB_remap_index 128 +#define Uniform1fvARB_remap_index 129 +#define Uniform1iARB_remap_index 130 +#define Uniform1ivARB_remap_index 131 +#define Uniform2fARB_remap_index 132 +#define Uniform2fvARB_remap_index 133 +#define Uniform2iARB_remap_index 134 +#define Uniform2ivARB_remap_index 135 +#define Uniform3fARB_remap_index 136 +#define Uniform3fvARB_remap_index 137 +#define Uniform3iARB_remap_index 138 +#define Uniform3ivARB_remap_index 139 +#define Uniform4fARB_remap_index 140 +#define Uniform4fvARB_remap_index 141 +#define Uniform4iARB_remap_index 142 +#define Uniform4ivARB_remap_index 143 +#define UniformMatrix2fvARB_remap_index 144 +#define UniformMatrix3fvARB_remap_index 145 +#define UniformMatrix4fvARB_remap_index 146 +#define UseProgramObjectARB_remap_index 147 +#define ValidateProgramARB_remap_index 148 +#define BindAttribLocationARB_remap_index 149 +#define GetActiveAttribARB_remap_index 150 +#define GetAttribLocationARB_remap_index 151 +#define DrawBuffersARB_remap_index 152 +#define PolygonOffsetEXT_remap_index 153 +#define GetPixelTexGenParameterfvSGIS_remap_index 154 +#define GetPixelTexGenParameterivSGIS_remap_index 155 +#define PixelTexGenParameterfSGIS_remap_index 156 +#define PixelTexGenParameterfvSGIS_remap_index 157 +#define PixelTexGenParameteriSGIS_remap_index 158 +#define PixelTexGenParameterivSGIS_remap_index 159 +#define SampleMaskSGIS_remap_index 160 +#define SamplePatternSGIS_remap_index 161 +#define ColorPointerEXT_remap_index 162 +#define EdgeFlagPointerEXT_remap_index 163 +#define IndexPointerEXT_remap_index 164 +#define NormalPointerEXT_remap_index 165 +#define TexCoordPointerEXT_remap_index 166 +#define VertexPointerEXT_remap_index 167 +#define PointParameterfEXT_remap_index 168 +#define PointParameterfvEXT_remap_index 169 +#define LockArraysEXT_remap_index 170 +#define UnlockArraysEXT_remap_index 171 +#define CullParameterdvEXT_remap_index 172 +#define CullParameterfvEXT_remap_index 173 +#define SecondaryColor3bEXT_remap_index 174 +#define SecondaryColor3bvEXT_remap_index 175 +#define SecondaryColor3dEXT_remap_index 176 +#define SecondaryColor3dvEXT_remap_index 177 +#define SecondaryColor3fEXT_remap_index 178 +#define SecondaryColor3fvEXT_remap_index 179 +#define SecondaryColor3iEXT_remap_index 180 +#define SecondaryColor3ivEXT_remap_index 181 +#define SecondaryColor3sEXT_remap_index 182 +#define SecondaryColor3svEXT_remap_index 183 +#define SecondaryColor3ubEXT_remap_index 184 +#define SecondaryColor3ubvEXT_remap_index 185 +#define SecondaryColor3uiEXT_remap_index 186 +#define SecondaryColor3uivEXT_remap_index 187 +#define SecondaryColor3usEXT_remap_index 188 +#define SecondaryColor3usvEXT_remap_index 189 +#define SecondaryColorPointerEXT_remap_index 190 +#define MultiDrawArraysEXT_remap_index 191 +#define MultiDrawElementsEXT_remap_index 192 +#define FogCoordPointerEXT_remap_index 193 +#define FogCoorddEXT_remap_index 194 +#define FogCoorddvEXT_remap_index 195 +#define FogCoordfEXT_remap_index 196 +#define FogCoordfvEXT_remap_index 197 +#define PixelTexGenSGIX_remap_index 198 +#define BlendFuncSeparateEXT_remap_index 199 +#define FlushVertexArrayRangeNV_remap_index 200 +#define VertexArrayRangeNV_remap_index 201 +#define CombinerInputNV_remap_index 202 +#define CombinerOutputNV_remap_index 203 +#define CombinerParameterfNV_remap_index 204 +#define CombinerParameterfvNV_remap_index 205 +#define CombinerParameteriNV_remap_index 206 +#define CombinerParameterivNV_remap_index 207 +#define FinalCombinerInputNV_remap_index 208 +#define GetCombinerInputParameterfvNV_remap_index 209 +#define GetCombinerInputParameterivNV_remap_index 210 +#define GetCombinerOutputParameterfvNV_remap_index 211 +#define GetCombinerOutputParameterivNV_remap_index 212 +#define GetFinalCombinerInputParameterfvNV_remap_index 213 +#define GetFinalCombinerInputParameterivNV_remap_index 214 +#define ResizeBuffersMESA_remap_index 215 +#define WindowPos2dMESA_remap_index 216 +#define WindowPos2dvMESA_remap_index 217 +#define WindowPos2fMESA_remap_index 218 +#define WindowPos2fvMESA_remap_index 219 +#define WindowPos2iMESA_remap_index 220 +#define WindowPos2ivMESA_remap_index 221 +#define WindowPos2sMESA_remap_index 222 +#define WindowPos2svMESA_remap_index 223 +#define WindowPos3dMESA_remap_index 224 +#define WindowPos3dvMESA_remap_index 225 +#define WindowPos3fMESA_remap_index 226 +#define WindowPos3fvMESA_remap_index 227 +#define WindowPos3iMESA_remap_index 228 +#define WindowPos3ivMESA_remap_index 229 +#define WindowPos3sMESA_remap_index 230 +#define WindowPos3svMESA_remap_index 231 +#define WindowPos4dMESA_remap_index 232 +#define WindowPos4dvMESA_remap_index 233 +#define WindowPos4fMESA_remap_index 234 +#define WindowPos4fvMESA_remap_index 235 +#define WindowPos4iMESA_remap_index 236 +#define WindowPos4ivMESA_remap_index 237 +#define WindowPos4sMESA_remap_index 238 +#define WindowPos4svMESA_remap_index 239 +#define MultiModeDrawArraysIBM_remap_index 240 +#define MultiModeDrawElementsIBM_remap_index 241 +#define DeleteFencesNV_remap_index 242 +#define FinishFenceNV_remap_index 243 +#define GenFencesNV_remap_index 244 +#define GetFenceivNV_remap_index 245 +#define IsFenceNV_remap_index 246 +#define SetFenceNV_remap_index 247 +#define TestFenceNV_remap_index 248 +#define AreProgramsResidentNV_remap_index 249 +#define BindProgramNV_remap_index 250 +#define DeleteProgramsNV_remap_index 251 +#define ExecuteProgramNV_remap_index 252 +#define GenProgramsNV_remap_index 253 +#define GetProgramParameterdvNV_remap_index 254 +#define GetProgramParameterfvNV_remap_index 255 +#define GetProgramStringNV_remap_index 256 +#define GetProgramivNV_remap_index 257 +#define GetTrackMatrixivNV_remap_index 258 +#define GetVertexAttribPointervNV_remap_index 259 +#define GetVertexAttribdvNV_remap_index 260 +#define GetVertexAttribfvNV_remap_index 261 +#define GetVertexAttribivNV_remap_index 262 +#define IsProgramNV_remap_index 263 +#define LoadProgramNV_remap_index 264 +#define ProgramParameter4dNV_remap_index 265 +#define ProgramParameter4dvNV_remap_index 266 +#define ProgramParameter4fNV_remap_index 267 +#define ProgramParameter4fvNV_remap_index 268 +#define ProgramParameters4dvNV_remap_index 269 +#define ProgramParameters4fvNV_remap_index 270 +#define RequestResidentProgramsNV_remap_index 271 +#define TrackMatrixNV_remap_index 272 +#define VertexAttrib1dNV_remap_index 273 +#define VertexAttrib1dvNV_remap_index 274 +#define VertexAttrib1fNV_remap_index 275 +#define VertexAttrib1fvNV_remap_index 276 +#define VertexAttrib1sNV_remap_index 277 +#define VertexAttrib1svNV_remap_index 278 +#define VertexAttrib2dNV_remap_index 279 +#define VertexAttrib2dvNV_remap_index 280 +#define VertexAttrib2fNV_remap_index 281 +#define VertexAttrib2fvNV_remap_index 282 +#define VertexAttrib2sNV_remap_index 283 +#define VertexAttrib2svNV_remap_index 284 +#define VertexAttrib3dNV_remap_index 285 +#define VertexAttrib3dvNV_remap_index 286 +#define VertexAttrib3fNV_remap_index 287 +#define VertexAttrib3fvNV_remap_index 288 +#define VertexAttrib3sNV_remap_index 289 +#define VertexAttrib3svNV_remap_index 290 +#define VertexAttrib4dNV_remap_index 291 +#define VertexAttrib4dvNV_remap_index 292 +#define VertexAttrib4fNV_remap_index 293 +#define VertexAttrib4fvNV_remap_index 294 +#define VertexAttrib4sNV_remap_index 295 +#define VertexAttrib4svNV_remap_index 296 +#define VertexAttrib4ubNV_remap_index 297 +#define VertexAttrib4ubvNV_remap_index 298 +#define VertexAttribPointerNV_remap_index 299 +#define VertexAttribs1dvNV_remap_index 300 +#define VertexAttribs1fvNV_remap_index 301 +#define VertexAttribs1svNV_remap_index 302 +#define VertexAttribs2dvNV_remap_index 303 +#define VertexAttribs2fvNV_remap_index 304 +#define VertexAttribs2svNV_remap_index 305 +#define VertexAttribs3dvNV_remap_index 306 +#define VertexAttribs3fvNV_remap_index 307 +#define VertexAttribs3svNV_remap_index 308 +#define VertexAttribs4dvNV_remap_index 309 +#define VertexAttribs4fvNV_remap_index 310 +#define VertexAttribs4svNV_remap_index 311 +#define VertexAttribs4ubvNV_remap_index 312 +#define AlphaFragmentOp1ATI_remap_index 313 +#define AlphaFragmentOp2ATI_remap_index 314 +#define AlphaFragmentOp3ATI_remap_index 315 +#define BeginFragmentShaderATI_remap_index 316 +#define BindFragmentShaderATI_remap_index 317 +#define ColorFragmentOp1ATI_remap_index 318 +#define ColorFragmentOp2ATI_remap_index 319 +#define ColorFragmentOp3ATI_remap_index 320 +#define DeleteFragmentShaderATI_remap_index 321 +#define EndFragmentShaderATI_remap_index 322 +#define GenFragmentShadersATI_remap_index 323 +#define PassTexCoordATI_remap_index 324 +#define SampleMapATI_remap_index 325 +#define SetFragmentShaderConstantATI_remap_index 326 +#define PointParameteriNV_remap_index 327 +#define PointParameterivNV_remap_index 328 +#define ActiveStencilFaceEXT_remap_index 329 +#define BindVertexArrayAPPLE_remap_index 330 +#define DeleteVertexArraysAPPLE_remap_index 331 +#define GenVertexArraysAPPLE_remap_index 332 +#define IsVertexArrayAPPLE_remap_index 333 +#define GetProgramNamedParameterdvNV_remap_index 334 +#define GetProgramNamedParameterfvNV_remap_index 335 +#define ProgramNamedParameter4dNV_remap_index 336 +#define ProgramNamedParameter4dvNV_remap_index 337 +#define ProgramNamedParameter4fNV_remap_index 338 +#define ProgramNamedParameter4fvNV_remap_index 339 +#define DepthBoundsEXT_remap_index 340 +#define BlendEquationSeparateEXT_remap_index 341 +#define BindFramebufferEXT_remap_index 342 +#define BindRenderbufferEXT_remap_index 343 +#define CheckFramebufferStatusEXT_remap_index 344 +#define DeleteFramebuffersEXT_remap_index 345 +#define DeleteRenderbuffersEXT_remap_index 346 +#define FramebufferRenderbufferEXT_remap_index 347 +#define FramebufferTexture1DEXT_remap_index 348 +#define FramebufferTexture2DEXT_remap_index 349 +#define FramebufferTexture3DEXT_remap_index 350 +#define GenFramebuffersEXT_remap_index 351 +#define GenRenderbuffersEXT_remap_index 352 +#define GenerateMipmapEXT_remap_index 353 +#define GetFramebufferAttachmentParameterivEXT_remap_index 354 +#define GetRenderbufferParameterivEXT_remap_index 355 +#define IsFramebufferEXT_remap_index 356 +#define IsRenderbufferEXT_remap_index 357 +#define RenderbufferStorageEXT_remap_index 358 +#define BlitFramebufferEXT_remap_index 359 +#define ProgramEnvParameters4fvEXT_remap_index 360 +#define ProgramLocalParameters4fvEXT_remap_index 361 +#define GetQueryObjecti64vEXT_remap_index 362 +#define GetQueryObjectui64vEXT_remap_index 363 +#define CALL_AttachShader(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLuint)), driDispatchRemapTable[AttachShader_remap_index], parameters) +#define GET_AttachShader(disp) GET_by_offset(disp, driDispatchRemapTable[AttachShader_remap_index]) +#define SET_AttachShader(disp, fn) SET_by_offset(disp, driDispatchRemapTable[AttachShader_remap_index], fn) +#define CALL_CreateProgram(disp, parameters) CALL_by_offset(disp, (GLuint (GLAPIENTRYP)(void)), driDispatchRemapTable[CreateProgram_remap_index], parameters) +#define GET_CreateProgram(disp) GET_by_offset(disp, driDispatchRemapTable[CreateProgram_remap_index]) +#define SET_CreateProgram(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CreateProgram_remap_index], fn) +#define CALL_CreateShader(disp, parameters) CALL_by_offset(disp, (GLuint (GLAPIENTRYP)(GLenum)), driDispatchRemapTable[CreateShader_remap_index], parameters) +#define GET_CreateShader(disp) GET_by_offset(disp, driDispatchRemapTable[CreateShader_remap_index]) +#define SET_CreateShader(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CreateShader_remap_index], fn) +#define CALL_DeleteProgram(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[DeleteProgram_remap_index], parameters) +#define GET_DeleteProgram(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteProgram_remap_index]) +#define SET_DeleteProgram(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteProgram_remap_index], fn) +#define CALL_DeleteShader(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[DeleteShader_remap_index], parameters) +#define GET_DeleteShader(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteShader_remap_index]) +#define SET_DeleteShader(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteShader_remap_index], fn) +#define CALL_DetachShader(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLuint)), driDispatchRemapTable[DetachShader_remap_index], parameters) +#define GET_DetachShader(disp) GET_by_offset(disp, driDispatchRemapTable[DetachShader_remap_index]) +#define SET_DetachShader(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DetachShader_remap_index], fn) +#define CALL_GetAttachedShaders(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, GLsizei *, GLuint *)), driDispatchRemapTable[GetAttachedShaders_remap_index], parameters) +#define GET_GetAttachedShaders(disp) GET_by_offset(disp, driDispatchRemapTable[GetAttachedShaders_remap_index]) +#define SET_GetAttachedShaders(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetAttachedShaders_remap_index], fn) +#define CALL_GetProgramInfoLog(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, GLsizei *, GLchar *)), driDispatchRemapTable[GetProgramInfoLog_remap_index], parameters) +#define GET_GetProgramInfoLog(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramInfoLog_remap_index]) +#define SET_GetProgramInfoLog(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramInfoLog_remap_index], fn) +#define CALL_GetProgramiv(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLint *)), driDispatchRemapTable[GetProgramiv_remap_index], parameters) +#define GET_GetProgramiv(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramiv_remap_index]) +#define SET_GetProgramiv(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramiv_remap_index], fn) +#define CALL_GetShaderInfoLog(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, GLsizei *, GLchar *)), driDispatchRemapTable[GetShaderInfoLog_remap_index], parameters) +#define GET_GetShaderInfoLog(disp) GET_by_offset(disp, driDispatchRemapTable[GetShaderInfoLog_remap_index]) +#define SET_GetShaderInfoLog(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetShaderInfoLog_remap_index], fn) +#define CALL_GetShaderiv(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLint *)), driDispatchRemapTable[GetShaderiv_remap_index], parameters) +#define GET_GetShaderiv(disp) GET_by_offset(disp, driDispatchRemapTable[GetShaderiv_remap_index]) +#define SET_GetShaderiv(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetShaderiv_remap_index], fn) +#define CALL_IsProgram(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[IsProgram_remap_index], parameters) +#define GET_IsProgram(disp) GET_by_offset(disp, driDispatchRemapTable[IsProgram_remap_index]) +#define SET_IsProgram(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IsProgram_remap_index], fn) +#define CALL_IsShader(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[IsShader_remap_index], parameters) +#define GET_IsShader(disp) GET_by_offset(disp, driDispatchRemapTable[IsShader_remap_index]) +#define SET_IsShader(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IsShader_remap_index], fn) #define CALL_StencilFuncSeparate(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLint, GLuint)), driDispatchRemapTable[StencilFuncSeparate_remap_index], parameters) #define GET_StencilFuncSeparate(disp) GET_by_offset(disp, driDispatchRemapTable[StencilFuncSeparate_remap_index]) #define SET_StencilFuncSeparate(disp, fn) SET_by_offset(disp, driDispatchRemapTable[StencilFuncSeparate_remap_index], fn) @@ -2742,6 +2793,24 @@ extern int driDispatchRemapTable[ driDispatchRemapTable_size ]; #define CALL_StencilOpSeparate(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLenum)), driDispatchRemapTable[StencilOpSeparate_remap_index], parameters) #define GET_StencilOpSeparate(disp) GET_by_offset(disp, driDispatchRemapTable[StencilOpSeparate_remap_index]) #define SET_StencilOpSeparate(disp, fn) SET_by_offset(disp, driDispatchRemapTable[StencilOpSeparate_remap_index], fn) +#define CALL_UniformMatrix2x3fv(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, GLboolean, const GLfloat *)), driDispatchRemapTable[UniformMatrix2x3fv_remap_index], parameters) +#define GET_UniformMatrix2x3fv(disp) GET_by_offset(disp, driDispatchRemapTable[UniformMatrix2x3fv_remap_index]) +#define SET_UniformMatrix2x3fv(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UniformMatrix2x3fv_remap_index], fn) +#define CALL_UniformMatrix2x4fv(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, GLboolean, const GLfloat *)), driDispatchRemapTable[UniformMatrix2x4fv_remap_index], parameters) +#define GET_UniformMatrix2x4fv(disp) GET_by_offset(disp, driDispatchRemapTable[UniformMatrix2x4fv_remap_index]) +#define SET_UniformMatrix2x4fv(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UniformMatrix2x4fv_remap_index], fn) +#define CALL_UniformMatrix3x2fv(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, GLboolean, const GLfloat *)), driDispatchRemapTable[UniformMatrix3x2fv_remap_index], parameters) +#define GET_UniformMatrix3x2fv(disp) GET_by_offset(disp, driDispatchRemapTable[UniformMatrix3x2fv_remap_index]) +#define SET_UniformMatrix3x2fv(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UniformMatrix3x2fv_remap_index], fn) +#define CALL_UniformMatrix3x4fv(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, GLboolean, const GLfloat *)), driDispatchRemapTable[UniformMatrix3x4fv_remap_index], parameters) +#define GET_UniformMatrix3x4fv(disp) GET_by_offset(disp, driDispatchRemapTable[UniformMatrix3x4fv_remap_index]) +#define SET_UniformMatrix3x4fv(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UniformMatrix3x4fv_remap_index], fn) +#define CALL_UniformMatrix4x2fv(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, GLboolean, const GLfloat *)), driDispatchRemapTable[UniformMatrix4x2fv_remap_index], parameters) +#define GET_UniformMatrix4x2fv(disp) GET_by_offset(disp, driDispatchRemapTable[UniformMatrix4x2fv_remap_index]) +#define SET_UniformMatrix4x2fv(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UniformMatrix4x2fv_remap_index], fn) +#define CALL_UniformMatrix4x3fv(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, GLboolean, const GLfloat *)), driDispatchRemapTable[UniformMatrix4x3fv_remap_index], parameters) +#define GET_UniformMatrix4x3fv(disp) GET_by_offset(disp, driDispatchRemapTable[UniformMatrix4x3fv_remap_index]) +#define SET_UniformMatrix4x3fv(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UniformMatrix4x3fv_remap_index], fn) #define CALL_LoadTransposeMatrixdARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLdouble *)), driDispatchRemapTable[LoadTransposeMatrixdARB_remap_index], parameters) #define GET_LoadTransposeMatrixdARB(disp) GET_by_offset(disp, driDispatchRemapTable[LoadTransposeMatrixdARB_remap_index]) #define SET_LoadTransposeMatrixdARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[LoadTransposeMatrixdARB_remap_index], fn) @@ -3138,45 +3207,6 @@ extern int driDispatchRemapTable[ driDispatchRemapTable_size ]; #define CALL_PolygonOffsetEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLfloat, GLfloat)), driDispatchRemapTable[PolygonOffsetEXT_remap_index], parameters) #define GET_PolygonOffsetEXT(disp) GET_by_offset(disp, driDispatchRemapTable[PolygonOffsetEXT_remap_index]) #define SET_PolygonOffsetEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PolygonOffsetEXT_remap_index], fn) -#define CALL_GetHistogramEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLboolean, GLenum, GLenum, GLvoid *)), driDispatchRemapTable[GetHistogramEXT_remap_index], parameters) -#define GET_GetHistogramEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetHistogramEXT_remap_index]) -#define SET_GetHistogramEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetHistogramEXT_remap_index], fn) -#define CALL_GetHistogramParameterfvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLfloat *)), driDispatchRemapTable[GetHistogramParameterfvEXT_remap_index], parameters) -#define GET_GetHistogramParameterfvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetHistogramParameterfvEXT_remap_index]) -#define SET_GetHistogramParameterfvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetHistogramParameterfvEXT_remap_index], fn) -#define CALL_GetHistogramParameterivEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLint *)), driDispatchRemapTable[GetHistogramParameterivEXT_remap_index], parameters) -#define GET_GetHistogramParameterivEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetHistogramParameterivEXT_remap_index]) -#define SET_GetHistogramParameterivEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetHistogramParameterivEXT_remap_index], fn) -#define CALL_GetMinmaxEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLboolean, GLenum, GLenum, GLvoid *)), driDispatchRemapTable[GetMinmaxEXT_remap_index], parameters) -#define GET_GetMinmaxEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetMinmaxEXT_remap_index]) -#define SET_GetMinmaxEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetMinmaxEXT_remap_index], fn) -#define CALL_GetMinmaxParameterfvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLfloat *)), driDispatchRemapTable[GetMinmaxParameterfvEXT_remap_index], parameters) -#define GET_GetMinmaxParameterfvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetMinmaxParameterfvEXT_remap_index]) -#define SET_GetMinmaxParameterfvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetMinmaxParameterfvEXT_remap_index], fn) -#define CALL_GetMinmaxParameterivEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLint *)), driDispatchRemapTable[GetMinmaxParameterivEXT_remap_index], parameters) -#define GET_GetMinmaxParameterivEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetMinmaxParameterivEXT_remap_index]) -#define SET_GetMinmaxParameterivEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetMinmaxParameterivEXT_remap_index], fn) -#define CALL_GetConvolutionFilterEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLvoid *)), driDispatchRemapTable[GetConvolutionFilterEXT_remap_index], parameters) -#define GET_GetConvolutionFilterEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetConvolutionFilterEXT_remap_index]) -#define SET_GetConvolutionFilterEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetConvolutionFilterEXT_remap_index], fn) -#define CALL_GetConvolutionParameterfvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLfloat *)), driDispatchRemapTable[GetConvolutionParameterfvEXT_remap_index], parameters) -#define GET_GetConvolutionParameterfvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetConvolutionParameterfvEXT_remap_index]) -#define SET_GetConvolutionParameterfvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetConvolutionParameterfvEXT_remap_index], fn) -#define CALL_GetConvolutionParameterivEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLint *)), driDispatchRemapTable[GetConvolutionParameterivEXT_remap_index], parameters) -#define GET_GetConvolutionParameterivEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetConvolutionParameterivEXT_remap_index]) -#define SET_GetConvolutionParameterivEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetConvolutionParameterivEXT_remap_index], fn) -#define CALL_GetSeparableFilterEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *)), driDispatchRemapTable[GetSeparableFilterEXT_remap_index], parameters) -#define GET_GetSeparableFilterEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetSeparableFilterEXT_remap_index]) -#define SET_GetSeparableFilterEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetSeparableFilterEXT_remap_index], fn) -#define CALL_GetColorTableParameterfvSGI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLfloat *)), driDispatchRemapTable[GetColorTableParameterfvSGI_remap_index], parameters) -#define GET_GetColorTableParameterfvSGI(disp) GET_by_offset(disp, driDispatchRemapTable[GetColorTableParameterfvSGI_remap_index]) -#define SET_GetColorTableParameterfvSGI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetColorTableParameterfvSGI_remap_index], fn) -#define CALL_GetColorTableParameterivSGI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLint *)), driDispatchRemapTable[GetColorTableParameterivSGI_remap_index], parameters) -#define GET_GetColorTableParameterivSGI(disp) GET_by_offset(disp, driDispatchRemapTable[GetColorTableParameterivSGI_remap_index]) -#define SET_GetColorTableParameterivSGI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetColorTableParameterivSGI_remap_index], fn) -#define CALL_GetColorTableSGI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLvoid *)), driDispatchRemapTable[GetColorTableSGI_remap_index], parameters) -#define GET_GetColorTableSGI(disp) GET_by_offset(disp, driDispatchRemapTable[GetColorTableSGI_remap_index]) -#define SET_GetColorTableSGI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetColorTableSGI_remap_index], fn) #define CALL_GetPixelTexGenParameterfvSGIS(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLfloat *)), driDispatchRemapTable[GetPixelTexGenParameterfvSGIS_remap_index], parameters) #define GET_GetPixelTexGenParameterfvSGIS(disp) GET_by_offset(disp, driDispatchRemapTable[GetPixelTexGenParameterfvSGIS_remap_index]) #define SET_GetPixelTexGenParameterfvSGIS(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetPixelTexGenParameterfvSGIS_remap_index], fn) @@ -3195,15 +3225,6 @@ extern int driDispatchRemapTable[ driDispatchRemapTable_size ]; #define CALL_PixelTexGenParameterivSGIS(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, const GLint *)), driDispatchRemapTable[PixelTexGenParameterivSGIS_remap_index], parameters) #define GET_PixelTexGenParameterivSGIS(disp) GET_by_offset(disp, driDispatchRemapTable[PixelTexGenParameterivSGIS_remap_index]) #define SET_PixelTexGenParameterivSGIS(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PixelTexGenParameterivSGIS_remap_index], fn) -#define CALL_AreTexturesResidentEXT(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLsizei, const GLuint *, GLboolean *)), driDispatchRemapTable[AreTexturesResidentEXT_remap_index], parameters) -#define GET_AreTexturesResidentEXT(disp) GET_by_offset(disp, driDispatchRemapTable[AreTexturesResidentEXT_remap_index]) -#define SET_AreTexturesResidentEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[AreTexturesResidentEXT_remap_index], fn) -#define CALL_GenTexturesEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, GLuint *)), driDispatchRemapTable[GenTexturesEXT_remap_index], parameters) -#define GET_GenTexturesEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GenTexturesEXT_remap_index]) -#define SET_GenTexturesEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GenTexturesEXT_remap_index], fn) -#define CALL_IsTextureEXT(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[IsTextureEXT_remap_index], parameters) -#define GET_IsTextureEXT(disp) GET_by_offset(disp, driDispatchRemapTable[IsTextureEXT_remap_index]) -#define SET_IsTextureEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IsTextureEXT_remap_index], fn) #define CALL_SampleMaskSGIS(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLclampf, GLboolean)), driDispatchRemapTable[SampleMaskSGIS_remap_index], parameters) #define GET_SampleMaskSGIS(disp) GET_by_offset(disp, driDispatchRemapTable[SampleMaskSGIS_remap_index]) #define SET_SampleMaskSGIS(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SampleMaskSGIS_remap_index], fn) @@ -3789,12 +3810,6 @@ extern int driDispatchRemapTable[ driDispatchRemapTable_size ]; #define CALL_GetFramebufferAttachmentParameterivEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLint *)), driDispatchRemapTable[GetFramebufferAttachmentParameterivEXT_remap_index], parameters) #define GET_GetFramebufferAttachmentParameterivEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetFramebufferAttachmentParameterivEXT_remap_index]) #define SET_GetFramebufferAttachmentParameterivEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetFramebufferAttachmentParameterivEXT_remap_index], fn) -#define CALL_GetQueryObjecti64vEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLint64EXT *)), driDispatchRemapTable[GetQueryObjecti64vEXT_remap_index], parameters) -#define GET_GetQueryObjecti64vEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetQueryObjecti64vEXT_remap_index]) -#define SET_GetQueryObjecti64vEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetQueryObjecti64vEXT_remap_index], fn) -#define CALL_GetQueryObjectui64vEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLuint64EXT *)), driDispatchRemapTable[GetQueryObjectui64vEXT_remap_index], parameters) -#define GET_GetQueryObjectui64vEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetQueryObjectui64vEXT_remap_index]) -#define SET_GetQueryObjectui64vEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetQueryObjectui64vEXT_remap_index], fn) #define CALL_GetRenderbufferParameterivEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLint *)), driDispatchRemapTable[GetRenderbufferParameterivEXT_remap_index], parameters) #define GET_GetRenderbufferParameterivEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetRenderbufferParameterivEXT_remap_index]) #define SET_GetRenderbufferParameterivEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetRenderbufferParameterivEXT_remap_index], fn) @@ -3816,6 +3831,12 @@ extern int driDispatchRemapTable[ driDispatchRemapTable_size ]; #define CALL_ProgramLocalParameters4fvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLsizei, const GLfloat *)), driDispatchRemapTable[ProgramLocalParameters4fvEXT_remap_index], parameters) #define GET_ProgramLocalParameters4fvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramLocalParameters4fvEXT_remap_index]) #define SET_ProgramLocalParameters4fvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramLocalParameters4fvEXT_remap_index], fn) +#define CALL_GetQueryObjecti64vEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLint64EXT *)), driDispatchRemapTable[GetQueryObjecti64vEXT_remap_index], parameters) +#define GET_GetQueryObjecti64vEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetQueryObjecti64vEXT_remap_index]) +#define SET_GetQueryObjecti64vEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetQueryObjecti64vEXT_remap_index], fn) +#define CALL_GetQueryObjectui64vEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLuint64EXT *)), driDispatchRemapTable[GetQueryObjectui64vEXT_remap_index], parameters) +#define GET_GetQueryObjectui64vEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetQueryObjectui64vEXT_remap_index]) +#define SET_GetQueryObjectui64vEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetQueryObjectui64vEXT_remap_index], fn) #endif /* !defined(IN_DRI_DRIVER) */ diff --git a/src/mesa/glapi/glapi.c b/src/mesa/glapi/glapi.c index 95edbc9071e..d1ccc5fba69 100644 --- a/src/mesa/glapi/glapi.c +++ b/src/mesa/glapi/glapi.c @@ -430,7 +430,12 @@ get_static_proc_address(const char *funcName) { const glprocs_table_t * const f = find_entry( funcName ); if (f) { -#ifdef DISPATCH_FUNCTION_SIZE +#if defined(DISPATCH_FUNCTION_SIZE) && defined(GLX_INDIRECT_RENDERING) + return (f->Address == NULL) + ? (_glapi_proc) (gl_dispatch_functions_start + + (DISPATCH_FUNCTION_SIZE * f->Offset)) + : f->Address; +#elif defined(DISPATCH_FUNCTION_SIZE) return (_glapi_proc) (gl_dispatch_functions_start + (DISPATCH_FUNCTION_SIZE * f->Offset)); #else @@ -992,13 +997,6 @@ _glapi_check_table(const struct _glapi_table *table) assert(blendColorOffset == _gloffset_BlendColor); assert(blendColorOffset == offset); } - { - GLuint istextureOffset = _glapi_get_proc_offset("glIsTextureEXT"); - char *istextureFunc = (char*) &table->IsTextureEXT; - GLuint offset = (istextureFunc - (char *) table) / sizeof(void *); - assert(istextureOffset == _gloffset_IsTextureEXT); - assert(istextureOffset == offset); - } { GLuint secondaryColor3fOffset = _glapi_get_proc_offset("glSecondaryColor3fEXT"); char *secondaryColor3fFunc = (char*) &table->SecondaryColor3fEXT; diff --git a/src/mesa/glapi/glapioffsets.h b/src/mesa/glapi/glapioffsets.h index 2dc4e77f45c..cb0d21083ef 100644 --- a/src/mesa/glapi/glapioffsets.h +++ b/src/mesa/glapi/glapioffsets.h @@ -440,374 +440,396 @@ #if !defined(IN_DRI_DRIVER) -#define _gloffset_StencilFuncSeparate 408 -#define _gloffset_StencilMaskSeparate 409 -#define _gloffset_StencilOpSeparate 410 -#define _gloffset_LoadTransposeMatrixdARB 411 -#define _gloffset_LoadTransposeMatrixfARB 412 -#define _gloffset_MultTransposeMatrixdARB 413 -#define _gloffset_MultTransposeMatrixfARB 414 -#define _gloffset_SampleCoverageARB 415 -#define _gloffset_CompressedTexImage1DARB 416 -#define _gloffset_CompressedTexImage2DARB 417 -#define _gloffset_CompressedTexImage3DARB 418 -#define _gloffset_CompressedTexSubImage1DARB 419 -#define _gloffset_CompressedTexSubImage2DARB 420 -#define _gloffset_CompressedTexSubImage3DARB 421 -#define _gloffset_GetCompressedTexImageARB 422 -#define _gloffset_DisableVertexAttribArrayARB 423 -#define _gloffset_EnableVertexAttribArrayARB 424 -#define _gloffset_GetProgramEnvParameterdvARB 425 -#define _gloffset_GetProgramEnvParameterfvARB 426 -#define _gloffset_GetProgramLocalParameterdvARB 427 -#define _gloffset_GetProgramLocalParameterfvARB 428 -#define _gloffset_GetProgramStringARB 429 -#define _gloffset_GetProgramivARB 430 -#define _gloffset_GetVertexAttribdvARB 431 -#define _gloffset_GetVertexAttribfvARB 432 -#define _gloffset_GetVertexAttribivARB 433 -#define _gloffset_ProgramEnvParameter4dARB 434 -#define _gloffset_ProgramEnvParameter4dvARB 435 -#define _gloffset_ProgramEnvParameter4fARB 436 -#define _gloffset_ProgramEnvParameter4fvARB 437 -#define _gloffset_ProgramLocalParameter4dARB 438 -#define _gloffset_ProgramLocalParameter4dvARB 439 -#define _gloffset_ProgramLocalParameter4fARB 440 -#define _gloffset_ProgramLocalParameter4fvARB 441 -#define _gloffset_ProgramStringARB 442 -#define _gloffset_VertexAttrib1dARB 443 -#define _gloffset_VertexAttrib1dvARB 444 -#define _gloffset_VertexAttrib1fARB 445 -#define _gloffset_VertexAttrib1fvARB 446 -#define _gloffset_VertexAttrib1sARB 447 -#define _gloffset_VertexAttrib1svARB 448 -#define _gloffset_VertexAttrib2dARB 449 -#define _gloffset_VertexAttrib2dvARB 450 -#define _gloffset_VertexAttrib2fARB 451 -#define _gloffset_VertexAttrib2fvARB 452 -#define _gloffset_VertexAttrib2sARB 453 -#define _gloffset_VertexAttrib2svARB 454 -#define _gloffset_VertexAttrib3dARB 455 -#define _gloffset_VertexAttrib3dvARB 456 -#define _gloffset_VertexAttrib3fARB 457 -#define _gloffset_VertexAttrib3fvARB 458 -#define _gloffset_VertexAttrib3sARB 459 -#define _gloffset_VertexAttrib3svARB 460 -#define _gloffset_VertexAttrib4NbvARB 461 -#define _gloffset_VertexAttrib4NivARB 462 -#define _gloffset_VertexAttrib4NsvARB 463 -#define _gloffset_VertexAttrib4NubARB 464 -#define _gloffset_VertexAttrib4NubvARB 465 -#define _gloffset_VertexAttrib4NuivARB 466 -#define _gloffset_VertexAttrib4NusvARB 467 -#define _gloffset_VertexAttrib4bvARB 468 -#define _gloffset_VertexAttrib4dARB 469 -#define _gloffset_VertexAttrib4dvARB 470 -#define _gloffset_VertexAttrib4fARB 471 -#define _gloffset_VertexAttrib4fvARB 472 -#define _gloffset_VertexAttrib4ivARB 473 -#define _gloffset_VertexAttrib4sARB 474 -#define _gloffset_VertexAttrib4svARB 475 -#define _gloffset_VertexAttrib4ubvARB 476 -#define _gloffset_VertexAttrib4uivARB 477 -#define _gloffset_VertexAttrib4usvARB 478 -#define _gloffset_VertexAttribPointerARB 479 -#define _gloffset_BindBufferARB 480 -#define _gloffset_BufferDataARB 481 -#define _gloffset_BufferSubDataARB 482 -#define _gloffset_DeleteBuffersARB 483 -#define _gloffset_GenBuffersARB 484 -#define _gloffset_GetBufferParameterivARB 485 -#define _gloffset_GetBufferPointervARB 486 -#define _gloffset_GetBufferSubDataARB 487 -#define _gloffset_IsBufferARB 488 -#define _gloffset_MapBufferARB 489 -#define _gloffset_UnmapBufferARB 490 -#define _gloffset_BeginQueryARB 491 -#define _gloffset_DeleteQueriesARB 492 -#define _gloffset_EndQueryARB 493 -#define _gloffset_GenQueriesARB 494 -#define _gloffset_GetQueryObjectivARB 495 -#define _gloffset_GetQueryObjectuivARB 496 -#define _gloffset_GetQueryivARB 497 -#define _gloffset_IsQueryARB 498 -#define _gloffset_AttachObjectARB 499 -#define _gloffset_CompileShaderARB 500 -#define _gloffset_CreateProgramObjectARB 501 -#define _gloffset_CreateShaderObjectARB 502 -#define _gloffset_DeleteObjectARB 503 -#define _gloffset_DetachObjectARB 504 -#define _gloffset_GetActiveUniformARB 505 -#define _gloffset_GetAttachedObjectsARB 506 -#define _gloffset_GetHandleARB 507 -#define _gloffset_GetInfoLogARB 508 -#define _gloffset_GetObjectParameterfvARB 509 -#define _gloffset_GetObjectParameterivARB 510 -#define _gloffset_GetShaderSourceARB 511 -#define _gloffset_GetUniformLocationARB 512 -#define _gloffset_GetUniformfvARB 513 -#define _gloffset_GetUniformivARB 514 -#define _gloffset_LinkProgramARB 515 -#define _gloffset_ShaderSourceARB 516 -#define _gloffset_Uniform1fARB 517 -#define _gloffset_Uniform1fvARB 518 -#define _gloffset_Uniform1iARB 519 -#define _gloffset_Uniform1ivARB 520 -#define _gloffset_Uniform2fARB 521 -#define _gloffset_Uniform2fvARB 522 -#define _gloffset_Uniform2iARB 523 -#define _gloffset_Uniform2ivARB 524 -#define _gloffset_Uniform3fARB 525 -#define _gloffset_Uniform3fvARB 526 -#define _gloffset_Uniform3iARB 527 -#define _gloffset_Uniform3ivARB 528 -#define _gloffset_Uniform4fARB 529 -#define _gloffset_Uniform4fvARB 530 -#define _gloffset_Uniform4iARB 531 -#define _gloffset_Uniform4ivARB 532 -#define _gloffset_UniformMatrix2fvARB 533 -#define _gloffset_UniformMatrix3fvARB 534 -#define _gloffset_UniformMatrix4fvARB 535 -#define _gloffset_UseProgramObjectARB 536 -#define _gloffset_ValidateProgramARB 537 -#define _gloffset_BindAttribLocationARB 538 -#define _gloffset_GetActiveAttribARB 539 -#define _gloffset_GetAttribLocationARB 540 -#define _gloffset_DrawBuffersARB 541 -#define _gloffset_PolygonOffsetEXT 542 -#define _gloffset_GetHistogramEXT 543 -#define _gloffset_GetHistogramParameterfvEXT 544 -#define _gloffset_GetHistogramParameterivEXT 545 -#define _gloffset_GetMinmaxEXT 546 -#define _gloffset_GetMinmaxParameterfvEXT 547 -#define _gloffset_GetMinmaxParameterivEXT 548 -#define _gloffset_GetConvolutionFilterEXT 549 -#define _gloffset_GetConvolutionParameterfvEXT 550 -#define _gloffset_GetConvolutionParameterivEXT 551 -#define _gloffset_GetSeparableFilterEXT 552 -#define _gloffset_GetColorTableParameterfvSGI 553 -#define _gloffset_GetColorTableParameterivSGI 554 -#define _gloffset_GetColorTableSGI 555 -#define _gloffset_GetPixelTexGenParameterfvSGIS 556 -#define _gloffset_GetPixelTexGenParameterivSGIS 557 -#define _gloffset_PixelTexGenParameterfSGIS 558 -#define _gloffset_PixelTexGenParameterfvSGIS 559 -#define _gloffset_PixelTexGenParameteriSGIS 560 -#define _gloffset_PixelTexGenParameterivSGIS 561 -#define _gloffset_AreTexturesResidentEXT 562 -#define _gloffset_GenTexturesEXT 563 -#define _gloffset_IsTextureEXT 564 -#define _gloffset_SampleMaskSGIS 565 -#define _gloffset_SamplePatternSGIS 566 -#define _gloffset_ColorPointerEXT 567 -#define _gloffset_EdgeFlagPointerEXT 568 -#define _gloffset_IndexPointerEXT 569 -#define _gloffset_NormalPointerEXT 570 -#define _gloffset_TexCoordPointerEXT 571 -#define _gloffset_VertexPointerEXT 572 -#define _gloffset_PointParameterfEXT 573 -#define _gloffset_PointParameterfvEXT 574 -#define _gloffset_LockArraysEXT 575 -#define _gloffset_UnlockArraysEXT 576 -#define _gloffset_CullParameterdvEXT 577 -#define _gloffset_CullParameterfvEXT 578 -#define _gloffset_SecondaryColor3bEXT 579 -#define _gloffset_SecondaryColor3bvEXT 580 -#define _gloffset_SecondaryColor3dEXT 581 -#define _gloffset_SecondaryColor3dvEXT 582 -#define _gloffset_SecondaryColor3fEXT 583 -#define _gloffset_SecondaryColor3fvEXT 584 -#define _gloffset_SecondaryColor3iEXT 585 -#define _gloffset_SecondaryColor3ivEXT 586 -#define _gloffset_SecondaryColor3sEXT 587 -#define _gloffset_SecondaryColor3svEXT 588 -#define _gloffset_SecondaryColor3ubEXT 589 -#define _gloffset_SecondaryColor3ubvEXT 590 -#define _gloffset_SecondaryColor3uiEXT 591 -#define _gloffset_SecondaryColor3uivEXT 592 -#define _gloffset_SecondaryColor3usEXT 593 -#define _gloffset_SecondaryColor3usvEXT 594 -#define _gloffset_SecondaryColorPointerEXT 595 -#define _gloffset_MultiDrawArraysEXT 596 -#define _gloffset_MultiDrawElementsEXT 597 -#define _gloffset_FogCoordPointerEXT 598 -#define _gloffset_FogCoorddEXT 599 -#define _gloffset_FogCoorddvEXT 600 -#define _gloffset_FogCoordfEXT 601 -#define _gloffset_FogCoordfvEXT 602 -#define _gloffset_PixelTexGenSGIX 603 -#define _gloffset_BlendFuncSeparateEXT 604 -#define _gloffset_FlushVertexArrayRangeNV 605 -#define _gloffset_VertexArrayRangeNV 606 -#define _gloffset_CombinerInputNV 607 -#define _gloffset_CombinerOutputNV 608 -#define _gloffset_CombinerParameterfNV 609 -#define _gloffset_CombinerParameterfvNV 610 -#define _gloffset_CombinerParameteriNV 611 -#define _gloffset_CombinerParameterivNV 612 -#define _gloffset_FinalCombinerInputNV 613 -#define _gloffset_GetCombinerInputParameterfvNV 614 -#define _gloffset_GetCombinerInputParameterivNV 615 -#define _gloffset_GetCombinerOutputParameterfvNV 616 -#define _gloffset_GetCombinerOutputParameterivNV 617 -#define _gloffset_GetFinalCombinerInputParameterfvNV 618 -#define _gloffset_GetFinalCombinerInputParameterivNV 619 -#define _gloffset_ResizeBuffersMESA 620 -#define _gloffset_WindowPos2dMESA 621 -#define _gloffset_WindowPos2dvMESA 622 -#define _gloffset_WindowPos2fMESA 623 -#define _gloffset_WindowPos2fvMESA 624 -#define _gloffset_WindowPos2iMESA 625 -#define _gloffset_WindowPos2ivMESA 626 -#define _gloffset_WindowPos2sMESA 627 -#define _gloffset_WindowPos2svMESA 628 -#define _gloffset_WindowPos3dMESA 629 -#define _gloffset_WindowPos3dvMESA 630 -#define _gloffset_WindowPos3fMESA 631 -#define _gloffset_WindowPos3fvMESA 632 -#define _gloffset_WindowPos3iMESA 633 -#define _gloffset_WindowPos3ivMESA 634 -#define _gloffset_WindowPos3sMESA 635 -#define _gloffset_WindowPos3svMESA 636 -#define _gloffset_WindowPos4dMESA 637 -#define _gloffset_WindowPos4dvMESA 638 -#define _gloffset_WindowPos4fMESA 639 -#define _gloffset_WindowPos4fvMESA 640 -#define _gloffset_WindowPos4iMESA 641 -#define _gloffset_WindowPos4ivMESA 642 -#define _gloffset_WindowPos4sMESA 643 -#define _gloffset_WindowPos4svMESA 644 -#define _gloffset_MultiModeDrawArraysIBM 645 -#define _gloffset_MultiModeDrawElementsIBM 646 -#define _gloffset_DeleteFencesNV 647 -#define _gloffset_FinishFenceNV 648 -#define _gloffset_GenFencesNV 649 -#define _gloffset_GetFenceivNV 650 -#define _gloffset_IsFenceNV 651 -#define _gloffset_SetFenceNV 652 -#define _gloffset_TestFenceNV 653 -#define _gloffset_AreProgramsResidentNV 654 -#define _gloffset_BindProgramNV 655 -#define _gloffset_DeleteProgramsNV 656 -#define _gloffset_ExecuteProgramNV 657 -#define _gloffset_GenProgramsNV 658 -#define _gloffset_GetProgramParameterdvNV 659 -#define _gloffset_GetProgramParameterfvNV 660 -#define _gloffset_GetProgramStringNV 661 -#define _gloffset_GetProgramivNV 662 -#define _gloffset_GetTrackMatrixivNV 663 -#define _gloffset_GetVertexAttribPointervNV 664 -#define _gloffset_GetVertexAttribdvNV 665 -#define _gloffset_GetVertexAttribfvNV 666 -#define _gloffset_GetVertexAttribivNV 667 -#define _gloffset_IsProgramNV 668 -#define _gloffset_LoadProgramNV 669 -#define _gloffset_ProgramParameter4dNV 670 -#define _gloffset_ProgramParameter4dvNV 671 -#define _gloffset_ProgramParameter4fNV 672 -#define _gloffset_ProgramParameter4fvNV 673 -#define _gloffset_ProgramParameters4dvNV 674 -#define _gloffset_ProgramParameters4fvNV 675 -#define _gloffset_RequestResidentProgramsNV 676 -#define _gloffset_TrackMatrixNV 677 -#define _gloffset_VertexAttrib1dNV 678 -#define _gloffset_VertexAttrib1dvNV 679 -#define _gloffset_VertexAttrib1fNV 680 -#define _gloffset_VertexAttrib1fvNV 681 -#define _gloffset_VertexAttrib1sNV 682 -#define _gloffset_VertexAttrib1svNV 683 -#define _gloffset_VertexAttrib2dNV 684 -#define _gloffset_VertexAttrib2dvNV 685 -#define _gloffset_VertexAttrib2fNV 686 -#define _gloffset_VertexAttrib2fvNV 687 -#define _gloffset_VertexAttrib2sNV 688 -#define _gloffset_VertexAttrib2svNV 689 -#define _gloffset_VertexAttrib3dNV 690 -#define _gloffset_VertexAttrib3dvNV 691 -#define _gloffset_VertexAttrib3fNV 692 -#define _gloffset_VertexAttrib3fvNV 693 -#define _gloffset_VertexAttrib3sNV 694 -#define _gloffset_VertexAttrib3svNV 695 -#define _gloffset_VertexAttrib4dNV 696 -#define _gloffset_VertexAttrib4dvNV 697 -#define _gloffset_VertexAttrib4fNV 698 -#define _gloffset_VertexAttrib4fvNV 699 -#define _gloffset_VertexAttrib4sNV 700 -#define _gloffset_VertexAttrib4svNV 701 -#define _gloffset_VertexAttrib4ubNV 702 -#define _gloffset_VertexAttrib4ubvNV 703 -#define _gloffset_VertexAttribPointerNV 704 -#define _gloffset_VertexAttribs1dvNV 705 -#define _gloffset_VertexAttribs1fvNV 706 -#define _gloffset_VertexAttribs1svNV 707 -#define _gloffset_VertexAttribs2dvNV 708 -#define _gloffset_VertexAttribs2fvNV 709 -#define _gloffset_VertexAttribs2svNV 710 -#define _gloffset_VertexAttribs3dvNV 711 -#define _gloffset_VertexAttribs3fvNV 712 -#define _gloffset_VertexAttribs3svNV 713 -#define _gloffset_VertexAttribs4dvNV 714 -#define _gloffset_VertexAttribs4fvNV 715 -#define _gloffset_VertexAttribs4svNV 716 -#define _gloffset_VertexAttribs4ubvNV 717 -#define _gloffset_AlphaFragmentOp1ATI 718 -#define _gloffset_AlphaFragmentOp2ATI 719 -#define _gloffset_AlphaFragmentOp3ATI 720 -#define _gloffset_BeginFragmentShaderATI 721 -#define _gloffset_BindFragmentShaderATI 722 -#define _gloffset_ColorFragmentOp1ATI 723 -#define _gloffset_ColorFragmentOp2ATI 724 -#define _gloffset_ColorFragmentOp3ATI 725 -#define _gloffset_DeleteFragmentShaderATI 726 -#define _gloffset_EndFragmentShaderATI 727 -#define _gloffset_GenFragmentShadersATI 728 -#define _gloffset_PassTexCoordATI 729 -#define _gloffset_SampleMapATI 730 -#define _gloffset_SetFragmentShaderConstantATI 731 -#define _gloffset_PointParameteriNV 732 -#define _gloffset_PointParameterivNV 733 -#define _gloffset_ActiveStencilFaceEXT 734 -#define _gloffset_BindVertexArrayAPPLE 735 -#define _gloffset_DeleteVertexArraysAPPLE 736 -#define _gloffset_GenVertexArraysAPPLE 737 -#define _gloffset_IsVertexArrayAPPLE 738 -#define _gloffset_GetProgramNamedParameterdvNV 739 -#define _gloffset_GetProgramNamedParameterfvNV 740 -#define _gloffset_ProgramNamedParameter4dNV 741 -#define _gloffset_ProgramNamedParameter4dvNV 742 -#define _gloffset_ProgramNamedParameter4fNV 743 -#define _gloffset_ProgramNamedParameter4fvNV 744 -#define _gloffset_DepthBoundsEXT 745 -#define _gloffset_BlendEquationSeparateEXT 746 -#define _gloffset_BindFramebufferEXT 747 -#define _gloffset_BindRenderbufferEXT 748 -#define _gloffset_CheckFramebufferStatusEXT 749 -#define _gloffset_DeleteFramebuffersEXT 750 -#define _gloffset_DeleteRenderbuffersEXT 751 -#define _gloffset_FramebufferRenderbufferEXT 752 -#define _gloffset_FramebufferTexture1DEXT 753 -#define _gloffset_FramebufferTexture2DEXT 754 -#define _gloffset_FramebufferTexture3DEXT 755 -#define _gloffset_GenFramebuffersEXT 756 -#define _gloffset_GenRenderbuffersEXT 757 -#define _gloffset_GenerateMipmapEXT 758 -#define _gloffset_GetFramebufferAttachmentParameterivEXT 759 -#define _gloffset_GetQueryObjecti64vEXT 760 -#define _gloffset_GetQueryObjectui64vEXT 761 -#define _gloffset_GetRenderbufferParameterivEXT 762 -#define _gloffset_IsFramebufferEXT 763 -#define _gloffset_IsRenderbufferEXT 764 -#define _gloffset_RenderbufferStorageEXT 765 -#define _gloffset_BlitFramebufferEXT 766 -#define _gloffset_ProgramEnvParameters4fvEXT 767 -#define _gloffset_ProgramLocalParameters4fvEXT 768 -#define _gloffset_FIRST_DYNAMIC 769 +#define _gloffset_AttachShader 408 +#define _gloffset_CreateProgram 409 +#define _gloffset_CreateShader 410 +#define _gloffset_DeleteProgram 411 +#define _gloffset_DeleteShader 412 +#define _gloffset_DetachShader 413 +#define _gloffset_GetAttachedShaders 414 +#define _gloffset_GetProgramInfoLog 415 +#define _gloffset_GetProgramiv 416 +#define _gloffset_GetShaderInfoLog 417 +#define _gloffset_GetShaderiv 418 +#define _gloffset_IsProgram 419 +#define _gloffset_IsShader 420 +#define _gloffset_StencilFuncSeparate 421 +#define _gloffset_StencilMaskSeparate 422 +#define _gloffset_StencilOpSeparate 423 +#define _gloffset_UniformMatrix2x3fv 424 +#define _gloffset_UniformMatrix2x4fv 425 +#define _gloffset_UniformMatrix3x2fv 426 +#define _gloffset_UniformMatrix3x4fv 427 +#define _gloffset_UniformMatrix4x2fv 428 +#define _gloffset_UniformMatrix4x3fv 429 +#define _gloffset_LoadTransposeMatrixdARB 430 +#define _gloffset_LoadTransposeMatrixfARB 431 +#define _gloffset_MultTransposeMatrixdARB 432 +#define _gloffset_MultTransposeMatrixfARB 433 +#define _gloffset_SampleCoverageARB 434 +#define _gloffset_CompressedTexImage1DARB 435 +#define _gloffset_CompressedTexImage2DARB 436 +#define _gloffset_CompressedTexImage3DARB 437 +#define _gloffset_CompressedTexSubImage1DARB 438 +#define _gloffset_CompressedTexSubImage2DARB 439 +#define _gloffset_CompressedTexSubImage3DARB 440 +#define _gloffset_GetCompressedTexImageARB 441 +#define _gloffset_DisableVertexAttribArrayARB 442 +#define _gloffset_EnableVertexAttribArrayARB 443 +#define _gloffset_GetProgramEnvParameterdvARB 444 +#define _gloffset_GetProgramEnvParameterfvARB 445 +#define _gloffset_GetProgramLocalParameterdvARB 446 +#define _gloffset_GetProgramLocalParameterfvARB 447 +#define _gloffset_GetProgramStringARB 448 +#define _gloffset_GetProgramivARB 449 +#define _gloffset_GetVertexAttribdvARB 450 +#define _gloffset_GetVertexAttribfvARB 451 +#define _gloffset_GetVertexAttribivARB 452 +#define _gloffset_ProgramEnvParameter4dARB 453 +#define _gloffset_ProgramEnvParameter4dvARB 454 +#define _gloffset_ProgramEnvParameter4fARB 455 +#define _gloffset_ProgramEnvParameter4fvARB 456 +#define _gloffset_ProgramLocalParameter4dARB 457 +#define _gloffset_ProgramLocalParameter4dvARB 458 +#define _gloffset_ProgramLocalParameter4fARB 459 +#define _gloffset_ProgramLocalParameter4fvARB 460 +#define _gloffset_ProgramStringARB 461 +#define _gloffset_VertexAttrib1dARB 462 +#define _gloffset_VertexAttrib1dvARB 463 +#define _gloffset_VertexAttrib1fARB 464 +#define _gloffset_VertexAttrib1fvARB 465 +#define _gloffset_VertexAttrib1sARB 466 +#define _gloffset_VertexAttrib1svARB 467 +#define _gloffset_VertexAttrib2dARB 468 +#define _gloffset_VertexAttrib2dvARB 469 +#define _gloffset_VertexAttrib2fARB 470 +#define _gloffset_VertexAttrib2fvARB 471 +#define _gloffset_VertexAttrib2sARB 472 +#define _gloffset_VertexAttrib2svARB 473 +#define _gloffset_VertexAttrib3dARB 474 +#define _gloffset_VertexAttrib3dvARB 475 +#define _gloffset_VertexAttrib3fARB 476 +#define _gloffset_VertexAttrib3fvARB 477 +#define _gloffset_VertexAttrib3sARB 478 +#define _gloffset_VertexAttrib3svARB 479 +#define _gloffset_VertexAttrib4NbvARB 480 +#define _gloffset_VertexAttrib4NivARB 481 +#define _gloffset_VertexAttrib4NsvARB 482 +#define _gloffset_VertexAttrib4NubARB 483 +#define _gloffset_VertexAttrib4NubvARB 484 +#define _gloffset_VertexAttrib4NuivARB 485 +#define _gloffset_VertexAttrib4NusvARB 486 +#define _gloffset_VertexAttrib4bvARB 487 +#define _gloffset_VertexAttrib4dARB 488 +#define _gloffset_VertexAttrib4dvARB 489 +#define _gloffset_VertexAttrib4fARB 490 +#define _gloffset_VertexAttrib4fvARB 491 +#define _gloffset_VertexAttrib4ivARB 492 +#define _gloffset_VertexAttrib4sARB 493 +#define _gloffset_VertexAttrib4svARB 494 +#define _gloffset_VertexAttrib4ubvARB 495 +#define _gloffset_VertexAttrib4uivARB 496 +#define _gloffset_VertexAttrib4usvARB 497 +#define _gloffset_VertexAttribPointerARB 498 +#define _gloffset_BindBufferARB 499 +#define _gloffset_BufferDataARB 500 +#define _gloffset_BufferSubDataARB 501 +#define _gloffset_DeleteBuffersARB 502 +#define _gloffset_GenBuffersARB 503 +#define _gloffset_GetBufferParameterivARB 504 +#define _gloffset_GetBufferPointervARB 505 +#define _gloffset_GetBufferSubDataARB 506 +#define _gloffset_IsBufferARB 507 +#define _gloffset_MapBufferARB 508 +#define _gloffset_UnmapBufferARB 509 +#define _gloffset_BeginQueryARB 510 +#define _gloffset_DeleteQueriesARB 511 +#define _gloffset_EndQueryARB 512 +#define _gloffset_GenQueriesARB 513 +#define _gloffset_GetQueryObjectivARB 514 +#define _gloffset_GetQueryObjectuivARB 515 +#define _gloffset_GetQueryivARB 516 +#define _gloffset_IsQueryARB 517 +#define _gloffset_AttachObjectARB 518 +#define _gloffset_CompileShaderARB 519 +#define _gloffset_CreateProgramObjectARB 520 +#define _gloffset_CreateShaderObjectARB 521 +#define _gloffset_DeleteObjectARB 522 +#define _gloffset_DetachObjectARB 523 +#define _gloffset_GetActiveUniformARB 524 +#define _gloffset_GetAttachedObjectsARB 525 +#define _gloffset_GetHandleARB 526 +#define _gloffset_GetInfoLogARB 527 +#define _gloffset_GetObjectParameterfvARB 528 +#define _gloffset_GetObjectParameterivARB 529 +#define _gloffset_GetShaderSourceARB 530 +#define _gloffset_GetUniformLocationARB 531 +#define _gloffset_GetUniformfvARB 532 +#define _gloffset_GetUniformivARB 533 +#define _gloffset_LinkProgramARB 534 +#define _gloffset_ShaderSourceARB 535 +#define _gloffset_Uniform1fARB 536 +#define _gloffset_Uniform1fvARB 537 +#define _gloffset_Uniform1iARB 538 +#define _gloffset_Uniform1ivARB 539 +#define _gloffset_Uniform2fARB 540 +#define _gloffset_Uniform2fvARB 541 +#define _gloffset_Uniform2iARB 542 +#define _gloffset_Uniform2ivARB 543 +#define _gloffset_Uniform3fARB 544 +#define _gloffset_Uniform3fvARB 545 +#define _gloffset_Uniform3iARB 546 +#define _gloffset_Uniform3ivARB 547 +#define _gloffset_Uniform4fARB 548 +#define _gloffset_Uniform4fvARB 549 +#define _gloffset_Uniform4iARB 550 +#define _gloffset_Uniform4ivARB 551 +#define _gloffset_UniformMatrix2fvARB 552 +#define _gloffset_UniformMatrix3fvARB 553 +#define _gloffset_UniformMatrix4fvARB 554 +#define _gloffset_UseProgramObjectARB 555 +#define _gloffset_ValidateProgramARB 556 +#define _gloffset_BindAttribLocationARB 557 +#define _gloffset_GetActiveAttribARB 558 +#define _gloffset_GetAttribLocationARB 559 +#define _gloffset_DrawBuffersARB 560 +#define _gloffset_PolygonOffsetEXT 561 +#define _gloffset_GetPixelTexGenParameterfvSGIS 562 +#define _gloffset_GetPixelTexGenParameterivSGIS 563 +#define _gloffset_PixelTexGenParameterfSGIS 564 +#define _gloffset_PixelTexGenParameterfvSGIS 565 +#define _gloffset_PixelTexGenParameteriSGIS 566 +#define _gloffset_PixelTexGenParameterivSGIS 567 +#define _gloffset_SampleMaskSGIS 568 +#define _gloffset_SamplePatternSGIS 569 +#define _gloffset_ColorPointerEXT 570 +#define _gloffset_EdgeFlagPointerEXT 571 +#define _gloffset_IndexPointerEXT 572 +#define _gloffset_NormalPointerEXT 573 +#define _gloffset_TexCoordPointerEXT 574 +#define _gloffset_VertexPointerEXT 575 +#define _gloffset_PointParameterfEXT 576 +#define _gloffset_PointParameterfvEXT 577 +#define _gloffset_LockArraysEXT 578 +#define _gloffset_UnlockArraysEXT 579 +#define _gloffset_CullParameterdvEXT 580 +#define _gloffset_CullParameterfvEXT 581 +#define _gloffset_SecondaryColor3bEXT 582 +#define _gloffset_SecondaryColor3bvEXT 583 +#define _gloffset_SecondaryColor3dEXT 584 +#define _gloffset_SecondaryColor3dvEXT 585 +#define _gloffset_SecondaryColor3fEXT 586 +#define _gloffset_SecondaryColor3fvEXT 587 +#define _gloffset_SecondaryColor3iEXT 588 +#define _gloffset_SecondaryColor3ivEXT 589 +#define _gloffset_SecondaryColor3sEXT 590 +#define _gloffset_SecondaryColor3svEXT 591 +#define _gloffset_SecondaryColor3ubEXT 592 +#define _gloffset_SecondaryColor3ubvEXT 593 +#define _gloffset_SecondaryColor3uiEXT 594 +#define _gloffset_SecondaryColor3uivEXT 595 +#define _gloffset_SecondaryColor3usEXT 596 +#define _gloffset_SecondaryColor3usvEXT 597 +#define _gloffset_SecondaryColorPointerEXT 598 +#define _gloffset_MultiDrawArraysEXT 599 +#define _gloffset_MultiDrawElementsEXT 600 +#define _gloffset_FogCoordPointerEXT 601 +#define _gloffset_FogCoorddEXT 602 +#define _gloffset_FogCoorddvEXT 603 +#define _gloffset_FogCoordfEXT 604 +#define _gloffset_FogCoordfvEXT 605 +#define _gloffset_PixelTexGenSGIX 606 +#define _gloffset_BlendFuncSeparateEXT 607 +#define _gloffset_FlushVertexArrayRangeNV 608 +#define _gloffset_VertexArrayRangeNV 609 +#define _gloffset_CombinerInputNV 610 +#define _gloffset_CombinerOutputNV 611 +#define _gloffset_CombinerParameterfNV 612 +#define _gloffset_CombinerParameterfvNV 613 +#define _gloffset_CombinerParameteriNV 614 +#define _gloffset_CombinerParameterivNV 615 +#define _gloffset_FinalCombinerInputNV 616 +#define _gloffset_GetCombinerInputParameterfvNV 617 +#define _gloffset_GetCombinerInputParameterivNV 618 +#define _gloffset_GetCombinerOutputParameterfvNV 619 +#define _gloffset_GetCombinerOutputParameterivNV 620 +#define _gloffset_GetFinalCombinerInputParameterfvNV 621 +#define _gloffset_GetFinalCombinerInputParameterivNV 622 +#define _gloffset_ResizeBuffersMESA 623 +#define _gloffset_WindowPos2dMESA 624 +#define _gloffset_WindowPos2dvMESA 625 +#define _gloffset_WindowPos2fMESA 626 +#define _gloffset_WindowPos2fvMESA 627 +#define _gloffset_WindowPos2iMESA 628 +#define _gloffset_WindowPos2ivMESA 629 +#define _gloffset_WindowPos2sMESA 630 +#define _gloffset_WindowPos2svMESA 631 +#define _gloffset_WindowPos3dMESA 632 +#define _gloffset_WindowPos3dvMESA 633 +#define _gloffset_WindowPos3fMESA 634 +#define _gloffset_WindowPos3fvMESA 635 +#define _gloffset_WindowPos3iMESA 636 +#define _gloffset_WindowPos3ivMESA 637 +#define _gloffset_WindowPos3sMESA 638 +#define _gloffset_WindowPos3svMESA 639 +#define _gloffset_WindowPos4dMESA 640 +#define _gloffset_WindowPos4dvMESA 641 +#define _gloffset_WindowPos4fMESA 642 +#define _gloffset_WindowPos4fvMESA 643 +#define _gloffset_WindowPos4iMESA 644 +#define _gloffset_WindowPos4ivMESA 645 +#define _gloffset_WindowPos4sMESA 646 +#define _gloffset_WindowPos4svMESA 647 +#define _gloffset_MultiModeDrawArraysIBM 648 +#define _gloffset_MultiModeDrawElementsIBM 649 +#define _gloffset_DeleteFencesNV 650 +#define _gloffset_FinishFenceNV 651 +#define _gloffset_GenFencesNV 652 +#define _gloffset_GetFenceivNV 653 +#define _gloffset_IsFenceNV 654 +#define _gloffset_SetFenceNV 655 +#define _gloffset_TestFenceNV 656 +#define _gloffset_AreProgramsResidentNV 657 +#define _gloffset_BindProgramNV 658 +#define _gloffset_DeleteProgramsNV 659 +#define _gloffset_ExecuteProgramNV 660 +#define _gloffset_GenProgramsNV 661 +#define _gloffset_GetProgramParameterdvNV 662 +#define _gloffset_GetProgramParameterfvNV 663 +#define _gloffset_GetProgramStringNV 664 +#define _gloffset_GetProgramivNV 665 +#define _gloffset_GetTrackMatrixivNV 666 +#define _gloffset_GetVertexAttribPointervNV 667 +#define _gloffset_GetVertexAttribdvNV 668 +#define _gloffset_GetVertexAttribfvNV 669 +#define _gloffset_GetVertexAttribivNV 670 +#define _gloffset_IsProgramNV 671 +#define _gloffset_LoadProgramNV 672 +#define _gloffset_ProgramParameter4dNV 673 +#define _gloffset_ProgramParameter4dvNV 674 +#define _gloffset_ProgramParameter4fNV 675 +#define _gloffset_ProgramParameter4fvNV 676 +#define _gloffset_ProgramParameters4dvNV 677 +#define _gloffset_ProgramParameters4fvNV 678 +#define _gloffset_RequestResidentProgramsNV 679 +#define _gloffset_TrackMatrixNV 680 +#define _gloffset_VertexAttrib1dNV 681 +#define _gloffset_VertexAttrib1dvNV 682 +#define _gloffset_VertexAttrib1fNV 683 +#define _gloffset_VertexAttrib1fvNV 684 +#define _gloffset_VertexAttrib1sNV 685 +#define _gloffset_VertexAttrib1svNV 686 +#define _gloffset_VertexAttrib2dNV 687 +#define _gloffset_VertexAttrib2dvNV 688 +#define _gloffset_VertexAttrib2fNV 689 +#define _gloffset_VertexAttrib2fvNV 690 +#define _gloffset_VertexAttrib2sNV 691 +#define _gloffset_VertexAttrib2svNV 692 +#define _gloffset_VertexAttrib3dNV 693 +#define _gloffset_VertexAttrib3dvNV 694 +#define _gloffset_VertexAttrib3fNV 695 +#define _gloffset_VertexAttrib3fvNV 696 +#define _gloffset_VertexAttrib3sNV 697 +#define _gloffset_VertexAttrib3svNV 698 +#define _gloffset_VertexAttrib4dNV 699 +#define _gloffset_VertexAttrib4dvNV 700 +#define _gloffset_VertexAttrib4fNV 701 +#define _gloffset_VertexAttrib4fvNV 702 +#define _gloffset_VertexAttrib4sNV 703 +#define _gloffset_VertexAttrib4svNV 704 +#define _gloffset_VertexAttrib4ubNV 705 +#define _gloffset_VertexAttrib4ubvNV 706 +#define _gloffset_VertexAttribPointerNV 707 +#define _gloffset_VertexAttribs1dvNV 708 +#define _gloffset_VertexAttribs1fvNV 709 +#define _gloffset_VertexAttribs1svNV 710 +#define _gloffset_VertexAttribs2dvNV 711 +#define _gloffset_VertexAttribs2fvNV 712 +#define _gloffset_VertexAttribs2svNV 713 +#define _gloffset_VertexAttribs3dvNV 714 +#define _gloffset_VertexAttribs3fvNV 715 +#define _gloffset_VertexAttribs3svNV 716 +#define _gloffset_VertexAttribs4dvNV 717 +#define _gloffset_VertexAttribs4fvNV 718 +#define _gloffset_VertexAttribs4svNV 719 +#define _gloffset_VertexAttribs4ubvNV 720 +#define _gloffset_AlphaFragmentOp1ATI 721 +#define _gloffset_AlphaFragmentOp2ATI 722 +#define _gloffset_AlphaFragmentOp3ATI 723 +#define _gloffset_BeginFragmentShaderATI 724 +#define _gloffset_BindFragmentShaderATI 725 +#define _gloffset_ColorFragmentOp1ATI 726 +#define _gloffset_ColorFragmentOp2ATI 727 +#define _gloffset_ColorFragmentOp3ATI 728 +#define _gloffset_DeleteFragmentShaderATI 729 +#define _gloffset_EndFragmentShaderATI 730 +#define _gloffset_GenFragmentShadersATI 731 +#define _gloffset_PassTexCoordATI 732 +#define _gloffset_SampleMapATI 733 +#define _gloffset_SetFragmentShaderConstantATI 734 +#define _gloffset_PointParameteriNV 735 +#define _gloffset_PointParameterivNV 736 +#define _gloffset_ActiveStencilFaceEXT 737 +#define _gloffset_BindVertexArrayAPPLE 738 +#define _gloffset_DeleteVertexArraysAPPLE 739 +#define _gloffset_GenVertexArraysAPPLE 740 +#define _gloffset_IsVertexArrayAPPLE 741 +#define _gloffset_GetProgramNamedParameterdvNV 742 +#define _gloffset_GetProgramNamedParameterfvNV 743 +#define _gloffset_ProgramNamedParameter4dNV 744 +#define _gloffset_ProgramNamedParameter4dvNV 745 +#define _gloffset_ProgramNamedParameter4fNV 746 +#define _gloffset_ProgramNamedParameter4fvNV 747 +#define _gloffset_DepthBoundsEXT 748 +#define _gloffset_BlendEquationSeparateEXT 749 +#define _gloffset_BindFramebufferEXT 750 +#define _gloffset_BindRenderbufferEXT 751 +#define _gloffset_CheckFramebufferStatusEXT 752 +#define _gloffset_DeleteFramebuffersEXT 753 +#define _gloffset_DeleteRenderbuffersEXT 754 +#define _gloffset_FramebufferRenderbufferEXT 755 +#define _gloffset_FramebufferTexture1DEXT 756 +#define _gloffset_FramebufferTexture2DEXT 757 +#define _gloffset_FramebufferTexture3DEXT 758 +#define _gloffset_GenFramebuffersEXT 759 +#define _gloffset_GenRenderbuffersEXT 760 +#define _gloffset_GenerateMipmapEXT 761 +#define _gloffset_GetFramebufferAttachmentParameterivEXT 762 +#define _gloffset_GetRenderbufferParameterivEXT 763 +#define _gloffset_IsFramebufferEXT 764 +#define _gloffset_IsRenderbufferEXT 765 +#define _gloffset_RenderbufferStorageEXT 766 +#define _gloffset_BlitFramebufferEXT 767 +#define _gloffset_ProgramEnvParameters4fvEXT 768 +#define _gloffset_ProgramLocalParameters4fvEXT 769 +#define _gloffset_GetQueryObjecti64vEXT 770 +#define _gloffset_GetQueryObjectui64vEXT 771 +#define _gloffset_FIRST_DYNAMIC 772 #else +#define _gloffset_AttachShader driDispatchRemapTable[AttachShader_remap_index] +#define _gloffset_CreateProgram driDispatchRemapTable[CreateProgram_remap_index] +#define _gloffset_CreateShader driDispatchRemapTable[CreateShader_remap_index] +#define _gloffset_DeleteProgram driDispatchRemapTable[DeleteProgram_remap_index] +#define _gloffset_DeleteShader driDispatchRemapTable[DeleteShader_remap_index] +#define _gloffset_DetachShader driDispatchRemapTable[DetachShader_remap_index] +#define _gloffset_GetAttachedShaders driDispatchRemapTable[GetAttachedShaders_remap_index] +#define _gloffset_GetProgramInfoLog driDispatchRemapTable[GetProgramInfoLog_remap_index] +#define _gloffset_GetProgramiv driDispatchRemapTable[GetProgramiv_remap_index] +#define _gloffset_GetShaderInfoLog driDispatchRemapTable[GetShaderInfoLog_remap_index] +#define _gloffset_GetShaderiv driDispatchRemapTable[GetShaderiv_remap_index] +#define _gloffset_IsProgram driDispatchRemapTable[IsProgram_remap_index] +#define _gloffset_IsShader driDispatchRemapTable[IsShader_remap_index] #define _gloffset_StencilFuncSeparate driDispatchRemapTable[StencilFuncSeparate_remap_index] #define _gloffset_StencilMaskSeparate driDispatchRemapTable[StencilMaskSeparate_remap_index] #define _gloffset_StencilOpSeparate driDispatchRemapTable[StencilOpSeparate_remap_index] +#define _gloffset_UniformMatrix2x3fv driDispatchRemapTable[UniformMatrix2x3fv_remap_index] +#define _gloffset_UniformMatrix2x4fv driDispatchRemapTable[UniformMatrix2x4fv_remap_index] +#define _gloffset_UniformMatrix3x2fv driDispatchRemapTable[UniformMatrix3x2fv_remap_index] +#define _gloffset_UniformMatrix3x4fv driDispatchRemapTable[UniformMatrix3x4fv_remap_index] +#define _gloffset_UniformMatrix4x2fv driDispatchRemapTable[UniformMatrix4x2fv_remap_index] +#define _gloffset_UniformMatrix4x3fv driDispatchRemapTable[UniformMatrix4x3fv_remap_index] #define _gloffset_LoadTransposeMatrixdARB driDispatchRemapTable[LoadTransposeMatrixdARB_remap_index] #define _gloffset_LoadTransposeMatrixfARB driDispatchRemapTable[LoadTransposeMatrixfARB_remap_index] #define _gloffset_MultTransposeMatrixdARB driDispatchRemapTable[MultTransposeMatrixdARB_remap_index] @@ -940,28 +962,12 @@ #define _gloffset_GetAttribLocationARB driDispatchRemapTable[GetAttribLocationARB_remap_index] #define _gloffset_DrawBuffersARB driDispatchRemapTable[DrawBuffersARB_remap_index] #define _gloffset_PolygonOffsetEXT driDispatchRemapTable[PolygonOffsetEXT_remap_index] -#define _gloffset_GetHistogramEXT driDispatchRemapTable[GetHistogramEXT_remap_index] -#define _gloffset_GetHistogramParameterfvEXT driDispatchRemapTable[GetHistogramParameterfvEXT_remap_index] -#define _gloffset_GetHistogramParameterivEXT driDispatchRemapTable[GetHistogramParameterivEXT_remap_index] -#define _gloffset_GetMinmaxEXT driDispatchRemapTable[GetMinmaxEXT_remap_index] -#define _gloffset_GetMinmaxParameterfvEXT driDispatchRemapTable[GetMinmaxParameterfvEXT_remap_index] -#define _gloffset_GetMinmaxParameterivEXT driDispatchRemapTable[GetMinmaxParameterivEXT_remap_index] -#define _gloffset_GetConvolutionFilterEXT driDispatchRemapTable[GetConvolutionFilterEXT_remap_index] -#define _gloffset_GetConvolutionParameterfvEXT driDispatchRemapTable[GetConvolutionParameterfvEXT_remap_index] -#define _gloffset_GetConvolutionParameterivEXT driDispatchRemapTable[GetConvolutionParameterivEXT_remap_index] -#define _gloffset_GetSeparableFilterEXT driDispatchRemapTable[GetSeparableFilterEXT_remap_index] -#define _gloffset_GetColorTableParameterfvSGI driDispatchRemapTable[GetColorTableParameterfvSGI_remap_index] -#define _gloffset_GetColorTableParameterivSGI driDispatchRemapTable[GetColorTableParameterivSGI_remap_index] -#define _gloffset_GetColorTableSGI driDispatchRemapTable[GetColorTableSGI_remap_index] #define _gloffset_GetPixelTexGenParameterfvSGIS driDispatchRemapTable[GetPixelTexGenParameterfvSGIS_remap_index] #define _gloffset_GetPixelTexGenParameterivSGIS driDispatchRemapTable[GetPixelTexGenParameterivSGIS_remap_index] #define _gloffset_PixelTexGenParameterfSGIS driDispatchRemapTable[PixelTexGenParameterfSGIS_remap_index] #define _gloffset_PixelTexGenParameterfvSGIS driDispatchRemapTable[PixelTexGenParameterfvSGIS_remap_index] #define _gloffset_PixelTexGenParameteriSGIS driDispatchRemapTable[PixelTexGenParameteriSGIS_remap_index] #define _gloffset_PixelTexGenParameterivSGIS driDispatchRemapTable[PixelTexGenParameterivSGIS_remap_index] -#define _gloffset_AreTexturesResidentEXT driDispatchRemapTable[AreTexturesResidentEXT_remap_index] -#define _gloffset_GenTexturesEXT driDispatchRemapTable[GenTexturesEXT_remap_index] -#define _gloffset_IsTextureEXT driDispatchRemapTable[IsTextureEXT_remap_index] #define _gloffset_SampleMaskSGIS driDispatchRemapTable[SampleMaskSGIS_remap_index] #define _gloffset_SamplePatternSGIS driDispatchRemapTable[SamplePatternSGIS_remap_index] #define _gloffset_ColorPointerEXT driDispatchRemapTable[ColorPointerEXT_remap_index] @@ -1157,8 +1163,6 @@ #define _gloffset_GenRenderbuffersEXT driDispatchRemapTable[GenRenderbuffersEXT_remap_index] #define _gloffset_GenerateMipmapEXT driDispatchRemapTable[GenerateMipmapEXT_remap_index] #define _gloffset_GetFramebufferAttachmentParameterivEXT driDispatchRemapTable[GetFramebufferAttachmentParameterivEXT_remap_index] -#define _gloffset_GetQueryObjecti64vEXT driDispatchRemapTable[GetQueryObjecti64vEXT_remap_index] -#define _gloffset_GetQueryObjectui64vEXT driDispatchRemapTable[GetQueryObjectui64vEXT_remap_index] #define _gloffset_GetRenderbufferParameterivEXT driDispatchRemapTable[GetRenderbufferParameterivEXT_remap_index] #define _gloffset_IsFramebufferEXT driDispatchRemapTable[IsFramebufferEXT_remap_index] #define _gloffset_IsRenderbufferEXT driDispatchRemapTable[IsRenderbufferEXT_remap_index] @@ -1166,6 +1170,8 @@ #define _gloffset_BlitFramebufferEXT driDispatchRemapTable[BlitFramebufferEXT_remap_index] #define _gloffset_ProgramEnvParameters4fvEXT driDispatchRemapTable[ProgramEnvParameters4fvEXT_remap_index] #define _gloffset_ProgramLocalParameters4fvEXT driDispatchRemapTable[ProgramLocalParameters4fvEXT_remap_index] +#define _gloffset_GetQueryObjecti64vEXT driDispatchRemapTable[GetQueryObjecti64vEXT_remap_index] +#define _gloffset_GetQueryObjectui64vEXT driDispatchRemapTable[GetQueryObjectui64vEXT_remap_index] #endif /* !defined(IN_DRI_DRIVER) */ diff --git a/src/mesa/glapi/glapitable.h b/src/mesa/glapi/glapitable.h index e4b36958896..026af32af8f 100644 --- a/src/mesa/glapi/glapitable.h +++ b/src/mesa/glapi/glapitable.h @@ -445,367 +445,370 @@ struct _glapi_table void (GLAPIENTRYP MultiTexCoord4ivARB)(GLenum target, const GLint * v); /* 405 */ void (GLAPIENTRYP MultiTexCoord4sARB)(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); /* 406 */ void (GLAPIENTRYP MultiTexCoord4svARB)(GLenum target, const GLshort * v); /* 407 */ - void (GLAPIENTRYP StencilFuncSeparate)(GLenum face, GLenum func, GLint ref, GLuint mask); /* 408 */ - void (GLAPIENTRYP StencilMaskSeparate)(GLenum face, GLuint mask); /* 409 */ - void (GLAPIENTRYP StencilOpSeparate)(GLenum face, GLenum fail, GLenum zfail, GLenum zpass); /* 410 */ - void (GLAPIENTRYP LoadTransposeMatrixdARB)(const GLdouble * m); /* 411 */ - void (GLAPIENTRYP LoadTransposeMatrixfARB)(const GLfloat * m); /* 412 */ - void (GLAPIENTRYP MultTransposeMatrixdARB)(const GLdouble * m); /* 413 */ - void (GLAPIENTRYP MultTransposeMatrixfARB)(const GLfloat * m); /* 414 */ - void (GLAPIENTRYP SampleCoverageARB)(GLclampf value, GLboolean invert); /* 415 */ - void (GLAPIENTRYP CompressedTexImage1DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid * data); /* 416 */ - void (GLAPIENTRYP CompressedTexImage2DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid * data); /* 417 */ - void (GLAPIENTRYP CompressedTexImage3DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid * data); /* 418 */ - void (GLAPIENTRYP CompressedTexSubImage1DARB)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid * data); /* 419 */ - void (GLAPIENTRYP CompressedTexSubImage2DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid * data); /* 420 */ - void (GLAPIENTRYP CompressedTexSubImage3DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid * data); /* 421 */ - void (GLAPIENTRYP GetCompressedTexImageARB)(GLenum target, GLint level, GLvoid * img); /* 422 */ - void (GLAPIENTRYP DisableVertexAttribArrayARB)(GLuint index); /* 423 */ - void (GLAPIENTRYP EnableVertexAttribArrayARB)(GLuint index); /* 424 */ - void (GLAPIENTRYP GetProgramEnvParameterdvARB)(GLenum target, GLuint index, GLdouble * params); /* 425 */ - void (GLAPIENTRYP GetProgramEnvParameterfvARB)(GLenum target, GLuint index, GLfloat * params); /* 426 */ - void (GLAPIENTRYP GetProgramLocalParameterdvARB)(GLenum target, GLuint index, GLdouble * params); /* 427 */ - void (GLAPIENTRYP GetProgramLocalParameterfvARB)(GLenum target, GLuint index, GLfloat * params); /* 428 */ - void (GLAPIENTRYP GetProgramStringARB)(GLenum target, GLenum pname, GLvoid * string); /* 429 */ - void (GLAPIENTRYP GetProgramivARB)(GLenum target, GLenum pname, GLint * params); /* 430 */ - void (GLAPIENTRYP GetVertexAttribdvARB)(GLuint index, GLenum pname, GLdouble * params); /* 431 */ - void (GLAPIENTRYP GetVertexAttribfvARB)(GLuint index, GLenum pname, GLfloat * params); /* 432 */ - void (GLAPIENTRYP GetVertexAttribivARB)(GLuint index, GLenum pname, GLint * params); /* 433 */ - void (GLAPIENTRYP ProgramEnvParameter4dARB)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 434 */ - void (GLAPIENTRYP ProgramEnvParameter4dvARB)(GLenum target, GLuint index, const GLdouble * params); /* 435 */ - void (GLAPIENTRYP ProgramEnvParameter4fARB)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 436 */ - void (GLAPIENTRYP ProgramEnvParameter4fvARB)(GLenum target, GLuint index, const GLfloat * params); /* 437 */ - void (GLAPIENTRYP ProgramLocalParameter4dARB)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 438 */ - void (GLAPIENTRYP ProgramLocalParameter4dvARB)(GLenum target, GLuint index, const GLdouble * params); /* 439 */ - void (GLAPIENTRYP ProgramLocalParameter4fARB)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 440 */ - void (GLAPIENTRYP ProgramLocalParameter4fvARB)(GLenum target, GLuint index, const GLfloat * params); /* 441 */ - void (GLAPIENTRYP ProgramStringARB)(GLenum target, GLenum format, GLsizei len, const GLvoid * string); /* 442 */ - void (GLAPIENTRYP VertexAttrib1dARB)(GLuint index, GLdouble x); /* 443 */ - void (GLAPIENTRYP VertexAttrib1dvARB)(GLuint index, const GLdouble * v); /* 444 */ - void (GLAPIENTRYP VertexAttrib1fARB)(GLuint index, GLfloat x); /* 445 */ - void (GLAPIENTRYP VertexAttrib1fvARB)(GLuint index, const GLfloat * v); /* 446 */ - void (GLAPIENTRYP VertexAttrib1sARB)(GLuint index, GLshort x); /* 447 */ - void (GLAPIENTRYP VertexAttrib1svARB)(GLuint index, const GLshort * v); /* 448 */ - void (GLAPIENTRYP VertexAttrib2dARB)(GLuint index, GLdouble x, GLdouble y); /* 449 */ - void (GLAPIENTRYP VertexAttrib2dvARB)(GLuint index, const GLdouble * v); /* 450 */ - void (GLAPIENTRYP VertexAttrib2fARB)(GLuint index, GLfloat x, GLfloat y); /* 451 */ - void (GLAPIENTRYP VertexAttrib2fvARB)(GLuint index, const GLfloat * v); /* 452 */ - void (GLAPIENTRYP VertexAttrib2sARB)(GLuint index, GLshort x, GLshort y); /* 453 */ - void (GLAPIENTRYP VertexAttrib2svARB)(GLuint index, const GLshort * v); /* 454 */ - void (GLAPIENTRYP VertexAttrib3dARB)(GLuint index, GLdouble x, GLdouble y, GLdouble z); /* 455 */ - void (GLAPIENTRYP VertexAttrib3dvARB)(GLuint index, const GLdouble * v); /* 456 */ - void (GLAPIENTRYP VertexAttrib3fARB)(GLuint index, GLfloat x, GLfloat y, GLfloat z); /* 457 */ - void (GLAPIENTRYP VertexAttrib3fvARB)(GLuint index, const GLfloat * v); /* 458 */ - void (GLAPIENTRYP VertexAttrib3sARB)(GLuint index, GLshort x, GLshort y, GLshort z); /* 459 */ - void (GLAPIENTRYP VertexAttrib3svARB)(GLuint index, const GLshort * v); /* 460 */ - void (GLAPIENTRYP VertexAttrib4NbvARB)(GLuint index, const GLbyte * v); /* 461 */ - void (GLAPIENTRYP VertexAttrib4NivARB)(GLuint index, const GLint * v); /* 462 */ - void (GLAPIENTRYP VertexAttrib4NsvARB)(GLuint index, const GLshort * v); /* 463 */ - void (GLAPIENTRYP VertexAttrib4NubARB)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); /* 464 */ - void (GLAPIENTRYP VertexAttrib4NubvARB)(GLuint index, const GLubyte * v); /* 465 */ - void (GLAPIENTRYP VertexAttrib4NuivARB)(GLuint index, const GLuint * v); /* 466 */ - void (GLAPIENTRYP VertexAttrib4NusvARB)(GLuint index, const GLushort * v); /* 467 */ - void (GLAPIENTRYP VertexAttrib4bvARB)(GLuint index, const GLbyte * v); /* 468 */ - void (GLAPIENTRYP VertexAttrib4dARB)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 469 */ - void (GLAPIENTRYP VertexAttrib4dvARB)(GLuint index, const GLdouble * v); /* 470 */ - void (GLAPIENTRYP VertexAttrib4fARB)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 471 */ - void (GLAPIENTRYP VertexAttrib4fvARB)(GLuint index, const GLfloat * v); /* 472 */ - void (GLAPIENTRYP VertexAttrib4ivARB)(GLuint index, const GLint * v); /* 473 */ - void (GLAPIENTRYP VertexAttrib4sARB)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); /* 474 */ - void (GLAPIENTRYP VertexAttrib4svARB)(GLuint index, const GLshort * v); /* 475 */ - void (GLAPIENTRYP VertexAttrib4ubvARB)(GLuint index, const GLubyte * v); /* 476 */ - void (GLAPIENTRYP VertexAttrib4uivARB)(GLuint index, const GLuint * v); /* 477 */ - void (GLAPIENTRYP VertexAttrib4usvARB)(GLuint index, const GLushort * v); /* 478 */ - void (GLAPIENTRYP VertexAttribPointerARB)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid * pointer); /* 479 */ - void (GLAPIENTRYP BindBufferARB)(GLenum target, GLuint buffer); /* 480 */ - void (GLAPIENTRYP BufferDataARB)(GLenum target, GLsizeiptrARB size, const GLvoid * data, GLenum usage); /* 481 */ - void (GLAPIENTRYP BufferSubDataARB)(GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid * data); /* 482 */ - void (GLAPIENTRYP DeleteBuffersARB)(GLsizei n, const GLuint * buffer); /* 483 */ - void (GLAPIENTRYP GenBuffersARB)(GLsizei n, GLuint * buffer); /* 484 */ - void (GLAPIENTRYP GetBufferParameterivARB)(GLenum target, GLenum pname, GLint * params); /* 485 */ - void (GLAPIENTRYP GetBufferPointervARB)(GLenum target, GLenum pname, GLvoid ** params); /* 486 */ - void (GLAPIENTRYP GetBufferSubDataARB)(GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid * data); /* 487 */ - GLboolean (GLAPIENTRYP IsBufferARB)(GLuint buffer); /* 488 */ - GLvoid * (GLAPIENTRYP MapBufferARB)(GLenum target, GLenum access); /* 489 */ - GLboolean (GLAPIENTRYP UnmapBufferARB)(GLenum target); /* 490 */ - void (GLAPIENTRYP BeginQueryARB)(GLenum target, GLuint id); /* 491 */ - void (GLAPIENTRYP DeleteQueriesARB)(GLsizei n, const GLuint * ids); /* 492 */ - void (GLAPIENTRYP EndQueryARB)(GLenum target); /* 493 */ - void (GLAPIENTRYP GenQueriesARB)(GLsizei n, GLuint * ids); /* 494 */ - void (GLAPIENTRYP GetQueryObjectivARB)(GLuint id, GLenum pname, GLint * params); /* 495 */ - void (GLAPIENTRYP GetQueryObjectuivARB)(GLuint id, GLenum pname, GLuint * params); /* 496 */ - void (GLAPIENTRYP GetQueryivARB)(GLenum target, GLenum pname, GLint * params); /* 497 */ - GLboolean (GLAPIENTRYP IsQueryARB)(GLuint id); /* 498 */ - void (GLAPIENTRYP AttachObjectARB)(GLhandleARB containerObj, GLhandleARB obj); /* 499 */ - void (GLAPIENTRYP CompileShaderARB)(GLhandleARB shaderObj); /* 500 */ - GLhandleARB (GLAPIENTRYP CreateProgramObjectARB)(void); /* 501 */ - GLhandleARB (GLAPIENTRYP CreateShaderObjectARB)(GLenum shaderType); /* 502 */ - void (GLAPIENTRYP DeleteObjectARB)(GLhandleARB obj); /* 503 */ - void (GLAPIENTRYP DetachObjectARB)(GLhandleARB containerObj, GLhandleARB attachedObj); /* 504 */ - void (GLAPIENTRYP GetActiveUniformARB)(GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei * length, GLint * size, GLenum * type, GLcharARB * name); /* 505 */ - void (GLAPIENTRYP GetAttachedObjectsARB)(GLhandleARB containerObj, GLsizei maxLength, GLsizei * length, GLhandleARB * infoLog); /* 506 */ - GLhandleARB (GLAPIENTRYP GetHandleARB)(GLenum pname); /* 507 */ - void (GLAPIENTRYP GetInfoLogARB)(GLhandleARB obj, GLsizei maxLength, GLsizei * length, GLcharARB * infoLog); /* 508 */ - void (GLAPIENTRYP GetObjectParameterfvARB)(GLhandleARB obj, GLenum pname, GLfloat * params); /* 509 */ - void (GLAPIENTRYP GetObjectParameterivARB)(GLhandleARB obj, GLenum pname, GLint * params); /* 510 */ - void (GLAPIENTRYP GetShaderSourceARB)(GLhandleARB obj, GLsizei maxLength, GLsizei * length, GLcharARB * source); /* 511 */ - GLint (GLAPIENTRYP GetUniformLocationARB)(GLhandleARB programObj, const GLcharARB * name); /* 512 */ - void (GLAPIENTRYP GetUniformfvARB)(GLhandleARB programObj, GLint location, GLfloat * params); /* 513 */ - void (GLAPIENTRYP GetUniformivARB)(GLhandleARB programObj, GLint location, GLint * params); /* 514 */ - void (GLAPIENTRYP LinkProgramARB)(GLhandleARB programObj); /* 515 */ - void (GLAPIENTRYP ShaderSourceARB)(GLhandleARB shaderObj, GLsizei count, const GLcharARB ** string, const GLint * length); /* 516 */ - void (GLAPIENTRYP Uniform1fARB)(GLint location, GLfloat v0); /* 517 */ - void (GLAPIENTRYP Uniform1fvARB)(GLint location, GLsizei count, const GLfloat * value); /* 518 */ - void (GLAPIENTRYP Uniform1iARB)(GLint location, GLint v0); /* 519 */ - void (GLAPIENTRYP Uniform1ivARB)(GLint location, GLsizei count, const GLint * value); /* 520 */ - void (GLAPIENTRYP Uniform2fARB)(GLint location, GLfloat v0, GLfloat v1); /* 521 */ - void (GLAPIENTRYP Uniform2fvARB)(GLint location, GLsizei count, const GLfloat * value); /* 522 */ - void (GLAPIENTRYP Uniform2iARB)(GLint location, GLint v0, GLint v1); /* 523 */ - void (GLAPIENTRYP Uniform2ivARB)(GLint location, GLsizei count, const GLint * value); /* 524 */ - void (GLAPIENTRYP Uniform3fARB)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2); /* 525 */ - void (GLAPIENTRYP Uniform3fvARB)(GLint location, GLsizei count, const GLfloat * value); /* 526 */ - void (GLAPIENTRYP Uniform3iARB)(GLint location, GLint v0, GLint v1, GLint v2); /* 527 */ - void (GLAPIENTRYP Uniform3ivARB)(GLint location, GLsizei count, const GLint * value); /* 528 */ - void (GLAPIENTRYP Uniform4fARB)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); /* 529 */ - void (GLAPIENTRYP Uniform4fvARB)(GLint location, GLsizei count, const GLfloat * value); /* 530 */ - void (GLAPIENTRYP Uniform4iARB)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3); /* 531 */ - void (GLAPIENTRYP Uniform4ivARB)(GLint location, GLsizei count, const GLint * value); /* 532 */ - void (GLAPIENTRYP UniformMatrix2fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 533 */ - void (GLAPIENTRYP UniformMatrix3fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 534 */ - void (GLAPIENTRYP UniformMatrix4fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 535 */ - void (GLAPIENTRYP UseProgramObjectARB)(GLhandleARB programObj); /* 536 */ - void (GLAPIENTRYP ValidateProgramARB)(GLhandleARB programObj); /* 537 */ - void (GLAPIENTRYP BindAttribLocationARB)(GLhandleARB programObj, GLuint index, const GLcharARB * name); /* 538 */ - void (GLAPIENTRYP GetActiveAttribARB)(GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei * length, GLint * size, GLenum * type, GLcharARB * name); /* 539 */ - GLint (GLAPIENTRYP GetAttribLocationARB)(GLhandleARB programObj, const GLcharARB * name); /* 540 */ - void (GLAPIENTRYP DrawBuffersARB)(GLsizei n, const GLenum * bufs); /* 541 */ - void (GLAPIENTRYP PolygonOffsetEXT)(GLfloat factor, GLfloat bias); /* 542 */ - void (GLAPIENTRYP GetHistogramEXT)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values); /* 543 */ - void (GLAPIENTRYP GetHistogramParameterfvEXT)(GLenum target, GLenum pname, GLfloat * params); /* 544 */ - void (GLAPIENTRYP GetHistogramParameterivEXT)(GLenum target, GLenum pname, GLint * params); /* 545 */ - void (GLAPIENTRYP GetMinmaxEXT)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values); /* 546 */ - void (GLAPIENTRYP GetMinmaxParameterfvEXT)(GLenum target, GLenum pname, GLfloat * params); /* 547 */ - void (GLAPIENTRYP GetMinmaxParameterivEXT)(GLenum target, GLenum pname, GLint * params); /* 548 */ - void (GLAPIENTRYP GetConvolutionFilterEXT)(GLenum target, GLenum format, GLenum type, GLvoid * image); /* 549 */ - void (GLAPIENTRYP GetConvolutionParameterfvEXT)(GLenum target, GLenum pname, GLfloat * params); /* 550 */ - void (GLAPIENTRYP GetConvolutionParameterivEXT)(GLenum target, GLenum pname, GLint * params); /* 551 */ - void (GLAPIENTRYP GetSeparableFilterEXT)(GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span); /* 552 */ - void (GLAPIENTRYP GetColorTableParameterfvSGI)(GLenum target, GLenum pname, GLfloat * params); /* 553 */ - void (GLAPIENTRYP GetColorTableParameterivSGI)(GLenum target, GLenum pname, GLint * params); /* 554 */ - void (GLAPIENTRYP GetColorTableSGI)(GLenum target, GLenum format, GLenum type, GLvoid * table); /* 555 */ - void (GLAPIENTRYP GetPixelTexGenParameterfvSGIS)(GLenum pname, GLfloat * params); /* 556 */ - void (GLAPIENTRYP GetPixelTexGenParameterivSGIS)(GLenum pname, GLint * params); /* 557 */ - void (GLAPIENTRYP PixelTexGenParameterfSGIS)(GLenum pname, GLfloat param); /* 558 */ - void (GLAPIENTRYP PixelTexGenParameterfvSGIS)(GLenum pname, const GLfloat * params); /* 559 */ - void (GLAPIENTRYP PixelTexGenParameteriSGIS)(GLenum pname, GLint param); /* 560 */ - void (GLAPIENTRYP PixelTexGenParameterivSGIS)(GLenum pname, const GLint * params); /* 561 */ - GLboolean (GLAPIENTRYP AreTexturesResidentEXT)(GLsizei n, const GLuint * textures, GLboolean * residences); /* 562 */ - void (GLAPIENTRYP GenTexturesEXT)(GLsizei n, GLuint * textures); /* 563 */ - GLboolean (GLAPIENTRYP IsTextureEXT)(GLuint texture); /* 564 */ - void (GLAPIENTRYP SampleMaskSGIS)(GLclampf value, GLboolean invert); /* 565 */ - void (GLAPIENTRYP SamplePatternSGIS)(GLenum pattern); /* 566 */ - void (GLAPIENTRYP ColorPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 567 */ - void (GLAPIENTRYP EdgeFlagPointerEXT)(GLsizei stride, GLsizei count, const GLboolean * pointer); /* 568 */ - void (GLAPIENTRYP IndexPointerEXT)(GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 569 */ - void (GLAPIENTRYP NormalPointerEXT)(GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 570 */ - void (GLAPIENTRYP TexCoordPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 571 */ - void (GLAPIENTRYP VertexPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 572 */ - void (GLAPIENTRYP PointParameterfEXT)(GLenum pname, GLfloat param); /* 573 */ - void (GLAPIENTRYP PointParameterfvEXT)(GLenum pname, const GLfloat * params); /* 574 */ - void (GLAPIENTRYP LockArraysEXT)(GLint first, GLsizei count); /* 575 */ - void (GLAPIENTRYP UnlockArraysEXT)(void); /* 576 */ - void (GLAPIENTRYP CullParameterdvEXT)(GLenum pname, GLdouble * params); /* 577 */ - void (GLAPIENTRYP CullParameterfvEXT)(GLenum pname, GLfloat * params); /* 578 */ - void (GLAPIENTRYP SecondaryColor3bEXT)(GLbyte red, GLbyte green, GLbyte blue); /* 579 */ - void (GLAPIENTRYP SecondaryColor3bvEXT)(const GLbyte * v); /* 580 */ - void (GLAPIENTRYP SecondaryColor3dEXT)(GLdouble red, GLdouble green, GLdouble blue); /* 581 */ - void (GLAPIENTRYP SecondaryColor3dvEXT)(const GLdouble * v); /* 582 */ - void (GLAPIENTRYP SecondaryColor3fEXT)(GLfloat red, GLfloat green, GLfloat blue); /* 583 */ - void (GLAPIENTRYP SecondaryColor3fvEXT)(const GLfloat * v); /* 584 */ - void (GLAPIENTRYP SecondaryColor3iEXT)(GLint red, GLint green, GLint blue); /* 585 */ - void (GLAPIENTRYP SecondaryColor3ivEXT)(const GLint * v); /* 586 */ - void (GLAPIENTRYP SecondaryColor3sEXT)(GLshort red, GLshort green, GLshort blue); /* 587 */ - void (GLAPIENTRYP SecondaryColor3svEXT)(const GLshort * v); /* 588 */ - void (GLAPIENTRYP SecondaryColor3ubEXT)(GLubyte red, GLubyte green, GLubyte blue); /* 589 */ - void (GLAPIENTRYP SecondaryColor3ubvEXT)(const GLubyte * v); /* 590 */ - void (GLAPIENTRYP SecondaryColor3uiEXT)(GLuint red, GLuint green, GLuint blue); /* 591 */ - void (GLAPIENTRYP SecondaryColor3uivEXT)(const GLuint * v); /* 592 */ - void (GLAPIENTRYP SecondaryColor3usEXT)(GLushort red, GLushort green, GLushort blue); /* 593 */ - void (GLAPIENTRYP SecondaryColor3usvEXT)(const GLushort * v); /* 594 */ - void (GLAPIENTRYP SecondaryColorPointerEXT)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 595 */ - void (GLAPIENTRYP MultiDrawArraysEXT)(GLenum mode, GLint * first, GLsizei * count, GLsizei primcount); /* 596 */ - void (GLAPIENTRYP MultiDrawElementsEXT)(GLenum mode, const GLsizei * count, GLenum type, const GLvoid ** indices, GLsizei primcount); /* 597 */ - void (GLAPIENTRYP FogCoordPointerEXT)(GLenum type, GLsizei stride, const GLvoid * pointer); /* 598 */ - void (GLAPIENTRYP FogCoorddEXT)(GLdouble coord); /* 599 */ - void (GLAPIENTRYP FogCoorddvEXT)(const GLdouble * coord); /* 600 */ - void (GLAPIENTRYP FogCoordfEXT)(GLfloat coord); /* 601 */ - void (GLAPIENTRYP FogCoordfvEXT)(const GLfloat * coord); /* 602 */ - void (GLAPIENTRYP PixelTexGenSGIX)(GLenum mode); /* 603 */ - void (GLAPIENTRYP BlendFuncSeparateEXT)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); /* 604 */ - void (GLAPIENTRYP FlushVertexArrayRangeNV)(void); /* 605 */ - void (GLAPIENTRYP VertexArrayRangeNV)(GLsizei length, const GLvoid * pointer); /* 606 */ - void (GLAPIENTRYP CombinerInputNV)(GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); /* 607 */ - void (GLAPIENTRYP CombinerOutputNV)(GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); /* 608 */ - void (GLAPIENTRYP CombinerParameterfNV)(GLenum pname, GLfloat param); /* 609 */ - void (GLAPIENTRYP CombinerParameterfvNV)(GLenum pname, const GLfloat * params); /* 610 */ - void (GLAPIENTRYP CombinerParameteriNV)(GLenum pname, GLint param); /* 611 */ - void (GLAPIENTRYP CombinerParameterivNV)(GLenum pname, const GLint * params); /* 612 */ - void (GLAPIENTRYP FinalCombinerInputNV)(GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); /* 613 */ - void (GLAPIENTRYP GetCombinerInputParameterfvNV)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat * params); /* 614 */ - void (GLAPIENTRYP GetCombinerInputParameterivNV)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint * params); /* 615 */ - void (GLAPIENTRYP GetCombinerOutputParameterfvNV)(GLenum stage, GLenum portion, GLenum pname, GLfloat * params); /* 616 */ - void (GLAPIENTRYP GetCombinerOutputParameterivNV)(GLenum stage, GLenum portion, GLenum pname, GLint * params); /* 617 */ - void (GLAPIENTRYP GetFinalCombinerInputParameterfvNV)(GLenum variable, GLenum pname, GLfloat * params); /* 618 */ - void (GLAPIENTRYP GetFinalCombinerInputParameterivNV)(GLenum variable, GLenum pname, GLint * params); /* 619 */ - void (GLAPIENTRYP ResizeBuffersMESA)(void); /* 620 */ - void (GLAPIENTRYP WindowPos2dMESA)(GLdouble x, GLdouble y); /* 621 */ - void (GLAPIENTRYP WindowPos2dvMESA)(const GLdouble * v); /* 622 */ - void (GLAPIENTRYP WindowPos2fMESA)(GLfloat x, GLfloat y); /* 623 */ - void (GLAPIENTRYP WindowPos2fvMESA)(const GLfloat * v); /* 624 */ - void (GLAPIENTRYP WindowPos2iMESA)(GLint x, GLint y); /* 625 */ - void (GLAPIENTRYP WindowPos2ivMESA)(const GLint * v); /* 626 */ - void (GLAPIENTRYP WindowPos2sMESA)(GLshort x, GLshort y); /* 627 */ - void (GLAPIENTRYP WindowPos2svMESA)(const GLshort * v); /* 628 */ - void (GLAPIENTRYP WindowPos3dMESA)(GLdouble x, GLdouble y, GLdouble z); /* 629 */ - void (GLAPIENTRYP WindowPos3dvMESA)(const GLdouble * v); /* 630 */ - void (GLAPIENTRYP WindowPos3fMESA)(GLfloat x, GLfloat y, GLfloat z); /* 631 */ - void (GLAPIENTRYP WindowPos3fvMESA)(const GLfloat * v); /* 632 */ - void (GLAPIENTRYP WindowPos3iMESA)(GLint x, GLint y, GLint z); /* 633 */ - void (GLAPIENTRYP WindowPos3ivMESA)(const GLint * v); /* 634 */ - void (GLAPIENTRYP WindowPos3sMESA)(GLshort x, GLshort y, GLshort z); /* 635 */ - void (GLAPIENTRYP WindowPos3svMESA)(const GLshort * v); /* 636 */ - void (GLAPIENTRYP WindowPos4dMESA)(GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 637 */ - void (GLAPIENTRYP WindowPos4dvMESA)(const GLdouble * v); /* 638 */ - void (GLAPIENTRYP WindowPos4fMESA)(GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 639 */ - void (GLAPIENTRYP WindowPos4fvMESA)(const GLfloat * v); /* 640 */ - void (GLAPIENTRYP WindowPos4iMESA)(GLint x, GLint y, GLint z, GLint w); /* 641 */ - void (GLAPIENTRYP WindowPos4ivMESA)(const GLint * v); /* 642 */ - void (GLAPIENTRYP WindowPos4sMESA)(GLshort x, GLshort y, GLshort z, GLshort w); /* 643 */ - void (GLAPIENTRYP WindowPos4svMESA)(const GLshort * v); /* 644 */ - void (GLAPIENTRYP MultiModeDrawArraysIBM)(const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride); /* 645 */ - void (GLAPIENTRYP MultiModeDrawElementsIBM)(const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount, GLint modestride); /* 646 */ - void (GLAPIENTRYP DeleteFencesNV)(GLsizei n, const GLuint * fences); /* 647 */ - void (GLAPIENTRYP FinishFenceNV)(GLuint fence); /* 648 */ - void (GLAPIENTRYP GenFencesNV)(GLsizei n, GLuint * fences); /* 649 */ - void (GLAPIENTRYP GetFenceivNV)(GLuint fence, GLenum pname, GLint * params); /* 650 */ - GLboolean (GLAPIENTRYP IsFenceNV)(GLuint fence); /* 651 */ - void (GLAPIENTRYP SetFenceNV)(GLuint fence, GLenum condition); /* 652 */ - GLboolean (GLAPIENTRYP TestFenceNV)(GLuint fence); /* 653 */ - GLboolean (GLAPIENTRYP AreProgramsResidentNV)(GLsizei n, const GLuint * ids, GLboolean * residences); /* 654 */ - void (GLAPIENTRYP BindProgramNV)(GLenum target, GLuint program); /* 655 */ - void (GLAPIENTRYP DeleteProgramsNV)(GLsizei n, const GLuint * programs); /* 656 */ - void (GLAPIENTRYP ExecuteProgramNV)(GLenum target, GLuint id, const GLfloat * params); /* 657 */ - void (GLAPIENTRYP GenProgramsNV)(GLsizei n, GLuint * programs); /* 658 */ - void (GLAPIENTRYP GetProgramParameterdvNV)(GLenum target, GLuint index, GLenum pname, GLdouble * params); /* 659 */ - void (GLAPIENTRYP GetProgramParameterfvNV)(GLenum target, GLuint index, GLenum pname, GLfloat * params); /* 660 */ - void (GLAPIENTRYP GetProgramStringNV)(GLuint id, GLenum pname, GLubyte * program); /* 661 */ - void (GLAPIENTRYP GetProgramivNV)(GLuint id, GLenum pname, GLint * params); /* 662 */ - void (GLAPIENTRYP GetTrackMatrixivNV)(GLenum target, GLuint address, GLenum pname, GLint * params); /* 663 */ - void (GLAPIENTRYP GetVertexAttribPointervNV)(GLuint index, GLenum pname, GLvoid ** params); /* 664 */ - void (GLAPIENTRYP GetVertexAttribdvNV)(GLuint index, GLenum pname, GLdouble * params); /* 665 */ - void (GLAPIENTRYP GetVertexAttribfvNV)(GLuint index, GLenum pname, GLfloat * params); /* 666 */ - void (GLAPIENTRYP GetVertexAttribivNV)(GLuint index, GLenum pname, GLint * params); /* 667 */ - GLboolean (GLAPIENTRYP IsProgramNV)(GLuint program); /* 668 */ - void (GLAPIENTRYP LoadProgramNV)(GLenum target, GLuint id, GLsizei len, const GLubyte * program); /* 669 */ - void (GLAPIENTRYP ProgramParameter4dNV)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 670 */ - void (GLAPIENTRYP ProgramParameter4dvNV)(GLenum target, GLuint index, const GLdouble * params); /* 671 */ - void (GLAPIENTRYP ProgramParameter4fNV)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 672 */ - void (GLAPIENTRYP ProgramParameter4fvNV)(GLenum target, GLuint index, const GLfloat * params); /* 673 */ - void (GLAPIENTRYP ProgramParameters4dvNV)(GLenum target, GLuint index, GLuint num, const GLdouble * params); /* 674 */ - void (GLAPIENTRYP ProgramParameters4fvNV)(GLenum target, GLuint index, GLuint num, const GLfloat * params); /* 675 */ - void (GLAPIENTRYP RequestResidentProgramsNV)(GLsizei n, const GLuint * ids); /* 676 */ - void (GLAPIENTRYP TrackMatrixNV)(GLenum target, GLuint address, GLenum matrix, GLenum transform); /* 677 */ - void (GLAPIENTRYP VertexAttrib1dNV)(GLuint index, GLdouble x); /* 678 */ - void (GLAPIENTRYP VertexAttrib1dvNV)(GLuint index, const GLdouble * v); /* 679 */ - void (GLAPIENTRYP VertexAttrib1fNV)(GLuint index, GLfloat x); /* 680 */ - void (GLAPIENTRYP VertexAttrib1fvNV)(GLuint index, const GLfloat * v); /* 681 */ - void (GLAPIENTRYP VertexAttrib1sNV)(GLuint index, GLshort x); /* 682 */ - void (GLAPIENTRYP VertexAttrib1svNV)(GLuint index, const GLshort * v); /* 683 */ - void (GLAPIENTRYP VertexAttrib2dNV)(GLuint index, GLdouble x, GLdouble y); /* 684 */ - void (GLAPIENTRYP VertexAttrib2dvNV)(GLuint index, const GLdouble * v); /* 685 */ - void (GLAPIENTRYP VertexAttrib2fNV)(GLuint index, GLfloat x, GLfloat y); /* 686 */ - void (GLAPIENTRYP VertexAttrib2fvNV)(GLuint index, const GLfloat * v); /* 687 */ - void (GLAPIENTRYP VertexAttrib2sNV)(GLuint index, GLshort x, GLshort y); /* 688 */ - void (GLAPIENTRYP VertexAttrib2svNV)(GLuint index, const GLshort * v); /* 689 */ - void (GLAPIENTRYP VertexAttrib3dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z); /* 690 */ - void (GLAPIENTRYP VertexAttrib3dvNV)(GLuint index, const GLdouble * v); /* 691 */ - void (GLAPIENTRYP VertexAttrib3fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z); /* 692 */ - void (GLAPIENTRYP VertexAttrib3fvNV)(GLuint index, const GLfloat * v); /* 693 */ - void (GLAPIENTRYP VertexAttrib3sNV)(GLuint index, GLshort x, GLshort y, GLshort z); /* 694 */ - void (GLAPIENTRYP VertexAttrib3svNV)(GLuint index, const GLshort * v); /* 695 */ - void (GLAPIENTRYP VertexAttrib4dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 696 */ - void (GLAPIENTRYP VertexAttrib4dvNV)(GLuint index, const GLdouble * v); /* 697 */ - void (GLAPIENTRYP VertexAttrib4fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 698 */ - void (GLAPIENTRYP VertexAttrib4fvNV)(GLuint index, const GLfloat * v); /* 699 */ - void (GLAPIENTRYP VertexAttrib4sNV)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); /* 700 */ - void (GLAPIENTRYP VertexAttrib4svNV)(GLuint index, const GLshort * v); /* 701 */ - void (GLAPIENTRYP VertexAttrib4ubNV)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); /* 702 */ - void (GLAPIENTRYP VertexAttrib4ubvNV)(GLuint index, const GLubyte * v); /* 703 */ - void (GLAPIENTRYP VertexAttribPointerNV)(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 704 */ - void (GLAPIENTRYP VertexAttribs1dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 705 */ - void (GLAPIENTRYP VertexAttribs1fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 706 */ - void (GLAPIENTRYP VertexAttribs1svNV)(GLuint index, GLsizei n, const GLshort * v); /* 707 */ - void (GLAPIENTRYP VertexAttribs2dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 708 */ - void (GLAPIENTRYP VertexAttribs2fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 709 */ - void (GLAPIENTRYP VertexAttribs2svNV)(GLuint index, GLsizei n, const GLshort * v); /* 710 */ - void (GLAPIENTRYP VertexAttribs3dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 711 */ - void (GLAPIENTRYP VertexAttribs3fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 712 */ - void (GLAPIENTRYP VertexAttribs3svNV)(GLuint index, GLsizei n, const GLshort * v); /* 713 */ - void (GLAPIENTRYP VertexAttribs4dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 714 */ - void (GLAPIENTRYP VertexAttribs4fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 715 */ - void (GLAPIENTRYP VertexAttribs4svNV)(GLuint index, GLsizei n, const GLshort * v); /* 716 */ - void (GLAPIENTRYP VertexAttribs4ubvNV)(GLuint index, GLsizei n, const GLubyte * v); /* 717 */ - void (GLAPIENTRYP AlphaFragmentOp1ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); /* 718 */ - void (GLAPIENTRYP AlphaFragmentOp2ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); /* 719 */ - void (GLAPIENTRYP AlphaFragmentOp3ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); /* 720 */ - void (GLAPIENTRYP BeginFragmentShaderATI)(void); /* 721 */ - void (GLAPIENTRYP BindFragmentShaderATI)(GLuint id); /* 722 */ - void (GLAPIENTRYP ColorFragmentOp1ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); /* 723 */ - void (GLAPIENTRYP ColorFragmentOp2ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); /* 724 */ - void (GLAPIENTRYP ColorFragmentOp3ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); /* 725 */ - void (GLAPIENTRYP DeleteFragmentShaderATI)(GLuint id); /* 726 */ - void (GLAPIENTRYP EndFragmentShaderATI)(void); /* 727 */ - GLuint (GLAPIENTRYP GenFragmentShadersATI)(GLuint range); /* 728 */ - void (GLAPIENTRYP PassTexCoordATI)(GLuint dst, GLuint coord, GLenum swizzle); /* 729 */ - void (GLAPIENTRYP SampleMapATI)(GLuint dst, GLuint interp, GLenum swizzle); /* 730 */ - void (GLAPIENTRYP SetFragmentShaderConstantATI)(GLuint dst, const GLfloat * value); /* 731 */ - void (GLAPIENTRYP PointParameteriNV)(GLenum pname, GLint param); /* 732 */ - void (GLAPIENTRYP PointParameterivNV)(GLenum pname, const GLint * params); /* 733 */ - void (GLAPIENTRYP ActiveStencilFaceEXT)(GLenum face); /* 734 */ - void (GLAPIENTRYP BindVertexArrayAPPLE)(GLuint array); /* 735 */ - void (GLAPIENTRYP DeleteVertexArraysAPPLE)(GLsizei n, const GLuint * arrays); /* 736 */ - void (GLAPIENTRYP GenVertexArraysAPPLE)(GLsizei n, GLuint * arrays); /* 737 */ - GLboolean (GLAPIENTRYP IsVertexArrayAPPLE)(GLuint array); /* 738 */ - void (GLAPIENTRYP GetProgramNamedParameterdvNV)(GLuint id, GLsizei len, const GLubyte * name, GLdouble * params); /* 739 */ - void (GLAPIENTRYP GetProgramNamedParameterfvNV)(GLuint id, GLsizei len, const GLubyte * name, GLfloat * params); /* 740 */ - void (GLAPIENTRYP ProgramNamedParameter4dNV)(GLuint id, GLsizei len, const GLubyte * name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 741 */ - void (GLAPIENTRYP ProgramNamedParameter4dvNV)(GLuint id, GLsizei len, const GLubyte * name, const GLdouble * v); /* 742 */ - void (GLAPIENTRYP ProgramNamedParameter4fNV)(GLuint id, GLsizei len, const GLubyte * name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 743 */ - void (GLAPIENTRYP ProgramNamedParameter4fvNV)(GLuint id, GLsizei len, const GLubyte * name, const GLfloat * v); /* 744 */ - void (GLAPIENTRYP DepthBoundsEXT)(GLclampd zmin, GLclampd zmax); /* 745 */ - void (GLAPIENTRYP BlendEquationSeparateEXT)(GLenum modeRGB, GLenum modeA); /* 746 */ - void (GLAPIENTRYP BindFramebufferEXT)(GLenum target, GLuint framebuffer); /* 747 */ - void (GLAPIENTRYP BindRenderbufferEXT)(GLenum target, GLuint renderbuffer); /* 748 */ - GLenum (GLAPIENTRYP CheckFramebufferStatusEXT)(GLenum target); /* 749 */ - void (GLAPIENTRYP DeleteFramebuffersEXT)(GLsizei n, const GLuint * framebuffers); /* 750 */ - void (GLAPIENTRYP DeleteRenderbuffersEXT)(GLsizei n, const GLuint * renderbuffers); /* 751 */ - void (GLAPIENTRYP FramebufferRenderbufferEXT)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); /* 752 */ - void (GLAPIENTRYP FramebufferTexture1DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); /* 753 */ - void (GLAPIENTRYP FramebufferTexture2DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); /* 754 */ - void (GLAPIENTRYP FramebufferTexture3DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); /* 755 */ - void (GLAPIENTRYP GenFramebuffersEXT)(GLsizei n, GLuint * framebuffers); /* 756 */ - void (GLAPIENTRYP GenRenderbuffersEXT)(GLsizei n, GLuint * renderbuffers); /* 757 */ - void (GLAPIENTRYP GenerateMipmapEXT)(GLenum target); /* 758 */ - void (GLAPIENTRYP GetFramebufferAttachmentParameterivEXT)(GLenum target, GLenum attachment, GLenum pname, GLint * params); /* 759 */ - void (GLAPIENTRYP GetQueryObjecti64vEXT)(GLuint id, GLenum pname, GLint64EXT * params); /* 760 */ - void (GLAPIENTRYP GetQueryObjectui64vEXT)(GLuint id, GLenum pname, GLuint64EXT * params); /* 761 */ - void (GLAPIENTRYP GetRenderbufferParameterivEXT)(GLenum target, GLenum pname, GLint * params); /* 762 */ - GLboolean (GLAPIENTRYP IsFramebufferEXT)(GLuint framebuffer); /* 763 */ - GLboolean (GLAPIENTRYP IsRenderbufferEXT)(GLuint renderbuffer); /* 764 */ - void (GLAPIENTRYP RenderbufferStorageEXT)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height); /* 765 */ - void (GLAPIENTRYP BlitFramebufferEXT)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); /* 766 */ - void (GLAPIENTRYP ProgramEnvParameters4fvEXT)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); /* 767 */ - void (GLAPIENTRYP ProgramLocalParameters4fvEXT)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); /* 768 */ + void (GLAPIENTRYP AttachShader)(GLuint program, GLuint shader); /* 408 */ + GLuint (GLAPIENTRYP CreateProgram)(void); /* 409 */ + GLuint (GLAPIENTRYP CreateShader)(GLenum type); /* 410 */ + void (GLAPIENTRYP DeleteProgram)(GLuint program); /* 411 */ + void (GLAPIENTRYP DeleteShader)(GLuint program); /* 412 */ + void (GLAPIENTRYP DetachShader)(GLuint program, GLuint shader); /* 413 */ + void (GLAPIENTRYP GetAttachedShaders)(GLuint program, GLsizei maxCount, GLsizei * count, GLuint * obj); /* 414 */ + void (GLAPIENTRYP GetProgramInfoLog)(GLuint program, GLsizei bufSize, GLsizei * length, GLchar * infoLog); /* 415 */ + void (GLAPIENTRYP GetProgramiv)(GLuint program, GLenum pname, GLint * params); /* 416 */ + void (GLAPIENTRYP GetShaderInfoLog)(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * infoLog); /* 417 */ + void (GLAPIENTRYP GetShaderiv)(GLuint shader, GLenum pname, GLint * params); /* 418 */ + GLboolean (GLAPIENTRYP IsProgram)(GLuint program); /* 419 */ + GLboolean (GLAPIENTRYP IsShader)(GLuint shader); /* 420 */ + void (GLAPIENTRYP StencilFuncSeparate)(GLenum face, GLenum func, GLint ref, GLuint mask); /* 421 */ + void (GLAPIENTRYP StencilMaskSeparate)(GLenum face, GLuint mask); /* 422 */ + void (GLAPIENTRYP StencilOpSeparate)(GLenum face, GLenum fail, GLenum zfail, GLenum zpass); /* 423 */ + void (GLAPIENTRYP UniformMatrix2x3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 424 */ + void (GLAPIENTRYP UniformMatrix2x4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 425 */ + void (GLAPIENTRYP UniformMatrix3x2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 426 */ + void (GLAPIENTRYP UniformMatrix3x4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 427 */ + void (GLAPIENTRYP UniformMatrix4x2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 428 */ + void (GLAPIENTRYP UniformMatrix4x3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 429 */ + void (GLAPIENTRYP LoadTransposeMatrixdARB)(const GLdouble * m); /* 430 */ + void (GLAPIENTRYP LoadTransposeMatrixfARB)(const GLfloat * m); /* 431 */ + void (GLAPIENTRYP MultTransposeMatrixdARB)(const GLdouble * m); /* 432 */ + void (GLAPIENTRYP MultTransposeMatrixfARB)(const GLfloat * m); /* 433 */ + void (GLAPIENTRYP SampleCoverageARB)(GLclampf value, GLboolean invert); /* 434 */ + void (GLAPIENTRYP CompressedTexImage1DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid * data); /* 435 */ + void (GLAPIENTRYP CompressedTexImage2DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid * data); /* 436 */ + void (GLAPIENTRYP CompressedTexImage3DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid * data); /* 437 */ + void (GLAPIENTRYP CompressedTexSubImage1DARB)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid * data); /* 438 */ + void (GLAPIENTRYP CompressedTexSubImage2DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid * data); /* 439 */ + void (GLAPIENTRYP CompressedTexSubImage3DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid * data); /* 440 */ + void (GLAPIENTRYP GetCompressedTexImageARB)(GLenum target, GLint level, GLvoid * img); /* 441 */ + void (GLAPIENTRYP DisableVertexAttribArrayARB)(GLuint index); /* 442 */ + void (GLAPIENTRYP EnableVertexAttribArrayARB)(GLuint index); /* 443 */ + void (GLAPIENTRYP GetProgramEnvParameterdvARB)(GLenum target, GLuint index, GLdouble * params); /* 444 */ + void (GLAPIENTRYP GetProgramEnvParameterfvARB)(GLenum target, GLuint index, GLfloat * params); /* 445 */ + void (GLAPIENTRYP GetProgramLocalParameterdvARB)(GLenum target, GLuint index, GLdouble * params); /* 446 */ + void (GLAPIENTRYP GetProgramLocalParameterfvARB)(GLenum target, GLuint index, GLfloat * params); /* 447 */ + void (GLAPIENTRYP GetProgramStringARB)(GLenum target, GLenum pname, GLvoid * string); /* 448 */ + void (GLAPIENTRYP GetProgramivARB)(GLenum target, GLenum pname, GLint * params); /* 449 */ + void (GLAPIENTRYP GetVertexAttribdvARB)(GLuint index, GLenum pname, GLdouble * params); /* 450 */ + void (GLAPIENTRYP GetVertexAttribfvARB)(GLuint index, GLenum pname, GLfloat * params); /* 451 */ + void (GLAPIENTRYP GetVertexAttribivARB)(GLuint index, GLenum pname, GLint * params); /* 452 */ + void (GLAPIENTRYP ProgramEnvParameter4dARB)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 453 */ + void (GLAPIENTRYP ProgramEnvParameter4dvARB)(GLenum target, GLuint index, const GLdouble * params); /* 454 */ + void (GLAPIENTRYP ProgramEnvParameter4fARB)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 455 */ + void (GLAPIENTRYP ProgramEnvParameter4fvARB)(GLenum target, GLuint index, const GLfloat * params); /* 456 */ + void (GLAPIENTRYP ProgramLocalParameter4dARB)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 457 */ + void (GLAPIENTRYP ProgramLocalParameter4dvARB)(GLenum target, GLuint index, const GLdouble * params); /* 458 */ + void (GLAPIENTRYP ProgramLocalParameter4fARB)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 459 */ + void (GLAPIENTRYP ProgramLocalParameter4fvARB)(GLenum target, GLuint index, const GLfloat * params); /* 460 */ + void (GLAPIENTRYP ProgramStringARB)(GLenum target, GLenum format, GLsizei len, const GLvoid * string); /* 461 */ + void (GLAPIENTRYP VertexAttrib1dARB)(GLuint index, GLdouble x); /* 462 */ + void (GLAPIENTRYP VertexAttrib1dvARB)(GLuint index, const GLdouble * v); /* 463 */ + void (GLAPIENTRYP VertexAttrib1fARB)(GLuint index, GLfloat x); /* 464 */ + void (GLAPIENTRYP VertexAttrib1fvARB)(GLuint index, const GLfloat * v); /* 465 */ + void (GLAPIENTRYP VertexAttrib1sARB)(GLuint index, GLshort x); /* 466 */ + void (GLAPIENTRYP VertexAttrib1svARB)(GLuint index, const GLshort * v); /* 467 */ + void (GLAPIENTRYP VertexAttrib2dARB)(GLuint index, GLdouble x, GLdouble y); /* 468 */ + void (GLAPIENTRYP VertexAttrib2dvARB)(GLuint index, const GLdouble * v); /* 469 */ + void (GLAPIENTRYP VertexAttrib2fARB)(GLuint index, GLfloat x, GLfloat y); /* 470 */ + void (GLAPIENTRYP VertexAttrib2fvARB)(GLuint index, const GLfloat * v); /* 471 */ + void (GLAPIENTRYP VertexAttrib2sARB)(GLuint index, GLshort x, GLshort y); /* 472 */ + void (GLAPIENTRYP VertexAttrib2svARB)(GLuint index, const GLshort * v); /* 473 */ + void (GLAPIENTRYP VertexAttrib3dARB)(GLuint index, GLdouble x, GLdouble y, GLdouble z); /* 474 */ + void (GLAPIENTRYP VertexAttrib3dvARB)(GLuint index, const GLdouble * v); /* 475 */ + void (GLAPIENTRYP VertexAttrib3fARB)(GLuint index, GLfloat x, GLfloat y, GLfloat z); /* 476 */ + void (GLAPIENTRYP VertexAttrib3fvARB)(GLuint index, const GLfloat * v); /* 477 */ + void (GLAPIENTRYP VertexAttrib3sARB)(GLuint index, GLshort x, GLshort y, GLshort z); /* 478 */ + void (GLAPIENTRYP VertexAttrib3svARB)(GLuint index, const GLshort * v); /* 479 */ + void (GLAPIENTRYP VertexAttrib4NbvARB)(GLuint index, const GLbyte * v); /* 480 */ + void (GLAPIENTRYP VertexAttrib4NivARB)(GLuint index, const GLint * v); /* 481 */ + void (GLAPIENTRYP VertexAttrib4NsvARB)(GLuint index, const GLshort * v); /* 482 */ + void (GLAPIENTRYP VertexAttrib4NubARB)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); /* 483 */ + void (GLAPIENTRYP VertexAttrib4NubvARB)(GLuint index, const GLubyte * v); /* 484 */ + void (GLAPIENTRYP VertexAttrib4NuivARB)(GLuint index, const GLuint * v); /* 485 */ + void (GLAPIENTRYP VertexAttrib4NusvARB)(GLuint index, const GLushort * v); /* 486 */ + void (GLAPIENTRYP VertexAttrib4bvARB)(GLuint index, const GLbyte * v); /* 487 */ + void (GLAPIENTRYP VertexAttrib4dARB)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 488 */ + void (GLAPIENTRYP VertexAttrib4dvARB)(GLuint index, const GLdouble * v); /* 489 */ + void (GLAPIENTRYP VertexAttrib4fARB)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 490 */ + void (GLAPIENTRYP VertexAttrib4fvARB)(GLuint index, const GLfloat * v); /* 491 */ + void (GLAPIENTRYP VertexAttrib4ivARB)(GLuint index, const GLint * v); /* 492 */ + void (GLAPIENTRYP VertexAttrib4sARB)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); /* 493 */ + void (GLAPIENTRYP VertexAttrib4svARB)(GLuint index, const GLshort * v); /* 494 */ + void (GLAPIENTRYP VertexAttrib4ubvARB)(GLuint index, const GLubyte * v); /* 495 */ + void (GLAPIENTRYP VertexAttrib4uivARB)(GLuint index, const GLuint * v); /* 496 */ + void (GLAPIENTRYP VertexAttrib4usvARB)(GLuint index, const GLushort * v); /* 497 */ + void (GLAPIENTRYP VertexAttribPointerARB)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid * pointer); /* 498 */ + void (GLAPIENTRYP BindBufferARB)(GLenum target, GLuint buffer); /* 499 */ + void (GLAPIENTRYP BufferDataARB)(GLenum target, GLsizeiptrARB size, const GLvoid * data, GLenum usage); /* 500 */ + void (GLAPIENTRYP BufferSubDataARB)(GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid * data); /* 501 */ + void (GLAPIENTRYP DeleteBuffersARB)(GLsizei n, const GLuint * buffer); /* 502 */ + void (GLAPIENTRYP GenBuffersARB)(GLsizei n, GLuint * buffer); /* 503 */ + void (GLAPIENTRYP GetBufferParameterivARB)(GLenum target, GLenum pname, GLint * params); /* 504 */ + void (GLAPIENTRYP GetBufferPointervARB)(GLenum target, GLenum pname, GLvoid ** params); /* 505 */ + void (GLAPIENTRYP GetBufferSubDataARB)(GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid * data); /* 506 */ + GLboolean (GLAPIENTRYP IsBufferARB)(GLuint buffer); /* 507 */ + GLvoid * (GLAPIENTRYP MapBufferARB)(GLenum target, GLenum access); /* 508 */ + GLboolean (GLAPIENTRYP UnmapBufferARB)(GLenum target); /* 509 */ + void (GLAPIENTRYP BeginQueryARB)(GLenum target, GLuint id); /* 510 */ + void (GLAPIENTRYP DeleteQueriesARB)(GLsizei n, const GLuint * ids); /* 511 */ + void (GLAPIENTRYP EndQueryARB)(GLenum target); /* 512 */ + void (GLAPIENTRYP GenQueriesARB)(GLsizei n, GLuint * ids); /* 513 */ + void (GLAPIENTRYP GetQueryObjectivARB)(GLuint id, GLenum pname, GLint * params); /* 514 */ + void (GLAPIENTRYP GetQueryObjectuivARB)(GLuint id, GLenum pname, GLuint * params); /* 515 */ + void (GLAPIENTRYP GetQueryivARB)(GLenum target, GLenum pname, GLint * params); /* 516 */ + GLboolean (GLAPIENTRYP IsQueryARB)(GLuint id); /* 517 */ + void (GLAPIENTRYP AttachObjectARB)(GLhandleARB containerObj, GLhandleARB obj); /* 518 */ + void (GLAPIENTRYP CompileShaderARB)(GLhandleARB shader); /* 519 */ + GLhandleARB (GLAPIENTRYP CreateProgramObjectARB)(void); /* 520 */ + GLhandleARB (GLAPIENTRYP CreateShaderObjectARB)(GLenum shaderType); /* 521 */ + void (GLAPIENTRYP DeleteObjectARB)(GLhandleARB obj); /* 522 */ + void (GLAPIENTRYP DetachObjectARB)(GLhandleARB containerObj, GLhandleARB attachedObj); /* 523 */ + void (GLAPIENTRYP GetActiveUniformARB)(GLhandleARB program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLcharARB * name); /* 524 */ + void (GLAPIENTRYP GetAttachedObjectsARB)(GLhandleARB containerObj, GLsizei maxLength, GLsizei * length, GLhandleARB * infoLog); /* 525 */ + GLhandleARB (GLAPIENTRYP GetHandleARB)(GLenum pname); /* 526 */ + void (GLAPIENTRYP GetInfoLogARB)(GLhandleARB obj, GLsizei maxLength, GLsizei * length, GLcharARB * infoLog); /* 527 */ + void (GLAPIENTRYP GetObjectParameterfvARB)(GLhandleARB obj, GLenum pname, GLfloat * params); /* 528 */ + void (GLAPIENTRYP GetObjectParameterivARB)(GLhandleARB obj, GLenum pname, GLint * params); /* 529 */ + void (GLAPIENTRYP GetShaderSourceARB)(GLhandleARB shader, GLsizei bufSize, GLsizei * length, GLcharARB * source); /* 530 */ + GLint (GLAPIENTRYP GetUniformLocationARB)(GLhandleARB program, const GLcharARB * name); /* 531 */ + void (GLAPIENTRYP GetUniformfvARB)(GLhandleARB program, GLint location, GLfloat * params); /* 532 */ + void (GLAPIENTRYP GetUniformivARB)(GLhandleARB program, GLint location, GLint * params); /* 533 */ + void (GLAPIENTRYP LinkProgramARB)(GLhandleARB program); /* 534 */ + void (GLAPIENTRYP ShaderSourceARB)(GLhandleARB shader, GLsizei count, const GLcharARB ** string, const GLint * length); /* 535 */ + void (GLAPIENTRYP Uniform1fARB)(GLint location, GLfloat v0); /* 536 */ + void (GLAPIENTRYP Uniform1fvARB)(GLint location, GLsizei count, const GLfloat * value); /* 537 */ + void (GLAPIENTRYP Uniform1iARB)(GLint location, GLint v0); /* 538 */ + void (GLAPIENTRYP Uniform1ivARB)(GLint location, GLsizei count, const GLint * value); /* 539 */ + void (GLAPIENTRYP Uniform2fARB)(GLint location, GLfloat v0, GLfloat v1); /* 540 */ + void (GLAPIENTRYP Uniform2fvARB)(GLint location, GLsizei count, const GLfloat * value); /* 541 */ + void (GLAPIENTRYP Uniform2iARB)(GLint location, GLint v0, GLint v1); /* 542 */ + void (GLAPIENTRYP Uniform2ivARB)(GLint location, GLsizei count, const GLint * value); /* 543 */ + void (GLAPIENTRYP Uniform3fARB)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2); /* 544 */ + void (GLAPIENTRYP Uniform3fvARB)(GLint location, GLsizei count, const GLfloat * value); /* 545 */ + void (GLAPIENTRYP Uniform3iARB)(GLint location, GLint v0, GLint v1, GLint v2); /* 546 */ + void (GLAPIENTRYP Uniform3ivARB)(GLint location, GLsizei count, const GLint * value); /* 547 */ + void (GLAPIENTRYP Uniform4fARB)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); /* 548 */ + void (GLAPIENTRYP Uniform4fvARB)(GLint location, GLsizei count, const GLfloat * value); /* 549 */ + void (GLAPIENTRYP Uniform4iARB)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3); /* 550 */ + void (GLAPIENTRYP Uniform4ivARB)(GLint location, GLsizei count, const GLint * value); /* 551 */ + void (GLAPIENTRYP UniformMatrix2fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 552 */ + void (GLAPIENTRYP UniformMatrix3fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 553 */ + void (GLAPIENTRYP UniformMatrix4fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 554 */ + void (GLAPIENTRYP UseProgramObjectARB)(GLhandleARB program); /* 555 */ + void (GLAPIENTRYP ValidateProgramARB)(GLhandleARB program); /* 556 */ + void (GLAPIENTRYP BindAttribLocationARB)(GLhandleARB program, GLuint index, const GLcharARB * name); /* 557 */ + void (GLAPIENTRYP GetActiveAttribARB)(GLhandleARB program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLcharARB * name); /* 558 */ + GLint (GLAPIENTRYP GetAttribLocationARB)(GLhandleARB program, const GLcharARB * name); /* 559 */ + void (GLAPIENTRYP DrawBuffersARB)(GLsizei n, const GLenum * bufs); /* 560 */ + void (GLAPIENTRYP PolygonOffsetEXT)(GLfloat factor, GLfloat bias); /* 561 */ + void (GLAPIENTRYP GetPixelTexGenParameterfvSGIS)(GLenum pname, GLfloat * params); /* 562 */ + void (GLAPIENTRYP GetPixelTexGenParameterivSGIS)(GLenum pname, GLint * params); /* 563 */ + void (GLAPIENTRYP PixelTexGenParameterfSGIS)(GLenum pname, GLfloat param); /* 564 */ + void (GLAPIENTRYP PixelTexGenParameterfvSGIS)(GLenum pname, const GLfloat * params); /* 565 */ + void (GLAPIENTRYP PixelTexGenParameteriSGIS)(GLenum pname, GLint param); /* 566 */ + void (GLAPIENTRYP PixelTexGenParameterivSGIS)(GLenum pname, const GLint * params); /* 567 */ + void (GLAPIENTRYP SampleMaskSGIS)(GLclampf value, GLboolean invert); /* 568 */ + void (GLAPIENTRYP SamplePatternSGIS)(GLenum pattern); /* 569 */ + void (GLAPIENTRYP ColorPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 570 */ + void (GLAPIENTRYP EdgeFlagPointerEXT)(GLsizei stride, GLsizei count, const GLboolean * pointer); /* 571 */ + void (GLAPIENTRYP IndexPointerEXT)(GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 572 */ + void (GLAPIENTRYP NormalPointerEXT)(GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 573 */ + void (GLAPIENTRYP TexCoordPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 574 */ + void (GLAPIENTRYP VertexPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 575 */ + void (GLAPIENTRYP PointParameterfEXT)(GLenum pname, GLfloat param); /* 576 */ + void (GLAPIENTRYP PointParameterfvEXT)(GLenum pname, const GLfloat * params); /* 577 */ + void (GLAPIENTRYP LockArraysEXT)(GLint first, GLsizei count); /* 578 */ + void (GLAPIENTRYP UnlockArraysEXT)(void); /* 579 */ + void (GLAPIENTRYP CullParameterdvEXT)(GLenum pname, GLdouble * params); /* 580 */ + void (GLAPIENTRYP CullParameterfvEXT)(GLenum pname, GLfloat * params); /* 581 */ + void (GLAPIENTRYP SecondaryColor3bEXT)(GLbyte red, GLbyte green, GLbyte blue); /* 582 */ + void (GLAPIENTRYP SecondaryColor3bvEXT)(const GLbyte * v); /* 583 */ + void (GLAPIENTRYP SecondaryColor3dEXT)(GLdouble red, GLdouble green, GLdouble blue); /* 584 */ + void (GLAPIENTRYP SecondaryColor3dvEXT)(const GLdouble * v); /* 585 */ + void (GLAPIENTRYP SecondaryColor3fEXT)(GLfloat red, GLfloat green, GLfloat blue); /* 586 */ + void (GLAPIENTRYP SecondaryColor3fvEXT)(const GLfloat * v); /* 587 */ + void (GLAPIENTRYP SecondaryColor3iEXT)(GLint red, GLint green, GLint blue); /* 588 */ + void (GLAPIENTRYP SecondaryColor3ivEXT)(const GLint * v); /* 589 */ + void (GLAPIENTRYP SecondaryColor3sEXT)(GLshort red, GLshort green, GLshort blue); /* 590 */ + void (GLAPIENTRYP SecondaryColor3svEXT)(const GLshort * v); /* 591 */ + void (GLAPIENTRYP SecondaryColor3ubEXT)(GLubyte red, GLubyte green, GLubyte blue); /* 592 */ + void (GLAPIENTRYP SecondaryColor3ubvEXT)(const GLubyte * v); /* 593 */ + void (GLAPIENTRYP SecondaryColor3uiEXT)(GLuint red, GLuint green, GLuint blue); /* 594 */ + void (GLAPIENTRYP SecondaryColor3uivEXT)(const GLuint * v); /* 595 */ + void (GLAPIENTRYP SecondaryColor3usEXT)(GLushort red, GLushort green, GLushort blue); /* 596 */ + void (GLAPIENTRYP SecondaryColor3usvEXT)(const GLushort * v); /* 597 */ + void (GLAPIENTRYP SecondaryColorPointerEXT)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 598 */ + void (GLAPIENTRYP MultiDrawArraysEXT)(GLenum mode, GLint * first, GLsizei * count, GLsizei primcount); /* 599 */ + void (GLAPIENTRYP MultiDrawElementsEXT)(GLenum mode, const GLsizei * count, GLenum type, const GLvoid ** indices, GLsizei primcount); /* 600 */ + void (GLAPIENTRYP FogCoordPointerEXT)(GLenum type, GLsizei stride, const GLvoid * pointer); /* 601 */ + void (GLAPIENTRYP FogCoorddEXT)(GLdouble coord); /* 602 */ + void (GLAPIENTRYP FogCoorddvEXT)(const GLdouble * coord); /* 603 */ + void (GLAPIENTRYP FogCoordfEXT)(GLfloat coord); /* 604 */ + void (GLAPIENTRYP FogCoordfvEXT)(const GLfloat * coord); /* 605 */ + void (GLAPIENTRYP PixelTexGenSGIX)(GLenum mode); /* 606 */ + void (GLAPIENTRYP BlendFuncSeparateEXT)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); /* 607 */ + void (GLAPIENTRYP FlushVertexArrayRangeNV)(void); /* 608 */ + void (GLAPIENTRYP VertexArrayRangeNV)(GLsizei length, const GLvoid * pointer); /* 609 */ + void (GLAPIENTRYP CombinerInputNV)(GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); /* 610 */ + void (GLAPIENTRYP CombinerOutputNV)(GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); /* 611 */ + void (GLAPIENTRYP CombinerParameterfNV)(GLenum pname, GLfloat param); /* 612 */ + void (GLAPIENTRYP CombinerParameterfvNV)(GLenum pname, const GLfloat * params); /* 613 */ + void (GLAPIENTRYP CombinerParameteriNV)(GLenum pname, GLint param); /* 614 */ + void (GLAPIENTRYP CombinerParameterivNV)(GLenum pname, const GLint * params); /* 615 */ + void (GLAPIENTRYP FinalCombinerInputNV)(GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); /* 616 */ + void (GLAPIENTRYP GetCombinerInputParameterfvNV)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat * params); /* 617 */ + void (GLAPIENTRYP GetCombinerInputParameterivNV)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint * params); /* 618 */ + void (GLAPIENTRYP GetCombinerOutputParameterfvNV)(GLenum stage, GLenum portion, GLenum pname, GLfloat * params); /* 619 */ + void (GLAPIENTRYP GetCombinerOutputParameterivNV)(GLenum stage, GLenum portion, GLenum pname, GLint * params); /* 620 */ + void (GLAPIENTRYP GetFinalCombinerInputParameterfvNV)(GLenum variable, GLenum pname, GLfloat * params); /* 621 */ + void (GLAPIENTRYP GetFinalCombinerInputParameterivNV)(GLenum variable, GLenum pname, GLint * params); /* 622 */ + void (GLAPIENTRYP ResizeBuffersMESA)(void); /* 623 */ + void (GLAPIENTRYP WindowPos2dMESA)(GLdouble x, GLdouble y); /* 624 */ + void (GLAPIENTRYP WindowPos2dvMESA)(const GLdouble * v); /* 625 */ + void (GLAPIENTRYP WindowPos2fMESA)(GLfloat x, GLfloat y); /* 626 */ + void (GLAPIENTRYP WindowPos2fvMESA)(const GLfloat * v); /* 627 */ + void (GLAPIENTRYP WindowPos2iMESA)(GLint x, GLint y); /* 628 */ + void (GLAPIENTRYP WindowPos2ivMESA)(const GLint * v); /* 629 */ + void (GLAPIENTRYP WindowPos2sMESA)(GLshort x, GLshort y); /* 630 */ + void (GLAPIENTRYP WindowPos2svMESA)(const GLshort * v); /* 631 */ + void (GLAPIENTRYP WindowPos3dMESA)(GLdouble x, GLdouble y, GLdouble z); /* 632 */ + void (GLAPIENTRYP WindowPos3dvMESA)(const GLdouble * v); /* 633 */ + void (GLAPIENTRYP WindowPos3fMESA)(GLfloat x, GLfloat y, GLfloat z); /* 634 */ + void (GLAPIENTRYP WindowPos3fvMESA)(const GLfloat * v); /* 635 */ + void (GLAPIENTRYP WindowPos3iMESA)(GLint x, GLint y, GLint z); /* 636 */ + void (GLAPIENTRYP WindowPos3ivMESA)(const GLint * v); /* 637 */ + void (GLAPIENTRYP WindowPos3sMESA)(GLshort x, GLshort y, GLshort z); /* 638 */ + void (GLAPIENTRYP WindowPos3svMESA)(const GLshort * v); /* 639 */ + void (GLAPIENTRYP WindowPos4dMESA)(GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 640 */ + void (GLAPIENTRYP WindowPos4dvMESA)(const GLdouble * v); /* 641 */ + void (GLAPIENTRYP WindowPos4fMESA)(GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 642 */ + void (GLAPIENTRYP WindowPos4fvMESA)(const GLfloat * v); /* 643 */ + void (GLAPIENTRYP WindowPos4iMESA)(GLint x, GLint y, GLint z, GLint w); /* 644 */ + void (GLAPIENTRYP WindowPos4ivMESA)(const GLint * v); /* 645 */ + void (GLAPIENTRYP WindowPos4sMESA)(GLshort x, GLshort y, GLshort z, GLshort w); /* 646 */ + void (GLAPIENTRYP WindowPos4svMESA)(const GLshort * v); /* 647 */ + void (GLAPIENTRYP MultiModeDrawArraysIBM)(const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride); /* 648 */ + void (GLAPIENTRYP MultiModeDrawElementsIBM)(const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount, GLint modestride); /* 649 */ + void (GLAPIENTRYP DeleteFencesNV)(GLsizei n, const GLuint * fences); /* 650 */ + void (GLAPIENTRYP FinishFenceNV)(GLuint fence); /* 651 */ + void (GLAPIENTRYP GenFencesNV)(GLsizei n, GLuint * fences); /* 652 */ + void (GLAPIENTRYP GetFenceivNV)(GLuint fence, GLenum pname, GLint * params); /* 653 */ + GLboolean (GLAPIENTRYP IsFenceNV)(GLuint fence); /* 654 */ + void (GLAPIENTRYP SetFenceNV)(GLuint fence, GLenum condition); /* 655 */ + GLboolean (GLAPIENTRYP TestFenceNV)(GLuint fence); /* 656 */ + GLboolean (GLAPIENTRYP AreProgramsResidentNV)(GLsizei n, const GLuint * ids, GLboolean * residences); /* 657 */ + void (GLAPIENTRYP BindProgramNV)(GLenum target, GLuint program); /* 658 */ + void (GLAPIENTRYP DeleteProgramsNV)(GLsizei n, const GLuint * programs); /* 659 */ + void (GLAPIENTRYP ExecuteProgramNV)(GLenum target, GLuint id, const GLfloat * params); /* 660 */ + void (GLAPIENTRYP GenProgramsNV)(GLsizei n, GLuint * programs); /* 661 */ + void (GLAPIENTRYP GetProgramParameterdvNV)(GLenum target, GLuint index, GLenum pname, GLdouble * params); /* 662 */ + void (GLAPIENTRYP GetProgramParameterfvNV)(GLenum target, GLuint index, GLenum pname, GLfloat * params); /* 663 */ + void (GLAPIENTRYP GetProgramStringNV)(GLuint id, GLenum pname, GLubyte * program); /* 664 */ + void (GLAPIENTRYP GetProgramivNV)(GLuint id, GLenum pname, GLint * params); /* 665 */ + void (GLAPIENTRYP GetTrackMatrixivNV)(GLenum target, GLuint address, GLenum pname, GLint * params); /* 666 */ + void (GLAPIENTRYP GetVertexAttribPointervNV)(GLuint index, GLenum pname, GLvoid ** params); /* 667 */ + void (GLAPIENTRYP GetVertexAttribdvNV)(GLuint index, GLenum pname, GLdouble * params); /* 668 */ + void (GLAPIENTRYP GetVertexAttribfvNV)(GLuint index, GLenum pname, GLfloat * params); /* 669 */ + void (GLAPIENTRYP GetVertexAttribivNV)(GLuint index, GLenum pname, GLint * params); /* 670 */ + GLboolean (GLAPIENTRYP IsProgramNV)(GLuint program); /* 671 */ + void (GLAPIENTRYP LoadProgramNV)(GLenum target, GLuint id, GLsizei len, const GLubyte * program); /* 672 */ + void (GLAPIENTRYP ProgramParameter4dNV)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 673 */ + void (GLAPIENTRYP ProgramParameter4dvNV)(GLenum target, GLuint index, const GLdouble * params); /* 674 */ + void (GLAPIENTRYP ProgramParameter4fNV)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 675 */ + void (GLAPIENTRYP ProgramParameter4fvNV)(GLenum target, GLuint index, const GLfloat * params); /* 676 */ + void (GLAPIENTRYP ProgramParameters4dvNV)(GLenum target, GLuint index, GLuint num, const GLdouble * params); /* 677 */ + void (GLAPIENTRYP ProgramParameters4fvNV)(GLenum target, GLuint index, GLuint num, const GLfloat * params); /* 678 */ + void (GLAPIENTRYP RequestResidentProgramsNV)(GLsizei n, const GLuint * ids); /* 679 */ + void (GLAPIENTRYP TrackMatrixNV)(GLenum target, GLuint address, GLenum matrix, GLenum transform); /* 680 */ + void (GLAPIENTRYP VertexAttrib1dNV)(GLuint index, GLdouble x); /* 681 */ + void (GLAPIENTRYP VertexAttrib1dvNV)(GLuint index, const GLdouble * v); /* 682 */ + void (GLAPIENTRYP VertexAttrib1fNV)(GLuint index, GLfloat x); /* 683 */ + void (GLAPIENTRYP VertexAttrib1fvNV)(GLuint index, const GLfloat * v); /* 684 */ + void (GLAPIENTRYP VertexAttrib1sNV)(GLuint index, GLshort x); /* 685 */ + void (GLAPIENTRYP VertexAttrib1svNV)(GLuint index, const GLshort * v); /* 686 */ + void (GLAPIENTRYP VertexAttrib2dNV)(GLuint index, GLdouble x, GLdouble y); /* 687 */ + void (GLAPIENTRYP VertexAttrib2dvNV)(GLuint index, const GLdouble * v); /* 688 */ + void (GLAPIENTRYP VertexAttrib2fNV)(GLuint index, GLfloat x, GLfloat y); /* 689 */ + void (GLAPIENTRYP VertexAttrib2fvNV)(GLuint index, const GLfloat * v); /* 690 */ + void (GLAPIENTRYP VertexAttrib2sNV)(GLuint index, GLshort x, GLshort y); /* 691 */ + void (GLAPIENTRYP VertexAttrib2svNV)(GLuint index, const GLshort * v); /* 692 */ + void (GLAPIENTRYP VertexAttrib3dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z); /* 693 */ + void (GLAPIENTRYP VertexAttrib3dvNV)(GLuint index, const GLdouble * v); /* 694 */ + void (GLAPIENTRYP VertexAttrib3fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z); /* 695 */ + void (GLAPIENTRYP VertexAttrib3fvNV)(GLuint index, const GLfloat * v); /* 696 */ + void (GLAPIENTRYP VertexAttrib3sNV)(GLuint index, GLshort x, GLshort y, GLshort z); /* 697 */ + void (GLAPIENTRYP VertexAttrib3svNV)(GLuint index, const GLshort * v); /* 698 */ + void (GLAPIENTRYP VertexAttrib4dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 699 */ + void (GLAPIENTRYP VertexAttrib4dvNV)(GLuint index, const GLdouble * v); /* 700 */ + void (GLAPIENTRYP VertexAttrib4fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 701 */ + void (GLAPIENTRYP VertexAttrib4fvNV)(GLuint index, const GLfloat * v); /* 702 */ + void (GLAPIENTRYP VertexAttrib4sNV)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); /* 703 */ + void (GLAPIENTRYP VertexAttrib4svNV)(GLuint index, const GLshort * v); /* 704 */ + void (GLAPIENTRYP VertexAttrib4ubNV)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); /* 705 */ + void (GLAPIENTRYP VertexAttrib4ubvNV)(GLuint index, const GLubyte * v); /* 706 */ + void (GLAPIENTRYP VertexAttribPointerNV)(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 707 */ + void (GLAPIENTRYP VertexAttribs1dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 708 */ + void (GLAPIENTRYP VertexAttribs1fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 709 */ + void (GLAPIENTRYP VertexAttribs1svNV)(GLuint index, GLsizei n, const GLshort * v); /* 710 */ + void (GLAPIENTRYP VertexAttribs2dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 711 */ + void (GLAPIENTRYP VertexAttribs2fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 712 */ + void (GLAPIENTRYP VertexAttribs2svNV)(GLuint index, GLsizei n, const GLshort * v); /* 713 */ + void (GLAPIENTRYP VertexAttribs3dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 714 */ + void (GLAPIENTRYP VertexAttribs3fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 715 */ + void (GLAPIENTRYP VertexAttribs3svNV)(GLuint index, GLsizei n, const GLshort * v); /* 716 */ + void (GLAPIENTRYP VertexAttribs4dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 717 */ + void (GLAPIENTRYP VertexAttribs4fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 718 */ + void (GLAPIENTRYP VertexAttribs4svNV)(GLuint index, GLsizei n, const GLshort * v); /* 719 */ + void (GLAPIENTRYP VertexAttribs4ubvNV)(GLuint index, GLsizei n, const GLubyte * v); /* 720 */ + void (GLAPIENTRYP AlphaFragmentOp1ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); /* 721 */ + void (GLAPIENTRYP AlphaFragmentOp2ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); /* 722 */ + void (GLAPIENTRYP AlphaFragmentOp3ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); /* 723 */ + void (GLAPIENTRYP BeginFragmentShaderATI)(void); /* 724 */ + void (GLAPIENTRYP BindFragmentShaderATI)(GLuint id); /* 725 */ + void (GLAPIENTRYP ColorFragmentOp1ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); /* 726 */ + void (GLAPIENTRYP ColorFragmentOp2ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); /* 727 */ + void (GLAPIENTRYP ColorFragmentOp3ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); /* 728 */ + void (GLAPIENTRYP DeleteFragmentShaderATI)(GLuint id); /* 729 */ + void (GLAPIENTRYP EndFragmentShaderATI)(void); /* 730 */ + GLuint (GLAPIENTRYP GenFragmentShadersATI)(GLuint range); /* 731 */ + void (GLAPIENTRYP PassTexCoordATI)(GLuint dst, GLuint coord, GLenum swizzle); /* 732 */ + void (GLAPIENTRYP SampleMapATI)(GLuint dst, GLuint interp, GLenum swizzle); /* 733 */ + void (GLAPIENTRYP SetFragmentShaderConstantATI)(GLuint dst, const GLfloat * value); /* 734 */ + void (GLAPIENTRYP PointParameteriNV)(GLenum pname, GLint param); /* 735 */ + void (GLAPIENTRYP PointParameterivNV)(GLenum pname, const GLint * params); /* 736 */ + void (GLAPIENTRYP ActiveStencilFaceEXT)(GLenum face); /* 737 */ + void (GLAPIENTRYP BindVertexArrayAPPLE)(GLuint array); /* 738 */ + void (GLAPIENTRYP DeleteVertexArraysAPPLE)(GLsizei n, const GLuint * arrays); /* 739 */ + void (GLAPIENTRYP GenVertexArraysAPPLE)(GLsizei n, GLuint * arrays); /* 740 */ + GLboolean (GLAPIENTRYP IsVertexArrayAPPLE)(GLuint array); /* 741 */ + void (GLAPIENTRYP GetProgramNamedParameterdvNV)(GLuint id, GLsizei len, const GLubyte * name, GLdouble * params); /* 742 */ + void (GLAPIENTRYP GetProgramNamedParameterfvNV)(GLuint id, GLsizei len, const GLubyte * name, GLfloat * params); /* 743 */ + void (GLAPIENTRYP ProgramNamedParameter4dNV)(GLuint id, GLsizei len, const GLubyte * name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 744 */ + void (GLAPIENTRYP ProgramNamedParameter4dvNV)(GLuint id, GLsizei len, const GLubyte * name, const GLdouble * v); /* 745 */ + void (GLAPIENTRYP ProgramNamedParameter4fNV)(GLuint id, GLsizei len, const GLubyte * name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 746 */ + void (GLAPIENTRYP ProgramNamedParameter4fvNV)(GLuint id, GLsizei len, const GLubyte * name, const GLfloat * v); /* 747 */ + void (GLAPIENTRYP DepthBoundsEXT)(GLclampd zmin, GLclampd zmax); /* 748 */ + void (GLAPIENTRYP BlendEquationSeparateEXT)(GLenum modeRGB, GLenum modeA); /* 749 */ + void (GLAPIENTRYP BindFramebufferEXT)(GLenum target, GLuint framebuffer); /* 750 */ + void (GLAPIENTRYP BindRenderbufferEXT)(GLenum target, GLuint renderbuffer); /* 751 */ + GLenum (GLAPIENTRYP CheckFramebufferStatusEXT)(GLenum target); /* 752 */ + void (GLAPIENTRYP DeleteFramebuffersEXT)(GLsizei n, const GLuint * framebuffers); /* 753 */ + void (GLAPIENTRYP DeleteRenderbuffersEXT)(GLsizei n, const GLuint * renderbuffers); /* 754 */ + void (GLAPIENTRYP FramebufferRenderbufferEXT)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); /* 755 */ + void (GLAPIENTRYP FramebufferTexture1DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); /* 756 */ + void (GLAPIENTRYP FramebufferTexture2DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); /* 757 */ + void (GLAPIENTRYP FramebufferTexture3DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); /* 758 */ + void (GLAPIENTRYP GenFramebuffersEXT)(GLsizei n, GLuint * framebuffers); /* 759 */ + void (GLAPIENTRYP GenRenderbuffersEXT)(GLsizei n, GLuint * renderbuffers); /* 760 */ + void (GLAPIENTRYP GenerateMipmapEXT)(GLenum target); /* 761 */ + void (GLAPIENTRYP GetFramebufferAttachmentParameterivEXT)(GLenum target, GLenum attachment, GLenum pname, GLint * params); /* 762 */ + void (GLAPIENTRYP GetRenderbufferParameterivEXT)(GLenum target, GLenum pname, GLint * params); /* 763 */ + GLboolean (GLAPIENTRYP IsFramebufferEXT)(GLuint framebuffer); /* 764 */ + GLboolean (GLAPIENTRYP IsRenderbufferEXT)(GLuint renderbuffer); /* 765 */ + void (GLAPIENTRYP RenderbufferStorageEXT)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height); /* 766 */ + void (GLAPIENTRYP BlitFramebufferEXT)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); /* 767 */ + void (GLAPIENTRYP ProgramEnvParameters4fvEXT)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); /* 768 */ + void (GLAPIENTRYP ProgramLocalParameters4fvEXT)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); /* 769 */ + void (GLAPIENTRYP GetQueryObjecti64vEXT)(GLuint id, GLenum pname, GLint64EXT * params); /* 770 */ + void (GLAPIENTRYP GetQueryObjectui64vEXT)(GLuint id, GLenum pname, GLuint64EXT * params); /* 771 */ }; #endif /* !defined( _GLAPI_TABLE_H_ ) */ diff --git a/src/mesa/glapi/glapitemp.h b/src/mesa/glapi/glapitemp.h index bdf66880d1b..340a4f6a040 100644 --- a/src/mesa/glapi/glapitemp.h +++ b/src/mesa/glapi/glapitemp.h @@ -1710,6 +1710,13 @@ KEYWORD1 GLboolean KEYWORD2 NAME(AreTexturesResident)(GLsizei n, const GLuint * RETURN_DISPATCH(AreTexturesResident, (n, textures, residences), (F, "glAreTexturesResident(%d, %p, %p);\n", n, (const void *) textures, (const void *) residences)); } +#ifndef GLX_INDIRECT_RENDERING +KEYWORD1 GLboolean KEYWORD2 NAME(AreTexturesResidentEXT)(GLsizei n, const GLuint * textures, GLboolean * residences) +{ + RETURN_DISPATCH(AreTexturesResident, (n, textures, residences), (F, "glAreTexturesResidentEXT(%d, %p, %p);\n", n, (const void *) textures, (const void *) residences)); +} +#endif /* GLX_INDIRECT_RENDERING */ + KEYWORD1 void KEYWORD2 NAME(CopyTexImage1D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border) { DISPATCH(CopyTexImage1D, (target, level, internalformat, x, y, width, border), (F, "glCopyTexImage1D(0x%x, %d, 0x%x, %d, %d, %d, %d);\n", target, level, internalformat, x, y, width, border)); @@ -1755,16 +1762,25 @@ KEYWORD1 void KEYWORD2 NAME(DeleteTextures)(GLsizei n, const GLuint * textures) DISPATCH(DeleteTextures, (n, textures), (F, "glDeleteTextures(%d, %p);\n", n, (const void *) textures)); } +#ifndef GLX_INDIRECT_RENDERING KEYWORD1 void KEYWORD2 NAME(DeleteTexturesEXT)(GLsizei n, const GLuint * textures) { DISPATCH(DeleteTextures, (n, textures), (F, "glDeleteTexturesEXT(%d, %p);\n", n, (const void *) textures)); } +#endif /* GLX_INDIRECT_RENDERING */ KEYWORD1 void KEYWORD2 NAME(GenTextures)(GLsizei n, GLuint * textures) { DISPATCH(GenTextures, (n, textures), (F, "glGenTextures(%d, %p);\n", n, (const void *) textures)); } +#ifndef GLX_INDIRECT_RENDERING +KEYWORD1 void KEYWORD2 NAME(GenTexturesEXT)(GLsizei n, GLuint * textures) +{ + DISPATCH(GenTextures, (n, textures), (F, "glGenTexturesEXT(%d, %p);\n", n, (const void *) textures)); +} +#endif /* GLX_INDIRECT_RENDERING */ + KEYWORD1 void KEYWORD2 NAME(GetPointerv)(GLenum pname, GLvoid ** params) { DISPATCH(GetPointerv, (pname, params), (F, "glGetPointerv(0x%x, %p);\n", pname, (const void *) params)); @@ -1780,6 +1796,13 @@ KEYWORD1 GLboolean KEYWORD2 NAME(IsTexture)(GLuint texture) RETURN_DISPATCH(IsTexture, (texture), (F, "glIsTexture(%d);\n", texture)); } +#ifndef GLX_INDIRECT_RENDERING +KEYWORD1 GLboolean KEYWORD2 NAME(IsTextureEXT)(GLuint texture) +{ + RETURN_DISPATCH(IsTexture, (texture), (F, "glIsTextureEXT(%d);\n", texture)); +} +#endif /* GLX_INDIRECT_RENDERING */ + KEYWORD1 void KEYWORD2 NAME(PrioritizeTextures)(GLsizei n, const GLuint * textures, const GLclampf * priorities) { DISPATCH(PrioritizeTextures, (n, textures, priorities), (F, "glPrioritizeTextures(%d, %p, %p);\n", n, (const void *) textures, (const void *) priorities)); @@ -1908,16 +1931,64 @@ KEYWORD1 void KEYWORD2 NAME(GetColorTable)(GLenum target, GLenum format, GLenum DISPATCH(GetColorTable, (target, format, type, table), (F, "glGetColorTable(0x%x, 0x%x, 0x%x, %p);\n", target, format, type, (const void *) table)); } +#ifndef GLX_INDIRECT_RENDERING +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_343)(GLenum target, GLenum format, GLenum type, GLvoid * table); + +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_343)(GLenum target, GLenum format, GLenum type, GLvoid * table) +{ + DISPATCH(GetColorTable, (target, format, type, table), (F, "glGetColorTableSGI(0x%x, 0x%x, 0x%x, %p);\n", target, format, type, (const void *) table)); +} +#endif /* GLX_INDIRECT_RENDERING */ + +#ifndef GLX_INDIRECT_RENDERING +KEYWORD1 void KEYWORD2 NAME(GetColorTableEXT)(GLenum target, GLenum format, GLenum type, GLvoid * table) +{ + DISPATCH(GetColorTable, (target, format, type, table), (F, "glGetColorTableEXT(0x%x, 0x%x, 0x%x, %p);\n", target, format, type, (const void *) table)); +} +#endif /* GLX_INDIRECT_RENDERING */ + KEYWORD1 void KEYWORD2 NAME(GetColorTableParameterfv)(GLenum target, GLenum pname, GLfloat * params) { DISPATCH(GetColorTableParameterfv, (target, pname, params), (F, "glGetColorTableParameterfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); } +#ifndef GLX_INDIRECT_RENDERING +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_344)(GLenum target, GLenum pname, GLfloat * params); + +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_344)(GLenum target, GLenum pname, GLfloat * params) +{ + DISPATCH(GetColorTableParameterfv, (target, pname, params), (F, "glGetColorTableParameterfvSGI(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); +} +#endif /* GLX_INDIRECT_RENDERING */ + +#ifndef GLX_INDIRECT_RENDERING +KEYWORD1 void KEYWORD2 NAME(GetColorTableParameterfvEXT)(GLenum target, GLenum pname, GLfloat * params) +{ + DISPATCH(GetColorTableParameterfv, (target, pname, params), (F, "glGetColorTableParameterfvEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); +} +#endif /* GLX_INDIRECT_RENDERING */ + KEYWORD1 void KEYWORD2 NAME(GetColorTableParameteriv)(GLenum target, GLenum pname, GLint * params) { DISPATCH(GetColorTableParameteriv, (target, pname, params), (F, "glGetColorTableParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); } +#ifndef GLX_INDIRECT_RENDERING +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_345)(GLenum target, GLenum pname, GLint * params); + +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_345)(GLenum target, GLenum pname, GLint * params) +{ + DISPATCH(GetColorTableParameteriv, (target, pname, params), (F, "glGetColorTableParameterivSGI(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); +} +#endif /* GLX_INDIRECT_RENDERING */ + +#ifndef GLX_INDIRECT_RENDERING +KEYWORD1 void KEYWORD2 NAME(GetColorTableParameterivEXT)(GLenum target, GLenum pname, GLint * params) +{ + DISPATCH(GetColorTableParameteriv, (target, pname, params), (F, "glGetColorTableParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); +} +#endif /* GLX_INDIRECT_RENDERING */ + KEYWORD1 void KEYWORD2 NAME(ColorSubTable)(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid * data) { DISPATCH(ColorSubTable, (target, start, count, format, type, data), (F, "glColorSubTable(0x%x, %d, %d, 0x%x, 0x%x, %p);\n", target, start, count, format, type, (const void *) data)); @@ -2043,21 +2114,57 @@ KEYWORD1 void KEYWORD2 NAME(GetConvolutionFilter)(GLenum target, GLenum format, DISPATCH(GetConvolutionFilter, (target, format, type, image), (F, "glGetConvolutionFilter(0x%x, 0x%x, 0x%x, %p);\n", target, format, type, (const void *) image)); } +#ifndef GLX_INDIRECT_RENDERING +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_356)(GLenum target, GLenum format, GLenum type, GLvoid * image); + +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_356)(GLenum target, GLenum format, GLenum type, GLvoid * image) +{ + DISPATCH(GetConvolutionFilter, (target, format, type, image), (F, "glGetConvolutionFilterEXT(0x%x, 0x%x, 0x%x, %p);\n", target, format, type, (const void *) image)); +} +#endif /* GLX_INDIRECT_RENDERING */ + KEYWORD1 void KEYWORD2 NAME(GetConvolutionParameterfv)(GLenum target, GLenum pname, GLfloat * params) { DISPATCH(GetConvolutionParameterfv, (target, pname, params), (F, "glGetConvolutionParameterfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); } +#ifndef GLX_INDIRECT_RENDERING +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_357)(GLenum target, GLenum pname, GLfloat * params); + +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_357)(GLenum target, GLenum pname, GLfloat * params) +{ + DISPATCH(GetConvolutionParameterfv, (target, pname, params), (F, "glGetConvolutionParameterfvEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); +} +#endif /* GLX_INDIRECT_RENDERING */ + KEYWORD1 void KEYWORD2 NAME(GetConvolutionParameteriv)(GLenum target, GLenum pname, GLint * params) { DISPATCH(GetConvolutionParameteriv, (target, pname, params), (F, "glGetConvolutionParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); } +#ifndef GLX_INDIRECT_RENDERING +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_358)(GLenum target, GLenum pname, GLint * params); + +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_358)(GLenum target, GLenum pname, GLint * params) +{ + DISPATCH(GetConvolutionParameteriv, (target, pname, params), (F, "glGetConvolutionParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); +} +#endif /* GLX_INDIRECT_RENDERING */ + KEYWORD1 void KEYWORD2 NAME(GetSeparableFilter)(GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span) { DISPATCH(GetSeparableFilter, (target, format, type, row, column, span), (F, "glGetSeparableFilter(0x%x, 0x%x, 0x%x, %p, %p, %p);\n", target, format, type, (const void *) row, (const void *) column, (const void *) span)); } +#ifndef GLX_INDIRECT_RENDERING +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_359)(GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span); + +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_359)(GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span) +{ + DISPATCH(GetSeparableFilter, (target, format, type, row, column, span), (F, "glGetSeparableFilterEXT(0x%x, 0x%x, 0x%x, %p, %p, %p);\n", target, format, type, (const void *) row, (const void *) column, (const void *) span)); +} +#endif /* GLX_INDIRECT_RENDERING */ + KEYWORD1 void KEYWORD2 NAME(SeparableFilter2D)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * row, const GLvoid * column) { DISPATCH(SeparableFilter2D, (target, internalformat, width, height, format, type, row, column), (F, "glSeparableFilter2D(0x%x, 0x%x, %d, %d, 0x%x, 0x%x, %p, %p);\n", target, internalformat, width, height, format, type, (const void *) row, (const void *) column)); @@ -2075,31 +2182,85 @@ KEYWORD1 void KEYWORD2 NAME(GetHistogram)(GLenum target, GLboolean reset, GLenum DISPATCH(GetHistogram, (target, reset, format, type, values), (F, "glGetHistogram(0x%x, %d, 0x%x, 0x%x, %p);\n", target, reset, format, type, (const void *) values)); } +#ifndef GLX_INDIRECT_RENDERING +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_361)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values); + +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_361)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values) +{ + DISPATCH(GetHistogram, (target, reset, format, type, values), (F, "glGetHistogramEXT(0x%x, %d, 0x%x, 0x%x, %p);\n", target, reset, format, type, (const void *) values)); +} +#endif /* GLX_INDIRECT_RENDERING */ + KEYWORD1 void KEYWORD2 NAME(GetHistogramParameterfv)(GLenum target, GLenum pname, GLfloat * params) { DISPATCH(GetHistogramParameterfv, (target, pname, params), (F, "glGetHistogramParameterfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); } +#ifndef GLX_INDIRECT_RENDERING +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_362)(GLenum target, GLenum pname, GLfloat * params); + +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_362)(GLenum target, GLenum pname, GLfloat * params) +{ + DISPATCH(GetHistogramParameterfv, (target, pname, params), (F, "glGetHistogramParameterfvEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); +} +#endif /* GLX_INDIRECT_RENDERING */ + KEYWORD1 void KEYWORD2 NAME(GetHistogramParameteriv)(GLenum target, GLenum pname, GLint * params) { DISPATCH(GetHistogramParameteriv, (target, pname, params), (F, "glGetHistogramParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); } +#ifndef GLX_INDIRECT_RENDERING +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_363)(GLenum target, GLenum pname, GLint * params); + +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_363)(GLenum target, GLenum pname, GLint * params) +{ + DISPATCH(GetHistogramParameteriv, (target, pname, params), (F, "glGetHistogramParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); +} +#endif /* GLX_INDIRECT_RENDERING */ + KEYWORD1 void KEYWORD2 NAME(GetMinmax)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values) { DISPATCH(GetMinmax, (target, reset, format, type, values), (F, "glGetMinmax(0x%x, %d, 0x%x, 0x%x, %p);\n", target, reset, format, type, (const void *) values)); } +#ifndef GLX_INDIRECT_RENDERING +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_364)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values); + +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_364)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values) +{ + DISPATCH(GetMinmax, (target, reset, format, type, values), (F, "glGetMinmaxEXT(0x%x, %d, 0x%x, 0x%x, %p);\n", target, reset, format, type, (const void *) values)); +} +#endif /* GLX_INDIRECT_RENDERING */ + KEYWORD1 void KEYWORD2 NAME(GetMinmaxParameterfv)(GLenum target, GLenum pname, GLfloat * params) { DISPATCH(GetMinmaxParameterfv, (target, pname, params), (F, "glGetMinmaxParameterfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); } +#ifndef GLX_INDIRECT_RENDERING +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_365)(GLenum target, GLenum pname, GLfloat * params); + +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_365)(GLenum target, GLenum pname, GLfloat * params) +{ + DISPATCH(GetMinmaxParameterfv, (target, pname, params), (F, "glGetMinmaxParameterfvEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); +} +#endif /* GLX_INDIRECT_RENDERING */ + KEYWORD1 void KEYWORD2 NAME(GetMinmaxParameteriv)(GLenum target, GLenum pname, GLint * params) { DISPATCH(GetMinmaxParameteriv, (target, pname, params), (F, "glGetMinmaxParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); } +#ifndef GLX_INDIRECT_RENDERING +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_366)(GLenum target, GLenum pname, GLint * params); + +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_366)(GLenum target, GLenum pname, GLint * params) +{ + DISPATCH(GetMinmaxParameteriv, (target, pname, params), (F, "glGetMinmaxParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); +} +#endif /* GLX_INDIRECT_RENDERING */ + KEYWORD1 void KEYWORD2 NAME(Histogram)(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink) { DISPATCH(Histogram, (target, width, internalformat, sink), (F, "glHistogram(0x%x, %d, 0x%x, %d);\n", target, width, internalformat, sink)); @@ -2518,6 +2679,71 @@ KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4svARB)(GLenum target, const GLshort * DISPATCH(MultiTexCoord4svARB, (target, v), (F, "glMultiTexCoord4svARB(0x%x, %p);\n", target, (const void *) v)); } +KEYWORD1 void KEYWORD2 NAME(AttachShader)(GLuint program, GLuint shader) +{ + DISPATCH(AttachShader, (program, shader), (F, "glAttachShader(%d, %d);\n", program, shader)); +} + +KEYWORD1 GLuint KEYWORD2 NAME(CreateProgram)(void) +{ + RETURN_DISPATCH(CreateProgram, (), (F, "glCreateProgram();\n")); +} + +KEYWORD1 GLuint KEYWORD2 NAME(CreateShader)(GLenum type) +{ + RETURN_DISPATCH(CreateShader, (type), (F, "glCreateShader(0x%x);\n", type)); +} + +KEYWORD1 void KEYWORD2 NAME(DeleteProgram)(GLuint program) +{ + DISPATCH(DeleteProgram, (program), (F, "glDeleteProgram(%d);\n", program)); +} + +KEYWORD1 void KEYWORD2 NAME(DeleteShader)(GLuint program) +{ + DISPATCH(DeleteShader, (program), (F, "glDeleteShader(%d);\n", program)); +} + +KEYWORD1 void KEYWORD2 NAME(DetachShader)(GLuint program, GLuint shader) +{ + DISPATCH(DetachShader, (program, shader), (F, "glDetachShader(%d, %d);\n", program, shader)); +} + +KEYWORD1 void KEYWORD2 NAME(GetAttachedShaders)(GLuint program, GLsizei maxCount, GLsizei * count, GLuint * obj) +{ + DISPATCH(GetAttachedShaders, (program, maxCount, count, obj), (F, "glGetAttachedShaders(%d, %d, %p, %p);\n", program, maxCount, (const void *) count, (const void *) obj)); +} + +KEYWORD1 void KEYWORD2 NAME(GetProgramInfoLog)(GLuint program, GLsizei bufSize, GLsizei * length, GLchar * infoLog) +{ + DISPATCH(GetProgramInfoLog, (program, bufSize, length, infoLog), (F, "glGetProgramInfoLog(%d, %d, %p, %p);\n", program, bufSize, (const void *) length, (const void *) infoLog)); +} + +KEYWORD1 void KEYWORD2 NAME(GetProgramiv)(GLuint program, GLenum pname, GLint * params) +{ + DISPATCH(GetProgramiv, (program, pname, params), (F, "glGetProgramiv(%d, 0x%x, %p);\n", program, pname, (const void *) params)); +} + +KEYWORD1 void KEYWORD2 NAME(GetShaderInfoLog)(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * infoLog) +{ + DISPATCH(GetShaderInfoLog, (shader, bufSize, length, infoLog), (F, "glGetShaderInfoLog(%d, %d, %p, %p);\n", shader, bufSize, (const void *) length, (const void *) infoLog)); +} + +KEYWORD1 void KEYWORD2 NAME(GetShaderiv)(GLuint shader, GLenum pname, GLint * params) +{ + DISPATCH(GetShaderiv, (shader, pname, params), (F, "glGetShaderiv(%d, 0x%x, %p);\n", shader, pname, (const void *) params)); +} + +KEYWORD1 GLboolean KEYWORD2 NAME(IsProgram)(GLuint program) +{ + RETURN_DISPATCH(IsProgram, (program), (F, "glIsProgram(%d);\n", program)); +} + +KEYWORD1 GLboolean KEYWORD2 NAME(IsShader)(GLuint shader) +{ + RETURN_DISPATCH(IsShader, (shader), (F, "glIsShader(%d);\n", shader)); +} + KEYWORD1 void KEYWORD2 NAME(StencilFuncSeparate)(GLenum face, GLenum func, GLint ref, GLuint mask) { DISPATCH(StencilFuncSeparate, (face, func, ref, mask), (F, "glStencilFuncSeparate(0x%x, 0x%x, %d, %d);\n", face, func, ref, mask)); @@ -2533,6 +2759,36 @@ KEYWORD1 void KEYWORD2 NAME(StencilOpSeparate)(GLenum face, GLenum fail, GLenum DISPATCH(StencilOpSeparate, (face, fail, zfail, zpass), (F, "glStencilOpSeparate(0x%x, 0x%x, 0x%x, 0x%x);\n", face, fail, zfail, zpass)); } +KEYWORD1 void KEYWORD2 NAME(UniformMatrix2x3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) +{ + DISPATCH(UniformMatrix2x3fv, (location, count, transpose, value), (F, "glUniformMatrix2x3fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value)); +} + +KEYWORD1 void KEYWORD2 NAME(UniformMatrix2x4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) +{ + DISPATCH(UniformMatrix2x4fv, (location, count, transpose, value), (F, "glUniformMatrix2x4fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value)); +} + +KEYWORD1 void KEYWORD2 NAME(UniformMatrix3x2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) +{ + DISPATCH(UniformMatrix3x2fv, (location, count, transpose, value), (F, "glUniformMatrix3x2fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value)); +} + +KEYWORD1 void KEYWORD2 NAME(UniformMatrix3x4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) +{ + DISPATCH(UniformMatrix3x4fv, (location, count, transpose, value), (F, "glUniformMatrix3x4fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value)); +} + +KEYWORD1 void KEYWORD2 NAME(UniformMatrix4x2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) +{ + DISPATCH(UniformMatrix4x2fv, (location, count, transpose, value), (F, "glUniformMatrix4x2fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value)); +} + +KEYWORD1 void KEYWORD2 NAME(UniformMatrix4x3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) +{ + DISPATCH(UniformMatrix4x3fv, (location, count, transpose, value), (F, "glUniformMatrix4x3fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value)); +} + KEYWORD1 void KEYWORD2 NAME(LoadTransposeMatrixd)(const GLdouble * m) { DISPATCH(LoadTransposeMatrixdARB, (m), (F, "glLoadTransposeMatrixd(%p);\n", (const void *) m)); @@ -2653,11 +2909,21 @@ KEYWORD1 void KEYWORD2 NAME(GetCompressedTexImageARB)(GLenum target, GLint level DISPATCH(GetCompressedTexImageARB, (target, level, img), (F, "glGetCompressedTexImageARB(0x%x, %d, %p);\n", target, level, (const void *) img)); } +KEYWORD1 void KEYWORD2 NAME(DisableVertexAttribArray)(GLuint index) +{ + DISPATCH(DisableVertexAttribArrayARB, (index), (F, "glDisableVertexAttribArray(%d);\n", index)); +} + KEYWORD1 void KEYWORD2 NAME(DisableVertexAttribArrayARB)(GLuint index) { DISPATCH(DisableVertexAttribArrayARB, (index), (F, "glDisableVertexAttribArrayARB(%d);\n", index)); } +KEYWORD1 void KEYWORD2 NAME(EnableVertexAttribArray)(GLuint index) +{ + DISPATCH(EnableVertexAttribArrayARB, (index), (F, "glEnableVertexAttribArray(%d);\n", index)); +} + KEYWORD1 void KEYWORD2 NAME(EnableVertexAttribArrayARB)(GLuint index) { DISPATCH(EnableVertexAttribArrayARB, (index), (F, "glEnableVertexAttribArrayARB(%d);\n", index)); @@ -2693,16 +2959,31 @@ KEYWORD1 void KEYWORD2 NAME(GetProgramivARB)(GLenum target, GLenum pname, GLint DISPATCH(GetProgramivARB, (target, pname, params), (F, "glGetProgramivARB(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); } +KEYWORD1 void KEYWORD2 NAME(GetVertexAttribdv)(GLuint index, GLenum pname, GLdouble * params) +{ + DISPATCH(GetVertexAttribdvARB, (index, pname, params), (F, "glGetVertexAttribdv(%d, 0x%x, %p);\n", index, pname, (const void *) params)); +} + KEYWORD1 void KEYWORD2 NAME(GetVertexAttribdvARB)(GLuint index, GLenum pname, GLdouble * params) { DISPATCH(GetVertexAttribdvARB, (index, pname, params), (F, "glGetVertexAttribdvARB(%d, 0x%x, %p);\n", index, pname, (const void *) params)); } +KEYWORD1 void KEYWORD2 NAME(GetVertexAttribfv)(GLuint index, GLenum pname, GLfloat * params) +{ + DISPATCH(GetVertexAttribfvARB, (index, pname, params), (F, "glGetVertexAttribfv(%d, 0x%x, %p);\n", index, pname, (const void *) params)); +} + KEYWORD1 void KEYWORD2 NAME(GetVertexAttribfvARB)(GLuint index, GLenum pname, GLfloat * params) { DISPATCH(GetVertexAttribfvARB, (index, pname, params), (F, "glGetVertexAttribfvARB(%d, 0x%x, %p);\n", index, pname, (const void *) params)); } +KEYWORD1 void KEYWORD2 NAME(GetVertexAttribiv)(GLuint index, GLenum pname, GLint * params) +{ + DISPATCH(GetVertexAttribivARB, (index, pname, params), (F, "glGetVertexAttribiv(%d, 0x%x, %p);\n", index, pname, (const void *) params)); +} + KEYWORD1 void KEYWORD2 NAME(GetVertexAttribivARB)(GLuint index, GLenum pname, GLint * params) { DISPATCH(GetVertexAttribivARB, (index, pname, params), (F, "glGetVertexAttribivARB(%d, 0x%x, %p);\n", index, pname, (const void *) params)); @@ -2753,126 +3034,251 @@ KEYWORD1 void KEYWORD2 NAME(ProgramStringARB)(GLenum target, GLenum format, GLsi DISPATCH(ProgramStringARB, (target, format, len, string), (F, "glProgramStringARB(0x%x, 0x%x, %d, %p);\n", target, format, len, (const void *) string)); } +KEYWORD1 void KEYWORD2 NAME(VertexAttrib1d)(GLuint index, GLdouble x) +{ + DISPATCH(VertexAttrib1dARB, (index, x), (F, "glVertexAttrib1d(%d, %f);\n", index, x)); +} + KEYWORD1 void KEYWORD2 NAME(VertexAttrib1dARB)(GLuint index, GLdouble x) { DISPATCH(VertexAttrib1dARB, (index, x), (F, "glVertexAttrib1dARB(%d, %f);\n", index, x)); } +KEYWORD1 void KEYWORD2 NAME(VertexAttrib1dv)(GLuint index, const GLdouble * v) +{ + DISPATCH(VertexAttrib1dvARB, (index, v), (F, "glVertexAttrib1dv(%d, %p);\n", index, (const void *) v)); +} + KEYWORD1 void KEYWORD2 NAME(VertexAttrib1dvARB)(GLuint index, const GLdouble * v) { DISPATCH(VertexAttrib1dvARB, (index, v), (F, "glVertexAttrib1dvARB(%d, %p);\n", index, (const void *) v)); } +KEYWORD1 void KEYWORD2 NAME(VertexAttrib1f)(GLuint index, GLfloat x) +{ + DISPATCH(VertexAttrib1fARB, (index, x), (F, "glVertexAttrib1f(%d, %f);\n", index, x)); +} + KEYWORD1 void KEYWORD2 NAME(VertexAttrib1fARB)(GLuint index, GLfloat x) { DISPATCH(VertexAttrib1fARB, (index, x), (F, "glVertexAttrib1fARB(%d, %f);\n", index, x)); } +KEYWORD1 void KEYWORD2 NAME(VertexAttrib1fv)(GLuint index, const GLfloat * v) +{ + DISPATCH(VertexAttrib1fvARB, (index, v), (F, "glVertexAttrib1fv(%d, %p);\n", index, (const void *) v)); +} + KEYWORD1 void KEYWORD2 NAME(VertexAttrib1fvARB)(GLuint index, const GLfloat * v) { DISPATCH(VertexAttrib1fvARB, (index, v), (F, "glVertexAttrib1fvARB(%d, %p);\n", index, (const void *) v)); } +KEYWORD1 void KEYWORD2 NAME(VertexAttrib1s)(GLuint index, GLshort x) +{ + DISPATCH(VertexAttrib1sARB, (index, x), (F, "glVertexAttrib1s(%d, %d);\n", index, x)); +} + KEYWORD1 void KEYWORD2 NAME(VertexAttrib1sARB)(GLuint index, GLshort x) { DISPATCH(VertexAttrib1sARB, (index, x), (F, "glVertexAttrib1sARB(%d, %d);\n", index, x)); } +KEYWORD1 void KEYWORD2 NAME(VertexAttrib1sv)(GLuint index, const GLshort * v) +{ + DISPATCH(VertexAttrib1svARB, (index, v), (F, "glVertexAttrib1sv(%d, %p);\n", index, (const void *) v)); +} + KEYWORD1 void KEYWORD2 NAME(VertexAttrib1svARB)(GLuint index, const GLshort * v) { DISPATCH(VertexAttrib1svARB, (index, v), (F, "glVertexAttrib1svARB(%d, %p);\n", index, (const void *) v)); } +KEYWORD1 void KEYWORD2 NAME(VertexAttrib2d)(GLuint index, GLdouble x, GLdouble y) +{ + DISPATCH(VertexAttrib2dARB, (index, x, y), (F, "glVertexAttrib2d(%d, %f, %f);\n", index, x, y)); +} + KEYWORD1 void KEYWORD2 NAME(VertexAttrib2dARB)(GLuint index, GLdouble x, GLdouble y) { DISPATCH(VertexAttrib2dARB, (index, x, y), (F, "glVertexAttrib2dARB(%d, %f, %f);\n", index, x, y)); } +KEYWORD1 void KEYWORD2 NAME(VertexAttrib2dv)(GLuint index, const GLdouble * v) +{ + DISPATCH(VertexAttrib2dvARB, (index, v), (F, "glVertexAttrib2dv(%d, %p);\n", index, (const void *) v)); +} + KEYWORD1 void KEYWORD2 NAME(VertexAttrib2dvARB)(GLuint index, const GLdouble * v) { DISPATCH(VertexAttrib2dvARB, (index, v), (F, "glVertexAttrib2dvARB(%d, %p);\n", index, (const void *) v)); } +KEYWORD1 void KEYWORD2 NAME(VertexAttrib2f)(GLuint index, GLfloat x, GLfloat y) +{ + DISPATCH(VertexAttrib2fARB, (index, x, y), (F, "glVertexAttrib2f(%d, %f, %f);\n", index, x, y)); +} + KEYWORD1 void KEYWORD2 NAME(VertexAttrib2fARB)(GLuint index, GLfloat x, GLfloat y) { DISPATCH(VertexAttrib2fARB, (index, x, y), (F, "glVertexAttrib2fARB(%d, %f, %f);\n", index, x, y)); } +KEYWORD1 void KEYWORD2 NAME(VertexAttrib2fv)(GLuint index, const GLfloat * v) +{ + DISPATCH(VertexAttrib2fvARB, (index, v), (F, "glVertexAttrib2fv(%d, %p);\n", index, (const void *) v)); +} + KEYWORD1 void KEYWORD2 NAME(VertexAttrib2fvARB)(GLuint index, const GLfloat * v) { DISPATCH(VertexAttrib2fvARB, (index, v), (F, "glVertexAttrib2fvARB(%d, %p);\n", index, (const void *) v)); } +KEYWORD1 void KEYWORD2 NAME(VertexAttrib2s)(GLuint index, GLshort x, GLshort y) +{ + DISPATCH(VertexAttrib2sARB, (index, x, y), (F, "glVertexAttrib2s(%d, %d, %d);\n", index, x, y)); +} + KEYWORD1 void KEYWORD2 NAME(VertexAttrib2sARB)(GLuint index, GLshort x, GLshort y) { DISPATCH(VertexAttrib2sARB, (index, x, y), (F, "glVertexAttrib2sARB(%d, %d, %d);\n", index, x, y)); } +KEYWORD1 void KEYWORD2 NAME(VertexAttrib2sv)(GLuint index, const GLshort * v) +{ + DISPATCH(VertexAttrib2svARB, (index, v), (F, "glVertexAttrib2sv(%d, %p);\n", index, (const void *) v)); +} + KEYWORD1 void KEYWORD2 NAME(VertexAttrib2svARB)(GLuint index, const GLshort * v) { DISPATCH(VertexAttrib2svARB, (index, v), (F, "glVertexAttrib2svARB(%d, %p);\n", index, (const void *) v)); } +KEYWORD1 void KEYWORD2 NAME(VertexAttrib3d)(GLuint index, GLdouble x, GLdouble y, GLdouble z) +{ + DISPATCH(VertexAttrib3dARB, (index, x, y, z), (F, "glVertexAttrib3d(%d, %f, %f, %f);\n", index, x, y, z)); +} + KEYWORD1 void KEYWORD2 NAME(VertexAttrib3dARB)(GLuint index, GLdouble x, GLdouble y, GLdouble z) { DISPATCH(VertexAttrib3dARB, (index, x, y, z), (F, "glVertexAttrib3dARB(%d, %f, %f, %f);\n", index, x, y, z)); } +KEYWORD1 void KEYWORD2 NAME(VertexAttrib3dv)(GLuint index, const GLdouble * v) +{ + DISPATCH(VertexAttrib3dvARB, (index, v), (F, "glVertexAttrib3dv(%d, %p);\n", index, (const void *) v)); +} + KEYWORD1 void KEYWORD2 NAME(VertexAttrib3dvARB)(GLuint index, const GLdouble * v) { DISPATCH(VertexAttrib3dvARB, (index, v), (F, "glVertexAttrib3dvARB(%d, %p);\n", index, (const void *) v)); } +KEYWORD1 void KEYWORD2 NAME(VertexAttrib3f)(GLuint index, GLfloat x, GLfloat y, GLfloat z) +{ + DISPATCH(VertexAttrib3fARB, (index, x, y, z), (F, "glVertexAttrib3f(%d, %f, %f, %f);\n", index, x, y, z)); +} + KEYWORD1 void KEYWORD2 NAME(VertexAttrib3fARB)(GLuint index, GLfloat x, GLfloat y, GLfloat z) { DISPATCH(VertexAttrib3fARB, (index, x, y, z), (F, "glVertexAttrib3fARB(%d, %f, %f, %f);\n", index, x, y, z)); } +KEYWORD1 void KEYWORD2 NAME(VertexAttrib3fv)(GLuint index, const GLfloat * v) +{ + DISPATCH(VertexAttrib3fvARB, (index, v), (F, "glVertexAttrib3fv(%d, %p);\n", index, (const void *) v)); +} + KEYWORD1 void KEYWORD2 NAME(VertexAttrib3fvARB)(GLuint index, const GLfloat * v) { DISPATCH(VertexAttrib3fvARB, (index, v), (F, "glVertexAttrib3fvARB(%d, %p);\n", index, (const void *) v)); } +KEYWORD1 void KEYWORD2 NAME(VertexAttrib3s)(GLuint index, GLshort x, GLshort y, GLshort z) +{ + DISPATCH(VertexAttrib3sARB, (index, x, y, z), (F, "glVertexAttrib3s(%d, %d, %d, %d);\n", index, x, y, z)); +} + KEYWORD1 void KEYWORD2 NAME(VertexAttrib3sARB)(GLuint index, GLshort x, GLshort y, GLshort z) { DISPATCH(VertexAttrib3sARB, (index, x, y, z), (F, "glVertexAttrib3sARB(%d, %d, %d, %d);\n", index, x, y, z)); } +KEYWORD1 void KEYWORD2 NAME(VertexAttrib3sv)(GLuint index, const GLshort * v) +{ + DISPATCH(VertexAttrib3svARB, (index, v), (F, "glVertexAttrib3sv(%d, %p);\n", index, (const void *) v)); +} + KEYWORD1 void KEYWORD2 NAME(VertexAttrib3svARB)(GLuint index, const GLshort * v) { DISPATCH(VertexAttrib3svARB, (index, v), (F, "glVertexAttrib3svARB(%d, %p);\n", index, (const void *) v)); } +KEYWORD1 void KEYWORD2 NAME(VertexAttrib4Nbv)(GLuint index, const GLbyte * v) +{ + DISPATCH(VertexAttrib4NbvARB, (index, v), (F, "glVertexAttrib4Nbv(%d, %p);\n", index, (const void *) v)); +} + KEYWORD1 void KEYWORD2 NAME(VertexAttrib4NbvARB)(GLuint index, const GLbyte * v) { DISPATCH(VertexAttrib4NbvARB, (index, v), (F, "glVertexAttrib4NbvARB(%d, %p);\n", index, (const void *) v)); } +KEYWORD1 void KEYWORD2 NAME(VertexAttrib4Niv)(GLuint index, const GLint * v) +{ + DISPATCH(VertexAttrib4NivARB, (index, v), (F, "glVertexAttrib4Niv(%d, %p);\n", index, (const void *) v)); +} + KEYWORD1 void KEYWORD2 NAME(VertexAttrib4NivARB)(GLuint index, const GLint * v) { DISPATCH(VertexAttrib4NivARB, (index, v), (F, "glVertexAttrib4NivARB(%d, %p);\n", index, (const void *) v)); } +KEYWORD1 void KEYWORD2 NAME(VertexAttrib4Nsv)(GLuint index, const GLshort * v) +{ + DISPATCH(VertexAttrib4NsvARB, (index, v), (F, "glVertexAttrib4Nsv(%d, %p);\n", index, (const void *) v)); +} + KEYWORD1 void KEYWORD2 NAME(VertexAttrib4NsvARB)(GLuint index, const GLshort * v) { DISPATCH(VertexAttrib4NsvARB, (index, v), (F, "glVertexAttrib4NsvARB(%d, %p);\n", index, (const void *) v)); } +KEYWORD1 void KEYWORD2 NAME(VertexAttrib4Nub)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w) +{ + DISPATCH(VertexAttrib4NubARB, (index, x, y, z, w), (F, "glVertexAttrib4Nub(%d, %d, %d, %d, %d);\n", index, x, y, z, w)); +} + KEYWORD1 void KEYWORD2 NAME(VertexAttrib4NubARB)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w) { DISPATCH(VertexAttrib4NubARB, (index, x, y, z, w), (F, "glVertexAttrib4NubARB(%d, %d, %d, %d, %d);\n", index, x, y, z, w)); } +KEYWORD1 void KEYWORD2 NAME(VertexAttrib4Nubv)(GLuint index, const GLubyte * v) +{ + DISPATCH(VertexAttrib4NubvARB, (index, v), (F, "glVertexAttrib4Nubv(%d, %p);\n", index, (const void *) v)); +} + KEYWORD1 void KEYWORD2 NAME(VertexAttrib4NubvARB)(GLuint index, const GLubyte * v) { DISPATCH(VertexAttrib4NubvARB, (index, v), (F, "glVertexAttrib4NubvARB(%d, %p);\n", index, (const void *) v)); } +KEYWORD1 void KEYWORD2 NAME(VertexAttrib4Nuiv)(GLuint index, const GLuint * v) +{ + DISPATCH(VertexAttrib4NuivARB, (index, v), (F, "glVertexAttrib4Nuiv(%d, %p);\n", index, (const void *) v)); +} + KEYWORD1 void KEYWORD2 NAME(VertexAttrib4NuivARB)(GLuint index, const GLuint * v) { DISPATCH(VertexAttrib4NuivARB, (index, v), (F, "glVertexAttrib4NuivARB(%d, %p);\n", index, (const void *) v)); } +KEYWORD1 void KEYWORD2 NAME(VertexAttrib4Nusv)(GLuint index, const GLushort * v) +{ + DISPATCH(VertexAttrib4NusvARB, (index, v), (F, "glVertexAttrib4Nusv(%d, %p);\n", index, (const void *) v)); +} + KEYWORD1 void KEYWORD2 NAME(VertexAttrib4NusvARB)(GLuint index, const GLushort * v) { DISPATCH(VertexAttrib4NusvARB, (index, v), (F, "glVertexAttrib4NusvARB(%d, %p);\n", index, (const void *) v)); @@ -2883,21 +3289,41 @@ KEYWORD1 void KEYWORD2 NAME(VertexAttrib4bvARB)(GLuint index, const GLbyte * v) DISPATCH(VertexAttrib4bvARB, (index, v), (F, "glVertexAttrib4bvARB(%d, %p);\n", index, (const void *) v)); } +KEYWORD1 void KEYWORD2 NAME(VertexAttrib4d)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) +{ + DISPATCH(VertexAttrib4dARB, (index, x, y, z, w), (F, "glVertexAttrib4d(%d, %f, %f, %f, %f);\n", index, x, y, z, w)); +} + KEYWORD1 void KEYWORD2 NAME(VertexAttrib4dARB)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) { DISPATCH(VertexAttrib4dARB, (index, x, y, z, w), (F, "glVertexAttrib4dARB(%d, %f, %f, %f, %f);\n", index, x, y, z, w)); } +KEYWORD1 void KEYWORD2 NAME(VertexAttrib4dv)(GLuint index, const GLdouble * v) +{ + DISPATCH(VertexAttrib4dvARB, (index, v), (F, "glVertexAttrib4dv(%d, %p);\n", index, (const void *) v)); +} + KEYWORD1 void KEYWORD2 NAME(VertexAttrib4dvARB)(GLuint index, const GLdouble * v) { DISPATCH(VertexAttrib4dvARB, (index, v), (F, "glVertexAttrib4dvARB(%d, %p);\n", index, (const void *) v)); } +KEYWORD1 void KEYWORD2 NAME(VertexAttrib4f)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) +{ + DISPATCH(VertexAttrib4fARB, (index, x, y, z, w), (F, "glVertexAttrib4f(%d, %f, %f, %f, %f);\n", index, x, y, z, w)); +} + KEYWORD1 void KEYWORD2 NAME(VertexAttrib4fARB)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) { DISPATCH(VertexAttrib4fARB, (index, x, y, z, w), (F, "glVertexAttrib4fARB(%d, %f, %f, %f, %f);\n", index, x, y, z, w)); } +KEYWORD1 void KEYWORD2 NAME(VertexAttrib4fv)(GLuint index, const GLfloat * v) +{ + DISPATCH(VertexAttrib4fvARB, (index, v), (F, "glVertexAttrib4fv(%d, %p);\n", index, (const void *) v)); +} + KEYWORD1 void KEYWORD2 NAME(VertexAttrib4fvARB)(GLuint index, const GLfloat * v) { DISPATCH(VertexAttrib4fvARB, (index, v), (F, "glVertexAttrib4fvARB(%d, %p);\n", index, (const void *) v)); @@ -2908,11 +3334,21 @@ KEYWORD1 void KEYWORD2 NAME(VertexAttrib4ivARB)(GLuint index, const GLint * v) DISPATCH(VertexAttrib4ivARB, (index, v), (F, "glVertexAttrib4ivARB(%d, %p);\n", index, (const void *) v)); } +KEYWORD1 void KEYWORD2 NAME(VertexAttrib4s)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w) +{ + DISPATCH(VertexAttrib4sARB, (index, x, y, z, w), (F, "glVertexAttrib4s(%d, %d, %d, %d, %d);\n", index, x, y, z, w)); +} + KEYWORD1 void KEYWORD2 NAME(VertexAttrib4sARB)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w) { DISPATCH(VertexAttrib4sARB, (index, x, y, z, w), (F, "glVertexAttrib4sARB(%d, %d, %d, %d, %d);\n", index, x, y, z, w)); } +KEYWORD1 void KEYWORD2 NAME(VertexAttrib4sv)(GLuint index, const GLshort * v) +{ + DISPATCH(VertexAttrib4svARB, (index, v), (F, "glVertexAttrib4sv(%d, %p);\n", index, (const void *) v)); +} + KEYWORD1 void KEYWORD2 NAME(VertexAttrib4svARB)(GLuint index, const GLshort * v) { DISPATCH(VertexAttrib4svARB, (index, v), (F, "glVertexAttrib4svARB(%d, %p);\n", index, (const void *) v)); @@ -2933,6 +3369,11 @@ KEYWORD1 void KEYWORD2 NAME(VertexAttrib4usvARB)(GLuint index, const GLushort * DISPATCH(VertexAttrib4usvARB, (index, v), (F, "glVertexAttrib4usvARB(%d, %p);\n", index, (const void *) v)); } +KEYWORD1 void KEYWORD2 NAME(VertexAttribPointer)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid * pointer) +{ + DISPATCH(VertexAttribPointerARB, (index, size, type, normalized, stride, pointer), (F, "glVertexAttribPointer(%d, %d, 0x%x, %d, %d, %p);\n", index, size, type, normalized, stride, (const void *) pointer)); +} + KEYWORD1 void KEYWORD2 NAME(VertexAttribPointerARB)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid * pointer) { DISPATCH(VertexAttribPointerARB, (index, size, type, normalized, stride, pointer), (F, "glVertexAttribPointerARB(%d, %d, 0x%x, %d, %d, %p);\n", index, size, type, normalized, stride, (const void *) pointer)); @@ -3133,9 +3574,14 @@ KEYWORD1 void KEYWORD2 NAME(AttachObjectARB)(GLhandleARB containerObj, GLhandleA DISPATCH(AttachObjectARB, (containerObj, obj), (F, "glAttachObjectARB(%d, %d);\n", containerObj, obj)); } -KEYWORD1 void KEYWORD2 NAME(CompileShaderARB)(GLhandleARB shaderObj) +KEYWORD1 void KEYWORD2 NAME(CompileShader)(GLuint shader) { - DISPATCH(CompileShaderARB, (shaderObj), (F, "glCompileShaderARB(%d);\n", shaderObj)); + DISPATCH(CompileShaderARB, (shader), (F, "glCompileShader(%d);\n", shader)); +} + +KEYWORD1 void KEYWORD2 NAME(CompileShaderARB)(GLhandleARB shader) +{ + DISPATCH(CompileShaderARB, (shader), (F, "glCompileShaderARB(%d);\n", shader)); } KEYWORD1 GLhandleARB KEYWORD2 NAME(CreateProgramObjectARB)(void) @@ -3158,9 +3604,14 @@ KEYWORD1 void KEYWORD2 NAME(DetachObjectARB)(GLhandleARB containerObj, GLhandleA DISPATCH(DetachObjectARB, (containerObj, attachedObj), (F, "glDetachObjectARB(%d, %d);\n", containerObj, attachedObj)); } -KEYWORD1 void KEYWORD2 NAME(GetActiveUniformARB)(GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei * length, GLint * size, GLenum * type, GLcharARB * name) +KEYWORD1 void KEYWORD2 NAME(GetActiveUniform)(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLchar * name) +{ + DISPATCH(GetActiveUniformARB, (program, index, bufSize, length, size, type, name), (F, "glGetActiveUniform(%d, %d, %d, %p, %p, %p, %p);\n", program, index, bufSize, (const void *) length, (const void *) size, (const void *) type, (const void *) name)); +} + +KEYWORD1 void KEYWORD2 NAME(GetActiveUniformARB)(GLhandleARB program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLcharARB * name) { - DISPATCH(GetActiveUniformARB, (programObj, index, maxLength, length, size, type, name), (F, "glGetActiveUniformARB(%d, %d, %d, %p, %p, %p, %p);\n", programObj, index, maxLength, (const void *) length, (const void *) size, (const void *) type, (const void *) name)); + DISPATCH(GetActiveUniformARB, (program, index, bufSize, length, size, type, name), (F, "glGetActiveUniformARB(%d, %d, %d, %p, %p, %p, %p);\n", program, index, bufSize, (const void *) length, (const void *) size, (const void *) type, (const void *) name)); } KEYWORD1 void KEYWORD2 NAME(GetAttachedObjectsARB)(GLhandleARB containerObj, GLsizei maxLength, GLsizei * length, GLhandleARB * infoLog) @@ -3188,34 +3639,69 @@ KEYWORD1 void KEYWORD2 NAME(GetObjectParameterivARB)(GLhandleARB obj, GLenum pna DISPATCH(GetObjectParameterivARB, (obj, pname, params), (F, "glGetObjectParameterivARB(%d, 0x%x, %p);\n", obj, pname, (const void *) params)); } -KEYWORD1 void KEYWORD2 NAME(GetShaderSourceARB)(GLhandleARB obj, GLsizei maxLength, GLsizei * length, GLcharARB * source) +KEYWORD1 void KEYWORD2 NAME(GetShaderSource)(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * source) +{ + DISPATCH(GetShaderSourceARB, (shader, bufSize, length, source), (F, "glGetShaderSource(%d, %d, %p, %p);\n", shader, bufSize, (const void *) length, (const void *) source)); +} + +KEYWORD1 void KEYWORD2 NAME(GetShaderSourceARB)(GLhandleARB shader, GLsizei bufSize, GLsizei * length, GLcharARB * source) +{ + DISPATCH(GetShaderSourceARB, (shader, bufSize, length, source), (F, "glGetShaderSourceARB(%d, %d, %p, %p);\n", shader, bufSize, (const void *) length, (const void *) source)); +} + +KEYWORD1 GLint KEYWORD2 NAME(GetUniformLocation)(GLuint program, const GLchar * name) +{ + RETURN_DISPATCH(GetUniformLocationARB, (program, name), (F, "glGetUniformLocation(%d, %p);\n", program, (const void *) name)); +} + +KEYWORD1 GLint KEYWORD2 NAME(GetUniformLocationARB)(GLhandleARB program, const GLcharARB * name) +{ + RETURN_DISPATCH(GetUniformLocationARB, (program, name), (F, "glGetUniformLocationARB(%d, %p);\n", program, (const void *) name)); +} + +KEYWORD1 void KEYWORD2 NAME(GetUniformfv)(GLuint program, GLint location, GLfloat * params) +{ + DISPATCH(GetUniformfvARB, (program, location, params), (F, "glGetUniformfv(%d, %d, %p);\n", program, location, (const void *) params)); +} + +KEYWORD1 void KEYWORD2 NAME(GetUniformfvARB)(GLhandleARB program, GLint location, GLfloat * params) { - DISPATCH(GetShaderSourceARB, (obj, maxLength, length, source), (F, "glGetShaderSourceARB(%d, %d, %p, %p);\n", obj, maxLength, (const void *) length, (const void *) source)); + DISPATCH(GetUniformfvARB, (program, location, params), (F, "glGetUniformfvARB(%d, %d, %p);\n", program, location, (const void *) params)); } -KEYWORD1 GLint KEYWORD2 NAME(GetUniformLocationARB)(GLhandleARB programObj, const GLcharARB * name) +KEYWORD1 void KEYWORD2 NAME(GetUniformiv)(GLuint program, GLint location, GLint * params) { - RETURN_DISPATCH(GetUniformLocationARB, (programObj, name), (F, "glGetUniformLocationARB(%d, %p);\n", programObj, (const void *) name)); + DISPATCH(GetUniformivARB, (program, location, params), (F, "glGetUniformiv(%d, %d, %p);\n", program, location, (const void *) params)); } -KEYWORD1 void KEYWORD2 NAME(GetUniformfvARB)(GLhandleARB programObj, GLint location, GLfloat * params) +KEYWORD1 void KEYWORD2 NAME(GetUniformivARB)(GLhandleARB program, GLint location, GLint * params) { - DISPATCH(GetUniformfvARB, (programObj, location, params), (F, "glGetUniformfvARB(%d, %d, %p);\n", programObj, location, (const void *) params)); + DISPATCH(GetUniformivARB, (program, location, params), (F, "glGetUniformivARB(%d, %d, %p);\n", program, location, (const void *) params)); } -KEYWORD1 void KEYWORD2 NAME(GetUniformivARB)(GLhandleARB programObj, GLint location, GLint * params) +KEYWORD1 void KEYWORD2 NAME(LinkProgram)(GLuint program) { - DISPATCH(GetUniformivARB, (programObj, location, params), (F, "glGetUniformivARB(%d, %d, %p);\n", programObj, location, (const void *) params)); + DISPATCH(LinkProgramARB, (program), (F, "glLinkProgram(%d);\n", program)); } -KEYWORD1 void KEYWORD2 NAME(LinkProgramARB)(GLhandleARB programObj) +KEYWORD1 void KEYWORD2 NAME(LinkProgramARB)(GLhandleARB program) { - DISPATCH(LinkProgramARB, (programObj), (F, "glLinkProgramARB(%d);\n", programObj)); + DISPATCH(LinkProgramARB, (program), (F, "glLinkProgramARB(%d);\n", program)); } -KEYWORD1 void KEYWORD2 NAME(ShaderSourceARB)(GLhandleARB shaderObj, GLsizei count, const GLcharARB ** string, const GLint * length) +KEYWORD1 void KEYWORD2 NAME(ShaderSource)(GLuint shader, GLsizei count, const GLchar ** string, const GLint * length) { - DISPATCH(ShaderSourceARB, (shaderObj, count, string, length), (F, "glShaderSourceARB(%d, %d, %p, %p);\n", shaderObj, count, (const void *) string, (const void *) length)); + DISPATCH(ShaderSourceARB, (shader, count, string, length), (F, "glShaderSource(%d, %d, %p, %p);\n", shader, count, (const void *) string, (const void *) length)); +} + +KEYWORD1 void KEYWORD2 NAME(ShaderSourceARB)(GLhandleARB shader, GLsizei count, const GLcharARB ** string, const GLint * length) +{ + DISPATCH(ShaderSourceARB, (shader, count, string, length), (F, "glShaderSourceARB(%d, %d, %p, %p);\n", shader, count, (const void *) string, (const void *) length)); +} + +KEYWORD1 void KEYWORD2 NAME(Uniform1f)(GLint location, GLfloat v0) +{ + DISPATCH(Uniform1fARB, (location, v0), (F, "glUniform1f(%d, %f);\n", location, v0)); } KEYWORD1 void KEYWORD2 NAME(Uniform1fARB)(GLint location, GLfloat v0) @@ -3223,314 +3709,308 @@ KEYWORD1 void KEYWORD2 NAME(Uniform1fARB)(GLint location, GLfloat v0) DISPATCH(Uniform1fARB, (location, v0), (F, "glUniform1fARB(%d, %f);\n", location, v0)); } +KEYWORD1 void KEYWORD2 NAME(Uniform1fv)(GLint location, GLsizei count, const GLfloat * value) +{ + DISPATCH(Uniform1fvARB, (location, count, value), (F, "glUniform1fv(%d, %d, %p);\n", location, count, (const void *) value)); +} + KEYWORD1 void KEYWORD2 NAME(Uniform1fvARB)(GLint location, GLsizei count, const GLfloat * value) { DISPATCH(Uniform1fvARB, (location, count, value), (F, "glUniform1fvARB(%d, %d, %p);\n", location, count, (const void *) value)); } +KEYWORD1 void KEYWORD2 NAME(Uniform1i)(GLint location, GLint v0) +{ + DISPATCH(Uniform1iARB, (location, v0), (F, "glUniform1i(%d, %d);\n", location, v0)); +} + KEYWORD1 void KEYWORD2 NAME(Uniform1iARB)(GLint location, GLint v0) { DISPATCH(Uniform1iARB, (location, v0), (F, "glUniform1iARB(%d, %d);\n", location, v0)); } +KEYWORD1 void KEYWORD2 NAME(Uniform1iv)(GLint location, GLsizei count, const GLint * value) +{ + DISPATCH(Uniform1ivARB, (location, count, value), (F, "glUniform1iv(%d, %d, %p);\n", location, count, (const void *) value)); +} + KEYWORD1 void KEYWORD2 NAME(Uniform1ivARB)(GLint location, GLsizei count, const GLint * value) { DISPATCH(Uniform1ivARB, (location, count, value), (F, "glUniform1ivARB(%d, %d, %p);\n", location, count, (const void *) value)); } +KEYWORD1 void KEYWORD2 NAME(Uniform2f)(GLint location, GLfloat v0, GLfloat v1) +{ + DISPATCH(Uniform2fARB, (location, v0, v1), (F, "glUniform2f(%d, %f, %f);\n", location, v0, v1)); +} + KEYWORD1 void KEYWORD2 NAME(Uniform2fARB)(GLint location, GLfloat v0, GLfloat v1) { DISPATCH(Uniform2fARB, (location, v0, v1), (F, "glUniform2fARB(%d, %f, %f);\n", location, v0, v1)); } +KEYWORD1 void KEYWORD2 NAME(Uniform2fv)(GLint location, GLsizei count, const GLfloat * value) +{ + DISPATCH(Uniform2fvARB, (location, count, value), (F, "glUniform2fv(%d, %d, %p);\n", location, count, (const void *) value)); +} + KEYWORD1 void KEYWORD2 NAME(Uniform2fvARB)(GLint location, GLsizei count, const GLfloat * value) { DISPATCH(Uniform2fvARB, (location, count, value), (F, "glUniform2fvARB(%d, %d, %p);\n", location, count, (const void *) value)); } +KEYWORD1 void KEYWORD2 NAME(Uniform2i)(GLint location, GLint v0, GLint v1) +{ + DISPATCH(Uniform2iARB, (location, v0, v1), (F, "glUniform2i(%d, %d, %d);\n", location, v0, v1)); +} + KEYWORD1 void KEYWORD2 NAME(Uniform2iARB)(GLint location, GLint v0, GLint v1) { DISPATCH(Uniform2iARB, (location, v0, v1), (F, "glUniform2iARB(%d, %d, %d);\n", location, v0, v1)); } +KEYWORD1 void KEYWORD2 NAME(Uniform2iv)(GLint location, GLsizei count, const GLint * value) +{ + DISPATCH(Uniform2ivARB, (location, count, value), (F, "glUniform2iv(%d, %d, %p);\n", location, count, (const void *) value)); +} + KEYWORD1 void KEYWORD2 NAME(Uniform2ivARB)(GLint location, GLsizei count, const GLint * value) { DISPATCH(Uniform2ivARB, (location, count, value), (F, "glUniform2ivARB(%d, %d, %p);\n", location, count, (const void *) value)); } -KEYWORD1 void KEYWORD2 NAME(Uniform3fARB)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2) +KEYWORD1 void KEYWORD2 NAME(Uniform3f)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2) { - DISPATCH(Uniform3fARB, (location, v0, v1, v2), (F, "glUniform3fARB(%d, %f, %f, %f);\n", location, v0, v1, v2)); + DISPATCH(Uniform3fARB, (location, v0, v1, v2), (F, "glUniform3f(%d, %f, %f, %f);\n", location, v0, v1, v2)); } -KEYWORD1 void KEYWORD2 NAME(Uniform3fvARB)(GLint location, GLsizei count, const GLfloat * value) +KEYWORD1 void KEYWORD2 NAME(Uniform3fARB)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2) { - DISPATCH(Uniform3fvARB, (location, count, value), (F, "glUniform3fvARB(%d, %d, %p);\n", location, count, (const void *) value)); + DISPATCH(Uniform3fARB, (location, v0, v1, v2), (F, "glUniform3fARB(%d, %f, %f, %f);\n", location, v0, v1, v2)); } -KEYWORD1 void KEYWORD2 NAME(Uniform3iARB)(GLint location, GLint v0, GLint v1, GLint v2) +KEYWORD1 void KEYWORD2 NAME(Uniform3fv)(GLint location, GLsizei count, const GLfloat * value) { - DISPATCH(Uniform3iARB, (location, v0, v1, v2), (F, "glUniform3iARB(%d, %d, %d, %d);\n", location, v0, v1, v2)); + DISPATCH(Uniform3fvARB, (location, count, value), (F, "glUniform3fv(%d, %d, %p);\n", location, count, (const void *) value)); } -KEYWORD1 void KEYWORD2 NAME(Uniform3ivARB)(GLint location, GLsizei count, const GLint * value) +KEYWORD1 void KEYWORD2 NAME(Uniform3fvARB)(GLint location, GLsizei count, const GLfloat * value) { - DISPATCH(Uniform3ivARB, (location, count, value), (F, "glUniform3ivARB(%d, %d, %p);\n", location, count, (const void *) value)); + DISPATCH(Uniform3fvARB, (location, count, value), (F, "glUniform3fvARB(%d, %d, %p);\n", location, count, (const void *) value)); } -KEYWORD1 void KEYWORD2 NAME(Uniform4fARB)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3) +KEYWORD1 void KEYWORD2 NAME(Uniform3i)(GLint location, GLint v0, GLint v1, GLint v2) { - DISPATCH(Uniform4fARB, (location, v0, v1, v2, v3), (F, "glUniform4fARB(%d, %f, %f, %f, %f);\n", location, v0, v1, v2, v3)); + DISPATCH(Uniform3iARB, (location, v0, v1, v2), (F, "glUniform3i(%d, %d, %d, %d);\n", location, v0, v1, v2)); } -KEYWORD1 void KEYWORD2 NAME(Uniform4fvARB)(GLint location, GLsizei count, const GLfloat * value) +KEYWORD1 void KEYWORD2 NAME(Uniform3iARB)(GLint location, GLint v0, GLint v1, GLint v2) { - DISPATCH(Uniform4fvARB, (location, count, value), (F, "glUniform4fvARB(%d, %d, %p);\n", location, count, (const void *) value)); + DISPATCH(Uniform3iARB, (location, v0, v1, v2), (F, "glUniform3iARB(%d, %d, %d, %d);\n", location, v0, v1, v2)); } -KEYWORD1 void KEYWORD2 NAME(Uniform4iARB)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3) +KEYWORD1 void KEYWORD2 NAME(Uniform3iv)(GLint location, GLsizei count, const GLint * value) { - DISPATCH(Uniform4iARB, (location, v0, v1, v2, v3), (F, "glUniform4iARB(%d, %d, %d, %d, %d);\n", location, v0, v1, v2, v3)); + DISPATCH(Uniform3ivARB, (location, count, value), (F, "glUniform3iv(%d, %d, %p);\n", location, count, (const void *) value)); } -KEYWORD1 void KEYWORD2 NAME(Uniform4ivARB)(GLint location, GLsizei count, const GLint * value) +KEYWORD1 void KEYWORD2 NAME(Uniform3ivARB)(GLint location, GLsizei count, const GLint * value) { - DISPATCH(Uniform4ivARB, (location, count, value), (F, "glUniform4ivARB(%d, %d, %p);\n", location, count, (const void *) value)); + DISPATCH(Uniform3ivARB, (location, count, value), (F, "glUniform3ivARB(%d, %d, %p);\n", location, count, (const void *) value)); } -KEYWORD1 void KEYWORD2 NAME(UniformMatrix2fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) +KEYWORD1 void KEYWORD2 NAME(Uniform4f)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3) { - DISPATCH(UniformMatrix2fvARB, (location, count, transpose, value), (F, "glUniformMatrix2fvARB(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value)); + DISPATCH(Uniform4fARB, (location, v0, v1, v2, v3), (F, "glUniform4f(%d, %f, %f, %f, %f);\n", location, v0, v1, v2, v3)); } -KEYWORD1 void KEYWORD2 NAME(UniformMatrix3fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) +KEYWORD1 void KEYWORD2 NAME(Uniform4fARB)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3) { - DISPATCH(UniformMatrix3fvARB, (location, count, transpose, value), (F, "glUniformMatrix3fvARB(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value)); + DISPATCH(Uniform4fARB, (location, v0, v1, v2, v3), (F, "glUniform4fARB(%d, %f, %f, %f, %f);\n", location, v0, v1, v2, v3)); } -KEYWORD1 void KEYWORD2 NAME(UniformMatrix4fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) +KEYWORD1 void KEYWORD2 NAME(Uniform4fv)(GLint location, GLsizei count, const GLfloat * value) { - DISPATCH(UniformMatrix4fvARB, (location, count, transpose, value), (F, "glUniformMatrix4fvARB(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value)); + DISPATCH(Uniform4fvARB, (location, count, value), (F, "glUniform4fv(%d, %d, %p);\n", location, count, (const void *) value)); } -KEYWORD1 void KEYWORD2 NAME(UseProgramObjectARB)(GLhandleARB programObj) +KEYWORD1 void KEYWORD2 NAME(Uniform4fvARB)(GLint location, GLsizei count, const GLfloat * value) { - DISPATCH(UseProgramObjectARB, (programObj), (F, "glUseProgramObjectARB(%d);\n", programObj)); + DISPATCH(Uniform4fvARB, (location, count, value), (F, "glUniform4fvARB(%d, %d, %p);\n", location, count, (const void *) value)); } -KEYWORD1 void KEYWORD2 NAME(ValidateProgramARB)(GLhandleARB programObj) +KEYWORD1 void KEYWORD2 NAME(Uniform4i)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3) { - DISPATCH(ValidateProgramARB, (programObj), (F, "glValidateProgramARB(%d);\n", programObj)); + DISPATCH(Uniform4iARB, (location, v0, v1, v2, v3), (F, "glUniform4i(%d, %d, %d, %d, %d);\n", location, v0, v1, v2, v3)); } -KEYWORD1 void KEYWORD2 NAME(BindAttribLocationARB)(GLhandleARB programObj, GLuint index, const GLcharARB * name) +KEYWORD1 void KEYWORD2 NAME(Uniform4iARB)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3) { - DISPATCH(BindAttribLocationARB, (programObj, index, name), (F, "glBindAttribLocationARB(%d, %d, %p);\n", programObj, index, (const void *) name)); + DISPATCH(Uniform4iARB, (location, v0, v1, v2, v3), (F, "glUniform4iARB(%d, %d, %d, %d, %d);\n", location, v0, v1, v2, v3)); } -KEYWORD1 void KEYWORD2 NAME(GetActiveAttribARB)(GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei * length, GLint * size, GLenum * type, GLcharARB * name) +KEYWORD1 void KEYWORD2 NAME(Uniform4iv)(GLint location, GLsizei count, const GLint * value) { - DISPATCH(GetActiveAttribARB, (programObj, index, maxLength, length, size, type, name), (F, "glGetActiveAttribARB(%d, %d, %d, %p, %p, %p, %p);\n", programObj, index, maxLength, (const void *) length, (const void *) size, (const void *) type, (const void *) name)); + DISPATCH(Uniform4ivARB, (location, count, value), (F, "glUniform4iv(%d, %d, %p);\n", location, count, (const void *) value)); } -KEYWORD1 GLint KEYWORD2 NAME(GetAttribLocationARB)(GLhandleARB programObj, const GLcharARB * name) +KEYWORD1 void KEYWORD2 NAME(Uniform4ivARB)(GLint location, GLsizei count, const GLint * value) { - RETURN_DISPATCH(GetAttribLocationARB, (programObj, name), (F, "glGetAttribLocationARB(%d, %p);\n", programObj, (const void *) name)); + DISPATCH(Uniform4ivARB, (location, count, value), (F, "glUniform4ivARB(%d, %d, %p);\n", location, count, (const void *) value)); } -KEYWORD1 void KEYWORD2 NAME(DrawBuffers)(GLsizei n, const GLenum * bufs) +KEYWORD1 void KEYWORD2 NAME(UniformMatrix2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) { - DISPATCH(DrawBuffersARB, (n, bufs), (F, "glDrawBuffers(%d, %p);\n", n, (const void *) bufs)); + DISPATCH(UniformMatrix2fvARB, (location, count, transpose, value), (F, "glUniformMatrix2fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value)); } -KEYWORD1 void KEYWORD2 NAME(DrawBuffersARB)(GLsizei n, const GLenum * bufs) +KEYWORD1 void KEYWORD2 NAME(UniformMatrix2fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) { - DISPATCH(DrawBuffersARB, (n, bufs), (F, "glDrawBuffersARB(%d, %p);\n", n, (const void *) bufs)); + DISPATCH(UniformMatrix2fvARB, (location, count, transpose, value), (F, "glUniformMatrix2fvARB(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value)); } -KEYWORD1 void KEYWORD2 NAME(DrawBuffersATI)(GLsizei n, const GLenum * bufs) +KEYWORD1 void KEYWORD2 NAME(UniformMatrix3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) { - DISPATCH(DrawBuffersARB, (n, bufs), (F, "glDrawBuffersATI(%d, %p);\n", n, (const void *) bufs)); + DISPATCH(UniformMatrix3fvARB, (location, count, transpose, value), (F, "glUniformMatrix3fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value)); } -KEYWORD1 void KEYWORD2 NAME(PolygonOffsetEXT)(GLfloat factor, GLfloat bias) +KEYWORD1 void KEYWORD2 NAME(UniformMatrix3fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) { - DISPATCH(PolygonOffsetEXT, (factor, bias), (F, "glPolygonOffsetEXT(%f, %f);\n", factor, bias)); + DISPATCH(UniformMatrix3fvARB, (location, count, transpose, value), (F, "glUniformMatrix3fvARB(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_543)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_543)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values) +KEYWORD1 void KEYWORD2 NAME(UniformMatrix4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) { - DISPATCH(GetHistogramEXT, (target, reset, format, type, values), (F, "glGetHistogramEXT(0x%x, %d, 0x%x, 0x%x, %p);\n", target, reset, format, type, (const void *) values)); + DISPATCH(UniformMatrix4fvARB, (location, count, transpose, value), (F, "glUniformMatrix4fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_544)(GLenum target, GLenum pname, GLfloat * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_544)(GLenum target, GLenum pname, GLfloat * params) +KEYWORD1 void KEYWORD2 NAME(UniformMatrix4fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) { - DISPATCH(GetHistogramParameterfvEXT, (target, pname, params), (F, "glGetHistogramParameterfvEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); + DISPATCH(UniformMatrix4fvARB, (location, count, transpose, value), (F, "glUniformMatrix4fvARB(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_545)(GLenum target, GLenum pname, GLint * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_545)(GLenum target, GLenum pname, GLint * params) +KEYWORD1 void KEYWORD2 NAME(UseProgram)(GLuint program) { - DISPATCH(GetHistogramParameterivEXT, (target, pname, params), (F, "glGetHistogramParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); + DISPATCH(UseProgramObjectARB, (program), (F, "glUseProgram(%d);\n", program)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_546)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_546)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values) +KEYWORD1 void KEYWORD2 NAME(UseProgramObjectARB)(GLhandleARB program) { - DISPATCH(GetMinmaxEXT, (target, reset, format, type, values), (F, "glGetMinmaxEXT(0x%x, %d, 0x%x, 0x%x, %p);\n", target, reset, format, type, (const void *) values)); + DISPATCH(UseProgramObjectARB, (program), (F, "glUseProgramObjectARB(%d);\n", program)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_547)(GLenum target, GLenum pname, GLfloat * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_547)(GLenum target, GLenum pname, GLfloat * params) +KEYWORD1 void KEYWORD2 NAME(ValidateProgram)(GLuint program) { - DISPATCH(GetMinmaxParameterfvEXT, (target, pname, params), (F, "glGetMinmaxParameterfvEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); + DISPATCH(ValidateProgramARB, (program), (F, "glValidateProgram(%d);\n", program)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_548)(GLenum target, GLenum pname, GLint * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_548)(GLenum target, GLenum pname, GLint * params) +KEYWORD1 void KEYWORD2 NAME(ValidateProgramARB)(GLhandleARB program) { - DISPATCH(GetMinmaxParameterivEXT, (target, pname, params), (F, "glGetMinmaxParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); + DISPATCH(ValidateProgramARB, (program), (F, "glValidateProgramARB(%d);\n", program)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_549)(GLenum target, GLenum format, GLenum type, GLvoid * image); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_549)(GLenum target, GLenum format, GLenum type, GLvoid * image) +KEYWORD1 void KEYWORD2 NAME(BindAttribLocation)(GLuint program, GLuint index, const GLchar * name) { - DISPATCH(GetConvolutionFilterEXT, (target, format, type, image), (F, "glGetConvolutionFilterEXT(0x%x, 0x%x, 0x%x, %p);\n", target, format, type, (const void *) image)); + DISPATCH(BindAttribLocationARB, (program, index, name), (F, "glBindAttribLocation(%d, %d, %p);\n", program, index, (const void *) name)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_550)(GLenum target, GLenum pname, GLfloat * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_550)(GLenum target, GLenum pname, GLfloat * params) +KEYWORD1 void KEYWORD2 NAME(BindAttribLocationARB)(GLhandleARB program, GLuint index, const GLcharARB * name) { - DISPATCH(GetConvolutionParameterfvEXT, (target, pname, params), (F, "glGetConvolutionParameterfvEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); + DISPATCH(BindAttribLocationARB, (program, index, name), (F, "glBindAttribLocationARB(%d, %d, %p);\n", program, index, (const void *) name)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_551)(GLenum target, GLenum pname, GLint * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_551)(GLenum target, GLenum pname, GLint * params) +KEYWORD1 void KEYWORD2 NAME(GetActiveAttrib)(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLchar * name) { - DISPATCH(GetConvolutionParameterivEXT, (target, pname, params), (F, "glGetConvolutionParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); + DISPATCH(GetActiveAttribARB, (program, index, bufSize, length, size, type, name), (F, "glGetActiveAttrib(%d, %d, %d, %p, %p, %p, %p);\n", program, index, bufSize, (const void *) length, (const void *) size, (const void *) type, (const void *) name)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_552)(GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_552)(GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span) +KEYWORD1 void KEYWORD2 NAME(GetActiveAttribARB)(GLhandleARB program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLcharARB * name) { - DISPATCH(GetSeparableFilterEXT, (target, format, type, row, column, span), (F, "glGetSeparableFilterEXT(0x%x, 0x%x, 0x%x, %p, %p, %p);\n", target, format, type, (const void *) row, (const void *) column, (const void *) span)); + DISPATCH(GetActiveAttribARB, (program, index, bufSize, length, size, type, name), (F, "glGetActiveAttribARB(%d, %d, %d, %p, %p, %p, %p);\n", program, index, bufSize, (const void *) length, (const void *) size, (const void *) type, (const void *) name)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_553)(GLenum target, GLenum pname, GLfloat * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_553)(GLenum target, GLenum pname, GLfloat * params) +KEYWORD1 GLint KEYWORD2 NAME(GetAttribLocation)(GLuint program, const GLchar * name) { - DISPATCH(GetColorTableParameterfvSGI, (target, pname, params), (F, "glGetColorTableParameterfvSGI(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); + RETURN_DISPATCH(GetAttribLocationARB, (program, name), (F, "glGetAttribLocation(%d, %p);\n", program, (const void *) name)); } -KEYWORD1 void KEYWORD2 NAME(GetColorTableParameterfvEXT)(GLenum target, GLenum pname, GLfloat * params) +KEYWORD1 GLint KEYWORD2 NAME(GetAttribLocationARB)(GLhandleARB program, const GLcharARB * name) { - DISPATCH(GetColorTableParameterfvSGI, (target, pname, params), (F, "glGetColorTableParameterfvEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); + RETURN_DISPATCH(GetAttribLocationARB, (program, name), (F, "glGetAttribLocationARB(%d, %p);\n", program, (const void *) name)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_554)(GLenum target, GLenum pname, GLint * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_554)(GLenum target, GLenum pname, GLint * params) +KEYWORD1 void KEYWORD2 NAME(DrawBuffers)(GLsizei n, const GLenum * bufs) { - DISPATCH(GetColorTableParameterivSGI, (target, pname, params), (F, "glGetColorTableParameterivSGI(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); + DISPATCH(DrawBuffersARB, (n, bufs), (F, "glDrawBuffers(%d, %p);\n", n, (const void *) bufs)); } -KEYWORD1 void KEYWORD2 NAME(GetColorTableParameterivEXT)(GLenum target, GLenum pname, GLint * params) +KEYWORD1 void KEYWORD2 NAME(DrawBuffersARB)(GLsizei n, const GLenum * bufs) { - DISPATCH(GetColorTableParameterivSGI, (target, pname, params), (F, "glGetColorTableParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); + DISPATCH(DrawBuffersARB, (n, bufs), (F, "glDrawBuffersARB(%d, %p);\n", n, (const void *) bufs)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_555)(GLenum target, GLenum format, GLenum type, GLvoid * table); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_555)(GLenum target, GLenum format, GLenum type, GLvoid * table) +KEYWORD1 void KEYWORD2 NAME(DrawBuffersATI)(GLsizei n, const GLenum * bufs) { - DISPATCH(GetColorTableSGI, (target, format, type, table), (F, "glGetColorTableSGI(0x%x, 0x%x, 0x%x, %p);\n", target, format, type, (const void *) table)); + DISPATCH(DrawBuffersARB, (n, bufs), (F, "glDrawBuffersATI(%d, %p);\n", n, (const void *) bufs)); } -KEYWORD1 void KEYWORD2 NAME(GetColorTableEXT)(GLenum target, GLenum format, GLenum type, GLvoid * table) +KEYWORD1 void KEYWORD2 NAME(PolygonOffsetEXT)(GLfloat factor, GLfloat bias) { - DISPATCH(GetColorTableSGI, (target, format, type, table), (F, "glGetColorTableEXT(0x%x, 0x%x, 0x%x, %p);\n", target, format, type, (const void *) table)); + DISPATCH(PolygonOffsetEXT, (factor, bias), (F, "glPolygonOffsetEXT(%f, %f);\n", factor, bias)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_556)(GLenum pname, GLfloat * params); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_562)(GLenum pname, GLfloat * params); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_556)(GLenum pname, GLfloat * params) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_562)(GLenum pname, GLfloat * params) { DISPATCH(GetPixelTexGenParameterfvSGIS, (pname, params), (F, "glGetPixelTexGenParameterfvSGIS(0x%x, %p);\n", pname, (const void *) params)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_557)(GLenum pname, GLint * params); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_563)(GLenum pname, GLint * params); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_557)(GLenum pname, GLint * params) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_563)(GLenum pname, GLint * params) { DISPATCH(GetPixelTexGenParameterivSGIS, (pname, params), (F, "glGetPixelTexGenParameterivSGIS(0x%x, %p);\n", pname, (const void *) params)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_558)(GLenum pname, GLfloat param); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_564)(GLenum pname, GLfloat param); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_558)(GLenum pname, GLfloat param) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_564)(GLenum pname, GLfloat param) { DISPATCH(PixelTexGenParameterfSGIS, (pname, param), (F, "glPixelTexGenParameterfSGIS(0x%x, %f);\n", pname, param)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_559)(GLenum pname, const GLfloat * params); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_565)(GLenum pname, const GLfloat * params); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_559)(GLenum pname, const GLfloat * params) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_565)(GLenum pname, const GLfloat * params) { DISPATCH(PixelTexGenParameterfvSGIS, (pname, params), (F, "glPixelTexGenParameterfvSGIS(0x%x, %p);\n", pname, (const void *) params)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_560)(GLenum pname, GLint param); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_566)(GLenum pname, GLint param); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_560)(GLenum pname, GLint param) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_566)(GLenum pname, GLint param) { DISPATCH(PixelTexGenParameteriSGIS, (pname, param), (F, "glPixelTexGenParameteriSGIS(0x%x, %d);\n", pname, param)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_561)(GLenum pname, const GLint * params); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_567)(GLenum pname, const GLint * params); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_561)(GLenum pname, const GLint * params) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_567)(GLenum pname, const GLint * params) { DISPATCH(PixelTexGenParameterivSGIS, (pname, params), (F, "glPixelTexGenParameterivSGIS(0x%x, %p);\n", pname, (const void *) params)); } -KEYWORD1 GLboolean KEYWORD2 NAME(AreTexturesResidentEXT)(GLsizei n, const GLuint * textures, GLboolean * residences) -{ - RETURN_DISPATCH(AreTexturesResidentEXT, (n, textures, residences), (F, "glAreTexturesResidentEXT(%d, %p, %p);\n", n, (const void *) textures, (const void *) residences)); -} +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_568)(GLclampf value, GLboolean invert); -KEYWORD1 void KEYWORD2 NAME(GenTexturesEXT)(GLsizei n, GLuint * textures) -{ - DISPATCH(GenTexturesEXT, (n, textures), (F, "glGenTexturesEXT(%d, %p);\n", n, (const void *) textures)); -} - -KEYWORD1 GLboolean KEYWORD2 NAME(IsTextureEXT)(GLuint texture) -{ - RETURN_DISPATCH(IsTextureEXT, (texture), (F, "glIsTextureEXT(%d);\n", texture)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_565)(GLclampf value, GLboolean invert); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_565)(GLclampf value, GLboolean invert) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_568)(GLclampf value, GLboolean invert) { DISPATCH(SampleMaskSGIS, (value, invert), (F, "glSampleMaskSGIS(%f, %d);\n", value, invert)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_566)(GLenum pattern); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_569)(GLenum pattern); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_566)(GLenum pattern) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_569)(GLenum pattern) { DISPATCH(SamplePatternSGIS, (pattern), (F, "glSamplePatternSGIS(0x%x);\n", pattern)); } @@ -3580,9 +4060,9 @@ KEYWORD1 void KEYWORD2 NAME(PointParameterfEXT)(GLenum pname, GLfloat param) DISPATCH(PointParameterfEXT, (pname, param), (F, "glPointParameterfEXT(0x%x, %f);\n", pname, param)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_573)(GLenum pname, GLfloat param); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_576)(GLenum pname, GLfloat param); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_573)(GLenum pname, GLfloat param) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_576)(GLenum pname, GLfloat param) { DISPATCH(PointParameterfEXT, (pname, param), (F, "glPointParameterfSGIS(0x%x, %f);\n", pname, param)); } @@ -3602,9 +4082,9 @@ KEYWORD1 void KEYWORD2 NAME(PointParameterfvEXT)(GLenum pname, const GLfloat * p DISPATCH(PointParameterfvEXT, (pname, params), (F, "glPointParameterfvEXT(0x%x, %p);\n", pname, (const void *) params)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_574)(GLenum pname, const GLfloat * params); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_577)(GLenum pname, const GLfloat * params); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_574)(GLenum pname, const GLfloat * params) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_577)(GLenum pname, const GLfloat * params) { DISPATCH(PointParameterfvEXT, (pname, params), (F, "glPointParameterfvSGIS(0x%x, %p);\n", pname, (const void *) params)); } @@ -3619,16 +4099,16 @@ KEYWORD1 void KEYWORD2 NAME(UnlockArraysEXT)(void) DISPATCH(UnlockArraysEXT, (), (F, "glUnlockArraysEXT();\n")); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_577)(GLenum pname, GLdouble * params); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_580)(GLenum pname, GLdouble * params); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_577)(GLenum pname, GLdouble * params) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_580)(GLenum pname, GLdouble * params) { DISPATCH(CullParameterdvEXT, (pname, params), (F, "glCullParameterdvEXT(0x%x, %p);\n", pname, (const void *) params)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_578)(GLenum pname, GLfloat * params); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_581)(GLenum pname, GLfloat * params); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_578)(GLenum pname, GLfloat * params) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_581)(GLenum pname, GLfloat * params) { DISPATCH(CullParameterfvEXT, (pname, params), (F, "glCullParameterfvEXT(0x%x, %p);\n", pname, (const void *) params)); } @@ -3873,9 +4353,9 @@ KEYWORD1 void KEYWORD2 NAME(FogCoordfvEXT)(const GLfloat * coord) DISPATCH(FogCoordfvEXT, (coord), (F, "glFogCoordfvEXT(%p);\n", (const void *) coord)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_603)(GLenum mode); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_606)(GLenum mode); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_603)(GLenum mode) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_606)(GLenum mode) { DISPATCH(PixelTexGenSGIX, (mode), (F, "glPixelTexGenSGIX(0x%x);\n", mode)); } @@ -3890,9 +4370,9 @@ KEYWORD1 void KEYWORD2 NAME(BlendFuncSeparateEXT)(GLenum sfactorRGB, GLenum dfac DISPATCH(BlendFuncSeparateEXT, (sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha), (F, "glBlendFuncSeparateEXT(0x%x, 0x%x, 0x%x, 0x%x);\n", sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_604)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_607)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_604)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_607)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha) { DISPATCH(BlendFuncSeparateEXT, (sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha), (F, "glBlendFuncSeparateINGR(0x%x, 0x%x, 0x%x, 0x%x);\n", sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha)); } @@ -4257,65 +4737,65 @@ KEYWORD1 void KEYWORD2 NAME(WindowPos4svMESA)(const GLshort * v) DISPATCH(WindowPos4svMESA, (v), (F, "glWindowPos4svMESA(%p);\n", (const void *) v)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_645)(const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_648)(const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_645)(const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_648)(const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride) { DISPATCH(MultiModeDrawArraysIBM, (mode, first, count, primcount, modestride), (F, "glMultiModeDrawArraysIBM(%p, %p, %p, %d, %d);\n", (const void *) mode, (const void *) first, (const void *) count, primcount, modestride)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_646)(const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount, GLint modestride); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_649)(const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount, GLint modestride); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_646)(const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount, GLint modestride) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_649)(const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount, GLint modestride) { DISPATCH(MultiModeDrawElementsIBM, (mode, count, type, indices, primcount, modestride), (F, "glMultiModeDrawElementsIBM(%p, %p, 0x%x, %p, %d, %d);\n", (const void *) mode, (const void *) count, type, (const void *) indices, primcount, modestride)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_647)(GLsizei n, const GLuint * fences); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_650)(GLsizei n, const GLuint * fences); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_647)(GLsizei n, const GLuint * fences) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_650)(GLsizei n, const GLuint * fences) { DISPATCH(DeleteFencesNV, (n, fences), (F, "glDeleteFencesNV(%d, %p);\n", n, (const void *) fences)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_648)(GLuint fence); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_651)(GLuint fence); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_648)(GLuint fence) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_651)(GLuint fence) { DISPATCH(FinishFenceNV, (fence), (F, "glFinishFenceNV(%d);\n", fence)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_649)(GLsizei n, GLuint * fences); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_652)(GLsizei n, GLuint * fences); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_649)(GLsizei n, GLuint * fences) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_652)(GLsizei n, GLuint * fences) { DISPATCH(GenFencesNV, (n, fences), (F, "glGenFencesNV(%d, %p);\n", n, (const void *) fences)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_650)(GLuint fence, GLenum pname, GLint * params); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_653)(GLuint fence, GLenum pname, GLint * params); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_650)(GLuint fence, GLenum pname, GLint * params) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_653)(GLuint fence, GLenum pname, GLint * params) { DISPATCH(GetFenceivNV, (fence, pname, params), (F, "glGetFenceivNV(%d, 0x%x, %p);\n", fence, pname, (const void *) params)); } -KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_651)(GLuint fence); +KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_654)(GLuint fence); -KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_651)(GLuint fence) +KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_654)(GLuint fence) { RETURN_DISPATCH(IsFenceNV, (fence), (F, "glIsFenceNV(%d);\n", fence)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_652)(GLuint fence, GLenum condition); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_655)(GLuint fence, GLenum condition); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_652)(GLuint fence, GLenum condition) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_655)(GLuint fence, GLenum condition) { DISPATCH(SetFenceNV, (fence, condition), (F, "glSetFenceNV(%d, 0x%x);\n", fence, condition)); } -KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_653)(GLuint fence); +KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_656)(GLuint fence); -KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_653)(GLuint fence) +KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_656)(GLuint fence) { RETURN_DISPATCH(TestFenceNV, (fence), (F, "glTestFenceNV(%d);\n", fence)); } @@ -4755,37 +5235,37 @@ KEYWORD1 void KEYWORD2 NAME(PointParameterivNV)(GLenum pname, const GLint * para DISPATCH(PointParameterivNV, (pname, params), (F, "glPointParameterivNV(0x%x, %p);\n", pname, (const void *) params)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_734)(GLenum face); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_737)(GLenum face); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_734)(GLenum face) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_737)(GLenum face) { DISPATCH(ActiveStencilFaceEXT, (face), (F, "glActiveStencilFaceEXT(0x%x);\n", face)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_735)(GLuint array); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_738)(GLuint array); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_735)(GLuint array) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_738)(GLuint array) { DISPATCH(BindVertexArrayAPPLE, (array), (F, "glBindVertexArrayAPPLE(%d);\n", array)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_736)(GLsizei n, const GLuint * arrays); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_739)(GLsizei n, const GLuint * arrays); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_736)(GLsizei n, const GLuint * arrays) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_739)(GLsizei n, const GLuint * arrays) { DISPATCH(DeleteVertexArraysAPPLE, (n, arrays), (F, "glDeleteVertexArraysAPPLE(%d, %p);\n", n, (const void *) arrays)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_737)(GLsizei n, GLuint * arrays); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_740)(GLsizei n, GLuint * arrays); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_737)(GLsizei n, GLuint * arrays) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_740)(GLsizei n, GLuint * arrays) { DISPATCH(GenVertexArraysAPPLE, (n, arrays), (F, "glGenVertexArraysAPPLE(%d, %p);\n", n, (const void *) arrays)); } -KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_738)(GLuint array); +KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_741)(GLuint array); -KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_738)(GLuint array) +KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_741)(GLuint array) { RETURN_DISPATCH(IsVertexArrayAPPLE, (array), (F, "glIsVertexArrayAPPLE(%d);\n", array)); } @@ -4820,9 +5300,9 @@ KEYWORD1 void KEYWORD2 NAME(ProgramNamedParameter4fvNV)(GLuint id, GLsizei len, DISPATCH(ProgramNamedParameter4fvNV, (id, len, name, v), (F, "glProgramNamedParameter4fvNV(%d, %d, %p, %p);\n", id, len, (const void *) name, (const void *) v)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_745)(GLclampd zmin, GLclampd zmax); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_748)(GLclampd zmin, GLclampd zmax); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_745)(GLclampd zmin, GLclampd zmax) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_748)(GLclampd zmin, GLclampd zmax) { DISPATCH(DepthBoundsEXT, (zmin, zmax), (F, "glDepthBoundsEXT(%f, %f);\n", zmin, zmax)); } @@ -4832,9 +5312,9 @@ KEYWORD1 void KEYWORD2 NAME(BlendEquationSeparate)(GLenum modeRGB, GLenum modeA) DISPATCH(BlendEquationSeparateEXT, (modeRGB, modeA), (F, "glBlendEquationSeparate(0x%x, 0x%x);\n", modeRGB, modeA)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_746)(GLenum modeRGB, GLenum modeA); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_749)(GLenum modeRGB, GLenum modeA); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_746)(GLenum modeRGB, GLenum modeA) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_749)(GLenum modeRGB, GLenum modeA) { DISPATCH(BlendEquationSeparateEXT, (modeRGB, modeA), (F, "glBlendEquationSeparateEXT(0x%x, 0x%x);\n", modeRGB, modeA)); } @@ -4904,20 +5384,6 @@ KEYWORD1 void KEYWORD2 NAME(GetFramebufferAttachmentParameterivEXT)(GLenum targe DISPATCH(GetFramebufferAttachmentParameterivEXT, (target, attachment, pname, params), (F, "glGetFramebufferAttachmentParameterivEXT(0x%x, 0x%x, 0x%x, %p);\n", target, attachment, pname, (const void *) params)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_760)(GLuint id, GLenum pname, GLint64EXT * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_760)(GLuint id, GLenum pname, GLint64EXT * params) -{ - DISPATCH(GetQueryObjecti64vEXT, (id, pname, params), (F, "glGetQueryObjecti64vEXT(%d, 0x%x, %p);\n", id, pname, (const void *) params)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_761)(GLuint id, GLenum pname, GLuint64EXT * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_761)(GLuint id, GLenum pname, GLuint64EXT * params) -{ - DISPATCH(GetQueryObjectui64vEXT, (id, pname, params), (F, "glGetQueryObjectui64vEXT(%d, 0x%x, %p);\n", id, pname, (const void *) params)); -} - KEYWORD1 void KEYWORD2 NAME(GetRenderbufferParameterivEXT)(GLenum target, GLenum pname, GLint * params) { DISPATCH(GetRenderbufferParameterivEXT, (target, pname, params), (F, "glGetRenderbufferParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); @@ -4938,27 +5404,41 @@ KEYWORD1 void KEYWORD2 NAME(RenderbufferStorageEXT)(GLenum target, GLenum intern DISPATCH(RenderbufferStorageEXT, (target, internalformat, width, height), (F, "glRenderbufferStorageEXT(0x%x, 0x%x, %d, %d);\n", target, internalformat, width, height)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_766)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_767)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_766)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_767)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) { DISPATCH(BlitFramebufferEXT, (srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter), (F, "glBlitFramebufferEXT(%d, %d, %d, %d, %d, %d, %d, %d, %d, 0x%x);\n", srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_767)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_768)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_767)(GLenum target, GLuint index, GLsizei count, const GLfloat * params) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_768)(GLenum target, GLuint index, GLsizei count, const GLfloat * params) { DISPATCH(ProgramEnvParameters4fvEXT, (target, index, count, params), (F, "glProgramEnvParameters4fvEXT(0x%x, %d, %d, %p);\n", target, index, count, (const void *) params)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_768)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_769)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_768)(GLenum target, GLuint index, GLsizei count, const GLfloat * params) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_769)(GLenum target, GLuint index, GLsizei count, const GLfloat * params) { DISPATCH(ProgramLocalParameters4fvEXT, (target, index, count, params), (F, "glProgramLocalParameters4fvEXT(0x%x, %d, %d, %p);\n", target, index, count, (const void *) params)); } +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_770)(GLuint id, GLenum pname, GLint64EXT * params); + +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_770)(GLuint id, GLenum pname, GLint64EXT * params) +{ + DISPATCH(GetQueryObjecti64vEXT, (id, pname, params), (F, "glGetQueryObjecti64vEXT(%d, 0x%x, %p);\n", id, pname, (const void *) params)); +} + +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_771)(GLuint id, GLenum pname, GLuint64EXT * params); + +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_771)(GLuint id, GLenum pname, GLuint64EXT * params) +{ + DISPATCH(GetQueryObjectui64vEXT, (id, pname, params), (F, "glGetQueryObjectui64vEXT(%d, 0x%x, %p);\n", id, pname, (const void *) params)); +} + #endif /* defined( NAME ) */ @@ -5381,9 +5861,28 @@ static _glapi_proc DISPATCH_TABLE_NAME[] = { TABLE_ENTRY(MultiTexCoord4ivARB), TABLE_ENTRY(MultiTexCoord4sARB), TABLE_ENTRY(MultiTexCoord4svARB), + TABLE_ENTRY(AttachShader), + TABLE_ENTRY(CreateProgram), + TABLE_ENTRY(CreateShader), + TABLE_ENTRY(DeleteProgram), + TABLE_ENTRY(DeleteShader), + TABLE_ENTRY(DetachShader), + TABLE_ENTRY(GetAttachedShaders), + TABLE_ENTRY(GetProgramInfoLog), + TABLE_ENTRY(GetProgramiv), + TABLE_ENTRY(GetShaderInfoLog), + TABLE_ENTRY(GetShaderiv), + TABLE_ENTRY(IsProgram), + TABLE_ENTRY(IsShader), TABLE_ENTRY(StencilFuncSeparate), TABLE_ENTRY(StencilMaskSeparate), TABLE_ENTRY(StencilOpSeparate), + TABLE_ENTRY(UniformMatrix2x3fv), + TABLE_ENTRY(UniformMatrix2x4fv), + TABLE_ENTRY(UniformMatrix3x2fv), + TABLE_ENTRY(UniformMatrix3x4fv), + TABLE_ENTRY(UniformMatrix4x2fv), + TABLE_ENTRY(UniformMatrix4x3fv), TABLE_ENTRY(LoadTransposeMatrixdARB), TABLE_ENTRY(LoadTransposeMatrixfARB), TABLE_ENTRY(MultTransposeMatrixdARB), @@ -5516,30 +6015,14 @@ static _glapi_proc DISPATCH_TABLE_NAME[] = { TABLE_ENTRY(GetAttribLocationARB), TABLE_ENTRY(DrawBuffersARB), TABLE_ENTRY(PolygonOffsetEXT), - TABLE_ENTRY(_dispatch_stub_543), - TABLE_ENTRY(_dispatch_stub_544), - TABLE_ENTRY(_dispatch_stub_545), - TABLE_ENTRY(_dispatch_stub_546), - TABLE_ENTRY(_dispatch_stub_547), - TABLE_ENTRY(_dispatch_stub_548), - TABLE_ENTRY(_dispatch_stub_549), - TABLE_ENTRY(_dispatch_stub_550), - TABLE_ENTRY(_dispatch_stub_551), - TABLE_ENTRY(_dispatch_stub_552), - TABLE_ENTRY(_dispatch_stub_553), - TABLE_ENTRY(_dispatch_stub_554), - TABLE_ENTRY(_dispatch_stub_555), - TABLE_ENTRY(_dispatch_stub_556), - TABLE_ENTRY(_dispatch_stub_557), - TABLE_ENTRY(_dispatch_stub_558), - TABLE_ENTRY(_dispatch_stub_559), - TABLE_ENTRY(_dispatch_stub_560), - TABLE_ENTRY(_dispatch_stub_561), - TABLE_ENTRY(AreTexturesResidentEXT), - TABLE_ENTRY(GenTexturesEXT), - TABLE_ENTRY(IsTextureEXT), + TABLE_ENTRY(_dispatch_stub_562), + TABLE_ENTRY(_dispatch_stub_563), + TABLE_ENTRY(_dispatch_stub_564), TABLE_ENTRY(_dispatch_stub_565), TABLE_ENTRY(_dispatch_stub_566), + TABLE_ENTRY(_dispatch_stub_567), + TABLE_ENTRY(_dispatch_stub_568), + TABLE_ENTRY(_dispatch_stub_569), TABLE_ENTRY(ColorPointerEXT), TABLE_ENTRY(EdgeFlagPointerEXT), TABLE_ENTRY(IndexPointerEXT), @@ -5550,8 +6033,8 @@ static _glapi_proc DISPATCH_TABLE_NAME[] = { TABLE_ENTRY(PointParameterfvEXT), TABLE_ENTRY(LockArraysEXT), TABLE_ENTRY(UnlockArraysEXT), - TABLE_ENTRY(_dispatch_stub_577), - TABLE_ENTRY(_dispatch_stub_578), + TABLE_ENTRY(_dispatch_stub_580), + TABLE_ENTRY(_dispatch_stub_581), TABLE_ENTRY(SecondaryColor3bEXT), TABLE_ENTRY(SecondaryColor3bvEXT), TABLE_ENTRY(SecondaryColor3dEXT), @@ -5576,7 +6059,7 @@ static _glapi_proc DISPATCH_TABLE_NAME[] = { TABLE_ENTRY(FogCoorddvEXT), TABLE_ENTRY(FogCoordfEXT), TABLE_ENTRY(FogCoordfvEXT), - TABLE_ENTRY(_dispatch_stub_603), + TABLE_ENTRY(_dispatch_stub_606), TABLE_ENTRY(BlendFuncSeparateEXT), TABLE_ENTRY(FlushVertexArrayRangeNV), TABLE_ENTRY(VertexArrayRangeNV), @@ -5618,15 +6101,15 @@ static _glapi_proc DISPATCH_TABLE_NAME[] = { TABLE_ENTRY(WindowPos4ivMESA), TABLE_ENTRY(WindowPos4sMESA), TABLE_ENTRY(WindowPos4svMESA), - TABLE_ENTRY(_dispatch_stub_645), - TABLE_ENTRY(_dispatch_stub_646), - TABLE_ENTRY(_dispatch_stub_647), TABLE_ENTRY(_dispatch_stub_648), TABLE_ENTRY(_dispatch_stub_649), TABLE_ENTRY(_dispatch_stub_650), TABLE_ENTRY(_dispatch_stub_651), TABLE_ENTRY(_dispatch_stub_652), TABLE_ENTRY(_dispatch_stub_653), + TABLE_ENTRY(_dispatch_stub_654), + TABLE_ENTRY(_dispatch_stub_655), + TABLE_ENTRY(_dispatch_stub_656), TABLE_ENTRY(AreProgramsResidentNV), TABLE_ENTRY(BindProgramNV), TABLE_ENTRY(DeleteProgramsNV), @@ -5707,19 +6190,19 @@ static _glapi_proc DISPATCH_TABLE_NAME[] = { TABLE_ENTRY(SetFragmentShaderConstantATI), TABLE_ENTRY(PointParameteriNV), TABLE_ENTRY(PointParameterivNV), - TABLE_ENTRY(_dispatch_stub_734), - TABLE_ENTRY(_dispatch_stub_735), - TABLE_ENTRY(_dispatch_stub_736), TABLE_ENTRY(_dispatch_stub_737), TABLE_ENTRY(_dispatch_stub_738), + TABLE_ENTRY(_dispatch_stub_739), + TABLE_ENTRY(_dispatch_stub_740), + TABLE_ENTRY(_dispatch_stub_741), TABLE_ENTRY(GetProgramNamedParameterdvNV), TABLE_ENTRY(GetProgramNamedParameterfvNV), TABLE_ENTRY(ProgramNamedParameter4dNV), TABLE_ENTRY(ProgramNamedParameter4dvNV), TABLE_ENTRY(ProgramNamedParameter4fNV), TABLE_ENTRY(ProgramNamedParameter4fvNV), - TABLE_ENTRY(_dispatch_stub_745), - TABLE_ENTRY(_dispatch_stub_746), + TABLE_ENTRY(_dispatch_stub_748), + TABLE_ENTRY(_dispatch_stub_749), TABLE_ENTRY(BindFramebufferEXT), TABLE_ENTRY(BindRenderbufferEXT), TABLE_ENTRY(CheckFramebufferStatusEXT), @@ -5733,15 +6216,15 @@ static _glapi_proc DISPATCH_TABLE_NAME[] = { TABLE_ENTRY(GenRenderbuffersEXT), TABLE_ENTRY(GenerateMipmapEXT), TABLE_ENTRY(GetFramebufferAttachmentParameterivEXT), - TABLE_ENTRY(_dispatch_stub_760), - TABLE_ENTRY(_dispatch_stub_761), TABLE_ENTRY(GetRenderbufferParameterivEXT), TABLE_ENTRY(IsFramebufferEXT), TABLE_ENTRY(IsRenderbufferEXT), TABLE_ENTRY(RenderbufferStorageEXT), - TABLE_ENTRY(_dispatch_stub_766), TABLE_ENTRY(_dispatch_stub_767), TABLE_ENTRY(_dispatch_stub_768), + TABLE_ENTRY(_dispatch_stub_769), + TABLE_ENTRY(_dispatch_stub_770), + TABLE_ENTRY(_dispatch_stub_771), /* A whole bunch of no-op functions. These might be called * when someone tries to call a dynamically-registered * extension function without a current rendering context. @@ -5858,12 +6341,23 @@ static _glapi_proc UNUSED_TABLE_NAME[] = { TABLE_ENTRY(ArrayElementEXT), TABLE_ENTRY(BindTextureEXT), TABLE_ENTRY(DrawArraysEXT), +#ifndef GLX_INDIRECT_RENDERING + TABLE_ENTRY(AreTexturesResidentEXT), +#endif TABLE_ENTRY(CopyTexImage1DEXT), TABLE_ENTRY(CopyTexImage2DEXT), TABLE_ENTRY(CopyTexSubImage1DEXT), TABLE_ENTRY(CopyTexSubImage2DEXT), +#ifndef GLX_INDIRECT_RENDERING TABLE_ENTRY(DeleteTexturesEXT), +#endif +#ifndef GLX_INDIRECT_RENDERING + TABLE_ENTRY(GenTexturesEXT), +#endif TABLE_ENTRY(GetPointervEXT), +#ifndef GLX_INDIRECT_RENDERING + TABLE_ENTRY(IsTextureEXT), +#endif TABLE_ENTRY(PrioritizeTexturesEXT), TABLE_ENTRY(TexSubImage1DEXT), TABLE_ENTRY(TexSubImage2DEXT), @@ -5871,6 +6365,15 @@ static _glapi_proc UNUSED_TABLE_NAME[] = { TABLE_ENTRY(BlendEquationEXT), TABLE_ENTRY(DrawRangeElementsEXT), TABLE_ENTRY(ColorTableEXT), +#ifndef GLX_INDIRECT_RENDERING + TABLE_ENTRY(GetColorTableEXT), +#endif +#ifndef GLX_INDIRECT_RENDERING + TABLE_ENTRY(GetColorTableParameterfvEXT), +#endif +#ifndef GLX_INDIRECT_RENDERING + TABLE_ENTRY(GetColorTableParameterivEXT), +#endif TABLE_ENTRY(TexImage3DEXT), TABLE_ENTRY(TexSubImage3DEXT), TABLE_ENTRY(CopyTexSubImage3DEXT), @@ -5920,6 +6423,43 @@ static _glapi_proc UNUSED_TABLE_NAME[] = { TABLE_ENTRY(CompressedTexSubImage2D), TABLE_ENTRY(CompressedTexSubImage3D), TABLE_ENTRY(GetCompressedTexImage), + TABLE_ENTRY(DisableVertexAttribArray), + TABLE_ENTRY(EnableVertexAttribArray), + TABLE_ENTRY(GetVertexAttribdv), + TABLE_ENTRY(GetVertexAttribfv), + TABLE_ENTRY(GetVertexAttribiv), + TABLE_ENTRY(VertexAttrib1d), + TABLE_ENTRY(VertexAttrib1dv), + TABLE_ENTRY(VertexAttrib1f), + TABLE_ENTRY(VertexAttrib1fv), + TABLE_ENTRY(VertexAttrib1s), + TABLE_ENTRY(VertexAttrib1sv), + TABLE_ENTRY(VertexAttrib2d), + TABLE_ENTRY(VertexAttrib2dv), + TABLE_ENTRY(VertexAttrib2f), + TABLE_ENTRY(VertexAttrib2fv), + TABLE_ENTRY(VertexAttrib2s), + TABLE_ENTRY(VertexAttrib2sv), + TABLE_ENTRY(VertexAttrib3d), + TABLE_ENTRY(VertexAttrib3dv), + TABLE_ENTRY(VertexAttrib3f), + TABLE_ENTRY(VertexAttrib3fv), + TABLE_ENTRY(VertexAttrib3s), + TABLE_ENTRY(VertexAttrib3sv), + TABLE_ENTRY(VertexAttrib4Nbv), + TABLE_ENTRY(VertexAttrib4Niv), + TABLE_ENTRY(VertexAttrib4Nsv), + TABLE_ENTRY(VertexAttrib4Nub), + TABLE_ENTRY(VertexAttrib4Nubv), + TABLE_ENTRY(VertexAttrib4Nuiv), + TABLE_ENTRY(VertexAttrib4Nusv), + TABLE_ENTRY(VertexAttrib4d), + TABLE_ENTRY(VertexAttrib4dv), + TABLE_ENTRY(VertexAttrib4f), + TABLE_ENTRY(VertexAttrib4fv), + TABLE_ENTRY(VertexAttrib4s), + TABLE_ENTRY(VertexAttrib4sv), + TABLE_ENTRY(VertexAttribPointer), TABLE_ENTRY(BindBuffer), TABLE_ENTRY(BufferData), TABLE_ENTRY(BufferSubData), @@ -5939,11 +6479,40 @@ static _glapi_proc UNUSED_TABLE_NAME[] = { TABLE_ENTRY(GetQueryObjectuiv), TABLE_ENTRY(GetQueryiv), TABLE_ENTRY(IsQuery), + TABLE_ENTRY(CompileShader), + TABLE_ENTRY(GetActiveUniform), + TABLE_ENTRY(GetShaderSource), + TABLE_ENTRY(GetUniformLocation), + TABLE_ENTRY(GetUniformfv), + TABLE_ENTRY(GetUniformiv), + TABLE_ENTRY(LinkProgram), + TABLE_ENTRY(ShaderSource), + TABLE_ENTRY(Uniform1f), + TABLE_ENTRY(Uniform1fv), + TABLE_ENTRY(Uniform1i), + TABLE_ENTRY(Uniform1iv), + TABLE_ENTRY(Uniform2f), + TABLE_ENTRY(Uniform2fv), + TABLE_ENTRY(Uniform2i), + TABLE_ENTRY(Uniform2iv), + TABLE_ENTRY(Uniform3f), + TABLE_ENTRY(Uniform3fv), + TABLE_ENTRY(Uniform3i), + TABLE_ENTRY(Uniform3iv), + TABLE_ENTRY(Uniform4f), + TABLE_ENTRY(Uniform4fv), + TABLE_ENTRY(Uniform4i), + TABLE_ENTRY(Uniform4iv), + TABLE_ENTRY(UniformMatrix2fv), + TABLE_ENTRY(UniformMatrix3fv), + TABLE_ENTRY(UniformMatrix4fv), + TABLE_ENTRY(UseProgram), + TABLE_ENTRY(ValidateProgram), + TABLE_ENTRY(BindAttribLocation), + TABLE_ENTRY(GetActiveAttrib), + TABLE_ENTRY(GetAttribLocation), TABLE_ENTRY(DrawBuffers), TABLE_ENTRY(DrawBuffersATI), - TABLE_ENTRY(GetColorTableParameterfvEXT), - TABLE_ENTRY(GetColorTableParameterivEXT), - TABLE_ENTRY(GetColorTableEXT), TABLE_ENTRY(PointParameterf), TABLE_ENTRY(PointParameterfARB), TABLE_ENTRY(PointParameterfv), diff --git a/src/mesa/glapi/glprocs.h b/src/mesa/glapi/glprocs.h index 635438fc04a..548c271bdf7 100644 --- a/src/mesa/glapi/glprocs.h +++ b/src/mesa/glapi/glprocs.h @@ -2,7 +2,7 @@ /* * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. - * (C) Copyright IBM Corporation 2004 + * (C) Copyright IBM Corporation 2004, 2006 * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a @@ -26,25 +26,31 @@ * SOFTWARE. */ + /* This file is only included by glapi.c and is used for * the GetProcAddress() function */ typedef struct { GLint Name_offset; -#ifdef NEED_FUNCTION_POINTER +#if defined(NEED_FUNCTION_POINTER) || defined(GLX_INDIRECT_RENDERING) _glapi_proc Address; #endif GLuint Offset; } glprocs_table_t; -#ifdef NEED_FUNCTION_POINTER -# define NAME_FUNC_OFFSET(n,f,o) { n , (_glapi_proc) f , o } -#else -# define NAME_FUNC_OFFSET(n,f,o) { n , o } +#if !defined(NEED_FUNCTION_POINTER) && !defined(GLX_INDIRECT_RENDERING) +# define NAME_FUNC_OFFSET(n,f1,f2,f3,o) { n , o } +#elif defined(NEED_FUNCTION_POINTER) && !defined(GLX_INDIRECT_RENDERING) +# define NAME_FUNC_OFFSET(n,f1,f2,f3,o) { n , (_glapi_proc) f1 , o } +#elif defined(NEED_FUNCTION_POINTER) && defined(GLX_INDIRECT_RENDERING) +# define NAME_FUNC_OFFSET(n,f1,f2,f3,o) { n , (_glapi_proc) f2 , o } +#elif !defined(NEED_FUNCTION_POINTER) && defined(GLX_INDIRECT_RENDERING) +# define NAME_FUNC_OFFSET(n,f1,f2,f3,o) { n , (_glapi_proc) f3 , o } #endif + static const char gl_string_table[] = "glNewList\0" "glEndList\0" @@ -454,9 +460,28 @@ static const char gl_string_table[] = "glMultiTexCoord4ivARB\0" "glMultiTexCoord4sARB\0" "glMultiTexCoord4svARB\0" + "glAttachShader\0" + "glCreateProgram\0" + "glCreateShader\0" + "glDeleteProgram\0" + "glDeleteShader\0" + "glDetachShader\0" + "glGetAttachedShaders\0" + "glGetProgramInfoLog\0" + "glGetProgramiv\0" + "glGetShaderInfoLog\0" + "glGetShaderiv\0" + "glIsProgram\0" + "glIsShader\0" "glStencilFuncSeparate\0" "glStencilMaskSeparate\0" "glStencilOpSeparate\0" + "glUniformMatrix2x3fv\0" + "glUniformMatrix2x4fv\0" + "glUniformMatrix3x2fv\0" + "glUniformMatrix3x4fv\0" + "glUniformMatrix4x2fv\0" + "glUniformMatrix4x3fv\0" "glLoadTransposeMatrixdARB\0" "glLoadTransposeMatrixfARB\0" "glMultTransposeMatrixdARB\0" @@ -589,28 +614,12 @@ static const char gl_string_table[] = "glGetAttribLocationARB\0" "glDrawBuffersARB\0" "glPolygonOffsetEXT\0" - "glGetHistogramEXT\0" - "glGetHistogramParameterfvEXT\0" - "glGetHistogramParameterivEXT\0" - "glGetMinmaxEXT\0" - "glGetMinmaxParameterfvEXT\0" - "glGetMinmaxParameterivEXT\0" - "glGetConvolutionFilterEXT\0" - "glGetConvolutionParameterfvEXT\0" - "glGetConvolutionParameterivEXT\0" - "glGetSeparableFilterEXT\0" - "glGetColorTableParameterfvSGI\0" - "glGetColorTableParameterivSGI\0" - "glGetColorTableSGI\0" "glGetPixelTexGenParameterfvSGIS\0" "glGetPixelTexGenParameterivSGIS\0" "glPixelTexGenParameterfSGIS\0" "glPixelTexGenParameterfvSGIS\0" "glPixelTexGenParameteriSGIS\0" "glPixelTexGenParameterivSGIS\0" - "glAreTexturesResidentEXT\0" - "glGenTexturesEXT\0" - "glIsTextureEXT\0" "glSampleMaskSGIS\0" "glSamplePatternSGIS\0" "glColorPointerEXT\0" @@ -806,8 +815,6 @@ static const char gl_string_table[] = "glGenRenderbuffersEXT\0" "glGenerateMipmapEXT\0" "glGetFramebufferAttachmentParameterivEXT\0" - "glGetQueryObjecti64vEXT\0" - "glGetQueryObjectui64vEXT\0" "glGetRenderbufferParameterivEXT\0" "glIsFramebufferEXT\0" "glIsRenderbufferEXT\0" @@ -815,15 +822,20 @@ static const char gl_string_table[] = "glBlitFramebufferEXT\0" "glProgramEnvParameters4fvEXT\0" "glProgramLocalParameters4fvEXT\0" + "glGetQueryObjecti64vEXT\0" + "glGetQueryObjectui64vEXT\0" "glArrayElementEXT\0" "glBindTextureEXT\0" "glDrawArraysEXT\0" + "glAreTexturesResidentEXT\0" "glCopyTexImage1DEXT\0" "glCopyTexImage2DEXT\0" "glCopyTexSubImage1DEXT\0" "glCopyTexSubImage2DEXT\0" "glDeleteTexturesEXT\0" + "glGenTexturesEXT\0" "glGetPointervEXT\0" + "glIsTextureEXT\0" "glPrioritizeTexturesEXT\0" "glTexSubImage1DEXT\0" "glTexSubImage2DEXT\0" @@ -835,6 +847,12 @@ static const char gl_string_table[] = "glColorTableParameterfvSGI\0" "glColorTableParameterivSGI\0" "glCopyColorTableSGI\0" + "glGetColorTableSGI\0" + "glGetColorTableEXT\0" + "glGetColorTableParameterfvSGI\0" + "glGetColorTableParameterfvEXT\0" + "glGetColorTableParameterivSGI\0" + "glGetColorTableParameterivEXT\0" "glColorSubTableEXT\0" "glCopyColorSubTableEXT\0" "glConvolutionFilter1DEXT\0" @@ -845,7 +863,17 @@ static const char gl_string_table[] = "glConvolutionParameterivEXT\0" "glCopyConvolutionFilter1DEXT\0" "glCopyConvolutionFilter2DEXT\0" + "glGetConvolutionFilterEXT\0" + "glGetConvolutionParameterfvEXT\0" + "glGetConvolutionParameterivEXT\0" + "glGetSeparableFilterEXT\0" "glSeparableFilter2DEXT\0" + "glGetHistogramEXT\0" + "glGetHistogramParameterfvEXT\0" + "glGetHistogramParameterivEXT\0" + "glGetMinmaxEXT\0" + "glGetMinmaxParameterfvEXT\0" + "glGetMinmaxParameterivEXT\0" "glHistogramEXT\0" "glMinmaxEXT\0" "glResetHistogramEXT\0" @@ -899,6 +927,43 @@ static const char gl_string_table[] = "glCompressedTexSubImage2D\0" "glCompressedTexSubImage3D\0" "glGetCompressedTexImage\0" + "glDisableVertexAttribArray\0" + "glEnableVertexAttribArray\0" + "glGetVertexAttribdv\0" + "glGetVertexAttribfv\0" + "glGetVertexAttribiv\0" + "glVertexAttrib1d\0" + "glVertexAttrib1dv\0" + "glVertexAttrib1f\0" + "glVertexAttrib1fv\0" + "glVertexAttrib1s\0" + "glVertexAttrib1sv\0" + "glVertexAttrib2d\0" + "glVertexAttrib2dv\0" + "glVertexAttrib2f\0" + "glVertexAttrib2fv\0" + "glVertexAttrib2s\0" + "glVertexAttrib2sv\0" + "glVertexAttrib3d\0" + "glVertexAttrib3dv\0" + "glVertexAttrib3f\0" + "glVertexAttrib3fv\0" + "glVertexAttrib3s\0" + "glVertexAttrib3sv\0" + "glVertexAttrib4Nbv\0" + "glVertexAttrib4Niv\0" + "glVertexAttrib4Nsv\0" + "glVertexAttrib4Nub\0" + "glVertexAttrib4Nubv\0" + "glVertexAttrib4Nuiv\0" + "glVertexAttrib4Nusv\0" + "glVertexAttrib4d\0" + "glVertexAttrib4dv\0" + "glVertexAttrib4f\0" + "glVertexAttrib4fv\0" + "glVertexAttrib4s\0" + "glVertexAttrib4sv\0" + "glVertexAttribPointer\0" "glBindBuffer\0" "glBufferData\0" "glBufferSubData\0" @@ -918,11 +983,40 @@ static const char gl_string_table[] = "glGetQueryObjectuiv\0" "glGetQueryiv\0" "glIsQuery\0" + "glCompileShader\0" + "glGetActiveUniform\0" + "glGetShaderSource\0" + "glGetUniformLocation\0" + "glGetUniformfv\0" + "glGetUniformiv\0" + "glLinkProgram\0" + "glShaderSource\0" + "glUniform1f\0" + "glUniform1fv\0" + "glUniform1i\0" + "glUniform1iv\0" + "glUniform2f\0" + "glUniform2fv\0" + "glUniform2i\0" + "glUniform2iv\0" + "glUniform3f\0" + "glUniform3fv\0" + "glUniform3i\0" + "glUniform3iv\0" + "glUniform4f\0" + "glUniform4fv\0" + "glUniform4i\0" + "glUniform4iv\0" + "glUniformMatrix2fv\0" + "glUniformMatrix3fv\0" + "glUniformMatrix4fv\0" + "glUseProgram\0" + "glValidateProgram\0" + "glBindAttribLocation\0" + "glGetActiveAttrib\0" + "glGetAttribLocation\0" "glDrawBuffers\0" "glDrawBuffersATI\0" - "glGetColorTableParameterfvEXT\0" - "glGetColorTableParameterivEXT\0" - "glGetColorTableEXT\0" "glSampleMaskEXT\0" "glSamplePatternEXT\0" "glPointParameterf\0" @@ -1001,1008 +1095,1096 @@ static const char gl_string_table[] = ; /* FIXME: Having these (incorrect) prototypes here is ugly. */ -#ifdef NEED_FUNCTION_POINTER -extern void gl_dispatch_stub_543(void); -extern void gl_dispatch_stub_544(void); -extern void gl_dispatch_stub_545(void); -extern void gl_dispatch_stub_546(void); -extern void gl_dispatch_stub_547(void); -extern void gl_dispatch_stub_548(void); -extern void gl_dispatch_stub_549(void); -extern void gl_dispatch_stub_550(void); -extern void gl_dispatch_stub_551(void); -extern void gl_dispatch_stub_552(void); -extern void gl_dispatch_stub_553(void); -extern void gl_dispatch_stub_554(void); -extern void gl_dispatch_stub_555(void); -extern void gl_dispatch_stub_556(void); -extern void gl_dispatch_stub_557(void); -extern void gl_dispatch_stub_558(void); -extern void gl_dispatch_stub_559(void); -extern void gl_dispatch_stub_560(void); -extern void gl_dispatch_stub_561(void); +#if defined(NEED_FUNCTION_POINTER) || defined(GLX_INDIRECT_RENDERING) +extern void gl_dispatch_stub_343(void); +extern void gl_dispatch_stub_344(void); +extern void gl_dispatch_stub_345(void); +extern void gl_dispatch_stub_356(void); +extern void gl_dispatch_stub_357(void); +extern void gl_dispatch_stub_358(void); +extern void gl_dispatch_stub_359(void); +extern void gl_dispatch_stub_361(void); +extern void gl_dispatch_stub_362(void); +extern void gl_dispatch_stub_363(void); +extern void gl_dispatch_stub_364(void); +extern void gl_dispatch_stub_365(void); +extern void gl_dispatch_stub_366(void); +extern void gl_dispatch_stub_562(void); +extern void gl_dispatch_stub_563(void); +extern void gl_dispatch_stub_564(void); extern void gl_dispatch_stub_565(void); extern void gl_dispatch_stub_566(void); -extern void gl_dispatch_stub_577(void); -extern void gl_dispatch_stub_578(void); -extern void gl_dispatch_stub_603(void); -extern void gl_dispatch_stub_645(void); -extern void gl_dispatch_stub_646(void); -extern void gl_dispatch_stub_647(void); +extern void gl_dispatch_stub_567(void); +extern void gl_dispatch_stub_568(void); +extern void gl_dispatch_stub_569(void); +extern void gl_dispatch_stub_580(void); +extern void gl_dispatch_stub_581(void); +extern void gl_dispatch_stub_606(void); extern void gl_dispatch_stub_648(void); extern void gl_dispatch_stub_649(void); extern void gl_dispatch_stub_650(void); extern void gl_dispatch_stub_651(void); extern void gl_dispatch_stub_652(void); extern void gl_dispatch_stub_653(void); -extern void gl_dispatch_stub_734(void); -extern void gl_dispatch_stub_735(void); -extern void gl_dispatch_stub_736(void); +extern void gl_dispatch_stub_654(void); +extern void gl_dispatch_stub_655(void); +extern void gl_dispatch_stub_656(void); extern void gl_dispatch_stub_737(void); extern void gl_dispatch_stub_738(void); -extern void gl_dispatch_stub_745(void); -extern void gl_dispatch_stub_746(void); -extern void gl_dispatch_stub_760(void); -extern void gl_dispatch_stub_761(void); -extern void gl_dispatch_stub_766(void); +extern void gl_dispatch_stub_739(void); +extern void gl_dispatch_stub_740(void); +extern void gl_dispatch_stub_741(void); +extern void gl_dispatch_stub_748(void); +extern void gl_dispatch_stub_749(void); extern void gl_dispatch_stub_767(void); extern void gl_dispatch_stub_768(void); -#endif /* NEED_FUNCTION_POINTER */ +extern void gl_dispatch_stub_769(void); +extern void gl_dispatch_stub_770(void); +extern void gl_dispatch_stub_771(void); +#endif /* defined(NEED_FUNCTION_POINTER) || defined(GLX_INDIRECT_RENDERING) */ static const glprocs_table_t static_functions[] = { - NAME_FUNC_OFFSET( 0, glNewList, _gloffset_NewList ), - NAME_FUNC_OFFSET( 10, glEndList, _gloffset_EndList ), - NAME_FUNC_OFFSET( 20, glCallList, _gloffset_CallList ), - NAME_FUNC_OFFSET( 31, glCallLists, _gloffset_CallLists ), - NAME_FUNC_OFFSET( 43, glDeleteLists, _gloffset_DeleteLists ), - NAME_FUNC_OFFSET( 57, glGenLists, _gloffset_GenLists ), - NAME_FUNC_OFFSET( 68, glListBase, _gloffset_ListBase ), - NAME_FUNC_OFFSET( 79, glBegin, _gloffset_Begin ), - NAME_FUNC_OFFSET( 87, glBitmap, _gloffset_Bitmap ), - NAME_FUNC_OFFSET( 96, glColor3b, _gloffset_Color3b ), - NAME_FUNC_OFFSET( 106, glColor3bv, _gloffset_Color3bv ), - NAME_FUNC_OFFSET( 117, glColor3d, _gloffset_Color3d ), - NAME_FUNC_OFFSET( 127, glColor3dv, _gloffset_Color3dv ), - NAME_FUNC_OFFSET( 138, glColor3f, _gloffset_Color3f ), - NAME_FUNC_OFFSET( 148, glColor3fv, _gloffset_Color3fv ), - NAME_FUNC_OFFSET( 159, glColor3i, _gloffset_Color3i ), - NAME_FUNC_OFFSET( 169, glColor3iv, _gloffset_Color3iv ), - NAME_FUNC_OFFSET( 180, glColor3s, _gloffset_Color3s ), - NAME_FUNC_OFFSET( 190, glColor3sv, _gloffset_Color3sv ), - NAME_FUNC_OFFSET( 201, glColor3ub, _gloffset_Color3ub ), - NAME_FUNC_OFFSET( 212, glColor3ubv, _gloffset_Color3ubv ), - NAME_FUNC_OFFSET( 224, glColor3ui, _gloffset_Color3ui ), - NAME_FUNC_OFFSET( 235, glColor3uiv, _gloffset_Color3uiv ), - NAME_FUNC_OFFSET( 247, glColor3us, _gloffset_Color3us ), - NAME_FUNC_OFFSET( 258, glColor3usv, _gloffset_Color3usv ), - NAME_FUNC_OFFSET( 270, glColor4b, _gloffset_Color4b ), - NAME_FUNC_OFFSET( 280, glColor4bv, _gloffset_Color4bv ), - NAME_FUNC_OFFSET( 291, glColor4d, _gloffset_Color4d ), - NAME_FUNC_OFFSET( 301, glColor4dv, _gloffset_Color4dv ), - NAME_FUNC_OFFSET( 312, glColor4f, _gloffset_Color4f ), - NAME_FUNC_OFFSET( 322, glColor4fv, _gloffset_Color4fv ), - NAME_FUNC_OFFSET( 333, glColor4i, _gloffset_Color4i ), - NAME_FUNC_OFFSET( 343, glColor4iv, _gloffset_Color4iv ), - NAME_FUNC_OFFSET( 354, glColor4s, _gloffset_Color4s ), - NAME_FUNC_OFFSET( 364, glColor4sv, _gloffset_Color4sv ), - NAME_FUNC_OFFSET( 375, glColor4ub, _gloffset_Color4ub ), - NAME_FUNC_OFFSET( 386, glColor4ubv, _gloffset_Color4ubv ), - NAME_FUNC_OFFSET( 398, glColor4ui, _gloffset_Color4ui ), - NAME_FUNC_OFFSET( 409, glColor4uiv, _gloffset_Color4uiv ), - NAME_FUNC_OFFSET( 421, glColor4us, _gloffset_Color4us ), - NAME_FUNC_OFFSET( 432, glColor4usv, _gloffset_Color4usv ), - NAME_FUNC_OFFSET( 444, glEdgeFlag, _gloffset_EdgeFlag ), - NAME_FUNC_OFFSET( 455, glEdgeFlagv, _gloffset_EdgeFlagv ), - NAME_FUNC_OFFSET( 467, glEnd, _gloffset_End ), - NAME_FUNC_OFFSET( 473, glIndexd, _gloffset_Indexd ), - NAME_FUNC_OFFSET( 482, glIndexdv, _gloffset_Indexdv ), - NAME_FUNC_OFFSET( 492, glIndexf, _gloffset_Indexf ), - NAME_FUNC_OFFSET( 501, glIndexfv, _gloffset_Indexfv ), - NAME_FUNC_OFFSET( 511, glIndexi, _gloffset_Indexi ), - NAME_FUNC_OFFSET( 520, glIndexiv, _gloffset_Indexiv ), - NAME_FUNC_OFFSET( 530, glIndexs, _gloffset_Indexs ), - NAME_FUNC_OFFSET( 539, glIndexsv, _gloffset_Indexsv ), - NAME_FUNC_OFFSET( 549, glNormal3b, _gloffset_Normal3b ), - NAME_FUNC_OFFSET( 560, glNormal3bv, _gloffset_Normal3bv ), - NAME_FUNC_OFFSET( 572, glNormal3d, _gloffset_Normal3d ), - NAME_FUNC_OFFSET( 583, glNormal3dv, _gloffset_Normal3dv ), - NAME_FUNC_OFFSET( 595, glNormal3f, _gloffset_Normal3f ), - NAME_FUNC_OFFSET( 606, glNormal3fv, _gloffset_Normal3fv ), - NAME_FUNC_OFFSET( 618, glNormal3i, _gloffset_Normal3i ), - NAME_FUNC_OFFSET( 629, glNormal3iv, _gloffset_Normal3iv ), - NAME_FUNC_OFFSET( 641, glNormal3s, _gloffset_Normal3s ), - NAME_FUNC_OFFSET( 652, glNormal3sv, _gloffset_Normal3sv ), - NAME_FUNC_OFFSET( 664, glRasterPos2d, _gloffset_RasterPos2d ), - NAME_FUNC_OFFSET( 678, glRasterPos2dv, _gloffset_RasterPos2dv ), - NAME_FUNC_OFFSET( 693, glRasterPos2f, _gloffset_RasterPos2f ), - NAME_FUNC_OFFSET( 707, glRasterPos2fv, _gloffset_RasterPos2fv ), - NAME_FUNC_OFFSET( 722, glRasterPos2i, _gloffset_RasterPos2i ), - NAME_FUNC_OFFSET( 736, glRasterPos2iv, _gloffset_RasterPos2iv ), - NAME_FUNC_OFFSET( 751, glRasterPos2s, _gloffset_RasterPos2s ), - NAME_FUNC_OFFSET( 765, glRasterPos2sv, _gloffset_RasterPos2sv ), - NAME_FUNC_OFFSET( 780, glRasterPos3d, _gloffset_RasterPos3d ), - NAME_FUNC_OFFSET( 794, glRasterPos3dv, _gloffset_RasterPos3dv ), - NAME_FUNC_OFFSET( 809, glRasterPos3f, _gloffset_RasterPos3f ), - NAME_FUNC_OFFSET( 823, glRasterPos3fv, _gloffset_RasterPos3fv ), - NAME_FUNC_OFFSET( 838, glRasterPos3i, _gloffset_RasterPos3i ), - NAME_FUNC_OFFSET( 852, glRasterPos3iv, _gloffset_RasterPos3iv ), - NAME_FUNC_OFFSET( 867, glRasterPos3s, _gloffset_RasterPos3s ), - NAME_FUNC_OFFSET( 881, glRasterPos3sv, _gloffset_RasterPos3sv ), - NAME_FUNC_OFFSET( 896, glRasterPos4d, _gloffset_RasterPos4d ), - NAME_FUNC_OFFSET( 910, glRasterPos4dv, _gloffset_RasterPos4dv ), - NAME_FUNC_OFFSET( 925, glRasterPos4f, _gloffset_RasterPos4f ), - NAME_FUNC_OFFSET( 939, glRasterPos4fv, _gloffset_RasterPos4fv ), - NAME_FUNC_OFFSET( 954, glRasterPos4i, _gloffset_RasterPos4i ), - NAME_FUNC_OFFSET( 968, glRasterPos4iv, _gloffset_RasterPos4iv ), - NAME_FUNC_OFFSET( 983, glRasterPos4s, _gloffset_RasterPos4s ), - NAME_FUNC_OFFSET( 997, glRasterPos4sv, _gloffset_RasterPos4sv ), - NAME_FUNC_OFFSET( 1012, glRectd, _gloffset_Rectd ), - NAME_FUNC_OFFSET( 1020, glRectdv, _gloffset_Rectdv ), - NAME_FUNC_OFFSET( 1029, glRectf, _gloffset_Rectf ), - NAME_FUNC_OFFSET( 1037, glRectfv, _gloffset_Rectfv ), - NAME_FUNC_OFFSET( 1046, glRecti, _gloffset_Recti ), - NAME_FUNC_OFFSET( 1054, glRectiv, _gloffset_Rectiv ), - NAME_FUNC_OFFSET( 1063, glRects, _gloffset_Rects ), - NAME_FUNC_OFFSET( 1071, glRectsv, _gloffset_Rectsv ), - NAME_FUNC_OFFSET( 1080, glTexCoord1d, _gloffset_TexCoord1d ), - NAME_FUNC_OFFSET( 1093, glTexCoord1dv, _gloffset_TexCoord1dv ), - NAME_FUNC_OFFSET( 1107, glTexCoord1f, _gloffset_TexCoord1f ), - NAME_FUNC_OFFSET( 1120, glTexCoord1fv, _gloffset_TexCoord1fv ), - NAME_FUNC_OFFSET( 1134, glTexCoord1i, _gloffset_TexCoord1i ), - NAME_FUNC_OFFSET( 1147, glTexCoord1iv, _gloffset_TexCoord1iv ), - NAME_FUNC_OFFSET( 1161, glTexCoord1s, _gloffset_TexCoord1s ), - NAME_FUNC_OFFSET( 1174, glTexCoord1sv, _gloffset_TexCoord1sv ), - NAME_FUNC_OFFSET( 1188, glTexCoord2d, _gloffset_TexCoord2d ), - NAME_FUNC_OFFSET( 1201, glTexCoord2dv, _gloffset_TexCoord2dv ), - NAME_FUNC_OFFSET( 1215, glTexCoord2f, _gloffset_TexCoord2f ), - NAME_FUNC_OFFSET( 1228, glTexCoord2fv, _gloffset_TexCoord2fv ), - NAME_FUNC_OFFSET( 1242, glTexCoord2i, _gloffset_TexCoord2i ), - NAME_FUNC_OFFSET( 1255, glTexCoord2iv, _gloffset_TexCoord2iv ), - NAME_FUNC_OFFSET( 1269, glTexCoord2s, _gloffset_TexCoord2s ), - NAME_FUNC_OFFSET( 1282, glTexCoord2sv, _gloffset_TexCoord2sv ), - NAME_FUNC_OFFSET( 1296, glTexCoord3d, _gloffset_TexCoord3d ), - NAME_FUNC_OFFSET( 1309, glTexCoord3dv, _gloffset_TexCoord3dv ), - NAME_FUNC_OFFSET( 1323, glTexCoord3f, _gloffset_TexCoord3f ), - NAME_FUNC_OFFSET( 1336, glTexCoord3fv, _gloffset_TexCoord3fv ), - NAME_FUNC_OFFSET( 1350, glTexCoord3i, _gloffset_TexCoord3i ), - NAME_FUNC_OFFSET( 1363, glTexCoord3iv, _gloffset_TexCoord3iv ), - NAME_FUNC_OFFSET( 1377, glTexCoord3s, _gloffset_TexCoord3s ), - NAME_FUNC_OFFSET( 1390, glTexCoord3sv, _gloffset_TexCoord3sv ), - NAME_FUNC_OFFSET( 1404, glTexCoord4d, _gloffset_TexCoord4d ), - NAME_FUNC_OFFSET( 1417, glTexCoord4dv, _gloffset_TexCoord4dv ), - NAME_FUNC_OFFSET( 1431, glTexCoord4f, _gloffset_TexCoord4f ), - NAME_FUNC_OFFSET( 1444, glTexCoord4fv, _gloffset_TexCoord4fv ), - NAME_FUNC_OFFSET( 1458, glTexCoord4i, _gloffset_TexCoord4i ), - NAME_FUNC_OFFSET( 1471, glTexCoord4iv, _gloffset_TexCoord4iv ), - NAME_FUNC_OFFSET( 1485, glTexCoord4s, _gloffset_TexCoord4s ), - NAME_FUNC_OFFSET( 1498, glTexCoord4sv, _gloffset_TexCoord4sv ), - NAME_FUNC_OFFSET( 1512, glVertex2d, _gloffset_Vertex2d ), - NAME_FUNC_OFFSET( 1523, glVertex2dv, _gloffset_Vertex2dv ), - NAME_FUNC_OFFSET( 1535, glVertex2f, _gloffset_Vertex2f ), - NAME_FUNC_OFFSET( 1546, glVertex2fv, _gloffset_Vertex2fv ), - NAME_FUNC_OFFSET( 1558, glVertex2i, _gloffset_Vertex2i ), - NAME_FUNC_OFFSET( 1569, glVertex2iv, _gloffset_Vertex2iv ), - NAME_FUNC_OFFSET( 1581, glVertex2s, _gloffset_Vertex2s ), - NAME_FUNC_OFFSET( 1592, glVertex2sv, _gloffset_Vertex2sv ), - NAME_FUNC_OFFSET( 1604, glVertex3d, _gloffset_Vertex3d ), - NAME_FUNC_OFFSET( 1615, glVertex3dv, _gloffset_Vertex3dv ), - NAME_FUNC_OFFSET( 1627, glVertex3f, _gloffset_Vertex3f ), - NAME_FUNC_OFFSET( 1638, glVertex3fv, _gloffset_Vertex3fv ), - NAME_FUNC_OFFSET( 1650, glVertex3i, _gloffset_Vertex3i ), - NAME_FUNC_OFFSET( 1661, glVertex3iv, _gloffset_Vertex3iv ), - NAME_FUNC_OFFSET( 1673, glVertex3s, _gloffset_Vertex3s ), - NAME_FUNC_OFFSET( 1684, glVertex3sv, _gloffset_Vertex3sv ), - NAME_FUNC_OFFSET( 1696, glVertex4d, _gloffset_Vertex4d ), - NAME_FUNC_OFFSET( 1707, glVertex4dv, _gloffset_Vertex4dv ), - NAME_FUNC_OFFSET( 1719, glVertex4f, _gloffset_Vertex4f ), - NAME_FUNC_OFFSET( 1730, glVertex4fv, _gloffset_Vertex4fv ), - NAME_FUNC_OFFSET( 1742, glVertex4i, _gloffset_Vertex4i ), - NAME_FUNC_OFFSET( 1753, glVertex4iv, _gloffset_Vertex4iv ), - NAME_FUNC_OFFSET( 1765, glVertex4s, _gloffset_Vertex4s ), - NAME_FUNC_OFFSET( 1776, glVertex4sv, _gloffset_Vertex4sv ), - NAME_FUNC_OFFSET( 1788, glClipPlane, _gloffset_ClipPlane ), - NAME_FUNC_OFFSET( 1800, glColorMaterial, _gloffset_ColorMaterial ), - NAME_FUNC_OFFSET( 1816, glCullFace, _gloffset_CullFace ), - NAME_FUNC_OFFSET( 1827, glFogf, _gloffset_Fogf ), - NAME_FUNC_OFFSET( 1834, glFogfv, _gloffset_Fogfv ), - NAME_FUNC_OFFSET( 1842, glFogi, _gloffset_Fogi ), - NAME_FUNC_OFFSET( 1849, glFogiv, _gloffset_Fogiv ), - NAME_FUNC_OFFSET( 1857, glFrontFace, _gloffset_FrontFace ), - NAME_FUNC_OFFSET( 1869, glHint, _gloffset_Hint ), - NAME_FUNC_OFFSET( 1876, glLightf, _gloffset_Lightf ), - NAME_FUNC_OFFSET( 1885, glLightfv, _gloffset_Lightfv ), - NAME_FUNC_OFFSET( 1895, glLighti, _gloffset_Lighti ), - NAME_FUNC_OFFSET( 1904, glLightiv, _gloffset_Lightiv ), - NAME_FUNC_OFFSET( 1914, glLightModelf, _gloffset_LightModelf ), - NAME_FUNC_OFFSET( 1928, glLightModelfv, _gloffset_LightModelfv ), - NAME_FUNC_OFFSET( 1943, glLightModeli, _gloffset_LightModeli ), - NAME_FUNC_OFFSET( 1957, glLightModeliv, _gloffset_LightModeliv ), - NAME_FUNC_OFFSET( 1972, glLineStipple, _gloffset_LineStipple ), - NAME_FUNC_OFFSET( 1986, glLineWidth, _gloffset_LineWidth ), - NAME_FUNC_OFFSET( 1998, glMaterialf, _gloffset_Materialf ), - NAME_FUNC_OFFSET( 2010, glMaterialfv, _gloffset_Materialfv ), - NAME_FUNC_OFFSET( 2023, glMateriali, _gloffset_Materiali ), - NAME_FUNC_OFFSET( 2035, glMaterialiv, _gloffset_Materialiv ), - NAME_FUNC_OFFSET( 2048, glPointSize, _gloffset_PointSize ), - NAME_FUNC_OFFSET( 2060, glPolygonMode, _gloffset_PolygonMode ), - NAME_FUNC_OFFSET( 2074, glPolygonStipple, _gloffset_PolygonStipple ), - NAME_FUNC_OFFSET( 2091, glScissor, _gloffset_Scissor ), - NAME_FUNC_OFFSET( 2101, glShadeModel, _gloffset_ShadeModel ), - NAME_FUNC_OFFSET( 2114, glTexParameterf, _gloffset_TexParameterf ), - NAME_FUNC_OFFSET( 2130, glTexParameterfv, _gloffset_TexParameterfv ), - NAME_FUNC_OFFSET( 2147, glTexParameteri, _gloffset_TexParameteri ), - NAME_FUNC_OFFSET( 2163, glTexParameteriv, _gloffset_TexParameteriv ), - NAME_FUNC_OFFSET( 2180, glTexImage1D, _gloffset_TexImage1D ), - NAME_FUNC_OFFSET( 2193, glTexImage2D, _gloffset_TexImage2D ), - NAME_FUNC_OFFSET( 2206, glTexEnvf, _gloffset_TexEnvf ), - NAME_FUNC_OFFSET( 2216, glTexEnvfv, _gloffset_TexEnvfv ), - NAME_FUNC_OFFSET( 2227, glTexEnvi, _gloffset_TexEnvi ), - NAME_FUNC_OFFSET( 2237, glTexEnviv, _gloffset_TexEnviv ), - NAME_FUNC_OFFSET( 2248, glTexGend, _gloffset_TexGend ), - NAME_FUNC_OFFSET( 2258, glTexGendv, _gloffset_TexGendv ), - NAME_FUNC_OFFSET( 2269, glTexGenf, _gloffset_TexGenf ), - NAME_FUNC_OFFSET( 2279, glTexGenfv, _gloffset_TexGenfv ), - NAME_FUNC_OFFSET( 2290, glTexGeni, _gloffset_TexGeni ), - NAME_FUNC_OFFSET( 2300, glTexGeniv, _gloffset_TexGeniv ), - NAME_FUNC_OFFSET( 2311, glFeedbackBuffer, _gloffset_FeedbackBuffer ), - NAME_FUNC_OFFSET( 2328, glSelectBuffer, _gloffset_SelectBuffer ), - NAME_FUNC_OFFSET( 2343, glRenderMode, _gloffset_RenderMode ), - NAME_FUNC_OFFSET( 2356, glInitNames, _gloffset_InitNames ), - NAME_FUNC_OFFSET( 2368, glLoadName, _gloffset_LoadName ), - NAME_FUNC_OFFSET( 2379, glPassThrough, _gloffset_PassThrough ), - NAME_FUNC_OFFSET( 2393, glPopName, _gloffset_PopName ), - NAME_FUNC_OFFSET( 2403, glPushName, _gloffset_PushName ), - NAME_FUNC_OFFSET( 2414, glDrawBuffer, _gloffset_DrawBuffer ), - NAME_FUNC_OFFSET( 2427, glClear, _gloffset_Clear ), - NAME_FUNC_OFFSET( 2435, glClearAccum, _gloffset_ClearAccum ), - NAME_FUNC_OFFSET( 2448, glClearIndex, _gloffset_ClearIndex ), - NAME_FUNC_OFFSET( 2461, glClearColor, _gloffset_ClearColor ), - NAME_FUNC_OFFSET( 2474, glClearStencil, _gloffset_ClearStencil ), - NAME_FUNC_OFFSET( 2489, glClearDepth, _gloffset_ClearDepth ), - NAME_FUNC_OFFSET( 2502, glStencilMask, _gloffset_StencilMask ), - NAME_FUNC_OFFSET( 2516, glColorMask, _gloffset_ColorMask ), - NAME_FUNC_OFFSET( 2528, glDepthMask, _gloffset_DepthMask ), - NAME_FUNC_OFFSET( 2540, glIndexMask, _gloffset_IndexMask ), - NAME_FUNC_OFFSET( 2552, glAccum, _gloffset_Accum ), - NAME_FUNC_OFFSET( 2560, glDisable, _gloffset_Disable ), - NAME_FUNC_OFFSET( 2570, glEnable, _gloffset_Enable ), - NAME_FUNC_OFFSET( 2579, glFinish, _gloffset_Finish ), - NAME_FUNC_OFFSET( 2588, glFlush, _gloffset_Flush ), - NAME_FUNC_OFFSET( 2596, glPopAttrib, _gloffset_PopAttrib ), - NAME_FUNC_OFFSET( 2608, glPushAttrib, _gloffset_PushAttrib ), - NAME_FUNC_OFFSET( 2621, glMap1d, _gloffset_Map1d ), - NAME_FUNC_OFFSET( 2629, glMap1f, _gloffset_Map1f ), - NAME_FUNC_OFFSET( 2637, glMap2d, _gloffset_Map2d ), - NAME_FUNC_OFFSET( 2645, glMap2f, _gloffset_Map2f ), - NAME_FUNC_OFFSET( 2653, glMapGrid1d, _gloffset_MapGrid1d ), - NAME_FUNC_OFFSET( 2665, glMapGrid1f, _gloffset_MapGrid1f ), - NAME_FUNC_OFFSET( 2677, glMapGrid2d, _gloffset_MapGrid2d ), - NAME_FUNC_OFFSET( 2689, glMapGrid2f, _gloffset_MapGrid2f ), - NAME_FUNC_OFFSET( 2701, glEvalCoord1d, _gloffset_EvalCoord1d ), - NAME_FUNC_OFFSET( 2715, glEvalCoord1dv, _gloffset_EvalCoord1dv ), - NAME_FUNC_OFFSET( 2730, glEvalCoord1f, _gloffset_EvalCoord1f ), - NAME_FUNC_OFFSET( 2744, glEvalCoord1fv, _gloffset_EvalCoord1fv ), - NAME_FUNC_OFFSET( 2759, glEvalCoord2d, _gloffset_EvalCoord2d ), - NAME_FUNC_OFFSET( 2773, glEvalCoord2dv, _gloffset_EvalCoord2dv ), - NAME_FUNC_OFFSET( 2788, glEvalCoord2f, _gloffset_EvalCoord2f ), - NAME_FUNC_OFFSET( 2802, glEvalCoord2fv, _gloffset_EvalCoord2fv ), - NAME_FUNC_OFFSET( 2817, glEvalMesh1, _gloffset_EvalMesh1 ), - NAME_FUNC_OFFSET( 2829, glEvalPoint1, _gloffset_EvalPoint1 ), - NAME_FUNC_OFFSET( 2842, glEvalMesh2, _gloffset_EvalMesh2 ), - NAME_FUNC_OFFSET( 2854, glEvalPoint2, _gloffset_EvalPoint2 ), - NAME_FUNC_OFFSET( 2867, glAlphaFunc, _gloffset_AlphaFunc ), - NAME_FUNC_OFFSET( 2879, glBlendFunc, _gloffset_BlendFunc ), - NAME_FUNC_OFFSET( 2891, glLogicOp, _gloffset_LogicOp ), - NAME_FUNC_OFFSET( 2901, glStencilFunc, _gloffset_StencilFunc ), - NAME_FUNC_OFFSET( 2915, glStencilOp, _gloffset_StencilOp ), - NAME_FUNC_OFFSET( 2927, glDepthFunc, _gloffset_DepthFunc ), - NAME_FUNC_OFFSET( 2939, glPixelZoom, _gloffset_PixelZoom ), - NAME_FUNC_OFFSET( 2951, glPixelTransferf, _gloffset_PixelTransferf ), - NAME_FUNC_OFFSET( 2968, glPixelTransferi, _gloffset_PixelTransferi ), - NAME_FUNC_OFFSET( 2985, glPixelStoref, _gloffset_PixelStoref ), - NAME_FUNC_OFFSET( 2999, glPixelStorei, _gloffset_PixelStorei ), - NAME_FUNC_OFFSET( 3013, glPixelMapfv, _gloffset_PixelMapfv ), - NAME_FUNC_OFFSET( 3026, glPixelMapuiv, _gloffset_PixelMapuiv ), - NAME_FUNC_OFFSET( 3040, glPixelMapusv, _gloffset_PixelMapusv ), - NAME_FUNC_OFFSET( 3054, glReadBuffer, _gloffset_ReadBuffer ), - NAME_FUNC_OFFSET( 3067, glCopyPixels, _gloffset_CopyPixels ), - NAME_FUNC_OFFSET( 3080, glReadPixels, _gloffset_ReadPixels ), - NAME_FUNC_OFFSET( 3093, glDrawPixels, _gloffset_DrawPixels ), - NAME_FUNC_OFFSET( 3106, glGetBooleanv, _gloffset_GetBooleanv ), - NAME_FUNC_OFFSET( 3120, glGetClipPlane, _gloffset_GetClipPlane ), - NAME_FUNC_OFFSET( 3135, glGetDoublev, _gloffset_GetDoublev ), - NAME_FUNC_OFFSET( 3148, glGetError, _gloffset_GetError ), - NAME_FUNC_OFFSET( 3159, glGetFloatv, _gloffset_GetFloatv ), - NAME_FUNC_OFFSET( 3171, glGetIntegerv, _gloffset_GetIntegerv ), - NAME_FUNC_OFFSET( 3185, glGetLightfv, _gloffset_GetLightfv ), - NAME_FUNC_OFFSET( 3198, glGetLightiv, _gloffset_GetLightiv ), - NAME_FUNC_OFFSET( 3211, glGetMapdv, _gloffset_GetMapdv ), - NAME_FUNC_OFFSET( 3222, glGetMapfv, _gloffset_GetMapfv ), - NAME_FUNC_OFFSET( 3233, glGetMapiv, _gloffset_GetMapiv ), - NAME_FUNC_OFFSET( 3244, glGetMaterialfv, _gloffset_GetMaterialfv ), - NAME_FUNC_OFFSET( 3260, glGetMaterialiv, _gloffset_GetMaterialiv ), - NAME_FUNC_OFFSET( 3276, glGetPixelMapfv, _gloffset_GetPixelMapfv ), - NAME_FUNC_OFFSET( 3292, glGetPixelMapuiv, _gloffset_GetPixelMapuiv ), - NAME_FUNC_OFFSET( 3309, glGetPixelMapusv, _gloffset_GetPixelMapusv ), - NAME_FUNC_OFFSET( 3326, glGetPolygonStipple, _gloffset_GetPolygonStipple ), - NAME_FUNC_OFFSET( 3346, glGetString, _gloffset_GetString ), - NAME_FUNC_OFFSET( 3358, glGetTexEnvfv, _gloffset_GetTexEnvfv ), - NAME_FUNC_OFFSET( 3372, glGetTexEnviv, _gloffset_GetTexEnviv ), - NAME_FUNC_OFFSET( 3386, glGetTexGendv, _gloffset_GetTexGendv ), - NAME_FUNC_OFFSET( 3400, glGetTexGenfv, _gloffset_GetTexGenfv ), - NAME_FUNC_OFFSET( 3414, glGetTexGeniv, _gloffset_GetTexGeniv ), - NAME_FUNC_OFFSET( 3428, glGetTexImage, _gloffset_GetTexImage ), - NAME_FUNC_OFFSET( 3442, glGetTexParameterfv, _gloffset_GetTexParameterfv ), - NAME_FUNC_OFFSET( 3462, glGetTexParameteriv, _gloffset_GetTexParameteriv ), - NAME_FUNC_OFFSET( 3482, glGetTexLevelParameterfv, _gloffset_GetTexLevelParameterfv ), - NAME_FUNC_OFFSET( 3507, glGetTexLevelParameteriv, _gloffset_GetTexLevelParameteriv ), - NAME_FUNC_OFFSET( 3532, glIsEnabled, _gloffset_IsEnabled ), - NAME_FUNC_OFFSET( 3544, glIsList, _gloffset_IsList ), - NAME_FUNC_OFFSET( 3553, glDepthRange, _gloffset_DepthRange ), - NAME_FUNC_OFFSET( 3566, glFrustum, _gloffset_Frustum ), - NAME_FUNC_OFFSET( 3576, glLoadIdentity, _gloffset_LoadIdentity ), - NAME_FUNC_OFFSET( 3591, glLoadMatrixf, _gloffset_LoadMatrixf ), - NAME_FUNC_OFFSET( 3605, glLoadMatrixd, _gloffset_LoadMatrixd ), - NAME_FUNC_OFFSET( 3619, glMatrixMode, _gloffset_MatrixMode ), - NAME_FUNC_OFFSET( 3632, glMultMatrixf, _gloffset_MultMatrixf ), - NAME_FUNC_OFFSET( 3646, glMultMatrixd, _gloffset_MultMatrixd ), - NAME_FUNC_OFFSET( 3660, glOrtho, _gloffset_Ortho ), - NAME_FUNC_OFFSET( 3668, glPopMatrix, _gloffset_PopMatrix ), - NAME_FUNC_OFFSET( 3680, glPushMatrix, _gloffset_PushMatrix ), - NAME_FUNC_OFFSET( 3693, glRotated, _gloffset_Rotated ), - NAME_FUNC_OFFSET( 3703, glRotatef, _gloffset_Rotatef ), - NAME_FUNC_OFFSET( 3713, glScaled, _gloffset_Scaled ), - NAME_FUNC_OFFSET( 3722, glScalef, _gloffset_Scalef ), - NAME_FUNC_OFFSET( 3731, glTranslated, _gloffset_Translated ), - NAME_FUNC_OFFSET( 3744, glTranslatef, _gloffset_Translatef ), - NAME_FUNC_OFFSET( 3757, glViewport, _gloffset_Viewport ), - NAME_FUNC_OFFSET( 3768, glArrayElement, _gloffset_ArrayElement ), - NAME_FUNC_OFFSET( 3783, glBindTexture, _gloffset_BindTexture ), - NAME_FUNC_OFFSET( 3797, glColorPointer, _gloffset_ColorPointer ), - NAME_FUNC_OFFSET( 3812, glDisableClientState, _gloffset_DisableClientState ), - NAME_FUNC_OFFSET( 3833, glDrawArrays, _gloffset_DrawArrays ), - NAME_FUNC_OFFSET( 3846, glDrawElements, _gloffset_DrawElements ), - NAME_FUNC_OFFSET( 3861, glEdgeFlagPointer, _gloffset_EdgeFlagPointer ), - NAME_FUNC_OFFSET( 3879, glEnableClientState, _gloffset_EnableClientState ), - NAME_FUNC_OFFSET( 3899, glIndexPointer, _gloffset_IndexPointer ), - NAME_FUNC_OFFSET( 3914, glIndexub, _gloffset_Indexub ), - NAME_FUNC_OFFSET( 3924, glIndexubv, _gloffset_Indexubv ), - NAME_FUNC_OFFSET( 3935, glInterleavedArrays, _gloffset_InterleavedArrays ), - NAME_FUNC_OFFSET( 3955, glNormalPointer, _gloffset_NormalPointer ), - NAME_FUNC_OFFSET( 3971, glPolygonOffset, _gloffset_PolygonOffset ), - NAME_FUNC_OFFSET( 3987, glTexCoordPointer, _gloffset_TexCoordPointer ), - NAME_FUNC_OFFSET( 4005, glVertexPointer, _gloffset_VertexPointer ), - NAME_FUNC_OFFSET( 4021, glAreTexturesResident, _gloffset_AreTexturesResident ), - NAME_FUNC_OFFSET( 4043, glCopyTexImage1D, _gloffset_CopyTexImage1D ), - NAME_FUNC_OFFSET( 4060, glCopyTexImage2D, _gloffset_CopyTexImage2D ), - NAME_FUNC_OFFSET( 4077, glCopyTexSubImage1D, _gloffset_CopyTexSubImage1D ), - NAME_FUNC_OFFSET( 4097, glCopyTexSubImage2D, _gloffset_CopyTexSubImage2D ), - NAME_FUNC_OFFSET( 4117, glDeleteTextures, _gloffset_DeleteTextures ), - NAME_FUNC_OFFSET( 4134, glGenTextures, _gloffset_GenTextures ), - NAME_FUNC_OFFSET( 4148, glGetPointerv, _gloffset_GetPointerv ), - NAME_FUNC_OFFSET( 4162, glIsTexture, _gloffset_IsTexture ), - NAME_FUNC_OFFSET( 4174, glPrioritizeTextures, _gloffset_PrioritizeTextures ), - NAME_FUNC_OFFSET( 4195, glTexSubImage1D, _gloffset_TexSubImage1D ), - NAME_FUNC_OFFSET( 4211, glTexSubImage2D, _gloffset_TexSubImage2D ), - NAME_FUNC_OFFSET( 4227, glPopClientAttrib, _gloffset_PopClientAttrib ), - NAME_FUNC_OFFSET( 4245, glPushClientAttrib, _gloffset_PushClientAttrib ), - NAME_FUNC_OFFSET( 4264, glBlendColor, _gloffset_BlendColor ), - NAME_FUNC_OFFSET( 4277, glBlendEquation, _gloffset_BlendEquation ), - NAME_FUNC_OFFSET( 4293, glDrawRangeElements, _gloffset_DrawRangeElements ), - NAME_FUNC_OFFSET( 4313, glColorTable, _gloffset_ColorTable ), - NAME_FUNC_OFFSET( 4326, glColorTableParameterfv, _gloffset_ColorTableParameterfv ), - NAME_FUNC_OFFSET( 4350, glColorTableParameteriv, _gloffset_ColorTableParameteriv ), - NAME_FUNC_OFFSET( 4374, glCopyColorTable, _gloffset_CopyColorTable ), - NAME_FUNC_OFFSET( 4391, glGetColorTable, _gloffset_GetColorTable ), - NAME_FUNC_OFFSET( 4407, glGetColorTableParameterfv, _gloffset_GetColorTableParameterfv ), - NAME_FUNC_OFFSET( 4434, glGetColorTableParameteriv, _gloffset_GetColorTableParameteriv ), - NAME_FUNC_OFFSET( 4461, glColorSubTable, _gloffset_ColorSubTable ), - NAME_FUNC_OFFSET( 4477, glCopyColorSubTable, _gloffset_CopyColorSubTable ), - NAME_FUNC_OFFSET( 4497, glConvolutionFilter1D, _gloffset_ConvolutionFilter1D ), - NAME_FUNC_OFFSET( 4519, glConvolutionFilter2D, _gloffset_ConvolutionFilter2D ), - NAME_FUNC_OFFSET( 4541, glConvolutionParameterf, _gloffset_ConvolutionParameterf ), - NAME_FUNC_OFFSET( 4565, glConvolutionParameterfv, _gloffset_ConvolutionParameterfv ), - NAME_FUNC_OFFSET( 4590, glConvolutionParameteri, _gloffset_ConvolutionParameteri ), - NAME_FUNC_OFFSET( 4614, glConvolutionParameteriv, _gloffset_ConvolutionParameteriv ), - NAME_FUNC_OFFSET( 4639, glCopyConvolutionFilter1D, _gloffset_CopyConvolutionFilter1D ), - NAME_FUNC_OFFSET( 4665, glCopyConvolutionFilter2D, _gloffset_CopyConvolutionFilter2D ), - NAME_FUNC_OFFSET( 4691, glGetConvolutionFilter, _gloffset_GetConvolutionFilter ), - NAME_FUNC_OFFSET( 4714, glGetConvolutionParameterfv, _gloffset_GetConvolutionParameterfv ), - NAME_FUNC_OFFSET( 4742, glGetConvolutionParameteriv, _gloffset_GetConvolutionParameteriv ), - NAME_FUNC_OFFSET( 4770, glGetSeparableFilter, _gloffset_GetSeparableFilter ), - NAME_FUNC_OFFSET( 4791, glSeparableFilter2D, _gloffset_SeparableFilter2D ), - NAME_FUNC_OFFSET( 4811, glGetHistogram, _gloffset_GetHistogram ), - NAME_FUNC_OFFSET( 4826, glGetHistogramParameterfv, _gloffset_GetHistogramParameterfv ), - NAME_FUNC_OFFSET( 4852, glGetHistogramParameteriv, _gloffset_GetHistogramParameteriv ), - NAME_FUNC_OFFSET( 4878, glGetMinmax, _gloffset_GetMinmax ), - NAME_FUNC_OFFSET( 4890, glGetMinmaxParameterfv, _gloffset_GetMinmaxParameterfv ), - NAME_FUNC_OFFSET( 4913, glGetMinmaxParameteriv, _gloffset_GetMinmaxParameteriv ), - NAME_FUNC_OFFSET( 4936, glHistogram, _gloffset_Histogram ), - NAME_FUNC_OFFSET( 4948, glMinmax, _gloffset_Minmax ), - NAME_FUNC_OFFSET( 4957, glResetHistogram, _gloffset_ResetHistogram ), - NAME_FUNC_OFFSET( 4974, glResetMinmax, _gloffset_ResetMinmax ), - NAME_FUNC_OFFSET( 4988, glTexImage3D, _gloffset_TexImage3D ), - NAME_FUNC_OFFSET( 5001, glTexSubImage3D, _gloffset_TexSubImage3D ), - NAME_FUNC_OFFSET( 5017, glCopyTexSubImage3D, _gloffset_CopyTexSubImage3D ), - NAME_FUNC_OFFSET( 5037, glActiveTextureARB, _gloffset_ActiveTextureARB ), - NAME_FUNC_OFFSET( 5056, glClientActiveTextureARB, _gloffset_ClientActiveTextureARB ), - NAME_FUNC_OFFSET( 5081, glMultiTexCoord1dARB, _gloffset_MultiTexCoord1dARB ), - NAME_FUNC_OFFSET( 5102, glMultiTexCoord1dvARB, _gloffset_MultiTexCoord1dvARB ), - NAME_FUNC_OFFSET( 5124, glMultiTexCoord1fARB, _gloffset_MultiTexCoord1fARB ), - NAME_FUNC_OFFSET( 5145, glMultiTexCoord1fvARB, _gloffset_MultiTexCoord1fvARB ), - NAME_FUNC_OFFSET( 5167, glMultiTexCoord1iARB, _gloffset_MultiTexCoord1iARB ), - NAME_FUNC_OFFSET( 5188, glMultiTexCoord1ivARB, _gloffset_MultiTexCoord1ivARB ), - NAME_FUNC_OFFSET( 5210, glMultiTexCoord1sARB, _gloffset_MultiTexCoord1sARB ), - NAME_FUNC_OFFSET( 5231, glMultiTexCoord1svARB, _gloffset_MultiTexCoord1svARB ), - NAME_FUNC_OFFSET( 5253, glMultiTexCoord2dARB, _gloffset_MultiTexCoord2dARB ), - NAME_FUNC_OFFSET( 5274, glMultiTexCoord2dvARB, _gloffset_MultiTexCoord2dvARB ), - NAME_FUNC_OFFSET( 5296, glMultiTexCoord2fARB, _gloffset_MultiTexCoord2fARB ), - NAME_FUNC_OFFSET( 5317, glMultiTexCoord2fvARB, _gloffset_MultiTexCoord2fvARB ), - NAME_FUNC_OFFSET( 5339, glMultiTexCoord2iARB, _gloffset_MultiTexCoord2iARB ), - NAME_FUNC_OFFSET( 5360, glMultiTexCoord2ivARB, _gloffset_MultiTexCoord2ivARB ), - NAME_FUNC_OFFSET( 5382, glMultiTexCoord2sARB, _gloffset_MultiTexCoord2sARB ), - NAME_FUNC_OFFSET( 5403, glMultiTexCoord2svARB, _gloffset_MultiTexCoord2svARB ), - NAME_FUNC_OFFSET( 5425, glMultiTexCoord3dARB, _gloffset_MultiTexCoord3dARB ), - NAME_FUNC_OFFSET( 5446, glMultiTexCoord3dvARB, _gloffset_MultiTexCoord3dvARB ), - NAME_FUNC_OFFSET( 5468, glMultiTexCoord3fARB, _gloffset_MultiTexCoord3fARB ), - NAME_FUNC_OFFSET( 5489, glMultiTexCoord3fvARB, _gloffset_MultiTexCoord3fvARB ), - NAME_FUNC_OFFSET( 5511, glMultiTexCoord3iARB, _gloffset_MultiTexCoord3iARB ), - NAME_FUNC_OFFSET( 5532, glMultiTexCoord3ivARB, _gloffset_MultiTexCoord3ivARB ), - NAME_FUNC_OFFSET( 5554, glMultiTexCoord3sARB, _gloffset_MultiTexCoord3sARB ), - NAME_FUNC_OFFSET( 5575, glMultiTexCoord3svARB, _gloffset_MultiTexCoord3svARB ), - NAME_FUNC_OFFSET( 5597, glMultiTexCoord4dARB, _gloffset_MultiTexCoord4dARB ), - NAME_FUNC_OFFSET( 5618, glMultiTexCoord4dvARB, _gloffset_MultiTexCoord4dvARB ), - NAME_FUNC_OFFSET( 5640, glMultiTexCoord4fARB, _gloffset_MultiTexCoord4fARB ), - NAME_FUNC_OFFSET( 5661, glMultiTexCoord4fvARB, _gloffset_MultiTexCoord4fvARB ), - NAME_FUNC_OFFSET( 5683, glMultiTexCoord4iARB, _gloffset_MultiTexCoord4iARB ), - NAME_FUNC_OFFSET( 5704, glMultiTexCoord4ivARB, _gloffset_MultiTexCoord4ivARB ), - NAME_FUNC_OFFSET( 5726, glMultiTexCoord4sARB, _gloffset_MultiTexCoord4sARB ), - NAME_FUNC_OFFSET( 5747, glMultiTexCoord4svARB, _gloffset_MultiTexCoord4svARB ), - NAME_FUNC_OFFSET( 5769, glStencilFuncSeparate, _gloffset_StencilFuncSeparate ), - NAME_FUNC_OFFSET( 5791, glStencilMaskSeparate, _gloffset_StencilMaskSeparate ), - NAME_FUNC_OFFSET( 5813, glStencilOpSeparate, _gloffset_StencilOpSeparate ), - NAME_FUNC_OFFSET( 5833, glLoadTransposeMatrixdARB, _gloffset_LoadTransposeMatrixdARB ), - NAME_FUNC_OFFSET( 5859, glLoadTransposeMatrixfARB, _gloffset_LoadTransposeMatrixfARB ), - NAME_FUNC_OFFSET( 5885, glMultTransposeMatrixdARB, _gloffset_MultTransposeMatrixdARB ), - NAME_FUNC_OFFSET( 5911, glMultTransposeMatrixfARB, _gloffset_MultTransposeMatrixfARB ), - NAME_FUNC_OFFSET( 5937, glSampleCoverageARB, _gloffset_SampleCoverageARB ), - NAME_FUNC_OFFSET( 5957, glCompressedTexImage1DARB, _gloffset_CompressedTexImage1DARB ), - NAME_FUNC_OFFSET( 5983, glCompressedTexImage2DARB, _gloffset_CompressedTexImage2DARB ), - NAME_FUNC_OFFSET( 6009, glCompressedTexImage3DARB, _gloffset_CompressedTexImage3DARB ), - NAME_FUNC_OFFSET( 6035, glCompressedTexSubImage1DARB, _gloffset_CompressedTexSubImage1DARB ), - NAME_FUNC_OFFSET( 6064, glCompressedTexSubImage2DARB, _gloffset_CompressedTexSubImage2DARB ), - NAME_FUNC_OFFSET( 6093, glCompressedTexSubImage3DARB, _gloffset_CompressedTexSubImage3DARB ), - NAME_FUNC_OFFSET( 6122, glGetCompressedTexImageARB, _gloffset_GetCompressedTexImageARB ), - NAME_FUNC_OFFSET( 6149, glDisableVertexAttribArrayARB, _gloffset_DisableVertexAttribArrayARB ), - NAME_FUNC_OFFSET( 6179, glEnableVertexAttribArrayARB, _gloffset_EnableVertexAttribArrayARB ), - NAME_FUNC_OFFSET( 6208, glGetProgramEnvParameterdvARB, _gloffset_GetProgramEnvParameterdvARB ), - NAME_FUNC_OFFSET( 6238, glGetProgramEnvParameterfvARB, _gloffset_GetProgramEnvParameterfvARB ), - NAME_FUNC_OFFSET( 6268, glGetProgramLocalParameterdvARB, _gloffset_GetProgramLocalParameterdvARB ), - NAME_FUNC_OFFSET( 6300, glGetProgramLocalParameterfvARB, _gloffset_GetProgramLocalParameterfvARB ), - NAME_FUNC_OFFSET( 6332, glGetProgramStringARB, _gloffset_GetProgramStringARB ), - NAME_FUNC_OFFSET( 6354, glGetProgramivARB, _gloffset_GetProgramivARB ), - NAME_FUNC_OFFSET( 6372, glGetVertexAttribdvARB, _gloffset_GetVertexAttribdvARB ), - NAME_FUNC_OFFSET( 6395, glGetVertexAttribfvARB, _gloffset_GetVertexAttribfvARB ), - NAME_FUNC_OFFSET( 6418, glGetVertexAttribivARB, _gloffset_GetVertexAttribivARB ), - NAME_FUNC_OFFSET( 6441, glProgramEnvParameter4dARB, _gloffset_ProgramEnvParameter4dARB ), - NAME_FUNC_OFFSET( 6468, glProgramEnvParameter4dvARB, _gloffset_ProgramEnvParameter4dvARB ), - NAME_FUNC_OFFSET( 6496, glProgramEnvParameter4fARB, _gloffset_ProgramEnvParameter4fARB ), - NAME_FUNC_OFFSET( 6523, glProgramEnvParameter4fvARB, _gloffset_ProgramEnvParameter4fvARB ), - NAME_FUNC_OFFSET( 6551, glProgramLocalParameter4dARB, _gloffset_ProgramLocalParameter4dARB ), - NAME_FUNC_OFFSET( 6580, glProgramLocalParameter4dvARB, _gloffset_ProgramLocalParameter4dvARB ), - NAME_FUNC_OFFSET( 6610, glProgramLocalParameter4fARB, _gloffset_ProgramLocalParameter4fARB ), - NAME_FUNC_OFFSET( 6639, glProgramLocalParameter4fvARB, _gloffset_ProgramLocalParameter4fvARB ), - NAME_FUNC_OFFSET( 6669, glProgramStringARB, _gloffset_ProgramStringARB ), - NAME_FUNC_OFFSET( 6688, glVertexAttrib1dARB, _gloffset_VertexAttrib1dARB ), - NAME_FUNC_OFFSET( 6708, glVertexAttrib1dvARB, _gloffset_VertexAttrib1dvARB ), - NAME_FUNC_OFFSET( 6729, glVertexAttrib1fARB, _gloffset_VertexAttrib1fARB ), - NAME_FUNC_OFFSET( 6749, glVertexAttrib1fvARB, _gloffset_VertexAttrib1fvARB ), - NAME_FUNC_OFFSET( 6770, glVertexAttrib1sARB, _gloffset_VertexAttrib1sARB ), - NAME_FUNC_OFFSET( 6790, glVertexAttrib1svARB, _gloffset_VertexAttrib1svARB ), - NAME_FUNC_OFFSET( 6811, glVertexAttrib2dARB, _gloffset_VertexAttrib2dARB ), - NAME_FUNC_OFFSET( 6831, glVertexAttrib2dvARB, _gloffset_VertexAttrib2dvARB ), - NAME_FUNC_OFFSET( 6852, glVertexAttrib2fARB, _gloffset_VertexAttrib2fARB ), - NAME_FUNC_OFFSET( 6872, glVertexAttrib2fvARB, _gloffset_VertexAttrib2fvARB ), - NAME_FUNC_OFFSET( 6893, glVertexAttrib2sARB, _gloffset_VertexAttrib2sARB ), - NAME_FUNC_OFFSET( 6913, glVertexAttrib2svARB, _gloffset_VertexAttrib2svARB ), - NAME_FUNC_OFFSET( 6934, glVertexAttrib3dARB, _gloffset_VertexAttrib3dARB ), - NAME_FUNC_OFFSET( 6954, glVertexAttrib3dvARB, _gloffset_VertexAttrib3dvARB ), - NAME_FUNC_OFFSET( 6975, glVertexAttrib3fARB, _gloffset_VertexAttrib3fARB ), - NAME_FUNC_OFFSET( 6995, glVertexAttrib3fvARB, _gloffset_VertexAttrib3fvARB ), - NAME_FUNC_OFFSET( 7016, glVertexAttrib3sARB, _gloffset_VertexAttrib3sARB ), - NAME_FUNC_OFFSET( 7036, glVertexAttrib3svARB, _gloffset_VertexAttrib3svARB ), - NAME_FUNC_OFFSET( 7057, glVertexAttrib4NbvARB, _gloffset_VertexAttrib4NbvARB ), - NAME_FUNC_OFFSET( 7079, glVertexAttrib4NivARB, _gloffset_VertexAttrib4NivARB ), - NAME_FUNC_OFFSET( 7101, glVertexAttrib4NsvARB, _gloffset_VertexAttrib4NsvARB ), - NAME_FUNC_OFFSET( 7123, glVertexAttrib4NubARB, _gloffset_VertexAttrib4NubARB ), - NAME_FUNC_OFFSET( 7145, glVertexAttrib4NubvARB, _gloffset_VertexAttrib4NubvARB ), - NAME_FUNC_OFFSET( 7168, glVertexAttrib4NuivARB, _gloffset_VertexAttrib4NuivARB ), - NAME_FUNC_OFFSET( 7191, glVertexAttrib4NusvARB, _gloffset_VertexAttrib4NusvARB ), - NAME_FUNC_OFFSET( 7214, glVertexAttrib4bvARB, _gloffset_VertexAttrib4bvARB ), - NAME_FUNC_OFFSET( 7235, glVertexAttrib4dARB, _gloffset_VertexAttrib4dARB ), - NAME_FUNC_OFFSET( 7255, glVertexAttrib4dvARB, _gloffset_VertexAttrib4dvARB ), - NAME_FUNC_OFFSET( 7276, glVertexAttrib4fARB, _gloffset_VertexAttrib4fARB ), - NAME_FUNC_OFFSET( 7296, glVertexAttrib4fvARB, _gloffset_VertexAttrib4fvARB ), - NAME_FUNC_OFFSET( 7317, glVertexAttrib4ivARB, _gloffset_VertexAttrib4ivARB ), - NAME_FUNC_OFFSET( 7338, glVertexAttrib4sARB, _gloffset_VertexAttrib4sARB ), - NAME_FUNC_OFFSET( 7358, glVertexAttrib4svARB, _gloffset_VertexAttrib4svARB ), - NAME_FUNC_OFFSET( 7379, glVertexAttrib4ubvARB, _gloffset_VertexAttrib4ubvARB ), - NAME_FUNC_OFFSET( 7401, glVertexAttrib4uivARB, _gloffset_VertexAttrib4uivARB ), - NAME_FUNC_OFFSET( 7423, glVertexAttrib4usvARB, _gloffset_VertexAttrib4usvARB ), - NAME_FUNC_OFFSET( 7445, glVertexAttribPointerARB, _gloffset_VertexAttribPointerARB ), - NAME_FUNC_OFFSET( 7470, glBindBufferARB, _gloffset_BindBufferARB ), - NAME_FUNC_OFFSET( 7486, glBufferDataARB, _gloffset_BufferDataARB ), - NAME_FUNC_OFFSET( 7502, glBufferSubDataARB, _gloffset_BufferSubDataARB ), - NAME_FUNC_OFFSET( 7521, glDeleteBuffersARB, _gloffset_DeleteBuffersARB ), - NAME_FUNC_OFFSET( 7540, glGenBuffersARB, _gloffset_GenBuffersARB ), - NAME_FUNC_OFFSET( 7556, glGetBufferParameterivARB, _gloffset_GetBufferParameterivARB ), - NAME_FUNC_OFFSET( 7582, glGetBufferPointervARB, _gloffset_GetBufferPointervARB ), - NAME_FUNC_OFFSET( 7605, glGetBufferSubDataARB, _gloffset_GetBufferSubDataARB ), - NAME_FUNC_OFFSET( 7627, glIsBufferARB, _gloffset_IsBufferARB ), - NAME_FUNC_OFFSET( 7641, glMapBufferARB, _gloffset_MapBufferARB ), - NAME_FUNC_OFFSET( 7656, glUnmapBufferARB, _gloffset_UnmapBufferARB ), - NAME_FUNC_OFFSET( 7673, glBeginQueryARB, _gloffset_BeginQueryARB ), - NAME_FUNC_OFFSET( 7689, glDeleteQueriesARB, _gloffset_DeleteQueriesARB ), - NAME_FUNC_OFFSET( 7708, glEndQueryARB, _gloffset_EndQueryARB ), - NAME_FUNC_OFFSET( 7722, glGenQueriesARB, _gloffset_GenQueriesARB ), - NAME_FUNC_OFFSET( 7738, glGetQueryObjectivARB, _gloffset_GetQueryObjectivARB ), - NAME_FUNC_OFFSET( 7760, glGetQueryObjectuivARB, _gloffset_GetQueryObjectuivARB ), - NAME_FUNC_OFFSET( 7783, glGetQueryivARB, _gloffset_GetQueryivARB ), - NAME_FUNC_OFFSET( 7799, glIsQueryARB, _gloffset_IsQueryARB ), - NAME_FUNC_OFFSET( 7812, glAttachObjectARB, _gloffset_AttachObjectARB ), - NAME_FUNC_OFFSET( 7830, glCompileShaderARB, _gloffset_CompileShaderARB ), - NAME_FUNC_OFFSET( 7849, glCreateProgramObjectARB, _gloffset_CreateProgramObjectARB ), - NAME_FUNC_OFFSET( 7874, glCreateShaderObjectARB, _gloffset_CreateShaderObjectARB ), - NAME_FUNC_OFFSET( 7898, glDeleteObjectARB, _gloffset_DeleteObjectARB ), - NAME_FUNC_OFFSET( 7916, glDetachObjectARB, _gloffset_DetachObjectARB ), - NAME_FUNC_OFFSET( 7934, glGetActiveUniformARB, _gloffset_GetActiveUniformARB ), - NAME_FUNC_OFFSET( 7956, glGetAttachedObjectsARB, _gloffset_GetAttachedObjectsARB ), - NAME_FUNC_OFFSET( 7980, glGetHandleARB, _gloffset_GetHandleARB ), - NAME_FUNC_OFFSET( 7995, glGetInfoLogARB, _gloffset_GetInfoLogARB ), - NAME_FUNC_OFFSET( 8011, glGetObjectParameterfvARB, _gloffset_GetObjectParameterfvARB ), - NAME_FUNC_OFFSET( 8037, glGetObjectParameterivARB, _gloffset_GetObjectParameterivARB ), - NAME_FUNC_OFFSET( 8063, glGetShaderSourceARB, _gloffset_GetShaderSourceARB ), - NAME_FUNC_OFFSET( 8084, glGetUniformLocationARB, _gloffset_GetUniformLocationARB ), - NAME_FUNC_OFFSET( 8108, glGetUniformfvARB, _gloffset_GetUniformfvARB ), - NAME_FUNC_OFFSET( 8126, glGetUniformivARB, _gloffset_GetUniformivARB ), - NAME_FUNC_OFFSET( 8144, glLinkProgramARB, _gloffset_LinkProgramARB ), - NAME_FUNC_OFFSET( 8161, glShaderSourceARB, _gloffset_ShaderSourceARB ), - NAME_FUNC_OFFSET( 8179, glUniform1fARB, _gloffset_Uniform1fARB ), - NAME_FUNC_OFFSET( 8194, glUniform1fvARB, _gloffset_Uniform1fvARB ), - NAME_FUNC_OFFSET( 8210, glUniform1iARB, _gloffset_Uniform1iARB ), - NAME_FUNC_OFFSET( 8225, glUniform1ivARB, _gloffset_Uniform1ivARB ), - NAME_FUNC_OFFSET( 8241, glUniform2fARB, _gloffset_Uniform2fARB ), - NAME_FUNC_OFFSET( 8256, glUniform2fvARB, _gloffset_Uniform2fvARB ), - NAME_FUNC_OFFSET( 8272, glUniform2iARB, _gloffset_Uniform2iARB ), - NAME_FUNC_OFFSET( 8287, glUniform2ivARB, _gloffset_Uniform2ivARB ), - NAME_FUNC_OFFSET( 8303, glUniform3fARB, _gloffset_Uniform3fARB ), - NAME_FUNC_OFFSET( 8318, glUniform3fvARB, _gloffset_Uniform3fvARB ), - NAME_FUNC_OFFSET( 8334, glUniform3iARB, _gloffset_Uniform3iARB ), - NAME_FUNC_OFFSET( 8349, glUniform3ivARB, _gloffset_Uniform3ivARB ), - NAME_FUNC_OFFSET( 8365, glUniform4fARB, _gloffset_Uniform4fARB ), - NAME_FUNC_OFFSET( 8380, glUniform4fvARB, _gloffset_Uniform4fvARB ), - NAME_FUNC_OFFSET( 8396, glUniform4iARB, _gloffset_Uniform4iARB ), - NAME_FUNC_OFFSET( 8411, glUniform4ivARB, _gloffset_Uniform4ivARB ), - NAME_FUNC_OFFSET( 8427, glUniformMatrix2fvARB, _gloffset_UniformMatrix2fvARB ), - NAME_FUNC_OFFSET( 8449, glUniformMatrix3fvARB, _gloffset_UniformMatrix3fvARB ), - NAME_FUNC_OFFSET( 8471, glUniformMatrix4fvARB, _gloffset_UniformMatrix4fvARB ), - NAME_FUNC_OFFSET( 8493, glUseProgramObjectARB, _gloffset_UseProgramObjectARB ), - NAME_FUNC_OFFSET( 8515, glValidateProgramARB, _gloffset_ValidateProgramARB ), - NAME_FUNC_OFFSET( 8536, glBindAttribLocationARB, _gloffset_BindAttribLocationARB ), - NAME_FUNC_OFFSET( 8560, glGetActiveAttribARB, _gloffset_GetActiveAttribARB ), - NAME_FUNC_OFFSET( 8581, glGetAttribLocationARB, _gloffset_GetAttribLocationARB ), - NAME_FUNC_OFFSET( 8604, glDrawBuffersARB, _gloffset_DrawBuffersARB ), - NAME_FUNC_OFFSET( 8621, glPolygonOffsetEXT, _gloffset_PolygonOffsetEXT ), - NAME_FUNC_OFFSET( 8640, gl_dispatch_stub_543, _gloffset_GetHistogramEXT ), - NAME_FUNC_OFFSET( 8658, gl_dispatch_stub_544, _gloffset_GetHistogramParameterfvEXT ), - NAME_FUNC_OFFSET( 8687, gl_dispatch_stub_545, _gloffset_GetHistogramParameterivEXT ), - NAME_FUNC_OFFSET( 8716, gl_dispatch_stub_546, _gloffset_GetMinmaxEXT ), - NAME_FUNC_OFFSET( 8731, gl_dispatch_stub_547, _gloffset_GetMinmaxParameterfvEXT ), - NAME_FUNC_OFFSET( 8757, gl_dispatch_stub_548, _gloffset_GetMinmaxParameterivEXT ), - NAME_FUNC_OFFSET( 8783, gl_dispatch_stub_549, _gloffset_GetConvolutionFilterEXT ), - NAME_FUNC_OFFSET( 8809, gl_dispatch_stub_550, _gloffset_GetConvolutionParameterfvEXT ), - NAME_FUNC_OFFSET( 8840, gl_dispatch_stub_551, _gloffset_GetConvolutionParameterivEXT ), - NAME_FUNC_OFFSET( 8871, gl_dispatch_stub_552, _gloffset_GetSeparableFilterEXT ), - NAME_FUNC_OFFSET( 8895, gl_dispatch_stub_553, _gloffset_GetColorTableParameterfvSGI ), - NAME_FUNC_OFFSET( 8925, gl_dispatch_stub_554, _gloffset_GetColorTableParameterivSGI ), - NAME_FUNC_OFFSET( 8955, gl_dispatch_stub_555, _gloffset_GetColorTableSGI ), - NAME_FUNC_OFFSET( 8974, gl_dispatch_stub_556, _gloffset_GetPixelTexGenParameterfvSGIS ), - NAME_FUNC_OFFSET( 9006, gl_dispatch_stub_557, _gloffset_GetPixelTexGenParameterivSGIS ), - NAME_FUNC_OFFSET( 9038, gl_dispatch_stub_558, _gloffset_PixelTexGenParameterfSGIS ), - NAME_FUNC_OFFSET( 9066, gl_dispatch_stub_559, _gloffset_PixelTexGenParameterfvSGIS ), - NAME_FUNC_OFFSET( 9095, gl_dispatch_stub_560, _gloffset_PixelTexGenParameteriSGIS ), - NAME_FUNC_OFFSET( 9123, gl_dispatch_stub_561, _gloffset_PixelTexGenParameterivSGIS ), - NAME_FUNC_OFFSET( 9152, glAreTexturesResidentEXT, _gloffset_AreTexturesResidentEXT ), - NAME_FUNC_OFFSET( 9177, glGenTexturesEXT, _gloffset_GenTexturesEXT ), - NAME_FUNC_OFFSET( 9194, glIsTextureEXT, _gloffset_IsTextureEXT ), - NAME_FUNC_OFFSET( 9209, gl_dispatch_stub_565, _gloffset_SampleMaskSGIS ), - NAME_FUNC_OFFSET( 9226, gl_dispatch_stub_566, _gloffset_SamplePatternSGIS ), - NAME_FUNC_OFFSET( 9246, glColorPointerEXT, _gloffset_ColorPointerEXT ), - NAME_FUNC_OFFSET( 9264, glEdgeFlagPointerEXT, _gloffset_EdgeFlagPointerEXT ), - NAME_FUNC_OFFSET( 9285, glIndexPointerEXT, _gloffset_IndexPointerEXT ), - NAME_FUNC_OFFSET( 9303, glNormalPointerEXT, _gloffset_NormalPointerEXT ), - NAME_FUNC_OFFSET( 9322, glTexCoordPointerEXT, _gloffset_TexCoordPointerEXT ), - NAME_FUNC_OFFSET( 9343, glVertexPointerEXT, _gloffset_VertexPointerEXT ), - NAME_FUNC_OFFSET( 9362, glPointParameterfEXT, _gloffset_PointParameterfEXT ), - NAME_FUNC_OFFSET( 9383, glPointParameterfvEXT, _gloffset_PointParameterfvEXT ), - NAME_FUNC_OFFSET( 9405, glLockArraysEXT, _gloffset_LockArraysEXT ), - NAME_FUNC_OFFSET( 9421, glUnlockArraysEXT, _gloffset_UnlockArraysEXT ), - NAME_FUNC_OFFSET( 9439, gl_dispatch_stub_577, _gloffset_CullParameterdvEXT ), - NAME_FUNC_OFFSET( 9460, gl_dispatch_stub_578, _gloffset_CullParameterfvEXT ), - NAME_FUNC_OFFSET( 9481, glSecondaryColor3bEXT, _gloffset_SecondaryColor3bEXT ), - NAME_FUNC_OFFSET( 9503, glSecondaryColor3bvEXT, _gloffset_SecondaryColor3bvEXT ), - NAME_FUNC_OFFSET( 9526, glSecondaryColor3dEXT, _gloffset_SecondaryColor3dEXT ), - NAME_FUNC_OFFSET( 9548, glSecondaryColor3dvEXT, _gloffset_SecondaryColor3dvEXT ), - NAME_FUNC_OFFSET( 9571, glSecondaryColor3fEXT, _gloffset_SecondaryColor3fEXT ), - NAME_FUNC_OFFSET( 9593, glSecondaryColor3fvEXT, _gloffset_SecondaryColor3fvEXT ), - NAME_FUNC_OFFSET( 9616, glSecondaryColor3iEXT, _gloffset_SecondaryColor3iEXT ), - NAME_FUNC_OFFSET( 9638, glSecondaryColor3ivEXT, _gloffset_SecondaryColor3ivEXT ), - NAME_FUNC_OFFSET( 9661, glSecondaryColor3sEXT, _gloffset_SecondaryColor3sEXT ), - NAME_FUNC_OFFSET( 9683, glSecondaryColor3svEXT, _gloffset_SecondaryColor3svEXT ), - NAME_FUNC_OFFSET( 9706, glSecondaryColor3ubEXT, _gloffset_SecondaryColor3ubEXT ), - NAME_FUNC_OFFSET( 9729, glSecondaryColor3ubvEXT, _gloffset_SecondaryColor3ubvEXT ), - NAME_FUNC_OFFSET( 9753, glSecondaryColor3uiEXT, _gloffset_SecondaryColor3uiEXT ), - NAME_FUNC_OFFSET( 9776, glSecondaryColor3uivEXT, _gloffset_SecondaryColor3uivEXT ), - NAME_FUNC_OFFSET( 9800, glSecondaryColor3usEXT, _gloffset_SecondaryColor3usEXT ), - NAME_FUNC_OFFSET( 9823, glSecondaryColor3usvEXT, _gloffset_SecondaryColor3usvEXT ), - NAME_FUNC_OFFSET( 9847, glSecondaryColorPointerEXT, _gloffset_SecondaryColorPointerEXT ), - NAME_FUNC_OFFSET( 9874, glMultiDrawArraysEXT, _gloffset_MultiDrawArraysEXT ), - NAME_FUNC_OFFSET( 9895, glMultiDrawElementsEXT, _gloffset_MultiDrawElementsEXT ), - NAME_FUNC_OFFSET( 9918, glFogCoordPointerEXT, _gloffset_FogCoordPointerEXT ), - NAME_FUNC_OFFSET( 9939, glFogCoorddEXT, _gloffset_FogCoorddEXT ), - NAME_FUNC_OFFSET( 9954, glFogCoorddvEXT, _gloffset_FogCoorddvEXT ), - NAME_FUNC_OFFSET( 9970, glFogCoordfEXT, _gloffset_FogCoordfEXT ), - NAME_FUNC_OFFSET( 9985, glFogCoordfvEXT, _gloffset_FogCoordfvEXT ), - NAME_FUNC_OFFSET( 10001, gl_dispatch_stub_603, _gloffset_PixelTexGenSGIX ), - NAME_FUNC_OFFSET( 10019, glBlendFuncSeparateEXT, _gloffset_BlendFuncSeparateEXT ), - NAME_FUNC_OFFSET( 10042, glFlushVertexArrayRangeNV, _gloffset_FlushVertexArrayRangeNV ), - NAME_FUNC_OFFSET( 10068, glVertexArrayRangeNV, _gloffset_VertexArrayRangeNV ), - NAME_FUNC_OFFSET( 10089, glCombinerInputNV, _gloffset_CombinerInputNV ), - NAME_FUNC_OFFSET( 10107, glCombinerOutputNV, _gloffset_CombinerOutputNV ), - NAME_FUNC_OFFSET( 10126, glCombinerParameterfNV, _gloffset_CombinerParameterfNV ), - NAME_FUNC_OFFSET( 10149, glCombinerParameterfvNV, _gloffset_CombinerParameterfvNV ), - NAME_FUNC_OFFSET( 10173, glCombinerParameteriNV, _gloffset_CombinerParameteriNV ), - NAME_FUNC_OFFSET( 10196, glCombinerParameterivNV, _gloffset_CombinerParameterivNV ), - NAME_FUNC_OFFSET( 10220, glFinalCombinerInputNV, _gloffset_FinalCombinerInputNV ), - NAME_FUNC_OFFSET( 10243, glGetCombinerInputParameterfvNV, _gloffset_GetCombinerInputParameterfvNV ), - NAME_FUNC_OFFSET( 10275, glGetCombinerInputParameterivNV, _gloffset_GetCombinerInputParameterivNV ), - NAME_FUNC_OFFSET( 10307, glGetCombinerOutputParameterfvNV, _gloffset_GetCombinerOutputParameterfvNV ), - NAME_FUNC_OFFSET( 10340, glGetCombinerOutputParameterivNV, _gloffset_GetCombinerOutputParameterivNV ), - NAME_FUNC_OFFSET( 10373, glGetFinalCombinerInputParameterfvNV, _gloffset_GetFinalCombinerInputParameterfvNV ), - NAME_FUNC_OFFSET( 10410, glGetFinalCombinerInputParameterivNV, _gloffset_GetFinalCombinerInputParameterivNV ), - NAME_FUNC_OFFSET( 10447, glResizeBuffersMESA, _gloffset_ResizeBuffersMESA ), - NAME_FUNC_OFFSET( 10467, glWindowPos2dMESA, _gloffset_WindowPos2dMESA ), - NAME_FUNC_OFFSET( 10485, glWindowPos2dvMESA, _gloffset_WindowPos2dvMESA ), - NAME_FUNC_OFFSET( 10504, glWindowPos2fMESA, _gloffset_WindowPos2fMESA ), - NAME_FUNC_OFFSET( 10522, glWindowPos2fvMESA, _gloffset_WindowPos2fvMESA ), - NAME_FUNC_OFFSET( 10541, glWindowPos2iMESA, _gloffset_WindowPos2iMESA ), - NAME_FUNC_OFFSET( 10559, glWindowPos2ivMESA, _gloffset_WindowPos2ivMESA ), - NAME_FUNC_OFFSET( 10578, glWindowPos2sMESA, _gloffset_WindowPos2sMESA ), - NAME_FUNC_OFFSET( 10596, glWindowPos2svMESA, _gloffset_WindowPos2svMESA ), - NAME_FUNC_OFFSET( 10615, glWindowPos3dMESA, _gloffset_WindowPos3dMESA ), - NAME_FUNC_OFFSET( 10633, glWindowPos3dvMESA, _gloffset_WindowPos3dvMESA ), - NAME_FUNC_OFFSET( 10652, glWindowPos3fMESA, _gloffset_WindowPos3fMESA ), - NAME_FUNC_OFFSET( 10670, glWindowPos3fvMESA, _gloffset_WindowPos3fvMESA ), - NAME_FUNC_OFFSET( 10689, glWindowPos3iMESA, _gloffset_WindowPos3iMESA ), - NAME_FUNC_OFFSET( 10707, glWindowPos3ivMESA, _gloffset_WindowPos3ivMESA ), - NAME_FUNC_OFFSET( 10726, glWindowPos3sMESA, _gloffset_WindowPos3sMESA ), - NAME_FUNC_OFFSET( 10744, glWindowPos3svMESA, _gloffset_WindowPos3svMESA ), - NAME_FUNC_OFFSET( 10763, glWindowPos4dMESA, _gloffset_WindowPos4dMESA ), - NAME_FUNC_OFFSET( 10781, glWindowPos4dvMESA, _gloffset_WindowPos4dvMESA ), - NAME_FUNC_OFFSET( 10800, glWindowPos4fMESA, _gloffset_WindowPos4fMESA ), - NAME_FUNC_OFFSET( 10818, glWindowPos4fvMESA, _gloffset_WindowPos4fvMESA ), - NAME_FUNC_OFFSET( 10837, glWindowPos4iMESA, _gloffset_WindowPos4iMESA ), - NAME_FUNC_OFFSET( 10855, glWindowPos4ivMESA, _gloffset_WindowPos4ivMESA ), - NAME_FUNC_OFFSET( 10874, glWindowPos4sMESA, _gloffset_WindowPos4sMESA ), - NAME_FUNC_OFFSET( 10892, glWindowPos4svMESA, _gloffset_WindowPos4svMESA ), - NAME_FUNC_OFFSET( 10911, gl_dispatch_stub_645, _gloffset_MultiModeDrawArraysIBM ), - NAME_FUNC_OFFSET( 10936, gl_dispatch_stub_646, _gloffset_MultiModeDrawElementsIBM ), - NAME_FUNC_OFFSET( 10963, gl_dispatch_stub_647, _gloffset_DeleteFencesNV ), - NAME_FUNC_OFFSET( 10980, gl_dispatch_stub_648, _gloffset_FinishFenceNV ), - NAME_FUNC_OFFSET( 10996, gl_dispatch_stub_649, _gloffset_GenFencesNV ), - NAME_FUNC_OFFSET( 11010, gl_dispatch_stub_650, _gloffset_GetFenceivNV ), - NAME_FUNC_OFFSET( 11025, gl_dispatch_stub_651, _gloffset_IsFenceNV ), - NAME_FUNC_OFFSET( 11037, gl_dispatch_stub_652, _gloffset_SetFenceNV ), - NAME_FUNC_OFFSET( 11050, gl_dispatch_stub_653, _gloffset_TestFenceNV ), - NAME_FUNC_OFFSET( 11064, glAreProgramsResidentNV, _gloffset_AreProgramsResidentNV ), - NAME_FUNC_OFFSET( 11088, glBindProgramNV, _gloffset_BindProgramNV ), - NAME_FUNC_OFFSET( 11104, glDeleteProgramsNV, _gloffset_DeleteProgramsNV ), - NAME_FUNC_OFFSET( 11123, glExecuteProgramNV, _gloffset_ExecuteProgramNV ), - NAME_FUNC_OFFSET( 11142, glGenProgramsNV, _gloffset_GenProgramsNV ), - NAME_FUNC_OFFSET( 11158, glGetProgramParameterdvNV, _gloffset_GetProgramParameterdvNV ), - NAME_FUNC_OFFSET( 11184, glGetProgramParameterfvNV, _gloffset_GetProgramParameterfvNV ), - NAME_FUNC_OFFSET( 11210, glGetProgramStringNV, _gloffset_GetProgramStringNV ), - NAME_FUNC_OFFSET( 11231, glGetProgramivNV, _gloffset_GetProgramivNV ), - NAME_FUNC_OFFSET( 11248, glGetTrackMatrixivNV, _gloffset_GetTrackMatrixivNV ), - NAME_FUNC_OFFSET( 11269, glGetVertexAttribPointervNV, _gloffset_GetVertexAttribPointervNV ), - NAME_FUNC_OFFSET( 11297, glGetVertexAttribdvNV, _gloffset_GetVertexAttribdvNV ), - NAME_FUNC_OFFSET( 11319, glGetVertexAttribfvNV, _gloffset_GetVertexAttribfvNV ), - NAME_FUNC_OFFSET( 11341, glGetVertexAttribivNV, _gloffset_GetVertexAttribivNV ), - NAME_FUNC_OFFSET( 11363, glIsProgramNV, _gloffset_IsProgramNV ), - NAME_FUNC_OFFSET( 11377, glLoadProgramNV, _gloffset_LoadProgramNV ), - NAME_FUNC_OFFSET( 11393, glProgramParameter4dNV, _gloffset_ProgramParameter4dNV ), - NAME_FUNC_OFFSET( 11416, glProgramParameter4dvNV, _gloffset_ProgramParameter4dvNV ), - NAME_FUNC_OFFSET( 11440, glProgramParameter4fNV, _gloffset_ProgramParameter4fNV ), - NAME_FUNC_OFFSET( 11463, glProgramParameter4fvNV, _gloffset_ProgramParameter4fvNV ), - NAME_FUNC_OFFSET( 11487, glProgramParameters4dvNV, _gloffset_ProgramParameters4dvNV ), - NAME_FUNC_OFFSET( 11512, glProgramParameters4fvNV, _gloffset_ProgramParameters4fvNV ), - NAME_FUNC_OFFSET( 11537, glRequestResidentProgramsNV, _gloffset_RequestResidentProgramsNV ), - NAME_FUNC_OFFSET( 11565, glTrackMatrixNV, _gloffset_TrackMatrixNV ), - NAME_FUNC_OFFSET( 11581, glVertexAttrib1dNV, _gloffset_VertexAttrib1dNV ), - NAME_FUNC_OFFSET( 11600, glVertexAttrib1dvNV, _gloffset_VertexAttrib1dvNV ), - NAME_FUNC_OFFSET( 11620, glVertexAttrib1fNV, _gloffset_VertexAttrib1fNV ), - NAME_FUNC_OFFSET( 11639, glVertexAttrib1fvNV, _gloffset_VertexAttrib1fvNV ), - NAME_FUNC_OFFSET( 11659, glVertexAttrib1sNV, _gloffset_VertexAttrib1sNV ), - NAME_FUNC_OFFSET( 11678, glVertexAttrib1svNV, _gloffset_VertexAttrib1svNV ), - NAME_FUNC_OFFSET( 11698, glVertexAttrib2dNV, _gloffset_VertexAttrib2dNV ), - NAME_FUNC_OFFSET( 11717, glVertexAttrib2dvNV, _gloffset_VertexAttrib2dvNV ), - NAME_FUNC_OFFSET( 11737, glVertexAttrib2fNV, _gloffset_VertexAttrib2fNV ), - NAME_FUNC_OFFSET( 11756, glVertexAttrib2fvNV, _gloffset_VertexAttrib2fvNV ), - NAME_FUNC_OFFSET( 11776, glVertexAttrib2sNV, _gloffset_VertexAttrib2sNV ), - NAME_FUNC_OFFSET( 11795, glVertexAttrib2svNV, _gloffset_VertexAttrib2svNV ), - NAME_FUNC_OFFSET( 11815, glVertexAttrib3dNV, _gloffset_VertexAttrib3dNV ), - NAME_FUNC_OFFSET( 11834, glVertexAttrib3dvNV, _gloffset_VertexAttrib3dvNV ), - NAME_FUNC_OFFSET( 11854, glVertexAttrib3fNV, _gloffset_VertexAttrib3fNV ), - NAME_FUNC_OFFSET( 11873, glVertexAttrib3fvNV, _gloffset_VertexAttrib3fvNV ), - NAME_FUNC_OFFSET( 11893, glVertexAttrib3sNV, _gloffset_VertexAttrib3sNV ), - NAME_FUNC_OFFSET( 11912, glVertexAttrib3svNV, _gloffset_VertexAttrib3svNV ), - NAME_FUNC_OFFSET( 11932, glVertexAttrib4dNV, _gloffset_VertexAttrib4dNV ), - NAME_FUNC_OFFSET( 11951, glVertexAttrib4dvNV, _gloffset_VertexAttrib4dvNV ), - NAME_FUNC_OFFSET( 11971, glVertexAttrib4fNV, _gloffset_VertexAttrib4fNV ), - NAME_FUNC_OFFSET( 11990, glVertexAttrib4fvNV, _gloffset_VertexAttrib4fvNV ), - NAME_FUNC_OFFSET( 12010, glVertexAttrib4sNV, _gloffset_VertexAttrib4sNV ), - NAME_FUNC_OFFSET( 12029, glVertexAttrib4svNV, _gloffset_VertexAttrib4svNV ), - NAME_FUNC_OFFSET( 12049, glVertexAttrib4ubNV, _gloffset_VertexAttrib4ubNV ), - NAME_FUNC_OFFSET( 12069, glVertexAttrib4ubvNV, _gloffset_VertexAttrib4ubvNV ), - NAME_FUNC_OFFSET( 12090, glVertexAttribPointerNV, _gloffset_VertexAttribPointerNV ), - NAME_FUNC_OFFSET( 12114, glVertexAttribs1dvNV, _gloffset_VertexAttribs1dvNV ), - NAME_FUNC_OFFSET( 12135, glVertexAttribs1fvNV, _gloffset_VertexAttribs1fvNV ), - NAME_FUNC_OFFSET( 12156, glVertexAttribs1svNV, _gloffset_VertexAttribs1svNV ), - NAME_FUNC_OFFSET( 12177, glVertexAttribs2dvNV, _gloffset_VertexAttribs2dvNV ), - NAME_FUNC_OFFSET( 12198, glVertexAttribs2fvNV, _gloffset_VertexAttribs2fvNV ), - NAME_FUNC_OFFSET( 12219, glVertexAttribs2svNV, _gloffset_VertexAttribs2svNV ), - NAME_FUNC_OFFSET( 12240, glVertexAttribs3dvNV, _gloffset_VertexAttribs3dvNV ), - NAME_FUNC_OFFSET( 12261, glVertexAttribs3fvNV, _gloffset_VertexAttribs3fvNV ), - NAME_FUNC_OFFSET( 12282, glVertexAttribs3svNV, _gloffset_VertexAttribs3svNV ), - NAME_FUNC_OFFSET( 12303, glVertexAttribs4dvNV, _gloffset_VertexAttribs4dvNV ), - NAME_FUNC_OFFSET( 12324, glVertexAttribs4fvNV, _gloffset_VertexAttribs4fvNV ), - NAME_FUNC_OFFSET( 12345, glVertexAttribs4svNV, _gloffset_VertexAttribs4svNV ), - NAME_FUNC_OFFSET( 12366, glVertexAttribs4ubvNV, _gloffset_VertexAttribs4ubvNV ), - NAME_FUNC_OFFSET( 12388, glAlphaFragmentOp1ATI, _gloffset_AlphaFragmentOp1ATI ), - NAME_FUNC_OFFSET( 12410, glAlphaFragmentOp2ATI, _gloffset_AlphaFragmentOp2ATI ), - NAME_FUNC_OFFSET( 12432, glAlphaFragmentOp3ATI, _gloffset_AlphaFragmentOp3ATI ), - NAME_FUNC_OFFSET( 12454, glBeginFragmentShaderATI, _gloffset_BeginFragmentShaderATI ), - NAME_FUNC_OFFSET( 12479, glBindFragmentShaderATI, _gloffset_BindFragmentShaderATI ), - NAME_FUNC_OFFSET( 12503, glColorFragmentOp1ATI, _gloffset_ColorFragmentOp1ATI ), - NAME_FUNC_OFFSET( 12525, glColorFragmentOp2ATI, _gloffset_ColorFragmentOp2ATI ), - NAME_FUNC_OFFSET( 12547, glColorFragmentOp3ATI, _gloffset_ColorFragmentOp3ATI ), - NAME_FUNC_OFFSET( 12569, glDeleteFragmentShaderATI, _gloffset_DeleteFragmentShaderATI ), - NAME_FUNC_OFFSET( 12595, glEndFragmentShaderATI, _gloffset_EndFragmentShaderATI ), - NAME_FUNC_OFFSET( 12618, glGenFragmentShadersATI, _gloffset_GenFragmentShadersATI ), - NAME_FUNC_OFFSET( 12642, glPassTexCoordATI, _gloffset_PassTexCoordATI ), - NAME_FUNC_OFFSET( 12660, glSampleMapATI, _gloffset_SampleMapATI ), - NAME_FUNC_OFFSET( 12675, glSetFragmentShaderConstantATI, _gloffset_SetFragmentShaderConstantATI ), - NAME_FUNC_OFFSET( 12706, glPointParameteriNV, _gloffset_PointParameteriNV ), - NAME_FUNC_OFFSET( 12726, glPointParameterivNV, _gloffset_PointParameterivNV ), - NAME_FUNC_OFFSET( 12747, gl_dispatch_stub_734, _gloffset_ActiveStencilFaceEXT ), - NAME_FUNC_OFFSET( 12770, gl_dispatch_stub_735, _gloffset_BindVertexArrayAPPLE ), - NAME_FUNC_OFFSET( 12793, gl_dispatch_stub_736, _gloffset_DeleteVertexArraysAPPLE ), - NAME_FUNC_OFFSET( 12819, gl_dispatch_stub_737, _gloffset_GenVertexArraysAPPLE ), - NAME_FUNC_OFFSET( 12842, gl_dispatch_stub_738, _gloffset_IsVertexArrayAPPLE ), - NAME_FUNC_OFFSET( 12863, glGetProgramNamedParameterdvNV, _gloffset_GetProgramNamedParameterdvNV ), - NAME_FUNC_OFFSET( 12894, glGetProgramNamedParameterfvNV, _gloffset_GetProgramNamedParameterfvNV ), - NAME_FUNC_OFFSET( 12925, glProgramNamedParameter4dNV, _gloffset_ProgramNamedParameter4dNV ), - NAME_FUNC_OFFSET( 12953, glProgramNamedParameter4dvNV, _gloffset_ProgramNamedParameter4dvNV ), - NAME_FUNC_OFFSET( 12982, glProgramNamedParameter4fNV, _gloffset_ProgramNamedParameter4fNV ), - NAME_FUNC_OFFSET( 13010, glProgramNamedParameter4fvNV, _gloffset_ProgramNamedParameter4fvNV ), - NAME_FUNC_OFFSET( 13039, gl_dispatch_stub_745, _gloffset_DepthBoundsEXT ), - NAME_FUNC_OFFSET( 13056, gl_dispatch_stub_746, _gloffset_BlendEquationSeparateEXT ), - NAME_FUNC_OFFSET( 13083, glBindFramebufferEXT, _gloffset_BindFramebufferEXT ), - NAME_FUNC_OFFSET( 13104, glBindRenderbufferEXT, _gloffset_BindRenderbufferEXT ), - NAME_FUNC_OFFSET( 13126, glCheckFramebufferStatusEXT, _gloffset_CheckFramebufferStatusEXT ), - NAME_FUNC_OFFSET( 13154, glDeleteFramebuffersEXT, _gloffset_DeleteFramebuffersEXT ), - NAME_FUNC_OFFSET( 13178, glDeleteRenderbuffersEXT, _gloffset_DeleteRenderbuffersEXT ), - NAME_FUNC_OFFSET( 13203, glFramebufferRenderbufferEXT, _gloffset_FramebufferRenderbufferEXT ), - NAME_FUNC_OFFSET( 13232, glFramebufferTexture1DEXT, _gloffset_FramebufferTexture1DEXT ), - NAME_FUNC_OFFSET( 13258, glFramebufferTexture2DEXT, _gloffset_FramebufferTexture2DEXT ), - NAME_FUNC_OFFSET( 13284, glFramebufferTexture3DEXT, _gloffset_FramebufferTexture3DEXT ), - NAME_FUNC_OFFSET( 13310, glGenFramebuffersEXT, _gloffset_GenFramebuffersEXT ), - NAME_FUNC_OFFSET( 13331, glGenRenderbuffersEXT, _gloffset_GenRenderbuffersEXT ), - NAME_FUNC_OFFSET( 13353, glGenerateMipmapEXT, _gloffset_GenerateMipmapEXT ), - NAME_FUNC_OFFSET( 13373, glGetFramebufferAttachmentParameterivEXT, _gloffset_GetFramebufferAttachmentParameterivEXT ), - NAME_FUNC_OFFSET( 13414, gl_dispatch_stub_760, _gloffset_GetQueryObjecti64vEXT ), - NAME_FUNC_OFFSET( 13438, gl_dispatch_stub_761, _gloffset_GetQueryObjectui64vEXT ), - NAME_FUNC_OFFSET( 13463, glGetRenderbufferParameterivEXT, _gloffset_GetRenderbufferParameterivEXT ), - NAME_FUNC_OFFSET( 13495, glIsFramebufferEXT, _gloffset_IsFramebufferEXT ), - NAME_FUNC_OFFSET( 13514, glIsRenderbufferEXT, _gloffset_IsRenderbufferEXT ), - NAME_FUNC_OFFSET( 13534, glRenderbufferStorageEXT, _gloffset_RenderbufferStorageEXT ), - NAME_FUNC_OFFSET( 13559, gl_dispatch_stub_766, _gloffset_BlitFramebufferEXT ), - NAME_FUNC_OFFSET( 13580, gl_dispatch_stub_767, _gloffset_ProgramEnvParameters4fvEXT ), - NAME_FUNC_OFFSET( 13609, gl_dispatch_stub_768, _gloffset_ProgramLocalParameters4fvEXT ), - NAME_FUNC_OFFSET( 13640, glArrayElement, _gloffset_ArrayElement ), - NAME_FUNC_OFFSET( 13658, glBindTexture, _gloffset_BindTexture ), - NAME_FUNC_OFFSET( 13675, glDrawArrays, _gloffset_DrawArrays ), - NAME_FUNC_OFFSET( 13691, glCopyTexImage1D, _gloffset_CopyTexImage1D ), - NAME_FUNC_OFFSET( 13711, glCopyTexImage2D, _gloffset_CopyTexImage2D ), - NAME_FUNC_OFFSET( 13731, glCopyTexSubImage1D, _gloffset_CopyTexSubImage1D ), - NAME_FUNC_OFFSET( 13754, glCopyTexSubImage2D, _gloffset_CopyTexSubImage2D ), - NAME_FUNC_OFFSET( 13777, glDeleteTextures, _gloffset_DeleteTextures ), - NAME_FUNC_OFFSET( 13797, glGetPointerv, _gloffset_GetPointerv ), - NAME_FUNC_OFFSET( 13814, glPrioritizeTextures, _gloffset_PrioritizeTextures ), - NAME_FUNC_OFFSET( 13838, glTexSubImage1D, _gloffset_TexSubImage1D ), - NAME_FUNC_OFFSET( 13857, glTexSubImage2D, _gloffset_TexSubImage2D ), - NAME_FUNC_OFFSET( 13876, glBlendColor, _gloffset_BlendColor ), - NAME_FUNC_OFFSET( 13892, glBlendEquation, _gloffset_BlendEquation ), - NAME_FUNC_OFFSET( 13911, glDrawRangeElements, _gloffset_DrawRangeElements ), - NAME_FUNC_OFFSET( 13934, glColorTable, _gloffset_ColorTable ), - NAME_FUNC_OFFSET( 13950, glColorTable, _gloffset_ColorTable ), - NAME_FUNC_OFFSET( 13966, glColorTableParameterfv, _gloffset_ColorTableParameterfv ), - NAME_FUNC_OFFSET( 13993, glColorTableParameteriv, _gloffset_ColorTableParameteriv ), - NAME_FUNC_OFFSET( 14020, glCopyColorTable, _gloffset_CopyColorTable ), - NAME_FUNC_OFFSET( 14040, glColorSubTable, _gloffset_ColorSubTable ), - NAME_FUNC_OFFSET( 14059, glCopyColorSubTable, _gloffset_CopyColorSubTable ), - NAME_FUNC_OFFSET( 14082, glConvolutionFilter1D, _gloffset_ConvolutionFilter1D ), - NAME_FUNC_OFFSET( 14107, glConvolutionFilter2D, _gloffset_ConvolutionFilter2D ), - NAME_FUNC_OFFSET( 14132, glConvolutionParameterf, _gloffset_ConvolutionParameterf ), - NAME_FUNC_OFFSET( 14159, glConvolutionParameterfv, _gloffset_ConvolutionParameterfv ), - NAME_FUNC_OFFSET( 14187, glConvolutionParameteri, _gloffset_ConvolutionParameteri ), - NAME_FUNC_OFFSET( 14214, glConvolutionParameteriv, _gloffset_ConvolutionParameteriv ), - NAME_FUNC_OFFSET( 14242, glCopyConvolutionFilter1D, _gloffset_CopyConvolutionFilter1D ), - NAME_FUNC_OFFSET( 14271, glCopyConvolutionFilter2D, _gloffset_CopyConvolutionFilter2D ), - NAME_FUNC_OFFSET( 14300, glSeparableFilter2D, _gloffset_SeparableFilter2D ), - NAME_FUNC_OFFSET( 14323, glHistogram, _gloffset_Histogram ), - NAME_FUNC_OFFSET( 14338, glMinmax, _gloffset_Minmax ), - NAME_FUNC_OFFSET( 14350, glResetHistogram, _gloffset_ResetHistogram ), - NAME_FUNC_OFFSET( 14370, glResetMinmax, _gloffset_ResetMinmax ), - NAME_FUNC_OFFSET( 14387, glTexImage3D, _gloffset_TexImage3D ), - NAME_FUNC_OFFSET( 14403, glTexSubImage3D, _gloffset_TexSubImage3D ), - NAME_FUNC_OFFSET( 14422, glCopyTexSubImage3D, _gloffset_CopyTexSubImage3D ), - NAME_FUNC_OFFSET( 14445, glActiveTextureARB, _gloffset_ActiveTextureARB ), - NAME_FUNC_OFFSET( 14461, glClientActiveTextureARB, _gloffset_ClientActiveTextureARB ), - NAME_FUNC_OFFSET( 14483, glMultiTexCoord1dARB, _gloffset_MultiTexCoord1dARB ), - NAME_FUNC_OFFSET( 14501, glMultiTexCoord1dvARB, _gloffset_MultiTexCoord1dvARB ), - NAME_FUNC_OFFSET( 14520, glMultiTexCoord1fARB, _gloffset_MultiTexCoord1fARB ), - NAME_FUNC_OFFSET( 14538, glMultiTexCoord1fvARB, _gloffset_MultiTexCoord1fvARB ), - NAME_FUNC_OFFSET( 14557, glMultiTexCoord1iARB, _gloffset_MultiTexCoord1iARB ), - NAME_FUNC_OFFSET( 14575, glMultiTexCoord1ivARB, _gloffset_MultiTexCoord1ivARB ), - NAME_FUNC_OFFSET( 14594, glMultiTexCoord1sARB, _gloffset_MultiTexCoord1sARB ), - NAME_FUNC_OFFSET( 14612, glMultiTexCoord1svARB, _gloffset_MultiTexCoord1svARB ), - NAME_FUNC_OFFSET( 14631, glMultiTexCoord2dARB, _gloffset_MultiTexCoord2dARB ), - NAME_FUNC_OFFSET( 14649, glMultiTexCoord2dvARB, _gloffset_MultiTexCoord2dvARB ), - NAME_FUNC_OFFSET( 14668, glMultiTexCoord2fARB, _gloffset_MultiTexCoord2fARB ), - NAME_FUNC_OFFSET( 14686, glMultiTexCoord2fvARB, _gloffset_MultiTexCoord2fvARB ), - NAME_FUNC_OFFSET( 14705, glMultiTexCoord2iARB, _gloffset_MultiTexCoord2iARB ), - NAME_FUNC_OFFSET( 14723, glMultiTexCoord2ivARB, _gloffset_MultiTexCoord2ivARB ), - NAME_FUNC_OFFSET( 14742, glMultiTexCoord2sARB, _gloffset_MultiTexCoord2sARB ), - NAME_FUNC_OFFSET( 14760, glMultiTexCoord2svARB, _gloffset_MultiTexCoord2svARB ), - NAME_FUNC_OFFSET( 14779, glMultiTexCoord3dARB, _gloffset_MultiTexCoord3dARB ), - NAME_FUNC_OFFSET( 14797, glMultiTexCoord3dvARB, _gloffset_MultiTexCoord3dvARB ), - NAME_FUNC_OFFSET( 14816, glMultiTexCoord3fARB, _gloffset_MultiTexCoord3fARB ), - NAME_FUNC_OFFSET( 14834, glMultiTexCoord3fvARB, _gloffset_MultiTexCoord3fvARB ), - NAME_FUNC_OFFSET( 14853, glMultiTexCoord3iARB, _gloffset_MultiTexCoord3iARB ), - NAME_FUNC_OFFSET( 14871, glMultiTexCoord3ivARB, _gloffset_MultiTexCoord3ivARB ), - NAME_FUNC_OFFSET( 14890, glMultiTexCoord3sARB, _gloffset_MultiTexCoord3sARB ), - NAME_FUNC_OFFSET( 14908, glMultiTexCoord3svARB, _gloffset_MultiTexCoord3svARB ), - NAME_FUNC_OFFSET( 14927, glMultiTexCoord4dARB, _gloffset_MultiTexCoord4dARB ), - NAME_FUNC_OFFSET( 14945, glMultiTexCoord4dvARB, _gloffset_MultiTexCoord4dvARB ), - NAME_FUNC_OFFSET( 14964, glMultiTexCoord4fARB, _gloffset_MultiTexCoord4fARB ), - NAME_FUNC_OFFSET( 14982, glMultiTexCoord4fvARB, _gloffset_MultiTexCoord4fvARB ), - NAME_FUNC_OFFSET( 15001, glMultiTexCoord4iARB, _gloffset_MultiTexCoord4iARB ), - NAME_FUNC_OFFSET( 15019, glMultiTexCoord4ivARB, _gloffset_MultiTexCoord4ivARB ), - NAME_FUNC_OFFSET( 15038, glMultiTexCoord4sARB, _gloffset_MultiTexCoord4sARB ), - NAME_FUNC_OFFSET( 15056, glMultiTexCoord4svARB, _gloffset_MultiTexCoord4svARB ), - NAME_FUNC_OFFSET( 15075, glLoadTransposeMatrixdARB, _gloffset_LoadTransposeMatrixdARB ), - NAME_FUNC_OFFSET( 15098, glLoadTransposeMatrixfARB, _gloffset_LoadTransposeMatrixfARB ), - NAME_FUNC_OFFSET( 15121, glMultTransposeMatrixdARB, _gloffset_MultTransposeMatrixdARB ), - NAME_FUNC_OFFSET( 15144, glMultTransposeMatrixfARB, _gloffset_MultTransposeMatrixfARB ), - NAME_FUNC_OFFSET( 15167, glSampleCoverageARB, _gloffset_SampleCoverageARB ), - NAME_FUNC_OFFSET( 15184, glCompressedTexImage1DARB, _gloffset_CompressedTexImage1DARB ), - NAME_FUNC_OFFSET( 15207, glCompressedTexImage2DARB, _gloffset_CompressedTexImage2DARB ), - NAME_FUNC_OFFSET( 15230, glCompressedTexImage3DARB, _gloffset_CompressedTexImage3DARB ), - NAME_FUNC_OFFSET( 15253, glCompressedTexSubImage1DARB, _gloffset_CompressedTexSubImage1DARB ), - NAME_FUNC_OFFSET( 15279, glCompressedTexSubImage2DARB, _gloffset_CompressedTexSubImage2DARB ), - NAME_FUNC_OFFSET( 15305, glCompressedTexSubImage3DARB, _gloffset_CompressedTexSubImage3DARB ), - NAME_FUNC_OFFSET( 15331, glGetCompressedTexImageARB, _gloffset_GetCompressedTexImageARB ), - NAME_FUNC_OFFSET( 15355, glBindBufferARB, _gloffset_BindBufferARB ), - NAME_FUNC_OFFSET( 15368, glBufferDataARB, _gloffset_BufferDataARB ), - NAME_FUNC_OFFSET( 15381, glBufferSubDataARB, _gloffset_BufferSubDataARB ), - NAME_FUNC_OFFSET( 15397, glDeleteBuffersARB, _gloffset_DeleteBuffersARB ), - NAME_FUNC_OFFSET( 15413, glGenBuffersARB, _gloffset_GenBuffersARB ), - NAME_FUNC_OFFSET( 15426, glGetBufferParameterivARB, _gloffset_GetBufferParameterivARB ), - NAME_FUNC_OFFSET( 15449, glGetBufferPointervARB, _gloffset_GetBufferPointervARB ), - NAME_FUNC_OFFSET( 15469, glGetBufferSubDataARB, _gloffset_GetBufferSubDataARB ), - NAME_FUNC_OFFSET( 15488, glIsBufferARB, _gloffset_IsBufferARB ), - NAME_FUNC_OFFSET( 15499, glMapBufferARB, _gloffset_MapBufferARB ), - NAME_FUNC_OFFSET( 15511, glUnmapBufferARB, _gloffset_UnmapBufferARB ), - NAME_FUNC_OFFSET( 15525, glBeginQueryARB, _gloffset_BeginQueryARB ), - NAME_FUNC_OFFSET( 15538, glDeleteQueriesARB, _gloffset_DeleteQueriesARB ), - NAME_FUNC_OFFSET( 15554, glEndQueryARB, _gloffset_EndQueryARB ), - NAME_FUNC_OFFSET( 15565, glGenQueriesARB, _gloffset_GenQueriesARB ), - NAME_FUNC_OFFSET( 15578, glGetQueryObjectivARB, _gloffset_GetQueryObjectivARB ), - NAME_FUNC_OFFSET( 15597, glGetQueryObjectuivARB, _gloffset_GetQueryObjectuivARB ), - NAME_FUNC_OFFSET( 15617, glGetQueryivARB, _gloffset_GetQueryivARB ), - NAME_FUNC_OFFSET( 15630, glIsQueryARB, _gloffset_IsQueryARB ), - NAME_FUNC_OFFSET( 15640, glDrawBuffersARB, _gloffset_DrawBuffersARB ), - NAME_FUNC_OFFSET( 15654, glDrawBuffersARB, _gloffset_DrawBuffersARB ), - NAME_FUNC_OFFSET( 15671, gl_dispatch_stub_553, _gloffset_GetColorTableParameterfvSGI ), - NAME_FUNC_OFFSET( 15701, gl_dispatch_stub_554, _gloffset_GetColorTableParameterivSGI ), - NAME_FUNC_OFFSET( 15731, gl_dispatch_stub_555, _gloffset_GetColorTableSGI ), - NAME_FUNC_OFFSET( 15750, gl_dispatch_stub_565, _gloffset_SampleMaskSGIS ), - NAME_FUNC_OFFSET( 15766, gl_dispatch_stub_566, _gloffset_SamplePatternSGIS ), - NAME_FUNC_OFFSET( 15785, glPointParameterfEXT, _gloffset_PointParameterfEXT ), - NAME_FUNC_OFFSET( 15803, glPointParameterfEXT, _gloffset_PointParameterfEXT ), - NAME_FUNC_OFFSET( 15824, glPointParameterfEXT, _gloffset_PointParameterfEXT ), - NAME_FUNC_OFFSET( 15846, glPointParameterfvEXT, _gloffset_PointParameterfvEXT ), - NAME_FUNC_OFFSET( 15865, glPointParameterfvEXT, _gloffset_PointParameterfvEXT ), - NAME_FUNC_OFFSET( 15887, glPointParameterfvEXT, _gloffset_PointParameterfvEXT ), - NAME_FUNC_OFFSET( 15910, glSecondaryColor3bEXT, _gloffset_SecondaryColor3bEXT ), - NAME_FUNC_OFFSET( 15929, glSecondaryColor3bvEXT, _gloffset_SecondaryColor3bvEXT ), - NAME_FUNC_OFFSET( 15949, glSecondaryColor3dEXT, _gloffset_SecondaryColor3dEXT ), - NAME_FUNC_OFFSET( 15968, glSecondaryColor3dvEXT, _gloffset_SecondaryColor3dvEXT ), - NAME_FUNC_OFFSET( 15988, glSecondaryColor3fEXT, _gloffset_SecondaryColor3fEXT ), - NAME_FUNC_OFFSET( 16007, glSecondaryColor3fvEXT, _gloffset_SecondaryColor3fvEXT ), - NAME_FUNC_OFFSET( 16027, glSecondaryColor3iEXT, _gloffset_SecondaryColor3iEXT ), - NAME_FUNC_OFFSET( 16046, glSecondaryColor3ivEXT, _gloffset_SecondaryColor3ivEXT ), - NAME_FUNC_OFFSET( 16066, glSecondaryColor3sEXT, _gloffset_SecondaryColor3sEXT ), - NAME_FUNC_OFFSET( 16085, glSecondaryColor3svEXT, _gloffset_SecondaryColor3svEXT ), - NAME_FUNC_OFFSET( 16105, glSecondaryColor3ubEXT, _gloffset_SecondaryColor3ubEXT ), - NAME_FUNC_OFFSET( 16125, glSecondaryColor3ubvEXT, _gloffset_SecondaryColor3ubvEXT ), - NAME_FUNC_OFFSET( 16146, glSecondaryColor3uiEXT, _gloffset_SecondaryColor3uiEXT ), - NAME_FUNC_OFFSET( 16166, glSecondaryColor3uivEXT, _gloffset_SecondaryColor3uivEXT ), - NAME_FUNC_OFFSET( 16187, glSecondaryColor3usEXT, _gloffset_SecondaryColor3usEXT ), - NAME_FUNC_OFFSET( 16207, glSecondaryColor3usvEXT, _gloffset_SecondaryColor3usvEXT ), - NAME_FUNC_OFFSET( 16228, glSecondaryColorPointerEXT, _gloffset_SecondaryColorPointerEXT ), - NAME_FUNC_OFFSET( 16252, glMultiDrawArraysEXT, _gloffset_MultiDrawArraysEXT ), - NAME_FUNC_OFFSET( 16270, glMultiDrawElementsEXT, _gloffset_MultiDrawElementsEXT ), - NAME_FUNC_OFFSET( 16290, glFogCoordPointerEXT, _gloffset_FogCoordPointerEXT ), - NAME_FUNC_OFFSET( 16308, glFogCoorddEXT, _gloffset_FogCoorddEXT ), - NAME_FUNC_OFFSET( 16320, glFogCoorddvEXT, _gloffset_FogCoorddvEXT ), - NAME_FUNC_OFFSET( 16333, glFogCoordfEXT, _gloffset_FogCoordfEXT ), - NAME_FUNC_OFFSET( 16345, glFogCoordfvEXT, _gloffset_FogCoordfvEXT ), - NAME_FUNC_OFFSET( 16358, glBlendFuncSeparateEXT, _gloffset_BlendFuncSeparateEXT ), - NAME_FUNC_OFFSET( 16378, glBlendFuncSeparateEXT, _gloffset_BlendFuncSeparateEXT ), - NAME_FUNC_OFFSET( 16402, glWindowPos2dMESA, _gloffset_WindowPos2dMESA ), - NAME_FUNC_OFFSET( 16416, glWindowPos2dMESA, _gloffset_WindowPos2dMESA ), - NAME_FUNC_OFFSET( 16433, glWindowPos2dvMESA, _gloffset_WindowPos2dvMESA ), - NAME_FUNC_OFFSET( 16448, glWindowPos2dvMESA, _gloffset_WindowPos2dvMESA ), - NAME_FUNC_OFFSET( 16466, glWindowPos2fMESA, _gloffset_WindowPos2fMESA ), - NAME_FUNC_OFFSET( 16480, glWindowPos2fMESA, _gloffset_WindowPos2fMESA ), - NAME_FUNC_OFFSET( 16497, glWindowPos2fvMESA, _gloffset_WindowPos2fvMESA ), - NAME_FUNC_OFFSET( 16512, glWindowPos2fvMESA, _gloffset_WindowPos2fvMESA ), - NAME_FUNC_OFFSET( 16530, glWindowPos2iMESA, _gloffset_WindowPos2iMESA ), - NAME_FUNC_OFFSET( 16544, glWindowPos2iMESA, _gloffset_WindowPos2iMESA ), - NAME_FUNC_OFFSET( 16561, glWindowPos2ivMESA, _gloffset_WindowPos2ivMESA ), - NAME_FUNC_OFFSET( 16576, glWindowPos2ivMESA, _gloffset_WindowPos2ivMESA ), - NAME_FUNC_OFFSET( 16594, glWindowPos2sMESA, _gloffset_WindowPos2sMESA ), - NAME_FUNC_OFFSET( 16608, glWindowPos2sMESA, _gloffset_WindowPos2sMESA ), - NAME_FUNC_OFFSET( 16625, glWindowPos2svMESA, _gloffset_WindowPos2svMESA ), - NAME_FUNC_OFFSET( 16640, glWindowPos2svMESA, _gloffset_WindowPos2svMESA ), - NAME_FUNC_OFFSET( 16658, glWindowPos3dMESA, _gloffset_WindowPos3dMESA ), - NAME_FUNC_OFFSET( 16672, glWindowPos3dMESA, _gloffset_WindowPos3dMESA ), - NAME_FUNC_OFFSET( 16689, glWindowPos3dvMESA, _gloffset_WindowPos3dvMESA ), - NAME_FUNC_OFFSET( 16704, glWindowPos3dvMESA, _gloffset_WindowPos3dvMESA ), - NAME_FUNC_OFFSET( 16722, glWindowPos3fMESA, _gloffset_WindowPos3fMESA ), - NAME_FUNC_OFFSET( 16736, glWindowPos3fMESA, _gloffset_WindowPos3fMESA ), - NAME_FUNC_OFFSET( 16753, glWindowPos3fvMESA, _gloffset_WindowPos3fvMESA ), - NAME_FUNC_OFFSET( 16768, glWindowPos3fvMESA, _gloffset_WindowPos3fvMESA ), - NAME_FUNC_OFFSET( 16786, glWindowPos3iMESA, _gloffset_WindowPos3iMESA ), - NAME_FUNC_OFFSET( 16800, glWindowPos3iMESA, _gloffset_WindowPos3iMESA ), - NAME_FUNC_OFFSET( 16817, glWindowPos3ivMESA, _gloffset_WindowPos3ivMESA ), - NAME_FUNC_OFFSET( 16832, glWindowPos3ivMESA, _gloffset_WindowPos3ivMESA ), - NAME_FUNC_OFFSET( 16850, glWindowPos3sMESA, _gloffset_WindowPos3sMESA ), - NAME_FUNC_OFFSET( 16864, glWindowPos3sMESA, _gloffset_WindowPos3sMESA ), - NAME_FUNC_OFFSET( 16881, glWindowPos3svMESA, _gloffset_WindowPos3svMESA ), - NAME_FUNC_OFFSET( 16896, glWindowPos3svMESA, _gloffset_WindowPos3svMESA ), - NAME_FUNC_OFFSET( 16914, glBindProgramNV, _gloffset_BindProgramNV ), - NAME_FUNC_OFFSET( 16931, glDeleteProgramsNV, _gloffset_DeleteProgramsNV ), - NAME_FUNC_OFFSET( 16951, glGenProgramsNV, _gloffset_GenProgramsNV ), - NAME_FUNC_OFFSET( 16968, glGetVertexAttribPointervNV, _gloffset_GetVertexAttribPointervNV ), - NAME_FUNC_OFFSET( 16997, glIsProgramNV, _gloffset_IsProgramNV ), - NAME_FUNC_OFFSET( 17012, glPointParameteriNV, _gloffset_PointParameteriNV ), - NAME_FUNC_OFFSET( 17030, glPointParameterivNV, _gloffset_PointParameterivNV ), - NAME_FUNC_OFFSET( 17049, gl_dispatch_stub_746, _gloffset_BlendEquationSeparateEXT ), - NAME_FUNC_OFFSET( 17073, gl_dispatch_stub_746, _gloffset_BlendEquationSeparateEXT ), - NAME_FUNC_OFFSET( -1, NULL, 0 ) + NAME_FUNC_OFFSET( 0, glNewList, glNewList, NULL, _gloffset_NewList), + NAME_FUNC_OFFSET( 10, glEndList, glEndList, NULL, _gloffset_EndList), + NAME_FUNC_OFFSET( 20, glCallList, glCallList, NULL, _gloffset_CallList), + NAME_FUNC_OFFSET( 31, glCallLists, glCallLists, NULL, _gloffset_CallLists), + NAME_FUNC_OFFSET( 43, glDeleteLists, glDeleteLists, NULL, _gloffset_DeleteLists), + NAME_FUNC_OFFSET( 57, glGenLists, glGenLists, NULL, _gloffset_GenLists), + NAME_FUNC_OFFSET( 68, glListBase, glListBase, NULL, _gloffset_ListBase), + NAME_FUNC_OFFSET( 79, glBegin, glBegin, NULL, _gloffset_Begin), + NAME_FUNC_OFFSET( 87, glBitmap, glBitmap, NULL, _gloffset_Bitmap), + NAME_FUNC_OFFSET( 96, glColor3b, glColor3b, NULL, _gloffset_Color3b), + NAME_FUNC_OFFSET( 106, glColor3bv, glColor3bv, NULL, _gloffset_Color3bv), + NAME_FUNC_OFFSET( 117, glColor3d, glColor3d, NULL, _gloffset_Color3d), + NAME_FUNC_OFFSET( 127, glColor3dv, glColor3dv, NULL, _gloffset_Color3dv), + NAME_FUNC_OFFSET( 138, glColor3f, glColor3f, NULL, _gloffset_Color3f), + NAME_FUNC_OFFSET( 148, glColor3fv, glColor3fv, NULL, _gloffset_Color3fv), + NAME_FUNC_OFFSET( 159, glColor3i, glColor3i, NULL, _gloffset_Color3i), + NAME_FUNC_OFFSET( 169, glColor3iv, glColor3iv, NULL, _gloffset_Color3iv), + NAME_FUNC_OFFSET( 180, glColor3s, glColor3s, NULL, _gloffset_Color3s), + NAME_FUNC_OFFSET( 190, glColor3sv, glColor3sv, NULL, _gloffset_Color3sv), + NAME_FUNC_OFFSET( 201, glColor3ub, glColor3ub, NULL, _gloffset_Color3ub), + NAME_FUNC_OFFSET( 212, glColor3ubv, glColor3ubv, NULL, _gloffset_Color3ubv), + NAME_FUNC_OFFSET( 224, glColor3ui, glColor3ui, NULL, _gloffset_Color3ui), + NAME_FUNC_OFFSET( 235, glColor3uiv, glColor3uiv, NULL, _gloffset_Color3uiv), + NAME_FUNC_OFFSET( 247, glColor3us, glColor3us, NULL, _gloffset_Color3us), + NAME_FUNC_OFFSET( 258, glColor3usv, glColor3usv, NULL, _gloffset_Color3usv), + NAME_FUNC_OFFSET( 270, glColor4b, glColor4b, NULL, _gloffset_Color4b), + NAME_FUNC_OFFSET( 280, glColor4bv, glColor4bv, NULL, _gloffset_Color4bv), + NAME_FUNC_OFFSET( 291, glColor4d, glColor4d, NULL, _gloffset_Color4d), + NAME_FUNC_OFFSET( 301, glColor4dv, glColor4dv, NULL, _gloffset_Color4dv), + NAME_FUNC_OFFSET( 312, glColor4f, glColor4f, NULL, _gloffset_Color4f), + NAME_FUNC_OFFSET( 322, glColor4fv, glColor4fv, NULL, _gloffset_Color4fv), + NAME_FUNC_OFFSET( 333, glColor4i, glColor4i, NULL, _gloffset_Color4i), + NAME_FUNC_OFFSET( 343, glColor4iv, glColor4iv, NULL, _gloffset_Color4iv), + NAME_FUNC_OFFSET( 354, glColor4s, glColor4s, NULL, _gloffset_Color4s), + NAME_FUNC_OFFSET( 364, glColor4sv, glColor4sv, NULL, _gloffset_Color4sv), + NAME_FUNC_OFFSET( 375, glColor4ub, glColor4ub, NULL, _gloffset_Color4ub), + NAME_FUNC_OFFSET( 386, glColor4ubv, glColor4ubv, NULL, _gloffset_Color4ubv), + NAME_FUNC_OFFSET( 398, glColor4ui, glColor4ui, NULL, _gloffset_Color4ui), + NAME_FUNC_OFFSET( 409, glColor4uiv, glColor4uiv, NULL, _gloffset_Color4uiv), + NAME_FUNC_OFFSET( 421, glColor4us, glColor4us, NULL, _gloffset_Color4us), + NAME_FUNC_OFFSET( 432, glColor4usv, glColor4usv, NULL, _gloffset_Color4usv), + NAME_FUNC_OFFSET( 444, glEdgeFlag, glEdgeFlag, NULL, _gloffset_EdgeFlag), + NAME_FUNC_OFFSET( 455, glEdgeFlagv, glEdgeFlagv, NULL, _gloffset_EdgeFlagv), + NAME_FUNC_OFFSET( 467, glEnd, glEnd, NULL, _gloffset_End), + NAME_FUNC_OFFSET( 473, glIndexd, glIndexd, NULL, _gloffset_Indexd), + NAME_FUNC_OFFSET( 482, glIndexdv, glIndexdv, NULL, _gloffset_Indexdv), + NAME_FUNC_OFFSET( 492, glIndexf, glIndexf, NULL, _gloffset_Indexf), + NAME_FUNC_OFFSET( 501, glIndexfv, glIndexfv, NULL, _gloffset_Indexfv), + NAME_FUNC_OFFSET( 511, glIndexi, glIndexi, NULL, _gloffset_Indexi), + NAME_FUNC_OFFSET( 520, glIndexiv, glIndexiv, NULL, _gloffset_Indexiv), + NAME_FUNC_OFFSET( 530, glIndexs, glIndexs, NULL, _gloffset_Indexs), + NAME_FUNC_OFFSET( 539, glIndexsv, glIndexsv, NULL, _gloffset_Indexsv), + NAME_FUNC_OFFSET( 549, glNormal3b, glNormal3b, NULL, _gloffset_Normal3b), + NAME_FUNC_OFFSET( 560, glNormal3bv, glNormal3bv, NULL, _gloffset_Normal3bv), + NAME_FUNC_OFFSET( 572, glNormal3d, glNormal3d, NULL, _gloffset_Normal3d), + NAME_FUNC_OFFSET( 583, glNormal3dv, glNormal3dv, NULL, _gloffset_Normal3dv), + NAME_FUNC_OFFSET( 595, glNormal3f, glNormal3f, NULL, _gloffset_Normal3f), + NAME_FUNC_OFFSET( 606, glNormal3fv, glNormal3fv, NULL, _gloffset_Normal3fv), + NAME_FUNC_OFFSET( 618, glNormal3i, glNormal3i, NULL, _gloffset_Normal3i), + NAME_FUNC_OFFSET( 629, glNormal3iv, glNormal3iv, NULL, _gloffset_Normal3iv), + NAME_FUNC_OFFSET( 641, glNormal3s, glNormal3s, NULL, _gloffset_Normal3s), + NAME_FUNC_OFFSET( 652, glNormal3sv, glNormal3sv, NULL, _gloffset_Normal3sv), + NAME_FUNC_OFFSET( 664, glRasterPos2d, glRasterPos2d, NULL, _gloffset_RasterPos2d), + NAME_FUNC_OFFSET( 678, glRasterPos2dv, glRasterPos2dv, NULL, _gloffset_RasterPos2dv), + NAME_FUNC_OFFSET( 693, glRasterPos2f, glRasterPos2f, NULL, _gloffset_RasterPos2f), + NAME_FUNC_OFFSET( 707, glRasterPos2fv, glRasterPos2fv, NULL, _gloffset_RasterPos2fv), + NAME_FUNC_OFFSET( 722, glRasterPos2i, glRasterPos2i, NULL, _gloffset_RasterPos2i), + NAME_FUNC_OFFSET( 736, glRasterPos2iv, glRasterPos2iv, NULL, _gloffset_RasterPos2iv), + NAME_FUNC_OFFSET( 751, glRasterPos2s, glRasterPos2s, NULL, _gloffset_RasterPos2s), + NAME_FUNC_OFFSET( 765, glRasterPos2sv, glRasterPos2sv, NULL, _gloffset_RasterPos2sv), + NAME_FUNC_OFFSET( 780, glRasterPos3d, glRasterPos3d, NULL, _gloffset_RasterPos3d), + NAME_FUNC_OFFSET( 794, glRasterPos3dv, glRasterPos3dv, NULL, _gloffset_RasterPos3dv), + NAME_FUNC_OFFSET( 809, glRasterPos3f, glRasterPos3f, NULL, _gloffset_RasterPos3f), + NAME_FUNC_OFFSET( 823, glRasterPos3fv, glRasterPos3fv, NULL, _gloffset_RasterPos3fv), + NAME_FUNC_OFFSET( 838, glRasterPos3i, glRasterPos3i, NULL, _gloffset_RasterPos3i), + NAME_FUNC_OFFSET( 852, glRasterPos3iv, glRasterPos3iv, NULL, _gloffset_RasterPos3iv), + NAME_FUNC_OFFSET( 867, glRasterPos3s, glRasterPos3s, NULL, _gloffset_RasterPos3s), + NAME_FUNC_OFFSET( 881, glRasterPos3sv, glRasterPos3sv, NULL, _gloffset_RasterPos3sv), + NAME_FUNC_OFFSET( 896, glRasterPos4d, glRasterPos4d, NULL, _gloffset_RasterPos4d), + NAME_FUNC_OFFSET( 910, glRasterPos4dv, glRasterPos4dv, NULL, _gloffset_RasterPos4dv), + NAME_FUNC_OFFSET( 925, glRasterPos4f, glRasterPos4f, NULL, _gloffset_RasterPos4f), + NAME_FUNC_OFFSET( 939, glRasterPos4fv, glRasterPos4fv, NULL, _gloffset_RasterPos4fv), + NAME_FUNC_OFFSET( 954, glRasterPos4i, glRasterPos4i, NULL, _gloffset_RasterPos4i), + NAME_FUNC_OFFSET( 968, glRasterPos4iv, glRasterPos4iv, NULL, _gloffset_RasterPos4iv), + NAME_FUNC_OFFSET( 983, glRasterPos4s, glRasterPos4s, NULL, _gloffset_RasterPos4s), + NAME_FUNC_OFFSET( 997, glRasterPos4sv, glRasterPos4sv, NULL, _gloffset_RasterPos4sv), + NAME_FUNC_OFFSET( 1012, glRectd, glRectd, NULL, _gloffset_Rectd), + NAME_FUNC_OFFSET( 1020, glRectdv, glRectdv, NULL, _gloffset_Rectdv), + NAME_FUNC_OFFSET( 1029, glRectf, glRectf, NULL, _gloffset_Rectf), + NAME_FUNC_OFFSET( 1037, glRectfv, glRectfv, NULL, _gloffset_Rectfv), + NAME_FUNC_OFFSET( 1046, glRecti, glRecti, NULL, _gloffset_Recti), + NAME_FUNC_OFFSET( 1054, glRectiv, glRectiv, NULL, _gloffset_Rectiv), + NAME_FUNC_OFFSET( 1063, glRects, glRects, NULL, _gloffset_Rects), + NAME_FUNC_OFFSET( 1071, glRectsv, glRectsv, NULL, _gloffset_Rectsv), + NAME_FUNC_OFFSET( 1080, glTexCoord1d, glTexCoord1d, NULL, _gloffset_TexCoord1d), + NAME_FUNC_OFFSET( 1093, glTexCoord1dv, glTexCoord1dv, NULL, _gloffset_TexCoord1dv), + NAME_FUNC_OFFSET( 1107, glTexCoord1f, glTexCoord1f, NULL, _gloffset_TexCoord1f), + NAME_FUNC_OFFSET( 1120, glTexCoord1fv, glTexCoord1fv, NULL, _gloffset_TexCoord1fv), + NAME_FUNC_OFFSET( 1134, glTexCoord1i, glTexCoord1i, NULL, _gloffset_TexCoord1i), + NAME_FUNC_OFFSET( 1147, glTexCoord1iv, glTexCoord1iv, NULL, _gloffset_TexCoord1iv), + NAME_FUNC_OFFSET( 1161, glTexCoord1s, glTexCoord1s, NULL, _gloffset_TexCoord1s), + NAME_FUNC_OFFSET( 1174, glTexCoord1sv, glTexCoord1sv, NULL, _gloffset_TexCoord1sv), + NAME_FUNC_OFFSET( 1188, glTexCoord2d, glTexCoord2d, NULL, _gloffset_TexCoord2d), + NAME_FUNC_OFFSET( 1201, glTexCoord2dv, glTexCoord2dv, NULL, _gloffset_TexCoord2dv), + NAME_FUNC_OFFSET( 1215, glTexCoord2f, glTexCoord2f, NULL, _gloffset_TexCoord2f), + NAME_FUNC_OFFSET( 1228, glTexCoord2fv, glTexCoord2fv, NULL, _gloffset_TexCoord2fv), + NAME_FUNC_OFFSET( 1242, glTexCoord2i, glTexCoord2i, NULL, _gloffset_TexCoord2i), + NAME_FUNC_OFFSET( 1255, glTexCoord2iv, glTexCoord2iv, NULL, _gloffset_TexCoord2iv), + NAME_FUNC_OFFSET( 1269, glTexCoord2s, glTexCoord2s, NULL, _gloffset_TexCoord2s), + NAME_FUNC_OFFSET( 1282, glTexCoord2sv, glTexCoord2sv, NULL, _gloffset_TexCoord2sv), + NAME_FUNC_OFFSET( 1296, glTexCoord3d, glTexCoord3d, NULL, _gloffset_TexCoord3d), + NAME_FUNC_OFFSET( 1309, glTexCoord3dv, glTexCoord3dv, NULL, _gloffset_TexCoord3dv), + NAME_FUNC_OFFSET( 1323, glTexCoord3f, glTexCoord3f, NULL, _gloffset_TexCoord3f), + NAME_FUNC_OFFSET( 1336, glTexCoord3fv, glTexCoord3fv, NULL, _gloffset_TexCoord3fv), + NAME_FUNC_OFFSET( 1350, glTexCoord3i, glTexCoord3i, NULL, _gloffset_TexCoord3i), + NAME_FUNC_OFFSET( 1363, glTexCoord3iv, glTexCoord3iv, NULL, _gloffset_TexCoord3iv), + NAME_FUNC_OFFSET( 1377, glTexCoord3s, glTexCoord3s, NULL, _gloffset_TexCoord3s), + NAME_FUNC_OFFSET( 1390, glTexCoord3sv, glTexCoord3sv, NULL, _gloffset_TexCoord3sv), + NAME_FUNC_OFFSET( 1404, glTexCoord4d, glTexCoord4d, NULL, _gloffset_TexCoord4d), + NAME_FUNC_OFFSET( 1417, glTexCoord4dv, glTexCoord4dv, NULL, _gloffset_TexCoord4dv), + NAME_FUNC_OFFSET( 1431, glTexCoord4f, glTexCoord4f, NULL, _gloffset_TexCoord4f), + NAME_FUNC_OFFSET( 1444, glTexCoord4fv, glTexCoord4fv, NULL, _gloffset_TexCoord4fv), + NAME_FUNC_OFFSET( 1458, glTexCoord4i, glTexCoord4i, NULL, _gloffset_TexCoord4i), + NAME_FUNC_OFFSET( 1471, glTexCoord4iv, glTexCoord4iv, NULL, _gloffset_TexCoord4iv), + NAME_FUNC_OFFSET( 1485, glTexCoord4s, glTexCoord4s, NULL, _gloffset_TexCoord4s), + NAME_FUNC_OFFSET( 1498, glTexCoord4sv, glTexCoord4sv, NULL, _gloffset_TexCoord4sv), + NAME_FUNC_OFFSET( 1512, glVertex2d, glVertex2d, NULL, _gloffset_Vertex2d), + NAME_FUNC_OFFSET( 1523, glVertex2dv, glVertex2dv, NULL, _gloffset_Vertex2dv), + NAME_FUNC_OFFSET( 1535, glVertex2f, glVertex2f, NULL, _gloffset_Vertex2f), + NAME_FUNC_OFFSET( 1546, glVertex2fv, glVertex2fv, NULL, _gloffset_Vertex2fv), + NAME_FUNC_OFFSET( 1558, glVertex2i, glVertex2i, NULL, _gloffset_Vertex2i), + NAME_FUNC_OFFSET( 1569, glVertex2iv, glVertex2iv, NULL, _gloffset_Vertex2iv), + NAME_FUNC_OFFSET( 1581, glVertex2s, glVertex2s, NULL, _gloffset_Vertex2s), + NAME_FUNC_OFFSET( 1592, glVertex2sv, glVertex2sv, NULL, _gloffset_Vertex2sv), + NAME_FUNC_OFFSET( 1604, glVertex3d, glVertex3d, NULL, _gloffset_Vertex3d), + NAME_FUNC_OFFSET( 1615, glVertex3dv, glVertex3dv, NULL, _gloffset_Vertex3dv), + NAME_FUNC_OFFSET( 1627, glVertex3f, glVertex3f, NULL, _gloffset_Vertex3f), + NAME_FUNC_OFFSET( 1638, glVertex3fv, glVertex3fv, NULL, _gloffset_Vertex3fv), + NAME_FUNC_OFFSET( 1650, glVertex3i, glVertex3i, NULL, _gloffset_Vertex3i), + NAME_FUNC_OFFSET( 1661, glVertex3iv, glVertex3iv, NULL, _gloffset_Vertex3iv), + NAME_FUNC_OFFSET( 1673, glVertex3s, glVertex3s, NULL, _gloffset_Vertex3s), + NAME_FUNC_OFFSET( 1684, glVertex3sv, glVertex3sv, NULL, _gloffset_Vertex3sv), + NAME_FUNC_OFFSET( 1696, glVertex4d, glVertex4d, NULL, _gloffset_Vertex4d), + NAME_FUNC_OFFSET( 1707, glVertex4dv, glVertex4dv, NULL, _gloffset_Vertex4dv), + NAME_FUNC_OFFSET( 1719, glVertex4f, glVertex4f, NULL, _gloffset_Vertex4f), + NAME_FUNC_OFFSET( 1730, glVertex4fv, glVertex4fv, NULL, _gloffset_Vertex4fv), + NAME_FUNC_OFFSET( 1742, glVertex4i, glVertex4i, NULL, _gloffset_Vertex4i), + NAME_FUNC_OFFSET( 1753, glVertex4iv, glVertex4iv, NULL, _gloffset_Vertex4iv), + NAME_FUNC_OFFSET( 1765, glVertex4s, glVertex4s, NULL, _gloffset_Vertex4s), + NAME_FUNC_OFFSET( 1776, glVertex4sv, glVertex4sv, NULL, _gloffset_Vertex4sv), + NAME_FUNC_OFFSET( 1788, glClipPlane, glClipPlane, NULL, _gloffset_ClipPlane), + NAME_FUNC_OFFSET( 1800, glColorMaterial, glColorMaterial, NULL, _gloffset_ColorMaterial), + NAME_FUNC_OFFSET( 1816, glCullFace, glCullFace, NULL, _gloffset_CullFace), + NAME_FUNC_OFFSET( 1827, glFogf, glFogf, NULL, _gloffset_Fogf), + NAME_FUNC_OFFSET( 1834, glFogfv, glFogfv, NULL, _gloffset_Fogfv), + NAME_FUNC_OFFSET( 1842, glFogi, glFogi, NULL, _gloffset_Fogi), + NAME_FUNC_OFFSET( 1849, glFogiv, glFogiv, NULL, _gloffset_Fogiv), + NAME_FUNC_OFFSET( 1857, glFrontFace, glFrontFace, NULL, _gloffset_FrontFace), + NAME_FUNC_OFFSET( 1869, glHint, glHint, NULL, _gloffset_Hint), + NAME_FUNC_OFFSET( 1876, glLightf, glLightf, NULL, _gloffset_Lightf), + NAME_FUNC_OFFSET( 1885, glLightfv, glLightfv, NULL, _gloffset_Lightfv), + NAME_FUNC_OFFSET( 1895, glLighti, glLighti, NULL, _gloffset_Lighti), + NAME_FUNC_OFFSET( 1904, glLightiv, glLightiv, NULL, _gloffset_Lightiv), + NAME_FUNC_OFFSET( 1914, glLightModelf, glLightModelf, NULL, _gloffset_LightModelf), + NAME_FUNC_OFFSET( 1928, glLightModelfv, glLightModelfv, NULL, _gloffset_LightModelfv), + NAME_FUNC_OFFSET( 1943, glLightModeli, glLightModeli, NULL, _gloffset_LightModeli), + NAME_FUNC_OFFSET( 1957, glLightModeliv, glLightModeliv, NULL, _gloffset_LightModeliv), + NAME_FUNC_OFFSET( 1972, glLineStipple, glLineStipple, NULL, _gloffset_LineStipple), + NAME_FUNC_OFFSET( 1986, glLineWidth, glLineWidth, NULL, _gloffset_LineWidth), + NAME_FUNC_OFFSET( 1998, glMaterialf, glMaterialf, NULL, _gloffset_Materialf), + NAME_FUNC_OFFSET( 2010, glMaterialfv, glMaterialfv, NULL, _gloffset_Materialfv), + NAME_FUNC_OFFSET( 2023, glMateriali, glMateriali, NULL, _gloffset_Materiali), + NAME_FUNC_OFFSET( 2035, glMaterialiv, glMaterialiv, NULL, _gloffset_Materialiv), + NAME_FUNC_OFFSET( 2048, glPointSize, glPointSize, NULL, _gloffset_PointSize), + NAME_FUNC_OFFSET( 2060, glPolygonMode, glPolygonMode, NULL, _gloffset_PolygonMode), + NAME_FUNC_OFFSET( 2074, glPolygonStipple, glPolygonStipple, NULL, _gloffset_PolygonStipple), + NAME_FUNC_OFFSET( 2091, glScissor, glScissor, NULL, _gloffset_Scissor), + NAME_FUNC_OFFSET( 2101, glShadeModel, glShadeModel, NULL, _gloffset_ShadeModel), + NAME_FUNC_OFFSET( 2114, glTexParameterf, glTexParameterf, NULL, _gloffset_TexParameterf), + NAME_FUNC_OFFSET( 2130, glTexParameterfv, glTexParameterfv, NULL, _gloffset_TexParameterfv), + NAME_FUNC_OFFSET( 2147, glTexParameteri, glTexParameteri, NULL, _gloffset_TexParameteri), + NAME_FUNC_OFFSET( 2163, glTexParameteriv, glTexParameteriv, NULL, _gloffset_TexParameteriv), + NAME_FUNC_OFFSET( 2180, glTexImage1D, glTexImage1D, NULL, _gloffset_TexImage1D), + NAME_FUNC_OFFSET( 2193, glTexImage2D, glTexImage2D, NULL, _gloffset_TexImage2D), + NAME_FUNC_OFFSET( 2206, glTexEnvf, glTexEnvf, NULL, _gloffset_TexEnvf), + NAME_FUNC_OFFSET( 2216, glTexEnvfv, glTexEnvfv, NULL, _gloffset_TexEnvfv), + NAME_FUNC_OFFSET( 2227, glTexEnvi, glTexEnvi, NULL, _gloffset_TexEnvi), + NAME_FUNC_OFFSET( 2237, glTexEnviv, glTexEnviv, NULL, _gloffset_TexEnviv), + NAME_FUNC_OFFSET( 2248, glTexGend, glTexGend, NULL, _gloffset_TexGend), + NAME_FUNC_OFFSET( 2258, glTexGendv, glTexGendv, NULL, _gloffset_TexGendv), + NAME_FUNC_OFFSET( 2269, glTexGenf, glTexGenf, NULL, _gloffset_TexGenf), + NAME_FUNC_OFFSET( 2279, glTexGenfv, glTexGenfv, NULL, _gloffset_TexGenfv), + NAME_FUNC_OFFSET( 2290, glTexGeni, glTexGeni, NULL, _gloffset_TexGeni), + NAME_FUNC_OFFSET( 2300, glTexGeniv, glTexGeniv, NULL, _gloffset_TexGeniv), + NAME_FUNC_OFFSET( 2311, glFeedbackBuffer, glFeedbackBuffer, NULL, _gloffset_FeedbackBuffer), + NAME_FUNC_OFFSET( 2328, glSelectBuffer, glSelectBuffer, NULL, _gloffset_SelectBuffer), + NAME_FUNC_OFFSET( 2343, glRenderMode, glRenderMode, NULL, _gloffset_RenderMode), + NAME_FUNC_OFFSET( 2356, glInitNames, glInitNames, NULL, _gloffset_InitNames), + NAME_FUNC_OFFSET( 2368, glLoadName, glLoadName, NULL, _gloffset_LoadName), + NAME_FUNC_OFFSET( 2379, glPassThrough, glPassThrough, NULL, _gloffset_PassThrough), + NAME_FUNC_OFFSET( 2393, glPopName, glPopName, NULL, _gloffset_PopName), + NAME_FUNC_OFFSET( 2403, glPushName, glPushName, NULL, _gloffset_PushName), + NAME_FUNC_OFFSET( 2414, glDrawBuffer, glDrawBuffer, NULL, _gloffset_DrawBuffer), + NAME_FUNC_OFFSET( 2427, glClear, glClear, NULL, _gloffset_Clear), + NAME_FUNC_OFFSET( 2435, glClearAccum, glClearAccum, NULL, _gloffset_ClearAccum), + NAME_FUNC_OFFSET( 2448, glClearIndex, glClearIndex, NULL, _gloffset_ClearIndex), + NAME_FUNC_OFFSET( 2461, glClearColor, glClearColor, NULL, _gloffset_ClearColor), + NAME_FUNC_OFFSET( 2474, glClearStencil, glClearStencil, NULL, _gloffset_ClearStencil), + NAME_FUNC_OFFSET( 2489, glClearDepth, glClearDepth, NULL, _gloffset_ClearDepth), + NAME_FUNC_OFFSET( 2502, glStencilMask, glStencilMask, NULL, _gloffset_StencilMask), + NAME_FUNC_OFFSET( 2516, glColorMask, glColorMask, NULL, _gloffset_ColorMask), + NAME_FUNC_OFFSET( 2528, glDepthMask, glDepthMask, NULL, _gloffset_DepthMask), + NAME_FUNC_OFFSET( 2540, glIndexMask, glIndexMask, NULL, _gloffset_IndexMask), + NAME_FUNC_OFFSET( 2552, glAccum, glAccum, NULL, _gloffset_Accum), + NAME_FUNC_OFFSET( 2560, glDisable, glDisable, NULL, _gloffset_Disable), + NAME_FUNC_OFFSET( 2570, glEnable, glEnable, NULL, _gloffset_Enable), + NAME_FUNC_OFFSET( 2579, glFinish, glFinish, NULL, _gloffset_Finish), + NAME_FUNC_OFFSET( 2588, glFlush, glFlush, NULL, _gloffset_Flush), + NAME_FUNC_OFFSET( 2596, glPopAttrib, glPopAttrib, NULL, _gloffset_PopAttrib), + NAME_FUNC_OFFSET( 2608, glPushAttrib, glPushAttrib, NULL, _gloffset_PushAttrib), + NAME_FUNC_OFFSET( 2621, glMap1d, glMap1d, NULL, _gloffset_Map1d), + NAME_FUNC_OFFSET( 2629, glMap1f, glMap1f, NULL, _gloffset_Map1f), + NAME_FUNC_OFFSET( 2637, glMap2d, glMap2d, NULL, _gloffset_Map2d), + NAME_FUNC_OFFSET( 2645, glMap2f, glMap2f, NULL, _gloffset_Map2f), + NAME_FUNC_OFFSET( 2653, glMapGrid1d, glMapGrid1d, NULL, _gloffset_MapGrid1d), + NAME_FUNC_OFFSET( 2665, glMapGrid1f, glMapGrid1f, NULL, _gloffset_MapGrid1f), + NAME_FUNC_OFFSET( 2677, glMapGrid2d, glMapGrid2d, NULL, _gloffset_MapGrid2d), + NAME_FUNC_OFFSET( 2689, glMapGrid2f, glMapGrid2f, NULL, _gloffset_MapGrid2f), + NAME_FUNC_OFFSET( 2701, glEvalCoord1d, glEvalCoord1d, NULL, _gloffset_EvalCoord1d), + NAME_FUNC_OFFSET( 2715, glEvalCoord1dv, glEvalCoord1dv, NULL, _gloffset_EvalCoord1dv), + NAME_FUNC_OFFSET( 2730, glEvalCoord1f, glEvalCoord1f, NULL, _gloffset_EvalCoord1f), + NAME_FUNC_OFFSET( 2744, glEvalCoord1fv, glEvalCoord1fv, NULL, _gloffset_EvalCoord1fv), + NAME_FUNC_OFFSET( 2759, glEvalCoord2d, glEvalCoord2d, NULL, _gloffset_EvalCoord2d), + NAME_FUNC_OFFSET( 2773, glEvalCoord2dv, glEvalCoord2dv, NULL, _gloffset_EvalCoord2dv), + NAME_FUNC_OFFSET( 2788, glEvalCoord2f, glEvalCoord2f, NULL, _gloffset_EvalCoord2f), + NAME_FUNC_OFFSET( 2802, glEvalCoord2fv, glEvalCoord2fv, NULL, _gloffset_EvalCoord2fv), + NAME_FUNC_OFFSET( 2817, glEvalMesh1, glEvalMesh1, NULL, _gloffset_EvalMesh1), + NAME_FUNC_OFFSET( 2829, glEvalPoint1, glEvalPoint1, NULL, _gloffset_EvalPoint1), + NAME_FUNC_OFFSET( 2842, glEvalMesh2, glEvalMesh2, NULL, _gloffset_EvalMesh2), + NAME_FUNC_OFFSET( 2854, glEvalPoint2, glEvalPoint2, NULL, _gloffset_EvalPoint2), + NAME_FUNC_OFFSET( 2867, glAlphaFunc, glAlphaFunc, NULL, _gloffset_AlphaFunc), + NAME_FUNC_OFFSET( 2879, glBlendFunc, glBlendFunc, NULL, _gloffset_BlendFunc), + NAME_FUNC_OFFSET( 2891, glLogicOp, glLogicOp, NULL, _gloffset_LogicOp), + NAME_FUNC_OFFSET( 2901, glStencilFunc, glStencilFunc, NULL, _gloffset_StencilFunc), + NAME_FUNC_OFFSET( 2915, glStencilOp, glStencilOp, NULL, _gloffset_StencilOp), + NAME_FUNC_OFFSET( 2927, glDepthFunc, glDepthFunc, NULL, _gloffset_DepthFunc), + NAME_FUNC_OFFSET( 2939, glPixelZoom, glPixelZoom, NULL, _gloffset_PixelZoom), + NAME_FUNC_OFFSET( 2951, glPixelTransferf, glPixelTransferf, NULL, _gloffset_PixelTransferf), + NAME_FUNC_OFFSET( 2968, glPixelTransferi, glPixelTransferi, NULL, _gloffset_PixelTransferi), + NAME_FUNC_OFFSET( 2985, glPixelStoref, glPixelStoref, NULL, _gloffset_PixelStoref), + NAME_FUNC_OFFSET( 2999, glPixelStorei, glPixelStorei, NULL, _gloffset_PixelStorei), + NAME_FUNC_OFFSET( 3013, glPixelMapfv, glPixelMapfv, NULL, _gloffset_PixelMapfv), + NAME_FUNC_OFFSET( 3026, glPixelMapuiv, glPixelMapuiv, NULL, _gloffset_PixelMapuiv), + NAME_FUNC_OFFSET( 3040, glPixelMapusv, glPixelMapusv, NULL, _gloffset_PixelMapusv), + NAME_FUNC_OFFSET( 3054, glReadBuffer, glReadBuffer, NULL, _gloffset_ReadBuffer), + NAME_FUNC_OFFSET( 3067, glCopyPixels, glCopyPixels, NULL, _gloffset_CopyPixels), + NAME_FUNC_OFFSET( 3080, glReadPixels, glReadPixels, NULL, _gloffset_ReadPixels), + NAME_FUNC_OFFSET( 3093, glDrawPixels, glDrawPixels, NULL, _gloffset_DrawPixels), + NAME_FUNC_OFFSET( 3106, glGetBooleanv, glGetBooleanv, NULL, _gloffset_GetBooleanv), + NAME_FUNC_OFFSET( 3120, glGetClipPlane, glGetClipPlane, NULL, _gloffset_GetClipPlane), + NAME_FUNC_OFFSET( 3135, glGetDoublev, glGetDoublev, NULL, _gloffset_GetDoublev), + NAME_FUNC_OFFSET( 3148, glGetError, glGetError, NULL, _gloffset_GetError), + NAME_FUNC_OFFSET( 3159, glGetFloatv, glGetFloatv, NULL, _gloffset_GetFloatv), + NAME_FUNC_OFFSET( 3171, glGetIntegerv, glGetIntegerv, NULL, _gloffset_GetIntegerv), + NAME_FUNC_OFFSET( 3185, glGetLightfv, glGetLightfv, NULL, _gloffset_GetLightfv), + NAME_FUNC_OFFSET( 3198, glGetLightiv, glGetLightiv, NULL, _gloffset_GetLightiv), + NAME_FUNC_OFFSET( 3211, glGetMapdv, glGetMapdv, NULL, _gloffset_GetMapdv), + NAME_FUNC_OFFSET( 3222, glGetMapfv, glGetMapfv, NULL, _gloffset_GetMapfv), + NAME_FUNC_OFFSET( 3233, glGetMapiv, glGetMapiv, NULL, _gloffset_GetMapiv), + NAME_FUNC_OFFSET( 3244, glGetMaterialfv, glGetMaterialfv, NULL, _gloffset_GetMaterialfv), + NAME_FUNC_OFFSET( 3260, glGetMaterialiv, glGetMaterialiv, NULL, _gloffset_GetMaterialiv), + NAME_FUNC_OFFSET( 3276, glGetPixelMapfv, glGetPixelMapfv, NULL, _gloffset_GetPixelMapfv), + NAME_FUNC_OFFSET( 3292, glGetPixelMapuiv, glGetPixelMapuiv, NULL, _gloffset_GetPixelMapuiv), + NAME_FUNC_OFFSET( 3309, glGetPixelMapusv, glGetPixelMapusv, NULL, _gloffset_GetPixelMapusv), + NAME_FUNC_OFFSET( 3326, glGetPolygonStipple, glGetPolygonStipple, NULL, _gloffset_GetPolygonStipple), + NAME_FUNC_OFFSET( 3346, glGetString, glGetString, NULL, _gloffset_GetString), + NAME_FUNC_OFFSET( 3358, glGetTexEnvfv, glGetTexEnvfv, NULL, _gloffset_GetTexEnvfv), + NAME_FUNC_OFFSET( 3372, glGetTexEnviv, glGetTexEnviv, NULL, _gloffset_GetTexEnviv), + NAME_FUNC_OFFSET( 3386, glGetTexGendv, glGetTexGendv, NULL, _gloffset_GetTexGendv), + NAME_FUNC_OFFSET( 3400, glGetTexGenfv, glGetTexGenfv, NULL, _gloffset_GetTexGenfv), + NAME_FUNC_OFFSET( 3414, glGetTexGeniv, glGetTexGeniv, NULL, _gloffset_GetTexGeniv), + NAME_FUNC_OFFSET( 3428, glGetTexImage, glGetTexImage, NULL, _gloffset_GetTexImage), + NAME_FUNC_OFFSET( 3442, glGetTexParameterfv, glGetTexParameterfv, NULL, _gloffset_GetTexParameterfv), + NAME_FUNC_OFFSET( 3462, glGetTexParameteriv, glGetTexParameteriv, NULL, _gloffset_GetTexParameteriv), + NAME_FUNC_OFFSET( 3482, glGetTexLevelParameterfv, glGetTexLevelParameterfv, NULL, _gloffset_GetTexLevelParameterfv), + NAME_FUNC_OFFSET( 3507, glGetTexLevelParameteriv, glGetTexLevelParameteriv, NULL, _gloffset_GetTexLevelParameteriv), + NAME_FUNC_OFFSET( 3532, glIsEnabled, glIsEnabled, NULL, _gloffset_IsEnabled), + NAME_FUNC_OFFSET( 3544, glIsList, glIsList, NULL, _gloffset_IsList), + NAME_FUNC_OFFSET( 3553, glDepthRange, glDepthRange, NULL, _gloffset_DepthRange), + NAME_FUNC_OFFSET( 3566, glFrustum, glFrustum, NULL, _gloffset_Frustum), + NAME_FUNC_OFFSET( 3576, glLoadIdentity, glLoadIdentity, NULL, _gloffset_LoadIdentity), + NAME_FUNC_OFFSET( 3591, glLoadMatrixf, glLoadMatrixf, NULL, _gloffset_LoadMatrixf), + NAME_FUNC_OFFSET( 3605, glLoadMatrixd, glLoadMatrixd, NULL, _gloffset_LoadMatrixd), + NAME_FUNC_OFFSET( 3619, glMatrixMode, glMatrixMode, NULL, _gloffset_MatrixMode), + NAME_FUNC_OFFSET( 3632, glMultMatrixf, glMultMatrixf, NULL, _gloffset_MultMatrixf), + NAME_FUNC_OFFSET( 3646, glMultMatrixd, glMultMatrixd, NULL, _gloffset_MultMatrixd), + NAME_FUNC_OFFSET( 3660, glOrtho, glOrtho, NULL, _gloffset_Ortho), + NAME_FUNC_OFFSET( 3668, glPopMatrix, glPopMatrix, NULL, _gloffset_PopMatrix), + NAME_FUNC_OFFSET( 3680, glPushMatrix, glPushMatrix, NULL, _gloffset_PushMatrix), + NAME_FUNC_OFFSET( 3693, glRotated, glRotated, NULL, _gloffset_Rotated), + NAME_FUNC_OFFSET( 3703, glRotatef, glRotatef, NULL, _gloffset_Rotatef), + NAME_FUNC_OFFSET( 3713, glScaled, glScaled, NULL, _gloffset_Scaled), + NAME_FUNC_OFFSET( 3722, glScalef, glScalef, NULL, _gloffset_Scalef), + NAME_FUNC_OFFSET( 3731, glTranslated, glTranslated, NULL, _gloffset_Translated), + NAME_FUNC_OFFSET( 3744, glTranslatef, glTranslatef, NULL, _gloffset_Translatef), + NAME_FUNC_OFFSET( 3757, glViewport, glViewport, NULL, _gloffset_Viewport), + NAME_FUNC_OFFSET( 3768, glArrayElement, glArrayElement, NULL, _gloffset_ArrayElement), + NAME_FUNC_OFFSET( 3783, glBindTexture, glBindTexture, NULL, _gloffset_BindTexture), + NAME_FUNC_OFFSET( 3797, glColorPointer, glColorPointer, NULL, _gloffset_ColorPointer), + NAME_FUNC_OFFSET( 3812, glDisableClientState, glDisableClientState, NULL, _gloffset_DisableClientState), + NAME_FUNC_OFFSET( 3833, glDrawArrays, glDrawArrays, NULL, _gloffset_DrawArrays), + NAME_FUNC_OFFSET( 3846, glDrawElements, glDrawElements, NULL, _gloffset_DrawElements), + NAME_FUNC_OFFSET( 3861, glEdgeFlagPointer, glEdgeFlagPointer, NULL, _gloffset_EdgeFlagPointer), + NAME_FUNC_OFFSET( 3879, glEnableClientState, glEnableClientState, NULL, _gloffset_EnableClientState), + NAME_FUNC_OFFSET( 3899, glIndexPointer, glIndexPointer, NULL, _gloffset_IndexPointer), + NAME_FUNC_OFFSET( 3914, glIndexub, glIndexub, NULL, _gloffset_Indexub), + NAME_FUNC_OFFSET( 3924, glIndexubv, glIndexubv, NULL, _gloffset_Indexubv), + NAME_FUNC_OFFSET( 3935, glInterleavedArrays, glInterleavedArrays, NULL, _gloffset_InterleavedArrays), + NAME_FUNC_OFFSET( 3955, glNormalPointer, glNormalPointer, NULL, _gloffset_NormalPointer), + NAME_FUNC_OFFSET( 3971, glPolygonOffset, glPolygonOffset, NULL, _gloffset_PolygonOffset), + NAME_FUNC_OFFSET( 3987, glTexCoordPointer, glTexCoordPointer, NULL, _gloffset_TexCoordPointer), + NAME_FUNC_OFFSET( 4005, glVertexPointer, glVertexPointer, NULL, _gloffset_VertexPointer), + NAME_FUNC_OFFSET( 4021, glAreTexturesResident, glAreTexturesResident, NULL, _gloffset_AreTexturesResident), + NAME_FUNC_OFFSET( 4043, glCopyTexImage1D, glCopyTexImage1D, NULL, _gloffset_CopyTexImage1D), + NAME_FUNC_OFFSET( 4060, glCopyTexImage2D, glCopyTexImage2D, NULL, _gloffset_CopyTexImage2D), + NAME_FUNC_OFFSET( 4077, glCopyTexSubImage1D, glCopyTexSubImage1D, NULL, _gloffset_CopyTexSubImage1D), + NAME_FUNC_OFFSET( 4097, glCopyTexSubImage2D, glCopyTexSubImage2D, NULL, _gloffset_CopyTexSubImage2D), + NAME_FUNC_OFFSET( 4117, glDeleteTextures, glDeleteTextures, NULL, _gloffset_DeleteTextures), + NAME_FUNC_OFFSET( 4134, glGenTextures, glGenTextures, NULL, _gloffset_GenTextures), + NAME_FUNC_OFFSET( 4148, glGetPointerv, glGetPointerv, NULL, _gloffset_GetPointerv), + NAME_FUNC_OFFSET( 4162, glIsTexture, glIsTexture, NULL, _gloffset_IsTexture), + NAME_FUNC_OFFSET( 4174, glPrioritizeTextures, glPrioritizeTextures, NULL, _gloffset_PrioritizeTextures), + NAME_FUNC_OFFSET( 4195, glTexSubImage1D, glTexSubImage1D, NULL, _gloffset_TexSubImage1D), + NAME_FUNC_OFFSET( 4211, glTexSubImage2D, glTexSubImage2D, NULL, _gloffset_TexSubImage2D), + NAME_FUNC_OFFSET( 4227, glPopClientAttrib, glPopClientAttrib, NULL, _gloffset_PopClientAttrib), + NAME_FUNC_OFFSET( 4245, glPushClientAttrib, glPushClientAttrib, NULL, _gloffset_PushClientAttrib), + NAME_FUNC_OFFSET( 4264, glBlendColor, glBlendColor, NULL, _gloffset_BlendColor), + NAME_FUNC_OFFSET( 4277, glBlendEquation, glBlendEquation, NULL, _gloffset_BlendEquation), + NAME_FUNC_OFFSET( 4293, glDrawRangeElements, glDrawRangeElements, NULL, _gloffset_DrawRangeElements), + NAME_FUNC_OFFSET( 4313, glColorTable, glColorTable, NULL, _gloffset_ColorTable), + NAME_FUNC_OFFSET( 4326, glColorTableParameterfv, glColorTableParameterfv, NULL, _gloffset_ColorTableParameterfv), + NAME_FUNC_OFFSET( 4350, glColorTableParameteriv, glColorTableParameteriv, NULL, _gloffset_ColorTableParameteriv), + NAME_FUNC_OFFSET( 4374, glCopyColorTable, glCopyColorTable, NULL, _gloffset_CopyColorTable), + NAME_FUNC_OFFSET( 4391, glGetColorTable, glGetColorTable, NULL, _gloffset_GetColorTable), + NAME_FUNC_OFFSET( 4407, glGetColorTableParameterfv, glGetColorTableParameterfv, NULL, _gloffset_GetColorTableParameterfv), + NAME_FUNC_OFFSET( 4434, glGetColorTableParameteriv, glGetColorTableParameteriv, NULL, _gloffset_GetColorTableParameteriv), + NAME_FUNC_OFFSET( 4461, glColorSubTable, glColorSubTable, NULL, _gloffset_ColorSubTable), + NAME_FUNC_OFFSET( 4477, glCopyColorSubTable, glCopyColorSubTable, NULL, _gloffset_CopyColorSubTable), + NAME_FUNC_OFFSET( 4497, glConvolutionFilter1D, glConvolutionFilter1D, NULL, _gloffset_ConvolutionFilter1D), + NAME_FUNC_OFFSET( 4519, glConvolutionFilter2D, glConvolutionFilter2D, NULL, _gloffset_ConvolutionFilter2D), + NAME_FUNC_OFFSET( 4541, glConvolutionParameterf, glConvolutionParameterf, NULL, _gloffset_ConvolutionParameterf), + NAME_FUNC_OFFSET( 4565, glConvolutionParameterfv, glConvolutionParameterfv, NULL, _gloffset_ConvolutionParameterfv), + NAME_FUNC_OFFSET( 4590, glConvolutionParameteri, glConvolutionParameteri, NULL, _gloffset_ConvolutionParameteri), + NAME_FUNC_OFFSET( 4614, glConvolutionParameteriv, glConvolutionParameteriv, NULL, _gloffset_ConvolutionParameteriv), + NAME_FUNC_OFFSET( 4639, glCopyConvolutionFilter1D, glCopyConvolutionFilter1D, NULL, _gloffset_CopyConvolutionFilter1D), + NAME_FUNC_OFFSET( 4665, glCopyConvolutionFilter2D, glCopyConvolutionFilter2D, NULL, _gloffset_CopyConvolutionFilter2D), + NAME_FUNC_OFFSET( 4691, glGetConvolutionFilter, glGetConvolutionFilter, NULL, _gloffset_GetConvolutionFilter), + NAME_FUNC_OFFSET( 4714, glGetConvolutionParameterfv, glGetConvolutionParameterfv, NULL, _gloffset_GetConvolutionParameterfv), + NAME_FUNC_OFFSET( 4742, glGetConvolutionParameteriv, glGetConvolutionParameteriv, NULL, _gloffset_GetConvolutionParameteriv), + NAME_FUNC_OFFSET( 4770, glGetSeparableFilter, glGetSeparableFilter, NULL, _gloffset_GetSeparableFilter), + NAME_FUNC_OFFSET( 4791, glSeparableFilter2D, glSeparableFilter2D, NULL, _gloffset_SeparableFilter2D), + NAME_FUNC_OFFSET( 4811, glGetHistogram, glGetHistogram, NULL, _gloffset_GetHistogram), + NAME_FUNC_OFFSET( 4826, glGetHistogramParameterfv, glGetHistogramParameterfv, NULL, _gloffset_GetHistogramParameterfv), + NAME_FUNC_OFFSET( 4852, glGetHistogramParameteriv, glGetHistogramParameteriv, NULL, _gloffset_GetHistogramParameteriv), + NAME_FUNC_OFFSET( 4878, glGetMinmax, glGetMinmax, NULL, _gloffset_GetMinmax), + NAME_FUNC_OFFSET( 4890, glGetMinmaxParameterfv, glGetMinmaxParameterfv, NULL, _gloffset_GetMinmaxParameterfv), + NAME_FUNC_OFFSET( 4913, glGetMinmaxParameteriv, glGetMinmaxParameteriv, NULL, _gloffset_GetMinmaxParameteriv), + NAME_FUNC_OFFSET( 4936, glHistogram, glHistogram, NULL, _gloffset_Histogram), + NAME_FUNC_OFFSET( 4948, glMinmax, glMinmax, NULL, _gloffset_Minmax), + NAME_FUNC_OFFSET( 4957, glResetHistogram, glResetHistogram, NULL, _gloffset_ResetHistogram), + NAME_FUNC_OFFSET( 4974, glResetMinmax, glResetMinmax, NULL, _gloffset_ResetMinmax), + NAME_FUNC_OFFSET( 4988, glTexImage3D, glTexImage3D, NULL, _gloffset_TexImage3D), + NAME_FUNC_OFFSET( 5001, glTexSubImage3D, glTexSubImage3D, NULL, _gloffset_TexSubImage3D), + NAME_FUNC_OFFSET( 5017, glCopyTexSubImage3D, glCopyTexSubImage3D, NULL, _gloffset_CopyTexSubImage3D), + NAME_FUNC_OFFSET( 5037, glActiveTextureARB, glActiveTextureARB, NULL, _gloffset_ActiveTextureARB), + NAME_FUNC_OFFSET( 5056, glClientActiveTextureARB, glClientActiveTextureARB, NULL, _gloffset_ClientActiveTextureARB), + NAME_FUNC_OFFSET( 5081, glMultiTexCoord1dARB, glMultiTexCoord1dARB, NULL, _gloffset_MultiTexCoord1dARB), + NAME_FUNC_OFFSET( 5102, glMultiTexCoord1dvARB, glMultiTexCoord1dvARB, NULL, _gloffset_MultiTexCoord1dvARB), + NAME_FUNC_OFFSET( 5124, glMultiTexCoord1fARB, glMultiTexCoord1fARB, NULL, _gloffset_MultiTexCoord1fARB), + NAME_FUNC_OFFSET( 5145, glMultiTexCoord1fvARB, glMultiTexCoord1fvARB, NULL, _gloffset_MultiTexCoord1fvARB), + NAME_FUNC_OFFSET( 5167, glMultiTexCoord1iARB, glMultiTexCoord1iARB, NULL, _gloffset_MultiTexCoord1iARB), + NAME_FUNC_OFFSET( 5188, glMultiTexCoord1ivARB, glMultiTexCoord1ivARB, NULL, _gloffset_MultiTexCoord1ivARB), + NAME_FUNC_OFFSET( 5210, glMultiTexCoord1sARB, glMultiTexCoord1sARB, NULL, _gloffset_MultiTexCoord1sARB), + NAME_FUNC_OFFSET( 5231, glMultiTexCoord1svARB, glMultiTexCoord1svARB, NULL, _gloffset_MultiTexCoord1svARB), + NAME_FUNC_OFFSET( 5253, glMultiTexCoord2dARB, glMultiTexCoord2dARB, NULL, _gloffset_MultiTexCoord2dARB), + NAME_FUNC_OFFSET( 5274, glMultiTexCoord2dvARB, glMultiTexCoord2dvARB, NULL, _gloffset_MultiTexCoord2dvARB), + NAME_FUNC_OFFSET( 5296, glMultiTexCoord2fARB, glMultiTexCoord2fARB, NULL, _gloffset_MultiTexCoord2fARB), + NAME_FUNC_OFFSET( 5317, glMultiTexCoord2fvARB, glMultiTexCoord2fvARB, NULL, _gloffset_MultiTexCoord2fvARB), + NAME_FUNC_OFFSET( 5339, glMultiTexCoord2iARB, glMultiTexCoord2iARB, NULL, _gloffset_MultiTexCoord2iARB), + NAME_FUNC_OFFSET( 5360, glMultiTexCoord2ivARB, glMultiTexCoord2ivARB, NULL, _gloffset_MultiTexCoord2ivARB), + NAME_FUNC_OFFSET( 5382, glMultiTexCoord2sARB, glMultiTexCoord2sARB, NULL, _gloffset_MultiTexCoord2sARB), + NAME_FUNC_OFFSET( 5403, glMultiTexCoord2svARB, glMultiTexCoord2svARB, NULL, _gloffset_MultiTexCoord2svARB), + NAME_FUNC_OFFSET( 5425, glMultiTexCoord3dARB, glMultiTexCoord3dARB, NULL, _gloffset_MultiTexCoord3dARB), + NAME_FUNC_OFFSET( 5446, glMultiTexCoord3dvARB, glMultiTexCoord3dvARB, NULL, _gloffset_MultiTexCoord3dvARB), + NAME_FUNC_OFFSET( 5468, glMultiTexCoord3fARB, glMultiTexCoord3fARB, NULL, _gloffset_MultiTexCoord3fARB), + NAME_FUNC_OFFSET( 5489, glMultiTexCoord3fvARB, glMultiTexCoord3fvARB, NULL, _gloffset_MultiTexCoord3fvARB), + NAME_FUNC_OFFSET( 5511, glMultiTexCoord3iARB, glMultiTexCoord3iARB, NULL, _gloffset_MultiTexCoord3iARB), + NAME_FUNC_OFFSET( 5532, glMultiTexCoord3ivARB, glMultiTexCoord3ivARB, NULL, _gloffset_MultiTexCoord3ivARB), + NAME_FUNC_OFFSET( 5554, glMultiTexCoord3sARB, glMultiTexCoord3sARB, NULL, _gloffset_MultiTexCoord3sARB), + NAME_FUNC_OFFSET( 5575, glMultiTexCoord3svARB, glMultiTexCoord3svARB, NULL, _gloffset_MultiTexCoord3svARB), + NAME_FUNC_OFFSET( 5597, glMultiTexCoord4dARB, glMultiTexCoord4dARB, NULL, _gloffset_MultiTexCoord4dARB), + NAME_FUNC_OFFSET( 5618, glMultiTexCoord4dvARB, glMultiTexCoord4dvARB, NULL, _gloffset_MultiTexCoord4dvARB), + NAME_FUNC_OFFSET( 5640, glMultiTexCoord4fARB, glMultiTexCoord4fARB, NULL, _gloffset_MultiTexCoord4fARB), + NAME_FUNC_OFFSET( 5661, glMultiTexCoord4fvARB, glMultiTexCoord4fvARB, NULL, _gloffset_MultiTexCoord4fvARB), + NAME_FUNC_OFFSET( 5683, glMultiTexCoord4iARB, glMultiTexCoord4iARB, NULL, _gloffset_MultiTexCoord4iARB), + NAME_FUNC_OFFSET( 5704, glMultiTexCoord4ivARB, glMultiTexCoord4ivARB, NULL, _gloffset_MultiTexCoord4ivARB), + NAME_FUNC_OFFSET( 5726, glMultiTexCoord4sARB, glMultiTexCoord4sARB, NULL, _gloffset_MultiTexCoord4sARB), + NAME_FUNC_OFFSET( 5747, glMultiTexCoord4svARB, glMultiTexCoord4svARB, NULL, _gloffset_MultiTexCoord4svARB), + NAME_FUNC_OFFSET( 5769, glAttachShader, glAttachShader, NULL, _gloffset_AttachShader), + NAME_FUNC_OFFSET( 5784, glCreateProgram, glCreateProgram, NULL, _gloffset_CreateProgram), + NAME_FUNC_OFFSET( 5800, glCreateShader, glCreateShader, NULL, _gloffset_CreateShader), + NAME_FUNC_OFFSET( 5815, glDeleteProgram, glDeleteProgram, NULL, _gloffset_DeleteProgram), + NAME_FUNC_OFFSET( 5831, glDeleteShader, glDeleteShader, NULL, _gloffset_DeleteShader), + NAME_FUNC_OFFSET( 5846, glDetachShader, glDetachShader, NULL, _gloffset_DetachShader), + NAME_FUNC_OFFSET( 5861, glGetAttachedShaders, glGetAttachedShaders, NULL, _gloffset_GetAttachedShaders), + NAME_FUNC_OFFSET( 5882, glGetProgramInfoLog, glGetProgramInfoLog, NULL, _gloffset_GetProgramInfoLog), + NAME_FUNC_OFFSET( 5902, glGetProgramiv, glGetProgramiv, NULL, _gloffset_GetProgramiv), + NAME_FUNC_OFFSET( 5917, glGetShaderInfoLog, glGetShaderInfoLog, NULL, _gloffset_GetShaderInfoLog), + NAME_FUNC_OFFSET( 5936, glGetShaderiv, glGetShaderiv, NULL, _gloffset_GetShaderiv), + NAME_FUNC_OFFSET( 5950, glIsProgram, glIsProgram, NULL, _gloffset_IsProgram), + NAME_FUNC_OFFSET( 5962, glIsShader, glIsShader, NULL, _gloffset_IsShader), + NAME_FUNC_OFFSET( 5973, glStencilFuncSeparate, glStencilFuncSeparate, NULL, _gloffset_StencilFuncSeparate), + NAME_FUNC_OFFSET( 5995, glStencilMaskSeparate, glStencilMaskSeparate, NULL, _gloffset_StencilMaskSeparate), + NAME_FUNC_OFFSET( 6017, glStencilOpSeparate, glStencilOpSeparate, NULL, _gloffset_StencilOpSeparate), + NAME_FUNC_OFFSET( 6037, glUniformMatrix2x3fv, glUniformMatrix2x3fv, NULL, _gloffset_UniformMatrix2x3fv), + NAME_FUNC_OFFSET( 6058, glUniformMatrix2x4fv, glUniformMatrix2x4fv, NULL, _gloffset_UniformMatrix2x4fv), + NAME_FUNC_OFFSET( 6079, glUniformMatrix3x2fv, glUniformMatrix3x2fv, NULL, _gloffset_UniformMatrix3x2fv), + NAME_FUNC_OFFSET( 6100, glUniformMatrix3x4fv, glUniformMatrix3x4fv, NULL, _gloffset_UniformMatrix3x4fv), + NAME_FUNC_OFFSET( 6121, glUniformMatrix4x2fv, glUniformMatrix4x2fv, NULL, _gloffset_UniformMatrix4x2fv), + NAME_FUNC_OFFSET( 6142, glUniformMatrix4x3fv, glUniformMatrix4x3fv, NULL, _gloffset_UniformMatrix4x3fv), + NAME_FUNC_OFFSET( 6163, glLoadTransposeMatrixdARB, glLoadTransposeMatrixdARB, NULL, _gloffset_LoadTransposeMatrixdARB), + NAME_FUNC_OFFSET( 6189, glLoadTransposeMatrixfARB, glLoadTransposeMatrixfARB, NULL, _gloffset_LoadTransposeMatrixfARB), + NAME_FUNC_OFFSET( 6215, glMultTransposeMatrixdARB, glMultTransposeMatrixdARB, NULL, _gloffset_MultTransposeMatrixdARB), + NAME_FUNC_OFFSET( 6241, glMultTransposeMatrixfARB, glMultTransposeMatrixfARB, NULL, _gloffset_MultTransposeMatrixfARB), + NAME_FUNC_OFFSET( 6267, glSampleCoverageARB, glSampleCoverageARB, NULL, _gloffset_SampleCoverageARB), + NAME_FUNC_OFFSET( 6287, glCompressedTexImage1DARB, glCompressedTexImage1DARB, NULL, _gloffset_CompressedTexImage1DARB), + NAME_FUNC_OFFSET( 6313, glCompressedTexImage2DARB, glCompressedTexImage2DARB, NULL, _gloffset_CompressedTexImage2DARB), + NAME_FUNC_OFFSET( 6339, glCompressedTexImage3DARB, glCompressedTexImage3DARB, NULL, _gloffset_CompressedTexImage3DARB), + NAME_FUNC_OFFSET( 6365, glCompressedTexSubImage1DARB, glCompressedTexSubImage1DARB, NULL, _gloffset_CompressedTexSubImage1DARB), + NAME_FUNC_OFFSET( 6394, glCompressedTexSubImage2DARB, glCompressedTexSubImage2DARB, NULL, _gloffset_CompressedTexSubImage2DARB), + NAME_FUNC_OFFSET( 6423, glCompressedTexSubImage3DARB, glCompressedTexSubImage3DARB, NULL, _gloffset_CompressedTexSubImage3DARB), + NAME_FUNC_OFFSET( 6452, glGetCompressedTexImageARB, glGetCompressedTexImageARB, NULL, _gloffset_GetCompressedTexImageARB), + NAME_FUNC_OFFSET( 6479, glDisableVertexAttribArrayARB, glDisableVertexAttribArrayARB, NULL, _gloffset_DisableVertexAttribArrayARB), + NAME_FUNC_OFFSET( 6509, glEnableVertexAttribArrayARB, glEnableVertexAttribArrayARB, NULL, _gloffset_EnableVertexAttribArrayARB), + NAME_FUNC_OFFSET( 6538, glGetProgramEnvParameterdvARB, glGetProgramEnvParameterdvARB, NULL, _gloffset_GetProgramEnvParameterdvARB), + NAME_FUNC_OFFSET( 6568, glGetProgramEnvParameterfvARB, glGetProgramEnvParameterfvARB, NULL, _gloffset_GetProgramEnvParameterfvARB), + NAME_FUNC_OFFSET( 6598, glGetProgramLocalParameterdvARB, glGetProgramLocalParameterdvARB, NULL, _gloffset_GetProgramLocalParameterdvARB), + NAME_FUNC_OFFSET( 6630, glGetProgramLocalParameterfvARB, glGetProgramLocalParameterfvARB, NULL, _gloffset_GetProgramLocalParameterfvARB), + NAME_FUNC_OFFSET( 6662, glGetProgramStringARB, glGetProgramStringARB, NULL, _gloffset_GetProgramStringARB), + NAME_FUNC_OFFSET( 6684, glGetProgramivARB, glGetProgramivARB, NULL, _gloffset_GetProgramivARB), + NAME_FUNC_OFFSET( 6702, glGetVertexAttribdvARB, glGetVertexAttribdvARB, NULL, _gloffset_GetVertexAttribdvARB), + NAME_FUNC_OFFSET( 6725, glGetVertexAttribfvARB, glGetVertexAttribfvARB, NULL, _gloffset_GetVertexAttribfvARB), + NAME_FUNC_OFFSET( 6748, glGetVertexAttribivARB, glGetVertexAttribivARB, NULL, _gloffset_GetVertexAttribivARB), + NAME_FUNC_OFFSET( 6771, glProgramEnvParameter4dARB, glProgramEnvParameter4dARB, NULL, _gloffset_ProgramEnvParameter4dARB), + NAME_FUNC_OFFSET( 6798, glProgramEnvParameter4dvARB, glProgramEnvParameter4dvARB, NULL, _gloffset_ProgramEnvParameter4dvARB), + NAME_FUNC_OFFSET( 6826, glProgramEnvParameter4fARB, glProgramEnvParameter4fARB, NULL, _gloffset_ProgramEnvParameter4fARB), + NAME_FUNC_OFFSET( 6853, glProgramEnvParameter4fvARB, glProgramEnvParameter4fvARB, NULL, _gloffset_ProgramEnvParameter4fvARB), + NAME_FUNC_OFFSET( 6881, glProgramLocalParameter4dARB, glProgramLocalParameter4dARB, NULL, _gloffset_ProgramLocalParameter4dARB), + NAME_FUNC_OFFSET( 6910, glProgramLocalParameter4dvARB, glProgramLocalParameter4dvARB, NULL, _gloffset_ProgramLocalParameter4dvARB), + NAME_FUNC_OFFSET( 6940, glProgramLocalParameter4fARB, glProgramLocalParameter4fARB, NULL, _gloffset_ProgramLocalParameter4fARB), + NAME_FUNC_OFFSET( 6969, glProgramLocalParameter4fvARB, glProgramLocalParameter4fvARB, NULL, _gloffset_ProgramLocalParameter4fvARB), + NAME_FUNC_OFFSET( 6999, glProgramStringARB, glProgramStringARB, NULL, _gloffset_ProgramStringARB), + NAME_FUNC_OFFSET( 7018, glVertexAttrib1dARB, glVertexAttrib1dARB, NULL, _gloffset_VertexAttrib1dARB), + NAME_FUNC_OFFSET( 7038, glVertexAttrib1dvARB, glVertexAttrib1dvARB, NULL, _gloffset_VertexAttrib1dvARB), + NAME_FUNC_OFFSET( 7059, glVertexAttrib1fARB, glVertexAttrib1fARB, NULL, _gloffset_VertexAttrib1fARB), + NAME_FUNC_OFFSET( 7079, glVertexAttrib1fvARB, glVertexAttrib1fvARB, NULL, _gloffset_VertexAttrib1fvARB), + NAME_FUNC_OFFSET( 7100, glVertexAttrib1sARB, glVertexAttrib1sARB, NULL, _gloffset_VertexAttrib1sARB), + NAME_FUNC_OFFSET( 7120, glVertexAttrib1svARB, glVertexAttrib1svARB, NULL, _gloffset_VertexAttrib1svARB), + NAME_FUNC_OFFSET( 7141, glVertexAttrib2dARB, glVertexAttrib2dARB, NULL, _gloffset_VertexAttrib2dARB), + NAME_FUNC_OFFSET( 7161, glVertexAttrib2dvARB, glVertexAttrib2dvARB, NULL, _gloffset_VertexAttrib2dvARB), + NAME_FUNC_OFFSET( 7182, glVertexAttrib2fARB, glVertexAttrib2fARB, NULL, _gloffset_VertexAttrib2fARB), + NAME_FUNC_OFFSET( 7202, glVertexAttrib2fvARB, glVertexAttrib2fvARB, NULL, _gloffset_VertexAttrib2fvARB), + NAME_FUNC_OFFSET( 7223, glVertexAttrib2sARB, glVertexAttrib2sARB, NULL, _gloffset_VertexAttrib2sARB), + NAME_FUNC_OFFSET( 7243, glVertexAttrib2svARB, glVertexAttrib2svARB, NULL, _gloffset_VertexAttrib2svARB), + NAME_FUNC_OFFSET( 7264, glVertexAttrib3dARB, glVertexAttrib3dARB, NULL, _gloffset_VertexAttrib3dARB), + NAME_FUNC_OFFSET( 7284, glVertexAttrib3dvARB, glVertexAttrib3dvARB, NULL, _gloffset_VertexAttrib3dvARB), + NAME_FUNC_OFFSET( 7305, glVertexAttrib3fARB, glVertexAttrib3fARB, NULL, _gloffset_VertexAttrib3fARB), + NAME_FUNC_OFFSET( 7325, glVertexAttrib3fvARB, glVertexAttrib3fvARB, NULL, _gloffset_VertexAttrib3fvARB), + NAME_FUNC_OFFSET( 7346, glVertexAttrib3sARB, glVertexAttrib3sARB, NULL, _gloffset_VertexAttrib3sARB), + NAME_FUNC_OFFSET( 7366, glVertexAttrib3svARB, glVertexAttrib3svARB, NULL, _gloffset_VertexAttrib3svARB), + NAME_FUNC_OFFSET( 7387, glVertexAttrib4NbvARB, glVertexAttrib4NbvARB, NULL, _gloffset_VertexAttrib4NbvARB), + NAME_FUNC_OFFSET( 7409, glVertexAttrib4NivARB, glVertexAttrib4NivARB, NULL, _gloffset_VertexAttrib4NivARB), + NAME_FUNC_OFFSET( 7431, glVertexAttrib4NsvARB, glVertexAttrib4NsvARB, NULL, _gloffset_VertexAttrib4NsvARB), + NAME_FUNC_OFFSET( 7453, glVertexAttrib4NubARB, glVertexAttrib4NubARB, NULL, _gloffset_VertexAttrib4NubARB), + NAME_FUNC_OFFSET( 7475, glVertexAttrib4NubvARB, glVertexAttrib4NubvARB, NULL, _gloffset_VertexAttrib4NubvARB), + NAME_FUNC_OFFSET( 7498, glVertexAttrib4NuivARB, glVertexAttrib4NuivARB, NULL, _gloffset_VertexAttrib4NuivARB), + NAME_FUNC_OFFSET( 7521, glVertexAttrib4NusvARB, glVertexAttrib4NusvARB, NULL, _gloffset_VertexAttrib4NusvARB), + NAME_FUNC_OFFSET( 7544, glVertexAttrib4bvARB, glVertexAttrib4bvARB, NULL, _gloffset_VertexAttrib4bvARB), + NAME_FUNC_OFFSET( 7565, glVertexAttrib4dARB, glVertexAttrib4dARB, NULL, _gloffset_VertexAttrib4dARB), + NAME_FUNC_OFFSET( 7585, glVertexAttrib4dvARB, glVertexAttrib4dvARB, NULL, _gloffset_VertexAttrib4dvARB), + NAME_FUNC_OFFSET( 7606, glVertexAttrib4fARB, glVertexAttrib4fARB, NULL, _gloffset_VertexAttrib4fARB), + NAME_FUNC_OFFSET( 7626, glVertexAttrib4fvARB, glVertexAttrib4fvARB, NULL, _gloffset_VertexAttrib4fvARB), + NAME_FUNC_OFFSET( 7647, glVertexAttrib4ivARB, glVertexAttrib4ivARB, NULL, _gloffset_VertexAttrib4ivARB), + NAME_FUNC_OFFSET( 7668, glVertexAttrib4sARB, glVertexAttrib4sARB, NULL, _gloffset_VertexAttrib4sARB), + NAME_FUNC_OFFSET( 7688, glVertexAttrib4svARB, glVertexAttrib4svARB, NULL, _gloffset_VertexAttrib4svARB), + NAME_FUNC_OFFSET( 7709, glVertexAttrib4ubvARB, glVertexAttrib4ubvARB, NULL, _gloffset_VertexAttrib4ubvARB), + NAME_FUNC_OFFSET( 7731, glVertexAttrib4uivARB, glVertexAttrib4uivARB, NULL, _gloffset_VertexAttrib4uivARB), + NAME_FUNC_OFFSET( 7753, glVertexAttrib4usvARB, glVertexAttrib4usvARB, NULL, _gloffset_VertexAttrib4usvARB), + NAME_FUNC_OFFSET( 7775, glVertexAttribPointerARB, glVertexAttribPointerARB, NULL, _gloffset_VertexAttribPointerARB), + NAME_FUNC_OFFSET( 7800, glBindBufferARB, glBindBufferARB, NULL, _gloffset_BindBufferARB), + NAME_FUNC_OFFSET( 7816, glBufferDataARB, glBufferDataARB, NULL, _gloffset_BufferDataARB), + NAME_FUNC_OFFSET( 7832, glBufferSubDataARB, glBufferSubDataARB, NULL, _gloffset_BufferSubDataARB), + NAME_FUNC_OFFSET( 7851, glDeleteBuffersARB, glDeleteBuffersARB, NULL, _gloffset_DeleteBuffersARB), + NAME_FUNC_OFFSET( 7870, glGenBuffersARB, glGenBuffersARB, NULL, _gloffset_GenBuffersARB), + NAME_FUNC_OFFSET( 7886, glGetBufferParameterivARB, glGetBufferParameterivARB, NULL, _gloffset_GetBufferParameterivARB), + NAME_FUNC_OFFSET( 7912, glGetBufferPointervARB, glGetBufferPointervARB, NULL, _gloffset_GetBufferPointervARB), + NAME_FUNC_OFFSET( 7935, glGetBufferSubDataARB, glGetBufferSubDataARB, NULL, _gloffset_GetBufferSubDataARB), + NAME_FUNC_OFFSET( 7957, glIsBufferARB, glIsBufferARB, NULL, _gloffset_IsBufferARB), + NAME_FUNC_OFFSET( 7971, glMapBufferARB, glMapBufferARB, NULL, _gloffset_MapBufferARB), + NAME_FUNC_OFFSET( 7986, glUnmapBufferARB, glUnmapBufferARB, NULL, _gloffset_UnmapBufferARB), + NAME_FUNC_OFFSET( 8003, glBeginQueryARB, glBeginQueryARB, NULL, _gloffset_BeginQueryARB), + NAME_FUNC_OFFSET( 8019, glDeleteQueriesARB, glDeleteQueriesARB, NULL, _gloffset_DeleteQueriesARB), + NAME_FUNC_OFFSET( 8038, glEndQueryARB, glEndQueryARB, NULL, _gloffset_EndQueryARB), + NAME_FUNC_OFFSET( 8052, glGenQueriesARB, glGenQueriesARB, NULL, _gloffset_GenQueriesARB), + NAME_FUNC_OFFSET( 8068, glGetQueryObjectivARB, glGetQueryObjectivARB, NULL, _gloffset_GetQueryObjectivARB), + NAME_FUNC_OFFSET( 8090, glGetQueryObjectuivARB, glGetQueryObjectuivARB, NULL, _gloffset_GetQueryObjectuivARB), + NAME_FUNC_OFFSET( 8113, glGetQueryivARB, glGetQueryivARB, NULL, _gloffset_GetQueryivARB), + NAME_FUNC_OFFSET( 8129, glIsQueryARB, glIsQueryARB, NULL, _gloffset_IsQueryARB), + NAME_FUNC_OFFSET( 8142, glAttachObjectARB, glAttachObjectARB, NULL, _gloffset_AttachObjectARB), + NAME_FUNC_OFFSET( 8160, glCompileShaderARB, glCompileShaderARB, NULL, _gloffset_CompileShaderARB), + NAME_FUNC_OFFSET( 8179, glCreateProgramObjectARB, glCreateProgramObjectARB, NULL, _gloffset_CreateProgramObjectARB), + NAME_FUNC_OFFSET( 8204, glCreateShaderObjectARB, glCreateShaderObjectARB, NULL, _gloffset_CreateShaderObjectARB), + NAME_FUNC_OFFSET( 8228, glDeleteObjectARB, glDeleteObjectARB, NULL, _gloffset_DeleteObjectARB), + NAME_FUNC_OFFSET( 8246, glDetachObjectARB, glDetachObjectARB, NULL, _gloffset_DetachObjectARB), + NAME_FUNC_OFFSET( 8264, glGetActiveUniformARB, glGetActiveUniformARB, NULL, _gloffset_GetActiveUniformARB), + NAME_FUNC_OFFSET( 8286, glGetAttachedObjectsARB, glGetAttachedObjectsARB, NULL, _gloffset_GetAttachedObjectsARB), + NAME_FUNC_OFFSET( 8310, glGetHandleARB, glGetHandleARB, NULL, _gloffset_GetHandleARB), + NAME_FUNC_OFFSET( 8325, glGetInfoLogARB, glGetInfoLogARB, NULL, _gloffset_GetInfoLogARB), + NAME_FUNC_OFFSET( 8341, glGetObjectParameterfvARB, glGetObjectParameterfvARB, NULL, _gloffset_GetObjectParameterfvARB), + NAME_FUNC_OFFSET( 8367, glGetObjectParameterivARB, glGetObjectParameterivARB, NULL, _gloffset_GetObjectParameterivARB), + NAME_FUNC_OFFSET( 8393, glGetShaderSourceARB, glGetShaderSourceARB, NULL, _gloffset_GetShaderSourceARB), + NAME_FUNC_OFFSET( 8414, glGetUniformLocationARB, glGetUniformLocationARB, NULL, _gloffset_GetUniformLocationARB), + NAME_FUNC_OFFSET( 8438, glGetUniformfvARB, glGetUniformfvARB, NULL, _gloffset_GetUniformfvARB), + NAME_FUNC_OFFSET( 8456, glGetUniformivARB, glGetUniformivARB, NULL, _gloffset_GetUniformivARB), + NAME_FUNC_OFFSET( 8474, glLinkProgramARB, glLinkProgramARB, NULL, _gloffset_LinkProgramARB), + NAME_FUNC_OFFSET( 8491, glShaderSourceARB, glShaderSourceARB, NULL, _gloffset_ShaderSourceARB), + NAME_FUNC_OFFSET( 8509, glUniform1fARB, glUniform1fARB, NULL, _gloffset_Uniform1fARB), + NAME_FUNC_OFFSET( 8524, glUniform1fvARB, glUniform1fvARB, NULL, _gloffset_Uniform1fvARB), + NAME_FUNC_OFFSET( 8540, glUniform1iARB, glUniform1iARB, NULL, _gloffset_Uniform1iARB), + NAME_FUNC_OFFSET( 8555, glUniform1ivARB, glUniform1ivARB, NULL, _gloffset_Uniform1ivARB), + NAME_FUNC_OFFSET( 8571, glUniform2fARB, glUniform2fARB, NULL, _gloffset_Uniform2fARB), + NAME_FUNC_OFFSET( 8586, glUniform2fvARB, glUniform2fvARB, NULL, _gloffset_Uniform2fvARB), + NAME_FUNC_OFFSET( 8602, glUniform2iARB, glUniform2iARB, NULL, _gloffset_Uniform2iARB), + NAME_FUNC_OFFSET( 8617, glUniform2ivARB, glUniform2ivARB, NULL, _gloffset_Uniform2ivARB), + NAME_FUNC_OFFSET( 8633, glUniform3fARB, glUniform3fARB, NULL, _gloffset_Uniform3fARB), + NAME_FUNC_OFFSET( 8648, glUniform3fvARB, glUniform3fvARB, NULL, _gloffset_Uniform3fvARB), + NAME_FUNC_OFFSET( 8664, glUniform3iARB, glUniform3iARB, NULL, _gloffset_Uniform3iARB), + NAME_FUNC_OFFSET( 8679, glUniform3ivARB, glUniform3ivARB, NULL, _gloffset_Uniform3ivARB), + NAME_FUNC_OFFSET( 8695, glUniform4fARB, glUniform4fARB, NULL, _gloffset_Uniform4fARB), + NAME_FUNC_OFFSET( 8710, glUniform4fvARB, glUniform4fvARB, NULL, _gloffset_Uniform4fvARB), + NAME_FUNC_OFFSET( 8726, glUniform4iARB, glUniform4iARB, NULL, _gloffset_Uniform4iARB), + NAME_FUNC_OFFSET( 8741, glUniform4ivARB, glUniform4ivARB, NULL, _gloffset_Uniform4ivARB), + NAME_FUNC_OFFSET( 8757, glUniformMatrix2fvARB, glUniformMatrix2fvARB, NULL, _gloffset_UniformMatrix2fvARB), + NAME_FUNC_OFFSET( 8779, glUniformMatrix3fvARB, glUniformMatrix3fvARB, NULL, _gloffset_UniformMatrix3fvARB), + NAME_FUNC_OFFSET( 8801, glUniformMatrix4fvARB, glUniformMatrix4fvARB, NULL, _gloffset_UniformMatrix4fvARB), + NAME_FUNC_OFFSET( 8823, glUseProgramObjectARB, glUseProgramObjectARB, NULL, _gloffset_UseProgramObjectARB), + NAME_FUNC_OFFSET( 8845, glValidateProgramARB, glValidateProgramARB, NULL, _gloffset_ValidateProgramARB), + NAME_FUNC_OFFSET( 8866, glBindAttribLocationARB, glBindAttribLocationARB, NULL, _gloffset_BindAttribLocationARB), + NAME_FUNC_OFFSET( 8890, glGetActiveAttribARB, glGetActiveAttribARB, NULL, _gloffset_GetActiveAttribARB), + NAME_FUNC_OFFSET( 8911, glGetAttribLocationARB, glGetAttribLocationARB, NULL, _gloffset_GetAttribLocationARB), + NAME_FUNC_OFFSET( 8934, glDrawBuffersARB, glDrawBuffersARB, NULL, _gloffset_DrawBuffersARB), + NAME_FUNC_OFFSET( 8951, glPolygonOffsetEXT, glPolygonOffsetEXT, NULL, _gloffset_PolygonOffsetEXT), + NAME_FUNC_OFFSET( 8970, gl_dispatch_stub_562, gl_dispatch_stub_562, NULL, _gloffset_GetPixelTexGenParameterfvSGIS), + NAME_FUNC_OFFSET( 9002, gl_dispatch_stub_563, gl_dispatch_stub_563, NULL, _gloffset_GetPixelTexGenParameterivSGIS), + NAME_FUNC_OFFSET( 9034, gl_dispatch_stub_564, gl_dispatch_stub_564, NULL, _gloffset_PixelTexGenParameterfSGIS), + NAME_FUNC_OFFSET( 9062, gl_dispatch_stub_565, gl_dispatch_stub_565, NULL, _gloffset_PixelTexGenParameterfvSGIS), + NAME_FUNC_OFFSET( 9091, gl_dispatch_stub_566, gl_dispatch_stub_566, NULL, _gloffset_PixelTexGenParameteriSGIS), + NAME_FUNC_OFFSET( 9119, gl_dispatch_stub_567, gl_dispatch_stub_567, NULL, _gloffset_PixelTexGenParameterivSGIS), + NAME_FUNC_OFFSET( 9148, gl_dispatch_stub_568, gl_dispatch_stub_568, NULL, _gloffset_SampleMaskSGIS), + NAME_FUNC_OFFSET( 9165, gl_dispatch_stub_569, gl_dispatch_stub_569, NULL, _gloffset_SamplePatternSGIS), + NAME_FUNC_OFFSET( 9185, glColorPointerEXT, glColorPointerEXT, NULL, _gloffset_ColorPointerEXT), + NAME_FUNC_OFFSET( 9203, glEdgeFlagPointerEXT, glEdgeFlagPointerEXT, NULL, _gloffset_EdgeFlagPointerEXT), + NAME_FUNC_OFFSET( 9224, glIndexPointerEXT, glIndexPointerEXT, NULL, _gloffset_IndexPointerEXT), + NAME_FUNC_OFFSET( 9242, glNormalPointerEXT, glNormalPointerEXT, NULL, _gloffset_NormalPointerEXT), + NAME_FUNC_OFFSET( 9261, glTexCoordPointerEXT, glTexCoordPointerEXT, NULL, _gloffset_TexCoordPointerEXT), + NAME_FUNC_OFFSET( 9282, glVertexPointerEXT, glVertexPointerEXT, NULL, _gloffset_VertexPointerEXT), + NAME_FUNC_OFFSET( 9301, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT), + NAME_FUNC_OFFSET( 9322, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT), + NAME_FUNC_OFFSET( 9344, glLockArraysEXT, glLockArraysEXT, NULL, _gloffset_LockArraysEXT), + NAME_FUNC_OFFSET( 9360, glUnlockArraysEXT, glUnlockArraysEXT, NULL, _gloffset_UnlockArraysEXT), + NAME_FUNC_OFFSET( 9378, gl_dispatch_stub_580, gl_dispatch_stub_580, NULL, _gloffset_CullParameterdvEXT), + NAME_FUNC_OFFSET( 9399, gl_dispatch_stub_581, gl_dispatch_stub_581, NULL, _gloffset_CullParameterfvEXT), + NAME_FUNC_OFFSET( 9420, glSecondaryColor3bEXT, glSecondaryColor3bEXT, NULL, _gloffset_SecondaryColor3bEXT), + NAME_FUNC_OFFSET( 9442, glSecondaryColor3bvEXT, glSecondaryColor3bvEXT, NULL, _gloffset_SecondaryColor3bvEXT), + NAME_FUNC_OFFSET( 9465, glSecondaryColor3dEXT, glSecondaryColor3dEXT, NULL, _gloffset_SecondaryColor3dEXT), + NAME_FUNC_OFFSET( 9487, glSecondaryColor3dvEXT, glSecondaryColor3dvEXT, NULL, _gloffset_SecondaryColor3dvEXT), + NAME_FUNC_OFFSET( 9510, glSecondaryColor3fEXT, glSecondaryColor3fEXT, NULL, _gloffset_SecondaryColor3fEXT), + NAME_FUNC_OFFSET( 9532, glSecondaryColor3fvEXT, glSecondaryColor3fvEXT, NULL, _gloffset_SecondaryColor3fvEXT), + NAME_FUNC_OFFSET( 9555, glSecondaryColor3iEXT, glSecondaryColor3iEXT, NULL, _gloffset_SecondaryColor3iEXT), + NAME_FUNC_OFFSET( 9577, glSecondaryColor3ivEXT, glSecondaryColor3ivEXT, NULL, _gloffset_SecondaryColor3ivEXT), + NAME_FUNC_OFFSET( 9600, glSecondaryColor3sEXT, glSecondaryColor3sEXT, NULL, _gloffset_SecondaryColor3sEXT), + NAME_FUNC_OFFSET( 9622, glSecondaryColor3svEXT, glSecondaryColor3svEXT, NULL, _gloffset_SecondaryColor3svEXT), + NAME_FUNC_OFFSET( 9645, glSecondaryColor3ubEXT, glSecondaryColor3ubEXT, NULL, _gloffset_SecondaryColor3ubEXT), + NAME_FUNC_OFFSET( 9668, glSecondaryColor3ubvEXT, glSecondaryColor3ubvEXT, NULL, _gloffset_SecondaryColor3ubvEXT), + NAME_FUNC_OFFSET( 9692, glSecondaryColor3uiEXT, glSecondaryColor3uiEXT, NULL, _gloffset_SecondaryColor3uiEXT), + NAME_FUNC_OFFSET( 9715, glSecondaryColor3uivEXT, glSecondaryColor3uivEXT, NULL, _gloffset_SecondaryColor3uivEXT), + NAME_FUNC_OFFSET( 9739, glSecondaryColor3usEXT, glSecondaryColor3usEXT, NULL, _gloffset_SecondaryColor3usEXT), + NAME_FUNC_OFFSET( 9762, glSecondaryColor3usvEXT, glSecondaryColor3usvEXT, NULL, _gloffset_SecondaryColor3usvEXT), + NAME_FUNC_OFFSET( 9786, glSecondaryColorPointerEXT, glSecondaryColorPointerEXT, NULL, _gloffset_SecondaryColorPointerEXT), + NAME_FUNC_OFFSET( 9813, glMultiDrawArraysEXT, glMultiDrawArraysEXT, NULL, _gloffset_MultiDrawArraysEXT), + NAME_FUNC_OFFSET( 9834, glMultiDrawElementsEXT, glMultiDrawElementsEXT, NULL, _gloffset_MultiDrawElementsEXT), + NAME_FUNC_OFFSET( 9857, glFogCoordPointerEXT, glFogCoordPointerEXT, NULL, _gloffset_FogCoordPointerEXT), + NAME_FUNC_OFFSET( 9878, glFogCoorddEXT, glFogCoorddEXT, NULL, _gloffset_FogCoorddEXT), + NAME_FUNC_OFFSET( 9893, glFogCoorddvEXT, glFogCoorddvEXT, NULL, _gloffset_FogCoorddvEXT), + NAME_FUNC_OFFSET( 9909, glFogCoordfEXT, glFogCoordfEXT, NULL, _gloffset_FogCoordfEXT), + NAME_FUNC_OFFSET( 9924, glFogCoordfvEXT, glFogCoordfvEXT, NULL, _gloffset_FogCoordfvEXT), + NAME_FUNC_OFFSET( 9940, gl_dispatch_stub_606, gl_dispatch_stub_606, NULL, _gloffset_PixelTexGenSGIX), + NAME_FUNC_OFFSET( 9958, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, _gloffset_BlendFuncSeparateEXT), + NAME_FUNC_OFFSET( 9981, glFlushVertexArrayRangeNV, glFlushVertexArrayRangeNV, NULL, _gloffset_FlushVertexArrayRangeNV), + NAME_FUNC_OFFSET(10007, glVertexArrayRangeNV, glVertexArrayRangeNV, NULL, _gloffset_VertexArrayRangeNV), + NAME_FUNC_OFFSET(10028, glCombinerInputNV, glCombinerInputNV, NULL, _gloffset_CombinerInputNV), + NAME_FUNC_OFFSET(10046, glCombinerOutputNV, glCombinerOutputNV, NULL, _gloffset_CombinerOutputNV), + NAME_FUNC_OFFSET(10065, glCombinerParameterfNV, glCombinerParameterfNV, NULL, _gloffset_CombinerParameterfNV), + NAME_FUNC_OFFSET(10088, glCombinerParameterfvNV, glCombinerParameterfvNV, NULL, _gloffset_CombinerParameterfvNV), + NAME_FUNC_OFFSET(10112, glCombinerParameteriNV, glCombinerParameteriNV, NULL, _gloffset_CombinerParameteriNV), + NAME_FUNC_OFFSET(10135, glCombinerParameterivNV, glCombinerParameterivNV, NULL, _gloffset_CombinerParameterivNV), + NAME_FUNC_OFFSET(10159, glFinalCombinerInputNV, glFinalCombinerInputNV, NULL, _gloffset_FinalCombinerInputNV), + NAME_FUNC_OFFSET(10182, glGetCombinerInputParameterfvNV, glGetCombinerInputParameterfvNV, NULL, _gloffset_GetCombinerInputParameterfvNV), + NAME_FUNC_OFFSET(10214, glGetCombinerInputParameterivNV, glGetCombinerInputParameterivNV, NULL, _gloffset_GetCombinerInputParameterivNV), + NAME_FUNC_OFFSET(10246, glGetCombinerOutputParameterfvNV, glGetCombinerOutputParameterfvNV, NULL, _gloffset_GetCombinerOutputParameterfvNV), + NAME_FUNC_OFFSET(10279, glGetCombinerOutputParameterivNV, glGetCombinerOutputParameterivNV, NULL, _gloffset_GetCombinerOutputParameterivNV), + NAME_FUNC_OFFSET(10312, glGetFinalCombinerInputParameterfvNV, glGetFinalCombinerInputParameterfvNV, NULL, _gloffset_GetFinalCombinerInputParameterfvNV), + NAME_FUNC_OFFSET(10349, glGetFinalCombinerInputParameterivNV, glGetFinalCombinerInputParameterivNV, NULL, _gloffset_GetFinalCombinerInputParameterivNV), + NAME_FUNC_OFFSET(10386, glResizeBuffersMESA, glResizeBuffersMESA, NULL, _gloffset_ResizeBuffersMESA), + NAME_FUNC_OFFSET(10406, glWindowPos2dMESA, glWindowPos2dMESA, NULL, _gloffset_WindowPos2dMESA), + NAME_FUNC_OFFSET(10424, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, _gloffset_WindowPos2dvMESA), + NAME_FUNC_OFFSET(10443, glWindowPos2fMESA, glWindowPos2fMESA, NULL, _gloffset_WindowPos2fMESA), + NAME_FUNC_OFFSET(10461, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, _gloffset_WindowPos2fvMESA), + NAME_FUNC_OFFSET(10480, glWindowPos2iMESA, glWindowPos2iMESA, NULL, _gloffset_WindowPos2iMESA), + NAME_FUNC_OFFSET(10498, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, _gloffset_WindowPos2ivMESA), + NAME_FUNC_OFFSET(10517, glWindowPos2sMESA, glWindowPos2sMESA, NULL, _gloffset_WindowPos2sMESA), + NAME_FUNC_OFFSET(10535, glWindowPos2svMESA, glWindowPos2svMESA, NULL, _gloffset_WindowPos2svMESA), + NAME_FUNC_OFFSET(10554, glWindowPos3dMESA, glWindowPos3dMESA, NULL, _gloffset_WindowPos3dMESA), + NAME_FUNC_OFFSET(10572, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, _gloffset_WindowPos3dvMESA), + NAME_FUNC_OFFSET(10591, glWindowPos3fMESA, glWindowPos3fMESA, NULL, _gloffset_WindowPos3fMESA), + NAME_FUNC_OFFSET(10609, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, _gloffset_WindowPos3fvMESA), + NAME_FUNC_OFFSET(10628, glWindowPos3iMESA, glWindowPos3iMESA, NULL, _gloffset_WindowPos3iMESA), + NAME_FUNC_OFFSET(10646, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, _gloffset_WindowPos3ivMESA), + NAME_FUNC_OFFSET(10665, glWindowPos3sMESA, glWindowPos3sMESA, NULL, _gloffset_WindowPos3sMESA), + NAME_FUNC_OFFSET(10683, glWindowPos3svMESA, glWindowPos3svMESA, NULL, _gloffset_WindowPos3svMESA), + NAME_FUNC_OFFSET(10702, glWindowPos4dMESA, glWindowPos4dMESA, NULL, _gloffset_WindowPos4dMESA), + NAME_FUNC_OFFSET(10720, glWindowPos4dvMESA, glWindowPos4dvMESA, NULL, _gloffset_WindowPos4dvMESA), + NAME_FUNC_OFFSET(10739, glWindowPos4fMESA, glWindowPos4fMESA, NULL, _gloffset_WindowPos4fMESA), + NAME_FUNC_OFFSET(10757, glWindowPos4fvMESA, glWindowPos4fvMESA, NULL, _gloffset_WindowPos4fvMESA), + NAME_FUNC_OFFSET(10776, glWindowPos4iMESA, glWindowPos4iMESA, NULL, _gloffset_WindowPos4iMESA), + NAME_FUNC_OFFSET(10794, glWindowPos4ivMESA, glWindowPos4ivMESA, NULL, _gloffset_WindowPos4ivMESA), + NAME_FUNC_OFFSET(10813, glWindowPos4sMESA, glWindowPos4sMESA, NULL, _gloffset_WindowPos4sMESA), + NAME_FUNC_OFFSET(10831, glWindowPos4svMESA, glWindowPos4svMESA, NULL, _gloffset_WindowPos4svMESA), + NAME_FUNC_OFFSET(10850, gl_dispatch_stub_648, gl_dispatch_stub_648, NULL, _gloffset_MultiModeDrawArraysIBM), + NAME_FUNC_OFFSET(10875, gl_dispatch_stub_649, gl_dispatch_stub_649, NULL, _gloffset_MultiModeDrawElementsIBM), + NAME_FUNC_OFFSET(10902, gl_dispatch_stub_650, gl_dispatch_stub_650, NULL, _gloffset_DeleteFencesNV), + NAME_FUNC_OFFSET(10919, gl_dispatch_stub_651, gl_dispatch_stub_651, NULL, _gloffset_FinishFenceNV), + NAME_FUNC_OFFSET(10935, gl_dispatch_stub_652, gl_dispatch_stub_652, NULL, _gloffset_GenFencesNV), + NAME_FUNC_OFFSET(10949, gl_dispatch_stub_653, gl_dispatch_stub_653, NULL, _gloffset_GetFenceivNV), + NAME_FUNC_OFFSET(10964, gl_dispatch_stub_654, gl_dispatch_stub_654, NULL, _gloffset_IsFenceNV), + NAME_FUNC_OFFSET(10976, gl_dispatch_stub_655, gl_dispatch_stub_655, NULL, _gloffset_SetFenceNV), + NAME_FUNC_OFFSET(10989, gl_dispatch_stub_656, gl_dispatch_stub_656, NULL, _gloffset_TestFenceNV), + NAME_FUNC_OFFSET(11003, glAreProgramsResidentNV, glAreProgramsResidentNV, NULL, _gloffset_AreProgramsResidentNV), + NAME_FUNC_OFFSET(11027, glBindProgramNV, glBindProgramNV, NULL, _gloffset_BindProgramNV), + NAME_FUNC_OFFSET(11043, glDeleteProgramsNV, glDeleteProgramsNV, NULL, _gloffset_DeleteProgramsNV), + NAME_FUNC_OFFSET(11062, glExecuteProgramNV, glExecuteProgramNV, NULL, _gloffset_ExecuteProgramNV), + NAME_FUNC_OFFSET(11081, glGenProgramsNV, glGenProgramsNV, NULL, _gloffset_GenProgramsNV), + NAME_FUNC_OFFSET(11097, glGetProgramParameterdvNV, glGetProgramParameterdvNV, NULL, _gloffset_GetProgramParameterdvNV), + NAME_FUNC_OFFSET(11123, glGetProgramParameterfvNV, glGetProgramParameterfvNV, NULL, _gloffset_GetProgramParameterfvNV), + NAME_FUNC_OFFSET(11149, glGetProgramStringNV, glGetProgramStringNV, NULL, _gloffset_GetProgramStringNV), + NAME_FUNC_OFFSET(11170, glGetProgramivNV, glGetProgramivNV, NULL, _gloffset_GetProgramivNV), + NAME_FUNC_OFFSET(11187, glGetTrackMatrixivNV, glGetTrackMatrixivNV, NULL, _gloffset_GetTrackMatrixivNV), + NAME_FUNC_OFFSET(11208, glGetVertexAttribPointervNV, glGetVertexAttribPointervNV, NULL, _gloffset_GetVertexAttribPointervNV), + NAME_FUNC_OFFSET(11236, glGetVertexAttribdvNV, glGetVertexAttribdvNV, NULL, _gloffset_GetVertexAttribdvNV), + NAME_FUNC_OFFSET(11258, glGetVertexAttribfvNV, glGetVertexAttribfvNV, NULL, _gloffset_GetVertexAttribfvNV), + NAME_FUNC_OFFSET(11280, glGetVertexAttribivNV, glGetVertexAttribivNV, NULL, _gloffset_GetVertexAttribivNV), + NAME_FUNC_OFFSET(11302, glIsProgramNV, glIsProgramNV, NULL, _gloffset_IsProgramNV), + NAME_FUNC_OFFSET(11316, glLoadProgramNV, glLoadProgramNV, NULL, _gloffset_LoadProgramNV), + NAME_FUNC_OFFSET(11332, glProgramParameter4dNV, glProgramParameter4dNV, NULL, _gloffset_ProgramParameter4dNV), + NAME_FUNC_OFFSET(11355, glProgramParameter4dvNV, glProgramParameter4dvNV, NULL, _gloffset_ProgramParameter4dvNV), + NAME_FUNC_OFFSET(11379, glProgramParameter4fNV, glProgramParameter4fNV, NULL, _gloffset_ProgramParameter4fNV), + NAME_FUNC_OFFSET(11402, glProgramParameter4fvNV, glProgramParameter4fvNV, NULL, _gloffset_ProgramParameter4fvNV), + NAME_FUNC_OFFSET(11426, glProgramParameters4dvNV, glProgramParameters4dvNV, NULL, _gloffset_ProgramParameters4dvNV), + NAME_FUNC_OFFSET(11451, glProgramParameters4fvNV, glProgramParameters4fvNV, NULL, _gloffset_ProgramParameters4fvNV), + NAME_FUNC_OFFSET(11476, glRequestResidentProgramsNV, glRequestResidentProgramsNV, NULL, _gloffset_RequestResidentProgramsNV), + NAME_FUNC_OFFSET(11504, glTrackMatrixNV, glTrackMatrixNV, NULL, _gloffset_TrackMatrixNV), + NAME_FUNC_OFFSET(11520, glVertexAttrib1dNV, glVertexAttrib1dNV, NULL, _gloffset_VertexAttrib1dNV), + NAME_FUNC_OFFSET(11539, glVertexAttrib1dvNV, glVertexAttrib1dvNV, NULL, _gloffset_VertexAttrib1dvNV), + NAME_FUNC_OFFSET(11559, glVertexAttrib1fNV, glVertexAttrib1fNV, NULL, _gloffset_VertexAttrib1fNV), + NAME_FUNC_OFFSET(11578, glVertexAttrib1fvNV, glVertexAttrib1fvNV, NULL, _gloffset_VertexAttrib1fvNV), + NAME_FUNC_OFFSET(11598, glVertexAttrib1sNV, glVertexAttrib1sNV, NULL, _gloffset_VertexAttrib1sNV), + NAME_FUNC_OFFSET(11617, glVertexAttrib1svNV, glVertexAttrib1svNV, NULL, _gloffset_VertexAttrib1svNV), + NAME_FUNC_OFFSET(11637, glVertexAttrib2dNV, glVertexAttrib2dNV, NULL, _gloffset_VertexAttrib2dNV), + NAME_FUNC_OFFSET(11656, glVertexAttrib2dvNV, glVertexAttrib2dvNV, NULL, _gloffset_VertexAttrib2dvNV), + NAME_FUNC_OFFSET(11676, glVertexAttrib2fNV, glVertexAttrib2fNV, NULL, _gloffset_VertexAttrib2fNV), + NAME_FUNC_OFFSET(11695, glVertexAttrib2fvNV, glVertexAttrib2fvNV, NULL, _gloffset_VertexAttrib2fvNV), + NAME_FUNC_OFFSET(11715, glVertexAttrib2sNV, glVertexAttrib2sNV, NULL, _gloffset_VertexAttrib2sNV), + NAME_FUNC_OFFSET(11734, glVertexAttrib2svNV, glVertexAttrib2svNV, NULL, _gloffset_VertexAttrib2svNV), + NAME_FUNC_OFFSET(11754, glVertexAttrib3dNV, glVertexAttrib3dNV, NULL, _gloffset_VertexAttrib3dNV), + NAME_FUNC_OFFSET(11773, glVertexAttrib3dvNV, glVertexAttrib3dvNV, NULL, _gloffset_VertexAttrib3dvNV), + NAME_FUNC_OFFSET(11793, glVertexAttrib3fNV, glVertexAttrib3fNV, NULL, _gloffset_VertexAttrib3fNV), + NAME_FUNC_OFFSET(11812, glVertexAttrib3fvNV, glVertexAttrib3fvNV, NULL, _gloffset_VertexAttrib3fvNV), + NAME_FUNC_OFFSET(11832, glVertexAttrib3sNV, glVertexAttrib3sNV, NULL, _gloffset_VertexAttrib3sNV), + NAME_FUNC_OFFSET(11851, glVertexAttrib3svNV, glVertexAttrib3svNV, NULL, _gloffset_VertexAttrib3svNV), + NAME_FUNC_OFFSET(11871, glVertexAttrib4dNV, glVertexAttrib4dNV, NULL, _gloffset_VertexAttrib4dNV), + NAME_FUNC_OFFSET(11890, glVertexAttrib4dvNV, glVertexAttrib4dvNV, NULL, _gloffset_VertexAttrib4dvNV), + NAME_FUNC_OFFSET(11910, glVertexAttrib4fNV, glVertexAttrib4fNV, NULL, _gloffset_VertexAttrib4fNV), + NAME_FUNC_OFFSET(11929, glVertexAttrib4fvNV, glVertexAttrib4fvNV, NULL, _gloffset_VertexAttrib4fvNV), + NAME_FUNC_OFFSET(11949, glVertexAttrib4sNV, glVertexAttrib4sNV, NULL, _gloffset_VertexAttrib4sNV), + NAME_FUNC_OFFSET(11968, glVertexAttrib4svNV, glVertexAttrib4svNV, NULL, _gloffset_VertexAttrib4svNV), + NAME_FUNC_OFFSET(11988, glVertexAttrib4ubNV, glVertexAttrib4ubNV, NULL, _gloffset_VertexAttrib4ubNV), + NAME_FUNC_OFFSET(12008, glVertexAttrib4ubvNV, glVertexAttrib4ubvNV, NULL, _gloffset_VertexAttrib4ubvNV), + NAME_FUNC_OFFSET(12029, glVertexAttribPointerNV, glVertexAttribPointerNV, NULL, _gloffset_VertexAttribPointerNV), + NAME_FUNC_OFFSET(12053, glVertexAttribs1dvNV, glVertexAttribs1dvNV, NULL, _gloffset_VertexAttribs1dvNV), + NAME_FUNC_OFFSET(12074, glVertexAttribs1fvNV, glVertexAttribs1fvNV, NULL, _gloffset_VertexAttribs1fvNV), + NAME_FUNC_OFFSET(12095, glVertexAttribs1svNV, glVertexAttribs1svNV, NULL, _gloffset_VertexAttribs1svNV), + NAME_FUNC_OFFSET(12116, glVertexAttribs2dvNV, glVertexAttribs2dvNV, NULL, _gloffset_VertexAttribs2dvNV), + NAME_FUNC_OFFSET(12137, glVertexAttribs2fvNV, glVertexAttribs2fvNV, NULL, _gloffset_VertexAttribs2fvNV), + NAME_FUNC_OFFSET(12158, glVertexAttribs2svNV, glVertexAttribs2svNV, NULL, _gloffset_VertexAttribs2svNV), + NAME_FUNC_OFFSET(12179, glVertexAttribs3dvNV, glVertexAttribs3dvNV, NULL, _gloffset_VertexAttribs3dvNV), + NAME_FUNC_OFFSET(12200, glVertexAttribs3fvNV, glVertexAttribs3fvNV, NULL, _gloffset_VertexAttribs3fvNV), + NAME_FUNC_OFFSET(12221, glVertexAttribs3svNV, glVertexAttribs3svNV, NULL, _gloffset_VertexAttribs3svNV), + NAME_FUNC_OFFSET(12242, glVertexAttribs4dvNV, glVertexAttribs4dvNV, NULL, _gloffset_VertexAttribs4dvNV), + NAME_FUNC_OFFSET(12263, glVertexAttribs4fvNV, glVertexAttribs4fvNV, NULL, _gloffset_VertexAttribs4fvNV), + NAME_FUNC_OFFSET(12284, glVertexAttribs4svNV, glVertexAttribs4svNV, NULL, _gloffset_VertexAttribs4svNV), + NAME_FUNC_OFFSET(12305, glVertexAttribs4ubvNV, glVertexAttribs4ubvNV, NULL, _gloffset_VertexAttribs4ubvNV), + NAME_FUNC_OFFSET(12327, glAlphaFragmentOp1ATI, glAlphaFragmentOp1ATI, NULL, _gloffset_AlphaFragmentOp1ATI), + NAME_FUNC_OFFSET(12349, glAlphaFragmentOp2ATI, glAlphaFragmentOp2ATI, NULL, _gloffset_AlphaFragmentOp2ATI), + NAME_FUNC_OFFSET(12371, glAlphaFragmentOp3ATI, glAlphaFragmentOp3ATI, NULL, _gloffset_AlphaFragmentOp3ATI), + NAME_FUNC_OFFSET(12393, glBeginFragmentShaderATI, glBeginFragmentShaderATI, NULL, _gloffset_BeginFragmentShaderATI), + NAME_FUNC_OFFSET(12418, glBindFragmentShaderATI, glBindFragmentShaderATI, NULL, _gloffset_BindFragmentShaderATI), + NAME_FUNC_OFFSET(12442, glColorFragmentOp1ATI, glColorFragmentOp1ATI, NULL, _gloffset_ColorFragmentOp1ATI), + NAME_FUNC_OFFSET(12464, glColorFragmentOp2ATI, glColorFragmentOp2ATI, NULL, _gloffset_ColorFragmentOp2ATI), + NAME_FUNC_OFFSET(12486, glColorFragmentOp3ATI, glColorFragmentOp3ATI, NULL, _gloffset_ColorFragmentOp3ATI), + NAME_FUNC_OFFSET(12508, glDeleteFragmentShaderATI, glDeleteFragmentShaderATI, NULL, _gloffset_DeleteFragmentShaderATI), + NAME_FUNC_OFFSET(12534, glEndFragmentShaderATI, glEndFragmentShaderATI, NULL, _gloffset_EndFragmentShaderATI), + NAME_FUNC_OFFSET(12557, glGenFragmentShadersATI, glGenFragmentShadersATI, NULL, _gloffset_GenFragmentShadersATI), + NAME_FUNC_OFFSET(12581, glPassTexCoordATI, glPassTexCoordATI, NULL, _gloffset_PassTexCoordATI), + NAME_FUNC_OFFSET(12599, glSampleMapATI, glSampleMapATI, NULL, _gloffset_SampleMapATI), + NAME_FUNC_OFFSET(12614, glSetFragmentShaderConstantATI, glSetFragmentShaderConstantATI, NULL, _gloffset_SetFragmentShaderConstantATI), + NAME_FUNC_OFFSET(12645, glPointParameteriNV, glPointParameteriNV, NULL, _gloffset_PointParameteriNV), + NAME_FUNC_OFFSET(12665, glPointParameterivNV, glPointParameterivNV, NULL, _gloffset_PointParameterivNV), + NAME_FUNC_OFFSET(12686, gl_dispatch_stub_737, gl_dispatch_stub_737, NULL, _gloffset_ActiveStencilFaceEXT), + NAME_FUNC_OFFSET(12709, gl_dispatch_stub_738, gl_dispatch_stub_738, NULL, _gloffset_BindVertexArrayAPPLE), + NAME_FUNC_OFFSET(12732, gl_dispatch_stub_739, gl_dispatch_stub_739, NULL, _gloffset_DeleteVertexArraysAPPLE), + NAME_FUNC_OFFSET(12758, gl_dispatch_stub_740, gl_dispatch_stub_740, NULL, _gloffset_GenVertexArraysAPPLE), + NAME_FUNC_OFFSET(12781, gl_dispatch_stub_741, gl_dispatch_stub_741, NULL, _gloffset_IsVertexArrayAPPLE), + NAME_FUNC_OFFSET(12802, glGetProgramNamedParameterdvNV, glGetProgramNamedParameterdvNV, NULL, _gloffset_GetProgramNamedParameterdvNV), + NAME_FUNC_OFFSET(12833, glGetProgramNamedParameterfvNV, glGetProgramNamedParameterfvNV, NULL, _gloffset_GetProgramNamedParameterfvNV), + NAME_FUNC_OFFSET(12864, glProgramNamedParameter4dNV, glProgramNamedParameter4dNV, NULL, _gloffset_ProgramNamedParameter4dNV), + NAME_FUNC_OFFSET(12892, glProgramNamedParameter4dvNV, glProgramNamedParameter4dvNV, NULL, _gloffset_ProgramNamedParameter4dvNV), + NAME_FUNC_OFFSET(12921, glProgramNamedParameter4fNV, glProgramNamedParameter4fNV, NULL, _gloffset_ProgramNamedParameter4fNV), + NAME_FUNC_OFFSET(12949, glProgramNamedParameter4fvNV, glProgramNamedParameter4fvNV, NULL, _gloffset_ProgramNamedParameter4fvNV), + NAME_FUNC_OFFSET(12978, gl_dispatch_stub_748, gl_dispatch_stub_748, NULL, _gloffset_DepthBoundsEXT), + NAME_FUNC_OFFSET(12995, gl_dispatch_stub_749, gl_dispatch_stub_749, NULL, _gloffset_BlendEquationSeparateEXT), + NAME_FUNC_OFFSET(13022, glBindFramebufferEXT, glBindFramebufferEXT, NULL, _gloffset_BindFramebufferEXT), + NAME_FUNC_OFFSET(13043, glBindRenderbufferEXT, glBindRenderbufferEXT, NULL, _gloffset_BindRenderbufferEXT), + NAME_FUNC_OFFSET(13065, glCheckFramebufferStatusEXT, glCheckFramebufferStatusEXT, NULL, _gloffset_CheckFramebufferStatusEXT), + NAME_FUNC_OFFSET(13093, glDeleteFramebuffersEXT, glDeleteFramebuffersEXT, NULL, _gloffset_DeleteFramebuffersEXT), + NAME_FUNC_OFFSET(13117, glDeleteRenderbuffersEXT, glDeleteRenderbuffersEXT, NULL, _gloffset_DeleteRenderbuffersEXT), + NAME_FUNC_OFFSET(13142, glFramebufferRenderbufferEXT, glFramebufferRenderbufferEXT, NULL, _gloffset_FramebufferRenderbufferEXT), + NAME_FUNC_OFFSET(13171, glFramebufferTexture1DEXT, glFramebufferTexture1DEXT, NULL, _gloffset_FramebufferTexture1DEXT), + NAME_FUNC_OFFSET(13197, glFramebufferTexture2DEXT, glFramebufferTexture2DEXT, NULL, _gloffset_FramebufferTexture2DEXT), + NAME_FUNC_OFFSET(13223, glFramebufferTexture3DEXT, glFramebufferTexture3DEXT, NULL, _gloffset_FramebufferTexture3DEXT), + NAME_FUNC_OFFSET(13249, glGenFramebuffersEXT, glGenFramebuffersEXT, NULL, _gloffset_GenFramebuffersEXT), + NAME_FUNC_OFFSET(13270, glGenRenderbuffersEXT, glGenRenderbuffersEXT, NULL, _gloffset_GenRenderbuffersEXT), + NAME_FUNC_OFFSET(13292, glGenerateMipmapEXT, glGenerateMipmapEXT, NULL, _gloffset_GenerateMipmapEXT), + NAME_FUNC_OFFSET(13312, glGetFramebufferAttachmentParameterivEXT, glGetFramebufferAttachmentParameterivEXT, NULL, _gloffset_GetFramebufferAttachmentParameterivEXT), + NAME_FUNC_OFFSET(13353, glGetRenderbufferParameterivEXT, glGetRenderbufferParameterivEXT, NULL, _gloffset_GetRenderbufferParameterivEXT), + NAME_FUNC_OFFSET(13385, glIsFramebufferEXT, glIsFramebufferEXT, NULL, _gloffset_IsFramebufferEXT), + NAME_FUNC_OFFSET(13404, glIsRenderbufferEXT, glIsRenderbufferEXT, NULL, _gloffset_IsRenderbufferEXT), + NAME_FUNC_OFFSET(13424, glRenderbufferStorageEXT, glRenderbufferStorageEXT, NULL, _gloffset_RenderbufferStorageEXT), + NAME_FUNC_OFFSET(13449, gl_dispatch_stub_767, gl_dispatch_stub_767, NULL, _gloffset_BlitFramebufferEXT), + NAME_FUNC_OFFSET(13470, gl_dispatch_stub_768, gl_dispatch_stub_768, NULL, _gloffset_ProgramEnvParameters4fvEXT), + NAME_FUNC_OFFSET(13499, gl_dispatch_stub_769, gl_dispatch_stub_769, NULL, _gloffset_ProgramLocalParameters4fvEXT), + NAME_FUNC_OFFSET(13530, gl_dispatch_stub_770, gl_dispatch_stub_770, NULL, _gloffset_GetQueryObjecti64vEXT), + NAME_FUNC_OFFSET(13554, gl_dispatch_stub_771, gl_dispatch_stub_771, NULL, _gloffset_GetQueryObjectui64vEXT), + NAME_FUNC_OFFSET(13579, glArrayElement, glArrayElement, NULL, _gloffset_ArrayElement), + NAME_FUNC_OFFSET(13597, glBindTexture, glBindTexture, NULL, _gloffset_BindTexture), + NAME_FUNC_OFFSET(13614, glDrawArrays, glDrawArrays, NULL, _gloffset_DrawArrays), + NAME_FUNC_OFFSET(13630, glAreTexturesResident, glAreTexturesResidentEXT, glAreTexturesResidentEXT, _gloffset_AreTexturesResident), + NAME_FUNC_OFFSET(13655, glCopyTexImage1D, glCopyTexImage1D, NULL, _gloffset_CopyTexImage1D), + NAME_FUNC_OFFSET(13675, glCopyTexImage2D, glCopyTexImage2D, NULL, _gloffset_CopyTexImage2D), + NAME_FUNC_OFFSET(13695, glCopyTexSubImage1D, glCopyTexSubImage1D, NULL, _gloffset_CopyTexSubImage1D), + NAME_FUNC_OFFSET(13718, glCopyTexSubImage2D, glCopyTexSubImage2D, NULL, _gloffset_CopyTexSubImage2D), + NAME_FUNC_OFFSET(13741, glDeleteTextures, glDeleteTexturesEXT, glDeleteTexturesEXT, _gloffset_DeleteTextures), + NAME_FUNC_OFFSET(13761, glGenTextures, glGenTexturesEXT, glGenTexturesEXT, _gloffset_GenTextures), + NAME_FUNC_OFFSET(13778, glGetPointerv, glGetPointerv, NULL, _gloffset_GetPointerv), + NAME_FUNC_OFFSET(13795, glIsTexture, glIsTextureEXT, glIsTextureEXT, _gloffset_IsTexture), + NAME_FUNC_OFFSET(13810, glPrioritizeTextures, glPrioritizeTextures, NULL, _gloffset_PrioritizeTextures), + NAME_FUNC_OFFSET(13834, glTexSubImage1D, glTexSubImage1D, NULL, _gloffset_TexSubImage1D), + NAME_FUNC_OFFSET(13853, glTexSubImage2D, glTexSubImage2D, NULL, _gloffset_TexSubImage2D), + NAME_FUNC_OFFSET(13872, glBlendColor, glBlendColor, NULL, _gloffset_BlendColor), + NAME_FUNC_OFFSET(13888, glBlendEquation, glBlendEquation, NULL, _gloffset_BlendEquation), + NAME_FUNC_OFFSET(13907, glDrawRangeElements, glDrawRangeElements, NULL, _gloffset_DrawRangeElements), + NAME_FUNC_OFFSET(13930, glColorTable, glColorTable, NULL, _gloffset_ColorTable), + NAME_FUNC_OFFSET(13946, glColorTable, glColorTable, NULL, _gloffset_ColorTable), + NAME_FUNC_OFFSET(13962, glColorTableParameterfv, glColorTableParameterfv, NULL, _gloffset_ColorTableParameterfv), + NAME_FUNC_OFFSET(13989, glColorTableParameteriv, glColorTableParameteriv, NULL, _gloffset_ColorTableParameteriv), + NAME_FUNC_OFFSET(14016, glCopyColorTable, glCopyColorTable, NULL, _gloffset_CopyColorTable), + NAME_FUNC_OFFSET(14036, glGetColorTable, glGetColorTableEXT, glGetColorTableEXT, _gloffset_GetColorTable), + NAME_FUNC_OFFSET(14055, glGetColorTable, glGetColorTableEXT, glGetColorTableEXT, _gloffset_GetColorTable), + NAME_FUNC_OFFSET(14074, glGetColorTableParameterfv, glGetColorTableParameterfvEXT, glGetColorTableParameterfvEXT, _gloffset_GetColorTableParameterfv), + NAME_FUNC_OFFSET(14104, glGetColorTableParameterfv, glGetColorTableParameterfvEXT, glGetColorTableParameterfvEXT, _gloffset_GetColorTableParameterfv), + NAME_FUNC_OFFSET(14134, glGetColorTableParameteriv, glGetColorTableParameterivEXT, glGetColorTableParameterivEXT, _gloffset_GetColorTableParameteriv), + NAME_FUNC_OFFSET(14164, glGetColorTableParameteriv, glGetColorTableParameterivEXT, glGetColorTableParameterivEXT, _gloffset_GetColorTableParameteriv), + NAME_FUNC_OFFSET(14194, glColorSubTable, glColorSubTable, NULL, _gloffset_ColorSubTable), + NAME_FUNC_OFFSET(14213, glCopyColorSubTable, glCopyColorSubTable, NULL, _gloffset_CopyColorSubTable), + NAME_FUNC_OFFSET(14236, glConvolutionFilter1D, glConvolutionFilter1D, NULL, _gloffset_ConvolutionFilter1D), + NAME_FUNC_OFFSET(14261, glConvolutionFilter2D, glConvolutionFilter2D, NULL, _gloffset_ConvolutionFilter2D), + NAME_FUNC_OFFSET(14286, glConvolutionParameterf, glConvolutionParameterf, NULL, _gloffset_ConvolutionParameterf), + NAME_FUNC_OFFSET(14313, glConvolutionParameterfv, glConvolutionParameterfv, NULL, _gloffset_ConvolutionParameterfv), + NAME_FUNC_OFFSET(14341, glConvolutionParameteri, glConvolutionParameteri, NULL, _gloffset_ConvolutionParameteri), + NAME_FUNC_OFFSET(14368, glConvolutionParameteriv, glConvolutionParameteriv, NULL, _gloffset_ConvolutionParameteriv), + NAME_FUNC_OFFSET(14396, glCopyConvolutionFilter1D, glCopyConvolutionFilter1D, NULL, _gloffset_CopyConvolutionFilter1D), + NAME_FUNC_OFFSET(14425, glCopyConvolutionFilter2D, glCopyConvolutionFilter2D, NULL, _gloffset_CopyConvolutionFilter2D), + NAME_FUNC_OFFSET(14454, glGetConvolutionFilter, gl_dispatch_stub_356, gl_dispatch_stub_356, _gloffset_GetConvolutionFilter), + NAME_FUNC_OFFSET(14480, glGetConvolutionParameterfv, gl_dispatch_stub_357, gl_dispatch_stub_357, _gloffset_GetConvolutionParameterfv), + NAME_FUNC_OFFSET(14511, glGetConvolutionParameteriv, gl_dispatch_stub_358, gl_dispatch_stub_358, _gloffset_GetConvolutionParameteriv), + NAME_FUNC_OFFSET(14542, glGetSeparableFilter, gl_dispatch_stub_359, gl_dispatch_stub_359, _gloffset_GetSeparableFilter), + NAME_FUNC_OFFSET(14566, glSeparableFilter2D, glSeparableFilter2D, NULL, _gloffset_SeparableFilter2D), + NAME_FUNC_OFFSET(14589, glGetHistogram, gl_dispatch_stub_361, gl_dispatch_stub_361, _gloffset_GetHistogram), + NAME_FUNC_OFFSET(14607, glGetHistogramParameterfv, gl_dispatch_stub_362, gl_dispatch_stub_362, _gloffset_GetHistogramParameterfv), + NAME_FUNC_OFFSET(14636, glGetHistogramParameteriv, gl_dispatch_stub_363, gl_dispatch_stub_363, _gloffset_GetHistogramParameteriv), + NAME_FUNC_OFFSET(14665, glGetMinmax, gl_dispatch_stub_364, gl_dispatch_stub_364, _gloffset_GetMinmax), + NAME_FUNC_OFFSET(14680, glGetMinmaxParameterfv, gl_dispatch_stub_365, gl_dispatch_stub_365, _gloffset_GetMinmaxParameterfv), + NAME_FUNC_OFFSET(14706, glGetMinmaxParameteriv, gl_dispatch_stub_366, gl_dispatch_stub_366, _gloffset_GetMinmaxParameteriv), + NAME_FUNC_OFFSET(14732, glHistogram, glHistogram, NULL, _gloffset_Histogram), + NAME_FUNC_OFFSET(14747, glMinmax, glMinmax, NULL, _gloffset_Minmax), + NAME_FUNC_OFFSET(14759, glResetHistogram, glResetHistogram, NULL, _gloffset_ResetHistogram), + NAME_FUNC_OFFSET(14779, glResetMinmax, glResetMinmax, NULL, _gloffset_ResetMinmax), + NAME_FUNC_OFFSET(14796, glTexImage3D, glTexImage3D, NULL, _gloffset_TexImage3D), + NAME_FUNC_OFFSET(14812, glTexSubImage3D, glTexSubImage3D, NULL, _gloffset_TexSubImage3D), + NAME_FUNC_OFFSET(14831, glCopyTexSubImage3D, glCopyTexSubImage3D, NULL, _gloffset_CopyTexSubImage3D), + NAME_FUNC_OFFSET(14854, glActiveTextureARB, glActiveTextureARB, NULL, _gloffset_ActiveTextureARB), + NAME_FUNC_OFFSET(14870, glClientActiveTextureARB, glClientActiveTextureARB, NULL, _gloffset_ClientActiveTextureARB), + NAME_FUNC_OFFSET(14892, glMultiTexCoord1dARB, glMultiTexCoord1dARB, NULL, _gloffset_MultiTexCoord1dARB), + NAME_FUNC_OFFSET(14910, glMultiTexCoord1dvARB, glMultiTexCoord1dvARB, NULL, _gloffset_MultiTexCoord1dvARB), + NAME_FUNC_OFFSET(14929, glMultiTexCoord1fARB, glMultiTexCoord1fARB, NULL, _gloffset_MultiTexCoord1fARB), + NAME_FUNC_OFFSET(14947, glMultiTexCoord1fvARB, glMultiTexCoord1fvARB, NULL, _gloffset_MultiTexCoord1fvARB), + NAME_FUNC_OFFSET(14966, glMultiTexCoord1iARB, glMultiTexCoord1iARB, NULL, _gloffset_MultiTexCoord1iARB), + NAME_FUNC_OFFSET(14984, glMultiTexCoord1ivARB, glMultiTexCoord1ivARB, NULL, _gloffset_MultiTexCoord1ivARB), + NAME_FUNC_OFFSET(15003, glMultiTexCoord1sARB, glMultiTexCoord1sARB, NULL, _gloffset_MultiTexCoord1sARB), + NAME_FUNC_OFFSET(15021, glMultiTexCoord1svARB, glMultiTexCoord1svARB, NULL, _gloffset_MultiTexCoord1svARB), + NAME_FUNC_OFFSET(15040, glMultiTexCoord2dARB, glMultiTexCoord2dARB, NULL, _gloffset_MultiTexCoord2dARB), + NAME_FUNC_OFFSET(15058, glMultiTexCoord2dvARB, glMultiTexCoord2dvARB, NULL, _gloffset_MultiTexCoord2dvARB), + NAME_FUNC_OFFSET(15077, glMultiTexCoord2fARB, glMultiTexCoord2fARB, NULL, _gloffset_MultiTexCoord2fARB), + NAME_FUNC_OFFSET(15095, glMultiTexCoord2fvARB, glMultiTexCoord2fvARB, NULL, _gloffset_MultiTexCoord2fvARB), + NAME_FUNC_OFFSET(15114, glMultiTexCoord2iARB, glMultiTexCoord2iARB, NULL, _gloffset_MultiTexCoord2iARB), + NAME_FUNC_OFFSET(15132, glMultiTexCoord2ivARB, glMultiTexCoord2ivARB, NULL, _gloffset_MultiTexCoord2ivARB), + NAME_FUNC_OFFSET(15151, glMultiTexCoord2sARB, glMultiTexCoord2sARB, NULL, _gloffset_MultiTexCoord2sARB), + NAME_FUNC_OFFSET(15169, glMultiTexCoord2svARB, glMultiTexCoord2svARB, NULL, _gloffset_MultiTexCoord2svARB), + NAME_FUNC_OFFSET(15188, glMultiTexCoord3dARB, glMultiTexCoord3dARB, NULL, _gloffset_MultiTexCoord3dARB), + NAME_FUNC_OFFSET(15206, glMultiTexCoord3dvARB, glMultiTexCoord3dvARB, NULL, _gloffset_MultiTexCoord3dvARB), + NAME_FUNC_OFFSET(15225, glMultiTexCoord3fARB, glMultiTexCoord3fARB, NULL, _gloffset_MultiTexCoord3fARB), + NAME_FUNC_OFFSET(15243, glMultiTexCoord3fvARB, glMultiTexCoord3fvARB, NULL, _gloffset_MultiTexCoord3fvARB), + NAME_FUNC_OFFSET(15262, glMultiTexCoord3iARB, glMultiTexCoord3iARB, NULL, _gloffset_MultiTexCoord3iARB), + NAME_FUNC_OFFSET(15280, glMultiTexCoord3ivARB, glMultiTexCoord3ivARB, NULL, _gloffset_MultiTexCoord3ivARB), + NAME_FUNC_OFFSET(15299, glMultiTexCoord3sARB, glMultiTexCoord3sARB, NULL, _gloffset_MultiTexCoord3sARB), + NAME_FUNC_OFFSET(15317, glMultiTexCoord3svARB, glMultiTexCoord3svARB, NULL, _gloffset_MultiTexCoord3svARB), + NAME_FUNC_OFFSET(15336, glMultiTexCoord4dARB, glMultiTexCoord4dARB, NULL, _gloffset_MultiTexCoord4dARB), + NAME_FUNC_OFFSET(15354, glMultiTexCoord4dvARB, glMultiTexCoord4dvARB, NULL, _gloffset_MultiTexCoord4dvARB), + NAME_FUNC_OFFSET(15373, glMultiTexCoord4fARB, glMultiTexCoord4fARB, NULL, _gloffset_MultiTexCoord4fARB), + NAME_FUNC_OFFSET(15391, glMultiTexCoord4fvARB, glMultiTexCoord4fvARB, NULL, _gloffset_MultiTexCoord4fvARB), + NAME_FUNC_OFFSET(15410, glMultiTexCoord4iARB, glMultiTexCoord4iARB, NULL, _gloffset_MultiTexCoord4iARB), + NAME_FUNC_OFFSET(15428, glMultiTexCoord4ivARB, glMultiTexCoord4ivARB, NULL, _gloffset_MultiTexCoord4ivARB), + NAME_FUNC_OFFSET(15447, glMultiTexCoord4sARB, glMultiTexCoord4sARB, NULL, _gloffset_MultiTexCoord4sARB), + NAME_FUNC_OFFSET(15465, glMultiTexCoord4svARB, glMultiTexCoord4svARB, NULL, _gloffset_MultiTexCoord4svARB), + NAME_FUNC_OFFSET(15484, glLoadTransposeMatrixdARB, glLoadTransposeMatrixdARB, NULL, _gloffset_LoadTransposeMatrixdARB), + NAME_FUNC_OFFSET(15507, glLoadTransposeMatrixfARB, glLoadTransposeMatrixfARB, NULL, _gloffset_LoadTransposeMatrixfARB), + NAME_FUNC_OFFSET(15530, glMultTransposeMatrixdARB, glMultTransposeMatrixdARB, NULL, _gloffset_MultTransposeMatrixdARB), + NAME_FUNC_OFFSET(15553, glMultTransposeMatrixfARB, glMultTransposeMatrixfARB, NULL, _gloffset_MultTransposeMatrixfARB), + NAME_FUNC_OFFSET(15576, glSampleCoverageARB, glSampleCoverageARB, NULL, _gloffset_SampleCoverageARB), + NAME_FUNC_OFFSET(15593, glCompressedTexImage1DARB, glCompressedTexImage1DARB, NULL, _gloffset_CompressedTexImage1DARB), + NAME_FUNC_OFFSET(15616, glCompressedTexImage2DARB, glCompressedTexImage2DARB, NULL, _gloffset_CompressedTexImage2DARB), + NAME_FUNC_OFFSET(15639, glCompressedTexImage3DARB, glCompressedTexImage3DARB, NULL, _gloffset_CompressedTexImage3DARB), + NAME_FUNC_OFFSET(15662, glCompressedTexSubImage1DARB, glCompressedTexSubImage1DARB, NULL, _gloffset_CompressedTexSubImage1DARB), + NAME_FUNC_OFFSET(15688, glCompressedTexSubImage2DARB, glCompressedTexSubImage2DARB, NULL, _gloffset_CompressedTexSubImage2DARB), + NAME_FUNC_OFFSET(15714, glCompressedTexSubImage3DARB, glCompressedTexSubImage3DARB, NULL, _gloffset_CompressedTexSubImage3DARB), + NAME_FUNC_OFFSET(15740, glGetCompressedTexImageARB, glGetCompressedTexImageARB, NULL, _gloffset_GetCompressedTexImageARB), + NAME_FUNC_OFFSET(15764, glDisableVertexAttribArrayARB, glDisableVertexAttribArrayARB, NULL, _gloffset_DisableVertexAttribArrayARB), + NAME_FUNC_OFFSET(15791, glEnableVertexAttribArrayARB, glEnableVertexAttribArrayARB, NULL, _gloffset_EnableVertexAttribArrayARB), + NAME_FUNC_OFFSET(15817, glGetVertexAttribdvARB, glGetVertexAttribdvARB, NULL, _gloffset_GetVertexAttribdvARB), + NAME_FUNC_OFFSET(15837, glGetVertexAttribfvARB, glGetVertexAttribfvARB, NULL, _gloffset_GetVertexAttribfvARB), + NAME_FUNC_OFFSET(15857, glGetVertexAttribivARB, glGetVertexAttribivARB, NULL, _gloffset_GetVertexAttribivARB), + NAME_FUNC_OFFSET(15877, glVertexAttrib1dARB, glVertexAttrib1dARB, NULL, _gloffset_VertexAttrib1dARB), + NAME_FUNC_OFFSET(15894, glVertexAttrib1dvARB, glVertexAttrib1dvARB, NULL, _gloffset_VertexAttrib1dvARB), + NAME_FUNC_OFFSET(15912, glVertexAttrib1fARB, glVertexAttrib1fARB, NULL, _gloffset_VertexAttrib1fARB), + NAME_FUNC_OFFSET(15929, glVertexAttrib1fvARB, glVertexAttrib1fvARB, NULL, _gloffset_VertexAttrib1fvARB), + NAME_FUNC_OFFSET(15947, glVertexAttrib1sARB, glVertexAttrib1sARB, NULL, _gloffset_VertexAttrib1sARB), + NAME_FUNC_OFFSET(15964, glVertexAttrib1svARB, glVertexAttrib1svARB, NULL, _gloffset_VertexAttrib1svARB), + NAME_FUNC_OFFSET(15982, glVertexAttrib2dARB, glVertexAttrib2dARB, NULL, _gloffset_VertexAttrib2dARB), + NAME_FUNC_OFFSET(15999, glVertexAttrib2dvARB, glVertexAttrib2dvARB, NULL, _gloffset_VertexAttrib2dvARB), + NAME_FUNC_OFFSET(16017, glVertexAttrib2fARB, glVertexAttrib2fARB, NULL, _gloffset_VertexAttrib2fARB), + NAME_FUNC_OFFSET(16034, glVertexAttrib2fvARB, glVertexAttrib2fvARB, NULL, _gloffset_VertexAttrib2fvARB), + NAME_FUNC_OFFSET(16052, glVertexAttrib2sARB, glVertexAttrib2sARB, NULL, _gloffset_VertexAttrib2sARB), + NAME_FUNC_OFFSET(16069, glVertexAttrib2svARB, glVertexAttrib2svARB, NULL, _gloffset_VertexAttrib2svARB), + NAME_FUNC_OFFSET(16087, glVertexAttrib3dARB, glVertexAttrib3dARB, NULL, _gloffset_VertexAttrib3dARB), + NAME_FUNC_OFFSET(16104, glVertexAttrib3dvARB, glVertexAttrib3dvARB, NULL, _gloffset_VertexAttrib3dvARB), + NAME_FUNC_OFFSET(16122, glVertexAttrib3fARB, glVertexAttrib3fARB, NULL, _gloffset_VertexAttrib3fARB), + NAME_FUNC_OFFSET(16139, glVertexAttrib3fvARB, glVertexAttrib3fvARB, NULL, _gloffset_VertexAttrib3fvARB), + NAME_FUNC_OFFSET(16157, glVertexAttrib3sARB, glVertexAttrib3sARB, NULL, _gloffset_VertexAttrib3sARB), + NAME_FUNC_OFFSET(16174, glVertexAttrib3svARB, glVertexAttrib3svARB, NULL, _gloffset_VertexAttrib3svARB), + NAME_FUNC_OFFSET(16192, glVertexAttrib4NbvARB, glVertexAttrib4NbvARB, NULL, _gloffset_VertexAttrib4NbvARB), + NAME_FUNC_OFFSET(16211, glVertexAttrib4NivARB, glVertexAttrib4NivARB, NULL, _gloffset_VertexAttrib4NivARB), + NAME_FUNC_OFFSET(16230, glVertexAttrib4NsvARB, glVertexAttrib4NsvARB, NULL, _gloffset_VertexAttrib4NsvARB), + NAME_FUNC_OFFSET(16249, glVertexAttrib4NubARB, glVertexAttrib4NubARB, NULL, _gloffset_VertexAttrib4NubARB), + NAME_FUNC_OFFSET(16268, glVertexAttrib4NubvARB, glVertexAttrib4NubvARB, NULL, _gloffset_VertexAttrib4NubvARB), + NAME_FUNC_OFFSET(16288, glVertexAttrib4NuivARB, glVertexAttrib4NuivARB, NULL, _gloffset_VertexAttrib4NuivARB), + NAME_FUNC_OFFSET(16308, glVertexAttrib4NusvARB, glVertexAttrib4NusvARB, NULL, _gloffset_VertexAttrib4NusvARB), + NAME_FUNC_OFFSET(16328, glVertexAttrib4dARB, glVertexAttrib4dARB, NULL, _gloffset_VertexAttrib4dARB), + NAME_FUNC_OFFSET(16345, glVertexAttrib4dvARB, glVertexAttrib4dvARB, NULL, _gloffset_VertexAttrib4dvARB), + NAME_FUNC_OFFSET(16363, glVertexAttrib4fARB, glVertexAttrib4fARB, NULL, _gloffset_VertexAttrib4fARB), + NAME_FUNC_OFFSET(16380, glVertexAttrib4fvARB, glVertexAttrib4fvARB, NULL, _gloffset_VertexAttrib4fvARB), + NAME_FUNC_OFFSET(16398, glVertexAttrib4sARB, glVertexAttrib4sARB, NULL, _gloffset_VertexAttrib4sARB), + NAME_FUNC_OFFSET(16415, glVertexAttrib4svARB, glVertexAttrib4svARB, NULL, _gloffset_VertexAttrib4svARB), + NAME_FUNC_OFFSET(16433, glVertexAttribPointerARB, glVertexAttribPointerARB, NULL, _gloffset_VertexAttribPointerARB), + NAME_FUNC_OFFSET(16455, glBindBufferARB, glBindBufferARB, NULL, _gloffset_BindBufferARB), + NAME_FUNC_OFFSET(16468, glBufferDataARB, glBufferDataARB, NULL, _gloffset_BufferDataARB), + NAME_FUNC_OFFSET(16481, glBufferSubDataARB, glBufferSubDataARB, NULL, _gloffset_BufferSubDataARB), + NAME_FUNC_OFFSET(16497, glDeleteBuffersARB, glDeleteBuffersARB, NULL, _gloffset_DeleteBuffersARB), + NAME_FUNC_OFFSET(16513, glGenBuffersARB, glGenBuffersARB, NULL, _gloffset_GenBuffersARB), + NAME_FUNC_OFFSET(16526, glGetBufferParameterivARB, glGetBufferParameterivARB, NULL, _gloffset_GetBufferParameterivARB), + NAME_FUNC_OFFSET(16549, glGetBufferPointervARB, glGetBufferPointervARB, NULL, _gloffset_GetBufferPointervARB), + NAME_FUNC_OFFSET(16569, glGetBufferSubDataARB, glGetBufferSubDataARB, NULL, _gloffset_GetBufferSubDataARB), + NAME_FUNC_OFFSET(16588, glIsBufferARB, glIsBufferARB, NULL, _gloffset_IsBufferARB), + NAME_FUNC_OFFSET(16599, glMapBufferARB, glMapBufferARB, NULL, _gloffset_MapBufferARB), + NAME_FUNC_OFFSET(16611, glUnmapBufferARB, glUnmapBufferARB, NULL, _gloffset_UnmapBufferARB), + NAME_FUNC_OFFSET(16625, glBeginQueryARB, glBeginQueryARB, NULL, _gloffset_BeginQueryARB), + NAME_FUNC_OFFSET(16638, glDeleteQueriesARB, glDeleteQueriesARB, NULL, _gloffset_DeleteQueriesARB), + NAME_FUNC_OFFSET(16654, glEndQueryARB, glEndQueryARB, NULL, _gloffset_EndQueryARB), + NAME_FUNC_OFFSET(16665, glGenQueriesARB, glGenQueriesARB, NULL, _gloffset_GenQueriesARB), + NAME_FUNC_OFFSET(16678, glGetQueryObjectivARB, glGetQueryObjectivARB, NULL, _gloffset_GetQueryObjectivARB), + NAME_FUNC_OFFSET(16697, glGetQueryObjectuivARB, glGetQueryObjectuivARB, NULL, _gloffset_GetQueryObjectuivARB), + NAME_FUNC_OFFSET(16717, glGetQueryivARB, glGetQueryivARB, NULL, _gloffset_GetQueryivARB), + NAME_FUNC_OFFSET(16730, glIsQueryARB, glIsQueryARB, NULL, _gloffset_IsQueryARB), + NAME_FUNC_OFFSET(16740, glCompileShaderARB, glCompileShaderARB, NULL, _gloffset_CompileShaderARB), + NAME_FUNC_OFFSET(16756, glGetActiveUniformARB, glGetActiveUniformARB, NULL, _gloffset_GetActiveUniformARB), + NAME_FUNC_OFFSET(16775, glGetShaderSourceARB, glGetShaderSourceARB, NULL, _gloffset_GetShaderSourceARB), + NAME_FUNC_OFFSET(16793, glGetUniformLocationARB, glGetUniformLocationARB, NULL, _gloffset_GetUniformLocationARB), + NAME_FUNC_OFFSET(16814, glGetUniformfvARB, glGetUniformfvARB, NULL, _gloffset_GetUniformfvARB), + NAME_FUNC_OFFSET(16829, glGetUniformivARB, glGetUniformivARB, NULL, _gloffset_GetUniformivARB), + NAME_FUNC_OFFSET(16844, glLinkProgramARB, glLinkProgramARB, NULL, _gloffset_LinkProgramARB), + NAME_FUNC_OFFSET(16858, glShaderSourceARB, glShaderSourceARB, NULL, _gloffset_ShaderSourceARB), + NAME_FUNC_OFFSET(16873, glUniform1fARB, glUniform1fARB, NULL, _gloffset_Uniform1fARB), + NAME_FUNC_OFFSET(16885, glUniform1fvARB, glUniform1fvARB, NULL, _gloffset_Uniform1fvARB), + NAME_FUNC_OFFSET(16898, glUniform1iARB, glUniform1iARB, NULL, _gloffset_Uniform1iARB), + NAME_FUNC_OFFSET(16910, glUniform1ivARB, glUniform1ivARB, NULL, _gloffset_Uniform1ivARB), + NAME_FUNC_OFFSET(16923, glUniform2fARB, glUniform2fARB, NULL, _gloffset_Uniform2fARB), + NAME_FUNC_OFFSET(16935, glUniform2fvARB, glUniform2fvARB, NULL, _gloffset_Uniform2fvARB), + NAME_FUNC_OFFSET(16948, glUniform2iARB, glUniform2iARB, NULL, _gloffset_Uniform2iARB), + NAME_FUNC_OFFSET(16960, glUniform2ivARB, glUniform2ivARB, NULL, _gloffset_Uniform2ivARB), + NAME_FUNC_OFFSET(16973, glUniform3fARB, glUniform3fARB, NULL, _gloffset_Uniform3fARB), + NAME_FUNC_OFFSET(16985, glUniform3fvARB, glUniform3fvARB, NULL, _gloffset_Uniform3fvARB), + NAME_FUNC_OFFSET(16998, glUniform3iARB, glUniform3iARB, NULL, _gloffset_Uniform3iARB), + NAME_FUNC_OFFSET(17010, glUniform3ivARB, glUniform3ivARB, NULL, _gloffset_Uniform3ivARB), + NAME_FUNC_OFFSET(17023, glUniform4fARB, glUniform4fARB, NULL, _gloffset_Uniform4fARB), + NAME_FUNC_OFFSET(17035, glUniform4fvARB, glUniform4fvARB, NULL, _gloffset_Uniform4fvARB), + NAME_FUNC_OFFSET(17048, glUniform4iARB, glUniform4iARB, NULL, _gloffset_Uniform4iARB), + NAME_FUNC_OFFSET(17060, glUniform4ivARB, glUniform4ivARB, NULL, _gloffset_Uniform4ivARB), + NAME_FUNC_OFFSET(17073, glUniformMatrix2fvARB, glUniformMatrix2fvARB, NULL, _gloffset_UniformMatrix2fvARB), + NAME_FUNC_OFFSET(17092, glUniformMatrix3fvARB, glUniformMatrix3fvARB, NULL, _gloffset_UniformMatrix3fvARB), + NAME_FUNC_OFFSET(17111, glUniformMatrix4fvARB, glUniformMatrix4fvARB, NULL, _gloffset_UniformMatrix4fvARB), + NAME_FUNC_OFFSET(17130, glUseProgramObjectARB, glUseProgramObjectARB, NULL, _gloffset_UseProgramObjectARB), + NAME_FUNC_OFFSET(17143, glValidateProgramARB, glValidateProgramARB, NULL, _gloffset_ValidateProgramARB), + NAME_FUNC_OFFSET(17161, glBindAttribLocationARB, glBindAttribLocationARB, NULL, _gloffset_BindAttribLocationARB), + NAME_FUNC_OFFSET(17182, glGetActiveAttribARB, glGetActiveAttribARB, NULL, _gloffset_GetActiveAttribARB), + NAME_FUNC_OFFSET(17200, glGetAttribLocationARB, glGetAttribLocationARB, NULL, _gloffset_GetAttribLocationARB), + NAME_FUNC_OFFSET(17220, glDrawBuffersARB, glDrawBuffersARB, NULL, _gloffset_DrawBuffersARB), + NAME_FUNC_OFFSET(17234, glDrawBuffersARB, glDrawBuffersARB, NULL, _gloffset_DrawBuffersARB), + NAME_FUNC_OFFSET(17251, gl_dispatch_stub_568, gl_dispatch_stub_568, NULL, _gloffset_SampleMaskSGIS), + NAME_FUNC_OFFSET(17267, gl_dispatch_stub_569, gl_dispatch_stub_569, NULL, _gloffset_SamplePatternSGIS), + NAME_FUNC_OFFSET(17286, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT), + NAME_FUNC_OFFSET(17304, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT), + NAME_FUNC_OFFSET(17325, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT), + NAME_FUNC_OFFSET(17347, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT), + NAME_FUNC_OFFSET(17366, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT), + NAME_FUNC_OFFSET(17388, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT), + NAME_FUNC_OFFSET(17411, glSecondaryColor3bEXT, glSecondaryColor3bEXT, NULL, _gloffset_SecondaryColor3bEXT), + NAME_FUNC_OFFSET(17430, glSecondaryColor3bvEXT, glSecondaryColor3bvEXT, NULL, _gloffset_SecondaryColor3bvEXT), + NAME_FUNC_OFFSET(17450, glSecondaryColor3dEXT, glSecondaryColor3dEXT, NULL, _gloffset_SecondaryColor3dEXT), + NAME_FUNC_OFFSET(17469, glSecondaryColor3dvEXT, glSecondaryColor3dvEXT, NULL, _gloffset_SecondaryColor3dvEXT), + NAME_FUNC_OFFSET(17489, glSecondaryColor3fEXT, glSecondaryColor3fEXT, NULL, _gloffset_SecondaryColor3fEXT), + NAME_FUNC_OFFSET(17508, glSecondaryColor3fvEXT, glSecondaryColor3fvEXT, NULL, _gloffset_SecondaryColor3fvEXT), + NAME_FUNC_OFFSET(17528, glSecondaryColor3iEXT, glSecondaryColor3iEXT, NULL, _gloffset_SecondaryColor3iEXT), + NAME_FUNC_OFFSET(17547, glSecondaryColor3ivEXT, glSecondaryColor3ivEXT, NULL, _gloffset_SecondaryColor3ivEXT), + NAME_FUNC_OFFSET(17567, glSecondaryColor3sEXT, glSecondaryColor3sEXT, NULL, _gloffset_SecondaryColor3sEXT), + NAME_FUNC_OFFSET(17586, glSecondaryColor3svEXT, glSecondaryColor3svEXT, NULL, _gloffset_SecondaryColor3svEXT), + NAME_FUNC_OFFSET(17606, glSecondaryColor3ubEXT, glSecondaryColor3ubEXT, NULL, _gloffset_SecondaryColor3ubEXT), + NAME_FUNC_OFFSET(17626, glSecondaryColor3ubvEXT, glSecondaryColor3ubvEXT, NULL, _gloffset_SecondaryColor3ubvEXT), + NAME_FUNC_OFFSET(17647, glSecondaryColor3uiEXT, glSecondaryColor3uiEXT, NULL, _gloffset_SecondaryColor3uiEXT), + NAME_FUNC_OFFSET(17667, glSecondaryColor3uivEXT, glSecondaryColor3uivEXT, NULL, _gloffset_SecondaryColor3uivEXT), + NAME_FUNC_OFFSET(17688, glSecondaryColor3usEXT, glSecondaryColor3usEXT, NULL, _gloffset_SecondaryColor3usEXT), + NAME_FUNC_OFFSET(17708, glSecondaryColor3usvEXT, glSecondaryColor3usvEXT, NULL, _gloffset_SecondaryColor3usvEXT), + NAME_FUNC_OFFSET(17729, glSecondaryColorPointerEXT, glSecondaryColorPointerEXT, NULL, _gloffset_SecondaryColorPointerEXT), + NAME_FUNC_OFFSET(17753, glMultiDrawArraysEXT, glMultiDrawArraysEXT, NULL, _gloffset_MultiDrawArraysEXT), + NAME_FUNC_OFFSET(17771, glMultiDrawElementsEXT, glMultiDrawElementsEXT, NULL, _gloffset_MultiDrawElementsEXT), + NAME_FUNC_OFFSET(17791, glFogCoordPointerEXT, glFogCoordPointerEXT, NULL, _gloffset_FogCoordPointerEXT), + NAME_FUNC_OFFSET(17809, glFogCoorddEXT, glFogCoorddEXT, NULL, _gloffset_FogCoorddEXT), + NAME_FUNC_OFFSET(17821, glFogCoorddvEXT, glFogCoorddvEXT, NULL, _gloffset_FogCoorddvEXT), + NAME_FUNC_OFFSET(17834, glFogCoordfEXT, glFogCoordfEXT, NULL, _gloffset_FogCoordfEXT), + NAME_FUNC_OFFSET(17846, glFogCoordfvEXT, glFogCoordfvEXT, NULL, _gloffset_FogCoordfvEXT), + NAME_FUNC_OFFSET(17859, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, _gloffset_BlendFuncSeparateEXT), + NAME_FUNC_OFFSET(17879, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, _gloffset_BlendFuncSeparateEXT), + NAME_FUNC_OFFSET(17903, glWindowPos2dMESA, glWindowPos2dMESA, NULL, _gloffset_WindowPos2dMESA), + NAME_FUNC_OFFSET(17917, glWindowPos2dMESA, glWindowPos2dMESA, NULL, _gloffset_WindowPos2dMESA), + NAME_FUNC_OFFSET(17934, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, _gloffset_WindowPos2dvMESA), + NAME_FUNC_OFFSET(17949, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, _gloffset_WindowPos2dvMESA), + NAME_FUNC_OFFSET(17967, glWindowPos2fMESA, glWindowPos2fMESA, NULL, _gloffset_WindowPos2fMESA), + NAME_FUNC_OFFSET(17981, glWindowPos2fMESA, glWindowPos2fMESA, NULL, _gloffset_WindowPos2fMESA), + NAME_FUNC_OFFSET(17998, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, _gloffset_WindowPos2fvMESA), + NAME_FUNC_OFFSET(18013, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, _gloffset_WindowPos2fvMESA), + NAME_FUNC_OFFSET(18031, glWindowPos2iMESA, glWindowPos2iMESA, NULL, _gloffset_WindowPos2iMESA), + NAME_FUNC_OFFSET(18045, glWindowPos2iMESA, glWindowPos2iMESA, NULL, _gloffset_WindowPos2iMESA), + NAME_FUNC_OFFSET(18062, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, _gloffset_WindowPos2ivMESA), + NAME_FUNC_OFFSET(18077, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, _gloffset_WindowPos2ivMESA), + NAME_FUNC_OFFSET(18095, glWindowPos2sMESA, glWindowPos2sMESA, NULL, _gloffset_WindowPos2sMESA), + NAME_FUNC_OFFSET(18109, glWindowPos2sMESA, glWindowPos2sMESA, NULL, _gloffset_WindowPos2sMESA), + NAME_FUNC_OFFSET(18126, glWindowPos2svMESA, glWindowPos2svMESA, NULL, _gloffset_WindowPos2svMESA), + NAME_FUNC_OFFSET(18141, glWindowPos2svMESA, glWindowPos2svMESA, NULL, _gloffset_WindowPos2svMESA), + NAME_FUNC_OFFSET(18159, glWindowPos3dMESA, glWindowPos3dMESA, NULL, _gloffset_WindowPos3dMESA), + NAME_FUNC_OFFSET(18173, glWindowPos3dMESA, glWindowPos3dMESA, NULL, _gloffset_WindowPos3dMESA), + NAME_FUNC_OFFSET(18190, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, _gloffset_WindowPos3dvMESA), + NAME_FUNC_OFFSET(18205, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, _gloffset_WindowPos3dvMESA), + NAME_FUNC_OFFSET(18223, glWindowPos3fMESA, glWindowPos3fMESA, NULL, _gloffset_WindowPos3fMESA), + NAME_FUNC_OFFSET(18237, glWindowPos3fMESA, glWindowPos3fMESA, NULL, _gloffset_WindowPos3fMESA), + NAME_FUNC_OFFSET(18254, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, _gloffset_WindowPos3fvMESA), + NAME_FUNC_OFFSET(18269, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, _gloffset_WindowPos3fvMESA), + NAME_FUNC_OFFSET(18287, glWindowPos3iMESA, glWindowPos3iMESA, NULL, _gloffset_WindowPos3iMESA), + NAME_FUNC_OFFSET(18301, glWindowPos3iMESA, glWindowPos3iMESA, NULL, _gloffset_WindowPos3iMESA), + NAME_FUNC_OFFSET(18318, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, _gloffset_WindowPos3ivMESA), + NAME_FUNC_OFFSET(18333, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, _gloffset_WindowPos3ivMESA), + NAME_FUNC_OFFSET(18351, glWindowPos3sMESA, glWindowPos3sMESA, NULL, _gloffset_WindowPos3sMESA), + NAME_FUNC_OFFSET(18365, glWindowPos3sMESA, glWindowPos3sMESA, NULL, _gloffset_WindowPos3sMESA), + NAME_FUNC_OFFSET(18382, glWindowPos3svMESA, glWindowPos3svMESA, NULL, _gloffset_WindowPos3svMESA), + NAME_FUNC_OFFSET(18397, glWindowPos3svMESA, glWindowPos3svMESA, NULL, _gloffset_WindowPos3svMESA), + NAME_FUNC_OFFSET(18415, glBindProgramNV, glBindProgramNV, NULL, _gloffset_BindProgramNV), + NAME_FUNC_OFFSET(18432, glDeleteProgramsNV, glDeleteProgramsNV, NULL, _gloffset_DeleteProgramsNV), + NAME_FUNC_OFFSET(18452, glGenProgramsNV, glGenProgramsNV, NULL, _gloffset_GenProgramsNV), + NAME_FUNC_OFFSET(18469, glGetVertexAttribPointervNV, glGetVertexAttribPointervNV, NULL, _gloffset_GetVertexAttribPointervNV), + NAME_FUNC_OFFSET(18498, glIsProgramNV, glIsProgramNV, NULL, _gloffset_IsProgramNV), + NAME_FUNC_OFFSET(18513, glPointParameteriNV, glPointParameteriNV, NULL, _gloffset_PointParameteriNV), + NAME_FUNC_OFFSET(18531, glPointParameterivNV, glPointParameterivNV, NULL, _gloffset_PointParameterivNV), + NAME_FUNC_OFFSET(18550, gl_dispatch_stub_749, gl_dispatch_stub_749, NULL, _gloffset_BlendEquationSeparateEXT), + NAME_FUNC_OFFSET(18574, gl_dispatch_stub_749, gl_dispatch_stub_749, NULL, _gloffset_BlendEquationSeparateEXT), + NAME_FUNC_OFFSET(-1, NULL, NULL, NULL, 0) }; #undef NAME_FUNC_OFFSET diff --git a/src/mesa/glapi/glthread.h b/src/mesa/glapi/glthread.h index 0958cd1b32c..a61086d0dc6 100644 --- a/src/mesa/glapi/glthread.h +++ b/src/mesa/glapi/glthread.h @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.5.1 + * Version: 6.5.2 * * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. * @@ -64,6 +64,12 @@ #define GLTHREAD_H +#if defined(USE_MGL_NAMESPACE) +#define _glapi_Dispatch _mglapi_Dispatch +#endif + + + #if (defined(PTHREADS) || defined(SOLARIS_THREADS) ||\ defined(WIN32_THREADS) || defined(USE_XTHREADS) || defined(BEOS_THREADS)) \ && !defined(THREADS) diff --git a/src/mesa/main/accum.c b/src/mesa/main/accum.c index a6e422640cf..2345695f3c6 100644 --- a/src/mesa/main/accum.c +++ b/src/mesa/main/accum.c @@ -94,11 +94,7 @@ _mesa_Accum( GLenum op, GLfloat value ) } if (ctx->RenderMode == GL_RENDER) { - GLint x = ctx->DrawBuffer->_Xmin; - GLint y = ctx->DrawBuffer->_Ymin; - GLint width = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin; - GLint height = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin; - ctx->Driver.Accum(ctx, op, value, x, y, width, height); + ctx->Driver.Accum(ctx, op, value); } } diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c index ef970ad9eb6..e22edc1bbcf 100644 --- a/src/mesa/main/attrib.c +++ b/src/mesa/main/attrib.c @@ -337,6 +337,8 @@ _mesa_PushAttrib(GLbitfield mask) if (mask & GL_TEXTURE_BIT) { struct gl_texture_attrib *attr; GLuint u; + + _mesa_lock_context_textures(ctx); /* Bump the texture object reference counts so that they don't * inadvertantly get deleted. */ @@ -362,6 +364,9 @@ _mesa_PushAttrib(GLbitfield mask) _mesa_copy_texture_object(&attr->Unit[u].SavedRect, attr->Unit[u].CurrentRect); } + + _mesa_unlock_context_textures(ctx); + newnode = new_attrib_node( GL_TEXTURE_BIT ); newnode->data = attr; newnode->next = head; diff --git a/src/mesa/main/blend.c b/src/mesa/main/blend.c index bf886af9e81..81bd4c2f320 100644 --- a/src/mesa/main/blend.c +++ b/src/mesa/main/blend.c @@ -516,6 +516,37 @@ _mesa_ColorMask( GLboolean red, GLboolean green, } +extern void GLAPIENTRY +_mesa_ClampColorARB(GLenum target, GLenum clamp) +{ + GET_CURRENT_CONTEXT(ctx); + + ASSERT_OUTSIDE_BEGIN_END(ctx); + + if (clamp != GL_TRUE && clamp != GL_FALSE && clamp != GL_FIXED_ONLY_ARB) { + _mesa_error(ctx, GL_INVALID_ENUM, "glClampColorARB(clamp)"); + return; + } + + switch (target) { + case GL_CLAMP_VERTEX_COLOR_ARB: + ctx->Light.ClampVertexColor = clamp; + break; + case GL_CLAMP_FRAGMENT_COLOR_ARB: + ctx->Color.ClampFragmentColor = clamp; + break; + case GL_CLAMP_READ_COLOR_ARB: + ctx->Color.ClampReadColor = clamp; + break; + default: + _mesa_error(ctx, GL_INVALID_ENUM, "glClampColorARB(target)"); + return; + } +} + + + + /**********************************************************************/ /** \name Initialization */ /*@{*/ diff --git a/src/mesa/main/blend.h b/src/mesa/main/blend.h index d6c03d903f4..5c0f2783a73 100644 --- a/src/mesa/main/blend.h +++ b/src/mesa/main/blend.h @@ -5,9 +5,9 @@ /* * Mesa 3-D graphics library - * Version: 3.5 + * Version: 6.5.2 * - * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2006 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"), @@ -72,6 +72,11 @@ extern void GLAPIENTRY _mesa_ColorMask( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha ); + +extern void GLAPIENTRY +_mesa_ClampColorARB(GLenum target, GLenum clamp); + + extern void _mesa_init_color( GLcontext * ctx ); diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c index adaf3ade078..3f9f7985465 100644 --- a/src/mesa/main/bufferobj.c +++ b/src/mesa/main/bufferobj.c @@ -296,7 +296,10 @@ _mesa_buffer_subdata( GLcontext *ctx, GLenum target, GLintptrARB offset, { (void) ctx; (void) target; - if (bufObj->Data && ((GLuint) (size + offset) <= bufObj->Size)) { + /* this should have been caught in _mesa_BufferSubData() */ + ASSERT((GLuint) (size + offset) <= bufObj->Size); + + if (bufObj->Data) { _mesa_memcpy( (GLubyte *) bufObj->Data + offset, data, size ); } } @@ -336,9 +339,9 @@ _mesa_buffer_get_subdata( GLcontext *ctx, GLenum target, GLintptrARB offset, /** * Fallback function called via ctx->Driver.MapBuffer(). * Hardware drivers that really implement buffer objects should never use - * function. + * this function. * - * The input parameters will have been already tested for errors. + * The function parameters will have been already tested for errors. * * \param ctx GL context. * \param target Buffer object target on which to operate. diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c index 6f4a51e1072..0e3ed155841 100644 --- a/src/mesa/main/buffers.c +++ b/src/mesa/main/buffers.c @@ -1,11 +1,6 @@ -/** - * \file buffers.c - * Frame buffer management. - */ - /* * Mesa 3-D graphics library - * Version: 6.5 + * Version: 6.5.2 * * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. * @@ -28,6 +23,13 @@ */ +/** + * \file buffers.c + * General framebuffer-related functions, like glClear, glScissor, etc. + */ + + + #include "glheader.h" #include "buffers.h" #include "colormac.h" @@ -139,10 +141,6 @@ _mesa_Clear( GLbitfield mask ) } if (ctx->RenderMode == GL_RENDER) { - const GLint x = ctx->DrawBuffer->_Xmin; - const GLint y = ctx->DrawBuffer->_Ymin; - const GLint height = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin; - const GLint width = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin; GLbitfield bufferMask; /* don't clear depth buffer if depth writing disabled */ @@ -175,8 +173,7 @@ _mesa_Clear( GLbitfield mask ) } ASSERT(ctx->Driver.Clear); - ctx->Driver.Clear( ctx, bufferMask, (GLboolean) !ctx->Scissor.Enabled, - x, y, width, height ); + ctx->Driver.Clear(ctx, bufferMask); } } @@ -581,6 +578,9 @@ _mesa_ReadBuffer(GLenum buffer) #if _HAVE_FULL_GL /** + * XXX THIS IS OBSOLETE - drivers should take care of detecting window + * size changes and act accordingly, likely calling _mesa_resize_framebuffer(). + * * GL_MESA_resize_buffers extension. * * When this function is called, we'll ask the window system how large @@ -591,16 +591,18 @@ _mesa_ReadBuffer(GLenum buffer) * \note This function should only be called through the GL API, not * from device drivers (as was done in the past). */ -void GLAPIENTRY -_mesa_ResizeBuffersMESA( void ) -{ - GET_CURRENT_CONTEXT(ctx); +void _mesa_resizebuffers( GLcontext *ctx ) +{ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH( ctx ); if (MESA_VERBOSE & VERBOSE_API) _mesa_debug(ctx, "glResizeBuffersMESA\n"); + if (!ctx->Driver.GetBufferSize) { + return; + } + if (ctx->WinSysDrawBuffer) { GLuint newWidth, newHeight; GLframebuffer *buffer = ctx->WinSysDrawBuffer; @@ -638,6 +640,19 @@ _mesa_ResizeBuffersMESA( void ) } +/* + * XXX THIS IS OBSOLETE + */ +void GLAPIENTRY +_mesa_ResizeBuffersMESA( void ) +{ + GET_CURRENT_CONTEXT(ctx); + + if (ctx->Extensions.MESA_resize_buffers) + _mesa_resizebuffers( ctx ); +} + + /* * XXX move somewhere else someday? */ diff --git a/src/mesa/main/buffers.h b/src/mesa/main/buffers.h index b61bdad4330..fcc21523421 100644 --- a/src/mesa/main/buffers.h +++ b/src/mesa/main/buffers.h @@ -78,4 +78,6 @@ extern void _mesa_set_scissor(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height); +extern void _mesa_resizebuffers( GLcontext *ctx ); + #endif diff --git a/src/mesa/main/colortab.c b/src/mesa/main/colortab.c index 8b6fc127fe9..e9349516eb8 100644 --- a/src/mesa/main/colortab.c +++ b/src/mesa/main/colortab.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.5 + * Version: 6.5.2 * - * Copyright (C) 1999-2005 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2006 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"), @@ -32,7 +32,7 @@ #include "state.h" -/* +/** * Given an internalFormat token passed to glColorTable, * return the corresponding base format. * Return -1 if invalid token. @@ -92,32 +92,14 @@ base_colortab_format( GLenum format ) -/* +/** * Examine table's format and set the component sizes accordingly. */ static void set_component_sizes( struct gl_color_table *table ) { - GLubyte sz; - - switch (table->Type) { - case GL_UNSIGNED_BYTE: - sz = 8 * sizeof(GLubyte); - break; - case GL_UNSIGNED_SHORT: - sz = 8 * sizeof(GLushort); - break; - case GL_FLOAT: - /* Don't actually return 32 here since that causes the conformance - * tests to blow up. Conform thinks the component is an integer, - * not a float. - */ - sz = 8; /** 8 * sizeof(GLfloat); **/ - break; - default: - _mesa_problem(NULL, "bad color table type in set_component_sizes 0x%x", table->Type); - return; - } + /* assuming the ubyte table */ + const GLubyte sz = 8; switch (table->_BaseFormat) { case GL_ALPHA: @@ -217,7 +199,7 @@ store_colortable_entries(GLcontext *ctx, struct gl_color_table *table, } - if (table->Type == GL_FLOAT) { + { /* convert user-provided data to GLfloat values */ GLfloat tempTab[MAX_COLOR_TABLE_SIZE * 4]; GLfloat *tableF; @@ -233,7 +215,7 @@ store_colortable_entries(GLcontext *ctx, struct gl_color_table *table, IMAGE_CLAMP_BIT); /* transfer ops */ /* the destination */ - tableF = (GLfloat *) table->Table; + tableF = table->TableF; /* Apply scale & bias & clamp now */ switch (table->_BaseFormat) { @@ -284,16 +266,16 @@ store_colortable_entries(GLcontext *ctx, struct gl_color_table *table, return; } } - else { - /* non-float (GLchan) */ + + /* update the ubyte table */ + { const GLint comps = _mesa_components_in_format(table->_BaseFormat); - GLchan *dest = (GLchan *) table->Table + start * comps; - _mesa_unpack_color_span_chan(ctx, count, /* number of entries */ - table->_BaseFormat, /* dest format */ - dest, /* dest address */ - format, type, data, /* src data */ - &ctx->Unpack, - 0); /* transfer ops */ + const GLfloat *tableF = table->TableF + start * comps; + GLubyte *tableUB = table->TableUB + start * comps; + GLint i; + for (i = 0; i < count * comps; i++) { + CLAMPED_FLOAT_TO_UBYTE(tableUB[i], tableF[i]); + } } if (ctx->Unpack.BufferObj->Name) { @@ -317,7 +299,6 @@ _mesa_ColorTable( GLenum target, GLenum internalFormat, GLint baseFormat; GLfloat rScale = 1.0, gScale = 1.0, bScale = 1.0, aScale = 1.0; GLfloat rBias = 0.0, gBias = 0.0, bBias = 0.0, aBias = 0.0; - GLenum tableType = CHAN_TYPE; GLint comps; ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); /* too complex */ @@ -367,11 +348,9 @@ _mesa_ColorTable( GLenum target, GLenum internalFormat, break; case GL_SHARED_TEXTURE_PALETTE_EXT: table = &ctx->Texture.Palette; - tableType = GL_FLOAT; break; case GL_COLOR_TABLE: table = &ctx->ColorTable; - tableType = GL_FLOAT; rScale = ctx->Pixel.ColorTableScale[0]; gScale = ctx->Pixel.ColorTableScale[1]; bScale = ctx->Pixel.ColorTableScale[2]; @@ -391,7 +370,6 @@ _mesa_ColorTable( GLenum target, GLenum internalFormat, return; } table = &(texUnit->ColorTable); - tableType = GL_FLOAT; rScale = ctx->Pixel.TextureColorTableScale[0]; gScale = ctx->Pixel.TextureColorTableScale[1]; bScale = ctx->Pixel.TextureColorTableScale[2]; @@ -407,12 +385,10 @@ _mesa_ColorTable( GLenum target, GLenum internalFormat, return; } table = &(texUnit->ProxyColorTable); - tableType = GL_FLOAT; proxy = GL_TRUE; break; case GL_POST_CONVOLUTION_COLOR_TABLE: table = &ctx->PostConvolutionColorTable; - tableType = GL_FLOAT; rScale = ctx->Pixel.PCCTscale[0]; gScale = ctx->Pixel.PCCTscale[1]; bScale = ctx->Pixel.PCCTscale[2]; @@ -424,12 +400,10 @@ _mesa_ColorTable( GLenum target, GLenum internalFormat, break; case GL_PROXY_POST_CONVOLUTION_COLOR_TABLE: table = &ctx->ProxyPostConvolutionColorTable; - tableType = GL_FLOAT; proxy = GL_TRUE; break; case GL_POST_COLOR_MATRIX_COLOR_TABLE: table = &ctx->PostColorMatrixColorTable; - tableType = GL_FLOAT; rScale = ctx->Pixel.PCMCTscale[0]; gScale = ctx->Pixel.PCMCTscale[1]; bScale = ctx->Pixel.PCMCTscale[2]; @@ -441,7 +415,6 @@ _mesa_ColorTable( GLenum target, GLenum internalFormat, break; case GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE: table = &ctx->ProxyPostColorMatrixColorTable; - tableType = GL_FLOAT; proxy = GL_TRUE; break; default: @@ -491,27 +464,18 @@ _mesa_ColorTable( GLenum target, GLenum internalFormat, table->Size = width; table->InternalFormat = internalFormat; table->_BaseFormat = (GLenum) baseFormat; - table->Type = (tableType == GL_FLOAT) ? GL_FLOAT : CHAN_TYPE; comps = _mesa_components_in_format(table->_BaseFormat); assert(comps > 0); /* error should have been caught sooner */ if (!proxy) { - /* free old table, if any */ - if (table->Table) { - FREE(table->Table); - table->Table = NULL; - } + _mesa_free_colortable_data(table); if (width > 0) { - if (table->Type == GL_FLOAT) { - table->Table = MALLOC(comps * width * sizeof(GLfloat)); - } - else { - table->Table = MALLOC(comps * width * sizeof(GLchan)); - } + table->TableF = _mesa_malloc(comps * width * sizeof(GLfloat)); + table->TableUB = _mesa_malloc(comps * width * sizeof(GLubyte)); - if (!table->Table) { + if (!table->TableF || !table->TableUB) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glColorTable"); return; } @@ -652,8 +616,8 @@ _mesa_ColorSubTable( GLenum target, GLsizei start, return; } - if (!table->Table) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glColorSubTable"); + if (!table->TableF || !table->TableUB) { + /* a GL_OUT_OF_MEMORY error would have been recorded previously */ return; } @@ -708,7 +672,7 @@ _mesa_GetColorTable( GLenum target, GLenum format, GET_CURRENT_CONTEXT(ctx); struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; struct gl_color_table *table = NULL; - GLchan rgba[MAX_COLOR_TABLE_SIZE][4]; + GLfloat rgba[MAX_COLOR_TABLE_SIZE][4]; ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); if (ctx->NewState) { @@ -759,177 +723,67 @@ _mesa_GetColorTable( GLenum target, GLenum format, ASSERT(table); switch (table->_BaseFormat) { - case GL_ALPHA: - if (table->Type == GL_FLOAT) { - const GLfloat *tableF = (const GLfloat *) table->Table; - GLuint i; - for (i = 0; i < table->Size; i++) { - rgba[i][RCOMP] = 0; - rgba[i][GCOMP] = 0; - rgba[i][BCOMP] = 0; -#if CHAN_BITS==32 - rgba[i][ACOMP] = tableF[i]; -#else - rgba[i][ACOMP] = IROUND_POS(tableF[i] * CHAN_MAXF); -#endif - } - } - else { - const GLchan *tableUB = (const GLchan *) table->Table; - GLuint i; - for (i = 0; i < table->Size; i++) { - rgba[i][RCOMP] = 0; - rgba[i][GCOMP] = 0; - rgba[i][BCOMP] = 0; - rgba[i][ACOMP] = tableUB[i]; - } - } - break; - case GL_LUMINANCE: - if (table->Type == GL_FLOAT) { - const GLfloat *tableF = (const GLfloat *) table->Table; - GLuint i; - for (i = 0; i < table->Size; i++) { -#if CHAN_BITS==32 - rgba[i][RCOMP] = - rgba[i][GCOMP] = - rgba[i][BCOMP] = tableF[i]; - rgba[i][ACOMP] = CHAN_MAX; -#else - rgba[i][RCOMP] = - rgba[i][GCOMP] = - rgba[i][BCOMP] = IROUND_POS(tableF[i] * CHAN_MAXF); - rgba[i][ACOMP] = CHAN_MAX; -#endif - } - } - else { - const GLchan *tableUB = (const GLchan *) table->Table; - GLuint i; - for (i = 0; i < table->Size; i++) { - rgba[i][RCOMP] = - rgba[i][GCOMP] = - rgba[i][BCOMP] = tableUB[i]; - rgba[i][ACOMP] = CHAN_MAX; - } - } - break; - case GL_LUMINANCE_ALPHA: - if (table->Type == GL_FLOAT) { - const GLfloat *tableF = (const GLfloat *) table->Table; - GLuint i; - for (i = 0; i < table->Size; i++) { -#if CHAN_BITS==32 - rgba[i][RCOMP] = - rgba[i][GCOMP] = - rgba[i][BCOMP] = tableF[i*2+0]; - rgba[i][ACOMP] = tableF[i*2+1]; -#else - rgba[i][RCOMP] = - rgba[i][GCOMP] = - rgba[i][BCOMP] = IROUND_POS(tableF[i*2+0] * CHAN_MAXF); - rgba[i][ACOMP] = IROUND_POS(tableF[i*2+1] * CHAN_MAXF); -#endif - } - } - else { - const GLchan *tableUB = (const GLchan *) table->Table; - GLuint i; - for (i = 0; i < table->Size; i++) { - rgba[i][RCOMP] = - rgba[i][GCOMP] = - rgba[i][BCOMP] = tableUB[i*2+0]; - rgba[i][ACOMP] = tableUB[i*2+1]; - } + case GL_ALPHA: + { + GLuint i; + for (i = 0; i < table->Size; i++) { + rgba[i][RCOMP] = 0; + rgba[i][GCOMP] = 0; + rgba[i][BCOMP] = 0; + rgba[i][ACOMP] = table->TableF[i]; } - break; - case GL_INTENSITY: - if (table->Type == GL_FLOAT) { - const GLfloat *tableF = (const GLfloat *) table->Table; - GLuint i; - for (i = 0; i < table->Size; i++) { -#if CHAN_BITS==32 - rgba[i][RCOMP] = - rgba[i][GCOMP] = - rgba[i][BCOMP] = - rgba[i][ACOMP] = tableF[i]; -#else - rgba[i][RCOMP] = - rgba[i][GCOMP] = - rgba[i][BCOMP] = - rgba[i][ACOMP] = IROUND_POS(tableF[i] * CHAN_MAXF); -#endif - } - } - else { - const GLchan *tableUB = (const GLchan *) table->Table; - GLuint i; - for (i = 0; i < table->Size; i++) { - rgba[i][RCOMP] = - rgba[i][GCOMP] = - rgba[i][BCOMP] = - rgba[i][ACOMP] = tableUB[i]; - } - } - break; - case GL_RGB: - if (table->Type == GL_FLOAT) { - const GLfloat *tableF = (const GLfloat *) table->Table; - GLuint i; - for (i = 0; i < table->Size; i++) { -#if CHAN_BITS==32 - rgba[i][RCOMP] = tableF[i*3+0]; - rgba[i][GCOMP] = tableF[i*3+1]; - rgba[i][BCOMP] = tableF[i*3+2]; - rgba[i][ACOMP] = CHAN_MAX; -#else - rgba[i][RCOMP] = IROUND_POS(tableF[i*3+0] * CHAN_MAXF); - rgba[i][GCOMP] = IROUND_POS(tableF[i*3+1] * CHAN_MAXF); - rgba[i][BCOMP] = IROUND_POS(tableF[i*3+2] * CHAN_MAXF); - rgba[i][ACOMP] = CHAN_MAX; -#endif - } + } + break; + case GL_LUMINANCE: + { + GLuint i; + for (i = 0; i < table->Size; i++) { + rgba[i][RCOMP] = + rgba[i][GCOMP] = + rgba[i][BCOMP] = table->TableF[i]; + rgba[i][ACOMP] = 1.0F; } - else { - const GLchan *tableUB = (const GLchan *) table->Table; - GLuint i; - for (i = 0; i < table->Size; i++) { - rgba[i][RCOMP] = tableUB[i*3+0]; - rgba[i][GCOMP] = tableUB[i*3+1]; - rgba[i][BCOMP] = tableUB[i*3+2]; - rgba[i][ACOMP] = CHAN_MAX; - } + } + break; + case GL_LUMINANCE_ALPHA: + { + GLuint i; + for (i = 0; i < table->Size; i++) { + rgba[i][RCOMP] = + rgba[i][GCOMP] = + rgba[i][BCOMP] = table->TableF[i*2+0]; + rgba[i][ACOMP] = table->TableF[i*2+1]; } - break; - case GL_RGBA: - if (table->Type == GL_FLOAT) { - const GLfloat *tableF = (const GLfloat *) table->Table; -#if CHAN_BITS==32 - _mesa_memcpy(rgba, tableF, 4 * table->Size * sizeof(GLfloat)); -#else - GLuint i; - for (i = 0; i < table->Size; i++) { - rgba[i][RCOMP] = IROUND_POS(tableF[i*4+0] * CHAN_MAXF); - rgba[i][GCOMP] = IROUND_POS(tableF[i*4+1] * CHAN_MAXF); - rgba[i][BCOMP] = IROUND_POS(tableF[i*4+2] * CHAN_MAXF); - rgba[i][ACOMP] = IROUND_POS(tableF[i*4+3] * CHAN_MAXF); - } -#endif + } + break; + case GL_INTENSITY: + { + GLuint i; + for (i = 0; i < table->Size; i++) { + rgba[i][RCOMP] = + rgba[i][GCOMP] = + rgba[i][BCOMP] = + rgba[i][ACOMP] = table->TableF[i]; } - else { - const GLchan *tableUB = (const GLchan *) table->Table; - GLuint i; - for (i = 0; i < table->Size; i++) { - rgba[i][RCOMP] = tableUB[i*4+0]; - rgba[i][GCOMP] = tableUB[i*4+1]; - rgba[i][BCOMP] = tableUB[i*4+2]; - rgba[i][ACOMP] = tableUB[i*4+3]; - } + } + break; + case GL_RGB: + { + GLuint i; + for (i = 0; i < table->Size; i++) { + rgba[i][RCOMP] = table->TableF[i*3+0]; + rgba[i][GCOMP] = table->TableF[i*3+1]; + rgba[i][BCOMP] = table->TableF[i*3+2]; + rgba[i][ACOMP] = 1.0F; } - break; - default: - _mesa_problem(ctx, "bad table format in glGetColorTable"); - return; + } + break; + case GL_RGBA: + _mesa_memcpy(rgba, table->TableF, 4 * table->Size * sizeof(GLfloat)); + break; + default: + _mesa_problem(ctx, "bad table format in glGetColorTable"); + return; } if (ctx->Pack.BufferObj->Name) { @@ -953,8 +807,8 @@ _mesa_GetColorTable( GLenum target, GLenum format, data = ADD_POINTERS(buf, data); } - _mesa_pack_rgba_span_chan(ctx, table->Size, (const GLchan (*)[4]) rgba, - format, type, data, &ctx->Pack, GL_FALSE); + _mesa_pack_rgba_span_float(ctx, table->Size, rgba, + format, type, data, &ctx->Pack, 0x0); if (ctx->Pack.BufferObj->Name) { ctx->Driver.UnmapBuffer(ctx, GL_PIXEL_PACK_BUFFER_EXT, @@ -1434,8 +1288,8 @@ _mesa_GetColorTableParameteriv( GLenum target, GLenum pname, GLint *params ) void _mesa_init_colortable( struct gl_color_table *p ) { - p->Type = CHAN_TYPE; - p->Table = NULL; + p->TableF = NULL; + p->TableUB = NULL; p->Size = 0; p->InternalFormat = GL_RGBA; } @@ -1445,9 +1299,13 @@ _mesa_init_colortable( struct gl_color_table *p ) void _mesa_free_colortable_data( struct gl_color_table *p ) { - if (p->Table) { - FREE(p->Table); - p->Table = NULL; + if (p->TableF) { + _mesa_free(p->TableF); + p->TableF = NULL; + } + if (p->TableUB) { + _mesa_free(p->TableUB); + p->TableUB = NULL; } } @@ -1455,7 +1313,8 @@ _mesa_free_colortable_data( struct gl_color_table *p ) /* * Initialize all colortables for a context. */ -void _mesa_init_colortables( GLcontext * ctx ) +void +_mesa_init_colortables( GLcontext * ctx ) { /* Color tables */ _mesa_init_colortable(&ctx->ColorTable); @@ -1470,7 +1329,8 @@ void _mesa_init_colortables( GLcontext * ctx ) /* * Free all colortable data for a context */ -void _mesa_free_colortables_data( GLcontext *ctx ) +void +_mesa_free_colortables_data( GLcontext *ctx ) { _mesa_free_colortable_data(&ctx->ColorTable); _mesa_free_colortable_data(&ctx->ProxyColorTable); diff --git a/src/mesa/main/colortab.h b/src/mesa/main/colortab.h index 4bd16210a0b..b6ff737a65f 100644 --- a/src/mesa/main/colortab.h +++ b/src/mesa/main/colortab.h @@ -1,18 +1,8 @@ -/** - * \file colortab.h - * Color tables. - * - * \if subset - * (No-op) - * - * \endif - */ - /* * Mesa 3-D graphics library - * Version: 3.5 + * Version: 6.5.2 * - * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2006 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"), diff --git a/src/mesa/main/config.h b/src/mesa/main/config.h index e2ba65ac63b..5a0481328ff 100644 --- a/src/mesa/main/config.h +++ b/src/mesa/main/config.h @@ -5,7 +5,7 @@ /* * Mesa 3-D graphics library - * Version: 6.5.1 + * Version: 6.5.2 * * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. * @@ -28,8 +28,8 @@ */ -#ifndef CONFIG_H -#define CONFIG_H +#ifndef MESA_CONFIG_H_INCLUDED +#define MESA_CONFIG_H_INCLUDED /** * \name OpenGL implementation limits @@ -323,4 +323,4 @@ #define MAX_CLIPPED_VERTICES ((2 * (6 + MAX_CLIP_PLANES))+1) -#endif /* CONFIG_H */ +#endif /* MESA_CONFIG_H_INCLUDED */ diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index afe6048c802..c8acc6b55ca 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -735,6 +735,10 @@ alloc_shared_state( GLcontext *ctx ) ss->DefaultCubeMap->RefCount += MAX_TEXTURE_IMAGE_UNITS; ss->DefaultRect->RefCount += MAX_TEXTURE_IMAGE_UNITS; + _glthread_INIT_MUTEX(ss->TexMutex); + ss->TextureStateStamp = 0; + + #if FEATURE_EXT_framebuffer_object ss->FrameBuffers = _mesa_NewHashTable(); if (!ss->FrameBuffers) @@ -1048,6 +1052,7 @@ _mesa_init_constants( GLcontext *ctx ) ctx->Const.VertexProgram.MaxLocalParams = MAX_PROGRAM_LOCAL_PARAMS; ctx->Const.VertexProgram.MaxEnvParams = MAX_NV_VERTEX_PROGRAM_PARAMS; ctx->Const.VertexProgram.MaxAddressRegs = MAX_VERTEX_PROGRAM_ADDRESS_REGS; + ctx->Const.VertexProgram.MaxUniformComponents = MAX_VERTEX_UNIFORM_COMPONENTS; init_natives(&ctx->Const.VertexProgram); #endif #if FEATURE_ARB_fragment_program @@ -1061,6 +1066,7 @@ _mesa_init_constants( GLcontext *ctx ) ctx->Const.FragmentProgram.MaxLocalParams = MAX_PROGRAM_LOCAL_PARAMS; ctx->Const.FragmentProgram.MaxEnvParams = MAX_NV_FRAGMENT_PROGRAM_PARAMS; ctx->Const.FragmentProgram.MaxAddressRegs = MAX_FRAGMENT_PROGRAM_ADDRESS_REGS; + ctx->Const.FragmentProgram.MaxUniformComponents = MAX_FRAGMENT_UNIFORM_COMPONENTS; init_natives(&ctx->Const.FragmentProgram); #endif ctx->Const.MaxProgramMatrices = MAX_PROGRAM_MATRICES; @@ -1087,6 +1093,11 @@ _mesa_init_constants( GLcontext *ctx ) ctx->Const.MaxRenderbufferSize = MAX_WIDTH; #endif +#if FEATURE_ARB_vertex_shader + ctx->Const.MaxVertexTextureImageUnits = MAX_VERTEX_TEXTURE_IMAGE_UNITS; + ctx->Const.MaxVaryingFloats = MAX_VARYING_FLOATS; +#endif + /* sanity checks */ ASSERT(ctx->Const.MaxTextureUnits == MIN2(ctx->Const.MaxTextureImageUnits, ctx->Const.MaxTextureCoordUnits)); @@ -1629,11 +1640,12 @@ static void initialize_framebuffer_size(GLcontext *ctx, GLframebuffer *fb) { GLuint width, height; - ASSERT(ctx->Driver.GetBufferSize); - ctx->Driver.GetBufferSize(fb, &width, &height); - if (ctx->Driver.ResizeBuffers) - ctx->Driver.ResizeBuffers(ctx, fb, width, height); - fb->Initialized = GL_TRUE; + if (ctx->Driver.GetBufferSize) { + ctx->Driver.GetBufferSize(fb, &width, &height); + if (ctx->Driver.ResizeBuffers) + ctx->Driver.ResizeBuffers(ctx, fb, width, height); + fb->Initialized = GL_TRUE; + } } @@ -1706,6 +1718,9 @@ _mesa_make_current( GLcontext *newCtx, GLframebuffer *drawBuffer, newCtx->NewState |= _NEW_BUFFERS; +#if 1 + /* We want to get rid of these lines: */ + #if _HAVE_FULL_GL if (!drawBuffer->Initialized) { initialize_framebuffer_size(newCtx, drawBuffer); @@ -1713,7 +1728,26 @@ _mesa_make_current( GLcontext *newCtx, GLframebuffer *drawBuffer, if (readBuffer != drawBuffer && !readBuffer->Initialized) { initialize_framebuffer_size(newCtx, readBuffer); } + + _mesa_resizebuffers(newCtx); +#endif + +#else + /* We want the drawBuffer and readBuffer to be initialized by + * the driver. + * This generally means the Width and Height match the actual + * window size and the renderbuffers (both hardware and software + * based) are allocated to match. The later can generally be + * done with a call to _mesa_resize_framebuffer(). + * + * It's theoretically possible for a buffer to have zero width + * or height, but for now, assert check that the driver did what's + * expected of it. + */ + ASSERT(drawBuffer->Width > 0); + ASSERT(drawBuffer->Height > 0); #endif + if (newCtx->FirstTimeCurrent) { /* set initial viewport and scissor size now */ _mesa_set_viewport(newCtx, 0, 0, diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h index c72fe8a56ac..e7e0fda72ea 100644 --- a/src/mesa/main/context.h +++ b/src/mesa/main/context.h @@ -317,4 +317,12 @@ do { \ ) +/** + * Is RGBA LogicOp enabled? + */ +#define RGBA_LOGICOP_ENABLED(CTX) \ + ((CTX)->Color.ColorLogicOpEnabled || \ + ((CTX)->Color.BlendEnabled && (CTX)->Color.BlendEquationRGB == GL_LOGIC_OP)) + + #endif /* CONTEXT_H */ diff --git a/src/mesa/main/convolve.c b/src/mesa/main/convolve.c index 6b97c7f56cd..814c6a0a5a6 100644 --- a/src/mesa/main/convolve.c +++ b/src/mesa/main/convolve.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.3 + * Version: 6.5.2 * - * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2006 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"), @@ -560,9 +560,10 @@ _mesa_CopyConvolutionFilter2D(GLenum target, GLenum internalFormat, GLint x, GLi void GLAPIENTRY -_mesa_GetConvolutionFilter(GLenum target, GLenum format, GLenum type, GLvoid *image) +_mesa_GetConvolutionFilter(GLenum target, GLenum format, GLenum type, + GLvoid *image) { - const struct gl_convolution_attrib *filter; + struct gl_convolution_attrib *filter; GLuint row; GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); @@ -623,10 +624,9 @@ _mesa_GetConvolutionFilter(GLenum target, GLenum format, GLenum type, GLvoid *im GLvoid *dst = _mesa_image_address2d(&ctx->Pack, image, filter->Width, filter->Height, format, type, row, 0); - const GLfloat *src = filter->Filter + row * filter->Width * 4; - _mesa_pack_rgba_span_float(ctx, filter->Width, - (const GLfloat (*)[4]) src, - format, type, dst, &ctx->Pack, 0); + GLfloat (*src)[4] = (GLfloat (*)[4]) (filter->Filter + row * filter->Width * 4); + _mesa_pack_rgba_span_float(ctx, filter->Width, src, + format, type, dst, &ctx->Pack, 0x0); } if (ctx->Pack.BufferObj->Name) { @@ -768,10 +768,11 @@ _mesa_GetConvolutionParameteriv(GLenum target, GLenum pname, GLint *params) void GLAPIENTRY -_mesa_GetSeparableFilter(GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span) +_mesa_GetSeparableFilter(GLenum target, GLenum format, GLenum type, + GLvoid *row, GLvoid *column, GLvoid *span) { const GLint colStart = MAX_CONVOLUTION_WIDTH * 4; - const struct gl_convolution_attrib *filter; + struct gl_convolution_attrib *filter; GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); @@ -785,7 +786,8 @@ _mesa_GetSeparableFilter(GLenum target, GLenum format, GLenum type, GLvoid *row, } if (!_mesa_is_legal_format_and_type(ctx, format, type)) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glGetConvolutionFilter(format or type)"); + _mesa_error(ctx, GL_INVALID_OPERATION, + "glGetConvolutionFilter(format or type)"); return; } @@ -833,18 +835,17 @@ _mesa_GetSeparableFilter(GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *dst = _mesa_image_address1d(&ctx->Pack, row, filter->Width, format, type, 0); _mesa_pack_rgba_span_float(ctx, filter->Width, - (const GLfloat (*)[4]) filter->Filter, - format, type, dst, &ctx->Pack, 0); + (GLfloat (*)[4]) filter->Filter, + format, type, dst, &ctx->Pack, 0x0); } /* Column filter */ if (column) { GLvoid *dst = _mesa_image_address1d(&ctx->Pack, column, filter->Height, format, type, 0); - const GLfloat *src = filter->Filter + colStart; - _mesa_pack_rgba_span_float(ctx, filter->Height, - (const GLfloat (*)[4]) src, - format, type, dst, &ctx->Pack, 0); + GLfloat (*src)[4] = (GLfloat (*)[4]) (filter->Filter + colStart); + _mesa_pack_rgba_span_float(ctx, filter->Height, src, + format, type, dst, &ctx->Pack, 0x0); } (void) span; /* unused at this time */ diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h index 1b8cf6304e5..1de2542bee2 100644 --- a/src/mesa/main/dd.h +++ b/src/mesa/main/dd.h @@ -5,9 +5,9 @@ /* * Mesa 3-D graphics library - * Version: 6.5 + * Version: 6.5.2 * - * Copyright (C) 1999-2005 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2006 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"), @@ -52,8 +52,7 @@ struct mesa_display_list; struct dd_function_table { /** * Return a string as needed by glGetString(). - * - * Only the GL_RENDERER token must be implemented. Otherwise, NULL can be + * Only the GL_RENDERER query must be implemented. Otherwise, NULL can be * returned. */ const GLubyte * (*GetString)( GLcontext *ctx, GLenum name ); @@ -70,19 +69,20 @@ struct dd_function_table { * Get the width and height of the named buffer/window. * * Mesa uses this to determine when the driver's window size has changed. + * XXX OBSOLETE: this function will be removed in the future. */ void (*GetBufferSize)( GLframebuffer *buffer, GLuint *width, GLuint *height ); /** * Resize the given framebuffer to the given size. + * XXX OBSOLETE: this function will be removed in the future. */ void (*ResizeBuffers)( GLcontext *ctx, GLframebuffer *fb, GLuint width, GLuint height); /** * Called whenever an error is generated. - * * __GLcontextRec::ErrorValue contains the error value. */ void (*Error)( GLcontext *ctx ); @@ -99,40 +99,24 @@ struct dd_function_table { /** * Clear the color/depth/stencil/accum buffer(s). - * - * \param mask a bitmask of the DD_*_BIT values defined above that indicates - * which buffers need to be cleared. - * \param all if true then clear the whole buffer, else clear only the - * region defined by (x, y, width, height). - * - * This function must obey the glColorMask(), glIndexMask() and - * glStencilMask() settings! - * Software Mesa can do masked clears if the device driver can't. + * \param buffers a bitmask of BUFFER_BIT_* flags indicating which + * renderbuffers need to be cleared. */ - void (*Clear)( GLcontext *ctx, GLbitfield mask, GLboolean all, - GLint x, GLint y, GLint width, GLint height ); + void (*Clear)( GLcontext *ctx, GLbitfield buffers ); - - /** - * \name For hardware accumulation buffer - */ - /*@{*/ /** - * Execute glAccum command within the given scissor region. + * Execute glAccum command. */ - void (*Accum)( GLcontext *ctx, GLenum op, GLfloat value, - GLint xpos, GLint ypos, GLint width, GLint height ); - /*@}*/ + void (*Accum)( GLcontext *ctx, GLenum op, GLfloat value ); /** - * \name glDraw(), glRead(), glCopyPixels() and glBitmap() functions + * \name Image-related functions */ /*@{*/ /** - * This is called by glDrawPixels(). - * + * Called by glDrawPixels(). * \p unpack describes how to unpack the source image data. */ void (*DrawPixels)( GLcontext *ctx, @@ -151,19 +135,14 @@ struct dd_function_table { GLvoid *dest ); /** - * Do a glCopyPixels(). - * - * This function must respect all rasterization state, glPixelTransfer(), - * glPixelZoom(), etc. + * Called by glCopyPixels(). */ void (*CopyPixels)( GLcontext *ctx, GLint srcx, GLint srcy, GLsizei width, GLsizei height, GLint dstx, GLint dsty, GLenum type ); /** - * This is called by glBitmap(). - * - * Works the same as dd_function_table::DrawPixels, above. + * Called by glBitmap(). */ void (*Bitmap)( GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, @@ -591,8 +570,9 @@ struct dd_function_table { /** Notify driver that a program string has been specified. */ void (*ProgramStringNotify)(GLcontext *ctx, GLenum target, struct gl_program *prog); - - + /** Get value of a fragment program register during program execution. */ + void (*GetFragmentProgramRegister)(GLcontext *ctx, enum register_file file, + GLuint index, GLfloat val[4]); /** Query if program can be loaded onto hardware */ GLboolean (*IsProgramNative)(GLcontext *ctx, GLenum target, diff --git a/src/mesa/main/descrip.mms b/src/mesa/main/descrip.mms index 5790e6b796c..d09c57b3212 100644 --- a/src/mesa/main/descrip.mms +++ b/src/mesa/main/descrip.mms @@ -56,6 +56,7 @@ SOURCES =accum.c \ light.c \ lines.c \ matrix.c \ + mipmap.c \ mm.c \ occlude.c \ pixel.c \ @@ -118,6 +119,7 @@ imports.obj,\ light.obj,\ lines.obj,\ matrix.obj,\ +mipmap.obj,\ mm.obj,\ occlude.obj,\ pixel.obj,\ @@ -193,6 +195,7 @@ imports.obj : imports.c vsnprintf.c light.obj : light.c lines.obj : lines.c matrix.obj : matrix.c +mipmap.obj : mipmap.c mm.obj : mm.c occlude.obj : occlude.c pixel.obj : pixel.c diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index 8be01cfb7dc..dca6ede6cb3 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -7869,7 +7869,6 @@ _mesa_init_dlist_table(struct _glapi_table *table) /* GL 1.1 */ SET_AreTexturesResident(table, exec_AreTexturesResident); - SET_AreTexturesResidentEXT(table, exec_AreTexturesResident); SET_BindTexture(table, save_BindTexture); SET_ColorPointer(table, exec_ColorPointer); SET_CopyTexImage1D(table, save_CopyTexImage1D); @@ -7881,12 +7880,10 @@ _mesa_init_dlist_table(struct _glapi_table *table) SET_EdgeFlagPointer(table, exec_EdgeFlagPointer); SET_EnableClientState(table, exec_EnableClientState); SET_GenTextures(table, exec_GenTextures); - SET_GenTexturesEXT(table, exec_GenTextures); SET_GetPointerv(table, exec_GetPointerv); SET_IndexPointer(table, exec_IndexPointer); SET_InterleavedArrays(table, exec_InterleavedArrays); SET_IsTexture(table, exec_IsTexture); - SET_IsTextureEXT(table, exec_IsTexture); SET_NormalPointer(table, exec_NormalPointer); SET_PopClientAttrib(table, exec_PopClientAttrib); SET_PrioritizeTextures(table, save_PrioritizeTextures); @@ -7925,31 +7922,18 @@ _mesa_init_dlist_table(struct _glapi_table *table) SET_CopyConvolutionFilter1D(table, exec_CopyConvolutionFilter1D); SET_CopyConvolutionFilter2D(table, exec_CopyConvolutionFilter2D); SET_GetColorTable(table, exec_GetColorTable); - SET_GetColorTableSGI(table, exec_GetColorTable); SET_GetColorTableParameterfv(table, exec_GetColorTableParameterfv); - SET_GetColorTableParameterfvSGI(table, exec_GetColorTableParameterfv); SET_GetColorTableParameteriv(table, exec_GetColorTableParameteriv); - SET_GetColorTableParameterivSGI(table, exec_GetColorTableParameteriv); SET_GetConvolutionFilter(table, exec_GetConvolutionFilter); - SET_GetConvolutionFilterEXT(table, exec_GetConvolutionFilter); SET_GetConvolutionParameterfv(table, exec_GetConvolutionParameterfv); - SET_GetConvolutionParameterfvEXT(table, exec_GetConvolutionParameterfv); SET_GetConvolutionParameteriv(table, exec_GetConvolutionParameteriv); - SET_GetConvolutionParameterivEXT(table, exec_GetConvolutionParameteriv); SET_GetHistogram(table, exec_GetHistogram); - SET_GetHistogramEXT(table, exec_GetHistogram); SET_GetHistogramParameterfv(table, exec_GetHistogramParameterfv); - SET_GetHistogramParameterfvEXT(table, exec_GetHistogramParameterfv); SET_GetHistogramParameteriv(table, exec_GetHistogramParameteriv); - SET_GetHistogramParameterivEXT(table, exec_GetHistogramParameteriv); SET_GetMinmax(table, exec_GetMinmax); - SET_GetMinmaxEXT(table, exec_GetMinmax); SET_GetMinmaxParameterfv(table, exec_GetMinmaxParameterfv); - SET_GetMinmaxParameterfvEXT(table, exec_GetMinmaxParameterfv); SET_GetMinmaxParameteriv(table, exec_GetMinmaxParameteriv); - SET_GetMinmaxParameterivEXT(table, exec_GetMinmaxParameteriv); SET_GetSeparableFilter(table, exec_GetSeparableFilter); - SET_GetSeparableFilterEXT(table, exec_GetSeparableFilter); SET_Histogram(table, save_Histogram); SET_Minmax(table, save_Minmax); SET_ResetHistogram(table, save_ResetHistogram); @@ -7975,10 +7959,10 @@ _mesa_init_dlist_table(struct _glapi_table *table) #if 0 SET_ColorTableSGI(table, save_ColorTable); SET_ColorSubTableSGI(table, save_ColorSubTable); -#endif SET_GetColorTableSGI(table, exec_GetColorTable); SET_GetColorTableParameterfvSGI(table, exec_GetColorTableParameterfv); SET_GetColorTableParameterivSGI(table, exec_GetColorTableParameteriv); +#endif /* 30. GL_EXT_vertex_array */ SET_ColorPointerEXT(table, exec_ColorPointerEXT); @@ -8068,7 +8052,7 @@ _mesa_init_dlist_table(struct _glapi_table *table) SET_GetVertexAttribfvNV(table, _mesa_GetVertexAttribfvNV); SET_GetVertexAttribivNV(table, _mesa_GetVertexAttribivNV); SET_GetVertexAttribPointervNV(table, _mesa_GetVertexAttribPointervNV); - SET_IsProgramNV(table, _mesa_IsProgram); + SET_IsProgramNV(table, _mesa_IsProgramARB); SET_LoadProgramNV(table, save_LoadProgramNV); SET_ProgramParameter4dNV(table, save_ProgramParameter4dNV); SET_ProgramParameter4dvNV(table, save_ProgramParameter4dvNV); @@ -8161,7 +8145,7 @@ _mesa_init_dlist_table(struct _glapi_table *table) SET_BindProgramNV(table, save_BindProgramNV); SET_DeleteProgramsNV(table, _mesa_DeletePrograms); SET_GenProgramsNV(table, _mesa_GenPrograms); - SET_IsProgramNV(table, _mesa_IsProgram); + SET_IsProgramNV(table, _mesa_IsProgramARB); SET_GetVertexAttribdvNV(table, _mesa_GetVertexAttribdvNV); SET_GetVertexAttribfvNV(table, _mesa_GetVertexAttribfvNV); SET_GetVertexAttribivNV(table, _mesa_GetVertexAttribivNV); diff --git a/src/mesa/main/enums.c b/src/mesa/main/enums.c index b569d6ad6f6..d864cd22aa4 100644 --- a/src/mesa/main/enums.c +++ b/src/mesa/main/enums.c @@ -50,9 +50,13 @@ static const char enum_string_table[] = "GL_ACCUM_CLEAR_VALUE\0" "GL_ACCUM_GREEN_BITS\0" "GL_ACCUM_RED_BITS\0" + "GL_ACTIVE_ATTRIBUTES\0" + "GL_ACTIVE_ATTRIBUTE_MAX_LENGTH\0" "GL_ACTIVE_STENCIL_FACE_EXT\0" "GL_ACTIVE_TEXTURE\0" "GL_ACTIVE_TEXTURE_ARB\0" + "GL_ACTIVE_UNIFORMS\0" + "GL_ACTIVE_UNIFORM_MAX_LENGTH\0" "GL_ACTIVE_VERTEX_UNITS_ARB\0" "GL_ADD\0" "GL_ADD_SIGNED\0" @@ -87,6 +91,7 @@ static const char enum_string_table[] = "GL_ARRAY_BUFFER_ARB\0" "GL_ARRAY_BUFFER_BINDING\0" "GL_ARRAY_BUFFER_BINDING_ARB\0" + "GL_ATTACHED_SHADERS\0" "GL_ATTRIB_ARRAY_POINTER_NV\0" "GL_ATTRIB_ARRAY_SIZE_NV\0" "GL_ATTRIB_ARRAY_STRIDE_NV\0" @@ -112,6 +117,7 @@ static const char enum_string_table[] = "GL_BLEND_DST_ALPHA\0" "GL_BLEND_DST_RGB\0" "GL_BLEND_EQUATION\0" + "GL_BLEND_EQUATION_ALPHA\0" "GL_BLEND_EQUATION_ALPHA_EXT\0" "GL_BLEND_EQUATION_EXT\0" "GL_BLEND_EQUATION_RGB_EXT\0" @@ -122,9 +128,13 @@ static const char enum_string_table[] = "GL_BLUE_BIAS\0" "GL_BLUE_BITS\0" "GL_BLUE_SCALE\0" + "GL_BOOL\0" "GL_BOOL_ARB\0" + "GL_BOOL_VEC2\0" "GL_BOOL_VEC2_ARB\0" + "GL_BOOL_VEC3\0" "GL_BOOL_VEC3_ARB\0" + "GL_BOOL_VEC4\0" "GL_BOOL_VEC4_ARB\0" "GL_BUFFER_ACCESS\0" "GL_BUFFER_ACCESS_ARB\0" @@ -245,6 +255,7 @@ static const char enum_string_table[] = "GL_COMPARE_R_TO_TEXTURE_ARB\0" "GL_COMPILE\0" "GL_COMPILE_AND_EXECUTE\0" + "GL_COMPILE_STATUS\0" "GL_COMPRESSED_ALPHA\0" "GL_COMPRESSED_ALPHA_ARB\0" "GL_COMPRESSED_INTENSITY\0" @@ -289,6 +300,7 @@ static const char enum_string_table[] = "GL_CONVOLUTION_HEIGHT_EXT\0" "GL_CONVOLUTION_WIDTH\0" "GL_CONVOLUTION_WIDTH_EXT\0" + "GL_COORD_REPLACE\0" "GL_COORD_REPLACE_ARB\0" "GL_COORD_REPLACE_NV\0" "GL_COPY\0" @@ -312,6 +324,7 @@ static const char enum_string_table[] = "GL_CURRENT_MATRIX_STACK_DEPTH_NV\0" "GL_CURRENT_NORMAL\0" "GL_CURRENT_PALETTE_MATRIX_ARB\0" + "GL_CURRENT_PROGRAM\0" "GL_CURRENT_QUERY\0" "GL_CURRENT_QUERY_ARB\0" "GL_CURRENT_RASTER_COLOR\0" @@ -322,6 +335,7 @@ static const char enum_string_table[] = "GL_CURRENT_RASTER_TEXTURE_COORDS\0" "GL_CURRENT_SECONDARY_COLOR\0" "GL_CURRENT_TEXTURE_COORDS\0" + "GL_CURRENT_VERTEX_ATTRIB\0" "GL_CURRENT_VERTEX_ATTRIB_ARB\0" "GL_CURRENT_WEIGHT_ARB\0" "GL_CW\0" @@ -332,6 +346,7 @@ static const char enum_string_table[] = "GL_DECR\0" "GL_DECR_WRAP\0" "GL_DECR_WRAP_EXT\0" + "GL_DELETE_STATUS\0" "GL_DEPTH\0" "GL_DEPTH_ATTACHMENT_EXT\0" "GL_DEPTH_BIAS\0" @@ -374,36 +389,52 @@ static const char enum_string_table[] = "GL_DOUBLE\0" "GL_DOUBLEBUFFER\0" "GL_DRAW_BUFFER\0" + "GL_DRAW_BUFFER0\0" "GL_DRAW_BUFFER0_ARB\0" "GL_DRAW_BUFFER0_ATI\0" + "GL_DRAW_BUFFER1\0" + "GL_DRAW_BUFFER10\0" "GL_DRAW_BUFFER10_ARB\0" "GL_DRAW_BUFFER10_ATI\0" + "GL_DRAW_BUFFER11\0" "GL_DRAW_BUFFER11_ARB\0" "GL_DRAW_BUFFER11_ATI\0" + "GL_DRAW_BUFFER12\0" "GL_DRAW_BUFFER12_ARB\0" "GL_DRAW_BUFFER12_ATI\0" + "GL_DRAW_BUFFER13\0" "GL_DRAW_BUFFER13_ARB\0" "GL_DRAW_BUFFER13_ATI\0" + "GL_DRAW_BUFFER14\0" "GL_DRAW_BUFFER14_ARB\0" "GL_DRAW_BUFFER14_ATI\0" + "GL_DRAW_BUFFER15\0" "GL_DRAW_BUFFER15_ARB\0" "GL_DRAW_BUFFER15_ATI\0" "GL_DRAW_BUFFER1_ARB\0" "GL_DRAW_BUFFER1_ATI\0" + "GL_DRAW_BUFFER2\0" "GL_DRAW_BUFFER2_ARB\0" "GL_DRAW_BUFFER2_ATI\0" + "GL_DRAW_BUFFER3\0" "GL_DRAW_BUFFER3_ARB\0" "GL_DRAW_BUFFER3_ATI\0" + "GL_DRAW_BUFFER4\0" "GL_DRAW_BUFFER4_ARB\0" "GL_DRAW_BUFFER4_ATI\0" + "GL_DRAW_BUFFER5\0" "GL_DRAW_BUFFER5_ARB\0" "GL_DRAW_BUFFER5_ATI\0" + "GL_DRAW_BUFFER6\0" "GL_DRAW_BUFFER6_ARB\0" "GL_DRAW_BUFFER6_ATI\0" + "GL_DRAW_BUFFER7\0" "GL_DRAW_BUFFER7_ARB\0" "GL_DRAW_BUFFER7_ATI\0" + "GL_DRAW_BUFFER8\0" "GL_DRAW_BUFFER8_ARB\0" "GL_DRAW_BUFFER8_ATI\0" + "GL_DRAW_BUFFER9\0" "GL_DRAW_BUFFER9_ARB\0" "GL_DRAW_BUFFER9_ATI\0" "GL_DRAW_FRAMEBUFFER_BINDING_EXT\0" @@ -448,11 +479,17 @@ static const char enum_string_table[] = "GL_FILL\0" "GL_FLAT\0" "GL_FLOAT\0" + "GL_FLOAT_MAT2\0" "GL_FLOAT_MAT2_ARB\0" + "GL_FLOAT_MAT3\0" "GL_FLOAT_MAT3_ARB\0" + "GL_FLOAT_MAT4\0" "GL_FLOAT_MAT4_ARB\0" + "GL_FLOAT_VEC2\0" "GL_FLOAT_VEC2_ARB\0" + "GL_FLOAT_VEC3\0" "GL_FLOAT_VEC3_ARB\0" + "GL_FLOAT_VEC4\0" "GL_FLOAT_VEC4_ARB\0" "GL_FOG\0" "GL_FOG_BIT\0" @@ -483,7 +520,9 @@ static const char enum_string_table[] = "GL_FOG_START\0" "GL_FRAGMENT_DEPTH\0" "GL_FRAGMENT_PROGRAM_ARB\0" + "GL_FRAGMENT_SHADER\0" "GL_FRAGMENT_SHADER_ARB\0" + "GL_FRAGMENT_SHADER_DERIVATIVE_HINT\0" "GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT\0" "GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT\0" "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT\0" @@ -517,6 +556,30 @@ static const char enum_string_table[] = "GL_GENERATE_MIPMAP_HINT_SGIS\0" "GL_GENERATE_MIPMAP_SGIS\0" "GL_GEQUAL\0" + "GL_GL_BLEND_EQUATION_RGB\0" + "GL_GL_COMPRESSED_SLUMINANCE\0" + "GL_GL_COMPRESSED_SLUMINANCE_ALPHA\0" + "GL_GL_COMPRESSED_SRGB\0" + "GL_GL_COMPRESSED_SRGB_ALPHA\0" + "GL_GL_CURRENT_RASTER_SECONDARY_COLOR\0" + "GL_GL_FLOAT_MAT2x3\0" + "GL_GL_FLOAT_MAT2x4\0" + "GL_GL_FLOAT_MAT3x2\0" + "GL_GL_FLOAT_MAT3x4\0" + "GL_GL_FLOAT_MAT4x2\0" + "GL_GL_FLOAT_MAT4x3\0" + "GL_GL_PIXEL_PACK_BUFFER\0" + "GL_GL_PIXEL_PACK_BUFFER_BINDING\0" + "GL_GL_PIXEL_UNPACK_BUFFER\0" + "GL_GL_PIXEL_UNPACK_BUFFER_BINDING\0" + "GL_GL_SLUMINANCE\0" + "GL_GL_SLUMINANCE8\0" + "GL_GL_SLUMINANCE8_ALPHA8\0" + "GL_GL_SLUMINANCE_ALPHA\0" + "GL_GL_SRGB\0" + "GL_GL_SRGB8\0" + "GL_GL_SRGB8_ALPHA8\0" + "GL_GL_SRGB_ALPHA\0" "GL_GREATER\0" "GL_GREEN\0" "GL_GREEN_BIAS\0" @@ -561,6 +624,7 @@ static const char enum_string_table[] = "GL_INDEX_OFFSET\0" "GL_INDEX_SHIFT\0" "GL_INDEX_WRITEMASK\0" + "GL_INFO_LOG_LENGTH\0" "GL_INT\0" "GL_INTENSITY\0" "GL_INTENSITY12\0" @@ -575,8 +639,11 @@ static const char enum_string_table[] = "GL_INTERPOLATE\0" "GL_INTERPOLATE_ARB\0" "GL_INTERPOLATE_EXT\0" + "GL_INT_VEC2\0" "GL_INT_VEC2_ARB\0" + "GL_INT_VEC3\0" "GL_INT_VEC3_ARB\0" + "GL_INT_VEC4\0" "GL_INT_VEC4_ARB\0" "GL_INVALID_ENUM\0" "GL_INVALID_FRAMEBUFFER_OPERATION_EXT\0" @@ -625,6 +692,7 @@ static const char enum_string_table[] = "GL_LINE_WIDTH\0" "GL_LINE_WIDTH_GRANULARITY\0" "GL_LINE_WIDTH_RANGE\0" + "GL_LINK_STATUS\0" "GL_LIST_BASE\0" "GL_LIST_BIT\0" "GL_LIST_INDEX\0" @@ -632,6 +700,7 @@ static const char enum_string_table[] = "GL_LOAD\0" "GL_LOGIC_OP\0" "GL_LOGIC_OP_MODE\0" + "GL_LOWER_LEFT\0" "GL_LUMINANCE\0" "GL_LUMINANCE12\0" "GL_LUMINANCE12_ALPHA12\0" @@ -767,6 +836,7 @@ static const char enum_string_table[] = "GL_MAX_COLOR_ATTACHMENTS_EXT\0" "GL_MAX_COLOR_MATRIX_STACK_DEPTH\0" "GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI\0" + "GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS\0" "GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB\0" "GL_MAX_CONVOLUTION_HEIGHT\0" "GL_MAX_CONVOLUTION_HEIGHT_EXT\0" @@ -774,12 +844,14 @@ static const char enum_string_table[] = "GL_MAX_CONVOLUTION_WIDTH_EXT\0" "GL_MAX_CUBE_MAP_TEXTURE_SIZE\0" "GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB\0" + "GL_MAX_DRAW_BUFFERS\0" "GL_MAX_DRAW_BUFFERS_ARB\0" "GL_MAX_DRAW_BUFFERS_ATI\0" "GL_MAX_ELEMENTS_INDICES\0" "GL_MAX_ELEMENTS_VERTICES\0" "GL_MAX_EVAL_ORDER\0" "GL_MAX_EXT\0" + "GL_MAX_FRAGMENT_UNIFORM_COMPONENTS\0" "GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB\0" "GL_MAX_LIGHTS\0" "GL_MAX_LIST_NESTING\0" @@ -819,7 +891,9 @@ static const char enum_string_table[] = "GL_MAX_RENDERBUFFER_SIZE_EXT\0" "GL_MAX_SHININESS_NV\0" "GL_MAX_SPOT_EXPONENT_NV\0" + "GL_MAX_TEXTURE_COORDS\0" "GL_MAX_TEXTURE_COORDS_ARB\0" + "GL_MAX_TEXTURE_IMAGE_UNITS\0" "GL_MAX_TEXTURE_IMAGE_UNITS_ARB\0" "GL_MAX_TEXTURE_LOD_BIAS\0" "GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT\0" @@ -829,9 +903,13 @@ static const char enum_string_table[] = "GL_MAX_TEXTURE_UNITS_ARB\0" "GL_MAX_TRACK_MATRICES_NV\0" "GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV\0" + "GL_MAX_VARYING_FLOATS\0" "GL_MAX_VARYING_FLOATS_ARB\0" + "GL_MAX_VERTEX_ATTRIBS\0" "GL_MAX_VERTEX_ATTRIBS_ARB\0" + "GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS\0" "GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB\0" + "GL_MAX_VERTEX_UNIFORM_COMPONENTS\0" "GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB\0" "GL_MAX_VERTEX_UNITS_ARB\0" "GL_MAX_VIEWPORT_DIMS\0" @@ -1047,6 +1125,7 @@ static const char enum_string_table[] = "GL_POINT_SIZE_RANGE\0" "GL_POINT_SMOOTH\0" "GL_POINT_SMOOTH_HINT\0" + "GL_POINT_SPRITE\0" "GL_POINT_SPRITE_ARB\0" "GL_POINT_SPRITE_COORD_ORIGIN\0" "GL_POINT_SPRITE_NV\0" @@ -1246,6 +1325,12 @@ static const char enum_string_table[] = "GL_RGB_SCALE_EXT\0" "GL_RIGHT\0" "GL_S\0" + "GL_SAMPLER_1D\0" + "GL_SAMPLER_1D_SHADOW\0" + "GL_SAMPLER_2D\0" + "GL_SAMPLER_2D_SHADOW\0" + "GL_SAMPLER_3D\0" + "GL_SAMPLER_CUBE\0" "GL_SAMPLES\0" "GL_SAMPLES_3DFX\0" "GL_SAMPLES_ARB\0" @@ -1282,7 +1367,10 @@ static const char enum_string_table[] = "GL_SEPARATE_SPECULAR_COLOR_EXT\0" "GL_SET\0" "GL_SHADER_OBJECT_ARB\0" + "GL_SHADER_SOURCE_LENGTH\0" + "GL_SHADER_TYPE\0" "GL_SHADE_MODEL\0" + "GL_SHADING_LANGUAGE_VERSION\0" "GL_SHADOW_AMBIENT_SGIX\0" "GL_SHARED_TEXTURE_PALETTE_EXT\0" "GL_SHININESS\0" @@ -1339,6 +1427,13 @@ static const char enum_string_table[] = "GL_STATIC_READ_ARB\0" "GL_STENCIL\0" "GL_STENCIL_ATTACHMENT_EXT\0" + "GL_STENCIL_BACK_FAIL\0" + "GL_STENCIL_BACK_FUNC\0" + "GL_STENCIL_BACK_PASS_DEPTH_FAIL\0" + "GL_STENCIL_BACK_PASS_DEPTH_PASS\0" + "GL_STENCIL_BACK_REF\0" + "GL_STENCIL_BACK_VALUE_MASK\0" + "GL_STENCIL_BACK_WRITEMASK\0" "GL_STENCIL_BITS\0" "GL_STENCIL_BUFFER_BIT\0" "GL_STENCIL_CLEAR_VALUE\0" @@ -1601,8 +1696,10 @@ static const char enum_string_table[] = "GL_UNSIGNED_SHORT_8_8_MESA\0" "GL_UNSIGNED_SHORT_8_8_REV_APPLE\0" "GL_UNSIGNED_SHORT_8_8_REV_MESA\0" + "GL_UPPER_LEFT\0" "GL_V2F\0" "GL_V3F\0" + "GL_VALIDATE_STATUS\0" "GL_VENDOR\0" "GL_VERSION\0" "GL_VERTEX_ARRAY\0" @@ -1631,20 +1728,29 @@ static const char enum_string_table[] = "GL_VERTEX_ATTRIB_ARRAY9_NV\0" "GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING\0" "GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB\0" + "GL_VERTEX_ATTRIB_ARRAY_ENABLED\0" "GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB\0" + "GL_VERTEX_ATTRIB_ARRAY_NORMALIZED\0" "GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB\0" + "GL_VERTEX_ATTRIB_ARRAY_POINTER\0" "GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB\0" + "GL_VERTEX_ATTRIB_ARRAY_SIZE\0" "GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB\0" + "GL_VERTEX_ATTRIB_ARRAY_STRIDE\0" "GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB\0" + "GL_VERTEX_ATTRIB_ARRAY_TYPE\0" "GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB\0" "GL_VERTEX_BLEND_ARB\0" "GL_VERTEX_PROGRAM_ARB\0" "GL_VERTEX_PROGRAM_BINDING_NV\0" "GL_VERTEX_PROGRAM_NV\0" + "GL_VERTEX_PROGRAM_POINT_SIZE\0" "GL_VERTEX_PROGRAM_POINT_SIZE_ARB\0" "GL_VERTEX_PROGRAM_POINT_SIZE_NV\0" + "GL_VERTEX_PROGRAM_TWO_SIDE\0" "GL_VERTEX_PROGRAM_TWO_SIDE_ARB\0" "GL_VERTEX_PROGRAM_TWO_SIDE_NV\0" + "GL_VERTEX_SHADER\0" "GL_VERTEX_SHADER_ARB\0" "GL_VERTEX_STATE_PROGRAM_NV\0" "GL_VIEWPORT\0" @@ -1668,7 +1774,7 @@ static const char enum_string_table[] = "GL_ZOOM_Y\0" ; -static const enum_elt all_enums[1631] = +static const enum_elt all_enums[1737] = { { 0, 0x00000600 }, /* GL_2D */ { 6, 0x00001407 }, /* GL_2_BYTES */ @@ -1685,2866 +1791,3009 @@ static const enum_elt all_enums[1631] = { 165, 0x00000B80 }, /* GL_ACCUM_CLEAR_VALUE */ { 186, 0x00000D59 }, /* GL_ACCUM_GREEN_BITS */ { 206, 0x00000D58 }, /* GL_ACCUM_RED_BITS */ - { 224, 0x00008911 }, /* GL_ACTIVE_STENCIL_FACE_EXT */ - { 251, 0x000084E0 }, /* GL_ACTIVE_TEXTURE */ - { 269, 0x000084E0 }, /* GL_ACTIVE_TEXTURE_ARB */ - { 291, 0x000086A5 }, /* GL_ACTIVE_VERTEX_UNITS_ARB */ - { 318, 0x00000104 }, /* GL_ADD */ - { 325, 0x00008574 }, /* GL_ADD_SIGNED */ - { 339, 0x00008574 }, /* GL_ADD_SIGNED_ARB */ - { 357, 0x00008574 }, /* GL_ADD_SIGNED_EXT */ - { 375, 0x0000846E }, /* GL_ALIASED_LINE_WIDTH_RANGE */ - { 403, 0x0000846D }, /* GL_ALIASED_POINT_SIZE_RANGE */ - { 431, 0x000FFFFF }, /* GL_ALL_ATTRIB_BITS */ - { 450, 0xFFFFFFFF }, /* GL_ALL_CLIENT_ATTRIB_BITS */ - { 476, 0x00001906 }, /* GL_ALPHA */ - { 485, 0x0000803D }, /* GL_ALPHA12 */ - { 496, 0x0000803D }, /* GL_ALPHA12_EXT */ - { 511, 0x0000803E }, /* GL_ALPHA16 */ - { 522, 0x0000803E }, /* GL_ALPHA16_EXT */ - { 537, 0x0000803B }, /* GL_ALPHA4 */ - { 547, 0x0000803B }, /* GL_ALPHA4_EXT */ - { 561, 0x0000803C }, /* GL_ALPHA8 */ - { 571, 0x0000803C }, /* GL_ALPHA8_EXT */ - { 585, 0x00000D1D }, /* GL_ALPHA_BIAS */ - { 599, 0x00000D55 }, /* GL_ALPHA_BITS */ - { 613, 0x00000D1C }, /* GL_ALPHA_SCALE */ - { 628, 0x00000BC0 }, /* GL_ALPHA_TEST */ - { 642, 0x00000BC1 }, /* GL_ALPHA_TEST_FUNC */ - { 661, 0x00000BC2 }, /* GL_ALPHA_TEST_REF */ - { 679, 0x00000207 }, /* GL_ALWAYS */ - { 689, 0x00001200 }, /* GL_AMBIENT */ - { 700, 0x00001602 }, /* GL_AMBIENT_AND_DIFFUSE */ - { 723, 0x00001501 }, /* GL_AND */ - { 730, 0x00001504 }, /* GL_AND_INVERTED */ - { 746, 0x00001502 }, /* GL_AND_REVERSE */ - { 761, 0x00008892 }, /* GL_ARRAY_BUFFER */ - { 777, 0x00008892 }, /* GL_ARRAY_BUFFER_ARB */ - { 797, 0x00008894 }, /* GL_ARRAY_BUFFER_BINDING */ - { 821, 0x00008894 }, /* GL_ARRAY_BUFFER_BINDING_ARB */ - { 849, 0x00008645 }, /* GL_ATTRIB_ARRAY_POINTER_NV */ - { 876, 0x00008623 }, /* GL_ATTRIB_ARRAY_SIZE_NV */ - { 900, 0x00008624 }, /* GL_ATTRIB_ARRAY_STRIDE_NV */ - { 926, 0x00008625 }, /* GL_ATTRIB_ARRAY_TYPE_NV */ - { 950, 0x00000BB0 }, /* GL_ATTRIB_STACK_DEPTH */ - { 972, 0x00000D80 }, /* GL_AUTO_NORMAL */ - { 987, 0x00000409 }, /* GL_AUX0 */ - { 995, 0x0000040A }, /* GL_AUX1 */ - { 1003, 0x0000040B }, /* GL_AUX2 */ - { 1011, 0x0000040C }, /* GL_AUX3 */ - { 1019, 0x00000C00 }, /* GL_AUX_BUFFERS */ - { 1034, 0x00000405 }, /* GL_BACK */ - { 1042, 0x00000402 }, /* GL_BACK_LEFT */ - { 1055, 0x00000403 }, /* GL_BACK_RIGHT */ - { 1069, 0x000080E0 }, /* GL_BGR */ - { 1076, 0x000080E1 }, /* GL_BGRA */ - { 1084, 0x00001A00 }, /* GL_BITMAP */ - { 1094, 0x00000704 }, /* GL_BITMAP_TOKEN */ - { 1110, 0x00000BE2 }, /* GL_BLEND */ - { 1119, 0x00008005 }, /* GL_BLEND_COLOR */ - { 1134, 0x00008005 }, /* GL_BLEND_COLOR_EXT */ - { 1153, 0x00000BE0 }, /* GL_BLEND_DST */ - { 1166, 0x000080CA }, /* GL_BLEND_DST_ALPHA */ - { 1185, 0x000080C8 }, /* GL_BLEND_DST_RGB */ - { 1202, 0x00008009 }, /* GL_BLEND_EQUATION */ - { 1220, 0x0000883D }, /* GL_BLEND_EQUATION_ALPHA_EXT */ - { 1248, 0x00008009 }, /* GL_BLEND_EQUATION_EXT */ - { 1270, 0x00008009 }, /* GL_BLEND_EQUATION_RGB_EXT */ - { 1296, 0x00000BE1 }, /* GL_BLEND_SRC */ - { 1309, 0x000080CB }, /* GL_BLEND_SRC_ALPHA */ - { 1328, 0x000080C9 }, /* GL_BLEND_SRC_RGB */ - { 1345, 0x00001905 }, /* GL_BLUE */ - { 1353, 0x00000D1B }, /* GL_BLUE_BIAS */ - { 1366, 0x00000D54 }, /* GL_BLUE_BITS */ - { 1379, 0x00000D1A }, /* GL_BLUE_SCALE */ - { 1393, 0x00008B56 }, /* GL_BOOL_ARB */ - { 1405, 0x00008B57 }, /* GL_BOOL_VEC2_ARB */ - { 1422, 0x00008B58 }, /* GL_BOOL_VEC3_ARB */ - { 1439, 0x00008B59 }, /* GL_BOOL_VEC4_ARB */ - { 1456, 0x000088BB }, /* GL_BUFFER_ACCESS */ - { 1473, 0x000088BB }, /* GL_BUFFER_ACCESS_ARB */ - { 1494, 0x000088BC }, /* GL_BUFFER_MAPPED */ - { 1511, 0x000088BC }, /* GL_BUFFER_MAPPED_ARB */ - { 1532, 0x000088BD }, /* GL_BUFFER_MAP_POINTER */ - { 1554, 0x000088BD }, /* GL_BUFFER_MAP_POINTER_ARB */ - { 1580, 0x00008764 }, /* GL_BUFFER_SIZE */ - { 1595, 0x00008764 }, /* GL_BUFFER_SIZE_ARB */ - { 1614, 0x00008765 }, /* GL_BUFFER_USAGE */ - { 1630, 0x00008765 }, /* GL_BUFFER_USAGE_ARB */ - { 1650, 0x00001400 }, /* GL_BYTE */ - { 1658, 0x00002A24 }, /* GL_C3F_V3F */ - { 1669, 0x00002A26 }, /* GL_C4F_N3F_V3F */ - { 1684, 0x00002A22 }, /* GL_C4UB_V2F */ - { 1696, 0x00002A23 }, /* GL_C4UB_V3F */ - { 1708, 0x00000901 }, /* GL_CCW */ - { 1715, 0x00002900 }, /* GL_CLAMP */ - { 1724, 0x0000812D }, /* GL_CLAMP_TO_BORDER */ - { 1743, 0x0000812D }, /* GL_CLAMP_TO_BORDER_ARB */ - { 1766, 0x0000812D }, /* GL_CLAMP_TO_BORDER_SGIS */ - { 1790, 0x0000812F }, /* GL_CLAMP_TO_EDGE */ - { 1807, 0x0000812F }, /* GL_CLAMP_TO_EDGE_SGIS */ - { 1829, 0x00001500 }, /* GL_CLEAR */ - { 1838, 0x000084E1 }, /* GL_CLIENT_ACTIVE_TEXTURE */ - { 1863, 0x000084E1 }, /* GL_CLIENT_ACTIVE_TEXTURE_ARB */ - { 1892, 0xFFFFFFFF }, /* GL_CLIENT_ALL_ATTRIB_BITS */ - { 1918, 0x00000BB1 }, /* GL_CLIENT_ATTRIB_STACK_DEPTH */ - { 1947, 0x00000001 }, /* GL_CLIENT_PIXEL_STORE_BIT */ - { 1973, 0x00000002 }, /* GL_CLIENT_VERTEX_ARRAY_BIT */ - { 2000, 0x00003000 }, /* GL_CLIP_PLANE0 */ - { 2015, 0x00003001 }, /* GL_CLIP_PLANE1 */ - { 2030, 0x00003002 }, /* GL_CLIP_PLANE2 */ - { 2045, 0x00003003 }, /* GL_CLIP_PLANE3 */ - { 2060, 0x00003004 }, /* GL_CLIP_PLANE4 */ - { 2075, 0x00003005 }, /* GL_CLIP_PLANE5 */ - { 2090, 0x000080F0 }, /* GL_CLIP_VOLUME_CLIPPING_HINT_EXT */ - { 2123, 0x00000A00 }, /* GL_COEFF */ - { 2132, 0x00001800 }, /* GL_COLOR */ - { 2141, 0x00008076 }, /* GL_COLOR_ARRAY */ - { 2156, 0x00008898 }, /* GL_COLOR_ARRAY_BUFFER_BINDING */ - { 2186, 0x00008898 }, /* GL_COLOR_ARRAY_BUFFER_BINDING_ARB */ - { 2220, 0x00008090 }, /* GL_COLOR_ARRAY_POINTER */ - { 2243, 0x00008081 }, /* GL_COLOR_ARRAY_SIZE */ - { 2263, 0x00008083 }, /* GL_COLOR_ARRAY_STRIDE */ - { 2285, 0x00008082 }, /* GL_COLOR_ARRAY_TYPE */ - { 2305, 0x00008CE0 }, /* GL_COLOR_ATTACHMENT0_EXT */ - { 2330, 0x00008CEA }, /* GL_COLOR_ATTACHMENT10_EXT */ - { 2356, 0x00008CEB }, /* GL_COLOR_ATTACHMENT11_EXT */ - { 2382, 0x00008CEC }, /* GL_COLOR_ATTACHMENT12_EXT */ - { 2408, 0x00008CED }, /* GL_COLOR_ATTACHMENT13_EXT */ - { 2434, 0x00008CEE }, /* GL_COLOR_ATTACHMENT14_EXT */ - { 2460, 0x00008CEF }, /* GL_COLOR_ATTACHMENT15_EXT */ - { 2486, 0x00008CE1 }, /* GL_COLOR_ATTACHMENT1_EXT */ - { 2511, 0x00008CE2 }, /* GL_COLOR_ATTACHMENT2_EXT */ - { 2536, 0x00008CE3 }, /* GL_COLOR_ATTACHMENT3_EXT */ - { 2561, 0x00008CE4 }, /* GL_COLOR_ATTACHMENT4_EXT */ - { 2586, 0x00008CE5 }, /* GL_COLOR_ATTACHMENT5_EXT */ - { 2611, 0x00008CE6 }, /* GL_COLOR_ATTACHMENT6_EXT */ - { 2636, 0x00008CE7 }, /* GL_COLOR_ATTACHMENT7_EXT */ - { 2661, 0x00008CE8 }, /* GL_COLOR_ATTACHMENT8_EXT */ - { 2686, 0x00008CE9 }, /* GL_COLOR_ATTACHMENT9_EXT */ - { 2711, 0x00004000 }, /* GL_COLOR_BUFFER_BIT */ - { 2731, 0x00000C22 }, /* GL_COLOR_CLEAR_VALUE */ - { 2752, 0x00001900 }, /* GL_COLOR_INDEX */ - { 2767, 0x00001603 }, /* GL_COLOR_INDEXES */ - { 2784, 0x00000BF2 }, /* GL_COLOR_LOGIC_OP */ - { 2802, 0x00000B57 }, /* GL_COLOR_MATERIAL */ - { 2820, 0x00000B55 }, /* GL_COLOR_MATERIAL_FACE */ - { 2843, 0x00000B56 }, /* GL_COLOR_MATERIAL_PARAMETER */ - { 2871, 0x000080B1 }, /* GL_COLOR_MATRIX */ - { 2887, 0x000080B1 }, /* GL_COLOR_MATRIX_SGI */ - { 2907, 0x000080B2 }, /* GL_COLOR_MATRIX_STACK_DEPTH */ - { 2935, 0x000080B2 }, /* GL_COLOR_MATRIX_STACK_DEPTH_SGI */ - { 2967, 0x00008458 }, /* GL_COLOR_SUM */ - { 2980, 0x00008458 }, /* GL_COLOR_SUM_ARB */ - { 2997, 0x000080D0 }, /* GL_COLOR_TABLE */ - { 3012, 0x000080DD }, /* GL_COLOR_TABLE_ALPHA_SIZE */ - { 3038, 0x000080DD }, /* GL_COLOR_TABLE_ALPHA_SIZE_EXT */ - { 3068, 0x000080DD }, /* GL_COLOR_TABLE_ALPHA_SIZE_SGI */ - { 3098, 0x000080D7 }, /* GL_COLOR_TABLE_BIAS */ - { 3118, 0x000080D7 }, /* GL_COLOR_TABLE_BIAS_SGI */ - { 3142, 0x000080DC }, /* GL_COLOR_TABLE_BLUE_SIZE */ - { 3167, 0x000080DC }, /* GL_COLOR_TABLE_BLUE_SIZE_EXT */ - { 3196, 0x000080DC }, /* GL_COLOR_TABLE_BLUE_SIZE_SGI */ - { 3225, 0x000080D8 }, /* GL_COLOR_TABLE_FORMAT */ - { 3247, 0x000080D8 }, /* GL_COLOR_TABLE_FORMAT_EXT */ - { 3273, 0x000080D8 }, /* GL_COLOR_TABLE_FORMAT_SGI */ - { 3299, 0x000080DB }, /* GL_COLOR_TABLE_GREEN_SIZE */ - { 3325, 0x000080DB }, /* GL_COLOR_TABLE_GREEN_SIZE_EXT */ - { 3355, 0x000080DB }, /* GL_COLOR_TABLE_GREEN_SIZE_SGI */ - { 3385, 0x000080DF }, /* GL_COLOR_TABLE_INTENSITY_SIZE */ - { 3415, 0x000080DF }, /* GL_COLOR_TABLE_INTENSITY_SIZE_EXT */ - { 3449, 0x000080DF }, /* GL_COLOR_TABLE_INTENSITY_SIZE_SGI */ - { 3483, 0x000080DE }, /* GL_COLOR_TABLE_LUMINANCE_SIZE */ - { 3513, 0x000080DE }, /* GL_COLOR_TABLE_LUMINANCE_SIZE_EXT */ - { 3547, 0x000080DE }, /* GL_COLOR_TABLE_LUMINANCE_SIZE_SGI */ - { 3581, 0x000080DA }, /* GL_COLOR_TABLE_RED_SIZE */ - { 3605, 0x000080DA }, /* GL_COLOR_TABLE_RED_SIZE_EXT */ - { 3633, 0x000080DA }, /* GL_COLOR_TABLE_RED_SIZE_SGI */ - { 3661, 0x000080D6 }, /* GL_COLOR_TABLE_SCALE */ - { 3682, 0x000080D6 }, /* GL_COLOR_TABLE_SCALE_SGI */ - { 3707, 0x000080D9 }, /* GL_COLOR_TABLE_WIDTH */ - { 3728, 0x000080D9 }, /* GL_COLOR_TABLE_WIDTH_EXT */ - { 3753, 0x000080D9 }, /* GL_COLOR_TABLE_WIDTH_SGI */ - { 3778, 0x00000C23 }, /* GL_COLOR_WRITEMASK */ - { 3797, 0x00008570 }, /* GL_COMBINE */ - { 3808, 0x00008503 }, /* GL_COMBINE4 */ - { 3820, 0x00008572 }, /* GL_COMBINE_ALPHA */ - { 3837, 0x00008572 }, /* GL_COMBINE_ALPHA_ARB */ - { 3858, 0x00008572 }, /* GL_COMBINE_ALPHA_EXT */ - { 3879, 0x00008570 }, /* GL_COMBINE_ARB */ - { 3894, 0x00008570 }, /* GL_COMBINE_EXT */ - { 3909, 0x00008571 }, /* GL_COMBINE_RGB */ - { 3924, 0x00008571 }, /* GL_COMBINE_RGB_ARB */ - { 3943, 0x00008571 }, /* GL_COMBINE_RGB_EXT */ - { 3962, 0x0000884E }, /* GL_COMPARE_R_TO_TEXTURE */ - { 3986, 0x0000884E }, /* GL_COMPARE_R_TO_TEXTURE_ARB */ - { 4014, 0x00001300 }, /* GL_COMPILE */ - { 4025, 0x00001301 }, /* GL_COMPILE_AND_EXECUTE */ - { 4048, 0x000084E9 }, /* GL_COMPRESSED_ALPHA */ - { 4068, 0x000084E9 }, /* GL_COMPRESSED_ALPHA_ARB */ - { 4092, 0x000084EC }, /* GL_COMPRESSED_INTENSITY */ - { 4116, 0x000084EC }, /* GL_COMPRESSED_INTENSITY_ARB */ - { 4144, 0x000084EA }, /* GL_COMPRESSED_LUMINANCE */ - { 4168, 0x000084EB }, /* GL_COMPRESSED_LUMINANCE_ALPHA */ - { 4198, 0x000084EB }, /* GL_COMPRESSED_LUMINANCE_ALPHA_ARB */ - { 4232, 0x000084EA }, /* GL_COMPRESSED_LUMINANCE_ARB */ - { 4260, 0x000084ED }, /* GL_COMPRESSED_RGB */ - { 4278, 0x000084EE }, /* GL_COMPRESSED_RGBA */ - { 4297, 0x000084EE }, /* GL_COMPRESSED_RGBA_ARB */ - { 4320, 0x000086B1 }, /* GL_COMPRESSED_RGBA_FXT1_3DFX */ - { 4349, 0x000083F1 }, /* GL_COMPRESSED_RGBA_S3TC_DXT1_EXT */ - { 4382, 0x000083F2 }, /* GL_COMPRESSED_RGBA_S3TC_DXT3_EXT */ - { 4415, 0x000083F3 }, /* GL_COMPRESSED_RGBA_S3TC_DXT5_EXT */ - { 4448, 0x000084ED }, /* GL_COMPRESSED_RGB_ARB */ - { 4470, 0x000086B0 }, /* GL_COMPRESSED_RGB_FXT1_3DFX */ - { 4498, 0x000083F0 }, /* GL_COMPRESSED_RGB_S3TC_DXT1_EXT */ - { 4530, 0x000086A3 }, /* GL_COMPRESSED_TEXTURE_FORMATS */ - { 4560, 0x00008576 }, /* GL_CONSTANT */ - { 4572, 0x00008003 }, /* GL_CONSTANT_ALPHA */ - { 4590, 0x00008003 }, /* GL_CONSTANT_ALPHA_EXT */ - { 4612, 0x00008576 }, /* GL_CONSTANT_ARB */ - { 4628, 0x00001207 }, /* GL_CONSTANT_ATTENUATION */ - { 4652, 0x00008151 }, /* GL_CONSTANT_BORDER_HP */ - { 4674, 0x00008001 }, /* GL_CONSTANT_COLOR */ - { 4692, 0x00008001 }, /* GL_CONSTANT_COLOR_EXT */ - { 4714, 0x00008576 }, /* GL_CONSTANT_EXT */ - { 4730, 0x00008010 }, /* GL_CONVOLUTION_1D */ - { 4748, 0x00008011 }, /* GL_CONVOLUTION_2D */ - { 4766, 0x00008154 }, /* GL_CONVOLUTION_BORDER_COLOR */ - { 4794, 0x00008154 }, /* GL_CONVOLUTION_BORDER_COLOR_HP */ - { 4825, 0x00008013 }, /* GL_CONVOLUTION_BORDER_MODE */ - { 4852, 0x00008013 }, /* GL_CONVOLUTION_BORDER_MODE_EXT */ - { 4883, 0x00008015 }, /* GL_CONVOLUTION_FILTER_BIAS */ - { 4910, 0x00008015 }, /* GL_CONVOLUTION_FILTER_BIAS_EXT */ - { 4941, 0x00008014 }, /* GL_CONVOLUTION_FILTER_SCALE */ - { 4969, 0x00008014 }, /* GL_CONVOLUTION_FILTER_SCALE_EXT */ - { 5001, 0x00008017 }, /* GL_CONVOLUTION_FORMAT */ - { 5023, 0x00008017 }, /* GL_CONVOLUTION_FORMAT_EXT */ - { 5049, 0x00008019 }, /* GL_CONVOLUTION_HEIGHT */ - { 5071, 0x00008019 }, /* GL_CONVOLUTION_HEIGHT_EXT */ - { 5097, 0x00008018 }, /* GL_CONVOLUTION_WIDTH */ - { 5118, 0x00008018 }, /* GL_CONVOLUTION_WIDTH_EXT */ - { 5143, 0x00008862 }, /* GL_COORD_REPLACE_ARB */ - { 5164, 0x00008862 }, /* GL_COORD_REPLACE_NV */ - { 5184, 0x00001503 }, /* GL_COPY */ - { 5192, 0x0000150C }, /* GL_COPY_INVERTED */ - { 5209, 0x00000706 }, /* GL_COPY_PIXEL_TOKEN */ - { 5229, 0x00000B44 }, /* GL_CULL_FACE */ - { 5242, 0x00000B45 }, /* GL_CULL_FACE_MODE */ - { 5260, 0x000081AA }, /* GL_CULL_VERTEX_EXT */ - { 5279, 0x000081AC }, /* GL_CULL_VERTEX_EYE_POSITION_EXT */ - { 5311, 0x000081AB }, /* GL_CULL_VERTEX_OBJECT_POSITION_EXT */ - { 5346, 0x00008626 }, /* GL_CURRENT_ATTRIB_NV */ - { 5367, 0x00000001 }, /* GL_CURRENT_BIT */ - { 5382, 0x00000B00 }, /* GL_CURRENT_COLOR */ - { 5399, 0x00008453 }, /* GL_CURRENT_FOG_COORD */ - { 5420, 0x00008453 }, /* GL_CURRENT_FOG_COORDINATE */ - { 5446, 0x00000B01 }, /* GL_CURRENT_INDEX */ - { 5463, 0x00008641 }, /* GL_CURRENT_MATRIX_ARB */ - { 5485, 0x00008845 }, /* GL_CURRENT_MATRIX_INDEX_ARB */ - { 5513, 0x00008641 }, /* GL_CURRENT_MATRIX_NV */ - { 5534, 0x00008640 }, /* GL_CURRENT_MATRIX_STACK_DEPTH_ARB */ - { 5568, 0x00008640 }, /* GL_CURRENT_MATRIX_STACK_DEPTH_NV */ - { 5601, 0x00000B02 }, /* GL_CURRENT_NORMAL */ - { 5619, 0x00008843 }, /* GL_CURRENT_PALETTE_MATRIX_ARB */ - { 5649, 0x00008865 }, /* GL_CURRENT_QUERY */ - { 5666, 0x00008865 }, /* GL_CURRENT_QUERY_ARB */ - { 5687, 0x00000B04 }, /* GL_CURRENT_RASTER_COLOR */ - { 5711, 0x00000B09 }, /* GL_CURRENT_RASTER_DISTANCE */ - { 5738, 0x00000B05 }, /* GL_CURRENT_RASTER_INDEX */ - { 5762, 0x00000B07 }, /* GL_CURRENT_RASTER_POSITION */ - { 5789, 0x00000B08 }, /* GL_CURRENT_RASTER_POSITION_VALID */ - { 5822, 0x00000B06 }, /* GL_CURRENT_RASTER_TEXTURE_COORDS */ - { 5855, 0x00008459 }, /* GL_CURRENT_SECONDARY_COLOR */ - { 5882, 0x00000B03 }, /* GL_CURRENT_TEXTURE_COORDS */ - { 5908, 0x00008626 }, /* GL_CURRENT_VERTEX_ATTRIB_ARB */ - { 5937, 0x000086A8 }, /* GL_CURRENT_WEIGHT_ARB */ - { 5959, 0x00000900 }, /* GL_CW */ - { 5965, 0x0000875B }, /* GL_DEBUG_ASSERT_MESA */ - { 5986, 0x00008759 }, /* GL_DEBUG_OBJECT_MESA */ - { 6007, 0x0000875A }, /* GL_DEBUG_PRINT_MESA */ - { 6027, 0x00002101 }, /* GL_DECAL */ - { 6036, 0x00001E03 }, /* GL_DECR */ - { 6044, 0x00008508 }, /* GL_DECR_WRAP */ - { 6057, 0x00008508 }, /* GL_DECR_WRAP_EXT */ - { 6074, 0x00001801 }, /* GL_DEPTH */ - { 6083, 0x00008D00 }, /* GL_DEPTH_ATTACHMENT_EXT */ - { 6107, 0x00000D1F }, /* GL_DEPTH_BIAS */ - { 6121, 0x00000D56 }, /* GL_DEPTH_BITS */ - { 6135, 0x00008891 }, /* GL_DEPTH_BOUNDS_EXT */ - { 6155, 0x00008890 }, /* GL_DEPTH_BOUNDS_TEST_EXT */ - { 6180, 0x00000100 }, /* GL_DEPTH_BUFFER_BIT */ - { 6200, 0x0000864F }, /* GL_DEPTH_CLAMP_NV */ - { 6218, 0x00000B73 }, /* GL_DEPTH_CLEAR_VALUE */ - { 6239, 0x00001902 }, /* GL_DEPTH_COMPONENT */ - { 6258, 0x000081A5 }, /* GL_DEPTH_COMPONENT16 */ - { 6279, 0x000081A5 }, /* GL_DEPTH_COMPONENT16_ARB */ - { 6304, 0x000081A5 }, /* GL_DEPTH_COMPONENT16_SGIX */ - { 6330, 0x000081A6 }, /* GL_DEPTH_COMPONENT24 */ - { 6351, 0x000081A6 }, /* GL_DEPTH_COMPONENT24_ARB */ - { 6376, 0x000081A6 }, /* GL_DEPTH_COMPONENT24_SGIX */ - { 6402, 0x000081A7 }, /* GL_DEPTH_COMPONENT32 */ - { 6423, 0x000081A7 }, /* GL_DEPTH_COMPONENT32_ARB */ - { 6448, 0x000081A7 }, /* GL_DEPTH_COMPONENT32_SGIX */ - { 6474, 0x00000B74 }, /* GL_DEPTH_FUNC */ - { 6488, 0x00000B70 }, /* GL_DEPTH_RANGE */ - { 6503, 0x00000D1E }, /* GL_DEPTH_SCALE */ - { 6518, 0x000084F9 }, /* GL_DEPTH_STENCIL_NV */ - { 6538, 0x0000886F }, /* GL_DEPTH_STENCIL_TO_BGRA_NV */ - { 6566, 0x0000886E }, /* GL_DEPTH_STENCIL_TO_RGBA_NV */ - { 6594, 0x00000B71 }, /* GL_DEPTH_TEST */ - { 6608, 0x0000884B }, /* GL_DEPTH_TEXTURE_MODE */ - { 6630, 0x0000884B }, /* GL_DEPTH_TEXTURE_MODE_ARB */ - { 6656, 0x00000B72 }, /* GL_DEPTH_WRITEMASK */ - { 6675, 0x00001201 }, /* GL_DIFFUSE */ - { 6686, 0x00000BD0 }, /* GL_DITHER */ - { 6696, 0x00000A02 }, /* GL_DOMAIN */ - { 6706, 0x00001100 }, /* GL_DONT_CARE */ - { 6719, 0x000086AE }, /* GL_DOT3_RGB */ - { 6731, 0x000086AF }, /* GL_DOT3_RGBA */ - { 6744, 0x000086AF }, /* GL_DOT3_RGBA_ARB */ - { 6761, 0x00008741 }, /* GL_DOT3_RGBA_EXT */ - { 6778, 0x000086AE }, /* GL_DOT3_RGB_ARB */ - { 6794, 0x00008740 }, /* GL_DOT3_RGB_EXT */ - { 6810, 0x0000140A }, /* GL_DOUBLE */ - { 6820, 0x00000C32 }, /* GL_DOUBLEBUFFER */ - { 6836, 0x00000C01 }, /* GL_DRAW_BUFFER */ - { 6851, 0x00008825 }, /* GL_DRAW_BUFFER0_ARB */ - { 6871, 0x00008825 }, /* GL_DRAW_BUFFER0_ATI */ - { 6891, 0x0000882F }, /* GL_DRAW_BUFFER10_ARB */ - { 6912, 0x0000882F }, /* GL_DRAW_BUFFER10_ATI */ - { 6933, 0x00008830 }, /* GL_DRAW_BUFFER11_ARB */ - { 6954, 0x00008830 }, /* GL_DRAW_BUFFER11_ATI */ - { 6975, 0x00008831 }, /* GL_DRAW_BUFFER12_ARB */ - { 6996, 0x00008831 }, /* GL_DRAW_BUFFER12_ATI */ - { 7017, 0x00008832 }, /* GL_DRAW_BUFFER13_ARB */ - { 7038, 0x00008832 }, /* GL_DRAW_BUFFER13_ATI */ - { 7059, 0x00008833 }, /* GL_DRAW_BUFFER14_ARB */ - { 7080, 0x00008833 }, /* GL_DRAW_BUFFER14_ATI */ - { 7101, 0x00008834 }, /* GL_DRAW_BUFFER15_ARB */ - { 7122, 0x00008834 }, /* GL_DRAW_BUFFER15_ATI */ - { 7143, 0x00008826 }, /* GL_DRAW_BUFFER1_ARB */ - { 7163, 0x00008826 }, /* GL_DRAW_BUFFER1_ATI */ - { 7183, 0x00008827 }, /* GL_DRAW_BUFFER2_ARB */ - { 7203, 0x00008827 }, /* GL_DRAW_BUFFER2_ATI */ - { 7223, 0x00008828 }, /* GL_DRAW_BUFFER3_ARB */ - { 7243, 0x00008828 }, /* GL_DRAW_BUFFER3_ATI */ - { 7263, 0x00008829 }, /* GL_DRAW_BUFFER4_ARB */ - { 7283, 0x00008829 }, /* GL_DRAW_BUFFER4_ATI */ - { 7303, 0x0000882A }, /* GL_DRAW_BUFFER5_ARB */ - { 7323, 0x0000882A }, /* GL_DRAW_BUFFER5_ATI */ - { 7343, 0x0000882B }, /* GL_DRAW_BUFFER6_ARB */ - { 7363, 0x0000882B }, /* GL_DRAW_BUFFER6_ATI */ - { 7383, 0x0000882C }, /* GL_DRAW_BUFFER7_ARB */ - { 7403, 0x0000882C }, /* GL_DRAW_BUFFER7_ATI */ - { 7423, 0x0000882D }, /* GL_DRAW_BUFFER8_ARB */ - { 7443, 0x0000882D }, /* GL_DRAW_BUFFER8_ATI */ - { 7463, 0x0000882E }, /* GL_DRAW_BUFFER9_ARB */ - { 7483, 0x0000882E }, /* GL_DRAW_BUFFER9_ATI */ - { 7503, 0x00008CA6 }, /* GL_DRAW_FRAMEBUFFER_BINDING_EXT */ - { 7535, 0x00008CA9 }, /* GL_DRAW_FRAMEBUFFER_EXT */ - { 7559, 0x00000705 }, /* GL_DRAW_PIXEL_TOKEN */ - { 7579, 0x00000304 }, /* GL_DST_ALPHA */ - { 7592, 0x00000306 }, /* GL_DST_COLOR */ - { 7605, 0x000088EA }, /* GL_DYNAMIC_COPY */ - { 7621, 0x000088EA }, /* GL_DYNAMIC_COPY_ARB */ - { 7641, 0x000088E8 }, /* GL_DYNAMIC_DRAW */ - { 7657, 0x000088E8 }, /* GL_DYNAMIC_DRAW_ARB */ - { 7677, 0x000088E9 }, /* GL_DYNAMIC_READ */ - { 7693, 0x000088E9 }, /* GL_DYNAMIC_READ_ARB */ - { 7713, 0x00000B43 }, /* GL_EDGE_FLAG */ - { 7726, 0x00008079 }, /* GL_EDGE_FLAG_ARRAY */ - { 7745, 0x0000889B }, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING */ - { 7779, 0x0000889B }, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB */ - { 7817, 0x00008093 }, /* GL_EDGE_FLAG_ARRAY_POINTER */ - { 7844, 0x0000808C }, /* GL_EDGE_FLAG_ARRAY_STRIDE */ - { 7870, 0x00008893 }, /* GL_ELEMENT_ARRAY_BUFFER */ - { 7894, 0x00008893 }, /* GL_ELEMENT_ARRAY_BUFFER_ARB */ - { 7922, 0x00008895 }, /* GL_ELEMENT_ARRAY_BUFFER_BINDING */ - { 7954, 0x00008895 }, /* GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB */ - { 7990, 0x00001600 }, /* GL_EMISSION */ - { 8002, 0x00002000 }, /* GL_ENABLE_BIT */ - { 8016, 0x00000202 }, /* GL_EQUAL */ - { 8025, 0x00001509 }, /* GL_EQUIV */ - { 8034, 0x00010000 }, /* GL_EVAL_BIT */ - { 8046, 0x00000800 }, /* GL_EXP */ - { 8053, 0x00000801 }, /* GL_EXP2 */ - { 8061, 0x00001F03 }, /* GL_EXTENSIONS */ - { 8075, 0x00002400 }, /* GL_EYE_LINEAR */ - { 8089, 0x00002502 }, /* GL_EYE_PLANE */ - { 8102, 0x0000855C }, /* GL_EYE_PLANE_ABSOLUTE_NV */ - { 8127, 0x0000855B }, /* GL_EYE_RADIAL_NV */ - { 8144, 0x00000000 }, /* GL_FALSE */ - { 8153, 0x00001101 }, /* GL_FASTEST */ - { 8164, 0x00001C01 }, /* GL_FEEDBACK */ - { 8176, 0x00000DF0 }, /* GL_FEEDBACK_BUFFER_POINTER */ - { 8203, 0x00000DF1 }, /* GL_FEEDBACK_BUFFER_SIZE */ - { 8227, 0x00000DF2 }, /* GL_FEEDBACK_BUFFER_TYPE */ - { 8251, 0x00001B02 }, /* GL_FILL */ - { 8259, 0x00001D00 }, /* GL_FLAT */ - { 8267, 0x00001406 }, /* GL_FLOAT */ - { 8276, 0x00008B5A }, /* GL_FLOAT_MAT2_ARB */ - { 8294, 0x00008B5B }, /* GL_FLOAT_MAT3_ARB */ - { 8312, 0x00008B5C }, /* GL_FLOAT_MAT4_ARB */ - { 8330, 0x00008B50 }, /* GL_FLOAT_VEC2_ARB */ - { 8348, 0x00008B51 }, /* GL_FLOAT_VEC3_ARB */ - { 8366, 0x00008B52 }, /* GL_FLOAT_VEC4_ARB */ - { 8384, 0x00000B60 }, /* GL_FOG */ - { 8391, 0x00000080 }, /* GL_FOG_BIT */ - { 8402, 0x00000B66 }, /* GL_FOG_COLOR */ - { 8415, 0x00008451 }, /* GL_FOG_COORD */ - { 8428, 0x00008451 }, /* GL_FOG_COORDINATE */ - { 8446, 0x00008457 }, /* GL_FOG_COORDINATE_ARRAY */ - { 8470, 0x0000889D }, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING */ - { 8509, 0x0000889D }, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB */ - { 8552, 0x00008456 }, /* GL_FOG_COORDINATE_ARRAY_POINTER */ - { 8584, 0x00008455 }, /* GL_FOG_COORDINATE_ARRAY_STRIDE */ - { 8615, 0x00008454 }, /* GL_FOG_COORDINATE_ARRAY_TYPE */ - { 8644, 0x00008450 }, /* GL_FOG_COORDINATE_SOURCE */ - { 8669, 0x00008457 }, /* GL_FOG_COORD_ARRAY */ - { 8688, 0x0000889D }, /* GL_FOG_COORD_ARRAY_BUFFER_BINDING */ - { 8722, 0x00008456 }, /* GL_FOG_COORD_ARRAY_POINTER */ - { 8749, 0x00008455 }, /* GL_FOG_COORD_ARRAY_STRIDE */ - { 8775, 0x00008454 }, /* GL_FOG_COORD_ARRAY_TYPE */ - { 8799, 0x00008450 }, /* GL_FOG_COORD_SRC */ - { 8816, 0x00000B62 }, /* GL_FOG_DENSITY */ - { 8831, 0x0000855A }, /* GL_FOG_DISTANCE_MODE_NV */ - { 8855, 0x00000B64 }, /* GL_FOG_END */ - { 8866, 0x00000C54 }, /* GL_FOG_HINT */ - { 8878, 0x00000B61 }, /* GL_FOG_INDEX */ - { 8891, 0x00000B65 }, /* GL_FOG_MODE */ - { 8903, 0x00008198 }, /* GL_FOG_OFFSET_SGIX */ - { 8922, 0x00008199 }, /* GL_FOG_OFFSET_VALUE_SGIX */ - { 8947, 0x00000B63 }, /* GL_FOG_START */ - { 8960, 0x00008452 }, /* GL_FRAGMENT_DEPTH */ - { 8978, 0x00008804 }, /* GL_FRAGMENT_PROGRAM_ARB */ - { 9002, 0x00008B30 }, /* GL_FRAGMENT_SHADER_ARB */ - { 9025, 0x00008CD1 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT */ - { 9067, 0x00008CD0 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT */ - { 9109, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT */ - { 9158, 0x00008CD3 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT */ - { 9210, 0x00008CD2 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT */ - { 9254, 0x00008CA6 }, /* GL_FRAMEBUFFER_BINDING_EXT */ - { 9281, 0x00008CD5 }, /* GL_FRAMEBUFFER_COMPLETE_EXT */ - { 9309, 0x00008D40 }, /* GL_FRAMEBUFFER_EXT */ - { 9328, 0x00008CD6 }, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT */ - { 9369, 0x00008CD9 }, /* GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT */ - { 9410, 0x00008CDB }, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT */ - { 9452, 0x00008CD8 }, /* GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT */ - { 9503, 0x00008CDA }, /* GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT */ - { 9541, 0x00008CD7 }, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT */ - { 9590, 0x00008CDC }, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT */ - { 9632, 0x00008CDE }, /* GL_FRAMEBUFFER_STATUS_ERROR_EXT */ - { 9664, 0x00008CDD }, /* GL_FRAMEBUFFER_UNSUPPORTED_EXT */ - { 9695, 0x00000404 }, /* GL_FRONT */ - { 9704, 0x00000408 }, /* GL_FRONT_AND_BACK */ - { 9722, 0x00000B46 }, /* GL_FRONT_FACE */ - { 9736, 0x00000400 }, /* GL_FRONT_LEFT */ - { 9750, 0x00000401 }, /* GL_FRONT_RIGHT */ - { 9765, 0x00008006 }, /* GL_FUNC_ADD */ - { 9777, 0x00008006 }, /* GL_FUNC_ADD_EXT */ - { 9793, 0x0000800B }, /* GL_FUNC_REVERSE_SUBTRACT */ - { 9818, 0x0000800B }, /* GL_FUNC_REVERSE_SUBTRACT_EXT */ - { 9847, 0x0000800A }, /* GL_FUNC_SUBTRACT */ - { 9864, 0x0000800A }, /* GL_FUNC_SUBTRACT_EXT */ - { 9885, 0x00008191 }, /* GL_GENERATE_MIPMAP */ - { 9904, 0x00008192 }, /* GL_GENERATE_MIPMAP_HINT */ - { 9928, 0x00008192 }, /* GL_GENERATE_MIPMAP_HINT_SGIS */ - { 9957, 0x00008191 }, /* GL_GENERATE_MIPMAP_SGIS */ - { 9981, 0x00000206 }, /* GL_GEQUAL */ - { 9991, 0x00000204 }, /* GL_GREATER */ - { 10002, 0x00001904 }, /* GL_GREEN */ - { 10011, 0x00000D19 }, /* GL_GREEN_BIAS */ - { 10025, 0x00000D53 }, /* GL_GREEN_BITS */ - { 10039, 0x00000D18 }, /* GL_GREEN_SCALE */ - { 10054, 0x00008000 }, /* GL_HINT_BIT */ - { 10066, 0x00008024 }, /* GL_HISTOGRAM */ - { 10079, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE */ - { 10103, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE_EXT */ - { 10131, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE */ - { 10154, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE_EXT */ - { 10181, 0x00008024 }, /* GL_HISTOGRAM_EXT */ - { 10198, 0x00008027 }, /* GL_HISTOGRAM_FORMAT */ - { 10218, 0x00008027 }, /* GL_HISTOGRAM_FORMAT_EXT */ - { 10242, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE */ - { 10266, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE_EXT */ - { 10294, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE */ - { 10322, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE_EXT */ - { 10354, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE */ - { 10376, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE_EXT */ - { 10402, 0x0000802D }, /* GL_HISTOGRAM_SINK */ - { 10420, 0x0000802D }, /* GL_HISTOGRAM_SINK_EXT */ - { 10442, 0x00008026 }, /* GL_HISTOGRAM_WIDTH */ - { 10461, 0x00008026 }, /* GL_HISTOGRAM_WIDTH_EXT */ - { 10484, 0x0000862A }, /* GL_IDENTITY_NV */ - { 10499, 0x00008150 }, /* GL_IGNORE_BORDER_HP */ - { 10519, 0x00008B9B }, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */ - { 10559, 0x00008B9A }, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */ - { 10597, 0x00001E02 }, /* GL_INCR */ - { 10605, 0x00008507 }, /* GL_INCR_WRAP */ - { 10618, 0x00008507 }, /* GL_INCR_WRAP_EXT */ - { 10635, 0x00008077 }, /* GL_INDEX_ARRAY */ - { 10650, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING */ - { 10680, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING_ARB */ - { 10714, 0x00008091 }, /* GL_INDEX_ARRAY_POINTER */ - { 10737, 0x00008086 }, /* GL_INDEX_ARRAY_STRIDE */ - { 10759, 0x00008085 }, /* GL_INDEX_ARRAY_TYPE */ - { 10779, 0x00000D51 }, /* GL_INDEX_BITS */ - { 10793, 0x00000C20 }, /* GL_INDEX_CLEAR_VALUE */ - { 10814, 0x00000BF1 }, /* GL_INDEX_LOGIC_OP */ - { 10832, 0x00000C30 }, /* GL_INDEX_MODE */ - { 10846, 0x00000D13 }, /* GL_INDEX_OFFSET */ - { 10862, 0x00000D12 }, /* GL_INDEX_SHIFT */ - { 10877, 0x00000C21 }, /* GL_INDEX_WRITEMASK */ - { 10896, 0x00001404 }, /* GL_INT */ - { 10903, 0x00008049 }, /* GL_INTENSITY */ - { 10916, 0x0000804C }, /* GL_INTENSITY12 */ - { 10931, 0x0000804C }, /* GL_INTENSITY12_EXT */ - { 10950, 0x0000804D }, /* GL_INTENSITY16 */ - { 10965, 0x0000804D }, /* GL_INTENSITY16_EXT */ - { 10984, 0x0000804A }, /* GL_INTENSITY4 */ - { 10998, 0x0000804A }, /* GL_INTENSITY4_EXT */ - { 11016, 0x0000804B }, /* GL_INTENSITY8 */ - { 11030, 0x0000804B }, /* GL_INTENSITY8_EXT */ - { 11048, 0x00008049 }, /* GL_INTENSITY_EXT */ - { 11065, 0x00008575 }, /* GL_INTERPOLATE */ - { 11080, 0x00008575 }, /* GL_INTERPOLATE_ARB */ - { 11099, 0x00008575 }, /* GL_INTERPOLATE_EXT */ - { 11118, 0x00008B53 }, /* GL_INT_VEC2_ARB */ - { 11134, 0x00008B54 }, /* GL_INT_VEC3_ARB */ - { 11150, 0x00008B55 }, /* GL_INT_VEC4_ARB */ - { 11166, 0x00000500 }, /* GL_INVALID_ENUM */ - { 11182, 0x00000506 }, /* GL_INVALID_FRAMEBUFFER_OPERATION_EXT */ - { 11219, 0x00000502 }, /* GL_INVALID_OPERATION */ - { 11240, 0x00000501 }, /* GL_INVALID_VALUE */ - { 11257, 0x0000862B }, /* GL_INVERSE_NV */ - { 11271, 0x0000862D }, /* GL_INVERSE_TRANSPOSE_NV */ - { 11295, 0x0000150A }, /* GL_INVERT */ - { 11305, 0x00001E00 }, /* GL_KEEP */ - { 11313, 0x00000406 }, /* GL_LEFT */ - { 11321, 0x00000203 }, /* GL_LEQUAL */ - { 11331, 0x00000201 }, /* GL_LESS */ - { 11339, 0x00004000 }, /* GL_LIGHT0 */ - { 11349, 0x00004001 }, /* GL_LIGHT1 */ - { 11359, 0x00004002 }, /* GL_LIGHT2 */ - { 11369, 0x00004003 }, /* GL_LIGHT3 */ - { 11379, 0x00004004 }, /* GL_LIGHT4 */ - { 11389, 0x00004005 }, /* GL_LIGHT5 */ - { 11399, 0x00004006 }, /* GL_LIGHT6 */ - { 11409, 0x00004007 }, /* GL_LIGHT7 */ - { 11419, 0x00000B50 }, /* GL_LIGHTING */ - { 11431, 0x00000040 }, /* GL_LIGHTING_BIT */ - { 11447, 0x00000B53 }, /* GL_LIGHT_MODEL_AMBIENT */ - { 11470, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL */ - { 11499, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL_EXT */ - { 11532, 0x00000B51 }, /* GL_LIGHT_MODEL_LOCAL_VIEWER */ - { 11560, 0x00000B52 }, /* GL_LIGHT_MODEL_TWO_SIDE */ - { 11584, 0x00001B01 }, /* GL_LINE */ - { 11592, 0x00002601 }, /* GL_LINEAR */ - { 11602, 0x00001208 }, /* GL_LINEAR_ATTENUATION */ - { 11624, 0x00008170 }, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */ - { 11654, 0x0000844F }, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */ - { 11685, 0x00002703 }, /* GL_LINEAR_MIPMAP_LINEAR */ - { 11709, 0x00002701 }, /* GL_LINEAR_MIPMAP_NEAREST */ - { 11734, 0x00000001 }, /* GL_LINES */ - { 11743, 0x00000004 }, /* GL_LINE_BIT */ - { 11755, 0x00000002 }, /* GL_LINE_LOOP */ - { 11768, 0x00000707 }, /* GL_LINE_RESET_TOKEN */ - { 11788, 0x00000B20 }, /* GL_LINE_SMOOTH */ - { 11803, 0x00000C52 }, /* GL_LINE_SMOOTH_HINT */ - { 11823, 0x00000B24 }, /* GL_LINE_STIPPLE */ - { 11839, 0x00000B25 }, /* GL_LINE_STIPPLE_PATTERN */ - { 11863, 0x00000B26 }, /* GL_LINE_STIPPLE_REPEAT */ - { 11886, 0x00000003 }, /* GL_LINE_STRIP */ - { 11900, 0x00000702 }, /* GL_LINE_TOKEN */ - { 11914, 0x00000B21 }, /* GL_LINE_WIDTH */ - { 11928, 0x00000B23 }, /* GL_LINE_WIDTH_GRANULARITY */ - { 11954, 0x00000B22 }, /* GL_LINE_WIDTH_RANGE */ - { 11974, 0x00000B32 }, /* GL_LIST_BASE */ - { 11987, 0x00020000 }, /* GL_LIST_BIT */ - { 11999, 0x00000B33 }, /* GL_LIST_INDEX */ - { 12013, 0x00000B30 }, /* GL_LIST_MODE */ - { 12026, 0x00000101 }, /* GL_LOAD */ - { 12034, 0x00000BF1 }, /* GL_LOGIC_OP */ - { 12046, 0x00000BF0 }, /* GL_LOGIC_OP_MODE */ - { 12063, 0x00001909 }, /* GL_LUMINANCE */ - { 12076, 0x00008041 }, /* GL_LUMINANCE12 */ - { 12091, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12 */ - { 12114, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12_EXT */ - { 12141, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4 */ - { 12163, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4_EXT */ - { 12189, 0x00008041 }, /* GL_LUMINANCE12_EXT */ - { 12208, 0x00008042 }, /* GL_LUMINANCE16 */ - { 12223, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16 */ - { 12246, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16_EXT */ - { 12273, 0x00008042 }, /* GL_LUMINANCE16_EXT */ - { 12292, 0x0000803F }, /* GL_LUMINANCE4 */ - { 12306, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4 */ - { 12327, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4_EXT */ - { 12352, 0x0000803F }, /* GL_LUMINANCE4_EXT */ - { 12370, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2 */ - { 12391, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2_EXT */ - { 12416, 0x00008040 }, /* GL_LUMINANCE8 */ - { 12430, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8 */ - { 12451, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8_EXT */ - { 12476, 0x00008040 }, /* GL_LUMINANCE8_EXT */ - { 12494, 0x0000190A }, /* GL_LUMINANCE_ALPHA */ - { 12513, 0x00000D90 }, /* GL_MAP1_COLOR_4 */ - { 12529, 0x00000DD0 }, /* GL_MAP1_GRID_DOMAIN */ - { 12549, 0x00000DD1 }, /* GL_MAP1_GRID_SEGMENTS */ - { 12571, 0x00000D91 }, /* GL_MAP1_INDEX */ - { 12585, 0x00000D92 }, /* GL_MAP1_NORMAL */ - { 12600, 0x00000D93 }, /* GL_MAP1_TEXTURE_COORD_1 */ - { 12624, 0x00000D94 }, /* GL_MAP1_TEXTURE_COORD_2 */ - { 12648, 0x00000D95 }, /* GL_MAP1_TEXTURE_COORD_3 */ - { 12672, 0x00000D96 }, /* GL_MAP1_TEXTURE_COORD_4 */ - { 12696, 0x00000D97 }, /* GL_MAP1_VERTEX_3 */ - { 12713, 0x00000D98 }, /* GL_MAP1_VERTEX_4 */ - { 12730, 0x00008660 }, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */ - { 12758, 0x0000866A }, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */ - { 12787, 0x0000866B }, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */ - { 12816, 0x0000866C }, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */ - { 12845, 0x0000866D }, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */ - { 12874, 0x0000866E }, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */ - { 12903, 0x0000866F }, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */ - { 12932, 0x00008661 }, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */ - { 12960, 0x00008662 }, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */ - { 12988, 0x00008663 }, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */ - { 13016, 0x00008664 }, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */ - { 13044, 0x00008665 }, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */ - { 13072, 0x00008666 }, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */ - { 13100, 0x00008667 }, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */ - { 13128, 0x00008668 }, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */ - { 13156, 0x00008669 }, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */ - { 13184, 0x00000DB0 }, /* GL_MAP2_COLOR_4 */ - { 13200, 0x00000DD2 }, /* GL_MAP2_GRID_DOMAIN */ - { 13220, 0x00000DD3 }, /* GL_MAP2_GRID_SEGMENTS */ - { 13242, 0x00000DB1 }, /* GL_MAP2_INDEX */ - { 13256, 0x00000DB2 }, /* GL_MAP2_NORMAL */ - { 13271, 0x00000DB3 }, /* GL_MAP2_TEXTURE_COORD_1 */ - { 13295, 0x00000DB4 }, /* GL_MAP2_TEXTURE_COORD_2 */ - { 13319, 0x00000DB5 }, /* GL_MAP2_TEXTURE_COORD_3 */ - { 13343, 0x00000DB6 }, /* GL_MAP2_TEXTURE_COORD_4 */ - { 13367, 0x00000DB7 }, /* GL_MAP2_VERTEX_3 */ - { 13384, 0x00000DB8 }, /* GL_MAP2_VERTEX_4 */ - { 13401, 0x00008670 }, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */ - { 13429, 0x0000867A }, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */ - { 13458, 0x0000867B }, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */ - { 13487, 0x0000867C }, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */ - { 13516, 0x0000867D }, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */ - { 13545, 0x0000867E }, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */ - { 13574, 0x0000867F }, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */ - { 13603, 0x00008671 }, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */ - { 13631, 0x00008672 }, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */ - { 13659, 0x00008673 }, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */ - { 13687, 0x00008674 }, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */ - { 13715, 0x00008675 }, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */ - { 13743, 0x00008676 }, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */ - { 13771, 0x00008677 }, /* GL_MAP2_VERTEX_ATTRIB7_4_NV */ - { 13799, 0x00008678 }, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */ - { 13827, 0x00008679 }, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */ - { 13855, 0x00000D10 }, /* GL_MAP_COLOR */ - { 13868, 0x00000D11 }, /* GL_MAP_STENCIL */ - { 13883, 0x000088C0 }, /* GL_MATRIX0_ARB */ - { 13898, 0x00008630 }, /* GL_MATRIX0_NV */ - { 13912, 0x000088CA }, /* GL_MATRIX10_ARB */ - { 13928, 0x000088CB }, /* GL_MATRIX11_ARB */ - { 13944, 0x000088CC }, /* GL_MATRIX12_ARB */ - { 13960, 0x000088CD }, /* GL_MATRIX13_ARB */ - { 13976, 0x000088CE }, /* GL_MATRIX14_ARB */ - { 13992, 0x000088CF }, /* GL_MATRIX15_ARB */ - { 14008, 0x000088D0 }, /* GL_MATRIX16_ARB */ - { 14024, 0x000088D1 }, /* GL_MATRIX17_ARB */ - { 14040, 0x000088D2 }, /* GL_MATRIX18_ARB */ - { 14056, 0x000088D3 }, /* GL_MATRIX19_ARB */ - { 14072, 0x000088C1 }, /* GL_MATRIX1_ARB */ - { 14087, 0x00008631 }, /* GL_MATRIX1_NV */ - { 14101, 0x000088D4 }, /* GL_MATRIX20_ARB */ - { 14117, 0x000088D5 }, /* GL_MATRIX21_ARB */ - { 14133, 0x000088D6 }, /* GL_MATRIX22_ARB */ - { 14149, 0x000088D7 }, /* GL_MATRIX23_ARB */ - { 14165, 0x000088D8 }, /* GL_MATRIX24_ARB */ - { 14181, 0x000088D9 }, /* GL_MATRIX25_ARB */ - { 14197, 0x000088DA }, /* GL_MATRIX26_ARB */ - { 14213, 0x000088DB }, /* GL_MATRIX27_ARB */ - { 14229, 0x000088DC }, /* GL_MATRIX28_ARB */ - { 14245, 0x000088DD }, /* GL_MATRIX29_ARB */ - { 14261, 0x000088C2 }, /* GL_MATRIX2_ARB */ - { 14276, 0x00008632 }, /* GL_MATRIX2_NV */ - { 14290, 0x000088DE }, /* GL_MATRIX30_ARB */ - { 14306, 0x000088DF }, /* GL_MATRIX31_ARB */ - { 14322, 0x000088C3 }, /* GL_MATRIX3_ARB */ - { 14337, 0x00008633 }, /* GL_MATRIX3_NV */ - { 14351, 0x000088C4 }, /* GL_MATRIX4_ARB */ - { 14366, 0x00008634 }, /* GL_MATRIX4_NV */ - { 14380, 0x000088C5 }, /* GL_MATRIX5_ARB */ - { 14395, 0x00008635 }, /* GL_MATRIX5_NV */ - { 14409, 0x000088C6 }, /* GL_MATRIX6_ARB */ - { 14424, 0x00008636 }, /* GL_MATRIX6_NV */ - { 14438, 0x000088C7 }, /* GL_MATRIX7_ARB */ - { 14453, 0x00008637 }, /* GL_MATRIX7_NV */ - { 14467, 0x000088C8 }, /* GL_MATRIX8_ARB */ - { 14482, 0x000088C9 }, /* GL_MATRIX9_ARB */ - { 14497, 0x00008844 }, /* GL_MATRIX_INDEX_ARRAY_ARB */ - { 14523, 0x00008849 }, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */ - { 14557, 0x00008846 }, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */ - { 14588, 0x00008848 }, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */ - { 14621, 0x00008847 }, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */ - { 14652, 0x00000BA0 }, /* GL_MATRIX_MODE */ - { 14667, 0x00008840 }, /* GL_MATRIX_PALETTE_ARB */ - { 14689, 0x00008008 }, /* GL_MAX */ - { 14696, 0x00008073 }, /* GL_MAX_3D_TEXTURE_SIZE */ - { 14719, 0x00000D35 }, /* GL_MAX_ATTRIB_STACK_DEPTH */ - { 14745, 0x00000D3B }, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */ - { 14778, 0x00008177 }, /* GL_MAX_CLIPMAP_DEPTH_SGIX */ - { 14804, 0x00008178 }, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */ - { 14838, 0x00000D32 }, /* GL_MAX_CLIP_PLANES */ - { 14857, 0x00008CDF }, /* GL_MAX_COLOR_ATTACHMENTS_EXT */ - { 14886, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */ - { 14918, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI */ - { 14954, 0x00008B4D }, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB */ - { 14994, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT */ - { 15020, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT_EXT */ - { 15050, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH */ - { 15075, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH_EXT */ - { 15104, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */ - { 15133, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB */ - { 15166, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ARB */ - { 15190, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ATI */ - { 15214, 0x000080E9 }, /* GL_MAX_ELEMENTS_INDICES */ - { 15238, 0x000080E8 }, /* GL_MAX_ELEMENTS_VERTICES */ - { 15263, 0x00000D30 }, /* GL_MAX_EVAL_ORDER */ - { 15281, 0x00008008 }, /* GL_MAX_EXT */ - { 15292, 0x00008B49 }, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB */ - { 15331, 0x00000D31 }, /* GL_MAX_LIGHTS */ - { 15345, 0x00000B31 }, /* GL_MAX_LIST_NESTING */ - { 15365, 0x00008841 }, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */ - { 15403, 0x00000D36 }, /* GL_MAX_MODELVIEW_STACK_DEPTH */ - { 15432, 0x00000D37 }, /* GL_MAX_NAME_STACK_DEPTH */ - { 15456, 0x00008842 }, /* GL_MAX_PALETTE_MATRICES_ARB */ - { 15484, 0x00000D34 }, /* GL_MAX_PIXEL_MAP_TABLE */ - { 15507, 0x000088B1 }, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */ - { 15544, 0x0000880B }, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */ - { 15580, 0x000088AD }, /* GL_MAX_PROGRAM_ATTRIBS_ARB */ - { 15607, 0x000088F5 }, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */ - { 15636, 0x000088B5 }, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */ - { 15670, 0x000088F4 }, /* GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */ - { 15706, 0x000088F6 }, /* GL_MAX_PROGRAM_IF_DEPTH_NV */ - { 15733, 0x000088A1 }, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */ - { 15765, 0x000088B4 }, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */ - { 15801, 0x000088F8 }, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */ - { 15830, 0x000088F7 }, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */ - { 15859, 0x0000862F }, /* GL_MAX_PROGRAM_MATRICES_ARB */ - { 15887, 0x0000862E }, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */ - { 15925, 0x000088B3 }, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ - { 15969, 0x0000880E }, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ - { 16012, 0x000088AF }, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */ - { 16046, 0x000088A3 }, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ - { 16085, 0x000088AB }, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */ - { 16122, 0x000088A7 }, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */ - { 16160, 0x00008810 }, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ - { 16203, 0x0000880F }, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ - { 16246, 0x000088A9 }, /* GL_MAX_PROGRAM_PARAMETERS_ARB */ - { 16276, 0x000088A5 }, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */ - { 16307, 0x0000880D }, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */ - { 16343, 0x0000880C }, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */ - { 16379, 0x00000D38 }, /* GL_MAX_PROJECTION_STACK_DEPTH */ - { 16409, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB */ - { 16443, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_NV */ - { 16476, 0x000084E8 }, /* GL_MAX_RENDERBUFFER_SIZE_EXT */ - { 16505, 0x00008504 }, /* GL_MAX_SHININESS_NV */ - { 16525, 0x00008505 }, /* GL_MAX_SPOT_EXPONENT_NV */ - { 16549, 0x00008871 }, /* GL_MAX_TEXTURE_COORDS_ARB */ - { 16575, 0x00008872 }, /* GL_MAX_TEXTURE_IMAGE_UNITS_ARB */ - { 16606, 0x000084FD }, /* GL_MAX_TEXTURE_LOD_BIAS */ - { 16630, 0x000084FF }, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */ - { 16664, 0x00000D33 }, /* GL_MAX_TEXTURE_SIZE */ - { 16684, 0x00000D39 }, /* GL_MAX_TEXTURE_STACK_DEPTH */ - { 16711, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS */ - { 16732, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS_ARB */ - { 16757, 0x0000862F }, /* GL_MAX_TRACK_MATRICES_NV */ - { 16782, 0x0000862E }, /* GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV */ - { 16817, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS_ARB */ - { 16843, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS_ARB */ - { 16869, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */ - { 16907, 0x00008B4A }, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB */ - { 16944, 0x000086A4 }, /* GL_MAX_VERTEX_UNITS_ARB */ - { 16968, 0x00000D3A }, /* GL_MAX_VIEWPORT_DIMS */ - { 16989, 0x00008007 }, /* GL_MIN */ - { 16996, 0x0000802E }, /* GL_MINMAX */ - { 17006, 0x0000802E }, /* GL_MINMAX_EXT */ - { 17020, 0x0000802F }, /* GL_MINMAX_FORMAT */ - { 17037, 0x0000802F }, /* GL_MINMAX_FORMAT_EXT */ - { 17058, 0x00008030 }, /* GL_MINMAX_SINK */ - { 17073, 0x00008030 }, /* GL_MINMAX_SINK_EXT */ - { 17092, 0x00008007 }, /* GL_MIN_EXT */ - { 17103, 0x00008370 }, /* GL_MIRRORED_REPEAT */ - { 17122, 0x00008370 }, /* GL_MIRRORED_REPEAT_ARB */ - { 17145, 0x00008370 }, /* GL_MIRRORED_REPEAT_IBM */ - { 17168, 0x00008742 }, /* GL_MIRROR_CLAMP_ATI */ - { 17188, 0x00008742 }, /* GL_MIRROR_CLAMP_EXT */ - { 17208, 0x00008912 }, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */ - { 17238, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_ATI */ - { 17266, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */ - { 17294, 0x00001700 }, /* GL_MODELVIEW */ - { 17307, 0x00001700 }, /* GL_MODELVIEW0_ARB */ - { 17325, 0x0000872A }, /* GL_MODELVIEW10_ARB */ - { 17344, 0x0000872B }, /* GL_MODELVIEW11_ARB */ - { 17363, 0x0000872C }, /* GL_MODELVIEW12_ARB */ - { 17382, 0x0000872D }, /* GL_MODELVIEW13_ARB */ - { 17401, 0x0000872E }, /* GL_MODELVIEW14_ARB */ - { 17420, 0x0000872F }, /* GL_MODELVIEW15_ARB */ - { 17439, 0x00008730 }, /* GL_MODELVIEW16_ARB */ - { 17458, 0x00008731 }, /* GL_MODELVIEW17_ARB */ - { 17477, 0x00008732 }, /* GL_MODELVIEW18_ARB */ - { 17496, 0x00008733 }, /* GL_MODELVIEW19_ARB */ - { 17515, 0x0000850A }, /* GL_MODELVIEW1_ARB */ - { 17533, 0x00008734 }, /* GL_MODELVIEW20_ARB */ - { 17552, 0x00008735 }, /* GL_MODELVIEW21_ARB */ - { 17571, 0x00008736 }, /* GL_MODELVIEW22_ARB */ - { 17590, 0x00008737 }, /* GL_MODELVIEW23_ARB */ - { 17609, 0x00008738 }, /* GL_MODELVIEW24_ARB */ - { 17628, 0x00008739 }, /* GL_MODELVIEW25_ARB */ - { 17647, 0x0000873A }, /* GL_MODELVIEW26_ARB */ - { 17666, 0x0000873B }, /* GL_MODELVIEW27_ARB */ - { 17685, 0x0000873C }, /* GL_MODELVIEW28_ARB */ - { 17704, 0x0000873D }, /* GL_MODELVIEW29_ARB */ - { 17723, 0x00008722 }, /* GL_MODELVIEW2_ARB */ - { 17741, 0x0000873E }, /* GL_MODELVIEW30_ARB */ - { 17760, 0x0000873F }, /* GL_MODELVIEW31_ARB */ - { 17779, 0x00008723 }, /* GL_MODELVIEW3_ARB */ - { 17797, 0x00008724 }, /* GL_MODELVIEW4_ARB */ - { 17815, 0x00008725 }, /* GL_MODELVIEW5_ARB */ - { 17833, 0x00008726 }, /* GL_MODELVIEW6_ARB */ - { 17851, 0x00008727 }, /* GL_MODELVIEW7_ARB */ - { 17869, 0x00008728 }, /* GL_MODELVIEW8_ARB */ - { 17887, 0x00008729 }, /* GL_MODELVIEW9_ARB */ - { 17905, 0x00000BA6 }, /* GL_MODELVIEW_MATRIX */ - { 17925, 0x00008629 }, /* GL_MODELVIEW_PROJECTION_NV */ - { 17952, 0x00000BA3 }, /* GL_MODELVIEW_STACK_DEPTH */ - { 17977, 0x00002100 }, /* GL_MODULATE */ - { 17989, 0x00008744 }, /* GL_MODULATE_ADD_ATI */ - { 18009, 0x00008745 }, /* GL_MODULATE_SIGNED_ADD_ATI */ - { 18036, 0x00008746 }, /* GL_MODULATE_SUBTRACT_ATI */ - { 18061, 0x00000103 }, /* GL_MULT */ - { 18069, 0x0000809D }, /* GL_MULTISAMPLE */ - { 18084, 0x000086B2 }, /* GL_MULTISAMPLE_3DFX */ - { 18104, 0x0000809D }, /* GL_MULTISAMPLE_ARB */ - { 18123, 0x20000000 }, /* GL_MULTISAMPLE_BIT */ - { 18142, 0x20000000 }, /* GL_MULTISAMPLE_BIT_3DFX */ - { 18166, 0x20000000 }, /* GL_MULTISAMPLE_BIT_ARB */ - { 18189, 0x00008534 }, /* GL_MULTISAMPLE_FILTER_HINT_NV */ - { 18219, 0x00002A25 }, /* GL_N3F_V3F */ - { 18230, 0x00000D70 }, /* GL_NAME_STACK_DEPTH */ - { 18250, 0x0000150E }, /* GL_NAND */ - { 18258, 0x00002600 }, /* GL_NEAREST */ - { 18269, 0x0000844E }, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */ - { 18300, 0x0000844D }, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */ - { 18332, 0x00002702 }, /* GL_NEAREST_MIPMAP_LINEAR */ - { 18357, 0x00002700 }, /* GL_NEAREST_MIPMAP_NEAREST */ - { 18383, 0x00000200 }, /* GL_NEVER */ - { 18392, 0x00001102 }, /* GL_NICEST */ - { 18402, 0x00000000 }, /* GL_NONE */ - { 18410, 0x00001505 }, /* GL_NOOP */ - { 18418, 0x00001508 }, /* GL_NOR */ - { 18425, 0x00000BA1 }, /* GL_NORMALIZE */ - { 18438, 0x00008075 }, /* GL_NORMAL_ARRAY */ - { 18454, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING */ - { 18485, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING_ARB */ - { 18520, 0x0000808F }, /* GL_NORMAL_ARRAY_POINTER */ - { 18544, 0x0000807F }, /* GL_NORMAL_ARRAY_STRIDE */ - { 18567, 0x0000807E }, /* GL_NORMAL_ARRAY_TYPE */ - { 18588, 0x00008511 }, /* GL_NORMAL_MAP */ - { 18602, 0x00008511 }, /* GL_NORMAL_MAP_ARB */ - { 18620, 0x00008511 }, /* GL_NORMAL_MAP_NV */ - { 18637, 0x00000205 }, /* GL_NOTEQUAL */ - { 18649, 0x00000000 }, /* GL_NO_ERROR */ - { 18661, 0x000086A2 }, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */ - { 18695, 0x000086A2 }, /* GL_NUM_TEXTURE_COMPRESSED_FORMATS_ARB */ - { 18733, 0x00008B89 }, /* GL_OBJECT_ACTIVE_ATTRIBUTES_ARB */ - { 18765, 0x00008B8A }, /* GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB */ - { 18807, 0x00008B86 }, /* GL_OBJECT_ACTIVE_UNIFORMS_ARB */ - { 18837, 0x00008B87 }, /* GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB */ - { 18877, 0x00008B85 }, /* GL_OBJECT_ATTACHED_OBJECTS_ARB */ - { 18908, 0x00008B81 }, /* GL_OBJECT_COMPILE_STATUS_ARB */ - { 18937, 0x00008B80 }, /* GL_OBJECT_DELETE_STATUS_ARB */ - { 18965, 0x00008B84 }, /* GL_OBJECT_INFO_LOG_LENGTH_ARB */ - { 18995, 0x00002401 }, /* GL_OBJECT_LINEAR */ - { 19012, 0x00008B82 }, /* GL_OBJECT_LINK_STATUS_ARB */ - { 19038, 0x00002501 }, /* GL_OBJECT_PLANE */ - { 19054, 0x00008B88 }, /* GL_OBJECT_SHADER_SOURCE_LENGTH_ARB */ - { 19089, 0x00008B4F }, /* GL_OBJECT_SUBTYPE_ARB */ - { 19111, 0x00008B4E }, /* GL_OBJECT_TYPE_ARB */ - { 19130, 0x00008B83 }, /* GL_OBJECT_VALIDATE_STATUS_ARB */ - { 19160, 0x00008165 }, /* GL_OCCLUSION_TEST_HP */ - { 19181, 0x00008166 }, /* GL_OCCLUSION_TEST_RESULT_HP */ - { 19209, 0x00000001 }, /* GL_ONE */ - { 19216, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA */ - { 19244, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA_EXT */ - { 19276, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR */ - { 19304, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR_EXT */ - { 19336, 0x00000305 }, /* GL_ONE_MINUS_DST_ALPHA */ - { 19359, 0x00000307 }, /* GL_ONE_MINUS_DST_COLOR */ - { 19382, 0x00000303 }, /* GL_ONE_MINUS_SRC_ALPHA */ - { 19405, 0x00000301 }, /* GL_ONE_MINUS_SRC_COLOR */ - { 19428, 0x00008598 }, /* GL_OPERAND0_ALPHA */ - { 19446, 0x00008598 }, /* GL_OPERAND0_ALPHA_ARB */ - { 19468, 0x00008598 }, /* GL_OPERAND0_ALPHA_EXT */ - { 19490, 0x00008590 }, /* GL_OPERAND0_RGB */ - { 19506, 0x00008590 }, /* GL_OPERAND0_RGB_ARB */ - { 19526, 0x00008590 }, /* GL_OPERAND0_RGB_EXT */ - { 19546, 0x00008599 }, /* GL_OPERAND1_ALPHA */ - { 19564, 0x00008599 }, /* GL_OPERAND1_ALPHA_ARB */ - { 19586, 0x00008599 }, /* GL_OPERAND1_ALPHA_EXT */ - { 19608, 0x00008591 }, /* GL_OPERAND1_RGB */ - { 19624, 0x00008591 }, /* GL_OPERAND1_RGB_ARB */ - { 19644, 0x00008591 }, /* GL_OPERAND1_RGB_EXT */ - { 19664, 0x0000859A }, /* GL_OPERAND2_ALPHA */ - { 19682, 0x0000859A }, /* GL_OPERAND2_ALPHA_ARB */ - { 19704, 0x0000859A }, /* GL_OPERAND2_ALPHA_EXT */ - { 19726, 0x00008592 }, /* GL_OPERAND2_RGB */ - { 19742, 0x00008592 }, /* GL_OPERAND2_RGB_ARB */ - { 19762, 0x00008592 }, /* GL_OPERAND2_RGB_EXT */ - { 19782, 0x0000859B }, /* GL_OPERAND3_ALPHA_NV */ - { 19803, 0x00008593 }, /* GL_OPERAND3_RGB_NV */ - { 19822, 0x00001507 }, /* GL_OR */ - { 19828, 0x00000A01 }, /* GL_ORDER */ - { 19837, 0x0000150D }, /* GL_OR_INVERTED */ - { 19852, 0x0000150B }, /* GL_OR_REVERSE */ - { 19866, 0x00000505 }, /* GL_OUT_OF_MEMORY */ - { 19883, 0x00000D05 }, /* GL_PACK_ALIGNMENT */ - { 19901, 0x0000806C }, /* GL_PACK_IMAGE_HEIGHT */ - { 19922, 0x00008758 }, /* GL_PACK_INVERT_MESA */ - { 19942, 0x00000D01 }, /* GL_PACK_LSB_FIRST */ - { 19960, 0x00000D02 }, /* GL_PACK_ROW_LENGTH */ - { 19979, 0x0000806B }, /* GL_PACK_SKIP_IMAGES */ - { 19999, 0x00000D04 }, /* GL_PACK_SKIP_PIXELS */ - { 20019, 0x00000D03 }, /* GL_PACK_SKIP_ROWS */ - { 20037, 0x00000D00 }, /* GL_PACK_SWAP_BYTES */ - { 20056, 0x00008B92 }, /* GL_PALETTE4_R5_G6_B5_OES */ - { 20081, 0x00008B94 }, /* GL_PALETTE4_RGB5_A1_OES */ - { 20105, 0x00008B90 }, /* GL_PALETTE4_RGB8_OES */ - { 20126, 0x00008B93 }, /* GL_PALETTE4_RGBA4_OES */ - { 20148, 0x00008B91 }, /* GL_PALETTE4_RGBA8_OES */ - { 20170, 0x00008B97 }, /* GL_PALETTE8_R5_G6_B5_OES */ - { 20195, 0x00008B99 }, /* GL_PALETTE8_RGB5_A1_OES */ - { 20219, 0x00008B95 }, /* GL_PALETTE8_RGB8_OES */ - { 20240, 0x00008B98 }, /* GL_PALETTE8_RGBA4_OES */ - { 20262, 0x00008B96 }, /* GL_PALETTE8_RGBA8_OES */ - { 20284, 0x00000700 }, /* GL_PASS_THROUGH_TOKEN */ - { 20306, 0x00000C50 }, /* GL_PERSPECTIVE_CORRECTION_HINT */ - { 20337, 0x00000C79 }, /* GL_PIXEL_MAP_A_TO_A */ - { 20357, 0x00000CB9 }, /* GL_PIXEL_MAP_A_TO_A_SIZE */ - { 20382, 0x00000C78 }, /* GL_PIXEL_MAP_B_TO_B */ - { 20402, 0x00000CB8 }, /* GL_PIXEL_MAP_B_TO_B_SIZE */ - { 20427, 0x00000C77 }, /* GL_PIXEL_MAP_G_TO_G */ - { 20447, 0x00000CB7 }, /* GL_PIXEL_MAP_G_TO_G_SIZE */ - { 20472, 0x00000C75 }, /* GL_PIXEL_MAP_I_TO_A */ - { 20492, 0x00000CB5 }, /* GL_PIXEL_MAP_I_TO_A_SIZE */ - { 20517, 0x00000C74 }, /* GL_PIXEL_MAP_I_TO_B */ - { 20537, 0x00000CB4 }, /* GL_PIXEL_MAP_I_TO_B_SIZE */ - { 20562, 0x00000C73 }, /* GL_PIXEL_MAP_I_TO_G */ - { 20582, 0x00000CB3 }, /* GL_PIXEL_MAP_I_TO_G_SIZE */ - { 20607, 0x00000C70 }, /* GL_PIXEL_MAP_I_TO_I */ - { 20627, 0x00000CB0 }, /* GL_PIXEL_MAP_I_TO_I_SIZE */ - { 20652, 0x00000C72 }, /* GL_PIXEL_MAP_I_TO_R */ - { 20672, 0x00000CB2 }, /* GL_PIXEL_MAP_I_TO_R_SIZE */ - { 20697, 0x00000C76 }, /* GL_PIXEL_MAP_R_TO_R */ - { 20717, 0x00000CB6 }, /* GL_PIXEL_MAP_R_TO_R_SIZE */ - { 20742, 0x00000C71 }, /* GL_PIXEL_MAP_S_TO_S */ - { 20762, 0x00000CB1 }, /* GL_PIXEL_MAP_S_TO_S_SIZE */ - { 20787, 0x00000020 }, /* GL_PIXEL_MODE_BIT */ - { 20805, 0x000088ED }, /* GL_PIXEL_PACK_BUFFER_BINDING_EXT */ - { 20838, 0x000088EB }, /* GL_PIXEL_PACK_BUFFER_EXT */ - { 20863, 0x000088EF }, /* GL_PIXEL_UNPACK_BUFFER_BINDING_EXT */ - { 20898, 0x000088EC }, /* GL_PIXEL_UNPACK_BUFFER_EXT */ - { 20925, 0x00001B00 }, /* GL_POINT */ - { 20934, 0x00000000 }, /* GL_POINTS */ - { 20944, 0x00000002 }, /* GL_POINT_BIT */ - { 20957, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION */ - { 20987, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_ARB */ - { 21021, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_EXT */ - { 21055, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_SGIS */ - { 21090, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE */ - { 21119, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_ARB */ - { 21152, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_EXT */ - { 21185, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_SGIS */ - { 21219, 0x00000B11 }, /* GL_POINT_SIZE */ - { 21233, 0x00000B13 }, /* GL_POINT_SIZE_GRANULARITY */ - { 21259, 0x00008127 }, /* GL_POINT_SIZE_MAX */ - { 21277, 0x00008127 }, /* GL_POINT_SIZE_MAX_ARB */ - { 21299, 0x00008127 }, /* GL_POINT_SIZE_MAX_EXT */ - { 21321, 0x00008127 }, /* GL_POINT_SIZE_MAX_SGIS */ - { 21344, 0x00008126 }, /* GL_POINT_SIZE_MIN */ - { 21362, 0x00008126 }, /* GL_POINT_SIZE_MIN_ARB */ - { 21384, 0x00008126 }, /* GL_POINT_SIZE_MIN_EXT */ - { 21406, 0x00008126 }, /* GL_POINT_SIZE_MIN_SGIS */ - { 21429, 0x00000B12 }, /* GL_POINT_SIZE_RANGE */ - { 21449, 0x00000B10 }, /* GL_POINT_SMOOTH */ - { 21465, 0x00000C51 }, /* GL_POINT_SMOOTH_HINT */ - { 21486, 0x00008861 }, /* GL_POINT_SPRITE_ARB */ - { 21506, 0x00008CA0 }, /* GL_POINT_SPRITE_COORD_ORIGIN */ - { 21535, 0x00008861 }, /* GL_POINT_SPRITE_NV */ - { 21554, 0x00008863 }, /* GL_POINT_SPRITE_R_MODE_NV */ - { 21580, 0x00000701 }, /* GL_POINT_TOKEN */ - { 21595, 0x00000009 }, /* GL_POLYGON */ - { 21606, 0x00000008 }, /* GL_POLYGON_BIT */ - { 21621, 0x00000B40 }, /* GL_POLYGON_MODE */ - { 21637, 0x00008039 }, /* GL_POLYGON_OFFSET_BIAS */ - { 21660, 0x00008038 }, /* GL_POLYGON_OFFSET_FACTOR */ - { 21685, 0x00008037 }, /* GL_POLYGON_OFFSET_FILL */ - { 21708, 0x00002A02 }, /* GL_POLYGON_OFFSET_LINE */ - { 21731, 0x00002A01 }, /* GL_POLYGON_OFFSET_POINT */ - { 21755, 0x00002A00 }, /* GL_POLYGON_OFFSET_UNITS */ - { 21779, 0x00000B41 }, /* GL_POLYGON_SMOOTH */ - { 21797, 0x00000C53 }, /* GL_POLYGON_SMOOTH_HINT */ - { 21820, 0x00000B42 }, /* GL_POLYGON_STIPPLE */ - { 21839, 0x00000010 }, /* GL_POLYGON_STIPPLE_BIT */ - { 21862, 0x00000703 }, /* GL_POLYGON_TOKEN */ - { 21879, 0x00001203 }, /* GL_POSITION */ - { 21891, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */ - { 21923, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI */ - { 21959, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */ - { 21992, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI */ - { 22029, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */ - { 22060, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI */ - { 22095, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */ - { 22127, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI */ - { 22163, 0x000080D2 }, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */ - { 22196, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */ - { 22228, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI */ - { 22264, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */ - { 22297, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI */ - { 22334, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS */ - { 22364, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS_SGI */ - { 22398, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE */ - { 22429, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE_SGI */ - { 22464, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS */ - { 22495, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS_EXT */ - { 22530, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE */ - { 22562, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE_EXT */ - { 22598, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS */ - { 22628, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS_EXT */ - { 22662, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE */ - { 22693, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE_EXT */ - { 22728, 0x000080D1 }, /* GL_POST_CONVOLUTION_COLOR_TABLE */ - { 22760, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS */ - { 22791, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS_EXT */ - { 22826, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE */ - { 22858, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE_EXT */ - { 22894, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS */ - { 22923, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS_EXT */ - { 22956, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE */ - { 22986, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE_EXT */ - { 23020, 0x0000817B }, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */ - { 23059, 0x00008179 }, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */ - { 23092, 0x0000817C }, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */ - { 23132, 0x0000817A }, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */ - { 23166, 0x00008578 }, /* GL_PREVIOUS */ - { 23178, 0x00008578 }, /* GL_PREVIOUS_ARB */ - { 23194, 0x00008578 }, /* GL_PREVIOUS_EXT */ - { 23210, 0x00008577 }, /* GL_PRIMARY_COLOR */ - { 23227, 0x00008577 }, /* GL_PRIMARY_COLOR_ARB */ - { 23248, 0x00008577 }, /* GL_PRIMARY_COLOR_EXT */ - { 23269, 0x000088B0 }, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */ - { 23302, 0x00008805 }, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */ - { 23334, 0x000088AC }, /* GL_PROGRAM_ATTRIBS_ARB */ - { 23357, 0x00008677 }, /* GL_PROGRAM_BINDING_ARB */ - { 23380, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_ARB */ - { 23410, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_NV */ - { 23439, 0x00008874 }, /* GL_PROGRAM_ERROR_STRING_ARB */ - { 23467, 0x00008876 }, /* GL_PROGRAM_FORMAT_ARB */ - { 23489, 0x00008875 }, /* GL_PROGRAM_FORMAT_ASCII_ARB */ - { 23517, 0x000088A0 }, /* GL_PROGRAM_INSTRUCTIONS_ARB */ - { 23545, 0x00008627 }, /* GL_PROGRAM_LENGTH_ARB */ - { 23567, 0x00008627 }, /* GL_PROGRAM_LENGTH_NV */ - { 23588, 0x000088B2 }, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ - { 23628, 0x00008808 }, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ - { 23667, 0x000088AE }, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */ - { 23697, 0x000088A2 }, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ - { 23732, 0x000088AA }, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */ - { 23765, 0x000088A6 }, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */ - { 23799, 0x0000880A }, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ - { 23838, 0x00008809 }, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ - { 23877, 0x00008B40 }, /* GL_PROGRAM_OBJECT_ARB */ - { 23899, 0x000088A8 }, /* GL_PROGRAM_PARAMETERS_ARB */ - { 23925, 0x00008644 }, /* GL_PROGRAM_PARAMETER_NV */ - { 23949, 0x00008647 }, /* GL_PROGRAM_RESIDENT_NV */ - { 23972, 0x00008628 }, /* GL_PROGRAM_STRING_ARB */ - { 23994, 0x00008628 }, /* GL_PROGRAM_STRING_NV */ - { 24015, 0x00008646 }, /* GL_PROGRAM_TARGET_NV */ - { 24036, 0x000088A4 }, /* GL_PROGRAM_TEMPORARIES_ARB */ - { 24063, 0x00008807 }, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */ - { 24095, 0x00008806 }, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */ - { 24127, 0x000088B6 }, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */ - { 24162, 0x00001701 }, /* GL_PROJECTION */ - { 24176, 0x00000BA7 }, /* GL_PROJECTION_MATRIX */ - { 24197, 0x00000BA4 }, /* GL_PROJECTION_STACK_DEPTH */ - { 24223, 0x000080D3 }, /* GL_PROXY_COLOR_TABLE */ - { 24244, 0x00008025 }, /* GL_PROXY_HISTOGRAM */ - { 24263, 0x00008025 }, /* GL_PROXY_HISTOGRAM_EXT */ - { 24286, 0x000080D5 }, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */ - { 24325, 0x000080D4 }, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */ - { 24363, 0x00008063 }, /* GL_PROXY_TEXTURE_1D */ - { 24383, 0x00008063 }, /* GL_PROXY_TEXTURE_1D_EXT */ - { 24407, 0x00008064 }, /* GL_PROXY_TEXTURE_2D */ - { 24427, 0x00008064 }, /* GL_PROXY_TEXTURE_2D_EXT */ - { 24451, 0x00008070 }, /* GL_PROXY_TEXTURE_3D */ - { 24471, 0x000080BD }, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */ - { 24504, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP */ - { 24530, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP_ARB */ - { 24560, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */ - { 24591, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_NV */ - { 24621, 0x00002003 }, /* GL_Q */ - { 24626, 0x00001209 }, /* GL_QUADRATIC_ATTENUATION */ - { 24651, 0x00000007 }, /* GL_QUADS */ - { 24660, 0x00008614 }, /* GL_QUAD_MESH_SUN */ - { 24677, 0x00000008 }, /* GL_QUAD_STRIP */ - { 24691, 0x00008864 }, /* GL_QUERY_COUNTER_BITS */ - { 24713, 0x00008864 }, /* GL_QUERY_COUNTER_BITS_ARB */ - { 24739, 0x00008866 }, /* GL_QUERY_RESULT */ - { 24755, 0x00008866 }, /* GL_QUERY_RESULT_ARB */ - { 24775, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE */ - { 24801, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE_ARB */ - { 24831, 0x00002002 }, /* GL_R */ - { 24836, 0x00002A10 }, /* GL_R3_G3_B2 */ - { 24848, 0x00019262 }, /* GL_RASTER_POSITION_UNCLIPPED_IBM */ - { 24881, 0x00000C02 }, /* GL_READ_BUFFER */ - { 24896, 0x00008CAA }, /* GL_READ_FRAMEBUFFER_BINDING_EXT */ - { 24928, 0x00008CA8 }, /* GL_READ_FRAMEBUFFER_EXT */ - { 24952, 0x000088B8 }, /* GL_READ_ONLY */ - { 24965, 0x000088B8 }, /* GL_READ_ONLY_ARB */ - { 24982, 0x000088BA }, /* GL_READ_WRITE */ - { 24996, 0x000088BA }, /* GL_READ_WRITE_ARB */ - { 25014, 0x00001903 }, /* GL_RED */ - { 25021, 0x00008016 }, /* GL_REDUCE */ - { 25031, 0x00008016 }, /* GL_REDUCE_EXT */ - { 25045, 0x00000D15 }, /* GL_RED_BIAS */ - { 25057, 0x00000D52 }, /* GL_RED_BITS */ - { 25069, 0x00000D14 }, /* GL_RED_SCALE */ - { 25082, 0x00008512 }, /* GL_REFLECTION_MAP */ - { 25100, 0x00008512 }, /* GL_REFLECTION_MAP_ARB */ - { 25122, 0x00008512 }, /* GL_REFLECTION_MAP_NV */ - { 25143, 0x00001C00 }, /* GL_RENDER */ - { 25153, 0x00008CA7 }, /* GL_RENDERBUFFER_BINDING_EXT */ - { 25181, 0x00008D41 }, /* GL_RENDERBUFFER_EXT */ - { 25201, 0x00008D43 }, /* GL_RENDERBUFFER_HEIGHT_EXT */ - { 25228, 0x00008D44 }, /* GL_RENDERBUFFER_INTERNAL_FORMAT_EXT */ - { 25264, 0x00008D42 }, /* GL_RENDERBUFFER_WIDTH_EXT */ - { 25290, 0x00001F01 }, /* GL_RENDERER */ - { 25302, 0x00000C40 }, /* GL_RENDER_MODE */ - { 25317, 0x00002901 }, /* GL_REPEAT */ - { 25327, 0x00001E01 }, /* GL_REPLACE */ - { 25338, 0x00008062 }, /* GL_REPLACE_EXT */ - { 25353, 0x00008153 }, /* GL_REPLICATE_BORDER_HP */ - { 25376, 0x0000803A }, /* GL_RESCALE_NORMAL */ - { 25394, 0x0000803A }, /* GL_RESCALE_NORMAL_EXT */ - { 25416, 0x00000102 }, /* GL_RETURN */ - { 25426, 0x00001907 }, /* GL_RGB */ - { 25433, 0x00008052 }, /* GL_RGB10 */ - { 25442, 0x00008059 }, /* GL_RGB10_A2 */ - { 25454, 0x00008059 }, /* GL_RGB10_A2_EXT */ - { 25470, 0x00008052 }, /* GL_RGB10_EXT */ - { 25483, 0x00008053 }, /* GL_RGB12 */ - { 25492, 0x00008053 }, /* GL_RGB12_EXT */ - { 25505, 0x00008054 }, /* GL_RGB16 */ - { 25514, 0x00008054 }, /* GL_RGB16_EXT */ - { 25527, 0x0000804E }, /* GL_RGB2_EXT */ - { 25539, 0x0000804F }, /* GL_RGB4 */ - { 25547, 0x0000804F }, /* GL_RGB4_EXT */ - { 25559, 0x000083A1 }, /* GL_RGB4_S3TC */ - { 25572, 0x00008050 }, /* GL_RGB5 */ - { 25580, 0x00008057 }, /* GL_RGB5_A1 */ - { 25591, 0x00008057 }, /* GL_RGB5_A1_EXT */ - { 25606, 0x00008050 }, /* GL_RGB5_EXT */ - { 25618, 0x00008051 }, /* GL_RGB8 */ - { 25626, 0x00008051 }, /* GL_RGB8_EXT */ - { 25638, 0x00001908 }, /* GL_RGBA */ - { 25646, 0x0000805A }, /* GL_RGBA12 */ - { 25656, 0x0000805A }, /* GL_RGBA12_EXT */ - { 25670, 0x0000805B }, /* GL_RGBA16 */ - { 25680, 0x0000805B }, /* GL_RGBA16_EXT */ - { 25694, 0x00008055 }, /* GL_RGBA2 */ - { 25703, 0x00008055 }, /* GL_RGBA2_EXT */ - { 25716, 0x00008056 }, /* GL_RGBA4 */ - { 25725, 0x000083A5 }, /* GL_RGBA4_DXT5_S3TC */ - { 25744, 0x00008056 }, /* GL_RGBA4_EXT */ - { 25757, 0x000083A3 }, /* GL_RGBA4_S3TC */ - { 25771, 0x00008058 }, /* GL_RGBA8 */ - { 25780, 0x00008058 }, /* GL_RGBA8_EXT */ - { 25793, 0x000083A4 }, /* GL_RGBA_DXT5_S3TC */ - { 25811, 0x00000C31 }, /* GL_RGBA_MODE */ - { 25824, 0x000083A2 }, /* GL_RGBA_S3TC */ - { 25837, 0x000083A0 }, /* GL_RGB_S3TC */ - { 25849, 0x00008573 }, /* GL_RGB_SCALE */ - { 25862, 0x00008573 }, /* GL_RGB_SCALE_ARB */ - { 25879, 0x00008573 }, /* GL_RGB_SCALE_EXT */ - { 25896, 0x00000407 }, /* GL_RIGHT */ - { 25905, 0x00002000 }, /* GL_S */ - { 25910, 0x000080A9 }, /* GL_SAMPLES */ - { 25921, 0x000086B4 }, /* GL_SAMPLES_3DFX */ - { 25937, 0x000080A9 }, /* GL_SAMPLES_ARB */ - { 25952, 0x00008914 }, /* GL_SAMPLES_PASSED */ - { 25970, 0x00008914 }, /* GL_SAMPLES_PASSED_ARB */ - { 25992, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE */ - { 26020, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE_ARB */ - { 26052, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE */ - { 26075, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE_ARB */ - { 26102, 0x000080A8 }, /* GL_SAMPLE_BUFFERS */ - { 26120, 0x000086B3 }, /* GL_SAMPLE_BUFFERS_3DFX */ - { 26143, 0x000080A8 }, /* GL_SAMPLE_BUFFERS_ARB */ - { 26165, 0x000080A0 }, /* GL_SAMPLE_COVERAGE */ - { 26184, 0x000080A0 }, /* GL_SAMPLE_COVERAGE_ARB */ - { 26207, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT */ - { 26233, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT_ARB */ - { 26263, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE */ - { 26288, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE_ARB */ - { 26317, 0x00080000 }, /* GL_SCISSOR_BIT */ - { 26332, 0x00000C10 }, /* GL_SCISSOR_BOX */ - { 26347, 0x00000C11 }, /* GL_SCISSOR_TEST */ - { 26363, 0x0000845E }, /* GL_SECONDARY_COLOR_ARRAY */ - { 26388, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */ - { 26428, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB */ - { 26472, 0x0000845D }, /* GL_SECONDARY_COLOR_ARRAY_POINTER */ - { 26505, 0x0000845A }, /* GL_SECONDARY_COLOR_ARRAY_SIZE */ - { 26535, 0x0000845C }, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */ - { 26567, 0x0000845B }, /* GL_SECONDARY_COLOR_ARRAY_TYPE */ - { 26597, 0x00001C02 }, /* GL_SELECT */ - { 26607, 0x00000DF3 }, /* GL_SELECTION_BUFFER_POINTER */ - { 26635, 0x00000DF4 }, /* GL_SELECTION_BUFFER_SIZE */ - { 26660, 0x00008012 }, /* GL_SEPARABLE_2D */ - { 26676, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR */ - { 26703, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR_EXT */ - { 26734, 0x0000150F }, /* GL_SET */ - { 26741, 0x00008B48 }, /* GL_SHADER_OBJECT_ARB */ - { 26762, 0x00000B54 }, /* GL_SHADE_MODEL */ - { 26777, 0x000080BF }, /* GL_SHADOW_AMBIENT_SGIX */ - { 26800, 0x000081FB }, /* GL_SHARED_TEXTURE_PALETTE_EXT */ - { 26830, 0x00001601 }, /* GL_SHININESS */ - { 26843, 0x00001402 }, /* GL_SHORT */ - { 26852, 0x000081F9 }, /* GL_SINGLE_COLOR */ - { 26868, 0x000081F9 }, /* GL_SINGLE_COLOR_EXT */ - { 26888, 0x000085CC }, /* GL_SLICE_ACCUM_SUN */ - { 26907, 0x00001D01 }, /* GL_SMOOTH */ - { 26917, 0x00000B23 }, /* GL_SMOOTH_LINE_WIDTH_GRANULARITY */ - { 26950, 0x00000B22 }, /* GL_SMOOTH_LINE_WIDTH_RANGE */ - { 26977, 0x00000B13 }, /* GL_SMOOTH_POINT_SIZE_GRANULARITY */ - { 27010, 0x00000B12 }, /* GL_SMOOTH_POINT_SIZE_RANGE */ - { 27037, 0x00008588 }, /* GL_SOURCE0_ALPHA */ - { 27054, 0x00008588 }, /* GL_SOURCE0_ALPHA_ARB */ - { 27075, 0x00008588 }, /* GL_SOURCE0_ALPHA_EXT */ - { 27096, 0x00008580 }, /* GL_SOURCE0_RGB */ - { 27111, 0x00008580 }, /* GL_SOURCE0_RGB_ARB */ - { 27130, 0x00008580 }, /* GL_SOURCE0_RGB_EXT */ - { 27149, 0x00008589 }, /* GL_SOURCE1_ALPHA */ - { 27166, 0x00008589 }, /* GL_SOURCE1_ALPHA_ARB */ - { 27187, 0x00008589 }, /* GL_SOURCE1_ALPHA_EXT */ - { 27208, 0x00008581 }, /* GL_SOURCE1_RGB */ - { 27223, 0x00008581 }, /* GL_SOURCE1_RGB_ARB */ - { 27242, 0x00008581 }, /* GL_SOURCE1_RGB_EXT */ - { 27261, 0x0000858A }, /* GL_SOURCE2_ALPHA */ - { 27278, 0x0000858A }, /* GL_SOURCE2_ALPHA_ARB */ - { 27299, 0x0000858A }, /* GL_SOURCE2_ALPHA_EXT */ - { 27320, 0x00008582 }, /* GL_SOURCE2_RGB */ - { 27335, 0x00008582 }, /* GL_SOURCE2_RGB_ARB */ - { 27354, 0x00008582 }, /* GL_SOURCE2_RGB_EXT */ - { 27373, 0x0000858B }, /* GL_SOURCE3_ALPHA_NV */ - { 27393, 0x00008583 }, /* GL_SOURCE3_RGB_NV */ - { 27411, 0x00001202 }, /* GL_SPECULAR */ - { 27423, 0x00002402 }, /* GL_SPHERE_MAP */ - { 27437, 0x00001206 }, /* GL_SPOT_CUTOFF */ - { 27452, 0x00001204 }, /* GL_SPOT_DIRECTION */ - { 27470, 0x00001205 }, /* GL_SPOT_EXPONENT */ - { 27487, 0x00008588 }, /* GL_SRC0_ALPHA */ - { 27501, 0x00008580 }, /* GL_SRC0_RGB */ - { 27513, 0x00008589 }, /* GL_SRC1_ALPHA */ - { 27527, 0x00008581 }, /* GL_SRC1_RGB */ - { 27539, 0x0000858A }, /* GL_SRC2_ALPHA */ - { 27553, 0x00008582 }, /* GL_SRC2_RGB */ - { 27565, 0x00000302 }, /* GL_SRC_ALPHA */ - { 27578, 0x00000308 }, /* GL_SRC_ALPHA_SATURATE */ - { 27600, 0x00000300 }, /* GL_SRC_COLOR */ - { 27613, 0x00000503 }, /* GL_STACK_OVERFLOW */ - { 27631, 0x00000504 }, /* GL_STACK_UNDERFLOW */ - { 27650, 0x000088E6 }, /* GL_STATIC_COPY */ - { 27665, 0x000088E6 }, /* GL_STATIC_COPY_ARB */ - { 27684, 0x000088E4 }, /* GL_STATIC_DRAW */ - { 27699, 0x000088E4 }, /* GL_STATIC_DRAW_ARB */ - { 27718, 0x000088E5 }, /* GL_STATIC_READ */ - { 27733, 0x000088E5 }, /* GL_STATIC_READ_ARB */ - { 27752, 0x00001802 }, /* GL_STENCIL */ - { 27763, 0x00008D20 }, /* GL_STENCIL_ATTACHMENT_EXT */ - { 27789, 0x00000D57 }, /* GL_STENCIL_BITS */ - { 27805, 0x00000400 }, /* GL_STENCIL_BUFFER_BIT */ - { 27827, 0x00000B91 }, /* GL_STENCIL_CLEAR_VALUE */ - { 27850, 0x00000B94 }, /* GL_STENCIL_FAIL */ - { 27866, 0x00000B92 }, /* GL_STENCIL_FUNC */ - { 27882, 0x00001901 }, /* GL_STENCIL_INDEX */ - { 27899, 0x00008D49 }, /* GL_STENCIL_INDEX16_EXT */ - { 27922, 0x00008D46 }, /* GL_STENCIL_INDEX1_EXT */ - { 27944, 0x00008D47 }, /* GL_STENCIL_INDEX4_EXT */ - { 27966, 0x00008D48 }, /* GL_STENCIL_INDEX8_EXT */ - { 27988, 0x00008D45 }, /* GL_STENCIL_INDEX_EXT */ - { 28009, 0x00000B95 }, /* GL_STENCIL_PASS_DEPTH_FAIL */ - { 28036, 0x00000B96 }, /* GL_STENCIL_PASS_DEPTH_PASS */ - { 28063, 0x00000B97 }, /* GL_STENCIL_REF */ - { 28078, 0x00000B90 }, /* GL_STENCIL_TEST */ - { 28094, 0x00008910 }, /* GL_STENCIL_TEST_TWO_SIDE_EXT */ - { 28123, 0x00000B93 }, /* GL_STENCIL_VALUE_MASK */ - { 28145, 0x00000B98 }, /* GL_STENCIL_WRITEMASK */ - { 28166, 0x00000C33 }, /* GL_STEREO */ - { 28176, 0x000088E2 }, /* GL_STREAM_COPY */ - { 28191, 0x000088E2 }, /* GL_STREAM_COPY_ARB */ - { 28210, 0x000088E0 }, /* GL_STREAM_DRAW */ - { 28225, 0x000088E0 }, /* GL_STREAM_DRAW_ARB */ - { 28244, 0x000088E1 }, /* GL_STREAM_READ */ - { 28259, 0x000088E1 }, /* GL_STREAM_READ_ARB */ - { 28278, 0x00000D50 }, /* GL_SUBPIXEL_BITS */ - { 28295, 0x000084E7 }, /* GL_SUBTRACT */ - { 28307, 0x000084E7 }, /* GL_SUBTRACT_ARB */ - { 28323, 0x00002001 }, /* GL_T */ - { 28328, 0x00002A2A }, /* GL_T2F_C3F_V3F */ - { 28343, 0x00002A2C }, /* GL_T2F_C4F_N3F_V3F */ - { 28362, 0x00002A29 }, /* GL_T2F_C4UB_V3F */ - { 28378, 0x00002A2B }, /* GL_T2F_N3F_V3F */ - { 28393, 0x00002A27 }, /* GL_T2F_V3F */ - { 28404, 0x00002A2D }, /* GL_T4F_C4F_N3F_V4F */ - { 28423, 0x00002A28 }, /* GL_T4F_V4F */ - { 28434, 0x00008031 }, /* GL_TABLE_TOO_LARGE_EXT */ - { 28457, 0x00001702 }, /* GL_TEXTURE */ - { 28468, 0x000084C0 }, /* GL_TEXTURE0 */ - { 28480, 0x000084C0 }, /* GL_TEXTURE0_ARB */ - { 28496, 0x000084C1 }, /* GL_TEXTURE1 */ - { 28508, 0x000084CA }, /* GL_TEXTURE10 */ - { 28521, 0x000084CA }, /* GL_TEXTURE10_ARB */ - { 28538, 0x000084CB }, /* GL_TEXTURE11 */ - { 28551, 0x000084CB }, /* GL_TEXTURE11_ARB */ - { 28568, 0x000084CC }, /* GL_TEXTURE12 */ - { 28581, 0x000084CC }, /* GL_TEXTURE12_ARB */ - { 28598, 0x000084CD }, /* GL_TEXTURE13 */ - { 28611, 0x000084CD }, /* GL_TEXTURE13_ARB */ - { 28628, 0x000084CE }, /* GL_TEXTURE14 */ - { 28641, 0x000084CE }, /* GL_TEXTURE14_ARB */ - { 28658, 0x000084CF }, /* GL_TEXTURE15 */ - { 28671, 0x000084CF }, /* GL_TEXTURE15_ARB */ - { 28688, 0x000084D0 }, /* GL_TEXTURE16 */ - { 28701, 0x000084D0 }, /* GL_TEXTURE16_ARB */ - { 28718, 0x000084D1 }, /* GL_TEXTURE17 */ - { 28731, 0x000084D1 }, /* GL_TEXTURE17_ARB */ - { 28748, 0x000084D2 }, /* GL_TEXTURE18 */ - { 28761, 0x000084D2 }, /* GL_TEXTURE18_ARB */ - { 28778, 0x000084D3 }, /* GL_TEXTURE19 */ - { 28791, 0x000084D3 }, /* GL_TEXTURE19_ARB */ - { 28808, 0x000084C1 }, /* GL_TEXTURE1_ARB */ - { 28824, 0x000084C2 }, /* GL_TEXTURE2 */ - { 28836, 0x000084D4 }, /* GL_TEXTURE20 */ - { 28849, 0x000084D4 }, /* GL_TEXTURE20_ARB */ - { 28866, 0x000084D5 }, /* GL_TEXTURE21 */ - { 28879, 0x000084D5 }, /* GL_TEXTURE21_ARB */ - { 28896, 0x000084D6 }, /* GL_TEXTURE22 */ - { 28909, 0x000084D6 }, /* GL_TEXTURE22_ARB */ - { 28926, 0x000084D7 }, /* GL_TEXTURE23 */ - { 28939, 0x000084D7 }, /* GL_TEXTURE23_ARB */ - { 28956, 0x000084D8 }, /* GL_TEXTURE24 */ - { 28969, 0x000084D8 }, /* GL_TEXTURE24_ARB */ - { 28986, 0x000084D9 }, /* GL_TEXTURE25 */ - { 28999, 0x000084D9 }, /* GL_TEXTURE25_ARB */ - { 29016, 0x000084DA }, /* GL_TEXTURE26 */ - { 29029, 0x000084DA }, /* GL_TEXTURE26_ARB */ - { 29046, 0x000084DB }, /* GL_TEXTURE27 */ - { 29059, 0x000084DB }, /* GL_TEXTURE27_ARB */ - { 29076, 0x000084DC }, /* GL_TEXTURE28 */ - { 29089, 0x000084DC }, /* GL_TEXTURE28_ARB */ - { 29106, 0x000084DD }, /* GL_TEXTURE29 */ - { 29119, 0x000084DD }, /* GL_TEXTURE29_ARB */ - { 29136, 0x000084C2 }, /* GL_TEXTURE2_ARB */ - { 29152, 0x000084C3 }, /* GL_TEXTURE3 */ - { 29164, 0x000084DE }, /* GL_TEXTURE30 */ - { 29177, 0x000084DE }, /* GL_TEXTURE30_ARB */ - { 29194, 0x000084DF }, /* GL_TEXTURE31 */ - { 29207, 0x000084DF }, /* GL_TEXTURE31_ARB */ - { 29224, 0x000084C3 }, /* GL_TEXTURE3_ARB */ - { 29240, 0x000084C4 }, /* GL_TEXTURE4 */ - { 29252, 0x000084C4 }, /* GL_TEXTURE4_ARB */ - { 29268, 0x000084C5 }, /* GL_TEXTURE5 */ - { 29280, 0x000084C5 }, /* GL_TEXTURE5_ARB */ - { 29296, 0x000084C6 }, /* GL_TEXTURE6 */ - { 29308, 0x000084C6 }, /* GL_TEXTURE6_ARB */ - { 29324, 0x000084C7 }, /* GL_TEXTURE7 */ - { 29336, 0x000084C7 }, /* GL_TEXTURE7_ARB */ - { 29352, 0x000084C8 }, /* GL_TEXTURE8 */ - { 29364, 0x000084C8 }, /* GL_TEXTURE8_ARB */ - { 29380, 0x000084C9 }, /* GL_TEXTURE9 */ - { 29392, 0x000084C9 }, /* GL_TEXTURE9_ARB */ - { 29408, 0x00000DE0 }, /* GL_TEXTURE_1D */ - { 29422, 0x00000DE1 }, /* GL_TEXTURE_2D */ - { 29436, 0x0000806F }, /* GL_TEXTURE_3D */ - { 29450, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE */ - { 29472, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE_EXT */ - { 29498, 0x0000813C }, /* GL_TEXTURE_BASE_LEVEL */ - { 29520, 0x00008068 }, /* GL_TEXTURE_BINDING_1D */ - { 29542, 0x00008069 }, /* GL_TEXTURE_BINDING_2D */ - { 29564, 0x0000806A }, /* GL_TEXTURE_BINDING_3D */ - { 29586, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP */ - { 29614, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP_ARB */ - { 29646, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */ - { 29679, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_NV */ - { 29711, 0x00040000 }, /* GL_TEXTURE_BIT */ - { 29726, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE */ - { 29747, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE_EXT */ - { 29772, 0x00001005 }, /* GL_TEXTURE_BORDER */ - { 29790, 0x00001004 }, /* GL_TEXTURE_BORDER_COLOR */ - { 29814, 0x00008171 }, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */ - { 29845, 0x00008176 }, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */ - { 29875, 0x00008172 }, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */ - { 29905, 0x00008175 }, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */ - { 29940, 0x00008173 }, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */ - { 29971, 0x00008174 }, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */ - { 30009, 0x000080BC }, /* GL_TEXTURE_COLOR_TABLE_SGI */ - { 30036, 0x000081EF }, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */ - { 30068, 0x000080BF }, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ - { 30102, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC */ - { 30126, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC_ARB */ - { 30154, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE */ - { 30178, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE_ARB */ - { 30206, 0x0000819B }, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */ - { 30239, 0x0000819A }, /* GL_TEXTURE_COMPARE_SGIX */ - { 30263, 0x00001003 }, /* GL_TEXTURE_COMPONENTS */ - { 30285, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED */ - { 30307, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED_ARB */ - { 30333, 0x000086A3 }, /* GL_TEXTURE_COMPRESSED_FORMATS_ARB */ - { 30367, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */ - { 30400, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB */ - { 30437, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT */ - { 30465, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT_ARB */ - { 30497, 0x00008078 }, /* GL_TEXTURE_COORD_ARRAY */ - { 30520, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */ - { 30558, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB */ - { 30600, 0x00008092 }, /* GL_TEXTURE_COORD_ARRAY_POINTER */ - { 30631, 0x00008088 }, /* GL_TEXTURE_COORD_ARRAY_SIZE */ - { 30659, 0x0000808A }, /* GL_TEXTURE_COORD_ARRAY_STRIDE */ - { 30689, 0x00008089 }, /* GL_TEXTURE_COORD_ARRAY_TYPE */ - { 30717, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP */ - { 30737, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP_ARB */ - { 30761, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */ - { 30792, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB */ - { 30827, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */ - { 30858, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB */ - { 30893, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */ - { 30924, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB */ - { 30959, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */ - { 30990, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB */ - { 31025, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */ - { 31056, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB */ - { 31091, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */ - { 31122, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB */ - { 31157, 0x00008071 }, /* GL_TEXTURE_DEPTH */ - { 31174, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE */ - { 31196, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE_ARB */ - { 31222, 0x00002300 }, /* GL_TEXTURE_ENV */ - { 31237, 0x00002201 }, /* GL_TEXTURE_ENV_COLOR */ - { 31258, 0x00002200 }, /* GL_TEXTURE_ENV_MODE */ - { 31278, 0x00008500 }, /* GL_TEXTURE_FILTER_CONTROL */ - { 31304, 0x00002500 }, /* GL_TEXTURE_GEN_MODE */ - { 31324, 0x00000C63 }, /* GL_TEXTURE_GEN_Q */ - { 31341, 0x00000C62 }, /* GL_TEXTURE_GEN_R */ - { 31358, 0x00000C60 }, /* GL_TEXTURE_GEN_S */ - { 31375, 0x00000C61 }, /* GL_TEXTURE_GEN_T */ - { 31392, 0x0000819D }, /* GL_TEXTURE_GEQUAL_R_SGIX */ - { 31417, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE */ - { 31439, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE_EXT */ - { 31465, 0x00001001 }, /* GL_TEXTURE_HEIGHT */ - { 31483, 0x000080ED }, /* GL_TEXTURE_INDEX_SIZE_EXT */ - { 31509, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE */ - { 31535, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE_EXT */ - { 31565, 0x00001003 }, /* GL_TEXTURE_INTERNAL_FORMAT */ - { 31592, 0x0000819C }, /* GL_TEXTURE_LEQUAL_R_SGIX */ - { 31617, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS */ - { 31637, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS_EXT */ - { 31661, 0x00008190 }, /* GL_TEXTURE_LOD_BIAS_R_SGIX */ - { 31688, 0x0000818E }, /* GL_TEXTURE_LOD_BIAS_S_SGIX */ - { 31715, 0x0000818F }, /* GL_TEXTURE_LOD_BIAS_T_SGIX */ - { 31742, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE */ - { 31768, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE_EXT */ - { 31798, 0x00002800 }, /* GL_TEXTURE_MAG_FILTER */ - { 31820, 0x00000BA8 }, /* GL_TEXTURE_MATRIX */ - { 31838, 0x000084FE }, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */ - { 31868, 0x0000836B }, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */ - { 31896, 0x00008369 }, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */ - { 31924, 0x0000836A }, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */ - { 31952, 0x0000813D }, /* GL_TEXTURE_MAX_LEVEL */ - { 31973, 0x0000813B }, /* GL_TEXTURE_MAX_LOD */ - { 31992, 0x00002801 }, /* GL_TEXTURE_MIN_FILTER */ - { 32014, 0x0000813A }, /* GL_TEXTURE_MIN_LOD */ - { 32033, 0x00008066 }, /* GL_TEXTURE_PRIORITY */ - { 32053, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_ARB */ - { 32078, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_NV */ - { 32102, 0x0000805C }, /* GL_TEXTURE_RED_SIZE */ - { 32122, 0x0000805C }, /* GL_TEXTURE_RED_SIZE_EXT */ - { 32146, 0x00008067 }, /* GL_TEXTURE_RESIDENT */ - { 32166, 0x00000BA5 }, /* GL_TEXTURE_STACK_DEPTH */ - { 32189, 0x00008065 }, /* GL_TEXTURE_TOO_LARGE_EXT */ - { 32214, 0x0000888F }, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */ - { 32248, 0x00001000 }, /* GL_TEXTURE_WIDTH */ - { 32265, 0x00008072 }, /* GL_TEXTURE_WRAP_R */ - { 32283, 0x00002802 }, /* GL_TEXTURE_WRAP_S */ - { 32301, 0x00002803 }, /* GL_TEXTURE_WRAP_T */ - { 32319, 0x000088BF }, /* GL_TIME_ELAPSED_EXT */ - { 32339, 0x00008648 }, /* GL_TRACK_MATRIX_NV */ - { 32358, 0x00008649 }, /* GL_TRACK_MATRIX_TRANSFORM_NV */ - { 32387, 0x00001000 }, /* GL_TRANSFORM_BIT */ - { 32404, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX */ - { 32430, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX_ARB */ - { 32460, 0x000088B7 }, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */ - { 32492, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX */ - { 32522, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX_ARB */ - { 32556, 0x0000862C }, /* GL_TRANSPOSE_NV */ - { 32572, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX */ - { 32603, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX_ARB */ - { 32638, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX */ - { 32666, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX_ARB */ - { 32698, 0x00000004 }, /* GL_TRIANGLES */ - { 32711, 0x00000006 }, /* GL_TRIANGLE_FAN */ - { 32727, 0x00008615 }, /* GL_TRIANGLE_MESH_SUN */ - { 32748, 0x00000005 }, /* GL_TRIANGLE_STRIP */ - { 32766, 0x00000001 }, /* GL_TRUE */ - { 32774, 0x00000CF5 }, /* GL_UNPACK_ALIGNMENT */ - { 32794, 0x0000806E }, /* GL_UNPACK_IMAGE_HEIGHT */ - { 32817, 0x00000CF1 }, /* GL_UNPACK_LSB_FIRST */ - { 32837, 0x00000CF2 }, /* GL_UNPACK_ROW_LENGTH */ - { 32858, 0x0000806D }, /* GL_UNPACK_SKIP_IMAGES */ - { 32880, 0x00000CF4 }, /* GL_UNPACK_SKIP_PIXELS */ - { 32902, 0x00000CF3 }, /* GL_UNPACK_SKIP_ROWS */ - { 32922, 0x00000CF0 }, /* GL_UNPACK_SWAP_BYTES */ - { 32943, 0x00001401 }, /* GL_UNSIGNED_BYTE */ - { 32960, 0x00008362 }, /* GL_UNSIGNED_BYTE_2_3_3_REV */ - { 32987, 0x00008032 }, /* GL_UNSIGNED_BYTE_3_3_2 */ - { 33010, 0x00001405 }, /* GL_UNSIGNED_INT */ - { 33026, 0x00008036 }, /* GL_UNSIGNED_INT_10_10_10_2 */ - { 33053, 0x000084FA }, /* GL_UNSIGNED_INT_24_8_NV */ - { 33077, 0x00008368 }, /* GL_UNSIGNED_INT_2_10_10_10_REV */ - { 33108, 0x00008035 }, /* GL_UNSIGNED_INT_8_8_8_8 */ - { 33132, 0x00008367 }, /* GL_UNSIGNED_INT_8_8_8_8_REV */ - { 33160, 0x00001403 }, /* GL_UNSIGNED_SHORT */ - { 33178, 0x00008366 }, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */ - { 33208, 0x00008033 }, /* GL_UNSIGNED_SHORT_4_4_4_4 */ - { 33234, 0x00008365 }, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */ - { 33264, 0x00008034 }, /* GL_UNSIGNED_SHORT_5_5_5_1 */ - { 33290, 0x00008363 }, /* GL_UNSIGNED_SHORT_5_6_5 */ - { 33314, 0x00008364 }, /* GL_UNSIGNED_SHORT_5_6_5_REV */ - { 33342, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_APPLE */ - { 33370, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_MESA */ - { 33397, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */ - { 33429, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_MESA */ - { 33460, 0x00002A20 }, /* GL_V2F */ - { 33467, 0x00002A21 }, /* GL_V3F */ - { 33474, 0x00001F00 }, /* GL_VENDOR */ - { 33484, 0x00001F02 }, /* GL_VERSION */ - { 33495, 0x00008074 }, /* GL_VERTEX_ARRAY */ - { 33511, 0x000085B5 }, /* GL_VERTEX_ARRAY_BINDING_APPLE */ - { 33541, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING */ - { 33572, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING_ARB */ - { 33607, 0x0000808E }, /* GL_VERTEX_ARRAY_POINTER */ - { 33631, 0x0000807A }, /* GL_VERTEX_ARRAY_SIZE */ - { 33652, 0x0000807C }, /* GL_VERTEX_ARRAY_STRIDE */ - { 33675, 0x0000807B }, /* GL_VERTEX_ARRAY_TYPE */ - { 33696, 0x00008650 }, /* GL_VERTEX_ATTRIB_ARRAY0_NV */ - { 33723, 0x0000865A }, /* GL_VERTEX_ATTRIB_ARRAY10_NV */ - { 33751, 0x0000865B }, /* GL_VERTEX_ATTRIB_ARRAY11_NV */ - { 33779, 0x0000865C }, /* GL_VERTEX_ATTRIB_ARRAY12_NV */ - { 33807, 0x0000865D }, /* GL_VERTEX_ATTRIB_ARRAY13_NV */ - { 33835, 0x0000865E }, /* GL_VERTEX_ATTRIB_ARRAY14_NV */ - { 33863, 0x0000865F }, /* GL_VERTEX_ATTRIB_ARRAY15_NV */ - { 33891, 0x00008651 }, /* GL_VERTEX_ATTRIB_ARRAY1_NV */ - { 33918, 0x00008652 }, /* GL_VERTEX_ATTRIB_ARRAY2_NV */ - { 33945, 0x00008653 }, /* GL_VERTEX_ATTRIB_ARRAY3_NV */ - { 33972, 0x00008654 }, /* GL_VERTEX_ATTRIB_ARRAY4_NV */ - { 33999, 0x00008655 }, /* GL_VERTEX_ATTRIB_ARRAY5_NV */ - { 34026, 0x00008656 }, /* GL_VERTEX_ATTRIB_ARRAY6_NV */ - { 34053, 0x00008657 }, /* GL_VERTEX_ATTRIB_ARRAY7_NV */ - { 34080, 0x00008658 }, /* GL_VERTEX_ATTRIB_ARRAY8_NV */ - { 34107, 0x00008659 }, /* GL_VERTEX_ATTRIB_ARRAY9_NV */ - { 34134, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */ - { 34172, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB */ - { 34214, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB */ - { 34249, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB */ - { 34287, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB */ - { 34322, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB */ - { 34354, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB */ - { 34388, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB */ - { 34420, 0x000086A7 }, /* GL_VERTEX_BLEND_ARB */ - { 34440, 0x00008620 }, /* GL_VERTEX_PROGRAM_ARB */ - { 34462, 0x0000864A }, /* GL_VERTEX_PROGRAM_BINDING_NV */ - { 34491, 0x00008620 }, /* GL_VERTEX_PROGRAM_NV */ - { 34512, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_ARB */ - { 34545, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_NV */ - { 34577, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_ARB */ - { 34608, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_NV */ - { 34638, 0x00008B31 }, /* GL_VERTEX_SHADER_ARB */ - { 34659, 0x00008621 }, /* GL_VERTEX_STATE_PROGRAM_NV */ - { 34686, 0x00000BA2 }, /* GL_VIEWPORT */ - { 34698, 0x00000800 }, /* GL_VIEWPORT_BIT */ - { 34714, 0x000086AD }, /* GL_WEIGHT_ARRAY_ARB */ - { 34734, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */ - { 34765, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB */ - { 34800, 0x000086AC }, /* GL_WEIGHT_ARRAY_POINTER_ARB */ - { 34828, 0x000086AB }, /* GL_WEIGHT_ARRAY_SIZE_ARB */ - { 34853, 0x000086AA }, /* GL_WEIGHT_ARRAY_STRIDE_ARB */ - { 34880, 0x000086A9 }, /* GL_WEIGHT_ARRAY_TYPE_ARB */ - { 34905, 0x000086A6 }, /* GL_WEIGHT_SUM_UNITY_ARB */ - { 34929, 0x000081D4 }, /* GL_WRAP_BORDER_SUN */ - { 34948, 0x000088B9 }, /* GL_WRITE_ONLY */ - { 34962, 0x000088B9 }, /* GL_WRITE_ONLY_ARB */ - { 34980, 0x00001506 }, /* GL_XOR */ - { 34987, 0x000085B9 }, /* GL_YCBCR_422_APPLE */ - { 35006, 0x00008757 }, /* GL_YCBCR_MESA */ - { 35020, 0x00000000 }, /* GL_ZERO */ - { 35028, 0x00000D16 }, /* GL_ZOOM_X */ - { 35038, 0x00000D17 }, /* GL_ZOOM_Y */ + { 224, 0x00008B89 }, /* GL_ACTIVE_ATTRIBUTES */ + { 245, 0x00008B8A }, /* GL_ACTIVE_ATTRIBUTE_MAX_LENGTH */ + { 276, 0x00008911 }, /* GL_ACTIVE_STENCIL_FACE_EXT */ + { 303, 0x000084E0 }, /* GL_ACTIVE_TEXTURE */ + { 321, 0x000084E0 }, /* GL_ACTIVE_TEXTURE_ARB */ + { 343, 0x00008B86 }, /* GL_ACTIVE_UNIFORMS */ + { 362, 0x00008B87 }, /* GL_ACTIVE_UNIFORM_MAX_LENGTH */ + { 391, 0x000086A5 }, /* GL_ACTIVE_VERTEX_UNITS_ARB */ + { 418, 0x00000104 }, /* GL_ADD */ + { 425, 0x00008574 }, /* GL_ADD_SIGNED */ + { 439, 0x00008574 }, /* GL_ADD_SIGNED_ARB */ + { 457, 0x00008574 }, /* GL_ADD_SIGNED_EXT */ + { 475, 0x0000846E }, /* GL_ALIASED_LINE_WIDTH_RANGE */ + { 503, 0x0000846D }, /* GL_ALIASED_POINT_SIZE_RANGE */ + { 531, 0x000FFFFF }, /* GL_ALL_ATTRIB_BITS */ + { 550, 0xFFFFFFFF }, /* GL_ALL_CLIENT_ATTRIB_BITS */ + { 576, 0x00001906 }, /* GL_ALPHA */ + { 585, 0x0000803D }, /* GL_ALPHA12 */ + { 596, 0x0000803D }, /* GL_ALPHA12_EXT */ + { 611, 0x0000803E }, /* GL_ALPHA16 */ + { 622, 0x0000803E }, /* GL_ALPHA16_EXT */ + { 637, 0x0000803B }, /* GL_ALPHA4 */ + { 647, 0x0000803B }, /* GL_ALPHA4_EXT */ + { 661, 0x0000803C }, /* GL_ALPHA8 */ + { 671, 0x0000803C }, /* GL_ALPHA8_EXT */ + { 685, 0x00000D1D }, /* GL_ALPHA_BIAS */ + { 699, 0x00000D55 }, /* GL_ALPHA_BITS */ + { 713, 0x00000D1C }, /* GL_ALPHA_SCALE */ + { 728, 0x00000BC0 }, /* GL_ALPHA_TEST */ + { 742, 0x00000BC1 }, /* GL_ALPHA_TEST_FUNC */ + { 761, 0x00000BC2 }, /* GL_ALPHA_TEST_REF */ + { 779, 0x00000207 }, /* GL_ALWAYS */ + { 789, 0x00001200 }, /* GL_AMBIENT */ + { 800, 0x00001602 }, /* GL_AMBIENT_AND_DIFFUSE */ + { 823, 0x00001501 }, /* GL_AND */ + { 830, 0x00001504 }, /* GL_AND_INVERTED */ + { 846, 0x00001502 }, /* GL_AND_REVERSE */ + { 861, 0x00008892 }, /* GL_ARRAY_BUFFER */ + { 877, 0x00008892 }, /* GL_ARRAY_BUFFER_ARB */ + { 897, 0x00008894 }, /* GL_ARRAY_BUFFER_BINDING */ + { 921, 0x00008894 }, /* GL_ARRAY_BUFFER_BINDING_ARB */ + { 949, 0x00008B85 }, /* GL_ATTACHED_SHADERS */ + { 969, 0x00008645 }, /* GL_ATTRIB_ARRAY_POINTER_NV */ + { 996, 0x00008623 }, /* GL_ATTRIB_ARRAY_SIZE_NV */ + { 1020, 0x00008624 }, /* GL_ATTRIB_ARRAY_STRIDE_NV */ + { 1046, 0x00008625 }, /* GL_ATTRIB_ARRAY_TYPE_NV */ + { 1070, 0x00000BB0 }, /* GL_ATTRIB_STACK_DEPTH */ + { 1092, 0x00000D80 }, /* GL_AUTO_NORMAL */ + { 1107, 0x00000409 }, /* GL_AUX0 */ + { 1115, 0x0000040A }, /* GL_AUX1 */ + { 1123, 0x0000040B }, /* GL_AUX2 */ + { 1131, 0x0000040C }, /* GL_AUX3 */ + { 1139, 0x00000C00 }, /* GL_AUX_BUFFERS */ + { 1154, 0x00000405 }, /* GL_BACK */ + { 1162, 0x00000402 }, /* GL_BACK_LEFT */ + { 1175, 0x00000403 }, /* GL_BACK_RIGHT */ + { 1189, 0x000080E0 }, /* GL_BGR */ + { 1196, 0x000080E1 }, /* GL_BGRA */ + { 1204, 0x00001A00 }, /* GL_BITMAP */ + { 1214, 0x00000704 }, /* GL_BITMAP_TOKEN */ + { 1230, 0x00000BE2 }, /* GL_BLEND */ + { 1239, 0x00008005 }, /* GL_BLEND_COLOR */ + { 1254, 0x00008005 }, /* GL_BLEND_COLOR_EXT */ + { 1273, 0x00000BE0 }, /* GL_BLEND_DST */ + { 1286, 0x000080CA }, /* GL_BLEND_DST_ALPHA */ + { 1305, 0x000080C8 }, /* GL_BLEND_DST_RGB */ + { 1322, 0x00008009 }, /* GL_BLEND_EQUATION */ + { 1340, 0x0000883D }, /* GL_BLEND_EQUATION_ALPHA */ + { 1364, 0x0000883D }, /* GL_BLEND_EQUATION_ALPHA_EXT */ + { 1392, 0x00008009 }, /* GL_BLEND_EQUATION_EXT */ + { 1414, 0x00008009 }, /* GL_BLEND_EQUATION_RGB_EXT */ + { 1440, 0x00000BE1 }, /* GL_BLEND_SRC */ + { 1453, 0x000080CB }, /* GL_BLEND_SRC_ALPHA */ + { 1472, 0x000080C9 }, /* GL_BLEND_SRC_RGB */ + { 1489, 0x00001905 }, /* GL_BLUE */ + { 1497, 0x00000D1B }, /* GL_BLUE_BIAS */ + { 1510, 0x00000D54 }, /* GL_BLUE_BITS */ + { 1523, 0x00000D1A }, /* GL_BLUE_SCALE */ + { 1537, 0x00008B56 }, /* GL_BOOL */ + { 1545, 0x00008B56 }, /* GL_BOOL_ARB */ + { 1557, 0x00008B57 }, /* GL_BOOL_VEC2 */ + { 1570, 0x00008B57 }, /* GL_BOOL_VEC2_ARB */ + { 1587, 0x00008B58 }, /* GL_BOOL_VEC3 */ + { 1600, 0x00008B58 }, /* GL_BOOL_VEC3_ARB */ + { 1617, 0x00008B59 }, /* GL_BOOL_VEC4 */ + { 1630, 0x00008B59 }, /* GL_BOOL_VEC4_ARB */ + { 1647, 0x000088BB }, /* GL_BUFFER_ACCESS */ + { 1664, 0x000088BB }, /* GL_BUFFER_ACCESS_ARB */ + { 1685, 0x000088BC }, /* GL_BUFFER_MAPPED */ + { 1702, 0x000088BC }, /* GL_BUFFER_MAPPED_ARB */ + { 1723, 0x000088BD }, /* GL_BUFFER_MAP_POINTER */ + { 1745, 0x000088BD }, /* GL_BUFFER_MAP_POINTER_ARB */ + { 1771, 0x00008764 }, /* GL_BUFFER_SIZE */ + { 1786, 0x00008764 }, /* GL_BUFFER_SIZE_ARB */ + { 1805, 0x00008765 }, /* GL_BUFFER_USAGE */ + { 1821, 0x00008765 }, /* GL_BUFFER_USAGE_ARB */ + { 1841, 0x00001400 }, /* GL_BYTE */ + { 1849, 0x00002A24 }, /* GL_C3F_V3F */ + { 1860, 0x00002A26 }, /* GL_C4F_N3F_V3F */ + { 1875, 0x00002A22 }, /* GL_C4UB_V2F */ + { 1887, 0x00002A23 }, /* GL_C4UB_V3F */ + { 1899, 0x00000901 }, /* GL_CCW */ + { 1906, 0x00002900 }, /* GL_CLAMP */ + { 1915, 0x0000812D }, /* GL_CLAMP_TO_BORDER */ + { 1934, 0x0000812D }, /* GL_CLAMP_TO_BORDER_ARB */ + { 1957, 0x0000812D }, /* GL_CLAMP_TO_BORDER_SGIS */ + { 1981, 0x0000812F }, /* GL_CLAMP_TO_EDGE */ + { 1998, 0x0000812F }, /* GL_CLAMP_TO_EDGE_SGIS */ + { 2020, 0x00001500 }, /* GL_CLEAR */ + { 2029, 0x000084E1 }, /* GL_CLIENT_ACTIVE_TEXTURE */ + { 2054, 0x000084E1 }, /* GL_CLIENT_ACTIVE_TEXTURE_ARB */ + { 2083, 0xFFFFFFFF }, /* GL_CLIENT_ALL_ATTRIB_BITS */ + { 2109, 0x00000BB1 }, /* GL_CLIENT_ATTRIB_STACK_DEPTH */ + { 2138, 0x00000001 }, /* GL_CLIENT_PIXEL_STORE_BIT */ + { 2164, 0x00000002 }, /* GL_CLIENT_VERTEX_ARRAY_BIT */ + { 2191, 0x00003000 }, /* GL_CLIP_PLANE0 */ + { 2206, 0x00003001 }, /* GL_CLIP_PLANE1 */ + { 2221, 0x00003002 }, /* GL_CLIP_PLANE2 */ + { 2236, 0x00003003 }, /* GL_CLIP_PLANE3 */ + { 2251, 0x00003004 }, /* GL_CLIP_PLANE4 */ + { 2266, 0x00003005 }, /* GL_CLIP_PLANE5 */ + { 2281, 0x000080F0 }, /* GL_CLIP_VOLUME_CLIPPING_HINT_EXT */ + { 2314, 0x00000A00 }, /* GL_COEFF */ + { 2323, 0x00001800 }, /* GL_COLOR */ + { 2332, 0x00008076 }, /* GL_COLOR_ARRAY */ + { 2347, 0x00008898 }, /* GL_COLOR_ARRAY_BUFFER_BINDING */ + { 2377, 0x00008898 }, /* GL_COLOR_ARRAY_BUFFER_BINDING_ARB */ + { 2411, 0x00008090 }, /* GL_COLOR_ARRAY_POINTER */ + { 2434, 0x00008081 }, /* GL_COLOR_ARRAY_SIZE */ + { 2454, 0x00008083 }, /* GL_COLOR_ARRAY_STRIDE */ + { 2476, 0x00008082 }, /* GL_COLOR_ARRAY_TYPE */ + { 2496, 0x00008CE0 }, /* GL_COLOR_ATTACHMENT0_EXT */ + { 2521, 0x00008CEA }, /* GL_COLOR_ATTACHMENT10_EXT */ + { 2547, 0x00008CEB }, /* GL_COLOR_ATTACHMENT11_EXT */ + { 2573, 0x00008CEC }, /* GL_COLOR_ATTACHMENT12_EXT */ + { 2599, 0x00008CED }, /* GL_COLOR_ATTACHMENT13_EXT */ + { 2625, 0x00008CEE }, /* GL_COLOR_ATTACHMENT14_EXT */ + { 2651, 0x00008CEF }, /* GL_COLOR_ATTACHMENT15_EXT */ + { 2677, 0x00008CE1 }, /* GL_COLOR_ATTACHMENT1_EXT */ + { 2702, 0x00008CE2 }, /* GL_COLOR_ATTACHMENT2_EXT */ + { 2727, 0x00008CE3 }, /* GL_COLOR_ATTACHMENT3_EXT */ + { 2752, 0x00008CE4 }, /* GL_COLOR_ATTACHMENT4_EXT */ + { 2777, 0x00008CE5 }, /* GL_COLOR_ATTACHMENT5_EXT */ + { 2802, 0x00008CE6 }, /* GL_COLOR_ATTACHMENT6_EXT */ + { 2827, 0x00008CE7 }, /* GL_COLOR_ATTACHMENT7_EXT */ + { 2852, 0x00008CE8 }, /* GL_COLOR_ATTACHMENT8_EXT */ + { 2877, 0x00008CE9 }, /* GL_COLOR_ATTACHMENT9_EXT */ + { 2902, 0x00004000 }, /* GL_COLOR_BUFFER_BIT */ + { 2922, 0x00000C22 }, /* GL_COLOR_CLEAR_VALUE */ + { 2943, 0x00001900 }, /* GL_COLOR_INDEX */ + { 2958, 0x00001603 }, /* GL_COLOR_INDEXES */ + { 2975, 0x00000BF2 }, /* GL_COLOR_LOGIC_OP */ + { 2993, 0x00000B57 }, /* GL_COLOR_MATERIAL */ + { 3011, 0x00000B55 }, /* GL_COLOR_MATERIAL_FACE */ + { 3034, 0x00000B56 }, /* GL_COLOR_MATERIAL_PARAMETER */ + { 3062, 0x000080B1 }, /* GL_COLOR_MATRIX */ + { 3078, 0x000080B1 }, /* GL_COLOR_MATRIX_SGI */ + { 3098, 0x000080B2 }, /* GL_COLOR_MATRIX_STACK_DEPTH */ + { 3126, 0x000080B2 }, /* GL_COLOR_MATRIX_STACK_DEPTH_SGI */ + { 3158, 0x00008458 }, /* GL_COLOR_SUM */ + { 3171, 0x00008458 }, /* GL_COLOR_SUM_ARB */ + { 3188, 0x000080D0 }, /* GL_COLOR_TABLE */ + { 3203, 0x000080DD }, /* GL_COLOR_TABLE_ALPHA_SIZE */ + { 3229, 0x000080DD }, /* GL_COLOR_TABLE_ALPHA_SIZE_EXT */ + { 3259, 0x000080DD }, /* GL_COLOR_TABLE_ALPHA_SIZE_SGI */ + { 3289, 0x000080D7 }, /* GL_COLOR_TABLE_BIAS */ + { 3309, 0x000080D7 }, /* GL_COLOR_TABLE_BIAS_SGI */ + { 3333, 0x000080DC }, /* GL_COLOR_TABLE_BLUE_SIZE */ + { 3358, 0x000080DC }, /* GL_COLOR_TABLE_BLUE_SIZE_EXT */ + { 3387, 0x000080DC }, /* GL_COLOR_TABLE_BLUE_SIZE_SGI */ + { 3416, 0x000080D8 }, /* GL_COLOR_TABLE_FORMAT */ + { 3438, 0x000080D8 }, /* GL_COLOR_TABLE_FORMAT_EXT */ + { 3464, 0x000080D8 }, /* GL_COLOR_TABLE_FORMAT_SGI */ + { 3490, 0x000080DB }, /* GL_COLOR_TABLE_GREEN_SIZE */ + { 3516, 0x000080DB }, /* GL_COLOR_TABLE_GREEN_SIZE_EXT */ + { 3546, 0x000080DB }, /* GL_COLOR_TABLE_GREEN_SIZE_SGI */ + { 3576, 0x000080DF }, /* GL_COLOR_TABLE_INTENSITY_SIZE */ + { 3606, 0x000080DF }, /* GL_COLOR_TABLE_INTENSITY_SIZE_EXT */ + { 3640, 0x000080DF }, /* GL_COLOR_TABLE_INTENSITY_SIZE_SGI */ + { 3674, 0x000080DE }, /* GL_COLOR_TABLE_LUMINANCE_SIZE */ + { 3704, 0x000080DE }, /* GL_COLOR_TABLE_LUMINANCE_SIZE_EXT */ + { 3738, 0x000080DE }, /* GL_COLOR_TABLE_LUMINANCE_SIZE_SGI */ + { 3772, 0x000080DA }, /* GL_COLOR_TABLE_RED_SIZE */ + { 3796, 0x000080DA }, /* GL_COLOR_TABLE_RED_SIZE_EXT */ + { 3824, 0x000080DA }, /* GL_COLOR_TABLE_RED_SIZE_SGI */ + { 3852, 0x000080D6 }, /* GL_COLOR_TABLE_SCALE */ + { 3873, 0x000080D6 }, /* GL_COLOR_TABLE_SCALE_SGI */ + { 3898, 0x000080D9 }, /* GL_COLOR_TABLE_WIDTH */ + { 3919, 0x000080D9 }, /* GL_COLOR_TABLE_WIDTH_EXT */ + { 3944, 0x000080D9 }, /* GL_COLOR_TABLE_WIDTH_SGI */ + { 3969, 0x00000C23 }, /* GL_COLOR_WRITEMASK */ + { 3988, 0x00008570 }, /* GL_COMBINE */ + { 3999, 0x00008503 }, /* GL_COMBINE4 */ + { 4011, 0x00008572 }, /* GL_COMBINE_ALPHA */ + { 4028, 0x00008572 }, /* GL_COMBINE_ALPHA_ARB */ + { 4049, 0x00008572 }, /* GL_COMBINE_ALPHA_EXT */ + { 4070, 0x00008570 }, /* GL_COMBINE_ARB */ + { 4085, 0x00008570 }, /* GL_COMBINE_EXT */ + { 4100, 0x00008571 }, /* GL_COMBINE_RGB */ + { 4115, 0x00008571 }, /* GL_COMBINE_RGB_ARB */ + { 4134, 0x00008571 }, /* GL_COMBINE_RGB_EXT */ + { 4153, 0x0000884E }, /* GL_COMPARE_R_TO_TEXTURE */ + { 4177, 0x0000884E }, /* GL_COMPARE_R_TO_TEXTURE_ARB */ + { 4205, 0x00001300 }, /* GL_COMPILE */ + { 4216, 0x00001301 }, /* GL_COMPILE_AND_EXECUTE */ + { 4239, 0x00008B81 }, /* GL_COMPILE_STATUS */ + { 4257, 0x000084E9 }, /* GL_COMPRESSED_ALPHA */ + { 4277, 0x000084E9 }, /* GL_COMPRESSED_ALPHA_ARB */ + { 4301, 0x000084EC }, /* GL_COMPRESSED_INTENSITY */ + { 4325, 0x000084EC }, /* GL_COMPRESSED_INTENSITY_ARB */ + { 4353, 0x000084EA }, /* GL_COMPRESSED_LUMINANCE */ + { 4377, 0x000084EB }, /* GL_COMPRESSED_LUMINANCE_ALPHA */ + { 4407, 0x000084EB }, /* GL_COMPRESSED_LUMINANCE_ALPHA_ARB */ + { 4441, 0x000084EA }, /* GL_COMPRESSED_LUMINANCE_ARB */ + { 4469, 0x000084ED }, /* GL_COMPRESSED_RGB */ + { 4487, 0x000084EE }, /* GL_COMPRESSED_RGBA */ + { 4506, 0x000084EE }, /* GL_COMPRESSED_RGBA_ARB */ + { 4529, 0x000086B1 }, /* GL_COMPRESSED_RGBA_FXT1_3DFX */ + { 4558, 0x000083F1 }, /* GL_COMPRESSED_RGBA_S3TC_DXT1_EXT */ + { 4591, 0x000083F2 }, /* GL_COMPRESSED_RGBA_S3TC_DXT3_EXT */ + { 4624, 0x000083F3 }, /* GL_COMPRESSED_RGBA_S3TC_DXT5_EXT */ + { 4657, 0x000084ED }, /* GL_COMPRESSED_RGB_ARB */ + { 4679, 0x000086B0 }, /* GL_COMPRESSED_RGB_FXT1_3DFX */ + { 4707, 0x000083F0 }, /* GL_COMPRESSED_RGB_S3TC_DXT1_EXT */ + { 4739, 0x000086A3 }, /* GL_COMPRESSED_TEXTURE_FORMATS */ + { 4769, 0x00008576 }, /* GL_CONSTANT */ + { 4781, 0x00008003 }, /* GL_CONSTANT_ALPHA */ + { 4799, 0x00008003 }, /* GL_CONSTANT_ALPHA_EXT */ + { 4821, 0x00008576 }, /* GL_CONSTANT_ARB */ + { 4837, 0x00001207 }, /* GL_CONSTANT_ATTENUATION */ + { 4861, 0x00008151 }, /* GL_CONSTANT_BORDER_HP */ + { 4883, 0x00008001 }, /* GL_CONSTANT_COLOR */ + { 4901, 0x00008001 }, /* GL_CONSTANT_COLOR_EXT */ + { 4923, 0x00008576 }, /* GL_CONSTANT_EXT */ + { 4939, 0x00008010 }, /* GL_CONVOLUTION_1D */ + { 4957, 0x00008011 }, /* GL_CONVOLUTION_2D */ + { 4975, 0x00008154 }, /* GL_CONVOLUTION_BORDER_COLOR */ + { 5003, 0x00008154 }, /* GL_CONVOLUTION_BORDER_COLOR_HP */ + { 5034, 0x00008013 }, /* GL_CONVOLUTION_BORDER_MODE */ + { 5061, 0x00008013 }, /* GL_CONVOLUTION_BORDER_MODE_EXT */ + { 5092, 0x00008015 }, /* GL_CONVOLUTION_FILTER_BIAS */ + { 5119, 0x00008015 }, /* GL_CONVOLUTION_FILTER_BIAS_EXT */ + { 5150, 0x00008014 }, /* GL_CONVOLUTION_FILTER_SCALE */ + { 5178, 0x00008014 }, /* GL_CONVOLUTION_FILTER_SCALE_EXT */ + { 5210, 0x00008017 }, /* GL_CONVOLUTION_FORMAT */ + { 5232, 0x00008017 }, /* GL_CONVOLUTION_FORMAT_EXT */ + { 5258, 0x00008019 }, /* GL_CONVOLUTION_HEIGHT */ + { 5280, 0x00008019 }, /* GL_CONVOLUTION_HEIGHT_EXT */ + { 5306, 0x00008018 }, /* GL_CONVOLUTION_WIDTH */ + { 5327, 0x00008018 }, /* GL_CONVOLUTION_WIDTH_EXT */ + { 5352, 0x00008862 }, /* GL_COORD_REPLACE */ + { 5369, 0x00008862 }, /* GL_COORD_REPLACE_ARB */ + { 5390, 0x00008862 }, /* GL_COORD_REPLACE_NV */ + { 5410, 0x00001503 }, /* GL_COPY */ + { 5418, 0x0000150C }, /* GL_COPY_INVERTED */ + { 5435, 0x00000706 }, /* GL_COPY_PIXEL_TOKEN */ + { 5455, 0x00000B44 }, /* GL_CULL_FACE */ + { 5468, 0x00000B45 }, /* GL_CULL_FACE_MODE */ + { 5486, 0x000081AA }, /* GL_CULL_VERTEX_EXT */ + { 5505, 0x000081AC }, /* GL_CULL_VERTEX_EYE_POSITION_EXT */ + { 5537, 0x000081AB }, /* GL_CULL_VERTEX_OBJECT_POSITION_EXT */ + { 5572, 0x00008626 }, /* GL_CURRENT_ATTRIB_NV */ + { 5593, 0x00000001 }, /* GL_CURRENT_BIT */ + { 5608, 0x00000B00 }, /* GL_CURRENT_COLOR */ + { 5625, 0x00008453 }, /* GL_CURRENT_FOG_COORD */ + { 5646, 0x00008453 }, /* GL_CURRENT_FOG_COORDINATE */ + { 5672, 0x00000B01 }, /* GL_CURRENT_INDEX */ + { 5689, 0x00008641 }, /* GL_CURRENT_MATRIX_ARB */ + { 5711, 0x00008845 }, /* GL_CURRENT_MATRIX_INDEX_ARB */ + { 5739, 0x00008641 }, /* GL_CURRENT_MATRIX_NV */ + { 5760, 0x00008640 }, /* GL_CURRENT_MATRIX_STACK_DEPTH_ARB */ + { 5794, 0x00008640 }, /* GL_CURRENT_MATRIX_STACK_DEPTH_NV */ + { 5827, 0x00000B02 }, /* GL_CURRENT_NORMAL */ + { 5845, 0x00008843 }, /* GL_CURRENT_PALETTE_MATRIX_ARB */ + { 5875, 0x00008B8D }, /* GL_CURRENT_PROGRAM */ + { 5894, 0x00008865 }, /* GL_CURRENT_QUERY */ + { 5911, 0x00008865 }, /* GL_CURRENT_QUERY_ARB */ + { 5932, 0x00000B04 }, /* GL_CURRENT_RASTER_COLOR */ + { 5956, 0x00000B09 }, /* GL_CURRENT_RASTER_DISTANCE */ + { 5983, 0x00000B05 }, /* GL_CURRENT_RASTER_INDEX */ + { 6007, 0x00000B07 }, /* GL_CURRENT_RASTER_POSITION */ + { 6034, 0x00000B08 }, /* GL_CURRENT_RASTER_POSITION_VALID */ + { 6067, 0x00000B06 }, /* GL_CURRENT_RASTER_TEXTURE_COORDS */ + { 6100, 0x00008459 }, /* GL_CURRENT_SECONDARY_COLOR */ + { 6127, 0x00000B03 }, /* GL_CURRENT_TEXTURE_COORDS */ + { 6153, 0x00008626 }, /* GL_CURRENT_VERTEX_ATTRIB */ + { 6178, 0x00008626 }, /* GL_CURRENT_VERTEX_ATTRIB_ARB */ + { 6207, 0x000086A8 }, /* GL_CURRENT_WEIGHT_ARB */ + { 6229, 0x00000900 }, /* GL_CW */ + { 6235, 0x0000875B }, /* GL_DEBUG_ASSERT_MESA */ + { 6256, 0x00008759 }, /* GL_DEBUG_OBJECT_MESA */ + { 6277, 0x0000875A }, /* GL_DEBUG_PRINT_MESA */ + { 6297, 0x00002101 }, /* GL_DECAL */ + { 6306, 0x00001E03 }, /* GL_DECR */ + { 6314, 0x00008508 }, /* GL_DECR_WRAP */ + { 6327, 0x00008508 }, /* GL_DECR_WRAP_EXT */ + { 6344, 0x00008B80 }, /* GL_DELETE_STATUS */ + { 6361, 0x00001801 }, /* GL_DEPTH */ + { 6370, 0x00008D00 }, /* GL_DEPTH_ATTACHMENT_EXT */ + { 6394, 0x00000D1F }, /* GL_DEPTH_BIAS */ + { 6408, 0x00000D56 }, /* GL_DEPTH_BITS */ + { 6422, 0x00008891 }, /* GL_DEPTH_BOUNDS_EXT */ + { 6442, 0x00008890 }, /* GL_DEPTH_BOUNDS_TEST_EXT */ + { 6467, 0x00000100 }, /* GL_DEPTH_BUFFER_BIT */ + { 6487, 0x0000864F }, /* GL_DEPTH_CLAMP_NV */ + { 6505, 0x00000B73 }, /* GL_DEPTH_CLEAR_VALUE */ + { 6526, 0x00001902 }, /* GL_DEPTH_COMPONENT */ + { 6545, 0x000081A5 }, /* GL_DEPTH_COMPONENT16 */ + { 6566, 0x000081A5 }, /* GL_DEPTH_COMPONENT16_ARB */ + { 6591, 0x000081A5 }, /* GL_DEPTH_COMPONENT16_SGIX */ + { 6617, 0x000081A6 }, /* GL_DEPTH_COMPONENT24 */ + { 6638, 0x000081A6 }, /* GL_DEPTH_COMPONENT24_ARB */ + { 6663, 0x000081A6 }, /* GL_DEPTH_COMPONENT24_SGIX */ + { 6689, 0x000081A7 }, /* GL_DEPTH_COMPONENT32 */ + { 6710, 0x000081A7 }, /* GL_DEPTH_COMPONENT32_ARB */ + { 6735, 0x000081A7 }, /* GL_DEPTH_COMPONENT32_SGIX */ + { 6761, 0x00000B74 }, /* GL_DEPTH_FUNC */ + { 6775, 0x00000B70 }, /* GL_DEPTH_RANGE */ + { 6790, 0x00000D1E }, /* GL_DEPTH_SCALE */ + { 6805, 0x000084F9 }, /* GL_DEPTH_STENCIL_NV */ + { 6825, 0x0000886F }, /* GL_DEPTH_STENCIL_TO_BGRA_NV */ + { 6853, 0x0000886E }, /* GL_DEPTH_STENCIL_TO_RGBA_NV */ + { 6881, 0x00000B71 }, /* GL_DEPTH_TEST */ + { 6895, 0x0000884B }, /* GL_DEPTH_TEXTURE_MODE */ + { 6917, 0x0000884B }, /* GL_DEPTH_TEXTURE_MODE_ARB */ + { 6943, 0x00000B72 }, /* GL_DEPTH_WRITEMASK */ + { 6962, 0x00001201 }, /* GL_DIFFUSE */ + { 6973, 0x00000BD0 }, /* GL_DITHER */ + { 6983, 0x00000A02 }, /* GL_DOMAIN */ + { 6993, 0x00001100 }, /* GL_DONT_CARE */ + { 7006, 0x000086AE }, /* GL_DOT3_RGB */ + { 7018, 0x000086AF }, /* GL_DOT3_RGBA */ + { 7031, 0x000086AF }, /* GL_DOT3_RGBA_ARB */ + { 7048, 0x00008741 }, /* GL_DOT3_RGBA_EXT */ + { 7065, 0x000086AE }, /* GL_DOT3_RGB_ARB */ + { 7081, 0x00008740 }, /* GL_DOT3_RGB_EXT */ + { 7097, 0x0000140A }, /* GL_DOUBLE */ + { 7107, 0x00000C32 }, /* GL_DOUBLEBUFFER */ + { 7123, 0x00000C01 }, /* GL_DRAW_BUFFER */ + { 7138, 0x00008825 }, /* GL_DRAW_BUFFER0 */ + { 7154, 0x00008825 }, /* GL_DRAW_BUFFER0_ARB */ + { 7174, 0x00008825 }, /* GL_DRAW_BUFFER0_ATI */ + { 7194, 0x00008826 }, /* GL_DRAW_BUFFER1 */ + { 7210, 0x0000882F }, /* GL_DRAW_BUFFER10 */ + { 7227, 0x0000882F }, /* GL_DRAW_BUFFER10_ARB */ + { 7248, 0x0000882F }, /* GL_DRAW_BUFFER10_ATI */ + { 7269, 0x00008830 }, /* GL_DRAW_BUFFER11 */ + { 7286, 0x00008830 }, /* GL_DRAW_BUFFER11_ARB */ + { 7307, 0x00008830 }, /* GL_DRAW_BUFFER11_ATI */ + { 7328, 0x00008831 }, /* GL_DRAW_BUFFER12 */ + { 7345, 0x00008831 }, /* GL_DRAW_BUFFER12_ARB */ + { 7366, 0x00008831 }, /* GL_DRAW_BUFFER12_ATI */ + { 7387, 0x00008832 }, /* GL_DRAW_BUFFER13 */ + { 7404, 0x00008832 }, /* GL_DRAW_BUFFER13_ARB */ + { 7425, 0x00008832 }, /* GL_DRAW_BUFFER13_ATI */ + { 7446, 0x00008833 }, /* GL_DRAW_BUFFER14 */ + { 7463, 0x00008833 }, /* GL_DRAW_BUFFER14_ARB */ + { 7484, 0x00008833 }, /* GL_DRAW_BUFFER14_ATI */ + { 7505, 0x00008834 }, /* GL_DRAW_BUFFER15 */ + { 7522, 0x00008834 }, /* GL_DRAW_BUFFER15_ARB */ + { 7543, 0x00008834 }, /* GL_DRAW_BUFFER15_ATI */ + { 7564, 0x00008826 }, /* GL_DRAW_BUFFER1_ARB */ + { 7584, 0x00008826 }, /* GL_DRAW_BUFFER1_ATI */ + { 7604, 0x00008827 }, /* GL_DRAW_BUFFER2 */ + { 7620, 0x00008827 }, /* GL_DRAW_BUFFER2_ARB */ + { 7640, 0x00008827 }, /* GL_DRAW_BUFFER2_ATI */ + { 7660, 0x00008828 }, /* GL_DRAW_BUFFER3 */ + { 7676, 0x00008828 }, /* GL_DRAW_BUFFER3_ARB */ + { 7696, 0x00008828 }, /* GL_DRAW_BUFFER3_ATI */ + { 7716, 0x00008829 }, /* GL_DRAW_BUFFER4 */ + { 7732, 0x00008829 }, /* GL_DRAW_BUFFER4_ARB */ + { 7752, 0x00008829 }, /* GL_DRAW_BUFFER4_ATI */ + { 7772, 0x0000882A }, /* GL_DRAW_BUFFER5 */ + { 7788, 0x0000882A }, /* GL_DRAW_BUFFER5_ARB */ + { 7808, 0x0000882A }, /* GL_DRAW_BUFFER5_ATI */ + { 7828, 0x0000882B }, /* GL_DRAW_BUFFER6 */ + { 7844, 0x0000882B }, /* GL_DRAW_BUFFER6_ARB */ + { 7864, 0x0000882B }, /* GL_DRAW_BUFFER6_ATI */ + { 7884, 0x0000882C }, /* GL_DRAW_BUFFER7 */ + { 7900, 0x0000882C }, /* GL_DRAW_BUFFER7_ARB */ + { 7920, 0x0000882C }, /* GL_DRAW_BUFFER7_ATI */ + { 7940, 0x0000882D }, /* GL_DRAW_BUFFER8 */ + { 7956, 0x0000882D }, /* GL_DRAW_BUFFER8_ARB */ + { 7976, 0x0000882D }, /* GL_DRAW_BUFFER8_ATI */ + { 7996, 0x0000882E }, /* GL_DRAW_BUFFER9 */ + { 8012, 0x0000882E }, /* GL_DRAW_BUFFER9_ARB */ + { 8032, 0x0000882E }, /* GL_DRAW_BUFFER9_ATI */ + { 8052, 0x00008CA6 }, /* GL_DRAW_FRAMEBUFFER_BINDING_EXT */ + { 8084, 0x00008CA9 }, /* GL_DRAW_FRAMEBUFFER_EXT */ + { 8108, 0x00000705 }, /* GL_DRAW_PIXEL_TOKEN */ + { 8128, 0x00000304 }, /* GL_DST_ALPHA */ + { 8141, 0x00000306 }, /* GL_DST_COLOR */ + { 8154, 0x000088EA }, /* GL_DYNAMIC_COPY */ + { 8170, 0x000088EA }, /* GL_DYNAMIC_COPY_ARB */ + { 8190, 0x000088E8 }, /* GL_DYNAMIC_DRAW */ + { 8206, 0x000088E8 }, /* GL_DYNAMIC_DRAW_ARB */ + { 8226, 0x000088E9 }, /* GL_DYNAMIC_READ */ + { 8242, 0x000088E9 }, /* GL_DYNAMIC_READ_ARB */ + { 8262, 0x00000B43 }, /* GL_EDGE_FLAG */ + { 8275, 0x00008079 }, /* GL_EDGE_FLAG_ARRAY */ + { 8294, 0x0000889B }, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING */ + { 8328, 0x0000889B }, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB */ + { 8366, 0x00008093 }, /* GL_EDGE_FLAG_ARRAY_POINTER */ + { 8393, 0x0000808C }, /* GL_EDGE_FLAG_ARRAY_STRIDE */ + { 8419, 0x00008893 }, /* GL_ELEMENT_ARRAY_BUFFER */ + { 8443, 0x00008893 }, /* GL_ELEMENT_ARRAY_BUFFER_ARB */ + { 8471, 0x00008895 }, /* GL_ELEMENT_ARRAY_BUFFER_BINDING */ + { 8503, 0x00008895 }, /* GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB */ + { 8539, 0x00001600 }, /* GL_EMISSION */ + { 8551, 0x00002000 }, /* GL_ENABLE_BIT */ + { 8565, 0x00000202 }, /* GL_EQUAL */ + { 8574, 0x00001509 }, /* GL_EQUIV */ + { 8583, 0x00010000 }, /* GL_EVAL_BIT */ + { 8595, 0x00000800 }, /* GL_EXP */ + { 8602, 0x00000801 }, /* GL_EXP2 */ + { 8610, 0x00001F03 }, /* GL_EXTENSIONS */ + { 8624, 0x00002400 }, /* GL_EYE_LINEAR */ + { 8638, 0x00002502 }, /* GL_EYE_PLANE */ + { 8651, 0x0000855C }, /* GL_EYE_PLANE_ABSOLUTE_NV */ + { 8676, 0x0000855B }, /* GL_EYE_RADIAL_NV */ + { 8693, 0x00000000 }, /* GL_FALSE */ + { 8702, 0x00001101 }, /* GL_FASTEST */ + { 8713, 0x00001C01 }, /* GL_FEEDBACK */ + { 8725, 0x00000DF0 }, /* GL_FEEDBACK_BUFFER_POINTER */ + { 8752, 0x00000DF1 }, /* GL_FEEDBACK_BUFFER_SIZE */ + { 8776, 0x00000DF2 }, /* GL_FEEDBACK_BUFFER_TYPE */ + { 8800, 0x00001B02 }, /* GL_FILL */ + { 8808, 0x00001D00 }, /* GL_FLAT */ + { 8816, 0x00001406 }, /* GL_FLOAT */ + { 8825, 0x00008B5A }, /* GL_FLOAT_MAT2 */ + { 8839, 0x00008B5A }, /* GL_FLOAT_MAT2_ARB */ + { 8857, 0x00008B5B }, /* GL_FLOAT_MAT3 */ + { 8871, 0x00008B5B }, /* GL_FLOAT_MAT3_ARB */ + { 8889, 0x00008B5C }, /* GL_FLOAT_MAT4 */ + { 8903, 0x00008B5C }, /* GL_FLOAT_MAT4_ARB */ + { 8921, 0x00008B50 }, /* GL_FLOAT_VEC2 */ + { 8935, 0x00008B50 }, /* GL_FLOAT_VEC2_ARB */ + { 8953, 0x00008B51 }, /* GL_FLOAT_VEC3 */ + { 8967, 0x00008B51 }, /* GL_FLOAT_VEC3_ARB */ + { 8985, 0x00008B52 }, /* GL_FLOAT_VEC4 */ + { 8999, 0x00008B52 }, /* GL_FLOAT_VEC4_ARB */ + { 9017, 0x00000B60 }, /* GL_FOG */ + { 9024, 0x00000080 }, /* GL_FOG_BIT */ + { 9035, 0x00000B66 }, /* GL_FOG_COLOR */ + { 9048, 0x00008451 }, /* GL_FOG_COORD */ + { 9061, 0x00008451 }, /* GL_FOG_COORDINATE */ + { 9079, 0x00008457 }, /* GL_FOG_COORDINATE_ARRAY */ + { 9103, 0x0000889D }, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING */ + { 9142, 0x0000889D }, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB */ + { 9185, 0x00008456 }, /* GL_FOG_COORDINATE_ARRAY_POINTER */ + { 9217, 0x00008455 }, /* GL_FOG_COORDINATE_ARRAY_STRIDE */ + { 9248, 0x00008454 }, /* GL_FOG_COORDINATE_ARRAY_TYPE */ + { 9277, 0x00008450 }, /* GL_FOG_COORDINATE_SOURCE */ + { 9302, 0x00008457 }, /* GL_FOG_COORD_ARRAY */ + { 9321, 0x0000889D }, /* GL_FOG_COORD_ARRAY_BUFFER_BINDING */ + { 9355, 0x00008456 }, /* GL_FOG_COORD_ARRAY_POINTER */ + { 9382, 0x00008455 }, /* GL_FOG_COORD_ARRAY_STRIDE */ + { 9408, 0x00008454 }, /* GL_FOG_COORD_ARRAY_TYPE */ + { 9432, 0x00008450 }, /* GL_FOG_COORD_SRC */ + { 9449, 0x00000B62 }, /* GL_FOG_DENSITY */ + { 9464, 0x0000855A }, /* GL_FOG_DISTANCE_MODE_NV */ + { 9488, 0x00000B64 }, /* GL_FOG_END */ + { 9499, 0x00000C54 }, /* GL_FOG_HINT */ + { 9511, 0x00000B61 }, /* GL_FOG_INDEX */ + { 9524, 0x00000B65 }, /* GL_FOG_MODE */ + { 9536, 0x00008198 }, /* GL_FOG_OFFSET_SGIX */ + { 9555, 0x00008199 }, /* GL_FOG_OFFSET_VALUE_SGIX */ + { 9580, 0x00000B63 }, /* GL_FOG_START */ + { 9593, 0x00008452 }, /* GL_FRAGMENT_DEPTH */ + { 9611, 0x00008804 }, /* GL_FRAGMENT_PROGRAM_ARB */ + { 9635, 0x00008B30 }, /* GL_FRAGMENT_SHADER */ + { 9654, 0x00008B30 }, /* GL_FRAGMENT_SHADER_ARB */ + { 9677, 0x00008B8B }, /* GL_FRAGMENT_SHADER_DERIVATIVE_HINT */ + { 9712, 0x00008CD1 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT */ + { 9754, 0x00008CD0 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT */ + { 9796, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT */ + { 9845, 0x00008CD3 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT */ + { 9897, 0x00008CD2 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT */ + { 9941, 0x00008CA6 }, /* GL_FRAMEBUFFER_BINDING_EXT */ + { 9968, 0x00008CD5 }, /* GL_FRAMEBUFFER_COMPLETE_EXT */ + { 9996, 0x00008D40 }, /* GL_FRAMEBUFFER_EXT */ + { 10015, 0x00008CD6 }, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT */ + { 10056, 0x00008CD9 }, /* GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT */ + { 10097, 0x00008CDB }, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT */ + { 10139, 0x00008CD8 }, /* GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT */ + { 10190, 0x00008CDA }, /* GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT */ + { 10228, 0x00008CD7 }, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT */ + { 10277, 0x00008CDC }, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT */ + { 10319, 0x00008CDE }, /* GL_FRAMEBUFFER_STATUS_ERROR_EXT */ + { 10351, 0x00008CDD }, /* GL_FRAMEBUFFER_UNSUPPORTED_EXT */ + { 10382, 0x00000404 }, /* GL_FRONT */ + { 10391, 0x00000408 }, /* GL_FRONT_AND_BACK */ + { 10409, 0x00000B46 }, /* GL_FRONT_FACE */ + { 10423, 0x00000400 }, /* GL_FRONT_LEFT */ + { 10437, 0x00000401 }, /* GL_FRONT_RIGHT */ + { 10452, 0x00008006 }, /* GL_FUNC_ADD */ + { 10464, 0x00008006 }, /* GL_FUNC_ADD_EXT */ + { 10480, 0x0000800B }, /* GL_FUNC_REVERSE_SUBTRACT */ + { 10505, 0x0000800B }, /* GL_FUNC_REVERSE_SUBTRACT_EXT */ + { 10534, 0x0000800A }, /* GL_FUNC_SUBTRACT */ + { 10551, 0x0000800A }, /* GL_FUNC_SUBTRACT_EXT */ + { 10572, 0x00008191 }, /* GL_GENERATE_MIPMAP */ + { 10591, 0x00008192 }, /* GL_GENERATE_MIPMAP_HINT */ + { 10615, 0x00008192 }, /* GL_GENERATE_MIPMAP_HINT_SGIS */ + { 10644, 0x00008191 }, /* GL_GENERATE_MIPMAP_SGIS */ + { 10668, 0x00000206 }, /* GL_GEQUAL */ + { 10678, 0x00008009 }, /* GL_GL_BLEND_EQUATION_RGB */ + { 10703, 0x00008C4A }, /* GL_GL_COMPRESSED_SLUMINANCE */ + { 10731, 0x00008C4B }, /* GL_GL_COMPRESSED_SLUMINANCE_ALPHA */ + { 10765, 0x00008C48 }, /* GL_GL_COMPRESSED_SRGB */ + { 10787, 0x00008C49 }, /* GL_GL_COMPRESSED_SRGB_ALPHA */ + { 10815, 0x0000845F }, /* GL_GL_CURRENT_RASTER_SECONDARY_COLOR */ + { 10852, 0x00008B65 }, /* GL_GL_FLOAT_MAT2x3 */ + { 10871, 0x00008B66 }, /* GL_GL_FLOAT_MAT2x4 */ + { 10890, 0x00008B67 }, /* GL_GL_FLOAT_MAT3x2 */ + { 10909, 0x00008B68 }, /* GL_GL_FLOAT_MAT3x4 */ + { 10928, 0x00008B69 }, /* GL_GL_FLOAT_MAT4x2 */ + { 10947, 0x00008B6A }, /* GL_GL_FLOAT_MAT4x3 */ + { 10966, 0x000088EB }, /* GL_GL_PIXEL_PACK_BUFFER */ + { 10990, 0x000088ED }, /* GL_GL_PIXEL_PACK_BUFFER_BINDING */ + { 11022, 0x000088EC }, /* GL_GL_PIXEL_UNPACK_BUFFER */ + { 11048, 0x000088EF }, /* GL_GL_PIXEL_UNPACK_BUFFER_BINDING */ + { 11082, 0x00008C46 }, /* GL_GL_SLUMINANCE */ + { 11099, 0x00008C47 }, /* GL_GL_SLUMINANCE8 */ + { 11117, 0x00008C45 }, /* GL_GL_SLUMINANCE8_ALPHA8 */ + { 11142, 0x00008C44 }, /* GL_GL_SLUMINANCE_ALPHA */ + { 11165, 0x00008C40 }, /* GL_GL_SRGB */ + { 11176, 0x00008C41 }, /* GL_GL_SRGB8 */ + { 11188, 0x00008C43 }, /* GL_GL_SRGB8_ALPHA8 */ + { 11207, 0x00008C42 }, /* GL_GL_SRGB_ALPHA */ + { 11224, 0x00000204 }, /* GL_GREATER */ + { 11235, 0x00001904 }, /* GL_GREEN */ + { 11244, 0x00000D19 }, /* GL_GREEN_BIAS */ + { 11258, 0x00000D53 }, /* GL_GREEN_BITS */ + { 11272, 0x00000D18 }, /* GL_GREEN_SCALE */ + { 11287, 0x00008000 }, /* GL_HINT_BIT */ + { 11299, 0x00008024 }, /* GL_HISTOGRAM */ + { 11312, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE */ + { 11336, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE_EXT */ + { 11364, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE */ + { 11387, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE_EXT */ + { 11414, 0x00008024 }, /* GL_HISTOGRAM_EXT */ + { 11431, 0x00008027 }, /* GL_HISTOGRAM_FORMAT */ + { 11451, 0x00008027 }, /* GL_HISTOGRAM_FORMAT_EXT */ + { 11475, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE */ + { 11499, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE_EXT */ + { 11527, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE */ + { 11555, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE_EXT */ + { 11587, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE */ + { 11609, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE_EXT */ + { 11635, 0x0000802D }, /* GL_HISTOGRAM_SINK */ + { 11653, 0x0000802D }, /* GL_HISTOGRAM_SINK_EXT */ + { 11675, 0x00008026 }, /* GL_HISTOGRAM_WIDTH */ + { 11694, 0x00008026 }, /* GL_HISTOGRAM_WIDTH_EXT */ + { 11717, 0x0000862A }, /* GL_IDENTITY_NV */ + { 11732, 0x00008150 }, /* GL_IGNORE_BORDER_HP */ + { 11752, 0x00008B9B }, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */ + { 11792, 0x00008B9A }, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */ + { 11830, 0x00001E02 }, /* GL_INCR */ + { 11838, 0x00008507 }, /* GL_INCR_WRAP */ + { 11851, 0x00008507 }, /* GL_INCR_WRAP_EXT */ + { 11868, 0x00008077 }, /* GL_INDEX_ARRAY */ + { 11883, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING */ + { 11913, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING_ARB */ + { 11947, 0x00008091 }, /* GL_INDEX_ARRAY_POINTER */ + { 11970, 0x00008086 }, /* GL_INDEX_ARRAY_STRIDE */ + { 11992, 0x00008085 }, /* GL_INDEX_ARRAY_TYPE */ + { 12012, 0x00000D51 }, /* GL_INDEX_BITS */ + { 12026, 0x00000C20 }, /* GL_INDEX_CLEAR_VALUE */ + { 12047, 0x00000BF1 }, /* GL_INDEX_LOGIC_OP */ + { 12065, 0x00000C30 }, /* GL_INDEX_MODE */ + { 12079, 0x00000D13 }, /* GL_INDEX_OFFSET */ + { 12095, 0x00000D12 }, /* GL_INDEX_SHIFT */ + { 12110, 0x00000C21 }, /* GL_INDEX_WRITEMASK */ + { 12129, 0x00008B84 }, /* GL_INFO_LOG_LENGTH */ + { 12148, 0x00001404 }, /* GL_INT */ + { 12155, 0x00008049 }, /* GL_INTENSITY */ + { 12168, 0x0000804C }, /* GL_INTENSITY12 */ + { 12183, 0x0000804C }, /* GL_INTENSITY12_EXT */ + { 12202, 0x0000804D }, /* GL_INTENSITY16 */ + { 12217, 0x0000804D }, /* GL_INTENSITY16_EXT */ + { 12236, 0x0000804A }, /* GL_INTENSITY4 */ + { 12250, 0x0000804A }, /* GL_INTENSITY4_EXT */ + { 12268, 0x0000804B }, /* GL_INTENSITY8 */ + { 12282, 0x0000804B }, /* GL_INTENSITY8_EXT */ + { 12300, 0x00008049 }, /* GL_INTENSITY_EXT */ + { 12317, 0x00008575 }, /* GL_INTERPOLATE */ + { 12332, 0x00008575 }, /* GL_INTERPOLATE_ARB */ + { 12351, 0x00008575 }, /* GL_INTERPOLATE_EXT */ + { 12370, 0x00008B53 }, /* GL_INT_VEC2 */ + { 12382, 0x00008B53 }, /* GL_INT_VEC2_ARB */ + { 12398, 0x00008B54 }, /* GL_INT_VEC3 */ + { 12410, 0x00008B54 }, /* GL_INT_VEC3_ARB */ + { 12426, 0x00008B55 }, /* GL_INT_VEC4 */ + { 12438, 0x00008B55 }, /* GL_INT_VEC4_ARB */ + { 12454, 0x00000500 }, /* GL_INVALID_ENUM */ + { 12470, 0x00000506 }, /* GL_INVALID_FRAMEBUFFER_OPERATION_EXT */ + { 12507, 0x00000502 }, /* GL_INVALID_OPERATION */ + { 12528, 0x00000501 }, /* GL_INVALID_VALUE */ + { 12545, 0x0000862B }, /* GL_INVERSE_NV */ + { 12559, 0x0000862D }, /* GL_INVERSE_TRANSPOSE_NV */ + { 12583, 0x0000150A }, /* GL_INVERT */ + { 12593, 0x00001E00 }, /* GL_KEEP */ + { 12601, 0x00000406 }, /* GL_LEFT */ + { 12609, 0x00000203 }, /* GL_LEQUAL */ + { 12619, 0x00000201 }, /* GL_LESS */ + { 12627, 0x00004000 }, /* GL_LIGHT0 */ + { 12637, 0x00004001 }, /* GL_LIGHT1 */ + { 12647, 0x00004002 }, /* GL_LIGHT2 */ + { 12657, 0x00004003 }, /* GL_LIGHT3 */ + { 12667, 0x00004004 }, /* GL_LIGHT4 */ + { 12677, 0x00004005 }, /* GL_LIGHT5 */ + { 12687, 0x00004006 }, /* GL_LIGHT6 */ + { 12697, 0x00004007 }, /* GL_LIGHT7 */ + { 12707, 0x00000B50 }, /* GL_LIGHTING */ + { 12719, 0x00000040 }, /* GL_LIGHTING_BIT */ + { 12735, 0x00000B53 }, /* GL_LIGHT_MODEL_AMBIENT */ + { 12758, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL */ + { 12787, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL_EXT */ + { 12820, 0x00000B51 }, /* GL_LIGHT_MODEL_LOCAL_VIEWER */ + { 12848, 0x00000B52 }, /* GL_LIGHT_MODEL_TWO_SIDE */ + { 12872, 0x00001B01 }, /* GL_LINE */ + { 12880, 0x00002601 }, /* GL_LINEAR */ + { 12890, 0x00001208 }, /* GL_LINEAR_ATTENUATION */ + { 12912, 0x00008170 }, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */ + { 12942, 0x0000844F }, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */ + { 12973, 0x00002703 }, /* GL_LINEAR_MIPMAP_LINEAR */ + { 12997, 0x00002701 }, /* GL_LINEAR_MIPMAP_NEAREST */ + { 13022, 0x00000001 }, /* GL_LINES */ + { 13031, 0x00000004 }, /* GL_LINE_BIT */ + { 13043, 0x00000002 }, /* GL_LINE_LOOP */ + { 13056, 0x00000707 }, /* GL_LINE_RESET_TOKEN */ + { 13076, 0x00000B20 }, /* GL_LINE_SMOOTH */ + { 13091, 0x00000C52 }, /* GL_LINE_SMOOTH_HINT */ + { 13111, 0x00000B24 }, /* GL_LINE_STIPPLE */ + { 13127, 0x00000B25 }, /* GL_LINE_STIPPLE_PATTERN */ + { 13151, 0x00000B26 }, /* GL_LINE_STIPPLE_REPEAT */ + { 13174, 0x00000003 }, /* GL_LINE_STRIP */ + { 13188, 0x00000702 }, /* GL_LINE_TOKEN */ + { 13202, 0x00000B21 }, /* GL_LINE_WIDTH */ + { 13216, 0x00000B23 }, /* GL_LINE_WIDTH_GRANULARITY */ + { 13242, 0x00000B22 }, /* GL_LINE_WIDTH_RANGE */ + { 13262, 0x00008B82 }, /* GL_LINK_STATUS */ + { 13277, 0x00000B32 }, /* GL_LIST_BASE */ + { 13290, 0x00020000 }, /* GL_LIST_BIT */ + { 13302, 0x00000B33 }, /* GL_LIST_INDEX */ + { 13316, 0x00000B30 }, /* GL_LIST_MODE */ + { 13329, 0x00000101 }, /* GL_LOAD */ + { 13337, 0x00000BF1 }, /* GL_LOGIC_OP */ + { 13349, 0x00000BF0 }, /* GL_LOGIC_OP_MODE */ + { 13366, 0x00008CA1 }, /* GL_LOWER_LEFT */ + { 13380, 0x00001909 }, /* GL_LUMINANCE */ + { 13393, 0x00008041 }, /* GL_LUMINANCE12 */ + { 13408, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12 */ + { 13431, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12_EXT */ + { 13458, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4 */ + { 13480, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4_EXT */ + { 13506, 0x00008041 }, /* GL_LUMINANCE12_EXT */ + { 13525, 0x00008042 }, /* GL_LUMINANCE16 */ + { 13540, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16 */ + { 13563, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16_EXT */ + { 13590, 0x00008042 }, /* GL_LUMINANCE16_EXT */ + { 13609, 0x0000803F }, /* GL_LUMINANCE4 */ + { 13623, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4 */ + { 13644, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4_EXT */ + { 13669, 0x0000803F }, /* GL_LUMINANCE4_EXT */ + { 13687, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2 */ + { 13708, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2_EXT */ + { 13733, 0x00008040 }, /* GL_LUMINANCE8 */ + { 13747, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8 */ + { 13768, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8_EXT */ + { 13793, 0x00008040 }, /* GL_LUMINANCE8_EXT */ + { 13811, 0x0000190A }, /* GL_LUMINANCE_ALPHA */ + { 13830, 0x00000D90 }, /* GL_MAP1_COLOR_4 */ + { 13846, 0x00000DD0 }, /* GL_MAP1_GRID_DOMAIN */ + { 13866, 0x00000DD1 }, /* GL_MAP1_GRID_SEGMENTS */ + { 13888, 0x00000D91 }, /* GL_MAP1_INDEX */ + { 13902, 0x00000D92 }, /* GL_MAP1_NORMAL */ + { 13917, 0x00000D93 }, /* GL_MAP1_TEXTURE_COORD_1 */ + { 13941, 0x00000D94 }, /* GL_MAP1_TEXTURE_COORD_2 */ + { 13965, 0x00000D95 }, /* GL_MAP1_TEXTURE_COORD_3 */ + { 13989, 0x00000D96 }, /* GL_MAP1_TEXTURE_COORD_4 */ + { 14013, 0x00000D97 }, /* GL_MAP1_VERTEX_3 */ + { 14030, 0x00000D98 }, /* GL_MAP1_VERTEX_4 */ + { 14047, 0x00008660 }, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */ + { 14075, 0x0000866A }, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */ + { 14104, 0x0000866B }, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */ + { 14133, 0x0000866C }, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */ + { 14162, 0x0000866D }, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */ + { 14191, 0x0000866E }, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */ + { 14220, 0x0000866F }, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */ + { 14249, 0x00008661 }, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */ + { 14277, 0x00008662 }, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */ + { 14305, 0x00008663 }, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */ + { 14333, 0x00008664 }, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */ + { 14361, 0x00008665 }, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */ + { 14389, 0x00008666 }, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */ + { 14417, 0x00008667 }, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */ + { 14445, 0x00008668 }, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */ + { 14473, 0x00008669 }, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */ + { 14501, 0x00000DB0 }, /* GL_MAP2_COLOR_4 */ + { 14517, 0x00000DD2 }, /* GL_MAP2_GRID_DOMAIN */ + { 14537, 0x00000DD3 }, /* GL_MAP2_GRID_SEGMENTS */ + { 14559, 0x00000DB1 }, /* GL_MAP2_INDEX */ + { 14573, 0x00000DB2 }, /* GL_MAP2_NORMAL */ + { 14588, 0x00000DB3 }, /* GL_MAP2_TEXTURE_COORD_1 */ + { 14612, 0x00000DB4 }, /* GL_MAP2_TEXTURE_COORD_2 */ + { 14636, 0x00000DB5 }, /* GL_MAP2_TEXTURE_COORD_3 */ + { 14660, 0x00000DB6 }, /* GL_MAP2_TEXTURE_COORD_4 */ + { 14684, 0x00000DB7 }, /* GL_MAP2_VERTEX_3 */ + { 14701, 0x00000DB8 }, /* GL_MAP2_VERTEX_4 */ + { 14718, 0x00008670 }, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */ + { 14746, 0x0000867A }, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */ + { 14775, 0x0000867B }, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */ + { 14804, 0x0000867C }, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */ + { 14833, 0x0000867D }, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */ + { 14862, 0x0000867E }, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */ + { 14891, 0x0000867F }, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */ + { 14920, 0x00008671 }, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */ + { 14948, 0x00008672 }, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */ + { 14976, 0x00008673 }, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */ + { 15004, 0x00008674 }, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */ + { 15032, 0x00008675 }, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */ + { 15060, 0x00008676 }, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */ + { 15088, 0x00008677 }, /* GL_MAP2_VERTEX_ATTRIB7_4_NV */ + { 15116, 0x00008678 }, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */ + { 15144, 0x00008679 }, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */ + { 15172, 0x00000D10 }, /* GL_MAP_COLOR */ + { 15185, 0x00000D11 }, /* GL_MAP_STENCIL */ + { 15200, 0x000088C0 }, /* GL_MATRIX0_ARB */ + { 15215, 0x00008630 }, /* GL_MATRIX0_NV */ + { 15229, 0x000088CA }, /* GL_MATRIX10_ARB */ + { 15245, 0x000088CB }, /* GL_MATRIX11_ARB */ + { 15261, 0x000088CC }, /* GL_MATRIX12_ARB */ + { 15277, 0x000088CD }, /* GL_MATRIX13_ARB */ + { 15293, 0x000088CE }, /* GL_MATRIX14_ARB */ + { 15309, 0x000088CF }, /* GL_MATRIX15_ARB */ + { 15325, 0x000088D0 }, /* GL_MATRIX16_ARB */ + { 15341, 0x000088D1 }, /* GL_MATRIX17_ARB */ + { 15357, 0x000088D2 }, /* GL_MATRIX18_ARB */ + { 15373, 0x000088D3 }, /* GL_MATRIX19_ARB */ + { 15389, 0x000088C1 }, /* GL_MATRIX1_ARB */ + { 15404, 0x00008631 }, /* GL_MATRIX1_NV */ + { 15418, 0x000088D4 }, /* GL_MATRIX20_ARB */ + { 15434, 0x000088D5 }, /* GL_MATRIX21_ARB */ + { 15450, 0x000088D6 }, /* GL_MATRIX22_ARB */ + { 15466, 0x000088D7 }, /* GL_MATRIX23_ARB */ + { 15482, 0x000088D8 }, /* GL_MATRIX24_ARB */ + { 15498, 0x000088D9 }, /* GL_MATRIX25_ARB */ + { 15514, 0x000088DA }, /* GL_MATRIX26_ARB */ + { 15530, 0x000088DB }, /* GL_MATRIX27_ARB */ + { 15546, 0x000088DC }, /* GL_MATRIX28_ARB */ + { 15562, 0x000088DD }, /* GL_MATRIX29_ARB */ + { 15578, 0x000088C2 }, /* GL_MATRIX2_ARB */ + { 15593, 0x00008632 }, /* GL_MATRIX2_NV */ + { 15607, 0x000088DE }, /* GL_MATRIX30_ARB */ + { 15623, 0x000088DF }, /* GL_MATRIX31_ARB */ + { 15639, 0x000088C3 }, /* GL_MATRIX3_ARB */ + { 15654, 0x00008633 }, /* GL_MATRIX3_NV */ + { 15668, 0x000088C4 }, /* GL_MATRIX4_ARB */ + { 15683, 0x00008634 }, /* GL_MATRIX4_NV */ + { 15697, 0x000088C5 }, /* GL_MATRIX5_ARB */ + { 15712, 0x00008635 }, /* GL_MATRIX5_NV */ + { 15726, 0x000088C6 }, /* GL_MATRIX6_ARB */ + { 15741, 0x00008636 }, /* GL_MATRIX6_NV */ + { 15755, 0x000088C7 }, /* GL_MATRIX7_ARB */ + { 15770, 0x00008637 }, /* GL_MATRIX7_NV */ + { 15784, 0x000088C8 }, /* GL_MATRIX8_ARB */ + { 15799, 0x000088C9 }, /* GL_MATRIX9_ARB */ + { 15814, 0x00008844 }, /* GL_MATRIX_INDEX_ARRAY_ARB */ + { 15840, 0x00008849 }, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */ + { 15874, 0x00008846 }, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */ + { 15905, 0x00008848 }, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */ + { 15938, 0x00008847 }, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */ + { 15969, 0x00000BA0 }, /* GL_MATRIX_MODE */ + { 15984, 0x00008840 }, /* GL_MATRIX_PALETTE_ARB */ + { 16006, 0x00008008 }, /* GL_MAX */ + { 16013, 0x00008073 }, /* GL_MAX_3D_TEXTURE_SIZE */ + { 16036, 0x00000D35 }, /* GL_MAX_ATTRIB_STACK_DEPTH */ + { 16062, 0x00000D3B }, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */ + { 16095, 0x00008177 }, /* GL_MAX_CLIPMAP_DEPTH_SGIX */ + { 16121, 0x00008178 }, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */ + { 16155, 0x00000D32 }, /* GL_MAX_CLIP_PLANES */ + { 16174, 0x00008CDF }, /* GL_MAX_COLOR_ATTACHMENTS_EXT */ + { 16203, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */ + { 16235, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI */ + { 16271, 0x00008B4D }, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS */ + { 16307, 0x00008B4D }, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB */ + { 16347, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT */ + { 16373, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT_EXT */ + { 16403, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH */ + { 16428, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH_EXT */ + { 16457, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */ + { 16486, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB */ + { 16519, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS */ + { 16539, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ARB */ + { 16563, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ATI */ + { 16587, 0x000080E9 }, /* GL_MAX_ELEMENTS_INDICES */ + { 16611, 0x000080E8 }, /* GL_MAX_ELEMENTS_VERTICES */ + { 16636, 0x00000D30 }, /* GL_MAX_EVAL_ORDER */ + { 16654, 0x00008008 }, /* GL_MAX_EXT */ + { 16665, 0x00008B49 }, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS */ + { 16700, 0x00008B49 }, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB */ + { 16739, 0x00000D31 }, /* GL_MAX_LIGHTS */ + { 16753, 0x00000B31 }, /* GL_MAX_LIST_NESTING */ + { 16773, 0x00008841 }, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */ + { 16811, 0x00000D36 }, /* GL_MAX_MODELVIEW_STACK_DEPTH */ + { 16840, 0x00000D37 }, /* GL_MAX_NAME_STACK_DEPTH */ + { 16864, 0x00008842 }, /* GL_MAX_PALETTE_MATRICES_ARB */ + { 16892, 0x00000D34 }, /* GL_MAX_PIXEL_MAP_TABLE */ + { 16915, 0x000088B1 }, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */ + { 16952, 0x0000880B }, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */ + { 16988, 0x000088AD }, /* GL_MAX_PROGRAM_ATTRIBS_ARB */ + { 17015, 0x000088F5 }, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */ + { 17044, 0x000088B5 }, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */ + { 17078, 0x000088F4 }, /* GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */ + { 17114, 0x000088F6 }, /* GL_MAX_PROGRAM_IF_DEPTH_NV */ + { 17141, 0x000088A1 }, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */ + { 17173, 0x000088B4 }, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */ + { 17209, 0x000088F8 }, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */ + { 17238, 0x000088F7 }, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */ + { 17267, 0x0000862F }, /* GL_MAX_PROGRAM_MATRICES_ARB */ + { 17295, 0x0000862E }, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */ + { 17333, 0x000088B3 }, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ + { 17377, 0x0000880E }, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ + { 17420, 0x000088AF }, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */ + { 17454, 0x000088A3 }, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ + { 17493, 0x000088AB }, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */ + { 17530, 0x000088A7 }, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */ + { 17568, 0x00008810 }, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ + { 17611, 0x0000880F }, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ + { 17654, 0x000088A9 }, /* GL_MAX_PROGRAM_PARAMETERS_ARB */ + { 17684, 0x000088A5 }, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */ + { 17715, 0x0000880D }, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */ + { 17751, 0x0000880C }, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */ + { 17787, 0x00000D38 }, /* GL_MAX_PROJECTION_STACK_DEPTH */ + { 17817, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB */ + { 17851, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_NV */ + { 17884, 0x000084E8 }, /* GL_MAX_RENDERBUFFER_SIZE_EXT */ + { 17913, 0x00008504 }, /* GL_MAX_SHININESS_NV */ + { 17933, 0x00008505 }, /* GL_MAX_SPOT_EXPONENT_NV */ + { 17957, 0x00008871 }, /* GL_MAX_TEXTURE_COORDS */ + { 17979, 0x00008871 }, /* GL_MAX_TEXTURE_COORDS_ARB */ + { 18005, 0x00008872 }, /* GL_MAX_TEXTURE_IMAGE_UNITS */ + { 18032, 0x00008872 }, /* GL_MAX_TEXTURE_IMAGE_UNITS_ARB */ + { 18063, 0x000084FD }, /* GL_MAX_TEXTURE_LOD_BIAS */ + { 18087, 0x000084FF }, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */ + { 18121, 0x00000D33 }, /* GL_MAX_TEXTURE_SIZE */ + { 18141, 0x00000D39 }, /* GL_MAX_TEXTURE_STACK_DEPTH */ + { 18168, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS */ + { 18189, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS_ARB */ + { 18214, 0x0000862F }, /* GL_MAX_TRACK_MATRICES_NV */ + { 18239, 0x0000862E }, /* GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV */ + { 18274, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS */ + { 18296, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS_ARB */ + { 18322, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS */ + { 18344, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS_ARB */ + { 18370, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS */ + { 18404, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */ + { 18442, 0x00008B4A }, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS */ + { 18475, 0x00008B4A }, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB */ + { 18512, 0x000086A4 }, /* GL_MAX_VERTEX_UNITS_ARB */ + { 18536, 0x00000D3A }, /* GL_MAX_VIEWPORT_DIMS */ + { 18557, 0x00008007 }, /* GL_MIN */ + { 18564, 0x0000802E }, /* GL_MINMAX */ + { 18574, 0x0000802E }, /* GL_MINMAX_EXT */ + { 18588, 0x0000802F }, /* GL_MINMAX_FORMAT */ + { 18605, 0x0000802F }, /* GL_MINMAX_FORMAT_EXT */ + { 18626, 0x00008030 }, /* GL_MINMAX_SINK */ + { 18641, 0x00008030 }, /* GL_MINMAX_SINK_EXT */ + { 18660, 0x00008007 }, /* GL_MIN_EXT */ + { 18671, 0x00008370 }, /* GL_MIRRORED_REPEAT */ + { 18690, 0x00008370 }, /* GL_MIRRORED_REPEAT_ARB */ + { 18713, 0x00008370 }, /* GL_MIRRORED_REPEAT_IBM */ + { 18736, 0x00008742 }, /* GL_MIRROR_CLAMP_ATI */ + { 18756, 0x00008742 }, /* GL_MIRROR_CLAMP_EXT */ + { 18776, 0x00008912 }, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */ + { 18806, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_ATI */ + { 18834, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */ + { 18862, 0x00001700 }, /* GL_MODELVIEW */ + { 18875, 0x00001700 }, /* GL_MODELVIEW0_ARB */ + { 18893, 0x0000872A }, /* GL_MODELVIEW10_ARB */ + { 18912, 0x0000872B }, /* GL_MODELVIEW11_ARB */ + { 18931, 0x0000872C }, /* GL_MODELVIEW12_ARB */ + { 18950, 0x0000872D }, /* GL_MODELVIEW13_ARB */ + { 18969, 0x0000872E }, /* GL_MODELVIEW14_ARB */ + { 18988, 0x0000872F }, /* GL_MODELVIEW15_ARB */ + { 19007, 0x00008730 }, /* GL_MODELVIEW16_ARB */ + { 19026, 0x00008731 }, /* GL_MODELVIEW17_ARB */ + { 19045, 0x00008732 }, /* GL_MODELVIEW18_ARB */ + { 19064, 0x00008733 }, /* GL_MODELVIEW19_ARB */ + { 19083, 0x0000850A }, /* GL_MODELVIEW1_ARB */ + { 19101, 0x00008734 }, /* GL_MODELVIEW20_ARB */ + { 19120, 0x00008735 }, /* GL_MODELVIEW21_ARB */ + { 19139, 0x00008736 }, /* GL_MODELVIEW22_ARB */ + { 19158, 0x00008737 }, /* GL_MODELVIEW23_ARB */ + { 19177, 0x00008738 }, /* GL_MODELVIEW24_ARB */ + { 19196, 0x00008739 }, /* GL_MODELVIEW25_ARB */ + { 19215, 0x0000873A }, /* GL_MODELVIEW26_ARB */ + { 19234, 0x0000873B }, /* GL_MODELVIEW27_ARB */ + { 19253, 0x0000873C }, /* GL_MODELVIEW28_ARB */ + { 19272, 0x0000873D }, /* GL_MODELVIEW29_ARB */ + { 19291, 0x00008722 }, /* GL_MODELVIEW2_ARB */ + { 19309, 0x0000873E }, /* GL_MODELVIEW30_ARB */ + { 19328, 0x0000873F }, /* GL_MODELVIEW31_ARB */ + { 19347, 0x00008723 }, /* GL_MODELVIEW3_ARB */ + { 19365, 0x00008724 }, /* GL_MODELVIEW4_ARB */ + { 19383, 0x00008725 }, /* GL_MODELVIEW5_ARB */ + { 19401, 0x00008726 }, /* GL_MODELVIEW6_ARB */ + { 19419, 0x00008727 }, /* GL_MODELVIEW7_ARB */ + { 19437, 0x00008728 }, /* GL_MODELVIEW8_ARB */ + { 19455, 0x00008729 }, /* GL_MODELVIEW9_ARB */ + { 19473, 0x00000BA6 }, /* GL_MODELVIEW_MATRIX */ + { 19493, 0x00008629 }, /* GL_MODELVIEW_PROJECTION_NV */ + { 19520, 0x00000BA3 }, /* GL_MODELVIEW_STACK_DEPTH */ + { 19545, 0x00002100 }, /* GL_MODULATE */ + { 19557, 0x00008744 }, /* GL_MODULATE_ADD_ATI */ + { 19577, 0x00008745 }, /* GL_MODULATE_SIGNED_ADD_ATI */ + { 19604, 0x00008746 }, /* GL_MODULATE_SUBTRACT_ATI */ + { 19629, 0x00000103 }, /* GL_MULT */ + { 19637, 0x0000809D }, /* GL_MULTISAMPLE */ + { 19652, 0x000086B2 }, /* GL_MULTISAMPLE_3DFX */ + { 19672, 0x0000809D }, /* GL_MULTISAMPLE_ARB */ + { 19691, 0x20000000 }, /* GL_MULTISAMPLE_BIT */ + { 19710, 0x20000000 }, /* GL_MULTISAMPLE_BIT_3DFX */ + { 19734, 0x20000000 }, /* GL_MULTISAMPLE_BIT_ARB */ + { 19757, 0x00008534 }, /* GL_MULTISAMPLE_FILTER_HINT_NV */ + { 19787, 0x00002A25 }, /* GL_N3F_V3F */ + { 19798, 0x00000D70 }, /* GL_NAME_STACK_DEPTH */ + { 19818, 0x0000150E }, /* GL_NAND */ + { 19826, 0x00002600 }, /* GL_NEAREST */ + { 19837, 0x0000844E }, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */ + { 19868, 0x0000844D }, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */ + { 19900, 0x00002702 }, /* GL_NEAREST_MIPMAP_LINEAR */ + { 19925, 0x00002700 }, /* GL_NEAREST_MIPMAP_NEAREST */ + { 19951, 0x00000200 }, /* GL_NEVER */ + { 19960, 0x00001102 }, /* GL_NICEST */ + { 19970, 0x00000000 }, /* GL_NONE */ + { 19978, 0x00001505 }, /* GL_NOOP */ + { 19986, 0x00001508 }, /* GL_NOR */ + { 19993, 0x00000BA1 }, /* GL_NORMALIZE */ + { 20006, 0x00008075 }, /* GL_NORMAL_ARRAY */ + { 20022, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING */ + { 20053, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING_ARB */ + { 20088, 0x0000808F }, /* GL_NORMAL_ARRAY_POINTER */ + { 20112, 0x0000807F }, /* GL_NORMAL_ARRAY_STRIDE */ + { 20135, 0x0000807E }, /* GL_NORMAL_ARRAY_TYPE */ + { 20156, 0x00008511 }, /* GL_NORMAL_MAP */ + { 20170, 0x00008511 }, /* GL_NORMAL_MAP_ARB */ + { 20188, 0x00008511 }, /* GL_NORMAL_MAP_NV */ + { 20205, 0x00000205 }, /* GL_NOTEQUAL */ + { 20217, 0x00000000 }, /* GL_NO_ERROR */ + { 20229, 0x000086A2 }, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */ + { 20263, 0x000086A2 }, /* GL_NUM_TEXTURE_COMPRESSED_FORMATS_ARB */ + { 20301, 0x00008B89 }, /* GL_OBJECT_ACTIVE_ATTRIBUTES_ARB */ + { 20333, 0x00008B8A }, /* GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB */ + { 20375, 0x00008B86 }, /* GL_OBJECT_ACTIVE_UNIFORMS_ARB */ + { 20405, 0x00008B87 }, /* GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB */ + { 20445, 0x00008B85 }, /* GL_OBJECT_ATTACHED_OBJECTS_ARB */ + { 20476, 0x00008B81 }, /* GL_OBJECT_COMPILE_STATUS_ARB */ + { 20505, 0x00008B80 }, /* GL_OBJECT_DELETE_STATUS_ARB */ + { 20533, 0x00008B84 }, /* GL_OBJECT_INFO_LOG_LENGTH_ARB */ + { 20563, 0x00002401 }, /* GL_OBJECT_LINEAR */ + { 20580, 0x00008B82 }, /* GL_OBJECT_LINK_STATUS_ARB */ + { 20606, 0x00002501 }, /* GL_OBJECT_PLANE */ + { 20622, 0x00008B88 }, /* GL_OBJECT_SHADER_SOURCE_LENGTH_ARB */ + { 20657, 0x00008B4F }, /* GL_OBJECT_SUBTYPE_ARB */ + { 20679, 0x00008B4E }, /* GL_OBJECT_TYPE_ARB */ + { 20698, 0x00008B83 }, /* GL_OBJECT_VALIDATE_STATUS_ARB */ + { 20728, 0x00008165 }, /* GL_OCCLUSION_TEST_HP */ + { 20749, 0x00008166 }, /* GL_OCCLUSION_TEST_RESULT_HP */ + { 20777, 0x00000001 }, /* GL_ONE */ + { 20784, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA */ + { 20812, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA_EXT */ + { 20844, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR */ + { 20872, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR_EXT */ + { 20904, 0x00000305 }, /* GL_ONE_MINUS_DST_ALPHA */ + { 20927, 0x00000307 }, /* GL_ONE_MINUS_DST_COLOR */ + { 20950, 0x00000303 }, /* GL_ONE_MINUS_SRC_ALPHA */ + { 20973, 0x00000301 }, /* GL_ONE_MINUS_SRC_COLOR */ + { 20996, 0x00008598 }, /* GL_OPERAND0_ALPHA */ + { 21014, 0x00008598 }, /* GL_OPERAND0_ALPHA_ARB */ + { 21036, 0x00008598 }, /* GL_OPERAND0_ALPHA_EXT */ + { 21058, 0x00008590 }, /* GL_OPERAND0_RGB */ + { 21074, 0x00008590 }, /* GL_OPERAND0_RGB_ARB */ + { 21094, 0x00008590 }, /* GL_OPERAND0_RGB_EXT */ + { 21114, 0x00008599 }, /* GL_OPERAND1_ALPHA */ + { 21132, 0x00008599 }, /* GL_OPERAND1_ALPHA_ARB */ + { 21154, 0x00008599 }, /* GL_OPERAND1_ALPHA_EXT */ + { 21176, 0x00008591 }, /* GL_OPERAND1_RGB */ + { 21192, 0x00008591 }, /* GL_OPERAND1_RGB_ARB */ + { 21212, 0x00008591 }, /* GL_OPERAND1_RGB_EXT */ + { 21232, 0x0000859A }, /* GL_OPERAND2_ALPHA */ + { 21250, 0x0000859A }, /* GL_OPERAND2_ALPHA_ARB */ + { 21272, 0x0000859A }, /* GL_OPERAND2_ALPHA_EXT */ + { 21294, 0x00008592 }, /* GL_OPERAND2_RGB */ + { 21310, 0x00008592 }, /* GL_OPERAND2_RGB_ARB */ + { 21330, 0x00008592 }, /* GL_OPERAND2_RGB_EXT */ + { 21350, 0x0000859B }, /* GL_OPERAND3_ALPHA_NV */ + { 21371, 0x00008593 }, /* GL_OPERAND3_RGB_NV */ + { 21390, 0x00001507 }, /* GL_OR */ + { 21396, 0x00000A01 }, /* GL_ORDER */ + { 21405, 0x0000150D }, /* GL_OR_INVERTED */ + { 21420, 0x0000150B }, /* GL_OR_REVERSE */ + { 21434, 0x00000505 }, /* GL_OUT_OF_MEMORY */ + { 21451, 0x00000D05 }, /* GL_PACK_ALIGNMENT */ + { 21469, 0x0000806C }, /* GL_PACK_IMAGE_HEIGHT */ + { 21490, 0x00008758 }, /* GL_PACK_INVERT_MESA */ + { 21510, 0x00000D01 }, /* GL_PACK_LSB_FIRST */ + { 21528, 0x00000D02 }, /* GL_PACK_ROW_LENGTH */ + { 21547, 0x0000806B }, /* GL_PACK_SKIP_IMAGES */ + { 21567, 0x00000D04 }, /* GL_PACK_SKIP_PIXELS */ + { 21587, 0x00000D03 }, /* GL_PACK_SKIP_ROWS */ + { 21605, 0x00000D00 }, /* GL_PACK_SWAP_BYTES */ + { 21624, 0x00008B92 }, /* GL_PALETTE4_R5_G6_B5_OES */ + { 21649, 0x00008B94 }, /* GL_PALETTE4_RGB5_A1_OES */ + { 21673, 0x00008B90 }, /* GL_PALETTE4_RGB8_OES */ + { 21694, 0x00008B93 }, /* GL_PALETTE4_RGBA4_OES */ + { 21716, 0x00008B91 }, /* GL_PALETTE4_RGBA8_OES */ + { 21738, 0x00008B97 }, /* GL_PALETTE8_R5_G6_B5_OES */ + { 21763, 0x00008B99 }, /* GL_PALETTE8_RGB5_A1_OES */ + { 21787, 0x00008B95 }, /* GL_PALETTE8_RGB8_OES */ + { 21808, 0x00008B98 }, /* GL_PALETTE8_RGBA4_OES */ + { 21830, 0x00008B96 }, /* GL_PALETTE8_RGBA8_OES */ + { 21852, 0x00000700 }, /* GL_PASS_THROUGH_TOKEN */ + { 21874, 0x00000C50 }, /* GL_PERSPECTIVE_CORRECTION_HINT */ + { 21905, 0x00000C79 }, /* GL_PIXEL_MAP_A_TO_A */ + { 21925, 0x00000CB9 }, /* GL_PIXEL_MAP_A_TO_A_SIZE */ + { 21950, 0x00000C78 }, /* GL_PIXEL_MAP_B_TO_B */ + { 21970, 0x00000CB8 }, /* GL_PIXEL_MAP_B_TO_B_SIZE */ + { 21995, 0x00000C77 }, /* GL_PIXEL_MAP_G_TO_G */ + { 22015, 0x00000CB7 }, /* GL_PIXEL_MAP_G_TO_G_SIZE */ + { 22040, 0x00000C75 }, /* GL_PIXEL_MAP_I_TO_A */ + { 22060, 0x00000CB5 }, /* GL_PIXEL_MAP_I_TO_A_SIZE */ + { 22085, 0x00000C74 }, /* GL_PIXEL_MAP_I_TO_B */ + { 22105, 0x00000CB4 }, /* GL_PIXEL_MAP_I_TO_B_SIZE */ + { 22130, 0x00000C73 }, /* GL_PIXEL_MAP_I_TO_G */ + { 22150, 0x00000CB3 }, /* GL_PIXEL_MAP_I_TO_G_SIZE */ + { 22175, 0x00000C70 }, /* GL_PIXEL_MAP_I_TO_I */ + { 22195, 0x00000CB0 }, /* GL_PIXEL_MAP_I_TO_I_SIZE */ + { 22220, 0x00000C72 }, /* GL_PIXEL_MAP_I_TO_R */ + { 22240, 0x00000CB2 }, /* GL_PIXEL_MAP_I_TO_R_SIZE */ + { 22265, 0x00000C76 }, /* GL_PIXEL_MAP_R_TO_R */ + { 22285, 0x00000CB6 }, /* GL_PIXEL_MAP_R_TO_R_SIZE */ + { 22310, 0x00000C71 }, /* GL_PIXEL_MAP_S_TO_S */ + { 22330, 0x00000CB1 }, /* GL_PIXEL_MAP_S_TO_S_SIZE */ + { 22355, 0x00000020 }, /* GL_PIXEL_MODE_BIT */ + { 22373, 0x000088ED }, /* GL_PIXEL_PACK_BUFFER_BINDING_EXT */ + { 22406, 0x000088EB }, /* GL_PIXEL_PACK_BUFFER_EXT */ + { 22431, 0x000088EF }, /* GL_PIXEL_UNPACK_BUFFER_BINDING_EXT */ + { 22466, 0x000088EC }, /* GL_PIXEL_UNPACK_BUFFER_EXT */ + { 22493, 0x00001B00 }, /* GL_POINT */ + { 22502, 0x00000000 }, /* GL_POINTS */ + { 22512, 0x00000002 }, /* GL_POINT_BIT */ + { 22525, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION */ + { 22555, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_ARB */ + { 22589, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_EXT */ + { 22623, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_SGIS */ + { 22658, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE */ + { 22687, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_ARB */ + { 22720, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_EXT */ + { 22753, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_SGIS */ + { 22787, 0x00000B11 }, /* GL_POINT_SIZE */ + { 22801, 0x00000B13 }, /* GL_POINT_SIZE_GRANULARITY */ + { 22827, 0x00008127 }, /* GL_POINT_SIZE_MAX */ + { 22845, 0x00008127 }, /* GL_POINT_SIZE_MAX_ARB */ + { 22867, 0x00008127 }, /* GL_POINT_SIZE_MAX_EXT */ + { 22889, 0x00008127 }, /* GL_POINT_SIZE_MAX_SGIS */ + { 22912, 0x00008126 }, /* GL_POINT_SIZE_MIN */ + { 22930, 0x00008126 }, /* GL_POINT_SIZE_MIN_ARB */ + { 22952, 0x00008126 }, /* GL_POINT_SIZE_MIN_EXT */ + { 22974, 0x00008126 }, /* GL_POINT_SIZE_MIN_SGIS */ + { 22997, 0x00000B12 }, /* GL_POINT_SIZE_RANGE */ + { 23017, 0x00000B10 }, /* GL_POINT_SMOOTH */ + { 23033, 0x00000C51 }, /* GL_POINT_SMOOTH_HINT */ + { 23054, 0x00008861 }, /* GL_POINT_SPRITE */ + { 23070, 0x00008861 }, /* GL_POINT_SPRITE_ARB */ + { 23090, 0x00008CA0 }, /* GL_POINT_SPRITE_COORD_ORIGIN */ + { 23119, 0x00008861 }, /* GL_POINT_SPRITE_NV */ + { 23138, 0x00008863 }, /* GL_POINT_SPRITE_R_MODE_NV */ + { 23164, 0x00000701 }, /* GL_POINT_TOKEN */ + { 23179, 0x00000009 }, /* GL_POLYGON */ + { 23190, 0x00000008 }, /* GL_POLYGON_BIT */ + { 23205, 0x00000B40 }, /* GL_POLYGON_MODE */ + { 23221, 0x00008039 }, /* GL_POLYGON_OFFSET_BIAS */ + { 23244, 0x00008038 }, /* GL_POLYGON_OFFSET_FACTOR */ + { 23269, 0x00008037 }, /* GL_POLYGON_OFFSET_FILL */ + { 23292, 0x00002A02 }, /* GL_POLYGON_OFFSET_LINE */ + { 23315, 0x00002A01 }, /* GL_POLYGON_OFFSET_POINT */ + { 23339, 0x00002A00 }, /* GL_POLYGON_OFFSET_UNITS */ + { 23363, 0x00000B41 }, /* GL_POLYGON_SMOOTH */ + { 23381, 0x00000C53 }, /* GL_POLYGON_SMOOTH_HINT */ + { 23404, 0x00000B42 }, /* GL_POLYGON_STIPPLE */ + { 23423, 0x00000010 }, /* GL_POLYGON_STIPPLE_BIT */ + { 23446, 0x00000703 }, /* GL_POLYGON_TOKEN */ + { 23463, 0x00001203 }, /* GL_POSITION */ + { 23475, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */ + { 23507, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI */ + { 23543, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */ + { 23576, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI */ + { 23613, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */ + { 23644, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI */ + { 23679, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */ + { 23711, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI */ + { 23747, 0x000080D2 }, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */ + { 23780, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */ + { 23812, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI */ + { 23848, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */ + { 23881, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI */ + { 23918, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS */ + { 23948, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS_SGI */ + { 23982, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE */ + { 24013, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE_SGI */ + { 24048, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS */ + { 24079, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS_EXT */ + { 24114, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE */ + { 24146, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE_EXT */ + { 24182, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS */ + { 24212, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS_EXT */ + { 24246, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE */ + { 24277, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE_EXT */ + { 24312, 0x000080D1 }, /* GL_POST_CONVOLUTION_COLOR_TABLE */ + { 24344, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS */ + { 24375, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS_EXT */ + { 24410, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE */ + { 24442, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE_EXT */ + { 24478, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS */ + { 24507, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS_EXT */ + { 24540, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE */ + { 24570, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE_EXT */ + { 24604, 0x0000817B }, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */ + { 24643, 0x00008179 }, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */ + { 24676, 0x0000817C }, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */ + { 24716, 0x0000817A }, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */ + { 24750, 0x00008578 }, /* GL_PREVIOUS */ + { 24762, 0x00008578 }, /* GL_PREVIOUS_ARB */ + { 24778, 0x00008578 }, /* GL_PREVIOUS_EXT */ + { 24794, 0x00008577 }, /* GL_PRIMARY_COLOR */ + { 24811, 0x00008577 }, /* GL_PRIMARY_COLOR_ARB */ + { 24832, 0x00008577 }, /* GL_PRIMARY_COLOR_EXT */ + { 24853, 0x000088B0 }, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */ + { 24886, 0x00008805 }, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */ + { 24918, 0x000088AC }, /* GL_PROGRAM_ATTRIBS_ARB */ + { 24941, 0x00008677 }, /* GL_PROGRAM_BINDING_ARB */ + { 24964, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_ARB */ + { 24994, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_NV */ + { 25023, 0x00008874 }, /* GL_PROGRAM_ERROR_STRING_ARB */ + { 25051, 0x00008876 }, /* GL_PROGRAM_FORMAT_ARB */ + { 25073, 0x00008875 }, /* GL_PROGRAM_FORMAT_ASCII_ARB */ + { 25101, 0x000088A0 }, /* GL_PROGRAM_INSTRUCTIONS_ARB */ + { 25129, 0x00008627 }, /* GL_PROGRAM_LENGTH_ARB */ + { 25151, 0x00008627 }, /* GL_PROGRAM_LENGTH_NV */ + { 25172, 0x000088B2 }, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ + { 25212, 0x00008808 }, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ + { 25251, 0x000088AE }, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */ + { 25281, 0x000088A2 }, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ + { 25316, 0x000088AA }, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */ + { 25349, 0x000088A6 }, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */ + { 25383, 0x0000880A }, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ + { 25422, 0x00008809 }, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ + { 25461, 0x00008B40 }, /* GL_PROGRAM_OBJECT_ARB */ + { 25483, 0x000088A8 }, /* GL_PROGRAM_PARAMETERS_ARB */ + { 25509, 0x00008644 }, /* GL_PROGRAM_PARAMETER_NV */ + { 25533, 0x00008647 }, /* GL_PROGRAM_RESIDENT_NV */ + { 25556, 0x00008628 }, /* GL_PROGRAM_STRING_ARB */ + { 25578, 0x00008628 }, /* GL_PROGRAM_STRING_NV */ + { 25599, 0x00008646 }, /* GL_PROGRAM_TARGET_NV */ + { 25620, 0x000088A4 }, /* GL_PROGRAM_TEMPORARIES_ARB */ + { 25647, 0x00008807 }, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */ + { 25679, 0x00008806 }, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */ + { 25711, 0x000088B6 }, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */ + { 25746, 0x00001701 }, /* GL_PROJECTION */ + { 25760, 0x00000BA7 }, /* GL_PROJECTION_MATRIX */ + { 25781, 0x00000BA4 }, /* GL_PROJECTION_STACK_DEPTH */ + { 25807, 0x000080D3 }, /* GL_PROXY_COLOR_TABLE */ + { 25828, 0x00008025 }, /* GL_PROXY_HISTOGRAM */ + { 25847, 0x00008025 }, /* GL_PROXY_HISTOGRAM_EXT */ + { 25870, 0x000080D5 }, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */ + { 25909, 0x000080D4 }, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */ + { 25947, 0x00008063 }, /* GL_PROXY_TEXTURE_1D */ + { 25967, 0x00008063 }, /* GL_PROXY_TEXTURE_1D_EXT */ + { 25991, 0x00008064 }, /* GL_PROXY_TEXTURE_2D */ + { 26011, 0x00008064 }, /* GL_PROXY_TEXTURE_2D_EXT */ + { 26035, 0x00008070 }, /* GL_PROXY_TEXTURE_3D */ + { 26055, 0x000080BD }, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */ + { 26088, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP */ + { 26114, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP_ARB */ + { 26144, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */ + { 26175, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_NV */ + { 26205, 0x00002003 }, /* GL_Q */ + { 26210, 0x00001209 }, /* GL_QUADRATIC_ATTENUATION */ + { 26235, 0x00000007 }, /* GL_QUADS */ + { 26244, 0x00008614 }, /* GL_QUAD_MESH_SUN */ + { 26261, 0x00000008 }, /* GL_QUAD_STRIP */ + { 26275, 0x00008864 }, /* GL_QUERY_COUNTER_BITS */ + { 26297, 0x00008864 }, /* GL_QUERY_COUNTER_BITS_ARB */ + { 26323, 0x00008866 }, /* GL_QUERY_RESULT */ + { 26339, 0x00008866 }, /* GL_QUERY_RESULT_ARB */ + { 26359, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE */ + { 26385, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE_ARB */ + { 26415, 0x00002002 }, /* GL_R */ + { 26420, 0x00002A10 }, /* GL_R3_G3_B2 */ + { 26432, 0x00019262 }, /* GL_RASTER_POSITION_UNCLIPPED_IBM */ + { 26465, 0x00000C02 }, /* GL_READ_BUFFER */ + { 26480, 0x00008CAA }, /* GL_READ_FRAMEBUFFER_BINDING_EXT */ + { 26512, 0x00008CA8 }, /* GL_READ_FRAMEBUFFER_EXT */ + { 26536, 0x000088B8 }, /* GL_READ_ONLY */ + { 26549, 0x000088B8 }, /* GL_READ_ONLY_ARB */ + { 26566, 0x000088BA }, /* GL_READ_WRITE */ + { 26580, 0x000088BA }, /* GL_READ_WRITE_ARB */ + { 26598, 0x00001903 }, /* GL_RED */ + { 26605, 0x00008016 }, /* GL_REDUCE */ + { 26615, 0x00008016 }, /* GL_REDUCE_EXT */ + { 26629, 0x00000D15 }, /* GL_RED_BIAS */ + { 26641, 0x00000D52 }, /* GL_RED_BITS */ + { 26653, 0x00000D14 }, /* GL_RED_SCALE */ + { 26666, 0x00008512 }, /* GL_REFLECTION_MAP */ + { 26684, 0x00008512 }, /* GL_REFLECTION_MAP_ARB */ + { 26706, 0x00008512 }, /* GL_REFLECTION_MAP_NV */ + { 26727, 0x00001C00 }, /* GL_RENDER */ + { 26737, 0x00008CA7 }, /* GL_RENDERBUFFER_BINDING_EXT */ + { 26765, 0x00008D41 }, /* GL_RENDERBUFFER_EXT */ + { 26785, 0x00008D43 }, /* GL_RENDERBUFFER_HEIGHT_EXT */ + { 26812, 0x00008D44 }, /* GL_RENDERBUFFER_INTERNAL_FORMAT_EXT */ + { 26848, 0x00008D42 }, /* GL_RENDERBUFFER_WIDTH_EXT */ + { 26874, 0x00001F01 }, /* GL_RENDERER */ + { 26886, 0x00000C40 }, /* GL_RENDER_MODE */ + { 26901, 0x00002901 }, /* GL_REPEAT */ + { 26911, 0x00001E01 }, /* GL_REPLACE */ + { 26922, 0x00008062 }, /* GL_REPLACE_EXT */ + { 26937, 0x00008153 }, /* GL_REPLICATE_BORDER_HP */ + { 26960, 0x0000803A }, /* GL_RESCALE_NORMAL */ + { 26978, 0x0000803A }, /* GL_RESCALE_NORMAL_EXT */ + { 27000, 0x00000102 }, /* GL_RETURN */ + { 27010, 0x00001907 }, /* GL_RGB */ + { 27017, 0x00008052 }, /* GL_RGB10 */ + { 27026, 0x00008059 }, /* GL_RGB10_A2 */ + { 27038, 0x00008059 }, /* GL_RGB10_A2_EXT */ + { 27054, 0x00008052 }, /* GL_RGB10_EXT */ + { 27067, 0x00008053 }, /* GL_RGB12 */ + { 27076, 0x00008053 }, /* GL_RGB12_EXT */ + { 27089, 0x00008054 }, /* GL_RGB16 */ + { 27098, 0x00008054 }, /* GL_RGB16_EXT */ + { 27111, 0x0000804E }, /* GL_RGB2_EXT */ + { 27123, 0x0000804F }, /* GL_RGB4 */ + { 27131, 0x0000804F }, /* GL_RGB4_EXT */ + { 27143, 0x000083A1 }, /* GL_RGB4_S3TC */ + { 27156, 0x00008050 }, /* GL_RGB5 */ + { 27164, 0x00008057 }, /* GL_RGB5_A1 */ + { 27175, 0x00008057 }, /* GL_RGB5_A1_EXT */ + { 27190, 0x00008050 }, /* GL_RGB5_EXT */ + { 27202, 0x00008051 }, /* GL_RGB8 */ + { 27210, 0x00008051 }, /* GL_RGB8_EXT */ + { 27222, 0x00001908 }, /* GL_RGBA */ + { 27230, 0x0000805A }, /* GL_RGBA12 */ + { 27240, 0x0000805A }, /* GL_RGBA12_EXT */ + { 27254, 0x0000805B }, /* GL_RGBA16 */ + { 27264, 0x0000805B }, /* GL_RGBA16_EXT */ + { 27278, 0x00008055 }, /* GL_RGBA2 */ + { 27287, 0x00008055 }, /* GL_RGBA2_EXT */ + { 27300, 0x00008056 }, /* GL_RGBA4 */ + { 27309, 0x000083A5 }, /* GL_RGBA4_DXT5_S3TC */ + { 27328, 0x00008056 }, /* GL_RGBA4_EXT */ + { 27341, 0x000083A3 }, /* GL_RGBA4_S3TC */ + { 27355, 0x00008058 }, /* GL_RGBA8 */ + { 27364, 0x00008058 }, /* GL_RGBA8_EXT */ + { 27377, 0x000083A4 }, /* GL_RGBA_DXT5_S3TC */ + { 27395, 0x00000C31 }, /* GL_RGBA_MODE */ + { 27408, 0x000083A2 }, /* GL_RGBA_S3TC */ + { 27421, 0x000083A0 }, /* GL_RGB_S3TC */ + { 27433, 0x00008573 }, /* GL_RGB_SCALE */ + { 27446, 0x00008573 }, /* GL_RGB_SCALE_ARB */ + { 27463, 0x00008573 }, /* GL_RGB_SCALE_EXT */ + { 27480, 0x00000407 }, /* GL_RIGHT */ + { 27489, 0x00002000 }, /* GL_S */ + { 27494, 0x00008B5D }, /* GL_SAMPLER_1D */ + { 27508, 0x00008B61 }, /* GL_SAMPLER_1D_SHADOW */ + { 27529, 0x00008B5E }, /* GL_SAMPLER_2D */ + { 27543, 0x00008B62 }, /* GL_SAMPLER_2D_SHADOW */ + { 27564, 0x00008B5F }, /* GL_SAMPLER_3D */ + { 27578, 0x00008B60 }, /* GL_SAMPLER_CUBE */ + { 27594, 0x000080A9 }, /* GL_SAMPLES */ + { 27605, 0x000086B4 }, /* GL_SAMPLES_3DFX */ + { 27621, 0x000080A9 }, /* GL_SAMPLES_ARB */ + { 27636, 0x00008914 }, /* GL_SAMPLES_PASSED */ + { 27654, 0x00008914 }, /* GL_SAMPLES_PASSED_ARB */ + { 27676, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE */ + { 27704, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE_ARB */ + { 27736, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE */ + { 27759, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE_ARB */ + { 27786, 0x000080A8 }, /* GL_SAMPLE_BUFFERS */ + { 27804, 0x000086B3 }, /* GL_SAMPLE_BUFFERS_3DFX */ + { 27827, 0x000080A8 }, /* GL_SAMPLE_BUFFERS_ARB */ + { 27849, 0x000080A0 }, /* GL_SAMPLE_COVERAGE */ + { 27868, 0x000080A0 }, /* GL_SAMPLE_COVERAGE_ARB */ + { 27891, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT */ + { 27917, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT_ARB */ + { 27947, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE */ + { 27972, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE_ARB */ + { 28001, 0x00080000 }, /* GL_SCISSOR_BIT */ + { 28016, 0x00000C10 }, /* GL_SCISSOR_BOX */ + { 28031, 0x00000C11 }, /* GL_SCISSOR_TEST */ + { 28047, 0x0000845E }, /* GL_SECONDARY_COLOR_ARRAY */ + { 28072, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */ + { 28112, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB */ + { 28156, 0x0000845D }, /* GL_SECONDARY_COLOR_ARRAY_POINTER */ + { 28189, 0x0000845A }, /* GL_SECONDARY_COLOR_ARRAY_SIZE */ + { 28219, 0x0000845C }, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */ + { 28251, 0x0000845B }, /* GL_SECONDARY_COLOR_ARRAY_TYPE */ + { 28281, 0x00001C02 }, /* GL_SELECT */ + { 28291, 0x00000DF3 }, /* GL_SELECTION_BUFFER_POINTER */ + { 28319, 0x00000DF4 }, /* GL_SELECTION_BUFFER_SIZE */ + { 28344, 0x00008012 }, /* GL_SEPARABLE_2D */ + { 28360, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR */ + { 28387, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR_EXT */ + { 28418, 0x0000150F }, /* GL_SET */ + { 28425, 0x00008B48 }, /* GL_SHADER_OBJECT_ARB */ + { 28446, 0x00008B88 }, /* GL_SHADER_SOURCE_LENGTH */ + { 28470, 0x00008B4F }, /* GL_SHADER_TYPE */ + { 28485, 0x00000B54 }, /* GL_SHADE_MODEL */ + { 28500, 0x00008B8C }, /* GL_SHADING_LANGUAGE_VERSION */ + { 28528, 0x000080BF }, /* GL_SHADOW_AMBIENT_SGIX */ + { 28551, 0x000081FB }, /* GL_SHARED_TEXTURE_PALETTE_EXT */ + { 28581, 0x00001601 }, /* GL_SHININESS */ + { 28594, 0x00001402 }, /* GL_SHORT */ + { 28603, 0x000081F9 }, /* GL_SINGLE_COLOR */ + { 28619, 0x000081F9 }, /* GL_SINGLE_COLOR_EXT */ + { 28639, 0x000085CC }, /* GL_SLICE_ACCUM_SUN */ + { 28658, 0x00001D01 }, /* GL_SMOOTH */ + { 28668, 0x00000B23 }, /* GL_SMOOTH_LINE_WIDTH_GRANULARITY */ + { 28701, 0x00000B22 }, /* GL_SMOOTH_LINE_WIDTH_RANGE */ + { 28728, 0x00000B13 }, /* GL_SMOOTH_POINT_SIZE_GRANULARITY */ + { 28761, 0x00000B12 }, /* GL_SMOOTH_POINT_SIZE_RANGE */ + { 28788, 0x00008588 }, /* GL_SOURCE0_ALPHA */ + { 28805, 0x00008588 }, /* GL_SOURCE0_ALPHA_ARB */ + { 28826, 0x00008588 }, /* GL_SOURCE0_ALPHA_EXT */ + { 28847, 0x00008580 }, /* GL_SOURCE0_RGB */ + { 28862, 0x00008580 }, /* GL_SOURCE0_RGB_ARB */ + { 28881, 0x00008580 }, /* GL_SOURCE0_RGB_EXT */ + { 28900, 0x00008589 }, /* GL_SOURCE1_ALPHA */ + { 28917, 0x00008589 }, /* GL_SOURCE1_ALPHA_ARB */ + { 28938, 0x00008589 }, /* GL_SOURCE1_ALPHA_EXT */ + { 28959, 0x00008581 }, /* GL_SOURCE1_RGB */ + { 28974, 0x00008581 }, /* GL_SOURCE1_RGB_ARB */ + { 28993, 0x00008581 }, /* GL_SOURCE1_RGB_EXT */ + { 29012, 0x0000858A }, /* GL_SOURCE2_ALPHA */ + { 29029, 0x0000858A }, /* GL_SOURCE2_ALPHA_ARB */ + { 29050, 0x0000858A }, /* GL_SOURCE2_ALPHA_EXT */ + { 29071, 0x00008582 }, /* GL_SOURCE2_RGB */ + { 29086, 0x00008582 }, /* GL_SOURCE2_RGB_ARB */ + { 29105, 0x00008582 }, /* GL_SOURCE2_RGB_EXT */ + { 29124, 0x0000858B }, /* GL_SOURCE3_ALPHA_NV */ + { 29144, 0x00008583 }, /* GL_SOURCE3_RGB_NV */ + { 29162, 0x00001202 }, /* GL_SPECULAR */ + { 29174, 0x00002402 }, /* GL_SPHERE_MAP */ + { 29188, 0x00001206 }, /* GL_SPOT_CUTOFF */ + { 29203, 0x00001204 }, /* GL_SPOT_DIRECTION */ + { 29221, 0x00001205 }, /* GL_SPOT_EXPONENT */ + { 29238, 0x00008588 }, /* GL_SRC0_ALPHA */ + { 29252, 0x00008580 }, /* GL_SRC0_RGB */ + { 29264, 0x00008589 }, /* GL_SRC1_ALPHA */ + { 29278, 0x00008581 }, /* GL_SRC1_RGB */ + { 29290, 0x0000858A }, /* GL_SRC2_ALPHA */ + { 29304, 0x00008582 }, /* GL_SRC2_RGB */ + { 29316, 0x00000302 }, /* GL_SRC_ALPHA */ + { 29329, 0x00000308 }, /* GL_SRC_ALPHA_SATURATE */ + { 29351, 0x00000300 }, /* GL_SRC_COLOR */ + { 29364, 0x00000503 }, /* GL_STACK_OVERFLOW */ + { 29382, 0x00000504 }, /* GL_STACK_UNDERFLOW */ + { 29401, 0x000088E6 }, /* GL_STATIC_COPY */ + { 29416, 0x000088E6 }, /* GL_STATIC_COPY_ARB */ + { 29435, 0x000088E4 }, /* GL_STATIC_DRAW */ + { 29450, 0x000088E4 }, /* GL_STATIC_DRAW_ARB */ + { 29469, 0x000088E5 }, /* GL_STATIC_READ */ + { 29484, 0x000088E5 }, /* GL_STATIC_READ_ARB */ + { 29503, 0x00001802 }, /* GL_STENCIL */ + { 29514, 0x00008D20 }, /* GL_STENCIL_ATTACHMENT_EXT */ + { 29540, 0x00008801 }, /* GL_STENCIL_BACK_FAIL */ + { 29561, 0x00008800 }, /* GL_STENCIL_BACK_FUNC */ + { 29582, 0x00008802 }, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL */ + { 29614, 0x00008803 }, /* GL_STENCIL_BACK_PASS_DEPTH_PASS */ + { 29646, 0x00008CA3 }, /* GL_STENCIL_BACK_REF */ + { 29666, 0x00008CA4 }, /* GL_STENCIL_BACK_VALUE_MASK */ + { 29693, 0x00008CA5 }, /* GL_STENCIL_BACK_WRITEMASK */ + { 29719, 0x00000D57 }, /* GL_STENCIL_BITS */ + { 29735, 0x00000400 }, /* GL_STENCIL_BUFFER_BIT */ + { 29757, 0x00000B91 }, /* GL_STENCIL_CLEAR_VALUE */ + { 29780, 0x00000B94 }, /* GL_STENCIL_FAIL */ + { 29796, 0x00000B92 }, /* GL_STENCIL_FUNC */ + { 29812, 0x00001901 }, /* GL_STENCIL_INDEX */ + { 29829, 0x00008D49 }, /* GL_STENCIL_INDEX16_EXT */ + { 29852, 0x00008D46 }, /* GL_STENCIL_INDEX1_EXT */ + { 29874, 0x00008D47 }, /* GL_STENCIL_INDEX4_EXT */ + { 29896, 0x00008D48 }, /* GL_STENCIL_INDEX8_EXT */ + { 29918, 0x00008D45 }, /* GL_STENCIL_INDEX_EXT */ + { 29939, 0x00000B95 }, /* GL_STENCIL_PASS_DEPTH_FAIL */ + { 29966, 0x00000B96 }, /* GL_STENCIL_PASS_DEPTH_PASS */ + { 29993, 0x00000B97 }, /* GL_STENCIL_REF */ + { 30008, 0x00000B90 }, /* GL_STENCIL_TEST */ + { 30024, 0x00008910 }, /* GL_STENCIL_TEST_TWO_SIDE_EXT */ + { 30053, 0x00000B93 }, /* GL_STENCIL_VALUE_MASK */ + { 30075, 0x00000B98 }, /* GL_STENCIL_WRITEMASK */ + { 30096, 0x00000C33 }, /* GL_STEREO */ + { 30106, 0x000088E2 }, /* GL_STREAM_COPY */ + { 30121, 0x000088E2 }, /* GL_STREAM_COPY_ARB */ + { 30140, 0x000088E0 }, /* GL_STREAM_DRAW */ + { 30155, 0x000088E0 }, /* GL_STREAM_DRAW_ARB */ + { 30174, 0x000088E1 }, /* GL_STREAM_READ */ + { 30189, 0x000088E1 }, /* GL_STREAM_READ_ARB */ + { 30208, 0x00000D50 }, /* GL_SUBPIXEL_BITS */ + { 30225, 0x000084E7 }, /* GL_SUBTRACT */ + { 30237, 0x000084E7 }, /* GL_SUBTRACT_ARB */ + { 30253, 0x00002001 }, /* GL_T */ + { 30258, 0x00002A2A }, /* GL_T2F_C3F_V3F */ + { 30273, 0x00002A2C }, /* GL_T2F_C4F_N3F_V3F */ + { 30292, 0x00002A29 }, /* GL_T2F_C4UB_V3F */ + { 30308, 0x00002A2B }, /* GL_T2F_N3F_V3F */ + { 30323, 0x00002A27 }, /* GL_T2F_V3F */ + { 30334, 0x00002A2D }, /* GL_T4F_C4F_N3F_V4F */ + { 30353, 0x00002A28 }, /* GL_T4F_V4F */ + { 30364, 0x00008031 }, /* GL_TABLE_TOO_LARGE_EXT */ + { 30387, 0x00001702 }, /* GL_TEXTURE */ + { 30398, 0x000084C0 }, /* GL_TEXTURE0 */ + { 30410, 0x000084C0 }, /* GL_TEXTURE0_ARB */ + { 30426, 0x000084C1 }, /* GL_TEXTURE1 */ + { 30438, 0x000084CA }, /* GL_TEXTURE10 */ + { 30451, 0x000084CA }, /* GL_TEXTURE10_ARB */ + { 30468, 0x000084CB }, /* GL_TEXTURE11 */ + { 30481, 0x000084CB }, /* GL_TEXTURE11_ARB */ + { 30498, 0x000084CC }, /* GL_TEXTURE12 */ + { 30511, 0x000084CC }, /* GL_TEXTURE12_ARB */ + { 30528, 0x000084CD }, /* GL_TEXTURE13 */ + { 30541, 0x000084CD }, /* GL_TEXTURE13_ARB */ + { 30558, 0x000084CE }, /* GL_TEXTURE14 */ + { 30571, 0x000084CE }, /* GL_TEXTURE14_ARB */ + { 30588, 0x000084CF }, /* GL_TEXTURE15 */ + { 30601, 0x000084CF }, /* GL_TEXTURE15_ARB */ + { 30618, 0x000084D0 }, /* GL_TEXTURE16 */ + { 30631, 0x000084D0 }, /* GL_TEXTURE16_ARB */ + { 30648, 0x000084D1 }, /* GL_TEXTURE17 */ + { 30661, 0x000084D1 }, /* GL_TEXTURE17_ARB */ + { 30678, 0x000084D2 }, /* GL_TEXTURE18 */ + { 30691, 0x000084D2 }, /* GL_TEXTURE18_ARB */ + { 30708, 0x000084D3 }, /* GL_TEXTURE19 */ + { 30721, 0x000084D3 }, /* GL_TEXTURE19_ARB */ + { 30738, 0x000084C1 }, /* GL_TEXTURE1_ARB */ + { 30754, 0x000084C2 }, /* GL_TEXTURE2 */ + { 30766, 0x000084D4 }, /* GL_TEXTURE20 */ + { 30779, 0x000084D4 }, /* GL_TEXTURE20_ARB */ + { 30796, 0x000084D5 }, /* GL_TEXTURE21 */ + { 30809, 0x000084D5 }, /* GL_TEXTURE21_ARB */ + { 30826, 0x000084D6 }, /* GL_TEXTURE22 */ + { 30839, 0x000084D6 }, /* GL_TEXTURE22_ARB */ + { 30856, 0x000084D7 }, /* GL_TEXTURE23 */ + { 30869, 0x000084D7 }, /* GL_TEXTURE23_ARB */ + { 30886, 0x000084D8 }, /* GL_TEXTURE24 */ + { 30899, 0x000084D8 }, /* GL_TEXTURE24_ARB */ + { 30916, 0x000084D9 }, /* GL_TEXTURE25 */ + { 30929, 0x000084D9 }, /* GL_TEXTURE25_ARB */ + { 30946, 0x000084DA }, /* GL_TEXTURE26 */ + { 30959, 0x000084DA }, /* GL_TEXTURE26_ARB */ + { 30976, 0x000084DB }, /* GL_TEXTURE27 */ + { 30989, 0x000084DB }, /* GL_TEXTURE27_ARB */ + { 31006, 0x000084DC }, /* GL_TEXTURE28 */ + { 31019, 0x000084DC }, /* GL_TEXTURE28_ARB */ + { 31036, 0x000084DD }, /* GL_TEXTURE29 */ + { 31049, 0x000084DD }, /* GL_TEXTURE29_ARB */ + { 31066, 0x000084C2 }, /* GL_TEXTURE2_ARB */ + { 31082, 0x000084C3 }, /* GL_TEXTURE3 */ + { 31094, 0x000084DE }, /* GL_TEXTURE30 */ + { 31107, 0x000084DE }, /* GL_TEXTURE30_ARB */ + { 31124, 0x000084DF }, /* GL_TEXTURE31 */ + { 31137, 0x000084DF }, /* GL_TEXTURE31_ARB */ + { 31154, 0x000084C3 }, /* GL_TEXTURE3_ARB */ + { 31170, 0x000084C4 }, /* GL_TEXTURE4 */ + { 31182, 0x000084C4 }, /* GL_TEXTURE4_ARB */ + { 31198, 0x000084C5 }, /* GL_TEXTURE5 */ + { 31210, 0x000084C5 }, /* GL_TEXTURE5_ARB */ + { 31226, 0x000084C6 }, /* GL_TEXTURE6 */ + { 31238, 0x000084C6 }, /* GL_TEXTURE6_ARB */ + { 31254, 0x000084C7 }, /* GL_TEXTURE7 */ + { 31266, 0x000084C7 }, /* GL_TEXTURE7_ARB */ + { 31282, 0x000084C8 }, /* GL_TEXTURE8 */ + { 31294, 0x000084C8 }, /* GL_TEXTURE8_ARB */ + { 31310, 0x000084C9 }, /* GL_TEXTURE9 */ + { 31322, 0x000084C9 }, /* GL_TEXTURE9_ARB */ + { 31338, 0x00000DE0 }, /* GL_TEXTURE_1D */ + { 31352, 0x00000DE1 }, /* GL_TEXTURE_2D */ + { 31366, 0x0000806F }, /* GL_TEXTURE_3D */ + { 31380, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE */ + { 31402, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE_EXT */ + { 31428, 0x0000813C }, /* GL_TEXTURE_BASE_LEVEL */ + { 31450, 0x00008068 }, /* GL_TEXTURE_BINDING_1D */ + { 31472, 0x00008069 }, /* GL_TEXTURE_BINDING_2D */ + { 31494, 0x0000806A }, /* GL_TEXTURE_BINDING_3D */ + { 31516, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP */ + { 31544, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP_ARB */ + { 31576, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */ + { 31609, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_NV */ + { 31641, 0x00040000 }, /* GL_TEXTURE_BIT */ + { 31656, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE */ + { 31677, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE_EXT */ + { 31702, 0x00001005 }, /* GL_TEXTURE_BORDER */ + { 31720, 0x00001004 }, /* GL_TEXTURE_BORDER_COLOR */ + { 31744, 0x00008171 }, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */ + { 31775, 0x00008176 }, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */ + { 31805, 0x00008172 }, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */ + { 31835, 0x00008175 }, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */ + { 31870, 0x00008173 }, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */ + { 31901, 0x00008174 }, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */ + { 31939, 0x000080BC }, /* GL_TEXTURE_COLOR_TABLE_SGI */ + { 31966, 0x000081EF }, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */ + { 31998, 0x000080BF }, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ + { 32032, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC */ + { 32056, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC_ARB */ + { 32084, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE */ + { 32108, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE_ARB */ + { 32136, 0x0000819B }, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */ + { 32169, 0x0000819A }, /* GL_TEXTURE_COMPARE_SGIX */ + { 32193, 0x00001003 }, /* GL_TEXTURE_COMPONENTS */ + { 32215, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED */ + { 32237, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED_ARB */ + { 32263, 0x000086A3 }, /* GL_TEXTURE_COMPRESSED_FORMATS_ARB */ + { 32297, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */ + { 32330, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB */ + { 32367, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT */ + { 32395, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT_ARB */ + { 32427, 0x00008078 }, /* GL_TEXTURE_COORD_ARRAY */ + { 32450, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */ + { 32488, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB */ + { 32530, 0x00008092 }, /* GL_TEXTURE_COORD_ARRAY_POINTER */ + { 32561, 0x00008088 }, /* GL_TEXTURE_COORD_ARRAY_SIZE */ + { 32589, 0x0000808A }, /* GL_TEXTURE_COORD_ARRAY_STRIDE */ + { 32619, 0x00008089 }, /* GL_TEXTURE_COORD_ARRAY_TYPE */ + { 32647, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP */ + { 32667, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP_ARB */ + { 32691, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */ + { 32722, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB */ + { 32757, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */ + { 32788, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB */ + { 32823, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */ + { 32854, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB */ + { 32889, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */ + { 32920, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB */ + { 32955, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */ + { 32986, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB */ + { 33021, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */ + { 33052, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB */ + { 33087, 0x00008071 }, /* GL_TEXTURE_DEPTH */ + { 33104, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE */ + { 33126, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE_ARB */ + { 33152, 0x00002300 }, /* GL_TEXTURE_ENV */ + { 33167, 0x00002201 }, /* GL_TEXTURE_ENV_COLOR */ + { 33188, 0x00002200 }, /* GL_TEXTURE_ENV_MODE */ + { 33208, 0x00008500 }, /* GL_TEXTURE_FILTER_CONTROL */ + { 33234, 0x00002500 }, /* GL_TEXTURE_GEN_MODE */ + { 33254, 0x00000C63 }, /* GL_TEXTURE_GEN_Q */ + { 33271, 0x00000C62 }, /* GL_TEXTURE_GEN_R */ + { 33288, 0x00000C60 }, /* GL_TEXTURE_GEN_S */ + { 33305, 0x00000C61 }, /* GL_TEXTURE_GEN_T */ + { 33322, 0x0000819D }, /* GL_TEXTURE_GEQUAL_R_SGIX */ + { 33347, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE */ + { 33369, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE_EXT */ + { 33395, 0x00001001 }, /* GL_TEXTURE_HEIGHT */ + { 33413, 0x000080ED }, /* GL_TEXTURE_INDEX_SIZE_EXT */ + { 33439, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE */ + { 33465, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE_EXT */ + { 33495, 0x00001003 }, /* GL_TEXTURE_INTERNAL_FORMAT */ + { 33522, 0x0000819C }, /* GL_TEXTURE_LEQUAL_R_SGIX */ + { 33547, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS */ + { 33567, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS_EXT */ + { 33591, 0x00008190 }, /* GL_TEXTURE_LOD_BIAS_R_SGIX */ + { 33618, 0x0000818E }, /* GL_TEXTURE_LOD_BIAS_S_SGIX */ + { 33645, 0x0000818F }, /* GL_TEXTURE_LOD_BIAS_T_SGIX */ + { 33672, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE */ + { 33698, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE_EXT */ + { 33728, 0x00002800 }, /* GL_TEXTURE_MAG_FILTER */ + { 33750, 0x00000BA8 }, /* GL_TEXTURE_MATRIX */ + { 33768, 0x000084FE }, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */ + { 33798, 0x0000836B }, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */ + { 33826, 0x00008369 }, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */ + { 33854, 0x0000836A }, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */ + { 33882, 0x0000813D }, /* GL_TEXTURE_MAX_LEVEL */ + { 33903, 0x0000813B }, /* GL_TEXTURE_MAX_LOD */ + { 33922, 0x00002801 }, /* GL_TEXTURE_MIN_FILTER */ + { 33944, 0x0000813A }, /* GL_TEXTURE_MIN_LOD */ + { 33963, 0x00008066 }, /* GL_TEXTURE_PRIORITY */ + { 33983, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_ARB */ + { 34008, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_NV */ + { 34032, 0x0000805C }, /* GL_TEXTURE_RED_SIZE */ + { 34052, 0x0000805C }, /* GL_TEXTURE_RED_SIZE_EXT */ + { 34076, 0x00008067 }, /* GL_TEXTURE_RESIDENT */ + { 34096, 0x00000BA5 }, /* GL_TEXTURE_STACK_DEPTH */ + { 34119, 0x00008065 }, /* GL_TEXTURE_TOO_LARGE_EXT */ + { 34144, 0x0000888F }, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */ + { 34178, 0x00001000 }, /* GL_TEXTURE_WIDTH */ + { 34195, 0x00008072 }, /* GL_TEXTURE_WRAP_R */ + { 34213, 0x00002802 }, /* GL_TEXTURE_WRAP_S */ + { 34231, 0x00002803 }, /* GL_TEXTURE_WRAP_T */ + { 34249, 0x000088BF }, /* GL_TIME_ELAPSED_EXT */ + { 34269, 0x00008648 }, /* GL_TRACK_MATRIX_NV */ + { 34288, 0x00008649 }, /* GL_TRACK_MATRIX_TRANSFORM_NV */ + { 34317, 0x00001000 }, /* GL_TRANSFORM_BIT */ + { 34334, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX */ + { 34360, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX_ARB */ + { 34390, 0x000088B7 }, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */ + { 34422, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX */ + { 34452, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX_ARB */ + { 34486, 0x0000862C }, /* GL_TRANSPOSE_NV */ + { 34502, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX */ + { 34533, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX_ARB */ + { 34568, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX */ + { 34596, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX_ARB */ + { 34628, 0x00000004 }, /* GL_TRIANGLES */ + { 34641, 0x00000006 }, /* GL_TRIANGLE_FAN */ + { 34657, 0x00008615 }, /* GL_TRIANGLE_MESH_SUN */ + { 34678, 0x00000005 }, /* GL_TRIANGLE_STRIP */ + { 34696, 0x00000001 }, /* GL_TRUE */ + { 34704, 0x00000CF5 }, /* GL_UNPACK_ALIGNMENT */ + { 34724, 0x0000806E }, /* GL_UNPACK_IMAGE_HEIGHT */ + { 34747, 0x00000CF1 }, /* GL_UNPACK_LSB_FIRST */ + { 34767, 0x00000CF2 }, /* GL_UNPACK_ROW_LENGTH */ + { 34788, 0x0000806D }, /* GL_UNPACK_SKIP_IMAGES */ + { 34810, 0x00000CF4 }, /* GL_UNPACK_SKIP_PIXELS */ + { 34832, 0x00000CF3 }, /* GL_UNPACK_SKIP_ROWS */ + { 34852, 0x00000CF0 }, /* GL_UNPACK_SWAP_BYTES */ + { 34873, 0x00001401 }, /* GL_UNSIGNED_BYTE */ + { 34890, 0x00008362 }, /* GL_UNSIGNED_BYTE_2_3_3_REV */ + { 34917, 0x00008032 }, /* GL_UNSIGNED_BYTE_3_3_2 */ + { 34940, 0x00001405 }, /* GL_UNSIGNED_INT */ + { 34956, 0x00008036 }, /* GL_UNSIGNED_INT_10_10_10_2 */ + { 34983, 0x000084FA }, /* GL_UNSIGNED_INT_24_8_NV */ + { 35007, 0x00008368 }, /* GL_UNSIGNED_INT_2_10_10_10_REV */ + { 35038, 0x00008035 }, /* GL_UNSIGNED_INT_8_8_8_8 */ + { 35062, 0x00008367 }, /* GL_UNSIGNED_INT_8_8_8_8_REV */ + { 35090, 0x00001403 }, /* GL_UNSIGNED_SHORT */ + { 35108, 0x00008366 }, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */ + { 35138, 0x00008033 }, /* GL_UNSIGNED_SHORT_4_4_4_4 */ + { 35164, 0x00008365 }, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */ + { 35194, 0x00008034 }, /* GL_UNSIGNED_SHORT_5_5_5_1 */ + { 35220, 0x00008363 }, /* GL_UNSIGNED_SHORT_5_6_5 */ + { 35244, 0x00008364 }, /* GL_UNSIGNED_SHORT_5_6_5_REV */ + { 35272, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_APPLE */ + { 35300, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_MESA */ + { 35327, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */ + { 35359, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_MESA */ + { 35390, 0x00008CA2 }, /* GL_UPPER_LEFT */ + { 35404, 0x00002A20 }, /* GL_V2F */ + { 35411, 0x00002A21 }, /* GL_V3F */ + { 35418, 0x00008B83 }, /* GL_VALIDATE_STATUS */ + { 35437, 0x00001F00 }, /* GL_VENDOR */ + { 35447, 0x00001F02 }, /* GL_VERSION */ + { 35458, 0x00008074 }, /* GL_VERTEX_ARRAY */ + { 35474, 0x000085B5 }, /* GL_VERTEX_ARRAY_BINDING_APPLE */ + { 35504, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING */ + { 35535, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING_ARB */ + { 35570, 0x0000808E }, /* GL_VERTEX_ARRAY_POINTER */ + { 35594, 0x0000807A }, /* GL_VERTEX_ARRAY_SIZE */ + { 35615, 0x0000807C }, /* GL_VERTEX_ARRAY_STRIDE */ + { 35638, 0x0000807B }, /* GL_VERTEX_ARRAY_TYPE */ + { 35659, 0x00008650 }, /* GL_VERTEX_ATTRIB_ARRAY0_NV */ + { 35686, 0x0000865A }, /* GL_VERTEX_ATTRIB_ARRAY10_NV */ + { 35714, 0x0000865B }, /* GL_VERTEX_ATTRIB_ARRAY11_NV */ + { 35742, 0x0000865C }, /* GL_VERTEX_ATTRIB_ARRAY12_NV */ + { 35770, 0x0000865D }, /* GL_VERTEX_ATTRIB_ARRAY13_NV */ + { 35798, 0x0000865E }, /* GL_VERTEX_ATTRIB_ARRAY14_NV */ + { 35826, 0x0000865F }, /* GL_VERTEX_ATTRIB_ARRAY15_NV */ + { 35854, 0x00008651 }, /* GL_VERTEX_ATTRIB_ARRAY1_NV */ + { 35881, 0x00008652 }, /* GL_VERTEX_ATTRIB_ARRAY2_NV */ + { 35908, 0x00008653 }, /* GL_VERTEX_ATTRIB_ARRAY3_NV */ + { 35935, 0x00008654 }, /* GL_VERTEX_ATTRIB_ARRAY4_NV */ + { 35962, 0x00008655 }, /* GL_VERTEX_ATTRIB_ARRAY5_NV */ + { 35989, 0x00008656 }, /* GL_VERTEX_ATTRIB_ARRAY6_NV */ + { 36016, 0x00008657 }, /* GL_VERTEX_ATTRIB_ARRAY7_NV */ + { 36043, 0x00008658 }, /* GL_VERTEX_ATTRIB_ARRAY8_NV */ + { 36070, 0x00008659 }, /* GL_VERTEX_ATTRIB_ARRAY9_NV */ + { 36097, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */ + { 36135, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB */ + { 36177, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED */ + { 36208, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB */ + { 36243, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED */ + { 36277, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB */ + { 36315, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER */ + { 36346, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB */ + { 36381, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE */ + { 36409, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB */ + { 36441, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE */ + { 36471, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB */ + { 36505, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE */ + { 36533, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB */ + { 36565, 0x000086A7 }, /* GL_VERTEX_BLEND_ARB */ + { 36585, 0x00008620 }, /* GL_VERTEX_PROGRAM_ARB */ + { 36607, 0x0000864A }, /* GL_VERTEX_PROGRAM_BINDING_NV */ + { 36636, 0x00008620 }, /* GL_VERTEX_PROGRAM_NV */ + { 36657, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE */ + { 36686, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_ARB */ + { 36719, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_NV */ + { 36751, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE */ + { 36778, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_ARB */ + { 36809, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_NV */ + { 36839, 0x00008B31 }, /* GL_VERTEX_SHADER */ + { 36856, 0x00008B31 }, /* GL_VERTEX_SHADER_ARB */ + { 36877, 0x00008621 }, /* GL_VERTEX_STATE_PROGRAM_NV */ + { 36904, 0x00000BA2 }, /* GL_VIEWPORT */ + { 36916, 0x00000800 }, /* GL_VIEWPORT_BIT */ + { 36932, 0x000086AD }, /* GL_WEIGHT_ARRAY_ARB */ + { 36952, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */ + { 36983, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB */ + { 37018, 0x000086AC }, /* GL_WEIGHT_ARRAY_POINTER_ARB */ + { 37046, 0x000086AB }, /* GL_WEIGHT_ARRAY_SIZE_ARB */ + { 37071, 0x000086AA }, /* GL_WEIGHT_ARRAY_STRIDE_ARB */ + { 37098, 0x000086A9 }, /* GL_WEIGHT_ARRAY_TYPE_ARB */ + { 37123, 0x000086A6 }, /* GL_WEIGHT_SUM_UNITY_ARB */ + { 37147, 0x000081D4 }, /* GL_WRAP_BORDER_SUN */ + { 37166, 0x000088B9 }, /* GL_WRITE_ONLY */ + { 37180, 0x000088B9 }, /* GL_WRITE_ONLY_ARB */ + { 37198, 0x00001506 }, /* GL_XOR */ + { 37205, 0x000085B9 }, /* GL_YCBCR_422_APPLE */ + { 37224, 0x00008757 }, /* GL_YCBCR_MESA */ + { 37238, 0x00000000 }, /* GL_ZERO */ + { 37246, 0x00000D16 }, /* GL_ZOOM_X */ + { 37256, 0x00000D17 }, /* GL_ZOOM_Y */ }; -static const unsigned reduced_enums[1240] = +static const unsigned reduced_enums[1277] = { - 404, /* GL_FALSE */ - 576, /* GL_LINES */ - 578, /* GL_LINE_LOOP */ - 585, /* GL_LINE_STRIP */ - 1533, /* GL_TRIANGLES */ - 1536, /* GL_TRIANGLE_STRIP */ - 1534, /* GL_TRIANGLE_FAN */ - 1127, /* GL_QUADS */ - 1129, /* GL_QUAD_STRIP */ - 1017, /* GL_POLYGON */ - 1029, /* GL_POLYGON_STIPPLE_BIT */ - 983, /* GL_PIXEL_MODE_BIT */ - 563, /* GL_LIGHTING_BIT */ - 420, /* GL_FOG_BIT */ + 30, /* GL_ALL_CLIENT_ATTRIB_BITS */ + 435, /* GL_FALSE */ + 643, /* GL_LINES */ + 645, /* GL_LINE_LOOP */ + 652, /* GL_LINE_STRIP */ + 1628, /* GL_TRIANGLES */ + 1631, /* GL_TRIANGLE_STRIP */ + 1629, /* GL_TRIANGLE_FAN */ + 1206, /* GL_QUADS */ + 1208, /* GL_QUAD_STRIP */ + 1096, /* GL_POLYGON */ + 1108, /* GL_POLYGON_STIPPLE_BIT */ + 1061, /* GL_PIXEL_MODE_BIT */ + 630, /* GL_LIGHTING_BIT */ + 457, /* GL_FOG_BIT */ 8, /* GL_ACCUM */ - 594, /* GL_LOAD */ - 1169, /* GL_RETURN */ - 856, /* GL_MULT */ - 19, /* GL_ADD */ - 872, /* GL_NEVER */ - 553, /* GL_LESS */ - 394, /* GL_EQUAL */ - 552, /* GL_LEQUAL */ - 482, /* GL_GREATER */ - 887, /* GL_NOTEQUAL */ - 481, /* GL_GEQUAL */ - 42, /* GL_ALWAYS */ - 1293, /* GL_SRC_COLOR */ - 916, /* GL_ONE_MINUS_SRC_COLOR */ - 1291, /* GL_SRC_ALPHA */ - 915, /* GL_ONE_MINUS_SRC_ALPHA */ - 374, /* GL_DST_ALPHA */ - 913, /* GL_ONE_MINUS_DST_ALPHA */ - 375, /* GL_DST_COLOR */ - 914, /* GL_ONE_MINUS_DST_COLOR */ - 1292, /* GL_SRC_ALPHA_SATURATE */ - 469, /* GL_FRONT_LEFT */ - 470, /* GL_FRONT_RIGHT */ - 64, /* GL_BACK_LEFT */ - 65, /* GL_BACK_RIGHT */ - 466, /* GL_FRONT */ - 63, /* GL_BACK */ - 551, /* GL_LEFT */ - 1209, /* GL_RIGHT */ - 467, /* GL_FRONT_AND_BACK */ - 58, /* GL_AUX0 */ - 59, /* GL_AUX1 */ - 60, /* GL_AUX2 */ - 61, /* GL_AUX3 */ - 543, /* GL_INVALID_ENUM */ - 546, /* GL_INVALID_VALUE */ - 545, /* GL_INVALID_OPERATION */ - 1294, /* GL_STACK_OVERFLOW */ - 1295, /* GL_STACK_UNDERFLOW */ - 941, /* GL_OUT_OF_MEMORY */ - 544, /* GL_INVALID_FRAMEBUFFER_OPERATION_EXT */ + 662, /* GL_LOAD */ + 1248, /* GL_RETURN */ + 934, /* GL_MULT */ + 23, /* GL_ADD */ + 950, /* GL_NEVER */ + 620, /* GL_LESS */ + 425, /* GL_EQUAL */ + 619, /* GL_LEQUAL */ + 545, /* GL_GREATER */ + 965, /* GL_NOTEQUAL */ + 520, /* GL_GEQUAL */ + 46, /* GL_ALWAYS */ + 1381, /* GL_SRC_COLOR */ + 994, /* GL_ONE_MINUS_SRC_COLOR */ + 1379, /* GL_SRC_ALPHA */ + 993, /* GL_ONE_MINUS_SRC_ALPHA */ + 405, /* GL_DST_ALPHA */ + 991, /* GL_ONE_MINUS_DST_ALPHA */ + 406, /* GL_DST_COLOR */ + 992, /* GL_ONE_MINUS_DST_COLOR */ + 1380, /* GL_SRC_ALPHA_SATURATE */ + 508, /* GL_FRONT_LEFT */ + 509, /* GL_FRONT_RIGHT */ + 69, /* GL_BACK_LEFT */ + 70, /* GL_BACK_RIGHT */ + 505, /* GL_FRONT */ + 68, /* GL_BACK */ + 618, /* GL_LEFT */ + 1288, /* GL_RIGHT */ + 506, /* GL_FRONT_AND_BACK */ + 63, /* GL_AUX0 */ + 64, /* GL_AUX1 */ + 65, /* GL_AUX2 */ + 66, /* GL_AUX3 */ + 610, /* GL_INVALID_ENUM */ + 613, /* GL_INVALID_VALUE */ + 612, /* GL_INVALID_OPERATION */ + 1382, /* GL_STACK_OVERFLOW */ + 1383, /* GL_STACK_UNDERFLOW */ + 1019, /* GL_OUT_OF_MEMORY */ + 611, /* GL_INVALID_FRAMEBUFFER_OPERATION_EXT */ 0, /* GL_2D */ 2, /* GL_3D */ 3, /* GL_3D_COLOR */ 4, /* GL_3D_COLOR_TEXTURE */ 6, /* GL_4D_COLOR_TEXTURE */ - 961, /* GL_PASS_THROUGH_TOKEN */ - 1016, /* GL_POINT_TOKEN */ - 586, /* GL_LINE_TOKEN */ - 1030, /* GL_POLYGON_TOKEN */ - 69, /* GL_BITMAP_TOKEN */ - 373, /* GL_DRAW_PIXEL_TOKEN */ - 258, /* GL_COPY_PIXEL_TOKEN */ - 579, /* GL_LINE_RESET_TOKEN */ - 397, /* GL_EXP */ - 398, /* GL_EXP2 */ - 289, /* GL_CW */ - 106, /* GL_CCW */ - 127, /* GL_COEFF */ - 938, /* GL_ORDER */ - 328, /* GL_DOMAIN */ - 266, /* GL_CURRENT_COLOR */ - 269, /* GL_CURRENT_INDEX */ - 275, /* GL_CURRENT_NORMAL */ - 286, /* GL_CURRENT_TEXTURE_COORDS */ - 279, /* GL_CURRENT_RASTER_COLOR */ - 281, /* GL_CURRENT_RASTER_INDEX */ - 284, /* GL_CURRENT_RASTER_TEXTURE_COORDS */ - 282, /* GL_CURRENT_RASTER_POSITION */ - 283, /* GL_CURRENT_RASTER_POSITION_VALID */ - 280, /* GL_CURRENT_RASTER_DISTANCE */ - 1010, /* GL_POINT_SMOOTH */ - 999, /* GL_POINT_SIZE */ - 1009, /* GL_POINT_SIZE_RANGE */ - 1000, /* GL_POINT_SIZE_GRANULARITY */ - 580, /* GL_LINE_SMOOTH */ - 587, /* GL_LINE_WIDTH */ - 589, /* GL_LINE_WIDTH_RANGE */ - 588, /* GL_LINE_WIDTH_GRANULARITY */ - 582, /* GL_LINE_STIPPLE */ - 583, /* GL_LINE_STIPPLE_PATTERN */ - 584, /* GL_LINE_STIPPLE_REPEAT */ - 593, /* GL_LIST_MODE */ - 747, /* GL_MAX_LIST_NESTING */ - 590, /* GL_LIST_BASE */ - 592, /* GL_LIST_INDEX */ - 1019, /* GL_POLYGON_MODE */ - 1026, /* GL_POLYGON_SMOOTH */ - 1028, /* GL_POLYGON_STIPPLE */ - 382, /* GL_EDGE_FLAG */ - 259, /* GL_CULL_FACE */ - 260, /* GL_CULL_FACE_MODE */ - 468, /* GL_FRONT_FACE */ - 562, /* GL_LIGHTING */ - 567, /* GL_LIGHT_MODEL_LOCAL_VIEWER */ - 568, /* GL_LIGHT_MODEL_TWO_SIDE */ - 564, /* GL_LIGHT_MODEL_AMBIENT */ - 1247, /* GL_SHADE_MODEL */ - 158, /* GL_COLOR_MATERIAL_FACE */ - 159, /* GL_COLOR_MATERIAL_PARAMETER */ - 157, /* GL_COLOR_MATERIAL */ - 419, /* GL_FOG */ - 441, /* GL_FOG_INDEX */ - 437, /* GL_FOG_DENSITY */ - 445, /* GL_FOG_START */ - 439, /* GL_FOG_END */ - 442, /* GL_FOG_MODE */ - 421, /* GL_FOG_COLOR */ - 317, /* GL_DEPTH_RANGE */ - 322, /* GL_DEPTH_TEST */ - 325, /* GL_DEPTH_WRITEMASK */ - 305, /* GL_DEPTH_CLEAR_VALUE */ - 316, /* GL_DEPTH_FUNC */ + 1039, /* GL_PASS_THROUGH_TOKEN */ + 1095, /* GL_POINT_TOKEN */ + 653, /* GL_LINE_TOKEN */ + 1109, /* GL_POLYGON_TOKEN */ + 74, /* GL_BITMAP_TOKEN */ + 404, /* GL_DRAW_PIXEL_TOKEN */ + 270, /* GL_COPY_PIXEL_TOKEN */ + 646, /* GL_LINE_RESET_TOKEN */ + 428, /* GL_EXP */ + 429, /* GL_EXP2 */ + 303, /* GL_CW */ + 116, /* GL_CCW */ + 137, /* GL_COEFF */ + 1016, /* GL_ORDER */ + 343, /* GL_DOMAIN */ + 278, /* GL_CURRENT_COLOR */ + 281, /* GL_CURRENT_INDEX */ + 287, /* GL_CURRENT_NORMAL */ + 299, /* GL_CURRENT_TEXTURE_COORDS */ + 292, /* GL_CURRENT_RASTER_COLOR */ + 294, /* GL_CURRENT_RASTER_INDEX */ + 297, /* GL_CURRENT_RASTER_TEXTURE_COORDS */ + 295, /* GL_CURRENT_RASTER_POSITION */ + 296, /* GL_CURRENT_RASTER_POSITION_VALID */ + 293, /* GL_CURRENT_RASTER_DISTANCE */ + 1088, /* GL_POINT_SMOOTH */ + 1077, /* GL_POINT_SIZE */ + 1087, /* GL_POINT_SIZE_RANGE */ + 1078, /* GL_POINT_SIZE_GRANULARITY */ + 647, /* GL_LINE_SMOOTH */ + 654, /* GL_LINE_WIDTH */ + 656, /* GL_LINE_WIDTH_RANGE */ + 655, /* GL_LINE_WIDTH_GRANULARITY */ + 649, /* GL_LINE_STIPPLE */ + 650, /* GL_LINE_STIPPLE_PATTERN */ + 651, /* GL_LINE_STIPPLE_REPEAT */ + 661, /* GL_LIST_MODE */ + 819, /* GL_MAX_LIST_NESTING */ + 658, /* GL_LIST_BASE */ + 660, /* GL_LIST_INDEX */ + 1098, /* GL_POLYGON_MODE */ + 1105, /* GL_POLYGON_SMOOTH */ + 1107, /* GL_POLYGON_STIPPLE */ + 413, /* GL_EDGE_FLAG */ + 271, /* GL_CULL_FACE */ + 272, /* GL_CULL_FACE_MODE */ + 507, /* GL_FRONT_FACE */ + 629, /* GL_LIGHTING */ + 634, /* GL_LIGHT_MODEL_LOCAL_VIEWER */ + 635, /* GL_LIGHT_MODEL_TWO_SIDE */ + 631, /* GL_LIGHT_MODEL_AMBIENT */ + 1334, /* GL_SHADE_MODEL */ + 168, /* GL_COLOR_MATERIAL_FACE */ + 169, /* GL_COLOR_MATERIAL_PARAMETER */ + 167, /* GL_COLOR_MATERIAL */ + 456, /* GL_FOG */ + 478, /* GL_FOG_INDEX */ + 474, /* GL_FOG_DENSITY */ + 482, /* GL_FOG_START */ + 476, /* GL_FOG_END */ + 479, /* GL_FOG_MODE */ + 458, /* GL_FOG_COLOR */ + 332, /* GL_DEPTH_RANGE */ + 337, /* GL_DEPTH_TEST */ + 340, /* GL_DEPTH_WRITEMASK */ + 320, /* GL_DEPTH_CLEAR_VALUE */ + 331, /* GL_DEPTH_FUNC */ 12, /* GL_ACCUM_CLEAR_VALUE */ - 1318, /* GL_STENCIL_TEST */ - 1306, /* GL_STENCIL_CLEAR_VALUE */ - 1308, /* GL_STENCIL_FUNC */ - 1320, /* GL_STENCIL_VALUE_MASK */ - 1307, /* GL_STENCIL_FAIL */ - 1315, /* GL_STENCIL_PASS_DEPTH_FAIL */ - 1316, /* GL_STENCIL_PASS_DEPTH_PASS */ - 1317, /* GL_STENCIL_REF */ - 1321, /* GL_STENCIL_WRITEMASK */ - 720, /* GL_MATRIX_MODE */ - 877, /* GL_NORMALIZE */ - 1612, /* GL_VIEWPORT */ - 851, /* GL_MODELVIEW_STACK_DEPTH */ - 1109, /* GL_PROJECTION_STACK_DEPTH */ - 1512, /* GL_TEXTURE_STACK_DEPTH */ - 849, /* GL_MODELVIEW_MATRIX */ - 1108, /* GL_PROJECTION_MATRIX */ - 1497, /* GL_TEXTURE_MATRIX */ - 56, /* GL_ATTRIB_STACK_DEPTH */ - 117, /* GL_CLIENT_ATTRIB_STACK_DEPTH */ - 39, /* GL_ALPHA_TEST */ - 40, /* GL_ALPHA_TEST_FUNC */ - 41, /* GL_ALPHA_TEST_REF */ - 327, /* GL_DITHER */ - 73, /* GL_BLEND_DST */ - 80, /* GL_BLEND_SRC */ - 70, /* GL_BLEND */ - 596, /* GL_LOGIC_OP_MODE */ - 521, /* GL_INDEX_LOGIC_OP */ - 156, /* GL_COLOR_LOGIC_OP */ - 62, /* GL_AUX_BUFFERS */ - 338, /* GL_DRAW_BUFFER */ - 1139, /* GL_READ_BUFFER */ - 1230, /* GL_SCISSOR_BOX */ - 1231, /* GL_SCISSOR_TEST */ - 520, /* GL_INDEX_CLEAR_VALUE */ - 525, /* GL_INDEX_WRITEMASK */ - 153, /* GL_COLOR_CLEAR_VALUE */ - 195, /* GL_COLOR_WRITEMASK */ - 522, /* GL_INDEX_MODE */ - 1203, /* GL_RGBA_MODE */ - 337, /* GL_DOUBLEBUFFER */ - 1322, /* GL_STEREO */ - 1162, /* GL_RENDER_MODE */ - 962, /* GL_PERSPECTIVE_CORRECTION_HINT */ - 1011, /* GL_POINT_SMOOTH_HINT */ - 581, /* GL_LINE_SMOOTH_HINT */ - 1027, /* GL_POLYGON_SMOOTH_HINT */ - 440, /* GL_FOG_HINT */ - 1478, /* GL_TEXTURE_GEN_S */ - 1479, /* GL_TEXTURE_GEN_T */ - 1477, /* GL_TEXTURE_GEN_R */ - 1476, /* GL_TEXTURE_GEN_Q */ - 975, /* GL_PIXEL_MAP_I_TO_I */ - 981, /* GL_PIXEL_MAP_S_TO_S */ - 977, /* GL_PIXEL_MAP_I_TO_R */ - 973, /* GL_PIXEL_MAP_I_TO_G */ - 971, /* GL_PIXEL_MAP_I_TO_B */ - 969, /* GL_PIXEL_MAP_I_TO_A */ - 979, /* GL_PIXEL_MAP_R_TO_R */ - 967, /* GL_PIXEL_MAP_G_TO_G */ - 965, /* GL_PIXEL_MAP_B_TO_B */ - 963, /* GL_PIXEL_MAP_A_TO_A */ - 976, /* GL_PIXEL_MAP_I_TO_I_SIZE */ - 982, /* GL_PIXEL_MAP_S_TO_S_SIZE */ - 978, /* GL_PIXEL_MAP_I_TO_R_SIZE */ - 974, /* GL_PIXEL_MAP_I_TO_G_SIZE */ - 972, /* GL_PIXEL_MAP_I_TO_B_SIZE */ - 970, /* GL_PIXEL_MAP_I_TO_A_SIZE */ - 980, /* GL_PIXEL_MAP_R_TO_R_SIZE */ - 968, /* GL_PIXEL_MAP_G_TO_G_SIZE */ - 966, /* GL_PIXEL_MAP_B_TO_B_SIZE */ - 964, /* GL_PIXEL_MAP_A_TO_A_SIZE */ - 1545, /* GL_UNPACK_SWAP_BYTES */ - 1540, /* GL_UNPACK_LSB_FIRST */ - 1541, /* GL_UNPACK_ROW_LENGTH */ - 1544, /* GL_UNPACK_SKIP_ROWS */ - 1543, /* GL_UNPACK_SKIP_PIXELS */ - 1538, /* GL_UNPACK_ALIGNMENT */ - 950, /* GL_PACK_SWAP_BYTES */ - 945, /* GL_PACK_LSB_FIRST */ - 946, /* GL_PACK_ROW_LENGTH */ - 949, /* GL_PACK_SKIP_ROWS */ - 948, /* GL_PACK_SKIP_PIXELS */ - 942, /* GL_PACK_ALIGNMENT */ - 673, /* GL_MAP_COLOR */ - 674, /* GL_MAP_STENCIL */ - 524, /* GL_INDEX_SHIFT */ - 523, /* GL_INDEX_OFFSET */ - 1151, /* GL_RED_SCALE */ - 1149, /* GL_RED_BIAS */ - 1629, /* GL_ZOOM_X */ - 1630, /* GL_ZOOM_Y */ - 486, /* GL_GREEN_SCALE */ - 484, /* GL_GREEN_BIAS */ - 86, /* GL_BLUE_SCALE */ - 84, /* GL_BLUE_BIAS */ - 38, /* GL_ALPHA_SCALE */ - 36, /* GL_ALPHA_BIAS */ - 318, /* GL_DEPTH_SCALE */ - 299, /* GL_DEPTH_BIAS */ - 743, /* GL_MAX_EVAL_ORDER */ - 746, /* GL_MAX_LIGHTS */ - 728, /* GL_MAX_CLIP_PLANES */ - 788, /* GL_MAX_TEXTURE_SIZE */ - 752, /* GL_MAX_PIXEL_MAP_TABLE */ - 724, /* GL_MAX_ATTRIB_STACK_DEPTH */ - 749, /* GL_MAX_MODELVIEW_STACK_DEPTH */ - 750, /* GL_MAX_NAME_STACK_DEPTH */ - 778, /* GL_MAX_PROJECTION_STACK_DEPTH */ - 789, /* GL_MAX_TEXTURE_STACK_DEPTH */ - 799, /* GL_MAX_VIEWPORT_DIMS */ - 725, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */ - 1329, /* GL_SUBPIXEL_BITS */ - 519, /* GL_INDEX_BITS */ - 1150, /* GL_RED_BITS */ - 485, /* GL_GREEN_BITS */ - 85, /* GL_BLUE_BITS */ - 37, /* GL_ALPHA_BITS */ - 300, /* GL_DEPTH_BITS */ - 1304, /* GL_STENCIL_BITS */ + 1413, /* GL_STENCIL_TEST */ + 1401, /* GL_STENCIL_CLEAR_VALUE */ + 1403, /* GL_STENCIL_FUNC */ + 1415, /* GL_STENCIL_VALUE_MASK */ + 1402, /* GL_STENCIL_FAIL */ + 1410, /* GL_STENCIL_PASS_DEPTH_FAIL */ + 1411, /* GL_STENCIL_PASS_DEPTH_PASS */ + 1412, /* GL_STENCIL_REF */ + 1416, /* GL_STENCIL_WRITEMASK */ + 789, /* GL_MATRIX_MODE */ + 955, /* GL_NORMALIZE */ + 1718, /* GL_VIEWPORT */ + 929, /* GL_MODELVIEW_STACK_DEPTH */ + 1188, /* GL_PROJECTION_STACK_DEPTH */ + 1607, /* GL_TEXTURE_STACK_DEPTH */ + 927, /* GL_MODELVIEW_MATRIX */ + 1187, /* GL_PROJECTION_MATRIX */ + 1592, /* GL_TEXTURE_MATRIX */ + 61, /* GL_ATTRIB_STACK_DEPTH */ + 127, /* GL_CLIENT_ATTRIB_STACK_DEPTH */ + 43, /* GL_ALPHA_TEST */ + 44, /* GL_ALPHA_TEST_FUNC */ + 45, /* GL_ALPHA_TEST_REF */ + 342, /* GL_DITHER */ + 78, /* GL_BLEND_DST */ + 86, /* GL_BLEND_SRC */ + 75, /* GL_BLEND */ + 664, /* GL_LOGIC_OP_MODE */ + 584, /* GL_INDEX_LOGIC_OP */ + 166, /* GL_COLOR_LOGIC_OP */ + 67, /* GL_AUX_BUFFERS */ + 353, /* GL_DRAW_BUFFER */ + 1218, /* GL_READ_BUFFER */ + 1315, /* GL_SCISSOR_BOX */ + 1316, /* GL_SCISSOR_TEST */ + 583, /* GL_INDEX_CLEAR_VALUE */ + 588, /* GL_INDEX_WRITEMASK */ + 163, /* GL_COLOR_CLEAR_VALUE */ + 205, /* GL_COLOR_WRITEMASK */ + 585, /* GL_INDEX_MODE */ + 1282, /* GL_RGBA_MODE */ + 352, /* GL_DOUBLEBUFFER */ + 1417, /* GL_STEREO */ + 1241, /* GL_RENDER_MODE */ + 1040, /* GL_PERSPECTIVE_CORRECTION_HINT */ + 1089, /* GL_POINT_SMOOTH_HINT */ + 648, /* GL_LINE_SMOOTH_HINT */ + 1106, /* GL_POLYGON_SMOOTH_HINT */ + 477, /* GL_FOG_HINT */ + 1573, /* GL_TEXTURE_GEN_S */ + 1574, /* GL_TEXTURE_GEN_T */ + 1572, /* GL_TEXTURE_GEN_R */ + 1571, /* GL_TEXTURE_GEN_Q */ + 1053, /* GL_PIXEL_MAP_I_TO_I */ + 1059, /* GL_PIXEL_MAP_S_TO_S */ + 1055, /* GL_PIXEL_MAP_I_TO_R */ + 1051, /* GL_PIXEL_MAP_I_TO_G */ + 1049, /* GL_PIXEL_MAP_I_TO_B */ + 1047, /* GL_PIXEL_MAP_I_TO_A */ + 1057, /* GL_PIXEL_MAP_R_TO_R */ + 1045, /* GL_PIXEL_MAP_G_TO_G */ + 1043, /* GL_PIXEL_MAP_B_TO_B */ + 1041, /* GL_PIXEL_MAP_A_TO_A */ + 1054, /* GL_PIXEL_MAP_I_TO_I_SIZE */ + 1060, /* GL_PIXEL_MAP_S_TO_S_SIZE */ + 1056, /* GL_PIXEL_MAP_I_TO_R_SIZE */ + 1052, /* GL_PIXEL_MAP_I_TO_G_SIZE */ + 1050, /* GL_PIXEL_MAP_I_TO_B_SIZE */ + 1048, /* GL_PIXEL_MAP_I_TO_A_SIZE */ + 1058, /* GL_PIXEL_MAP_R_TO_R_SIZE */ + 1046, /* GL_PIXEL_MAP_G_TO_G_SIZE */ + 1044, /* GL_PIXEL_MAP_B_TO_B_SIZE */ + 1042, /* GL_PIXEL_MAP_A_TO_A_SIZE */ + 1640, /* GL_UNPACK_SWAP_BYTES */ + 1635, /* GL_UNPACK_LSB_FIRST */ + 1636, /* GL_UNPACK_ROW_LENGTH */ + 1639, /* GL_UNPACK_SKIP_ROWS */ + 1638, /* GL_UNPACK_SKIP_PIXELS */ + 1633, /* GL_UNPACK_ALIGNMENT */ + 1028, /* GL_PACK_SWAP_BYTES */ + 1023, /* GL_PACK_LSB_FIRST */ + 1024, /* GL_PACK_ROW_LENGTH */ + 1027, /* GL_PACK_SKIP_ROWS */ + 1026, /* GL_PACK_SKIP_PIXELS */ + 1020, /* GL_PACK_ALIGNMENT */ + 742, /* GL_MAP_COLOR */ + 743, /* GL_MAP_STENCIL */ + 587, /* GL_INDEX_SHIFT */ + 586, /* GL_INDEX_OFFSET */ + 1230, /* GL_RED_SCALE */ + 1228, /* GL_RED_BIAS */ + 1735, /* GL_ZOOM_X */ + 1736, /* GL_ZOOM_Y */ + 549, /* GL_GREEN_SCALE */ + 547, /* GL_GREEN_BIAS */ + 92, /* GL_BLUE_SCALE */ + 90, /* GL_BLUE_BIAS */ + 42, /* GL_ALPHA_SCALE */ + 40, /* GL_ALPHA_BIAS */ + 333, /* GL_DEPTH_SCALE */ + 314, /* GL_DEPTH_BIAS */ + 814, /* GL_MAX_EVAL_ORDER */ + 818, /* GL_MAX_LIGHTS */ + 797, /* GL_MAX_CLIP_PLANES */ + 862, /* GL_MAX_TEXTURE_SIZE */ + 824, /* GL_MAX_PIXEL_MAP_TABLE */ + 793, /* GL_MAX_ATTRIB_STACK_DEPTH */ + 821, /* GL_MAX_MODELVIEW_STACK_DEPTH */ + 822, /* GL_MAX_NAME_STACK_DEPTH */ + 850, /* GL_MAX_PROJECTION_STACK_DEPTH */ + 863, /* GL_MAX_TEXTURE_STACK_DEPTH */ + 877, /* GL_MAX_VIEWPORT_DIMS */ + 794, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */ + 1424, /* GL_SUBPIXEL_BITS */ + 582, /* GL_INDEX_BITS */ + 1229, /* GL_RED_BITS */ + 548, /* GL_GREEN_BITS */ + 91, /* GL_BLUE_BITS */ + 41, /* GL_ALPHA_BITS */ + 315, /* GL_DEPTH_BITS */ + 1399, /* GL_STENCIL_BITS */ 14, /* GL_ACCUM_RED_BITS */ 13, /* GL_ACCUM_GREEN_BITS */ 10, /* GL_ACCUM_BLUE_BITS */ 9, /* GL_ACCUM_ALPHA_BITS */ - 865, /* GL_NAME_STACK_DEPTH */ - 57, /* GL_AUTO_NORMAL */ - 619, /* GL_MAP1_COLOR_4 */ - 622, /* GL_MAP1_INDEX */ - 623, /* GL_MAP1_NORMAL */ - 624, /* GL_MAP1_TEXTURE_COORD_1 */ - 625, /* GL_MAP1_TEXTURE_COORD_2 */ - 626, /* GL_MAP1_TEXTURE_COORD_3 */ - 627, /* GL_MAP1_TEXTURE_COORD_4 */ - 628, /* GL_MAP1_VERTEX_3 */ - 629, /* GL_MAP1_VERTEX_4 */ - 646, /* GL_MAP2_COLOR_4 */ - 649, /* GL_MAP2_INDEX */ - 650, /* GL_MAP2_NORMAL */ - 651, /* GL_MAP2_TEXTURE_COORD_1 */ - 652, /* GL_MAP2_TEXTURE_COORD_2 */ - 653, /* GL_MAP2_TEXTURE_COORD_3 */ - 654, /* GL_MAP2_TEXTURE_COORD_4 */ - 655, /* GL_MAP2_VERTEX_3 */ - 656, /* GL_MAP2_VERTEX_4 */ - 620, /* GL_MAP1_GRID_DOMAIN */ - 621, /* GL_MAP1_GRID_SEGMENTS */ - 647, /* GL_MAP2_GRID_DOMAIN */ - 648, /* GL_MAP2_GRID_SEGMENTS */ - 1406, /* GL_TEXTURE_1D */ - 1407, /* GL_TEXTURE_2D */ - 407, /* GL_FEEDBACK_BUFFER_POINTER */ - 408, /* GL_FEEDBACK_BUFFER_SIZE */ - 409, /* GL_FEEDBACK_BUFFER_TYPE */ - 1240, /* GL_SELECTION_BUFFER_POINTER */ - 1241, /* GL_SELECTION_BUFFER_SIZE */ - 1515, /* GL_TEXTURE_WIDTH */ - 1483, /* GL_TEXTURE_HEIGHT */ - 1439, /* GL_TEXTURE_COMPONENTS */ - 1423, /* GL_TEXTURE_BORDER_COLOR */ - 1422, /* GL_TEXTURE_BORDER */ - 329, /* GL_DONT_CARE */ - 405, /* GL_FASTEST */ - 873, /* GL_NICEST */ - 43, /* GL_AMBIENT */ - 326, /* GL_DIFFUSE */ - 1280, /* GL_SPECULAR */ - 1031, /* GL_POSITION */ - 1283, /* GL_SPOT_DIRECTION */ - 1284, /* GL_SPOT_EXPONENT */ - 1282, /* GL_SPOT_CUTOFF */ - 233, /* GL_CONSTANT_ATTENUATION */ - 571, /* GL_LINEAR_ATTENUATION */ - 1126, /* GL_QUADRATIC_ATTENUATION */ - 208, /* GL_COMPILE */ - 209, /* GL_COMPILE_AND_EXECUTE */ - 101, /* GL_BYTE */ - 1546, /* GL_UNSIGNED_BYTE */ - 1251, /* GL_SHORT */ - 1555, /* GL_UNSIGNED_SHORT */ - 526, /* GL_INT */ - 1549, /* GL_UNSIGNED_INT */ - 412, /* GL_FLOAT */ + 943, /* GL_NAME_STACK_DEPTH */ + 62, /* GL_AUTO_NORMAL */ + 688, /* GL_MAP1_COLOR_4 */ + 691, /* GL_MAP1_INDEX */ + 692, /* GL_MAP1_NORMAL */ + 693, /* GL_MAP1_TEXTURE_COORD_1 */ + 694, /* GL_MAP1_TEXTURE_COORD_2 */ + 695, /* GL_MAP1_TEXTURE_COORD_3 */ + 696, /* GL_MAP1_TEXTURE_COORD_4 */ + 697, /* GL_MAP1_VERTEX_3 */ + 698, /* GL_MAP1_VERTEX_4 */ + 715, /* GL_MAP2_COLOR_4 */ + 718, /* GL_MAP2_INDEX */ + 719, /* GL_MAP2_NORMAL */ + 720, /* GL_MAP2_TEXTURE_COORD_1 */ + 721, /* GL_MAP2_TEXTURE_COORD_2 */ + 722, /* GL_MAP2_TEXTURE_COORD_3 */ + 723, /* GL_MAP2_TEXTURE_COORD_4 */ + 724, /* GL_MAP2_VERTEX_3 */ + 725, /* GL_MAP2_VERTEX_4 */ + 689, /* GL_MAP1_GRID_DOMAIN */ + 690, /* GL_MAP1_GRID_SEGMENTS */ + 716, /* GL_MAP2_GRID_DOMAIN */ + 717, /* GL_MAP2_GRID_SEGMENTS */ + 1501, /* GL_TEXTURE_1D */ + 1502, /* GL_TEXTURE_2D */ + 438, /* GL_FEEDBACK_BUFFER_POINTER */ + 439, /* GL_FEEDBACK_BUFFER_SIZE */ + 440, /* GL_FEEDBACK_BUFFER_TYPE */ + 1325, /* GL_SELECTION_BUFFER_POINTER */ + 1326, /* GL_SELECTION_BUFFER_SIZE */ + 1610, /* GL_TEXTURE_WIDTH */ + 1578, /* GL_TEXTURE_HEIGHT */ + 1534, /* GL_TEXTURE_COMPONENTS */ + 1518, /* GL_TEXTURE_BORDER_COLOR */ + 1517, /* GL_TEXTURE_BORDER */ + 344, /* GL_DONT_CARE */ + 436, /* GL_FASTEST */ + 951, /* GL_NICEST */ + 47, /* GL_AMBIENT */ + 341, /* GL_DIFFUSE */ + 1368, /* GL_SPECULAR */ + 1110, /* GL_POSITION */ + 1371, /* GL_SPOT_DIRECTION */ + 1372, /* GL_SPOT_EXPONENT */ + 1370, /* GL_SPOT_CUTOFF */ + 244, /* GL_CONSTANT_ATTENUATION */ + 638, /* GL_LINEAR_ATTENUATION */ + 1205, /* GL_QUADRATIC_ATTENUATION */ + 218, /* GL_COMPILE */ + 219, /* GL_COMPILE_AND_EXECUTE */ + 111, /* GL_BYTE */ + 1641, /* GL_UNSIGNED_BYTE */ + 1339, /* GL_SHORT */ + 1650, /* GL_UNSIGNED_SHORT */ + 590, /* GL_INT */ + 1644, /* GL_UNSIGNED_INT */ + 443, /* GL_FLOAT */ 1, /* GL_2_BYTES */ 5, /* GL_3_BYTES */ 7, /* GL_4_BYTES */ - 336, /* GL_DOUBLE */ - 113, /* GL_CLEAR */ - 45, /* GL_AND */ - 47, /* GL_AND_REVERSE */ - 256, /* GL_COPY */ - 46, /* GL_AND_INVERTED */ - 875, /* GL_NOOP */ - 1625, /* GL_XOR */ - 937, /* GL_OR */ - 876, /* GL_NOR */ - 395, /* GL_EQUIV */ - 549, /* GL_INVERT */ - 940, /* GL_OR_REVERSE */ - 257, /* GL_COPY_INVERTED */ - 939, /* GL_OR_INVERTED */ - 866, /* GL_NAND */ - 1245, /* GL_SET */ - 392, /* GL_EMISSION */ - 1250, /* GL_SHININESS */ - 44, /* GL_AMBIENT_AND_DIFFUSE */ - 155, /* GL_COLOR_INDEXES */ - 816, /* GL_MODELVIEW */ - 1107, /* GL_PROJECTION */ - 1341, /* GL_TEXTURE */ - 128, /* GL_COLOR */ - 297, /* GL_DEPTH */ - 1302, /* GL_STENCIL */ - 154, /* GL_COLOR_INDEX */ - 1309, /* GL_STENCIL_INDEX */ - 306, /* GL_DEPTH_COMPONENT */ - 1146, /* GL_RED */ - 483, /* GL_GREEN */ - 83, /* GL_BLUE */ - 27, /* GL_ALPHA */ - 1170, /* GL_RGB */ - 1189, /* GL_RGBA */ - 597, /* GL_LUMINANCE */ - 618, /* GL_LUMINANCE_ALPHA */ - 68, /* GL_BITMAP */ - 988, /* GL_POINT */ - 569, /* GL_LINE */ - 410, /* GL_FILL */ - 1155, /* GL_RENDER */ - 406, /* GL_FEEDBACK */ - 1239, /* GL_SELECT */ - 411, /* GL_FLAT */ - 1255, /* GL_SMOOTH */ - 550, /* GL_KEEP */ - 1164, /* GL_REPLACE */ - 510, /* GL_INCR */ - 294, /* GL_DECR */ - 1568, /* GL_VENDOR */ - 1161, /* GL_RENDERER */ - 1569, /* GL_VERSION */ - 399, /* GL_EXTENSIONS */ - 1210, /* GL_S */ - 1332, /* GL_T */ - 1136, /* GL_R */ - 1125, /* GL_Q */ - 852, /* GL_MODULATE */ - 293, /* GL_DECAL */ - 1473, /* GL_TEXTURE_ENV_MODE */ - 1472, /* GL_TEXTURE_ENV_COLOR */ - 1471, /* GL_TEXTURE_ENV */ - 400, /* GL_EYE_LINEAR */ - 899, /* GL_OBJECT_LINEAR */ - 1281, /* GL_SPHERE_MAP */ - 1475, /* GL_TEXTURE_GEN_MODE */ - 901, /* GL_OBJECT_PLANE */ - 401, /* GL_EYE_PLANE */ - 867, /* GL_NEAREST */ - 570, /* GL_LINEAR */ - 871, /* GL_NEAREST_MIPMAP_NEAREST */ - 575, /* GL_LINEAR_MIPMAP_NEAREST */ - 870, /* GL_NEAREST_MIPMAP_LINEAR */ - 574, /* GL_LINEAR_MIPMAP_LINEAR */ - 1496, /* GL_TEXTURE_MAG_FILTER */ - 1504, /* GL_TEXTURE_MIN_FILTER */ - 1517, /* GL_TEXTURE_WRAP_S */ - 1518, /* GL_TEXTURE_WRAP_T */ - 107, /* GL_CLAMP */ - 1163, /* GL_REPEAT */ - 1025, /* GL_POLYGON_OFFSET_UNITS */ - 1024, /* GL_POLYGON_OFFSET_POINT */ - 1023, /* GL_POLYGON_OFFSET_LINE */ - 1137, /* GL_R3_G3_B2 */ - 1566, /* GL_V2F */ - 1567, /* GL_V3F */ - 104, /* GL_C4UB_V2F */ - 105, /* GL_C4UB_V3F */ - 102, /* GL_C3F_V3F */ - 864, /* GL_N3F_V3F */ - 103, /* GL_C4F_N3F_V3F */ - 1337, /* GL_T2F_V3F */ - 1339, /* GL_T4F_V4F */ - 1335, /* GL_T2F_C4UB_V3F */ - 1333, /* GL_T2F_C3F_V3F */ - 1336, /* GL_T2F_N3F_V3F */ - 1334, /* GL_T2F_C4F_N3F_V3F */ - 1338, /* GL_T4F_C4F_N3F_V4F */ - 120, /* GL_CLIP_PLANE0 */ - 121, /* GL_CLIP_PLANE1 */ - 122, /* GL_CLIP_PLANE2 */ - 123, /* GL_CLIP_PLANE3 */ - 124, /* GL_CLIP_PLANE4 */ - 125, /* GL_CLIP_PLANE5 */ - 554, /* GL_LIGHT0 */ - 555, /* GL_LIGHT1 */ - 556, /* GL_LIGHT2 */ - 557, /* GL_LIGHT3 */ - 558, /* GL_LIGHT4 */ - 559, /* GL_LIGHT5 */ - 560, /* GL_LIGHT6 */ - 561, /* GL_LIGHT7 */ - 487, /* GL_HINT_BIT */ - 235, /* GL_CONSTANT_COLOR */ - 911, /* GL_ONE_MINUS_CONSTANT_COLOR */ - 230, /* GL_CONSTANT_ALPHA */ - 909, /* GL_ONE_MINUS_CONSTANT_ALPHA */ - 71, /* GL_BLEND_COLOR */ - 471, /* GL_FUNC_ADD */ - 800, /* GL_MIN */ - 722, /* GL_MAX */ - 76, /* GL_BLEND_EQUATION */ - 475, /* GL_FUNC_SUBTRACT */ - 473, /* GL_FUNC_REVERSE_SUBTRACT */ - 238, /* GL_CONVOLUTION_1D */ - 239, /* GL_CONVOLUTION_2D */ - 1242, /* GL_SEPARABLE_2D */ - 242, /* GL_CONVOLUTION_BORDER_MODE */ - 246, /* GL_CONVOLUTION_FILTER_SCALE */ - 244, /* GL_CONVOLUTION_FILTER_BIAS */ - 1147, /* GL_REDUCE */ - 248, /* GL_CONVOLUTION_FORMAT */ - 252, /* GL_CONVOLUTION_WIDTH */ - 250, /* GL_CONVOLUTION_HEIGHT */ - 735, /* GL_MAX_CONVOLUTION_WIDTH */ - 733, /* GL_MAX_CONVOLUTION_HEIGHT */ - 1064, /* GL_POST_CONVOLUTION_RED_SCALE */ - 1060, /* GL_POST_CONVOLUTION_GREEN_SCALE */ - 1055, /* GL_POST_CONVOLUTION_BLUE_SCALE */ - 1051, /* GL_POST_CONVOLUTION_ALPHA_SCALE */ - 1062, /* GL_POST_CONVOLUTION_RED_BIAS */ - 1058, /* GL_POST_CONVOLUTION_GREEN_BIAS */ - 1053, /* GL_POST_CONVOLUTION_BLUE_BIAS */ - 1049, /* GL_POST_CONVOLUTION_ALPHA_BIAS */ - 488, /* GL_HISTOGRAM */ - 1111, /* GL_PROXY_HISTOGRAM */ - 504, /* GL_HISTOGRAM_WIDTH */ - 494, /* GL_HISTOGRAM_FORMAT */ - 500, /* GL_HISTOGRAM_RED_SIZE */ - 496, /* GL_HISTOGRAM_GREEN_SIZE */ - 491, /* GL_HISTOGRAM_BLUE_SIZE */ - 489, /* GL_HISTOGRAM_ALPHA_SIZE */ - 498, /* GL_HISTOGRAM_LUMINANCE_SIZE */ - 502, /* GL_HISTOGRAM_SINK */ - 801, /* GL_MINMAX */ - 803, /* GL_MINMAX_FORMAT */ - 805, /* GL_MINMAX_SINK */ - 1340, /* GL_TABLE_TOO_LARGE_EXT */ - 1548, /* GL_UNSIGNED_BYTE_3_3_2 */ - 1557, /* GL_UNSIGNED_SHORT_4_4_4_4 */ - 1559, /* GL_UNSIGNED_SHORT_5_5_5_1 */ - 1553, /* GL_UNSIGNED_INT_8_8_8_8 */ - 1550, /* GL_UNSIGNED_INT_10_10_10_2 */ - 1022, /* GL_POLYGON_OFFSET_FILL */ - 1021, /* GL_POLYGON_OFFSET_FACTOR */ - 1020, /* GL_POLYGON_OFFSET_BIAS */ - 1167, /* GL_RESCALE_NORMAL */ - 32, /* GL_ALPHA4 */ - 34, /* GL_ALPHA8 */ - 28, /* GL_ALPHA12 */ - 30, /* GL_ALPHA16 */ - 608, /* GL_LUMINANCE4 */ - 614, /* GL_LUMINANCE8 */ - 598, /* GL_LUMINANCE12 */ - 604, /* GL_LUMINANCE16 */ - 609, /* GL_LUMINANCE4_ALPHA4 */ - 612, /* GL_LUMINANCE6_ALPHA2 */ - 615, /* GL_LUMINANCE8_ALPHA8 */ - 601, /* GL_LUMINANCE12_ALPHA4 */ - 599, /* GL_LUMINANCE12_ALPHA12 */ - 605, /* GL_LUMINANCE16_ALPHA16 */ - 527, /* GL_INTENSITY */ - 532, /* GL_INTENSITY4 */ - 534, /* GL_INTENSITY8 */ - 528, /* GL_INTENSITY12 */ - 530, /* GL_INTENSITY16 */ - 1179, /* GL_RGB2_EXT */ - 1180, /* GL_RGB4 */ - 1183, /* GL_RGB5 */ - 1187, /* GL_RGB8 */ - 1171, /* GL_RGB10 */ - 1175, /* GL_RGB12 */ - 1177, /* GL_RGB16 */ - 1194, /* GL_RGBA2 */ - 1196, /* GL_RGBA4 */ - 1184, /* GL_RGB5_A1 */ - 1200, /* GL_RGBA8 */ - 1172, /* GL_RGB10_A2 */ - 1190, /* GL_RGBA12 */ - 1192, /* GL_RGBA16 */ - 1509, /* GL_TEXTURE_RED_SIZE */ - 1481, /* GL_TEXTURE_GREEN_SIZE */ - 1420, /* GL_TEXTURE_BLUE_SIZE */ - 1409, /* GL_TEXTURE_ALPHA_SIZE */ - 1494, /* GL_TEXTURE_LUMINANCE_SIZE */ - 1485, /* GL_TEXTURE_INTENSITY_SIZE */ - 1165, /* GL_REPLACE_EXT */ - 1115, /* GL_PROXY_TEXTURE_1D */ - 1117, /* GL_PROXY_TEXTURE_2D */ - 1513, /* GL_TEXTURE_TOO_LARGE_EXT */ - 1506, /* GL_TEXTURE_PRIORITY */ - 1511, /* GL_TEXTURE_RESIDENT */ - 1412, /* GL_TEXTURE_BINDING_1D */ - 1413, /* GL_TEXTURE_BINDING_2D */ - 1414, /* GL_TEXTURE_BINDING_3D */ - 947, /* GL_PACK_SKIP_IMAGES */ - 943, /* GL_PACK_IMAGE_HEIGHT */ - 1542, /* GL_UNPACK_SKIP_IMAGES */ - 1539, /* GL_UNPACK_IMAGE_HEIGHT */ - 1408, /* GL_TEXTURE_3D */ - 1119, /* GL_PROXY_TEXTURE_3D */ - 1468, /* GL_TEXTURE_DEPTH */ - 1516, /* GL_TEXTURE_WRAP_R */ - 723, /* GL_MAX_3D_TEXTURE_SIZE */ - 1570, /* GL_VERTEX_ARRAY */ - 878, /* GL_NORMAL_ARRAY */ - 129, /* GL_COLOR_ARRAY */ - 513, /* GL_INDEX_ARRAY */ - 1447, /* GL_TEXTURE_COORD_ARRAY */ - 383, /* GL_EDGE_FLAG_ARRAY */ - 1575, /* GL_VERTEX_ARRAY_SIZE */ - 1577, /* GL_VERTEX_ARRAY_TYPE */ - 1576, /* GL_VERTEX_ARRAY_STRIDE */ - 883, /* GL_NORMAL_ARRAY_TYPE */ - 882, /* GL_NORMAL_ARRAY_STRIDE */ - 133, /* GL_COLOR_ARRAY_SIZE */ - 135, /* GL_COLOR_ARRAY_TYPE */ - 134, /* GL_COLOR_ARRAY_STRIDE */ - 518, /* GL_INDEX_ARRAY_TYPE */ - 517, /* GL_INDEX_ARRAY_STRIDE */ - 1451, /* GL_TEXTURE_COORD_ARRAY_SIZE */ - 1453, /* GL_TEXTURE_COORD_ARRAY_TYPE */ - 1452, /* GL_TEXTURE_COORD_ARRAY_STRIDE */ - 387, /* GL_EDGE_FLAG_ARRAY_STRIDE */ - 1574, /* GL_VERTEX_ARRAY_POINTER */ - 881, /* GL_NORMAL_ARRAY_POINTER */ - 132, /* GL_COLOR_ARRAY_POINTER */ - 516, /* GL_INDEX_ARRAY_POINTER */ - 1450, /* GL_TEXTURE_COORD_ARRAY_POINTER */ - 386, /* GL_EDGE_FLAG_ARRAY_POINTER */ - 857, /* GL_MULTISAMPLE */ - 1216, /* GL_SAMPLE_ALPHA_TO_COVERAGE */ - 1218, /* GL_SAMPLE_ALPHA_TO_ONE */ - 1223, /* GL_SAMPLE_COVERAGE */ - 1220, /* GL_SAMPLE_BUFFERS */ - 1211, /* GL_SAMPLES */ - 1227, /* GL_SAMPLE_COVERAGE_VALUE */ - 1225, /* GL_SAMPLE_COVERAGE_INVERT */ - 160, /* GL_COLOR_MATRIX */ - 162, /* GL_COLOR_MATRIX_STACK_DEPTH */ - 730, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */ - 1047, /* GL_POST_COLOR_MATRIX_RED_SCALE */ - 1043, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */ - 1038, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */ - 1034, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */ - 1045, /* GL_POST_COLOR_MATRIX_RED_BIAS */ - 1041, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */ - 1036, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */ - 1032, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */ - 1430, /* GL_TEXTURE_COLOR_TABLE_SGI */ - 1120, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */ - 1432, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ - 75, /* GL_BLEND_DST_RGB */ - 82, /* GL_BLEND_SRC_RGB */ - 74, /* GL_BLEND_DST_ALPHA */ - 81, /* GL_BLEND_SRC_ALPHA */ - 166, /* GL_COLOR_TABLE */ - 1057, /* GL_POST_CONVOLUTION_COLOR_TABLE */ - 1040, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */ - 1110, /* GL_PROXY_COLOR_TABLE */ - 1114, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */ - 1113, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */ - 190, /* GL_COLOR_TABLE_SCALE */ - 170, /* GL_COLOR_TABLE_BIAS */ - 175, /* GL_COLOR_TABLE_FORMAT */ - 192, /* GL_COLOR_TABLE_WIDTH */ - 187, /* GL_COLOR_TABLE_RED_SIZE */ - 178, /* GL_COLOR_TABLE_GREEN_SIZE */ - 172, /* GL_COLOR_TABLE_BLUE_SIZE */ - 167, /* GL_COLOR_TABLE_ALPHA_SIZE */ - 184, /* GL_COLOR_TABLE_LUMINANCE_SIZE */ - 181, /* GL_COLOR_TABLE_INTENSITY_SIZE */ - 66, /* GL_BGR */ - 67, /* GL_BGRA */ - 742, /* GL_MAX_ELEMENTS_VERTICES */ - 741, /* GL_MAX_ELEMENTS_INDICES */ - 1484, /* GL_TEXTURE_INDEX_SIZE_EXT */ - 126, /* GL_CLIP_VOLUME_CLIPPING_HINT_EXT */ - 1005, /* GL_POINT_SIZE_MIN */ - 1001, /* GL_POINT_SIZE_MAX */ - 995, /* GL_POINT_FADE_THRESHOLD_SIZE */ - 991, /* GL_POINT_DISTANCE_ATTENUATION */ - 108, /* GL_CLAMP_TO_BORDER */ - 111, /* GL_CLAMP_TO_EDGE */ - 1505, /* GL_TEXTURE_MIN_LOD */ - 1503, /* GL_TEXTURE_MAX_LOD */ - 1411, /* GL_TEXTURE_BASE_LEVEL */ - 1502, /* GL_TEXTURE_MAX_LEVEL */ - 507, /* GL_IGNORE_BORDER_HP */ - 234, /* GL_CONSTANT_BORDER_HP */ - 1166, /* GL_REPLICATE_BORDER_HP */ - 240, /* GL_CONVOLUTION_BORDER_COLOR */ - 906, /* GL_OCCLUSION_TEST_HP */ - 907, /* GL_OCCLUSION_TEST_RESULT_HP */ - 572, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */ - 1424, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */ - 1426, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */ - 1428, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */ - 1429, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */ - 1427, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */ - 1425, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */ - 726, /* GL_MAX_CLIPMAP_DEPTH_SGIX */ - 727, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */ - 1067, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */ - 1069, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */ - 1066, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */ - 1068, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */ - 1492, /* GL_TEXTURE_LOD_BIAS_S_SGIX */ - 1493, /* GL_TEXTURE_LOD_BIAS_T_SGIX */ - 1491, /* GL_TEXTURE_LOD_BIAS_R_SGIX */ - 477, /* GL_GENERATE_MIPMAP */ - 478, /* GL_GENERATE_MIPMAP_HINT */ - 443, /* GL_FOG_OFFSET_SGIX */ - 444, /* GL_FOG_OFFSET_VALUE_SGIX */ - 1438, /* GL_TEXTURE_COMPARE_SGIX */ - 1437, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */ - 1488, /* GL_TEXTURE_LEQUAL_R_SGIX */ - 1480, /* GL_TEXTURE_GEQUAL_R_SGIX */ - 307, /* GL_DEPTH_COMPONENT16 */ - 310, /* GL_DEPTH_COMPONENT24 */ - 313, /* GL_DEPTH_COMPONENT32 */ - 261, /* GL_CULL_VERTEX_EXT */ - 263, /* GL_CULL_VERTEX_OBJECT_POSITION_EXT */ - 262, /* GL_CULL_VERTEX_EYE_POSITION_EXT */ - 1622, /* GL_WRAP_BORDER_SUN */ - 1431, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */ - 565, /* GL_LIGHT_MODEL_COLOR_CONTROL */ - 1252, /* GL_SINGLE_COLOR */ - 1243, /* GL_SEPARATE_SPECULAR_COLOR */ - 1249, /* GL_SHARED_TEXTURE_PALETTE_EXT */ - 1547, /* GL_UNSIGNED_BYTE_2_3_3_REV */ - 1560, /* GL_UNSIGNED_SHORT_5_6_5 */ - 1561, /* GL_UNSIGNED_SHORT_5_6_5_REV */ - 1558, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */ - 1556, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */ - 1554, /* GL_UNSIGNED_INT_8_8_8_8_REV */ - 1552, /* GL_UNSIGNED_INT_2_10_10_10_REV */ - 1500, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */ - 1501, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */ - 1499, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */ - 808, /* GL_MIRRORED_REPEAT */ - 1205, /* GL_RGB_S3TC */ - 1182, /* GL_RGB4_S3TC */ - 1204, /* GL_RGBA_S3TC */ - 1199, /* GL_RGBA4_S3TC */ - 1202, /* GL_RGBA_DXT5_S3TC */ - 1197, /* GL_RGBA4_DXT5_S3TC */ - 227, /* GL_COMPRESSED_RGB_S3TC_DXT1_EXT */ - 222, /* GL_COMPRESSED_RGBA_S3TC_DXT1_EXT */ - 223, /* GL_COMPRESSED_RGBA_S3TC_DXT3_EXT */ - 224, /* GL_COMPRESSED_RGBA_S3TC_DXT5_EXT */ - 869, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */ - 868, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */ - 573, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */ - 430, /* GL_FOG_COORDINATE_SOURCE */ - 422, /* GL_FOG_COORD */ - 446, /* GL_FRAGMENT_DEPTH */ - 267, /* GL_CURRENT_FOG_COORD */ - 429, /* GL_FOG_COORDINATE_ARRAY_TYPE */ - 428, /* GL_FOG_COORDINATE_ARRAY_STRIDE */ - 427, /* GL_FOG_COORDINATE_ARRAY_POINTER */ - 424, /* GL_FOG_COORDINATE_ARRAY */ - 164, /* GL_COLOR_SUM */ - 285, /* GL_CURRENT_SECONDARY_COLOR */ - 1236, /* GL_SECONDARY_COLOR_ARRAY_SIZE */ - 1238, /* GL_SECONDARY_COLOR_ARRAY_TYPE */ - 1237, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */ - 1235, /* GL_SECONDARY_COLOR_ARRAY_POINTER */ - 1232, /* GL_SECONDARY_COLOR_ARRAY */ - 24, /* GL_ALIASED_POINT_SIZE_RANGE */ - 23, /* GL_ALIASED_LINE_WIDTH_RANGE */ - 1342, /* GL_TEXTURE0 */ - 1344, /* GL_TEXTURE1 */ - 1366, /* GL_TEXTURE2 */ - 1388, /* GL_TEXTURE3 */ - 1394, /* GL_TEXTURE4 */ - 1396, /* GL_TEXTURE5 */ - 1398, /* GL_TEXTURE6 */ - 1400, /* GL_TEXTURE7 */ - 1402, /* GL_TEXTURE8 */ - 1404, /* GL_TEXTURE9 */ - 1345, /* GL_TEXTURE10 */ - 1347, /* GL_TEXTURE11 */ - 1349, /* GL_TEXTURE12 */ - 1351, /* GL_TEXTURE13 */ - 1353, /* GL_TEXTURE14 */ - 1355, /* GL_TEXTURE15 */ - 1357, /* GL_TEXTURE16 */ - 1359, /* GL_TEXTURE17 */ - 1361, /* GL_TEXTURE18 */ - 1363, /* GL_TEXTURE19 */ - 1367, /* GL_TEXTURE20 */ - 1369, /* GL_TEXTURE21 */ - 1371, /* GL_TEXTURE22 */ - 1373, /* GL_TEXTURE23 */ - 1375, /* GL_TEXTURE24 */ - 1377, /* GL_TEXTURE25 */ - 1379, /* GL_TEXTURE26 */ - 1381, /* GL_TEXTURE27 */ - 1383, /* GL_TEXTURE28 */ - 1385, /* GL_TEXTURE29 */ - 1389, /* GL_TEXTURE30 */ - 1391, /* GL_TEXTURE31 */ - 16, /* GL_ACTIVE_TEXTURE */ - 114, /* GL_CLIENT_ACTIVE_TEXTURE */ - 790, /* GL_MAX_TEXTURE_UNITS */ - 1526, /* GL_TRANSPOSE_MODELVIEW_MATRIX */ - 1529, /* GL_TRANSPOSE_PROJECTION_MATRIX */ - 1531, /* GL_TRANSPOSE_TEXTURE_MATRIX */ - 1523, /* GL_TRANSPOSE_COLOR_MATRIX */ - 1330, /* GL_SUBTRACT */ - 781, /* GL_MAX_RENDERBUFFER_SIZE_EXT */ - 210, /* GL_COMPRESSED_ALPHA */ - 214, /* GL_COMPRESSED_LUMINANCE */ - 215, /* GL_COMPRESSED_LUMINANCE_ALPHA */ - 212, /* GL_COMPRESSED_INTENSITY */ - 218, /* GL_COMPRESSED_RGB */ - 219, /* GL_COMPRESSED_RGBA */ - 1445, /* GL_TEXTURE_COMPRESSION_HINT */ - 1507, /* GL_TEXTURE_RECTANGLE_ARB */ - 1417, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */ - 1123, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */ - 779, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB */ - 319, /* GL_DEPTH_STENCIL_NV */ - 1551, /* GL_UNSIGNED_INT_24_8_NV */ - 786, /* GL_MAX_TEXTURE_LOD_BIAS */ - 1498, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */ - 787, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */ - 1474, /* GL_TEXTURE_FILTER_CONTROL */ - 1489, /* GL_TEXTURE_LOD_BIAS */ - 197, /* GL_COMBINE4 */ - 782, /* GL_MAX_SHININESS_NV */ - 783, /* GL_MAX_SPOT_EXPONENT_NV */ - 511, /* GL_INCR_WRAP */ - 295, /* GL_DECR_WRAP */ - 828, /* GL_MODELVIEW1_ARB */ - 884, /* GL_NORMAL_MAP */ - 1152, /* GL_REFLECTION_MAP */ - 1454, /* GL_TEXTURE_CUBE_MAP */ - 1415, /* GL_TEXTURE_BINDING_CUBE_MAP */ - 1462, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */ - 1456, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */ - 1464, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */ - 1458, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */ - 1466, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */ - 1460, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */ - 1121, /* GL_PROXY_TEXTURE_CUBE_MAP */ - 737, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */ - 863, /* GL_MULTISAMPLE_FILTER_HINT_NV */ - 438, /* GL_FOG_DISTANCE_MODE_NV */ - 403, /* GL_EYE_RADIAL_NV */ - 402, /* GL_EYE_PLANE_ABSOLUTE_NV */ - 196, /* GL_COMBINE */ - 203, /* GL_COMBINE_RGB */ - 198, /* GL_COMBINE_ALPHA */ - 1206, /* GL_RGB_SCALE */ - 20, /* GL_ADD_SIGNED */ - 537, /* GL_INTERPOLATE */ - 229, /* GL_CONSTANT */ - 1073, /* GL_PRIMARY_COLOR */ - 1070, /* GL_PREVIOUS */ - 1263, /* GL_SOURCE0_RGB */ - 1269, /* GL_SOURCE1_RGB */ - 1275, /* GL_SOURCE2_RGB */ - 1279, /* GL_SOURCE3_RGB_NV */ - 1260, /* GL_SOURCE0_ALPHA */ - 1266, /* GL_SOURCE1_ALPHA */ - 1272, /* GL_SOURCE2_ALPHA */ - 1278, /* GL_SOURCE3_ALPHA_NV */ - 920, /* GL_OPERAND0_RGB */ - 926, /* GL_OPERAND1_RGB */ - 932, /* GL_OPERAND2_RGB */ - 936, /* GL_OPERAND3_RGB_NV */ - 917, /* GL_OPERAND0_ALPHA */ - 923, /* GL_OPERAND1_ALPHA */ - 929, /* GL_OPERAND2_ALPHA */ - 935, /* GL_OPERAND3_ALPHA_NV */ - 1571, /* GL_VERTEX_ARRAY_BINDING_APPLE */ - 1626, /* GL_YCBCR_422_APPLE */ - 1562, /* GL_UNSIGNED_SHORT_8_8_APPLE */ - 1564, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */ - 1254, /* GL_SLICE_ACCUM_SUN */ - 1128, /* GL_QUAD_MESH_SUN */ - 1535, /* GL_TRIANGLE_MESH_SUN */ - 1603, /* GL_VERTEX_PROGRAM_ARB */ - 1611, /* GL_VERTEX_STATE_PROGRAM_NV */ - 1596, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB */ - 1599, /* GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB */ - 1600, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB */ - 1601, /* GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB */ - 287, /* GL_CURRENT_VERTEX_ATTRIB_ARB */ - 1086, /* GL_PROGRAM_LENGTH_ARB */ - 1100, /* GL_PROGRAM_STRING_ARB */ - 850, /* GL_MODELVIEW_PROJECTION_NV */ - 506, /* GL_IDENTITY_NV */ - 547, /* GL_INVERSE_NV */ - 1528, /* GL_TRANSPOSE_NV */ - 548, /* GL_INVERSE_TRANSPOSE_NV */ - 765, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */ - 764, /* GL_MAX_PROGRAM_MATRICES_ARB */ - 676, /* GL_MATRIX0_NV */ - 688, /* GL_MATRIX1_NV */ - 700, /* GL_MATRIX2_NV */ - 704, /* GL_MATRIX3_NV */ - 706, /* GL_MATRIX4_NV */ - 708, /* GL_MATRIX5_NV */ - 710, /* GL_MATRIX6_NV */ - 712, /* GL_MATRIX7_NV */ - 273, /* GL_CURRENT_MATRIX_STACK_DEPTH_ARB */ - 270, /* GL_CURRENT_MATRIX_ARB */ - 1606, /* GL_VERTEX_PROGRAM_POINT_SIZE_ARB */ - 1608, /* GL_VERTEX_PROGRAM_TWO_SIDE_ARB */ - 1098, /* GL_PROGRAM_PARAMETER_NV */ - 1598, /* GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB */ - 1102, /* GL_PROGRAM_TARGET_NV */ - 1099, /* GL_PROGRAM_RESIDENT_NV */ - 1520, /* GL_TRACK_MATRIX_NV */ - 1521, /* GL_TRACK_MATRIX_TRANSFORM_NV */ - 1604, /* GL_VERTEX_PROGRAM_BINDING_NV */ - 1080, /* GL_PROGRAM_ERROR_POSITION_ARB */ - 304, /* GL_DEPTH_CLAMP_NV */ - 1578, /* GL_VERTEX_ATTRIB_ARRAY0_NV */ - 1585, /* GL_VERTEX_ATTRIB_ARRAY1_NV */ - 1586, /* GL_VERTEX_ATTRIB_ARRAY2_NV */ - 1587, /* GL_VERTEX_ATTRIB_ARRAY3_NV */ - 1588, /* GL_VERTEX_ATTRIB_ARRAY4_NV */ - 1589, /* GL_VERTEX_ATTRIB_ARRAY5_NV */ - 1590, /* GL_VERTEX_ATTRIB_ARRAY6_NV */ - 1591, /* GL_VERTEX_ATTRIB_ARRAY7_NV */ - 1592, /* GL_VERTEX_ATTRIB_ARRAY8_NV */ - 1593, /* GL_VERTEX_ATTRIB_ARRAY9_NV */ - 1579, /* GL_VERTEX_ATTRIB_ARRAY10_NV */ - 1580, /* GL_VERTEX_ATTRIB_ARRAY11_NV */ - 1581, /* GL_VERTEX_ATTRIB_ARRAY12_NV */ - 1582, /* GL_VERTEX_ATTRIB_ARRAY13_NV */ - 1583, /* GL_VERTEX_ATTRIB_ARRAY14_NV */ - 1584, /* GL_VERTEX_ATTRIB_ARRAY15_NV */ - 630, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */ - 637, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */ - 638, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */ - 639, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */ - 640, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */ - 641, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */ - 642, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */ - 643, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */ - 644, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */ - 645, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */ - 631, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */ - 632, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */ - 633, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */ - 634, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */ - 635, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */ - 636, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */ - 657, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */ - 664, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */ - 665, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */ - 666, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */ - 667, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */ - 668, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */ - 669, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */ - 1079, /* GL_PROGRAM_BINDING_ARB */ - 671, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */ - 672, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */ - 658, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */ - 659, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */ - 660, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */ - 661, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */ - 662, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */ - 663, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */ - 1443, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */ - 1440, /* GL_TEXTURE_COMPRESSED */ - 889, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */ - 228, /* GL_COMPRESSED_TEXTURE_FORMATS */ - 798, /* GL_MAX_VERTEX_UNITS_ARB */ - 18, /* GL_ACTIVE_VERTEX_UNITS_ARB */ - 1621, /* GL_WEIGHT_SUM_UNITY_ARB */ - 1602, /* GL_VERTEX_BLEND_ARB */ - 288, /* GL_CURRENT_WEIGHT_ARB */ - 1620, /* GL_WEIGHT_ARRAY_TYPE_ARB */ - 1619, /* GL_WEIGHT_ARRAY_STRIDE_ARB */ - 1618, /* GL_WEIGHT_ARRAY_SIZE_ARB */ - 1617, /* GL_WEIGHT_ARRAY_POINTER_ARB */ - 1614, /* GL_WEIGHT_ARRAY_ARB */ - 330, /* GL_DOT3_RGB */ - 331, /* GL_DOT3_RGBA */ - 226, /* GL_COMPRESSED_RGB_FXT1_3DFX */ - 221, /* GL_COMPRESSED_RGBA_FXT1_3DFX */ - 858, /* GL_MULTISAMPLE_3DFX */ - 1221, /* GL_SAMPLE_BUFFERS_3DFX */ - 1212, /* GL_SAMPLES_3DFX */ - 839, /* GL_MODELVIEW2_ARB */ - 842, /* GL_MODELVIEW3_ARB */ - 843, /* GL_MODELVIEW4_ARB */ - 844, /* GL_MODELVIEW5_ARB */ - 845, /* GL_MODELVIEW6_ARB */ - 846, /* GL_MODELVIEW7_ARB */ - 847, /* GL_MODELVIEW8_ARB */ - 848, /* GL_MODELVIEW9_ARB */ - 818, /* GL_MODELVIEW10_ARB */ - 819, /* GL_MODELVIEW11_ARB */ - 820, /* GL_MODELVIEW12_ARB */ - 821, /* GL_MODELVIEW13_ARB */ - 822, /* GL_MODELVIEW14_ARB */ - 823, /* GL_MODELVIEW15_ARB */ - 824, /* GL_MODELVIEW16_ARB */ - 825, /* GL_MODELVIEW17_ARB */ - 826, /* GL_MODELVIEW18_ARB */ - 827, /* GL_MODELVIEW19_ARB */ - 829, /* GL_MODELVIEW20_ARB */ - 830, /* GL_MODELVIEW21_ARB */ - 831, /* GL_MODELVIEW22_ARB */ - 832, /* GL_MODELVIEW23_ARB */ - 833, /* GL_MODELVIEW24_ARB */ - 834, /* GL_MODELVIEW25_ARB */ - 835, /* GL_MODELVIEW26_ARB */ - 836, /* GL_MODELVIEW27_ARB */ - 837, /* GL_MODELVIEW28_ARB */ - 838, /* GL_MODELVIEW29_ARB */ - 840, /* GL_MODELVIEW30_ARB */ - 841, /* GL_MODELVIEW31_ARB */ - 335, /* GL_DOT3_RGB_EXT */ - 333, /* GL_DOT3_RGBA_EXT */ - 812, /* GL_MIRROR_CLAMP_EXT */ - 815, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */ - 853, /* GL_MODULATE_ADD_ATI */ - 854, /* GL_MODULATE_SIGNED_ADD_ATI */ - 855, /* GL_MODULATE_SUBTRACT_ATI */ - 1627, /* GL_YCBCR_MESA */ - 944, /* GL_PACK_INVERT_MESA */ - 291, /* GL_DEBUG_OBJECT_MESA */ - 292, /* GL_DEBUG_PRINT_MESA */ - 290, /* GL_DEBUG_ASSERT_MESA */ - 97, /* GL_BUFFER_SIZE */ - 99, /* GL_BUFFER_USAGE */ - 447, /* GL_FRAGMENT_PROGRAM_ARB */ - 1077, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */ - 1105, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */ - 1104, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */ - 1089, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ - 1095, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ - 1094, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ - 754, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */ - 777, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */ - 776, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */ - 767, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ - 773, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ - 772, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ - 739, /* GL_MAX_DRAW_BUFFERS_ARB */ - 339, /* GL_DRAW_BUFFER0_ARB */ - 353, /* GL_DRAW_BUFFER1_ARB */ - 355, /* GL_DRAW_BUFFER2_ARB */ - 357, /* GL_DRAW_BUFFER3_ARB */ - 359, /* GL_DRAW_BUFFER4_ARB */ - 361, /* GL_DRAW_BUFFER5_ARB */ - 363, /* GL_DRAW_BUFFER6_ARB */ - 365, /* GL_DRAW_BUFFER7_ARB */ - 367, /* GL_DRAW_BUFFER8_ARB */ - 369, /* GL_DRAW_BUFFER9_ARB */ - 341, /* GL_DRAW_BUFFER10_ARB */ - 343, /* GL_DRAW_BUFFER11_ARB */ - 345, /* GL_DRAW_BUFFER12_ARB */ - 347, /* GL_DRAW_BUFFER13_ARB */ - 349, /* GL_DRAW_BUFFER14_ARB */ - 351, /* GL_DRAW_BUFFER15_ARB */ - 77, /* GL_BLEND_EQUATION_ALPHA_EXT */ - 721, /* GL_MATRIX_PALETTE_ARB */ - 748, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */ - 751, /* GL_MAX_PALETTE_MATRICES_ARB */ - 276, /* GL_CURRENT_PALETTE_MATRIX_ARB */ - 715, /* GL_MATRIX_INDEX_ARRAY_ARB */ - 271, /* GL_CURRENT_MATRIX_INDEX_ARB */ - 717, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */ - 719, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */ - 718, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */ - 716, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */ - 1469, /* GL_TEXTURE_DEPTH_SIZE */ - 323, /* GL_DEPTH_TEXTURE_MODE */ - 1435, /* GL_TEXTURE_COMPARE_MODE */ - 1433, /* GL_TEXTURE_COMPARE_FUNC */ - 206, /* GL_COMPARE_R_TO_TEXTURE */ - 1012, /* GL_POINT_SPRITE_ARB */ - 254, /* GL_COORD_REPLACE_ARB */ - 1015, /* GL_POINT_SPRITE_R_MODE_NV */ - 1130, /* GL_QUERY_COUNTER_BITS */ - 277, /* GL_CURRENT_QUERY */ - 1132, /* GL_QUERY_RESULT */ - 1134, /* GL_QUERY_RESULT_AVAILABLE */ - 795, /* GL_MAX_VERTEX_ATTRIBS_ARB */ - 1597, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB */ - 321, /* GL_DEPTH_STENCIL_TO_RGBA_NV */ - 320, /* GL_DEPTH_STENCIL_TO_BGRA_NV */ - 784, /* GL_MAX_TEXTURE_COORDS_ARB */ - 785, /* GL_MAX_TEXTURE_IMAGE_UNITS_ARB */ - 1082, /* GL_PROGRAM_ERROR_STRING_ARB */ - 1084, /* GL_PROGRAM_FORMAT_ASCII_ARB */ - 1083, /* GL_PROGRAM_FORMAT_ARB */ - 1514, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */ - 302, /* GL_DEPTH_BOUNDS_TEST_EXT */ - 301, /* GL_DEPTH_BOUNDS_EXT */ - 48, /* GL_ARRAY_BUFFER */ - 388, /* GL_ELEMENT_ARRAY_BUFFER */ - 50, /* GL_ARRAY_BUFFER_BINDING */ - 390, /* GL_ELEMENT_ARRAY_BUFFER_BINDING */ - 1572, /* GL_VERTEX_ARRAY_BUFFER_BINDING */ - 879, /* GL_NORMAL_ARRAY_BUFFER_BINDING */ - 130, /* GL_COLOR_ARRAY_BUFFER_BINDING */ - 514, /* GL_INDEX_ARRAY_BUFFER_BINDING */ - 1448, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */ - 384, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING */ - 1233, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */ - 425, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING */ - 1615, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */ - 1594, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */ - 1085, /* GL_PROGRAM_INSTRUCTIONS_ARB */ - 760, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */ - 1091, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ - 769, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ - 1103, /* GL_PROGRAM_TEMPORARIES_ARB */ - 775, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */ - 1093, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */ - 771, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */ - 1097, /* GL_PROGRAM_PARAMETERS_ARB */ - 774, /* GL_MAX_PROGRAM_PARAMETERS_ARB */ - 1092, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */ - 770, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */ - 1078, /* GL_PROGRAM_ATTRIBS_ARB */ - 755, /* GL_MAX_PROGRAM_ATTRIBS_ARB */ - 1090, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */ - 768, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */ - 1076, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */ - 753, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */ - 1088, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ - 766, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ - 761, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */ - 757, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */ - 1106, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */ - 1525, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */ - 1142, /* GL_READ_ONLY */ - 1623, /* GL_WRITE_ONLY */ - 1144, /* GL_READ_WRITE */ - 91, /* GL_BUFFER_ACCESS */ - 93, /* GL_BUFFER_MAPPED */ - 95, /* GL_BUFFER_MAP_POINTER */ - 1519, /* GL_TIME_ELAPSED_EXT */ - 675, /* GL_MATRIX0_ARB */ - 687, /* GL_MATRIX1_ARB */ - 699, /* GL_MATRIX2_ARB */ - 703, /* GL_MATRIX3_ARB */ - 705, /* GL_MATRIX4_ARB */ - 707, /* GL_MATRIX5_ARB */ - 709, /* GL_MATRIX6_ARB */ - 711, /* GL_MATRIX7_ARB */ - 713, /* GL_MATRIX8_ARB */ - 714, /* GL_MATRIX9_ARB */ - 677, /* GL_MATRIX10_ARB */ - 678, /* GL_MATRIX11_ARB */ - 679, /* GL_MATRIX12_ARB */ - 680, /* GL_MATRIX13_ARB */ - 681, /* GL_MATRIX14_ARB */ - 682, /* GL_MATRIX15_ARB */ - 683, /* GL_MATRIX16_ARB */ - 684, /* GL_MATRIX17_ARB */ - 685, /* GL_MATRIX18_ARB */ - 686, /* GL_MATRIX19_ARB */ - 689, /* GL_MATRIX20_ARB */ - 690, /* GL_MATRIX21_ARB */ - 691, /* GL_MATRIX22_ARB */ - 692, /* GL_MATRIX23_ARB */ - 693, /* GL_MATRIX24_ARB */ - 694, /* GL_MATRIX25_ARB */ - 695, /* GL_MATRIX26_ARB */ - 696, /* GL_MATRIX27_ARB */ - 697, /* GL_MATRIX28_ARB */ - 698, /* GL_MATRIX29_ARB */ - 701, /* GL_MATRIX30_ARB */ - 702, /* GL_MATRIX31_ARB */ - 1325, /* GL_STREAM_DRAW */ - 1327, /* GL_STREAM_READ */ - 1323, /* GL_STREAM_COPY */ - 1298, /* GL_STATIC_DRAW */ - 1300, /* GL_STATIC_READ */ - 1296, /* GL_STATIC_COPY */ - 378, /* GL_DYNAMIC_DRAW */ - 380, /* GL_DYNAMIC_READ */ - 376, /* GL_DYNAMIC_COPY */ - 985, /* GL_PIXEL_PACK_BUFFER_EXT */ - 987, /* GL_PIXEL_UNPACK_BUFFER_EXT */ - 984, /* GL_PIXEL_PACK_BUFFER_BINDING_EXT */ - 986, /* GL_PIXEL_UNPACK_BUFFER_BINDING_EXT */ - 758, /* GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */ - 756, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */ - 759, /* GL_MAX_PROGRAM_IF_DEPTH_NV */ - 763, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */ - 762, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */ - 1319, /* GL_STENCIL_TEST_TWO_SIDE_EXT */ - 15, /* GL_ACTIVE_STENCIL_FACE_EXT */ - 813, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */ - 1214, /* GL_SAMPLES_PASSED */ - 448, /* GL_FRAGMENT_SHADER_ARB */ - 1610, /* GL_VERTEX_SHADER_ARB */ - 1096, /* GL_PROGRAM_OBJECT_ARB */ - 1246, /* GL_SHADER_OBJECT_ARB */ - 745, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB */ - 797, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB */ - 794, /* GL_MAX_VARYING_FLOATS_ARB */ - 796, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */ - 732, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB */ - 904, /* GL_OBJECT_TYPE_ARB */ - 903, /* GL_OBJECT_SUBTYPE_ARB */ - 416, /* GL_FLOAT_VEC2_ARB */ - 417, /* GL_FLOAT_VEC3_ARB */ - 418, /* GL_FLOAT_VEC4_ARB */ - 540, /* GL_INT_VEC2_ARB */ - 541, /* GL_INT_VEC3_ARB */ - 542, /* GL_INT_VEC4_ARB */ - 87, /* GL_BOOL_ARB */ - 88, /* GL_BOOL_VEC2_ARB */ - 89, /* GL_BOOL_VEC3_ARB */ - 90, /* GL_BOOL_VEC4_ARB */ - 413, /* GL_FLOAT_MAT2_ARB */ - 414, /* GL_FLOAT_MAT3_ARB */ - 415, /* GL_FLOAT_MAT4_ARB */ - 897, /* GL_OBJECT_DELETE_STATUS_ARB */ - 896, /* GL_OBJECT_COMPILE_STATUS_ARB */ - 900, /* GL_OBJECT_LINK_STATUS_ARB */ - 905, /* GL_OBJECT_VALIDATE_STATUS_ARB */ - 898, /* GL_OBJECT_INFO_LOG_LENGTH_ARB */ - 895, /* GL_OBJECT_ATTACHED_OBJECTS_ARB */ - 893, /* GL_OBJECT_ACTIVE_UNIFORMS_ARB */ - 894, /* GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB */ - 902, /* GL_OBJECT_SHADER_SOURCE_LENGTH_ARB */ - 891, /* GL_OBJECT_ACTIVE_ATTRIBUTES_ARB */ - 892, /* GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB */ - 953, /* GL_PALETTE4_RGB8_OES */ - 955, /* GL_PALETTE4_RGBA8_OES */ - 951, /* GL_PALETTE4_R5_G6_B5_OES */ - 954, /* GL_PALETTE4_RGBA4_OES */ - 952, /* GL_PALETTE4_RGB5_A1_OES */ - 958, /* GL_PALETTE8_RGB8_OES */ - 960, /* GL_PALETTE8_RGBA8_OES */ - 956, /* GL_PALETTE8_R5_G6_B5_OES */ - 959, /* GL_PALETTE8_RGBA4_OES */ - 957, /* GL_PALETTE8_RGB5_A1_OES */ - 509, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */ - 508, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */ - 1013, /* GL_POINT_SPRITE_COORD_ORIGIN */ - 371, /* GL_DRAW_FRAMEBUFFER_BINDING_EXT */ - 1156, /* GL_RENDERBUFFER_BINDING_EXT */ - 1141, /* GL_READ_FRAMEBUFFER_EXT */ - 372, /* GL_DRAW_FRAMEBUFFER_EXT */ - 1140, /* GL_READ_FRAMEBUFFER_BINDING_EXT */ - 450, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT */ - 449, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT */ - 453, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT */ - 452, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT */ - 451, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT */ - 455, /* GL_FRAMEBUFFER_COMPLETE_EXT */ - 457, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT */ - 462, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT */ - 460, /* GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT */ - 458, /* GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT */ - 461, /* GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT */ - 459, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT */ - 463, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT */ - 465, /* GL_FRAMEBUFFER_UNSUPPORTED_EXT */ - 464, /* GL_FRAMEBUFFER_STATUS_ERROR_EXT */ - 729, /* GL_MAX_COLOR_ATTACHMENTS_EXT */ - 136, /* GL_COLOR_ATTACHMENT0_EXT */ - 143, /* GL_COLOR_ATTACHMENT1_EXT */ - 144, /* GL_COLOR_ATTACHMENT2_EXT */ - 145, /* GL_COLOR_ATTACHMENT3_EXT */ - 146, /* GL_COLOR_ATTACHMENT4_EXT */ - 147, /* GL_COLOR_ATTACHMENT5_EXT */ - 148, /* GL_COLOR_ATTACHMENT6_EXT */ - 149, /* GL_COLOR_ATTACHMENT7_EXT */ - 150, /* GL_COLOR_ATTACHMENT8_EXT */ - 151, /* GL_COLOR_ATTACHMENT9_EXT */ - 137, /* GL_COLOR_ATTACHMENT10_EXT */ - 138, /* GL_COLOR_ATTACHMENT11_EXT */ - 139, /* GL_COLOR_ATTACHMENT12_EXT */ - 140, /* GL_COLOR_ATTACHMENT13_EXT */ - 141, /* GL_COLOR_ATTACHMENT14_EXT */ - 142, /* GL_COLOR_ATTACHMENT15_EXT */ - 298, /* GL_DEPTH_ATTACHMENT_EXT */ - 1303, /* GL_STENCIL_ATTACHMENT_EXT */ - 456, /* GL_FRAMEBUFFER_EXT */ - 1157, /* GL_RENDERBUFFER_EXT */ - 1160, /* GL_RENDERBUFFER_WIDTH_EXT */ - 1158, /* GL_RENDERBUFFER_HEIGHT_EXT */ - 1159, /* GL_RENDERBUFFER_INTERNAL_FORMAT_EXT */ - 1314, /* GL_STENCIL_INDEX_EXT */ - 1311, /* GL_STENCIL_INDEX1_EXT */ - 1312, /* GL_STENCIL_INDEX4_EXT */ - 1313, /* GL_STENCIL_INDEX8_EXT */ - 1310, /* GL_STENCIL_INDEX16_EXT */ - 396, /* GL_EVAL_BIT */ - 1138, /* GL_RASTER_POSITION_UNCLIPPED_IBM */ - 591, /* GL_LIST_BIT */ - 1419, /* GL_TEXTURE_BIT */ - 1229, /* GL_SCISSOR_BIT */ - 25, /* GL_ALL_ATTRIB_BITS */ - 860, /* GL_MULTISAMPLE_BIT */ - 26, /* GL_ALL_CLIENT_ATTRIB_BITS */ + 351, /* GL_DOUBLE */ + 123, /* GL_CLEAR */ + 49, /* GL_AND */ + 51, /* GL_AND_REVERSE */ + 268, /* GL_COPY */ + 50, /* GL_AND_INVERTED */ + 953, /* GL_NOOP */ + 1731, /* GL_XOR */ + 1015, /* GL_OR */ + 954, /* GL_NOR */ + 426, /* GL_EQUIV */ + 616, /* GL_INVERT */ + 1018, /* GL_OR_REVERSE */ + 269, /* GL_COPY_INVERTED */ + 1017, /* GL_OR_INVERTED */ + 944, /* GL_NAND */ + 1330, /* GL_SET */ + 423, /* GL_EMISSION */ + 1338, /* GL_SHININESS */ + 48, /* GL_AMBIENT_AND_DIFFUSE */ + 165, /* GL_COLOR_INDEXES */ + 894, /* GL_MODELVIEW */ + 1186, /* GL_PROJECTION */ + 1436, /* GL_TEXTURE */ + 138, /* GL_COLOR */ + 312, /* GL_DEPTH */ + 1390, /* GL_STENCIL */ + 164, /* GL_COLOR_INDEX */ + 1404, /* GL_STENCIL_INDEX */ + 321, /* GL_DEPTH_COMPONENT */ + 1225, /* GL_RED */ + 546, /* GL_GREEN */ + 89, /* GL_BLUE */ + 31, /* GL_ALPHA */ + 1249, /* GL_RGB */ + 1268, /* GL_RGBA */ + 666, /* GL_LUMINANCE */ + 687, /* GL_LUMINANCE_ALPHA */ + 73, /* GL_BITMAP */ + 1066, /* GL_POINT */ + 636, /* GL_LINE */ + 441, /* GL_FILL */ + 1234, /* GL_RENDER */ + 437, /* GL_FEEDBACK */ + 1324, /* GL_SELECT */ + 442, /* GL_FLAT */ + 1343, /* GL_SMOOTH */ + 617, /* GL_KEEP */ + 1243, /* GL_REPLACE */ + 573, /* GL_INCR */ + 308, /* GL_DECR */ + 1665, /* GL_VENDOR */ + 1240, /* GL_RENDERER */ + 1666, /* GL_VERSION */ + 430, /* GL_EXTENSIONS */ + 1289, /* GL_S */ + 1427, /* GL_T */ + 1215, /* GL_R */ + 1204, /* GL_Q */ + 930, /* GL_MODULATE */ + 307, /* GL_DECAL */ + 1568, /* GL_TEXTURE_ENV_MODE */ + 1567, /* GL_TEXTURE_ENV_COLOR */ + 1566, /* GL_TEXTURE_ENV */ + 431, /* GL_EYE_LINEAR */ + 977, /* GL_OBJECT_LINEAR */ + 1369, /* GL_SPHERE_MAP */ + 1570, /* GL_TEXTURE_GEN_MODE */ + 979, /* GL_OBJECT_PLANE */ + 432, /* GL_EYE_PLANE */ + 945, /* GL_NEAREST */ + 637, /* GL_LINEAR */ + 949, /* GL_NEAREST_MIPMAP_NEAREST */ + 642, /* GL_LINEAR_MIPMAP_NEAREST */ + 948, /* GL_NEAREST_MIPMAP_LINEAR */ + 641, /* GL_LINEAR_MIPMAP_LINEAR */ + 1591, /* GL_TEXTURE_MAG_FILTER */ + 1599, /* GL_TEXTURE_MIN_FILTER */ + 1612, /* GL_TEXTURE_WRAP_S */ + 1613, /* GL_TEXTURE_WRAP_T */ + 117, /* GL_CLAMP */ + 1242, /* GL_REPEAT */ + 1104, /* GL_POLYGON_OFFSET_UNITS */ + 1103, /* GL_POLYGON_OFFSET_POINT */ + 1102, /* GL_POLYGON_OFFSET_LINE */ + 1216, /* GL_R3_G3_B2 */ + 1662, /* GL_V2F */ + 1663, /* GL_V3F */ + 114, /* GL_C4UB_V2F */ + 115, /* GL_C4UB_V3F */ + 112, /* GL_C3F_V3F */ + 942, /* GL_N3F_V3F */ + 113, /* GL_C4F_N3F_V3F */ + 1432, /* GL_T2F_V3F */ + 1434, /* GL_T4F_V4F */ + 1430, /* GL_T2F_C4UB_V3F */ + 1428, /* GL_T2F_C3F_V3F */ + 1431, /* GL_T2F_N3F_V3F */ + 1429, /* GL_T2F_C4F_N3F_V3F */ + 1433, /* GL_T4F_C4F_N3F_V4F */ + 130, /* GL_CLIP_PLANE0 */ + 131, /* GL_CLIP_PLANE1 */ + 132, /* GL_CLIP_PLANE2 */ + 133, /* GL_CLIP_PLANE3 */ + 134, /* GL_CLIP_PLANE4 */ + 135, /* GL_CLIP_PLANE5 */ + 621, /* GL_LIGHT0 */ + 622, /* GL_LIGHT1 */ + 623, /* GL_LIGHT2 */ + 624, /* GL_LIGHT3 */ + 625, /* GL_LIGHT4 */ + 626, /* GL_LIGHT5 */ + 627, /* GL_LIGHT6 */ + 628, /* GL_LIGHT7 */ + 550, /* GL_HINT_BIT */ + 246, /* GL_CONSTANT_COLOR */ + 989, /* GL_ONE_MINUS_CONSTANT_COLOR */ + 241, /* GL_CONSTANT_ALPHA */ + 987, /* GL_ONE_MINUS_CONSTANT_ALPHA */ + 76, /* GL_BLEND_COLOR */ + 510, /* GL_FUNC_ADD */ + 878, /* GL_MIN */ + 791, /* GL_MAX */ + 81, /* GL_BLEND_EQUATION */ + 514, /* GL_FUNC_SUBTRACT */ + 512, /* GL_FUNC_REVERSE_SUBTRACT */ + 249, /* GL_CONVOLUTION_1D */ + 250, /* GL_CONVOLUTION_2D */ + 1327, /* GL_SEPARABLE_2D */ + 253, /* GL_CONVOLUTION_BORDER_MODE */ + 257, /* GL_CONVOLUTION_FILTER_SCALE */ + 255, /* GL_CONVOLUTION_FILTER_BIAS */ + 1226, /* GL_REDUCE */ + 259, /* GL_CONVOLUTION_FORMAT */ + 263, /* GL_CONVOLUTION_WIDTH */ + 261, /* GL_CONVOLUTION_HEIGHT */ + 805, /* GL_MAX_CONVOLUTION_WIDTH */ + 803, /* GL_MAX_CONVOLUTION_HEIGHT */ + 1143, /* GL_POST_CONVOLUTION_RED_SCALE */ + 1139, /* GL_POST_CONVOLUTION_GREEN_SCALE */ + 1134, /* GL_POST_CONVOLUTION_BLUE_SCALE */ + 1130, /* GL_POST_CONVOLUTION_ALPHA_SCALE */ + 1141, /* GL_POST_CONVOLUTION_RED_BIAS */ + 1137, /* GL_POST_CONVOLUTION_GREEN_BIAS */ + 1132, /* GL_POST_CONVOLUTION_BLUE_BIAS */ + 1128, /* GL_POST_CONVOLUTION_ALPHA_BIAS */ + 551, /* GL_HISTOGRAM */ + 1190, /* GL_PROXY_HISTOGRAM */ + 567, /* GL_HISTOGRAM_WIDTH */ + 557, /* GL_HISTOGRAM_FORMAT */ + 563, /* GL_HISTOGRAM_RED_SIZE */ + 559, /* GL_HISTOGRAM_GREEN_SIZE */ + 554, /* GL_HISTOGRAM_BLUE_SIZE */ + 552, /* GL_HISTOGRAM_ALPHA_SIZE */ + 561, /* GL_HISTOGRAM_LUMINANCE_SIZE */ + 565, /* GL_HISTOGRAM_SINK */ + 879, /* GL_MINMAX */ + 881, /* GL_MINMAX_FORMAT */ + 883, /* GL_MINMAX_SINK */ + 1435, /* GL_TABLE_TOO_LARGE_EXT */ + 1643, /* GL_UNSIGNED_BYTE_3_3_2 */ + 1652, /* GL_UNSIGNED_SHORT_4_4_4_4 */ + 1654, /* GL_UNSIGNED_SHORT_5_5_5_1 */ + 1648, /* GL_UNSIGNED_INT_8_8_8_8 */ + 1645, /* GL_UNSIGNED_INT_10_10_10_2 */ + 1101, /* GL_POLYGON_OFFSET_FILL */ + 1100, /* GL_POLYGON_OFFSET_FACTOR */ + 1099, /* GL_POLYGON_OFFSET_BIAS */ + 1246, /* GL_RESCALE_NORMAL */ + 36, /* GL_ALPHA4 */ + 38, /* GL_ALPHA8 */ + 32, /* GL_ALPHA12 */ + 34, /* GL_ALPHA16 */ + 677, /* GL_LUMINANCE4 */ + 683, /* GL_LUMINANCE8 */ + 667, /* GL_LUMINANCE12 */ + 673, /* GL_LUMINANCE16 */ + 678, /* GL_LUMINANCE4_ALPHA4 */ + 681, /* GL_LUMINANCE6_ALPHA2 */ + 684, /* GL_LUMINANCE8_ALPHA8 */ + 670, /* GL_LUMINANCE12_ALPHA4 */ + 668, /* GL_LUMINANCE12_ALPHA12 */ + 674, /* GL_LUMINANCE16_ALPHA16 */ + 591, /* GL_INTENSITY */ + 596, /* GL_INTENSITY4 */ + 598, /* GL_INTENSITY8 */ + 592, /* GL_INTENSITY12 */ + 594, /* GL_INTENSITY16 */ + 1258, /* GL_RGB2_EXT */ + 1259, /* GL_RGB4 */ + 1262, /* GL_RGB5 */ + 1266, /* GL_RGB8 */ + 1250, /* GL_RGB10 */ + 1254, /* GL_RGB12 */ + 1256, /* GL_RGB16 */ + 1273, /* GL_RGBA2 */ + 1275, /* GL_RGBA4 */ + 1263, /* GL_RGB5_A1 */ + 1279, /* GL_RGBA8 */ + 1251, /* GL_RGB10_A2 */ + 1269, /* GL_RGBA12 */ + 1271, /* GL_RGBA16 */ + 1604, /* GL_TEXTURE_RED_SIZE */ + 1576, /* GL_TEXTURE_GREEN_SIZE */ + 1515, /* GL_TEXTURE_BLUE_SIZE */ + 1504, /* GL_TEXTURE_ALPHA_SIZE */ + 1589, /* GL_TEXTURE_LUMINANCE_SIZE */ + 1580, /* GL_TEXTURE_INTENSITY_SIZE */ + 1244, /* GL_REPLACE_EXT */ + 1194, /* GL_PROXY_TEXTURE_1D */ + 1196, /* GL_PROXY_TEXTURE_2D */ + 1608, /* GL_TEXTURE_TOO_LARGE_EXT */ + 1601, /* GL_TEXTURE_PRIORITY */ + 1606, /* GL_TEXTURE_RESIDENT */ + 1507, /* GL_TEXTURE_BINDING_1D */ + 1508, /* GL_TEXTURE_BINDING_2D */ + 1509, /* GL_TEXTURE_BINDING_3D */ + 1025, /* GL_PACK_SKIP_IMAGES */ + 1021, /* GL_PACK_IMAGE_HEIGHT */ + 1637, /* GL_UNPACK_SKIP_IMAGES */ + 1634, /* GL_UNPACK_IMAGE_HEIGHT */ + 1503, /* GL_TEXTURE_3D */ + 1198, /* GL_PROXY_TEXTURE_3D */ + 1563, /* GL_TEXTURE_DEPTH */ + 1611, /* GL_TEXTURE_WRAP_R */ + 792, /* GL_MAX_3D_TEXTURE_SIZE */ + 1667, /* GL_VERTEX_ARRAY */ + 956, /* GL_NORMAL_ARRAY */ + 139, /* GL_COLOR_ARRAY */ + 576, /* GL_INDEX_ARRAY */ + 1542, /* GL_TEXTURE_COORD_ARRAY */ + 414, /* GL_EDGE_FLAG_ARRAY */ + 1672, /* GL_VERTEX_ARRAY_SIZE */ + 1674, /* GL_VERTEX_ARRAY_TYPE */ + 1673, /* GL_VERTEX_ARRAY_STRIDE */ + 961, /* GL_NORMAL_ARRAY_TYPE */ + 960, /* GL_NORMAL_ARRAY_STRIDE */ + 143, /* GL_COLOR_ARRAY_SIZE */ + 145, /* GL_COLOR_ARRAY_TYPE */ + 144, /* GL_COLOR_ARRAY_STRIDE */ + 581, /* GL_INDEX_ARRAY_TYPE */ + 580, /* GL_INDEX_ARRAY_STRIDE */ + 1546, /* GL_TEXTURE_COORD_ARRAY_SIZE */ + 1548, /* GL_TEXTURE_COORD_ARRAY_TYPE */ + 1547, /* GL_TEXTURE_COORD_ARRAY_STRIDE */ + 418, /* GL_EDGE_FLAG_ARRAY_STRIDE */ + 1671, /* GL_VERTEX_ARRAY_POINTER */ + 959, /* GL_NORMAL_ARRAY_POINTER */ + 142, /* GL_COLOR_ARRAY_POINTER */ + 579, /* GL_INDEX_ARRAY_POINTER */ + 1545, /* GL_TEXTURE_COORD_ARRAY_POINTER */ + 417, /* GL_EDGE_FLAG_ARRAY_POINTER */ + 935, /* GL_MULTISAMPLE */ + 1301, /* GL_SAMPLE_ALPHA_TO_COVERAGE */ + 1303, /* GL_SAMPLE_ALPHA_TO_ONE */ + 1308, /* GL_SAMPLE_COVERAGE */ + 1305, /* GL_SAMPLE_BUFFERS */ + 1296, /* GL_SAMPLES */ + 1312, /* GL_SAMPLE_COVERAGE_VALUE */ + 1310, /* GL_SAMPLE_COVERAGE_INVERT */ + 170, /* GL_COLOR_MATRIX */ + 172, /* GL_COLOR_MATRIX_STACK_DEPTH */ + 799, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */ + 1126, /* GL_POST_COLOR_MATRIX_RED_SCALE */ + 1122, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */ + 1117, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */ + 1113, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */ + 1124, /* GL_POST_COLOR_MATRIX_RED_BIAS */ + 1120, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */ + 1115, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */ + 1111, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */ + 1525, /* GL_TEXTURE_COLOR_TABLE_SGI */ + 1199, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */ + 1527, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ + 80, /* GL_BLEND_DST_RGB */ + 88, /* GL_BLEND_SRC_RGB */ + 79, /* GL_BLEND_DST_ALPHA */ + 87, /* GL_BLEND_SRC_ALPHA */ + 176, /* GL_COLOR_TABLE */ + 1136, /* GL_POST_CONVOLUTION_COLOR_TABLE */ + 1119, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */ + 1189, /* GL_PROXY_COLOR_TABLE */ + 1193, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */ + 1192, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */ + 200, /* GL_COLOR_TABLE_SCALE */ + 180, /* GL_COLOR_TABLE_BIAS */ + 185, /* GL_COLOR_TABLE_FORMAT */ + 202, /* GL_COLOR_TABLE_WIDTH */ + 197, /* GL_COLOR_TABLE_RED_SIZE */ + 188, /* GL_COLOR_TABLE_GREEN_SIZE */ + 182, /* GL_COLOR_TABLE_BLUE_SIZE */ + 177, /* GL_COLOR_TABLE_ALPHA_SIZE */ + 194, /* GL_COLOR_TABLE_LUMINANCE_SIZE */ + 191, /* GL_COLOR_TABLE_INTENSITY_SIZE */ + 71, /* GL_BGR */ + 72, /* GL_BGRA */ + 813, /* GL_MAX_ELEMENTS_VERTICES */ + 812, /* GL_MAX_ELEMENTS_INDICES */ + 1579, /* GL_TEXTURE_INDEX_SIZE_EXT */ + 136, /* GL_CLIP_VOLUME_CLIPPING_HINT_EXT */ + 1083, /* GL_POINT_SIZE_MIN */ + 1079, /* GL_POINT_SIZE_MAX */ + 1073, /* GL_POINT_FADE_THRESHOLD_SIZE */ + 1069, /* GL_POINT_DISTANCE_ATTENUATION */ + 118, /* GL_CLAMP_TO_BORDER */ + 121, /* GL_CLAMP_TO_EDGE */ + 1600, /* GL_TEXTURE_MIN_LOD */ + 1598, /* GL_TEXTURE_MAX_LOD */ + 1506, /* GL_TEXTURE_BASE_LEVEL */ + 1597, /* GL_TEXTURE_MAX_LEVEL */ + 570, /* GL_IGNORE_BORDER_HP */ + 245, /* GL_CONSTANT_BORDER_HP */ + 1245, /* GL_REPLICATE_BORDER_HP */ + 251, /* GL_CONVOLUTION_BORDER_COLOR */ + 984, /* GL_OCCLUSION_TEST_HP */ + 985, /* GL_OCCLUSION_TEST_RESULT_HP */ + 639, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */ + 1519, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */ + 1521, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */ + 1523, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */ + 1524, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */ + 1522, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */ + 1520, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */ + 795, /* GL_MAX_CLIPMAP_DEPTH_SGIX */ + 796, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */ + 1146, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */ + 1148, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */ + 1145, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */ + 1147, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */ + 1587, /* GL_TEXTURE_LOD_BIAS_S_SGIX */ + 1588, /* GL_TEXTURE_LOD_BIAS_T_SGIX */ + 1586, /* GL_TEXTURE_LOD_BIAS_R_SGIX */ + 516, /* GL_GENERATE_MIPMAP */ + 517, /* GL_GENERATE_MIPMAP_HINT */ + 480, /* GL_FOG_OFFSET_SGIX */ + 481, /* GL_FOG_OFFSET_VALUE_SGIX */ + 1533, /* GL_TEXTURE_COMPARE_SGIX */ + 1532, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */ + 1583, /* GL_TEXTURE_LEQUAL_R_SGIX */ + 1575, /* GL_TEXTURE_GEQUAL_R_SGIX */ + 322, /* GL_DEPTH_COMPONENT16 */ + 325, /* GL_DEPTH_COMPONENT24 */ + 328, /* GL_DEPTH_COMPONENT32 */ + 273, /* GL_CULL_VERTEX_EXT */ + 275, /* GL_CULL_VERTEX_OBJECT_POSITION_EXT */ + 274, /* GL_CULL_VERTEX_EYE_POSITION_EXT */ + 1728, /* GL_WRAP_BORDER_SUN */ + 1526, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */ + 632, /* GL_LIGHT_MODEL_COLOR_CONTROL */ + 1340, /* GL_SINGLE_COLOR */ + 1328, /* GL_SEPARATE_SPECULAR_COLOR */ + 1337, /* GL_SHARED_TEXTURE_PALETTE_EXT */ + 1642, /* GL_UNSIGNED_BYTE_2_3_3_REV */ + 1655, /* GL_UNSIGNED_SHORT_5_6_5 */ + 1656, /* GL_UNSIGNED_SHORT_5_6_5_REV */ + 1653, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */ + 1651, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */ + 1649, /* GL_UNSIGNED_INT_8_8_8_8_REV */ + 1647, /* GL_UNSIGNED_INT_2_10_10_10_REV */ + 1595, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */ + 1596, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */ + 1594, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */ + 886, /* GL_MIRRORED_REPEAT */ + 1284, /* GL_RGB_S3TC */ + 1261, /* GL_RGB4_S3TC */ + 1283, /* GL_RGBA_S3TC */ + 1278, /* GL_RGBA4_S3TC */ + 1281, /* GL_RGBA_DXT5_S3TC */ + 1276, /* GL_RGBA4_DXT5_S3TC */ + 238, /* GL_COMPRESSED_RGB_S3TC_DXT1_EXT */ + 233, /* GL_COMPRESSED_RGBA_S3TC_DXT1_EXT */ + 234, /* GL_COMPRESSED_RGBA_S3TC_DXT3_EXT */ + 235, /* GL_COMPRESSED_RGBA_S3TC_DXT5_EXT */ + 947, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */ + 946, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */ + 640, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */ + 467, /* GL_FOG_COORDINATE_SOURCE */ + 459, /* GL_FOG_COORD */ + 483, /* GL_FRAGMENT_DEPTH */ + 279, /* GL_CURRENT_FOG_COORD */ + 466, /* GL_FOG_COORDINATE_ARRAY_TYPE */ + 465, /* GL_FOG_COORDINATE_ARRAY_STRIDE */ + 464, /* GL_FOG_COORDINATE_ARRAY_POINTER */ + 461, /* GL_FOG_COORDINATE_ARRAY */ + 174, /* GL_COLOR_SUM */ + 298, /* GL_CURRENT_SECONDARY_COLOR */ + 1321, /* GL_SECONDARY_COLOR_ARRAY_SIZE */ + 1323, /* GL_SECONDARY_COLOR_ARRAY_TYPE */ + 1322, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */ + 1320, /* GL_SECONDARY_COLOR_ARRAY_POINTER */ + 1317, /* GL_SECONDARY_COLOR_ARRAY */ + 526, /* GL_GL_CURRENT_RASTER_SECONDARY_COLOR */ + 28, /* GL_ALIASED_POINT_SIZE_RANGE */ + 27, /* GL_ALIASED_LINE_WIDTH_RANGE */ + 1437, /* GL_TEXTURE0 */ + 1439, /* GL_TEXTURE1 */ + 1461, /* GL_TEXTURE2 */ + 1483, /* GL_TEXTURE3 */ + 1489, /* GL_TEXTURE4 */ + 1491, /* GL_TEXTURE5 */ + 1493, /* GL_TEXTURE6 */ + 1495, /* GL_TEXTURE7 */ + 1497, /* GL_TEXTURE8 */ + 1499, /* GL_TEXTURE9 */ + 1440, /* GL_TEXTURE10 */ + 1442, /* GL_TEXTURE11 */ + 1444, /* GL_TEXTURE12 */ + 1446, /* GL_TEXTURE13 */ + 1448, /* GL_TEXTURE14 */ + 1450, /* GL_TEXTURE15 */ + 1452, /* GL_TEXTURE16 */ + 1454, /* GL_TEXTURE17 */ + 1456, /* GL_TEXTURE18 */ + 1458, /* GL_TEXTURE19 */ + 1462, /* GL_TEXTURE20 */ + 1464, /* GL_TEXTURE21 */ + 1466, /* GL_TEXTURE22 */ + 1468, /* GL_TEXTURE23 */ + 1470, /* GL_TEXTURE24 */ + 1472, /* GL_TEXTURE25 */ + 1474, /* GL_TEXTURE26 */ + 1476, /* GL_TEXTURE27 */ + 1478, /* GL_TEXTURE28 */ + 1480, /* GL_TEXTURE29 */ + 1484, /* GL_TEXTURE30 */ + 1486, /* GL_TEXTURE31 */ + 18, /* GL_ACTIVE_TEXTURE */ + 124, /* GL_CLIENT_ACTIVE_TEXTURE */ + 864, /* GL_MAX_TEXTURE_UNITS */ + 1621, /* GL_TRANSPOSE_MODELVIEW_MATRIX */ + 1624, /* GL_TRANSPOSE_PROJECTION_MATRIX */ + 1626, /* GL_TRANSPOSE_TEXTURE_MATRIX */ + 1618, /* GL_TRANSPOSE_COLOR_MATRIX */ + 1425, /* GL_SUBTRACT */ + 853, /* GL_MAX_RENDERBUFFER_SIZE_EXT */ + 221, /* GL_COMPRESSED_ALPHA */ + 225, /* GL_COMPRESSED_LUMINANCE */ + 226, /* GL_COMPRESSED_LUMINANCE_ALPHA */ + 223, /* GL_COMPRESSED_INTENSITY */ + 229, /* GL_COMPRESSED_RGB */ + 230, /* GL_COMPRESSED_RGBA */ + 1540, /* GL_TEXTURE_COMPRESSION_HINT */ + 1602, /* GL_TEXTURE_RECTANGLE_ARB */ + 1512, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */ + 1202, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */ + 851, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB */ + 334, /* GL_DEPTH_STENCIL_NV */ + 1646, /* GL_UNSIGNED_INT_24_8_NV */ + 860, /* GL_MAX_TEXTURE_LOD_BIAS */ + 1593, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */ + 861, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */ + 1569, /* GL_TEXTURE_FILTER_CONTROL */ + 1584, /* GL_TEXTURE_LOD_BIAS */ + 207, /* GL_COMBINE4 */ + 854, /* GL_MAX_SHININESS_NV */ + 855, /* GL_MAX_SPOT_EXPONENT_NV */ + 574, /* GL_INCR_WRAP */ + 309, /* GL_DECR_WRAP */ + 906, /* GL_MODELVIEW1_ARB */ + 962, /* GL_NORMAL_MAP */ + 1231, /* GL_REFLECTION_MAP */ + 1549, /* GL_TEXTURE_CUBE_MAP */ + 1510, /* GL_TEXTURE_BINDING_CUBE_MAP */ + 1557, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */ + 1551, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */ + 1559, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */ + 1553, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */ + 1561, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */ + 1555, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */ + 1200, /* GL_PROXY_TEXTURE_CUBE_MAP */ + 807, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */ + 941, /* GL_MULTISAMPLE_FILTER_HINT_NV */ + 475, /* GL_FOG_DISTANCE_MODE_NV */ + 434, /* GL_EYE_RADIAL_NV */ + 433, /* GL_EYE_PLANE_ABSOLUTE_NV */ + 206, /* GL_COMBINE */ + 213, /* GL_COMBINE_RGB */ + 208, /* GL_COMBINE_ALPHA */ + 1285, /* GL_RGB_SCALE */ + 24, /* GL_ADD_SIGNED */ + 601, /* GL_INTERPOLATE */ + 240, /* GL_CONSTANT */ + 1152, /* GL_PRIMARY_COLOR */ + 1149, /* GL_PREVIOUS */ + 1351, /* GL_SOURCE0_RGB */ + 1357, /* GL_SOURCE1_RGB */ + 1363, /* GL_SOURCE2_RGB */ + 1367, /* GL_SOURCE3_RGB_NV */ + 1348, /* GL_SOURCE0_ALPHA */ + 1354, /* GL_SOURCE1_ALPHA */ + 1360, /* GL_SOURCE2_ALPHA */ + 1366, /* GL_SOURCE3_ALPHA_NV */ + 998, /* GL_OPERAND0_RGB */ + 1004, /* GL_OPERAND1_RGB */ + 1010, /* GL_OPERAND2_RGB */ + 1014, /* GL_OPERAND3_RGB_NV */ + 995, /* GL_OPERAND0_ALPHA */ + 1001, /* GL_OPERAND1_ALPHA */ + 1007, /* GL_OPERAND2_ALPHA */ + 1013, /* GL_OPERAND3_ALPHA_NV */ + 1668, /* GL_VERTEX_ARRAY_BINDING_APPLE */ + 1732, /* GL_YCBCR_422_APPLE */ + 1657, /* GL_UNSIGNED_SHORT_8_8_APPLE */ + 1659, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */ + 1342, /* GL_SLICE_ACCUM_SUN */ + 1207, /* GL_QUAD_MESH_SUN */ + 1630, /* GL_TRIANGLE_MESH_SUN */ + 1706, /* GL_VERTEX_PROGRAM_ARB */ + 1717, /* GL_VERTEX_STATE_PROGRAM_NV */ + 1693, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED */ + 1699, /* GL_VERTEX_ATTRIB_ARRAY_SIZE */ + 1701, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE */ + 1703, /* GL_VERTEX_ATTRIB_ARRAY_TYPE */ + 300, /* GL_CURRENT_VERTEX_ATTRIB */ + 1165, /* GL_PROGRAM_LENGTH_ARB */ + 1179, /* GL_PROGRAM_STRING_ARB */ + 928, /* GL_MODELVIEW_PROJECTION_NV */ + 569, /* GL_IDENTITY_NV */ + 614, /* GL_INVERSE_NV */ + 1623, /* GL_TRANSPOSE_NV */ + 615, /* GL_INVERSE_TRANSPOSE_NV */ + 837, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */ + 836, /* GL_MAX_PROGRAM_MATRICES_ARB */ + 745, /* GL_MATRIX0_NV */ + 757, /* GL_MATRIX1_NV */ + 769, /* GL_MATRIX2_NV */ + 773, /* GL_MATRIX3_NV */ + 775, /* GL_MATRIX4_NV */ + 777, /* GL_MATRIX5_NV */ + 779, /* GL_MATRIX6_NV */ + 781, /* GL_MATRIX7_NV */ + 285, /* GL_CURRENT_MATRIX_STACK_DEPTH_ARB */ + 282, /* GL_CURRENT_MATRIX_ARB */ + 1709, /* GL_VERTEX_PROGRAM_POINT_SIZE */ + 1712, /* GL_VERTEX_PROGRAM_TWO_SIDE */ + 1177, /* GL_PROGRAM_PARAMETER_NV */ + 1697, /* GL_VERTEX_ATTRIB_ARRAY_POINTER */ + 1181, /* GL_PROGRAM_TARGET_NV */ + 1178, /* GL_PROGRAM_RESIDENT_NV */ + 1615, /* GL_TRACK_MATRIX_NV */ + 1616, /* GL_TRACK_MATRIX_TRANSFORM_NV */ + 1707, /* GL_VERTEX_PROGRAM_BINDING_NV */ + 1159, /* GL_PROGRAM_ERROR_POSITION_ARB */ + 319, /* GL_DEPTH_CLAMP_NV */ + 1675, /* GL_VERTEX_ATTRIB_ARRAY0_NV */ + 1682, /* GL_VERTEX_ATTRIB_ARRAY1_NV */ + 1683, /* GL_VERTEX_ATTRIB_ARRAY2_NV */ + 1684, /* GL_VERTEX_ATTRIB_ARRAY3_NV */ + 1685, /* GL_VERTEX_ATTRIB_ARRAY4_NV */ + 1686, /* GL_VERTEX_ATTRIB_ARRAY5_NV */ + 1687, /* GL_VERTEX_ATTRIB_ARRAY6_NV */ + 1688, /* GL_VERTEX_ATTRIB_ARRAY7_NV */ + 1689, /* GL_VERTEX_ATTRIB_ARRAY8_NV */ + 1690, /* GL_VERTEX_ATTRIB_ARRAY9_NV */ + 1676, /* GL_VERTEX_ATTRIB_ARRAY10_NV */ + 1677, /* GL_VERTEX_ATTRIB_ARRAY11_NV */ + 1678, /* GL_VERTEX_ATTRIB_ARRAY12_NV */ + 1679, /* GL_VERTEX_ATTRIB_ARRAY13_NV */ + 1680, /* GL_VERTEX_ATTRIB_ARRAY14_NV */ + 1681, /* GL_VERTEX_ATTRIB_ARRAY15_NV */ + 699, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */ + 706, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */ + 707, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */ + 708, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */ + 709, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */ + 710, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */ + 711, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */ + 712, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */ + 713, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */ + 714, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */ + 700, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */ + 701, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */ + 702, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */ + 703, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */ + 704, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */ + 705, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */ + 726, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */ + 733, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */ + 734, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */ + 735, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */ + 736, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */ + 737, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */ + 738, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */ + 1158, /* GL_PROGRAM_BINDING_ARB */ + 740, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */ + 741, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */ + 727, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */ + 728, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */ + 729, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */ + 730, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */ + 731, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */ + 732, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */ + 1538, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */ + 1535, /* GL_TEXTURE_COMPRESSED */ + 967, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */ + 239, /* GL_COMPRESSED_TEXTURE_FORMATS */ + 876, /* GL_MAX_VERTEX_UNITS_ARB */ + 22, /* GL_ACTIVE_VERTEX_UNITS_ARB */ + 1727, /* GL_WEIGHT_SUM_UNITY_ARB */ + 1705, /* GL_VERTEX_BLEND_ARB */ + 302, /* GL_CURRENT_WEIGHT_ARB */ + 1726, /* GL_WEIGHT_ARRAY_TYPE_ARB */ + 1725, /* GL_WEIGHT_ARRAY_STRIDE_ARB */ + 1724, /* GL_WEIGHT_ARRAY_SIZE_ARB */ + 1723, /* GL_WEIGHT_ARRAY_POINTER_ARB */ + 1720, /* GL_WEIGHT_ARRAY_ARB */ + 345, /* GL_DOT3_RGB */ + 346, /* GL_DOT3_RGBA */ + 237, /* GL_COMPRESSED_RGB_FXT1_3DFX */ + 232, /* GL_COMPRESSED_RGBA_FXT1_3DFX */ + 936, /* GL_MULTISAMPLE_3DFX */ + 1306, /* GL_SAMPLE_BUFFERS_3DFX */ + 1297, /* GL_SAMPLES_3DFX */ + 917, /* GL_MODELVIEW2_ARB */ + 920, /* GL_MODELVIEW3_ARB */ + 921, /* GL_MODELVIEW4_ARB */ + 922, /* GL_MODELVIEW5_ARB */ + 923, /* GL_MODELVIEW6_ARB */ + 924, /* GL_MODELVIEW7_ARB */ + 925, /* GL_MODELVIEW8_ARB */ + 926, /* GL_MODELVIEW9_ARB */ + 896, /* GL_MODELVIEW10_ARB */ + 897, /* GL_MODELVIEW11_ARB */ + 898, /* GL_MODELVIEW12_ARB */ + 899, /* GL_MODELVIEW13_ARB */ + 900, /* GL_MODELVIEW14_ARB */ + 901, /* GL_MODELVIEW15_ARB */ + 902, /* GL_MODELVIEW16_ARB */ + 903, /* GL_MODELVIEW17_ARB */ + 904, /* GL_MODELVIEW18_ARB */ + 905, /* GL_MODELVIEW19_ARB */ + 907, /* GL_MODELVIEW20_ARB */ + 908, /* GL_MODELVIEW21_ARB */ + 909, /* GL_MODELVIEW22_ARB */ + 910, /* GL_MODELVIEW23_ARB */ + 911, /* GL_MODELVIEW24_ARB */ + 912, /* GL_MODELVIEW25_ARB */ + 913, /* GL_MODELVIEW26_ARB */ + 914, /* GL_MODELVIEW27_ARB */ + 915, /* GL_MODELVIEW28_ARB */ + 916, /* GL_MODELVIEW29_ARB */ + 918, /* GL_MODELVIEW30_ARB */ + 919, /* GL_MODELVIEW31_ARB */ + 350, /* GL_DOT3_RGB_EXT */ + 348, /* GL_DOT3_RGBA_EXT */ + 890, /* GL_MIRROR_CLAMP_EXT */ + 893, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */ + 931, /* GL_MODULATE_ADD_ATI */ + 932, /* GL_MODULATE_SIGNED_ADD_ATI */ + 933, /* GL_MODULATE_SUBTRACT_ATI */ + 1733, /* GL_YCBCR_MESA */ + 1022, /* GL_PACK_INVERT_MESA */ + 305, /* GL_DEBUG_OBJECT_MESA */ + 306, /* GL_DEBUG_PRINT_MESA */ + 304, /* GL_DEBUG_ASSERT_MESA */ + 107, /* GL_BUFFER_SIZE */ + 109, /* GL_BUFFER_USAGE */ + 1393, /* GL_STENCIL_BACK_FUNC */ + 1392, /* GL_STENCIL_BACK_FAIL */ + 1394, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL */ + 1395, /* GL_STENCIL_BACK_PASS_DEPTH_PASS */ + 484, /* GL_FRAGMENT_PROGRAM_ARB */ + 1156, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */ + 1184, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */ + 1183, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */ + 1168, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ + 1174, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ + 1173, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ + 826, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */ + 849, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */ + 848, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */ + 839, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ + 845, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ + 844, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ + 809, /* GL_MAX_DRAW_BUFFERS */ + 354, /* GL_DRAW_BUFFER0 */ + 357, /* GL_DRAW_BUFFER1 */ + 378, /* GL_DRAW_BUFFER2 */ + 381, /* GL_DRAW_BUFFER3 */ + 384, /* GL_DRAW_BUFFER4 */ + 387, /* GL_DRAW_BUFFER5 */ + 390, /* GL_DRAW_BUFFER6 */ + 393, /* GL_DRAW_BUFFER7 */ + 396, /* GL_DRAW_BUFFER8 */ + 399, /* GL_DRAW_BUFFER9 */ + 358, /* GL_DRAW_BUFFER10 */ + 361, /* GL_DRAW_BUFFER11 */ + 364, /* GL_DRAW_BUFFER12 */ + 367, /* GL_DRAW_BUFFER13 */ + 370, /* GL_DRAW_BUFFER14 */ + 373, /* GL_DRAW_BUFFER15 */ + 82, /* GL_BLEND_EQUATION_ALPHA */ + 790, /* GL_MATRIX_PALETTE_ARB */ + 820, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */ + 823, /* GL_MAX_PALETTE_MATRICES_ARB */ + 288, /* GL_CURRENT_PALETTE_MATRIX_ARB */ + 784, /* GL_MATRIX_INDEX_ARRAY_ARB */ + 283, /* GL_CURRENT_MATRIX_INDEX_ARB */ + 786, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */ + 788, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */ + 787, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */ + 785, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */ + 1564, /* GL_TEXTURE_DEPTH_SIZE */ + 338, /* GL_DEPTH_TEXTURE_MODE */ + 1530, /* GL_TEXTURE_COMPARE_MODE */ + 1528, /* GL_TEXTURE_COMPARE_FUNC */ + 216, /* GL_COMPARE_R_TO_TEXTURE */ + 1090, /* GL_POINT_SPRITE */ + 265, /* GL_COORD_REPLACE */ + 1094, /* GL_POINT_SPRITE_R_MODE_NV */ + 1209, /* GL_QUERY_COUNTER_BITS */ + 290, /* GL_CURRENT_QUERY */ + 1211, /* GL_QUERY_RESULT */ + 1213, /* GL_QUERY_RESULT_AVAILABLE */ + 870, /* GL_MAX_VERTEX_ATTRIBS */ + 1695, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED */ + 336, /* GL_DEPTH_STENCIL_TO_RGBA_NV */ + 335, /* GL_DEPTH_STENCIL_TO_BGRA_NV */ + 856, /* GL_MAX_TEXTURE_COORDS */ + 858, /* GL_MAX_TEXTURE_IMAGE_UNITS */ + 1161, /* GL_PROGRAM_ERROR_STRING_ARB */ + 1163, /* GL_PROGRAM_FORMAT_ASCII_ARB */ + 1162, /* GL_PROGRAM_FORMAT_ARB */ + 1609, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */ + 317, /* GL_DEPTH_BOUNDS_TEST_EXT */ + 316, /* GL_DEPTH_BOUNDS_EXT */ + 52, /* GL_ARRAY_BUFFER */ + 419, /* GL_ELEMENT_ARRAY_BUFFER */ + 54, /* GL_ARRAY_BUFFER_BINDING */ + 421, /* GL_ELEMENT_ARRAY_BUFFER_BINDING */ + 1669, /* GL_VERTEX_ARRAY_BUFFER_BINDING */ + 957, /* GL_NORMAL_ARRAY_BUFFER_BINDING */ + 140, /* GL_COLOR_ARRAY_BUFFER_BINDING */ + 577, /* GL_INDEX_ARRAY_BUFFER_BINDING */ + 1543, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */ + 415, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING */ + 1318, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */ + 462, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING */ + 1721, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */ + 1691, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */ + 1164, /* GL_PROGRAM_INSTRUCTIONS_ARB */ + 832, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */ + 1170, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ + 841, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ + 1182, /* GL_PROGRAM_TEMPORARIES_ARB */ + 847, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */ + 1172, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */ + 843, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */ + 1176, /* GL_PROGRAM_PARAMETERS_ARB */ + 846, /* GL_MAX_PROGRAM_PARAMETERS_ARB */ + 1171, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */ + 842, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */ + 1157, /* GL_PROGRAM_ATTRIBS_ARB */ + 827, /* GL_MAX_PROGRAM_ATTRIBS_ARB */ + 1169, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */ + 840, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */ + 1155, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */ + 825, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */ + 1167, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ + 838, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ + 833, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */ + 829, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */ + 1185, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */ + 1620, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */ + 1221, /* GL_READ_ONLY */ + 1729, /* GL_WRITE_ONLY */ + 1223, /* GL_READ_WRITE */ + 101, /* GL_BUFFER_ACCESS */ + 103, /* GL_BUFFER_MAPPED */ + 105, /* GL_BUFFER_MAP_POINTER */ + 1614, /* GL_TIME_ELAPSED_EXT */ + 744, /* GL_MATRIX0_ARB */ + 756, /* GL_MATRIX1_ARB */ + 768, /* GL_MATRIX2_ARB */ + 772, /* GL_MATRIX3_ARB */ + 774, /* GL_MATRIX4_ARB */ + 776, /* GL_MATRIX5_ARB */ + 778, /* GL_MATRIX6_ARB */ + 780, /* GL_MATRIX7_ARB */ + 782, /* GL_MATRIX8_ARB */ + 783, /* GL_MATRIX9_ARB */ + 746, /* GL_MATRIX10_ARB */ + 747, /* GL_MATRIX11_ARB */ + 748, /* GL_MATRIX12_ARB */ + 749, /* GL_MATRIX13_ARB */ + 750, /* GL_MATRIX14_ARB */ + 751, /* GL_MATRIX15_ARB */ + 752, /* GL_MATRIX16_ARB */ + 753, /* GL_MATRIX17_ARB */ + 754, /* GL_MATRIX18_ARB */ + 755, /* GL_MATRIX19_ARB */ + 758, /* GL_MATRIX20_ARB */ + 759, /* GL_MATRIX21_ARB */ + 760, /* GL_MATRIX22_ARB */ + 761, /* GL_MATRIX23_ARB */ + 762, /* GL_MATRIX24_ARB */ + 763, /* GL_MATRIX25_ARB */ + 764, /* GL_MATRIX26_ARB */ + 765, /* GL_MATRIX27_ARB */ + 766, /* GL_MATRIX28_ARB */ + 767, /* GL_MATRIX29_ARB */ + 770, /* GL_MATRIX30_ARB */ + 771, /* GL_MATRIX31_ARB */ + 1420, /* GL_STREAM_DRAW */ + 1422, /* GL_STREAM_READ */ + 1418, /* GL_STREAM_COPY */ + 1386, /* GL_STATIC_DRAW */ + 1388, /* GL_STATIC_READ */ + 1384, /* GL_STATIC_COPY */ + 409, /* GL_DYNAMIC_DRAW */ + 411, /* GL_DYNAMIC_READ */ + 407, /* GL_DYNAMIC_COPY */ + 533, /* GL_GL_PIXEL_PACK_BUFFER */ + 535, /* GL_GL_PIXEL_UNPACK_BUFFER */ + 534, /* GL_GL_PIXEL_PACK_BUFFER_BINDING */ + 536, /* GL_GL_PIXEL_UNPACK_BUFFER_BINDING */ + 830, /* GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */ + 828, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */ + 831, /* GL_MAX_PROGRAM_IF_DEPTH_NV */ + 835, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */ + 834, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */ + 1414, /* GL_STENCIL_TEST_TWO_SIDE_EXT */ + 17, /* GL_ACTIVE_STENCIL_FACE_EXT */ + 891, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */ + 1299, /* GL_SAMPLES_PASSED */ + 485, /* GL_FRAGMENT_SHADER */ + 1715, /* GL_VERTEX_SHADER */ + 1175, /* GL_PROGRAM_OBJECT_ARB */ + 1331, /* GL_SHADER_OBJECT_ARB */ + 816, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS */ + 874, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS */ + 868, /* GL_MAX_VARYING_FLOATS */ + 872, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS */ + 801, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS */ + 982, /* GL_OBJECT_TYPE_ARB */ + 1333, /* GL_SHADER_TYPE */ + 450, /* GL_FLOAT_VEC2 */ + 452, /* GL_FLOAT_VEC3 */ + 454, /* GL_FLOAT_VEC4 */ + 604, /* GL_INT_VEC2 */ + 606, /* GL_INT_VEC3 */ + 608, /* GL_INT_VEC4 */ + 93, /* GL_BOOL */ + 95, /* GL_BOOL_VEC2 */ + 97, /* GL_BOOL_VEC3 */ + 99, /* GL_BOOL_VEC4 */ + 444, /* GL_FLOAT_MAT2 */ + 446, /* GL_FLOAT_MAT3 */ + 448, /* GL_FLOAT_MAT4 */ + 1290, /* GL_SAMPLER_1D */ + 1292, /* GL_SAMPLER_2D */ + 1294, /* GL_SAMPLER_3D */ + 1295, /* GL_SAMPLER_CUBE */ + 1291, /* GL_SAMPLER_1D_SHADOW */ + 1293, /* GL_SAMPLER_2D_SHADOW */ + 527, /* GL_GL_FLOAT_MAT2x3 */ + 528, /* GL_GL_FLOAT_MAT2x4 */ + 529, /* GL_GL_FLOAT_MAT3x2 */ + 530, /* GL_GL_FLOAT_MAT3x4 */ + 531, /* GL_GL_FLOAT_MAT4x2 */ + 532, /* GL_GL_FLOAT_MAT4x3 */ + 311, /* GL_DELETE_STATUS */ + 220, /* GL_COMPILE_STATUS */ + 657, /* GL_LINK_STATUS */ + 1664, /* GL_VALIDATE_STATUS */ + 589, /* GL_INFO_LOG_LENGTH */ + 56, /* GL_ATTACHED_SHADERS */ + 20, /* GL_ACTIVE_UNIFORMS */ + 21, /* GL_ACTIVE_UNIFORM_MAX_LENGTH */ + 1332, /* GL_SHADER_SOURCE_LENGTH */ + 15, /* GL_ACTIVE_ATTRIBUTES */ + 16, /* GL_ACTIVE_ATTRIBUTE_MAX_LENGTH */ + 487, /* GL_FRAGMENT_SHADER_DERIVATIVE_HINT */ + 1335, /* GL_SHADING_LANGUAGE_VERSION */ + 289, /* GL_CURRENT_PROGRAM */ + 1031, /* GL_PALETTE4_RGB8_OES */ + 1033, /* GL_PALETTE4_RGBA8_OES */ + 1029, /* GL_PALETTE4_R5_G6_B5_OES */ + 1032, /* GL_PALETTE4_RGBA4_OES */ + 1030, /* GL_PALETTE4_RGB5_A1_OES */ + 1036, /* GL_PALETTE8_RGB8_OES */ + 1038, /* GL_PALETTE8_RGBA8_OES */ + 1034, /* GL_PALETTE8_R5_G6_B5_OES */ + 1037, /* GL_PALETTE8_RGBA4_OES */ + 1035, /* GL_PALETTE8_RGB5_A1_OES */ + 572, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */ + 571, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */ + 541, /* GL_GL_SRGB */ + 542, /* GL_GL_SRGB8 */ + 544, /* GL_GL_SRGB_ALPHA */ + 543, /* GL_GL_SRGB8_ALPHA8 */ + 540, /* GL_GL_SLUMINANCE_ALPHA */ + 539, /* GL_GL_SLUMINANCE8_ALPHA8 */ + 537, /* GL_GL_SLUMINANCE */ + 538, /* GL_GL_SLUMINANCE8 */ + 524, /* GL_GL_COMPRESSED_SRGB */ + 525, /* GL_GL_COMPRESSED_SRGB_ALPHA */ + 522, /* GL_GL_COMPRESSED_SLUMINANCE */ + 523, /* GL_GL_COMPRESSED_SLUMINANCE_ALPHA */ + 1092, /* GL_POINT_SPRITE_COORD_ORIGIN */ + 665, /* GL_LOWER_LEFT */ + 1661, /* GL_UPPER_LEFT */ + 1396, /* GL_STENCIL_BACK_REF */ + 1397, /* GL_STENCIL_BACK_VALUE_MASK */ + 1398, /* GL_STENCIL_BACK_WRITEMASK */ + 402, /* GL_DRAW_FRAMEBUFFER_BINDING_EXT */ + 1235, /* GL_RENDERBUFFER_BINDING_EXT */ + 1220, /* GL_READ_FRAMEBUFFER_EXT */ + 403, /* GL_DRAW_FRAMEBUFFER_EXT */ + 1219, /* GL_READ_FRAMEBUFFER_BINDING_EXT */ + 489, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT */ + 488, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT */ + 492, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT */ + 491, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT */ + 490, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT */ + 494, /* GL_FRAMEBUFFER_COMPLETE_EXT */ + 496, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT */ + 501, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT */ + 499, /* GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT */ + 497, /* GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT */ + 500, /* GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT */ + 498, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT */ + 502, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT */ + 504, /* GL_FRAMEBUFFER_UNSUPPORTED_EXT */ + 503, /* GL_FRAMEBUFFER_STATUS_ERROR_EXT */ + 798, /* GL_MAX_COLOR_ATTACHMENTS_EXT */ + 146, /* GL_COLOR_ATTACHMENT0_EXT */ + 153, /* GL_COLOR_ATTACHMENT1_EXT */ + 154, /* GL_COLOR_ATTACHMENT2_EXT */ + 155, /* GL_COLOR_ATTACHMENT3_EXT */ + 156, /* GL_COLOR_ATTACHMENT4_EXT */ + 157, /* GL_COLOR_ATTACHMENT5_EXT */ + 158, /* GL_COLOR_ATTACHMENT6_EXT */ + 159, /* GL_COLOR_ATTACHMENT7_EXT */ + 160, /* GL_COLOR_ATTACHMENT8_EXT */ + 161, /* GL_COLOR_ATTACHMENT9_EXT */ + 147, /* GL_COLOR_ATTACHMENT10_EXT */ + 148, /* GL_COLOR_ATTACHMENT11_EXT */ + 149, /* GL_COLOR_ATTACHMENT12_EXT */ + 150, /* GL_COLOR_ATTACHMENT13_EXT */ + 151, /* GL_COLOR_ATTACHMENT14_EXT */ + 152, /* GL_COLOR_ATTACHMENT15_EXT */ + 313, /* GL_DEPTH_ATTACHMENT_EXT */ + 1391, /* GL_STENCIL_ATTACHMENT_EXT */ + 495, /* GL_FRAMEBUFFER_EXT */ + 1236, /* GL_RENDERBUFFER_EXT */ + 1239, /* GL_RENDERBUFFER_WIDTH_EXT */ + 1237, /* GL_RENDERBUFFER_HEIGHT_EXT */ + 1238, /* GL_RENDERBUFFER_INTERNAL_FORMAT_EXT */ + 1409, /* GL_STENCIL_INDEX_EXT */ + 1406, /* GL_STENCIL_INDEX1_EXT */ + 1407, /* GL_STENCIL_INDEX4_EXT */ + 1408, /* GL_STENCIL_INDEX8_EXT */ + 1405, /* GL_STENCIL_INDEX16_EXT */ + 427, /* GL_EVAL_BIT */ + 1217, /* GL_RASTER_POSITION_UNCLIPPED_IBM */ + 659, /* GL_LIST_BIT */ + 1514, /* GL_TEXTURE_BIT */ + 1314, /* GL_SCISSOR_BIT */ + 29, /* GL_ALL_ATTRIB_BITS */ + 938, /* GL_MULTISAMPLE_BIT */ }; #define Elements(x) sizeof(x)/sizeof(*x) diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 5edf9a7dd65..135323f9c15 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -58,6 +58,7 @@ static const struct { { OFF, "GL_ARB_point_sprite", F(ARB_point_sprite) }, { OFF, "GL_ARB_shader_objects", F(ARB_shader_objects) }, { OFF, "GL_ARB_shading_language_100", F(ARB_shading_language_100) }, + { OFF, "GL_ARB_shading_language_120", F(ARB_shading_language_120) }, { OFF, "GL_ARB_shadow", F(ARB_shadow) }, { OFF, "GL_ARB_shadow_ambient", F(SGIX_shadow_ambient) }, { OFF, "GL_ARB_texture_border_clamp", F(ARB_texture_border_clamp) }, @@ -249,7 +250,7 @@ _mesa_enable_sw_extensions(GLcontext *ctx) ctx->Extensions.EXT_secondary_color = GL_TRUE; ctx->Extensions.EXT_shared_texture_palette = GL_TRUE; ctx->Extensions.EXT_stencil_wrap = GL_TRUE; - ctx->Extensions.EXT_stencil_two_side = GL_TRUE; + ctx->Extensions.EXT_stencil_two_side = GL_FALSE; /* obsolete */ ctx->Extensions.EXT_texture_env_add = GL_TRUE; ctx->Extensions.EXT_texture_env_combine = GL_TRUE; ctx->Extensions.EXT_texture_env_dot3 = GL_TRUE; @@ -388,7 +389,7 @@ _mesa_enable_2_0_extensions(GLcontext *ctx) #if FEATURE_ARB_shading_language_100 ctx->Extensions.ARB_shading_language_100 = GL_TRUE; #endif - ctx->Extensions.EXT_stencil_two_side = GL_FALSE; /* yes, turn it off */ + ctx->Extensions.EXT_stencil_two_side = GL_FALSE; /* obsolete */ #if FEATURE_ARB_vertex_shader ctx->Extensions.ARB_vertex_shader = GL_TRUE; #endif diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index b6a59336cb8..cf8de1e0cbe 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -33,6 +33,7 @@ #include "fbobject.h" #include "framebuffer.h" #include "hash.h" +#include "mipmap.h" #include "renderbuffer.h" #include "state.h" #include "teximage.h" @@ -570,6 +571,12 @@ _mesa_BindRenderbufferEXT(GLenum target, GLuint renderbuffer) } FLUSH_VERTICES(ctx, _NEW_BUFFERS); + /* The above doesn't fully flush the drivers in the way that a + * glFlush does, but that is required here: + */ + if (ctx->Driver.Flush) + ctx->Driver.Flush(ctx); + if (renderbuffer) { newRb = _mesa_lookup_renderbuffer(ctx, renderbuffer); @@ -972,7 +979,9 @@ _mesa_BindFramebufferEXT(GLenum target, GLuint framebuffer) } FLUSH_VERTICES(ctx, _NEW_BUFFERS); - + if (ctx->Driver.Flush) { + ctx->Driver.Flush(ctx); + } if (framebuffer) { /* Binding a user-created framebuffer object */ newFb = _mesa_lookup_framebuffer(ctx, framebuffer); @@ -1047,6 +1056,11 @@ _mesa_DeleteFramebuffersEXT(GLsizei n, const GLuint *framebuffers) ASSERT_OUTSIDE_BEGIN_END(ctx); FLUSH_VERTICES(ctx, _NEW_BUFFERS); + /* The above doesn't fully flush the drivers in the way that a + * glFlush does, but that is required here: + */ + if (ctx->Driver.Flush) + ctx->Driver.Flush(ctx); for (i = 0; i < n; i++) { if (framebuffers[i] > 0) { @@ -1262,6 +1276,11 @@ framebuffer_texture(GLuint dims, GLenum target, GLenum attachment, } FLUSH_VERTICES(ctx, _NEW_BUFFERS); + /* The above doesn't fully flush the drivers in the way that a + * glFlush does, but that is required here: + */ + if (ctx->Driver.Flush) + ctx->Driver.Flush(ctx); _glthread_LOCK_MUTEX(fb->Mutex); if (texObj) { @@ -1380,6 +1399,11 @@ _mesa_FramebufferRenderbufferEXT(GLenum target, GLenum attachment, } FLUSH_VERTICES(ctx, _NEW_BUFFERS); + /* The above doesn't fully flush the drivers in the way that a + * glFlush does, but that is required here: + */ + if (ctx->Driver.Flush) + ctx->Driver.Flush(ctx); assert(ctx->Driver.FramebufferRenderbuffer); ctx->Driver.FramebufferRenderbuffer(ctx, fb, attachment, rb); @@ -1443,6 +1467,11 @@ _mesa_GetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment, } FLUSH_VERTICES(ctx, _NEW_BUFFERS); + /* The above doesn't fully flush the drivers in the way that a + * glFlush does, but that is required here: + */ + if (ctx->Driver.Flush) + ctx->Driver.Flush(ctx); switch (pname) { case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT: @@ -1521,7 +1550,9 @@ _mesa_GenerateMipmapEXT(GLenum target) texObj = _mesa_select_tex_object(ctx, texUnit, target); /* XXX this might not handle cube maps correctly */ + _mesa_lock_texture(ctx, texObj); _mesa_generate_mipmap(ctx, target, texUnit, texObj); + _mesa_unlock_texture(ctx, texObj); } diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c index d0dbbbad02b..465197401b7 100644 --- a/src/mesa/main/framebuffer.c +++ b/src/mesa/main/framebuffer.c @@ -327,9 +327,14 @@ _mesa_resize_framebuffer(GLcontext *ctx, struct gl_framebuffer *fb, fb->Width = width; fb->Height = height; - /* to update scissor / window bounds */ - if (ctx) + if (ctx) { + /* update scissor / window bounds */ _mesa_update_draw_buffer_bounds(ctx); + /* Signal new buffer state so that swrast will update its clipping + * info (the CLIP_BIT flag). + */ + ctx->NewState |= _NEW_BUFFERS; + } } diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index 086785911ee..858c8226592 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -793,7 +793,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.RedBias); break; case GL_RED_BITS: - params[0] = INT_TO_BOOLEAN( ctx->DrawBuffer->Visual.redBits ); + params[0] = INT_TO_BOOLEAN(ctx->DrawBuffer->Visual.redBits); break; case GL_RED_SCALE: params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.RedScale); @@ -1833,6 +1833,9 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) case GL_STENCIL_BACK_VALUE_MASK: params[0] = INT_TO_BOOLEAN(ctx->Stencil.ValueMask[1]); break; + case GL_STENCIL_BACK_WRITEMASK: + params[0] = INT_TO_BOOLEAN(ctx->Stencil.WriteMask[1]); + break; case GL_STENCIL_BACK_REF: params[0] = INT_TO_BOOLEAN(ctx->Stencil.Ref[1]); break; @@ -1863,7 +1866,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) break; case GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB: CHECK_EXT1(ARB_fragment_shader, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(MAX_FRAGMENT_UNIFORM_COMPONENTS); + params[0] = INT_TO_BOOLEAN(ctx->Const.FragmentProgram.MaxUniformComponents); break; case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB: CHECK_EXT1(ARB_fragment_shader, "GetBooleanv"); @@ -1871,15 +1874,15 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) break; case GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB: CHECK_EXT1(ARB_vertex_shader, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(MAX_VERTEX_UNIFORM_COMPONENTS); + params[0] = INT_TO_BOOLEAN(ctx->Const.VertexProgram.MaxUniformComponents); break; case GL_MAX_VARYING_FLOATS_ARB: CHECK_EXT1(ARB_vertex_shader, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(MAX_VARYING_FLOATS); + params[0] = INT_TO_BOOLEAN(ctx->Const.MaxVaryingFloats); break; case GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB: CHECK_EXT1(ARB_vertex_shader, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(MAX_VERTEX_TEXTURE_IMAGE_UNITS); + params[0] = INT_TO_BOOLEAN(ctx->Const.MaxVertexTextureImageUnits); break; case GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB: CHECK_EXT1(ARB_vertex_shader, "GetBooleanv"); @@ -2617,7 +2620,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) params[0] = ctx->Pixel.RedBias; break; case GL_RED_BITS: - params[0] = (GLfloat)( ctx->DrawBuffer->Visual.redBits ); + params[0] = (GLfloat)(ctx->DrawBuffer->Visual.redBits); break; case GL_RED_SCALE: params[0] = ctx->Pixel.RedScale; @@ -3657,6 +3660,9 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) case GL_STENCIL_BACK_VALUE_MASK: params[0] = (GLfloat)(ctx->Stencil.ValueMask[1]); break; + case GL_STENCIL_BACK_WRITEMASK: + params[0] = (GLfloat)(ctx->Stencil.WriteMask[1]); + break; case GL_STENCIL_BACK_REF: params[0] = (GLfloat)(ctx->Stencil.Ref[1]); break; @@ -3687,7 +3693,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) break; case GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB: CHECK_EXT1(ARB_fragment_shader, "GetFloatv"); - params[0] = (GLfloat)(MAX_FRAGMENT_UNIFORM_COMPONENTS); + params[0] = (GLfloat)(ctx->Const.FragmentProgram.MaxUniformComponents); break; case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB: CHECK_EXT1(ARB_fragment_shader, "GetFloatv"); @@ -3695,15 +3701,15 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) break; case GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB: CHECK_EXT1(ARB_vertex_shader, "GetFloatv"); - params[0] = (GLfloat)(MAX_VERTEX_UNIFORM_COMPONENTS); + params[0] = (GLfloat)(ctx->Const.VertexProgram.MaxUniformComponents); break; case GL_MAX_VARYING_FLOATS_ARB: CHECK_EXT1(ARB_vertex_shader, "GetFloatv"); - params[0] = (GLfloat)(MAX_VARYING_FLOATS); + params[0] = (GLfloat)(ctx->Const.MaxVaryingFloats); break; case GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB: CHECK_EXT1(ARB_vertex_shader, "GetFloatv"); - params[0] = (GLfloat)(MAX_VERTEX_TEXTURE_IMAGE_UNITS); + params[0] = (GLfloat)(ctx->Const.MaxVertexTextureImageUnits); break; case GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB: CHECK_EXT1(ARB_vertex_shader, "GetFloatv"); @@ -4441,7 +4447,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) params[0] = IROUND(ctx->Pixel.RedBias); break; case GL_RED_BITS: - params[0] = ctx->DrawBuffer->Visual.redBits ; + params[0] = ctx->DrawBuffer->Visual.redBits; break; case GL_RED_SCALE: params[0] = IROUND(ctx->Pixel.RedScale); @@ -5481,6 +5487,9 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) case GL_STENCIL_BACK_VALUE_MASK: params[0] = ctx->Stencil.ValueMask[1]; break; + case GL_STENCIL_BACK_WRITEMASK: + params[0] = ctx->Stencil.WriteMask[1]; + break; case GL_STENCIL_BACK_REF: params[0] = ctx->Stencil.Ref[1]; break; @@ -5511,7 +5520,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) break; case GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB: CHECK_EXT1(ARB_fragment_shader, "GetIntegerv"); - params[0] = MAX_FRAGMENT_UNIFORM_COMPONENTS; + params[0] = ctx->Const.FragmentProgram.MaxUniformComponents; break; case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB: CHECK_EXT1(ARB_fragment_shader, "GetIntegerv"); @@ -5519,15 +5528,15 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) break; case GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB: CHECK_EXT1(ARB_vertex_shader, "GetIntegerv"); - params[0] = MAX_VERTEX_UNIFORM_COMPONENTS; + params[0] = ctx->Const.VertexProgram.MaxUniformComponents; break; case GL_MAX_VARYING_FLOATS_ARB: CHECK_EXT1(ARB_vertex_shader, "GetIntegerv"); - params[0] = MAX_VARYING_FLOATS; + params[0] = ctx->Const.MaxVaryingFloats; break; case GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB: CHECK_EXT1(ARB_vertex_shader, "GetIntegerv"); - params[0] = MAX_VERTEX_TEXTURE_IMAGE_UNITS; + params[0] = ctx->Const.MaxVertexTextureImageUnits; break; case GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB: CHECK_EXT1(ARB_vertex_shader, "GetIntegerv"); diff --git a/src/mesa/main/getstring.c b/src/mesa/main/getstring.c index fba8e1634f4..f033ddc8954 100644 --- a/src/mesa/main/getstring.c +++ b/src/mesa/main/getstring.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.3 + * Version: 6.5.2 * - * Copyright (C) 1999-2005 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2006 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"), @@ -54,12 +54,16 @@ _mesa_GetString( GLenum name ) static const char *version_1_3 = "1.3 Mesa " MESA_VERSION_STRING; static const char *version_1_4 = "1.4 Mesa " MESA_VERSION_STRING; static const char *version_1_5 = "1.5 Mesa " MESA_VERSION_STRING; - static const char *version_2_0 = "1.5 Mesa " MESA_VERSION_STRING;/*XXX FIX*/ + static const char *version_2_0 = "1.5 Mesa " MESA_VERSION_STRING; + static const char *version_2_1 = "1.5 Mesa " MESA_VERSION_STRING; #if FEATURE_ARB_shading_language_100 static const char *sl_version_110 = "1.10 Mesa " MESA_VERSION_STRING; #endif + if (!ctx) + return NULL; + ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, NULL); /* this is a required driver function */ @@ -107,9 +111,18 @@ _mesa_GetString( GLenum name ) ctx->Extensions.EXT_shadow_funcs) { if (ctx->Extensions.ARB_draw_buffers && ctx->Extensions.ARB_point_sprite && - ctx->Extensions.ARB_texture_non_power_of_two && - ctx->Extensions.EXT_stencil_two_side) { - return (const GLubyte *) version_2_0; + ctx->Extensions.ARB_shader_objects && + ctx->Extensions.ARB_vertex_shader && + ctx->Extensions.ARB_fragment_shader && + ctx->Extensions.ARB_texture_non_power_of_two) { + if (ctx->Extensions.ARB_shading_language_120 && + ctx->Extensions.EXT_pixel_buffer_object && + ctx->Extensions.EXT_texture_sRGB) { + return (const GLubyte *) version_2_1; + } + else { + return (const GLubyte *) version_2_0; + } } else { return (const GLubyte *) version_1_5; diff --git a/src/mesa/main/histogram.c b/src/mesa/main/histogram.c index 29aced0c7a7..6a7f09489c5 100644 --- a/src/mesa/main/histogram.c +++ b/src/mesa/main/histogram.c @@ -748,8 +748,8 @@ _mesa_GetMinmax(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvo minmax[1][GCOMP] = CLAMP(ctx->MinMax.Max[GCOMP], 0.0F, 1.0F); minmax[1][BCOMP] = CLAMP(ctx->MinMax.Max[BCOMP], 0.0F, 1.0F); minmax[1][ACOMP] = CLAMP(ctx->MinMax.Max[ACOMP], 0.0F, 1.0F); - _mesa_pack_rgba_span_float(ctx, 2, (CONST GLfloat (*)[4]) minmax, - format, type, values, &ctx->Pack, 0); + _mesa_pack_rgba_span_float(ctx, 2, minmax, + format, type, values, &ctx->Pack, 0x0); } if (ctx->Pack.BufferObj->Name) { diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c index d86c2203a81..695aab5227f 100644 --- a/src/mesa/main/image.c +++ b/src/mesa/main/image.c @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.5.1 + * Version: 6.5.2 * * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. * @@ -990,7 +990,7 @@ _mesa_pack_bitmap( GLint width, GLint height, const GLubyte *source, * as indicated by the transferOps bitmask */ void -_mesa_apply_rgba_transfer_ops(GLcontext *ctx, GLuint transferOps, +_mesa_apply_rgba_transfer_ops(GLcontext *ctx, GLbitfield transferOps, GLuint n, GLfloat rgba[][4]) { /* scale & bias */ @@ -1059,45 +1059,130 @@ _mesa_apply_rgba_transfer_ops(GLcontext *ctx, GLuint transferOps, } +/* + * Apply color index shift and offset to an array of pixels. + */ +static void +shift_and_offset_ci( const GLcontext *ctx, GLuint n, GLuint indexes[] ) +{ + GLint shift = ctx->Pixel.IndexShift; + GLint offset = ctx->Pixel.IndexOffset; + GLuint i; + if (shift > 0) { + for (i=0;i> shift) + offset; + } + } + else { + for (i=0;iPixel.MapItoIsize - 1; + GLuint i; + for (i = 0; i < n; i++) { + const GLuint j = indexes[i] & mask; + indexes[i] = IROUND(ctx->Pixel.MapItoI[j]); + } + } +} + + +/** + * Apply stencil index shift, offset and table lookup to an array + * of stencil values. + */ +void +_mesa_apply_stencil_transfer_ops(const GLcontext *ctx, GLuint n, + GLstencil stencil[]) +{ + if (ctx->Pixel.IndexShift != 0 || ctx->Pixel.IndexOffset != 0) { + const GLint offset = ctx->Pixel.IndexOffset; + GLint shift = ctx->Pixel.IndexShift; + GLuint i; + if (shift > 0) { + for (i = 0; i < n; i++) { + stencil[i] = (stencil[i] << shift) + offset; + } + } + else if (shift < 0) { + shift = -shift; + for (i = 0; i < n; i++) { + stencil[i] = (stencil[i] >> shift) + offset; + } + } + else { + for (i = 0; i < n; i++) { + stencil[i] = stencil[i] + offset; + } + } + } + if (ctx->Pixel.MapStencilFlag) { + GLuint mask = ctx->Pixel.MapStoSsize - 1; + GLuint i; + for (i = 0; i < n; i++) { + stencil[i] = ctx->Pixel.MapStoS[ stencil[i] & mask ]; + } + } +} + /** * Used to pack an array [][4] of RGBA float colors as specified * by the dstFormat, dstType and dstPacking. Used by glReadPixels, * glGetConvolutionFilter(), etc. - * NOTE: it's assumed the incoming float colors are all in [0,1]. + * Incoming colors will be clamped to [0,1] if needed. + * Note: the rgba values will be modified by this function when any pixel + * transfer ops are enabled. */ void -_mesa_pack_rgba_span_float( GLcontext *ctx, - GLuint n, CONST GLfloat rgbaIn[][4], - GLenum dstFormat, GLenum dstType, - GLvoid *dstAddr, - const struct gl_pixelstore_attrib *dstPacking, - GLuint transferOps ) +_mesa_pack_rgba_span_float(GLcontext *ctx, GLuint n, GLfloat rgba[][4], + GLenum dstFormat, GLenum dstType, + GLvoid *dstAddr, + const struct gl_pixelstore_attrib *dstPacking, + GLbitfield transferOps) { - const GLint comps = _mesa_components_in_format(dstFormat); GLfloat luminance[MAX_WIDTH]; - const GLfloat (*rgba)[4]; + const GLint comps = _mesa_components_in_format(dstFormat); GLuint i; - if (transferOps) { - /* make copy of incoming data */ - GLfloat rgbaCopy[MAX_WIDTH][4]; - _mesa_memcpy(rgbaCopy, rgbaIn, n * 4 * sizeof(GLfloat)); - _mesa_apply_rgba_transfer_ops(ctx, transferOps, n, rgbaCopy); - rgba = (const GLfloat (*)[4]) rgbaCopy; + if (dstType != GL_FLOAT) { + /* need to clamp to [0, 1] */ + transferOps |= IMAGE_CLAMP_BIT; + } + if (transferOps) { + _mesa_apply_rgba_transfer_ops(ctx, transferOps, n, rgba); if ((transferOps & IMAGE_MIN_MAX_BIT) && ctx->MinMax.Sink) { return; } } - else { - /* use incoming data, not a copy */ - rgba = (const GLfloat (*)[4]) rgbaIn; - } if (dstFormat == GL_LUMINANCE || dstFormat == GL_LUMINANCE_ALPHA) { /* compute luminance values */ - if (ctx->Color.ClampReadColor == GL_TRUE) { + if (ctx->Color.ClampReadColor == GL_TRUE || dstType != GL_FLOAT) { for (i = 0; i < n; i++) { GLfloat sum = rgba[i][RCOMP] + rgba[i][GCOMP] + rgba[i][BCOMP]; luminance[i] = CLAMP(sum, 0.0F, 1.0F); @@ -1992,78 +2077,6 @@ _mesa_pack_rgba_span_float( GLcontext *ctx, } -/* - * Pack the given RGBA span into client memory at 'dest' address - * in the given pixel format and type. - * Optionally apply the enabled pixel transfer ops. - * Pack into memory using the given packing params struct. - * This is used by glReadPixels and glGetTexImage?D() - * \param ctx - the context - * n - number of pixels in the span - * rgba - the pixels - * format - dest packing format - * type - dest packing data type - * destination - destination packing address - * packing - pixel packing parameters - * transferOps - bitmask of IMAGE_*_BIT operations to apply - */ -void -_mesa_pack_rgba_span_chan( GLcontext *ctx, - GLuint n, CONST GLchan srcRgba[][4], - GLenum dstFormat, GLenum dstType, - GLvoid *dstAddr, - const struct gl_pixelstore_attrib *dstPacking, - GLuint transferOps) -{ - ASSERT((ctx->NewState & _NEW_PIXEL) == 0 || transferOps == 0); - - /* Test for optimized case first */ - if (transferOps == 0 && dstFormat == GL_RGBA && dstType == CHAN_TYPE) { - /* common simple case */ - _mesa_memcpy(dstAddr, srcRgba, n * 4 * sizeof(GLchan)); - } - else if (transferOps == 0 && dstFormat == GL_RGB && dstType == CHAN_TYPE) { - /* common simple case */ - GLuint i; - GLchan *dest = (GLchan *) dstAddr; - for (i = 0; i < n; i++) { - dest[0] = srcRgba[i][RCOMP]; - dest[1] = srcRgba[i][GCOMP]; - dest[2] = srcRgba[i][BCOMP]; - dest += 3; - } - } - else if (transferOps == 0 && dstFormat == GL_RGBA && dstType == GL_UNSIGNED_BYTE) { - /* common simple case */ - GLuint i; - GLubyte *dest = (GLubyte *) dstAddr; - for (i = 0; i < n; i++) { - dest[0] = CHAN_TO_UBYTE(srcRgba[i][RCOMP]); - dest[1] = CHAN_TO_UBYTE(srcRgba[i][GCOMP]); - dest[2] = CHAN_TO_UBYTE(srcRgba[i][BCOMP]); - dest[3] = CHAN_TO_UBYTE(srcRgba[i][ACOMP]); - dest += 4; - } - } - else { - /* general solution */ - GLuint i; - GLfloat rgba[MAX_WIDTH][4]; - assert(n <= MAX_WIDTH); - /* convert color components to floating point */ - for (i = 0; i < n; i++) { - rgba[i][RCOMP] = CHAN_TO_FLOAT(srcRgba[i][RCOMP]); - rgba[i][GCOMP] = CHAN_TO_FLOAT(srcRgba[i][GCOMP]); - rgba[i][BCOMP] = CHAN_TO_FLOAT(srcRgba[i][BCOMP]); - rgba[i][ACOMP] = CHAN_TO_FLOAT(srcRgba[i][ACOMP]); - } - _mesa_pack_rgba_span_float(ctx, n, (const GLfloat (*)[4]) rgba, - dstFormat, dstType, dstAddr, - dstPacking, transferOps); - } -} - - #define SWAP2BYTE(VALUE) \ { \ GLubyte *bytes = (GLubyte *) &(VALUE); \ @@ -2089,7 +2102,7 @@ extract_uint_indexes(GLuint n, GLuint indexes[], GLenum srcFormat, GLenum srcType, const GLvoid *src, const struct gl_pixelstore_attrib *unpack ) { - assert(srcFormat == GL_COLOR_INDEX); + ASSERT(srcFormat == GL_COLOR_INDEX || srcFormat == GL_STENCIL_INDEX); ASSERT(srcType == GL_BITMAP || srcType == GL_UNSIGNED_BYTE || @@ -2820,7 +2833,7 @@ _mesa_unpack_color_span_chan( GLcontext *ctx, GLenum srcFormat, GLenum srcType, const GLvoid *source, const struct gl_pixelstore_attrib *srcPacking, - GLuint transferOps ) + GLbitfield transferOps ) { ASSERT(dstFormat == GL_ALPHA || dstFormat == GL_LUMINANCE || @@ -3002,17 +3015,10 @@ _mesa_unpack_color_span_chan( GLcontext *ctx, extract_uint_indexes(n, indexes, srcFormat, srcType, source, srcPacking); - if (dstFormat == GL_COLOR_INDEX - && (transferOps & IMAGE_MAP_COLOR_BIT)) { - _mesa_map_ci(ctx, n, indexes); - } - if (transferOps & IMAGE_SHIFT_OFFSET_BIT) { - _mesa_shift_and_offset_ci(ctx, n, indexes); - } - if (dstFormat == GL_COLOR_INDEX) { - /* convert to GLchan and return */ GLuint i; + _mesa_apply_ci_transfer_ops(ctx, transferOps, n, indexes); + /* convert to GLchan and return */ for (i = 0; i < n; i++) { dest[i] = (GLchan) (indexes[i] & 0xff); } @@ -3020,6 +3026,9 @@ _mesa_unpack_color_span_chan( GLcontext *ctx, } else { /* Convert indexes to RGBA */ + if (transferOps & IMAGE_SHIFT_OFFSET_BIT) { + shift_and_offset_ci(ctx, n, indexes); + } _mesa_map_ci_to_rgba(ctx, n, indexes, rgba); } @@ -3160,7 +3169,7 @@ _mesa_unpack_color_span_float( GLcontext *ctx, GLenum srcFormat, GLenum srcType, const GLvoid *source, const struct gl_pixelstore_attrib *srcPacking, - GLuint transferOps ) + GLbitfield transferOps ) { ASSERT(dstFormat == GL_ALPHA || dstFormat == GL_LUMINANCE || @@ -3226,17 +3235,10 @@ _mesa_unpack_color_span_float( GLcontext *ctx, extract_uint_indexes(n, indexes, srcFormat, srcType, source, srcPacking); - if (dstFormat == GL_COLOR_INDEX - && (transferOps & IMAGE_MAP_COLOR_BIT)) { - _mesa_map_ci(ctx, n, indexes); - } - if (transferOps & IMAGE_SHIFT_OFFSET_BIT) { - _mesa_shift_and_offset_ci(ctx, n, indexes); - } - if (dstFormat == GL_COLOR_INDEX) { - /* convert to GLchan and return */ GLuint i; + _mesa_apply_ci_transfer_ops(ctx, transferOps, n, indexes); + /* convert to GLchan and return */ for (i = 0; i < n; i++) { dest[i] = (GLchan) (indexes[i] & 0xff); } @@ -3244,6 +3246,9 @@ _mesa_unpack_color_span_float( GLcontext *ctx, } else { /* Convert indexes to RGBA */ + if (transferOps & IMAGE_SHIFT_OFFSET_BIT) { + shift_and_offset_ci(ctx, n, indexes); + } _mesa_map_ci_to_rgba(ctx, n, indexes, rgba); } @@ -3386,7 +3391,7 @@ _mesa_unpack_index_span( const GLcontext *ctx, GLuint n, GLenum dstType, GLvoid *dest, GLenum srcType, const GLvoid *source, const struct gl_pixelstore_attrib *srcPacking, - GLuint transferOps ) + GLbitfield transferOps ) { ASSERT(srcType == GL_BITMAP || srcType == GL_UNSIGNED_BYTE || @@ -3426,14 +3431,8 @@ _mesa_unpack_index_span( const GLcontext *ctx, GLuint n, extract_uint_indexes(n, indexes, GL_COLOR_INDEX, srcType, source, srcPacking); - if (transferOps & IMAGE_SHIFT_OFFSET_BIT) { - /* shift and offset indexes */ - _mesa_shift_and_offset_ci(ctx, n, indexes); - } - if (transferOps & IMAGE_MAP_COLOR_BIT) { - /* Apply lookup table */ - _mesa_map_ci(ctx, n, indexes); - } + if (transferOps) + _mesa_apply_ci_transfer_ops(ctx, transferOps, n, indexes); /* convert to dest type */ switch (dstType) { @@ -3469,7 +3468,7 @@ void _mesa_pack_index_span( const GLcontext *ctx, GLuint n, GLenum dstType, GLvoid *dest, const GLuint *source, const struct gl_pixelstore_attrib *dstPacking, - GLuint transferOps ) + GLbitfield transferOps ) { GLuint indexes[MAX_WIDTH]; @@ -3480,12 +3479,7 @@ _mesa_pack_index_span( const GLcontext *ctx, GLuint n, if (transferOps & (IMAGE_MAP_COLOR_BIT | IMAGE_SHIFT_OFFSET_BIT)) { /* make a copy of input */ _mesa_memcpy(indexes, source, n * sizeof(GLuint)); - if (transferOps & IMAGE_SHIFT_OFFSET_BIT) { - _mesa_shift_and_offset_ci( ctx, n, indexes); - } - if (transferOps & IMAGE_MAP_COLOR_BIT) { - _mesa_map_ci(ctx, n, indexes); - } + _mesa_apply_ci_transfer_ops(ctx, transferOps, n, indexes); source = indexes; } @@ -3605,7 +3599,7 @@ _mesa_unpack_stencil_span( const GLcontext *ctx, GLuint n, GLenum dstType, GLvoid *dest, GLenum srcType, const GLvoid *source, const struct gl_pixelstore_attrib *srcPacking, - GLuint transferOps ) + GLbitfield transferOps ) { ASSERT(srcType == GL_BITMAP || srcType == GL_UNSIGNED_BYTE || @@ -3646,13 +3640,13 @@ _mesa_unpack_stencil_span( const GLcontext *ctx, GLuint n, GLuint indexes[MAX_WIDTH]; assert(n <= MAX_WIDTH); - extract_uint_indexes(n, indexes, GL_COLOR_INDEX, srcType, source, + extract_uint_indexes(n, indexes, GL_STENCIL_INDEX, srcType, source, srcPacking); if (transferOps) { if (transferOps & IMAGE_SHIFT_OFFSET_BIT) { /* shift and offset indexes */ - _mesa_shift_and_offset_ci(ctx, n, indexes); + shift_and_offset_ci(ctx, n, indexes); } if (ctx->Pixel.MapStencilFlag) { @@ -3708,12 +3702,7 @@ _mesa_pack_stencil_span( const GLcontext *ctx, GLuint n, ctx->Pixel.MapStencilFlag) { /* make a copy of input */ _mesa_memcpy(stencil, source, n * sizeof(GLstencil)); - if (ctx->Pixel.IndexShift || ctx->Pixel.IndexOffset) { - _mesa_shift_and_offset_stencil( ctx, n, stencil ); - } - if (ctx->Pixel.MapStencilFlag) { - _mesa_map_stencil( ctx, n, stencil ); - } + _mesa_apply_stencil_transfer_ops(ctx, n, stencil); source = stencil; } @@ -4142,15 +4131,11 @@ _mesa_pack_depth_stencil_span(const GLcontext *ctx, GLuint n, GLuint *dest, depthVals = depthCopy; } - if (ctx->Pixel.IndexShift || ctx->Pixel.IndexOffset) { + if (ctx->Pixel.IndexShift || + ctx->Pixel.IndexOffset || + ctx->Pixel.MapStencilFlag) { _mesa_memcpy(stencilCopy, stencilVals, n * sizeof(GLstencil)); - _mesa_shift_and_offset_stencil(ctx, n, stencilCopy); - stencilVals = stencilCopy; - } - if (ctx->Pixel.MapStencilFlag) { - if (stencilVals != stencilCopy) - _mesa_memcpy(stencilCopy, stencilVals, n * sizeof(GLstencil)); - _mesa_map_stencil(ctx, n, stencilCopy); + _mesa_apply_stencil_transfer_ops(ctx, n, stencilCopy); stencilVals = stencilCopy; } @@ -4243,11 +4228,136 @@ _mesa_unpack_image( GLuint dimensions, #endif /* _HAVE_FULL_GL */ + /** - * Perform clipping for glDrawPixels. The image's window position - * and size, and the unpack SkipPixels and SkipRows are adjusted so - * that the image region is entirely within the window and scissor bounds. - * NOTE: this will only work when glPixelZoom is (1, 1). + * Convert an array of RGBA colors from one datatype to another. + * NOTE: src may equal dst. In that case, we use a temporary buffer. + */ +void +_mesa_convert_colors(GLenum srcType, const GLvoid *src, + GLenum dstType, GLvoid *dst, + GLuint count, const GLubyte mask[]) +{ + GLuint tempBuffer[MAX_WIDTH][4]; + const GLboolean useTemp = (src == dst); + + ASSERT(srcType != dstType); + + switch (srcType) { + case GL_UNSIGNED_BYTE: + if (dstType == GL_UNSIGNED_SHORT) { + const GLubyte (*src1)[4] = (const GLubyte (*)[4]) src; + GLushort (*dst2)[4] = (GLushort (*)[4]) (useTemp ? tempBuffer : dst); + GLuint i; + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + dst2[i][RCOMP] = UBYTE_TO_USHORT(src1[i][RCOMP]); + dst2[i][GCOMP] = UBYTE_TO_USHORT(src1[i][GCOMP]); + dst2[i][BCOMP] = UBYTE_TO_USHORT(src1[i][BCOMP]); + dst2[i][ACOMP] = UBYTE_TO_USHORT(src1[i][ACOMP]); + } + } + if (useTemp) + _mesa_memcpy(dst, tempBuffer, count * 4 * sizeof(GLushort)); + } + else { + const GLubyte (*src1)[4] = (const GLubyte (*)[4]) src; + GLfloat (*dst4)[4] = (GLfloat (*)[4]) (useTemp ? tempBuffer : dst); + GLuint i; + ASSERT(dstType == GL_FLOAT); + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + dst4[i][RCOMP] = UBYTE_TO_FLOAT(src1[i][RCOMP]); + dst4[i][GCOMP] = UBYTE_TO_FLOAT(src1[i][GCOMP]); + dst4[i][BCOMP] = UBYTE_TO_FLOAT(src1[i][BCOMP]); + dst4[i][ACOMP] = UBYTE_TO_FLOAT(src1[i][ACOMP]); + } + } + if (useTemp) + _mesa_memcpy(dst, tempBuffer, count * 4 * sizeof(GLfloat)); + } + break; + case GL_UNSIGNED_SHORT: + if (dstType == GL_UNSIGNED_BYTE) { + const GLushort (*src2)[4] = (const GLushort (*)[4]) src; + GLubyte (*dst1)[4] = (GLubyte (*)[4]) (useTemp ? tempBuffer : dst); + GLuint i; + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + dst1[i][RCOMP] = USHORT_TO_UBYTE(src2[i][RCOMP]); + dst1[i][GCOMP] = USHORT_TO_UBYTE(src2[i][GCOMP]); + dst1[i][BCOMP] = USHORT_TO_UBYTE(src2[i][BCOMP]); + dst1[i][ACOMP] = USHORT_TO_UBYTE(src2[i][ACOMP]); + } + } + if (useTemp) + _mesa_memcpy(dst, tempBuffer, count * 4 * sizeof(GLubyte)); + } + else { + const GLushort (*src2)[4] = (const GLushort (*)[4]) src; + GLfloat (*dst4)[4] = (GLfloat (*)[4]) (useTemp ? tempBuffer : dst); + GLuint i; + ASSERT(dstType == GL_FLOAT); + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + dst4[i][RCOMP] = USHORT_TO_FLOAT(src2[i][RCOMP]); + dst4[i][GCOMP] = USHORT_TO_FLOAT(src2[i][GCOMP]); + dst4[i][BCOMP] = USHORT_TO_FLOAT(src2[i][BCOMP]); + dst4[i][ACOMP] = USHORT_TO_FLOAT(src2[i][ACOMP]); + } + } + if (useTemp) + _mesa_memcpy(dst, tempBuffer, count * 4 * sizeof(GLfloat)); + } + break; + case GL_FLOAT: + if (dstType == GL_UNSIGNED_BYTE) { + const GLfloat (*src4)[4] = (const GLfloat (*)[4]) src; + GLubyte (*dst1)[4] = (GLubyte (*)[4]) (useTemp ? tempBuffer : dst); + GLuint i; + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + UNCLAMPED_FLOAT_TO_UBYTE(dst1[i][RCOMP], src4[i][RCOMP]); + UNCLAMPED_FLOAT_TO_UBYTE(dst1[i][GCOMP], src4[i][GCOMP]); + UNCLAMPED_FLOAT_TO_UBYTE(dst1[i][BCOMP], src4[i][BCOMP]); + UNCLAMPED_FLOAT_TO_UBYTE(dst1[i][ACOMP], src4[i][ACOMP]); + } + } + if (useTemp) + _mesa_memcpy(dst, tempBuffer, count * 4 * sizeof(GLubyte)); + } + else { + const GLfloat (*src4)[4] = (const GLfloat (*)[4]) src; + GLushort (*dst2)[4] = (GLushort (*)[4]) (useTemp ? tempBuffer : dst); + GLuint i; + ASSERT(dstType == GL_UNSIGNED_SHORT); + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + UNCLAMPED_FLOAT_TO_USHORT(dst2[i][RCOMP], src4[i][RCOMP]); + UNCLAMPED_FLOAT_TO_USHORT(dst2[i][GCOMP], src4[i][GCOMP]); + UNCLAMPED_FLOAT_TO_USHORT(dst2[i][BCOMP], src4[i][BCOMP]); + UNCLAMPED_FLOAT_TO_USHORT(dst2[i][ACOMP], src4[i][ACOMP]); + } + } + if (useTemp) + _mesa_memcpy(dst, tempBuffer, count * 4 * sizeof(GLushort)); + } + break; + default: + _mesa_problem(NULL, "Invalid datatype in _mesa_convert_colors"); + } +} + + + + +/** + * Perform basic clipping for glDrawPixels. The image's position and size + * and the unpack SkipPixels and SkipRows are adjusted so that the image + * region is entirely within the window and scissor bounds. + * NOTE: this will only work when glPixelZoom is (1, 1) or (1, -1). + * If Pixel.ZoomY is -1, *destY will be changed to be the first row which + * we'll actually write. Beforehand, *destY-1 is the first drawing row. * * \return GL_TRUE if image is ready for drawing or * GL_FALSE if image was completely clipped away (draw nothing) @@ -4264,7 +4374,8 @@ _mesa_clip_drawpixels(const GLcontext *ctx, unpack->RowLength = *width; } - ASSERT(ctx->Pixel.ZoomX == 1.0F && ctx->Pixel.ZoomY == 1.0F); + ASSERT(ctx->Pixel.ZoomX == 1.0F); + ASSERT(ctx->Pixel.ZoomY == 1.0F || ctx->Pixel.ZoomY == -1.0F); /* left clipping */ if (*destX < buffer->_Xmin) { @@ -4279,15 +4390,30 @@ _mesa_clip_drawpixels(const GLcontext *ctx, if (*width <= 0) return GL_FALSE; - /* bottom clipping */ - if (*destY < buffer->_Ymin) { - unpack->SkipRows += (buffer->_Ymin - *destY); - *height -= (buffer->_Ymin - *destY); - *destY = buffer->_Ymin; + if (ctx->Pixel.ZoomY == 1.0F) { + /* bottom clipping */ + if (*destY < buffer->_Ymin) { + unpack->SkipRows += (buffer->_Ymin - *destY); + *height -= (buffer->_Ymin - *destY); + *destY = buffer->_Ymin; + } + /* top clipping */ + if (*destY + *height > buffer->_Ymax) + *height -= (*destY + *height - buffer->_Ymax); + } + else { /* upside down */ + /* top clipping */ + if (*destY > buffer->_Ymax) { + unpack->SkipRows += (*destY - buffer->_Ymax); + *height -= (*destY - buffer->_Ymax); + *destY = buffer->_Ymax; + } + /* bottom clipping */ + if (*destY - *height < buffer->_Ymin) + *height -= (buffer->_Ymin - (*destY - *height)); + /* adjust destY so it's the first row to write to */ + (*destY)--; } - /* top clipping */ - if (*destY + *height > buffer->_Ymax) - *height -= (*destY + *height - buffer->_Ymax); if (*height <= 0) return GL_TRUE; diff --git a/src/mesa/main/image.h b/src/mesa/main/image.h index 84faa03255e..990398a7c45 100644 --- a/src/mesa/main/image.h +++ b/src/mesa/main/image.h @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.5 + * Version: 6.5.2 * * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. * @@ -112,23 +112,25 @@ _mesa_pack_bitmap( GLint width, GLint height, const GLubyte *source, extern void -_mesa_apply_rgba_transfer_ops(GLcontext *ctx, GLuint transferOps, +_mesa_apply_rgba_transfer_ops(GLcontext *ctx, GLbitfield transferOps, GLuint n, GLfloat rgba[][4]); + extern void -_mesa_pack_rgba_span_float( GLcontext *ctx, - GLuint n, CONST GLfloat rgba[][4], - GLenum dstFormat, GLenum dstType, GLvoid *dstAddr, - const struct gl_pixelstore_attrib *dstPacking, - GLuint transferOps ); +_mesa_apply_ci_transfer_ops(const GLcontext *ctx, GLbitfield transferOps, + GLuint n, GLuint indexes[]); extern void -_mesa_pack_rgba_span_chan( GLcontext *ctx, - GLuint n, CONST GLchan rgba[][4], - GLenum dstFormat, GLenum dstType, GLvoid *dstAddr, - const struct gl_pixelstore_attrib *dstPacking, - GLuint transferOps ); +_mesa_apply_stencil_transfer_ops(const GLcontext *ctx, GLuint n, + GLstencil stencil[]); + + +extern void +_mesa_pack_rgba_span_float( GLcontext *ctx, GLuint n, GLfloat rgba[][4], + GLenum dstFormat, GLenum dstType, GLvoid *dstAddr, + const struct gl_pixelstore_attrib *dstPacking, + GLbitfield transferOps ); extern void @@ -137,7 +139,7 @@ _mesa_unpack_color_span_chan( GLcontext *ctx, GLenum srcFormat, GLenum srcType, const GLvoid *source, const struct gl_pixelstore_attrib *srcPacking, - GLuint transferOps ); + GLbitfield transferOps ); extern void @@ -146,7 +148,7 @@ _mesa_unpack_color_span_float( GLcontext *ctx, GLenum srcFormat, GLenum srcType, const GLvoid *source, const struct gl_pixelstore_attrib *srcPacking, - GLuint transferOps ); + GLbitfield transferOps ); extern void @@ -154,14 +156,14 @@ _mesa_unpack_index_span( const GLcontext *ctx, GLuint n, GLenum dstType, GLvoid *dest, GLenum srcType, const GLvoid *source, const struct gl_pixelstore_attrib *srcPacking, - GLuint transferOps ); + GLbitfield transferOps ); extern void _mesa_pack_index_span( const GLcontext *ctx, GLuint n, GLenum dstType, GLvoid *dest, const GLuint *source, const struct gl_pixelstore_attrib *dstPacking, - GLuint transferOps ); + GLbitfield transferOps ); extern void @@ -169,7 +171,7 @@ _mesa_unpack_stencil_span( const GLcontext *ctx, GLuint n, GLenum dstType, GLvoid *dest, GLenum srcType, const GLvoid *source, const struct gl_pixelstore_attrib *srcPacking, - GLuint transferOps ); + GLbitfield transferOps ); extern void _mesa_pack_stencil_span( const GLcontext *ctx, GLuint n, @@ -203,6 +205,12 @@ _mesa_unpack_image( GLuint dimensions, const struct gl_pixelstore_attrib *unpack ); +extern void +_mesa_convert_colors(GLenum srcType, const GLvoid *src, + GLenum dstType, GLvoid *dst, + GLuint count, const GLubyte mask[]); + + extern GLboolean _mesa_clip_drawpixels(const GLcontext *ctx, GLint *destX, GLint *destY, diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h index a17a0fd18ca..9fb02a7e9cd 100644 --- a/src/mesa/main/imports.h +++ b/src/mesa/main/imports.h @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.5.1 + * Version: 6.5.2 * * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. * @@ -604,6 +604,17 @@ do { \ #endif +/** + * Return 1 if this is a little endian machine, 0 if big endian. + */ +static INLINE GLboolean +_mesa_little_endian(void) +{ + const GLuint ui = 1; /* intentionally not static */ + return *((const GLubyte *) &ui); +} + + /********************************************************************** * Functions diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c index 63f88b7229f..984f7b2abc4 100644 --- a/src/mesa/main/light.c +++ b/src/mesa/main/light.c @@ -1340,6 +1340,7 @@ _mesa_init_lighting( GLcontext *ctx ) NULL ); ctx->Light.ColorMaterialEnabled = GL_FALSE; + ctx->Light.ClampVertexColor = GL_TRUE; /* Lighting miscellaneous */ ctx->_ShineTabList = MALLOC_STRUCT( gl_shine_tab ); diff --git a/src/mesa/main/macros.h b/src/mesa/main/macros.h index 672a2f8bd2f..fbbcd4e269e 100644 --- a/src/mesa/main/macros.h +++ b/src/mesa/main/macros.h @@ -5,9 +5,9 @@ /* * Mesa 3-D graphics library - * Version: 6.5 + * Version: 6.5.2 * - * Copyright (C) 1999-2005 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2006 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"), @@ -511,7 +511,18 @@ do { \ (DST)[1] += S; \ } while (0) +/** Assign scalers to short vectors */ +#define ASSIGN_2V( V, V0, V1 ) \ +do { \ + V[0] = V0; \ + V[1] = V1; \ +} while(0) + +/*@}*/ + +/** \name Linear interpolation macros */ +/*@{*/ /** * Linear interpolation @@ -585,15 +596,6 @@ do { \ } \ } while(0) - - -/** Assign scalers to short vectors */ -#define ASSIGN_2V( V, V0, V1 ) \ -do { \ - V[0] = V0; \ - V[1] = V1; \ -} while(0) - /*@}*/ diff --git a/src/mesa/main/mipmap.c b/src/mesa/main/mipmap.c new file mode 100644 index 00000000000..f154bd46513 --- /dev/null +++ b/src/mesa/main/mipmap.c @@ -0,0 +1,1147 @@ +/* + * Mesa 3-D graphics library + * Version: 6.5.2 + * + * Copyright (C) 1999-2006 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. + */ + + +/** + * \file mipmap.c mipmap generation and teximage resizing functions. + */ + +#include "imports.h" +#include "mipmap.h" +#include "texcompress.h" +#include "texformat.h" +#include "teximage.h" +#include "image.h" + + + +/** + * Average together two rows of a source image to produce a single new + * row in the dest image. It's legal for the two source rows to point + * to the same data. The source width must be equal to either the + * dest width or two times the dest width. + */ +static void +do_row(const struct gl_texture_format *format, GLint srcWidth, + const GLvoid *srcRowA, const GLvoid *srcRowB, + GLint dstWidth, GLvoid *dstRow) +{ + const GLuint k0 = (srcWidth == dstWidth) ? 0 : 1; + const GLuint colStride = (srcWidth == dstWidth) ? 1 : 2; + + /* This assertion is no longer valid with non-power-of-2 textures + assert(srcWidth == dstWidth || srcWidth == 2 * dstWidth); + */ + + switch (format->MesaFormat) { + case MESA_FORMAT_RGBA: + { + GLuint i, j, k; + const GLchan (*rowA)[4] = (const GLchan (*)[4]) srcRowA; + const GLchan (*rowB)[4] = (const GLchan (*)[4]) srcRowB; + GLchan (*dst)[4] = (GLchan (*)[4]) dstRow; + for (i = j = 0, k = k0; i < (GLuint) dstWidth; + i++, j += colStride, k += colStride) { + dst[i][0] = (rowA[j][0] + rowA[k][0] + + rowB[j][0] + rowB[k][0]) / 4; + dst[i][1] = (rowA[j][1] + rowA[k][1] + + rowB[j][1] + rowB[k][1]) / 4; + dst[i][2] = (rowA[j][2] + rowA[k][2] + + rowB[j][2] + rowB[k][2]) / 4; + dst[i][3] = (rowA[j][3] + rowA[k][3] + + rowB[j][3] + rowB[k][3]) / 4; + } + } + return; + case MESA_FORMAT_RGB: + { + GLuint i, j, k; + const GLchan (*rowA)[3] = (const GLchan (*)[3]) srcRowA; + const GLchan (*rowB)[3] = (const GLchan (*)[3]) srcRowB; + GLchan (*dst)[3] = (GLchan (*)[3]) dstRow; + for (i = j = 0, k = k0; i < (GLuint) dstWidth; + i++, j += colStride, k += colStride) { + dst[i][0] = (rowA[j][0] + rowA[k][0] + + rowB[j][0] + rowB[k][0]) / 4; + dst[i][1] = (rowA[j][1] + rowA[k][1] + + rowB[j][1] + rowB[k][1]) / 4; + dst[i][2] = (rowA[j][2] + rowA[k][2] + + rowB[j][2] + rowB[k][2]) / 4; + } + } + return; + case MESA_FORMAT_ALPHA: + case MESA_FORMAT_LUMINANCE: + case MESA_FORMAT_INTENSITY: + { + GLuint i, j, k; + const GLchan *rowA = (const GLchan *) srcRowA; + const GLchan *rowB = (const GLchan *) srcRowB; + GLchan *dst = (GLchan *) dstRow; + for (i = j = 0, k = k0; i < (GLuint) dstWidth; + i++, j += colStride, k += colStride) { + dst[i] = (rowA[j] + rowA[k] + rowB[j] + rowB[k]) / 4; + } + } + return; + case MESA_FORMAT_LUMINANCE_ALPHA: + { + GLuint i, j, k; + const GLchan (*rowA)[2] = (const GLchan (*)[2]) srcRowA; + const GLchan (*rowB)[2] = (const GLchan (*)[2]) srcRowB; + GLchan (*dst)[2] = (GLchan (*)[2]) dstRow; + for (i = j = 0, k = k0; i < (GLuint) dstWidth; + i++, j += colStride, k += colStride) { + dst[i][0] = (rowA[j][0] + rowA[k][0] + + rowB[j][0] + rowB[k][0]) / 4; + dst[i][1] = (rowA[j][1] + rowA[k][1] + + rowB[j][1] + rowB[k][1]) / 4; + } + } + return; + case MESA_FORMAT_Z32: + { + GLuint i, j, k; + const GLuint *rowA = (const GLuint *) srcRowA; + const GLuint *rowB = (const GLuint *) srcRowB; + GLfloat *dst = (GLfloat *) dstRow; + for (i = j = 0, k = k0; i < (GLuint) dstWidth; + i++, j += colStride, k += colStride) { + dst[i] = rowA[j] / 4 + rowA[k] / 4 + rowB[j] / 4 + rowB[k] / 4; + } + } + return; + case MESA_FORMAT_Z16: + { + GLuint i, j, k; + const GLushort *rowA = (const GLushort *) srcRowA; + const GLushort *rowB = (const GLushort *) srcRowB; + GLushort *dst = (GLushort *) dstRow; + for (i = j = 0, k = k0; i < (GLuint) dstWidth; + i++, j += colStride, k += colStride) { + dst[i] = (rowA[j] + rowA[k] + rowB[j] + rowB[k]) / 4; + } + } + return; + /* Begin hardware formats */ + case MESA_FORMAT_RGBA8888: + case MESA_FORMAT_RGBA8888_REV: + case MESA_FORMAT_ARGB8888: + case MESA_FORMAT_ARGB8888_REV: +#if FEATURE_EXT_texture_sRGB + case MESA_FORMAT_SRGBA8: +#endif + { + GLuint i, j, k; + const GLubyte (*rowA)[4] = (const GLubyte (*)[4]) srcRowA; + const GLubyte (*rowB)[4] = (const GLubyte (*)[4]) srcRowB; + GLubyte (*dst)[4] = (GLubyte (*)[4]) dstRow; + for (i = j = 0, k = k0; i < (GLuint) dstWidth; + i++, j += colStride, k += colStride) { + dst[i][0] = (rowA[j][0] + rowA[k][0] + + rowB[j][0] + rowB[k][0]) / 4; + dst[i][1] = (rowA[j][1] + rowA[k][1] + + rowB[j][1] + rowB[k][1]) / 4; + dst[i][2] = (rowA[j][2] + rowA[k][2] + + rowB[j][2] + rowB[k][2]) / 4; + dst[i][3] = (rowA[j][3] + rowA[k][3] + + rowB[j][3] + rowB[k][3]) / 4; + } + } + return; + case MESA_FORMAT_RGB888: + case MESA_FORMAT_BGR888: +#if FEATURE_EXT_texture_sRGB + case MESA_FORMAT_SRGB8: +#endif + { + GLuint i, j, k; + const GLubyte (*rowA)[3] = (const GLubyte (*)[3]) srcRowA; + const GLubyte (*rowB)[3] = (const GLubyte (*)[3]) srcRowB; + GLubyte (*dst)[3] = (GLubyte (*)[3]) dstRow; + for (i = j = 0, k = k0; i < (GLuint) dstWidth; + i++, j += colStride, k += colStride) { + dst[i][0] = (rowA[j][0] + rowA[k][0] + + rowB[j][0] + rowB[k][0]) / 4; + dst[i][1] = (rowA[j][1] + rowA[k][1] + + rowB[j][1] + rowB[k][1]) / 4; + dst[i][2] = (rowA[j][2] + rowA[k][2] + + rowB[j][2] + rowB[k][2]) / 4; + } + } + return; + case MESA_FORMAT_RGB565: + case MESA_FORMAT_RGB565_REV: + { + GLuint i, j, k; + const GLushort *rowA = (const GLushort *) srcRowA; + const GLushort *rowB = (const GLushort *) srcRowB; + GLushort *dst = (GLushort *) dstRow; + for (i = j = 0, k = k0; i < (GLuint) dstWidth; + i++, j += colStride, k += colStride) { + const GLint rowAr0 = rowA[j] & 0x1f; + const GLint rowAr1 = rowA[k] & 0x1f; + const GLint rowBr0 = rowB[j] & 0x1f; + const GLint rowBr1 = rowB[k] & 0x1f; + const GLint rowAg0 = (rowA[j] >> 5) & 0x3f; + const GLint rowAg1 = (rowA[k] >> 5) & 0x3f; + const GLint rowBg0 = (rowB[j] >> 5) & 0x3f; + const GLint rowBg1 = (rowB[k] >> 5) & 0x3f; + const GLint rowAb0 = (rowA[j] >> 11) & 0x1f; + const GLint rowAb1 = (rowA[k] >> 11) & 0x1f; + const GLint rowBb0 = (rowB[j] >> 11) & 0x1f; + const GLint rowBb1 = (rowB[k] >> 11) & 0x1f; + const GLint red = (rowAr0 + rowAr1 + rowBr0 + rowBr1) >> 2; + const GLint green = (rowAg0 + rowAg1 + rowBg0 + rowBg1) >> 2; + const GLint blue = (rowAb0 + rowAb1 + rowBb0 + rowBb1) >> 2; + dst[i] = (blue << 11) | (green << 5) | red; + } + } + return; + case MESA_FORMAT_ARGB4444: + case MESA_FORMAT_ARGB4444_REV: + { + GLuint i, j, k; + const GLushort *rowA = (const GLushort *) srcRowA; + const GLushort *rowB = (const GLushort *) srcRowB; + GLushort *dst = (GLushort *) dstRow; + for (i = j = 0, k = k0; i < (GLuint) dstWidth; + i++, j += colStride, k += colStride) { + const GLint rowAr0 = rowA[j] & 0xf; + const GLint rowAr1 = rowA[k] & 0xf; + const GLint rowBr0 = rowB[j] & 0xf; + const GLint rowBr1 = rowB[k] & 0xf; + const GLint rowAg0 = (rowA[j] >> 4) & 0xf; + const GLint rowAg1 = (rowA[k] >> 4) & 0xf; + const GLint rowBg0 = (rowB[j] >> 4) & 0xf; + const GLint rowBg1 = (rowB[k] >> 4) & 0xf; + const GLint rowAb0 = (rowA[j] >> 8) & 0xf; + const GLint rowAb1 = (rowA[k] >> 8) & 0xf; + const GLint rowBb0 = (rowB[j] >> 8) & 0xf; + const GLint rowBb1 = (rowB[k] >> 8) & 0xf; + const GLint rowAa0 = (rowA[j] >> 12) & 0xf; + const GLint rowAa1 = (rowA[k] >> 12) & 0xf; + const GLint rowBa0 = (rowB[j] >> 12) & 0xf; + const GLint rowBa1 = (rowB[k] >> 12) & 0xf; + const GLint red = (rowAr0 + rowAr1 + rowBr0 + rowBr1) >> 2; + const GLint green = (rowAg0 + rowAg1 + rowBg0 + rowBg1) >> 2; + const GLint blue = (rowAb0 + rowAb1 + rowBb0 + rowBb1) >> 2; + const GLint alpha = (rowAa0 + rowAa1 + rowBa0 + rowBa1) >> 2; + dst[i] = (alpha << 12) | (blue << 8) | (green << 4) | red; + } + } + return; + case MESA_FORMAT_ARGB1555: + case MESA_FORMAT_ARGB1555_REV: /* XXX broken? */ + { + GLuint i, j, k; + const GLushort *rowA = (const GLushort *) srcRowA; + const GLushort *rowB = (const GLushort *) srcRowB; + GLushort *dst = (GLushort *) dstRow; + for (i = j = 0, k = k0; i < (GLuint) dstWidth; + i++, j += colStride, k += colStride) { + const GLint rowAr0 = rowA[j] & 0x1f; + const GLint rowAr1 = rowA[k] & 0x1f; + const GLint rowBr0 = rowB[j] & 0x1f; + const GLint rowBr1 = rowB[k] & 0xf; + const GLint rowAg0 = (rowA[j] >> 5) & 0x1f; + const GLint rowAg1 = (rowA[k] >> 5) & 0x1f; + const GLint rowBg0 = (rowB[j] >> 5) & 0x1f; + const GLint rowBg1 = (rowB[k] >> 5) & 0x1f; + const GLint rowAb0 = (rowA[j] >> 10) & 0x1f; + const GLint rowAb1 = (rowA[k] >> 10) & 0x1f; + const GLint rowBb0 = (rowB[j] >> 10) & 0x1f; + const GLint rowBb1 = (rowB[k] >> 10) & 0x1f; + const GLint rowAa0 = (rowA[j] >> 15) & 0x1; + const GLint rowAa1 = (rowA[k] >> 15) & 0x1; + const GLint rowBa0 = (rowB[j] >> 15) & 0x1; + const GLint rowBa1 = (rowB[k] >> 15) & 0x1; + const GLint red = (rowAr0 + rowAr1 + rowBr0 + rowBr1) >> 2; + const GLint green = (rowAg0 + rowAg1 + rowBg0 + rowBg1) >> 2; + const GLint blue = (rowAb0 + rowAb1 + rowBb0 + rowBb1) >> 2; + const GLint alpha = (rowAa0 + rowAa1 + rowBa0 + rowBa1) >> 2; + dst[i] = (alpha << 15) | (blue << 10) | (green << 5) | red; + } + } + return; + case MESA_FORMAT_AL88: + case MESA_FORMAT_AL88_REV: +#if FEATURE_EXT_texture_sRGB + case MESA_FORMAT_SLA8: +#endif + { + GLuint i, j, k; + const GLubyte (*rowA)[2] = (const GLubyte (*)[2]) srcRowA; + const GLubyte (*rowB)[2] = (const GLubyte (*)[2]) srcRowB; + GLubyte (*dst)[2] = (GLubyte (*)[2]) dstRow; + for (i = j = 0, k = k0; i < (GLuint) dstWidth; + i++, j += colStride, k += colStride) { + dst[i][0] = (rowA[j][0] + rowA[k][0] + + rowB[j][0] + rowB[k][0]) >> 2; + dst[i][1] = (rowA[j][1] + rowA[k][1] + + rowB[j][1] + rowB[k][1]) >> 2; + } + } + return; + case MESA_FORMAT_RGB332: + { + GLuint i, j, k; + const GLubyte *rowA = (const GLubyte *) srcRowA; + const GLubyte *rowB = (const GLubyte *) srcRowB; + GLubyte *dst = (GLubyte *) dstRow; + for (i = j = 0, k = k0; i < (GLuint) dstWidth; + i++, j += colStride, k += colStride) { + const GLint rowAr0 = rowA[j] & 0x3; + const GLint rowAr1 = rowA[k] & 0x3; + const GLint rowBr0 = rowB[j] & 0x3; + const GLint rowBr1 = rowB[k] & 0x3; + const GLint rowAg0 = (rowA[j] >> 2) & 0x7; + const GLint rowAg1 = (rowA[k] >> 2) & 0x7; + const GLint rowBg0 = (rowB[j] >> 2) & 0x7; + const GLint rowBg1 = (rowB[k] >> 2) & 0x7; + const GLint rowAb0 = (rowA[j] >> 5) & 0x7; + const GLint rowAb1 = (rowA[k] >> 5) & 0x7; + const GLint rowBb0 = (rowB[j] >> 5) & 0x7; + const GLint rowBb1 = (rowB[k] >> 5) & 0x7; + const GLint red = (rowAr0 + rowAr1 + rowBr0 + rowBr1) >> 2; + const GLint green = (rowAg0 + rowAg1 + rowBg0 + rowBg1) >> 2; + const GLint blue = (rowAb0 + rowAb1 + rowBb0 + rowBb1) >> 2; + dst[i] = (blue << 5) | (green << 2) | red; + } + } + return; + case MESA_FORMAT_A8: + case MESA_FORMAT_L8: + case MESA_FORMAT_I8: + case MESA_FORMAT_CI8: +#if FEATURE_EXT_texture_sRGB + case MESA_FORMAT_SL8: +#endif + { + GLuint i, j, k; + const GLubyte *rowA = (const GLubyte *) srcRowA; + const GLubyte *rowB = (const GLubyte *) srcRowB; + GLubyte *dst = (GLubyte *) dstRow; + for (i = j = 0, k = k0; i < (GLuint) dstWidth; + i++, j += colStride, k += colStride) { + dst[i] = (rowA[j] + rowA[k] + rowB[j] + rowB[k]) >> 2; + } + } + return; + case MESA_FORMAT_RGBA_FLOAT32: + { + GLuint i, j, k; + const GLfloat (*rowA)[4] = (const GLfloat (*)[4]) srcRowA; + const GLfloat (*rowB)[4] = (const GLfloat (*)[4]) srcRowB; + GLfloat (*dst)[4] = (GLfloat (*)[4]) dstRow; + for (i = j = 0, k = k0; i < (GLuint) dstWidth; + i++, j += colStride, k += colStride) { + dst[i][0] = (rowA[j][0] + rowA[k][0] + + rowB[j][0] + rowB[k][0]) * 0.25F; + dst[i][1] = (rowA[j][1] + rowA[k][1] + + rowB[j][1] + rowB[k][1]) * 0.25F; + dst[i][2] = (rowA[j][2] + rowA[k][2] + + rowB[j][2] + rowB[k][2]) * 0.25F; + dst[i][3] = (rowA[j][3] + rowA[k][3] + + rowB[j][3] + rowB[k][3]) * 0.25F; + } + } + return; + case MESA_FORMAT_RGBA_FLOAT16: + { + GLuint i, j, k, comp; + const GLhalfARB (*rowA)[4] = (const GLhalfARB (*)[4]) srcRowA; + const GLhalfARB (*rowB)[4] = (const GLhalfARB (*)[4]) srcRowB; + GLhalfARB (*dst)[4] = (GLhalfARB (*)[4]) dstRow; + for (i = j = 0, k = k0; i < (GLuint) dstWidth; + i++, j += colStride, k += colStride) { + for (comp = 0; comp < 4; comp++) { + GLfloat aj, ak, bj, bk; + aj = _mesa_half_to_float(rowA[j][comp]); + ak = _mesa_half_to_float(rowA[k][comp]); + bj = _mesa_half_to_float(rowB[j][comp]); + bk = _mesa_half_to_float(rowB[k][comp]); + dst[i][comp] = _mesa_float_to_half((aj + ak + bj + bk) * 0.25F); + } + } + } + return; + case MESA_FORMAT_RGB_FLOAT32: + { + GLuint i, j, k; + const GLfloat (*rowA)[3] = (const GLfloat (*)[3]) srcRowA; + const GLfloat (*rowB)[3] = (const GLfloat (*)[3]) srcRowB; + GLfloat (*dst)[3] = (GLfloat (*)[3]) dstRow; + for (i = j = 0, k = k0; i < (GLuint) dstWidth; + i++, j += colStride, k += colStride) { + dst[i][0] = (rowA[j][0] + rowA[k][0] + + rowB[j][0] + rowB[k][0]) * 0.25F; + dst[i][1] = (rowA[j][1] + rowA[k][1] + + rowB[j][1] + rowB[k][1]) * 0.25F; + dst[i][2] = (rowA[j][2] + rowA[k][2] + + rowB[j][2] + rowB[k][2]) * 0.25F; + } + } + return; + case MESA_FORMAT_RGB_FLOAT16: + { + GLuint i, j, k, comp; + const GLhalfARB (*rowA)[3] = (const GLhalfARB (*)[3]) srcRowA; + const GLhalfARB (*rowB)[3] = (const GLhalfARB (*)[3]) srcRowB; + GLhalfARB (*dst)[3] = (GLhalfARB (*)[3]) dstRow; + for (i = j = 0, k = k0; i < (GLuint) dstWidth; + i++, j += colStride, k += colStride) { + for (comp = 0; comp < 3; comp++) { + GLfloat aj, ak, bj, bk; + aj = _mesa_half_to_float(rowA[j][comp]); + ak = _mesa_half_to_float(rowA[k][comp]); + bj = _mesa_half_to_float(rowB[j][comp]); + bk = _mesa_half_to_float(rowB[k][comp]); + dst[i][comp] = _mesa_float_to_half((aj + ak + bj + bk) * 0.25F); + } + } + } + return; + case MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32: + { + GLuint i, j, k; + const GLfloat (*rowA)[2] = (const GLfloat (*)[2]) srcRowA; + const GLfloat (*rowB)[2] = (const GLfloat (*)[2]) srcRowB; + GLfloat (*dst)[2] = (GLfloat (*)[2]) dstRow; + for (i = j = 0, k = k0; i < (GLuint) dstWidth; + i++, j += colStride, k += colStride) { + dst[i][0] = (rowA[j][0] + rowA[k][0] + + rowB[j][0] + rowB[k][0]) * 0.25F; + dst[i][1] = (rowA[j][1] + rowA[k][1] + + rowB[j][1] + rowB[k][1]) * 0.25F; + } + } + return; + case MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16: + { + GLuint i, j, k, comp; + const GLhalfARB (*rowA)[2] = (const GLhalfARB (*)[2]) srcRowA; + const GLhalfARB (*rowB)[2] = (const GLhalfARB (*)[2]) srcRowB; + GLhalfARB (*dst)[2] = (GLhalfARB (*)[2]) dstRow; + for (i = j = 0, k = k0; i < (GLuint) dstWidth; + i++, j += colStride, k += colStride) { + for (comp = 0; comp < 2; comp++) { + GLfloat aj, ak, bj, bk; + aj = _mesa_half_to_float(rowA[j][comp]); + ak = _mesa_half_to_float(rowA[k][comp]); + bj = _mesa_half_to_float(rowB[j][comp]); + bk = _mesa_half_to_float(rowB[k][comp]); + dst[i][comp] = _mesa_float_to_half((aj + ak + bj + bk) * 0.25F); + } + } + } + return; + case MESA_FORMAT_ALPHA_FLOAT32: + case MESA_FORMAT_LUMINANCE_FLOAT32: + case MESA_FORMAT_INTENSITY_FLOAT32: + { + GLuint i, j, k; + const GLfloat *rowA = (const GLfloat *) srcRowA; + const GLfloat *rowB = (const GLfloat *) srcRowB; + GLfloat *dst = (GLfloat *) dstRow; + for (i = j = 0, k = k0; i < (GLuint) dstWidth; + i++, j += colStride, k += colStride) { + dst[i] = (rowA[j] + rowA[k] + rowB[j] + rowB[k]) * 0.25F; + } + } + return; + case MESA_FORMAT_ALPHA_FLOAT16: + case MESA_FORMAT_LUMINANCE_FLOAT16: + case MESA_FORMAT_INTENSITY_FLOAT16: + { + GLuint i, j, k; + const GLhalfARB *rowA = (const GLhalfARB *) srcRowA; + const GLhalfARB *rowB = (const GLhalfARB *) srcRowB; + GLhalfARB *dst = (GLhalfARB *) dstRow; + for (i = j = 0, k = k0; i < (GLuint) dstWidth; + i++, j += colStride, k += colStride) { + GLfloat aj, ak, bj, bk; + aj = _mesa_half_to_float(rowA[j]); + ak = _mesa_half_to_float(rowA[k]); + bj = _mesa_half_to_float(rowB[j]); + bk = _mesa_half_to_float(rowB[k]); + dst[i] = _mesa_float_to_half((aj + ak + bj + bk) * 0.25F); + } + } + return; + + default: + _mesa_problem(NULL, "bad format in do_row()"); + } +} + + +/* + * These functions generate a 1/2-size mipmap image from a source image. + * Texture borders are handled by copying or averaging the source image's + * border texels, depending on the scale-down factor. + */ + +static void +make_1d_mipmap(const struct gl_texture_format *format, GLint border, + GLint srcWidth, const GLubyte *srcPtr, + GLint dstWidth, GLubyte *dstPtr) +{ + const GLint bpt = format->TexelBytes; + const GLubyte *src; + GLubyte *dst; + + /* skip the border pixel, if any */ + src = srcPtr + border * bpt; + dst = dstPtr + border * bpt; + + /* we just duplicate the input row, kind of hack, saves code */ + do_row(format, srcWidth - 2 * border, src, src, + dstWidth - 2 * border, dst); + + if (border) { + /* copy left-most pixel from source */ + MEMCPY(dstPtr, srcPtr, bpt); + /* copy right-most pixel from source */ + MEMCPY(dstPtr + (dstWidth - 1) * bpt, + srcPtr + (srcWidth - 1) * bpt, + bpt); + } +} + + +/** + * XXX need to use the tex image's row stride! + */ +static void +make_2d_mipmap(const struct gl_texture_format *format, GLint border, + GLint srcWidth, GLint srcHeight, const GLubyte *srcPtr, + GLint dstWidth, GLint dstHeight, GLubyte *dstPtr) +{ + const GLint bpt = format->TexelBytes; + const GLint srcWidthNB = srcWidth - 2 * border; /* sizes w/out border */ + const GLint dstWidthNB = dstWidth - 2 * border; + const GLint dstHeightNB = dstHeight - 2 * border; + const GLint srcRowStride = bpt * srcWidth; + const GLint dstRowStride = bpt * dstWidth; + const GLubyte *srcA, *srcB; + GLubyte *dst; + GLint row; + + /* Compute src and dst pointers, skipping any border */ + srcA = srcPtr + border * ((srcWidth + 1) * bpt); + if (srcHeight > 1) + srcB = srcA + srcRowStride; + else + srcB = srcA; + dst = dstPtr + border * ((dstWidth + 1) * bpt); + + for (row = 0; row < dstHeightNB; row++) { + do_row(format, srcWidthNB, srcA, srcB, + dstWidthNB, dst); + srcA += 2 * srcRowStride; + srcB += 2 * srcRowStride; + dst += dstRowStride; + } + + /* This is ugly but probably won't be used much */ + if (border > 0) { + /* fill in dest border */ + /* lower-left border pixel */ + MEMCPY(dstPtr, srcPtr, bpt); + /* lower-right border pixel */ + MEMCPY(dstPtr + (dstWidth - 1) * bpt, + srcPtr + (srcWidth - 1) * bpt, bpt); + /* upper-left border pixel */ + MEMCPY(dstPtr + dstWidth * (dstHeight - 1) * bpt, + srcPtr + srcWidth * (srcHeight - 1) * bpt, bpt); + /* upper-right border pixel */ + MEMCPY(dstPtr + (dstWidth * dstHeight - 1) * bpt, + srcPtr + (srcWidth * srcHeight - 1) * bpt, bpt); + /* lower border */ + do_row(format, srcWidthNB, + srcPtr + bpt, + srcPtr + bpt, + dstWidthNB, dstPtr + bpt); + /* upper border */ + do_row(format, srcWidthNB, + srcPtr + (srcWidth * (srcHeight - 1) + 1) * bpt, + srcPtr + (srcWidth * (srcHeight - 1) + 1) * bpt, + dstWidthNB, + dstPtr + (dstWidth * (dstHeight - 1) + 1) * bpt); + /* left and right borders */ + if (srcHeight == dstHeight) { + /* copy border pixel from src to dst */ + for (row = 1; row < srcHeight; row++) { + MEMCPY(dstPtr + dstWidth * row * bpt, + srcPtr + srcWidth * row * bpt, bpt); + MEMCPY(dstPtr + (dstWidth * row + dstWidth - 1) * bpt, + srcPtr + (srcWidth * row + srcWidth - 1) * bpt, bpt); + } + } + else { + /* average two src pixels each dest pixel */ + for (row = 0; row < dstHeightNB; row += 2) { + do_row(format, 1, + srcPtr + (srcWidth * (row * 2 + 1)) * bpt, + srcPtr + (srcWidth * (row * 2 + 2)) * bpt, + 1, dstPtr + (dstWidth * row + 1) * bpt); + do_row(format, 1, + srcPtr + (srcWidth * (row * 2 + 1) + srcWidth - 1) * bpt, + srcPtr + (srcWidth * (row * 2 + 2) + srcWidth - 1) * bpt, + 1, dstPtr + (dstWidth * row + 1 + dstWidth - 1) * bpt); + } + } + } +} + + +static void +make_3d_mipmap(const struct gl_texture_format *format, GLint border, + GLint srcWidth, GLint srcHeight, GLint srcDepth, + const GLubyte *srcPtr, + GLint dstWidth, GLint dstHeight, GLint dstDepth, + GLubyte *dstPtr) +{ + const GLint bpt = format->TexelBytes; + const GLint srcWidthNB = srcWidth - 2 * border; /* sizes w/out border */ + const GLint srcDepthNB = srcDepth - 2 * border; + const GLint dstWidthNB = dstWidth - 2 * border; + const GLint dstHeightNB = dstHeight - 2 * border; + const GLint dstDepthNB = dstDepth - 2 * border; + GLvoid *tmpRowA, *tmpRowB; + GLint img, row; + GLint bytesPerSrcImage, bytesPerDstImage; + GLint bytesPerSrcRow, bytesPerDstRow; + GLint srcImageOffset, srcRowOffset; + + (void) srcDepthNB; /* silence warnings */ + + /* Need two temporary row buffers */ + tmpRowA = _mesa_malloc(srcWidth * bpt); + if (!tmpRowA) + return; + tmpRowB = _mesa_malloc(srcWidth * bpt); + if (!tmpRowB) { + _mesa_free(tmpRowA); + return; + } + + bytesPerSrcImage = srcWidth * srcHeight * bpt; + bytesPerDstImage = dstWidth * dstHeight * bpt; + + bytesPerSrcRow = srcWidth * bpt; + bytesPerDstRow = dstWidth * bpt; + + /* Offset between adjacent src images to be averaged together */ + srcImageOffset = (srcDepth == dstDepth) ? 0 : bytesPerSrcImage; + + /* Offset between adjacent src rows to be averaged together */ + srcRowOffset = (srcHeight == dstHeight) ? 0 : srcWidth * bpt; + + /* + * Need to average together up to 8 src pixels for each dest pixel. + * Break that down into 3 operations: + * 1. take two rows from source image and average them together. + * 2. take two rows from next source image and average them together. + * 3. take the two averaged rows and average them for the final dst row. + */ + + /* + _mesa_printf("mip3d %d x %d x %d -> %d x %d x %d\n", + srcWidth, srcHeight, srcDepth, dstWidth, dstHeight, dstDepth); + */ + + for (img = 0; img < dstDepthNB; img++) { + /* first source image pointer, skipping border */ + const GLubyte *imgSrcA = srcPtr + + (bytesPerSrcImage + bytesPerSrcRow + border) * bpt * border + + img * (bytesPerSrcImage + srcImageOffset); + /* second source image pointer, skipping border */ + const GLubyte *imgSrcB = imgSrcA + srcImageOffset; + /* address of the dest image, skipping border */ + GLubyte *imgDst = dstPtr + + (bytesPerDstImage + bytesPerDstRow + border) * bpt * border + + img * bytesPerDstImage; + + /* setup the four source row pointers and the dest row pointer */ + const GLubyte *srcImgARowA = imgSrcA; + const GLubyte *srcImgARowB = imgSrcA + srcRowOffset; + const GLubyte *srcImgBRowA = imgSrcB; + const GLubyte *srcImgBRowB = imgSrcB + srcRowOffset; + GLubyte *dstImgRow = imgDst; + + for (row = 0; row < dstHeightNB; row++) { + /* Average together two rows from first src image */ + do_row(format, srcWidthNB, srcImgARowA, srcImgARowB, + srcWidthNB, tmpRowA); + /* Average together two rows from second src image */ + do_row(format, srcWidthNB, srcImgBRowA, srcImgBRowB, + srcWidthNB, tmpRowB); + /* Average together the temp rows to make the final row */ + do_row(format, srcWidthNB, tmpRowA, tmpRowB, + dstWidthNB, dstImgRow); + /* advance to next rows */ + srcImgARowA += bytesPerSrcRow + srcRowOffset; + srcImgARowB += bytesPerSrcRow + srcRowOffset; + srcImgBRowA += bytesPerSrcRow + srcRowOffset; + srcImgBRowB += bytesPerSrcRow + srcRowOffset; + dstImgRow += bytesPerDstRow; + } + } + + _mesa_free(tmpRowA); + _mesa_free(tmpRowB); + + /* Luckily we can leverage the make_2d_mipmap() function here! */ + if (border > 0) { + /* do front border image */ + make_2d_mipmap(format, 1, srcWidth, srcHeight, srcPtr, + dstWidth, dstHeight, dstPtr); + /* do back border image */ + make_2d_mipmap(format, 1, srcWidth, srcHeight, + srcPtr + bytesPerSrcImage * (srcDepth - 1), + dstWidth, dstHeight, + dstPtr + bytesPerDstImage * (dstDepth - 1)); + /* do four remaining border edges that span the image slices */ + if (srcDepth == dstDepth) { + /* just copy border pixels from src to dst */ + for (img = 0; img < dstDepthNB; img++) { + const GLubyte *src; + GLubyte *dst; + + /* do border along [img][row=0][col=0] */ + src = srcPtr + (img + 1) * bytesPerSrcImage; + dst = dstPtr + (img + 1) * bytesPerDstImage; + MEMCPY(dst, src, bpt); + + /* do border along [img][row=dstHeight-1][col=0] */ + src = srcPtr + (img * 2 + 1) * bytesPerSrcImage + + (srcHeight - 1) * bytesPerSrcRow; + dst = dstPtr + (img + 1) * bytesPerDstImage + + (dstHeight - 1) * bytesPerDstRow; + MEMCPY(dst, src, bpt); + + /* do border along [img][row=0][col=dstWidth-1] */ + src = srcPtr + (img * 2 + 1) * bytesPerSrcImage + + (srcWidth - 1) * bpt; + dst = dstPtr + (img + 1) * bytesPerDstImage + + (dstWidth - 1) * bpt; + MEMCPY(dst, src, bpt); + + /* do border along [img][row=dstHeight-1][col=dstWidth-1] */ + src = srcPtr + (img * 2 + 1) * bytesPerSrcImage + + (bytesPerSrcImage - bpt); + dst = dstPtr + (img + 1) * bytesPerDstImage + + (bytesPerDstImage - bpt); + MEMCPY(dst, src, bpt); + } + } + else { + /* average border pixels from adjacent src image pairs */ + ASSERT(srcDepthNB == 2 * dstDepthNB); + for (img = 0; img < dstDepthNB; img++) { + const GLubyte *src; + GLubyte *dst; + + /* do border along [img][row=0][col=0] */ + src = srcPtr + (img * 2 + 1) * bytesPerSrcImage; + dst = dstPtr + (img + 1) * bytesPerDstImage; + do_row(format, 1, src, src + srcImageOffset, 1, dst); + + /* do border along [img][row=dstHeight-1][col=0] */ + src = srcPtr + (img * 2 + 1) * bytesPerSrcImage + + (srcHeight - 1) * bytesPerSrcRow; + dst = dstPtr + (img + 1) * bytesPerDstImage + + (dstHeight - 1) * bytesPerDstRow; + do_row(format, 1, src, src + srcImageOffset, 1, dst); + + /* do border along [img][row=0][col=dstWidth-1] */ + src = srcPtr + (img * 2 + 1) * bytesPerSrcImage + + (srcWidth - 1) * bpt; + dst = dstPtr + (img + 1) * bytesPerDstImage + + (dstWidth - 1) * bpt; + do_row(format, 1, src, src + srcImageOffset, 1, dst); + + /* do border along [img][row=dstHeight-1][col=dstWidth-1] */ + src = srcPtr + (img * 2 + 1) * bytesPerSrcImage + + (bytesPerSrcImage - bpt); + dst = dstPtr + (img + 1) * bytesPerDstImage + + (bytesPerDstImage - bpt); + do_row(format, 1, src, src + srcImageOffset, 1, dst); + } + } + } +} + + +/** + * For GL_SGIX_generate_mipmap: + * Generate a complete set of mipmaps from texObj's base-level image. + * Stop at texObj's MaxLevel or when we get to the 1x1 texture. + */ +void +_mesa_generate_mipmap(GLcontext *ctx, GLenum target, + const struct gl_texture_unit *texUnit, + struct gl_texture_object *texObj) +{ + const struct gl_texture_image *srcImage; + const struct gl_texture_format *convertFormat; + const GLubyte *srcData = NULL; + GLubyte *dstData = NULL; + GLint level, maxLevels; + + ASSERT(texObj); + /* XXX choose cube map face here??? */ + srcImage = texObj->Image[0][texObj->BaseLevel]; + ASSERT(srcImage); + + maxLevels = _mesa_max_texture_levels(ctx, texObj->Target); + ASSERT(maxLevels > 0); /* bad target */ + + /* Find convertFormat - the format that do_row() will process */ + if (srcImage->IsCompressed) { + /* setup for compressed textures */ + GLuint row; + GLint components, size; + GLchan *dst; + + assert(texObj->Target == GL_TEXTURE_2D); + + if (srcImage->_BaseFormat == GL_RGB) { + convertFormat = &_mesa_texformat_rgb; + components = 3; + } + else if (srcImage->_BaseFormat == GL_RGBA) { + convertFormat = &_mesa_texformat_rgba; + components = 4; + } + else { + _mesa_problem(ctx, "bad srcImage->_BaseFormat in _mesa_generate_mipmaps"); + return; + } + + /* allocate storage for uncompressed GL_RGB or GL_RGBA images */ + size = _mesa_bytes_per_pixel(srcImage->_BaseFormat, CHAN_TYPE) + * srcImage->Width * srcImage->Height * srcImage->Depth + 20; + /* 20 extra bytes, just be safe when calling last FetchTexel */ + srcData = (GLubyte *) _mesa_malloc(size); + if (!srcData) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "generate mipmaps"); + return; + } + dstData = (GLubyte *) _mesa_malloc(size / 2); /* 1/4 would probably be OK */ + if (!dstData) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "generate mipmaps"); + _mesa_free((void *) srcData); + return; + } + + /* decompress base image here */ + dst = (GLchan *) srcData; + for (row = 0; row < srcImage->Height; row++) { + GLuint col; + for (col = 0; col < srcImage->Width; col++) { + srcImage->FetchTexelc(srcImage, col, row, 0, dst); + dst += components; + } + } + } + else { + /* uncompressed */ + convertFormat = srcImage->TexFormat; + } + + for (level = texObj->BaseLevel; level < texObj->MaxLevel + && level < maxLevels - 1; level++) { + /* generate image[level+1] from image[level] */ + const struct gl_texture_image *srcImage; + struct gl_texture_image *dstImage; + GLint srcWidth, srcHeight, srcDepth; + GLint dstWidth, dstHeight, dstDepth; + GLint border, bytesPerTexel; + + /* get src image parameters */ + srcImage = _mesa_select_tex_image(ctx, texObj, target, level); + ASSERT(srcImage); + srcWidth = srcImage->Width; + srcHeight = srcImage->Height; + srcDepth = srcImage->Depth; + border = srcImage->Border; + + /* compute next (level+1) image size */ + if (srcWidth - 2 * border > 1) { + dstWidth = (srcWidth - 2 * border) / 2 + 2 * border; + } + else { + dstWidth = srcWidth; /* can't go smaller */ + } + if (srcHeight - 2 * border > 1) { + dstHeight = (srcHeight - 2 * border) / 2 + 2 * border; + } + else { + dstHeight = srcHeight; /* can't go smaller */ + } + if (srcDepth - 2 * border > 1) { + dstDepth = (srcDepth - 2 * border) / 2 + 2 * border; + } + else { + dstDepth = srcDepth; /* can't go smaller */ + } + + if (dstWidth == srcWidth && + dstHeight == srcHeight && + dstDepth == srcDepth) { + /* all done */ + if (srcImage->IsCompressed) { + _mesa_free((void *) srcData); + _mesa_free(dstData); + } + return; + } + + /* get dest gl_texture_image */ + dstImage = _mesa_get_tex_image(ctx, texObj, target, level + 1); + if (!dstImage) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "generating mipmaps"); + return; + } + + /* Free old image data */ + if (dstImage->Data) + ctx->Driver.FreeTexImageData(ctx, dstImage); + + /* initialize new image */ + _mesa_init_teximage_fields(ctx, target, dstImage, dstWidth, dstHeight, + dstDepth, border, srcImage->InternalFormat); + dstImage->DriverData = NULL; + dstImage->TexFormat = srcImage->TexFormat; + dstImage->FetchTexelc = srcImage->FetchTexelc; + dstImage->FetchTexelf = srcImage->FetchTexelf; + dstImage->IsCompressed = srcImage->IsCompressed; + if (dstImage->IsCompressed) { + dstImage->CompressedSize + = ctx->Driver.CompressedTextureSize(ctx, dstImage->Width, + dstImage->Height, + dstImage->Depth, + dstImage->TexFormat->MesaFormat); + ASSERT(dstImage->CompressedSize > 0); + } + + ASSERT(dstImage->TexFormat); + ASSERT(dstImage->FetchTexelc); + ASSERT(dstImage->FetchTexelf); + + /* Alloc new teximage data buffer. + * Setup src and dest data pointers. + */ + if (dstImage->IsCompressed) { + dstImage->Data = _mesa_alloc_texmemory(dstImage->CompressedSize); + if (!dstImage->Data) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "generating mipmaps"); + return; + } + /* srcData and dstData are already set */ + ASSERT(srcData); + ASSERT(dstData); + } + else { + bytesPerTexel = dstImage->TexFormat->TexelBytes; + ASSERT(dstWidth * dstHeight * dstDepth * bytesPerTexel > 0); + dstImage->Data = _mesa_alloc_texmemory(dstWidth * dstHeight + * dstDepth * bytesPerTexel); + if (!dstImage->Data) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "generating mipmaps"); + return; + } + srcData = (const GLubyte *) srcImage->Data; + dstData = (GLubyte *) dstImage->Data; + } + + /* + * We use simple 2x2 averaging to compute the next mipmap level. + */ + switch (target) { + case GL_TEXTURE_1D: + make_1d_mipmap(convertFormat, border, + srcWidth, srcData, + dstWidth, dstData); + break; + case GL_TEXTURE_2D: + case GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB: + case GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB: + case GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB: + make_2d_mipmap(convertFormat, border, + srcWidth, srcHeight, srcData, + dstWidth, dstHeight, dstData); + break; + case GL_TEXTURE_3D: + make_3d_mipmap(convertFormat, border, + srcWidth, srcHeight, srcDepth, srcData, + dstWidth, dstHeight, dstDepth, dstData); + break; + case GL_TEXTURE_RECTANGLE_NV: + /* no mipmaps, do nothing */ + break; + default: + _mesa_problem(ctx, "bad dimensions in _mesa_generate_mipmaps"); + return; + } + + if (dstImage->IsCompressed) { + GLubyte *temp; + /* compress image from dstData into dstImage->Data */ + const GLenum srcFormat = convertFormat->BaseFormat; + GLint dstRowStride + = _mesa_compressed_row_stride(dstImage->TexFormat->MesaFormat, dstWidth); + ASSERT(srcFormat == GL_RGB || srcFormat == GL_RGBA); + dstImage->TexFormat->StoreImage(ctx, 2, dstImage->_BaseFormat, + dstImage->TexFormat, + dstImage->Data, + 0, 0, 0, /* dstX/Y/Zoffset */ + dstRowStride, 0, /* strides */ + dstWidth, dstHeight, 1, /* size */ + srcFormat, CHAN_TYPE, + dstData, /* src data, actually */ + &ctx->DefaultPacking); + /* swap src and dest pointers */ + temp = (GLubyte *) srcData; + srcData = dstData; + dstData = temp; + } + + } /* loop over mipmap levels */ +} + + +/** + * Helper function for drivers which need to rescale texture images to + * certain aspect ratios. + * Nearest filtering only (for broken hardware that can't support + * all aspect ratios). This can be made a lot faster, but I don't + * really care enough... + */ +void +_mesa_rescale_teximage2d(GLuint bytesPerPixel, + GLuint srcStrideInPixels, + GLuint dstRowStride, + GLint srcWidth, GLint srcHeight, + GLint dstWidth, GLint dstHeight, + const GLvoid *srcImage, GLvoid *dstImage) +{ + GLint row, col; + +#define INNER_LOOP( TYPE, HOP, WOP ) \ + for ( row = 0 ; row < dstHeight ; row++ ) { \ + GLint srcRow = row HOP hScale; \ + for ( col = 0 ; col < dstWidth ; col++ ) { \ + GLint srcCol = col WOP wScale; \ + dst[col] = src[srcRow * srcStrideInPixels + srcCol]; \ + } \ + dst = (TYPE *) ((GLubyte *) dst + dstRowStride); \ + } \ + +#define RESCALE_IMAGE( TYPE ) \ +do { \ + const TYPE *src = (const TYPE *)srcImage; \ + TYPE *dst = (TYPE *)dstImage; \ + \ + if ( srcHeight < dstHeight ) { \ + const GLint hScale = dstHeight / srcHeight; \ + if ( srcWidth < dstWidth ) { \ + const GLint wScale = dstWidth / srcWidth; \ + INNER_LOOP( TYPE, /, / ); \ + } \ + else { \ + const GLint wScale = srcWidth / dstWidth; \ + INNER_LOOP( TYPE, /, * ); \ + } \ + } \ + else { \ + const GLint hScale = srcHeight / dstHeight; \ + if ( srcWidth < dstWidth ) { \ + const GLint wScale = dstWidth / srcWidth; \ + INNER_LOOP( TYPE, *, / ); \ + } \ + else { \ + const GLint wScale = srcWidth / dstWidth; \ + INNER_LOOP( TYPE, *, * ); \ + } \ + } \ +} while (0) + + switch ( bytesPerPixel ) { + case 4: + RESCALE_IMAGE( GLuint ); + break; + + case 2: + RESCALE_IMAGE( GLushort ); + break; + + case 1: + RESCALE_IMAGE( GLubyte ); + break; + default: + _mesa_problem(NULL,"unexpected bytes/pixel in _mesa_rescale_teximage2d"); + } +} + + +/** + * Upscale an image by replication, not (typical) stretching. + * We use this when the image width or height is less than a + * certain size (4, 8) and we need to upscale an image. + */ +void +_mesa_upscale_teximage2d(GLsizei inWidth, GLsizei inHeight, + GLsizei outWidth, GLsizei outHeight, + GLint comps, const GLchan *src, GLint srcRowStride, + GLchan *dest ) +{ + GLint i, j, k; + + ASSERT(outWidth >= inWidth); + ASSERT(outHeight >= inHeight); +#if 0 + ASSERT(inWidth == 1 || inWidth == 2 || inHeight == 1 || inHeight == 2); + ASSERT((outWidth & 3) == 0); + ASSERT((outHeight & 3) == 0); +#endif + + for (i = 0; i < outHeight; i++) { + const GLint ii = i % inHeight; + for (j = 0; j < outWidth; j++) { + const GLint jj = j % inWidth; + for (k = 0; k < comps; k++) { + dest[(i * outWidth + j) * comps + k] + = src[ii * srcRowStride + jj * comps + k]; + } + } + } +} + diff --git a/src/mesa/main/mipmap.h b/src/mesa/main/mipmap.h new file mode 100644 index 00000000000..df786032838 --- /dev/null +++ b/src/mesa/main/mipmap.h @@ -0,0 +1,52 @@ +/* + * Mesa 3-D graphics library + * Version: 6.5.2 + * + * Copyright (C) 1999-2006 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. + */ + + +#ifndef MIPMAP_H +#define MIPMAP_H + +#include "mtypes.h" + +extern void +_mesa_generate_mipmap(GLcontext *ctx, GLenum target, + const struct gl_texture_unit *texUnit, + struct gl_texture_object *texObj); + + +extern void +_mesa_rescale_teximage2d(GLuint bytesPerPixel, + GLuint srcStrideInPixels, + GLuint dstRowStride, + GLint srcWidth, GLint srcHeight, + GLint dstWidth, GLint dstHeight, + const GLvoid *srcImage, GLvoid *dstImage); + +extern void +_mesa_upscale_teximage2d(GLsizei inWidth, GLsizei inHeight, + GLsizei outWidth, GLsizei outHeight, + GLint comps, const GLchan *src, GLint srcRowStride, + GLchan *dest); + + +#endif /* MIPMAP_H */ diff --git a/src/mesa/main/mm.c b/src/mesa/main/mm.c index 7a657dc3cad..846c329c70d 100644 --- a/src/mesa/main/mm.c +++ b/src/mesa/main/mm.c @@ -234,8 +234,6 @@ Join2Blocks(struct mem_block *p) int mmFreeMem(struct mem_block *b) { - struct mem_block *heap = b->heap; - if (!b) return 0; diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 2bb6d93c390..0ed73beb3c5 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -392,9 +392,9 @@ struct gl_color_table { GLenum InternalFormat; /**< The user-specified format */ GLenum _BaseFormat; /**< GL_ALPHA, GL_RGBA, GL_RGB, etc */ - GLuint Size; /**< number of entries (rows) in table */ - GLvoid *Table; /**< points to data of */ - GLenum Type; /**< GL_UNSIGNED_BYTE or GL_FLOAT */ + GLuint Size; /**< number of entries in table */ + GLfloat *TableF; /**< Color table, floating point values */ + GLubyte *TableUB; /**< Color table, ubyte values */ GLubyte RedSize; GLubyte GreenSize; GLubyte BlueSize; @@ -888,6 +888,7 @@ struct gl_light_attrib GLenum ColorMaterialMode; /**< GL_AMBIENT, GL_DIFFUSE, etc */ GLbitfield ColorMaterialBitmask; /**< bitmask formed from Face and Mode */ GLboolean ColorMaterialEnabled; + GLenum ClampVertexColor; struct gl_light EnabledList; /**< List sentinel */ @@ -1808,18 +1809,6 @@ struct gl_evaluators }; -/** - * State used during execution of fragment programs. - */ -struct fp_machine -{ - GLfloat Temporaries[MAX_NV_FRAGMENT_PROGRAM_TEMPS][4]; - GLfloat Inputs[MAX_NV_FRAGMENT_PROGRAM_INPUTS][4]; - GLfloat Outputs[MAX_NV_FRAGMENT_PROGRAM_OUTPUTS][4]; - GLuint CondCodes[4]; -}; - - /** * Names of the various vertex/fragment program register files, etc. * NOTE: first four tokens must fit into 2 bits (see t_vb_arbprogram.c) @@ -1925,30 +1914,25 @@ struct gl_program_state /** - * State vars for GL_ARB/GL_NV_vertex_program + * Context state for vertex programs. */ struct gl_vertex_program_state { - GLboolean Enabled; /**< GL_VERTEX_PROGRAM_ARB/NV */ - GLboolean _Enabled; /**< Enabled and valid program? */ - GLboolean PointSizeEnabled; /**< GL_VERTEX_PROGRAM_POINT_SIZE_ARB/NV */ - GLboolean TwoSideEnabled; /**< GL_VERTEX_PROGRAM_TWO_SIDE_ARB/NV */ + GLboolean Enabled; /**< GL_VERTEX_PROGRAM_ARB/NV */ + GLboolean _Enabled; /**< Enabled and valid program? */ + GLboolean PointSizeEnabled; /**< GL_VERTEX_PROGRAM_POINT_SIZE_ARB/NV */ + GLboolean TwoSideEnabled; /**< GL_VERTEX_PROGRAM_TWO_SIDE_ARB/NV */ struct gl_vertex_program *Current; /**< ptr to currently bound program */ const struct gl_vertex_program *_Current; /**< ptr to currently bound program, including internal (t_vp_build.c) programs */ + GLfloat Parameters[MAX_NV_VERTEX_PROGRAM_PARAMS][4]; /**< Env params */ + + /* For GL_NV_vertex_program only: */ GLenum TrackMatrix[MAX_NV_VERTEX_PROGRAM_PARAMS / 4]; GLenum TrackMatrixTransform[MAX_NV_VERTEX_PROGRAM_PARAMS / 4]; - GLfloat Parameters[MAX_NV_VERTEX_PROGRAM_PARAMS][4]; /* Env params */ - /* Only used during program execution (may be moved someday): */ - GLfloat Temporaries[MAX_NV_VERTEX_PROGRAM_TEMPS][4]; - GLfloat Inputs[MAX_NV_VERTEX_PROGRAM_INPUTS][4]; - GLuint InputsSize[MAX_NV_VERTEX_PROGRAM_INPUTS]; - GLfloat Outputs[MAX_NV_VERTEX_PROGRAM_OUTPUTS][4]; - GLint AddressReg[4]; - #if FEATURE_MESA_program_debug GLprogramcallbackMESA Callback; GLvoid *CallbackData; @@ -1959,18 +1943,17 @@ struct gl_vertex_program_state /** - * Context state for GL_ARB/NV_fragment_program + * Context state for fragment programs. */ struct gl_fragment_program_state { - GLboolean Enabled; /* GL_VERTEX_PROGRAM_NV */ - GLboolean _Enabled; /* Enabled and valid program? */ - GLboolean _Active; - struct gl_fragment_program *Current; /* ptr to currently bound program */ - const struct gl_fragment_program *_Current; /* ptr to currently active program + GLboolean Enabled; /**< User-set fragment program enable flag */ + GLboolean _Enabled; /**< Fragment program enabled and valid? */ + GLboolean _Active; /**< Is a user program or internal program active? */ + struct gl_fragment_program *Current; /**< User-bound program */ + const struct gl_fragment_program *_Current; /**< currently active program (including internal programs) */ - struct fp_machine Machine; /* machine state */ - GLfloat Parameters[MAX_NV_FRAGMENT_PROGRAM_PARAMS][4]; /* Env params */ + GLfloat Parameters[MAX_NV_FRAGMENT_PROGRAM_PARAMS][4]; /**< Env params */ #if FEATURE_MESA_program_debug GLprogramcallbackMESA Callback; @@ -1990,17 +1973,6 @@ struct gl_fragment_program_state struct atifs_instruction; struct atifs_setupinst; -/** - * State for executing ATI fragment shader. - */ -struct atifs_machine -{ - GLfloat Registers[6][4]; /** six temporary registers */ - GLfloat PrevPassRegisters[6][4]; - GLfloat Inputs[2][4]; /** Primary, secondary input colors */ -}; - - /** * ATI fragment shader */ @@ -2031,7 +2003,6 @@ struct gl_ati_fragment_shader_state GLboolean _Enabled; /** enabled and valid shader? */ GLboolean Compiling; GLfloat GlobalConstants[8][4]; - struct atifs_machine Machine; /* machine state */ struct ati_fragment_shader *Current; }; @@ -2091,6 +2062,19 @@ struct gl_shared_state struct gl_texture_object *DefaultRect; /*@}*/ + /** + * \name Thread safety and statechange notification for texture + * objects. + * + * \todo Improve the granularity of locking. + */ + /*@{*/ + _glthread_Mutex TexMutex; /**< texobj thread safety */ + GLuint TextureStateStamp; /**< state notification for shared tex */ + /*@}*/ + + + /** * \name Vertex/fragment programs */ @@ -2340,6 +2324,8 @@ struct gl_program_constants GLuint MaxNativeTemps; GLuint MaxNativeAddressRegs; /* vertex program only, for now */ GLuint MaxNativeParameters; + /* For shaders */ + GLuint MaxUniformComponents; }; @@ -2389,6 +2375,9 @@ struct gl_constants /* GL_EXT_framebuffer_object */ GLuint MaxColorAttachments; GLuint MaxRenderbufferSize; + /* GL_ARB_vertex_shader */ + GLuint MaxVertexTextureImageUnits; + GLuint MaxVaryingFloats; }; @@ -2417,6 +2406,7 @@ struct gl_extensions GLboolean ARB_point_sprite; GLboolean ARB_shader_objects; GLboolean ARB_shading_language_100; + GLboolean ARB_shading_language_120; GLboolean ARB_shadow; GLboolean ARB_texture_border_clamp; GLboolean ARB_texture_compression; @@ -2955,6 +2945,8 @@ struct __GLcontextRec GLboolean _ForceEyeCoords; GLenum _CurrentProgram; /* currently executing program */ + GLuint TextureStateTimestamp; /* detect changes to shared state */ + struct gl_shine_tab *_ShineTable[2]; /**< Active shine tables */ struct gl_shine_tab *_ShineTabList; /**< MRU list of inactive shine tables */ /**@}*/ diff --git a/src/mesa/main/pixel.c b/src/mesa/main/pixel.c index 3b1f848e8c3..4e47cdba890 100644 --- a/src/mesa/main/pixel.c +++ b/src/mesa/main/pixel.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.5 + * Version: 6.5.2 * - * Copyright (C) 1999-2005 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2006 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"), @@ -1171,200 +1171,88 @@ void _mesa_lookup_rgba_float(const struct gl_color_table *table, GLuint n, GLfloat rgba[][4]) { - if (!table->Table || table->Size == 0) + const GLint max = table->Size - 1; + const GLfloat scale = (GLfloat) max; + const GLfloat *lut = table->TableF; + GLuint i; + + if (!table->TableF || table->Size == 0) return; switch (table->_BaseFormat) { case GL_INTENSITY: /* replace RGBA with I */ - if (table->Type == GL_FLOAT) { - const GLint max = table->Size - 1; - const GLfloat scale = (GLfloat) max; - const GLfloat *lut = (const GLfloat *) table->Table; - GLuint i; - for (i = 0; i < n; i++) { - GLint j = IROUND(rgba[i][RCOMP] * scale); - GLfloat c = lut[CLAMP(j, 0, max)]; - rgba[i][RCOMP] = rgba[i][GCOMP] = - rgba[i][BCOMP] = rgba[i][ACOMP] = c; - } - } - else { - const GLint max = table->Size - 1; - const GLfloat scale = (GLfloat) max; - const GLchan *lut = (const GLchan *) table->Table; - GLuint i; - for (i = 0; i < n; i++) { - GLint j = IROUND(rgba[i][RCOMP] * scale); - GLfloat c = CHAN_TO_FLOAT(lut[CLAMP(j, 0, max)]); - rgba[i][RCOMP] = rgba[i][GCOMP] = - rgba[i][BCOMP] = rgba[i][ACOMP] = c; - } + for (i = 0; i < n; i++) { + GLint j = IROUND(rgba[i][RCOMP] * scale); + GLfloat c = lut[CLAMP(j, 0, max)]; + rgba[i][RCOMP] = + rgba[i][GCOMP] = + rgba[i][BCOMP] = + rgba[i][ACOMP] = c; } break; case GL_LUMINANCE: /* replace RGB with L */ - if (table->Type == GL_FLOAT) { - const GLint max = table->Size - 1; - const GLfloat scale = (GLfloat) max; - const GLfloat *lut = (const GLfloat *) table->Table; - GLuint i; - for (i = 0; i < n; i++) { - GLint j = IROUND(rgba[i][RCOMP] * scale); - GLfloat c = lut[CLAMP(j, 0, max)]; - rgba[i][RCOMP] = rgba[i][GCOMP] = rgba[i][BCOMP] = c; - } - } - else { - const GLint max = table->Size - 1; - const GLfloat scale = (GLfloat) max; - const GLchan *lut = (const GLchan *) table->Table; - GLuint i; - for (i = 0; i < n; i++) { - GLint j = IROUND(rgba[i][RCOMP] * scale); - GLfloat c = CHAN_TO_FLOAT(lut[CLAMP(j, 0, max)]); - rgba[i][RCOMP] = rgba[i][GCOMP] = rgba[i][BCOMP] = c; - } + for (i = 0; i < n; i++) { + GLint j = IROUND(rgba[i][RCOMP] * scale); + GLfloat c = lut[CLAMP(j, 0, max)]; + rgba[i][RCOMP] = + rgba[i][GCOMP] = + rgba[i][BCOMP] = c; } break; case GL_ALPHA: /* replace A with A */ - if (table->Type == GL_FLOAT) { - const GLint max = table->Size - 1; - const GLfloat scale = (GLfloat) max; - const GLfloat *lut = (const GLfloat *) table->Table; - GLuint i; - for (i = 0; i < n; i++) { - GLint j = IROUND(rgba[i][ACOMP] * scale); - rgba[i][ACOMP] = lut[CLAMP(j, 0, max)]; - } - } - else { - const GLint max = table->Size - 1; - const GLfloat scale = (GLfloat) max; - const GLchan *lut = (const GLchan *) table->Table; - GLuint i; - for (i = 0; i < n; i++) { - GLint j = IROUND(rgba[i][ACOMP] * scale); - rgba[i][ACOMP] = CHAN_TO_FLOAT(lut[CLAMP(j, 0, max)]); - } + for (i = 0; i < n; i++) { + GLint j = IROUND(rgba[i][ACOMP] * scale); + rgba[i][ACOMP] = lut[CLAMP(j, 0, max)]; } break; case GL_LUMINANCE_ALPHA: /* replace RGBA with LLLA */ - if (table->Type == GL_FLOAT) { - const GLint max = table->Size - 1; - const GLfloat scale = (GLfloat) max; - const GLfloat *lut = (const GLfloat *) table->Table; - GLuint i; - for (i = 0; i < n; i++) { - GLint jL = IROUND(rgba[i][RCOMP] * scale); - GLint jA = IROUND(rgba[i][ACOMP] * scale); - GLfloat luminance, alpha; - jL = CLAMP(jL, 0, max); - jA = CLAMP(jA, 0, max); - luminance = lut[jL * 2 + 0]; - alpha = lut[jA * 2 + 1]; - rgba[i][RCOMP] = rgba[i][GCOMP] = rgba[i][BCOMP] = luminance; - rgba[i][ACOMP] = alpha;; - } - } - else { - const GLint max = table->Size - 1; - const GLfloat scale = (GLfloat) max; - const GLchan *lut = (const GLchan *) table->Table; - GLuint i; - for (i = 0; i < n; i++) { - GLint jL = IROUND(rgba[i][RCOMP] * scale); - GLint jA = IROUND(rgba[i][ACOMP] * scale); - GLfloat luminance, alpha; - jL = CLAMP(jL, 0, max); - jA = CLAMP(jA, 0, max); - luminance = CHAN_TO_FLOAT(lut[jL * 2 + 0]); - alpha = CHAN_TO_FLOAT(lut[jA * 2 + 1]); - rgba[i][RCOMP] = rgba[i][GCOMP] = rgba[i][BCOMP] = luminance; - rgba[i][ACOMP] = alpha;; - } + for (i = 0; i < n; i++) { + GLint jL = IROUND(rgba[i][RCOMP] * scale); + GLint jA = IROUND(rgba[i][ACOMP] * scale); + GLfloat luminance, alpha; + jL = CLAMP(jL, 0, max); + jA = CLAMP(jA, 0, max); + luminance = lut[jL * 2 + 0]; + alpha = lut[jA * 2 + 1]; + rgba[i][RCOMP] = + rgba[i][GCOMP] = + rgba[i][BCOMP] = luminance; + rgba[i][ACOMP] = alpha;; } break; case GL_RGB: /* replace RGB with RGB */ - if (table->Type == GL_FLOAT) { - const GLint max = table->Size - 1; - const GLfloat scale = (GLfloat) max; - const GLfloat *lut = (const GLfloat *) table->Table; - GLuint i; - for (i = 0; i < n; i++) { - GLint jR = IROUND(rgba[i][RCOMP] * scale); - GLint jG = IROUND(rgba[i][GCOMP] * scale); - GLint jB = IROUND(rgba[i][BCOMP] * scale); - jR = CLAMP(jR, 0, max); - jG = CLAMP(jG, 0, max); - jB = CLAMP(jB, 0, max); - rgba[i][RCOMP] = lut[jR * 3 + 0]; - rgba[i][GCOMP] = lut[jG * 3 + 1]; - rgba[i][BCOMP] = lut[jB * 3 + 2]; - } - } - else { - const GLint max = table->Size - 1; - const GLfloat scale = (GLfloat) max; - const GLchan *lut = (const GLchan *) table->Table; - GLuint i; - for (i = 0; i < n; i++) { - GLint jR = IROUND(rgba[i][RCOMP] * scale); - GLint jG = IROUND(rgba[i][GCOMP] * scale); - GLint jB = IROUND(rgba[i][BCOMP] * scale); - jR = CLAMP(jR, 0, max); - jG = CLAMP(jG, 0, max); - jB = CLAMP(jB, 0, max); - rgba[i][RCOMP] = CHAN_TO_FLOAT(lut[jR * 3 + 0]); - rgba[i][GCOMP] = CHAN_TO_FLOAT(lut[jG * 3 + 1]); - rgba[i][BCOMP] = CHAN_TO_FLOAT(lut[jB * 3 + 2]); - } + for (i = 0; i < n; i++) { + GLint jR = IROUND(rgba[i][RCOMP] * scale); + GLint jG = IROUND(rgba[i][GCOMP] * scale); + GLint jB = IROUND(rgba[i][BCOMP] * scale); + jR = CLAMP(jR, 0, max); + jG = CLAMP(jG, 0, max); + jB = CLAMP(jB, 0, max); + rgba[i][RCOMP] = lut[jR * 3 + 0]; + rgba[i][GCOMP] = lut[jG * 3 + 1]; + rgba[i][BCOMP] = lut[jB * 3 + 2]; } break; case GL_RGBA: /* replace RGBA with RGBA */ - if (table->Type == GL_FLOAT) { - const GLint max = table->Size - 1; - const GLfloat scale = (GLfloat) max; - const GLfloat *lut = (const GLfloat *) table->Table; - GLuint i; - for (i = 0; i < n; i++) { - GLint jR = IROUND(rgba[i][RCOMP] * scale); - GLint jG = IROUND(rgba[i][GCOMP] * scale); - GLint jB = IROUND(rgba[i][BCOMP] * scale); - GLint jA = IROUND(rgba[i][ACOMP] * scale); - jR = CLAMP(jR, 0, max); - jG = CLAMP(jG, 0, max); - jB = CLAMP(jB, 0, max); - jA = CLAMP(jA, 0, max); - rgba[i][RCOMP] = lut[jR * 4 + 0]; - rgba[i][GCOMP] = lut[jG * 4 + 1]; - rgba[i][BCOMP] = lut[jB * 4 + 2]; - rgba[i][ACOMP] = lut[jA * 4 + 3]; - } - } - else { - const GLint max = table->Size - 1; - const GLfloat scale = (GLfloat) max; - const GLchan *lut = (const GLchan *) table->Table; - GLuint i; - for (i = 0; i < n; i++) { - GLint jR = IROUND(rgba[i][RCOMP] * scale); - GLint jG = IROUND(rgba[i][GCOMP] * scale); - GLint jB = IROUND(rgba[i][BCOMP] * scale); - GLint jA = IROUND(rgba[i][ACOMP] * scale); - jR = CLAMP(jR, 0, max); - jG = CLAMP(jG, 0, max); - jB = CLAMP(jB, 0, max); - jA = CLAMP(jA, 0, max); - rgba[i][RCOMP] = CHAN_TO_FLOAT(lut[jR * 4 + 0]); - rgba[i][GCOMP] = CHAN_TO_FLOAT(lut[jG * 4 + 1]); - rgba[i][BCOMP] = CHAN_TO_FLOAT(lut[jB * 4 + 2]); - rgba[i][ACOMP] = CHAN_TO_FLOAT(lut[jA * 4 + 3]); - } + for (i = 0; i < n; i++) { + GLint jR = IROUND(rgba[i][RCOMP] * scale); + GLint jG = IROUND(rgba[i][GCOMP] * scale); + GLint jB = IROUND(rgba[i][BCOMP] * scale); + GLint jA = IROUND(rgba[i][ACOMP] * scale); + jR = CLAMP(jR, 0, max); + jG = CLAMP(jG, 0, max); + jB = CLAMP(jB, 0, max); + jA = CLAMP(jA, 0, max); + rgba[i][RCOMP] = lut[jR * 4 + 0]; + rgba[i][GCOMP] = lut[jG * 4 + 1]; + rgba[i][BCOMP] = lut[jB * 4 + 2]; + rgba[i][ACOMP] = lut[jA * 4 + 3]; } break; default: @@ -1376,361 +1264,147 @@ _mesa_lookup_rgba_float(const struct gl_color_table *table, /** - * Apply a color table lookup to an array of GLchan RGBA colors. + * Apply a color table lookup to an array of ubyte/RGBA colors. */ void -_mesa_lookup_rgba_chan(const struct gl_color_table *table, - GLuint n, GLchan rgba[][4]) +_mesa_lookup_rgba_ubyte(const struct gl_color_table *table, + GLuint n, GLubyte rgba[][4]) { - if (!table->Table || table->Size == 0) + const GLubyte *lut = table->TableUB; + const GLfloat scale = (GLfloat) (table->Size - 1) / 255.0; + GLuint i; + + if (!table->TableUB || table->Size == 0) return; switch (table->_BaseFormat) { - case GL_INTENSITY: - /* replace RGBA with I */ - if (table->Type == GL_FLOAT) { - const GLfloat scale = (GLfloat) (table->Size - 1) / CHAN_MAXF; - const GLfloat *lut = (const GLfloat *) table->Table; - GLuint i; - for (i = 0; i < n; i++) { - GLint j = IROUND((GLfloat) rgba[i][RCOMP] * scale); - GLchan c; - CLAMPED_FLOAT_TO_CHAN(c, lut[j]); - rgba[i][RCOMP] = rgba[i][GCOMP] = - rgba[i][BCOMP] = rgba[i][ACOMP] = c; - } - } - else { -#if CHAN_TYPE == GL_UNSIGNED_BYTE - if (table->Size == 256) { - /* common case */ - const GLchan *lut = (const GLchan *) table->Table; - GLuint i; - for (i = 0; i < n; i++) { - const GLchan c = lut[rgba[i][RCOMP]]; - rgba[i][RCOMP] = rgba[i][GCOMP] = - rgba[i][BCOMP] = rgba[i][ACOMP] = c; - } - } - else -#endif - { - const GLfloat scale = (GLfloat) (table->Size - 1) / CHAN_MAXF; - const GLchan *lut = (const GLchan *) table->Table; - GLuint i; - for (i = 0; i < n; i++) { - GLint j = IROUND((GLfloat) rgba[i][RCOMP] * scale); - rgba[i][RCOMP] = rgba[i][GCOMP] = - rgba[i][BCOMP] = rgba[i][ACOMP] = lut[j]; - } - } - } - break; - case GL_LUMINANCE: - /* replace RGB with L */ - if (table->Type == GL_FLOAT) { - const GLfloat scale = (GLfloat) (table->Size - 1) / CHAN_MAXF; - const GLfloat *lut = (const GLfloat *) table->Table; - GLuint i; - for (i = 0; i < n; i++) { - GLint j = IROUND((GLfloat) rgba[i][RCOMP] * scale); - GLchan c; - CLAMPED_FLOAT_TO_CHAN(c, lut[j]); - rgba[i][RCOMP] = rgba[i][GCOMP] = rgba[i][BCOMP] = c; - } + case GL_INTENSITY: + /* replace RGBA with I */ + if (table->Size == 256) { + for (i = 0; i < n; i++) { + const GLubyte c = lut[rgba[i][RCOMP]]; + rgba[i][RCOMP] = + rgba[i][GCOMP] = + rgba[i][BCOMP] = + rgba[i][ACOMP] = c; } - else { -#if CHAN_TYPE == GL_UNSIGNED_BYTE - if (table->Size == 256) { - /* common case */ - const GLchan *lut = (const GLchan *) table->Table; - GLuint i; - for (i = 0; i < n; i++) { - const GLchan c = lut[rgba[i][RCOMP]]; - rgba[i][RCOMP] = rgba[i][GCOMP] = rgba[i][BCOMP] = c; - } - } - else -#endif - { - const GLfloat scale = (GLfloat) (table->Size - 1) / CHAN_MAXF; - const GLchan *lut = (const GLchan *) table->Table; - GLuint i; - for (i = 0; i < n; i++) { - GLint j = IROUND((GLfloat) rgba[i][RCOMP] * scale); - rgba[i][RCOMP] = rgba[i][GCOMP] = rgba[i][BCOMP] = lut[j]; - } - } + } + else { + for (i = 0; i < n; i++) { + GLint j = IROUND((GLfloat) rgba[i][RCOMP] * scale); + rgba[i][RCOMP] = + rgba[i][GCOMP] = + rgba[i][BCOMP] = + rgba[i][ACOMP] = lut[j]; } - break; - case GL_ALPHA: - /* replace A with A */ - if (table->Type == GL_FLOAT) { - const GLfloat scale = (GLfloat) (table->Size - 1) / CHAN_MAXF; - const GLfloat *lut = (const GLfloat *) table->Table; - GLuint i; - for (i = 0; i < n; i++) { - GLint j = IROUND((GLfloat) rgba[i][ACOMP] * scale); - GLchan c; - CLAMPED_FLOAT_TO_CHAN(c, lut[j]); - rgba[i][ACOMP] = c; - } + } + break; + case GL_LUMINANCE: + /* replace RGB with L */ + if (table->Size == 256) { + for (i = 0; i < n; i++) { + const GLubyte c = lut[rgba[i][RCOMP]]; + rgba[i][RCOMP] = + rgba[i][GCOMP] = + rgba[i][BCOMP] = c; } - else { -#if CHAN_TYPE == GL_UNSIGNED_BYTE - if (table->Size == 256) { - /* common case */ - const GLchan *lut = (const GLchan *) table->Table; - GLuint i; - for (i = 0; i < n; i++) { - rgba[i][ACOMP] = lut[rgba[i][ACOMP]]; - } - } - else -#endif - { - const GLfloat scale = (GLfloat) (table->Size - 1) / CHAN_MAXF; - const GLchan *lut = (const GLchan *) table->Table; - GLuint i; - for (i = 0; i < n; i++) { - GLint j = IROUND((GLfloat) rgba[i][ACOMP] * scale); - rgba[i][ACOMP] = lut[j]; - } - } + } + else { + for (i = 0; i < n; i++) { + GLint j = IROUND((GLfloat) rgba[i][RCOMP] * scale); + rgba[i][RCOMP] = + rgba[i][GCOMP] = + rgba[i][BCOMP] = lut[j]; } - break; - case GL_LUMINANCE_ALPHA: - /* replace RGBA with LLLA */ - if (table->Type == GL_FLOAT) { - const GLfloat scale = (GLfloat) (table->Size - 1) / CHAN_MAXF; - const GLfloat *lut = (const GLfloat *) table->Table; - GLuint i; - for (i = 0; i < n; i++) { - GLint jL = IROUND((GLfloat) rgba[i][RCOMP] * scale); - GLint jA = IROUND((GLfloat) rgba[i][ACOMP] * scale); - GLchan luminance, alpha; - CLAMPED_FLOAT_TO_CHAN(luminance, lut[jL * 2 + 0]); - CLAMPED_FLOAT_TO_CHAN(alpha, lut[jA * 2 + 1]); - rgba[i][RCOMP] = rgba[i][GCOMP] = rgba[i][BCOMP] = luminance; - rgba[i][ACOMP] = alpha;; - } + } + break; + case GL_ALPHA: + /* replace A with A */ + if (table->Size == 256) { + for (i = 0; i < n; i++) { + rgba[i][ACOMP] = lut[rgba[i][ACOMP]]; } - else { -#if CHAN_TYPE == GL_UNSIGNED_BYTE - if (table->Size == 256) { - /* common case */ - const GLchan *lut = (const GLchan *) table->Table; - GLuint i; - for (i = 0; i < n; i++) { - GLchan l = lut[rgba[i][RCOMP] * 2 + 0]; - GLchan a = lut[rgba[i][ACOMP] * 2 + 1];; - rgba[i][RCOMP] = rgba[i][GCOMP] = rgba[i][BCOMP] = l; - rgba[i][ACOMP] = a; - } - } - else -#endif - { - const GLfloat scale = (GLfloat) (table->Size - 1) / CHAN_MAXF; - const GLchan *lut = (const GLchan *) table->Table; - GLuint i; - for (i = 0; i < n; i++) { - GLint jL = IROUND((GLfloat) rgba[i][RCOMP] * scale); - GLint jA = IROUND((GLfloat) rgba[i][ACOMP] * scale); - GLchan luminance = lut[jL * 2 + 0]; - GLchan alpha = lut[jA * 2 + 1]; - rgba[i][RCOMP] = rgba[i][GCOMP] = rgba[i][BCOMP] = luminance; - rgba[i][ACOMP] = alpha; - } - } + } + else { + for (i = 0; i < n; i++) { + GLint j = IROUND((GLfloat) rgba[i][ACOMP] * scale); + rgba[i][ACOMP] = lut[j]; } - break; - case GL_RGB: - /* replace RGB with RGB */ - if (table->Type == GL_FLOAT) { - const GLfloat scale = (GLfloat) (table->Size - 1) / CHAN_MAXF; - const GLfloat *lut = (const GLfloat *) table->Table; - GLuint i; - for (i = 0; i < n; i++) { - GLint jR = IROUND((GLfloat) rgba[i][RCOMP] * scale); - GLint jG = IROUND((GLfloat) rgba[i][GCOMP] * scale); - GLint jB = IROUND((GLfloat) rgba[i][BCOMP] * scale); - CLAMPED_FLOAT_TO_CHAN(rgba[i][RCOMP], lut[jR * 3 + 0]); - CLAMPED_FLOAT_TO_CHAN(rgba[i][GCOMP], lut[jG * 3 + 1]); - CLAMPED_FLOAT_TO_CHAN(rgba[i][BCOMP], lut[jB * 3 + 2]); - } + } + break; + case GL_LUMINANCE_ALPHA: + /* replace RGBA with LLLA */ + if (table->Size == 256) { + for (i = 0; i < n; i++) { + GLubyte l = lut[rgba[i][RCOMP] * 2 + 0]; + GLubyte a = lut[rgba[i][ACOMP] * 2 + 1];; + rgba[i][RCOMP] = + rgba[i][GCOMP] = + rgba[i][BCOMP] = l; + rgba[i][ACOMP] = a; } - else { -#if CHAN_TYPE == GL_UNSIGNED_BYTE - if (table->Size == 256) { - /* common case */ - const GLchan *lut = (const GLchan *) table->Table; - GLuint i; - for (i = 0; i < n; i++) { - rgba[i][RCOMP] = lut[rgba[i][RCOMP] * 3 + 0]; - rgba[i][GCOMP] = lut[rgba[i][GCOMP] * 3 + 1]; - rgba[i][BCOMP] = lut[rgba[i][BCOMP] * 3 + 2]; - } - } - else -#endif - { - const GLfloat scale = (GLfloat) (table->Size - 1) / CHAN_MAXF; - const GLchan *lut = (const GLchan *) table->Table; - GLuint i; - for (i = 0; i < n; i++) { - GLint jR = IROUND((GLfloat) rgba[i][RCOMP] * scale); - GLint jG = IROUND((GLfloat) rgba[i][GCOMP] * scale); - GLint jB = IROUND((GLfloat) rgba[i][BCOMP] * scale); - rgba[i][RCOMP] = lut[jR * 3 + 0]; - rgba[i][GCOMP] = lut[jG * 3 + 1]; - rgba[i][BCOMP] = lut[jB * 3 + 2]; - } - } + } + else { + for (i = 0; i < n; i++) { + GLint jL = IROUND((GLfloat) rgba[i][RCOMP] * scale); + GLint jA = IROUND((GLfloat) rgba[i][ACOMP] * scale); + GLubyte luminance = lut[jL * 2 + 0]; + GLubyte alpha = lut[jA * 2 + 1]; + rgba[i][RCOMP] = + rgba[i][GCOMP] = + rgba[i][BCOMP] = luminance; + rgba[i][ACOMP] = alpha; } - break; - case GL_RGBA: - /* replace RGBA with RGBA */ - if (table->Type == GL_FLOAT) { - const GLfloat scale = (GLfloat) (table->Size - 1) / CHAN_MAXF; - const GLfloat *lut = (const GLfloat *) table->Table; - GLuint i; - for (i = 0; i < n; i++) { - GLint jR = IROUND((GLfloat) rgba[i][RCOMP] * scale); - GLint jG = IROUND((GLfloat) rgba[i][GCOMP] * scale); - GLint jB = IROUND((GLfloat) rgba[i][BCOMP] * scale); - GLint jA = IROUND((GLfloat) rgba[i][ACOMP] * scale); - CLAMPED_FLOAT_TO_CHAN(rgba[i][RCOMP], lut[jR * 4 + 0]); - CLAMPED_FLOAT_TO_CHAN(rgba[i][GCOMP], lut[jG * 4 + 1]); - CLAMPED_FLOAT_TO_CHAN(rgba[i][BCOMP], lut[jB * 4 + 2]); - CLAMPED_FLOAT_TO_CHAN(rgba[i][ACOMP], lut[jA * 4 + 3]); - } + } + break; + case GL_RGB: + if (table->Size == 256) { + for (i = 0; i < n; i++) { + rgba[i][RCOMP] = lut[rgba[i][RCOMP] * 3 + 0]; + rgba[i][GCOMP] = lut[rgba[i][GCOMP] * 3 + 1]; + rgba[i][BCOMP] = lut[rgba[i][BCOMP] * 3 + 2]; } - else { -#if CHAN_TYPE == GL_UNSIGNED_BYTE - if (table->Size == 256) { - /* common case */ - const GLchan *lut = (const GLchan *) table->Table; - GLuint i; - for (i = 0; i < n; i++) { - rgba[i][RCOMP] = lut[rgba[i][RCOMP] * 4 + 0]; - rgba[i][GCOMP] = lut[rgba[i][GCOMP] * 4 + 1]; - rgba[i][BCOMP] = lut[rgba[i][BCOMP] * 4 + 2]; - rgba[i][ACOMP] = lut[rgba[i][ACOMP] * 4 + 3]; - } - } - else -#endif - { - const GLfloat scale = (GLfloat) (table->Size - 1) / CHAN_MAXF; - const GLfloat *lut = (const GLfloat *) table->Table; - GLuint i; - for (i = 0; i < n; i++) { - GLint jR = IROUND((GLfloat) rgba[i][RCOMP] * scale); - GLint jG = IROUND((GLfloat) rgba[i][GCOMP] * scale); - GLint jB = IROUND((GLfloat) rgba[i][BCOMP] * scale); - GLint jA = IROUND((GLfloat) rgba[i][ACOMP] * scale); - CLAMPED_FLOAT_TO_CHAN(rgba[i][RCOMP], lut[jR * 4 + 0]); - CLAMPED_FLOAT_TO_CHAN(rgba[i][GCOMP], lut[jG * 4 + 1]); - CLAMPED_FLOAT_TO_CHAN(rgba[i][BCOMP], lut[jB * 4 + 2]); - CLAMPED_FLOAT_TO_CHAN(rgba[i][ACOMP], lut[jA * 4 + 3]); - } - } + } + else { + for (i = 0; i < n; i++) { + GLint jR = IROUND((GLfloat) rgba[i][RCOMP] * scale); + GLint jG = IROUND((GLfloat) rgba[i][GCOMP] * scale); + GLint jB = IROUND((GLfloat) rgba[i][BCOMP] * scale); + rgba[i][RCOMP] = lut[jR * 3 + 0]; + rgba[i][GCOMP] = lut[jG * 3 + 1]; + rgba[i][BCOMP] = lut[jB * 3 + 2]; } - break; - default: - _mesa_problem(NULL, "Bad format in _mesa_lookup_rgba_chan"); - return; - } -} - - - -/* - * Apply color index shift and offset to an array of pixels. - */ -void -_mesa_shift_and_offset_ci( const GLcontext *ctx, GLuint n, GLuint indexes[] ) -{ - GLint shift = ctx->Pixel.IndexShift; - GLint offset = ctx->Pixel.IndexOffset; - GLuint i; - if (shift > 0) { - for (i=0;i> shift) + offset; + break; + case GL_RGBA: + if (table->Size == 256) { + for (i = 0; i < n; i++) { + rgba[i][RCOMP] = lut[rgba[i][RCOMP] * 4 + 0]; + rgba[i][GCOMP] = lut[rgba[i][GCOMP] * 4 + 1]; + rgba[i][BCOMP] = lut[rgba[i][BCOMP] * 4 + 2]; + rgba[i][ACOMP] = lut[rgba[i][ACOMP] * 4 + 3]; + } } - } - else { - for (i=0;iPixel.MapItoIsize - 1; - GLuint i; - for (i = 0; i < n; i++) { - const GLuint j = index[i] & mask; - index[i] = IROUND(ctx->Pixel.MapItoI[j]); - } -} - - -/* - * Map color indexes to rgba values. - */ -void -_mesa_map_ci_to_rgba_chan( const GLcontext *ctx, GLuint n, - const GLuint index[], GLchan rgba[][4] ) -{ -#if CHAN_BITS == 8 - GLuint rmask = ctx->Pixel.MapItoRsize - 1; - GLuint gmask = ctx->Pixel.MapItoGsize - 1; - GLuint bmask = ctx->Pixel.MapItoBsize - 1; - GLuint amask = ctx->Pixel.MapItoAsize - 1; - const GLubyte *rMap = ctx->Pixel.MapItoR8; - const GLubyte *gMap = ctx->Pixel.MapItoG8; - const GLubyte *bMap = ctx->Pixel.MapItoB8; - const GLubyte *aMap = ctx->Pixel.MapItoA8; - GLuint i; - for (i=0;iPixel.MapItoRsize - 1; - GLuint gmask = ctx->Pixel.MapItoGsize - 1; - GLuint bmask = ctx->Pixel.MapItoBsize - 1; - GLuint amask = ctx->Pixel.MapItoAsize - 1; - const GLfloat *rMap = ctx->Pixel.MapItoR; - const GLfloat *gMap = ctx->Pixel.MapItoG; - const GLfloat *bMap = ctx->Pixel.MapItoB; - const GLfloat *aMap = ctx->Pixel.MapItoA; - GLuint i; - for (i=0;iPixel.MapItoRsize - 1; GLuint gmask = ctx->Pixel.MapItoGsize - 1; GLuint bmask = ctx->Pixel.MapItoBsize - 1; @@ -1780,61 +1453,6 @@ _mesa_map_ci8_to_rgba( const GLcontext *ctx, GLuint n, const GLubyte index[], rgba[i][BCOMP] = bMap[index[i] & bmask]; rgba[i][ACOMP] = aMap[index[i] & amask]; } -#else - GLuint rmask = ctx->Pixel.MapItoRsize - 1; - GLuint gmask = ctx->Pixel.MapItoGsize - 1; - GLuint bmask = ctx->Pixel.MapItoBsize - 1; - GLuint amask = ctx->Pixel.MapItoAsize - 1; - const GLfloat *rMap = ctx->Pixel.MapItoR; - const GLfloat *gMap = ctx->Pixel.MapItoG; - const GLfloat *bMap = ctx->Pixel.MapItoB; - const GLfloat *aMap = ctx->Pixel.MapItoA; - GLuint i; - for (i=0;iPixel.IndexShift; - GLint offset = ctx->Pixel.IndexOffset; - if (shift > 0) { - for (i=0;i> shift) + offset; - } - } - else { - for (i=0;iPixel.MapStoSsize - 1; - GLuint i; - for (i=0;iPixel.MapStoS[ stencil[i] & mask ]; - } } @@ -1852,52 +1470,6 @@ _mesa_scale_and_bias_depth(const GLcontext *ctx, GLuint n, } -/* - * This function converts an array of GLchan colors to GLfloat colors. - * Most importantly, it undoes the non-uniform quantization of pixel - * values introduced when we convert shallow (< 8 bit) pixel values - * to GLubytes in the ctx->Driver.ReadRGBASpan() functions. - * This fixes a number of OpenGL conformance failures when running on - * 16bpp displays, for example. - */ -void -_mesa_chan_to_float_span(const GLcontext *ctx, GLuint n, - CONST GLchan rgba[][4], GLfloat rgbaf[][4]) -{ -#if CHAN_TYPE == GL_FLOAT - MEMCPY(rgbaf, rgba, n * 4 * sizeof(GLfloat)); -#else - const GLuint rShift = CHAN_BITS - ctx->Visual.redBits; - const GLuint gShift = CHAN_BITS - ctx->Visual.greenBits; - const GLuint bShift = CHAN_BITS - ctx->Visual.blueBits; - GLuint aShift; - const GLfloat rScale = 1.0F / (GLfloat) ((1 << ctx->Visual.redBits ) - 1); - const GLfloat gScale = 1.0F / (GLfloat) ((1 << ctx->Visual.greenBits) - 1); - const GLfloat bScale = 1.0F / (GLfloat) ((1 << ctx->Visual.blueBits ) - 1); - GLfloat aScale; - GLuint i; - - if (ctx->Visual.alphaBits > 0) { - aShift = CHAN_BITS - ctx->Visual.alphaBits; - aScale = 1.0F / (GLfloat) ((1 << ctx->Visual.alphaBits) - 1); - } - else { - aShift = 0; - aScale = 1.0F / CHAN_MAXF; - } - - for (i = 0; i < n; i++) { - const GLint r = rgba[i][RCOMP] >> rShift; - const GLint g = rgba[i][GCOMP] >> gShift; - const GLint b = rgba[i][BCOMP] >> bShift; - const GLint a = rgba[i][ACOMP] >> aShift; - rgbaf[i][RCOMP] = (GLfloat) r * rScale; - rgbaf[i][GCOMP] = (GLfloat) g * gScale; - rgbaf[i][BCOMP] = (GLfloat) b * bScale; - rgbaf[i][ACOMP] = (GLfloat) a * aScale; - } -#endif -} /**********************************************************************/ /***** State Management *****/ diff --git a/src/mesa/main/pixel.h b/src/mesa/main/pixel.h index 161990024b9..09155cfd70d 100644 --- a/src/mesa/main/pixel.h +++ b/src/mesa/main/pixel.h @@ -5,9 +5,9 @@ /* * Mesa 3-D graphics library - * Version: 6.5 + * Version: 6.5.2 * - * Copyright (C) 1999-2005 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2006 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"), @@ -98,23 +98,8 @@ _mesa_lookup_rgba_float(const struct gl_color_table *table, GLuint n, GLfloat rgba[][4]); extern void -_mesa_lookup_rgba_chan(const struct gl_color_table *table, - GLuint n, GLchan rgba[][4]); - - -extern void -_mesa_shift_and_offset_ci(const GLcontext *ctx, GLuint n, - GLuint indexes[]); - - -extern void -_mesa_map_ci(const GLcontext *ctx, GLuint n, GLuint index[]); - - -extern void -_mesa_map_ci_to_rgba_chan(const GLcontext *ctx, - GLuint n, const GLuint index[], - GLchan rgba[][4]); +_mesa_lookup_rgba_ubyte(const struct gl_color_table *table, + GLuint n, GLubyte rgba[][4]); extern void @@ -123,18 +108,8 @@ _mesa_map_ci_to_rgba(const GLcontext *ctx, extern void -_mesa_map_ci8_to_rgba(const GLcontext *ctx, - GLuint n, const GLubyte index[], - GLchan rgba[][4]); - - -extern void -_mesa_shift_and_offset_stencil(const GLcontext *ctx, GLuint n, - GLstencil indexes[]); - - -extern void -_mesa_map_stencil(const GLcontext *ctx, GLuint n, GLstencil index[]); +_mesa_map_ci8_to_rgba8(const GLcontext *ctx, GLuint n, const GLubyte index[], + GLubyte rgba[][4]); extern void @@ -142,11 +117,6 @@ _mesa_scale_and_bias_depth(const GLcontext *ctx, GLuint n, GLfloat depthValues[]); -extern void -_mesa_chan_to_float_span(const GLcontext *ctx, GLuint n, - CONST GLchan rgba[][4], GLfloat rgbaf[][4]); - - extern void _mesa_update_pixel( GLcontext *ctx, GLuint newstate ); diff --git a/src/mesa/main/rastpos.c b/src/mesa/main/rastpos.c index 4f490db724f..ddf2ac51d3b 100644 --- a/src/mesa/main/rastpos.c +++ b/src/mesa/main/rastpos.c @@ -994,6 +994,7 @@ void _mesa_init_rastpos( GLcontext * ctx ) ASSIGN_4V( ctx->Current.RasterPos, 0.0, 0.0, 0.0, 1.0 ); ctx->Current.RasterDistance = 0.0; ASSIGN_4V( ctx->Current.RasterColor, 1.0, 1.0, 1.0, 1.0 ); + ASSIGN_4V( ctx->Current.RasterSecondaryColor, 0.0, 0.0, 0.0, 1.0 ); ctx->Current.RasterIndex = 1.0; for (i=0; iCurrent.RasterTexCoords[i], 0.0, 0.0, 0.0, 1.0 ); diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c index b40a5dc5517..e62fbe47d15 100644 --- a/src/mesa/main/state.c +++ b/src/mesa/main/state.c @@ -304,7 +304,6 @@ _mesa_init_exec_table(struct _glapi_table *exec) SET_GenTextures(exec, _mesa_GenTextures); #if _HAVE_FULL_GL SET_AreTexturesResident(exec, _mesa_AreTexturesResident); - SET_AreTexturesResidentEXT(exec, _mesa_AreTexturesResident); SET_ColorPointer(exec, _mesa_ColorPointer); SET_CopyTexImage1D(exec, _mesa_CopyTexImage1D); SET_CopyTexImage2D(exec, _mesa_CopyTexImage2D); @@ -313,12 +312,10 @@ _mesa_init_exec_table(struct _glapi_table *exec) SET_DisableClientState(exec, _mesa_DisableClientState); SET_EdgeFlagPointer(exec, _mesa_EdgeFlagPointer); SET_EnableClientState(exec, _mesa_EnableClientState); - SET_GenTexturesEXT(exec, _mesa_GenTextures); SET_GetPointerv(exec, _mesa_GetPointerv); SET_IndexPointer(exec, _mesa_IndexPointer); SET_InterleavedArrays(exec, _mesa_InterleavedArrays); SET_IsTexture(exec, _mesa_IsTexture); - SET_IsTextureEXT(exec, _mesa_IsTexture); SET_NormalPointer(exec, _mesa_NormalPointer); SET_PopClientAttrib(exec, _mesa_PopClientAttrib); SET_PrioritizeTextures(exec, _mesa_PrioritizeTextures); @@ -356,31 +353,18 @@ _mesa_init_exec_table(struct _glapi_table *exec) SET_CopyConvolutionFilter1D(exec, _mesa_CopyConvolutionFilter1D); SET_CopyConvolutionFilter2D(exec, _mesa_CopyConvolutionFilter2D); SET_GetColorTable(exec, _mesa_GetColorTable); - SET_GetColorTableSGI(exec, _mesa_GetColorTable); SET_GetColorTableParameterfv(exec, _mesa_GetColorTableParameterfv); - SET_GetColorTableParameterfvSGI(exec, _mesa_GetColorTableParameterfv); SET_GetColorTableParameteriv(exec, _mesa_GetColorTableParameteriv); - SET_GetColorTableParameterivSGI(exec, _mesa_GetColorTableParameteriv); SET_GetConvolutionFilter(exec, _mesa_GetConvolutionFilter); - SET_GetConvolutionFilterEXT(exec, _mesa_GetConvolutionFilter); SET_GetConvolutionParameterfv(exec, _mesa_GetConvolutionParameterfv); - SET_GetConvolutionParameterfvEXT(exec, _mesa_GetConvolutionParameterfv); SET_GetConvolutionParameteriv(exec, _mesa_GetConvolutionParameteriv); - SET_GetConvolutionParameterivEXT(exec, _mesa_GetConvolutionParameteriv); SET_GetHistogram(exec, _mesa_GetHistogram); - SET_GetHistogramEXT(exec, _mesa_GetHistogram); SET_GetHistogramParameterfv(exec, _mesa_GetHistogramParameterfv); - SET_GetHistogramParameterfvEXT(exec, _mesa_GetHistogramParameterfv); SET_GetHistogramParameteriv(exec, _mesa_GetHistogramParameteriv); - SET_GetHistogramParameterivEXT(exec, _mesa_GetHistogramParameteriv); SET_GetMinmax(exec, _mesa_GetMinmax); - SET_GetMinmaxEXT(exec, _mesa_GetMinmax); SET_GetMinmaxParameterfv(exec, _mesa_GetMinmaxParameterfv); - SET_GetMinmaxParameterfvEXT(exec, _mesa_GetMinmaxParameterfv); SET_GetMinmaxParameteriv(exec, _mesa_GetMinmaxParameteriv); - SET_GetMinmaxParameterivEXT(exec, _mesa_GetMinmaxParameteriv); SET_GetSeparableFilter(exec, _mesa_GetSeparableFilter); - SET_GetSeparableFilterEXT(exec, _mesa_GetSeparableFilter); SET_Histogram(exec, _mesa_Histogram); SET_Minmax(exec, _mesa_Minmax); SET_ResetHistogram(exec, _mesa_ResetHistogram); @@ -392,6 +376,32 @@ _mesa_init_exec_table(struct _glapi_table *exec) SET_StencilFuncSeparate(exec, _mesa_StencilFuncSeparate); SET_StencilMaskSeparate(exec, _mesa_StencilMaskSeparate); SET_StencilOpSeparate(exec, _mesa_StencilOpSeparate); +#if FEATURE_ARB_shader_objects + SET_AttachShader(exec, _mesa_AttachShader); + SET_CreateProgram(exec, _mesa_CreateProgram); + SET_CreateShader(exec, _mesa_CreateShader); + SET_DeleteProgram(exec, _mesa_DeleteProgram); + SET_DeleteShader(exec, _mesa_DeleteShader); + SET_DetachShader(exec, _mesa_DetachShader); + SET_GetAttachedShaders(exec, _mesa_GetAttachedShaders); + SET_GetProgramiv(exec, _mesa_GetProgramiv); + SET_GetProgramInfoLog(exec, _mesa_GetProgramInfoLog); + SET_GetShaderiv(exec, _mesa_GetShaderiv); + SET_GetShaderInfoLog(exec, _mesa_GetShaderInfoLog); + SET_IsProgram(exec, _mesa_IsProgram); + SET_IsShader(exec, _mesa_IsShader); +#endif + + /* OpenGL 2.1 */ +#if FEATURE_ARB_shader_objects + SET_UniformMatrix2x3fv(exec, _mesa_UniformMatrix2x3fv); + SET_UniformMatrix3x2fv(exec, _mesa_UniformMatrix3x2fv); + SET_UniformMatrix2x4fv(exec, _mesa_UniformMatrix2x4fv); + SET_UniformMatrix4x2fv(exec, _mesa_UniformMatrix4x2fv); + SET_UniformMatrix3x4fv(exec, _mesa_UniformMatrix3x4fv); + SET_UniformMatrix4x3fv(exec, _mesa_UniformMatrix4x3fv); +#endif + /* 2. GL_EXT_blend_color */ #if 0 @@ -411,7 +421,7 @@ _mesa_init_exec_table(struct _glapi_table *exec) #endif /* 11. GL_EXT_histogram */ -#if _HAVE_FULL_GL +#if 0 SET_GetHistogramEXT(exec, _mesa_GetHistogram); SET_GetHistogramParameterfvEXT(exec, _mesa_GetHistogramParameterfv); SET_GetHistogramParameterivEXT(exec, _mesa_GetHistogramParameteriv); @@ -424,8 +434,6 @@ _mesa_init_exec_table(struct _glapi_table *exec) #if 0 SET_ColorTableSGI(exec, _mesa_ColorTable); SET_ColorSubTableSGI(exec, _mesa_ColorSubTable); -#endif -#if _HAVE_FULL_GL SET_GetColorTableSGI(exec, _mesa_GetColorTable); SET_GetColorTableParameterfvSGI(exec, _mesa_GetColorTableParameterfv); SET_GetColorTableParameterivSGI(exec, _mesa_GetColorTableParameteriv); @@ -525,7 +533,7 @@ _mesa_init_exec_table(struct _glapi_table *exec) SET_GetVertexAttribfvNV(exec, _mesa_GetVertexAttribfvNV); SET_GetVertexAttribivNV(exec, _mesa_GetVertexAttribivNV); SET_GetVertexAttribPointervNV(exec, _mesa_GetVertexAttribPointervNV); - SET_IsProgramNV(exec, _mesa_IsProgram); + SET_IsProgramNV(exec, _mesa_IsProgramARB); SET_LoadProgramNV(exec, _mesa_LoadProgramNV); SET_ProgramParameter4dNV(exec, _mesa_ProgramParameter4dNV); SET_ProgramParameter4dvNV(exec, _mesa_ProgramParameter4dvNV); @@ -1001,9 +1009,7 @@ update_color(GLcontext *ctx) /* This is needed to support 1.1's RGB logic ops AND * 1.0's blending logicops. */ - ctx->Color._LogicOpEnabled = (ctx->Color.ColorLogicOpEnabled || - (ctx->Color.BlendEnabled && - ctx->Color.BlendEquationRGB == GL_LOGIC_OP)); + ctx->Color._LogicOpEnabled = RGBA_LOGICOP_ENABLED(ctx); } @@ -1021,7 +1027,7 @@ update_color(GLcontext *ctx) * _mesa_update_lighting() and _mesa_update_tnl_spaces(). */ void -_mesa_update_state( GLcontext *ctx ) +_mesa_update_state_locked( GLcontext *ctx ) { GLbitfield new_state = ctx->NewState; @@ -1102,4 +1108,17 @@ _mesa_update_state( GLcontext *ctx ) ctx->Array.NewState = 0; } + +/* This is the usual entrypoint for state updates: + */ +void +_mesa_update_state( GLcontext *ctx ) +{ + _mesa_lock_context_textures(ctx); + _mesa_update_state_locked(ctx); + _mesa_unlock_context_textures(ctx); +} + + + /*@}*/ diff --git a/src/mesa/main/state.h b/src/mesa/main/state.h index 58cfcc41462..5240d4bf935 100644 --- a/src/mesa/main/state.h +++ b/src/mesa/main/state.h @@ -39,5 +39,11 @@ _mesa_init_exec_table(struct _glapi_table *exec); extern void _mesa_update_state( GLcontext *ctx ); +/* As above but can only be called between _mesa_lock_context_textures() and + * _mesa_unlock_context_textures(). + */ +extern void +_mesa_update_state_locked( GLcontext *ctx ); + #endif diff --git a/src/mesa/main/stencil.c b/src/mesa/main/stencil.c index 9992ec9b6eb..ad71a81f6e0 100644 --- a/src/mesa/main/stencil.c +++ b/src/mesa/main/stencil.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.5 + * Version: 6.5.2 * - * Copyright (C) 1999-2005 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2006 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"), @@ -38,6 +38,10 @@ * * So either we advertise the GL_EXT_stencil_two_side extension, or OpenGL * 2.0, but not both. + * + * Also, note that GL_ATI_separate_stencil is different as well: + * glStencilFuncSeparateATI(GLenum frontfunc, GLenum backfunc, ...) vs. + * glStencilFuncSeparate(GLenum face, GLenum func, ...). */ @@ -406,17 +410,16 @@ _mesa_StencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass) FLUSH_VERTICES(ctx, _NEW_STENCIL); - if (face == GL_FRONT || face == GL_FRONT_AND_BACK) { + if (face != GL_BACK) { ctx->Stencil.FailFunc[0] = fail; ctx->Stencil.ZFailFunc[0] = zfail; ctx->Stencil.ZPassFunc[0] = zpass; } - if (face == GL_BACK || face == GL_FRONT_AND_BACK) { + if (face != GL_FRONT) { ctx->Stencil.FailFunc[1] = fail; ctx->Stencil.ZFailFunc[1] = zfail; ctx->Stencil.ZPassFunc[1] = zpass; } - if (ctx->Driver.StencilOpSeparate) { ctx->Driver.StencilOpSeparate(ctx, face, fail, zfail, zpass); } @@ -465,7 +468,6 @@ _mesa_StencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask) ctx->Stencil.Ref[1] = ref; ctx->Stencil.ValueMask[1] = mask; } - if (ctx->Driver.StencilFuncSeparate) { ctx->Driver.StencilFuncSeparate(ctx, face, func, ref, mask); } @@ -486,13 +488,12 @@ _mesa_StencilMaskSeparate(GLenum face, GLuint mask) FLUSH_VERTICES(ctx, _NEW_STENCIL); - if (face == GL_FRONT || face == GL_FRONT_AND_BACK) { + if (face != GL_BACK) { ctx->Stencil.WriteMask[0] = mask; } - if (face == GL_BACK || face == GL_FRONT_AND_BACK) { + if (face != GL_FRONT) { ctx->Stencil.WriteMask[1] = mask; } - if (ctx->Driver.StencilMaskSeparate) { ctx->Driver.StencilMaskSeparate(ctx, face, mask); } diff --git a/src/mesa/main/texcompress.c b/src/mesa/main/texcompress.c index d5943080245..c44d594d683 100644 --- a/src/mesa/main/texcompress.c +++ b/src/mesa/main/texcompress.c @@ -34,6 +34,7 @@ #include "colormac.h" #include "context.h" #include "image.h" +#include "mipmap.h" #include "texcompress.h" #include "texformat.h" #include "texstore.h" diff --git a/src/mesa/main/texcompress_fxt1.c b/src/mesa/main/texcompress_fxt1.c index 18180e12eaf..2ac2c80a082 100644 --- a/src/mesa/main/texcompress_fxt1.c +++ b/src/mesa/main/texcompress_fxt1.c @@ -35,6 +35,7 @@ #include "context.h" #include "convolve.h" #include "image.h" +#include "mipmap.h" #include "texcompress.h" #include "texformat.h" #include "texstore.h" diff --git a/src/mesa/main/texcompress_s3tc.c b/src/mesa/main/texcompress_s3tc.c index 3ccc8a8df75..99b703de4a5 100644 --- a/src/mesa/main/texcompress_s3tc.c +++ b/src/mesa/main/texcompress_s3tc.c @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.5.1 + * Version: 6.5.2 * * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. * @@ -48,6 +48,8 @@ #ifdef __MINGW32__ #define DXTN_LIBNAME "dxtn.dll" +#define RTLD_LAZY 0 +#define RTLD_GLOBAL 0 #elif defined(__DJGPP__) #define DXTN_LIBNAME "dxtn.dxe" #else @@ -104,7 +106,7 @@ _mesa_dlsym(void *handle, const char *fname) { #if USE_EXTERNAL_DXTN_LIB #ifdef __MINGW32__ - return (GenericFunc) GetProcAddress(handle, fname) + return (GenericFunc) GetProcAddress(handle, fname); #elif defined(__DJGPP__) /* need '_' prefix on symbol names */ char fname2[1000]; diff --git a/src/mesa/main/texenvprogram.c b/src/mesa/main/texenvprogram.c index 5f798cc7df4..c99ff5cdc46 100644 --- a/src/mesa/main/texenvprogram.c +++ b/src/mesa/main/texenvprogram.c @@ -33,7 +33,11 @@ #include "shader/program.h" #include "shader/program_instruction.h" -#define MAX_INSTRUCTIONS 100 +/** + * According to Glean's texCombine test, no more than 21 instructions + * are needed. Allow a few extra just in case. + */ +#define MAX_INSTRUCTIONS 24 #define DISASSEM (MESA_VERBOSE & VERBOSE_DISASSEM) @@ -474,7 +478,7 @@ emit_op(struct texenv_fragment_program *p, GLuint nr = p->program->Base.NumInstructions++; struct prog_instruction *inst = &p->program->Base.Instructions[nr]; - _mesa_init_instruction(inst); + _mesa_init_instructions(inst, 1); inst->Opcode = op; emit_arg( &inst->SrcReg[0], src0 ); @@ -988,9 +992,10 @@ load_texunit_sources( struct texenv_fragment_program *p, int unit ) * current texture env/combine mode. */ static void -create_new_program(struct state_key *key, GLcontext *ctx, +create_new_program(GLcontext *ctx, struct state_key *key, struct gl_fragment_program *program) { + struct prog_instruction instBuffer[MAX_INSTRUCTIONS]; struct texenv_fragment_program p; GLuint unit; struct ureg cf, out; @@ -1000,18 +1005,19 @@ create_new_program(struct state_key *key, GLcontext *ctx, p.state = key; p.program = program; - p.program->Base.Instructions = - (struct prog_instruction*) _mesa_malloc(sizeof(struct prog_instruction) * MAX_INSTRUCTIONS); - p.program->Base.NumInstructions = 0; + /* During code generation, use locally-allocated instruction buffer, + * then alloc dynamic storage below. + */ + p.program->Base.Instructions = instBuffer; p.program->Base.Target = GL_FRAGMENT_PROGRAM_ARB; p.program->NumTexIndirections = 1; /* correct? */ p.program->NumTexInstructions = 0; p.program->NumAluInstructions = 0; p.program->Base.String = 0; p.program->Base.NumInstructions = - p.program->Base.NumTemporaries = - p.program->Base.NumParameters = - p.program->Base.NumAttributes = p.program->Base.NumAddressRegs = 0; + p.program->Base.NumTemporaries = + p.program->Base.NumParameters = + p.program->Base.NumAttributes = p.program->Base.NumAddressRegs = 0; p.program->Base.Parameters = _mesa_new_parameter_list(); p.program->Base.InputsRead = 0; @@ -1088,17 +1094,28 @@ create_new_program(struct state_key *key, GLcontext *ctx, ASSERT(p.program->Base.NumInstructions <= MAX_INSTRUCTIONS); + /* Allocate final instruction array */ + program->Base.Instructions + = _mesa_alloc_instructions(program->Base.NumInstructions); + if (!program->Base.Instructions) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, + "generating tex env program"); + return; + } + _mesa_memcpy(program->Base.Instructions, instBuffer, + sizeof(struct prog_instruction) + * program->Base.NumInstructions); + /* Notify driver the fragment program has (actually) changed. */ - if (ctx->Driver.ProgramStringNotify || DISASSEM) { - if (ctx->Driver.ProgramStringNotify) - ctx->Driver.ProgramStringNotify( ctx, GL_FRAGMENT_PROGRAM_ARB, - &p.program->Base ); - - if (DISASSEM) { - _mesa_print_program(&p.program->Base); - _mesa_printf("\n"); - } + if (ctx->Driver.ProgramStringNotify) { + ctx->Driver.ProgramStringNotify( ctx, GL_FRAGMENT_PROGRAM_ARB, + &p.program->Base ); + } + + if (DISASSEM) { + _mesa_print_program(&p.program->Base); + _mesa_printf("\n"); } } @@ -1225,7 +1242,7 @@ void _mesa_UpdateTexEnvProgram( GLcontext *ctx ) (struct gl_fragment_program *) ctx->Driver.NewProgram(ctx, GL_FRAGMENT_PROGRAM_ARB, 0); - create_new_program(&key, ctx, ctx->_TexEnvProgram); + create_new_program(ctx, &key, ctx->_TexEnvProgram); cache_item(&ctx->Texture.env_fp_cache, hash, &key, ctx->_TexEnvProgram); } else { diff --git a/src/mesa/main/texformat_tmp.h b/src/mesa/main/texformat_tmp.h index 0d3519188e2..99785da1a0a 100644 --- a/src/mesa/main/texformat_tmp.h +++ b/src/mesa/main/texformat_tmp.h @@ -1060,6 +1060,7 @@ static void FETCH(ci8)( const struct gl_texture_image *texImage, { const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1); const struct gl_color_table *palette; + GLubyte texelUB[4]; GLuint index; GET_CURRENT_CONTEXT(ctx); @@ -1075,91 +1076,61 @@ static void FETCH(ci8)( const struct gl_texture_image *texImage, /* Mask the index against size of palette to avoid going out of bounds */ index = (*src) & (palette->Size - 1); - if (palette->Type == GL_FLOAT) { - const GLfloat *ftable = (const GLfloat *) palette->Table; + { + const GLubyte *table = palette->TableUB; switch (palette->_BaseFormat) { case GL_ALPHA: - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = 0; - texel[ACOMP] = (GLchan) (ftable[index] * CHAN_MAX); - return; + texelUB[RCOMP] = + texelUB[GCOMP] = + texelUB[BCOMP] = 0; + texelUB[ACOMP] = table[index]; + break;; case GL_LUMINANCE: - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = (GLchan) (ftable[index] * CHAN_MAX); - texel[ACOMP] = CHAN_MAX; + texelUB[RCOMP] = + texelUB[GCOMP] = + texelUB[BCOMP] = table[index]; + texelUB[ACOMP] = 255; break; case GL_INTENSITY: - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = - texel[ACOMP] = ftable[index] * CHAN_MAX; - return; + texelUB[RCOMP] = + texelUB[GCOMP] = + texelUB[BCOMP] = + texelUB[ACOMP] = table[index]; + break;; case GL_LUMINANCE_ALPHA: - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = (GLchan) (ftable[index * 2 + 0] * CHAN_MAX); - texel[ACOMP] = (GLchan) (ftable[index * 2 + 1] * CHAN_MAX); - return; + texelUB[RCOMP] = + texelUB[GCOMP] = + texelUB[BCOMP] = table[index * 2 + 0]; + texelUB[ACOMP] = table[index * 2 + 1]; + break;; case GL_RGB: - texel[RCOMP] = (GLchan) (ftable[index * 3 + 0] * CHAN_MAX); - texel[GCOMP] = (GLchan) (ftable[index * 3 + 1] * CHAN_MAX); - texel[BCOMP] = (GLchan) (ftable[index * 3 + 2] * CHAN_MAX); - texel[ACOMP] = CHAN_MAX; - return; + texelUB[RCOMP] = table[index * 3 + 0]; + texelUB[GCOMP] = table[index * 3 + 1]; + texelUB[BCOMP] = table[index * 3 + 2]; + texelUB[ACOMP] = 255; + break;; case GL_RGBA: - texel[RCOMP] = (GLchan) (ftable[index * 4 + 0] * CHAN_MAX); - texel[GCOMP] = (GLchan) (ftable[index * 4 + 1] * CHAN_MAX); - texel[BCOMP] = (GLchan) (ftable[index * 4 + 2] * CHAN_MAX); - texel[ACOMP] = (GLchan) (ftable[index * 4 + 3] * CHAN_MAX); - return; - default: - _mesa_problem(ctx, "Bad palette format in fetch_texel_ci8"); - } - } - else { - const GLchan *table = (const GLchan *) palette->Table; - switch (palette->_BaseFormat) { - case GL_ALPHA: - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = 0; - texel[ACOMP] = table[index]; - return; - case GL_LUMINANCE: - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = table[index]; - texel[ACOMP] = CHAN_MAX; - break; - case GL_INTENSITY: - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = - texel[ACOMP] = table[index]; - return; - case GL_LUMINANCE_ALPHA: - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = table[index * 2 + 0]; - texel[ACOMP] = table[index * 2 + 1]; - return; - case GL_RGB: - texel[RCOMP] = table[index * 3 + 0]; - texel[GCOMP] = table[index * 3 + 1]; - texel[BCOMP] = table[index * 3 + 2]; - texel[ACOMP] = CHAN_MAX; - return; - case GL_RGBA: - texel[RCOMP] = table[index * 4 + 0]; - texel[GCOMP] = table[index * 4 + 1]; - texel[BCOMP] = table[index * 4 + 2]; - texel[ACOMP] = table[index * 4 + 3]; - return; + texelUB[RCOMP] = table[index * 4 + 0]; + texelUB[GCOMP] = table[index * 4 + 1]; + texelUB[BCOMP] = table[index * 4 + 2]; + texelUB[ACOMP] = table[index * 4 + 3]; + break;; default: _mesa_problem(ctx, "Bad palette format in fetch_texel_ci8"); } +#if CHAN_TYPE == GL_UNSIGNED_BYTE + COPY_4UBV(texel, texelUB); +#elif CHAN_TYPE == GL_UNSIGNED_SHORT + texel[0] = UBYTE_TO_USHORT(texelUB[0]); + texel[1] = UBYTE_TO_USHORT(texelUB[1]); + texel[2] = UBYTE_TO_USHORT(texelUB[2]); + texel[3] = UBYTE_TO_USHORT(texelUB[3]); +#else + texel[0] = UBYTE_TO_FLOAT(texelUB[0]); + texel[1] = UBYTE_TO_FLOAT(texelUB[1]); + texel[2] = UBYTE_TO_FLOAT(texelUB[2]); + texel[3] = UBYTE_TO_FLOAT(texelUB[3]); +#endif } } diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 14024fec047..543d6efc984 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -73,11 +73,11 @@ _mesa_free_texmemory(void *m) #if 0 static void PrintTexture(GLcontext *ctx, const struct gl_texture_image *img) { -#if CHAN_TYPE == GL_FLOAT - _mesa_problem(NULL, "PrintTexture doesn't support float channels"); +#if CHAN_TYPE != GL_UNSIGNED_BYTE + _mesa_problem(NULL, "PrintTexture not supported"); #else GLuint i, j, c; - const GLchan *data = (const GLchan *) img->Data; + const GLubyte *data = (const GLubyte *) img->Data; if (!data) { _mesa_printf("No texture data\n"); @@ -706,9 +706,12 @@ _mesa_free_texture_image_data(GLcontext *ctx, void _mesa_delete_texture_image( GLcontext *ctx, struct gl_texture_image *texImage ) { - if (texImage->Data) { - ctx->Driver.FreeTexImageData( ctx, texImage ); - } + /* Free texImage->Data and/or any other driver-specific texture + * image storage. + */ + ASSERT(ctx->Driver.FreeTexImageData); + ctx->Driver.FreeTexImageData( ctx, texImage ); + ASSERT(texImage->Data == NULL); if (texImage->ImageOffsets) _mesa_free(texImage->ImageOffsets); @@ -801,24 +804,23 @@ _mesa_select_tex_object(GLcontext *ctx, const struct gl_texture_unit *texUnit, * \sa gl_texture_unit. */ struct gl_texture_image * -_mesa_select_tex_image(GLcontext *ctx, const struct gl_texture_unit *texUnit, - GLenum target, GLint level) +_mesa_select_tex_image(GLcontext *ctx, const struct gl_texture_object *texObj, + GLenum target, GLint level) { - ASSERT(texUnit); - ASSERT(level < MAX_TEXTURE_LEVELS); + ASSERT(texObj); + + if (level < 0 || level >= MAX_TEXTURE_LEVELS) + return NULL; + switch (target) { case GL_TEXTURE_1D: - return texUnit->Current1D->Image[0][level]; case GL_PROXY_TEXTURE_1D: - return ctx->Texture.Proxy1D->Image[0][level]; case GL_TEXTURE_2D: - return texUnit->Current2D->Image[0][level]; case GL_PROXY_TEXTURE_2D: - return ctx->Texture.Proxy2D->Image[0][level]; case GL_TEXTURE_3D: - return texUnit->Current3D->Image[0][level]; case GL_PROXY_TEXTURE_3D: - return ctx->Texture.Proxy3D->Image[0][level]; + return texObj->Image[0][level]; + case GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB: case GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB: case GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB: @@ -828,33 +830,25 @@ _mesa_select_tex_image(GLcontext *ctx, const struct gl_texture_unit *texUnit, if (ctx->Extensions.ARB_texture_cube_map) { GLuint face = ((GLuint) target - (GLuint) GL_TEXTURE_CUBE_MAP_POSITIVE_X); - return texUnit->CurrentCubeMap->Image[face][level]; + return texObj->Image[face][level]; } else return NULL; + case GL_PROXY_TEXTURE_CUBE_MAP_ARB: if (ctx->Extensions.ARB_texture_cube_map) - return ctx->Texture.ProxyCubeMap->Image[0][level]; + return texObj->Image[0][level]; else return NULL; + case GL_TEXTURE_RECTANGLE_NV: - if (ctx->Extensions.NV_texture_rectangle) { - ASSERT(level == 0); - return texUnit->CurrentRect->Image[0][level]; - } - else { - return NULL; - } case GL_PROXY_TEXTURE_RECTANGLE_NV: - if (ctx->Extensions.NV_texture_rectangle) { - ASSERT(level == 0); - return ctx->Texture.ProxyRect->Image[0][level]; - } - else { + if (ctx->Extensions.NV_texture_rectangle && level == 0) + return texObj->Image[0][level]; + else return NULL; - } + default: - _mesa_problem(ctx, "bad target in _mesa_select_tex_image()"); return NULL; } } @@ -866,22 +860,25 @@ _mesa_select_tex_image(GLcontext *ctx, const struct gl_texture_unit *texUnit, * out of memory. */ struct gl_texture_image * -_mesa_get_tex_image(GLcontext *ctx, const struct gl_texture_unit *texUnit, +_mesa_get_tex_image(GLcontext *ctx, struct gl_texture_object *texObj, GLenum target, GLint level) { struct gl_texture_image *texImage; - texImage = _mesa_select_tex_image(ctx, texUnit, target, level); + + if (!texObj) + return NULL; + + texImage = _mesa_select_tex_image(ctx, texObj, target, level); if (!texImage) { - struct gl_texture_object *texObj; texImage = ctx->Driver.NewTextureImage(ctx); if (!texImage) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "texture image allocation"); return NULL; } - texObj = _mesa_select_tex_object(ctx, texUnit, target); - ASSERT(texObj); + _mesa_set_tex_image(texObj, target, level, texImage); } + return texImage; } @@ -1584,9 +1581,6 @@ subtexture_error_check( GLcontext *ctx, GLuint dimensions, GLint width, GLint height, GLint depth, GLenum format, GLenum type ) { - struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - struct gl_texture_image *destTex; - /* Check target */ if (dimensions == 1) { if (target != GL_TEXTURE_1D) { @@ -1596,14 +1590,13 @@ subtexture_error_check( GLcontext *ctx, GLuint dimensions, } else if (dimensions == 2) { if (target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB && - target <=GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB) { + target <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB) { if (!ctx->Extensions.ARB_texture_cube_map) { _mesa_error( ctx, GL_INVALID_ENUM, "glTexSubImage2D(target)" ); return GL_TRUE; } } - else if (ctx->Extensions.NV_texture_rectangle && - target == GL_TEXTURE_RECTANGLE_NV) { + else if (target == GL_TEXTURE_RECTANGLE_NV) { if (!ctx->Extensions.NV_texture_rectangle) { _mesa_error( ctx, GL_INVALID_ENUM, "glTexSubImage2D(target)" ); return GL_TRUE; @@ -1647,8 +1640,23 @@ subtexture_error_check( GLcontext *ctx, GLuint dimensions, return GL_TRUE; } - destTex = _mesa_select_tex_image(ctx, texUnit, target, level); + if (!_mesa_is_legal_format_and_type(ctx, format, type)) { + _mesa_error(ctx, GL_INVALID_ENUM, + "glTexSubImage%dD(format or type)", dimensions); + return GL_TRUE; + } + + return GL_FALSE; +} +static GLboolean +subtexture_error_check2( GLcontext *ctx, GLuint dimensions, + GLenum target, GLint level, + GLint xoffset, GLint yoffset, GLint zoffset, + GLint width, GLint height, GLint depth, + GLenum format, GLenum type, + const struct gl_texture_image *destTex ) +{ if (!destTex) { /* undefined image level */ _mesa_error(ctx, GL_INVALID_OPERATION, "glTexSubImage%dD", dimensions); @@ -1688,12 +1696,6 @@ subtexture_error_check( GLcontext *ctx, GLuint dimensions, } } - if (!_mesa_is_legal_format_and_type(ctx, format, type)) { - _mesa_error(ctx, GL_INVALID_ENUM, - "glTexSubImage%dD(format or type)", dimensions); - return GL_TRUE; - } - #if FEATURE_EXT_texture_sRGB if (destTex->InternalFormat == GL_COMPRESSED_SRGB_S3TC_DXT1_EXT || destTex->InternalFormat == GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT || @@ -1709,11 +1711,6 @@ subtexture_error_check( GLcontext *ctx, GLuint dimensions, #endif if (destTex->IsCompressed) { - const struct gl_texture_unit *texUnit; - const struct gl_texture_image *texImage; - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - texImage = _mesa_select_tex_image(ctx, texUnit, target, level); - if (target == GL_TEXTURE_2D || target == GL_PROXY_TEXTURE_2D) { /* OK */ } @@ -1735,12 +1732,12 @@ subtexture_error_check( GLcontext *ctx, GLuint dimensions, return GL_TRUE; } /* size must be multiple of 4 or equal to whole texture size */ - if ((width & 3) && (GLuint) width != texImage->Width) { + if ((width & 3) && (GLuint) width != destTex->Width) { _mesa_error(ctx, GL_INVALID_OPERATION, "glTexSubImage%D(width)", dimensions); return GL_TRUE; } - if ((height & 3) && (GLuint) height != texImage->Height) { + if ((height & 3) && (GLuint) height != destTex->Height) { _mesa_error(ctx, GL_INVALID_OPERATION, "glTexSubImage%D(width)", dimensions); return GL_TRUE; @@ -1781,6 +1778,11 @@ copytexture_error_check( GLcontext *ctx, GLuint dimensions, /* Basic level check (more checking in ctx->Driver.TestProxyTexImage) */ if (level < 0 || level >= MAX_TEXTURE_LEVELS) { + _mesa_error(ctx, GL_INVALID_VALUE, + "glCopyTexImage%dD(level=%d)", dimensions, level); + return GL_TRUE; + } + /* Check that the source buffer is complete */ if (ctx->ReadBuffer->Name) { _mesa_test_framebuffer_completeness(ctx, ctx->ReadBuffer); @@ -1791,11 +1793,6 @@ copytexture_error_check( GLcontext *ctx, GLuint dimensions, } } - _mesa_error(ctx, GL_INVALID_VALUE, - "glCopyTexImage%dD(level=%d)", dimensions, level); - return GL_TRUE; - } - /* Check border */ if (border < 0 || border > 1 || ((target == GL_TEXTURE_RECTANGLE_NV || @@ -1945,11 +1942,8 @@ static GLboolean copytexsubimage_error_check( GLcontext *ctx, GLuint dimensions, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, - GLsizei width, GLsizei height ) + GLsizei width, GLsizei height) { - struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - struct gl_texture_image *teximage; - /* Check target */ /* Check that the source buffer is complete */ if (ctx->ReadBuffer->Name) { @@ -2012,7 +2006,16 @@ copytexsubimage_error_check( GLcontext *ctx, GLuint dimensions, return GL_TRUE; } - teximage = _mesa_select_tex_image(ctx, texUnit, target, level); + return GL_FALSE; +} + +static GLboolean +copytexsubimage_error_check2( GLcontext *ctx, GLuint dimensions, + GLenum target, GLint level, + GLint xoffset, GLint yoffset, GLint zoffset, + GLsizei width, GLsizei height, + const struct gl_texture_image *teximage ) +{ if (!teximage) { _mesa_error(ctx, GL_INVALID_OPERATION, "glCopyTexSubImage%dD(undefined texture level: %d)", @@ -2186,59 +2189,66 @@ _mesa_GetTexImage( GLenum target, GLint level, GLenum format, if (!pixels) return; - texImage = _mesa_select_tex_image(ctx, texUnit, target, level); - if (!texImage) { - /* invalid mipmap level, not an error */ - return; - } + _mesa_lock_texture(ctx, texObj); + { + texImage = _mesa_select_tex_image(ctx, texObj, target, level); + if (!texImage) { + /* invalid mipmap level, not an error */ + goto out; + } - /* Make sure the requested image format is compatible with the - * texture's format. Note that a color index texture can be converted - * to RGBA so that combo is allowed. - */ - if (is_color_format(format) - && !is_color_format(texImage->TexFormat->BaseFormat) - && !is_index_format(texImage->TexFormat->BaseFormat)) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexImage(format mismatch)"); - return; - } - else if (is_index_format(format) - && !is_index_format(texImage->TexFormat->BaseFormat)) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexImage(format mismatch)"); - return; - } - else if (is_depth_format(format) - && !is_depth_format(texImage->TexFormat->BaseFormat) - && !is_depthstencil_format(texImage->TexFormat->BaseFormat)) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexImage(format mismatch)"); - return; - } - else if (is_ycbcr_format(format) - && !is_ycbcr_format(texImage->TexFormat->BaseFormat)) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexImage(format mismatch)"); - return; - } - else if (is_depthstencil_format(format) - && !is_depthstencil_format(texImage->TexFormat->BaseFormat)) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexImage(format mismatch)"); - return; - } - if (ctx->Pack.BufferObj->Name) { - /* packing texture image into a PBO */ - const GLuint dimensions = (target == GL_TEXTURE_3D) ? 3 : 2; - if (!_mesa_validate_pbo_access(dimensions, &ctx->Pack, texImage->Width, - texImage->Height, texImage->Depth, - format, type, pixels)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetTexImage(invalid PBO access)"); - return; + /* Make sure the requested image format is compatible with the + * texture's format. Note that a color index texture can be converted + * to RGBA so that combo is allowed. + */ + if (is_color_format(format) + && !is_color_format(texImage->TexFormat->BaseFormat) + && !is_index_format(texImage->TexFormat->BaseFormat)) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexImage(format mismatch)"); + goto out; + } + else if (is_index_format(format) + && !is_index_format(texImage->TexFormat->BaseFormat)) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexImage(format mismatch)"); + goto out; + } + else if (is_depth_format(format) + && !is_depth_format(texImage->TexFormat->BaseFormat) + && !is_depthstencil_format(texImage->TexFormat->BaseFormat)) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexImage(format mismatch)"); + goto out; + } + else if (is_ycbcr_format(format) + && !is_ycbcr_format(texImage->TexFormat->BaseFormat)) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexImage(format mismatch)"); + goto out; + } + else if (is_depthstencil_format(format) + && !is_depthstencil_format(texImage->TexFormat->BaseFormat)) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexImage(format mismatch)"); + goto out; + } + + if (ctx->Pack.BufferObj->Name) { + /* packing texture image into a PBO */ + const GLuint dimensions = (target == GL_TEXTURE_3D) ? 3 : 2; + if (!_mesa_validate_pbo_access(dimensions, &ctx->Pack, texImage->Width, + texImage->Height, texImage->Depth, + format, type, pixels)) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glGetTexImage(invalid PBO access)"); + goto out; + } } - } - /* typically, this will call _mesa_get_teximage() */ - ctx->Driver.GetTexImage(ctx, target, level, format, type, pixels, - texObj, texImage); + /* typically, this will call _mesa_get_teximage() */ + ctx->Driver.GetTexImage(ctx, target, level, format, type, pixels, + texObj, texImage); + + } + out: + _mesa_unlock_texture(ctx, texObj); } @@ -2301,40 +2311,47 @@ _mesa_TexImage1D( GLenum target, GLint level, GLint internalFormat, return; /* error was recorded */ } - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - texObj = _mesa_select_tex_object(ctx, texUnit, target); - texImage = _mesa_get_tex_image(ctx, texUnit, target, level); - - if (!texImage) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage1D"); - return; - } - else if (texImage->Data) { - ctx->Driver.FreeTexImageData( ctx, texImage ); - } - ASSERT(texImage->Data == NULL); - clear_teximage_fields(texImage); /* not really needed, but helpful */ - _mesa_init_teximage_fields(ctx, target, texImage, - postConvWidth, 1, 1, - border, internalFormat); - if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE) - _mesa_update_state(ctx); + _mesa_update_state(ctx); - ASSERT(ctx->Driver.TexImage1D); + texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; + texObj = _mesa_select_tex_object(ctx, texUnit, target); + _mesa_lock_texture(ctx, texObj); + { + texImage = _mesa_get_tex_image(ctx, texObj, target, level); + if (!texImage) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage1D"); + goto out; + } + + if (texImage->Data) { + ctx->Driver.FreeTexImageData( ctx, texImage ); + } - /* Give the texture to the driver! may be null! */ - (*ctx->Driver.TexImage1D)(ctx, target, level, internalFormat, - width, border, format, type, pixels, - &ctx->Unpack, texObj, texImage); + ASSERT(texImage->Data == NULL); - ASSERT(texImage->TexFormat); + clear_teximage_fields(texImage); /* not really needed, but helpful */ + _mesa_init_teximage_fields(ctx, target, texImage, + postConvWidth, 1, 1, + border, internalFormat); + + ASSERT(ctx->Driver.TexImage1D); - update_fbo_texture(ctx, texObj, face, level); + /* Give the texture to the driver! may be null! */ + (*ctx->Driver.TexImage1D)(ctx, target, level, internalFormat, + width, border, format, type, pixels, + &ctx->Unpack, texObj, texImage); + + ASSERT(texImage->TexFormat); - /* state update */ - texObj->Complete = GL_FALSE; - ctx->NewState |= _NEW_TEXTURE; + update_fbo_texture(ctx, texObj, face, level); + + /* state update */ + texObj->Complete = GL_FALSE; + ctx->NewState |= _NEW_TEXTURE; + } + out: + _mesa_unlock_texture(ctx, texObj); } else if (target == GL_PROXY_TEXTURE_1D) { /* Proxy texture: check for errors and update proxy state */ @@ -2396,39 +2413,46 @@ _mesa_TexImage2D( GLenum target, GLint level, GLint internalFormat, return; /* error was recorded */ } - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - texObj = _mesa_select_tex_object(ctx, texUnit, target); - texImage = _mesa_get_tex_image(ctx, texUnit, target, level); - if (!texImage) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D"); - return; - } - else if (texImage->Data) { - ctx->Driver.FreeTexImageData( ctx, texImage ); - } - ASSERT(texImage->Data == NULL); - clear_teximage_fields(texImage); /* not really needed, but helpful */ - _mesa_init_teximage_fields(ctx, target, texImage, - postConvWidth, postConvHeight, 1, - border, internalFormat); - if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE) - _mesa_update_state(ctx); - - ASSERT(ctx->Driver.TexImage2D); - - /* Give the texture to the driver! may be null! */ - (*ctx->Driver.TexImage2D)(ctx, target, level, internalFormat, - width, height, border, format, type, pixels, - &ctx->Unpack, texObj, texImage); - - ASSERT(texImage->TexFormat); + _mesa_update_state(ctx); - update_fbo_texture(ctx, texObj, face, level); - - /* state update */ - texObj->Complete = GL_FALSE; - ctx->NewState |= _NEW_TEXTURE; + texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; + texObj = _mesa_select_tex_object(ctx, texUnit, target); + _mesa_lock_texture(ctx, texObj); + { + texImage = _mesa_get_tex_image(ctx, texObj, target, level); + if (!texImage) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D"); + goto out; + } + + if (texImage->Data) { + ctx->Driver.FreeTexImageData( ctx, texImage ); + } + + ASSERT(texImage->Data == NULL); + clear_teximage_fields(texImage); /* not really needed, but helpful */ + _mesa_init_teximage_fields(ctx, target, texImage, + postConvWidth, postConvHeight, 1, + border, internalFormat); + + ASSERT(ctx->Driver.TexImage2D); + + /* Give the texture to the driver! may be null! */ + (*ctx->Driver.TexImage2D)(ctx, target, level, internalFormat, + width, height, border, format, type, pixels, + &ctx->Unpack, texObj, texImage); + + ASSERT(texImage->TexFormat); + + update_fbo_texture(ctx, texObj, face, level); + + /* state update */ + texObj->Complete = GL_FALSE; + ctx->NewState |= _NEW_TEXTURE; + } + out: + _mesa_unlock_texture(ctx, texObj); } else if (target == GL_PROXY_TEXTURE_2D || (target == GL_PROXY_TEXTURE_CUBE_MAP_ARB && @@ -2486,39 +2510,46 @@ _mesa_TexImage3D( GLenum target, GLint level, GLint internalFormat, return; /* error was recorded */ } + if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE) + _mesa_update_state(ctx); + texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; texObj = _mesa_select_tex_object(ctx, texUnit, target); - texImage = _mesa_get_tex_image(ctx, texUnit, target, level); - if (!texImage) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage3D"); - return; - } - else if (texImage->Data) { - ctx->Driver.FreeTexImageData( ctx, texImage ); - } - ASSERT(texImage->Data == NULL); - clear_teximage_fields(texImage); /* not really needed, but helpful */ - _mesa_init_teximage_fields(ctx, target, texImage, - width, height, depth, - border, internalFormat); - - if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE) - _mesa_update_state(ctx); + _mesa_lock_texture(ctx, texObj); + { + texImage = _mesa_get_tex_image(ctx, texObj, target, level); + if (!texImage) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage3D"); + goto out; + } + + if (texImage->Data) { + ctx->Driver.FreeTexImageData( ctx, texImage ); + } + + ASSERT(texImage->Data == NULL); + clear_teximage_fields(texImage); /* not really needed, but helpful */ + _mesa_init_teximage_fields(ctx, target, texImage, + width, height, depth, + border, internalFormat); - ASSERT(ctx->Driver.TexImage3D); + ASSERT(ctx->Driver.TexImage3D); - /* Give the texture to the driver! may be null! */ - (*ctx->Driver.TexImage3D)(ctx, target, level, internalFormat, - width, height, depth, border, format, type, - pixels, &ctx->Unpack, texObj, texImage); + /* Give the texture to the driver! may be null! */ + (*ctx->Driver.TexImage3D)(ctx, target, level, internalFormat, + width, height, depth, border, format, type, + pixels, &ctx->Unpack, texObj, texImage); - ASSERT(texImage->TexFormat); + ASSERT(texImage->TexFormat); - update_fbo_texture(ctx, texObj, face, level); + update_fbo_texture(ctx, texObj, face, level); - /* state update */ - texObj->Complete = GL_FALSE; - ctx->NewState |= _NEW_TEXTURE; + /* state update */ + texObj->Complete = GL_FALSE; + ctx->NewState |= _NEW_TEXTURE; + } + out: + _mesa_unlock_texture(ctx, texObj); } else if (target == GL_PROXY_TEXTURE_3D) { /* Proxy texture: check for errors and update proxy state */ @@ -2566,7 +2597,7 @@ _mesa_TexSubImage1D( GLenum target, GLint level, GLsizei postConvWidth = width; struct gl_texture_unit *texUnit; struct gl_texture_object *texObj; - struct gl_texture_image *texImage; + struct gl_texture_image *texImage = NULL; GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); @@ -2579,26 +2610,38 @@ _mesa_TexSubImage1D( GLenum target, GLint level, } if (subtexture_error_check(ctx, 1, target, level, xoffset, 0, 0, - postConvWidth, 1, 1, format, type)) { + postConvWidth, 1, 1, format, type)) { return; /* error was detected */ } + texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; texObj = _mesa_select_tex_object(ctx, texUnit, target); - texImage = _mesa_select_tex_image(ctx, texUnit, target, level); - assert(texImage); + assert(texObj); + + _mesa_lock_texture(ctx, texObj); + { + texImage = _mesa_select_tex_image(ctx, texObj, target, level); - if (width == 0) - return; /* no-op, not an error */ + if (subtexture_error_check2(ctx, 1, target, level, xoffset, 0, 0, + postConvWidth, 1, 1, format, type, texImage)) { + goto out; /* error was detected */ + } - /* If we have a border, xoffset=-1 is legal. Bias by border width */ - xoffset += texImage->Border; + if (width == 0) + goto out; /* no-op, not an error */ - ASSERT(ctx->Driver.TexSubImage1D); - (*ctx->Driver.TexSubImage1D)(ctx, target, level, xoffset, width, - format, type, pixels, &ctx->Unpack, - texObj, texImage); - ctx->NewState |= _NEW_TEXTURE; + /* If we have a border, xoffset=-1 is legal. Bias by border width */ + xoffset += texImage->Border; + + ASSERT(ctx->Driver.TexSubImage1D); + (*ctx->Driver.TexSubImage1D)(ctx, target, level, xoffset, width, + format, type, pixels, &ctx->Unpack, + texObj, texImage); + ctx->NewState |= _NEW_TEXTURE; + } + out: + _mesa_unlock_texture(ctx, texObj); } @@ -2626,27 +2669,37 @@ _mesa_TexSubImage2D( GLenum target, GLint level, } if (subtexture_error_check(ctx, 2, target, level, xoffset, yoffset, 0, - postConvWidth, postConvHeight, 1, format, type)) { + postConvWidth, postConvHeight, 1, format, type)) { return; /* error was detected */ } texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; texObj = _mesa_select_tex_object(ctx, texUnit, target); - texImage = _mesa_select_tex_image(ctx, texUnit, target, level); - assert(texImage); + _mesa_lock_texture(ctx, texObj); + { + texImage = _mesa_select_tex_image(ctx, texObj, target, level); - if (width == 0 || height == 0) - return; /* no-op, not an error */ + if (subtexture_error_check2(ctx, 2, target, level, xoffset, yoffset, 0, + postConvWidth, postConvHeight, 1, format, type, + texImage)) { + goto out; /* error was detected */ + } - /* If we have a border, xoffset=-1 is legal. Bias by border width */ - xoffset += texImage->Border; - yoffset += texImage->Border; + if (width == 0 || height == 0) + goto out; /* no-op, not an error */ - ASSERT(ctx->Driver.TexSubImage2D); - (*ctx->Driver.TexSubImage2D)(ctx, target, level, xoffset, yoffset, - width, height, format, type, pixels, - &ctx->Unpack, texObj, texImage); - ctx->NewState |= _NEW_TEXTURE; + /* If we have a border, xoffset=-1 is legal. Bias by border width */ + xoffset += texImage->Border; + yoffset += texImage->Border; + + ASSERT(ctx->Driver.TexSubImage2D); + (*ctx->Driver.TexSubImage2D)(ctx, target, level, xoffset, yoffset, + width, height, format, type, pixels, + &ctx->Unpack, texObj, texImage); + ctx->NewState |= _NEW_TEXTURE; + } + out: + _mesa_unlock_texture(ctx, texObj); } @@ -2674,24 +2727,34 @@ _mesa_TexSubImage3D( GLenum target, GLint level, texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; texObj = _mesa_select_tex_object(ctx, texUnit, target); - texImage = _mesa_select_tex_image(ctx, texUnit, target, level); - assert(texImage); - - if (width == 0 || height == 0 || height == 0) - return; /* no-op, not an error */ - - /* If we have a border, xoffset=-1 is legal. Bias by border width */ - xoffset += texImage->Border; - yoffset += texImage->Border; - zoffset += texImage->Border; - - ASSERT(ctx->Driver.TexSubImage3D); - (*ctx->Driver.TexSubImage3D)(ctx, target, level, - xoffset, yoffset, zoffset, - width, height, depth, - format, type, pixels, - &ctx->Unpack, texObj, texImage ); - ctx->NewState |= _NEW_TEXTURE; + + _mesa_lock_texture(ctx, texObj); + { + texImage = _mesa_select_tex_image(ctx, texObj, target, level); + + if (subtexture_error_check2(ctx, 3, target, level, xoffset, yoffset, zoffset, + width, height, depth, format, type, texImage)) { + goto out; /* error was detected */ + } + + if (width == 0 || height == 0 || height == 0) + goto out; /* no-op, not an error */ + + /* If we have a border, xoffset=-1 is legal. Bias by border width */ + xoffset += texImage->Border; + yoffset += texImage->Border; + zoffset += texImage->Border; + + ASSERT(ctx->Driver.TexSubImage3D); + (*ctx->Driver.TexSubImage3D)(ctx, target, level, + xoffset, yoffset, zoffset, + width, height, depth, + format, type, pixels, + &ctx->Unpack, texObj, texImage ); + ctx->NewState |= _NEW_TEXTURE; + } + out: + _mesa_unlock_texture(ctx, texObj); } @@ -2723,32 +2786,39 @@ _mesa_CopyTexImage1D( GLenum target, GLint level, texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; texObj = _mesa_select_tex_object(ctx, texUnit, target); - texImage = _mesa_get_tex_image(ctx, texUnit, target, level); - if (!texImage) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexImage1D"); - return; - } - else if (texImage->Data) { - ctx->Driver.FreeTexImageData( ctx, texImage ); - } - ASSERT(texImage->Data == NULL); + _mesa_lock_texture(ctx, texObj); + { + texImage = _mesa_get_tex_image(ctx, texObj, target, level); + if (!texImage) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexImage1D"); + goto out; + } + + if (texImage->Data) { + ctx->Driver.FreeTexImageData( ctx, texImage ); + } + + ASSERT(texImage->Data == NULL); - clear_teximage_fields(texImage); /* not really needed, but helpful */ - _mesa_init_teximage_fields(ctx, target, texImage, postConvWidth, 1, 1, - border, internalFormat); + clear_teximage_fields(texImage); /* not really needed, but helpful */ + _mesa_init_teximage_fields(ctx, target, texImage, postConvWidth, 1, 1, + border, internalFormat); - ASSERT(ctx->Driver.CopyTexImage1D); - (*ctx->Driver.CopyTexImage1D)(ctx, target, level, internalFormat, - x, y, width, border); + ASSERT(ctx->Driver.CopyTexImage1D); + (*ctx->Driver.CopyTexImage1D)(ctx, target, level, internalFormat, + x, y, width, border); - ASSERT(texImage->TexFormat); + ASSERT(texImage->TexFormat); - update_fbo_texture(ctx, texObj, face, level); + update_fbo_texture(ctx, texObj, face, level); - /* state update */ - texObj->Complete = GL_FALSE; - ctx->NewState |= _NEW_TEXTURE; + /* state update */ + texObj->Complete = GL_FALSE; + ctx->NewState |= _NEW_TEXTURE; + } + out: + _mesa_unlock_texture(ctx, texObj); } @@ -2780,41 +2850,50 @@ _mesa_CopyTexImage2D( GLenum target, GLint level, GLenum internalFormat, texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; texObj = _mesa_select_tex_object(ctx, texUnit, target); - texImage = _mesa_get_tex_image(ctx, texUnit, target, level); - if (!texImage) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexImage2D"); - return; - } - else if (texImage->Data) { - ctx->Driver.FreeTexImageData( ctx, texImage ); - } - ASSERT(texImage->Data == NULL); - clear_teximage_fields(texImage); /* not really needed, but helpful */ - _mesa_init_teximage_fields(ctx, target, texImage, - postConvWidth, postConvHeight, 1, - border, internalFormat); + _mesa_lock_texture(ctx, texObj); + { + texImage = _mesa_get_tex_image(ctx, texObj, target, level); - ASSERT(ctx->Driver.CopyTexImage2D); - (*ctx->Driver.CopyTexImage2D)(ctx, target, level, internalFormat, - x, y, width, height, border); + if (!texImage) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexImage2D"); + goto out; + } + + if (texImage->Data) { + ctx->Driver.FreeTexImageData( ctx, texImage ); + } + + ASSERT(texImage->Data == NULL); - ASSERT(texImage->TexFormat); + clear_teximage_fields(texImage); /* not really needed, but helpful */ + _mesa_init_teximage_fields(ctx, target, texImage, + postConvWidth, postConvHeight, 1, + border, internalFormat); + + ASSERT(ctx->Driver.CopyTexImage2D); + (*ctx->Driver.CopyTexImage2D)(ctx, target, level, internalFormat, + x, y, width, height, border); + + ASSERT(texImage->TexFormat); - update_fbo_texture(ctx, texObj, face, level); + update_fbo_texture(ctx, texObj, face, level); - /* state update */ - texObj->Complete = GL_FALSE; - ctx->NewState |= _NEW_TEXTURE; + /* state update */ + texObj->Complete = GL_FALSE; + ctx->NewState |= _NEW_TEXTURE; + } + out: + _mesa_unlock_texture(ctx, texObj); } - void GLAPIENTRY _mesa_CopyTexSubImage1D( GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width ) { struct gl_texture_unit *texUnit; + struct gl_texture_object *texObj; struct gl_texture_image *texImage; GLsizei postConvWidth = width; GET_CURRENT_CONTEXT(ctx); @@ -2831,15 +2910,27 @@ _mesa_CopyTexSubImage1D( GLenum target, GLint level, return; texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - texImage = _mesa_select_tex_image(ctx, texUnit, target, level); - ASSERT(texImage); + texObj = _mesa_select_tex_object(ctx, texUnit, target); + + _mesa_lock_texture(ctx, texObj); + { + texImage = _mesa_select_tex_image(ctx, texObj, target, level); - /* If we have a border, xoffset=-1 is legal. Bias by border width */ - xoffset += texImage->Border; + if (copytexsubimage_error_check2(ctx, 1, target, level, + xoffset, 0, 0, postConvWidth, 1, + texImage)) + goto out; + + + /* If we have a border, xoffset=-1 is legal. Bias by border width */ + xoffset += texImage->Border; - ASSERT(ctx->Driver.CopyTexSubImage1D); - (*ctx->Driver.CopyTexSubImage1D)(ctx, target, level, xoffset, x, y, width); - ctx->NewState |= _NEW_TEXTURE; + ASSERT(ctx->Driver.CopyTexSubImage1D); + (*ctx->Driver.CopyTexSubImage1D)(ctx, target, level, xoffset, x, y, width); + ctx->NewState |= _NEW_TEXTURE; + } + out: + _mesa_unlock_texture(ctx, texObj); } @@ -2850,6 +2941,7 @@ _mesa_CopyTexSubImage2D( GLenum target, GLint level, GLint x, GLint y, GLsizei width, GLsizei height ) { struct gl_texture_unit *texUnit; + struct gl_texture_object *texObj; struct gl_texture_image *texImage; GLsizei postConvWidth = width, postConvHeight = height; GET_CURRENT_CONTEXT(ctx); @@ -2866,17 +2958,27 @@ _mesa_CopyTexSubImage2D( GLenum target, GLint level, return; texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - texImage = _mesa_select_tex_image(ctx, texUnit, target, level); - ASSERT(texImage); + texObj = _mesa_select_tex_object(ctx, texUnit, target); + + _mesa_lock_texture(ctx, texObj); + { + texImage = _mesa_select_tex_image(ctx, texObj, target, level); - /* If we have a border, xoffset=-1 is legal. Bias by border width */ - xoffset += texImage->Border; - yoffset += texImage->Border; + if (copytexsubimage_error_check2(ctx, 2, target, level, xoffset, yoffset, 0, + postConvWidth, postConvHeight, texImage)) + goto out; - ASSERT(ctx->Driver.CopyTexSubImage2D); - (*ctx->Driver.CopyTexSubImage2D)(ctx, target, level, - xoffset, yoffset, x, y, width, height); - ctx->NewState |= _NEW_TEXTURE; + /* If we have a border, xoffset=-1 is legal. Bias by border width */ + xoffset += texImage->Border; + yoffset += texImage->Border; + + ASSERT(ctx->Driver.CopyTexSubImage2D); + (*ctx->Driver.CopyTexSubImage2D)(ctx, target, level, + xoffset, yoffset, x, y, width, height); + ctx->NewState |= _NEW_TEXTURE; + } + out: + _mesa_unlock_texture(ctx, texObj); } @@ -2887,6 +2989,7 @@ _mesa_CopyTexSubImage3D( GLenum target, GLint level, GLint x, GLint y, GLsizei width, GLsizei height ) { struct gl_texture_unit *texUnit; + struct gl_texture_object *texObj; struct gl_texture_image *texImage; GLsizei postConvWidth = width, postConvHeight = height; GET_CURRENT_CONTEXT(ctx); @@ -2903,19 +3006,30 @@ _mesa_CopyTexSubImage3D( GLenum target, GLint level, return; texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - texImage = _mesa_select_tex_image(ctx, texUnit, target, level); - ASSERT(texImage); + texObj = _mesa_select_tex_object(ctx, texUnit, target); + + _mesa_lock_texture(ctx, texObj); + { + texImage = _mesa_select_tex_image(ctx, texObj, target, level); - /* If we have a border, xoffset=-1 is legal. Bias by border width */ - xoffset += texImage->Border; - yoffset += texImage->Border; - zoffset += texImage->Border; + if (copytexsubimage_error_check2(ctx, 3, target, level, xoffset, yoffset, + zoffset, postConvWidth, postConvHeight, + texImage)) + goto out; - ASSERT(ctx->Driver.CopyTexSubImage3D); - (*ctx->Driver.CopyTexSubImage3D)(ctx, target, level, - xoffset, yoffset, zoffset, - x, y, width, height); - ctx->NewState |= _NEW_TEXTURE; + /* If we have a border, xoffset=-1 is legal. Bias by border width */ + xoffset += texImage->Border; + yoffset += texImage->Border; + zoffset += texImage->Border; + + ASSERT(ctx->Driver.CopyTexSubImage3D); + (*ctx->Driver.CopyTexSubImage3D)(ctx, target, level, + xoffset, yoffset, zoffset, + x, y, width, height); + ctx->NewState |= _NEW_TEXTURE; + } + out: + _mesa_unlock_texture(ctx, texObj); } @@ -3136,28 +3250,35 @@ _mesa_CompressedTexImage1DARB(GLenum target, GLint level, texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; texObj = _mesa_select_tex_object(ctx, texUnit, target); - texImage = _mesa_get_tex_image(ctx, texUnit, target, level); - if (!texImage) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage1D"); - return; - } - else if (texImage->Data) { - ctx->Driver.FreeTexImageData( ctx, texImage ); - } - ASSERT(texImage->Data == NULL); - _mesa_init_teximage_fields(ctx, target, texImage, width, 1, 1, - border, internalFormat); + _mesa_lock_texture(ctx, texObj); + { + texImage = _mesa_get_tex_image(ctx, texObj, target, level); + if (!texImage) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage1D"); + goto out; + } + + if (texImage->Data) { + ctx->Driver.FreeTexImageData( ctx, texImage ); + } + ASSERT(texImage->Data == NULL); - ASSERT(ctx->Driver.CompressedTexImage1D); - (*ctx->Driver.CompressedTexImage1D)(ctx, target, level, - internalFormat, width, border, - imageSize, data, - texObj, texImage); + _mesa_init_teximage_fields(ctx, target, texImage, width, 1, 1, + border, internalFormat); - /* state update */ - texObj->Complete = GL_FALSE; - ctx->NewState |= _NEW_TEXTURE; + ASSERT(ctx->Driver.CompressedTexImage1D); + (*ctx->Driver.CompressedTexImage1D)(ctx, target, level, + internalFormat, width, border, + imageSize, data, + texObj, texImage); + + /* state update */ + texObj->Complete = GL_FALSE; + ctx->NewState |= _NEW_TEXTURE; + } + out: + _mesa_unlock_texture(ctx, texObj); } else if (target == GL_PROXY_TEXTURE_1D) { /* Proxy texture: check for errors and update proxy state */ @@ -3179,11 +3300,18 @@ _mesa_CompressedTexImage1DARB(GLenum target, GLint level, else { /* store the teximage parameters */ struct gl_texture_unit *texUnit; + struct gl_texture_object *texObj; struct gl_texture_image *texImage; texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - texImage = _mesa_select_tex_image(ctx, texUnit, target, level); - _mesa_init_teximage_fields(ctx, target, texImage, width, 1, 1, - border, internalFormat); + texObj = _mesa_select_tex_object(ctx, texUnit, target); + + _mesa_lock_texture(ctx, texObj); + { + texImage = _mesa_select_tex_image(ctx, texObj, target, level); + _mesa_init_teximage_fields(ctx, target, texImage, width, 1, 1, + border, internalFormat); + } + _mesa_unlock_texture(ctx, texObj); } } else { @@ -3219,28 +3347,35 @@ _mesa_CompressedTexImage2DARB(GLenum target, GLint level, texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; texObj = _mesa_select_tex_object(ctx, texUnit, target); - texImage = _mesa_get_tex_image(ctx, texUnit, target, level); - if (!texImage) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage2D"); - return; - } - else if (texImage->Data) { - ctx->Driver.FreeTexImageData( ctx, texImage ); - } - ASSERT(texImage->Data == NULL); - _mesa_init_teximage_fields(ctx, target, texImage, width, height, 1, - border, internalFormat); + _mesa_lock_texture(ctx, texObj); + { + texImage = _mesa_get_tex_image(ctx, texObj, target, level); + if (!texImage) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage2D"); + goto out; + } + + if (texImage->Data) { + ctx->Driver.FreeTexImageData( ctx, texImage ); + } + ASSERT(texImage->Data == NULL); - ASSERT(ctx->Driver.CompressedTexImage2D); - (*ctx->Driver.CompressedTexImage2D)(ctx, target, level, - internalFormat, width, height, - border, imageSize, data, - texObj, texImage); + _mesa_init_teximage_fields(ctx, target, texImage, width, height, 1, + border, internalFormat); - /* state update */ - texObj->Complete = GL_FALSE; - ctx->NewState |= _NEW_TEXTURE; + ASSERT(ctx->Driver.CompressedTexImage2D); + (*ctx->Driver.CompressedTexImage2D)(ctx, target, level, + internalFormat, width, height, + border, imageSize, data, + texObj, texImage); + + /* state update */ + texObj->Complete = GL_FALSE; + ctx->NewState |= _NEW_TEXTURE; + } + out: + _mesa_unlock_texture(ctx, texObj); } else if (target == GL_PROXY_TEXTURE_2D || (target == GL_PROXY_TEXTURE_CUBE_MAP_ARB && @@ -3264,11 +3399,18 @@ _mesa_CompressedTexImage2DARB(GLenum target, GLint level, else { /* store the teximage parameters */ struct gl_texture_unit *texUnit; + struct gl_texture_object *texObj; struct gl_texture_image *texImage; texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - texImage = _mesa_select_tex_image(ctx, texUnit, target, level); - _mesa_init_teximage_fields(ctx, target, texImage, width, height, 1, - border, internalFormat); + texObj = _mesa_select_tex_object(ctx, texUnit, target); + + _mesa_lock_texture(ctx, texObj); + { + texImage = _mesa_select_tex_image(ctx, texObj, target, level); + _mesa_init_teximage_fields(ctx, target, texImage, width, height, 1, + border, internalFormat); + } + _mesa_unlock_texture(ctx, texObj); } } else { @@ -3301,29 +3443,35 @@ _mesa_CompressedTexImage3DARB(GLenum target, GLint level, texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; texObj = _mesa_select_tex_object(ctx, texUnit, target); - texImage = _mesa_get_tex_image(ctx, texUnit, target, level); - if (!texImage) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage3D"); - return; - } - else if (texImage->Data) { - ctx->Driver.FreeTexImageData( ctx, texImage ); - } - ASSERT(texImage->Data == NULL); - - _mesa_init_teximage_fields(ctx, target, texImage, width, height, depth, - border, internalFormat); + _mesa_lock_texture(ctx, texObj); + { + texImage = _mesa_get_tex_image(ctx, texObj, target, level); + if (!texImage) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage3D"); + goto out; + } + + if (texImage->Data) { + ctx->Driver.FreeTexImageData( ctx, texImage ); + } + ASSERT(texImage->Data == NULL); - ASSERT(ctx->Driver.CompressedTexImage3D); - (*ctx->Driver.CompressedTexImage3D)(ctx, target, level, - internalFormat, - width, height, depth, - border, imageSize, data, - texObj, texImage); + _mesa_init_teximage_fields(ctx, target, texImage, width, height, depth, + border, internalFormat); - /* state update */ - texObj->Complete = GL_FALSE; - ctx->NewState |= _NEW_TEXTURE; + ASSERT(ctx->Driver.CompressedTexImage3D); + (*ctx->Driver.CompressedTexImage3D)(ctx, target, level, + internalFormat, + width, height, depth, + border, imageSize, data, + texObj, texImage); + + /* state update */ + texObj->Complete = GL_FALSE; + ctx->NewState |= _NEW_TEXTURE; + } + out: + _mesa_unlock_texture(ctx, texObj); } else if (target == GL_PROXY_TEXTURE_3D) { /* Proxy texture: check for errors and update proxy state */ @@ -3345,11 +3493,17 @@ _mesa_CompressedTexImage3DARB(GLenum target, GLint level, else { /* store the teximage parameters */ struct gl_texture_unit *texUnit; + struct gl_texture_object *texObj; struct gl_texture_image *texImage; texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - texImage = _mesa_select_tex_image(ctx, texUnit, target, level); - _mesa_init_teximage_fields(ctx, target, texImage, width, height, - depth, border, internalFormat); + texObj = _mesa_select_tex_object(ctx, texUnit, target); + _mesa_lock_texture(ctx, texObj); + { + texImage = _mesa_select_tex_image(ctx, texObj, target, level); + _mesa_init_teximage_fields(ctx, target, texImage, width, height, + depth, border, internalFormat); + } + _mesa_unlock_texture(ctx, texObj); } } else { @@ -3382,30 +3536,35 @@ _mesa_CompressedTexSubImage1DARB(GLenum target, GLint level, GLint xoffset, texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; texObj = _mesa_select_tex_object(ctx, texUnit, target); - texImage = _mesa_select_tex_image(ctx, texUnit, target, level); - assert(texImage); + _mesa_lock_texture(ctx, texObj); + { + texImage = _mesa_select_tex_image(ctx, texObj, target, level); + assert(texImage); - if ((GLint) format != texImage->InternalFormat) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glCompressedTexSubImage1D(format)"); - return; - } + if ((GLint) format != texImage->InternalFormat) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glCompressedTexSubImage1D(format)"); + goto out; + } - if ((width == 1 || width == 2) && (GLuint) width != texImage->Width) { - _mesa_error(ctx, GL_INVALID_VALUE, "glCompressedTexSubImage1D(width)"); - return; - } + if ((width == 1 || width == 2) && (GLuint) width != texImage->Width) { + _mesa_error(ctx, GL_INVALID_VALUE, "glCompressedTexSubImage1D(width)"); + goto out; + } - if (width == 0) - return; /* no-op, not an error */ + if (width == 0) + goto out; /* no-op, not an error */ - if (ctx->Driver.CompressedTexSubImage1D) { - (*ctx->Driver.CompressedTexSubImage1D)(ctx, target, level, - xoffset, width, - format, imageSize, data, - texObj, texImage); + if (ctx->Driver.CompressedTexSubImage1D) { + (*ctx->Driver.CompressedTexSubImage1D)(ctx, target, level, + xoffset, width, + format, imageSize, data, + texObj, texImage); + } + ctx->NewState |= _NEW_TEXTURE; } - ctx->NewState |= _NEW_TEXTURE; + out: + _mesa_unlock_texture(ctx, texObj); } @@ -3434,31 +3593,36 @@ _mesa_CompressedTexSubImage2DARB(GLenum target, GLint level, GLint xoffset, texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; texObj = _mesa_select_tex_object(ctx, texUnit, target); - texImage = _mesa_select_tex_image(ctx, texUnit, target, level); - assert(texImage); + _mesa_lock_texture(ctx, texObj); + { + texImage = _mesa_select_tex_image(ctx, texObj, target, level); + assert(texImage); - if ((GLint) format != texImage->InternalFormat) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glCompressedTexSubImage2D(format)"); - return; - } + if ((GLint) format != texImage->InternalFormat) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glCompressedTexSubImage2D(format)"); + goto out; + } - if (((width == 1 || width == 2) && (GLuint) width != texImage->Width) || - ((height == 1 || height == 2) && (GLuint) height != texImage->Height)) { - _mesa_error(ctx, GL_INVALID_VALUE, "glCompressedTexSubImage2D(size)"); - return; - } + if (((width == 1 || width == 2) && (GLuint) width != texImage->Width) || + ((height == 1 || height == 2) && (GLuint) height != texImage->Height)) { + _mesa_error(ctx, GL_INVALID_VALUE, "glCompressedTexSubImage2D(size)"); + goto out; + } - if (width == 0 || height == 0) - return; /* no-op, not an error */ + if (width == 0 || height == 0) + goto out; /* no-op, not an error */ - if (ctx->Driver.CompressedTexSubImage2D) { - (*ctx->Driver.CompressedTexSubImage2D)(ctx, target, level, - xoffset, yoffset, width, height, - format, imageSize, data, - texObj, texImage); + if (ctx->Driver.CompressedTexSubImage2D) { + (*ctx->Driver.CompressedTexSubImage2D)(ctx, target, level, + xoffset, yoffset, width, height, + format, imageSize, data, + texObj, texImage); + } + ctx->NewState |= _NEW_TEXTURE; } - ctx->NewState |= _NEW_TEXTURE; + out: + _mesa_unlock_texture(ctx, texObj); } @@ -3486,33 +3650,38 @@ _mesa_CompressedTexSubImage3DARB(GLenum target, GLint level, GLint xoffset, texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; texObj = _mesa_select_tex_object(ctx, texUnit, target); - texImage = _mesa_select_tex_image(ctx, texUnit, target, level); - assert(texImage); + _mesa_lock_texture(ctx, texObj); + { + texImage = _mesa_select_tex_image(ctx, texObj, target, level); + assert(texImage); - if ((GLint) format != texImage->InternalFormat) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glCompressedTexSubImage3D(format)"); - return; - } + if ((GLint) format != texImage->InternalFormat) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glCompressedTexSubImage3D(format)"); + goto out; + } - if (((width == 1 || width == 2) && (GLuint) width != texImage->Width) || - ((height == 1 || height == 2) && (GLuint) height != texImage->Height) || - ((depth == 1 || depth == 2) && (GLuint) depth != texImage->Depth)) { - _mesa_error(ctx, GL_INVALID_VALUE, "glCompressedTexSubImage3D(size)"); - return; - } + if (((width == 1 || width == 2) && (GLuint) width != texImage->Width) || + ((height == 1 || height == 2) && (GLuint) height != texImage->Height) || + ((depth == 1 || depth == 2) && (GLuint) depth != texImage->Depth)) { + _mesa_error(ctx, GL_INVALID_VALUE, "glCompressedTexSubImage3D(size)"); + goto out; + } - if (width == 0 || height == 0 || depth == 0) - return; /* no-op, not an error */ + if (width == 0 || height == 0 || depth == 0) + goto out; /* no-op, not an error */ - if (ctx->Driver.CompressedTexSubImage3D) { - (*ctx->Driver.CompressedTexSubImage3D)(ctx, target, level, - xoffset, yoffset, zoffset, - width, height, depth, - format, imageSize, data, - texObj, texImage); + if (ctx->Driver.CompressedTexSubImage3D) { + (*ctx->Driver.CompressedTexSubImage3D)(ctx, target, level, + xoffset, yoffset, zoffset, + width, height, depth, + format, imageSize, data, + texObj, texImage); + } + ctx->NewState |= _NEW_TEXTURE; } - ctx->NewState |= _NEW_TEXTURE; + out: + _mesa_unlock_texture(ctx, texObj); } @@ -3520,12 +3689,13 @@ void GLAPIENTRY _mesa_GetCompressedTexImageARB(GLenum target, GLint level, GLvoid *img) { const struct gl_texture_unit *texUnit; - const struct gl_texture_object *texObj; + struct gl_texture_object *texObj; struct gl_texture_image *texImage; GLint maxLevels; GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); + texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; texObj = _mesa_select_tex_object(ctx, texUnit, target); if (!texObj) { @@ -3546,18 +3716,24 @@ _mesa_GetCompressedTexImageARB(GLenum target, GLint level, GLvoid *img) return; } - texImage = _mesa_select_tex_image(ctx, texUnit, target, level); - if (!texImage) { - /* probably invalid mipmap level */ - _mesa_error(ctx, GL_INVALID_VALUE, "glGetCompressedTexImageARB(level)"); - return; - } - if (!texImage->IsCompressed) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glGetCompressedTexImageARB"); - return; - } + _mesa_lock_texture(ctx, texObj); + { + texImage = _mesa_select_tex_image(ctx, texObj, target, level); + if (!texImage) { + /* probably invalid mipmap level */ + _mesa_error(ctx, GL_INVALID_VALUE, "glGetCompressedTexImageARB(level)"); + goto out; + } + + if (!texImage->IsCompressed) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glGetCompressedTexImageARB"); + goto out; + } - /* this typically calls _mesa_get_compressed_teximage() */ - ctx->Driver.GetCompressedTexImage(ctx, target, level, img, texObj,texImage); + /* this typically calls _mesa_get_compressed_teximage() */ + ctx->Driver.GetCompressedTexImage(ctx, target, level, img, texObj,texImage); + } + out: + _mesa_unlock_texture(ctx, texObj); } diff --git a/src/mesa/main/teximage.h b/src/mesa/main/teximage.h index 410789fe046..68457f4728c 100644 --- a/src/mesa/main/teximage.h +++ b/src/mesa/main/teximage.h @@ -84,12 +84,12 @@ _mesa_select_tex_object(GLcontext *ctx, const struct gl_texture_unit *texUnit, extern struct gl_texture_image * -_mesa_select_tex_image(GLcontext *ctx, const struct gl_texture_unit *texUnit, +_mesa_select_tex_image(GLcontext *ctx, const struct gl_texture_object *texObj, GLenum target, GLint level); extern struct gl_texture_image * -_mesa_get_tex_image(GLcontext *ctx, const struct gl_texture_unit *texUnit, +_mesa_get_tex_image(GLcontext *ctx, struct gl_texture_object *texObj, GLenum target, GLint level); @@ -106,6 +106,23 @@ _mesa_test_proxy_teximage(GLcontext *ctx, GLenum target, GLint level, GLint internalFormat, GLenum format, GLenum type, GLint width, GLint height, GLint depth, GLint border); + +/* Lock a texture for updating. See also _mesa_lock_context_textures(). + */ +static INLINE void _mesa_lock_texture(GLcontext *ctx, + struct gl_texture_object *texObj) +{ + _glthread_LOCK_MUTEX(ctx->Shared->TexMutex); + ctx->Shared->TextureStateStamp++; + (void) texObj; +} + +static INLINE void _mesa_unlock_texture(GLcontext *ctx, + struct gl_texture_object *texObj) +{ + _glthread_UNLOCK_MUTEX(ctx->Shared->TexMutex); +} + /*@}*/ diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index 8b42c2a712c..1d27cd3f7c6 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -697,7 +697,11 @@ _mesa_DeleteTextures( GLsizei n, const GLuint *textures) if (textures[i] > 0) { struct gl_texture_object *delObj = _mesa_lookup_texture(ctx, textures[i]); + if (delObj) { + GLboolean delete; + + _mesa_lock_texture(ctx, delObj); /* Check if texture is bound to any framebuffer objects. * If so, unbind. @@ -724,7 +728,14 @@ _mesa_DeleteTextures( GLsizei n, const GLuint *textures) * XXX all RefCount accesses should be protected by a mutex. */ delObj->RefCount--; - if (delObj->RefCount == 0) { + delete = (delObj->RefCount == 0); + _mesa_unlock_texture(ctx, delObj); + + /* We know that refcount went to zero above, so this is + * the only pointer left to delObj, so we don't have to + * worry about locking any more: + */ + if (delete) { ASSERT(delObj->Name != 0); /* Never delete default tex objs */ ASSERT(ctx->Driver.DeleteTexture); (*ctx->Driver.DeleteTexture)(ctx, delObj); @@ -1052,4 +1063,30 @@ _mesa_IsTexture( GLuint texture ) return t && t->Target; } +/* Simplest implementation of texture locking: Grab the a new mutex in + * the shared context. Examine the shared context state timestamp and + * if there has been a change, set the appropriate bits in + * ctx->NewState. + * + * See also _mesa_lock/unlock_texture in texobj.h + */ +void _mesa_lock_context_textures( GLcontext *ctx ) +{ + _glthread_LOCK_MUTEX(ctx->Shared->TexMutex); + + if (ctx->Shared->TextureStateStamp != ctx->TextureStateTimestamp) { + ctx->NewState |= _NEW_TEXTURE; + ctx->TextureStateTimestamp = ctx->Shared->TextureStateStamp; + } +} + + +void _mesa_unlock_context_textures( GLcontext *ctx ) +{ + assert(ctx->Shared->TextureStateStamp == ctx->TextureStateTimestamp); + _glthread_UNLOCK_MUTEX(ctx->Shared->TexMutex); +} + /*@}*/ + + diff --git a/src/mesa/main/texobj.h b/src/mesa/main/texobj.h index ac66ac69d3c..ec7cf8cd86e 100644 --- a/src/mesa/main/texobj.h +++ b/src/mesa/main/texobj.h @@ -61,6 +61,9 @@ extern void _mesa_test_texobj_completeness( const GLcontext *ctx, struct gl_texture_object *obj ); +extern void _mesa_unlock_context_textures( GLcontext *ctx ); +extern void _mesa_lock_context_textures( GLcontext *ctx ); + /*@}*/ @@ -95,4 +98,5 @@ _mesa_IsTexture( GLuint texture ); /*@}*/ + #endif diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c index 0687e5760c9..bcedcafe19e 100644 --- a/src/mesa/main/texstate.c +++ b/src/mesa/main/texstate.c @@ -144,6 +144,8 @@ _mesa_copy_texture_state( const GLcontext *src, GLcontext *dst ) dst->Texture.Unit[i].Combine.ScaleShiftA = src->Texture.Unit[i].Combine.ScaleShiftA; /* copy texture object bindings, not contents of texture objects */ + _mesa_lock_context_textures(dst); + copy_texture_binding(src, &dst->Texture.Unit[i].Current1D, src->Texture.Unit[i].Current1D); copy_texture_binding(src, &dst->Texture.Unit[i].Current2D, @@ -154,6 +156,8 @@ _mesa_copy_texture_state( const GLcontext *src, GLcontext *dst ) src->Texture.Unit[i].CurrentCubeMap); copy_texture_binding(src, &dst->Texture.Unit[i].CurrentRect, src->Texture.Unit[i].CurrentRect); + + _mesa_unlock_context_textures(dst); } } @@ -1700,6 +1704,7 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, GLenum pname, GLint *params ) { const struct gl_texture_unit *texUnit; + struct gl_texture_object *texObj; const struct gl_texture_image *img = NULL; GLuint dimensions; GLboolean isProxy; @@ -1734,14 +1739,17 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, return; } - img = _mesa_select_tex_image(ctx, texUnit, target, level); + texObj = _mesa_select_tex_object(ctx, texUnit, target); + _mesa_lock_texture(ctx, texObj); + + img = _mesa_select_tex_image(ctx, texObj, target, level); if (!img || !img->TexFormat) { /* undefined texture image */ if (pname == GL_TEXTURE_COMPONENTS) *params = 1; else *params = 0; - return; + goto out; } isProxy = _mesa_is_proxy_texture(target); @@ -1749,37 +1757,37 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, switch (pname) { case GL_TEXTURE_WIDTH: *params = img->Width; - return; + break; case GL_TEXTURE_HEIGHT: *params = img->Height; - return; + break; case GL_TEXTURE_DEPTH: *params = img->Depth; - return; + break; case GL_TEXTURE_INTERNAL_FORMAT: *params = img->InternalFormat; - return; + break; case GL_TEXTURE_BORDER: *params = img->Border; - return; + break; case GL_TEXTURE_RED_SIZE: if (img->_BaseFormat == GL_RGB || img->_BaseFormat == GL_RGBA) *params = img->TexFormat->RedBits; else *params = 0; - return; + break; case GL_TEXTURE_GREEN_SIZE: if (img->_BaseFormat == GL_RGB || img->_BaseFormat == GL_RGBA) *params = img->TexFormat->GreenBits; else *params = 0; - return; + break; case GL_TEXTURE_BLUE_SIZE: if (img->_BaseFormat == GL_RGB || img->_BaseFormat == GL_RGBA) *params = img->TexFormat->BlueBits; else *params = 0; - return; + break; case GL_TEXTURE_ALPHA_SIZE: if (img->_BaseFormat == GL_ALPHA || img->_BaseFormat == GL_LUMINANCE_ALPHA || @@ -1787,7 +1795,7 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, *params = img->TexFormat->AlphaBits; else *params = 0; - return; + break; case GL_TEXTURE_INTENSITY_SIZE: if (img->_BaseFormat != GL_INTENSITY) *params = 0; @@ -1795,7 +1803,7 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, *params = img->TexFormat->IntensityBits; else /* intensity probably stored as rgb texture */ *params = MIN2(img->TexFormat->RedBits, img->TexFormat->GreenBits); - return; + break; case GL_TEXTURE_LUMINANCE_SIZE: if (img->_BaseFormat != GL_LUMINANCE && img->_BaseFormat != GL_LUMINANCE_ALPHA) @@ -1804,13 +1812,13 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, *params = img->TexFormat->LuminanceBits; else /* luminance probably stored as rgb texture */ *params = MIN2(img->TexFormat->RedBits, img->TexFormat->GreenBits); - return; + break; case GL_TEXTURE_INDEX_SIZE_EXT: if (img->_BaseFormat == GL_COLOR_INDEX) *params = img->TexFormat->IndexBits; else *params = 0; - return; + break; case GL_TEXTURE_DEPTH_SIZE_ARB: if (ctx->Extensions.SGIX_depth_texture || ctx->Extensions.ARB_depth_texture) @@ -1818,7 +1826,7 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, else _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexLevelParameter[if]v(pname)"); - return; + break; case GL_TEXTURE_STENCIL_SIZE_EXT: if (ctx->Extensions.EXT_packed_depth_stencil) { *params = img->TexFormat->StencilBits; @@ -1827,7 +1835,7 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexLevelParameter[if]v(pname)"); } - return; + break; /* GL_ARB_texture_compression */ case GL_TEXTURE_COMPRESSED_IMAGE_SIZE: @@ -1849,7 +1857,7 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexLevelParameter[if]v(pname)"); } - return; + break; case GL_TEXTURE_COMPRESSED: if (ctx->Extensions.ARB_texture_compression) { *params = (GLint) img->IsCompressed; @@ -1858,7 +1866,7 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexLevelParameter[if]v(pname)"); } - return; + break; /* GL_ARB_texture_float */ case GL_TEXTURE_RED_TYPE_ARB: @@ -1869,7 +1877,7 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexLevelParameter[if]v(pname)"); } - return; + break; case GL_TEXTURE_GREEN_TYPE_ARB: if (ctx->Extensions.ARB_texture_float) { *params = img->TexFormat->GreenBits ? img->TexFormat->DataType : GL_NONE; @@ -1878,7 +1886,7 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexLevelParameter[if]v(pname)"); } - return; + break; case GL_TEXTURE_BLUE_TYPE_ARB: if (ctx->Extensions.ARB_texture_float) { *params = img->TexFormat->BlueBits ? img->TexFormat->DataType : GL_NONE; @@ -1887,7 +1895,7 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexLevelParameter[if]v(pname)"); } - return; + break; case GL_TEXTURE_ALPHA_TYPE_ARB: if (ctx->Extensions.ARB_texture_float) { *params = img->TexFormat->AlphaBits ? img->TexFormat->DataType : GL_NONE; @@ -1896,7 +1904,7 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexLevelParameter[if]v(pname)"); } - return; + break; case GL_TEXTURE_LUMINANCE_TYPE_ARB: if (ctx->Extensions.ARB_texture_float) { *params = img->TexFormat->LuminanceBits ? img->TexFormat->DataType : GL_NONE; @@ -1905,7 +1913,7 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexLevelParameter[if]v(pname)"); } - return; + break; case GL_TEXTURE_INTENSITY_TYPE_ARB: if (ctx->Extensions.ARB_texture_float) { *params = img->TexFormat->IntensityBits ? img->TexFormat->DataType : GL_NONE; @@ -1914,7 +1922,7 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexLevelParameter[if]v(pname)"); } - return; + break; case GL_TEXTURE_DEPTH_TYPE_ARB: if (ctx->Extensions.ARB_texture_float) { *params = img->TexFormat->DepthBits ? img->TexFormat->DataType : GL_NONE; @@ -1923,12 +1931,15 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexLevelParameter[if]v(pname)"); } - return; + break; default: _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexLevelParameter[if]v(pname)"); } + + out: + _mesa_unlock_texture(ctx, texObj); } @@ -1938,6 +1949,7 @@ _mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params ) { struct gl_texture_unit *texUnit; struct gl_texture_object *obj; + GLboolean error = GL_FALSE; GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); @@ -1955,28 +1967,29 @@ _mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params ) return; } + _mesa_lock_texture(ctx, obj); switch (pname) { case GL_TEXTURE_MAG_FILTER: *params = ENUM_TO_FLOAT(obj->MagFilter); - return; + break; case GL_TEXTURE_MIN_FILTER: *params = ENUM_TO_FLOAT(obj->MinFilter); - return; + break; case GL_TEXTURE_WRAP_S: *params = ENUM_TO_FLOAT(obj->WrapS); - return; + break; case GL_TEXTURE_WRAP_T: *params = ENUM_TO_FLOAT(obj->WrapT); - return; + break; case GL_TEXTURE_WRAP_R: *params = ENUM_TO_FLOAT(obj->WrapR); - return; + break; case GL_TEXTURE_BORDER_COLOR: params[0] = CLAMP(obj->BorderColor[0], 0.0F, 1.0F); params[1] = CLAMP(obj->BorderColor[1], 0.0F, 1.0F); params[2] = CLAMP(obj->BorderColor[2], 0.0F, 1.0F); params[3] = CLAMP(obj->BorderColor[3], 0.0F, 1.0F); - return; + break; case GL_TEXTURE_RESIDENT: { GLboolean resident; @@ -1986,82 +1999,94 @@ _mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params ) resident = GL_TRUE; *params = ENUM_TO_FLOAT(resident); } - return; + break; case GL_TEXTURE_PRIORITY: *params = obj->Priority; - return; + break; case GL_TEXTURE_MIN_LOD: *params = obj->MinLod; - return; + break; case GL_TEXTURE_MAX_LOD: *params = obj->MaxLod; - return; + break; case GL_TEXTURE_BASE_LEVEL: *params = (GLfloat) obj->BaseLevel; - return; + break; case GL_TEXTURE_MAX_LEVEL: *params = (GLfloat) obj->MaxLevel; - return; + break; case GL_TEXTURE_MAX_ANISOTROPY_EXT: if (ctx->Extensions.EXT_texture_filter_anisotropic) { *params = obj->MaxAnisotropy; - return; } + else + error = 1; break; case GL_TEXTURE_COMPARE_SGIX: if (ctx->Extensions.SGIX_shadow) { *params = (GLfloat) obj->CompareFlag; - return; } + else + error = 1; break; case GL_TEXTURE_COMPARE_OPERATOR_SGIX: if (ctx->Extensions.SGIX_shadow) { *params = (GLfloat) obj->CompareOperator; - return; } + else + error = 1; break; case GL_SHADOW_AMBIENT_SGIX: /* aka GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ if (ctx->Extensions.SGIX_shadow_ambient) { *params = obj->ShadowAmbient; - return; } + else + error = 1; break; case GL_GENERATE_MIPMAP_SGIS: if (ctx->Extensions.SGIS_generate_mipmap) { *params = (GLfloat) obj->GenerateMipmap; - return; } + else + error = 1; break; case GL_TEXTURE_COMPARE_MODE_ARB: if (ctx->Extensions.ARB_shadow) { *params = (GLfloat) obj->CompareMode; - return; } + else + error = 1; break; case GL_TEXTURE_COMPARE_FUNC_ARB: if (ctx->Extensions.ARB_shadow) { *params = (GLfloat) obj->CompareFunc; - return; } + else + error = 1; break; case GL_DEPTH_TEXTURE_MODE_ARB: if (ctx->Extensions.ARB_depth_texture) { *params = (GLfloat) obj->DepthMode; - return; } + else + error = 1; break; case GL_TEXTURE_LOD_BIAS: if (ctx->Extensions.EXT_texture_lod_bias) { *params = obj->LodBias; - return; } + else + error = 1; break; default: - ; /* silence warnings */ + error = 1; + break; } - /* If we get here, pname was an unrecognized enum */ - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexParameterfv(pname=0x%x)", - pname); + if (error) + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexParameterfv(pname=0x%x)", + pname); + + _mesa_unlock_texture(ctx, obj); } diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index 7471934b49d..89563842c25 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -27,7 +27,7 @@ * Brian Paul */ -/* +/** * The GL texture image functions in teximage.c basically just do * error checking and data structure allocation. They in turn call * device driver functions which actually copy/convert/store the user's @@ -58,16 +58,27 @@ #include "convolve.h" #include "image.h" #include "macros.h" +#include "mipmap.h" #include "imports.h" #include "texcompress.h" #include "texformat.h" #include "teximage.h" #include "texstore.h" +#include "enums.h" -static const GLint ZERO = 4, ONE = 5; +enum { + ZERO = 4, + ONE = 5 +}; -static GLboolean can_swizzle(GLenum logicalBaseFormat) + +/** + * Return GL_TRUE if the given image format is one that be converted + * to another format by swizzling. + */ +static GLboolean +can_swizzle(GLenum logicalBaseFormat) { switch (logicalBaseFormat) { case GL_RGBA: @@ -76,6 +87,12 @@ static GLboolean can_swizzle(GLenum logicalBaseFormat) case GL_INTENSITY: case GL_ALPHA: case GL_LUMINANCE: + case GL_RED: + case GL_GREEN: + case GL_BLUE: + case GL_BGR: + case GL_BGRA: + case GL_ABGR_EXT: return GL_TRUE; default: return GL_FALSE; @@ -83,89 +100,172 @@ static GLboolean can_swizzle(GLenum logicalBaseFormat) } + +enum { + IDX_LUMINANCE = 0, + IDX_ALPHA, + IDX_INTENSITY, + IDX_LUMINANCE_ALPHA, + IDX_RGB, + IDX_RGBA, + IDX_RED, + IDX_GREEN, + IDX_BLUE, + IDX_BGR, + IDX_BGRA, + IDX_ABGR, + MAX_IDX +}; + +#define MAP1(x) MAP4(x, ZERO, ZERO, ZERO) +#define MAP2(x,y) MAP4(x, y, ZERO, ZERO) +#define MAP3(x,y,z) MAP4(x, y, z, ZERO) +#define MAP4(x,y,z,w) { x, y, z, w, ZERO, ONE } + + +static const struct { + GLubyte format_idx; + GLubyte to_rgba[6]; + GLubyte from_rgba[6]; +} mappings[MAX_IDX] = +{ + { + IDX_LUMINANCE, + MAP4(0,0,0,ONE), + MAP1(0) + }, + + { + IDX_ALPHA, + MAP4(ZERO, ZERO, ZERO, 0), + MAP1(3) + }, + + { + IDX_INTENSITY, + MAP4(0, 0, 0, 0), + MAP1(0), + }, + + { + IDX_LUMINANCE_ALPHA, + MAP4(0,0,0,1), + MAP2(0,3) + }, + + { + IDX_RGB, + MAP4(0,1,2,ONE), + MAP3(0,1,2) + }, + + { + IDX_RGBA, + MAP4(0,1,2,3), + MAP4(0,1,2,3), + }, + + + { + IDX_RED, + MAP4(0, ZERO, ZERO, ONE), + MAP1(0), + }, + + { + IDX_GREEN, + MAP4(ZERO, 0, ZERO, ONE), + MAP1(1), + }, + + { + IDX_BLUE, + MAP4(ZERO, ZERO, 0, ONE), + MAP1(2), + }, + + { + IDX_BGR, + MAP4(2,1,0,ONE), + MAP3(2,1,0) + }, + + { + IDX_BGRA, + MAP4(2,1,0,3), + MAP4(2,1,0,3) + }, + + { + IDX_ABGR, + MAP4(3,2,1,0), + MAP4(3,2,1,0) + }, +}; + + + +/** + * Convert a GL image format enum to an IDX_* value (see above). + */ +static int +get_map_idx(GLenum value) +{ + switch (value) { + case GL_LUMINANCE: return IDX_LUMINANCE; + case GL_ALPHA: return IDX_ALPHA; + case GL_INTENSITY: return IDX_INTENSITY; + case GL_LUMINANCE_ALPHA: return IDX_LUMINANCE_ALPHA; + case GL_RGB: return IDX_RGB; + case GL_RGBA: return IDX_RGBA; + case GL_RED: return IDX_RED; + case GL_GREEN: return IDX_GREEN; + case GL_BLUE: return IDX_BLUE; + case GL_BGR: return IDX_BGR; + case GL_BGRA: return IDX_BGRA; + case GL_ABGR_EXT: return IDX_ABGR; + default: + _mesa_problem(NULL, "Unexpected inFormat"); + return 0; + } +} + + /** * When promoting texture formats (see below) we need to compute the * mapping of dest components back to source components. * This function does that. - * \param logicalBaseFormat the logical format of the texture - * \param textureBaseFormat the final texture format - * \return map[4] the four mapping values + * \param inFormat the incoming format of the texture + * \param outFormat the final texture format + * \return map[6] a full 6-component map */ static void -compute_component_mapping(GLenum logicalBaseFormat, GLenum textureBaseFormat, - GLubyte map[6]) +compute_component_mapping(GLenum inFormat, GLenum outFormat, + GLubyte *map) { + const int inFmt = get_map_idx(inFormat); + const int outFmt = get_map_idx(outFormat); + const GLubyte *in2rgba = mappings[inFmt].to_rgba; + const GLubyte *rgba2out = mappings[outFmt].from_rgba; + int i; + + for (i = 0; i < 4; i++) + map[i] = in2rgba[rgba2out[i]]; + map[ZERO] = ZERO; - map[ONE] = ONE; + map[ONE] = ONE; - /* compute mapping from dest components back to src components */ - switch (textureBaseFormat) { - case GL_RGB: - case GL_RGBA: - switch (logicalBaseFormat) { - case GL_LUMINANCE: - map[0] = map[1] = map[2] = 0; - if (textureBaseFormat == GL_RGBA) - map[3] = ONE; - break; - case GL_ALPHA: - ASSERT(textureBaseFormat == GL_RGBA); - map[0] = map[1] = map[2] = ZERO; - map[3] = 0; - break; - case GL_INTENSITY: - map[0] = map[1] = map[2] = 0; - if (textureBaseFormat == GL_RGBA) - map[3] = 0; - break; - case GL_LUMINANCE_ALPHA: - ASSERT(textureBaseFormat == GL_RGBA); - map[0] = map[1] = map[2] = 0; - map[3] = 1; - break; - case GL_RGB: - ASSERT(textureBaseFormat == GL_RGBA); - map[0] = 0; - map[1] = 1; - map[2] = 2; - map[3] = ONE; - break; - case GL_RGBA: - ASSERT(textureBaseFormat == GL_RGBA); - map[0] = 0; - map[1] = 1; - map[2] = 2; - map[3] = 3; - break; - default: - _mesa_problem(NULL, "Unexpected logicalBaseFormat"); - map[0] = map[1] = map[2] = map[3] = 0; - } - break; - case GL_LUMINANCE_ALPHA: - switch (logicalBaseFormat) { - case GL_LUMINANCE: - map[0] = 0; - map[1] = ONE; - break; - case GL_ALPHA: - map[0] = ZERO; - map[1] = 0; - break; - case GL_INTENSITY: - map[0] = 0; - map[1] = 0; - break; - default: - _mesa_problem(NULL, "Unexpected logicalBaseFormat"); - map[0] = map[1] = 0; - } - break; - default: - _mesa_problem(NULL, "Unexpected textureBaseFormat"); - map[0] = map[1] = 0; - break; - } +/* + _mesa_printf("from %x/%s to %x/%s map %d %d %d %d %d %d\n", + inFormat, _mesa_lookup_enum_by_nr(inFormat), + outFormat, _mesa_lookup_enum_by_nr(outFormat), + map[0], + map[1], + map[2], + map[3], + map[4], + map[5]); +*/ } @@ -298,7 +398,7 @@ make_temp_float_image(GLcontext *ctx, GLuint dims, GLfloat *dst = tempImage + img * (convWidth * convHeight * 4); for (row = 0; row < convHeight; row++) { _mesa_pack_rgba_span_float(ctx, convWidth, - (const GLfloat (*)[4]) src, + (GLfloat (*)[4]) src, logicalBaseFormat, GL_FLOAT, dst, &ctx->DefaultPacking, postConvTransferOps); @@ -552,14 +652,16 @@ _mesa_make_temp_chan_image(GLcontext *ctx, GLuint dims, * \param dstComponents number of color components in destination pixels * \param src source pixels * \param srcComponents number of color components in source pixels - * \param map the swizzle mapping + * \param map the swizzle mapping. map[X] says where to find the X component + * in the source image's pixels. For example, if the source image + * is GL_BGRA and X = red, map[0] yields 2. * \param count number of pixels to copy/swizzle. */ static void swizzle_copy(GLubyte *dst, GLuint dstComponents, const GLubyte *src, GLuint srcComponents, const GLubyte *map, GLuint count) { - GLubyte tmp[8]; + GLubyte tmp[6]; GLuint i; tmp[ZERO] = 0x0; @@ -596,10 +698,61 @@ swizzle_copy(GLubyte *dst, GLuint dstComponents, const GLubyte *src, dst += 2; } break; + case 1: + /* XXX investigate valgrind invalid read when running demos/texenv.c */ + for (i = 0; i < count; i++) { + COPY_4UBV(tmp, src); + src += srcComponents; + dst[0] = tmp[map[0]]; + dst += 1; + } + break; + } +} + + +static const GLubyte map_identity[6] = { 0, 1, 2, 3, ZERO, ONE }; +static const GLubyte map_3210[6] = { 3, 2, 1, 0, ZERO, ONE }; + +/* Deal with the _REV input types: + */ +static const GLubyte * +type_mapping( GLenum srcType ) +{ + switch (srcType) { + case GL_UNSIGNED_BYTE: + return map_identity; + case GL_UNSIGNED_INT_8_8_8_8: + return _mesa_little_endian() ? map_3210 : map_identity; + case GL_UNSIGNED_INT_8_8_8_8_REV: + return _mesa_little_endian() ? map_identity : map_3210; + default: + return NULL; + } +} + +/* Mapping required if input type is + */ +static const GLubyte * +byteswap_mapping( GLboolean swapBytes, + GLenum srcType ) +{ + if (!swapBytes) + return map_identity; + + switch (srcType) { + case GL_UNSIGNED_BYTE: + return map_identity; + case GL_UNSIGNED_INT_8_8_8_8: + case GL_UNSIGNED_INT_8_8_8_8_REV: + return map_3210; + default: + return NULL; } } + /** * Transfer a GLubyte texture image with component swizzling. */ @@ -607,7 +760,12 @@ static void _mesa_swizzle_ubyte_image(GLcontext *ctx, GLuint dimensions, GLenum srcFormat, - const GLubyte *dstmap, GLint dstComponents, + GLenum srcType, + + GLenum baseInternalFormat, + + const GLubyte *rgba2dst, + GLuint dstComponents, GLvoid *dstAddr, GLint dstXoffset, GLint dstYoffset, GLint dstZoffset, @@ -619,9 +777,9 @@ _mesa_swizzle_ubyte_image(GLcontext *ctx, const struct gl_pixelstore_attrib *srcPacking ) { GLint srcComponents = _mesa_components_in_format(srcFormat); - GLubyte srcmap[6], map[4]; + const GLubyte *srctype2ubyte, *swap; + GLubyte map[4], src2base[6], base2rgba[6]; GLint i; - const GLint srcRowStride = _mesa_image_row_stride(srcPacking, srcWidth, srcFormat, GL_UNSIGNED_BYTE); @@ -635,10 +793,20 @@ _mesa_swizzle_ubyte_image(GLcontext *ctx, (void) ctx; - compute_component_mapping(srcFormat, GL_RGBA, srcmap); + /* Translate from src->baseInternal->GL_RGBA->dst. This will + * correctly deal with RGBA->RGB->RGBA conversions where the final + * A value must be 0xff regardless of the incoming alpha values. + */ + compute_component_mapping(srcFormat, baseInternalFormat, src2base); + compute_component_mapping(baseInternalFormat, GL_RGBA, base2rgba); + swap = byteswap_mapping(srcPacking->SwapBytes, srcType); + srctype2ubyte = type_mapping(srcType); + for (i = 0; i < 4; i++) - map[i] = srcmap[dstmap[i]]; + map[i] = srctype2ubyte[swap[src2base[base2rgba[rgba2dst[i]]]]]; + +/* _mesa_printf("map %d %d %d %d\n", map[0], map[1], map[2], map[3]); */ if (srcRowStride == srcWidth * srcComponents && dimensions < 3) { @@ -817,6 +985,58 @@ _mesa_texstore_rgba(TEXSTORE_PARAMS) } } } + else if (!ctx->_ImageTransferState && + CHAN_TYPE == GL_UNSIGNED_BYTE && + (srcType == GL_UNSIGNED_BYTE || + srcType == GL_UNSIGNED_INT_8_8_8_8 || + srcType == GL_UNSIGNED_INT_8_8_8_8_REV) && + can_swizzle(baseInternalFormat) && + can_swizzle(srcFormat)) { + + const GLubyte *dstmap; + GLuint components; + + /* dstmap - how to swizzle from RGBA to dst format: + */ + if (dstFormat == &_mesa_texformat_rgba) { + dstmap = mappings[IDX_RGBA].from_rgba; + components = 4; + } + else if (dstFormat == &_mesa_texformat_rgb) { + dstmap = mappings[IDX_RGB].from_rgba; + components = 3; + } + else if (dstFormat == &_mesa_texformat_alpha) { + dstmap = mappings[IDX_ALPHA].from_rgba; + components = 1; + } + else if (dstFormat == &_mesa_texformat_luminance) { + dstmap = mappings[IDX_LUMINANCE].from_rgba; + components = 1; + } + else if (dstFormat == &_mesa_texformat_luminance_alpha) { + dstmap = mappings[IDX_LUMINANCE_ALPHA].from_rgba; + components = 2; + } + else if (dstFormat == &_mesa_texformat_intensity) { + dstmap = mappings[IDX_INTENSITY].from_rgba; + components = 1; + } + else { + _mesa_problem(ctx, "Unexpected dstFormat in _mesa_texstore_rgba"); + return GL_FALSE; + } + + _mesa_swizzle_ubyte_image(ctx, dims, + srcFormat, + srcType, + baseInternalFormat, + dstmap, components, + dstAddr, dstXoffset, dstYoffset, dstZoffset, + dstRowStride, dstImageOffsets, + srcWidth, srcHeight, srcDepth, srcAddr, + srcPacking); + } else { /* general path */ const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims, @@ -1050,13 +1270,14 @@ _mesa_texstore_rgb565(TEXSTORE_PARAMS) } +/** + * Store a texture in MESA_FORMAT_RGBA8888 or MESA_FORMAT_RGBA8888_REV. + */ GLboolean _mesa_texstore_rgba8888(TEXSTORE_PARAMS) { - const GLuint ui = 1; - const GLubyte littleEndian = *((const GLubyte *) &ui); + const GLboolean littleEndian = _mesa_little_endian(); - (void)littleEndian; ASSERT(dstFormat == &_mesa_texformat_rgba8888 || dstFormat == &_mesa_texformat_rgba8888_rev); ASSERT(dstFormat->TexelBytes == 4); @@ -1093,40 +1314,41 @@ _mesa_texstore_rgba8888(TEXSTORE_PARAMS) srcWidth, srcHeight, srcDepth, srcFormat, srcType, srcAddr, srcPacking); } -#if 0 - /* broken? */ else if (!ctx->_ImageTransferState && - !srcPacking->SwapBytes && - srcType == GL_UNSIGNED_BYTE && - dstFormat == &_mesa_texformat_rgba8888 && - littleEndian && - /* Three texture formats involved: srcFormat, - * baseInternalFormat and destFormat (GL_RGBA). Only two - * may differ. _mesa_swizzle_ubyte_image can't handle two - * propagations at once correctly. */ - (srcFormat == baseInternalFormat || - baseInternalFormat == GL_RGBA) && + (srcType == GL_UNSIGNED_BYTE || + srcType == GL_UNSIGNED_INT_8_8_8_8 || + srcType == GL_UNSIGNED_INT_8_8_8_8_REV) && + can_swizzle(baseInternalFormat) && can_swizzle(srcFormat)) { + GLubyte dstmap[4]; - /* dstmap - how to swizzle from GL_RGBA to dst format: - * - * FIXME - add !litteEndian and _rev varients: + /* dstmap - how to swizzle from RGBA to dst format: */ - dstmap[3] = 0; - dstmap[2] = 1; - dstmap[1] = 2; - dstmap[0] = 3; + if ((littleEndian && dstFormat == &_mesa_texformat_rgba8888) || + (!littleEndian && dstFormat == &_mesa_texformat_rgba8888_rev)) { + dstmap[3] = 0; + dstmap[2] = 1; + dstmap[1] = 2; + dstmap[0] = 3; + } + else { + dstmap[3] = 3; + dstmap[2] = 2; + dstmap[1] = 1; + dstmap[0] = 0; + } _mesa_swizzle_ubyte_image(ctx, dims, srcFormat, + srcType, + baseInternalFormat, dstmap, 4, dstAddr, dstXoffset, dstYoffset, dstZoffset, - dstRowStride, dstImageStride, + dstRowStride, dstImageOffsets, srcWidth, srcHeight, srcDepth, srcAddr, srcPacking); } -#endif else { /* general path */ const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims, @@ -1177,8 +1399,7 @@ _mesa_texstore_rgba8888(TEXSTORE_PARAMS) GLboolean _mesa_texstore_argb8888(TEXSTORE_PARAMS) { - const GLuint ui = 1; - const GLubyte littleEndian = *((const GLubyte *) &ui); + const GLboolean littleEndian = _mesa_little_endian(); ASSERT(dstFormat == &_mesa_texformat_argb8888 || dstFormat == &_mesa_texformat_argb8888_rev); @@ -1218,6 +1439,8 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS) !srcPacking->SwapBytes && dstFormat == &_mesa_texformat_argb8888 && srcFormat == GL_RGB && + (baseInternalFormat == GL_RGBA || + baseInternalFormat == GL_RGB) && srcType == GL_UNSIGNED_BYTE) { int img, row, col; @@ -1246,6 +1469,7 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS) !srcPacking->SwapBytes && dstFormat == &_mesa_texformat_argb8888 && srcFormat == GL_RGBA && + baseInternalFormat == GL_RGBA && (srcType == GL_UNSIGNED_BYTE && littleEndian)) { GLint img, row, col; /* For some reason, streaming copies to write-combined regions @@ -1280,6 +1504,7 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS) !srcPacking->SwapBytes && dstFormat == &_mesa_texformat_argb8888 && srcFormat == GL_RGBA && + baseInternalFormat == GL_RGBA && srcType == GL_UNSIGNED_BYTE) { GLint img, row, col; @@ -1305,29 +1530,37 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS) } } else if (!ctx->_ImageTransferState && - !srcPacking->SwapBytes && - dstFormat == &_mesa_texformat_argb8888 && - srcType == GL_UNSIGNED_BYTE && - littleEndian && - /* Three texture formats involved: srcFormat, - * baseInternalFormat and destFormat (GL_RGBA). Only two - * may differ. _mesa_swizzle_ubyte_image can't handle two - * propagations at once correctly. */ - (srcFormat == baseInternalFormat || - baseInternalFormat == GL_RGBA) && + (srcType == GL_UNSIGNED_BYTE || + srcType == GL_UNSIGNED_INT_8_8_8_8 || + srcType == GL_UNSIGNED_INT_8_8_8_8_REV) && + can_swizzle(baseInternalFormat) && can_swizzle(srcFormat)) { GLubyte dstmap[4]; - /* dstmap - how to swizzle from GL_RGBA to dst format: + /* dstmap - how to swizzle from RGBA to dst format: */ - dstmap[3] = 3; /* alpha */ - dstmap[2] = 0; /* red */ - dstmap[1] = 1; /* green */ - dstmap[0] = 2; /* blue */ + if ((littleEndian && dstFormat == &_mesa_texformat_argb8888) || + (!littleEndian && dstFormat == &_mesa_texformat_argb8888_rev)) { + dstmap[3] = 3; /* alpha */ + dstmap[2] = 0; /* red */ + dstmap[1] = 1; /* green */ + dstmap[0] = 2; /* blue */ + } + else { + assert((littleEndian && dstFormat == &_mesa_texformat_argb8888_rev) || + (!littleEndian && dstFormat == &_mesa_texformat_argb8888)); + dstmap[3] = 2; + dstmap[2] = 1; + dstmap[1] = 0; + dstmap[0] = 3; + } _mesa_swizzle_ubyte_image(ctx, dims, srcFormat, + srcType, + + baseInternalFormat, dstmap, 4, dstAddr, dstXoffset, dstYoffset, dstZoffset, dstRowStride, @@ -1385,8 +1618,7 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS) GLboolean _mesa_texstore_rgb888(TEXSTORE_PARAMS) { - const GLuint ui = 1; - const GLubyte littleEndian = *((const GLubyte *) &ui); + const GLboolean littleEndian = _mesa_little_endian(); ASSERT(dstFormat == &_mesa_texformat_rgb888); ASSERT(dstFormat->TexelBytes == 3); @@ -1431,6 +1663,30 @@ _mesa_texstore_rgb888(TEXSTORE_PARAMS) } } } + else if (!ctx->_ImageTransferState && + srcType == GL_UNSIGNED_BYTE && + can_swizzle(baseInternalFormat) && + can_swizzle(srcFormat)) { + + GLubyte dstmap[4]; + + /* dstmap - how to swizzle from RGBA to dst format: + */ + dstmap[0] = 2; + dstmap[1] = 1; + dstmap[2] = 0; + dstmap[3] = ONE; /* ? */ + + _mesa_swizzle_ubyte_image(ctx, dims, + srcFormat, + srcType, + baseInternalFormat, + dstmap, 3, + dstAddr, dstXoffset, dstYoffset, dstZoffset, + dstRowStride, dstImageOffsets, + srcWidth, srcHeight, srcDepth, srcAddr, + srcPacking); + } else { /* general path */ const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims, @@ -1487,8 +1743,7 @@ _mesa_texstore_rgb888(TEXSTORE_PARAMS) GLboolean _mesa_texstore_bgr888(TEXSTORE_PARAMS) { - const GLuint ui = 1; - const GLubyte littleEndian = *((const GLubyte *) &ui); + const GLboolean littleEndian = _mesa_little_endian(); ASSERT(dstFormat == &_mesa_texformat_bgr888); ASSERT(dstFormat->TexelBytes == 3); @@ -1533,6 +1788,30 @@ _mesa_texstore_bgr888(TEXSTORE_PARAMS) } } } + else if (!ctx->_ImageTransferState && + srcType == GL_UNSIGNED_BYTE && + can_swizzle(baseInternalFormat) && + can_swizzle(srcFormat)) { + + GLubyte dstmap[4]; + + /* dstmap - how to swizzle from RGBA to dst format: + */ + dstmap[0] = 0; + dstmap[1] = 1; + dstmap[2] = 2; + dstmap[3] = ONE; /* ? */ + + _mesa_swizzle_ubyte_image(ctx, dims, + srcFormat, + srcType, + baseInternalFormat, + dstmap, 3, + dstAddr, dstXoffset, dstYoffset, dstZoffset, + dstRowStride, dstImageOffsets, + srcWidth, srcHeight, srcDepth, srcAddr, + srcPacking); + } else { /* general path */ const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims, @@ -1707,8 +1986,7 @@ _mesa_texstore_argb1555(TEXSTORE_PARAMS) GLboolean _mesa_texstore_al88(TEXSTORE_PARAMS) { - const GLuint ui = 1; - const GLubyte littleEndian = *((const GLubyte *) &ui); + const GLboolean littleEndian = _mesa_little_endian(); ASSERT(dstFormat == &_mesa_texformat_al88 || dstFormat == &_mesa_texformat_al88_rev); @@ -1729,6 +2007,38 @@ _mesa_texstore_al88(TEXSTORE_PARAMS) srcWidth, srcHeight, srcDepth, srcFormat, srcType, srcAddr, srcPacking); } + else if (!ctx->_ImageTransferState && + littleEndian && + srcType == GL_UNSIGNED_BYTE && + can_swizzle(baseInternalFormat) && + can_swizzle(srcFormat)) { + + GLubyte dstmap[4]; + + /* dstmap - how to swizzle from RGBA to dst format: + */ + if ((littleEndian && dstFormat == &_mesa_texformat_al88) || + (!littleEndian && dstFormat == &_mesa_texformat_al88_rev)) { + dstmap[0] = 0; + dstmap[1] = 3; + } + else { + dstmap[0] = 3; + dstmap[1] = 0; + } + dstmap[2] = ZERO; /* ? */ + dstmap[3] = ONE; /* ? */ + + _mesa_swizzle_ubyte_image(ctx, dims, + srcFormat, + srcType, + baseInternalFormat, + dstmap, 2, + dstAddr, dstXoffset, dstYoffset, dstZoffset, + dstRowStride, dstImageOffsets, + srcWidth, srcHeight, srcDepth, srcAddr, + srcPacking); + } else { /* general path */ const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims, @@ -1849,6 +2159,35 @@ _mesa_texstore_a8(TEXSTORE_PARAMS) srcWidth, srcHeight, srcDepth, srcFormat, srcType, srcAddr, srcPacking); } + else if (!ctx->_ImageTransferState && + srcType == GL_UNSIGNED_BYTE && + can_swizzle(baseInternalFormat) && + can_swizzle(srcFormat)) { + + GLubyte dstmap[4]; + + /* dstmap - how to swizzle from RGBA to dst format: + */ + if (dstFormat == &_mesa_texformat_a8) { + dstmap[0] = 3; + } + else { + dstmap[0] = 0; + } + dstmap[1] = ZERO; /* ? */ + dstmap[2] = ZERO; /* ? */ + dstmap[3] = ONE; /* ? */ + + _mesa_swizzle_ubyte_image(ctx, dims, + srcFormat, + srcType, + baseInternalFormat, + dstmap, 1, + dstAddr, dstXoffset, dstYoffset, dstZoffset, + dstRowStride, dstImageOffsets, + srcWidth, srcHeight, srcDepth, srcAddr, + srcPacking); + } else { /* general path */ const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims, @@ -1930,8 +2269,7 @@ _mesa_texstore_ci8(TEXSTORE_PARAMS) GLboolean _mesa_texstore_ycbcr(TEXSTORE_PARAMS) { - const GLuint ui = 1; - const GLubyte littleEndian = *((const GLubyte *) &ui); + const GLboolean littleEndian = _mesa_little_endian(); (void) ctx; (void) dims; (void) baseInternalFormat; ASSERT((dstFormat == &_mesa_texformat_ycbcr) || @@ -2186,8 +2524,7 @@ _mesa_texstore_rgba_float16(TEXSTORE_PARAMS) GLboolean _mesa_texstore_srgb8(TEXSTORE_PARAMS) { - const GLuint ui = 1; - const GLubyte littleEndian = *((const GLubyte *) &ui); + const GLboolean littleEndian = _mesa_little_endian(); const struct gl_texture_format *newDstFormat; StoreTexImageFunc store; GLboolean k; @@ -2218,8 +2555,7 @@ _mesa_texstore_srgb8(TEXSTORE_PARAMS) GLboolean _mesa_texstore_srgba8(TEXSTORE_PARAMS) { - const GLuint ui = 1; - const GLubyte littleEndian = *((const GLubyte *) &ui); + const GLboolean littleEndian = _mesa_little_endian(); const struct gl_texture_format *newDstFormat; GLboolean k; @@ -2267,8 +2603,7 @@ _mesa_texstore_sl8(TEXSTORE_PARAMS) GLboolean _mesa_texstore_sla8(TEXSTORE_PARAMS) { - const GLuint ui = 1; - const GLubyte littleEndian = *((const GLubyte *) &ui); + const GLboolean littleEndian = _mesa_little_endian(); const struct gl_texture_format *newDstFormat; GLboolean k; @@ -2386,8 +2721,8 @@ _mesa_unmap_teximage_pbo(GLcontext *ctx, * Adaptor for fetching a GLchan texel from a float-valued texture. */ static void -FetchTexelFloatToChan( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texelOut ) +fetch_texel_float_to_chan(const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLchan *texelOut) { GLfloat temp[4]; ASSERT(texImage->FetchTexelf); @@ -2411,8 +2746,8 @@ FetchTexelFloatToChan( const struct gl_texture_image *texImage, * Adaptor for fetching a float texel from a GLchan-valued texture. */ static void -FetchTexelChanToFloat( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texelOut ) +fetch_texel_chan_to_float(const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texelOut) { GLchan temp[4]; ASSERT(texImage->FetchTexelc); @@ -2460,10 +2795,10 @@ set_fetch_functions(struct gl_texture_image *texImage, GLuint dims) /* now check if we need to use a float/chan adaptor */ if (!texImage->FetchTexelc) { - texImage->FetchTexelc = FetchTexelFloatToChan; + texImage->FetchTexelc = fetch_texel_float_to_chan; } else if (!texImage->FetchTexelf) { - texImage->FetchTexelf = FetchTexelChanToFloat; + texImage->FetchTexelf = fetch_texel_chan_to_float; } @@ -3119,1114 +3454,6 @@ _mesa_store_compressed_texsubimage3d(GLcontext *ctx, GLenum target, } -/* - * Average together two rows of a source image to produce a single new - * row in the dest image. It's legal for the two source rows to point - * to the same data. The source width must be equal to either the - * dest width or two times the dest width. - */ -static void -do_row(const struct gl_texture_format *format, GLint srcWidth, - const GLvoid *srcRowA, const GLvoid *srcRowB, - GLint dstWidth, GLvoid *dstRow) -{ - const GLuint k0 = (srcWidth == dstWidth) ? 0 : 1; - const GLuint colStride = (srcWidth == dstWidth) ? 1 : 2; - - /* This assertion is no longer valid with non-power-of-2 textures - assert(srcWidth == dstWidth || srcWidth == 2 * dstWidth); - */ - - switch (format->MesaFormat) { - case MESA_FORMAT_RGBA: - { - GLuint i, j, k; - const GLchan (*rowA)[4] = (const GLchan (*)[4]) srcRowA; - const GLchan (*rowB)[4] = (const GLchan (*)[4]) srcRowB; - GLchan (*dst)[4] = (GLchan (*)[4]) dstRow; - for (i = j = 0, k = k0; i < (GLuint) dstWidth; - i++, j += colStride, k += colStride) { - dst[i][0] = (rowA[j][0] + rowA[k][0] + - rowB[j][0] + rowB[k][0]) / 4; - dst[i][1] = (rowA[j][1] + rowA[k][1] + - rowB[j][1] + rowB[k][1]) / 4; - dst[i][2] = (rowA[j][2] + rowA[k][2] + - rowB[j][2] + rowB[k][2]) / 4; - dst[i][3] = (rowA[j][3] + rowA[k][3] + - rowB[j][3] + rowB[k][3]) / 4; - } - } - return; - case MESA_FORMAT_RGB: - { - GLuint i, j, k; - const GLchan (*rowA)[3] = (const GLchan (*)[3]) srcRowA; - const GLchan (*rowB)[3] = (const GLchan (*)[3]) srcRowB; - GLchan (*dst)[3] = (GLchan (*)[3]) dstRow; - for (i = j = 0, k = k0; i < (GLuint) dstWidth; - i++, j += colStride, k += colStride) { - dst[i][0] = (rowA[j][0] + rowA[k][0] + - rowB[j][0] + rowB[k][0]) / 4; - dst[i][1] = (rowA[j][1] + rowA[k][1] + - rowB[j][1] + rowB[k][1]) / 4; - dst[i][2] = (rowA[j][2] + rowA[k][2] + - rowB[j][2] + rowB[k][2]) / 4; - } - } - return; - case MESA_FORMAT_ALPHA: - case MESA_FORMAT_LUMINANCE: - case MESA_FORMAT_INTENSITY: - { - GLuint i, j, k; - const GLchan *rowA = (const GLchan *) srcRowA; - const GLchan *rowB = (const GLchan *) srcRowB; - GLchan *dst = (GLchan *) dstRow; - for (i = j = 0, k = k0; i < (GLuint) dstWidth; - i++, j += colStride, k += colStride) { - dst[i] = (rowA[j] + rowA[k] + rowB[j] + rowB[k]) / 4; - } - } - return; - case MESA_FORMAT_LUMINANCE_ALPHA: - { - GLuint i, j, k; - const GLchan (*rowA)[2] = (const GLchan (*)[2]) srcRowA; - const GLchan (*rowB)[2] = (const GLchan (*)[2]) srcRowB; - GLchan (*dst)[2] = (GLchan (*)[2]) dstRow; - for (i = j = 0, k = k0; i < (GLuint) dstWidth; - i++, j += colStride, k += colStride) { - dst[i][0] = (rowA[j][0] + rowA[k][0] + - rowB[j][0] + rowB[k][0]) / 4; - dst[i][1] = (rowA[j][1] + rowA[k][1] + - rowB[j][1] + rowB[k][1]) / 4; - } - } - return; - case MESA_FORMAT_Z32: - { - GLuint i, j, k; - const GLuint *rowA = (const GLuint *) srcRowA; - const GLuint *rowB = (const GLuint *) srcRowB; - GLfloat *dst = (GLfloat *) dstRow; - for (i = j = 0, k = k0; i < (GLuint) dstWidth; - i++, j += colStride, k += colStride) { - dst[i] = rowA[j] / 4 + rowA[k] / 4 + rowB[j] / 4 + rowB[k] / 4; - } - } - return; - case MESA_FORMAT_Z16: - { - GLuint i, j, k; - const GLushort *rowA = (const GLushort *) srcRowA; - const GLushort *rowB = (const GLushort *) srcRowB; - GLushort *dst = (GLushort *) dstRow; - for (i = j = 0, k = k0; i < (GLuint) dstWidth; - i++, j += colStride, k += colStride) { - dst[i] = (rowA[j] + rowA[k] + rowB[j] + rowB[k]) / 4; - } - } - return; - /* Begin hardware formats */ - case MESA_FORMAT_RGBA8888: - case MESA_FORMAT_RGBA8888_REV: - case MESA_FORMAT_ARGB8888: - case MESA_FORMAT_ARGB8888_REV: -#if FEATURE_EXT_texture_sRGB - case MESA_FORMAT_SRGBA8: -#endif - { - GLuint i, j, k; - const GLubyte (*rowA)[4] = (const GLubyte (*)[4]) srcRowA; - const GLubyte (*rowB)[4] = (const GLubyte (*)[4]) srcRowB; - GLubyte (*dst)[4] = (GLubyte (*)[4]) dstRow; - for (i = j = 0, k = k0; i < (GLuint) dstWidth; - i++, j += colStride, k += colStride) { - dst[i][0] = (rowA[j][0] + rowA[k][0] + - rowB[j][0] + rowB[k][0]) / 4; - dst[i][1] = (rowA[j][1] + rowA[k][1] + - rowB[j][1] + rowB[k][1]) / 4; - dst[i][2] = (rowA[j][2] + rowA[k][2] + - rowB[j][2] + rowB[k][2]) / 4; - dst[i][3] = (rowA[j][3] + rowA[k][3] + - rowB[j][3] + rowB[k][3]) / 4; - } - } - return; - case MESA_FORMAT_RGB888: - case MESA_FORMAT_BGR888: -#if FEATURE_EXT_texture_sRGB - case MESA_FORMAT_SRGB8: -#endif - { - GLuint i, j, k; - const GLubyte (*rowA)[3] = (const GLubyte (*)[3]) srcRowA; - const GLubyte (*rowB)[3] = (const GLubyte (*)[3]) srcRowB; - GLubyte (*dst)[3] = (GLubyte (*)[3]) dstRow; - for (i = j = 0, k = k0; i < (GLuint) dstWidth; - i++, j += colStride, k += colStride) { - dst[i][0] = (rowA[j][0] + rowA[k][0] + - rowB[j][0] + rowB[k][0]) / 4; - dst[i][1] = (rowA[j][1] + rowA[k][1] + - rowB[j][1] + rowB[k][1]) / 4; - dst[i][2] = (rowA[j][2] + rowA[k][2] + - rowB[j][2] + rowB[k][2]) / 4; - } - } - return; - case MESA_FORMAT_RGB565: - case MESA_FORMAT_RGB565_REV: - { - GLuint i, j, k; - const GLushort *rowA = (const GLushort *) srcRowA; - const GLushort *rowB = (const GLushort *) srcRowB; - GLushort *dst = (GLushort *) dstRow; - for (i = j = 0, k = k0; i < (GLuint) dstWidth; - i++, j += colStride, k += colStride) { - const GLint rowAr0 = rowA[j] & 0x1f; - const GLint rowAr1 = rowA[k] & 0x1f; - const GLint rowBr0 = rowB[j] & 0x1f; - const GLint rowBr1 = rowB[k] & 0x1f; - const GLint rowAg0 = (rowA[j] >> 5) & 0x3f; - const GLint rowAg1 = (rowA[k] >> 5) & 0x3f; - const GLint rowBg0 = (rowB[j] >> 5) & 0x3f; - const GLint rowBg1 = (rowB[k] >> 5) & 0x3f; - const GLint rowAb0 = (rowA[j] >> 11) & 0x1f; - const GLint rowAb1 = (rowA[k] >> 11) & 0x1f; - const GLint rowBb0 = (rowB[j] >> 11) & 0x1f; - const GLint rowBb1 = (rowB[k] >> 11) & 0x1f; - const GLint red = (rowAr0 + rowAr1 + rowBr0 + rowBr1) >> 2; - const GLint green = (rowAg0 + rowAg1 + rowBg0 + rowBg1) >> 2; - const GLint blue = (rowAb0 + rowAb1 + rowBb0 + rowBb1) >> 2; - dst[i] = (blue << 11) | (green << 5) | red; - } - } - return; - case MESA_FORMAT_ARGB4444: - case MESA_FORMAT_ARGB4444_REV: - { - GLuint i, j, k; - const GLushort *rowA = (const GLushort *) srcRowA; - const GLushort *rowB = (const GLushort *) srcRowB; - GLushort *dst = (GLushort *) dstRow; - for (i = j = 0, k = k0; i < (GLuint) dstWidth; - i++, j += colStride, k += colStride) { - const GLint rowAr0 = rowA[j] & 0xf; - const GLint rowAr1 = rowA[k] & 0xf; - const GLint rowBr0 = rowB[j] & 0xf; - const GLint rowBr1 = rowB[k] & 0xf; - const GLint rowAg0 = (rowA[j] >> 4) & 0xf; - const GLint rowAg1 = (rowA[k] >> 4) & 0xf; - const GLint rowBg0 = (rowB[j] >> 4) & 0xf; - const GLint rowBg1 = (rowB[k] >> 4) & 0xf; - const GLint rowAb0 = (rowA[j] >> 8) & 0xf; - const GLint rowAb1 = (rowA[k] >> 8) & 0xf; - const GLint rowBb0 = (rowB[j] >> 8) & 0xf; - const GLint rowBb1 = (rowB[k] >> 8) & 0xf; - const GLint rowAa0 = (rowA[j] >> 12) & 0xf; - const GLint rowAa1 = (rowA[k] >> 12) & 0xf; - const GLint rowBa0 = (rowB[j] >> 12) & 0xf; - const GLint rowBa1 = (rowB[k] >> 12) & 0xf; - const GLint red = (rowAr0 + rowAr1 + rowBr0 + rowBr1) >> 2; - const GLint green = (rowAg0 + rowAg1 + rowBg0 + rowBg1) >> 2; - const GLint blue = (rowAb0 + rowAb1 + rowBb0 + rowBb1) >> 2; - const GLint alpha = (rowAa0 + rowAa1 + rowBa0 + rowBa1) >> 2; - dst[i] = (alpha << 12) | (blue << 8) | (green << 4) | red; - } - } - return; - case MESA_FORMAT_ARGB1555: - case MESA_FORMAT_ARGB1555_REV: /* XXX broken? */ - { - GLuint i, j, k; - const GLushort *rowA = (const GLushort *) srcRowA; - const GLushort *rowB = (const GLushort *) srcRowB; - GLushort *dst = (GLushort *) dstRow; - for (i = j = 0, k = k0; i < (GLuint) dstWidth; - i++, j += colStride, k += colStride) { - const GLint rowAr0 = rowA[j] & 0x1f; - const GLint rowAr1 = rowA[k] & 0x1f; - const GLint rowBr0 = rowB[j] & 0x1f; - const GLint rowBr1 = rowB[k] & 0xf; - const GLint rowAg0 = (rowA[j] >> 5) & 0x1f; - const GLint rowAg1 = (rowA[k] >> 5) & 0x1f; - const GLint rowBg0 = (rowB[j] >> 5) & 0x1f; - const GLint rowBg1 = (rowB[k] >> 5) & 0x1f; - const GLint rowAb0 = (rowA[j] >> 10) & 0x1f; - const GLint rowAb1 = (rowA[k] >> 10) & 0x1f; - const GLint rowBb0 = (rowB[j] >> 10) & 0x1f; - const GLint rowBb1 = (rowB[k] >> 10) & 0x1f; - const GLint rowAa0 = (rowA[j] >> 15) & 0x1; - const GLint rowAa1 = (rowA[k] >> 15) & 0x1; - const GLint rowBa0 = (rowB[j] >> 15) & 0x1; - const GLint rowBa1 = (rowB[k] >> 15) & 0x1; - const GLint red = (rowAr0 + rowAr1 + rowBr0 + rowBr1) >> 2; - const GLint green = (rowAg0 + rowAg1 + rowBg0 + rowBg1) >> 2; - const GLint blue = (rowAb0 + rowAb1 + rowBb0 + rowBb1) >> 2; - const GLint alpha = (rowAa0 + rowAa1 + rowBa0 + rowBa1) >> 2; - dst[i] = (alpha << 15) | (blue << 10) | (green << 5) | red; - } - } - return; - case MESA_FORMAT_AL88: - case MESA_FORMAT_AL88_REV: -#if FEATURE_EXT_texture_sRGB - case MESA_FORMAT_SLA8: -#endif - { - GLuint i, j, k; - const GLubyte (*rowA)[2] = (const GLubyte (*)[2]) srcRowA; - const GLubyte (*rowB)[2] = (const GLubyte (*)[2]) srcRowB; - GLubyte (*dst)[2] = (GLubyte (*)[2]) dstRow; - for (i = j = 0, k = k0; i < (GLuint) dstWidth; - i++, j += colStride, k += colStride) { - dst[i][0] = (rowA[j][0] + rowA[k][0] + - rowB[j][0] + rowB[k][0]) >> 2; - dst[i][1] = (rowA[j][1] + rowA[k][1] + - rowB[j][1] + rowB[k][1]) >> 2; - } - } - return; - case MESA_FORMAT_RGB332: - { - GLuint i, j, k; - const GLubyte *rowA = (const GLubyte *) srcRowA; - const GLubyte *rowB = (const GLubyte *) srcRowB; - GLubyte *dst = (GLubyte *) dstRow; - for (i = j = 0, k = k0; i < (GLuint) dstWidth; - i++, j += colStride, k += colStride) { - const GLint rowAr0 = rowA[j] & 0x3; - const GLint rowAr1 = rowA[k] & 0x3; - const GLint rowBr0 = rowB[j] & 0x3; - const GLint rowBr1 = rowB[k] & 0x3; - const GLint rowAg0 = (rowA[j] >> 2) & 0x7; - const GLint rowAg1 = (rowA[k] >> 2) & 0x7; - const GLint rowBg0 = (rowB[j] >> 2) & 0x7; - const GLint rowBg1 = (rowB[k] >> 2) & 0x7; - const GLint rowAb0 = (rowA[j] >> 5) & 0x7; - const GLint rowAb1 = (rowA[k] >> 5) & 0x7; - const GLint rowBb0 = (rowB[j] >> 5) & 0x7; - const GLint rowBb1 = (rowB[k] >> 5) & 0x7; - const GLint red = (rowAr0 + rowAr1 + rowBr0 + rowBr1) >> 2; - const GLint green = (rowAg0 + rowAg1 + rowBg0 + rowBg1) >> 2; - const GLint blue = (rowAb0 + rowAb1 + rowBb0 + rowBb1) >> 2; - dst[i] = (blue << 5) | (green << 2) | red; - } - } - return; - case MESA_FORMAT_A8: - case MESA_FORMAT_L8: - case MESA_FORMAT_I8: - case MESA_FORMAT_CI8: -#if FEATURE_EXT_texture_sRGB - case MESA_FORMAT_SL8: -#endif - { - GLuint i, j, k; - const GLubyte *rowA = (const GLubyte *) srcRowA; - const GLubyte *rowB = (const GLubyte *) srcRowB; - GLubyte *dst = (GLubyte *) dstRow; - for (i = j = 0, k = k0; i < (GLuint) dstWidth; - i++, j += colStride, k += colStride) { - dst[i] = (rowA[j] + rowA[k] + rowB[j] + rowB[k]) >> 2; - } - } - return; - case MESA_FORMAT_RGBA_FLOAT32: - { - GLuint i, j, k; - const GLfloat (*rowA)[4] = (const GLfloat (*)[4]) srcRowA; - const GLfloat (*rowB)[4] = (const GLfloat (*)[4]) srcRowB; - GLfloat (*dst)[4] = (GLfloat (*)[4]) dstRow; - for (i = j = 0, k = k0; i < (GLuint) dstWidth; - i++, j += colStride, k += colStride) { - dst[i][0] = (rowA[j][0] + rowA[k][0] + - rowB[j][0] + rowB[k][0]) * 0.25F; - dst[i][1] = (rowA[j][1] + rowA[k][1] + - rowB[j][1] + rowB[k][1]) * 0.25F; - dst[i][2] = (rowA[j][2] + rowA[k][2] + - rowB[j][2] + rowB[k][2]) * 0.25F; - dst[i][3] = (rowA[j][3] + rowA[k][3] + - rowB[j][3] + rowB[k][3]) * 0.25F; - } - } - return; - case MESA_FORMAT_RGBA_FLOAT16: - { - GLuint i, j, k, comp; - const GLhalfARB (*rowA)[4] = (const GLhalfARB (*)[4]) srcRowA; - const GLhalfARB (*rowB)[4] = (const GLhalfARB (*)[4]) srcRowB; - GLhalfARB (*dst)[4] = (GLhalfARB (*)[4]) dstRow; - for (i = j = 0, k = k0; i < (GLuint) dstWidth; - i++, j += colStride, k += colStride) { - for (comp = 0; comp < 4; comp++) { - GLfloat aj, ak, bj, bk; - aj = _mesa_half_to_float(rowA[j][comp]); - ak = _mesa_half_to_float(rowA[k][comp]); - bj = _mesa_half_to_float(rowB[j][comp]); - bk = _mesa_half_to_float(rowB[k][comp]); - dst[i][comp] = _mesa_float_to_half((aj + ak + bj + bk) * 0.25F); - } - } - } - return; - case MESA_FORMAT_RGB_FLOAT32: - { - GLuint i, j, k; - const GLfloat (*rowA)[3] = (const GLfloat (*)[3]) srcRowA; - const GLfloat (*rowB)[3] = (const GLfloat (*)[3]) srcRowB; - GLfloat (*dst)[3] = (GLfloat (*)[3]) dstRow; - for (i = j = 0, k = k0; i < (GLuint) dstWidth; - i++, j += colStride, k += colStride) { - dst[i][0] = (rowA[j][0] + rowA[k][0] + - rowB[j][0] + rowB[k][0]) * 0.25F; - dst[i][1] = (rowA[j][1] + rowA[k][1] + - rowB[j][1] + rowB[k][1]) * 0.25F; - dst[i][2] = (rowA[j][2] + rowA[k][2] + - rowB[j][2] + rowB[k][2]) * 0.25F; - } - } - return; - case MESA_FORMAT_RGB_FLOAT16: - { - GLuint i, j, k, comp; - const GLhalfARB (*rowA)[3] = (const GLhalfARB (*)[3]) srcRowA; - const GLhalfARB (*rowB)[3] = (const GLhalfARB (*)[3]) srcRowB; - GLhalfARB (*dst)[3] = (GLhalfARB (*)[3]) dstRow; - for (i = j = 0, k = k0; i < (GLuint) dstWidth; - i++, j += colStride, k += colStride) { - for (comp = 0; comp < 3; comp++) { - GLfloat aj, ak, bj, bk; - aj = _mesa_half_to_float(rowA[j][comp]); - ak = _mesa_half_to_float(rowA[k][comp]); - bj = _mesa_half_to_float(rowB[j][comp]); - bk = _mesa_half_to_float(rowB[k][comp]); - dst[i][comp] = _mesa_float_to_half((aj + ak + bj + bk) * 0.25F); - } - } - } - return; - case MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32: - { - GLuint i, j, k; - const GLfloat (*rowA)[2] = (const GLfloat (*)[2]) srcRowA; - const GLfloat (*rowB)[2] = (const GLfloat (*)[2]) srcRowB; - GLfloat (*dst)[2] = (GLfloat (*)[2]) dstRow; - for (i = j = 0, k = k0; i < (GLuint) dstWidth; - i++, j += colStride, k += colStride) { - dst[i][0] = (rowA[j][0] + rowA[k][0] + - rowB[j][0] + rowB[k][0]) * 0.25F; - dst[i][1] = (rowA[j][1] + rowA[k][1] + - rowB[j][1] + rowB[k][1]) * 0.25F; - } - } - return; - case MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16: - { - GLuint i, j, k, comp; - const GLhalfARB (*rowA)[2] = (const GLhalfARB (*)[2]) srcRowA; - const GLhalfARB (*rowB)[2] = (const GLhalfARB (*)[2]) srcRowB; - GLhalfARB (*dst)[2] = (GLhalfARB (*)[2]) dstRow; - for (i = j = 0, k = k0; i < (GLuint) dstWidth; - i++, j += colStride, k += colStride) { - for (comp = 0; comp < 2; comp++) { - GLfloat aj, ak, bj, bk; - aj = _mesa_half_to_float(rowA[j][comp]); - ak = _mesa_half_to_float(rowA[k][comp]); - bj = _mesa_half_to_float(rowB[j][comp]); - bk = _mesa_half_to_float(rowB[k][comp]); - dst[i][comp] = _mesa_float_to_half((aj + ak + bj + bk) * 0.25F); - } - } - } - return; - case MESA_FORMAT_ALPHA_FLOAT32: - case MESA_FORMAT_LUMINANCE_FLOAT32: - case MESA_FORMAT_INTENSITY_FLOAT32: - { - GLuint i, j, k; - const GLfloat *rowA = (const GLfloat *) srcRowA; - const GLfloat *rowB = (const GLfloat *) srcRowB; - GLfloat *dst = (GLfloat *) dstRow; - for (i = j = 0, k = k0; i < (GLuint) dstWidth; - i++, j += colStride, k += colStride) { - dst[i] = (rowA[j] + rowA[k] + rowB[j] + rowB[k]) * 0.25F; - } - } - return; - case MESA_FORMAT_ALPHA_FLOAT16: - case MESA_FORMAT_LUMINANCE_FLOAT16: - case MESA_FORMAT_INTENSITY_FLOAT16: - { - GLuint i, j, k; - const GLhalfARB *rowA = (const GLhalfARB *) srcRowA; - const GLhalfARB *rowB = (const GLhalfARB *) srcRowB; - GLhalfARB *dst = (GLhalfARB *) dstRow; - for (i = j = 0, k = k0; i < (GLuint) dstWidth; - i++, j += colStride, k += colStride) { - GLfloat aj, ak, bj, bk; - aj = _mesa_half_to_float(rowA[j]); - ak = _mesa_half_to_float(rowA[k]); - bj = _mesa_half_to_float(rowB[j]); - bk = _mesa_half_to_float(rowB[k]); - dst[i] = _mesa_float_to_half((aj + ak + bj + bk) * 0.25F); - } - } - return; - - default: - _mesa_problem(NULL, "bad format in do_row()"); - } -} - - -/* - * These functions generate a 1/2-size mipmap image from a source image. - * Texture borders are handled by copying or averaging the source image's - * border texels, depending on the scale-down factor. - */ - -static void -make_1d_mipmap(const struct gl_texture_format *format, GLint border, - GLint srcWidth, const GLubyte *srcPtr, - GLint dstWidth, GLubyte *dstPtr) -{ - const GLint bpt = format->TexelBytes; - const GLubyte *src; - GLubyte *dst; - - /* skip the border pixel, if any */ - src = srcPtr + border * bpt; - dst = dstPtr + border * bpt; - - /* we just duplicate the input row, kind of hack, saves code */ - do_row(format, srcWidth - 2 * border, src, src, - dstWidth - 2 * border, dst); - - if (border) { - /* copy left-most pixel from source */ - MEMCPY(dstPtr, srcPtr, bpt); - /* copy right-most pixel from source */ - MEMCPY(dstPtr + (dstWidth - 1) * bpt, - srcPtr + (srcWidth - 1) * bpt, - bpt); - } -} - - -/** - * XXX need to use the tex image's row stride! - */ -static void -make_2d_mipmap(const struct gl_texture_format *format, GLint border, - GLint srcWidth, GLint srcHeight, const GLubyte *srcPtr, - GLint dstWidth, GLint dstHeight, GLubyte *dstPtr) -{ - const GLint bpt = format->TexelBytes; - const GLint srcWidthNB = srcWidth - 2 * border; /* sizes w/out border */ - const GLint dstWidthNB = dstWidth - 2 * border; - const GLint dstHeightNB = dstHeight - 2 * border; - const GLint srcRowStride = bpt * srcWidth; - const GLint dstRowStride = bpt * dstWidth; - const GLubyte *srcA, *srcB; - GLubyte *dst; - GLint row; - - /* Compute src and dst pointers, skipping any border */ - srcA = srcPtr + border * ((srcWidth + 1) * bpt); - if (srcHeight > 1) - srcB = srcA + srcRowStride; - else - srcB = srcA; - dst = dstPtr + border * ((dstWidth + 1) * bpt); - - for (row = 0; row < dstHeightNB; row++) { - do_row(format, srcWidthNB, srcA, srcB, - dstWidthNB, dst); - srcA += 2 * srcRowStride; - srcB += 2 * srcRowStride; - dst += dstRowStride; - } - - /* This is ugly but probably won't be used much */ - if (border > 0) { - /* fill in dest border */ - /* lower-left border pixel */ - MEMCPY(dstPtr, srcPtr, bpt); - /* lower-right border pixel */ - MEMCPY(dstPtr + (dstWidth - 1) * bpt, - srcPtr + (srcWidth - 1) * bpt, bpt); - /* upper-left border pixel */ - MEMCPY(dstPtr + dstWidth * (dstHeight - 1) * bpt, - srcPtr + srcWidth * (srcHeight - 1) * bpt, bpt); - /* upper-right border pixel */ - MEMCPY(dstPtr + (dstWidth * dstHeight - 1) * bpt, - srcPtr + (srcWidth * srcHeight - 1) * bpt, bpt); - /* lower border */ - do_row(format, srcWidthNB, - srcPtr + bpt, - srcPtr + bpt, - dstWidthNB, dstPtr + bpt); - /* upper border */ - do_row(format, srcWidthNB, - srcPtr + (srcWidth * (srcHeight - 1) + 1) * bpt, - srcPtr + (srcWidth * (srcHeight - 1) + 1) * bpt, - dstWidthNB, - dstPtr + (dstWidth * (dstHeight - 1) + 1) * bpt); - /* left and right borders */ - if (srcHeight == dstHeight) { - /* copy border pixel from src to dst */ - for (row = 1; row < srcHeight; row++) { - MEMCPY(dstPtr + dstWidth * row * bpt, - srcPtr + srcWidth * row * bpt, bpt); - MEMCPY(dstPtr + (dstWidth * row + dstWidth - 1) * bpt, - srcPtr + (srcWidth * row + srcWidth - 1) * bpt, bpt); - } - } - else { - /* average two src pixels each dest pixel */ - for (row = 0; row < dstHeightNB; row += 2) { - do_row(format, 1, - srcPtr + (srcWidth * (row * 2 + 1)) * bpt, - srcPtr + (srcWidth * (row * 2 + 2)) * bpt, - 1, dstPtr + (dstWidth * row + 1) * bpt); - do_row(format, 1, - srcPtr + (srcWidth * (row * 2 + 1) + srcWidth - 1) * bpt, - srcPtr + (srcWidth * (row * 2 + 2) + srcWidth - 1) * bpt, - 1, dstPtr + (dstWidth * row + 1 + dstWidth - 1) * bpt); - } - } - } -} - - -static void -make_3d_mipmap(const struct gl_texture_format *format, GLint border, - GLint srcWidth, GLint srcHeight, GLint srcDepth, - const GLubyte *srcPtr, - GLint dstWidth, GLint dstHeight, GLint dstDepth, - GLubyte *dstPtr) -{ - const GLint bpt = format->TexelBytes; - const GLint srcWidthNB = srcWidth - 2 * border; /* sizes w/out border */ - const GLint srcDepthNB = srcDepth - 2 * border; - const GLint dstWidthNB = dstWidth - 2 * border; - const GLint dstHeightNB = dstHeight - 2 * border; - const GLint dstDepthNB = dstDepth - 2 * border; - GLvoid *tmpRowA, *tmpRowB; - GLint img, row; - GLint bytesPerSrcImage, bytesPerDstImage; - GLint bytesPerSrcRow, bytesPerDstRow; - GLint srcImageOffset, srcRowOffset; - - (void) srcDepthNB; /* silence warnings */ - - /* Need two temporary row buffers */ - tmpRowA = _mesa_malloc(srcWidth * bpt); - if (!tmpRowA) - return; - tmpRowB = _mesa_malloc(srcWidth * bpt); - if (!tmpRowB) { - _mesa_free(tmpRowA); - return; - } - - bytesPerSrcImage = srcWidth * srcHeight * bpt; - bytesPerDstImage = dstWidth * dstHeight * bpt; - - bytesPerSrcRow = srcWidth * bpt; - bytesPerDstRow = dstWidth * bpt; - - /* Offset between adjacent src images to be averaged together */ - srcImageOffset = (srcDepth == dstDepth) ? 0 : bytesPerSrcImage; - - /* Offset between adjacent src rows to be averaged together */ - srcRowOffset = (srcHeight == dstHeight) ? 0 : srcWidth * bpt; - - /* - * Need to average together up to 8 src pixels for each dest pixel. - * Break that down into 3 operations: - * 1. take two rows from source image and average them together. - * 2. take two rows from next source image and average them together. - * 3. take the two averaged rows and average them for the final dst row. - */ - - /* - _mesa_printf("mip3d %d x %d x %d -> %d x %d x %d\n", - srcWidth, srcHeight, srcDepth, dstWidth, dstHeight, dstDepth); - */ - - for (img = 0; img < dstDepthNB; img++) { - /* first source image pointer, skipping border */ - const GLubyte *imgSrcA = srcPtr - + (bytesPerSrcImage + bytesPerSrcRow + border) * bpt * border - + img * (bytesPerSrcImage + srcImageOffset); - /* second source image pointer, skipping border */ - const GLubyte *imgSrcB = imgSrcA + srcImageOffset; - /* address of the dest image, skipping border */ - GLubyte *imgDst = dstPtr - + (bytesPerDstImage + bytesPerDstRow + border) * bpt * border - + img * bytesPerDstImage; - - /* setup the four source row pointers and the dest row pointer */ - const GLubyte *srcImgARowA = imgSrcA; - const GLubyte *srcImgARowB = imgSrcA + srcRowOffset; - const GLubyte *srcImgBRowA = imgSrcB; - const GLubyte *srcImgBRowB = imgSrcB + srcRowOffset; - GLubyte *dstImgRow = imgDst; - - for (row = 0; row < dstHeightNB; row++) { - /* Average together two rows from first src image */ - do_row(format, srcWidthNB, srcImgARowA, srcImgARowB, - srcWidthNB, tmpRowA); - /* Average together two rows from second src image */ - do_row(format, srcWidthNB, srcImgBRowA, srcImgBRowB, - srcWidthNB, tmpRowB); - /* Average together the temp rows to make the final row */ - do_row(format, srcWidthNB, tmpRowA, tmpRowB, - dstWidthNB, dstImgRow); - /* advance to next rows */ - srcImgARowA += bytesPerSrcRow + srcRowOffset; - srcImgARowB += bytesPerSrcRow + srcRowOffset; - srcImgBRowA += bytesPerSrcRow + srcRowOffset; - srcImgBRowB += bytesPerSrcRow + srcRowOffset; - dstImgRow += bytesPerDstRow; - } - } - - _mesa_free(tmpRowA); - _mesa_free(tmpRowB); - - /* Luckily we can leverage the make_2d_mipmap() function here! */ - if (border > 0) { - /* do front border image */ - make_2d_mipmap(format, 1, srcWidth, srcHeight, srcPtr, - dstWidth, dstHeight, dstPtr); - /* do back border image */ - make_2d_mipmap(format, 1, srcWidth, srcHeight, - srcPtr + bytesPerSrcImage * (srcDepth - 1), - dstWidth, dstHeight, - dstPtr + bytesPerDstImage * (dstDepth - 1)); - /* do four remaining border edges that span the image slices */ - if (srcDepth == dstDepth) { - /* just copy border pixels from src to dst */ - for (img = 0; img < dstDepthNB; img++) { - const GLubyte *src; - GLubyte *dst; - - /* do border along [img][row=0][col=0] */ - src = srcPtr + (img + 1) * bytesPerSrcImage; - dst = dstPtr + (img + 1) * bytesPerDstImage; - MEMCPY(dst, src, bpt); - - /* do border along [img][row=dstHeight-1][col=0] */ - src = srcPtr + (img * 2 + 1) * bytesPerSrcImage - + (srcHeight - 1) * bytesPerSrcRow; - dst = dstPtr + (img + 1) * bytesPerDstImage - + (dstHeight - 1) * bytesPerDstRow; - MEMCPY(dst, src, bpt); - - /* do border along [img][row=0][col=dstWidth-1] */ - src = srcPtr + (img * 2 + 1) * bytesPerSrcImage - + (srcWidth - 1) * bpt; - dst = dstPtr + (img + 1) * bytesPerDstImage - + (dstWidth - 1) * bpt; - MEMCPY(dst, src, bpt); - - /* do border along [img][row=dstHeight-1][col=dstWidth-1] */ - src = srcPtr + (img * 2 + 1) * bytesPerSrcImage - + (bytesPerSrcImage - bpt); - dst = dstPtr + (img + 1) * bytesPerDstImage - + (bytesPerDstImage - bpt); - MEMCPY(dst, src, bpt); - } - } - else { - /* average border pixels from adjacent src image pairs */ - ASSERT(srcDepthNB == 2 * dstDepthNB); - for (img = 0; img < dstDepthNB; img++) { - const GLubyte *src; - GLubyte *dst; - - /* do border along [img][row=0][col=0] */ - src = srcPtr + (img * 2 + 1) * bytesPerSrcImage; - dst = dstPtr + (img + 1) * bytesPerDstImage; - do_row(format, 1, src, src + srcImageOffset, 1, dst); - - /* do border along [img][row=dstHeight-1][col=0] */ - src = srcPtr + (img * 2 + 1) * bytesPerSrcImage - + (srcHeight - 1) * bytesPerSrcRow; - dst = dstPtr + (img + 1) * bytesPerDstImage - + (dstHeight - 1) * bytesPerDstRow; - do_row(format, 1, src, src + srcImageOffset, 1, dst); - - /* do border along [img][row=0][col=dstWidth-1] */ - src = srcPtr + (img * 2 + 1) * bytesPerSrcImage - + (srcWidth - 1) * bpt; - dst = dstPtr + (img + 1) * bytesPerDstImage - + (dstWidth - 1) * bpt; - do_row(format, 1, src, src + srcImageOffset, 1, dst); - - /* do border along [img][row=dstHeight-1][col=dstWidth-1] */ - src = srcPtr + (img * 2 + 1) * bytesPerSrcImage - + (bytesPerSrcImage - bpt); - dst = dstPtr + (img + 1) * bytesPerDstImage - + (bytesPerDstImage - bpt); - do_row(format, 1, src, src + srcImageOffset, 1, dst); - } - } - } -} - - -/** - * For GL_SGIX_generate_mipmap: - * Generate a complete set of mipmaps from texObj's base-level image. - * Stop at texObj's MaxLevel or when we get to the 1x1 texture. - */ -void -_mesa_generate_mipmap(GLcontext *ctx, GLenum target, - const struct gl_texture_unit *texUnit, - struct gl_texture_object *texObj) -{ - const struct gl_texture_image *srcImage; - const struct gl_texture_format *convertFormat; - const GLubyte *srcData = NULL; - GLubyte *dstData = NULL; - GLint level, maxLevels; - - ASSERT(texObj); - /* XXX choose cube map face here??? */ - srcImage = texObj->Image[0][texObj->BaseLevel]; - ASSERT(srcImage); - - maxLevels = _mesa_max_texture_levels(ctx, texObj->Target); - ASSERT(maxLevels > 0); /* bad target */ - - /* Find convertFormat - the format that do_row() will process */ - if (srcImage->IsCompressed) { - /* setup for compressed textures */ - GLuint row; - GLint components, size; - GLchan *dst; - - assert(texObj->Target == GL_TEXTURE_2D); - - if (srcImage->_BaseFormat == GL_RGB) { - convertFormat = &_mesa_texformat_rgb; - components = 3; - } - else if (srcImage->_BaseFormat == GL_RGBA) { - convertFormat = &_mesa_texformat_rgba; - components = 4; - } - else { - _mesa_problem(ctx, "bad srcImage->_BaseFormat in _mesa_generate_mipmaps"); - return; - } - - /* allocate storage for uncompressed GL_RGB or GL_RGBA images */ - size = _mesa_bytes_per_pixel(srcImage->_BaseFormat, CHAN_TYPE) - * srcImage->Width * srcImage->Height * srcImage->Depth + 20; - /* 20 extra bytes, just be safe when calling last FetchTexel */ - srcData = (GLubyte *) _mesa_malloc(size); - if (!srcData) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "generate mipmaps"); - return; - } - dstData = (GLubyte *) _mesa_malloc(size / 2); /* 1/4 would probably be OK */ - if (!dstData) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "generate mipmaps"); - _mesa_free((void *) srcData); - return; - } - - /* decompress base image here */ - dst = (GLchan *) srcData; - for (row = 0; row < srcImage->Height; row++) { - GLuint col; - for (col = 0; col < srcImage->Width; col++) { - srcImage->FetchTexelc(srcImage, col, row, 0, dst); - dst += components; - } - } - } - else { - /* uncompressed */ - convertFormat = srcImage->TexFormat; - } - - for (level = texObj->BaseLevel; level < texObj->MaxLevel - && level < maxLevels - 1; level++) { - /* generate image[level+1] from image[level] */ - const struct gl_texture_image *srcImage; - struct gl_texture_image *dstImage; - GLint srcWidth, srcHeight, srcDepth; - GLint dstWidth, dstHeight, dstDepth; - GLint border, bytesPerTexel; - - /* get src image parameters */ - srcImage = _mesa_select_tex_image(ctx, texUnit, target, level); - ASSERT(srcImage); - srcWidth = srcImage->Width; - srcHeight = srcImage->Height; - srcDepth = srcImage->Depth; - border = srcImage->Border; - - /* compute next (level+1) image size */ - if (srcWidth - 2 * border > 1) { - dstWidth = (srcWidth - 2 * border) / 2 + 2 * border; - } - else { - dstWidth = srcWidth; /* can't go smaller */ - } - if (srcHeight - 2 * border > 1) { - dstHeight = (srcHeight - 2 * border) / 2 + 2 * border; - } - else { - dstHeight = srcHeight; /* can't go smaller */ - } - if (srcDepth - 2 * border > 1) { - dstDepth = (srcDepth - 2 * border) / 2 + 2 * border; - } - else { - dstDepth = srcDepth; /* can't go smaller */ - } - - if (dstWidth == srcWidth && - dstHeight == srcHeight && - dstDepth == srcDepth) { - /* all done */ - if (srcImage->IsCompressed) { - _mesa_free((void *) srcData); - _mesa_free(dstData); - } - return; - } - - /* get dest gl_texture_image */ - dstImage = _mesa_get_tex_image(ctx, texUnit, target, level + 1); - if (!dstImage) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "generating mipmaps"); - return; - } - - /* Free old image data */ - if (dstImage->Data) - ctx->Driver.FreeTexImageData(ctx, dstImage); - - /* initialize new image */ - _mesa_init_teximage_fields(ctx, target, dstImage, dstWidth, dstHeight, - dstDepth, border, srcImage->InternalFormat); - dstImage->DriverData = NULL; - dstImage->TexFormat = srcImage->TexFormat; - dstImage->FetchTexelc = srcImage->FetchTexelc; - dstImage->FetchTexelf = srcImage->FetchTexelf; - dstImage->IsCompressed = srcImage->IsCompressed; - if (dstImage->IsCompressed) { - dstImage->CompressedSize - = ctx->Driver.CompressedTextureSize(ctx, dstImage->Width, - dstImage->Height, - dstImage->Depth, - dstImage->TexFormat->MesaFormat); - ASSERT(dstImage->CompressedSize > 0); - } - - ASSERT(dstImage->TexFormat); - ASSERT(dstImage->FetchTexelc); - ASSERT(dstImage->FetchTexelf); - - /* Alloc new teximage data buffer. - * Setup src and dest data pointers. - */ - if (dstImage->IsCompressed) { - dstImage->Data = _mesa_alloc_texmemory(dstImage->CompressedSize); - if (!dstImage->Data) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "generating mipmaps"); - return; - } - /* srcData and dstData are already set */ - ASSERT(srcData); - ASSERT(dstData); - } - else { - bytesPerTexel = dstImage->TexFormat->TexelBytes; - ASSERT(dstWidth * dstHeight * dstDepth * bytesPerTexel > 0); - dstImage->Data = _mesa_alloc_texmemory(dstWidth * dstHeight - * dstDepth * bytesPerTexel); - if (!dstImage->Data) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "generating mipmaps"); - return; - } - srcData = (const GLubyte *) srcImage->Data; - dstData = (GLubyte *) dstImage->Data; - } - - /* - * We use simple 2x2 averaging to compute the next mipmap level. - */ - switch (target) { - case GL_TEXTURE_1D: - make_1d_mipmap(convertFormat, border, - srcWidth, srcData, - dstWidth, dstData); - break; - case GL_TEXTURE_2D: - case GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB: - case GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB: - case GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB: - case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB: - case GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB: - case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB: - make_2d_mipmap(convertFormat, border, - srcWidth, srcHeight, srcData, - dstWidth, dstHeight, dstData); - break; - case GL_TEXTURE_3D: - make_3d_mipmap(convertFormat, border, - srcWidth, srcHeight, srcDepth, srcData, - dstWidth, dstHeight, dstDepth, dstData); - break; - case GL_TEXTURE_RECTANGLE_NV: - /* no mipmaps, do nothing */ - break; - default: - _mesa_problem(ctx, "bad dimensions in _mesa_generate_mipmaps"); - return; - } - - if (dstImage->IsCompressed) { - GLubyte *temp; - /* compress image from dstData into dstImage->Data */ - const GLenum srcFormat = convertFormat->BaseFormat; - GLint dstRowStride - = _mesa_compressed_row_stride(dstImage->TexFormat->MesaFormat, dstWidth); - ASSERT(srcFormat == GL_RGB || srcFormat == GL_RGBA); - dstImage->TexFormat->StoreImage(ctx, 2, dstImage->_BaseFormat, - dstImage->TexFormat, - dstImage->Data, - 0, 0, 0, /* dstX/Y/Zoffset */ - dstRowStride, 0, /* strides */ - dstWidth, dstHeight, 1, /* size */ - srcFormat, CHAN_TYPE, - dstData, /* src data, actually */ - &ctx->DefaultPacking); - /* swap src and dest pointers */ - temp = (GLubyte *) srcData; - srcData = dstData; - dstData = temp; - } - - } /* loop over mipmap levels */ -} - - -/** - * Helper function for drivers which need to rescale texture images to - * certain aspect ratios. - * Nearest filtering only (for broken hardware that can't support - * all aspect ratios). This can be made a lot faster, but I don't - * really care enough... - */ -void -_mesa_rescale_teximage2d (GLuint bytesPerPixel, - GLuint srcStrideInPixels, - GLuint dstRowStride, - GLint srcWidth, GLint srcHeight, - GLint dstWidth, GLint dstHeight, - const GLvoid *srcImage, GLvoid *dstImage) -{ - GLint row, col; - -#define INNER_LOOP( TYPE, HOP, WOP ) \ - for ( row = 0 ; row < dstHeight ; row++ ) { \ - GLint srcRow = row HOP hScale; \ - for ( col = 0 ; col < dstWidth ; col++ ) { \ - GLint srcCol = col WOP wScale; \ - dst[col] = src[srcRow * srcStrideInPixels + srcCol]; \ - } \ - dst = (TYPE *) ((GLubyte *) dst + dstRowStride); \ - } \ - -#define RESCALE_IMAGE( TYPE ) \ -do { \ - const TYPE *src = (const TYPE *)srcImage; \ - TYPE *dst = (TYPE *)dstImage; \ - \ - if ( srcHeight < dstHeight ) { \ - const GLint hScale = dstHeight / srcHeight; \ - if ( srcWidth < dstWidth ) { \ - const GLint wScale = dstWidth / srcWidth; \ - INNER_LOOP( TYPE, /, / ); \ - } \ - else { \ - const GLint wScale = srcWidth / dstWidth; \ - INNER_LOOP( TYPE, /, * ); \ - } \ - } \ - else { \ - const GLint hScale = srcHeight / dstHeight; \ - if ( srcWidth < dstWidth ) { \ - const GLint wScale = dstWidth / srcWidth; \ - INNER_LOOP( TYPE, *, / ); \ - } \ - else { \ - const GLint wScale = srcWidth / dstWidth; \ - INNER_LOOP( TYPE, *, * ); \ - } \ - } \ -} while (0) - - switch ( bytesPerPixel ) { - case 4: - RESCALE_IMAGE( GLuint ); - break; - - case 2: - RESCALE_IMAGE( GLushort ); - break; - - case 1: - RESCALE_IMAGE( GLubyte ); - break; - default: - _mesa_problem(NULL,"unexpected bytes/pixel in _mesa_rescale_teximage2d"); - } -} - - -/** - * Upscale an image by replication, not (typical) stretching. - * We use this when the image width or height is less than a - * certain size (4, 8) and we need to upscale an image. - */ -void -_mesa_upscale_teximage2d (GLsizei inWidth, GLsizei inHeight, - GLsizei outWidth, GLsizei outHeight, - GLint comps, const GLchan *src, GLint srcRowStride, - GLchan *dest ) -{ - GLint i, j, k; - - ASSERT(outWidth >= inWidth); - ASSERT(outHeight >= inHeight); -#if 0 - ASSERT(inWidth == 1 || inWidth == 2 || inHeight == 1 || inHeight == 2); - ASSERT((outWidth & 3) == 0); - ASSERT((outHeight & 3) == 0); -#endif - - for (i = 0; i < outHeight; i++) { - const GLint ii = i % inHeight; - for (j = 0; j < outWidth; j++) { - const GLint jj = j % inWidth; - for (k = 0; k < comps; k++) { - dest[(i * outWidth + j) * comps + k] - = src[ii * srcRowStride + jj * comps + k]; - } - } - } -} #if FEATURE_EXT_texture_sRGB @@ -4381,10 +3608,9 @@ _mesa_get_teximage(GLcontext *ctx, GLenum target, GLint level, for (col = 0; col < width; col++) { (*texImage->FetchTexelf)(texImage, col, row, img, rgba[col]); } - _mesa_pack_rgba_span_float(ctx, width, - (const GLfloat (*)[4]) rgba, - format, type, dest, &ctx->Pack, - 0 /* no image transfer */); + _mesa_pack_rgba_span_float(ctx, width, (GLfloat (*)[4]) rgba, + format, type, dest, + &ctx->Pack, 0x0 /*image xfer ops*/); } /* format */ } /* row */ } /* img */ diff --git a/src/mesa/main/texstore.h b/src/mesa/main/texstore.h index 7dc82a51c89..f67defc503f 100644 --- a/src/mesa/main/texstore.h +++ b/src/mesa/main/texstore.h @@ -200,27 +200,6 @@ _mesa_store_compressed_texsubimage3d(GLcontext *ctx, GLenum target, struct gl_texture_image *texImage); -extern void -_mesa_generate_mipmap(GLcontext *ctx, GLenum target, - const struct gl_texture_unit *texUnit, - struct gl_texture_object *texObj); - - -extern void -_mesa_rescale_teximage2d(GLuint bytesPerPixel, - GLuint srcStrideInPixels, - GLuint dstRowStride, - GLint srcWidth, GLint srcHeight, - GLint dstWidth, GLint dstHeight, - const GLvoid *srcImage, GLvoid *dstImage); - -extern void -_mesa_upscale_teximage2d(GLsizei inWidth, GLsizei inHeight, - GLsizei outWidth, GLsizei outHeight, - GLint comps, const GLchan *src, GLint srcRowStride, - GLchan *dest); - - extern void _mesa_get_teximage(GLcontext *ctx, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels, diff --git a/src/mesa/main/version.h b/src/mesa/main/version.h index 1c01d900192..e6196050b9e 100644 --- a/src/mesa/main/version.h +++ b/src/mesa/main/version.h @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.5.1 + * Version: 6.5.2 * * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. * @@ -30,8 +30,8 @@ /* Mesa version */ #define MESA_MAJOR 6 #define MESA_MINOR 5 -#define MESA_PATCH 1 -#define MESA_VERSION_STRING "6.5.1" +#define MESA_PATCH 2 +#define MESA_VERSION_STRING "6.5.2" /* To make version comparison easy */ #define MESA_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) diff --git a/src/mesa/shader/arbprogparse.c b/src/mesa/shader/arbprogparse.c index b8e5e4bd8ae..43e3bc183d4 100644 --- a/src/mesa/shader/arbprogparse.c +++ b/src/mesa/shader/arbprogparse.c @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.5.1 + * Version: 6.5.2 * * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. * @@ -2571,8 +2571,6 @@ parse_fp_vector_src_reg(GLcontext * ctx, const GLubyte ** inst, reg->File = file; reg->Index = index; - reg->Abs = 0; /* NV only */ - reg->NegateAbs = 0; /* NV only */ reg->NegateBase = negate; reg->Swizzle = MAKE_SWIZZLE4(swizzle[0], swizzle[1], swizzle[2], swizzle[3]); return 0; @@ -2595,8 +2593,6 @@ parse_fp_dst_reg(GLcontext * ctx, const GLubyte ** inst, if (parse_masked_dst_reg (ctx, inst, vc_head, Program, &file, &idx, &mask)) return 1; - reg->CondMask = 0; /* NV only */ - reg->CondSwizzle = 0; /* NV only */ reg->File = file; reg->Index = idx; reg->WriteMask = mask; @@ -2632,8 +2628,6 @@ parse_fp_scalar_src_reg (GLcontext * ctx, const GLubyte ** inst, reg->File = File; reg->Index = Index; - reg->Abs = 0; /* NV only */ - reg->NegateAbs = 0; /* NV only */ reg->NegateBase = Negate; reg->Swizzle = (Swizzle[0] << 0); @@ -2656,7 +2650,7 @@ parse_fp_instruction (GLcontext * ctx, const GLubyte ** inst, GLubyte instClass, type, code; GLboolean rel; - _mesa_init_instruction(fp); + _mesa_init_instructions(fp, 1); /* Record the position in the program string for debugging */ fp->StringPos = Program->Position; @@ -3148,7 +3142,7 @@ parse_vp_instruction (GLcontext * ctx, const GLubyte ** inst, /* The actual opcode name */ code = *(*inst)++; - _mesa_init_instruction(vp); + _mesa_init_instructions(vp, 1); /* Record the position in the program string for debugging */ vp->StringPos = Program->Position; @@ -3690,7 +3684,7 @@ parse_instructions(GLcontext * ctx, const GLubyte * inst, /* Finally, tag on an OPCODE_END instruction */ { const GLuint numInst = Program->Base.NumInstructions; - _mesa_init_instruction(Program->Base.Instructions + numInst); + _mesa_init_instructions(Program->Base.Instructions + numInst, 1); Program->Base.Instructions[numInst].Opcode = OPCODE_END; /* YYY Wrong Position in program, whatever, at least not random -> crash Program->Position = parse_position (&inst); diff --git a/src/mesa/shader/arbprogram.c b/src/mesa/shader/arbprogram.c index 89f2d20cc9a..91fb6910381 100644 --- a/src/mesa/shader/arbprogram.c +++ b/src/mesa/shader/arbprogram.c @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.5 + * Version: 6.5.2 * * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. * @@ -36,6 +36,7 @@ #include "imports.h" #include "macros.h" #include "mtypes.h" +#include "program.h" void GLAPIENTRY @@ -101,7 +102,7 @@ _mesa_GetVertexAttribfvARB(GLuint index, GLenum pname, GLfloat *params) GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); - if (index == 0 || index >= MAX_VERTEX_PROGRAM_ATTRIBS) { + if (index >= MAX_VERTEX_PROGRAM_ATTRIBS) { _mesa_error(ctx, GL_INVALID_VALUE, "glGetVertexAttribfvARB(index)"); return; } @@ -123,6 +124,11 @@ _mesa_GetVertexAttribfvARB(GLuint index, GLenum pname, GLfloat *params) params[0] = ctx->Array.ArrayObj->VertexAttrib[index].Normalized; break; case GL_CURRENT_VERTEX_ATTRIB_ARB: + if (index == 0) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glGetVertexAttribfvARB(index==0)"); + return; + } FLUSH_CURRENT(ctx, 0); COPY_4V(params, ctx->Current.Attrib[VERT_ATTRIB_GENERIC0 + index]); break; @@ -179,6 +185,29 @@ _mesa_GetVertexAttribPointervARB(GLuint index, GLenum pname, GLvoid **pointer) } +/** + * Determine if id names a vertex or fragment program. + * \note Not compiled into display lists. + * \note Called from both glIsProgramNV and glIsProgramARB. + * \param id is the program identifier + * \return GL_TRUE if id is a program, else GL_FALSE. + */ +GLboolean GLAPIENTRY +_mesa_IsProgramARB(GLuint id) +{ + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE); + + if (id == 0) + return GL_FALSE; + + if (_mesa_lookup_program(ctx, id)) + return GL_TRUE; + else + return GL_FALSE; +} + + void GLAPIENTRY _mesa_ProgramStringARB(GLenum target, GLenum format, GLsizei len, const GLvoid *string) diff --git a/src/mesa/shader/arbprogram.h b/src/mesa/shader/arbprogram.h index 54a14bbb9f8..233f6629650 100644 --- a/src/mesa/shader/arbprogram.h +++ b/src/mesa/shader/arbprogram.h @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 5.1 + * Version: 6.5.2 * - * Copyright (C) 1999-2003 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2006 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"), @@ -51,6 +51,10 @@ extern void GLAPIENTRY _mesa_GetVertexAttribPointervARB(GLuint index, GLenum pname, GLvoid **pointer); +extern GLboolean GLAPIENTRY +_mesa_IsProgramARB(GLuint id); + + extern void GLAPIENTRY _mesa_ProgramStringARB(GLenum target, GLenum format, GLsizei len, const GLvoid *string); diff --git a/src/mesa/shader/grammar/grammar.c b/src/mesa/shader/grammar/grammar.c index 0b767c02cd3..7f2ee42d21d 100644 --- a/src/mesa/shader/grammar/grammar.c +++ b/src/mesa/shader/grammar/grammar.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.2 + * Version: 6.6 * - * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2006 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"), @@ -368,9 +368,10 @@ static int str_equal_n (const byte *str1, const byte *str2, unsigned int n) return grammar_string_compare_n (str1, str2, n) == 0; } -static unsigned int str_length (const byte *str) +static int +str_length (const byte *str) { - return grammar_string_length (str); + return (int) (grammar_string_length (str)); } /* @@ -655,7 +656,9 @@ static void error_destroy (error **er) } struct dict_; -static byte *error_get_token (error *, struct dict_ *, const byte *, unsigned int); + +static byte * +error_get_token (error *, struct dict_ *, const byte *, int); /* condition operand type typedef @@ -1616,7 +1619,8 @@ static int get_error (const byte **text, error **er, map_str *maps) /* try to extract "token" from "...$token$..." */ { byte *processed = NULL; - unsigned int len = 0, i = 0; + unsigned int len = 0; + int i = 0; if (string_grow (&processed, &len, '\0')) { @@ -2274,12 +2278,13 @@ typedef enum match_result_ } match_result; /* - This function does the main job. It parses the text and generates output data. -*/ -static match_result match (dict *di, const byte *text, unsigned int *index, rule *ru, barray **ba, - int filtering_string, regbyte_ctx **rbc) + * This function does the main job. It parses the text and generates output data. + */ +static match_result +match (dict *di, const byte *text, int *index, rule *ru, barray **ba, int filtering_string, + regbyte_ctx **rbc) { - unsigned int ind = *index; + int ind = *index; match_result status = mr_not_matched; spec *sp = ru->m_specs; regbyte_ctx *ctx = *rbc; @@ -2287,7 +2292,7 @@ static match_result match (dict *di, const byte *text, unsigned int *index, rule /* for every specifier in the rule */ while (sp) { - unsigned int i, len, save_ind = ind; + int i, len, save_ind = ind; barray *array = NULL; if (satisfies_condition (sp->m_cond, ctx)) @@ -2318,7 +2323,7 @@ static match_result match (dict *di, const byte *text, unsigned int *index, rule if (!filtering_string && di->m_string) { barray *ba; - unsigned int filter_index = 0; + int filter_index = 0; match_result result; regbyte_ctx *null_ctx = NULL; @@ -2510,10 +2515,11 @@ static match_result match (dict *di, const byte *text, unsigned int *index, rule return mr_not_matched; } -static match_result fast_match (dict *di, const byte *text, unsigned int *index, rule *ru, int *_PP, bytepool *_BP, - int filtering_string, regbyte_ctx **rbc) +static match_result +fast_match (dict *di, const byte *text, int *index, rule *ru, int *_PP, bytepool *_BP, + int filtering_string, regbyte_ctx **rbc) { - unsigned int ind = *index; + int ind = *index; int _P = filtering_string ? 0 : *_PP; int _P2; match_result status = mr_not_matched; @@ -2523,7 +2529,7 @@ static match_result fast_match (dict *di, const byte *text, unsigned int *index, /* for every specifier in the rule */ while (sp) { - unsigned int i, len, save_ind = ind; + int i, len, save_ind = ind; _P2 = _P + (sp->m_emits ? emit_size (sp->m_emits) : 0); if (bytepool_reserve (_BP, _P2)) @@ -2551,7 +2557,7 @@ static match_result fast_match (dict *di, const byte *text, unsigned int *index, /* prefilter the stream */ if (!filtering_string && di->m_string) { - unsigned int filter_index = 0; + int filter_index = 0; match_result result; regbyte_ctx *null_ctx = NULL; @@ -2722,14 +2728,15 @@ static match_result fast_match (dict *di, const byte *text, unsigned int *index, return mr_not_matched; } -static byte *error_get_token (error *er, dict *di, const byte *text, unsigned int ind) +static byte * +error_get_token (error *er, dict *di, const byte *text, int ind) { byte *str = NULL; if (er->m_token) { barray *ba; - unsigned int filter_index = 0; + int filter_index = 0; regbyte_ctx *ctx = NULL; barray_create (&ba); @@ -2990,7 +2997,7 @@ static int _grammar_check (grammar id, const byte *text, byte **prod, unsigned i unsigned int estimate_prod_size, int use_fast_path) { dict *di = NULL; - unsigned int index = 0; + int index = 0; clear_last_error (); diff --git a/src/mesa/shader/nvfragparse.c b/src/mesa/shader/nvfragparse.c index 49ce220944e..5f3a30b7416 100644 --- a/src/mesa/shader/nvfragparse.c +++ b/src/mesa/shader/nvfragparse.c @@ -1273,7 +1273,7 @@ Parse_InstructionSequence(struct parse_state *parseState, GLubyte token[100]; /* Initialize the instruction */ - _mesa_init_instruction(inst); + _mesa_init_instructions(inst, 1); /* special instructions */ if (Parse_String(parseState, "DEFINE")) { diff --git a/src/mesa/shader/nvprogram.c b/src/mesa/shader/nvprogram.c index 4e29e0b3f88..4f160b14312 100644 --- a/src/mesa/shader/nvprogram.c +++ b/src/mesa/shader/nvprogram.c @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.5.1 + * Version: 6.5.2 * * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. * @@ -77,10 +77,7 @@ _mesa_ExecuteProgramNV(GLenum target, GLuint id, const GLfloat *params) return; } - _mesa_init_vp_per_vertex_registers(ctx); - _mesa_init_vp_per_primitive_registers(ctx); - COPY_4V(ctx->VertexProgram.Inputs[VERT_ATTRIB_POS], params); - _mesa_exec_vertex_program(ctx, vprog); + _mesa_exec_vertex_state_program(ctx, vprog, params); } @@ -89,8 +86,9 @@ _mesa_ExecuteProgramNV(GLenum target, GLuint id, const GLfloat *params) * \note Not compiled into display lists. * \note Called from the GL API dispatcher. */ -GLboolean GLAPIENTRY _mesa_AreProgramsResidentNV(GLsizei n, const GLuint *ids, - GLboolean *residences) +GLboolean GLAPIENTRY +_mesa_AreProgramsResidentNV(GLsizei n, const GLuint *ids, + GLboolean *residences) { GLint i, j; GLboolean allResident = GL_TRUE; @@ -362,7 +360,7 @@ _mesa_GetVertexAttribdvNV(GLuint index, GLenum pname, GLdouble *params) GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); - if (index == 0 || index >= MAX_NV_VERTEX_PROGRAM_INPUTS) { + if (index >= MAX_NV_VERTEX_PROGRAM_INPUTS) { _mesa_error(ctx, GL_INVALID_VALUE, "glGetVertexAttribdvNV(index)"); return; } @@ -378,6 +376,11 @@ _mesa_GetVertexAttribdvNV(GLuint index, GLenum pname, GLdouble *params) params[0] = ctx->Array.ArrayObj->VertexAttrib[index].Type; break; case GL_CURRENT_ATTRIB_NV: + if (index == 0) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glGetVertexAttribdvNV(index == 0)"); + return; + } FLUSH_CURRENT(ctx, 0); COPY_4V(params, ctx->Current.Attrib[index]); break; @@ -398,7 +401,7 @@ _mesa_GetVertexAttribfvNV(GLuint index, GLenum pname, GLfloat *params) GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); - if (index == 0 || index >= MAX_NV_VERTEX_PROGRAM_INPUTS) { + if (index >= MAX_NV_VERTEX_PROGRAM_INPUTS) { _mesa_error(ctx, GL_INVALID_VALUE, "glGetVertexAttribdvNV(index)"); return; } @@ -414,6 +417,11 @@ _mesa_GetVertexAttribfvNV(GLuint index, GLenum pname, GLfloat *params) params[0] = (GLfloat) ctx->Array.ArrayObj->VertexAttrib[index].Type; break; case GL_CURRENT_ATTRIB_NV: + if (index == 0) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glGetVertexAttribfvNV(index == 0)"); + return; + } FLUSH_CURRENT(ctx, 0); COPY_4V(params, ctx->Current.Attrib[index]); break; @@ -434,7 +442,7 @@ _mesa_GetVertexAttribivNV(GLuint index, GLenum pname, GLint *params) GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); - if (index == 0 || index >= MAX_NV_VERTEX_PROGRAM_INPUTS) { + if (index >= MAX_NV_VERTEX_PROGRAM_INPUTS) { _mesa_error(ctx, GL_INVALID_VALUE, "glGetVertexAttribdvNV(index)"); return; } @@ -450,6 +458,11 @@ _mesa_GetVertexAttribivNV(GLuint index, GLenum pname, GLint *params) params[0] = ctx->Array.ArrayObj->VertexAttrib[index].Type; break; case GL_CURRENT_ATTRIB_NV: + if (index == 0) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glGetVertexAttribivNV(index == 0)"); + return; + } FLUSH_CURRENT(ctx, 0); params[0] = (GLint) ctx->Current.Attrib[index][0]; params[1] = (GLint) ctx->Current.Attrib[index][1]; diff --git a/src/mesa/shader/nvvertexec.c b/src/mesa/shader/nvvertexec.c index c436f4f0451..10962d7e14a 100644 --- a/src/mesa/shader/nvvertexec.c +++ b/src/mesa/shader/nvvertexec.c @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.5 + * Version: 6.5.2 * * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. * @@ -47,23 +47,23 @@ static const GLfloat ZeroVec[4] = { 0.0F, 0.0F, 0.0F, 0.0F }; * per-vertex. */ void -_mesa_init_vp_per_vertex_registers(GLcontext *ctx) +_mesa_init_vp_per_vertex_registers(GLcontext *ctx, struct vp_machine *machine) { /* Input registers get initialized from the current vertex attribs */ - MEMCPY(ctx->VertexProgram.Inputs, ctx->Current.Attrib, + MEMCPY(machine->Inputs, ctx->Current.Attrib, MAX_VERTEX_PROGRAM_ATTRIBS * 4 * sizeof(GLfloat)); if (ctx->VertexProgram.Current->IsNVProgram) { GLuint i; /* Output/result regs are initialized to [0,0,0,1] */ for (i = 0; i < MAX_NV_VERTEX_PROGRAM_OUTPUTS; i++) { - ASSIGN_4V(ctx->VertexProgram.Outputs[i], 0.0F, 0.0F, 0.0F, 1.0F); + ASSIGN_4V(machine->Outputs[i], 0.0F, 0.0F, 0.0F, 1.0F); } /* Temp regs are initialized to [0,0,0,0] */ for (i = 0; i < MAX_NV_VERTEX_PROGRAM_TEMPS; i++) { - ASSIGN_4V(ctx->VertexProgram.Temporaries[i], 0.0F, 0.0F, 0.0F, 0.0F); + ASSIGN_4V(machine->Temporaries[i], 0.0F, 0.0F, 0.0F, 0.0F); } - ASSIGN_4V(ctx->VertexProgram.AddressReg, 0, 0, 0, 0); + ASSIGN_4V(machine->AddressReg, 0, 0, 0, 0); } } @@ -139,7 +139,7 @@ _mesa_init_vp_per_primitive_registers(GLcontext *ctx) continue; } - /* load the matrix */ + /* load the matrix values into sequential registers */ if (ctx->VertexProgram.TrackMatrixTransform[i] == GL_IDENTITY_NV) { load_matrix(ctx->VertexProgram.Parameters, i*4, mat->m); } @@ -161,7 +161,7 @@ _mesa_init_vp_per_primitive_registers(GLcontext *ctx) } } else { - /* Using and ARB vertex program */ + /* ARB vertex program */ if (ctx->VertexProgram.Current->Base.Parameters) { /* Grab the state GL state and put into registers */ _mesa_load_state_parameters(ctx, @@ -176,36 +176,37 @@ _mesa_init_vp_per_primitive_registers(GLcontext *ctx) * For debugging. Dump the current vertex program machine registers. */ void -_mesa_dump_vp_state( const struct gl_vertex_program_state *state ) +_mesa_dump_vp_state( const struct gl_vertex_program_state *state, + const struct vp_machine *machine) { int i; _mesa_printf("VertexIn:\n"); for (i = 0; i < MAX_NV_VERTEX_PROGRAM_INPUTS; i++) { _mesa_printf("%d: %f %f %f %f ", i, - state->Inputs[i][0], - state->Inputs[i][1], - state->Inputs[i][2], - state->Inputs[i][3]); + machine->Inputs[i][0], + machine->Inputs[i][1], + machine->Inputs[i][2], + machine->Inputs[i][3]); } _mesa_printf("\n"); _mesa_printf("VertexOut:\n"); for (i = 0; i < MAX_NV_VERTEX_PROGRAM_OUTPUTS; i++) { _mesa_printf("%d: %f %f %f %f ", i, - state->Outputs[i][0], - state->Outputs[i][1], - state->Outputs[i][2], - state->Outputs[i][3]); + machine->Outputs[i][0], + machine->Outputs[i][1], + machine->Outputs[i][2], + machine->Outputs[i][3]); } _mesa_printf("\n"); _mesa_printf("Registers:\n"); for (i = 0; i < MAX_NV_VERTEX_PROGRAM_TEMPS; i++) { _mesa_printf("%d: %f %f %f %f ", i, - state->Temporaries[i][0], - state->Temporaries[i][1], - state->Temporaries[i][2], - state->Temporaries[i][3]); + machine->Temporaries[i][0], + machine->Temporaries[i][1], + machine->Temporaries[i][2], + machine->Temporaries[i][3]); } _mesa_printf("\n"); @@ -227,41 +228,45 @@ _mesa_dump_vp_state( const struct gl_vertex_program_state *state ) * source register. */ static INLINE const GLfloat * -get_register_pointer( const struct prog_src_register *source, - const struct gl_vertex_program_state *state ) +get_register_pointer( GLcontext *ctx, + const struct prog_src_register *source, + struct vp_machine *machine, + const struct gl_vertex_program *program ) { if (source->RelAddr) { - const GLint reg = source->Index + state->AddressReg[0]; + const GLint reg = source->Index + machine->AddressReg[0]; ASSERT( (source->File == PROGRAM_ENV_PARAM) || (source->File == PROGRAM_STATE_VAR) ); if (reg < 0 || reg > MAX_NV_VERTEX_PROGRAM_PARAMS) return ZeroVec; else if (source->File == PROGRAM_ENV_PARAM) - return state->Parameters[reg]; - else - return state->Current->Base.Parameters->ParameterValues[reg]; + return ctx->VertexProgram.Parameters[reg]; + else { + ASSERT(source->File == PROGRAM_LOCAL_PARAM); + return program->Base.Parameters->ParameterValues[reg]; + } } else { switch (source->File) { case PROGRAM_TEMPORARY: ASSERT(source->Index < MAX_NV_VERTEX_PROGRAM_TEMPS); - return state->Temporaries[source->Index]; + return machine->Temporaries[source->Index]; case PROGRAM_INPUT: ASSERT(source->Index < MAX_NV_VERTEX_PROGRAM_INPUTS); - return state->Inputs[source->Index]; + return machine->Inputs[source->Index]; case PROGRAM_OUTPUT: /* This is only needed for the PRINT instruction */ ASSERT(source->Index < MAX_NV_VERTEX_PROGRAM_OUTPUTS); - return state->Outputs[source->Index]; + return machine->Outputs[source->Index]; case PROGRAM_LOCAL_PARAM: ASSERT(source->Index < MAX_PROGRAM_LOCAL_PARAMS); - return state->Current->Base.LocalParams[source->Index]; + return program->Base.LocalParams[source->Index]; case PROGRAM_ENV_PARAM: ASSERT(source->Index < MAX_NV_VERTEX_PROGRAM_PARAMS); - return state->Parameters[source->Index]; + return ctx->VertexProgram.Parameters[source->Index]; case PROGRAM_STATE_VAR: - ASSERT(source->Index < state->Current->Base.Parameters->NumParameters); - return state->Current->Base.Parameters->ParameterValues[source->Index]; + ASSERT(source->Index < program->Base.Parameters->NumParameters); + return program->Base.Parameters->ParameterValues[source->Index]; default: _mesa_problem(NULL, "Bad source register file in get_register_pointer"); @@ -277,23 +282,23 @@ get_register_pointer( const struct prog_src_register *source, * Apply swizzling and negating as needed. */ static INLINE void -fetch_vector4( const struct prog_src_register *source, - const struct gl_vertex_program_state *state, +fetch_vector4( GLcontext *ctx, + const struct prog_src_register *source, + struct vp_machine *machine, + const struct gl_vertex_program *program, GLfloat result[4] ) { - const GLfloat *src = get_register_pointer(source, state); - + const GLfloat *src = get_register_pointer(ctx, source, machine, program); + ASSERT(src); + result[0] = src[GET_SWZ(source->Swizzle, 0)]; + result[1] = src[GET_SWZ(source->Swizzle, 1)]; + result[2] = src[GET_SWZ(source->Swizzle, 2)]; + result[3] = src[GET_SWZ(source->Swizzle, 3)]; if (source->NegateBase) { - result[0] = -src[GET_SWZ(source->Swizzle, 0)]; - result[1] = -src[GET_SWZ(source->Swizzle, 1)]; - result[2] = -src[GET_SWZ(source->Swizzle, 2)]; - result[3] = -src[GET_SWZ(source->Swizzle, 3)]; - } - else { - result[0] = src[GET_SWZ(source->Swizzle, 0)]; - result[1] = src[GET_SWZ(source->Swizzle, 1)]; - result[2] = src[GET_SWZ(source->Swizzle, 2)]; - result[3] = src[GET_SWZ(source->Swizzle, 3)]; + result[0] = -result[0]; + result[1] = -result[1]; + result[2] = -result[2]; + result[3] = -result[3]; } } @@ -303,17 +308,17 @@ fetch_vector4( const struct prog_src_register *source, * As above, but only return result[0] element. */ static INLINE void -fetch_vector1( const struct prog_src_register *source, - const struct gl_vertex_program_state *state, +fetch_vector1( GLcontext *ctx, + const struct prog_src_register *source, + struct vp_machine *machine, + const struct gl_vertex_program *program, GLfloat result[4] ) { - const GLfloat *src = get_register_pointer(source, state); - + const GLfloat *src = get_register_pointer(ctx, source, machine, program); + ASSERT(src); + result[0] = src[GET_SWZ(source->Swizzle, 0)]; if (source->NegateBase) { - result[0] = -src[GET_SWZ(source->Swizzle, 0)]; - } - else { - result[0] = src[GET_SWZ(source->Swizzle, 0)]; + result[0] = -result[0]; } } @@ -322,19 +327,21 @@ fetch_vector1( const struct prog_src_register *source, * Store 4 floats into a register. */ static void -store_vector4( const struct prog_dst_register *dest, - struct gl_vertex_program_state *state, +store_vector4( const struct prog_instruction *inst, + struct vp_machine *machine, const GLfloat value[4] ) { + const struct prog_dst_register *dest = &(inst->DstReg); GLfloat *dst; switch (dest->File) { - case PROGRAM_TEMPORARY: - dst = state->Temporaries[dest->Index]; - break; case PROGRAM_OUTPUT: - dst = state->Outputs[dest->Index]; + dst = machine->Outputs[dest->Index]; + break; + case PROGRAM_TEMPORARY: + dst = machine->Temporaries[dest->Index]; break; case PROGRAM_ENV_PARAM: + /* Only for VP state programs */ { /* a slight hack */ GET_CURRENT_CONTEXT(ctx); @@ -379,9 +386,10 @@ store_vector4( const struct prog_dst_register *dest, * Execute the given vertex program */ void -_mesa_exec_vertex_program(GLcontext *ctx, const struct gl_vertex_program *program) +_mesa_exec_vertex_program(GLcontext *ctx, + struct vp_machine *machine, + const struct gl_vertex_program *program) { - struct gl_vertex_program_state *state = &ctx->VertexProgram; const struct prog_instruction *inst; ctx->_CurrentProgram = GL_VERTEX_PROGRAM_ARB; /* or NV, doesn't matter */ @@ -390,9 +398,9 @@ _mesa_exec_vertex_program(GLcontext *ctx, const struct gl_vertex_program *progra * by the MVP matrix and store in the vertex position result register. */ if (ctx->VertexProgram.Current->IsPositionInvariant) { - TRANSFORM_POINT( ctx->VertexProgram.Outputs[VERT_RESULT_HPOS], + TRANSFORM_POINT( machine->Outputs[VERT_RESULT_HPOS], ctx->_ModelProjectMatrix.m, - ctx->VertexProgram.Inputs[VERT_ATTRIB_POS]); + machine->Inputs[VERT_ATTRIB_POS]); /* XXX: This could go elsewhere */ ctx->VertexProgram.Current->Base.OutputsWritten |= VERT_BIT_POS; @@ -411,15 +419,15 @@ _mesa_exec_vertex_program(GLcontext *ctx, const struct gl_vertex_program *progra case OPCODE_MOV: { GLfloat t[4]; - fetch_vector4( &inst->SrcReg[0], state, t ); - store_vector4( &inst->DstReg, state, t ); + fetch_vector4( ctx, &inst->SrcReg[0], machine, program, t ); + store_vector4( inst, machine, t ); } break; case OPCODE_LIT: { const GLfloat epsilon = 1.0F / 256.0F; /* per NV spec */ GLfloat t[4], lit[4]; - fetch_vector4( &inst->SrcReg[0], state, t ); + fetch_vector4( ctx, &inst->SrcReg[0], machine, program, t ); t[0] = MAX2(t[0], 0.0F); t[1] = MAX2(t[1], 0.0F); t[3] = CLAMP(t[3], -(128.0F - epsilon), (128.0F - epsilon)); @@ -427,32 +435,32 @@ _mesa_exec_vertex_program(GLcontext *ctx, const struct gl_vertex_program *progra lit[1] = t[0]; lit[2] = (t[0] > 0.0) ? (GLfloat) _mesa_pow(t[1], t[3]) : 0.0F; lit[3] = 1.0; - store_vector4( &inst->DstReg, state, lit ); + store_vector4( inst, machine, lit ); } break; case OPCODE_RCP: { GLfloat t[4]; - fetch_vector1( &inst->SrcReg[0], state, t ); + fetch_vector1( ctx, &inst->SrcReg[0], machine, program, t ); if (t[0] != 1.0F) t[0] = 1.0F / t[0]; /* div by zero is infinity! */ t[1] = t[2] = t[3] = t[0]; - store_vector4( &inst->DstReg, state, t ); + store_vector4( inst, machine, t ); } break; case OPCODE_RSQ: { GLfloat t[4]; - fetch_vector1( &inst->SrcReg[0], state, t ); + fetch_vector1( ctx, &inst->SrcReg[0], machine, program, t ); t[0] = INV_SQRTF(FABSF(t[0])); t[1] = t[2] = t[3] = t[0]; - store_vector4( &inst->DstReg, state, t ); + store_vector4( inst, machine, t ); } break; case OPCODE_EXP: { GLfloat t[4], q[4], floor_t0; - fetch_vector1( &inst->SrcReg[0], state, t ); + fetch_vector1( ctx, &inst->SrcReg[0], machine, program, t ); floor_t0 = FLOORF(t[0]); if (floor_t0 > FLT_MAX_EXP) { SET_POS_INFINITY(q[0]); @@ -475,13 +483,13 @@ _mesa_exec_vertex_program(GLcontext *ctx, const struct gl_vertex_program *progra } q[1] = t[0] - floor_t0; q[3] = 1.0F; - store_vector4( &inst->DstReg, state, q ); + store_vector4( inst, machine, q ); } break; case OPCODE_LOG: { GLfloat t[4], q[4], abs_t0; - fetch_vector1( &inst->SrcReg[0], state, t ); + fetch_vector1( ctx, &inst->SrcReg[0], machine, program, t ); abs_t0 = FABSF(t[0]); if (abs_t0 != 0.0F) { /* Since we really can't handle infinite values on VMS @@ -512,147 +520,147 @@ _mesa_exec_vertex_program(GLcontext *ctx, const struct gl_vertex_program *progra SET_NEG_INFINITY(q[2]); } q[3] = 1.0; - store_vector4( &inst->DstReg, state, q ); + store_vector4( inst, machine, q ); } break; case OPCODE_MUL: { GLfloat t[4], u[4], prod[4]; - fetch_vector4( &inst->SrcReg[0], state, t ); - fetch_vector4( &inst->SrcReg[1], state, u ); + fetch_vector4( ctx, &inst->SrcReg[0], machine, program, t ); + fetch_vector4( ctx, &inst->SrcReg[1], machine, program, u ); prod[0] = t[0] * u[0]; prod[1] = t[1] * u[1]; prod[2] = t[2] * u[2]; prod[3] = t[3] * u[3]; - store_vector4( &inst->DstReg, state, prod ); + store_vector4( inst, machine, prod ); } break; case OPCODE_ADD: { GLfloat t[4], u[4], sum[4]; - fetch_vector4( &inst->SrcReg[0], state, t ); - fetch_vector4( &inst->SrcReg[1], state, u ); + fetch_vector4( ctx, &inst->SrcReg[0], machine, program, t ); + fetch_vector4( ctx, &inst->SrcReg[1], machine, program, u ); sum[0] = t[0] + u[0]; sum[1] = t[1] + u[1]; sum[2] = t[2] + u[2]; sum[3] = t[3] + u[3]; - store_vector4( &inst->DstReg, state, sum ); + store_vector4( inst, machine, sum ); } break; case OPCODE_DP3: { GLfloat t[4], u[4], dot[4]; - fetch_vector4( &inst->SrcReg[0], state, t ); - fetch_vector4( &inst->SrcReg[1], state, u ); + fetch_vector4( ctx, &inst->SrcReg[0], machine, program, t ); + fetch_vector4( ctx, &inst->SrcReg[1], machine, program, u ); dot[0] = t[0] * u[0] + t[1] * u[1] + t[2] * u[2]; dot[1] = dot[2] = dot[3] = dot[0]; - store_vector4( &inst->DstReg, state, dot ); + store_vector4( inst, machine, dot ); } break; case OPCODE_DP4: { GLfloat t[4], u[4], dot[4]; - fetch_vector4( &inst->SrcReg[0], state, t ); - fetch_vector4( &inst->SrcReg[1], state, u ); + fetch_vector4( ctx, &inst->SrcReg[0], machine, program, t ); + fetch_vector4( ctx, &inst->SrcReg[1], machine, program, u ); dot[0] = t[0] * u[0] + t[1] * u[1] + t[2] * u[2] + t[3] * u[3]; dot[1] = dot[2] = dot[3] = dot[0]; - store_vector4( &inst->DstReg, state, dot ); + store_vector4( inst, machine, dot ); } break; case OPCODE_DST: { GLfloat t[4], u[4], dst[4]; - fetch_vector4( &inst->SrcReg[0], state, t ); - fetch_vector4( &inst->SrcReg[1], state, u ); + fetch_vector4( ctx, &inst->SrcReg[0], machine, program, t ); + fetch_vector4( ctx, &inst->SrcReg[1], machine, program, u ); dst[0] = 1.0F; dst[1] = t[1] * u[1]; dst[2] = t[2]; dst[3] = u[3]; - store_vector4( &inst->DstReg, state, dst ); + store_vector4( inst, machine, dst ); } break; case OPCODE_MIN: { GLfloat t[4], u[4], min[4]; - fetch_vector4( &inst->SrcReg[0], state, t ); - fetch_vector4( &inst->SrcReg[1], state, u ); + fetch_vector4( ctx, &inst->SrcReg[0], machine, program, t ); + fetch_vector4( ctx, &inst->SrcReg[1], machine, program, u ); min[0] = (t[0] < u[0]) ? t[0] : u[0]; min[1] = (t[1] < u[1]) ? t[1] : u[1]; min[2] = (t[2] < u[2]) ? t[2] : u[2]; min[3] = (t[3] < u[3]) ? t[3] : u[3]; - store_vector4( &inst->DstReg, state, min ); + store_vector4( inst, machine, min ); } break; case OPCODE_MAX: { GLfloat t[4], u[4], max[4]; - fetch_vector4( &inst->SrcReg[0], state, t ); - fetch_vector4( &inst->SrcReg[1], state, u ); + fetch_vector4( ctx, &inst->SrcReg[0], machine, program, t ); + fetch_vector4( ctx, &inst->SrcReg[1], machine, program, u ); max[0] = (t[0] > u[0]) ? t[0] : u[0]; max[1] = (t[1] > u[1]) ? t[1] : u[1]; max[2] = (t[2] > u[2]) ? t[2] : u[2]; max[3] = (t[3] > u[3]) ? t[3] : u[3]; - store_vector4( &inst->DstReg, state, max ); + store_vector4( inst, machine, max ); } break; case OPCODE_SLT: { GLfloat t[4], u[4], slt[4]; - fetch_vector4( &inst->SrcReg[0], state, t ); - fetch_vector4( &inst->SrcReg[1], state, u ); + fetch_vector4( ctx, &inst->SrcReg[0], machine, program, t ); + fetch_vector4( ctx, &inst->SrcReg[1], machine, program, u ); slt[0] = (t[0] < u[0]) ? 1.0F : 0.0F; slt[1] = (t[1] < u[1]) ? 1.0F : 0.0F; slt[2] = (t[2] < u[2]) ? 1.0F : 0.0F; slt[3] = (t[3] < u[3]) ? 1.0F : 0.0F; - store_vector4( &inst->DstReg, state, slt ); + store_vector4( inst, machine, slt ); } break; case OPCODE_SGE: { GLfloat t[4], u[4], sge[4]; - fetch_vector4( &inst->SrcReg[0], state, t ); - fetch_vector4( &inst->SrcReg[1], state, u ); + fetch_vector4( ctx, &inst->SrcReg[0], machine, program, t ); + fetch_vector4( ctx, &inst->SrcReg[1], machine, program, u ); sge[0] = (t[0] >= u[0]) ? 1.0F : 0.0F; sge[1] = (t[1] >= u[1]) ? 1.0F : 0.0F; sge[2] = (t[2] >= u[2]) ? 1.0F : 0.0F; sge[3] = (t[3] >= u[3]) ? 1.0F : 0.0F; - store_vector4( &inst->DstReg, state, sge ); + store_vector4( inst, machine, sge ); } break; case OPCODE_MAD: { GLfloat t[4], u[4], v[4], sum[4]; - fetch_vector4( &inst->SrcReg[0], state, t ); - fetch_vector4( &inst->SrcReg[1], state, u ); - fetch_vector4( &inst->SrcReg[2], state, v ); + fetch_vector4( ctx, &inst->SrcReg[0], machine, program, t ); + fetch_vector4( ctx, &inst->SrcReg[1], machine, program, u ); + fetch_vector4( ctx, &inst->SrcReg[2], machine, program, v ); sum[0] = t[0] * u[0] + v[0]; sum[1] = t[1] * u[1] + v[1]; sum[2] = t[2] * u[2] + v[2]; sum[3] = t[3] * u[3] + v[3]; - store_vector4( &inst->DstReg, state, sum ); + store_vector4( inst, machine, sum ); } break; case OPCODE_ARL: { GLfloat t[4]; - fetch_vector4( &inst->SrcReg[0], state, t ); - state->AddressReg[0] = (GLint) FLOORF(t[0]); + fetch_vector4( ctx, &inst->SrcReg[0], machine, program, t ); + machine->AddressReg[0] = (GLint) FLOORF(t[0]); } break; case OPCODE_DPH: { GLfloat t[4], u[4], dot[4]; - fetch_vector4( &inst->SrcReg[0], state, t ); - fetch_vector4( &inst->SrcReg[1], state, u ); + fetch_vector4( ctx, &inst->SrcReg[0], machine, program, t ); + fetch_vector4( ctx, &inst->SrcReg[1], machine, program, u ); dot[0] = t[0] * u[0] + t[1] * u[1] + t[2] * u[2] + u[3]; dot[1] = dot[2] = dot[3] = dot[0]; - store_vector4( &inst->DstReg, state, dot ); + store_vector4( inst, machine, dot ); } break; case OPCODE_RCC: { GLfloat t[4], u; - fetch_vector1( &inst->SrcReg[0], state, t ); + fetch_vector1( ctx, &inst->SrcReg[0], machine, program, t ); if (t[0] == 1.0F) u = 1.0F; else @@ -674,115 +682,120 @@ _mesa_exec_vertex_program(GLcontext *ctx, const struct gl_vertex_program *progra } } t[0] = t[1] = t[2] = t[3] = u; - store_vector4( &inst->DstReg, state, t ); + store_vector4( inst, machine, t ); } break; case OPCODE_SUB: /* GL_NV_vertex_program1_1 */ { GLfloat t[4], u[4], sum[4]; - fetch_vector4( &inst->SrcReg[0], state, t ); - fetch_vector4( &inst->SrcReg[1], state, u ); + fetch_vector4( ctx, &inst->SrcReg[0], machine, program, t ); + fetch_vector4( ctx, &inst->SrcReg[1], machine, program, u ); sum[0] = t[0] - u[0]; sum[1] = t[1] - u[1]; sum[2] = t[2] - u[2]; sum[3] = t[3] - u[3]; - store_vector4( &inst->DstReg, state, sum ); + store_vector4( inst, machine, sum ); } break; case OPCODE_ABS: /* GL_NV_vertex_program1_1 */ { GLfloat t[4]; - fetch_vector4( &inst->SrcReg[0], state, t ); + fetch_vector4( ctx, &inst->SrcReg[0], machine, program, t ); if (t[0] < 0.0) t[0] = -t[0]; if (t[1] < 0.0) t[1] = -t[1]; if (t[2] < 0.0) t[2] = -t[2]; if (t[3] < 0.0) t[3] = -t[3]; - store_vector4( &inst->DstReg, state, t ); + store_vector4( inst, machine, t ); } break; case OPCODE_FLR: /* GL_ARB_vertex_program */ { GLfloat t[4]; - fetch_vector4( &inst->SrcReg[0], state, t ); + fetch_vector4( ctx, &inst->SrcReg[0], machine, program, t ); t[0] = FLOORF(t[0]); t[1] = FLOORF(t[1]); t[2] = FLOORF(t[2]); t[3] = FLOORF(t[3]); - store_vector4( &inst->DstReg, state, t ); + store_vector4( inst, machine, t ); } break; case OPCODE_FRC: /* GL_ARB_vertex_program */ { GLfloat t[4]; - fetch_vector4( &inst->SrcReg[0], state, t ); + fetch_vector4( ctx, &inst->SrcReg[0], machine, program, t ); t[0] = t[0] - FLOORF(t[0]); t[1] = t[1] - FLOORF(t[1]); t[2] = t[2] - FLOORF(t[2]); t[3] = t[3] - FLOORF(t[3]); - store_vector4( &inst->DstReg, state, t ); + store_vector4( inst, machine, t ); } break; case OPCODE_EX2: /* GL_ARB_vertex_program */ { GLfloat t[4]; - fetch_vector1( &inst->SrcReg[0], state, t ); + fetch_vector1( ctx, &inst->SrcReg[0], machine, program, t ); t[0] = t[1] = t[2] = t[3] = (GLfloat)_mesa_pow(2.0, t[0]); - store_vector4( &inst->DstReg, state, t ); + store_vector4( inst, machine, t ); } break; case OPCODE_LG2: /* GL_ARB_vertex_program */ { GLfloat t[4]; - fetch_vector1( &inst->SrcReg[0], state, t ); + fetch_vector1( ctx, &inst->SrcReg[0], machine, program, t ); t[0] = t[1] = t[2] = t[3] = LOG2(t[0]); - store_vector4( &inst->DstReg, state, t ); + store_vector4( inst, machine, t ); } break; case OPCODE_POW: /* GL_ARB_vertex_program */ { GLfloat t[4], u[4]; - fetch_vector1( &inst->SrcReg[0], state, t ); - fetch_vector1( &inst->SrcReg[1], state, u ); + fetch_vector1( ctx, &inst->SrcReg[0], machine, program, t ); + fetch_vector1( ctx, &inst->SrcReg[1], machine, program, u ); t[0] = t[1] = t[2] = t[3] = (GLfloat)_mesa_pow(t[0], u[0]); - store_vector4( &inst->DstReg, state, t ); + store_vector4( inst, machine, t ); } break; case OPCODE_XPD: /* GL_ARB_vertex_program */ { GLfloat t[4], u[4], cross[4]; - fetch_vector4( &inst->SrcReg[0], state, t ); - fetch_vector4( &inst->SrcReg[1], state, u ); + fetch_vector4( ctx, &inst->SrcReg[0], machine, program, t ); + fetch_vector4( ctx, &inst->SrcReg[1], machine, program, u ); cross[0] = t[1] * u[2] - t[2] * u[1]; cross[1] = t[2] * u[0] - t[0] * u[2]; cross[2] = t[0] * u[1] - t[1] * u[0]; - store_vector4( &inst->DstReg, state, cross ); + store_vector4( inst, machine, cross ); } break; case OPCODE_SWZ: /* GL_ARB_vertex_program */ { const struct prog_src_register *source = &inst->SrcReg[0]; - const GLfloat *src = get_register_pointer(source, state); + const GLfloat *src = get_register_pointer(ctx, source, + machine, program); GLfloat result[4]; GLuint i; /* do extended swizzling here */ for (i = 0; i < 4; i++) { - if (GET_SWZ(source->Swizzle, i) == SWIZZLE_ZERO) + const GLuint swz = GET_SWZ(source->Swizzle, i); + if (swz == SWIZZLE_ZERO) result[i] = 0.0; - else if (GET_SWZ(source->Swizzle, i) == SWIZZLE_ONE) + else if (swz == SWIZZLE_ONE) result[i] = 1.0; - else - result[i] = src[GET_SWZ(source->Swizzle, i)]; + else { + ASSERT(swz >= 0); + ASSERT(swz <= 3); + result[i] = src[swz]; + } if (source->NegateBase & (1 << i)) result[i] = -result[i]; } - store_vector4( &inst->DstReg, state, result ); + store_vector4( inst, machine, result ); } break; case OPCODE_PRINT: if (inst->SrcReg[0].File) { GLfloat t[4]; - fetch_vector4( &inst->SrcReg[0], state, t ); + fetch_vector4( ctx, &inst->SrcReg[0], machine, program, t ); _mesa_printf("%s%g, %g, %g, %g\n", (char *) inst->Data, t[0], t[1], t[2], t[3]); } @@ -805,48 +818,18 @@ _mesa_exec_vertex_program(GLcontext *ctx, const struct gl_vertex_program *progra } - /** -Thoughts on vertex program optimization: - -The obvious thing to do is to compile the vertex program into X86/SSE/3DNow! -assembly code. That will probably be a lot of work. - -Another approach might be to replace the vp_instruction->Opcode field with -a pointer to a specialized C function which executes the instruction. -In particular we can write functions which skip swizzling, negating, -masking, relative addressing, etc. when they're not needed. - -For example: - -void simple_add( struct prog_instruction *inst ) + * Execute a vertex state program. + * \sa _mesa_ExecuteProgramNV + */ +void +_mesa_exec_vertex_state_program(GLcontext *ctx, + struct gl_vertex_program *vprog, + const GLfloat *params) { - GLfloat *sum = machine->Registers[inst->DstReg.Register]; - GLfloat *a = machine->Registers[inst->SrcReg[0].Register]; - GLfloat *b = machine->Registers[inst->SrcReg[1].Register]; - sum[0] = a[0] + b[0]; - sum[1] = a[1] + b[1]; - sum[2] = a[2] + b[2]; - sum[3] = a[3] + b[3]; + struct vp_machine machine; + _mesa_init_vp_per_vertex_registers(ctx, &machine); + _mesa_init_vp_per_primitive_registers(ctx); + COPY_4V(machine.Inputs[VERT_ATTRIB_POS], params); + _mesa_exec_vertex_program(ctx, &machine, vprog); } - -*/ - -/* - -KW: - -A first step would be to 'vectorize' the programs in the same way as -the normal transformation code in the tnl module. Thus each opcode -takes zero or more input vectors (registers) and produces one or more -output vectors. - -These operations would intially be coded in C, with machine-specific -assembly following, as is currently the case for matrix -transformations in the math/ directory. The preprocessing scheme for -selecting simpler operations Brian describes above would also work -here. - -This should give reasonable performance without excessive effort. - -*/ diff --git a/src/mesa/shader/nvvertexec.h b/src/mesa/shader/nvvertexec.h index e0fd46a7662..b1cf31bd3c4 100644 --- a/src/mesa/shader/nvvertexec.h +++ b/src/mesa/shader/nvvertexec.h @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.1 + * Version: 6.5.2 * - * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2006 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"), @@ -28,16 +28,40 @@ #ifndef NVVERTEXEC_H #define NVVERTEXEC_H + +/** + * Virtual vertex program machine state. + * Only used during program execution. + */ +struct vp_machine +{ + GLfloat Temporaries[MAX_NV_VERTEX_PROGRAM_TEMPS][4]; + GLfloat Inputs[MAX_NV_VERTEX_PROGRAM_INPUTS][4]; + GLuint InputsSize[MAX_NV_VERTEX_PROGRAM_INPUTS]; + GLfloat Outputs[MAX_NV_VERTEX_PROGRAM_OUTPUTS][4]; + GLint AddressReg[4]; +}; + + + extern void -_mesa_init_vp_per_vertex_registers(GLcontext *ctx); +_mesa_init_vp_per_vertex_registers(GLcontext *ctx, struct vp_machine *machine); extern void _mesa_init_vp_per_primitive_registers(GLcontext *ctx); extern void -_mesa_exec_vertex_program(GLcontext *ctx, const struct gl_vertex_program *program); +_mesa_exec_vertex_program(GLcontext *ctx, + struct vp_machine *machine, + const struct gl_vertex_program *program); + +extern void +_mesa_exec_vertex_state_program(GLcontext *ctx, + struct gl_vertex_program *vprog, + const GLfloat *params); extern void -_mesa_dump_vp_state( const struct gl_vertex_program_state *state ); +_mesa_dump_vp_state( const struct gl_vertex_program_state *state, + const struct vp_machine *machine); #endif diff --git a/src/mesa/shader/nvvertparse.c b/src/mesa/shader/nvvertparse.c index 3840dca2220..ecfe8ec334f 100644 --- a/src/mesa/shader/nvvertparse.c +++ b/src/mesa/shader/nvvertparse.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.5 + * Version: 6.5.2 * - * Copyright (C) 1999-2005 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2006 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"), @@ -62,8 +62,8 @@ struct parse_state { GLboolean isStateProgram; GLboolean isPositionInvariant; GLboolean isVersion1_1; - GLuint inputsRead; - GLuint outputsWritten; + GLbitfield inputsRead; + GLbitfield outputsWritten; GLboolean anyProgRegsWritten; GLuint numInst; /* number of instructions parsed */ }; @@ -1143,7 +1143,7 @@ Parse_InstructionSequence(struct parse_state *parseState, struct prog_instruction *inst = program + parseState->numInst; /* Initialize the instruction */ - _mesa_init_instruction(inst); + _mesa_init_instructions(inst, 1); if (Parse_String(parseState, "MOV")) { if (!Parse_UnaryOpInstruction(parseState, inst, OPCODE_MOV)) @@ -1395,6 +1395,8 @@ _mesa_parse_nv_vertex_program(GLcontext *ctx, GLenum dstTarget, } program->Base.Instructions = newInst; program->Base.InputsRead = parseState.inputsRead; + if (parseState.isPositionInvariant) + program->Base.InputsRead |= VERT_BIT_POS; program->Base.NumInstructions = parseState.numInst; program->Base.OutputsWritten = parseState.outputsWritten; program->IsPositionInvariant = parseState.isPositionInvariant; diff --git a/src/mesa/shader/program.c b/src/mesa/shader/program.c index 590f357b636..eabfbc24d7c 100644 --- a/src/mesa/shader/program.c +++ b/src/mesa/shader/program.c @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.5.1 + * Version: 6.5.2 * * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. * @@ -45,7 +45,7 @@ static const char * make_state_string(const GLint stateTokens[6]); -static GLuint +static GLbitfield make_state_flags(const GLint state[]); @@ -485,8 +485,7 @@ _mesa_add_state_reference(struct gl_program_parameter_list *paramList, paramList->Parameters[index].StateIndexes[i] = (enum state_index) stateTokens[i]; } - paramList->StateFlags |= - make_state_flags(stateTokens); + paramList->StateFlags |= make_state_flags(stateTokens); } /* free name string here since we duplicated it in add_parameter() */ @@ -580,37 +579,29 @@ _mesa_fetch_state(GLcontext *ctx, const enum state_index state[], { /* state[1] is either 0=front or 1=back side */ const GLuint face = (GLuint) state[1]; + const struct gl_material *mat = &ctx->Light.Material; + ASSERT(face == 0 || face == 1); + /* we rely on tokens numbered so that _BACK_ == _FRONT_+ 1 */ + ASSERT(MAT_ATTRIB_FRONT_AMBIENT + 1 == MAT_ATTRIB_BACK_AMBIENT); + /* XXX we could get rid of this switch entirely with a little + * work in arbprogparse.c's parse_state_single_item(). + */ /* state[2] is the material attribute */ switch (state[2]) { case STATE_AMBIENT: - if (face == 0) - COPY_4V(value, ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_AMBIENT]); - else - COPY_4V(value, ctx->Light.Material.Attrib[MAT_ATTRIB_BACK_AMBIENT]); + COPY_4V(value, mat->Attrib[MAT_ATTRIB_FRONT_AMBIENT + face]); return; case STATE_DIFFUSE: - if (face == 0) - COPY_4V(value, ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_DIFFUSE]); - else - COPY_4V(value, ctx->Light.Material.Attrib[MAT_ATTRIB_BACK_DIFFUSE]); + COPY_4V(value, mat->Attrib[MAT_ATTRIB_FRONT_DIFFUSE + face]); return; case STATE_SPECULAR: - if (face == 0) - COPY_4V(value, ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_SPECULAR]); - else - COPY_4V(value, ctx->Light.Material.Attrib[MAT_ATTRIB_BACK_SPECULAR]); + COPY_4V(value, mat->Attrib[MAT_ATTRIB_FRONT_SPECULAR + face]); return; case STATE_EMISSION: - if (face == 0) - COPY_4V(value, ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_EMISSION]); - else - COPY_4V(value, ctx->Light.Material.Attrib[MAT_ATTRIB_BACK_EMISSION]); + COPY_4V(value, mat->Attrib[MAT_ATTRIB_FRONT_EMISSION + face]); return; case STATE_SHININESS: - if (face == 0) - value[0] = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_SHININESS][0]; - else - value[0] = ctx->Light.Material.Attrib[MAT_ATTRIB_BACK_SHININESS][0]; + value[0] = mat->Attrib[MAT_ATTRIB_FRONT_SHININESS + face][0]; value[1] = 0.0F; value[2] = 0.0F; value[3] = 1.0F; @@ -917,6 +908,15 @@ _mesa_fetch_state(GLcontext *ctx, const enum state_index state[], case STATE_NORMAL_SCALE: ASSIGN_4V(value, ctx->_ModelViewInvScale, 0, 0, 1); break; + case STATE_TEXRECT_SCALE: { + const int unit = (int) state[2]; + const struct gl_texture_object *texObj = ctx->Texture.Unit[unit]._Current; + if (texObj) { + struct gl_texture_image *texImage = texObj->Image[0][0]; + ASSIGN_4V(value, 1.0 / texImage->Width, 1.0 / texImage->Height, 0, 1); + } + break; + } default: _mesa_problem(ctx, "Bad state switch in _mesa_fetch_state()"); return; @@ -932,10 +932,14 @@ _mesa_fetch_state(GLcontext *ctx, const enum state_index state[], /** - * Return a bit mask of the Mesa state flags under which a parameter's - * value might change. + * Return a bitmask of the Mesa state flags (_NEW_* values) which would + * indicate that the given context state may have changed. + * The bitmask is used during validation to determine if we need to update + * vertex/fragment program parameters (like "state.material.color") when + * some GL state has changed. */ -static GLuint make_state_flags(const GLint state[]) +static GLbitfield +make_state_flags(const GLint state[]) { switch (state[0]) { case STATE_MATERIAL: @@ -988,6 +992,8 @@ static GLuint make_state_flags(const GLint state[]) switch (state[1]) { case STATE_NORMAL_SCALE: return _NEW_MODELVIEW; + case STATE_TEXRECT_SCALE: + return _NEW_TEXTURE; default: _mesa_problem(NULL, "unexpected int. state in make_state_flags()"); return 0; @@ -1296,26 +1302,32 @@ _mesa_load_state_parameters(GLcontext *ctx, /** * Initialize program instruction fields to defaults. + * \param inst first instruction to initialize + * \param count number of instructions to initialize */ void -_mesa_init_instruction(struct prog_instruction *inst) +_mesa_init_instructions(struct prog_instruction *inst, GLuint count) { - _mesa_bzero(inst, sizeof(struct prog_instruction)); - - inst->SrcReg[0].File = PROGRAM_UNDEFINED; - inst->SrcReg[0].Swizzle = SWIZZLE_NOOP; - inst->SrcReg[1].File = PROGRAM_UNDEFINED; - inst->SrcReg[1].Swizzle = SWIZZLE_NOOP; - inst->SrcReg[2].File = PROGRAM_UNDEFINED; - inst->SrcReg[2].Swizzle = SWIZZLE_NOOP; - - inst->DstReg.File = PROGRAM_UNDEFINED; - inst->DstReg.WriteMask = WRITEMASK_XYZW; - inst->DstReg.CondMask = COND_TR; - inst->DstReg.CondSwizzle = SWIZZLE_NOOP; - - inst->SaturateMode = SATURATE_OFF; - inst->Precision = FLOAT32; + GLuint i; + + _mesa_bzero(inst, count * sizeof(struct prog_instruction)); + + for (i = 0; i < count; i++) { + inst[i].SrcReg[0].File = PROGRAM_UNDEFINED; + inst[i].SrcReg[0].Swizzle = SWIZZLE_NOOP; + inst[i].SrcReg[1].File = PROGRAM_UNDEFINED; + inst[i].SrcReg[1].Swizzle = SWIZZLE_NOOP; + inst[i].SrcReg[2].File = PROGRAM_UNDEFINED; + inst[i].SrcReg[2].Swizzle = SWIZZLE_NOOP; + + inst[i].DstReg.File = PROGRAM_UNDEFINED; + inst[i].DstReg.WriteMask = WRITEMASK_XYZW; + inst[i].DstReg.CondMask = COND_TR; + inst[i].DstReg.CondSwizzle = SWIZZLE_NOOP; + + inst[i].SaturateMode = SATURATE_OFF; + inst[i].Precision = FLOAT32; + } } @@ -1450,19 +1462,8 @@ static const struct instruction_info InstInfo[MAX_OPCODE] = { GLuint _mesa_num_inst_src_regs(enum prog_opcode opcode) { - GLuint i; -#ifdef DEBUG - for (i = 0; i < MAX_OPCODE; i++) { - ASSERT(i == InstInfo[i].Opcode); - } -#endif - for (i = 0; i < MAX_OPCODE; i++) { - if (InstInfo[i].Opcode == opcode) { - return InstInfo[i].NumSrcRegs; - } - } - _mesa_problem(NULL, "invalid opcode in _mesa_num_inst_src_regs"); - return 0; + ASSERT(opcode == InstInfo[opcode].Opcode); + return InstInfo[opcode].NumSrcRegs; } @@ -1601,6 +1602,38 @@ print_src_reg(const struct prog_src_register *srcReg) srcReg->NegateBase, GL_FALSE)); } +void +_mesa_print_alu_instruction(const struct prog_instruction *inst, + const char *opcode_string, + GLuint numRegs) +{ + GLuint j; + + _mesa_printf("%s", opcode_string); + + /* frag prog only */ + if (inst->SaturateMode == SATURATE_ZERO_ONE) + _mesa_printf("_SAT"); + + if (inst->DstReg.File != PROGRAM_UNDEFINED) { + _mesa_printf(" %s[%d]%s", + program_file_string((enum register_file) inst->DstReg.File), + inst->DstReg.Index, + writemask_string(inst->DstReg.WriteMask)); + } + + if (numRegs > 0) + _mesa_printf(", "); + + for (j = 0; j < numRegs; j++) { + print_src_reg(inst->SrcReg + j); + if (j + 1 < numRegs) + _mesa_printf(", "); + } + + _mesa_printf(";\n"); +} + /** * Print a single vertex/fragment program instruction. @@ -1659,37 +1692,16 @@ _mesa_print_instruction(const struct prog_instruction *inst) print_src_reg(&inst->SrcReg[0]); _mesa_printf(";\n"); break; + case OPCODE_END: + _mesa_printf("END;\n"); + break; /* XXX may need for other special-case instructions */ default: /* typical alu instruction */ - { - const GLuint numRegs = _mesa_num_inst_src_regs(inst->Opcode); - GLuint j; - - _mesa_printf("%s", _mesa_opcode_string(inst->Opcode)); - - /* frag prog only */ - if (inst->SaturateMode == SATURATE_ZERO_ONE) - _mesa_printf("_SAT"); - - if (inst->DstReg.File != PROGRAM_UNDEFINED) { - _mesa_printf(" %s[%d]%s", - program_file_string((enum register_file) inst->DstReg.File), - inst->DstReg.Index, - writemask_string(inst->DstReg.WriteMask)); - } - - if (numRegs > 0) - _mesa_printf(", "); - - for (j = 0; j < numRegs; j++) { - print_src_reg(inst->SrcReg + j); - if (j + 1 < numRegs) - _mesa_printf(", "); - } - - _mesa_printf(";\n"); - } + _mesa_print_alu_instruction(inst, + _mesa_opcode_string(inst->Opcode), + _mesa_num_inst_src_regs(inst->Opcode)); + break; } } @@ -1961,30 +1973,6 @@ _mesa_GenPrograms(GLsizei n, GLuint *ids) } -/** - * Determine if id names a vertex or fragment program. - * \note Not compiled into display lists. - * \note Called from both glIsProgramNV and glIsProgramARB. - * \param id is the program identifier - * \return GL_TRUE if id is a program, else GL_FALSE. - */ -GLboolean GLAPIENTRY -_mesa_IsProgram(GLuint id) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE); - - if (id == 0) - return GL_FALSE; - - if (_mesa_lookup_program(ctx, id)) - return GL_TRUE; - else - return GL_FALSE; -} - - - /**********************************************************************/ /* GL_MESA_program_debug extension */ /**********************************************************************/ @@ -2091,7 +2079,9 @@ _mesa_GetProgramRegisterfvMESA(GLenum target, "glGetProgramRegisterfvMESA(registerName)"); return; } - COPY_4V(v, ctx->VertexProgram.Temporaries[i]); +#if 0 /* FIX ME */ + ctx->Driver.GetVertexProgramRegister(ctx, PROGRAM_TEMPORARY, i, v); +#endif } else if (reg[0] == 'v' && reg[1] == '[') { /* Vertex Input attribute */ @@ -2102,7 +2092,10 @@ _mesa_GetProgramRegisterfvMESA(GLenum target, _mesa_sprintf(number, "%d", i); if (_mesa_strncmp(reg + 2, name, 4) == 0 || _mesa_strncmp(reg + 2, number, _mesa_strlen(number)) == 0) { - COPY_4V(v, ctx->VertexProgram.Inputs[i]); +#if 0 /* FIX ME */ + ctx->Driver.GetVertexProgramRegister(ctx, PROGRAM_INPUT, + i, v); +#endif return; } } @@ -2155,7 +2148,8 @@ _mesa_GetProgramRegisterfvMESA(GLenum target, "glGetProgramRegisterfvMESA(registerName)"); return; } - COPY_4V(v, ctx->FragmentProgram.Machine.Temporaries[i]); + ctx->Driver.GetFragmentProgramRegister(ctx, PROGRAM_TEMPORARY, + i, v); } else if (reg[0] == 'f' && reg[1] == '[') { /* Fragment input attribute */ @@ -2163,7 +2157,8 @@ _mesa_GetProgramRegisterfvMESA(GLenum target, for (i = 0; i < ctx->Const.FragmentProgram.MaxAttribs; i++) { const char *name = _mesa_nv_fragment_input_register_name(i); if (_mesa_strncmp(reg + 2, name, 4) == 0) { - COPY_4V(v, ctx->FragmentProgram.Machine.Inputs[i]); + ctx->Driver.GetFragmentProgramRegister(ctx, + PROGRAM_INPUT, i, v); return; } } @@ -2173,15 +2168,18 @@ _mesa_GetProgramRegisterfvMESA(GLenum target, } else if (_mesa_strcmp(reg, "o[COLR]") == 0) { /* Fragment output color */ - COPY_4V(v, ctx->FragmentProgram.Machine.Outputs[FRAG_RESULT_COLR]); + ctx->Driver.GetFragmentProgramRegister(ctx, PROGRAM_OUTPUT, + FRAG_RESULT_COLR, v); } else if (_mesa_strcmp(reg, "o[COLH]") == 0) { /* Fragment output color */ - COPY_4V(v, ctx->FragmentProgram.Machine.Outputs[FRAG_RESULT_COLH]); + ctx->Driver.GetFragmentProgramRegister(ctx, PROGRAM_OUTPUT, + FRAG_RESULT_COLH, v); } else if (_mesa_strcmp(reg, "o[DEPR]") == 0) { /* Fragment output depth */ - COPY_4V(v, ctx->FragmentProgram.Machine.Outputs[FRAG_RESULT_DEPR]); + ctx->Driver.GetFragmentProgramRegister(ctx, PROGRAM_OUTPUT, + FRAG_RESULT_DEPR, v); } else { /* try user-defined identifiers */ @@ -2202,5 +2200,4 @@ _mesa_GetProgramRegisterfvMESA(GLenum target, "glGetProgramRegisterfvMESA(target)"); return; } - } diff --git a/src/mesa/shader/program.h b/src/mesa/shader/program.h index 6a345339aff..50958394c20 100644 --- a/src/mesa/shader/program.h +++ b/src/mesa/shader/program.h @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.5.1 + * Version: 6.5.2 * * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. * @@ -188,6 +188,7 @@ enum state_index { STATE_INTERNAL, /* Mesa additions */ STATE_NORMAL_SCALE, + STATE_TEXRECT_SCALE, STATE_POSITION_NORMALIZED /* normalized light position */ }; @@ -264,6 +265,11 @@ _mesa_load_state_parameters(GLcontext *ctx, extern void _mesa_print_instruction(const struct prog_instruction *inst); +void +_mesa_print_alu_instruction(const struct prog_instruction *inst, + const char *opcode_string, + GLuint numRegs); + extern void _mesa_print_program(const struct gl_program *prog); @@ -284,9 +290,6 @@ _mesa_DeletePrograms(GLsizei n, const GLuint *ids); extern void GLAPIENTRY _mesa_GenPrograms(GLsizei n, GLuint *ids); -extern GLboolean GLAPIENTRY -_mesa_IsProgram(GLuint id); - /* diff --git a/src/mesa/shader/program_instruction.h b/src/mesa/shader/program_instruction.h index 93bcfc240a9..cdec0ceb2a5 100644 --- a/src/mesa/shader/program_instruction.h +++ b/src/mesa/shader/program_instruction.h @@ -343,7 +343,7 @@ struct prog_instruction extern void -_mesa_init_instruction(struct prog_instruction *inst); +_mesa_init_instructions(struct prog_instruction *inst, GLuint count); extern GLuint _mesa_num_inst_src_regs(enum prog_opcode opcode); diff --git a/src/mesa/shader/programopt.c b/src/mesa/shader/programopt.c index 199202edf77..172d373b578 100644 --- a/src/mesa/shader/programopt.c +++ b/src/mesa/shader/programopt.c @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.5.1 + * Version: 6.5.2 * * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. * @@ -85,8 +85,8 @@ _mesa_insert_mvp_code(GLcontext *ctx, struct gl_vertex_program *vprog) * newInst[2] = DP4 result.position.z, mvp.row[2], vertex.position; * newInst[3] = DP4 result.position.w, mvp.row[3], vertex.position; */ + _mesa_init_instructions(newInst, 4); for (i = 0; i < 4; i++) { - _mesa_init_instruction(newInst + i); newInst[i].Opcode = OPCODE_DP4; newInst[i].DstReg.File = PROGRAM_OUTPUT; newInst[i].DstReg.Index = VERT_RESULT_HPOS; @@ -117,31 +117,189 @@ _mesa_insert_mvp_code(GLcontext *ctx, struct gl_vertex_program *vprog) /** * Append extra instructions onto the given fragment program to implement - * the fog mode specified by program->FogOption. - * XXX incomplete. + * the fog mode specified by fprog->FogOption. + * The fragment.fogcoord input is used to compute the fog blend factor. + * + * XXX with a little work, this function could be adapted to add fog code + * to vertex programs too. */ void _mesa_append_fog_code(GLcontext *ctx, struct gl_fragment_program *fprog) { - struct prog_instruction newInst[10]; - - switch (fprog->FogOption) { - case GL_LINEAR: - /* lerp */ - break; - case GL_EXP: - break; - case GL_EXP2: - break; - case GL_NONE: - /* no-op */ + static const GLint fogParamsState[] = { STATE_FOG_PARAMS, 0, 0, 0, 0 }; + static const GLint fogColorState[] = { STATE_FOG_COLOR, 0, 0, 0, 0 }; + struct prog_instruction *newInst, *inst; + const GLuint origLen = fprog->Base.NumInstructions; + const GLuint newLen = origLen + 6; + GLuint i; + GLint fogParamsRef, fogColorRef; /* state references */ + GLuint colorTemp, fogFactorTemp; /* temporary registerss */ + GLfloat fogVals[4]; + GLuint fogConsts; /* constant values for EXP, EXP2 mode */ + + if (fprog->FogOption == GL_NONE) { + _mesa_problem(ctx, "_mesa_append_fog_code() called for fragment program" + " with FogOption == GL_NONE"); return; - default: - _mesa_problem(ctx, "Invalid fog option"); + } + + /* Alloc storage for new instructions */ + newInst = _mesa_alloc_instructions(newLen); + if (!newInst) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, + "glProgramString(inserting fog_option code)"); return; } + /* Copy orig instructions into new instruction buffer */ + _mesa_memcpy(newInst, fprog->Base.Instructions, + origLen * sizeof(struct prog_instruction)); + + /* PARAM fogParamsRef = state.fog.params; */ + fogParamsRef + = _mesa_add_state_reference(fprog->Base.Parameters, fogParamsState); + /* PARAM fogColorRef = state.fog.color; */ + fogColorRef + = _mesa_add_state_reference(fprog->Base.Parameters, fogColorState); - (void) newInst; + /* TEMP colorTemp; */ + colorTemp = fprog->Base.NumTemporaries++; + /* TEMP fogFactorTemp; */ + fogFactorTemp = fprog->Base.NumTemporaries++; + /* PARAM fogVals = { 1/ln(2), 1/sqrt(ln(2), 0, 0 }; */ + fogVals[0] = 1.0 / log(2.0); + fogVals[1] = 1.0 / SQRTF(log(2.0)); + fogVals[2] = 0.0; + fogVals[3] = 0.0; + fogConsts = _mesa_add_unnamed_constant(fprog->Base.Parameters, fogVals); + + /* Scan program to find where result.color is written */ + inst = newInst; + for (i = 0; i < fprog->Base.NumInstructions; i++) { + if (inst->Opcode == OPCODE_END) + break; + if (inst->DstReg.File == PROGRAM_OUTPUT && + inst->DstReg.Index == FRAG_RESULT_COLR) { + /* change the instruction to write to colorTemp w/ clamping */ + inst->DstReg.File = PROGRAM_TEMPORARY; + inst->DstReg.Index = colorTemp; + inst->SaturateMode = SATURATE_ZERO_ONE; + /* don't break (may be several writes to result.color) */ + } + inst++; + } + assert(inst->Opcode == OPCODE_END); /* we'll overwrite this inst */ + + _mesa_init_instructions(inst, 6); + + /* emit instructions to compute fog blending factor */ + if (fprog->FogOption == GL_LINEAR) { + /* SUB fogFactorTemp.x, fogParamsRef.z, fragment.fogcoord.x; */ + inst->Opcode = OPCODE_SUB; + inst->DstReg.File = PROGRAM_TEMPORARY; + inst->DstReg.Index = fogFactorTemp; + inst->DstReg.WriteMask = WRITEMASK_X; + inst->SrcReg[0].File = PROGRAM_STATE_VAR; + inst->SrcReg[0].Index = fogParamsRef; + inst->SrcReg[0].Swizzle = SWIZZLE_Z; + inst->SrcReg[1].File = PROGRAM_INPUT; + inst->SrcReg[1].Index = FRAG_ATTRIB_FOGC; + inst++; + /* MUL fogFactorTemp.x, fogFactorTemp, fogParamsRef.w; */ + inst->Opcode = OPCODE_MUL; + inst->DstReg.File = PROGRAM_TEMPORARY; + inst->DstReg.Index = fogFactorTemp; + inst->DstReg.WriteMask = WRITEMASK_X; + inst->SrcReg[0].File = PROGRAM_TEMPORARY; + inst->SrcReg[0].Index = fogFactorTemp; + inst->SrcReg[1].File = PROGRAM_STATE_VAR; + inst->SrcReg[1].Index = fogParamsRef; + inst->SrcReg[1].Swizzle = SWIZZLE_W; + inst++; + } + else { + ASSERT(fprog->FogOption == GL_EXP || fprog->FogOption == GL_EXP2); + /* MUL fogFactorTemp.x, fogParamsRef.x, fragment.fogcoord; */ + inst->Opcode = OPCODE_MUL; + inst->DstReg.File = PROGRAM_TEMPORARY; + inst->DstReg.Index = fogFactorTemp; + inst->DstReg.WriteMask = WRITEMASK_X; + inst->SrcReg[0].File = PROGRAM_STATE_VAR; + inst->SrcReg[0].Index = fogParamsRef; + inst->SrcReg[0].Swizzle = SWIZZLE_X; /* X=density */ + inst->SrcReg[1].File = PROGRAM_INPUT; + inst->SrcReg[1].Index = FRAG_ATTRIB_FOGC; + inst->SrcReg[1].Swizzle = SWIZZLE_X; + inst++; + if (fprog->FogOption == GL_EXP2) { + /* MUL fogFactorTemp.x, fogFactorTemp.x, fogFactorTemp.x; */ + inst->Opcode = OPCODE_MUL; + inst->DstReg.File = PROGRAM_TEMPORARY; + inst->DstReg.Index = fogFactorTemp; + inst->DstReg.WriteMask = WRITEMASK_X; + inst->SrcReg[0].File = PROGRAM_TEMPORARY; + inst->SrcReg[0].Index = fogFactorTemp; + inst->SrcReg[1].File = PROGRAM_TEMPORARY; + inst->SrcReg[1].Index = fogFactorTemp; + inst++; + } + /* EXP: MUL fogFactorTemp.x, fogFactorTemp.x, {1/ln(2)}; */ + /* EXP2: MUL fogFactorTemp.x, fogFactorTemp.x, {1/sqrt(ln(2))}; */ + inst->Opcode = OPCODE_MUL; + inst->DstReg.File = PROGRAM_TEMPORARY; + inst->DstReg.Index = fogFactorTemp; + inst->DstReg.WriteMask = WRITEMASK_X; + inst->SrcReg[0].File = PROGRAM_TEMPORARY; + inst->SrcReg[0].Index = fogFactorTemp; + inst->SrcReg[1].File = PROGRAM_CONSTANT; + inst->SrcReg[1].Index = fogConsts; + inst->SrcReg[1].Swizzle + = (fprog->FogOption == GL_EXP) ? SWIZZLE_X : SWIZZLE_Y; + inst++; + /* EX2_SAT fogFactorTemp.x, -fogFactorTemp.x; */ + inst->Opcode = OPCODE_EX2; + inst->DstReg.File = PROGRAM_TEMPORARY; + inst->DstReg.Index = fogFactorTemp; + inst->DstReg.WriteMask = WRITEMASK_X; + inst->SrcReg[0].File = PROGRAM_TEMPORARY; + inst->SrcReg[0].Index = fogFactorTemp; + inst->SrcReg[0].NegateBase = GL_TRUE; + inst->SaturateMode = SATURATE_ZERO_ONE; + inst++; + } + /* LRP result.color.xyz, fogFactorTemp.xxxx, colorTemp, fogColorRef; */ + inst->Opcode = OPCODE_LRP; + inst->DstReg.File = PROGRAM_OUTPUT; + inst->DstReg.Index = FRAG_RESULT_COLR; + inst->DstReg.WriteMask = WRITEMASK_XYZ; + inst->SrcReg[0].File = PROGRAM_TEMPORARY; + inst->SrcReg[0].Index = fogFactorTemp; + inst->SrcReg[0].Swizzle + = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_X, SWIZZLE_X, SWIZZLE_X); + inst->SrcReg[1].File = PROGRAM_TEMPORARY; + inst->SrcReg[1].Index = colorTemp; + inst->SrcReg[2].File = PROGRAM_STATE_VAR; + inst->SrcReg[2].Index = fogColorRef; + inst++; + /* MOV result.color.w, colorTemp.x; # copy alpha */ + inst->Opcode = OPCODE_MOV; + inst->DstReg.File = PROGRAM_OUTPUT; + inst->DstReg.Index = FRAG_RESULT_COLR; + inst->DstReg.WriteMask = WRITEMASK_W; + inst->SrcReg[0].File = PROGRAM_TEMPORARY; + inst->SrcReg[0].Index = colorTemp; + inst++; + /* END; */ + inst->Opcode = OPCODE_END; + inst++; + + /* free old instructions */ + _mesa_free(fprog->Base.Instructions); + + /* install new instructions */ + fprog->Base.Instructions = newInst; + fprog->Base.NumInstructions = inst - newInst; + fprog->Base.InputsRead |= FRAG_BIT_FOGC; + /* XXX do this? fprog->FogOption = GL_NONE; */ } diff --git a/src/mesa/shader/programopt.h b/src/mesa/shader/programopt.h index 8799da435b3..efaf29b9374 100644 --- a/src/mesa/shader/programopt.h +++ b/src/mesa/shader/programopt.h @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.5.1 + * Version: 6.5.2 * * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. * diff --git a/src/mesa/shader/shaderobjects.c b/src/mesa/shader/shaderobjects.c index f26ff12adf1..a2416c28726 100644 --- a/src/mesa/shader/shaderobjects.c +++ b/src/mesa/shader/shaderobjects.c @@ -50,28 +50,34 @@ #define RELEASE_SHADER(x)\ (**x)._generic._unknown.Release ((struct gl2_unknown_intf **) (x)) + + static struct gl2_unknown_intf ** -lookup_handle (GLcontext *ctx, GLhandleARB handle, enum gl2_uiid uiid, const char *function) +lookup_handle(GLcontext * ctx, GLhandleARB handle, enum gl2_uiid uiid, + const char *function) { struct gl2_unknown_intf **unk; /* - * Note: _mesa_HashLookup() requires non-zero input values, so the passed-in handle value - * must be checked beforehand. + * Note: _mesa_HashLookup() requires non-zero input values, so the + * passed-in handle value must be checked beforehand. */ if (handle == 0) { - _mesa_error (ctx, GL_INVALID_VALUE, function); + _mesa_error(ctx, GL_INVALID_VALUE, function); return NULL; } - _glthread_LOCK_MUTEX (ctx->Shared->Mutex); - unk = (struct gl2_unknown_intf **) (_mesa_HashLookup (ctx->Shared->GL2Objects, handle)); - _glthread_UNLOCK_MUTEX (ctx->Shared->Mutex); - if (unk == NULL) - _mesa_error (ctx, GL_INVALID_VALUE, function); + _glthread_LOCK_MUTEX(ctx->Shared->Mutex); + unk = (struct gl2_unknown_intf **) _mesa_HashLookup(ctx->Shared->GL2Objects, + handle); + _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex); + + if (unk == NULL) { + _mesa_error(ctx, GL_INVALID_VALUE, function); + } else { - unk = (**unk).QueryInterface (unk, uiid); + unk = (**unk).QueryInterface(unk, uiid); if (unk == NULL) - _mesa_error (ctx, GL_INVALID_OPERATION, function); + _mesa_error(ctx, GL_INVALID_OPERATION, function); } return unk; } @@ -92,895 +98,635 @@ lookup_handle (GLcontext *ctx, GLhandleARB handle, enum gl2_uiid uiid, const cha struct gl2_shader_intf **x = (struct gl2_shader_intf **)\ lookup_handle (ctx, handle, UIID_SHADER, function); -#define GET_LINKED_PROGRAM(x, handle, function)\ - GET_PROGRAM(x, handle, function);\ - if (x != NULL && (**x).GetLinkStatus (x) == GL_FALSE) {\ - RELEASE_PROGRAM(x);\ - x = NULL;\ - _mesa_error (ctx, GL_INVALID_OPERATION, function);\ + +#define GET_LINKED_PROGRAM(x, handle, function) \ + GET_PROGRAM(x, handle, function); \ + if (x && (**x).GetLinkStatus(x) == GL_FALSE) { \ + RELEASE_PROGRAM(x); \ + _mesa_error(ctx, GL_INVALID_OPERATION, function); \ + x = NULL; \ } -#define GET_CURRENT_LINKED_PROGRAM(x, function)\ - struct gl2_program_intf **x = NULL;\ - if (ctx->ShaderObjects.CurrentProgram == NULL)\ - _mesa_error (ctx, GL_INVALID_OPERATION, function);\ - else {\ - x = ctx->ShaderObjects.CurrentProgram;\ - if (x != NULL && (**x).GetLinkStatus (x) == GL_FALSE) {\ - x = NULL;\ - _mesa_error (ctx, GL_INVALID_OPERATION, function);\ - }\ +#define GET_CURRENT_LINKED_PROGRAM(x, function) \ + struct gl2_program_intf **x = ctx->ShaderObjects.CurrentProgram; \ + if (!x || (**x).GetLinkStatus(x) == GL_FALSE) { \ + _mesa_error(ctx, GL_INVALID_OPERATION, function); \ + return; \ } + + #define IS_NAME_WITH_GL_PREFIX(x) ((x)[0] == 'g' && (x)[1] == 'l' && (x)[2] == '_') GLvoid GLAPIENTRY -_mesa_DeleteObjectARB (GLhandleARB obj) +_mesa_DeleteObjectARB(GLhandleARB obj) { - if (obj != 0) - { + if (obj != 0) { GET_CURRENT_CONTEXT(ctx); GET_GENERIC(gen, obj, "glDeleteObjectARB"); - if (gen != NULL) - { - (**gen).Delete (gen); + if (gen != NULL) { + (**gen).Delete(gen); RELEASE_GENERIC(gen); } } } GLhandleARB GLAPIENTRY -_mesa_GetHandleARB (GLenum pname) +_mesa_GetHandleARB(GLenum pname) { - GET_CURRENT_CONTEXT(ctx); + GET_CURRENT_CONTEXT(ctx); - switch (pname) - { + switch (pname) { case GL_PROGRAM_OBJECT_ARB: { struct gl2_program_intf **pro = ctx->ShaderObjects.CurrentProgram; if (pro != NULL) - return (**pro)._container._generic.GetName ((struct gl2_generic_intf **) (pro)); + return (**pro)._container._generic. + GetName((struct gl2_generic_intf **) (pro)); } break; - default: - _mesa_error (ctx, GL_INVALID_ENUM, "glGetHandleARB"); - } + default: + _mesa_error(ctx, GL_INVALID_ENUM, "glGetHandleARB"); + } - return 0; + return 0; } GLvoid GLAPIENTRY -_mesa_DetachObjectARB (GLhandleARB containerObj, GLhandleARB attachedObj) +_mesa_DetachObjectARB(GLhandleARB containerObj, GLhandleARB attachedObj) { - GET_CURRENT_CONTEXT(ctx); - GET_CONTAINER(con, containerObj, "glDetachObjectARB"); + GET_CURRENT_CONTEXT(ctx); + GET_CONTAINER(con, containerObj, "glDetachObjectARB"); - if (con != NULL) - { - GET_GENERIC(att, attachedObj, "glDetachObjectARB"); + if (con != NULL) { + GET_GENERIC(att, attachedObj, "glDetachObjectARB"); - if (att != NULL) - { - (**con).Detach (con, att); - RELEASE_GENERIC(att); - } - RELEASE_CONTAINER(con); - } + if (att != NULL) { + (**con).Detach(con, att); + RELEASE_GENERIC(att); + } + RELEASE_CONTAINER(con); + } } GLhandleARB GLAPIENTRY -_mesa_CreateShaderObjectARB (GLenum shaderType) +_mesa_CreateShaderObjectARB(GLenum shaderType) +{ + return _mesa_3dlabs_create_shader_object(shaderType); +} + +GLvoid GLAPIENTRY +_mesa_ShaderSourceARB(GLhandleARB shaderObj, GLsizei count, + const GLcharARB ** string, const GLint * length) { - return _mesa_3dlabs_create_shader_object (shaderType); + GET_CURRENT_CONTEXT(ctx); + GLint *offsets; + GLsizei i; + GLcharARB *source; + GET_SHADER(sha, shaderObj, "glShaderSourceARB"); + + if (sha == NULL) + return; + + if (string == NULL) { + RELEASE_SHADER(sha); + _mesa_error(ctx, GL_INVALID_VALUE, "glShaderSourceARB"); + return; + } + + /* + * This array holds offsets of where the appropriate string ends, thus the last + * element will be set to the total length of the source code. + */ + offsets = (GLint *) _mesa_malloc(count * sizeof(GLint)); + if (offsets == NULL) { + RELEASE_SHADER(sha); + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glShaderSourceARB"); + return; + } + + for (i = 0; i < count; i++) { + if (string[i] == NULL) { + _mesa_free((GLvoid *) offsets); + RELEASE_SHADER(sha); + _mesa_error(ctx, GL_INVALID_VALUE, "glShaderSourceARB"); + return; + } + if (length == NULL || length[i] < 0) + offsets[i] = _mesa_strlen(string[i]); + else + offsets[i] = length[i]; + /* accumulate string lengths */ + if (i > 0) + offsets[i] += offsets[i - 1]; + } + + source = + (GLcharARB *) _mesa_malloc((offsets[count - 1] + 1) * + sizeof(GLcharARB)); + if (source == NULL) { + _mesa_free((GLvoid *) offsets); + RELEASE_SHADER(sha); + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glShaderSourceARB"); + return; + } + + for (i = 0; i < count; i++) { + GLint start = (i > 0) ? offsets[i - 1] : 0; + _mesa_memcpy(source + start, string[i], + (offsets[i] - start) * sizeof(GLcharARB)); + } + source[offsets[count - 1]] = '\0'; + + (**sha).SetSource(sha, source, offsets, count); + RELEASE_SHADER(sha); } GLvoid GLAPIENTRY -_mesa_ShaderSourceARB (GLhandleARB shaderObj, GLsizei count, const GLcharARB **string, - const GLint *length) -{ - GET_CURRENT_CONTEXT(ctx); - GLint *offsets; - GLsizei i; - GLcharARB *source; - GET_SHADER(sha, shaderObj, "glShaderSourceARB"); - - if (sha == NULL) - return; - - if (string == NULL) - { - RELEASE_SHADER(sha); - _mesa_error (ctx, GL_INVALID_VALUE, "glShaderSourceARB"); - return; - } - - /* - * This array holds offsets of where the appropriate string ends, thus the last - * element will be set to the total length of the source code. - */ - offsets = (GLint *) _mesa_malloc (count * sizeof (GLint)); - if (offsets == NULL) - { - RELEASE_SHADER(sha); - _mesa_error (ctx, GL_OUT_OF_MEMORY, "glShaderSourceARB"); - return; - } - - for (i = 0; i < count; i++) - { - if (string[i] == NULL) - { - _mesa_free ((GLvoid *) offsets); - RELEASE_SHADER(sha); - _mesa_error (ctx, GL_INVALID_VALUE, "glShaderSourceARB"); - return; - } - if (length == NULL || length[i] < 0) - offsets[i] = _mesa_strlen (string[i]); - else - offsets[i] = length[i]; - /* accumulate string lengths */ - if (i > 0) - offsets[i] += offsets[i - 1]; - } - - source = (GLcharARB *) _mesa_malloc ((offsets[count - 1] + 1) * sizeof (GLcharARB)); - if (source == NULL) - { - _mesa_free ((GLvoid *) offsets); - RELEASE_SHADER(sha); - _mesa_error (ctx, GL_OUT_OF_MEMORY, "glShaderSourceARB"); - return; - } - - for (i = 0; i < count; i++) - { - GLint start = (i > 0) ? offsets[i - 1] : 0; - _mesa_memcpy (source + start, string[i], (offsets[i] - start) * sizeof (GLcharARB)); - } - source[offsets[count - 1]] = '\0'; - - (**sha).SetSource (sha, source, offsets, count); - RELEASE_SHADER(sha); -} - -GLvoid GLAPIENTRY -_mesa_CompileShaderARB (GLhandleARB shaderObj) -{ - GET_CURRENT_CONTEXT(ctx); - GET_SHADER(sha, shaderObj, "glCompileShaderARB"); - - if (sha != NULL) - { - (**sha).Compile (sha); - RELEASE_SHADER(sha); - } +_mesa_CompileShaderARB(GLhandleARB shaderObj) +{ + GET_CURRENT_CONTEXT(ctx); + GET_SHADER(sha, shaderObj, "glCompileShaderARB"); + + if (sha != NULL) { + (**sha).Compile(sha); + RELEASE_SHADER(sha); + } } GLhandleARB GLAPIENTRY -_mesa_CreateProgramObjectARB (GLvoid) +_mesa_CreateProgramObjectARB(GLvoid) { - return _mesa_3dlabs_create_program_object (); + return _mesa_3dlabs_create_program_object(); } GLvoid GLAPIENTRY -_mesa_AttachObjectARB (GLhandleARB containerObj, GLhandleARB obj) +_mesa_AttachObjectARB(GLhandleARB containerObj, GLhandleARB obj) { - GET_CURRENT_CONTEXT(ctx); - GET_CONTAINER(con, containerObj, "glAttachObjectARB"); + GET_CURRENT_CONTEXT(ctx); + GET_CONTAINER(con, containerObj, "glAttachObjectARB"); - if (con != NULL) - { - GET_GENERIC(att, obj, "glAttachObjectARB"); + if (con != NULL) { + GET_GENERIC(att, obj, "glAttachObjectARB"); - if (att != NULL) - { - (**con).Attach (con, att); - RELEASE_GENERIC(att); - } - RELEASE_CONTAINER(con); - } + if (att != NULL) { + (**con).Attach(con, att); + RELEASE_GENERIC(att); + } + RELEASE_CONTAINER(con); + } } GLvoid GLAPIENTRY -_mesa_LinkProgramARB (GLhandleARB programObj) +_mesa_LinkProgramARB(GLhandleARB programObj) { - GET_CURRENT_CONTEXT(ctx); - GET_PROGRAM(pro, programObj, "glLinkProgramARB"); - - if (pro != NULL) - { - (**pro).Link (pro); - if (pro == ctx->ShaderObjects.CurrentProgram) - { - if ((**pro).GetLinkStatus (pro)) - _mesa_UseProgramObjectARB (programObj); - else - _mesa_UseProgramObjectARB (0); - } - RELEASE_PROGRAM(pro); - } + GET_CURRENT_CONTEXT(ctx); + GET_PROGRAM(pro, programObj, "glLinkProgramARB"); + + if (pro != NULL) { + (**pro).Link(pro); + if (pro == ctx->ShaderObjects.CurrentProgram) { + if ((**pro).GetLinkStatus(pro)) + _mesa_UseProgramObjectARB(programObj); + else + _mesa_UseProgramObjectARB(0); + } + RELEASE_PROGRAM(pro); + } } GLvoid GLAPIENTRY -_mesa_UseProgramObjectARB (GLhandleARB programObj) +_mesa_UseProgramObjectARB(GLhandleARB programObj) { - GET_CURRENT_CONTEXT(ctx); + GET_CURRENT_CONTEXT(ctx); struct gl2_program_intf **program = NULL; - FLUSH_VERTICES(ctx, _NEW_PROGRAM); + FLUSH_VERTICES(ctx, _NEW_PROGRAM); - if (programObj != 0) - { - GET_PROGRAM(pro, programObj, "glUseProgramObjectARB"); + if (programObj != 0) { + GET_PROGRAM(pro, programObj, "glUseProgramObjectARB"); - if (pro == NULL) - return; + if (pro == NULL) + return; - if ((**pro).GetLinkStatus (pro) == GL_FALSE) - { - RELEASE_PROGRAM(pro); - _mesa_error (ctx, GL_INVALID_OPERATION, "glUseProgramObjectARB"); - return; - } + if ((**pro).GetLinkStatus(pro) == GL_FALSE) { + RELEASE_PROGRAM(pro); + _mesa_error(ctx, GL_INVALID_OPERATION, "glUseProgramObjectARB"); + return; + } - program = pro; + program = pro; - ctx->ShaderObjects._VertexShaderPresent = (**pro).IsShaderPresent (pro, GL_VERTEX_SHADER_ARB); - ctx->ShaderObjects._FragmentShaderPresent = (**pro).IsShaderPresent (pro, - GL_FRAGMENT_SHADER_ARB); - } - else - { - ctx->ShaderObjects._VertexShaderPresent = GL_FALSE; - ctx->ShaderObjects._FragmentShaderPresent = GL_FALSE; - } + ctx->ShaderObjects._VertexShaderPresent = + (**pro).IsShaderPresent(pro, GL_VERTEX_SHADER_ARB); + ctx->ShaderObjects._FragmentShaderPresent = + (**pro).IsShaderPresent(pro, GL_FRAGMENT_SHADER_ARB); + } + else { + ctx->ShaderObjects._VertexShaderPresent = GL_FALSE; + ctx->ShaderObjects._FragmentShaderPresent = GL_FALSE; + } - if (ctx->ShaderObjects.CurrentProgram != NULL) - RELEASE_PROGRAM(ctx->ShaderObjects.CurrentProgram); - ctx->ShaderObjects.CurrentProgram = program; + if (ctx->ShaderObjects.CurrentProgram != NULL) + RELEASE_PROGRAM(ctx->ShaderObjects.CurrentProgram); + ctx->ShaderObjects.CurrentProgram = program; } GLvoid GLAPIENTRY -_mesa_ValidateProgramARB (GLhandleARB programObj) +_mesa_ValidateProgramARB(GLhandleARB programObj) { - GET_CURRENT_CONTEXT(ctx); - GET_PROGRAM(pro, programObj, "glValidateProgramARB"); + GET_CURRENT_CONTEXT(ctx); + GET_PROGRAM(pro, programObj, "glValidateProgramARB"); - if (pro != NULL) - { - (**pro).Validate (pro); - RELEASE_PROGRAM(pro); - } + if (pro != NULL) { + (**pro).Validate(pro); + RELEASE_PROGRAM(pro); + } } -GLvoid GLAPIENTRY -_mesa_Uniform1fARB (GLint location, GLfloat v0) + +/** + * Helper function for all the _mesa_Uniform*() functions below. + */ +static INLINE void +uniform(GLint location, GLsizei count, const GLvoid *values, GLenum type, + const char *caller) { - GET_CURRENT_CONTEXT(ctx); - GET_CURRENT_LINKED_PROGRAM(pro, "glUniform1fARB"); + GET_CURRENT_CONTEXT(ctx); + GET_CURRENT_LINKED_PROGRAM(pro, caller); - FLUSH_VERTICES(ctx, _NEW_PROGRAM); + FLUSH_VERTICES(ctx, _NEW_PROGRAM); - if (pro != NULL) - { - if (!(**pro).WriteUniform (pro, location, 1, &v0, GL_FLOAT)) - _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform1fARB"); - } + if (!(**pro).WriteUniform(pro, location, count, values, type)) + _mesa_error(ctx, GL_INVALID_OPERATION, caller); } + GLvoid GLAPIENTRY -_mesa_Uniform2fARB (GLint location, GLfloat v0, GLfloat v1) +_mesa_Uniform1fARB(GLint location, GLfloat v0) { - GET_CURRENT_CONTEXT(ctx); - GET_CURRENT_LINKED_PROGRAM(pro, "glUniform2fARB"); - - FLUSH_VERTICES(ctx, _NEW_PROGRAM); - - if (pro != NULL) - { - GLfloat v[2]; - v[0] = v0; - v[1] = v1; - - if (!(**pro).WriteUniform (pro, location, 1, v, GL_FLOAT_VEC2)) - _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform2fARB"); - } + uniform(location, 1, &v0, GL_FLOAT, "glUniform1fARB"); } GLvoid GLAPIENTRY -_mesa_Uniform3fARB (GLint location, GLfloat v0, GLfloat v1, GLfloat v2) +_mesa_Uniform2fARB(GLint location, GLfloat v0, GLfloat v1) { - GET_CURRENT_CONTEXT(ctx); - GET_CURRENT_LINKED_PROGRAM(pro, "glUniform3fARB"); - - FLUSH_VERTICES(ctx, _NEW_PROGRAM); - - if (pro != NULL) - { - GLfloat v[3]; - v[0] = v0; - v[1] = v1; - v[2] = v2; - - if (!(**pro).WriteUniform (pro, location, 1, v, GL_FLOAT_VEC3)) - _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform3fARB"); - } + GLfloat v[2]; + v[0] = v0; + v[1] = v1; + uniform(location, 1, v, GL_FLOAT_VEC2, "glUniform2fARB"); } GLvoid GLAPIENTRY -_mesa_Uniform4fARB (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3) +_mesa_Uniform3fARB(GLint location, GLfloat v0, GLfloat v1, GLfloat v2) { - GET_CURRENT_CONTEXT(ctx); - GET_CURRENT_LINKED_PROGRAM(pro, "glUniform4fARB"); - - FLUSH_VERTICES(ctx, _NEW_PROGRAM); - - if (pro != NULL) - { - GLfloat v[4]; - v[0] = v0; - v[1] = v1; - v[2] = v2; - v[3] = v3; - - if (!(**pro).WriteUniform (pro, location, 1, v, GL_FLOAT_VEC4)) - _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform4fARB"); - } + GLfloat v[3]; + v[0] = v0; + v[1] = v1; + v[2] = v2; + uniform(location, 1, v, GL_FLOAT_VEC3, "glUniform3fARB"); } GLvoid GLAPIENTRY -_mesa_Uniform1iARB (GLint location, GLint v0) +_mesa_Uniform4fARB(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, + GLfloat v3) { - GET_CURRENT_CONTEXT(ctx); - GET_CURRENT_LINKED_PROGRAM(pro, "glUniform1iARB"); - - FLUSH_VERTICES(ctx, _NEW_PROGRAM); - - if (pro != NULL) - { - if (!(**pro).WriteUniform (pro, location, 1, &v0, GL_INT)) - _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform1iARB"); - } + GLfloat v[4]; + v[0] = v0; + v[1] = v1; + v[2] = v2; + v[3] = v3; + uniform(location, 1, v, GL_FLOAT_VEC4, "glUniform4fARB"); } GLvoid GLAPIENTRY -_mesa_Uniform2iARB (GLint location, GLint v0, GLint v1) +_mesa_Uniform1iARB(GLint location, GLint v0) { - GET_CURRENT_CONTEXT(ctx); - GET_CURRENT_LINKED_PROGRAM(pro, "glUniform2iARB"); - - FLUSH_VERTICES(ctx, _NEW_PROGRAM); - - if (pro != NULL) - { - GLint v[2]; - v[0] = v0; - v[1] = v1; - - if (!(**pro).WriteUniform (pro, location, 1, v, GL_INT_VEC2)) - _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform2iARB"); - } + uniform(location, 1, &v0, GL_INT, "glUniform1iARB"); } GLvoid GLAPIENTRY -_mesa_Uniform3iARB (GLint location, GLint v0, GLint v1, GLint v2) +_mesa_Uniform2iARB(GLint location, GLint v0, GLint v1) { - GET_CURRENT_CONTEXT(ctx); - GET_CURRENT_LINKED_PROGRAM(pro, "glUniform3iARB"); - - FLUSH_VERTICES(ctx, _NEW_PROGRAM); - - if (pro != NULL) - { - GLint v[3]; - v[0] = v0; - v[1] = v1; - v[2] = v2; - - if (!(**pro).WriteUniform (pro, location, 1, v, GL_INT_VEC3)) - _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform3iARB"); - } + GLint v[2]; + v[0] = v0; + v[1] = v1; + uniform(location, 1, v, GL_INT_VEC2, "glUniform2iARB"); } GLvoid GLAPIENTRY -_mesa_Uniform4iARB (GLint location, GLint v0, GLint v1, GLint v2, GLint v3) +_mesa_Uniform3iARB(GLint location, GLint v0, GLint v1, GLint v2) { - GET_CURRENT_CONTEXT(ctx); - GET_CURRENT_LINKED_PROGRAM(pro, "glUniform4iARB"); - - FLUSH_VERTICES(ctx, _NEW_PROGRAM); - - if (pro != NULL) - { - GLint v[4]; - v[0] = v0; - v[1] = v1; - v[2] = v2; - v[3] = v3; - - if (!(**pro).WriteUniform (pro, location, 1, v, GL_INT_VEC4)) - _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform4iARB"); - } + GLint v[3]; + v[0] = v0; + v[1] = v1; + v[2] = v2; + uniform(location, 1, v, GL_INT_VEC3, "glUniform3iARB"); } GLvoid GLAPIENTRY -_mesa_Uniform1fvARB (GLint location, GLsizei count, const GLfloat *value) +_mesa_Uniform4iARB(GLint location, GLint v0, GLint v1, GLint v2, GLint v3) { - GET_CURRENT_CONTEXT(ctx); - GET_CURRENT_LINKED_PROGRAM(pro, "glUniform1fvARB"); - - if (value == NULL) - { - _mesa_error (ctx, GL_INVALID_VALUE, "glUniform1fvARB"); - return; - } - - FLUSH_VERTICES(ctx, _NEW_PROGRAM); - - if (pro != NULL) - { - if (!(**pro).WriteUniform (pro, location, count, value, GL_FLOAT)) - _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform1fvARB"); - } + GLint v[4]; + v[0] = v0; + v[1] = v1; + v[2] = v2; + v[3] = v3; + uniform(location, 1, v, GL_INT_VEC4, "glUniform4iARB"); } GLvoid GLAPIENTRY -_mesa_Uniform2fvARB (GLint location, GLsizei count, const GLfloat *value) +_mesa_Uniform1fvARB(GLint location, GLsizei count, const GLfloat * value) { - GET_CURRENT_CONTEXT(ctx); - GET_CURRENT_LINKED_PROGRAM(pro, "glUniform2fvARB"); - - if (value == NULL) - { - _mesa_error (ctx, GL_INVALID_VALUE, "glUniform2fvARB"); - return; - } - - FLUSH_VERTICES(ctx, _NEW_PROGRAM); - - if (pro != NULL) - { - if (!(**pro).WriteUniform (pro, location, count, value, GL_FLOAT_VEC2)) - _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform2fvARB"); - } + uniform(location, count, value, GL_FLOAT, "glUniform1fvARB"); } GLvoid GLAPIENTRY -_mesa_Uniform3fvARB (GLint location, GLsizei count, const GLfloat *value) +_mesa_Uniform2fvARB(GLint location, GLsizei count, const GLfloat * value) { - GET_CURRENT_CONTEXT(ctx); - GET_CURRENT_LINKED_PROGRAM(pro, "glUniform3fvARB"); - - if (value == NULL) - { - _mesa_error (ctx, GL_INVALID_VALUE, "glUniform3fvARB"); - return; - } - - FLUSH_VERTICES(ctx, _NEW_PROGRAM); - - if (pro != NULL) - { - if (!(**pro).WriteUniform (pro, location, count, value, GL_FLOAT_VEC3)) - _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform3fvARB"); - } + uniform(location, count, value, GL_FLOAT_VEC2, "glUniform2fvARB"); } GLvoid GLAPIENTRY -_mesa_Uniform4fvARB (GLint location, GLsizei count, const GLfloat *value) +_mesa_Uniform3fvARB(GLint location, GLsizei count, const GLfloat * value) { - GET_CURRENT_CONTEXT(ctx); - GET_CURRENT_LINKED_PROGRAM(pro, "glUniform4fvARB"); - - if (value == NULL) - { - _mesa_error (ctx, GL_INVALID_VALUE, "glUniform4fvARB"); - return; - } - - FLUSH_VERTICES(ctx, _NEW_PROGRAM); - - if (pro != NULL) - { - if (!(**pro).WriteUniform (pro, location, count, value, GL_FLOAT_VEC4)) - _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform4fvARB"); - } + uniform(location, count, value, GL_FLOAT_VEC3, "glUniform3fvARB"); } GLvoid GLAPIENTRY -_mesa_Uniform1ivARB (GLint location, GLsizei count, const GLint *value) +_mesa_Uniform4fvARB(GLint location, GLsizei count, const GLfloat * value) { - GET_CURRENT_CONTEXT(ctx); - GET_CURRENT_LINKED_PROGRAM(pro, "glUniform1ivARB"); - - if (value == NULL) - { - _mesa_error (ctx, GL_INVALID_VALUE, "glUniform1ivARB"); - return; - } - - FLUSH_VERTICES(ctx, _NEW_PROGRAM); - - if (pro != NULL) - { - if (!(**pro).WriteUniform (pro, location, count, value, GL_INT)) - _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform1ivARB"); - } + uniform(location, count, value, GL_FLOAT_VEC4, "glUniform4fvARB"); } GLvoid GLAPIENTRY -_mesa_Uniform2ivARB (GLint location, GLsizei count, const GLint *value) +_mesa_Uniform1ivARB(GLint location, GLsizei count, const GLint * value) { - GET_CURRENT_CONTEXT(ctx); - GET_CURRENT_LINKED_PROGRAM(pro, "glUniform2ivARB"); - - if (value == NULL) - { - _mesa_error (ctx, GL_INVALID_VALUE, "glUniform2ivARB"); - return; - } + uniform(location, count, value, GL_INT, "glUniform1ivARB"); +} - FLUSH_VERTICES(ctx, _NEW_PROGRAM); +GLvoid GLAPIENTRY +_mesa_Uniform2ivARB(GLint location, GLsizei count, const GLint * value) +{ + uniform(location, count, value, GL_INT_VEC2, "glUniform2ivARB"); +} - if (pro != NULL) - { - if (!(**pro).WriteUniform (pro, location, count, value, GL_INT_VEC2)) - _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform2ivARB"); - } +GLvoid GLAPIENTRY +_mesa_Uniform3ivARB(GLint location, GLsizei count, const GLint * value) +{ + uniform(location, count, value, GL_INT_VEC3, "glUniform3ivARB"); } GLvoid GLAPIENTRY -_mesa_Uniform3ivARB (GLint location, GLsizei count, const GLint *value) +_mesa_Uniform4ivARB(GLint location, GLsizei count, const GLint * value) { - GET_CURRENT_CONTEXT(ctx); - GET_CURRENT_LINKED_PROGRAM(pro, "glUniform3ivARB"); + uniform(location, count, value, GL_INT_VEC4, "glUniform4ivARB"); +} - if (value == NULL) - { - _mesa_error (ctx, GL_INVALID_VALUE, "glUniform3ivARB"); - return; - } - FLUSH_VERTICES(ctx, _NEW_PROGRAM); +/** + * Helper function used by UniformMatrix**vARB() functions below. + */ +static void +uniform_matrix(GLint cols, GLint rows, const char *caller, + GLenum matrixType, + GLint location, GLsizei count, GLboolean transpose, + const GLfloat *values) +{ + const GLint matElements = rows * cols; + GET_CURRENT_CONTEXT(ctx); + GET_CURRENT_LINKED_PROGRAM(pro, caller); - if (pro != NULL) - { - if (!(**pro).WriteUniform (pro, location, count, value, GL_INT_VEC3)) - _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform3ivARB"); - } -} + if (values == NULL) { + _mesa_error(ctx, GL_INVALID_VALUE, caller); + return; + } -GLvoid GLAPIENTRY -_mesa_Uniform4ivARB (GLint location, GLsizei count, const GLint *value) -{ - GET_CURRENT_CONTEXT(ctx); - GET_CURRENT_LINKED_PROGRAM(pro, "glUniform4ivARB"); + FLUSH_VERTICES(ctx, _NEW_PROGRAM); - if (value == NULL) - { - _mesa_error (ctx, GL_INVALID_VALUE, "glUniform4ivARB"); - return; - } + if (transpose) { + GLfloat *trans, *pt; + const GLfloat *pv; + GLint i, j, k; - FLUSH_VERTICES(ctx, _NEW_PROGRAM); + trans = (GLfloat *) _mesa_malloc(count * matElements * sizeof(GLfloat)); + if (!trans) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, caller); + return; + } + + pt = trans; + pv = values; + for (i = 0; i < count; i++) { + /* transpose from pv matrix into pt matrix */ + for (j = 0; j < cols; j++) { + for (k = 0; k < rows; k++) { + /* XXX verify this */ + pt[j * rows + k] = pv[k * cols + j]; + } + } + pt += matElements; + pv += matElements; + } - if (pro != NULL) - { - if (!(**pro).WriteUniform (pro, location, count, value, GL_INT_VEC4)) - _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform4ivARB"); - } + if (!(**pro).WriteUniform(pro, location, count, trans, matrixType)) + _mesa_error(ctx, GL_INVALID_OPERATION, caller); + _mesa_free(trans); + } + else { + if (!(**pro).WriteUniform(pro, location, count, values, matrixType)) + _mesa_error(ctx, GL_INVALID_OPERATION, caller); + } } + GLvoid GLAPIENTRY -_mesa_UniformMatrix2fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) -{ - GET_CURRENT_CONTEXT(ctx); - GET_CURRENT_LINKED_PROGRAM(pro, "glUniformMatrix2fvARB"); - - if (value == NULL) - { - _mesa_error (ctx, GL_INVALID_VALUE, "glUniformMatrix2fvARB"); - return; - } - - FLUSH_VERTICES(ctx, _NEW_PROGRAM); - - if (pro != NULL) - { - if (transpose) - { - GLfloat *trans, *pt; - const GLfloat *pv; - - trans = (GLfloat *) _mesa_malloc (count * 4 * sizeof (GLfloat)); - if (trans == NULL) - { - _mesa_error (ctx, GL_OUT_OF_MEMORY, "glUniformMatrix2fvARB"); - return; - } - for (pt = trans, pv = value; pt != trans + count * 4; pt += 4, pv += 4) - { - pt[0] = pv[0]; - pt[1] = pv[2]; - pt[2] = pv[1]; - pt[3] = pv[3]; - } - if (!(**pro).WriteUniform (pro, location, count, trans, GL_FLOAT_MAT2)) - _mesa_error (ctx, GL_INVALID_OPERATION, "glUniformMatrix2fvARB"); - _mesa_free (trans); - } - else - { - if (!(**pro).WriteUniform (pro, location, count, value, GL_FLOAT_MAT2)) - _mesa_error (ctx, GL_INVALID_OPERATION, "glUniformMatrix2fvARB"); - } - } +_mesa_UniformMatrix2fvARB(GLint location, GLsizei count, GLboolean transpose, + const GLfloat * value) +{ + uniform_matrix(2, 2, "glUniformMatrix2fvARB", GL_FLOAT_MAT2, + location, count, transpose, value); } GLvoid GLAPIENTRY -_mesa_UniformMatrix3fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) -{ - GET_CURRENT_CONTEXT(ctx); - GET_CURRENT_LINKED_PROGRAM(pro, "glUniformMatrix3fvARB"); - - if (value == NULL) - { - _mesa_error (ctx, GL_INVALID_VALUE, "glUniformMatrix3fvARB"); - return; - } - - FLUSH_VERTICES(ctx, _NEW_PROGRAM); - - if (pro != NULL) - { - if (transpose) - { - GLfloat *trans, *pt; - const GLfloat *pv; - - trans = (GLfloat *) _mesa_malloc (count * 9 * sizeof (GLfloat)); - if (trans == NULL) - { - _mesa_error (ctx, GL_OUT_OF_MEMORY, "glUniformMatrix3fvARB"); - return; - } - for (pt = trans, pv = value; pt != trans + count * 9; pt += 9, pv += 9) - { - pt[0] = pv[0]; - pt[1] = pv[3]; - pt[2] = pv[6]; - pt[3] = pv[1]; - pt[4] = pv[4]; - pt[5] = pv[7]; - pt[6] = pv[2]; - pt[7] = pv[5]; - pt[8] = pv[8]; - } - if (!(**pro).WriteUniform (pro, location, count, trans, GL_FLOAT_MAT3)) - _mesa_error (ctx, GL_INVALID_OPERATION, "glUniformMatrix3fvARB"); - _mesa_free (trans); - } - else - { - if (!(**pro).WriteUniform (pro, location, count, value, GL_FLOAT_MAT3)) - _mesa_error (ctx, GL_INVALID_OPERATION, "glUniformMatrix3fvARB"); - } - } +_mesa_UniformMatrix3fvARB(GLint location, GLsizei count, GLboolean transpose, + const GLfloat * value) +{ + uniform_matrix(3, 3, "glUniformMatrix3fvARB", GL_FLOAT_MAT3, + location, count, transpose, value); } GLvoid GLAPIENTRY -_mesa_UniformMatrix4fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) -{ - GET_CURRENT_CONTEXT(ctx); - GET_CURRENT_LINKED_PROGRAM(pro, "glUniformMatrix4fvARB"); - - if (value == NULL) - { - _mesa_error (ctx, GL_INVALID_VALUE, "glUniformMatrix4fvARB"); - return; - } - - FLUSH_VERTICES(ctx, _NEW_PROGRAM); - - if (pro != NULL) - { - if (transpose) - { - GLfloat *trans, *pt; - const GLfloat *pv; - - trans = (GLfloat *) _mesa_malloc (count * 16 * sizeof (GLfloat)); - if (trans == NULL) - { - _mesa_error (ctx, GL_OUT_OF_MEMORY, "glUniformMatrix4fvARB"); - return; - } - for (pt = trans, pv = value; pt != trans + count * 16; pt += 16, pv += 16) - { - _math_transposef (pt, pv); - } - if (!(**pro).WriteUniform (pro, location, count, trans, GL_FLOAT_MAT4)) - _mesa_error (ctx, GL_INVALID_OPERATION, "glUniformMatrix4fvARB"); - _mesa_free (trans); - } - else - { - if (!(**pro).WriteUniform (pro, location, count, value, GL_FLOAT_MAT4)) - _mesa_error (ctx, GL_INVALID_OPERATION, "glUniformMatrix4fvARB"); - } - } +_mesa_UniformMatrix4fvARB(GLint location, GLsizei count, GLboolean transpose, + const GLfloat * value) +{ + uniform_matrix(4, 4, "glUniformMatrix4fvARB", GL_FLOAT_MAT4, + location, count, transpose, value); } static GLboolean -_mesa_get_object_parameter (GLhandleARB obj, GLenum pname, GLvoid *params, GLboolean *integral, - GLint *size) -{ - GET_CURRENT_CONTEXT(ctx); - GLint *ipar = (GLint *) params; - - /* set default values */ - *integral = GL_TRUE; /* indicates param type, TRUE: GLint, FALSE: GLfloat */ - *size = 1; /* param array size */ - - switch (pname) - { - case GL_OBJECT_TYPE_ARB: - case GL_OBJECT_DELETE_STATUS_ARB: - case GL_OBJECT_INFO_LOG_LENGTH_ARB: - { - GET_GENERIC(gen, obj, "glGetObjectParameterivARB"); - - if (gen == NULL) - return GL_FALSE; - - switch (pname) - { - case GL_OBJECT_TYPE_ARB: - *ipar = (**gen).GetType (gen); - break; - case GL_OBJECT_DELETE_STATUS_ARB: - *ipar = (**gen).GetDeleteStatus (gen); - break; +_mesa_get_object_parameter(GLhandleARB obj, GLenum pname, GLvoid * params, + GLboolean * integral, GLint * size) +{ + GET_CURRENT_CONTEXT(ctx); + GLint *ipar = (GLint *) params; + + /* set default values */ + *integral = GL_TRUE; /* indicates param type, TRUE: GLint, FALSE: GLfloat */ + *size = 1; /* param array size */ + + switch (pname) { + case GL_OBJECT_TYPE_ARB: + case GL_OBJECT_DELETE_STATUS_ARB: + case GL_OBJECT_INFO_LOG_LENGTH_ARB: + { + GET_GENERIC(gen, obj, "glGetObjectParameterivARB"); + + if (gen == NULL) + return GL_FALSE; + + switch (pname) { + case GL_OBJECT_TYPE_ARB: + *ipar = (**gen).GetType(gen); + break; + case GL_OBJECT_DELETE_STATUS_ARB: + *ipar = (**gen).GetDeleteStatus(gen); + break; case GL_OBJECT_INFO_LOG_LENGTH_ARB: - *ipar = (**gen).GetInfoLogLength (gen); + *ipar = (**gen).GetInfoLogLength(gen); + break; + } + + RELEASE_GENERIC(gen); + } + break; + case GL_OBJECT_SUBTYPE_ARB: + case GL_OBJECT_COMPILE_STATUS_ARB: + case GL_OBJECT_SHADER_SOURCE_LENGTH_ARB: + { + GET_SHADER(sha, obj, "glGetObjectParameterivARB"); + + if (sha == NULL) + return GL_FALSE; + + switch (pname) { + case GL_OBJECT_SUBTYPE_ARB: + *ipar = (**sha).GetSubType(sha); + break; + case GL_OBJECT_COMPILE_STATUS_ARB: + *ipar = (**sha).GetCompileStatus(sha); + break; + case GL_OBJECT_SHADER_SOURCE_LENGTH_ARB: + { + const GLcharARB *src = (**sha).GetSource(sha); + if (src == NULL) + *ipar = 0; + else + *ipar = _mesa_strlen(src) + 1; + } + break; + } + + RELEASE_SHADER(sha); + } + break; + case GL_OBJECT_LINK_STATUS_ARB: + case GL_OBJECT_VALIDATE_STATUS_ARB: + case GL_OBJECT_ATTACHED_OBJECTS_ARB: + case GL_OBJECT_ACTIVE_UNIFORMS_ARB: + case GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB: + { + GET_PROGRAM(pro, obj, "glGetObjectParameterivARB"); + + if (pro == NULL) + return GL_FALSE; + + switch (pname) { + case GL_OBJECT_LINK_STATUS_ARB: + *ipar = (**pro).GetLinkStatus(pro); + break; + case GL_OBJECT_VALIDATE_STATUS_ARB: + *ipar = (**pro).GetValidateStatus(pro); break; - } - - RELEASE_GENERIC(gen); - } - break; - case GL_OBJECT_SUBTYPE_ARB: - case GL_OBJECT_COMPILE_STATUS_ARB: - case GL_OBJECT_SHADER_SOURCE_LENGTH_ARB: - { - GET_SHADER(sha, obj, "glGetObjectParameterivARB"); - - if (sha == NULL) - return GL_FALSE; - - switch (pname) - { - case GL_OBJECT_SUBTYPE_ARB: - *ipar = (**sha).GetSubType (sha); - break; - case GL_OBJECT_COMPILE_STATUS_ARB: - *ipar = (**sha).GetCompileStatus (sha); - break; - case GL_OBJECT_SHADER_SOURCE_LENGTH_ARB: - { - const GLcharARB *src = (**sha).GetSource (sha); - - if (src == NULL) - *ipar = 0; - else - *ipar = _mesa_strlen (src) + 1; - } - break; - } - - RELEASE_SHADER(sha); - } - break; - case GL_OBJECT_LINK_STATUS_ARB: - case GL_OBJECT_VALIDATE_STATUS_ARB: - case GL_OBJECT_ATTACHED_OBJECTS_ARB: - case GL_OBJECT_ACTIVE_UNIFORMS_ARB: - case GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB: - { - GET_PROGRAM(pro, obj, "glGetObjectParameterivARB"); - - if (pro == NULL) - return GL_FALSE; - - switch (pname) - { - case GL_OBJECT_LINK_STATUS_ARB: - *ipar = (**pro).GetLinkStatus (pro); - break; - case GL_OBJECT_VALIDATE_STATUS_ARB: - *ipar = (**pro).GetValidateStatus (pro); - break; case GL_OBJECT_ATTACHED_OBJECTS_ARB: - *ipar = (**pro)._container.GetAttachedCount ((struct gl2_container_intf **) (pro)); + *ipar = + (**pro)._container. + GetAttachedCount((struct gl2_container_intf **) (pro)); + break; + case GL_OBJECT_ACTIVE_UNIFORMS_ARB: + *ipar = (**pro).GetActiveUniformCount(pro); + break; + case GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB: + *ipar = (**pro).GetActiveUniformMaxLength(pro); + break; + case GL_OBJECT_ACTIVE_ATTRIBUTES_ARB: + *ipar = (**pro).GetActiveAttribCount(pro); break; - case GL_OBJECT_ACTIVE_UNIFORMS_ARB: - *ipar = (**pro).GetActiveUniformCount (pro); - break; - case GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB: - *ipar = (**pro).GetActiveUniformMaxLength (pro); - break; - case GL_OBJECT_ACTIVE_ATTRIBUTES_ARB: - *ipar = (**pro).GetActiveAttribCount (pro); - break; - case GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB: - *ipar = (**pro).GetActiveAttribMaxLength (pro); - break; - } - - RELEASE_PROGRAM(pro); - } - break; - default: - _mesa_error (ctx, GL_INVALID_ENUM, "glGetObjectParameterivARB"); - return GL_FALSE; - } - - return GL_TRUE; + case GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB: + *ipar = (**pro).GetActiveAttribMaxLength(pro); + break; + } + + RELEASE_PROGRAM(pro); + } + break; + default: + _mesa_error(ctx, GL_INVALID_ENUM, "glGetObjectParameterivARB"); + return GL_FALSE; + } + + return GL_TRUE; } GLvoid GLAPIENTRY -_mesa_GetObjectParameterfvARB (GLhandleARB obj, GLenum pname, GLfloat *params) +_mesa_GetObjectParameterfvARB(GLhandleARB obj, GLenum pname, GLfloat * params) { - GET_CURRENT_CONTEXT(ctx); - GLboolean integral; - GLint size; + GET_CURRENT_CONTEXT(ctx); + GLboolean integral; + GLint size; - if (params == NULL) - { - _mesa_error (ctx, GL_INVALID_VALUE, "glGetObjectParameterfvARB"); - return; - } - - assert (sizeof (GLfloat) == sizeof (GLint)); + if (params == NULL) { + _mesa_error(ctx, GL_INVALID_VALUE, "glGetObjectParameterfvARB"); + return; + } - if (_mesa_get_object_parameter (obj, pname, (GLvoid *) params, &integral, &size)) - if (integral) - { - GLint i; + assert(sizeof(GLfloat) == sizeof(GLint)); - for (i = 0; i < size; i++) - params[i] = (GLfloat) ((GLint *) params)[i]; - } + if (_mesa_get_object_parameter(obj, pname, (GLvoid *) params, + &integral, &size)) { + if (integral) { + GLint i; + for (i = 0; i < size; i++) + params[i] = (GLfloat) ((GLint *) params)[i]; + } + } } GLvoid GLAPIENTRY -_mesa_GetObjectParameterivARB (GLhandleARB obj, GLenum pname, GLint *params) +_mesa_GetObjectParameterivARB(GLhandleARB obj, GLenum pname, GLint * params) { - GET_CURRENT_CONTEXT(ctx); - GLboolean integral; - GLint size; + GET_CURRENT_CONTEXT(ctx); + GLboolean integral; + GLint size; - if (params == NULL) - { - _mesa_error (ctx, GL_INVALID_VALUE, "glGetObjectParameterivARB"); - return; - } - - assert (sizeof (GLfloat) == sizeof (GLint)); + if (params == NULL) { + _mesa_error(ctx, GL_INVALID_VALUE, "glGetObjectParameterivARB"); + return; + } - if (_mesa_get_object_parameter (obj, pname, (GLvoid *) params, &integral, &size)) - if (!integral) - { - GLint i; + assert(sizeof(GLfloat) == sizeof(GLint)); - for (i = 0; i < size; i++) - params[i] = (GLint) ((GLfloat *) params)[i]; - } + if (_mesa_get_object_parameter(obj, pname, (GLvoid *) params, + &integral, &size)) { + if (!integral) { + GLint i; + for (i = 0; i < size; i++) + params[i] = (GLint) ((GLfloat *) params)[i]; + } + } } @@ -993,222 +739,453 @@ _mesa_GetObjectParameterivARB (GLhandleARB obj, GLenum pname, GLint *params) * \param dst the string destination */ static GLvoid -copy_string(const GLcharARB *src, GLsizei maxLength, GLsizei *length, - GLcharARB *dst) +copy_string(const GLcharARB * src, GLsizei maxLength, GLsizei * length, + GLcharARB * dst) { - GLsizei len; - for (len = 0; len < maxLength - 1 && src && src[len]; len++) - dst[len] = src[len]; - if (maxLength > 0) - dst[len] = 0; - if (length) - *length = len; + GLsizei len; + for (len = 0; len < maxLength - 1 && src && src[len]; len++) + dst[len] = src[len]; + if (maxLength > 0) + dst[len] = 0; + if (length) + *length = len; } GLvoid GLAPIENTRY -_mesa_GetInfoLogARB (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog) +_mesa_GetInfoLogARB(GLhandleARB obj, GLsizei maxLength, GLsizei * length, + GLcharARB * infoLog) { - GET_CURRENT_CONTEXT(ctx); - GET_GENERIC(gen, obj, "glGetInfoLogARB"); + GET_CURRENT_CONTEXT(ctx); + GET_GENERIC(gen, obj, "glGetInfoLogARB"); - if (gen == NULL) - return; + if (gen == NULL) + return; - if (infoLog == NULL) - _mesa_error (ctx, GL_INVALID_VALUE, "glGetInfoLogARB"); + if (infoLog == NULL) + _mesa_error(ctx, GL_INVALID_VALUE, "glGetInfoLogARB"); else { - GLsizei actualsize = (**gen).GetInfoLogLength (gen); + GLsizei actualsize = (**gen).GetInfoLogLength(gen); if (actualsize > maxLength) actualsize = maxLength; - (**gen).GetInfoLog (gen, actualsize, infoLog); + (**gen).GetInfoLog(gen, actualsize, infoLog); if (length != NULL) *length = (actualsize > 0) ? actualsize - 1 : 0; } - RELEASE_GENERIC(gen); + RELEASE_GENERIC(gen); } GLvoid GLAPIENTRY -_mesa_GetAttachedObjectsARB (GLhandleARB containerObj, GLsizei maxCount, GLsizei *count, - GLhandleARB *obj) +_mesa_GetAttachedObjectsARB(GLhandleARB containerObj, GLsizei maxCount, + GLsizei * count, GLhandleARB * obj) { - GET_CURRENT_CONTEXT(ctx); - GET_CONTAINER(con, containerObj, "glGetAttachedObjectsARB"); - - if (con == NULL) - return; - - if (obj == NULL) - _mesa_error (ctx, GL_INVALID_VALUE, "glGetAttachedObjectsARB"); - else - { - GLsizei cnt, i; + GET_CURRENT_CONTEXT(ctx); + GET_CONTAINER(con, containerObj, "glGetAttachedObjectsARB"); - cnt = (**con).GetAttachedCount (con); - if (cnt > maxCount) - cnt = maxCount; - if (count != NULL) - *count = cnt; + if (con == NULL) + return; - for (i = 0; i < cnt; i++) - { - struct gl2_generic_intf **x = (**con).GetAttached (con, i); - obj[i] = (**x).GetName (x); - RELEASE_GENERIC(x); - } - } - RELEASE_CONTAINER(con); + if (obj == NULL) + _mesa_error(ctx, GL_INVALID_VALUE, "glGetAttachedObjectsARB"); + else { + GLsizei cnt, i; + + cnt = (**con).GetAttachedCount(con); + if (cnt > maxCount) + cnt = maxCount; + if (count != NULL) + *count = cnt; + + for (i = 0; i < cnt; i++) { + struct gl2_generic_intf **x = (**con).GetAttached(con, i); + obj[i] = (**x).GetName(x); + RELEASE_GENERIC(x); + } + } + RELEASE_CONTAINER(con); } GLint GLAPIENTRY -_mesa_GetUniformLocationARB (GLhandleARB programObj, const GLcharARB *name) +_mesa_GetUniformLocationARB(GLhandleARB programObj, const GLcharARB * name) { - GET_CURRENT_CONTEXT(ctx); - GLint loc = -1; - GET_LINKED_PROGRAM(pro, programObj, "glGetUniformLocationARB"); + GET_CURRENT_CONTEXT(ctx); + GLint loc = -1; + GET_LINKED_PROGRAM(pro, programObj, "glGetUniformLocationARB"); - if (pro == NULL) - return -1; + if (!pro) + return -1; - if (name == NULL) - _mesa_error (ctx, GL_INVALID_VALUE, "glGetUniformLocationARB"); - else - { - if (!IS_NAME_WITH_GL_PREFIX(name)) - loc = (**pro).GetUniformLocation (pro, name); - } - RELEASE_PROGRAM(pro); - return loc; + if (name == NULL) + _mesa_error(ctx, GL_INVALID_VALUE, "glGetUniformLocationARB"); + else { + if (!IS_NAME_WITH_GL_PREFIX(name)) + loc = (**pro).GetUniformLocation(pro, name); + } + RELEASE_PROGRAM(pro); + return loc; } GLvoid GLAPIENTRY -_mesa_GetActiveUniformARB (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, - GLint *size, GLenum *type, GLcharARB *name) +_mesa_GetActiveUniformARB(GLhandleARB programObj, GLuint index, + GLsizei maxLength, GLsizei * length, GLint * size, + GLenum * type, GLcharARB * name) { - GET_CURRENT_CONTEXT(ctx); - GET_PROGRAM(pro, programObj, "glGetActiveUniformARB"); + GET_CURRENT_CONTEXT(ctx); + GET_PROGRAM(pro, programObj, "glGetActiveUniformARB"); - if (pro == NULL) - return; + if (pro == NULL) + return; - if (size == NULL || type == NULL || name == NULL) - _mesa_error (ctx, GL_INVALID_VALUE, "glGetActiveUniformARB"); - else - { - if (index < (**pro).GetActiveUniformCount (pro)) - (**pro).GetActiveUniform (pro, index, maxLength, length, size, type, name); - else - _mesa_error (ctx, GL_INVALID_VALUE, "glGetActiveUniformARB"); - } - RELEASE_PROGRAM(pro); + if (size == NULL || type == NULL || name == NULL) + _mesa_error(ctx, GL_INVALID_VALUE, "glGetActiveUniformARB"); + else { + if (index < (**pro).GetActiveUniformCount(pro)) + (**pro).GetActiveUniform(pro, index, maxLength, length, size, type, + name); + else + _mesa_error(ctx, GL_INVALID_VALUE, "glGetActiveUniformARB"); + } + RELEASE_PROGRAM(pro); } GLvoid GLAPIENTRY -_mesa_GetUniformfvARB (GLhandleARB programObj, GLint location, GLfloat *params) +_mesa_GetUniformfvARB(GLhandleARB programObj, GLint location, GLfloat * params) { - GET_CURRENT_CONTEXT(ctx); - GET_LINKED_PROGRAM(pro, programObj, "glGetUniformfvARB"); + GET_CURRENT_CONTEXT(ctx); + GET_LINKED_PROGRAM(pro, programObj, "glGetUniformfvARB"); + + if (!pro) + return; - if (pro != NULL) - { - /* TODO */ - RELEASE_PROGRAM(pro); - } + if (!(**pro).ReadUniform(pro, location, 1, params, GL_FLOAT)) + _mesa_error(ctx, GL_INVALID_OPERATION, "glGetUniformfvARB"); + + RELEASE_PROGRAM(pro); } GLvoid GLAPIENTRY -_mesa_GetUniformivARB (GLhandleARB programObj, GLint location, GLint *params) +_mesa_GetUniformivARB(GLhandleARB programObj, GLint location, GLint * params) { - GET_CURRENT_CONTEXT(ctx); - GET_LINKED_PROGRAM(pro, programObj, "glGetUniformivARB"); + GET_CURRENT_CONTEXT(ctx); + GET_LINKED_PROGRAM(pro, programObj, "glGetUniformivARB"); + + if (!pro) + return; - if (pro != NULL) - { - /* TODO */ - RELEASE_PROGRAM(pro); - } + if (!(**pro).ReadUniform(pro, location, 1, params, GL_INT)) + _mesa_error(ctx, GL_INVALID_OPERATION, "glGetUniformivARB"); + RELEASE_PROGRAM(pro); } GLvoid GLAPIENTRY -_mesa_GetShaderSourceARB (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source) +_mesa_GetShaderSourceARB(GLhandleARB obj, GLsizei maxLength, GLsizei * length, + GLcharARB * source) { - GET_CURRENT_CONTEXT(ctx); - GET_SHADER(sha, obj, "glGetShaderSourceARB"); + GET_CURRENT_CONTEXT(ctx); + GET_SHADER(sha, obj, "glGetShaderSourceARB"); - if (sha == NULL) - return; + if (sha == NULL) + return; - if (source == NULL) - _mesa_error (ctx, GL_INVALID_VALUE, "glGetShaderSourceARB"); - else - copy_string ((**sha).GetSource (sha), maxLength, length, source); - RELEASE_SHADER(sha); + if (source == NULL) + _mesa_error(ctx, GL_INVALID_VALUE, "glGetShaderSourceARB"); + else + copy_string((**sha).GetSource(sha), maxLength, length, source); + RELEASE_SHADER(sha); } /* GL_ARB_vertex_shader */ GLvoid GLAPIENTRY -_mesa_BindAttribLocationARB (GLhandleARB programObj, GLuint index, const GLcharARB *name) +_mesa_BindAttribLocationARB(GLhandleARB programObj, GLuint index, + const GLcharARB * name) { - GET_CURRENT_CONTEXT(ctx); - GET_PROGRAM(pro, programObj, "glBindAttribLocationARB"); + GET_CURRENT_CONTEXT(ctx); + GET_PROGRAM(pro, programObj, "glBindAttribLocationARB"); + + if (pro == NULL) + return; + + if (name == NULL || index >= MAX_VERTEX_ATTRIBS) + _mesa_error(ctx, GL_INVALID_VALUE, "glBindAttribLocationARB"); + else if (IS_NAME_WITH_GL_PREFIX(name)) + _mesa_error(ctx, GL_INVALID_OPERATION, "glBindAttribLocationARB"); + else + (**pro).OverrideAttribBinding(pro, index, name); + RELEASE_PROGRAM(pro); +} - if (pro == NULL) - return; +GLvoid GLAPIENTRY +_mesa_GetActiveAttribARB(GLhandleARB programObj, GLuint index, + GLsizei maxLength, GLsizei * length, GLint * size, + GLenum * type, GLcharARB * name) +{ + GET_CURRENT_CONTEXT(ctx); + GET_PROGRAM(pro, programObj, "glGetActiveAttribARB"); + + if (pro == NULL) + return; + + if (name == NULL || index >= (**pro).GetActiveAttribCount(pro)) + _mesa_error(ctx, GL_INVALID_VALUE, "glGetActiveAttribARB"); + else + (**pro).GetActiveAttrib(pro, index, maxLength, length, size, type, + name); + RELEASE_PROGRAM(pro); +} - if (name == NULL || index >= MAX_VERTEX_ATTRIBS) - _mesa_error (ctx, GL_INVALID_VALUE, "glBindAttribLocationARB"); - else if (IS_NAME_WITH_GL_PREFIX(name)) - _mesa_error (ctx, GL_INVALID_OPERATION, "glBindAttribLocationARB"); - else - (**pro).OverrideAttribBinding (pro, index, name); - RELEASE_PROGRAM(pro); +GLint GLAPIENTRY +_mesa_GetAttribLocationARB(GLhandleARB programObj, const GLcharARB * name) +{ + GET_CURRENT_CONTEXT(ctx); + GLint loc = -1; + GET_LINKED_PROGRAM(pro, programObj, "glGetAttribLocationARB"); + + if (!pro) + return -1; + + if (name == NULL) + _mesa_error(ctx, GL_INVALID_VALUE, "glGetAttribLocationARB"); + else if (!IS_NAME_WITH_GL_PREFIX(name)) + loc = (**pro).GetAttribLocation(pro, name); + RELEASE_PROGRAM(pro); + return loc; } -GLvoid GLAPIENTRY -_mesa_GetActiveAttribARB (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, - GLint *size, GLenum *type, GLcharARB *name) + +/** + ** OpenGL 2.0 functions which basically wrap the ARB_shader functions + **/ + +void GLAPIENTRY +_mesa_AttachShader(GLuint program, GLuint shader) { - GET_CURRENT_CONTEXT(ctx); - GET_PROGRAM(pro, programObj, "glGetActiveAttribARB"); + _mesa_AttachObjectARB(program, shader); +} - if (pro == NULL) - return; - if (name == NULL || index >= (**pro).GetActiveAttribCount (pro)) - _mesa_error (ctx, GL_INVALID_VALUE, "glGetActiveAttribARB"); - else - (**pro).GetActiveAttrib (pro, index, maxLength, length, size, type, name); - RELEASE_PROGRAM(pro); +GLuint GLAPIENTRY +_mesa_CreateShader(GLenum type) +{ + return (GLuint) _mesa_CreateShaderObjectARB(type); } -GLint GLAPIENTRY -_mesa_GetAttribLocationARB (GLhandleARB programObj, const GLcharARB *name) +GLuint GLAPIENTRY +_mesa_CreateProgram(void) +{ + return (GLuint) _mesa_CreateProgramObjectARB(); +} + +void GLAPIENTRY +_mesa_DeleteProgram(GLuint program) +{ + _mesa_DeleteObjectARB(program); +} + + +void GLAPIENTRY +_mesa_DeleteShader(GLuint shader) { - GET_CURRENT_CONTEXT(ctx); - GLint loc = -1; - GET_LINKED_PROGRAM(pro, programObj, "glGetAttribLocationARB"); + _mesa_DeleteObjectARB(shader); +} - if (pro == NULL) - return -1; +void GLAPIENTRY +_mesa_DetachShader(GLuint program, GLuint shader) +{ + _mesa_DetachObjectARB(program, shader); +} - if (name == NULL) - _mesa_error (ctx, GL_INVALID_VALUE, "glGetAttribLocationARB"); - else if (!IS_NAME_WITH_GL_PREFIX(name)) - loc = (**pro).GetAttribLocation (pro, name); - RELEASE_PROGRAM(pro); - return loc; +void GLAPIENTRY +_mesa_GetAttachedShaders(GLuint program, GLsizei maxCount, + GLsizei *count, GLuint *obj) +{ + _mesa_GetAttachedObjectsARB(program, maxCount, count, obj); } +void GLAPIENTRY +_mesa_GetProgramiv(GLuint program, GLenum pname, GLint *params) +{ + GET_CURRENT_CONTEXT(ctx); + GET_PROGRAM(pro, program, "glGetProgramiv"); + + if (!pro) + return; + + switch (pname) { + case GL_DELETE_STATUS: + *params = (**pro)._container._generic.GetDeleteStatus((struct gl2_generic_inf **) pro); + break; + case GL_LINK_STATUS: + *params = (**pro).GetLinkStatus(pro); + break; + case GL_VALIDATE_STATUS: + *params = (**pro).GetValidateStatus(pro); + break; + case GL_INFO_LOG_LENGTH: + *params = (**pro)._container._generic.GetInfoLogLength( (struct gl2_unknown_inf **) pro ); + break; + case GL_ATTACHED_SHADERS: + *params = (**pro)._container.GetAttachedCount( (struct gl2_unknown_inf **) pro ); + break; + case GL_ACTIVE_ATTRIBUTES: + *params = (**pro).GetActiveAttribCount(pro); + break; + case GL_ACTIVE_ATTRIBUTE_MAX_LENGTH: + *params = (**pro).GetActiveAttribMaxLength(pro); + break; + case GL_ACTIVE_UNIFORMS: + *params = (**pro).GetActiveUniformCount(pro); + break; + case GL_ACTIVE_UNIFORM_MAX_LENGTH: + *params = (**pro).GetActiveUniformMaxLength(pro); + break; + default: + _mesa_error(ctx, GL_INVALID_ENUM, "glGetProgramiv(pname)"); + return; + } +} + +void GLAPIENTRY +_mesa_GetProgramInfoLog(GLuint program, GLsizei bufSize, + GLsizei *length, GLchar *infoLog) +{ + _mesa_GetInfoLogARB(program, bufSize, length, infoLog); +} + +void GLAPIENTRY +_mesa_GetShaderiv(GLuint shader, GLenum pname, GLint *params) +{ + GET_CURRENT_CONTEXT(ctx); + GET_SHADER(sh, shader, "glGetShaderiv"); + + if (!sh) + return; + + switch (pname) { + case GL_SHADER_TYPE: + *params = (**sh).GetSubType(sh); + break; + case GL_DELETE_STATUS: + *params = (**sh)._generic.GetDeleteStatus((struct gl2_generic_inf **) sh); + break; + case GL_COMPILE_STATUS: + *params = (**sh).GetCompileStatus(sh); + break; + case GL_INFO_LOG_LENGTH: + *params = (**sh)._generic.GetInfoLogLength((struct gl2_generic_inf **)sh); + break; + case GL_SHADER_SOURCE_LENGTH: + { + const GLchar *src = (**sh).GetSource(sh); + *params = src ? (_mesa_strlen(src) + 1) : 0; + } + break; + default: + _mesa_error(ctx, GL_INVALID_ENUM, "glGetShaderiv(pname)"); + return; + } +} + +void GLAPIENTRY +_mesa_GetShaderInfoLog(GLuint shader, GLsizei bufSize, + GLsizei *length, GLchar *infoLog) +{ + _mesa_GetInfoLogARB(shader, bufSize, length, infoLog); +} + +GLboolean GLAPIENTRY +_mesa_IsProgram(GLuint program) +{ + GET_CURRENT_CONTEXT(ctx); + GET_PROGRAM(pro, program, "glIsProgram"); + if (pro) { + RELEASE_PROGRAM(pro); + return GL_TRUE; + } + else { + return GL_FALSE; + } +} + +GLboolean GLAPIENTRY +_mesa_IsShader(GLuint shader) +{ + GET_CURRENT_CONTEXT(ctx); + GET_SHADER(sh, shader, "glIsProgram"); + if (sh) { + RELEASE_SHADER(sh); + return GL_TRUE; + } + else { + return GL_FALSE; + } +} + + +/** + ** 2.1 functions + **/ + +void GLAPIENTRY +_mesa_UniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose, + const GLfloat *value) +{ + uniform_matrix(2, 3, "glUniformMatrix2x3fv", GL_FLOAT_MAT2x3, + location, count, transpose, value); +} + +void GLAPIENTRY +_mesa_UniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose, + const GLfloat *value) +{ + uniform_matrix(3, 2, "glUniformMatrix3x2fv", GL_FLOAT_MAT3x2, + location, count, transpose, value); +} + +void GLAPIENTRY +_mesa_UniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose, + const GLfloat *value) +{ + uniform_matrix(2, 4, "glUniformMatrix2x4fv", GL_FLOAT_MAT2x4, + location, count, transpose, value); +} + +void GLAPIENTRY +_mesa_UniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose, + const GLfloat *value) +{ + uniform_matrix(4, 2, "glUniformMatrix4x2fv", GL_FLOAT_MAT4x2, + location, count, transpose, value); +} + +void GLAPIENTRY +_mesa_UniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose, + const GLfloat *value) +{ + uniform_matrix(3, 4, "glUniformMatrix3x4fv", GL_FLOAT_MAT3x4, + location, count, transpose, value); +} + +void GLAPIENTRY +_mesa_UniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose, + const GLfloat *value) +{ + uniform_matrix(4, 3, "glUniformMatrix4x3fv", GL_FLOAT_MAT4x3, + location, count, transpose, value); +} + + + + + #endif GLvoid -_mesa_init_shaderobjects (GLcontext *ctx) +_mesa_init_shaderobjects(GLcontext * ctx) { - ctx->ShaderObjects.CurrentProgram = NULL; - ctx->ShaderObjects._FragmentShaderPresent = GL_FALSE; - ctx->ShaderObjects._VertexShaderPresent = GL_FALSE; + ctx->ShaderObjects.CurrentProgram = NULL; + ctx->ShaderObjects._FragmentShaderPresent = GL_FALSE; + ctx->ShaderObjects._VertexShaderPresent = GL_FALSE; - _mesa_init_shaderobjects_3dlabs (ctx); + _mesa_init_shaderobjects_3dlabs(ctx); } - diff --git a/src/mesa/shader/shaderobjects.h b/src/mesa/shader/shaderobjects.h index cc670216292..09ba807255e 100644 --- a/src/mesa/shader/shaderobjects.h +++ b/src/mesa/shader/shaderobjects.h @@ -104,6 +104,8 @@ struct gl2_program_intf GLint (* GetUniformLocation) (struct gl2_program_intf **, const GLchar *name); GLboolean (* WriteUniform) (struct gl2_program_intf **, GLint loc, GLsizei count, const GLvoid *data, GLenum type); + GLboolean (* ReadUniform) (struct gl2_program_intf **, GLint loc, GLsizei count, + GLvoid *data, GLenum type); GLvoid (* GetActiveAttrib) (struct gl2_program_intf **, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLchar *name); GLuint (* GetActiveAttribMaxLength) (struct gl2_program_intf **); @@ -270,6 +272,79 @@ _mesa_GetAttribLocationARB (GLhandleARB, const GLcharARB *); #endif /* FEATURE_ARB_vertex_shader */ + +/* 2.0 */ +extern void GLAPIENTRY +_mesa_AttachShader(GLuint program, GLuint shader); + +extern GLuint GLAPIENTRY +_mesa_CreateShader(GLenum); + +extern GLuint GLAPIENTRY +_mesa_CreateProgram(void); + +extern void GLAPIENTRY +_mesa_DeleteProgram(GLuint program); + +extern void GLAPIENTRY +_mesa_DeleteShader(GLuint shader); + +extern void GLAPIENTRY +_mesa_DetachShader(GLuint program, GLuint shader); + +extern void GLAPIENTRY +_mesa_GetAttachedShaders(GLuint program, GLsizei maxCount, + GLsizei *count, GLuint *obj); + +extern void GLAPIENTRY +_mesa_GetProgramiv(GLuint program, GLenum pname, GLint *params); + +extern void GLAPIENTRY +_mesa_GetProgramInfoLog(GLuint program, GLsizei bufSize, + GLsizei *length, GLchar *infoLog); + +extern void GLAPIENTRY +_mesa_GetShaderiv(GLuint shader, GLenum pname, GLint *params); + +extern void GLAPIENTRY +_mesa_GetShaderInfoLog(GLuint shader, GLsizei bufSize, + GLsizei *length, GLchar *infoLog); + +extern GLboolean GLAPIENTRY +_mesa_IsProgram(GLuint program); + +extern GLboolean GLAPIENTRY +_mesa_IsShader(GLuint shader); + + + +/* 2.1 */ +extern void GLAPIENTRY +_mesa_UniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose, + const GLfloat *value); + +extern void GLAPIENTRY +_mesa_UniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose, + const GLfloat *value); + +extern void GLAPIENTRY +_mesa_UniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose, + const GLfloat *value); + +extern void GLAPIENTRY +_mesa_UniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose, + const GLfloat *value); + +extern void GLAPIENTRY +_mesa_UniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose, + const GLfloat *value); + +extern void GLAPIENTRY +_mesa_UniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose, + const GLfloat *value); + + + #endif /* FEATURE_ARB_shader_objects */ extern void diff --git a/src/mesa/shader/shaderobjects_3dlabs.c b/src/mesa/shader/shaderobjects_3dlabs.c index 0def13d3b81..3ead1a17841 100755 --- a/src/mesa/shader/shaderobjects_3dlabs.c +++ b/src/mesa/shader/shaderobjects_3dlabs.c @@ -48,1731 +48,1887 @@ struct gl2_unknown_obj { - GLuint reference_count; - void (* _destructor) (struct gl2_unknown_intf **); + GLuint reference_count; + void (*_destructor) (struct gl2_unknown_intf **); }; struct gl2_unknown_impl { - struct gl2_unknown_intf *_vftbl; - struct gl2_unknown_obj _obj; + struct gl2_unknown_intf *_vftbl; + struct gl2_unknown_obj _obj; }; static void -_unknown_destructor (struct gl2_unknown_intf **intf) +_unknown_destructor(struct gl2_unknown_intf **intf) { } static void -_unknown_AddRef (struct gl2_unknown_intf **intf) +_unknown_AddRef(struct gl2_unknown_intf **intf) { - struct gl2_unknown_impl *impl = (struct gl2_unknown_impl *) intf; + struct gl2_unknown_impl *impl = (struct gl2_unknown_impl *) intf; - impl->_obj.reference_count++; + impl->_obj.reference_count++; } static void -_unknown_Release (struct gl2_unknown_intf **intf) +_unknown_Release(struct gl2_unknown_intf **intf) { - struct gl2_unknown_impl *impl = (struct gl2_unknown_impl *) intf; + struct gl2_unknown_impl *impl = (struct gl2_unknown_impl *) intf; - impl->_obj.reference_count--; - if (impl->_obj.reference_count == 0) - { - impl->_obj._destructor (intf); - _mesa_free ((void *) intf); - } + impl->_obj.reference_count--; + if (impl->_obj.reference_count == 0) { + impl->_obj._destructor(intf); + _mesa_free((void *) intf); + } } static struct gl2_unknown_intf ** -_unknown_QueryInterface (struct gl2_unknown_intf **intf, enum gl2_uiid uiid) +_unknown_QueryInterface(struct gl2_unknown_intf **intf, enum gl2_uiid uiid) { - if (uiid == UIID_UNKNOWN) - { - (**intf).AddRef (intf); - return intf; - } - return NULL; + if (uiid == UIID_UNKNOWN) { + (**intf).AddRef(intf); + return intf; + } + return NULL; } static struct gl2_unknown_intf _unknown_vftbl = { - _unknown_AddRef, - _unknown_Release, - _unknown_QueryInterface + _unknown_AddRef, + _unknown_Release, + _unknown_QueryInterface }; static void -_unknown_constructor (struct gl2_unknown_impl *impl) +_unknown_constructor(struct gl2_unknown_impl *impl) { - impl->_vftbl = &_unknown_vftbl; - impl->_obj.reference_count = 1; - impl->_obj._destructor = _unknown_destructor; + impl->_vftbl = &_unknown_vftbl; + impl->_obj.reference_count = 1; + impl->_obj._destructor = _unknown_destructor; } struct gl2_unkinner_obj { - struct gl2_unknown_intf **unkouter; + struct gl2_unknown_intf **unkouter; }; struct gl2_unkinner_impl { - struct gl2_unknown_intf *_vftbl; - struct gl2_unkinner_obj _obj; + struct gl2_unknown_intf *_vftbl; + struct gl2_unkinner_obj _obj; }; static void -_unkinner_destructor (struct gl2_unknown_intf **intf) +_unkinner_destructor(struct gl2_unknown_intf **intf) { } static void -_unkinner_AddRef (struct gl2_unknown_intf **intf) +_unkinner_AddRef(struct gl2_unknown_intf **intf) { - struct gl2_unkinner_impl *impl = (struct gl2_unkinner_impl *) intf; + struct gl2_unkinner_impl *impl = (struct gl2_unkinner_impl *) intf; - (**impl->_obj.unkouter).AddRef (impl->_obj.unkouter); + (**impl->_obj.unkouter).AddRef(impl->_obj.unkouter); } static void -_unkinner_Release (struct gl2_unknown_intf **intf) +_unkinner_Release(struct gl2_unknown_intf **intf) { - struct gl2_unkinner_impl *impl = (struct gl2_unkinner_impl *) intf; + struct gl2_unkinner_impl *impl = (struct gl2_unkinner_impl *) intf; - (**impl->_obj.unkouter).Release (impl->_obj.unkouter); + (**impl->_obj.unkouter).Release(impl->_obj.unkouter); } static struct gl2_unknown_intf ** -_unkinner_QueryInterface (struct gl2_unknown_intf **intf, enum gl2_uiid uiid) +_unkinner_QueryInterface(struct gl2_unknown_intf **intf, enum gl2_uiid uiid) { - struct gl2_unkinner_impl *impl = (struct gl2_unkinner_impl *) intf; + struct gl2_unkinner_impl *impl = (struct gl2_unkinner_impl *) intf; - return (**impl->_obj.unkouter).QueryInterface (impl->_obj.unkouter, uiid); + return (**impl->_obj.unkouter).QueryInterface(impl->_obj.unkouter, uiid); } static struct gl2_unknown_intf _unkinner_vftbl = { - _unkinner_AddRef, - _unkinner_Release, - _unkinner_QueryInterface + _unkinner_AddRef, + _unkinner_Release, + _unkinner_QueryInterface }; static void -_unkinner_constructor (struct gl2_unkinner_impl *impl, struct gl2_unknown_intf **outer) +_unkinner_constructor(struct gl2_unkinner_impl *impl, + struct gl2_unknown_intf **outer) { - impl->_vftbl = &_unkinner_vftbl; - impl->_obj.unkouter = outer; + impl->_vftbl = &_unkinner_vftbl; + impl->_obj.unkouter = outer; } struct gl2_generic_obj { - struct gl2_unknown_obj _unknown; - GLhandleARB name; - GLboolean delete_status; - GLcharARB *info_log; + struct gl2_unknown_obj _unknown; + GLhandleARB name; + GLboolean delete_status; + GLcharARB *info_log; }; struct gl2_generic_impl { - struct gl2_generic_intf *_vftbl; - struct gl2_generic_obj _obj; + struct gl2_generic_intf *_vftbl; + struct gl2_generic_obj _obj; }; static void -_generic_destructor (struct gl2_unknown_intf **intf) +_generic_destructor(struct gl2_unknown_intf **intf) { - GET_CURRENT_CONTEXT(ctx); - struct gl2_generic_impl *impl = (struct gl2_generic_impl *) intf; + GET_CURRENT_CONTEXT(ctx); + struct gl2_generic_impl *impl = (struct gl2_generic_impl *) intf; - _mesa_free ((void *) impl->_obj.info_log); + _mesa_free((void *) impl->_obj.info_log); - _glthread_LOCK_MUTEX (ctx->Shared->Mutex); - _mesa_HashRemove (ctx->Shared->GL2Objects, impl->_obj.name); - _glthread_UNLOCK_MUTEX (ctx->Shared->Mutex); + _glthread_LOCK_MUTEX(ctx->Shared->Mutex); + _mesa_HashRemove(ctx->Shared->GL2Objects, impl->_obj.name); + _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex); - _unknown_destructor (intf); + _unknown_destructor(intf); } static struct gl2_unknown_intf ** -_generic_QueryInterface (struct gl2_unknown_intf **intf, enum gl2_uiid uiid) +_generic_QueryInterface(struct gl2_unknown_intf **intf, enum gl2_uiid uiid) { - if (uiid == UIID_GENERIC) - { - (**intf).AddRef (intf); - return intf; - } - return _unknown_QueryInterface (intf, uiid); + if (uiid == UIID_GENERIC) { + (**intf).AddRef(intf); + return intf; + } + return _unknown_QueryInterface(intf, uiid); } static void -_generic_Delete (struct gl2_generic_intf **intf) +_generic_Delete(struct gl2_generic_intf **intf) { - struct gl2_generic_impl *impl = (struct gl2_generic_impl *) intf; + struct gl2_generic_impl *impl = (struct gl2_generic_impl *) intf; - if (impl->_obj.delete_status == GL_FALSE) - { - impl->_obj.delete_status = GL_TRUE; - (**intf)._unknown.Release ((struct gl2_unknown_intf **) intf); - } + if (impl->_obj.delete_status == GL_FALSE) { + impl->_obj.delete_status = GL_TRUE; + (**intf)._unknown.Release((struct gl2_unknown_intf **) intf); + } } static GLhandleARB -_generic_GetName (struct gl2_generic_intf **intf) +_generic_GetName(struct gl2_generic_intf **intf) { - struct gl2_generic_impl *impl = (struct gl2_generic_impl *) intf; + struct gl2_generic_impl *impl = (struct gl2_generic_impl *) intf; - return impl->_obj.name; + return impl->_obj.name; } static GLboolean -_generic_GetDeleteStatus (struct gl2_generic_intf **intf) +_generic_GetDeleteStatus(struct gl2_generic_intf **intf) { - struct gl2_generic_impl *impl = (struct gl2_generic_impl *) intf; + struct gl2_generic_impl *impl = (struct gl2_generic_impl *) intf; - return impl->_obj.delete_status; + return impl->_obj.delete_status; } static GLvoid -_generic_GetInfoLog (struct gl2_generic_intf **intf, GLsizei maxlen, GLcharARB *infolog) +_generic_GetInfoLog(struct gl2_generic_intf **intf, GLsizei maxlen, + GLcharARB * infolog) { struct gl2_generic_impl *impl = (struct gl2_generic_impl *) (intf); if (maxlen > 0) { - _mesa_strncpy (infolog, impl->_obj.info_log, maxlen - 1); + _mesa_strncpy(infolog, impl->_obj.info_log, maxlen - 1); infolog[maxlen - 1] = '\0'; } } static GLsizei -_generic_GetInfoLogLength (struct gl2_generic_intf **intf) +_generic_GetInfoLogLength(struct gl2_generic_intf **intf) { struct gl2_generic_impl *impl = (struct gl2_generic_impl *) (intf); if (impl->_obj.info_log == NULL) return 1; - return _mesa_strlen (impl->_obj.info_log) + 1; + return _mesa_strlen(impl->_obj.info_log) + 1; } static struct gl2_generic_intf _generic_vftbl = { - { - _unknown_AddRef, - _unknown_Release, - _generic_QueryInterface - }, - _generic_Delete, - NULL, /* abstract GetType */ - _generic_GetName, - _generic_GetDeleteStatus, + { + _unknown_AddRef, + _unknown_Release, + _generic_QueryInterface}, + _generic_Delete, + NULL, /* abstract GetType */ + _generic_GetName, + _generic_GetDeleteStatus, _generic_GetInfoLog, _generic_GetInfoLogLength }; static void -_generic_constructor (struct gl2_generic_impl *impl) +_generic_constructor(struct gl2_generic_impl *impl) { - GET_CURRENT_CONTEXT(ctx); + GET_CURRENT_CONTEXT(ctx); - _unknown_constructor ((struct gl2_unknown_impl *) impl); - impl->_vftbl = &_generic_vftbl; - impl->_obj._unknown._destructor = _generic_destructor; - impl->_obj.delete_status = GL_FALSE; - impl->_obj.info_log = NULL; + _unknown_constructor((struct gl2_unknown_impl *) impl); + impl->_vftbl = &_generic_vftbl; + impl->_obj._unknown._destructor = _generic_destructor; + impl->_obj.delete_status = GL_FALSE; + impl->_obj.info_log = NULL; - _glthread_LOCK_MUTEX (ctx->Shared->Mutex); - impl->_obj.name = _mesa_HashFindFreeKeyBlock (ctx->Shared->GL2Objects, 1); - _mesa_HashInsert (ctx->Shared->GL2Objects, impl->_obj.name, (void *) impl); - _glthread_UNLOCK_MUTEX (ctx->Shared->Mutex); + _glthread_LOCK_MUTEX(ctx->Shared->Mutex); + impl->_obj.name = _mesa_HashFindFreeKeyBlock(ctx->Shared->GL2Objects, 1); + _mesa_HashInsert(ctx->Shared->GL2Objects, impl->_obj.name, (void *) impl); + _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex); } struct gl2_container_obj { - struct gl2_generic_obj _generic; - struct gl2_generic_intf ***attached; - GLuint attached_count; + struct gl2_generic_obj _generic; + struct gl2_generic_intf ***attached; + GLuint attached_count; }; struct gl2_container_impl { - struct gl2_container_intf *_vftbl; - struct gl2_container_obj _obj; + struct gl2_container_intf *_vftbl; + struct gl2_container_obj _obj; }; static void -_container_destructor (struct gl2_unknown_intf **intf) +_container_destructor(struct gl2_unknown_intf **intf) { - struct gl2_container_impl *impl = (struct gl2_container_impl *) intf; - GLuint i; + struct gl2_container_impl *impl = (struct gl2_container_impl *) intf; + GLuint i; - for (i = 0; i < impl->_obj.attached_count; i++) - { - struct gl2_generic_intf **x = impl->_obj.attached[i]; - (**x)._unknown.Release ((struct gl2_unknown_intf **) x); - } + for (i = 0; i < impl->_obj.attached_count; i++) { + struct gl2_generic_intf **x = impl->_obj.attached[i]; + (**x)._unknown.Release((struct gl2_unknown_intf **) x); + } - _generic_destructor (intf); + _generic_destructor(intf); } static struct gl2_unknown_intf ** -_container_QueryInterface (struct gl2_unknown_intf **intf, enum gl2_uiid uiid) +_container_QueryInterface(struct gl2_unknown_intf **intf, enum gl2_uiid uiid) { - if (uiid == UIID_CONTAINER) - { - (**intf).AddRef (intf); - return intf; - } - return _generic_QueryInterface (intf, uiid); + if (uiid == UIID_CONTAINER) { + (**intf).AddRef(intf); + return intf; + } + return _generic_QueryInterface(intf, uiid); } static GLboolean -_container_Attach (struct gl2_container_intf **intf, struct gl2_generic_intf **att) +_container_Attach(struct gl2_container_intf **intf, + struct gl2_generic_intf **att) { - GET_CURRENT_CONTEXT(ctx); - struct gl2_container_impl *impl = (struct gl2_container_impl *) intf; - GLuint i; + GET_CURRENT_CONTEXT(ctx); + struct gl2_container_impl *impl = (struct gl2_container_impl *) intf; + GLuint i; - for (i = 0; i < impl->_obj.attached_count; i++) - if (impl->_obj.attached[i] == att) - { - _mesa_error (ctx, GL_INVALID_OPERATION, "_container_Attach"); - return GL_FALSE; - } + for (i = 0; i < impl->_obj.attached_count; i++) + if (impl->_obj.attached[i] == att) { + _mesa_error(ctx, GL_INVALID_OPERATION, "_container_Attach"); + return GL_FALSE; + } - impl->_obj.attached = (struct gl2_generic_intf ***) _mesa_realloc (impl->_obj.attached, - impl->_obj.attached_count * sizeof (*impl->_obj.attached), (impl->_obj.attached_count + 1) * - sizeof (*impl->_obj.attached)); - if (impl->_obj.attached == NULL) - return GL_FALSE; + impl->_obj.attached = (struct gl2_generic_intf ***) + _mesa_realloc(impl->_obj.attached, + impl->_obj.attached_count * sizeof(*impl->_obj.attached), + (impl->_obj.attached_count + 1) * sizeof(*impl->_obj.attached)); + if (impl->_obj.attached == NULL) + return GL_FALSE; - impl->_obj.attached[impl->_obj.attached_count] = att; - impl->_obj.attached_count++; - (**att)._unknown.AddRef ((struct gl2_unknown_intf **) att); - return GL_TRUE; + impl->_obj.attached[impl->_obj.attached_count] = att; + impl->_obj.attached_count++; + (**att)._unknown.AddRef((struct gl2_unknown_intf **) att); + return GL_TRUE; } static GLboolean -_container_Detach (struct gl2_container_intf **intf, struct gl2_generic_intf **att) -{ - GET_CURRENT_CONTEXT(ctx); - struct gl2_container_impl *impl = (struct gl2_container_impl *) intf; - GLuint i, j; - - for (i = 0; i < impl->_obj.attached_count; i++) - if (impl->_obj.attached[i] == att) - { - for (j = i; j < impl->_obj.attached_count - 1; j++) - impl->_obj.attached[j] = impl->_obj.attached[j + 1]; - impl->_obj.attached = (struct gl2_generic_intf ***) _mesa_realloc (impl->_obj.attached, - impl->_obj.attached_count * sizeof (*impl->_obj.attached), - (impl->_obj.attached_count - 1) * sizeof (*impl->_obj.attached)); - impl->_obj.attached_count--; - (**att)._unknown.Release ((struct gl2_unknown_intf **) att); - return GL_TRUE; - } +_container_Detach(struct gl2_container_intf **intf, + struct gl2_generic_intf **att) +{ + GET_CURRENT_CONTEXT(ctx); + struct gl2_container_impl *impl = (struct gl2_container_impl *) intf; + GLuint i, j; + + for (i = 0; i < impl->_obj.attached_count; i++) + if (impl->_obj.attached[i] == att) { + for (j = i; j < impl->_obj.attached_count - 1; j++) + impl->_obj.attached[j] = impl->_obj.attached[j + 1]; + impl->_obj.attached = (struct gl2_generic_intf ***) + _mesa_realloc(impl->_obj.attached, + impl->_obj.attached_count * sizeof(*impl->_obj.attached), + (impl->_obj.attached_count - 1) * sizeof(*impl->_obj.attached)); + impl->_obj.attached_count--; + (**att)._unknown.Release((struct gl2_unknown_intf **) att); + return GL_TRUE; + } - _mesa_error (ctx, GL_INVALID_OPERATION, "_container_Detach"); - return GL_FALSE; + _mesa_error(ctx, GL_INVALID_OPERATION, "_container_Detach"); + return GL_FALSE; } static GLsizei -_container_GetAttachedCount (struct gl2_container_intf **intf) +_container_GetAttachedCount(struct gl2_container_intf **intf) { - struct gl2_container_impl *impl = (struct gl2_container_impl *) intf; + struct gl2_container_impl *impl = (struct gl2_container_impl *) intf; - return impl->_obj.attached_count; + return impl->_obj.attached_count; } static struct gl2_generic_intf ** -_container_GetAttached (struct gl2_container_intf **intf, GLuint index) +_container_GetAttached(struct gl2_container_intf **intf, GLuint index) { - struct gl2_container_impl *impl = (struct gl2_container_impl *) intf; + struct gl2_container_impl *impl = (struct gl2_container_impl *) intf; - (**impl->_obj.attached[index])._unknown.AddRef ( - (struct gl2_unknown_intf **)impl->_obj.attached[index]); - return impl->_obj.attached[index]; + (**impl->_obj.attached[index])._unknown.AddRef((struct gl2_unknown_intf **) + impl->_obj.attached[index]); + return impl->_obj.attached[index]; } static struct gl2_container_intf _container_vftbl = { - { - { - _unknown_AddRef, - _unknown_Release, - _container_QueryInterface - }, - _generic_Delete, - NULL, /* abstract GetType */ - _generic_GetName, - _generic_GetDeleteStatus, + { + { + _unknown_AddRef, + _unknown_Release, + _container_QueryInterface + }, + _generic_Delete, + NULL, /* abstract GetType */ + _generic_GetName, + _generic_GetDeleteStatus, _generic_GetInfoLog, _generic_GetInfoLogLength - }, - _container_Attach, - _container_Detach, - _container_GetAttachedCount, - _container_GetAttached + }, + _container_Attach, + _container_Detach, + _container_GetAttachedCount, + _container_GetAttached }; static void -_container_constructor (struct gl2_container_impl *impl) +_container_constructor(struct gl2_container_impl *impl) { - _generic_constructor ((struct gl2_generic_impl *) impl); - impl->_vftbl = &_container_vftbl; - impl->_obj._generic._unknown._destructor = _container_destructor; - impl->_obj.attached = NULL; - impl->_obj.attached_count = 0; + _generic_constructor((struct gl2_generic_impl *) impl); + impl->_vftbl = &_container_vftbl; + impl->_obj._generic._unknown._destructor = _container_destructor; + impl->_obj.attached = NULL; + impl->_obj.attached_count = 0; } struct gl2_3dlabs_shhandle_obj { - struct gl2_unkinner_obj _unknown; + struct gl2_unkinner_obj _unknown; #if USE_3DLABS_FRONTEND - ShHandle handle; + ShHandle handle; #endif }; struct gl2_3dlabs_shhandle_impl { - struct gl2_3dlabs_shhandle_intf *_vftbl; - struct gl2_3dlabs_shhandle_obj _obj; + struct gl2_3dlabs_shhandle_intf *_vftbl; + struct gl2_3dlabs_shhandle_obj _obj; }; static void -_3dlabs_shhandle_destructor (struct gl2_unknown_intf **intf) +_3dlabs_shhandle_destructor(struct gl2_unknown_intf **intf) { #if USE_3DLABS_FRONTEND - struct gl2_3dlabs_shhandle_impl *impl = (struct gl2_3dlabs_shhandle_impl *) intf; - ShDestruct (impl->_obj.handle); + struct gl2_3dlabs_shhandle_impl *impl = + (struct gl2_3dlabs_shhandle_impl *) intf; + ShDestruct(impl->_obj.handle); #endif - _unkinner_destructor (intf); + _unkinner_destructor(intf); } static GLvoid * -_3dlabs_shhandle_GetShHandle (struct gl2_3dlabs_shhandle_intf **intf) +_3dlabs_shhandle_GetShHandle(struct gl2_3dlabs_shhandle_intf **intf) { #if USE_3DLABS_FRONTEND - struct gl2_3dlabs_shhandle_impl *impl = (struct gl2_3dlabs_shhandle_impl *) intf; - return impl->_obj.handle; + struct gl2_3dlabs_shhandle_impl *impl = + (struct gl2_3dlabs_shhandle_impl *) intf; + return impl->_obj.handle; #else - return NULL; + return NULL; #endif } static struct gl2_3dlabs_shhandle_intf _3dlabs_shhandle_vftbl = { - { - _unkinner_AddRef, - _unkinner_Release, - _unkinner_QueryInterface - }, - _3dlabs_shhandle_GetShHandle + { + _unkinner_AddRef, + _unkinner_Release, + _unkinner_QueryInterface}, + _3dlabs_shhandle_GetShHandle }; static void -_3dlabs_shhandle_constructor (struct gl2_3dlabs_shhandle_impl *impl, struct gl2_unknown_intf **outer) +_3dlabs_shhandle_constructor(struct gl2_3dlabs_shhandle_impl *impl, + struct gl2_unknown_intf **outer) { - _unkinner_constructor ((struct gl2_unkinner_impl *) impl, outer); - impl->_vftbl = &_3dlabs_shhandle_vftbl; + _unkinner_constructor((struct gl2_unkinner_impl *) impl, outer); + impl->_vftbl = &_3dlabs_shhandle_vftbl; #if USE_3DLABS_FRONTEND - impl->_obj.handle = NULL; + impl->_obj.handle = NULL; #endif } struct gl2_shader_obj { - struct gl2_generic_obj _generic; - struct gl2_3dlabs_shhandle_impl _3dlabs_shhandle; - GLboolean compile_status; - GLcharARB *source; - GLint *offsets; - GLsizei offset_count; + struct gl2_generic_obj _generic; + struct gl2_3dlabs_shhandle_impl _3dlabs_shhandle; + GLboolean compile_status; + GLcharARB *source; + GLint *offsets; + GLsizei offset_count; slang_code_object code; }; struct gl2_shader_impl { - struct gl2_shader_intf *_vftbl; - struct gl2_shader_obj _obj; + struct gl2_shader_intf *_vftbl; + struct gl2_shader_obj _obj; }; static void -_shader_destructor (struct gl2_unknown_intf **intf) +_shader_destructor(struct gl2_unknown_intf **intf) { - struct gl2_shader_impl *impl = (struct gl2_shader_impl *) intf; + struct gl2_shader_impl *impl = (struct gl2_shader_impl *) intf; - _mesa_free ((void *) impl->_obj.source); - _mesa_free ((void *) impl->_obj.offsets); - _slang_code_object_dtr (&impl->_obj.code); - _3dlabs_shhandle_destructor ((struct gl2_unknown_intf **) &impl->_obj._3dlabs_shhandle._vftbl); - _generic_destructor (intf); + _mesa_free((void *) impl->_obj.source); + _mesa_free((void *) impl->_obj.offsets); + _slang_code_object_dtr(&impl->_obj.code); + _3dlabs_shhandle_destructor((struct gl2_unknown_intf **) &impl->_obj. + _3dlabs_shhandle._vftbl); + _generic_destructor(intf); } static struct gl2_unknown_intf ** -_shader_QueryInterface (struct gl2_unknown_intf **intf, enum gl2_uiid uiid) +_shader_QueryInterface(struct gl2_unknown_intf **intf, enum gl2_uiid uiid) { #if USE_3DLABS_FRONTEND - struct gl2_shader_impl *impl = (struct gl2_shader_impl *) intf; + struct gl2_shader_impl *impl = (struct gl2_shader_impl *) intf; #endif - if (uiid == UIID_SHADER) - { - (**intf).AddRef (intf); - return intf; - } + if (uiid == UIID_SHADER) { + (**intf).AddRef(intf); + return intf; + } #if USE_3DLABS_FRONTEND - if (uiid == UIID_3DLABS_SHHANDLE) - { - (**intf).AddRef (intf); - return (struct gl2_unknown_intf **) &impl->_obj._3dlabs_shhandle._vftbl; - } + if (uiid == UIID_3DLABS_SHHANDLE) { + (**intf).AddRef(intf); + return (struct gl2_unknown_intf **) &impl->_obj._3dlabs_shhandle._vftbl; + } #endif - return _generic_QueryInterface (intf, uiid); + return _generic_QueryInterface(intf, uiid); } static GLenum -_shader_GetType (struct gl2_generic_intf **intf) +_shader_GetType(struct gl2_generic_intf **intf) { - return GL_SHADER_OBJECT_ARB; + return GL_SHADER_OBJECT_ARB; } static GLvoid -_shader_GetInfoLog (struct gl2_generic_intf **intf, GLsizei maxlen, GLcharARB *infolog) +_shader_GetInfoLog(struct gl2_generic_intf **intf, GLsizei maxlen, + GLcharARB * infolog) { struct gl2_shader_impl *impl = (struct gl2_shader_impl *) (intf); if (maxlen > 0) { if (impl->_obj._generic.info_log != NULL) { - GLsizei len = _mesa_strlen (impl->_obj._generic.info_log); + GLsizei len = _mesa_strlen(impl->_obj._generic.info_log); if (len > maxlen - 1) len = maxlen - 1; - _mesa_memcpy (infolog, impl->_obj._generic.info_log, len); + _mesa_memcpy(infolog, impl->_obj._generic.info_log, len); infolog += len; maxlen -= len; } if (impl->_obj.code.machine.infolog != NULL && impl->_obj.code.machine.infolog->text != NULL) { - GLsizei len = _mesa_strlen (impl->_obj.code.machine.infolog->text); + GLsizei len = _mesa_strlen(impl->_obj.code.machine.infolog->text); if (len > maxlen - 1) len = maxlen - 1; - _mesa_memcpy (infolog, impl->_obj.code.machine.infolog->text, len); + _mesa_memcpy(infolog, impl->_obj.code.machine.infolog->text, len); } infolog[maxlen - 1] = '\0'; } } static GLsizei -_shader_GetInfoLogLength (struct gl2_generic_intf **intf) +_shader_GetInfoLogLength(struct gl2_generic_intf **intf) { struct gl2_shader_impl *impl = (struct gl2_shader_impl *) (intf); GLsizei length = 1; if (impl->_obj._generic.info_log != NULL) - length += _mesa_strlen (impl->_obj._generic.info_log); + length += _mesa_strlen(impl->_obj._generic.info_log); if (impl->_obj.code.machine.infolog != NULL && impl->_obj.code.machine.infolog->text != NULL) - length += _mesa_strlen (impl->_obj.code.machine.infolog->text); + length += _mesa_strlen(impl->_obj.code.machine.infolog->text); return length; } static GLboolean -_shader_GetCompileStatus (struct gl2_shader_intf **intf) +_shader_GetCompileStatus(struct gl2_shader_intf **intf) { - struct gl2_shader_impl *impl = (struct gl2_shader_impl *) intf; + struct gl2_shader_impl *impl = (struct gl2_shader_impl *) intf; - return impl->_obj.compile_status; + return impl->_obj.compile_status; } static GLvoid -_shader_SetSource (struct gl2_shader_intf **intf, GLcharARB *src, GLint *off, GLsizei cnt) +_shader_SetSource(struct gl2_shader_intf **intf, GLcharARB * src, GLint * off, + GLsizei cnt) { - struct gl2_shader_impl *impl = (struct gl2_shader_impl *) intf; + struct gl2_shader_impl *impl = (struct gl2_shader_impl *) intf; - _mesa_free ((void *) impl->_obj.source); - impl->_obj.source = src; - _mesa_free ((void *) impl->_obj.offsets); - impl->_obj.offsets = off; - impl->_obj.offset_count = cnt; + _mesa_free((void *) impl->_obj.source); + impl->_obj.source = src; + _mesa_free((void *) impl->_obj.offsets); + impl->_obj.offsets = off; + impl->_obj.offset_count = cnt; } static const GLcharARB * -_shader_GetSource (struct gl2_shader_intf **intf) +_shader_GetSource(struct gl2_shader_intf **intf) { - struct gl2_shader_impl *impl = (struct gl2_shader_impl *) intf; + struct gl2_shader_impl *impl = (struct gl2_shader_impl *) intf; - return impl->_obj.source; + return impl->_obj.source; } static GLvoid -_shader_Compile (struct gl2_shader_intf **intf) +_shader_Compile(struct gl2_shader_intf **intf) { - struct gl2_shader_impl *impl = (struct gl2_shader_impl *) intf; + struct gl2_shader_impl *impl = (struct gl2_shader_impl *) intf; #if USE_3DLABS_FRONTEND - char **strings; - TBuiltInResource res; + char **strings; + TBuiltInResource res; #else - slang_unit_type type; - slang_info_log info_log; + slang_unit_type type; + slang_info_log info_log; #endif - impl->_obj.compile_status = GL_FALSE; - _mesa_free ((void *) impl->_obj._generic.info_log); - impl->_obj._generic.info_log = NULL; + impl->_obj.compile_status = GL_FALSE; + _mesa_free((void *) impl->_obj._generic.info_log); + impl->_obj._generic.info_log = NULL; #if USE_3DLABS_FRONTEND - /* 3dlabs compiler expects us to feed it with null-terminated string array, - we've got only one big string with offsets, so we must split it; but when - there's only one string to deal with, we pass its address directly */ - - if (impl->_obj.offset_count <= 1) - strings = &impl->_obj.source; - else - { - GLsizei i, offset = 0; - - strings = (char **) _mesa_malloc (impl->_obj.offset_count * sizeof (char *)); - if (strings == NULL) - return; - - for (i = 0; i < impl->_obj.offset_count; i++) - { - GLsizei size = impl->_obj.offsets[i] - offset; - - strings[i] = (char *) _mesa_malloc ((size + 1) * sizeof (char)); - if (strings[i] == NULL) - { - GLsizei j; - - for (j = 0; j < i; j++) - _mesa_free (strings[j]); - _mesa_free (strings); - return; - } - - _mesa_memcpy (strings[i], impl->_obj.source + offset, size * sizeof (char)); - strings[i][size] = '\0'; - offset = impl->_obj.offsets[i]; - } - } - - /* TODO set these fields to some REAL numbers */ - res.maxLights = 8; - res.maxClipPlanes = 6; - res.maxTextureUnits = 2; - res.maxTextureCoords = 2; - res.maxVertexAttribs = 8; - res.maxVertexUniformComponents = 64; - res.maxVaryingFloats = 8; - res.maxVertexTextureImageUnits = 2; - res.maxCombinedTextureImageUnits = 2; - res.maxTextureImageUnits = 2; - res.maxFragmentUniformComponents = 64; - res.maxDrawBuffers = 1; - - if (ShCompile (impl->_obj._3dlabs_shhandle._obj.handle, strings, impl->_obj.offset_count, - EShOptFull, &res, 0)) - impl->_obj.compile_status = GL_TRUE; - if (impl->_obj.offset_count > 1) - { - GLsizei i; - - for (i = 0; i < impl->_obj.offset_count; i++) - _mesa_free (strings[i]); - _mesa_free (strings); - } - - impl->_obj._generic.info_log = _mesa_strdup (ShGetInfoLog ( - impl->_obj._3dlabs_shhandle._obj.handle)); + /* 3dlabs compiler expects us to feed it with null-terminated string array, + we've got only one big string with offsets, so we must split it; but when + there's only one string to deal with, we pass its address directly */ + + if (impl->_obj.offset_count <= 1) + strings = &impl->_obj.source; + else { + GLsizei i, offset = 0; + + strings = + (char **) _mesa_malloc(impl->_obj.offset_count * sizeof(char *)); + if (strings == NULL) + return; + + for (i = 0; i < impl->_obj.offset_count; i++) { + GLsizei size = impl->_obj.offsets[i] - offset; + + strings[i] = (char *) _mesa_malloc((size + 1) * sizeof(char)); + if (strings[i] == NULL) { + GLsizei j; + + for (j = 0; j < i; j++) + _mesa_free(strings[j]); + _mesa_free(strings); + return; + } + + _mesa_memcpy(strings[i], impl->_obj.source + offset, + size * sizeof(char)); + strings[i][size] = '\0'; + offset = impl->_obj.offsets[i]; + } + } + + /* TODO set these fields to some REAL numbers */ + res.maxLights = 8; + res.maxClipPlanes = 6; + res.maxTextureUnits = 2; + res.maxTextureCoords = 2; + res.maxVertexAttribs = 8; + res.maxVertexUniformComponents = 64; + res.maxVaryingFloats = 8; + res.maxVertexTextureImageUnits = 2; + res.maxCombinedTextureImageUnits = 2; + res.maxTextureImageUnits = 2; + res.maxFragmentUniformComponents = 64; + res.maxDrawBuffers = 1; + + if (ShCompile + (impl->_obj._3dlabs_shhandle._obj.handle, strings, + impl->_obj.offset_count, EShOptFull, &res, 0)) + impl->_obj.compile_status = GL_TRUE; + if (impl->_obj.offset_count > 1) { + GLsizei i; + + for (i = 0; i < impl->_obj.offset_count; i++) + _mesa_free(strings[i]); + _mesa_free(strings); + } + + impl->_obj._generic.info_log = + _mesa_strdup(ShGetInfoLog(impl->_obj._3dlabs_shhandle._obj.handle)); #else - if (impl->_vftbl->GetSubType (intf) == GL_FRAGMENT_SHADER) - type = slang_unit_fragment_shader; - else - type = slang_unit_vertex_shader; - slang_info_log_construct (&info_log); - if (_slang_compile (impl->_obj.source, &impl->_obj.code, type, &info_log)) + if (impl->_vftbl->GetSubType(intf) == GL_FRAGMENT_SHADER) + type = slang_unit_fragment_shader; + else + type = slang_unit_vertex_shader; + slang_info_log_construct(&info_log); + if (_slang_compile(impl->_obj.source, &impl->_obj.code, type, &info_log)) impl->_obj.compile_status = GL_TRUE; - if (info_log.text != NULL) - impl->_obj._generic.info_log = _mesa_strdup (info_log.text); - else if (impl->_obj.compile_status) - impl->_obj._generic.info_log = _mesa_strdup ("Compile OK.\n"); + if (info_log.text != NULL) + impl->_obj._generic.info_log = _mesa_strdup(info_log.text); + else if (impl->_obj.compile_status) + impl->_obj._generic.info_log = _mesa_strdup("Compile OK.\n"); else - impl->_obj._generic.info_log = _mesa_strdup ("Compile failed.\n"); - slang_info_log_destruct (&info_log); + impl->_obj._generic.info_log = _mesa_strdup("Compile failed.\n"); + slang_info_log_destruct(&info_log); #endif } static struct gl2_shader_intf _shader_vftbl = { - { - { - _unknown_AddRef, - _unknown_Release, - _shader_QueryInterface - }, - _generic_Delete, - _shader_GetType, - _generic_GetName, - _generic_GetDeleteStatus, + { + { + _unknown_AddRef, + _unknown_Release, + _shader_QueryInterface + }, + _generic_Delete, + _shader_GetType, + _generic_GetName, + _generic_GetDeleteStatus, _shader_GetInfoLog, _shader_GetInfoLogLength - }, - NULL, /* abstract GetSubType */ - _shader_GetCompileStatus, - _shader_SetSource, - _shader_GetSource, - _shader_Compile + }, + NULL, /* abstract GetSubType */ + _shader_GetCompileStatus, + _shader_SetSource, + _shader_GetSource, + _shader_Compile }; static void -_shader_constructor (struct gl2_shader_impl *impl) +_shader_constructor(struct gl2_shader_impl *impl) { - _generic_constructor ((struct gl2_generic_impl *) impl); - _3dlabs_shhandle_constructor (&impl->_obj._3dlabs_shhandle, (struct gl2_unknown_intf **) - &impl->_vftbl); - impl->_vftbl = &_shader_vftbl; - impl->_obj._generic._unknown._destructor = _shader_destructor; - impl->_obj.compile_status = GL_FALSE; - impl->_obj.source = NULL; - impl->_obj.offsets = NULL; - impl->_obj.offset_count = 0; - _slang_code_object_ctr (&impl->_obj.code); + _generic_constructor((struct gl2_generic_impl *) impl); + _3dlabs_shhandle_constructor(&impl->_obj._3dlabs_shhandle, + (struct gl2_unknown_intf **) + &impl->_vftbl); + impl->_vftbl = &_shader_vftbl; + impl->_obj._generic._unknown._destructor = _shader_destructor; + impl->_obj.compile_status = GL_FALSE; + impl->_obj.source = NULL; + impl->_obj.offsets = NULL; + impl->_obj.offset_count = 0; + _slang_code_object_ctr(&impl->_obj.code); } struct gl2_program_obj { - struct gl2_container_obj _container; - GLboolean link_status; - GLboolean validate_status; + struct gl2_container_obj _container; + GLboolean link_status; + GLboolean validate_status; #if USE_3DLABS_FRONTEND - ShHandle linker; - ShHandle uniforms; + ShHandle linker; + ShHandle uniforms; #endif - slang_program prog; + slang_program prog; }; struct gl2_program_impl { - struct gl2_program_intf *_vftbl; - struct gl2_program_obj _obj; + struct gl2_program_intf *_vftbl; + struct gl2_program_obj _obj; }; static void -_program_destructor (struct gl2_unknown_intf **intf) +_program_destructor(struct gl2_unknown_intf **intf) { - struct gl2_program_impl *impl = (struct gl2_program_impl *) intf; + struct gl2_program_impl *impl = (struct gl2_program_impl *) intf; #if USE_3DLABS_FRONTEND - ShDestruct (impl->_obj.linker); - ShDestruct (impl->_obj.uniforms); + ShDestruct(impl->_obj.linker); + ShDestruct(impl->_obj.uniforms); #endif - _container_destructor (intf); - slang_program_dtr (&impl->_obj.prog); + _container_destructor(intf); + _slang_program_dtr(&impl->_obj.prog); } static struct gl2_unknown_intf ** -_program_QueryInterface (struct gl2_unknown_intf **intf, enum gl2_uiid uiid) +_program_QueryInterface(struct gl2_unknown_intf **intf, enum gl2_uiid uiid) { - if (uiid == UIID_PROGRAM) - { - (**intf).AddRef (intf); - return intf; - } - return _container_QueryInterface (intf, uiid); + if (uiid == UIID_PROGRAM) { + (**intf).AddRef(intf); + return intf; + } + return _container_QueryInterface(intf, uiid); } static GLenum -_program_GetType (struct gl2_generic_intf **intf) +_program_GetType(struct gl2_generic_intf **intf) { - return GL_PROGRAM_OBJECT_ARB; + return GL_PROGRAM_OBJECT_ARB; } static GLboolean -_program_Attach (struct gl2_container_intf **intf, struct gl2_generic_intf **att) -{ - GET_CURRENT_CONTEXT(ctx); - struct gl2_unknown_intf **sha; - - sha = (**att)._unknown.QueryInterface ((struct gl2_unknown_intf **) att, UIID_SHADER); - if (sha == NULL) - { - _mesa_error (ctx, GL_INVALID_OPERATION, "_program_Attach"); - return GL_FALSE; - } +_program_Attach(struct gl2_container_intf **intf, + struct gl2_generic_intf **att) +{ + GET_CURRENT_CONTEXT(ctx); + struct gl2_unknown_intf **sha; + + sha = + (**att)._unknown.QueryInterface((struct gl2_unknown_intf **) att, + UIID_SHADER); + if (sha == NULL) { + _mesa_error(ctx, GL_INVALID_OPERATION, "_program_Attach"); + return GL_FALSE; + } - (**sha).Release (sha); - return _container_Attach (intf, att); + (**sha).Release(sha); + return _container_Attach(intf, att); } static GLboolean -_program_GetLinkStatus (struct gl2_program_intf **intf) +_program_GetLinkStatus(struct gl2_program_intf **intf) { - struct gl2_program_impl *impl = (struct gl2_program_impl *) intf; + struct gl2_program_impl *impl = (struct gl2_program_impl *) intf; - return impl->_obj.link_status; + return impl->_obj.link_status; } static GLboolean -_program_GetValidateStatus (struct gl2_program_intf **intf) +_program_GetValidateStatus(struct gl2_program_intf **intf) { - struct gl2_program_impl *impl = (struct gl2_program_impl *) intf; + struct gl2_program_impl *impl = (struct gl2_program_impl *) intf; - return impl->_obj.validate_status; + return impl->_obj.validate_status; } static GLvoid -_program_Link (struct gl2_program_intf **intf) +_program_Link(struct gl2_program_intf **intf) { - struct gl2_program_impl *impl = (struct gl2_program_impl *) intf; + struct gl2_program_impl *impl = (struct gl2_program_impl *) intf; #if USE_3DLABS_FRONTEND - ShHandle *handles; + ShHandle *handles; #endif - GLuint i, count; + GLuint i, count; slang_code_object *code[2]; GLboolean all_compiled = GL_TRUE; - impl->_obj.link_status = GL_FALSE; - _mesa_free ((void *) impl->_obj._container._generic.info_log); - impl->_obj._container._generic.info_log = NULL; - slang_program_rst (&impl->_obj.prog); + impl->_obj.link_status = GL_FALSE; + _mesa_free((void *) impl->_obj._container._generic.info_log); + impl->_obj._container._generic.info_log = NULL; + _slang_program_rst(&impl->_obj.prog); #if USE_3DLABS_FRONTEND - handles = (ShHandle *) _mesa_malloc (impl->_obj._container.attached_count * sizeof (ShHandle)); - if (handles == NULL) - return; - - for (i = 0; i < impl->_obj._container.attached_count; i++) - { - struct gl2_generic_intf **gen = impl->_obj._container.attached[i]; - struct gl2_3dlabs_shhandle_intf **sh; - - sh = (struct gl2_3dlabs_shhandle_intf **) (**gen)._unknown.QueryInterface ( - (struct gl2_unknown_intf **) gen, UIID_3DLABS_SHHANDLE); - if (sh != NULL) - { - handles[i] = (**sh).GetShHandle (sh); - (**sh)._unknown.Release ((struct gl2_unknown_intf **) sh); - } - else - { - _mesa_free (handles); - return; - } - } - - if (ShLink (impl->_obj.linker, handles, impl->_obj._container.attached_count, - impl->_obj.uniforms, NULL, NULL)) - impl->_obj.link_status = GL_TRUE; - - impl->_obj._container._generic.info_log = _mesa_strdup (ShGetInfoLog (impl->_obj.linker)); + handles = + (ShHandle *) _mesa_malloc(impl->_obj._container.attached_count * + sizeof(ShHandle)); + if (handles == NULL) + return; + + for (i = 0; i < impl->_obj._container.attached_count; i++) { + struct gl2_generic_intf **gen = impl->_obj._container.attached[i]; + struct gl2_3dlabs_shhandle_intf **sh; + + sh = + (struct gl2_3dlabs_shhandle_intf **) (**gen)._unknown. + QueryInterface((struct gl2_unknown_intf **) gen, + UIID_3DLABS_SHHANDLE); + if (sh != NULL) { + handles[i] = (**sh).GetShHandle(sh); + (**sh)._unknown.Release((struct gl2_unknown_intf **) sh); + } + else { + _mesa_free(handles); + return; + } + } + + if (ShLink(impl->_obj.linker, handles, impl->_obj._container.attached_count, + impl->_obj.uniforms, NULL, NULL)) + impl->_obj.link_status = GL_TRUE; + + impl->_obj._container._generic.info_log = + _mesa_strdup(ShGetInfoLog(impl->_obj.linker)); #else count = impl->_obj._container.attached_count; if (count > 2) return; - for (i = 0; i < count; i++) - { - struct gl2_generic_intf **obj; - struct gl2_unknown_intf **unk; - struct gl2_shader_impl *sha; - - obj = impl->_obj._container.attached[i]; - unk = (**obj)._unknown.QueryInterface ((struct gl2_unknown_intf **) obj, UIID_SHADER); - if (unk == NULL) - return; - sha = (struct gl2_shader_impl *) unk; + + for (i = 0; i < count; i++) { + struct gl2_generic_intf **obj; + struct gl2_unknown_intf **unk; + struct gl2_shader_impl *sha; + + obj = impl->_obj._container.attached[i]; + unk = + (**obj)._unknown.QueryInterface((struct gl2_unknown_intf **) obj, + UIID_SHADER); + if (unk == NULL) + return; + sha = (struct gl2_shader_impl *) unk; code[i] = &sha->_obj.code; all_compiled = all_compiled && sha->_obj.compile_status; - (**unk).Release (unk); + (**unk).Release(unk); } impl->_obj.link_status = all_compiled; - if (!impl->_obj.link_status) - { - impl->_obj._container._generic.info_log = _mesa_strdup ( - "Error: One or more shaders has not successfully compiled.\n"); + if (!impl->_obj.link_status) { + impl->_obj._container._generic.info_log = + _mesa_strdup + ("Error: One or more shaders has not successfully compiled.\n"); return; } - impl->_obj.link_status = _slang_link (&impl->_obj.prog, code, count); - if (!impl->_obj.link_status) - { - impl->_obj._container._generic.info_log = _mesa_strdup ("Link failed.\n"); + impl->_obj.link_status = _slang_link(&impl->_obj.prog, code, count); + if (!impl->_obj.link_status) { + impl->_obj._container._generic.info_log = + _mesa_strdup("Link failed.\n"); return; } - impl->_obj._container._generic.info_log = _mesa_strdup ("Link OK.\n"); + impl->_obj._container._generic.info_log = _mesa_strdup("Link OK.\n"); #endif } static GLvoid -_program_Validate (struct gl2_program_intf **intf) +_program_Validate(struct gl2_program_intf **intf) { - struct gl2_program_impl *impl = (struct gl2_program_impl *) intf; + struct gl2_program_impl *impl = (struct gl2_program_impl *) intf; - impl->_obj.validate_status = GL_FALSE; - _mesa_free ((void *) impl->_obj._container._generic.info_log); - impl->_obj._container._generic.info_log = NULL; + impl->_obj.validate_status = GL_FALSE; + _mesa_free((void *) impl->_obj._container._generic.info_log); + impl->_obj._container._generic.info_log = NULL; - /* TODO validate */ + /* TODO validate */ } static GLvoid -write_common_fixed (slang_program *pro, GLuint index, const GLvoid *src, GLuint off, GLuint size) +write_common_fixed(slang_program * pro, GLuint index, const GLvoid * src, + GLuint off, GLuint size) { - GLuint i; + GLuint i; - for (i = 0; i < SLANG_SHADER_MAX; i++) - { - GLuint addr; + for (i = 0; i < SLANG_SHADER_MAX; i++) { + GLuint addr; - addr = pro->common_fixed_entries[i][index]; - if (addr != ~0) - { - GLubyte *dst; + addr = pro->common_fixed_entries[i][index]; + if (addr != ~0) { + GLubyte *dst; - dst = (GLubyte *) pro->machines[i]->mem + addr + off * size; - _mesa_memcpy (dst, src, size); - } - } + dst = (GLubyte *) pro->machines[i]->mem + addr + off * size; + _mesa_memcpy(dst, src, size); + } + } } static GLvoid -write_common_fixed_mat4 (slang_program *pro, GLmatrix *matrix, GLuint off, GLuint i, GLuint ii, - GLuint it, GLuint iit) +write_common_fixed_mat4(slang_program * pro, GLmatrix * matrix, GLuint off, + GLuint i, GLuint ii, GLuint it, GLuint iit) { - GLfloat mat[16]; + GLfloat mat[16]; - /* we want inverse matrix */ - if (!matrix->inv) - { - /* allocate inverse matrix and make it dirty */ - _math_matrix_alloc_inv (matrix); - _math_matrix_loadf (matrix, matrix->m); - } - _math_matrix_analyse (matrix); + /* we want inverse matrix */ + if (!matrix->inv) { + /* allocate inverse matrix and make it dirty */ + _math_matrix_alloc_inv(matrix); + _math_matrix_loadf(matrix, matrix->m); + } + _math_matrix_analyse(matrix); - write_common_fixed (pro, i, matrix->m, off, 16 * sizeof (GLfloat)); + write_common_fixed(pro, i, matrix->m, off, 16 * sizeof(GLfloat)); - /* inverse */ - write_common_fixed (pro, ii, matrix->inv, off, 16 * sizeof (GLfloat)); + /* inverse */ + write_common_fixed(pro, ii, matrix->inv, off, 16 * sizeof(GLfloat)); - /* transpose */ - _math_transposef (mat, matrix->m); - write_common_fixed (pro, it, mat, off, 16 * sizeof (GLfloat)); + /* transpose */ + _math_transposef(mat, matrix->m); + write_common_fixed(pro, it, mat, off, 16 * sizeof(GLfloat)); - /* inverse transpose */ - _math_transposef (mat, matrix->inv); - write_common_fixed (pro, iit, mat, off, 16 * sizeof (GLfloat)); + /* inverse transpose */ + _math_transposef(mat, matrix->inv); + write_common_fixed(pro, iit, mat, off, 16 * sizeof(GLfloat)); } static GLvoid -write_common_fixed_material (GLcontext *ctx, slang_program *pro, GLuint i, GLuint e, GLuint a, - GLuint d, GLuint sp, GLuint sh) +write_common_fixed_material(GLcontext * ctx, slang_program * pro, GLuint i, + GLuint e, GLuint a, GLuint d, GLuint sp, + GLuint sh) { - GLfloat v[17]; + GLfloat v[17]; - COPY_4FV(v, ctx->Light.Material.Attrib[e]); - COPY_4FV((v + 4), ctx->Light.Material.Attrib[a]); - COPY_4FV((v + 8), ctx->Light.Material.Attrib[d]); - COPY_4FV((v + 12), ctx->Light.Material.Attrib[sp]); - v[16] = ctx->Light.Material.Attrib[sh][0]; - write_common_fixed (pro, i, v, 0, 17 * sizeof (GLfloat)); + COPY_4FV(v, ctx->Light.Material.Attrib[e]); + COPY_4FV((v + 4), ctx->Light.Material.Attrib[a]); + COPY_4FV((v + 8), ctx->Light.Material.Attrib[d]); + COPY_4FV((v + 12), ctx->Light.Material.Attrib[sp]); + v[16] = ctx->Light.Material.Attrib[sh][0]; + write_common_fixed(pro, i, v, 0, 17 * sizeof(GLfloat)); } static GLvoid -write_common_fixed_light_model_product (GLcontext *ctx, slang_program *pro, GLuint i, GLuint e, - GLuint a) +write_common_fixed_light_model_product(GLcontext * ctx, slang_program * pro, + GLuint i, GLuint e, GLuint a) { - GLfloat v[4]; + GLfloat v[4]; - SCALE_4V(v, ctx->Light.Material.Attrib[a], ctx->Light.Model.Ambient); - ACC_4V(v, ctx->Light.Material.Attrib[e]); - write_common_fixed (pro, i, v, 0, 4 * sizeof (GLfloat)); + SCALE_4V(v, ctx->Light.Material.Attrib[a], ctx->Light.Model.Ambient); + ACC_4V(v, ctx->Light.Material.Attrib[e]); + write_common_fixed(pro, i, v, 0, 4 * sizeof(GLfloat)); } static GLvoid -write_common_fixed_light_product (GLcontext *ctx, slang_program *pro, GLuint off, GLuint i, GLuint a, - GLuint d, GLuint s) +write_common_fixed_light_product(GLcontext * ctx, slang_program * pro, + GLuint off, GLuint i, GLuint a, GLuint d, + GLuint s) { - GLfloat v[12]; - - SCALE_4V(v, ctx->Light.Light[off].Ambient, ctx->Light.Material.Attrib[a]); - SCALE_4V((v + 4), ctx->Light.Light[off].Diffuse, ctx->Light.Material.Attrib[d]); - SCALE_4V((v + 8), ctx->Light.Light[off].Specular, ctx->Light.Material.Attrib[s]); - write_common_fixed (pro, i, v, off, 12 * sizeof (GLfloat)); -} + GLfloat v[12]; -static GLvoid -_program_UpdateFixedUniforms (struct gl2_program_intf **intf) -{ - GET_CURRENT_CONTEXT(ctx); - struct gl2_program_impl *impl = (struct gl2_program_impl *) intf; - slang_program *pro = &impl->_obj.prog; - GLuint i; - GLfloat v[29]; - GLfloat *p; - - /* MODELVIEW matrix */ - write_common_fixed_mat4 (pro, ctx->ModelviewMatrixStack.Top, 0, - SLANG_COMMON_FIXED_MODELVIEWMATRIX, - SLANG_COMMON_FIXED_MODELVIEWMATRIXINVERSE, - SLANG_COMMON_FIXED_MODELVIEWMATRIXTRANSPOSE, - SLANG_COMMON_FIXED_MODELVIEWMATRIXINVERSETRANSPOSE); - - /* PROJECTION matrix */ - write_common_fixed_mat4 (pro, ctx->ProjectionMatrixStack.Top, 0, - SLANG_COMMON_FIXED_PROJECTIONMATRIX, - SLANG_COMMON_FIXED_PROJECTIONMATRIXINVERSE, - SLANG_COMMON_FIXED_PROJECTIONMATRIXTRANSPOSE, - SLANG_COMMON_FIXED_PROJECTIONMATRIXINVERSETRANSPOSE); - - /* MVP matrix */ - write_common_fixed_mat4 (pro, &ctx->_ModelProjectMatrix, 0, - SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIX, - SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIXINVERSE, - SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIXTRANSPOSE, - SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIXINVERSETRANSPOSE); - - for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) - { - /* TEXTURE matrix */ - write_common_fixed_mat4 (pro, ctx->TextureMatrixStack[i].Top, i, - SLANG_COMMON_FIXED_TEXTUREMATRIX, - SLANG_COMMON_FIXED_TEXTUREMATRIXINVERSE, - SLANG_COMMON_FIXED_TEXTUREMATRIXTRANSPOSE, - SLANG_COMMON_FIXED_TEXTUREMATRIXINVERSETRANSPOSE); - - /* EYE_PLANE texture-coordinate generation */ - write_common_fixed (pro, SLANG_COMMON_FIXED_EYEPLANES, ctx->Texture.Unit[i].EyePlaneS, - i, 4 * sizeof (GLfloat)); - write_common_fixed (pro, SLANG_COMMON_FIXED_EYEPLANET, ctx->Texture.Unit[i].EyePlaneT, - i, 4 * sizeof (GLfloat)); - write_common_fixed (pro, SLANG_COMMON_FIXED_EYEPLANER, ctx->Texture.Unit[i].EyePlaneR, - i, 4 * sizeof (GLfloat)); - write_common_fixed (pro, SLANG_COMMON_FIXED_EYEPLANEQ, ctx->Texture.Unit[i].EyePlaneQ, - i, 4 * sizeof (GLfloat)); - - /* OBJECT_PLANE texture-coordinate generation */ - write_common_fixed (pro, SLANG_COMMON_FIXED_OBJECTPLANES, ctx->Texture.Unit[i].ObjectPlaneS, - i, 4 * sizeof (GLfloat)); - write_common_fixed (pro, SLANG_COMMON_FIXED_OBJECTPLANET, ctx->Texture.Unit[i].ObjectPlaneT, - i, 4 * sizeof (GLfloat)); - write_common_fixed (pro, SLANG_COMMON_FIXED_OBJECTPLANER, ctx->Texture.Unit[i].ObjectPlaneR, - i, 4 * sizeof (GLfloat)); - write_common_fixed (pro, SLANG_COMMON_FIXED_OBJECTPLANEQ, ctx->Texture.Unit[i].ObjectPlaneQ, - i, 4 * sizeof (GLfloat)); - } - - /* NORMAL matrix - upper 3x3 inverse transpose of MODELVIEW matrix */ - p = ctx->ModelviewMatrixStack.Top->inv; - v[0] = p[0]; - v[1] = p[4]; - v[2] = p[8]; - v[3] = p[1]; - v[4] = p[5]; - v[5] = p[9]; - v[6] = p[2]; - v[7] = p[6]; - v[8] = p[10]; - write_common_fixed (pro, SLANG_COMMON_FIXED_NORMALMATRIX, v, 0, 9 * sizeof (GLfloat)); - - /* normal scale */ - write_common_fixed (pro, SLANG_COMMON_FIXED_NORMALSCALE, &ctx->_ModelViewInvScale, 0, sizeof (GLfloat)); - - /* depth range parameters */ - v[0] = ctx->Viewport.Near; - v[1] = ctx->Viewport.Far; - v[2] = ctx->Viewport.Far - ctx->Viewport.Near; - write_common_fixed (pro, SLANG_COMMON_FIXED_DEPTHRANGE, v, 0, 3 * sizeof (GLfloat)); - - /* CLIP_PLANEi */ - for (i = 0; i < ctx->Const.MaxClipPlanes; i++) - { - write_common_fixed (pro, SLANG_COMMON_FIXED_CLIPPLANE, ctx->Transform.EyeUserPlane[i], i, - 4 * sizeof (GLfloat)); - } - - /* point parameters */ - v[0] = ctx->Point.Size; - v[1] = ctx->Point.MinSize; - v[2] = ctx->Point.MaxSize; - v[3] = ctx->Point.Threshold; - COPY_3FV((v + 4), ctx->Point.Params); - write_common_fixed (pro, SLANG_COMMON_FIXED_POINT, v, 0, 7 * sizeof (GLfloat)); - - /* material parameters */ - write_common_fixed_material (ctx, pro, SLANG_COMMON_FIXED_FRONTMATERIAL, - MAT_ATTRIB_FRONT_EMISSION, - MAT_ATTRIB_FRONT_AMBIENT, - MAT_ATTRIB_FRONT_DIFFUSE, - MAT_ATTRIB_FRONT_SPECULAR, - MAT_ATTRIB_FRONT_SHININESS); - write_common_fixed_material (ctx, pro, SLANG_COMMON_FIXED_BACKMATERIAL, - MAT_ATTRIB_BACK_EMISSION, - MAT_ATTRIB_BACK_AMBIENT, - MAT_ATTRIB_BACK_DIFFUSE, - MAT_ATTRIB_BACK_SPECULAR, - MAT_ATTRIB_BACK_SHININESS); - - for (i = 0; i < ctx->Const.MaxLights; i++) - { - /* light source parameters */ - COPY_4FV(v, ctx->Light.Light[i].Ambient); - COPY_4FV((v + 4), ctx->Light.Light[i].Diffuse); - COPY_4FV((v + 8), ctx->Light.Light[i].Specular); - COPY_4FV((v + 12), ctx->Light.Light[i].EyePosition); - COPY_2FV((v + 16), ctx->Light.Light[i].EyePosition); - v[18] = ctx->Light.Light[i].EyePosition[2] + 1.0f; - NORMALIZE_3FV((v + 16)); - v[19] = 0.0f; - COPY_3V((v + 20), ctx->Light.Light[i].EyeDirection); - v[23] = ctx->Light.Light[i].SpotExponent; - v[24] = ctx->Light.Light[i].SpotCutoff; - v[25] = ctx->Light.Light[i]._CosCutoffNeg; - v[26] = ctx->Light.Light[i].ConstantAttenuation; - v[27] = ctx->Light.Light[i].LinearAttenuation; - v[28] = ctx->Light.Light[i].QuadraticAttenuation; - write_common_fixed (pro, SLANG_COMMON_FIXED_LIGHTSOURCE, v, i, 29 * sizeof (GLfloat)); - - /* light product */ - write_common_fixed_light_product (ctx, pro, i, SLANG_COMMON_FIXED_FRONTLIGHTPRODUCT, - MAT_ATTRIB_FRONT_AMBIENT, - MAT_ATTRIB_FRONT_DIFFUSE, - MAT_ATTRIB_FRONT_SPECULAR); - write_common_fixed_light_product (ctx, pro, i, SLANG_COMMON_FIXED_BACKLIGHTPRODUCT, - MAT_ATTRIB_BACK_AMBIENT, - MAT_ATTRIB_BACK_DIFFUSE, - MAT_ATTRIB_BACK_SPECULAR); - } - - /* light model parameters */ - write_common_fixed (pro, SLANG_COMMON_FIXED_LIGHTMODEL, ctx->Light.Model.Ambient, 0, 4 * sizeof (GLfloat)); - - /* light model product */ - write_common_fixed_light_model_product (ctx, pro, SLANG_COMMON_FIXED_FRONTLIGHTMODELPRODUCT, - MAT_ATTRIB_FRONT_EMISSION, - MAT_ATTRIB_FRONT_AMBIENT); - write_common_fixed_light_model_product (ctx, pro, SLANG_COMMON_FIXED_BACKLIGHTMODELPRODUCT, - MAT_ATTRIB_BACK_EMISSION, - MAT_ATTRIB_BACK_AMBIENT); - - /* TEXTURE_ENV_COLOR */ - for (i = 0; i < ctx->Const.MaxTextureImageUnits; i++) - { - write_common_fixed (pro, SLANG_COMMON_FIXED_TEXTUREENVCOLOR, ctx->Texture.Unit[i].EnvColor, - i, 4 * sizeof (GLfloat)); - } - - /* fog parameters */ - COPY_4FV(v, ctx->Fog.Color); - v[4] = ctx->Fog.Density; - v[5] = ctx->Fog.Start; - v[6] = ctx->Fog.End; - v[7] = ctx->Fog._Scale; - write_common_fixed (pro, SLANG_COMMON_FIXED_FOG, v, 0, 8 * sizeof (GLfloat)); + SCALE_4V(v, ctx->Light.Light[off].Ambient, ctx->Light.Material.Attrib[a]); + SCALE_4V((v + 4), ctx->Light.Light[off].Diffuse, + ctx->Light.Material.Attrib[d]); + SCALE_4V((v + 8), ctx->Light.Light[off].Specular, + ctx->Light.Material.Attrib[s]); + write_common_fixed(pro, i, v, off, 12 * sizeof(GLfloat)); } static GLvoid -_program_UpdateFixedAttrib (struct gl2_program_intf **intf, GLuint index, GLvoid *data, - GLuint offset, GLuint size, GLboolean write) +_program_UpdateFixedUniforms(struct gl2_program_intf **intf) { - struct gl2_program_impl *impl = (struct gl2_program_impl *) intf; - slang_program *pro = &impl->_obj.prog; - GLuint addr; + GET_CURRENT_CONTEXT(ctx); + struct gl2_program_impl *impl = (struct gl2_program_impl *) intf; + slang_program *pro = &impl->_obj.prog; + GLuint i; + GLfloat v[29]; + GLfloat *p; + + /* MODELVIEW matrix */ + write_common_fixed_mat4(pro, ctx->ModelviewMatrixStack.Top, 0, + SLANG_COMMON_FIXED_MODELVIEWMATRIX, + SLANG_COMMON_FIXED_MODELVIEWMATRIXINVERSE, + SLANG_COMMON_FIXED_MODELVIEWMATRIXTRANSPOSE, + SLANG_COMMON_FIXED_MODELVIEWMATRIXINVERSETRANSPOSE); + + /* PROJECTION matrix */ + write_common_fixed_mat4(pro, ctx->ProjectionMatrixStack.Top, 0, + SLANG_COMMON_FIXED_PROJECTIONMATRIX, + SLANG_COMMON_FIXED_PROJECTIONMATRIXINVERSE, + SLANG_COMMON_FIXED_PROJECTIONMATRIXTRANSPOSE, + SLANG_COMMON_FIXED_PROJECTIONMATRIXINVERSETRANSPOSE); + + /* MVP matrix */ + write_common_fixed_mat4(pro, &ctx->_ModelProjectMatrix, 0, + SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIX, + SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIXINVERSE, + SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIXTRANSPOSE, + SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIXINVERSETRANSPOSE); + + for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) { + /* TEXTURE matrix */ + write_common_fixed_mat4(pro, ctx->TextureMatrixStack[i].Top, i, + SLANG_COMMON_FIXED_TEXTUREMATRIX, + SLANG_COMMON_FIXED_TEXTUREMATRIXINVERSE, + SLANG_COMMON_FIXED_TEXTUREMATRIXTRANSPOSE, + SLANG_COMMON_FIXED_TEXTUREMATRIXINVERSETRANSPOSE); + + /* EYE_PLANE texture-coordinate generation */ + write_common_fixed(pro, SLANG_COMMON_FIXED_EYEPLANES, + ctx->Texture.Unit[i].EyePlaneS, i, + 4 * sizeof(GLfloat)); + write_common_fixed(pro, SLANG_COMMON_FIXED_EYEPLANET, + ctx->Texture.Unit[i].EyePlaneT, i, + 4 * sizeof(GLfloat)); + write_common_fixed(pro, SLANG_COMMON_FIXED_EYEPLANER, + ctx->Texture.Unit[i].EyePlaneR, i, + 4 * sizeof(GLfloat)); + write_common_fixed(pro, SLANG_COMMON_FIXED_EYEPLANEQ, + ctx->Texture.Unit[i].EyePlaneQ, i, + 4 * sizeof(GLfloat)); + + /* OBJECT_PLANE texture-coordinate generation */ + write_common_fixed(pro, SLANG_COMMON_FIXED_OBJECTPLANES, + ctx->Texture.Unit[i].ObjectPlaneS, i, + 4 * sizeof(GLfloat)); + write_common_fixed(pro, SLANG_COMMON_FIXED_OBJECTPLANET, + ctx->Texture.Unit[i].ObjectPlaneT, i, + 4 * sizeof(GLfloat)); + write_common_fixed(pro, SLANG_COMMON_FIXED_OBJECTPLANER, + ctx->Texture.Unit[i].ObjectPlaneR, i, + 4 * sizeof(GLfloat)); + write_common_fixed(pro, SLANG_COMMON_FIXED_OBJECTPLANEQ, + ctx->Texture.Unit[i].ObjectPlaneQ, i, + 4 * sizeof(GLfloat)); + } + + /* NORMAL matrix - upper 3x3 inverse transpose of MODELVIEW matrix */ + p = ctx->ModelviewMatrixStack.Top->inv; + v[0] = p[0]; + v[1] = p[4]; + v[2] = p[8]; + v[3] = p[1]; + v[4] = p[5]; + v[5] = p[9]; + v[6] = p[2]; + v[7] = p[6]; + v[8] = p[10]; + write_common_fixed(pro, SLANG_COMMON_FIXED_NORMALMATRIX, v, 0, + 9 * sizeof(GLfloat)); + + /* normal scale */ + write_common_fixed(pro, SLANG_COMMON_FIXED_NORMALSCALE, + &ctx->_ModelViewInvScale, 0, sizeof(GLfloat)); + + /* depth range parameters */ + v[0] = ctx->Viewport.Near; + v[1] = ctx->Viewport.Far; + v[2] = ctx->Viewport.Far - ctx->Viewport.Near; + write_common_fixed(pro, SLANG_COMMON_FIXED_DEPTHRANGE, v, 0, + 3 * sizeof(GLfloat)); + + /* CLIP_PLANEi */ + for (i = 0; i < ctx->Const.MaxClipPlanes; i++) { + write_common_fixed(pro, SLANG_COMMON_FIXED_CLIPPLANE, + ctx->Transform.EyeUserPlane[i], i, + 4 * sizeof(GLfloat)); + } - addr = pro->vertex_fixed_entries[index]; - if (addr != ~0) - { - GLubyte *mem; + /* point parameters */ + v[0] = ctx->Point.Size; + v[1] = ctx->Point.MinSize; + v[2] = ctx->Point.MaxSize; + v[3] = ctx->Point.Threshold; + COPY_3FV((v + 4), ctx->Point.Params); + write_common_fixed(pro, SLANG_COMMON_FIXED_POINT, v, 0, + 7 * sizeof(GLfloat)); + + /* material parameters */ + write_common_fixed_material(ctx, pro, SLANG_COMMON_FIXED_FRONTMATERIAL, + MAT_ATTRIB_FRONT_EMISSION, + MAT_ATTRIB_FRONT_AMBIENT, + MAT_ATTRIB_FRONT_DIFFUSE, + MAT_ATTRIB_FRONT_SPECULAR, + MAT_ATTRIB_FRONT_SHININESS); + write_common_fixed_material(ctx, pro, SLANG_COMMON_FIXED_BACKMATERIAL, + MAT_ATTRIB_BACK_EMISSION, + MAT_ATTRIB_BACK_AMBIENT, + MAT_ATTRIB_BACK_DIFFUSE, + MAT_ATTRIB_BACK_SPECULAR, + MAT_ATTRIB_BACK_SHININESS); + + for (i = 0; i < ctx->Const.MaxLights; i++) { + /* light source parameters */ + COPY_4FV(v, ctx->Light.Light[i].Ambient); + COPY_4FV((v + 4), ctx->Light.Light[i].Diffuse); + COPY_4FV((v + 8), ctx->Light.Light[i].Specular); + COPY_4FV((v + 12), ctx->Light.Light[i].EyePosition); + COPY_2FV((v + 16), ctx->Light.Light[i].EyePosition); + v[18] = ctx->Light.Light[i].EyePosition[2] + 1.0f; + NORMALIZE_3FV((v + 16)); + v[19] = 0.0f; + COPY_3V((v + 20), ctx->Light.Light[i].EyeDirection); + v[23] = ctx->Light.Light[i].SpotExponent; + v[24] = ctx->Light.Light[i].SpotCutoff; + v[25] = ctx->Light.Light[i]._CosCutoffNeg; + v[26] = ctx->Light.Light[i].ConstantAttenuation; + v[27] = ctx->Light.Light[i].LinearAttenuation; + v[28] = ctx->Light.Light[i].QuadraticAttenuation; + write_common_fixed(pro, SLANG_COMMON_FIXED_LIGHTSOURCE, v, i, + 29 * sizeof(GLfloat)); + + /* light product */ + write_common_fixed_light_product(ctx, pro, i, + SLANG_COMMON_FIXED_FRONTLIGHTPRODUCT, + MAT_ATTRIB_FRONT_AMBIENT, + MAT_ATTRIB_FRONT_DIFFUSE, + MAT_ATTRIB_FRONT_SPECULAR); + write_common_fixed_light_product(ctx, pro, i, + SLANG_COMMON_FIXED_BACKLIGHTPRODUCT, + MAT_ATTRIB_BACK_AMBIENT, + MAT_ATTRIB_BACK_DIFFUSE, + MAT_ATTRIB_BACK_SPECULAR); + } - mem = (GLubyte *) pro->machines[SLANG_SHADER_VERTEX]->mem + addr + offset * size; - if (write) - _mesa_memcpy (mem, data, size); - else - _mesa_memcpy (data, mem, size); - } + /* light model parameters */ + write_common_fixed(pro, SLANG_COMMON_FIXED_LIGHTMODEL, + ctx->Light.Model.Ambient, 0, 4 * sizeof(GLfloat)); + + /* light model product */ + write_common_fixed_light_model_product(ctx, pro, + SLANG_COMMON_FIXED_FRONTLIGHTMODELPRODUCT, + MAT_ATTRIB_FRONT_EMISSION, + MAT_ATTRIB_FRONT_AMBIENT); + write_common_fixed_light_model_product(ctx, pro, + SLANG_COMMON_FIXED_BACKLIGHTMODELPRODUCT, + MAT_ATTRIB_BACK_EMISSION, + MAT_ATTRIB_BACK_AMBIENT); + + /* TEXTURE_ENV_COLOR */ + for (i = 0; i < ctx->Const.MaxTextureImageUnits; i++) { + write_common_fixed(pro, SLANG_COMMON_FIXED_TEXTUREENVCOLOR, + ctx->Texture.Unit[i].EnvColor, i, + 4 * sizeof(GLfloat)); + } + + /* fog parameters */ + COPY_4FV(v, ctx->Fog.Color); + v[4] = ctx->Fog.Density; + v[5] = ctx->Fog.Start; + v[6] = ctx->Fog.End; + v[7] = ctx->Fog._Scale; + write_common_fixed(pro, SLANG_COMMON_FIXED_FOG, v, 0, 8 * sizeof(GLfloat)); } static GLvoid -_program_UpdateFixedVarying (struct gl2_program_intf **intf, GLuint index, GLvoid *data, - GLuint offset, GLuint size, GLboolean write) +_program_UpdateFixedAttrib(struct gl2_program_intf **intf, GLuint index, + GLvoid * data, GLuint offset, GLuint size, + GLboolean write) { - struct gl2_program_impl *impl = (struct gl2_program_impl *) intf; - slang_program *pro = &impl->_obj.prog; - GLuint addr; + struct gl2_program_impl *impl = (struct gl2_program_impl *) intf; + slang_program *pro = &impl->_obj.prog; + GLuint addr; + + addr = pro->vertex_fixed_entries[index]; + if (addr != ~0) { + GLubyte *mem; + + mem = + (GLubyte *) pro->machines[SLANG_SHADER_VERTEX]->mem + addr + + offset * size; + if (write) + _mesa_memcpy(mem, data, size); + else + _mesa_memcpy(data, mem, size); + } +} - addr = pro->fragment_fixed_entries[index]; - if (addr != ~0) - { - GLubyte *mem; - mem = (GLubyte *) pro->machines[SLANG_SHADER_FRAGMENT]->mem + addr + offset * size; - if (write) - _mesa_memcpy (mem, data, size); - else - _mesa_memcpy (data, mem, size); - } +/** + * Called during fragment shader execution to either load a varying + * register with values, or fetch values from a varying register. + * \param intf the internal program? + * \param index which varying register, one of the SLANG_FRAGMENT_FIXED_* + * values for example. + * \param data source values to load (or dest to write to) + * \param offset indicates a texture unit or generic varying attribute + * \param size number of bytes to copy + * \param write if true, write to the varying register, else store values + * in 'data' + */ +static GLvoid +_program_UpdateFixedVarying(struct gl2_program_intf **intf, GLuint index, + GLvoid * data, + GLuint offset, GLuint size, GLboolean write) +{ + struct gl2_program_impl *impl = (struct gl2_program_impl *) intf; + slang_program *pro = &impl->_obj.prog; + GLuint addr; + + addr = pro->fragment_fixed_entries[index]; + if (addr != ~0) { + GLubyte *mem; + + mem = + (GLubyte *) pro->machines[SLANG_SHADER_FRAGMENT]->mem + addr + + offset * size; + if (write) + _mesa_memcpy(mem, data, size); + else + _mesa_memcpy(data, mem, size); + } } static GLvoid -_program_GetTextureImageUsage (struct gl2_program_intf **intf, GLbitfield *teximageusage) -{ - GET_CURRENT_CONTEXT(ctx); - struct gl2_program_impl *impl = (struct gl2_program_impl *) intf; - slang_program *pro = &impl->_obj.prog; - GLuint i; - - for (i = 0; i < ctx->Const.MaxTextureImageUnits; i++) - teximageusage[i] = 0; - - for (i = 0; i < pro->texture_usage.count; i++) - { - GLuint n, addr, j; - - n = slang_export_data_quant_elements (pro->texture_usage.table[i].quant); - addr = pro->texture_usage.table[i].frag_address; - for (j = 0; j < n; j++) - { - GLubyte *mem; - GLuint image; - - mem = (GLubyte *) pro->machines[SLANG_SHADER_FRAGMENT]->mem + addr + j * 4; - image = (GLuint) *((GLfloat *) mem); - if (image >= 0 && image < ctx->Const.MaxTextureImageUnits) - { - switch (slang_export_data_quant_type (pro->texture_usage.table[i].quant)) - { - case GL_SAMPLER_1D_ARB: - case GL_SAMPLER_1D_SHADOW_ARB: - teximageusage[image] |= TEXTURE_1D_BIT; - break; - case GL_SAMPLER_2D_ARB: - case GL_SAMPLER_2D_SHADOW_ARB: - teximageusage[image] |= TEXTURE_2D_BIT; - break; - case GL_SAMPLER_3D_ARB: - teximageusage[image] |= TEXTURE_3D_BIT; - break; - case GL_SAMPLER_CUBE_ARB: - teximageusage[image] |= TEXTURE_CUBE_BIT; - break; - } - } - } - } - - /* TODO: make sure that for 0<=i<=MaxTextureImageUint bitcount(teximageuint[i])<=0 */ +_program_GetTextureImageUsage(struct gl2_program_intf **intf, + GLbitfield * teximageusage) +{ + GET_CURRENT_CONTEXT(ctx); + struct gl2_program_impl *impl = (struct gl2_program_impl *) intf; + slang_program *pro = &impl->_obj.prog; + GLuint i; + + for (i = 0; i < ctx->Const.MaxTextureImageUnits; i++) + teximageusage[i] = 0; + + for (i = 0; i < pro->texture_usage.count; i++) { + GLuint n, addr, j; + + n = slang_export_data_quant_elements(pro->texture_usage.table[i].quant); + addr = pro->texture_usage.table[i].frag_address; + for (j = 0; j < n; j++) { + GLubyte *mem; + GLuint image; + + mem = + (GLubyte *) pro->machines[SLANG_SHADER_FRAGMENT]->mem + addr + + j * 4; + image = (GLuint) * ((GLfloat *) mem); + if (image >= 0 && image < ctx->Const.MaxTextureImageUnits) { + switch (slang_export_data_quant_type + (pro->texture_usage.table[i].quant)) { + case GL_SAMPLER_1D_ARB: + case GL_SAMPLER_1D_SHADOW_ARB: + teximageusage[image] |= TEXTURE_1D_BIT; + break; + case GL_SAMPLER_2D_ARB: + case GL_SAMPLER_2D_SHADOW_ARB: + teximageusage[image] |= TEXTURE_2D_BIT; + break; + case GL_SAMPLER_3D_ARB: + teximageusage[image] |= TEXTURE_3D_BIT; + break; + case GL_SAMPLER_CUBE_ARB: + teximageusage[image] |= TEXTURE_CUBE_BIT; + break; + } + } + } + } + + /* TODO: make sure that for 0<=i<=MaxTextureImageUint bitcount(teximageuint[i])<=0 */ } static GLboolean -_program_IsShaderPresent (struct gl2_program_intf **intf, GLenum subtype) +_program_IsShaderPresent(struct gl2_program_intf **intf, GLenum subtype) { - struct gl2_program_impl *impl = (struct gl2_program_impl *) intf; - slang_program *pro = &impl->_obj.prog; + struct gl2_program_impl *impl = (struct gl2_program_impl *) intf; + slang_program *pro = &impl->_obj.prog; - switch (subtype) - { - case GL_VERTEX_SHADER_ARB: - return pro->machines[SLANG_SHADER_VERTEX] != NULL; - case GL_FRAGMENT_SHADER_ARB: - return pro->machines[SLANG_SHADER_FRAGMENT] != NULL; - default: - return GL_FALSE; - } + switch (subtype) { + case GL_VERTEX_SHADER_ARB: + return pro->machines[SLANG_SHADER_VERTEX] != NULL; + case GL_FRAGMENT_SHADER_ARB: + return pro->machines[SLANG_SHADER_FRAGMENT] != NULL; + default: + return GL_FALSE; + } } static GLvoid -get_active_variable (slang_active_variable *var, GLsizei maxLength, GLsizei *length, GLint *size, - GLenum *type, GLchar *name) +get_active_variable(slang_active_variable * var, GLsizei maxLength, + GLsizei * length, GLint * size, GLenum * type, + GLchar * name) { - GLsizei len; + GLsizei len; - len = _mesa_strlen (var->name); - if (len >= maxLength) - len = maxLength - 1; - if (length != NULL) - *length = len; - *size = slang_export_data_quant_elements (var->quant); - *type = slang_export_data_quant_type (var->quant); - _mesa_memcpy (name, var->name, len); - name[len] = '\0'; + len = _mesa_strlen(var->name); + if (len >= maxLength) + len = maxLength - 1; + if (length != NULL) + *length = len; + *size = slang_export_data_quant_elements(var->quant); + *type = slang_export_data_quant_type(var->quant); + _mesa_memcpy(name, var->name, len); + name[len] = '\0'; } static GLuint -get_active_variable_max_length (slang_active_variables *vars) +get_active_variable_max_length(slang_active_variables * vars) { - GLuint i, len = 0; + GLuint i, len = 0; - for (i = 0; i < vars->count; i++) - { - GLuint n = _mesa_strlen (vars->table[i].name); - if (n > len) - len = n; - } - return len; + for (i = 0; i < vars->count; i++) { + GLuint n = _mesa_strlen(vars->table[i].name); + if (n > len) + len = n; + } + return len; } static GLvoid -_program_GetActiveUniform (struct gl2_program_intf **intf, GLuint index, GLsizei maxLength, - GLsizei *length, GLint *size, GLenum *type, GLchar *name) +_program_GetActiveUniform(struct gl2_program_intf **intf, GLuint index, + GLsizei maxLength, GLsizei * length, GLint * size, + GLenum * type, GLchar * name) { - struct gl2_program_impl *impl = (struct gl2_program_impl *) (intf); - slang_active_variable *u = &impl->_obj.prog.active_uniforms.table[index]; + struct gl2_program_impl *impl = (struct gl2_program_impl *) (intf); + slang_active_variable *u = &impl->_obj.prog.active_uniforms.table[index]; - get_active_variable (u, maxLength, length, size, type, name); + get_active_variable(u, maxLength, length, size, type, name); } static GLuint -_program_GetActiveUniformMaxLength (struct gl2_program_intf **intf) +_program_GetActiveUniformMaxLength(struct gl2_program_intf **intf) { - struct gl2_program_impl *impl = (struct gl2_program_impl *) (intf); + struct gl2_program_impl *impl = (struct gl2_program_impl *) (intf); - return get_active_variable_max_length (&impl->_obj.prog.active_uniforms); + return get_active_variable_max_length(&impl->_obj.prog.active_uniforms); } static GLuint -_program_GetActiveUniformCount (struct gl2_program_intf **intf) +_program_GetActiveUniformCount(struct gl2_program_intf **intf) { - struct gl2_program_impl *impl = (struct gl2_program_impl *) (intf); + struct gl2_program_impl *impl = (struct gl2_program_impl *) (intf); - return impl->_obj.prog.active_uniforms.count; + return impl->_obj.prog.active_uniforms.count; } static GLint -_program_GetUniformLocation (struct gl2_program_intf **intf, const GLchar *name) +_program_GetUniformLocation(struct gl2_program_intf **intf, + const GLchar * name) { - struct gl2_program_impl *impl = (struct gl2_program_impl *) (intf); - slang_uniform_bindings *bind = &impl->_obj.prog.uniforms; - GLuint i; + struct gl2_program_impl *impl = (struct gl2_program_impl *) (intf); + slang_uniform_bindings *bind = &impl->_obj.prog.uniforms; + GLuint i; - for (i = 0; i < bind->count; i++) - if (_mesa_strcmp (bind->table[i].name, name) == 0) - return i; - return -1; + for (i = 0; i < bind->count; i++) + if (_mesa_strcmp(bind->table[i].name, name) == 0) + return i; + return -1; } +/** + * Write a uniform variable into program's memory. + * \return GL_TRUE for success, GL_FALSE if error + */ static GLboolean -_program_WriteUniform (struct gl2_program_intf **intf, GLint loc, GLsizei count, const GLvoid *data, - GLenum type) -{ - struct gl2_program_impl *impl = (struct gl2_program_impl *) (intf); - slang_uniform_bindings *uniforms = &impl->_obj.prog.uniforms; - slang_uniform_binding *uniform; - GLuint i; - GLboolean convert_float_to_bool = GL_FALSE; - GLboolean convert_int_to_bool = GL_FALSE; - GLboolean convert_int_to_float = GL_FALSE; - GLboolean types_match = GL_FALSE; - - if (loc == -1) - return GL_TRUE; - if (loc >= uniforms->count) - return GL_FALSE; - - uniform = &uniforms->table[loc]; - /* TODO: check sizes */ - if (slang_export_data_quant_struct (uniform->quant)) - return GL_FALSE; - - switch (slang_export_data_quant_type (uniform->quant)) - { - case GL_BOOL_ARB: - types_match = (type == GL_FLOAT) || (type == GL_INT); - if (type == GL_FLOAT) - convert_float_to_bool = GL_TRUE; - else - convert_int_to_bool = GL_TRUE; - break; - case GL_BOOL_VEC2_ARB: - types_match = (type == GL_FLOAT_VEC2_ARB) || (type == GL_INT_VEC2_ARB); - if (type == GL_FLOAT_VEC2_ARB) - convert_float_to_bool = GL_TRUE; - else - convert_int_to_bool = GL_TRUE; - break; - case GL_BOOL_VEC3_ARB: - types_match = (type == GL_FLOAT_VEC3_ARB) || (type == GL_INT_VEC3_ARB); - if (type == GL_FLOAT_VEC3_ARB) - convert_float_to_bool = GL_TRUE; - else - convert_int_to_bool = GL_TRUE; - break; - case GL_BOOL_VEC4_ARB: - types_match = (type == GL_FLOAT_VEC4_ARB) || (type == GL_INT_VEC4_ARB); - if (type == GL_FLOAT_VEC4_ARB) - convert_float_to_bool = GL_TRUE; - else - convert_int_to_bool = GL_TRUE; - break; - case GL_SAMPLER_1D_ARB: - case GL_SAMPLER_2D_ARB: - case GL_SAMPLER_3D_ARB: - case GL_SAMPLER_CUBE_ARB: - case GL_SAMPLER_1D_SHADOW_ARB: - case GL_SAMPLER_2D_SHADOW_ARB: - types_match = (type == GL_INT); - break; - default: - types_match = (type == slang_export_data_quant_type (uniform->quant)); - break; - } - - if (!types_match) - return GL_FALSE; - - switch (type) - { - case GL_INT: - case GL_INT_VEC2_ARB: - case GL_INT_VEC3_ARB: - case GL_INT_VEC4_ARB: - convert_int_to_float = GL_TRUE; - break; - } - - if (convert_float_to_bool) - { - for (i = 0; i < SLANG_SHADER_MAX; i++) - if (uniform->address[i] != ~0) - { - const GLfloat *src = (GLfloat *) (data); - GLfloat *dst = (GLfloat *) - (&impl->_obj.prog.machines[i]->mem[uniform->address[i] / 4]); - GLuint j; - GLuint total = count * slang_export_data_quant_components (uniform->quant); - - for (j = 0; j < total; j++) - dst[j] = src[j] != 0.0f ? 1.0f : 0.0f; - } - } - else if (convert_int_to_bool) - { - for (i = 0; i < SLANG_SHADER_MAX; i++) - if (uniform->address[i] != ~0) - { - const GLuint *src = (GLuint *) (data); - GLfloat *dst = (GLfloat *) - (&impl->_obj.prog.machines[i]->mem[uniform->address[i] / 4]); - GLuint j; - GLuint total = count * slang_export_data_quant_components (uniform->quant); - - for (j = 0; j < total; j++) - dst[j] = src[j] ? 1.0f : 0.0f; - } - } - else if (convert_int_to_float) - { - for (i = 0; i < SLANG_SHADER_MAX; i++) - if (uniform->address[i] != ~0) - { - const GLuint *src = (GLuint *) (data); - GLfloat *dst = (GLfloat *) - (&impl->_obj.prog.machines[i]->mem[uniform->address[i] / 4]); - GLuint j; - GLuint total = count * slang_export_data_quant_components (uniform->quant); - - for (j = 0; j < total; j++) - dst[j] = (GLfloat) src[j]; - } - } - else - { - for (i = 0; i < SLANG_SHADER_MAX; i++) - if (uniform->address[i] != ~0) - { - _mesa_memcpy (&impl->_obj.prog.machines[i]->mem[uniform->address[i] / 4], data, - count * slang_export_data_quant_size (uniform->quant)); - } - } - return GL_TRUE; +_program_WriteUniform(struct gl2_program_intf **intf, GLint loc, + GLsizei count, const GLvoid * data, GLenum type) +{ + struct gl2_program_impl *impl = (struct gl2_program_impl *) (intf); + slang_uniform_bindings *uniforms = &impl->_obj.prog.uniforms; + slang_uniform_binding *uniform; + GLuint i; + GLboolean convert_float_to_bool = GL_FALSE; + GLboolean convert_int_to_bool = GL_FALSE; + GLboolean convert_int_to_float = GL_FALSE; + GLboolean types_match = GL_FALSE; + + if (loc < 0 || loc >= uniforms->count) + return GL_FALSE; + + uniform = &uniforms->table[loc]; + /* TODO: check sizes */ + if (slang_export_data_quant_struct(uniform->quant)) + return GL_FALSE; + + switch (slang_export_data_quant_type(uniform->quant)) { + case GL_BOOL_ARB: + types_match = (type == GL_FLOAT) || (type == GL_INT); + if (type == GL_FLOAT) + convert_float_to_bool = GL_TRUE; + else + convert_int_to_bool = GL_TRUE; + break; + case GL_BOOL_VEC2_ARB: + types_match = (type == GL_FLOAT_VEC2_ARB) || (type == GL_INT_VEC2_ARB); + if (type == GL_FLOAT_VEC2_ARB) + convert_float_to_bool = GL_TRUE; + else + convert_int_to_bool = GL_TRUE; + break; + case GL_BOOL_VEC3_ARB: + types_match = (type == GL_FLOAT_VEC3_ARB) || (type == GL_INT_VEC3_ARB); + if (type == GL_FLOAT_VEC3_ARB) + convert_float_to_bool = GL_TRUE; + else + convert_int_to_bool = GL_TRUE; + break; + case GL_BOOL_VEC4_ARB: + types_match = (type == GL_FLOAT_VEC4_ARB) || (type == GL_INT_VEC4_ARB); + if (type == GL_FLOAT_VEC4_ARB) + convert_float_to_bool = GL_TRUE; + else + convert_int_to_bool = GL_TRUE; + break; + case GL_SAMPLER_1D_ARB: + case GL_SAMPLER_2D_ARB: + case GL_SAMPLER_3D_ARB: + case GL_SAMPLER_CUBE_ARB: + case GL_SAMPLER_1D_SHADOW_ARB: + case GL_SAMPLER_2D_SHADOW_ARB: + types_match = (type == GL_INT); + break; + default: + types_match = (type == slang_export_data_quant_type(uniform->quant)); + break; + } + + if (!types_match) + return GL_FALSE; + + switch (type) { + case GL_INT: + case GL_INT_VEC2_ARB: + case GL_INT_VEC3_ARB: + case GL_INT_VEC4_ARB: + convert_int_to_float = GL_TRUE; + break; + } + + for (i = 0; i < SLANG_SHADER_MAX; i++) { + if (uniform->address[i] != ~0) { + void *dest + = &impl->_obj.prog.machines[i]->mem[uniform->address[i] / 4]; + /* total number of values to copy */ + GLuint total + = count * slang_export_data_quant_components(uniform->quant); + GLuint j; + if (convert_float_to_bool) { + const GLfloat *src = (GLfloat *) (data); + GLfloat *dst = (GLfloat *) dest; + for (j = 0; j < total; j++) + dst[j] = src[j] != 0.0f ? 1.0f : 0.0f; + break; + } + else if (convert_int_to_bool) { + const GLint *src = (GLint *) (data); + GLfloat *dst = (GLfloat *) dest; + for (j = 0; j < total; j++) + dst[j] = src[j] ? 1.0f : 0.0f; + break; + } + else if (convert_int_to_float) { + const GLint *src = (GLint *) (data); + GLfloat *dst = (GLfloat *) dest; + for (j = 0; j < total; j++) + dst[j] = (GLfloat) src[j]; + break; + } + else { + _mesa_memcpy(dest, data, total * sizeof(GLfloat)); + break; + } + break; + } + } + return GL_TRUE; +} + +/** + * Read a uniform variable from program's memory. + * \return GL_TRUE for success, GL_FALSE if error + */ +static GLboolean +_program_ReadUniform(struct gl2_program_intf **intf, GLint loc, + GLsizei count, GLvoid *data, GLenum type) +{ + struct gl2_program_impl *impl = (struct gl2_program_impl *) (intf); + const slang_uniform_bindings *uniforms = &impl->_obj.prog.uniforms; + const slang_uniform_binding *uniform; + GLuint i; + GLboolean convert_bool_to_float = GL_FALSE; + GLboolean convert_bool_to_int = GL_FALSE; + GLboolean convert_float_to_int = GL_FALSE; + GLboolean types_match = GL_FALSE; + + if (loc < 0 || loc >= uniforms->count) + return GL_FALSE; + + uniform = &uniforms->table[loc]; + + if (slang_export_data_quant_struct(uniform->quant)) + return GL_FALSE; + + switch (slang_export_data_quant_type(uniform->quant)) { + case GL_BOOL_ARB: + types_match = (type == GL_FLOAT) || (type == GL_INT); + if (type == GL_FLOAT) + convert_bool_to_float = GL_TRUE; + else + convert_bool_to_int = GL_TRUE; + break; + case GL_BOOL_VEC2_ARB: + types_match = (type == GL_FLOAT_VEC2_ARB) || (type == GL_INT_VEC2_ARB); + if (type == GL_FLOAT_VEC2_ARB) + convert_bool_to_float = GL_TRUE; + else + convert_bool_to_int = GL_TRUE; + break; + case GL_BOOL_VEC3_ARB: + types_match = (type == GL_FLOAT_VEC3_ARB) || (type == GL_INT_VEC3_ARB); + if (type == GL_FLOAT_VEC3_ARB) + convert_bool_to_float = GL_TRUE; + else + convert_bool_to_int = GL_TRUE; + break; + case GL_BOOL_VEC4_ARB: + types_match = (type == GL_FLOAT_VEC4_ARB) || (type == GL_INT_VEC4_ARB); + if (type == GL_FLOAT_VEC4_ARB) + convert_bool_to_float = GL_TRUE; + else + convert_bool_to_int = GL_TRUE; + break; + case GL_SAMPLER_1D_ARB: + case GL_SAMPLER_2D_ARB: + case GL_SAMPLER_3D_ARB: + case GL_SAMPLER_CUBE_ARB: + case GL_SAMPLER_1D_SHADOW_ARB: + case GL_SAMPLER_2D_SHADOW_ARB: + types_match = (type == GL_INT); + break; + default: + /* uniform is a float type */ + types_match = (type == GL_FLOAT); + break; + } + + if (!types_match) + return GL_FALSE; + + switch (type) { + case GL_INT: + case GL_INT_VEC2_ARB: + case GL_INT_VEC3_ARB: + case GL_INT_VEC4_ARB: + convert_float_to_int = GL_TRUE; + break; + } + + for (i = 0; i < SLANG_SHADER_MAX; i++) { + if (uniform->address[i] != ~0) { + /* XXX if bools are really implemented as floats, some of this + * could probably be culled out. + */ + const void *source + = &impl->_obj.prog.machines[i]->mem[uniform->address[i] / 4]; + /* total number of values to copy */ + const GLuint total + = count * slang_export_data_quant_components(uniform->quant); + GLuint j; + if (convert_bool_to_float) { + GLfloat *dst = (GLfloat *) (data); + const GLfloat *src = (GLfloat *) source; + for (j = 0; j < total; j++) + dst[j] = src[j] == 0.0 ? 0.0 : 1.0; + } + else if (convert_bool_to_int) { + GLint *dst = (GLint *) (data); + const GLfloat *src = (GLfloat *) source; + for (j = 0; j < total; j++) + dst[j] = src[j] == 0.0 ? 0 : 1; + } + else if (convert_float_to_int) { + GLint *dst = (GLint *) (data); + const GLfloat *src = (GLfloat *) source; + for (j = 0; j < total; j++) + dst[j] = (GLint) src[j]; + } + else { + /* no type conversion needed */ + _mesa_memcpy(data, source, total * sizeof(GLfloat)); + } + break; + } /* if */ + } /* for */ + + return GL_TRUE; } + static GLvoid -_program_GetActiveAttrib (struct gl2_program_intf **intf, GLuint index, GLsizei maxLength, - GLsizei *length, GLint *size, GLenum *type, GLchar *name) +_program_GetActiveAttrib(struct gl2_program_intf **intf, GLuint index, + GLsizei maxLength, GLsizei * length, GLint * size, + GLenum * type, GLchar * name) { - struct gl2_program_impl *impl = (struct gl2_program_impl *) (intf); - slang_active_variable *a = &impl->_obj.prog.active_attribs.table[index]; + struct gl2_program_impl *impl = (struct gl2_program_impl *) (intf); + slang_active_variable *a = &impl->_obj.prog.active_attribs.table[index]; - get_active_variable (a, maxLength, length, size, type, name); + get_active_variable(a, maxLength, length, size, type, name); } static GLuint -_program_GetActiveAttribMaxLength (struct gl2_program_intf **intf) +_program_GetActiveAttribMaxLength(struct gl2_program_intf **intf) { - struct gl2_program_impl *impl = (struct gl2_program_impl *) (intf); + struct gl2_program_impl *impl = (struct gl2_program_impl *) (intf); - return get_active_variable_max_length (&impl->_obj.prog.active_attribs); + return get_active_variable_max_length(&impl->_obj.prog.active_attribs); } static GLuint -_program_GetActiveAttribCount (struct gl2_program_intf **intf) +_program_GetActiveAttribCount(struct gl2_program_intf **intf) { - struct gl2_program_impl *impl = (struct gl2_program_impl *) (intf); + struct gl2_program_impl *impl = (struct gl2_program_impl *) (intf); - return impl->_obj.prog.active_attribs.count; + return impl->_obj.prog.active_attribs.count; } static GLint -_program_GetAttribLocation (struct gl2_program_intf **intf, const GLchar *name) +_program_GetAttribLocation(struct gl2_program_intf **intf, + const GLchar * name) { - struct gl2_program_impl *impl = (struct gl2_program_impl *) (intf); - slang_attrib_bindings *attribs = &impl->_obj.prog.attribs; - GLuint i; + struct gl2_program_impl *impl = (struct gl2_program_impl *) (intf); + slang_attrib_bindings *attribs = &impl->_obj.prog.attribs; + GLuint i; - for (i = 0; i < attribs->binding_count; i++) - if (_mesa_strcmp (attribs->bindings[i].name, name) == 0) - return attribs->bindings[i].first_slot_index; - return -1; + for (i = 0; i < attribs->binding_count; i++) + if (_mesa_strcmp(attribs->bindings[i].name, name) == 0) + return attribs->bindings[i].first_slot_index; + return -1; } static GLvoid -_program_OverrideAttribBinding (struct gl2_program_intf **intf, GLuint index, const GLchar *name) +_program_OverrideAttribBinding(struct gl2_program_intf **intf, GLuint index, + const GLchar * name) { - GET_CURRENT_CONTEXT(ctx); - struct gl2_program_impl *impl = (struct gl2_program_impl *) (intf); - slang_program *pro = &impl->_obj.prog; + GET_CURRENT_CONTEXT(ctx); + struct gl2_program_impl *impl = (struct gl2_program_impl *) (intf); + slang_program *pro = &impl->_obj.prog; - if (!slang_attrib_overrides_add (&pro->attrib_overrides, index, name)) - _mesa_error (ctx, GL_OUT_OF_MEMORY, "_program_OverrideAttribBinding"); + if (!_slang_attrib_overrides_add(&pro->attrib_overrides, index, name)) + _mesa_error(ctx, GL_OUT_OF_MEMORY, "_program_OverrideAttribBinding"); } static GLvoid -_program_WriteAttrib (struct gl2_program_intf **intf, GLuint index, const GLfloat *value) +_program_WriteAttrib(struct gl2_program_intf **intf, GLuint index, + const GLfloat * value) { struct gl2_program_impl *impl = (struct gl2_program_impl *) (intf); slang_program *pro = &impl->_obj.prog; slang_attrib_slot *slot = &pro->attribs.slots[index]; /* - * Generic attributes can be allocated in a shader with scalar, vec or mat type. - * For scalar and vec types (specifically float, vec2 and vec3) this is simple - just - * ignore the extra components. For mat type this is more complicated - the vertex_shader - * spec requires to store every column of a matrix in a separate attrib slot. - * To prvent from overwriting data from neighbouring matrix columns, the "fill" information - * is kept to know how many components to copy. + * Generic attributes can be allocated in a shader with scalar, vec + * or mat type. For scalar and vec types (specifically float, vec2 + * and vec3) this is simple - just ignore the extra components. For + * mat type this is more complicated - the vertex_shader spec + * requires to store every column of a matrix in a separate attrib + * slot. To prvent from overwriting data from neighbouring matrix + * columns, the "fill" information is kept to know how many + * components to copy. */ if (slot->addr != ~0) - _mesa_memcpy (&pro->machines[SLANG_SHADER_VERTEX]->mem[slot->addr / 4]._float, value, - slot->fill * sizeof (GLfloat)); + _mesa_memcpy(&pro->machines[SLANG_SHADER_VERTEX]->mem[slot->addr / 4]. + _float, value, slot->fill * sizeof(GLfloat)); } static GLvoid -_program_UpdateVarying (struct gl2_program_intf **intf, GLuint index, GLfloat *value, - GLboolean vert) -{ - struct gl2_program_impl *impl = (struct gl2_program_impl *) intf; - slang_program *pro = &impl->_obj.prog; - GLuint addr; - - if (index >= pro->varyings.slot_count) - return; - if (vert) - addr = pro->varyings.slots[index].vert_addr / 4; - else - addr = pro->varyings.slots[index].frag_addr / 4; - if (addr != ~0) - { - if (vert) - *value = pro->machines[SLANG_SHADER_VERTEX]->mem[addr]._float; - else - pro->machines[SLANG_SHADER_FRAGMENT]->mem[addr]._float = *value; - } +_program_UpdateVarying(struct gl2_program_intf **intf, GLuint index, + GLfloat * value, GLboolean vert) +{ + struct gl2_program_impl *impl = (struct gl2_program_impl *) intf; + slang_program *pro = &impl->_obj.prog; + GLuint addr; + + if (index >= pro->varyings.slot_count) + return; + if (vert) + addr = pro->varyings.slots[index].vert_addr / 4; + else + addr = pro->varyings.slots[index].frag_addr / 4; + if (addr != ~0) { + if (vert) + *value = pro->machines[SLANG_SHADER_VERTEX]->mem[addr]._float; + else + pro->machines[SLANG_SHADER_FRAGMENT]->mem[addr]._float = *value; + } } static struct gl2_program_intf _program_vftbl = { - { - { - { - _unknown_AddRef, - _unknown_Release, - _program_QueryInterface - }, - _generic_Delete, - _program_GetType, - _generic_GetName, - _generic_GetDeleteStatus, + { + { + { + _unknown_AddRef, + _unknown_Release, + _program_QueryInterface + }, + _generic_Delete, + _program_GetType, + _generic_GetName, + _generic_GetDeleteStatus, _generic_GetInfoLog, _generic_GetInfoLogLength - }, - _program_Attach, - _container_Detach, - _container_GetAttachedCount, - _container_GetAttached - }, - _program_GetLinkStatus, - _program_GetValidateStatus, - _program_Link, - _program_Validate, - _program_UpdateFixedUniforms, - _program_UpdateFixedAttrib, - _program_UpdateFixedVarying, - _program_GetTextureImageUsage, - _program_IsShaderPresent, - _program_GetActiveUniform, - _program_GetActiveUniformMaxLength, - _program_GetActiveUniformCount, - _program_GetUniformLocation, - _program_WriteUniform, - _program_GetActiveAttrib, - _program_GetActiveAttribMaxLength, - _program_GetActiveAttribCount, - _program_GetAttribLocation, - _program_OverrideAttribBinding, + }, + _program_Attach, + _container_Detach, + _container_GetAttachedCount, + _container_GetAttached + }, + _program_GetLinkStatus, + _program_GetValidateStatus, + _program_Link, + _program_Validate, + _program_UpdateFixedUniforms, + _program_UpdateFixedAttrib, + _program_UpdateFixedVarying, + _program_GetTextureImageUsage, + _program_IsShaderPresent, + _program_GetActiveUniform, + _program_GetActiveUniformMaxLength, + _program_GetActiveUniformCount, + _program_GetUniformLocation, + _program_WriteUniform, + _program_ReadUniform, + _program_GetActiveAttrib, + _program_GetActiveAttribMaxLength, + _program_GetActiveAttribCount, + _program_GetAttribLocation, + _program_OverrideAttribBinding, _program_WriteAttrib, - _program_UpdateVarying + _program_UpdateVarying }; static void -_program_constructor (struct gl2_program_impl *impl) +_program_constructor(struct gl2_program_impl *impl) { - _container_constructor ((struct gl2_container_impl *) impl); - impl->_vftbl = &_program_vftbl; - impl->_obj._container._generic._unknown._destructor = _program_destructor; - impl->_obj.link_status = GL_FALSE; - impl->_obj.validate_status = GL_FALSE; + _container_constructor((struct gl2_container_impl *) impl); + impl->_vftbl = &_program_vftbl; + impl->_obj._container._generic._unknown._destructor = _program_destructor; + impl->_obj.link_status = GL_FALSE; + impl->_obj.validate_status = GL_FALSE; #if USE_3DLABS_FRONTEND - impl->_obj.linker = ShConstructLinker (EShExVertexFragment, 0); - impl->_obj.uniforms = ShConstructUniformMap (); + impl->_obj.linker = ShConstructLinker(EShExVertexFragment, 0); + impl->_obj.uniforms = ShConstructUniformMap(); #endif - slang_program_ctr (&impl->_obj.prog); + _slang_program_ctr(&impl->_obj.prog); } struct gl2_fragment_shader_obj { - struct gl2_shader_obj _shader; + struct gl2_shader_obj _shader; }; struct gl2_fragment_shader_impl { - struct gl2_fragment_shader_intf *_vftbl; - struct gl2_fragment_shader_obj _obj; + struct gl2_fragment_shader_intf *_vftbl; + struct gl2_fragment_shader_obj _obj; }; static void -_fragment_shader_destructor (struct gl2_unknown_intf **intf) +_fragment_shader_destructor(struct gl2_unknown_intf **intf) { - struct gl2_fragment_shader_impl *impl = (struct gl2_fragment_shader_impl *) intf; + struct gl2_fragment_shader_impl *impl = + (struct gl2_fragment_shader_impl *) intf; - (void) impl; - /* TODO free fragment shader data */ + (void) impl; + /* TODO free fragment shader data */ - _shader_destructor (intf); + _shader_destructor(intf); } static struct gl2_unknown_intf ** -_fragment_shader_QueryInterface (struct gl2_unknown_intf **intf, enum gl2_uiid uiid) +_fragment_shader_QueryInterface(struct gl2_unknown_intf **intf, + enum gl2_uiid uiid) { - if (uiid == UIID_FRAGMENT_SHADER) - { - (**intf).AddRef (intf); - return intf; - } - return _shader_QueryInterface (intf, uiid); + if (uiid == UIID_FRAGMENT_SHADER) { + (**intf).AddRef(intf); + return intf; + } + return _shader_QueryInterface(intf, uiid); } static GLenum -_fragment_shader_GetSubType (struct gl2_shader_intf **intf) +_fragment_shader_GetSubType(struct gl2_shader_intf **intf) { - return GL_FRAGMENT_SHADER_ARB; + return GL_FRAGMENT_SHADER_ARB; } static struct gl2_fragment_shader_intf _fragment_shader_vftbl = { - { - { - { - _unknown_AddRef, - _unknown_Release, - _fragment_shader_QueryInterface - }, - _generic_Delete, - _shader_GetType, - _generic_GetName, - _generic_GetDeleteStatus, + { + { + { + _unknown_AddRef, + _unknown_Release, + _fragment_shader_QueryInterface + }, + _generic_Delete, + _shader_GetType, + _generic_GetName, + _generic_GetDeleteStatus, _shader_GetInfoLog, _shader_GetInfoLogLength - }, - _fragment_shader_GetSubType, - _shader_GetCompileStatus, - _shader_SetSource, - _shader_GetSource, - _shader_Compile - } + }, + _fragment_shader_GetSubType, + _shader_GetCompileStatus, + _shader_SetSource, + _shader_GetSource, + _shader_Compile + } }; static void -_fragment_shader_constructor (struct gl2_fragment_shader_impl *impl) +_fragment_shader_constructor(struct gl2_fragment_shader_impl *impl) { - _shader_constructor ((struct gl2_shader_impl *) impl); - impl->_vftbl = &_fragment_shader_vftbl; - impl->_obj._shader._generic._unknown._destructor = _fragment_shader_destructor; + _shader_constructor((struct gl2_shader_impl *) impl); + impl->_vftbl = &_fragment_shader_vftbl; + impl->_obj._shader._generic._unknown._destructor = + _fragment_shader_destructor; #if USE_3DLABS_FRONTEND - impl->_obj._shader._3dlabs_shhandle._obj.handle = ShConstructCompiler (EShLangFragment, 0); + impl->_obj._shader._3dlabs_shhandle._obj.handle = + ShConstructCompiler(EShLangFragment, 0); #endif } struct gl2_vertex_shader_obj { - struct gl2_shader_obj _shader; + struct gl2_shader_obj _shader; }; struct gl2_vertex_shader_impl { - struct gl2_vertex_shader_intf *_vftbl; - struct gl2_vertex_shader_obj _obj; + struct gl2_vertex_shader_intf *_vftbl; + struct gl2_vertex_shader_obj _obj; }; static void -_vertex_shader_destructor (struct gl2_unknown_intf **intf) +_vertex_shader_destructor(struct gl2_unknown_intf **intf) { - struct gl2_vertex_shader_impl *impl = (struct gl2_vertex_shader_impl *) intf; + struct gl2_vertex_shader_impl *impl = + (struct gl2_vertex_shader_impl *) intf; - (void) impl; - /* TODO free vertex shader data */ + (void) impl; + /* TODO free vertex shader data */ - _shader_destructor (intf); + _shader_destructor(intf); } static struct gl2_unknown_intf ** -_vertex_shader_QueryInterface (struct gl2_unknown_intf **intf, enum gl2_uiid uiid) +_vertex_shader_QueryInterface(struct gl2_unknown_intf **intf, + enum gl2_uiid uiid) { - if (uiid == UIID_VERTEX_SHADER) - { - (**intf).AddRef (intf); - return intf; - } - return _shader_QueryInterface (intf, uiid); + if (uiid == UIID_VERTEX_SHADER) { + (**intf).AddRef(intf); + return intf; + } + return _shader_QueryInterface(intf, uiid); } static GLenum -_vertex_shader_GetSubType (struct gl2_shader_intf **intf) +_vertex_shader_GetSubType(struct gl2_shader_intf **intf) { - return GL_VERTEX_SHADER_ARB; + return GL_VERTEX_SHADER_ARB; } static struct gl2_vertex_shader_intf _vertex_shader_vftbl = { - { - { - { - _unknown_AddRef, - _unknown_Release, - _vertex_shader_QueryInterface - }, - _generic_Delete, - _shader_GetType, - _generic_GetName, - _generic_GetDeleteStatus, + { + { + { + _unknown_AddRef, + _unknown_Release, + _vertex_shader_QueryInterface + }, + _generic_Delete, + _shader_GetType, + _generic_GetName, + _generic_GetDeleteStatus, _shader_GetInfoLog, _shader_GetInfoLogLength - }, - _vertex_shader_GetSubType, - _shader_GetCompileStatus, - _shader_SetSource, - _shader_GetSource, - _shader_Compile - } + }, + _vertex_shader_GetSubType, + _shader_GetCompileStatus, + _shader_SetSource, + _shader_GetSource, + _shader_Compile + } }; static void -_vertex_shader_constructor (struct gl2_vertex_shader_impl *impl) +_vertex_shader_constructor(struct gl2_vertex_shader_impl *impl) { - _shader_constructor ((struct gl2_shader_impl *) impl); - impl->_vftbl = &_vertex_shader_vftbl; - impl->_obj._shader._generic._unknown._destructor = _vertex_shader_destructor; + _shader_constructor((struct gl2_shader_impl *) impl); + impl->_vftbl = &_vertex_shader_vftbl; + impl->_obj._shader._generic._unknown._destructor = + _vertex_shader_destructor; #if USE_3DLABS_FRONTEND - impl->_obj._shader._3dlabs_shhandle._obj.handle = ShConstructCompiler (EShLangVertex, 0); + impl->_obj._shader._3dlabs_shhandle._obj.handle = + ShConstructCompiler(EShLangVertex, 0); #endif } @@ -1788,34 +1944,35 @@ struct gl2_debug_impl }; static GLvoid -_debug_destructor (struct gl2_unknown_intf **intf) +_debug_destructor(struct gl2_unknown_intf **intf) { struct gl2_debug_impl *impl = (struct gl2_debug_impl *) (intf); (void) (impl); /* TODO */ - _generic_destructor (intf); + _generic_destructor(intf); } static struct gl2_unknown_intf ** -_debug_QueryInterface (struct gl2_unknown_intf **intf, enum gl2_uiid uiid) +_debug_QueryInterface(struct gl2_unknown_intf **intf, enum gl2_uiid uiid) { if (uiid == UIID_DEBUG) { - (**intf).AddRef (intf); + (**intf).AddRef(intf); return intf; } - return _generic_QueryInterface (intf, uiid); + return _generic_QueryInterface(intf, uiid); } static GLenum -_debug_GetType (struct gl2_generic_intf **intf) +_debug_GetType(struct gl2_generic_intf **intf) { - return /*GL_DEBUG_OBJECT_MESA*/0; + return /*GL_DEBUG_OBJECT_MESA */ 0; } static GLvoid -_debug_ClearDebugLog (struct gl2_debug_intf **intf, GLenum logType, GLenum shaderType) +_debug_ClearDebugLog(struct gl2_debug_intf **intf, GLenum logType, + GLenum shaderType) { struct gl2_debug_impl *impl = (struct gl2_debug_impl *) (intf); @@ -1824,8 +1981,9 @@ _debug_ClearDebugLog (struct gl2_debug_intf **intf, GLenum logType, GLenum shade } static GLvoid -_debug_GetDebugLog (struct gl2_debug_intf **intf, GLenum logType, GLenum shaderType, - GLsizei maxLength, GLsizei *length, GLcharARB *infoLog) +_debug_GetDebugLog(struct gl2_debug_intf **intf, GLenum logType, + GLenum shaderType, GLsizei maxLength, GLsizei * length, + GLcharARB * infoLog) { struct gl2_debug_impl *impl = (struct gl2_debug_impl *) (intf); @@ -1834,7 +1992,8 @@ _debug_GetDebugLog (struct gl2_debug_intf **intf, GLenum logType, GLenum shaderT } static GLsizei -_debug_GetDebugLogLength (struct gl2_debug_intf **intf, GLenum logType, GLenum shaderType) +_debug_GetDebugLogLength(struct gl2_debug_intf **intf, GLenum logType, + GLenum shaderType) { struct gl2_debug_impl *impl = (struct gl2_debug_impl *) (intf); @@ -1864,70 +2023,68 @@ static struct gl2_debug_intf _debug_vftbl = { }; static GLvoid -_debug_constructor (struct gl2_debug_impl *impl) +_debug_constructor(struct gl2_debug_impl *impl) { - _generic_constructor ((struct gl2_generic_impl *) (impl)); + _generic_constructor((struct gl2_generic_impl *) (impl)); impl->_vftbl = &_debug_vftbl; impl->_obj._generic._unknown._destructor = _debug_destructor; } GLhandleARB -_mesa_3dlabs_create_shader_object (GLenum shaderType) -{ - switch (shaderType) - { - case GL_FRAGMENT_SHADER_ARB: - { - struct gl2_fragment_shader_impl *x = (struct gl2_fragment_shader_impl *) - _mesa_malloc (sizeof (struct gl2_fragment_shader_impl)); - - if (x != NULL) - { - _fragment_shader_constructor (x); - return x->_obj._shader._generic.name; - } - } - break; - case GL_VERTEX_SHADER_ARB: - { - struct gl2_vertex_shader_impl *x = (struct gl2_vertex_shader_impl *) - _mesa_malloc (sizeof (struct gl2_vertex_shader_impl)); - - if (x != NULL) - { - _vertex_shader_constructor (x); - return x->_obj._shader._generic.name; - } - } - break; - } - - return 0; +_mesa_3dlabs_create_shader_object(GLenum shaderType) +{ + switch (shaderType) { + case GL_FRAGMENT_SHADER_ARB: + { + struct gl2_fragment_shader_impl *x = + (struct gl2_fragment_shader_impl *) + _mesa_malloc(sizeof(struct gl2_fragment_shader_impl)); + + if (x != NULL) { + _fragment_shader_constructor(x); + return x->_obj._shader._generic.name; + } + } + break; + case GL_VERTEX_SHADER_ARB: + { + struct gl2_vertex_shader_impl *x = (struct gl2_vertex_shader_impl *) + _mesa_malloc(sizeof(struct gl2_vertex_shader_impl)); + + if (x != NULL) { + _vertex_shader_constructor(x); + return x->_obj._shader._generic.name; + } + } + break; + } + + return 0; } GLhandleARB -_mesa_3dlabs_create_program_object (void) +_mesa_3dlabs_create_program_object(void) { - struct gl2_program_impl *x = (struct gl2_program_impl *) - _mesa_malloc (sizeof (struct gl2_program_impl)); + struct gl2_program_impl *x = (struct gl2_program_impl *) + _mesa_malloc(sizeof(struct gl2_program_impl)); - if (x != NULL) - { - _program_constructor (x); - return x->_obj._container._generic.name; - } + if (x != NULL) { + _program_constructor(x); + return x->_obj._container._generic.name; + } - return 0; + return 0; } GLhandleARB -_mesa_3dlabs_create_debug_object (GLvoid) +_mesa_3dlabs_create_debug_object(GLvoid) { struct gl2_debug_impl *obj; - obj = (struct gl2_debug_impl *) (_mesa_malloc (sizeof (struct gl2_debug_impl))); + obj = + (struct gl2_debug_impl *) (_mesa_malloc(sizeof(struct gl2_debug_impl))); if (obj != NULL) { - _debug_constructor (obj); + _debug_constructor(obj); return obj->_obj._generic.name; } return 0; @@ -1936,47 +2093,52 @@ _mesa_3dlabs_create_debug_object (GLvoid) #include "slang_assemble.h" #include "slang_execute.h" -int _slang_fetch_discard (struct gl2_program_intf **pro, GLboolean *val) +int +_slang_fetch_discard(struct gl2_program_intf **pro, GLboolean * val) { - struct gl2_program_impl *impl; + struct gl2_program_impl *impl; - impl = (struct gl2_program_impl *) pro; - *val = impl->_obj.prog.machines[SLANG_SHADER_FRAGMENT]->kill ? GL_TRUE : GL_FALSE; - return 1; + impl = (struct gl2_program_impl *) pro; + *val = + impl->_obj.prog.machines[SLANG_SHADER_FRAGMENT]-> + kill ? GL_TRUE : GL_FALSE; + return 1; } -static GLvoid exec_shader (struct gl2_program_intf **pro, GLuint i) +static GLvoid +exec_shader(struct gl2_program_intf **pro, GLuint i) { - struct gl2_program_impl *impl; - slang_program *p; + struct gl2_program_impl *impl; + slang_program *p; - impl = (struct gl2_program_impl *) pro; - p = &impl->_obj.prog; + impl = (struct gl2_program_impl *) pro; + p = &impl->_obj.prog; - slang_machine_init (p->machines[i]); - p->machines[i]->ip = p->code[i][SLANG_COMMON_CODE_MAIN]; + slang_machine_init(p->machines[i]); + p->machines[i]->ip = p->code[i][SLANG_COMMON_CODE_MAIN]; - _slang_execute2 (p->assemblies[i], p->machines[i]); + _slang_execute2(p->assemblies[i], p->machines[i]); } -GLvoid _slang_exec_fragment_shader (struct gl2_program_intf **pro) +GLvoid +_slang_exec_fragment_shader(struct gl2_program_intf **pro) { - exec_shader (pro, SLANG_SHADER_FRAGMENT); + exec_shader(pro, SLANG_SHADER_FRAGMENT); } -GLvoid _slang_exec_vertex_shader (struct gl2_program_intf **pro) +GLvoid +_slang_exec_vertex_shader(struct gl2_program_intf **pro) { - exec_shader (pro, SLANG_SHADER_VERTEX); + exec_shader(pro, SLANG_SHADER_VERTEX); } #endif void -_mesa_init_shaderobjects_3dlabs (GLcontext *ctx) +_mesa_init_shaderobjects_3dlabs(GLcontext * ctx) { #if USE_3DLABS_FRONTEND - _glslang_3dlabs_InitProcess (); - _glslang_3dlabs_ShInitialize (); + _glslang_3dlabs_InitProcess(); + _glslang_3dlabs_ShInitialize(); #endif } - diff --git a/src/mesa/shader/slang/library/gc_to_bin.c b/src/mesa/shader/slang/library/gc_to_bin.c index 69895d84bfd..ce9a6541acc 100755 --- a/src/mesa/shader/slang/library/gc_to_bin.c +++ b/src/mesa/shader/slang/library/gc_to_bin.c @@ -1,12 +1,13 @@ #include "../../grammar/grammar_crt.h" #include "../../grammar/grammar_crt.c" +#include #include static const char *slang_shader_syn = #include "slang_shader_syn.h" ; -static void gc_to_bin (grammar id, const char *in, const char *out) +static int gc_to_bin (grammar id, const char *in, const char *out) { FILE *f; byte *source, *prod; @@ -16,7 +17,7 @@ static void gc_to_bin (grammar id, const char *in, const char *out) f = fopen (in, "r"); if (f == NULL) - return; + return 1; fseek (f, 0, SEEK_END); size = ftell (f); fseek (f, 0, SEEK_SET); @@ -27,7 +28,7 @@ static void gc_to_bin (grammar id, const char *in, const char *out) if (!grammar_fast_check (id, source, &prod, &size, 65536)) { grammar_alloc_free (source); - return; + return 1; } f = fopen (out, "w"); @@ -59,29 +60,23 @@ static void gc_to_bin (grammar id, const char *in, const char *out) fprintf (f, "\n"); fclose (f); grammar_alloc_free (prod); + return 0; } -int main () +int main (int argc, char *argv[]) { - grammar id; - - id = grammar_load_from_text ((const byte *) slang_shader_syn); - if (id == 0) - return 1; - - grammar_set_reg8 (id, (const byte *) "parsing_builtin", 1); - - grammar_set_reg8 (id, (const byte *) "shader_type", 1); - gc_to_bin (id, "slang_core.gc", "slang_core_gc.h"); - gc_to_bin (id, "slang_common_builtin.gc", "slang_common_builtin_gc.h"); - gc_to_bin (id, "slang_fragment_builtin.gc", "slang_fragment_builtin_gc.h"); - gc_to_bin (id, "slang_builtin_vec4.gc", "slang_builtin_vec4_gc.h"); - - grammar_set_reg8 (id, (const byte *) "shader_type", 2); - gc_to_bin (id, "slang_vertex_builtin.gc", "slang_vertex_builtin_gc.h"); - - grammar_destroy (id); + grammar id; - return 0; + id = grammar_load_from_text ((const byte *) slang_shader_syn); + if (id == 0) + return 1; + grammar_set_reg8 (id, (const byte *) "parsing_builtin", 1); + grammar_set_reg8 (id, (const byte *) "shader_type", atoi (argv[1])); + if (gc_to_bin (id, argv[2], argv[3])) { + grammar_destroy (id); + return 1; + } + grammar_destroy (id); + return 0; } diff --git a/src/mesa/shader/slang/library/slang_pp_directives_syn.h b/src/mesa/shader/slang/library/slang_pp_directives_syn.h new file mode 100644 index 00000000000..35e7bc27616 --- /dev/null +++ b/src/mesa/shader/slang/library/slang_pp_directives_syn.h @@ -0,0 +1,239 @@ + +/* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED FROM THE .syn FILE */ + +".syntax source;\n" +".emtcode ESCAPE_TOKEN 0\n" +".emtcode TOKEN_END 0\n" +".emtcode TOKEN_DEFINE 1\n" +".emtcode TOKEN_UNDEF 2\n" +".emtcode TOKEN_IF 3\n" +".emtcode TOKEN_ELSE 4\n" +".emtcode TOKEN_ELIF 5\n" +".emtcode TOKEN_ENDIF 6\n" +".emtcode TOKEN_ERROR 7\n" +".emtcode TOKEN_PRAGMA 8\n" +".emtcode TOKEN_EXTENSION 9\n" +".emtcode TOKEN_LINE 10\n" +".emtcode PARAM_END 0\n" +".emtcode PARAM_PARAMETER 1\n" +".emtcode BEHAVIOR_REQUIRE 1\n" +".emtcode BEHAVIOR_ENABLE 2\n" +".emtcode BEHAVIOR_WARN 3\n" +".emtcode BEHAVIOR_DISABLE 4\n" +"source\n" +" optional_directive .and .loop source_element .and '\\0' .emit ESCAPE_TOKEN .emit TOKEN_END;\n" +"source_element\n" +" c_style_comment_block .or cpp_style_comment_block .or new_line_directive .or source_token;\n" +"c_style_comment_block\n" +" '/' .and '*' .and c_style_comment_rest .and .true .emit ' ';\n" +"c_style_comment_rest\n" +" .loop c_style_comment_body .and c_style_comment_end;\n" +"c_style_comment_body\n" +" c_style_comment_char_nostar .or c_style_comment_char_star_noslashstar;\n" +"c_style_comment_char_nostar\n" +" new_line .or '\\x2B'-'\\xFF' .or '\\x01'-'\\x29';\n" +"c_style_comment_char_star_noslashstar\n" +" '*' .and c_style_comment_char_star_noslashstar_1;\n" +"c_style_comment_char_star_noslashstar_1\n" +" c_style_comment_char_noslashstar .or c_style_comment_char_star_noslashstar;\n" +"c_style_comment_char_noslashstar\n" +" new_line .or '\\x30'-'\\xFF' .or '\\x01'-'\\x29' .or '\\x2B'-'\\x2E';\n" +"c_style_comment_end\n" +" '*' .and .loop c_style_comment_char_star .and '/';\n" +"c_style_comment_char_star\n" +" '*';\n" +"cpp_style_comment_block\n" +" '/' .and '/' .and cpp_style_comment_block_1;\n" +"cpp_style_comment_block_1\n" +" cpp_style_comment_block_2 .or cpp_style_comment_block_3;\n" +"cpp_style_comment_block_2\n" +" .loop cpp_style_comment_char .and new_line_directive;\n" +"cpp_style_comment_block_3\n" +" .loop cpp_style_comment_char;\n" +"cpp_style_comment_char\n" +" '\\x0E'-'\\xFF' .or '\\x01'-'\\x09' .or '\\x0B'-'\\x0C';\n" +"new_line_directive\n" +" new_line .and optional_directive;\n" +"new_line\n" +" generic_new_line .emit '\\n';\n" +"generic_new_line\n" +" carriage_return_line_feed .or line_feed_carriage_return .or '\\n' .or '\\r';\n" +"carriage_return_line_feed\n" +" '\\r' .and '\\n';\n" +"line_feed_carriage_return\n" +" '\\n' .and '\\r';\n" +"optional_directive\n" +" directive .emit ESCAPE_TOKEN .or .true;\n" +"directive\n" +" dir_define .emit TOKEN_DEFINE .or\n" +" dir_undef .emit TOKEN_UNDEF .or\n" +" dir_if .emit TOKEN_IF .or\n" +" dir_ifdef .emit TOKEN_IF .emit 'd' .emit 'e' .emit 'f' .emit 'i' .emit 'n' .emit 'e' .emit 'd'\n" +" .emit ' ' .or\n" +" dir_ifndef .emit TOKEN_IF .emit '!' .emit 'd' .emit 'e' .emit 'f' .emit 'i' .emit 'n' .emit 'e'\n" +" .emit 'd' .emit ' ' .or\n" +" dir_else .emit TOKEN_ELSE .or\n" +" dir_elif .emit TOKEN_ELIF .or\n" +" dir_endif .emit TOKEN_ENDIF .or\n" +" dir_ext .emit TOKEN_EXTENSION .or\n" +" dir_line .emit TOKEN_LINE;\n" +"dir_define\n" +" optional_space .and '#' .and optional_space .and \"define\" .and symbol .and opt_parameters .and\n" +" definition;\n" +"dir_undef\n" +" optional_space .and '#' .and optional_space .and \"undef\" .and symbol;\n" +"dir_if\n" +" optional_space .and '#' .and optional_space .and \"if\" .and expression;\n" +"dir_ifdef\n" +" optional_space .and '#' .and optional_space .and \"ifdef\" .and symbol;\n" +"dir_ifndef\n" +" optional_space .and '#' .and optional_space .and \"ifndef\" .and symbol;\n" +"dir_else\n" +" optional_space .and '#' .and optional_space .and \"else\";\n" +"dir_elif\n" +" optional_space .and '#' .and optional_space .and \"elif\" .and expression;\n" +"dir_endif\n" +" optional_space .and '#' .and optional_space .and \"endif\";\n" +"dir_ext\n" +" optional_space .and '#' .and optional_space .and \"extension\" .and space .and extension_name .and\n" +" optional_space .and ':' .and optional_space .and extension_behavior;\n" +"dir_line\n" +" optional_space .and '#' .and optional_space .and \"line\" .and expression;\n" +"symbol\n" +" space .and symbol_character .emit * .and .loop symbol_character2 .emit * .and .true .emit '\\0';\n" +"opt_parameters\n" +" parameters .or .true .emit PARAM_END;\n" +"parameters\n" +" '(' .and parameters_1 .and optional_space .and ')' .emit PARAM_END;\n" +"parameters_1\n" +" parameters_2 .or .true;\n" +"parameters_2\n" +" parameter .emit PARAM_PARAMETER .and .loop parameters_3;\n" +"parameters_3\n" +" optional_space .and ',' .and parameter .emit PARAM_PARAMETER;\n" +"parameter\n" +" optional_space .and symbol_character .emit * .and .loop symbol_character2 .emit * .and\n" +" .true .emit '\\0';\n" +"definition\n" +" .loop definition_character .emit * .and .true .emit '\\0';\n" +"definition_character\n" +" '\\x0E'-'\\xFF' .or '\\x01'-'\\x09' .or '\\x0B'-'\\x0C';\n" +"expression\n" +" expression_element .and .loop expression_element .and .true .emit '\\0';\n" +"expression_element\n" +" expression_character .emit *;\n" +"expression_character\n" +" '\\x0E'-'\\xFF' .or '\\x01'-'\\x09' .or '\\x0B'-'\\x0C';\n" +"extension_name\n" +" symbol_character .emit * .and .loop symbol_character2 .emit * .and .true .emit '\\0';\n" +"extension_behavior\n" +" \"require\" .emit BEHAVIOR_REQUIRE .or\n" +" \"enable\" .emit BEHAVIOR_ENABLE .or\n" +" \"warn\" .emit BEHAVIOR_WARN .or\n" +" \"disable\" .emit BEHAVIOR_DISABLE;\n" +"optional_space\n" +" .loop single_space;\n" +"space\n" +" single_space .and .loop single_space;\n" +"single_space\n" +" ' ' .or '\\t';\n" +"source_token\n" +" space .emit ' ' .or complex_token .or source_token_1;\n" +"source_token_1\n" +" simple_token .emit ' ' .and .true .emit ' ';\n" +"complex_token\n" +" identifier .or number;\n" +"simple_token\n" +" increment .or decrement .or lequal .or gequal .or equal .or nequal .or and .or xor .or or .or\n" +" addto .or subtractfrom .or multiplyto .or divideto .or other;\n" +"identifier\n" +" identifier_char1 .emit * .and .loop identifier_char2 .emit *;\n" +"identifier_char1\n" +" 'a'-'z' .or 'A'-'Z' .or '_';\n" +"identifier_char2\n" +" 'a'-'z' .or 'A'-'Z' .or '0'-'9' .or '_';\n" +"number\n" +" float .or integer;\n" +"digit_oct\n" +" '0'-'7';\n" +"digit_dec\n" +" '0'-'9';\n" +"digit_hex\n" +" '0'-'9' .or 'A'-'F' .or 'a'-'f';\n" +"float\n" +" float_1 .or float_2;\n" +"float_1\n" +" float_fractional_constant .and float_optional_exponent_part;\n" +"float_2\n" +" float_digit_sequence .and float_exponent_part;\n" +"float_fractional_constant\n" +" float_fractional_constant_1 .or float_fractional_constant_2 .or float_fractional_constant_3;\n" +"float_fractional_constant_1\n" +" float_digit_sequence .and '.' .emit '.' .and float_digit_sequence;\n" +"float_fractional_constant_2\n" +" float_digit_sequence .and '.' .emit '.';\n" +"float_fractional_constant_3\n" +" '.' .emit '.' .and float_digit_sequence;\n" +"float_optional_exponent_part\n" +" float_exponent_part .or .true;\n" +"float_digit_sequence\n" +" digit_dec .emit * .and .loop digit_dec .emit *;\n" +"float_exponent_part\n" +" float_exponent_part_1 .or float_exponent_part_2;\n" +"float_exponent_part_1\n" +" 'e' .emit 'e' .and float_optional_sign .and float_digit_sequence;\n" +"float_exponent_part_2\n" +" 'E' .emit 'E' .and float_optional_sign .and float_digit_sequence;\n" +"float_optional_sign\n" +" '+' .emit '+' .or '-' .emit '-' .or .true;\n" +"integer\n" +" integer_hex .or integer_oct .or integer_dec;\n" +"integer_hex\n" +" '0' .emit '0' .and integer_hex_1 .emit * .and digit_hex .emit * .and\n" +" .loop digit_hex .emit *;\n" +"integer_hex_1\n" +" 'x' .or 'X';\n" +"integer_oct\n" +" '0' .emit '0' .and .loop digit_oct .emit *;\n" +"integer_dec\n" +" digit_dec .emit * .and .loop digit_dec .emit *;\n" +"increment\n" +" '+' .emit * .and '+' .emit *;\n" +"decrement\n" +" '-' .emit * .and '-' .emit *;\n" +"lequal\n" +" '<' .emit * .and '=' .emit *;\n" +"gequal\n" +" '>' .emit * .and '=' .emit *;\n" +"equal\n" +" '=' .emit * .and '=' .emit *;\n" +"nequal\n" +" '!' .emit * .and '=' .emit *;\n" +"and\n" +" '&' .emit * .and '&' .emit *;\n" +"xor\n" +" '^' .emit * .and '^' .emit *;\n" +"or\n" +" '|' .emit * .and '|' .emit *;\n" +"addto\n" +" '+' .emit * .and '=' .emit *;\n" +"subtractfrom\n" +" '-' .emit * .and '=' .emit *;\n" +"multiplyto\n" +" '*' .emit * .and '=' .emit *;\n" +"divideto\n" +" '/' .emit * .and '=' .emit *;\n" +"other\n" +" '\\x24'-'\\xFF' .emit * .or '\\x01'-'\\x22' .emit *;\n" +"symbol_character\n" +" 'A'-'Z' .or 'a'-'z' .or '_';\n" +"symbol_character2\n" +" 'A'-'Z' .or 'a'-'z' .or '0'-'9' .or '_';\n" +".string string_lexer;\n" +"string_lexer\n" +" lex_first_identifier_character .and .loop lex_next_identifier_character;\n" +"lex_first_identifier_character\n" +" 'a'-'z' .or 'A'-'Z' .or '_';\n" +"lex_next_identifier_character\n" +" 'a'-'z' .or 'A'-'Z' .or '0'-'9' .or '_';\n" +"" diff --git a/src/mesa/shader/slang/library/slang_pp_expression_syn.h b/src/mesa/shader/slang/library/slang_pp_expression_syn.h new file mode 100644 index 00000000000..f3e9ef6b229 --- /dev/null +++ b/src/mesa/shader/slang/library/slang_pp_expression_syn.h @@ -0,0 +1,179 @@ + +/* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED FROM THE .syn FILE */ + +".syntax expression;\n" +".emtcode EXP_END 0\n" +".emtcode EXP_EXPRESSION 1\n" +".emtcode OP_END 0\n" +".emtcode OP_PUSHINT 1\n" +".emtcode OP_LOGICALOR 2\n" +".emtcode OP_LOGICALAND 3\n" +".emtcode OP_OR 4\n" +".emtcode OP_XOR 5\n" +".emtcode OP_AND 6\n" +".emtcode OP_EQUAL 7\n" +".emtcode OP_NOTEQUAL 8\n" +".emtcode OP_LESSEQUAL 9\n" +".emtcode OP_GREATEREQUAL 10\n" +".emtcode OP_LESS 11\n" +".emtcode OP_GREATER 12\n" +".emtcode OP_LEFTSHIFT 13\n" +".emtcode OP_RIGHTSHIFT 14\n" +".emtcode OP_ADD 15\n" +".emtcode OP_SUBTRACT 16\n" +".emtcode OP_MULTIPLY 17\n" +".emtcode OP_DIVIDE 18\n" +".emtcode OP_MODULUS 19\n" +".emtcode OP_PLUS 20\n" +".emtcode OP_MINUS 21\n" +".emtcode OP_NEGATE 22\n" +".emtcode OP_COMPLEMENT 23\n" +"expression\n" +" first_expression .and optional_second_expression .and optional_space .and '\\0' .emit EXP_END;\n" +"first_expression\n" +" optional_space .and logical_or_expression .emit EXP_EXPRESSION .and .true .emit OP_END;\n" +"optional_second_expression\n" +" second_expression .or .true;\n" +"second_expression\n" +" space .and logical_or_expression .emit EXP_EXPRESSION .and .true .emit OP_END;\n" +"logical_or_expression\n" +" logical_and_expression .and .loop logical_or_expression_1;\n" +"logical_or_expression_1\n" +" barbar .and logical_and_expression .and .true .emit OP_LOGICALOR;\n" +"logical_and_expression\n" +" or_expression .and .loop logical_and_expression_1;\n" +"logical_and_expression_1\n" +" ampersandampersand .and or_expression .and .true .emit OP_LOGICALAND;\n" +"or_expression\n" +" xor_expression .and .loop or_expression_1;\n" +"or_expression_1\n" +" bar .and xor_expression .and .true .emit OP_OR;\n" +"xor_expression\n" +" and_expression .and .loop xor_expression_1;\n" +"xor_expression_1\n" +" caret .and and_expression .and .true .emit OP_XOR;\n" +"and_expression\n" +" equality_expression .and .loop and_expression_1;\n" +"and_expression_1\n" +" ampersand .and equality_expression .and .true .emit OP_AND;\n" +"equality_expression\n" +" relational_expression .and .loop equality_expression_1;\n" +"equality_expression_1\n" +" equality_expression_2 .or equality_expression_3;\n" +"equality_expression_2\n" +" equalsequals .and relational_expression .and .true .emit OP_EQUAL;\n" +"equality_expression_3\n" +" bangequals .and relational_expression .and .true .emit OP_NOTEQUAL;\n" +"relational_expression\n" +" shift_expression .and .loop relational_expression_1;\n" +"relational_expression_1\n" +" relational_expression_2 .or relational_expression_3 .or relational_expression_4 .or\n" +" relational_expression_5;\n" +"relational_expression_2\n" +" lessequals .and shift_expression .and .true .emit OP_LESSEQUAL;\n" +"relational_expression_3\n" +" greaterequals .and shift_expression .and .true .emit OP_GREATEREQUAL;\n" +"relational_expression_4\n" +" less .and shift_expression .and .true .emit OP_LESS;\n" +"relational_expression_5\n" +" greater .and shift_expression .and .true .emit OP_GREATER;\n" +"shift_expression\n" +" additive_expression .and .loop shift_expression_1;\n" +"shift_expression_1\n" +" shift_expression_2 .or shift_expression_3;\n" +"shift_expression_2\n" +" lessless .and additive_expression .and .true .emit OP_LEFTSHIFT;\n" +"shift_expression_3\n" +" greatergreater .and additive_expression .and .true .emit OP_RIGHTSHIFT;\n" +"additive_expression\n" +" multiplicative_expression .and .loop additive_expression_1;\n" +"additive_expression_1\n" +" additive_expression_2 .or additive_expression_3;\n" +"additive_expression_2\n" +" plus .and multiplicative_expression .and .true .emit OP_ADD;\n" +"additive_expression_3\n" +" dash .and multiplicative_expression .and .true .emit OP_SUBTRACT;\n" +"multiplicative_expression\n" +" unary_expression .and .loop multiplicative_expression_1;\n" +"multiplicative_expression_1\n" +" multiplicative_expression_2 .or multiplicative_expression_3 .or multiplicative_expression_4;\n" +"multiplicative_expression_2\n" +" star .and unary_expression .and .true .emit OP_MULTIPLY;\n" +"multiplicative_expression_3\n" +" slash .and unary_expression .and .true .emit OP_DIVIDE;\n" +"multiplicative_expression_4\n" +" percent .and unary_expression .and .true .emit OP_MODULUS;\n" +"unary_expression\n" +" primary_expression .or unary_expression_1 .or unary_expression_2 .or unary_expression_3 .or\n" +" unary_expression_4;\n" +"unary_expression_1\n" +" plus .and unary_expression .and .true .emit OP_PLUS;\n" +"unary_expression_2\n" +" dash .and unary_expression .and .true .emit OP_MINUS;\n" +"unary_expression_3\n" +" bang .and unary_expression .and .true .emit OP_NEGATE;\n" +"unary_expression_4\n" +" tilda .and unary_expression .and .true .emit OP_COMPLEMENT;\n" +"primary_expression\n" +" intconstant .or primary_expression_1;\n" +"primary_expression_1\n" +" lparen .and logical_or_expression .and rparen;\n" +"intconstant\n" +" integer .emit OP_PUSHINT;\n" +"integer\n" +" integer_dec;\n" +"integer_dec\n" +" digit_dec .emit 10 .emit * .and .loop digit_dec .emit * .and .true .emit '\\0';\n" +"digit_dec\n" +" '0'-'9';\n" +"optional_space\n" +" .loop single_space;\n" +"space\n" +" single_space .and .loop single_space;\n" +"single_space\n" +" ' ' .or '\\t';\n" +"ampersand\n" +" optional_space .and '&' .and optional_space;\n" +"ampersandampersand\n" +" optional_space .and '&' .and '&' .and optional_space;\n" +"bang\n" +" optional_space .and '!' .and optional_space;\n" +"bangequals\n" +" optional_space .and '!' .and '=' .and optional_space;\n" +"bar\n" +" optional_space .and '|' .and optional_space;\n" +"barbar\n" +" optional_space .and '|' .and '|' .and optional_space;\n" +"caret\n" +" optional_space .and '^' .and optional_space;\n" +"dash\n" +" optional_space .and '-' .and optional_space;\n" +"equalsequals\n" +" optional_space .and '=' .and '=' .and optional_space;\n" +"greater\n" +" optional_space .and '>' .and optional_space;\n" +"greaterequals\n" +" optional_space .and '>' .and '=' .and optional_space;\n" +"greatergreater\n" +" optional_space .and '>' .and '>' .and optional_space;\n" +"less\n" +" optional_space .and '<' .and optional_space;\n" +"lessequals\n" +" optional_space .and '<' .and '=' .and optional_space;\n" +"lessless\n" +" optional_space .and '<' .and '<' .and optional_space;\n" +"lparen\n" +" optional_space .and '(' .and optional_space;\n" +"percent\n" +" optional_space .and '%' .and optional_space;\n" +"plus\n" +" optional_space .and '+' .and optional_space;\n" +"rparen\n" +" optional_space .and ')' .and optional_space;\n" +"slash\n" +" optional_space .and '/' .and optional_space;\n" +"star\n" +" optional_space .and '*' .and optional_space;\n" +"tilda\n" +" optional_space .and '~' .and optional_space;\n" +"" diff --git a/src/mesa/shader/slang/library/slang_shader_syn.h b/src/mesa/shader/slang/library/slang_shader_syn.h index f08c329303c..ad89472ba3b 100644 --- a/src/mesa/shader/slang/library/slang_shader_syn.h +++ b/src/mesa/shader/slang/library/slang_shader_syn.h @@ -1,3 +1,6 @@ + +/* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED FROM THE .syn FILE */ + ".syntax translation_unit;\n" ".emtcode REVISION 3\n" ".emtcode EXTERNAL_NULL 0\n" diff --git a/src/mesa/shader/slang/slang_analyse.c b/src/mesa/shader/slang/slang_analyse.c index 7a38dbbcbb5..fe48a670eeb 100644 --- a/src/mesa/shader/slang/slang_analyse.c +++ b/src/mesa/shader/slang/slang_analyse.c @@ -36,8 +36,8 @@ GLboolean _slang_analyse_texture_usage (slang_program *prog) { GLuint i, count = 0; - slang_texture_usages_dtr (&prog->texture_usage); - slang_texture_usages_ctr (&prog->texture_usage); + _slang_texture_usages_dtr (&prog->texture_usage); + _slang_texture_usages_ctr (&prog->texture_usage); /* * We could do a full code analysis to find out which uniforms are actually used. diff --git a/src/mesa/shader/slang/slang_assemble.c b/src/mesa/shader/slang/slang_assemble.c index 36fb2305f68..603fd4f7f87 100644 --- a/src/mesa/shader/slang/slang_assemble.c +++ b/src/mesa/shader/slang/slang_assemble.c @@ -35,13 +35,15 @@ /* slang_assembly */ -static GLboolean slang_assembly_construct (slang_assembly *assem) +static GLboolean +slang_assembly_construct(slang_assembly * assem) { - assem->type = slang_asm_none; - return GL_TRUE; + assem->type = slang_asm_none; + return GL_TRUE; } -static GLvoid slang_assembly_destruct (slang_assembly *assem) +static GLvoid +slang_assembly_destruct(slang_assembly * assem) { } @@ -50,80 +52,89 @@ static GLvoid slang_assembly_destruct (slang_assembly *assem) */ GLvoid -_slang_assembly_file_ctr (slang_assembly_file *self) +_slang_assembly_file_ctr(slang_assembly_file * self) { self->code = NULL; self->count = 0; self->capacity = 0; } -GLvoid slang_assembly_file_destruct (slang_assembly_file *file) +GLvoid +slang_assembly_file_destruct(slang_assembly_file * file) { - GLuint i; + GLuint i; - for (i = 0; i < file->count; i++) - slang_assembly_destruct (&file->code[i]); - slang_alloc_free (file->code); + for (i = 0; i < file->count; i++) + slang_assembly_destruct(&file->code[i]); + slang_alloc_free(file->code); } -static GLboolean push_new (slang_assembly_file *file) +static GLboolean +push_new(slang_assembly_file * file) { - if (file->count == file->capacity) - { - GLuint n; - - if (file->capacity == 0) - n = 256; - else - n = file->capacity * 2; - file->code = (slang_assembly *) slang_alloc_realloc (file->code, - file->capacity * sizeof (slang_assembly), n * sizeof (slang_assembly)); - if (file->code == NULL) - return GL_FALSE; - file->capacity = n; - } - if (!slang_assembly_construct (&file->code[file->count])) - return GL_FALSE; - file->count++; - return GL_TRUE; + if (file->count == file->capacity) { + GLuint n; + + if (file->capacity == 0) + n = 256; + else + n = file->capacity * 2; + file->code = (slang_assembly *) + slang_alloc_realloc(file->code, + file->capacity * sizeof(slang_assembly), + n * sizeof(slang_assembly)); + if (file->code == NULL) + return GL_FALSE; + file->capacity = n; + } + if (!slang_assembly_construct(&file->code[file->count])) + return GL_FALSE; + file->count++; + return GL_TRUE; } -static GLboolean push_gen (slang_assembly_file *file, slang_assembly_type type, GLfloat literal, - GLuint label, GLuint size) +static GLboolean +push_gen(slang_assembly_file * file, slang_assembly_type type, + GLfloat literal, GLuint label, GLuint size) { - slang_assembly *assem; - - if (!push_new (file)) - return GL_FALSE; - assem = &file->code[file->count - 1]; - assem->type = type; - assem->literal = literal; - assem->param[0] = label; - assem->param[1] = size; - return GL_TRUE; + slang_assembly *assem; + + if (!push_new(file)) + return GL_FALSE; + assem = &file->code[file->count - 1]; + assem->type = type; + assem->literal = literal; + assem->param[0] = label; + assem->param[1] = size; + return GL_TRUE; } -GLboolean slang_assembly_file_push (slang_assembly_file *file, slang_assembly_type type) +GLboolean +slang_assembly_file_push(slang_assembly_file * file, slang_assembly_type type) { - return push_gen (file, type, (GLfloat) 0, 0, 0); + return push_gen(file, type, (GLfloat) 0, 0, 0); } -GLboolean slang_assembly_file_push_label (slang_assembly_file *file, slang_assembly_type type, - GLuint label) +GLboolean +slang_assembly_file_push_label(slang_assembly_file * file, + slang_assembly_type type, GLuint label) { - return push_gen (file, type, (GLfloat) 0, label, 0); + return push_gen(file, type, (GLfloat) 0, label, 0); } -GLboolean slang_assembly_file_push_label2 (slang_assembly_file *file, slang_assembly_type type, - GLuint label1, GLuint label2) +GLboolean +slang_assembly_file_push_label2(slang_assembly_file * file, + slang_assembly_type type, GLuint label1, + GLuint label2) { - return push_gen (file, type, (GLfloat) 0, label1, label2); + return push_gen(file, type, (GLfloat) 0, label1, label2); } -GLboolean slang_assembly_file_push_literal (slang_assembly_file *file, slang_assembly_type type, - GLfloat literal) +GLboolean +slang_assembly_file_push_literal(slang_assembly_file * file, + slang_assembly_type type, GLfloat literal) { - return push_gen (file, type, literal, 0, 0); + return push_gen(file, type, literal, 0, 0); } #define PUSH slang_assembly_file_push @@ -133,284 +144,302 @@ GLboolean slang_assembly_file_push_literal (slang_assembly_file *file, slang_ass /* slang_assembly_file_restore_point */ -GLboolean slang_assembly_file_restore_point_save (slang_assembly_file *file, - slang_assembly_file_restore_point *point) +GLboolean +slang_assembly_file_restore_point_save(slang_assembly_file * file, + slang_assembly_file_restore_point * + point) { - point->count = file->count; - return GL_TRUE; + point->count = file->count; + return GL_TRUE; } -GLboolean slang_assembly_file_restore_point_load (slang_assembly_file *file, - slang_assembly_file_restore_point *point) +GLboolean +slang_assembly_file_restore_point_load(slang_assembly_file * file, + slang_assembly_file_restore_point * + point) { - GLuint i; + GLuint i; - for (i = point->count; i < file->count; i++) - slang_assembly_destruct (&file->code[i]); - file->count = point->count; - return GL_TRUE; + for (i = point->count; i < file->count; i++) + slang_assembly_destruct(&file->code[i]); + file->count = point->count; + return GL_TRUE; } /* utility functions */ -static GLboolean sizeof_variable (slang_assemble_ctx *A, slang_type_specifier *spec, - slang_type_qualifier qual, GLuint array_len, GLuint *size) +static GLboolean +sizeof_variable(slang_assemble_ctx * A, slang_type_specifier * spec, + slang_type_qualifier qual, GLuint array_len, GLuint * size) { - slang_storage_aggregate agg; - - /* calculate the size of the variable's aggregate */ - if (!slang_storage_aggregate_construct (&agg)) - return GL_FALSE; - if (!_slang_aggregate_variable (&agg, spec, array_len, A->space.funcs, A->space.structs, - A->space.vars, A->mach, A->file, A->atoms)) - { - slang_storage_aggregate_destruct (&agg); - return GL_FALSE; - } - *size += _slang_sizeof_aggregate (&agg); - slang_storage_aggregate_destruct (&agg); - - /* for reference variables consider the additional address overhead */ - if (qual == slang_qual_out || qual == slang_qual_inout) - *size += 4; - - return GL_TRUE; + slang_storage_aggregate agg; + + /* calculate the size of the variable's aggregate */ + if (!slang_storage_aggregate_construct(&agg)) + return GL_FALSE; + if (!_slang_aggregate_variable + (&agg, spec, array_len, A->space.funcs, A->space.structs, + A->space.vars, A->mach, A->file, A->atoms)) { + slang_storage_aggregate_destruct(&agg); + return GL_FALSE; + } + *size += _slang_sizeof_aggregate(&agg); + slang_storage_aggregate_destruct(&agg); + + /* for reference variables consider the additional address overhead */ + if (qual == slang_qual_out || qual == slang_qual_inout) + *size += 4; + + return GL_TRUE; } -static GLboolean sizeof_variable2 (slang_assemble_ctx *A, slang_variable *var, GLuint *size) +static GLboolean +sizeof_variable2(slang_assemble_ctx * A, slang_variable * var, GLuint * size) { - var->address = *size; - if (var->type.qualifier == slang_qual_out || var->type.qualifier == slang_qual_inout) - var->address += 4; - return sizeof_variable (A, &var->type.specifier, var->type.qualifier, var->array_len, size); + var->address = *size; + if (var->type.qualifier == slang_qual_out + || var->type.qualifier == slang_qual_inout) + var->address += 4; + return sizeof_variable(A, &var->type.specifier, var->type.qualifier, + var->array_len, size); } -static GLboolean sizeof_variables (slang_assemble_ctx *A, slang_variable_scope *vars, GLuint start, - GLuint stop, GLuint *size) +static GLboolean +sizeof_variables(slang_assemble_ctx * A, slang_variable_scope * vars, + GLuint start, GLuint stop, GLuint * size) { - GLuint i; + GLuint i; - for (i = start; i < stop; i++) - if (!sizeof_variable2 (A, &vars->variables[i], size)) - return GL_FALSE; - return GL_TRUE; + for (i = start; i < stop; i++) + if (!sizeof_variable2(A, &vars->variables[i], size)) + return GL_FALSE; + return GL_TRUE; } -static GLboolean collect_locals (slang_assemble_ctx *A, slang_operation *op, GLuint *size) +static GLboolean +collect_locals(slang_assemble_ctx * A, slang_operation * op, GLuint * size) { - GLuint i; - - if (!sizeof_variables (A, op->locals, 0, op->locals->num_variables, size)) - return GL_FALSE; - for (i = 0; i < op->num_children; i++) - if (!collect_locals (A, &op->children[i], size)) - return GL_FALSE; - return GL_TRUE; + GLuint i; + + if (!sizeof_variables(A, op->locals, 0, op->locals->num_variables, size)) + return GL_FALSE; + for (i = 0; i < op->num_children; i++) + if (!collect_locals(A, &op->children[i], size)) + return GL_FALSE; + return GL_TRUE; } /* _slang_locate_function() */ -slang_function *_slang_locate_function (slang_function_scope *funcs, slang_atom a_name, - slang_operation *params, GLuint num_params, slang_assembly_name_space *space, - slang_atom_pool *atoms) +slang_function * +_slang_locate_function(slang_function_scope * funcs, slang_atom a_name, + slang_operation * params, GLuint num_params, + slang_assembly_name_space * space, + slang_atom_pool * atoms) { - GLuint i; - - for (i = 0; i < funcs->num_functions; i++) - { - GLuint j; - slang_function *f = &funcs->functions[i]; - - if (a_name != f->header.a_name) - continue; - if (f->param_count != num_params) - continue; - for (j = 0; j < num_params; j++) - { - slang_assembly_typeinfo ti; - - if (!slang_assembly_typeinfo_construct (&ti)) - return NULL; - if (!_slang_typeof_operation_ (¶ms[j], space, &ti, atoms)) - { - slang_assembly_typeinfo_destruct (&ti); - return NULL; - } - if (!slang_type_specifier_equal (&ti.spec, &f->parameters->variables[j].type.specifier)) - { - slang_assembly_typeinfo_destruct (&ti); - break; - } - slang_assembly_typeinfo_destruct (&ti); - - /* "out" and "inout" formal parameter requires the actual parameter to be l-value */ - if (!ti.can_be_referenced && - (f->parameters->variables[j].type.qualifier == slang_qual_out || - f->parameters->variables[j].type.qualifier == slang_qual_inout)) - break; - } - if (j == num_params) - return f; - } - if (funcs->outer_scope != NULL) - return _slang_locate_function (funcs->outer_scope, a_name, params, num_params, space, atoms); - return NULL; + GLuint i; + + for (i = 0; i < funcs->num_functions; i++) { + GLuint j; + slang_function *f = &funcs->functions[i]; + + if (a_name != f->header.a_name) + continue; + if (f->param_count != num_params) + continue; + for (j = 0; j < num_params; j++) { + slang_assembly_typeinfo ti; + + if (!slang_assembly_typeinfo_construct(&ti)) + return NULL; + if (!_slang_typeof_operation_(¶ms[j], space, &ti, atoms)) { + slang_assembly_typeinfo_destruct(&ti); + return NULL; + } + if (!slang_type_specifier_equal + (&ti.spec, &f->parameters->variables[j].type.specifier)) { + slang_assembly_typeinfo_destruct(&ti); + break; + } + slang_assembly_typeinfo_destruct(&ti); + + /* "out" and "inout" formal parameter requires the actual parameter to be l-value */ + if (!ti.can_be_referenced && + (f->parameters->variables[j].type.qualifier == slang_qual_out || + f->parameters->variables[j].type.qualifier == slang_qual_inout)) + break; + } + if (j == num_params) + return f; + } + if (funcs->outer_scope != NULL) + return _slang_locate_function(funcs->outer_scope, a_name, params, + num_params, space, atoms); + return NULL; } /* _slang_assemble_function() */ -GLboolean _slang_assemble_function (slang_assemble_ctx *A, slang_function *fun) +GLboolean +_slang_assemble_function(slang_assemble_ctx * A, slang_function * fun) { - GLuint param_size, local_size; - GLuint skip, cleanup; - - fun->address = A->file->count; - - if (fun->body == NULL) - { - /* jump to the actual function body - we do not know it, so add the instruction - * to fixup table */ - fun->fixups.table = (GLuint *) slang_alloc_realloc (fun->fixups.table, - fun->fixups.count * sizeof (GLuint), (fun->fixups.count + 1) * sizeof (GLuint)); - if (fun->fixups.table == NULL) - return GL_FALSE; - fun->fixups.table[fun->fixups.count] = fun->address; - fun->fixups.count++; - if (!PUSH (A->file, slang_asm_jump)) - return GL_FALSE; - return GL_TRUE; - } - else - { - GLuint i; - - /* resolve all fixup table entries and delete it */ - for (i = 0; i < fun->fixups.count; i++) - A->file->code[fun->fixups.table[i]].param[0] = fun->address; - slang_fixup_table_free (&fun->fixups); - } - - /* At this point traverse function formal parameters and code to calculate - * total memory size to be allocated on the stack. - * During this process the variables will be assigned local addresses to - * reference them in the code. - * No storage optimizations are performed so exclusive scopes are not detected and shared. */ - - /* calculate return value size */ - param_size = 0; - if (fun->header.type.specifier.type != slang_spec_void) - if (!sizeof_variable (A, &fun->header.type.specifier, slang_qual_none, 0, ¶m_size)) - return GL_FALSE; - A->local.ret_size = param_size; - - /* calculate formal parameter list size */ - if (!sizeof_variables (A, fun->parameters, 0, fun->param_count, ¶m_size)) - return GL_FALSE; - - /* calculate local variables size - take into account the four-byte return address and - * temporaries for various tasks (4 for addr and 16 for swizzle temporaries). - * these include variables from the formal parameter scope and from the code */ - A->local.addr_tmp = param_size + 4; - A->local.swizzle_tmp = param_size + 4 + 4; - local_size = param_size + 4 + 4 + 16; - if (!sizeof_variables (A, fun->parameters, fun->param_count, fun->parameters->num_variables, - &local_size)) - return GL_FALSE; - if (!collect_locals (A, fun->body, &local_size)) - return GL_FALSE; - - /* allocate local variable storage */ - if (!PLAB (A->file, slang_asm_local_alloc, local_size - param_size - 4)) - return GL_FALSE; - - /* mark a new frame for function variable storage */ - if (!PLAB (A->file, slang_asm_enter, local_size)) - return GL_FALSE; - - /* jump directly to the actual code */ - skip = A->file->count; - if (!push_new (A->file)) - return GL_FALSE; - A->file->code[skip].type = slang_asm_jump; - - /* all "return" statements will be directed here */ - A->flow.function_end = A->file->count; - cleanup = A->file->count; - if (!push_new (A->file)) - return GL_FALSE; - A->file->code[cleanup].type = slang_asm_jump; - - /* execute the function body */ - A->file->code[skip].param[0] = A->file->count; - if (!_slang_assemble_operation (A, fun->body, /*slang_ref_freelance*/slang_ref_forbid)) - return GL_FALSE; - - /* this is the end of the function - restore the old function frame */ - A->file->code[cleanup].param[0] = A->file->count; - if (!PUSH (A->file, slang_asm_leave)) - return GL_FALSE; - - /* free local variable storage */ - if (!PLAB (A->file, slang_asm_local_free, local_size - param_size - 4)) - return GL_FALSE; - - /* return from the function */ - if (!PUSH (A->file, slang_asm_return)) - return GL_FALSE; - - return GL_TRUE; + GLuint param_size, local_size; + GLuint skip, cleanup; + + fun->address = A->file->count; + + if (fun->body == NULL) { + /* jump to the actual function body - we do not know it, so add the instruction + * to fixup table */ + fun->fixups.table = (GLuint *) + slang_alloc_realloc(fun->fixups.table, + fun->fixups.count * sizeof(GLuint), + (fun->fixups.count + 1) * sizeof(GLuint)); + if (fun->fixups.table == NULL) + return GL_FALSE; + fun->fixups.table[fun->fixups.count] = fun->address; + fun->fixups.count++; + if (!PUSH(A->file, slang_asm_jump)) + return GL_FALSE; + return GL_TRUE; + } + else { + GLuint i; + + /* resolve all fixup table entries and delete it */ + for (i = 0; i < fun->fixups.count; i++) + A->file->code[fun->fixups.table[i]].param[0] = fun->address; + slang_fixup_table_free(&fun->fixups); + } + + /* At this point traverse function formal parameters and code to calculate + * total memory size to be allocated on the stack. + * During this process the variables will be assigned local addresses to + * reference them in the code. + * No storage optimizations are performed so exclusive scopes are not + * detected and shared. + */ + + /* calculate return value size */ + param_size = 0; + if (fun->header.type.specifier.type != slang_spec_void) + if (!sizeof_variable + (A, &fun->header.type.specifier, slang_qual_none, 0, ¶m_size)) + return GL_FALSE; + A->local.ret_size = param_size; + + /* calculate formal parameter list size */ + if (!sizeof_variables + (A, fun->parameters, 0, fun->param_count, ¶m_size)) + return GL_FALSE; + + /* calculate local variables size - take into account the four-byte + * return address and temporaries for various tasks (4 for addr and + * 16 for swizzle temporaries). these include variables from the + * formal parameter scope and from the code + */ + A->local.addr_tmp = param_size + 4; + A->local.swizzle_tmp = param_size + 4 + 4; + local_size = param_size + 4 + 4 + 16; + if (!sizeof_variables + (A, fun->parameters, fun->param_count, fun->parameters->num_variables, + &local_size)) + return GL_FALSE; + if (!collect_locals(A, fun->body, &local_size)) + return GL_FALSE; + + /* allocate local variable storage */ + if (!PLAB(A->file, slang_asm_local_alloc, local_size - param_size - 4)) + return GL_FALSE; + + /* mark a new frame for function variable storage */ + if (!PLAB(A->file, slang_asm_enter, local_size)) + return GL_FALSE; + + /* jump directly to the actual code */ + skip = A->file->count; + if (!push_new(A->file)) + return GL_FALSE; + A->file->code[skip].type = slang_asm_jump; + + /* all "return" statements will be directed here */ + A->flow.function_end = A->file->count; + cleanup = A->file->count; + if (!push_new(A->file)) + return GL_FALSE; + A->file->code[cleanup].type = slang_asm_jump; + + /* execute the function body */ + A->file->code[skip].param[0] = A->file->count; + if (!_slang_assemble_operation + (A, fun->body, /*slang_ref_freelance */ slang_ref_forbid)) + return GL_FALSE; + + /* this is the end of the function - restore the old function frame */ + A->file->code[cleanup].param[0] = A->file->count; + if (!PUSH(A->file, slang_asm_leave)) + return GL_FALSE; + + /* free local variable storage */ + if (!PLAB(A->file, slang_asm_local_free, local_size - param_size - 4)) + return GL_FALSE; + + /* return from the function */ + if (!PUSH(A->file, slang_asm_return)) + return GL_FALSE; + + return GL_TRUE; } -GLboolean _slang_cleanup_stack (slang_assemble_ctx *A, slang_operation *op) +GLboolean +_slang_cleanup_stack(slang_assemble_ctx * A, slang_operation * op) { - slang_assembly_typeinfo ti; - GLuint size = 0; - - /* get type info of the operation and calculate its size */ - if (!slang_assembly_typeinfo_construct (&ti)) - return GL_FALSE; - if (!_slang_typeof_operation (A, op, &ti)) - { - slang_assembly_typeinfo_destruct (&ti); - return GL_FALSE; - } - if (ti.spec.type != slang_spec_void) { - if (A->ref == slang_ref_force) { - size = 4; - } - else if (!sizeof_variable (A, &ti.spec, slang_qual_none, 0, &size)) - { - slang_assembly_typeinfo_destruct (&ti); - return GL_FALSE; - } - } - slang_assembly_typeinfo_destruct (&ti); - - /* if nonzero, free it from the stack */ - if (size != 0) - { - if (!PLAB (A->file, slang_asm_local_free, size)) - return GL_FALSE; - } - - return GL_TRUE; + slang_assembly_typeinfo ti; + GLuint size = 0; + + /* get type info of the operation and calculate its size */ + if (!slang_assembly_typeinfo_construct(&ti)) + return GL_FALSE; + if (!_slang_typeof_operation(A, op, &ti)) { + slang_assembly_typeinfo_destruct(&ti); + return GL_FALSE; + } + if (ti.spec.type != slang_spec_void) { + if (A->ref == slang_ref_force) { + size = 4; + } + else if (!sizeof_variable(A, &ti.spec, slang_qual_none, 0, &size)) { + slang_assembly_typeinfo_destruct(&ti); + return GL_FALSE; + } + } + slang_assembly_typeinfo_destruct(&ti); + + /* if nonzero, free it from the stack */ + if (size != 0) { + if (!PLAB(A->file, slang_asm_local_free, size)) + return GL_FALSE; + } + + return GL_TRUE; } /* _slang_assemble_operation() */ static GLboolean -dereference_basic (slang_assemble_ctx *A, slang_storage_type type, GLuint *size, slang_swizzle *swz, - GLboolean is_swizzled) +dereference_basic(slang_assemble_ctx * A, slang_storage_type type, + GLuint * size, slang_swizzle * swz, GLboolean is_swizzled) { GLuint src_offset; slang_assembly_type ty; - *size -= _slang_sizeof_type (type); + *size -= _slang_sizeof_type(type); - /* If swizzling is taking place, we are forced to use scalar operations, even if we have - * vec4 instructions enabled (this should be actually done with special vec4 shuffle - * instructions). - * Adjust the size and calculate the offset within source variable to read. + /* If swizzling is taking place, we are forced to use scalar + * operations, even if we have vec4 instructions enabled (this + * should be actually done with special vec4 shuffle instructions). + * Adjust the size and calculate the offset within source variable + * to read. */ if (is_swizzled) src_offset = swz->swizzle[*size / 4] * 4; @@ -418,14 +447,14 @@ dereference_basic (slang_assemble_ctx *A, slang_storage_type type, GLuint *size, src_offset = *size; /* dereference data slot of a basic type */ - if (!PLAB2 (A->file, slang_asm_local_addr, A->local.addr_tmp, 4)) + if (!PLAB2(A->file, slang_asm_local_addr, A->local.addr_tmp, 4)) return GL_FALSE; - if (!PUSH (A->file, slang_asm_addr_deref)) + if (!PUSH(A->file, slang_asm_addr_deref)) return GL_FALSE; if (src_offset != 0) { - if (!PLAB (A->file, slang_asm_addr_push, src_offset)) + if (!PLAB(A->file, slang_asm_addr_push, src_offset)) return GL_FALSE; - if (!PUSH (A->file, slang_asm_addr_add)) + if (!PUSH(A->file, slang_asm_addr_add)) return GL_FALSE; } @@ -449,12 +478,13 @@ dereference_basic (slang_assemble_ctx *A, slang_storage_type type, GLuint *size, ty = slang_asm_none; } - return PUSH (A->file, ty); + return PUSH(A->file, ty); } static GLboolean -dereference_aggregate (slang_assemble_ctx *A, const slang_storage_aggregate *agg, GLuint *size, - slang_swizzle *swz, GLboolean is_swizzled) +dereference_aggregate(slang_assemble_ctx * A, + const slang_storage_aggregate * agg, GLuint * size, + slang_swizzle * swz, GLboolean is_swizzled) { GLuint i; @@ -464,22 +494,27 @@ dereference_aggregate (slang_assemble_ctx *A, const slang_storage_aggregate *agg for (j = arr->length; j > 0; j--) { if (arr->type == slang_stor_aggregate) { - if (!dereference_aggregate (A, arr->aggregate, size, swz, is_swizzled)) + if (!dereference_aggregate + (A, arr->aggregate, size, swz, is_swizzled)) return GL_FALSE; } else { if (is_swizzled && arr->type == slang_stor_vec4) { - if (!dereference_basic (A, slang_stor_float, size, swz, is_swizzled)) + if (!dereference_basic + (A, slang_stor_float, size, swz, is_swizzled)) return GL_FALSE; - if (!dereference_basic (A, slang_stor_float, size, swz, is_swizzled)) + if (!dereference_basic + (A, slang_stor_float, size, swz, is_swizzled)) return GL_FALSE; - if (!dereference_basic (A, slang_stor_float, size, swz, is_swizzled)) + if (!dereference_basic + (A, slang_stor_float, size, swz, is_swizzled)) return GL_FALSE; - if (!dereference_basic (A, slang_stor_float, size, swz, is_swizzled)) + if (!dereference_basic + (A, slang_stor_float, size, swz, is_swizzled)) return GL_FALSE; } else { - if (!dereference_basic (A, arr->type, size, swz, is_swizzled)) + if (!dereference_basic(A, arr->type, size, swz, is_swizzled)) return GL_FALSE; } } @@ -489,235 +524,240 @@ dereference_aggregate (slang_assemble_ctx *A, const slang_storage_aggregate *agg return GL_TRUE; } -GLboolean _slang_dereference (slang_assemble_ctx *A, slang_operation *op) +GLboolean +_slang_dereference(slang_assemble_ctx * A, slang_operation * op) { - slang_assembly_typeinfo ti; - GLboolean result = GL_FALSE; - slang_storage_aggregate agg; - GLuint size; - - /* get type information of the given operation */ - if (!slang_assembly_typeinfo_construct (&ti)) - return GL_FALSE; - if (!_slang_typeof_operation (A, op, &ti)) - goto end1; - - /* construct aggregate from the type info */ - if (!slang_storage_aggregate_construct (&agg)) - goto end1; - if (!_slang_aggregate_variable (&agg, &ti.spec, ti.array_len, A->space.funcs, A->space.structs, - A->space.vars, A->mach, A->file, A->atoms)) - goto end; - - /* dereference the resulting aggregate */ - size = _slang_sizeof_aggregate (&agg); - result = dereference_aggregate (A, &agg, &size, &ti.swz, ti.is_swizzled); - -end: - slang_storage_aggregate_destruct (&agg); -end1: - slang_assembly_typeinfo_destruct (&ti); - return result; + slang_assembly_typeinfo ti; + GLboolean result = GL_FALSE; + slang_storage_aggregate agg; + GLuint size; + + /* get type information of the given operation */ + if (!slang_assembly_typeinfo_construct(&ti)) + return GL_FALSE; + if (!_slang_typeof_operation(A, op, &ti)) + goto end1; + + /* construct aggregate from the type info */ + if (!slang_storage_aggregate_construct(&agg)) + goto end1; + if (!_slang_aggregate_variable + (&agg, &ti.spec, ti.array_len, A->space.funcs, A->space.structs, + A->space.vars, A->mach, A->file, A->atoms)) + goto end; + + /* dereference the resulting aggregate */ + size = _slang_sizeof_aggregate(&agg); + result = dereference_aggregate(A, &agg, &size, &ti.swz, ti.is_swizzled); + + end: + slang_storage_aggregate_destruct(&agg); + end1: + slang_assembly_typeinfo_destruct(&ti); + return result; } -GLboolean _slang_assemble_function_call (slang_assemble_ctx *A, slang_function *fun, - slang_operation *params, GLuint param_count, GLboolean assignment) +GLboolean +_slang_assemble_function_call(slang_assemble_ctx * A, slang_function * fun, + slang_operation * params, GLuint param_count, + GLboolean assignment) { - GLuint i; - slang_swizzle p_swz[64]; - slang_ref_type p_ref[64]; - - /* TODO: fix this, allocate dynamically */ - if (param_count > 64) - return GL_FALSE; - - /* make room for the return value, if any */ - if (fun->header.type.specifier.type != slang_spec_void) - { - GLuint ret_size = 0; - - if (!sizeof_variable (A, &fun->header.type.specifier, slang_qual_none, 0, &ret_size)) - return GL_FALSE; - if (!PLAB (A->file, slang_asm_local_alloc, ret_size)) - return GL_FALSE; - } - - /* push the actual parameters on the stack */ - for (i = 0; i < param_count; i++) - { - if (fun->parameters->variables[i].type.qualifier == slang_qual_inout || - fun->parameters->variables[i].type.qualifier == slang_qual_out) - { - if (!PLAB2 (A->file, slang_asm_local_addr, A->local.addr_tmp, 4)) - return GL_FALSE; - /* TODO: optimize the "out" parameter case */ - if (!_slang_assemble_operation (A, ¶ms[i], slang_ref_force)) - return GL_FALSE; - p_swz[i] = A->swz; - p_ref[i] = A->ref; - if (!PUSH (A->file, slang_asm_addr_copy)) - return GL_FALSE; - if (!PUSH (A->file, slang_asm_addr_deref)) - return GL_FALSE; - if (i == 0 && assignment) - { - /* duplicate the resulting address */ - if (!PLAB2 (A->file, slang_asm_local_addr, A->local.addr_tmp, 4)) - return GL_FALSE; - if (!PUSH (A->file, slang_asm_addr_deref)) - return GL_FALSE; - } - if (!_slang_dereference (A, ¶ms[i])) - return GL_FALSE; - } - else - { - if (!_slang_assemble_operation (A, ¶ms[i], slang_ref_forbid)) - return GL_FALSE; - p_swz[i] = A->swz; - p_ref[i] = A->ref; - } - } - - /* call the function */ - if (!PLAB (A->file, slang_asm_call, fun->address)) - return GL_FALSE; - - /* pop the parameters from the stack */ - for (i = param_count; i > 0; i--) - { - GLuint j = i - 1; - - A->swz = p_swz[j]; - A->ref = p_ref[j]; - if (fun->parameters->variables[j].type.qualifier == slang_qual_inout || - fun->parameters->variables[j].type.qualifier == slang_qual_out) - { - /* for output parameter copy the contents of the formal parameter - * back to the original actual parameter */ - if (!_slang_assemble_assignment (A, ¶ms[j])) - return GL_FALSE; - /* pop the actual parameter's address */ - if (!PLAB (A->file, slang_asm_local_free, 4)) - return GL_FALSE; - } - else - { - /* pop the value of the parameter */ - if (!_slang_cleanup_stack (A, ¶ms[j])) - return GL_FALSE; - } - } - - return GL_TRUE; + GLuint i; + slang_swizzle p_swz[64]; + slang_ref_type p_ref[64]; + + /* TODO: fix this, allocate dynamically */ + if (param_count > 64) + return GL_FALSE; + + /* make room for the return value, if any */ + if (fun->header.type.specifier.type != slang_spec_void) { + GLuint ret_size = 0; + + if (!sizeof_variable + (A, &fun->header.type.specifier, slang_qual_none, 0, &ret_size)) + return GL_FALSE; + if (!PLAB(A->file, slang_asm_local_alloc, ret_size)) + return GL_FALSE; + } + + /* push the actual parameters on the stack */ + for (i = 0; i < param_count; i++) { + if (fun->parameters->variables[i].type.qualifier == slang_qual_inout || + fun->parameters->variables[i].type.qualifier == slang_qual_out) { + if (!PLAB2(A->file, slang_asm_local_addr, A->local.addr_tmp, 4)) + return GL_FALSE; + /* TODO: optimize the "out" parameter case */ + if (!_slang_assemble_operation(A, ¶ms[i], slang_ref_force)) + return GL_FALSE; + p_swz[i] = A->swz; + p_ref[i] = A->ref; + if (!PUSH(A->file, slang_asm_addr_copy)) + return GL_FALSE; + if (!PUSH(A->file, slang_asm_addr_deref)) + return GL_FALSE; + if (i == 0 && assignment) { + /* duplicate the resulting address */ + if (!PLAB2(A->file, slang_asm_local_addr, A->local.addr_tmp, 4)) + return GL_FALSE; + if (!PUSH(A->file, slang_asm_addr_deref)) + return GL_FALSE; + } + if (!_slang_dereference(A, ¶ms[i])) + return GL_FALSE; + } + else { + if (!_slang_assemble_operation(A, ¶ms[i], slang_ref_forbid)) + return GL_FALSE; + p_swz[i] = A->swz; + p_ref[i] = A->ref; + } + } + + /* call the function */ + if (!PLAB(A->file, slang_asm_call, fun->address)) + return GL_FALSE; + + /* pop the parameters from the stack */ + for (i = param_count; i > 0; i--) { + GLuint j = i - 1; + + A->swz = p_swz[j]; + A->ref = p_ref[j]; + if (fun->parameters->variables[j].type.qualifier == slang_qual_inout || + fun->parameters->variables[j].type.qualifier == slang_qual_out) { + /* for output parameter copy the contents of the formal parameter + * back to the original actual parameter + */ + if (!_slang_assemble_assignment(A, ¶ms[j])) + return GL_FALSE; + /* pop the actual parameter's address */ + if (!PLAB(A->file, slang_asm_local_free, 4)) + return GL_FALSE; + } + else { + /* pop the value of the parameter */ + if (!_slang_cleanup_stack(A, ¶ms[j])) + return GL_FALSE; + } + } + + return GL_TRUE; } -GLboolean _slang_assemble_function_call_name (slang_assemble_ctx *A, const char *name, - slang_operation *params, GLuint param_count, GLboolean assignment) +GLboolean +_slang_assemble_function_call_name(slang_assemble_ctx * A, const char *name, + slang_operation * params, + GLuint param_count, GLboolean assignment) { - slang_atom atom; - slang_function *fun; - - atom = slang_atom_pool_atom (A->atoms, name); - if (atom == SLANG_ATOM_NULL) - return GL_FALSE; - fun = _slang_locate_function (A->space.funcs, atom, params, param_count, &A->space, A->atoms); - if (fun == NULL) - return GL_FALSE; - return _slang_assemble_function_call (A, fun, params, param_count, assignment); + slang_atom atom; + slang_function *fun; + + atom = slang_atom_pool_atom(A->atoms, name); + if (atom == SLANG_ATOM_NULL) + return GL_FALSE; + fun = + _slang_locate_function(A->space.funcs, atom, params, param_count, + &A->space, A->atoms); + if (fun == NULL) + return GL_FALSE; + return _slang_assemble_function_call(A, fun, params, param_count, + assignment); } -static GLboolean assemble_function_call_name_dummyint (slang_assemble_ctx *A, const char *name, - slang_operation *params) +static GLboolean +assemble_function_call_name_dummyint(slang_assemble_ctx * A, const char *name, + slang_operation * params) { - slang_operation p[2]; - GLboolean result; - - p[0] = params[0]; - if (!slang_operation_construct (&p[1])) - return GL_FALSE; - p[1].type = slang_oper_literal_int; - result = _slang_assemble_function_call_name (A, name, p, 2, GL_FALSE); - slang_operation_destruct (&p[1]); - return result; + slang_operation p[2]; + GLboolean result; + + p[0] = params[0]; + if (!slang_operation_construct(&p[1])) + return GL_FALSE; + p[1].type = slang_oper_literal_int; + result = _slang_assemble_function_call_name(A, name, p, 2, GL_FALSE); + slang_operation_destruct(&p[1]); + return result; } static const struct { - const char *name; - slang_assembly_type code1, code2; + const char *name; + slang_assembly_type code1, code2; } inst[] = { - /* core */ - { "float_add", slang_asm_float_add, slang_asm_float_copy }, - { "float_multiply", slang_asm_float_multiply, slang_asm_float_copy }, - { "float_divide", slang_asm_float_divide, slang_asm_float_copy }, - { "float_negate", slang_asm_float_negate, slang_asm_float_copy }, - { "float_less", slang_asm_float_less, slang_asm_bool_copy }, - { "float_equal", slang_asm_float_equal_exp,slang_asm_bool_copy }, - { "float_to_int", slang_asm_float_to_int, slang_asm_int_copy }, - { "float_sine", slang_asm_float_sine, slang_asm_float_copy }, - { "float_arcsine", slang_asm_float_arcsine, slang_asm_float_copy }, - { "float_arctan", slang_asm_float_arctan, slang_asm_float_copy }, - { "float_power", slang_asm_float_power, slang_asm_float_copy }, - { "float_log2", slang_asm_float_log2, slang_asm_float_copy }, - { "float_floor", slang_asm_float_floor, slang_asm_float_copy }, - { "float_ceil", slang_asm_float_ceil, slang_asm_float_copy }, - { "float_noise1", slang_asm_float_noise1, slang_asm_float_copy }, - { "float_noise2", slang_asm_float_noise2, slang_asm_float_copy }, - { "float_noise3", slang_asm_float_noise3, slang_asm_float_copy }, - { "float_noise4", slang_asm_float_noise4, slang_asm_float_copy }, - { "int_to_float", slang_asm_int_to_float, slang_asm_float_copy }, - { "vec4_tex1d", slang_asm_vec4_tex1d, slang_asm_none }, - { "vec4_tex2d", slang_asm_vec4_tex2d, slang_asm_none }, - { "vec4_tex3d", slang_asm_vec4_tex3d, slang_asm_none }, - { "vec4_texcube", slang_asm_vec4_texcube, slang_asm_none }, - { "vec4_shad1d", slang_asm_vec4_shad1d, slang_asm_none }, - { "vec4_shad2d", slang_asm_vec4_shad2d, slang_asm_none }, - /* GL_MESA_shader_debug */ - { "float_print", slang_asm_float_deref, slang_asm_float_print }, - { "int_print", slang_asm_int_deref, slang_asm_int_print }, - { "bool_print", slang_asm_bool_deref, slang_asm_bool_print }, + /* core */ + {"float_add", slang_asm_float_add, slang_asm_float_copy}, + {"float_multiply", slang_asm_float_multiply, slang_asm_float_copy}, + {"float_divide", slang_asm_float_divide, slang_asm_float_copy}, + {"float_negate", slang_asm_float_negate, slang_asm_float_copy}, + {"float_less", slang_asm_float_less, slang_asm_bool_copy}, + {"float_equal", slang_asm_float_equal_exp, slang_asm_bool_copy}, + {"float_to_int", slang_asm_float_to_int, slang_asm_int_copy}, + {"float_sine", slang_asm_float_sine, slang_asm_float_copy}, + {"float_arcsine", slang_asm_float_arcsine, slang_asm_float_copy}, + {"float_arctan", slang_asm_float_arctan, slang_asm_float_copy}, + {"float_power", slang_asm_float_power, slang_asm_float_copy}, + {"float_log2", slang_asm_float_log2, slang_asm_float_copy}, + {"float_floor", slang_asm_float_floor, slang_asm_float_copy}, + {"float_ceil", slang_asm_float_ceil, slang_asm_float_copy}, + {"float_noise1", slang_asm_float_noise1, slang_asm_float_copy}, + {"float_noise2", slang_asm_float_noise2, slang_asm_float_copy}, + {"float_noise3", slang_asm_float_noise3, slang_asm_float_copy}, + {"float_noise4", slang_asm_float_noise4, slang_asm_float_copy}, + {"int_to_float", slang_asm_int_to_float, slang_asm_float_copy}, + {"vec4_tex1d", slang_asm_vec4_tex1d, slang_asm_none}, + {"vec4_tex2d", slang_asm_vec4_tex2d, slang_asm_none}, + {"vec4_tex3d", slang_asm_vec4_tex3d, slang_asm_none}, + {"vec4_texcube", slang_asm_vec4_texcube, slang_asm_none}, + {"vec4_shad1d", slang_asm_vec4_shad1d, slang_asm_none}, + {"vec4_shad2d", slang_asm_vec4_shad2d, slang_asm_none}, + /* GL_MESA_shader_debug */ + {"float_print", slang_asm_float_deref, slang_asm_float_print}, + {"int_print", slang_asm_int_deref, slang_asm_int_print}, + {"bool_print", slang_asm_bool_deref, slang_asm_bool_print}, /* vec4 */ - { "float_to_vec4", slang_asm_float_to_vec4, slang_asm_none }, - { "vec4_add", slang_asm_vec4_add, slang_asm_none }, - { "vec4_subtract", slang_asm_vec4_subtract, slang_asm_none }, - { "vec4_multiply", slang_asm_vec4_multiply, slang_asm_none }, - { "vec4_divide", slang_asm_vec4_divide, slang_asm_none }, - { "vec4_negate", slang_asm_vec4_negate, slang_asm_none }, - { "vec4_dot", slang_asm_vec4_dot, slang_asm_none }, - - { NULL, slang_asm_none, slang_asm_none } + {"float_to_vec4", slang_asm_float_to_vec4, slang_asm_none}, + {"vec4_add", slang_asm_vec4_add, slang_asm_none}, + {"vec4_subtract", slang_asm_vec4_subtract, slang_asm_none}, + {"vec4_multiply", slang_asm_vec4_multiply, slang_asm_none}, + {"vec4_divide", slang_asm_vec4_divide, slang_asm_none}, + {"vec4_negate", slang_asm_vec4_negate, slang_asm_none}, + {"vec4_dot", slang_asm_vec4_dot, slang_asm_none}, + {NULL, slang_asm_none, slang_asm_none} }; -static GLboolean call_asm_instruction (slang_assemble_ctx *A, slang_atom a_name) +static GLboolean +call_asm_instruction(slang_assemble_ctx * A, slang_atom a_name) { - const char *id; - GLuint i; + const char *id; + GLuint i; - id = slang_atom_pool_id (A->atoms, a_name); + id = slang_atom_pool_id(A->atoms, a_name); - for (i = 0; inst[i].name != NULL; i++) - if (slang_string_compare (id, inst[i].name) == 0) - break; - if (inst[i].name == NULL) - return GL_FALSE; + for (i = 0; inst[i].name != NULL; i++) + if (slang_string_compare(id, inst[i].name) == 0) + break; + if (inst[i].name == NULL) + return GL_FALSE; - if (!PLAB2 (A->file, inst[i].code1, 4, 0)) - return GL_FALSE; - if (inst[i].code2 != slang_asm_none) - if (!PLAB2 (A->file, inst[i].code2, 4, 0)) - return GL_FALSE; + if (!PLAB2(A->file, inst[i].code1, 4, 0)) + return GL_FALSE; + if (inst[i].code2 != slang_asm_none) + if (!PLAB2(A->file, inst[i].code2, 4, 0)) + return GL_FALSE; - /* clean-up the stack from the remaining dst address */ - if (!PLAB (A->file, slang_asm_local_free, 4)) - return GL_FALSE; + /* clean-up the stack from the remaining dst address */ + if (!PLAB(A->file, slang_asm_local_free, 4)) + return GL_FALSE; - return GL_TRUE; + return GL_TRUE; } static GLboolean -equality_aggregate (slang_assemble_ctx *A, const slang_storage_aggregate *agg, GLuint *index, - GLuint size, GLuint z_label) +equality_aggregate(slang_assemble_ctx * A, + const slang_storage_aggregate * agg, GLuint * index, + GLuint size, GLuint z_label) { GLuint i; @@ -727,22 +767,25 @@ equality_aggregate (slang_assemble_ctx *A, const slang_storage_aggregate *agg, G for (j = 0; j < arr->length; j++) { if (arr->type == slang_stor_aggregate) { - if (!equality_aggregate (A, arr->aggregate, index, size, z_label)) + if (!equality_aggregate(A, arr->aggregate, index, size, z_label)) return GL_FALSE; } else { #if defined(USE_X86_ASM) || defined(SLANG_X86) if (arr->type == slang_stor_vec4) { - if (!PLAB2 (A->file, slang_asm_vec4_equal_int, size + *index, *index)) + if (!PLAB2 + (A->file, slang_asm_vec4_equal_int, size + *index, *index)) return GL_FALSE; } else #endif - if (!PLAB2 (A->file, slang_asm_float_equal_int, size + *index, *index)) - return GL_FALSE; + if (!PLAB2 + (A->file, slang_asm_float_equal_int, size + *index, + *index)) + return GL_FALSE; - *index += _slang_sizeof_type (arr->type); - if (!PLAB (A->file, slang_asm_jump_if_zero, z_label)) + *index += _slang_sizeof_type(arr->type); + if (!PLAB(A->file, slang_asm_jump_if_zero, z_label)) return GL_FALSE; } } @@ -751,753 +794,755 @@ equality_aggregate (slang_assemble_ctx *A, const slang_storage_aggregate *agg, G return GL_TRUE; } -static GLboolean equality (slang_assemble_ctx *A, slang_operation *op, GLboolean equal) +static GLboolean +equality(slang_assemble_ctx * A, slang_operation * op, GLboolean equal) { - slang_assembly_typeinfo ti; - GLboolean result = GL_FALSE; - slang_storage_aggregate agg; - GLuint index, size; - GLuint skip_jump, true_label, true_jump, false_label, false_jump; - - /* get type of operation */ - if (!slang_assembly_typeinfo_construct (&ti)) - return GL_FALSE; - if (!_slang_typeof_operation (A, op, &ti)) - goto end1; - - /* convert it to an aggregate */ - if (!slang_storage_aggregate_construct (&agg)) - goto end1; - if (!_slang_aggregate_variable (&agg, &ti.spec, 0, A->space.funcs, A->space.structs, - A->space.vars, A->mach, A->file, A->atoms)) - goto end; - - /* compute the size of the agregate - there are two such aggregates on the stack */ - size = _slang_sizeof_aggregate (&agg); - - /* jump to the actual data-comparison code */ - skip_jump = A->file->count; - if (!PUSH (A->file, slang_asm_jump)) - goto end; - - /* pop off the stack the compared data and push 1 */ - true_label = A->file->count; - if (!PLAB (A->file, slang_asm_local_free, size * 2)) - goto end; - if (!PLIT (A->file, slang_asm_bool_push, (GLfloat) 1)) - goto end; - true_jump = A->file->count; - if (!PUSH (A->file, slang_asm_jump)) - goto end; - - false_label = A->file->count; - if (!PLAB (A->file, slang_asm_local_free, size * 2)) - goto end; - if (!PLIT (A->file, slang_asm_bool_push, (GLfloat) 0)) - goto end; - false_jump = A->file->count; - if (!PUSH (A->file, slang_asm_jump)) - goto end; - - A->file->code[skip_jump].param[0] = A->file->count; - - /* compare the data on stack, it will eventually jump either to true or false label */ - index = 0; - if (!equality_aggregate (A, &agg, &index, size, equal ? false_label : true_label)) - goto end; - if (!PLAB (A->file, slang_asm_jump, equal ? true_label : false_label)) - goto end; - - A->file->code[true_jump].param[0] = A->file->count; - A->file->code[false_jump].param[0] = A->file->count; - - result = GL_TRUE; -end: - slang_storage_aggregate_destruct (&agg); -end1: - slang_assembly_typeinfo_destruct (&ti); - return result; + slang_assembly_typeinfo ti; + GLboolean result = GL_FALSE; + slang_storage_aggregate agg; + GLuint index, size; + GLuint skip_jump, true_label, true_jump, false_label, false_jump; + + /* get type of operation */ + if (!slang_assembly_typeinfo_construct(&ti)) + return GL_FALSE; + if (!_slang_typeof_operation(A, op, &ti)) + goto end1; + + /* convert it to an aggregate */ + if (!slang_storage_aggregate_construct(&agg)) + goto end1; + if (!_slang_aggregate_variable + (&agg, &ti.spec, 0, A->space.funcs, A->space.structs, A->space.vars, + A->mach, A->file, A->atoms)) + goto end; + + /* compute the size of the agregate - there are two such aggregates on the stack */ + size = _slang_sizeof_aggregate(&agg); + + /* jump to the actual data-comparison code */ + skip_jump = A->file->count; + if (!PUSH(A->file, slang_asm_jump)) + goto end; + + /* pop off the stack the compared data and push 1 */ + true_label = A->file->count; + if (!PLAB(A->file, slang_asm_local_free, size * 2)) + goto end; + if (!PLIT(A->file, slang_asm_bool_push, (GLfloat) 1)) + goto end; + true_jump = A->file->count; + if (!PUSH(A->file, slang_asm_jump)) + goto end; + + false_label = A->file->count; + if (!PLAB(A->file, slang_asm_local_free, size * 2)) + goto end; + if (!PLIT(A->file, slang_asm_bool_push, (GLfloat) 0)) + goto end; + false_jump = A->file->count; + if (!PUSH(A->file, slang_asm_jump)) + goto end; + + A->file->code[skip_jump].param[0] = A->file->count; + + /* compare the data on stack, it will eventually jump either to true or false label */ + index = 0; + if (!equality_aggregate + (A, &agg, &index, size, equal ? false_label : true_label)) + goto end; + if (!PLAB(A->file, slang_asm_jump, equal ? true_label : false_label)) + goto end; + + A->file->code[true_jump].param[0] = A->file->count; + A->file->code[false_jump].param[0] = A->file->count; + + result = GL_TRUE; + end: + slang_storage_aggregate_destruct(&agg); + end1: + slang_assembly_typeinfo_destruct(&ti); + return result; } -static GLboolean handle_subscript (slang_assemble_ctx *A, slang_assembly_typeinfo *tie, - slang_assembly_typeinfo *tia, slang_operation *op, slang_ref_type ref) +static GLboolean +handle_subscript(slang_assemble_ctx * A, slang_assembly_typeinfo * tie, + slang_assembly_typeinfo * tia, slang_operation * op, + slang_ref_type ref) { - GLuint asize = 0, esize = 0; - - /* get type info of the master expression (matrix, vector or an array */ - if (!_slang_typeof_operation (A, &op->children[0], tia)) - return GL_FALSE; - if (!sizeof_variable (A, &tia->spec, slang_qual_none, tia->array_len, &asize)) - return GL_FALSE; - - /* get type info of the result (matrix column, vector row or array element) */ - if (!_slang_typeof_operation (A, op, tie)) - return GL_FALSE; - if (!sizeof_variable (A, &tie->spec, slang_qual_none, 0, &esize)) - return GL_FALSE; - - /* assemble the master expression */ - if (!_slang_assemble_operation (A, &op->children[0], ref)) - return GL_FALSE; - - /* when indexing an l-value swizzle, push the swizzle_tmp */ - if (ref == slang_ref_force && tia->is_swizzled) - if (!PLAB2 (A->file, slang_asm_local_addr, A->local.swizzle_tmp, 16)) - return GL_FALSE; - - /* assemble the subscript expression */ - if (!_slang_assemble_operation (A, &op->children[1], slang_ref_forbid)) - return GL_FALSE; - - if (ref == slang_ref_force && tia->is_swizzled) - { - GLuint i; - - /* copy the swizzle indexes to the swizzle_tmp */ - for (i = 0; i < tia->swz.num_components; i++) - { - if (!PLAB2 (A->file, slang_asm_local_addr, A->local.swizzle_tmp, 16)) - return GL_FALSE; - if (!PLAB (A->file, slang_asm_addr_push, i * 4)) - return GL_FALSE; - if (!PUSH (A->file, slang_asm_addr_add)) - return GL_FALSE; - if (!PLAB (A->file, slang_asm_addr_push, tia->swz.swizzle[i])) - return GL_FALSE; - if (!PUSH (A->file, slang_asm_addr_copy)) - return GL_FALSE; - if (!PLAB (A->file, slang_asm_local_free, 4)) - return GL_FALSE; - } - - /* offset the pushed swizzle_tmp address and dereference it */ - if (!PUSH (A->file, slang_asm_int_to_addr)) - return GL_FALSE; - if (!PLAB (A->file, slang_asm_addr_push, 4)) - return GL_FALSE; - if (!PUSH (A->file, slang_asm_addr_multiply)) - return GL_FALSE; - if (!PUSH (A->file, slang_asm_addr_add)) - return GL_FALSE; - if (!PUSH (A->file, slang_asm_addr_deref)) - return GL_FALSE; - } - else - { - /* convert the integer subscript to a relative address */ - if (!PUSH (A->file, slang_asm_int_to_addr)) - return GL_FALSE; - } - - if (!PLAB (A->file, slang_asm_addr_push, esize)) - return GL_FALSE; - if (!PUSH (A->file, slang_asm_addr_multiply)) - return GL_FALSE; - - if (ref == slang_ref_force) - { - /* offset the base address with the relative address */ - if (!PUSH (A->file, slang_asm_addr_add)) - return GL_FALSE; - } - else - { - GLuint i; - - /* move the selected element to the beginning of the master expression */ - for (i = 0; i < esize; i += 4) - if (!PLAB2 (A->file, slang_asm_float_move, asize - esize + i + 4, i + 4)) - return GL_FALSE; - if (!PLAB (A->file, slang_asm_local_free, 4)) - return GL_FALSE; - - /* free the rest of the master expression */ - if (!PLAB (A->file, slang_asm_local_free, asize - esize)) - return GL_FALSE; - } - - return GL_TRUE; + GLuint asize = 0, esize = 0; + + /* get type info of the master expression (matrix, vector or an array */ + if (!_slang_typeof_operation(A, &op->children[0], tia)) + return GL_FALSE; + if (!sizeof_variable + (A, &tia->spec, slang_qual_none, tia->array_len, &asize)) + return GL_FALSE; + + /* get type info of the result (matrix column, vector row or array element) */ + if (!_slang_typeof_operation(A, op, tie)) + return GL_FALSE; + if (!sizeof_variable(A, &tie->spec, slang_qual_none, 0, &esize)) + return GL_FALSE; + + /* assemble the master expression */ + if (!_slang_assemble_operation(A, &op->children[0], ref)) + return GL_FALSE; + + /* when indexing an l-value swizzle, push the swizzle_tmp */ + if (ref == slang_ref_force && tia->is_swizzled) + if (!PLAB2(A->file, slang_asm_local_addr, A->local.swizzle_tmp, 16)) + return GL_FALSE; + + /* assemble the subscript expression */ + if (!_slang_assemble_operation(A, &op->children[1], slang_ref_forbid)) + return GL_FALSE; + + if (ref == slang_ref_force && tia->is_swizzled) { + GLuint i; + + /* copy the swizzle indexes to the swizzle_tmp */ + for (i = 0; i < tia->swz.num_components; i++) { + if (!PLAB2(A->file, slang_asm_local_addr, A->local.swizzle_tmp, 16)) + return GL_FALSE; + if (!PLAB(A->file, slang_asm_addr_push, i * 4)) + return GL_FALSE; + if (!PUSH(A->file, slang_asm_addr_add)) + return GL_FALSE; + if (!PLAB(A->file, slang_asm_addr_push, tia->swz.swizzle[i])) + return GL_FALSE; + if (!PUSH(A->file, slang_asm_addr_copy)) + return GL_FALSE; + if (!PLAB(A->file, slang_asm_local_free, 4)) + return GL_FALSE; + } + + /* offset the pushed swizzle_tmp address and dereference it */ + if (!PUSH(A->file, slang_asm_int_to_addr)) + return GL_FALSE; + if (!PLAB(A->file, slang_asm_addr_push, 4)) + return GL_FALSE; + if (!PUSH(A->file, slang_asm_addr_multiply)) + return GL_FALSE; + if (!PUSH(A->file, slang_asm_addr_add)) + return GL_FALSE; + if (!PUSH(A->file, slang_asm_addr_deref)) + return GL_FALSE; + } + else { + /* convert the integer subscript to a relative address */ + if (!PUSH(A->file, slang_asm_int_to_addr)) + return GL_FALSE; + } + + if (!PLAB(A->file, slang_asm_addr_push, esize)) + return GL_FALSE; + if (!PUSH(A->file, slang_asm_addr_multiply)) + return GL_FALSE; + + if (ref == slang_ref_force) { + /* offset the base address with the relative address */ + if (!PUSH(A->file, slang_asm_addr_add)) + return GL_FALSE; + } + else { + GLuint i; + + /* move the selected element to the beginning of the master expression */ + for (i = 0; i < esize; i += 4) + if (!PLAB2 + (A->file, slang_asm_float_move, asize - esize + i + 4, i + 4)) + return GL_FALSE; + if (!PLAB(A->file, slang_asm_local_free, 4)) + return GL_FALSE; + + /* free the rest of the master expression */ + if (!PLAB(A->file, slang_asm_local_free, asize - esize)) + return GL_FALSE; + } + + return GL_TRUE; } -static GLboolean handle_field (slang_assemble_ctx *A, slang_assembly_typeinfo *tia, - slang_assembly_typeinfo *tib, slang_operation *op, slang_ref_type ref) +static GLboolean +handle_field(slang_assemble_ctx * A, slang_assembly_typeinfo * tia, + slang_assembly_typeinfo * tib, slang_operation * op, + slang_ref_type ref) { - /* get type info of the result (field or swizzle) */ - if (!_slang_typeof_operation (A, op, tia)) - return GL_FALSE; - - /* get type info of the master expression being accessed (struct or vector) */ - if (!_slang_typeof_operation (A, &op->children[0], tib)) - return GL_FALSE; - - /* if swizzling a vector in-place, the swizzle temporary is needed */ - if (ref == slang_ref_forbid && tia->is_swizzled) - if (!PLAB2 (A->file, slang_asm_local_addr, A->local.swizzle_tmp, 16)) - return GL_FALSE; - - /* assemble the master expression */ - if (!_slang_assemble_operation (A, &op->children[0], ref)) - return GL_FALSE; - - /* assemble the field expression */ - if (tia->is_swizzled) - { - if (ref == slang_ref_force) - { + /* get type info of the result (field or swizzle) */ + if (!_slang_typeof_operation(A, op, tia)) + return GL_FALSE; + + /* get type info of the master expression being accessed (struct or vector) */ + if (!_slang_typeof_operation(A, &op->children[0], tib)) + return GL_FALSE; + + /* if swizzling a vector in-place, the swizzle temporary is needed */ + if (ref == slang_ref_forbid && tia->is_swizzled) + if (!PLAB2(A->file, slang_asm_local_addr, A->local.swizzle_tmp, 16)) + return GL_FALSE; + + /* assemble the master expression */ + if (!_slang_assemble_operation(A, &op->children[0], ref)) + return GL_FALSE; + + /* assemble the field expression */ + if (tia->is_swizzled) { + if (ref == slang_ref_force) { #if 0 - if (tia->swz.num_components == 1) - { - /* simple case - adjust the vector's address to point to the selected component */ - if (!PLAB (file, slang_asm_addr_push, tia->swz.swizzle[0] * 4)) - return 0; - if (!PUSH (file, slang_asm_addr_add)) - return 0; - } - else + if (tia->swz.num_components == 1) { + /* simple case - adjust the vector's address to point to + * the selected component + */ + if (!PLAB(file, slang_asm_addr_push, tia->swz.swizzle[0] * 4)) + return 0; + if (!PUSH(file, slang_asm_addr_add)) + return 0; + } + else #endif - { - /* two or more vector components are being referenced - the so-called write mask - * must be passed to the upper operations and applied when assigning value - * to this swizzle */ - A->swz = tia->swz; - } - } - else - { - /* swizzle the vector in-place using the swizzle temporary */ - if (!_slang_assemble_constructor_from_swizzle (A, &tia->swz, &tia->spec, &tib->spec)) - return GL_FALSE; - } - } - else - { - GLuint i, struct_size = 0, field_offset = 0, field_size = 0; + { + /* two or more vector components are being referenced - + * the so-called write mask must be passed to the upper + * operations and applied when assigning value to this swizzle + */ + A->swz = tia->swz; + } + } + else { + /* swizzle the vector in-place using the swizzle temporary */ + if (!_slang_assemble_constructor_from_swizzle + (A, &tia->swz, &tia->spec, &tib->spec)) + return GL_FALSE; + } + } + else { + GLuint i, struct_size = 0, field_offset = 0, field_size = 0; /* * Calculate struct size, field offset and field size. */ - for (i = 0; i < tib->spec._struct->fields->num_variables; i++) - { - slang_variable *field; - slang_storage_aggregate agg; - GLuint size; - - field = &tib->spec._struct->fields->variables[i]; - if (!slang_storage_aggregate_construct (&agg)) - return GL_FALSE; - if (!_slang_aggregate_variable (&agg, &field->type.specifier, field->array_len, - A->space.funcs, A->space.structs, A->space.vars, A->mach, A->file, A->atoms)) - { - slang_storage_aggregate_destruct (&agg); - return GL_FALSE; - } - size = _slang_sizeof_aggregate (&agg); - slang_storage_aggregate_destruct (&agg); + for (i = 0; i < tib->spec._struct->fields->num_variables; i++) { + slang_variable *field; + slang_storage_aggregate agg; + GLuint size; + + field = &tib->spec._struct->fields->variables[i]; + if (!slang_storage_aggregate_construct(&agg)) + return GL_FALSE; + if (!_slang_aggregate_variable + (&agg, &field->type.specifier, field->array_len, A->space.funcs, + A->space.structs, A->space.vars, A->mach, A->file, A->atoms)) { + slang_storage_aggregate_destruct(&agg); + return GL_FALSE; + } + size = _slang_sizeof_aggregate(&agg); + slang_storage_aggregate_destruct(&agg); if (op->a_id == field->a_name) { field_size = size; field_offset = struct_size; } struct_size += size; - } + } - if (ref == slang_ref_force) - { + if (ref == slang_ref_force) { GLboolean shift; /* - * OPTIMIZATION: If selecting first field, no address shifting is needed. - */ + * OPTIMIZATION: If selecting first field, no address shifting + * is needed. + */ shift = (field_offset != 0); if (shift) { - if (!PLAB (A->file, slang_asm_addr_push, field_offset)) + if (!PLAB(A->file, slang_asm_addr_push, field_offset)) + return GL_FALSE; + if (!PUSH(A->file, slang_asm_addr_add)) return GL_FALSE; - if (!PUSH (A->file, slang_asm_addr_add)) - return GL_FALSE; - } - } - else - { + } + } + else { GLboolean relocate, shrink; - GLuint free_b = 0; + GLuint free_b = 0; /* - * OPTIMIZATION: If selecting last field, no relocation is needed. - */ + * OPTIMIZATION: If selecting last field, no relocation is needed. + */ relocate = (field_offset != (struct_size - field_size)); /* - * OPTIMIZATION: If field and struct sizes are equal, no partial free is needed. - */ + * OPTIMIZATION: If field and struct sizes are equal, no partial + * free is needed. + */ shrink = (field_size != struct_size); - if (relocate) - { - GLuint i; + if (relocate) { + GLuint i; - /* - * Move the selected element to the end of the master expression. - * Do it in reverse order to avoid overwriting itself. - */ - if (!PLAB (A->file, slang_asm_addr_push, field_offset)) + /* + * Move the selected element to the end of the master expression. + * Do it in reverse order to avoid overwriting itself. + */ + if (!PLAB(A->file, slang_asm_addr_push, field_offset)) return GL_FALSE; - for (i = field_size; i > 0; i -= 4) - if (!PLAB2 (A->file, slang_asm_float_move, struct_size - field_size + i, i)) - return GL_FALSE; - free_b += 4; - } - - if (shrink) - { - /* free the rest of the master expression */ - free_b += struct_size - field_size; - } - - if (free_b) - { - if (!PLAB (A->file, slang_asm_local_free, free_b)) - return GL_FALSE; - } - } - } - - return GL_TRUE; + for (i = field_size; i > 0; i -= 4) + if (!PLAB2 + (A->file, slang_asm_float_move, + struct_size - field_size + i, i)) + return GL_FALSE; + free_b += 4; + } + + if (shrink) { + /* free the rest of the master expression */ + free_b += struct_size - field_size; + } + + if (free_b) { + if (!PLAB(A->file, slang_asm_local_free, free_b)) + return GL_FALSE; + } + } + } + + return GL_TRUE; } -GLboolean _slang_assemble_operation (slang_assemble_ctx *A, slang_operation *op, slang_ref_type ref) +GLboolean +_slang_assemble_operation(slang_assemble_ctx * A, slang_operation * op, + slang_ref_type ref) { - /* set default results */ - A->ref = /*(ref == slang_ref_freelance) ? slang_ref_force : */ref; - A->swz.num_components = 0; - - switch (op->type) - { - case slang_oper_block_no_new_scope: - case slang_oper_block_new_scope: - { - GLuint i; - - for (i = 0; i < op->num_children; i++) - { - if (!_slang_assemble_operation (A, &op->children[i], slang_ref_forbid/*slang_ref_freelance*/)) - return GL_FALSE; - if (!_slang_cleanup_stack (A, &op->children[i])) - return GL_FALSE; - } - } - break; - case slang_oper_variable_decl: - { - GLuint i; - slang_operation assign; - GLboolean result; - - /* Construct assignment expression placeholder. */ - if (!slang_operation_construct (&assign)) - return GL_FALSE; - assign.type = slang_oper_assign; - assign.children = (slang_operation *) slang_alloc_malloc (2 * sizeof (slang_operation)); - if (assign.children == NULL) - { - slang_operation_destruct (&assign); - return GL_FALSE; - } - for (assign.num_children = 0; assign.num_children < 2; assign.num_children++) - if (!slang_operation_construct (&assign.children[assign.num_children])) - { - slang_operation_destruct (&assign); - return GL_FALSE; - } - - result = GL_TRUE; - for (i = 0; i < op->num_children; i++) - { - slang_variable *var; - - var = _slang_locate_variable (op->children[i].locals, op->children[i].a_id, GL_TRUE); - if (var == NULL) - { - result = GL_FALSE; - break; - } - if (var->initializer == NULL) - continue; - - if (!slang_operation_copy (&assign.children[0], &op->children[i]) || - !slang_operation_copy (&assign.children[1], var->initializer) || - !_slang_assemble_assign (A, &assign, "=", slang_ref_forbid) || - !_slang_cleanup_stack (A, &assign)) - { - result = GL_FALSE; - break; - } - } - slang_operation_destruct (&assign); - if (!result) - return GL_FALSE; - } - break; - case slang_oper_asm: - { - GLuint i; - - if (!_slang_assemble_operation (A, &op->children[0], slang_ref_force)) - return GL_FALSE; - for (i = 1; i < op->num_children; i++) - if (!_slang_assemble_operation (A, &op->children[i], slang_ref_forbid)) - return GL_FALSE; - if (!call_asm_instruction (A, op->a_id)) - return GL_FALSE; - } - break; - case slang_oper_break: - if (!PLAB (A->file, slang_asm_jump, A->flow.loop_end)) - return GL_FALSE; - break; - case slang_oper_continue: - if (!PLAB (A->file, slang_asm_jump, A->flow.loop_start)) - return GL_FALSE; - break; - case slang_oper_discard: - if (!PUSH (A->file, slang_asm_discard)) - return GL_FALSE; - if (!PUSH (A->file, slang_asm_exit)) - return GL_FALSE; - break; - case slang_oper_return: - if (A->local.ret_size != 0) - { - /* push the result's address */ - if (!PLAB2 (A->file, slang_asm_local_addr, 0, A->local.ret_size)) - return GL_FALSE; - if (!_slang_assemble_operation (A, &op->children[0], slang_ref_forbid)) - return GL_FALSE; - - A->swz.num_components = 0; - /* assign the operation to the function result (it was reserved on the stack) */ - if (!_slang_assemble_assignment (A, op->children)) - return GL_FALSE; - - if (!PLAB (A->file, slang_asm_local_free, 4)) - return GL_FALSE; - } - if (!PLAB (A->file, slang_asm_jump, A->flow.function_end)) - return GL_FALSE; - break; - case slang_oper_expression: - if (ref == slang_ref_force) - return GL_FALSE; - if (!_slang_assemble_operation (A, &op->children[0], ref)) - return GL_FALSE; - break; - case slang_oper_if: - if (!_slang_assemble_if (A, op)) - return GL_FALSE; - break; - case slang_oper_while: - if (!_slang_assemble_while (A, op)) - return GL_FALSE; - break; - case slang_oper_do: - if (!_slang_assemble_do (A, op)) - return GL_FALSE; - break; - case slang_oper_for: - if (!_slang_assemble_for (A, op)) - return GL_FALSE; - break; - case slang_oper_void: - break; - case slang_oper_literal_bool: - if (ref == slang_ref_force) - return GL_FALSE; - if (!PLIT (A->file, slang_asm_bool_push, op->literal)) - return GL_FALSE; - A->ref = slang_ref_forbid; - break; - case slang_oper_literal_int: - if (ref == slang_ref_force) - return GL_FALSE; - if (!PLIT (A->file, slang_asm_int_push, op->literal)) - return GL_FALSE; - A->ref = slang_ref_forbid; - break; - case slang_oper_literal_float: - if (ref == slang_ref_force) - return GL_FALSE; - if (!PLIT (A->file, slang_asm_float_push, op->literal)) - return GL_FALSE; - A->ref = slang_ref_forbid; - break; - case slang_oper_identifier: - { - slang_variable *var; - GLuint size; - - /* find the variable and calculate its size */ - var = _slang_locate_variable (op->locals, op->a_id, GL_TRUE); - if (var == NULL) - return GL_FALSE; - size = 0; - if (!sizeof_variable (A, &var->type.specifier, slang_qual_none, var->array_len, &size)) - return GL_FALSE; - - /* prepare stack for dereferencing */ - if (ref == slang_ref_forbid) - if (!PLAB2 (A->file, slang_asm_local_addr, A->local.addr_tmp, 4)) - return GL_FALSE; - - /* push the variable's address */ - if (var->global) - { - if (!PLAB (A->file, slang_asm_global_addr, var->address)) - return GL_FALSE; - } - else - { - if (!PLAB2 (A->file, slang_asm_local_addr, var->address, size)) - return GL_FALSE; - } - - /* perform the dereference */ - if (ref == slang_ref_forbid) - { - if (!PUSH (A->file, slang_asm_addr_copy)) - return GL_FALSE; - if (!PLAB (A->file, slang_asm_local_free, 4)) - return GL_FALSE; - if (!_slang_dereference (A, op)) - return GL_FALSE; - } - } - break; - case slang_oper_sequence: - if (ref == slang_ref_force) - return GL_FALSE; - if (!_slang_assemble_operation (A, &op->children[0], slang_ref_forbid/*slang_ref_freelance*/)) - return GL_FALSE; - if (!_slang_cleanup_stack (A, &op->children[0])) - return GL_FALSE; - if (!_slang_assemble_operation (A, &op->children[1], slang_ref_forbid)) - return GL_FALSE; - A->ref = slang_ref_forbid; - break; - case slang_oper_assign: - if (!_slang_assemble_assign (A, op, "=", ref)) - return GL_FALSE; - break; - case slang_oper_addassign: - if (!_slang_assemble_assign (A, op, "+=", ref)) - return GL_FALSE; - A->ref = ref; - break; - case slang_oper_subassign: - if (!_slang_assemble_assign (A, op, "-=", ref)) - return GL_FALSE; - A->ref = ref; - break; - case slang_oper_mulassign: - if (!_slang_assemble_assign (A, op, "*=", ref)) - return GL_FALSE; - A->ref = ref; - break; - /*case slang_oper_modassign:*/ - /*case slang_oper_lshassign:*/ - /*case slang_oper_rshassign:*/ - /*case slang_oper_orassign:*/ - /*case slang_oper_xorassign:*/ - /*case slang_oper_andassign:*/ - case slang_oper_divassign: - if (!_slang_assemble_assign (A, op, "/=", ref)) - return GL_FALSE; - A->ref = ref; - break; - case slang_oper_select: - if (!_slang_assemble_select (A, op)) - return GL_FALSE; - A->ref = slang_ref_forbid; - break; - case slang_oper_logicalor: - if (!_slang_assemble_logicalor (A, op)) - return GL_FALSE; - A->ref = slang_ref_forbid; - break; - case slang_oper_logicaland: - if (!_slang_assemble_logicaland (A, op)) - return GL_FALSE; - A->ref = slang_ref_forbid; - break; - case slang_oper_logicalxor: - if (!_slang_assemble_function_call_name (A, "^^", op->children, 2, GL_FALSE)) - return GL_FALSE; - A->ref = slang_ref_forbid; - break; - /*case slang_oper_bitor:*/ - /*case slang_oper_bitxor:*/ - /*case slang_oper_bitand:*/ - case slang_oper_less: - if (!_slang_assemble_function_call_name (A, "<", op->children, 2, GL_FALSE)) - return GL_FALSE; - A->ref = slang_ref_forbid; - break; - case slang_oper_greater: - if (!_slang_assemble_function_call_name (A, ">", op->children, 2, GL_FALSE)) - return GL_FALSE; - A->ref = slang_ref_forbid; - break; - case slang_oper_lessequal: - if (!_slang_assemble_function_call_name (A, "<=", op->children, 2, GL_FALSE)) - return GL_FALSE; - A->ref = slang_ref_forbid; - break; - case slang_oper_greaterequal: - if (!_slang_assemble_function_call_name (A, ">=", op->children, 2, GL_FALSE)) - return GL_FALSE; - A->ref = slang_ref_forbid; - break; - /*case slang_oper_lshift:*/ - /*case slang_oper_rshift:*/ - case slang_oper_add: - if (!_slang_assemble_function_call_name (A, "+", op->children, 2, GL_FALSE)) - return GL_FALSE; - A->ref = slang_ref_forbid; - break; - case slang_oper_subtract: - if (!_slang_assemble_function_call_name (A, "-", op->children, 2, GL_FALSE)) - return GL_FALSE; - A->ref = slang_ref_forbid; - break; - case slang_oper_multiply: - if (!_slang_assemble_function_call_name (A, "*", op->children, 2, GL_FALSE)) - return GL_FALSE; - A->ref = slang_ref_forbid; - break; - /*case slang_oper_modulus:*/ - case slang_oper_divide: - if (!_slang_assemble_function_call_name (A, "/", op->children, 2, GL_FALSE)) - return GL_FALSE; - A->ref = slang_ref_forbid; - break; - case slang_oper_equal: - if (!_slang_assemble_operation (A, &op->children[0], slang_ref_forbid)) - return GL_FALSE; - if (!_slang_assemble_operation (A, &op->children[1], slang_ref_forbid)) - return GL_FALSE; - if (!equality (A, op->children, GL_TRUE)) - return GL_FALSE; - A->ref = slang_ref_forbid; - break; - case slang_oper_notequal: - if (!_slang_assemble_operation (A, &op->children[0], slang_ref_forbid)) - return GL_FALSE; - if (!_slang_assemble_operation (A, &op->children[1], slang_ref_forbid)) - return GL_FALSE; - if (!equality (A, op->children, GL_FALSE)) - return GL_FALSE; - A->ref = slang_ref_forbid; - break; - case slang_oper_preincrement: - if (!_slang_assemble_assign (A, op, "++", ref)) - return GL_FALSE; - A->ref = ref; - break; - case slang_oper_predecrement: - if (!_slang_assemble_assign (A, op, "--", ref)) - return GL_FALSE; - A->ref = ref; - break; - case slang_oper_plus: - if (!_slang_dereference (A, op)) - return GL_FALSE; - A->ref = slang_ref_forbid; - break; - case slang_oper_minus: - if (!_slang_assemble_function_call_name (A, "-", op->children, 1, GL_FALSE)) - return GL_FALSE; - A->ref = slang_ref_forbid; - break; - /*case slang_oper_complement:*/ - case slang_oper_not: - if (!_slang_assemble_function_call_name (A, "!", op->children, 1, GL_FALSE)) - return GL_FALSE; - A->ref = slang_ref_forbid; - break; - case slang_oper_subscript: - { - slang_assembly_typeinfo ti_arr, ti_elem; - - if (!slang_assembly_typeinfo_construct (&ti_arr)) - return GL_FALSE; - if (!slang_assembly_typeinfo_construct (&ti_elem)) - { - slang_assembly_typeinfo_destruct (&ti_arr); - return GL_FALSE; - } - if (!handle_subscript (A, &ti_elem, &ti_arr, op, ref)) - { - slang_assembly_typeinfo_destruct (&ti_arr); - slang_assembly_typeinfo_destruct (&ti_elem); - return GL_FALSE; - } - slang_assembly_typeinfo_destruct (&ti_arr); - slang_assembly_typeinfo_destruct (&ti_elem); - } - break; - case slang_oper_call: - { - slang_function *fun; - - fun = _slang_locate_function (A->space.funcs, op->a_id, op->children, op->num_children, - &A->space, A->atoms); - if (fun == NULL) - { - if (!_slang_assemble_constructor (A, op)) - return GL_FALSE; - } - else - { - if (!_slang_assemble_function_call (A, fun, op->children, op->num_children, GL_FALSE)) - return GL_FALSE; - } - A->ref = slang_ref_forbid; - } - break; - case slang_oper_field: - { - slang_assembly_typeinfo ti_after, ti_before; - - if (!slang_assembly_typeinfo_construct (&ti_after)) - return GL_FALSE; - if (!slang_assembly_typeinfo_construct (&ti_before)) - { - slang_assembly_typeinfo_destruct (&ti_after); - return GL_FALSE; - } - if (!handle_field (A, &ti_after, &ti_before, op, ref)) - { - slang_assembly_typeinfo_destruct (&ti_after); - slang_assembly_typeinfo_destruct (&ti_before); - return GL_FALSE; - } - slang_assembly_typeinfo_destruct (&ti_after); - slang_assembly_typeinfo_destruct (&ti_before); - } - break; - case slang_oper_postincrement: - if (!assemble_function_call_name_dummyint (A, "++", op->children)) - return GL_FALSE; - A->ref = slang_ref_forbid; - break; - case slang_oper_postdecrement: - if (!assemble_function_call_name_dummyint (A, "--", op->children)) - return GL_FALSE; - A->ref = slang_ref_forbid; - break; - default: - return GL_FALSE; - } - - return GL_TRUE; -} + /* set default results */ + A->ref = /*(ref == slang_ref_freelance) ? slang_ref_force : */ ref; + A->swz.num_components = 0; + + switch (op->type) { + case slang_oper_block_no_new_scope: + case slang_oper_block_new_scope: + { + GLuint i; + + for (i = 0; i < op->num_children; i++) { + if (!_slang_assemble_operation + (A, &op->children[i], + slang_ref_forbid /*slang_ref_freelance */ )) + return GL_FALSE; + if (!_slang_cleanup_stack(A, &op->children[i])) + return GL_FALSE; + } + } + break; + case slang_oper_variable_decl: + { + GLuint i; + slang_operation assign; + GLboolean result; + + /* Construct assignment expression placeholder. */ + if (!slang_operation_construct(&assign)) + return GL_FALSE; + assign.type = slang_oper_assign; + assign.children = + (slang_operation *) slang_alloc_malloc(2 * + sizeof(slang_operation)); + if (assign.children == NULL) { + slang_operation_destruct(&assign); + return GL_FALSE; + } + for (assign.num_children = 0; assign.num_children < 2; + assign.num_children++) + if (!slang_operation_construct + (&assign.children[assign.num_children])) { + slang_operation_destruct(&assign); + return GL_FALSE; + } + + result = GL_TRUE; + for (i = 0; i < op->num_children; i++) { + slang_variable *var; + + var = + _slang_locate_variable(op->children[i].locals, + op->children[i].a_id, GL_TRUE); + if (var == NULL) { + result = GL_FALSE; + break; + } + if (var->initializer == NULL) + continue; + + if (!slang_operation_copy(&assign.children[0], &op->children[i]) + || !slang_operation_copy(&assign.children[1], + var->initializer) + || !_slang_assemble_assign(A, &assign, "=", slang_ref_forbid) + || !_slang_cleanup_stack(A, &assign)) { + result = GL_FALSE; + break; + } + } + slang_operation_destruct(&assign); + if (!result) + return GL_FALSE; + } + break; + case slang_oper_asm: + { + GLuint i; + if (!_slang_assemble_operation(A, &op->children[0], slang_ref_force)) + return GL_FALSE; + for (i = 1; i < op->num_children; i++) + if (!_slang_assemble_operation + (A, &op->children[i], slang_ref_forbid)) + return GL_FALSE; + if (!call_asm_instruction(A, op->a_id)) + return GL_FALSE; + } + break; + case slang_oper_break: + if (!PLAB(A->file, slang_asm_jump, A->flow.loop_end)) + return GL_FALSE; + break; + case slang_oper_continue: + if (!PLAB(A->file, slang_asm_jump, A->flow.loop_start)) + return GL_FALSE; + break; + case slang_oper_discard: + if (!PUSH(A->file, slang_asm_discard)) + return GL_FALSE; + if (!PUSH(A->file, slang_asm_exit)) + return GL_FALSE; + break; + case slang_oper_return: + if (A->local.ret_size != 0) { + /* push the result's address */ + if (!PLAB2(A->file, slang_asm_local_addr, 0, A->local.ret_size)) + return GL_FALSE; + if (!_slang_assemble_operation + (A, &op->children[0], slang_ref_forbid)) + return GL_FALSE; + + A->swz.num_components = 0; + /* assign the operation to the function result (it was reserved on the stack) */ + if (!_slang_assemble_assignment(A, op->children)) + return GL_FALSE; + + if (!PLAB(A->file, slang_asm_local_free, 4)) + return GL_FALSE; + } + if (!PLAB(A->file, slang_asm_jump, A->flow.function_end)) + return GL_FALSE; + break; + case slang_oper_expression: + if (ref == slang_ref_force) + return GL_FALSE; + if (!_slang_assemble_operation(A, &op->children[0], ref)) + return GL_FALSE; + break; + case slang_oper_if: + if (!_slang_assemble_if(A, op)) + return GL_FALSE; + break; + case slang_oper_while: + if (!_slang_assemble_while(A, op)) + return GL_FALSE; + break; + case slang_oper_do: + if (!_slang_assemble_do(A, op)) + return GL_FALSE; + break; + case slang_oper_for: + if (!_slang_assemble_for(A, op)) + return GL_FALSE; + break; + case slang_oper_void: + break; + case slang_oper_literal_bool: + if (ref == slang_ref_force) + return GL_FALSE; + if (!PLIT(A->file, slang_asm_bool_push, op->literal)) + return GL_FALSE; + A->ref = slang_ref_forbid; + break; + case slang_oper_literal_int: + if (ref == slang_ref_force) + return GL_FALSE; + if (!PLIT(A->file, slang_asm_int_push, op->literal)) + return GL_FALSE; + A->ref = slang_ref_forbid; + break; + case slang_oper_literal_float: + if (ref == slang_ref_force) + return GL_FALSE; + if (!PLIT(A->file, slang_asm_float_push, op->literal)) + return GL_FALSE; + A->ref = slang_ref_forbid; + break; + case slang_oper_identifier: + { + slang_variable *var; + GLuint size; + + /* find the variable and calculate its size */ + var = _slang_locate_variable(op->locals, op->a_id, GL_TRUE); + if (var == NULL) + return GL_FALSE; + size = 0; + if (!sizeof_variable + (A, &var->type.specifier, slang_qual_none, var->array_len, + &size)) + return GL_FALSE; + + /* prepare stack for dereferencing */ + if (ref == slang_ref_forbid) + if (!PLAB2(A->file, slang_asm_local_addr, A->local.addr_tmp, 4)) + return GL_FALSE; + + /* push the variable's address */ + if (var->global) { + if (!PLAB(A->file, slang_asm_global_addr, var->address)) + return GL_FALSE; + } + else { + if (!PLAB2(A->file, slang_asm_local_addr, var->address, size)) + return GL_FALSE; + } + /* perform the dereference */ + if (ref == slang_ref_forbid) { + if (!PUSH(A->file, slang_asm_addr_copy)) + return GL_FALSE; + if (!PLAB(A->file, slang_asm_local_free, 4)) + return GL_FALSE; + if (!_slang_dereference(A, op)) + return GL_FALSE; + } + } + break; + case slang_oper_sequence: + if (ref == slang_ref_force) + return GL_FALSE; + if (!_slang_assemble_operation(A, &op->children[0], + slang_ref_forbid /*slang_ref_freelance */ )) + return GL_FALSE; + if (!_slang_cleanup_stack(A, &op->children[0])) + return GL_FALSE; + if (!_slang_assemble_operation(A, &op->children[1], slang_ref_forbid)) + return GL_FALSE; + A->ref = slang_ref_forbid; + break; + case slang_oper_assign: + if (!_slang_assemble_assign(A, op, "=", ref)) + return GL_FALSE; + break; + case slang_oper_addassign: + if (!_slang_assemble_assign(A, op, "+=", ref)) + return GL_FALSE; + A->ref = ref; + break; + case slang_oper_subassign: + if (!_slang_assemble_assign(A, op, "-=", ref)) + return GL_FALSE; + A->ref = ref; + break; + case slang_oper_mulassign: + if (!_slang_assemble_assign(A, op, "*=", ref)) + return GL_FALSE; + A->ref = ref; + break; + /*case slang_oper_modassign: */ + /*case slang_oper_lshassign: */ + /*case slang_oper_rshassign: */ + /*case slang_oper_orassign: */ + /*case slang_oper_xorassign: */ + /*case slang_oper_andassign: */ + case slang_oper_divassign: + if (!_slang_assemble_assign(A, op, "/=", ref)) + return GL_FALSE; + A->ref = ref; + break; + case slang_oper_select: + if (!_slang_assemble_select(A, op)) + return GL_FALSE; + A->ref = slang_ref_forbid; + break; + case slang_oper_logicalor: + if (!_slang_assemble_logicalor(A, op)) + return GL_FALSE; + A->ref = slang_ref_forbid; + break; + case slang_oper_logicaland: + if (!_slang_assemble_logicaland(A, op)) + return GL_FALSE; + A->ref = slang_ref_forbid; + break; + case slang_oper_logicalxor: + if (!_slang_assemble_function_call_name(A, "^^", op->children, 2, GL_FALSE)) + return GL_FALSE; + A->ref = slang_ref_forbid; + break; + /*case slang_oper_bitor: */ + /*case slang_oper_bitxor: */ + /*case slang_oper_bitand: */ + case slang_oper_less: + if (!_slang_assemble_function_call_name(A, "<", op->children, 2, GL_FALSE)) + return GL_FALSE; + A->ref = slang_ref_forbid; + break; + case slang_oper_greater: + if (!_slang_assemble_function_call_name(A, ">", op->children, 2, GL_FALSE)) + return GL_FALSE; + A->ref = slang_ref_forbid; + break; + case slang_oper_lessequal: + if (!_slang_assemble_function_call_name(A, "<=", op->children, 2, GL_FALSE)) + return GL_FALSE; + A->ref = slang_ref_forbid; + break; + case slang_oper_greaterequal: + if (!_slang_assemble_function_call_name(A, ">=", op->children, 2, GL_FALSE)) + return GL_FALSE; + A->ref = slang_ref_forbid; + break; + /*case slang_oper_lshift: */ + /*case slang_oper_rshift: */ + case slang_oper_add: + if (!_slang_assemble_function_call_name(A, "+", op->children, 2, GL_FALSE)) + return GL_FALSE; + A->ref = slang_ref_forbid; + break; + case slang_oper_subtract: + if (!_slang_assemble_function_call_name(A, "-", op->children, 2, GL_FALSE)) + return GL_FALSE; + A->ref = slang_ref_forbid; + break; + case slang_oper_multiply: + if (!_slang_assemble_function_call_name(A, "*", op->children, 2, GL_FALSE)) + return GL_FALSE; + A->ref = slang_ref_forbid; + break; + /*case slang_oper_modulus: */ + case slang_oper_divide: + if (!_slang_assemble_function_call_name(A, "/", op->children, 2, GL_FALSE)) + return GL_FALSE; + A->ref = slang_ref_forbid; + break; + case slang_oper_equal: + if (!_slang_assemble_operation(A, &op->children[0], slang_ref_forbid)) + return GL_FALSE; + if (!_slang_assemble_operation(A, &op->children[1], slang_ref_forbid)) + return GL_FALSE; + if (!equality(A, op->children, GL_TRUE)) + return GL_FALSE; + A->ref = slang_ref_forbid; + break; + case slang_oper_notequal: + if (!_slang_assemble_operation(A, &op->children[0], slang_ref_forbid)) + return GL_FALSE; + if (!_slang_assemble_operation(A, &op->children[1], slang_ref_forbid)) + return GL_FALSE; + if (!equality(A, op->children, GL_FALSE)) + return GL_FALSE; + A->ref = slang_ref_forbid; + break; + case slang_oper_preincrement: + if (!_slang_assemble_assign(A, op, "++", ref)) + return GL_FALSE; + A->ref = ref; + break; + case slang_oper_predecrement: + if (!_slang_assemble_assign(A, op, "--", ref)) + return GL_FALSE; + A->ref = ref; + break; + case slang_oper_plus: + if (!_slang_dereference(A, op)) + return GL_FALSE; + A->ref = slang_ref_forbid; + break; + case slang_oper_minus: + if (!_slang_assemble_function_call_name + (A, "-", op->children, 1, GL_FALSE)) + return GL_FALSE; + A->ref = slang_ref_forbid; + break; + /*case slang_oper_complement: */ + case slang_oper_not: + if (!_slang_assemble_function_call_name + (A, "!", op->children, 1, GL_FALSE)) + return GL_FALSE; + A->ref = slang_ref_forbid; + break; + case slang_oper_subscript: + { + slang_assembly_typeinfo ti_arr, ti_elem; + + if (!slang_assembly_typeinfo_construct(&ti_arr)) + return GL_FALSE; + if (!slang_assembly_typeinfo_construct(&ti_elem)) { + slang_assembly_typeinfo_destruct(&ti_arr); + return GL_FALSE; + } + if (!handle_subscript(A, &ti_elem, &ti_arr, op, ref)) { + slang_assembly_typeinfo_destruct(&ti_arr); + slang_assembly_typeinfo_destruct(&ti_elem); + return GL_FALSE; + } + slang_assembly_typeinfo_destruct(&ti_arr); + slang_assembly_typeinfo_destruct(&ti_elem); + } + break; + case slang_oper_call: + { + slang_function *fun; + + fun = + _slang_locate_function(A->space.funcs, op->a_id, op->children, + op->num_children, &A->space, A->atoms); + if (fun == NULL) { + if (!_slang_assemble_constructor(A, op)) + return GL_FALSE; + } + else { + if (!_slang_assemble_function_call + (A, fun, op->children, op->num_children, GL_FALSE)) + return GL_FALSE; + } + A->ref = slang_ref_forbid; + } + break; + case slang_oper_field: + { + slang_assembly_typeinfo ti_after, ti_before; + + if (!slang_assembly_typeinfo_construct(&ti_after)) + return GL_FALSE; + if (!slang_assembly_typeinfo_construct(&ti_before)) { + slang_assembly_typeinfo_destruct(&ti_after); + return GL_FALSE; + } + if (!handle_field(A, &ti_after, &ti_before, op, ref)) { + slang_assembly_typeinfo_destruct(&ti_after); + slang_assembly_typeinfo_destruct(&ti_before); + return GL_FALSE; + } + slang_assembly_typeinfo_destruct(&ti_after); + slang_assembly_typeinfo_destruct(&ti_before); + } + break; + case slang_oper_postincrement: + if (!assemble_function_call_name_dummyint(A, "++", op->children)) + return GL_FALSE; + A->ref = slang_ref_forbid; + break; + case slang_oper_postdecrement: + if (!assemble_function_call_name_dummyint(A, "--", op->children)) + return GL_FALSE; + A->ref = slang_ref_forbid; + break; + default: + return GL_FALSE; + } + + return GL_TRUE; +} diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c index 46bdf830f92..357d61b246a 100644 --- a/src/mesa/shader/slang/slang_compile.c +++ b/src/mesa/shader/slang/slang_compile.c @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.5 + * Version: 6.6 * * Copyright (C) 2005-2006 Brian Paul All Rights Reserved. * @@ -1918,10 +1918,11 @@ static GLboolean compile_with_grammar (grammar id, const char *source, slang_code_unit *unit, slang_unit_type type, slang_info_log *infolog, slang_code_unit *builtin) { - byte *prod; + byte *prod; GLuint size, start, version; + slang_string preprocessed; - /* retrieve version */ + /* First retrieve the version number. */ if (!_slang_preprocess_version (source, &version, &start, infolog)) return GL_FALSE; @@ -1930,22 +1931,31 @@ compile_with_grammar (grammar id, const char *source, slang_code_unit *unit, sla return GL_FALSE; } - /* check the syntax and generate its binary representation */ - if (!grammar_fast_check (id, (const byte *) source + start, &prod, &size, 65536)) - { - char buf[1024]; - unsigned int pos; - grammar_get_last_error ( (unsigned char*) buf, 1024, (int*) &pos); + /* Now preprocess the source string. */ + slang_string_init (&preprocessed); + if (!_slang_preprocess_directives (&preprocessed, &source[start], infolog)) { + slang_string_free (&preprocessed); + slang_info_log_error (infolog, "failed to preprocess the source."); + return GL_FALSE; + } + + /* Finally check the syntax and generate its binary representation. */ + if (!grammar_fast_check (id, (const byte *) (slang_string_cstr (&preprocessed)), &prod, &size, 65536)) { + char buf[1024]; + GLint pos; + + slang_string_free (&preprocessed); + grammar_get_last_error ((byte *) (buf), sizeof (buf), &pos); slang_info_log_error (infolog, buf); return GL_FALSE; - } + } + slang_string_free (&preprocessed); - /* syntax is okay - translate it to internal representation */ + /* Syntax is okay - translate it to internal representation. */ if (!compile_binary (prod, unit, type, infolog, builtin, &builtin[SLANG_BUILTIN_TOTAL - 1])) { grammar_alloc_free (prod); return GL_FALSE; } - grammar_alloc_free (prod); return GL_TRUE; } diff --git a/src/mesa/shader/slang/slang_execute_x86.c b/src/mesa/shader/slang/slang_execute_x86.c index 3e21edff6a3..958086ff07c 100644 --- a/src/mesa/shader/slang/slang_execute_x86.c +++ b/src/mesa/shader/slang/slang_execute_x86.c @@ -40,40 +40,42 @@ typedef struct { - GLuint index; - GLubyte *csr; + GLuint index; + GLubyte *csr; } fixup; typedef struct { - struct x86_function f; - struct x86_reg r_eax; - struct x86_reg r_ecx; - struct x86_reg r_edx; + struct x86_function f; + struct x86_reg r_eax; + struct x86_reg r_ecx; + struct x86_reg r_edx; struct x86_reg r_ebx; - struct x86_reg r_esp; - struct x86_reg r_ebp; - struct x86_reg r_st0; - struct x86_reg r_st1; - struct x86_reg r_st2; - struct x86_reg r_st3; + struct x86_reg r_esp; + struct x86_reg r_ebp; + struct x86_reg r_st0; + struct x86_reg r_st1; + struct x86_reg r_st2; + struct x86_reg r_st3; struct x86_reg r_st4; - fixup *fixups; - GLuint fixup_count; - GLubyte **labels; - slang_machine *mach; - GLubyte *l_discard; - GLubyte *l_exit; - GLshort fpucntl; + fixup *fixups; + GLuint fixup_count; + GLubyte **labels; + slang_machine *mach; + GLubyte *l_discard; + GLubyte *l_exit; + GLshort fpucntl; } codegen_ctx; -static GLvoid add_fixup (codegen_ctx *G, GLuint index, GLubyte *csr) +static GLvoid +add_fixup(codegen_ctx * G, GLuint index, GLubyte * csr) { - G->fixups = (fixup *) slang_alloc_realloc (G->fixups, G->fixup_count * sizeof (fixup), - (G->fixup_count + 1) * sizeof (fixup)); - G->fixups[G->fixup_count].index = index; - G->fixups[G->fixup_count].csr = csr; - G->fixup_count++; + G->fixups = + (fixup *) slang_alloc_realloc(G->fixups, G->fixup_count * sizeof(fixup), + (G->fixup_count + 1) * sizeof(fixup)); + G->fixups[G->fixup_count].index = index; + G->fixups[G->fixup_count].csr = csr; + G->fixup_count++; } #ifdef NO_FAST_MATH @@ -88,661 +90,665 @@ static GLvoid add_fixup (codegen_ctx *G, GLuint index, GLubyte *csr) /* * XXX - * These should produce a valid code that computes powers. Unfortunately, it does not. + * These should produce a valid code that computes powers. + * Unfortunately, it does not. */ -static void set_fpu_round_neg_inf (codegen_ctx *G) +static void +set_fpu_round_neg_inf(codegen_ctx * G) { - if (G->fpucntl != RND_NEG_FPU) - { - G->fpucntl = RND_NEG_FPU; - x87_fnclex (&G->f); - x86_mov_reg_imm (&G->f, G->r_eax, (GLint) &G->mach->x86.fpucntl_rnd_neg); - x87_fldcw (&G->f, x86_deref (G->r_eax)); - } + if (G->fpucntl != RND_NEG_FPU) { + G->fpucntl = RND_NEG_FPU; + x87_fnclex(&G->f); + x86_mov_reg_imm(&G->f, G->r_eax, + (GLint) & G->mach->x86.fpucntl_rnd_neg); + x87_fldcw(&G->f, x86_deref(G->r_eax)); + } } -static void emit_x87_ex2 (codegen_ctx *G) +static void +emit_x87_ex2(codegen_ctx * G) { - set_fpu_round_neg_inf (G); - - x87_fld (&G->f, G->r_st0); /* a a */ - x87_fprndint (&G->f); /* int(a) a */ - x87_fld (&G->f, G->r_st0); /* int(a) int(a) a */ - x87_fstp (&G->f, G->r_st3); /* int(a) a int(a)*/ - x87_fsubp (&G->f, G->r_st1);/* frac(a) int(a) */ - x87_f2xm1 (&G->f); /* (2^frac(a))-1 int(a)*/ - x87_fld1 (&G->f); /* 1 (2^frac(a))-1 int(a)*/ - x87_faddp (&G->f, G->r_st1);/* 2^frac(a) int(a) */ - x87_fscale (&G->f); /* 2^a */ + set_fpu_round_neg_inf(G); + + x87_fld(&G->f, G->r_st0); /* a a */ + x87_fprndint(&G->f); /* int(a) a */ + x87_fld(&G->f, G->r_st0); /* int(a) int(a) a */ + x87_fstp(&G->f, G->r_st3); /* int(a) a int(a) */ + x87_fsubp(&G->f, G->r_st1); /* frac(a) int(a) */ + x87_f2xm1(&G->f); /* (2^frac(a))-1 int(a) */ + x87_fld1(&G->f); /* 1 (2^frac(a))-1 int(a) */ + x87_faddp(&G->f, G->r_st1); /* 2^frac(a) int(a) */ + x87_fscale(&G->f); /* 2^a */ } -static void emit_pow (codegen_ctx *G) +static void +emit_pow(codegen_ctx * G) { - x87_fld (&G->f, x86_deref (G->r_esp)); - x87_fld (&G->f, x86_make_disp (G->r_esp, 4)); - x87_fyl2x (&G->f); - emit_x87_ex2 (G); + x87_fld(&G->f, x86_deref(G->r_esp)); + x87_fld(&G->f, x86_make_disp(G->r_esp, 4)); + x87_fyl2x(&G->f); + emit_x87_ex2(G); } #endif -static GLfloat do_ceilf (GLfloat x) +static GLfloat +do_ceilf(GLfloat x) { - return CEILF (x); + return CEILF(x); } -static GLfloat do_floorf (GLfloat x) +static GLfloat +do_floorf(GLfloat x) { - return FLOORF (x); + return FLOORF(x); } static GLfloat -do_ftoi (GLfloat x) +do_ftoi(GLfloat x) { return (GLfloat) ((GLint) (x)); } -static GLfloat do_powf (GLfloat y, GLfloat x) +static GLfloat +do_powf(GLfloat y, GLfloat x) { - return (GLfloat) _mesa_pow ((GLdouble) x, (GLdouble) y); + return (GLfloat) _mesa_pow((GLdouble) x, (GLdouble) y); } static GLvoid -ensure_infolog_created (slang_info_log **infolog) +ensure_infolog_created(slang_info_log ** infolog) { if (*infolog == NULL) { - *infolog = slang_alloc_malloc (sizeof (slang_info_log)); + *infolog = slang_alloc_malloc(sizeof(slang_info_log)); if (*infolog == NULL) return; - slang_info_log_construct (*infolog); + slang_info_log_construct(*infolog); } } -static GLvoid do_print_float (slang_info_log **infolog, GLfloat x) +static GLvoid +do_print_float(slang_info_log ** infolog, GLfloat x) { - _mesa_printf ("slang print: %f\n", x); - ensure_infolog_created (infolog); - slang_info_log_print (*infolog, "%f", x); + _mesa_printf("slang print: %f\n", x); + ensure_infolog_created(infolog); + slang_info_log_print(*infolog, "%f", x); } -static GLvoid do_print_int (slang_info_log **infolog, GLfloat x) +static GLvoid +do_print_int(slang_info_log ** infolog, GLfloat x) { - _mesa_printf ("slang print: %d\n", (GLint) (x)); - ensure_infolog_created (infolog); - slang_info_log_print (*infolog, "%d", (GLint) (x)); + _mesa_printf("slang print: %d\n", (GLint) (x)); + ensure_infolog_created(infolog); + slang_info_log_print(*infolog, "%d", (GLint) (x)); } -static GLvoid do_print_bool (slang_info_log **infolog, GLfloat x) +static GLvoid +do_print_bool(slang_info_log ** infolog, GLfloat x) { - _mesa_printf ("slang print: %s\n", (GLint) (x) ? "true" : "false"); - ensure_infolog_created (infolog); - slang_info_log_print (*infolog, "%s", (GLint) (x) ? "true" : "false"); + _mesa_printf("slang print: %s\n", (GLint) (x) ? "true" : "false"); + ensure_infolog_created(infolog); + slang_info_log_print(*infolog, "%s", (GLint) (x) ? "true" : "false"); } #define FLOAT_ONE 0x3f800000 #define FLOAT_ZERO 0 -static GLvoid codegen_assem (codegen_ctx *G, slang_assembly *a, slang_info_log **infolog) +static GLvoid +codegen_assem(codegen_ctx * G, slang_assembly * a, slang_info_log ** infolog) { - GLint disp, i; - - switch (a->type) - { - case slang_asm_none: - break; - case slang_asm_float_copy: - case slang_asm_int_copy: - case slang_asm_bool_copy: - x86_mov (&G->f, G->r_eax, x86_make_disp (G->r_esp, a->param[0])); - x86_pop (&G->f, G->r_ecx); - x86_mov (&G->f, x86_make_disp (G->r_eax, a->param[1]), G->r_ecx); - break; - case slang_asm_float_move: - case slang_asm_int_move: - case slang_asm_bool_move: - x86_lea (&G->f, G->r_eax, x86_make_disp (G->r_esp, a->param[1])); - x86_add (&G->f, G->r_eax, x86_deref (G->r_esp)); - x86_mov (&G->f, G->r_eax, x86_deref (G->r_eax)); - x86_mov (&G->f, x86_make_disp (G->r_esp, a->param[0]), G->r_eax); - break; - case slang_asm_float_push: - case slang_asm_int_push: - case slang_asm_bool_push: - /* TODO: use push imm32 */ - x86_mov_reg_imm (&G->f, G->r_eax, *((GLint *) &a->literal)); - x86_push (&G->f, G->r_eax); - break; - case slang_asm_float_deref: - case slang_asm_int_deref: - case slang_asm_bool_deref: - case slang_asm_addr_deref: - x86_mov (&G->f, G->r_eax, x86_deref (G->r_esp)); - x86_mov (&G->f, G->r_eax, x86_deref (G->r_eax)); - x86_mov (&G->f, x86_deref (G->r_esp), G->r_eax); - break; - case slang_asm_float_add: - x87_fld (&G->f, x86_make_disp (G->r_esp, 4)); - x87_fld (&G->f, x86_deref (G->r_esp)); - x87_faddp (&G->f, G->r_st1); - x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 4)); - x87_fstp (&G->f, x86_deref (G->r_esp)); - break; - case slang_asm_float_multiply: - x87_fld (&G->f, x86_make_disp (G->r_esp, 4)); - x87_fld (&G->f, x86_deref (G->r_esp)); - x87_fmulp (&G->f, G->r_st1); - x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 4)); - x87_fstp (&G->f, x86_deref (G->r_esp)); - break; - case slang_asm_float_divide: - x87_fld (&G->f, x86_make_disp (G->r_esp, 4)); - x87_fld (&G->f, x86_deref (G->r_esp)); - x87_fdivp (&G->f, G->r_st1); - x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 4)); - x87_fstp (&G->f, x86_deref (G->r_esp)); - break; - case slang_asm_float_negate: - x87_fld (&G->f, x86_deref (G->r_esp)); - x87_fchs (&G->f); - x87_fstp (&G->f, x86_deref (G->r_esp)); - break; - case slang_asm_float_less: - x87_fld (&G->f, x86_make_disp (G->r_esp, 4)); - x87_fcomp (&G->f, x86_deref (G->r_esp)); - x87_fnstsw (&G->f, G->r_eax); - /* TODO: use test r8,imm8 */ - x86_mov_reg_imm (&G->f, G->r_ecx, 0x100); - x86_test (&G->f, G->r_eax, G->r_ecx); - { - GLubyte *lab0, *lab1; - - /* TODO: use jcc rel8 */ - lab0 = x86_jcc_forward (&G->f, cc_E); - x86_mov_reg_imm (&G->f, G->r_ecx, FLOAT_ONE); - /* TODO: use jmp rel8 */ - lab1 = x86_jmp_forward (&G->f); - x86_fixup_fwd_jump (&G->f, lab0); - x86_mov_reg_imm (&G->f, G->r_ecx, FLOAT_ZERO); - x86_fixup_fwd_jump (&G->f, lab1); - x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 4)); - x86_mov (&G->f, x86_deref (G->r_esp), G->r_ecx); - } - break; - case slang_asm_float_equal_exp: - x87_fld (&G->f, x86_make_disp (G->r_esp, 4)); - x87_fcomp (&G->f, x86_deref (G->r_esp)); - x87_fnstsw (&G->f, G->r_eax); - /* TODO: use test r8,imm8 */ - x86_mov_reg_imm (&G->f, G->r_ecx, 0x4000); - x86_test (&G->f, G->r_eax, G->r_ecx); - { - GLubyte *lab0, *lab1; - - /* TODO: use jcc rel8 */ - lab0 = x86_jcc_forward (&G->f, cc_E); - x86_mov_reg_imm (&G->f, G->r_ecx, FLOAT_ONE); - /* TODO: use jmp rel8 */ - lab1 = x86_jmp_forward (&G->f); - x86_fixup_fwd_jump (&G->f, lab0); - x86_mov_reg_imm (&G->f, G->r_ecx, FLOAT_ZERO); - x86_fixup_fwd_jump (&G->f, lab1); - x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 4)); - x86_mov (&G->f, x86_deref (G->r_esp), G->r_ecx); - } - break; - case slang_asm_float_equal_int: - x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, -4)); - x87_fld (&G->f, x86_make_disp (G->r_esp, a->param[0] + 4)); - x87_fcomp (&G->f, x86_make_disp (G->r_esp, a->param[1] + 4)); - x87_fnstsw (&G->f, G->r_eax); - /* TODO: use test r8,imm8 */ - x86_mov_reg_imm (&G->f, G->r_ecx, 0x4000); - x86_test (&G->f, G->r_eax, G->r_ecx); - { - GLubyte *lab0, *lab1; - - /* TODO: use jcc rel8 */ - lab0 = x86_jcc_forward (&G->f, cc_E); - x86_mov_reg_imm (&G->f, G->r_ecx, FLOAT_ONE); - /* TODO: use jmp rel8 */ - lab1 = x86_jmp_forward (&G->f); - x86_fixup_fwd_jump (&G->f, lab0); - x86_mov_reg_imm (&G->f, G->r_ecx, FLOAT_ZERO); - x86_fixup_fwd_jump (&G->f, lab1); - x86_mov (&G->f, x86_deref (G->r_esp), G->r_ecx); - } - break; - case slang_asm_float_to_int: + GLint disp, i; + + switch (a->type) { + case slang_asm_none: + break; + case slang_asm_float_copy: + case slang_asm_int_copy: + case slang_asm_bool_copy: + x86_mov(&G->f, G->r_eax, x86_make_disp(G->r_esp, a->param[0])); + x86_pop(&G->f, G->r_ecx); + x86_mov(&G->f, x86_make_disp(G->r_eax, a->param[1]), G->r_ecx); + break; + case slang_asm_float_move: + case slang_asm_int_move: + case slang_asm_bool_move: + x86_lea(&G->f, G->r_eax, x86_make_disp(G->r_esp, a->param[1])); + x86_add(&G->f, G->r_eax, x86_deref(G->r_esp)); + x86_mov(&G->f, G->r_eax, x86_deref(G->r_eax)); + x86_mov(&G->f, x86_make_disp(G->r_esp, a->param[0]), G->r_eax); + break; + case slang_asm_float_push: + case slang_asm_int_push: + case slang_asm_bool_push: + /* TODO: use push imm32 */ + x86_mov_reg_imm(&G->f, G->r_eax, *((GLint *) & a->literal)); + x86_push(&G->f, G->r_eax); + break; + case slang_asm_float_deref: + case slang_asm_int_deref: + case slang_asm_bool_deref: + case slang_asm_addr_deref: + x86_mov(&G->f, G->r_eax, x86_deref(G->r_esp)); + x86_mov(&G->f, G->r_eax, x86_deref(G->r_eax)); + x86_mov(&G->f, x86_deref(G->r_esp), G->r_eax); + break; + case slang_asm_float_add: + x87_fld(&G->f, x86_make_disp(G->r_esp, 4)); + x87_fld(&G->f, x86_deref(G->r_esp)); + x87_faddp(&G->f, G->r_st1); + x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 4)); + x87_fstp(&G->f, x86_deref(G->r_esp)); + break; + case slang_asm_float_multiply: + x87_fld(&G->f, x86_make_disp(G->r_esp, 4)); + x87_fld(&G->f, x86_deref(G->r_esp)); + x87_fmulp(&G->f, G->r_st1); + x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 4)); + x87_fstp(&G->f, x86_deref(G->r_esp)); + break; + case slang_asm_float_divide: + x87_fld(&G->f, x86_make_disp(G->r_esp, 4)); + x87_fld(&G->f, x86_deref(G->r_esp)); + x87_fdivp(&G->f, G->r_st1); + x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 4)); + x87_fstp(&G->f, x86_deref(G->r_esp)); + break; + case slang_asm_float_negate: + x87_fld(&G->f, x86_deref(G->r_esp)); + x87_fchs(&G->f); + x87_fstp(&G->f, x86_deref(G->r_esp)); + break; + case slang_asm_float_less: + x87_fld(&G->f, x86_make_disp(G->r_esp, 4)); + x87_fcomp(&G->f, x86_deref(G->r_esp)); + x87_fnstsw(&G->f, G->r_eax); + /* TODO: use test r8,imm8 */ + x86_mov_reg_imm(&G->f, G->r_ecx, 0x100); + x86_test(&G->f, G->r_eax, G->r_ecx); + { + GLubyte *lab0, *lab1; + /* TODO: use jcc rel8 */ + lab0 = x86_jcc_forward(&G->f, cc_E); + x86_mov_reg_imm(&G->f, G->r_ecx, FLOAT_ONE); + /* TODO: use jmp rel8 */ + lab1 = x86_jmp_forward(&G->f); + x86_fixup_fwd_jump(&G->f, lab0); + x86_mov_reg_imm(&G->f, G->r_ecx, FLOAT_ZERO); + x86_fixup_fwd_jump(&G->f, lab1); + x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 4)); + x86_mov(&G->f, x86_deref(G->r_esp), G->r_ecx); + } + break; + case slang_asm_float_equal_exp: + x87_fld(&G->f, x86_make_disp(G->r_esp, 4)); + x87_fcomp(&G->f, x86_deref(G->r_esp)); + x87_fnstsw(&G->f, G->r_eax); + /* TODO: use test r8,imm8 */ + x86_mov_reg_imm(&G->f, G->r_ecx, 0x4000); + x86_test(&G->f, G->r_eax, G->r_ecx); + { + GLubyte *lab0, *lab1; + /* TODO: use jcc rel8 */ + lab0 = x86_jcc_forward(&G->f, cc_E); + x86_mov_reg_imm(&G->f, G->r_ecx, FLOAT_ONE); + /* TODO: use jmp rel8 */ + lab1 = x86_jmp_forward(&G->f); + x86_fixup_fwd_jump(&G->f, lab0); + x86_mov_reg_imm(&G->f, G->r_ecx, FLOAT_ZERO); + x86_fixup_fwd_jump(&G->f, lab1); + x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 4)); + x86_mov(&G->f, x86_deref(G->r_esp), G->r_ecx); + } + break; + case slang_asm_float_equal_int: + x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, -4)); + x87_fld(&G->f, x86_make_disp(G->r_esp, a->param[0] + 4)); + x87_fcomp(&G->f, x86_make_disp(G->r_esp, a->param[1] + 4)); + x87_fnstsw(&G->f, G->r_eax); + /* TODO: use test r8,imm8 */ + x86_mov_reg_imm(&G->f, G->r_ecx, 0x4000); + x86_test(&G->f, G->r_eax, G->r_ecx); + { + GLubyte *lab0, *lab1; + /* TODO: use jcc rel8 */ + lab0 = x86_jcc_forward(&G->f, cc_E); + x86_mov_reg_imm(&G->f, G->r_ecx, FLOAT_ONE); + /* TODO: use jmp rel8 */ + lab1 = x86_jmp_forward(&G->f); + x86_fixup_fwd_jump(&G->f, lab0); + x86_mov_reg_imm(&G->f, G->r_ecx, FLOAT_ZERO); + x86_fixup_fwd_jump(&G->f, lab1); + x86_mov(&G->f, x86_deref(G->r_esp), G->r_ecx); + } + break; + case slang_asm_float_to_int: /* TODO: use fistp without rounding */ - x86_call (&G->f, (GLubyte *) (do_ftoi)); - x87_fstp (&G->f, x86_deref (G->r_esp)); - break; - case slang_asm_float_sine: - /* TODO: use fsin */ - x86_call (&G->f, (GLubyte *) _mesa_sinf); - x87_fstp (&G->f, x86_deref (G->r_esp)); - break; - case slang_asm_float_arcsine: - /* TODO: use fpatan (?) */ - x86_call (&G->f, (GLubyte *) _mesa_asinf); - x87_fstp (&G->f, x86_deref (G->r_esp)); - break; - case slang_asm_float_arctan: - /* TODO: use fpatan */ - x86_call (&G->f, (GLubyte *) _mesa_atanf); - x87_fstp (&G->f, x86_deref (G->r_esp)); - break; - case slang_asm_float_power: - /* TODO: use emit_pow() */ - x86_call (&G->f, (GLubyte *) do_powf); - x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 4)); - x87_fstp (&G->f, x86_deref (G->r_esp)); - break; - case slang_asm_float_log2: - x87_fld1 (&G->f); - x87_fld (&G->f, x86_deref (G->r_esp)); - x87_fyl2x (&G->f); - x87_fstp (&G->f, x86_deref (G->r_esp)); - break; - case slang_asm_float_floor: - x86_call (&G->f, (GLubyte *) do_floorf); - x87_fstp (&G->f, x86_deref (G->r_esp)); - break; - case slang_asm_float_ceil: - x86_call (&G->f, (GLubyte *) do_ceilf); - x87_fstp (&G->f, x86_deref (G->r_esp)); - break; - case slang_asm_float_noise1: - x86_call (&G->f, (GLubyte *) _slang_library_noise1); - x87_fstp (&G->f, x86_deref (G->r_esp)); - break; - case slang_asm_float_noise2: - x86_call (&G->f, (GLubyte *) _slang_library_noise2); - x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 4)); - x87_fstp (&G->f, x86_deref (G->r_esp)); - break; - case slang_asm_float_noise3: - x86_call (&G->f, (GLubyte *) _slang_library_noise4); - x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 8)); - x87_fstp (&G->f, x86_deref (G->r_esp)); - break; - case slang_asm_float_noise4: - x86_call (&G->f, (GLubyte *) _slang_library_noise4); - x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 12)); - x87_fstp (&G->f, x86_deref (G->r_esp)); - break; - case slang_asm_int_to_float: - break; - case slang_asm_int_to_addr: - x87_fld (&G->f, x86_deref (G->r_esp)); - x87_fistp (&G->f, x86_deref (G->r_esp)); - break; - case slang_asm_addr_copy: - x86_pop (&G->f, G->r_eax); - x86_mov (&G->f, G->r_ecx, x86_deref (G->r_esp)); - x86_mov (&G->f, x86_deref (G->r_ecx), G->r_eax); - break; - case slang_asm_addr_push: - /* TODO: use push imm32 */ - x86_mov_reg_imm (&G->f, G->r_eax, (GLint) a->param[0]); - x86_push (&G->f, G->r_eax); - break; - case slang_asm_addr_add: - x86_pop (&G->f, G->r_eax); - x86_add (&G->f, x86_deref (G->r_esp), G->r_eax); - break; - case slang_asm_addr_multiply: - x86_pop (&G->f, G->r_ecx); - x86_mov (&G->f, G->r_eax, x86_deref (G->r_esp)); - x86_mul (&G->f, G->r_ecx); - x86_mov (&G->f, x86_deref (G->r_esp), G->r_eax); - break; - case slang_asm_vec4_tex1d: - x86_call (&G->f, (GLubyte *) _slang_library_tex1d); - x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 12)); - break; - case slang_asm_vec4_tex2d: - x86_call (&G->f, (GLubyte *) _slang_library_tex2d); - x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 16)); - break; - case slang_asm_vec4_tex3d: - x86_call (&G->f, (GLubyte *) _slang_library_tex3d); - x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 20)); - break; - case slang_asm_vec4_texcube: - x86_call (&G->f, (GLubyte *) _slang_library_texcube); - x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 20)); - break; - case slang_asm_vec4_shad1d: - x86_call (&G->f, (GLubyte *) _slang_library_shad1d); - x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 20)); - break; - case slang_asm_vec4_shad2d: - x86_call (&G->f, (GLubyte *) _slang_library_shad2d); - x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 20)); - break; - case slang_asm_jump: - add_fixup (G, a->param[0], x86_jmp_forward (&G->f)); - break; - case slang_asm_jump_if_zero: - x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 4)); - x86_xor (&G->f, G->r_eax, G->r_eax); - x86_cmp (&G->f, G->r_eax, x86_make_disp (G->r_esp, -4)); - { - GLubyte *lab0; - - /* TODO: use jcc rel8 */ - lab0 = x86_jcc_forward (&G->f, cc_NE); - add_fixup (G, a->param[0], x86_jmp_forward (&G->f)); - x86_fixup_fwd_jump (&G->f, lab0); - } - break; - case slang_asm_enter: - /* FIXME: x86_make_disp(esp, 0) + x86_lea() generates bogus code */ - assert (a->param[0] != 0); - x86_push (&G->f, G->r_ebp); - x86_lea (&G->f, G->r_ebp, x86_make_disp (G->r_esp, (GLint) a->param[0])); - break; - case slang_asm_leave: - x86_pop (&G->f, G->r_ebp); - break; - case slang_asm_local_alloc: - /* FIXME: x86_make_disp(esp, 0) + x86_lea() generates bogus code */ - assert (a->param[0] != 0); - x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, -(GLint) a->param[0])); - break; - case slang_asm_local_free: - /* FIXME: x86_make_disp(esp, 0) + x86_lea() generates bogus code */ - assert (a->param[0] != 0); - x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, (GLint) a->param[0])); - break; - case slang_asm_local_addr: - disp = -(GLint) (a->param[0] + a->param[1]) + 4; - if (disp != 0) - { - x86_lea (&G->f, G->r_eax, x86_make_disp (G->r_ebp, disp)); - x86_push (&G->f, G->r_eax); - } - else - x86_push (&G->f, G->r_ebp); - break; - case slang_asm_global_addr: - /* TODO: use push imm32 */ - x86_mov_reg_imm (&G->f, G->r_eax, (GLint) &G->mach->mem + a->param[0]); - x86_push (&G->f, G->r_eax); - break; - case slang_asm_call: - add_fixup (G, a->param[0], x86_call_forward (&G->f)); - break; - case slang_asm_return: - x86_ret (&G->f); - break; - case slang_asm_discard: - x86_jmp (&G->f, G->l_discard); - break; - case slang_asm_exit: - x86_jmp (&G->f, G->l_exit); - break; - /* GL_MESA_shader_debug */ + x86_call(&G->f, (GLubyte *) (do_ftoi)); + x87_fstp(&G->f, x86_deref(G->r_esp)); + break; + case slang_asm_float_sine: + /* TODO: use fsin */ + x86_call(&G->f, (GLubyte *) _mesa_sinf); + x87_fstp(&G->f, x86_deref(G->r_esp)); + break; + case slang_asm_float_arcsine: + /* TODO: use fpatan (?) */ + x86_call(&G->f, (GLubyte *) _mesa_asinf); + x87_fstp(&G->f, x86_deref(G->r_esp)); + break; + case slang_asm_float_arctan: + /* TODO: use fpatan */ + x86_call(&G->f, (GLubyte *) _mesa_atanf); + x87_fstp(&G->f, x86_deref(G->r_esp)); + break; + case slang_asm_float_power: + /* TODO: use emit_pow() */ + x86_call(&G->f, (GLubyte *) do_powf); + x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 4)); + x87_fstp(&G->f, x86_deref(G->r_esp)); + break; + case slang_asm_float_log2: + x87_fld1(&G->f); + x87_fld(&G->f, x86_deref(G->r_esp)); + x87_fyl2x(&G->f); + x87_fstp(&G->f, x86_deref(G->r_esp)); + break; + case slang_asm_float_floor: + x86_call(&G->f, (GLubyte *) do_floorf); + x87_fstp(&G->f, x86_deref(G->r_esp)); + break; + case slang_asm_float_ceil: + x86_call(&G->f, (GLubyte *) do_ceilf); + x87_fstp(&G->f, x86_deref(G->r_esp)); + break; + case slang_asm_float_noise1: + x86_call(&G->f, (GLubyte *) _slang_library_noise1); + x87_fstp(&G->f, x86_deref(G->r_esp)); + break; + case slang_asm_float_noise2: + x86_call(&G->f, (GLubyte *) _slang_library_noise2); + x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 4)); + x87_fstp(&G->f, x86_deref(G->r_esp)); + break; + case slang_asm_float_noise3: + x86_call(&G->f, (GLubyte *) _slang_library_noise4); + x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 8)); + x87_fstp(&G->f, x86_deref(G->r_esp)); + break; + case slang_asm_float_noise4: + x86_call(&G->f, (GLubyte *) _slang_library_noise4); + x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 12)); + x87_fstp(&G->f, x86_deref(G->r_esp)); + break; + case slang_asm_int_to_float: + break; + case slang_asm_int_to_addr: + x87_fld(&G->f, x86_deref(G->r_esp)); + x87_fistp(&G->f, x86_deref(G->r_esp)); + break; + case slang_asm_addr_copy: + x86_pop(&G->f, G->r_eax); + x86_mov(&G->f, G->r_ecx, x86_deref(G->r_esp)); + x86_mov(&G->f, x86_deref(G->r_ecx), G->r_eax); + break; + case slang_asm_addr_push: + /* TODO: use push imm32 */ + x86_mov_reg_imm(&G->f, G->r_eax, (GLint) a->param[0]); + x86_push(&G->f, G->r_eax); + break; + case slang_asm_addr_add: + x86_pop(&G->f, G->r_eax); + x86_add(&G->f, x86_deref(G->r_esp), G->r_eax); + break; + case slang_asm_addr_multiply: + x86_pop(&G->f, G->r_ecx); + x86_mov(&G->f, G->r_eax, x86_deref(G->r_esp)); + x86_mul(&G->f, G->r_ecx); + x86_mov(&G->f, x86_deref(G->r_esp), G->r_eax); + break; + case slang_asm_vec4_tex1d: + x86_call(&G->f, (GLubyte *) _slang_library_tex1d); + x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 12)); + break; + case slang_asm_vec4_tex2d: + x86_call(&G->f, (GLubyte *) _slang_library_tex2d); + x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 16)); + break; + case slang_asm_vec4_tex3d: + x86_call(&G->f, (GLubyte *) _slang_library_tex3d); + x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 20)); + break; + case slang_asm_vec4_texcube: + x86_call(&G->f, (GLubyte *) _slang_library_texcube); + x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 20)); + break; + case slang_asm_vec4_shad1d: + x86_call(&G->f, (GLubyte *) _slang_library_shad1d); + x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 20)); + break; + case slang_asm_vec4_shad2d: + x86_call(&G->f, (GLubyte *) _slang_library_shad2d); + x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 20)); + break; + case slang_asm_jump: + add_fixup(G, a->param[0], x86_jmp_forward(&G->f)); + break; + case slang_asm_jump_if_zero: + x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 4)); + x86_xor(&G->f, G->r_eax, G->r_eax); + x86_cmp(&G->f, G->r_eax, x86_make_disp(G->r_esp, -4)); + { + GLubyte *lab0; + /* TODO: use jcc rel8 */ + lab0 = x86_jcc_forward(&G->f, cc_NE); + add_fixup(G, a->param[0], x86_jmp_forward(&G->f)); + x86_fixup_fwd_jump(&G->f, lab0); + } + break; + case slang_asm_enter: + /* FIXME: x86_make_disp(esp, 0) + x86_lea() generates bogus code */ + assert(a->param[0] != 0); + x86_push(&G->f, G->r_ebp); + x86_lea(&G->f, G->r_ebp, x86_make_disp(G->r_esp, (GLint) a->param[0])); + break; + case slang_asm_leave: + x86_pop(&G->f, G->r_ebp); + break; + case slang_asm_local_alloc: + /* FIXME: x86_make_disp(esp, 0) + x86_lea() generates bogus code */ + assert(a->param[0] != 0); + x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, -(GLint) a->param[0])); + break; + case slang_asm_local_free: + /* FIXME: x86_make_disp(esp, 0) + x86_lea() generates bogus code */ + assert(a->param[0] != 0); + x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, (GLint) a->param[0])); + break; + case slang_asm_local_addr: + disp = -(GLint) (a->param[0] + a->param[1]) + 4; + if (disp != 0) { + x86_lea(&G->f, G->r_eax, x86_make_disp(G->r_ebp, disp)); + x86_push(&G->f, G->r_eax); + } + else + x86_push(&G->f, G->r_ebp); + break; + case slang_asm_global_addr: + /* TODO: use push imm32 */ + x86_mov_reg_imm(&G->f, G->r_eax, (GLint) & G->mach->mem + a->param[0]); + x86_push(&G->f, G->r_eax); + break; + case slang_asm_call: + add_fixup(G, a->param[0], x86_call_forward(&G->f)); + break; + case slang_asm_return: + x86_ret(&G->f); + break; + case slang_asm_discard: + x86_jmp(&G->f, G->l_discard); + break; + case slang_asm_exit: + x86_jmp(&G->f, G->l_exit); + break; + /* GL_MESA_shader_debug */ case slang_asm_float_print: /* TODO: use push imm32 */ - x86_mov_reg_imm (&G->f, G->r_eax, (GLint) (infolog)); - x86_push (&G->f, G->r_eax); - x86_call (&G->f, (GLubyte *) (do_print_float)); - x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 4)); + x86_mov_reg_imm(&G->f, G->r_eax, (GLint) (infolog)); + x86_push(&G->f, G->r_eax); + x86_call(&G->f, (GLubyte *) (do_print_float)); + x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 4)); break; - case slang_asm_int_print: + case slang_asm_int_print: /* TODO: use push imm32 */ - x86_mov_reg_imm (&G->f, G->r_eax, (GLint) (infolog)); - x86_push (&G->f, G->r_eax); - x86_call (&G->f, (GLubyte *) do_print_int); - x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 4)); - break; - case slang_asm_bool_print: + x86_mov_reg_imm(&G->f, G->r_eax, (GLint) (infolog)); + x86_push(&G->f, G->r_eax); + x86_call(&G->f, (GLubyte *) do_print_int); + x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 4)); + break; + case slang_asm_bool_print: /* TODO: use push imm32 */ - x86_mov_reg_imm (&G->f, G->r_eax, (GLint) (infolog)); - x86_push (&G->f, G->r_eax); - x86_call (&G->f, (GLubyte *) do_print_bool); - x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 4)); - break; - /* vec4 */ + x86_mov_reg_imm(&G->f, G->r_eax, (GLint) (infolog)); + x86_push(&G->f, G->r_eax); + x86_call(&G->f, (GLubyte *) do_print_bool); + x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 4)); + break; + /* vec4 */ case slang_asm_float_to_vec4: /* [vec4] | float > [vec4] */ - x87_fld (&G->f, x86_deref (G->r_esp)); - x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 4)); - x86_mov (&G->f, G->r_eax, x86_deref (G->r_esp)); - x87_fst (&G->f, x86_make_disp (G->r_eax, 12)); - x87_fst (&G->f, x86_make_disp (G->r_eax, 8)); - x87_fst (&G->f, x86_make_disp (G->r_eax, 4)); - x87_fstp (&G->f, x86_deref (G->r_eax)); + x87_fld(&G->f, x86_deref(G->r_esp)); + x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 4)); + x86_mov(&G->f, G->r_eax, x86_deref(G->r_esp)); + x87_fst(&G->f, x86_make_disp(G->r_eax, 12)); + x87_fst(&G->f, x86_make_disp(G->r_eax, 8)); + x87_fst(&G->f, x86_make_disp(G->r_eax, 4)); + x87_fstp(&G->f, x86_deref(G->r_eax)); break; case slang_asm_vec4_add: /* [vec4] | vec4 > [vec4] */ - x86_mov (&G->f, G->r_eax, x86_make_disp (G->r_esp, 16)); + x86_mov(&G->f, G->r_eax, x86_make_disp(G->r_esp, 16)); for (i = 0; i < 4; i++) - x87_fld (&G->f, x86_make_disp (G->r_eax, i * 4)); + x87_fld(&G->f, x86_make_disp(G->r_eax, i * 4)); for (i = 0; i < 4; i++) - x87_fld (&G->f, x86_make_disp (G->r_esp, i * 4)); - x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 16)); + x87_fld(&G->f, x86_make_disp(G->r_esp, i * 4)); + x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 16)); for (i = 0; i < 4; i++) - x87_faddp (&G->f, G->r_st4); + x87_faddp(&G->f, G->r_st4); for (i = 0; i < 4; i++) - x87_fstp (&G->f, x86_make_disp (G->r_eax, 12 - i * 4)); + x87_fstp(&G->f, x86_make_disp(G->r_eax, 12 - i * 4)); break; case slang_asm_vec4_subtract: /* [vec4] | vec4 > [vec4] */ - x86_mov (&G->f, G->r_eax, x86_make_disp (G->r_esp, 16)); + x86_mov(&G->f, G->r_eax, x86_make_disp(G->r_esp, 16)); for (i = 0; i < 4; i++) - x87_fld (&G->f, x86_make_disp (G->r_eax, i * 4)); + x87_fld(&G->f, x86_make_disp(G->r_eax, i * 4)); for (i = 0; i < 4; i++) - x87_fld (&G->f, x86_make_disp (G->r_esp, i * 4)); - x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 16)); + x87_fld(&G->f, x86_make_disp(G->r_esp, i * 4)); + x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 16)); for (i = 0; i < 4; i++) - x87_fsubp (&G->f, G->r_st4); + x87_fsubp(&G->f, G->r_st4); for (i = 0; i < 4; i++) - x87_fstp (&G->f, x86_make_disp (G->r_eax, 12 - i * 4)); + x87_fstp(&G->f, x86_make_disp(G->r_eax, 12 - i * 4)); break; case slang_asm_vec4_multiply: /* [vec4] | vec4 > [vec4] */ - x86_mov (&G->f, G->r_eax, x86_make_disp (G->r_esp, 16)); + x86_mov(&G->f, G->r_eax, x86_make_disp(G->r_esp, 16)); for (i = 0; i < 4; i++) - x87_fld (&G->f, x86_make_disp (G->r_eax, i * 4)); + x87_fld(&G->f, x86_make_disp(G->r_eax, i * 4)); for (i = 0; i < 4; i++) - x87_fld (&G->f, x86_make_disp (G->r_esp, i * 4)); - x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 16)); + x87_fld(&G->f, x86_make_disp(G->r_esp, i * 4)); + x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 16)); for (i = 0; i < 4; i++) - x87_fmulp (&G->f, G->r_st4); + x87_fmulp(&G->f, G->r_st4); for (i = 0; i < 4; i++) - x87_fstp (&G->f, x86_make_disp (G->r_eax, 12 - i * 4)); + x87_fstp(&G->f, x86_make_disp(G->r_eax, 12 - i * 4)); break; case slang_asm_vec4_divide: /* [vec4] | vec4 > [vec4] */ - x86_mov (&G->f, G->r_eax, x86_make_disp (G->r_esp, 16)); + x86_mov(&G->f, G->r_eax, x86_make_disp(G->r_esp, 16)); for (i = 0; i < 4; i++) - x87_fld (&G->f, x86_make_disp (G->r_eax, i * 4)); + x87_fld(&G->f, x86_make_disp(G->r_eax, i * 4)); for (i = 0; i < 4; i++) - x87_fld (&G->f, x86_make_disp (G->r_esp, i * 4)); - x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 16)); + x87_fld(&G->f, x86_make_disp(G->r_esp, i * 4)); + x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 16)); for (i = 0; i < 4; i++) - x87_fdivp (&G->f, G->r_st4); + x87_fdivp(&G->f, G->r_st4); for (i = 0; i < 4; i++) - x87_fstp (&G->f, x86_make_disp (G->r_eax, 12 - i * 4)); + x87_fstp(&G->f, x86_make_disp(G->r_eax, 12 - i * 4)); break; case slang_asm_vec4_negate: /* [vec4] > [vec4] */ - x86_mov (&G->f, G->r_eax, x86_deref (G->r_esp)); + x86_mov(&G->f, G->r_eax, x86_deref(G->r_esp)); for (i = 0; i < 4; i++) - x87_fld (&G->f, x86_make_disp (G->r_eax, i * 4)); + x87_fld(&G->f, x86_make_disp(G->r_eax, i * 4)); for (i = 0; i < 4; i++) { - x87_fchs (&G->f); - x87_fstp (&G->f, x86_make_disp (G->r_eax, 12 - i * 4)); + x87_fchs(&G->f); + x87_fstp(&G->f, x86_make_disp(G->r_eax, 12 - i * 4)); } break; case slang_asm_vec4_dot: /* [vec4] | vec4 > [float] */ for (i = 0; i < 4; i++) - x87_fld (&G->f, x86_make_disp (G->r_esp, i * 4)); - x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 16)); - x86_mov (&G->f, G->r_eax, x86_deref (G->r_esp)); + x87_fld(&G->f, x86_make_disp(G->r_esp, i * 4)); + x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 16)); + x86_mov(&G->f, G->r_eax, x86_deref(G->r_esp)); for (i = 0; i < 4; i++) - x87_fld (&G->f, x86_make_disp (G->r_eax, i * 4)); + x87_fld(&G->f, x86_make_disp(G->r_eax, i * 4)); for (i = 0; i < 4; i++) - x87_fmulp (&G->f, G->r_st4); + x87_fmulp(&G->f, G->r_st4); for (i = 0; i < 3; i++) - x87_faddp (&G->f, G->r_st1); - x87_fstp (&G->f, x86_deref (G->r_eax)); + x87_faddp(&G->f, G->r_st1); + x87_fstp(&G->f, x86_deref(G->r_eax)); break; case slang_asm_vec4_copy: /* [vec4] | vec4 > [vec4] */ - x86_mov (&G->f, G->r_eax, x86_make_disp (G->r_esp, a->param[0])); - x86_pop (&G->f, G->r_ecx); - x86_pop (&G->f, G->r_edx); - x86_mov (&G->f, x86_make_disp (G->r_eax, a->param[1]), G->r_ecx); - x86_pop (&G->f, G->r_ebx); - x86_mov (&G->f, x86_make_disp (G->r_eax, a->param[1] + 4), G->r_edx); - x86_pop (&G->f, G->r_ecx); - x86_mov (&G->f, x86_make_disp (G->r_eax, a->param[1] + 8), G->r_ebx); - x86_mov (&G->f, x86_make_disp (G->r_eax, a->param[1] + 12), G->r_ecx); + x86_mov(&G->f, G->r_eax, x86_make_disp(G->r_esp, a->param[0])); + x86_pop(&G->f, G->r_ecx); + x86_pop(&G->f, G->r_edx); + x86_mov(&G->f, x86_make_disp(G->r_eax, a->param[1]), G->r_ecx); + x86_pop(&G->f, G->r_ebx); + x86_mov(&G->f, x86_make_disp(G->r_eax, a->param[1] + 4), G->r_edx); + x86_pop(&G->f, G->r_ecx); + x86_mov(&G->f, x86_make_disp(G->r_eax, a->param[1] + 8), G->r_ebx); + x86_mov(&G->f, x86_make_disp(G->r_eax, a->param[1] + 12), G->r_ecx); break; case slang_asm_vec4_deref: /* [vec4] > vec4 */ - x86_mov (&G->f, G->r_eax, x86_deref (G->r_esp)); - x86_mov (&G->f, G->r_ecx, x86_make_disp (G->r_eax, 12)); - x86_mov (&G->f, G->r_edx, x86_make_disp (G->r_eax, 8)); - x86_mov (&G->f, x86_deref (G->r_esp), G->r_ecx); - x86_mov (&G->f, G->r_ebx, x86_make_disp (G->r_eax, 4)); - x86_push (&G->f, G->r_edx); - x86_mov (&G->f, G->r_ecx, x86_deref (G->r_eax)); - x86_push (&G->f, G->r_ebx); - x86_push (&G->f, G->r_ecx); + x86_mov(&G->f, G->r_eax, x86_deref(G->r_esp)); + x86_mov(&G->f, G->r_ecx, x86_make_disp(G->r_eax, 12)); + x86_mov(&G->f, G->r_edx, x86_make_disp(G->r_eax, 8)); + x86_mov(&G->f, x86_deref(G->r_esp), G->r_ecx); + x86_mov(&G->f, G->r_ebx, x86_make_disp(G->r_eax, 4)); + x86_push(&G->f, G->r_edx); + x86_mov(&G->f, G->r_ecx, x86_deref(G->r_eax)); + x86_push(&G->f, G->r_ebx); + x86_push(&G->f, G->r_ecx); break; case slang_asm_vec4_equal_int: - x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, -4)); - x86_mov_reg_imm (&G->f, G->r_edx, 0x4000); + x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, -4)); + x86_mov_reg_imm(&G->f, G->r_edx, 0x4000); for (i = 0; i < 4; i++) { - x87_fld (&G->f, x86_make_disp (G->r_esp, a->param[0] + 4 + i * 4)); - x87_fcomp (&G->f, x86_make_disp (G->r_esp, a->param[1] + 4 + i * 4)); - x87_fnstsw (&G->f, G->r_eax); - x86_and (&G->f, G->r_edx, G->r_eax); + x87_fld(&G->f, x86_make_disp(G->r_esp, a->param[0] + 4 + i * 4)); + x87_fcomp(&G->f, x86_make_disp(G->r_esp, a->param[1] + 4 + i * 4)); + x87_fnstsw(&G->f, G->r_eax); + x86_and(&G->f, G->r_edx, G->r_eax); } /* TODO: use test r8,imm8 */ - x86_mov_reg_imm (&G->f, G->r_ecx, 0x4000); - x86_test (&G->f, G->r_edx, G->r_ecx); + x86_mov_reg_imm(&G->f, G->r_ecx, 0x4000); + x86_test(&G->f, G->r_edx, G->r_ecx); { GLubyte *lab0, *lab1; /* TODO: use jcc rel8 */ - lab0 = x86_jcc_forward (&G->f, cc_E); - x86_mov_reg_imm (&G->f, G->r_ecx, FLOAT_ONE); + lab0 = x86_jcc_forward(&G->f, cc_E); + x86_mov_reg_imm(&G->f, G->r_ecx, FLOAT_ONE); /* TODO: use jmp rel8 */ - lab1 = x86_jmp_forward (&G->f); - x86_fixup_fwd_jump (&G->f, lab0); - x86_mov_reg_imm (&G->f, G->r_ecx, FLOAT_ZERO); - x86_fixup_fwd_jump (&G->f, lab1); - x86_mov (&G->f, x86_deref (G->r_esp), G->r_ecx); + lab1 = x86_jmp_forward(&G->f); + x86_fixup_fwd_jump(&G->f, lab0); + x86_mov_reg_imm(&G->f, G->r_ecx, FLOAT_ZERO); + x86_fixup_fwd_jump(&G->f, lab1); + x86_mov(&G->f, x86_deref(G->r_esp), G->r_ecx); } break; default: - assert (0); + _mesa_problem(NULL, "Unexpected switch case in codegen_assem"); } } -GLboolean _slang_x86_codegen (slang_machine *mach, slang_assembly_file *file, GLuint start) +GLboolean +_slang_x86_codegen(slang_machine * mach, slang_assembly_file * file, + GLuint start) { - codegen_ctx G; - GLubyte *j_body, *j_exit; - GLuint i; + codegen_ctx G; + GLubyte *j_body, *j_exit; + GLuint i; /* Free the old code - if any. */ if (mach->x86.compiled_func != NULL) { - _mesa_exec_free (mach->x86.compiled_func); + _mesa_exec_free(mach->x86.compiled_func); mach->x86.compiled_func = NULL; } - /* - * We need as much as 1M because *all* assembly, including built-in library, is - * being translated to x86. - * The built-in library occupies 450K, so we can be safe for now. - * It is going to change in the future, when we get assembly analysis running. - */ - x86_init_func_size (&G.f, 1048576); - G.r_eax = x86_make_reg (file_REG32, reg_AX); - G.r_ecx = x86_make_reg (file_REG32, reg_CX); - G.r_edx = x86_make_reg (file_REG32, reg_DX); - G.r_ebx = x86_make_reg (file_REG32, reg_BX); - G.r_esp = x86_make_reg (file_REG32, reg_SP); - G.r_ebp = x86_make_reg (file_REG32, reg_BP); - G.r_st0 = x86_make_reg (file_x87, 0); - G.r_st1 = x86_make_reg (file_x87, 1); - G.r_st2 = x86_make_reg (file_x87, 2); - G.r_st3 = x86_make_reg (file_x87, 3); - G.r_st4 = x86_make_reg (file_x87, 4); - G.fixups = NULL; - G.fixup_count = 0; - G.labels = (GLubyte **) slang_alloc_malloc (file->count * sizeof (GLubyte *)); - G.mach = mach; - G.fpucntl = RESTORE_FPU; - - mach->x86.fpucntl_rnd_neg = RND_NEG_FPU; - mach->x86.fpucntl_restore = RESTORE_FPU; - - /* prepare stack and jump to start */ - x86_push (&G.f, G.r_ebp); - x86_mov_reg_imm (&G.f, G.r_eax, (GLint) &mach->x86.esp_restore); - x86_push (&G.f, G.r_esp); - x86_pop (&G.f, G.r_ecx); - x86_mov (&G.f, x86_deref (G.r_eax), G.r_ecx); - j_body = x86_jmp_forward (&G.f); - - /* "discard" instructions jump to this label */ - G.l_discard = x86_get_label (&G.f); - x86_mov_reg_imm (&G.f, G.r_eax, (GLint) &G.mach->kill); - x86_mov_reg_imm (&G.f, G.r_ecx, 1); - x86_mov (&G.f, x86_deref (G.r_eax), G.r_ecx); - G.l_exit = x86_get_label (&G.f); - j_exit = x86_jmp_forward (&G.f); - - for (i = 0; i < file->count; i++) - { - G.labels[i] = x86_get_label (&G.f); - if (i == start) - x86_fixup_fwd_jump (&G.f, j_body); - codegen_assem (&G, &file->code[i], &mach->infolog); - } - - /* - * Restore stack and return. - * This must be handled this way, because "discard" can be invoked from any - * place in the code. - */ - x86_fixup_fwd_jump (&G.f, j_exit); - x86_mov_reg_imm (&G.f, G.r_eax, (GLint) &mach->x86.esp_restore); - x86_mov (&G.f, G.r_esp, x86_deref (G.r_eax)); - x86_pop (&G.f, G.r_ebp); - if (G.fpucntl != RESTORE_FPU) - { - x87_fnclex (&G.f); - x86_mov_reg_imm (&G.f, G.r_eax, (GLint) &G.mach->x86.fpucntl_restore); - x87_fldcw (&G.f, x86_deref (G.r_eax)); - } - x86_ret (&G.f); - - /* fixup forward labels */ - for (i = 0; i < G.fixup_count; i++) - { - G.f.csr = G.labels[G.fixups[i].index]; - x86_fixup_fwd_jump (&G.f, G.fixups[i].csr); - } - - slang_alloc_free (G.fixups); - slang_alloc_free (G.labels); - - /* install new code */ - mach->x86.compiled_func = (GLvoid (*) (slang_machine *)) x86_get_func (&G.f); - - return GL_TRUE; + /* + * We need as much as 1M because *all* assembly, including built-in library, is + * being translated to x86. + * The built-in library occupies 450K, so we can be safe for now. + * It is going to change in the future, when we get assembly analysis running. + */ + x86_init_func_size(&G.f, 1048576); + G.r_eax = x86_make_reg(file_REG32, reg_AX); + G.r_ecx = x86_make_reg(file_REG32, reg_CX); + G.r_edx = x86_make_reg(file_REG32, reg_DX); + G.r_ebx = x86_make_reg(file_REG32, reg_BX); + G.r_esp = x86_make_reg(file_REG32, reg_SP); + G.r_ebp = x86_make_reg(file_REG32, reg_BP); + G.r_st0 = x86_make_reg(file_x87, 0); + G.r_st1 = x86_make_reg(file_x87, 1); + G.r_st2 = x86_make_reg(file_x87, 2); + G.r_st3 = x86_make_reg(file_x87, 3); + G.r_st4 = x86_make_reg(file_x87, 4); + G.fixups = NULL; + G.fixup_count = 0; + G.labels = + (GLubyte **) slang_alloc_malloc(file->count * sizeof(GLubyte *)); + G.mach = mach; + G.fpucntl = RESTORE_FPU; + + mach->x86.fpucntl_rnd_neg = RND_NEG_FPU; + mach->x86.fpucntl_restore = RESTORE_FPU; + + /* prepare stack and jump to start */ + x86_push(&G.f, G.r_ebp); + x86_mov_reg_imm(&G.f, G.r_eax, (GLint) & mach->x86.esp_restore); + x86_push(&G.f, G.r_esp); + x86_pop(&G.f, G.r_ecx); + x86_mov(&G.f, x86_deref(G.r_eax), G.r_ecx); + j_body = x86_jmp_forward(&G.f); + + /* "discard" instructions jump to this label */ + G.l_discard = x86_get_label(&G.f); + x86_mov_reg_imm(&G.f, G.r_eax, (GLint) & G.mach->kill); + x86_mov_reg_imm(&G.f, G.r_ecx, 1); + x86_mov(&G.f, x86_deref(G.r_eax), G.r_ecx); + G.l_exit = x86_get_label(&G.f); + j_exit = x86_jmp_forward(&G.f); + + for (i = 0; i < file->count; i++) { + G.labels[i] = x86_get_label(&G.f); + if (i == start) + x86_fixup_fwd_jump(&G.f, j_body); + codegen_assem(&G, &file->code[i], &mach->infolog); + } + + /* + * Restore stack and return. + * This must be handled this way, because "discard" can be invoked from any + * place in the code. + */ + x86_fixup_fwd_jump(&G.f, j_exit); + x86_mov_reg_imm(&G.f, G.r_eax, (GLint) & mach->x86.esp_restore); + x86_mov(&G.f, G.r_esp, x86_deref(G.r_eax)); + x86_pop(&G.f, G.r_ebp); + if (G.fpucntl != RESTORE_FPU) { + x87_fnclex(&G.f); + x86_mov_reg_imm(&G.f, G.r_eax, (GLint) & G.mach->x86.fpucntl_restore); + x87_fldcw(&G.f, x86_deref(G.r_eax)); + } + x86_ret(&G.f); + + /* fixup forward labels */ + for (i = 0; i < G.fixup_count; i++) { + G.f.csr = G.labels[G.fixups[i].index]; + x86_fixup_fwd_jump(&G.f, G.fixups[i].csr); + } + + slang_alloc_free(G.fixups); + slang_alloc_free(G.labels); + + /* install new code */ + mach->x86.compiled_func = (GLvoid(*)(slang_machine *)) x86_get_func(&G.f); + + return GL_TRUE; } #endif - diff --git a/src/mesa/shader/slang/slang_link.c b/src/mesa/shader/slang/slang_link.c index 66202edf8d0..6114b7c2520 100644 --- a/src/mesa/shader/slang/slang_link.c +++ b/src/mesa/shader/slang/slang_link.c @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.5 + * Version: 6.6 * * Copyright (C) 2006 Brian Paul All Rights Reserved. * @@ -32,774 +32,842 @@ #include "slang_link.h" #include "slang_analyse.h" -static GLboolean entry_has_gl_prefix (slang_atom name, slang_atom_pool *atoms) +#define TABLE_GROW(PTR,TYPE,N) \ + (PTR = (TYPE *) (slang_alloc_realloc (PTR, N * sizeof (TYPE), (N + 1) * sizeof (TYPE)))) + +/* + * Check if a given name starts with "gl_". Globals with this prefix are + * treated differently, as they are built-in variables. + */ +static GLboolean +entry_has_gl_prefix (slang_atom name, slang_atom_pool *atoms) { - const char *str = slang_atom_pool_id (atoms, name); - return str[0] == 'g' && str[1] == 'l' && str[2] == '_'; + const GLchar *str; + + str = slang_atom_pool_id (atoms, name); + return str[0] == 'g' && str[1] == 'l' && str[2] == '_'; } /* * slang_active_variables */ -static GLvoid slang_active_variables_ctr (slang_active_variables *self) +static GLvoid +slang_active_variables_ctr (slang_active_variables *self) { - self->table = NULL; - self->count = 0; + self->table = NULL; + self->count = 0; } -static GLvoid slang_active_variables_dtr (slang_active_variables *self) +static GLvoid +slang_active_variables_dtr (slang_active_variables *self) { - GLuint i; + GLuint i; - for (i = 0; i < self->count; i++) - slang_alloc_free (self->table[i].name); - slang_alloc_free (self->table); + for (i = 0; i < self->count; i++) + slang_alloc_free (self->table[i].name); + slang_alloc_free (self->table); } -static GLboolean add_simple_variable (slang_active_variables *self, slang_export_data_quant *q, - const char *name) +/* + * Active variable queried by the application cannot be a structure. Queriable globals + * (uniforms and attributes) are decomposited into "simple" variables if they are + * "complex". + */ + +static GLboolean +add_simple_variable (slang_active_variables *self, slang_export_data_quant *q, const GLchar *name) { - const GLuint n = self->count; + GLuint n; + slang_active_variable *var; - self->table = (slang_active_variable *) slang_alloc_realloc (self->table, - n * sizeof (slang_active_variable), (n + 1) * sizeof (slang_active_variable)); - if (self->table == NULL) - return GL_FALSE; + n = self->count; + if (!TABLE_GROW(self->table, slang_active_variable, n)) + return GL_FALSE; - self->table[n].quant = q; - self->table[n].name = slang_string_duplicate (name); - if (self->table[n].name == NULL) - return GL_FALSE; - self->count++; + /* Initialize the new element. Increment table size only when it is fully initilized. */ + var = &self->table[n]; + var->quant = q; + var->name = slang_string_duplicate (name); + if (var->name == NULL) + return GL_FALSE; + self->count++; - return GL_TRUE; + return GL_TRUE; } -static GLboolean add_complex_variable (slang_active_variables *self, slang_export_data_quant *q, - char *name, slang_atom_pool *atoms) +static GLboolean +add_complex_variable (slang_active_variables *self, slang_export_data_quant *q, GLchar *name, + slang_atom_pool *atoms) { - slang_string_concat (name, slang_atom_pool_id (atoms, q->name)); - if (slang_export_data_quant_array (q)) - slang_string_concat (name, "[0]"); + slang_string_concat (name, slang_atom_pool_id (atoms, q->name)); - if (slang_export_data_quant_struct (q)) - { - GLuint dot_pos, i; - const GLuint fields = slang_export_data_quant_fields (q); + /* If array, add only first element. */ + if (slang_export_data_quant_array (q)) + slang_string_concat (name, "[0]"); - slang_string_concat (name, "."); - dot_pos = slang_string_length (name); + if (slang_export_data_quant_struct (q)) { + GLuint field_pos, fields, i; - for (i = 0; i < fields; i++) - { - if (!add_complex_variable (self, &q->structure[i], name, atoms)) - return GL_FALSE; + slang_string_concat (name, "."); + field_pos = slang_string_length (name); - name[dot_pos] = '\0'; - } + /* Break it down into individual fields. */ + fields = slang_export_data_quant_fields (q); + for (i = 0; i < fields; i++) { + if (!add_complex_variable (self, &q->structure[i], name, atoms)) + return GL_FALSE; + name[field_pos] = '\0'; + } - return GL_TRUE; - } + return GL_TRUE; + } - return add_simple_variable (self, q, name); + return add_simple_variable (self, q, name); } -static GLboolean gather_active_variables (slang_active_variables *self, - slang_export_data_table *tbl, slang_export_data_access access) +/* + * Search a list of global variables with a given access (either attribute or uniform) + * and add it to the list of active variables. + */ +static GLboolean +gather_active_variables (slang_active_variables *self, slang_export_data_table *tbl, + slang_export_data_access access) { - GLuint i; + GLuint i; - for (i = 0; i < tbl->count; i++) - if (tbl->entries[i].access == access) - { - char name[1024] = ""; + for (i = 0; i < tbl->count; i++) { + if (tbl->entries[i].access == access) { + GLchar name[1024] = ""; - if (!add_complex_variable (self, &tbl->entries[i].quant, name, tbl->atoms)) - return GL_FALSE; - } + if (!add_complex_variable (self, &tbl->entries[i].quant, name, tbl->atoms)) + return GL_FALSE; + } + } - return GL_TRUE; + return GL_TRUE; } /* * slang_attrib_overrides */ -static GLvoid slang_attrib_overrides_ctr (slang_attrib_overrides *self) +static GLvoid +slang_attrib_overrides_ctr (slang_attrib_overrides *self) { - self->table = NULL; - self->count = 0; + self->table = NULL; + self->count = 0; } -static GLvoid slang_attrib_overrides_dtr (slang_attrib_overrides *self) +static GLvoid +slang_attrib_overrides_dtr (slang_attrib_overrides *self) { - GLuint i; + GLuint i; - for (i = 0; i < self->count; i++) - slang_alloc_free (self->table[i].name); - slang_alloc_free (self->table); + for (i = 0; i < self->count; i++) + slang_alloc_free (self->table[i].name); + slang_alloc_free (self->table); } -GLboolean slang_attrib_overrides_add (slang_attrib_overrides *self, GLuint index, const GLchar *name) +static slang_attrib_override * +lookup_attrib_override (slang_attrib_overrides *self, const GLchar *name) { - const GLuint n = self->count; - GLuint i; + GLuint n, i; - for (i = 0; i < n; i++) - if (slang_string_compare (name, self->table[i].name) == 0) - { - self->table[i].index = index; - return GL_TRUE; - } + n = self->count; + for (i = 0; i < n; i++) { + if (slang_string_compare (name, self->table[i].name) == 0) + return &self->table[i]; + } + return NULL; +} - self->table = (slang_attrib_override *) slang_alloc_realloc (self->table, - n * sizeof (slang_attrib_override), (n + 1) * sizeof (slang_attrib_override)); - if (self->table == NULL) - return GL_FALSE; +GLboolean +_slang_attrib_overrides_add (slang_attrib_overrides *self, GLuint index, const GLchar *name) +{ + slang_attrib_override *ovr; + GLuint n; - self->table[n].index = index; - self->table[n].name = slang_string_duplicate (name); - if (self->table[n].name == NULL) - return GL_FALSE; - self->count++; + /* Attribs can be overriden multiple times. Look-up the table and replace + * its index if it is found. */ + ovr = lookup_attrib_override (self, name); + if (ovr != NULL) { + ovr->index = index; + return GL_TRUE; + } - return GL_TRUE; -} + n = self->count; + if (!TABLE_GROW(self->table, slang_attrib_override, n)) + return GL_FALSE; -static GLuint lookup_attrib_override (slang_attrib_overrides *self, const GLchar *name) -{ - GLuint i; + /* Initialize the new element. Increment table size only when it is fully initilized. */ + ovr = &self->table[n]; + ovr->index = index; + ovr->name = slang_string_duplicate (name); + if (ovr->name == NULL) + return GL_FALSE; + self->count++; - for (i = 0; i < self->count; i++) - if (slang_string_compare (name, self->table[i].name) == 0) - return self->table[i].index; - return MAX_VERTEX_ATTRIBS; + return GL_TRUE; } /* * slang_uniform_bindings */ -static GLvoid slang_uniform_bindings_ctr (slang_uniform_bindings *self) +static GLvoid +slang_uniform_bindings_ctr (slang_uniform_bindings *self) { - self->table = NULL; - self->count = 0; + self->table = NULL; + self->count = 0; } -static GLvoid slang_uniform_bindings_dtr (slang_uniform_bindings *self) +static GLvoid +slang_uniform_bindings_dtr (slang_uniform_bindings *self) { - GLuint i; + GLuint i; - for (i = 0; i < self->count; i++) - slang_alloc_free (self->table[i].name); - slang_alloc_free (self->table); + for (i = 0; i < self->count; i++) + slang_alloc_free (self->table[i].name); + slang_alloc_free (self->table); } -static GLboolean add_simple_uniform_binding (slang_uniform_bindings *self, - slang_export_data_quant *q, const char *name, GLuint index, GLuint addr) -{ - const GLuint n = self->count; - GLuint i; - - for (i = 0; i < n; i++) - if (slang_string_compare (self->table[i].name, name) == 0) - { - self->table[i].address[index] = addr; - return GL_TRUE; - } +static GLboolean +add_simple_uniform_binding (slang_uniform_bindings *self, slang_export_data_quant *q, + const GLchar *name, GLuint index, GLuint addr) +{ + GLuint n, i; + slang_uniform_binding *bind; + + /* Uniform binding table is shared between vertex and fragment shaders. If the same uniform + * is declared both in a vertex and fragment shader, only one uniform entry is maintained. + * When add a uniform binding there can be an entry already allocated for it by the other + * shader. */ + n = self->count; + for (i = 0; i < n; i++) { + if (slang_string_compare (self->table[i].name, name) == 0) { + self->table[i].address[index] = addr; + return GL_TRUE; + } + } - self->table = (slang_uniform_binding *) slang_alloc_realloc (self->table, - n * sizeof (slang_uniform_binding), (n + 1) * sizeof (slang_uniform_binding)); - if (self->table == NULL) - return GL_FALSE; + if (!TABLE_GROW(self->table, slang_uniform_binding, n)) + return GL_FALSE; - self->table[n].quant = q; - self->table[n].name = slang_string_duplicate (name); - if (self->table[n].name == NULL) - return GL_FALSE; - for (i = 0; i < SLANG_SHADER_MAX; i++) - self->table[n].address[i] = ~0; - self->table[n].address[index] = addr; - self->count++; + /* Initialize the new element. Increment table size only when it is fully initilized. */ + bind = &self->table[n]; + bind->quant = q; + bind->name = slang_string_duplicate (name); + if (bind->name == NULL) + return GL_FALSE; + for (i = 0; i < SLANG_SHADER_MAX; i++) + bind->address[i] = ~0; + bind->address[index] = addr; + self->count++; - return GL_TRUE; + return GL_TRUE; } -static GLboolean add_complex_uniform_binding (slang_uniform_bindings *self, - slang_export_data_quant *q, char *name, slang_atom_pool *atoms, GLuint index, GLuint addr) +static GLboolean +add_complex_uniform_binding (slang_uniform_bindings *self, slang_export_data_quant *q, + GLchar *name, slang_atom_pool *atoms, GLuint index, GLuint addr) { - GLuint count, i; + GLuint count, i; + + slang_string_concat (name, slang_atom_pool_id (atoms, q->name)); + count = slang_export_data_quant_elements (q); - slang_string_concat (name, slang_atom_pool_id (atoms, q->name)); - count = slang_export_data_quant_elements (q); - for (i = 0; i < count; i++) - { - GLuint bracket_pos; + /* If array, add binding for every array element. */ + for (i = 0; i < count; i++) { + GLuint bracket_pos; - bracket_pos = slang_string_length (name); - if (slang_export_data_quant_array (q)) - _mesa_sprintf (name + slang_string_length (name), "[%d]", i); + bracket_pos = slang_string_length (name); + if (slang_export_data_quant_array (q)) + _mesa_sprintf (&name[slang_string_length (name)], "[%d]", i); - if (slang_export_data_quant_struct (q)) - { - GLuint dot_pos, i; - const GLuint fields = slang_export_data_quant_fields (q); + if (slang_export_data_quant_struct (q)) { + GLuint field_pos, fields, i; - slang_string_concat (name, "."); - dot_pos = slang_string_length (name); + slang_string_concat (name, "."); + field_pos = slang_string_length (name); - for (i = 0; i < fields; i++) - { - if (!add_complex_uniform_binding (self, &q->structure[i], name, atoms, index, addr)) - return GL_FALSE; + /* Break it down into individual fields. */ + fields = slang_export_data_quant_fields (q); + for (i = 0; i < fields; i++) { + if (!add_complex_uniform_binding (self, &q->structure[i], name, atoms, index, addr)) + return GL_FALSE; - name[dot_pos] = '\0'; - addr += slang_export_data_quant_size (&q->structure[i]); - } - } - else - { - if (!add_simple_uniform_binding (self, q, name, index, addr)) - return GL_FALSE; + name[field_pos] = '\0'; + addr += slang_export_data_quant_size (&q->structure[i]); + } + } + else { + if (!add_simple_uniform_binding (self, q, name, index, addr)) + return GL_FALSE; - addr += slang_export_data_quant_size (q); - } + addr += slang_export_data_quant_size (q); + } - name[bracket_pos] = '\0'; - } + name[bracket_pos] = '\0'; + } - return GL_TRUE; + return GL_TRUE; } -static GLboolean gather_uniform_bindings (slang_uniform_bindings *self, - slang_export_data_table *tbl, GLuint index) +static GLboolean +gather_uniform_bindings (slang_uniform_bindings *self, slang_export_data_table *tbl, GLuint index) { - GLuint i; + GLuint n, i; - for (i = 0; i < tbl->count; i++) - if (tbl->entries[i].access == slang_exp_uniform) - { - char name[1024] = ""; + n = tbl->count; + for (i = 0; i < n; i++) { + if (tbl->entries[i].access == slang_exp_uniform) { + GLchar name[1024] = ""; - if (!add_complex_uniform_binding (self, &tbl->entries[i].quant, name, tbl->atoms, index, - tbl->entries[i].address)) - return GL_FALSE; - } + if (!add_complex_uniform_binding (self, &tbl->entries[i].quant, name, tbl->atoms, index, + tbl->entries[i].address)) + return GL_FALSE; + } + } - return GL_TRUE; + return GL_TRUE; } /* * slang_attrib_bindings */ -static GLvoid slang_attrib_bindings_ctr (slang_attrib_bindings *self) +static GLvoid +slang_attrib_bindings_ctr (slang_attrib_bindings *self) { - GLuint i; + GLuint i; - self->binding_count = 0; - for (i = 0; i < MAX_VERTEX_ATTRIBS; i++) - self->slots[i].addr = ~0; + self->binding_count = 0; + for (i = 0; i < MAX_VERTEX_ATTRIBS; i++) + self->slots[i].addr = ~0; } -static GLvoid slang_attrib_bindings_dtr (slang_attrib_bindings *self) +static GLvoid +slang_attrib_bindings_dtr (slang_attrib_bindings *self) { - GLuint i; + GLuint i; - for (i = 0; i < self->binding_count; i++) - slang_alloc_free (self->bindings[i].name); + for (i = 0; i < self->binding_count; i++) + slang_alloc_free (self->bindings[i].name); } /* * NOTE: If conventional vertex attribute gl_Vertex is used, application cannot use * vertex attrib index 0 for binding override. Currently this is not checked. - * Although attrib index 0 is not used when not explicitly asked. + * Anyways, attrib index 0 is not used when not explicitly asked. */ -static GLuint can_allocate_attrib_slots (slang_attrib_bindings *self, GLuint index, GLuint count) +static GLuint +can_allocate_attrib_slots (slang_attrib_bindings *self, GLuint index, GLuint count) { - GLuint i; + GLuint i; - for (i = 0; i < count; i++) - if (self->slots[index + i].addr != ~0) - break; - return i; + for (i = 0; i < count; i++) { + if (self->slots[index + i].addr != ~0) + break; + } + return i; } -static GLuint allocate_attrib_slots (slang_attrib_bindings *self, GLuint count) +static GLuint +allocate_attrib_slots (slang_attrib_bindings *self, GLuint count) { - GLuint i; + GLuint i; + + /* Start with attrib index 1. Index 0 will be used when explicitly + * asked by application binding. */ + for (i = 1; i <= MAX_VERTEX_ATTRIBS - count; i++) { + GLuint size; - for (i = 1; i <= MAX_VERTEX_ATTRIBS - count; i++) - { - GLuint size; - - size = can_allocate_attrib_slots (self, i, count); - if (size == count) - return i; + size = can_allocate_attrib_slots (self, i, count); + if (size == count) + return i; - /* speed-up the search a bit */ + /* Speed-up the search a bit. */ i += size; - } - return MAX_VERTEX_ATTRIBS; + } + + return MAX_VERTEX_ATTRIBS; } static GLboolean -add_attrib_binding (slang_attrib_bindings *self, slang_export_data_quant *q, const char *name, +add_attrib_binding (slang_attrib_bindings *self, slang_export_data_quant *q, const GLchar *name, GLuint addr, GLuint index_override) { - const GLuint n = self->binding_count; - GLuint slot_span, slot_fill, slot_index; - GLuint i; + GLuint slot_span, slot_fill, slot_index, i; + slang_attrib_binding *bind; - assert (slang_export_data_quant_simple (q)); + assert (slang_export_data_quant_simple (q)); - switch (slang_export_data_quant_type (q)) - { - case GL_FLOAT: + switch (slang_export_data_quant_type (q)) { + case GL_FLOAT: slot_span = 1; slot_fill = 1; break; - case GL_FLOAT_VEC2: + case GL_FLOAT_VEC2: slot_span = 1; slot_fill = 2; break; - case GL_FLOAT_VEC3: + case GL_FLOAT_VEC3: slot_span = 1; slot_fill = 3; break; - case GL_FLOAT_VEC4: - slot_span = 1; + case GL_FLOAT_VEC4: + slot_span = 1; slot_fill = 4; - break; - case GL_FLOAT_MAT2: - slot_span = 2; + break; + case GL_FLOAT_MAT2: + slot_span = 2; slot_fill = 2; - break; - case GL_FLOAT_MAT3: - slot_span = 3; + break; + case GL_FLOAT_MAT3: + slot_span = 3; slot_fill = 3; - break; - case GL_FLOAT_MAT4: - slot_span = 4; + break; + case GL_FLOAT_MAT4: + slot_span = 4; slot_fill = 4; - break; - default: - assert (0); - } - - if (index_override == MAX_VERTEX_ATTRIBS) - slot_index = allocate_attrib_slots (self, slot_span); - else if (can_allocate_attrib_slots (self, index_override, slot_span) == slot_span) - slot_index = index_override; - else - slot_index = MAX_VERTEX_ATTRIBS; - - if (slot_index == MAX_VERTEX_ATTRIBS) - { - /* TODO: info log: error: MAX_VERTEX_ATTRIBS exceeded */ - return GL_FALSE; - } - - self->bindings[n].quant = q; - self->bindings[n].name = slang_string_duplicate (name); - if (self->bindings[n].name == NULL) - return GL_FALSE; - self->bindings[n].first_slot_index = slot_index; - self->binding_count++; + break; + default: + assert (0); + } + + if (index_override == MAX_VERTEX_ATTRIBS) + slot_index = allocate_attrib_slots (self, slot_span); + else if (can_allocate_attrib_slots (self, index_override, slot_span) == slot_span) + slot_index = index_override; + else + slot_index = MAX_VERTEX_ATTRIBS; + + if (slot_index == MAX_VERTEX_ATTRIBS) { + /* TODO: info log: error: MAX_VERTEX_ATTRIBS exceeded */ + return GL_FALSE; + } + + /* Initialize the new element. Increment table size only when it is fully initilized. */ + bind = &self->bindings[self->binding_count]; + bind->quant = q; + bind->name = slang_string_duplicate (name); + if (bind->name == NULL) + return GL_FALSE; + bind->first_slot_index = slot_index; + self->binding_count++; for (i = 0; i < slot_span; i++) { - slang_attrib_slot *slot = &self->slots[self->bindings[n].first_slot_index + i]; + slang_attrib_slot *slot; + + slot = &self->slots[bind->first_slot_index + i]; slot->addr = addr + i * slot_fill * 4; slot->fill = slot_fill; } - return GL_TRUE; + return GL_TRUE; } -static GLboolean gather_attrib_bindings (slang_attrib_bindings *self, slang_export_data_table *tbl, - slang_attrib_overrides *ovr) -{ - GLuint i; - - /* First pass. Gather attribs that have overriden index slots. */ - for (i = 0; i < tbl->count; i++) - if (tbl->entries[i].access == slang_exp_attribute && - !entry_has_gl_prefix (tbl->entries[i].quant.name, tbl->atoms)) - { - slang_export_data_quant *quant = &tbl->entries[i].quant; - const GLchar *id = slang_atom_pool_id (tbl->atoms, quant->name); - GLuint index = lookup_attrib_override (ovr, id); - - if (index != MAX_VERTEX_ATTRIBS) - { - if (!add_attrib_binding (self, quant, id, tbl->entries[i].address, index)) - return GL_FALSE; - } - } - - /* Second pass. Gather attribs that have *NOT* overriden index slots. */ - for (i = 0; i < tbl->count; i++) - if (tbl->entries[i].access == slang_exp_attribute && - !entry_has_gl_prefix (tbl->entries[i].quant.name, tbl->atoms)) - { - slang_export_data_quant *quant = &tbl->entries[i].quant; - const GLchar *id = slang_atom_pool_id (tbl->atoms, quant->name); - GLuint index = lookup_attrib_override (ovr, id); +static GLboolean +gather_attrib_bindings (slang_attrib_bindings *self, slang_export_data_table *tbl, + slang_attrib_overrides *ovr) +{ + GLuint i; + + /* First pass. Gather attribs that have overriden index slots. */ + for (i = 0; i < tbl->count; i++) { + if (tbl->entries[i].access == slang_exp_attribute && + !entry_has_gl_prefix (tbl->entries[i].quant.name, tbl->atoms)) { + slang_export_data_quant *quant; + const GLchar *id; + slang_attrib_override *ao; + + quant = &tbl->entries[i].quant; + id = slang_atom_pool_id (tbl->atoms, quant->name); + ao = lookup_attrib_override (ovr, id); + if (ao != NULL) { + if (!add_attrib_binding (self, quant, id, tbl->entries[i].address, ao->index)) + return GL_FALSE; + } + } + } - if (index == MAX_VERTEX_ATTRIBS) - { - if (!add_attrib_binding (self, quant, id, tbl->entries[i].address, index)) - return GL_FALSE; - } - } + /* Second pass. Gather attribs that have not overriden index slots. */ + for (i = 0; i < tbl->count; i++) { + if (tbl->entries[i].access == slang_exp_attribute && + !entry_has_gl_prefix (tbl->entries[i].quant.name, tbl->atoms)) { + slang_export_data_quant *quant; + const GLchar *id; + slang_attrib_override *ao; + + quant = &tbl->entries[i].quant; + id = slang_atom_pool_id (tbl->atoms, quant->name); + ao = lookup_attrib_override (ovr, id); + if (ao == NULL) { + if (!add_attrib_binding (self, quant, id, tbl->entries[i].address, ao->index)) + return GL_FALSE; + } + } + } - return GL_TRUE; + return GL_TRUE; } /* * slang_varying_bindings */ -static GLvoid slang_varying_bindings_ctr (slang_varying_bindings *self) +static GLvoid +slang_varying_bindings_ctr (slang_varying_bindings *self) { - self->binding_count = 0; - self->slot_count = 0; + self->binding_count = 0; + self->slot_count = 0; } -static GLvoid slang_varying_bindings_dtr (slang_varying_bindings *self) +static GLvoid +slang_varying_bindings_dtr (slang_varying_bindings *self) { - GLuint i; + GLuint i; - for (i = 0; i < self->binding_count; i++) - slang_alloc_free (self->bindings[i].name); + for (i = 0; i < self->binding_count; i++) + slang_alloc_free (self->bindings[i].name); } -static GLvoid update_varying_slots (slang_varying_slot *slots, GLuint count, GLboolean is_vert, - GLuint addr, GLuint do_offset) +static GLvoid +update_varying_slots (slang_varying_slot *slots, GLuint count, GLboolean is_vert, GLuint addr, + GLuint do_offset) { - GLuint i; + GLuint i; - for (i = 0; i < count; i++) - *(is_vert ? &slots[i].vert_addr : &slots[i].frag_addr) = addr + i * 4 * do_offset; + for (i = 0; i < count; i++) { + if (is_vert) + slots[i].vert_addr = addr + i * 4 * do_offset; + else + slots[i].frag_addr = addr + i * 4 * do_offset; + } } -static GLboolean add_varying_binding (slang_varying_bindings *self, - slang_export_data_quant *q, const char *name, GLboolean is_vert, GLuint addr) -{ - const GLuint n = self->binding_count; - const GLuint slot_span = - slang_export_data_quant_components (q) * slang_export_data_quant_elements (q); - GLuint i; - - for (i = 0; i < n; i++) - if (slang_string_compare (self->bindings[i].name, name) == 0) - { - /* TODO: data quantities must match, or else link fails */ - update_varying_slots (&self->slots[self->bindings[i].first_slot_index], slot_span, - is_vert, addr, 1); - return GL_TRUE; - } +static GLboolean +add_varying_binding (slang_varying_bindings *self, slang_export_data_quant *q, const GLchar *name, + GLboolean is_vert, GLuint addr) +{ + GLuint n, slot_span, i; + slang_varying_binding *bind; + + n = self->binding_count; + slot_span = slang_export_data_quant_components (q) * slang_export_data_quant_elements (q); + for (i = 0; i < n; i++) { + if (slang_string_compare (self->bindings[i].name, name) == 0) { + /* TODO: data quantities must match, or else link fails */ + update_varying_slots (&self->slots[self->bindings[i].first_slot_index], slot_span, + is_vert, addr, 1); + return GL_TRUE; + } + } - if (self->slot_count + slot_span > MAX_VARYING_FLOATS) - { - /* TODO: info log: error: MAX_VARYING_FLOATS exceeded */ - return GL_FALSE; - } + if (self->slot_count + slot_span > MAX_VARYING_FLOATS) { + /* TODO: info log: error: MAX_VARYING_FLOATS exceeded */ + return GL_FALSE; + } - self->bindings[n].quant = q; - self->bindings[n].name = slang_string_duplicate (name); - if (self->bindings[n].name == NULL) - return GL_FALSE; - self->bindings[n].first_slot_index = self->slot_count; - self->binding_count++; + /* Initialize the new element. Increment table size only when it is fully initilized. */ + bind = &self->bindings[n]; + bind->quant = q; + bind->name = slang_string_duplicate (name); + if (bind->name == NULL) + return GL_FALSE; + bind->first_slot_index = self->slot_count; + self->binding_count++; - update_varying_slots (&self->slots[self->bindings[n].first_slot_index], slot_span, is_vert, - addr, 1); - update_varying_slots (&self->slots[self->bindings[n].first_slot_index], slot_span, !is_vert, - ~0, 0); - self->slot_count += slot_span; + update_varying_slots (&self->slots[bind->first_slot_index], slot_span, is_vert, addr, 1); + update_varying_slots (&self->slots[bind->first_slot_index], slot_span, !is_vert, ~0, 0); + self->slot_count += slot_span; - return GL_TRUE; + return GL_TRUE; } -static GLboolean gather_varying_bindings (slang_varying_bindings *self, - slang_export_data_table *tbl, GLboolean is_vert) -{ - GLuint i; - - for (i = 0; i < tbl->count; i++) - if (tbl->entries[i].access == slang_exp_varying && - !entry_has_gl_prefix (tbl->entries[i].quant.name, tbl->atoms)) - { - if (!add_varying_binding (self, &tbl->entries[i].quant, slang_atom_pool_id (tbl->atoms, - tbl->entries[i].quant.name), is_vert, tbl->entries[i].address)) - return GL_FALSE; - } +static GLboolean +gather_varying_bindings (slang_varying_bindings *self, slang_export_data_table *tbl, + GLboolean is_vert) +{ + GLuint i; + + for (i = 0; i < tbl->count; i++) { + if (tbl->entries[i].access == slang_exp_varying && + !entry_has_gl_prefix (tbl->entries[i].quant.name, tbl->atoms)) { + if (!add_varying_binding (self, &tbl->entries[i].quant, + slang_atom_pool_id (tbl->atoms, tbl->entries[i].quant.name), + is_vert, tbl->entries[i].address)) + return GL_FALSE; + } + } - return GL_TRUE; + return GL_TRUE; } /* * slang_texture_bindings */ -GLvoid slang_texture_usages_ctr (slang_texture_usages *self) +GLvoid +_slang_texture_usages_ctr (slang_texture_usages *self) { - self->table = NULL; - self->count = 0; + self->table = NULL; + self->count = 0; } -GLvoid slang_texture_usages_dtr (slang_texture_usages *self) +GLvoid +_slang_texture_usages_dtr (slang_texture_usages *self) { - slang_alloc_free (self->table); + slang_alloc_free (self->table); } /* * slang_program */ -GLvoid slang_program_ctr (slang_program *self) -{ - GLuint i; - - slang_active_variables_ctr (&self->active_uniforms); - slang_active_variables_ctr (&self->active_attribs); - slang_attrib_overrides_ctr (&self->attrib_overrides); - slang_uniform_bindings_ctr (&self->uniforms); - slang_attrib_bindings_ctr (&self->attribs); - slang_varying_bindings_ctr (&self->varyings); - slang_texture_usages_ctr (&self->texture_usage); - for (i = 0; i < SLANG_SHADER_MAX; i++) - { - GLuint j; - - for (j = 0; j < SLANG_COMMON_FIXED_MAX; j++) - self->common_fixed_entries[i][j] = ~0; - for (j = 0; j < SLANG_COMMON_CODE_MAX; j++) - self->code[i][j] = ~0; - self->machines[i] = NULL; - self->assemblies[i] = NULL; - } - for (i = 0; i < SLANG_VERTEX_FIXED_MAX; i++) - self->vertex_fixed_entries[i] = ~0; - for (i = 0; i < SLANG_FRAGMENT_FIXED_MAX; i++) - self->fragment_fixed_entries[i] = ~0; -} - -GLvoid slang_program_dtr (slang_program *self) -{ - slang_active_variables_dtr (&self->active_uniforms); - slang_active_variables_dtr (&self->active_attribs); - slang_attrib_overrides_dtr (&self->attrib_overrides); - slang_uniform_bindings_dtr (&self->uniforms); - slang_attrib_bindings_dtr (&self->attribs); - slang_varying_bindings_dtr (&self->varyings); - slang_texture_usages_dtr (&self->texture_usage); -} - -GLvoid slang_program_rst (slang_program *self) -{ - GLuint i; - - slang_active_variables_dtr (&self->active_uniforms); - slang_active_variables_dtr (&self->active_attribs); - slang_uniform_bindings_dtr (&self->uniforms); - slang_attrib_bindings_dtr (&self->attribs); - slang_varying_bindings_dtr (&self->varyings); - slang_texture_usages_dtr (&self->texture_usage); - - slang_active_variables_ctr (&self->active_uniforms); - slang_active_variables_ctr (&self->active_attribs); - slang_uniform_bindings_ctr (&self->uniforms); - slang_attrib_bindings_ctr (&self->attribs); - slang_varying_bindings_ctr (&self->varyings); - slang_texture_usages_ctr (&self->texture_usage); - for (i = 0; i < SLANG_SHADER_MAX; i++) - { - GLuint j; - - for (j = 0; j < SLANG_COMMON_FIXED_MAX; j++) - self->common_fixed_entries[i][j] = ~0; - for (j = 0; j < SLANG_COMMON_CODE_MAX; j++) - self->code[i][j] = ~0; - } - for (i = 0; i < SLANG_VERTEX_FIXED_MAX; i++) - self->vertex_fixed_entries[i] = ~0; - for (i = 0; i < SLANG_FRAGMENT_FIXED_MAX; i++) - self->fragment_fixed_entries[i] = ~0; +GLvoid +_slang_program_ctr (slang_program *self) +{ + GLuint i; + + slang_active_variables_ctr (&self->active_uniforms); + slang_active_variables_ctr (&self->active_attribs); + slang_attrib_overrides_ctr (&self->attrib_overrides); + slang_uniform_bindings_ctr (&self->uniforms); + slang_attrib_bindings_ctr (&self->attribs); + slang_varying_bindings_ctr (&self->varyings); + _slang_texture_usages_ctr (&self->texture_usage); + for (i = 0; i < SLANG_SHADER_MAX; i++) { + GLuint j; + + for (j = 0; j < SLANG_COMMON_FIXED_MAX; j++) + self->common_fixed_entries[i][j] = ~0; + for (j = 0; j < SLANG_COMMON_CODE_MAX; j++) + self->code[i][j] = ~0; + self->machines[i] = NULL; + self->assemblies[i] = NULL; + } + for (i = 0; i < SLANG_VERTEX_FIXED_MAX; i++) + self->vertex_fixed_entries[i] = ~0; + for (i = 0; i < SLANG_FRAGMENT_FIXED_MAX; i++) + self->fragment_fixed_entries[i] = ~0; +} + +GLvoid +_slang_program_dtr (slang_program *self) +{ + slang_active_variables_dtr (&self->active_uniforms); + slang_active_variables_dtr (&self->active_attribs); + slang_attrib_overrides_dtr (&self->attrib_overrides); + slang_uniform_bindings_dtr (&self->uniforms); + slang_attrib_bindings_dtr (&self->attribs); + slang_varying_bindings_dtr (&self->varyings); + _slang_texture_usages_dtr (&self->texture_usage); +} + +GLvoid +_slang_program_rst (slang_program *self) +{ + GLuint i; + + slang_active_variables_dtr (&self->active_uniforms); + slang_active_variables_dtr (&self->active_attribs); + slang_uniform_bindings_dtr (&self->uniforms); + slang_attrib_bindings_dtr (&self->attribs); + slang_varying_bindings_dtr (&self->varyings); + _slang_texture_usages_dtr (&self->texture_usage); + + slang_active_variables_ctr (&self->active_uniforms); + slang_active_variables_ctr (&self->active_attribs); + slang_uniform_bindings_ctr (&self->uniforms); + slang_attrib_bindings_ctr (&self->attribs); + slang_varying_bindings_ctr (&self->varyings); + _slang_texture_usages_ctr (&self->texture_usage); + for (i = 0; i < SLANG_SHADER_MAX; i++) { + GLuint j; + + for (j = 0; j < SLANG_COMMON_FIXED_MAX; j++) + self->common_fixed_entries[i][j] = ~0; + for (j = 0; j < SLANG_COMMON_CODE_MAX; j++) + self->code[i][j] = ~0; + } + for (i = 0; i < SLANG_VERTEX_FIXED_MAX; i++) + self->vertex_fixed_entries[i] = ~0; + for (i = 0; i < SLANG_FRAGMENT_FIXED_MAX; i++) + self->fragment_fixed_entries[i] = ~0; } /* * _slang_link() */ -static GLuint gd (slang_export_data_table *tbl, const char *name) -{ - slang_atom atom; - GLuint i; - - atom = slang_atom_pool_atom (tbl->atoms, name); - if (atom == SLANG_ATOM_NULL) - return ~0; - - for (i = 0; i < tbl->count; i++) - if (atom == tbl->entries[i].quant.name) - return tbl->entries[i].address; - return ~0; -} - -static GLvoid resolve_common_fixed (GLuint e[], slang_export_data_table *tbl) -{ - e[SLANG_COMMON_FIXED_MODELVIEWMATRIX] = gd (tbl, "gl_ModelViewMatrix"); - e[SLANG_COMMON_FIXED_PROJECTIONMATRIX] = gd (tbl, "gl_ProjectionMatrix"); - e[SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIX] = gd (tbl, "gl_ModelViewProjectionMatrix"); - e[SLANG_COMMON_FIXED_TEXTUREMATRIX] = gd (tbl, "gl_TextureMatrix"); - e[SLANG_COMMON_FIXED_NORMALMATRIX] = gd (tbl, "gl_NormalMatrix"); - e[SLANG_COMMON_FIXED_MODELVIEWMATRIXINVERSE] = gd (tbl, "gl_ModelViewMatrixInverse"); - e[SLANG_COMMON_FIXED_PROJECTIONMATRIXINVERSE] = gd (tbl, "gl_ProjectionMatrixInverse"); - e[SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIXINVERSE] = - gd (tbl, "gl_ModelViewProjectionMatrixInverse"); - e[SLANG_COMMON_FIXED_TEXTUREMATRIXINVERSE] = gd (tbl, "gl_TextureMatrixInverse"); - e[SLANG_COMMON_FIXED_MODELVIEWMATRIXTRANSPOSE] = gd (tbl, "gl_ModelViewMatrixTranspose"); - e[SLANG_COMMON_FIXED_PROJECTIONMATRIXTRANSPOSE] = gd (tbl, "gl_ProjectionMatrixTranspose"); - e[SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIXTRANSPOSE] = - gd (tbl, "gl_ModelViewProjectionMatrixTranspose"); - e[SLANG_COMMON_FIXED_TEXTUREMATRIXTRANSPOSE] = gd (tbl, "gl_TextureMatrixTranspose"); - e[SLANG_COMMON_FIXED_MODELVIEWMATRIXINVERSETRANSPOSE] = - gd (tbl, "gl_ModelViewMatrixInverseTranspose"); - e[SLANG_COMMON_FIXED_PROJECTIONMATRIXINVERSETRANSPOSE] = - gd (tbl, "gl_ProjectionMatrixInverseTranspose"); - e[SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIXINVERSETRANSPOSE] = - gd (tbl, "gl_ModelViewProjectionMatrixInverseTranspose"); - e[SLANG_COMMON_FIXED_TEXTUREMATRIXINVERSETRANSPOSE] = - gd (tbl, "gl_TextureMatrixInverseTranspose"); - e[SLANG_COMMON_FIXED_NORMALSCALE] = gd (tbl, "gl_NormalScale"); - e[SLANG_COMMON_FIXED_DEPTHRANGE] = gd (tbl, "gl_DepthRange"); - e[SLANG_COMMON_FIXED_CLIPPLANE] = gd (tbl, "gl_ClipPlane"); - e[SLANG_COMMON_FIXED_POINT] = gd (tbl, "gl_Point"); - e[SLANG_COMMON_FIXED_FRONTMATERIAL] = gd (tbl, "gl_FrontMaterial"); - e[SLANG_COMMON_FIXED_BACKMATERIAL] = gd (tbl, "gl_BackMaterial"); - e[SLANG_COMMON_FIXED_LIGHTSOURCE] = gd (tbl, "gl_LightSource"); - e[SLANG_COMMON_FIXED_LIGHTMODEL] = gd (tbl, "gl_LightModel"); - e[SLANG_COMMON_FIXED_FRONTLIGHTMODELPRODUCT] = gd (tbl, "gl_FrontLightModelProduct"); - e[SLANG_COMMON_FIXED_BACKLIGHTMODELPRODUCT] = gd (tbl, "gl_BackLightModelProduct"); - e[SLANG_COMMON_FIXED_FRONTLIGHTPRODUCT] = gd (tbl, "gl_FrontLightProduct"); - e[SLANG_COMMON_FIXED_BACKLIGHTPRODUCT] = gd (tbl, "gl_BackLightProduct"); - e[SLANG_COMMON_FIXED_TEXTUREENVCOLOR] = gd (tbl, "gl_TextureEnvColor"); - e[SLANG_COMMON_FIXED_EYEPLANES] = gd (tbl, "gl_EyePlaneS"); - e[SLANG_COMMON_FIXED_EYEPLANET] = gd (tbl, "gl_EyePlaneT"); - e[SLANG_COMMON_FIXED_EYEPLANER] = gd (tbl, "gl_EyePlaneR"); - e[SLANG_COMMON_FIXED_EYEPLANEQ] = gd (tbl, "gl_EyePlaneQ"); - e[SLANG_COMMON_FIXED_OBJECTPLANES] = gd (tbl, "gl_ObjectPlaneS"); - e[SLANG_COMMON_FIXED_OBJECTPLANET] = gd (tbl, "gl_ObjectPlaneT"); - e[SLANG_COMMON_FIXED_OBJECTPLANER] = gd (tbl, "gl_ObjectPlaneR"); - e[SLANG_COMMON_FIXED_OBJECTPLANEQ] = gd (tbl, "gl_ObjectPlaneQ"); - e[SLANG_COMMON_FIXED_FOG] = gd (tbl, "gl_Fog"); -} - -static GLvoid resolve_vertex_fixed (GLuint e[], slang_export_data_table *tbl) -{ - e[SLANG_VERTEX_FIXED_POSITION] = gd (tbl, "gl_Position"); - e[SLANG_VERTEX_FIXED_POINTSIZE] = gd (tbl, "gl_PointSize"); - e[SLANG_VERTEX_FIXED_CLIPVERTEX] = gd (tbl, "gl_ClipVertex"); - e[SLANG_VERTEX_FIXED_COLOR] = gd (tbl, "gl_Color"); - e[SLANG_VERTEX_FIXED_SECONDARYCOLOR] = gd (tbl, "gl_SecondaryColor"); - e[SLANG_VERTEX_FIXED_NORMAL] = gd (tbl, "gl_Normal"); - e[SLANG_VERTEX_FIXED_VERTEX] = gd (tbl, "gl_Vertex"); - e[SLANG_VERTEX_FIXED_MULTITEXCOORD0] = gd (tbl, "gl_MultiTexCoord0"); - e[SLANG_VERTEX_FIXED_MULTITEXCOORD1] = gd (tbl, "gl_MultiTexCoord1"); - e[SLANG_VERTEX_FIXED_MULTITEXCOORD2] = gd (tbl, "gl_MultiTexCoord2"); - e[SLANG_VERTEX_FIXED_MULTITEXCOORD3] = gd (tbl, "gl_MultiTexCoord3"); - e[SLANG_VERTEX_FIXED_MULTITEXCOORD4] = gd (tbl, "gl_MultiTexCoord4"); - e[SLANG_VERTEX_FIXED_MULTITEXCOORD5] = gd (tbl, "gl_MultiTexCoord5"); - e[SLANG_VERTEX_FIXED_MULTITEXCOORD6] = gd (tbl, "gl_MultiTexCoord6"); - e[SLANG_VERTEX_FIXED_MULTITEXCOORD7] = gd (tbl, "gl_MultiTexCoord7"); - e[SLANG_VERTEX_FIXED_FOGCOORD] = gd (tbl, "gl_FogCoord"); - e[SLANG_VERTEX_FIXED_FRONTCOLOR] = gd (tbl, "gl_FrontColor"); - e[SLANG_VERTEX_FIXED_BACKCOLOR] = gd (tbl, "gl_BackColor"); - e[SLANG_VERTEX_FIXED_FRONTSECONDARYCOLOR] = gd (tbl, "gl_FrontSecondaryColor"); - e[SLANG_VERTEX_FIXED_BACKSECONDARYCOLOR] = gd (tbl, "gl_BackSecondaryColor"); - e[SLANG_VERTEX_FIXED_TEXCOORD] = gd (tbl, "gl_TexCoord"); - e[SLANG_VERTEX_FIXED_FOGFRAGCOORD] = gd (tbl, "gl_FogFragCoord"); -} - -static GLvoid resolve_fragment_fixed (GLuint e[], slang_export_data_table *tbl) -{ - e[SLANG_FRAGMENT_FIXED_FRAGCOORD] = gd (tbl, "gl_FragCoord"); - e[SLANG_FRAGMENT_FIXED_FRONTFACING] = gd (tbl, "gl_FrontFacing"); - e[SLANG_FRAGMENT_FIXED_FRAGCOLOR] = gd (tbl, "gl_FragColor"); - e[SLANG_FRAGMENT_FIXED_FRAGDATA] = gd (tbl, "gl_FragData"); - e[SLANG_FRAGMENT_FIXED_FRAGDEPTH] = gd (tbl, "gl_FragDepth"); - e[SLANG_FRAGMENT_FIXED_COLOR] = gd (tbl, "gl_Color"); - e[SLANG_FRAGMENT_FIXED_SECONDARYCOLOR] = gd (tbl, "gl_SecondaryColor"); - e[SLANG_FRAGMENT_FIXED_TEXCOORD] = gd (tbl, "gl_TexCoord"); - e[SLANG_FRAGMENT_FIXED_FOGFRAGCOORD] = gd (tbl, "gl_FogFragCoord"); -} - -static GLuint gc (slang_export_code_table *tbl, const char *name) -{ - slang_atom atom; - GLuint i; - - atom = slang_atom_pool_atom (tbl->atoms, name); - if (atom == SLANG_ATOM_NULL) - return ~0; - - for (i = 0; i < tbl->count; i++) - if (atom == tbl->entries[i].name) - return tbl->entries[i].address; - return ~0; -} - -static GLvoid resolve_common_code (GLuint code[], slang_export_code_table *tbl) -{ - code[SLANG_COMMON_CODE_MAIN] = gc (tbl, "@main"); +static GLuint +gd (slang_export_data_table *tbl, const GLchar *name) +{ + slang_atom atom; + GLuint i; + + atom = slang_atom_pool_atom (tbl->atoms, name); + if (atom == SLANG_ATOM_NULL) + return ~0; + + for (i = 0; i < tbl->count; i++) { + if (atom == tbl->entries[i].quant.name) + return tbl->entries[i].address; + } + return ~0; +} + +static GLvoid +resolve_common_fixed (GLuint e[], slang_export_data_table *tbl) +{ + e[SLANG_COMMON_FIXED_MODELVIEWMATRIX] = gd (tbl, "gl_ModelViewMatrix"); + e[SLANG_COMMON_FIXED_PROJECTIONMATRIX] = gd (tbl, "gl_ProjectionMatrix"); + e[SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIX] = gd (tbl, "gl_ModelViewProjectionMatrix"); + e[SLANG_COMMON_FIXED_TEXTUREMATRIX] = gd (tbl, "gl_TextureMatrix"); + e[SLANG_COMMON_FIXED_NORMALMATRIX] = gd (tbl, "gl_NormalMatrix"); + e[SLANG_COMMON_FIXED_MODELVIEWMATRIXINVERSE] = gd (tbl, "gl_ModelViewMatrixInverse"); + e[SLANG_COMMON_FIXED_PROJECTIONMATRIXINVERSE] = gd (tbl, "gl_ProjectionMatrixInverse"); + e[SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIXINVERSE] = gd (tbl, "gl_ModelViewProjectionMatrixInverse"); + e[SLANG_COMMON_FIXED_TEXTUREMATRIXINVERSE] = gd (tbl, "gl_TextureMatrixInverse"); + e[SLANG_COMMON_FIXED_MODELVIEWMATRIXTRANSPOSE] = gd (tbl, "gl_ModelViewMatrixTranspose"); + e[SLANG_COMMON_FIXED_PROJECTIONMATRIXTRANSPOSE] = gd (tbl, "gl_ProjectionMatrixTranspose"); + e[SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIXTRANSPOSE] = gd (tbl, "gl_ModelViewProjectionMatrixTranspose"); + e[SLANG_COMMON_FIXED_TEXTUREMATRIXTRANSPOSE] = gd (tbl, "gl_TextureMatrixTranspose"); + e[SLANG_COMMON_FIXED_MODELVIEWMATRIXINVERSETRANSPOSE] = gd (tbl, "gl_ModelViewMatrixInverseTranspose"); + e[SLANG_COMMON_FIXED_PROJECTIONMATRIXINVERSETRANSPOSE] = gd (tbl, "gl_ProjectionMatrixInverseTranspose"); + e[SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIXINVERSETRANSPOSE] = gd (tbl, "gl_ModelViewProjectionMatrixInverseTranspose"); + e[SLANG_COMMON_FIXED_TEXTUREMATRIXINVERSETRANSPOSE] = gd (tbl, "gl_TextureMatrixInverseTranspose"); + e[SLANG_COMMON_FIXED_NORMALSCALE] = gd (tbl, "gl_NormalScale"); + e[SLANG_COMMON_FIXED_DEPTHRANGE] = gd (tbl, "gl_DepthRange"); + e[SLANG_COMMON_FIXED_CLIPPLANE] = gd (tbl, "gl_ClipPlane"); + e[SLANG_COMMON_FIXED_POINT] = gd (tbl, "gl_Point"); + e[SLANG_COMMON_FIXED_FRONTMATERIAL] = gd (tbl, "gl_FrontMaterial"); + e[SLANG_COMMON_FIXED_BACKMATERIAL] = gd (tbl, "gl_BackMaterial"); + e[SLANG_COMMON_FIXED_LIGHTSOURCE] = gd (tbl, "gl_LightSource"); + e[SLANG_COMMON_FIXED_LIGHTMODEL] = gd (tbl, "gl_LightModel"); + e[SLANG_COMMON_FIXED_FRONTLIGHTMODELPRODUCT] = gd (tbl, "gl_FrontLightModelProduct"); + e[SLANG_COMMON_FIXED_BACKLIGHTMODELPRODUCT] = gd (tbl, "gl_BackLightModelProduct"); + e[SLANG_COMMON_FIXED_FRONTLIGHTPRODUCT] = gd (tbl, "gl_FrontLightProduct"); + e[SLANG_COMMON_FIXED_BACKLIGHTPRODUCT] = gd (tbl, "gl_BackLightProduct"); + e[SLANG_COMMON_FIXED_TEXTUREENVCOLOR] = gd (tbl, "gl_TextureEnvColor"); + e[SLANG_COMMON_FIXED_EYEPLANES] = gd (tbl, "gl_EyePlaneS"); + e[SLANG_COMMON_FIXED_EYEPLANET] = gd (tbl, "gl_EyePlaneT"); + e[SLANG_COMMON_FIXED_EYEPLANER] = gd (tbl, "gl_EyePlaneR"); + e[SLANG_COMMON_FIXED_EYEPLANEQ] = gd (tbl, "gl_EyePlaneQ"); + e[SLANG_COMMON_FIXED_OBJECTPLANES] = gd (tbl, "gl_ObjectPlaneS"); + e[SLANG_COMMON_FIXED_OBJECTPLANET] = gd (tbl, "gl_ObjectPlaneT"); + e[SLANG_COMMON_FIXED_OBJECTPLANER] = gd (tbl, "gl_ObjectPlaneR"); + e[SLANG_COMMON_FIXED_OBJECTPLANEQ] = gd (tbl, "gl_ObjectPlaneQ"); + e[SLANG_COMMON_FIXED_FOG] = gd (tbl, "gl_Fog"); +} + +static GLvoid +resolve_vertex_fixed (GLuint e[], slang_export_data_table *tbl) +{ + e[SLANG_VERTEX_FIXED_POSITION] = gd (tbl, "gl_Position"); + e[SLANG_VERTEX_FIXED_POINTSIZE] = gd (tbl, "gl_PointSize"); + e[SLANG_VERTEX_FIXED_CLIPVERTEX] = gd (tbl, "gl_ClipVertex"); + e[SLANG_VERTEX_FIXED_COLOR] = gd (tbl, "gl_Color"); + e[SLANG_VERTEX_FIXED_SECONDARYCOLOR] = gd (tbl, "gl_SecondaryColor"); + e[SLANG_VERTEX_FIXED_NORMAL] = gd (tbl, "gl_Normal"); + e[SLANG_VERTEX_FIXED_VERTEX] = gd (tbl, "gl_Vertex"); + e[SLANG_VERTEX_FIXED_MULTITEXCOORD0] = gd (tbl, "gl_MultiTexCoord0"); + e[SLANG_VERTEX_FIXED_MULTITEXCOORD1] = gd (tbl, "gl_MultiTexCoord1"); + e[SLANG_VERTEX_FIXED_MULTITEXCOORD2] = gd (tbl, "gl_MultiTexCoord2"); + e[SLANG_VERTEX_FIXED_MULTITEXCOORD3] = gd (tbl, "gl_MultiTexCoord3"); + e[SLANG_VERTEX_FIXED_MULTITEXCOORD4] = gd (tbl, "gl_MultiTexCoord4"); + e[SLANG_VERTEX_FIXED_MULTITEXCOORD5] = gd (tbl, "gl_MultiTexCoord5"); + e[SLANG_VERTEX_FIXED_MULTITEXCOORD6] = gd (tbl, "gl_MultiTexCoord6"); + e[SLANG_VERTEX_FIXED_MULTITEXCOORD7] = gd (tbl, "gl_MultiTexCoord7"); + e[SLANG_VERTEX_FIXED_FOGCOORD] = gd (tbl, "gl_FogCoord"); + e[SLANG_VERTEX_FIXED_FRONTCOLOR] = gd (tbl, "gl_FrontColor"); + e[SLANG_VERTEX_FIXED_BACKCOLOR] = gd (tbl, "gl_BackColor"); + e[SLANG_VERTEX_FIXED_FRONTSECONDARYCOLOR] = gd (tbl, "gl_FrontSecondaryColor"); + e[SLANG_VERTEX_FIXED_BACKSECONDARYCOLOR] = gd (tbl, "gl_BackSecondaryColor"); + e[SLANG_VERTEX_FIXED_TEXCOORD] = gd (tbl, "gl_TexCoord"); + e[SLANG_VERTEX_FIXED_FOGFRAGCOORD] = gd (tbl, "gl_FogFragCoord"); +} + +static GLvoid +resolve_fragment_fixed (GLuint e[], slang_export_data_table *tbl) +{ + e[SLANG_FRAGMENT_FIXED_FRAGCOORD] = gd (tbl, "gl_FragCoord"); + e[SLANG_FRAGMENT_FIXED_FRONTFACING] = gd (tbl, "gl_FrontFacing"); + e[SLANG_FRAGMENT_FIXED_FRAGCOLOR] = gd (tbl, "gl_FragColor"); + e[SLANG_FRAGMENT_FIXED_FRAGDATA] = gd (tbl, "gl_FragData"); + e[SLANG_FRAGMENT_FIXED_FRAGDEPTH] = gd (tbl, "gl_FragDepth"); + e[SLANG_FRAGMENT_FIXED_COLOR] = gd (tbl, "gl_Color"); + e[SLANG_FRAGMENT_FIXED_SECONDARYCOLOR] = gd (tbl, "gl_SecondaryColor"); + e[SLANG_FRAGMENT_FIXED_TEXCOORD] = gd (tbl, "gl_TexCoord"); + e[SLANG_FRAGMENT_FIXED_FOGFRAGCOORD] = gd (tbl, "gl_FogFragCoord"); +} + +static GLuint +gc (slang_export_code_table *tbl, const GLchar *name) +{ + slang_atom atom; + GLuint i; + + atom = slang_atom_pool_atom (tbl->atoms, name); + if (atom == SLANG_ATOM_NULL) + return ~0; + + for (i = 0; i < tbl->count; i++) { + if (atom == tbl->entries[i].name) + return tbl->entries[i].address; + } + return ~0; +} + +static GLvoid +resolve_common_code (GLuint code[], slang_export_code_table *tbl) +{ + code[SLANG_COMMON_CODE_MAIN] = gc (tbl, "@main"); } GLboolean _slang_link (slang_program *prog, slang_code_object **objects, GLuint count) { - GLuint i; + GLuint i; - for (i = 0; i < count; i++) - { - GLuint index; + for (i = 0; i < count; i++) { + GLuint index; if (objects[i]->unit.type == slang_unit_fragment_shader) { - index = SLANG_SHADER_FRAGMENT; + index = SLANG_SHADER_FRAGMENT; resolve_fragment_fixed (prog->fragment_fixed_entries, &objects[i]->expdata); - } - else - { - index = SLANG_SHADER_VERTEX; + } + else { + index = SLANG_SHADER_VERTEX; resolve_vertex_fixed (prog->vertex_fixed_entries, &objects[i]->expdata); if (!gather_attrib_bindings (&prog->attribs, &objects[i]->expdata, &prog->attrib_overrides)) - return GL_FALSE; - } + return GL_FALSE; + } if (!gather_active_variables (&prog->active_uniforms, &objects[i]->expdata, slang_exp_uniform)) - return GL_FALSE; + return GL_FALSE; if (!gather_active_variables (&prog->active_attribs, &objects[i]->expdata, slang_exp_attribute)) - return GL_FALSE; + return GL_FALSE; if (!gather_uniform_bindings (&prog->uniforms, &objects[i]->expdata, index)) - return GL_FALSE; + return GL_FALSE; if (!gather_varying_bindings (&prog->varyings, &objects[i]->expdata, index == SLANG_SHADER_VERTEX)) - return GL_FALSE; + return GL_FALSE; resolve_common_fixed (prog->common_fixed_entries[index], &objects[i]->expdata); resolve_common_code (prog->code[index], &objects[i]->expcode); prog->machines[index] = &objects[i]->machine; prog->assemblies[index] = &objects[i]->assembly; - } + } - /* TODO: all varyings read by fragment shader must be written by vertex shader */ + /* TODO: all varyings read by fragment shader must be written by vertex shader */ - if (!_slang_analyse_texture_usage (prog)) - return GL_FALSE; + if (!_slang_analyse_texture_usage (prog)) + return GL_FALSE; - return GL_TRUE; + return GL_TRUE; } diff --git a/src/mesa/shader/slang/slang_link.h b/src/mesa/shader/slang/slang_link.h index a7898530318..433964223a5 100644 --- a/src/mesa/shader/slang/slang_link.h +++ b/src/mesa/shader/slang/slang_link.h @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.5 + * Version: 6.5.2 * * Copyright (C) 2006 Brian Paul All Rights Reserved. * @@ -33,277 +33,314 @@ extern "C" { enum { - SLANG_SHADER_VERTEX, - SLANG_SHADER_FRAGMENT, - SLANG_SHADER_MAX + SLANG_SHADER_VERTEX, + SLANG_SHADER_FRAGMENT, + SLANG_SHADER_MAX }; -/* Active variables. + +/** + * Active variables. * - * Active uniforms or attribs can be queried by the application to get a list of uniforms - * or attribs actually used by shaders (uniforms) or vertex shader (attribs). + * Active uniforms/attribs can be queried by the application to get a + * list of uniforms/attribs actually used by shaders (uniforms) or + * vertex shader only (attribs). */ - +/*@{*/ typedef struct { - slang_export_data_quant *quant; - char *name; + slang_export_data_quant *quant; + GLchar *name; } slang_active_variable; typedef struct { - slang_active_variable *table; - GLuint count; + slang_active_variable *table; + GLuint count; } slang_active_variables; +/*@}*/ -/* + +/** * Attrib binding override. * - * The application can override GL attrib binding by specifying its preferred index assignment - * for a given attrib name. Those overrides are taken into account while linking the program. + * The application can override GL attrib binding by specifying its + * preferred index assignment for a given attrib name. Those overrides + * are taken into account while linking the program. */ - +/*@{*/ typedef struct { - GLuint index; - GLchar *name; + GLuint index; + GLchar *name; } slang_attrib_override; typedef struct { - slang_attrib_override *table; - GLuint count; + slang_attrib_override *table; + GLuint count; } slang_attrib_overrides; +/*@}*/ -GLboolean slang_attrib_overrides_add (slang_attrib_overrides *, GLuint, const GLchar *); -/* +extern GLboolean +_slang_attrib_overrides_add (slang_attrib_overrides *, GLuint, const GLchar *); + + +/** * Uniform bindings. * - * Each slang_uniform_binding holds an array of addresses to actual memory locations in those - * shader types that use that uniform. Uniform bindings are held in an array and accessed - * by array index which is seen to the application as a uniform location. + * Each slang_uniform_binding holds an array of addresses to actual + * memory locations in those shader types that use that + * uniform. Uniform bindings are held in an array and accessed by + * array index which is seen to the application as a uniform location. * - * When the application writes to a particular uniform, it specifies its location. - * This location is treated as an array index to slang_uniform_bindings::table and tested - * against slang_uniform_bindings::count limit. The result is a pointer to slang_uniform_binding. - * The type of data being written to uniform is tested against slang_uniform_binding::quant. - * If the types are compatible, the array slang_uniform_binding::address is iterated for - * each shader type and if the address is valid (i.e. the uniform is used by this shader type), - * the new uniform value is written at that address. + * When the application writes to a particular uniform, it specifies + * its location. This location is treated as an array index to + * slang_uniform_bindings::table and tested against + * slang_uniform_bindings::count limit. The result is a pointer to + * slang_uniform_binding. The type of data being written to uniform + * is tested against slang_uniform_binding::quant. If the types are + * compatible, the array slang_uniform_binding::address is iterated + * for each shader type and if the address is valid (i.e. the uniform + * is used by this shader type), the new uniform value is written at + * that address. */ - +/*@{*/ typedef struct { - slang_export_data_quant *quant; - char *name; - GLuint address[SLANG_SHADER_MAX]; + slang_export_data_quant *quant; + GLchar *name; + GLuint address[SLANG_SHADER_MAX]; } slang_uniform_binding; typedef struct { - slang_uniform_binding *table; - GLuint count; + slang_uniform_binding *table; + GLuint count; } slang_uniform_bindings; +/*@}*/ -/* + +/** * Attrib bindings. * - * There is a fixed number of vertex attrib vectors (attrib slots). The slang_attrib_slot::addr - * maps vertex attrib index to the actual memory location of the attrib in vertex shader. - * One vertex attrib can span over many attrib slots (this is the case for matrices). The - * slang_attrib_binding::first_slot_index holds the first slot index that the attrib is bound to. + * There is a fixed number of vertex attrib vectors (attrib + * slots). The slang_attrib_slot::addr maps vertex attrib index to the + * actual memory location of the attrib in vertex shader. One vertex + * attrib can span over many attrib slots (this is the case for + * matrices). The slang_attrib_binding::first_slot_index holds the + * first slot index that the attrib is bound to. */ - +/*@{*/ typedef struct { - slang_export_data_quant *quant; - char *name; - GLuint first_slot_index; + slang_export_data_quant *quant; + GLchar *name; + GLuint first_slot_index; } slang_attrib_binding; typedef struct { - GLuint addr; /* memory location */ - GLuint fill; /* 1..4, number of components used */ + GLuint addr; /**< memory location */ + GLuint fill; /**< 1..4, number of components used */ } slang_attrib_slot; typedef struct { - slang_attrib_binding bindings[MAX_VERTEX_ATTRIBS]; - GLuint binding_count; - slang_attrib_slot slots[MAX_VERTEX_ATTRIBS]; + slang_attrib_binding bindings[MAX_VERTEX_ATTRIBS]; + GLuint binding_count; + slang_attrib_slot slots[MAX_VERTEX_ATTRIBS]; } slang_attrib_bindings; +/*@}*/ -/* + + +/** * Varying bindings. * - * There is a fixed number of varying floats (varying slots). The slang_varying_slot::vert_addr - * maps varying float index to the actual memory location of the output variable in vertex shader. - * The slang_varying_slot::frag_addr maps varying float index to the actual memory location of - * the input variable in fragment shader. + * There is a fixed number of varying floats (varying slots). The + * slang_varying_slot::vert_addr maps varying float index to the + * actual memory location of the output variable in vertex shader. + * The slang_varying_slot::frag_addr maps varying float index to the + * actual memory location of the input variable in fragment shader. */ - +/*@{*/ typedef struct { - GLuint vert_addr; - GLuint frag_addr; + GLuint vert_addr; + GLuint frag_addr; } slang_varying_slot; typedef struct { - slang_export_data_quant *quant; - char *name; - GLuint first_slot_index; + slang_export_data_quant *quant; + GLchar *name; + GLuint first_slot_index; } slang_varying_binding; typedef struct { - slang_varying_binding bindings[MAX_VARYING_FLOATS]; - GLuint binding_count; - slang_varying_slot slots[MAX_VARYING_FLOATS]; - GLuint slot_count; + slang_varying_binding bindings[MAX_VARYING_FLOATS]; + GLuint binding_count; + slang_varying_slot slots[MAX_VARYING_FLOATS]; + GLuint slot_count; } slang_varying_bindings; +/*@}*/ -/* + +/** * Texture usage. * - * A slang_texture_usage struct holds indirect information about texture image unit usage. The - * slang_texture_usages::table is derived from active uniform table by extracting only uniforms - * that are samplers. + * A slang_texture_usage struct holds indirect information about + * texture image unit usage. The slang_texture_usages::table is + * derived from active uniform table by extracting only uniforms that + * are samplers. * - * To collect current texture usage one must iterate the slang_texture_usages::table and read - * uniform at address slang_texture_usage::frag_address to get texture unit index. This - * index, coupled with texture access type (target) taken from slang_texture_usage::quant - * forms texture usage for that texture unit. + * To collect current texture usage one must iterate the + * slang_texture_usages::table and read uniform at address + * slang_texture_usage::frag_address to get texture unit index. This + * index, coupled with texture access type (target) taken from + * slang_texture_usage::quant forms texture usage for that texture + * unit. */ - +/*@{*/ typedef struct { - slang_export_data_quant *quant; - GLuint frag_address; + slang_export_data_quant *quant; + GLuint frag_address; } slang_texture_usage; typedef struct { - slang_texture_usage *table; - GLuint count; + slang_texture_usage *table; + GLuint count; } slang_texture_usages; +/*@}*/ + -GLvoid slang_texture_usages_ctr (slang_texture_usages *); -GLvoid slang_texture_usages_dtr (slang_texture_usages *); +extern GLvoid +_slang_texture_usages_ctr (slang_texture_usages *); + +extern GLvoid +_slang_texture_usages_dtr (slang_texture_usages *); enum { - SLANG_COMMON_FIXED_MODELVIEWMATRIX, - SLANG_COMMON_FIXED_PROJECTIONMATRIX, - SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIX, - SLANG_COMMON_FIXED_TEXTUREMATRIX, - SLANG_COMMON_FIXED_NORMALMATRIX, - SLANG_COMMON_FIXED_MODELVIEWMATRIXINVERSE, - SLANG_COMMON_FIXED_PROJECTIONMATRIXINVERSE, - SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIXINVERSE, - SLANG_COMMON_FIXED_TEXTUREMATRIXINVERSE, - SLANG_COMMON_FIXED_MODELVIEWMATRIXTRANSPOSE, - SLANG_COMMON_FIXED_PROJECTIONMATRIXTRANSPOSE, - SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIXTRANSPOSE, - SLANG_COMMON_FIXED_TEXTUREMATRIXTRANSPOSE, - SLANG_COMMON_FIXED_MODELVIEWMATRIXINVERSETRANSPOSE, - SLANG_COMMON_FIXED_PROJECTIONMATRIXINVERSETRANSPOSE, - SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIXINVERSETRANSPOSE, - SLANG_COMMON_FIXED_TEXTUREMATRIXINVERSETRANSPOSE, - SLANG_COMMON_FIXED_NORMALSCALE, - SLANG_COMMON_FIXED_DEPTHRANGE, - SLANG_COMMON_FIXED_CLIPPLANE, - SLANG_COMMON_FIXED_POINT, - SLANG_COMMON_FIXED_FRONTMATERIAL, - SLANG_COMMON_FIXED_BACKMATERIAL, - SLANG_COMMON_FIXED_LIGHTSOURCE, - SLANG_COMMON_FIXED_LIGHTMODEL, - SLANG_COMMON_FIXED_FRONTLIGHTMODELPRODUCT, - SLANG_COMMON_FIXED_BACKLIGHTMODELPRODUCT, - SLANG_COMMON_FIXED_FRONTLIGHTPRODUCT, - SLANG_COMMON_FIXED_BACKLIGHTPRODUCT, - SLANG_COMMON_FIXED_TEXTUREENVCOLOR, - SLANG_COMMON_FIXED_EYEPLANES, - SLANG_COMMON_FIXED_EYEPLANET, - SLANG_COMMON_FIXED_EYEPLANER, - SLANG_COMMON_FIXED_EYEPLANEQ, - SLANG_COMMON_FIXED_OBJECTPLANES, - SLANG_COMMON_FIXED_OBJECTPLANET, - SLANG_COMMON_FIXED_OBJECTPLANER, - SLANG_COMMON_FIXED_OBJECTPLANEQ, - SLANG_COMMON_FIXED_FOG, - SLANG_COMMON_FIXED_MAX + SLANG_COMMON_FIXED_MODELVIEWMATRIX, + SLANG_COMMON_FIXED_PROJECTIONMATRIX, + SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIX, + SLANG_COMMON_FIXED_TEXTUREMATRIX, + SLANG_COMMON_FIXED_NORMALMATRIX, + SLANG_COMMON_FIXED_MODELVIEWMATRIXINVERSE, + SLANG_COMMON_FIXED_PROJECTIONMATRIXINVERSE, + SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIXINVERSE, + SLANG_COMMON_FIXED_TEXTUREMATRIXINVERSE, + SLANG_COMMON_FIXED_MODELVIEWMATRIXTRANSPOSE, + SLANG_COMMON_FIXED_PROJECTIONMATRIXTRANSPOSE, + SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIXTRANSPOSE, + SLANG_COMMON_FIXED_TEXTUREMATRIXTRANSPOSE, + SLANG_COMMON_FIXED_MODELVIEWMATRIXINVERSETRANSPOSE, + SLANG_COMMON_FIXED_PROJECTIONMATRIXINVERSETRANSPOSE, + SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIXINVERSETRANSPOSE, + SLANG_COMMON_FIXED_TEXTUREMATRIXINVERSETRANSPOSE, + SLANG_COMMON_FIXED_NORMALSCALE, + SLANG_COMMON_FIXED_DEPTHRANGE, + SLANG_COMMON_FIXED_CLIPPLANE, + SLANG_COMMON_FIXED_POINT, + SLANG_COMMON_FIXED_FRONTMATERIAL, + SLANG_COMMON_FIXED_BACKMATERIAL, + SLANG_COMMON_FIXED_LIGHTSOURCE, + SLANG_COMMON_FIXED_LIGHTMODEL, + SLANG_COMMON_FIXED_FRONTLIGHTMODELPRODUCT, + SLANG_COMMON_FIXED_BACKLIGHTMODELPRODUCT, + SLANG_COMMON_FIXED_FRONTLIGHTPRODUCT, + SLANG_COMMON_FIXED_BACKLIGHTPRODUCT, + SLANG_COMMON_FIXED_TEXTUREENVCOLOR, + SLANG_COMMON_FIXED_EYEPLANES, + SLANG_COMMON_FIXED_EYEPLANET, + SLANG_COMMON_FIXED_EYEPLANER, + SLANG_COMMON_FIXED_EYEPLANEQ, + SLANG_COMMON_FIXED_OBJECTPLANES, + SLANG_COMMON_FIXED_OBJECTPLANET, + SLANG_COMMON_FIXED_OBJECTPLANER, + SLANG_COMMON_FIXED_OBJECTPLANEQ, + SLANG_COMMON_FIXED_FOG, + SLANG_COMMON_FIXED_MAX }; enum { - SLANG_VERTEX_FIXED_POSITION, - SLANG_VERTEX_FIXED_POINTSIZE, - SLANG_VERTEX_FIXED_CLIPVERTEX, - SLANG_VERTEX_FIXED_COLOR, - SLANG_VERTEX_FIXED_SECONDARYCOLOR, - SLANG_VERTEX_FIXED_NORMAL, - SLANG_VERTEX_FIXED_VERTEX, - SLANG_VERTEX_FIXED_MULTITEXCOORD0, - SLANG_VERTEX_FIXED_MULTITEXCOORD1, - SLANG_VERTEX_FIXED_MULTITEXCOORD2, - SLANG_VERTEX_FIXED_MULTITEXCOORD3, - SLANG_VERTEX_FIXED_MULTITEXCOORD4, - SLANG_VERTEX_FIXED_MULTITEXCOORD5, - SLANG_VERTEX_FIXED_MULTITEXCOORD6, - SLANG_VERTEX_FIXED_MULTITEXCOORD7, - SLANG_VERTEX_FIXED_FOGCOORD, - SLANG_VERTEX_FIXED_FRONTCOLOR, - SLANG_VERTEX_FIXED_BACKCOLOR, - SLANG_VERTEX_FIXED_FRONTSECONDARYCOLOR, - SLANG_VERTEX_FIXED_BACKSECONDARYCOLOR, - SLANG_VERTEX_FIXED_TEXCOORD, - SLANG_VERTEX_FIXED_FOGFRAGCOORD, - SLANG_VERTEX_FIXED_MAX + SLANG_VERTEX_FIXED_POSITION, + SLANG_VERTEX_FIXED_POINTSIZE, + SLANG_VERTEX_FIXED_CLIPVERTEX, + SLANG_VERTEX_FIXED_COLOR, + SLANG_VERTEX_FIXED_SECONDARYCOLOR, + SLANG_VERTEX_FIXED_NORMAL, + SLANG_VERTEX_FIXED_VERTEX, + SLANG_VERTEX_FIXED_MULTITEXCOORD0, + SLANG_VERTEX_FIXED_MULTITEXCOORD1, + SLANG_VERTEX_FIXED_MULTITEXCOORD2, + SLANG_VERTEX_FIXED_MULTITEXCOORD3, + SLANG_VERTEX_FIXED_MULTITEXCOORD4, + SLANG_VERTEX_FIXED_MULTITEXCOORD5, + SLANG_VERTEX_FIXED_MULTITEXCOORD6, + SLANG_VERTEX_FIXED_MULTITEXCOORD7, + SLANG_VERTEX_FIXED_FOGCOORD, + SLANG_VERTEX_FIXED_FRONTCOLOR, + SLANG_VERTEX_FIXED_BACKCOLOR, + SLANG_VERTEX_FIXED_FRONTSECONDARYCOLOR, + SLANG_VERTEX_FIXED_BACKSECONDARYCOLOR, + SLANG_VERTEX_FIXED_TEXCOORD, + SLANG_VERTEX_FIXED_FOGFRAGCOORD, + SLANG_VERTEX_FIXED_MAX }; enum { - SLANG_FRAGMENT_FIXED_FRAGCOORD, - SLANG_FRAGMENT_FIXED_FRONTFACING, - SLANG_FRAGMENT_FIXED_FRAGCOLOR, - SLANG_FRAGMENT_FIXED_FRAGDATA, - SLANG_FRAGMENT_FIXED_FRAGDEPTH, - SLANG_FRAGMENT_FIXED_COLOR, - SLANG_FRAGMENT_FIXED_SECONDARYCOLOR, - SLANG_FRAGMENT_FIXED_TEXCOORD, - SLANG_FRAGMENT_FIXED_FOGFRAGCOORD, - SLANG_FRAGMENT_FIXED_MAX + SLANG_FRAGMENT_FIXED_FRAGCOORD, + SLANG_FRAGMENT_FIXED_FRONTFACING, + SLANG_FRAGMENT_FIXED_FRAGCOLOR, + SLANG_FRAGMENT_FIXED_FRAGDATA, + SLANG_FRAGMENT_FIXED_FRAGDEPTH, + SLANG_FRAGMENT_FIXED_COLOR, + SLANG_FRAGMENT_FIXED_SECONDARYCOLOR, + SLANG_FRAGMENT_FIXED_TEXCOORD, + SLANG_FRAGMENT_FIXED_FOGFRAGCOORD, + SLANG_FRAGMENT_FIXED_MAX }; enum { - SLANG_COMMON_CODE_MAIN, - SLANG_COMMON_CODE_MAX + SLANG_COMMON_CODE_MAIN, + SLANG_COMMON_CODE_MAX }; typedef struct { - slang_active_variables active_uniforms; - slang_active_variables active_attribs; - slang_attrib_overrides attrib_overrides; - slang_uniform_bindings uniforms; - slang_attrib_bindings attribs; - slang_varying_bindings varyings; - slang_texture_usages texture_usage; - GLuint common_fixed_entries[SLANG_SHADER_MAX][SLANG_COMMON_FIXED_MAX]; - GLuint vertex_fixed_entries[SLANG_VERTEX_FIXED_MAX]; - GLuint fragment_fixed_entries[SLANG_FRAGMENT_FIXED_MAX]; - GLuint code[SLANG_SHADER_MAX][SLANG_COMMON_CODE_MAX]; - slang_machine *machines[SLANG_SHADER_MAX]; - slang_assembly_file *assemblies[SLANG_SHADER_MAX]; + slang_active_variables active_uniforms; + slang_active_variables active_attribs; + slang_attrib_overrides attrib_overrides; + slang_uniform_bindings uniforms; + slang_attrib_bindings attribs; + slang_varying_bindings varyings; + slang_texture_usages texture_usage; + GLuint common_fixed_entries[SLANG_SHADER_MAX][SLANG_COMMON_FIXED_MAX]; + GLuint vertex_fixed_entries[SLANG_VERTEX_FIXED_MAX]; + GLuint fragment_fixed_entries[SLANG_FRAGMENT_FIXED_MAX]; + GLuint code[SLANG_SHADER_MAX][SLANG_COMMON_CODE_MAX]; + slang_machine *machines[SLANG_SHADER_MAX]; + slang_assembly_file *assemblies[SLANG_SHADER_MAX]; } slang_program; -GLvoid slang_program_ctr (slang_program *); -GLvoid slang_program_dtr (slang_program *); -GLvoid slang_program_rst (slang_program *); +extern GLvoid +_slang_program_ctr (slang_program *); + +extern GLvoid +_slang_program_dtr (slang_program *); + +extern GLvoid +_slang_program_rst (slang_program *); extern GLboolean _slang_link (slang_program *, slang_code_object **, GLuint); diff --git a/src/mesa/shader/slang/slang_preprocess.c b/src/mesa/shader/slang/slang_preprocess.c index bd9ff9002e9..43aa9a1e95e 100644 --- a/src/mesa/shader/slang/slang_preprocess.c +++ b/src/mesa/shader/slang/slang_preprocess.c @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.5 + * Version: 6.6 * * Copyright (C) 2005-2006 Brian Paul All Rights Reserved. * @@ -32,6 +32,14 @@ #include "grammar_mesa.h" #include "slang_preprocess.h" +static const char *slang_pp_directives_syn = +#include "library/slang_pp_directives_syn.h" +; + +static const char *slang_pp_expression_syn = +#include "library/slang_pp_expression_syn.h" +; + static const char *slang_pp_version_syn = #include "library/slang_pp_version_syn.h" ; @@ -40,7 +48,7 @@ static GLvoid grammar_error_to_log (slang_info_log *log) { char buf[1024]; - int pos; + GLint pos; grammar_get_last_error ((byte *) (buf), sizeof (buf), &pos); slang_info_log_error (log, buf); @@ -75,3 +83,1089 @@ _slang_preprocess_version (const char *text, GLuint *version, GLuint *eaten, sla return GL_TRUE; } +/* + * The preprocessor does the following work. + * 1. Remove comments. Each comment block is replaced with a single space and if the + * block contains new-lines, they are preserved. This ensures that line numbers + * stay the same and if a comment block delimits two tokens, the are delitmited + * by the space after comment removal. + * 2. Remove preprocessor directives from the source string, checking their syntax and + * executing them if appropriate. Again, new-lines are preserved. + * 3. Expand macros. + * 4. Tokenize the source string by ensuring there is at least one space between every + * two adjacent tokens. + */ + +#define PP_ANNOTATE 0 + +static GLvoid +pp_annotate (slang_string *output, const char *fmt, ...) +{ +#if PP_ANNOTATE + va_list va; + char buffer[1024]; + + va_start (va, fmt); + _mesa_vsprintf (buffer, fmt, va); + va_end (va); + slang_string_pushs (output, buffer, _mesa_strlen (buffer)); +#else + (GLvoid) (output); + (GLvoid) (fmt); +#endif +} + + /* + * The expression is executed on a fixed-sized stack. The PUSH macro makes a runtime + * check if the stack is not overflown by too complex expressions. In that situation the + * GLSL preprocessor should report internal compiler error. + * The BINARYDIV makes a runtime check if the divider is not 0. If it is, it reports + * compilation error. + */ + +#define EXECUTION_STACK_SIZE 1024 + +#define PUSH(x)\ + do {\ + if (sp == 0) {\ + slang_info_log_error (elog, "internal compiler error: preprocessor execution stack overflow.");\ + return GL_FALSE;\ + }\ + stack[--sp] = x;\ + } while (GL_FALSE) + +#define POP(x)\ + do {\ + assert (sp < EXECUTION_STACK_SIZE);\ + x = stack[sp++];\ + } while (GL_FALSE) + +#define BINARY(op)\ + do {\ + GLint a, b;\ + POP(b);\ + POP(a);\ + PUSH(a op b);\ + } while (GL_FALSE) + +#define BINARYDIV(op)\ + do {\ + GLint a, b;\ + POP(b);\ + POP(a);\ + if (b == 0) {\ + slang_info_log_error (elog, "division by zero in preprocessor expression.");\ + return GL_FALSE;\ + }\ + PUSH(a op b);\ + } while (GL_FALSE) + +#define UNARY(op)\ + do {\ + GLint a;\ + POP(a);\ + PUSH(op a);\ + } while (GL_FALSE) + +#define OP_END 0 +#define OP_PUSHINT 1 +#define OP_LOGICALOR 2 +#define OP_LOGICALAND 3 +#define OP_OR 4 +#define OP_XOR 5 +#define OP_AND 6 +#define OP_EQUAL 7 +#define OP_NOTEQUAL 8 +#define OP_LESSEQUAL 9 +#define OP_GREATEREQUAL 10 +#define OP_LESS 11 +#define OP_GREATER 12 +#define OP_LEFTSHIFT 13 +#define OP_RIGHTSHIFT 14 +#define OP_ADD 15 +#define OP_SUBTRACT 16 +#define OP_MULTIPLY 17 +#define OP_DIVIDE 18 +#define OP_MODULUS 19 +#define OP_PLUS 20 +#define OP_MINUS 21 +#define OP_NEGATE 22 +#define OP_COMPLEMENT 23 + +static GLboolean +execute_expression (slang_string *output, const byte *code, GLuint *pi, GLint *result, + slang_info_log *elog) +{ + GLuint i = *pi; + GLint stack[EXECUTION_STACK_SIZE]; + GLuint sp = EXECUTION_STACK_SIZE; + + while (code[i] != OP_END) { + switch (code[i++]) { + case OP_PUSHINT: + i++; + PUSH(_mesa_atoi ((const char *) (&code[i]))); + i += _mesa_strlen ((const char *) (&code[i])) + 1; + break; + case OP_LOGICALOR: + BINARY(||); + break; + case OP_LOGICALAND: + BINARY(&&); + break; + case OP_OR: + BINARY(|); + break; + case OP_XOR: + BINARY(^); + break; + case OP_AND: + BINARY(&); + break; + case OP_EQUAL: + BINARY(==); + break; + case OP_NOTEQUAL: + BINARY(!=); + break; + case OP_LESSEQUAL: + BINARY(<=); + break; + case OP_GREATEREQUAL: + BINARY(>=); + break; + case OP_LESS: + BINARY(<); + break; + case OP_GREATER: + BINARY(>); + break; + case OP_LEFTSHIFT: + BINARY(<<); + break; + case OP_RIGHTSHIFT: + BINARY(>>); + break; + case OP_ADD: + BINARY(+); + break; + case OP_SUBTRACT: + BINARY(-); + break; + case OP_MULTIPLY: + BINARY(*); + break; + case OP_DIVIDE: + BINARYDIV(/); + break; + case OP_MODULUS: + BINARYDIV(%); + break; + case OP_PLUS: + UNARY(+); + break; + case OP_MINUS: + UNARY(-); + break; + case OP_NEGATE: + UNARY(!); + break; + case OP_COMPLEMENT: + UNARY(~); + break; + default: + assert (0); + } + } + + /* Write-back the index skipping the OP_END. */ + *pi = i + 1; + + /* There should be exactly one value left on the stack. This is our result. */ + POP(*result); + pp_annotate (output, "%d ", *result); + assert (sp == EXECUTION_STACK_SIZE); + return GL_TRUE; +} + +/* + * Function execute_expressions() executes up to 2 expressions. The second expression is there + * for the #line directive which takes 1 or 2 expressions that indicate line and file numbers. + * If it fails, it returns 0. If it succeeds, it returns the number of executed expressions. + */ + +#define EXP_END 0 +#define EXP_EXPRESSION 1 + +static GLuint +execute_expressions (slang_string *output, grammar eid, const byte *expr, GLint results[2], + slang_info_log *elog) +{ + GLint success; + byte *code; + GLuint size, count = 0; + + success = grammar_fast_check (eid, expr, &code, &size, 64); + if (success) { + GLuint i = 0; + + while (code[i++] == EXP_EXPRESSION) { + assert (count < 2); + + if (!execute_expression (output, code, &i, &results[count], elog)) { + count = 0; + break; + } + count++; + } + grammar_alloc_free (code); + } + else { + slang_info_log_error (elog, "syntax error in preprocessor expression.");\ + } + return count; +} + +/* + * The pp_symbol structure is used to hold macro definitions and macro formal parameters. The + * pp_symbols strcture is a collection of pp_symbol. It is used both for storing macro formal + * parameters and all global macro definitions. Making this unification wastes some memory, + * becuse macro formal parameters don't need further lists of symbols. We lose 8 bytes per + * formal parameter here, but making this we can use the same code to substitute macro parameters + * as well as macros in the source string. + */ + +typedef struct +{ + struct pp_symbol_ *symbols; + GLuint count; +} pp_symbols; + +static GLvoid +pp_symbols_init (pp_symbols *self) +{ + self->symbols = NULL; + self->count = 0; +} + +static GLvoid +pp_symbols_free (pp_symbols *); + +typedef struct pp_symbol_ +{ + slang_string name; + slang_string replacement; + pp_symbols parameters; +} pp_symbol; + +static GLvoid +pp_symbol_init (pp_symbol *self) +{ + slang_string_init (&self->name); + slang_string_init (&self->replacement); + pp_symbols_init (&self->parameters); +} + +static GLvoid +pp_symbol_free (pp_symbol *self) +{ + slang_string_free (&self->name); + slang_string_free (&self->replacement); + pp_symbols_free (&self->parameters); +} + +static GLvoid +pp_symbol_reset (pp_symbol *self) +{ + /* Leave symbol name intact. */ + slang_string_reset (&self->replacement); + pp_symbols_free (&self->parameters); + pp_symbols_init (&self->parameters); +} + +static GLvoid +pp_symbols_free (pp_symbols *self) +{ + GLuint i; + + for (i = 0; i < self->count; i++) + pp_symbol_free (&self->symbols[i]); + _mesa_free (self->symbols); +} + +static pp_symbol * +pp_symbols_push (pp_symbols *self) +{ + self->symbols = (pp_symbol *) (_mesa_realloc (self->symbols, self->count * sizeof (pp_symbol), + (self->count + 1) * sizeof (pp_symbol))); + if (self->symbols == NULL) + return NULL; + pp_symbol_init (&self->symbols[self->count]); + return &self->symbols[self->count++]; +} + +static GLboolean +pp_symbols_erase (pp_symbols *self, pp_symbol *symbol) +{ + assert (symbol >= self->symbols && symbol < self->symbols + self->count); + + self->count--; + pp_symbol_free (symbol); + if (symbol < self->symbols + self->count) + _mesa_memcpy (symbol, symbol + 1, sizeof (pp_symbol) * (self->symbols + self->count - symbol)); + self->symbols = (pp_symbol *) (_mesa_realloc (self->symbols, (self->count + 1) * sizeof (pp_symbol), + self->count * sizeof (pp_symbol))); + return self->symbols != NULL; +} + +static pp_symbol * +pp_symbols_find (pp_symbols *self, const char *name) +{ + GLuint i; + + for (i = 0; i < self->count; i++) + if (_mesa_strcmp (name, slang_string_cstr (&self->symbols[i].name)) == 0) + return &self->symbols[i]; + return NULL; +} + +/* + * The condition context of a single #if/#else/#endif level. Those can be nested, so there + * is a stack of condition contexts. + * There is a special global context on the bottom of the stack. It is there to simplify + * context handling. + */ + +typedef struct +{ + GLboolean current; /* The condition value of this level. */ + GLboolean effective; /* The effective product of current condition, outer level conditions + * and position within #if-#else-#endif sections. */ + GLboolean else_allowed; /* TRUE if in #if-#else section, FALSE if in #else-#endif section + * and for global context. */ + GLboolean endif_required; /* FALSE for global context only. */ +} pp_cond_ctx; + +/* Should be enuff. */ +#define CONDITION_STACK_SIZE 64 + +typedef struct +{ + pp_cond_ctx stack[CONDITION_STACK_SIZE]; + pp_cond_ctx *top; +} pp_cond_stack; + +static GLboolean +pp_cond_stack_push (pp_cond_stack *self, slang_info_log *elog) +{ + if (self->top == self->stack) { + slang_info_log_error (elog, "internal compiler error: preprocessor condition stack overflow."); + return GL_FALSE; + } + self->top--; + return GL_TRUE; +} + +static GLvoid +pp_cond_stack_reevaluate (pp_cond_stack *self) +{ + /* There must be at least 2 conditions on the stack - one global and one being evaluated. */ + assert (self->top <= &self->stack[CONDITION_STACK_SIZE - 2]); + + self->top->effective = self->top->current && self->top[1].effective; +} + +/* + * Extension enables through #extension directive. + * NOTE: Currently, only enable/disable state is stored. + */ + +typedef struct +{ + GLboolean MESA_shader_debug; /* GL_MESA_shader_debug enable */ +} pp_ext; + +/* + * Disable all extensions. Called at startup and on #extension all: disable. + */ +static GLvoid +pp_ext_disable_all (pp_ext *self) +{ + self->MESA_shader_debug = GL_FALSE; +} + +static GLvoid +pp_ext_init (pp_ext *self) +{ + pp_ext_disable_all (self); + /* Other initialization code goes here. */ +} + +static GLboolean +pp_ext_set (pp_ext *self, const char *name, GLboolean enable) +{ + if (_mesa_strcmp (name, "MESA_shader_debug") == 0) + self->MESA_shader_debug = enable; + /* Next extension name tests go here. */ + else + return GL_FALSE; + return GL_TRUE; +} + +/* + * The state of preprocessor: current line, file and version number, list of all defined macros + * and the #if/#endif context. + */ + +typedef struct +{ + GLint line; + GLint file; + GLint version; + pp_symbols symbols; + pp_ext ext; + slang_info_log *elog; + pp_cond_stack cond; +} pp_state; + +static GLvoid +pp_state_init (pp_state *self, slang_info_log *elog) +{ + self->line = 0; + self->file = 1; + self->version = 110; + pp_symbols_init (&self->symbols); + pp_ext_init (&self->ext); + self->elog = elog; + + /* Initialize condition stack and create the global context. */ + self->cond.top = &self->cond.stack[CONDITION_STACK_SIZE - 1]; + self->cond.top->current = GL_TRUE; + self->cond.top->effective = GL_TRUE; + self->cond.top->else_allowed = GL_FALSE; + self->cond.top->endif_required = GL_FALSE; +} + +static GLvoid +pp_state_free (pp_state *self) +{ + pp_symbols_free (&self->symbols); +} + +#define IS_FIRST_ID_CHAR(x) (((x) >= 'a' && (x) <= 'z') || ((x) >= 'A' && (x) <= 'Z') || (x) == '_') +#define IS_NEXT_ID_CHAR(x) (IS_FIRST_ID_CHAR(x) || ((x) >= '0' && (x) <= '9')) +#define IS_WHITE(x) ((x) == ' ' || (x) == '\n') +#define IS_NULL(x) ((x) == '\0') + +#define SKIP_WHITE(x) do { while (IS_WHITE(*(x))) (x)++; } while (GL_FALSE) + +typedef struct +{ + slang_string *output; + const char *input; + pp_state *state; +} expand_state; + +static GLboolean +expand_defined (expand_state *e, slang_string *buffer) +{ + GLboolean in_paren = GL_FALSE; + const char *id; + + /* Parse the optional opening parenthesis. */ + SKIP_WHITE(e->input); + if (*e->input == '(') { + e->input++; + in_paren = GL_TRUE; + SKIP_WHITE(e->input); + } + + /* Parse operand. */ + if (!IS_FIRST_ID_CHAR(*e->input)) { + slang_info_log_error (e->state->elog, + "preprocess error: identifier expected after operator 'defined'."); + return GL_FALSE; + } + slang_string_reset (buffer); + slang_string_pushc (buffer, *e->input++); + while (IS_NEXT_ID_CHAR(*e->input)) + slang_string_pushc (buffer, *e->input++); + id = slang_string_cstr (buffer); + + /* Check if the operand is defined. Output 1 if it is defined, output 0 if not. */ + if (pp_symbols_find (&e->state->symbols, id) == NULL) + slang_string_pushs (e->output, " 0 ", 3); + else + slang_string_pushs (e->output, " 1 ", 3); + + /* Parse the closing parentehesis if the opening one was there. */ + if (in_paren) { + SKIP_WHITE(e->input); + if (*e->input != ')') { + slang_info_log_error (e->state->elog, "preprocess error: ')' expected."); + return GL_FALSE; + } + e->input++; + SKIP_WHITE(e->input); + } + return GL_TRUE; +} + +static GLboolean +expand (expand_state *, pp_symbols *); + +static GLboolean +expand_symbol (expand_state *e, pp_symbol *symbol) +{ + expand_state es; + + /* If the macro has some parameters, we need to parse them. */ + if (symbol->parameters.count != 0) { + GLuint i; + + /* Parse the opening parenthesis. */ + SKIP_WHITE(e->input); + if (*e->input != '(') { + slang_info_log_error (e->state->elog, "preprocess error: '(' expected."); + return GL_FALSE; + } + e->input++; + SKIP_WHITE(e->input); + + /* Parse macro actual parameters. This can be anything, separated by a colon. + * TODO: What about nested/grouped parameters by parenthesis? */ + for (i = 0; i < symbol->parameters.count; i++) { + if (*e->input == ')') { + slang_info_log_error (e->state->elog, "preprocess error: unexpected ')'."); + return GL_FALSE; + } + + /* Eat all characters up to the comma or closing parentheses. */ + pp_symbol_reset (&symbol->parameters.symbols[i]); + while (!IS_NULL(*e->input) && *e->input != ',' && *e->input != ')') + slang_string_pushc (&symbol->parameters.symbols[i].replacement, *e->input++); + + /* If it was not the last paremeter, skip the comma. Otherwise, skip the + * closing parentheses. */ + if (i + 1 == symbol->parameters.count) { + /* This is the last paremeter - skip the closing parentheses. */ + if (*e->input != ')') { + slang_info_log_error (e->state->elog, "preprocess error: ')' expected."); + return GL_FALSE; + } + e->input++; + SKIP_WHITE(e->input); + } + else { + /* Skip the separating comma. */ + if (*e->input != ',') { + slang_info_log_error (e->state->elog, "preprocess error: ',' expected."); + return GL_FALSE; + } + e->input++; + SKIP_WHITE(e->input); + } + } + } + + /* Expand the macro. Use its parameters as a priority symbol list to expand + * macro parameters correctly. */ + es.output = e->output; + es.input = slang_string_cstr (&symbol->replacement); + es.state = e->state; + slang_string_pushc (e->output, ' '); + if (!expand (&es, &symbol->parameters)) + return GL_FALSE; + slang_string_pushc (e->output, ' '); + return GL_TRUE; +} + +/* + * Function expand() expands source text from to . The expansion is made using + * the list passed in parameter. It allows us to expand macro formal parameters with + * actual parameters. The global list of symbols from pp state is used when doing a recursive + * call of expand(). + */ + +static GLboolean +expand (expand_state *e, pp_symbols *symbols) +{ + while (!IS_NULL(*e->input)) { + if (IS_FIRST_ID_CHAR(*e->input)) { + slang_string buffer; + const char *id; + + /* Parse the identifier. */ + slang_string_init (&buffer); + slang_string_pushc (&buffer, *e->input++); + while (IS_NEXT_ID_CHAR(*e->input)) + slang_string_pushc (&buffer, *e->input++); + id = slang_string_cstr (&buffer); + + /* Now check if the identifier is special in some way. The "defined" identifier is + * actually an operator that we must handle here and expand it either to " 0 " or " 1 ". + * The other identifiers start with "__" and we expand it to appropriate values + * taken from the preprocessor state. */ + if (_mesa_strcmp (id, "defined") == 0) { + if (!expand_defined (e, &buffer)) + return GL_FALSE; + } + else if (_mesa_strcmp (id, "__LINE__") == 0) { + slang_string_pushc (e->output, ' '); + slang_string_pushi (e->output, e->state->line); + slang_string_pushc (e->output, ' '); + } + else if (_mesa_strcmp (id, "__FILE__") == 0) { + slang_string_pushc (e->output, ' '); + slang_string_pushi (e->output, e->state->file); + slang_string_pushc (e->output, ' '); + } + else if (_mesa_strcmp (id, "__VERSION__") == 0) { + slang_string_pushc (e->output, ' '); + slang_string_pushi (e->output, e->state->version); + slang_string_pushc (e->output, ' '); + } + else { + pp_symbol *symbol; + + /* The list of symbols from take precedence over the list from . + * Note that in some cases this is the same list so avoid double look-up. */ + symbol = pp_symbols_find (symbols, id); + if (symbol == NULL && symbols != &e->state->symbols) + symbol = pp_symbols_find (&e->state->symbols, id); + + /* If the symbol was found, recursively expand its definition. */ + if (symbol != NULL) { + if (!expand_symbol (e, symbol)) { + slang_string_free (&buffer); + return GL_FALSE; + } + } + else { + slang_string_push (e->output, &buffer); + } + } + slang_string_free (&buffer); + } + else if (IS_WHITE(*e->input)) { + slang_string_pushc (e->output, *e->input++); + } + else { + while (!IS_WHITE(*e->input) && !IS_NULL(*e->input) && !IS_FIRST_ID_CHAR(*e->input)) + slang_string_pushc (e->output, *e->input++); + } + } + return GL_TRUE; +} + +static GLboolean +parse_if (slang_string *output, const byte *prod, GLuint *pi, GLint *result, pp_state *state, + grammar eid) +{ + const char *text; + GLuint len; + + text = (const char *) (&prod[*pi]); + len = _mesa_strlen (text); + + if (state->cond.top->effective) { + slang_string expr; + GLuint count; + GLint results[2]; + expand_state es; + + /* Expand the expression. */ + slang_string_init (&expr); + es.output = &expr; + es.input = text; + es.state = state; + if (!expand (&es, &state->symbols)) + return GL_FALSE; + + /* Execute the expression. */ + count = execute_expressions (output, eid, (const byte *) (slang_string_cstr (&expr)), + results, state->elog); + slang_string_free (&expr); + if (count != 1) + return GL_FALSE; + *result = results[0]; + } + else { + /* The directive is dead. */ + *result = 0; + } + + *pi += len + 1; + return GL_TRUE; +} + +#define ESCAPE_TOKEN 0 + +#define TOKEN_END 0 +#define TOKEN_DEFINE 1 +#define TOKEN_UNDEF 2 +#define TOKEN_IF 3 +#define TOKEN_ELSE 4 +#define TOKEN_ELIF 5 +#define TOKEN_ENDIF 6 +#define TOKEN_ERROR 7 +#define TOKEN_PRAGMA 8 +#define TOKEN_EXTENSION 9 +#define TOKEN_LINE 10 + +#define PARAM_END 0 +#define PARAM_PARAMETER 1 + +#define BEHAVIOR_REQUIRE 1 +#define BEHAVIOR_ENABLE 2 +#define BEHAVIOR_WARN 3 +#define BEHAVIOR_DISABLE 4 + +static GLboolean +preprocess_source (slang_string *output, const char *source, grammar pid, grammar eid, + slang_info_log *elog) +{ + byte *prod; + GLuint size, i; + pp_state state; + + if (!grammar_fast_check (pid, (const byte *) (source), &prod, &size, 65536)) { + grammar_error_to_log (elog); + return GL_FALSE; + } + + pp_state_init (&state, elog); + + i = 0; + while (i < size) { + if (prod[i] != ESCAPE_TOKEN) { + if (state.cond.top->effective) { + slang_string input; + expand_state es; + + /* Eat only one line of source code to expand it. + * FIXME: This approach has one drawback. If a macro with parameters spans across + * multiple lines, the preprocessor will raise an error. */ + slang_string_init (&input); + while (prod[i] != '\0' && prod[i] != '\n') + slang_string_pushc (&input, prod[i++]); + if (prod[i] != '\0') + slang_string_pushc (&input, prod[i++]); + + /* Increment line number. */ + state.line++; + + es.output = output; + es.input = slang_string_cstr (&input); + es.state = &state; + if (!expand (&es, &state.symbols)) + goto error; + + slang_string_free (&input); + } + else { + /* Condition stack is disabled - keep track on line numbers and output only newlines. */ + if (prod[i] == '\n') { + state.line++; + /*pp_annotate (output, "%c", prod[i]);*/ + } + else { + /*pp_annotate (output, "%c", prod[i]);*/ + } + i++; + } + } + else { + const char *id; + GLuint idlen; + + i++; + switch (prod[i++]) { + + case TOKEN_END: + /* End of source string. + * Check if all #ifs have been terminated by matching #endifs. + * On condition stack there should be only the global condition context. */ + if (state.cond.top->endif_required) { + slang_info_log_error (elog, "end of source without matching #endif."); + return GL_FALSE; + } + break; + + case TOKEN_DEFINE: + { + pp_symbol *symbol = NULL; + + /* Parse macro name. */ + id = (const char *) (&prod[i]); + idlen = _mesa_strlen (id); + if (state.cond.top->effective) { + pp_annotate (output, "// #define %s(", id); + + /* If the symbol is already defined, override it. */ + symbol = pp_symbols_find (&state.symbols, id); + if (symbol == NULL) { + symbol = pp_symbols_push (&state.symbols); + if (symbol == NULL) + goto error; + slang_string_pushs (&symbol->name, id, idlen); + } + else { + pp_symbol_reset (symbol); + } + } + i += idlen + 1; + + /* Parse optional macro parameters. */ + while (prod[i++] != PARAM_END) { + if (state.cond.top->effective) { + pp_symbol *param; + + id = (const char *) (&prod[i]); + idlen = _mesa_strlen (id); + pp_annotate (output, "%s, ", id); + param = pp_symbols_push (&symbol->parameters); + if (param == NULL) + goto error; + slang_string_pushs (¶m->name, id, idlen); + } + i += idlen + 1; + } + + /* Parse macro replacement. */ + id = (const char *) (&prod[i]); + idlen = _mesa_strlen (id); + if (state.cond.top->effective) { + pp_annotate (output, ") %s", id); + slang_string_pushs (&symbol->replacement, id, idlen); + } + i += idlen + 1; + } + break; + + case TOKEN_UNDEF: + id = (const char *) (&prod[i]); + i += _mesa_strlen (id) + 1; + if (state.cond.top->effective) { + pp_symbol *symbol; + + pp_annotate (output, "// #undef %s", id); + /* Try to find symbol with given name and remove it. */ + symbol = pp_symbols_find (&state.symbols, id); + if (symbol != NULL) + if (!pp_symbols_erase (&state.symbols, symbol)) + goto error; + } + break; + + case TOKEN_IF: + { + GLint result; + + /* Parse #if expression end execute it. */ + pp_annotate (output, "// #if "); + if (!parse_if (output, prod, &i, &result, &state, eid)) + goto error; + + /* Push new condition on the stack. */ + if (!pp_cond_stack_push (&state.cond, state.elog)) + goto error; + state.cond.top->current = result ? GL_TRUE : GL_FALSE; + state.cond.top->else_allowed = GL_TRUE; + state.cond.top->endif_required = GL_TRUE; + pp_cond_stack_reevaluate (&state.cond); + } + break; + + case TOKEN_ELSE: + /* Check if #else is alloved here. */ + if (!state.cond.top->else_allowed) { + slang_info_log_error (elog, "#else without matching #if."); + goto error; + } + + /* Negate current condition and reevaluate it. */ + state.cond.top->current = !state.cond.top->current; + state.cond.top->else_allowed = GL_FALSE; + pp_cond_stack_reevaluate (&state.cond); + if (state.cond.top->effective) + pp_annotate (output, "// #else"); + break; + + case TOKEN_ELIF: + /* Check if #elif is alloved here. */ + if (!state.cond.top->else_allowed) { + slang_info_log_error (elog, "#elif without matching #if."); + goto error; + } + + /* Negate current condition and reevaluate it. */ + state.cond.top->current = !state.cond.top->current; + pp_cond_stack_reevaluate (&state.cond); + + if (state.cond.top->effective) + pp_annotate (output, "// #elif "); + + { + GLint result; + + /* Parse #elif expression end execute it. */ + if (!parse_if (output, prod, &i, &result, &state, eid)) + goto error; + + /* Update current condition and reevaluate it. */ + state.cond.top->current = result ? GL_TRUE : GL_FALSE; + pp_cond_stack_reevaluate (&state.cond); + } + break; + + case TOKEN_ENDIF: + /* Check if #endif is alloved here. */ + if (!state.cond.top->endif_required) { + slang_info_log_error (elog, "#endif without matching #if."); + goto error; + } + + /* Pop the condition off the stack. */ + state.cond.top++; + if (state.cond.top->effective) + pp_annotate (output, "// #endif"); + break; + + case TOKEN_EXTENSION: + /* Parse the extension name. */ + id = (const char *) (&prod[i]); + i += _mesa_strlen (id) + 1; + if (state.cond.top->effective) + pp_annotate (output, "// #extension %s: ", id); + + /* Parse and apply extension behavior. */ + if (state.cond.top->effective) { + switch (prod[i++]) { + + case BEHAVIOR_REQUIRE: + pp_annotate (output, "require"); + if (!pp_ext_set (&state.ext, id, GL_TRUE)) { + if (_mesa_strcmp (id, "all") == 0) { + slang_info_log_error (elog, "require: bad behavior for #extension all."); + goto error; + } + else { + slang_info_log_error (elog, "%s: required extension is not supported.", id); + goto error; + } + } + break; + + case BEHAVIOR_ENABLE: + pp_annotate (output, "enable"); + if (!pp_ext_set (&state.ext, id, GL_TRUE)) { + if (_mesa_strcmp (id, "all") == 0) { + slang_info_log_error (elog, "enable: bad behavior for #extension all."); + goto error; + } + else { + slang_info_log_warning (elog, "%s: enabled extension is not supported.", id); + } + } + break; + + case BEHAVIOR_WARN: + pp_annotate (output, "warn"); + if (!pp_ext_set (&state.ext, id, GL_TRUE)) { + if (_mesa_strcmp (id, "all") != 0) { + slang_info_log_warning (elog, "%s: enabled extension is not supported.", id); + } + } + break; + + case BEHAVIOR_DISABLE: + pp_annotate (output, "disable"); + if (!pp_ext_set (&state.ext, id, GL_FALSE)) { + if (_mesa_strcmp (id, "all") == 0) { + pp_ext_disable_all (&state.ext); + } + else { + slang_info_log_warning (elog, "%s: disabled extension is not supported.", id); + } + } + break; + + default: + assert (0); + } + } + break; + + case TOKEN_LINE: + id = (const char *) (&prod[i]); + i += _mesa_strlen (id) + 1; + + if (state.cond.top->effective) { + slang_string buffer; + GLuint count; + GLint results[2]; + expand_state es; + + slang_string_init (&buffer); + state.line++; + es.output = &buffer; + es.input = id; + es.state = &state; + if (!expand (&es, &state.symbols)) + goto error; + + pp_annotate (output, "// #line "); + count = execute_expressions (output, eid, + (const byte *) (slang_string_cstr (&buffer)), + results, state.elog); + slang_string_free (&buffer); + if (count == 0) + goto error; + + state.line = results[0] - 1; + if (count == 2) + state.file = results[1]; + } + break; + } + } + } + + /* Check for missing #endifs. */ + if (state.cond.top->endif_required) { + slang_info_log_error (elog, "#endif expected but end of source found."); + goto error; + } + + pp_state_free (&state); + return GL_TRUE; + +error: + pp_state_free (&state); + return GL_FALSE; +} + +GLboolean +_slang_preprocess_directives (slang_string *output, const char *input, slang_info_log *elog) +{ + grammar pid, eid; + GLboolean success; + + pid = grammar_load_from_text ((const byte *) (slang_pp_directives_syn)); + if (pid == 0) { + grammar_error_to_log (elog); + return GL_FALSE; + } + eid = grammar_load_from_text ((const byte *) (slang_pp_expression_syn)); + if (eid == 0) { + grammar_error_to_log (elog); + grammar_destroy (pid); + return GL_FALSE; + } + success = preprocess_source (output, input, pid, eid, elog); + grammar_destroy (eid); + grammar_destroy (pid); + return success; +} + diff --git a/src/mesa/shader/slang/slang_preprocess.h b/src/mesa/shader/slang/slang_preprocess.h index b55852dc4c0..f83e6e6e3fc 100644 --- a/src/mesa/shader/slang/slang_preprocess.h +++ b/src/mesa/shader/slang/slang_preprocess.h @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.5 + * Version: 6.6 * * Copyright (C) 2005-2006 Brian Paul All Rights Reserved. * @@ -34,6 +34,9 @@ extern "C" { GLboolean _slang_preprocess_version (const char *, GLuint *, GLuint *, slang_info_log *); +GLboolean +_slang_preprocess_directives (slang_string *output, const char *input, slang_info_log *); + #ifdef __cplusplus } #endif diff --git a/src/mesa/shader/slang/slang_utility.c b/src/mesa/shader/slang/slang_utility.c index 20ea6abae59..54fcc8a2382 100644 --- a/src/mesa/shader/slang/slang_utility.c +++ b/src/mesa/shader/slang/slang_utility.c @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.5 + * Version: 6.6 * * Copyright (C) 2005-2006 Brian Paul All Rights Reserved. * @@ -36,6 +36,99 @@ char *slang_string_concat (char *dst, const char *src) return _mesa_strcpy (dst + _mesa_strlen (dst), src); } +/* slang_string */ + +GLvoid +slang_string_init (slang_string *self) +{ + self->data = NULL; + self->capacity = 0; + self->length = 0; + self->fail = GL_FALSE; +} + +GLvoid +slang_string_free (slang_string *self) +{ + if (self->data != NULL) + _mesa_free (self->data); +} + +GLvoid +slang_string_reset (slang_string *self) +{ + self->length = 0; + self->fail = GL_FALSE; +} + +static GLboolean +grow (slang_string *self, GLuint size) +{ + if (self->fail) + return GL_FALSE; + if (size > self->capacity) { + /* do not overflow 32-bit range */ + assert (size < 0x80000000); + + self->data = (char *) (_mesa_realloc (self->data, self->capacity, size * 2)); + self->capacity = size * 2; + if (self->data == NULL) { + self->capacity = 0; + self->fail = GL_TRUE; + return GL_FALSE; + } + } + return GL_TRUE; +} + +GLvoid +slang_string_push (slang_string *self, const slang_string *str) +{ + if (str->fail) { + self->fail = GL_TRUE; + return; + } + if (grow (self, self->length + str->length)) { + _mesa_memcpy (&self->data[self->length], str->data, str->length); + self->length += str->length; + } +} + +GLvoid +slang_string_pushc (slang_string *self, const char c) +{ + if (grow (self, self->length + 1)) { + self->data[self->length] = c; + self->length++; + } +} + +GLvoid +slang_string_pushs (slang_string *self, const char *cstr, GLuint len) +{ + if (grow (self, self->length + len)) { + _mesa_memcpy (&self->data[self->length], cstr, len); + self->length += len; + } +} + +GLvoid +slang_string_pushi (slang_string *self, GLint i) +{ + char buffer[12]; + + _mesa_sprintf (buffer, "%d", i); + slang_string_pushs (self, buffer, strlen (buffer)); +} + +const char * +slang_string_cstr (slang_string *self) +{ + if (grow (self, self->length + 1)) + self->data[self->length] = '\0'; + return self->data; +} + /* slang_atom_pool */ void slang_atom_pool_construct (slang_atom_pool *pool) diff --git a/src/mesa/shader/slang/slang_utility.h b/src/mesa/shader/slang/slang_utility.h index 7a1997e5597..565de4e4b02 100644 --- a/src/mesa/shader/slang/slang_utility.h +++ b/src/mesa/shader/slang/slang_utility.h @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.5 + * Version: 6.6 * * Copyright (C) 2005-2006 Brian Paul All Rights Reserved. * @@ -44,6 +44,42 @@ extern "C" { char *slang_string_concat (char *, const char *); +/* slang_string */ + +typedef struct +{ + char *data; + GLuint length; + GLuint capacity; + GLboolean fail; +} slang_string; + +GLvoid +slang_string_init (slang_string *); + +GLvoid +slang_string_free (slang_string *); + +GLvoid +slang_string_reset (slang_string *); + +GLvoid +slang_string_push (slang_string *, const slang_string *); + +GLvoid +slang_string_pushc (slang_string *, const char); + +GLvoid +slang_string_pushs (slang_string *, const char *, GLuint); + +GLvoid +slang_string_pushi (slang_string *, GLint); + +const char * +slang_string_cstr (slang_string *); + +/* slang_atom */ + typedef GLvoid *slang_atom; #define SLANG_ATOM_NULL ((slang_atom) 0) diff --git a/src/mesa/sources b/src/mesa/sources index 8a13010c27b..09692c6f155 100644 --- a/src/mesa/sources +++ b/src/mesa/sources @@ -39,6 +39,7 @@ MAIN_SOURCES = \ main/light.c \ main/lines.c \ main/matrix.c \ + main/mipmap.c \ main/mm.c \ main/occlude.c \ main/pixel.c \ @@ -307,7 +308,7 @@ FBDEV_DRIVER_SOURCES = \ ALL_SOURCES = \ $(GLAPI_SOURCES) \ $(SOLO_SOURCES) \ - $(X86_SOURCES) \ + $(ASM_SOURCES) \ $(COMMON_DRIVER_SOURCES)\ $(X11_DRIVER_SOURCES) \ $(FBDEV_DRIVER_SOURCES) \ diff --git a/src/mesa/sparc/glapi_sparc.S b/src/mesa/sparc/glapi_sparc.S index bf2bc839082..c2a8ca6154d 100644 --- a/src/mesa/sparc/glapi_sparc.S +++ b/src/mesa/sparc/glapi_sparc.S @@ -473,9 +473,28 @@ __glapi_sparc_icache_flush: /* %o0 = insn_addr */ .globl glMultiTexCoord4ivARB ; .type glMultiTexCoord4ivARB,#function .globl glMultiTexCoord4sARB ; .type glMultiTexCoord4sARB,#function .globl glMultiTexCoord4svARB ; .type glMultiTexCoord4svARB,#function + .globl glAttachShader ; .type glAttachShader,#function + .globl glCreateProgram ; .type glCreateProgram,#function + .globl glCreateShader ; .type glCreateShader,#function + .globl glDeleteProgram ; .type glDeleteProgram,#function + .globl glDeleteShader ; .type glDeleteShader,#function + .globl glDetachShader ; .type glDetachShader,#function + .globl glGetAttachedShaders ; .type glGetAttachedShaders,#function + .globl glGetProgramInfoLog ; .type glGetProgramInfoLog,#function + .globl glGetProgramiv ; .type glGetProgramiv,#function + .globl glGetShaderInfoLog ; .type glGetShaderInfoLog,#function + .globl glGetShaderiv ; .type glGetShaderiv,#function + .globl glIsProgram ; .type glIsProgram,#function + .globl glIsShader ; .type glIsShader,#function .globl glStencilFuncSeparate ; .type glStencilFuncSeparate,#function .globl glStencilMaskSeparate ; .type glStencilMaskSeparate,#function .globl glStencilOpSeparate ; .type glStencilOpSeparate,#function + .globl glUniformMatrix2x3fv ; .type glUniformMatrix2x3fv,#function + .globl glUniformMatrix2x4fv ; .type glUniformMatrix2x4fv,#function + .globl glUniformMatrix3x2fv ; .type glUniformMatrix3x2fv,#function + .globl glUniformMatrix3x4fv ; .type glUniformMatrix3x4fv,#function + .globl glUniformMatrix4x2fv ; .type glUniformMatrix4x2fv,#function + .globl glUniformMatrix4x3fv ; .type glUniformMatrix4x3fv,#function .globl glLoadTransposeMatrixdARB ; .type glLoadTransposeMatrixdARB,#function .globl glLoadTransposeMatrixfARB ; .type glLoadTransposeMatrixfARB,#function .globl glMultTransposeMatrixdARB ; .type glMultTransposeMatrixdARB,#function @@ -608,30 +627,14 @@ __glapi_sparc_icache_flush: /* %o0 = insn_addr */ .globl glGetAttribLocationARB ; .type glGetAttribLocationARB,#function .globl glDrawBuffersARB ; .type glDrawBuffersARB,#function .globl glPolygonOffsetEXT ; .type glPolygonOffsetEXT,#function - .globl gl_dispatch_stub_543 ; .type gl_dispatch_stub_543,#function - .globl gl_dispatch_stub_544 ; .type gl_dispatch_stub_544,#function - .globl gl_dispatch_stub_545 ; .type gl_dispatch_stub_545,#function - .globl gl_dispatch_stub_546 ; .type gl_dispatch_stub_546,#function - .globl gl_dispatch_stub_547 ; .type gl_dispatch_stub_547,#function - .globl gl_dispatch_stub_548 ; .type gl_dispatch_stub_548,#function - .globl gl_dispatch_stub_549 ; .type gl_dispatch_stub_549,#function - .globl gl_dispatch_stub_550 ; .type gl_dispatch_stub_550,#function - .globl gl_dispatch_stub_551 ; .type gl_dispatch_stub_551,#function - .globl gl_dispatch_stub_552 ; .type gl_dispatch_stub_552,#function - .globl gl_dispatch_stub_553 ; .type gl_dispatch_stub_553,#function - .globl gl_dispatch_stub_554 ; .type gl_dispatch_stub_554,#function - .globl gl_dispatch_stub_555 ; .type gl_dispatch_stub_555,#function - .globl gl_dispatch_stub_556 ; .type gl_dispatch_stub_556,#function - .globl gl_dispatch_stub_557 ; .type gl_dispatch_stub_557,#function - .globl gl_dispatch_stub_558 ; .type gl_dispatch_stub_558,#function - .globl gl_dispatch_stub_559 ; .type gl_dispatch_stub_559,#function - .globl gl_dispatch_stub_560 ; .type gl_dispatch_stub_560,#function - .globl gl_dispatch_stub_561 ; .type gl_dispatch_stub_561,#function - .globl glAreTexturesResidentEXT ; .type glAreTexturesResidentEXT,#function - .globl glGenTexturesEXT ; .type glGenTexturesEXT,#function - .globl glIsTextureEXT ; .type glIsTextureEXT,#function + .globl gl_dispatch_stub_562 ; .type gl_dispatch_stub_562,#function + .globl gl_dispatch_stub_563 ; .type gl_dispatch_stub_563,#function + .globl gl_dispatch_stub_564 ; .type gl_dispatch_stub_564,#function .globl gl_dispatch_stub_565 ; .type gl_dispatch_stub_565,#function .globl gl_dispatch_stub_566 ; .type gl_dispatch_stub_566,#function + .globl gl_dispatch_stub_567 ; .type gl_dispatch_stub_567,#function + .globl gl_dispatch_stub_568 ; .type gl_dispatch_stub_568,#function + .globl gl_dispatch_stub_569 ; .type gl_dispatch_stub_569,#function .globl glColorPointerEXT ; .type glColorPointerEXT,#function .globl glEdgeFlagPointerEXT ; .type glEdgeFlagPointerEXT,#function .globl glIndexPointerEXT ; .type glIndexPointerEXT,#function @@ -642,8 +645,8 @@ __glapi_sparc_icache_flush: /* %o0 = insn_addr */ .globl glPointParameterfvEXT ; .type glPointParameterfvEXT,#function .globl glLockArraysEXT ; .type glLockArraysEXT,#function .globl glUnlockArraysEXT ; .type glUnlockArraysEXT,#function - .globl gl_dispatch_stub_577 ; .type gl_dispatch_stub_577,#function - .globl gl_dispatch_stub_578 ; .type gl_dispatch_stub_578,#function + .globl gl_dispatch_stub_580 ; .type gl_dispatch_stub_580,#function + .globl gl_dispatch_stub_581 ; .type gl_dispatch_stub_581,#function .globl glSecondaryColor3bEXT ; .type glSecondaryColor3bEXT,#function .globl glSecondaryColor3bvEXT ; .type glSecondaryColor3bvEXT,#function .globl glSecondaryColor3dEXT ; .type glSecondaryColor3dEXT,#function @@ -668,7 +671,7 @@ __glapi_sparc_icache_flush: /* %o0 = insn_addr */ .globl glFogCoorddvEXT ; .type glFogCoorddvEXT,#function .globl glFogCoordfEXT ; .type glFogCoordfEXT,#function .globl glFogCoordfvEXT ; .type glFogCoordfvEXT,#function - .globl gl_dispatch_stub_603 ; .type gl_dispatch_stub_603,#function + .globl gl_dispatch_stub_606 ; .type gl_dispatch_stub_606,#function .globl glBlendFuncSeparateEXT ; .type glBlendFuncSeparateEXT,#function .globl glFlushVertexArrayRangeNV ; .type glFlushVertexArrayRangeNV,#function .globl glVertexArrayRangeNV ; .type glVertexArrayRangeNV,#function @@ -710,15 +713,15 @@ __glapi_sparc_icache_flush: /* %o0 = insn_addr */ .globl glWindowPos4ivMESA ; .type glWindowPos4ivMESA,#function .globl glWindowPos4sMESA ; .type glWindowPos4sMESA,#function .globl glWindowPos4svMESA ; .type glWindowPos4svMESA,#function - .globl gl_dispatch_stub_645 ; .type gl_dispatch_stub_645,#function - .globl gl_dispatch_stub_646 ; .type gl_dispatch_stub_646,#function - .globl gl_dispatch_stub_647 ; .type gl_dispatch_stub_647,#function .globl gl_dispatch_stub_648 ; .type gl_dispatch_stub_648,#function .globl gl_dispatch_stub_649 ; .type gl_dispatch_stub_649,#function .globl gl_dispatch_stub_650 ; .type gl_dispatch_stub_650,#function .globl gl_dispatch_stub_651 ; .type gl_dispatch_stub_651,#function .globl gl_dispatch_stub_652 ; .type gl_dispatch_stub_652,#function .globl gl_dispatch_stub_653 ; .type gl_dispatch_stub_653,#function + .globl gl_dispatch_stub_654 ; .type gl_dispatch_stub_654,#function + .globl gl_dispatch_stub_655 ; .type gl_dispatch_stub_655,#function + .globl gl_dispatch_stub_656 ; .type gl_dispatch_stub_656,#function .globl glAreProgramsResidentNV ; .type glAreProgramsResidentNV,#function .globl glBindProgramNV ; .type glBindProgramNV,#function .globl glDeleteProgramsNV ; .type glDeleteProgramsNV,#function @@ -799,19 +802,19 @@ __glapi_sparc_icache_flush: /* %o0 = insn_addr */ .globl glSetFragmentShaderConstantATI ; .type glSetFragmentShaderConstantATI,#function .globl glPointParameteriNV ; .type glPointParameteriNV,#function .globl glPointParameterivNV ; .type glPointParameterivNV,#function - .globl gl_dispatch_stub_734 ; .type gl_dispatch_stub_734,#function - .globl gl_dispatch_stub_735 ; .type gl_dispatch_stub_735,#function - .globl gl_dispatch_stub_736 ; .type gl_dispatch_stub_736,#function .globl gl_dispatch_stub_737 ; .type gl_dispatch_stub_737,#function .globl gl_dispatch_stub_738 ; .type gl_dispatch_stub_738,#function + .globl gl_dispatch_stub_739 ; .type gl_dispatch_stub_739,#function + .globl gl_dispatch_stub_740 ; .type gl_dispatch_stub_740,#function + .globl gl_dispatch_stub_741 ; .type gl_dispatch_stub_741,#function .globl glGetProgramNamedParameterdvNV ; .type glGetProgramNamedParameterdvNV,#function .globl glGetProgramNamedParameterfvNV ; .type glGetProgramNamedParameterfvNV,#function .globl glProgramNamedParameter4dNV ; .type glProgramNamedParameter4dNV,#function .globl glProgramNamedParameter4dvNV ; .type glProgramNamedParameter4dvNV,#function .globl glProgramNamedParameter4fNV ; .type glProgramNamedParameter4fNV,#function .globl glProgramNamedParameter4fvNV ; .type glProgramNamedParameter4fvNV,#function - .globl gl_dispatch_stub_745 ; .type gl_dispatch_stub_745,#function - .globl gl_dispatch_stub_746 ; .type gl_dispatch_stub_746,#function + .globl gl_dispatch_stub_748 ; .type gl_dispatch_stub_748,#function + .globl gl_dispatch_stub_749 ; .type gl_dispatch_stub_749,#function .globl glBindFramebufferEXT ; .type glBindFramebufferEXT,#function .globl glBindRenderbufferEXT ; .type glBindRenderbufferEXT,#function .globl glCheckFramebufferStatusEXT ; .type glCheckFramebufferStatusEXT,#function @@ -825,15 +828,15 @@ __glapi_sparc_icache_flush: /* %o0 = insn_addr */ .globl glGenRenderbuffersEXT ; .type glGenRenderbuffersEXT,#function .globl glGenerateMipmapEXT ; .type glGenerateMipmapEXT,#function .globl glGetFramebufferAttachmentParameterivEXT ; .type glGetFramebufferAttachmentParameterivEXT,#function - .globl gl_dispatch_stub_760 ; .type gl_dispatch_stub_760,#function - .globl gl_dispatch_stub_761 ; .type gl_dispatch_stub_761,#function .globl glGetRenderbufferParameterivEXT ; .type glGetRenderbufferParameterivEXT,#function .globl glIsFramebufferEXT ; .type glIsFramebufferEXT,#function .globl glIsRenderbufferEXT ; .type glIsRenderbufferEXT,#function .globl glRenderbufferStorageEXT ; .type glRenderbufferStorageEXT,#function - .globl gl_dispatch_stub_766 ; .type gl_dispatch_stub_766,#function .globl gl_dispatch_stub_767 ; .type gl_dispatch_stub_767,#function .globl gl_dispatch_stub_768 ; .type gl_dispatch_stub_768,#function + .globl gl_dispatch_stub_769 ; .type gl_dispatch_stub_769,#function + .globl gl_dispatch_stub_770 ; .type gl_dispatch_stub_770,#function + .globl gl_dispatch_stub_771 ; .type gl_dispatch_stub_771,#function .globl _mesa_sparc_glapi_begin ; .type _mesa_sparc_glapi_begin,#function _mesa_sparc_glapi_begin: @@ -1245,9 +1248,28 @@ _mesa_sparc_glapi_begin: GL_STUB(glMultiTexCoord4ivARB, _gloffset_MultiTexCoord4ivARB) GL_STUB(glMultiTexCoord4sARB, _gloffset_MultiTexCoord4sARB) GL_STUB(glMultiTexCoord4svARB, _gloffset_MultiTexCoord4svARB) + GL_STUB(glAttachShader, _gloffset_AttachShader) + GL_STUB(glCreateProgram, _gloffset_CreateProgram) + GL_STUB(glCreateShader, _gloffset_CreateShader) + GL_STUB(glDeleteProgram, _gloffset_DeleteProgram) + GL_STUB(glDeleteShader, _gloffset_DeleteShader) + GL_STUB(glDetachShader, _gloffset_DetachShader) + GL_STUB(glGetAttachedShaders, _gloffset_GetAttachedShaders) + GL_STUB(glGetProgramInfoLog, _gloffset_GetProgramInfoLog) + GL_STUB(glGetProgramiv, _gloffset_GetProgramiv) + GL_STUB(glGetShaderInfoLog, _gloffset_GetShaderInfoLog) + GL_STUB(glGetShaderiv, _gloffset_GetShaderiv) + GL_STUB(glIsProgram, _gloffset_IsProgram) + GL_STUB(glIsShader, _gloffset_IsShader) GL_STUB(glStencilFuncSeparate, _gloffset_StencilFuncSeparate) GL_STUB(glStencilMaskSeparate, _gloffset_StencilMaskSeparate) GL_STUB(glStencilOpSeparate, _gloffset_StencilOpSeparate) + GL_STUB(glUniformMatrix2x3fv, _gloffset_UniformMatrix2x3fv) + GL_STUB(glUniformMatrix2x4fv, _gloffset_UniformMatrix2x4fv) + GL_STUB(glUniformMatrix3x2fv, _gloffset_UniformMatrix3x2fv) + GL_STUB(glUniformMatrix3x4fv, _gloffset_UniformMatrix3x4fv) + GL_STUB(glUniformMatrix4x2fv, _gloffset_UniformMatrix4x2fv) + GL_STUB(glUniformMatrix4x3fv, _gloffset_UniformMatrix4x3fv) GL_STUB(glLoadTransposeMatrixdARB, _gloffset_LoadTransposeMatrixdARB) GL_STUB(glLoadTransposeMatrixfARB, _gloffset_LoadTransposeMatrixfARB) GL_STUB(glMultTransposeMatrixdARB, _gloffset_MultTransposeMatrixdARB) @@ -1380,30 +1402,14 @@ _mesa_sparc_glapi_begin: GL_STUB(glGetAttribLocationARB, _gloffset_GetAttribLocationARB) GL_STUB(glDrawBuffersARB, _gloffset_DrawBuffersARB) GL_STUB(glPolygonOffsetEXT, _gloffset_PolygonOffsetEXT) - GL_STUB(gl_dispatch_stub_543, _gloffset__dispatch_stub_543) - GL_STUB(gl_dispatch_stub_544, _gloffset__dispatch_stub_544) - GL_STUB(gl_dispatch_stub_545, _gloffset__dispatch_stub_545) - GL_STUB(gl_dispatch_stub_546, _gloffset__dispatch_stub_546) - GL_STUB(gl_dispatch_stub_547, _gloffset__dispatch_stub_547) - GL_STUB(gl_dispatch_stub_548, _gloffset__dispatch_stub_548) - GL_STUB(gl_dispatch_stub_549, _gloffset__dispatch_stub_549) - GL_STUB(gl_dispatch_stub_550, _gloffset__dispatch_stub_550) - GL_STUB(gl_dispatch_stub_551, _gloffset__dispatch_stub_551) - GL_STUB(gl_dispatch_stub_552, _gloffset__dispatch_stub_552) - GL_STUB(gl_dispatch_stub_553, _gloffset__dispatch_stub_553) - GL_STUB(gl_dispatch_stub_554, _gloffset__dispatch_stub_554) - GL_STUB(gl_dispatch_stub_555, _gloffset__dispatch_stub_555) - GL_STUB(gl_dispatch_stub_556, _gloffset__dispatch_stub_556) - GL_STUB(gl_dispatch_stub_557, _gloffset__dispatch_stub_557) - GL_STUB(gl_dispatch_stub_558, _gloffset__dispatch_stub_558) - GL_STUB(gl_dispatch_stub_559, _gloffset__dispatch_stub_559) - GL_STUB(gl_dispatch_stub_560, _gloffset__dispatch_stub_560) - GL_STUB(gl_dispatch_stub_561, _gloffset__dispatch_stub_561) - GL_STUB(glAreTexturesResidentEXT, _gloffset_AreTexturesResidentEXT) - GL_STUB(glGenTexturesEXT, _gloffset_GenTexturesEXT) - GL_STUB(glIsTextureEXT, _gloffset_IsTextureEXT) + GL_STUB(gl_dispatch_stub_562, _gloffset__dispatch_stub_562) + GL_STUB(gl_dispatch_stub_563, _gloffset__dispatch_stub_563) + GL_STUB(gl_dispatch_stub_564, _gloffset__dispatch_stub_564) GL_STUB(gl_dispatch_stub_565, _gloffset__dispatch_stub_565) GL_STUB(gl_dispatch_stub_566, _gloffset__dispatch_stub_566) + GL_STUB(gl_dispatch_stub_567, _gloffset__dispatch_stub_567) + GL_STUB(gl_dispatch_stub_568, _gloffset__dispatch_stub_568) + GL_STUB(gl_dispatch_stub_569, _gloffset__dispatch_stub_569) GL_STUB(glColorPointerEXT, _gloffset_ColorPointerEXT) GL_STUB(glEdgeFlagPointerEXT, _gloffset_EdgeFlagPointerEXT) GL_STUB(glIndexPointerEXT, _gloffset_IndexPointerEXT) @@ -1414,8 +1420,8 @@ _mesa_sparc_glapi_begin: GL_STUB(glPointParameterfvEXT, _gloffset_PointParameterfvEXT) GL_STUB(glLockArraysEXT, _gloffset_LockArraysEXT) GL_STUB(glUnlockArraysEXT, _gloffset_UnlockArraysEXT) - GL_STUB(gl_dispatch_stub_577, _gloffset__dispatch_stub_577) - GL_STUB(gl_dispatch_stub_578, _gloffset__dispatch_stub_578) + GL_STUB(gl_dispatch_stub_580, _gloffset__dispatch_stub_580) + GL_STUB(gl_dispatch_stub_581, _gloffset__dispatch_stub_581) GL_STUB(glSecondaryColor3bEXT, _gloffset_SecondaryColor3bEXT) GL_STUB(glSecondaryColor3bvEXT, _gloffset_SecondaryColor3bvEXT) GL_STUB(glSecondaryColor3dEXT, _gloffset_SecondaryColor3dEXT) @@ -1440,7 +1446,7 @@ _mesa_sparc_glapi_begin: GL_STUB(glFogCoorddvEXT, _gloffset_FogCoorddvEXT) GL_STUB(glFogCoordfEXT, _gloffset_FogCoordfEXT) GL_STUB(glFogCoordfvEXT, _gloffset_FogCoordfvEXT) - GL_STUB(gl_dispatch_stub_603, _gloffset__dispatch_stub_603) + GL_STUB(gl_dispatch_stub_606, _gloffset__dispatch_stub_606) GL_STUB(glBlendFuncSeparateEXT, _gloffset_BlendFuncSeparateEXT) GL_STUB(glFlushVertexArrayRangeNV, _gloffset_FlushVertexArrayRangeNV) GL_STUB(glVertexArrayRangeNV, _gloffset_VertexArrayRangeNV) @@ -1482,15 +1488,15 @@ _mesa_sparc_glapi_begin: GL_STUB(glWindowPos4ivMESA, _gloffset_WindowPos4ivMESA) GL_STUB(glWindowPos4sMESA, _gloffset_WindowPos4sMESA) GL_STUB(glWindowPos4svMESA, _gloffset_WindowPos4svMESA) - GL_STUB(gl_dispatch_stub_645, _gloffset__dispatch_stub_645) - GL_STUB(gl_dispatch_stub_646, _gloffset__dispatch_stub_646) - GL_STUB(gl_dispatch_stub_647, _gloffset__dispatch_stub_647) GL_STUB(gl_dispatch_stub_648, _gloffset__dispatch_stub_648) GL_STUB(gl_dispatch_stub_649, _gloffset__dispatch_stub_649) GL_STUB(gl_dispatch_stub_650, _gloffset__dispatch_stub_650) GL_STUB(gl_dispatch_stub_651, _gloffset__dispatch_stub_651) GL_STUB(gl_dispatch_stub_652, _gloffset__dispatch_stub_652) GL_STUB(gl_dispatch_stub_653, _gloffset__dispatch_stub_653) + GL_STUB(gl_dispatch_stub_654, _gloffset__dispatch_stub_654) + GL_STUB(gl_dispatch_stub_655, _gloffset__dispatch_stub_655) + GL_STUB(gl_dispatch_stub_656, _gloffset__dispatch_stub_656) GL_STUB(glAreProgramsResidentNV, _gloffset_AreProgramsResidentNV) GL_STUB(glBindProgramNV, _gloffset_BindProgramNV) GL_STUB(glDeleteProgramsNV, _gloffset_DeleteProgramsNV) @@ -1571,19 +1577,19 @@ _mesa_sparc_glapi_begin: GL_STUB(glSetFragmentShaderConstantATI, _gloffset_SetFragmentShaderConstantATI) GL_STUB(glPointParameteriNV, _gloffset_PointParameteriNV) GL_STUB(glPointParameterivNV, _gloffset_PointParameterivNV) - GL_STUB(gl_dispatch_stub_734, _gloffset__dispatch_stub_734) - GL_STUB(gl_dispatch_stub_735, _gloffset__dispatch_stub_735) - GL_STUB(gl_dispatch_stub_736, _gloffset__dispatch_stub_736) GL_STUB(gl_dispatch_stub_737, _gloffset__dispatch_stub_737) GL_STUB(gl_dispatch_stub_738, _gloffset__dispatch_stub_738) + GL_STUB(gl_dispatch_stub_739, _gloffset__dispatch_stub_739) + GL_STUB(gl_dispatch_stub_740, _gloffset__dispatch_stub_740) + GL_STUB(gl_dispatch_stub_741, _gloffset__dispatch_stub_741) GL_STUB(glGetProgramNamedParameterdvNV, _gloffset_GetProgramNamedParameterdvNV) GL_STUB(glGetProgramNamedParameterfvNV, _gloffset_GetProgramNamedParameterfvNV) GL_STUB(glProgramNamedParameter4dNV, _gloffset_ProgramNamedParameter4dNV) GL_STUB(glProgramNamedParameter4dvNV, _gloffset_ProgramNamedParameter4dvNV) GL_STUB(glProgramNamedParameter4fNV, _gloffset_ProgramNamedParameter4fNV) GL_STUB(glProgramNamedParameter4fvNV, _gloffset_ProgramNamedParameter4fvNV) - GL_STUB(gl_dispatch_stub_745, _gloffset__dispatch_stub_745) - GL_STUB(gl_dispatch_stub_746, _gloffset__dispatch_stub_746) + GL_STUB(gl_dispatch_stub_748, _gloffset__dispatch_stub_748) + GL_STUB(gl_dispatch_stub_749, _gloffset__dispatch_stub_749) GL_STUB(glBindFramebufferEXT, _gloffset_BindFramebufferEXT) GL_STUB(glBindRenderbufferEXT, _gloffset_BindRenderbufferEXT) GL_STUB(glCheckFramebufferStatusEXT, _gloffset_CheckFramebufferStatusEXT) @@ -1597,15 +1603,15 @@ _mesa_sparc_glapi_begin: GL_STUB(glGenRenderbuffersEXT, _gloffset_GenRenderbuffersEXT) GL_STUB(glGenerateMipmapEXT, _gloffset_GenerateMipmapEXT) GL_STUB(glGetFramebufferAttachmentParameterivEXT, _gloffset_GetFramebufferAttachmentParameterivEXT) - GL_STUB(gl_dispatch_stub_760, _gloffset__dispatch_stub_760) - GL_STUB(gl_dispatch_stub_761, _gloffset__dispatch_stub_761) GL_STUB(glGetRenderbufferParameterivEXT, _gloffset_GetRenderbufferParameterivEXT) GL_STUB(glIsFramebufferEXT, _gloffset_IsFramebufferEXT) GL_STUB(glIsRenderbufferEXT, _gloffset_IsRenderbufferEXT) GL_STUB(glRenderbufferStorageEXT, _gloffset_RenderbufferStorageEXT) - GL_STUB(gl_dispatch_stub_766, _gloffset__dispatch_stub_766) GL_STUB(gl_dispatch_stub_767, _gloffset__dispatch_stub_767) GL_STUB(gl_dispatch_stub_768, _gloffset__dispatch_stub_768) + GL_STUB(gl_dispatch_stub_769, _gloffset__dispatch_stub_769) + GL_STUB(gl_dispatch_stub_770, _gloffset__dispatch_stub_770) + GL_STUB(gl_dispatch_stub_771, _gloffset__dispatch_stub_771) .globl _mesa_sparc_glapi_end ; .type _mesa_sparc_glapi_end,#function _mesa_sparc_glapi_end: @@ -1613,12 +1619,23 @@ _mesa_sparc_glapi_end: .globl glArrayElementEXT ; .type glArrayElementEXT,#function ; glArrayElementEXT = glArrayElement .globl glBindTextureEXT ; .type glBindTextureEXT,#function ; glBindTextureEXT = glBindTexture .globl glDrawArraysEXT ; .type glDrawArraysEXT,#function ; glDrawArraysEXT = glDrawArrays +#ifndef GLX_INDIRECT_RENDERING + .globl glAreTexturesResidentEXT ; .type glAreTexturesResidentEXT,#function ; glAreTexturesResidentEXT = glAreTexturesResident +#endif .globl glCopyTexImage1DEXT ; .type glCopyTexImage1DEXT,#function ; glCopyTexImage1DEXT = glCopyTexImage1D .globl glCopyTexImage2DEXT ; .type glCopyTexImage2DEXT,#function ; glCopyTexImage2DEXT = glCopyTexImage2D .globl glCopyTexSubImage1DEXT ; .type glCopyTexSubImage1DEXT,#function ; glCopyTexSubImage1DEXT = glCopyTexSubImage1D .globl glCopyTexSubImage2DEXT ; .type glCopyTexSubImage2DEXT,#function ; glCopyTexSubImage2DEXT = glCopyTexSubImage2D +#ifndef GLX_INDIRECT_RENDERING .globl glDeleteTexturesEXT ; .type glDeleteTexturesEXT,#function ; glDeleteTexturesEXT = glDeleteTextures +#endif +#ifndef GLX_INDIRECT_RENDERING + .globl glGenTexturesEXT ; .type glGenTexturesEXT,#function ; glGenTexturesEXT = glGenTextures +#endif .globl glGetPointervEXT ; .type glGetPointervEXT,#function ; glGetPointervEXT = glGetPointerv +#ifndef GLX_INDIRECT_RENDERING + .globl glIsTextureEXT ; .type glIsTextureEXT,#function ; glIsTextureEXT = glIsTexture +#endif .globl glPrioritizeTexturesEXT ; .type glPrioritizeTexturesEXT,#function ; glPrioritizeTexturesEXT = glPrioritizeTextures .globl glTexSubImage1DEXT ; .type glTexSubImage1DEXT,#function ; glTexSubImage1DEXT = glTexSubImage1D .globl glTexSubImage2DEXT ; .type glTexSubImage2DEXT,#function ; glTexSubImage2DEXT = glTexSubImage2D @@ -1626,6 +1643,15 @@ _mesa_sparc_glapi_end: .globl glBlendEquationEXT ; .type glBlendEquationEXT,#function ; glBlendEquationEXT = glBlendEquation .globl glDrawRangeElementsEXT ; .type glDrawRangeElementsEXT,#function ; glDrawRangeElementsEXT = glDrawRangeElements .globl glColorTableEXT ; .type glColorTableEXT,#function ; glColorTableEXT = glColorTable +#ifndef GLX_INDIRECT_RENDERING + .globl glGetColorTableEXT ; .type glGetColorTableEXT,#function ; glGetColorTableEXT = glGetColorTable +#endif +#ifndef GLX_INDIRECT_RENDERING + .globl glGetColorTableParameterfvEXT ; .type glGetColorTableParameterfvEXT,#function ; glGetColorTableParameterfvEXT = glGetColorTableParameterfv +#endif +#ifndef GLX_INDIRECT_RENDERING + .globl glGetColorTableParameterivEXT ; .type glGetColorTableParameterivEXT,#function ; glGetColorTableParameterivEXT = glGetColorTableParameteriv +#endif .globl glTexImage3DEXT ; .type glTexImage3DEXT,#function ; glTexImage3DEXT = glTexImage3D .globl glTexSubImage3DEXT ; .type glTexSubImage3DEXT,#function ; glTexSubImage3DEXT = glTexSubImage3D .globl glCopyTexSubImage3DEXT ; .type glCopyTexSubImage3DEXT,#function ; glCopyTexSubImage3DEXT = glCopyTexSubImage3D @@ -1675,6 +1701,43 @@ _mesa_sparc_glapi_end: .globl glCompressedTexSubImage2D ; .type glCompressedTexSubImage2D,#function ; glCompressedTexSubImage2D = glCompressedTexSubImage2DARB .globl glCompressedTexSubImage3D ; .type glCompressedTexSubImage3D,#function ; glCompressedTexSubImage3D = glCompressedTexSubImage3DARB .globl glGetCompressedTexImage ; .type glGetCompressedTexImage,#function ; glGetCompressedTexImage = glGetCompressedTexImageARB + .globl glDisableVertexAttribArray ; .type glDisableVertexAttribArray,#function ; glDisableVertexAttribArray = glDisableVertexAttribArrayARB + .globl glEnableVertexAttribArray ; .type glEnableVertexAttribArray,#function ; glEnableVertexAttribArray = glEnableVertexAttribArrayARB + .globl glGetVertexAttribdv ; .type glGetVertexAttribdv,#function ; glGetVertexAttribdv = glGetVertexAttribdvARB + .globl glGetVertexAttribfv ; .type glGetVertexAttribfv,#function ; glGetVertexAttribfv = glGetVertexAttribfvARB + .globl glGetVertexAttribiv ; .type glGetVertexAttribiv,#function ; glGetVertexAttribiv = glGetVertexAttribivARB + .globl glVertexAttrib1d ; .type glVertexAttrib1d,#function ; glVertexAttrib1d = glVertexAttrib1dARB + .globl glVertexAttrib1dv ; .type glVertexAttrib1dv,#function ; glVertexAttrib1dv = glVertexAttrib1dvARB + .globl glVertexAttrib1f ; .type glVertexAttrib1f,#function ; glVertexAttrib1f = glVertexAttrib1fARB + .globl glVertexAttrib1fv ; .type glVertexAttrib1fv,#function ; glVertexAttrib1fv = glVertexAttrib1fvARB + .globl glVertexAttrib1s ; .type glVertexAttrib1s,#function ; glVertexAttrib1s = glVertexAttrib1sARB + .globl glVertexAttrib1sv ; .type glVertexAttrib1sv,#function ; glVertexAttrib1sv = glVertexAttrib1svARB + .globl glVertexAttrib2d ; .type glVertexAttrib2d,#function ; glVertexAttrib2d = glVertexAttrib2dARB + .globl glVertexAttrib2dv ; .type glVertexAttrib2dv,#function ; glVertexAttrib2dv = glVertexAttrib2dvARB + .globl glVertexAttrib2f ; .type glVertexAttrib2f,#function ; glVertexAttrib2f = glVertexAttrib2fARB + .globl glVertexAttrib2fv ; .type glVertexAttrib2fv,#function ; glVertexAttrib2fv = glVertexAttrib2fvARB + .globl glVertexAttrib2s ; .type glVertexAttrib2s,#function ; glVertexAttrib2s = glVertexAttrib2sARB + .globl glVertexAttrib2sv ; .type glVertexAttrib2sv,#function ; glVertexAttrib2sv = glVertexAttrib2svARB + .globl glVertexAttrib3d ; .type glVertexAttrib3d,#function ; glVertexAttrib3d = glVertexAttrib3dARB + .globl glVertexAttrib3dv ; .type glVertexAttrib3dv,#function ; glVertexAttrib3dv = glVertexAttrib3dvARB + .globl glVertexAttrib3f ; .type glVertexAttrib3f,#function ; glVertexAttrib3f = glVertexAttrib3fARB + .globl glVertexAttrib3fv ; .type glVertexAttrib3fv,#function ; glVertexAttrib3fv = glVertexAttrib3fvARB + .globl glVertexAttrib3s ; .type glVertexAttrib3s,#function ; glVertexAttrib3s = glVertexAttrib3sARB + .globl glVertexAttrib3sv ; .type glVertexAttrib3sv,#function ; glVertexAttrib3sv = glVertexAttrib3svARB + .globl glVertexAttrib4Nbv ; .type glVertexAttrib4Nbv,#function ; glVertexAttrib4Nbv = glVertexAttrib4NbvARB + .globl glVertexAttrib4Niv ; .type glVertexAttrib4Niv,#function ; glVertexAttrib4Niv = glVertexAttrib4NivARB + .globl glVertexAttrib4Nsv ; .type glVertexAttrib4Nsv,#function ; glVertexAttrib4Nsv = glVertexAttrib4NsvARB + .globl glVertexAttrib4Nub ; .type glVertexAttrib4Nub,#function ; glVertexAttrib4Nub = glVertexAttrib4NubARB + .globl glVertexAttrib4Nubv ; .type glVertexAttrib4Nubv,#function ; glVertexAttrib4Nubv = glVertexAttrib4NubvARB + .globl glVertexAttrib4Nuiv ; .type glVertexAttrib4Nuiv,#function ; glVertexAttrib4Nuiv = glVertexAttrib4NuivARB + .globl glVertexAttrib4Nusv ; .type glVertexAttrib4Nusv,#function ; glVertexAttrib4Nusv = glVertexAttrib4NusvARB + .globl glVertexAttrib4d ; .type glVertexAttrib4d,#function ; glVertexAttrib4d = glVertexAttrib4dARB + .globl glVertexAttrib4dv ; .type glVertexAttrib4dv,#function ; glVertexAttrib4dv = glVertexAttrib4dvARB + .globl glVertexAttrib4f ; .type glVertexAttrib4f,#function ; glVertexAttrib4f = glVertexAttrib4fARB + .globl glVertexAttrib4fv ; .type glVertexAttrib4fv,#function ; glVertexAttrib4fv = glVertexAttrib4fvARB + .globl glVertexAttrib4s ; .type glVertexAttrib4s,#function ; glVertexAttrib4s = glVertexAttrib4sARB + .globl glVertexAttrib4sv ; .type glVertexAttrib4sv,#function ; glVertexAttrib4sv = glVertexAttrib4svARB + .globl glVertexAttribPointer ; .type glVertexAttribPointer,#function ; glVertexAttribPointer = glVertexAttribPointerARB .globl glBindBuffer ; .type glBindBuffer,#function ; glBindBuffer = glBindBufferARB .globl glBufferData ; .type glBufferData,#function ; glBufferData = glBufferDataARB .globl glBufferSubData ; .type glBufferSubData,#function ; glBufferSubData = glBufferSubDataARB @@ -1694,11 +1757,40 @@ _mesa_sparc_glapi_end: .globl glGetQueryObjectuiv ; .type glGetQueryObjectuiv,#function ; glGetQueryObjectuiv = glGetQueryObjectuivARB .globl glGetQueryiv ; .type glGetQueryiv,#function ; glGetQueryiv = glGetQueryivARB .globl glIsQuery ; .type glIsQuery,#function ; glIsQuery = glIsQueryARB + .globl glCompileShader ; .type glCompileShader,#function ; glCompileShader = glCompileShaderARB + .globl glGetActiveUniform ; .type glGetActiveUniform,#function ; glGetActiveUniform = glGetActiveUniformARB + .globl glGetShaderSource ; .type glGetShaderSource,#function ; glGetShaderSource = glGetShaderSourceARB + .globl glGetUniformLocation ; .type glGetUniformLocation,#function ; glGetUniformLocation = glGetUniformLocationARB + .globl glGetUniformfv ; .type glGetUniformfv,#function ; glGetUniformfv = glGetUniformfvARB + .globl glGetUniformiv ; .type glGetUniformiv,#function ; glGetUniformiv = glGetUniformivARB + .globl glLinkProgram ; .type glLinkProgram,#function ; glLinkProgram = glLinkProgramARB + .globl glShaderSource ; .type glShaderSource,#function ; glShaderSource = glShaderSourceARB + .globl glUniform1f ; .type glUniform1f,#function ; glUniform1f = glUniform1fARB + .globl glUniform1fv ; .type glUniform1fv,#function ; glUniform1fv = glUniform1fvARB + .globl glUniform1i ; .type glUniform1i,#function ; glUniform1i = glUniform1iARB + .globl glUniform1iv ; .type glUniform1iv,#function ; glUniform1iv = glUniform1ivARB + .globl glUniform2f ; .type glUniform2f,#function ; glUniform2f = glUniform2fARB + .globl glUniform2fv ; .type glUniform2fv,#function ; glUniform2fv = glUniform2fvARB + .globl glUniform2i ; .type glUniform2i,#function ; glUniform2i = glUniform2iARB + .globl glUniform2iv ; .type glUniform2iv,#function ; glUniform2iv = glUniform2ivARB + .globl glUniform3f ; .type glUniform3f,#function ; glUniform3f = glUniform3fARB + .globl glUniform3fv ; .type glUniform3fv,#function ; glUniform3fv = glUniform3fvARB + .globl glUniform3i ; .type glUniform3i,#function ; glUniform3i = glUniform3iARB + .globl glUniform3iv ; .type glUniform3iv,#function ; glUniform3iv = glUniform3ivARB + .globl glUniform4f ; .type glUniform4f,#function ; glUniform4f = glUniform4fARB + .globl glUniform4fv ; .type glUniform4fv,#function ; glUniform4fv = glUniform4fvARB + .globl glUniform4i ; .type glUniform4i,#function ; glUniform4i = glUniform4iARB + .globl glUniform4iv ; .type glUniform4iv,#function ; glUniform4iv = glUniform4ivARB + .globl glUniformMatrix2fv ; .type glUniformMatrix2fv,#function ; glUniformMatrix2fv = glUniformMatrix2fvARB + .globl glUniformMatrix3fv ; .type glUniformMatrix3fv,#function ; glUniformMatrix3fv = glUniformMatrix3fvARB + .globl glUniformMatrix4fv ; .type glUniformMatrix4fv,#function ; glUniformMatrix4fv = glUniformMatrix4fvARB + .globl glUseProgram ; .type glUseProgram,#function ; glUseProgram = glUseProgramObjectARB + .globl glValidateProgram ; .type glValidateProgram,#function ; glValidateProgram = glValidateProgramARB + .globl glBindAttribLocation ; .type glBindAttribLocation,#function ; glBindAttribLocation = glBindAttribLocationARB + .globl glGetActiveAttrib ; .type glGetActiveAttrib,#function ; glGetActiveAttrib = glGetActiveAttribARB + .globl glGetAttribLocation ; .type glGetAttribLocation,#function ; glGetAttribLocation = glGetAttribLocationARB .globl glDrawBuffers ; .type glDrawBuffers,#function ; glDrawBuffers = glDrawBuffersARB .globl glDrawBuffersATI ; .type glDrawBuffersATI,#function ; glDrawBuffersATI = glDrawBuffersARB - .globl glGetColorTableParameterfvEXT ; .type glGetColorTableParameterfvEXT,#function ; glGetColorTableParameterfvEXT = glGetColorTableParameterfvSGI - .globl glGetColorTableParameterivEXT ; .type glGetColorTableParameterivEXT,#function ; glGetColorTableParameterivEXT = glGetColorTableParameterivSGI - .globl glGetColorTableEXT ; .type glGetColorTableEXT,#function ; glGetColorTableEXT = glGetColorTableSGI .globl glPointParameterf ; .type glPointParameterf,#function ; glPointParameterf = glPointParameterfEXT .globl glPointParameterfARB ; .type glPointParameterfARB,#function ; glPointParameterfARB = glPointParameterfEXT .globl glPointParameterfv ; .type glPointParameterfv,#function ; glPointParameterfv = glPointParameterfvEXT diff --git a/src/mesa/sparc/sparc.c b/src/mesa/sparc/sparc.c index b7fe360d2c6..1b77b0bb7ba 100644 --- a/src/mesa/sparc/sparc.c +++ b/src/mesa/sparc/sparc.c @@ -133,7 +133,7 @@ void _mesa_init_all_sparc_transform_asm(void) _mesa_sparc_rescale_normals; #endif -#ifdef DEBUG +#ifdef DEBUG_MATH _math_test_all_transform_functions("sparc"); _math_test_all_cliptest_functions("sparc"); _math_test_all_normal_transform_functions("sparc"); diff --git a/src/mesa/swrast/s_aaline.c b/src/mesa/swrast/s_aaline.c index b8c214f6890..b3a209923fd 100644 --- a/src/mesa/swrast/s_aaline.c +++ b/src/mesa/swrast/s_aaline.c @@ -76,7 +76,7 @@ struct LineInfo GLfloat texWidth[MAX_TEXTURE_COORD_UNITS]; GLfloat texHeight[MAX_TEXTURE_COORD_UNITS]; - struct sw_span span; + SWspan span; }; diff --git a/src/mesa/swrast/s_aatritemp.h b/src/mesa/swrast/s_aatritemp.h index 23c262f8369..b5470a02980 100644 --- a/src/mesa/swrast/s_aatritemp.h +++ b/src/mesa/swrast/s_aatritemp.h @@ -51,7 +51,7 @@ GLboolean ltor; GLfloat majDx, majDy; /* major (i.e. long) edge dx and dy */ - struct sw_span span; + SWspan span; #ifdef DO_Z GLfloat zPlane[4]; @@ -279,7 +279,7 @@ while (coverage > 0.0F) { /* (cx,cy) = center of fragment */ const GLfloat cx = ix + 0.5F, cy = iy + 0.5F; - struct span_arrays *array = span.array; + SWspanarrays *array = span.array; #ifdef DO_INDEX array->coverage[count] = (GLfloat) compute_coveragei(pMin, pMid, pMax, ix, iy); #else @@ -383,7 +383,7 @@ while (coverage > 0.0F) { /* (cx,cy) = center of fragment */ const GLfloat cx = ix + 0.5F, cy = iy + 0.5F; - struct span_arrays *array = span.array; + SWspanarrays *array = span.array; #ifdef DO_INDEX array->coverage[ix] = (GLfloat) compute_coveragei(pMin, pMax, pMid, ix, iy); #else @@ -452,7 +452,7 @@ /* shift all values to the left */ /* XXX this is temporary */ { - struct span_arrays *array = span.array; + SWspanarrays *array = span.array; GLint j; for (j = 0; j < (GLint) n; j++) { #ifdef DO_RGBA @@ -482,7 +482,7 @@ #ifdef DO_MULTITEX /* shift texcoords */ { - struct span_arrays *array = span.array; + SWspanarrays *array = span.array; GLuint unit; for (unit = 0; unit < ctx->Const.MaxTextureUnits; unit++) { if (ctx->Texture.Unit[unit]._ReallyEnabled) { diff --git a/src/mesa/swrast/s_accum.c b/src/mesa/swrast/s_accum.c index a159e804976..69e9404c55c 100644 --- a/src/mesa/swrast/s_accum.c +++ b/src/mesa/swrast/s_accum.c @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.5.1 + * Version: 6.5.2 * * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. * @@ -307,7 +307,7 @@ accum_accum(GLcontext *ctx, GLfloat value, /* read colors from color buffer */ _swrast_read_rgba_span(ctx, ctx->ReadBuffer->_ColorReadBuffer, width, - xpos, ypos + i, rgba); + xpos, ypos + i, CHAN_TYPE, rgba); /* do accumulation */ if (swrast->_IntegerAccumMode) { @@ -391,7 +391,7 @@ accum_load(GLcontext *ctx, GLfloat value, /* read colors from color buffer */ _swrast_read_rgba_span(ctx, ctx->ReadBuffer->_ColorReadBuffer, width, - xpos, ypos + i, rgba); + xpos, ypos + i, CHAN_TYPE, rgba); /* do load */ if (swrast->_IntegerAccumMode) { @@ -467,9 +467,14 @@ accum_return(GLcontext *ctx, GLfloat value, /* XXX maybe transpose the 'i' and 'buffer' loops??? */ for (i = 0; i < height; i++) { - GLchan rgba[MAX_WIDTH][4]; GLshort accumRow[4 * MAX_WIDTH]; GLshort *acc; + SWspan span; + + /* init color span */ + INIT_SPAN(span, GL_BITMAP, width, 0, SPAN_RGBA); + span.x = xpos; + span.y = ypos + i; if (directAccess) { acc = (GLshort *) accumRb->GetPointer(ctx, accumRb, xpos, ypos +i); @@ -487,10 +492,10 @@ accum_return(GLcontext *ctx, GLfloat value, ASSERT(acc[j * 4 + 1] < max); ASSERT(acc[j * 4 + 2] < max); ASSERT(acc[j * 4 + 3] < max); - rgba[j][RCOMP] = multTable[acc[j * 4 + 0]]; - rgba[j][GCOMP] = multTable[acc[j * 4 + 1]]; - rgba[j][BCOMP] = multTable[acc[j * 4 + 2]]; - rgba[j][ACOMP] = multTable[acc[j * 4 + 3]]; + span.array->rgba[j][RCOMP] = multTable[acc[j * 4 + 0]]; + span.array->rgba[j][GCOMP] = multTable[acc[j * 4 + 1]]; + span.array->rgba[j][BCOMP] = multTable[acc[j * 4 + 2]]; + span.array->rgba[j][ACOMP] = multTable[acc[j * 4 + 3]]; } } else { @@ -508,10 +513,10 @@ accum_return(GLcontext *ctx, GLfloat value, GLint b = IROUND( (GLfloat) (acc[j * 4 + 2]) * scale ); GLint a = IROUND( (GLfloat) (acc[j * 4 + 3]) * scale ); #endif - rgba[j][RCOMP] = CLAMP( r, 0, CHAN_MAX ); - rgba[j][GCOMP] = CLAMP( g, 0, CHAN_MAX ); - rgba[j][BCOMP] = CLAMP( b, 0, CHAN_MAX ); - rgba[j][ACOMP] = CLAMP( a, 0, CHAN_MAX ); + span.array->rgba[j][RCOMP] = CLAMP( r, 0, CHAN_MAX ); + span.array->rgba[j][GCOMP] = CLAMP( g, 0, CHAN_MAX ); + span.array->rgba[j][BCOMP] = CLAMP( b, 0, CHAN_MAX ); + span.array->rgba[j][ACOMP] = CLAMP( a, 0, CHAN_MAX ); } } @@ -519,9 +524,9 @@ accum_return(GLcontext *ctx, GLfloat value, for (buffer = 0; buffer < fb->_NumColorDrawBuffers[0]; buffer++) { struct gl_renderbuffer *rb = fb->_ColorDrawBuffers[0][buffer]; if (masking) { - _swrast_mask_rgba_array(ctx, rb, width, xpos, ypos + i, rgba); + _swrast_mask_rgba_span(ctx, rb, &span); } - rb->PutRow(ctx, rb, width, xpos, ypos + i, rgba, NULL); + rb->PutRow(ctx, rb, width, xpos, ypos + i, span.array->rgba, NULL); } } } @@ -536,12 +541,10 @@ accum_return(GLcontext *ctx, GLfloat value, * Software fallback for glAccum. */ void -_swrast_Accum( GLcontext *ctx, GLenum op, GLfloat value, - GLint xpos, GLint ypos, - GLint width, GLint height ) - +_swrast_Accum(GLcontext *ctx, GLenum op, GLfloat value) { SWcontext *swrast = SWRAST_CONTEXT(ctx); + GLint xpos, ypos, width, height; if (SWRAST_CONTEXT(ctx)->NewState) _swrast_validate_derived( ctx ); @@ -553,6 +556,14 @@ _swrast_Accum( GLcontext *ctx, GLenum op, GLfloat value, RENDER_START(swrast, ctx); + /* Compute region after calling RENDER_START so that we know the + * drawbuffer's size/bounds are up to date. + */ + xpos = ctx->DrawBuffer->_Xmin; + ypos = ctx->DrawBuffer->_Ymin; + width = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin; + height = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin; + switch (op) { case GL_ADD: if (value != 0.0F) { diff --git a/src/mesa/swrast/s_alpha.c b/src/mesa/swrast/s_alpha.c index 55c1e6a58f8..87a016512cd 100644 --- a/src/mesa/swrast/s_alpha.c +++ b/src/mesa/swrast/s_alpha.c @@ -1,9 +1,8 @@ - /* * Mesa 3-D graphics library - * Version: 4.1 + * Version: 6.5.2 * - * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2006 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"), @@ -37,188 +36,125 @@ #include "s_context.h" +#define ALPHA_TEST(ALPHA, LOOP_CODE) \ +do { \ + switch (ctx->Color.AlphaFunc) { \ + case GL_LESS: \ + for (i = 0; i < n; i++) { \ + mask[i] &= (ALPHA < ref); \ + LOOP_CODE; \ + } \ + break; \ + case GL_LEQUAL: \ + for (i = 0; i < n; i++) { \ + mask[i] &= (ALPHA <= ref); \ + LOOP_CODE; \ + } \ + break; \ + case GL_GEQUAL: \ + for (i = 0; i < n; i++) { \ + mask[i] &= (ALPHA >= ref); \ + LOOP_CODE; \ + } \ + break; \ + case GL_GREATER: \ + for (i = 0; i < n; i++) { \ + mask[i] &= (ALPHA > ref); \ + LOOP_CODE; \ + } \ + break; \ + case GL_NOTEQUAL: \ + for (i = 0; i < n; i++) { \ + mask[i] &= (ALPHA != ref); \ + LOOP_CODE; \ + } \ + break; \ + case GL_EQUAL: \ + for (i = 0; i < n; i++) { \ + mask[i] &= (ALPHA == ref); \ + LOOP_CODE; \ + } \ + break; \ + default: \ + _mesa_problem(ctx, "Invalid alpha test in _swrast_alpha_test" ); \ + return 0; \ + } \ +} while (0) + + + /** - * \fn GLint _swrast_alpha_test( const GLcontext *ctx, struct sw_span *span ) - * \brief Apply the alpha test to a span of pixels. - * \return - * - "0" = all pixels in the span failed the alpha test. - * - "1" = one or more pixels passed the alpha test. + * Perform the alpha test for an array of pixels. + * For pixels that fail the test, mask[i] will be set to 0. + * \return 0 if all pixels in the span failed the alpha test, + * 1 if one or more pixels passed the alpha test. */ GLint -_swrast_alpha_test( const GLcontext *ctx, struct sw_span *span ) +_swrast_alpha_test(const GLcontext *ctx, SWspan *span) { - const GLchan (*rgba)[4] = (const GLchan (*)[4]) span->array->rgba; - GLchan ref; const GLuint n = span->end; GLubyte *mask = span->array->mask; GLuint i; - CLAMPED_FLOAT_TO_CHAN(ref, ctx->Color.AlphaRef); + if (ctx->Color.AlphaFunc == GL_ALWAYS) { + /* do nothing */ + return 1; + } + else if (ctx->Color.AlphaFunc == GL_NEVER) { + /* All pixels failed - caller should check for this return value and + * act accordingly. + */ + span->writeAll = GL_FALSE; + return 0; + } if (span->arrayMask & SPAN_RGBA) { - /* Use the array values */ - switch (ctx->Color.AlphaFunc) { - case GL_LESS: - for (i = 0; i < n; i++) - mask[i] &= (rgba[i][ACOMP] < ref); - break; - case GL_LEQUAL: - for (i = 0; i < n; i++) - mask[i] &= (rgba[i][ACOMP] <= ref); - break; - case GL_GEQUAL: - for (i = 0; i < n; i++) - mask[i] &= (rgba[i][ACOMP] >= ref); - break; - case GL_GREATER: - for (i = 0; i < n; i++) - mask[i] &= (rgba[i][ACOMP] > ref); - break; - case GL_NOTEQUAL: - for (i = 0; i < n; i++) - mask[i] &= (rgba[i][ACOMP] != ref); - break; - case GL_EQUAL: - for (i = 0; i < n; i++) - mask[i] &= (rgba[i][ACOMP] == ref); - break; - case GL_ALWAYS: - /* do nothing */ - return 1; - case GL_NEVER: - /* caller should check for zero! */ - span->writeAll = GL_FALSE; - return 0; - default: - _mesa_problem( ctx, "Invalid alpha test in _swrast_alpha_test" ); - return 0; + /* Use array's alpha values */ + if (span->array->ChanType == GL_UNSIGNED_BYTE) { + GLubyte (*rgba)[4] = span->array->color.sz1.rgba; + GLubyte ref; + CLAMPED_FLOAT_TO_UBYTE(ref, ctx->Color.AlphaRef); + ALPHA_TEST(rgba[i][ACOMP], ;); + } + else if (span->array->ChanType == GL_UNSIGNED_SHORT) { + GLushort (*rgba)[4] = span->array->color.sz2.rgba; + GLushort ref; + CLAMPED_FLOAT_TO_USHORT(ref, ctx->Color.AlphaRef); + ALPHA_TEST(rgba[i][ACOMP], ;); + } + else { + GLfloat (*rgba)[4] = span->array->color.sz4.rgba; + const GLfloat ref = ctx->Color.AlphaRef; + ALPHA_TEST(rgba[i][ACOMP], ;); } } else { - /* Use the interpolation values */ -#if CHAN_TYPE == GL_FLOAT - const GLfloat alphaStep = span->alphaStep; - GLfloat alpha = span->alpha; + /* Interpolate alpha values */ ASSERT(span->interpMask & SPAN_RGBA); - switch (ctx->Color.AlphaFunc) { - case GL_LESS: - for (i = 0; i < n; i++) { - mask[i] &= (alpha < ref); - alpha += alphaStep; - } - break; - case GL_LEQUAL: - for (i = 0; i < n; i++) { - mask[i] &= (alpha <= ref); - alpha += alphaStep; - } - break; - case GL_GEQUAL: - for (i = 0; i < n; i++) { - mask[i] &= (alpha >= ref); - alpha += alphaStep; - } - break; - case GL_GREATER: - for (i = 0; i < n; i++) { - mask[i] &= (alpha > ref); - alpha += alphaStep; - } - break; - case GL_NOTEQUAL: - for (i = 0; i < n; i++) { - mask[i] &= (alpha != ref); - alpha += alphaStep; - } - break; - case GL_EQUAL: - for (i = 0; i < n; i++) { - mask[i] &= (alpha == ref); - alpha += alphaStep; - } - break; - case GL_ALWAYS: - /* do nothing */ - return 1; - case GL_NEVER: - /* caller should check for zero! */ - span->writeAll = GL_FALSE; - return 0; - default: - _mesa_problem( ctx, "Invalid alpha test in gl_alpha_test" ); - return 0; + if (span->array->ChanType == GL_UNSIGNED_BYTE) { + const GLfixed alphaStep = span->alphaStep; + GLfixed alpha = span->alpha; + GLubyte ref; + CLAMPED_FLOAT_TO_UBYTE(ref, ctx->Color.AlphaRef); + ALPHA_TEST(FixedToInt(alpha), alpha += alphaStep); } -#else - /* 8 or 16-bit channel interpolation */ - const GLfixed alphaStep = span->alphaStep; - GLfixed alpha = span->alpha; - ASSERT(span->interpMask & SPAN_RGBA); - switch (ctx->Color.AlphaFunc) { - case GL_LESS: - for (i = 0; i < n; i++) { - mask[i] &= (FixedToChan(alpha) < ref); - alpha += alphaStep; - } - break; - case GL_LEQUAL: - for (i = 0; i < n; i++) { - mask[i] &= (FixedToChan(alpha) <= ref); - alpha += alphaStep; - } - break; - case GL_GEQUAL: - for (i = 0; i < n; i++) { - mask[i] &= (FixedToChan(alpha) >= ref); - alpha += alphaStep; - } - break; - case GL_GREATER: - for (i = 0; i < n; i++) { - mask[i] &= (FixedToChan(alpha) > ref); - alpha += alphaStep; - } - break; - case GL_NOTEQUAL: - for (i = 0; i < n; i++) { - mask[i] &= (FixedToChan(alpha) != ref); - alpha += alphaStep; - } - break; - case GL_EQUAL: - for (i = 0; i < n; i++) { - mask[i] &= (FixedToChan(alpha) == ref); - alpha += alphaStep; - } - break; - case GL_ALWAYS: - /* do nothing */ - return 1; - case GL_NEVER: - /* caller should check for zero! */ - span->writeAll = GL_FALSE; - return 0; - default: - _mesa_problem( ctx, "Invalid alpha test in gl_alpha_test" ); - return 0; + else if (span->array->ChanType == GL_UNSIGNED_SHORT) { + const GLfixed alphaStep = span->alphaStep; + GLfixed alpha = span->alpha; + GLushort ref; + CLAMPED_FLOAT_TO_USHORT(ref, ctx->Color.AlphaRef); + ALPHA_TEST(FixedToInt(alpha), alpha += alphaStep); + } + else { + const GLfloat alphaStep = span->alphaStep; + GLfloat alpha = span->alpha; + const GLfloat ref = ctx->Color.AlphaRef; + ALPHA_TEST(alpha, alpha += alphaStep); } -#endif /* CHAN_TYPE */ } -#if 0 - /* XXXX This causes conformance failures!!!! */ - while ((span->start <= span->end) && - (mask[span->start] == 0)) - span->start ++; - - while ((span->end >= span->start) && - (mask[span->end] == 0)) - span->end --; -#endif - span->writeAll = GL_FALSE; - if (span->start >= span->end) - return 0; - else - return 1; + /* XXX examine mask[] values? */ + return 1; } diff --git a/src/mesa/swrast/s_alpha.h b/src/mesa/swrast/s_alpha.h index add0f74c453..a85ef8a83ad 100644 --- a/src/mesa/swrast/s_alpha.h +++ b/src/mesa/swrast/s_alpha.h @@ -33,7 +33,7 @@ extern GLint -_swrast_alpha_test( const GLcontext *ctx, struct sw_span *span ); +_swrast_alpha_test( const GLcontext *ctx, SWspan *span ); #endif diff --git a/src/mesa/swrast/s_arbshader.c b/src/mesa/swrast/s_arbshader.c index c3f85ee1574..ee971a36ecc 100644 --- a/src/mesa/swrast/s_arbshader.c +++ b/src/mesa/swrast/s_arbshader.c @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.5 + * Version: 6.6 * * Copyright (C) 2006 Brian Paul All Rights Reserved. * @@ -38,11 +38,13 @@ #if FEATURE_ARB_fragment_shader void -_swrast_exec_arbshader(GLcontext *ctx, struct sw_span *span) +_swrast_exec_arbshader(GLcontext *ctx, SWspan *span) { struct gl2_program_intf **pro; GLuint i; + ASSERT(span->array->ChanType == GL_FLOAT); + if (!ctx->ShaderObjects._FragmentShaderPresent) return; @@ -57,6 +59,9 @@ _swrast_exec_arbshader(GLcontext *ctx, struct sw_span *span) GLuint j; GLboolean discard; + /* + * Load input attributes + */ vec[0] = (GLfloat) span->x + i; vec[1] = (GLfloat) span->y; vec[2] = (GLfloat) span->array->z[i] / ctx->DrawBuffer->_DepthMaxF; @@ -64,32 +69,22 @@ _swrast_exec_arbshader(GLcontext *ctx, struct sw_span *span) (**pro).UpdateFixedVarying(pro, SLANG_FRAGMENT_FIXED_FRAGCOORD, vec, 0, 4 * sizeof(GLfloat), GL_TRUE); - vec[0] = CHAN_TO_FLOAT(span->array->rgba[i][RCOMP]); - vec[1] = CHAN_TO_FLOAT(span->array->rgba[i][GCOMP]); - vec[2] = CHAN_TO_FLOAT(span->array->rgba[i][BCOMP]); - vec[3] = CHAN_TO_FLOAT(span->array->rgba[i][ACOMP]); - (**pro).UpdateFixedVarying(pro, SLANG_FRAGMENT_FIXED_COLOR, vec, 0, - 4 * sizeof(GLfloat), GL_TRUE); - - vec[0] = CHAN_TO_FLOAT(span->array->spec[i][RCOMP]); - vec[1] = CHAN_TO_FLOAT(span->array->spec[i][GCOMP]); - vec[2] = CHAN_TO_FLOAT(span->array->spec[i][BCOMP]); - vec[3] = CHAN_TO_FLOAT(span->array->spec[i][ACOMP]); + (**pro).UpdateFixedVarying(pro, SLANG_FRAGMENT_FIXED_COLOR, + span->array->color.sz4.rgba[i], + 0, 4 * sizeof(GLfloat), GL_TRUE); + (**pro).UpdateFixedVarying(pro, SLANG_FRAGMENT_FIXED_SECONDARYCOLOR, - vec, 0, 4 * sizeof(GLfloat), GL_TRUE); + span->array->color.sz4.spec[i], + 0, 4 * sizeof(GLfloat), GL_TRUE); for (j = 0; j < ctx->Const.MaxTextureCoordUnits; j++) { - vec[0] = span->array->texcoords[j][i][0]; - vec[1] = span->array->texcoords[j][i][1]; - vec[2] = span->array->texcoords[j][i][2]; - vec[3] = span->array->texcoords[j][i][3]; (**pro).UpdateFixedVarying(pro, SLANG_FRAGMENT_FIXED_TEXCOORD, - vec, j, 4 * sizeof(GLfloat), GL_TRUE); + span->array->texcoords[j][i], + j, 4 * sizeof(GLfloat), GL_TRUE); } for (j = 0; j < MAX_VARYING_VECTORS; j++) { GLuint k; - for (k = 0; k < VARYINGS_PER_VECTOR; k++) { (**pro).UpdateVarying(pro, j * VARYINGS_PER_VECTOR + k, &span->array->varying[i][j][k], @@ -99,6 +94,9 @@ _swrast_exec_arbshader(GLcontext *ctx, struct sw_span *span) _slang_exec_fragment_shader(pro); + /* + * Store results + */ _slang_fetch_discard(pro, &discard); if (discard) { span->array->mask[i] = GL_FALSE; @@ -107,10 +105,16 @@ _swrast_exec_arbshader(GLcontext *ctx, struct sw_span *span) else { (**pro).UpdateFixedVarying(pro, SLANG_FRAGMENT_FIXED_FRAGCOLOR, vec, 0, 4 * sizeof(GLfloat), GL_FALSE); - UNCLAMPED_FLOAT_TO_CHAN(span->array->rgba[i][RCOMP], vec[0]); - UNCLAMPED_FLOAT_TO_CHAN(span->array->rgba[i][GCOMP], vec[1]); - UNCLAMPED_FLOAT_TO_CHAN(span->array->rgba[i][BCOMP], vec[2]); - UNCLAMPED_FLOAT_TO_CHAN(span->array->rgba[i][ACOMP], vec[3]); + COPY_4V(span->array->color.sz4.rgba[i], vec); + + (**pro).UpdateFixedVarying(pro, SLANG_FRAGMENT_FIXED_FRAGDEPTH, vec, 0, + sizeof (GLfloat), GL_FALSE); + if (vec[0] <= 0.0f) + span->array->z[i] = 0; + else if (vec[0] >= 1.0f) + span->array->z[i] = ctx->DrawBuffer->_DepthMax; + else + span->array->z[i] = IROUND(vec[0] * ctx->DrawBuffer->_DepthMaxF); } } } diff --git a/src/mesa/swrast/s_arbshader.h b/src/mesa/swrast/s_arbshader.h index 805cd4da38f..5df80c870b0 100644 --- a/src/mesa/swrast/s_arbshader.h +++ b/src/mesa/swrast/s_arbshader.h @@ -30,7 +30,7 @@ #if FEATURE_ARB_fragment_shader -extern void _swrast_exec_arbshader (GLcontext *ctx, struct sw_span *span); +extern void _swrast_exec_arbshader (GLcontext *ctx, SWspan *span); #endif /* FEATURE_ARB_fragment_shader */ diff --git a/src/mesa/swrast/s_atifragshader.c b/src/mesa/swrast/s_atifragshader.c index 08640e146b5..75df50b0baa 100644 --- a/src/mesa/swrast/s_atifragshader.c +++ b/src/mesa/swrast/s_atifragshader.c @@ -30,6 +30,18 @@ #include "s_atifragshader.h" +/** + * State for executing ATI fragment shader. + */ +struct atifs_machine +{ + GLfloat Registers[6][4]; /** six temporary registers */ + GLfloat PrevPassRegisters[6][4]; + GLfloat Inputs[2][4]; /** Primary, secondary input colors */ +}; + + + /** * Fetch a texel. */ @@ -230,17 +242,6 @@ finish_pass(struct atifs_machine *machine) } } -/** - * Execute the given fragment shader - * NOTE: we do everything in single-precision floating point; we don't - * currently observe the single/half/fixed-precision qualifiers. - * \param ctx - rendering context - * \param program - the fragment program to execute - * \param machine - machine state (register file) - * \param maxInst - max number of instructions to execute - * \return GL_TRUE if program completed or GL_FALSE if program executed KIL. - */ - struct ati_fs_opcode_st ati_fs_opcodes[] = { {GL_ADD_ATI, 2}, {GL_SUB_ATI, 2}, @@ -259,7 +260,7 @@ struct ati_fs_opcode_st ati_fs_opcodes[] = { static void handle_pass_op(struct atifs_machine *machine, struct atifs_setupinst *texinst, - const struct sw_span *span, GLuint column, GLuint idx) + const SWspan *span, GLuint column, GLuint idx) { GLuint swizzle = texinst->swizzle; GLuint pass_tex = texinst->src; @@ -279,7 +280,7 @@ handle_pass_op(struct atifs_machine *machine, struct atifs_setupinst *texinst, static void handle_sample_op(GLcontext * ctx, struct atifs_machine *machine, - struct atifs_setupinst *texinst, const struct sw_span *span, + struct atifs_setupinst *texinst, const SWspan *span, GLuint column, GLuint idx) { /* sample from unit idx using texinst->src as coords */ @@ -304,11 +305,21 @@ do { \ COPY_4V(src[optype][i], x); \ } while (0) -static GLboolean -execute_shader(GLcontext * ctx, - const struct ati_fragment_shader *shader, GLuint maxInst, - struct atifs_machine *machine, const struct sw_span *span, - GLuint column) + + +/** + * Execute the given fragment shader. + * NOTE: we do everything in single-precision floating point + * \param ctx - rendering context + * \param shader - the shader to execute + * \param machine - virtual machine state + * \param span - the SWspan we're operating on + * \param column - which pixel [i] we're operating on in the span + */ +static void +execute_shader(GLcontext *ctx, const struct ati_fragment_shader *shader, + struct atifs_machine *machine, const SWspan *span, + GLuint column) { GLuint pc; struct atifs_instruction *inst; @@ -542,73 +553,58 @@ execute_shader(GLcontext * ctx, } } } - return GL_TRUE; } + +/** + * Init fragment shader virtual machine state. + */ static void init_machine(GLcontext * ctx, struct atifs_machine *machine, const struct ati_fragment_shader *shader, - const struct sw_span *span, GLuint col) + const SWspan *span, GLuint col) { + GLfloat (*inputs)[4] = machine->Inputs; GLint i, j; for (i = 0; i < 6; i++) { for (j = 0; j < 4; j++) - ctx->ATIFragmentShader.Machine.Registers[i][j] = 0.0; + machine->Registers[i][j] = 0.0; } - ctx->ATIFragmentShader.Machine.Inputs[ATI_FS_INPUT_PRIMARY][0] = - CHAN_TO_FLOAT(span->array->rgba[col][0]); - ctx->ATIFragmentShader.Machine.Inputs[ATI_FS_INPUT_PRIMARY][1] = - CHAN_TO_FLOAT(span->array->rgba[col][1]); - ctx->ATIFragmentShader.Machine.Inputs[ATI_FS_INPUT_PRIMARY][2] = - CHAN_TO_FLOAT(span->array->rgba[col][2]); - ctx->ATIFragmentShader.Machine.Inputs[ATI_FS_INPUT_PRIMARY][3] = - CHAN_TO_FLOAT(span->array->rgba[col][3]); - - ctx->ATIFragmentShader.Machine.Inputs[ATI_FS_INPUT_SECONDARY][0] = - CHAN_TO_FLOAT(span->array->spec[col][0]); - ctx->ATIFragmentShader.Machine.Inputs[ATI_FS_INPUT_SECONDARY][1] = - CHAN_TO_FLOAT(span->array->spec[col][1]); - ctx->ATIFragmentShader.Machine.Inputs[ATI_FS_INPUT_SECONDARY][2] = - CHAN_TO_FLOAT(span->array->spec[col][2]); - ctx->ATIFragmentShader.Machine.Inputs[ATI_FS_INPUT_SECONDARY][3] = - CHAN_TO_FLOAT(span->array->spec[col][3]); + COPY_4V(inputs[ATI_FS_INPUT_PRIMARY], span->array->color.sz4.rgba[col]); + COPY_4V(inputs[ATI_FS_INPUT_SECONDARY], span->array->color.sz4.spec[col]); } /** - * Execute the current fragment program, operating on the given span. + * Execute the current ATI shader program, operating on the given span. */ void -_swrast_exec_fragment_shader(GLcontext * ctx, struct sw_span *span) +_swrast_exec_fragment_shader(GLcontext * ctx, SWspan *span) { const struct ati_fragment_shader *shader = ctx->ATIFragmentShader.Current; + struct atifs_machine machine; GLuint i; + /* incoming colors should be floats */ + ASSERT(span->array->ChanType == GL_FLOAT); + ctx->_CurrentProgram = GL_FRAGMENT_SHADER_ATI; for (i = 0; i < span->end; i++) { if (span->array->mask[i]) { - init_machine(ctx, &ctx->ATIFragmentShader.Machine, - ctx->ATIFragmentShader.Current, span, i); - /* can't really happen... */ - if (!execute_shader(ctx, shader, ~0, - &ctx->ATIFragmentShader.Machine, span, i)) { - span->array->mask[i] = GL_FALSE; - span->writeAll = GL_FALSE; - } + init_machine(ctx, &machine, shader, span, i); + + execute_shader(ctx, shader, &machine, span, i); + /* store result color */ { - const GLfloat *colOut = - ctx->ATIFragmentShader.Machine.Registers[0]; - - /*fprintf(stderr,"outputs %f %f %f %f\n", colOut[0], colOut[1], colOut[2], colOut[3]); */ - UNCLAMPED_FLOAT_TO_CHAN(span->array->rgba[i][RCOMP], colOut[0]); - UNCLAMPED_FLOAT_TO_CHAN(span->array->rgba[i][GCOMP], colOut[1]); - UNCLAMPED_FLOAT_TO_CHAN(span->array->rgba[i][BCOMP], colOut[2]); - UNCLAMPED_FLOAT_TO_CHAN(span->array->rgba[i][ACOMP], colOut[3]); + const GLfloat *colOut = machine.Registers[0]; + /*fprintf(stderr,"outputs %f %f %f %f\n", + colOut[0], colOut[1], colOut[2], colOut[3]); */ + COPY_4V(span->array->color.sz4.rgba[i], colOut); } } } diff --git a/src/mesa/swrast/s_atifragshader.h b/src/mesa/swrast/s_atifragshader.h index 269be1f2e47..871a0c04559 100644 --- a/src/mesa/swrast/s_atifragshader.h +++ b/src/mesa/swrast/s_atifragshader.h @@ -31,7 +31,7 @@ extern void -_swrast_exec_fragment_shader( GLcontext *ctx, struct sw_span *span ); +_swrast_exec_fragment_shader( GLcontext *ctx, SWspan *span ); #endif diff --git a/src/mesa/swrast/s_bitmap.c b/src/mesa/swrast/s_bitmap.c index dd5008cf6b9..25a1ef89d04 100644 --- a/src/mesa/swrast/s_bitmap.c +++ b/src/mesa/swrast/s_bitmap.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.3 + * Version: 6.5.2 * - * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2006 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"), @@ -39,8 +39,10 @@ -/* +/** * Render a bitmap. + * Called via ctx->Driver.Bitmap() + * All parameter error checking will have been done before this is called. */ void _swrast_Bitmap( GLcontext *ctx, GLint px, GLint py, @@ -51,7 +53,7 @@ _swrast_Bitmap( GLcontext *ctx, GLint px, GLint py, SWcontext *swrast = SWRAST_CONTEXT(ctx); GLint row, col; GLuint count = 0; - struct sw_span span; + SWspan span; ASSERT(ctx->RenderMode == GL_RENDER); @@ -82,20 +84,7 @@ _swrast_Bitmap( GLcontext *ctx, GLint px, GLint py, INIT_SPAN(span, GL_BITMAP, width, 0, SPAN_XY); - if (ctx->Visual.rgbMode) { - span.interpMask |= SPAN_RGBA; - span.red = FloatToFixed(ctx->Current.RasterColor[0] * CHAN_MAXF); - span.green = FloatToFixed(ctx->Current.RasterColor[1] * CHAN_MAXF); - span.blue = FloatToFixed(ctx->Current.RasterColor[2] * CHAN_MAXF); - span.alpha = FloatToFixed(ctx->Current.RasterColor[3] * CHAN_MAXF); - span.redStep = span.greenStep = span.blueStep = span.alphaStep = 0; - } - else { - span.interpMask |= SPAN_INDEX; - span.index = FloatToFixed(ctx->Current.RasterIndex); - span.indexStep = 0; - } - + _swrast_span_default_color(ctx, &span); if (ctx->Depth.Test) _swrast_span_default_z(ctx, &span); if (swrast->_FogEnabled) @@ -177,7 +166,7 @@ _swrast_Bitmap( GLcontext *ctx, GLint px, GLint py, #if 0 /* * XXX this is another way to implement Bitmap. Use horizontal runs of - * fragments, initializing the mask array to indicate which fragmens to + * fragments, initializing the mask array to indicate which fragments to * draw or skip. */ void @@ -188,7 +177,7 @@ _swrast_Bitmap( GLcontext *ctx, GLint px, GLint py, { SWcontext *swrast = SWRAST_CONTEXT(ctx); GLint row, col; - struct sw_span span; + SWspan span; ASSERT(ctx->RenderMode == GL_RENDER); ASSERT(bitmap); @@ -204,20 +193,8 @@ _swrast_Bitmap( GLcontext *ctx, GLint px, GLint py, span.x = px; span.y = py; /*span.end = width;*/ - if (ctx->Visual.rgbMode) { - span.interpMask |= SPAN_RGBA; - span.red = FloatToFixed(ctx->Current.RasterColor[0] * CHAN_MAXF); - span.green = FloatToFixed(ctx->Current.RasterColor[1] * CHAN_MAXF); - span.blue = FloatToFixed(ctx->Current.RasterColor[2] * CHAN_MAXF); - span.alpha = FloatToFixed(ctx->Current.RasterColor[3] * CHAN_MAXF); - span.redStep = span.greenStep = span.blueStep = span.alphaStep = 0; - } - else { - span.interpMask |= SPAN_INDEX; - span.index = FloatToFixed(ctx->Current.RasterIndex); - span.indexStep = 0; - } + _swrast_span_default_color(ctx, &span); if (ctx->Depth.Test) _swrast_span_default_z(ctx, &span); if (swrast->_FogEnabled) diff --git a/src/mesa/swrast/s_blend.c b/src/mesa/swrast/s_blend.c index d94ff3923cf..82c5e84294a 100644 --- a/src/mesa/swrast/s_blend.c +++ b/src/mesa/swrast/s_blend.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.3 + * Version: 6.5.2 * - * Copyright (C) 1999-2005 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2006 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"), @@ -22,16 +22,19 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/* - * Regarding GL_NV_blend_square: + +/** + * \file swrast/s_blend.c + * \brief software blending. + * \author Brian Paul * - * Portions of this software may use or implement intellectual - * property owned and licensed by NVIDIA Corporation. NVIDIA disclaims - * any and all warranties with respect to such intellectual property, - * including any use thereof or modifications thereto. + * Only a few blend modes have been optimized (min, max, transparency, add) + * more optimized cases can easily be added if needed. + * Celestia uses glBlendFunc(GL_SRC_ALPHA, GL_ONE), for example. */ + #include "glheader.h" #include "context.h" #include "colormac.h" @@ -51,329 +54,450 @@ #endif -/* - * Special case for glBlendFunc(GL_ZERO, GL_ONE) +/** + * Integer divide by 255 + * Declare "int divtemp" before using. + * This satisfies Glean and should be reasonably fast. + * Contributed by Nathan Hand. + */ +#define DIV255(X) (divtemp = (X), ((divtemp << 8) + divtemp + 256) >> 16) + + + +/** + * Special case for glBlendFunc(GL_ZERO, GL_ONE). + * No-op means the framebuffer values remain unchanged. + * Any chanType ok. */ static void _BLENDAPI -blend_noop( GLcontext *ctx, GLuint n, const GLubyte mask[], - GLchan rgba[][4], CONST GLchan dest[][4] ) +blend_noop(GLcontext *ctx, GLuint n, const GLubyte mask[], + GLvoid *src, const GLvoid *dst, GLenum chanType) { - GLuint i; - ASSERT(ctx->Color.BlendEquationRGB==GL_FUNC_ADD); - ASSERT(ctx->Color.BlendEquationA==GL_FUNC_ADD); - ASSERT(ctx->Color.BlendSrcRGB==GL_ZERO); - ASSERT(ctx->Color.BlendDstRGB==GL_ONE); + GLint bytes; + + ASSERT(ctx->Color.BlendEquationRGB == GL_FUNC_ADD); + ASSERT(ctx->Color.BlendEquationA == GL_FUNC_ADD); + ASSERT(ctx->Color.BlendSrcRGB == GL_ZERO); + ASSERT(ctx->Color.BlendDstRGB == GL_ONE); (void) ctx; - for (i = 0; i < n; i++) { - if (mask[i]) { - COPY_CHAN4( rgba[i], dest[i] ); - } - } + /* just memcpy */ + if (chanType == GL_UNSIGNED_BYTE) + bytes = 4 * n * sizeof(GLubyte); + else if (chanType == GL_UNSIGNED_SHORT) + bytes = 4 * n * sizeof(GLushort); + else + bytes = 4 * n * sizeof(GLfloat); + + _mesa_memcpy(src, dst, bytes); } -/* +/** * Special case for glBlendFunc(GL_ONE, GL_ZERO) + * Any chanType ok. */ static void _BLENDAPI -blend_replace( GLcontext *ctx, GLuint n, const GLubyte mask[], - GLchan rgba[][4], CONST GLchan dest[][4] ) +blend_replace(GLcontext *ctx, GLuint n, const GLubyte mask[], + GLvoid *src, const GLvoid *dst, GLenum chanType) { - ASSERT(ctx->Color.BlendEquationRGB==GL_FUNC_ADD); - ASSERT(ctx->Color.BlendEquationA==GL_FUNC_ADD); - ASSERT(ctx->Color.BlendSrcRGB==GL_ONE); - ASSERT(ctx->Color.BlendDstRGB==GL_ZERO); + ASSERT(ctx->Color.BlendEquationRGB == GL_FUNC_ADD); + ASSERT(ctx->Color.BlendEquationA == GL_FUNC_ADD); + ASSERT(ctx->Color.BlendSrcRGB == GL_ONE); + ASSERT(ctx->Color.BlendDstRGB == GL_ZERO); (void) ctx; (void) n; (void) mask; - (void) rgba; - (void) dest; + (void) src; + (void) dst; } -/* - * Common transparency blending mode. +/** + * Common transparency blending mode: + * glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA). */ static void _BLENDAPI -blend_transparency( GLcontext *ctx, GLuint n, const GLubyte mask[], - GLchan rgba[][4], CONST GLchan dest[][4] ) +blend_transparency_ubyte(GLcontext *ctx, GLuint n, const GLubyte mask[], + GLvoid *src, const GLvoid *dst, GLenum chanType) { + GLubyte (*rgba)[4] = (GLubyte (*)[4]) src; + const GLubyte (*dest)[4] = (const GLubyte (*)[4]) dst; GLuint i; - ASSERT(ctx->Color.BlendEquationRGB==GL_FUNC_ADD); - ASSERT(ctx->Color.BlendEquationA==GL_FUNC_ADD); - ASSERT(ctx->Color.BlendSrcRGB==GL_SRC_ALPHA); - ASSERT(ctx->Color.BlendDstRGB==GL_ONE_MINUS_SRC_ALPHA); + + ASSERT(ctx->Color.BlendEquationRGB == GL_FUNC_ADD); + ASSERT(ctx->Color.BlendEquationA == GL_FUNC_ADD); + ASSERT(ctx->Color.BlendSrcRGB == GL_SRC_ALPHA); + ASSERT(ctx->Color.BlendSrcA == GL_SRC_ALPHA); + ASSERT(ctx->Color.BlendDstRGB == GL_ONE_MINUS_SRC_ALPHA); + ASSERT(ctx->Color.BlendDstA == GL_ONE_MINUS_SRC_ALPHA); + ASSERT(chanType == GL_UNSIGNED_BYTE); + (void) ctx; - for (i=0;i> 8; - const GLint g = (rgba[i][GCOMP] * t + dest[i][GCOMP] * s + 1) >> 8; - const GLint b = (rgba[i][BCOMP] * t + dest[i][BCOMP] * s + 1) >> 8; - const GLint a = (rgba[i][ACOMP] * t + dest[i][ACOMP] * s + 1) >> 8; -#elif 0 - /* This is slower but satisfies Glean */ - const GLint s = CHAN_MAX - t; - const GLint r = (rgba[i][RCOMP] * t + dest[i][RCOMP] * s) / 255; - const GLint g = (rgba[i][GCOMP] * t + dest[i][GCOMP] * s) / 255; - const GLint b = (rgba[i][BCOMP] * t + dest[i][BCOMP] * s) / 255; - const GLint a = (rgba[i][ACOMP] * t + dest[i][ACOMP] * s) / 255; -#else -#if CHAN_BITS == 8 - /* This satisfies Glean and should be reasonably fast */ - /* Contributed by Nathan Hand */ -#if 0 -#define DIV255(X) (((X) << 8) + (X) + 256) >> 16 -#else - GLint temp; -#define DIV255(X) (temp = (X), ((temp << 8) + temp + 256) >> 16) -#endif + else if (t != 255) { + GLint divtemp; const GLint r = DIV255((rgba[i][RCOMP] - dest[i][RCOMP]) * t) + dest[i][RCOMP]; const GLint g = DIV255((rgba[i][GCOMP] - dest[i][GCOMP]) * t) + dest[i][GCOMP]; const GLint b = DIV255((rgba[i][BCOMP] - dest[i][BCOMP]) * t) + dest[i][BCOMP]; const GLint a = DIV255((rgba[i][ACOMP] - dest[i][ACOMP]) * t) + dest[i][ACOMP]; - -#undef DIV255 -#elif CHAN_BITS == 16 - const GLfloat tt = (GLfloat) t / CHAN_MAXF; - const GLint r = (GLint) ((rgba[i][RCOMP] - dest[i][RCOMP]) * tt + dest[i][RCOMP]); - const GLint g = (GLint) ((rgba[i][GCOMP] - dest[i][GCOMP]) * tt + dest[i][GCOMP]); - const GLint b = (GLint) ((rgba[i][BCOMP] - dest[i][BCOMP]) * tt + dest[i][BCOMP]); - const GLint a = (GLint) ((rgba[i][ACOMP] - dest[i][ACOMP]) * tt + dest[i][ACOMP]); -#else /* CHAN_BITS == 32 */ - const GLfloat tt = (GLfloat) t / CHAN_MAXF; - const GLfloat r = (rgba[i][RCOMP] - dest[i][RCOMP]) * tt + dest[i][RCOMP]; - const GLfloat g = (rgba[i][GCOMP] - dest[i][GCOMP]) * tt + dest[i][GCOMP]; - const GLfloat b = (rgba[i][BCOMP] - dest[i][BCOMP]) * tt + dest[i][BCOMP]; - const GLfloat a = CLAMP( rgba[i][ACOMP], 0.0F, CHAN_MAXF ) * t + - CLAMP( dest[i][ACOMP], 0.0F, CHAN_MAXF ) * (1.0F - t); -#endif -#endif - ASSERT(r <= CHAN_MAX); - ASSERT(g <= CHAN_MAX); - ASSERT(b <= CHAN_MAX); - ASSERT(a <= CHAN_MAX); - rgba[i][RCOMP] = (GLchan) r; - rgba[i][GCOMP] = (GLchan) g; - rgba[i][BCOMP] = (GLchan) b; - rgba[i][ACOMP] = (GLchan) a; + ASSERT(r <= 255); + ASSERT(g <= 255); + ASSERT(b <= 255); + ASSERT(a <= 255); + rgba[i][RCOMP] = (GLubyte) r; + rgba[i][GCOMP] = (GLubyte) g; + rgba[i][BCOMP] = (GLubyte) b; + rgba[i][ACOMP] = (GLubyte) a; } } } } +static void _BLENDAPI +blend_transparency_ushort(GLcontext *ctx, GLuint n, const GLubyte mask[], + GLvoid *src, const GLvoid *dst, GLenum chanType) +{ + GLushort (*rgba)[4] = (GLushort (*)[4]) src; + const GLushort (*dest)[4] = (const GLushort (*)[4]) dst; + GLuint i; + + ASSERT(ctx->Color.BlendEquationRGB == GL_FUNC_ADD); + ASSERT(ctx->Color.BlendEquationA == GL_FUNC_ADD); + ASSERT(ctx->Color.BlendSrcRGB == GL_SRC_ALPHA); + ASSERT(ctx->Color.BlendSrcA == GL_SRC_ALPHA); + ASSERT(ctx->Color.BlendDstRGB == GL_ONE_MINUS_SRC_ALPHA); + ASSERT(ctx->Color.BlendDstA == GL_ONE_MINUS_SRC_ALPHA); + ASSERT(chanType == GL_UNSIGNED_SHORT); + + (void) ctx; + + for (i = 0; i < n; i++) { + if (mask[i]) { + const GLint t = rgba[i][ACOMP]; + if (t == 0) { + /* 0% alpha */ + COPY_4V(rgba[i], dest[i]); + } + else if (t != 65535) { + const GLfloat tt = (GLfloat) t / 65535.0F; + GLushort r = (GLushort) ((rgba[i][RCOMP] - dest[i][RCOMP]) * tt + dest[i][RCOMP]); + GLushort g = (GLushort) ((rgba[i][GCOMP] - dest[i][GCOMP]) * tt + dest[i][GCOMP]); + GLushort b = (GLushort) ((rgba[i][BCOMP] - dest[i][BCOMP]) * tt + dest[i][BCOMP]); + GLushort a = (GLushort) ((rgba[i][ACOMP] - dest[i][ACOMP]) * tt + dest[i][ACOMP]); + ASSIGN_4V(rgba[i], r, g, b, a); + } + } + } +} + -/* - * Add src and dest. - */ static void _BLENDAPI -blend_add( GLcontext *ctx, GLuint n, const GLubyte mask[], - GLchan rgba[][4], CONST GLchan dest[][4] ) +blend_transparency_float(GLcontext *ctx, GLuint n, const GLubyte mask[], + GLvoid *src, const GLvoid *dst, GLenum chanType) { + GLfloat (*rgba)[4] = (GLfloat (*)[4]) src; + const GLfloat (*dest)[4] = (const GLfloat (*)[4]) dst; GLuint i; - ASSERT(ctx->Color.BlendEquationRGB==GL_FUNC_ADD); - ASSERT(ctx->Color.BlendEquationA==GL_FUNC_ADD); - ASSERT(ctx->Color.BlendSrcRGB==GL_ONE); - ASSERT(ctx->Color.BlendDstRGB==GL_ONE); + + ASSERT(ctx->Color.BlendEquationRGB == GL_FUNC_ADD); + ASSERT(ctx->Color.BlendEquationA == GL_FUNC_ADD); + ASSERT(ctx->Color.BlendSrcRGB == GL_SRC_ALPHA); + ASSERT(ctx->Color.BlendSrcA == GL_SRC_ALPHA); + ASSERT(ctx->Color.BlendDstRGB == GL_ONE_MINUS_SRC_ALPHA); + ASSERT(ctx->Color.BlendDstA == GL_ONE_MINUS_SRC_ALPHA); + ASSERT(chanType == GL_FLOAT); + (void) ctx; - for (i=0;iColor.BlendEquationRGB==GL_MIN); - ASSERT(ctx->Color.BlendEquationA==GL_MIN); + + ASSERT(ctx->Color.BlendEquationRGB == GL_FUNC_ADD); + ASSERT(ctx->Color.BlendEquationA == GL_FUNC_ADD); + ASSERT(ctx->Color.BlendSrcRGB == GL_ONE); + ASSERT(ctx->Color.BlendDstRGB == GL_ONE); (void) ctx; - for (i=0;iColor.BlendEquationRGB==GL_MAX); - ASSERT(ctx->Color.BlendEquationA==GL_MAX); + ASSERT(ctx->Color.BlendEquationRGB == GL_MIN); + ASSERT(ctx->Color.BlendEquationA == GL_MIN); (void) ctx; - for (i=0;iColor.BlendEquationRGB == GL_MAX); + ASSERT(ctx->Color.BlendEquationA == GL_MAX); (void) ctx; - for (i=0;i> 16; - GLint g = (rgba[i][GCOMP] * dest[i][GCOMP] + 65535) >> 16; - GLint b = (rgba[i][BCOMP] * dest[i][BCOMP] + 65535) >> 16; - GLint a = (rgba[i][ACOMP] * dest[i][ACOMP] + 65535) >> 16; - rgba[i][RCOMP] = (GLchan) r; - rgba[i][GCOMP] = (GLchan) g; - rgba[i][BCOMP] = (GLchan) b; - rgba[i][ACOMP] = (GLchan) a; -#else - GLint r = (rgba[i][RCOMP] * dest[i][RCOMP] + 255) >> 8; - GLint g = (rgba[i][GCOMP] * dest[i][GCOMP] + 255) >> 8; - GLint b = (rgba[i][BCOMP] * dest[i][BCOMP] + 255) >> 8; - GLint a = (rgba[i][ACOMP] * dest[i][ACOMP] + 255) >> 8; - rgba[i][RCOMP] = (GLchan) r; - rgba[i][GCOMP] = (GLchan) g; - rgba[i][BCOMP] = (GLchan) b; - rgba[i][ACOMP] = (GLchan) a; -#endif + if (chanType == GL_UNSIGNED_BYTE) { + GLubyte (*rgba)[4] = (GLubyte (*)[4]) src; + const GLubyte (*dest)[4] = (const GLubyte (*)[4]) dst; + for (i=0;i> 16; + rgba[i][GCOMP] = (rgba[i][GCOMP] * dest[i][GCOMP] + 65535) >> 16; + rgba[i][BCOMP] = (rgba[i][BCOMP] * dest[i][BCOMP] + 65535) >> 16; + rgba[i][ACOMP] = (rgba[i][ACOMP] * dest[i][ACOMP] + 65535) >> 16; + } + } + } + else { + GLfloat (*rgba)[4] = (GLfloat (*)[4]) src; + const GLfloat (*dest)[4] = (const GLfloat (*)[4]) dst; + ASSERT(chanType == GL_FLOAT); + for (i=0;iColor.BlendSrcRGB) { @@ -384,33 +508,33 @@ blend_general( GLcontext *ctx, GLuint n, const GLubyte mask[], sR = sG = sB = 1.0F; break; case GL_DST_COLOR: - sR = (GLfloat) Rd * rscale; - sG = (GLfloat) Gd * gscale; - sB = (GLfloat) Bd * bscale; + sR = Rd; + sG = Gd; + sB = Bd; break; case GL_ONE_MINUS_DST_COLOR: - sR = 1.0F - (GLfloat) Rd * rscale; - sG = 1.0F - (GLfloat) Gd * gscale; - sB = 1.0F - (GLfloat) Bd * bscale; + sR = 1.0F - Rd; + sG = 1.0F - Gd; + sB = 1.0F - Bd; break; case GL_SRC_ALPHA: - sR = sG = sB = (GLfloat) As * ascale; + sR = sG = sB = As; break; case GL_ONE_MINUS_SRC_ALPHA: - sR = sG = sB = 1.0F - (GLfloat) As * ascale; + sR = sG = sB = 1.0F - As; break; case GL_DST_ALPHA: - sR = sG = sB = (GLfloat) Ad * ascale; + sR = sG = sB = Ad; break; case GL_ONE_MINUS_DST_ALPHA: - sR = sG = sB = 1.0F - (GLfloat) Ad * ascale; + sR = sG = sB = 1.0F - Ad; break; case GL_SRC_ALPHA_SATURATE: - if (As < CHAN_MAX - Ad) { - sR = sG = sB = (GLfloat) As * ascale; + if (As < 1.0F - Ad) { + sR = sG = sB = As; } else { - sR = sG = sB = 1.0F - (GLfloat) Ad * ascale; + sR = sG = sB = 1.0F - Ad; } break; case GL_CONSTANT_COLOR: @@ -429,19 +553,19 @@ blend_general( GLcontext *ctx, GLuint n, const GLubyte mask[], case GL_ONE_MINUS_CONSTANT_ALPHA: sR = sG = sB = 1.0F - ctx->Color.BlendColor[3]; break; - case GL_SRC_COLOR: /* GL_NV_blend_square */ - sR = (GLfloat) Rs * rscale; - sG = (GLfloat) Gs * gscale; - sB = (GLfloat) Bs * bscale; + case GL_SRC_COLOR: + sR = Rs; + sG = Gs; + sB = Bs; break; - case GL_ONE_MINUS_SRC_COLOR: /* GL_NV_blend_square */ - sR = 1.0F - (GLfloat) Rs * rscale; - sG = 1.0F - (GLfloat) Gs * gscale; - sB = 1.0F - (GLfloat) Bs * bscale; + case GL_ONE_MINUS_SRC_COLOR: + sR = 1.0F - Rs; + sG = 1.0F - Gs; + sB = 1.0F - Bs; break; default: /* this should never happen */ - _mesa_problem(ctx, "Bad blend source RGB factor in do_blend"); + _mesa_problem(ctx, "Bad blend source RGB factor in blend_general_float"); return; } @@ -454,22 +578,22 @@ blend_general( GLcontext *ctx, GLuint n, const GLubyte mask[], sA = 1.0F; break; case GL_DST_COLOR: - sA = (GLfloat) Ad * ascale; + sA = Ad; break; case GL_ONE_MINUS_DST_COLOR: - sA = 1.0F - (GLfloat) Ad * ascale; + sA = 1.0F - Ad; break; case GL_SRC_ALPHA: - sA = (GLfloat) As * ascale; + sA = As; break; case GL_ONE_MINUS_SRC_ALPHA: - sA = 1.0F - (GLfloat) As * ascale; + sA = 1.0F - As; break; case GL_DST_ALPHA: - sA =(GLfloat) Ad * ascale; + sA = Ad; break; case GL_ONE_MINUS_DST_ALPHA: - sA = 1.0F - (GLfloat) Ad * ascale; + sA = 1.0F - Ad; break; case GL_SRC_ALPHA_SATURATE: sA = 1.0; @@ -486,16 +610,17 @@ blend_general( GLcontext *ctx, GLuint n, const GLubyte mask[], case GL_ONE_MINUS_CONSTANT_ALPHA: sA = 1.0F - ctx->Color.BlendColor[3]; break; - case GL_SRC_COLOR: /* GL_NV_blend_square */ - sA = (GLfloat) As * ascale; + case GL_SRC_COLOR: + sA = As; break; - case GL_ONE_MINUS_SRC_COLOR: /* GL_NV_blend_square */ - sA = 1.0F - (GLfloat) As * ascale; + case GL_ONE_MINUS_SRC_COLOR: + sA = 1.0F - As; break; default: /* this should never happen */ sA = 0.0F; - _mesa_problem(ctx, "Bad blend source A factor in do_blend"); + _mesa_problem(ctx, "Bad blend source A factor in blend_general_float"); + return; } /* Dest RGB factor */ @@ -507,26 +632,26 @@ blend_general( GLcontext *ctx, GLuint n, const GLubyte mask[], dR = dG = dB = 1.0F; break; case GL_SRC_COLOR: - dR = (GLfloat) Rs * rscale; - dG = (GLfloat) Gs * gscale; - dB = (GLfloat) Bs * bscale; + dR = Rs; + dG = Gs; + dB = Bs; break; case GL_ONE_MINUS_SRC_COLOR: - dR = 1.0F - (GLfloat) Rs * rscale; - dG = 1.0F - (GLfloat) Gs * gscale; - dB = 1.0F - (GLfloat) Bs * bscale; + dR = 1.0F - Rs; + dG = 1.0F - Gs; + dB = 1.0F - Bs; break; case GL_SRC_ALPHA: - dR = dG = dB = (GLfloat) As * ascale; + dR = dG = dB = As; break; case GL_ONE_MINUS_SRC_ALPHA: - dR = dG = dB = 1.0F - (GLfloat) As * ascale; + dR = dG = dB = 1.0F - As; break; case GL_DST_ALPHA: - dR = dG = dB = (GLfloat) Ad * ascale; + dR = dG = dB = Ad; break; case GL_ONE_MINUS_DST_ALPHA: - dR = dG = dB = 1.0F - (GLfloat) Ad * ascale; + dR = dG = dB = 1.0F - Ad; break; case GL_CONSTANT_COLOR: dR = ctx->Color.BlendColor[0]; @@ -544,20 +669,21 @@ blend_general( GLcontext *ctx, GLuint n, const GLubyte mask[], case GL_ONE_MINUS_CONSTANT_ALPHA: dR = dG = dB = 1.0F - ctx->Color.BlendColor[3]; break; - case GL_DST_COLOR: /* GL_NV_blend_square */ - dR = (GLfloat) Rd * rscale; - dG = (GLfloat) Gd * gscale; - dB = (GLfloat) Bd * bscale; + case GL_DST_COLOR: + dR = Rd; + dG = Gd; + dB = Bd; break; - case GL_ONE_MINUS_DST_COLOR: /* GL_NV_blend_square */ - dR = 1.0F - (GLfloat) Rd * rscale; - dG = 1.0F - (GLfloat) Gd * gscale; - dB = 1.0F - (GLfloat) Bd * bscale; + case GL_ONE_MINUS_DST_COLOR: + dR = 1.0F - Rd; + dG = 1.0F - Gd; + dB = 1.0F - Bd; break; default: /* this should never happen */ dR = dG = dB = 0.0F; - _mesa_problem(ctx, "Bad blend dest RGB factor in do_blend"); + _mesa_problem(ctx, "Bad blend dest RGB factor in blend_general_float"); + return; } /* Dest Alpha factor */ @@ -569,22 +695,22 @@ blend_general( GLcontext *ctx, GLuint n, const GLubyte mask[], dA = 1.0F; break; case GL_SRC_COLOR: - dA = (GLfloat) As * ascale; + dA = As; break; case GL_ONE_MINUS_SRC_COLOR: - dA = 1.0F - (GLfloat) As * ascale; + dA = 1.0F - As; break; case GL_SRC_ALPHA: - dA = (GLfloat) As * ascale; + dA = As; break; case GL_ONE_MINUS_SRC_ALPHA: - dA = 1.0F - (GLfloat) As * ascale; + dA = 1.0F - As; break; case GL_DST_ALPHA: - dA = (GLfloat) Ad * ascale; + dA = Ad; break; case GL_ONE_MINUS_DST_ALPHA: - dA = 1.0F - (GLfloat) Ad * ascale; + dA = 1.0F - Ad; break; case GL_CONSTANT_COLOR: dA = ctx->Color.BlendColor[3]; @@ -598,171 +724,176 @@ blend_general( GLcontext *ctx, GLuint n, const GLubyte mask[], case GL_ONE_MINUS_CONSTANT_ALPHA: dA = 1.0F - ctx->Color.BlendColor[3]; break; - case GL_DST_COLOR: /* GL_NV_blend_square */ - dA = (GLfloat) Ad * ascale; + case GL_DST_COLOR: + dA = Ad; break; - case GL_ONE_MINUS_DST_COLOR: /* GL_NV_blend_square */ - dA = 1.0F - (GLfloat) Ad * ascale; + case GL_ONE_MINUS_DST_COLOR: + dA = 1.0F - Ad; break; default: /* this should never happen */ dA = 0.0F; - _mesa_problem(ctx, "Bad blend dest A factor in do_blend"); + _mesa_problem(ctx, "Bad blend dest A factor in blend_general_float"); return; } - /* Due to round-off problems we have to clamp against zero. */ - /* Optimization: we don't have to do this for all src & dst factors */ - if (dA < 0.0F) dA = 0.0F; - if (dR < 0.0F) dR = 0.0F; - if (dG < 0.0F) dG = 0.0F; - if (dB < 0.0F) dB = 0.0F; - if (sA < 0.0F) sA = 0.0F; - if (sR < 0.0F) sR = 0.0F; - if (sG < 0.0F) sG = 0.0F; - if (sB < 0.0F) sB = 0.0F; - - ASSERT( sR <= 1.0 ); - ASSERT( sG <= 1.0 ); - ASSERT( sB <= 1.0 ); - ASSERT( sA <= 1.0 ); - ASSERT( dR <= 1.0 ); - ASSERT( dG <= 1.0 ); - ASSERT( dB <= 1.0 ); - ASSERT( dA <= 1.0 ); - - /* compute blended color */ -#if CHAN_TYPE == GL_FLOAT - if (ctx->Color.BlendEquationRGB==GL_FUNC_ADD) { + /* compute the blended RGB */ + switch (ctx->Color.BlendEquationRGB) { + case GL_FUNC_ADD: r = Rs * sR + Rd * dR; g = Gs * sG + Gd * dG; b = Bs * sB + Bd * dB; a = As * sA + Ad * dA; - } - else if (ctx->Color.BlendEquationRGB==GL_FUNC_SUBTRACT) { + break; + case GL_FUNC_SUBTRACT: r = Rs * sR - Rd * dR; g = Gs * sG - Gd * dG; b = Bs * sB - Bd * dB; a = As * sA - Ad * dA; - } - else if (ctx->Color.BlendEquationRGB==GL_FUNC_REVERSE_SUBTRACT) { + break; + case GL_FUNC_REVERSE_SUBTRACT: r = Rd * dR - Rs * sR; g = Gd * dG - Gs * sG; b = Bd * dB - Bs * sB; a = Ad * dA - As * sA; - } - else if (ctx->Color.BlendEquationRGB==GL_MIN) { + break; + case GL_MIN: r = MIN2( Rd, Rs ); g = MIN2( Gd, Gs ); b = MIN2( Bd, Bs ); - } - else if (ctx->Color.BlendEquationRGB==GL_MAX) { + break; + case GL_MAX: r = MAX2( Rd, Rs ); g = MAX2( Gd, Gs ); b = MAX2( Bd, Bs ); - } - else { + break; + default: /* should never get here */ r = g = b = 0.0F; /* silence uninitialized var warning */ _mesa_problem(ctx, "unexpected BlendEquation in blend_general()"); + return; } - if (ctx->Color.BlendEquationA==GL_FUNC_ADD) { + /* compute the blended alpha */ + switch (ctx->Color.BlendEquationA) { + case GL_FUNC_ADD: a = As * sA + Ad * dA; - } - else if (ctx->Color.BlendEquationA==GL_FUNC_SUBTRACT) { + break; + case GL_FUNC_SUBTRACT: a = As * sA - Ad * dA; - } - else if (ctx->Color.BlendEquationA==GL_FUNC_REVERSE_SUBTRACT) { + break; + case GL_FUNC_REVERSE_SUBTRACT: a = Ad * dA - As * sA; - } - else if (ctx->Color.BlendEquationA==GL_MIN) { + break; + case GL_MIN: a = MIN2( Ad, As ); - } - else if (ctx->Color.BlendEquationA==GL_MAX) { + break; + case GL_MAX: a = MAX2( Ad, As ); - } - else { + break; + default: /* should never get here */ a = 0.0F; /* silence uninitialized var warning */ _mesa_problem(ctx, "unexpected BlendEquation in blend_general()"); + return; } /* final clamping */ +#if 0 rgba[i][RCOMP] = MAX2( r, 0.0F ); rgba[i][GCOMP] = MAX2( g, 0.0F ); rgba[i][BCOMP] = MAX2( b, 0.0F ); - rgba[i][ACOMP] = CLAMP( a, 0.0F, CHAN_MAXF ); + rgba[i][ACOMP] = CLAMP( a, 0.0F, 1.0F ); #else - if (ctx->Color.BlendEquationRGB==GL_FUNC_ADD) { - r = Rs * sR + Rd * dR + 0.5F; - g = Gs * sG + Gd * dG + 0.5F; - b = Bs * sB + Bd * dB + 0.5F; - } - else if (ctx->Color.BlendEquationRGB==GL_FUNC_SUBTRACT) { - r = Rs * sR - Rd * dR + 0.5F; - g = Gs * sG - Gd * dG + 0.5F; - b = Bs * sB - Bd * dB + 0.5F; - } - else if (ctx->Color.BlendEquationRGB==GL_FUNC_REVERSE_SUBTRACT) { - r = Rd * dR - Rs * sR + 0.5F; - g = Gd * dG - Gs * sG + 0.5F; - b = Bd * dB - Bs * sB + 0.5F; - } - else if (ctx->Color.BlendEquationRGB==GL_MIN) { - r = MIN2( Rd, Rs ); - g = MIN2( Gd, Gs ); - b = MIN2( Bd, Bs ); - } - else if (ctx->Color.BlendEquationRGB==GL_MAX) { - r = MAX2( Rd, Rs ); - g = MAX2( Gd, Gs ); - b = MAX2( Bd, Bs ); - } - else { - /* should never get here */ - r = g = b = 0.0F; /* silence uninitialized var warning */ - _mesa_problem(ctx, "unexpected BlendEquation in blend_general()"); - } + ASSIGN_4V(rgba[i], r, g, b, a); +#endif + } + } +} - if (ctx->Color.BlendEquationA==GL_FUNC_ADD) { - a = As * sA + Ad * dA + 0.5F; + +/** + * Do any blending operation, any chanType. + */ +static void +blend_general(GLcontext *ctx, GLuint n, const GLubyte mask[], + void *src, const void *dst, GLenum chanType) +{ + GLfloat rgbaF[MAX_WIDTH][4], destF[MAX_WIDTH][4]; + + if (chanType == GL_UNSIGNED_BYTE) { + GLubyte (*rgba)[4] = (GLubyte (*)[4]) src; + const GLubyte (*dest)[4] = (const GLubyte (*)[4]) dst; + GLuint i; + /* convert ubytes to floats */ + for (i = 0; i < n; i++) { + if (mask[i]) { + rgbaF[i][RCOMP] = UBYTE_TO_FLOAT(rgba[i][RCOMP]); + rgbaF[i][GCOMP] = UBYTE_TO_FLOAT(rgba[i][GCOMP]); + rgbaF[i][BCOMP] = UBYTE_TO_FLOAT(rgba[i][BCOMP]); + rgbaF[i][ACOMP] = UBYTE_TO_FLOAT(rgba[i][ACOMP]); + destF[i][RCOMP] = UBYTE_TO_FLOAT(dest[i][RCOMP]); + destF[i][GCOMP] = UBYTE_TO_FLOAT(dest[i][GCOMP]); + destF[i][BCOMP] = UBYTE_TO_FLOAT(dest[i][BCOMP]); + destF[i][ACOMP] = UBYTE_TO_FLOAT(dest[i][ACOMP]); } - else if (ctx->Color.BlendEquationA==GL_FUNC_SUBTRACT) { - a = As * sA - Ad * dA + 0.5F; + } + /* do blend */ + blend_general_float(ctx, n, mask, rgbaF, destF, chanType); + /* convert back to ubytes */ + for (i = 0; i < n; i++) { + if (mask[i]) { + UNCLAMPED_FLOAT_TO_UBYTE(rgba[i][RCOMP], rgbaF[i][RCOMP]); + UNCLAMPED_FLOAT_TO_UBYTE(rgba[i][GCOMP], rgbaF[i][GCOMP]); + UNCLAMPED_FLOAT_TO_UBYTE(rgba[i][BCOMP], rgbaF[i][BCOMP]); + UNCLAMPED_FLOAT_TO_UBYTE(rgba[i][ACOMP], rgbaF[i][ACOMP]); } - else if (ctx->Color.BlendEquationA==GL_FUNC_REVERSE_SUBTRACT) { - a = Ad * dA - As * sA + 0.5F; + } + } + else if (chanType == GL_UNSIGNED_SHORT) { + GLushort (*rgba)[4] = (GLushort (*)[4]) src; + const GLushort (*dest)[4] = (const GLushort (*)[4]) dst; + GLuint i; + /* convert ushorts to floats */ + for (i = 0; i < n; i++) { + if (mask[i]) { + rgbaF[i][RCOMP] = USHORT_TO_FLOAT(rgba[i][RCOMP]); + rgbaF[i][GCOMP] = USHORT_TO_FLOAT(rgba[i][GCOMP]); + rgbaF[i][BCOMP] = USHORT_TO_FLOAT(rgba[i][BCOMP]); + rgbaF[i][ACOMP] = USHORT_TO_FLOAT(rgba[i][ACOMP]); + destF[i][RCOMP] = USHORT_TO_FLOAT(dest[i][RCOMP]); + destF[i][GCOMP] = USHORT_TO_FLOAT(dest[i][GCOMP]); + destF[i][BCOMP] = USHORT_TO_FLOAT(dest[i][BCOMP]); + destF[i][ACOMP] = USHORT_TO_FLOAT(dest[i][ACOMP]); } - else if (ctx->Color.BlendEquationA==GL_MIN) { - a = MIN2( Ad, As ); - } - else if (ctx->Color.BlendEquationA==GL_MAX) { - a = MAX2( Ad, As ); - } - else { - /* should never get here */ - a = 0.0F; /* silence uninitialized var warning */ - _mesa_problem(ctx, "unexpected BlendEquation in blend_general()"); + } + /* do blend */ + blend_general_float(ctx, n, mask, rgbaF, destF, chanType); + /* convert back to ushorts */ + for (i = 0; i < n; i++) { + if (mask[i]) { + UNCLAMPED_FLOAT_TO_USHORT(rgba[i][RCOMP], rgbaF[i][RCOMP]); + UNCLAMPED_FLOAT_TO_USHORT(rgba[i][GCOMP], rgbaF[i][GCOMP]); + UNCLAMPED_FLOAT_TO_USHORT(rgba[i][BCOMP], rgbaF[i][BCOMP]); + UNCLAMPED_FLOAT_TO_USHORT(rgba[i][ACOMP], rgbaF[i][ACOMP]); } - - /* final clamping */ - rgba[i][RCOMP] = (GLchan) (GLint) CLAMP( r, 0.0F, CHAN_MAXF ); - rgba[i][GCOMP] = (GLchan) (GLint) CLAMP( g, 0.0F, CHAN_MAXF ); - rgba[i][BCOMP] = (GLchan) (GLint) CLAMP( b, 0.0F, CHAN_MAXF ); - rgba[i][ACOMP] = (GLchan) (GLint) CLAMP( a, 0.0F, CHAN_MAXF ); -#endif } } + else { + blend_general_float(ctx, n, mask, rgbaF, destF, chanType); + } } -/* + +/** * Analyze current blending parameters to pick fastest blending function. * Result: the ctx->Color.BlendFunc pointer is updated. */ -void _swrast_choose_blend_func( GLcontext *ctx ) +void +_swrast_choose_blend_func(GLcontext *ctx, GLenum chanType) { + SWcontext *swrast = SWRAST_CONTEXT(ctx); const GLenum eq = ctx->Color.BlendEquationRGB; const GLenum srcRGB = ctx->Color.BlendSrcRGB; const GLenum dstRGB = ctx->Color.BlendDstRGB; @@ -770,103 +901,101 @@ void _swrast_choose_blend_func( GLcontext *ctx ) const GLenum dstA = ctx->Color.BlendDstA; if (ctx->Color.BlendEquationRGB != ctx->Color.BlendEquationA) { - SWRAST_CONTEXT(ctx)->BlendFunc = blend_general; + swrast->BlendFunc = blend_general; } - else if (eq==GL_MIN) { + else if (eq == GL_MIN) { /* Note: GL_MIN ignores the blending weight factors */ #if defined(USE_MMX_ASM) - if ( cpu_has_mmx ) { - SWRAST_CONTEXT(ctx)->BlendFunc = _mesa_mmx_blend_min; + if (cpu_has_mmx && chanType == GL_UNSIGNED_BYTE) { + swrast->BlendFunc = _mesa_mmx_blend_min; } else #endif - SWRAST_CONTEXT(ctx)->BlendFunc = blend_min; + swrast->BlendFunc = blend_min; } - else if (eq==GL_MAX) { + else if (eq == GL_MAX) { /* Note: GL_MAX ignores the blending weight factors */ #if defined(USE_MMX_ASM) - if ( cpu_has_mmx ) { - SWRAST_CONTEXT(ctx)->BlendFunc = _mesa_mmx_blend_max; + if (cpu_has_mmx && chanType == GL_UNSIGNED_BYTE) { + swrast->BlendFunc = _mesa_mmx_blend_max; } else #endif - SWRAST_CONTEXT(ctx)->BlendFunc = blend_max; + swrast->BlendFunc = blend_max; } else if (srcRGB != srcA || dstRGB != dstA) { - SWRAST_CONTEXT(ctx)->BlendFunc = blend_general; + swrast->BlendFunc = blend_general; } - else if (eq==GL_FUNC_ADD && srcRGB==GL_SRC_ALPHA - && dstRGB==GL_ONE_MINUS_SRC_ALPHA) { + else if (eq == GL_FUNC_ADD && srcRGB == GL_SRC_ALPHA + && dstRGB == GL_ONE_MINUS_SRC_ALPHA) { #if defined(USE_MMX_ASM) - if ( cpu_has_mmx ) { - SWRAST_CONTEXT(ctx)->BlendFunc = _mesa_mmx_blend_transparency; + if (cpu_has_mmx && chanType == GL_UNSIGNED_BYTE) { + swrast->BlendFunc = _mesa_mmx_blend_transparency; } else #endif - SWRAST_CONTEXT(ctx)->BlendFunc = blend_transparency; + { + if (chanType == GL_UNSIGNED_BYTE) + swrast->BlendFunc = blend_transparency_ubyte; + else if (chanType == GL_UNSIGNED_SHORT) + swrast->BlendFunc = blend_transparency_ushort; + else + swrast->BlendFunc = blend_transparency_float; + } } - else if (eq==GL_FUNC_ADD && srcRGB==GL_ONE && dstRGB==GL_ONE) { + else if (eq == GL_FUNC_ADD && srcRGB == GL_ONE && dstRGB == GL_ONE) { #if defined(USE_MMX_ASM) - if ( cpu_has_mmx ) { - SWRAST_CONTEXT(ctx)->BlendFunc = _mesa_mmx_blend_add; + if (cpu_has_mmx && chanType == GL_UNSIGNED_BYTE) { + swrast->BlendFunc = _mesa_mmx_blend_add; } else #endif - SWRAST_CONTEXT(ctx)->BlendFunc = blend_add; + swrast->BlendFunc = blend_add; } - else if (((eq==GL_FUNC_ADD || eq==GL_FUNC_REVERSE_SUBTRACT) - && (srcRGB==GL_ZERO && dstRGB==GL_SRC_COLOR)) + else if (((eq == GL_FUNC_ADD || eq == GL_FUNC_REVERSE_SUBTRACT) + && (srcRGB == GL_ZERO && dstRGB == GL_SRC_COLOR)) || - ((eq==GL_FUNC_ADD || eq==GL_FUNC_SUBTRACT) - && (srcRGB==GL_DST_COLOR && dstRGB==GL_ZERO))) { + ((eq == GL_FUNC_ADD || eq == GL_FUNC_SUBTRACT) + && (srcRGB == GL_DST_COLOR && dstRGB == GL_ZERO))) { #if defined(USE_MMX_ASM) - if ( cpu_has_mmx ) { - SWRAST_CONTEXT(ctx)->BlendFunc = _mesa_mmx_blend_modulate; + if (cpu_has_mmx && chanType == GL_UNSIGNED_BYTE) { + swrast->BlendFunc = _mesa_mmx_blend_modulate; } else #endif - SWRAST_CONTEXT(ctx)->BlendFunc = blend_modulate; + swrast->BlendFunc = blend_modulate; } - else if (eq==GL_FUNC_ADD && srcRGB == GL_ZERO && dstRGB == GL_ONE) { - SWRAST_CONTEXT(ctx)->BlendFunc = blend_noop; + else if (eq == GL_FUNC_ADD && srcRGB == GL_ZERO && dstRGB == GL_ONE) { + swrast->BlendFunc = blend_noop; } - else if (eq==GL_FUNC_ADD && srcRGB == GL_ONE && dstRGB == GL_ZERO) { - SWRAST_CONTEXT(ctx)->BlendFunc = blend_replace; + else if (eq == GL_FUNC_ADD && srcRGB == GL_ONE && dstRGB == GL_ZERO) { + swrast->BlendFunc = blend_replace; } else { - SWRAST_CONTEXT(ctx)->BlendFunc = blend_general; + swrast->BlendFunc = blend_general; } } -/* +/** * Apply the blending operator to a span of pixels. * We can handle horizontal runs of pixels (spans) or arrays of x/y * pixel coordinates. */ void -_swrast_blend_span(GLcontext *ctx, struct gl_renderbuffer *rb, - const struct sw_span *span, GLchan rgba[][4]) +_swrast_blend_span(GLcontext *ctx, struct gl_renderbuffer *rb, SWspan *span) { - GLchan framebuffer[MAX_WIDTH][4]; + SWcontext *swrast = SWRAST_CONTEXT(ctx); + void *rbPixels; ASSERT(span->end <= MAX_WIDTH); ASSERT(span->arrayMask & SPAN_RGBA); + ASSERT(rb->DataType == span->array->ChanType); ASSERT(!ctx->Color._LogicOpEnabled); - /* Read span of current frame buffer pixels */ - if (span->arrayMask & SPAN_XY) { - /* array of x/y pixel coords */ - _swrast_get_values(ctx, rb, span->end, span->array->x, span->array->y, - framebuffer, 4 * sizeof(GLchan)); - } - else { - /* horizontal run of pixels */ - _swrast_read_rgba_span(ctx, rb, span->end, span->x, span->y, - framebuffer); - } + rbPixels = _swrast_get_dest_rgba(ctx, rb, span); - SWRAST_CONTEXT(ctx)->BlendFunc( ctx, span->end, span->array->mask, rgba, - (const GLchan (*)[4]) framebuffer ); + swrast->BlendFunc(ctx, span->end, span->array->mask, + span->array->rgba, rbPixels, span->array->ChanType); } diff --git a/src/mesa/swrast/s_blend.h b/src/mesa/swrast/s_blend.h index c9519321521..0b8cbed1a01 100644 --- a/src/mesa/swrast/s_blend.h +++ b/src/mesa/swrast/s_blend.h @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.3 + * Version: 6.5.2 * - * Copyright (C) 1999-2005 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2006 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"), @@ -32,12 +32,11 @@ extern void -_swrast_blend_span(GLcontext *ctx, struct gl_renderbuffer *rb, - const struct sw_span *span, GLchan rgba[][4]); +_swrast_blend_span(GLcontext *ctx, struct gl_renderbuffer *rb, SWspan *span); extern void -_swrast_choose_blend_func(GLcontext *ctx); +_swrast_choose_blend_func(GLcontext *ctx, GLenum chanType); #endif diff --git a/src/mesa/swrast/s_buffers.c b/src/mesa/swrast/s_buffers.c index 57f23ee829b..284ea2b5178 100644 --- a/src/mesa/swrast/s_buffers.c +++ b/src/mesa/swrast/s_buffers.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.5 + * Version: 6.5.2 * - * Copyright (C) 1999-2005 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2006 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"), @@ -47,25 +47,53 @@ clear_rgba_buffer_with_masking(GLcontext *ctx, struct gl_renderbuffer *rb) const GLint y = ctx->DrawBuffer->_Ymin; const GLint height = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin; const GLint width = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin; - GLchan clearColor[4]; + SWspan span; GLint i; ASSERT(ctx->Visual.rgbMode); ASSERT(rb->PutRow); - CLAMPED_FLOAT_TO_CHAN(clearColor[RCOMP], ctx->Color.ClearColor[0]); - CLAMPED_FLOAT_TO_CHAN(clearColor[GCOMP], ctx->Color.ClearColor[1]); - CLAMPED_FLOAT_TO_CHAN(clearColor[BCOMP], ctx->Color.ClearColor[2]); - CLAMPED_FLOAT_TO_CHAN(clearColor[ACOMP], ctx->Color.ClearColor[3]); + /* Initialize color span with clear color */ + /* XXX optimize for clearcolor == black/zero (bzero) */ + INIT_SPAN(span, GL_BITMAP, width, 0, SPAN_RGBA); + span.array->ChanType = rb->DataType; + if (span.array->ChanType == GL_UNSIGNED_BYTE) { + GLubyte clearColor[4]; + UNCLAMPED_FLOAT_TO_UBYTE(clearColor[RCOMP], ctx->Color.ClearColor[0]); + UNCLAMPED_FLOAT_TO_UBYTE(clearColor[GCOMP], ctx->Color.ClearColor[1]); + UNCLAMPED_FLOAT_TO_UBYTE(clearColor[BCOMP], ctx->Color.ClearColor[2]); + UNCLAMPED_FLOAT_TO_UBYTE(clearColor[ACOMP], ctx->Color.ClearColor[3]); + for (i = 0; i < width; i++) { + COPY_4UBV(span.array->rgba[i], clearColor); + } + } + else if (span.array->ChanType == GL_UNSIGNED_SHORT) { + GLushort clearColor[4]; + UNCLAMPED_FLOAT_TO_USHORT(clearColor[RCOMP], ctx->Color.ClearColor[0]); + UNCLAMPED_FLOAT_TO_USHORT(clearColor[GCOMP], ctx->Color.ClearColor[1]); + UNCLAMPED_FLOAT_TO_USHORT(clearColor[BCOMP], ctx->Color.ClearColor[2]); + UNCLAMPED_FLOAT_TO_USHORT(clearColor[ACOMP], ctx->Color.ClearColor[3]); + for (i = 0; i < width; i++) { + COPY_4V(span.array->rgba[i], clearColor); + } + } + else { + ASSERT(span.array->ChanType == GL_FLOAT); + for (i = 0; i < width; i++) { + COPY_4V(span.array->rgba[i], ctx->Color.ClearColor); + } + } + /* Note that masking will change the color values, but only the + * channels for which the write mask is GL_FALSE. The channels + * which which are write-enabled won't get modified. + */ for (i = 0; i < height; i++) { - GLchan rgba[MAX_WIDTH][4]; - GLint j; - for (j = 0; j < width; j++) { - COPY_CHAN4(rgba[j], clearColor); - } - _swrast_mask_rgba_array( ctx, rb, width, x, y + i, rgba ); - rb->PutRow(ctx, rb, width, x, y + i, rgba, NULL); + span.x = x; + span.y = y + i; + _swrast_mask_rgba_span(ctx, rb, &span); + /* write masked row */ + rb->PutRow(ctx, rb, width, x, y + i, span.array->rgba, NULL); } } @@ -80,20 +108,29 @@ clear_ci_buffer_with_masking(GLcontext *ctx, struct gl_renderbuffer *rb) const GLint y = ctx->DrawBuffer->_Ymin; const GLint height = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin; const GLint width = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin; + SWspan span; GLint i; ASSERT(!ctx->Visual.rgbMode); ASSERT(rb->PutRow); ASSERT(rb->DataType == GL_UNSIGNED_INT); + /* Initialize index span with clear index */ + INIT_SPAN(span, GL_BITMAP, width, 0, SPAN_RGBA); + for (i = 0; i < width;i++) { + span.array->index[i] = ctx->Color.ClearIndex; + } + + /* Note that masking will change the color indexes, but only the + * bits for which the write mask is GL_FALSE. The bits + * which are write-enabled won't get modified. + */ for (i = 0; i < height;i++) { - GLuint span[MAX_WIDTH]; - GLint j; - for (j = 0; j < width;j++) { - span[j] = ctx->Color.ClearIndex; - } - _swrast_mask_ci_array(ctx, rb, width, x, y + i, span); - rb->PutRow(ctx, rb, width, x, y + i, span, NULL); + span.x = x; + span.y = y + i; + _swrast_mask_ci_span(ctx, rb, &span); + /* write masked row */ + rb->PutRow(ctx, rb, width, x, y + i, span.array->index, NULL); } } @@ -256,18 +293,15 @@ clear_color_buffers(GLcontext *ctx) /** * Called via the device driver's ctx->Driver.Clear() function if the * device driver can't clear one or more of the buffers itself. - * \param mask bitfield of BUFER_BIT_* values indicating which renderbuffers - * are to be cleared. + * \param buffers bitfield of BUFFER_BIT_* values indicating which + * renderbuffers are to be cleared. * \param all if GL_TRUE, clear whole buffer, else clear specified region. */ void -_swrast_Clear(GLcontext *ctx, GLbitfield mask, - GLboolean all, GLint x, GLint y, GLint width, GLint height) +_swrast_Clear(GLcontext *ctx, GLbitfield buffers) { SWcontext *swrast = SWRAST_CONTEXT(ctx); - (void) all; (void) x; (void) y; (void) width; (void) height; - #ifdef DEBUG_FOO { const GLbitfield legalBits = @@ -282,25 +316,25 @@ _swrast_Clear(GLcontext *ctx, GLbitfield mask, BUFFER_BIT_AUX1 | BUFFER_BIT_AUX2 | BUFFER_BIT_AUX3; - assert((mask & (~legalBits)) == 0); + assert((buffers & (~legalBits)) == 0); } #endif RENDER_START(swrast,ctx); /* do software clearing here */ - if (mask) { - if (mask & ctx->DrawBuffer->_ColorDrawBufferMask[0]) { + if (buffers) { + if (buffers & ctx->DrawBuffer->_ColorDrawBufferMask[0]) { clear_color_buffers(ctx); } - if (mask & BUFFER_BIT_DEPTH) { + if (buffers & BUFFER_BIT_DEPTH) { _swrast_clear_depth_buffer(ctx, ctx->DrawBuffer->_DepthBuffer); } - if (mask & BUFFER_BIT_ACCUM) { + if (buffers & BUFFER_BIT_ACCUM) { _swrast_clear_accum_buffer(ctx, ctx->DrawBuffer->Attachment[BUFFER_ACCUM].Renderbuffer); } - if (mask & BUFFER_BIT_STENCIL) { + if (buffers & BUFFER_BIT_STENCIL) { _swrast_clear_stencil_buffer(ctx, ctx->DrawBuffer->_StencilBuffer); } } diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c index a265d9e6cef..52d560ffdb6 100644 --- a/src/mesa/swrast/s_context.c +++ b/src/mesa/swrast/s_context.c @@ -98,7 +98,7 @@ _swrast_update_rasterflags( GLcontext *ctx ) rasterMask |= MULTI_DRAW_BIT; /* all color index bits disabled */ } - if (ctx->FragmentProgram._Active) { + if (ctx->FragmentProgram._Enabled) { rasterMask |= FRAGPROG_BIT; } @@ -199,14 +199,9 @@ _swrast_update_fog_state( GLcontext *ctx ) { SWcontext *swrast = SWRAST_CONTEXT(ctx); - /* convert fog color to GLchan values */ - CLAMPED_FLOAT_TO_CHAN(swrast->_FogColor[RCOMP], ctx->Fog.Color[RCOMP]); - CLAMPED_FLOAT_TO_CHAN(swrast->_FogColor[GCOMP], ctx->Fog.Color[GCOMP]); - CLAMPED_FLOAT_TO_CHAN(swrast->_FogColor[BCOMP], ctx->Fog.Color[BCOMP]); - /* determine if fog is needed, and if so, which fog mode */ swrast->_FogEnabled = GL_FALSE; - if (ctx->FragmentProgram._Active) { + if (ctx->FragmentProgram._Enabled) { if (ctx->FragmentProgram._Current->Base.Target==GL_FRAGMENT_PROGRAM_ARB) { const struct gl_fragment_program *fp = ctx->FragmentProgram._Current; @@ -228,11 +223,17 @@ _swrast_update_fog_state( GLcontext *ctx ) * program parameters with current state values. */ static void -_swrast_update_fragment_program( GLcontext *ctx ) +_swrast_update_fragment_program(GLcontext *ctx, GLbitfield newState) { - if (ctx->FragmentProgram._Active) { + if (ctx->FragmentProgram._Enabled) { const struct gl_fragment_program *fp = ctx->FragmentProgram._Current; - _mesa_load_state_parameters(ctx, fp->Base.Parameters); +#if 0 + /* XXX Need a way to trigger the initial loading of parameters + * even when there's no recent state changes. + */ + if (fp->Base.Parameters->StateFlags & newState) +#endif + _mesa_load_state_parameters(ctx, fp->Base.Parameters); } } @@ -296,10 +297,11 @@ _swrast_validate_triangle( GLcontext *ctx, _swrast_validate_derived( ctx ); swrast->choose_triangle( ctx ); + ASSERT(swrast->Triangle); if (ctx->Texture._EnabledUnits == 0 && NEED_SECONDARY_COLOR(ctx) - && !ctx->FragmentProgram._Active) { + && !ctx->FragmentProgram._Enabled) { /* separate specular color, but no texture */ swrast->SpecTriangle = swrast->Triangle; swrast->Triangle = _swrast_add_spec_terms_triangle; @@ -319,10 +321,11 @@ _swrast_validate_line( GLcontext *ctx, const SWvertex *v0, const SWvertex *v1 ) _swrast_validate_derived( ctx ); swrast->choose_line( ctx ); + ASSERT(swrast->Line); if (ctx->Texture._EnabledUnits == 0 && NEED_SECONDARY_COLOR(ctx) - && !ctx->FragmentProgram._Active) { + && !ctx->FragmentProgram._Enabled) { swrast->SpecLine = swrast->Line; swrast->Line = _swrast_add_spec_terms_line; } @@ -345,7 +348,7 @@ _swrast_validate_point( GLcontext *ctx, const SWvertex *v0 ) if (ctx->Texture._EnabledUnits == 0 && NEED_SECONDARY_COLOR(ctx) - && !ctx->FragmentProgram._Active) { + && !ctx->FragmentProgram._Enabled) { swrast->SpecPoint = swrast->Point; swrast->Point = _swrast_add_spec_terms_point; } @@ -359,17 +362,16 @@ _swrast_validate_point( GLcontext *ctx, const SWvertex *v0 ) * function, then call it. */ static void _ASMAPI -_swrast_validate_blend_func( GLcontext *ctx, GLuint n, - const GLubyte mask[], - GLchan src[][4], - CONST GLchan dst[][4] ) +_swrast_validate_blend_func(GLcontext *ctx, GLuint n, const GLubyte mask[], + GLvoid *src, const GLvoid *dst, + GLenum chanType ) { SWcontext *swrast = SWRAST_CONTEXT(ctx); - _swrast_validate_derived( ctx ); - _swrast_choose_blend_func( ctx ); + _swrast_validate_derived( ctx ); /* why is this needed? */ + _swrast_choose_blend_func( ctx, chanType ); - swrast->BlendFunc( ctx, n, mask, src, dst ); + swrast->BlendFunc( ctx, n, mask, src, dst, chanType ); } @@ -525,8 +527,18 @@ _swrast_validate_derived( GLcontext *ctx ) if (swrast->NewState & (_NEW_FOG | _NEW_PROGRAM)) _swrast_update_fog_state( ctx ); - if (swrast->NewState & _NEW_PROGRAM) - _swrast_update_fragment_program( ctx ); + if (swrast->NewState & (_NEW_MODELVIEW | + _NEW_PROJECTION | + _NEW_TEXTURE_MATRIX | + _NEW_FOG | + _NEW_LIGHT | + _NEW_LINE | + _NEW_TEXTURE | + _NEW_TRANSFORM | + _NEW_POINT | + _NEW_VIEWPORT | + _NEW_PROGRAM)) + _swrast_update_fragment_program( ctx, swrast->NewState ); if (swrast->NewState & _NEW_TEXTURE) _swrast_update_texture_samplers( ctx ); @@ -675,11 +687,22 @@ _swrast_CreateContext( GLcontext *ctx ) for (i = 0; i < MAX_TEXTURE_IMAGE_UNITS; i++) swrast->TextureSample[i] = NULL; - swrast->SpanArrays = MALLOC_STRUCT(span_arrays); + swrast->SpanArrays = MALLOC_STRUCT(sw_span_arrays); if (!swrast->SpanArrays) { FREE(swrast); return GL_FALSE; } + swrast->SpanArrays->ChanType = CHAN_TYPE; +#if CHAN_TYPE == GL_UNSIGNED_BYTE + swrast->SpanArrays->rgba = swrast->SpanArrays->color.sz1.rgba; + swrast->SpanArrays->spec = swrast->SpanArrays->color.sz1.spec; +#elif CHAN_TYPE == GL_UNSIGNED_SHORT + swrast->SpanArrays->rgba = swrast->SpanArrays->color.sz2.rgba; + swrast->SpanArrays->spec = swrast->SpanArrays->color.sz2.spec; +#else + swrast->SpanArrays->rgba = swrast->SpanArrays->color.sz4.rgba; + swrast->SpanArrays->spec = swrast->SpanArrays->color.sz4.spec; +#endif /* init point span buffer */ swrast->PointSpan.primitive = GL_POINT; diff --git a/src/mesa/swrast/s_context.h b/src/mesa/swrast/s_context.h index 3c5a4c32228..37d7081d4d6 100644 --- a/src/mesa/swrast/s_context.h +++ b/src/mesa/swrast/s_context.h @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.5 + * Version: 6.5.2 * * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. * @@ -49,7 +49,7 @@ /** * \defgroup SpanFlags SPAN_XXX-flags - * Bitmasks to indicate which span_arrays need to be computed + * Bitmasks to indicate which sw_span_arrays need to be computed * (sw_span::interpMask) or have already been filled in (sw_span::arrayMask) */ /*@{*/ @@ -69,21 +69,52 @@ #define SPAN_VARYING 0x2000 /*@}*/ +#if 0 +/* alternate arrangement for code below */ +struct arrays2 { + union { + GLubyte sz1[MAX_WIDTH][4]; /* primary color */ + GLushort sz2[MAX_WIDTH][4]; + GLfloat sz4[MAX_WIDTH][4]; + } rgba; + union { + GLubyte sz1[MAX_WIDTH][4]; /* specular color and temp storage */ + GLushort sz2[MAX_WIDTH][4]; + GLfloat sz4[MAX_WIDTH][4]; + } spec; +}; +#endif + /** - * \struct span_arrays + * \sw_span_arrays * \brief Arrays of fragment values. * * These will either be computed from the x/xStep values above or * filled in by glDraw/CopyPixels, etc. * These arrays are separated out of sw_span to conserve memory. */ -struct span_arrays { - /* XXX the next three fields could go into a union */ - GLchan rgb[MAX_WIDTH][3]; - GLchan rgba[MAX_WIDTH][4]; +typedef struct sw_span_arrays { + GLenum ChanType; /**< Color channel type, GL_UNSIGNED_BYTE, GL_FLOAT */ + union { + struct { + GLubyte rgba[MAX_WIDTH][4]; /**< primary color */ + GLubyte spec[MAX_WIDTH][4]; /**< specular color and temp storage */ + } sz1; + struct { + GLushort rgba[MAX_WIDTH][4]; + GLushort spec[MAX_WIDTH][4]; + } sz2; + struct { + GLfloat rgba[MAX_WIDTH][4]; + GLfloat spec[MAX_WIDTH][4]; + } sz4; + } color; + /** XXX these are temporary fields, pointing into above color arrays */ + GLchan (*rgba)[4]; + GLchan (*spec)[4]; + GLuint index[MAX_WIDTH]; - GLchan spec[MAX_WIDTH][4]; /* specular color */ GLint x[MAX_WIDTH]; /**< X/Y used for point/line rendering only */ GLint y[MAX_WIDTH]; /**< X/Y used for point/line rendering only */ GLuint z[MAX_WIDTH]; @@ -95,11 +126,11 @@ struct span_arrays { /** This mask indicates which fragments are alive or culled */ GLubyte mask[MAX_WIDTH]; -}; +} SWspanarrays; /** - * \struct sw_span + * \SWspan * \brief Contains data for either a horizontal line or a set of * pixels that are passed through a pipeline of functions before being * drawn. @@ -120,7 +151,7 @@ struct span_arrays { * stream of these structures which would be consumed by one or more * span-processing threads which could run in parallel. */ -struct sw_span { +typedef struct sw_span { GLint x, y; /** Only need to process pixels between start <= i < end */ @@ -197,8 +228,9 @@ struct sw_span { * a lot of memory. The span_arrays struct is about 400KB while the * sw_span struct is only about 512 bytes. */ - struct span_arrays *array; -}; + SWspanarrays *array; +} SWspan; + #define INIT_SPAN(S, PRIMITIVE, END, INTERP_MASK, ARRAY_MASK) \ @@ -220,7 +252,8 @@ typedef void (*texture_sample_func)(GLcontext *ctx, typedef void (_ASMAPIP blend_func)( GLcontext *ctx, GLuint n, const GLubyte mask[], - GLchan src[][4], CONST GLchan dst[][4] ); + GLvoid *src, const GLvoid *dst, + GLenum chanType); typedef void (*swrast_point_func)( GLcontext *ctx, const SWvertex *); @@ -272,7 +305,7 @@ typedef void (*validate_texture_image_func)(GLcontext *ctx, /** * \struct SWcontext - * \brief SWContext? + * \brief Per-context state that's private to the software rasterizer module. */ typedef struct { @@ -293,7 +326,6 @@ typedef struct GLfloat _BackfaceSign; GLboolean _PreferPixelFog; /* Compute fog blend factor per fragment? */ GLboolean _AnyTextureCombine; - GLchan _FogColor[3]; GLboolean _FogEnabled; GLenum _FogMode; /* either GL_FOG_MODE or fragment program's fog mode */ @@ -356,12 +388,12 @@ typedef struct * this object is big and causes problems when allocated on the stack * on some systems. */ - struct span_arrays *SpanArrays; + SWspanarrays *SpanArrays; /** * Used to buffer N GL_POINTS, instead of rendering one by one. */ - struct sw_span PointSpan; + SWspan PointSpan; /** Internal hooks, kept up to date by the same mechanism as above. */ @@ -400,6 +432,16 @@ _swrast_validate_derived( GLcontext *ctx ); +/** + * Size of an RGBA pixel, in bytes, for given datatype. + */ +#define RGBA_PIXEL_SIZE(TYPE) \ + ((TYPE == GL_UNSIGNED_BYTE) ? 4 * sizeof(GLubyte) : \ + ((TYPE == GL_UNSIGNED_SHORT) ? 4 * sizeof(GLushort) \ + : 4 * sizeof(GLfloat))) + + + /* * XXX these macros are just bandages for now in order to make * CHAN_BITS==32 compile cleanly. diff --git a/src/mesa/swrast/s_copypix.c b/src/mesa/swrast/s_copypix.c index 88fd445132b..761ab724e91 100644 --- a/src/mesa/swrast/s_copypix.c +++ b/src/mesa/swrast/s_copypix.c @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.5.1 + * Version: 6.5.2 * * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. * @@ -41,11 +41,12 @@ -/* +/** * Determine if there's overlap in an image copy. * This test also compensates for the fact that copies are done from * bottom to top and overlaps can sometimes be handled correctly * without making a temporary image copy. + * \return GL_TRUE if the regions overlap, GL_FALSE otherwise. */ static GLboolean regions_overlap(GLint srcx, GLint srcy, @@ -87,41 +88,6 @@ regions_overlap(GLint srcx, GLint srcy, /** - * Convert GLfloat[n][4] colors to GLchan[n][4]. - * XXX maybe move into image.c - */ -static void -float_span_to_chan(GLuint n, CONST GLfloat in[][4], GLchan out[][4]) -{ - GLuint i; - for (i = 0; i < n; i++) { - UNCLAMPED_FLOAT_TO_CHAN(out[i][RCOMP], in[i][RCOMP]); - UNCLAMPED_FLOAT_TO_CHAN(out[i][GCOMP], in[i][GCOMP]); - UNCLAMPED_FLOAT_TO_CHAN(out[i][BCOMP], in[i][BCOMP]); - UNCLAMPED_FLOAT_TO_CHAN(out[i][ACOMP], in[i][ACOMP]); - } -} - - -/** - * Convert GLchan[n][4] colors to GLfloat[n][4]. - * XXX maybe move into image.c - */ -static void -chan_span_to_float(GLuint n, CONST GLchan in[][4], GLfloat out[][4]) -{ - GLuint i; - for (i = 0; i < n; i++) { - out[i][RCOMP] = CHAN_TO_FLOAT(in[i][RCOMP]); - out[i][GCOMP] = CHAN_TO_FLOAT(in[i][GCOMP]); - out[i][BCOMP] = CHAN_TO_FLOAT(in[i][BCOMP]); - out[i][ACOMP] = CHAN_TO_FLOAT(in[i][ACOMP]); - } -} - - - -/* * RGBA copypixels with convolution. */ static void @@ -129,13 +95,13 @@ copy_conv_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, GLint width, GLint height, GLint destx, GLint desty) { SWcontext *swrast = SWRAST_CONTEXT(ctx); - struct gl_renderbuffer *drawRb = NULL; - GLboolean quick_draw; GLint row; const GLboolean zoom = ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F; - const GLuint transferOps = ctx->_ImageTransferState; + const GLbitfield transferOps = ctx->_ImageTransferState; + const GLboolean sink = (ctx->Pixel.MinMaxEnabled && ctx->MinMax.Sink) + || (ctx->Pixel.HistogramEnabled && ctx->Histogram.Sink); GLfloat *dest, *tmpImage, *convImage; - struct sw_span span; + SWspan span; INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_RGBA); @@ -145,17 +111,6 @@ copy_conv_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, _swrast_span_default_fog(ctx, &span); - if (SWRAST_CONTEXT(ctx)->_RasterMask == 0 - && !zoom - && destx >= 0 - && destx + width <= (GLint) ctx->DrawBuffer->Width) { - quick_draw = GL_TRUE; - drawRb = ctx->DrawBuffer->_ColorDrawBuffers[0][0]; - } - else { - quick_draw = GL_FALSE; - } - /* allocate space for GLfloat image */ tmpImage = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat)); if (!tmpImage) { @@ -169,15 +124,11 @@ copy_conv_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, return; } - /* read source image */ + /* read source image as float/RGBA */ dest = tmpImage; for (row = 0; row < height; row++) { - GLchan rgba[MAX_WIDTH][4]; - /* Read GLchan and convert to GLfloat */ _swrast_read_rgba_span(ctx, ctx->ReadBuffer->_ColorReadBuffer, - width, srcx, srcy + row, rgba); - chan_span_to_float(width, (CONST GLchan (*)[4]) rgba, - (GLfloat (*)[4]) dest); + width, srcx, srcy + row, GL_FLOAT, dest); dest += 4 * width; } @@ -207,38 +158,36 @@ copy_conv_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, width, rgba); } - /* write the new image */ - for (row = 0; row < height; row++) { - const GLfloat *src = convImage + row * width * 4; - GLint dy; + if (!sink) { + /* write the new image */ + for (row = 0; row < height; row++) { + const GLfloat *src = convImage + row * width * 4; + GLvoid *rgba = span.array->color.sz1.rgba; /* row storage */ - /* convert floats back to chan */ - float_span_to_chan(width, (const GLfloat (*)[4]) src, span.array->rgba); + /* copy convolved colors into span array */ + _mesa_memcpy(rgba, src, width * 4 * sizeof(GLfloat)); - /* write row to framebuffer */ - dy = desty + row; - if (quick_draw && dy >= 0 && dy < (GLint) ctx->DrawBuffer->Height) { - drawRb->PutRow(ctx, drawRb, width, destx, dy, span.array->rgba, NULL); - } - else { + /* write span */ span.x = destx; - span.y = dy; + span.y = desty + row; span.end = width; + span.array->ChanType = GL_FLOAT; if (zoom) { - _swrast_write_zoomed_rgba_span(ctx, destx, desty, &span, - (CONST GLchan (*)[4])span.array->rgba); + _swrast_write_zoomed_rgba_span(ctx, destx, desty, &span, rgba); } else { _swrast_write_rgba_span(ctx, &span); } } + /* restore this */ + span.array->ChanType = CHAN_TYPE; } _mesa_free(convImage); } -/* +/** * RGBA copypixels */ static void @@ -246,22 +195,18 @@ copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, GLint width, GLint height, GLint destx, GLint desty) { SWcontext *swrast = SWRAST_CONTEXT(ctx); - struct gl_renderbuffer *drawRb; - GLchan *tmpImage,*p; - GLboolean quick_draw; - GLint sy, dy, stepy, j; + GLfloat *tmpImage, *p; + GLint sy, dy, stepy, row; const GLboolean zoom = ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F; GLint overlapping; const GLuint transferOps = ctx->_ImageTransferState; - struct sw_span span; + SWspan span; if (!ctx->ReadBuffer->_ColorReadBuffer) { /* no readbuffer - OK */ return; } - INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_RGBA); - if (ctx->Pixel.Convolution2DEnabled || ctx->Pixel.Separable2DEnabled) { copy_conv_rgba_pixels(ctx, srcx, srcy, width, height, destx, desty); return; @@ -289,35 +234,23 @@ copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, overlapping = GL_FALSE; } + INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_RGBA); if (ctx->Depth.Test) _swrast_span_default_z(ctx, &span); if (swrast->_FogEnabled) _swrast_span_default_fog(ctx, &span); - if (SWRAST_CONTEXT(ctx)->_RasterMask == 0 - && !zoom - && destx >= 0 - && destx + width <= (GLint) ctx->DrawBuffer->Width) { - quick_draw = GL_TRUE; - drawRb = ctx->DrawBuffer->_ColorDrawBuffers[0][0]; - } - else { - quick_draw = GL_FALSE; - drawRb = NULL; - } - if (overlapping) { - GLint ssy = sy; - tmpImage = (GLchan *) _mesa_malloc(width * height * sizeof(GLchan) * 4); + tmpImage = (GLfloat *) _mesa_malloc(width * height * sizeof(GLfloat) * 4); if (!tmpImage) { _mesa_error( ctx, GL_OUT_OF_MEMORY, "glCopyPixels" ); return; } - /* read the source image */ + /* read the source image as RGBA/float */ p = tmpImage; - for (j = 0; j < height; j++, ssy += stepy) { + for (row = 0; row < height; row++) { _swrast_read_rgba_span( ctx, ctx->ReadBuffer->_ColorReadBuffer, - width, srcx, ssy, (GLchan (*)[4]) p ); + width, srcx, sy + row, GL_FLOAT, p ); p += width * 4; } p = tmpImage; @@ -327,49 +260,43 @@ copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, p = NULL; } - for (j = 0; j < height; j++, sy += stepy, dy += stepy) { - /* Get source pixels */ + ASSERT(width < MAX_WIDTH); + + for (row = 0; row < height; row++, sy += stepy, dy += stepy) { + GLvoid *rgba = span.array->color.sz4.rgba; + + /* Get row/span of source pixels */ if (overlapping) { /* get from buffered image */ - ASSERT(width < MAX_WIDTH); - _mesa_memcpy(span.array->rgba, p, width * sizeof(GLchan) * 4); + _mesa_memcpy(rgba, p, width * sizeof(GLfloat) * 4); p += width * 4; } else { /* get from framebuffer */ - ASSERT(width < MAX_WIDTH); _swrast_read_rgba_span( ctx, ctx->ReadBuffer->_ColorReadBuffer, - width, srcx, sy, span.array->rgba ); + width, srcx, sy, GL_FLOAT, rgba ); } if (transferOps) { - GLfloat rgbaFloat[MAX_WIDTH][4]; - /* convert to float, transfer, convert back to chan */ - chan_span_to_float(width, (CONST GLchan (*)[4]) span.array->rgba, - rgbaFloat); - _mesa_apply_rgba_transfer_ops(ctx, transferOps, width, rgbaFloat); - float_span_to_chan(width, (CONST GLfloat (*)[4]) rgbaFloat, - span.array->rgba); + _mesa_apply_rgba_transfer_ops(ctx, transferOps, width, + (GLfloat (*)[4]) rgba); } /* Write color span */ - if (quick_draw && dy >= 0 && dy < (GLint) ctx->DrawBuffer->Height) { - drawRb->PutRow(ctx, drawRb, width, destx, dy, span.array->rgba, NULL); + span.x = destx; + span.y = dy; + span.end = width; + span.array->ChanType = GL_FLOAT; + if (zoom) { + _swrast_write_zoomed_rgba_span(ctx, destx, desty, &span, rgba); } else { - span.x = destx; - span.y = dy; - span.end = width; - if (zoom) { - _swrast_write_zoomed_rgba_span(ctx, destx, desty, &span, - (CONST GLchan (*)[4]) span.array->rgba); - } - else { - _swrast_write_rgba_span(ctx, &span); - } + _swrast_write_rgba_span(ctx, &span); } } + span.array->ChanType = CHAN_TYPE; /* restore */ + if (overlapping) _mesa_free(tmpImage); } @@ -385,9 +312,8 @@ copy_ci_pixels( GLcontext *ctx, GLint srcx, GLint srcy, GLint sy, dy, stepy; GLint j; const GLboolean zoom = ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F; - const GLboolean shift_or_offset = ctx->Pixel.IndexShift || ctx->Pixel.IndexOffset; GLint overlapping; - struct sw_span span; + SWspan span; if (!ctx->ReadBuffer->_ColorReadBuffer) { /* no readbuffer - OK */ @@ -455,13 +381,9 @@ copy_ci_pixels( GLcontext *ctx, GLint srcx, GLint srcy, width, srcx, sy, span.array->index ); } - /* Apply shift, offset, look-up table */ - if (shift_or_offset) { - _mesa_shift_and_offset_ci( ctx, width, span.array->index ); - } - if (ctx->Pixel.MapColorFlag) { - _mesa_map_ci( ctx, width, span.array->index ); - } + if (ctx->_ImageTransferState) + _mesa_apply_ci_transfer_ops(ctx, ctx->_ImageTransferState, + width, span.array->index); /* write color indexes */ span.x = destx; @@ -530,7 +452,7 @@ copy_depth_pixels( GLcontext *ctx, GLint srcx, GLint srcy, GLint j; const GLboolean zoom = ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F; GLint overlapping; - struct sw_span span; + SWspan span; if (!readRb) { /* no readbuffer - OK */ @@ -605,7 +527,7 @@ copy_depth_pixels( GLcontext *ctx, GLint srcx, GLint srcy, if (fb->Visual.rgbMode) { if (zoom) _swrast_write_zoomed_rgba_span(ctx, destx, desty, &span, - (const GLchan (*)[4]) span.array->rgba); + span.array->rgba); else _swrast_write_rgba_span(ctx, &span); } @@ -634,7 +556,6 @@ copy_stencil_pixels( GLcontext *ctx, GLint srcx, GLint srcy, GLint j; GLstencil *p, *tmpImage; const GLboolean zoom = ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F; - const GLboolean shift_or_offset = ctx->Pixel.IndexShift || ctx->Pixel.IndexOffset; GLint overlapping; if (!rb) { @@ -695,13 +616,7 @@ copy_stencil_pixels( GLcontext *ctx, GLint srcx, GLint srcy, _swrast_read_stencil_span( ctx, rb, width, srcx, sy, stencil ); } - /* Apply shift, offset, look-up table */ - if (shift_or_offset) { - _mesa_shift_and_offset_stencil( ctx, width, stencil ); - } - if (ctx->Pixel.MapStencilFlag) { - _mesa_map_stencil( ctx, width, stencil ); - } + _mesa_apply_stencil_transfer_ops(ctx, width, stencil); /* Write stencil values */ if (zoom) { @@ -737,8 +652,6 @@ copy_depth_stencil_pixels(GLcontext *ctx, const GLfloat depthScale = ctx->DrawBuffer->_DepthMaxF; const GLuint stencilMask = ctx->Stencil.WriteMask[0]; const GLboolean zoom = ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F; - const GLboolean shiftOrOffset - = ctx->Pixel.IndexShift || ctx->Pixel.IndexOffset; const GLboolean scaleOrBias = ctx->Pixel.DepthScale != 1.0 || ctx->Pixel.DepthBias != 0.0; GLint overlapping; @@ -828,13 +741,7 @@ copy_depth_stencil_pixels(GLcontext *ctx, width, srcX, sy, stencil); } - /* Apply shift, offset, look-up table */ - if (shiftOrOffset) { - _mesa_shift_and_offset_stencil(ctx, width, stencil); - } - if (ctx->Pixel.MapStencilFlag) { - _mesa_map_stencil(ctx, width, stencil); - } + _mesa_apply_stencil_transfer_ops(ctx, width, stencil); /* Write values */ if (zoom) { @@ -902,6 +809,88 @@ copy_depth_stencil_pixels(GLcontext *ctx, } + +/** + * Try to do a fast copy pixels. + */ +static GLboolean +fast_copy_pixels(GLcontext *ctx, + GLint srcX, GLint srcY, GLsizei width, GLsizei height, + GLint dstX, GLint dstY, GLenum type) +{ + struct gl_framebuffer *srcFb = ctx->ReadBuffer; + struct gl_framebuffer *dstFb = ctx->DrawBuffer; + struct gl_renderbuffer *srcRb, *dstRb; + GLint row, yStep; + + if (SWRAST_CONTEXT(ctx)->_RasterMask != 0x0 || + ctx->Pixel.ZoomX != 1.0F || + ctx->Pixel.ZoomY != 1.0F || + ctx->_ImageTransferState) { + /* can't handle these */ + return GL_FALSE; + } + + if (type == GL_COLOR) { + if (dstFb->_NumColorDrawBuffers[0] != 1) + return GL_FALSE; + srcRb = srcFb->_ColorReadBuffer; + dstRb = dstFb->_ColorDrawBuffers[0][0]; + } + else if (type == GL_STENCIL) { + srcRb = srcFb->_StencilBuffer; + dstRb = dstFb->_StencilBuffer; + } + else if (type == GL_DEPTH) { + srcRb = srcFb->_DepthBuffer; + dstRb = dstFb->_DepthBuffer; + } + else { + ASSERT(type == GL_DEPTH_STENCIL_EXT); + /* XXX correct? */ + srcRb = srcFb->Attachment[BUFFER_DEPTH].Renderbuffer; + dstRb = dstFb->Attachment[BUFFER_DEPTH].Renderbuffer; + } + + /* src and dst renderbuffers must be same format and type */ + if (!srcRb || !dstRb || + srcRb->DataType != dstRb->DataType || + srcRb->_BaseFormat != dstRb->_BaseFormat) { + return GL_FALSE; + } + + /* clipping not supported */ + if (srcX < 0 || srcX + width > srcFb->Width || + srcY < 0 || srcY + height > srcFb->Height || + dstX < dstFb->_Xmin || dstX + width > dstFb->_Xmax || + dstY < dstFb->_Ymin || dstY + height > dstFb->_Ymax) { + return GL_FALSE; + } + + /* overlapping src/dst doesn't matter, just determine Y direction */ + if (srcY < dstY) { + /* top-down max-to-min */ + srcY = srcY + height - 1; + dstY = dstY + height - 1; + yStep = -1; + } + else { + /* bottom-up min-to-max */ + yStep = 1; + } + + for (row = 0; row < height; row++) { + GLuint temp[MAX_WIDTH][4]; + srcRb->GetRow(ctx, srcRb, width, srcX, srcY, temp); + dstRb->PutRow(ctx, dstRb, width, dstX, dstY, temp, NULL); + srcY += yStep; + dstY += yStep; + } + + return GL_TRUE; +} + + /** * Do software-based glCopyPixels. * By time we get here, all parameters will have been error-checked. @@ -917,26 +906,28 @@ _swrast_CopyPixels( GLcontext *ctx, if (swrast->NewState) _swrast_validate_derived( ctx ); - switch (type) { - case GL_COLOR: - if (ctx->Visual.rgbMode) { - copy_rgba_pixels( ctx, srcx, srcy, width, height, destx, desty ); + if (!fast_copy_pixels(ctx, srcx, srcy, width, height, destx, desty, type)) { + switch (type) { + case GL_COLOR: + if (ctx->Visual.rgbMode) { + copy_rgba_pixels( ctx, srcx, srcy, width, height, destx, desty ); + } + else { + copy_ci_pixels( ctx, srcx, srcy, width, height, destx, desty ); + } + break; + case GL_DEPTH: + copy_depth_pixels( ctx, srcx, srcy, width, height, destx, desty ); + break; + case GL_STENCIL: + copy_stencil_pixels( ctx, srcx, srcy, width, height, destx, desty ); + break; + case GL_DEPTH_STENCIL_EXT: + copy_depth_stencil_pixels(ctx, srcx, srcy, width, height, destx, desty); + break; + default: + _mesa_problem(ctx, "unexpected type in _swrast_CopyPixels"); } - else { - copy_ci_pixels( ctx, srcx, srcy, width, height, destx, desty ); - } - break; - case GL_DEPTH: - copy_depth_pixels( ctx, srcx, srcy, width, height, destx, desty ); - break; - case GL_STENCIL: - copy_stencil_pixels( ctx, srcx, srcy, width, height, destx, desty ); - break; - case GL_DEPTH_STENCIL_EXT: - copy_depth_stencil_pixels(ctx, srcx, srcy, width, height, destx, desty); - break; - default: - _mesa_problem(ctx, "unexpected type in _swrast_CopyPixels"); } RENDER_FINISH(swrast,ctx); diff --git a/src/mesa/swrast/s_depth.c b/src/mesa/swrast/s_depth.c index 1001cea3524..cb584b5de8f 100644 --- a/src/mesa/swrast/s_depth.c +++ b/src/mesa/swrast/s_depth.c @@ -503,7 +503,7 @@ depth_test_span32( GLcontext *ctx, GLuint n, * Apply depth test to span of fragments. */ static GLuint -depth_test_span( GLcontext *ctx, struct sw_span *span) +depth_test_span( GLcontext *ctx, SWspan *span) { struct gl_framebuffer *fb = ctx->DrawBuffer; struct gl_renderbuffer *rb = fb->_DepthBuffer; @@ -1051,7 +1051,7 @@ direct_depth_test_pixels32(GLcontext *ctx, GLuint *zStart, GLuint stride, static GLuint -depth_test_pixels( GLcontext *ctx, struct sw_span *span ) +depth_test_pixels( GLcontext *ctx, SWspan *span ) { struct gl_framebuffer *fb = ctx->DrawBuffer; struct gl_renderbuffer *rb = fb->_DepthBuffer; @@ -1101,7 +1101,7 @@ depth_test_pixels( GLcontext *ctx, struct sw_span *span ) * \return approx number of pixels that passed (only zero is reliable) */ GLuint -_swrast_depth_test_span( GLcontext *ctx, struct sw_span *span) +_swrast_depth_test_span( GLcontext *ctx, SWspan *span) { if (span->arrayMask & SPAN_XY) return depth_test_pixels(ctx, span); @@ -1118,7 +1118,7 @@ _swrast_depth_test_span( GLcontext *ctx, struct sw_span *span) * \return GL_TRUE if any fragments pass, GL_FALSE if no fragments pass */ GLboolean -_swrast_depth_bounds_test( GLcontext *ctx, struct sw_span *span ) +_swrast_depth_bounds_test( GLcontext *ctx, SWspan *span ) { struct gl_framebuffer *fb = ctx->DrawBuffer; struct gl_renderbuffer *rb = fb->_DepthBuffer; diff --git a/src/mesa/swrast/s_depth.h b/src/mesa/swrast/s_depth.h index f93d95fa3d2..d1ed050efd6 100644 --- a/src/mesa/swrast/s_depth.h +++ b/src/mesa/swrast/s_depth.h @@ -32,11 +32,11 @@ extern GLuint -_swrast_depth_test_span( GLcontext *ctx, struct sw_span *span); +_swrast_depth_test_span( GLcontext *ctx, SWspan *span); extern GLboolean -_swrast_depth_bounds_test( GLcontext *ctx, struct sw_span *span ); +_swrast_depth_bounds_test( GLcontext *ctx, SWspan *span ); extern void diff --git a/src/mesa/swrast/s_drawpix.c b/src/mesa/swrast/s_drawpix.c index cfe516733f1..bdb25583515 100644 --- a/src/mesa/swrast/s_drawpix.c +++ b/src/mesa/swrast/s_drawpix.c @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.5.1 + * Version: 6.5.2 * * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. * @@ -40,32 +40,37 @@ #include "s_zoom.h" -/* + +/** * Try to do a fast and simple RGB(a) glDrawPixels. * Return: GL_TRUE if success, GL_FALSE if slow path must be used instead */ static GLboolean -fast_draw_pixels(GLcontext *ctx, GLint x, GLint y, - GLsizei width, GLsizei height, - GLenum format, GLenum type, - const struct gl_pixelstore_attrib *unpack, - const GLvoid *pixels) +fast_draw_rgba_pixels(GLcontext *ctx, GLint x, GLint y, + GLsizei width, GLsizei height, + GLenum format, GLenum type, + const struct gl_pixelstore_attrib *userUnpack, + const GLvoid *pixels) { const GLint imgX = x, imgY = y; struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[0][0]; + const GLenum rbType = rb->DataType; SWcontext *swrast = SWRAST_CONTEXT(ctx); - struct sw_span span; - - INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_RGBA); - - if (swrast->_RasterMask & MULTI_DRAW_BIT) - return GL_FALSE; - - if (ctx->_ImageTransferState) { - /* don't handle any pixel transfer options here */ + SWspan span; + GLboolean simpleZoom; + GLint yStep; /* +1 or -1 */ + struct gl_pixelstore_attrib unpack; + GLint destX, destY, drawWidth, drawHeight; /* post clipping */ + + if ((swrast->_RasterMask & ~CLIP_BIT) || + ctx->Texture._EnabledCoordUnits || + userUnpack->SwapBytes || + ctx->_ImageTransferState) { + /* can't handle any of those conditions */ return GL_FALSE; } + INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_RGBA); if (ctx->Depth.Test) _swrast_span_default_z(ctx, &span); if (swrast->_FogEnabled) @@ -73,372 +78,243 @@ fast_draw_pixels(GLcontext *ctx, GLint x, GLint y, if (ctx->Texture._EnabledCoordUnits) _swrast_span_default_texcoords(ctx, &span); - if ((swrast->_RasterMask & ~CLIP_BIT) == 0 - && ctx->Texture._EnabledCoordUnits == 0 - && unpack->Alignment == 1 /* XXX may not really need this */ - && !unpack->SwapBytes - && !unpack->LsbFirst) { - - /* XXX there's a lot of clipping code here that should be replaced - * by a call to _mesa_clip_drawpixels(). - */ - GLint destX = x; - GLint destY = y; - GLint drawWidth = width; /* actual width drawn */ - GLint drawHeight = height; /* actual height drawn */ - GLint skipPixels = unpack->SkipPixels; - GLint skipRows = unpack->SkipRows; - GLint rowLength; - - if (unpack->RowLength > 0) - rowLength = unpack->RowLength; - else - rowLength = width; + /* copy input params since clipping may change them */ + unpack = *userUnpack; + destX = x; + destY = y; + drawWidth = width; + drawHeight = height; + + /* check for simple zooming and clipping */ + if (ctx->Pixel.ZoomX == 1.0F && + (ctx->Pixel.ZoomY == 1.0F || ctx->Pixel.ZoomY == -1.0F)) { + if (!_mesa_clip_drawpixels(ctx, &destX, &destY, + &drawWidth, &drawHeight, &unpack)) { + /* image was completely clipped: no-op, all done */ + return GL_TRUE; + } + simpleZoom = GL_TRUE; + yStep = (GLint) ctx->Pixel.ZoomY; + ASSERT(yStep == 1 || yStep == -1); + } + else { + /* non-simple zooming */ + simpleZoom = GL_FALSE; + yStep = 1; + if (unpack.RowLength == 0) + unpack.RowLength = width; + } - /* If we're not using pixel zoom then do all clipping calculations - * now. Otherwise, we'll let the _swrast_write_zoomed_*_span() functions - * handle the clipping. - */ - if (ctx->Pixel.ZoomX==1.0F && ctx->Pixel.ZoomY==1.0F) { - /* horizontal clipping */ - if (destX < ctx->DrawBuffer->_Xmin) { - skipPixels += (ctx->DrawBuffer->_Xmin - destX); - drawWidth -= (ctx->DrawBuffer->_Xmin - destX); - destX = ctx->DrawBuffer->_Xmin; - } - if (destX + drawWidth > ctx->DrawBuffer->_Xmax) - drawWidth -= (destX + drawWidth - ctx->DrawBuffer->_Xmax); - if (drawWidth <= 0) - return GL_TRUE; + /* + * Ready to draw! + */ - /* vertical clipping */ - if (destY < ctx->DrawBuffer->_Ymin) { - skipRows += (ctx->DrawBuffer->_Ymin - destY); - drawHeight -= (ctx->DrawBuffer->_Ymin - destY); - destY = ctx->DrawBuffer->_Ymin; + if (format == GL_RGBA && type == rbType) { + const GLubyte *src = _mesa_image_address2d(&unpack, pixels, width, + height, format, type, 0, 0); + const GLint srcStride = _mesa_image_row_stride(&unpack, width, + format, type); + if (simpleZoom) { + GLint row; + for (row = 0; row < drawHeight; row++) { + rb->PutRow(ctx, rb, drawWidth, destX, destY, src, NULL); + src += srcStride; + destY += yStep; } - if (destY + drawHeight > ctx->DrawBuffer->_Ymax) - drawHeight -= (destY + drawHeight - ctx->DrawBuffer->_Ymax); - if (drawHeight <= 0) - return GL_TRUE; } - else if (ctx->Pixel.ZoomX==1.0F && ctx->Pixel.ZoomY==-1.0F) { - /* upside-down image */ - /* horizontal clipping */ - if (destX < ctx->DrawBuffer->_Xmin) { - skipPixels += (ctx->DrawBuffer->_Xmin - destX); - drawWidth -= (ctx->DrawBuffer->_Xmin - destX); - destX = ctx->DrawBuffer->_Xmin; + else { + /* with zooming */ + GLint row; + for (row = 0; row < drawHeight; row++) { + span.x = destX; + span.y = destY + row; + span.end = drawWidth; + span.array->ChanType = rbType; + _swrast_write_zoomed_rgba_span(ctx, imgX, imgY, &span, src); + src += srcStride; } - if (destX + drawWidth > ctx->DrawBuffer->_Xmax) - drawWidth -= (destX + drawWidth - ctx->DrawBuffer->_Xmax); - if (drawWidth <= 0) - return GL_TRUE; + span.array->ChanType = CHAN_TYPE; + } + return GL_TRUE; + } - /* vertical clipping */ - if (destY > ctx->DrawBuffer->_Ymax) { - skipRows += (destY - ctx->DrawBuffer->_Ymax); - drawHeight -= (destY - ctx->DrawBuffer->_Ymax); - destY = ctx->DrawBuffer->_Ymax; + if (format == GL_RGB && type == rbType) { + const GLubyte *src = _mesa_image_address2d(&unpack, pixels, width, + height, format, type, 0, 0); + const GLint srcStride = _mesa_image_row_stride(&unpack, width, + format, type); + if (simpleZoom) { + GLint row; + for (row = 0; row < drawHeight; row++) { + rb->PutRowRGB(ctx, rb, drawWidth, destX, destY, src, NULL); + src += srcStride; + destY += yStep; } - if (destY - drawHeight < ctx->DrawBuffer->_Ymin) - drawHeight -= (ctx->DrawBuffer->_Ymin - (destY - drawHeight)); - if (drawHeight <= 0) - return GL_TRUE; } else { - if (drawWidth > MAX_WIDTH) - return GL_FALSE; /* fall back to general case path */ + /* with zooming */ + GLint row; + for (row = 0; row < drawHeight; row++) { + span.x = destX; + span.y = destY; + span.end = drawWidth; + span.array->ChanType = rbType; + _swrast_write_zoomed_rgb_span(ctx, imgX, imgY, &span, src); + src += srcStride; + destY++; + } + span.array->ChanType = CHAN_TYPE; } + return GL_TRUE; + } + /* Remaining cases haven't been tested with alignment != 1 */ + if (userUnpack->Alignment != 1) + return GL_FALSE; - /* - * Ready to draw! - * The window region at (destX, destY) of size (drawWidth, drawHeight) - * will be written to. - * We'll take pixel data from buffer pointed to by "pixels" but we'll - * skip "skipRows" rows and skip "skipPixels" pixels/row. - */ - - if (format == GL_RGBA && type == CHAN_TYPE) { - if (ctx->Visual.rgbMode) { - const GLchan *src = (const GLchan *) pixels - + (skipRows * rowLength + skipPixels) * 4; - if (ctx->Pixel.ZoomX==1.0F && ctx->Pixel.ZoomY==1.0F) { - /* no zooming */ - GLint row; - for (row=0; rowPutRow(ctx, rb, drawWidth, destX, destY, src, NULL); - src += rowLength * 4; - destY++; - } - } - else if (ctx->Pixel.ZoomX==1.0F && ctx->Pixel.ZoomY==-1.0F) { - /* upside-down */ - GLint row; - for (row=0; rowPutRow(ctx, rb, drawWidth, destX, destY, src, NULL); - src += rowLength * 4; - } - } - else { - /* with zooming */ - GLint row; - for (row=0; rowPutRowRGB(ctx, rb, drawWidth, destX, destY, rgb, NULL); + src += unpack.RowLength; + destY += yStep; } - return GL_TRUE; } - else if (format == GL_RGB && type == CHAN_TYPE) { - if (ctx->Visual.rgbMode) { - const GLchan *src = (const GLchan *) pixels - + (skipRows * rowLength + skipPixels) * 3; - if (ctx->Pixel.ZoomX==1.0F && ctx->Pixel.ZoomY==1.0F) { - GLint row; - for (row=0; rowPutRowRGB(ctx, rb, drawWidth, destX, destY, src, NULL); - src += rowLength * 3; - destY++; - } - } - else if (ctx->Pixel.ZoomX==1.0F && ctx->Pixel.ZoomY==-1.0F) { - /* upside-down */ - GLint row; - for (row=0; rowPutRowRGB(ctx, rb, drawWidth, destX, destY, src, NULL); - src += rowLength * 3; - } - } - else { - /* with zooming */ - GLint row; - for (row=0; rowVisual.rgbMode) { - const GLchan *src = (const GLchan *) pixels - + (skipRows * rowLength + skipPixels); - if (ctx->Pixel.ZoomX==1.0F && ctx->Pixel.ZoomY==1.0F) { - /* no zooming */ - GLint row; - ASSERT(drawWidth <= MAX_WIDTH); - for (row=0; rowrgb[i][0] = src[i]; - span.array->rgb[i][1] = src[i]; - span.array->rgb[i][2] = src[i]; - } - rb->PutRowRGB(ctx, rb, drawWidth, destX, destY, - span.array->rgb, NULL); - src += rowLength; - destY++; - } - } - else if (ctx->Pixel.ZoomX==1.0F && ctx->Pixel.ZoomY==-1.0F) { - /* upside-down */ - GLint row; - ASSERT(drawWidth <= MAX_WIDTH); - for (row=0; rowrgb[i][0] = src[i]; - span.array->rgb[i][1] = src[i]; - span.array->rgb[i][2] = src[i]; - } - destY--; - rb->PutRow(ctx, rb, drawWidth, destX, destY, - span.array->rgb, NULL); - src += rowLength; - } - } - else { - /* with zooming */ - GLint row; - ASSERT(drawWidth <= MAX_WIDTH); - for (row=0; rowrgb[i][0] = src[i]; - span.array->rgb[i][1] = src[i]; - span.array->rgb[i][2] = src[i]; - } - span.x = destX; - span.y = destY; - span.end = drawWidth; - _swrast_write_zoomed_rgb_span(ctx, imgX, imgY, &span, - (CONST GLchan (*)[3]) span.array->rgb); - src += rowLength; - destY++; - } + return GL_TRUE; + } + + if (format == GL_LUMINANCE_ALPHA && type == CHAN_TYPE && rbType == CHAN_TYPE) { + const GLchan *src = (const GLchan *) pixels + + (unpack.SkipRows * unpack.RowLength + unpack.SkipPixels)*2; + if (simpleZoom) { + GLint row; + ASSERT(drawWidth <= MAX_WIDTH); + for (row = 0; row < drawHeight; row++) { + GLint i; + const GLchan *ptr = src; + for (i = 0;irgba[i][0] = *ptr; + span.array->rgba[i][1] = *ptr; + span.array->rgba[i][2] = *ptr++; + span.array->rgba[i][3] = *ptr++; } + rb->PutRow(ctx, rb, drawWidth, destX, destY, + span.array->rgba, NULL); + src += unpack.RowLength*2; + destY += yStep; } - return GL_TRUE; } - else if (format == GL_LUMINANCE_ALPHA && type == CHAN_TYPE) { - if (ctx->Visual.rgbMode) { - const GLchan *src = (const GLchan *) pixels - + (skipRows * rowLength + skipPixels)*2; - if (ctx->Pixel.ZoomX==1.0F && ctx->Pixel.ZoomY==1.0F) { - /* no zooming */ - GLint row; - ASSERT(drawWidth <= MAX_WIDTH); - for (row=0; rowrgba[i][0] = *ptr; - span.array->rgba[i][1] = *ptr; - span.array->rgba[i][2] = *ptr++; - span.array->rgba[i][3] = *ptr++; - } - rb->PutRow(ctx, rb, drawWidth, destX, destY, - span.array->rgba, NULL); - src += rowLength*2; - destY++; - } - } - else if (ctx->Pixel.ZoomX==1.0F && ctx->Pixel.ZoomY==-1.0F) { - /* upside-down */ - GLint row; - ASSERT(drawWidth <= MAX_WIDTH); - for (row=0; rowrgba[i][0] = *ptr; - span.array->rgba[i][1] = *ptr; - span.array->rgba[i][2] = *ptr++; - span.array->rgba[i][3] = *ptr++; - } - destY--; - rb->PutRow(ctx, rb, drawWidth, destX, destY, - span.array->rgba, NULL); - src += rowLength*2; - } - } - else { - /* with zooming */ - GLint row; - ASSERT(drawWidth <= MAX_WIDTH); - for (row=0; rowrgba[i][0] = *ptr; - span.array->rgba[i][1] = *ptr; - span.array->rgba[i][2] = *ptr++; - span.array->rgba[i][3] = *ptr++; - } - span.x = destX; - span.y = destY; - span.end = drawWidth; - _swrast_write_zoomed_rgba_span(ctx, imgX, imgY, &span, - (CONST GLchan (*)[4]) span.array->rgba); - src += rowLength*2; - destY++; - } + else { + /* with zooming */ + GLint row; + ASSERT(drawWidth <= MAX_WIDTH); + for (row = 0; row < drawHeight; row++) { + const GLchan *ptr = src; + GLint i; + for (i = 0;irgba[i][0] = *ptr; + span.array->rgba[i][1] = *ptr; + span.array->rgba[i][2] = *ptr++; + span.array->rgba[i][3] = *ptr++; } + span.x = destX; + span.y = destY; + span.end = drawWidth; + _swrast_write_zoomed_rgba_span(ctx, imgX, imgY, &span, + span.array->rgba); + src += unpack.RowLength*2; + destY++; } - return GL_TRUE; } - else if (format==GL_COLOR_INDEX && type==GL_UNSIGNED_BYTE) { - const GLubyte *src = - (const GLubyte *) pixels + skipRows * rowLength + skipPixels; - if (ctx->Visual.rgbMode) { - /* convert CI data to RGBA */ - if (ctx->Pixel.ZoomX==1.0F && ctx->Pixel.ZoomY==1.0F) { - /* no zooming */ - GLint row; - for (row=0; rowrgba); - rb->PutRow(ctx, rb, drawWidth, destX, destY, - span.array->rgba, NULL); - src += rowLength; - destY++; - } - return GL_TRUE; - } - else if (ctx->Pixel.ZoomX==1.0F && ctx->Pixel.ZoomY==-1.0F) { - /* upside-down */ - GLint row; - for (row=0; rowrgba); - destY--; - rb->PutRow(ctx, rb, drawWidth, destX, destY, - span.array->rgba, NULL); - src += rowLength; - } - return GL_TRUE; - } - else { - /* with zooming */ - GLint row; - for (row=0; rowrgba); - span.x = destX; - span.y = destY; - span.end = drawWidth; - _swrast_write_zoomed_rgba_span(ctx, imgX, imgY, &span, - (CONST GLchan (*)[4]) span.array->rgba); - src += rowLength; - destY++; - } - return GL_TRUE; + return GL_TRUE; + } + + if (format == GL_COLOR_INDEX && type == GL_UNSIGNED_BYTE) { + const GLubyte *src = (const GLubyte *) pixels + + unpack.SkipRows * unpack.RowLength + unpack.SkipPixels; + if (ctx->Visual.rgbMode && rbType == GL_UNSIGNED_BYTE) { + /* convert ubyte/CI data to ubyte/RGBA */ + if (simpleZoom) { + GLint row; + for (row = 0; row < drawHeight; row++) { + ASSERT(drawWidth <= MAX_WIDTH); + _mesa_map_ci8_to_rgba8(ctx, drawWidth, src, + span.array->color.sz1.rgba); + rb->PutRow(ctx, rb, drawWidth, destX, destY, + span.array->color.sz1.rgba, NULL); + src += unpack.RowLength; + destY += yStep; } } else { - /* write CI data to CI frame buffer */ + /* ubyte/CI to ubyte/RGBA with zooming */ GLint row; - if (ctx->Pixel.ZoomX==1.0F && ctx->Pixel.ZoomY==1.0F) { - /* no zooming */ - for (row=0; rowPutRow(ctx, rb, drawWidth, destX, destY, index32, NULL); - src += rowLength; - destY++; - } - return GL_TRUE; - } - else { - /* with zooming */ - return GL_FALSE; + for (row = 0; row < drawHeight; row++) { + ASSERT(drawWidth <= MAX_WIDTH); + _mesa_map_ci8_to_rgba8(ctx, drawWidth, src, + span.array->color.sz1.rgba); + span.x = destX; + span.y = destY; + span.end = drawWidth; + _swrast_write_zoomed_rgba_span(ctx, imgX, imgY, &span, + span.array->color.sz1.rgba); + src += unpack.RowLength; + destY++; } } + return GL_TRUE; } - else { - /* can't handle this pixel format and/or data type here */ - return GL_FALSE; + else if (!ctx->Visual.rgbMode && rbType == GL_UNSIGNED_INT) { + /* write CI data to CI frame buffer */ + GLint row; + if (simpleZoom) { + for (row = 0; row < drawHeight; row++) { + GLuint index32[MAX_WIDTH]; + GLint col; + for (col = 0; col < drawWidth; col++) + index32[col] = src[col]; + rb->PutRow(ctx, rb, drawWidth, destX, destY, index32, NULL); + src += unpack.RowLength; + destY += yStep; + } + return GL_TRUE; + } } } - /* can't do a simple draw, have to use slow path */ + /* can't handle this pixel format and/or data type */ return GL_FALSE; } @@ -458,7 +334,7 @@ draw_index_pixels( GLcontext *ctx, GLint x, GLint y, const GLint imgX = x, imgY = y; const GLboolean zoom = ctx->Pixel.ZoomX!=1.0 || ctx->Pixel.ZoomY!=1.0; GLint row, skipPixels; - struct sw_span span; + SWspan span; INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_INDEX); @@ -530,13 +406,7 @@ draw_stencil_pixels( GLcontext *ctx, GLint x, GLint y, _mesa_unpack_index_span(ctx, spanWidth, destType, values, type, source, unpack, ctx->_ImageTransferState); - if (ctx->_ImageTransferState & IMAGE_SHIFT_OFFSET_BIT) { - _mesa_shift_and_offset_stencil(ctx, spanWidth, values); - } - if (ctx->Pixel.MapStencilFlag) { - _mesa_map_stencil(ctx, spanWidth, values); - } - + _mesa_apply_stencil_transfer_ops(ctx, spanWidth, values); if (zoom) { _swrast_write_zoomed_stencil_span(ctx, x, y, spanWidth, spanX, spanY, values); @@ -564,7 +434,7 @@ draw_depth_pixels( GLcontext *ctx, GLint x, GLint y, const GLboolean scaleOrBias = ctx->Pixel.DepthScale != 1.0 || ctx->Pixel.DepthBias != 0.0; const GLboolean zoom = ctx->Pixel.ZoomX != 1.0 || ctx->Pixel.ZoomY != 1.0; - struct sw_span span; + SWspan span; INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_Z); @@ -665,7 +535,7 @@ draw_depth_pixels( GLcontext *ctx, GLint x, GLint y, -/* +/** * Draw RGBA image. */ static void @@ -677,19 +547,17 @@ draw_rgba_pixels( GLcontext *ctx, GLint x, GLint y, { SWcontext *swrast = SWRAST_CONTEXT(ctx); const GLint imgX = x, imgY = y; - struct gl_renderbuffer *rb = NULL; /* only used for quickDraw path */ const GLboolean zoom = ctx->Pixel.ZoomX!=1.0 || ctx->Pixel.ZoomY!=1.0; - GLboolean quickDraw; GLfloat *convImage = NULL; - GLuint transferOps = ctx->_ImageTransferState; - struct sw_span span; - - INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_RGBA); + GLbitfield transferOps = ctx->_ImageTransferState; + SWspan span; /* Try an optimized glDrawPixels first */ - if (fast_draw_pixels(ctx, x, y, width, height, format, type, unpack, pixels)) + if (fast_draw_rgba_pixels(ctx, x, y, width, height, format, type, + unpack, pixels)) return; + INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_RGBA); if (ctx->Depth.Test) _swrast_span_default_z(ctx, &span); if (swrast->_FogEnabled) @@ -697,18 +565,6 @@ draw_rgba_pixels( GLcontext *ctx, GLint x, GLint y, if (ctx->Texture._EnabledCoordUnits) _swrast_span_default_texcoords(ctx, &span); - if (swrast->_RasterMask == 0 && !zoom && x >= 0 && y >= 0 - && x + width <= (GLint) ctx->DrawBuffer->Width - && y + height <= (GLint) ctx->DrawBuffer->Height - && ctx->DrawBuffer->_NumColorDrawBuffers[0] == 1) { - quickDraw = GL_TRUE; - rb = ctx->DrawBuffer->_ColorDrawBuffers[0][0]; - } - else { - quickDraw = GL_FALSE; - rb = NULL; - } - if (ctx->Pixel.Convolution2DEnabled || ctx->Pixel.Separable2DEnabled) { /* Convolution has to be handled specially. We'll create an * intermediate image, applying all pixel transfer operations @@ -760,59 +616,66 @@ draw_rgba_pixels( GLcontext *ctx, GLint x, GLint y, transferOps &= IMAGE_POST_CONVOLUTION_BITS; } + if (ctx->DrawBuffer->_NumColorDrawBuffers[0] > 0 && + ctx->DrawBuffer->_ColorDrawBuffers[0][0]->DataType != GL_FLOAT && + ctx->Color.ClampFragmentColor != GL_FALSE) { + /* need to clamp colors before applying fragment ops */ + transferOps |= IMAGE_CLAMP_BIT; + } + /* * General solution */ { + const GLboolean sink = (ctx->Pixel.MinMaxEnabled && ctx->MinMax.Sink) + || (ctx->Pixel.HistogramEnabled && ctx->Histogram.Sink); const GLbitfield interpMask = span.interpMask; const GLbitfield arrayMask = span.arrayMask; + const GLint srcStride + = _mesa_image_row_stride(unpack, width, format, type); GLint skipPixels = 0; + /* use span array for temp color storage */ + GLfloat *rgba = (GLfloat *) span.array->color.sz4.rgba; /* if the span is wider than MAX_WIDTH we have to do it in chunks */ while (skipPixels < width) { const GLint spanWidth = MIN2(width - skipPixels, MAX_WIDTH); + const GLubyte *source = _mesa_image_address2d(unpack, pixels, + width, height, format, type, 0, skipPixels); GLint row; - ASSERT(span.end <= MAX_WIDTH); - for (row = 0; row < height; row++) { - const GLvoid *source = _mesa_image_address2d(unpack, - pixels, width, height, format, type, row, skipPixels); - - /* Set these for each row since the _swrast_write_* function may - * change them while clipping. - */ - span.x = x + skipPixels; - span.y = y + row; - span.end = spanWidth; - span.arrayMask = arrayMask; - span.interpMask = interpMask; - - _mesa_unpack_color_span_chan(ctx, spanWidth, GL_RGBA, - (GLchan *) span.array->rgba, - format, type, source, unpack, - transferOps); - - if ((ctx->Pixel.MinMaxEnabled && ctx->MinMax.Sink) || - (ctx->Pixel.HistogramEnabled && ctx->Histogram.Sink)) - continue; - + /* get image row as float/RGBA */ + _mesa_unpack_color_span_float(ctx, spanWidth, GL_RGBA, rgba, + format, type, source, unpack, + transferOps); /* draw the span */ - if (quickDraw) { - rb->PutRow(ctx, rb, span.end, span.x, span.y, - span.array->rgba, NULL); - } - else if (zoom) { - _swrast_write_zoomed_rgba_span(ctx, imgX, imgY, &span, - (CONST GLchan (*)[4]) span.array->rgba); - } - else { - _swrast_write_rgba_span(ctx, &span); + if (!sink) { + /* Set these for each row since the _swrast_write_* functions + * may change them while clipping/rendering. + */ + span.array->ChanType = GL_FLOAT; + span.x = x + skipPixels; + span.y = y + row; + span.end = spanWidth; + span.arrayMask = arrayMask; + span.interpMask = interpMask; + if (zoom) { + _swrast_write_zoomed_rgba_span(ctx, imgX, imgY, &span, rgba); + } + else { + _swrast_write_rgba_span(ctx, &span); + } } - } + + source += srcStride; + } /* for row */ skipPixels += spanWidth; - } + } /* while skipPixels < width */ + + /* XXX this is ugly/temporary, to undo above change */ + span.array->ChanType = CHAN_TYPE; } if (convImage) { diff --git a/src/mesa/swrast/s_fog.c b/src/mesa/swrast/s_fog.c index e3d6274b3fe..f4c3fe4f2dc 100644 --- a/src/mesa/swrast/s_fog.c +++ b/src/mesa/swrast/s_fog.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.3 + * Version: 6.5.2 * - * Copyright (C) 1999-2005 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2006 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"), @@ -30,7 +30,6 @@ #include "s_context.h" #include "s_fog.h" -#include "s_span.h" /** @@ -66,6 +65,33 @@ _swrast_z_to_fogfactor(GLcontext *ctx, GLfloat z) } +/** + * Template code for computing fog blend factor and applying it to colors. + * \param TYPE either GLubyte, GLushort or GLfloat. + * \param COMPUTE_F code to compute the fog blend factor, f. + */ +#define FOG_LOOP(TYPE, COMPUTE_F) \ +do { \ + const GLfloat fogStep = span->fogStep; \ + GLfloat fogCoord = span->fog; \ + const GLfloat wStep = haveW ? span->dwdx : 0.0F; \ + GLfloat w = haveW ? span->w : 1.0F; \ + GLuint i; \ + for (i = 0; i < span->end; i++) { \ + GLfloat f, oneMinusF; \ + COMPUTE_F; \ + f = CLAMP(f, 0.0F, 1.0F); \ + oneMinusF = 1.0F - f; \ + rgba[i][RCOMP] = (TYPE) (f * rgba[i][RCOMP] + oneMinusF * rFog); \ + rgba[i][GCOMP] = (TYPE) (f * rgba[i][GCOMP] + oneMinusF * gFog); \ + rgba[i][BCOMP] = (TYPE) (f * rgba[i][BCOMP] + oneMinusF * bFog); \ + fogCoord += fogStep; \ + w += wStep; \ + } \ +} while (0) + + + /** * Apply fog to a span of RGBA pixels. * The fog value are either in the span->array->fog array or interpolated from @@ -74,19 +100,33 @@ _swrast_z_to_fogfactor(GLcontext *ctx, GLfloat z) * _PreferPixelFog should be in sync with that state! */ void -_swrast_fog_rgba_span( const GLcontext *ctx, struct sw_span *span ) +_swrast_fog_rgba_span( const GLcontext *ctx, SWspan *span ) { const SWcontext *swrast = SWRAST_CONTEXT(ctx); - const GLchan rFog = swrast->_FogColor[RCOMP]; - const GLchan gFog = swrast->_FogColor[GCOMP]; - const GLchan bFog = swrast->_FogColor[BCOMP]; + GLfloat rFog, gFog, bFog; const GLuint haveW = (span->interpMask & SPAN_W); - GLchan (*rgba)[4] = (GLchan (*)[4]) span->array->rgba; ASSERT(swrast->_FogEnabled); ASSERT((span->interpMask | span->arrayMask) & SPAN_FOG); ASSERT(span->arrayMask & SPAN_RGBA); + if (span->array->ChanType == GL_UNSIGNED_BYTE) { + rFog = ctx->Fog.Color[RCOMP] * 255.0; + gFog = ctx->Fog.Color[GCOMP] * 255.0; + bFog = ctx->Fog.Color[BCOMP] * 255.0; + } + else if (span->array->ChanType == GL_UNSIGNED_SHORT) { + rFog = ctx->Fog.Color[RCOMP] * 65535.0; + gFog = ctx->Fog.Color[GCOMP] * 65535.0; + bFog = ctx->Fog.Color[BCOMP] * 65535.0; + } + else { + rFog = ctx->Fog.Color[RCOMP]; + gFog = ctx->Fog.Color[GCOMP]; + bFog = ctx->Fog.Color[BCOMP]; + } + + /* NOTE: if haveW is true, that means the fog start/step values are * perspective-corrected and we have to divide each fog coord by W. */ @@ -96,79 +136,71 @@ _swrast_fog_rgba_span( const GLcontext *ctx, struct sw_span *span ) /* The span's fog values are fog coordinates, now compute blend factors * and blend the fragment colors with the fog color. */ + const GLfloat fogEnd = ctx->Fog.End; + const GLfloat fogScale = (ctx->Fog.Start == ctx->Fog.End) + ? 1.0F : 1.0F / (ctx->Fog.End - ctx->Fog.Start); + const GLfloat density = -ctx->Fog.Density; + const GLfloat negDensitySquared = -ctx->Fog.Density * ctx->Fog.Density; + switch (swrast->_FogMode) { case GL_LINEAR: - { - const GLfloat fogEnd = ctx->Fog.End; - const GLfloat fogScale = (ctx->Fog.Start == ctx->Fog.End) - ? 1.0F : 1.0F / (ctx->Fog.End - ctx->Fog.Start); - const GLfloat fogStep = span->fogStep; - GLfloat fogCoord = span->fog; - const GLfloat wStep = haveW ? span->dwdx : 0.0F; - GLfloat w = haveW ? span->w : 1.0F; - GLuint i; - for (i = 0; i < span->end; i++) { - GLfloat f, oneMinusF; - f = (fogEnd - FABSF(fogCoord) / w) * fogScale; - f = CLAMP(f, 0.0F, 1.0F); - oneMinusF = 1.0F - f; - rgba[i][RCOMP] = (GLchan) (f * rgba[i][RCOMP] + oneMinusF * rFog); - rgba[i][GCOMP] = (GLchan) (f * rgba[i][GCOMP] + oneMinusF * gFog); - rgba[i][BCOMP] = (GLchan) (f * rgba[i][BCOMP] + oneMinusF * bFog); - fogCoord += fogStep; - w += wStep; - } +#define COMPUTE_F f = (fogEnd - FABSF(fogCoord) / w) * fogScale; + if (span->array->ChanType == GL_UNSIGNED_BYTE) { + GLubyte (*rgba)[4] = span->array->color.sz1.rgba; + FOG_LOOP(GLubyte, COMPUTE_F); + } + else if (span->array->ChanType == GL_UNSIGNED_SHORT) { + GLushort (*rgba)[4] = span->array->color.sz2.rgba; + FOG_LOOP(GLushort, COMPUTE_F); + } + else { + GLfloat (*rgba)[4] = span->array->color.sz4.rgba; + ASSERT(span->array->ChanType == GL_FLOAT); + FOG_LOOP(GLfloat, COMPUTE_F); } +#undef COMPUTE_F break; + case GL_EXP: - { - const GLfloat density = -ctx->Fog.Density; - const GLfloat fogStep = span->fogStep; - GLfloat fogCoord = span->fog; - const GLfloat wStep = haveW ? span->dwdx : 0.0F; - GLfloat w = haveW ? span->w : 1.0F; - GLuint i; - for (i = 0; i < span->end; i++) { - GLfloat f, oneMinusF; - f = EXPF(density * FABSF(fogCoord) / w); - f = CLAMP(f, 0.0F, 1.0F); - oneMinusF = 1.0F - f; - rgba[i][RCOMP] = (GLchan) (f * rgba[i][RCOMP] + oneMinusF * rFog); - rgba[i][GCOMP] = (GLchan) (f * rgba[i][GCOMP] + oneMinusF * gFog); - rgba[i][BCOMP] = (GLchan) (f * rgba[i][BCOMP] + oneMinusF * bFog); - fogCoord += fogStep; - w += wStep; - } +#define COMPUTE_F f = EXPF(density * FABSF(fogCoord) / w); + if (span->array->ChanType == GL_UNSIGNED_BYTE) { + GLubyte (*rgba)[4] = span->array->color.sz1.rgba; + FOG_LOOP(GLubyte, COMPUTE_F); + } + else if (span->array->ChanType == GL_UNSIGNED_SHORT) { + GLushort (*rgba)[4] = span->array->color.sz2.rgba; + FOG_LOOP(GLushort, COMPUTE_F); + } + else { + GLfloat (*rgba)[4] = span->array->color.sz4.rgba; + ASSERT(span->array->ChanType == GL_FLOAT); + FOG_LOOP(GLfloat, COMPUTE_F); } +#undef COMPUTE_F break; + case GL_EXP2: - { - const GLfloat negDensitySquared = -ctx->Fog.Density * ctx->Fog.Density; - const GLfloat fogStep = span->fogStep; - GLfloat fogCoord = span->fog; - const GLfloat wStep = haveW ? span->dwdx : 0.0F; - GLfloat w = haveW ? span->w : 1.0F; - GLuint i; - for (i = 0; i < span->end; i++) { - const GLfloat coord = fogCoord / w; - GLfloat tmp = negDensitySquared * coord * coord; - GLfloat f, oneMinusF; -#if defined(__alpha__) || defined(__alpha) - /* XXX this underflow check may be needed for other systems*/ - if (tmp < FLT_MIN_10_EXP) - tmp = FLT_MIN_10_EXP; -#endif - f = EXPF(tmp); - f = CLAMP(f, 0.0F, 1.0F); - oneMinusF = 1.0F - f; - rgba[i][RCOMP] = (GLchan) (f * rgba[i][RCOMP] + oneMinusF * rFog); - rgba[i][GCOMP] = (GLchan) (f * rgba[i][GCOMP] + oneMinusF * gFog); - rgba[i][BCOMP] = (GLchan) (f * rgba[i][BCOMP] + oneMinusF * bFog); - fogCoord += fogStep; - w += wStep; - } +#define COMPUTE_F const GLfloat coord = fogCoord / w; \ + GLfloat tmp = negDensitySquared * coord * coord; \ + if (tmp < FLT_MIN_10_EXP) \ + tmp = FLT_MIN_10_EXP; \ + f = EXPF(tmp); + if (span->array->ChanType == GL_UNSIGNED_BYTE) { + GLubyte (*rgba)[4] = span->array->color.sz1.rgba; + FOG_LOOP(GLubyte, COMPUTE_F); + } + else if (span->array->ChanType == GL_UNSIGNED_SHORT) { + GLushort (*rgba)[4] = span->array->color.sz2.rgba; + FOG_LOOP(GLushort, COMPUTE_F); } + else { + GLfloat (*rgba)[4] = span->array->color.sz4.rgba; + ASSERT(span->array->ChanType == GL_FLOAT); + FOG_LOOP(GLfloat, COMPUTE_F); + } +#undef COMPUTE_F break; + default: _mesa_problem(ctx, "Bad fog mode in _swrast_fog_rgba_span"); return; @@ -179,33 +211,58 @@ _swrast_fog_rgba_span( const GLcontext *ctx, struct sw_span *span ) * They were previously computed per-vertex. */ GLuint i; - for (i = 0; i < span->end; i++) { - const GLfloat f = span->array->fog[i]; - const GLfloat oneMinusF = 1.0F - f; - rgba[i][RCOMP] = (GLchan) (f * rgba[i][RCOMP] + oneMinusF * rFog); - rgba[i][GCOMP] = (GLchan) (f * rgba[i][GCOMP] + oneMinusF * gFog); - rgba[i][BCOMP] = (GLchan) (f * rgba[i][BCOMP] + oneMinusF * bFog); + if (span->array->ChanType == GL_UNSIGNED_BYTE) { + GLubyte (*rgba)[4] = span->array->color.sz1.rgba; + for (i = 0; i < span->end; i++) { + const GLfloat f = span->array->fog[i]; + const GLfloat oneMinusF = 1.0F - f; + rgba[i][RCOMP] = (GLubyte) (f * rgba[i][RCOMP] + oneMinusF * rFog); + rgba[i][GCOMP] = (GLubyte) (f * rgba[i][GCOMP] + oneMinusF * gFog); + rgba[i][BCOMP] = (GLubyte) (f * rgba[i][BCOMP] + oneMinusF * bFog); + } } + else if (span->array->ChanType == GL_UNSIGNED_SHORT) { + GLushort (*rgba)[4] = span->array->color.sz2.rgba; + for (i = 0; i < span->end; i++) { + const GLfloat f = span->array->fog[i]; + const GLfloat oneMinusF = 1.0F - f; + rgba[i][RCOMP] = (GLushort) (f * rgba[i][RCOMP] + oneMinusF * rFog); + rgba[i][GCOMP] = (GLushort) (f * rgba[i][GCOMP] + oneMinusF * gFog); + rgba[i][BCOMP] = (GLushort) (f * rgba[i][BCOMP] + oneMinusF * bFog); + } + } + else { + GLfloat (*rgba)[4] = span->array->color.sz4.rgba; + ASSERT(span->array->ChanType == GL_FLOAT); + for (i = 0; i < span->end; i++) { + const GLfloat f = span->array->fog[i]; + const GLfloat oneMinusF = 1.0F - f; + rgba[i][RCOMP] = f * rgba[i][RCOMP] + oneMinusF * rFog; + rgba[i][GCOMP] = f * rgba[i][GCOMP] + oneMinusF * gFog; + rgba[i][BCOMP] = f * rgba[i][BCOMP] + oneMinusF * bFog; + } + } + } else { /* The span's fog start/step values are blend factors. * They were previously computed per-vertex. */ - const GLfloat fogStep = span->fogStep; - GLfloat fog = span->fog; - const GLfloat wStep = haveW ? span->dwdx : 0.0F; - GLfloat w = haveW ? span->w : 1.0F; - GLuint i; - ASSERT(span->interpMask & SPAN_FOG); - for (i = 0; i < span->end; i++) { - const GLfloat fact = fog / w; - const GLfloat oneMinusF = 1.0F - fact; - rgba[i][RCOMP] = (GLchan) (fact * rgba[i][RCOMP] + oneMinusF * rFog); - rgba[i][GCOMP] = (GLchan) (fact * rgba[i][GCOMP] + oneMinusF * gFog); - rgba[i][BCOMP] = (GLchan) (fact * rgba[i][BCOMP] + oneMinusF * bFog); - fog += fogStep; - w += wStep; +#define COMPUTE_F f = fogCoord / w; + if (span->array->ChanType == GL_UNSIGNED_BYTE) { + GLubyte (*rgba)[4] = span->array->color.sz1.rgba; + FOG_LOOP(GLubyte, COMPUTE_F); + } + else if (span->array->ChanType == GL_UNSIGNED_SHORT) { + GLushort (*rgba)[4] = span->array->color.sz2.rgba; + FOG_LOOP(GLushort, COMPUTE_F); + } + else { + GLfloat (*rgba)[4] = span->array->color.sz4.rgba; + ASSERT(span->array->ChanType == GL_FLOAT); + FOG_LOOP(GLfloat, COMPUTE_F); } +#undef COMPUTE_F } } @@ -214,7 +271,7 @@ _swrast_fog_rgba_span( const GLcontext *ctx, struct sw_span *span ) * As above, but color index mode. */ void -_swrast_fog_ci_span( const GLcontext *ctx, struct sw_span *span ) +_swrast_fog_ci_span( const GLcontext *ctx, SWspan *span ) { const SWcontext *swrast = SWRAST_CONTEXT(ctx); const GLuint haveW = (span->interpMask & SPAN_W); diff --git a/src/mesa/swrast/s_fog.h b/src/mesa/swrast/s_fog.h index f5744b1d952..9639bee2cc3 100644 --- a/src/mesa/swrast/s_fog.h +++ b/src/mesa/swrast/s_fog.h @@ -36,10 +36,10 @@ extern GLfloat _swrast_z_to_fogfactor(GLcontext *ctx, GLfloat z); extern void -_swrast_fog_rgba_span( const GLcontext *ctx, struct sw_span *span ); +_swrast_fog_rgba_span( const GLcontext *ctx, SWspan *span ); extern void -_swrast_fog_ci_span( const GLcontext *ctx, struct sw_span *span ); +_swrast_fog_ci_span( const GLcontext *ctx, SWspan *span ); #endif diff --git a/src/mesa/swrast/s_imaging.c b/src/mesa/swrast/s_imaging.c index ac69d270b88..73aaba1ec9f 100644 --- a/src/mesa/swrast/s_imaging.c +++ b/src/mesa/swrast/s_imaging.c @@ -54,7 +54,7 @@ _swrast_CopyColorTable( GLcontext *ctx, /* read the data from framebuffer */ _swrast_read_rgba_span( ctx, ctx->ReadBuffer->_ColorReadBuffer, - width, x, y, data ); + width, x, y, CHAN_TYPE, data ); RENDER_FINISH(swrast,ctx); @@ -89,7 +89,7 @@ _swrast_CopyColorSubTable( GLcontext *ctx,GLenum target, GLsizei start, /* read the data from framebuffer */ _swrast_read_rgba_span( ctx, ctx->ReadBuffer->_ColorReadBuffer, - width, x, y, data ); + width, x, y, CHAN_TYPE, data ); RENDER_FINISH(swrast,ctx); @@ -122,7 +122,7 @@ _swrast_CopyConvolutionFilter1D(GLcontext *ctx, GLenum target, /* read the data from framebuffer */ _swrast_read_rgba_span( ctx, ctx->ReadBuffer->_ColorReadBuffer, - width, x, y, (GLchan (*)[4]) rgba ); + width, x, y, CHAN_TYPE, rgba ); RENDER_FINISH( swrast, ctx ); @@ -160,7 +160,7 @@ _swrast_CopyConvolutionFilter2D(GLcontext *ctx, GLenum target, /* read pixels from framebuffer */ for (i = 0; i < height; i++) { _swrast_read_rgba_span( ctx, ctx->ReadBuffer->_ColorReadBuffer, - width, x, y + i, (GLchan (*)[4]) rgba[i] ); + width, x, y + i, CHAN_TYPE, rgba[i] ); } RENDER_FINISH(swrast,ctx); diff --git a/src/mesa/swrast/s_lines.c b/src/mesa/swrast/s_lines.c index 1abe85c541b..ff507249b08 100644 --- a/src/mesa/swrast/s_lines.c +++ b/src/mesa/swrast/s_lines.c @@ -61,7 +61,7 @@ compute_stipple_mask( GLcontext *ctx, GLuint len, GLubyte mask[] ) * To draw a wide line we can simply redraw the span N times, side by side. */ static void -draw_wide_line( GLcontext *ctx, struct sw_span *span, GLboolean xMajor ) +draw_wide_line( GLcontext *ctx, SWspan *span, GLboolean xMajor ) { GLint width, start; diff --git a/src/mesa/swrast/s_linetemp.h b/src/mesa/swrast/s_linetemp.h index f7c5ab49237..f5b2d95653f 100644 --- a/src/mesa/swrast/s_linetemp.h +++ b/src/mesa/swrast/s_linetemp.h @@ -70,7 +70,7 @@ static void NAME( GLcontext *ctx, const SWvertex *vert0, const SWvertex *vert1 ) { - struct sw_span span; + SWspan span; GLuint interpFlags = 0; GLint x0 = (GLint) vert0->win[0]; GLint x1 = (GLint) vert1->win[0]; diff --git a/src/mesa/swrast/s_logic.c b/src/mesa/swrast/s_logic.c index 60458c2b804..719b17962d4 100644 --- a/src/mesa/swrast/s_logic.c +++ b/src/mesa/swrast/s_logic.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.3 + * Version: 6.5.2 * - * Copyright (C) 1999-2005 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2006 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"), @@ -33,20 +33,25 @@ #include "s_span.h" -#define LOGIC_OP_LOOP(MODE) \ +/** + * We do all logic ops on 4-byte GLuints. + * Depending on bytes per pixel, the mask array elements correspond to + * 1, 2 or 4 GLuints. + */ +#define LOGIC_OP_LOOP(MODE, MASKSTRIDE) \ do { \ GLuint i; \ switch (MODE) { \ case GL_CLEAR: \ for (i = 0; i < n; i++) { \ - if (mask[i]) { \ + if (mask[i / MASKSTRIDE]) { \ src[i] = 0; \ } \ } \ break; \ case GL_SET: \ for (i = 0; i < n; i++) { \ - if (mask[i]) { \ + if (mask[i / MASKSTRIDE]) { \ src[i] = ~0; \ } \ } \ @@ -56,91 +61,91 @@ do { \ break; \ case GL_COPY_INVERTED: \ for (i = 0; i < n; i++) { \ - if (mask[i]) { \ + if (mask[i / MASKSTRIDE]) { \ src[i] = ~src[i]; \ } \ } \ break; \ case GL_NOOP: \ for (i = 0; i < n; i++) { \ - if (mask[i]) { \ + if (mask[i / MASKSTRIDE]) { \ src[i] = dest[i]; \ } \ } \ break; \ case GL_INVERT: \ for (i = 0; i < n; i++) { \ - if (mask[i]) { \ + if (mask[i / MASKSTRIDE]) { \ src[i] = ~dest[i]; \ } \ } \ break; \ case GL_AND: \ for (i = 0; i < n; i++) { \ - if (mask[i]) { \ + if (mask[i / MASKSTRIDE]) { \ src[i] &= dest[i]; \ } \ } \ break; \ case GL_NAND: \ for (i = 0; i < n; i++) { \ - if (mask[i]) { \ + if (mask[i / MASKSTRIDE]) { \ src[i] = ~(src[i] & dest[i]); \ } \ } \ break; \ case GL_OR: \ for (i = 0; i < n; i++) { \ - if (mask[i]) { \ + if (mask[i / MASKSTRIDE]) { \ src[i] |= dest[i]; \ } \ } \ break; \ case GL_NOR: \ for (i = 0; i < n; i++) { \ - if (mask[i]) { \ + if (mask[i / MASKSTRIDE]) { \ src[i] = ~(src[i] | dest[i]); \ } \ } \ break; \ case GL_XOR: \ for (i = 0; i < n; i++) { \ - if (mask[i]) { \ + if (mask[i / MASKSTRIDE]) { \ src[i] ^= dest[i]; \ } \ } \ break; \ case GL_EQUIV: \ for (i = 0; i < n; i++) { \ - if (mask[i]) { \ + if (mask[i / MASKSTRIDE]) { \ src[i] = ~(src[i] ^ dest[i]); \ } \ } \ break; \ case GL_AND_REVERSE: \ for (i = 0; i < n; i++) { \ - if (mask[i]) { \ + if (mask[i / MASKSTRIDE]) { \ src[i] = src[i] & ~dest[i]; \ } \ } \ break; \ case GL_AND_INVERTED: \ for (i = 0; i < n; i++) { \ - if (mask[i]) { \ + if (mask[i / MASKSTRIDE]) { \ src[i] = ~src[i] & dest[i]; \ } \ } \ break; \ case GL_OR_REVERSE: \ for (i = 0; i < n; i++) { \ - if (mask[i]) { \ + if (mask[i / MASKSTRIDE]) { \ src[i] = src[i] | ~dest[i]; \ } \ } \ break; \ case GL_OR_INVERTED: \ for (i = 0; i < n; i++) { \ - if (mask[i]) { \ + if (mask[i / MASKSTRIDE]) { \ src[i] = ~src[i] | dest[i]; \ } \ } \ @@ -152,27 +157,27 @@ do { \ -static void -logicop_ubyte(GLcontext *ctx, GLuint n, GLubyte src[], const GLubyte dest[], +static INLINE void +logicop_uint1(GLcontext *ctx, GLuint n, GLuint src[], const GLuint dest[], const GLubyte mask[]) { - LOGIC_OP_LOOP(ctx->Color.LogicOp); + LOGIC_OP_LOOP(ctx->Color.LogicOp, 1); } -static void -logicop_ushort(GLcontext *ctx, GLuint n, GLushort src[], const GLushort dest[], - const GLubyte mask[]) +static INLINE void +logicop_uint2(GLcontext *ctx, GLuint n, GLuint src[], const GLuint dest[], + const GLubyte mask[]) { - LOGIC_OP_LOOP(ctx->Color.LogicOp); + LOGIC_OP_LOOP(ctx->Color.LogicOp, 2); } -static void -logicop_uint(GLcontext *ctx, GLuint n, GLuint src[], const GLuint dest[], - const GLubyte mask[]) +static INLINE void +logicop_uint4(GLcontext *ctx, GLuint n, GLuint src[], const GLuint dest[], + const GLubyte mask[]) { - LOGIC_OP_LOOP(ctx->Color.LogicOp); + LOGIC_OP_LOOP(ctx->Color.LogicOp, 4); } @@ -183,9 +188,10 @@ logicop_uint(GLcontext *ctx, GLuint n, GLuint src[], const GLuint dest[], */ void _swrast_logicop_ci_span(GLcontext *ctx, struct gl_renderbuffer *rb, - const struct sw_span *span, GLuint index[]) + SWspan *span) { GLuint dest[MAX_WIDTH]; + GLuint *index = span->array->index; ASSERT(span->end < MAX_WIDTH); ASSERT(rb->DataType == GL_UNSIGNED_INT); @@ -199,7 +205,7 @@ _swrast_logicop_ci_span(GLcontext *ctx, struct gl_renderbuffer *rb, rb->GetRow(ctx, rb, span->end, span->x, span->y, dest); } - logicop_uint(ctx, span->end, index, dest, span->array->mask); + logicop_uint1(ctx, span->end, index, dest, span->array->mask); } @@ -210,35 +216,31 @@ _swrast_logicop_ci_span(GLcontext *ctx, struct gl_renderbuffer *rb, */ void _swrast_logicop_rgba_span(GLcontext *ctx, struct gl_renderbuffer *rb, - const struct sw_span *span, GLchan rgba[][4]) + SWspan *span) { - GLchan dest[MAX_WIDTH][4]; + void *rbPixels; ASSERT(span->end < MAX_WIDTH); ASSERT(span->arrayMask & SPAN_RGBA); - ASSERT(rb->DataType == CHAN_TYPE); + ASSERT(rb->DataType == span->array->ChanType); - if (span->arrayMask & SPAN_XY) { - _swrast_get_values(ctx, rb, span->end, span->array->x, span->array->y, - dest, 4 * sizeof(GLchan)); + rbPixels = _swrast_get_dest_rgba(ctx, rb, span); + + if (span->array->ChanType == GL_UNSIGNED_BYTE) { + /* treat 4*GLubyte as GLuint */ + logicop_uint1(ctx, span->end, + (GLuint *) span->array->color.sz1.rgba, + (const GLuint *) rbPixels, span->array->mask); + } + else if (span->array->ChanType == GL_UNSIGNED_SHORT) { + /* treat 2*GLushort as GLuint */ + logicop_uint2(ctx, 2 * span->end, + (GLuint *) span->array->color.sz2.rgba, + (const GLuint *) rbPixels, span->array->mask); } else { - _swrast_read_rgba_span(ctx, rb, span->end, span->x, span->y, dest); + logicop_uint4(ctx, 4 * span->end, + (GLuint *) span->array->color.sz4.rgba, + (const GLuint *) rbPixels, span->array->mask); } - - /* XXX make this a runtime test */ -#if CHAN_TYPE == GL_UNSIGNED_BYTE - /* treat 4*GLubyte as GLuint */ - logicop_uint(ctx, span->end, (GLuint *) rgba, - (const GLuint *) dest, span->array->mask); -#elif CHAN_TYPE == GL_UNSIGNED_SHORT - logicop_ushort(ctx, 4 * span->end, (GLushort *) rgba, - (const GLushort *) dest, span->array->mask); -#elif CHAN_TYPE == GL_FLOAT - logicop_uint(ctx, 4 * span->end, (GLuint *) rgba, - (const GLuint *) dest, span->array->mask); -#endif - (void) logicop_ubyte; - (void) logicop_ushort; - (void) logicop_uint; } diff --git a/src/mesa/swrast/s_logic.h b/src/mesa/swrast/s_logic.h index ce5f183ff65..0bc2c3f8a82 100644 --- a/src/mesa/swrast/s_logic.h +++ b/src/mesa/swrast/s_logic.h @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.3 + * Version: 6.5.2 * - * Copyright (C) 1999-2005 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2006 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"), @@ -33,12 +33,12 @@ extern void _swrast_logicop_ci_span(GLcontext *ctx, struct gl_renderbuffer *rb, - const struct sw_span *span, GLuint index[]); + SWspan *span); extern void _swrast_logicop_rgba_span(GLcontext *ctx, struct gl_renderbuffer *rb, - const struct sw_span *span, GLchan rgba[][4]); + SWspan *span); #endif diff --git a/src/mesa/swrast/s_masking.c b/src/mesa/swrast/s_masking.c index 65c4e7d01cc..65c984dd3e3 100644 --- a/src/mesa/swrast/s_masking.c +++ b/src/mesa/swrast/s_masking.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.3 + * Version: 6.5.2 * - * Copyright (C) 1999-2005 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2006 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"), @@ -29,7 +29,6 @@ #include "glheader.h" -#include "enums.h" #include "macros.h" #include "s_context.h" @@ -37,100 +36,83 @@ #include "s_span.h" - +/** + * Apply the color mask to a span of rgba values. + */ void _swrast_mask_rgba_span(GLcontext *ctx, struct gl_renderbuffer *rb, - const struct sw_span *span, GLchan rgba[][4]) + SWspan *span) { - GLchan dest[MAX_WIDTH][4]; -#if CHAN_BITS == 8 - GLuint srcMask = *((GLuint*)ctx->Color.ColorMask); - GLuint dstMask = ~srcMask; - GLuint *rgba32 = (GLuint *) rgba; - GLuint *dest32 = (GLuint *) dest; -#else - const GLboolean rMask = ctx->Color.ColorMask[RCOMP]; - const GLboolean gMask = ctx->Color.ColorMask[GCOMP]; - const GLboolean bMask = ctx->Color.ColorMask[BCOMP]; - const GLboolean aMask = ctx->Color.ColorMask[ACOMP]; -#endif const GLuint n = span->end; - GLuint i; + void *rbPixels; ASSERT(n < MAX_WIDTH); ASSERT(span->arrayMask & SPAN_RGBA); - - if (span->arrayMask & SPAN_XY) { - _swrast_get_values(ctx, rb, n, span->array->x, span->array->y, - dest, 4 * sizeof(GLchan)); + ASSERT(rb->DataType == span->array->ChanType); + + rbPixels = _swrast_get_dest_rgba(ctx, rb, span); + + /* + * Do component masking. + * Note that we're not using span->array->mask[] here. We could... + */ + if (span->array->ChanType == GL_UNSIGNED_BYTE) { + /* treat 4xGLubyte as 1xGLuint */ + const GLuint srcMask = *((GLuint *) ctx->Color.ColorMask); + const GLuint dstMask = ~srcMask; + const GLuint *dst = (const GLuint *) rbPixels; + GLuint *src = (GLuint *) span->array->color.sz1.rgba; + GLuint i; + for (i = 0; i < n; i++) { + src[i] = (src[i] & srcMask) | (dst[i] & dstMask); + } } - else { - _swrast_read_rgba_span(ctx, rb, n, span->x, span->y, dest); + else if (span->array->ChanType == GL_UNSIGNED_SHORT) { + /* 2-byte components */ + /* XXX try to use 64-bit arithmetic someday */ + const GLushort rMask = ctx->Color.ColorMask[RCOMP] ? 0xffff : 0x0; + const GLushort gMask = ctx->Color.ColorMask[GCOMP] ? 0xffff : 0x0; + const GLushort bMask = ctx->Color.ColorMask[BCOMP] ? 0xffff : 0x0; + const GLushort aMask = ctx->Color.ColorMask[ACOMP] ? 0xffff : 0x0; + const GLushort (*dst)[4] = (const GLushort (*)[4]) rbPixels; + GLushort (*src)[4] = span->array->color.sz2.rgba; + GLuint i; + for (i = 0; i < n; i++) { + src[i][RCOMP] = (src[i][RCOMP] & rMask) | (dst[i][RCOMP] & ~rMask); + src[i][GCOMP] = (src[i][GCOMP] & gMask) | (dst[i][GCOMP] & ~gMask); + src[i][BCOMP] = (src[i][BCOMP] & bMask) | (dst[i][BCOMP] & ~bMask); + src[i][ACOMP] = (src[i][ACOMP] & aMask) | (dst[i][ACOMP] & ~aMask); + } } - -#if CHAN_BITS == 8 - for (i = 0; i < n; i++) { - rgba32[i] = (rgba32[i] & srcMask) | (dest32[i] & dstMask); - } -#else - for (i = 0; i < n; i++) { - if (!rMask) rgba[i][RCOMP] = dest[i][RCOMP]; - if (!gMask) rgba[i][GCOMP] = dest[i][GCOMP]; - if (!bMask) rgba[i][BCOMP] = dest[i][BCOMP]; - if (!aMask) rgba[i][ACOMP] = dest[i][ACOMP]; + else { + /* 4-byte components */ + const GLuint rMask = ctx->Color.ColorMask[RCOMP] ? ~0x0 : 0x0; + const GLuint gMask = ctx->Color.ColorMask[GCOMP] ? ~0x0 : 0x0; + const GLuint bMask = ctx->Color.ColorMask[BCOMP] ? ~0x0 : 0x0; + const GLuint aMask = ctx->Color.ColorMask[ACOMP] ? ~0x0 : 0x0; + const GLuint (*dst)[4] = (const GLuint (*)[4]) rbPixels; + GLuint (*src)[4] = (GLuint (*)[4]) span->array->color.sz4.rgba; + GLuint i; + for (i = 0; i < n; i++) { + src[i][RCOMP] = (src[i][RCOMP] & rMask) | (dst[i][RCOMP] & ~rMask); + src[i][GCOMP] = (src[i][GCOMP] & gMask) | (dst[i][GCOMP] & ~gMask); + src[i][BCOMP] = (src[i][BCOMP] & bMask) | (dst[i][BCOMP] & ~bMask); + src[i][ACOMP] = (src[i][ACOMP] & aMask) | (dst[i][ACOMP] & ~aMask); + } } -#endif } -/* - * Apply glColorMask to a span of RGBA pixels. +/** + * Apply the index mask to a span of color index values. */ -void -_swrast_mask_rgba_array(GLcontext *ctx, struct gl_renderbuffer *rb, - GLuint n, GLint x, GLint y, GLchan rgba[][4]) -{ - GLchan dest[MAX_WIDTH][4]; - GLuint i; - -#if CHAN_BITS == 8 - - GLuint srcMask = *((GLuint*)ctx->Color.ColorMask); - GLuint dstMask = ~srcMask; - GLuint *rgba32 = (GLuint *) rgba; - GLuint *dest32 = (GLuint *) dest; - - _swrast_read_rgba_span( ctx, rb, n, x, y, dest ); - for (i = 0; i < n; i++) { - rgba32[i] = (rgba32[i] & srcMask) | (dest32[i] & dstMask); - } - -#else - - const GLint rMask = ctx->Color.ColorMask[RCOMP]; - const GLint gMask = ctx->Color.ColorMask[GCOMP]; - const GLint bMask = ctx->Color.ColorMask[BCOMP]; - const GLint aMask = ctx->Color.ColorMask[ACOMP]; - - _swrast_read_rgba_span( ctx, rb, n, x, y, dest ); - for (i = 0; i < n; i++) { - if (!rMask) rgba[i][RCOMP] = dest[i][RCOMP]; - if (!gMask) rgba[i][GCOMP] = dest[i][GCOMP]; - if (!bMask) rgba[i][BCOMP] = dest[i][BCOMP]; - if (!aMask) rgba[i][ACOMP] = dest[i][ACOMP]; - } - -#endif -} - - - void _swrast_mask_ci_span(GLcontext *ctx, struct gl_renderbuffer *rb, - const struct sw_span *span, GLuint index[]) + SWspan *span) { const GLuint srcMask = ctx->Color.IndexMask; const GLuint dstMask = ~srcMask; + GLuint *index = span->array->index; GLuint dest[MAX_WIDTH]; GLuint i; @@ -150,23 +132,3 @@ _swrast_mask_ci_span(GLcontext *ctx, struct gl_renderbuffer *rb, index[i] = (index[i] & srcMask) | (dest[i] & dstMask); } } - - -/* - * Apply glIndexMask to an array of CI pixels. - */ -void -_swrast_mask_ci_array(GLcontext *ctx, struct gl_renderbuffer *rb, - GLuint n, GLint x, GLint y, GLuint index[]) -{ - const GLuint srcMask = ctx->Color.IndexMask; - const GLuint dstMask = ~srcMask; - GLuint dest[MAX_WIDTH]; - GLuint i; - - _swrast_read_index_span(ctx, rb, n, x, y, dest); - - for (i=0;iDriver.GetFragmentProgramRegister(). + */ +void +_swrast_get_program_register(GLcontext *ctx, enum register_file file, + GLuint index, GLfloat val[4]) +{ + if (CurrentMachine) { + switch (file) { + case PROGRAM_INPUT: + COPY_4V(val, CurrentMachine->Inputs[index]); + break; + case PROGRAM_OUTPUT: + COPY_4V(val, CurrentMachine->Outputs[index]); + break; + case PROGRAM_TEMPORARY: + COPY_4V(val, CurrentMachine->Temporaries[index]); + break; + default: + _mesa_problem(NULL, + "bad register file in _swrast_get_program_register"); + } + } +} +#endif /* FEATURE_MESA_program_debug */ + + /** * Fetch a texel. */ @@ -108,40 +156,35 @@ get_register_pointer( GLcontext *ctx, const struct fp_machine *machine, const struct gl_fragment_program *program ) { - const GLfloat *src; switch (source->File) { - case PROGRAM_TEMPORARY: - ASSERT(source->Index < MAX_NV_FRAGMENT_PROGRAM_TEMPS); - src = machine->Temporaries[source->Index]; - break; - case PROGRAM_INPUT: - ASSERT(source->Index < MAX_NV_FRAGMENT_PROGRAM_INPUTS); - src = machine->Inputs[source->Index]; - break; - case PROGRAM_OUTPUT: - /* This is only for PRINT */ - ASSERT(source->Index < MAX_NV_FRAGMENT_PROGRAM_OUTPUTS); - src = machine->Outputs[source->Index]; - break; - case PROGRAM_LOCAL_PARAM: - ASSERT(source->Index < MAX_PROGRAM_LOCAL_PARAMS); - src = program->Base.LocalParams[source->Index]; - break; - case PROGRAM_ENV_PARAM: - ASSERT(source->Index < MAX_NV_FRAGMENT_PROGRAM_PARAMS); - src = ctx->FragmentProgram.Parameters[source->Index]; - break; - case PROGRAM_STATE_VAR: - /* Fallthrough */ - case PROGRAM_NAMED_PARAM: - ASSERT(source->Index < (GLint) program->Base.Parameters->NumParameters); - src = program->Base.Parameters->ParameterValues[source->Index]; - break; - default: - _mesa_problem(ctx, "Invalid input register file %d in fetch_vector4", source->File); - src = NULL; + case PROGRAM_TEMPORARY: + ASSERT(source->Index < MAX_NV_FRAGMENT_PROGRAM_TEMPS); + return machine->Temporaries[source->Index]; + case PROGRAM_INPUT: + ASSERT(source->Index < MAX_NV_FRAGMENT_PROGRAM_INPUTS); + return machine->Inputs[source->Index]; + case PROGRAM_OUTPUT: + /* This is only for PRINT */ + ASSERT(source->Index < MAX_NV_FRAGMENT_PROGRAM_OUTPUTS); + return machine->Outputs[source->Index]; + case PROGRAM_LOCAL_PARAM: + ASSERT(source->Index < MAX_PROGRAM_LOCAL_PARAMS); + return program->Base.LocalParams[source->Index]; + case PROGRAM_ENV_PARAM: + ASSERT(source->Index < MAX_NV_FRAGMENT_PROGRAM_PARAMS); + return ctx->FragmentProgram.Parameters[source->Index]; + case PROGRAM_STATE_VAR: + /* Fallthrough */ + case PROGRAM_CONSTANT: + /* Fallthrough */ + case PROGRAM_NAMED_PARAM: + ASSERT(source->Index < (GLint) program->Base.Parameters->NumParameters); + return program->Base.Parameters->ParameterValues[source->Index]; + default: + _mesa_problem(ctx, "Invalid input register file %d in fp " + "get_register_pointer", source->File); + return NULL; } - return src; } @@ -159,10 +202,17 @@ fetch_vector4( GLcontext *ctx, const GLfloat *src = get_register_pointer(ctx, source, machine, program); ASSERT(src); - result[0] = src[GET_SWZ(source->Swizzle, 0)]; - result[1] = src[GET_SWZ(source->Swizzle, 1)]; - result[2] = src[GET_SWZ(source->Swizzle, 2)]; - result[3] = src[GET_SWZ(source->Swizzle, 3)]; + if (source->Swizzle == MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, + SWIZZLE_Z, SWIZZLE_W)) { + /* no swizzling */ + COPY_4V(result, src); + } + else { + result[0] = src[GET_SWZ(source->Swizzle, 0)]; + result[1] = src[GET_SWZ(source->Swizzle, 1)]; + result[2] = src[GET_SWZ(source->Swizzle, 2)]; + result[3] = src[GET_SWZ(source->Swizzle, 3)]; + } if (source->NegateBase) { result[0] = -result[0]; @@ -193,7 +243,7 @@ fetch_vector4( GLcontext *ctx, static GLboolean fetch_vector4_deriv( GLcontext *ctx, const struct prog_src_register *source, - const struct sw_span *span, + const SWspan *span, char xOrY, GLint column, GLfloat result[4] ) { GLfloat src[4]; @@ -361,7 +411,7 @@ generate_cc( float value ) /** * Test if the ccMaskRule is satisfied by the given condition code. - * Used to mask destination writes according to the current condition codee. + * Used to mask destination writes according to the current condition code. */ static INLINE GLboolean test_cc(GLuint condCode, GLuint ccMaskRule) @@ -391,11 +441,9 @@ store_vector4( const struct prog_instruction *inst, { const struct prog_dst_register *dest = &(inst->DstReg); const GLboolean clamp = inst->SaturateMode == SATURATE_ZERO_ONE; - const GLboolean updateCC = inst->CondUpdate; GLfloat *dstReg; GLfloat dummyReg[4]; GLfloat clampedValue[4]; - GLboolean condWriteMask[4]; GLuint writeMask = dest->WriteMask; switch (dest->File) { @@ -413,7 +461,7 @@ store_vector4( const struct prog_instruction *inst, return; } -#if DEBUG_FRAG +#if 0 if (value[0] > 1.0e10 || IS_INF_OR_NAN(value[0]) || IS_INF_OR_NAN(value[1]) || @@ -431,39 +479,46 @@ store_vector4( const struct prog_instruction *inst, } if (dest->CondMask != COND_TR) { - condWriteMask[0] = GET_BIT(writeMask, 0) - && test_cc(machine->CondCodes[GET_SWZ(dest->CondSwizzle, 0)], dest->CondMask); - condWriteMask[1] = GET_BIT(writeMask, 1) - && test_cc(machine->CondCodes[GET_SWZ(dest->CondSwizzle, 1)], dest->CondMask); - condWriteMask[2] = GET_BIT(writeMask, 2) - && test_cc(machine->CondCodes[GET_SWZ(dest->CondSwizzle, 2)], dest->CondMask); - condWriteMask[3] = GET_BIT(writeMask, 3) - && test_cc(machine->CondCodes[GET_SWZ(dest->CondSwizzle, 3)], dest->CondMask); - - writeMask = ((condWriteMask[0] << 0) | - (condWriteMask[1] << 1) | - (condWriteMask[2] << 2) | - (condWriteMask[3] << 3)); + /* condition codes may turn off some writes */ + if (writeMask & WRITEMASK_X) { + if (!test_cc(machine->CondCodes[GET_SWZ(dest->CondSwizzle, 0)], + dest->CondMask)) + writeMask &= ~WRITEMASK_X; + } + if (writeMask & WRITEMASK_Y) { + if (!test_cc(machine->CondCodes[GET_SWZ(dest->CondSwizzle, 1)], + dest->CondMask)) + writeMask &= ~WRITEMASK_Y; + } + if (writeMask & WRITEMASK_Z) { + if (!test_cc(machine->CondCodes[GET_SWZ(dest->CondSwizzle, 2)], + dest->CondMask)) + writeMask &= ~WRITEMASK_Z; + } + if (writeMask & WRITEMASK_W) { + if (!test_cc(machine->CondCodes[GET_SWZ(dest->CondSwizzle, 3)], + dest->CondMask)) + writeMask &= ~WRITEMASK_W; + } } - if (GET_BIT(writeMask, 0)) { + if (writeMask & WRITEMASK_X) dstReg[0] = value[0]; - if (updateCC) - machine->CondCodes[0] = generate_cc(value[0]); - } - if (GET_BIT(writeMask, 1)) { + if (writeMask & WRITEMASK_Y) dstReg[1] = value[1]; - if (updateCC) - machine->CondCodes[1] = generate_cc(value[1]); - } - if (GET_BIT(writeMask, 2)) { + if (writeMask & WRITEMASK_Z) dstReg[2] = value[2]; - if (updateCC) - machine->CondCodes[2] = generate_cc(value[2]); - } - if (GET_BIT(writeMask, 3)) { + if (writeMask & WRITEMASK_W) dstReg[3] = value[3]; - if (updateCC) + + if (inst->CondUpdate) { + if (writeMask & WRITEMASK_X) + machine->CondCodes[0] = generate_cc(value[0]); + if (writeMask & WRITEMASK_Y) + machine->CondCodes[1] = generate_cc(value[1]); + if (writeMask & WRITEMASK_Z) + machine->CondCodes[2] = generate_cc(value[2]); + if (writeMask & WRITEMASK_W) machine->CondCodes[3] = generate_cc(value[3]); } } @@ -478,7 +533,7 @@ static void init_machine_deriv( GLcontext *ctx, const struct fp_machine *machine, const struct gl_fragment_program *program, - const struct sw_span *span, char xOrY, + const SWspan *span, char xOrY, struct fp_machine *dMachine ) { GLuint u; @@ -589,14 +644,14 @@ init_machine_deriv( GLcontext *ctx, static GLboolean execute_program( GLcontext *ctx, const struct gl_fragment_program *program, GLuint maxInst, - struct fp_machine *machine, const struct sw_span *span, + struct fp_machine *machine, const SWspan *span, GLuint column ) { GLuint pc; -#if DEBUG_FRAG - printf("execute fragment program --------------------\n"); -#endif + if (DEBUG_FRAG) { + printf("execute fragment program --------------------\n"); + } for (pc = 0; pc < maxInst; pc++) { const struct prog_instruction *inst = program->Base.Instructions + pc; @@ -608,6 +663,10 @@ execute_program( GLcontext *ctx, ctx->FragmentProgram.CallbackData); } + if (DEBUG_FRAG) { + _mesa_print_instruction(inst); + } + switch (inst->Opcode) { case OPCODE_ABS: { @@ -630,6 +689,12 @@ execute_program( GLcontext *ctx, result[2] = a[2] + b[2]; result[3] = a[3] + b[3]; store_vector4( inst, machine, result ); + if (DEBUG_FRAG) { + printf("ADD (%g %g %g %g) = (%g %g %g %g) + (%g %g %g %g)\n", + result[0], result[1], result[2], result[3], + a[0], a[1], a[2], a[3], + b[0], b[1], b[2], b[3]); + } } break; case OPCODE_CMP: @@ -649,7 +714,8 @@ execute_program( GLcontext *ctx, { GLfloat a[4], result[4]; fetch_vector1( ctx, &inst->SrcReg[0], machine, program, a ); - result[0] = result[1] = result[2] = result[3] = (GLfloat)_mesa_cos(a[0]); + result[0] = result[1] = result[2] = result[3] + = (GLfloat) _mesa_cos(a[0]); store_vector4( inst, machine, result ); } break; @@ -703,13 +769,12 @@ execute_program( GLcontext *ctx, GLfloat a[4], b[4], result[4]; fetch_vector4( ctx, &inst->SrcReg[0], machine, program, a ); fetch_vector4( ctx, &inst->SrcReg[1], machine, program, b ); - result[0] = result[1] = result[2] = result[3] = - a[0] * b[0] + a[1] * b[1] + a[2] * b[2]; + result[0] = result[1] = result[2] = result[3] = DOT3(a, b); store_vector4( inst, machine, result ); -#if DEBUG_FRAG - printf("DP3 %g = (%g %g %g) . (%g %g %g)\n", - result[0], a[0], a[1], a[2], b[0], b[1], b[2]); -#endif + if (DEBUG_FRAG) { + printf("DP3 %g = (%g %g %g) . (%g %g %g)\n", + result[0], a[0], a[1], a[2], b[0], b[1], b[2]); + } } break; case OPCODE_DP4: @@ -717,13 +782,13 @@ execute_program( GLcontext *ctx, GLfloat a[4], b[4], result[4]; fetch_vector4( ctx, &inst->SrcReg[0], machine, program, a ); fetch_vector4( ctx, &inst->SrcReg[1], machine, program, b ); - result[0] = result[1] = result[2] = result[3] = - a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3]; + result[0] = result[1] = result[2] = result[3] = DOT4(a,b); store_vector4( inst, machine, result ); -#if DEBUG_FRAG - printf("DP4 %g = (%g, %g %g %g) . (%g, %g %g %g)\n", - result[0], a[0], a[1], a[2], a[3], b[0], b[1], b[2], b[3]); -#endif + if (DEBUG_FRAG) { + printf("DP4 %g = (%g, %g %g %g) . (%g, %g %g %g)\n", + result[0], a[0], a[1], a[2], a[3], + b[0], b[1], b[2], b[3]); + } } break; case OPCODE_DPH: @@ -804,8 +869,7 @@ execute_program( GLcontext *ctx, { GLfloat a[4], result[4]; fetch_vector1( ctx, &inst->SrcReg[0], machine, program, a ); - result[0] = result[1] = result[2] = result[3] - = LOG2(a[0]); + result[0] = result[1] = result[2] = result[3] = LOG2(a[0]); store_vector4( inst, machine, result ); } break; @@ -832,6 +896,11 @@ execute_program( GLcontext *ctx, } result[3] = 1.0F; store_vector4( inst, machine, result ); + if (DEBUG_FRAG) { + printf("LIT (%g %g %g %g) : (%g %g %g %g)\n", + result[0], result[1], result[2], result[3], + a[0], a[1], a[2], a[3]); + } } break; case OPCODE_LRP: @@ -845,6 +914,14 @@ execute_program( GLcontext *ctx, result[2] = a[2] * b[2] + (1.0F - a[2]) * c[2]; result[3] = a[3] * b[3] + (1.0F - a[3]) * c[3]; store_vector4( inst, machine, result ); + if (DEBUG_FRAG) { + printf("LRP (%g %g %g %g) = (%g %g %g %g), " + "(%g %g %g %g), (%g %g %g %g)\n", + result[0], result[1], result[2], result[3], + a[0], a[1], a[2], a[3], + b[0], b[1], b[2], b[3], + c[0], c[1], c[2], c[3]); + } } break; case OPCODE_MAD: @@ -858,6 +935,14 @@ execute_program( GLcontext *ctx, result[2] = a[2] * b[2] + c[2]; result[3] = a[3] * b[3] + c[3]; store_vector4( inst, machine, result ); + if (DEBUG_FRAG) { + printf("MAD (%g %g %g %g) = (%g %g %g %g) * " + "(%g %g %g %g) + (%g %g %g %g)\n", + result[0], result[1], result[2], result[3], + a[0], a[1], a[2], a[3], + b[0], b[1], b[2], b[3], + c[0], c[1], c[2], c[3]); + } } break; case OPCODE_MAX: @@ -870,12 +955,12 @@ execute_program( GLcontext *ctx, result[2] = MAX2(a[2], b[2]); result[3] = MAX2(a[3], b[3]); store_vector4( inst, machine, result ); -#if DEBUG_FRAG - printf("MAX (%g %g %g %g) = (%g %g %g %g), (%g %g %g %g)\n", - result[0], result[1], result[2], result[3], - a[0], a[1], a[2], a[3], - b[0], b[1], b[2], b[3]); -#endif + if (DEBUG_FRAG) { + printf("MAX (%g %g %g %g) = (%g %g %g %g), (%g %g %g %g)\n", + result[0], result[1], result[2], result[3], + a[0], a[1], a[2], a[3], + b[0], b[1], b[2], b[3]); + } } break; case OPCODE_MIN: @@ -895,10 +980,10 @@ execute_program( GLcontext *ctx, GLfloat result[4]; fetch_vector4( ctx, &inst->SrcReg[0], machine, program, result ); store_vector4( inst, machine, result ); -#if DEBUG_FRAG - printf("MOV (%g %g %g %g)\n", - result[0], result[1], result[2], result[3]); -#endif + if (DEBUG_FRAG) { + printf("MOV (%g %g %g %g)\n", + result[0], result[1], result[2], result[3]); + } } break; case OPCODE_MUL: @@ -911,12 +996,12 @@ execute_program( GLcontext *ctx, result[2] = a[2] * b[2]; result[3] = a[3] * b[3]; store_vector4( inst, machine, result ); -#if DEBUG_FRAG - printf("MUL (%g %g %g %g) = (%g %g %g %g) * (%g %g %g %g)\n", - result[0], result[1], result[2], result[3], - a[0], a[1], a[2], a[3], - b[0], b[1], b[2], b[3]); -#endif + if (DEBUG_FRAG) { + printf("MUL (%g %g %g %g) = (%g %g %g %g) * (%g %g %g %g)\n", + result[0], result[1], result[2], result[3], + a[0], a[1], a[2], a[3], + b[0], b[1], b[2], b[3]); + } } break; case OPCODE_PK2H: /* pack two 16-bit floats in one 32-bit float */ @@ -998,31 +1083,26 @@ execute_program( GLcontext *ctx, { GLfloat a[4], result[4]; fetch_vector1( ctx, &inst->SrcReg[0], machine, program, a ); -#if DEBUG_FRAG - if (a[0] == 0) - printf("RCP(0)\n"); - else if (IS_INF_OR_NAN(a[0])) - printf("RCP(inf)\n"); -#endif - result[0] = result[1] = result[2] = result[3] - = 1.0F / a[0]; + if (DEBUG_FRAG) { + if (a[0] == 0) + printf("RCP(0)\n"); + else if (IS_INF_OR_NAN(a[0])) + printf("RCP(inf)\n"); + } + result[0] = result[1] = result[2] = result[3] = 1.0F / a[0]; store_vector4( inst, machine, result ); } break; - case OPCODE_RFL: + case OPCODE_RFL: /* reflection vector */ { - GLfloat axis[4], dir[4], result[4], tmp[4]; + GLfloat axis[4], dir[4], result[4], tmpX, tmpW; fetch_vector4( ctx, &inst->SrcReg[0], machine, program, axis ); fetch_vector4( ctx, &inst->SrcReg[1], machine, program, dir ); - tmp[3] = axis[0] * axis[0] - + axis[1] * axis[1] - + axis[2] * axis[2]; - tmp[0] = (2.0F * (axis[0] * dir[0] + - axis[1] * dir[1] + - axis[2] * dir[2])) / tmp[3]; - result[0] = tmp[0] * axis[0] - dir[0]; - result[1] = tmp[0] * axis[1] - dir[1]; - result[2] = tmp[0] * axis[2] - dir[2]; + tmpW = DOT3(axis, axis); + tmpX = (2.0F * DOT3(axis, dir)) / tmpW; + result[0] = tmpX * axis[0] - dir[0]; + result[1] = tmpX * axis[1] - dir[1]; + result[2] = tmpX * axis[2] - dir[2]; /* result[3] is never written! XXX enforce in parser! */ store_vector4( inst, machine, result ); } @@ -1034,9 +1114,9 @@ execute_program( GLcontext *ctx, a[0] = FABSF(a[0]); result[0] = result[1] = result[2] = result[3] = INV_SQRTF(a[0]); store_vector4( inst, machine, result ); -#if DEBUG_FRAG - printf("RSQ %g = 1/sqrt(|%g|)\n", result[0], a[0]); -#endif + if (DEBUG_FRAG) { + printf("RSQ %g = 1/sqrt(|%g|)\n", result[0], a[0]); + } } break; case OPCODE_SCS: /* sine and cos */ @@ -1096,8 +1176,8 @@ execute_program( GLcontext *ctx, { GLfloat a[4], result[4]; fetch_vector1( ctx, &inst->SrcReg[0], machine, program, a ); - result[0] = result[1] = result[2] = - result[3] = (GLfloat)_mesa_sin(a[0]); + result[0] = result[1] = result[2] = result[3] + = (GLfloat) _mesa_sin(a[0]); store_vector4( inst, machine, result ); } break; @@ -1153,25 +1233,31 @@ execute_program( GLcontext *ctx, result[2] = a[2] - b[2]; result[3] = a[3] - b[3]; store_vector4( inst, machine, result ); + if (DEBUG_FRAG) { + printf("SUB (%g %g %g %g) = (%g %g %g %g) - (%g %g %g %g)\n", + result[0], result[1], result[2], result[3], + a[0], a[1], a[2], a[3], b[0], b[1], b[2], b[3]); + } } break; - case OPCODE_SWZ: + case OPCODE_SWZ: /* extended swizzle */ { const struct prog_src_register *source = &inst->SrcReg[0]; const GLfloat *src = get_register_pointer(ctx, source, machine, program); GLfloat result[4]; GLuint i; - - /* do extended swizzling here */ for (i = 0; i < 4; i++) { - if (GET_SWZ(source->Swizzle, i) == SWIZZLE_ZERO) + const GLuint swz = GET_SWZ(source->Swizzle, i); + if (swz == SWIZZLE_ZERO) result[i] = 0.0; - else if (GET_SWZ(source->Swizzle, i) == SWIZZLE_ONE) + else if (swz == SWIZZLE_ONE) result[i] = 1.0; - else - result[i] = src[GET_SWZ(source->Swizzle, i)]; - + else { + ASSERT(swz >= 0); + ASSERT(swz <= 3); + result[i] = src[swz]; + } if (source->NegateBase & (1 << i)) result[i] = -result[i]; } @@ -1181,44 +1267,47 @@ execute_program( GLcontext *ctx, case OPCODE_TEX: /* Both ARB and NV frag prog */ /* Texel lookup */ { - GLfloat texcoord[4], color[4]; - fetch_vector4( ctx, &inst->SrcReg[0], machine, program, texcoord ); - /* Note: we pass 0 for LOD. The ARB extension requires it - * while the NV extension says it's implementation dependant. + /* Note: only use the precomputed lambda value when we're + * sampling texture unit [K] with texcoord[K]. + * Otherwise, the lambda value may have no relation to the + * instruction's texcoord or texture image. Using the wrong + * lambda is usually bad news. + * The rest of the time, just use zero (until we get a more + * sophisticated way of computing lambda). */ - /* KW: Previously lambda was passed as zero, but I - * believe this is incorrect, the spec seems to - * indicate rather that lambda should not be - * changed/biased, unlike TXB where texcoord[3] is - * added to the lambda calculations. The lambda should - * still be calculated normally for TEX & TXP though, - * not set to zero. Otherwise it's very difficult to - * implement normal GL semantics through the fragment - * shader. - */ - fetch_texel( ctx, texcoord, - span->array->lambda[inst->TexSrcUnit][column], - inst->TexSrcUnit, color ); -#if DEBUG_FRAG - if (color[3]) - printf("color[3] = %f\n", color[3]); -#endif + GLfloat coord[4], color[4], lambda; + if (inst->SrcReg[0].File == PROGRAM_INPUT && + inst->SrcReg[0].Index == FRAG_ATTRIB_TEX0+inst->TexSrcUnit) + lambda = span->array->lambda[inst->TexSrcUnit][column]; + else + lambda = 0.0; + fetch_vector4(ctx, &inst->SrcReg[0], machine, program, coord); + fetch_texel( ctx, coord, lambda, inst->TexSrcUnit, color ); + if (DEBUG_FRAG) { + printf("TEX (%g, %g, %g, %g) = texture[%d][%g, %g, %g, %g], " + "lod %f\n", + color[0], color[1], color[2], color[3], + inst->TexSrcUnit, + coord[0], coord[1], coord[2], coord[3], lambda); + } store_vector4( inst, machine, color ); } break; case OPCODE_TXB: /* GL_ARB_fragment_program only */ /* Texel lookup with LOD bias */ { - GLfloat texcoord[4], color[4], bias, lambda; - - fetch_vector4( ctx, &inst->SrcReg[0], machine, program, texcoord ); - /* texcoord[3] is the bias to add to lambda */ + GLfloat coord[4], color[4], lambda, bias; + if (inst->SrcReg[0].File == PROGRAM_INPUT && + inst->SrcReg[0].Index == FRAG_ATTRIB_TEX0+inst->TexSrcUnit) + lambda = span->array->lambda[inst->TexSrcUnit][column]; + else + lambda = 0.0; + fetch_vector4(ctx, &inst->SrcReg[0], machine, program, coord); + /* coord[3] is the bias to add to lambda */ bias = ctx->Texture.Unit[inst->TexSrcUnit].LodBias + ctx->Texture.Unit[inst->TexSrcUnit]._Current->LodBias - + texcoord[3]; - lambda = span->array->lambda[inst->TexSrcUnit][column] + bias; - fetch_texel( ctx, texcoord, lambda, - inst->TexSrcUnit, color ); + + coord[3]; + fetch_texel(ctx, coord, lambda + bias, inst->TexSrcUnit, color); store_vector4( inst, machine, color ); } break; @@ -1237,8 +1326,13 @@ execute_program( GLcontext *ctx, case OPCODE_TXP: /* GL_ARB_fragment_program only */ /* Texture lookup w/ projective divide */ { - GLfloat texcoord[4], color[4]; - fetch_vector4( ctx, &inst->SrcReg[0], machine, program, texcoord ); + GLfloat texcoord[4], color[4], lambda; + if (inst->SrcReg[0].File == PROGRAM_INPUT && + inst->SrcReg[0].Index == FRAG_ATTRIB_TEX0+inst->TexSrcUnit) + lambda = span->array->lambda[inst->TexSrcUnit][column]; + else + lambda = 0.0; + fetch_vector4(ctx, &inst->SrcReg[0], machine, program,texcoord); /* Not so sure about this test - if texcoord[3] is * zero, we'd probably be fine except for an ASSERT in * IROUND_POS() which gets triggered by the inf values created. @@ -1248,34 +1342,27 @@ execute_program( GLcontext *ctx, texcoord[1] /= texcoord[3]; texcoord[2] /= texcoord[3]; } - /* KW: Previously lambda was passed as zero, but I - * believe this is incorrect, the spec seems to - * indicate rather that lambda should not be - * changed/biased, unlike TXB where texcoord[3] is - * added to the lambda calculations. The lambda should - * still be calculated normally for TEX & TXP though, - * not set to zero. - */ - fetch_texel( ctx, texcoord, - span->array->lambda[inst->TexSrcUnit][column], - inst->TexSrcUnit, color ); + fetch_texel( ctx, texcoord, lambda, inst->TexSrcUnit, color ); store_vector4( inst, machine, color ); } break; case OPCODE_TXP_NV: /* GL_NV_fragment_program only */ /* Texture lookup w/ projective divide */ { - GLfloat texcoord[4], color[4]; - fetch_vector4( ctx, &inst->SrcReg[0], machine, program, texcoord ); + GLfloat texcoord[4], color[4], lambda; + if (inst->SrcReg[0].File == PROGRAM_INPUT && + inst->SrcReg[0].Index == FRAG_ATTRIB_TEX0+inst->TexSrcUnit) + lambda = span->array->lambda[inst->TexSrcUnit][column]; + else + lambda = 0.0; + fetch_vector4(ctx, &inst->SrcReg[0], machine, program,texcoord); if (inst->TexSrcTarget != TEXTURE_CUBE_INDEX && texcoord[3] != 0.0) { texcoord[0] /= texcoord[3]; texcoord[1] /= texcoord[3]; texcoord[2] /= texcoord[3]; } - fetch_texel( ctx, texcoord, - span->array->lambda[inst->TexSrcUnit][column], - inst->TexSrcUnit, color ); + fetch_texel( ctx, texcoord, lambda, inst->TexSrcUnit, color ); store_vector4( inst, machine, color ); } break; @@ -1379,10 +1466,19 @@ execute_program( GLcontext *ctx, } +/** + * Initialize the virtual fragment program machine state prior to running + * fragment program on a fragment. This involves initializing the input + * registers, condition codes, etc. + * \param machine the virtual machine state to init + * \param program the fragment program we're about to run + * \param span the span of pixels we'll operate on + * \param col which element (column) of the span we'll operate on + */ static void init_machine( GLcontext *ctx, struct fp_machine *machine, const struct gl_fragment_program *program, - const struct sw_span *span, GLuint col ) + const SWspan *span, GLuint col ) { GLuint inputsRead = program->Base.InputsRead; GLuint u; @@ -1412,19 +1508,14 @@ init_machine( GLcontext *ctx, struct fp_machine *machine, wpos[3] = span->w + col * span->dwdx; } if (inputsRead & (1 << FRAG_ATTRIB_COL0)) { - GLfloat *col0 = machine->Inputs[FRAG_ATTRIB_COL0]; ASSERT(span->arrayMask & SPAN_RGBA); - col0[0] = CHAN_TO_FLOAT(span->array->rgba[col][RCOMP]); - col0[1] = CHAN_TO_FLOAT(span->array->rgba[col][GCOMP]); - col0[2] = CHAN_TO_FLOAT(span->array->rgba[col][BCOMP]); - col0[3] = CHAN_TO_FLOAT(span->array->rgba[col][ACOMP]); + COPY_4V(machine->Inputs[FRAG_ATTRIB_COL0], + span->array->color.sz4.rgba[col]); } if (inputsRead & (1 << FRAG_ATTRIB_COL1)) { - GLfloat *col1 = machine->Inputs[FRAG_ATTRIB_COL1]; - col1[0] = CHAN_TO_FLOAT(span->array->spec[col][RCOMP]); - col1[1] = CHAN_TO_FLOAT(span->array->spec[col][GCOMP]); - col1[2] = CHAN_TO_FLOAT(span->array->spec[col][BCOMP]); - col1[3] = CHAN_TO_FLOAT(span->array->spec[col][ACOMP]); + ASSERT(span->arrayMask & SPAN_SPEC); + COPY_4V(machine->Inputs[FRAG_ATTRIB_COL1], + span->array->color.sz4.spec[col]); } if (inputsRead & (1 << FRAG_ATTRIB_FOGC)) { GLfloat *fogc = machine->Inputs[FRAG_ATTRIB_FOGC]; @@ -1451,56 +1542,66 @@ init_machine( GLcontext *ctx, struct fp_machine *machine, } - /** - * Execute the current fragment program, operating on the given span. + * Run fragment program on the pixels in span from 'start' to 'end' - 1. */ -void -_swrast_exec_fragment_program( GLcontext *ctx, struct sw_span *span ) +static void +run_program(GLcontext *ctx, SWspan *span, GLuint start, GLuint end) { const struct gl_fragment_program *program = ctx->FragmentProgram._Current; + struct fp_machine machine; GLuint i; - ctx->_CurrentProgram = GL_FRAGMENT_PROGRAM_ARB; /* or NV, doesn't matter */ - - if (program->Base.Parameters) { - _mesa_load_state_parameters(ctx, program->Base.Parameters); - } + CurrentMachine = &machine; - for (i = 0; i < span->end; i++) { + for (i = start; i < end; i++) { if (span->array->mask[i]) { - init_machine(ctx, &ctx->FragmentProgram.Machine, - ctx->FragmentProgram._Current, span, i); - - if (!execute_program(ctx, program, ~0, - &ctx->FragmentProgram.Machine, span, i)) { - span->array->mask[i] = GL_FALSE; /* killed fragment */ - span->writeAll = GL_FALSE; - } - - /* Store output registers */ - { - const GLfloat *colOut - = ctx->FragmentProgram.Machine.Outputs[FRAG_RESULT_COLR]; - UNCLAMPED_FLOAT_TO_CHAN(span->array->rgba[i][RCOMP], colOut[0]); - UNCLAMPED_FLOAT_TO_CHAN(span->array->rgba[i][GCOMP], colOut[1]); - UNCLAMPED_FLOAT_TO_CHAN(span->array->rgba[i][BCOMP], colOut[2]); - UNCLAMPED_FLOAT_TO_CHAN(span->array->rgba[i][ACOMP], colOut[3]); + init_machine(ctx, &machine, program, span, i); + + if (execute_program(ctx, program, ~0, &machine, span, i)) { + /* Store result color */ + COPY_4V(span->array->color.sz4.rgba[i], + machine.Outputs[FRAG_RESULT_COLR]); + + /* Store result depth/z */ + if (program->Base.OutputsWritten & (1 << FRAG_RESULT_DEPR)) { + const GLfloat depth = machine.Outputs[FRAG_RESULT_DEPR][2]; + if (depth <= 0.0) + span->array->z[i] = 0; + else if (depth >= 1.0) + span->array->z[i] = ctx->DrawBuffer->_DepthMax; + else + span->array->z[i] = IROUND(depth * ctx->DrawBuffer->_DepthMaxF); + } } - /* depth value */ - if (program->Base.OutputsWritten & (1 << FRAG_RESULT_DEPR)) { - const GLfloat depth - = ctx->FragmentProgram.Machine.Outputs[FRAG_RESULT_DEPR][2]; - if (depth <= 0.0) - span->array->z[i] = 0; - else if (depth >= 1.0) - span->array->z[i] = ctx->DrawBuffer->_DepthMax; - else - span->array->z[i] = IROUND(depth * ctx->DrawBuffer->_DepthMaxF); + else { + /* killed fragment */ + span->array->mask[i] = GL_FALSE; + span->writeAll = GL_FALSE; } } } + CurrentMachine = NULL; +} + + +/** + * Execute the current fragment program for all the fragments + * in the given span. + */ +void +_swrast_exec_fragment_program( GLcontext *ctx, SWspan *span ) +{ + const struct gl_fragment_program *program = ctx->FragmentProgram._Current; + + /* incoming colors should be floats */ + ASSERT(span->array->ChanType == GL_FLOAT); + + ctx->_CurrentProgram = GL_FRAGMENT_PROGRAM_ARB; /* or NV, doesn't matter */ + + run_program(ctx, span, 0, span->end); + if (program->Base.OutputsWritten & (1 << FRAG_RESULT_DEPR)) { span->interpMask &= ~SPAN_Z; span->arrayMask |= SPAN_Z; diff --git a/src/mesa/swrast/s_nvfragprog.h b/src/mesa/swrast/s_nvfragprog.h index ac5a15fe9bc..188bacc3d89 100644 --- a/src/mesa/swrast/s_nvfragprog.h +++ b/src/mesa/swrast/s_nvfragprog.h @@ -31,7 +31,7 @@ extern void -_swrast_exec_fragment_program( GLcontext *ctx, struct sw_span *span ); +_swrast_exec_fragment_program( GLcontext *ctx, SWspan *span ); #endif diff --git a/src/mesa/swrast/s_pointtemp.h b/src/mesa/swrast/s_pointtemp.h index 4ce261009c0..6316833a686 100644 --- a/src/mesa/swrast/s_pointtemp.h +++ b/src/mesa/swrast/s_pointtemp.h @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.5 + * Version: 6.5.2 * - * Copyright (C) 1999-2005 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2006 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"), @@ -92,7 +92,7 @@ NAME ( GLcontext *ctx, const SWvertex *vert ) GLuint u; #endif SWcontext *swrast = SWRAST_CONTEXT(ctx); - struct sw_span *span = &(swrast->PointSpan); + SWspan *span = &(swrast->PointSpan); /* Cull primitives with malformed coordinates. */ @@ -119,7 +119,7 @@ NAME ( GLcontext *ctx, const SWvertex *vert ) span->arrayMask |= SPAN_INDEX; #endif #if FLAGS & TEXTURE - span->arrayMask |= SPAN_TEXTURE; + span->arrayMask |= (SPAN_TEXTURE | SPAN_LAMBDA); if (ctx->FragmentProgram._Active) { /* Don't divide texture s,t,r by q (use TXP to do that) */ for (u = 0; u < ctx->Const.MaxTextureUnits; u++) { @@ -150,7 +150,7 @@ NAME ( GLcontext *ctx, const SWvertex *vert ) span->arrayMask |= SPAN_COVERAGE; #endif #if FLAGS & SPRITE - span->arrayMask |= SPAN_TEXTURE; + span->arrayMask |= (SPAN_TEXTURE | SPAN_LAMBDA); #endif /* Compute point size if not known to be one */ @@ -232,12 +232,14 @@ NAME ( GLcontext *ctx, const SWvertex *vert ) /* check if we need to flush */ if (span->end + (xmax-xmin+1) * (ymax-ymin+1) >= MAX_WIDTH || (swrast->_RasterMask & (BLEND_BIT | LOGIC_OP_BIT | MASKING_BIT))) { + if (span->end > 0) { #if FLAGS & RGBA - _swrast_write_rgba_span(ctx, span); + _swrast_write_rgba_span(ctx, span); #else - _swrast_write_index_span(ctx, span); + _swrast_write_index_span(ctx, span); #endif - span->end = 0; + span->end = 0; + } } /* @@ -279,6 +281,7 @@ NAME ( GLcontext *ctx, const SWvertex *vert ) for (u = 0; u < ctx->Const.MaxTextureUnits; u++) { if (ctx->Texture._EnabledCoordUnits & (1 << u)) { COPY_4V(span->array->texcoords[u][count], texcoord[u]); + span->array->lambda[u][count] = 0.0; } } #endif @@ -343,6 +346,7 @@ NAME ( GLcontext *ctx, const SWvertex *vert ) span->array->texcoords[u][count][1] = t; span->array->texcoords[u][count][2] = r; span->array->texcoords[u][count][3] = 1.0F; + span->array->lambda[u][count] = 0.0; /* XXX fix? */ } else { COPY_4V(span->array->texcoords[u][count], vert->texcoord[u]); diff --git a/src/mesa/swrast/s_readpix.c b/src/mesa/swrast/s_readpix.c index 4c3be5a83f4..128ce0afb33 100644 --- a/src/mesa/swrast/s_readpix.c +++ b/src/mesa/swrast/s_readpix.c @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.5 + * Version: 6.5.2 * * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. * @@ -193,79 +193,107 @@ read_stencil_pixels( GLcontext *ctx, /** - * Optimized glReadPixels for particular pixel formats: - * GL_UNSIGNED_BYTE, GL_RGBA - * when pixel scaling, biasing and mapping are disabled. + * Optimized glReadPixels for particular pixel formats when pixel + * scaling, biasing, mapping, etc. are disabled. */ static GLboolean -read_fast_rgba_pixels( GLcontext *ctx, +fast_read_rgba_pixels( GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels, - const struct gl_pixelstore_attrib *packing ) + const struct gl_pixelstore_attrib *packing, + GLbitfield transferOps) { struct gl_renderbuffer *rb = ctx->ReadBuffer->_ColorReadBuffer; - /* can't do scale, bias, mapping, etc */ - if (ctx->_ImageTransferState) - return GL_FALSE; + ASSERT(rb->_BaseFormat == GL_RGBA || rb->_BaseFormat == GL_RGB); - /* can't do fancy pixel packing */ - if (packing->Alignment != 1 || packing->SwapBytes || packing->LsbFirst) + /* clipping should have already been done */ + ASSERT(x + width <= rb->Width); + ASSERT(y + height <= rb->Height); + + /* check for things we can't handle here */ + if (transferOps || + packing->SwapBytes || + packing->LsbFirst) { return GL_FALSE; + } - { - GLint srcX = x; - GLint srcY = y; - GLint readWidth = width; /* actual width read */ - GLint readHeight = height; /* actual height read */ - GLint skipPixels = packing->SkipPixels; - GLint skipRows = packing->SkipRows; - GLint rowLength; - - if (packing->RowLength > 0) - rowLength = packing->RowLength; - else - rowLength = width; - - /* - * Ready to read! - * The window region at (destX, destY) of size (readWidth, readHeight) - * will be read back. - * We'll write pixel data to buffer pointed to by "pixels" but we'll - * skip "skipRows" rows and skip "skipPixels" pixels/row. - */ -#if CHAN_BITS == 8 - if (format == GL_RGBA && type == GL_UNSIGNED_BYTE) -#elif CHAN_BITS == 16 - if (format == GL_RGBA && type == GL_UNSIGNED_SHORT) -#else - if (0) -#endif - { - GLchan *dest = (GLchan *) pixels - + (skipRows * rowLength + skipPixels) * 4; - GLint row; - - if (packing->Invert) { - /* start at top and go down */ - dest += (readHeight - 1) * rowLength * 4; - rowLength = -rowLength; - } + if (format == GL_RGBA && rb->DataType == type) { + const GLint dstStride = _mesa_image_row_stride(packing, width, + format, type); + GLubyte *dest = _mesa_image_address2d(packing, pixels, width, height, + format, type, 0, 0); + GLint row; + ASSERT(rb->GetRow); + for (row = 0; row < height; row++) { + rb->GetRow(ctx, rb, width, x, y + row, dest); + dest += dstStride; + } + return GL_TRUE; + } - ASSERT(rb->GetRow); - for (row=0; rowGetRow(ctx, rb, readWidth, srcX, srcY, dest); - dest += rowLength * 4; - srcY++; + if (format == GL_RGB && + rb->DataType == GL_UNSIGNED_BYTE && + type == GL_UNSIGNED_BYTE) { + const GLint dstStride = _mesa_image_row_stride(packing, width, + format, type); + GLubyte *dest = _mesa_image_address2d(packing, pixels, width, height, + format, type, 0, 0); + GLint row; + ASSERT(rb->GetRow); + for (row = 0; row < height; row++) { + GLubyte tempRow[MAX_WIDTH][4]; + GLint col; + rb->GetRow(ctx, rb, width, x, y + row, tempRow); + /* convert RGBA to RGB */ + for (col = 0; col < width; col++) { + dest[col * 3 + 0] = tempRow[col][0]; + dest[col * 3 + 1] = tempRow[col][1]; + dest[col * 3 + 2] = tempRow[col][2]; } - return GL_TRUE; - } - else { - /* can't do this format/type combination */ - return GL_FALSE; + dest += dstStride; } + return GL_TRUE; + } + + /* not handled */ + return GL_FALSE; +} + + +/** + * When we're using a low-precision color buffer (like 16-bit 5/6/5) + * we have to adjust our color values a bit to pass conformance. + * The problem is when a 5 or 6-bit color value is convert to an 8-bit + * value and then a floating point value, the floating point values don't + * increment uniformly as the 5 or 6-bit value is incremented. + * + * This function adjusts floating point values to compensate. + */ +static void +adjust_colors(GLcontext *ctx, GLuint n, GLfloat rgba[][4]) +{ + const GLuint rShift = 8 - ctx->Visual.redBits; + const GLuint gShift = 8 - ctx->Visual.greenBits; + const GLuint bShift = 8 - ctx->Visual.blueBits; + const GLfloat rScale = 1.0F / (GLfloat) ((1 << ctx->Visual.redBits ) - 1); + const GLfloat gScale = 1.0F / (GLfloat) ((1 << ctx->Visual.greenBits) - 1); + const GLfloat bScale = 1.0F / (GLfloat) ((1 << ctx->Visual.blueBits ) - 1); + GLuint i; + for (i = 0; i < n; i++) { + GLint r, g, b; + /* convert float back to ubyte */ + CLAMPED_FLOAT_TO_UBYTE(r, rgba[i][RCOMP]); + CLAMPED_FLOAT_TO_UBYTE(g, rgba[i][GCOMP]); + CLAMPED_FLOAT_TO_UBYTE(b, rgba[i][BCOMP]); + /* using only the N most significant bits of the ubyte value, convert to + * float in [0,1]. + */ + rgba[i][RCOMP] = (GLfloat) (r >> rShift) * rScale; + rgba[i][GCOMP] = (GLfloat) (g >> gShift) * gScale; + rgba[i][BCOMP] = (GLfloat) (b >> bShift) * bScale; } } @@ -281,14 +309,21 @@ read_rgba_pixels( GLcontext *ctx, GLenum format, GLenum type, GLvoid *pixels, const struct gl_pixelstore_attrib *packing ) { + SWcontext *swrast = SWRAST_CONTEXT(ctx); + GLbitfield transferOps = ctx->_ImageTransferState; struct gl_framebuffer *fb = ctx->ReadBuffer; struct gl_renderbuffer *rb = fb->_ColorReadBuffer; ASSERT(rb); + if (type == GL_FLOAT && ((ctx->Color.ClampReadColor == GL_TRUE) || + (ctx->Color.ClampReadColor == GL_FIXED_ONLY_ARB && + rb->DataType != GL_FLOAT))) + transferOps |= IMAGE_CLAMP_BIT; + /* Try optimized path first */ - if (read_fast_rgba_pixels( ctx, x, y, width, height, - format, type, pixels, packing )) { + if (fast_read_rgba_pixels(ctx, x, y, width, height, + format, type, pixels, packing, transferOps)) { return; /* done! */ } @@ -296,7 +331,6 @@ read_rgba_pixels( GLcontext *ctx, ASSERT(width <= MAX_WIDTH); if (ctx->Pixel.Convolution2DEnabled || ctx->Pixel.Separable2DEnabled) { - const GLuint transferOps = ctx->_ImageTransferState; GLfloat *dest, *src, *tmpImage, *convImage; GLint row; @@ -315,22 +349,21 @@ read_rgba_pixels( GLcontext *ctx, /* read full RGBA, FLOAT image */ dest = tmpImage; for (row = 0; row < height; row++, y++) { - GLchan rgba[MAX_WIDTH][4]; if (fb->Visual.rgbMode) { - _swrast_read_rgba_span(ctx, rb, width, x, y, rgba); + _swrast_read_rgba_span(ctx, rb, width, x, y, GL_FLOAT, dest); } else { GLuint index[MAX_WIDTH]; ASSERT(rb->DataType == GL_UNSIGNED_INT); rb->GetRow(ctx, rb, width, x, y, index); - if (ctx->Pixel.IndexShift != 0 || ctx->Pixel.IndexOffset !=0 ) { - _mesa_map_ci(ctx, width, index); - } - _mesa_map_ci_to_rgba_chan(ctx, width, index, rgba); + _mesa_apply_ci_transfer_ops(ctx, + transferOps & IMAGE_SHIFT_OFFSET_BIT, + width, index); + _mesa_map_ci_to_rgba(ctx, width, index, (GLfloat (*)[4]) dest); } - _mesa_pack_rgba_span_chan(ctx, width, (const GLchan (*)[4]) rgba, - GL_RGBA, GL_FLOAT, dest, &ctx->DefaultPacking, - transferOps & IMAGE_PRE_CONVOLUTION_BITS); + _mesa_apply_rgba_transfer_ops(ctx, + transferOps & IMAGE_PRE_CONVOLUTION_BITS, + width, (GLfloat (*)[4]) dest); dest += width * 4; } @@ -350,8 +383,7 @@ read_rgba_pixels( GLcontext *ctx, GLvoid *dest; dest = _mesa_image_address2d(packing, pixels, width, height, format, type, row, 0); - _mesa_pack_rgba_span_float(ctx, width, - (const GLfloat (*)[4]) src, + _mesa_pack_rgba_span_float(ctx, width, (GLfloat (*)[4]) src, format, type, dest, packing, transferOps & IMAGE_POST_CONVOLUTION_BITS); src += width * 4; @@ -360,45 +392,42 @@ read_rgba_pixels( GLcontext *ctx, } else { /* no convolution */ + const GLint dstStride + = _mesa_image_row_stride(packing, width, format, type); + GLfloat (*rgba)[4] = swrast->SpanArrays->color.sz4.rgba; GLint row; + GLubyte *dst = _mesa_image_address2d(packing, pixels, width, height, + format, type, 0, 0); + for (row = 0; row < height; row++, y++) { - GLchan rgba[MAX_WIDTH][4]; - GLvoid *dst; + + /* Get float rgba pixels */ if (fb->Visual.rgbMode) { - _swrast_read_rgba_span(ctx, rb, width, x, y, rgba); + _swrast_read_rgba_span(ctx, rb, width, x, y, GL_FLOAT, rgba); } else { + /* read CI and convert to RGBA */ GLuint index[MAX_WIDTH]; ASSERT(rb->DataType == GL_UNSIGNED_INT); rb->GetRow(ctx, rb, width, x, y, index); - if (ctx->Pixel.IndexShift != 0 || ctx->Pixel.IndexOffset != 0) { - _mesa_map_ci(ctx, width, index); - } - _mesa_map_ci_to_rgba_chan(ctx, width, index, rgba); + _mesa_apply_ci_transfer_ops(ctx, + transferOps & IMAGE_SHIFT_OFFSET_BIT, + width, index); + _mesa_map_ci_to_rgba(ctx, width, index, rgba); } - dst = _mesa_image_address2d(packing, pixels, width, height, - format, type, row, 0); - if (fb->Visual.redBits < CHAN_BITS || - fb->Visual.greenBits < CHAN_BITS || - fb->Visual.blueBits < CHAN_BITS) { - /* Requantize the color values into floating point and go from - * there. This fixes conformance failures with 5/6/5 color - * buffers, for example. - */ - GLfloat rgbaf[MAX_WIDTH][4]; - _mesa_chan_to_float_span(ctx, width, - (CONST GLchan (*)[4]) rgba, rgbaf); - _mesa_pack_rgba_span_float(ctx, width, - (CONST GLfloat (*)[4]) rgbaf, - format, type, dst, packing, - ctx->_ImageTransferState); - } - else { - /* GLubytes are fine */ - _mesa_pack_rgba_span_chan(ctx, width, (CONST GLchan (*)[4]) rgba, - format, type, dst, packing, - ctx->_ImageTransferState); + + /* apply fudge factor for shallow color buffers */ + if (fb->Visual.redBits < 8 || + fb->Visual.greenBits < 8 || + fb->Visual.blueBits < 8) { + adjust_colors(ctx, width, rgba); } + + /* pack the row of RGBA pixels into user's buffer */ + _mesa_pack_rgba_span_float(ctx, width, rgba, format, type, dst, + packing, transferOps); + + dst += dstStride; } } } @@ -525,7 +554,7 @@ _swrast_ReadPixels( GLcontext *ctx, /* Do all needed clipping here, so that we can forget about it later */ if (!_mesa_clip_readpixels(ctx, &x, &y, &width, &height, &clippedPacking)) { /* The ReadPixels region is totally outside the window bounds */ - return; + goto end; } if (clippedPacking.BufferObj->Name) { diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c index d1431054162..c74b98facfb 100644 --- a/src/mesa/swrast/s_span.c +++ b/src/mesa/swrast/s_span.c @@ -35,6 +35,7 @@ #include "context.h" #include "macros.h" #include "imports.h" +#include "image.h" #include "s_atifragshader.h" #include "s_alpha.h" @@ -56,7 +57,7 @@ * Used during setup for glDraw/CopyPixels. */ void -_swrast_span_default_z( GLcontext *ctx, struct sw_span *span ) +_swrast_span_default_z( GLcontext *ctx, SWspan *span ) { const GLfloat depthMax = ctx->DrawBuffer->_DepthMaxF; if (ctx->DrawBuffer->Visual.depthBits <= 16) @@ -73,7 +74,7 @@ _swrast_span_default_z( GLcontext *ctx, struct sw_span *span ) * Used during setup for glDraw/CopyPixels. */ void -_swrast_span_default_fog( GLcontext *ctx, struct sw_span *span ) +_swrast_span_default_fog( GLcontext *ctx, SWspan *span ) { span->fog = _swrast_z_to_fogfactor(ctx, ctx->Current.RasterDistance); span->fogStep = span->dfogdx = span->dfogdy = 0.0F; @@ -86,7 +87,7 @@ _swrast_span_default_fog( GLcontext *ctx, struct sw_span *span ) * Used during setup for glDraw/CopyPixels. */ void -_swrast_span_default_color( GLcontext *ctx, struct sw_span *span ) +_swrast_span_default_color( GLcontext *ctx, SWspan *span ) { if (ctx->Visual.rgbMode) { GLchan r, g, b, a; @@ -124,12 +125,12 @@ _swrast_span_default_color( GLcontext *ctx, struct sw_span *span ) * Used during setup for glDraw/CopyPixels. */ void -_swrast_span_default_texcoords( GLcontext *ctx, struct sw_span *span ) +_swrast_span_default_texcoords( GLcontext *ctx, SWspan *span ) { GLuint i; for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) { const GLfloat *tc = ctx->Current.RasterTexCoords[i]; - if (ctx->FragmentProgram._Active || ctx->ATIFragmentShader._Enabled) { + if (ctx->FragmentProgram._Enabled || ctx->ATIFragmentShader._Enabled) { COPY_4V(span->tex[i], tc); } else if (tc[3] > 0.0F) { @@ -149,68 +150,254 @@ _swrast_span_default_texcoords( GLcontext *ctx, struct sw_span *span ) } -/* Fill in the span.color.rgba array from the interpolation values */ -static void -interpolate_colors(GLcontext *ctx, struct sw_span *span) +/** + * Interpolate primary colors to fill in the span->array->color array. + */ +static INLINE void +interpolate_colors(SWspan *span) { const GLuint n = span->end; - GLchan (*rgba)[4] = span->array->rgba; GLuint i; - (void) ctx; ASSERT((span->interpMask & SPAN_RGBA) && - !(span->arrayMask & SPAN_RGBA)); - - if (span->interpMask & SPAN_FLAT) { - /* constant color */ - GLchan color[4]; - color[RCOMP] = FixedToChan(span->red); - color[GCOMP] = FixedToChan(span->green); - color[BCOMP] = FixedToChan(span->blue); - color[ACOMP] = FixedToChan(span->alpha); - for (i = 0; i < n; i++) { - COPY_CHAN4(span->array->rgba[i], color); + !(span->arrayMask & SPAN_RGBA)); + + switch (span->array->ChanType) { +#if CHAN_BITS != 32 + case GL_UNSIGNED_BYTE: + { + GLubyte (*rgba)[4] = span->array->color.sz1.rgba; + if (span->interpMask & SPAN_FLAT) { + GLubyte color[4]; + color[RCOMP] = FixedToInt(span->red); + color[GCOMP] = FixedToInt(span->green); + color[BCOMP] = FixedToInt(span->blue); + color[ACOMP] = FixedToInt(span->alpha); + for (i = 0; i < n; i++) { + COPY_4UBV(rgba[i], color); + } + } + else { + GLfixed r = span->red; + GLfixed g = span->green; + GLfixed b = span->blue; + GLfixed a = span->alpha; + GLint dr = span->redStep; + GLint dg = span->greenStep; + GLint db = span->blueStep; + GLint da = span->alphaStep; + for (i = 0; i < n; i++) { + rgba[i][RCOMP] = FixedToChan(r); + rgba[i][GCOMP] = FixedToChan(g); + rgba[i][BCOMP] = FixedToChan(b); + rgba[i][ACOMP] = FixedToChan(a); + r += dr; + g += dg; + b += db; + a += da; + } + } + } + break; + case GL_UNSIGNED_SHORT: + { + GLushort (*rgba)[4] = span->array->color.sz2.rgba; + if (span->interpMask & SPAN_FLAT) { + GLushort color[4]; + color[RCOMP] = FixedToInt(span->red); + color[GCOMP] = FixedToInt(span->green); + color[BCOMP] = FixedToInt(span->blue); + color[ACOMP] = FixedToInt(span->alpha); + for (i = 0; i < n; i++) { + COPY_4V(rgba[i], color); + } + } + else { + GLushort (*rgba)[4] = span->array->color.sz2.rgba; + GLfixed r, g, b, a; + GLint dr, dg, db, da; + r = span->red; + g = span->green; + b = span->blue; + a = span->alpha; + dr = span->redStep; + dg = span->greenStep; + db = span->blueStep; + da = span->alphaStep; + for (i = 0; i < n; i++) { + rgba[i][RCOMP] = FixedToChan(r); + rgba[i][GCOMP] = FixedToChan(g); + rgba[i][BCOMP] = FixedToChan(b); + rgba[i][ACOMP] = FixedToChan(a); + r += dr; + g += dg; + b += db; + a += da; + } + } + } + break; +#endif + case GL_FLOAT: + { + GLfloat (*rgba)[4] = span->array->color.sz4.rgba; + GLfloat r, g, b, a, dr, dg, db, da; + r = span->red; + g = span->green; + b = span->blue; + a = span->alpha; + if (span->interpMask & SPAN_FLAT) { + dr = dg = db = da = 0.0; + } + else { + dr = span->redStep; + dg = span->greenStep; + db = span->blueStep; + da = span->alphaStep; + } + for (i = 0; i < n; i++) { + rgba[i][RCOMP] = r; + rgba[i][GCOMP] = g; + rgba[i][BCOMP] = b; + rgba[i][ACOMP] = a; + r += dr; + g += dg; + b += db; + a += da; + } } + break; + default: + _mesa_problem(NULL, "bad datatype in interpolate_colors"); } - else { - /* interpolate */ -#if CHAN_TYPE == GL_FLOAT - GLfloat r = span->red; - GLfloat g = span->green; - GLfloat b = span->blue; - GLfloat a = span->alpha; - const GLfloat dr = span->redStep; - const GLfloat dg = span->greenStep; - const GLfloat db = span->blueStep; - const GLfloat da = span->alphaStep; + span->arrayMask |= SPAN_RGBA; +} + + +/** + * Interpolate specular/secondary colors. + */ +static INLINE void +interpolate_specular(SWspan *span) +{ + const GLuint n = span->end; + GLuint i; + + switch (span->array->ChanType) { +#if CHAN_BITS != 32 + case GL_UNSIGNED_BYTE: + { + GLubyte (*spec)[4] = span->array->color.sz1.spec; + if (span->interpMask & SPAN_FLAT) { + GLubyte color[4]; + color[RCOMP] = FixedToInt(span->specRed); + color[GCOMP] = FixedToInt(span->specGreen); + color[BCOMP] = FixedToInt(span->specBlue); + color[ACOMP] = 0; + for (i = 0; i < n; i++) { + COPY_4UBV(spec[i], color); + } + } + else { + GLfixed r = span->specRed; + GLfixed g = span->specGreen; + GLfixed b = span->specBlue; + GLint dr = span->specRedStep; + GLint dg = span->specGreenStep; + GLint db = span->specBlueStep; + for (i = 0; i < n; i++) { + spec[i][RCOMP] = CLAMP(FixedToChan(r), 0, 255); + spec[i][GCOMP] = CLAMP(FixedToChan(g), 0, 255); + spec[i][BCOMP] = CLAMP(FixedToChan(b), 0, 255); + spec[i][ACOMP] = 0; + r += dr; + g += dg; + b += db; + } + } + } + break; + case GL_UNSIGNED_SHORT: + { + GLushort (*spec)[4] = span->array->color.sz2.spec; + if (span->interpMask & SPAN_FLAT) { + GLushort color[4]; + color[RCOMP] = FixedToInt(span->specRed); + color[GCOMP] = FixedToInt(span->specGreen); + color[BCOMP] = FixedToInt(span->specBlue); + color[ACOMP] = 0; + for (i = 0; i < n; i++) { + COPY_4V(spec[i], color); + } + } + else { + GLfixed r = FloatToFixed(span->specRed); + GLfixed g = FloatToFixed(span->specGreen); + GLfixed b = FloatToFixed(span->specBlue); + GLint dr = FloatToFixed(span->specRedStep); + GLint dg = FloatToFixed(span->specGreenStep); + GLint db = FloatToFixed(span->specBlueStep); + for (i = 0; i < n; i++) { + spec[i][RCOMP] = FixedToInt(r); + spec[i][GCOMP] = FixedToInt(g); + spec[i][BCOMP] = FixedToInt(b); + spec[i][ACOMP] = 0; + r += dr; + g += dg; + b += db; + } + } + } + break; +#endif + case GL_FLOAT: + { + GLfloat (*spec)[4] = span->array->color.sz4.spec; +#if CHAN_BITS <= 16 + GLfloat r = CHAN_TO_FLOAT(FixedToChan(span->specRed)); + GLfloat g = CHAN_TO_FLOAT(FixedToChan(span->specGreen)); + GLfloat b = CHAN_TO_FLOAT(FixedToChan(span->specBlue)); #else - GLfixed r = span->red; - GLfixed g = span->green; - GLfixed b = span->blue; - GLfixed a = span->alpha; - const GLint dr = span->redStep; - const GLint dg = span->greenStep; - const GLint db = span->blueStep; - const GLint da = span->alphaStep; + GLfloat r = span->specRed; + GLfloat g = span->specGreen; + GLfloat b = span->specBlue; #endif - for (i = 0; i < n; i++) { - rgba[i][RCOMP] = FixedToChan(r); - rgba[i][GCOMP] = FixedToChan(g); - rgba[i][BCOMP] = FixedToChan(b); - rgba[i][ACOMP] = FixedToChan(a); - r += dr; - g += dg; - b += db; - a += da; + GLfloat dr, dg, db; + if (span->interpMask & SPAN_FLAT) { + dr = dg = db = 0.0; + } + else { +#if CHAN_BITS <= 16 + dr = CHAN_TO_FLOAT(FixedToChan(span->specRedStep)); + dg = CHAN_TO_FLOAT(FixedToChan(span->specGreenStep)); + db = CHAN_TO_FLOAT(FixedToChan(span->specBlueStep)); +#else + dr = span->specRedStep; + dg = span->specGreenStep; + db = span->specBlueStep; +#endif + } + for (i = 0; i < n; i++) { + spec[i][RCOMP] = r; + spec[i][GCOMP] = g; + spec[i][BCOMP] = b; + spec[i][ACOMP] = 0.0F; + r += dr; + g += dg; + b += db; + } } + break; + default: + _mesa_problem(NULL, "bad datatype in interpolate_specular"); } - span->arrayMask |= SPAN_RGBA; + span->arrayMask |= SPAN_SPEC; } /* Fill in the span.color.index array from the interpolation values */ -static void -interpolate_indexes(GLcontext *ctx, struct sw_span *span) +static INLINE void +interpolate_indexes(GLcontext *ctx, SWspan *span) { GLfixed index = span->index; const GLint indexStep = span->indexStep; @@ -240,51 +427,9 @@ interpolate_indexes(GLcontext *ctx, struct sw_span *span) } -/* Fill in the span.->array->spec array from the interpolation values */ -static void -interpolate_specular(GLcontext *ctx, struct sw_span *span) -{ - (void) ctx; - if (span->interpMask & SPAN_FLAT) { - /* constant color */ - const GLchan r = FixedToChan(span->specRed); - const GLchan g = FixedToChan(span->specGreen); - const GLchan b = FixedToChan(span->specBlue); - GLuint i; - for (i = 0; i < span->end; i++) { - span->array->spec[i][RCOMP] = r; - span->array->spec[i][GCOMP] = g; - span->array->spec[i][BCOMP] = b; - } - } - else { - /* interpolate */ -#if CHAN_TYPE == GL_FLOAT - GLfloat r = span->specRed; - GLfloat g = span->specGreen; - GLfloat b = span->specBlue; -#else - GLfixed r = span->specRed; - GLfixed g = span->specGreen; - GLfixed b = span->specBlue; -#endif - GLuint i; - for (i = 0; i < span->end; i++) { - span->array->spec[i][RCOMP] = FixedToChan(r); - span->array->spec[i][GCOMP] = FixedToChan(g); - span->array->spec[i][BCOMP] = FixedToChan(b); - r += span->specRedStep; - g += span->specGreenStep; - b += span->specBlueStep; - } - } - span->arrayMask |= SPAN_SPEC; -} - - /* Fill in the span.array.fog values from the interpolation values */ -static void -interpolate_fog(const GLcontext *ctx, struct sw_span *span) +static INLINE void +interpolate_fog(const GLcontext *ctx, SWspan *span) { GLfloat *fog = span->array->fog; const GLfloat fogStep = span->fogStep; @@ -304,7 +449,7 @@ interpolate_fog(const GLcontext *ctx, struct sw_span *span) /* Fill in the span.zArray array from the interpolation values */ void -_swrast_span_interpolate_z( const GLcontext *ctx, struct sw_span *span ) +_swrast_span_interpolate_z( const GLcontext *ctx, SWspan *span ) { const GLuint n = span->end; GLuint i; @@ -392,7 +537,7 @@ _swrast_compute_lambda(GLfloat dsdx, GLfloat dsdy, GLfloat dtdx, GLfloat dtdy, * or user-written code. */ static void -interpolate_texcoords(GLcontext *ctx, struct sw_span *span) +interpolate_texcoords(GLcontext *ctx, SWspan *span) { ASSERT(span->interpMask & SPAN_TEXTURE); ASSERT(!(span->arrayMask & SPAN_TEXTURE)); @@ -410,7 +555,7 @@ interpolate_texcoords(GLcontext *ctx, struct sw_span *span) if (obj) { const struct gl_texture_image *img = obj->Image[0][obj->BaseLevel]; needLambda = (obj->MinFilter != obj->MagFilter) - || ctx->FragmentProgram._Active; + || ctx->FragmentProgram._Enabled; texW = img->WidthScale; texH = img->HeightScale; } @@ -435,7 +580,7 @@ interpolate_texcoords(GLcontext *ctx, struct sw_span *span) GLfloat r = span->tex[u][2]; GLfloat q = span->tex[u][3]; GLuint i; - if (ctx->FragmentProgram._Active || ctx->ATIFragmentShader._Enabled || + if (ctx->FragmentProgram._Enabled || ctx->ATIFragmentShader._Enabled || ctx->ShaderObjects._FragmentShaderPresent) { /* do perspective correction but don't divide s, t, r by q */ const GLfloat dwdx = span->dwdx; @@ -487,7 +632,7 @@ interpolate_texcoords(GLcontext *ctx, struct sw_span *span) GLfloat r = span->tex[u][2]; GLfloat q = span->tex[u][3]; GLuint i; - if (ctx->FragmentProgram._Active || ctx->ATIFragmentShader._Enabled || + if (ctx->FragmentProgram._Enabled || ctx->ATIFragmentShader._Enabled || ctx->ShaderObjects._FragmentShaderPresent) { /* do perspective correction but don't divide s, t, r by q */ const GLfloat dwdx = span->dwdx; @@ -546,7 +691,7 @@ interpolate_texcoords(GLcontext *ctx, struct sw_span *span) if (obj) { const struct gl_texture_image *img = obj->Image[0][obj->BaseLevel]; needLambda = (obj->MinFilter != obj->MagFilter) - || ctx->FragmentProgram._Active; + || ctx->FragmentProgram._Enabled; texW = (GLfloat) img->WidthScale; texH = (GLfloat) img->HeightScale; } @@ -571,7 +716,7 @@ interpolate_texcoords(GLcontext *ctx, struct sw_span *span) GLfloat r = span->tex[0][2]; GLfloat q = span->tex[0][3]; GLuint i; - if (ctx->FragmentProgram._Active || ctx->ATIFragmentShader._Enabled || + if (ctx->FragmentProgram._Enabled || ctx->ATIFragmentShader._Enabled || ctx->ShaderObjects._FragmentShaderPresent) { /* do perspective correction but don't divide s, t, r by q */ const GLfloat dwdx = span->dwdx; @@ -623,7 +768,7 @@ interpolate_texcoords(GLcontext *ctx, struct sw_span *span) GLfloat r = span->tex[0][2]; GLfloat q = span->tex[0][3]; GLuint i; - if (ctx->FragmentProgram._Active || ctx->ATIFragmentShader._Enabled || + if (ctx->FragmentProgram._Enabled || ctx->ATIFragmentShader._Enabled || ctx->ShaderObjects._FragmentShaderPresent) { /* do perspective correction but don't divide s, t, r by q */ const GLfloat dwdx = span->dwdx; @@ -675,8 +820,8 @@ interpolate_texcoords(GLcontext *ctx, struct sw_span *span) /** * Fill in the span.varying array from the interpolation values. */ -static void -interpolate_varying(GLcontext *ctx, struct sw_span *span) +static INLINE void +interpolate_varying(GLcontext *ctx, SWspan *span) { GLuint i, j; @@ -707,8 +852,8 @@ interpolate_varying(GLcontext *ctx, struct sw_span *span) /** * Apply the current polygon stipple pattern to a span of pixels. */ -static void -stipple_polygon_span( GLcontext *ctx, struct sw_span *span ) +static INLINE void +stipple_polygon_span( GLcontext *ctx, SWspan *span ) { const GLuint highbit = 0x80000000; const GLuint stipple = ctx->PolygonStipple[span->y % 32]; @@ -740,8 +885,8 @@ stipple_polygon_span( GLcontext *ctx, struct sw_span *span ) * Return: GL_TRUE some pixels still visible * GL_FALSE nothing visible */ -static GLuint -clip_span( GLcontext *ctx, struct sw_span *span ) +static INLINE GLuint +clip_span( GLcontext *ctx, SWspan *span ) { const GLint xmin = ctx->DrawBuffer->_Xmin; const GLint xmax = ctx->DrawBuffer->_Xmax; @@ -809,14 +954,11 @@ clip_span( GLcontext *ctx, struct sw_span *span ) * to their original values before returning. */ void -_swrast_write_index_span( GLcontext *ctx, struct sw_span *span) +_swrast_write_index_span( GLcontext *ctx, SWspan *span) { const SWcontext *swrast = SWRAST_CONTEXT(ctx); - const struct gl_framebuffer *fb = ctx->DrawBuffer; - const GLuint output = 0; const GLbitfield origInterpMask = span->interpMask; const GLbitfield origArrayMask = span->arrayMask; - GLuint buf; ASSERT(span->end <= MAX_WIDTH); ASSERT(span->primitive == GL_POINT || span->primitive == GL_LINE || @@ -931,95 +1073,106 @@ _swrast_write_index_span( GLcontext *ctx, struct sw_span *span) } } - /* Loop over drawing buffers */ - for (buf = 0; buf < fb->_NumColorDrawBuffers[output]; buf++) { - struct gl_renderbuffer *rb = fb->_ColorDrawBuffers[output][buf]; - GLuint indexTemp[MAX_WIDTH], *index32; + /* + * Write to renderbuffers + */ + { + struct gl_framebuffer *fb = ctx->DrawBuffer; + const GLuint output = 0; /* only frag progs can write to other outputs */ + const GLuint numDrawBuffers = fb->_NumColorDrawBuffers[output]; + GLuint indexSave[MAX_WIDTH]; + GLuint buf; - ASSERT(rb->_BaseFormat == GL_COLOR_INDEX); + if (numDrawBuffers > 1) { + /* save indexes for second, third renderbuffer writes */ + _mesa_memcpy(indexSave, span->array->index, + span->end * sizeof(indexSave[0])); + } - if (ctx->Color.IndexLogicOpEnabled || - ctx->Color.IndexMask != 0xffffffff) { - /* make copy of incoming indexes */ - MEMCPY(indexTemp, span->array->index, span->end * sizeof(GLuint)); + for (buf = 0; buf < fb->_NumColorDrawBuffers[output]; buf++) { + struct gl_renderbuffer *rb = fb->_ColorDrawBuffers[output][buf]; + ASSERT(rb->_BaseFormat == GL_COLOR_INDEX); if (ctx->Color.IndexLogicOpEnabled) { - _swrast_logicop_ci_span(ctx, rb, span, indexTemp); + _swrast_logicop_ci_span(ctx, rb, span); } if (ctx->Color.IndexMask != 0xffffffff) { - _swrast_mask_ci_span(ctx, rb, span, indexTemp); + _swrast_mask_ci_span(ctx, rb, span); } - index32 = indexTemp; - } - else { - index32 = span->array->index; - } - if ((span->interpMask & SPAN_INDEX) && span->indexStep == 0) { - /* all fragments have same color index */ - GLubyte index8; - GLushort index16; - GLuint index32; - void *value; - - if (rb->DataType == GL_UNSIGNED_BYTE) { - index8 = FixedToInt(span->index); - value = &index8; - } - else if (rb->DataType == GL_UNSIGNED_SHORT) { - index16 = FixedToInt(span->index); - value = &index16; - } - else { - ASSERT(rb->DataType == GL_UNSIGNED_INT); - index32 = FixedToInt(span->index); - value = &index32; - } + if ((span->interpMask & SPAN_INDEX) && span->indexStep == 0) { + /* all fragments have same color index */ + GLubyte index8; + GLushort index16; + GLuint index32; + void *value; - if (span->arrayMask & SPAN_XY) { - rb->PutMonoValues(ctx, rb, span->end, span->array->x, - span->array->y, value, span->array->mask); - } - else { - rb->PutMonoRow(ctx, rb, span->end, span->x, span->y, - value, span->array->mask); - } - } - else { - /* each fragment is a different color */ - GLubyte index8[MAX_WIDTH]; - GLushort index16[MAX_WIDTH]; - void *values; + if (rb->DataType == GL_UNSIGNED_BYTE) { + index8 = FixedToInt(span->index); + value = &index8; + } + else if (rb->DataType == GL_UNSIGNED_SHORT) { + index16 = FixedToInt(span->index); + value = &index16; + } + else { + ASSERT(rb->DataType == GL_UNSIGNED_INT); + index32 = FixedToInt(span->index); + value = &index32; + } - if (rb->DataType == GL_UNSIGNED_BYTE) { - GLuint k; - for (k = 0; k < span->end; k++) { - index8[k] = (GLubyte) index32[k]; + if (span->arrayMask & SPAN_XY) { + rb->PutMonoValues(ctx, rb, span->end, span->array->x, + span->array->y, value, span->array->mask); } - values = index8; - } - else if (rb->DataType == GL_UNSIGNED_SHORT) { - GLuint k; - for (k = 0; k < span->end; k++) { - index16[k] = (GLushort) index32[k]; + else { + rb->PutMonoRow(ctx, rb, span->end, span->x, span->y, + value, span->array->mask); } - values = index16; } else { - ASSERT(rb->DataType == GL_UNSIGNED_INT); - values = index32; - } + /* each fragment is a different color */ + GLubyte index8[MAX_WIDTH]; + GLushort index16[MAX_WIDTH]; + void *values; + + if (rb->DataType == GL_UNSIGNED_BYTE) { + GLuint k; + for (k = 0; k < span->end; k++) { + index8[k] = (GLubyte) span->array->index[k]; + } + values = index8; + } + else if (rb->DataType == GL_UNSIGNED_SHORT) { + GLuint k; + for (k = 0; k < span->end; k++) { + index16[k] = (GLushort) span->array->index[k]; + } + values = index16; + } + else { + ASSERT(rb->DataType == GL_UNSIGNED_INT); + values = span->array->index; + } - if (span->arrayMask & SPAN_XY) { - rb->PutValues(ctx, rb, span->end, span->array->x, span->array->y, + if (span->arrayMask & SPAN_XY) { + rb->PutValues(ctx, rb, span->end, + span->array->x, span->array->y, + values, span->array->mask); + } + else { + rb->PutRow(ctx, rb, span->end, span->x, span->y, values, span->array->mask); + } } - else { - rb->PutRow(ctx, rb, span->end, span->x, span->y, - values, span->array->mask); + + if (buf + 1 < numDrawBuffers) { + /* restore original span values */ + _mesa_memcpy(span->array->index, indexSave, + span->end * sizeof(indexSave[0])); } - } + } /* for buf */ } span->interpMask = origInterpMask; @@ -1031,80 +1184,210 @@ _swrast_write_index_span( GLcontext *ctx, struct sw_span *span) * Add specular color to base color. This is used only when * GL_LIGHT_MODEL_COLOR_CONTROL = GL_SEPARATE_SPECULAR_COLOR. */ -static void -add_colors(GLuint n, GLchan rgba[][4], GLchan specular[][4] ) +static INLINE void +add_specular(GLcontext *ctx, SWspan *span) +{ + switch (span->array->ChanType) { + case GL_UNSIGNED_BYTE: + { + GLubyte (*rgba)[4] = span->array->color.sz1.rgba; + GLubyte (*spec)[4] = span->array->color.sz1.spec; + GLuint i; + for (i = 0; i < span->end; i++) { + GLint r = rgba[i][RCOMP] + spec[i][RCOMP]; + GLint g = rgba[i][GCOMP] + spec[i][GCOMP]; + GLint b = rgba[i][BCOMP] + spec[i][BCOMP]; + GLint a = rgba[i][ACOMP] + spec[i][ACOMP]; + rgba[i][RCOMP] = MIN2(r, 255); + rgba[i][GCOMP] = MIN2(g, 255); + rgba[i][BCOMP] = MIN2(b, 255); + rgba[i][ACOMP] = MIN2(a, 255); + } + } + break; + case GL_UNSIGNED_SHORT: + { + GLushort (*rgba)[4] = span->array->color.sz2.rgba; + GLushort (*spec)[4] = span->array->color.sz2.spec; + GLuint i; + for (i = 0; i < span->end; i++) { + GLint r = rgba[i][RCOMP] + spec[i][RCOMP]; + GLint g = rgba[i][GCOMP] + spec[i][GCOMP]; + GLint b = rgba[i][BCOMP] + spec[i][BCOMP]; + GLint a = rgba[i][ACOMP] + spec[i][ACOMP]; + rgba[i][RCOMP] = MIN2(r, 65535); + rgba[i][GCOMP] = MIN2(g, 65535); + rgba[i][BCOMP] = MIN2(b, 65535); + rgba[i][ACOMP] = MIN2(a, 65535); + } + } + break; + case GL_FLOAT: + { + GLfloat (*rgba)[4] = span->array->color.sz4.rgba; + GLfloat (*spec)[4] = span->array->color.sz4.spec; + GLuint i; + for (i = 0; i < span->end; i++) { + rgba[i][RCOMP] += spec[i][RCOMP]; + rgba[i][GCOMP] += spec[i][GCOMP]; + rgba[i][BCOMP] += spec[i][BCOMP]; + rgba[i][ACOMP] += spec[i][ACOMP]; + } + } + break; + default: + _mesa_problem(ctx, "Invalid datatype in add_specular"); + } +} + + +/** + * Apply antialiasing coverage value to alpha values. + */ +static INLINE void +apply_aa_coverage(SWspan *span) { + const GLfloat *coverage = span->array->coverage; GLuint i; - for (i = 0; i < n; i++) { -#if CHAN_TYPE == GL_FLOAT - /* no clamping */ - rgba[i][RCOMP] += specular[i][RCOMP]; - rgba[i][GCOMP] += specular[i][GCOMP]; - rgba[i][BCOMP] += specular[i][BCOMP]; -#else - GLint r = rgba[i][RCOMP] + specular[i][RCOMP]; - GLint g = rgba[i][GCOMP] + specular[i][GCOMP]; - GLint b = rgba[i][BCOMP] + specular[i][BCOMP]; - rgba[i][RCOMP] = (GLchan) MIN2(r, CHAN_MAX); - rgba[i][GCOMP] = (GLchan) MIN2(g, CHAN_MAX); - rgba[i][BCOMP] = (GLchan) MIN2(b, CHAN_MAX); -#endif + if (span->array->ChanType == GL_UNSIGNED_BYTE) { + GLubyte (*rgba)[4] = span->array->color.sz1.rgba; + for (i = 0; i < span->end; i++) { + const GLfloat a = rgba[i][ACOMP] * coverage[i]; + rgba[i][ACOMP] = (GLubyte) CLAMP(a, 0.0, 255.0); + ASSERT(coverage[i] >= 0.0); + ASSERT(coverage[i] <= 1.0); + } + } + else if (span->array->ChanType == GL_UNSIGNED_SHORT) { + GLushort (*rgba)[4] = span->array->color.sz2.rgba; + for (i = 0; i < span->end; i++) { + const GLfloat a = rgba[i][ACOMP] * coverage[i]; + rgba[i][ACOMP] = (GLushort) CLAMP(a, 0.0, 65535.0); + } + } + else { + GLfloat (*rgba)[4] = span->array->color.sz4.rgba; + for (i = 0; i < span->end; i++) { + rgba[i][ACOMP] = rgba[i][ACOMP] * coverage[i]; + } } } /** - * XXX merge this code into the _swrast_write_rgba_span() routine! - * - * Draw to more than one RGBA color buffer (or none). - * All fragment operations, up to (but not) blending/logicop should - * have been done first. + * Clamp span's float colors to [0,1] */ -static void -multi_write_rgba_span( GLcontext *ctx, struct sw_span *span ) +static INLINE void +clamp_colors(SWspan *span) { - const GLuint colorMask = *((GLuint *) ctx->Color.ColorMask); - struct gl_framebuffer *fb = ctx->DrawBuffer; - const GLuint output = 0; + GLfloat (*rgba)[4] = span->array->color.sz4.rgba; GLuint i; + ASSERT(span->array->ChanType == GL_FLOAT); + for (i = 0; i < span->end; i++) { + rgba[i][RCOMP] = CLAMP(rgba[i][RCOMP], 0.0F, 1.0F); + rgba[i][GCOMP] = CLAMP(rgba[i][GCOMP], 0.0F, 1.0F); + rgba[i][BCOMP] = CLAMP(rgba[i][BCOMP], 0.0F, 1.0F); + rgba[i][ACOMP] = CLAMP(rgba[i][ACOMP], 0.0F, 1.0F); + } +} + + +/** + * Convert the span's color arrays to the given type. + */ +static INLINE void +convert_color_type(GLcontext *ctx, SWspan *span, GLenum newType) +{ + GLvoid *src, *dst; + if (span->array->ChanType == GL_UNSIGNED_BYTE) { + src = span->array->color.sz1.rgba; + } + else if (span->array->ChanType == GL_UNSIGNED_BYTE) { + src = span->array->color.sz2.rgba; + } + else { + src = span->array->color.sz4.rgba; + } + if (newType == GL_UNSIGNED_BYTE) { + dst = span->array->color.sz1.rgba; + } + else if (newType == GL_UNSIGNED_BYTE) { + dst = span->array->color.sz2.rgba; + } + else { + dst = span->array->color.sz4.rgba; + } - ASSERT(span->end < MAX_WIDTH); - ASSERT(colorMask != 0x0); + _mesa_convert_colors(span->array->ChanType, src, + newType, dst, + span->end, span->array->mask); - for (i = 0; i < fb->_NumColorDrawBuffers[output]; i++) { - struct gl_renderbuffer *rb = fb->_ColorDrawBuffers[output][i]; - GLchan rgbaTmp[MAX_WIDTH][4]; + span->array->ChanType = newType; +} - /* make copy of incoming colors */ - MEMCPY( rgbaTmp, span->array->rgba, 4 * span->end * sizeof(GLchan) ); - if (ctx->Color._LogicOpEnabled) { - _swrast_logicop_rgba_span(ctx, rb, span, rgbaTmp); - } - else if (ctx->Color.BlendEnabled) { - _swrast_blend_span(ctx, rb, span, rgbaTmp); - } - if (colorMask != 0xffffffff) { - _swrast_mask_rgba_span(ctx, rb, span, rgbaTmp); +/** + * Apply fragment shader, fragment program or normal texturing to span. + */ +static INLINE void +shade_texture_span(GLcontext *ctx, SWspan *span) +{ + /* Now we need the rgba array, fill it in if needed */ + if (span->interpMask & SPAN_RGBA) + interpolate_colors(span); + + if (ctx->Texture._EnabledCoordUnits && (span->interpMask & SPAN_TEXTURE)) + interpolate_texcoords(ctx, span); + + if (ctx->ShaderObjects._FragmentShaderPresent || + ctx->FragmentProgram._Enabled || + ctx->ATIFragmentShader._Enabled) { + + /* use float colors if running a fragment program or shader */ + const GLenum oldType = span->array->ChanType; + const GLenum newType = GL_FLOAT; + if (oldType != newType) { + GLvoid *src = (oldType == GL_UNSIGNED_BYTE) + ? (GLvoid *) span->array->color.sz1.rgba + : (GLvoid *) span->array->color.sz2.rgba; + _mesa_convert_colors(oldType, src, + newType, span->array->color.sz4.rgba, + span->end, span->array->mask); + span->array->ChanType = newType; } - if (span->arrayMask & SPAN_XY) { - /* array of pixel coords */ - ASSERT(rb->PutValues); - rb->PutValues(ctx, rb, span->end, span->array->x, - span->array->y, rgbaTmp, span->array->mask); + /* fragment programs/shaders may need specular, fog and Z coords */ + if (span->interpMask & SPAN_SPEC) + interpolate_specular(span); + + if (span->interpMask & SPAN_FOG) + interpolate_fog(ctx, span); + + if (span->interpMask & SPAN_Z) + _swrast_span_interpolate_z (ctx, span); + + /* Run fragment program/shader now */ + if (ctx->ShaderObjects._FragmentShaderPresent) { + interpolate_varying(ctx, span); + _swrast_exec_arbshader(ctx, span); + } + else if (ctx->FragmentProgram._Enabled) { + _swrast_exec_fragment_program(ctx, span); } else { - /* horizontal run of pixels */ - ASSERT(rb->PutRow); - rb->PutRow(ctx, rb, span->end, span->x, span->y, rgbaTmp, - span->array->mask); + ASSERT(ctx->ATIFragmentShader._Enabled); + _swrast_exec_fragment_shader(ctx, span); } } + else if (ctx->Texture._EnabledUnits && (span->arrayMask & SPAN_TEXTURE)) { + /* conventional texturing */ + _swrast_texture_span(ctx, span); + } } + /** * Apply all the per-fragment operations to a span. * This now includes texturing (_swrast_write_texture_span() is history). @@ -1113,26 +1396,64 @@ multi_write_rgba_span( GLcontext *ctx, struct sw_span *span ) * to their original values before returning. */ void -_swrast_write_rgba_span( GLcontext *ctx, struct sw_span *span) +_swrast_write_rgba_span( GLcontext *ctx, SWspan *span) { + const SWcontext *swrast = SWRAST_CONTEXT(ctx); const GLuint colorMask = *((GLuint *) ctx->Color.ColorMask); - SWcontext *swrast = SWRAST_CONTEXT(ctx); const GLbitfield origInterpMask = span->interpMask; const GLbitfield origArrayMask = span->arrayMask; - const GLboolean deferredTexture = !(ctx->Color.AlphaEnabled || - ctx->FragmentProgram._Active || - ctx->ShaderObjects._FragmentShaderPresent); - - ASSERT(span->primitive == GL_POINT || span->primitive == GL_LINE || - span->primitive == GL_POLYGON || span->primitive == GL_BITMAP); - ASSERT(span->end <= MAX_WIDTH); - ASSERT((span->interpMask & span->arrayMask) == 0); + const GLenum chanType = span->array->ChanType; + const GLboolean shader + = ctx->FragmentProgram._Enabled + || ctx->ShaderObjects._FragmentShaderPresent + || ctx->ATIFragmentShader._Enabled; + const GLboolean shaderOrTexture = shader || ctx->Texture._EnabledUnits; + GLboolean deferredTexture; /* printf("%s() interp 0x%x array 0x%x\n", __FUNCTION__, span->interpMask, span->arrayMask); */ + ASSERT(span->primitive == GL_POINT || + span->primitive == GL_LINE || + span->primitive == GL_POLYGON || + span->primitive == GL_BITMAP); + ASSERT(span->end <= MAX_WIDTH); + ASSERT((span->interpMask & span->arrayMask) == 0); + ASSERT((span->interpMask & SPAN_RGBA) ^ (span->arrayMask & SPAN_RGBA)); + + /* check for conditions that prevent deferred shading */ + if (ctx->Color.AlphaEnabled) { + /* alpha test depends on post-texture/shader colors */ + deferredTexture = GL_FALSE; + } + else if (shaderOrTexture) { + if (ctx->FragmentProgram._Enabled) { + if (ctx->FragmentProgram.Current->Base.OutputsWritten + & (1 << FRAG_RESULT_DEPR)) { + /* Z comes from fragment program */ + deferredTexture = GL_FALSE; + } + else { + deferredTexture = GL_TRUE; + } + } + else if (ctx->ShaderObjects._FragmentShaderPresent) { + /* XXX how do we test if Z is written by shader? */ + deferredTexture = GL_FALSE; /* never defer to be safe */ + } + else { + /* ATI frag shader or conventional texturing */ + deferredTexture = GL_TRUE; + } + } + else { + /* no texturing or shadering */ + deferredTexture = GL_FALSE; + } + + /* Fragment write masks */ if (span->arrayMask & SPAN_MASK) { /* mask was initialized by caller, probably glBitmap */ span->writeAll = GL_FALSE; @@ -1169,59 +1490,19 @@ _swrast_write_rgba_span( GLcontext *ctx, struct sw_span *span) stipple_polygon_span(ctx, span); } - /* Interpolate texcoords? */ - if (ctx->Texture._EnabledCoordUnits - && (span->interpMask & SPAN_TEXTURE) - && (span->arrayMask & SPAN_TEXTURE) == 0) { - interpolate_texcoords(ctx, span); - } - - if (ctx->ShaderObjects._FragmentShaderPresent) { - interpolate_varying(ctx, span); - } - /* This is the normal place to compute the resulting fragment color/Z. * As an optimization, we try to defer this until after Z/stencil * testing in order to try to avoid computing colors that we won't * actually need. */ - if (!deferredTexture) { - /* Now we need the rgba array, fill it in if needed */ - if ((span->interpMask & SPAN_RGBA) && (span->arrayMask & SPAN_RGBA) == 0) - interpolate_colors(ctx, span); - - if (span->interpMask & SPAN_SPEC) - interpolate_specular(ctx, span); - - if (span->interpMask & SPAN_FOG) - interpolate_fog(ctx, span); + if (shaderOrTexture && !deferredTexture) { + shade_texture_span(ctx, span); + } - /* Compute fragment colors with fragment program or texture lookups */ -#if FEATURE_ARB_fragment_shader - if (ctx->ShaderObjects._FragmentShaderPresent) { - if (span->interpMask & SPAN_Z) - _swrast_span_interpolate_z (ctx, span); - _swrast_exec_arbshader (ctx, span); - } - else -#endif - if (ctx->FragmentProgram._Active) { - /* frag prog may need Z values */ - if (span->interpMask & SPAN_Z) - _swrast_span_interpolate_z(ctx, span); - _swrast_exec_fragment_program( ctx, span ); - } - else if (ctx->ATIFragmentShader._Enabled) - _swrast_exec_fragment_shader( ctx, span ); - else if (ctx->Texture._EnabledUnits && (span->arrayMask & SPAN_TEXTURE)) - _swrast_texture_span( ctx, span ); - - /* Do the alpha test */ - if (ctx->Color.AlphaEnabled) { - if (!_swrast_alpha_test(ctx, span)) { - span->arrayMask = origArrayMask; - return; - } + /* Do the alpha test */ + if (ctx->Color.AlphaEnabled) { + if (!_swrast_alpha_test(ctx, span)) { + goto end; } } @@ -1233,9 +1514,7 @@ _swrast_write_rgba_span( GLcontext *ctx, struct sw_span *span) if (ctx->Stencil.Enabled && ctx->DrawBuffer->Visual.stencilBits > 0) { /* Combined Z/stencil tests */ if (!_swrast_stencil_and_ztest_span(ctx, span)) { - span->interpMask = origInterpMask; - span->arrayMask = origArrayMask; - return; + goto end; } } else if (ctx->DrawBuffer->Visual.depthBits > 0) { @@ -1243,9 +1522,7 @@ _swrast_write_rgba_span( GLcontext *ctx, struct sw_span *span) ASSERT(ctx->Depth.Test); ASSERT(span->arrayMask & SPAN_Z); if (!_swrast_depth_test_span(ctx, span)) { - span->interpMask = origInterpMask; - span->arrayMask = origArrayMask; - return; + goto end; } } } @@ -1264,9 +1541,7 @@ _swrast_write_rgba_span( GLcontext *ctx, struct sw_span *span) * the occlusion test. */ if (colorMask == 0x0) { - span->interpMask = origInterpMask; - span->arrayMask = origArrayMask; - return; + goto end; } /* If we were able to defer fragment color computation to now, there's @@ -1274,44 +1549,26 @@ _swrast_write_rgba_span( GLcontext *ctx, struct sw_span *span) * Z/stencil testing. */ if (deferredTexture) { - /* Now we need the rgba array, fill it in if needed */ - if ((span->interpMask & SPAN_RGBA) && (span->arrayMask & SPAN_RGBA) == 0) - interpolate_colors(ctx, span); - - if (span->interpMask & SPAN_SPEC) - interpolate_specular(ctx, span); - - if (span->interpMask & SPAN_FOG) - interpolate_fog(ctx, span); + ASSERT(shaderOrTexture); + shade_texture_span(ctx, span); + } -#if FEATURE_ARB_fragment_shader - if (ctx->ShaderObjects._FragmentShaderPresent) { - if (span->interpMask & SPAN_Z) - _swrast_span_interpolate_z (ctx, span); - _swrast_exec_arbshader (ctx, span); - } - else -#endif - if (ctx->FragmentProgram._Active) - _swrast_exec_fragment_program( ctx, span ); - else if (ctx->ATIFragmentShader._Enabled) - _swrast_exec_fragment_shader( ctx, span ); - else if (ctx->Texture._EnabledUnits && (span->arrayMask & SPAN_TEXTURE)) - _swrast_texture_span( ctx, span ); + if ((span->arrayMask & SPAN_RGBA) == 0) { + interpolate_colors(span); } ASSERT(span->arrayMask & SPAN_RGBA); - if (!ctx->FragmentProgram._Enabled) { + if (!shader) { /* Add base and specular colors */ if (ctx->Fog.ColorSumEnabled || (ctx->Light.Enabled && ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR)) { if (span->interpMask & SPAN_SPEC) { - interpolate_specular(ctx, span); + interpolate_specular(span); } if (span->arrayMask & SPAN_SPEC) { - add_colors( span->end, span->array->rgba, span->array->spec ); + add_specular(ctx, span); } else { /* We probably added the base/specular colors during the @@ -1328,80 +1585,95 @@ _swrast_write_rgba_span( GLcontext *ctx, struct sw_span *span) /* Antialias coverage application */ if (span->arrayMask & SPAN_COVERAGE) { - GLchan (*rgba)[4] = span->array->rgba; - GLfloat *coverage = span->array->coverage; - GLuint i; - for (i = 0; i < span->end; i++) { - rgba[i][ACOMP] = (GLchan) (rgba[i][ACOMP] * coverage[i]); - } + apply_aa_coverage(span); } /* Clamp color/alpha values over the range [0.0, 1.0] before storage */ -#if CHAN_TYPE == GL_FLOAT - if (ctx->Color.ClampFragmentColor) { - GLchan (*rgba)[4] = span->array->rgba; - GLuint i; - for (i = 0; i < span->end; i++) { - rgba[i][RCOMP] = CLAMP(rgba[i][RCOMP], 0.0, CHAN_MAXF); - rgba[i][GCOMP] = CLAMP(rgba[i][GCOMP], 0.0, CHAN_MAXF); - rgba[i][BCOMP] = CLAMP(rgba[i][BCOMP], 0.0, CHAN_MAXF); - rgba[i][ACOMP] = CLAMP(rgba[i][ACOMP], 0.0, CHAN_MAXF); - } + if (ctx->Color.ClampFragmentColor == GL_TRUE && + span->array->ChanType == GL_FLOAT) { + clamp_colors(span); } -#endif - if (swrast->_RasterMask & MULTI_DRAW_BIT) { - /* need to do blend/logicop separately for each color buffer */ - multi_write_rgba_span(ctx, span); - } - else { - /* normal: write to exactly one buffer */ - struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[0][0]; - - if (ctx->Color._LogicOpEnabled) { - _swrast_logicop_rgba_span(ctx, rb, span, span->array->rgba); - } - else if (ctx->Color.BlendEnabled) { - _swrast_blend_span(ctx, rb, span, span->array->rgba); + /* + * Write to renderbuffers + */ + { + struct gl_framebuffer *fb = ctx->DrawBuffer; + const GLuint output = 0; /* only frag progs can write to other outputs */ + const GLuint numDrawBuffers = fb->_NumColorDrawBuffers[output]; + GLchan rgbaSave[MAX_WIDTH][4]; + GLuint buf; + + if (numDrawBuffers > 0) { + if (fb->_ColorDrawBuffers[output][0]->DataType + != span->array->ChanType) { + convert_color_type(ctx, span, + fb->_ColorDrawBuffers[output][0]->DataType); + } } - /* Color component masking */ - if (colorMask != 0xffffffff) { - _swrast_mask_rgba_span(ctx, rb, span, span->array->rgba); + if (numDrawBuffers > 1) { + /* save colors for second, third renderbuffer writes */ + _mesa_memcpy(rgbaSave, span->array->rgba, + 4 * span->end * sizeof(GLchan)); } - /* Finally, write the pixels to a color buffer */ - if (span->arrayMask & SPAN_XY) { - /* array of pixel coords */ - ASSERT(rb->PutValues); - ASSERT(rb->_BaseFormat == GL_RGB || rb->_BaseFormat == GL_RGBA); - /* XXX check datatype */ - rb->PutValues(ctx, rb, span->end, span->array->x, span->array->y, - span->array->rgba, span->array->mask); - } - else { - /* horizontal run of pixels */ - ASSERT(rb->PutRow); - ASSERT(rb->_BaseFormat == GL_RGB || rb->_BaseFormat == GL_RGBA); - /* XXX check datatype */ - rb->PutRow(ctx, rb, span->end, span->x, span->y, span->array->rgba, - span->writeAll ? NULL : span->array->mask); - } + for (buf = 0; buf < numDrawBuffers; buf++) { + struct gl_renderbuffer *rb = fb->_ColorDrawBuffers[output][buf]; + ASSERT(rb->_BaseFormat == GL_RGBA || rb->_BaseFormat == GL_RGB); + + if (ctx->Color._LogicOpEnabled) { + _swrast_logicop_rgba_span(ctx, rb, span); + } + else if (ctx->Color.BlendEnabled) { + _swrast_blend_span(ctx, rb, span); + } + + if (colorMask != 0xffffffff) { + _swrast_mask_rgba_span(ctx, rb, span); + } + + if (span->arrayMask & SPAN_XY) { + /* array of pixel coords */ + ASSERT(rb->PutValues); + rb->PutValues(ctx, rb, span->end, + span->array->x, span->array->y, + span->array->rgba, span->array->mask); + } + else { + /* horizontal run of pixels */ + ASSERT(rb->PutRow); + rb->PutRow(ctx, rb, span->end, span->x, span->y, span->array->rgba, + span->writeAll ? NULL: span->array->mask); + } + + if (buf + 1 < numDrawBuffers) { + /* restore original span values */ + _mesa_memcpy(span->array->rgba, rgbaSave, + 4 * span->end * sizeof(GLchan)); + } + } /* for buf */ + } +end: + /* restore these values before returning */ span->interpMask = origInterpMask; span->arrayMask = origArrayMask; + span->array->ChanType = chanType; } - /** * Read RGBA pixels from frame buffer. Clipping will be done to prevent * reading ouside the buffer's boundaries. + * \param type datatype for returned colors + * \param rgba the returned colors */ void _swrast_read_rgba_span( GLcontext *ctx, struct gl_renderbuffer *rb, - GLuint n, GLint x, GLint y, GLchan rgba[][4] ) + GLuint n, GLint x, GLint y, GLenum dstType, + GLvoid *rgba) { const GLint bufWidth = (GLint) rb->Width; const GLint bufHeight = (GLint) rb->Height; @@ -1443,8 +1715,18 @@ _swrast_read_rgba_span( GLcontext *ctx, struct gl_renderbuffer *rb, ASSERT(rb); ASSERT(rb->GetRow); ASSERT(rb->_BaseFormat == GL_RGB || rb->_BaseFormat == GL_RGBA); - ASSERT(rb->DataType == CHAN_TYPE); - rb->GetRow(ctx, rb, length, x + skip, y, rgba + skip); + + if (rb->DataType == dstType) { + rb->GetRow(ctx, rb, length, x + skip, y, + (GLubyte *) rgba + skip * RGBA_PIXEL_SIZE(rb->DataType)); + } + else { + GLuint temp[MAX_WIDTH * 4]; + rb->GetRow(ctx, rb, length, x + skip, y, temp); + _mesa_convert_colors(rb->DataType, temp, + dstType, (GLubyte *) rgba + skip * RGBA_PIXEL_SIZE(dstType), + length, NULL); + } } } @@ -1521,7 +1803,7 @@ _swrast_read_index_span( GLcontext *ctx, struct gl_renderbuffer *rb, * Wrapper for gl_renderbuffer::GetValues() which does clipping to avoid * reading values outside the buffer bounds. * We can use this for reading any format/type of renderbuffer. - * \param valueSize is the size in bytes of each value put into the + * \param valueSize is the size in bytes of each value (pixel) put into the * values array. */ void @@ -1557,6 +1839,7 @@ _swrast_get_values(GLcontext *ctx, struct gl_renderbuffer *rb, /** * Wrapper for gl_renderbuffer::PutRow() which does clipping. + * \param valueSize size of each value (pixel) in bytes */ void _swrast_put_row(GLcontext *ctx, struct gl_renderbuffer *rb, @@ -1591,6 +1874,7 @@ _swrast_put_row(GLcontext *ctx, struct gl_renderbuffer *rb, /** * Wrapper for gl_renderbuffer::GetRow() which does clipping. + * \param valueSize size of each value (pixel) in bytes */ void _swrast_get_row(GLcontext *ctx, struct gl_renderbuffer *rb, @@ -1620,3 +1904,45 @@ _swrast_get_row(GLcontext *ctx, struct gl_renderbuffer *rb, rb->GetRow(ctx, rb, count, x, y, (GLubyte *) values + skip * valueSize); } + + +/** + * Get RGBA pixels from the given renderbuffer. Put the pixel colors into + * the span's specular color arrays. The specular color arrays should no + * longer be needed by time this function is called. + * Used by blending, logicop and masking functions. + * \return pointer to the colors we read. + */ +void * +_swrast_get_dest_rgba(GLcontext *ctx, struct gl_renderbuffer *rb, + SWspan *span) +{ + const GLuint pixelSize = RGBA_PIXEL_SIZE(span->array->ChanType); + void *rbPixels; + + /* + * Determine pixel size (in bytes). + * Point rbPixels to a temporary space (use specular color arrays). + */ + if (span->array->ChanType == GL_UNSIGNED_BYTE) { + rbPixels = span->array->color.sz1.spec; + } + else if (span->array->ChanType == GL_UNSIGNED_SHORT) { + rbPixels = span->array->color.sz2.spec; + } + else { + rbPixels = span->array->color.sz4.spec; + } + + /* Get destination values from renderbuffer */ + if (span->arrayMask & SPAN_XY) { + _swrast_get_values(ctx, rb, span->end, span->array->x, span->array->y, + rbPixels, pixelSize); + } + else { + _swrast_get_row(ctx, rb, span->end, span->x, span->y, + rbPixels, pixelSize); + } + + return rbPixels; +} diff --git a/src/mesa/swrast/s_span.h b/src/mesa/swrast/s_span.h index 40a57e1ae53..c441106abae 100644 --- a/src/mesa/swrast/s_span.h +++ b/src/mesa/swrast/s_span.h @@ -32,19 +32,19 @@ extern void -_swrast_span_default_z( GLcontext *ctx, struct sw_span *span ); +_swrast_span_default_z( GLcontext *ctx, SWspan *span ); extern void -_swrast_span_interpolate_z( const GLcontext *ctx, struct sw_span *span ); +_swrast_span_interpolate_z( const GLcontext *ctx, SWspan *span ); extern void -_swrast_span_default_fog( GLcontext *ctx, struct sw_span *span ); +_swrast_span_default_fog( GLcontext *ctx, SWspan *span ); extern void -_swrast_span_default_color( GLcontext *ctx, struct sw_span *span ); +_swrast_span_default_color( GLcontext *ctx, SWspan *span ); extern void -_swrast_span_default_texcoords( GLcontext *ctx, struct sw_span *span ); +_swrast_span_default_texcoords( GLcontext *ctx, SWspan *span ); extern GLfloat _swrast_compute_lambda(GLfloat dsdx, GLfloat dsdy, GLfloat dtdx, GLfloat dtdy, @@ -52,16 +52,16 @@ _swrast_compute_lambda(GLfloat dsdx, GLfloat dsdy, GLfloat dtdx, GLfloat dtdy, GLfloat s, GLfloat t, GLfloat q, GLfloat invQ); extern void -_swrast_write_index_span( GLcontext *ctx, struct sw_span *span); +_swrast_write_index_span( GLcontext *ctx, SWspan *span); extern void -_swrast_write_rgba_span( GLcontext *ctx, struct sw_span *span); +_swrast_write_rgba_span( GLcontext *ctx, SWspan *span); extern void -_swrast_read_rgba_span( GLcontext *ctx, struct gl_renderbuffer *rb, - GLuint n, GLint x, GLint y, GLchan rgba[][4] ); +_swrast_read_rgba_span(GLcontext *ctx, struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, GLenum type, GLvoid *rgba); extern void _swrast_read_index_span( GLcontext *ctx, struct gl_renderbuffer *rb, @@ -82,4 +82,9 @@ _swrast_get_row(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, GLint x, GLint y, GLvoid *values, GLuint valueSize); + +extern void * +_swrast_get_dest_rgba(GLcontext *ctx, struct gl_renderbuffer *rb, + SWspan *span); + #endif diff --git a/src/mesa/swrast/s_stencil.c b/src/mesa/swrast/s_stencil.c index 1c78f848e13..dbab6b3c20b 100644 --- a/src/mesa/swrast/s_stencil.c +++ b/src/mesa/swrast/s_stencil.c @@ -406,7 +406,7 @@ do_stencil_test( GLcontext *ctx, GLuint face, GLuint n, GLstencil stencil[], * */ static GLboolean -stencil_and_ztest_span(GLcontext *ctx, struct sw_span *span, GLuint face) +stencil_and_ztest_span(GLcontext *ctx, SWspan *span, GLuint face) { struct gl_framebuffer *fb = ctx->DrawBuffer; struct gl_renderbuffer *rb = fb->_StencilBuffer; @@ -900,7 +900,7 @@ stencil_test_pixels( GLcontext *ctx, GLuint face, GLuint n, * GL_TRUE - one or more fragments passed the testing */ static GLboolean -stencil_and_ztest_pixels( GLcontext *ctx, struct sw_span *span, GLuint face ) +stencil_and_ztest_pixels( GLcontext *ctx, SWspan *span, GLuint face ) { struct gl_framebuffer *fb = ctx->DrawBuffer; struct gl_renderbuffer *rb = fb->_StencilBuffer; @@ -1007,7 +1007,7 @@ stencil_and_ztest_pixels( GLcontext *ctx, struct sw_span *span, GLuint face ) * GL_FALSE = all fragments failed. */ GLboolean -_swrast_stencil_and_ztest_span(GLcontext *ctx, struct sw_span *span) +_swrast_stencil_and_ztest_span(GLcontext *ctx, SWspan *span) { /* span->facing can only be non-zero if using two-sided stencil */ ASSERT(ctx->Stencil._TestTwoSide || span->facing == 0); diff --git a/src/mesa/swrast/s_stencil.h b/src/mesa/swrast/s_stencil.h index fabc25250da..1fcb538fecf 100644 --- a/src/mesa/swrast/s_stencil.h +++ b/src/mesa/swrast/s_stencil.h @@ -33,7 +33,7 @@ extern GLboolean -_swrast_stencil_and_ztest_span(GLcontext *ctx, struct sw_span *span); +_swrast_stencil_and_ztest_span(GLcontext *ctx, SWspan *span); extern void diff --git a/src/mesa/swrast/s_texcombine.c b/src/mesa/swrast/s_texcombine.c index ac26c9cebb2..2a3455f35e2 100644 --- a/src/mesa/swrast/s_texcombine.c +++ b/src/mesa/swrast/s_texcombine.c @@ -1073,7 +1073,7 @@ texture_apply( const GLcontext *ctx, * Apply texture mapping to a span of fragments. */ void -_swrast_texture_span( GLcontext *ctx, struct sw_span *span ) +_swrast_texture_span( GLcontext *ctx, SWspan *span ) { SWcontext *swrast = SWRAST_CONTEXT(ctx); GLchan primary_rgba[MAX_WIDTH][4]; @@ -1132,7 +1132,13 @@ _swrast_texture_span( GLcontext *ctx, struct sw_span *span ) /* GL_SGI_texture_color_table */ if (texUnit->ColorTableEnabled) { - _mesa_lookup_rgba_chan(&texUnit->ColorTable, span->end, texels); +#if CHAN_TYPE == GL_UNSIGNED_BYTE + _mesa_lookup_rgba_ubyte(&texUnit->ColorTable, span->end, texels); +#elif CHAN_TYPE == GL_UNSIGNED_SHORT + _mesa_lookup_rgba_ubyte(&texUnit->ColorTable, span->end, texels); +#else + _mesa_lookup_rgba_float(&texUnit->ColorTable, span->end, texels); +#endif } } } diff --git a/src/mesa/swrast/s_texcombine.h b/src/mesa/swrast/s_texcombine.h index eca967c5404..3bf70e0b86e 100644 --- a/src/mesa/swrast/s_texcombine.h +++ b/src/mesa/swrast/s_texcombine.h @@ -31,6 +31,6 @@ #include "swrast.h" extern void -_swrast_texture_span( GLcontext *ctx, struct sw_span *span ); +_swrast_texture_span( GLcontext *ctx, SWspan *span ); #endif diff --git a/src/mesa/swrast/s_texfilter.c b/src/mesa/swrast/s_texfilter.c index 629b4ec1369..f55e23422d4 100644 --- a/src/mesa/swrast/s_texfilter.c +++ b/src/mesa/swrast/s_texfilter.c @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.5.1 + * Version: 6.5.2 * * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. * @@ -590,13 +590,13 @@ compute_min_mag_ranges(const struct gl_texture_object *tObj, } #endif /* DEBUG */ - if (lambda[0] <= minMagThresh && lambda[n-1] <= minMagThresh) { + if (lambda[0] <= minMagThresh && (n <= 1 || lambda[n-1] <= minMagThresh)) { /* magnification for whole span */ *magStart = 0; *magEnd = n; *minStart = *minEnd = 0; } - else if (lambda[0] > minMagThresh && lambda[n-1] > minMagThresh) { + else if (lambda[0] > minMagThresh && (n <=1 || lambda[n-1] > minMagThresh)) { /* minification for whole span */ *minStart = 0; *minEnd = n; diff --git a/src/mesa/swrast/s_texstore.c b/src/mesa/swrast/s_texstore.c index e9f4faeed00..3f49b40d9c1 100644 --- a/src/mesa/swrast/s_texstore.c +++ b/src/mesa/swrast/s_texstore.c @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.5.1 + * Version: 6.5.2 * * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. * @@ -43,6 +43,7 @@ #include "convolve.h" #include "image.h" #include "macros.h" +#include "mipmap.h" #include "texformat.h" #include "teximage.h" #include "texstore.h" @@ -51,33 +52,37 @@ #include "s_depth.h" #include "s_span.h" -/* + +/** * Read an RGBA image from the frame buffer. * This is used by glCopyTex[Sub]Image[12]D(). - * Input: ctx - the context - * x, y - lower left corner - * width, height - size of region to read - * Return: pointer to block of GL_RGBA, GLchan data. + * \param x window source x + * \param y window source y + * \param width image width + * \param height image height + * \param type datatype for returned GL_RGBA image + * \return pointer to image */ -static GLchan * -read_color_image( GLcontext *ctx, GLint x, GLint y, +static GLvoid * +read_color_image( GLcontext *ctx, GLint x, GLint y, GLenum type, GLsizei width, GLsizei height ) { SWcontext *swrast = SWRAST_CONTEXT(ctx); - const GLint stride = 4 * width; - GLint i; - GLchan *image, *dst; + struct gl_renderbuffer *rb = ctx->ReadBuffer->_ColorReadBuffer; + const GLint pixelSize = _mesa_bytes_per_pixel(GL_RGBA, type); + const GLint stride = width * pixelSize; + GLint row; + GLubyte *image, *dst; - image = (GLchan *) _mesa_malloc(width * height * 4 * sizeof(GLchan)); + image = (GLubyte *) _mesa_malloc(width * height * pixelSize); if (!image) return NULL; RENDER_START(swrast, ctx); dst = image; - for (i = 0; i < height; i++) { - _swrast_read_rgba_span(ctx, ctx->ReadBuffer->_ColorReadBuffer, - width, x, y + i, (GLchan (*)[4]) dst); + for (row = 0; row < height; row++) { + _swrast_read_rgba_span(ctx, rb, width, x, y + row, type, dst); dst += stride; } @@ -249,7 +254,7 @@ _swrast_copy_teximage1d( GLcontext *ctx, GLenum target, GLint level, texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; texObj = _mesa_select_tex_object(ctx, texUnit, target); ASSERT(texObj); - texImage = _mesa_select_tex_image(ctx, texUnit, target, level); + texImage = _mesa_select_tex_image(ctx, texObj, target, level); ASSERT(texImage); ASSERT(ctx->Driver.TexImage1D); @@ -284,15 +289,16 @@ _swrast_copy_teximage1d( GLcontext *ctx, GLenum target, GLint level, } else { /* read RGBA image from framebuffer */ - GLchan *image = read_color_image(ctx, x, y, width, 1); + const GLenum format = GL_RGBA; + const GLenum type = ctx->ReadBuffer->_ColorReadBuffer->DataType; + GLvoid *image = read_color_image(ctx, x, y, type, width, 1); if (!image) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexImage1D"); return; } /* call glTexImage1D to redefine the texture */ ctx->Driver.TexImage1D(ctx, target, level, internalFormat, - width, border, - GL_RGBA, CHAN_TYPE, image, + width, border, format, type, image, &ctx->DefaultPacking, texObj, texImage); _mesa_free(image); } @@ -325,7 +331,7 @@ _swrast_copy_teximage2d( GLcontext *ctx, GLenum target, GLint level, texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; texObj = _mesa_select_tex_object(ctx, texUnit, target); ASSERT(texObj); - texImage = _mesa_select_tex_image(ctx, texUnit, target, level); + texImage = _mesa_select_tex_image(ctx, texObj, target, level); ASSERT(texImage); ASSERT(ctx->Driver.TexImage2D); @@ -359,15 +365,16 @@ _swrast_copy_teximage2d( GLcontext *ctx, GLenum target, GLint level, } else { /* read RGBA image from framebuffer */ - GLchan *image = read_color_image(ctx, x, y, width, height); + const GLenum format = GL_RGBA; + const GLenum type = ctx->ReadBuffer->_ColorReadBuffer->DataType; + GLvoid *image = read_color_image(ctx, x, y, type, width, height); if (!image) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexImage2D"); return; } /* call glTexImage2D to redefine the texture */ ctx->Driver.TexImage2D(ctx, target, level, internalFormat, - width, height, border, - GL_RGBA, CHAN_TYPE, image, + width, height, border, format, type, image, &ctx->DefaultPacking, texObj, texImage); _mesa_free(image); } @@ -393,7 +400,7 @@ _swrast_copy_texsubimage1d( GLcontext *ctx, GLenum target, GLint level, texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; texObj = _mesa_select_tex_object(ctx, texUnit, target); ASSERT(texObj); - texImage = _mesa_select_tex_image(ctx, texUnit, target, level); + texImage = _mesa_select_tex_image(ctx, texObj, target, level); ASSERT(texImage); ASSERT(ctx->Driver.TexImage1D); @@ -427,14 +434,16 @@ _swrast_copy_texsubimage1d( GLcontext *ctx, GLenum target, GLint level, } else { /* read RGBA image from framebuffer */ - GLchan *image = read_color_image(ctx, x, y, width, 1); + const GLenum format = GL_RGBA; + const GLenum type = ctx->ReadBuffer->_ColorReadBuffer->DataType; + GLvoid *image = read_color_image(ctx, x, y, type, width, 1); if (!image) { _mesa_error( ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage1D" ); return; } /* now call glTexSubImage1D to do the real work */ ctx->Driver.TexSubImage1D(ctx, target, level, xoffset, width, - GL_RGBA, CHAN_TYPE, image, + format, type, image, &ctx->DefaultPacking, texObj, texImage); _mesa_free(image); } @@ -465,7 +474,7 @@ _swrast_copy_texsubimage2d( GLcontext *ctx, texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; texObj = _mesa_select_tex_object(ctx, texUnit, target); ASSERT(texObj); - texImage = _mesa_select_tex_image(ctx, texUnit, target, level); + texImage = _mesa_select_tex_image(ctx, texObj, target, level); ASSERT(texImage); ASSERT(ctx->Driver.TexImage2D); @@ -500,7 +509,9 @@ _swrast_copy_texsubimage2d( GLcontext *ctx, } else { /* read RGBA image from framebuffer */ - GLchan *image = read_color_image(ctx, x, y, width, height); + const GLenum format = GL_RGBA; + const GLenum type = ctx->ReadBuffer->_ColorReadBuffer->DataType; + GLvoid *image = read_color_image(ctx, x, y, type, width, height); if (!image) { _mesa_error( ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage2D" ); return; @@ -508,7 +519,7 @@ _swrast_copy_texsubimage2d( GLcontext *ctx, /* now call glTexSubImage2D to do the real work */ ctx->Driver.TexSubImage2D(ctx, target, level, xoffset, yoffset, width, height, - GL_RGBA, CHAN_TYPE, image, + format, type, image, &ctx->DefaultPacking, texObj, texImage); _mesa_free(image); } @@ -536,7 +547,7 @@ _swrast_copy_texsubimage3d( GLcontext *ctx, texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; texObj = _mesa_select_tex_object(ctx, texUnit, target); ASSERT(texObj); - texImage = _mesa_select_tex_image(ctx, texUnit, target, level); + texImage = _mesa_select_tex_image(ctx, texObj, target, level); ASSERT(texImage); ASSERT(ctx->Driver.TexImage3D); @@ -571,7 +582,9 @@ _swrast_copy_texsubimage3d( GLcontext *ctx, } else { /* read RGBA image from framebuffer */ - GLchan *image = read_color_image(ctx, x, y, width, height); + const GLenum format = GL_RGBA; + const GLenum type = ctx->ReadBuffer->_ColorReadBuffer->DataType; + GLvoid *image = read_color_image(ctx, x, y, type, width, height); if (!image) { _mesa_error( ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage3D" ); return; @@ -579,7 +592,7 @@ _swrast_copy_texsubimage3d( GLcontext *ctx, /* now call glTexSubImage3D to do the real work */ ctx->Driver.TexSubImage3D(ctx, target, level, xoffset, yoffset, zoffset, width, height, 1, - GL_RGBA, CHAN_TYPE, image, + format, type, image, &ctx->DefaultPacking, texObj, texImage); _mesa_free(image); } diff --git a/src/mesa/swrast/s_triangle.c b/src/mesa/swrast/s_triangle.c index a1cbd881a73..b17c4354605 100644 --- a/src/mesa/swrast/s_triangle.c +++ b/src/mesa/swrast/s_triangle.c @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.5 + * Version: 6.5.2 * * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. * @@ -163,6 +163,7 @@ _swrast_culltriangle( GLcontext *ctx, #define RENDER_SPAN( span ) \ GLuint i; \ + GLchan rgb[MAX_WIDTH][3]; \ span.intTex[0] -= FIXED_HALF; /* off-by-one error? */ \ span.intTex[1] -= FIXED_HALF; \ for (i = 0; i < span.end; i++) { \ @@ -170,13 +171,13 @@ _swrast_culltriangle( GLcontext *ctx, GLint t = FixedToInt(span.intTex[1]) & tmask; \ GLint pos = (t << twidth_log2) + s; \ pos = pos + pos + pos; /* multiply by 3 */ \ - span.array->rgb[i][RCOMP] = texture[pos]; \ - span.array->rgb[i][GCOMP] = texture[pos+1]; \ - span.array->rgb[i][BCOMP] = texture[pos+2]; \ + rgb[i][RCOMP] = texture[pos]; \ + rgb[i][GCOMP] = texture[pos+1]; \ + rgb[i][BCOMP] = texture[pos+2]; \ span.intTex[0] += span.intTexStep[0]; \ span.intTex[1] += span.intTexStep[1]; \ } \ - rb->PutRowRGB(ctx, rb, span.end, span.x, span.y, span.array->rgb, NULL); + rb->PutRowRGB(ctx, rb, span.end, span.x, span.y, rgb, NULL); #include "s_tritemp.h" @@ -214,6 +215,7 @@ _swrast_culltriangle( GLcontext *ctx, #define RENDER_SPAN( span ) \ GLuint i; \ + GLchan rgb[MAX_WIDTH][3]; \ span.intTex[0] -= FIXED_HALF; /* off-by-one error? */ \ span.intTex[1] -= FIXED_HALF; \ for (i = 0; i < span.end; i++) { \ @@ -223,9 +225,9 @@ _swrast_culltriangle( GLcontext *ctx, GLint t = FixedToInt(span.intTex[1]) & tmask; \ GLint pos = (t << twidth_log2) + s; \ pos = pos + pos + pos; /* multiply by 3 */ \ - span.array->rgb[i][RCOMP] = texture[pos]; \ - span.array->rgb[i][GCOMP] = texture[pos+1]; \ - span.array->rgb[i][BCOMP] = texture[pos+2]; \ + rgb[i][RCOMP] = texture[pos]; \ + rgb[i][GCOMP] = texture[pos+1]; \ + rgb[i][BCOMP] = texture[pos+2]; \ zRow[i] = z; \ span.array->mask[i] = 1; \ } \ @@ -236,8 +238,7 @@ _swrast_culltriangle( GLcontext *ctx, span.intTex[1] += span.intTexStep[1]; \ span.z += span.zStep; \ } \ - rb->PutRowRGB(ctx, rb, span.end, span.x, span.y, \ - span.array->rgb, span.array->mask); + rb->PutRowRGB(ctx, rb, span.end, span.x, span.y, rgb, span.array->mask); #include "s_tritemp.h" @@ -278,7 +279,7 @@ ilerp_2d(GLint ia, GLint ib, GLint v00, GLint v10, GLint v01, GLint v11) * texture env modes. */ static INLINE void -affine_span(GLcontext *ctx, struct sw_span *span, +affine_span(GLcontext *ctx, SWspan *span, struct affine_info *info) { GLchan sample[4]; /* the filtered texture sample */ @@ -601,7 +602,7 @@ struct persp_info static INLINE void -fast_persp_span(GLcontext *ctx, struct sw_span *span, +fast_persp_span(GLcontext *ctx, SWspan *span, struct persp_info *info) { GLchan sample[4]; /* the filtered texture sample */ @@ -1072,7 +1073,7 @@ _swrast_choose_triangle( GLcontext *ctx ) } } - if (ctx->Texture._EnabledCoordUnits || ctx->FragmentProgram._Active || + if (ctx->Texture._EnabledCoordUnits || ctx->FragmentProgram._Enabled || ctx->ATIFragmentShader._Enabled || ctx->ShaderObjects._FragmentShaderPresent) { /* Ugh, we do a _lot_ of tests to pick the best textured tri func */ const struct gl_texture_object *texObj2D; @@ -1088,7 +1089,7 @@ _swrast_choose_triangle( GLcontext *ctx ) /* First see if we can use an optimized 2-D texture function */ if (ctx->Texture._EnabledCoordUnits == 0x1 - && !ctx->FragmentProgram._Active + && !ctx->FragmentProgram._Enabled && !ctx->ATIFragmentShader._Enabled && !ctx->ShaderObjects._FragmentShaderPresent && ctx->Texture.Unit[0]._ReallyEnabled == TEXTURE_2D_BIT diff --git a/src/mesa/swrast/s_tritemp.h b/src/mesa/swrast/s_tritemp.h index 29a7a94da15..9e0a8a3d32a 100644 --- a/src/mesa/swrast/s_tritemp.h +++ b/src/mesa/swrast/s_tritemp.h @@ -216,7 +216,7 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, #endif GLinterp vMin_fx, vMin_fy, vMid_fx, vMid_fy, vMax_fx, vMax_fy; - struct sw_span span; + SWspan span; INIT_SPAN(span, GL_POLYGON, 0, 0, 0); diff --git a/src/mesa/swrast/s_zoom.c b/src/mesa/swrast/s_zoom.c index 3fd914083f9..29b8df41b7e 100644 --- a/src/mesa/swrast/s_zoom.c +++ b/src/mesa/swrast/s_zoom.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.5 + * Version: 6.5.2 * - * Copyright (C) 1999-2005 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2006 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"), @@ -119,11 +119,11 @@ unzoom_x(GLfloat zoomX, GLint imageX, GLint zx) * index/depth_span(). */ static void -zoom_span( GLcontext *ctx, GLint imgX, GLint imgY, const struct sw_span *span, +zoom_span( GLcontext *ctx, GLint imgX, GLint imgY, const SWspan *span, const GLvoid *src, GLenum format ) { - struct sw_span zoomed; - struct span_arrays zoomed_arrays; /* this is big! */ + SWspan zoomed; + SWspanarrays zoomed_arrays; /* this is big! */ GLint x0, x1, y0, y1; GLint zoomedWidth; @@ -144,6 +144,19 @@ zoom_span( GLcontext *ctx, GLint imgX, GLint imgY, const struct sw_span *span, zoomed.x = x0; zoomed.end = zoomedWidth; zoomed.array = &zoomed_arrays; + zoomed_arrays.ChanType = span->array->ChanType; + /* XXX temporary */ +#if CHAN_TYPE == GL_UNSIGNED_BYTE + zoomed_arrays.rgba = zoomed_arrays.color.sz1.rgba; + zoomed_arrays.spec = zoomed_arrays.color.sz1.spec; +#elif CHAN_TYPE == GL_UNSIGNED_SHORT + zoomed_arrays.rgba = zoomed_arrays.color.sz2.rgba; + zoomed_arrays.spec = zoomed_arrays.color.sz2.spec; +#else + zoomed_arrays.rgba = zoomed_arrays.color.sz4.rgba; + zoomed_arrays.spec = zoomed_arrays.color.sz4.spec; +#endif + /* copy fog interp info */ zoomed.fog = span->fog; @@ -190,26 +203,76 @@ zoom_span( GLcontext *ctx, GLint imgX, GLint imgY, const struct sw_span *span, /* zoom the span horizontally */ if (format == GL_RGBA) { - const GLchan (*rgba)[4] = (const GLchan (*)[4]) src; - GLint i; - for (i = 0; i < zoomedWidth; i++) { - GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x; - ASSERT(j >= 0); - ASSERT(j < span->end); - COPY_CHAN4(zoomed.array->rgba[i], rgba[j]); + if (zoomed.array->ChanType == GL_UNSIGNED_BYTE) { + const GLubyte (*rgba)[4] = (const GLubyte (*)[4]) src; + GLint i; + for (i = 0; i < zoomedWidth; i++) { + GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x; + ASSERT(j >= 0); + ASSERT(j < span->end); + COPY_4UBV(zoomed.array->color.sz1.rgba[i], rgba[j]); + } + } + else if (zoomed.array->ChanType == GL_UNSIGNED_SHORT) { + const GLushort (*rgba)[4] = (const GLushort (*)[4]) src; + GLint i; + for (i = 0; i < zoomedWidth; i++) { + GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x; + ASSERT(j >= 0); + ASSERT(j < span->end); + COPY_4V(zoomed.array->color.sz2.rgba[i], rgba[j]); + } + } + else { + const GLfloat (*rgba)[4] = (const GLfloat (*)[4]) src; + GLint i; + for (i = 0; i < zoomedWidth; i++) { + GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x; + ASSERT(j >= 0); + ASSERT(j < span->end); + COPY_4V(zoomed.array->color.sz4.rgba[i], rgba[j]); + } } } else if (format == GL_RGB) { - const GLchan (*rgb)[3] = (const GLchan (*)[3]) src; - GLint i; - for (i = 0; i < zoomedWidth; i++) { - GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x; - ASSERT(j >= 0); - ASSERT(j < span->end); - zoomed.array->rgba[i][0] = rgb[j][0]; - zoomed.array->rgba[i][1] = rgb[j][1]; - zoomed.array->rgba[i][2] = rgb[j][2]; - zoomed.array->rgba[i][3] = CHAN_MAX; + if (zoomed.array->ChanType == GL_UNSIGNED_BYTE) { + const GLubyte (*rgb)[3] = (const GLubyte (*)[3]) src; + GLint i; + for (i = 0; i < zoomedWidth; i++) { + GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x; + ASSERT(j >= 0); + ASSERT(j < span->end); + zoomed.array->color.sz1.rgba[i][0] = rgb[j][0]; + zoomed.array->color.sz1.rgba[i][1] = rgb[j][1]; + zoomed.array->color.sz1.rgba[i][2] = rgb[j][2]; + zoomed.array->color.sz1.rgba[i][3] = 0xff; + } + } + else if (zoomed.array->ChanType == GL_UNSIGNED_SHORT) { + const GLushort (*rgb)[3] = (const GLushort (*)[3]) src; + GLint i; + for (i = 0; i < zoomedWidth; i++) { + GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x; + ASSERT(j >= 0); + ASSERT(j < span->end); + zoomed.array->color.sz2.rgba[i][0] = rgb[j][0]; + zoomed.array->color.sz2.rgba[i][1] = rgb[j][1]; + zoomed.array->color.sz2.rgba[i][2] = rgb[j][2]; + zoomed.array->color.sz2.rgba[i][3] = 0xffff; + } + } + else { + const GLfloat (*rgb)[3] = (const GLfloat (*)[3]) src; + GLint i; + for (i = 0; i < zoomedWidth; i++) { + GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x; + ASSERT(j >= 0); + ASSERT(j < span->end); + zoomed.array->color.sz4.rgba[i][0] = rgb[j][0]; + zoomed.array->color.sz4.rgba[i][1] = rgb[j][1]; + zoomed.array->color.sz4.rgba[i][2] = rgb[j][2]; + zoomed.array->color.sz4.rgba[i][3] = 1.0F; + } } } else if (format == GL_COLOR_INDEX) { @@ -241,22 +304,28 @@ zoom_span( GLcontext *ctx, GLint imgX, GLint imgY, const struct sw_span *span, * going to call _swrast_write_zoomed_span() more than once. * Also, clipping may change the span end value, so store it as well. */ - GLchan rgbaSave[MAX_WIDTH][4]; const GLint end = zoomed.end; /* save */ + /* use specular color array for temp storage */ + void *rgbaSave = zoomed.array->spec; + const GLint pixelSize = + (zoomed.array->ChanType == GL_UNSIGNED_BYTE) ? 4 * sizeof(GLubyte) : + ((zoomed.array->ChanType == GL_UNSIGNED_SHORT) ? 4 * sizeof(GLushort) + : 4 * sizeof(GLfloat)); if (y1 - y0 > 1) { - MEMCPY(rgbaSave, zoomed.array->rgba, zoomed.end * 4 * sizeof(GLchan)); + MEMCPY(rgbaSave, zoomed.array->rgba, zoomed.end * pixelSize); } for (zoomed.y = y0; zoomed.y < y1; zoomed.y++) { _swrast_write_rgba_span(ctx, &zoomed); zoomed.end = end; /* restore */ if (y1 - y0 > 1) { /* restore the colors */ - MEMCPY(zoomed.array->rgba, rgbaSave, zoomed.end*4 * sizeof(GLchan)); + MEMCPY(zoomed.array->rgba, rgbaSave, zoomed.end * pixelSize); } } } else if (format == GL_COLOR_INDEX) { - GLuint indexSave[MAX_WIDTH]; + /* use specular color array for temp storage */ + GLuint *indexSave = (GLuint *) zoomed.array->spec; const GLint end = zoomed.end; /* save */ if (y1 - y0 > 1) { MEMCPY(indexSave, zoomed.array->index, zoomed.end * sizeof(GLuint)); @@ -274,26 +343,24 @@ zoom_span( GLcontext *ctx, GLint imgX, GLint imgY, const struct sw_span *span, void -_swrast_write_zoomed_rgba_span( GLcontext *ctx, GLint imgX, GLint imgY, - const struct sw_span *span, - CONST GLchan rgba[][4]) +_swrast_write_zoomed_rgba_span(GLcontext *ctx, GLint imgX, GLint imgY, + const SWspan *span, const GLvoid *rgba) { - zoom_span(ctx, imgX, imgY, span, (const GLvoid *) rgba, GL_RGBA); + zoom_span(ctx, imgX, imgY, span, rgba, GL_RGBA); } void _swrast_write_zoomed_rgb_span(GLcontext *ctx, GLint imgX, GLint imgY, - const struct sw_span *span, - CONST GLchan rgb[][3]) + const SWspan *span, const GLvoid *rgb) { - zoom_span(ctx, imgX, imgY, span, (const GLvoid *) rgb, GL_RGB); + zoom_span(ctx, imgX, imgY, span, rgb, GL_RGB); } void _swrast_write_zoomed_index_span(GLcontext *ctx, GLint imgX, GLint imgY, - const struct sw_span *span) + const SWspan *span) { zoom_span(ctx, imgX, imgY, span, (const GLvoid *) span->array->index, GL_COLOR_INDEX); @@ -302,7 +369,7 @@ _swrast_write_zoomed_index_span(GLcontext *ctx, GLint imgX, GLint imgY, void _swrast_write_zoomed_depth_span(GLcontext *ctx, GLint imgX, GLint imgY, - const struct sw_span *span) + const SWspan *span) { zoom_span(ctx, imgX, imgY, span, (const GLvoid *) span->array->z, GL_DEPTH_COMPONENT); diff --git a/src/mesa/swrast/s_zoom.h b/src/mesa/swrast/s_zoom.h index d10c270245d..6ca11ac2111 100644 --- a/src/mesa/swrast/s_zoom.h +++ b/src/mesa/swrast/s_zoom.h @@ -31,21 +31,19 @@ extern void _swrast_write_zoomed_rgba_span(GLcontext *ctx, GLint imgX, GLint imgY, - const struct sw_span *span, - CONST GLchan rgb[][4]); + const SWspan *span, const GLvoid *rgba); extern void _swrast_write_zoomed_rgb_span(GLcontext *ctx, GLint imgX, GLint imgY, - const struct sw_span *span, - CONST GLchan rgb[][3]); + const SWspan *span, const GLvoid *rgb); extern void _swrast_write_zoomed_index_span(GLcontext *ctx, GLint imgX, GLint imgY, - const struct sw_span *span); + const SWspan *span); extern void _swrast_write_zoomed_depth_span(GLcontext *ctx, GLint imgX, GLint imgY, - const struct sw_span *span); + const SWspan *span); extern void diff --git a/src/mesa/swrast/swrast.h b/src/mesa/swrast/swrast.h index 2a212342539..09686c8380a 100644 --- a/src/mesa/swrast/swrast.h +++ b/src/mesa/swrast/swrast.h @@ -130,13 +130,10 @@ _swrast_BlitFramebuffer(GLcontext *ctx, GLbitfield mask, GLenum filter); extern void -_swrast_Clear( GLcontext *ctx, GLbitfield mask, GLboolean all, - GLint x, GLint y, GLint width, GLint height ); +_swrast_Clear(GLcontext *ctx, GLbitfield buffers); extern void -_swrast_Accum( GLcontext *ctx, GLenum op, - GLfloat value, GLint xpos, GLint ypos, - GLint width, GLint height ); +_swrast_Accum(GLcontext *ctx, GLenum op, GLfloat value); @@ -255,6 +252,13 @@ extern void _swrast_eject_texture_images(GLcontext *ctx); +#if FEATURE_MESA_program_debug +extern void +_swrast_get_program_register(GLcontext *, enum register_file file, + GLuint index, GLfloat val[4]); +#endif /* FEATURE_MESA_program_debug */ + + /** * The driver interface for the software rasterizer. * XXX this may go away. diff --git a/src/mesa/tnl/t_array_api.c b/src/mesa/tnl/t_array_api.c index 36ea54296ce..6826cf7e24c 100644 --- a/src/mesa/tnl/t_array_api.c +++ b/src/mesa/tnl/t_array_api.c @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.5 + * Version: 6.5.2 * * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. * @@ -115,6 +115,12 @@ _tnl_DrawArrays(GLenum mode, GLint start, GLsizei count) { GET_CURRENT_CONTEXT(ctx); TNLcontext *tnl = TNL_CONTEXT(ctx); + /* It's tempting to get rid of this threshold value because we take + * very different paths if 'count' is less than or greater than 'thresh'. + * I've found/fixed at least one bug which only occured for particular + * array sizes. Also, several conformance tests use very short arrays + * which means the long-array path doesn't get tested. -Brian + */ GLuint thresh = (ctx->Driver.NeedFlush & FLUSH_STORED_VERTICES) ? 30 : 10; if (MESA_VERBOSE & VERBOSE_API) @@ -289,6 +295,18 @@ _tnl_DrawRangeElements(GLenum mode, ui_indices = (GLuint *)_ac_import_elements( ctx, GL_UNSIGNED_INT, count, type, indices ); +#ifdef DEBUG + /* check that array indices really fall inside [start, end] range */ + { + GLuint i; + for (i = 0; i < count; i++) { + if (ui_indices[i] < start || ui_indices[i] > end) { + _mesa_warning(ctx, "Invalid array index in " + "glDrawRangeElements(index=%u)", ui_indices[i]); + } + } + } +#endif assert(!ctx->CompileFlag); diff --git a/src/mesa/tnl/t_array_import.c b/src/mesa/tnl/t_array_import.c index 0677a1fd3b2..13c5689ceb9 100644 --- a/src/mesa/tnl/t_array_import.c +++ b/src/mesa/tnl/t_array_import.c @@ -327,9 +327,10 @@ void _tnl_vb_bind_arrays( GLcontext *ctx, GLint start, GLint end) } else if (index >= VERT_ATTRIB_GENERIC1 && index <= VERT_ATTRIB_GENERIC15) { - if (program && !program->IsNVProgram) { + const GLuint arrayIndex = index - VERT_ATTRIB_GENERIC0; + if (program && !program->IsNVProgram && + ctx->Array.ArrayObj->VertexAttrib[arrayIndex].Enabled) { /* GL_ARB_vertex_program: bind a generic attribute array */ - const GLuint arrayIndex = index - VERT_ATTRIB_GENERIC0; _tnl_import_attrib(ctx, arrayIndex, GL_FALSE, GL_TRUE); VB->AttribPtr[index] = &tmp->Attribs[arrayIndex]; } diff --git a/src/mesa/tnl/t_context.c b/src/mesa/tnl/t_context.c index b6f5152c741..55b40c0531f 100644 --- a/src/mesa/tnl/t_context.c +++ b/src/mesa/tnl/t_context.c @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.5 + * Version: 6.5.2 * * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. * @@ -184,7 +184,8 @@ _tnl_InvalidateState( GLcontext *ctx, GLuint new_state ) if (ctx->Fog.Enabled || (ctx->FragmentProgram._Active && - ctx->FragmentProgram._Current->FogOption != GL_NONE)) + (ctx->FragmentProgram._Current->FogOption != GL_NONE || + ctx->FragmentProgram._Current->Base.InputsRead & FRAG_BIT_FOGC))) RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_FOG ); if (ctx->Polygon.FrontMode != GL_FILL || diff --git a/src/mesa/tnl/t_context.h b/src/mesa/tnl/t_context.h index 97ad79c58fd..d5414bd730d 100644 --- a/src/mesa/tnl/t_context.h +++ b/src/mesa/tnl/t_context.h @@ -248,6 +248,7 @@ struct _tnl_dynfn_generators { struct tnl_vtx { GLfloat buffer[VERT_BUFFER_SIZE]; GLubyte attrsz[_TNL_ATTRIB_MAX]; + GLubyte active_sz[_TNL_ATTRIB_MAX]; GLuint vertex_size; struct tnl_prim prim[TNL_MAX_PRIM]; GLuint prim_count; diff --git a/src/mesa/tnl/t_vb_arbprogram.c b/src/mesa/tnl/t_vb_arbprogram.c index 0ff26df713a..71fb45dd95c 100644 --- a/src/mesa/tnl/t_vb_arbprogram.c +++ b/src/mesa/tnl/t_vb_arbprogram.c @@ -1182,7 +1182,8 @@ do_ndc_cliptest(GLcontext *ctx, struct arb_vp_machine *m) /* Test userclip planes. This contributes to VB->ClipMask. */ - if (ctx->Transform.ClipPlanesEnabled && !ctx->VertexProgram._Enabled) { + if (ctx->Transform.ClipPlanesEnabled && (!ctx->VertexProgram._Enabled || + ctx->VertexProgram.Current->IsPositionInvariant)) { userclip( ctx, VB->ClipPtr, m->clipmask, diff --git a/src/mesa/tnl/t_vb_cliptmp.h b/src/mesa/tnl/t_vb_cliptmp.h index f3776e7eeb6..788fe329ed8 100644 --- a/src/mesa/tnl/t_vb_cliptmp.h +++ b/src/mesa/tnl/t_vb_cliptmp.h @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.5.1 + * Version: 6.5.2 * * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. * @@ -125,6 +125,7 @@ TAG(clip_line)( GLcontext *ctx, GLuint v0, GLuint v1, GLubyte mask ) GLfloat t0 = 0; GLfloat t1 = 0; GLuint p; + const GLuint v0_orig = v0; if (mask & 0x3f) { LINE_CLIP( CLIP_RIGHT_BIT, -1, 0, 0, 1 ); @@ -153,12 +154,17 @@ TAG(clip_line)( GLcontext *ctx, GLuint v0, GLuint v1, GLubyte mask ) v0 = newvert; newvert++; } - else + else { ASSERT(t0 == 0.0); + } + /* Note: we need to use vertex v0_orig when computing the new + * interpolated/clipped vertex position, not the current v0 which + * may have got set when we clipped the other end of the line! + */ if (VB->ClipMask[v1]) { - INTERP_4F( t1, coord[newvert], coord[v1], coord[v0] ); - interp( ctx, t1, newvert, v1, v0, GL_FALSE ); + INTERP_4F( t1, coord[newvert], coord[v1], coord[v0_orig] ); + interp( ctx, t1, newvert, v1, v0_orig, GL_FALSE ); if (ctx->Light.ShadeModel == GL_FLAT) tnl->Driver.Render.CopyPV( ctx, newvert, v1 ); @@ -167,8 +173,9 @@ TAG(clip_line)( GLcontext *ctx, GLuint v0, GLuint v1, GLubyte mask ) newvert++; } - else + else { ASSERT(t1 == 0.0); + } tnl->Driver.Render.ClippedLine( ctx, v0, v1 ); } diff --git a/src/mesa/tnl/t_vb_program.c b/src/mesa/tnl/t_vb_program.c index 36ee4b2f46a..f11ac616f16 100644 --- a/src/mesa/tnl/t_vb_program.c +++ b/src/mesa/tnl/t_vb_program.c @@ -76,6 +76,7 @@ run_vp( GLcontext *ctx, struct tnl_pipeline_stage *stage ) struct vp_stage_data *store = VP_STAGE_DATA(stage); struct vertex_buffer *VB = &tnl->vb; struct gl_vertex_program *program = ctx->VertexProgram.Current; + struct vp_machine machine; GLuint i; if (ctx->ShaderObjects._VertexShaderPresent) @@ -91,7 +92,7 @@ run_vp( GLcontext *ctx, struct tnl_pipeline_stage *stage ) for (i = 0; i < VB->Count; i++) { GLuint attr; - _mesa_init_vp_per_vertex_registers(ctx); + _mesa_init_vp_per_vertex_registers(ctx, &machine); #if 0 printf("Input %d: %f, %f, %f, %f\n", i, @@ -118,30 +119,29 @@ run_vp( GLcontext *ctx, struct tnl_pipeline_stage *stage ) const GLuint size = VB->AttribPtr[attr]->size; const GLuint stride = VB->AttribPtr[attr]->stride; const GLfloat *data = (GLfloat *) (ptr + stride * i); - COPY_CLEAN_4V(ctx->VertexProgram.Inputs[attr], size, data); + COPY_CLEAN_4V(machine.Inputs[attr], size, data); } } /* execute the program */ ASSERT(program); - _mesa_exec_vertex_program(ctx, program); + _mesa_exec_vertex_program(ctx, &machine, program); /* Fixup fog an point size results if needed */ if (ctx->Fog.Enabled && (program->Base.OutputsWritten & (1 << VERT_RESULT_FOGC)) == 0) { - ctx->VertexProgram.Outputs[VERT_RESULT_FOGC][0] = 1.0; + machine.Outputs[VERT_RESULT_FOGC][0] = 1.0; } if (ctx->VertexProgram.PointSizeEnabled && (program->Base.OutputsWritten & (1 << VERT_RESULT_PSIZ)) == 0) { - ctx->VertexProgram.Outputs[VERT_RESULT_PSIZ][0] = ctx->Point.Size; + machine.Outputs[VERT_RESULT_PSIZ][0] = ctx->Point.Size; } /* copy the output registers into the VB->attribs arrays */ /* XXX (optimize) could use a conditional and smaller loop limit here */ for (attr = 0; attr < 15; attr++) { - COPY_4V(store->attribs[attr].data[i], - ctx->VertexProgram.Outputs[attr]); + COPY_4V(store->attribs[attr].data[i], machine.Outputs[attr]); } } diff --git a/src/mesa/tnl/t_vtx_api.c b/src/mesa/tnl/t_vtx_api.c index 9379d91780c..b766ce2d2ce 100644 --- a/src/mesa/tnl/t_vtx_api.c +++ b/src/mesa/tnl/t_vtx_api.c @@ -174,6 +174,8 @@ static void _tnl_copy_to_current( GLcontext *ctx ) } ctx->Driver.NeedFlush &= ~FLUSH_UPDATE_CURRENT; + + ctx->NewState |= _NEW_LIGHT; } @@ -321,13 +323,17 @@ static void _tnl_fixup_vertex( GLcontext *ctx, GLuint attr, GLuint sz ) static const GLfloat id[4] = { 0, 0, 0, 1 }; int i; + if (0) + _mesa_printf("%s attr %d sz %d -> %d\n", + __FUNCTION__, attr, tnl->vtx.attrsz[attr], sz); + if (tnl->vtx.attrsz[attr] < sz) { /* New size is larger. Need to flush existing vertices and get * an enlarged vertex format. */ _tnl_wrap_upgrade_vertex( ctx, attr, sz ); } - else if (tnl->vtx.attrsz[attr] > sz) { + else if (sz < tnl->vtx.active_sz[attr]) { /* New size is smaller - just need to fill in some * zeros. Don't need to flush or wrap. */ @@ -335,6 +341,8 @@ static void _tnl_fixup_vertex( GLcontext *ctx, GLuint attr, GLuint sz ) tnl->vtx.attrptr[attr][i-1] = id[i-1]; } + tnl->vtx.active_sz[attr] = sz; + /* Does setting NeedFlush belong here? Necessitates resetting * vtxfmt on each flush (otherwise flags won't get reset * afterwards). @@ -398,7 +406,7 @@ static tnl_attrfv_func do_choose( GLuint attr, GLuint sz ) { GET_CURRENT_CONTEXT( ctx ); TNLcontext *tnl = TNL_CONTEXT(ctx); - GLuint oldsz = tnl->vtx.attrsz[attr]; + GLuint oldsz = tnl->vtx.active_sz[attr]; assert(attr < _TNL_MAX_ATTR_CODEGEN); @@ -519,6 +527,7 @@ reset_attrfv(TNLcontext *tnl) if (tnl->vtx.attrsz[i]) { GLint j = tnl->vtx.attrsz[i] - 1; tnl->vtx.attrsz[i] = 0; + tnl->vtx.active_sz[i] = 0; if (i < _TNL_MAX_ATTR_CODEGEN) { while (j >= 0) { @@ -550,7 +559,7 @@ reset_attrfv(TNLcontext *tnl) */ #define OTHER_ATTR( A, N, params ) \ do { \ - if (tnl->vtx.attrsz[A] != N) { \ + if (tnl->vtx.active_sz[A] != N) { \ _tnl_fixup_vertex( ctx, A, N ); \ } \ \ @@ -650,7 +659,7 @@ static void GLAPIENTRY _tnl_EvalCoord1f( GLfloat u ) for (i = 0; i < _TNL_NUM_EVAL; i++) { if (tnl->vtx.eval.map1[i].map) - if (tnl->vtx.attrsz[i] != tnl->vtx.eval.map1[i].sz) + if (tnl->vtx.active_sz[i] != tnl->vtx.eval.map1[i].sz) _tnl_fixup_vertex( ctx, i, tnl->vtx.eval.map1[i].sz ); } } @@ -678,12 +687,12 @@ static void GLAPIENTRY _tnl_EvalCoord2f( GLfloat u, GLfloat v ) for (i = 0; i < _TNL_NUM_EVAL; i++) { if (tnl->vtx.eval.map2[i].map) - if (tnl->vtx.attrsz[i] != tnl->vtx.eval.map2[i].sz) + if (tnl->vtx.active_sz[i] != tnl->vtx.eval.map2[i].sz) _tnl_fixup_vertex( ctx, i, tnl->vtx.eval.map2[i].sz ); } if (ctx->Eval.AutoNormal) - if (tnl->vtx.attrsz[_TNL_ATTRIB_NORMAL] != 3) + if (tnl->vtx.active_sz[_TNL_ATTRIB_NORMAL] != 3) _tnl_fixup_vertex( ctx, _TNL_ATTRIB_NORMAL, 3 ); } @@ -1005,8 +1014,10 @@ void _tnl_vtx_init( GLcontext *ctx ) _mesa_memcpy( tnl->vtx.tabfv, choose, sizeof(choose) ); - for (i = 0 ; i < _TNL_ATTRIB_MAX ; i++) + for (i = 0 ; i < _TNL_ATTRIB_MAX ; i++) { tnl->vtx.attrsz[i] = 0; + tnl->vtx.active_sz[i] = 0; + } tnl->vtx.vertex_size = 0; tnl->vtx.have_materials = 0; diff --git a/src/mesa/x86-64/glapi_x86-64.S b/src/mesa/x86-64/glapi_x86-64.S index 6ce188cb97c..d8ef5eae095 100644 --- a/src/mesa/x86-64/glapi_x86-64.S +++ b/src/mesa/x86-64/glapi_x86-64.S @@ -40,6 +40,7 @@ # if defined(USE_MGL_NAMESPACE) # define GL_PREFIX(n) GLNAME(CONCAT(mgl,n)) +# define _glapi_Dispatch _mglapi_Dispatch # else # define GL_PREFIX(n) GLNAME(CONCAT(gl,n)) # endif @@ -15146,9 +15147,9 @@ GL_PREFIX(MultiTexCoord4svARB): .size GL_PREFIX(MultiTexCoord4svARB), .-GL_PREFIX(MultiTexCoord4svARB) .p2align 4,,15 - .globl GL_PREFIX(StencilFuncSeparate) - .type GL_PREFIX(StencilFuncSeparate), @function -GL_PREFIX(StencilFuncSeparate): + .globl GL_PREFIX(AttachShader) + .type GL_PREFIX(AttachShader), @function +GL_PREFIX(AttachShader): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3264(%rax), %r11 @@ -15156,13 +15157,9 @@ GL_PREFIX(StencilFuncSeparate): #elif defined(PTHREADS) pushq %rdi pushq %rsi - pushq %rdx - pushq %rcx pushq %rbp call _x86_64_get_dispatch@PLT popq %rbp - popq %rcx - popq %rdx popq %rsi popq %rdi movq 3264(%rax), %r11 @@ -15176,36 +15173,28 @@ GL_PREFIX(StencilFuncSeparate): 1: pushq %rdi pushq %rsi - pushq %rdx - pushq %rcx pushq %rbp call _glapi_get_dispatch popq %rbp - popq %rcx - popq %rdx popq %rsi popq %rdi movq 3264(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(StencilFuncSeparate), .-GL_PREFIX(StencilFuncSeparate) + .size GL_PREFIX(AttachShader), .-GL_PREFIX(AttachShader) .p2align 4,,15 - .globl GL_PREFIX(StencilMaskSeparate) - .type GL_PREFIX(StencilMaskSeparate), @function -GL_PREFIX(StencilMaskSeparate): + .globl GL_PREFIX(CreateProgram) + .type GL_PREFIX(CreateProgram), @function +GL_PREFIX(CreateProgram): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3272(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) - pushq %rdi - pushq %rsi pushq %rbp call _x86_64_get_dispatch@PLT popq %rbp - popq %rsi - popq %rdi movq 3272(%rax), %r11 jmp *%r11 #else @@ -15215,37 +15204,25 @@ GL_PREFIX(StencilMaskSeparate): movq 3272(%rax), %r11 jmp *%r11 1: - pushq %rdi - pushq %rsi pushq %rbp call _glapi_get_dispatch popq %rbp - popq %rsi - popq %rdi movq 3272(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(StencilMaskSeparate), .-GL_PREFIX(StencilMaskSeparate) + .size GL_PREFIX(CreateProgram), .-GL_PREFIX(CreateProgram) .p2align 4,,15 - .globl GL_PREFIX(StencilOpSeparate) - .type GL_PREFIX(StencilOpSeparate), @function -GL_PREFIX(StencilOpSeparate): + .globl GL_PREFIX(CreateShader) + .type GL_PREFIX(CreateShader), @function +GL_PREFIX(CreateShader): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3280(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi popq %rdi movq 3280(%rax), %r11 jmp *%r11 @@ -15257,25 +15234,17 @@ GL_PREFIX(StencilOpSeparate): jmp *%r11 1: pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi popq %rdi movq 3280(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(StencilOpSeparate), .-GL_PREFIX(StencilOpSeparate) + .size GL_PREFIX(CreateShader), .-GL_PREFIX(CreateShader) .p2align 4,,15 - .globl GL_PREFIX(LoadTransposeMatrixdARB) - .type GL_PREFIX(LoadTransposeMatrixdARB), @function -GL_PREFIX(LoadTransposeMatrixdARB): + .globl GL_PREFIX(DeleteProgram) + .type GL_PREFIX(DeleteProgram), @function +GL_PREFIX(DeleteProgram): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3288(%rax), %r11 @@ -15299,12 +15268,12 @@ GL_PREFIX(LoadTransposeMatrixdARB): movq 3288(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(LoadTransposeMatrixdARB), .-GL_PREFIX(LoadTransposeMatrixdARB) + .size GL_PREFIX(DeleteProgram), .-GL_PREFIX(DeleteProgram) .p2align 4,,15 - .globl GL_PREFIX(LoadTransposeMatrixfARB) - .type GL_PREFIX(LoadTransposeMatrixfARB), @function -GL_PREFIX(LoadTransposeMatrixfARB): + .globl GL_PREFIX(DeleteShader) + .type GL_PREFIX(DeleteShader), @function +GL_PREFIX(DeleteShader): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3296(%rax), %r11 @@ -15328,19 +15297,23 @@ GL_PREFIX(LoadTransposeMatrixfARB): movq 3296(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(LoadTransposeMatrixfARB), .-GL_PREFIX(LoadTransposeMatrixfARB) + .size GL_PREFIX(DeleteShader), .-GL_PREFIX(DeleteShader) .p2align 4,,15 - .globl GL_PREFIX(MultTransposeMatrixdARB) - .type GL_PREFIX(MultTransposeMatrixdARB), @function -GL_PREFIX(MultTransposeMatrixdARB): + .globl GL_PREFIX(DetachShader) + .type GL_PREFIX(DetachShader), @function +GL_PREFIX(DetachShader): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3304(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi + pushq %rsi + pushq %rbp call _x86_64_get_dispatch@PLT + popq %rbp + popq %rsi popq %rdi movq 3304(%rax), %r11 jmp *%r11 @@ -15352,24 +15325,36 @@ GL_PREFIX(MultTransposeMatrixdARB): jmp *%r11 1: pushq %rdi + pushq %rsi + pushq %rbp call _glapi_get_dispatch + popq %rbp + popq %rsi popq %rdi movq 3304(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(MultTransposeMatrixdARB), .-GL_PREFIX(MultTransposeMatrixdARB) + .size GL_PREFIX(DetachShader), .-GL_PREFIX(DetachShader) .p2align 4,,15 - .globl GL_PREFIX(MultTransposeMatrixfARB) - .type GL_PREFIX(MultTransposeMatrixfARB), @function -GL_PREFIX(MultTransposeMatrixfARB): + .globl GL_PREFIX(GetAttachedShaders) + .type GL_PREFIX(GetAttachedShaders), @function +GL_PREFIX(GetAttachedShaders): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3312(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi + pushq %rsi + pushq %rdx + pushq %rcx + pushq %rbp call _x86_64_get_dispatch@PLT + popq %rbp + popq %rcx + popq %rdx + popq %rsi popq %rdi movq 3312(%rax), %r11 jmp *%r11 @@ -15381,17 +15366,25 @@ GL_PREFIX(MultTransposeMatrixfARB): jmp *%r11 1: pushq %rdi + pushq %rsi + pushq %rdx + pushq %rcx + pushq %rbp call _glapi_get_dispatch + popq %rbp + popq %rcx + popq %rdx + popq %rsi popq %rdi movq 3312(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(MultTransposeMatrixfARB), .-GL_PREFIX(MultTransposeMatrixfARB) + .size GL_PREFIX(GetAttachedShaders), .-GL_PREFIX(GetAttachedShaders) .p2align 4,,15 - .globl GL_PREFIX(SampleCoverageARB) - .type GL_PREFIX(SampleCoverageARB), @function -GL_PREFIX(SampleCoverageARB): + .globl GL_PREFIX(GetProgramInfoLog) + .type GL_PREFIX(GetProgramInfoLog), @function +GL_PREFIX(GetProgramInfoLog): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3320(%rax), %r11 @@ -15399,9 +15392,13 @@ GL_PREFIX(SampleCoverageARB): #elif defined(PTHREADS) pushq %rdi pushq %rsi + pushq %rdx + pushq %rcx pushq %rbp call _x86_64_get_dispatch@PLT popq %rbp + popq %rcx + popq %rdx popq %rsi popq %rdi movq 3320(%rax), %r11 @@ -15415,20 +15412,24 @@ GL_PREFIX(SampleCoverageARB): 1: pushq %rdi pushq %rsi + pushq %rdx + pushq %rcx pushq %rbp call _glapi_get_dispatch popq %rbp + popq %rcx + popq %rdx popq %rsi popq %rdi movq 3320(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(SampleCoverageARB), .-GL_PREFIX(SampleCoverageARB) + .size GL_PREFIX(GetProgramInfoLog), .-GL_PREFIX(GetProgramInfoLog) .p2align 4,,15 - .globl GL_PREFIX(CompressedTexImage1DARB) - .type GL_PREFIX(CompressedTexImage1DARB), @function -GL_PREFIX(CompressedTexImage1DARB): + .globl GL_PREFIX(GetProgramiv) + .type GL_PREFIX(GetProgramiv), @function +GL_PREFIX(GetProgramiv): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3328(%rax), %r11 @@ -15437,15 +15438,7 @@ GL_PREFIX(CompressedTexImage1DARB): pushq %rdi pushq %rsi pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp call _x86_64_get_dispatch@PLT - popq %rbp - popq %r9 - popq %r8 - popq %rcx popq %rdx popq %rsi popq %rdi @@ -15461,27 +15454,19 @@ GL_PREFIX(CompressedTexImage1DARB): pushq %rdi pushq %rsi pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp call _glapi_get_dispatch - popq %rbp - popq %r9 - popq %r8 - popq %rcx popq %rdx popq %rsi popq %rdi movq 3328(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(CompressedTexImage1DARB), .-GL_PREFIX(CompressedTexImage1DARB) + .size GL_PREFIX(GetProgramiv), .-GL_PREFIX(GetProgramiv) .p2align 4,,15 - .globl GL_PREFIX(CompressedTexImage2DARB) - .type GL_PREFIX(CompressedTexImage2DARB), @function -GL_PREFIX(CompressedTexImage2DARB): + .globl GL_PREFIX(GetShaderInfoLog) + .type GL_PREFIX(GetShaderInfoLog), @function +GL_PREFIX(GetShaderInfoLog): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3336(%rax), %r11 @@ -15491,13 +15476,9 @@ GL_PREFIX(CompressedTexImage2DARB): pushq %rsi pushq %rdx pushq %rcx - pushq %r8 - pushq %r9 pushq %rbp call _x86_64_get_dispatch@PLT popq %rbp - popq %r9 - popq %r8 popq %rcx popq %rdx popq %rsi @@ -15515,13 +15496,9 @@ GL_PREFIX(CompressedTexImage2DARB): pushq %rsi pushq %rdx pushq %rcx - pushq %r8 - pushq %r9 pushq %rbp call _glapi_get_dispatch popq %rbp - popq %r9 - popq %r8 popq %rcx popq %rdx popq %rsi @@ -15529,12 +15506,12 @@ GL_PREFIX(CompressedTexImage2DARB): movq 3336(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(CompressedTexImage2DARB), .-GL_PREFIX(CompressedTexImage2DARB) + .size GL_PREFIX(GetShaderInfoLog), .-GL_PREFIX(GetShaderInfoLog) .p2align 4,,15 - .globl GL_PREFIX(CompressedTexImage3DARB) - .type GL_PREFIX(CompressedTexImage3DARB), @function -GL_PREFIX(CompressedTexImage3DARB): + .globl GL_PREFIX(GetShaderiv) + .type GL_PREFIX(GetShaderiv), @function +GL_PREFIX(GetShaderiv): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3344(%rax), %r11 @@ -15543,15 +15520,7 @@ GL_PREFIX(CompressedTexImage3DARB): pushq %rdi pushq %rsi pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp call _x86_64_get_dispatch@PLT - popq %rbp - popq %r9 - popq %r8 - popq %rcx popq %rdx popq %rsi popq %rdi @@ -15567,46 +15536,26 @@ GL_PREFIX(CompressedTexImage3DARB): pushq %rdi pushq %rsi pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp call _glapi_get_dispatch - popq %rbp - popq %r9 - popq %r8 - popq %rcx popq %rdx popq %rsi popq %rdi movq 3344(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(CompressedTexImage3DARB), .-GL_PREFIX(CompressedTexImage3DARB) + .size GL_PREFIX(GetShaderiv), .-GL_PREFIX(GetShaderiv) .p2align 4,,15 - .globl GL_PREFIX(CompressedTexSubImage1DARB) - .type GL_PREFIX(CompressedTexSubImage1DARB), @function -GL_PREFIX(CompressedTexSubImage1DARB): + .globl GL_PREFIX(IsProgram) + .type GL_PREFIX(IsProgram), @function +GL_PREFIX(IsProgram): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3352(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp call _x86_64_get_dispatch@PLT - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi popq %rdi movq 3352(%rax), %r11 jmp *%r11 @@ -15618,48 +15567,24 @@ GL_PREFIX(CompressedTexSubImage1DARB): jmp *%r11 1: pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp call _glapi_get_dispatch - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi popq %rdi movq 3352(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(CompressedTexSubImage1DARB), .-GL_PREFIX(CompressedTexSubImage1DARB) + .size GL_PREFIX(IsProgram), .-GL_PREFIX(IsProgram) .p2align 4,,15 - .globl GL_PREFIX(CompressedTexSubImage2DARB) - .type GL_PREFIX(CompressedTexSubImage2DARB), @function -GL_PREFIX(CompressedTexSubImage2DARB): + .globl GL_PREFIX(IsShader) + .type GL_PREFIX(IsShader), @function +GL_PREFIX(IsShader): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3360(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp call _x86_64_get_dispatch@PLT - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi popq %rdi movq 3360(%rax), %r11 jmp *%r11 @@ -15671,29 +15596,17 @@ GL_PREFIX(CompressedTexSubImage2DARB): jmp *%r11 1: pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp call _glapi_get_dispatch - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi popq %rdi movq 3360(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(CompressedTexSubImage2DARB), .-GL_PREFIX(CompressedTexSubImage2DARB) + .size GL_PREFIX(IsShader), .-GL_PREFIX(IsShader) .p2align 4,,15 - .globl GL_PREFIX(CompressedTexSubImage3DARB) - .type GL_PREFIX(CompressedTexSubImage3DARB), @function -GL_PREFIX(CompressedTexSubImage3DARB): + .globl GL_PREFIX(StencilFuncSeparate) + .type GL_PREFIX(StencilFuncSeparate), @function +GL_PREFIX(StencilFuncSeparate): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3368(%rax), %r11 @@ -15703,13 +15616,9 @@ GL_PREFIX(CompressedTexSubImage3DARB): pushq %rsi pushq %rdx pushq %rcx - pushq %r8 - pushq %r9 pushq %rbp call _x86_64_get_dispatch@PLT popq %rbp - popq %r9 - popq %r8 popq %rcx popq %rdx popq %rsi @@ -15727,13 +15636,9 @@ GL_PREFIX(CompressedTexSubImage3DARB): pushq %rsi pushq %rdx pushq %rcx - pushq %r8 - pushq %r9 pushq %rbp call _glapi_get_dispatch popq %rbp - popq %r9 - popq %r8 popq %rcx popq %rdx popq %rsi @@ -15741,12 +15646,12 @@ GL_PREFIX(CompressedTexSubImage3DARB): movq 3368(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(CompressedTexSubImage3DARB), .-GL_PREFIX(CompressedTexSubImage3DARB) + .size GL_PREFIX(StencilFuncSeparate), .-GL_PREFIX(StencilFuncSeparate) .p2align 4,,15 - .globl GL_PREFIX(GetCompressedTexImageARB) - .type GL_PREFIX(GetCompressedTexImageARB), @function -GL_PREFIX(GetCompressedTexImageARB): + .globl GL_PREFIX(StencilMaskSeparate) + .type GL_PREFIX(StencilMaskSeparate), @function +GL_PREFIX(StencilMaskSeparate): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3376(%rax), %r11 @@ -15754,9 +15659,9 @@ GL_PREFIX(GetCompressedTexImageARB): #elif defined(PTHREADS) pushq %rdi pushq %rsi - pushq %rdx + pushq %rbp call _x86_64_get_dispatch@PLT - popq %rdx + popq %rbp popq %rsi popq %rdi movq 3376(%rax), %r11 @@ -15770,27 +15675,35 @@ GL_PREFIX(GetCompressedTexImageARB): 1: pushq %rdi pushq %rsi - pushq %rdx + pushq %rbp call _glapi_get_dispatch - popq %rdx + popq %rbp popq %rsi popq %rdi movq 3376(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetCompressedTexImageARB), .-GL_PREFIX(GetCompressedTexImageARB) + .size GL_PREFIX(StencilMaskSeparate), .-GL_PREFIX(StencilMaskSeparate) .p2align 4,,15 - .globl GL_PREFIX(DisableVertexAttribArrayARB) - .type GL_PREFIX(DisableVertexAttribArrayARB), @function -GL_PREFIX(DisableVertexAttribArrayARB): + .globl GL_PREFIX(StencilOpSeparate) + .type GL_PREFIX(StencilOpSeparate), @function +GL_PREFIX(StencilOpSeparate): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3384(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi + pushq %rsi + pushq %rdx + pushq %rcx + pushq %rbp call _x86_64_get_dispatch@PLT + popq %rbp + popq %rcx + popq %rdx + popq %rsi popq %rdi movq 3384(%rax), %r11 jmp *%r11 @@ -15802,24 +15715,40 @@ GL_PREFIX(DisableVertexAttribArrayARB): jmp *%r11 1: pushq %rdi + pushq %rsi + pushq %rdx + pushq %rcx + pushq %rbp call _glapi_get_dispatch - popq %rdi - movq 3384(%rax), %r11 + popq %rbp + popq %rcx + popq %rdx + popq %rsi + popq %rdi + movq 3384(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(DisableVertexAttribArrayARB), .-GL_PREFIX(DisableVertexAttribArrayARB) + .size GL_PREFIX(StencilOpSeparate), .-GL_PREFIX(StencilOpSeparate) .p2align 4,,15 - .globl GL_PREFIX(EnableVertexAttribArrayARB) - .type GL_PREFIX(EnableVertexAttribArrayARB), @function -GL_PREFIX(EnableVertexAttribArrayARB): + .globl GL_PREFIX(UniformMatrix2x3fv) + .type GL_PREFIX(UniformMatrix2x3fv), @function +GL_PREFIX(UniformMatrix2x3fv): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3392(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi + pushq %rsi + pushq %rdx + pushq %rcx + pushq %rbp call _x86_64_get_dispatch@PLT + popq %rbp + popq %rcx + popq %rdx + popq %rsi popq %rdi movq 3392(%rax), %r11 jmp *%r11 @@ -15831,17 +15760,25 @@ GL_PREFIX(EnableVertexAttribArrayARB): jmp *%r11 1: pushq %rdi + pushq %rsi + pushq %rdx + pushq %rcx + pushq %rbp call _glapi_get_dispatch + popq %rbp + popq %rcx + popq %rdx + popq %rsi popq %rdi movq 3392(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(EnableVertexAttribArrayARB), .-GL_PREFIX(EnableVertexAttribArrayARB) + .size GL_PREFIX(UniformMatrix2x3fv), .-GL_PREFIX(UniformMatrix2x3fv) .p2align 4,,15 - .globl GL_PREFIX(GetProgramEnvParameterdvARB) - .type GL_PREFIX(GetProgramEnvParameterdvARB), @function -GL_PREFIX(GetProgramEnvParameterdvARB): + .globl GL_PREFIX(UniformMatrix2x4fv) + .type GL_PREFIX(UniformMatrix2x4fv), @function +GL_PREFIX(UniformMatrix2x4fv): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3400(%rax), %r11 @@ -15850,7 +15787,11 @@ GL_PREFIX(GetProgramEnvParameterdvARB): pushq %rdi pushq %rsi pushq %rdx + pushq %rcx + pushq %rbp call _x86_64_get_dispatch@PLT + popq %rbp + popq %rcx popq %rdx popq %rsi popq %rdi @@ -15866,19 +15807,23 @@ GL_PREFIX(GetProgramEnvParameterdvARB): pushq %rdi pushq %rsi pushq %rdx + pushq %rcx + pushq %rbp call _glapi_get_dispatch + popq %rbp + popq %rcx popq %rdx popq %rsi popq %rdi movq 3400(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetProgramEnvParameterdvARB), .-GL_PREFIX(GetProgramEnvParameterdvARB) + .size GL_PREFIX(UniformMatrix2x4fv), .-GL_PREFIX(UniformMatrix2x4fv) .p2align 4,,15 - .globl GL_PREFIX(GetProgramEnvParameterfvARB) - .type GL_PREFIX(GetProgramEnvParameterfvARB), @function -GL_PREFIX(GetProgramEnvParameterfvARB): + .globl GL_PREFIX(UniformMatrix3x2fv) + .type GL_PREFIX(UniformMatrix3x2fv), @function +GL_PREFIX(UniformMatrix3x2fv): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3408(%rax), %r11 @@ -15887,7 +15832,11 @@ GL_PREFIX(GetProgramEnvParameterfvARB): pushq %rdi pushq %rsi pushq %rdx + pushq %rcx + pushq %rbp call _x86_64_get_dispatch@PLT + popq %rbp + popq %rcx popq %rdx popq %rsi popq %rdi @@ -15903,19 +15852,23 @@ GL_PREFIX(GetProgramEnvParameterfvARB): pushq %rdi pushq %rsi pushq %rdx + pushq %rcx + pushq %rbp call _glapi_get_dispatch + popq %rbp + popq %rcx popq %rdx popq %rsi popq %rdi movq 3408(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetProgramEnvParameterfvARB), .-GL_PREFIX(GetProgramEnvParameterfvARB) + .size GL_PREFIX(UniformMatrix3x2fv), .-GL_PREFIX(UniformMatrix3x2fv) .p2align 4,,15 - .globl GL_PREFIX(GetProgramLocalParameterdvARB) - .type GL_PREFIX(GetProgramLocalParameterdvARB), @function -GL_PREFIX(GetProgramLocalParameterdvARB): + .globl GL_PREFIX(UniformMatrix3x4fv) + .type GL_PREFIX(UniformMatrix3x4fv), @function +GL_PREFIX(UniformMatrix3x4fv): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3416(%rax), %r11 @@ -15924,7 +15877,11 @@ GL_PREFIX(GetProgramLocalParameterdvARB): pushq %rdi pushq %rsi pushq %rdx + pushq %rcx + pushq %rbp call _x86_64_get_dispatch@PLT + popq %rbp + popq %rcx popq %rdx popq %rsi popq %rdi @@ -15940,19 +15897,23 @@ GL_PREFIX(GetProgramLocalParameterdvARB): pushq %rdi pushq %rsi pushq %rdx + pushq %rcx + pushq %rbp call _glapi_get_dispatch + popq %rbp + popq %rcx popq %rdx popq %rsi popq %rdi movq 3416(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetProgramLocalParameterdvARB), .-GL_PREFIX(GetProgramLocalParameterdvARB) + .size GL_PREFIX(UniformMatrix3x4fv), .-GL_PREFIX(UniformMatrix3x4fv) .p2align 4,,15 - .globl GL_PREFIX(GetProgramLocalParameterfvARB) - .type GL_PREFIX(GetProgramLocalParameterfvARB), @function -GL_PREFIX(GetProgramLocalParameterfvARB): + .globl GL_PREFIX(UniformMatrix4x2fv) + .type GL_PREFIX(UniformMatrix4x2fv), @function +GL_PREFIX(UniformMatrix4x2fv): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3424(%rax), %r11 @@ -15961,7 +15922,11 @@ GL_PREFIX(GetProgramLocalParameterfvARB): pushq %rdi pushq %rsi pushq %rdx + pushq %rcx + pushq %rbp call _x86_64_get_dispatch@PLT + popq %rbp + popq %rcx popq %rdx popq %rsi popq %rdi @@ -15977,19 +15942,23 @@ GL_PREFIX(GetProgramLocalParameterfvARB): pushq %rdi pushq %rsi pushq %rdx + pushq %rcx + pushq %rbp call _glapi_get_dispatch + popq %rbp + popq %rcx popq %rdx popq %rsi popq %rdi movq 3424(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetProgramLocalParameterfvARB), .-GL_PREFIX(GetProgramLocalParameterfvARB) + .size GL_PREFIX(UniformMatrix4x2fv), .-GL_PREFIX(UniformMatrix4x2fv) .p2align 4,,15 - .globl GL_PREFIX(GetProgramStringARB) - .type GL_PREFIX(GetProgramStringARB), @function -GL_PREFIX(GetProgramStringARB): + .globl GL_PREFIX(UniformMatrix4x3fv) + .type GL_PREFIX(UniformMatrix4x3fv), @function +GL_PREFIX(UniformMatrix4x3fv): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3432(%rax), %r11 @@ -15998,7 +15967,11 @@ GL_PREFIX(GetProgramStringARB): pushq %rdi pushq %rsi pushq %rdx + pushq %rcx + pushq %rbp call _x86_64_get_dispatch@PLT + popq %rbp + popq %rcx popq %rdx popq %rsi popq %rdi @@ -16014,30 +15987,30 @@ GL_PREFIX(GetProgramStringARB): pushq %rdi pushq %rsi pushq %rdx + pushq %rcx + pushq %rbp call _glapi_get_dispatch + popq %rbp + popq %rcx popq %rdx popq %rsi popq %rdi movq 3432(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetProgramStringARB), .-GL_PREFIX(GetProgramStringARB) + .size GL_PREFIX(UniformMatrix4x3fv), .-GL_PREFIX(UniformMatrix4x3fv) .p2align 4,,15 - .globl GL_PREFIX(GetProgramivARB) - .type GL_PREFIX(GetProgramivARB), @function -GL_PREFIX(GetProgramivARB): + .globl GL_PREFIX(LoadTransposeMatrixdARB) + .type GL_PREFIX(LoadTransposeMatrixdARB), @function +GL_PREFIX(LoadTransposeMatrixdARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3440(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi - pushq %rsi - pushq %rdx call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi popq %rdi movq 3440(%rax), %r11 jmp *%r11 @@ -16049,32 +16022,24 @@ GL_PREFIX(GetProgramivARB): jmp *%r11 1: pushq %rdi - pushq %rsi - pushq %rdx call _glapi_get_dispatch - popq %rdx - popq %rsi popq %rdi movq 3440(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetProgramivARB), .-GL_PREFIX(GetProgramivARB) + .size GL_PREFIX(LoadTransposeMatrixdARB), .-GL_PREFIX(LoadTransposeMatrixdARB) .p2align 4,,15 - .globl GL_PREFIX(GetVertexAttribdvARB) - .type GL_PREFIX(GetVertexAttribdvARB), @function -GL_PREFIX(GetVertexAttribdvARB): + .globl GL_PREFIX(LoadTransposeMatrixfARB) + .type GL_PREFIX(LoadTransposeMatrixfARB), @function +GL_PREFIX(LoadTransposeMatrixfARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3448(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi - pushq %rsi - pushq %rdx call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi popq %rdi movq 3448(%rax), %r11 jmp *%r11 @@ -16086,32 +16051,24 @@ GL_PREFIX(GetVertexAttribdvARB): jmp *%r11 1: pushq %rdi - pushq %rsi - pushq %rdx call _glapi_get_dispatch - popq %rdx - popq %rsi popq %rdi movq 3448(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetVertexAttribdvARB), .-GL_PREFIX(GetVertexAttribdvARB) + .size GL_PREFIX(LoadTransposeMatrixfARB), .-GL_PREFIX(LoadTransposeMatrixfARB) .p2align 4,,15 - .globl GL_PREFIX(GetVertexAttribfvARB) - .type GL_PREFIX(GetVertexAttribfvARB), @function -GL_PREFIX(GetVertexAttribfvARB): + .globl GL_PREFIX(MultTransposeMatrixdARB) + .type GL_PREFIX(MultTransposeMatrixdARB), @function +GL_PREFIX(MultTransposeMatrixdARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3456(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi - pushq %rsi - pushq %rdx call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi popq %rdi movq 3456(%rax), %r11 jmp *%r11 @@ -16123,32 +16080,24 @@ GL_PREFIX(GetVertexAttribfvARB): jmp *%r11 1: pushq %rdi - pushq %rsi - pushq %rdx call _glapi_get_dispatch - popq %rdx - popq %rsi popq %rdi movq 3456(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetVertexAttribfvARB), .-GL_PREFIX(GetVertexAttribfvARB) + .size GL_PREFIX(MultTransposeMatrixdARB), .-GL_PREFIX(MultTransposeMatrixdARB) .p2align 4,,15 - .globl GL_PREFIX(GetVertexAttribivARB) - .type GL_PREFIX(GetVertexAttribivARB), @function -GL_PREFIX(GetVertexAttribivARB): + .globl GL_PREFIX(MultTransposeMatrixfARB) + .type GL_PREFIX(MultTransposeMatrixfARB), @function +GL_PREFIX(MultTransposeMatrixfARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3464(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi - pushq %rsi - pushq %rdx call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi popq %rdi movq 3464(%rax), %r11 jmp *%r11 @@ -16160,41 +16109,29 @@ GL_PREFIX(GetVertexAttribivARB): jmp *%r11 1: pushq %rdi - pushq %rsi - pushq %rdx call _glapi_get_dispatch - popq %rdx - popq %rsi popq %rdi movq 3464(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetVertexAttribivARB), .-GL_PREFIX(GetVertexAttribivARB) + .size GL_PREFIX(MultTransposeMatrixfARB), .-GL_PREFIX(MultTransposeMatrixfARB) .p2align 4,,15 - .globl GL_PREFIX(ProgramEnvParameter4dARB) - .type GL_PREFIX(ProgramEnvParameter4dARB), @function -GL_PREFIX(ProgramEnvParameter4dARB): + .globl GL_PREFIX(SampleCoverageARB) + .type GL_PREFIX(SampleCoverageARB), @function +GL_PREFIX(SampleCoverageARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3472(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) - subq $56, %rsp - movq %rdi, (%rsp) - movq %rsi, 8(%rsp) - movq %xmm0, 16(%rsp) - movq %xmm1, 24(%rsp) - movq %xmm2, 32(%rsp) - movq %xmm3, 40(%rsp) + pushq %rdi + pushq %rsi + pushq %rbp call _x86_64_get_dispatch@PLT - movq 40(%rsp), %xmm3 - movq 32(%rsp), %xmm2 - movq 24(%rsp), %xmm1 - movq 16(%rsp), %xmm0 - movq 8(%rsp), %rsi - movq (%rsp), %rdi - addq $56, %rsp + popq %rbp + popq %rsi + popq %rdi movq 3472(%rax), %r11 jmp *%r11 #else @@ -16204,30 +16141,22 @@ GL_PREFIX(ProgramEnvParameter4dARB): movq 3472(%rax), %r11 jmp *%r11 1: - subq $56, %rsp - movq %rdi, (%rsp) - movq %rsi, 8(%rsp) - movq %xmm0, 16(%rsp) - movq %xmm1, 24(%rsp) - movq %xmm2, 32(%rsp) - movq %xmm3, 40(%rsp) + pushq %rdi + pushq %rsi + pushq %rbp call _glapi_get_dispatch - movq 40(%rsp), %xmm3 - movq 32(%rsp), %xmm2 - movq 24(%rsp), %xmm1 - movq 16(%rsp), %xmm0 - movq 8(%rsp), %rsi - movq (%rsp), %rdi - addq $56, %rsp + popq %rbp + popq %rsi + popq %rdi movq 3472(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(ProgramEnvParameter4dARB), .-GL_PREFIX(ProgramEnvParameter4dARB) + .size GL_PREFIX(SampleCoverageARB), .-GL_PREFIX(SampleCoverageARB) .p2align 4,,15 - .globl GL_PREFIX(ProgramEnvParameter4dvARB) - .type GL_PREFIX(ProgramEnvParameter4dvARB), @function -GL_PREFIX(ProgramEnvParameter4dvARB): + .globl GL_PREFIX(CompressedTexImage1DARB) + .type GL_PREFIX(CompressedTexImage1DARB), @function +GL_PREFIX(CompressedTexImage1DARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3480(%rax), %r11 @@ -16236,7 +16165,15 @@ GL_PREFIX(ProgramEnvParameter4dvARB): pushq %rdi pushq %rsi pushq %rdx + pushq %rcx + pushq %r8 + pushq %r9 + pushq %rbp call _x86_64_get_dispatch@PLT + popq %rbp + popq %r9 + popq %r8 + popq %rcx popq %rdx popq %rsi popq %rdi @@ -16252,72 +16189,80 @@ GL_PREFIX(ProgramEnvParameter4dvARB): pushq %rdi pushq %rsi pushq %rdx + pushq %rcx + pushq %r8 + pushq %r9 + pushq %rbp call _glapi_get_dispatch + popq %rbp + popq %r9 + popq %r8 + popq %rcx popq %rdx popq %rsi popq %rdi movq 3480(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(ProgramEnvParameter4dvARB), .-GL_PREFIX(ProgramEnvParameter4dvARB) + .size GL_PREFIX(CompressedTexImage1DARB), .-GL_PREFIX(CompressedTexImage1DARB) .p2align 4,,15 - .globl GL_PREFIX(ProgramEnvParameter4fARB) - .type GL_PREFIX(ProgramEnvParameter4fARB), @function -GL_PREFIX(ProgramEnvParameter4fARB): + .globl GL_PREFIX(CompressedTexImage2DARB) + .type GL_PREFIX(CompressedTexImage2DARB), @function +GL_PREFIX(CompressedTexImage2DARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3488(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) - subq $56, %rsp - movq %rdi, (%rsp) - movq %rsi, 8(%rsp) - movq %xmm0, 16(%rsp) - movq %xmm1, 24(%rsp) - movq %xmm2, 32(%rsp) - movq %xmm3, 40(%rsp) + pushq %rdi + pushq %rsi + pushq %rdx + pushq %rcx + pushq %r8 + pushq %r9 + pushq %rbp call _x86_64_get_dispatch@PLT - movq 40(%rsp), %xmm3 - movq 32(%rsp), %xmm2 - movq 24(%rsp), %xmm1 - movq 16(%rsp), %xmm0 - movq 8(%rsp), %rsi - movq (%rsp), %rdi - addq $56, %rsp - movq 3488(%rax), %r11 - jmp *%r11 -#else - movq _glapi_Dispatch(%rip), %rax - testq %rax, %rax + popq %rbp + popq %r9 + popq %r8 + popq %rcx + popq %rdx + popq %rsi + popq %rdi + movq 3488(%rax), %r11 + jmp *%r11 +#else + movq _glapi_Dispatch(%rip), %rax + testq %rax, %rax je 1f movq 3488(%rax), %r11 jmp *%r11 1: - subq $56, %rsp - movq %rdi, (%rsp) - movq %rsi, 8(%rsp) - movq %xmm0, 16(%rsp) - movq %xmm1, 24(%rsp) - movq %xmm2, 32(%rsp) - movq %xmm3, 40(%rsp) + pushq %rdi + pushq %rsi + pushq %rdx + pushq %rcx + pushq %r8 + pushq %r9 + pushq %rbp call _glapi_get_dispatch - movq 40(%rsp), %xmm3 - movq 32(%rsp), %xmm2 - movq 24(%rsp), %xmm1 - movq 16(%rsp), %xmm0 - movq 8(%rsp), %rsi - movq (%rsp), %rdi - addq $56, %rsp + popq %rbp + popq %r9 + popq %r8 + popq %rcx + popq %rdx + popq %rsi + popq %rdi movq 3488(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(ProgramEnvParameter4fARB), .-GL_PREFIX(ProgramEnvParameter4fARB) + .size GL_PREFIX(CompressedTexImage2DARB), .-GL_PREFIX(CompressedTexImage2DARB) .p2align 4,,15 - .globl GL_PREFIX(ProgramEnvParameter4fvARB) - .type GL_PREFIX(ProgramEnvParameter4fvARB), @function -GL_PREFIX(ProgramEnvParameter4fvARB): + .globl GL_PREFIX(CompressedTexImage3DARB) + .type GL_PREFIX(CompressedTexImage3DARB), @function +GL_PREFIX(CompressedTexImage3DARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3496(%rax), %r11 @@ -16326,7 +16271,15 @@ GL_PREFIX(ProgramEnvParameter4fvARB): pushq %rdi pushq %rsi pushq %rdx + pushq %rcx + pushq %r8 + pushq %r9 + pushq %rbp call _x86_64_get_dispatch@PLT + popq %rbp + popq %r9 + popq %r8 + popq %rcx popq %rdx popq %rsi popq %rdi @@ -16342,39 +16295,47 @@ GL_PREFIX(ProgramEnvParameter4fvARB): pushq %rdi pushq %rsi pushq %rdx + pushq %rcx + pushq %r8 + pushq %r9 + pushq %rbp call _glapi_get_dispatch + popq %rbp + popq %r9 + popq %r8 + popq %rcx popq %rdx popq %rsi popq %rdi movq 3496(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(ProgramEnvParameter4fvARB), .-GL_PREFIX(ProgramEnvParameter4fvARB) + .size GL_PREFIX(CompressedTexImage3DARB), .-GL_PREFIX(CompressedTexImage3DARB) .p2align 4,,15 - .globl GL_PREFIX(ProgramLocalParameter4dARB) - .type GL_PREFIX(ProgramLocalParameter4dARB), @function -GL_PREFIX(ProgramLocalParameter4dARB): + .globl GL_PREFIX(CompressedTexSubImage1DARB) + .type GL_PREFIX(CompressedTexSubImage1DARB), @function +GL_PREFIX(CompressedTexSubImage1DARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3504(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) - subq $56, %rsp - movq %rdi, (%rsp) - movq %rsi, 8(%rsp) - movq %xmm0, 16(%rsp) - movq %xmm1, 24(%rsp) - movq %xmm2, 32(%rsp) - movq %xmm3, 40(%rsp) + pushq %rdi + pushq %rsi + pushq %rdx + pushq %rcx + pushq %r8 + pushq %r9 + pushq %rbp call _x86_64_get_dispatch@PLT - movq 40(%rsp), %xmm3 - movq 32(%rsp), %xmm2 - movq 24(%rsp), %xmm1 - movq 16(%rsp), %xmm0 - movq 8(%rsp), %rsi - movq (%rsp), %rdi - addq $56, %rsp + popq %rbp + popq %r9 + popq %r8 + popq %rcx + popq %rdx + popq %rsi + popq %rdi movq 3504(%rax), %r11 jmp *%r11 #else @@ -16384,30 +16345,30 @@ GL_PREFIX(ProgramLocalParameter4dARB): movq 3504(%rax), %r11 jmp *%r11 1: - subq $56, %rsp - movq %rdi, (%rsp) - movq %rsi, 8(%rsp) - movq %xmm0, 16(%rsp) - movq %xmm1, 24(%rsp) - movq %xmm2, 32(%rsp) - movq %xmm3, 40(%rsp) + pushq %rdi + pushq %rsi + pushq %rdx + pushq %rcx + pushq %r8 + pushq %r9 + pushq %rbp call _glapi_get_dispatch - movq 40(%rsp), %xmm3 - movq 32(%rsp), %xmm2 - movq 24(%rsp), %xmm1 - movq 16(%rsp), %xmm0 - movq 8(%rsp), %rsi - movq (%rsp), %rdi - addq $56, %rsp + popq %rbp + popq %r9 + popq %r8 + popq %rcx + popq %rdx + popq %rsi + popq %rdi movq 3504(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(ProgramLocalParameter4dARB), .-GL_PREFIX(ProgramLocalParameter4dARB) + .size GL_PREFIX(CompressedTexSubImage1DARB), .-GL_PREFIX(CompressedTexSubImage1DARB) .p2align 4,,15 - .globl GL_PREFIX(ProgramLocalParameter4dvARB) - .type GL_PREFIX(ProgramLocalParameter4dvARB), @function -GL_PREFIX(ProgramLocalParameter4dvARB): + .globl GL_PREFIX(CompressedTexSubImage2DARB) + .type GL_PREFIX(CompressedTexSubImage2DARB), @function +GL_PREFIX(CompressedTexSubImage2DARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3512(%rax), %r11 @@ -16416,7 +16377,15 @@ GL_PREFIX(ProgramLocalParameter4dvARB): pushq %rdi pushq %rsi pushq %rdx + pushq %rcx + pushq %r8 + pushq %r9 + pushq %rbp call _x86_64_get_dispatch@PLT + popq %rbp + popq %r9 + popq %r8 + popq %rcx popq %rdx popq %rsi popq %rdi @@ -16432,39 +16401,47 @@ GL_PREFIX(ProgramLocalParameter4dvARB): pushq %rdi pushq %rsi pushq %rdx + pushq %rcx + pushq %r8 + pushq %r9 + pushq %rbp call _glapi_get_dispatch + popq %rbp + popq %r9 + popq %r8 + popq %rcx popq %rdx popq %rsi popq %rdi movq 3512(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(ProgramLocalParameter4dvARB), .-GL_PREFIX(ProgramLocalParameter4dvARB) + .size GL_PREFIX(CompressedTexSubImage2DARB), .-GL_PREFIX(CompressedTexSubImage2DARB) .p2align 4,,15 - .globl GL_PREFIX(ProgramLocalParameter4fARB) - .type GL_PREFIX(ProgramLocalParameter4fARB), @function -GL_PREFIX(ProgramLocalParameter4fARB): + .globl GL_PREFIX(CompressedTexSubImage3DARB) + .type GL_PREFIX(CompressedTexSubImage3DARB), @function +GL_PREFIX(CompressedTexSubImage3DARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3520(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) - subq $56, %rsp - movq %rdi, (%rsp) - movq %rsi, 8(%rsp) - movq %xmm0, 16(%rsp) - movq %xmm1, 24(%rsp) - movq %xmm2, 32(%rsp) - movq %xmm3, 40(%rsp) + pushq %rdi + pushq %rsi + pushq %rdx + pushq %rcx + pushq %r8 + pushq %r9 + pushq %rbp call _x86_64_get_dispatch@PLT - movq 40(%rsp), %xmm3 - movq 32(%rsp), %xmm2 - movq 24(%rsp), %xmm1 - movq 16(%rsp), %xmm0 - movq 8(%rsp), %rsi - movq (%rsp), %rdi - addq $56, %rsp + popq %rbp + popq %r9 + popq %r8 + popq %rcx + popq %rdx + popq %rsi + popq %rdi movq 3520(%rax), %r11 jmp *%r11 #else @@ -16474,30 +16451,30 @@ GL_PREFIX(ProgramLocalParameter4fARB): movq 3520(%rax), %r11 jmp *%r11 1: - subq $56, %rsp - movq %rdi, (%rsp) - movq %rsi, 8(%rsp) - movq %xmm0, 16(%rsp) - movq %xmm1, 24(%rsp) - movq %xmm2, 32(%rsp) - movq %xmm3, 40(%rsp) + pushq %rdi + pushq %rsi + pushq %rdx + pushq %rcx + pushq %r8 + pushq %r9 + pushq %rbp call _glapi_get_dispatch - movq 40(%rsp), %xmm3 - movq 32(%rsp), %xmm2 - movq 24(%rsp), %xmm1 - movq 16(%rsp), %xmm0 - movq 8(%rsp), %rsi - movq (%rsp), %rdi - addq $56, %rsp + popq %rbp + popq %r9 + popq %r8 + popq %rcx + popq %rdx + popq %rsi + popq %rdi movq 3520(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(ProgramLocalParameter4fARB), .-GL_PREFIX(ProgramLocalParameter4fARB) + .size GL_PREFIX(CompressedTexSubImage3DARB), .-GL_PREFIX(CompressedTexSubImage3DARB) .p2align 4,,15 - .globl GL_PREFIX(ProgramLocalParameter4fvARB) - .type GL_PREFIX(ProgramLocalParameter4fvARB), @function -GL_PREFIX(ProgramLocalParameter4fvARB): + .globl GL_PREFIX(GetCompressedTexImageARB) + .type GL_PREFIX(GetCompressedTexImageARB), @function +GL_PREFIX(GetCompressedTexImageARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3528(%rax), %r11 @@ -16529,27 +16506,19 @@ GL_PREFIX(ProgramLocalParameter4fvARB): movq 3528(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(ProgramLocalParameter4fvARB), .-GL_PREFIX(ProgramLocalParameter4fvARB) + .size GL_PREFIX(GetCompressedTexImageARB), .-GL_PREFIX(GetCompressedTexImageARB) .p2align 4,,15 - .globl GL_PREFIX(ProgramStringARB) - .type GL_PREFIX(ProgramStringARB), @function -GL_PREFIX(ProgramStringARB): + .globl GL_PREFIX(DisableVertexAttribArrayARB) + .type GL_PREFIX(DisableVertexAttribArrayARB), @function +GL_PREFIX(DisableVertexAttribArrayARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3536(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi popq %rdi movq 3536(%rax), %r11 jmp *%r11 @@ -16561,37 +16530,25 @@ GL_PREFIX(ProgramStringARB): jmp *%r11 1: pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi popq %rdi movq 3536(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(ProgramStringARB), .-GL_PREFIX(ProgramStringARB) + .size GL_PREFIX(DisableVertexAttribArrayARB), .-GL_PREFIX(DisableVertexAttribArrayARB) .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib1dARB) - .type GL_PREFIX(VertexAttrib1dARB), @function -GL_PREFIX(VertexAttrib1dARB): + .globl GL_PREFIX(EnableVertexAttribArrayARB) + .type GL_PREFIX(EnableVertexAttribArrayARB), @function +GL_PREFIX(EnableVertexAttribArrayARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3544(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) - subq $24, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) + pushq %rdi call _x86_64_get_dispatch@PLT - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $24, %rsp + popq %rdi movq 3544(%rax), %r11 jmp *%r11 #else @@ -16601,22 +16558,18 @@ GL_PREFIX(VertexAttrib1dARB): movq 3544(%rax), %r11 jmp *%r11 1: - subq $24, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) + pushq %rdi call _glapi_get_dispatch - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $24, %rsp + popq %rdi movq 3544(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib1dARB), .-GL_PREFIX(VertexAttrib1dARB) + .size GL_PREFIX(EnableVertexAttribArrayARB), .-GL_PREFIX(EnableVertexAttribArrayARB) .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib1dvARB) - .type GL_PREFIX(VertexAttrib1dvARB), @function -GL_PREFIX(VertexAttrib1dvARB): + .globl GL_PREFIX(GetProgramEnvParameterdvARB) + .type GL_PREFIX(GetProgramEnvParameterdvARB), @function +GL_PREFIX(GetProgramEnvParameterdvARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3552(%rax), %r11 @@ -16624,9 +16577,9 @@ GL_PREFIX(VertexAttrib1dvARB): #elif defined(PTHREADS) pushq %rdi pushq %rsi - pushq %rbp + pushq %rdx call _x86_64_get_dispatch@PLT - popq %rbp + popq %rdx popq %rsi popq %rdi movq 3552(%rax), %r11 @@ -16640,32 +16593,32 @@ GL_PREFIX(VertexAttrib1dvARB): 1: pushq %rdi pushq %rsi - pushq %rbp + pushq %rdx call _glapi_get_dispatch - popq %rbp + popq %rdx popq %rsi popq %rdi movq 3552(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib1dvARB), .-GL_PREFIX(VertexAttrib1dvARB) + .size GL_PREFIX(GetProgramEnvParameterdvARB), .-GL_PREFIX(GetProgramEnvParameterdvARB) .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib1fARB) - .type GL_PREFIX(VertexAttrib1fARB), @function -GL_PREFIX(VertexAttrib1fARB): + .globl GL_PREFIX(GetProgramEnvParameterfvARB) + .type GL_PREFIX(GetProgramEnvParameterfvARB), @function +GL_PREFIX(GetProgramEnvParameterfvARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3560(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) - subq $24, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) + pushq %rdi + pushq %rsi + pushq %rdx call _x86_64_get_dispatch@PLT - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $24, %rsp + popq %rdx + popq %rsi + popq %rdi movq 3560(%rax), %r11 jmp *%r11 #else @@ -16675,22 +16628,22 @@ GL_PREFIX(VertexAttrib1fARB): movq 3560(%rax), %r11 jmp *%r11 1: - subq $24, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) + pushq %rdi + pushq %rsi + pushq %rdx call _glapi_get_dispatch - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $24, %rsp + popq %rdx + popq %rsi + popq %rdi movq 3560(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib1fARB), .-GL_PREFIX(VertexAttrib1fARB) + .size GL_PREFIX(GetProgramEnvParameterfvARB), .-GL_PREFIX(GetProgramEnvParameterfvARB) .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib1fvARB) - .type GL_PREFIX(VertexAttrib1fvARB), @function -GL_PREFIX(VertexAttrib1fvARB): + .globl GL_PREFIX(GetProgramLocalParameterdvARB) + .type GL_PREFIX(GetProgramLocalParameterdvARB), @function +GL_PREFIX(GetProgramLocalParameterdvARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3568(%rax), %r11 @@ -16698,9 +16651,9 @@ GL_PREFIX(VertexAttrib1fvARB): #elif defined(PTHREADS) pushq %rdi pushq %rsi - pushq %rbp + pushq %rdx call _x86_64_get_dispatch@PLT - popq %rbp + popq %rdx popq %rsi popq %rdi movq 3568(%rax), %r11 @@ -16714,20 +16667,20 @@ GL_PREFIX(VertexAttrib1fvARB): 1: pushq %rdi pushq %rsi - pushq %rbp + pushq %rdx call _glapi_get_dispatch - popq %rbp + popq %rdx popq %rsi popq %rdi movq 3568(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib1fvARB), .-GL_PREFIX(VertexAttrib1fvARB) + .size GL_PREFIX(GetProgramLocalParameterdvARB), .-GL_PREFIX(GetProgramLocalParameterdvARB) .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib1sARB) - .type GL_PREFIX(VertexAttrib1sARB), @function -GL_PREFIX(VertexAttrib1sARB): + .globl GL_PREFIX(GetProgramLocalParameterfvARB) + .type GL_PREFIX(GetProgramLocalParameterfvARB), @function +GL_PREFIX(GetProgramLocalParameterfvARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3576(%rax), %r11 @@ -16735,9 +16688,9 @@ GL_PREFIX(VertexAttrib1sARB): #elif defined(PTHREADS) pushq %rdi pushq %rsi - pushq %rbp + pushq %rdx call _x86_64_get_dispatch@PLT - popq %rbp + popq %rdx popq %rsi popq %rdi movq 3576(%rax), %r11 @@ -16751,20 +16704,20 @@ GL_PREFIX(VertexAttrib1sARB): 1: pushq %rdi pushq %rsi - pushq %rbp + pushq %rdx call _glapi_get_dispatch - popq %rbp + popq %rdx popq %rsi popq %rdi movq 3576(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib1sARB), .-GL_PREFIX(VertexAttrib1sARB) + .size GL_PREFIX(GetProgramLocalParameterfvARB), .-GL_PREFIX(GetProgramLocalParameterfvARB) .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib1svARB) - .type GL_PREFIX(VertexAttrib1svARB), @function -GL_PREFIX(VertexAttrib1svARB): + .globl GL_PREFIX(GetProgramStringARB) + .type GL_PREFIX(GetProgramStringARB), @function +GL_PREFIX(GetProgramStringARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3584(%rax), %r11 @@ -16772,9 +16725,9 @@ GL_PREFIX(VertexAttrib1svARB): #elif defined(PTHREADS) pushq %rdi pushq %rsi - pushq %rbp + pushq %rdx call _x86_64_get_dispatch@PLT - popq %rbp + popq %rdx popq %rsi popq %rdi movq 3584(%rax), %r11 @@ -16788,34 +16741,32 @@ GL_PREFIX(VertexAttrib1svARB): 1: pushq %rdi pushq %rsi - pushq %rbp + pushq %rdx call _glapi_get_dispatch - popq %rbp + popq %rdx popq %rsi popq %rdi movq 3584(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib1svARB), .-GL_PREFIX(VertexAttrib1svARB) + .size GL_PREFIX(GetProgramStringARB), .-GL_PREFIX(GetProgramStringARB) .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib2dARB) - .type GL_PREFIX(VertexAttrib2dARB), @function -GL_PREFIX(VertexAttrib2dARB): + .globl GL_PREFIX(GetProgramivARB) + .type GL_PREFIX(GetProgramivARB), @function +GL_PREFIX(GetProgramivARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3592(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) - subq $24, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) + pushq %rdi + pushq %rsi + pushq %rdx call _x86_64_get_dispatch@PLT - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $24, %rsp + popq %rdx + popq %rsi + popq %rdi movq 3592(%rax), %r11 jmp *%r11 #else @@ -16825,24 +16776,22 @@ GL_PREFIX(VertexAttrib2dARB): movq 3592(%rax), %r11 jmp *%r11 1: - subq $24, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) + pushq %rdi + pushq %rsi + pushq %rdx call _glapi_get_dispatch - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $24, %rsp + popq %rdx + popq %rsi + popq %rdi movq 3592(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib2dARB), .-GL_PREFIX(VertexAttrib2dARB) + .size GL_PREFIX(GetProgramivARB), .-GL_PREFIX(GetProgramivARB) .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib2dvARB) - .type GL_PREFIX(VertexAttrib2dvARB), @function -GL_PREFIX(VertexAttrib2dvARB): + .globl GL_PREFIX(GetVertexAttribdvARB) + .type GL_PREFIX(GetVertexAttribdvARB), @function +GL_PREFIX(GetVertexAttribdvARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3600(%rax), %r11 @@ -16850,9 +16799,9 @@ GL_PREFIX(VertexAttrib2dvARB): #elif defined(PTHREADS) pushq %rdi pushq %rsi - pushq %rbp + pushq %rdx call _x86_64_get_dispatch@PLT - popq %rbp + popq %rdx popq %rsi popq %rdi movq 3600(%rax), %r11 @@ -16866,34 +16815,32 @@ GL_PREFIX(VertexAttrib2dvARB): 1: pushq %rdi pushq %rsi - pushq %rbp + pushq %rdx call _glapi_get_dispatch - popq %rbp + popq %rdx popq %rsi popq %rdi movq 3600(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib2dvARB), .-GL_PREFIX(VertexAttrib2dvARB) + .size GL_PREFIX(GetVertexAttribdvARB), .-GL_PREFIX(GetVertexAttribdvARB) .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib2fARB) - .type GL_PREFIX(VertexAttrib2fARB), @function -GL_PREFIX(VertexAttrib2fARB): + .globl GL_PREFIX(GetVertexAttribfvARB) + .type GL_PREFIX(GetVertexAttribfvARB), @function +GL_PREFIX(GetVertexAttribfvARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3608(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) - subq $24, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) + pushq %rdi + pushq %rsi + pushq %rdx call _x86_64_get_dispatch@PLT - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $24, %rsp + popq %rdx + popq %rsi + popq %rdi movq 3608(%rax), %r11 jmp *%r11 #else @@ -16903,24 +16850,22 @@ GL_PREFIX(VertexAttrib2fARB): movq 3608(%rax), %r11 jmp *%r11 1: - subq $24, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) + pushq %rdi + pushq %rsi + pushq %rdx call _glapi_get_dispatch - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $24, %rsp + popq %rdx + popq %rsi + popq %rdi movq 3608(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib2fARB), .-GL_PREFIX(VertexAttrib2fARB) + .size GL_PREFIX(GetVertexAttribfvARB), .-GL_PREFIX(GetVertexAttribfvARB) .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib2fvARB) - .type GL_PREFIX(VertexAttrib2fvARB), @function -GL_PREFIX(VertexAttrib2fvARB): + .globl GL_PREFIX(GetVertexAttribivARB) + .type GL_PREFIX(GetVertexAttribivARB), @function +GL_PREFIX(GetVertexAttribivARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3616(%rax), %r11 @@ -16928,9 +16873,9 @@ GL_PREFIX(VertexAttrib2fvARB): #elif defined(PTHREADS) pushq %rdi pushq %rsi - pushq %rbp + pushq %rdx call _x86_64_get_dispatch@PLT - popq %rbp + popq %rdx popq %rsi popq %rdi movq 3616(%rax), %r11 @@ -16944,32 +16889,40 @@ GL_PREFIX(VertexAttrib2fvARB): 1: pushq %rdi pushq %rsi - pushq %rbp + pushq %rdx call _glapi_get_dispatch - popq %rbp + popq %rdx popq %rsi popq %rdi movq 3616(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib2fvARB), .-GL_PREFIX(VertexAttrib2fvARB) + .size GL_PREFIX(GetVertexAttribivARB), .-GL_PREFIX(GetVertexAttribivARB) .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib2sARB) - .type GL_PREFIX(VertexAttrib2sARB), @function -GL_PREFIX(VertexAttrib2sARB): + .globl GL_PREFIX(ProgramEnvParameter4dARB) + .type GL_PREFIX(ProgramEnvParameter4dARB), @function +GL_PREFIX(ProgramEnvParameter4dARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3624(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx + subq $56, %rsp + movq %rdi, (%rsp) + movq %rsi, 8(%rsp) + movq %xmm0, 16(%rsp) + movq %xmm1, 24(%rsp) + movq %xmm2, 32(%rsp) + movq %xmm3, 40(%rsp) call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi + movq 40(%rsp), %xmm3 + movq 32(%rsp), %xmm2 + movq 24(%rsp), %xmm1 + movq 16(%rsp), %xmm0 + movq 8(%rsp), %rsi + movq (%rsp), %rdi + addq $56, %rsp movq 3624(%rax), %r11 jmp *%r11 #else @@ -16979,22 +16932,30 @@ GL_PREFIX(VertexAttrib2sARB): movq 3624(%rax), %r11 jmp *%r11 1: - pushq %rdi - pushq %rsi - pushq %rdx + subq $56, %rsp + movq %rdi, (%rsp) + movq %rsi, 8(%rsp) + movq %xmm0, 16(%rsp) + movq %xmm1, 24(%rsp) + movq %xmm2, 32(%rsp) + movq %xmm3, 40(%rsp) call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi + movq 40(%rsp), %xmm3 + movq 32(%rsp), %xmm2 + movq 24(%rsp), %xmm1 + movq 16(%rsp), %xmm0 + movq 8(%rsp), %rsi + movq (%rsp), %rdi + addq $56, %rsp movq 3624(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib2sARB), .-GL_PREFIX(VertexAttrib2sARB) + .size GL_PREFIX(ProgramEnvParameter4dARB), .-GL_PREFIX(ProgramEnvParameter4dARB) .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib2svARB) - .type GL_PREFIX(VertexAttrib2svARB), @function -GL_PREFIX(VertexAttrib2svARB): + .globl GL_PREFIX(ProgramEnvParameter4dvARB) + .type GL_PREFIX(ProgramEnvParameter4dvARB), @function +GL_PREFIX(ProgramEnvParameter4dvARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3632(%rax), %r11 @@ -17002,9 +16963,9 @@ GL_PREFIX(VertexAttrib2svARB): #elif defined(PTHREADS) pushq %rdi pushq %rsi - pushq %rbp + pushq %rdx call _x86_64_get_dispatch@PLT - popq %rbp + popq %rdx popq %rsi popq %rdi movq 3632(%rax), %r11 @@ -17018,36 +16979,40 @@ GL_PREFIX(VertexAttrib2svARB): 1: pushq %rdi pushq %rsi - pushq %rbp + pushq %rdx call _glapi_get_dispatch - popq %rbp + popq %rdx popq %rsi popq %rdi movq 3632(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib2svARB), .-GL_PREFIX(VertexAttrib2svARB) + .size GL_PREFIX(ProgramEnvParameter4dvARB), .-GL_PREFIX(ProgramEnvParameter4dvARB) .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib3dARB) - .type GL_PREFIX(VertexAttrib3dARB), @function -GL_PREFIX(VertexAttrib3dARB): + .globl GL_PREFIX(ProgramEnvParameter4fARB) + .type GL_PREFIX(ProgramEnvParameter4fARB), @function +GL_PREFIX(ProgramEnvParameter4fARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3640(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) - subq $40, %rsp + subq $56, %rsp movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) - movq %xmm2, 24(%rsp) + movq %rsi, 8(%rsp) + movq %xmm0, 16(%rsp) + movq %xmm1, 24(%rsp) + movq %xmm2, 32(%rsp) + movq %xmm3, 40(%rsp) call _x86_64_get_dispatch@PLT - movq 24(%rsp), %xmm2 - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 + movq 40(%rsp), %xmm3 + movq 32(%rsp), %xmm2 + movq 24(%rsp), %xmm1 + movq 16(%rsp), %xmm0 + movq 8(%rsp), %rsi movq (%rsp), %rdi - addq $40, %rsp + addq $56, %rsp movq 3640(%rax), %r11 jmp *%r11 #else @@ -17057,26 +17022,30 @@ GL_PREFIX(VertexAttrib3dARB): movq 3640(%rax), %r11 jmp *%r11 1: - subq $40, %rsp + subq $56, %rsp movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) - movq %xmm2, 24(%rsp) + movq %rsi, 8(%rsp) + movq %xmm0, 16(%rsp) + movq %xmm1, 24(%rsp) + movq %xmm2, 32(%rsp) + movq %xmm3, 40(%rsp) call _glapi_get_dispatch - movq 24(%rsp), %xmm2 - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 + movq 40(%rsp), %xmm3 + movq 32(%rsp), %xmm2 + movq 24(%rsp), %xmm1 + movq 16(%rsp), %xmm0 + movq 8(%rsp), %rsi movq (%rsp), %rdi - addq $40, %rsp + addq $56, %rsp movq 3640(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib3dARB), .-GL_PREFIX(VertexAttrib3dARB) + .size GL_PREFIX(ProgramEnvParameter4fARB), .-GL_PREFIX(ProgramEnvParameter4fARB) .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib3dvARB) - .type GL_PREFIX(VertexAttrib3dvARB), @function -GL_PREFIX(VertexAttrib3dvARB): + .globl GL_PREFIX(ProgramEnvParameter4fvARB) + .type GL_PREFIX(ProgramEnvParameter4fvARB), @function +GL_PREFIX(ProgramEnvParameter4fvARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3648(%rax), %r11 @@ -17084,9 +17053,9 @@ GL_PREFIX(VertexAttrib3dvARB): #elif defined(PTHREADS) pushq %rdi pushq %rsi - pushq %rbp + pushq %rdx call _x86_64_get_dispatch@PLT - popq %rbp + popq %rdx popq %rsi popq %rdi movq 3648(%rax), %r11 @@ -17100,36 +17069,40 @@ GL_PREFIX(VertexAttrib3dvARB): 1: pushq %rdi pushq %rsi - pushq %rbp + pushq %rdx call _glapi_get_dispatch - popq %rbp + popq %rdx popq %rsi popq %rdi movq 3648(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib3dvARB), .-GL_PREFIX(VertexAttrib3dvARB) + .size GL_PREFIX(ProgramEnvParameter4fvARB), .-GL_PREFIX(ProgramEnvParameter4fvARB) .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib3fARB) - .type GL_PREFIX(VertexAttrib3fARB), @function -GL_PREFIX(VertexAttrib3fARB): + .globl GL_PREFIX(ProgramLocalParameter4dARB) + .type GL_PREFIX(ProgramLocalParameter4dARB), @function +GL_PREFIX(ProgramLocalParameter4dARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3656(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) - subq $40, %rsp + subq $56, %rsp movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) - movq %xmm2, 24(%rsp) + movq %rsi, 8(%rsp) + movq %xmm0, 16(%rsp) + movq %xmm1, 24(%rsp) + movq %xmm2, 32(%rsp) + movq %xmm3, 40(%rsp) call _x86_64_get_dispatch@PLT - movq 24(%rsp), %xmm2 - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 + movq 40(%rsp), %xmm3 + movq 32(%rsp), %xmm2 + movq 24(%rsp), %xmm1 + movq 16(%rsp), %xmm0 + movq 8(%rsp), %rsi movq (%rsp), %rdi - addq $40, %rsp + addq $56, %rsp movq 3656(%rax), %r11 jmp *%r11 #else @@ -17139,26 +17112,30 @@ GL_PREFIX(VertexAttrib3fARB): movq 3656(%rax), %r11 jmp *%r11 1: - subq $40, %rsp + subq $56, %rsp movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) - movq %xmm2, 24(%rsp) + movq %rsi, 8(%rsp) + movq %xmm0, 16(%rsp) + movq %xmm1, 24(%rsp) + movq %xmm2, 32(%rsp) + movq %xmm3, 40(%rsp) call _glapi_get_dispatch - movq 24(%rsp), %xmm2 - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 + movq 40(%rsp), %xmm3 + movq 32(%rsp), %xmm2 + movq 24(%rsp), %xmm1 + movq 16(%rsp), %xmm0 + movq 8(%rsp), %rsi movq (%rsp), %rdi - addq $40, %rsp + addq $56, %rsp movq 3656(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib3fARB), .-GL_PREFIX(VertexAttrib3fARB) + .size GL_PREFIX(ProgramLocalParameter4dARB), .-GL_PREFIX(ProgramLocalParameter4dARB) .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib3fvARB) - .type GL_PREFIX(VertexAttrib3fvARB), @function -GL_PREFIX(VertexAttrib3fvARB): + .globl GL_PREFIX(ProgramLocalParameter4dvARB) + .type GL_PREFIX(ProgramLocalParameter4dvARB), @function +GL_PREFIX(ProgramLocalParameter4dvARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3664(%rax), %r11 @@ -17166,9 +17143,9 @@ GL_PREFIX(VertexAttrib3fvARB): #elif defined(PTHREADS) pushq %rdi pushq %rsi - pushq %rbp + pushq %rdx call _x86_64_get_dispatch@PLT - popq %rbp + popq %rdx popq %rsi popq %rdi movq 3664(%rax), %r11 @@ -17182,36 +17159,40 @@ GL_PREFIX(VertexAttrib3fvARB): 1: pushq %rdi pushq %rsi - pushq %rbp + pushq %rdx call _glapi_get_dispatch - popq %rbp + popq %rdx popq %rsi popq %rdi movq 3664(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib3fvARB), .-GL_PREFIX(VertexAttrib3fvARB) + .size GL_PREFIX(ProgramLocalParameter4dvARB), .-GL_PREFIX(ProgramLocalParameter4dvARB) .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib3sARB) - .type GL_PREFIX(VertexAttrib3sARB), @function -GL_PREFIX(VertexAttrib3sARB): + .globl GL_PREFIX(ProgramLocalParameter4fARB) + .type GL_PREFIX(ProgramLocalParameter4fARB), @function +GL_PREFIX(ProgramLocalParameter4fARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3672(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp + subq $56, %rsp + movq %rdi, (%rsp) + movq %rsi, 8(%rsp) + movq %xmm0, 16(%rsp) + movq %xmm1, 24(%rsp) + movq %xmm2, 32(%rsp) + movq %xmm3, 40(%rsp) call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi + movq 40(%rsp), %xmm3 + movq 32(%rsp), %xmm2 + movq 24(%rsp), %xmm1 + movq 16(%rsp), %xmm0 + movq 8(%rsp), %rsi + movq (%rsp), %rdi + addq $56, %rsp movq 3672(%rax), %r11 jmp *%r11 #else @@ -17221,26 +17202,30 @@ GL_PREFIX(VertexAttrib3sARB): movq 3672(%rax), %r11 jmp *%r11 1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi + subq $56, %rsp + movq %rdi, (%rsp) + movq %rsi, 8(%rsp) + movq %xmm0, 16(%rsp) + movq %xmm1, 24(%rsp) + movq %xmm2, 32(%rsp) + movq %xmm3, 40(%rsp) + call _glapi_get_dispatch + movq 40(%rsp), %xmm3 + movq 32(%rsp), %xmm2 + movq 24(%rsp), %xmm1 + movq 16(%rsp), %xmm0 + movq 8(%rsp), %rsi + movq (%rsp), %rdi + addq $56, %rsp movq 3672(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib3sARB), .-GL_PREFIX(VertexAttrib3sARB) + .size GL_PREFIX(ProgramLocalParameter4fARB), .-GL_PREFIX(ProgramLocalParameter4fARB) .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib3svARB) - .type GL_PREFIX(VertexAttrib3svARB), @function -GL_PREFIX(VertexAttrib3svARB): + .globl GL_PREFIX(ProgramLocalParameter4fvARB) + .type GL_PREFIX(ProgramLocalParameter4fvARB), @function +GL_PREFIX(ProgramLocalParameter4fvARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3680(%rax), %r11 @@ -17248,9 +17233,9 @@ GL_PREFIX(VertexAttrib3svARB): #elif defined(PTHREADS) pushq %rdi pushq %rsi - pushq %rbp + pushq %rdx call _x86_64_get_dispatch@PLT - popq %rbp + popq %rdx popq %rsi popq %rdi movq 3680(%rax), %r11 @@ -17264,20 +17249,20 @@ GL_PREFIX(VertexAttrib3svARB): 1: pushq %rdi pushq %rsi - pushq %rbp + pushq %rdx call _glapi_get_dispatch - popq %rbp + popq %rdx popq %rsi popq %rdi movq 3680(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib3svARB), .-GL_PREFIX(VertexAttrib3svARB) + .size GL_PREFIX(ProgramLocalParameter4fvARB), .-GL_PREFIX(ProgramLocalParameter4fvARB) .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib4NbvARB) - .type GL_PREFIX(VertexAttrib4NbvARB), @function -GL_PREFIX(VertexAttrib4NbvARB): + .globl GL_PREFIX(ProgramStringARB) + .type GL_PREFIX(ProgramStringARB), @function +GL_PREFIX(ProgramStringARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3688(%rax), %r11 @@ -17285,9 +17270,13 @@ GL_PREFIX(VertexAttrib4NbvARB): #elif defined(PTHREADS) pushq %rdi pushq %rsi + pushq %rdx + pushq %rcx pushq %rbp call _x86_64_get_dispatch@PLT popq %rbp + popq %rcx + popq %rdx popq %rsi popq %rdi movq 3688(%rax), %r11 @@ -17301,32 +17290,36 @@ GL_PREFIX(VertexAttrib4NbvARB): 1: pushq %rdi pushq %rsi + pushq %rdx + pushq %rcx pushq %rbp call _glapi_get_dispatch popq %rbp + popq %rcx + popq %rdx popq %rsi popq %rdi movq 3688(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib4NbvARB), .-GL_PREFIX(VertexAttrib4NbvARB) + .size GL_PREFIX(ProgramStringARB), .-GL_PREFIX(ProgramStringARB) .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib4NivARB) - .type GL_PREFIX(VertexAttrib4NivARB), @function -GL_PREFIX(VertexAttrib4NivARB): + .globl GL_PREFIX(VertexAttrib1dARB) + .type GL_PREFIX(VertexAttrib1dARB), @function +GL_PREFIX(VertexAttrib1dARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3696(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp + subq $24, %rsp + movq %rdi, (%rsp) + movq %xmm0, 8(%rsp) call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi + movq 8(%rsp), %xmm0 + movq (%rsp), %rdi + addq $24, %rsp movq 3696(%rax), %r11 jmp *%r11 #else @@ -17336,22 +17329,22 @@ GL_PREFIX(VertexAttrib4NivARB): movq 3696(%rax), %r11 jmp *%r11 1: - pushq %rdi - pushq %rsi - pushq %rbp + subq $24, %rsp + movq %rdi, (%rsp) + movq %xmm0, 8(%rsp) call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi + movq 8(%rsp), %xmm0 + movq (%rsp), %rdi + addq $24, %rsp movq 3696(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib4NivARB), .-GL_PREFIX(VertexAttrib4NivARB) + .size GL_PREFIX(VertexAttrib1dARB), .-GL_PREFIX(VertexAttrib1dARB) .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib4NsvARB) - .type GL_PREFIX(VertexAttrib4NsvARB), @function -GL_PREFIX(VertexAttrib4NsvARB): + .globl GL_PREFIX(VertexAttrib1dvARB) + .type GL_PREFIX(VertexAttrib1dvARB), @function +GL_PREFIX(VertexAttrib1dvARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3704(%rax), %r11 @@ -17383,28 +17376,24 @@ GL_PREFIX(VertexAttrib4NsvARB): movq 3704(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib4NsvARB), .-GL_PREFIX(VertexAttrib4NsvARB) + .size GL_PREFIX(VertexAttrib1dvARB), .-GL_PREFIX(VertexAttrib1dvARB) .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib4NubARB) - .type GL_PREFIX(VertexAttrib4NubARB), @function -GL_PREFIX(VertexAttrib4NubARB): + .globl GL_PREFIX(VertexAttrib1fARB) + .type GL_PREFIX(VertexAttrib1fARB), @function +GL_PREFIX(VertexAttrib1fARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3712(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 + subq $24, %rsp + movq %rdi, (%rsp) + movq %xmm0, 8(%rsp) call _x86_64_get_dispatch@PLT - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi + movq 8(%rsp), %xmm0 + movq (%rsp), %rdi + addq $24, %rsp movq 3712(%rax), %r11 jmp *%r11 #else @@ -17414,26 +17403,22 @@ GL_PREFIX(VertexAttrib4NubARB): movq 3712(%rax), %r11 jmp *%r11 1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 + subq $24, %rsp + movq %rdi, (%rsp) + movq %xmm0, 8(%rsp) call _glapi_get_dispatch - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi + movq 8(%rsp), %xmm0 + movq (%rsp), %rdi + addq $24, %rsp movq 3712(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib4NubARB), .-GL_PREFIX(VertexAttrib4NubARB) + .size GL_PREFIX(VertexAttrib1fARB), .-GL_PREFIX(VertexAttrib1fARB) .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib4NubvARB) - .type GL_PREFIX(VertexAttrib4NubvARB), @function -GL_PREFIX(VertexAttrib4NubvARB): + .globl GL_PREFIX(VertexAttrib1fvARB) + .type GL_PREFIX(VertexAttrib1fvARB), @function +GL_PREFIX(VertexAttrib1fvARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3720(%rax), %r11 @@ -17465,12 +17450,12 @@ GL_PREFIX(VertexAttrib4NubvARB): movq 3720(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib4NubvARB), .-GL_PREFIX(VertexAttrib4NubvARB) + .size GL_PREFIX(VertexAttrib1fvARB), .-GL_PREFIX(VertexAttrib1fvARB) .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib4NuivARB) - .type GL_PREFIX(VertexAttrib4NuivARB), @function -GL_PREFIX(VertexAttrib4NuivARB): + .globl GL_PREFIX(VertexAttrib1sARB) + .type GL_PREFIX(VertexAttrib1sARB), @function +GL_PREFIX(VertexAttrib1sARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3728(%rax), %r11 @@ -17502,12 +17487,12 @@ GL_PREFIX(VertexAttrib4NuivARB): movq 3728(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib4NuivARB), .-GL_PREFIX(VertexAttrib4NuivARB) + .size GL_PREFIX(VertexAttrib1sARB), .-GL_PREFIX(VertexAttrib1sARB) .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib4NusvARB) - .type GL_PREFIX(VertexAttrib4NusvARB), @function -GL_PREFIX(VertexAttrib4NusvARB): + .globl GL_PREFIX(VertexAttrib1svARB) + .type GL_PREFIX(VertexAttrib1svARB), @function +GL_PREFIX(VertexAttrib1svARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3736(%rax), %r11 @@ -17539,24 +17524,26 @@ GL_PREFIX(VertexAttrib4NusvARB): movq 3736(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib4NusvARB), .-GL_PREFIX(VertexAttrib4NusvARB) + .size GL_PREFIX(VertexAttrib1svARB), .-GL_PREFIX(VertexAttrib1svARB) .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib4bvARB) - .type GL_PREFIX(VertexAttrib4bvARB), @function -GL_PREFIX(VertexAttrib4bvARB): + .globl GL_PREFIX(VertexAttrib2dARB) + .type GL_PREFIX(VertexAttrib2dARB), @function +GL_PREFIX(VertexAttrib2dARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3744(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp + subq $24, %rsp + movq %rdi, (%rsp) + movq %xmm0, 8(%rsp) + movq %xmm1, 16(%rsp) call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi + movq 16(%rsp), %xmm1 + movq 8(%rsp), %xmm0 + movq (%rsp), %rdi + addq $24, %rsp movq 3744(%rax), %r11 jmp *%r11 #else @@ -17566,40 +17553,36 @@ GL_PREFIX(VertexAttrib4bvARB): movq 3744(%rax), %r11 jmp *%r11 1: - pushq %rdi - pushq %rsi - pushq %rbp + subq $24, %rsp + movq %rdi, (%rsp) + movq %xmm0, 8(%rsp) + movq %xmm1, 16(%rsp) call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi + movq 16(%rsp), %xmm1 + movq 8(%rsp), %xmm0 + movq (%rsp), %rdi + addq $24, %rsp movq 3744(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib4bvARB), .-GL_PREFIX(VertexAttrib4bvARB) + .size GL_PREFIX(VertexAttrib2dARB), .-GL_PREFIX(VertexAttrib2dARB) .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib4dARB) - .type GL_PREFIX(VertexAttrib4dARB), @function -GL_PREFIX(VertexAttrib4dARB): + .globl GL_PREFIX(VertexAttrib2dvARB) + .type GL_PREFIX(VertexAttrib2dvARB), @function +GL_PREFIX(VertexAttrib2dvARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3752(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) - subq $40, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) - movq %xmm2, 24(%rsp) - movq %xmm3, 32(%rsp) + pushq %rdi + pushq %rsi + pushq %rbp call _x86_64_get_dispatch@PLT - movq 32(%rsp), %xmm3 - movq 24(%rsp), %xmm2 - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $40, %rsp + popq %rbp + popq %rsi + popq %rdi movq 3752(%rax), %r11 jmp *%r11 #else @@ -17609,40 +17592,36 @@ GL_PREFIX(VertexAttrib4dARB): movq 3752(%rax), %r11 jmp *%r11 1: - subq $40, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) - movq %xmm2, 24(%rsp) - movq %xmm3, 32(%rsp) + pushq %rdi + pushq %rsi + pushq %rbp call _glapi_get_dispatch - movq 32(%rsp), %xmm3 - movq 24(%rsp), %xmm2 - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $40, %rsp + popq %rbp + popq %rsi + popq %rdi movq 3752(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib4dARB), .-GL_PREFIX(VertexAttrib4dARB) + .size GL_PREFIX(VertexAttrib2dvARB), .-GL_PREFIX(VertexAttrib2dvARB) .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib4dvARB) - .type GL_PREFIX(VertexAttrib4dvARB), @function -GL_PREFIX(VertexAttrib4dvARB): + .globl GL_PREFIX(VertexAttrib2fARB) + .type GL_PREFIX(VertexAttrib2fARB), @function +GL_PREFIX(VertexAttrib2fARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3760(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp + subq $24, %rsp + movq %rdi, (%rsp) + movq %xmm0, 8(%rsp) + movq %xmm1, 16(%rsp) call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi + movq 16(%rsp), %xmm1 + movq 8(%rsp), %xmm0 + movq (%rsp), %rdi + addq $24, %rsp movq 3760(%rax), %r11 jmp *%r11 #else @@ -17652,40 +17631,36 @@ GL_PREFIX(VertexAttrib4dvARB): movq 3760(%rax), %r11 jmp *%r11 1: - pushq %rdi - pushq %rsi - pushq %rbp - call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi + subq $24, %rsp + movq %rdi, (%rsp) + movq %xmm0, 8(%rsp) + movq %xmm1, 16(%rsp) + call _glapi_get_dispatch + movq 16(%rsp), %xmm1 + movq 8(%rsp), %xmm0 + movq (%rsp), %rdi + addq $24, %rsp movq 3760(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib4dvARB), .-GL_PREFIX(VertexAttrib4dvARB) + .size GL_PREFIX(VertexAttrib2fARB), .-GL_PREFIX(VertexAttrib2fARB) .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib4fARB) - .type GL_PREFIX(VertexAttrib4fARB), @function -GL_PREFIX(VertexAttrib4fARB): + .globl GL_PREFIX(VertexAttrib2fvARB) + .type GL_PREFIX(VertexAttrib2fvARB), @function +GL_PREFIX(VertexAttrib2fvARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3768(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) - subq $40, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) - movq %xmm2, 24(%rsp) - movq %xmm3, 32(%rsp) + pushq %rdi + pushq %rsi + pushq %rbp call _x86_64_get_dispatch@PLT - movq 32(%rsp), %xmm3 - movq 24(%rsp), %xmm2 - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $40, %rsp + popq %rbp + popq %rsi + popq %rdi movq 3768(%rax), %r11 jmp *%r11 #else @@ -17695,28 +17670,22 @@ GL_PREFIX(VertexAttrib4fARB): movq 3768(%rax), %r11 jmp *%r11 1: - subq $40, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) - movq %xmm2, 24(%rsp) - movq %xmm3, 32(%rsp) + pushq %rdi + pushq %rsi + pushq %rbp call _glapi_get_dispatch - movq 32(%rsp), %xmm3 - movq 24(%rsp), %xmm2 - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $40, %rsp + popq %rbp + popq %rsi + popq %rdi movq 3768(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib4fARB), .-GL_PREFIX(VertexAttrib4fARB) + .size GL_PREFIX(VertexAttrib2fvARB), .-GL_PREFIX(VertexAttrib2fvARB) .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib4fvARB) - .type GL_PREFIX(VertexAttrib4fvARB), @function -GL_PREFIX(VertexAttrib4fvARB): + .globl GL_PREFIX(VertexAttrib2sARB) + .type GL_PREFIX(VertexAttrib2sARB), @function +GL_PREFIX(VertexAttrib2sARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3776(%rax), %r11 @@ -17724,9 +17693,9 @@ GL_PREFIX(VertexAttrib4fvARB): #elif defined(PTHREADS) pushq %rdi pushq %rsi - pushq %rbp + pushq %rdx call _x86_64_get_dispatch@PLT - popq %rbp + popq %rdx popq %rsi popq %rdi movq 3776(%rax), %r11 @@ -17740,20 +17709,20 @@ GL_PREFIX(VertexAttrib4fvARB): 1: pushq %rdi pushq %rsi - pushq %rbp + pushq %rdx call _glapi_get_dispatch - popq %rbp + popq %rdx popq %rsi popq %rdi movq 3776(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib4fvARB), .-GL_PREFIX(VertexAttrib4fvARB) + .size GL_PREFIX(VertexAttrib2sARB), .-GL_PREFIX(VertexAttrib2sARB) .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib4ivARB) - .type GL_PREFIX(VertexAttrib4ivARB), @function -GL_PREFIX(VertexAttrib4ivARB): + .globl GL_PREFIX(VertexAttrib2svARB) + .type GL_PREFIX(VertexAttrib2svARB), @function +GL_PREFIX(VertexAttrib2svARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3784(%rax), %r11 @@ -17785,28 +17754,28 @@ GL_PREFIX(VertexAttrib4ivARB): movq 3784(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib4ivARB), .-GL_PREFIX(VertexAttrib4ivARB) + .size GL_PREFIX(VertexAttrib2svARB), .-GL_PREFIX(VertexAttrib2svARB) .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib4sARB) - .type GL_PREFIX(VertexAttrib4sARB), @function -GL_PREFIX(VertexAttrib4sARB): + .globl GL_PREFIX(VertexAttrib3dARB) + .type GL_PREFIX(VertexAttrib3dARB), @function +GL_PREFIX(VertexAttrib3dARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3792(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 + subq $40, %rsp + movq %rdi, (%rsp) + movq %xmm0, 8(%rsp) + movq %xmm1, 16(%rsp) + movq %xmm2, 24(%rsp) call _x86_64_get_dispatch@PLT - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi + movq 24(%rsp), %xmm2 + movq 16(%rsp), %xmm1 + movq 8(%rsp), %xmm0 + movq (%rsp), %rdi + addq $40, %rsp movq 3792(%rax), %r11 jmp *%r11 #else @@ -17816,26 +17785,26 @@ GL_PREFIX(VertexAttrib4sARB): movq 3792(%rax), %r11 jmp *%r11 1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 + subq $40, %rsp + movq %rdi, (%rsp) + movq %xmm0, 8(%rsp) + movq %xmm1, 16(%rsp) + movq %xmm2, 24(%rsp) call _glapi_get_dispatch - popq %r8 - popq %rcx - popq %rdx - popq %rsi - popq %rdi + movq 24(%rsp), %xmm2 + movq 16(%rsp), %xmm1 + movq 8(%rsp), %xmm0 + movq (%rsp), %rdi + addq $40, %rsp movq 3792(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib4sARB), .-GL_PREFIX(VertexAttrib4sARB) + .size GL_PREFIX(VertexAttrib3dARB), .-GL_PREFIX(VertexAttrib3dARB) .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib4svARB) - .type GL_PREFIX(VertexAttrib4svARB), @function -GL_PREFIX(VertexAttrib4svARB): + .globl GL_PREFIX(VertexAttrib3dvARB) + .type GL_PREFIX(VertexAttrib3dvARB), @function +GL_PREFIX(VertexAttrib3dvARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3800(%rax), %r11 @@ -17867,24 +17836,28 @@ GL_PREFIX(VertexAttrib4svARB): movq 3800(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib4svARB), .-GL_PREFIX(VertexAttrib4svARB) + .size GL_PREFIX(VertexAttrib3dvARB), .-GL_PREFIX(VertexAttrib3dvARB) .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib4ubvARB) - .type GL_PREFIX(VertexAttrib4ubvARB), @function -GL_PREFIX(VertexAttrib4ubvARB): + .globl GL_PREFIX(VertexAttrib3fARB) + .type GL_PREFIX(VertexAttrib3fARB), @function +GL_PREFIX(VertexAttrib3fARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3808(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp + subq $40, %rsp + movq %rdi, (%rsp) + movq %xmm0, 8(%rsp) + movq %xmm1, 16(%rsp) + movq %xmm2, 24(%rsp) call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi + movq 24(%rsp), %xmm2 + movq 16(%rsp), %xmm1 + movq 8(%rsp), %xmm0 + movq (%rsp), %rdi + addq $40, %rsp movq 3808(%rax), %r11 jmp *%r11 #else @@ -17894,22 +17867,26 @@ GL_PREFIX(VertexAttrib4ubvARB): movq 3808(%rax), %r11 jmp *%r11 1: - pushq %rdi - pushq %rsi - pushq %rbp + subq $40, %rsp + movq %rdi, (%rsp) + movq %xmm0, 8(%rsp) + movq %xmm1, 16(%rsp) + movq %xmm2, 24(%rsp) call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi + movq 24(%rsp), %xmm2 + movq 16(%rsp), %xmm1 + movq 8(%rsp), %xmm0 + movq (%rsp), %rdi + addq $40, %rsp movq 3808(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib4ubvARB), .-GL_PREFIX(VertexAttrib4ubvARB) + .size GL_PREFIX(VertexAttrib3fARB), .-GL_PREFIX(VertexAttrib3fARB) .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib4uivARB) - .type GL_PREFIX(VertexAttrib4uivARB), @function -GL_PREFIX(VertexAttrib4uivARB): + .globl GL_PREFIX(VertexAttrib3fvARB) + .type GL_PREFIX(VertexAttrib3fvARB), @function +GL_PREFIX(VertexAttrib3fvARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3816(%rax), %r11 @@ -17941,12 +17918,12 @@ GL_PREFIX(VertexAttrib4uivARB): movq 3816(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib4uivARB), .-GL_PREFIX(VertexAttrib4uivARB) + .size GL_PREFIX(VertexAttrib3fvARB), .-GL_PREFIX(VertexAttrib3fvARB) .p2align 4,,15 - .globl GL_PREFIX(VertexAttrib4usvARB) - .type GL_PREFIX(VertexAttrib4usvARB), @function -GL_PREFIX(VertexAttrib4usvARB): + .globl GL_PREFIX(VertexAttrib3sARB) + .type GL_PREFIX(VertexAttrib3sARB), @function +GL_PREFIX(VertexAttrib3sARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3824(%rax), %r11 @@ -17954,9 +17931,13 @@ GL_PREFIX(VertexAttrib4usvARB): #elif defined(PTHREADS) pushq %rdi pushq %rsi + pushq %rdx + pushq %rcx pushq %rbp call _x86_64_get_dispatch@PLT popq %rbp + popq %rcx + popq %rdx popq %rsi popq %rdi movq 3824(%rax), %r11 @@ -17970,20 +17951,24 @@ GL_PREFIX(VertexAttrib4usvARB): 1: pushq %rdi pushq %rsi + pushq %rdx + pushq %rcx pushq %rbp call _glapi_get_dispatch popq %rbp + popq %rcx + popq %rdx popq %rsi popq %rdi movq 3824(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttrib4usvARB), .-GL_PREFIX(VertexAttrib4usvARB) + .size GL_PREFIX(VertexAttrib3sARB), .-GL_PREFIX(VertexAttrib3sARB) .p2align 4,,15 - .globl GL_PREFIX(VertexAttribPointerARB) - .type GL_PREFIX(VertexAttribPointerARB), @function -GL_PREFIX(VertexAttribPointerARB): + .globl GL_PREFIX(VertexAttrib3svARB) + .type GL_PREFIX(VertexAttrib3svARB), @function +GL_PREFIX(VertexAttrib3svARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3832(%rax), %r11 @@ -17991,17 +17976,9 @@ GL_PREFIX(VertexAttribPointerARB): #elif defined(PTHREADS) pushq %rdi pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 pushq %rbp call _x86_64_get_dispatch@PLT popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx popq %rsi popq %rdi movq 3832(%rax), %r11 @@ -18015,28 +17992,20 @@ GL_PREFIX(VertexAttribPointerARB): 1: pushq %rdi pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 pushq %rbp call _glapi_get_dispatch popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx popq %rsi popq %rdi movq 3832(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(VertexAttribPointerARB), .-GL_PREFIX(VertexAttribPointerARB) + .size GL_PREFIX(VertexAttrib3svARB), .-GL_PREFIX(VertexAttrib3svARB) .p2align 4,,15 - .globl GL_PREFIX(BindBufferARB) - .type GL_PREFIX(BindBufferARB), @function -GL_PREFIX(BindBufferARB): + .globl GL_PREFIX(VertexAttrib4NbvARB) + .type GL_PREFIX(VertexAttrib4NbvARB), @function +GL_PREFIX(VertexAttrib4NbvARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3840(%rax), %r11 @@ -18068,12 +18037,12 @@ GL_PREFIX(BindBufferARB): movq 3840(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(BindBufferARB), .-GL_PREFIX(BindBufferARB) + .size GL_PREFIX(VertexAttrib4NbvARB), .-GL_PREFIX(VertexAttrib4NbvARB) .p2align 4,,15 - .globl GL_PREFIX(BufferDataARB) - .type GL_PREFIX(BufferDataARB), @function -GL_PREFIX(BufferDataARB): + .globl GL_PREFIX(VertexAttrib4NivARB) + .type GL_PREFIX(VertexAttrib4NivARB), @function +GL_PREFIX(VertexAttrib4NivARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3848(%rax), %r11 @@ -18081,13 +18050,9 @@ GL_PREFIX(BufferDataARB): #elif defined(PTHREADS) pushq %rdi pushq %rsi - pushq %rdx - pushq %rcx pushq %rbp call _x86_64_get_dispatch@PLT popq %rbp - popq %rcx - popq %rdx popq %rsi popq %rdi movq 3848(%rax), %r11 @@ -18101,24 +18066,20 @@ GL_PREFIX(BufferDataARB): 1: pushq %rdi pushq %rsi - pushq %rdx - pushq %rcx pushq %rbp call _glapi_get_dispatch popq %rbp - popq %rcx - popq %rdx popq %rsi popq %rdi movq 3848(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(BufferDataARB), .-GL_PREFIX(BufferDataARB) + .size GL_PREFIX(VertexAttrib4NivARB), .-GL_PREFIX(VertexAttrib4NivARB) .p2align 4,,15 - .globl GL_PREFIX(BufferSubDataARB) - .type GL_PREFIX(BufferSubDataARB), @function -GL_PREFIX(BufferSubDataARB): + .globl GL_PREFIX(VertexAttrib4NsvARB) + .type GL_PREFIX(VertexAttrib4NsvARB), @function +GL_PREFIX(VertexAttrib4NsvARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3856(%rax), %r11 @@ -18126,13 +18087,9 @@ GL_PREFIX(BufferSubDataARB): #elif defined(PTHREADS) pushq %rdi pushq %rsi - pushq %rdx - pushq %rcx pushq %rbp call _x86_64_get_dispatch@PLT popq %rbp - popq %rcx - popq %rdx popq %rsi popq %rdi movq 3856(%rax), %r11 @@ -18146,24 +18103,20 @@ GL_PREFIX(BufferSubDataARB): 1: pushq %rdi pushq %rsi - pushq %rdx - pushq %rcx pushq %rbp call _glapi_get_dispatch popq %rbp - popq %rcx - popq %rdx popq %rsi popq %rdi movq 3856(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(BufferSubDataARB), .-GL_PREFIX(BufferSubDataARB) + .size GL_PREFIX(VertexAttrib4NsvARB), .-GL_PREFIX(VertexAttrib4NsvARB) .p2align 4,,15 - .globl GL_PREFIX(DeleteBuffersARB) - .type GL_PREFIX(DeleteBuffersARB), @function -GL_PREFIX(DeleteBuffersARB): + .globl GL_PREFIX(VertexAttrib4NubARB) + .type GL_PREFIX(VertexAttrib4NubARB), @function +GL_PREFIX(VertexAttrib4NubARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3864(%rax), %r11 @@ -18171,9 +18124,13 @@ GL_PREFIX(DeleteBuffersARB): #elif defined(PTHREADS) pushq %rdi pushq %rsi - pushq %rbp + pushq %rdx + pushq %rcx + pushq %r8 call _x86_64_get_dispatch@PLT - popq %rbp + popq %r8 + popq %rcx + popq %rdx popq %rsi popq %rdi movq 3864(%rax), %r11 @@ -18187,20 +18144,24 @@ GL_PREFIX(DeleteBuffersARB): 1: pushq %rdi pushq %rsi - pushq %rbp + pushq %rdx + pushq %rcx + pushq %r8 call _glapi_get_dispatch - popq %rbp + popq %r8 + popq %rcx + popq %rdx popq %rsi popq %rdi movq 3864(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(DeleteBuffersARB), .-GL_PREFIX(DeleteBuffersARB) + .size GL_PREFIX(VertexAttrib4NubARB), .-GL_PREFIX(VertexAttrib4NubARB) .p2align 4,,15 - .globl GL_PREFIX(GenBuffersARB) - .type GL_PREFIX(GenBuffersARB), @function -GL_PREFIX(GenBuffersARB): + .globl GL_PREFIX(VertexAttrib4NubvARB) + .type GL_PREFIX(VertexAttrib4NubvARB), @function +GL_PREFIX(VertexAttrib4NubvARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3872(%rax), %r11 @@ -18232,12 +18193,12 @@ GL_PREFIX(GenBuffersARB): movq 3872(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GenBuffersARB), .-GL_PREFIX(GenBuffersARB) + .size GL_PREFIX(VertexAttrib4NubvARB), .-GL_PREFIX(VertexAttrib4NubvARB) .p2align 4,,15 - .globl GL_PREFIX(GetBufferParameterivARB) - .type GL_PREFIX(GetBufferParameterivARB), @function -GL_PREFIX(GetBufferParameterivARB): + .globl GL_PREFIX(VertexAttrib4NuivARB) + .type GL_PREFIX(VertexAttrib4NuivARB), @function +GL_PREFIX(VertexAttrib4NuivARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3880(%rax), %r11 @@ -18245,9 +18206,9 @@ GL_PREFIX(GetBufferParameterivARB): #elif defined(PTHREADS) pushq %rdi pushq %rsi - pushq %rdx + pushq %rbp call _x86_64_get_dispatch@PLT - popq %rdx + popq %rbp popq %rsi popq %rdi movq 3880(%rax), %r11 @@ -18261,20 +18222,20 @@ GL_PREFIX(GetBufferParameterivARB): 1: pushq %rdi pushq %rsi - pushq %rdx + pushq %rbp call _glapi_get_dispatch - popq %rdx + popq %rbp popq %rsi popq %rdi movq 3880(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetBufferParameterivARB), .-GL_PREFIX(GetBufferParameterivARB) + .size GL_PREFIX(VertexAttrib4NuivARB), .-GL_PREFIX(VertexAttrib4NuivARB) .p2align 4,,15 - .globl GL_PREFIX(GetBufferPointervARB) - .type GL_PREFIX(GetBufferPointervARB), @function -GL_PREFIX(GetBufferPointervARB): + .globl GL_PREFIX(VertexAttrib4NusvARB) + .type GL_PREFIX(VertexAttrib4NusvARB), @function +GL_PREFIX(VertexAttrib4NusvARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3888(%rax), %r11 @@ -18282,9 +18243,9 @@ GL_PREFIX(GetBufferPointervARB): #elif defined(PTHREADS) pushq %rdi pushq %rsi - pushq %rdx + pushq %rbp call _x86_64_get_dispatch@PLT - popq %rdx + popq %rbp popq %rsi popq %rdi movq 3888(%rax), %r11 @@ -18298,20 +18259,20 @@ GL_PREFIX(GetBufferPointervARB): 1: pushq %rdi pushq %rsi - pushq %rdx + pushq %rbp call _glapi_get_dispatch - popq %rdx + popq %rbp popq %rsi popq %rdi movq 3888(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetBufferPointervARB), .-GL_PREFIX(GetBufferPointervARB) + .size GL_PREFIX(VertexAttrib4NusvARB), .-GL_PREFIX(VertexAttrib4NusvARB) .p2align 4,,15 - .globl GL_PREFIX(GetBufferSubDataARB) - .type GL_PREFIX(GetBufferSubDataARB), @function -GL_PREFIX(GetBufferSubDataARB): + .globl GL_PREFIX(VertexAttrib4bvARB) + .type GL_PREFIX(VertexAttrib4bvARB), @function +GL_PREFIX(VertexAttrib4bvARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3896(%rax), %r11 @@ -18319,13 +18280,9 @@ GL_PREFIX(GetBufferSubDataARB): #elif defined(PTHREADS) pushq %rdi pushq %rsi - pushq %rdx - pushq %rcx pushq %rbp call _x86_64_get_dispatch@PLT popq %rbp - popq %rcx - popq %rdx popq %rsi popq %rdi movq 3896(%rax), %r11 @@ -18339,32 +18296,38 @@ GL_PREFIX(GetBufferSubDataARB): 1: pushq %rdi pushq %rsi - pushq %rdx - pushq %rcx pushq %rbp call _glapi_get_dispatch popq %rbp - popq %rcx - popq %rdx popq %rsi popq %rdi movq 3896(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetBufferSubDataARB), .-GL_PREFIX(GetBufferSubDataARB) + .size GL_PREFIX(VertexAttrib4bvARB), .-GL_PREFIX(VertexAttrib4bvARB) .p2align 4,,15 - .globl GL_PREFIX(IsBufferARB) - .type GL_PREFIX(IsBufferARB), @function -GL_PREFIX(IsBufferARB): + .globl GL_PREFIX(VertexAttrib4dARB) + .type GL_PREFIX(VertexAttrib4dARB), @function +GL_PREFIX(VertexAttrib4dARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3904(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) - pushq %rdi + subq $40, %rsp + movq %rdi, (%rsp) + movq %xmm0, 8(%rsp) + movq %xmm1, 16(%rsp) + movq %xmm2, 24(%rsp) + movq %xmm3, 32(%rsp) call _x86_64_get_dispatch@PLT - popq %rdi + movq 32(%rsp), %xmm3 + movq 24(%rsp), %xmm2 + movq 16(%rsp), %xmm1 + movq 8(%rsp), %xmm0 + movq (%rsp), %rdi + addq $40, %rsp movq 3904(%rax), %r11 jmp *%r11 #else @@ -18374,18 +18337,28 @@ GL_PREFIX(IsBufferARB): movq 3904(%rax), %r11 jmp *%r11 1: - pushq %rdi + subq $40, %rsp + movq %rdi, (%rsp) + movq %xmm0, 8(%rsp) + movq %xmm1, 16(%rsp) + movq %xmm2, 24(%rsp) + movq %xmm3, 32(%rsp) call _glapi_get_dispatch - popq %rdi + movq 32(%rsp), %xmm3 + movq 24(%rsp), %xmm2 + movq 16(%rsp), %xmm1 + movq 8(%rsp), %xmm0 + movq (%rsp), %rdi + addq $40, %rsp movq 3904(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(IsBufferARB), .-GL_PREFIX(IsBufferARB) + .size GL_PREFIX(VertexAttrib4dARB), .-GL_PREFIX(VertexAttrib4dARB) .p2align 4,,15 - .globl GL_PREFIX(MapBufferARB) - .type GL_PREFIX(MapBufferARB), @function -GL_PREFIX(MapBufferARB): + .globl GL_PREFIX(VertexAttrib4dvARB) + .type GL_PREFIX(VertexAttrib4dvARB), @function +GL_PREFIX(VertexAttrib4dvARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3912(%rax), %r11 @@ -18417,20 +18390,30 @@ GL_PREFIX(MapBufferARB): movq 3912(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(MapBufferARB), .-GL_PREFIX(MapBufferARB) + .size GL_PREFIX(VertexAttrib4dvARB), .-GL_PREFIX(VertexAttrib4dvARB) .p2align 4,,15 - .globl GL_PREFIX(UnmapBufferARB) - .type GL_PREFIX(UnmapBufferARB), @function -GL_PREFIX(UnmapBufferARB): + .globl GL_PREFIX(VertexAttrib4fARB) + .type GL_PREFIX(VertexAttrib4fARB), @function +GL_PREFIX(VertexAttrib4fARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3920(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) - pushq %rdi + subq $40, %rsp + movq %rdi, (%rsp) + movq %xmm0, 8(%rsp) + movq %xmm1, 16(%rsp) + movq %xmm2, 24(%rsp) + movq %xmm3, 32(%rsp) call _x86_64_get_dispatch@PLT - popq %rdi + movq 32(%rsp), %xmm3 + movq 24(%rsp), %xmm2 + movq 16(%rsp), %xmm1 + movq 8(%rsp), %xmm0 + movq (%rsp), %rdi + addq $40, %rsp movq 3920(%rax), %r11 jmp *%r11 #else @@ -18440,18 +18423,28 @@ GL_PREFIX(UnmapBufferARB): movq 3920(%rax), %r11 jmp *%r11 1: - pushq %rdi + subq $40, %rsp + movq %rdi, (%rsp) + movq %xmm0, 8(%rsp) + movq %xmm1, 16(%rsp) + movq %xmm2, 24(%rsp) + movq %xmm3, 32(%rsp) call _glapi_get_dispatch - popq %rdi + movq 32(%rsp), %xmm3 + movq 24(%rsp), %xmm2 + movq 16(%rsp), %xmm1 + movq 8(%rsp), %xmm0 + movq (%rsp), %rdi + addq $40, %rsp movq 3920(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(UnmapBufferARB), .-GL_PREFIX(UnmapBufferARB) + .size GL_PREFIX(VertexAttrib4fARB), .-GL_PREFIX(VertexAttrib4fARB) .p2align 4,,15 - .globl GL_PREFIX(BeginQueryARB) - .type GL_PREFIX(BeginQueryARB), @function -GL_PREFIX(BeginQueryARB): + .globl GL_PREFIX(VertexAttrib4fvARB) + .type GL_PREFIX(VertexAttrib4fvARB), @function +GL_PREFIX(VertexAttrib4fvARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3928(%rax), %r11 @@ -18483,12 +18476,12 @@ GL_PREFIX(BeginQueryARB): movq 3928(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(BeginQueryARB), .-GL_PREFIX(BeginQueryARB) + .size GL_PREFIX(VertexAttrib4fvARB), .-GL_PREFIX(VertexAttrib4fvARB) .p2align 4,,15 - .globl GL_PREFIX(DeleteQueriesARB) - .type GL_PREFIX(DeleteQueriesARB), @function -GL_PREFIX(DeleteQueriesARB): + .globl GL_PREFIX(VertexAttrib4ivARB) + .type GL_PREFIX(VertexAttrib4ivARB), @function +GL_PREFIX(VertexAttrib4ivARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3936(%rax), %r11 @@ -18520,19 +18513,27 @@ GL_PREFIX(DeleteQueriesARB): movq 3936(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(DeleteQueriesARB), .-GL_PREFIX(DeleteQueriesARB) + .size GL_PREFIX(VertexAttrib4ivARB), .-GL_PREFIX(VertexAttrib4ivARB) .p2align 4,,15 - .globl GL_PREFIX(EndQueryARB) - .type GL_PREFIX(EndQueryARB), @function -GL_PREFIX(EndQueryARB): + .globl GL_PREFIX(VertexAttrib4sARB) + .type GL_PREFIX(VertexAttrib4sARB), @function +GL_PREFIX(VertexAttrib4sARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3944(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi + pushq %rsi + pushq %rdx + pushq %rcx + pushq %r8 call _x86_64_get_dispatch@PLT + popq %r8 + popq %rcx + popq %rdx + popq %rsi popq %rdi movq 3944(%rax), %r11 jmp *%r11 @@ -18544,17 +18545,25 @@ GL_PREFIX(EndQueryARB): jmp *%r11 1: pushq %rdi + pushq %rsi + pushq %rdx + pushq %rcx + pushq %r8 call _glapi_get_dispatch + popq %r8 + popq %rcx + popq %rdx + popq %rsi popq %rdi movq 3944(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(EndQueryARB), .-GL_PREFIX(EndQueryARB) + .size GL_PREFIX(VertexAttrib4sARB), .-GL_PREFIX(VertexAttrib4sARB) .p2align 4,,15 - .globl GL_PREFIX(GenQueriesARB) - .type GL_PREFIX(GenQueriesARB), @function -GL_PREFIX(GenQueriesARB): + .globl GL_PREFIX(VertexAttrib4svARB) + .type GL_PREFIX(VertexAttrib4svARB), @function +GL_PREFIX(VertexAttrib4svARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3952(%rax), %r11 @@ -18586,12 +18595,12 @@ GL_PREFIX(GenQueriesARB): movq 3952(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GenQueriesARB), .-GL_PREFIX(GenQueriesARB) + .size GL_PREFIX(VertexAttrib4svARB), .-GL_PREFIX(VertexAttrib4svARB) .p2align 4,,15 - .globl GL_PREFIX(GetQueryObjectivARB) - .type GL_PREFIX(GetQueryObjectivARB), @function -GL_PREFIX(GetQueryObjectivARB): + .globl GL_PREFIX(VertexAttrib4ubvARB) + .type GL_PREFIX(VertexAttrib4ubvARB), @function +GL_PREFIX(VertexAttrib4ubvARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3960(%rax), %r11 @@ -18599,9 +18608,9 @@ GL_PREFIX(GetQueryObjectivARB): #elif defined(PTHREADS) pushq %rdi pushq %rsi - pushq %rdx + pushq %rbp call _x86_64_get_dispatch@PLT - popq %rdx + popq %rbp popq %rsi popq %rdi movq 3960(%rax), %r11 @@ -18615,20 +18624,20 @@ GL_PREFIX(GetQueryObjectivARB): 1: pushq %rdi pushq %rsi - pushq %rdx + pushq %rbp call _glapi_get_dispatch - popq %rdx + popq %rbp popq %rsi popq %rdi movq 3960(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetQueryObjectivARB), .-GL_PREFIX(GetQueryObjectivARB) + .size GL_PREFIX(VertexAttrib4ubvARB), .-GL_PREFIX(VertexAttrib4ubvARB) .p2align 4,,15 - .globl GL_PREFIX(GetQueryObjectuivARB) - .type GL_PREFIX(GetQueryObjectuivARB), @function -GL_PREFIX(GetQueryObjectuivARB): + .globl GL_PREFIX(VertexAttrib4uivARB) + .type GL_PREFIX(VertexAttrib4uivARB), @function +GL_PREFIX(VertexAttrib4uivARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3968(%rax), %r11 @@ -18636,9 +18645,9 @@ GL_PREFIX(GetQueryObjectuivARB): #elif defined(PTHREADS) pushq %rdi pushq %rsi - pushq %rdx + pushq %rbp call _x86_64_get_dispatch@PLT - popq %rdx + popq %rbp popq %rsi popq %rdi movq 3968(%rax), %r11 @@ -18652,20 +18661,20 @@ GL_PREFIX(GetQueryObjectuivARB): 1: pushq %rdi pushq %rsi - pushq %rdx + pushq %rbp call _glapi_get_dispatch - popq %rdx + popq %rbp popq %rsi popq %rdi movq 3968(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetQueryObjectuivARB), .-GL_PREFIX(GetQueryObjectuivARB) + .size GL_PREFIX(VertexAttrib4uivARB), .-GL_PREFIX(VertexAttrib4uivARB) .p2align 4,,15 - .globl GL_PREFIX(GetQueryivARB) - .type GL_PREFIX(GetQueryivARB), @function -GL_PREFIX(GetQueryivARB): + .globl GL_PREFIX(VertexAttrib4usvARB) + .type GL_PREFIX(VertexAttrib4usvARB), @function +GL_PREFIX(VertexAttrib4usvARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3976(%rax), %r11 @@ -18673,9 +18682,9 @@ GL_PREFIX(GetQueryivARB): #elif defined(PTHREADS) pushq %rdi pushq %rsi - pushq %rdx + pushq %rbp call _x86_64_get_dispatch@PLT - popq %rdx + popq %rbp popq %rsi popq %rdi movq 3976(%rax), %r11 @@ -18689,27 +18698,39 @@ GL_PREFIX(GetQueryivARB): 1: pushq %rdi pushq %rsi - pushq %rdx + pushq %rbp call _glapi_get_dispatch - popq %rdx + popq %rbp popq %rsi popq %rdi movq 3976(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetQueryivARB), .-GL_PREFIX(GetQueryivARB) + .size GL_PREFIX(VertexAttrib4usvARB), .-GL_PREFIX(VertexAttrib4usvARB) .p2align 4,,15 - .globl GL_PREFIX(IsQueryARB) - .type GL_PREFIX(IsQueryARB), @function -GL_PREFIX(IsQueryARB): + .globl GL_PREFIX(VertexAttribPointerARB) + .type GL_PREFIX(VertexAttribPointerARB), @function +GL_PREFIX(VertexAttribPointerARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3984(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi + pushq %rsi + pushq %rdx + pushq %rcx + pushq %r8 + pushq %r9 + pushq %rbp call _x86_64_get_dispatch@PLT + popq %rbp + popq %r9 + popq %r8 + popq %rcx + popq %rdx + popq %rsi popq %rdi movq 3984(%rax), %r11 jmp *%r11 @@ -18721,17 +18742,29 @@ GL_PREFIX(IsQueryARB): jmp *%r11 1: pushq %rdi + pushq %rsi + pushq %rdx + pushq %rcx + pushq %r8 + pushq %r9 + pushq %rbp call _glapi_get_dispatch + popq %rbp + popq %r9 + popq %r8 + popq %rcx + popq %rdx + popq %rsi popq %rdi movq 3984(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(IsQueryARB), .-GL_PREFIX(IsQueryARB) + .size GL_PREFIX(VertexAttribPointerARB), .-GL_PREFIX(VertexAttribPointerARB) .p2align 4,,15 - .globl GL_PREFIX(AttachObjectARB) - .type GL_PREFIX(AttachObjectARB), @function -GL_PREFIX(AttachObjectARB): + .globl GL_PREFIX(BindBufferARB) + .type GL_PREFIX(BindBufferARB), @function +GL_PREFIX(BindBufferARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 3992(%rax), %r11 @@ -18763,19 +18796,27 @@ GL_PREFIX(AttachObjectARB): movq 3992(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(AttachObjectARB), .-GL_PREFIX(AttachObjectARB) + .size GL_PREFIX(BindBufferARB), .-GL_PREFIX(BindBufferARB) .p2align 4,,15 - .globl GL_PREFIX(CompileShaderARB) - .type GL_PREFIX(CompileShaderARB), @function -GL_PREFIX(CompileShaderARB): + .globl GL_PREFIX(BufferDataARB) + .type GL_PREFIX(BufferDataARB), @function +GL_PREFIX(BufferDataARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 4000(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi + pushq %rsi + pushq %rdx + pushq %rcx + pushq %rbp call _x86_64_get_dispatch@PLT + popq %rbp + popq %rcx + popq %rdx + popq %rsi popq %rdi movq 4000(%rax), %r11 jmp *%r11 @@ -18787,25 +18828,41 @@ GL_PREFIX(CompileShaderARB): jmp *%r11 1: pushq %rdi + pushq %rsi + pushq %rdx + pushq %rcx + pushq %rbp call _glapi_get_dispatch + popq %rbp + popq %rcx + popq %rdx + popq %rsi popq %rdi movq 4000(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(CompileShaderARB), .-GL_PREFIX(CompileShaderARB) + .size GL_PREFIX(BufferDataARB), .-GL_PREFIX(BufferDataARB) .p2align 4,,15 - .globl GL_PREFIX(CreateProgramObjectARB) - .type GL_PREFIX(CreateProgramObjectARB), @function -GL_PREFIX(CreateProgramObjectARB): + .globl GL_PREFIX(BufferSubDataARB) + .type GL_PREFIX(BufferSubDataARB), @function +GL_PREFIX(BufferSubDataARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 4008(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) + pushq %rdi + pushq %rsi + pushq %rdx + pushq %rcx pushq %rbp call _x86_64_get_dispatch@PLT popq %rbp + popq %rcx + popq %rdx + popq %rsi + popq %rdi movq 4008(%rax), %r11 jmp *%r11 #else @@ -18815,25 +18872,37 @@ GL_PREFIX(CreateProgramObjectARB): movq 4008(%rax), %r11 jmp *%r11 1: + pushq %rdi + pushq %rsi + pushq %rdx + pushq %rcx pushq %rbp call _glapi_get_dispatch popq %rbp + popq %rcx + popq %rdx + popq %rsi + popq %rdi movq 4008(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(CreateProgramObjectARB), .-GL_PREFIX(CreateProgramObjectARB) + .size GL_PREFIX(BufferSubDataARB), .-GL_PREFIX(BufferSubDataARB) .p2align 4,,15 - .globl GL_PREFIX(CreateShaderObjectARB) - .type GL_PREFIX(CreateShaderObjectARB), @function -GL_PREFIX(CreateShaderObjectARB): + .globl GL_PREFIX(DeleteBuffersARB) + .type GL_PREFIX(DeleteBuffersARB), @function +GL_PREFIX(DeleteBuffersARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 4016(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi + pushq %rsi + pushq %rbp call _x86_64_get_dispatch@PLT + popq %rbp + popq %rsi popq %rdi movq 4016(%rax), %r11 jmp *%r11 @@ -18845,24 +18914,32 @@ GL_PREFIX(CreateShaderObjectARB): jmp *%r11 1: pushq %rdi + pushq %rsi + pushq %rbp call _glapi_get_dispatch + popq %rbp + popq %rsi popq %rdi movq 4016(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(CreateShaderObjectARB), .-GL_PREFIX(CreateShaderObjectARB) + .size GL_PREFIX(DeleteBuffersARB), .-GL_PREFIX(DeleteBuffersARB) .p2align 4,,15 - .globl GL_PREFIX(DeleteObjectARB) - .type GL_PREFIX(DeleteObjectARB), @function -GL_PREFIX(DeleteObjectARB): + .globl GL_PREFIX(GenBuffersARB) + .type GL_PREFIX(GenBuffersARB), @function +GL_PREFIX(GenBuffersARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 4024(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi + pushq %rsi + pushq %rbp call _x86_64_get_dispatch@PLT + popq %rbp + popq %rsi popq %rdi movq 4024(%rax), %r11 jmp *%r11 @@ -18874,17 +18951,21 @@ GL_PREFIX(DeleteObjectARB): jmp *%r11 1: pushq %rdi + pushq %rsi + pushq %rbp call _glapi_get_dispatch + popq %rbp + popq %rsi popq %rdi movq 4024(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(DeleteObjectARB), .-GL_PREFIX(DeleteObjectARB) + .size GL_PREFIX(GenBuffersARB), .-GL_PREFIX(GenBuffersARB) .p2align 4,,15 - .globl GL_PREFIX(DetachObjectARB) - .type GL_PREFIX(DetachObjectARB), @function -GL_PREFIX(DetachObjectARB): + .globl GL_PREFIX(GetBufferParameterivARB) + .type GL_PREFIX(GetBufferParameterivARB), @function +GL_PREFIX(GetBufferParameterivARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 4032(%rax), %r11 @@ -18892,9 +18973,9 @@ GL_PREFIX(DetachObjectARB): #elif defined(PTHREADS) pushq %rdi pushq %rsi - pushq %rbp + pushq %rdx call _x86_64_get_dispatch@PLT - popq %rbp + popq %rdx popq %rsi popq %rdi movq 4032(%rax), %r11 @@ -18908,20 +18989,20 @@ GL_PREFIX(DetachObjectARB): 1: pushq %rdi pushq %rsi - pushq %rbp + pushq %rdx call _glapi_get_dispatch - popq %rbp + popq %rdx popq %rsi popq %rdi movq 4032(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(DetachObjectARB), .-GL_PREFIX(DetachObjectARB) + .size GL_PREFIX(GetBufferParameterivARB), .-GL_PREFIX(GetBufferParameterivARB) .p2align 4,,15 - .globl GL_PREFIX(GetActiveUniformARB) - .type GL_PREFIX(GetActiveUniformARB), @function -GL_PREFIX(GetActiveUniformARB): + .globl GL_PREFIX(GetBufferPointervARB) + .type GL_PREFIX(GetBufferPointervARB), @function +GL_PREFIX(GetBufferPointervARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 4040(%rax), %r11 @@ -18930,15 +19011,7 @@ GL_PREFIX(GetActiveUniformARB): pushq %rdi pushq %rsi pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp call _x86_64_get_dispatch@PLT - popq %rbp - popq %r9 - popq %r8 - popq %rcx popq %rdx popq %rsi popq %rdi @@ -18954,27 +19027,19 @@ GL_PREFIX(GetActiveUniformARB): pushq %rdi pushq %rsi pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp call _glapi_get_dispatch - popq %rbp - popq %r9 - popq %r8 - popq %rcx popq %rdx popq %rsi popq %rdi movq 4040(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetActiveUniformARB), .-GL_PREFIX(GetActiveUniformARB) + .size GL_PREFIX(GetBufferPointervARB), .-GL_PREFIX(GetBufferPointervARB) .p2align 4,,15 - .globl GL_PREFIX(GetAttachedObjectsARB) - .type GL_PREFIX(GetAttachedObjectsARB), @function -GL_PREFIX(GetAttachedObjectsARB): + .globl GL_PREFIX(GetBufferSubDataARB) + .type GL_PREFIX(GetBufferSubDataARB), @function +GL_PREFIX(GetBufferSubDataARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 4048(%rax), %r11 @@ -19014,12 +19079,12 @@ GL_PREFIX(GetAttachedObjectsARB): movq 4048(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetAttachedObjectsARB), .-GL_PREFIX(GetAttachedObjectsARB) + .size GL_PREFIX(GetBufferSubDataARB), .-GL_PREFIX(GetBufferSubDataARB) .p2align 4,,15 - .globl GL_PREFIX(GetHandleARB) - .type GL_PREFIX(GetHandleARB), @function -GL_PREFIX(GetHandleARB): + .globl GL_PREFIX(IsBufferARB) + .type GL_PREFIX(IsBufferARB), @function +GL_PREFIX(IsBufferARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 4056(%rax), %r11 @@ -19043,12 +19108,12 @@ GL_PREFIX(GetHandleARB): movq 4056(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetHandleARB), .-GL_PREFIX(GetHandleARB) + .size GL_PREFIX(IsBufferARB), .-GL_PREFIX(IsBufferARB) .p2align 4,,15 - .globl GL_PREFIX(GetInfoLogARB) - .type GL_PREFIX(GetInfoLogARB), @function -GL_PREFIX(GetInfoLogARB): + .globl GL_PREFIX(MapBufferARB) + .type GL_PREFIX(MapBufferARB), @function +GL_PREFIX(MapBufferARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 4064(%rax), %r11 @@ -19056,13 +19121,9 @@ GL_PREFIX(GetInfoLogARB): #elif defined(PTHREADS) pushq %rdi pushq %rsi - pushq %rdx - pushq %rcx pushq %rbp call _x86_64_get_dispatch@PLT popq %rbp - popq %rcx - popq %rdx popq %rsi popq %rdi movq 4064(%rax), %r11 @@ -19076,35 +19137,27 @@ GL_PREFIX(GetInfoLogARB): 1: pushq %rdi pushq %rsi - pushq %rdx - pushq %rcx pushq %rbp call _glapi_get_dispatch popq %rbp - popq %rcx - popq %rdx popq %rsi popq %rdi movq 4064(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetInfoLogARB), .-GL_PREFIX(GetInfoLogARB) + .size GL_PREFIX(MapBufferARB), .-GL_PREFIX(MapBufferARB) .p2align 4,,15 - .globl GL_PREFIX(GetObjectParameterfvARB) - .type GL_PREFIX(GetObjectParameterfvARB), @function -GL_PREFIX(GetObjectParameterfvARB): + .globl GL_PREFIX(UnmapBufferARB) + .type GL_PREFIX(UnmapBufferARB), @function +GL_PREFIX(UnmapBufferARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 4072(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi - pushq %rsi - pushq %rdx call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi popq %rdi movq 4072(%rax), %r11 jmp *%r11 @@ -19116,21 +19169,17 @@ GL_PREFIX(GetObjectParameterfvARB): jmp *%r11 1: pushq %rdi - pushq %rsi - pushq %rdx call _glapi_get_dispatch - popq %rdx - popq %rsi popq %rdi movq 4072(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetObjectParameterfvARB), .-GL_PREFIX(GetObjectParameterfvARB) + .size GL_PREFIX(UnmapBufferARB), .-GL_PREFIX(UnmapBufferARB) .p2align 4,,15 - .globl GL_PREFIX(GetObjectParameterivARB) - .type GL_PREFIX(GetObjectParameterivARB), @function -GL_PREFIX(GetObjectParameterivARB): + .globl GL_PREFIX(BeginQueryARB) + .type GL_PREFIX(BeginQueryARB), @function +GL_PREFIX(BeginQueryARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 4080(%rax), %r11 @@ -19138,9 +19187,9 @@ GL_PREFIX(GetObjectParameterivARB): #elif defined(PTHREADS) pushq %rdi pushq %rsi - pushq %rdx + pushq %rbp call _x86_64_get_dispatch@PLT - popq %rdx + popq %rbp popq %rsi popq %rdi movq 4080(%rax), %r11 @@ -19154,20 +19203,20 @@ GL_PREFIX(GetObjectParameterivARB): 1: pushq %rdi pushq %rsi - pushq %rdx + pushq %rbp call _glapi_get_dispatch - popq %rdx + popq %rbp popq %rsi popq %rdi movq 4080(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetObjectParameterivARB), .-GL_PREFIX(GetObjectParameterivARB) + .size GL_PREFIX(BeginQueryARB), .-GL_PREFIX(BeginQueryARB) .p2align 4,,15 - .globl GL_PREFIX(GetShaderSourceARB) - .type GL_PREFIX(GetShaderSourceARB), @function -GL_PREFIX(GetShaderSourceARB): + .globl GL_PREFIX(DeleteQueriesARB) + .type GL_PREFIX(DeleteQueriesARB), @function +GL_PREFIX(DeleteQueriesARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 4088(%rax), %r11 @@ -19175,13 +19224,9 @@ GL_PREFIX(GetShaderSourceARB): #elif defined(PTHREADS) pushq %rdi pushq %rsi - pushq %rdx - pushq %rcx pushq %rbp call _x86_64_get_dispatch@PLT popq %rbp - popq %rcx - popq %rdx popq %rsi popq %rdi movq 4088(%rax), %r11 @@ -19195,35 +19240,27 @@ GL_PREFIX(GetShaderSourceARB): 1: pushq %rdi pushq %rsi - pushq %rdx - pushq %rcx pushq %rbp call _glapi_get_dispatch popq %rbp - popq %rcx - popq %rdx popq %rsi popq %rdi movq 4088(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetShaderSourceARB), .-GL_PREFIX(GetShaderSourceARB) + .size GL_PREFIX(DeleteQueriesARB), .-GL_PREFIX(DeleteQueriesARB) .p2align 4,,15 - .globl GL_PREFIX(GetUniformLocationARB) - .type GL_PREFIX(GetUniformLocationARB), @function -GL_PREFIX(GetUniformLocationARB): + .globl GL_PREFIX(EndQueryARB) + .type GL_PREFIX(EndQueryARB), @function +GL_PREFIX(EndQueryARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 4096(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi - pushq %rsi - pushq %rbp call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi popq %rdi movq 4096(%rax), %r11 jmp *%r11 @@ -19235,21 +19272,17 @@ GL_PREFIX(GetUniformLocationARB): jmp *%r11 1: pushq %rdi - pushq %rsi - pushq %rbp call _glapi_get_dispatch - popq %rbp - popq %rsi popq %rdi movq 4096(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetUniformLocationARB), .-GL_PREFIX(GetUniformLocationARB) + .size GL_PREFIX(EndQueryARB), .-GL_PREFIX(EndQueryARB) .p2align 4,,15 - .globl GL_PREFIX(GetUniformfvARB) - .type GL_PREFIX(GetUniformfvARB), @function -GL_PREFIX(GetUniformfvARB): + .globl GL_PREFIX(GenQueriesARB) + .type GL_PREFIX(GenQueriesARB), @function +GL_PREFIX(GenQueriesARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 4104(%rax), %r11 @@ -19257,9 +19290,9 @@ GL_PREFIX(GetUniformfvARB): #elif defined(PTHREADS) pushq %rdi pushq %rsi - pushq %rdx + pushq %rbp call _x86_64_get_dispatch@PLT - popq %rdx + popq %rbp popq %rsi popq %rdi movq 4104(%rax), %r11 @@ -19273,20 +19306,20 @@ GL_PREFIX(GetUniformfvARB): 1: pushq %rdi pushq %rsi - pushq %rdx + pushq %rbp call _glapi_get_dispatch - popq %rdx + popq %rbp popq %rsi popq %rdi movq 4104(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetUniformfvARB), .-GL_PREFIX(GetUniformfvARB) + .size GL_PREFIX(GenQueriesARB), .-GL_PREFIX(GenQueriesARB) .p2align 4,,15 - .globl GL_PREFIX(GetUniformivARB) - .type GL_PREFIX(GetUniformivARB), @function -GL_PREFIX(GetUniformivARB): + .globl GL_PREFIX(GetQueryObjectivARB) + .type GL_PREFIX(GetQueryObjectivARB), @function +GL_PREFIX(GetQueryObjectivARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 4112(%rax), %r11 @@ -19318,19 +19351,23 @@ GL_PREFIX(GetUniformivARB): movq 4112(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetUniformivARB), .-GL_PREFIX(GetUniformivARB) + .size GL_PREFIX(GetQueryObjectivARB), .-GL_PREFIX(GetQueryObjectivARB) .p2align 4,,15 - .globl GL_PREFIX(LinkProgramARB) - .type GL_PREFIX(LinkProgramARB), @function -GL_PREFIX(LinkProgramARB): + .globl GL_PREFIX(GetQueryObjectuivARB) + .type GL_PREFIX(GetQueryObjectuivARB), @function +GL_PREFIX(GetQueryObjectuivARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 4120(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi + pushq %rsi + pushq %rdx call _x86_64_get_dispatch@PLT + popq %rdx + popq %rsi popq %rdi movq 4120(%rax), %r11 jmp *%r11 @@ -19342,17 +19379,21 @@ GL_PREFIX(LinkProgramARB): jmp *%r11 1: pushq %rdi + pushq %rsi + pushq %rdx call _glapi_get_dispatch + popq %rdx + popq %rsi popq %rdi movq 4120(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(LinkProgramARB), .-GL_PREFIX(LinkProgramARB) + .size GL_PREFIX(GetQueryObjectuivARB), .-GL_PREFIX(GetQueryObjectuivARB) .p2align 4,,15 - .globl GL_PREFIX(ShaderSourceARB) - .type GL_PREFIX(ShaderSourceARB), @function -GL_PREFIX(ShaderSourceARB): + .globl GL_PREFIX(GetQueryivARB) + .type GL_PREFIX(GetQueryivARB), @function +GL_PREFIX(GetQueryivARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 4128(%rax), %r11 @@ -19361,11 +19402,7 @@ GL_PREFIX(ShaderSourceARB): pushq %rdi pushq %rsi pushq %rdx - pushq %rcx - pushq %rbp call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx popq %rdx popq %rsi popq %rdi @@ -19381,35 +19418,27 @@ GL_PREFIX(ShaderSourceARB): pushq %rdi pushq %rsi pushq %rdx - pushq %rcx - pushq %rbp call _glapi_get_dispatch - popq %rbp - popq %rcx popq %rdx popq %rsi popq %rdi movq 4128(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(ShaderSourceARB), .-GL_PREFIX(ShaderSourceARB) + .size GL_PREFIX(GetQueryivARB), .-GL_PREFIX(GetQueryivARB) .p2align 4,,15 - .globl GL_PREFIX(Uniform1fARB) - .type GL_PREFIX(Uniform1fARB), @function -GL_PREFIX(Uniform1fARB): + .globl GL_PREFIX(IsQueryARB) + .type GL_PREFIX(IsQueryARB), @function +GL_PREFIX(IsQueryARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 4136(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) - subq $24, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) + pushq %rdi call _x86_64_get_dispatch@PLT - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $24, %rsp + popq %rdi movq 4136(%rax), %r11 jmp *%r11 #else @@ -19419,22 +19448,18 @@ GL_PREFIX(Uniform1fARB): movq 4136(%rax), %r11 jmp *%r11 1: - subq $24, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) + pushq %rdi call _glapi_get_dispatch - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $24, %rsp + popq %rdi movq 4136(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Uniform1fARB), .-GL_PREFIX(Uniform1fARB) + .size GL_PREFIX(IsQueryARB), .-GL_PREFIX(IsQueryARB) .p2align 4,,15 - .globl GL_PREFIX(Uniform1fvARB) - .type GL_PREFIX(Uniform1fvARB), @function -GL_PREFIX(Uniform1fvARB): + .globl GL_PREFIX(AttachObjectARB) + .type GL_PREFIX(AttachObjectARB), @function +GL_PREFIX(AttachObjectARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 4144(%rax), %r11 @@ -19442,9 +19467,9 @@ GL_PREFIX(Uniform1fvARB): #elif defined(PTHREADS) pushq %rdi pushq %rsi - pushq %rdx + pushq %rbp call _x86_64_get_dispatch@PLT - popq %rdx + popq %rbp popq %rsi popq %rdi movq 4144(%rax), %r11 @@ -19458,31 +19483,27 @@ GL_PREFIX(Uniform1fvARB): 1: pushq %rdi pushq %rsi - pushq %rdx + pushq %rbp call _glapi_get_dispatch - popq %rdx + popq %rbp popq %rsi popq %rdi movq 4144(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Uniform1fvARB), .-GL_PREFIX(Uniform1fvARB) + .size GL_PREFIX(AttachObjectARB), .-GL_PREFIX(AttachObjectARB) .p2align 4,,15 - .globl GL_PREFIX(Uniform1iARB) - .type GL_PREFIX(Uniform1iARB), @function -GL_PREFIX(Uniform1iARB): + .globl GL_PREFIX(CompileShaderARB) + .type GL_PREFIX(CompileShaderARB), @function +GL_PREFIX(CompileShaderARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 4152(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi - pushq %rsi - pushq %rbp call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi popq %rdi movq 4152(%rax), %r11 jmp *%r11 @@ -19494,33 +19515,25 @@ GL_PREFIX(Uniform1iARB): jmp *%r11 1: pushq %rdi - pushq %rsi - pushq %rbp call _glapi_get_dispatch - popq %rbp - popq %rsi popq %rdi movq 4152(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Uniform1iARB), .-GL_PREFIX(Uniform1iARB) + .size GL_PREFIX(CompileShaderARB), .-GL_PREFIX(CompileShaderARB) .p2align 4,,15 - .globl GL_PREFIX(Uniform1ivARB) - .type GL_PREFIX(Uniform1ivARB), @function -GL_PREFIX(Uniform1ivARB): + .globl GL_PREFIX(CreateProgramObjectARB) + .type GL_PREFIX(CreateProgramObjectARB), @function +GL_PREFIX(CreateProgramObjectARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 4160(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx + pushq %rbp call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi + popq %rbp movq 4160(%rax), %r11 jmp *%r11 #else @@ -19530,36 +19543,26 @@ GL_PREFIX(Uniform1ivARB): movq 4160(%rax), %r11 jmp *%r11 1: - pushq %rdi - pushq %rsi - pushq %rdx + pushq %rbp call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi + popq %rbp movq 4160(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Uniform1ivARB), .-GL_PREFIX(Uniform1ivARB) + .size GL_PREFIX(CreateProgramObjectARB), .-GL_PREFIX(CreateProgramObjectARB) .p2align 4,,15 - .globl GL_PREFIX(Uniform2fARB) - .type GL_PREFIX(Uniform2fARB), @function -GL_PREFIX(Uniform2fARB): + .globl GL_PREFIX(CreateShaderObjectARB) + .type GL_PREFIX(CreateShaderObjectARB), @function +GL_PREFIX(CreateShaderObjectARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 4168(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) - subq $24, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) + pushq %rdi call _x86_64_get_dispatch@PLT - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $24, %rsp + popq %rdi movq 4168(%rax), %r11 jmp *%r11 #else @@ -19569,35 +19572,25 @@ GL_PREFIX(Uniform2fARB): movq 4168(%rax), %r11 jmp *%r11 1: - subq $24, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) + pushq %rdi call _glapi_get_dispatch - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $24, %rsp + popq %rdi movq 4168(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Uniform2fARB), .-GL_PREFIX(Uniform2fARB) + .size GL_PREFIX(CreateShaderObjectARB), .-GL_PREFIX(CreateShaderObjectARB) .p2align 4,,15 - .globl GL_PREFIX(Uniform2fvARB) - .type GL_PREFIX(Uniform2fvARB), @function -GL_PREFIX(Uniform2fvARB): + .globl GL_PREFIX(DeleteObjectARB) + .type GL_PREFIX(DeleteObjectARB), @function +GL_PREFIX(DeleteObjectARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 4176(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi - pushq %rsi - pushq %rdx call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi popq %rdi movq 4176(%rax), %r11 jmp *%r11 @@ -19609,21 +19602,17 @@ GL_PREFIX(Uniform2fvARB): jmp *%r11 1: pushq %rdi - pushq %rsi - pushq %rdx call _glapi_get_dispatch - popq %rdx - popq %rsi popq %rdi movq 4176(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Uniform2fvARB), .-GL_PREFIX(Uniform2fvARB) + .size GL_PREFIX(DeleteObjectARB), .-GL_PREFIX(DeleteObjectARB) .p2align 4,,15 - .globl GL_PREFIX(Uniform2iARB) - .type GL_PREFIX(Uniform2iARB), @function -GL_PREFIX(Uniform2iARB): + .globl GL_PREFIX(DetachObjectARB) + .type GL_PREFIX(DetachObjectARB), @function +GL_PREFIX(DetachObjectARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 4184(%rax), %r11 @@ -19631,9 +19620,9 @@ GL_PREFIX(Uniform2iARB): #elif defined(PTHREADS) pushq %rdi pushq %rsi - pushq %rdx + pushq %rbp call _x86_64_get_dispatch@PLT - popq %rdx + popq %rbp popq %rsi popq %rdi movq 4184(%rax), %r11 @@ -19647,20 +19636,20 @@ GL_PREFIX(Uniform2iARB): 1: pushq %rdi pushq %rsi - pushq %rdx + pushq %rbp call _glapi_get_dispatch - popq %rdx + popq %rbp popq %rsi popq %rdi movq 4184(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Uniform2iARB), .-GL_PREFIX(Uniform2iARB) + .size GL_PREFIX(DetachObjectARB), .-GL_PREFIX(DetachObjectARB) .p2align 4,,15 - .globl GL_PREFIX(Uniform2ivARB) - .type GL_PREFIX(Uniform2ivARB), @function -GL_PREFIX(Uniform2ivARB): + .globl GL_PREFIX(GetActiveUniformARB) + .type GL_PREFIX(GetActiveUniformARB), @function +GL_PREFIX(GetActiveUniformARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 4192(%rax), %r11 @@ -19669,7 +19658,15 @@ GL_PREFIX(Uniform2ivARB): pushq %rdi pushq %rsi pushq %rdx + pushq %rcx + pushq %r8 + pushq %r9 + pushq %rbp call _x86_64_get_dispatch@PLT + popq %rbp + popq %r9 + popq %r8 + popq %rcx popq %rdx popq %rsi popq %rdi @@ -19685,35 +19682,43 @@ GL_PREFIX(Uniform2ivARB): pushq %rdi pushq %rsi pushq %rdx + pushq %rcx + pushq %r8 + pushq %r9 + pushq %rbp call _glapi_get_dispatch + popq %rbp + popq %r9 + popq %r8 + popq %rcx popq %rdx popq %rsi popq %rdi movq 4192(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Uniform2ivARB), .-GL_PREFIX(Uniform2ivARB) + .size GL_PREFIX(GetActiveUniformARB), .-GL_PREFIX(GetActiveUniformARB) .p2align 4,,15 - .globl GL_PREFIX(Uniform3fARB) - .type GL_PREFIX(Uniform3fARB), @function -GL_PREFIX(Uniform3fARB): + .globl GL_PREFIX(GetAttachedObjectsARB) + .type GL_PREFIX(GetAttachedObjectsARB), @function +GL_PREFIX(GetAttachedObjectsARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 4200(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) - subq $40, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) - movq %xmm2, 24(%rsp) + pushq %rdi + pushq %rsi + pushq %rdx + pushq %rcx + pushq %rbp call _x86_64_get_dispatch@PLT - movq 24(%rsp), %xmm2 - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $40, %rsp + popq %rbp + popq %rcx + popq %rdx + popq %rsi + popq %rdi movq 4200(%rax), %r11 jmp *%r11 #else @@ -19723,37 +19728,33 @@ GL_PREFIX(Uniform3fARB): movq 4200(%rax), %r11 jmp *%r11 1: - subq $40, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) - movq %xmm2, 24(%rsp) + pushq %rdi + pushq %rsi + pushq %rdx + pushq %rcx + pushq %rbp call _glapi_get_dispatch - movq 24(%rsp), %xmm2 - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $40, %rsp + popq %rbp + popq %rcx + popq %rdx + popq %rsi + popq %rdi movq 4200(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Uniform3fARB), .-GL_PREFIX(Uniform3fARB) + .size GL_PREFIX(GetAttachedObjectsARB), .-GL_PREFIX(GetAttachedObjectsARB) .p2align 4,,15 - .globl GL_PREFIX(Uniform3fvARB) - .type GL_PREFIX(Uniform3fvARB), @function -GL_PREFIX(Uniform3fvARB): + .globl GL_PREFIX(GetHandleARB) + .type GL_PREFIX(GetHandleARB), @function +GL_PREFIX(GetHandleARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 4208(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi - pushq %rsi - pushq %rdx call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi popq %rdi movq 4208(%rax), %r11 jmp *%r11 @@ -19765,21 +19766,17 @@ GL_PREFIX(Uniform3fvARB): jmp *%r11 1: pushq %rdi - pushq %rsi - pushq %rdx call _glapi_get_dispatch - popq %rdx - popq %rsi popq %rdi movq 4208(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Uniform3fvARB), .-GL_PREFIX(Uniform3fvARB) + .size GL_PREFIX(GetHandleARB), .-GL_PREFIX(GetHandleARB) .p2align 4,,15 - .globl GL_PREFIX(Uniform3iARB) - .type GL_PREFIX(Uniform3iARB), @function -GL_PREFIX(Uniform3iARB): + .globl GL_PREFIX(GetInfoLogARB) + .type GL_PREFIX(GetInfoLogARB), @function +GL_PREFIX(GetInfoLogARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 4216(%rax), %r11 @@ -19819,12 +19816,12 @@ GL_PREFIX(Uniform3iARB): movq 4216(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Uniform3iARB), .-GL_PREFIX(Uniform3iARB) + .size GL_PREFIX(GetInfoLogARB), .-GL_PREFIX(GetInfoLogARB) .p2align 4,,15 - .globl GL_PREFIX(Uniform3ivARB) - .type GL_PREFIX(Uniform3ivARB), @function -GL_PREFIX(Uniform3ivARB): + .globl GL_PREFIX(GetObjectParameterfvARB) + .type GL_PREFIX(GetObjectParameterfvARB), @function +GL_PREFIX(GetObjectParameterfvARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 4224(%rax), %r11 @@ -19856,30 +19853,24 @@ GL_PREFIX(Uniform3ivARB): movq 4224(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Uniform3ivARB), .-GL_PREFIX(Uniform3ivARB) + .size GL_PREFIX(GetObjectParameterfvARB), .-GL_PREFIX(GetObjectParameterfvARB) .p2align 4,,15 - .globl GL_PREFIX(Uniform4fARB) - .type GL_PREFIX(Uniform4fARB), @function -GL_PREFIX(Uniform4fARB): + .globl GL_PREFIX(GetObjectParameterivARB) + .type GL_PREFIX(GetObjectParameterivARB), @function +GL_PREFIX(GetObjectParameterivARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 4232(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) - subq $40, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) - movq %xmm2, 24(%rsp) - movq %xmm3, 32(%rsp) + pushq %rdi + pushq %rsi + pushq %rdx call _x86_64_get_dispatch@PLT - movq 32(%rsp), %xmm3 - movq 24(%rsp), %xmm2 - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $40, %rsp + popq %rdx + popq %rsi + popq %rdi movq 4232(%rax), %r11 jmp *%r11 #else @@ -19889,28 +19880,22 @@ GL_PREFIX(Uniform4fARB): movq 4232(%rax), %r11 jmp *%r11 1: - subq $40, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) - movq %xmm1, 16(%rsp) - movq %xmm2, 24(%rsp) - movq %xmm3, 32(%rsp) + pushq %rdi + pushq %rsi + pushq %rdx call _glapi_get_dispatch - movq 32(%rsp), %xmm3 - movq 24(%rsp), %xmm2 - movq 16(%rsp), %xmm1 - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi - addq $40, %rsp + popq %rdx + popq %rsi + popq %rdi movq 4232(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Uniform4fARB), .-GL_PREFIX(Uniform4fARB) + .size GL_PREFIX(GetObjectParameterivARB), .-GL_PREFIX(GetObjectParameterivARB) .p2align 4,,15 - .globl GL_PREFIX(Uniform4fvARB) - .type GL_PREFIX(Uniform4fvARB), @function -GL_PREFIX(Uniform4fvARB): + .globl GL_PREFIX(GetShaderSourceARB) + .type GL_PREFIX(GetShaderSourceARB), @function +GL_PREFIX(GetShaderSourceARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 4240(%rax), %r11 @@ -19919,7 +19904,11 @@ GL_PREFIX(Uniform4fvARB): pushq %rdi pushq %rsi pushq %rdx + pushq %rcx + pushq %rbp call _x86_64_get_dispatch@PLT + popq %rbp + popq %rcx popq %rdx popq %rsi popq %rdi @@ -19935,19 +19924,23 @@ GL_PREFIX(Uniform4fvARB): pushq %rdi pushq %rsi pushq %rdx + pushq %rcx + pushq %rbp call _glapi_get_dispatch + popq %rbp + popq %rcx popq %rdx popq %rsi popq %rdi movq 4240(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Uniform4fvARB), .-GL_PREFIX(Uniform4fvARB) + .size GL_PREFIX(GetShaderSourceARB), .-GL_PREFIX(GetShaderSourceARB) .p2align 4,,15 - .globl GL_PREFIX(Uniform4iARB) - .type GL_PREFIX(Uniform4iARB), @function -GL_PREFIX(Uniform4iARB): + .globl GL_PREFIX(GetUniformLocationARB) + .type GL_PREFIX(GetUniformLocationARB), @function +GL_PREFIX(GetUniformLocationARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 4248(%rax), %r11 @@ -19955,13 +19948,9 @@ GL_PREFIX(Uniform4iARB): #elif defined(PTHREADS) pushq %rdi pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 + pushq %rbp call _x86_64_get_dispatch@PLT - popq %r8 - popq %rcx - popq %rdx + popq %rbp popq %rsi popq %rdi movq 4248(%rax), %r11 @@ -19975,24 +19964,20 @@ GL_PREFIX(Uniform4iARB): 1: pushq %rdi pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 + pushq %rbp call _glapi_get_dispatch - popq %r8 - popq %rcx - popq %rdx + popq %rbp popq %rsi popq %rdi movq 4248(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Uniform4iARB), .-GL_PREFIX(Uniform4iARB) + .size GL_PREFIX(GetUniformLocationARB), .-GL_PREFIX(GetUniformLocationARB) .p2align 4,,15 - .globl GL_PREFIX(Uniform4ivARB) - .type GL_PREFIX(Uniform4ivARB), @function -GL_PREFIX(Uniform4ivARB): + .globl GL_PREFIX(GetUniformfvARB) + .type GL_PREFIX(GetUniformfvARB), @function +GL_PREFIX(GetUniformfvARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 4256(%rax), %r11 @@ -20024,16 +20009,82 @@ GL_PREFIX(Uniform4ivARB): movq 4256(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(Uniform4ivARB), .-GL_PREFIX(Uniform4ivARB) + .size GL_PREFIX(GetUniformfvARB), .-GL_PREFIX(GetUniformfvARB) .p2align 4,,15 - .globl GL_PREFIX(UniformMatrix2fvARB) - .type GL_PREFIX(UniformMatrix2fvARB), @function -GL_PREFIX(UniformMatrix2fvARB): + .globl GL_PREFIX(GetUniformivARB) + .type GL_PREFIX(GetUniformivARB), @function +GL_PREFIX(GetUniformivARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 4264(%rax), %r11 jmp *%r11 +#elif defined(PTHREADS) + pushq %rdi + pushq %rsi + pushq %rdx + call _x86_64_get_dispatch@PLT + popq %rdx + popq %rsi + popq %rdi + movq 4264(%rax), %r11 + jmp *%r11 +#else + movq _glapi_Dispatch(%rip), %rax + testq %rax, %rax + je 1f + movq 4264(%rax), %r11 + jmp *%r11 +1: + pushq %rdi + pushq %rsi + pushq %rdx + call _glapi_get_dispatch + popq %rdx + popq %rsi + popq %rdi + movq 4264(%rax), %r11 + jmp *%r11 +#endif /* defined(GLX_USE_TLS) */ + .size GL_PREFIX(GetUniformivARB), .-GL_PREFIX(GetUniformivARB) + + .p2align 4,,15 + .globl GL_PREFIX(LinkProgramARB) + .type GL_PREFIX(LinkProgramARB), @function +GL_PREFIX(LinkProgramARB): +#if defined(GLX_USE_TLS) + call _x86_64_get_dispatch@PLT + movq 4272(%rax), %r11 + jmp *%r11 +#elif defined(PTHREADS) + pushq %rdi + call _x86_64_get_dispatch@PLT + popq %rdi + movq 4272(%rax), %r11 + jmp *%r11 +#else + movq _glapi_Dispatch(%rip), %rax + testq %rax, %rax + je 1f + movq 4272(%rax), %r11 + jmp *%r11 +1: + pushq %rdi + call _glapi_get_dispatch + popq %rdi + movq 4272(%rax), %r11 + jmp *%r11 +#endif /* defined(GLX_USE_TLS) */ + .size GL_PREFIX(LinkProgramARB), .-GL_PREFIX(LinkProgramARB) + + .p2align 4,,15 + .globl GL_PREFIX(ShaderSourceARB) + .type GL_PREFIX(ShaderSourceARB), @function +GL_PREFIX(ShaderSourceARB): +#if defined(GLX_USE_TLS) + call _x86_64_get_dispatch@PLT + movq 4280(%rax), %r11 + jmp *%r11 #elif defined(PTHREADS) pushq %rdi pushq %rsi @@ -20046,186 +20097,227 @@ GL_PREFIX(UniformMatrix2fvARB): popq %rdx popq %rsi popq %rdi - movq 4264(%rax), %r11 + movq 4280(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4264(%rax), %r11 + movq 4280(%rax), %r11 + jmp *%r11 +1: + pushq %rdi + pushq %rsi + pushq %rdx + pushq %rcx + pushq %rbp + call _glapi_get_dispatch + popq %rbp + popq %rcx + popq %rdx + popq %rsi + popq %rdi + movq 4280(%rax), %r11 + jmp *%r11 +#endif /* defined(GLX_USE_TLS) */ + .size GL_PREFIX(ShaderSourceARB), .-GL_PREFIX(ShaderSourceARB) + + .p2align 4,,15 + .globl GL_PREFIX(Uniform1fARB) + .type GL_PREFIX(Uniform1fARB), @function +GL_PREFIX(Uniform1fARB): +#if defined(GLX_USE_TLS) + call _x86_64_get_dispatch@PLT + movq 4288(%rax), %r11 + jmp *%r11 +#elif defined(PTHREADS) + subq $24, %rsp + movq %rdi, (%rsp) + movq %xmm0, 8(%rsp) + call _x86_64_get_dispatch@PLT + movq 8(%rsp), %xmm0 + movq (%rsp), %rdi + addq $24, %rsp + movq 4288(%rax), %r11 + jmp *%r11 +#else + movq _glapi_Dispatch(%rip), %rax + testq %rax, %rax + je 1f + movq 4288(%rax), %r11 jmp *%r11 1: - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbp + subq $24, %rsp + movq %rdi, (%rsp) + movq %xmm0, 8(%rsp) call _glapi_get_dispatch - popq %rbp - popq %rcx - popq %rdx - popq %rsi - popq %rdi - movq 4264(%rax), %r11 + movq 8(%rsp), %xmm0 + movq (%rsp), %rdi + addq $24, %rsp + movq 4288(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(UniformMatrix2fvARB), .-GL_PREFIX(UniformMatrix2fvARB) + .size GL_PREFIX(Uniform1fARB), .-GL_PREFIX(Uniform1fARB) .p2align 4,,15 - .globl GL_PREFIX(UniformMatrix3fvARB) - .type GL_PREFIX(UniformMatrix3fvARB), @function -GL_PREFIX(UniformMatrix3fvARB): + .globl GL_PREFIX(Uniform1fvARB) + .type GL_PREFIX(Uniform1fvARB), @function +GL_PREFIX(Uniform1fvARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4272(%rax), %r11 + movq 4296(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi pushq %rsi pushq %rdx - pushq %rcx - pushq %rbp call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx popq %rdx popq %rsi popq %rdi - movq 4272(%rax), %r11 + movq 4296(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4272(%rax), %r11 + movq 4296(%rax), %r11 jmp *%r11 1: pushq %rdi pushq %rsi pushq %rdx - pushq %rcx - pushq %rbp call _glapi_get_dispatch - popq %rbp - popq %rcx popq %rdx popq %rsi popq %rdi - movq 4272(%rax), %r11 + movq 4296(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(UniformMatrix3fvARB), .-GL_PREFIX(UniformMatrix3fvARB) + .size GL_PREFIX(Uniform1fvARB), .-GL_PREFIX(Uniform1fvARB) .p2align 4,,15 - .globl GL_PREFIX(UniformMatrix4fvARB) - .type GL_PREFIX(UniformMatrix4fvARB), @function -GL_PREFIX(UniformMatrix4fvARB): + .globl GL_PREFIX(Uniform1iARB) + .type GL_PREFIX(Uniform1iARB), @function +GL_PREFIX(Uniform1iARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4280(%rax), %r11 + movq 4304(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi pushq %rsi - pushq %rdx - pushq %rcx pushq %rbp call _x86_64_get_dispatch@PLT popq %rbp - popq %rcx - popq %rdx popq %rsi popq %rdi - movq 4280(%rax), %r11 + movq 4304(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4280(%rax), %r11 + movq 4304(%rax), %r11 jmp *%r11 1: pushq %rdi pushq %rsi - pushq %rdx - pushq %rcx pushq %rbp call _glapi_get_dispatch popq %rbp - popq %rcx - popq %rdx popq %rsi popq %rdi - movq 4280(%rax), %r11 + movq 4304(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(UniformMatrix4fvARB), .-GL_PREFIX(UniformMatrix4fvARB) + .size GL_PREFIX(Uniform1iARB), .-GL_PREFIX(Uniform1iARB) .p2align 4,,15 - .globl GL_PREFIX(UseProgramObjectARB) - .type GL_PREFIX(UseProgramObjectARB), @function -GL_PREFIX(UseProgramObjectARB): + .globl GL_PREFIX(Uniform1ivARB) + .type GL_PREFIX(Uniform1ivARB), @function +GL_PREFIX(Uniform1ivARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4288(%rax), %r11 + movq 4312(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi + pushq %rsi + pushq %rdx call _x86_64_get_dispatch@PLT + popq %rdx + popq %rsi popq %rdi - movq 4288(%rax), %r11 + movq 4312(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4288(%rax), %r11 + movq 4312(%rax), %r11 jmp *%r11 1: pushq %rdi + pushq %rsi + pushq %rdx call _glapi_get_dispatch + popq %rdx + popq %rsi popq %rdi - movq 4288(%rax), %r11 + movq 4312(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(UseProgramObjectARB), .-GL_PREFIX(UseProgramObjectARB) + .size GL_PREFIX(Uniform1ivARB), .-GL_PREFIX(Uniform1ivARB) .p2align 4,,15 - .globl GL_PREFIX(ValidateProgramARB) - .type GL_PREFIX(ValidateProgramARB), @function -GL_PREFIX(ValidateProgramARB): + .globl GL_PREFIX(Uniform2fARB) + .type GL_PREFIX(Uniform2fARB), @function +GL_PREFIX(Uniform2fARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4296(%rax), %r11 + movq 4320(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) - pushq %rdi + subq $24, %rsp + movq %rdi, (%rsp) + movq %xmm0, 8(%rsp) + movq %xmm1, 16(%rsp) call _x86_64_get_dispatch@PLT - popq %rdi - movq 4296(%rax), %r11 + movq 16(%rsp), %xmm1 + movq 8(%rsp), %xmm0 + movq (%rsp), %rdi + addq $24, %rsp + movq 4320(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4296(%rax), %r11 + movq 4320(%rax), %r11 jmp *%r11 1: - pushq %rdi + subq $24, %rsp + movq %rdi, (%rsp) + movq %xmm0, 8(%rsp) + movq %xmm1, 16(%rsp) call _glapi_get_dispatch - popq %rdi - movq 4296(%rax), %r11 + movq 16(%rsp), %xmm1 + movq 8(%rsp), %xmm0 + movq (%rsp), %rdi + addq $24, %rsp + movq 4320(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(ValidateProgramARB), .-GL_PREFIX(ValidateProgramARB) + .size GL_PREFIX(Uniform2fARB), .-GL_PREFIX(Uniform2fARB) .p2align 4,,15 - .globl GL_PREFIX(BindAttribLocationARB) - .type GL_PREFIX(BindAttribLocationARB), @function -GL_PREFIX(BindAttribLocationARB): + .globl GL_PREFIX(Uniform2fvARB) + .type GL_PREFIX(Uniform2fvARB), @function +GL_PREFIX(Uniform2fvARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4304(%rax), %r11 + movq 4328(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -20235,13 +20327,13 @@ GL_PREFIX(BindAttribLocationARB): popq %rdx popq %rsi popq %rdi - movq 4304(%rax), %r11 + movq 4328(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4304(%rax), %r11 + movq 4328(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -20251,229 +20343,219 @@ GL_PREFIX(BindAttribLocationARB): popq %rdx popq %rsi popq %rdi - movq 4304(%rax), %r11 + movq 4328(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(BindAttribLocationARB), .-GL_PREFIX(BindAttribLocationARB) + .size GL_PREFIX(Uniform2fvARB), .-GL_PREFIX(Uniform2fvARB) .p2align 4,,15 - .globl GL_PREFIX(GetActiveAttribARB) - .type GL_PREFIX(GetActiveAttribARB), @function -GL_PREFIX(GetActiveAttribARB): + .globl GL_PREFIX(Uniform2iARB) + .type GL_PREFIX(Uniform2iARB), @function +GL_PREFIX(Uniform2iARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4312(%rax), %r11 + movq 4336(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi pushq %rsi pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp call _x86_64_get_dispatch@PLT - popq %rbp - popq %r9 - popq %r8 - popq %rcx popq %rdx popq %rsi popq %rdi - movq 4312(%rax), %r11 + movq 4336(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4312(%rax), %r11 + movq 4336(%rax), %r11 jmp *%r11 1: pushq %rdi pushq %rsi pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp call _glapi_get_dispatch - popq %rbp - popq %r9 - popq %r8 - popq %rcx popq %rdx popq %rsi popq %rdi - movq 4312(%rax), %r11 + movq 4336(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetActiveAttribARB), .-GL_PREFIX(GetActiveAttribARB) + .size GL_PREFIX(Uniform2iARB), .-GL_PREFIX(Uniform2iARB) .p2align 4,,15 - .globl GL_PREFIX(GetAttribLocationARB) - .type GL_PREFIX(GetAttribLocationARB), @function -GL_PREFIX(GetAttribLocationARB): + .globl GL_PREFIX(Uniform2ivARB) + .type GL_PREFIX(Uniform2ivARB), @function +GL_PREFIX(Uniform2ivARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4320(%rax), %r11 + movq 4344(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi pushq %rsi - pushq %rbp + pushq %rdx call _x86_64_get_dispatch@PLT - popq %rbp + popq %rdx popq %rsi popq %rdi - movq 4320(%rax), %r11 + movq 4344(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4320(%rax), %r11 + movq 4344(%rax), %r11 jmp *%r11 1: pushq %rdi pushq %rsi - pushq %rbp + pushq %rdx call _glapi_get_dispatch - popq %rbp + popq %rdx popq %rsi popq %rdi - movq 4320(%rax), %r11 + movq 4344(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetAttribLocationARB), .-GL_PREFIX(GetAttribLocationARB) + .size GL_PREFIX(Uniform2ivARB), .-GL_PREFIX(Uniform2ivARB) .p2align 4,,15 - .globl GL_PREFIX(DrawBuffersARB) - .type GL_PREFIX(DrawBuffersARB), @function -GL_PREFIX(DrawBuffersARB): + .globl GL_PREFIX(Uniform3fARB) + .type GL_PREFIX(Uniform3fARB), @function +GL_PREFIX(Uniform3fARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4328(%rax), %r11 + movq 4352(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp + subq $40, %rsp + movq %rdi, (%rsp) + movq %xmm0, 8(%rsp) + movq %xmm1, 16(%rsp) + movq %xmm2, 24(%rsp) call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 4328(%rax), %r11 + movq 24(%rsp), %xmm2 + movq 16(%rsp), %xmm1 + movq 8(%rsp), %xmm0 + movq (%rsp), %rdi + addq $40, %rsp + movq 4352(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4328(%rax), %r11 + movq 4352(%rax), %r11 jmp *%r11 1: - pushq %rdi - pushq %rsi - pushq %rbp + subq $40, %rsp + movq %rdi, (%rsp) + movq %xmm0, 8(%rsp) + movq %xmm1, 16(%rsp) + movq %xmm2, 24(%rsp) call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 4328(%rax), %r11 + movq 24(%rsp), %xmm2 + movq 16(%rsp), %xmm1 + movq 8(%rsp), %xmm0 + movq (%rsp), %rdi + addq $40, %rsp + movq 4352(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(DrawBuffersARB), .-GL_PREFIX(DrawBuffersARB) + .size GL_PREFIX(Uniform3fARB), .-GL_PREFIX(Uniform3fARB) .p2align 4,,15 - .globl GL_PREFIX(PolygonOffsetEXT) - .type GL_PREFIX(PolygonOffsetEXT), @function -GL_PREFIX(PolygonOffsetEXT): + .globl GL_PREFIX(Uniform3fvARB) + .type GL_PREFIX(Uniform3fvARB), @function +GL_PREFIX(Uniform3fvARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4336(%rax), %r11 + movq 4360(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) - subq $24, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) + pushq %rdi + pushq %rsi + pushq %rdx call _x86_64_get_dispatch@PLT - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $24, %rsp - movq 4336(%rax), %r11 + popq %rdx + popq %rsi + popq %rdi + movq 4360(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4336(%rax), %r11 + movq 4360(%rax), %r11 jmp *%r11 1: - subq $24, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) + pushq %rdi + pushq %rsi + pushq %rdx call _glapi_get_dispatch - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $24, %rsp - movq 4336(%rax), %r11 + popq %rdx + popq %rsi + popq %rdi + movq 4360(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(PolygonOffsetEXT), .-GL_PREFIX(PolygonOffsetEXT) + .size GL_PREFIX(Uniform3fvARB), .-GL_PREFIX(Uniform3fvARB) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_543) - .type GL_PREFIX(_dispatch_stub_543), @function - HIDDEN(GL_PREFIX(_dispatch_stub_543)) -GL_PREFIX(_dispatch_stub_543): + .globl GL_PREFIX(Uniform3iARB) + .type GL_PREFIX(Uniform3iARB), @function +GL_PREFIX(Uniform3iARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4344(%rax), %r11 + movq 4368(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi pushq %rsi pushq %rdx pushq %rcx - pushq %r8 + pushq %rbp call _x86_64_get_dispatch@PLT - popq %r8 + popq %rbp popq %rcx popq %rdx popq %rsi popq %rdi - movq 4344(%rax), %r11 + movq 4368(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4344(%rax), %r11 + movq 4368(%rax), %r11 jmp *%r11 1: pushq %rdi pushq %rsi pushq %rdx pushq %rcx - pushq %r8 + pushq %rbp call _glapi_get_dispatch - popq %r8 + popq %rbp popq %rcx popq %rdx popq %rsi popq %rdi - movq 4344(%rax), %r11 + movq 4368(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_543), .-GL_PREFIX(_dispatch_stub_543) + .size GL_PREFIX(Uniform3iARB), .-GL_PREFIX(Uniform3iARB) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_544) - .type GL_PREFIX(_dispatch_stub_544), @function - HIDDEN(GL_PREFIX(_dispatch_stub_544)) -GL_PREFIX(_dispatch_stub_544): + .globl GL_PREFIX(Uniform3ivARB) + .type GL_PREFIX(Uniform3ivARB), @function +GL_PREFIX(Uniform3ivARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4352(%rax), %r11 + movq 4376(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -20483,13 +20565,13 @@ GL_PREFIX(_dispatch_stub_544): popq %rdx popq %rsi popq %rdi - movq 4352(%rax), %r11 + movq 4376(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4352(%rax), %r11 + movq 4376(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -20499,141 +20581,149 @@ GL_PREFIX(_dispatch_stub_544): popq %rdx popq %rsi popq %rdi - movq 4352(%rax), %r11 + movq 4376(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_544), .-GL_PREFIX(_dispatch_stub_544) + .size GL_PREFIX(Uniform3ivARB), .-GL_PREFIX(Uniform3ivARB) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_545) - .type GL_PREFIX(_dispatch_stub_545), @function - HIDDEN(GL_PREFIX(_dispatch_stub_545)) -GL_PREFIX(_dispatch_stub_545): + .globl GL_PREFIX(Uniform4fARB) + .type GL_PREFIX(Uniform4fARB), @function +GL_PREFIX(Uniform4fARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4360(%rax), %r11 + movq 4384(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rdx + subq $40, %rsp + movq %rdi, (%rsp) + movq %xmm0, 8(%rsp) + movq %xmm1, 16(%rsp) + movq %xmm2, 24(%rsp) + movq %xmm3, 32(%rsp) call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi - popq %rdi - movq 4360(%rax), %r11 + movq 32(%rsp), %xmm3 + movq 24(%rsp), %xmm2 + movq 16(%rsp), %xmm1 + movq 8(%rsp), %xmm0 + movq (%rsp), %rdi + addq $40, %rsp + movq 4384(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4360(%rax), %r11 + movq 4384(%rax), %r11 jmp *%r11 1: - pushq %rdi - pushq %rsi - pushq %rdx + subq $40, %rsp + movq %rdi, (%rsp) + movq %xmm0, 8(%rsp) + movq %xmm1, 16(%rsp) + movq %xmm2, 24(%rsp) + movq %xmm3, 32(%rsp) call _glapi_get_dispatch - popq %rdx - popq %rsi - popq %rdi - movq 4360(%rax), %r11 + movq 32(%rsp), %xmm3 + movq 24(%rsp), %xmm2 + movq 16(%rsp), %xmm1 + movq 8(%rsp), %xmm0 + movq (%rsp), %rdi + addq $40, %rsp + movq 4384(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_545), .-GL_PREFIX(_dispatch_stub_545) + .size GL_PREFIX(Uniform4fARB), .-GL_PREFIX(Uniform4fARB) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_546) - .type GL_PREFIX(_dispatch_stub_546), @function - HIDDEN(GL_PREFIX(_dispatch_stub_546)) -GL_PREFIX(_dispatch_stub_546): + .globl GL_PREFIX(Uniform4fvARB) + .type GL_PREFIX(Uniform4fvARB), @function +GL_PREFIX(Uniform4fvARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4368(%rax), %r11 + movq 4392(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi pushq %rsi pushq %rdx - pushq %rcx - pushq %r8 call _x86_64_get_dispatch@PLT - popq %r8 - popq %rcx popq %rdx popq %rsi popq %rdi - movq 4368(%rax), %r11 + movq 4392(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4368(%rax), %r11 + movq 4392(%rax), %r11 jmp *%r11 1: pushq %rdi pushq %rsi pushq %rdx - pushq %rcx - pushq %r8 call _glapi_get_dispatch - popq %r8 - popq %rcx popq %rdx popq %rsi popq %rdi - movq 4368(%rax), %r11 + movq 4392(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_546), .-GL_PREFIX(_dispatch_stub_546) + .size GL_PREFIX(Uniform4fvARB), .-GL_PREFIX(Uniform4fvARB) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_547) - .type GL_PREFIX(_dispatch_stub_547), @function - HIDDEN(GL_PREFIX(_dispatch_stub_547)) -GL_PREFIX(_dispatch_stub_547): + .globl GL_PREFIX(Uniform4iARB) + .type GL_PREFIX(Uniform4iARB), @function +GL_PREFIX(Uniform4iARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4376(%rax), %r11 + movq 4400(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi pushq %rsi pushq %rdx + pushq %rcx + pushq %r8 call _x86_64_get_dispatch@PLT + popq %r8 + popq %rcx popq %rdx popq %rsi popq %rdi - movq 4376(%rax), %r11 + movq 4400(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4376(%rax), %r11 + movq 4400(%rax), %r11 jmp *%r11 1: pushq %rdi pushq %rsi pushq %rdx + pushq %rcx + pushq %r8 call _glapi_get_dispatch + popq %r8 + popq %rcx popq %rdx popq %rsi popq %rdi - movq 4376(%rax), %r11 + movq 4400(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_547), .-GL_PREFIX(_dispatch_stub_547) + .size GL_PREFIX(Uniform4iARB), .-GL_PREFIX(Uniform4iARB) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_548) - .type GL_PREFIX(_dispatch_stub_548), @function - HIDDEN(GL_PREFIX(_dispatch_stub_548)) -GL_PREFIX(_dispatch_stub_548): + .globl GL_PREFIX(Uniform4ivARB) + .type GL_PREFIX(Uniform4ivARB), @function +GL_PREFIX(Uniform4ivARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4384(%rax), %r11 + movq 4408(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -20643,13 +20733,13 @@ GL_PREFIX(_dispatch_stub_548): popq %rdx popq %rsi popq %rdi - movq 4384(%rax), %r11 + movq 4408(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4384(%rax), %r11 + movq 4408(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -20659,19 +20749,18 @@ GL_PREFIX(_dispatch_stub_548): popq %rdx popq %rsi popq %rdi - movq 4384(%rax), %r11 + movq 4408(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_548), .-GL_PREFIX(_dispatch_stub_548) + .size GL_PREFIX(Uniform4ivARB), .-GL_PREFIX(Uniform4ivARB) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_549) - .type GL_PREFIX(_dispatch_stub_549), @function - HIDDEN(GL_PREFIX(_dispatch_stub_549)) -GL_PREFIX(_dispatch_stub_549): + .globl GL_PREFIX(UniformMatrix2fvARB) + .type GL_PREFIX(UniformMatrix2fvARB), @function +GL_PREFIX(UniformMatrix2fvARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4392(%rax), %r11 + movq 4416(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -20685,13 +20774,13 @@ GL_PREFIX(_dispatch_stub_549): popq %rdx popq %rsi popq %rdi - movq 4392(%rax), %r11 + movq 4416(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4392(%rax), %r11 + movq 4416(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -20705,187 +20794,166 @@ GL_PREFIX(_dispatch_stub_549): popq %rdx popq %rsi popq %rdi - movq 4392(%rax), %r11 + movq 4416(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_549), .-GL_PREFIX(_dispatch_stub_549) + .size GL_PREFIX(UniformMatrix2fvARB), .-GL_PREFIX(UniformMatrix2fvARB) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_550) - .type GL_PREFIX(_dispatch_stub_550), @function - HIDDEN(GL_PREFIX(_dispatch_stub_550)) -GL_PREFIX(_dispatch_stub_550): + .globl GL_PREFIX(UniformMatrix3fvARB) + .type GL_PREFIX(UniformMatrix3fvARB), @function +GL_PREFIX(UniformMatrix3fvARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4400(%rax), %r11 + movq 4424(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi pushq %rsi pushq %rdx + pushq %rcx + pushq %rbp call _x86_64_get_dispatch@PLT + popq %rbp + popq %rcx popq %rdx popq %rsi popq %rdi - movq 4400(%rax), %r11 + movq 4424(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4400(%rax), %r11 + movq 4424(%rax), %r11 jmp *%r11 1: pushq %rdi pushq %rsi pushq %rdx + pushq %rcx + pushq %rbp call _glapi_get_dispatch + popq %rbp + popq %rcx popq %rdx popq %rsi popq %rdi - movq 4400(%rax), %r11 + movq 4424(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_550), .-GL_PREFIX(_dispatch_stub_550) + .size GL_PREFIX(UniformMatrix3fvARB), .-GL_PREFIX(UniformMatrix3fvARB) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_551) - .type GL_PREFIX(_dispatch_stub_551), @function - HIDDEN(GL_PREFIX(_dispatch_stub_551)) -GL_PREFIX(_dispatch_stub_551): + .globl GL_PREFIX(UniformMatrix4fvARB) + .type GL_PREFIX(UniformMatrix4fvARB), @function +GL_PREFIX(UniformMatrix4fvARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4408(%rax), %r11 + movq 4432(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi pushq %rsi pushq %rdx + pushq %rcx + pushq %rbp call _x86_64_get_dispatch@PLT + popq %rbp + popq %rcx popq %rdx popq %rsi popq %rdi - movq 4408(%rax), %r11 + movq 4432(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4408(%rax), %r11 + movq 4432(%rax), %r11 jmp *%r11 1: pushq %rdi pushq %rsi pushq %rdx + pushq %rcx + pushq %rbp call _glapi_get_dispatch + popq %rbp + popq %rcx popq %rdx popq %rsi popq %rdi - movq 4408(%rax), %r11 + movq 4432(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_551), .-GL_PREFIX(_dispatch_stub_551) + .size GL_PREFIX(UniformMatrix4fvARB), .-GL_PREFIX(UniformMatrix4fvARB) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_552) - .type GL_PREFIX(_dispatch_stub_552), @function - HIDDEN(GL_PREFIX(_dispatch_stub_552)) -GL_PREFIX(_dispatch_stub_552): + .globl GL_PREFIX(UseProgramObjectARB) + .type GL_PREFIX(UseProgramObjectARB), @function +GL_PREFIX(UseProgramObjectARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4416(%rax), %r11 + movq 4440(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp call _x86_64_get_dispatch@PLT - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi popq %rdi - movq 4416(%rax), %r11 + movq 4440(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4416(%rax), %r11 + movq 4440(%rax), %r11 jmp *%r11 1: pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %r8 - pushq %r9 - pushq %rbp call _glapi_get_dispatch - popq %rbp - popq %r9 - popq %r8 - popq %rcx - popq %rdx - popq %rsi popq %rdi - movq 4416(%rax), %r11 + movq 4440(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_552), .-GL_PREFIX(_dispatch_stub_552) + .size GL_PREFIX(UseProgramObjectARB), .-GL_PREFIX(UseProgramObjectARB) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_553) - .type GL_PREFIX(_dispatch_stub_553), @function - HIDDEN(GL_PREFIX(_dispatch_stub_553)) -GL_PREFIX(_dispatch_stub_553): + .globl GL_PREFIX(ValidateProgramARB) + .type GL_PREFIX(ValidateProgramARB), @function +GL_PREFIX(ValidateProgramARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4424(%rax), %r11 + movq 4448(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi - pushq %rsi - pushq %rdx call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi popq %rdi - movq 4424(%rax), %r11 + movq 4448(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4424(%rax), %r11 + movq 4448(%rax), %r11 jmp *%r11 1: pushq %rdi - pushq %rsi - pushq %rdx call _glapi_get_dispatch - popq %rdx - popq %rsi popq %rdi - movq 4424(%rax), %r11 + movq 4448(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_553), .-GL_PREFIX(_dispatch_stub_553) + .size GL_PREFIX(ValidateProgramARB), .-GL_PREFIX(ValidateProgramARB) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_554) - .type GL_PREFIX(_dispatch_stub_554), @function - HIDDEN(GL_PREFIX(_dispatch_stub_554)) -GL_PREFIX(_dispatch_stub_554): + .globl GL_PREFIX(BindAttribLocationARB) + .type GL_PREFIX(BindAttribLocationARB), @function +GL_PREFIX(BindAttribLocationARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4432(%rax), %r11 + movq 4456(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -20895,13 +20963,13 @@ GL_PREFIX(_dispatch_stub_554): popq %rdx popq %rsi popq %rdi - movq 4432(%rax), %r11 + movq 4456(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4432(%rax), %r11 + movq 4456(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -20911,65 +20979,71 @@ GL_PREFIX(_dispatch_stub_554): popq %rdx popq %rsi popq %rdi - movq 4432(%rax), %r11 + movq 4456(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_554), .-GL_PREFIX(_dispatch_stub_554) + .size GL_PREFIX(BindAttribLocationARB), .-GL_PREFIX(BindAttribLocationARB) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_555) - .type GL_PREFIX(_dispatch_stub_555), @function - HIDDEN(GL_PREFIX(_dispatch_stub_555)) -GL_PREFIX(_dispatch_stub_555): + .globl GL_PREFIX(GetActiveAttribARB) + .type GL_PREFIX(GetActiveAttribARB), @function +GL_PREFIX(GetActiveAttribARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4440(%rax), %r11 + movq 4464(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi pushq %rsi pushq %rdx pushq %rcx + pushq %r8 + pushq %r9 pushq %rbp call _x86_64_get_dispatch@PLT popq %rbp + popq %r9 + popq %r8 popq %rcx popq %rdx popq %rsi popq %rdi - movq 4440(%rax), %r11 + movq 4464(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4440(%rax), %r11 + movq 4464(%rax), %r11 jmp *%r11 1: pushq %rdi pushq %rsi pushq %rdx pushq %rcx + pushq %r8 + pushq %r9 pushq %rbp call _glapi_get_dispatch popq %rbp + popq %r9 + popq %r8 popq %rcx popq %rdx popq %rsi popq %rdi - movq 4440(%rax), %r11 + movq 4464(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_555), .-GL_PREFIX(_dispatch_stub_555) + .size GL_PREFIX(GetActiveAttribARB), .-GL_PREFIX(GetActiveAttribARB) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_556) - .type GL_PREFIX(_dispatch_stub_556), @function - HIDDEN(GL_PREFIX(_dispatch_stub_556)) -GL_PREFIX(_dispatch_stub_556): + .globl GL_PREFIX(GetAttribLocationARB) + .type GL_PREFIX(GetAttribLocationARB), @function +GL_PREFIX(GetAttribLocationARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4448(%rax), %r11 + movq 4472(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -20979,13 +21053,13 @@ GL_PREFIX(_dispatch_stub_556): popq %rbp popq %rsi popq %rdi - movq 4448(%rax), %r11 + movq 4472(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4448(%rax), %r11 + movq 4472(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -20995,19 +21069,18 @@ GL_PREFIX(_dispatch_stub_556): popq %rbp popq %rsi popq %rdi - movq 4448(%rax), %r11 + movq 4472(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_556), .-GL_PREFIX(_dispatch_stub_556) + .size GL_PREFIX(GetAttribLocationARB), .-GL_PREFIX(GetAttribLocationARB) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_557) - .type GL_PREFIX(_dispatch_stub_557), @function - HIDDEN(GL_PREFIX(_dispatch_stub_557)) -GL_PREFIX(_dispatch_stub_557): + .globl GL_PREFIX(DrawBuffersARB) + .type GL_PREFIX(DrawBuffersARB), @function +GL_PREFIX(DrawBuffersARB): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4456(%rax), %r11 + movq 4480(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -21017,13 +21090,13 @@ GL_PREFIX(_dispatch_stub_557): popq %rbp popq %rsi popq %rdi - movq 4456(%rax), %r11 + movq 4480(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4456(%rax), %r11 + movq 4480(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -21033,57 +21106,56 @@ GL_PREFIX(_dispatch_stub_557): popq %rbp popq %rsi popq %rdi - movq 4456(%rax), %r11 + movq 4480(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_557), .-GL_PREFIX(_dispatch_stub_557) + .size GL_PREFIX(DrawBuffersARB), .-GL_PREFIX(DrawBuffersARB) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_558) - .type GL_PREFIX(_dispatch_stub_558), @function - HIDDEN(GL_PREFIX(_dispatch_stub_558)) -GL_PREFIX(_dispatch_stub_558): + .globl GL_PREFIX(PolygonOffsetEXT) + .type GL_PREFIX(PolygonOffsetEXT), @function +GL_PREFIX(PolygonOffsetEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4464(%rax), %r11 + movq 4488(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) subq $24, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) + movq %xmm0, (%rsp) + movq %xmm1, 8(%rsp) call _x86_64_get_dispatch@PLT - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi + movq 8(%rsp), %xmm1 + movq (%rsp), %xmm0 addq $24, %rsp - movq 4464(%rax), %r11 + movq 4488(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4464(%rax), %r11 + movq 4488(%rax), %r11 jmp *%r11 1: subq $24, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) + movq %xmm0, (%rsp) + movq %xmm1, 8(%rsp) call _glapi_get_dispatch - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi + movq 8(%rsp), %xmm1 + movq (%rsp), %xmm0 addq $24, %rsp - movq 4464(%rax), %r11 + movq 4488(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_558), .-GL_PREFIX(_dispatch_stub_558) + .size GL_PREFIX(PolygonOffsetEXT), .-GL_PREFIX(PolygonOffsetEXT) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_559) - .type GL_PREFIX(_dispatch_stub_559), @function - HIDDEN(GL_PREFIX(_dispatch_stub_559)) -GL_PREFIX(_dispatch_stub_559): + .globl GL_PREFIX(_dispatch_stub_562) + .type GL_PREFIX(_dispatch_stub_562), @function + HIDDEN(GL_PREFIX(_dispatch_stub_562)) +GL_PREFIX(_dispatch_stub_562): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4472(%rax), %r11 + movq 4496(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -21093,13 +21165,13 @@ GL_PREFIX(_dispatch_stub_559): popq %rbp popq %rsi popq %rdi - movq 4472(%rax), %r11 + movq 4496(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4472(%rax), %r11 + movq 4496(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -21109,19 +21181,19 @@ GL_PREFIX(_dispatch_stub_559): popq %rbp popq %rsi popq %rdi - movq 4472(%rax), %r11 + movq 4496(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_559), .-GL_PREFIX(_dispatch_stub_559) + .size GL_PREFIX(_dispatch_stub_562), .-GL_PREFIX(_dispatch_stub_562) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_560) - .type GL_PREFIX(_dispatch_stub_560), @function - HIDDEN(GL_PREFIX(_dispatch_stub_560)) -GL_PREFIX(_dispatch_stub_560): + .globl GL_PREFIX(_dispatch_stub_563) + .type GL_PREFIX(_dispatch_stub_563), @function + HIDDEN(GL_PREFIX(_dispatch_stub_563)) +GL_PREFIX(_dispatch_stub_563): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4480(%rax), %r11 + movq 4504(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -21131,13 +21203,13 @@ GL_PREFIX(_dispatch_stub_560): popq %rbp popq %rsi popq %rdi - movq 4480(%rax), %r11 + movq 4504(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4480(%rax), %r11 + movq 4504(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -21147,93 +21219,95 @@ GL_PREFIX(_dispatch_stub_560): popq %rbp popq %rsi popq %rdi - movq 4480(%rax), %r11 + movq 4504(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_560), .-GL_PREFIX(_dispatch_stub_560) + .size GL_PREFIX(_dispatch_stub_563), .-GL_PREFIX(_dispatch_stub_563) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_561) - .type GL_PREFIX(_dispatch_stub_561), @function - HIDDEN(GL_PREFIX(_dispatch_stub_561)) -GL_PREFIX(_dispatch_stub_561): + .globl GL_PREFIX(_dispatch_stub_564) + .type GL_PREFIX(_dispatch_stub_564), @function + HIDDEN(GL_PREFIX(_dispatch_stub_564)) +GL_PREFIX(_dispatch_stub_564): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4488(%rax), %r11 + movq 4512(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp + subq $24, %rsp + movq %rdi, (%rsp) + movq %xmm0, 8(%rsp) call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi - movq 4488(%rax), %r11 + movq 8(%rsp), %xmm0 + movq (%rsp), %rdi + addq $24, %rsp + movq 4512(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4488(%rax), %r11 + movq 4512(%rax), %r11 jmp *%r11 1: - pushq %rdi - pushq %rsi - pushq %rbp + subq $24, %rsp + movq %rdi, (%rsp) + movq %xmm0, 8(%rsp) call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi - movq 4488(%rax), %r11 + movq 8(%rsp), %xmm0 + movq (%rsp), %rdi + addq $24, %rsp + movq 4512(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_561), .-GL_PREFIX(_dispatch_stub_561) + .size GL_PREFIX(_dispatch_stub_564), .-GL_PREFIX(_dispatch_stub_564) .p2align 4,,15 - .globl GL_PREFIX(AreTexturesResidentEXT) - .type GL_PREFIX(AreTexturesResidentEXT), @function -GL_PREFIX(AreTexturesResidentEXT): + .globl GL_PREFIX(_dispatch_stub_565) + .type GL_PREFIX(_dispatch_stub_565), @function + HIDDEN(GL_PREFIX(_dispatch_stub_565)) +GL_PREFIX(_dispatch_stub_565): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4496(%rax), %r11 + movq 4520(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi pushq %rsi - pushq %rdx + pushq %rbp call _x86_64_get_dispatch@PLT - popq %rdx + popq %rbp popq %rsi popq %rdi - movq 4496(%rax), %r11 + movq 4520(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4496(%rax), %r11 + movq 4520(%rax), %r11 jmp *%r11 1: pushq %rdi pushq %rsi - pushq %rdx + pushq %rbp call _glapi_get_dispatch - popq %rdx + popq %rbp popq %rsi popq %rdi - movq 4496(%rax), %r11 + movq 4520(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(AreTexturesResidentEXT), .-GL_PREFIX(AreTexturesResidentEXT) + .size GL_PREFIX(_dispatch_stub_565), .-GL_PREFIX(_dispatch_stub_565) .p2align 4,,15 - .globl GL_PREFIX(GenTexturesEXT) - .type GL_PREFIX(GenTexturesEXT), @function -GL_PREFIX(GenTexturesEXT): + .globl GL_PREFIX(_dispatch_stub_566) + .type GL_PREFIX(_dispatch_stub_566), @function + HIDDEN(GL_PREFIX(_dispatch_stub_566)) +GL_PREFIX(_dispatch_stub_566): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4504(%rax), %r11 + movq 4528(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -21243,13 +21317,13 @@ GL_PREFIX(GenTexturesEXT): popq %rbp popq %rsi popq %rdi - movq 4504(%rax), %r11 + movq 4528(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4504(%rax), %r11 + movq 4528(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -21259,48 +21333,57 @@ GL_PREFIX(GenTexturesEXT): popq %rbp popq %rsi popq %rdi - movq 4504(%rax), %r11 + movq 4528(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GenTexturesEXT), .-GL_PREFIX(GenTexturesEXT) + .size GL_PREFIX(_dispatch_stub_566), .-GL_PREFIX(_dispatch_stub_566) .p2align 4,,15 - .globl GL_PREFIX(IsTextureEXT) - .type GL_PREFIX(IsTextureEXT), @function -GL_PREFIX(IsTextureEXT): + .globl GL_PREFIX(_dispatch_stub_567) + .type GL_PREFIX(_dispatch_stub_567), @function + HIDDEN(GL_PREFIX(_dispatch_stub_567)) +GL_PREFIX(_dispatch_stub_567): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4512(%rax), %r11 + movq 4536(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi + pushq %rsi + pushq %rbp call _x86_64_get_dispatch@PLT + popq %rbp + popq %rsi popq %rdi - movq 4512(%rax), %r11 + movq 4536(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4512(%rax), %r11 + movq 4536(%rax), %r11 jmp *%r11 1: pushq %rdi + pushq %rsi + pushq %rbp call _glapi_get_dispatch + popq %rbp + popq %rsi popq %rdi - movq 4512(%rax), %r11 + movq 4536(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(IsTextureEXT), .-GL_PREFIX(IsTextureEXT) + .size GL_PREFIX(_dispatch_stub_567), .-GL_PREFIX(_dispatch_stub_567) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_565) - .type GL_PREFIX(_dispatch_stub_565), @function - HIDDEN(GL_PREFIX(_dispatch_stub_565)) -GL_PREFIX(_dispatch_stub_565): + .globl GL_PREFIX(_dispatch_stub_568) + .type GL_PREFIX(_dispatch_stub_568), @function + HIDDEN(GL_PREFIX(_dispatch_stub_568)) +GL_PREFIX(_dispatch_stub_568): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4520(%rax), %r11 + movq 4544(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -21310,13 +21393,13 @@ GL_PREFIX(_dispatch_stub_565): popq %rbp popq %rsi popq %rdi - movq 4520(%rax), %r11 + movq 4544(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4520(%rax), %r11 + movq 4544(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -21326,40 +21409,40 @@ GL_PREFIX(_dispatch_stub_565): popq %rbp popq %rsi popq %rdi - movq 4520(%rax), %r11 + movq 4544(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_565), .-GL_PREFIX(_dispatch_stub_565) + .size GL_PREFIX(_dispatch_stub_568), .-GL_PREFIX(_dispatch_stub_568) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_566) - .type GL_PREFIX(_dispatch_stub_566), @function - HIDDEN(GL_PREFIX(_dispatch_stub_566)) -GL_PREFIX(_dispatch_stub_566): + .globl GL_PREFIX(_dispatch_stub_569) + .type GL_PREFIX(_dispatch_stub_569), @function + HIDDEN(GL_PREFIX(_dispatch_stub_569)) +GL_PREFIX(_dispatch_stub_569): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4528(%rax), %r11 + movq 4552(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 4528(%rax), %r11 + movq 4552(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4528(%rax), %r11 + movq 4552(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 4528(%rax), %r11 + movq 4552(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_566), .-GL_PREFIX(_dispatch_stub_566) + .size GL_PREFIX(_dispatch_stub_569), .-GL_PREFIX(_dispatch_stub_569) .p2align 4,,15 .globl GL_PREFIX(ColorPointerEXT) @@ -21367,7 +21450,7 @@ GL_PREFIX(_dispatch_stub_566): GL_PREFIX(ColorPointerEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4536(%rax), %r11 + movq 4560(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -21381,13 +21464,13 @@ GL_PREFIX(ColorPointerEXT): popq %rdx popq %rsi popq %rdi - movq 4536(%rax), %r11 + movq 4560(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4536(%rax), %r11 + movq 4560(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -21401,7 +21484,7 @@ GL_PREFIX(ColorPointerEXT): popq %rdx popq %rsi popq %rdi - movq 4536(%rax), %r11 + movq 4560(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(ColorPointerEXT), .-GL_PREFIX(ColorPointerEXT) @@ -21412,7 +21495,7 @@ GL_PREFIX(ColorPointerEXT): GL_PREFIX(EdgeFlagPointerEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4544(%rax), %r11 + movq 4568(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -21422,13 +21505,13 @@ GL_PREFIX(EdgeFlagPointerEXT): popq %rdx popq %rsi popq %rdi - movq 4544(%rax), %r11 + movq 4568(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4544(%rax), %r11 + movq 4568(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -21438,7 +21521,7 @@ GL_PREFIX(EdgeFlagPointerEXT): popq %rdx popq %rsi popq %rdi - movq 4544(%rax), %r11 + movq 4568(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(EdgeFlagPointerEXT), .-GL_PREFIX(EdgeFlagPointerEXT) @@ -21449,7 +21532,7 @@ GL_PREFIX(EdgeFlagPointerEXT): GL_PREFIX(IndexPointerEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4552(%rax), %r11 + movq 4576(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -21463,13 +21546,13 @@ GL_PREFIX(IndexPointerEXT): popq %rdx popq %rsi popq %rdi - movq 4552(%rax), %r11 + movq 4576(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4552(%rax), %r11 + movq 4576(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -21483,7 +21566,7 @@ GL_PREFIX(IndexPointerEXT): popq %rdx popq %rsi popq %rdi - movq 4552(%rax), %r11 + movq 4576(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(IndexPointerEXT), .-GL_PREFIX(IndexPointerEXT) @@ -21494,7 +21577,7 @@ GL_PREFIX(IndexPointerEXT): GL_PREFIX(NormalPointerEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4560(%rax), %r11 + movq 4584(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -21508,13 +21591,13 @@ GL_PREFIX(NormalPointerEXT): popq %rdx popq %rsi popq %rdi - movq 4560(%rax), %r11 + movq 4584(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4560(%rax), %r11 + movq 4584(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -21528,7 +21611,7 @@ GL_PREFIX(NormalPointerEXT): popq %rdx popq %rsi popq %rdi - movq 4560(%rax), %r11 + movq 4584(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(NormalPointerEXT), .-GL_PREFIX(NormalPointerEXT) @@ -21539,7 +21622,7 @@ GL_PREFIX(NormalPointerEXT): GL_PREFIX(TexCoordPointerEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4568(%rax), %r11 + movq 4592(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -21553,13 +21636,13 @@ GL_PREFIX(TexCoordPointerEXT): popq %rdx popq %rsi popq %rdi - movq 4568(%rax), %r11 + movq 4592(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4568(%rax), %r11 + movq 4592(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -21573,7 +21656,7 @@ GL_PREFIX(TexCoordPointerEXT): popq %rdx popq %rsi popq %rdi - movq 4568(%rax), %r11 + movq 4592(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(TexCoordPointerEXT), .-GL_PREFIX(TexCoordPointerEXT) @@ -21584,7 +21667,7 @@ GL_PREFIX(TexCoordPointerEXT): GL_PREFIX(VertexPointerEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4576(%rax), %r11 + movq 4600(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -21598,13 +21681,13 @@ GL_PREFIX(VertexPointerEXT): popq %rdx popq %rsi popq %rdi - movq 4576(%rax), %r11 + movq 4600(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4576(%rax), %r11 + movq 4600(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -21618,7 +21701,7 @@ GL_PREFIX(VertexPointerEXT): popq %rdx popq %rsi popq %rdi - movq 4576(%rax), %r11 + movq 4600(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexPointerEXT), .-GL_PREFIX(VertexPointerEXT) @@ -21629,7 +21712,7 @@ GL_PREFIX(VertexPointerEXT): GL_PREFIX(PointParameterfEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4584(%rax), %r11 + movq 4608(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) subq $24, %rsp @@ -21639,13 +21722,13 @@ GL_PREFIX(PointParameterfEXT): movq 8(%rsp), %xmm0 movq (%rsp), %rdi addq $24, %rsp - movq 4584(%rax), %r11 + movq 4608(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4584(%rax), %r11 + movq 4608(%rax), %r11 jmp *%r11 1: subq $24, %rsp @@ -21655,7 +21738,7 @@ GL_PREFIX(PointParameterfEXT): movq 8(%rsp), %xmm0 movq (%rsp), %rdi addq $24, %rsp - movq 4584(%rax), %r11 + movq 4608(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(PointParameterfEXT), .-GL_PREFIX(PointParameterfEXT) @@ -21666,7 +21749,7 @@ GL_PREFIX(PointParameterfEXT): GL_PREFIX(PointParameterfvEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4592(%rax), %r11 + movq 4616(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -21676,13 +21759,13 @@ GL_PREFIX(PointParameterfvEXT): popq %rbp popq %rsi popq %rdi - movq 4592(%rax), %r11 + movq 4616(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4592(%rax), %r11 + movq 4616(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -21692,7 +21775,7 @@ GL_PREFIX(PointParameterfvEXT): popq %rbp popq %rsi popq %rdi - movq 4592(%rax), %r11 + movq 4616(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(PointParameterfvEXT), .-GL_PREFIX(PointParameterfvEXT) @@ -21703,7 +21786,7 @@ GL_PREFIX(PointParameterfvEXT): GL_PREFIX(LockArraysEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4600(%rax), %r11 + movq 4624(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -21713,13 +21796,13 @@ GL_PREFIX(LockArraysEXT): popq %rbp popq %rsi popq %rdi - movq 4600(%rax), %r11 + movq 4624(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4600(%rax), %r11 + movq 4624(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -21729,7 +21812,7 @@ GL_PREFIX(LockArraysEXT): popq %rbp popq %rsi popq %rdi - movq 4600(%rax), %r11 + movq 4624(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(LockArraysEXT), .-GL_PREFIX(LockArraysEXT) @@ -21740,37 +21823,37 @@ GL_PREFIX(LockArraysEXT): GL_PREFIX(UnlockArraysEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4608(%rax), %r11 + movq 4632(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rbp call _x86_64_get_dispatch@PLT popq %rbp - movq 4608(%rax), %r11 + movq 4632(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4608(%rax), %r11 + movq 4632(%rax), %r11 jmp *%r11 1: pushq %rbp call _glapi_get_dispatch popq %rbp - movq 4608(%rax), %r11 + movq 4632(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(UnlockArraysEXT), .-GL_PREFIX(UnlockArraysEXT) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_577) - .type GL_PREFIX(_dispatch_stub_577), @function - HIDDEN(GL_PREFIX(_dispatch_stub_577)) -GL_PREFIX(_dispatch_stub_577): + .globl GL_PREFIX(_dispatch_stub_580) + .type GL_PREFIX(_dispatch_stub_580), @function + HIDDEN(GL_PREFIX(_dispatch_stub_580)) +GL_PREFIX(_dispatch_stub_580): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4616(%rax), %r11 + movq 4640(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -21780,13 +21863,13 @@ GL_PREFIX(_dispatch_stub_577): popq %rbp popq %rsi popq %rdi - movq 4616(%rax), %r11 + movq 4640(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4616(%rax), %r11 + movq 4640(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -21796,19 +21879,19 @@ GL_PREFIX(_dispatch_stub_577): popq %rbp popq %rsi popq %rdi - movq 4616(%rax), %r11 + movq 4640(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_577), .-GL_PREFIX(_dispatch_stub_577) + .size GL_PREFIX(_dispatch_stub_580), .-GL_PREFIX(_dispatch_stub_580) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_578) - .type GL_PREFIX(_dispatch_stub_578), @function - HIDDEN(GL_PREFIX(_dispatch_stub_578)) -GL_PREFIX(_dispatch_stub_578): + .globl GL_PREFIX(_dispatch_stub_581) + .type GL_PREFIX(_dispatch_stub_581), @function + HIDDEN(GL_PREFIX(_dispatch_stub_581)) +GL_PREFIX(_dispatch_stub_581): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4624(%rax), %r11 + movq 4648(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -21818,13 +21901,13 @@ GL_PREFIX(_dispatch_stub_578): popq %rbp popq %rsi popq %rdi - movq 4624(%rax), %r11 + movq 4648(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4624(%rax), %r11 + movq 4648(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -21834,10 +21917,10 @@ GL_PREFIX(_dispatch_stub_578): popq %rbp popq %rsi popq %rdi - movq 4624(%rax), %r11 + movq 4648(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_578), .-GL_PREFIX(_dispatch_stub_578) + .size GL_PREFIX(_dispatch_stub_581), .-GL_PREFIX(_dispatch_stub_581) .p2align 4,,15 .globl GL_PREFIX(SecondaryColor3bEXT) @@ -21845,7 +21928,7 @@ GL_PREFIX(_dispatch_stub_578): GL_PREFIX(SecondaryColor3bEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4632(%rax), %r11 + movq 4656(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -21855,13 +21938,13 @@ GL_PREFIX(SecondaryColor3bEXT): popq %rdx popq %rsi popq %rdi - movq 4632(%rax), %r11 + movq 4656(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4632(%rax), %r11 + movq 4656(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -21871,7 +21954,7 @@ GL_PREFIX(SecondaryColor3bEXT): popq %rdx popq %rsi popq %rdi - movq 4632(%rax), %r11 + movq 4656(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(SecondaryColor3bEXT), .-GL_PREFIX(SecondaryColor3bEXT) @@ -21882,25 +21965,25 @@ GL_PREFIX(SecondaryColor3bEXT): GL_PREFIX(SecondaryColor3bvEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4640(%rax), %r11 + movq 4664(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 4640(%rax), %r11 + movq 4664(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4640(%rax), %r11 + movq 4664(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 4640(%rax), %r11 + movq 4664(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(SecondaryColor3bvEXT), .-GL_PREFIX(SecondaryColor3bvEXT) @@ -21911,7 +21994,7 @@ GL_PREFIX(SecondaryColor3bvEXT): GL_PREFIX(SecondaryColor3dEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4648(%rax), %r11 + movq 4672(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) subq $24, %rsp @@ -21923,13 +22006,13 @@ GL_PREFIX(SecondaryColor3dEXT): movq 8(%rsp), %xmm1 movq (%rsp), %xmm0 addq $24, %rsp - movq 4648(%rax), %r11 + movq 4672(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4648(%rax), %r11 + movq 4672(%rax), %r11 jmp *%r11 1: subq $24, %rsp @@ -21941,7 +22024,7 @@ GL_PREFIX(SecondaryColor3dEXT): movq 8(%rsp), %xmm1 movq (%rsp), %xmm0 addq $24, %rsp - movq 4648(%rax), %r11 + movq 4672(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(SecondaryColor3dEXT), .-GL_PREFIX(SecondaryColor3dEXT) @@ -21952,25 +22035,25 @@ GL_PREFIX(SecondaryColor3dEXT): GL_PREFIX(SecondaryColor3dvEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4656(%rax), %r11 + movq 4680(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 4656(%rax), %r11 + movq 4680(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4656(%rax), %r11 + movq 4680(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 4656(%rax), %r11 + movq 4680(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(SecondaryColor3dvEXT), .-GL_PREFIX(SecondaryColor3dvEXT) @@ -21981,7 +22064,7 @@ GL_PREFIX(SecondaryColor3dvEXT): GL_PREFIX(SecondaryColor3fEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4664(%rax), %r11 + movq 4688(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) subq $24, %rsp @@ -21993,13 +22076,13 @@ GL_PREFIX(SecondaryColor3fEXT): movq 8(%rsp), %xmm1 movq (%rsp), %xmm0 addq $24, %rsp - movq 4664(%rax), %r11 + movq 4688(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4664(%rax), %r11 + movq 4688(%rax), %r11 jmp *%r11 1: subq $24, %rsp @@ -22011,7 +22094,7 @@ GL_PREFIX(SecondaryColor3fEXT): movq 8(%rsp), %xmm1 movq (%rsp), %xmm0 addq $24, %rsp - movq 4664(%rax), %r11 + movq 4688(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(SecondaryColor3fEXT), .-GL_PREFIX(SecondaryColor3fEXT) @@ -22022,25 +22105,25 @@ GL_PREFIX(SecondaryColor3fEXT): GL_PREFIX(SecondaryColor3fvEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4672(%rax), %r11 + movq 4696(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 4672(%rax), %r11 + movq 4696(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4672(%rax), %r11 + movq 4696(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 4672(%rax), %r11 + movq 4696(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(SecondaryColor3fvEXT), .-GL_PREFIX(SecondaryColor3fvEXT) @@ -22051,7 +22134,7 @@ GL_PREFIX(SecondaryColor3fvEXT): GL_PREFIX(SecondaryColor3iEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4680(%rax), %r11 + movq 4704(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -22061,13 +22144,13 @@ GL_PREFIX(SecondaryColor3iEXT): popq %rdx popq %rsi popq %rdi - movq 4680(%rax), %r11 + movq 4704(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4680(%rax), %r11 + movq 4704(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -22077,7 +22160,7 @@ GL_PREFIX(SecondaryColor3iEXT): popq %rdx popq %rsi popq %rdi - movq 4680(%rax), %r11 + movq 4704(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(SecondaryColor3iEXT), .-GL_PREFIX(SecondaryColor3iEXT) @@ -22088,25 +22171,25 @@ GL_PREFIX(SecondaryColor3iEXT): GL_PREFIX(SecondaryColor3ivEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4688(%rax), %r11 + movq 4712(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 4688(%rax), %r11 + movq 4712(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4688(%rax), %r11 + movq 4712(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 4688(%rax), %r11 + movq 4712(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(SecondaryColor3ivEXT), .-GL_PREFIX(SecondaryColor3ivEXT) @@ -22117,7 +22200,7 @@ GL_PREFIX(SecondaryColor3ivEXT): GL_PREFIX(SecondaryColor3sEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4696(%rax), %r11 + movq 4720(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -22127,13 +22210,13 @@ GL_PREFIX(SecondaryColor3sEXT): popq %rdx popq %rsi popq %rdi - movq 4696(%rax), %r11 + movq 4720(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4696(%rax), %r11 + movq 4720(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -22143,7 +22226,7 @@ GL_PREFIX(SecondaryColor3sEXT): popq %rdx popq %rsi popq %rdi - movq 4696(%rax), %r11 + movq 4720(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(SecondaryColor3sEXT), .-GL_PREFIX(SecondaryColor3sEXT) @@ -22154,25 +22237,25 @@ GL_PREFIX(SecondaryColor3sEXT): GL_PREFIX(SecondaryColor3svEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4704(%rax), %r11 + movq 4728(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 4704(%rax), %r11 + movq 4728(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4704(%rax), %r11 + movq 4728(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 4704(%rax), %r11 + movq 4728(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(SecondaryColor3svEXT), .-GL_PREFIX(SecondaryColor3svEXT) @@ -22183,7 +22266,7 @@ GL_PREFIX(SecondaryColor3svEXT): GL_PREFIX(SecondaryColor3ubEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4712(%rax), %r11 + movq 4736(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -22193,13 +22276,13 @@ GL_PREFIX(SecondaryColor3ubEXT): popq %rdx popq %rsi popq %rdi - movq 4712(%rax), %r11 + movq 4736(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4712(%rax), %r11 + movq 4736(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -22209,7 +22292,7 @@ GL_PREFIX(SecondaryColor3ubEXT): popq %rdx popq %rsi popq %rdi - movq 4712(%rax), %r11 + movq 4736(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(SecondaryColor3ubEXT), .-GL_PREFIX(SecondaryColor3ubEXT) @@ -22220,25 +22303,25 @@ GL_PREFIX(SecondaryColor3ubEXT): GL_PREFIX(SecondaryColor3ubvEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4720(%rax), %r11 + movq 4744(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 4720(%rax), %r11 + movq 4744(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4720(%rax), %r11 + movq 4744(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 4720(%rax), %r11 + movq 4744(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(SecondaryColor3ubvEXT), .-GL_PREFIX(SecondaryColor3ubvEXT) @@ -22249,7 +22332,7 @@ GL_PREFIX(SecondaryColor3ubvEXT): GL_PREFIX(SecondaryColor3uiEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4728(%rax), %r11 + movq 4752(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -22259,13 +22342,13 @@ GL_PREFIX(SecondaryColor3uiEXT): popq %rdx popq %rsi popq %rdi - movq 4728(%rax), %r11 + movq 4752(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4728(%rax), %r11 + movq 4752(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -22275,7 +22358,7 @@ GL_PREFIX(SecondaryColor3uiEXT): popq %rdx popq %rsi popq %rdi - movq 4728(%rax), %r11 + movq 4752(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(SecondaryColor3uiEXT), .-GL_PREFIX(SecondaryColor3uiEXT) @@ -22286,25 +22369,25 @@ GL_PREFIX(SecondaryColor3uiEXT): GL_PREFIX(SecondaryColor3uivEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4736(%rax), %r11 + movq 4760(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 4736(%rax), %r11 + movq 4760(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4736(%rax), %r11 + movq 4760(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 4736(%rax), %r11 + movq 4760(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(SecondaryColor3uivEXT), .-GL_PREFIX(SecondaryColor3uivEXT) @@ -22315,7 +22398,7 @@ GL_PREFIX(SecondaryColor3uivEXT): GL_PREFIX(SecondaryColor3usEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4744(%rax), %r11 + movq 4768(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -22325,13 +22408,13 @@ GL_PREFIX(SecondaryColor3usEXT): popq %rdx popq %rsi popq %rdi - movq 4744(%rax), %r11 + movq 4768(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4744(%rax), %r11 + movq 4768(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -22341,7 +22424,7 @@ GL_PREFIX(SecondaryColor3usEXT): popq %rdx popq %rsi popq %rdi - movq 4744(%rax), %r11 + movq 4768(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(SecondaryColor3usEXT), .-GL_PREFIX(SecondaryColor3usEXT) @@ -22352,25 +22435,25 @@ GL_PREFIX(SecondaryColor3usEXT): GL_PREFIX(SecondaryColor3usvEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4752(%rax), %r11 + movq 4776(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 4752(%rax), %r11 + movq 4776(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4752(%rax), %r11 + movq 4776(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 4752(%rax), %r11 + movq 4776(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(SecondaryColor3usvEXT), .-GL_PREFIX(SecondaryColor3usvEXT) @@ -22381,7 +22464,7 @@ GL_PREFIX(SecondaryColor3usvEXT): GL_PREFIX(SecondaryColorPointerEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4760(%rax), %r11 + movq 4784(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -22395,13 +22478,13 @@ GL_PREFIX(SecondaryColorPointerEXT): popq %rdx popq %rsi popq %rdi - movq 4760(%rax), %r11 + movq 4784(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4760(%rax), %r11 + movq 4784(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -22415,7 +22498,7 @@ GL_PREFIX(SecondaryColorPointerEXT): popq %rdx popq %rsi popq %rdi - movq 4760(%rax), %r11 + movq 4784(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(SecondaryColorPointerEXT), .-GL_PREFIX(SecondaryColorPointerEXT) @@ -22426,7 +22509,7 @@ GL_PREFIX(SecondaryColorPointerEXT): GL_PREFIX(MultiDrawArraysEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4768(%rax), %r11 + movq 4792(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -22440,13 +22523,13 @@ GL_PREFIX(MultiDrawArraysEXT): popq %rdx popq %rsi popq %rdi - movq 4768(%rax), %r11 + movq 4792(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4768(%rax), %r11 + movq 4792(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -22460,7 +22543,7 @@ GL_PREFIX(MultiDrawArraysEXT): popq %rdx popq %rsi popq %rdi - movq 4768(%rax), %r11 + movq 4792(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(MultiDrawArraysEXT), .-GL_PREFIX(MultiDrawArraysEXT) @@ -22471,7 +22554,7 @@ GL_PREFIX(MultiDrawArraysEXT): GL_PREFIX(MultiDrawElementsEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4776(%rax), %r11 + movq 4800(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -22485,13 +22568,13 @@ GL_PREFIX(MultiDrawElementsEXT): popq %rdx popq %rsi popq %rdi - movq 4776(%rax), %r11 + movq 4800(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4776(%rax), %r11 + movq 4800(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -22505,7 +22588,7 @@ GL_PREFIX(MultiDrawElementsEXT): popq %rdx popq %rsi popq %rdi - movq 4776(%rax), %r11 + movq 4800(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(MultiDrawElementsEXT), .-GL_PREFIX(MultiDrawElementsEXT) @@ -22516,7 +22599,7 @@ GL_PREFIX(MultiDrawElementsEXT): GL_PREFIX(FogCoordPointerEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4784(%rax), %r11 + movq 4808(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -22526,13 +22609,13 @@ GL_PREFIX(FogCoordPointerEXT): popq %rdx popq %rsi popq %rdi - movq 4784(%rax), %r11 + movq 4808(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4784(%rax), %r11 + movq 4808(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -22542,7 +22625,7 @@ GL_PREFIX(FogCoordPointerEXT): popq %rdx popq %rsi popq %rdi - movq 4784(%rax), %r11 + movq 4808(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(FogCoordPointerEXT), .-GL_PREFIX(FogCoordPointerEXT) @@ -22553,7 +22636,7 @@ GL_PREFIX(FogCoordPointerEXT): GL_PREFIX(FogCoorddEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4792(%rax), %r11 + movq 4816(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) subq $8, %rsp @@ -22561,13 +22644,13 @@ GL_PREFIX(FogCoorddEXT): call _x86_64_get_dispatch@PLT movq (%rsp), %xmm0 addq $8, %rsp - movq 4792(%rax), %r11 + movq 4816(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4792(%rax), %r11 + movq 4816(%rax), %r11 jmp *%r11 1: subq $8, %rsp @@ -22575,7 +22658,7 @@ GL_PREFIX(FogCoorddEXT): call _glapi_get_dispatch movq (%rsp), %xmm0 addq $8, %rsp - movq 4792(%rax), %r11 + movq 4816(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(FogCoorddEXT), .-GL_PREFIX(FogCoorddEXT) @@ -22586,25 +22669,25 @@ GL_PREFIX(FogCoorddEXT): GL_PREFIX(FogCoorddvEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4800(%rax), %r11 + movq 4824(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 4800(%rax), %r11 + movq 4824(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4800(%rax), %r11 + movq 4824(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 4800(%rax), %r11 + movq 4824(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(FogCoorddvEXT), .-GL_PREFIX(FogCoorddvEXT) @@ -22615,7 +22698,7 @@ GL_PREFIX(FogCoorddvEXT): GL_PREFIX(FogCoordfEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4808(%rax), %r11 + movq 4832(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) subq $8, %rsp @@ -22623,13 +22706,13 @@ GL_PREFIX(FogCoordfEXT): call _x86_64_get_dispatch@PLT movq (%rsp), %xmm0 addq $8, %rsp - movq 4808(%rax), %r11 + movq 4832(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4808(%rax), %r11 + movq 4832(%rax), %r11 jmp *%r11 1: subq $8, %rsp @@ -22637,7 +22720,7 @@ GL_PREFIX(FogCoordfEXT): call _glapi_get_dispatch movq (%rsp), %xmm0 addq $8, %rsp - movq 4808(%rax), %r11 + movq 4832(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(FogCoordfEXT), .-GL_PREFIX(FogCoordfEXT) @@ -22648,58 +22731,58 @@ GL_PREFIX(FogCoordfEXT): GL_PREFIX(FogCoordfvEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4816(%rax), %r11 + movq 4840(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 4816(%rax), %r11 + movq 4840(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4816(%rax), %r11 + movq 4840(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 4816(%rax), %r11 + movq 4840(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(FogCoordfvEXT), .-GL_PREFIX(FogCoordfvEXT) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_603) - .type GL_PREFIX(_dispatch_stub_603), @function - HIDDEN(GL_PREFIX(_dispatch_stub_603)) -GL_PREFIX(_dispatch_stub_603): + .globl GL_PREFIX(_dispatch_stub_606) + .type GL_PREFIX(_dispatch_stub_606), @function + HIDDEN(GL_PREFIX(_dispatch_stub_606)) +GL_PREFIX(_dispatch_stub_606): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4824(%rax), %r11 + movq 4848(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 4824(%rax), %r11 + movq 4848(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4824(%rax), %r11 + movq 4848(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 4824(%rax), %r11 + movq 4848(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_603), .-GL_PREFIX(_dispatch_stub_603) + .size GL_PREFIX(_dispatch_stub_606), .-GL_PREFIX(_dispatch_stub_606) .p2align 4,,15 .globl GL_PREFIX(BlendFuncSeparateEXT) @@ -22707,7 +22790,7 @@ GL_PREFIX(_dispatch_stub_603): GL_PREFIX(BlendFuncSeparateEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4832(%rax), %r11 + movq 4856(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -22721,13 +22804,13 @@ GL_PREFIX(BlendFuncSeparateEXT): popq %rdx popq %rsi popq %rdi - movq 4832(%rax), %r11 + movq 4856(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4832(%rax), %r11 + movq 4856(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -22741,7 +22824,7 @@ GL_PREFIX(BlendFuncSeparateEXT): popq %rdx popq %rsi popq %rdi - movq 4832(%rax), %r11 + movq 4856(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(BlendFuncSeparateEXT), .-GL_PREFIX(BlendFuncSeparateEXT) @@ -22752,25 +22835,25 @@ GL_PREFIX(BlendFuncSeparateEXT): GL_PREFIX(FlushVertexArrayRangeNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4840(%rax), %r11 + movq 4864(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rbp call _x86_64_get_dispatch@PLT popq %rbp - movq 4840(%rax), %r11 + movq 4864(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4840(%rax), %r11 + movq 4864(%rax), %r11 jmp *%r11 1: pushq %rbp call _glapi_get_dispatch popq %rbp - movq 4840(%rax), %r11 + movq 4864(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(FlushVertexArrayRangeNV), .-GL_PREFIX(FlushVertexArrayRangeNV) @@ -22781,7 +22864,7 @@ GL_PREFIX(FlushVertexArrayRangeNV): GL_PREFIX(VertexArrayRangeNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4848(%rax), %r11 + movq 4872(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -22791,13 +22874,13 @@ GL_PREFIX(VertexArrayRangeNV): popq %rbp popq %rsi popq %rdi - movq 4848(%rax), %r11 + movq 4872(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4848(%rax), %r11 + movq 4872(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -22807,7 +22890,7 @@ GL_PREFIX(VertexArrayRangeNV): popq %rbp popq %rsi popq %rdi - movq 4848(%rax), %r11 + movq 4872(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexArrayRangeNV), .-GL_PREFIX(VertexArrayRangeNV) @@ -22818,7 +22901,7 @@ GL_PREFIX(VertexArrayRangeNV): GL_PREFIX(CombinerInputNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4856(%rax), %r11 + movq 4880(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -22836,13 +22919,13 @@ GL_PREFIX(CombinerInputNV): popq %rdx popq %rsi popq %rdi - movq 4856(%rax), %r11 + movq 4880(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4856(%rax), %r11 + movq 4880(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -22860,7 +22943,7 @@ GL_PREFIX(CombinerInputNV): popq %rdx popq %rsi popq %rdi - movq 4856(%rax), %r11 + movq 4880(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(CombinerInputNV), .-GL_PREFIX(CombinerInputNV) @@ -22871,7 +22954,7 @@ GL_PREFIX(CombinerInputNV): GL_PREFIX(CombinerOutputNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4864(%rax), %r11 + movq 4888(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -22889,13 +22972,13 @@ GL_PREFIX(CombinerOutputNV): popq %rdx popq %rsi popq %rdi - movq 4864(%rax), %r11 + movq 4888(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4864(%rax), %r11 + movq 4888(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -22913,7 +22996,7 @@ GL_PREFIX(CombinerOutputNV): popq %rdx popq %rsi popq %rdi - movq 4864(%rax), %r11 + movq 4888(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(CombinerOutputNV), .-GL_PREFIX(CombinerOutputNV) @@ -22924,7 +23007,7 @@ GL_PREFIX(CombinerOutputNV): GL_PREFIX(CombinerParameterfNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4872(%rax), %r11 + movq 4896(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) subq $24, %rsp @@ -22934,13 +23017,13 @@ GL_PREFIX(CombinerParameterfNV): movq 8(%rsp), %xmm0 movq (%rsp), %rdi addq $24, %rsp - movq 4872(%rax), %r11 + movq 4896(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4872(%rax), %r11 + movq 4896(%rax), %r11 jmp *%r11 1: subq $24, %rsp @@ -22950,7 +23033,7 @@ GL_PREFIX(CombinerParameterfNV): movq 8(%rsp), %xmm0 movq (%rsp), %rdi addq $24, %rsp - movq 4872(%rax), %r11 + movq 4896(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(CombinerParameterfNV), .-GL_PREFIX(CombinerParameterfNV) @@ -22961,7 +23044,7 @@ GL_PREFIX(CombinerParameterfNV): GL_PREFIX(CombinerParameterfvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4880(%rax), %r11 + movq 4904(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -22971,13 +23054,13 @@ GL_PREFIX(CombinerParameterfvNV): popq %rbp popq %rsi popq %rdi - movq 4880(%rax), %r11 + movq 4904(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4880(%rax), %r11 + movq 4904(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -22987,7 +23070,7 @@ GL_PREFIX(CombinerParameterfvNV): popq %rbp popq %rsi popq %rdi - movq 4880(%rax), %r11 + movq 4904(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(CombinerParameterfvNV), .-GL_PREFIX(CombinerParameterfvNV) @@ -22998,7 +23081,7 @@ GL_PREFIX(CombinerParameterfvNV): GL_PREFIX(CombinerParameteriNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4888(%rax), %r11 + movq 4912(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -23008,13 +23091,13 @@ GL_PREFIX(CombinerParameteriNV): popq %rbp popq %rsi popq %rdi - movq 4888(%rax), %r11 + movq 4912(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4888(%rax), %r11 + movq 4912(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -23024,7 +23107,7 @@ GL_PREFIX(CombinerParameteriNV): popq %rbp popq %rsi popq %rdi - movq 4888(%rax), %r11 + movq 4912(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(CombinerParameteriNV), .-GL_PREFIX(CombinerParameteriNV) @@ -23035,7 +23118,7 @@ GL_PREFIX(CombinerParameteriNV): GL_PREFIX(CombinerParameterivNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4896(%rax), %r11 + movq 4920(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -23045,13 +23128,13 @@ GL_PREFIX(CombinerParameterivNV): popq %rbp popq %rsi popq %rdi - movq 4896(%rax), %r11 + movq 4920(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4896(%rax), %r11 + movq 4920(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -23061,7 +23144,7 @@ GL_PREFIX(CombinerParameterivNV): popq %rbp popq %rsi popq %rdi - movq 4896(%rax), %r11 + movq 4920(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(CombinerParameterivNV), .-GL_PREFIX(CombinerParameterivNV) @@ -23072,7 +23155,7 @@ GL_PREFIX(CombinerParameterivNV): GL_PREFIX(FinalCombinerInputNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4904(%rax), %r11 + movq 4928(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -23086,13 +23169,13 @@ GL_PREFIX(FinalCombinerInputNV): popq %rdx popq %rsi popq %rdi - movq 4904(%rax), %r11 + movq 4928(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4904(%rax), %r11 + movq 4928(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -23106,7 +23189,7 @@ GL_PREFIX(FinalCombinerInputNV): popq %rdx popq %rsi popq %rdi - movq 4904(%rax), %r11 + movq 4928(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(FinalCombinerInputNV), .-GL_PREFIX(FinalCombinerInputNV) @@ -23117,7 +23200,7 @@ GL_PREFIX(FinalCombinerInputNV): GL_PREFIX(GetCombinerInputParameterfvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4912(%rax), %r11 + movq 4936(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -23131,13 +23214,13 @@ GL_PREFIX(GetCombinerInputParameterfvNV): popq %rdx popq %rsi popq %rdi - movq 4912(%rax), %r11 + movq 4936(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4912(%rax), %r11 + movq 4936(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -23151,7 +23234,7 @@ GL_PREFIX(GetCombinerInputParameterfvNV): popq %rdx popq %rsi popq %rdi - movq 4912(%rax), %r11 + movq 4936(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GetCombinerInputParameterfvNV), .-GL_PREFIX(GetCombinerInputParameterfvNV) @@ -23162,7 +23245,7 @@ GL_PREFIX(GetCombinerInputParameterfvNV): GL_PREFIX(GetCombinerInputParameterivNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4920(%rax), %r11 + movq 4944(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -23176,13 +23259,13 @@ GL_PREFIX(GetCombinerInputParameterivNV): popq %rdx popq %rsi popq %rdi - movq 4920(%rax), %r11 + movq 4944(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4920(%rax), %r11 + movq 4944(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -23196,7 +23279,7 @@ GL_PREFIX(GetCombinerInputParameterivNV): popq %rdx popq %rsi popq %rdi - movq 4920(%rax), %r11 + movq 4944(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GetCombinerInputParameterivNV), .-GL_PREFIX(GetCombinerInputParameterivNV) @@ -23207,7 +23290,7 @@ GL_PREFIX(GetCombinerInputParameterivNV): GL_PREFIX(GetCombinerOutputParameterfvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4928(%rax), %r11 + movq 4952(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -23221,13 +23304,13 @@ GL_PREFIX(GetCombinerOutputParameterfvNV): popq %rdx popq %rsi popq %rdi - movq 4928(%rax), %r11 + movq 4952(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4928(%rax), %r11 + movq 4952(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -23241,7 +23324,7 @@ GL_PREFIX(GetCombinerOutputParameterfvNV): popq %rdx popq %rsi popq %rdi - movq 4928(%rax), %r11 + movq 4952(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GetCombinerOutputParameterfvNV), .-GL_PREFIX(GetCombinerOutputParameterfvNV) @@ -23252,7 +23335,7 @@ GL_PREFIX(GetCombinerOutputParameterfvNV): GL_PREFIX(GetCombinerOutputParameterivNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4936(%rax), %r11 + movq 4960(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -23266,13 +23349,13 @@ GL_PREFIX(GetCombinerOutputParameterivNV): popq %rdx popq %rsi popq %rdi - movq 4936(%rax), %r11 + movq 4960(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4936(%rax), %r11 + movq 4960(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -23286,7 +23369,7 @@ GL_PREFIX(GetCombinerOutputParameterivNV): popq %rdx popq %rsi popq %rdi - movq 4936(%rax), %r11 + movq 4960(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GetCombinerOutputParameterivNV), .-GL_PREFIX(GetCombinerOutputParameterivNV) @@ -23297,7 +23380,7 @@ GL_PREFIX(GetCombinerOutputParameterivNV): GL_PREFIX(GetFinalCombinerInputParameterfvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4944(%rax), %r11 + movq 4968(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -23307,13 +23390,13 @@ GL_PREFIX(GetFinalCombinerInputParameterfvNV): popq %rdx popq %rsi popq %rdi - movq 4944(%rax), %r11 + movq 4968(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4944(%rax), %r11 + movq 4968(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -23323,7 +23406,7 @@ GL_PREFIX(GetFinalCombinerInputParameterfvNV): popq %rdx popq %rsi popq %rdi - movq 4944(%rax), %r11 + movq 4968(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GetFinalCombinerInputParameterfvNV), .-GL_PREFIX(GetFinalCombinerInputParameterfvNV) @@ -23334,7 +23417,7 @@ GL_PREFIX(GetFinalCombinerInputParameterfvNV): GL_PREFIX(GetFinalCombinerInputParameterivNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4952(%rax), %r11 + movq 4976(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -23344,13 +23427,13 @@ GL_PREFIX(GetFinalCombinerInputParameterivNV): popq %rdx popq %rsi popq %rdi - movq 4952(%rax), %r11 + movq 4976(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4952(%rax), %r11 + movq 4976(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -23360,7 +23443,7 @@ GL_PREFIX(GetFinalCombinerInputParameterivNV): popq %rdx popq %rsi popq %rdi - movq 4952(%rax), %r11 + movq 4976(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GetFinalCombinerInputParameterivNV), .-GL_PREFIX(GetFinalCombinerInputParameterivNV) @@ -23371,25 +23454,25 @@ GL_PREFIX(GetFinalCombinerInputParameterivNV): GL_PREFIX(ResizeBuffersMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4960(%rax), %r11 + movq 4984(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rbp call _x86_64_get_dispatch@PLT popq %rbp - movq 4960(%rax), %r11 + movq 4984(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4960(%rax), %r11 + movq 4984(%rax), %r11 jmp *%r11 1: pushq %rbp call _glapi_get_dispatch popq %rbp - movq 4960(%rax), %r11 + movq 4984(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(ResizeBuffersMESA), .-GL_PREFIX(ResizeBuffersMESA) @@ -23400,7 +23483,7 @@ GL_PREFIX(ResizeBuffersMESA): GL_PREFIX(WindowPos2dMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4968(%rax), %r11 + movq 4992(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) subq $24, %rsp @@ -23410,13 +23493,13 @@ GL_PREFIX(WindowPos2dMESA): movq 8(%rsp), %xmm1 movq (%rsp), %xmm0 addq $24, %rsp - movq 4968(%rax), %r11 + movq 4992(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4968(%rax), %r11 + movq 4992(%rax), %r11 jmp *%r11 1: subq $24, %rsp @@ -23426,7 +23509,7 @@ GL_PREFIX(WindowPos2dMESA): movq 8(%rsp), %xmm1 movq (%rsp), %xmm0 addq $24, %rsp - movq 4968(%rax), %r11 + movq 4992(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(WindowPos2dMESA), .-GL_PREFIX(WindowPos2dMESA) @@ -23437,25 +23520,25 @@ GL_PREFIX(WindowPos2dMESA): GL_PREFIX(WindowPos2dvMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4976(%rax), %r11 + movq 5000(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 4976(%rax), %r11 + movq 5000(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4976(%rax), %r11 + movq 5000(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 4976(%rax), %r11 + movq 5000(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(WindowPos2dvMESA), .-GL_PREFIX(WindowPos2dvMESA) @@ -23466,7 +23549,7 @@ GL_PREFIX(WindowPos2dvMESA): GL_PREFIX(WindowPos2fMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4984(%rax), %r11 + movq 5008(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) subq $24, %rsp @@ -23476,13 +23559,13 @@ GL_PREFIX(WindowPos2fMESA): movq 8(%rsp), %xmm1 movq (%rsp), %xmm0 addq $24, %rsp - movq 4984(%rax), %r11 + movq 5008(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4984(%rax), %r11 + movq 5008(%rax), %r11 jmp *%r11 1: subq $24, %rsp @@ -23492,7 +23575,7 @@ GL_PREFIX(WindowPos2fMESA): movq 8(%rsp), %xmm1 movq (%rsp), %xmm0 addq $24, %rsp - movq 4984(%rax), %r11 + movq 5008(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(WindowPos2fMESA), .-GL_PREFIX(WindowPos2fMESA) @@ -23503,25 +23586,25 @@ GL_PREFIX(WindowPos2fMESA): GL_PREFIX(WindowPos2fvMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4992(%rax), %r11 + movq 5016(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 4992(%rax), %r11 + movq 5016(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4992(%rax), %r11 + movq 5016(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 4992(%rax), %r11 + movq 5016(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(WindowPos2fvMESA), .-GL_PREFIX(WindowPos2fvMESA) @@ -23532,7 +23615,7 @@ GL_PREFIX(WindowPos2fvMESA): GL_PREFIX(WindowPos2iMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5000(%rax), %r11 + movq 5024(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -23542,13 +23625,13 @@ GL_PREFIX(WindowPos2iMESA): popq %rbp popq %rsi popq %rdi - movq 5000(%rax), %r11 + movq 5024(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5000(%rax), %r11 + movq 5024(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -23558,7 +23641,7 @@ GL_PREFIX(WindowPos2iMESA): popq %rbp popq %rsi popq %rdi - movq 5000(%rax), %r11 + movq 5024(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(WindowPos2iMESA), .-GL_PREFIX(WindowPos2iMESA) @@ -23569,25 +23652,25 @@ GL_PREFIX(WindowPos2iMESA): GL_PREFIX(WindowPos2ivMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5008(%rax), %r11 + movq 5032(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 5008(%rax), %r11 + movq 5032(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5008(%rax), %r11 + movq 5032(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 5008(%rax), %r11 + movq 5032(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(WindowPos2ivMESA), .-GL_PREFIX(WindowPos2ivMESA) @@ -23598,7 +23681,7 @@ GL_PREFIX(WindowPos2ivMESA): GL_PREFIX(WindowPos2sMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5016(%rax), %r11 + movq 5040(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -23608,13 +23691,13 @@ GL_PREFIX(WindowPos2sMESA): popq %rbp popq %rsi popq %rdi - movq 5016(%rax), %r11 + movq 5040(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5016(%rax), %r11 + movq 5040(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -23624,7 +23707,7 @@ GL_PREFIX(WindowPos2sMESA): popq %rbp popq %rsi popq %rdi - movq 5016(%rax), %r11 + movq 5040(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(WindowPos2sMESA), .-GL_PREFIX(WindowPos2sMESA) @@ -23635,25 +23718,25 @@ GL_PREFIX(WindowPos2sMESA): GL_PREFIX(WindowPos2svMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5024(%rax), %r11 + movq 5048(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 5024(%rax), %r11 + movq 5048(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5024(%rax), %r11 + movq 5048(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 5024(%rax), %r11 + movq 5048(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(WindowPos2svMESA), .-GL_PREFIX(WindowPos2svMESA) @@ -23664,7 +23747,7 @@ GL_PREFIX(WindowPos2svMESA): GL_PREFIX(WindowPos3dMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5032(%rax), %r11 + movq 5056(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) subq $24, %rsp @@ -23676,13 +23759,13 @@ GL_PREFIX(WindowPos3dMESA): movq 8(%rsp), %xmm1 movq (%rsp), %xmm0 addq $24, %rsp - movq 5032(%rax), %r11 + movq 5056(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5032(%rax), %r11 + movq 5056(%rax), %r11 jmp *%r11 1: subq $24, %rsp @@ -23694,7 +23777,7 @@ GL_PREFIX(WindowPos3dMESA): movq 8(%rsp), %xmm1 movq (%rsp), %xmm0 addq $24, %rsp - movq 5032(%rax), %r11 + movq 5056(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(WindowPos3dMESA), .-GL_PREFIX(WindowPos3dMESA) @@ -23705,25 +23788,25 @@ GL_PREFIX(WindowPos3dMESA): GL_PREFIX(WindowPos3dvMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5040(%rax), %r11 + movq 5064(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 5040(%rax), %r11 + movq 5064(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5040(%rax), %r11 + movq 5064(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 5040(%rax), %r11 + movq 5064(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(WindowPos3dvMESA), .-GL_PREFIX(WindowPos3dvMESA) @@ -23734,7 +23817,7 @@ GL_PREFIX(WindowPos3dvMESA): GL_PREFIX(WindowPos3fMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5048(%rax), %r11 + movq 5072(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) subq $24, %rsp @@ -23746,13 +23829,13 @@ GL_PREFIX(WindowPos3fMESA): movq 8(%rsp), %xmm1 movq (%rsp), %xmm0 addq $24, %rsp - movq 5048(%rax), %r11 + movq 5072(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5048(%rax), %r11 + movq 5072(%rax), %r11 jmp *%r11 1: subq $24, %rsp @@ -23764,7 +23847,7 @@ GL_PREFIX(WindowPos3fMESA): movq 8(%rsp), %xmm1 movq (%rsp), %xmm0 addq $24, %rsp - movq 5048(%rax), %r11 + movq 5072(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(WindowPos3fMESA), .-GL_PREFIX(WindowPos3fMESA) @@ -23775,25 +23858,25 @@ GL_PREFIX(WindowPos3fMESA): GL_PREFIX(WindowPos3fvMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5056(%rax), %r11 + movq 5080(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 5056(%rax), %r11 + movq 5080(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5056(%rax), %r11 + movq 5080(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 5056(%rax), %r11 + movq 5080(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(WindowPos3fvMESA), .-GL_PREFIX(WindowPos3fvMESA) @@ -23804,7 +23887,7 @@ GL_PREFIX(WindowPos3fvMESA): GL_PREFIX(WindowPos3iMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5064(%rax), %r11 + movq 5088(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -23814,13 +23897,13 @@ GL_PREFIX(WindowPos3iMESA): popq %rdx popq %rsi popq %rdi - movq 5064(%rax), %r11 + movq 5088(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5064(%rax), %r11 + movq 5088(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -23830,7 +23913,7 @@ GL_PREFIX(WindowPos3iMESA): popq %rdx popq %rsi popq %rdi - movq 5064(%rax), %r11 + movq 5088(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(WindowPos3iMESA), .-GL_PREFIX(WindowPos3iMESA) @@ -23841,25 +23924,25 @@ GL_PREFIX(WindowPos3iMESA): GL_PREFIX(WindowPos3ivMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5072(%rax), %r11 + movq 5096(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 5072(%rax), %r11 + movq 5096(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5072(%rax), %r11 + movq 5096(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 5072(%rax), %r11 + movq 5096(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(WindowPos3ivMESA), .-GL_PREFIX(WindowPos3ivMESA) @@ -23870,7 +23953,7 @@ GL_PREFIX(WindowPos3ivMESA): GL_PREFIX(WindowPos3sMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5080(%rax), %r11 + movq 5104(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -23880,13 +23963,13 @@ GL_PREFIX(WindowPos3sMESA): popq %rdx popq %rsi popq %rdi - movq 5080(%rax), %r11 + movq 5104(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5080(%rax), %r11 + movq 5104(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -23896,7 +23979,7 @@ GL_PREFIX(WindowPos3sMESA): popq %rdx popq %rsi popq %rdi - movq 5080(%rax), %r11 + movq 5104(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(WindowPos3sMESA), .-GL_PREFIX(WindowPos3sMESA) @@ -23907,25 +23990,25 @@ GL_PREFIX(WindowPos3sMESA): GL_PREFIX(WindowPos3svMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5088(%rax), %r11 + movq 5112(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 5088(%rax), %r11 + movq 5112(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5088(%rax), %r11 + movq 5112(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 5088(%rax), %r11 + movq 5112(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(WindowPos3svMESA), .-GL_PREFIX(WindowPos3svMESA) @@ -23936,7 +24019,7 @@ GL_PREFIX(WindowPos3svMESA): GL_PREFIX(WindowPos4dMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5096(%rax), %r11 + movq 5120(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) subq $40, %rsp @@ -23950,13 +24033,13 @@ GL_PREFIX(WindowPos4dMESA): movq 8(%rsp), %xmm1 movq (%rsp), %xmm0 addq $40, %rsp - movq 5096(%rax), %r11 + movq 5120(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5096(%rax), %r11 + movq 5120(%rax), %r11 jmp *%r11 1: subq $40, %rsp @@ -23970,7 +24053,7 @@ GL_PREFIX(WindowPos4dMESA): movq 8(%rsp), %xmm1 movq (%rsp), %xmm0 addq $40, %rsp - movq 5096(%rax), %r11 + movq 5120(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(WindowPos4dMESA), .-GL_PREFIX(WindowPos4dMESA) @@ -23981,25 +24064,25 @@ GL_PREFIX(WindowPos4dMESA): GL_PREFIX(WindowPos4dvMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5104(%rax), %r11 + movq 5128(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 5104(%rax), %r11 + movq 5128(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5104(%rax), %r11 + movq 5128(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 5104(%rax), %r11 + movq 5128(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(WindowPos4dvMESA), .-GL_PREFIX(WindowPos4dvMESA) @@ -24010,7 +24093,7 @@ GL_PREFIX(WindowPos4dvMESA): GL_PREFIX(WindowPos4fMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5112(%rax), %r11 + movq 5136(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) subq $40, %rsp @@ -24024,13 +24107,13 @@ GL_PREFIX(WindowPos4fMESA): movq 8(%rsp), %xmm1 movq (%rsp), %xmm0 addq $40, %rsp - movq 5112(%rax), %r11 + movq 5136(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5112(%rax), %r11 + movq 5136(%rax), %r11 jmp *%r11 1: subq $40, %rsp @@ -24044,7 +24127,7 @@ GL_PREFIX(WindowPos4fMESA): movq 8(%rsp), %xmm1 movq (%rsp), %xmm0 addq $40, %rsp - movq 5112(%rax), %r11 + movq 5136(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(WindowPos4fMESA), .-GL_PREFIX(WindowPos4fMESA) @@ -24055,25 +24138,25 @@ GL_PREFIX(WindowPos4fMESA): GL_PREFIX(WindowPos4fvMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5120(%rax), %r11 + movq 5144(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 5120(%rax), %r11 + movq 5144(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5120(%rax), %r11 + movq 5144(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 5120(%rax), %r11 + movq 5144(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(WindowPos4fvMESA), .-GL_PREFIX(WindowPos4fvMESA) @@ -24084,7 +24167,7 @@ GL_PREFIX(WindowPos4fvMESA): GL_PREFIX(WindowPos4iMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5128(%rax), %r11 + movq 5152(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -24098,13 +24181,13 @@ GL_PREFIX(WindowPos4iMESA): popq %rdx popq %rsi popq %rdi - movq 5128(%rax), %r11 + movq 5152(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5128(%rax), %r11 + movq 5152(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -24118,7 +24201,7 @@ GL_PREFIX(WindowPos4iMESA): popq %rdx popq %rsi popq %rdi - movq 5128(%rax), %r11 + movq 5152(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(WindowPos4iMESA), .-GL_PREFIX(WindowPos4iMESA) @@ -24129,25 +24212,25 @@ GL_PREFIX(WindowPos4iMESA): GL_PREFIX(WindowPos4ivMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5136(%rax), %r11 + movq 5160(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 5136(%rax), %r11 + movq 5160(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5136(%rax), %r11 + movq 5160(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 5136(%rax), %r11 + movq 5160(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(WindowPos4ivMESA), .-GL_PREFIX(WindowPos4ivMESA) @@ -24158,7 +24241,7 @@ GL_PREFIX(WindowPos4ivMESA): GL_PREFIX(WindowPos4sMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5144(%rax), %r11 + movq 5168(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -24172,13 +24255,13 @@ GL_PREFIX(WindowPos4sMESA): popq %rdx popq %rsi popq %rdi - movq 5144(%rax), %r11 + movq 5168(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5144(%rax), %r11 + movq 5168(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -24192,7 +24275,7 @@ GL_PREFIX(WindowPos4sMESA): popq %rdx popq %rsi popq %rdi - movq 5144(%rax), %r11 + movq 5168(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(WindowPos4sMESA), .-GL_PREFIX(WindowPos4sMESA) @@ -24203,37 +24286,37 @@ GL_PREFIX(WindowPos4sMESA): GL_PREFIX(WindowPos4svMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5152(%rax), %r11 + movq 5176(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 5152(%rax), %r11 + movq 5176(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5152(%rax), %r11 + movq 5176(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 5152(%rax), %r11 + movq 5176(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(WindowPos4svMESA), .-GL_PREFIX(WindowPos4svMESA) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_645) - .type GL_PREFIX(_dispatch_stub_645), @function - HIDDEN(GL_PREFIX(_dispatch_stub_645)) -GL_PREFIX(_dispatch_stub_645): + .globl GL_PREFIX(_dispatch_stub_648) + .type GL_PREFIX(_dispatch_stub_648), @function + HIDDEN(GL_PREFIX(_dispatch_stub_648)) +GL_PREFIX(_dispatch_stub_648): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5160(%rax), %r11 + movq 5184(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -24247,13 +24330,13 @@ GL_PREFIX(_dispatch_stub_645): popq %rdx popq %rsi popq %rdi - movq 5160(%rax), %r11 + movq 5184(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5160(%rax), %r11 + movq 5184(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -24267,19 +24350,19 @@ GL_PREFIX(_dispatch_stub_645): popq %rdx popq %rsi popq %rdi - movq 5160(%rax), %r11 + movq 5184(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_645), .-GL_PREFIX(_dispatch_stub_645) + .size GL_PREFIX(_dispatch_stub_648), .-GL_PREFIX(_dispatch_stub_648) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_646) - .type GL_PREFIX(_dispatch_stub_646), @function - HIDDEN(GL_PREFIX(_dispatch_stub_646)) -GL_PREFIX(_dispatch_stub_646): + .globl GL_PREFIX(_dispatch_stub_649) + .type GL_PREFIX(_dispatch_stub_649), @function + HIDDEN(GL_PREFIX(_dispatch_stub_649)) +GL_PREFIX(_dispatch_stub_649): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5168(%rax), %r11 + movq 5192(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -24297,13 +24380,13 @@ GL_PREFIX(_dispatch_stub_646): popq %rdx popq %rsi popq %rdi - movq 5168(%rax), %r11 + movq 5192(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5168(%rax), %r11 + movq 5192(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -24321,19 +24404,19 @@ GL_PREFIX(_dispatch_stub_646): popq %rdx popq %rsi popq %rdi - movq 5168(%rax), %r11 + movq 5192(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_646), .-GL_PREFIX(_dispatch_stub_646) + .size GL_PREFIX(_dispatch_stub_649), .-GL_PREFIX(_dispatch_stub_649) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_647) - .type GL_PREFIX(_dispatch_stub_647), @function - HIDDEN(GL_PREFIX(_dispatch_stub_647)) -GL_PREFIX(_dispatch_stub_647): + .globl GL_PREFIX(_dispatch_stub_650) + .type GL_PREFIX(_dispatch_stub_650), @function + HIDDEN(GL_PREFIX(_dispatch_stub_650)) +GL_PREFIX(_dispatch_stub_650): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5176(%rax), %r11 + movq 5200(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -24343,13 +24426,13 @@ GL_PREFIX(_dispatch_stub_647): popq %rbp popq %rsi popq %rdi - movq 5176(%rax), %r11 + movq 5200(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5176(%rax), %r11 + movq 5200(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -24359,49 +24442,49 @@ GL_PREFIX(_dispatch_stub_647): popq %rbp popq %rsi popq %rdi - movq 5176(%rax), %r11 + movq 5200(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_647), .-GL_PREFIX(_dispatch_stub_647) + .size GL_PREFIX(_dispatch_stub_650), .-GL_PREFIX(_dispatch_stub_650) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_648) - .type GL_PREFIX(_dispatch_stub_648), @function - HIDDEN(GL_PREFIX(_dispatch_stub_648)) -GL_PREFIX(_dispatch_stub_648): + .globl GL_PREFIX(_dispatch_stub_651) + .type GL_PREFIX(_dispatch_stub_651), @function + HIDDEN(GL_PREFIX(_dispatch_stub_651)) +GL_PREFIX(_dispatch_stub_651): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5184(%rax), %r11 + movq 5208(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 5184(%rax), %r11 + movq 5208(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5184(%rax), %r11 + movq 5208(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 5184(%rax), %r11 + movq 5208(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_648), .-GL_PREFIX(_dispatch_stub_648) + .size GL_PREFIX(_dispatch_stub_651), .-GL_PREFIX(_dispatch_stub_651) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_649) - .type GL_PREFIX(_dispatch_stub_649), @function - HIDDEN(GL_PREFIX(_dispatch_stub_649)) -GL_PREFIX(_dispatch_stub_649): + .globl GL_PREFIX(_dispatch_stub_652) + .type GL_PREFIX(_dispatch_stub_652), @function + HIDDEN(GL_PREFIX(_dispatch_stub_652)) +GL_PREFIX(_dispatch_stub_652): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5192(%rax), %r11 + movq 5216(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -24411,13 +24494,13 @@ GL_PREFIX(_dispatch_stub_649): popq %rbp popq %rsi popq %rdi - movq 5192(%rax), %r11 + movq 5216(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5192(%rax), %r11 + movq 5216(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -24427,19 +24510,19 @@ GL_PREFIX(_dispatch_stub_649): popq %rbp popq %rsi popq %rdi - movq 5192(%rax), %r11 + movq 5216(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_649), .-GL_PREFIX(_dispatch_stub_649) + .size GL_PREFIX(_dispatch_stub_652), .-GL_PREFIX(_dispatch_stub_652) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_650) - .type GL_PREFIX(_dispatch_stub_650), @function - HIDDEN(GL_PREFIX(_dispatch_stub_650)) -GL_PREFIX(_dispatch_stub_650): + .globl GL_PREFIX(_dispatch_stub_653) + .type GL_PREFIX(_dispatch_stub_653), @function + HIDDEN(GL_PREFIX(_dispatch_stub_653)) +GL_PREFIX(_dispatch_stub_653): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5200(%rax), %r11 + movq 5224(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -24449,13 +24532,13 @@ GL_PREFIX(_dispatch_stub_650): popq %rdx popq %rsi popq %rdi - movq 5200(%rax), %r11 + movq 5224(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5200(%rax), %r11 + movq 5224(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -24465,49 +24548,49 @@ GL_PREFIX(_dispatch_stub_650): popq %rdx popq %rsi popq %rdi - movq 5200(%rax), %r11 + movq 5224(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_650), .-GL_PREFIX(_dispatch_stub_650) + .size GL_PREFIX(_dispatch_stub_653), .-GL_PREFIX(_dispatch_stub_653) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_651) - .type GL_PREFIX(_dispatch_stub_651), @function - HIDDEN(GL_PREFIX(_dispatch_stub_651)) -GL_PREFIX(_dispatch_stub_651): + .globl GL_PREFIX(_dispatch_stub_654) + .type GL_PREFIX(_dispatch_stub_654), @function + HIDDEN(GL_PREFIX(_dispatch_stub_654)) +GL_PREFIX(_dispatch_stub_654): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5208(%rax), %r11 + movq 5232(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 5208(%rax), %r11 + movq 5232(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5208(%rax), %r11 + movq 5232(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 5208(%rax), %r11 + movq 5232(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_651), .-GL_PREFIX(_dispatch_stub_651) + .size GL_PREFIX(_dispatch_stub_654), .-GL_PREFIX(_dispatch_stub_654) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_652) - .type GL_PREFIX(_dispatch_stub_652), @function - HIDDEN(GL_PREFIX(_dispatch_stub_652)) -GL_PREFIX(_dispatch_stub_652): + .globl GL_PREFIX(_dispatch_stub_655) + .type GL_PREFIX(_dispatch_stub_655), @function + HIDDEN(GL_PREFIX(_dispatch_stub_655)) +GL_PREFIX(_dispatch_stub_655): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5216(%rax), %r11 + movq 5240(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -24517,13 +24600,13 @@ GL_PREFIX(_dispatch_stub_652): popq %rbp popq %rsi popq %rdi - movq 5216(%rax), %r11 + movq 5240(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5216(%rax), %r11 + movq 5240(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -24533,40 +24616,40 @@ GL_PREFIX(_dispatch_stub_652): popq %rbp popq %rsi popq %rdi - movq 5216(%rax), %r11 + movq 5240(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_652), .-GL_PREFIX(_dispatch_stub_652) + .size GL_PREFIX(_dispatch_stub_655), .-GL_PREFIX(_dispatch_stub_655) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_653) - .type GL_PREFIX(_dispatch_stub_653), @function - HIDDEN(GL_PREFIX(_dispatch_stub_653)) -GL_PREFIX(_dispatch_stub_653): + .globl GL_PREFIX(_dispatch_stub_656) + .type GL_PREFIX(_dispatch_stub_656), @function + HIDDEN(GL_PREFIX(_dispatch_stub_656)) +GL_PREFIX(_dispatch_stub_656): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5224(%rax), %r11 + movq 5248(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 5224(%rax), %r11 + movq 5248(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5224(%rax), %r11 + movq 5248(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 5224(%rax), %r11 + movq 5248(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_653), .-GL_PREFIX(_dispatch_stub_653) + .size GL_PREFIX(_dispatch_stub_656), .-GL_PREFIX(_dispatch_stub_656) .p2align 4,,15 .globl GL_PREFIX(AreProgramsResidentNV) @@ -24574,7 +24657,7 @@ GL_PREFIX(_dispatch_stub_653): GL_PREFIX(AreProgramsResidentNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5232(%rax), %r11 + movq 5256(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -24584,13 +24667,13 @@ GL_PREFIX(AreProgramsResidentNV): popq %rdx popq %rsi popq %rdi - movq 5232(%rax), %r11 + movq 5256(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5232(%rax), %r11 + movq 5256(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -24600,7 +24683,7 @@ GL_PREFIX(AreProgramsResidentNV): popq %rdx popq %rsi popq %rdi - movq 5232(%rax), %r11 + movq 5256(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(AreProgramsResidentNV), .-GL_PREFIX(AreProgramsResidentNV) @@ -24611,7 +24694,7 @@ GL_PREFIX(AreProgramsResidentNV): GL_PREFIX(BindProgramNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5240(%rax), %r11 + movq 5264(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -24621,13 +24704,13 @@ GL_PREFIX(BindProgramNV): popq %rbp popq %rsi popq %rdi - movq 5240(%rax), %r11 + movq 5264(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5240(%rax), %r11 + movq 5264(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -24637,7 +24720,7 @@ GL_PREFIX(BindProgramNV): popq %rbp popq %rsi popq %rdi - movq 5240(%rax), %r11 + movq 5264(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(BindProgramNV), .-GL_PREFIX(BindProgramNV) @@ -24648,7 +24731,7 @@ GL_PREFIX(BindProgramNV): GL_PREFIX(DeleteProgramsNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5248(%rax), %r11 + movq 5272(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -24658,13 +24741,13 @@ GL_PREFIX(DeleteProgramsNV): popq %rbp popq %rsi popq %rdi - movq 5248(%rax), %r11 + movq 5272(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5248(%rax), %r11 + movq 5272(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -24674,7 +24757,7 @@ GL_PREFIX(DeleteProgramsNV): popq %rbp popq %rsi popq %rdi - movq 5248(%rax), %r11 + movq 5272(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(DeleteProgramsNV), .-GL_PREFIX(DeleteProgramsNV) @@ -24685,7 +24768,7 @@ GL_PREFIX(DeleteProgramsNV): GL_PREFIX(ExecuteProgramNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5256(%rax), %r11 + movq 5280(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -24695,13 +24778,13 @@ GL_PREFIX(ExecuteProgramNV): popq %rdx popq %rsi popq %rdi - movq 5256(%rax), %r11 + movq 5280(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5256(%rax), %r11 + movq 5280(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -24711,7 +24794,7 @@ GL_PREFIX(ExecuteProgramNV): popq %rdx popq %rsi popq %rdi - movq 5256(%rax), %r11 + movq 5280(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(ExecuteProgramNV), .-GL_PREFIX(ExecuteProgramNV) @@ -24722,7 +24805,7 @@ GL_PREFIX(ExecuteProgramNV): GL_PREFIX(GenProgramsNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5264(%rax), %r11 + movq 5288(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -24732,13 +24815,13 @@ GL_PREFIX(GenProgramsNV): popq %rbp popq %rsi popq %rdi - movq 5264(%rax), %r11 + movq 5288(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5264(%rax), %r11 + movq 5288(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -24748,7 +24831,7 @@ GL_PREFIX(GenProgramsNV): popq %rbp popq %rsi popq %rdi - movq 5264(%rax), %r11 + movq 5288(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GenProgramsNV), .-GL_PREFIX(GenProgramsNV) @@ -24759,7 +24842,7 @@ GL_PREFIX(GenProgramsNV): GL_PREFIX(GetProgramParameterdvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5272(%rax), %r11 + movq 5296(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -24773,13 +24856,13 @@ GL_PREFIX(GetProgramParameterdvNV): popq %rdx popq %rsi popq %rdi - movq 5272(%rax), %r11 + movq 5296(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5272(%rax), %r11 + movq 5296(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -24793,7 +24876,7 @@ GL_PREFIX(GetProgramParameterdvNV): popq %rdx popq %rsi popq %rdi - movq 5272(%rax), %r11 + movq 5296(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GetProgramParameterdvNV), .-GL_PREFIX(GetProgramParameterdvNV) @@ -24804,7 +24887,7 @@ GL_PREFIX(GetProgramParameterdvNV): GL_PREFIX(GetProgramParameterfvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5280(%rax), %r11 + movq 5304(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -24818,13 +24901,13 @@ GL_PREFIX(GetProgramParameterfvNV): popq %rdx popq %rsi popq %rdi - movq 5280(%rax), %r11 + movq 5304(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5280(%rax), %r11 + movq 5304(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -24838,7 +24921,7 @@ GL_PREFIX(GetProgramParameterfvNV): popq %rdx popq %rsi popq %rdi - movq 5280(%rax), %r11 + movq 5304(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GetProgramParameterfvNV), .-GL_PREFIX(GetProgramParameterfvNV) @@ -24849,7 +24932,7 @@ GL_PREFIX(GetProgramParameterfvNV): GL_PREFIX(GetProgramStringNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5288(%rax), %r11 + movq 5312(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -24859,13 +24942,13 @@ GL_PREFIX(GetProgramStringNV): popq %rdx popq %rsi popq %rdi - movq 5288(%rax), %r11 + movq 5312(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5288(%rax), %r11 + movq 5312(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -24875,7 +24958,7 @@ GL_PREFIX(GetProgramStringNV): popq %rdx popq %rsi popq %rdi - movq 5288(%rax), %r11 + movq 5312(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GetProgramStringNV), .-GL_PREFIX(GetProgramStringNV) @@ -24886,7 +24969,7 @@ GL_PREFIX(GetProgramStringNV): GL_PREFIX(GetProgramivNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5296(%rax), %r11 + movq 5320(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -24896,13 +24979,13 @@ GL_PREFIX(GetProgramivNV): popq %rdx popq %rsi popq %rdi - movq 5296(%rax), %r11 + movq 5320(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5296(%rax), %r11 + movq 5320(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -24912,7 +24995,7 @@ GL_PREFIX(GetProgramivNV): popq %rdx popq %rsi popq %rdi - movq 5296(%rax), %r11 + movq 5320(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GetProgramivNV), .-GL_PREFIX(GetProgramivNV) @@ -24923,7 +25006,7 @@ GL_PREFIX(GetProgramivNV): GL_PREFIX(GetTrackMatrixivNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5304(%rax), %r11 + movq 5328(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -24937,13 +25020,13 @@ GL_PREFIX(GetTrackMatrixivNV): popq %rdx popq %rsi popq %rdi - movq 5304(%rax), %r11 + movq 5328(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5304(%rax), %r11 + movq 5328(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -24957,7 +25040,7 @@ GL_PREFIX(GetTrackMatrixivNV): popq %rdx popq %rsi popq %rdi - movq 5304(%rax), %r11 + movq 5328(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GetTrackMatrixivNV), .-GL_PREFIX(GetTrackMatrixivNV) @@ -24968,7 +25051,7 @@ GL_PREFIX(GetTrackMatrixivNV): GL_PREFIX(GetVertexAttribPointervNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5312(%rax), %r11 + movq 5336(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -24978,13 +25061,13 @@ GL_PREFIX(GetVertexAttribPointervNV): popq %rdx popq %rsi popq %rdi - movq 5312(%rax), %r11 + movq 5336(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5312(%rax), %r11 + movq 5336(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -24994,7 +25077,7 @@ GL_PREFIX(GetVertexAttribPointervNV): popq %rdx popq %rsi popq %rdi - movq 5312(%rax), %r11 + movq 5336(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GetVertexAttribPointervNV), .-GL_PREFIX(GetVertexAttribPointervNV) @@ -25005,7 +25088,7 @@ GL_PREFIX(GetVertexAttribPointervNV): GL_PREFIX(GetVertexAttribdvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5320(%rax), %r11 + movq 5344(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -25015,13 +25098,13 @@ GL_PREFIX(GetVertexAttribdvNV): popq %rdx popq %rsi popq %rdi - movq 5320(%rax), %r11 + movq 5344(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5320(%rax), %r11 + movq 5344(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -25031,7 +25114,7 @@ GL_PREFIX(GetVertexAttribdvNV): popq %rdx popq %rsi popq %rdi - movq 5320(%rax), %r11 + movq 5344(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GetVertexAttribdvNV), .-GL_PREFIX(GetVertexAttribdvNV) @@ -25042,7 +25125,7 @@ GL_PREFIX(GetVertexAttribdvNV): GL_PREFIX(GetVertexAttribfvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5328(%rax), %r11 + movq 5352(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -25052,13 +25135,13 @@ GL_PREFIX(GetVertexAttribfvNV): popq %rdx popq %rsi popq %rdi - movq 5328(%rax), %r11 + movq 5352(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5328(%rax), %r11 + movq 5352(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -25068,7 +25151,7 @@ GL_PREFIX(GetVertexAttribfvNV): popq %rdx popq %rsi popq %rdi - movq 5328(%rax), %r11 + movq 5352(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GetVertexAttribfvNV), .-GL_PREFIX(GetVertexAttribfvNV) @@ -25079,7 +25162,7 @@ GL_PREFIX(GetVertexAttribfvNV): GL_PREFIX(GetVertexAttribivNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5336(%rax), %r11 + movq 5360(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -25089,13 +25172,13 @@ GL_PREFIX(GetVertexAttribivNV): popq %rdx popq %rsi popq %rdi - movq 5336(%rax), %r11 + movq 5360(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5336(%rax), %r11 + movq 5360(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -25105,7 +25188,7 @@ GL_PREFIX(GetVertexAttribivNV): popq %rdx popq %rsi popq %rdi - movq 5336(%rax), %r11 + movq 5360(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GetVertexAttribivNV), .-GL_PREFIX(GetVertexAttribivNV) @@ -25116,25 +25199,25 @@ GL_PREFIX(GetVertexAttribivNV): GL_PREFIX(IsProgramNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5344(%rax), %r11 + movq 5368(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 5344(%rax), %r11 + movq 5368(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5344(%rax), %r11 + movq 5368(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 5344(%rax), %r11 + movq 5368(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(IsProgramNV), .-GL_PREFIX(IsProgramNV) @@ -25145,7 +25228,7 @@ GL_PREFIX(IsProgramNV): GL_PREFIX(LoadProgramNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5352(%rax), %r11 + movq 5376(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -25159,13 +25242,13 @@ GL_PREFIX(LoadProgramNV): popq %rdx popq %rsi popq %rdi - movq 5352(%rax), %r11 + movq 5376(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5352(%rax), %r11 + movq 5376(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -25179,7 +25262,7 @@ GL_PREFIX(LoadProgramNV): popq %rdx popq %rsi popq %rdi - movq 5352(%rax), %r11 + movq 5376(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(LoadProgramNV), .-GL_PREFIX(LoadProgramNV) @@ -25190,7 +25273,7 @@ GL_PREFIX(LoadProgramNV): GL_PREFIX(ProgramParameter4dNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5360(%rax), %r11 + movq 5384(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) subq $56, %rsp @@ -25208,13 +25291,13 @@ GL_PREFIX(ProgramParameter4dNV): movq 8(%rsp), %rsi movq (%rsp), %rdi addq $56, %rsp - movq 5360(%rax), %r11 + movq 5384(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5360(%rax), %r11 + movq 5384(%rax), %r11 jmp *%r11 1: subq $56, %rsp @@ -25232,7 +25315,7 @@ GL_PREFIX(ProgramParameter4dNV): movq 8(%rsp), %rsi movq (%rsp), %rdi addq $56, %rsp - movq 5360(%rax), %r11 + movq 5384(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(ProgramParameter4dNV), .-GL_PREFIX(ProgramParameter4dNV) @@ -25243,7 +25326,7 @@ GL_PREFIX(ProgramParameter4dNV): GL_PREFIX(ProgramParameter4dvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5368(%rax), %r11 + movq 5392(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -25253,13 +25336,13 @@ GL_PREFIX(ProgramParameter4dvNV): popq %rdx popq %rsi popq %rdi - movq 5368(%rax), %r11 + movq 5392(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5368(%rax), %r11 + movq 5392(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -25269,7 +25352,7 @@ GL_PREFIX(ProgramParameter4dvNV): popq %rdx popq %rsi popq %rdi - movq 5368(%rax), %r11 + movq 5392(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(ProgramParameter4dvNV), .-GL_PREFIX(ProgramParameter4dvNV) @@ -25280,7 +25363,7 @@ GL_PREFIX(ProgramParameter4dvNV): GL_PREFIX(ProgramParameter4fNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5376(%rax), %r11 + movq 5400(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) subq $56, %rsp @@ -25298,13 +25381,13 @@ GL_PREFIX(ProgramParameter4fNV): movq 8(%rsp), %rsi movq (%rsp), %rdi addq $56, %rsp - movq 5376(%rax), %r11 + movq 5400(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5376(%rax), %r11 + movq 5400(%rax), %r11 jmp *%r11 1: subq $56, %rsp @@ -25322,7 +25405,7 @@ GL_PREFIX(ProgramParameter4fNV): movq 8(%rsp), %rsi movq (%rsp), %rdi addq $56, %rsp - movq 5376(%rax), %r11 + movq 5400(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(ProgramParameter4fNV), .-GL_PREFIX(ProgramParameter4fNV) @@ -25333,7 +25416,7 @@ GL_PREFIX(ProgramParameter4fNV): GL_PREFIX(ProgramParameter4fvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5384(%rax), %r11 + movq 5408(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -25343,13 +25426,13 @@ GL_PREFIX(ProgramParameter4fvNV): popq %rdx popq %rsi popq %rdi - movq 5384(%rax), %r11 + movq 5408(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5384(%rax), %r11 + movq 5408(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -25359,7 +25442,7 @@ GL_PREFIX(ProgramParameter4fvNV): popq %rdx popq %rsi popq %rdi - movq 5384(%rax), %r11 + movq 5408(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(ProgramParameter4fvNV), .-GL_PREFIX(ProgramParameter4fvNV) @@ -25370,7 +25453,7 @@ GL_PREFIX(ProgramParameter4fvNV): GL_PREFIX(ProgramParameters4dvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5392(%rax), %r11 + movq 5416(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -25384,13 +25467,13 @@ GL_PREFIX(ProgramParameters4dvNV): popq %rdx popq %rsi popq %rdi - movq 5392(%rax), %r11 + movq 5416(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5392(%rax), %r11 + movq 5416(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -25404,7 +25487,7 @@ GL_PREFIX(ProgramParameters4dvNV): popq %rdx popq %rsi popq %rdi - movq 5392(%rax), %r11 + movq 5416(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(ProgramParameters4dvNV), .-GL_PREFIX(ProgramParameters4dvNV) @@ -25415,7 +25498,7 @@ GL_PREFIX(ProgramParameters4dvNV): GL_PREFIX(ProgramParameters4fvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5400(%rax), %r11 + movq 5424(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -25429,13 +25512,13 @@ GL_PREFIX(ProgramParameters4fvNV): popq %rdx popq %rsi popq %rdi - movq 5400(%rax), %r11 + movq 5424(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5400(%rax), %r11 + movq 5424(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -25449,7 +25532,7 @@ GL_PREFIX(ProgramParameters4fvNV): popq %rdx popq %rsi popq %rdi - movq 5400(%rax), %r11 + movq 5424(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(ProgramParameters4fvNV), .-GL_PREFIX(ProgramParameters4fvNV) @@ -25460,7 +25543,7 @@ GL_PREFIX(ProgramParameters4fvNV): GL_PREFIX(RequestResidentProgramsNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5408(%rax), %r11 + movq 5432(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -25470,13 +25553,13 @@ GL_PREFIX(RequestResidentProgramsNV): popq %rbp popq %rsi popq %rdi - movq 5408(%rax), %r11 + movq 5432(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5408(%rax), %r11 + movq 5432(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -25486,7 +25569,7 @@ GL_PREFIX(RequestResidentProgramsNV): popq %rbp popq %rsi popq %rdi - movq 5408(%rax), %r11 + movq 5432(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(RequestResidentProgramsNV), .-GL_PREFIX(RequestResidentProgramsNV) @@ -25497,7 +25580,7 @@ GL_PREFIX(RequestResidentProgramsNV): GL_PREFIX(TrackMatrixNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5416(%rax), %r11 + movq 5440(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -25511,13 +25594,13 @@ GL_PREFIX(TrackMatrixNV): popq %rdx popq %rsi popq %rdi - movq 5416(%rax), %r11 + movq 5440(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5416(%rax), %r11 + movq 5440(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -25531,7 +25614,7 @@ GL_PREFIX(TrackMatrixNV): popq %rdx popq %rsi popq %rdi - movq 5416(%rax), %r11 + movq 5440(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(TrackMatrixNV), .-GL_PREFIX(TrackMatrixNV) @@ -25542,7 +25625,7 @@ GL_PREFIX(TrackMatrixNV): GL_PREFIX(VertexAttrib1dNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5424(%rax), %r11 + movq 5448(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) subq $24, %rsp @@ -25552,13 +25635,13 @@ GL_PREFIX(VertexAttrib1dNV): movq 8(%rsp), %xmm0 movq (%rsp), %rdi addq $24, %rsp - movq 5424(%rax), %r11 + movq 5448(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5424(%rax), %r11 + movq 5448(%rax), %r11 jmp *%r11 1: subq $24, %rsp @@ -25568,7 +25651,7 @@ GL_PREFIX(VertexAttrib1dNV): movq 8(%rsp), %xmm0 movq (%rsp), %rdi addq $24, %rsp - movq 5424(%rax), %r11 + movq 5448(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib1dNV), .-GL_PREFIX(VertexAttrib1dNV) @@ -25579,7 +25662,7 @@ GL_PREFIX(VertexAttrib1dNV): GL_PREFIX(VertexAttrib1dvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5432(%rax), %r11 + movq 5456(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -25589,13 +25672,13 @@ GL_PREFIX(VertexAttrib1dvNV): popq %rbp popq %rsi popq %rdi - movq 5432(%rax), %r11 + movq 5456(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5432(%rax), %r11 + movq 5456(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -25605,7 +25688,7 @@ GL_PREFIX(VertexAttrib1dvNV): popq %rbp popq %rsi popq %rdi - movq 5432(%rax), %r11 + movq 5456(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib1dvNV), .-GL_PREFIX(VertexAttrib1dvNV) @@ -25616,7 +25699,7 @@ GL_PREFIX(VertexAttrib1dvNV): GL_PREFIX(VertexAttrib1fNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5440(%rax), %r11 + movq 5464(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) subq $24, %rsp @@ -25626,13 +25709,13 @@ GL_PREFIX(VertexAttrib1fNV): movq 8(%rsp), %xmm0 movq (%rsp), %rdi addq $24, %rsp - movq 5440(%rax), %r11 + movq 5464(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5440(%rax), %r11 + movq 5464(%rax), %r11 jmp *%r11 1: subq $24, %rsp @@ -25642,7 +25725,7 @@ GL_PREFIX(VertexAttrib1fNV): movq 8(%rsp), %xmm0 movq (%rsp), %rdi addq $24, %rsp - movq 5440(%rax), %r11 + movq 5464(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib1fNV), .-GL_PREFIX(VertexAttrib1fNV) @@ -25653,7 +25736,7 @@ GL_PREFIX(VertexAttrib1fNV): GL_PREFIX(VertexAttrib1fvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5448(%rax), %r11 + movq 5472(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -25663,13 +25746,13 @@ GL_PREFIX(VertexAttrib1fvNV): popq %rbp popq %rsi popq %rdi - movq 5448(%rax), %r11 + movq 5472(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5448(%rax), %r11 + movq 5472(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -25679,7 +25762,7 @@ GL_PREFIX(VertexAttrib1fvNV): popq %rbp popq %rsi popq %rdi - movq 5448(%rax), %r11 + movq 5472(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib1fvNV), .-GL_PREFIX(VertexAttrib1fvNV) @@ -25690,7 +25773,7 @@ GL_PREFIX(VertexAttrib1fvNV): GL_PREFIX(VertexAttrib1sNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5456(%rax), %r11 + movq 5480(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -25700,13 +25783,13 @@ GL_PREFIX(VertexAttrib1sNV): popq %rbp popq %rsi popq %rdi - movq 5456(%rax), %r11 + movq 5480(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5456(%rax), %r11 + movq 5480(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -25716,7 +25799,7 @@ GL_PREFIX(VertexAttrib1sNV): popq %rbp popq %rsi popq %rdi - movq 5456(%rax), %r11 + movq 5480(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib1sNV), .-GL_PREFIX(VertexAttrib1sNV) @@ -25727,7 +25810,7 @@ GL_PREFIX(VertexAttrib1sNV): GL_PREFIX(VertexAttrib1svNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5464(%rax), %r11 + movq 5488(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -25737,13 +25820,13 @@ GL_PREFIX(VertexAttrib1svNV): popq %rbp popq %rsi popq %rdi - movq 5464(%rax), %r11 + movq 5488(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5464(%rax), %r11 + movq 5488(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -25753,7 +25836,7 @@ GL_PREFIX(VertexAttrib1svNV): popq %rbp popq %rsi popq %rdi - movq 5464(%rax), %r11 + movq 5488(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib1svNV), .-GL_PREFIX(VertexAttrib1svNV) @@ -25764,7 +25847,7 @@ GL_PREFIX(VertexAttrib1svNV): GL_PREFIX(VertexAttrib2dNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5472(%rax), %r11 + movq 5496(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) subq $24, %rsp @@ -25776,13 +25859,13 @@ GL_PREFIX(VertexAttrib2dNV): movq 8(%rsp), %xmm0 movq (%rsp), %rdi addq $24, %rsp - movq 5472(%rax), %r11 + movq 5496(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5472(%rax), %r11 + movq 5496(%rax), %r11 jmp *%r11 1: subq $24, %rsp @@ -25794,7 +25877,7 @@ GL_PREFIX(VertexAttrib2dNV): movq 8(%rsp), %xmm0 movq (%rsp), %rdi addq $24, %rsp - movq 5472(%rax), %r11 + movq 5496(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib2dNV), .-GL_PREFIX(VertexAttrib2dNV) @@ -25805,7 +25888,7 @@ GL_PREFIX(VertexAttrib2dNV): GL_PREFIX(VertexAttrib2dvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5480(%rax), %r11 + movq 5504(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -25815,13 +25898,13 @@ GL_PREFIX(VertexAttrib2dvNV): popq %rbp popq %rsi popq %rdi - movq 5480(%rax), %r11 + movq 5504(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5480(%rax), %r11 + movq 5504(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -25831,7 +25914,7 @@ GL_PREFIX(VertexAttrib2dvNV): popq %rbp popq %rsi popq %rdi - movq 5480(%rax), %r11 + movq 5504(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib2dvNV), .-GL_PREFIX(VertexAttrib2dvNV) @@ -25842,7 +25925,7 @@ GL_PREFIX(VertexAttrib2dvNV): GL_PREFIX(VertexAttrib2fNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5488(%rax), %r11 + movq 5512(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) subq $24, %rsp @@ -25854,13 +25937,13 @@ GL_PREFIX(VertexAttrib2fNV): movq 8(%rsp), %xmm0 movq (%rsp), %rdi addq $24, %rsp - movq 5488(%rax), %r11 + movq 5512(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5488(%rax), %r11 + movq 5512(%rax), %r11 jmp *%r11 1: subq $24, %rsp @@ -25872,7 +25955,7 @@ GL_PREFIX(VertexAttrib2fNV): movq 8(%rsp), %xmm0 movq (%rsp), %rdi addq $24, %rsp - movq 5488(%rax), %r11 + movq 5512(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib2fNV), .-GL_PREFIX(VertexAttrib2fNV) @@ -25883,7 +25966,7 @@ GL_PREFIX(VertexAttrib2fNV): GL_PREFIX(VertexAttrib2fvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5496(%rax), %r11 + movq 5520(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -25893,13 +25976,13 @@ GL_PREFIX(VertexAttrib2fvNV): popq %rbp popq %rsi popq %rdi - movq 5496(%rax), %r11 + movq 5520(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5496(%rax), %r11 + movq 5520(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -25909,7 +25992,7 @@ GL_PREFIX(VertexAttrib2fvNV): popq %rbp popq %rsi popq %rdi - movq 5496(%rax), %r11 + movq 5520(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib2fvNV), .-GL_PREFIX(VertexAttrib2fvNV) @@ -25920,7 +26003,7 @@ GL_PREFIX(VertexAttrib2fvNV): GL_PREFIX(VertexAttrib2sNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5504(%rax), %r11 + movq 5528(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -25930,13 +26013,13 @@ GL_PREFIX(VertexAttrib2sNV): popq %rdx popq %rsi popq %rdi - movq 5504(%rax), %r11 + movq 5528(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5504(%rax), %r11 + movq 5528(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -25946,7 +26029,7 @@ GL_PREFIX(VertexAttrib2sNV): popq %rdx popq %rsi popq %rdi - movq 5504(%rax), %r11 + movq 5528(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib2sNV), .-GL_PREFIX(VertexAttrib2sNV) @@ -25957,7 +26040,7 @@ GL_PREFIX(VertexAttrib2sNV): GL_PREFIX(VertexAttrib2svNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5512(%rax), %r11 + movq 5536(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -25967,13 +26050,13 @@ GL_PREFIX(VertexAttrib2svNV): popq %rbp popq %rsi popq %rdi - movq 5512(%rax), %r11 + movq 5536(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5512(%rax), %r11 + movq 5536(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -25983,7 +26066,7 @@ GL_PREFIX(VertexAttrib2svNV): popq %rbp popq %rsi popq %rdi - movq 5512(%rax), %r11 + movq 5536(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib2svNV), .-GL_PREFIX(VertexAttrib2svNV) @@ -25994,7 +26077,7 @@ GL_PREFIX(VertexAttrib2svNV): GL_PREFIX(VertexAttrib3dNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5520(%rax), %r11 + movq 5544(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) subq $40, %rsp @@ -26008,13 +26091,13 @@ GL_PREFIX(VertexAttrib3dNV): movq 8(%rsp), %xmm0 movq (%rsp), %rdi addq $40, %rsp - movq 5520(%rax), %r11 + movq 5544(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5520(%rax), %r11 + movq 5544(%rax), %r11 jmp *%r11 1: subq $40, %rsp @@ -26028,7 +26111,7 @@ GL_PREFIX(VertexAttrib3dNV): movq 8(%rsp), %xmm0 movq (%rsp), %rdi addq $40, %rsp - movq 5520(%rax), %r11 + movq 5544(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib3dNV), .-GL_PREFIX(VertexAttrib3dNV) @@ -26039,7 +26122,7 @@ GL_PREFIX(VertexAttrib3dNV): GL_PREFIX(VertexAttrib3dvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5528(%rax), %r11 + movq 5552(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -26049,13 +26132,13 @@ GL_PREFIX(VertexAttrib3dvNV): popq %rbp popq %rsi popq %rdi - movq 5528(%rax), %r11 + movq 5552(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5528(%rax), %r11 + movq 5552(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -26065,7 +26148,7 @@ GL_PREFIX(VertexAttrib3dvNV): popq %rbp popq %rsi popq %rdi - movq 5528(%rax), %r11 + movq 5552(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib3dvNV), .-GL_PREFIX(VertexAttrib3dvNV) @@ -26076,7 +26159,7 @@ GL_PREFIX(VertexAttrib3dvNV): GL_PREFIX(VertexAttrib3fNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5536(%rax), %r11 + movq 5560(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) subq $40, %rsp @@ -26090,13 +26173,13 @@ GL_PREFIX(VertexAttrib3fNV): movq 8(%rsp), %xmm0 movq (%rsp), %rdi addq $40, %rsp - movq 5536(%rax), %r11 + movq 5560(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5536(%rax), %r11 + movq 5560(%rax), %r11 jmp *%r11 1: subq $40, %rsp @@ -26110,7 +26193,7 @@ GL_PREFIX(VertexAttrib3fNV): movq 8(%rsp), %xmm0 movq (%rsp), %rdi addq $40, %rsp - movq 5536(%rax), %r11 + movq 5560(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib3fNV), .-GL_PREFIX(VertexAttrib3fNV) @@ -26121,7 +26204,7 @@ GL_PREFIX(VertexAttrib3fNV): GL_PREFIX(VertexAttrib3fvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5544(%rax), %r11 + movq 5568(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -26131,13 +26214,13 @@ GL_PREFIX(VertexAttrib3fvNV): popq %rbp popq %rsi popq %rdi - movq 5544(%rax), %r11 + movq 5568(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5544(%rax), %r11 + movq 5568(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -26147,7 +26230,7 @@ GL_PREFIX(VertexAttrib3fvNV): popq %rbp popq %rsi popq %rdi - movq 5544(%rax), %r11 + movq 5568(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib3fvNV), .-GL_PREFIX(VertexAttrib3fvNV) @@ -26158,7 +26241,7 @@ GL_PREFIX(VertexAttrib3fvNV): GL_PREFIX(VertexAttrib3sNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5552(%rax), %r11 + movq 5576(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -26172,13 +26255,13 @@ GL_PREFIX(VertexAttrib3sNV): popq %rdx popq %rsi popq %rdi - movq 5552(%rax), %r11 + movq 5576(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5552(%rax), %r11 + movq 5576(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -26192,7 +26275,7 @@ GL_PREFIX(VertexAttrib3sNV): popq %rdx popq %rsi popq %rdi - movq 5552(%rax), %r11 + movq 5576(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib3sNV), .-GL_PREFIX(VertexAttrib3sNV) @@ -26203,7 +26286,7 @@ GL_PREFIX(VertexAttrib3sNV): GL_PREFIX(VertexAttrib3svNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5560(%rax), %r11 + movq 5584(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -26213,13 +26296,13 @@ GL_PREFIX(VertexAttrib3svNV): popq %rbp popq %rsi popq %rdi - movq 5560(%rax), %r11 + movq 5584(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5560(%rax), %r11 + movq 5584(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -26229,7 +26312,7 @@ GL_PREFIX(VertexAttrib3svNV): popq %rbp popq %rsi popq %rdi - movq 5560(%rax), %r11 + movq 5584(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib3svNV), .-GL_PREFIX(VertexAttrib3svNV) @@ -26240,7 +26323,7 @@ GL_PREFIX(VertexAttrib3svNV): GL_PREFIX(VertexAttrib4dNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5568(%rax), %r11 + movq 5592(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) subq $40, %rsp @@ -26256,13 +26339,13 @@ GL_PREFIX(VertexAttrib4dNV): movq 8(%rsp), %xmm0 movq (%rsp), %rdi addq $40, %rsp - movq 5568(%rax), %r11 + movq 5592(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5568(%rax), %r11 + movq 5592(%rax), %r11 jmp *%r11 1: subq $40, %rsp @@ -26278,7 +26361,7 @@ GL_PREFIX(VertexAttrib4dNV): movq 8(%rsp), %xmm0 movq (%rsp), %rdi addq $40, %rsp - movq 5568(%rax), %r11 + movq 5592(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib4dNV), .-GL_PREFIX(VertexAttrib4dNV) @@ -26289,7 +26372,7 @@ GL_PREFIX(VertexAttrib4dNV): GL_PREFIX(VertexAttrib4dvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5576(%rax), %r11 + movq 5600(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -26299,13 +26382,13 @@ GL_PREFIX(VertexAttrib4dvNV): popq %rbp popq %rsi popq %rdi - movq 5576(%rax), %r11 + movq 5600(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5576(%rax), %r11 + movq 5600(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -26315,7 +26398,7 @@ GL_PREFIX(VertexAttrib4dvNV): popq %rbp popq %rsi popq %rdi - movq 5576(%rax), %r11 + movq 5600(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib4dvNV), .-GL_PREFIX(VertexAttrib4dvNV) @@ -26326,7 +26409,7 @@ GL_PREFIX(VertexAttrib4dvNV): GL_PREFIX(VertexAttrib4fNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5584(%rax), %r11 + movq 5608(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) subq $40, %rsp @@ -26342,13 +26425,13 @@ GL_PREFIX(VertexAttrib4fNV): movq 8(%rsp), %xmm0 movq (%rsp), %rdi addq $40, %rsp - movq 5584(%rax), %r11 + movq 5608(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5584(%rax), %r11 + movq 5608(%rax), %r11 jmp *%r11 1: subq $40, %rsp @@ -26364,7 +26447,7 @@ GL_PREFIX(VertexAttrib4fNV): movq 8(%rsp), %xmm0 movq (%rsp), %rdi addq $40, %rsp - movq 5584(%rax), %r11 + movq 5608(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib4fNV), .-GL_PREFIX(VertexAttrib4fNV) @@ -26375,7 +26458,7 @@ GL_PREFIX(VertexAttrib4fNV): GL_PREFIX(VertexAttrib4fvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5592(%rax), %r11 + movq 5616(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -26385,13 +26468,13 @@ GL_PREFIX(VertexAttrib4fvNV): popq %rbp popq %rsi popq %rdi - movq 5592(%rax), %r11 + movq 5616(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5592(%rax), %r11 + movq 5616(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -26401,7 +26484,7 @@ GL_PREFIX(VertexAttrib4fvNV): popq %rbp popq %rsi popq %rdi - movq 5592(%rax), %r11 + movq 5616(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib4fvNV), .-GL_PREFIX(VertexAttrib4fvNV) @@ -26412,7 +26495,7 @@ GL_PREFIX(VertexAttrib4fvNV): GL_PREFIX(VertexAttrib4sNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5600(%rax), %r11 + movq 5624(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -26426,13 +26509,13 @@ GL_PREFIX(VertexAttrib4sNV): popq %rdx popq %rsi popq %rdi - movq 5600(%rax), %r11 + movq 5624(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5600(%rax), %r11 + movq 5624(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -26446,7 +26529,7 @@ GL_PREFIX(VertexAttrib4sNV): popq %rdx popq %rsi popq %rdi - movq 5600(%rax), %r11 + movq 5624(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib4sNV), .-GL_PREFIX(VertexAttrib4sNV) @@ -26457,7 +26540,7 @@ GL_PREFIX(VertexAttrib4sNV): GL_PREFIX(VertexAttrib4svNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5608(%rax), %r11 + movq 5632(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -26467,13 +26550,13 @@ GL_PREFIX(VertexAttrib4svNV): popq %rbp popq %rsi popq %rdi - movq 5608(%rax), %r11 + movq 5632(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5608(%rax), %r11 + movq 5632(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -26483,7 +26566,7 @@ GL_PREFIX(VertexAttrib4svNV): popq %rbp popq %rsi popq %rdi - movq 5608(%rax), %r11 + movq 5632(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib4svNV), .-GL_PREFIX(VertexAttrib4svNV) @@ -26494,7 +26577,7 @@ GL_PREFIX(VertexAttrib4svNV): GL_PREFIX(VertexAttrib4ubNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5616(%rax), %r11 + movq 5640(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -26508,13 +26591,13 @@ GL_PREFIX(VertexAttrib4ubNV): popq %rdx popq %rsi popq %rdi - movq 5616(%rax), %r11 + movq 5640(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5616(%rax), %r11 + movq 5640(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -26528,7 +26611,7 @@ GL_PREFIX(VertexAttrib4ubNV): popq %rdx popq %rsi popq %rdi - movq 5616(%rax), %r11 + movq 5640(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib4ubNV), .-GL_PREFIX(VertexAttrib4ubNV) @@ -26539,7 +26622,7 @@ GL_PREFIX(VertexAttrib4ubNV): GL_PREFIX(VertexAttrib4ubvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5624(%rax), %r11 + movq 5648(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -26549,13 +26632,13 @@ GL_PREFIX(VertexAttrib4ubvNV): popq %rbp popq %rsi popq %rdi - movq 5624(%rax), %r11 + movq 5648(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5624(%rax), %r11 + movq 5648(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -26565,7 +26648,7 @@ GL_PREFIX(VertexAttrib4ubvNV): popq %rbp popq %rsi popq %rdi - movq 5624(%rax), %r11 + movq 5648(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib4ubvNV), .-GL_PREFIX(VertexAttrib4ubvNV) @@ -26576,7 +26659,7 @@ GL_PREFIX(VertexAttrib4ubvNV): GL_PREFIX(VertexAttribPointerNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5632(%rax), %r11 + movq 5656(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -26590,13 +26673,13 @@ GL_PREFIX(VertexAttribPointerNV): popq %rdx popq %rsi popq %rdi - movq 5632(%rax), %r11 + movq 5656(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5632(%rax), %r11 + movq 5656(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -26610,7 +26693,7 @@ GL_PREFIX(VertexAttribPointerNV): popq %rdx popq %rsi popq %rdi - movq 5632(%rax), %r11 + movq 5656(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttribPointerNV), .-GL_PREFIX(VertexAttribPointerNV) @@ -26621,7 +26704,7 @@ GL_PREFIX(VertexAttribPointerNV): GL_PREFIX(VertexAttribs1dvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5640(%rax), %r11 + movq 5664(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -26631,13 +26714,13 @@ GL_PREFIX(VertexAttribs1dvNV): popq %rdx popq %rsi popq %rdi - movq 5640(%rax), %r11 + movq 5664(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5640(%rax), %r11 + movq 5664(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -26647,7 +26730,7 @@ GL_PREFIX(VertexAttribs1dvNV): popq %rdx popq %rsi popq %rdi - movq 5640(%rax), %r11 + movq 5664(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttribs1dvNV), .-GL_PREFIX(VertexAttribs1dvNV) @@ -26658,7 +26741,7 @@ GL_PREFIX(VertexAttribs1dvNV): GL_PREFIX(VertexAttribs1fvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5648(%rax), %r11 + movq 5672(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -26668,13 +26751,13 @@ GL_PREFIX(VertexAttribs1fvNV): popq %rdx popq %rsi popq %rdi - movq 5648(%rax), %r11 + movq 5672(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5648(%rax), %r11 + movq 5672(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -26684,7 +26767,7 @@ GL_PREFIX(VertexAttribs1fvNV): popq %rdx popq %rsi popq %rdi - movq 5648(%rax), %r11 + movq 5672(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttribs1fvNV), .-GL_PREFIX(VertexAttribs1fvNV) @@ -26695,7 +26778,7 @@ GL_PREFIX(VertexAttribs1fvNV): GL_PREFIX(VertexAttribs1svNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5656(%rax), %r11 + movq 5680(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -26705,13 +26788,13 @@ GL_PREFIX(VertexAttribs1svNV): popq %rdx popq %rsi popq %rdi - movq 5656(%rax), %r11 + movq 5680(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5656(%rax), %r11 + movq 5680(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -26721,7 +26804,7 @@ GL_PREFIX(VertexAttribs1svNV): popq %rdx popq %rsi popq %rdi - movq 5656(%rax), %r11 + movq 5680(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttribs1svNV), .-GL_PREFIX(VertexAttribs1svNV) @@ -26732,7 +26815,7 @@ GL_PREFIX(VertexAttribs1svNV): GL_PREFIX(VertexAttribs2dvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5664(%rax), %r11 + movq 5688(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -26742,13 +26825,13 @@ GL_PREFIX(VertexAttribs2dvNV): popq %rdx popq %rsi popq %rdi - movq 5664(%rax), %r11 + movq 5688(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5664(%rax), %r11 + movq 5688(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -26758,7 +26841,7 @@ GL_PREFIX(VertexAttribs2dvNV): popq %rdx popq %rsi popq %rdi - movq 5664(%rax), %r11 + movq 5688(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttribs2dvNV), .-GL_PREFIX(VertexAttribs2dvNV) @@ -26769,7 +26852,7 @@ GL_PREFIX(VertexAttribs2dvNV): GL_PREFIX(VertexAttribs2fvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5672(%rax), %r11 + movq 5696(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -26779,13 +26862,13 @@ GL_PREFIX(VertexAttribs2fvNV): popq %rdx popq %rsi popq %rdi - movq 5672(%rax), %r11 + movq 5696(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5672(%rax), %r11 + movq 5696(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -26795,7 +26878,7 @@ GL_PREFIX(VertexAttribs2fvNV): popq %rdx popq %rsi popq %rdi - movq 5672(%rax), %r11 + movq 5696(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttribs2fvNV), .-GL_PREFIX(VertexAttribs2fvNV) @@ -26806,7 +26889,7 @@ GL_PREFIX(VertexAttribs2fvNV): GL_PREFIX(VertexAttribs2svNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5680(%rax), %r11 + movq 5704(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -26816,13 +26899,13 @@ GL_PREFIX(VertexAttribs2svNV): popq %rdx popq %rsi popq %rdi - movq 5680(%rax), %r11 + movq 5704(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5680(%rax), %r11 + movq 5704(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -26832,7 +26915,7 @@ GL_PREFIX(VertexAttribs2svNV): popq %rdx popq %rsi popq %rdi - movq 5680(%rax), %r11 + movq 5704(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttribs2svNV), .-GL_PREFIX(VertexAttribs2svNV) @@ -26843,7 +26926,7 @@ GL_PREFIX(VertexAttribs2svNV): GL_PREFIX(VertexAttribs3dvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5688(%rax), %r11 + movq 5712(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -26853,13 +26936,13 @@ GL_PREFIX(VertexAttribs3dvNV): popq %rdx popq %rsi popq %rdi - movq 5688(%rax), %r11 + movq 5712(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5688(%rax), %r11 + movq 5712(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -26869,7 +26952,7 @@ GL_PREFIX(VertexAttribs3dvNV): popq %rdx popq %rsi popq %rdi - movq 5688(%rax), %r11 + movq 5712(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttribs3dvNV), .-GL_PREFIX(VertexAttribs3dvNV) @@ -26880,7 +26963,7 @@ GL_PREFIX(VertexAttribs3dvNV): GL_PREFIX(VertexAttribs3fvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5696(%rax), %r11 + movq 5720(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -26890,13 +26973,13 @@ GL_PREFIX(VertexAttribs3fvNV): popq %rdx popq %rsi popq %rdi - movq 5696(%rax), %r11 + movq 5720(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5696(%rax), %r11 + movq 5720(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -26906,7 +26989,7 @@ GL_PREFIX(VertexAttribs3fvNV): popq %rdx popq %rsi popq %rdi - movq 5696(%rax), %r11 + movq 5720(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttribs3fvNV), .-GL_PREFIX(VertexAttribs3fvNV) @@ -26917,7 +27000,7 @@ GL_PREFIX(VertexAttribs3fvNV): GL_PREFIX(VertexAttribs3svNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5704(%rax), %r11 + movq 5728(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -26927,13 +27010,13 @@ GL_PREFIX(VertexAttribs3svNV): popq %rdx popq %rsi popq %rdi - movq 5704(%rax), %r11 + movq 5728(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5704(%rax), %r11 + movq 5728(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -26943,7 +27026,7 @@ GL_PREFIX(VertexAttribs3svNV): popq %rdx popq %rsi popq %rdi - movq 5704(%rax), %r11 + movq 5728(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttribs3svNV), .-GL_PREFIX(VertexAttribs3svNV) @@ -26954,7 +27037,7 @@ GL_PREFIX(VertexAttribs3svNV): GL_PREFIX(VertexAttribs4dvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5712(%rax), %r11 + movq 5736(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -26964,13 +27047,13 @@ GL_PREFIX(VertexAttribs4dvNV): popq %rdx popq %rsi popq %rdi - movq 5712(%rax), %r11 + movq 5736(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5712(%rax), %r11 + movq 5736(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -26980,7 +27063,7 @@ GL_PREFIX(VertexAttribs4dvNV): popq %rdx popq %rsi popq %rdi - movq 5712(%rax), %r11 + movq 5736(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttribs4dvNV), .-GL_PREFIX(VertexAttribs4dvNV) @@ -26991,7 +27074,7 @@ GL_PREFIX(VertexAttribs4dvNV): GL_PREFIX(VertexAttribs4fvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5720(%rax), %r11 + movq 5744(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -27001,13 +27084,13 @@ GL_PREFIX(VertexAttribs4fvNV): popq %rdx popq %rsi popq %rdi - movq 5720(%rax), %r11 + movq 5744(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5720(%rax), %r11 + movq 5744(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -27017,7 +27100,7 @@ GL_PREFIX(VertexAttribs4fvNV): popq %rdx popq %rsi popq %rdi - movq 5720(%rax), %r11 + movq 5744(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttribs4fvNV), .-GL_PREFIX(VertexAttribs4fvNV) @@ -27028,7 +27111,7 @@ GL_PREFIX(VertexAttribs4fvNV): GL_PREFIX(VertexAttribs4svNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5728(%rax), %r11 + movq 5752(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -27038,13 +27121,13 @@ GL_PREFIX(VertexAttribs4svNV): popq %rdx popq %rsi popq %rdi - movq 5728(%rax), %r11 + movq 5752(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5728(%rax), %r11 + movq 5752(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -27054,7 +27137,7 @@ GL_PREFIX(VertexAttribs4svNV): popq %rdx popq %rsi popq %rdi - movq 5728(%rax), %r11 + movq 5752(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttribs4svNV), .-GL_PREFIX(VertexAttribs4svNV) @@ -27065,7 +27148,7 @@ GL_PREFIX(VertexAttribs4svNV): GL_PREFIX(VertexAttribs4ubvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5736(%rax), %r11 + movq 5760(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -27075,13 +27158,13 @@ GL_PREFIX(VertexAttribs4ubvNV): popq %rdx popq %rsi popq %rdi - movq 5736(%rax), %r11 + movq 5760(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5736(%rax), %r11 + movq 5760(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -27091,7 +27174,7 @@ GL_PREFIX(VertexAttribs4ubvNV): popq %rdx popq %rsi popq %rdi - movq 5736(%rax), %r11 + movq 5760(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttribs4ubvNV), .-GL_PREFIX(VertexAttribs4ubvNV) @@ -27102,7 +27185,7 @@ GL_PREFIX(VertexAttribs4ubvNV): GL_PREFIX(AlphaFragmentOp1ATI): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5744(%rax), %r11 + movq 5768(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -27120,13 +27203,13 @@ GL_PREFIX(AlphaFragmentOp1ATI): popq %rdx popq %rsi popq %rdi - movq 5744(%rax), %r11 + movq 5768(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5744(%rax), %r11 + movq 5768(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -27144,7 +27227,7 @@ GL_PREFIX(AlphaFragmentOp1ATI): popq %rdx popq %rsi popq %rdi - movq 5744(%rax), %r11 + movq 5768(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(AlphaFragmentOp1ATI), .-GL_PREFIX(AlphaFragmentOp1ATI) @@ -27155,7 +27238,7 @@ GL_PREFIX(AlphaFragmentOp1ATI): GL_PREFIX(AlphaFragmentOp2ATI): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5752(%rax), %r11 + movq 5776(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -27173,13 +27256,13 @@ GL_PREFIX(AlphaFragmentOp2ATI): popq %rdx popq %rsi popq %rdi - movq 5752(%rax), %r11 + movq 5776(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5752(%rax), %r11 + movq 5776(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -27197,7 +27280,7 @@ GL_PREFIX(AlphaFragmentOp2ATI): popq %rdx popq %rsi popq %rdi - movq 5752(%rax), %r11 + movq 5776(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(AlphaFragmentOp2ATI), .-GL_PREFIX(AlphaFragmentOp2ATI) @@ -27208,7 +27291,7 @@ GL_PREFIX(AlphaFragmentOp2ATI): GL_PREFIX(AlphaFragmentOp3ATI): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5760(%rax), %r11 + movq 5784(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -27226,13 +27309,13 @@ GL_PREFIX(AlphaFragmentOp3ATI): popq %rdx popq %rsi popq %rdi - movq 5760(%rax), %r11 + movq 5784(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5760(%rax), %r11 + movq 5784(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -27250,7 +27333,7 @@ GL_PREFIX(AlphaFragmentOp3ATI): popq %rdx popq %rsi popq %rdi - movq 5760(%rax), %r11 + movq 5784(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(AlphaFragmentOp3ATI), .-GL_PREFIX(AlphaFragmentOp3ATI) @@ -27261,25 +27344,25 @@ GL_PREFIX(AlphaFragmentOp3ATI): GL_PREFIX(BeginFragmentShaderATI): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5768(%rax), %r11 + movq 5792(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rbp call _x86_64_get_dispatch@PLT popq %rbp - movq 5768(%rax), %r11 + movq 5792(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5768(%rax), %r11 + movq 5792(%rax), %r11 jmp *%r11 1: pushq %rbp call _glapi_get_dispatch popq %rbp - movq 5768(%rax), %r11 + movq 5792(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(BeginFragmentShaderATI), .-GL_PREFIX(BeginFragmentShaderATI) @@ -27290,25 +27373,25 @@ GL_PREFIX(BeginFragmentShaderATI): GL_PREFIX(BindFragmentShaderATI): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5776(%rax), %r11 + movq 5800(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 5776(%rax), %r11 + movq 5800(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5776(%rax), %r11 + movq 5800(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 5776(%rax), %r11 + movq 5800(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(BindFragmentShaderATI), .-GL_PREFIX(BindFragmentShaderATI) @@ -27319,7 +27402,7 @@ GL_PREFIX(BindFragmentShaderATI): GL_PREFIX(ColorFragmentOp1ATI): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5784(%rax), %r11 + movq 5808(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -27337,13 +27420,13 @@ GL_PREFIX(ColorFragmentOp1ATI): popq %rdx popq %rsi popq %rdi - movq 5784(%rax), %r11 + movq 5808(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5784(%rax), %r11 + movq 5808(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -27361,7 +27444,7 @@ GL_PREFIX(ColorFragmentOp1ATI): popq %rdx popq %rsi popq %rdi - movq 5784(%rax), %r11 + movq 5808(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(ColorFragmentOp1ATI), .-GL_PREFIX(ColorFragmentOp1ATI) @@ -27372,7 +27455,7 @@ GL_PREFIX(ColorFragmentOp1ATI): GL_PREFIX(ColorFragmentOp2ATI): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5792(%rax), %r11 + movq 5816(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -27390,13 +27473,13 @@ GL_PREFIX(ColorFragmentOp2ATI): popq %rdx popq %rsi popq %rdi - movq 5792(%rax), %r11 + movq 5816(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5792(%rax), %r11 + movq 5816(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -27414,7 +27497,7 @@ GL_PREFIX(ColorFragmentOp2ATI): popq %rdx popq %rsi popq %rdi - movq 5792(%rax), %r11 + movq 5816(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(ColorFragmentOp2ATI), .-GL_PREFIX(ColorFragmentOp2ATI) @@ -27425,7 +27508,7 @@ GL_PREFIX(ColorFragmentOp2ATI): GL_PREFIX(ColorFragmentOp3ATI): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5800(%rax), %r11 + movq 5824(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -27443,13 +27526,13 @@ GL_PREFIX(ColorFragmentOp3ATI): popq %rdx popq %rsi popq %rdi - movq 5800(%rax), %r11 + movq 5824(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5800(%rax), %r11 + movq 5824(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -27467,7 +27550,7 @@ GL_PREFIX(ColorFragmentOp3ATI): popq %rdx popq %rsi popq %rdi - movq 5800(%rax), %r11 + movq 5824(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(ColorFragmentOp3ATI), .-GL_PREFIX(ColorFragmentOp3ATI) @@ -27478,25 +27561,25 @@ GL_PREFIX(ColorFragmentOp3ATI): GL_PREFIX(DeleteFragmentShaderATI): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5808(%rax), %r11 + movq 5832(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 5808(%rax), %r11 + movq 5832(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5808(%rax), %r11 + movq 5832(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 5808(%rax), %r11 + movq 5832(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(DeleteFragmentShaderATI), .-GL_PREFIX(DeleteFragmentShaderATI) @@ -27507,25 +27590,25 @@ GL_PREFIX(DeleteFragmentShaderATI): GL_PREFIX(EndFragmentShaderATI): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5816(%rax), %r11 + movq 5840(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rbp call _x86_64_get_dispatch@PLT popq %rbp - movq 5816(%rax), %r11 + movq 5840(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5816(%rax), %r11 + movq 5840(%rax), %r11 jmp *%r11 1: pushq %rbp call _glapi_get_dispatch popq %rbp - movq 5816(%rax), %r11 + movq 5840(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(EndFragmentShaderATI), .-GL_PREFIX(EndFragmentShaderATI) @@ -27536,25 +27619,25 @@ GL_PREFIX(EndFragmentShaderATI): GL_PREFIX(GenFragmentShadersATI): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5824(%rax), %r11 + movq 5848(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 5824(%rax), %r11 + movq 5848(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5824(%rax), %r11 + movq 5848(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 5824(%rax), %r11 + movq 5848(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GenFragmentShadersATI), .-GL_PREFIX(GenFragmentShadersATI) @@ -27565,7 +27648,7 @@ GL_PREFIX(GenFragmentShadersATI): GL_PREFIX(PassTexCoordATI): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5832(%rax), %r11 + movq 5856(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -27575,13 +27658,13 @@ GL_PREFIX(PassTexCoordATI): popq %rdx popq %rsi popq %rdi - movq 5832(%rax), %r11 + movq 5856(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5832(%rax), %r11 + movq 5856(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -27591,7 +27674,7 @@ GL_PREFIX(PassTexCoordATI): popq %rdx popq %rsi popq %rdi - movq 5832(%rax), %r11 + movq 5856(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(PassTexCoordATI), .-GL_PREFIX(PassTexCoordATI) @@ -27602,7 +27685,7 @@ GL_PREFIX(PassTexCoordATI): GL_PREFIX(SampleMapATI): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5840(%rax), %r11 + movq 5864(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -27612,13 +27695,13 @@ GL_PREFIX(SampleMapATI): popq %rdx popq %rsi popq %rdi - movq 5840(%rax), %r11 + movq 5864(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5840(%rax), %r11 + movq 5864(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -27628,7 +27711,7 @@ GL_PREFIX(SampleMapATI): popq %rdx popq %rsi popq %rdi - movq 5840(%rax), %r11 + movq 5864(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(SampleMapATI), .-GL_PREFIX(SampleMapATI) @@ -27639,7 +27722,7 @@ GL_PREFIX(SampleMapATI): GL_PREFIX(SetFragmentShaderConstantATI): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5848(%rax), %r11 + movq 5872(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -27649,13 +27732,13 @@ GL_PREFIX(SetFragmentShaderConstantATI): popq %rbp popq %rsi popq %rdi - movq 5848(%rax), %r11 + movq 5872(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5848(%rax), %r11 + movq 5872(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -27665,7 +27748,7 @@ GL_PREFIX(SetFragmentShaderConstantATI): popq %rbp popq %rsi popq %rdi - movq 5848(%rax), %r11 + movq 5872(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(SetFragmentShaderConstantATI), .-GL_PREFIX(SetFragmentShaderConstantATI) @@ -27676,7 +27759,7 @@ GL_PREFIX(SetFragmentShaderConstantATI): GL_PREFIX(PointParameteriNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5856(%rax), %r11 + movq 5880(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -27686,13 +27769,13 @@ GL_PREFIX(PointParameteriNV): popq %rbp popq %rsi popq %rdi - movq 5856(%rax), %r11 + movq 5880(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5856(%rax), %r11 + movq 5880(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -27702,7 +27785,7 @@ GL_PREFIX(PointParameteriNV): popq %rbp popq %rsi popq %rdi - movq 5856(%rax), %r11 + movq 5880(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(PointParameteriNV), .-GL_PREFIX(PointParameteriNV) @@ -27713,7 +27796,7 @@ GL_PREFIX(PointParameteriNV): GL_PREFIX(PointParameterivNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5864(%rax), %r11 + movq 5888(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -27723,13 +27806,13 @@ GL_PREFIX(PointParameterivNV): popq %rbp popq %rsi popq %rdi - movq 5864(%rax), %r11 + movq 5888(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5864(%rax), %r11 + movq 5888(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -27739,79 +27822,79 @@ GL_PREFIX(PointParameterivNV): popq %rbp popq %rsi popq %rdi - movq 5864(%rax), %r11 + movq 5888(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(PointParameterivNV), .-GL_PREFIX(PointParameterivNV) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_734) - .type GL_PREFIX(_dispatch_stub_734), @function - HIDDEN(GL_PREFIX(_dispatch_stub_734)) -GL_PREFIX(_dispatch_stub_734): + .globl GL_PREFIX(_dispatch_stub_737) + .type GL_PREFIX(_dispatch_stub_737), @function + HIDDEN(GL_PREFIX(_dispatch_stub_737)) +GL_PREFIX(_dispatch_stub_737): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5872(%rax), %r11 + movq 5896(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 5872(%rax), %r11 + movq 5896(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5872(%rax), %r11 + movq 5896(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 5872(%rax), %r11 + movq 5896(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_734), .-GL_PREFIX(_dispatch_stub_734) + .size GL_PREFIX(_dispatch_stub_737), .-GL_PREFIX(_dispatch_stub_737) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_735) - .type GL_PREFIX(_dispatch_stub_735), @function - HIDDEN(GL_PREFIX(_dispatch_stub_735)) -GL_PREFIX(_dispatch_stub_735): + .globl GL_PREFIX(_dispatch_stub_738) + .type GL_PREFIX(_dispatch_stub_738), @function + HIDDEN(GL_PREFIX(_dispatch_stub_738)) +GL_PREFIX(_dispatch_stub_738): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5880(%rax), %r11 + movq 5904(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 5880(%rax), %r11 + movq 5904(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5880(%rax), %r11 + movq 5904(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 5880(%rax), %r11 + movq 5904(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_735), .-GL_PREFIX(_dispatch_stub_735) + .size GL_PREFIX(_dispatch_stub_738), .-GL_PREFIX(_dispatch_stub_738) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_736) - .type GL_PREFIX(_dispatch_stub_736), @function - HIDDEN(GL_PREFIX(_dispatch_stub_736)) -GL_PREFIX(_dispatch_stub_736): + .globl GL_PREFIX(_dispatch_stub_739) + .type GL_PREFIX(_dispatch_stub_739), @function + HIDDEN(GL_PREFIX(_dispatch_stub_739)) +GL_PREFIX(_dispatch_stub_739): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5888(%rax), %r11 + movq 5912(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -27821,13 +27904,13 @@ GL_PREFIX(_dispatch_stub_736): popq %rbp popq %rsi popq %rdi - movq 5888(%rax), %r11 + movq 5912(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5888(%rax), %r11 + movq 5912(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -27837,19 +27920,19 @@ GL_PREFIX(_dispatch_stub_736): popq %rbp popq %rsi popq %rdi - movq 5888(%rax), %r11 + movq 5912(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_736), .-GL_PREFIX(_dispatch_stub_736) + .size GL_PREFIX(_dispatch_stub_739), .-GL_PREFIX(_dispatch_stub_739) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_737) - .type GL_PREFIX(_dispatch_stub_737), @function - HIDDEN(GL_PREFIX(_dispatch_stub_737)) -GL_PREFIX(_dispatch_stub_737): + .globl GL_PREFIX(_dispatch_stub_740) + .type GL_PREFIX(_dispatch_stub_740), @function + HIDDEN(GL_PREFIX(_dispatch_stub_740)) +GL_PREFIX(_dispatch_stub_740): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5896(%rax), %r11 + movq 5920(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -27859,13 +27942,13 @@ GL_PREFIX(_dispatch_stub_737): popq %rbp popq %rsi popq %rdi - movq 5896(%rax), %r11 + movq 5920(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5896(%rax), %r11 + movq 5920(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -27875,40 +27958,40 @@ GL_PREFIX(_dispatch_stub_737): popq %rbp popq %rsi popq %rdi - movq 5896(%rax), %r11 + movq 5920(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_737), .-GL_PREFIX(_dispatch_stub_737) + .size GL_PREFIX(_dispatch_stub_740), .-GL_PREFIX(_dispatch_stub_740) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_738) - .type GL_PREFIX(_dispatch_stub_738), @function - HIDDEN(GL_PREFIX(_dispatch_stub_738)) -GL_PREFIX(_dispatch_stub_738): + .globl GL_PREFIX(_dispatch_stub_741) + .type GL_PREFIX(_dispatch_stub_741), @function + HIDDEN(GL_PREFIX(_dispatch_stub_741)) +GL_PREFIX(_dispatch_stub_741): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5904(%rax), %r11 + movq 5928(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 5904(%rax), %r11 + movq 5928(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5904(%rax), %r11 + movq 5928(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 5904(%rax), %r11 + movq 5928(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_738), .-GL_PREFIX(_dispatch_stub_738) + .size GL_PREFIX(_dispatch_stub_741), .-GL_PREFIX(_dispatch_stub_741) .p2align 4,,15 .globl GL_PREFIX(GetProgramNamedParameterdvNV) @@ -27916,7 +27999,7 @@ GL_PREFIX(_dispatch_stub_738): GL_PREFIX(GetProgramNamedParameterdvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5912(%rax), %r11 + movq 5936(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -27930,13 +28013,13 @@ GL_PREFIX(GetProgramNamedParameterdvNV): popq %rdx popq %rsi popq %rdi - movq 5912(%rax), %r11 + movq 5936(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5912(%rax), %r11 + movq 5936(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -27950,7 +28033,7 @@ GL_PREFIX(GetProgramNamedParameterdvNV): popq %rdx popq %rsi popq %rdi - movq 5912(%rax), %r11 + movq 5936(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GetProgramNamedParameterdvNV), .-GL_PREFIX(GetProgramNamedParameterdvNV) @@ -27961,7 +28044,7 @@ GL_PREFIX(GetProgramNamedParameterdvNV): GL_PREFIX(GetProgramNamedParameterfvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5920(%rax), %r11 + movq 5944(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -27975,13 +28058,13 @@ GL_PREFIX(GetProgramNamedParameterfvNV): popq %rdx popq %rsi popq %rdi - movq 5920(%rax), %r11 + movq 5944(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5920(%rax), %r11 + movq 5944(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -27995,7 +28078,7 @@ GL_PREFIX(GetProgramNamedParameterfvNV): popq %rdx popq %rsi popq %rdi - movq 5920(%rax), %r11 + movq 5944(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GetProgramNamedParameterfvNV), .-GL_PREFIX(GetProgramNamedParameterfvNV) @@ -28006,7 +28089,7 @@ GL_PREFIX(GetProgramNamedParameterfvNV): GL_PREFIX(ProgramNamedParameter4dNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5928(%rax), %r11 + movq 5952(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) subq $56, %rsp @@ -28026,13 +28109,13 @@ GL_PREFIX(ProgramNamedParameter4dNV): movq 8(%rsp), %rsi movq (%rsp), %rdi addq $56, %rsp - movq 5928(%rax), %r11 + movq 5952(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5928(%rax), %r11 + movq 5952(%rax), %r11 jmp *%r11 1: subq $56, %rsp @@ -28052,7 +28135,7 @@ GL_PREFIX(ProgramNamedParameter4dNV): movq 8(%rsp), %rsi movq (%rsp), %rdi addq $56, %rsp - movq 5928(%rax), %r11 + movq 5952(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(ProgramNamedParameter4dNV), .-GL_PREFIX(ProgramNamedParameter4dNV) @@ -28063,7 +28146,7 @@ GL_PREFIX(ProgramNamedParameter4dNV): GL_PREFIX(ProgramNamedParameter4dvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5936(%rax), %r11 + movq 5960(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -28077,13 +28160,13 @@ GL_PREFIX(ProgramNamedParameter4dvNV): popq %rdx popq %rsi popq %rdi - movq 5936(%rax), %r11 + movq 5960(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5936(%rax), %r11 + movq 5960(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -28097,7 +28180,7 @@ GL_PREFIX(ProgramNamedParameter4dvNV): popq %rdx popq %rsi popq %rdi - movq 5936(%rax), %r11 + movq 5960(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(ProgramNamedParameter4dvNV), .-GL_PREFIX(ProgramNamedParameter4dvNV) @@ -28108,7 +28191,7 @@ GL_PREFIX(ProgramNamedParameter4dvNV): GL_PREFIX(ProgramNamedParameter4fNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5944(%rax), %r11 + movq 5968(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) subq $56, %rsp @@ -28128,13 +28211,13 @@ GL_PREFIX(ProgramNamedParameter4fNV): movq 8(%rsp), %rsi movq (%rsp), %rdi addq $56, %rsp - movq 5944(%rax), %r11 + movq 5968(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5944(%rax), %r11 + movq 5968(%rax), %r11 jmp *%r11 1: subq $56, %rsp @@ -28154,7 +28237,7 @@ GL_PREFIX(ProgramNamedParameter4fNV): movq 8(%rsp), %rsi movq (%rsp), %rdi addq $56, %rsp - movq 5944(%rax), %r11 + movq 5968(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(ProgramNamedParameter4fNV), .-GL_PREFIX(ProgramNamedParameter4fNV) @@ -28165,7 +28248,7 @@ GL_PREFIX(ProgramNamedParameter4fNV): GL_PREFIX(ProgramNamedParameter4fvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5952(%rax), %r11 + movq 5976(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -28179,13 +28262,13 @@ GL_PREFIX(ProgramNamedParameter4fvNV): popq %rdx popq %rsi popq %rdi - movq 5952(%rax), %r11 + movq 5976(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5952(%rax), %r11 + movq 5976(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -28199,19 +28282,19 @@ GL_PREFIX(ProgramNamedParameter4fvNV): popq %rdx popq %rsi popq %rdi - movq 5952(%rax), %r11 + movq 5976(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(ProgramNamedParameter4fvNV), .-GL_PREFIX(ProgramNamedParameter4fvNV) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_745) - .type GL_PREFIX(_dispatch_stub_745), @function - HIDDEN(GL_PREFIX(_dispatch_stub_745)) -GL_PREFIX(_dispatch_stub_745): + .globl GL_PREFIX(_dispatch_stub_748) + .type GL_PREFIX(_dispatch_stub_748), @function + HIDDEN(GL_PREFIX(_dispatch_stub_748)) +GL_PREFIX(_dispatch_stub_748): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5960(%rax), %r11 + movq 5984(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -28221,13 +28304,13 @@ GL_PREFIX(_dispatch_stub_745): popq %rbp popq %rsi popq %rdi - movq 5960(%rax), %r11 + movq 5984(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5960(%rax), %r11 + movq 5984(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -28237,19 +28320,19 @@ GL_PREFIX(_dispatch_stub_745): popq %rbp popq %rsi popq %rdi - movq 5960(%rax), %r11 + movq 5984(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_745), .-GL_PREFIX(_dispatch_stub_745) + .size GL_PREFIX(_dispatch_stub_748), .-GL_PREFIX(_dispatch_stub_748) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_746) - .type GL_PREFIX(_dispatch_stub_746), @function - HIDDEN(GL_PREFIX(_dispatch_stub_746)) -GL_PREFIX(_dispatch_stub_746): + .globl GL_PREFIX(_dispatch_stub_749) + .type GL_PREFIX(_dispatch_stub_749), @function + HIDDEN(GL_PREFIX(_dispatch_stub_749)) +GL_PREFIX(_dispatch_stub_749): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5968(%rax), %r11 + movq 5992(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -28259,13 +28342,13 @@ GL_PREFIX(_dispatch_stub_746): popq %rbp popq %rsi popq %rdi - movq 5968(%rax), %r11 + movq 5992(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5968(%rax), %r11 + movq 5992(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -28275,10 +28358,10 @@ GL_PREFIX(_dispatch_stub_746): popq %rbp popq %rsi popq %rdi - movq 5968(%rax), %r11 + movq 5992(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_746), .-GL_PREFIX(_dispatch_stub_746) + .size GL_PREFIX(_dispatch_stub_749), .-GL_PREFIX(_dispatch_stub_749) .p2align 4,,15 .globl GL_PREFIX(BindFramebufferEXT) @@ -28286,7 +28369,7 @@ GL_PREFIX(_dispatch_stub_746): GL_PREFIX(BindFramebufferEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5976(%rax), %r11 + movq 6000(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -28296,13 +28379,13 @@ GL_PREFIX(BindFramebufferEXT): popq %rbp popq %rsi popq %rdi - movq 5976(%rax), %r11 + movq 6000(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5976(%rax), %r11 + movq 6000(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -28312,7 +28395,7 @@ GL_PREFIX(BindFramebufferEXT): popq %rbp popq %rsi popq %rdi - movq 5976(%rax), %r11 + movq 6000(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(BindFramebufferEXT), .-GL_PREFIX(BindFramebufferEXT) @@ -28323,7 +28406,7 @@ GL_PREFIX(BindFramebufferEXT): GL_PREFIX(BindRenderbufferEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5984(%rax), %r11 + movq 6008(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -28333,13 +28416,13 @@ GL_PREFIX(BindRenderbufferEXT): popq %rbp popq %rsi popq %rdi - movq 5984(%rax), %r11 + movq 6008(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5984(%rax), %r11 + movq 6008(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -28349,7 +28432,7 @@ GL_PREFIX(BindRenderbufferEXT): popq %rbp popq %rsi popq %rdi - movq 5984(%rax), %r11 + movq 6008(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(BindRenderbufferEXT), .-GL_PREFIX(BindRenderbufferEXT) @@ -28360,25 +28443,25 @@ GL_PREFIX(BindRenderbufferEXT): GL_PREFIX(CheckFramebufferStatusEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5992(%rax), %r11 + movq 6016(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 5992(%rax), %r11 + movq 6016(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5992(%rax), %r11 + movq 6016(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 5992(%rax), %r11 + movq 6016(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(CheckFramebufferStatusEXT), .-GL_PREFIX(CheckFramebufferStatusEXT) @@ -28389,7 +28472,7 @@ GL_PREFIX(CheckFramebufferStatusEXT): GL_PREFIX(DeleteFramebuffersEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6000(%rax), %r11 + movq 6024(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -28399,13 +28482,13 @@ GL_PREFIX(DeleteFramebuffersEXT): popq %rbp popq %rsi popq %rdi - movq 6000(%rax), %r11 + movq 6024(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6000(%rax), %r11 + movq 6024(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -28415,7 +28498,7 @@ GL_PREFIX(DeleteFramebuffersEXT): popq %rbp popq %rsi popq %rdi - movq 6000(%rax), %r11 + movq 6024(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(DeleteFramebuffersEXT), .-GL_PREFIX(DeleteFramebuffersEXT) @@ -28426,7 +28509,7 @@ GL_PREFIX(DeleteFramebuffersEXT): GL_PREFIX(DeleteRenderbuffersEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6008(%rax), %r11 + movq 6032(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -28436,13 +28519,13 @@ GL_PREFIX(DeleteRenderbuffersEXT): popq %rbp popq %rsi popq %rdi - movq 6008(%rax), %r11 + movq 6032(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6008(%rax), %r11 + movq 6032(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -28452,7 +28535,7 @@ GL_PREFIX(DeleteRenderbuffersEXT): popq %rbp popq %rsi popq %rdi - movq 6008(%rax), %r11 + movq 6032(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(DeleteRenderbuffersEXT), .-GL_PREFIX(DeleteRenderbuffersEXT) @@ -28463,7 +28546,7 @@ GL_PREFIX(DeleteRenderbuffersEXT): GL_PREFIX(FramebufferRenderbufferEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6016(%rax), %r11 + movq 6040(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -28477,13 +28560,13 @@ GL_PREFIX(FramebufferRenderbufferEXT): popq %rdx popq %rsi popq %rdi - movq 6016(%rax), %r11 + movq 6040(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6016(%rax), %r11 + movq 6040(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -28497,7 +28580,7 @@ GL_PREFIX(FramebufferRenderbufferEXT): popq %rdx popq %rsi popq %rdi - movq 6016(%rax), %r11 + movq 6040(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(FramebufferRenderbufferEXT), .-GL_PREFIX(FramebufferRenderbufferEXT) @@ -28508,7 +28591,7 @@ GL_PREFIX(FramebufferRenderbufferEXT): GL_PREFIX(FramebufferTexture1DEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6024(%rax), %r11 + movq 6048(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -28522,13 +28605,13 @@ GL_PREFIX(FramebufferTexture1DEXT): popq %rdx popq %rsi popq %rdi - movq 6024(%rax), %r11 + movq 6048(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6024(%rax), %r11 + movq 6048(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -28542,7 +28625,7 @@ GL_PREFIX(FramebufferTexture1DEXT): popq %rdx popq %rsi popq %rdi - movq 6024(%rax), %r11 + movq 6048(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(FramebufferTexture1DEXT), .-GL_PREFIX(FramebufferTexture1DEXT) @@ -28553,7 +28636,7 @@ GL_PREFIX(FramebufferTexture1DEXT): GL_PREFIX(FramebufferTexture2DEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6032(%rax), %r11 + movq 6056(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -28567,13 +28650,13 @@ GL_PREFIX(FramebufferTexture2DEXT): popq %rdx popq %rsi popq %rdi - movq 6032(%rax), %r11 + movq 6056(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6032(%rax), %r11 + movq 6056(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -28587,7 +28670,7 @@ GL_PREFIX(FramebufferTexture2DEXT): popq %rdx popq %rsi popq %rdi - movq 6032(%rax), %r11 + movq 6056(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(FramebufferTexture2DEXT), .-GL_PREFIX(FramebufferTexture2DEXT) @@ -28598,7 +28681,7 @@ GL_PREFIX(FramebufferTexture2DEXT): GL_PREFIX(FramebufferTexture3DEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6040(%rax), %r11 + movq 6064(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -28616,13 +28699,13 @@ GL_PREFIX(FramebufferTexture3DEXT): popq %rdx popq %rsi popq %rdi - movq 6040(%rax), %r11 + movq 6064(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6040(%rax), %r11 + movq 6064(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -28640,7 +28723,7 @@ GL_PREFIX(FramebufferTexture3DEXT): popq %rdx popq %rsi popq %rdi - movq 6040(%rax), %r11 + movq 6064(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(FramebufferTexture3DEXT), .-GL_PREFIX(FramebufferTexture3DEXT) @@ -28651,7 +28734,7 @@ GL_PREFIX(FramebufferTexture3DEXT): GL_PREFIX(GenFramebuffersEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6048(%rax), %r11 + movq 6072(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -28661,13 +28744,13 @@ GL_PREFIX(GenFramebuffersEXT): popq %rbp popq %rsi popq %rdi - movq 6048(%rax), %r11 + movq 6072(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6048(%rax), %r11 + movq 6072(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -28677,7 +28760,7 @@ GL_PREFIX(GenFramebuffersEXT): popq %rbp popq %rsi popq %rdi - movq 6048(%rax), %r11 + movq 6072(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GenFramebuffersEXT), .-GL_PREFIX(GenFramebuffersEXT) @@ -28688,7 +28771,7 @@ GL_PREFIX(GenFramebuffersEXT): GL_PREFIX(GenRenderbuffersEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6056(%rax), %r11 + movq 6080(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -28698,13 +28781,13 @@ GL_PREFIX(GenRenderbuffersEXT): popq %rbp popq %rsi popq %rdi - movq 6056(%rax), %r11 + movq 6080(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6056(%rax), %r11 + movq 6080(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -28714,7 +28797,7 @@ GL_PREFIX(GenRenderbuffersEXT): popq %rbp popq %rsi popq %rdi - movq 6056(%rax), %r11 + movq 6080(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GenRenderbuffersEXT), .-GL_PREFIX(GenRenderbuffersEXT) @@ -28725,25 +28808,25 @@ GL_PREFIX(GenRenderbuffersEXT): GL_PREFIX(GenerateMipmapEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6064(%rax), %r11 + movq 6088(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 6064(%rax), %r11 + movq 6088(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6064(%rax), %r11 + movq 6088(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 6064(%rax), %r11 + movq 6088(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GenerateMipmapEXT), .-GL_PREFIX(GenerateMipmapEXT) @@ -28754,7 +28837,7 @@ GL_PREFIX(GenerateMipmapEXT): GL_PREFIX(GetFramebufferAttachmentParameterivEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6072(%rax), %r11 + movq 6096(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -28768,13 +28851,13 @@ GL_PREFIX(GetFramebufferAttachmentParameterivEXT): popq %rdx popq %rsi popq %rdi - movq 6072(%rax), %r11 + movq 6096(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6072(%rax), %r11 + movq 6096(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -28788,19 +28871,18 @@ GL_PREFIX(GetFramebufferAttachmentParameterivEXT): popq %rdx popq %rsi popq %rdi - movq 6072(%rax), %r11 + movq 6096(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GetFramebufferAttachmentParameterivEXT), .-GL_PREFIX(GetFramebufferAttachmentParameterivEXT) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_760) - .type GL_PREFIX(_dispatch_stub_760), @function - HIDDEN(GL_PREFIX(_dispatch_stub_760)) -GL_PREFIX(_dispatch_stub_760): + .globl GL_PREFIX(GetRenderbufferParameterivEXT) + .type GL_PREFIX(GetRenderbufferParameterivEXT), @function +GL_PREFIX(GetRenderbufferParameterivEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6080(%rax), %r11 + movq 6104(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -28810,13 +28892,13 @@ GL_PREFIX(_dispatch_stub_760): popq %rdx popq %rsi popq %rdi - movq 6080(%rax), %r11 + movq 6104(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6080(%rax), %r11 + movq 6104(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -28826,151 +28908,176 @@ GL_PREFIX(_dispatch_stub_760): popq %rdx popq %rsi popq %rdi - movq 6080(%rax), %r11 + movq 6104(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_760), .-GL_PREFIX(_dispatch_stub_760) + .size GL_PREFIX(GetRenderbufferParameterivEXT), .-GL_PREFIX(GetRenderbufferParameterivEXT) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_761) - .type GL_PREFIX(_dispatch_stub_761), @function - HIDDEN(GL_PREFIX(_dispatch_stub_761)) -GL_PREFIX(_dispatch_stub_761): + .globl GL_PREFIX(IsFramebufferEXT) + .type GL_PREFIX(IsFramebufferEXT), @function +GL_PREFIX(IsFramebufferEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6088(%rax), %r11 + movq 6112(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi - pushq %rsi - pushq %rdx call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi popq %rdi - movq 6088(%rax), %r11 + movq 6112(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6088(%rax), %r11 + movq 6112(%rax), %r11 jmp *%r11 1: pushq %rdi - pushq %rsi - pushq %rdx call _glapi_get_dispatch - popq %rdx - popq %rsi popq %rdi - movq 6088(%rax), %r11 + movq 6112(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_761), .-GL_PREFIX(_dispatch_stub_761) + .size GL_PREFIX(IsFramebufferEXT), .-GL_PREFIX(IsFramebufferEXT) .p2align 4,,15 - .globl GL_PREFIX(GetRenderbufferParameterivEXT) - .type GL_PREFIX(GetRenderbufferParameterivEXT), @function -GL_PREFIX(GetRenderbufferParameterivEXT): + .globl GL_PREFIX(IsRenderbufferEXT) + .type GL_PREFIX(IsRenderbufferEXT), @function +GL_PREFIX(IsRenderbufferEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6096(%rax), %r11 + movq 6120(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi - pushq %rsi - pushq %rdx call _x86_64_get_dispatch@PLT - popq %rdx - popq %rsi popq %rdi - movq 6096(%rax), %r11 + movq 6120(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6096(%rax), %r11 + movq 6120(%rax), %r11 jmp *%r11 1: pushq %rdi - pushq %rsi - pushq %rdx call _glapi_get_dispatch - popq %rdx - popq %rsi popq %rdi - movq 6096(%rax), %r11 + movq 6120(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(GetRenderbufferParameterivEXT), .-GL_PREFIX(GetRenderbufferParameterivEXT) + .size GL_PREFIX(IsRenderbufferEXT), .-GL_PREFIX(IsRenderbufferEXT) .p2align 4,,15 - .globl GL_PREFIX(IsFramebufferEXT) - .type GL_PREFIX(IsFramebufferEXT), @function -GL_PREFIX(IsFramebufferEXT): + .globl GL_PREFIX(RenderbufferStorageEXT) + .type GL_PREFIX(RenderbufferStorageEXT), @function +GL_PREFIX(RenderbufferStorageEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6104(%rax), %r11 + movq 6128(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi + pushq %rsi + pushq %rdx + pushq %rcx + pushq %rbp call _x86_64_get_dispatch@PLT + popq %rbp + popq %rcx + popq %rdx + popq %rsi popq %rdi - movq 6104(%rax), %r11 + movq 6128(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6104(%rax), %r11 + movq 6128(%rax), %r11 jmp *%r11 1: pushq %rdi + pushq %rsi + pushq %rdx + pushq %rcx + pushq %rbp call _glapi_get_dispatch + popq %rbp + popq %rcx + popq %rdx + popq %rsi popq %rdi - movq 6104(%rax), %r11 + movq 6128(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(IsFramebufferEXT), .-GL_PREFIX(IsFramebufferEXT) + .size GL_PREFIX(RenderbufferStorageEXT), .-GL_PREFIX(RenderbufferStorageEXT) .p2align 4,,15 - .globl GL_PREFIX(IsRenderbufferEXT) - .type GL_PREFIX(IsRenderbufferEXT), @function -GL_PREFIX(IsRenderbufferEXT): + .globl GL_PREFIX(_dispatch_stub_767) + .type GL_PREFIX(_dispatch_stub_767), @function + HIDDEN(GL_PREFIX(_dispatch_stub_767)) +GL_PREFIX(_dispatch_stub_767): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6112(%rax), %r11 + movq 6136(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi + pushq %rsi + pushq %rdx + pushq %rcx + pushq %r8 + pushq %r9 + pushq %rbp call _x86_64_get_dispatch@PLT + popq %rbp + popq %r9 + popq %r8 + popq %rcx + popq %rdx + popq %rsi popq %rdi - movq 6112(%rax), %r11 + movq 6136(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6112(%rax), %r11 + movq 6136(%rax), %r11 jmp *%r11 1: pushq %rdi + pushq %rsi + pushq %rdx + pushq %rcx + pushq %r8 + pushq %r9 + pushq %rbp call _glapi_get_dispatch + popq %rbp + popq %r9 + popq %r8 + popq %rcx + popq %rdx + popq %rsi popq %rdi - movq 6112(%rax), %r11 + movq 6136(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(IsRenderbufferEXT), .-GL_PREFIX(IsRenderbufferEXT) + .size GL_PREFIX(_dispatch_stub_767), .-GL_PREFIX(_dispatch_stub_767) .p2align 4,,15 - .globl GL_PREFIX(RenderbufferStorageEXT) - .type GL_PREFIX(RenderbufferStorageEXT), @function -GL_PREFIX(RenderbufferStorageEXT): + .globl GL_PREFIX(_dispatch_stub_768) + .type GL_PREFIX(_dispatch_stub_768), @function + HIDDEN(GL_PREFIX(_dispatch_stub_768)) +GL_PREFIX(_dispatch_stub_768): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6120(%rax), %r11 + movq 6144(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -28984,13 +29091,13 @@ GL_PREFIX(RenderbufferStorageEXT): popq %rdx popq %rsi popq %rdi - movq 6120(%rax), %r11 + movq 6144(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6120(%rax), %r11 + movq 6144(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -29004,166 +29111,153 @@ GL_PREFIX(RenderbufferStorageEXT): popq %rdx popq %rsi popq %rdi - movq 6120(%rax), %r11 + movq 6144(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(RenderbufferStorageEXT), .-GL_PREFIX(RenderbufferStorageEXT) + .size GL_PREFIX(_dispatch_stub_768), .-GL_PREFIX(_dispatch_stub_768) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_766) - .type GL_PREFIX(_dispatch_stub_766), @function - HIDDEN(GL_PREFIX(_dispatch_stub_766)) -GL_PREFIX(_dispatch_stub_766): + .globl GL_PREFIX(_dispatch_stub_769) + .type GL_PREFIX(_dispatch_stub_769), @function + HIDDEN(GL_PREFIX(_dispatch_stub_769)) +GL_PREFIX(_dispatch_stub_769): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6128(%rax), %r11 + movq 6152(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi pushq %rsi pushq %rdx pushq %rcx - pushq %r8 - pushq %r9 pushq %rbp call _x86_64_get_dispatch@PLT popq %rbp - popq %r9 - popq %r8 popq %rcx popq %rdx popq %rsi popq %rdi - movq 6128(%rax), %r11 + movq 6152(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6128(%rax), %r11 + movq 6152(%rax), %r11 jmp *%r11 1: pushq %rdi pushq %rsi pushq %rdx pushq %rcx - pushq %r8 - pushq %r9 pushq %rbp call _glapi_get_dispatch popq %rbp - popq %r9 - popq %r8 popq %rcx popq %rdx popq %rsi popq %rdi - movq 6128(%rax), %r11 + movq 6152(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_766), .-GL_PREFIX(_dispatch_stub_766) + .size GL_PREFIX(_dispatch_stub_769), .-GL_PREFIX(_dispatch_stub_769) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_767) - .type GL_PREFIX(_dispatch_stub_767), @function - HIDDEN(GL_PREFIX(_dispatch_stub_767)) -GL_PREFIX(_dispatch_stub_767): + .globl GL_PREFIX(_dispatch_stub_770) + .type GL_PREFIX(_dispatch_stub_770), @function + HIDDEN(GL_PREFIX(_dispatch_stub_770)) +GL_PREFIX(_dispatch_stub_770): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6136(%rax), %r11 + movq 6160(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi pushq %rsi pushq %rdx - pushq %rcx - pushq %rbp call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx popq %rdx popq %rsi popq %rdi - movq 6136(%rax), %r11 + movq 6160(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6136(%rax), %r11 + movq 6160(%rax), %r11 jmp *%r11 1: pushq %rdi pushq %rsi pushq %rdx - pushq %rcx - pushq %rbp call _glapi_get_dispatch - popq %rbp - popq %rcx popq %rdx popq %rsi popq %rdi - movq 6136(%rax), %r11 + movq 6160(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_767), .-GL_PREFIX(_dispatch_stub_767) + .size GL_PREFIX(_dispatch_stub_770), .-GL_PREFIX(_dispatch_stub_770) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_768) - .type GL_PREFIX(_dispatch_stub_768), @function - HIDDEN(GL_PREFIX(_dispatch_stub_768)) -GL_PREFIX(_dispatch_stub_768): + .globl GL_PREFIX(_dispatch_stub_771) + .type GL_PREFIX(_dispatch_stub_771), @function + HIDDEN(GL_PREFIX(_dispatch_stub_771)) +GL_PREFIX(_dispatch_stub_771): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6144(%rax), %r11 + movq 6168(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi pushq %rsi pushq %rdx - pushq %rcx - pushq %rbp call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx popq %rdx popq %rsi popq %rdi - movq 6144(%rax), %r11 + movq 6168(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6144(%rax), %r11 + movq 6168(%rax), %r11 jmp *%r11 1: pushq %rdi pushq %rsi pushq %rdx - pushq %rcx - pushq %rbp call _glapi_get_dispatch - popq %rbp - popq %rcx popq %rdx popq %rsi popq %rdi - movq 6144(%rax), %r11 + movq 6168(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_768), .-GL_PREFIX(_dispatch_stub_768) + .size GL_PREFIX(_dispatch_stub_771), .-GL_PREFIX(_dispatch_stub_771) .globl GL_PREFIX(ArrayElementEXT) ; .set GL_PREFIX(ArrayElementEXT), GL_PREFIX(ArrayElement) .globl GL_PREFIX(BindTextureEXT) ; .set GL_PREFIX(BindTextureEXT), GL_PREFIX(BindTexture) .globl GL_PREFIX(DrawArraysEXT) ; .set GL_PREFIX(DrawArraysEXT), GL_PREFIX(DrawArrays) +#ifndef GLX_INDIRECT_RENDERING + .globl GL_PREFIX(AreTexturesResidentEXT) ; .set GL_PREFIX(AreTexturesResidentEXT), GL_PREFIX(AreTexturesResident) +#endif .globl GL_PREFIX(CopyTexImage1DEXT) ; .set GL_PREFIX(CopyTexImage1DEXT), GL_PREFIX(CopyTexImage1D) .globl GL_PREFIX(CopyTexImage2DEXT) ; .set GL_PREFIX(CopyTexImage2DEXT), GL_PREFIX(CopyTexImage2D) .globl GL_PREFIX(CopyTexSubImage1DEXT) ; .set GL_PREFIX(CopyTexSubImage1DEXT), GL_PREFIX(CopyTexSubImage1D) .globl GL_PREFIX(CopyTexSubImage2DEXT) ; .set GL_PREFIX(CopyTexSubImage2DEXT), GL_PREFIX(CopyTexSubImage2D) +#ifndef GLX_INDIRECT_RENDERING .globl GL_PREFIX(DeleteTexturesEXT) ; .set GL_PREFIX(DeleteTexturesEXT), GL_PREFIX(DeleteTextures) +#endif +#ifndef GLX_INDIRECT_RENDERING + .globl GL_PREFIX(GenTexturesEXT) ; .set GL_PREFIX(GenTexturesEXT), GL_PREFIX(GenTextures) +#endif .globl GL_PREFIX(GetPointervEXT) ; .set GL_PREFIX(GetPointervEXT), GL_PREFIX(GetPointerv) +#ifndef GLX_INDIRECT_RENDERING + .globl GL_PREFIX(IsTextureEXT) ; .set GL_PREFIX(IsTextureEXT), GL_PREFIX(IsTexture) +#endif .globl GL_PREFIX(PrioritizeTexturesEXT) ; .set GL_PREFIX(PrioritizeTexturesEXT), GL_PREFIX(PrioritizeTextures) .globl GL_PREFIX(TexSubImage1DEXT) ; .set GL_PREFIX(TexSubImage1DEXT), GL_PREFIX(TexSubImage1D) .globl GL_PREFIX(TexSubImage2DEXT) ; .set GL_PREFIX(TexSubImage2DEXT), GL_PREFIX(TexSubImage2D) @@ -29171,6 +29265,15 @@ GL_PREFIX(_dispatch_stub_768): .globl GL_PREFIX(BlendEquationEXT) ; .set GL_PREFIX(BlendEquationEXT), GL_PREFIX(BlendEquation) .globl GL_PREFIX(DrawRangeElementsEXT) ; .set GL_PREFIX(DrawRangeElementsEXT), GL_PREFIX(DrawRangeElements) .globl GL_PREFIX(ColorTableEXT) ; .set GL_PREFIX(ColorTableEXT), GL_PREFIX(ColorTable) +#ifndef GLX_INDIRECT_RENDERING + .globl GL_PREFIX(GetColorTableEXT) ; .set GL_PREFIX(GetColorTableEXT), GL_PREFIX(GetColorTable) +#endif +#ifndef GLX_INDIRECT_RENDERING + .globl GL_PREFIX(GetColorTableParameterfvEXT) ; .set GL_PREFIX(GetColorTableParameterfvEXT), GL_PREFIX(GetColorTableParameterfv) +#endif +#ifndef GLX_INDIRECT_RENDERING + .globl GL_PREFIX(GetColorTableParameterivEXT) ; .set GL_PREFIX(GetColorTableParameterivEXT), GL_PREFIX(GetColorTableParameteriv) +#endif .globl GL_PREFIX(TexImage3DEXT) ; .set GL_PREFIX(TexImage3DEXT), GL_PREFIX(TexImage3D) .globl GL_PREFIX(TexSubImage3DEXT) ; .set GL_PREFIX(TexSubImage3DEXT), GL_PREFIX(TexSubImage3D) .globl GL_PREFIX(CopyTexSubImage3DEXT) ; .set GL_PREFIX(CopyTexSubImage3DEXT), GL_PREFIX(CopyTexSubImage3D) @@ -29220,6 +29323,43 @@ GL_PREFIX(_dispatch_stub_768): .globl GL_PREFIX(CompressedTexSubImage2D) ; .set GL_PREFIX(CompressedTexSubImage2D), GL_PREFIX(CompressedTexSubImage2DARB) .globl GL_PREFIX(CompressedTexSubImage3D) ; .set GL_PREFIX(CompressedTexSubImage3D), GL_PREFIX(CompressedTexSubImage3DARB) .globl GL_PREFIX(GetCompressedTexImage) ; .set GL_PREFIX(GetCompressedTexImage), GL_PREFIX(GetCompressedTexImageARB) + .globl GL_PREFIX(DisableVertexAttribArray) ; .set GL_PREFIX(DisableVertexAttribArray), GL_PREFIX(DisableVertexAttribArrayARB) + .globl GL_PREFIX(EnableVertexAttribArray) ; .set GL_PREFIX(EnableVertexAttribArray), GL_PREFIX(EnableVertexAttribArrayARB) + .globl GL_PREFIX(GetVertexAttribdv) ; .set GL_PREFIX(GetVertexAttribdv), GL_PREFIX(GetVertexAttribdvARB) + .globl GL_PREFIX(GetVertexAttribfv) ; .set GL_PREFIX(GetVertexAttribfv), GL_PREFIX(GetVertexAttribfvARB) + .globl GL_PREFIX(GetVertexAttribiv) ; .set GL_PREFIX(GetVertexAttribiv), GL_PREFIX(GetVertexAttribivARB) + .globl GL_PREFIX(VertexAttrib1d) ; .set GL_PREFIX(VertexAttrib1d), GL_PREFIX(VertexAttrib1dARB) + .globl GL_PREFIX(VertexAttrib1dv) ; .set GL_PREFIX(VertexAttrib1dv), GL_PREFIX(VertexAttrib1dvARB) + .globl GL_PREFIX(VertexAttrib1f) ; .set GL_PREFIX(VertexAttrib1f), GL_PREFIX(VertexAttrib1fARB) + .globl GL_PREFIX(VertexAttrib1fv) ; .set GL_PREFIX(VertexAttrib1fv), GL_PREFIX(VertexAttrib1fvARB) + .globl GL_PREFIX(VertexAttrib1s) ; .set GL_PREFIX(VertexAttrib1s), GL_PREFIX(VertexAttrib1sARB) + .globl GL_PREFIX(VertexAttrib1sv) ; .set GL_PREFIX(VertexAttrib1sv), GL_PREFIX(VertexAttrib1svARB) + .globl GL_PREFIX(VertexAttrib2d) ; .set GL_PREFIX(VertexAttrib2d), GL_PREFIX(VertexAttrib2dARB) + .globl GL_PREFIX(VertexAttrib2dv) ; .set GL_PREFIX(VertexAttrib2dv), GL_PREFIX(VertexAttrib2dvARB) + .globl GL_PREFIX(VertexAttrib2f) ; .set GL_PREFIX(VertexAttrib2f), GL_PREFIX(VertexAttrib2fARB) + .globl GL_PREFIX(VertexAttrib2fv) ; .set GL_PREFIX(VertexAttrib2fv), GL_PREFIX(VertexAttrib2fvARB) + .globl GL_PREFIX(VertexAttrib2s) ; .set GL_PREFIX(VertexAttrib2s), GL_PREFIX(VertexAttrib2sARB) + .globl GL_PREFIX(VertexAttrib2sv) ; .set GL_PREFIX(VertexAttrib2sv), GL_PREFIX(VertexAttrib2svARB) + .globl GL_PREFIX(VertexAttrib3d) ; .set GL_PREFIX(VertexAttrib3d), GL_PREFIX(VertexAttrib3dARB) + .globl GL_PREFIX(VertexAttrib3dv) ; .set GL_PREFIX(VertexAttrib3dv), GL_PREFIX(VertexAttrib3dvARB) + .globl GL_PREFIX(VertexAttrib3f) ; .set GL_PREFIX(VertexAttrib3f), GL_PREFIX(VertexAttrib3fARB) + .globl GL_PREFIX(VertexAttrib3fv) ; .set GL_PREFIX(VertexAttrib3fv), GL_PREFIX(VertexAttrib3fvARB) + .globl GL_PREFIX(VertexAttrib3s) ; .set GL_PREFIX(VertexAttrib3s), GL_PREFIX(VertexAttrib3sARB) + .globl GL_PREFIX(VertexAttrib3sv) ; .set GL_PREFIX(VertexAttrib3sv), GL_PREFIX(VertexAttrib3svARB) + .globl GL_PREFIX(VertexAttrib4Nbv) ; .set GL_PREFIX(VertexAttrib4Nbv), GL_PREFIX(VertexAttrib4NbvARB) + .globl GL_PREFIX(VertexAttrib4Niv) ; .set GL_PREFIX(VertexAttrib4Niv), GL_PREFIX(VertexAttrib4NivARB) + .globl GL_PREFIX(VertexAttrib4Nsv) ; .set GL_PREFIX(VertexAttrib4Nsv), GL_PREFIX(VertexAttrib4NsvARB) + .globl GL_PREFIX(VertexAttrib4Nub) ; .set GL_PREFIX(VertexAttrib4Nub), GL_PREFIX(VertexAttrib4NubARB) + .globl GL_PREFIX(VertexAttrib4Nubv) ; .set GL_PREFIX(VertexAttrib4Nubv), GL_PREFIX(VertexAttrib4NubvARB) + .globl GL_PREFIX(VertexAttrib4Nuiv) ; .set GL_PREFIX(VertexAttrib4Nuiv), GL_PREFIX(VertexAttrib4NuivARB) + .globl GL_PREFIX(VertexAttrib4Nusv) ; .set GL_PREFIX(VertexAttrib4Nusv), GL_PREFIX(VertexAttrib4NusvARB) + .globl GL_PREFIX(VertexAttrib4d) ; .set GL_PREFIX(VertexAttrib4d), GL_PREFIX(VertexAttrib4dARB) + .globl GL_PREFIX(VertexAttrib4dv) ; .set GL_PREFIX(VertexAttrib4dv), GL_PREFIX(VertexAttrib4dvARB) + .globl GL_PREFIX(VertexAttrib4f) ; .set GL_PREFIX(VertexAttrib4f), GL_PREFIX(VertexAttrib4fARB) + .globl GL_PREFIX(VertexAttrib4fv) ; .set GL_PREFIX(VertexAttrib4fv), GL_PREFIX(VertexAttrib4fvARB) + .globl GL_PREFIX(VertexAttrib4s) ; .set GL_PREFIX(VertexAttrib4s), GL_PREFIX(VertexAttrib4sARB) + .globl GL_PREFIX(VertexAttrib4sv) ; .set GL_PREFIX(VertexAttrib4sv), GL_PREFIX(VertexAttrib4svARB) + .globl GL_PREFIX(VertexAttribPointer) ; .set GL_PREFIX(VertexAttribPointer), GL_PREFIX(VertexAttribPointerARB) .globl GL_PREFIX(BindBuffer) ; .set GL_PREFIX(BindBuffer), GL_PREFIX(BindBufferARB) .globl GL_PREFIX(BufferData) ; .set GL_PREFIX(BufferData), GL_PREFIX(BufferDataARB) .globl GL_PREFIX(BufferSubData) ; .set GL_PREFIX(BufferSubData), GL_PREFIX(BufferSubDataARB) @@ -29239,11 +29379,40 @@ GL_PREFIX(_dispatch_stub_768): .globl GL_PREFIX(GetQueryObjectuiv) ; .set GL_PREFIX(GetQueryObjectuiv), GL_PREFIX(GetQueryObjectuivARB) .globl GL_PREFIX(GetQueryiv) ; .set GL_PREFIX(GetQueryiv), GL_PREFIX(GetQueryivARB) .globl GL_PREFIX(IsQuery) ; .set GL_PREFIX(IsQuery), GL_PREFIX(IsQueryARB) + .globl GL_PREFIX(CompileShader) ; .set GL_PREFIX(CompileShader), GL_PREFIX(CompileShaderARB) + .globl GL_PREFIX(GetActiveUniform) ; .set GL_PREFIX(GetActiveUniform), GL_PREFIX(GetActiveUniformARB) + .globl GL_PREFIX(GetShaderSource) ; .set GL_PREFIX(GetShaderSource), GL_PREFIX(GetShaderSourceARB) + .globl GL_PREFIX(GetUniformLocation) ; .set GL_PREFIX(GetUniformLocation), GL_PREFIX(GetUniformLocationARB) + .globl GL_PREFIX(GetUniformfv) ; .set GL_PREFIX(GetUniformfv), GL_PREFIX(GetUniformfvARB) + .globl GL_PREFIX(GetUniformiv) ; .set GL_PREFIX(GetUniformiv), GL_PREFIX(GetUniformivARB) + .globl GL_PREFIX(LinkProgram) ; .set GL_PREFIX(LinkProgram), GL_PREFIX(LinkProgramARB) + .globl GL_PREFIX(ShaderSource) ; .set GL_PREFIX(ShaderSource), GL_PREFIX(ShaderSourceARB) + .globl GL_PREFIX(Uniform1f) ; .set GL_PREFIX(Uniform1f), GL_PREFIX(Uniform1fARB) + .globl GL_PREFIX(Uniform1fv) ; .set GL_PREFIX(Uniform1fv), GL_PREFIX(Uniform1fvARB) + .globl GL_PREFIX(Uniform1i) ; .set GL_PREFIX(Uniform1i), GL_PREFIX(Uniform1iARB) + .globl GL_PREFIX(Uniform1iv) ; .set GL_PREFIX(Uniform1iv), GL_PREFIX(Uniform1ivARB) + .globl GL_PREFIX(Uniform2f) ; .set GL_PREFIX(Uniform2f), GL_PREFIX(Uniform2fARB) + .globl GL_PREFIX(Uniform2fv) ; .set GL_PREFIX(Uniform2fv), GL_PREFIX(Uniform2fvARB) + .globl GL_PREFIX(Uniform2i) ; .set GL_PREFIX(Uniform2i), GL_PREFIX(Uniform2iARB) + .globl GL_PREFIX(Uniform2iv) ; .set GL_PREFIX(Uniform2iv), GL_PREFIX(Uniform2ivARB) + .globl GL_PREFIX(Uniform3f) ; .set GL_PREFIX(Uniform3f), GL_PREFIX(Uniform3fARB) + .globl GL_PREFIX(Uniform3fv) ; .set GL_PREFIX(Uniform3fv), GL_PREFIX(Uniform3fvARB) + .globl GL_PREFIX(Uniform3i) ; .set GL_PREFIX(Uniform3i), GL_PREFIX(Uniform3iARB) + .globl GL_PREFIX(Uniform3iv) ; .set GL_PREFIX(Uniform3iv), GL_PREFIX(Uniform3ivARB) + .globl GL_PREFIX(Uniform4f) ; .set GL_PREFIX(Uniform4f), GL_PREFIX(Uniform4fARB) + .globl GL_PREFIX(Uniform4fv) ; .set GL_PREFIX(Uniform4fv), GL_PREFIX(Uniform4fvARB) + .globl GL_PREFIX(Uniform4i) ; .set GL_PREFIX(Uniform4i), GL_PREFIX(Uniform4iARB) + .globl GL_PREFIX(Uniform4iv) ; .set GL_PREFIX(Uniform4iv), GL_PREFIX(Uniform4ivARB) + .globl GL_PREFIX(UniformMatrix2fv) ; .set GL_PREFIX(UniformMatrix2fv), GL_PREFIX(UniformMatrix2fvARB) + .globl GL_PREFIX(UniformMatrix3fv) ; .set GL_PREFIX(UniformMatrix3fv), GL_PREFIX(UniformMatrix3fvARB) + .globl GL_PREFIX(UniformMatrix4fv) ; .set GL_PREFIX(UniformMatrix4fv), GL_PREFIX(UniformMatrix4fvARB) + .globl GL_PREFIX(UseProgram) ; .set GL_PREFIX(UseProgram), GL_PREFIX(UseProgramObjectARB) + .globl GL_PREFIX(ValidateProgram) ; .set GL_PREFIX(ValidateProgram), GL_PREFIX(ValidateProgramARB) + .globl GL_PREFIX(BindAttribLocation) ; .set GL_PREFIX(BindAttribLocation), GL_PREFIX(BindAttribLocationARB) + .globl GL_PREFIX(GetActiveAttrib) ; .set GL_PREFIX(GetActiveAttrib), GL_PREFIX(GetActiveAttribARB) + .globl GL_PREFIX(GetAttribLocation) ; .set GL_PREFIX(GetAttribLocation), GL_PREFIX(GetAttribLocationARB) .globl GL_PREFIX(DrawBuffers) ; .set GL_PREFIX(DrawBuffers), GL_PREFIX(DrawBuffersARB) .globl GL_PREFIX(DrawBuffersATI) ; .set GL_PREFIX(DrawBuffersATI), GL_PREFIX(DrawBuffersARB) - .globl GL_PREFIX(GetColorTableParameterfvEXT) ; .set GL_PREFIX(GetColorTableParameterfvEXT), GL_PREFIX(_dispatch_stub_553) - .globl GL_PREFIX(GetColorTableParameterivEXT) ; .set GL_PREFIX(GetColorTableParameterivEXT), GL_PREFIX(_dispatch_stub_554) - .globl GL_PREFIX(GetColorTableEXT) ; .set GL_PREFIX(GetColorTableEXT), GL_PREFIX(_dispatch_stub_555) .globl GL_PREFIX(PointParameterf) ; .set GL_PREFIX(PointParameterf), GL_PREFIX(PointParameterfEXT) .globl GL_PREFIX(PointParameterfARB) ; .set GL_PREFIX(PointParameterfARB), GL_PREFIX(PointParameterfEXT) .globl GL_PREFIX(PointParameterfv) ; .set GL_PREFIX(PointParameterfv), GL_PREFIX(PointParameterfvEXT) @@ -29312,7 +29481,7 @@ GL_PREFIX(_dispatch_stub_768): .globl GL_PREFIX(IsProgramARB) ; .set GL_PREFIX(IsProgramARB), GL_PREFIX(IsProgramNV) .globl GL_PREFIX(PointParameteri) ; .set GL_PREFIX(PointParameteri), GL_PREFIX(PointParameteriNV) .globl GL_PREFIX(PointParameteriv) ; .set GL_PREFIX(PointParameteriv), GL_PREFIX(PointParameterivNV) - .globl GL_PREFIX(BlendEquationSeparate) ; .set GL_PREFIX(BlendEquationSeparate), GL_PREFIX(_dispatch_stub_746) + .globl GL_PREFIX(BlendEquationSeparate) ; .set GL_PREFIX(BlendEquationSeparate), GL_PREFIX(_dispatch_stub_749) #if defined(GLX_USE_TLS) && defined(__linux__) .section ".note.ABI-tag", "a" diff --git a/src/mesa/x86-64/matypes.h b/src/mesa/x86-64/matypes.h index 644700d7475..719ea310acc 100644 --- a/src/mesa/x86-64/matypes.h +++ b/src/mesa/x86-64/matypes.h @@ -12,18 +12,18 @@ * Offsets for GLcontext */ -#define CTX_DRIVER_CTX 944 - -#define CTX_LIGHT_ENABLED 39288 -#define CTX_LIGHT_SHADE_MODEL 39292 -#define CTX_LIGHT_COLOR_MAT_FACE 39296 -#define CTX_LIGHT_COLOR_MAT_MODE 39300 -#define CTX_LIGHT_COLOR_MAT_MASK 39304 -#define CTX_LIGHT_COLOR_MAT_ENABLED 39308 -#define CTX_LIGHT_ENABLED_LIST 39312 -#define CTX_LIGHT_NEED_VERTS 43673 -#define CTX_LIGHT_FLAGS 43676 -#define CTX_LIGHT_BASE_COLOR 43680 +#define CTX_DRIVER_CTX 948 + +#define CTX_LIGHT_ENABLED 39308 +#define CTX_LIGHT_SHADE_MODEL 39312 +#define CTX_LIGHT_COLOR_MAT_FACE 39316 +#define CTX_LIGHT_COLOR_MAT_MODE 39320 +#define CTX_LIGHT_COLOR_MAT_MASK 39324 +#define CTX_LIGHT_COLOR_MAT_ENABLED 39328 +#define CTX_LIGHT_ENABLED_LIST 39336 +#define CTX_LIGHT_NEED_VERTS 43697 +#define CTX_LIGHT_FLAGS 43700 +#define CTX_LIGHT_BASE_COLOR 43704 /* ============================================================= diff --git a/src/mesa/x86-64/x86-64.c b/src/mesa/x86-64/x86-64.c index 21d978b06e5..09508b66d52 100644 --- a/src/mesa/x86-64/x86-64.c +++ b/src/mesa/x86-64/x86-64.c @@ -1,4 +1,4 @@ -/* $Id: x86-64.c,v 1.2 2005/09/19 20:12:33 brianp Exp $ */ +/* $Id: x86-64.c,v 1.4 2006/10/17 17:03:21 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -44,6 +44,9 @@ DECLARE_XFORM_GROUP( x86_64, 4 ) +#else +/* just to silence warning below */ +#include "x86-64.h" #endif /* @@ -105,7 +108,7 @@ void _mesa_init_all_x86_64_transform_asm(void) _mesa_x86_64_transform_points4_2d; */ -#ifdef DEBUG +#ifdef DEBUG_MATH _math_test_all_transform_functions("x86_64"); _math_test_all_cliptest_functions("x86_64"); _math_test_all_normal_transform_functions("x86_64"); diff --git a/src/mesa/x86/glapi_x86.S b/src/mesa/x86/glapi_x86.S index 989fedc9b7b..2c01b38aeb7 100644 --- a/src/mesa/x86/glapi_x86.S +++ b/src/mesa/x86/glapi_x86.S @@ -38,6 +38,7 @@ #else # if defined(USE_MGL_NAMESPACE) # define GL_PREFIX(n,n2) GLNAME(CONCAT(mgl,n)) +# define _glapi_Dispatch _mglapi_Dispatch # else # define GL_PREFIX(n,n2) GLNAME(CONCAT(gl,n)) # endif @@ -549,9 +550,28 @@ GLNAME(gl_dispatch_functions_start): GL_STUB(MultiTexCoord4ivARB, _gloffset_MultiTexCoord4ivARB, MultiTexCoord4ivARB@8) GL_STUB(MultiTexCoord4sARB, _gloffset_MultiTexCoord4sARB, MultiTexCoord4sARB@20) GL_STUB(MultiTexCoord4svARB, _gloffset_MultiTexCoord4svARB, MultiTexCoord4svARB@8) + GL_STUB(AttachShader, _gloffset_AttachShader, AttachShader@8) + GL_STUB(CreateProgram, _gloffset_CreateProgram, CreateProgram@0) + GL_STUB(CreateShader, _gloffset_CreateShader, CreateShader@4) + GL_STUB(DeleteProgram, _gloffset_DeleteProgram, DeleteProgram@4) + GL_STUB(DeleteShader, _gloffset_DeleteShader, DeleteShader@4) + GL_STUB(DetachShader, _gloffset_DetachShader, DetachShader@8) + GL_STUB(GetAttachedShaders, _gloffset_GetAttachedShaders, GetAttachedShaders@16) + GL_STUB(GetProgramInfoLog, _gloffset_GetProgramInfoLog, GetProgramInfoLog@16) + GL_STUB(GetProgramiv, _gloffset_GetProgramiv, GetProgramiv@12) + GL_STUB(GetShaderInfoLog, _gloffset_GetShaderInfoLog, GetShaderInfoLog@16) + GL_STUB(GetShaderiv, _gloffset_GetShaderiv, GetShaderiv@12) + GL_STUB(IsProgram, _gloffset_IsProgram, IsProgram@4) + GL_STUB(IsShader, _gloffset_IsShader, IsShader@4) GL_STUB(StencilFuncSeparate, _gloffset_StencilFuncSeparate, StencilFuncSeparate@16) GL_STUB(StencilMaskSeparate, _gloffset_StencilMaskSeparate, StencilMaskSeparate@8) GL_STUB(StencilOpSeparate, _gloffset_StencilOpSeparate, StencilOpSeparate@16) + GL_STUB(UniformMatrix2x3fv, _gloffset_UniformMatrix2x3fv, UniformMatrix2x3fv@16) + GL_STUB(UniformMatrix2x4fv, _gloffset_UniformMatrix2x4fv, UniformMatrix2x4fv@16) + GL_STUB(UniformMatrix3x2fv, _gloffset_UniformMatrix3x2fv, UniformMatrix3x2fv@16) + GL_STUB(UniformMatrix3x4fv, _gloffset_UniformMatrix3x4fv, UniformMatrix3x4fv@16) + GL_STUB(UniformMatrix4x2fv, _gloffset_UniformMatrix4x2fv, UniformMatrix4x2fv@16) + GL_STUB(UniformMatrix4x3fv, _gloffset_UniformMatrix4x3fv, UniformMatrix4x3fv@16) GL_STUB(LoadTransposeMatrixdARB, _gloffset_LoadTransposeMatrixdARB, LoadTransposeMatrixdARB@4) GL_STUB(LoadTransposeMatrixfARB, _gloffset_LoadTransposeMatrixfARB, LoadTransposeMatrixfARB@4) GL_STUB(MultTransposeMatrixdARB, _gloffset_MultTransposeMatrixdARB, MultTransposeMatrixdARB@4) @@ -684,51 +704,22 @@ GLNAME(gl_dispatch_functions_start): GL_STUB(GetAttribLocationARB, _gloffset_GetAttribLocationARB, GetAttribLocationARB@8) GL_STUB(DrawBuffersARB, _gloffset_DrawBuffersARB, DrawBuffersARB@8) GL_STUB(PolygonOffsetEXT, _gloffset_PolygonOffsetEXT, PolygonOffsetEXT@8) - GL_STUB(_dispatch_stub_543, _gloffset_GetHistogramEXT, _dispatch_stub_543@20) - HIDDEN(GL_PREFIX(_dispatch_stub_543, _dispatch_stub_543@20)) - GL_STUB(_dispatch_stub_544, _gloffset_GetHistogramParameterfvEXT, _dispatch_stub_544@12) - HIDDEN(GL_PREFIX(_dispatch_stub_544, _dispatch_stub_544@12)) - GL_STUB(_dispatch_stub_545, _gloffset_GetHistogramParameterivEXT, _dispatch_stub_545@12) - HIDDEN(GL_PREFIX(_dispatch_stub_545, _dispatch_stub_545@12)) - GL_STUB(_dispatch_stub_546, _gloffset_GetMinmaxEXT, _dispatch_stub_546@20) - HIDDEN(GL_PREFIX(_dispatch_stub_546, _dispatch_stub_546@20)) - GL_STUB(_dispatch_stub_547, _gloffset_GetMinmaxParameterfvEXT, _dispatch_stub_547@12) - HIDDEN(GL_PREFIX(_dispatch_stub_547, _dispatch_stub_547@12)) - GL_STUB(_dispatch_stub_548, _gloffset_GetMinmaxParameterivEXT, _dispatch_stub_548@12) - HIDDEN(GL_PREFIX(_dispatch_stub_548, _dispatch_stub_548@12)) - GL_STUB(_dispatch_stub_549, _gloffset_GetConvolutionFilterEXT, _dispatch_stub_549@16) - HIDDEN(GL_PREFIX(_dispatch_stub_549, _dispatch_stub_549@16)) - GL_STUB(_dispatch_stub_550, _gloffset_GetConvolutionParameterfvEXT, _dispatch_stub_550@12) - HIDDEN(GL_PREFIX(_dispatch_stub_550, _dispatch_stub_550@12)) - GL_STUB(_dispatch_stub_551, _gloffset_GetConvolutionParameterivEXT, _dispatch_stub_551@12) - HIDDEN(GL_PREFIX(_dispatch_stub_551, _dispatch_stub_551@12)) - GL_STUB(_dispatch_stub_552, _gloffset_GetSeparableFilterEXT, _dispatch_stub_552@24) - HIDDEN(GL_PREFIX(_dispatch_stub_552, _dispatch_stub_552@24)) - GL_STUB(_dispatch_stub_553, _gloffset_GetColorTableParameterfvSGI, _dispatch_stub_553@12) - HIDDEN(GL_PREFIX(_dispatch_stub_553, _dispatch_stub_553@12)) - GL_STUB(_dispatch_stub_554, _gloffset_GetColorTableParameterivSGI, _dispatch_stub_554@12) - HIDDEN(GL_PREFIX(_dispatch_stub_554, _dispatch_stub_554@12)) - GL_STUB(_dispatch_stub_555, _gloffset_GetColorTableSGI, _dispatch_stub_555@16) - HIDDEN(GL_PREFIX(_dispatch_stub_555, _dispatch_stub_555@16)) - GL_STUB(_dispatch_stub_556, _gloffset_GetPixelTexGenParameterfvSGIS, _dispatch_stub_556@8) - HIDDEN(GL_PREFIX(_dispatch_stub_556, _dispatch_stub_556@8)) - GL_STUB(_dispatch_stub_557, _gloffset_GetPixelTexGenParameterivSGIS, _dispatch_stub_557@8) - HIDDEN(GL_PREFIX(_dispatch_stub_557, _dispatch_stub_557@8)) - GL_STUB(_dispatch_stub_558, _gloffset_PixelTexGenParameterfSGIS, _dispatch_stub_558@8) - HIDDEN(GL_PREFIX(_dispatch_stub_558, _dispatch_stub_558@8)) - GL_STUB(_dispatch_stub_559, _gloffset_PixelTexGenParameterfvSGIS, _dispatch_stub_559@8) - HIDDEN(GL_PREFIX(_dispatch_stub_559, _dispatch_stub_559@8)) - GL_STUB(_dispatch_stub_560, _gloffset_PixelTexGenParameteriSGIS, _dispatch_stub_560@8) - HIDDEN(GL_PREFIX(_dispatch_stub_560, _dispatch_stub_560@8)) - GL_STUB(_dispatch_stub_561, _gloffset_PixelTexGenParameterivSGIS, _dispatch_stub_561@8) - HIDDEN(GL_PREFIX(_dispatch_stub_561, _dispatch_stub_561@8)) - GL_STUB(AreTexturesResidentEXT, _gloffset_AreTexturesResidentEXT, AreTexturesResidentEXT@12) - GL_STUB(GenTexturesEXT, _gloffset_GenTexturesEXT, GenTexturesEXT@8) - GL_STUB(IsTextureEXT, _gloffset_IsTextureEXT, IsTextureEXT@4) - GL_STUB(_dispatch_stub_565, _gloffset_SampleMaskSGIS, _dispatch_stub_565@8) + GL_STUB(_dispatch_stub_562, _gloffset_GetPixelTexGenParameterfvSGIS, _dispatch_stub_562@8) + HIDDEN(GL_PREFIX(_dispatch_stub_562, _dispatch_stub_562@8)) + GL_STUB(_dispatch_stub_563, _gloffset_GetPixelTexGenParameterivSGIS, _dispatch_stub_563@8) + HIDDEN(GL_PREFIX(_dispatch_stub_563, _dispatch_stub_563@8)) + GL_STUB(_dispatch_stub_564, _gloffset_PixelTexGenParameterfSGIS, _dispatch_stub_564@8) + HIDDEN(GL_PREFIX(_dispatch_stub_564, _dispatch_stub_564@8)) + GL_STUB(_dispatch_stub_565, _gloffset_PixelTexGenParameterfvSGIS, _dispatch_stub_565@8) HIDDEN(GL_PREFIX(_dispatch_stub_565, _dispatch_stub_565@8)) - GL_STUB(_dispatch_stub_566, _gloffset_SamplePatternSGIS, _dispatch_stub_566@4) - HIDDEN(GL_PREFIX(_dispatch_stub_566, _dispatch_stub_566@4)) + GL_STUB(_dispatch_stub_566, _gloffset_PixelTexGenParameteriSGIS, _dispatch_stub_566@8) + HIDDEN(GL_PREFIX(_dispatch_stub_566, _dispatch_stub_566@8)) + GL_STUB(_dispatch_stub_567, _gloffset_PixelTexGenParameterivSGIS, _dispatch_stub_567@8) + HIDDEN(GL_PREFIX(_dispatch_stub_567, _dispatch_stub_567@8)) + GL_STUB(_dispatch_stub_568, _gloffset_SampleMaskSGIS, _dispatch_stub_568@8) + HIDDEN(GL_PREFIX(_dispatch_stub_568, _dispatch_stub_568@8)) + GL_STUB(_dispatch_stub_569, _gloffset_SamplePatternSGIS, _dispatch_stub_569@4) + HIDDEN(GL_PREFIX(_dispatch_stub_569, _dispatch_stub_569@4)) GL_STUB(ColorPointerEXT, _gloffset_ColorPointerEXT, ColorPointerEXT@20) GL_STUB(EdgeFlagPointerEXT, _gloffset_EdgeFlagPointerEXT, EdgeFlagPointerEXT@12) GL_STUB(IndexPointerEXT, _gloffset_IndexPointerEXT, IndexPointerEXT@16) @@ -739,10 +730,10 @@ GLNAME(gl_dispatch_functions_start): GL_STUB(PointParameterfvEXT, _gloffset_PointParameterfvEXT, PointParameterfvEXT@8) GL_STUB(LockArraysEXT, _gloffset_LockArraysEXT, LockArraysEXT@8) GL_STUB(UnlockArraysEXT, _gloffset_UnlockArraysEXT, UnlockArraysEXT@0) - GL_STUB(_dispatch_stub_577, _gloffset_CullParameterdvEXT, _dispatch_stub_577@8) - HIDDEN(GL_PREFIX(_dispatch_stub_577, _dispatch_stub_577@8)) - GL_STUB(_dispatch_stub_578, _gloffset_CullParameterfvEXT, _dispatch_stub_578@8) - HIDDEN(GL_PREFIX(_dispatch_stub_578, _dispatch_stub_578@8)) + GL_STUB(_dispatch_stub_580, _gloffset_CullParameterdvEXT, _dispatch_stub_580@8) + HIDDEN(GL_PREFIX(_dispatch_stub_580, _dispatch_stub_580@8)) + GL_STUB(_dispatch_stub_581, _gloffset_CullParameterfvEXT, _dispatch_stub_581@8) + HIDDEN(GL_PREFIX(_dispatch_stub_581, _dispatch_stub_581@8)) GL_STUB(SecondaryColor3bEXT, _gloffset_SecondaryColor3bEXT, SecondaryColor3bEXT@12) GL_STUB(SecondaryColor3bvEXT, _gloffset_SecondaryColor3bvEXT, SecondaryColor3bvEXT@4) GL_STUB(SecondaryColor3dEXT, _gloffset_SecondaryColor3dEXT, SecondaryColor3dEXT@24) @@ -767,8 +758,8 @@ GLNAME(gl_dispatch_functions_start): GL_STUB(FogCoorddvEXT, _gloffset_FogCoorddvEXT, FogCoorddvEXT@4) GL_STUB(FogCoordfEXT, _gloffset_FogCoordfEXT, FogCoordfEXT@4) GL_STUB(FogCoordfvEXT, _gloffset_FogCoordfvEXT, FogCoordfvEXT@4) - GL_STUB(_dispatch_stub_603, _gloffset_PixelTexGenSGIX, _dispatch_stub_603@4) - HIDDEN(GL_PREFIX(_dispatch_stub_603, _dispatch_stub_603@4)) + GL_STUB(_dispatch_stub_606, _gloffset_PixelTexGenSGIX, _dispatch_stub_606@4) + HIDDEN(GL_PREFIX(_dispatch_stub_606, _dispatch_stub_606@4)) GL_STUB(BlendFuncSeparateEXT, _gloffset_BlendFuncSeparateEXT, BlendFuncSeparateEXT@16) GL_STUB(FlushVertexArrayRangeNV, _gloffset_FlushVertexArrayRangeNV, FlushVertexArrayRangeNV@0) GL_STUB(VertexArrayRangeNV, _gloffset_VertexArrayRangeNV, VertexArrayRangeNV@8) @@ -810,24 +801,24 @@ GLNAME(gl_dispatch_functions_start): GL_STUB(WindowPos4ivMESA, _gloffset_WindowPos4ivMESA, WindowPos4ivMESA@4) GL_STUB(WindowPos4sMESA, _gloffset_WindowPos4sMESA, WindowPos4sMESA@16) GL_STUB(WindowPos4svMESA, _gloffset_WindowPos4svMESA, WindowPos4svMESA@4) - GL_STUB(_dispatch_stub_645, _gloffset_MultiModeDrawArraysIBM, _dispatch_stub_645@20) - HIDDEN(GL_PREFIX(_dispatch_stub_645, _dispatch_stub_645@20)) - GL_STUB(_dispatch_stub_646, _gloffset_MultiModeDrawElementsIBM, _dispatch_stub_646@24) - HIDDEN(GL_PREFIX(_dispatch_stub_646, _dispatch_stub_646@24)) - GL_STUB(_dispatch_stub_647, _gloffset_DeleteFencesNV, _dispatch_stub_647@8) - HIDDEN(GL_PREFIX(_dispatch_stub_647, _dispatch_stub_647@8)) - GL_STUB(_dispatch_stub_648, _gloffset_FinishFenceNV, _dispatch_stub_648@4) - HIDDEN(GL_PREFIX(_dispatch_stub_648, _dispatch_stub_648@4)) - GL_STUB(_dispatch_stub_649, _gloffset_GenFencesNV, _dispatch_stub_649@8) - HIDDEN(GL_PREFIX(_dispatch_stub_649, _dispatch_stub_649@8)) - GL_STUB(_dispatch_stub_650, _gloffset_GetFenceivNV, _dispatch_stub_650@12) - HIDDEN(GL_PREFIX(_dispatch_stub_650, _dispatch_stub_650@12)) - GL_STUB(_dispatch_stub_651, _gloffset_IsFenceNV, _dispatch_stub_651@4) + GL_STUB(_dispatch_stub_648, _gloffset_MultiModeDrawArraysIBM, _dispatch_stub_648@20) + HIDDEN(GL_PREFIX(_dispatch_stub_648, _dispatch_stub_648@20)) + GL_STUB(_dispatch_stub_649, _gloffset_MultiModeDrawElementsIBM, _dispatch_stub_649@24) + HIDDEN(GL_PREFIX(_dispatch_stub_649, _dispatch_stub_649@24)) + GL_STUB(_dispatch_stub_650, _gloffset_DeleteFencesNV, _dispatch_stub_650@8) + HIDDEN(GL_PREFIX(_dispatch_stub_650, _dispatch_stub_650@8)) + GL_STUB(_dispatch_stub_651, _gloffset_FinishFenceNV, _dispatch_stub_651@4) HIDDEN(GL_PREFIX(_dispatch_stub_651, _dispatch_stub_651@4)) - GL_STUB(_dispatch_stub_652, _gloffset_SetFenceNV, _dispatch_stub_652@8) + GL_STUB(_dispatch_stub_652, _gloffset_GenFencesNV, _dispatch_stub_652@8) HIDDEN(GL_PREFIX(_dispatch_stub_652, _dispatch_stub_652@8)) - GL_STUB(_dispatch_stub_653, _gloffset_TestFenceNV, _dispatch_stub_653@4) - HIDDEN(GL_PREFIX(_dispatch_stub_653, _dispatch_stub_653@4)) + GL_STUB(_dispatch_stub_653, _gloffset_GetFenceivNV, _dispatch_stub_653@12) + HIDDEN(GL_PREFIX(_dispatch_stub_653, _dispatch_stub_653@12)) + GL_STUB(_dispatch_stub_654, _gloffset_IsFenceNV, _dispatch_stub_654@4) + HIDDEN(GL_PREFIX(_dispatch_stub_654, _dispatch_stub_654@4)) + GL_STUB(_dispatch_stub_655, _gloffset_SetFenceNV, _dispatch_stub_655@8) + HIDDEN(GL_PREFIX(_dispatch_stub_655, _dispatch_stub_655@8)) + GL_STUB(_dispatch_stub_656, _gloffset_TestFenceNV, _dispatch_stub_656@4) + HIDDEN(GL_PREFIX(_dispatch_stub_656, _dispatch_stub_656@4)) GL_STUB(AreProgramsResidentNV, _gloffset_AreProgramsResidentNV, AreProgramsResidentNV@12) GL_STUB(BindProgramNV, _gloffset_BindProgramNV, BindProgramNV@8) GL_STUB(DeleteProgramsNV, _gloffset_DeleteProgramsNV, DeleteProgramsNV@8) @@ -908,26 +899,26 @@ GLNAME(gl_dispatch_functions_start): GL_STUB(SetFragmentShaderConstantATI, _gloffset_SetFragmentShaderConstantATI, SetFragmentShaderConstantATI@8) GL_STUB(PointParameteriNV, _gloffset_PointParameteriNV, PointParameteriNV@8) GL_STUB(PointParameterivNV, _gloffset_PointParameterivNV, PointParameterivNV@8) - GL_STUB(_dispatch_stub_734, _gloffset_ActiveStencilFaceEXT, _dispatch_stub_734@4) - HIDDEN(GL_PREFIX(_dispatch_stub_734, _dispatch_stub_734@4)) - GL_STUB(_dispatch_stub_735, _gloffset_BindVertexArrayAPPLE, _dispatch_stub_735@4) - HIDDEN(GL_PREFIX(_dispatch_stub_735, _dispatch_stub_735@4)) - GL_STUB(_dispatch_stub_736, _gloffset_DeleteVertexArraysAPPLE, _dispatch_stub_736@8) - HIDDEN(GL_PREFIX(_dispatch_stub_736, _dispatch_stub_736@8)) - GL_STUB(_dispatch_stub_737, _gloffset_GenVertexArraysAPPLE, _dispatch_stub_737@8) - HIDDEN(GL_PREFIX(_dispatch_stub_737, _dispatch_stub_737@8)) - GL_STUB(_dispatch_stub_738, _gloffset_IsVertexArrayAPPLE, _dispatch_stub_738@4) + GL_STUB(_dispatch_stub_737, _gloffset_ActiveStencilFaceEXT, _dispatch_stub_737@4) + HIDDEN(GL_PREFIX(_dispatch_stub_737, _dispatch_stub_737@4)) + GL_STUB(_dispatch_stub_738, _gloffset_BindVertexArrayAPPLE, _dispatch_stub_738@4) HIDDEN(GL_PREFIX(_dispatch_stub_738, _dispatch_stub_738@4)) + GL_STUB(_dispatch_stub_739, _gloffset_DeleteVertexArraysAPPLE, _dispatch_stub_739@8) + HIDDEN(GL_PREFIX(_dispatch_stub_739, _dispatch_stub_739@8)) + GL_STUB(_dispatch_stub_740, _gloffset_GenVertexArraysAPPLE, _dispatch_stub_740@8) + HIDDEN(GL_PREFIX(_dispatch_stub_740, _dispatch_stub_740@8)) + GL_STUB(_dispatch_stub_741, _gloffset_IsVertexArrayAPPLE, _dispatch_stub_741@4) + HIDDEN(GL_PREFIX(_dispatch_stub_741, _dispatch_stub_741@4)) GL_STUB(GetProgramNamedParameterdvNV, _gloffset_GetProgramNamedParameterdvNV, GetProgramNamedParameterdvNV@16) GL_STUB(GetProgramNamedParameterfvNV, _gloffset_GetProgramNamedParameterfvNV, GetProgramNamedParameterfvNV@16) GL_STUB(ProgramNamedParameter4dNV, _gloffset_ProgramNamedParameter4dNV, ProgramNamedParameter4dNV@44) GL_STUB(ProgramNamedParameter4dvNV, _gloffset_ProgramNamedParameter4dvNV, ProgramNamedParameter4dvNV@16) GL_STUB(ProgramNamedParameter4fNV, _gloffset_ProgramNamedParameter4fNV, ProgramNamedParameter4fNV@28) GL_STUB(ProgramNamedParameter4fvNV, _gloffset_ProgramNamedParameter4fvNV, ProgramNamedParameter4fvNV@16) - GL_STUB(_dispatch_stub_745, _gloffset_DepthBoundsEXT, _dispatch_stub_745@16) - HIDDEN(GL_PREFIX(_dispatch_stub_745, _dispatch_stub_745@16)) - GL_STUB(_dispatch_stub_746, _gloffset_BlendEquationSeparateEXT, _dispatch_stub_746@8) - HIDDEN(GL_PREFIX(_dispatch_stub_746, _dispatch_stub_746@8)) + GL_STUB(_dispatch_stub_748, _gloffset_DepthBoundsEXT, _dispatch_stub_748@16) + HIDDEN(GL_PREFIX(_dispatch_stub_748, _dispatch_stub_748@16)) + GL_STUB(_dispatch_stub_749, _gloffset_BlendEquationSeparateEXT, _dispatch_stub_749@8) + HIDDEN(GL_PREFIX(_dispatch_stub_749, _dispatch_stub_749@8)) GL_STUB(BindFramebufferEXT, _gloffset_BindFramebufferEXT, BindFramebufferEXT@8) GL_STUB(BindRenderbufferEXT, _gloffset_BindRenderbufferEXT, BindRenderbufferEXT@8) GL_STUB(CheckFramebufferStatusEXT, _gloffset_CheckFramebufferStatusEXT, CheckFramebufferStatusEXT@4) @@ -941,29 +932,40 @@ GLNAME(gl_dispatch_functions_start): GL_STUB(GenRenderbuffersEXT, _gloffset_GenRenderbuffersEXT, GenRenderbuffersEXT@8) GL_STUB(GenerateMipmapEXT, _gloffset_GenerateMipmapEXT, GenerateMipmapEXT@4) GL_STUB(GetFramebufferAttachmentParameterivEXT, _gloffset_GetFramebufferAttachmentParameterivEXT, GetFramebufferAttachmentParameterivEXT@16) - GL_STUB(_dispatch_stub_760, _gloffset_GetQueryObjecti64vEXT, _dispatch_stub_760@12) - HIDDEN(GL_PREFIX(_dispatch_stub_760, _dispatch_stub_760@12)) - GL_STUB(_dispatch_stub_761, _gloffset_GetQueryObjectui64vEXT, _dispatch_stub_761@12) - HIDDEN(GL_PREFIX(_dispatch_stub_761, _dispatch_stub_761@12)) GL_STUB(GetRenderbufferParameterivEXT, _gloffset_GetRenderbufferParameterivEXT, GetRenderbufferParameterivEXT@12) GL_STUB(IsFramebufferEXT, _gloffset_IsFramebufferEXT, IsFramebufferEXT@4) GL_STUB(IsRenderbufferEXT, _gloffset_IsRenderbufferEXT, IsRenderbufferEXT@4) GL_STUB(RenderbufferStorageEXT, _gloffset_RenderbufferStorageEXT, RenderbufferStorageEXT@16) - GL_STUB(_dispatch_stub_766, _gloffset_BlitFramebufferEXT, _dispatch_stub_766@40) - HIDDEN(GL_PREFIX(_dispatch_stub_766, _dispatch_stub_766@40)) - GL_STUB(_dispatch_stub_767, _gloffset_ProgramEnvParameters4fvEXT, _dispatch_stub_767@16) - HIDDEN(GL_PREFIX(_dispatch_stub_767, _dispatch_stub_767@16)) - GL_STUB(_dispatch_stub_768, _gloffset_ProgramLocalParameters4fvEXT, _dispatch_stub_768@16) + GL_STUB(_dispatch_stub_767, _gloffset_BlitFramebufferEXT, _dispatch_stub_767@40) + HIDDEN(GL_PREFIX(_dispatch_stub_767, _dispatch_stub_767@40)) + GL_STUB(_dispatch_stub_768, _gloffset_ProgramEnvParameters4fvEXT, _dispatch_stub_768@16) HIDDEN(GL_PREFIX(_dispatch_stub_768, _dispatch_stub_768@16)) + GL_STUB(_dispatch_stub_769, _gloffset_ProgramLocalParameters4fvEXT, _dispatch_stub_769@16) + HIDDEN(GL_PREFIX(_dispatch_stub_769, _dispatch_stub_769@16)) + GL_STUB(_dispatch_stub_770, _gloffset_GetQueryObjecti64vEXT, _dispatch_stub_770@12) + HIDDEN(GL_PREFIX(_dispatch_stub_770, _dispatch_stub_770@12)) + GL_STUB(_dispatch_stub_771, _gloffset_GetQueryObjectui64vEXT, _dispatch_stub_771@12) + HIDDEN(GL_PREFIX(_dispatch_stub_771, _dispatch_stub_771@12)) GL_STUB_ALIAS(ArrayElementEXT, _gloffset_ArrayElement, ArrayElementEXT@4, ArrayElement, ArrayElement@4) GL_STUB_ALIAS(BindTextureEXT, _gloffset_BindTexture, BindTextureEXT@8, BindTexture, BindTexture@8) GL_STUB_ALIAS(DrawArraysEXT, _gloffset_DrawArrays, DrawArraysEXT@12, DrawArrays, DrawArrays@12) +#ifndef GLX_INDIRECT_RENDERING + GL_STUB_ALIAS(AreTexturesResidentEXT, _gloffset_AreTexturesResident, AreTexturesResidentEXT@12, AreTexturesResident, AreTexturesResident@12) +#endif GL_STUB_ALIAS(CopyTexImage1DEXT, _gloffset_CopyTexImage1D, CopyTexImage1DEXT@28, CopyTexImage1D, CopyTexImage1D@28) GL_STUB_ALIAS(CopyTexImage2DEXT, _gloffset_CopyTexImage2D, CopyTexImage2DEXT@32, CopyTexImage2D, CopyTexImage2D@32) GL_STUB_ALIAS(CopyTexSubImage1DEXT, _gloffset_CopyTexSubImage1D, CopyTexSubImage1DEXT@24, CopyTexSubImage1D, CopyTexSubImage1D@24) GL_STUB_ALIAS(CopyTexSubImage2DEXT, _gloffset_CopyTexSubImage2D, CopyTexSubImage2DEXT@32, CopyTexSubImage2D, CopyTexSubImage2D@32) +#ifndef GLX_INDIRECT_RENDERING GL_STUB_ALIAS(DeleteTexturesEXT, _gloffset_DeleteTextures, DeleteTexturesEXT@8, DeleteTextures, DeleteTextures@8) +#endif +#ifndef GLX_INDIRECT_RENDERING + GL_STUB_ALIAS(GenTexturesEXT, _gloffset_GenTextures, GenTexturesEXT@8, GenTextures, GenTextures@8) +#endif GL_STUB_ALIAS(GetPointervEXT, _gloffset_GetPointerv, GetPointervEXT@8, GetPointerv, GetPointerv@8) +#ifndef GLX_INDIRECT_RENDERING + GL_STUB_ALIAS(IsTextureEXT, _gloffset_IsTexture, IsTextureEXT@4, IsTexture, IsTexture@4) +#endif GL_STUB_ALIAS(PrioritizeTexturesEXT, _gloffset_PrioritizeTextures, PrioritizeTexturesEXT@12, PrioritizeTextures, PrioritizeTextures@12) GL_STUB_ALIAS(TexSubImage1DEXT, _gloffset_TexSubImage1D, TexSubImage1DEXT@28, TexSubImage1D, TexSubImage1D@28) GL_STUB_ALIAS(TexSubImage2DEXT, _gloffset_TexSubImage2D, TexSubImage2DEXT@36, TexSubImage2D, TexSubImage2D@36) @@ -975,6 +977,24 @@ GLNAME(gl_dispatch_functions_start): GL_STUB_ALIAS(ColorTableParameterfvSGI, _gloffset_ColorTableParameterfv, ColorTableParameterfvSGI@12, ColorTableParameterfv, ColorTableParameterfv@12) GL_STUB_ALIAS(ColorTableParameterivSGI, _gloffset_ColorTableParameteriv, ColorTableParameterivSGI@12, ColorTableParameteriv, ColorTableParameteriv@12) GL_STUB_ALIAS(CopyColorTableSGI, _gloffset_CopyColorTable, CopyColorTableSGI@20, CopyColorTable, CopyColorTable@20) +#ifndef GLX_INDIRECT_RENDERING + GL_STUB_ALIAS(GetColorTableSGI, _gloffset_GetColorTable, GetColorTableSGI@16, GetColorTable, GetColorTable@16) +#endif +#ifndef GLX_INDIRECT_RENDERING + GL_STUB_ALIAS(GetColorTableEXT, _gloffset_GetColorTable, GetColorTableEXT@16, GetColorTable, GetColorTable@16) +#endif +#ifndef GLX_INDIRECT_RENDERING + GL_STUB_ALIAS(GetColorTableParameterfvSGI, _gloffset_GetColorTableParameterfv, GetColorTableParameterfvSGI@12, GetColorTableParameterfv, GetColorTableParameterfv@12) +#endif +#ifndef GLX_INDIRECT_RENDERING + GL_STUB_ALIAS(GetColorTableParameterfvEXT, _gloffset_GetColorTableParameterfv, GetColorTableParameterfvEXT@12, GetColorTableParameterfv, GetColorTableParameterfv@12) +#endif +#ifndef GLX_INDIRECT_RENDERING + GL_STUB_ALIAS(GetColorTableParameterivSGI, _gloffset_GetColorTableParameteriv, GetColorTableParameterivSGI@12, GetColorTableParameteriv, GetColorTableParameteriv@12) +#endif +#ifndef GLX_INDIRECT_RENDERING + GL_STUB_ALIAS(GetColorTableParameterivEXT, _gloffset_GetColorTableParameteriv, GetColorTableParameterivEXT@12, GetColorTableParameteriv, GetColorTableParameteriv@12) +#endif GL_STUB_ALIAS(ColorSubTableEXT, _gloffset_ColorSubTable, ColorSubTableEXT@24, ColorSubTable, ColorSubTable@24) GL_STUB_ALIAS(CopyColorSubTableEXT, _gloffset_CopyColorSubTable, CopyColorSubTableEXT@20, CopyColorSubTable, CopyColorSubTable@20) GL_STUB_ALIAS(ConvolutionFilter1DEXT, _gloffset_ConvolutionFilter1D, ConvolutionFilter1DEXT@24, ConvolutionFilter1D, ConvolutionFilter1D@24) @@ -985,7 +1005,37 @@ GLNAME(gl_dispatch_functions_start): GL_STUB_ALIAS(ConvolutionParameterivEXT, _gloffset_ConvolutionParameteriv, ConvolutionParameterivEXT@12, ConvolutionParameteriv, ConvolutionParameteriv@12) GL_STUB_ALIAS(CopyConvolutionFilter1DEXT, _gloffset_CopyConvolutionFilter1D, CopyConvolutionFilter1DEXT@20, CopyConvolutionFilter1D, CopyConvolutionFilter1D@20) GL_STUB_ALIAS(CopyConvolutionFilter2DEXT, _gloffset_CopyConvolutionFilter2D, CopyConvolutionFilter2DEXT@24, CopyConvolutionFilter2D, CopyConvolutionFilter2D@24) +#ifndef GLX_INDIRECT_RENDERING + GL_STUB_ALIAS(GetConvolutionFilterEXT, _gloffset_GetConvolutionFilter, GetConvolutionFilterEXT@16, GetConvolutionFilter, GetConvolutionFilter@16) +#endif +#ifndef GLX_INDIRECT_RENDERING + GL_STUB_ALIAS(GetConvolutionParameterfvEXT, _gloffset_GetConvolutionParameterfv, GetConvolutionParameterfvEXT@12, GetConvolutionParameterfv, GetConvolutionParameterfv@12) +#endif +#ifndef GLX_INDIRECT_RENDERING + GL_STUB_ALIAS(GetConvolutionParameterivEXT, _gloffset_GetConvolutionParameteriv, GetConvolutionParameterivEXT@12, GetConvolutionParameteriv, GetConvolutionParameteriv@12) +#endif +#ifndef GLX_INDIRECT_RENDERING + GL_STUB_ALIAS(GetSeparableFilterEXT, _gloffset_GetSeparableFilter, GetSeparableFilterEXT@24, GetSeparableFilter, GetSeparableFilter@24) +#endif GL_STUB_ALIAS(SeparableFilter2DEXT, _gloffset_SeparableFilter2D, SeparableFilter2DEXT@32, SeparableFilter2D, SeparableFilter2D@32) +#ifndef GLX_INDIRECT_RENDERING + GL_STUB_ALIAS(GetHistogramEXT, _gloffset_GetHistogram, GetHistogramEXT@20, GetHistogram, GetHistogram@20) +#endif +#ifndef GLX_INDIRECT_RENDERING + GL_STUB_ALIAS(GetHistogramParameterfvEXT, _gloffset_GetHistogramParameterfv, GetHistogramParameterfvEXT@12, GetHistogramParameterfv, GetHistogramParameterfv@12) +#endif +#ifndef GLX_INDIRECT_RENDERING + GL_STUB_ALIAS(GetHistogramParameterivEXT, _gloffset_GetHistogramParameteriv, GetHistogramParameterivEXT@12, GetHistogramParameteriv, GetHistogramParameteriv@12) +#endif +#ifndef GLX_INDIRECT_RENDERING + GL_STUB_ALIAS(GetMinmaxEXT, _gloffset_GetMinmax, GetMinmaxEXT@20, GetMinmax, GetMinmax@20) +#endif +#ifndef GLX_INDIRECT_RENDERING + GL_STUB_ALIAS(GetMinmaxParameterfvEXT, _gloffset_GetMinmaxParameterfv, GetMinmaxParameterfvEXT@12, GetMinmaxParameterfv, GetMinmaxParameterfv@12) +#endif +#ifndef GLX_INDIRECT_RENDERING + GL_STUB_ALIAS(GetMinmaxParameterivEXT, _gloffset_GetMinmaxParameteriv, GetMinmaxParameterivEXT@12, GetMinmaxParameteriv, GetMinmaxParameteriv@12) +#endif GL_STUB_ALIAS(HistogramEXT, _gloffset_Histogram, HistogramEXT@16, Histogram, Histogram@16) GL_STUB_ALIAS(MinmaxEXT, _gloffset_Minmax, MinmaxEXT@12, Minmax, Minmax@12) GL_STUB_ALIAS(ResetHistogramEXT, _gloffset_ResetHistogram, ResetHistogramEXT@4, ResetHistogram, ResetHistogram@4) @@ -1039,6 +1089,43 @@ GLNAME(gl_dispatch_functions_start): GL_STUB_ALIAS(CompressedTexSubImage2D, _gloffset_CompressedTexSubImage2DARB, CompressedTexSubImage2D@36, CompressedTexSubImage2DARB, CompressedTexSubImage2DARB@36) GL_STUB_ALIAS(CompressedTexSubImage3D, _gloffset_CompressedTexSubImage3DARB, CompressedTexSubImage3D@44, CompressedTexSubImage3DARB, CompressedTexSubImage3DARB@44) GL_STUB_ALIAS(GetCompressedTexImage, _gloffset_GetCompressedTexImageARB, GetCompressedTexImage@12, GetCompressedTexImageARB, GetCompressedTexImageARB@12) + GL_STUB_ALIAS(DisableVertexAttribArray, _gloffset_DisableVertexAttribArrayARB, DisableVertexAttribArray@4, DisableVertexAttribArrayARB, DisableVertexAttribArrayARB@4) + GL_STUB_ALIAS(EnableVertexAttribArray, _gloffset_EnableVertexAttribArrayARB, EnableVertexAttribArray@4, EnableVertexAttribArrayARB, EnableVertexAttribArrayARB@4) + GL_STUB_ALIAS(GetVertexAttribdv, _gloffset_GetVertexAttribdvARB, GetVertexAttribdv@12, GetVertexAttribdvARB, GetVertexAttribdvARB@12) + GL_STUB_ALIAS(GetVertexAttribfv, _gloffset_GetVertexAttribfvARB, GetVertexAttribfv@12, GetVertexAttribfvARB, GetVertexAttribfvARB@12) + GL_STUB_ALIAS(GetVertexAttribiv, _gloffset_GetVertexAttribivARB, GetVertexAttribiv@12, GetVertexAttribivARB, GetVertexAttribivARB@12) + GL_STUB_ALIAS(VertexAttrib1d, _gloffset_VertexAttrib1dARB, VertexAttrib1d@12, VertexAttrib1dARB, VertexAttrib1dARB@12) + GL_STUB_ALIAS(VertexAttrib1dv, _gloffset_VertexAttrib1dvARB, VertexAttrib1dv@8, VertexAttrib1dvARB, VertexAttrib1dvARB@8) + GL_STUB_ALIAS(VertexAttrib1f, _gloffset_VertexAttrib1fARB, VertexAttrib1f@8, VertexAttrib1fARB, VertexAttrib1fARB@8) + GL_STUB_ALIAS(VertexAttrib1fv, _gloffset_VertexAttrib1fvARB, VertexAttrib1fv@8, VertexAttrib1fvARB, VertexAttrib1fvARB@8) + GL_STUB_ALIAS(VertexAttrib1s, _gloffset_VertexAttrib1sARB, VertexAttrib1s@8, VertexAttrib1sARB, VertexAttrib1sARB@8) + GL_STUB_ALIAS(VertexAttrib1sv, _gloffset_VertexAttrib1svARB, VertexAttrib1sv@8, VertexAttrib1svARB, VertexAttrib1svARB@8) + GL_STUB_ALIAS(VertexAttrib2d, _gloffset_VertexAttrib2dARB, VertexAttrib2d@20, VertexAttrib2dARB, VertexAttrib2dARB@20) + GL_STUB_ALIAS(VertexAttrib2dv, _gloffset_VertexAttrib2dvARB, VertexAttrib2dv@8, VertexAttrib2dvARB, VertexAttrib2dvARB@8) + GL_STUB_ALIAS(VertexAttrib2f, _gloffset_VertexAttrib2fARB, VertexAttrib2f@12, VertexAttrib2fARB, VertexAttrib2fARB@12) + GL_STUB_ALIAS(VertexAttrib2fv, _gloffset_VertexAttrib2fvARB, VertexAttrib2fv@8, VertexAttrib2fvARB, VertexAttrib2fvARB@8) + GL_STUB_ALIAS(VertexAttrib2s, _gloffset_VertexAttrib2sARB, VertexAttrib2s@12, VertexAttrib2sARB, VertexAttrib2sARB@12) + GL_STUB_ALIAS(VertexAttrib2sv, _gloffset_VertexAttrib2svARB, VertexAttrib2sv@8, VertexAttrib2svARB, VertexAttrib2svARB@8) + GL_STUB_ALIAS(VertexAttrib3d, _gloffset_VertexAttrib3dARB, VertexAttrib3d@28, VertexAttrib3dARB, VertexAttrib3dARB@28) + GL_STUB_ALIAS(VertexAttrib3dv, _gloffset_VertexAttrib3dvARB, VertexAttrib3dv@8, VertexAttrib3dvARB, VertexAttrib3dvARB@8) + GL_STUB_ALIAS(VertexAttrib3f, _gloffset_VertexAttrib3fARB, VertexAttrib3f@16, VertexAttrib3fARB, VertexAttrib3fARB@16) + GL_STUB_ALIAS(VertexAttrib3fv, _gloffset_VertexAttrib3fvARB, VertexAttrib3fv@8, VertexAttrib3fvARB, VertexAttrib3fvARB@8) + GL_STUB_ALIAS(VertexAttrib3s, _gloffset_VertexAttrib3sARB, VertexAttrib3s@16, VertexAttrib3sARB, VertexAttrib3sARB@16) + GL_STUB_ALIAS(VertexAttrib3sv, _gloffset_VertexAttrib3svARB, VertexAttrib3sv@8, VertexAttrib3svARB, VertexAttrib3svARB@8) + GL_STUB_ALIAS(VertexAttrib4Nbv, _gloffset_VertexAttrib4NbvARB, VertexAttrib4Nbv@8, VertexAttrib4NbvARB, VertexAttrib4NbvARB@8) + GL_STUB_ALIAS(VertexAttrib4Niv, _gloffset_VertexAttrib4NivARB, VertexAttrib4Niv@8, VertexAttrib4NivARB, VertexAttrib4NivARB@8) + GL_STUB_ALIAS(VertexAttrib4Nsv, _gloffset_VertexAttrib4NsvARB, VertexAttrib4Nsv@8, VertexAttrib4NsvARB, VertexAttrib4NsvARB@8) + GL_STUB_ALIAS(VertexAttrib4Nub, _gloffset_VertexAttrib4NubARB, VertexAttrib4Nub@20, VertexAttrib4NubARB, VertexAttrib4NubARB@20) + GL_STUB_ALIAS(VertexAttrib4Nubv, _gloffset_VertexAttrib4NubvARB, VertexAttrib4Nubv@8, VertexAttrib4NubvARB, VertexAttrib4NubvARB@8) + GL_STUB_ALIAS(VertexAttrib4Nuiv, _gloffset_VertexAttrib4NuivARB, VertexAttrib4Nuiv@8, VertexAttrib4NuivARB, VertexAttrib4NuivARB@8) + GL_STUB_ALIAS(VertexAttrib4Nusv, _gloffset_VertexAttrib4NusvARB, VertexAttrib4Nusv@8, VertexAttrib4NusvARB, VertexAttrib4NusvARB@8) + GL_STUB_ALIAS(VertexAttrib4d, _gloffset_VertexAttrib4dARB, VertexAttrib4d@36, VertexAttrib4dARB, VertexAttrib4dARB@36) + GL_STUB_ALIAS(VertexAttrib4dv, _gloffset_VertexAttrib4dvARB, VertexAttrib4dv@8, VertexAttrib4dvARB, VertexAttrib4dvARB@8) + GL_STUB_ALIAS(VertexAttrib4f, _gloffset_VertexAttrib4fARB, VertexAttrib4f@20, VertexAttrib4fARB, VertexAttrib4fARB@20) + GL_STUB_ALIAS(VertexAttrib4fv, _gloffset_VertexAttrib4fvARB, VertexAttrib4fv@8, VertexAttrib4fvARB, VertexAttrib4fvARB@8) + GL_STUB_ALIAS(VertexAttrib4s, _gloffset_VertexAttrib4sARB, VertexAttrib4s@20, VertexAttrib4sARB, VertexAttrib4sARB@20) + GL_STUB_ALIAS(VertexAttrib4sv, _gloffset_VertexAttrib4svARB, VertexAttrib4sv@8, VertexAttrib4svARB, VertexAttrib4svARB@8) + GL_STUB_ALIAS(VertexAttribPointer, _gloffset_VertexAttribPointerARB, VertexAttribPointer@24, VertexAttribPointerARB, VertexAttribPointerARB@24) GL_STUB_ALIAS(BindBuffer, _gloffset_BindBufferARB, BindBuffer@8, BindBufferARB, BindBufferARB@8) GL_STUB_ALIAS(BufferData, _gloffset_BufferDataARB, BufferData@16, BufferDataARB, BufferDataARB@16) GL_STUB_ALIAS(BufferSubData, _gloffset_BufferSubDataARB, BufferSubData@16, BufferSubDataARB, BufferSubDataARB@16) @@ -1058,6 +1145,38 @@ GLNAME(gl_dispatch_functions_start): GL_STUB_ALIAS(GetQueryObjectuiv, _gloffset_GetQueryObjectuivARB, GetQueryObjectuiv@12, GetQueryObjectuivARB, GetQueryObjectuivARB@12) GL_STUB_ALIAS(GetQueryiv, _gloffset_GetQueryivARB, GetQueryiv@12, GetQueryivARB, GetQueryivARB@12) GL_STUB_ALIAS(IsQuery, _gloffset_IsQueryARB, IsQuery@4, IsQueryARB, IsQueryARB@4) + GL_STUB_ALIAS(CompileShader, _gloffset_CompileShaderARB, CompileShader@4, CompileShaderARB, CompileShaderARB@4) + GL_STUB_ALIAS(GetActiveUniform, _gloffset_GetActiveUniformARB, GetActiveUniform@28, GetActiveUniformARB, GetActiveUniformARB@28) + GL_STUB_ALIAS(GetShaderSource, _gloffset_GetShaderSourceARB, GetShaderSource@16, GetShaderSourceARB, GetShaderSourceARB@16) + GL_STUB_ALIAS(GetUniformLocation, _gloffset_GetUniformLocationARB, GetUniformLocation@8, GetUniformLocationARB, GetUniformLocationARB@8) + GL_STUB_ALIAS(GetUniformfv, _gloffset_GetUniformfvARB, GetUniformfv@12, GetUniformfvARB, GetUniformfvARB@12) + GL_STUB_ALIAS(GetUniformiv, _gloffset_GetUniformivARB, GetUniformiv@12, GetUniformivARB, GetUniformivARB@12) + GL_STUB_ALIAS(LinkProgram, _gloffset_LinkProgramARB, LinkProgram@4, LinkProgramARB, LinkProgramARB@4) + GL_STUB_ALIAS(ShaderSource, _gloffset_ShaderSourceARB, ShaderSource@16, ShaderSourceARB, ShaderSourceARB@16) + GL_STUB_ALIAS(Uniform1f, _gloffset_Uniform1fARB, Uniform1f@8, Uniform1fARB, Uniform1fARB@8) + GL_STUB_ALIAS(Uniform1fv, _gloffset_Uniform1fvARB, Uniform1fv@12, Uniform1fvARB, Uniform1fvARB@12) + GL_STUB_ALIAS(Uniform1i, _gloffset_Uniform1iARB, Uniform1i@8, Uniform1iARB, Uniform1iARB@8) + GL_STUB_ALIAS(Uniform1iv, _gloffset_Uniform1ivARB, Uniform1iv@12, Uniform1ivARB, Uniform1ivARB@12) + GL_STUB_ALIAS(Uniform2f, _gloffset_Uniform2fARB, Uniform2f@12, Uniform2fARB, Uniform2fARB@12) + GL_STUB_ALIAS(Uniform2fv, _gloffset_Uniform2fvARB, Uniform2fv@12, Uniform2fvARB, Uniform2fvARB@12) + GL_STUB_ALIAS(Uniform2i, _gloffset_Uniform2iARB, Uniform2i@12, Uniform2iARB, Uniform2iARB@12) + GL_STUB_ALIAS(Uniform2iv, _gloffset_Uniform2ivARB, Uniform2iv@12, Uniform2ivARB, Uniform2ivARB@12) + GL_STUB_ALIAS(Uniform3f, _gloffset_Uniform3fARB, Uniform3f@16, Uniform3fARB, Uniform3fARB@16) + GL_STUB_ALIAS(Uniform3fv, _gloffset_Uniform3fvARB, Uniform3fv@12, Uniform3fvARB, Uniform3fvARB@12) + GL_STUB_ALIAS(Uniform3i, _gloffset_Uniform3iARB, Uniform3i@16, Uniform3iARB, Uniform3iARB@16) + GL_STUB_ALIAS(Uniform3iv, _gloffset_Uniform3ivARB, Uniform3iv@12, Uniform3ivARB, Uniform3ivARB@12) + GL_STUB_ALIAS(Uniform4f, _gloffset_Uniform4fARB, Uniform4f@20, Uniform4fARB, Uniform4fARB@20) + GL_STUB_ALIAS(Uniform4fv, _gloffset_Uniform4fvARB, Uniform4fv@12, Uniform4fvARB, Uniform4fvARB@12) + GL_STUB_ALIAS(Uniform4i, _gloffset_Uniform4iARB, Uniform4i@20, Uniform4iARB, Uniform4iARB@20) + GL_STUB_ALIAS(Uniform4iv, _gloffset_Uniform4ivARB, Uniform4iv@12, Uniform4ivARB, Uniform4ivARB@12) + GL_STUB_ALIAS(UniformMatrix2fv, _gloffset_UniformMatrix2fvARB, UniformMatrix2fv@16, UniformMatrix2fvARB, UniformMatrix2fvARB@16) + GL_STUB_ALIAS(UniformMatrix3fv, _gloffset_UniformMatrix3fvARB, UniformMatrix3fv@16, UniformMatrix3fvARB, UniformMatrix3fvARB@16) + GL_STUB_ALIAS(UniformMatrix4fv, _gloffset_UniformMatrix4fvARB, UniformMatrix4fv@16, UniformMatrix4fvARB, UniformMatrix4fvARB@16) + GL_STUB_ALIAS(UseProgram, _gloffset_UseProgramObjectARB, UseProgram@4, UseProgramObjectARB, UseProgramObjectARB@4) + GL_STUB_ALIAS(ValidateProgram, _gloffset_ValidateProgramARB, ValidateProgram@4, ValidateProgramARB, ValidateProgramARB@4) + GL_STUB_ALIAS(BindAttribLocation, _gloffset_BindAttribLocationARB, BindAttribLocation@12, BindAttribLocationARB, BindAttribLocationARB@12) + GL_STUB_ALIAS(GetActiveAttrib, _gloffset_GetActiveAttribARB, GetActiveAttrib@28, GetActiveAttribARB, GetActiveAttribARB@28) + GL_STUB_ALIAS(GetAttribLocation, _gloffset_GetAttribLocationARB, GetAttribLocation@8, GetAttribLocationARB, GetAttribLocationARB@8) GL_STUB_ALIAS(DrawBuffers, _gloffset_DrawBuffersARB, DrawBuffers@8, DrawBuffersARB, DrawBuffersARB@8) GL_STUB_ALIAS(DrawBuffersATI, _gloffset_DrawBuffersARB, DrawBuffersATI@8, DrawBuffersARB, DrawBuffersARB@8) GL_STUB_ALIAS(PointParameterf, _gloffset_PointParameterfEXT, PointParameterf@8, PointParameterfEXT, PointParameterfEXT@8) diff --git a/src/mesa/x86/matypes.h b/src/mesa/x86/matypes.h index 64216711562..abce247dc09 100644 --- a/src/mesa/x86/matypes.h +++ b/src/mesa/x86/matypes.h @@ -13,18 +13,18 @@ * Offsets for GLcontext */ -#define CTX_DRIVER_CTX 944 - -#define CTX_LIGHT_ENABLED 39288 -#define CTX_LIGHT_SHADE_MODEL 39292 -#define CTX_LIGHT_COLOR_MAT_FACE 39296 -#define CTX_LIGHT_COLOR_MAT_MODE 39300 -#define CTX_LIGHT_COLOR_MAT_MASK 39304 -#define CTX_LIGHT_COLOR_MAT_ENABLED 39308 -#define CTX_LIGHT_ENABLED_LIST 39312 -#define CTX_LIGHT_NEED_VERTS 43673 -#define CTX_LIGHT_FLAGS 43676 -#define CTX_LIGHT_BASE_COLOR 43680 +#define CTX_DRIVER_CTX 948 + +#define CTX_LIGHT_ENABLED 39308 +#define CTX_LIGHT_SHADE_MODEL 39312 +#define CTX_LIGHT_COLOR_MAT_FACE 39316 +#define CTX_LIGHT_COLOR_MAT_MODE 39320 +#define CTX_LIGHT_COLOR_MAT_MASK 39324 +#define CTX_LIGHT_COLOR_MAT_ENABLED 39328 +#define CTX_LIGHT_ENABLED_LIST 39336 +#define CTX_LIGHT_NEED_VERTS 43697 +#define CTX_LIGHT_FLAGS 43700 +#define CTX_LIGHT_BASE_COLOR 43704 /* ============================================================= diff --git a/src/mesa/x86/mmx.h b/src/mesa/x86/mmx.h index 11f78635ae9..5641936bdb0 100644 --- a/src/mesa/x86/mmx.h +++ b/src/mesa/x86/mmx.h @@ -1,10 +1,8 @@ -/* $Id: mmx.h,v 1.9 2002/04/19 20:12:30 jrfonseca Exp $ */ - /* * Mesa 3-D graphics library - * Version: 3.5 + * Version: 6.5.2 * - * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2006 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"), @@ -30,22 +28,27 @@ extern void _ASMAPI _mesa_mmx_blend_transparency( GLcontext *ctx, GLuint n, const GLubyte mask[], - GLubyte rgba[][4], const GLubyte dest[][4] ); + GLvoid *rgba, const GLvoid *dest, + GLenum chanType ); extern void _ASMAPI _mesa_mmx_blend_add( GLcontext *ctx, GLuint n, const GLubyte mask[], - GLubyte rgba[][4], const GLubyte dest[][4] ); + GLvoid *rgba, const GLvoid *dest, + GLenum chanType ); extern void _ASMAPI _mesa_mmx_blend_min( GLcontext *ctx, GLuint n, const GLubyte mask[], - GLubyte rgba[][4], const GLubyte dest[][4] ); + GLvoid *rgba, const GLvoid *dest, + GLenum chanType ); extern void _ASMAPI _mesa_mmx_blend_max( GLcontext *ctx, GLuint n, const GLubyte mask[], - GLubyte rgba[][4], const GLubyte dest[][4] ); + GLvoid *rgba, const GLvoid *dest, + GLenum chanType ); extern void _ASMAPI _mesa_mmx_blend_modulate( GLcontext *ctx, GLuint n, const GLubyte mask[], - GLubyte rgba[][4], const GLubyte dest[][4] ); + GLvoid *rgba, const GLvoid *dest, + GLenum chanType ); #endif diff --git a/windows/VC6/mesa/mesa/mesa.dsp b/windows/VC6/mesa/mesa/mesa.dsp index 60ff915a32e..a2f2f2dff4f 100644 --- a/windows/VC6/mesa/mesa/mesa.dsp +++ b/windows/VC6/mesa/mesa/mesa.dsp @@ -393,6 +393,10 @@ SOURCE=..\..\..\..\src\mesa\main\matrix.c # End Source File # Begin Source File +SOURCE=..\..\..\..\src\mesa\main\mipmap.c +# End Source File +# Begin Source File + SOURCE=..\..\..\..\src\mesa\main\mm.c # End Source File # Begin Source File diff --git a/windows/VC7/mesa/mesa/mesa.vcproj b/windows/VC7/mesa/mesa/mesa.vcproj index c6da5b0cffb..b63312c8862 100644 --- a/windows/VC7/mesa/mesa/mesa.vcproj +++ b/windows/VC7/mesa/mesa/mesa.vcproj @@ -287,6 +287,9 @@ + + -- cgit v1.2.3 From 223a97f92a6725812f4925e4c61df59cb7f52c70 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Sat, 18 Nov 2006 21:21:18 +0000 Subject: Bump build-dependency on libdrm-dev (>= 2.2.0). --- debian/changelog | 3 ++- debian/control | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 59de3401145..11138a7ec8b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,8 +4,9 @@ mesa (6.5.2~rc1-1) experimental; urgency=low * 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 libdrm2-dev (>= 2.2.0). - -- Thierry Reding Sat, 18 Nov 2006 18:52:55 +0100 + -- Thierry Reding Sat, 18 Nov 2006 20:05:42 +0100 mesa (6.5.1-1) experimental; urgency=low diff --git a/debian/control b/debian/control index 697d819ebe9..12c8db45b9a 100644 --- a/debian/control +++ b/debian/control @@ -4,7 +4,7 @@ Priority: optional Maintainer: Debian X Strike Force Uploaders: Thierry Reding Standards-Version: 3.7.2 -Build-Depends: debhelper (>= 5), quilt (>= 0.40), pkg-config, libdrm-dev (>= 2.0.2) [!hurd-i386], libx11-dev, xutils-dev, x11proto-gl-dev (>= 1.4.8), libxxf86vm-dev, libexpat1-dev, lesstif2-dev, dpkg-dev (>= 1.13.19) +Build-Depends: debhelper (>= 5), quilt (>= 0.40), pkg-config, libdrm-dev (>= 2.2.0) [!hurd-i386], libx11-dev, xutils-dev, x11proto-gl-dev (>= 1.4.8), libxxf86vm-dev, libexpat1-dev, lesstif2-dev, dpkg-dev (>= 1.13.19) Package: libgl1-mesa-swx11 Section: libs -- cgit v1.2.3 From f403108f5f1a9d4451f0db3d20a74f4ec82f4d38 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Sat, 18 Nov 2006 21:22:52 +0000 Subject: Fix typo in changelog. libdrm2-dev is not a package. --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 11138a7ec8b..ecdb97accaf 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,9 +4,9 @@ mesa (6.5.2~rc1-1) experimental; urgency=low * 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 libdrm2-dev (>= 2.2.0). + * Bump build-dependency on libdrm-dev (>= 2.2.0). - -- Thierry Reding Sat, 18 Nov 2006 20:05:42 +0100 + -- Thierry Reding Sat, 18 Nov 2006 22:22:07 +0100 mesa (6.5.1-1) experimental; urgency=low -- cgit v1.2.3 From 8dbee7867f16688adb98cce7d64a186960c31a38 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Sat, 18 Nov 2006 21:28:07 +0000 Subject: 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. --- configs/debian-default | 1 - debian/changelog | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'debian') diff --git a/configs/debian-default b/configs/debian-default index b64a6806bad..3412bb351d1 100644 --- a/configs/debian-default +++ b/configs/debian-default @@ -8,7 +8,6 @@ SRC_DIRS = mesa PROGRAM_DIRS = INSTALL_DIR = $(DESTDIR)/usr -INSTALL = /usr/bin/install # vim: ft=make diff --git a/debian/changelog b/debian/changelog index ecdb97accaf..0c87f58f519 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,8 +5,11 @@ mesa (6.5.2~rc1-1) experimental; urgency=low + 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:22:07 +0100 + -- Thierry Reding Sat, 18 Nov 2006 22:23:04 +0100 mesa (6.5.1-1) experimental; urgency=low -- cgit v1.2.3 From c72ef1773120a2ce527b0f3bea5f16a42ee2340d Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Wed, 22 Nov 2006 19:47:56 +0000 Subject: Add libOSMesa16 and libOSMesa32 entries to libosmesa6.shlibs so packages linking against those libraries will get the correct dependencies. --- debian/libosmesa6.shlibs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'debian') diff --git a/debian/libosmesa6.shlibs b/debian/libosmesa6.shlibs index f4d3f753196..7f57882ef17 100644 --- a/debian/libosmesa6.shlibs +++ b/debian/libosmesa6.shlibs @@ -1 +1,3 @@ libOSMesa 6 libosmesa6 | libgl1-mesa-glide3 +libOSMesa16 6 libosmesa6 (>= 6.5.1-1) +libOSMesa32 6 libosmesa6 (>= 6.5.1-1) -- cgit v1.2.3 From db164ab514beb5eca780e383c04f5ad90b6e7bd7 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Wed, 22 Nov 2006 19:50:34 +0000 Subject: Update to latest upstream release candidate. --- configs/linux-static | 5 + debian/changelog | 7 + .../patches/02_use-ieee-fp-on-s390-and-m68k.patch | 2 +- docs/mangling.html | 4 + docs/relnotes-6.5.2.html | 3 + include/GL/gl.h | 31 - include/GL/gl_mangle.h | 18 +- src/glu/sgi/libutil/mipmap.c | 44 +- src/mesa/drivers/dri/i965/brw_save_api.c | 10 +- src/mesa/drivers/dri/i965/brw_vs_tnl.c | 2 +- src/mesa/drivers/dri/i965/brw_wm_fp.c | 2 +- src/mesa/drivers/dri/r200/r200_context.c | 23 +- src/mesa/drivers/dri/r200/r200_context.h | 1 + src/mesa/drivers/dri/r200/r200_lock.c | 14 +- src/mesa/drivers/dri/r200/r200_state.c | 35 +- src/mesa/drivers/dri/r300/r300_context.h | 26 +- src/mesa/drivers/dri/r300/r300_fragprog.c | 7 + src/mesa/drivers/dri/r300/r300_maos.c | 4 +- src/mesa/drivers/dri/r300/r300_shader.c | 17 +- src/mesa/drivers/dri/r300/r300_state.c | 80 +- src/mesa/drivers/dri/r300/r300_vertexprog.c | 482 ++- src/mesa/drivers/dri/savage/savagespan.c | 2 - src/mesa/glapi/glprocs.h | 50 + src/mesa/main/api_arrayelt.c | 94 +- src/mesa/main/api_arrayelt.h | 5 + src/mesa/main/attrib.c | 8 +- src/mesa/main/config.h | 1 + src/mesa/main/context.c | 11 + src/mesa/main/enums.c | 2 +- src/mesa/main/image.c | 6 +- src/mesa/main/imports.h | 9 + src/mesa/main/texcompress_fxt1.c | 4 +- src/mesa/main/texenvprogram.c | 2 +- src/mesa/shader/arbprogparse.c | 17 +- src/mesa/shader/descrip.mms | 7 +- src/mesa/shader/nvfragparse.c | 8 +- src/mesa/shader/program.c | 111 +- src/mesa/shader/program.h | 19 +- src/mesa/shader/program_instruction.h | 7 +- src/mesa/shader/programopt.c | 2 +- src/mesa/shader/shaderobjects.c | 14 +- src/mesa/shader/slang/slang_assemble.c | 24 +- src/mesa/shader/slang/slang_assemble.h | 288 +- src/mesa/shader/slang/slang_assemble_typeinfo.c | 1036 ++++--- src/mesa/shader/slang/slang_assemble_typeinfo.h | 138 +- src/mesa/shader/slang/slang_compile.c | 3170 ++++++++++---------- src/mesa/shader/slang/slang_compile_function.c | 252 +- src/mesa/shader/slang/slang_compile_function.h | 72 +- src/mesa/shader/slang/slang_compile_operation.h | 120 +- src/mesa/shader/slang/slang_compile_variable.c | 2 +- src/mesa/shader/slang/slang_compile_variable.h | 98 +- src/mesa/shader/slang/slang_execute.c | 1032 ++++--- src/mesa/shader/slang/slang_execute.h | 66 +- src/mesa/shader/slang/slang_preprocess.c | 8 +- src/mesa/shader/slang/slang_utility.c | 125 +- src/mesa/swrast/s_nvfragprog.c | 53 + src/mesa/tnl/t_save_api.c | 8 + src/mesa/tnl/t_vp_build.c | 4 +- 58 files changed, 4359 insertions(+), 3333 deletions(-) (limited to 'debian') diff --git a/configs/linux-static b/configs/linux-static index 0104d34022b..85141ea643f 100644 --- a/configs/linux-static +++ b/configs/linux-static @@ -19,3 +19,8 @@ OSMESA_LIB_DEPS = GLU_LIB_DEPS = GLUT_LIB_DEPS = GLW_LIB_DEPS = + +# Need to specify all libraries we may need +APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm \ + -L/usr/X11R6/lib/ -lX11 -lXmu -lXi -lpthread + diff --git a/debian/changelog b/debian/changelog index 0c87f58f519..ca239b9d547 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +mesa (6.5.2~rc2-1) experimental; urgency=low + + * New upstream release candidate: + + Refresh 02_use-ieee-fp-on-s390-and-m68k.patch. + + -- Thierry Reding Wed, 22 Nov 2006 20:49:06 +0100 + mesa (6.5.2~rc1-1) experimental; urgency=low * New upstream release candidate. diff --git a/debian/patches/02_use-ieee-fp-on-s390-and-m68k.patch b/debian/patches/02_use-ieee-fp-on-s390-and-m68k.patch index d219de8f267..f54457521c5 100644 --- a/debian/patches/02_use-ieee-fp-on-s390-and-m68k.patch +++ b/debian/patches/02_use-ieee-fp-on-s390-and-m68k.patch @@ -4,7 +4,7 @@ This patch by David Nusinow. --- a/src/mesa/main/imports.h +++ b/src/mesa/main/imports.h -@@ -146,8 +146,9 @@ +@@ -155,8 +155,9 @@ *** USE_IEEE: Determine if we're using IEEE floating point ***/ #if defined(__i386__) || defined(__386__) || defined(__sparc__) || \ diff --git a/docs/mangling.html b/docs/mangling.html index 3f550ba5ec6..55071544fa6 100644 --- a/docs/mangling.html +++ b/docs/mangling.html @@ -19,6 +19,10 @@ This results in all the Mesa functions being prefixed with

    To do this, recompile Mesa with the compiler flag -DUSE_MGL_NAMESPACE. Add the flag to CFLAGS in the configuration file which you want to use. +For example: +

    +CFLAGS += -DUSE_MGL_NAMESPACE
    +

    diff --git a/docs/relnotes-6.5.2.html b/docs/relnotes-6.5.2.html index 1ba936413a8..ba99420d7d1 100644 --- a/docs/relnotes-6.5.2.html +++ b/docs/relnotes-6.5.2.html @@ -66,6 +66,9 @@ copy texturing).
  • Fixed some fragment program bugs in Intel i915 DRI driver
  • Fixed glGetVertexAttribfvARB bug 8883
  • Implemented glGetUniform[fi]vARB() functions +
  • Fixed glDrawPixels(GL_COLOR_INDEX, GL_BITMAP) segfault (bug 9044) +
  • Fixed some gluBuild2DMipmaps() bugs (Greg McGarragh) +
  • Fixed broken "mgl" name mangling diff --git a/include/GL/gl.h b/include/GL/gl.h index 5b30e3f3865..78a00aeb8b3 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -2172,37 +2172,6 @@ GLAPI GLsizei APIENTRY glGetDebugLogLengthMESA (GLhandleARB obj, GLenum logType, #endif /* GL_ARB_shader_objects */ -/* - * ???. GL_MESA_trace - * XXX obsolete - */ -#ifndef GL_MESA_trace -#define GL_MESA_trace 1 - -#define GL_TRACE_ALL_BITS_MESA 0xFFFF -#define GL_TRACE_OPERATIONS_BIT_MESA 0x0001 -#define GL_TRACE_PRIMITIVES_BIT_MESA 0x0002 -#define GL_TRACE_ARRAYS_BIT_MESA 0x0004 -#define GL_TRACE_TEXTURES_BIT_MESA 0x0008 -#define GL_TRACE_PIXELS_BIT_MESA 0x0010 -#define GL_TRACE_ERRORS_BIT_MESA 0x0020 -#define GL_TRACE_MASK_MESA 0x8755 -#define GL_TRACE_NAME_MESA 0x8756 - -GLAPI void GLAPIENTRY glEnableTraceMESA( GLbitfield mask ); -GLAPI void GLAPIENTRY glDisableTraceMESA( GLbitfield mask ); -GLAPI void GLAPIENTRY glNewTraceMESA( GLbitfield mask, const GLubyte * traceName ); -GLAPI void GLAPIENTRY glEndTraceMESA( void ); -GLAPI void GLAPIENTRY glTraceAssertAttribMESA( GLbitfield attribMask ); -GLAPI void GLAPIENTRY glTraceCommentMESA( const GLubyte * comment ); -GLAPI void GLAPIENTRY glTraceTextureMESA( GLuint name, const GLubyte* comment ); -GLAPI void GLAPIENTRY glTraceListMESA( GLuint name, const GLubyte* comment ); -GLAPI void GLAPIENTRY glTracePointerMESA( GLvoid* pointer, const GLubyte* comment ); -GLAPI void GLAPIENTRY glTracePointerRangeMESA( const GLvoid* first, const GLvoid* last, const GLubyte* comment ); - -#endif /* GL_MESA_trace */ - - /* * ???. GL_MESA_packed_depth_stencil * XXX obsolete diff --git a/include/GL/gl_mangle.h b/include/GL/gl_mangle.h index 2e6558def1a..7416d5372cd 100644 --- a/include/GL/gl_mangle.h +++ b/include/GL/gl_mangle.h @@ -274,7 +274,6 @@ #define glDetailTexFuncSGIS MANGLE(DetailTexFuncSGIS) #define glDisableClientState MANGLE(DisableClientState) #define glDisable MANGLE(Disable) -#define glDisableTraceMESA MANGLE(DisableTraceMESA) #define glDisableVariantClientStateEXT MANGLE(DisableVariantClientStateEXT) #define glDisableVertexAttribArrayARB MANGLE(DisableVertexAttribArrayARB) #define glDisableVertexAttribArray MANGLE(DisableVertexAttribArray) @@ -302,7 +301,6 @@ #define glElementPointerATI MANGLE(ElementPointerATI) #define glEnableClientState MANGLE(EnableClientState) #define glEnable MANGLE(Enable) -#define glEnableTraceMESA MANGLE(EnableTraceMESA) #define glEnableVariantClientStateEXT MANGLE(EnableVariantClientStateEXT) #define glEnableVertexAttribArrayARB MANGLE(EnableVertexAttribArrayARB) #define glEnableVertexAttribArray MANGLE(EnableVertexAttribArray) @@ -312,7 +310,6 @@ #define glEndOcclusionQueryNV MANGLE(EndOcclusionQueryNV) #define glEndQueryARB MANGLE(EndQueryARB) #define glEndQuery MANGLE(EndQuery) -#define glEndTraceMESA MANGLE(EndTraceMESA) #define glEndVertexShaderEXT MANGLE(EndVertexShaderEXT) #define glEvalCoord1d MANGLE(EvalCoord1d) #define glEvalCoord1dv MANGLE(EvalCoord1dv) @@ -781,7 +778,6 @@ #define glMultTransposeMatrixf MANGLE(MultTransposeMatrixf) #define glNewList MANGLE(NewList) #define glNewObjectBufferATI MANGLE(NewObjectBufferATI) -#define glNewTraceMESA MANGLE(NewTraceMESA) #define glNormal3b MANGLE(Normal3b) #define glNormal3bv MANGLE(Normal3bv) #define glNormal3d MANGLE(Normal3d) @@ -923,6 +919,7 @@ #define glRectsv MANGLE(Rectsv) #define glReferencePlaneSGIX MANGLE(ReferencePlaneSGIX) #define glRenderbufferStorageEXT MANGLE(RenderbufferStorageEXT) +#define glRenderbufferStorageMultisampleEXT MANGLE(RenderbufferStorageMultisampleEXT) #define glRenderMode MANGLE(RenderMode) #define glReplacementCodePointerSUN MANGLE(ReplacementCodePointerSUN) #define glReplacementCodeubSUN MANGLE(ReplacementCodeubSUN) @@ -1022,6 +1019,7 @@ #define glSpriteParameteriSGIX MANGLE(SpriteParameteriSGIX) #define glSpriteParameterivSGIX MANGLE(SpriteParameterivSGIX) #define glStartInstrumentsSGIX MANGLE(StartInstrumentsSGIX) +#define glStencilClearTagEXT MANGLE(StencilClearTagEXT) #define glStencilFunc MANGLE(StencilFunc) #define glStencilFuncSeparateATI MANGLE(StencilFuncSeparateATI) #define glStencilFuncSeparate MANGLE(StencilFuncSeparate) @@ -1140,12 +1138,6 @@ #define glTextureLightEXT MANGLE(TextureLightEXT) #define glTextureMaterialEXT MANGLE(TextureMaterialEXT) #define glTextureNormalEXT MANGLE(TextureNormalEXT) -#define glTraceAssertAttribMESA MANGLE(TraceAssertAttribMESA) -#define glTraceCommentMESA MANGLE(TraceCommentMESA) -#define glTraceListMESA MANGLE(TraceListMESA) -#define glTracePointerMESA MANGLE(TracePointerMESA) -#define glTracePointerRangeMESA MANGLE(TracePointerRangeMESA) -#define glTraceTextureMESA MANGLE(TraceTextureMESA) #define glTrackMatrixNV MANGLE(TrackMatrixNV) #define glTranslated MANGLE(Translated) #define glTranslatef MANGLE(Translatef) @@ -1183,10 +1175,16 @@ #define glUniform4iv MANGLE(Uniform4iv) #define glUniformMatrix2fvARB MANGLE(UniformMatrix2fvARB) #define glUniformMatrix2fv MANGLE(UniformMatrix2fv) +#define glUniformMatrix2x3fv MANGLE(UniformMatrix2x3fv) +#define glUniformMatrix2x4fv MANGLE(UniformMatrix2x4fv) #define glUniformMatrix3fvARB MANGLE(UniformMatrix3fvARB) #define glUniformMatrix3fv MANGLE(UniformMatrix3fv) +#define glUniformMatrix3x2fv MANGLE(UniformMatrix3x2fv) +#define glUniformMatrix3x4fv MANGLE(UniformMatrix3x4fv) #define glUniformMatrix4fvARB MANGLE(UniformMatrix4fvARB) #define glUniformMatrix4fv MANGLE(UniformMatrix4fv) +#define glUniformMatrix4x2fv MANGLE(UniformMatrix4x2fv) +#define glUniformMatrix4x3fv MANGLE(UniformMatrix4x3fv) #define glUnlockArraysEXT MANGLE(UnlockArraysEXT) #define glUnmapBufferARB MANGLE(UnmapBufferARB) #define glUnmapBuffer MANGLE(UnmapBuffer) diff --git a/src/glu/sgi/libutil/mipmap.c b/src/glu/sgi/libutil/mipmap.c index 5c28c858ec6..44f519a4e21 100644 --- a/src/glu/sgi/libutil/mipmap.c +++ b/src/glu/sgi/libutil/mipmap.c @@ -377,6 +377,7 @@ static void halveImage_ubyte(GLint components, GLuint width, GLuint height, { int i, j, k; int newwidth, newheight; + int padBytes; GLubyte *s; const char *t; @@ -390,6 +391,7 @@ static void halveImage_ubyte(GLint components, GLuint width, GLuint height, newwidth = width / 2; newheight = height / 2; + padBytes = ysize - (width*group_size); s = dataout; t = (const char *)datain; @@ -405,6 +407,7 @@ static void halveImage_ubyte(GLint components, GLuint width, GLuint height, } t += group_size; } + t += padBytes; t += ysize; } } @@ -476,6 +479,7 @@ static void halveImage_byte(GLint components, GLuint width, GLuint height, { int i, j, k; int newwidth, newheight; + int padBytes; GLbyte *s; const char *t; @@ -489,6 +493,7 @@ static void halveImage_byte(GLint components, GLuint width, GLuint height, newwidth = width / 2; newheight = height / 2; + padBytes = ysize - (width*group_size); s = dataout; t = (const char *)datain; @@ -504,6 +509,7 @@ static void halveImage_byte(GLint components, GLuint width, GLuint height, } t += group_size; } + t += padBytes; t += ysize; } } @@ -573,6 +579,7 @@ static void halveImage_ushort(GLint components, GLuint width, GLuint height, { int i, j, k; int newwidth, newheight; + int padBytes; GLushort *s; const char *t; @@ -586,6 +593,7 @@ static void halveImage_ushort(GLint components, GLuint width, GLuint height, newwidth = width / 2; newheight = height / 2; + padBytes = ysize - (width*group_size); s = dataout; t = (const char *)datain; @@ -602,6 +610,7 @@ static void halveImage_ushort(GLint components, GLuint width, GLuint height, } t += group_size; } + t += padBytes; t += ysize; } else @@ -616,6 +625,7 @@ static void halveImage_ushort(GLint components, GLuint width, GLuint height, } t += group_size; } + t += padBytes; t += ysize; } } @@ -708,6 +718,7 @@ static void halveImage_short(GLint components, GLuint width, GLuint height, { int i, j, k; int newwidth, newheight; + int padBytes; GLshort *s; const char *t; @@ -721,6 +732,7 @@ static void halveImage_short(GLint components, GLuint width, GLuint height, newwidth = width / 2; newheight = height / 2; + padBytes = ysize - (width*group_size); s = dataout; t = (const char *)datain; @@ -737,6 +749,7 @@ static void halveImage_short(GLint components, GLuint width, GLuint height, } t += group_size; } + t += padBytes; t += ysize; } else @@ -758,6 +771,7 @@ static void halveImage_short(GLint components, GLuint width, GLuint height, } t += group_size; } + t += padBytes; t += ysize; } } @@ -850,6 +864,7 @@ static void halveImage_uint(GLint components, GLuint width, GLuint height, { int i, j, k; int newwidth, newheight; + int padBytes; GLuint *s; const char *t; @@ -863,6 +878,7 @@ static void halveImage_uint(GLint components, GLuint width, GLuint height, newwidth = width / 2; newheight = height / 2; + padBytes = ysize - (width*group_size); s = dataout; t = (const char *)datain; @@ -881,6 +897,7 @@ static void halveImage_uint(GLint components, GLuint width, GLuint height, } t += group_size; } + t += padBytes; t += ysize; } else @@ -899,6 +916,7 @@ static void halveImage_uint(GLint components, GLuint width, GLuint height, } t += group_size; } + t += padBytes; t += ysize; } } @@ -990,6 +1008,7 @@ static void halveImage_int(GLint components, GLuint width, GLuint height, { int i, j, k; int newwidth, newheight; + int padBytes; GLint *s; const char *t; @@ -1003,6 +1022,7 @@ static void halveImage_int(GLint components, GLuint width, GLuint height, newwidth = width / 2; newheight = height / 2; + padBytes = ysize - (width*group_size); s = dataout; t = (const char *)datain; @@ -1019,6 +1039,7 @@ static void halveImage_int(GLint components, GLuint width, GLuint height, } t += group_size; } + t += padBytes; t += ysize; } else @@ -1041,6 +1062,7 @@ static void halveImage_int(GLint components, GLuint width, GLuint height, } t += group_size; } + t += padBytes; t += ysize; } } @@ -1134,6 +1156,7 @@ static void halveImage_float(GLint components, GLuint width, GLuint height, { int i, j, k; int newwidth, newheight; + int padBytes; GLfloat *s; const char *t; @@ -1147,6 +1170,7 @@ static void halveImage_float(GLint components, GLuint width, GLuint height, newwidth = width / 2; newheight = height / 2; + padBytes = ysize - (width*group_size); s = dataout; t = (const char *)datain; @@ -1163,6 +1187,7 @@ static void halveImage_float(GLint components, GLuint width, GLuint height, } t += group_size; } + t += padBytes; t += ysize; } else @@ -1183,6 +1208,7 @@ static void halveImage_float(GLint components, GLuint width, GLuint height, } t += group_size; } + t += padBytes; t += ysize; } } @@ -3845,10 +3871,12 @@ static int gluBuild2DMipmapLevelsCore(GLenum target, GLint internalFormat, if (width == newwidth && height == newheight) { /* Use usersImage for level userLevel */ if (baseLevel <= level && level <= maxLevel) { + glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length); glTexImage2D(target, level, internalFormat, width, height, 0, format, type, usersImage); } + glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); if(levels == 0) { /* we're done. clean up and return */ glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment); glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows); @@ -8643,7 +8671,8 @@ static void halveImageSlice(int components, int halfHeight= height / 2; int halfDepth= depth / 2; const char *src= (const char *)dataIn; - int padBytes= rowSizeInBytes - (width * groupSizeInBytes); + int rowPadBytes= rowSizeInBytes - (width * groupSizeInBytes); + int imagePadBytes= imageSizeInBytes - (width*height*groupSizeInBytes); int outIndex= 0; assert((width == 1 || height == 1) && depth >= 2); @@ -8727,7 +8756,7 @@ static void halveImageSlice(int components, /* skip over to next horizontal square of 4 */ src+= groupSizeInBytes; } /* for jj */ - src+= padBytes; + src+= rowPadBytes; src+= rowSizeInBytes; } /* for ii */ @@ -8772,11 +8801,12 @@ static void halveImageSlice(int components, src+= elementSizeInBytes; } /* for cc */ - src+= padBytes; + src+= rowPadBytes; /* skip over to next vertical square of 4 */ src+= rowSizeInBytes; } /* for jj */ + src+= imagePadBytes; src+= imageSizeInBytes; } /* for ii */ @@ -8816,7 +8846,8 @@ static void halveImage3D(int components, int halfHeight= height / 2; int halfDepth= depth / 2; const char *src= (const char *) dataIn; - int padBytes= rowSizeInBytes - (width*groupSizeInBytes); + int rowPadBytes= rowSizeInBytes - (width*groupSizeInBytes); + int imagePadBytes= imageSizeInBytes - (width*height*groupSizeInBytes); int outIndex= 0; for (dd= 0; dd < halfDepth; dd++) { @@ -8872,7 +8903,7 @@ static void halveImage3D(int components, src+= groupSizeInBytes; } /* for jj */ /* skip past pad bytes, if any, to get to next row */ - src+= padBytes; + src+= rowPadBytes; /* src is at beginning of a row here, but it's the second row of * the square block of 4 pixels that we just worked on so we @@ -8887,6 +8918,9 @@ static void halveImage3D(int components, src+= rowSizeInBytes; } /* for ii */ + /* skip past pad bytes, if any, to get to next image */ + src+= imagePadBytes; + src+= imageSizeInBytes; } /* for dd */ diff --git a/src/mesa/drivers/dri/i965/brw_save_api.c b/src/mesa/drivers/dri/i965/brw_save_api.c index 9c0e4af48a5..c541fbe0f46 100644 --- a/src/mesa/drivers/dri/i965/brw_save_api.c +++ b/src/mesa/drivers/dri/i965/brw_save_api.c @@ -529,7 +529,7 @@ static void _save_upgrade_vertex( GLcontext *ctx, /* Need to note this and fix up at runtime (or loopback): */ - if (save->currentsz[attr][0] == 0) { + if (attr != BRW_ATTRIB_POS && save->currentsz[attr][0] == 0) { assert(oldsz == 0); save->dangling_attr_ref = GL_TRUE; } @@ -855,10 +855,14 @@ static void GLAPIENTRY _save_OBE_DrawArrays(GLenum mode, GLint start, GLsizei co if (!_mesa_validate_DrawArrays( ctx, mode, start, count )) return; + _ae_map_vbos( ctx ); + brw_save_NotifyBegin( ctx, mode | BRW_SAVE_PRIM_WEAK ); for (i = 0; i < count; i++) CALL_ArrayElement(GET_DISPATCH(), (start + i)); CALL_End(GET_DISPATCH(), ()); + + _ae_unmap_vbos( ctx ); } /* Could do better by copying the arrays and element list intact and @@ -873,6 +877,8 @@ static void GLAPIENTRY _save_OBE_DrawElements(GLenum mode, GLsizei count, GLenum if (!_mesa_validate_DrawElements( ctx, mode, count, type, indices )) return; + _ae_map_vbos( ctx ); + brw_save_NotifyBegin( ctx, mode | BRW_SAVE_PRIM_WEAK ); switch (type) { @@ -894,6 +900,8 @@ static void GLAPIENTRY _save_OBE_DrawElements(GLenum mode, GLsizei count, GLenum } CALL_End(GET_DISPATCH(), ()); + + _ae_unmap_vbos( ctx ); } static void GLAPIENTRY _save_OBE_DrawRangeElements(GLenum mode, diff --git a/src/mesa/drivers/dri/i965/brw_vs_tnl.c b/src/mesa/drivers/dri/i965/brw_vs_tnl.c index 1df111f6457..52bdb9d7614 100644 --- a/src/mesa/drivers/dri/i965/brw_vs_tnl.c +++ b/src/mesa/drivers/dri/i965/brw_vs_tnl.c @@ -404,7 +404,7 @@ static struct ureg register_const4f( struct tnl_program *p, values[1] = s1; values[2] = s2; values[3] = s3; - idx = _mesa_add_unnamed_constant( p->program->Base.Parameters, values ); + idx = _mesa_add_unnamed_constant( p->program->Base.Parameters, values, 4 ); return make_ureg(PROGRAM_STATE_VAR, idx); } diff --git a/src/mesa/drivers/dri/i965/brw_wm_fp.c b/src/mesa/drivers/dri/i965/brw_wm_fp.c index 04c7555b9b8..bb0aa356150 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_fp.c +++ b/src/mesa/drivers/dri/i965/brw_wm_fp.c @@ -432,7 +432,7 @@ static struct prog_src_register search_or_add_const4f( struct brw_wm_compile *c, return src_reg(PROGRAM_STATE_VAR, idx); } - idx = _mesa_add_unnamed_constant( paramList, values ); + idx = _mesa_add_unnamed_constant( paramList, values, 4 ); return src_reg(PROGRAM_STATE_VAR, idx); } diff --git a/src/mesa/drivers/dri/r200/r200_context.c b/src/mesa/drivers/dri/r200/r200_context.c index 06b2a152d9f..bb7a16c9327 100644 --- a/src/mesa/drivers/dri/r200/r200_context.c +++ b/src/mesa/drivers/dri/r200/r200_context.c @@ -87,21 +87,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. int R200_DEBUG = (0); #endif - -/* Return the width and height of the given buffer. - */ -static void r200GetBufferSize( GLframebuffer *buffer, - GLuint *width, GLuint *height ) -{ - GET_CURRENT_CONTEXT(ctx); - r200ContextPtr rmesa = R200_CONTEXT(ctx); - - LOCK_HARDWARE( rmesa ); - *width = rmesa->dri.drawable->w; - *height = rmesa->dri.drawable->h; - UNLOCK_HARDWARE( rmesa ); -} - /* Return various strings for glGetString(). */ static const GLubyte *r200GetString( GLcontext *ctx, GLenum name ) @@ -233,7 +218,7 @@ static const struct tnl_pipeline_stage *r200_pipeline[] = { */ static void r200InitDriverFuncs( struct dd_function_table *functions ) { - functions->GetBufferSize = r200GetBufferSize; + functions->GetBufferSize = NULL; /* OBSOLETE */ functions->GetString = r200GetString; } @@ -700,7 +685,13 @@ r200MakeCurrent( __DRIcontextPrivate *driContextPriv, if ( newCtx->dri.drawable != driDrawPriv ) { driDrawableInitVBlank( driDrawPriv, newCtx->vblank_flags, &newCtx->vbl_seq ); + } + + if ( newCtx->dri.drawable != driDrawPriv || + newCtx->dri.readable != driReadPriv ) { newCtx->dri.drawable = driDrawPriv; + newCtx->dri.readable = driReadPriv; + r200UpdateWindow( newCtx->glCtx ); r200UpdateViewportOffset( newCtx->glCtx ); } diff --git a/src/mesa/drivers/dri/r200/r200_context.h b/src/mesa/drivers/dri/r200/r200_context.h index c6910f5238a..9f109e07ff5 100644 --- a/src/mesa/drivers/dri/r200/r200_context.h +++ b/src/mesa/drivers/dri/r200/r200_context.h @@ -699,6 +699,7 @@ struct r200_dri_mirror { __DRIcontextPrivate *context; /* DRI context */ __DRIscreenPrivate *screen; /* DRI screen */ __DRIdrawablePrivate *drawable; /* DRI drawable bound to this ctx */ + __DRIdrawablePrivate *readable; /* DRI readable bound to this ctx */ drm_context_t hwContext; drm_hw_lock_t *hwLock; diff --git a/src/mesa/drivers/dri/r200/r200_lock.c b/src/mesa/drivers/dri/r200/r200_lock.c index 66bb075864f..bcc0c916396 100644 --- a/src/mesa/drivers/dri/r200/r200_lock.c +++ b/src/mesa/drivers/dri/r200/r200_lock.c @@ -69,7 +69,8 @@ r200UpdatePageFlipping( r200ContextPtr rmesa ) */ void r200GetLock( r200ContextPtr rmesa, GLuint flags ) { - __DRIdrawablePrivate *dPriv = rmesa->dri.drawable; + __DRIdrawablePrivate *drawable = rmesa->dri.drawable; + __DRIdrawablePrivate *readable = rmesa->dri.readable; __DRIscreenPrivate *sPriv = rmesa->dri.screen; drm_radeon_sarea_t *sarea = rmesa->sarea; int i; @@ -84,17 +85,20 @@ void r200GetLock( r200ContextPtr rmesa, GLuint flags ) * Since the hardware state depends on having the latest drawable * clip rects, all state checking must be done _after_ this call. */ - DRI_VALIDATE_DRAWABLE_INFO( sPriv, dPriv ); + DRI_VALIDATE_DRAWABLE_INFO( sPriv, drawable ); + if (drawable != readable) { + DRI_VALIDATE_DRAWABLE_INFO( sPriv, readable ); + } - if ( rmesa->lastStamp != dPriv->lastStamp ) { + if ( rmesa->lastStamp != drawable->lastStamp ) { r200UpdatePageFlipping( rmesa ); if (rmesa->glCtx->DrawBuffer->_ColorDrawBufferMask[0] == BUFFER_BIT_BACK_LEFT) r200SetCliprects( rmesa, GL_BACK_LEFT ); else r200SetCliprects( rmesa, GL_FRONT_LEFT ); r200UpdateViewportOffset( rmesa->glCtx ); - driUpdateFramebufferSize(rmesa->glCtx, dPriv); - rmesa->lastStamp = dPriv->lastStamp; + driUpdateFramebufferSize(rmesa->glCtx, drawable); + rmesa->lastStamp = drawable->lastStamp; } R200_STATECHANGE( rmesa, ctx ); diff --git a/src/mesa/drivers/dri/r200/r200_state.c b/src/mesa/drivers/dri/r200/r200_state.c index 097fbc868a4..dc1fbef72ee 100644 --- a/src/mesa/drivers/dri/r200/r200_state.c +++ b/src/mesa/drivers/dri/r200/r200_state.c @@ -40,6 +40,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "enums.h" #include "colormac.h" #include "light.h" +#include "framebuffer.h" #include "swrast/swrast.h" #include "array_cache/acache.h" @@ -1845,23 +1846,26 @@ static void r200LogicOpCode( GLcontext *ctx, GLenum opcode ) void r200SetCliprects( r200ContextPtr rmesa, GLenum mode ) { - __DRIdrawablePrivate *dPriv = rmesa->dri.drawable; + __DRIdrawablePrivate *const drawable = rmesa->dri.drawable; + __DRIdrawablePrivate *const readable = rmesa->dri.readable; + GLframebuffer *const draw_fb = (GLframebuffer*) drawable->driverPrivate; + GLframebuffer *const read_fb = (GLframebuffer*) readable->driverPrivate; switch ( mode ) { case GL_FRONT_LEFT: - rmesa->numClipRects = dPriv->numClipRects; - rmesa->pClipRects = dPriv->pClipRects; + rmesa->numClipRects = drawable->numClipRects; + rmesa->pClipRects = drawable->pClipRects; break; case GL_BACK_LEFT: /* Can't ignore 2d windows if we are page flipping. */ - if ( dPriv->numBackClipRects == 0 || rmesa->doPageFlip ) { - rmesa->numClipRects = dPriv->numClipRects; - rmesa->pClipRects = dPriv->pClipRects; + if ( drawable->numBackClipRects == 0 || rmesa->doPageFlip ) { + rmesa->numClipRects = drawable->numClipRects; + rmesa->pClipRects = drawable->pClipRects; } else { - rmesa->numClipRects = dPriv->numBackClipRects; - rmesa->pClipRects = dPriv->pBackClipRects; + rmesa->numClipRects = drawable->numBackClipRects; + rmesa->pClipRects = drawable->pBackClipRects; } break; default: @@ -1869,6 +1873,21 @@ void r200SetCliprects( r200ContextPtr rmesa, GLenum mode ) return; } + if ((draw_fb->Width != drawable->w) || (draw_fb->Height != drawable->h)) { + _mesa_resize_framebuffer(rmesa->glCtx, draw_fb, + drawable->w, drawable->h); + draw_fb->Initialized = GL_TRUE; + } + + if (drawable != readable) { + if ((read_fb->Width != readable->w) || + (read_fb->Height != readable->h)) { + _mesa_resize_framebuffer(rmesa->glCtx, read_fb, + readable->w, readable->h); + read_fb->Initialized = GL_TRUE; + } + } + if (rmesa->state.scissor.enabled) r200RecalcScissorRects( rmesa ); } diff --git a/src/mesa/drivers/dri/r300/r300_context.h b/src/mesa/drivers/dri/r300/r300_context.h index df73cdedc11..dd3ecbb2357 100644 --- a/src/mesa/drivers/dri/r300/r300_context.h +++ b/src/mesa/drivers/dri/r300/r300_context.h @@ -549,6 +549,7 @@ struct r300_stencilbuffer_state { /* Can be tested with colormat currently. */ #define VSF_MAX_FRAGMENT_TEMPS (14) +#define STATE_R300_WINDOW_DIMENSION (STATE_INTERNAL_DRIVER+0) struct r300_vertex_shader_fragment { int length; @@ -592,7 +593,8 @@ struct r300_vertex_shader_state { extern int hw_tcl_on; -#define CURRENT_VERTEX_SHADER(ctx) (ctx->VertexProgram._Current) +//#define CURRENT_VERTEX_SHADER(ctx) (ctx->VertexProgram._Current) +#define CURRENT_VERTEX_SHADER(ctx) (R300_CONTEXT(ctx)->selected_vp) /* Should but doesnt work */ //#define CURRENT_VERTEX_SHADER(ctx) (R300_CONTEXT(ctx)->curr_vp) @@ -607,15 +609,22 @@ extern int hw_tcl_on; /* r300_vertex_shader_state and r300_vertex_program should probably be merged together someday. * Keeping them them seperate for now should ensure fixed pipeline keeps functioning properly. */ + +struct r300_vertex_program_key { + GLuint InputsRead; + GLuint OutputsWritten; +}; + struct r300_vertex_program { - struct gl_vertex_program mesa_program; /* Must be first */ + struct r300_vertex_program *next; + struct r300_vertex_program_key key; int translated; struct r300_vertex_shader_fragment program; - struct r300_vertex_shader_fragment params; int pos_end; int num_temporaries; /* Number of temp vars used by program */ + int wpos_idx; int inputs[VERT_ATTRIB_MAX]; int outputs[VERT_RESULT_MAX]; int native; @@ -623,6 +632,12 @@ struct r300_vertex_program { int use_ref_count; }; +struct r300_vertex_program_cont { + struct gl_vertex_program mesa_program; /* Must be first */ + struct r300_vertex_shader_fragment params; + struct r300_vertex_program *progs; +}; + #define PFS_MAX_ALU_INST 64 #define PFS_MAX_TEX_INST 64 #define PFS_MAX_TEX_INDIRECT 4 @@ -797,6 +812,7 @@ struct r300_context { struct r300_cmdbuf cmdbuf; struct r300_state state; struct gl_vertex_program *curr_vp; + struct r300_vertex_program *selected_vp; /* Vertex buffers */ @@ -854,9 +870,9 @@ extern GLboolean r300CreateContext(const __GLcontextModes * glVisual, extern int r300_get_num_verts(r300ContextPtr rmesa, int num_verts, int prim); -void r300_translate_vertex_shader(struct r300_vertex_program *vp); +extern void r300_select_vertex_shader(r300ContextPtr r300); extern void r300InitShaderFuncs(struct dd_function_table *functions); -extern int r300VertexProgUpdateParams(GLcontext *ctx, struct r300_vertex_program *vp, float *dst); +extern int r300VertexProgUpdateParams(GLcontext *ctx, struct r300_vertex_program_cont *vp, float *dst); extern int r300Fallback(GLcontext *ctx); extern void radeon_vb_to_rvb(r300ContextPtr rmesa, struct radeon_vertex_buffer *rvb, struct vertex_buffer *vb); diff --git a/src/mesa/drivers/dri/r300/r300_fragprog.c b/src/mesa/drivers/dri/r300/r300_fragprog.c index 7793c5eb2e3..cab54512146 100644 --- a/src/mesa/drivers/dri/r300/r300_fragprog.c +++ b/src/mesa/drivers/dri/r300/r300_fragprog.c @@ -1555,6 +1555,13 @@ static void init_program(struct r300_fragment_program *rp) } InputsRead &= ~FRAG_BITS_TEX_ANY; + /* fragment position treated as a texcoord */ + if (InputsRead & FRAG_BIT_WPOS) { + cs->inputs[FRAG_ATTRIB_WPOS].refcount = 0; + cs->inputs[FRAG_ATTRIB_WPOS].reg = get_hw_temp(rp); + } + InputsRead &= ~FRAG_BIT_WPOS; + /* Then primary colour */ if (InputsRead & FRAG_BIT_COL0) { cs->inputs[FRAG_ATTRIB_COL0].refcount = 0; diff --git a/src/mesa/drivers/dri/r300/r300_maos.c b/src/mesa/drivers/dri/r300/r300_maos.c index 2fdad519fd5..fcb87cbbb59 100644 --- a/src/mesa/drivers/dri/r300/r300_maos.c +++ b/src/mesa/drivers/dri/r300/r300_maos.c @@ -407,8 +407,8 @@ int r300EmitArrays(GLcontext *ctx) if (hw_tcl_on) { struct r300_vertex_program *prog=(struct r300_vertex_program *)CURRENT_VERTEX_SHADER(ctx); inputs = prog->inputs; - InputsRead = CURRENT_VERTEX_SHADER(ctx)->Base.InputsRead; - OutputsWritten = CURRENT_VERTEX_SHADER(ctx)->Base.OutputsWritten; + InputsRead = CURRENT_VERTEX_SHADER(ctx)->key.InputsRead; + OutputsWritten = CURRENT_VERTEX_SHADER(ctx)->key.OutputsWritten; } else { DECLARE_RENDERINPUTS(inputs_bitset); inputs = r300->state.sw_tcl_inputs; diff --git a/src/mesa/drivers/dri/r300/r300_shader.c b/src/mesa/drivers/dri/r300/r300_shader.c index 576b18953f9..26721e8dfda 100644 --- a/src/mesa/drivers/dri/r300/r300_shader.c +++ b/src/mesa/drivers/dri/r300/r300_shader.c @@ -12,13 +12,13 @@ r300BindProgram(GLcontext *ctx, GLenum target, struct gl_program *prog) { r300ContextPtr rmesa = R300_CONTEXT(ctx); - struct r300_vertex_program *vp=(void *)prog; + struct r300_vertex_program_cont *vp=(void *)prog; switch(target){ case GL_VERTEX_PROGRAM_ARB: - rmesa->curr_vp = (struct gl_vertex_program *)vp; - vp->ref_count++; + //rmesa->curr_vp = (struct gl_vertex_program *)vp; + //vp->ref_count++; #if 0 if((vp->ref_count % 1500) == 0) { fprintf(stderr, "id %p, ref_count %d\n", vp, vp->ref_count); @@ -37,13 +37,13 @@ r300BindProgram(GLcontext *ctx, GLenum target, struct gl_program *prog) static struct gl_program * r300NewProgram(GLcontext *ctx, GLenum target, GLuint id) { - struct r300_vertex_program *vp; + struct r300_vertex_program_cont *vp; struct r300_fragment_program *fp; switch(target){ case GL_VERTEX_STATE_PROGRAM_NV: case GL_VERTEX_PROGRAM_ARB: - vp=CALLOC_STRUCT(r300_vertex_program); + vp=CALLOC_STRUCT(r300_vertex_program_cont); return _mesa_init_vertex_program(ctx, &vp->mesa_program, target, id); case GL_FRAGMENT_PROGRAM_ARB: fp=CALLOC_STRUCT(r300_fragment_program); @@ -77,13 +77,14 @@ r300DeleteProgram(GLcontext *ctx, struct gl_program *prog) static void r300ProgramStringNotify(GLcontext *ctx, GLenum target, struct gl_program *prog) { - struct r300_vertex_program *vp=(void *)prog; + struct r300_vertex_program_cont *vp=(void *)prog; struct r300_fragment_program *fp = (struct r300_fragment_program *) prog; switch(target) { case GL_VERTEX_PROGRAM_ARB: - vp->translated = GL_FALSE; - memset(&vp->translated, 0, sizeof(struct r300_vertex_program) - sizeof(struct gl_vertex_program)); + vp->progs = NULL; + /*vp->translated = GL_FALSE; + memset(&vp->translated, 0, sizeof(struct r300_vertex_program) - sizeof(struct gl_vertex_program));*/ /*r300_translate_vertex_shader(vp);*/ break; case GL_FRAGMENT_PROGRAM_ARB: diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index b06336457de..72255066d59 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -1044,6 +1044,59 @@ r300UpdateDrawBuffer(GLcontext *ctx) #endif } +static void r300FetchStateParameter(GLcontext *ctx, const enum state_index state[], + GLfloat *value) +{ + r300ContextPtr r300 = R300_CONTEXT(ctx); + + switch(state[0]) + { + case STATE_INTERNAL: + switch(state[1]) + { + case STATE_R300_WINDOW_DIMENSION: + value[0] = r300->radeon.dri.drawable->w; /* width */ + value[1] = r300->radeon.dri.drawable->h; /* height */ + value[2] = 0.5F; /* for moving range [-1 1] -> [0 1] */ + value[3] = 1.0F; /* not used */ + break; + default:; + } + default:; + } +} + +/** + * Update R300's own internal state parameters. + * For now just STATE_R300_WINDOW_DIMENSION + */ +static void r300UpdateStateParameters(GLcontext * ctx, GLuint new_state) +{ + struct r300_vertex_program_cont *vpc; + struct gl_program_parameter_list *paramList; + GLuint i; + + if(!(new_state & (_NEW_BUFFERS|_NEW_PROGRAM))) + return; + + vpc = (struct r300_vertex_program_cont *)ctx->VertexProgram._Current; + if (!vpc) + return; + + paramList = vpc->mesa_program.Base.Parameters; + + if (!paramList) + return; + + for (i = 0; i < paramList->NumParameters; i++) { + if (paramList->Parameters[i].Type == PROGRAM_STATE_VAR){ + r300FetchStateParameter(ctx, + paramList->Parameters[i].StateIndexes, + paramList->ParameterValues[i]); + } + } +} + /* ============================================================= * Polygon state */ @@ -1285,7 +1338,7 @@ void r300_setup_rs_unit(GLcontext *ctx) int i; if(hw_tcl_on) - OutputsWritten.vp_outputs = CURRENT_VERTEX_SHADER(ctx)->Base.OutputsWritten; + OutputsWritten.vp_outputs = CURRENT_VERTEX_SHADER(ctx)->key.OutputsWritten; else RENDERINPUTS_COPY( OutputsWritten.index_bitset, r300->state.render_inputs_bitset ); @@ -1304,6 +1357,20 @@ void r300_setup_rs_unit(GLcontext *ctx) r300->hw.rr.cmd[R300_RR_ROUTE_1] = 0; + if (InputsRead & FRAG_BIT_WPOS){ + for (i = 0; i < ctx->Const.MaxTextureUnits; i++) + if (!(InputsRead & (FRAG_BIT_TEX0 << i))) + break; + + if(i == ctx->Const.MaxTextureUnits){ + fprintf(stderr, "\tno free texcoord found...\n"); + exit(0); + } + + InputsRead |= (FRAG_BIT_TEX0 << i); + InputsRead &= ~FRAG_BIT_WPOS; + } + for (i=0;iConst.MaxTextureUnits;i++) { r300->hw.ri.cmd[R300_RI_INTERP_0+i] = 0 | R300_RS_INTERP_USED @@ -1610,7 +1677,7 @@ void r300SetupVertexProgram(r300ContextPtr rmesa) ((drm_r300_cmd_header_t*)rmesa->hw.vpp.cmd)->vpu.count = 0; R300_STATECHANGE(rmesa, vpp); - param_count = r300VertexProgUpdateParams(ctx, prog, (float *)&rmesa->hw.vpp.cmd[R300_VPP_PARAM_0]); + param_count = r300VertexProgUpdateParams(ctx, (struct r300_vertex_program_cont *)ctx->VertexProgram._Current/*prog*/, (float *)&rmesa->hw.vpp.cmd[R300_VPP_PARAM_0]); bump_vpu_count(rmesa->hw.vpp.cmd, param_count); param_count /= 4; @@ -1669,9 +1736,10 @@ void r300UpdateShaders(r300ContextPtr rmesa) TNL_CONTEXT(ctx)->vb.AttribPtr[i] = rmesa->temp_attrib[i]; } + r300_select_vertex_shader(rmesa); vp = (struct r300_vertex_program *)CURRENT_VERTEX_SHADER(ctx); - if (vp->translated == GL_FALSE) - r300_translate_vertex_shader(vp); + /*if (vp->translated == GL_FALSE) + r300_translate_vertex_shader(vp);*/ if (vp->translated == GL_FALSE) { fprintf(stderr, "Failing back to sw-tcl\n"); hw_tcl_on = future_hw_tcl_on = 0; @@ -1679,6 +1747,7 @@ void r300UpdateShaders(r300ContextPtr rmesa) return ; } + r300UpdateStateParameters(ctx, _NEW_PROGRAM); } } @@ -1812,6 +1881,9 @@ static void r300InvalidateState(GLcontext * ctx, GLuint new_state) if (new_state & (_NEW_BUFFERS | _NEW_COLOR | _NEW_PIXEL)) { r300UpdateDrawBuffer(ctx); } + + r300UpdateStateParameters(ctx, new_state); + #ifndef CB_DPATH /* Go inefficiency! */ r300ResetHwState(r300); diff --git a/src/mesa/drivers/dri/r300/r300_vertexprog.c b/src/mesa/drivers/dri/r300/r300_vertexprog.c index cc932b86d99..2492a4a3a0a 100644 --- a/src/mesa/drivers/dri/r300/r300_vertexprog.c +++ b/src/mesa/drivers/dri/r300/r300_vertexprog.c @@ -95,7 +95,7 @@ static struct{ }; #undef OPN -int r300VertexProgUpdateParams(GLcontext *ctx, struct r300_vertex_program *vp, float *dst) +int r300VertexProgUpdateParams(GLcontext *ctx, struct r300_vertex_program_cont *vp, float *dst) { int pi; struct gl_vertex_program *mesa_vp = &vp->mesa_program; @@ -177,17 +177,9 @@ static unsigned long t_dst_class(enum register_file file) static unsigned long t_dst_index(struct r300_vertex_program *vp, struct prog_dst_register *dst) { - if(dst->File == PROGRAM_OUTPUT) { - if (vp->outputs[dst->Index] != -1) - return vp->outputs[dst->Index]; - else { - WARN_ONCE("Unknown output %d\n", dst->Index); - return 10; - } - }else if(dst->File == PROGRAM_ADDRESS) { - assert(dst->Index == 0); - } - + if(dst->File == PROGRAM_OUTPUT) + return vp->outputs[dst->Index]; + return dst->Index; } @@ -335,6 +327,18 @@ static unsigned long op_operands(enum prog_opcode opcode) return 0; } +static GLboolean valid_dst(struct r300_vertex_program *vp, struct prog_dst_register *dst) +{ + if(dst->File == PROGRAM_OUTPUT && vp->outputs[dst->Index] == -1){ + WARN_ONCE("Output %d not used by fragment program\n", dst->Index); + return GL_FALSE; + }else if(dst->File == PROGRAM_ADDRESS) { + assert(dst->Index == 0); + } + + return GL_TRUE; +} + /* TODO: Get rid of t_src_class call */ #define CMP_SRCS(a, b) ((a.RelAddr != b.RelAddr) || (a.Index != b.Index && \ ((t_src_class(a.File) == VSF_IN_CLASS_PARAM && \ @@ -384,10 +388,8 @@ static unsigned long op_operands(enum prog_opcode opcode) u_temp_i=VSF_MAX_FRAGMENT_TEMPS-1; \ } while (0) -void r300_translate_vertex_shader(struct r300_vertex_program *vp) +static void r300_translate_vertex_shader(struct r300_vertex_program *vp, struct prog_instruction *vpi) { - struct gl_vertex_program *mesa_vp= &vp->mesa_program; - struct prog_instruction *vpi; int i, cur_reg=0; VERTEX_SHADER_INSTRUCTION *o_inst; unsigned long operands; @@ -399,131 +401,9 @@ void r300_translate_vertex_shader(struct r300_vertex_program *vp) int u_temp_i=VSF_MAX_FRAGMENT_TEMPS-1; struct prog_src_register src[3]; - if (mesa_vp->Base.NumInstructions == 0) - return; - - if (getenv("R300_VP_SAFETY")) { - WARN_ONCE("R300_VP_SAFETY enabled.\n"); - - vpi = malloc((mesa_vp->Base.NumInstructions + VSF_MAX_FRAGMENT_TEMPS) * sizeof(struct prog_instruction)); - memset(vpi, 0, VSF_MAX_FRAGMENT_TEMPS * sizeof(struct prog_instruction)); - - for (i=0; i < VSF_MAX_FRAGMENT_TEMPS; i++) { - vpi[i].Opcode = OPCODE_MOV; - vpi[i].StringPos = 0; - vpi[i].Data = 0; - - vpi[i].DstReg.File = PROGRAM_TEMPORARY; - vpi[i].DstReg.Index = i; - vpi[i].DstReg.WriteMask = WRITEMASK_XYZW; - vpi[i].DstReg.CondMask = COND_TR; - - vpi[i].SrcReg[0].File = PROGRAM_STATE_VAR; - vpi[i].SrcReg[0].Index = 0; - vpi[i].SrcReg[0].Swizzle = MAKE_SWIZZLE4(SWIZZLE_ONE, SWIZZLE_ONE, SWIZZLE_ONE, SWIZZLE_ONE); - } - - memcpy(&vpi[i], mesa_vp->Base.Instructions, mesa_vp->Base.NumInstructions * sizeof(struct prog_instruction)); - - free(mesa_vp->Base.Instructions); - - mesa_vp->Base.Instructions = vpi; - - mesa_vp->Base.NumInstructions += VSF_MAX_FRAGMENT_TEMPS; - vpi = &mesa_vp->Base.Instructions[mesa_vp->Base.NumInstructions-1]; - - assert(vpi->Opcode == OPCODE_END); - } - - if (mesa_vp->IsPositionInvariant) { - struct gl_program_parameter_list *paramList; - GLint tokens[6] = { STATE_MATRIX, STATE_MVP, 0, 0, 0, STATE_MATRIX }; - -#ifdef PREFER_DP4 - tokens[5] = STATE_MATRIX; -#else - tokens[5] = STATE_MATRIX_TRANSPOSE; -#endif - paramList = mesa_vp->Base.Parameters; - - vpi = malloc((mesa_vp->Base.NumInstructions + 4) * sizeof(struct prog_instruction)); - memset(vpi, 0, 4 * sizeof(struct prog_instruction)); - - for (i=0; i < 4; i++) { - GLint idx; - tokens[3] = tokens[4] = i; - idx = _mesa_add_state_reference(paramList, tokens); -#ifdef PREFER_DP4 - vpi[i].Opcode = OPCODE_DP4; - vpi[i].StringPos = 0; - vpi[i].Data = 0; - - vpi[i].DstReg.File = PROGRAM_OUTPUT; - vpi[i].DstReg.Index = VERT_RESULT_HPOS; - vpi[i].DstReg.WriteMask = 1 << i; - vpi[i].DstReg.CondMask = COND_TR; - - vpi[i].SrcReg[0].File = PROGRAM_STATE_VAR; - vpi[i].SrcReg[0].Index = idx; - vpi[i].SrcReg[0].Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_W); - - vpi[i].SrcReg[1].File = PROGRAM_INPUT; - vpi[i].SrcReg[1].Index = VERT_ATTRIB_POS; - vpi[i].SrcReg[1].Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_W); -#else - if (i == 0) - vpi[i].Opcode = OPCODE_MUL; - else - vpi[i].Opcode = OPCODE_MAD; - - vpi[i].StringPos = 0; - vpi[i].Data = 0; - - if (i == 3) - vpi[i].DstReg.File = PROGRAM_OUTPUT; - else - vpi[i].DstReg.File = PROGRAM_TEMPORARY; - vpi[i].DstReg.Index = 0; - vpi[i].DstReg.WriteMask = 0xf; - vpi[i].DstReg.CondMask = COND_TR; - - vpi[i].SrcReg[0].File = PROGRAM_STATE_VAR; - vpi[i].SrcReg[0].Index = idx; - vpi[i].SrcReg[0].Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_W); - - vpi[i].SrcReg[1].File = PROGRAM_INPUT; - vpi[i].SrcReg[1].Index = VERT_ATTRIB_POS; - vpi[i].SrcReg[1].Swizzle = MAKE_SWIZZLE4(i, i, i, i); - - if (i > 0) { - vpi[i].SrcReg[2].File = PROGRAM_TEMPORARY; - vpi[i].SrcReg[2].Index = 0; - vpi[i].SrcReg[2].Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_W); - } -#endif - } - - memcpy(&vpi[i], mesa_vp->Base.Instructions, mesa_vp->Base.NumInstructions * sizeof(struct prog_instruction)); - - free(mesa_vp->Base.Instructions); - - mesa_vp->Base.Instructions = vpi; - - mesa_vp->Base.NumInstructions += 4; - vpi = &mesa_vp->Base.Instructions[mesa_vp->Base.NumInstructions-1]; - - assert(vpi->Opcode == OPCODE_END); - - mesa_vp->Base.InputsRead |= (1 << VERT_ATTRIB_POS); - mesa_vp->Base.OutputsWritten |= (1 << VERT_RESULT_HPOS); - - //fprintf(stderr, "IsPositionInvariant is set!\n"); - //_mesa_print_program(&mesa_vp->Base); - } - vp->pos_end=0; /* Not supported yet */ vp->program.length=0; - vp->num_temporaries=mesa_vp->Base.NumTemporaries; + /*vp->num_temporaries=mesa_vp->Base.NumTemporaries;*/ for(i=0; i < VERT_ATTRIB_MAX; i++) vp->inputs[i] = -1; @@ -531,42 +411,49 @@ void r300_translate_vertex_shader(struct r300_vertex_program *vp) for(i=0; i < VERT_RESULT_MAX; i++) vp->outputs[i] = -1; - assert(mesa_vp->Base.OutputsWritten & (1 << VERT_RESULT_HPOS)); + assert(vp->key.OutputsWritten & (1 << VERT_RESULT_HPOS)); /* Assign outputs */ - if(mesa_vp->Base.OutputsWritten & (1 << VERT_RESULT_HPOS)) + if(vp->key.OutputsWritten & (1 << VERT_RESULT_HPOS)) vp->outputs[VERT_RESULT_HPOS] = cur_reg++; - if(mesa_vp->Base.OutputsWritten & (1 << VERT_RESULT_PSIZ)) + if(vp->key.OutputsWritten & (1 << VERT_RESULT_PSIZ)) vp->outputs[VERT_RESULT_PSIZ] = cur_reg++; - if(mesa_vp->Base.OutputsWritten & (1 << VERT_RESULT_COL0)) + if(vp->key.OutputsWritten & (1 << VERT_RESULT_COL0)) vp->outputs[VERT_RESULT_COL0] = cur_reg++; - if(mesa_vp->Base.OutputsWritten & (1 << VERT_RESULT_COL1)) + if(vp->key.OutputsWritten & (1 << VERT_RESULT_COL1)) vp->outputs[VERT_RESULT_COL1] = cur_reg++; #if 0 /* Not supported yet */ - if(mesa_vp->Base.OutputsWritten & (1 << VERT_RESULT_BFC0)) + if(vp->key.OutputsWritten & (1 << VERT_RESULT_BFC0)) vp->outputs[VERT_RESULT_BFC0] = cur_reg++; - if(mesa_vp->Base.OutputsWritten & (1 << VERT_RESULT_BFC1)) + if(vp->key.OutputsWritten & (1 << VERT_RESULT_BFC1)) vp->outputs[VERT_RESULT_BFC1] = cur_reg++; - if(mesa_vp->Base.OutputsWritten & (1 << VERT_RESULT_FOGC)) + if(vp->key.OutputsWritten & (1 << VERT_RESULT_FOGC)) vp->outputs[VERT_RESULT_FOGC] = cur_reg++; #endif for(i=VERT_RESULT_TEX0; i <= VERT_RESULT_TEX7; i++) - if(mesa_vp->Base.OutputsWritten & (1 << i)) + if(vp->key.OutputsWritten & (1 << i)) vp->outputs[i] = cur_reg++; vp->translated = GL_TRUE; vp->native = GL_TRUE; o_inst=vp->program.body.i; - for(vpi=mesa_vp->Base.Instructions; vpi->Opcode != OPCODE_END; vpi++, o_inst++){ + for(; vpi->Opcode != OPCODE_END; vpi++, o_inst++){ FREE_TEMPS(); + + if(!valid_dst(vp, &vpi->DstReg)) + { + /* redirect result to unused temp */ + vpi->DstReg.File = PROGRAM_TEMPORARY; + vpi->DstReg.Index = u_temp_i; + } operands=op_operands(vpi->Opcode); are_srcs_scalar=operands & SCALAR_FLAG; @@ -987,3 +874,302 @@ void r300_translate_vertex_shader(struct r300_vertex_program *vp) #endif } +static void position_invariant(struct gl_program *prog) +{ + struct prog_instruction *vpi; + struct gl_program_parameter_list *paramList; + int i; + + GLint tokens[6] = { STATE_MATRIX, STATE_MVP, 0, 0, 0, STATE_MATRIX }; + +#ifdef PREFER_DP4 + tokens[5] = STATE_MATRIX; +#else + tokens[5] = STATE_MATRIX_TRANSPOSE; +#endif + paramList = prog->Parameters; + + vpi = malloc((prog->NumInstructions + 4) * sizeof(struct prog_instruction)); + memset(vpi, 0, 4 * sizeof(struct prog_instruction)); + + for (i=0; i < 4; i++) { + GLint idx; + tokens[3] = tokens[4] = i; + idx = _mesa_add_state_reference(paramList, tokens); +#ifdef PREFER_DP4 + vpi[i].Opcode = OPCODE_DP4; + vpi[i].StringPos = 0; + vpi[i].Data = 0; + + vpi[i].DstReg.File = PROGRAM_OUTPUT; + vpi[i].DstReg.Index = VERT_RESULT_HPOS; + vpi[i].DstReg.WriteMask = 1 << i; + vpi[i].DstReg.CondMask = COND_TR; + + vpi[i].SrcReg[0].File = PROGRAM_STATE_VAR; + vpi[i].SrcReg[0].Index = idx; + vpi[i].SrcReg[0].Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_W); + + vpi[i].SrcReg[1].File = PROGRAM_INPUT; + vpi[i].SrcReg[1].Index = VERT_ATTRIB_POS; + vpi[i].SrcReg[1].Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_W); +#else + if (i == 0) + vpi[i].Opcode = OPCODE_MUL; + else + vpi[i].Opcode = OPCODE_MAD; + + vpi[i].StringPos = 0; + vpi[i].Data = 0; + + if (i == 3) + vpi[i].DstReg.File = PROGRAM_OUTPUT; + else + vpi[i].DstReg.File = PROGRAM_TEMPORARY; + vpi[i].DstReg.Index = 0; + vpi[i].DstReg.WriteMask = 0xf; + vpi[i].DstReg.CondMask = COND_TR; + + vpi[i].SrcReg[0].File = PROGRAM_STATE_VAR; + vpi[i].SrcReg[0].Index = idx; + vpi[i].SrcReg[0].Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_W); + + vpi[i].SrcReg[1].File = PROGRAM_INPUT; + vpi[i].SrcReg[1].Index = VERT_ATTRIB_POS; + vpi[i].SrcReg[1].Swizzle = MAKE_SWIZZLE4(i, i, i, i); + + if (i > 0) { + vpi[i].SrcReg[2].File = PROGRAM_TEMPORARY; + vpi[i].SrcReg[2].Index = 0; + vpi[i].SrcReg[2].Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_W); + } +#endif + } + + memcpy(&vpi[i], prog->Instructions, prog->NumInstructions * sizeof(struct prog_instruction)); + + free(prog->Instructions); + + prog->Instructions = vpi; + + prog->NumInstructions += 4; + vpi = &prog->Instructions[prog->NumInstructions-1]; + + assert(vpi->Opcode == OPCODE_END); +} + +static void insert_wpos(struct r300_vertex_program *vp, + struct gl_program *prog, + GLint pos) +{ + + GLint tokens[6] = { STATE_INTERNAL, STATE_R300_WINDOW_DIMENSION, 0, 0, 0, 0 }; + struct prog_instruction *vpi; + struct prog_instruction *vpi_insert; + GLuint temp_index; + GLuint window_index; + int i = 0; + + vpi = malloc((prog->NumInstructions + 5) * sizeof(struct prog_instruction)); + memcpy(vpi, prog->Instructions, (pos+1) * sizeof(struct prog_instruction)); + + vpi_insert = &vpi[pos]; + + /* make a copy before outputting VERT_RESULT_HPOS */ + vpi_insert->DstReg.File = vpi_insert->SrcReg[2].File; + vpi_insert->DstReg.Index = temp_index = vpi_insert->SrcReg[2].Index; + + vpi_insert++; + memset(vpi_insert, 0, 5 * sizeof(struct prog_instruction)); + + vpi_insert[i].Opcode = OPCODE_MOV; + + vpi_insert[i].DstReg.File = PROGRAM_OUTPUT; + vpi_insert[i].DstReg.Index = VERT_RESULT_HPOS; + vpi_insert[i].DstReg.WriteMask = WRITEMASK_XYZW; + vpi_insert[i].DstReg.CondMask = COND_TR; + + vpi_insert[i].SrcReg[0].File = PROGRAM_TEMPORARY; + vpi_insert[i].SrcReg[0].Index = temp_index; + vpi_insert[i].SrcReg[0].Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_W); + i++; + + /* perspective divide */ + vpi_insert[i].Opcode = OPCODE_RCP; + + vpi_insert[i].DstReg.File = PROGRAM_TEMPORARY; + vpi_insert[i].DstReg.Index = temp_index; + vpi_insert[i].DstReg.WriteMask = WRITEMASK_W; + vpi_insert[i].DstReg.CondMask = COND_TR; + + vpi_insert[i].SrcReg[0].File = PROGRAM_TEMPORARY; + vpi_insert[i].SrcReg[0].Index = temp_index; + vpi_insert[i].SrcReg[0].Swizzle = MAKE_SWIZZLE4(SWIZZLE_W, SWIZZLE_ZERO, SWIZZLE_ZERO, SWIZZLE_ZERO); + i++; + + vpi_insert[i].Opcode = OPCODE_MUL; + + vpi_insert[i].DstReg.File = PROGRAM_TEMPORARY; + vpi_insert[i].DstReg.Index = temp_index; + vpi_insert[i].DstReg.WriteMask = WRITEMASK_XYZ; + vpi_insert[i].DstReg.CondMask = COND_TR; + + vpi_insert[i].SrcReg[0].File = PROGRAM_TEMPORARY; + vpi_insert[i].SrcReg[0].Index = temp_index; + vpi_insert[i].SrcReg[0].Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_ZERO); + + vpi_insert[i].SrcReg[1].File = PROGRAM_TEMPORARY; + vpi_insert[i].SrcReg[1].Index = temp_index; + vpi_insert[i].SrcReg[1].Swizzle = MAKE_SWIZZLE4(SWIZZLE_W, SWIZZLE_W, SWIZZLE_W, SWIZZLE_ZERO); + i++; + + /* viewport transformation */ + window_index = _mesa_add_state_reference(prog->Parameters, tokens); + + vpi_insert[i].Opcode = OPCODE_MAD; + + vpi_insert[i].DstReg.File = PROGRAM_TEMPORARY; + vpi_insert[i].DstReg.Index = temp_index; + vpi_insert[i].DstReg.WriteMask = WRITEMASK_XYZ; + vpi_insert[i].DstReg.CondMask = COND_TR; + + vpi_insert[i].SrcReg[0].File = PROGRAM_TEMPORARY; + vpi_insert[i].SrcReg[0].Index = temp_index; + vpi_insert[i].SrcReg[0].Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_ZERO); + + vpi_insert[i].SrcReg[1].File = PROGRAM_STATE_VAR; + vpi_insert[i].SrcReg[1].Index = window_index; + vpi_insert[i].SrcReg[1].Swizzle = MAKE_SWIZZLE4(SWIZZLE_Z, SWIZZLE_Z, SWIZZLE_Z, SWIZZLE_ZERO); + + vpi_insert[i].SrcReg[2].File = PROGRAM_STATE_VAR; + vpi_insert[i].SrcReg[2].Index = window_index; + vpi_insert[i].SrcReg[2].Swizzle = MAKE_SWIZZLE4(SWIZZLE_Z, SWIZZLE_Z, SWIZZLE_Z, SWIZZLE_ZERO); + i++; + + vpi_insert[i].Opcode = OPCODE_MUL; + + vpi_insert[i].DstReg.File = PROGRAM_OUTPUT; + vpi_insert[i].DstReg.Index = VERT_RESULT_TEX0+vp->wpos_idx; + vpi_insert[i].DstReg.WriteMask = WRITEMASK_XYZW; + vpi_insert[i].DstReg.CondMask = COND_TR; + + vpi_insert[i].SrcReg[0].File = PROGRAM_TEMPORARY; + vpi_insert[i].SrcReg[0].Index = temp_index; + vpi_insert[i].SrcReg[0].Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_W); + + vpi_insert[i].SrcReg[1].File = PROGRAM_STATE_VAR; + vpi_insert[i].SrcReg[1].Index = window_index; + vpi_insert[i].SrcReg[1].Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_ONE, SWIZZLE_ONE); + i++; + + memcpy(&vpi_insert[i], &prog->Instructions[pos+1], (prog->NumInstructions-(pos+1)) * sizeof(struct prog_instruction)); + + free(prog->Instructions); + + prog->Instructions = vpi; + + prog->NumInstructions += i; + vpi = &prog->Instructions[prog->NumInstructions-1]; + + assert(vpi->Opcode == OPCODE_END); +} + +static void pos_as_texcoord(struct r300_vertex_program *vp, + struct gl_program *prog) +{ + struct prog_instruction *vpi; + int pos = 0; + + for(vpi = prog->Instructions; vpi->Opcode != OPCODE_END; vpi++, pos++){ + if( vpi->DstReg.File == PROGRAM_OUTPUT && + vpi->DstReg.Index == VERT_RESULT_HPOS ){ + insert_wpos(vp, prog, pos); + break; + } + } + +} + +static struct r300_vertex_program *build_program(struct r300_vertex_program_key *wanted_key, + struct gl_vertex_program *mesa_vp, + GLint wpos_idx) +{ + struct r300_vertex_program *vp; + + vp = _mesa_calloc(sizeof(*vp)); + _mesa_memcpy(&vp->key, wanted_key, sizeof(vp->key)); + + vp->wpos_idx = wpos_idx; + + if(mesa_vp->IsPositionInvariant) + position_invariant(&mesa_vp->Base); + + if(wpos_idx > -1) + pos_as_texcoord(vp, &mesa_vp->Base); + + assert(mesa_vp->Base.NumInstructions); + + vp->num_temporaries=mesa_vp->Base.NumTemporaries; + + r300_translate_vertex_shader(vp, mesa_vp->Base.Instructions); + + return vp; +} + +void r300_select_vertex_shader(r300ContextPtr r300) +{ + GLcontext *ctx = ctx = r300->radeon.glCtx; + GLuint InputsRead; + struct r300_vertex_program_key wanted_key = { 0 }; + GLint i; + struct r300_vertex_program_cont *vpc; + struct r300_vertex_program *vp; + GLint wpos_idx; + + vpc = (struct r300_vertex_program_cont *)ctx->VertexProgram._Current; + InputsRead = ctx->FragmentProgram._Current->Base.InputsRead; + + wanted_key.OutputsWritten |= 1 << VERT_RESULT_HPOS; + + wpos_idx = -1; + if (InputsRead & FRAG_BIT_WPOS){ + for (i = 0; i < ctx->Const.MaxTextureUnits; i++) + if (!(InputsRead & (FRAG_BIT_TEX0 << i))) + break; + + if(i == ctx->Const.MaxTextureUnits){ + fprintf(stderr, "\tno free texcoord found\n"); + exit(0); + } + + InputsRead |= (FRAG_BIT_TEX0 << i); + wpos_idx = i; + } + + if (InputsRead & FRAG_BIT_COL0) + wanted_key.OutputsWritten |= 1 << VERT_RESULT_COL0; + + if ((InputsRead & FRAG_BIT_COL1) /*|| + (InputsRead & FRAG_BIT_FOGC)*/) + wanted_key.OutputsWritten |= 1 << VERT_RESULT_COL1; + + for (i = 0; i < ctx->Const.MaxTextureUnits; i++) + if (InputsRead & (FRAG_BIT_TEX0 << i)) + wanted_key.OutputsWritten |= 1 << (VERT_RESULT_TEX0 + i); + + wanted_key.InputsRead = vpc->mesa_program.Base.InputsRead; + + for (vp = vpc->progs; vp; vp = vp->next) + if (_mesa_memcmp(&vp->key, &wanted_key, sizeof(wanted_key)) == 0) { + r300->selected_vp = vp; + return ; + } + + //_mesa_print_program(&vpc->mesa_program.Base); + + vp = build_program(&wanted_key, &vpc->mesa_program, wpos_idx); + vp->next = vpc->progs; + vpc->progs = vp; + + r300->selected_vp = vp; +} diff --git a/src/mesa/drivers/dri/savage/savagespan.c b/src/mesa/drivers/dri/savage/savagespan.c index 2fe991a6b99..61ab9e6d64a 100644 --- a/src/mesa/drivers/dri/savage/savagespan.c +++ b/src/mesa/drivers/dri/savage/savagespan.c @@ -33,7 +33,6 @@ #define DBG 0 #define LOCAL_VARS \ - savageContextPtr imesa = SAVAGE_CONTEXT(ctx); \ driRenderbuffer *drb = (driRenderbuffer *) rb; \ __DRIdrawablePrivate *const dPriv = drb->dPriv; \ GLuint cpp = drb->cpp; \ @@ -44,7 +43,6 @@ (void) p #define LOCAL_DEPTH_VARS \ - savageContextPtr imesa = SAVAGE_CONTEXT(ctx); \ driRenderbuffer *drb = (driRenderbuffer *) rb; \ __DRIdrawablePrivate *const dPriv = drb->dPriv; \ GLuint zpp = drb->cpp; \ diff --git a/src/mesa/glapi/glprocs.h b/src/mesa/glapi/glprocs.h index 548c271bdf7..905c65862d1 100644 --- a/src/mesa/glapi/glprocs.h +++ b/src/mesa/glapi/glprocs.h @@ -1094,6 +1094,56 @@ static const char gl_string_table[] = "glBlendEquationSeparateATI\0" ; + +#ifdef USE_MGL_NAMESPACE +#define gl_dispatch_stub_343 mgl_dispatch_stub_343 +#define gl_dispatch_stub_344 mgl_dispatch_stub_344 +#define gl_dispatch_stub_345 mgl_dispatch_stub_345 +#define gl_dispatch_stub_356 mgl_dispatch_stub_356 +#define gl_dispatch_stub_357 mgl_dispatch_stub_357 +#define gl_dispatch_stub_358 mgl_dispatch_stub_358 +#define gl_dispatch_stub_359 mgl_dispatch_stub_359 +#define gl_dispatch_stub_361 mgl_dispatch_stub_361 +#define gl_dispatch_stub_362 mgl_dispatch_stub_362 +#define gl_dispatch_stub_363 mgl_dispatch_stub_363 +#define gl_dispatch_stub_364 mgl_dispatch_stub_364 +#define gl_dispatch_stub_365 mgl_dispatch_stub_365 +#define gl_dispatch_stub_366 mgl_dispatch_stub_366 +#define gl_dispatch_stub_562 mgl_dispatch_stub_562 +#define gl_dispatch_stub_563 mgl_dispatch_stub_563 +#define gl_dispatch_stub_564 mgl_dispatch_stub_564 +#define gl_dispatch_stub_565 mgl_dispatch_stub_565 +#define gl_dispatch_stub_566 mgl_dispatch_stub_566 +#define gl_dispatch_stub_567 mgl_dispatch_stub_567 +#define gl_dispatch_stub_568 mgl_dispatch_stub_568 +#define gl_dispatch_stub_569 mgl_dispatch_stub_569 +#define gl_dispatch_stub_580 mgl_dispatch_stub_580 +#define gl_dispatch_stub_581 mgl_dispatch_stub_581 +#define gl_dispatch_stub_606 mgl_dispatch_stub_606 +#define gl_dispatch_stub_648 mgl_dispatch_stub_648 +#define gl_dispatch_stub_649 mgl_dispatch_stub_649 +#define gl_dispatch_stub_650 mgl_dispatch_stub_650 +#define gl_dispatch_stub_651 mgl_dispatch_stub_651 +#define gl_dispatch_stub_652 mgl_dispatch_stub_652 +#define gl_dispatch_stub_653 mgl_dispatch_stub_653 +#define gl_dispatch_stub_654 mgl_dispatch_stub_654 +#define gl_dispatch_stub_655 mgl_dispatch_stub_655 +#define gl_dispatch_stub_656 mgl_dispatch_stub_656 +#define gl_dispatch_stub_737 mgl_dispatch_stub_737 +#define gl_dispatch_stub_738 mgl_dispatch_stub_738 +#define gl_dispatch_stub_739 mgl_dispatch_stub_739 +#define gl_dispatch_stub_740 mgl_dispatch_stub_740 +#define gl_dispatch_stub_741 mgl_dispatch_stub_741 +#define gl_dispatch_stub_748 mgl_dispatch_stub_748 +#define gl_dispatch_stub_749 mgl_dispatch_stub_749 +#define gl_dispatch_stub_767 mgl_dispatch_stub_767 +#define gl_dispatch_stub_768 mgl_dispatch_stub_768 +#define gl_dispatch_stub_769 mgl_dispatch_stub_769 +#define gl_dispatch_stub_770 mgl_dispatch_stub_770 +#define gl_dispatch_stub_771 mgl_dispatch_stub_771 +#endif /* USE_MGL_NAMESPACE */ + + /* FIXME: Having these (incorrect) prototypes here is ugly. */ #if defined(NEED_FUNCTION_POINTER) || defined(GLX_INDIRECT_RENDERING) extern void gl_dispatch_stub_343(void); diff --git a/src/mesa/main/api_arrayelt.c b/src/mesa/main/api_arrayelt.c index dda659bbc3f..804700118f2 100644 --- a/src/mesa/main/api_arrayelt.c +++ b/src/mesa/main/api_arrayelt.c @@ -53,6 +53,11 @@ typedef struct { AEarray arrays[32]; AEattrib attribs[VERT_ATTRIB_MAX + 1]; GLuint NewState; + + struct gl_buffer_object *vbo[VERT_ATTRIB_MAX]; + GLuint nr_vbos; + GLboolean mapped_vbos; + } AEcontext; #define AE_CONTEXT(ctx) ((AEcontext *)(ctx)->aelt_context) @@ -1063,6 +1068,18 @@ void _ae_destroy_context( GLcontext *ctx ) } } +static void check_vbo( AEcontext *actx, + struct gl_buffer_object *vbo ) +{ + if (vbo->Name && !vbo->Pointer) { + GLuint i; + for (i = 0; i < actx->nr_vbos; i++) + if (actx->vbo[i] == vbo) + return; + actx->vbo[actx->nr_vbos++] = vbo; + } +} + /** * Make a list of per-vertex functions to call for each glArrayElement call. @@ -1081,31 +1098,37 @@ static void _ae_update_state( GLcontext *ctx ) if (ctx->Array.ArrayObj->Index.Enabled) { aa->array = &ctx->Array.ArrayObj->Index; aa->offset = IndexFuncs[TYPE_IDX(aa->array->Type)]; + check_vbo(actx, aa->array->BufferObj); aa++; } if (ctx->Array.ArrayObj->EdgeFlag.Enabled) { aa->array = &ctx->Array.ArrayObj->EdgeFlag; aa->offset = _gloffset_EdgeFlagv; + check_vbo(actx, aa->array->BufferObj); aa++; } if (ctx->Array.ArrayObj->Normal.Enabled) { aa->array = &ctx->Array.ArrayObj->Normal; aa->offset = NormalFuncs[TYPE_IDX(aa->array->Type)]; + check_vbo(actx, aa->array->BufferObj); aa++; } if (ctx->Array.ArrayObj->Color.Enabled) { aa->array = &ctx->Array.ArrayObj->Color; aa->offset = ColorFuncs[aa->array->Size-3][TYPE_IDX(aa->array->Type)]; + check_vbo(actx, aa->array->BufferObj); aa++; } if (ctx->Array.ArrayObj->SecondaryColor.Enabled) { aa->array = &ctx->Array.ArrayObj->SecondaryColor; aa->offset = SecondaryColorFuncs[TYPE_IDX(aa->array->Type)]; + check_vbo(actx, aa->array->BufferObj); aa++; } if (ctx->Array.ArrayObj->FogCoord.Enabled) { aa->array = &ctx->Array.ArrayObj->FogCoord; aa->offset = FogCoordFuncs[TYPE_IDX(aa->array->Type)]; + check_vbo(actx, aa->array->BufferObj); aa++; } for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) { @@ -1120,11 +1143,12 @@ static void _ae_update_state( GLcontext *ctx ) [at->array->Size-1] [TYPE_IDX(at->array->Type)]; at->index = VERT_ATTRIB_TEX0 + i; + check_vbo(actx, aa->array->BufferObj); at++; } } - /* generic vertex attribute arrays */ + /* generic vertex attribute arrays */ for (i = 1; i < VERT_ATTRIB_MAX; i++) { /* skip zero! */ struct gl_client_array *attribArray = &ctx->Array.ArrayObj->VertexAttrib[i]; if (attribArray->Enabled) { @@ -1146,6 +1170,7 @@ static void _ae_update_state( GLcontext *ctx ) [TYPE_IDX(at->array->Type)]; } at->index = i; + check_vbo(actx, aa->array->BufferObj); at++; } } @@ -1158,14 +1183,18 @@ static void _ae_update_state( GLcontext *ctx ) aa->array = &ctx->Array.ArrayObj->VertexAttrib[0]; assert(aa->array->Size >= 2); /* XXX fix someday? */ aa->offset = VertexFuncs[aa->array->Size-2][TYPE_IDX(aa->array->Type)]; + check_vbo(actx, aa->array->BufferObj); aa++; } else if (ctx->Array.ArrayObj->Vertex.Enabled) { aa->array = &ctx->Array.ArrayObj->Vertex; aa->offset = VertexFuncs[aa->array->Size-2][TYPE_IDX(aa->array->Type)]; + check_vbo(actx, aa->array->BufferObj); aa++; } + check_vbo(actx, ctx->Array.ElementArrayBufferObj); + ASSERT(at - actx->attribs <= VERT_ATTRIB_MAX); ASSERT(aa - actx->arrays < 32); at->func = NULL; /* terminate the list */ @@ -1174,6 +1203,44 @@ static void _ae_update_state( GLcontext *ctx ) actx->NewState = 0; } +void _ae_map_vbos( GLcontext *ctx ) +{ + AEcontext *actx = AE_CONTEXT(ctx); + GLuint i; + + if (actx->mapped_vbos) + return; + + if (actx->NewState) + _ae_update_state(ctx); + + for (i = 0; i < actx->nr_vbos; i++) + ctx->Driver.MapBuffer(ctx, + GL_ARRAY_BUFFER_ARB, + GL_DYNAMIC_DRAW_ARB, + actx->vbo[i]); + + actx->mapped_vbos = GL_TRUE; +} + +void _ae_unmap_vbos( GLcontext *ctx ) +{ + AEcontext *actx = AE_CONTEXT(ctx); + GLuint i; + + if (!actx->mapped_vbos) + return; + + assert (!actx->NewState); + + for (i = 0; i < actx->nr_vbos; i++) + ctx->Driver.UnmapBuffer(ctx, + GL_ARRAY_BUFFER_ARB, + actx->vbo[i]); + + actx->mapped_vbos = GL_FALSE; +} + /** * Called via glArrayElement() and glDrawArrays(). @@ -1188,15 +1255,24 @@ void GLAPIENTRY _ae_loopback_array_elt( GLint elt ) const AEarray *aa; const AEattrib *at; const struct _glapi_table * const disp = GET_DISPATCH(); + GLboolean do_map; - - if (actx->NewState) + if (actx->NewState) { + assert(!actx->mapped_vbos); _ae_update_state( ctx ); + } + do_map = actx->nr_vbos && !actx->mapped_vbos; + + /* + */ + if (do_map) + _ae_map_vbos(ctx); + /* generic attributes */ for (at = actx->attribs; at->func; at++) { const GLubyte *src - = ADD_POINTERS(at->array->BufferObj->Data, at->array->Ptr) + = ADD_POINTERS(at->array->BufferObj->Pointer, at->array->Ptr) + elt * at->array->StrideB; at->func( at->index, src ); } @@ -1204,15 +1280,21 @@ void GLAPIENTRY _ae_loopback_array_elt( GLint elt ) /* conventional arrays */ for (aa = actx->arrays; aa->offset != -1 ; aa++) { const GLubyte *src - = ADD_POINTERS(aa->array->BufferObj->Data, aa->array->Ptr) + = ADD_POINTERS(aa->array->BufferObj->Pointer, aa->array->Ptr) + elt * aa->array->StrideB; CALL_by_offset( disp, (array_func), aa->offset, ((const void *) src) ); } + + if (do_map) + _ae_unmap_vbos(ctx); } void _ae_invalidate_state( GLcontext *ctx, GLuint new_state ) { - AE_CONTEXT(ctx)->NewState |= new_state; + AEcontext *actx = AE_CONTEXT(ctx); + + assert(!actx->mapped_vbos); + actx->NewState |= new_state; } diff --git a/src/mesa/main/api_arrayelt.h b/src/mesa/main/api_arrayelt.h index 1c0af9f3ea8..e621724fb29 100644 --- a/src/mesa/main/api_arrayelt.h +++ b/src/mesa/main/api_arrayelt.h @@ -34,4 +34,9 @@ extern void _ae_destroy_context( GLcontext *ctx ); extern void _ae_invalidate_state( GLcontext *ctx, GLuint new_state ); extern void GLAPIENTRY _ae_loopback_array_elt( GLint elt ); +/* May optionally be called before a batch of element calls: + */ +extern void _ae_map_vbos( GLcontext *ctx ); +extern void _ae_unmap_vbos( GLcontext *ctx ); + #endif diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c index e22edc1bbcf..9993a0021bc 100644 --- a/src/mesa/main/attrib.c +++ b/src/mesa/main/attrib.c @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.5.1 + * Version: 6.5.2 * * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. * @@ -1009,9 +1009,6 @@ _mesa_PopAttrib(void) (GLfloat) light->Model.TwoSide); _mesa_LightModelf(GL_LIGHT_MODEL_COLOR_CONTROL, (GLfloat) light->Model.ColorControl); - /* materials */ - MEMCPY(&ctx->Light.Material, &light->Material, - sizeof(struct gl_material)); /* shade model */ _mesa_ShadeModel(light->ShadeModel); /* color material */ @@ -1019,6 +1016,9 @@ _mesa_PopAttrib(void) light->ColorMaterialMode); _mesa_set_enable(ctx, GL_COLOR_MATERIAL, light->ColorMaterialEnabled); + /* materials */ + MEMCPY(&ctx->Light.Material, &light->Material, + sizeof(struct gl_material)); } break; case GL_LINE_BIT: diff --git a/src/mesa/main/config.h b/src/mesa/main/config.h index 5a0481328ff..13c6281f077 100644 --- a/src/mesa/main/config.h +++ b/src/mesa/main/config.h @@ -198,6 +198,7 @@ #define MAX_PROGRAM_LOCAL_PARAMS 128 /* KW: power of two */ #define MAX_PROGRAM_MATRICES 8 #define MAX_PROGRAM_MATRIX_STACK_DEPTH 4 +#define MAX_PROGRAM_CALL_DEPTH 8 /*@}*/ /** For GL_ARB_fragment_shader */ diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index c8acc6b55ca..44ee0465690 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -876,6 +876,16 @@ delete_arrayobj_cb(GLuint id, void *data, void *userData) _mesa_delete_array_object(ctx, arrayObj); } +/** + * Callback for deleting an shader object. Called by _mesa_HashDeleteAll(). + */ +static void +delete_shaderobj_cb(GLuint id, void *data, void *userData) +{ + /* XXX probably need to fix this */ + _mesa_free(data); +} + /** * Deallocate a shared state object and all children structures. @@ -938,6 +948,7 @@ free_shared_state( GLcontext *ctx, struct gl_shared_state *ss ) _mesa_DeleteHashTable(ss->ArrayObjects); #if FEATURE_ARB_shader_objects + _mesa_HashDeleteAll(ss->GL2Objects, delete_shaderobj_cb, ctx); _mesa_DeleteHashTable(ss->GL2Objects); #endif diff --git a/src/mesa/main/enums.c b/src/mesa/main/enums.c index d864cd22aa4..fc56809e978 100644 --- a/src/mesa/main/enums.c +++ b/src/mesa/main/enums.c @@ -34,7 +34,7 @@ typedef struct { int n; } enum_elt; -static const char enum_string_table[] = +LONGSTRING static const char enum_string_table[] = "GL_2D\0" "GL_2_BYTES\0" "GL_3D\0" diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c index 695aab5227f..6ff4089f0ea 100644 --- a/src/mesa/main/image.c +++ b/src/mesa/main/image.c @@ -1168,7 +1168,7 @@ _mesa_pack_rgba_span_float(GLcontext *ctx, GLuint n, GLfloat rgba[][4], const GLint comps = _mesa_components_in_format(dstFormat); GLuint i; - if (dstType != GL_FLOAT) { + if (dstType != GL_FLOAT || ctx->Color.ClampReadColor == GL_TRUE) { /* need to clamp to [0, 1] */ transferOps |= IMAGE_CLAMP_BIT; } @@ -1182,7 +1182,7 @@ _mesa_pack_rgba_span_float(GLcontext *ctx, GLuint n, GLfloat rgba[][4], if (dstFormat == GL_LUMINANCE || dstFormat == GL_LUMINANCE_ALPHA) { /* compute luminance values */ - if (ctx->Color.ClampReadColor == GL_TRUE || dstType != GL_FLOAT) { + if (dstType != GL_FLOAT || ctx->Color.ClampReadColor == GL_TRUE) { for (i = 0; i < n; i++) { GLfloat sum = rgba[i][RCOMP] + rgba[i][GCOMP] + rgba[i][BCOMP]; luminance[i] = CLAMP(sum, 0.0F, 1.0F); @@ -4173,7 +4173,7 @@ _mesa_unpack_image( GLuint dimensions, if (width <= 0 || height <= 0 || depth <= 0) return NULL; /* generate error later */ - if (format == GL_BITMAP) { + if (type == GL_BITMAP) { bytesPerRow = (width + 7) >> 3; flipBytes = !unpack->LsbFirst; swap2 = swap4 = GL_FALSE; diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h index 9fb02a7e9cd..dad2767e72d 100644 --- a/src/mesa/main/imports.h +++ b/src/mesa/main/imports.h @@ -55,6 +55,15 @@ extern "C" { #define NULL 0 #endif + +/** gcc -pedantic warns about long string literals, LONGSTRING silences that */ +#if !defined(__GNUC__) || (__GNUC__ < 2) || \ + ((__GNUC__ == 2) && (__GNUC_MINOR__ <= 7)) +# define LONGSTRING +#else +# define LONGSTRING __extension__ +#endif + /*@}*/ diff --git a/src/mesa/main/texcompress_fxt1.c b/src/mesa/main/texcompress_fxt1.c index 2ac2c80a082..d3011cedce4 100644 --- a/src/mesa/main/texcompress_fxt1.c +++ b/src/mesa/main/texcompress_fxt1.c @@ -105,7 +105,7 @@ texstore_rgb_fxt1(TEXSTORE_PARAMS) } dst = _mesa_compressed_image_address(dstXoffset, dstYoffset, 0, - GL_COMPRESSED_RGB_FXT1_3DFX, + dstFormat->MesaFormat, texWidth, (GLubyte *) dstAddr); fxt1_encode(srcWidth, srcHeight, 3, pixels, srcRowStride, @@ -162,7 +162,7 @@ texstore_rgba_fxt1(TEXSTORE_PARAMS) } dst = _mesa_compressed_image_address(dstXoffset, dstYoffset, 0, - GL_COMPRESSED_RGBA_FXT1_3DFX, + dstFormat->MesaFormat, texWidth, (GLubyte *) dstAddr); fxt1_encode(srcWidth, srcHeight, 4, pixels, srcRowStride, diff --git a/src/mesa/main/texenvprogram.c b/src/mesa/main/texenvprogram.c index c99ff5cdc46..5329719cbbb 100644 --- a/src/mesa/main/texenvprogram.c +++ b/src/mesa/main/texenvprogram.c @@ -575,7 +575,7 @@ static struct ureg register_const4f( struct texenv_fragment_program *p, values[1] = s1; values[2] = s2; values[3] = s3; - idx = _mesa_add_unnamed_constant( p->program->Base.Parameters, values ); + idx = _mesa_add_unnamed_constant( p->program->Base.Parameters, values, 4 ); return make_ureg(PROGRAM_STATE_VAR, idx); } diff --git a/src/mesa/shader/arbprogparse.c b/src/mesa/shader/arbprogparse.c index 43e3bc183d4..5a61f30193b 100644 --- a/src/mesa/shader/arbprogparse.c +++ b/src/mesa/shader/arbprogparse.c @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.5.2 + * Version: 6.5.1 * * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. * @@ -77,12 +77,6 @@ struct arb_program }; -#ifndef __extension__ -#if !defined(__GNUC__) || (__GNUC__ < 2) || \ - ((__GNUC__ == 2) && (__GNUC_MINOR__ <= 7)) -# define __extension__ -#endif -#endif /* TODO: * Fragment Program Stuff: @@ -168,10 +162,11 @@ struct arb_program typedef GLubyte *production; + /** * This is the text describing the rules to parse the grammar */ -__extension__ static char arb_grammar_text[] = +LONGSTRING static char arb_grammar_text[] = #include "arbprogram_syn.h" ; @@ -1815,7 +1810,7 @@ parse_param_elements (GLcontext * ctx, const GLubyte ** inst, parse_constant (inst, const_values, Program, use); idx = _mesa_add_named_constant(Program->Base.Parameters, (char *) param_var->name, - const_values); + const_values, 4); if (param_var->param_binding_begin == ~0U) param_var->param_binding_begin = idx; param_var->param_binding_length++; @@ -4053,7 +4048,8 @@ _mesa_parse_arb_fragment_program(GLcontext* ctx, GLenum target, program->Base.Parameters = ap.Base.Parameters; #if DEBUG_FP - _mesa_print_program(&program.Base); + _mesa_printf("____________Fragment program %u ________\n", program->Base.ID); + _mesa_print_program(&program->Base); #endif } @@ -4105,6 +4101,7 @@ _mesa_parse_arb_vertex_program(GLcontext *ctx, GLenum target, program->Base.Parameters = ap.Base.Parameters; #if DEBUG_VP + _mesa_printf("____________Vertex program %u __________\n", program->Base.ID); _mesa_print_program(&program->Base); #endif } diff --git a/src/mesa/shader/descrip.mms b/src/mesa/shader/descrip.mms index 95569a6f25c..d70cec38300 100644 --- a/src/mesa/shader/descrip.mms +++ b/src/mesa/shader/descrip.mms @@ -1,7 +1,6 @@ # Makefile for core library for VMS -# contributed by Jouk Jansen joukj@hrem.stm.tudelft.nl -# Last revision : 1 June 2005 - +# contributed by Jouk Jansen joukj@hrem.nano.tudelft.nl +# Last revision : 20 November 2006 .first define gl [---.include.gl] define math [-.math] @@ -16,7 +15,7 @@ VPATH = RCS INCDIR = [---.include],[.grammar],[-.main],[-.glapi],[.slang] LIBDIR = [---.lib] -CFLAGS = /include=($(INCDIR),[])/define=(PTHREADS=1)/name=(as_is,short)/float=ieee/ieee=denorm +CFLAGS = /include=($(INCDIR),[])/define=(PTHREADS=1,"__extension__=")/name=(as_is,short)/float=ieee/ieee=denorm SOURCES = \ atifragshader.c \ diff --git a/src/mesa/shader/nvfragparse.c b/src/mesa/shader/nvfragparse.c index 5f3a30b7416..79e6dbd87b7 100644 --- a/src/mesa/shader/nvfragparse.c +++ b/src/mesa/shader/nvfragparse.c @@ -1041,7 +1041,7 @@ Parse_VectorSrc(struct parse_state *parseState, GLuint paramIndex; if (!Parse_ScalarConstant(parseState, values)) RETURN_ERROR; - paramIndex = _mesa_add_unnamed_constant(parseState->parameters, values); + paramIndex = _mesa_add_unnamed_constant(parseState->parameters, values, 4); srcReg->File = PROGRAM_NAMED_PARAM; srcReg->Index = paramIndex; } @@ -1052,7 +1052,7 @@ Parse_VectorSrc(struct parse_state *parseState, (void) Parse_String(parseState, "{"); if (!Parse_VectorConstant(parseState, values)) RETURN_ERROR; - paramIndex = _mesa_add_unnamed_constant(parseState->parameters, values); + paramIndex = _mesa_add_unnamed_constant(parseState->parameters, values, 4); srcReg->File = PROGRAM_NAMED_PARAM; srcReg->Index = paramIndex; } @@ -1142,7 +1142,7 @@ Parse_ScalarSrcReg(struct parse_state *parseState, (void) Parse_String(parseState, "{"); if (!Parse_VectorConstant(parseState, values)) RETURN_ERROR; - paramIndex = _mesa_add_unnamed_constant(parseState->parameters, values); + paramIndex = _mesa_add_unnamed_constant(parseState->parameters, values, 4); srcReg->File = PROGRAM_NAMED_PARAM; srcReg->Index = paramIndex; } @@ -1166,7 +1166,7 @@ Parse_ScalarSrcReg(struct parse_state *parseState, GLuint paramIndex; if (!Parse_ScalarConstant(parseState, values)) RETURN_ERROR; - paramIndex = _mesa_add_unnamed_constant(parseState->parameters, values); + paramIndex = _mesa_add_unnamed_constant(parseState->parameters, values, 4); srcReg->Index = paramIndex; srcReg->File = PROGRAM_NAMED_PARAM; needSuffix = GL_FALSE; diff --git a/src/mesa/shader/program.c b/src/mesa/shader/program.c index eabfbc24d7c..789d36eba02 100644 --- a/src/mesa/shader/program.c +++ b/src/mesa/shader/program.c @@ -430,14 +430,24 @@ _mesa_add_named_parameter(struct gl_program_parameter_list *paramList, * This will be used when the program contains something like this: * PARAM myVals = { 0, 1, 2, 3 }; * - * \param paramList - the parameter list - * \param values - four float values - * \return index of the new parameter. + * \param paramList the parameter list + * \param name the name for the constant + * \param values four float values + * \return index/position of the new parameter in the parameter list */ GLint _mesa_add_named_constant(struct gl_program_parameter_list *paramList, - const char *name, const GLfloat values[4]) + const char *name, const GLfloat values[4], + GLuint size) { +#if 0 /* disable this for now -- we need to save the name! */ + GLuint pos, swizzle; + ASSERT(size == 4); /* XXX future feature */ + /* check if we already have this constant */ + if (_mesa_lookup_parameter_constant(paramList, values, 4, &pos, &swizzle)) { + return pos; + } +#endif return add_parameter(paramList, name, values, PROGRAM_CONSTANT); } @@ -447,14 +457,20 @@ _mesa_add_named_constant(struct gl_program_parameter_list *paramList, * This will be used when the program contains something like this: * MOV r, { 0, 1, 2, 3 }; * - * \param paramList - the parameter list - * \param values - four float values - * \return index of the new parameter. + * \param paramList the parameter list + * \param values four float values + * \return index/position of the new parameter in the parameter list. */ GLint _mesa_add_unnamed_constant(struct gl_program_parameter_list *paramList, - const GLfloat values[4]) + const GLfloat values[4], GLuint size) { + GLuint pos, swizzle; + ASSERT(size == 4); /* XXX future feature */ + /* check if we already have this constant */ + if (_mesa_lookup_parameter_constant(paramList, values, 4, &pos, &swizzle)) { + return pos; + } return add_parameter(paramList, NULL, values, PROGRAM_CONSTANT); } @@ -464,8 +480,8 @@ _mesa_add_unnamed_constant(struct gl_program_parameter_list *paramList, * This will be used when the program contains something like this: * PARAM ambient = state.material.front.ambient; * - * \param paramList - the parameter list - * \param state - an array of 6 state tokens + * \param paramList the parameter list + * \param state an array of 6 state tokens * \return index of the new parameter. */ GLint @@ -500,7 +516,7 @@ _mesa_add_state_reference(struct gl_program_parameter_list *paramList, * \return pointer to the float[4] values. */ GLfloat * -_mesa_lookup_parameter_value(struct gl_program_parameter_list *paramList, +_mesa_lookup_parameter_value(const struct gl_program_parameter_list *paramList, GLsizei nameLen, const char *name) { GLuint i; @@ -530,11 +546,15 @@ _mesa_lookup_parameter_value(struct gl_program_parameter_list *paramList, /** - * Lookup a parameter index by name in the given parameter list. + * Given a program parameter name, find its position in the list of parameters. + * \param paramList the parameter list to search + * \param nameLen length of name (in chars). + * If length is negative, assume that name is null-terminated. + * \param name the name to search for * \return index of parameter in the list. */ GLint -_mesa_lookup_parameter_index(struct gl_program_parameter_list *paramList, +_mesa_lookup_parameter_index(const struct gl_program_parameter_list *paramList, GLsizei nameLen, const char *name) { GLint i; @@ -563,6 +583,61 @@ _mesa_lookup_parameter_index(struct gl_program_parameter_list *paramList, } +/** + * Look for a float vector in the given parameter list. The float vector + * may be of length 1, 2, 3 or 4. + * \param paramList the parameter list to search + * \param v the float vector to search for + * \param size number of element in v + * \param posOut returns the position of the constant, if found + * \param swizzleOut returns a swizzle mask describing location of the + * vector elements if found + * \return GL_TRUE if found, GL_FALSE if not found + */ +GLboolean +_mesa_lookup_parameter_constant(const struct gl_program_parameter_list *paramList, + const GLfloat v[], GLsizei vSize, + GLuint *posOut, GLuint *swizzleOut) +{ + GLuint i; + + assert(vSize >= 1); + assert(vSize <= 4); + + if (!paramList) + return -1; + + for (i = 0; i < paramList->NumParameters; i++) { + if (paramList->Parameters[i].Type == PROGRAM_CONSTANT) { + const GLint maxShift = 4 - vSize; + GLint shift, j; + for (shift = 0; shift <= maxShift; shift++) { + GLint matched = 0; + GLuint swizzle[4]; + swizzle[0] = swizzle[1] = swizzle[2] = swizzle[3] = 0; + /* XXX we could do out-of-order swizzle matches too, someday */ + for (j = 0; j < vSize; j++) { + assert(shift + j < 4); + if (paramList->ParameterValues[i][shift + j] == v[j]) { + matched++; + swizzle[j] = shift + j; + } + } + if (matched == vSize) { + /* found! */ + *posOut = i; + *swizzleOut = MAKE_SWIZZLE4(swizzle[0], swizzle[1], + swizzle[2], swizzle[3]); + return GL_TRUE; + } + } + } + } + + return GL_FALSE; +} + + /** * Use the list of tokens in the state[] array to find global GL state * and return it in . Usually, four values are returned in @@ -918,7 +993,9 @@ _mesa_fetch_state(GLcontext *ctx, const enum state_index state[], break; } default: - _mesa_problem(ctx, "Bad state switch in _mesa_fetch_state()"); + /* unknown state indexes are silently ignored + * should be handled by the driver. + */ return; } } @@ -995,7 +1072,9 @@ make_state_flags(const GLint state[]) case STATE_TEXRECT_SCALE: return _NEW_TEXTURE; default: - _mesa_problem(NULL, "unexpected int. state in make_state_flags()"); + /* unknown state indexes are silently ignored and + * no flag set, since it is handled by the driver. + */ return 0; } @@ -1267,7 +1346,7 @@ make_state_string(const GLint state[6]) case STATE_INTERNAL: break; default: - _mesa_problem(NULL, "Invalid state in maka_state_string"); + _mesa_problem(NULL, "Invalid state in make_state_string"); break; } diff --git a/src/mesa/shader/program.h b/src/mesa/shader/program.h index 50958394c20..af06c03598f 100644 --- a/src/mesa/shader/program.h +++ b/src/mesa/shader/program.h @@ -189,7 +189,8 @@ enum state_index { STATE_INTERNAL, /* Mesa additions */ STATE_NORMAL_SCALE, STATE_TEXRECT_SCALE, - STATE_POSITION_NORMALIZED /* normalized light position */ + STATE_POSITION_NORMALIZED, /* normalized light position */ + STATE_INTERNAL_DRIVER /* first available state index for drivers (must be last) */ }; @@ -238,30 +239,34 @@ _mesa_add_named_parameter(struct gl_program_parameter_list *paramList, extern GLint _mesa_add_named_constant(struct gl_program_parameter_list *paramList, - const char *name, const GLfloat values[4]); + const char *name, const GLfloat values[4], + GLuint size); extern GLint _mesa_add_unnamed_constant(struct gl_program_parameter_list *paramList, - const GLfloat values[4]); + const GLfloat values[4], GLuint size); extern GLint _mesa_add_state_reference(struct gl_program_parameter_list *paramList, const GLint *stateTokens); extern GLfloat * -_mesa_lookup_parameter_value(struct gl_program_parameter_list *paramList, +_mesa_lookup_parameter_value(const struct gl_program_parameter_list *paramList, GLsizei nameLen, const char *name); extern GLint -_mesa_lookup_parameter_index(struct gl_program_parameter_list *paramList, +_mesa_lookup_parameter_index(const struct gl_program_parameter_list *paramList, GLsizei nameLen, const char *name); +extern GLboolean +_mesa_lookup_parameter_constant(const struct gl_program_parameter_list *paramList, + const GLfloat v[], GLsizei vSize, + GLuint *posOut, GLuint *swizzleOut); + extern void _mesa_load_state_parameters(GLcontext *ctx, struct gl_program_parameter_list *paramList); - - extern void _mesa_print_instruction(const struct prog_instruction *inst); diff --git a/src/mesa/shader/program_instruction.h b/src/mesa/shader/program_instruction.h index cdec0ceb2a5..ad3a6d4dd4e 100644 --- a/src/mesa/shader/program_instruction.h +++ b/src/mesa/shader/program_instruction.h @@ -286,7 +286,7 @@ struct prog_instruction GLuint CondUpdate:1; /** - * If prog_instruction::cc_update is \c GL_TRUE, this value selects the + * If prog_instruction::CondUpdate is \c GL_TRUE, this value selects the * condition code register that is to be updated. * * In GL_NV_fragment_program or GL_NV_vertex_program2 mode, only condition @@ -339,6 +339,11 @@ struct prog_instruction */ GLuint TexSrcTarget:3; /*@}*/ + + /** + * For BRA and CAL instructions, the location to jump to. + */ + GLuint BranchTarget; }; diff --git a/src/mesa/shader/programopt.c b/src/mesa/shader/programopt.c index 172d373b578..783177739d1 100644 --- a/src/mesa/shader/programopt.c +++ b/src/mesa/shader/programopt.c @@ -172,7 +172,7 @@ _mesa_append_fog_code(GLcontext *ctx, struct gl_fragment_program *fprog) fogVals[1] = 1.0 / SQRTF(log(2.0)); fogVals[2] = 0.0; fogVals[3] = 0.0; - fogConsts = _mesa_add_unnamed_constant(fprog->Base.Parameters, fogVals); + fogConsts = _mesa_add_unnamed_constant(fprog->Base.Parameters, fogVals, 4); /* Scan program to find where result.color is written */ inst = newInst; diff --git a/src/mesa/shader/shaderobjects.c b/src/mesa/shader/shaderobjects.c index a2416c28726..da4d5c84721 100644 --- a/src/mesa/shader/shaderobjects.c +++ b/src/mesa/shader/shaderobjects.c @@ -307,14 +307,14 @@ _mesa_UseProgramObjectARB(GLhandleARB programObj) FLUSH_VERTICES(ctx, _NEW_PROGRAM); if (programObj != 0) { - GET_PROGRAM(pro, programObj, "glUseProgramObjectARB"); + GET_PROGRAM(pro, programObj, "glUseProgramObjectARB(program)"); if (pro == NULL) return; if ((**pro).GetLinkStatus(pro) == GL_FALSE) { RELEASE_PROGRAM(pro); - _mesa_error(ctx, GL_INVALID_OPERATION, "glUseProgramObjectARB"); + _mesa_error(ctx, GL_INVALID_OPERATION, "glUseProgramObjectARB(not linked)"); return; } @@ -1013,7 +1013,7 @@ _mesa_GetProgramiv(GLuint program, GLenum pname, GLint *params) switch (pname) { case GL_DELETE_STATUS: - *params = (**pro)._container._generic.GetDeleteStatus((struct gl2_generic_inf **) pro); + *params = (**pro)._container._generic.GetDeleteStatus((struct gl2_generic_intf **) pro); break; case GL_LINK_STATUS: *params = (**pro).GetLinkStatus(pro); @@ -1022,10 +1022,10 @@ _mesa_GetProgramiv(GLuint program, GLenum pname, GLint *params) *params = (**pro).GetValidateStatus(pro); break; case GL_INFO_LOG_LENGTH: - *params = (**pro)._container._generic.GetInfoLogLength( (struct gl2_unknown_inf **) pro ); + *params = (**pro)._container._generic.GetInfoLogLength( (struct gl2_generic_intf **) pro ); break; case GL_ATTACHED_SHADERS: - *params = (**pro)._container.GetAttachedCount( (struct gl2_unknown_inf **) pro ); + *params = (**pro)._container.GetAttachedCount( (struct gl2_container_intf **) pro ); break; case GL_ACTIVE_ATTRIBUTES: *params = (**pro).GetActiveAttribCount(pro); @@ -1066,13 +1066,13 @@ _mesa_GetShaderiv(GLuint shader, GLenum pname, GLint *params) *params = (**sh).GetSubType(sh); break; case GL_DELETE_STATUS: - *params = (**sh)._generic.GetDeleteStatus((struct gl2_generic_inf **) sh); + *params = (**sh)._generic.GetDeleteStatus((struct gl2_generic_intf **) sh); break; case GL_COMPILE_STATUS: *params = (**sh).GetCompileStatus(sh); break; case GL_INFO_LOG_LENGTH: - *params = (**sh)._generic.GetInfoLogLength((struct gl2_generic_inf **)sh); + *params = (**sh)._generic.GetInfoLogLength((struct gl2_generic_intf **)sh); break; case GL_SHADER_SOURCE_LENGTH: { diff --git a/src/mesa/shader/slang/slang_assemble.c b/src/mesa/shader/slang/slang_assemble.c index 603fd4f7f87..0cba5d5d007 100644 --- a/src/mesa/shader/slang/slang_assemble.c +++ b/src/mesa/shader/slang/slang_assemble.c @@ -232,9 +232,9 @@ collect_locals(slang_assemble_ctx * A, slang_operation * op, GLuint * size) /* _slang_locate_function() */ slang_function * -_slang_locate_function(slang_function_scope * funcs, slang_atom a_name, - slang_operation * params, GLuint num_params, - slang_assembly_name_space * space, +_slang_locate_function(const slang_function_scope * funcs, slang_atom a_name, + const slang_operation * params, GLuint num_params, + const slang_assembly_name_space * space, slang_atom_pool * atoms) { GLuint i; @@ -289,24 +289,18 @@ _slang_assemble_function(slang_assemble_ctx * A, slang_function * fun) fun->address = A->file->count; if (fun->body == NULL) { - /* jump to the actual function body - we do not know it, so add the instruction - * to fixup table */ - fun->fixups.table = (GLuint *) - slang_alloc_realloc(fun->fixups.table, - fun->fixups.count * sizeof(GLuint), - (fun->fixups.count + 1) * sizeof(GLuint)); - if (fun->fixups.table == NULL) - return GL_FALSE; - fun->fixups.table[fun->fixups.count] = fun->address; - fun->fixups.count++; + /* jump to the actual function body - we do not know it, so add + * the instruction to fixup table + */ + if (!slang_fixup_save(&fun->fixups, fun->address)) + return GL_FALSE; if (!PUSH(A->file, slang_asm_jump)) return GL_FALSE; return GL_TRUE; } else { - GLuint i; - /* resolve all fixup table entries and delete it */ + GLuint i; for (i = 0; i < fun->fixups.count; i++) A->file->code[fun->fixups.table[i]].param[0] = fun->address; slang_fixup_table_free(&fun->fixups); diff --git a/src/mesa/shader/slang/slang_assemble.h b/src/mesa/shader/slang/slang_assemble.h index 95e4fa263a3..d004e665003 100644 --- a/src/mesa/shader/slang/slang_assemble.h +++ b/src/mesa/shader/slang/slang_assemble.h @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.5 + * Version: 6.5.2 * * Copyright (C) 2005-2006 Brian Paul All Rights Reserved. * @@ -22,7 +22,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#if !defined SLANG_ASSEMBLE_H +#ifndef SLANG_ASSEMBLE_H #define SLANG_ASSEMBLE_H #include "slang_utility.h" @@ -31,72 +31,82 @@ extern "C" { #endif + struct slang_operation_; typedef enum slang_assembly_type_ { - /* core */ - slang_asm_none, - slang_asm_float_copy, - slang_asm_float_move, - slang_asm_float_push, - slang_asm_float_deref, - slang_asm_float_add, - slang_asm_float_multiply, - slang_asm_float_divide, - slang_asm_float_negate, - slang_asm_float_less, - slang_asm_float_equal_exp, - slang_asm_float_equal_int, - slang_asm_float_to_int, - slang_asm_float_sine, - slang_asm_float_arcsine, - slang_asm_float_arctan, - slang_asm_float_power, - slang_asm_float_log2, - slang_asm_float_floor, - slang_asm_float_ceil, - slang_asm_float_noise1, - slang_asm_float_noise2, - slang_asm_float_noise3, - slang_asm_float_noise4, - slang_asm_int_copy, - slang_asm_int_move, - slang_asm_int_push, - slang_asm_int_deref, - slang_asm_int_to_float, - slang_asm_int_to_addr, - slang_asm_bool_copy, - slang_asm_bool_move, - slang_asm_bool_push, - slang_asm_bool_deref, - slang_asm_addr_copy, - slang_asm_addr_push, - slang_asm_addr_deref, - slang_asm_addr_add, - slang_asm_addr_multiply, - slang_asm_vec4_tex1d, - slang_asm_vec4_tex2d, - slang_asm_vec4_tex3d, - slang_asm_vec4_texcube, - slang_asm_vec4_shad1d, - slang_asm_vec4_shad2d, - slang_asm_jump, - slang_asm_jump_if_zero, - slang_asm_enter, - slang_asm_leave, - slang_asm_local_alloc, - slang_asm_local_free, - slang_asm_local_addr, - slang_asm_global_addr, - slang_asm_call, - slang_asm_return, - slang_asm_discard, - slang_asm_exit, + /* core */ + slang_asm_none, + slang_asm_float_copy, + slang_asm_float_move, + slang_asm_float_push, + slang_asm_float_deref, + slang_asm_float_add, /* a = pop(); b = pop(); push(a + b); */ + slang_asm_float_multiply, + slang_asm_float_divide, + slang_asm_float_negate, /* push(-pop()) */ + slang_asm_float_less, /* a = pop(); b = pop(); push(a < b); */ + slang_asm_float_equal_exp, + slang_asm_float_equal_int, + slang_asm_float_to_int, /* push(floatToInt(pop())) */ + slang_asm_float_sine, /* push(sin(pop()) */ + slang_asm_float_arcsine, + slang_asm_float_arctan, + slang_asm_float_power, /* push(pow(pop(), pop())) */ + slang_asm_float_log2, + slang_asm_float_floor, + slang_asm_float_ceil, + slang_asm_float_noise1, /* push(noise1(pop()) */ + slang_asm_float_noise2, /* push(noise2(pop(), pop())) */ + slang_asm_float_noise3, + slang_asm_float_noise4, + + slang_asm_int_copy, + slang_asm_int_move, + slang_asm_int_push, + slang_asm_int_deref, + slang_asm_int_to_float, + slang_asm_int_to_addr, + + slang_asm_bool_copy, + slang_asm_bool_move, + slang_asm_bool_push, + slang_asm_bool_deref, + + slang_asm_addr_copy, + slang_asm_addr_push, + slang_asm_addr_deref, + slang_asm_addr_add, + slang_asm_addr_multiply, + + slang_asm_vec4_tex1d, + slang_asm_vec4_tex2d, + slang_asm_vec4_tex3d, + slang_asm_vec4_texcube, + slang_asm_vec4_shad1d, + slang_asm_vec4_shad2d, + + slang_asm_jump, + slang_asm_jump_if_zero, + + slang_asm_enter, + slang_asm_leave, + + slang_asm_local_alloc, + slang_asm_local_free, + slang_asm_local_addr, + slang_asm_global_addr, + + slang_asm_call, /* push(ip); jump(inst->param[0]); */ + slang_asm_return, + + slang_asm_discard, + slang_asm_exit, /* GL_MESA_shader_debug */ - slang_asm_float_print, - slang_asm_int_print, - slang_asm_bool_print, + slang_asm_float_print, + slang_asm_int_print, + slang_asm_bool_print, /* vec4 */ slang_asm_float_to_vec4, slang_asm_vec4_add, @@ -109,111 +119,152 @@ typedef enum slang_assembly_type_ slang_asm_vec4_deref, slang_asm_vec4_equal_int, /* not a real assembly instruction */ - slang_asm__last + slang_asm__last } slang_assembly_type; + +/** + * An assembly-level shader instruction. + */ typedef struct slang_assembly_ { - slang_assembly_type type; - GLfloat literal; - GLuint param[2]; + slang_assembly_type type; /**< The instruction opcode */ + GLfloat literal; /**< float literal */ + GLuint param[2]; /**< Two integer/address parameters */ } slang_assembly; + +/** + * A list of slang_assembly instructions + */ typedef struct slang_assembly_file_ { - slang_assembly *code; - GLuint count; - GLuint capacity; + slang_assembly *code; + GLuint count; + GLuint capacity; } slang_assembly_file; + +extern GLvoid +_slang_assembly_file_ctr(slang_assembly_file *); + extern GLvoid -_slang_assembly_file_ctr (slang_assembly_file *); +slang_assembly_file_destruct(slang_assembly_file *); + +extern GLboolean +slang_assembly_file_push(slang_assembly_file *, slang_assembly_type); + +extern GLboolean +slang_assembly_file_push_label(slang_assembly_file *, + slang_assembly_type, GLuint); + +extern GLboolean +slang_assembly_file_push_label2(slang_assembly_file *, slang_assembly_type, + GLuint, GLuint); + +extern GLboolean +slang_assembly_file_push_literal(slang_assembly_file *, + slang_assembly_type, GLfloat); -GLvoid slang_assembly_file_destruct (slang_assembly_file *); -GLboolean slang_assembly_file_push (slang_assembly_file *, slang_assembly_type); -GLboolean slang_assembly_file_push_label (slang_assembly_file *, slang_assembly_type, GLuint); -GLboolean slang_assembly_file_push_label2 (slang_assembly_file *, slang_assembly_type, GLuint, GLuint); -GLboolean slang_assembly_file_push_literal (slang_assembly_file *, slang_assembly_type, GLfloat); typedef struct slang_assembly_file_restore_point_ { - GLuint count; + GLuint count; } slang_assembly_file_restore_point; -GLboolean slang_assembly_file_restore_point_save (slang_assembly_file *, - slang_assembly_file_restore_point *); -GLboolean slang_assembly_file_restore_point_load (slang_assembly_file *, - slang_assembly_file_restore_point *); + +extern GLboolean +slang_assembly_file_restore_point_save(slang_assembly_file *, + slang_assembly_file_restore_point *); + +extern GLboolean +slang_assembly_file_restore_point_load(slang_assembly_file *, + slang_assembly_file_restore_point *); + typedef struct slang_assembly_flow_control_ { - GLuint loop_start; /* for "continue" statement */ - GLuint loop_end; /* for "break" statement */ - GLuint function_end; /* for "return" statement */ + GLuint loop_start; /**< for "continue" statement */ + GLuint loop_end; /**< for "break" statement */ + GLuint function_end; /**< for "return" statement */ } slang_assembly_flow_control; typedef struct slang_assembly_local_info_ { - GLuint ret_size; - GLuint addr_tmp; - GLuint swizzle_tmp; + GLuint ret_size; + GLuint addr_tmp; + GLuint swizzle_tmp; } slang_assembly_local_info; typedef enum { - slang_ref_force, - slang_ref_forbid/*, - slang_ref_freelance*/ + slang_ref_force, + slang_ref_forbid /**< slang_ref_freelance */ } slang_ref_type; -/* - * Holds a complete information about vector swizzle - the array contains - * vector component source indices, where 0 is "x", 1 is "y", 2 is "z" and 3 is "w". +/** + * Holds complete information about vector swizzle - the + * array contains vector component source indices, where 0 is "x", 1 + * is "y", 2 is "z" and 3 is "w". * Example: "xwz" --> { 3, { 0, 3, 2, not used } }. */ typedef struct slang_swizzle_ { - GLuint num_components; - GLuint swizzle[4]; + GLuint num_components; + GLuint swizzle[4]; } slang_swizzle; typedef struct slang_assembly_name_space_ { - struct slang_function_scope_ *funcs; - struct slang_struct_scope_ *structs; - struct slang_variable_scope_ *vars; + struct slang_function_scope_ *funcs; + struct slang_struct_scope_ *structs; + struct slang_variable_scope_ *vars; } slang_assembly_name_space; typedef struct slang_assemble_ctx_ { - slang_assembly_file *file; - struct slang_machine_ *mach; - slang_atom_pool *atoms; - slang_assembly_name_space space; - slang_assembly_flow_control flow; - slang_assembly_local_info local; - slang_ref_type ref; - slang_swizzle swz; + slang_assembly_file *file; + struct slang_machine_ *mach; + slang_atom_pool *atoms; + slang_assembly_name_space space; + slang_assembly_flow_control flow; + slang_assembly_local_info local; + slang_ref_type ref; + slang_swizzle swz; } slang_assemble_ctx; -struct slang_function_ *_slang_locate_function (struct slang_function_scope_ *funcs, slang_atom name, - struct slang_operation_ *params, GLuint num_params, slang_assembly_name_space *space, - slang_atom_pool *); +extern struct slang_function_ * +_slang_locate_function(const struct slang_function_scope_ *funcs, + slang_atom name, const struct slang_operation_ *params, + GLuint num_params, + const slang_assembly_name_space *space, + slang_atom_pool *); -GLboolean _slang_assemble_function (slang_assemble_ctx *, struct slang_function_ *); +extern GLboolean +_slang_assemble_function(slang_assemble_ctx *, struct slang_function_ *); -GLboolean _slang_cleanup_stack (slang_assemble_ctx *, struct slang_operation_ *); +extern GLboolean +_slang_assemble_function2(slang_assemble_ctx * , struct slang_function_ *); -GLboolean _slang_dereference (slang_assemble_ctx *, struct slang_operation_ *); +extern GLboolean +_slang_cleanup_stack(slang_assemble_ctx *, struct slang_operation_ *); -GLboolean _slang_assemble_function_call (slang_assemble_ctx *, struct slang_function_ *, - struct slang_operation_ *, GLuint, GLboolean); +extern GLboolean +_slang_dereference(slang_assemble_ctx *, struct slang_operation_ *); -GLboolean _slang_assemble_function_call_name (slang_assemble_ctx *, const char *, - struct slang_operation_ *, GLuint, GLboolean); +extern GLboolean +_slang_assemble_function_call(slang_assemble_ctx *, struct slang_function_ *, + struct slang_operation_ *, GLuint, GLboolean); + +extern GLboolean +_slang_assemble_function_call_name(slang_assemble_ctx *, const char *, + struct slang_operation_ *, GLuint, + GLboolean); + +extern GLboolean +_slang_assemble_operation(slang_assemble_ctx *, struct slang_operation_ *, + slang_ref_type); -GLboolean _slang_assemble_operation (slang_assemble_ctx *, struct slang_operation_ *, - slang_ref_type); #ifdef __cplusplus } @@ -225,4 +276,3 @@ GLboolean _slang_assemble_operation (slang_assemble_ctx *, struct slang_operatio #include "slang_assemble_conditional.h" #endif - diff --git a/src/mesa/shader/slang/slang_assemble_typeinfo.c b/src/mesa/shader/slang/slang_assemble_typeinfo.c index 58f4e24f256..f4ee573df73 100644 --- a/src/mesa/shader/slang/slang_assemble_typeinfo.c +++ b/src/mesa/shader/slang/slang_assemble_typeinfo.c @@ -36,552 +36,590 @@ * slang_type_specifier */ -GLvoid slang_type_specifier_ctr (slang_type_specifier *self) +GLvoid +slang_type_specifier_ctr(slang_type_specifier * self) { - self->type = slang_spec_void; - self->_struct = NULL; - self->_array = NULL; + self->type = slang_spec_void; + self->_struct = NULL; + self->_array = NULL; } -GLvoid slang_type_specifier_dtr (slang_type_specifier *self) +GLvoid +slang_type_specifier_dtr(slang_type_specifier * self) { - if (self->_struct != NULL) - { - slang_struct_destruct (self->_struct); - slang_alloc_free (self->_struct); - } - if (self->_array != NULL) - { - slang_type_specifier_dtr (self->_array); - slang_alloc_free (self->_array); - } + if (self->_struct != NULL) { + slang_struct_destruct(self->_struct); + slang_alloc_free(self->_struct); + } + if (self->_array != NULL) { + slang_type_specifier_dtr(self->_array); + slang_alloc_free(self->_array); + } } -GLboolean slang_type_specifier_copy (slang_type_specifier *x, const slang_type_specifier *y) +GLboolean +slang_type_specifier_copy(slang_type_specifier * x, + const slang_type_specifier * y) { - slang_type_specifier z; - - slang_type_specifier_ctr (&z); - z.type = y->type; - if (z.type == slang_spec_struct) - { - z._struct = (slang_struct *) slang_alloc_malloc (sizeof (slang_struct)); - if (z._struct == NULL) - { - slang_type_specifier_dtr (&z); - return GL_FALSE; - } - if (!slang_struct_construct (z._struct)) - { - slang_alloc_free (z._struct); - slang_type_specifier_dtr (&z); - return GL_FALSE; - } - if (!slang_struct_copy (z._struct, y->_struct)) - { - slang_type_specifier_dtr (&z); - return GL_FALSE; - } - } - else if (z.type == slang_spec_array) - { - z._array = (slang_type_specifier *) slang_alloc_malloc (sizeof (slang_type_specifier)); - if (z._array == NULL) - { - slang_type_specifier_dtr (&z); - return GL_FALSE; - } - slang_type_specifier_ctr (z._array); - if (!slang_type_specifier_copy (z._array, y->_array)) - { - slang_type_specifier_dtr (&z); - return GL_FALSE; - } - } - slang_type_specifier_dtr (x); - *x = z; - return GL_TRUE; + slang_type_specifier z; + + slang_type_specifier_ctr(&z); + z.type = y->type; + if (z.type == slang_spec_struct) { + z._struct = (slang_struct *) slang_alloc_malloc(sizeof(slang_struct)); + if (z._struct == NULL) { + slang_type_specifier_dtr(&z); + return GL_FALSE; + } + if (!slang_struct_construct(z._struct)) { + slang_alloc_free(z._struct); + slang_type_specifier_dtr(&z); + return GL_FALSE; + } + if (!slang_struct_copy(z._struct, y->_struct)) { + slang_type_specifier_dtr(&z); + return GL_FALSE; + } + } + else if (z.type == slang_spec_array) { + z._array = + (slang_type_specifier *) + slang_alloc_malloc(sizeof(slang_type_specifier)); + if (z._array == NULL) { + slang_type_specifier_dtr(&z); + return GL_FALSE; + } + slang_type_specifier_ctr(z._array); + if (!slang_type_specifier_copy(z._array, y->_array)) { + slang_type_specifier_dtr(&z); + return GL_FALSE; + } + } + slang_type_specifier_dtr(x); + *x = z; + return GL_TRUE; } -GLboolean slang_type_specifier_equal (const slang_type_specifier *x, const slang_type_specifier *y) +GLboolean +slang_type_specifier_equal(const slang_type_specifier * x, + const slang_type_specifier * y) { - if (x->type != y->type) - return 0; - if (x->type == slang_spec_struct) - return slang_struct_equal (x->_struct, y->_struct); - if (x->type == slang_spec_array) - return slang_type_specifier_equal (x->_array, y->_array); - return 1; + if (x->type != y->type) + return 0; + if (x->type == slang_spec_struct) + return slang_struct_equal(x->_struct, y->_struct); + if (x->type == slang_spec_array) + return slang_type_specifier_equal(x->_array, y->_array); + return 1; } /* slang_assembly_typeinfo */ -GLboolean slang_assembly_typeinfo_construct (slang_assembly_typeinfo *ti) +GLboolean +slang_assembly_typeinfo_construct(slang_assembly_typeinfo * ti) { - slang_type_specifier_ctr (&ti->spec); - ti->array_len = 0; - return GL_TRUE; + slang_type_specifier_ctr(&ti->spec); + ti->array_len = 0; + return GL_TRUE; } -GLvoid slang_assembly_typeinfo_destruct (slang_assembly_typeinfo *ti) +GLvoid +slang_assembly_typeinfo_destruct(slang_assembly_typeinfo * ti) { - slang_type_specifier_dtr (&ti->spec); + slang_type_specifier_dtr(&ti->spec); } /* _slang_typeof_operation() */ -static GLboolean typeof_existing_function (const char *name, slang_operation *params, - GLuint num_params, slang_assembly_name_space *space, slang_type_specifier *spec, - slang_atom_pool *atoms) +/** + * Determine the return type of a function. + * \param name name of the function + * \param params array of function parameters + * \param num_params number of parameters + * \param space namespace to use + * \param spec returns the function's type + * \param atoms atom pool + * \return GL_TRUE for success, GL_FALSE if failure + */ +static GLboolean +typeof_existing_function(const char *name, const slang_operation * params, + GLuint num_params, + const slang_assembly_name_space * space, + slang_type_specifier * spec, + slang_atom_pool * atoms) { - slang_atom atom; - GLboolean exists; - - atom = slang_atom_pool_atom (atoms, name); - if (!_slang_typeof_function (atom, params, num_params, space, spec, &exists, atoms)) - return GL_FALSE; - return exists; + slang_atom atom; + GLboolean exists; + + atom = slang_atom_pool_atom(atoms, name); + if (!_slang_typeof_function(atom, params, num_params, space, spec, + &exists, atoms)) + return GL_FALSE; + return exists; } -GLboolean _slang_typeof_operation (slang_assemble_ctx *A, slang_operation *op, - slang_assembly_typeinfo *ti) +GLboolean +_slang_typeof_operation(const slang_assemble_ctx * A, + const slang_operation * op, + slang_assembly_typeinfo * ti) { - return _slang_typeof_operation_ (op, &A->space, ti, A->atoms); + return _slang_typeof_operation_(op, &A->space, ti, A->atoms); } -GLboolean _slang_typeof_operation_ (slang_operation *op, slang_assembly_name_space *space, - slang_assembly_typeinfo *ti, slang_atom_pool *atoms) + +/** + * Determine the return type of an operation. + * \param op the operation node + * \param space the namespace to use + * \param ti the returned type + * \param atoms atom pool + * \return GL_TRUE for success, GL_FALSE if failure + */ +GLboolean +_slang_typeof_operation_(const slang_operation * op, + const slang_assembly_name_space * space, + slang_assembly_typeinfo * ti, + slang_atom_pool * atoms) { - ti->can_be_referenced = GL_FALSE; - ti->is_swizzled = GL_FALSE; - - switch (op->type) - { - case slang_oper_block_no_new_scope: - case slang_oper_block_new_scope: - case slang_oper_variable_decl: - case slang_oper_asm: - case slang_oper_break: - case slang_oper_continue: - case slang_oper_discard: - case slang_oper_return: - case slang_oper_if: - case slang_oper_while: - case slang_oper_do: - case slang_oper_for: - case slang_oper_void: - ti->spec.type = slang_spec_void; - break; - case slang_oper_expression: - case slang_oper_assign: - case slang_oper_addassign: - case slang_oper_subassign: - case slang_oper_mulassign: - case slang_oper_divassign: - case slang_oper_preincrement: - case slang_oper_predecrement: - if (!_slang_typeof_operation_ (op->children, space, ti, atoms)) - return 0; - break; - case slang_oper_literal_bool: - case slang_oper_logicalor: - case slang_oper_logicalxor: - case slang_oper_logicaland: - case slang_oper_equal: - case slang_oper_notequal: - case slang_oper_less: - case slang_oper_greater: - case slang_oper_lessequal: - case slang_oper_greaterequal: - case slang_oper_not: - ti->spec.type = slang_spec_bool; - break; - case slang_oper_literal_int: - ti->spec.type = slang_spec_int; - break; - case slang_oper_literal_float: - ti->spec.type = slang_spec_float; - break; - case slang_oper_identifier: - { - slang_variable *var; - - var = _slang_locate_variable (op->locals, op->a_id, GL_TRUE); - if (var == NULL) - return GL_FALSE; - if (!slang_type_specifier_copy (&ti->spec, &var->type.specifier)) - return GL_FALSE; - ti->can_be_referenced = GL_TRUE; - ti->array_len = var->array_len; - } - break; - case slang_oper_sequence: - /* TODO: check [0] and [1] if they match */ - if (!_slang_typeof_operation_ (&op->children[1], space, ti, atoms)) - return GL_FALSE; - ti->can_be_referenced = GL_FALSE; - ti->is_swizzled = GL_FALSE; - break; - /*case slang_oper_modassign:*/ - /*case slang_oper_lshassign:*/ - /*case slang_oper_rshassign:*/ - /*case slang_oper_orassign:*/ - /*case slang_oper_xorassign:*/ - /*case slang_oper_andassign:*/ - case slang_oper_select: - /* TODO: check [1] and [2] if they match */ - if (!_slang_typeof_operation_ (&op->children[1], space, ti, atoms)) - return GL_FALSE; - ti->can_be_referenced = GL_FALSE; - ti->is_swizzled = GL_FALSE; - break; - /*case slang_oper_bitor:*/ - /*case slang_oper_bitxor:*/ - /*case slang_oper_bitand:*/ - /*case slang_oper_lshift:*/ - /*case slang_oper_rshift:*/ - case slang_oper_add: - if (!typeof_existing_function ("+", op->children, 2, space, &ti->spec, atoms)) - return GL_FALSE; - break; - case slang_oper_subtract: - if (!typeof_existing_function ("-", op->children, 2, space, &ti->spec, atoms)) - return GL_FALSE; - break; - case slang_oper_multiply: - if (!typeof_existing_function ("*", op->children, 2, space, &ti->spec, atoms)) - return GL_FALSE; - break; - case slang_oper_divide: - if (!typeof_existing_function ("/", op->children, 2, space, &ti->spec, atoms)) - return GL_FALSE; - break; - /*case slang_oper_modulus:*/ - case slang_oper_plus: - if (!_slang_typeof_operation_ (op->children, space, ti, atoms)) - return GL_FALSE; - ti->can_be_referenced = GL_FALSE; - ti->is_swizzled = GL_FALSE; - break; - case slang_oper_minus: - if (!typeof_existing_function ("-", op->children, 1, space, &ti->spec, atoms)) - return GL_FALSE; - break; - /*case slang_oper_complement:*/ - case slang_oper_subscript: - { - slang_assembly_typeinfo _ti; - - if (!slang_assembly_typeinfo_construct (&_ti)) - return GL_FALSE; - if (!_slang_typeof_operation_ (op->children, space, &_ti, atoms)) - { - slang_assembly_typeinfo_destruct (&_ti); - return GL_FALSE; - } - ti->can_be_referenced = _ti.can_be_referenced; - if (_ti.spec.type == slang_spec_array) - { - if (!slang_type_specifier_copy (&ti->spec, _ti.spec._array)) - { - slang_assembly_typeinfo_destruct (&_ti); - return GL_FALSE; - } - } - else - { - if (!_slang_type_is_vector (_ti.spec.type) && !_slang_type_is_matrix (_ti.spec.type)) - { - slang_assembly_typeinfo_destruct (&_ti); - return GL_FALSE; - } - ti->spec.type = _slang_type_base (_ti.spec.type); - } - slang_assembly_typeinfo_destruct (&_ti); - } - break; - case slang_oper_call: - { - GLboolean exists; - - if (!_slang_typeof_function (op->a_id, op->children, op->num_children, space, &ti->spec, - &exists, atoms)) - return GL_FALSE; - if (!exists) - { - slang_struct *s = slang_struct_scope_find (space->structs, op->a_id, GL_TRUE); - if (s != NULL) - { - ti->spec.type = slang_spec_struct; - ti->spec._struct = (slang_struct *) slang_alloc_malloc (sizeof (slang_struct)); - if (ti->spec._struct == NULL) - return GL_FALSE; - if (!slang_struct_construct (ti->spec._struct)) - { - slang_alloc_free (ti->spec._struct); - ti->spec._struct = NULL; - return GL_FALSE; - } - if (!slang_struct_copy (ti->spec._struct, s)) - return GL_FALSE; - } - else - { - const char *name; - slang_type_specifier_type type; - - name = slang_atom_pool_id (atoms, op->a_id); - type = slang_type_specifier_type_from_string (name); - if (type == slang_spec_void) - return GL_FALSE; - ti->spec.type = type; - } - } - } - break; - case slang_oper_field: - { - slang_assembly_typeinfo _ti; - - if (!slang_assembly_typeinfo_construct (&_ti)) - return GL_FALSE; - if (!_slang_typeof_operation_ (op->children, space, &_ti, atoms)) - { - slang_assembly_typeinfo_destruct (&_ti); - return GL_FALSE; - } - if (_ti.spec.type == slang_spec_struct) - { - slang_variable *field; - - field = _slang_locate_variable (_ti.spec._struct->fields, op->a_id, GL_FALSE); - if (field == NULL) - { - slang_assembly_typeinfo_destruct (&_ti); - return GL_FALSE; - } - if (!slang_type_specifier_copy (&ti->spec, &field->type.specifier)) - { - slang_assembly_typeinfo_destruct (&_ti); - return GL_FALSE; - } - ti->can_be_referenced = _ti.can_be_referenced; - } - else - { - GLuint rows; - const char *swizzle; - slang_type_specifier_type base; - - /* determine the swizzle of the field expression */ - if (!_slang_type_is_vector (_ti.spec.type)) - { - slang_assembly_typeinfo_destruct (&_ti); - return GL_FALSE; - } - rows = _slang_type_dim (_ti.spec.type); - swizzle = slang_atom_pool_id (atoms, op->a_id); - if (!_slang_is_swizzle (swizzle, rows, &ti->swz)) - { - slang_assembly_typeinfo_destruct (&_ti); - return GL_FALSE; - } - ti->is_swizzled = GL_TRUE; - ti->can_be_referenced = _ti.can_be_referenced && _slang_is_swizzle_mask (&ti->swz, - rows); - if (_ti.is_swizzled) - { - slang_swizzle swz; - - /* swizzle the swizzle */ - _slang_multiply_swizzles (&swz, &_ti.swz, &ti->swz); - ti->swz = swz; - } - base = _slang_type_base (_ti.spec.type); - switch (ti->swz.num_components) - { - case 1: - ti->spec.type = base; - break; - case 2: - switch (base) - { - case slang_spec_float: - ti->spec.type = slang_spec_vec2; - break; - case slang_spec_int: - ti->spec.type = slang_spec_ivec2; - break; - case slang_spec_bool: - ti->spec.type = slang_spec_bvec2; - break; - default: - break; - } - break; - case 3: - switch (base) - { - case slang_spec_float: - ti->spec.type = slang_spec_vec3; - break; - case slang_spec_int: - ti->spec.type = slang_spec_ivec3; - break; - case slang_spec_bool: - ti->spec.type = slang_spec_bvec3; - break; - default: - break; - } - break; - case 4: - switch (base) - { - case slang_spec_float: - ti->spec.type = slang_spec_vec4; - break; - case slang_spec_int: - ti->spec.type = slang_spec_ivec4; - break; - case slang_spec_bool: - ti->spec.type = slang_spec_bvec4; - break; - default: - break; - } - break; - default: - break; - } - } - slang_assembly_typeinfo_destruct (&_ti); - } - break; - case slang_oper_postincrement: - case slang_oper_postdecrement: - if (!_slang_typeof_operation_ (op->children, space, ti, atoms)) - return GL_FALSE; - ti->can_be_referenced = GL_FALSE; - ti->is_swizzled = GL_FALSE; - break; - default: - return GL_FALSE; - } - - return GL_TRUE; + ti->can_be_referenced = GL_FALSE; + ti->is_swizzled = GL_FALSE; + + switch (op->type) { + case slang_oper_block_no_new_scope: + case slang_oper_block_new_scope: + case slang_oper_variable_decl: + case slang_oper_asm: + case slang_oper_break: + case slang_oper_continue: + case slang_oper_discard: + case slang_oper_return: + case slang_oper_if: + case slang_oper_while: + case slang_oper_do: + case slang_oper_for: + case slang_oper_void: + ti->spec.type = slang_spec_void; + break; + case slang_oper_expression: + case slang_oper_assign: + case slang_oper_addassign: + case slang_oper_subassign: + case slang_oper_mulassign: + case slang_oper_divassign: + case slang_oper_preincrement: + case slang_oper_predecrement: + if (!_slang_typeof_operation_(op->children, space, ti, atoms)) + return 0; + break; + case slang_oper_literal_bool: + case slang_oper_logicalor: + case slang_oper_logicalxor: + case slang_oper_logicaland: + case slang_oper_equal: + case slang_oper_notequal: + case slang_oper_less: + case slang_oper_greater: + case slang_oper_lessequal: + case slang_oper_greaterequal: + case slang_oper_not: + ti->spec.type = slang_spec_bool; + break; + case slang_oper_literal_int: + ti->spec.type = slang_spec_int; + break; + case slang_oper_literal_float: + ti->spec.type = slang_spec_float; + break; + case slang_oper_identifier: + { + slang_variable *var; + + var = _slang_locate_variable(op->locals, op->a_id, GL_TRUE); + if (var == NULL) + return GL_FALSE; + if (!slang_type_specifier_copy(&ti->spec, &var->type.specifier)) + return GL_FALSE; + ti->can_be_referenced = GL_TRUE; + ti->array_len = var->array_len; + } + break; + case slang_oper_sequence: + /* TODO: check [0] and [1] if they match */ + if (!_slang_typeof_operation_(&op->children[1], space, ti, atoms)) + return GL_FALSE; + ti->can_be_referenced = GL_FALSE; + ti->is_swizzled = GL_FALSE; + break; + /*case slang_oper_modassign: */ + /*case slang_oper_lshassign: */ + /*case slang_oper_rshassign: */ + /*case slang_oper_orassign: */ + /*case slang_oper_xorassign: */ + /*case slang_oper_andassign: */ + case slang_oper_select: + /* TODO: check [1] and [2] if they match */ + if (!_slang_typeof_operation_(&op->children[1], space, ti, atoms)) + return GL_FALSE; + ti->can_be_referenced = GL_FALSE; + ti->is_swizzled = GL_FALSE; + break; + /*case slang_oper_bitor: */ + /*case slang_oper_bitxor: */ + /*case slang_oper_bitand: */ + /*case slang_oper_lshift: */ + /*case slang_oper_rshift: */ + case slang_oper_add: + if (!typeof_existing_function("+", op->children, 2, space, + &ti->spec, atoms)) + return GL_FALSE; + break; + case slang_oper_subtract: + if (!typeof_existing_function("-", op->children, 2, space, + &ti->spec, atoms)) + return GL_FALSE; + break; + case slang_oper_multiply: + if (!typeof_existing_function("*", op->children, 2, space, + &ti->spec, atoms)) + return GL_FALSE; + break; + case slang_oper_divide: + if (!typeof_existing_function("/", op->children, 2, space, + &ti->spec, atoms)) + return GL_FALSE; + break; + /*case slang_oper_modulus: */ + case slang_oper_plus: + if (!_slang_typeof_operation_(op->children, space, ti, atoms)) + return GL_FALSE; + ti->can_be_referenced = GL_FALSE; + ti->is_swizzled = GL_FALSE; + break; + case slang_oper_minus: + if (!typeof_existing_function + ("-", op->children, 1, space, &ti->spec, atoms)) + return GL_FALSE; + break; + /*case slang_oper_complement: */ + case slang_oper_subscript: + { + slang_assembly_typeinfo _ti; + + if (!slang_assembly_typeinfo_construct(&_ti)) + return GL_FALSE; + if (!_slang_typeof_operation_(op->children, space, &_ti, atoms)) { + slang_assembly_typeinfo_destruct(&_ti); + return GL_FALSE; + } + ti->can_be_referenced = _ti.can_be_referenced; + if (_ti.spec.type == slang_spec_array) { + if (!slang_type_specifier_copy(&ti->spec, _ti.spec._array)) { + slang_assembly_typeinfo_destruct(&_ti); + return GL_FALSE; + } + } + else { + if (!_slang_type_is_vector(_ti.spec.type) + && !_slang_type_is_matrix(_ti.spec.type)) { + slang_assembly_typeinfo_destruct(&_ti); + return GL_FALSE; + } + ti->spec.type = _slang_type_base(_ti.spec.type); + } + slang_assembly_typeinfo_destruct(&_ti); + } + break; + case slang_oper_call: + { + GLboolean exists; + + if (!_slang_typeof_function(op->a_id, op->children, op->num_children, + space, &ti->spec, &exists, atoms)) + return GL_FALSE; + if (!exists) { + slang_struct *s = + slang_struct_scope_find(space->structs, op->a_id, GL_TRUE); + if (s != NULL) { + ti->spec.type = slang_spec_struct; + ti->spec._struct = + (slang_struct *) slang_alloc_malloc(sizeof(slang_struct)); + if (ti->spec._struct == NULL) + return GL_FALSE; + if (!slang_struct_construct(ti->spec._struct)) { + slang_alloc_free(ti->spec._struct); + ti->spec._struct = NULL; + return GL_FALSE; + } + if (!slang_struct_copy(ti->spec._struct, s)) + return GL_FALSE; + } + else { + const char *name; + slang_type_specifier_type type; + + name = slang_atom_pool_id(atoms, op->a_id); + type = slang_type_specifier_type_from_string(name); + if (type == slang_spec_void) + return GL_FALSE; + ti->spec.type = type; + } + } + } + break; + case slang_oper_field: + { + slang_assembly_typeinfo _ti; + + if (!slang_assembly_typeinfo_construct(&_ti)) + return GL_FALSE; + if (!_slang_typeof_operation_(op->children, space, &_ti, atoms)) { + slang_assembly_typeinfo_destruct(&_ti); + return GL_FALSE; + } + if (_ti.spec.type == slang_spec_struct) { + slang_variable *field; + + field = + _slang_locate_variable(_ti.spec._struct->fields, op->a_id, + GL_FALSE); + if (field == NULL) { + slang_assembly_typeinfo_destruct(&_ti); + return GL_FALSE; + } + if (!slang_type_specifier_copy(&ti->spec, &field->type.specifier)) { + slang_assembly_typeinfo_destruct(&_ti); + return GL_FALSE; + } + ti->can_be_referenced = _ti.can_be_referenced; + } + else { + GLuint rows; + const char *swizzle; + slang_type_specifier_type base; + + /* determine the swizzle of the field expression */ + if (!_slang_type_is_vector(_ti.spec.type)) { + slang_assembly_typeinfo_destruct(&_ti); + return GL_FALSE; + } + rows = _slang_type_dim(_ti.spec.type); + swizzle = slang_atom_pool_id(atoms, op->a_id); + if (!_slang_is_swizzle(swizzle, rows, &ti->swz)) { + slang_assembly_typeinfo_destruct(&_ti); + return GL_FALSE; + } + ti->is_swizzled = GL_TRUE; + ti->can_be_referenced = _ti.can_be_referenced + && _slang_is_swizzle_mask(&ti->swz, rows); + if (_ti.is_swizzled) { + slang_swizzle swz; + + /* swizzle the swizzle */ + _slang_multiply_swizzles(&swz, &_ti.swz, &ti->swz); + ti->swz = swz; + } + base = _slang_type_base(_ti.spec.type); + switch (ti->swz.num_components) { + case 1: + ti->spec.type = base; + break; + case 2: + switch (base) { + case slang_spec_float: + ti->spec.type = slang_spec_vec2; + break; + case slang_spec_int: + ti->spec.type = slang_spec_ivec2; + break; + case slang_spec_bool: + ti->spec.type = slang_spec_bvec2; + break; + default: + break; + } + break; + case 3: + switch (base) { + case slang_spec_float: + ti->spec.type = slang_spec_vec3; + break; + case slang_spec_int: + ti->spec.type = slang_spec_ivec3; + break; + case slang_spec_bool: + ti->spec.type = slang_spec_bvec3; + break; + default: + break; + } + break; + case 4: + switch (base) { + case slang_spec_float: + ti->spec.type = slang_spec_vec4; + break; + case slang_spec_int: + ti->spec.type = slang_spec_ivec4; + break; + case slang_spec_bool: + ti->spec.type = slang_spec_bvec4; + break; + default: + break; + } + break; + default: + break; + } + } + slang_assembly_typeinfo_destruct(&_ti); + } + break; + case slang_oper_postincrement: + case slang_oper_postdecrement: + if (!_slang_typeof_operation_(op->children, space, ti, atoms)) + return GL_FALSE; + ti->can_be_referenced = GL_FALSE; + ti->is_swizzled = GL_FALSE; + break; + default: + return GL_FALSE; + } + + return GL_TRUE; } -/* _slang_typeof_function() */ -GLboolean _slang_typeof_function (slang_atom a_name, slang_operation *params, GLuint num_params, - slang_assembly_name_space *space, slang_type_specifier *spec, GLboolean *exists, - slang_atom_pool *atoms) + +/** + * Determine the return type of a function. + * \param a_name the function name + * \param param function parameters (overloading) + * \param num_params number of parameters to function + * \param space namespace to search + * \param exists returns GL_TRUE or GL_FALSE to indicate existance of function + * \return GL_TRUE for success, GL_FALSE if failure (bad function name) + */ +GLboolean +_slang_typeof_function(slang_atom a_name, const slang_operation * params, + GLuint num_params, + const slang_assembly_name_space * space, + slang_type_specifier * spec, GLboolean * exists, + slang_atom_pool * atoms) { - slang_function *fun; - - fun = _slang_locate_function (space->funcs, a_name, params, num_params, space, atoms); - *exists = fun != NULL; - if (fun == NULL) - return GL_TRUE; - return slang_type_specifier_copy (spec, &fun->header.type.specifier); + slang_function *fun = _slang_locate_function(space->funcs, a_name, params, + num_params, space, atoms); + *exists = fun != NULL; + if (!fun) + return GL_TRUE; /* yes, not false */ + return slang_type_specifier_copy(spec, &fun->header.type.specifier); } -/* _slang_type_is_matrix() */ -GLboolean _slang_type_is_matrix (slang_type_specifier_type ty) + +/** + * Determine if a type is a matrix. + * \return GL_TRUE if is a matrix, GL_FALSE otherwise. + */ +GLboolean +_slang_type_is_matrix(slang_type_specifier_type ty) { - switch (ty) - { - case slang_spec_mat2: - case slang_spec_mat3: - case slang_spec_mat4: - return GL_TRUE; - default: - return GL_FALSE; - } + switch (ty) { + case slang_spec_mat2: + case slang_spec_mat3: + case slang_spec_mat4: + return GL_TRUE; + default: + return GL_FALSE; + } } -/* _slang_type_is_vector() */ -GLboolean _slang_type_is_vector (slang_type_specifier_type ty) +/** + * Determine if a type is a vector. + * \return GL_TRUE if is a vector, GL_FALSE otherwise. + */ +GLboolean +_slang_type_is_vector(slang_type_specifier_type ty) { - switch (ty) - { - case slang_spec_vec2: - case slang_spec_vec3: - case slang_spec_vec4: - case slang_spec_ivec2: - case slang_spec_ivec3: - case slang_spec_ivec4: - case slang_spec_bvec2: - case slang_spec_bvec3: - case slang_spec_bvec4: - return GL_TRUE; - default: - return GL_FALSE; - } + switch (ty) { + case slang_spec_vec2: + case slang_spec_vec3: + case slang_spec_vec4: + case slang_spec_ivec2: + case slang_spec_ivec3: + case slang_spec_ivec4: + case slang_spec_bvec2: + case slang_spec_bvec3: + case slang_spec_bvec4: + return GL_TRUE; + default: + return GL_FALSE; + } } -/* _slang_type_base_of_vector() */ -slang_type_specifier_type _slang_type_base (slang_type_specifier_type ty) +/** + * Given a vector type, return the type of the vector's elements + */ +slang_type_specifier_type +_slang_type_base(slang_type_specifier_type ty) { - switch (ty) - { - case slang_spec_float: - case slang_spec_vec2: - case slang_spec_vec3: - case slang_spec_vec4: - return slang_spec_float; - case slang_spec_int: - case slang_spec_ivec2: - case slang_spec_ivec3: - case slang_spec_ivec4: - return slang_spec_int; - case slang_spec_bool: - case slang_spec_bvec2: - case slang_spec_bvec3: - case slang_spec_bvec4: - return slang_spec_bool; - case slang_spec_mat2: - return slang_spec_vec2; - case slang_spec_mat3: - return slang_spec_vec3; - case slang_spec_mat4: - return slang_spec_vec4; - default: - return slang_spec_void; - } + switch (ty) { + case slang_spec_float: + case slang_spec_vec2: + case slang_spec_vec3: + case slang_spec_vec4: + return slang_spec_float; + case slang_spec_int: + case slang_spec_ivec2: + case slang_spec_ivec3: + case slang_spec_ivec4: + return slang_spec_int; + case slang_spec_bool: + case slang_spec_bvec2: + case slang_spec_bvec3: + case slang_spec_bvec4: + return slang_spec_bool; + case slang_spec_mat2: + return slang_spec_vec2; + case slang_spec_mat3: + return slang_spec_vec3; + case slang_spec_mat4: + return slang_spec_vec4; + default: + return slang_spec_void; + } } -/* _slang_type_dim */ -GLuint _slang_type_dim (slang_type_specifier_type ty) +/** + * Return the number of elements in a vector or matrix type + */ +GLuint +_slang_type_dim(slang_type_specifier_type ty) { - switch (ty) - { - case slang_spec_float: - case slang_spec_int: - case slang_spec_bool: - return 1; - case slang_spec_vec2: - case slang_spec_ivec2: - case slang_spec_bvec2: - case slang_spec_mat2: - return 2; - case slang_spec_vec3: - case slang_spec_ivec3: - case slang_spec_bvec3: - case slang_spec_mat3: - return 3; - case slang_spec_vec4: - case slang_spec_ivec4: - case slang_spec_bvec4: - case slang_spec_mat4: - return 4; - default: - return 0; - } + switch (ty) { + case slang_spec_float: + case slang_spec_int: + case slang_spec_bool: + return 1; + case slang_spec_vec2: + case slang_spec_ivec2: + case slang_spec_bvec2: + case slang_spec_mat2: + return 2; + case slang_spec_vec3: + case slang_spec_ivec3: + case slang_spec_bvec3: + case slang_spec_mat3: + return 3; + case slang_spec_vec4: + case slang_spec_ivec4: + case slang_spec_bvec4: + case slang_spec_mat4: + return 4; + default: + return 0; + } } - diff --git a/src/mesa/shader/slang/slang_assemble_typeinfo.h b/src/mesa/shader/slang/slang_assemble_typeinfo.h index 7e8af96915b..5d951226a1e 100644 --- a/src/mesa/shader/slang/slang_assemble_typeinfo.h +++ b/src/mesa/shader/slang/slang_assemble_typeinfo.h @@ -29,84 +29,120 @@ extern "C" { #endif + +/** + * The basic shading language types (float, vec4, mat3, etc) + */ typedef enum slang_type_specifier_type_ { - slang_spec_void, - slang_spec_bool, - slang_spec_bvec2, - slang_spec_bvec3, - slang_spec_bvec4, - slang_spec_int, - slang_spec_ivec2, - slang_spec_ivec3, - slang_spec_ivec4, - slang_spec_float, - slang_spec_vec2, - slang_spec_vec3, - slang_spec_vec4, - slang_spec_mat2, - slang_spec_mat3, - slang_spec_mat4, - slang_spec_sampler1D, - slang_spec_sampler2D, - slang_spec_sampler3D, - slang_spec_samplerCube, - slang_spec_sampler1DShadow, - slang_spec_sampler2DShadow, - slang_spec_struct, - slang_spec_array + slang_spec_void, + slang_spec_bool, + slang_spec_bvec2, + slang_spec_bvec3, + slang_spec_bvec4, + slang_spec_int, + slang_spec_ivec2, + slang_spec_ivec3, + slang_spec_ivec4, + slang_spec_float, + slang_spec_vec2, + slang_spec_vec3, + slang_spec_vec4, + slang_spec_mat2, + slang_spec_mat3, + slang_spec_mat4, + slang_spec_sampler1D, + slang_spec_sampler2D, + slang_spec_sampler3D, + slang_spec_samplerCube, + slang_spec_sampler1DShadow, + slang_spec_sampler2DShadow, + slang_spec_struct, + slang_spec_array } slang_type_specifier_type; + +/** + * Describes more sophisticated types, like structs and arrays. + */ typedef struct slang_type_specifier_ { - slang_type_specifier_type type; - struct slang_struct_ *_struct; /* type: spec_struct */ - struct slang_type_specifier_ *_array; /* type: spec_array */ + slang_type_specifier_type type; + struct slang_struct_ *_struct; /**< type: spec_struct */ + struct slang_type_specifier_ *_array; /**< type: spec_array */ } slang_type_specifier; -GLvoid slang_type_specifier_ctr (slang_type_specifier *); -GLvoid slang_type_specifier_dtr (slang_type_specifier *); -GLboolean slang_type_specifier_copy (slang_type_specifier *, const slang_type_specifier *); -GLboolean slang_type_specifier_equal (const slang_type_specifier *, const slang_type_specifier *); + +extern GLvoid +slang_type_specifier_ctr(slang_type_specifier *); + +extern GLvoid +slang_type_specifier_dtr(slang_type_specifier *); + +extern GLboolean +slang_type_specifier_copy(slang_type_specifier *, const slang_type_specifier *); + +extern GLboolean +slang_type_specifier_equal(const slang_type_specifier *, + const slang_type_specifier *); + typedef struct slang_assembly_typeinfo_ { - GLboolean can_be_referenced; - GLboolean is_swizzled; - slang_swizzle swz; - slang_type_specifier spec; - GLuint array_len; + GLboolean can_be_referenced; + GLboolean is_swizzled; + slang_swizzle swz; + slang_type_specifier spec; + GLuint array_len; } slang_assembly_typeinfo; -GLboolean slang_assembly_typeinfo_construct (slang_assembly_typeinfo *); -GLvoid slang_assembly_typeinfo_destruct (slang_assembly_typeinfo *); +extern GLboolean +slang_assembly_typeinfo_construct(slang_assembly_typeinfo *); -/* +extern GLvoid +slang_assembly_typeinfo_destruct(slang_assembly_typeinfo *); + + +/** * Retrieves type information about an operation. * Returns GL_TRUE on success. * Returns GL_FALSE otherwise. */ -GLboolean _slang_typeof_operation (slang_assemble_ctx *, struct slang_operation_ *, - slang_assembly_typeinfo *); -GLboolean _slang_typeof_operation_ (struct slang_operation_ *, slang_assembly_name_space *, - slang_assembly_typeinfo *, slang_atom_pool *); +extern GLboolean +_slang_typeof_operation(const slang_assemble_ctx *, + const struct slang_operation_ *, + slang_assembly_typeinfo *); -/* +extern GLboolean +_slang_typeof_operation_(const struct slang_operation_ *, + const slang_assembly_name_space *, + slang_assembly_typeinfo *, slang_atom_pool *); + +/** * Retrieves type of a function prototype, if one exists. * Returns GL_TRUE on success, even if the function was not found. * Returns GL_FALSE otherwise. */ -GLboolean _slang_typeof_function (slang_atom a_name, struct slang_operation_ *params, - GLuint num_params, slang_assembly_name_space *, slang_type_specifier *spec, GLboolean *exists, - slang_atom_pool *); +extern GLboolean +_slang_typeof_function(slang_atom a_name, + const struct slang_operation_ *params, + GLuint num_params, const slang_assembly_name_space *, + slang_type_specifier *spec, GLboolean *exists, + slang_atom_pool *); + +extern GLboolean +_slang_type_is_matrix(slang_type_specifier_type); + +extern GLboolean +_slang_type_is_vector(slang_type_specifier_type); -GLboolean _slang_type_is_matrix (slang_type_specifier_type); +extern slang_type_specifier_type +_slang_type_base(slang_type_specifier_type); -GLboolean _slang_type_is_vector (slang_type_specifier_type); +extern GLuint +_slang_type_dim(slang_type_specifier_type); -slang_type_specifier_type _slang_type_base (slang_type_specifier_type); -GLuint _slang_type_dim (slang_type_specifier_type); #ifdef __cplusplus } diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c index 357d61b246a..77a293ea45e 100644 --- a/src/mesa/shader/slang/slang_compile.c +++ b/src/mesa/shader/slang/slang_compile.c @@ -35,21 +35,23 @@ #include "slang_storage.h" /* - * This is a straightforward implementation of the slang front-end compiler. - * Lots of error-checking functionality is missing but every well-formed shader source should - * compile successfully and execute as expected. However, some semantically ill-formed shaders + * This is a straightforward implementation of the slang front-end + * compiler. Lots of error-checking functionality is missing but + * every well-formed shader source should compile successfully and + * execute as expected. However, some semantically ill-formed shaders * may be accepted resulting in undefined behaviour. */ /* slang_var_pool */ -static GLuint slang_var_pool_alloc (slang_var_pool *pool, unsigned int size) +static GLuint +slang_var_pool_alloc(slang_var_pool * pool, unsigned int size) { - GLuint addr; + GLuint addr; - addr = pool->next_addr; - pool->next_addr += size; - return addr; + addr = pool->next_addr; + pool->next_addr += size; + return addr; } /* @@ -57,20 +59,21 @@ static GLuint slang_var_pool_alloc (slang_var_pool *pool, unsigned int size) */ GLvoid -_slang_code_unit_ctr (slang_code_unit *self, struct slang_code_object_ *object) +_slang_code_unit_ctr(slang_code_unit * self, + struct slang_code_object_ * object) { - _slang_variable_scope_ctr (&self->vars); - _slang_function_scope_ctr (&self->funs); - _slang_struct_scope_ctr (&self->structs); + _slang_variable_scope_ctr(&self->vars); + _slang_function_scope_ctr(&self->funs); + _slang_struct_scope_ctr(&self->structs); self->object = object; } GLvoid -_slang_code_unit_dtr (slang_code_unit *self) +_slang_code_unit_dtr(slang_code_unit * self) { - slang_variable_scope_destruct (&self->vars); - slang_function_scope_destruct (&self->funs); - slang_struct_scope_destruct (&self->structs); + slang_variable_scope_destruct(&self->vars); + slang_function_scope_destruct(&self->funs); + slang_struct_scope_destruct(&self->structs); } /* @@ -78,296 +81,313 @@ _slang_code_unit_dtr (slang_code_unit *self) */ GLvoid -_slang_code_object_ctr (slang_code_object *self) +_slang_code_object_ctr(slang_code_object * self) { GLuint i; for (i = 0; i < SLANG_BUILTIN_TOTAL; i++) - _slang_code_unit_ctr (&self->builtin[i], self); - _slang_code_unit_ctr (&self->unit, self); - _slang_assembly_file_ctr (&self->assembly); - slang_machine_ctr (&self->machine); + _slang_code_unit_ctr(&self->builtin[i], self); + _slang_code_unit_ctr(&self->unit, self); + _slang_assembly_file_ctr(&self->assembly); + slang_machine_ctr(&self->machine); self->varpool.next_addr = 0; - slang_atom_pool_construct (&self->atompool); - slang_export_data_table_ctr (&self->expdata); + slang_atom_pool_construct(&self->atompool); + slang_export_data_table_ctr(&self->expdata); self->expdata.atoms = &self->atompool; - slang_export_code_table_ctr (&self->expcode); + slang_export_code_table_ctr(&self->expcode); self->expcode.atoms = &self->atompool; } GLvoid -_slang_code_object_dtr (slang_code_object *self) +_slang_code_object_dtr(slang_code_object * self) { GLuint i; for (i = 0; i < SLANG_BUILTIN_TOTAL; i++) - _slang_code_unit_dtr (&self->builtin[i]); - _slang_code_unit_dtr (&self->unit); - slang_assembly_file_destruct (&self->assembly); - slang_machine_dtr (&self->machine); - slang_atom_pool_destruct (&self->atompool); - slang_export_data_table_dtr (&self->expdata); - slang_export_code_table_ctr (&self->expcode); + _slang_code_unit_dtr(&self->builtin[i]); + _slang_code_unit_dtr(&self->unit); + slang_assembly_file_destruct(&self->assembly); + slang_machine_dtr(&self->machine); + slang_atom_pool_destruct(&self->atompool); + slang_export_data_table_dtr(&self->expdata); + slang_export_code_table_ctr(&self->expcode); } /* slang_info_log */ static char *out_of_memory = "Error: Out of memory.\n"; -void slang_info_log_construct (slang_info_log *log) +void +slang_info_log_construct(slang_info_log * log) { - log->text = NULL; - log->dont_free_text = 0; + log->text = NULL; + log->dont_free_text = 0; } -void slang_info_log_destruct (slang_info_log *log) +void +slang_info_log_destruct(slang_info_log * log) { - if (!log->dont_free_text) - slang_alloc_free (log->text); + if (!log->dont_free_text) + slang_alloc_free(log->text); } -static int slang_info_log_message (slang_info_log *log, const char *prefix, const char *msg) +static int +slang_info_log_message(slang_info_log * log, const char *prefix, + const char *msg) { GLuint size; - if (log->dont_free_text) - return 0; - size = slang_string_length (msg) + 2; + if (log->dont_free_text) + return 0; + size = slang_string_length(msg) + 2; if (prefix != NULL) - size += slang_string_length (prefix) + 2; + size += slang_string_length(prefix) + 2; if (log->text != NULL) { - GLuint old_len = slang_string_length (log->text); - log->text = (char *) (slang_alloc_realloc (log->text, old_len + 1, old_len + size)); + GLuint old_len = slang_string_length(log->text); + log->text = (char *) + slang_alloc_realloc(log->text, old_len + 1, old_len + size); } else { - log->text = (char *) (slang_alloc_malloc (size)); + log->text = (char *) (slang_alloc_malloc(size)); if (log->text != NULL) log->text[0] = '\0'; } - if (log->text == NULL) - return 0; + if (log->text == NULL) + return 0; if (prefix != NULL) { - slang_string_concat (log->text, prefix); - slang_string_concat (log->text, ": "); + slang_string_concat(log->text, prefix); + slang_string_concat(log->text, ": "); } - slang_string_concat (log->text, msg); - slang_string_concat (log->text, "\n"); - return 1; + slang_string_concat(log->text, msg); + slang_string_concat(log->text, "\n"); + return 1; } -int slang_info_log_print (slang_info_log *log, const char *msg, ...) +int +slang_info_log_print(slang_info_log * log, const char *msg, ...) { va_list va; char buf[1024]; - va_start (va, msg); - _mesa_vsprintf (buf, msg, va); - va_end (va); - return slang_info_log_message (log, NULL, buf); + va_start(va, msg); + _mesa_vsprintf(buf, msg, va); + va_end(va); + return slang_info_log_message(log, NULL, buf); } -int slang_info_log_error (slang_info_log *log, const char *msg, ...) +int +slang_info_log_error(slang_info_log * log, const char *msg, ...) { - va_list va; - char buf[1024]; - - va_start (va, msg); - _mesa_vsprintf (buf, msg, va); - va_end (va); - if (slang_info_log_message (log, "Error", buf)) - return 1; - slang_info_log_memory (log); - return 0; + va_list va; + char buf[1024]; + + va_start(va, msg); + _mesa_vsprintf(buf, msg, va); + va_end(va); + if (slang_info_log_message(log, "Error", buf)) + return 1; + slang_info_log_memory(log); + return 0; } -int slang_info_log_warning (slang_info_log *log, const char *msg, ...) +int +slang_info_log_warning(slang_info_log * log, const char *msg, ...) { - va_list va; - char buf[1024]; - - va_start (va, msg); - _mesa_vsprintf (buf, msg, va); - va_end (va); - if (slang_info_log_message (log, "Warning", buf)) - return 1; - slang_info_log_memory (log); - return 0; + va_list va; + char buf[1024]; + + va_start(va, msg); + _mesa_vsprintf(buf, msg, va); + va_end(va); + if (slang_info_log_message(log, "Warning", buf)) + return 1; + slang_info_log_memory(log); + return 0; } -void slang_info_log_memory (slang_info_log *log) +void +slang_info_log_memory(slang_info_log * log) { - if (!slang_info_log_message (log, "Error", "Out of memory.")) - { - log->dont_free_text = 1; - log->text = out_of_memory; - } + if (!slang_info_log_message(log, "Error", "Out of memory.")) { + log->dont_free_text = 1; + log->text = out_of_memory; + } } /* slang_parse_ctx */ typedef struct slang_parse_ctx_ { - const byte *I; - slang_info_log *L; - int parsing_builtin; - int global_scope; - slang_atom_pool *atoms; + const byte *I; + slang_info_log *L; + int parsing_builtin; + GLboolean global_scope; /**< Is object being declared a global? */ + slang_atom_pool *atoms; } slang_parse_ctx; /* slang_output_ctx */ typedef struct slang_output_ctx_ { - slang_variable_scope *vars; - slang_function_scope *funs; - slang_struct_scope *structs; - slang_assembly_file *assembly; - slang_var_pool *global_pool; - slang_machine *machine; + slang_variable_scope *vars; + slang_function_scope *funs; + slang_struct_scope *structs; + slang_assembly_file *assembly; + slang_var_pool *global_pool; + slang_machine *machine; } slang_output_ctx; /* _slang_compile() */ -static void parse_identifier_str (slang_parse_ctx *C, char **id) +static void +parse_identifier_str(slang_parse_ctx * C, char **id) { - *id = (char *) C->I; - C->I += _mesa_strlen (*id) + 1; + *id = (char *) C->I; + C->I += _mesa_strlen(*id) + 1; } -static slang_atom parse_identifier (slang_parse_ctx *C) +static slang_atom +parse_identifier(slang_parse_ctx * C) { - const char *id; - - id = (const char *) C->I; - C->I += _mesa_strlen (id) + 1; - return slang_atom_pool_atom (C->atoms, id); + const char *id; + + id = (const char *) C->I; + C->I += _mesa_strlen(id) + 1; + return slang_atom_pool_atom(C->atoms, id); } -static int parse_number (slang_parse_ctx *C, int *number) +static int +parse_number(slang_parse_ctx * C, int *number) { - const int radix = (int) (*C->I++); - *number = 0; - while (*C->I != '\0') - { - int digit; - if (*C->I >= '0' && *C->I <= '9') - digit = (int) (*C->I - '0'); - else if (*C->I >= 'A' && *C->I <= 'Z') - digit = (int) (*C->I - 'A') + 10; - else - digit = (int) (*C->I - 'a') + 10; - *number = *number * radix + digit; - C->I++; - } - C->I++; - if (*number > 65535) - slang_info_log_warning (C->L, "%d: literal integer overflow.", *number); - return 1; + const int radix = (int) (*C->I++); + *number = 0; + while (*C->I != '\0') { + int digit; + if (*C->I >= '0' && *C->I <= '9') + digit = (int) (*C->I - '0'); + else if (*C->I >= 'A' && *C->I <= 'Z') + digit = (int) (*C->I - 'A') + 10; + else + digit = (int) (*C->I - 'a') + 10; + *number = *number * radix + digit; + C->I++; + } + C->I++; + if (*number > 65535) + slang_info_log_warning(C->L, "%d: literal integer overflow.", *number); + return 1; } -static int parse_float (slang_parse_ctx *C, float *number) +static int +parse_float(slang_parse_ctx * C, float *number) { - char *integral = NULL; - char *fractional = NULL; - char *exponent = NULL; - char *whole = NULL; - - parse_identifier_str (C, &integral); - parse_identifier_str (C, &fractional); - parse_identifier_str (C, &exponent); - - whole = (char *) (slang_alloc_malloc ((_mesa_strlen (integral) + _mesa_strlen (fractional) + - _mesa_strlen (exponent) + 3) * sizeof (char))); - if (whole == NULL) - { - slang_info_log_memory (C->L); - return 0; - } - - slang_string_copy (whole, integral); - slang_string_concat (whole, "."); - slang_string_concat (whole, fractional); - slang_string_concat (whole, "E"); - slang_string_concat (whole, exponent); - - *number = (float) (_mesa_strtod(whole, (char **)NULL)); - - slang_alloc_free (whole); - return 1; + char *integral = NULL; + char *fractional = NULL; + char *exponent = NULL; + char *whole = NULL; + + parse_identifier_str(C, &integral); + parse_identifier_str(C, &fractional); + parse_identifier_str(C, &exponent); + + whole = (char *) (slang_alloc_malloc((_mesa_strlen(integral) + + _mesa_strlen(fractional) + + _mesa_strlen(exponent) + 3) * sizeof(char))); + if (whole == NULL) { + slang_info_log_memory(C->L); + return 0; + } + + slang_string_copy(whole, integral); + slang_string_concat(whole, "."); + slang_string_concat(whole, fractional); + slang_string_concat(whole, "E"); + slang_string_concat(whole, exponent); + + *number = (float) (_mesa_strtod(whole, (char **) NULL)); + + slang_alloc_free(whole); + return 1; } /* revision number - increment after each change affecting emitted output */ #define REVISION 3 -static int check_revision (slang_parse_ctx *C) +static int +check_revision(slang_parse_ctx * C) { - if (*C->I != REVISION) - { - slang_info_log_error (C->L, "Internal compiler error."); - return 0; - } - C->I++; - return 1; + if (*C->I != REVISION) { + slang_info_log_error(C->L, "Internal compiler error."); + return 0; + } + C->I++; + return 1; } -static int parse_statement (slang_parse_ctx *, slang_output_ctx *, slang_operation *); -static int parse_expression (slang_parse_ctx *, slang_output_ctx *, slang_operation *); -static int parse_type_specifier (slang_parse_ctx *, slang_output_ctx *, slang_type_specifier *); +static int parse_statement(slang_parse_ctx *, slang_output_ctx *, + slang_operation *); +static int parse_expression(slang_parse_ctx *, slang_output_ctx *, + slang_operation *); +static int parse_type_specifier(slang_parse_ctx *, slang_output_ctx *, + slang_type_specifier *); -static GLboolean parse_array_len (slang_parse_ctx *C, slang_output_ctx *O, GLuint *len) +static GLboolean +parse_array_len(slang_parse_ctx * C, slang_output_ctx * O, GLuint * len) { - slang_operation array_size; - slang_assembly_name_space space; - GLboolean result; - - if (!slang_operation_construct (&array_size)) - return GL_FALSE; - if (!parse_expression (C, O, &array_size)) - { - slang_operation_destruct (&array_size); - return GL_FALSE; - } - - space.funcs = O->funs; - space.structs = O->structs; - space.vars = O->vars; - result = _slang_evaluate_int (O->assembly, O->machine, &space, &array_size, len, C->atoms); - slang_operation_destruct (&array_size); - return result; + slang_operation array_size; + slang_assembly_name_space space; + GLboolean result; + + if (!slang_operation_construct(&array_size)) + return GL_FALSE; + if (!parse_expression(C, O, &array_size)) { + slang_operation_destruct(&array_size); + return GL_FALSE; + } + + space.funcs = O->funs; + space.structs = O->structs; + space.vars = O->vars; + result = _slang_evaluate_int(O->assembly, O->machine, &space, + &array_size, len, C->atoms); + slang_operation_destruct(&array_size); + return result; } -static GLboolean calculate_var_size (slang_parse_ctx *C, slang_output_ctx *O, slang_variable *var) +static GLboolean +calculate_var_size(slang_parse_ctx * C, slang_output_ctx * O, + slang_variable * var) { - slang_storage_aggregate agg; - - if (!slang_storage_aggregate_construct (&agg)) - return GL_FALSE; - if (!_slang_aggregate_variable (&agg, &var->type.specifier, var->array_len, O->funs, O->structs, - O->vars, O->machine, O->assembly, C->atoms)) - { - slang_storage_aggregate_destruct (&agg); - return GL_FALSE; - } - var->size = _slang_sizeof_aggregate (&agg); - slang_storage_aggregate_destruct (&agg); - return GL_TRUE; + slang_storage_aggregate agg; + + if (!slang_storage_aggregate_construct(&agg)) + return GL_FALSE; + if (!_slang_aggregate_variable(&agg, &var->type.specifier, var->array_len, + O->funs, O->structs, O->vars, O->machine, + O->assembly, C->atoms)) { + slang_storage_aggregate_destruct(&agg); + return GL_FALSE; + } + var->size = _slang_sizeof_aggregate(&agg); + slang_storage_aggregate_destruct(&agg); + return GL_TRUE; } -static GLboolean convert_to_array (slang_parse_ctx *C, slang_variable *var, - const slang_type_specifier *sp) +static GLboolean +convert_to_array(slang_parse_ctx * C, slang_variable * var, + const slang_type_specifier * sp) { - /* sized array - mark it as array, copy the specifier to the array element and - * parse the expression */ - var->type.specifier.type = slang_spec_array; - var->type.specifier._array = (slang_type_specifier *) slang_alloc_malloc (sizeof ( - slang_type_specifier)); - if (var->type.specifier._array == NULL) - { - slang_info_log_memory (C->L); - return GL_FALSE; - } - slang_type_specifier_ctr (var->type.specifier._array); - return slang_type_specifier_copy (var->type.specifier._array, sp); + /* sized array - mark it as array, copy the specifier to the array element and + * parse the expression */ + var->type.specifier.type = slang_spec_array; + var->type.specifier._array = (slang_type_specifier *) + slang_alloc_malloc(sizeof(slang_type_specifier)); + if (var->type.specifier._array == NULL) { + slang_info_log_memory(C->L); + return GL_FALSE; + } + slang_type_specifier_ctr(var->type.specifier._array); + return slang_type_specifier_copy(var->type.specifier._array, sp); } /* structure field */ @@ -375,136 +395,139 @@ static GLboolean convert_to_array (slang_parse_ctx *C, slang_variable *var, #define FIELD_NEXT 1 #define FIELD_ARRAY 2 -static GLboolean parse_struct_field_var (slang_parse_ctx *C, slang_output_ctx *O, slang_variable *var, - const slang_type_specifier *sp) +static GLboolean +parse_struct_field_var(slang_parse_ctx * C, slang_output_ctx * O, + slang_variable * var, const slang_type_specifier * sp) { - var->a_name = parse_identifier (C); - if (var->a_name == SLANG_ATOM_NULL) - return GL_FALSE; - - switch (*C->I++) - { - case FIELD_NONE: - if (!slang_type_specifier_copy (&var->type.specifier, sp)) - return GL_FALSE; - break; - case FIELD_ARRAY: - if (!convert_to_array (C, var, sp)) - return GL_FALSE; - if (!parse_array_len (C, O, &var->array_len)) - return GL_FALSE; - break; - default: - return GL_FALSE; - } - - return calculate_var_size (C, O, var); + var->a_name = parse_identifier(C); + if (var->a_name == SLANG_ATOM_NULL) + return GL_FALSE; + + switch (*C->I++) { + case FIELD_NONE: + if (!slang_type_specifier_copy(&var->type.specifier, sp)) + return GL_FALSE; + break; + case FIELD_ARRAY: + if (!convert_to_array(C, var, sp)) + return GL_FALSE; + if (!parse_array_len(C, O, &var->array_len)) + return GL_FALSE; + break; + default: + return GL_FALSE; + } + + return calculate_var_size(C, O, var); } -static int parse_struct_field (slang_parse_ctx *C, slang_output_ctx *O, slang_struct *st, - slang_type_specifier *sp) +static int +parse_struct_field(slang_parse_ctx * C, slang_output_ctx * O, + slang_struct * st, slang_type_specifier * sp) { - slang_output_ctx o = *O; - - o.structs = st->structs; - if (!parse_type_specifier (C, &o, sp)) - return 0; - do - { - slang_variable *var; - - st->fields->variables = (slang_variable *) slang_alloc_realloc (st->fields->variables, - st->fields->num_variables * sizeof (slang_variable), - (st->fields->num_variables + 1) * sizeof (slang_variable)); - if (st->fields->variables == NULL) - { - slang_info_log_memory (C->L); - return 0; - } - var = &st->fields->variables[st->fields->num_variables]; - if (!slang_variable_construct (var)) - return 0; - st->fields->num_variables++; - if (!parse_struct_field_var (C, &o, var, sp)) - return 0; - } - while (*C->I++ != FIELD_NONE); - - return 1; + slang_output_ctx o = *O; + + o.structs = st->structs; + if (!parse_type_specifier(C, &o, sp)) + return 0; + + do { + slang_variable *var; + + st->fields->variables = + (slang_variable *) slang_alloc_realloc(st->fields->variables, + st->fields->num_variables * + sizeof(slang_variable), + (st->fields->num_variables + + 1) * sizeof(slang_variable)); + if (st->fields->variables == NULL) { + slang_info_log_memory(C->L); + return 0; + } + var = &st->fields->variables[st->fields->num_variables]; + if (!slang_variable_construct(var)) + return 0; + st->fields->num_variables++; + if (!parse_struct_field_var(C, &o, var, sp)) + return 0; + } + while (*C->I++ != FIELD_NONE); + + return 1; } -static int parse_struct (slang_parse_ctx *C, slang_output_ctx *O, slang_struct **st) +static int +parse_struct(slang_parse_ctx * C, slang_output_ctx * O, slang_struct ** st) { - slang_atom a_name; - const char *name; - - /* parse struct name (if any) and make sure it is unique in current scope */ - a_name = parse_identifier (C); - if (a_name == SLANG_ATOM_NULL) - return 0; - name = slang_atom_pool_id (C->atoms, a_name); - if (name[0] != '\0' && slang_struct_scope_find (O->structs, a_name, 0) != NULL) - { - slang_info_log_error (C->L, "%s: duplicate type name.", name); - return 0; - } - - /* set-up a new struct */ - *st = (slang_struct *) slang_alloc_malloc (sizeof (slang_struct)); - if (*st == NULL) - { - slang_info_log_memory (C->L); - return 0; - } - if (!slang_struct_construct (*st)) - { - slang_alloc_free (*st); - *st = NULL; - slang_info_log_memory (C->L); - return 0; - } - (**st).a_name = a_name; - (**st).structs->outer_scope = O->structs; - - /* parse individual struct fields */ - do - { - slang_type_specifier sp; - - slang_type_specifier_ctr (&sp); - if (!parse_struct_field (C, O, *st, &sp)) - { - slang_type_specifier_dtr (&sp); - return 0; - } - slang_type_specifier_dtr (&sp); - } - while (*C->I++ != FIELD_NONE); - - /* if named struct, copy it to current scope */ - if (name[0] != '\0') - { - slang_struct *s; - - O->structs->structs = (slang_struct *) slang_alloc_realloc (O->structs->structs, - O->structs->num_structs * sizeof (slang_struct), - (O->structs->num_structs + 1) * sizeof (slang_struct)); - if (O->structs->structs == NULL) - { - slang_info_log_memory (C->L); - return 0; - } - s = &O->structs->structs[O->structs->num_structs]; - if (!slang_struct_construct (s)) - return 0; - O->structs->num_structs++; - if (!slang_struct_copy (s, *st)) - return 0; - } - - return 1; + slang_atom a_name; + const char *name; + + /* parse struct name (if any) and make sure it is unique in current scope */ + a_name = parse_identifier(C); + if (a_name == SLANG_ATOM_NULL) + return 0; + + name = slang_atom_pool_id(C->atoms, a_name); + if (name[0] != '\0' + && slang_struct_scope_find(O->structs, a_name, 0) != NULL) { + slang_info_log_error(C->L, "%s: duplicate type name.", name); + return 0; + } + + /* set-up a new struct */ + *st = (slang_struct *) slang_alloc_malloc(sizeof(slang_struct)); + if (*st == NULL) { + slang_info_log_memory(C->L); + return 0; + } + if (!slang_struct_construct(*st)) { + slang_alloc_free(*st); + *st = NULL; + slang_info_log_memory(C->L); + return 0; + } + (**st).a_name = a_name; + (**st).structs->outer_scope = O->structs; + + /* parse individual struct fields */ + do { + slang_type_specifier sp; + + slang_type_specifier_ctr(&sp); + if (!parse_struct_field(C, O, *st, &sp)) { + slang_type_specifier_dtr(&sp); + return 0; + } + slang_type_specifier_dtr(&sp); + } + while (*C->I++ != FIELD_NONE); + + /* if named struct, copy it to current scope */ + if (name[0] != '\0') { + slang_struct *s; + + O->structs->structs = + (slang_struct *) slang_alloc_realloc(O->structs->structs, + O->structs->num_structs * + sizeof(slang_struct), + (O->structs->num_structs + + 1) * sizeof(slang_struct)); + if (O->structs->structs == NULL) { + slang_info_log_memory(C->L); + return 0; + } + s = &O->structs->structs[O->structs->num_structs]; + if (!slang_struct_construct(s)) + return 0; + O->structs->num_structs++; + if (!slang_struct_copy(s, *st)) + return 0; + } + + return 1; } + /* type qualifier */ #define TYPE_QUALIFIER_NONE 0 #define TYPE_QUALIFIER_CONST 1 @@ -514,35 +537,35 @@ static int parse_struct (slang_parse_ctx *C, slang_output_ctx *O, slang_struct * #define TYPE_QUALIFIER_FIXEDOUTPUT 5 #define TYPE_QUALIFIER_FIXEDINPUT 6 -static int parse_type_qualifier (slang_parse_ctx *C, slang_type_qualifier *qual) +static int +parse_type_qualifier(slang_parse_ctx * C, slang_type_qualifier * qual) { - switch (*C->I++) - { - case TYPE_QUALIFIER_NONE: - *qual = slang_qual_none; - break; - case TYPE_QUALIFIER_CONST: - *qual = slang_qual_const; - break; - case TYPE_QUALIFIER_ATTRIBUTE: - *qual = slang_qual_attribute; - break; - case TYPE_QUALIFIER_VARYING: - *qual = slang_qual_varying; - break; - case TYPE_QUALIFIER_UNIFORM: - *qual = slang_qual_uniform; - break; - case TYPE_QUALIFIER_FIXEDOUTPUT: - *qual = slang_qual_fixedoutput; - break; - case TYPE_QUALIFIER_FIXEDINPUT: - *qual = slang_qual_fixedinput; - break; - default: - return 0; - } - return 1; + switch (*C->I++) { + case TYPE_QUALIFIER_NONE: + *qual = slang_qual_none; + break; + case TYPE_QUALIFIER_CONST: + *qual = slang_qual_const; + break; + case TYPE_QUALIFIER_ATTRIBUTE: + *qual = slang_qual_attribute; + break; + case TYPE_QUALIFIER_VARYING: + *qual = slang_qual_varying; + break; + case TYPE_QUALIFIER_UNIFORM: + *qual = slang_qual_uniform; + break; + case TYPE_QUALIFIER_FIXEDOUTPUT: + *qual = slang_qual_fixedoutput; + break; + case TYPE_QUALIFIER_FIXEDINPUT: + *qual = slang_qual_fixedinput; + break; + default: + return 0; + } + return 1; } /* type specifier */ @@ -571,127 +594,127 @@ static int parse_type_qualifier (slang_parse_ctx *C, slang_type_qualifier *qual) #define TYPE_SPECIFIER_STRUCT 22 #define TYPE_SPECIFIER_TYPENAME 23 -static int parse_type_specifier (slang_parse_ctx *C, slang_output_ctx *O, slang_type_specifier *spec) +static int +parse_type_specifier(slang_parse_ctx * C, slang_output_ctx * O, + slang_type_specifier * spec) { - switch (*C->I++) - { - case TYPE_SPECIFIER_VOID: - spec->type = slang_spec_void; - break; - case TYPE_SPECIFIER_BOOL: - spec->type = slang_spec_bool; - break; - case TYPE_SPECIFIER_BVEC2: - spec->type = slang_spec_bvec2; - break; - case TYPE_SPECIFIER_BVEC3: - spec->type = slang_spec_bvec3; - break; - case TYPE_SPECIFIER_BVEC4: - spec->type = slang_spec_bvec4; - break; - case TYPE_SPECIFIER_INT: - spec->type = slang_spec_int; - break; - case TYPE_SPECIFIER_IVEC2: - spec->type = slang_spec_ivec2; - break; - case TYPE_SPECIFIER_IVEC3: - spec->type = slang_spec_ivec3; - break; - case TYPE_SPECIFIER_IVEC4: - spec->type = slang_spec_ivec4; - break; - case TYPE_SPECIFIER_FLOAT: - spec->type = slang_spec_float; - break; - case TYPE_SPECIFIER_VEC2: - spec->type = slang_spec_vec2; - break; - case TYPE_SPECIFIER_VEC3: - spec->type = slang_spec_vec3; - break; - case TYPE_SPECIFIER_VEC4: - spec->type = slang_spec_vec4; - break; - case TYPE_SPECIFIER_MAT2: - spec->type = slang_spec_mat2; - break; - case TYPE_SPECIFIER_MAT3: - spec->type = slang_spec_mat3; - break; - case TYPE_SPECIFIER_MAT4: - spec->type = slang_spec_mat4; - break; - case TYPE_SPECIFIER_SAMPLER1D: - spec->type = slang_spec_sampler1D; - break; - case TYPE_SPECIFIER_SAMPLER2D: - spec->type = slang_spec_sampler2D; - break; - case TYPE_SPECIFIER_SAMPLER3D: - spec->type = slang_spec_sampler3D; - break; - case TYPE_SPECIFIER_SAMPLERCUBE: - spec->type = slang_spec_samplerCube; - break; - case TYPE_SPECIFIER_SAMPLER1DSHADOW: - spec->type = slang_spec_sampler1DShadow; - break; - case TYPE_SPECIFIER_SAMPLER2DSHADOW: - spec->type = slang_spec_sampler2DShadow; - break; - case TYPE_SPECIFIER_STRUCT: - spec->type = slang_spec_struct; - if (!parse_struct (C, O, &spec->_struct)) - return 0; - break; - case TYPE_SPECIFIER_TYPENAME: - spec->type = slang_spec_struct; - { - slang_atom a_name; - slang_struct *stru; - - a_name = parse_identifier (C); - if (a_name == NULL) - return 0; - - stru = slang_struct_scope_find (O->structs, a_name, 1); - if (stru == NULL) - { - slang_info_log_error (C->L, "%s: undeclared type name.", - slang_atom_pool_id (C->atoms, a_name)); - return 0; - } - - spec->_struct = (slang_struct *) slang_alloc_malloc (sizeof (slang_struct)); - if (spec->_struct == NULL) - { - slang_info_log_memory (C->L); - return 0; - } - if (!slang_struct_construct (spec->_struct)) - { - slang_alloc_free (spec->_struct); - spec->_struct = NULL; - return 0; - } - if (!slang_struct_copy (spec->_struct, stru)) - return 0; - } - break; - default: - return 0; - } - return 1; + switch (*C->I++) { + case TYPE_SPECIFIER_VOID: + spec->type = slang_spec_void; + break; + case TYPE_SPECIFIER_BOOL: + spec->type = slang_spec_bool; + break; + case TYPE_SPECIFIER_BVEC2: + spec->type = slang_spec_bvec2; + break; + case TYPE_SPECIFIER_BVEC3: + spec->type = slang_spec_bvec3; + break; + case TYPE_SPECIFIER_BVEC4: + spec->type = slang_spec_bvec4; + break; + case TYPE_SPECIFIER_INT: + spec->type = slang_spec_int; + break; + case TYPE_SPECIFIER_IVEC2: + spec->type = slang_spec_ivec2; + break; + case TYPE_SPECIFIER_IVEC3: + spec->type = slang_spec_ivec3; + break; + case TYPE_SPECIFIER_IVEC4: + spec->type = slang_spec_ivec4; + break; + case TYPE_SPECIFIER_FLOAT: + spec->type = slang_spec_float; + break; + case TYPE_SPECIFIER_VEC2: + spec->type = slang_spec_vec2; + break; + case TYPE_SPECIFIER_VEC3: + spec->type = slang_spec_vec3; + break; + case TYPE_SPECIFIER_VEC4: + spec->type = slang_spec_vec4; + break; + case TYPE_SPECIFIER_MAT2: + spec->type = slang_spec_mat2; + break; + case TYPE_SPECIFIER_MAT3: + spec->type = slang_spec_mat3; + break; + case TYPE_SPECIFIER_MAT4: + spec->type = slang_spec_mat4; + break; + case TYPE_SPECIFIER_SAMPLER1D: + spec->type = slang_spec_sampler1D; + break; + case TYPE_SPECIFIER_SAMPLER2D: + spec->type = slang_spec_sampler2D; + break; + case TYPE_SPECIFIER_SAMPLER3D: + spec->type = slang_spec_sampler3D; + break; + case TYPE_SPECIFIER_SAMPLERCUBE: + spec->type = slang_spec_samplerCube; + break; + case TYPE_SPECIFIER_SAMPLER1DSHADOW: + spec->type = slang_spec_sampler1DShadow; + break; + case TYPE_SPECIFIER_SAMPLER2DSHADOW: + spec->type = slang_spec_sampler2DShadow; + break; + case TYPE_SPECIFIER_STRUCT: + spec->type = slang_spec_struct; + if (!parse_struct(C, O, &spec->_struct)) + return 0; + break; + case TYPE_SPECIFIER_TYPENAME: + spec->type = slang_spec_struct; + { + slang_atom a_name; + slang_struct *stru; + + a_name = parse_identifier(C); + if (a_name == NULL) + return 0; + + stru = slang_struct_scope_find(O->structs, a_name, 1); + if (stru == NULL) { + slang_info_log_error(C->L, "%s: undeclared type name.", + slang_atom_pool_id(C->atoms, a_name)); + return 0; + } + + spec->_struct = + (slang_struct *) slang_alloc_malloc(sizeof(slang_struct)); + if (spec->_struct == NULL) { + slang_info_log_memory(C->L); + return 0; + } + if (!slang_struct_construct(spec->_struct)) { + slang_alloc_free(spec->_struct); + spec->_struct = NULL; + return 0; + } + if (!slang_struct_copy(spec->_struct, stru)) + return 0; + } + break; + default: + return 0; + } + return 1; } -static int parse_fully_specified_type (slang_parse_ctx *C, slang_output_ctx *O, - slang_fully_specified_type *type) +static int +parse_fully_specified_type(slang_parse_ctx * C, slang_output_ctx * O, + slang_fully_specified_type * type) { - if (!parse_type_qualifier (C, &type->qualifier)) - return 0; - return parse_type_specifier (C, O, &type->specifier); + if (!parse_type_qualifier(C, &type->qualifier)) + return 0; + return parse_type_specifier(C, O, &type->specifier); } /* operation */ @@ -758,459 +781,486 @@ static int parse_fully_specified_type (slang_parse_ctx *C, slang_output_ctx *O, #define OP_POSTINCREMENT 60 #define OP_POSTDECREMENT 61 -static int parse_child_operation (slang_parse_ctx *C, slang_output_ctx *O, slang_operation *oper, - int statement) + +/** + * When parsing a compound production, this function is used to parse the + * children. + * For example, a a while-loop compound will have two children, the + * while condition expression and the loop body. So, this function will + * be called twice to parse those two sub-expressions. + * \param C the parsing context + * \param O the output context + * \param oper the operation we're parsing + * \param statment which child of the operation is being parsed + * \return 1 if success, 0 if error + */ +static int +parse_child_operation(slang_parse_ctx * C, slang_output_ctx * O, + slang_operation * oper, unsigned int statement) { - slang_operation *ch; - - oper->children = (slang_operation *) slang_alloc_realloc (oper->children, - oper->num_children * sizeof (slang_operation), - (oper->num_children + 1) * sizeof (slang_operation)); - if (oper->children == NULL) - { - slang_info_log_memory (C->L); - return 0; - } - ch = &oper->children[oper->num_children]; - if (!slang_operation_construct (ch)) - { - slang_info_log_memory (C->L); - return 0; - } - oper->num_children++; - if (statement) - return parse_statement (C, O, ch); - return parse_expression (C, O, ch); + slang_operation *ch; + + /* grow child array */ + oper->children = (slang_operation *) + slang_alloc_realloc(oper->children, + oper->num_children * sizeof(slang_operation), + (oper->num_children + 1) * sizeof(slang_operation)); + if (oper->children == NULL) { + slang_info_log_memory(C->L); + return 0; + } + + ch = &oper->children[oper->num_children]; + if (!slang_operation_construct(ch)) { + slang_info_log_memory(C->L); + return 0; + } + oper->num_children++; + /* XXX I guess the 0th "statement" is not really a statement? */ + if (statement) + return parse_statement(C, O, ch); + return parse_expression(C, O, ch); } -static int parse_declaration (slang_parse_ctx *C, slang_output_ctx *O); +static int parse_declaration(slang_parse_ctx * C, slang_output_ctx * O); -static int parse_statement (slang_parse_ctx *C, slang_output_ctx *O, slang_operation *oper) +static int +parse_statement(slang_parse_ctx * C, slang_output_ctx * O, + slang_operation * oper) { - oper->locals->outer_scope = O->vars; - switch (*C->I++) - { - case OP_BLOCK_BEGIN_NO_NEW_SCOPE: - /* parse child statements, do not create new variable scope */ - oper->type = slang_oper_block_no_new_scope; - while (*C->I != OP_END) - if (!parse_child_operation (C, O, oper, 1)) - return 0; - C->I++; - break; - case OP_BLOCK_BEGIN_NEW_SCOPE: - /* parse child statements, create new variable scope */ - { - slang_output_ctx o = *O; - - oper->type = slang_oper_block_new_scope; - o.vars = oper->locals; - while (*C->I != OP_END) - if (!parse_child_operation (C, &o, oper, 1)) - return 0; - C->I++; - } - break; - case OP_DECLARE: - /* local variable declaration, individual declarators are stored as children identifiers */ - oper->type = slang_oper_variable_decl; - { - const unsigned int first_var = O->vars->num_variables; - - /* parse the declaration, note that there can be zero or more than one declarators */ - if (!parse_declaration (C, O)) - return 0; - if (first_var < O->vars->num_variables) - { - const unsigned int num_vars = O->vars->num_variables - first_var; - unsigned int i; - - oper->children = (slang_operation *) slang_alloc_malloc (num_vars * sizeof ( - slang_operation)); - if (oper->children == NULL) - { - slang_info_log_memory (C->L); - return 0; - } - for (oper->num_children = 0; oper->num_children < num_vars; oper->num_children++) - if (!slang_operation_construct (&oper->children[oper->num_children])) - { - slang_info_log_memory (C->L); - return 0; - } - for (i = first_var; i < O->vars->num_variables; i++) - { - slang_operation *o = &oper->children[i - first_var]; - - o->type = slang_oper_identifier; - o->locals->outer_scope = O->vars; - o->a_id = O->vars->variables[i].a_name; - } - } - } - break; - case OP_ASM: - /* the __asm statement, parse the mnemonic and all its arguments as expressions */ - oper->type = slang_oper_asm; - oper->a_id = parse_identifier (C); - if (oper->a_id == SLANG_ATOM_NULL) - return 0; - while (*C->I != OP_END) - if (!parse_child_operation (C, O, oper, 0)) - return 0; - C->I++; - break; - case OP_BREAK: - oper->type = slang_oper_break; - break; - case OP_CONTINUE: - oper->type = slang_oper_continue; - break; - case OP_DISCARD: - oper->type = slang_oper_discard; - break; - case OP_RETURN: - oper->type = slang_oper_return; - if (!parse_child_operation (C, O, oper, 0)) - return 0; - break; - case OP_EXPRESSION: - oper->type = slang_oper_expression; - if (!parse_child_operation (C, O, oper, 0)) - return 0; - break; - case OP_IF: - oper->type = slang_oper_if; - if (!parse_child_operation (C, O, oper, 0)) - return 0; - if (!parse_child_operation (C, O, oper, 1)) - return 0; - if (!parse_child_operation (C, O, oper, 1)) - return 0; - break; - case OP_WHILE: - { - slang_output_ctx o = *O; - - oper->type = slang_oper_while; - o.vars = oper->locals; - if (!parse_child_operation (C, &o, oper, 1)) - return 0; - if (!parse_child_operation (C, &o, oper, 1)) - return 0; - } - break; - case OP_DO: - oper->type = slang_oper_do; - if (!parse_child_operation (C, O, oper, 1)) - return 0; - if (!parse_child_operation (C, O, oper, 0)) - return 0; - break; - case OP_FOR: - { - slang_output_ctx o = *O; - - oper->type = slang_oper_for; - o.vars = oper->locals; - if (!parse_child_operation (C, &o, oper, 1)) - return 0; - if (!parse_child_operation (C, &o, oper, 1)) - return 0; - if (!parse_child_operation (C, &o, oper, 0)) - return 0; - if (!parse_child_operation (C, &o, oper, 1)) - return 0; - } - break; - default: - return 0; - } - return 1; + oper->locals->outer_scope = O->vars; + switch (*C->I++) { + case OP_BLOCK_BEGIN_NO_NEW_SCOPE: + /* parse child statements, do not create new variable scope */ + oper->type = slang_oper_block_no_new_scope; + while (*C->I != OP_END) + if (!parse_child_operation(C, O, oper, 1)) + return 0; + C->I++; + break; + case OP_BLOCK_BEGIN_NEW_SCOPE: + /* parse child statements, create new variable scope */ + { + slang_output_ctx o = *O; + + oper->type = slang_oper_block_new_scope; + o.vars = oper->locals; + while (*C->I != OP_END) + if (!parse_child_operation(C, &o, oper, 1)) + return 0; + C->I++; + } + break; + case OP_DECLARE: + /* local variable declaration, individual declarators are stored as + * children identifiers + */ + oper->type = slang_oper_variable_decl; + { + const unsigned int first_var = O->vars->num_variables; + + /* parse the declaration, note that there can be zero or more + * than one declarators + */ + if (!parse_declaration(C, O)) + return 0; + if (first_var < O->vars->num_variables) { + const unsigned int num_vars = O->vars->num_variables - first_var; + unsigned int i; + + oper->children = (slang_operation *) + slang_alloc_malloc(num_vars * sizeof(slang_operation)); + if (oper->children == NULL) { + slang_info_log_memory(C->L); + return 0; + } + for (oper->num_children = 0; oper->num_children < num_vars; + oper->num_children++) { + if (!slang_operation_construct + (&oper->children[oper->num_children])) { + slang_info_log_memory(C->L); + return 0; + } + } + for (i = first_var; i < O->vars->num_variables; i++) { + slang_operation *o = &oper->children[i - first_var]; + o->type = slang_oper_identifier; + o->locals->outer_scope = O->vars; + o->a_id = O->vars->variables[i].a_name; + } + } + } + break; + case OP_ASM: + /* the __asm statement, parse the mnemonic and all its arguments + * as expressions + */ + oper->type = slang_oper_asm; + oper->a_id = parse_identifier(C); + if (oper->a_id == SLANG_ATOM_NULL) + return 0; + while (*C->I != OP_END) { + if (!parse_child_operation(C, O, oper, 0)) + return 0; + } + C->I++; + break; + case OP_BREAK: + oper->type = slang_oper_break; + break; + case OP_CONTINUE: + oper->type = slang_oper_continue; + break; + case OP_DISCARD: + oper->type = slang_oper_discard; + break; + case OP_RETURN: + oper->type = slang_oper_return; + if (!parse_child_operation(C, O, oper, 0)) + return 0; + break; + case OP_EXPRESSION: + oper->type = slang_oper_expression; + if (!parse_child_operation(C, O, oper, 0)) + return 0; + break; + case OP_IF: + oper->type = slang_oper_if; + if (!parse_child_operation(C, O, oper, 0)) + return 0; + if (!parse_child_operation(C, O, oper, 1)) + return 0; + if (!parse_child_operation(C, O, oper, 1)) + return 0; + break; + case OP_WHILE: + { + slang_output_ctx o = *O; + + oper->type = slang_oper_while; + o.vars = oper->locals; + if (!parse_child_operation(C, &o, oper, 1)) + return 0; + if (!parse_child_operation(C, &o, oper, 1)) + return 0; + } + break; + case OP_DO: + oper->type = slang_oper_do; + if (!parse_child_operation(C, O, oper, 1)) + return 0; + if (!parse_child_operation(C, O, oper, 0)) + return 0; + break; + case OP_FOR: + { + slang_output_ctx o = *O; + + oper->type = slang_oper_for; + o.vars = oper->locals; + if (!parse_child_operation(C, &o, oper, 1)) + return 0; + if (!parse_child_operation(C, &o, oper, 1)) + return 0; + if (!parse_child_operation(C, &o, oper, 0)) + return 0; + if (!parse_child_operation(C, &o, oper, 1)) + return 0; + } + break; + default: + return 0; + } + return 1; } -static int handle_nary_expression (slang_parse_ctx *C, slang_operation *op, slang_operation **ops, - unsigned int *total_ops, unsigned int n) +static int +handle_nary_expression(slang_parse_ctx * C, slang_operation * op, + slang_operation ** ops, unsigned int *total_ops, + unsigned int n) { - unsigned int i; - - op->children = (slang_operation *) slang_alloc_malloc (n * sizeof (slang_operation)); - if (op->children == NULL) - { - slang_info_log_memory (C->L); - return 0; - } - op->num_children = n; - - for (i = 0; i < n; i++) - op->children[i] = (*ops)[*total_ops - (n + 1 - i)]; - (*ops)[*total_ops - (n + 1)] = (*ops)[*total_ops - 1]; - *total_ops -= n; - - *ops = (slang_operation *) slang_alloc_realloc (*ops, (*total_ops + n) * sizeof (slang_operation), - *total_ops * sizeof (slang_operation)); - if (*ops == NULL) - { - slang_info_log_memory (C->L); - return 0; - } - return 1; + unsigned int i; + + op->children = + (slang_operation *) slang_alloc_malloc(n * sizeof(slang_operation)); + if (op->children == NULL) { + slang_info_log_memory(C->L); + return 0; + } + op->num_children = n; + + for (i = 0; i < n; i++) + op->children[i] = (*ops)[*total_ops - (n + 1 - i)]; + (*ops)[*total_ops - (n + 1)] = (*ops)[*total_ops - 1]; + *total_ops -= n; + + *ops = (slang_operation *) + slang_alloc_realloc(*ops, + (*total_ops + n) * sizeof(slang_operation), + *total_ops * sizeof(slang_operation)); + if (*ops == NULL) { + slang_info_log_memory(C->L); + return 0; + } + return 1; } -static int is_constructor_name (const char *name, slang_atom a_name, slang_struct_scope *structs) +static int +is_constructor_name(const char *name, slang_atom a_name, + slang_struct_scope * structs) { - if (slang_type_specifier_type_from_string (name) != slang_spec_void) - return 1; - return slang_struct_scope_find (structs, a_name, 1) != NULL; + if (slang_type_specifier_type_from_string(name) != slang_spec_void) + return 1; + return slang_struct_scope_find(structs, a_name, 1) != NULL; } -static int parse_expression (slang_parse_ctx *C, slang_output_ctx *O, slang_operation *oper) +static int +parse_expression(slang_parse_ctx * C, slang_output_ctx * O, + slang_operation * oper) { - slang_operation *ops = NULL; - unsigned int num_ops = 0; - int number; - - while (*C->I != OP_END) - { - slang_operation *op; - const unsigned int op_code = *C->I++; - - /* allocate default operation, becomes a no-op if not used */ - ops = (slang_operation *) slang_alloc_realloc (ops, - num_ops * sizeof (slang_operation), (num_ops + 1) * sizeof (slang_operation)); - if (ops == NULL) - { - slang_info_log_memory (C->L); - return 0; - } - op = &ops[num_ops]; - if (!slang_operation_construct (op)) - { - slang_info_log_memory (C->L); - return 0; - } - num_ops++; - op->locals->outer_scope = O->vars; - - switch (op_code) - { - case OP_PUSH_VOID: - op->type = slang_oper_void; - break; - case OP_PUSH_BOOL: - op->type = slang_oper_literal_bool; - if (!parse_number (C, &number)) - return 0; - op->literal = (GLfloat) number; - break; - case OP_PUSH_INT: - op->type = slang_oper_literal_int; - if (!parse_number (C, &number)) - return 0; - op->literal = (GLfloat) number; - break; - case OP_PUSH_FLOAT: - op->type = slang_oper_literal_float; - if (!parse_float (C, &op->literal)) - return 0; - break; - case OP_PUSH_IDENTIFIER: - op->type = slang_oper_identifier; - op->a_id = parse_identifier (C); - if (op->a_id == SLANG_ATOM_NULL) - return 0; - break; - case OP_SEQUENCE: - op->type = slang_oper_sequence; - if (!handle_nary_expression (C, op, &ops, &num_ops, 2)) - return 0; - break; - case OP_ASSIGN: - op->type = slang_oper_assign; - if (!handle_nary_expression (C, op, &ops, &num_ops, 2)) - return 0; - break; - case OP_ADDASSIGN: - op->type = slang_oper_addassign; - if (!handle_nary_expression (C, op, &ops, &num_ops, 2)) - return 0; - break; - case OP_SUBASSIGN: - op->type = slang_oper_subassign; - if (!handle_nary_expression (C, op, &ops, &num_ops, 2)) - return 0; - break; - case OP_MULASSIGN: - op->type = slang_oper_mulassign; - if (!handle_nary_expression (C, op, &ops, &num_ops, 2)) - return 0; - break; - case OP_DIVASSIGN: - op->type = slang_oper_divassign; - if (!handle_nary_expression (C, op, &ops, &num_ops, 2)) - return 0; - break; - /*case OP_MODASSIGN:*/ - /*case OP_LSHASSIGN:*/ - /*case OP_RSHASSIGN:*/ - /*case OP_ORASSIGN:*/ - /*case OP_XORASSIGN:*/ - /*case OP_ANDASSIGN:*/ - case OP_SELECT: - op->type = slang_oper_select; - if (!handle_nary_expression (C, op, &ops, &num_ops, 3)) - return 0; - break; - case OP_LOGICALOR: - op->type = slang_oper_logicalor; - if (!handle_nary_expression (C, op, &ops, &num_ops, 2)) - return 0; - break; - case OP_LOGICALXOR: - op->type = slang_oper_logicalxor; - if (!handle_nary_expression (C, op, &ops, &num_ops, 2)) - return 0; - break; - case OP_LOGICALAND: - op->type = slang_oper_logicaland; - if (!handle_nary_expression (C, op, &ops, &num_ops, 2)) - return 0; - break; - /*case OP_BITOR:*/ - /*case OP_BITXOR:*/ - /*case OP_BITAND:*/ - case OP_EQUAL: - op->type = slang_oper_equal; - if (!handle_nary_expression (C, op, &ops, &num_ops, 2)) - return 0; - break; - case OP_NOTEQUAL: - op->type = slang_oper_notequal; - if (!handle_nary_expression (C, op, &ops, &num_ops, 2)) - return 0; - break; - case OP_LESS: - op->type = slang_oper_less; - if (!handle_nary_expression (C, op, &ops, &num_ops, 2)) - return 0; - break; - case OP_GREATER: - op->type = slang_oper_greater; - if (!handle_nary_expression (C, op, &ops, &num_ops, 2)) - return 0; - break; - case OP_LESSEQUAL: - op->type = slang_oper_lessequal; - if (!handle_nary_expression (C, op, &ops, &num_ops, 2)) - return 0; - break; - case OP_GREATEREQUAL: - op->type = slang_oper_greaterequal; - if (!handle_nary_expression (C, op, &ops, &num_ops, 2)) - return 0; - break; - /*case OP_LSHIFT:*/ - /*case OP_RSHIFT:*/ - case OP_ADD: - op->type = slang_oper_add; - if (!handle_nary_expression (C, op, &ops, &num_ops, 2)) - return 0; - break; - case OP_SUBTRACT: - op->type = slang_oper_subtract; - if (!handle_nary_expression (C, op, &ops, &num_ops, 2)) - return 0; - break; - case OP_MULTIPLY: - op->type = slang_oper_multiply; - if (!handle_nary_expression (C, op, &ops, &num_ops, 2)) - return 0; - break; - case OP_DIVIDE: - op->type = slang_oper_divide; - if (!handle_nary_expression (C, op, &ops, &num_ops, 2)) - return 0; - break; - /*case OP_MODULUS:*/ - case OP_PREINCREMENT: - op->type = slang_oper_preincrement; - if (!handle_nary_expression (C, op, &ops, &num_ops, 1)) - return 0; - break; - case OP_PREDECREMENT: - op->type = slang_oper_predecrement; - if (!handle_nary_expression (C, op, &ops, &num_ops, 1)) - return 0; - break; - case OP_PLUS: - op->type = slang_oper_plus; - if (!handle_nary_expression (C, op, &ops, &num_ops, 1)) - return 0; - break; - case OP_MINUS: - op->type = slang_oper_minus; - if (!handle_nary_expression (C, op, &ops, &num_ops, 1)) - return 0; - break; - case OP_NOT: - op->type = slang_oper_not; - if (!handle_nary_expression (C, op, &ops, &num_ops, 1)) - return 0; - break; - /*case OP_COMPLEMENT:*/ - case OP_SUBSCRIPT: - op->type = slang_oper_subscript; - if (!handle_nary_expression (C, op, &ops, &num_ops, 2)) - return 0; - break; - case OP_CALL: - op->type = slang_oper_call; - op->a_id = parse_identifier (C); - if (op->a_id == SLANG_ATOM_NULL) - return 0; - while (*C->I != OP_END) - if (!parse_child_operation (C, O, op, 0)) - return 0; - C->I++; - if (!C->parsing_builtin && !slang_function_scope_find_by_name (O->funs, op->a_id, 1)) - { - const char *id; - - id = slang_atom_pool_id (C->atoms, op->a_id); - if (!is_constructor_name (id, op->a_id, O->structs)) - { - slang_info_log_error (C->L, "%s: undeclared function name.", id); - return 0; - } - } - break; - case OP_FIELD: - op->type = slang_oper_field; - op->a_id = parse_identifier (C); - if (op->a_id == SLANG_ATOM_NULL) - return 0; - if (!handle_nary_expression (C, op, &ops, &num_ops, 1)) - return 0; - break; - case OP_POSTINCREMENT: - op->type = slang_oper_postincrement; - if (!handle_nary_expression (C, op, &ops, &num_ops, 1)) - return 0; - break; - case OP_POSTDECREMENT: - op->type = slang_oper_postdecrement; - if (!handle_nary_expression (C, op, &ops, &num_ops, 1)) - return 0; - break; - default: - return 0; - } - } - C->I++; - - *oper = *ops; - slang_alloc_free (ops); - return 1; + slang_operation *ops = NULL; + unsigned int num_ops = 0; + int number; + + while (*C->I != OP_END) { + slang_operation *op; + const unsigned int op_code = *C->I++; + + /* allocate default operation, becomes a no-op if not used */ + ops = (slang_operation *) + slang_alloc_realloc(ops, + num_ops * sizeof(slang_operation), + (num_ops + 1) * sizeof(slang_operation)); + if (ops == NULL) { + slang_info_log_memory(C->L); + return 0; + } + op = &ops[num_ops]; + if (!slang_operation_construct(op)) { + slang_info_log_memory(C->L); + return 0; + } + num_ops++; + op->locals->outer_scope = O->vars; + + switch (op_code) { + case OP_PUSH_VOID: + op->type = slang_oper_void; + break; + case OP_PUSH_BOOL: + op->type = slang_oper_literal_bool; + if (!parse_number(C, &number)) + return 0; + op->literal = (GLfloat) number; + break; + case OP_PUSH_INT: + op->type = slang_oper_literal_int; + if (!parse_number(C, &number)) + return 0; + op->literal = (GLfloat) number; + break; + case OP_PUSH_FLOAT: + op->type = slang_oper_literal_float; + if (!parse_float(C, &op->literal)) + return 0; + break; + case OP_PUSH_IDENTIFIER: + op->type = slang_oper_identifier; + op->a_id = parse_identifier(C); + if (op->a_id == SLANG_ATOM_NULL) + return 0; + break; + case OP_SEQUENCE: + op->type = slang_oper_sequence; + if (!handle_nary_expression(C, op, &ops, &num_ops, 2)) + return 0; + break; + case OP_ASSIGN: + op->type = slang_oper_assign; + if (!handle_nary_expression(C, op, &ops, &num_ops, 2)) + return 0; + break; + case OP_ADDASSIGN: + op->type = slang_oper_addassign; + if (!handle_nary_expression(C, op, &ops, &num_ops, 2)) + return 0; + break; + case OP_SUBASSIGN: + op->type = slang_oper_subassign; + if (!handle_nary_expression(C, op, &ops, &num_ops, 2)) + return 0; + break; + case OP_MULASSIGN: + op->type = slang_oper_mulassign; + if (!handle_nary_expression(C, op, &ops, &num_ops, 2)) + return 0; + break; + case OP_DIVASSIGN: + op->type = slang_oper_divassign; + if (!handle_nary_expression(C, op, &ops, &num_ops, 2)) + return 0; + break; + /*case OP_MODASSIGN: */ + /*case OP_LSHASSIGN: */ + /*case OP_RSHASSIGN: */ + /*case OP_ORASSIGN: */ + /*case OP_XORASSIGN: */ + /*case OP_ANDASSIGN: */ + case OP_SELECT: + op->type = slang_oper_select; + if (!handle_nary_expression(C, op, &ops, &num_ops, 3)) + return 0; + break; + case OP_LOGICALOR: + op->type = slang_oper_logicalor; + if (!handle_nary_expression(C, op, &ops, &num_ops, 2)) + return 0; + break; + case OP_LOGICALXOR: + op->type = slang_oper_logicalxor; + if (!handle_nary_expression(C, op, &ops, &num_ops, 2)) + return 0; + break; + case OP_LOGICALAND: + op->type = slang_oper_logicaland; + if (!handle_nary_expression(C, op, &ops, &num_ops, 2)) + return 0; + break; + /*case OP_BITOR: */ + /*case OP_BITXOR: */ + /*case OP_BITAND: */ + case OP_EQUAL: + op->type = slang_oper_equal; + if (!handle_nary_expression(C, op, &ops, &num_ops, 2)) + return 0; + break; + case OP_NOTEQUAL: + op->type = slang_oper_notequal; + if (!handle_nary_expression(C, op, &ops, &num_ops, 2)) + return 0; + break; + case OP_LESS: + op->type = slang_oper_less; + if (!handle_nary_expression(C, op, &ops, &num_ops, 2)) + return 0; + break; + case OP_GREATER: + op->type = slang_oper_greater; + if (!handle_nary_expression(C, op, &ops, &num_ops, 2)) + return 0; + break; + case OP_LESSEQUAL: + op->type = slang_oper_lessequal; + if (!handle_nary_expression(C, op, &ops, &num_ops, 2)) + return 0; + break; + case OP_GREATEREQUAL: + op->type = slang_oper_greaterequal; + if (!handle_nary_expression(C, op, &ops, &num_ops, 2)) + return 0; + break; + /*case OP_LSHIFT: */ + /*case OP_RSHIFT: */ + case OP_ADD: + op->type = slang_oper_add; + if (!handle_nary_expression(C, op, &ops, &num_ops, 2)) + return 0; + break; + case OP_SUBTRACT: + op->type = slang_oper_subtract; + if (!handle_nary_expression(C, op, &ops, &num_ops, 2)) + return 0; + break; + case OP_MULTIPLY: + op->type = slang_oper_multiply; + if (!handle_nary_expression(C, op, &ops, &num_ops, 2)) + return 0; + break; + case OP_DIVIDE: + op->type = slang_oper_divide; + if (!handle_nary_expression(C, op, &ops, &num_ops, 2)) + return 0; + break; + /*case OP_MODULUS: */ + case OP_PREINCREMENT: + op->type = slang_oper_preincrement; + if (!handle_nary_expression(C, op, &ops, &num_ops, 1)) + return 0; + break; + case OP_PREDECREMENT: + op->type = slang_oper_predecrement; + if (!handle_nary_expression(C, op, &ops, &num_ops, 1)) + return 0; + break; + case OP_PLUS: + op->type = slang_oper_plus; + if (!handle_nary_expression(C, op, &ops, &num_ops, 1)) + return 0; + break; + case OP_MINUS: + op->type = slang_oper_minus; + if (!handle_nary_expression(C, op, &ops, &num_ops, 1)) + return 0; + break; + case OP_NOT: + op->type = slang_oper_not; + if (!handle_nary_expression(C, op, &ops, &num_ops, 1)) + return 0; + break; + /*case OP_COMPLEMENT: */ + case OP_SUBSCRIPT: + op->type = slang_oper_subscript; + if (!handle_nary_expression(C, op, &ops, &num_ops, 2)) + return 0; + break; + case OP_CALL: + op->type = slang_oper_call; + op->a_id = parse_identifier(C); + if (op->a_id == SLANG_ATOM_NULL) + return 0; + while (*C->I != OP_END) + if (!parse_child_operation(C, O, op, 0)) + return 0; + C->I++; + if (!C->parsing_builtin + && !slang_function_scope_find_by_name(O->funs, op->a_id, 1)) { + const char *id; + + id = slang_atom_pool_id(C->atoms, op->a_id); + if (!is_constructor_name(id, op->a_id, O->structs)) { + slang_info_log_error(C->L, "%s: undeclared function name.", id); + return 0; + } + } + break; + case OP_FIELD: + op->type = slang_oper_field; + op->a_id = parse_identifier(C); + if (op->a_id == SLANG_ATOM_NULL) + return 0; + if (!handle_nary_expression(C, op, &ops, &num_ops, 1)) + return 0; + break; + case OP_POSTINCREMENT: + op->type = slang_oper_postincrement; + if (!handle_nary_expression(C, op, &ops, &num_ops, 1)) + return 0; + break; + case OP_POSTDECREMENT: + op->type = slang_oper_postdecrement; + if (!handle_nary_expression(C, op, &ops, &num_ops, 1)) + return 0; + break; + default: + return 0; + } + } + C->I++; + + *oper = *ops; + slang_alloc_free(ops); + + return 1; } /* parameter qualifier */ @@ -1222,78 +1272,76 @@ static int parse_expression (slang_parse_ctx *C, slang_output_ctx *O, slang_oper #define PARAMETER_ARRAY_NOT_PRESENT 0 #define PARAMETER_ARRAY_PRESENT 1 -static int parse_parameter_declaration (slang_parse_ctx *C, slang_output_ctx *O, - slang_variable *param) +static int +parse_parameter_declaration(slang_parse_ctx * C, slang_output_ctx * O, + slang_variable * param) { - /* parse and validate the parameter's type qualifiers (there can be two at most) because - * not all combinations are valid */ - if (!parse_type_qualifier (C, ¶m->type.qualifier)) - return 0; - switch (*C->I++) - { - case PARAM_QUALIFIER_IN: - if (param->type.qualifier != slang_qual_const && param->type.qualifier != slang_qual_none) - { - slang_info_log_error (C->L, "Invalid type qualifier."); - return 0; - } - break; - case PARAM_QUALIFIER_OUT: - if (param->type.qualifier == slang_qual_none) - param->type.qualifier = slang_qual_out; - else - { - slang_info_log_error (C->L, "Invalid type qualifier."); - return 0; - } - break; - case PARAM_QUALIFIER_INOUT: - if (param->type.qualifier == slang_qual_none) - param->type.qualifier = slang_qual_inout; - else - { - slang_info_log_error (C->L, "Invalid type qualifier."); - return 0; - } - break; - default: - return 0; - } - - /* parse parameter's type specifier and name */ - if (!parse_type_specifier (C, O, ¶m->type.specifier)) - return 0; - param->a_name = parse_identifier (C); - if (param->a_name == SLANG_ATOM_NULL) - return 0; - - /* if the parameter is an array, parse its size (the size must be explicitly defined */ - if (*C->I++ == PARAMETER_ARRAY_PRESENT) - { - slang_type_specifier p; - - slang_type_specifier_ctr (&p); - if (!slang_type_specifier_copy (&p, ¶m->type.specifier)) - { - slang_type_specifier_dtr (&p); - return GL_FALSE; - } - if (!convert_to_array (C, param, &p)) - { - slang_type_specifier_dtr (&p); - return GL_FALSE; - } - slang_type_specifier_dtr (&p); - if (!parse_array_len (C, O, ¶m->array_len)) - return GL_FALSE; - } - - /* calculate the parameter size */ - if (!calculate_var_size (C, O, param)) - return GL_FALSE; - - /* TODO: allocate the local address here? */ - return 1; + /* parse and validate the parameter's type qualifiers (there can be + * two at most) because not all combinations are valid + */ + if (!parse_type_qualifier(C, ¶m->type.qualifier)) + return 0; + switch (*C->I++) { + case PARAM_QUALIFIER_IN: + if (param->type.qualifier != slang_qual_const + && param->type.qualifier != slang_qual_none) { + slang_info_log_error(C->L, "Invalid type qualifier."); + return 0; + } + break; + case PARAM_QUALIFIER_OUT: + if (param->type.qualifier == slang_qual_none) + param->type.qualifier = slang_qual_out; + else { + slang_info_log_error(C->L, "Invalid type qualifier."); + return 0; + } + break; + case PARAM_QUALIFIER_INOUT: + if (param->type.qualifier == slang_qual_none) + param->type.qualifier = slang_qual_inout; + else { + slang_info_log_error(C->L, "Invalid type qualifier."); + return 0; + } + break; + default: + return 0; + } + + /* parse parameter's type specifier and name */ + if (!parse_type_specifier(C, O, ¶m->type.specifier)) + return 0; + param->a_name = parse_identifier(C); + if (param->a_name == SLANG_ATOM_NULL) + return 0; + + /* if the parameter is an array, parse its size (the size must be + * explicitly defined + */ + if (*C->I++ == PARAMETER_ARRAY_PRESENT) { + slang_type_specifier p; + + slang_type_specifier_ctr(&p); + if (!slang_type_specifier_copy(&p, ¶m->type.specifier)) { + slang_type_specifier_dtr(&p); + return GL_FALSE; + } + if (!convert_to_array(C, param, &p)) { + slang_type_specifier_dtr(&p); + return GL_FALSE; + } + slang_type_specifier_dtr(&p); + if (!parse_array_len(C, O, ¶m->array_len)) + return GL_FALSE; + } + + /* calculate the parameter size */ + if (!calculate_var_size(C, O, param)) + return GL_FALSE; + + /* TODO: allocate the local address here? */ + return 1; } /* function type */ @@ -1336,251 +1384,256 @@ static int parse_parameter_declaration (slang_parse_ctx *C, slang_output_ctx *O, /*#define OPERATOR_COMPLEMENT 28*/ #define OPERATOR_NOT 29 -static const struct { - unsigned int o_code; - const char *o_name; +static const struct +{ + unsigned int o_code; + const char *o_name; } operator_names[] = { - { OPERATOR_INCREMENT, "++" }, - { OPERATOR_ADDASSIGN, "+=" }, - { OPERATOR_PLUS, "+" }, - { OPERATOR_DECREMENT, "--" }, - { OPERATOR_SUBASSIGN, "-=" }, - { OPERATOR_MINUS, "-" }, - { OPERATOR_NOT, "!" }, - { OPERATOR_MULASSIGN, "*=" }, - { OPERATOR_MULTIPLY, "*" }, - { OPERATOR_DIVASSIGN, "/=" }, - { OPERATOR_DIVIDE, "/" }, - { OPERATOR_LESSEQUAL, "<=" }, - /*{ OPERATOR_LSHASSIGN, "<<=" },*/ - /*{ OPERATOR_LSHIFT, "<<" },*/ - { OPERATOR_LESS, "<" }, - { OPERATOR_GREATEREQUAL, ">=" }, - /*{ OPERATOR_RSHASSIGN, ">>=" },*/ - /*{ OPERATOR_RSHIFT, ">>" },*/ - { OPERATOR_GREATER, ">" }, - /*{ OPERATOR_MODASSIGN, "%=" },*/ - /*{ OPERATOR_MODULUS, "%" },*/ - /*{ OPERATOR_ANDASSIGN, "&=" },*/ - /*{ OPERATOR_BITAND, "&" },*/ - /*{ OPERATOR_ORASSIGN, "|=" },*/ - /*{ OPERATOR_BITOR, "|" },*/ - /*{ OPERATOR_COMPLEMENT, "~" },*/ - /*{ OPERATOR_XORASSIGN, "^=" },*/ - { OPERATOR_LOGICALXOR, "^^" }, - /*{ OPERATOR_BITXOR, "^" }*/ + {OPERATOR_INCREMENT, "++"}, + {OPERATOR_ADDASSIGN, "+="}, + {OPERATOR_PLUS, "+"}, + {OPERATOR_DECREMENT, "--"}, + {OPERATOR_SUBASSIGN, "-="}, + {OPERATOR_MINUS, "-"}, + {OPERATOR_NOT, "!"}, + {OPERATOR_MULASSIGN, "*="}, + {OPERATOR_MULTIPLY, "*"}, + {OPERATOR_DIVASSIGN, "/="}, + {OPERATOR_DIVIDE, "/"}, + {OPERATOR_LESSEQUAL, "<="}, + /*{ OPERATOR_LSHASSIGN, "<<=" }, */ + /*{ OPERATOR_LSHIFT, "<<" }, */ + {OPERATOR_LESS, "<"}, + {OPERATOR_GREATEREQUAL, ">="}, + /*{ OPERATOR_RSHASSIGN, ">>=" }, */ + /*{ OPERATOR_RSHIFT, ">>" }, */ + {OPERATOR_GREATER, ">"}, + /*{ OPERATOR_MODASSIGN, "%=" }, */ + /*{ OPERATOR_MODULUS, "%" }, */ + /*{ OPERATOR_ANDASSIGN, "&=" }, */ + /*{ OPERATOR_BITAND, "&" }, */ + /*{ OPERATOR_ORASSIGN, "|=" }, */ + /*{ OPERATOR_BITOR, "|" }, */ + /*{ OPERATOR_COMPLEMENT, "~" }, */ + /*{ OPERATOR_XORASSIGN, "^=" }, */ + {OPERATOR_LOGICALXOR, "^^"}, + /*{ OPERATOR_BITXOR, "^" } */ }; -static slang_atom parse_operator_name (slang_parse_ctx *C) +static slang_atom +parse_operator_name(slang_parse_ctx * C) { - unsigned int i; - - for (i = 0; i < sizeof (operator_names) / sizeof (*operator_names); i++) - { - if (operator_names[i].o_code == (unsigned int) (*C->I)) - { - slang_atom atom = slang_atom_pool_atom (C->atoms, operator_names[i].o_name); - if (atom == SLANG_ATOM_NULL) - { - slang_info_log_memory (C->L); - return 0; - } - C->I++; - return atom; - } - } - return 0; + unsigned int i; + + for (i = 0; i < sizeof(operator_names) / sizeof(*operator_names); i++) { + if (operator_names[i].o_code == (unsigned int) (*C->I)) { + slang_atom atom = + slang_atom_pool_atom(C->atoms, operator_names[i].o_name); + if (atom == SLANG_ATOM_NULL) { + slang_info_log_memory(C->L); + return 0; + } + C->I++; + return atom; + } + } + return 0; } -static int parse_function_prototype (slang_parse_ctx *C, slang_output_ctx *O, slang_function *func) +static int +parse_function_prototype(slang_parse_ctx * C, slang_output_ctx * O, + slang_function * func) { - /* parse function type and name */ - if (!parse_fully_specified_type (C, O, &func->header.type)) - return 0; - switch (*C->I++) - { - case FUNCTION_ORDINARY: - func->kind = slang_func_ordinary; - func->header.a_name = parse_identifier (C); - if (func->header.a_name == SLANG_ATOM_NULL) - return 0; - break; - case FUNCTION_CONSTRUCTOR: - func->kind = slang_func_constructor; - if (func->header.type.specifier.type == slang_spec_struct) - return 0; - func->header.a_name = slang_atom_pool_atom (C->atoms, - slang_type_specifier_type_to_string (func->header.type.specifier.type)); - if (func->header.a_name == SLANG_ATOM_NULL) - { - slang_info_log_memory (C->L); - return 0; - } - break; - case FUNCTION_OPERATOR: - func->kind = slang_func_operator; - func->header.a_name = parse_operator_name (C); - if (func->header.a_name == SLANG_ATOM_NULL) - return 0; - break; - default: - return 0; - } - - /* parse function parameters */ - while (*C->I++ == PARAMETER_NEXT) - { - slang_variable *p; - - func->parameters->variables = (slang_variable *) slang_alloc_realloc ( - func->parameters->variables, - func->parameters->num_variables * sizeof (slang_variable), - (func->parameters->num_variables + 1) * sizeof (slang_variable)); - if (func->parameters->variables == NULL) - { - slang_info_log_memory (C->L); - return 0; - } - p = &func->parameters->variables[func->parameters->num_variables]; - if (!slang_variable_construct (p)) - return 0; - func->parameters->num_variables++; - if (!parse_parameter_declaration (C, O, p)) - return 0; - } - - /* function formal parameters and local variables share the same scope, so save - * the information about param count in a seperate place - * also link the scope to the global variable scope so when a given identifier is not - * found here, the search process continues in the global space */ - func->param_count = func->parameters->num_variables; - func->parameters->outer_scope = O->vars; - return 1; + /* parse function type and name */ + if (!parse_fully_specified_type(C, O, &func->header.type)) + return 0; + switch (*C->I++) { + case FUNCTION_ORDINARY: + func->kind = slang_func_ordinary; + func->header.a_name = parse_identifier(C); + if (func->header.a_name == SLANG_ATOM_NULL) + return 0; + break; + case FUNCTION_CONSTRUCTOR: + func->kind = slang_func_constructor; + if (func->header.type.specifier.type == slang_spec_struct) + return 0; + func->header.a_name = + slang_atom_pool_atom(C->atoms, + slang_type_specifier_type_to_string + (func->header.type.specifier.type)); + if (func->header.a_name == SLANG_ATOM_NULL) { + slang_info_log_memory(C->L); + return 0; + } + break; + case FUNCTION_OPERATOR: + func->kind = slang_func_operator; + func->header.a_name = parse_operator_name(C); + if (func->header.a_name == SLANG_ATOM_NULL) + return 0; + break; + default: + return 0; + } + + /* parse function parameters */ + while (*C->I++ == PARAMETER_NEXT) { + slang_variable *p; + + func->parameters->variables = (slang_variable *) + slang_alloc_realloc(func->parameters->variables, + func->parameters->num_variables * sizeof(slang_variable), + (func->parameters->num_variables + 1) * sizeof(slang_variable)); + if (func->parameters->variables == NULL) { + slang_info_log_memory(C->L); + return 0; + } + p = &func->parameters->variables[func->parameters->num_variables]; + if (!slang_variable_construct(p)) + return 0; + func->parameters->num_variables++; + if (!parse_parameter_declaration(C, O, p)) + return 0; + } + + /* function formal parameters and local variables share the same + * scope, so save the information about param count in a seperate + * place also link the scope to the global variable scope so when a + * given identifier is not found here, the search process continues + * in the global space + */ + func->param_count = func->parameters->num_variables; + func->parameters->outer_scope = O->vars; + return 1; } -static int parse_function_definition (slang_parse_ctx *C, slang_output_ctx *O, slang_function *func) +static int +parse_function_definition(slang_parse_ctx * C, slang_output_ctx * O, + slang_function * func) { - slang_output_ctx o = *O; - - if (!parse_function_prototype (C, O, func)) - return 0; - - /* create function's body operation */ - func->body = (slang_operation *) slang_alloc_malloc (sizeof (slang_operation)); - if (func->body == NULL) - { - slang_info_log_memory (C->L); - return 0; - } - if (!slang_operation_construct (func->body)) - { - slang_alloc_free (func->body); - func->body = NULL; - slang_info_log_memory (C->L); - return 0; - } - - /* to parse the body the parse context is modified in order to capture parsed variables - * into function's local variable scope */ - C->global_scope = 0; - o.vars = func->parameters; - if (!parse_statement (C, &o, func->body)) - return 0; - C->global_scope = 1; - return 1; + slang_output_ctx o = *O; + + if (!parse_function_prototype(C, O, func)) + return 0; + + /* create function's body operation */ + func->body = + (slang_operation *) slang_alloc_malloc(sizeof(slang_operation)); + if (func->body == NULL) { + slang_info_log_memory(C->L); + return 0; + } + if (!slang_operation_construct(func->body)) { + slang_alloc_free(func->body); + func->body = NULL; + slang_info_log_memory(C->L); + return 0; + } + + /* to parse the body the parse context is modified in order to + * capture parsed variables into function's local variable scope + */ + C->global_scope = GL_FALSE; + o.vars = func->parameters; + if (!parse_statement(C, &o, func->body)) + return 0; + + C->global_scope = GL_TRUE; + return 1; } -static GLboolean initialize_global (slang_assemble_ctx *A, slang_variable *var) +static GLboolean +initialize_global(slang_assemble_ctx * A, slang_variable * var) { - slang_assembly_file_restore_point point; - slang_machine mach; - slang_assembly_local_info save_local = A->local; - slang_operation op_id, op_assign; - GLboolean result; - - /* save the current assembly */ - if (!slang_assembly_file_restore_point_save (A->file, &point)) - return GL_FALSE; - - /* setup the machine */ - mach = *A->mach; - mach.ip = A->file->count; - - /* allocate local storage for expression */ - A->local.ret_size = 0; - A->local.addr_tmp = 0; - A->local.swizzle_tmp = 4; - if (!slang_assembly_file_push_label (A->file, slang_asm_local_alloc, 20)) - return GL_FALSE; - if (!slang_assembly_file_push_label (A->file, slang_asm_enter, 20)) - return GL_FALSE; - - /* construct the left side of assignment */ - if (!slang_operation_construct (&op_id)) - return GL_FALSE; - op_id.type = slang_oper_identifier; - op_id.a_id = var->a_name; - - /* put the variable into operation's scope */ - op_id.locals->variables = (slang_variable *) slang_alloc_malloc (sizeof (slang_variable)); - if (op_id.locals->variables == NULL) - { - slang_operation_destruct (&op_id); - return GL_FALSE; - } - op_id.locals->num_variables = 1; - op_id.locals->variables[0] = *var; - - /* construct the assignment expression */ - if (!slang_operation_construct (&op_assign)) - { - op_id.locals->num_variables = 0; - slang_operation_destruct (&op_id); - return GL_FALSE; - } - op_assign.type = slang_oper_assign; - op_assign.children = (slang_operation *) slang_alloc_malloc (2 * sizeof (slang_operation)); - if (op_assign.children == NULL) - { - slang_operation_destruct (&op_assign); - op_id.locals->num_variables = 0; - slang_operation_destruct (&op_id); - return GL_FALSE; - } - op_assign.num_children = 2; - op_assign.children[0] = op_id; - op_assign.children[1] = *var->initializer; - - /* insert the actual expression */ - result = _slang_assemble_operation (A, &op_assign, slang_ref_forbid); - - /* carefully destroy the operations */ - op_assign.num_children = 0; - slang_alloc_free (op_assign.children); - op_assign.children = NULL; - slang_operation_destruct (&op_assign); - op_id.locals->num_variables = 0; - slang_operation_destruct (&op_id); - - if (!result) - return GL_FALSE; - if (!slang_assembly_file_push (A->file, slang_asm_exit)) - return GL_FALSE; - - /* execute the expression */ - if (!_slang_execute2 (A->file, &mach)) - return GL_FALSE; - - /* restore the old assembly */ - if (!slang_assembly_file_restore_point_load (A->file, &point)) - return GL_FALSE; - A->local = save_local; - - /* now we copy the contents of the initialized variable back to the original machine */ - _mesa_memcpy ((GLubyte *) A->mach->mem + var->address, (GLubyte *) mach.mem + var->address, - var->size); - - return GL_TRUE; + slang_assembly_file_restore_point point; + slang_machine mach; + slang_assembly_local_info save_local = A->local; + slang_operation op_id, op_assign; + GLboolean result; + + /* save the current assembly */ + if (!slang_assembly_file_restore_point_save(A->file, &point)) + return GL_FALSE; + + /* setup the machine */ + mach = *A->mach; + mach.ip = A->file->count; + + /* allocate local storage for expression */ + A->local.ret_size = 0; + A->local.addr_tmp = 0; + A->local.swizzle_tmp = 4; + if (!slang_assembly_file_push_label(A->file, slang_asm_local_alloc, 20)) + return GL_FALSE; + if (!slang_assembly_file_push_label(A->file, slang_asm_enter, 20)) + return GL_FALSE; + + /* construct the left side of assignment */ + if (!slang_operation_construct(&op_id)) + return GL_FALSE; + op_id.type = slang_oper_identifier; + op_id.a_id = var->a_name; + + /* put the variable into operation's scope */ + op_id.locals->variables = + (slang_variable *) slang_alloc_malloc(sizeof(slang_variable)); + if (op_id.locals->variables == NULL) { + slang_operation_destruct(&op_id); + return GL_FALSE; + } + op_id.locals->num_variables = 1; + op_id.locals->variables[0] = *var; + + /* construct the assignment expression */ + if (!slang_operation_construct(&op_assign)) { + op_id.locals->num_variables = 0; + slang_operation_destruct(&op_id); + return GL_FALSE; + } + op_assign.type = slang_oper_assign; + op_assign.children = + (slang_operation *) slang_alloc_malloc(2 * sizeof(slang_operation)); + if (op_assign.children == NULL) { + slang_operation_destruct(&op_assign); + op_id.locals->num_variables = 0; + slang_operation_destruct(&op_id); + return GL_FALSE; + } + op_assign.num_children = 2; + op_assign.children[0] = op_id; + op_assign.children[1] = *var->initializer; + + /* insert the actual expression */ + result = _slang_assemble_operation(A, &op_assign, slang_ref_forbid); + + /* carefully destroy the operations */ + op_assign.num_children = 0; + slang_alloc_free(op_assign.children); + op_assign.children = NULL; + slang_operation_destruct(&op_assign); + op_id.locals->num_variables = 0; + slang_operation_destruct(&op_id); + + if (!result) + return GL_FALSE; + if (!slang_assembly_file_push(A->file, slang_asm_exit)) + return GL_FALSE; + + /* execute the expression */ + if (!_slang_execute2(A->file, &mach)) + return GL_FALSE; + + /* restore the old assembly */ + if (!slang_assembly_file_restore_point_load(A->file, &point)) + return GL_FALSE; + A->local = save_local; + + /* now we copy the contents of the initialized variable back to the original machine */ + _mesa_memcpy((GLubyte *) A->mach->mem + var->address, + (GLubyte *) mach.mem + var->address, var->size); + + return GL_TRUE; } /* init declarator list */ @@ -1594,89 +1647,95 @@ static GLboolean initialize_global (slang_assemble_ctx *A, slang_variable *var) #define VARIABLE_ARRAY_EXPLICIT 3 #define VARIABLE_ARRAY_UNKNOWN 4 -static int parse_init_declarator (slang_parse_ctx *C, slang_output_ctx *O, - const slang_fully_specified_type *type) + +/** + * Parse the initializer for a variable declaration. + */ +static int +parse_init_declarator(slang_parse_ctx * C, slang_output_ctx * O, + const slang_fully_specified_type * type) { - slang_variable *var; - - /* empty init declatator (without name, e.g. "float ;") */ - if (*C->I++ == VARIABLE_NONE) - return 1; - - /* make room for the new variable and initialize it */ - O->vars->variables = (slang_variable *) slang_alloc_realloc (O->vars->variables, - O->vars->num_variables * sizeof (slang_variable), - (O->vars->num_variables + 1) * sizeof (slang_variable)); - if (O->vars->variables == NULL) - { - slang_info_log_memory (C->L); - return 0; - } - var = &O->vars->variables[O->vars->num_variables]; - if (!slang_variable_construct (var)) - return 0; - O->vars->num_variables++; - - /* copy the declarator qualifier type, parse the identifier */ - var->global = C->global_scope; - var->type.qualifier = type->qualifier; - var->a_name = parse_identifier (C); - if (var->a_name == SLANG_ATOM_NULL) - return 0; - - switch (*C->I++) - { - case VARIABLE_NONE: - /* simple variable declarator - just copy the specifier */ - if (!slang_type_specifier_copy (&var->type.specifier, &type->specifier)) - return 0; - break; - case VARIABLE_INITIALIZER: - /* initialized variable - copy the specifier and parse the expression */ - if (!slang_type_specifier_copy (&var->type.specifier, &type->specifier)) - return 0; - var->initializer = (slang_operation *) slang_alloc_malloc (sizeof (slang_operation)); - if (var->initializer == NULL) - { - slang_info_log_memory (C->L); - return 0; - } - if (!slang_operation_construct (var->initializer)) - { - slang_alloc_free (var->initializer); - var->initializer = NULL; - slang_info_log_memory (C->L); - return 0; - } - if (!parse_expression (C, O, var->initializer)) - return 0; - break; + slang_variable *var; + + /* empty init declatator (without name, e.g. "float ;") */ + if (*C->I++ == VARIABLE_NONE) + return 1; + + /* make room for the new variable and initialize it */ + O->vars->variables = (slang_variable *) + slang_alloc_realloc(O->vars->variables, + O->vars->num_variables * sizeof(slang_variable), + (O->vars->num_variables + 1) * sizeof(slang_variable)); + if (O->vars->variables == NULL) { + slang_info_log_memory(C->L); + return 0; + } + var = &O->vars->variables[O->vars->num_variables]; + if (!slang_variable_construct(var)) + return 0; + O->vars->num_variables++; + + /* copy the declarator qualifier type, parse the identifier */ + var->global = C->global_scope; + var->type.qualifier = type->qualifier; + var->a_name = parse_identifier(C); + if (var->a_name == SLANG_ATOM_NULL) + return 0; + + switch (*C->I++) { + case VARIABLE_NONE: + /* simple variable declarator - just copy the specifier */ + if (!slang_type_specifier_copy(&var->type.specifier, &type->specifier)) + return 0; + break; + case VARIABLE_INITIALIZER: + /* initialized variable - copy the specifier and parse the expression */ + if (!slang_type_specifier_copy(&var->type.specifier, &type->specifier)) + return 0; + var->initializer = + (slang_operation *) slang_alloc_malloc(sizeof(slang_operation)); + if (var->initializer == NULL) { + slang_info_log_memory(C->L); + return 0; + } + if (!slang_operation_construct(var->initializer)) { + slang_alloc_free(var->initializer); + var->initializer = NULL; + slang_info_log_memory(C->L); + return 0; + } + if (!parse_expression(C, O, var->initializer)) + return 0; + break; #if 0 - case VARIABLE_ARRAY_UNKNOWN: - /* unsized array - mark it as array and copy the specifier to the array element */ - if (!convert_to_array (C, var, &type->specifier)) - return GL_FALSE; - break; + case VARIABLE_ARRAY_UNKNOWN: + /* unsized array - mark it as array and copy the specifier to + the array element + */ + if (!convert_to_array(C, var, &type->specifier)) + return GL_FALSE; + break; #endif - case VARIABLE_ARRAY_EXPLICIT: - if (!convert_to_array (C, var, &type->specifier)) - return GL_FALSE; - if (!parse_array_len (C, O, &var->array_len)) - return GL_FALSE; - break; - default: - return 0; - } - - /* allocate global address space for a variable with a known size */ - if (C->global_scope && !(var->type.specifier.type == slang_spec_array && var->array_len == 0)) - { - if (!calculate_var_size (C, O, var)) - return GL_FALSE; - var->address = slang_var_pool_alloc (O->global_pool, var->size); - } - - /* initialize global variable */ + case VARIABLE_ARRAY_EXPLICIT: + if (!convert_to_array(C, var, &type->specifier)) + return GL_FALSE; + if (!parse_array_len(C, O, &var->array_len)) + return GL_FALSE; + break; + default: + return 0; + } + + /* allocate global address space for a variable with a known size */ + if (C->global_scope + && !(var->type.specifier.type == slang_spec_array + && var->array_len == 0)) { + if (!calculate_var_size(C, O, var)) + return GL_FALSE; + var->address = slang_var_pool_alloc(O->global_pool, var->size); + } + + /* initialize global variable */ if (C->global_scope) { if (var->initializer != NULL) { slang_assemble_ctx A; @@ -1687,160 +1746,171 @@ static int parse_init_declarator (slang_parse_ctx *C, slang_output_ctx *O, A.space.funcs = O->funs; A.space.structs = O->structs; A.space.vars = O->vars; - if (!initialize_global (&A, var)) + if (!initialize_global(&A, var)) return 0; } else { - _mesa_memset ((GLubyte *) (O->machine->mem) + var->address, 0, var->size); + _mesa_memset((GLubyte *) (O->machine->mem) + var->address, 0, + var->size); } - } - return 1; + } + return 1; } -static int parse_init_declarator_list (slang_parse_ctx *C, slang_output_ctx *O) +/** + * Parse a list of variable declarations. Each variable may have an + * initializer. + */ +static int +parse_init_declarator_list(slang_parse_ctx * C, slang_output_ctx * O) { - slang_fully_specified_type type; - - /* parse the fully specified type, common to all declarators */ - if (!slang_fully_specified_type_construct (&type)) - return 0; - if (!parse_fully_specified_type (C, O, &type)) - { - slang_fully_specified_type_destruct (&type); - return 0; - } - - /* parse declarators, pass-in the parsed type */ - do - { - if (!parse_init_declarator (C, O, &type)) - { - slang_fully_specified_type_destruct (&type); - return 0; - } - } - while (*C->I++ == DECLARATOR_NEXT); - - slang_fully_specified_type_destruct (&type); - return 1; + slang_fully_specified_type type; + + /* parse the fully specified type, common to all declarators */ + if (!slang_fully_specified_type_construct(&type)) + return 0; + if (!parse_fully_specified_type(C, O, &type)) { + slang_fully_specified_type_destruct(&type); + return 0; + } + + /* parse declarators, pass-in the parsed type */ + do { + if (!parse_init_declarator(C, O, &type)) { + slang_fully_specified_type_destruct(&type); + return 0; + } + } + while (*C->I++ == DECLARATOR_NEXT); + + slang_fully_specified_type_destruct(&type); + return 1; } -static int parse_function (slang_parse_ctx *C, slang_output_ctx *O, int definition, - slang_function **parsed_func_ret) + +/** + * Parse a function definition or declaration. + * \param C parsing context + * \param O output context + * \param definition if non-zero expect a definition, else a declaration + * \param parsed_func_ret returns the parsed function + * \return 1 if success, 0 if failure + */ +static int +parse_function(slang_parse_ctx * C, slang_output_ctx * O, int definition, + slang_function ** parsed_func_ret) { - slang_function parsed_func, *found_func; - - /* parse function definition/declaration */ - if (!slang_function_construct (&parsed_func)) - return 0; - if (definition) - { - if (!parse_function_definition (C, O, &parsed_func)) - { - slang_function_destruct (&parsed_func); - return 0; - } - } - else - { - if (!parse_function_prototype (C, O, &parsed_func)) - { - slang_function_destruct (&parsed_func); - return 0; - } - } - - /* find a function with a prototype matching the parsed one - only the current scope - * is being searched to allow built-in function overriding */ - found_func = slang_function_scope_find (O->funs, &parsed_func, 0); - if (found_func == NULL) - { - /* add the parsed function to the function list */ - O->funs->functions = (slang_function *) slang_alloc_realloc (O->funs->functions, - O->funs->num_functions * sizeof (slang_function), - (O->funs->num_functions + 1) * sizeof (slang_function)); - if (O->funs->functions == NULL) - { - slang_info_log_memory (C->L); - slang_function_destruct (&parsed_func); - return 0; - } - O->funs->functions[O->funs->num_functions] = parsed_func; - O->funs->num_functions++; - - /* return the newly parsed function */ - *parsed_func_ret = &O->funs->functions[O->funs->num_functions - 1]; - } - else - { - /* TODO: check function return type qualifiers and specifiers */ - if (definition) - { - if (found_func->body != NULL) - { - slang_info_log_error (C->L, "%s: function already has a body.", - slang_atom_pool_id (C->atoms, parsed_func.header.a_name)); - slang_function_destruct (&parsed_func); - return 0; - } - - /* destroy the existing function declaration and replace it with the new one, - * remember to save the fixup table */ - parsed_func.fixups = found_func->fixups; - slang_fixup_table_init (&found_func->fixups); - slang_function_destruct (found_func); - *found_func = parsed_func; - } - else - { - /* another declaration of the same function prototype - ignore it */ - slang_function_destruct (&parsed_func); - } - - /* return the found function */ - *parsed_func_ret = found_func; - } - - /* assemble the parsed function */ - { - slang_assemble_ctx A; - - A.file = O->assembly; - A.mach = O->machine; - A.atoms = C->atoms; - A.space.funcs = O->funs; - A.space.structs = O->structs; - A.space.vars = O->vars; - if (!_slang_assemble_function (&A, *parsed_func_ret)) - return 0; - } - return 1; + slang_function parsed_func, *found_func; + + /* parse function definition/declaration */ + if (!slang_function_construct(&parsed_func)) + return 0; + if (definition) { + if (!parse_function_definition(C, O, &parsed_func)) { + slang_function_destruct(&parsed_func); + return 0; + } + } + else { + if (!parse_function_prototype(C, O, &parsed_func)) { + slang_function_destruct(&parsed_func); + return 0; + } + } + + /* find a function with a prototype matching the parsed one - only + * the current scope is being searched to allow built-in function + * overriding + */ + found_func = slang_function_scope_find(O->funs, &parsed_func, 0); + if (found_func == NULL) { + /* add the parsed function to the function list */ + O->funs->functions = + (slang_function *) slang_alloc_realloc(O->funs->functions, + O->funs->num_functions * + sizeof(slang_function), + (O->funs->num_functions + + 1) * sizeof(slang_function)); + if (O->funs->functions == NULL) { + slang_info_log_memory(C->L); + slang_function_destruct(&parsed_func); + return 0; + } + O->funs->functions[O->funs->num_functions] = parsed_func; + O->funs->num_functions++; + + /* return the newly parsed function */ + *parsed_func_ret = &O->funs->functions[O->funs->num_functions - 1]; + } + else { + /* TODO: check function return type qualifiers and specifiers */ + if (definition) { + if (found_func->body != NULL) { + slang_info_log_error(C->L, "%s: function already has a body.", + slang_atom_pool_id(C->atoms, + parsed_func.header. + a_name)); + slang_function_destruct(&parsed_func); + return 0; + } + + /* destroy the existing function declaration and replace it + * with the new one, remember to save the fixup table + */ + parsed_func.fixups = found_func->fixups; + slang_fixup_table_init(&found_func->fixups); + slang_function_destruct(found_func); + *found_func = parsed_func; + } + else { + /* another declaration of the same function prototype - ignore it */ + slang_function_destruct(&parsed_func); + } + + /* return the found function */ + *parsed_func_ret = found_func; + } + + /* assemble the parsed function */ + { + slang_assemble_ctx A; + + A.file = O->assembly; + A.mach = O->machine; + A.atoms = C->atoms; + A.space.funcs = O->funs; + A.space.structs = O->structs; + A.space.vars = O->vars; + if (!_slang_assemble_function(&A, *parsed_func_ret)) + return 0; + } + return 1; } /* declaration */ #define DECLARATION_FUNCTION_PROTOTYPE 1 #define DECLARATION_INIT_DECLARATOR_LIST 2 -static int parse_declaration (slang_parse_ctx *C, slang_output_ctx *O) +static int +parse_declaration(slang_parse_ctx * C, slang_output_ctx * O) { - switch (*C->I++) - { - case DECLARATION_INIT_DECLARATOR_LIST: - if (!parse_init_declarator_list (C, O)) - return 0; - break; - case DECLARATION_FUNCTION_PROTOTYPE: - { - slang_function *dummy_func; - - if (!parse_function (C, O, 0, &dummy_func)) - return 0; - } - break; - default: - return 0; - } - return 1; + switch (*C->I++) { + case DECLARATION_INIT_DECLARATOR_LIST: + if (!parse_init_declarator_list(C, O)) + return 0; + break; + case DECLARATION_FUNCTION_PROTOTYPE: + { + slang_function *dummy_func; + + if (!parse_function(C, O, 0, &dummy_func)) + return 0; + } + break; + default: + return 0; + } + return 1; } /* external declaration */ @@ -1849,9 +1919,9 @@ static int parse_declaration (slang_parse_ctx *C, slang_output_ctx *O) #define EXTERNAL_DECLARATION 2 static GLboolean -parse_code_unit (slang_parse_ctx *C, slang_code_unit *unit) +parse_code_unit(slang_parse_ctx * C, slang_code_unit * unit) { - slang_output_ctx o; + slang_output_ctx o; /* setup output context */ o.funs = &unit->funs; @@ -1861,34 +1931,33 @@ parse_code_unit (slang_parse_ctx *C, slang_code_unit *unit) o.global_pool = &unit->object->varpool; o.machine = &unit->object->machine; - /* parse individual functions and declarations */ - while (*C->I != EXTERNAL_NULL) - { - switch (*C->I++) - { - case EXTERNAL_FUNCTION_DEFINITION: - { - slang_function *func; - - if (!parse_function (C, &o, 1, &func)) - return 0; - } - break; - case EXTERNAL_DECLARATION: - if (!parse_declaration (C, &o)) - return 0; - break; - default: - return 0; - } - } - C->I++; - return 1; + /* parse individual functions and declarations */ + while (*C->I != EXTERNAL_NULL) { + switch (*C->I++) { + case EXTERNAL_FUNCTION_DEFINITION: + { + slang_function *func; + + if (!parse_function(C, &o, 1, &func)) + return 0; + } + break; + case EXTERNAL_DECLARATION: + if (!parse_declaration(C, &o)) + return 0; + break; + default: + return 0; + } + } + C->I++; + return 1; } static GLboolean -compile_binary (const byte *prod, slang_code_unit *unit, slang_unit_type type, - slang_info_log *infolog, slang_code_unit *builtin, slang_code_unit *downlink) +compile_binary(const byte * prod, slang_code_unit * unit, + slang_unit_type type, slang_info_log * infolog, + slang_code_unit * builtin, slang_code_unit * downlink) { slang_parse_ctx C; @@ -1901,7 +1970,7 @@ compile_binary (const byte *prod, slang_code_unit *unit, slang_unit_type type, C.global_scope = GL_TRUE; C.atoms = &unit->object->atompool; - if (!check_revision (&C)) + if (!check_revision(&C)) return GL_FALSE; if (downlink != NULL) { @@ -1911,58 +1980,64 @@ compile_binary (const byte *prod, slang_code_unit *unit, slang_unit_type type, } /* parse translation unit */ - return parse_code_unit (&C, unit); + return parse_code_unit(&C, unit); } static GLboolean -compile_with_grammar (grammar id, const char *source, slang_code_unit *unit, slang_unit_type type, - slang_info_log *infolog, slang_code_unit *builtin) +compile_with_grammar(grammar id, const char *source, slang_code_unit * unit, + slang_unit_type type, slang_info_log * infolog, + slang_code_unit * builtin) { byte *prod; GLuint size, start, version; slang_string preprocessed; /* First retrieve the version number. */ - if (!_slang_preprocess_version (source, &version, &start, infolog)) + if (!_slang_preprocess_version(source, &version, &start, infolog)) return GL_FALSE; if (version > 110) { - slang_info_log_error (infolog, "language version specified is not supported."); + slang_info_log_error(infolog, + "language version specified is not supported."); return GL_FALSE; } /* Now preprocess the source string. */ - slang_string_init (&preprocessed); - if (!_slang_preprocess_directives (&preprocessed, &source[start], infolog)) { - slang_string_free (&preprocessed); - slang_info_log_error (infolog, "failed to preprocess the source."); + slang_string_init(&preprocessed); + if (!_slang_preprocess_directives(&preprocessed, &source[start], infolog)) { + slang_string_free(&preprocessed); + slang_info_log_error(infolog, "failed to preprocess the source."); return GL_FALSE; } /* Finally check the syntax and generate its binary representation. */ - if (!grammar_fast_check (id, (const byte *) (slang_string_cstr (&preprocessed)), &prod, &size, 65536)) { + if (!grammar_fast_check + (id, (const byte *) (slang_string_cstr(&preprocessed)), &prod, &size, + 65536)) { char buf[1024]; GLint pos; - slang_string_free (&preprocessed); - grammar_get_last_error ((byte *) (buf), sizeof (buf), &pos); - slang_info_log_error (infolog, buf); + slang_string_free(&preprocessed); + grammar_get_last_error((byte *) (buf), sizeof(buf), &pos); + slang_info_log_error(infolog, buf); return GL_FALSE; } - slang_string_free (&preprocessed); + slang_string_free(&preprocessed); /* Syntax is okay - translate it to internal representation. */ - if (!compile_binary (prod, unit, type, infolog, builtin, &builtin[SLANG_BUILTIN_TOTAL - 1])) { - grammar_alloc_free (prod); + if (!compile_binary + (prod, unit, type, infolog, builtin, + &builtin[SLANG_BUILTIN_TOTAL - 1])) { + grammar_alloc_free(prod); return GL_FALSE; } - grammar_alloc_free (prod); + grammar_alloc_free(prod); return GL_TRUE; } -static const char *slang_shader_syn = +LONGSTRING static const char *slang_shader_syn = #include "library/slang_shader_syn.h" -; + ; static const byte slang_core_gc[] = { #include "library/slang_core_gc.h" @@ -1987,106 +2062,111 @@ static const byte slang_builtin_vec4_gc[] = { #endif static GLboolean -compile_object (grammar *id, const char *source, slang_code_object *object, slang_unit_type type, - slang_info_log *infolog) +compile_object(grammar * id, const char *source, slang_code_object * object, + slang_unit_type type, slang_info_log * infolog) { slang_code_unit *builtins = NULL; /* load GLSL grammar */ - *id = grammar_load_from_text ((const byte *) (slang_shader_syn)); - if (*id == 0) - { - byte buf[1024]; - int pos; - - grammar_get_last_error (buf, 1024, &pos); - slang_info_log_error (infolog, (const char *) (buf)); + *id = grammar_load_from_text((const byte *) (slang_shader_syn)); + if (*id == 0) { + byte buf[1024]; + int pos; + + grammar_get_last_error(buf, 1024, &pos); + slang_info_log_error(infolog, (const char *) (buf)); return GL_FALSE; - } - - /* set shader type - the syntax is slightly different for different shaders */ - if (type == slang_unit_fragment_shader || type == slang_unit_fragment_builtin) - grammar_set_reg8 (*id, (const byte *) "shader_type", 1); - else - grammar_set_reg8 (*id, (const byte *) "shader_type", 2); - - /* enable language extensions */ - grammar_set_reg8 (*id, (const byte *) "parsing_builtin", 1); - - /* if parsing user-specified shader, load built-in library */ - if (type == slang_unit_fragment_shader || type == slang_unit_vertex_shader) - { - /* compile core functionality first */ - if (!compile_binary (slang_core_gc, &object->builtin[SLANG_BUILTIN_CORE], - slang_unit_fragment_builtin, infolog, NULL, NULL)) + } + + /* set shader type - the syntax is slightly different for different shaders */ + if (type == slang_unit_fragment_shader + || type == slang_unit_fragment_builtin) + grammar_set_reg8(*id, (const byte *) "shader_type", 1); + else + grammar_set_reg8(*id, (const byte *) "shader_type", 2); + + /* enable language extensions */ + grammar_set_reg8(*id, (const byte *) "parsing_builtin", 1); + + /* if parsing user-specified shader, load built-in library */ + if (type == slang_unit_fragment_shader || type == slang_unit_vertex_shader) { + /* compile core functionality first */ + if (!compile_binary(slang_core_gc, &object->builtin[SLANG_BUILTIN_CORE], + slang_unit_fragment_builtin, infolog, NULL, NULL)) return GL_FALSE; - /* compile common functions and variables, link to core */ - if (!compile_binary (slang_common_builtin_gc, &object->builtin[SLANG_BUILTIN_COMMON], - slang_unit_fragment_builtin, infolog, NULL, - &object->builtin[SLANG_BUILTIN_CORE])) + /* compile common functions and variables, link to core */ + if (!compile_binary + (slang_common_builtin_gc, &object->builtin[SLANG_BUILTIN_COMMON], + slang_unit_fragment_builtin, infolog, NULL, + &object->builtin[SLANG_BUILTIN_CORE])) return GL_FALSE; - /* compile target-specific functions and variables, link to common */ - if (type == slang_unit_fragment_shader) - { - if (!compile_binary (slang_fragment_builtin_gc, &object->builtin[SLANG_BUILTIN_TARGET], - slang_unit_fragment_builtin, infolog, NULL, - &object->builtin[SLANG_BUILTIN_COMMON])) + /* compile target-specific functions and variables, link to common */ + if (type == slang_unit_fragment_shader) { + if (!compile_binary + (slang_fragment_builtin_gc, + &object->builtin[SLANG_BUILTIN_TARGET], + slang_unit_fragment_builtin, infolog, NULL, + &object->builtin[SLANG_BUILTIN_COMMON])) return GL_FALSE; - } - else if (type == slang_unit_vertex_shader) - { - if (!compile_binary (slang_vertex_builtin_gc, &object->builtin[SLANG_BUILTIN_TARGET], - slang_unit_vertex_builtin, infolog, NULL, - &object->builtin[SLANG_BUILTIN_COMMON])) + } + else if (type == slang_unit_vertex_shader) { + if (!compile_binary + (slang_vertex_builtin_gc, &object->builtin[SLANG_BUILTIN_TARGET], + slang_unit_vertex_builtin, infolog, NULL, + &object->builtin[SLANG_BUILTIN_COMMON])) return GL_FALSE; - } + } #if defined(USE_X86_ASM) || defined(SLANG_X86) /* compile x86 4-component vector overrides, link to target */ - if (!compile_binary (slang_builtin_vec4_gc, &object->builtin[SLANG_BUILTIN_VEC4], - slang_unit_fragment_builtin, infolog, NULL, - &object->builtin[SLANG_BUILTIN_TARGET])) + if (!compile_binary + (slang_builtin_vec4_gc, &object->builtin[SLANG_BUILTIN_VEC4], + slang_unit_fragment_builtin, infolog, NULL, + &object->builtin[SLANG_BUILTIN_TARGET])) return GL_FALSE; #endif - /* disable language extensions */ - grammar_set_reg8 (*id, (const byte *) "parsing_builtin", 0); + /* disable language extensions */ + grammar_set_reg8(*id, (const byte *) "parsing_builtin", 0); builtins = object->builtin; - } + } - /* compile the actual shader - pass-in built-in library for external shader */ - return compile_with_grammar (*id, source, &object->unit, type, infolog, builtins); + /* compile the actual shader - pass-in built-in library for external shader */ + return compile_with_grammar(*id, source, &object->unit, type, infolog, + builtins); } GLboolean -_slang_compile (const char *source, slang_code_object *object, slang_unit_type type, - slang_info_log *infolog) +_slang_compile(const char *source, slang_code_object * object, + slang_unit_type type, slang_info_log * infolog) { GLboolean success; grammar id = 0; - _slang_code_object_dtr (object); - _slang_code_object_ctr (object); + _slang_code_object_dtr(object); + _slang_code_object_ctr(object); - success = compile_object (&id, source, object, type, infolog); + success = compile_object(&id, source, object, type, infolog); if (id != 0) - grammar_destroy (id); + grammar_destroy(id); if (!success) return GL_FALSE; - if (!_slang_build_export_data_table (&object->expdata, &object->unit.vars)) + if (!_slang_build_export_data_table(&object->expdata, &object->unit.vars)) return GL_FALSE; - if (!_slang_build_export_code_table (&object->expcode, &object->unit.funs, &object->unit)) + if (!_slang_build_export_code_table + (&object->expcode, &object->unit.funs, &object->unit)) return GL_FALSE; #if defined(USE_X86_ASM) || defined(SLANG_X86) /* XXX: lookup the @main label */ - if (!_slang_x86_codegen (&object->machine, &object->assembly, object->expcode.entries[0].address)) + if (!_slang_x86_codegen + (&object->machine, &object->assembly, + object->expcode.entries[0].address)) return GL_FALSE; #endif return GL_TRUE; } - diff --git a/src/mesa/shader/slang/slang_compile_function.c b/src/mesa/shader/slang/slang_compile_function.c index eb8fd1bd40f..e6e0d89ddb6 100644 --- a/src/mesa/shader/slang/slang_compile_function.c +++ b/src/mesa/shader/slang/slang_compile_function.c @@ -33,50 +33,74 @@ /* slang_fixup_table */ -void slang_fixup_table_init (slang_fixup_table *fix) +void +slang_fixup_table_init(slang_fixup_table * fix) { - fix->table = NULL; - fix->count = 0; + fix->table = NULL; + fix->count = 0; } -void slang_fixup_table_free (slang_fixup_table *fix) +void +slang_fixup_table_free(slang_fixup_table * fix) { - slang_alloc_free (fix->table); - slang_fixup_table_init (fix); + slang_alloc_free(fix->table); + slang_fixup_table_init(fix); } +/** + * Add a new fixup address to the table. + */ +GLboolean +slang_fixup_save(slang_fixup_table *fixups, GLuint address) +{ + fixups->table = (GLuint *) + slang_alloc_realloc(fixups->table, + fixups->count * sizeof(GLuint), + (fixups->count + 1) * sizeof(GLuint)); + if (fixups->table == NULL) + return GL_FALSE; + fixups->table[fixups->count] = address; + fixups->count++; + return GL_TRUE; +} + + + /* slang_function */ -int slang_function_construct (slang_function *func) +int +slang_function_construct(slang_function * func) { - func->kind = slang_func_ordinary; - if (!slang_variable_construct (&func->header)) - return 0; - func->parameters = (slang_variable_scope *) slang_alloc_malloc (sizeof (slang_variable_scope)); - if (func->parameters == NULL) - { - slang_variable_destruct (&func->header); - return 0; - } - _slang_variable_scope_ctr (func->parameters); - func->param_count = 0; - func->body = NULL; - func->address = ~0; - slang_fixup_table_init (&func->fixups); - return 1; + func->kind = slang_func_ordinary; + if (!slang_variable_construct(&func->header)) + return 0; + + func->parameters = (slang_variable_scope *) + slang_alloc_malloc(sizeof(slang_variable_scope)); + if (func->parameters == NULL) { + slang_variable_destruct(&func->header); + return 0; + } + + _slang_variable_scope_ctr(func->parameters); + func->param_count = 0; + func->body = NULL; + func->address = ~0; + slang_fixup_table_init(&func->fixups); + return 1; } -void slang_function_destruct (slang_function *func) +void +slang_function_destruct(slang_function * func) { - slang_variable_destruct (&func->header); - slang_variable_scope_destruct (func->parameters); - slang_alloc_free (func->parameters); - if (func->body != NULL) - { - slang_operation_destruct (func->body); - slang_alloc_free (func->body); - } - slang_fixup_table_free (&func->fixups); + slang_variable_destruct(&func->header); + slang_variable_scope_destruct(func->parameters); + slang_alloc_free(func->parameters); + if (func->body != NULL) { + slang_operation_destruct(func->body); + slang_alloc_free(func->body); + } + slang_fixup_table_free(&func->fixups); } /* @@ -84,60 +108,82 @@ void slang_function_destruct (slang_function *func) */ GLvoid -_slang_function_scope_ctr (slang_function_scope *self) +_slang_function_scope_ctr(slang_function_scope * self) { self->functions = NULL; self->num_functions = 0; self->outer_scope = NULL; } -void slang_function_scope_destruct (slang_function_scope *scope) +void +slang_function_scope_destruct(slang_function_scope * scope) { - unsigned int i; + unsigned int i; - for (i = 0; i < scope->num_functions; i++) - slang_function_destruct (scope->functions + i); - slang_alloc_free (scope->functions); + for (i = 0; i < scope->num_functions; i++) + slang_function_destruct(scope->functions + i); + slang_alloc_free(scope->functions); } -int slang_function_scope_find_by_name (slang_function_scope *funcs, slang_atom a_name, int all_scopes) + +/** + * Search a list of functions for a particular function by name. + * \param funcs the list of functions to search + * \param a_name the name to search for + * \param all_scopes if non-zero, search containing scopes too. + * \return pointer to found function, or NULL. + */ +int +slang_function_scope_find_by_name(slang_function_scope * funcs, + slang_atom a_name, int all_scopes) { - unsigned int i; - - for (i = 0; i < funcs->num_functions; i++) - if (a_name == funcs->functions[i].header.a_name) - return 1; - if (all_scopes && funcs->outer_scope != NULL) - return slang_function_scope_find_by_name (funcs->outer_scope, a_name, 1); - return 0; + unsigned int i; + + for (i = 0; i < funcs->num_functions; i++) + if (a_name == funcs->functions[i].header.a_name) + return 1; + if (all_scopes && funcs->outer_scope != NULL) + return slang_function_scope_find_by_name(funcs->outer_scope, a_name, 1); + return 0; } -slang_function *slang_function_scope_find (slang_function_scope *funcs, slang_function *fun, - int all_scopes) + +/** + * Search a list of functions for a particular function (for implementing + * function calls. Matching is done by first comparing the function's name, + * then the function's parameter list. + * + * \param funcs the list of functions to search + * \param fun the function to search for + * \param all_scopes if non-zero, search containing scopes too. + * \return pointer to found function, or NULL. + */ +slang_function * +slang_function_scope_find(slang_function_scope * funcs, slang_function * fun, + int all_scopes) { - unsigned int i; - - for (i = 0; i < funcs->num_functions; i++) - { - slang_function *f = &funcs->functions[i]; - unsigned int j; - - if (fun->header.a_name != f->header.a_name) - continue; - if (fun->param_count != f->param_count) - continue; - for (j = 0; j < fun->param_count; j++) - { - if (!slang_type_specifier_equal (&fun->parameters->variables[j].type.specifier, - &f->parameters->variables[j].type.specifier)) - break; - } - if (j == fun->param_count) - return f; - } - if (all_scopes && funcs->outer_scope != NULL) - return slang_function_scope_find (funcs->outer_scope, fun, 1); - return NULL; + unsigned int i; + + for (i = 0; i < funcs->num_functions; i++) { + slang_function *f = &funcs->functions[i]; + unsigned int j; + + if (fun->header.a_name != f->header.a_name) + continue; + if (fun->param_count != f->param_count) + continue; + for (j = 0; j < fun->param_count; j++) { + if (!slang_type_specifier_equal + (&fun->parameters->variables[j].type.specifier, + &f->parameters->variables[j].type.specifier)) + break; + } + if (j == fun->param_count) + return f; + } + if (all_scopes && funcs->outer_scope != NULL) + return slang_function_scope_find(funcs->outer_scope, fun, 1); + return NULL; } /* @@ -145,31 +191,30 @@ slang_function *slang_function_scope_find (slang_function_scope *funcs, slang_fu */ GLboolean -_slang_build_export_code_table (slang_export_code_table *tbl, slang_function_scope *funs, - slang_code_unit *unit) +_slang_build_export_code_table(slang_export_code_table * tbl, + slang_function_scope * funs, + slang_code_unit * unit) { - slang_atom mainAtom; - GLuint i; - - mainAtom = slang_atom_pool_atom (tbl->atoms, "main"); - if (mainAtom == SLANG_ATOM_NULL) - return GL_FALSE; - - for (i = 0; i < funs->num_functions; i++) - { - if (funs->functions[i].header.a_name == mainAtom) - { - slang_function *fun = &funs->functions[i]; - slang_export_code_entry *e; - slang_assemble_ctx A; - - e = slang_export_code_table_add (tbl); - if (e == NULL) - return GL_FALSE; + slang_atom mainAtom; + GLuint i; + + mainAtom = slang_atom_pool_atom(tbl->atoms, "main"); + if (mainAtom == SLANG_ATOM_NULL) + return GL_FALSE; + + for (i = 0; i < funs->num_functions; i++) { + if (funs->functions[i].header.a_name == mainAtom) { + slang_function *fun = &funs->functions[i]; + slang_export_code_entry *e; + slang_assemble_ctx A; + + e = slang_export_code_table_add(tbl); + if (e == NULL) + return GL_FALSE; e->address = unit->object->assembly.count; - e->name = slang_atom_pool_atom (tbl->atoms, "@main"); - if (e->name == SLANG_ATOM_NULL) - return GL_FALSE; + e->name = slang_atom_pool_atom(tbl->atoms, "@main"); + if (e->name == SLANG_ATOM_NULL) + return GL_FALSE; A.file = &unit->object->assembly; A.mach = &unit->object->machine; @@ -177,12 +222,13 @@ _slang_build_export_code_table (slang_export_code_table *tbl, slang_function_sco A.space.funcs = &unit->funs; A.space.structs = &unit->structs; A.space.vars = &unit->vars; - slang_assembly_file_push_label (&unit->object->assembly, slang_asm_local_alloc, 20); - slang_assembly_file_push_label (&unit->object->assembly, slang_asm_enter, 20); - _slang_assemble_function_call (&A, fun, NULL, 0, GL_FALSE); - slang_assembly_file_push (&unit->object->assembly, slang_asm_exit); - } - } - return GL_TRUE; + slang_assembly_file_push_label(&unit->object->assembly, + slang_asm_local_alloc, 20); + slang_assembly_file_push_label(&unit->object->assembly, + slang_asm_enter, 20); + _slang_assemble_function_call(&A, fun, NULL, 0, GL_FALSE); + slang_assembly_file_push(&unit->object->assembly, slang_asm_exit); + } + } + return GL_TRUE; } - diff --git a/src/mesa/shader/slang/slang_compile_function.h b/src/mesa/shader/slang/slang_compile_function.h index 24bc0d6ffd1..8835544bf38 100644 --- a/src/mesa/shader/slang/slang_compile_function.h +++ b/src/mesa/shader/slang/slang_compile_function.h @@ -31,53 +31,77 @@ extern "C" { struct slang_code_unit_; +/** + * Types of functions. + */ typedef enum slang_function_kind_ { - slang_func_ordinary, - slang_func_constructor, - slang_func_operator + slang_func_ordinary, + slang_func_constructor, + slang_func_operator } slang_function_kind; + +/** + * When we need to fill in addresses which we won't know until the future, + * we keep track of them with a fix-up table. + */ typedef struct slang_fixup_table_ { - GLuint *table; - GLuint count; + GLuint *table; /**< array[count] of addresses */ + GLuint count; } slang_fixup_table; -void slang_fixup_table_init (slang_fixup_table *); -void slang_fixup_table_free (slang_fixup_table *); +extern void slang_fixup_table_init(slang_fixup_table *); +extern void slang_fixup_table_free(slang_fixup_table *); +extern GLboolean slang_fixup_save(slang_fixup_table *fixups, GLuint address); + +/** + * Description of a compiled shader function. + */ typedef struct slang_function_ { - slang_function_kind kind; - slang_variable header; - slang_variable_scope *parameters; - unsigned int param_count; - slang_operation *body; - unsigned int address; - slang_fixup_table fixups; + slang_function_kind kind; + slang_variable header; + slang_variable_scope *parameters; + unsigned int param_count; + slang_operation *body; /**< The instruction tree */ + unsigned int address; + slang_fixup_table fixups; } slang_function; -int slang_function_construct (slang_function *); -void slang_function_destruct (slang_function *); +extern int slang_function_construct(slang_function *); +extern void slang_function_destruct(slang_function *); + +/** + * Basically, a list of compiled functions. + */ typedef struct slang_function_scope_ { - slang_function *functions; + slang_function *functions; GLuint num_functions; - struct slang_function_scope_ *outer_scope; + struct slang_function_scope_ *outer_scope; } slang_function_scope; + extern GLvoid -_slang_function_scope_ctr (slang_function_scope *); +_slang_function_scope_ctr(slang_function_scope *); + +extern void +slang_function_scope_destruct(slang_function_scope *); -void slang_function_scope_destruct (slang_function_scope *); -int slang_function_scope_find_by_name (slang_function_scope *, slang_atom, int); -slang_function *slang_function_scope_find (slang_function_scope *, slang_function *, int); +extern int +slang_function_scope_find_by_name(slang_function_scope *, slang_atom, int); + +extern slang_function * +slang_function_scope_find(slang_function_scope *, slang_function *, int); extern GLboolean -_slang_build_export_code_table (slang_export_code_table *, slang_function_scope *, - struct slang_code_unit_ *); +_slang_build_export_code_table(slang_export_code_table *, slang_function_scope *, + struct slang_code_unit_ *); + #ifdef __cplusplus } diff --git a/src/mesa/shader/slang/slang_compile_operation.h b/src/mesa/shader/slang/slang_compile_operation.h index d9bce36b9bd..f5fee1e50e6 100644 --- a/src/mesa/shader/slang/slang_compile_operation.h +++ b/src/mesa/shader/slang/slang_compile_operation.h @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.5 + * Version: 6.5.2 * * Copyright (C) 2005-2006 Brian Paul All Rights Reserved. * @@ -29,85 +29,97 @@ extern "C" { #endif +/** + * Types of slang operations. + * These are the basic intermediate code representations. + * [foo] indicates a sub-tree or reference to another type of node + */ typedef enum slang_operation_type_ { slang_oper_none, - slang_oper_block_no_new_scope, - slang_oper_block_new_scope, - slang_oper_variable_decl, + slang_oper_block_no_new_scope, /* "{" sequence "}" */ + slang_oper_block_new_scope, /* "{" sequence "}" */ + slang_oper_variable_decl, /* [type] [var] or [var] = [expr] */ slang_oper_asm, - slang_oper_break, - slang_oper_continue, - slang_oper_discard, - slang_oper_return, - slang_oper_expression, - slang_oper_if, - slang_oper_while, - slang_oper_do, - slang_oper_for, - slang_oper_void, - slang_oper_literal_bool, - slang_oper_literal_int, - slang_oper_literal_float, - slang_oper_identifier, - slang_oper_sequence, - slang_oper_assign, - slang_oper_addassign, - slang_oper_subassign, - slang_oper_mulassign, - slang_oper_divassign, + slang_oper_break, /* "break" statement */ + slang_oper_continue, /* "continue" statement */ + slang_oper_discard, /* "discard" (kill fragment) statement */ + slang_oper_return, /* "return" [expr] */ + slang_oper_expression, /* [expr] */ + slang_oper_if, /* "if" [0] then [1] else [2] */ + slang_oper_while, /* "while" [cond] [body] */ + slang_oper_do, /* "do" [body] "while" [cond] */ + slang_oper_for, /* "for" [init] [while] [incr] [body] */ + slang_oper_void, /* nop */ + slang_oper_literal_bool, /* "true" or "false" */ + slang_oper_literal_int, /* integer literal */ + slang_oper_literal_float, /* float literal */ + slang_oper_identifier, /* var name, func name, etc */ + slang_oper_sequence, /* [expr] "," [expr] "," etc */ + slang_oper_assign, /* [var] "=" [expr] */ + slang_oper_addassign, /* [var] "+=" [expr] */ + slang_oper_subassign, /* [var] "-=" [expr] */ + slang_oper_mulassign, /* [var] "*=" [expr] */ + slang_oper_divassign, /* [var] "/=" [expr] */ /*slang_oper_modassign,*/ /*slang_oper_lshassign,*/ /*slang_oper_rshassign,*/ /*slang_oper_orassign,*/ /*slang_oper_xorassign,*/ /*slang_oper_andassign,*/ - slang_oper_select, - slang_oper_logicalor, - slang_oper_logicalxor, - slang_oper_logicaland, + slang_oper_select, /* [expr] "?" [expr] ":" [expr] */ + slang_oper_logicalor, /* [expr] "||" [expr] */ + slang_oper_logicalxor, /* [expr] "^^" [expr] */ + slang_oper_logicaland, /* [expr] "&&" [expr] */ /*slang_oper_bitor,*/ /*slang_oper_bitxor,*/ /*slang_oper_bitand,*/ - slang_oper_equal, - slang_oper_notequal, - slang_oper_less, - slang_oper_greater, - slang_oper_lessequal, - slang_oper_greaterequal, + slang_oper_equal, /* [expr] "==" [expr] */ + slang_oper_notequal, /* [expr] "!=" [expr] */ + slang_oper_less, /* [expr] "<" [expr] */ + slang_oper_greater, /* [expr] ">" [expr] */ + slang_oper_lessequal, /* [expr] "<=" [expr] */ + slang_oper_greaterequal, /* [expr] ">=" [expr] */ /*slang_oper_lshift,*/ /*slang_oper_rshift,*/ - slang_oper_add, - slang_oper_subtract, - slang_oper_multiply, - slang_oper_divide, + slang_oper_add, /* [expr] "+" [expr] */ + slang_oper_subtract, /* [expr] "-" [expr] */ + slang_oper_multiply, /* [expr] "*" [expr] */ + slang_oper_divide, /* [expr] "/" [expr] */ /*slang_oper_modulus,*/ - slang_oper_preincrement, - slang_oper_predecrement, - slang_oper_plus, - slang_oper_minus, + slang_oper_preincrement, /* "++" [var] */ + slang_oper_predecrement, /* "--" [var] */ + slang_oper_plus, /* "-" [expr] */ + slang_oper_minus, /* "+" [expr] */ /*slang_oper_complement,*/ - slang_oper_not, - slang_oper_subscript, - slang_oper_call, - slang_oper_field, - slang_oper_postincrement, - slang_oper_postdecrement + slang_oper_not, /* "!" [expr] */ + slang_oper_subscript, /* [expr] "[" [expr] "]" */ + slang_oper_call, /* [func name] [param] [param] [...] */ + slang_oper_field, /* i.e.: ".next" or ".xzy" or ".xxx" etc */ + slang_oper_postincrement, /* [var] "++" */ + slang_oper_postdecrement /* [var] "--" */ } slang_operation_type; + +/** + * A slang_operation is basically a compiled instruction (such as assignment, + * a while-loop, a conditiona, a function call, etc). + */ typedef struct slang_operation_ { slang_operation_type type; struct slang_operation_ *children; unsigned int num_children; - float literal; /* type: bool, literal_int, literal_float */ - slang_atom a_id; /* type: asm, identifier, call, field */ - slang_variable_scope *locals; + float literal; /**< Used for float, int and bool values */ + slang_atom a_id; /**< type: asm, identifier, call, field */ + slang_variable_scope *locals; /**< local vars for scope */ } slang_operation; -int slang_operation_construct (slang_operation *); -void slang_operation_destruct (slang_operation *); -int slang_operation_copy (slang_operation *, const slang_operation *); + +extern int slang_operation_construct (slang_operation *); +extern void slang_operation_destruct (slang_operation *); +extern int slang_operation_copy (slang_operation *, const slang_operation *); + #ifdef __cplusplus } diff --git a/src/mesa/shader/slang/slang_compile_variable.c b/src/mesa/shader/slang/slang_compile_variable.c index b62743addb0..679d93b951a 100644 --- a/src/mesa/shader/slang/slang_compile_variable.c +++ b/src/mesa/shader/slang/slang_compile_variable.c @@ -183,7 +183,7 @@ int slang_variable_construct (slang_variable *var) var->initializer = NULL; var->address = ~0; var->size = 0; - var->global = 0; + var->global = GL_FALSE; return 1; } diff --git a/src/mesa/shader/slang/slang_compile_variable.h b/src/mesa/shader/slang/slang_compile_variable.h index 6b9679a3b75..3b6e1987c82 100644 --- a/src/mesa/shader/slang/slang_compile_variable.h +++ b/src/mesa/shader/slang/slang_compile_variable.h @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.5 + * Version: 6.5.2 * * Copyright (C) 2005-2006 Brian Paul All Rights Reserved. * @@ -29,67 +29,95 @@ extern "C" { #endif + typedef enum slang_type_qualifier_ { - slang_qual_none, - slang_qual_const, - slang_qual_attribute, - slang_qual_varying, - slang_qual_uniform, - slang_qual_out, - slang_qual_inout, - slang_qual_fixedoutput, /* internal */ - slang_qual_fixedinput /* internal */ + slang_qual_none, + slang_qual_const, + slang_qual_attribute, + slang_qual_varying, + slang_qual_uniform, + slang_qual_out, + slang_qual_inout, + slang_qual_fixedoutput, /* internal */ + slang_qual_fixedinput /* internal */ } slang_type_qualifier; -slang_type_specifier_type slang_type_specifier_type_from_string (const char *); -const char *slang_type_specifier_type_to_string (slang_type_specifier_type); +extern slang_type_specifier_type +slang_type_specifier_type_from_string(const char *); + +extern const char * +slang_type_specifier_type_to_string(slang_type_specifier_type); + + typedef struct slang_fully_specified_type_ { - slang_type_qualifier qualifier; - slang_type_specifier specifier; + slang_type_qualifier qualifier; + slang_type_specifier specifier; } slang_fully_specified_type; -int slang_fully_specified_type_construct (slang_fully_specified_type *); -void slang_fully_specified_type_destruct (slang_fully_specified_type *); -int slang_fully_specified_type_copy (slang_fully_specified_type *, const slang_fully_specified_type *); +extern int +slang_fully_specified_type_construct(slang_fully_specified_type *); + +extern void +slang_fully_specified_type_destruct(slang_fully_specified_type *); + +extern int +slang_fully_specified_type_copy(slang_fully_specified_type *, + const slang_fully_specified_type *); + typedef struct slang_variable_scope_ { - struct slang_variable_ *variables; + struct slang_variable_ *variables; GLuint num_variables; - struct slang_variable_scope_ *outer_scope; + struct slang_variable_scope_ *outer_scope; } slang_variable_scope; extern GLvoid -_slang_variable_scope_ctr (slang_variable_scope *); +_slang_variable_scope_ctr(slang_variable_scope *); + +extern void +slang_variable_scope_destruct(slang_variable_scope *); + +extern int +slang_variable_scope_copy(slang_variable_scope *, + const slang_variable_scope *); -void slang_variable_scope_destruct (slang_variable_scope *); -int slang_variable_scope_copy (slang_variable_scope *, const slang_variable_scope *); typedef struct slang_variable_ { - slang_fully_specified_type type; - slang_atom a_name; - GLuint array_len; /* type: spec_array */ - struct slang_operation_ *initializer; - unsigned int address; - unsigned int size; - int global; + slang_fully_specified_type type; + slang_atom a_name; + GLuint array_len; /* type: spec_array */ + struct slang_operation_ *initializer; + unsigned int address; + unsigned int size; + GLboolean global; } slang_variable; -int slang_variable_construct (slang_variable *); -void slang_variable_destruct (slang_variable *); -int slang_variable_copy (slang_variable *, const slang_variable *); -slang_variable *_slang_locate_variable (slang_variable_scope *, slang_atom a_name, GLboolean all); +extern int +slang_variable_construct(slang_variable *); + +extern void +slang_variable_destruct(slang_variable *); + +extern int +slang_variable_copy(slang_variable *, const slang_variable *); + +extern slang_variable * +_slang_locate_variable(slang_variable_scope *, slang_atom a_name, + GLboolean all); + +extern GLboolean +_slang_build_export_data_table(slang_export_data_table *, + slang_variable_scope *); -GLboolean _slang_build_export_data_table (slang_export_data_table *, slang_variable_scope *); #ifdef __cplusplus } #endif #endif - diff --git a/src/mesa/shader/slang/slang_execute.c b/src/mesa/shader/slang/slang_execute.c index 98bfd896c4e..e469de02075 100644 --- a/src/mesa/shader/slang/slang_execute.c +++ b/src/mesa/shader/slang/slang_execute.c @@ -36,571 +36,625 @@ #define DEBUG_SLANG 0 -GLvoid slang_machine_ctr (slang_machine *self) +GLvoid +slang_machine_ctr(slang_machine * self) { - slang_machine_init (self); + slang_machine_init(self); self->infolog = NULL; #if defined(USE_X86_ASM) || defined(SLANG_X86) - self->x86.compiled_func = NULL; + self->x86.compiled_func = NULL; #endif } -GLvoid slang_machine_dtr (slang_machine *self) +GLvoid +slang_machine_dtr(slang_machine * self) { if (self->infolog != NULL) { - slang_info_log_destruct (self->infolog); - slang_alloc_free (self->infolog); + slang_info_log_destruct(self->infolog); + slang_alloc_free(self->infolog); } #if defined(USE_X86_ASM) || defined(SLANG_X86) - if (self->x86.compiled_func != NULL) - _mesa_exec_free (self->x86.compiled_func); + if (self->x86.compiled_func != NULL) + _mesa_exec_free(self->x86.compiled_func); #endif } -void slang_machine_init (slang_machine *mach) + +/** + * Initialize the shader virtual machine. + * NOTE: stack grows downward in memory. + */ +void +slang_machine_init(slang_machine * mach) { - mach->ip = 0; - mach->sp = SLANG_MACHINE_STACK_SIZE; - mach->bp = 0; - mach->kill = 0; - mach->exit = 0; + mach->ip = 0; + mach->sp = SLANG_MACHINE_STACK_SIZE; + mach->bp = 0; + mach->kill = GL_FALSE; + mach->exit = GL_FALSE; } #if DEBUG_SLANG -static void dump_instruction (FILE *f, slang_assembly *a, unsigned int i) +static void +dump_instruction(FILE * f, slang_assembly * a, unsigned int i) { - fprintf (f, "%.5u:\t", i); - - switch (a->type) - { - /* core */ - case slang_asm_none: - fprintf (f, "none"); - break; - case slang_asm_float_copy: - fprintf (f, "float_copy\t%d, %d", a->param[0], a->param[1]); - break; - case slang_asm_float_move: - fprintf (f, "float_move\t%d, %d", a->param[0], a->param[1]); - break; - case slang_asm_float_push: - fprintf (f, "float_push\t%f", a->literal); - break; - case slang_asm_float_deref: - fprintf (f, "float_deref"); - break; - case slang_asm_float_add: - fprintf (f, "float_add"); - break; - case slang_asm_float_multiply: - fprintf (f, "float_multiply"); - break; - case slang_asm_float_divide: - fprintf (f, "float_divide"); - break; - case slang_asm_float_negate: - fprintf (f, "float_negate"); - break; - case slang_asm_float_less: - fprintf (f, "float_less"); - break; - case slang_asm_float_equal_exp: - fprintf (f, "float_equal"); - break; - case slang_asm_float_equal_int: - fprintf (f, "float_equal\t%d, %d", a->param[0], a->param[1]); - break; - case slang_asm_float_to_int: - fprintf (f, "float_to_int"); - break; - case slang_asm_float_sine: - fprintf (f, "float_sine"); - break; - case slang_asm_float_arcsine: - fprintf (f, "float_arcsine"); - break; - case slang_asm_float_arctan: - fprintf (f, "float_arctan"); - break; - case slang_asm_float_power: - fprintf (f, "float_power"); - break; - case slang_asm_float_log2: - fprintf (f, "float_log2"); - break; - case slang_asm_float_floor: - fprintf (f, "float_floor"); - break; - case slang_asm_float_ceil: - fprintf (f, "float_ceil"); - break; - case slang_asm_float_noise1: - fprintf (f, "float_noise1"); - break; - case slang_asm_float_noise2: - fprintf (f, "float_noise2"); - break; - case slang_asm_float_noise3: - fprintf (f, "float_noise3"); - break; - case slang_asm_float_noise4: - fprintf (f, "float_noise4"); - break; - case slang_asm_int_copy: - fprintf (f, "int_copy\t%d, %d", a->param[0], a->param[1]); - break; - case slang_asm_int_move: - fprintf (f, "int_move\t%d, %d", a->param[0], a->param[1]); - break; - case slang_asm_int_push: - fprintf (f, "int_push\t%d", (GLint) a->literal); - break; - case slang_asm_int_deref: - fprintf (f, "int_deref"); - break; - case slang_asm_int_to_float: - fprintf (f, "int_to_float"); - break; - case slang_asm_int_to_addr: - fprintf (f, "int_to_addr"); - break; - case slang_asm_bool_copy: - fprintf (f, "bool_copy\t%d, %d", a->param[0], a->param[1]); - break; - case slang_asm_bool_move: - fprintf (f, "bool_move\t%d, %d", a->param[0], a->param[1]); - break; - case slang_asm_bool_push: - fprintf (f, "bool_push\t%d", a->literal != 0.0f); - break; - case slang_asm_bool_deref: - fprintf (f, "bool_deref"); - break; - case slang_asm_addr_copy: - fprintf (f, "addr_copy"); - break; - case slang_asm_addr_push: - fprintf (f, "addr_push\t%u", a->param[0]); - break; - case slang_asm_addr_deref: - fprintf (f, "addr_deref"); - break; - case slang_asm_addr_add: - fprintf (f, "addr_add"); - break; - case slang_asm_addr_multiply: - fprintf (f, "addr_multiply"); - break; - case slang_asm_vec4_tex1d: - fprintf (f, "vec4_tex1d"); - break; - case slang_asm_vec4_tex2d: - fprintf (f, "vec4_tex2d"); - break; - case slang_asm_vec4_tex3d: - fprintf (f, "vec4_tex3d"); - break; - case slang_asm_vec4_texcube: - fprintf (f, "vec4_texcube"); - break; - case slang_asm_vec4_shad1d: - fprintf (f, "vec4_shad1d"); - break; - case slang_asm_vec4_shad2d: - fprintf (f, "vec4_shad2d"); - break; - case slang_asm_jump: - fprintf (f, "jump\t%u", a->param[0]); - break; - case slang_asm_jump_if_zero: - fprintf (f, "jump_if_zero\t%u", a->param[0]); - break; - case slang_asm_enter: - fprintf (f, "enter\t%u", a->param[0]); - break; - case slang_asm_leave: - fprintf (f, "leave"); - break; - case slang_asm_local_alloc: - fprintf (f, "local_alloc\t%u", a->param[0]); - break; - case slang_asm_local_free: - fprintf (f, "local_free\t%u", a->param[0]); - break; - case slang_asm_local_addr: - fprintf (f, "local_addr\t%u, %u", a->param[0], a->param[1]); - break; - case slang_asm_global_addr: - fprintf (f, "global_addr\t%u", a->param[0]); - break; - case slang_asm_call: - fprintf (f, "call\t%u", a->param[0]); - break; - case slang_asm_return: - fprintf (f, "return"); - break; - case slang_asm_discard: - fprintf (f, "discard"); - break; - case slang_asm_exit: - fprintf (f, "exit"); - break; - /* GL_MESA_shader_debug */ - case slang_asm_float_print: - fprintf (f, "float_print"); - break; - case slang_asm_int_print: - fprintf (f, "int_print"); - break; - case slang_asm_bool_print: - fprintf (f, "bool_print"); - break; - /* vec4 */ + fprintf(f, "%.5u:\t", i); + + switch (a->type) { + /* core */ + case slang_asm_none: + fprintf(f, "none"); + break; + case slang_asm_float_copy: + fprintf(f, "float_copy\t%d, %d", a->param[0], a->param[1]); + break; + case slang_asm_float_move: + fprintf(f, "float_move\t%d, %d", a->param[0], a->param[1]); + break; + case slang_asm_float_push: + fprintf(f, "float_push\t%f", a->literal); + break; + case slang_asm_float_deref: + fprintf(f, "float_deref"); + break; + case slang_asm_float_add: + fprintf(f, "float_add"); + break; + case slang_asm_float_multiply: + fprintf(f, "float_multiply"); + break; + case slang_asm_float_divide: + fprintf(f, "float_divide"); + break; + case slang_asm_float_negate: + fprintf(f, "float_negate"); + break; + case slang_asm_float_less: + fprintf(f, "float_less"); + break; + case slang_asm_float_equal_exp: + fprintf(f, "float_equal"); + break; + case slang_asm_float_equal_int: + fprintf(f, "float_equal\t%d, %d", a->param[0], a->param[1]); + break; + case slang_asm_float_to_int: + fprintf(f, "float_to_int"); + break; + case slang_asm_float_sine: + fprintf(f, "float_sine"); + break; + case slang_asm_float_arcsine: + fprintf(f, "float_arcsine"); + break; + case slang_asm_float_arctan: + fprintf(f, "float_arctan"); + break; + case slang_asm_float_power: + fprintf(f, "float_power"); + break; + case slang_asm_float_log2: + fprintf(f, "float_log2"); + break; + case slang_asm_float_floor: + fprintf(f, "float_floor"); + break; + case slang_asm_float_ceil: + fprintf(f, "float_ceil"); + break; + case slang_asm_float_noise1: + fprintf(f, "float_noise1"); + break; + case slang_asm_float_noise2: + fprintf(f, "float_noise2"); + break; + case slang_asm_float_noise3: + fprintf(f, "float_noise3"); + break; + case slang_asm_float_noise4: + fprintf(f, "float_noise4"); + break; + case slang_asm_int_copy: + fprintf(f, "int_copy\t%d, %d", a->param[0], a->param[1]); + break; + case slang_asm_int_move: + fprintf(f, "int_move\t%d, %d", a->param[0], a->param[1]); + break; + case slang_asm_int_push: + fprintf(f, "int_push\t%d", (GLint) a->literal); + break; + case slang_asm_int_deref: + fprintf(f, "int_deref"); + break; + case slang_asm_int_to_float: + fprintf(f, "int_to_float"); + break; + case slang_asm_int_to_addr: + fprintf(f, "int_to_addr"); + break; + case slang_asm_bool_copy: + fprintf(f, "bool_copy\t%d, %d", a->param[0], a->param[1]); + break; + case slang_asm_bool_move: + fprintf(f, "bool_move\t%d, %d", a->param[0], a->param[1]); + break; + case slang_asm_bool_push: + fprintf(f, "bool_push\t%d", a->literal != 0.0f); + break; + case slang_asm_bool_deref: + fprintf(f, "bool_deref"); + break; + case slang_asm_addr_copy: + fprintf(f, "addr_copy"); + break; + case slang_asm_addr_push: + fprintf(f, "addr_push\t%u", a->param[0]); + break; + case slang_asm_addr_deref: + fprintf(f, "addr_deref"); + break; + case slang_asm_addr_add: + fprintf(f, "addr_add"); + break; + case slang_asm_addr_multiply: + fprintf(f, "addr_multiply"); + break; + case slang_asm_vec4_tex1d: + fprintf(f, "vec4_tex1d"); + break; + case slang_asm_vec4_tex2d: + fprintf(f, "vec4_tex2d"); + break; + case slang_asm_vec4_tex3d: + fprintf(f, "vec4_tex3d"); + break; + case slang_asm_vec4_texcube: + fprintf(f, "vec4_texcube"); + break; + case slang_asm_vec4_shad1d: + fprintf(f, "vec4_shad1d"); + break; + case slang_asm_vec4_shad2d: + fprintf(f, "vec4_shad2d"); + break; + case slang_asm_jump: + fprintf(f, "jump\t%u", a->param[0]); + break; + case slang_asm_jump_if_zero: + fprintf(f, "jump_if_zero\t%u", a->param[0]); + break; + case slang_asm_enter: + fprintf(f, "enter\t%u", a->param[0]); + break; + case slang_asm_leave: + fprintf(f, "leave"); + break; + case slang_asm_local_alloc: + fprintf(f, "local_alloc\t%u", a->param[0]); + break; + case slang_asm_local_free: + fprintf(f, "local_free\t%u", a->param[0]); + break; + case slang_asm_local_addr: + fprintf(f, "local_addr\t%u, %u", a->param[0], a->param[1]); + break; + case slang_asm_global_addr: + fprintf(f, "global_addr\t%u", a->param[0]); + break; + case slang_asm_call: + fprintf(f, "call\t%u", a->param[0]); + break; + case slang_asm_return: + fprintf(f, "return"); + break; + case slang_asm_discard: + fprintf(f, "discard"); + break; + case slang_asm_exit: + fprintf(f, "exit"); + break; + /* GL_MESA_shader_debug */ + case slang_asm_float_print: + fprintf(f, "float_print"); + break; + case slang_asm_int_print: + fprintf(f, "int_print"); + break; + case slang_asm_bool_print: + fprintf(f, "bool_print"); + break; + /* vec4 */ case slang_asm_float_to_vec4: - fprintf (f, "float_to_vec4"); + fprintf(f, "float_to_vec4"); break; case slang_asm_vec4_add: - fprintf (f, "vec4_add"); + fprintf(f, "vec4_add"); break; case slang_asm_vec4_subtract: - fprintf (f, "vec4_subtract"); + fprintf(f, "vec4_subtract"); break; case slang_asm_vec4_multiply: - fprintf (f, "vec4_multiply"); + fprintf(f, "vec4_multiply"); break; case slang_asm_vec4_divide: - fprintf (f, "vec4_divide"); + fprintf(f, "vec4_divide"); break; case slang_asm_vec4_negate: - fprintf (f, "vec4_negate"); + fprintf(f, "vec4_negate"); break; case slang_asm_vec4_dot: - fprintf (f, "vec4_dot"); + fprintf(f, "vec4_dot"); break; case slang_asm_vec4_copy: - fprintf (f, "vec4_copy"); + fprintf(f, "vec4_copy"); break; case slang_asm_vec4_deref: - fprintf (f, "vec4_deref"); + fprintf(f, "vec4_deref"); break; case slang_asm_vec4_equal_int: - fprintf (f, "vec4_equal"); + fprintf(f, "vec4_equal"); break; default: - break; - } + break; + } - fprintf (f, "\n"); + fprintf(f, "\n"); } -static void dump (const slang_assembly_file *file) +static void +dump(const slang_assembly_file * file) { - unsigned int i; - static unsigned int counter = 0; - FILE *f; - char filename[256]; + unsigned int i; + static unsigned int counter = 0; + FILE *f; + char filename[256]; - counter++; - _mesa_sprintf (filename, "~mesa-slang-assembly-dump-(%u).txt", counter); - f = fopen (filename, "w"); - if (f == NULL) - return; + counter++; + _mesa_sprintf(filename, "~mesa-slang-assembly-dump-(%u).txt", counter); + f = fopen(filename, "w"); + if (f == NULL) + return; - for (i = 0; i < file->count; i++) - dump_instruction (f, file->code + i, i); + for (i = 0; i < file->count; i++) + dump_instruction(f, file->code + i, i); - fclose (f); + fclose(f); } #endif static GLvoid -ensure_infolog_created (slang_info_log **infolog) +ensure_infolog_created(slang_info_log ** infolog) { if (*infolog == NULL) { - *infolog = slang_alloc_malloc (sizeof (slang_info_log)); + *infolog = slang_alloc_malloc(sizeof(slang_info_log)); if (*infolog == NULL) return; - slang_info_log_construct (*infolog); + slang_info_log_construct(*infolog); } } GLboolean -_slang_execute2 (const slang_assembly_file *file, slang_machine *mach) +_slang_execute2(const slang_assembly_file * file, slang_machine * mach) { - slang_machine_slot *stack; + slang_machine_slot *stack; #if DEBUG_SLANG - static unsigned int counter = 0; - char filename[256]; - FILE *f; + static unsigned int counter = 0; + char filename[256]; + FILE *f; #endif - /* assume 32-bit floats and uints; should work fine also on 64-bit platforms */ - static_assert(sizeof (GLfloat) == 4); - static_assert(sizeof (GLuint) == 4); + /* assume 32-bit floats and uints; should work fine also on 64-bit platforms */ + static_assert(sizeof(GLfloat) == 4); + static_assert(sizeof(GLuint) == 4); #if DEBUG_SLANG - dump (file); - counter++; - _mesa_sprintf (filename, "~mesa-slang-assembly-exec-(%u).txt", counter); - f = fopen (filename, "w"); + dump(file); + counter++; + _mesa_sprintf(filename, "~mesa-slang-assembly-exec-(%u).txt", counter); + f = fopen(filename, "w"); #endif #if defined(USE_X86_ASM) || defined(SLANG_X86) - if (mach->x86.compiled_func != NULL) - { - mach->x86.compiled_func (mach); - return GL_TRUE; - } + if (mach->x86.compiled_func != NULL) { + mach->x86.compiled_func(mach); + return GL_TRUE; + } #endif - stack = mach->mem + SLANG_MACHINE_GLOBAL_SIZE; + stack = mach->mem + SLANG_MACHINE_GLOBAL_SIZE; - while (!mach->exit) - { - slang_assembly *a = &file->code[mach->ip]; + while (!mach->exit) { + const slang_assembly *a = &file->code[mach->ip]; #if DEBUG_SLANG - if (f != NULL && a->type != slang_asm_none) - { - unsigned int i; + if (f != NULL && a->type != slang_asm_none) { + unsigned int i; - dump_instruction (f, file->code + mach->ip, mach->ip); - fprintf (f, "\t\tsp=%u bp=%u\n", mach->sp, mach->bp); - for (i = mach->sp; i < SLANG_MACHINE_STACK_SIZE; i++) - fprintf (f, "\t%.5u\t%6f\t%u\n", i, stack[i]._float, stack[i]._addr); - fflush (f); - } + dump_instruction(f, file->code + mach->ip, mach->ip); + fprintf(f, "\t\tsp=%u bp=%u\n", mach->sp, mach->bp); + for (i = mach->sp; i < SLANG_MACHINE_STACK_SIZE; i++) + fprintf(f, "\t%.5u\t%6f\t%u\n", i, stack[i]._float, + stack[i]._addr); + fflush(f); + } #endif - mach->ip++; + mach->ip++; - switch (a->type) - { - /* core */ - case slang_asm_none: - break; - case slang_asm_float_copy: - case slang_asm_int_copy: - case slang_asm_bool_copy: - mach->mem[(stack[mach->sp + a->param[0] / 4]._addr + a->param[1]) / 4]._float = - stack[mach->sp]._float; - mach->sp++; - break; - case slang_asm_float_move: - case slang_asm_int_move: - case slang_asm_bool_move: - stack[mach->sp + a->param[0] / 4]._float = - stack[mach->sp + (stack[mach->sp]._addr + a->param[1]) / 4]._float; - break; - case slang_asm_float_push: - case slang_asm_int_push: - case slang_asm_bool_push: - mach->sp--; - stack[mach->sp]._float = a->literal; - break; - case slang_asm_float_deref: - case slang_asm_int_deref: - case slang_asm_bool_deref: - stack[mach->sp]._float = mach->mem[stack[mach->sp]._addr / 4]._float; - break; - case slang_asm_float_add: - stack[mach->sp + 1]._float += stack[mach->sp]._float; - mach->sp++; - break; - case slang_asm_float_multiply: - stack[mach->sp + 1]._float *= stack[mach->sp]._float; - mach->sp++; - break; - case slang_asm_float_divide: - stack[mach->sp + 1]._float /= stack[mach->sp]._float; - mach->sp++; - break; - case slang_asm_float_negate: - stack[mach->sp]._float = -stack[mach->sp]._float; - break; - case slang_asm_float_less: - stack[mach->sp + 1]._float = - stack[mach->sp + 1]._float < stack[mach->sp]._float ? (GLfloat) 1 : (GLfloat) 0; - mach->sp++; - break; - case slang_asm_float_equal_exp: - stack[mach->sp + 1]._float = - stack[mach->sp + 1]._float == stack[mach->sp]._float ? (GLfloat) 1 : (GLfloat) 0; - mach->sp++; - break; - case slang_asm_float_equal_int: - mach->sp--; - stack[mach->sp]._float = stack[mach->sp + 1 + a->param[0] / 4]._float == - stack[mach->sp + 1 + a->param[1] / 4]._float ? (GLfloat) 1 : (GLfloat) 0; - break; - case slang_asm_float_to_int: - stack[mach->sp]._float = (GLfloat) (GLint) stack[mach->sp]._float; - break; - case slang_asm_float_sine: - stack[mach->sp]._float = (GLfloat) _mesa_sin (stack[mach->sp]._float); - break; - case slang_asm_float_arcsine: - stack[mach->sp]._float = _mesa_asinf (stack[mach->sp]._float); - break; - case slang_asm_float_arctan: - stack[mach->sp]._float = _mesa_atanf (stack[mach->sp]._float); - break; - case slang_asm_float_power: - stack[mach->sp + 1]._float = - (GLfloat) _mesa_pow (stack[mach->sp + 1]._float, stack[mach->sp]._float); - mach->sp++; - break; - case slang_asm_float_log2: - stack[mach->sp]._float = LOG2 (stack[mach->sp]._float); - break; - case slang_asm_float_floor: - stack[mach->sp]._float = FLOORF (stack[mach->sp]._float); - break; - case slang_asm_float_ceil: - stack[mach->sp]._float = CEILF (stack[mach->sp]._float); - break; - case slang_asm_float_noise1: - stack[mach->sp]._float = _slang_library_noise1 (stack[mach->sp]._float); - break; - case slang_asm_float_noise2: - stack[mach->sp + 1]._float = _slang_library_noise2 (stack[mach->sp]._float, - stack[mach->sp + 1]._float); - mach->sp++; - break; - case slang_asm_float_noise3: - stack[mach->sp + 2]._float = _slang_library_noise3 (stack[mach->sp]._float, - stack[mach->sp + 1]._float, stack[mach->sp + 2]._float); - mach->sp += 2; - break; - case slang_asm_float_noise4: - stack[mach->sp + 3]._float = _slang_library_noise4 (stack[mach->sp]._float, - stack[mach->sp + 1]._float, stack[mach->sp + 2]._float, stack[mach->sp + 3]._float); - mach->sp += 3; - break; - case slang_asm_int_to_float: - break; - case slang_asm_int_to_addr: - stack[mach->sp]._addr = (GLuint) (GLint) stack[mach->sp]._float; - break; - case slang_asm_addr_copy: - mach->mem[stack[mach->sp + 1]._addr / 4]._addr = stack[mach->sp]._addr; - mach->sp++; - break; - case slang_asm_addr_push: - case slang_asm_global_addr: - mach->sp--; - stack[mach->sp]._addr = a->param[0]; - break; - case slang_asm_addr_deref: - stack[mach->sp]._addr = mach->mem[stack[mach->sp]._addr / 4]._addr; - break; - case slang_asm_addr_add: - stack[mach->sp + 1]._addr += stack[mach->sp]._addr; - mach->sp++; - break; - case slang_asm_addr_multiply: - stack[mach->sp + 1]._addr *= stack[mach->sp]._addr; - mach->sp++; - break; - case slang_asm_vec4_tex1d: - _slang_library_tex1d (stack[mach->sp]._float, stack[mach->sp + 1]._float, - stack[mach->sp + 2]._float, &mach->mem[stack[mach->sp + 3]._addr / 4]._float); - mach->sp += 3; - break; - case slang_asm_vec4_tex2d: - _slang_library_tex2d (stack[mach->sp]._float, stack[mach->sp + 1]._float, - stack[mach->sp + 2]._float, stack[mach->sp + 3]._float, - &mach->mem[stack[mach->sp + 4]._addr / 4]._float); - mach->sp += 4; - break; - case slang_asm_vec4_tex3d: - _slang_library_tex3d (stack[mach->sp]._float, stack[mach->sp + 1]._float, - stack[mach->sp + 2]._float, stack[mach->sp + 3]._float, stack[mach->sp + 4]._float, - &mach->mem[stack[mach->sp + 5]._addr / 4]._float); - mach->sp += 5; - break; - case slang_asm_vec4_texcube: - _slang_library_texcube (stack[mach->sp]._float, stack[mach->sp + 1]._float, - stack[mach->sp + 2]._float, stack[mach->sp + 3]._float, stack[mach->sp + 4]._float, - &mach->mem[stack[mach->sp + 5]._addr / 4]._float); - mach->sp += 5; - break; - case slang_asm_vec4_shad1d: - _slang_library_shad1d (stack[mach->sp]._float, stack[mach->sp + 1]._float, - stack[mach->sp + 2]._float, stack[mach->sp + 3]._float, stack[mach->sp + 4]._float, - &mach->mem[stack[mach->sp + 5]._addr / 4]._float); - mach->sp += 5; - break; - case slang_asm_vec4_shad2d: - _slang_library_shad2d (stack[mach->sp]._float, stack[mach->sp + 1]._float, - stack[mach->sp + 2]._float, stack[mach->sp + 3]._float, stack[mach->sp + 4]._float, - &mach->mem[stack[mach->sp + 5]._addr / 4]._float); - mach->sp += 5; - break; - case slang_asm_jump: - mach->ip = a->param[0]; - break; - case slang_asm_jump_if_zero: - if (stack[mach->sp]._float == 0.0f) - mach->ip = a->param[0]; - mach->sp++; - break; - case slang_asm_enter: - mach->sp--; - stack[mach->sp]._addr = mach->bp; - mach->bp = mach->sp + a->param[0] / 4; - break; - case slang_asm_leave: - mach->bp = stack[mach->sp]._addr; - mach->sp++; - break; - case slang_asm_local_alloc: - mach->sp -= a->param[0] / 4; - break; - case slang_asm_local_free: - mach->sp += a->param[0] / 4; - break; - case slang_asm_local_addr: - mach->sp--; - stack[mach->sp]._addr = SLANG_MACHINE_GLOBAL_SIZE * 4 + mach->bp * 4 - - (a->param[0] + a->param[1]) + 4; - break; - case slang_asm_call: - mach->sp--; - stack[mach->sp]._addr = mach->ip; - mach->ip = a->param[0]; - break; - case slang_asm_return: - mach->ip = stack[mach->sp]._addr; - mach->sp++; - break; - case slang_asm_discard: - mach->kill = 1; - break; - case slang_asm_exit: - mach->exit = 1; - break; - /* GL_MESA_shader_debug */ - case slang_asm_float_print: - _mesa_printf ("slang print: %f\n", stack[mach->sp]._float); - ensure_infolog_created (&mach->infolog); - slang_info_log_print (mach->infolog, "%f", stack[mach->sp]._float); - break; - case slang_asm_int_print: - _mesa_printf ("slang print: %d\n", (GLint) stack[mach->sp]._float); - ensure_infolog_created (&mach->infolog); - slang_info_log_print (mach->infolog, "%d", (GLint) (stack[mach->sp]._float)); - break; - case slang_asm_bool_print: - _mesa_printf ("slang print: %s\n", (GLint) stack[mach->sp]._float ? "true" : "false"); - ensure_infolog_created (&mach->infolog); - slang_info_log_print (mach->infolog, "%s", - (GLint) (stack[mach->sp]._float) ? "true" : "false"); - break; - /* vec4 */ + switch (a->type) { + /* core */ + case slang_asm_none: + break; + case slang_asm_float_copy: + case slang_asm_int_copy: + case slang_asm_bool_copy: + /* store top value on stack to memory */ + { + GLuint address + = (stack[mach->sp + a->param[0] / 4]._addr + a->param[1]) / 4; + GLfloat value = stack[mach->sp]._float; + mach->mem[address]._float = value; + } + mach->sp++; + break; + case slang_asm_float_move: + case slang_asm_int_move: + case slang_asm_bool_move: + stack[mach->sp + a->param[0] / 4]._float = + stack[mach->sp + + (stack[mach->sp]._addr + a->param[1]) / 4]._float; + break; + case slang_asm_float_push: + case slang_asm_int_push: + case slang_asm_bool_push: + /* push float/int/bool literal onto stop of stack */ + mach->sp--; + stack[mach->sp]._float = a->literal; + break; + case slang_asm_float_deref: + case slang_asm_int_deref: + case slang_asm_bool_deref: + /* load value from memory, replace stop of stack with it */ + stack[mach->sp]._float = mach->mem[stack[mach->sp]._addr / 4]._float; + break; + case slang_asm_float_add: + /* pop two top floats, push sum */ + stack[mach->sp + 1]._float += stack[mach->sp]._float; + mach->sp++; + break; + case slang_asm_float_multiply: + stack[mach->sp + 1]._float *= stack[mach->sp]._float; + mach->sp++; + break; + case slang_asm_float_divide: + stack[mach->sp + 1]._float /= stack[mach->sp]._float; + mach->sp++; + break; + case slang_asm_float_negate: + stack[mach->sp]._float = -stack[mach->sp]._float; + break; + case slang_asm_float_less: + stack[mach->sp + 1]._float = + (stack[mach->sp + 1]._float < stack[mach->sp]._float) + ? (GLfloat) 1 : (GLfloat) 0; + mach->sp++; + break; + case slang_asm_float_equal_exp: + stack[mach->sp + 1]._float = + (stack[mach->sp + 1]._float == stack[mach->sp]._float) + ? (GLfloat) 1 : (GLfloat) 0; + mach->sp++; + break; + case slang_asm_float_equal_int: + /* pop top two values, compare, push 0 or 1 */ + mach->sp--; + stack[mach->sp]._float = + (stack[mach->sp + 1 + a->param[0] / 4]._float == + stack[mach->sp + 1 + a->param[1] / 4]._float) + ? (GLfloat) 1 : (GLfloat) 0; + break; + case slang_asm_float_to_int: + stack[mach->sp]._float = (GLfloat) (GLint) stack[mach->sp]._float; + break; + case slang_asm_float_sine: + stack[mach->sp]._float = (GLfloat) _mesa_sin(stack[mach->sp]._float); + break; + case slang_asm_float_arcsine: + stack[mach->sp]._float = _mesa_asinf(stack[mach->sp]._float); + break; + case slang_asm_float_arctan: + stack[mach->sp]._float = _mesa_atanf(stack[mach->sp]._float); + break; + case slang_asm_float_power: + stack[mach->sp + 1]._float = (GLfloat) + _mesa_pow(stack[mach->sp + 1]._float, stack[mach->sp]._float); + mach->sp++; + break; + case slang_asm_float_log2: + stack[mach->sp]._float = LOG2(stack[mach->sp]._float); + break; + case slang_asm_float_floor: + stack[mach->sp]._float = FLOORF(stack[mach->sp]._float); + break; + case slang_asm_float_ceil: + stack[mach->sp]._float = CEILF(stack[mach->sp]._float); + break; + case slang_asm_float_noise1: + stack[mach->sp]._float = + _slang_library_noise1(stack[mach->sp]._float); + break; + case slang_asm_float_noise2: + stack[mach->sp + 1]._float = + _slang_library_noise2(stack[mach->sp]._float, + stack[mach->sp + 1]._float); + mach->sp++; + break; + case slang_asm_float_noise3: + stack[mach->sp + 2]._float = + _slang_library_noise3(stack[mach->sp]._float, + stack[mach->sp + 1]._float, + stack[mach->sp + 2]._float); + mach->sp += 2; + break; + case slang_asm_float_noise4: + stack[mach->sp + 3]._float = + _slang_library_noise4(stack[mach->sp]._float, + stack[mach->sp + 1]._float, + stack[mach->sp + 2]._float, + stack[mach->sp + 3]._float); + mach->sp += 3; + break; + case slang_asm_int_to_float: + break; + case slang_asm_int_to_addr: + stack[mach->sp]._addr = (GLuint) (GLint) stack[mach->sp]._float; + break; + case slang_asm_addr_copy: + mach->mem[stack[mach->sp + 1]._addr / 4]._addr = + stack[mach->sp]._addr; + mach->sp++; + break; + case slang_asm_addr_push: + case slang_asm_global_addr: + mach->sp--; + stack[mach->sp]._addr = a->param[0]; + break; + case slang_asm_addr_deref: + stack[mach->sp]._addr = mach->mem[stack[mach->sp]._addr / 4]._addr; + break; + case slang_asm_addr_add: + stack[mach->sp + 1]._addr += stack[mach->sp]._addr; + mach->sp++; + break; + case slang_asm_addr_multiply: + stack[mach->sp + 1]._addr *= stack[mach->sp]._addr; + mach->sp++; + break; + case slang_asm_vec4_tex1d: + _slang_library_tex1d(stack[mach->sp]._float, + stack[mach->sp + 1]._float, + stack[mach->sp + 2]._float, + &mach->mem[stack[mach->sp + 3]._addr / + 4]._float); + mach->sp += 3; + break; + case slang_asm_vec4_tex2d: + _slang_library_tex2d(stack[mach->sp]._float, + stack[mach->sp + 1]._float, + stack[mach->sp + 2]._float, + stack[mach->sp + 3]._float, + &mach->mem[stack[mach->sp + 4]._addr / + 4]._float); + mach->sp += 4; + break; + case slang_asm_vec4_tex3d: + _slang_library_tex3d(stack[mach->sp]._float, + stack[mach->sp + 1]._float, + stack[mach->sp + 2]._float, + stack[mach->sp + 3]._float, + stack[mach->sp + 4]._float, + &mach->mem[stack[mach->sp + 5]._addr / + 4]._float); + mach->sp += 5; + break; + case slang_asm_vec4_texcube: + _slang_library_texcube(stack[mach->sp]._float, + stack[mach->sp + 1]._float, + stack[mach->sp + 2]._float, + stack[mach->sp + 3]._float, + stack[mach->sp + 4]._float, + &mach->mem[stack[mach->sp + 5]._addr / + 4]._float); + mach->sp += 5; + break; + case slang_asm_vec4_shad1d: + _slang_library_shad1d(stack[mach->sp]._float, + stack[mach->sp + 1]._float, + stack[mach->sp + 2]._float, + stack[mach->sp + 3]._float, + stack[mach->sp + 4]._float, + &mach->mem[stack[mach->sp + 5]._addr / + 4]._float); + mach->sp += 5; + break; + case slang_asm_vec4_shad2d: + _slang_library_shad2d(stack[mach->sp]._float, + stack[mach->sp + 1]._float, + stack[mach->sp + 2]._float, + stack[mach->sp + 3]._float, + stack[mach->sp + 4]._float, + &mach->mem[stack[mach->sp + 5]._addr / + 4]._float); + mach->sp += 5; + break; + case slang_asm_jump: + mach->ip = a->param[0]; + break; + case slang_asm_jump_if_zero: + if (stack[mach->sp]._float == 0.0f) + mach->ip = a->param[0]; + mach->sp++; + break; + case slang_asm_enter: + mach->sp--; + stack[mach->sp]._addr = mach->bp; + mach->bp = mach->sp + a->param[0] / 4; + break; + case slang_asm_leave: + mach->bp = stack[mach->sp]._addr; + mach->sp++; + break; + case slang_asm_local_alloc: + mach->sp -= a->param[0] / 4; + break; + case slang_asm_local_free: + mach->sp += a->param[0] / 4; + break; + case slang_asm_local_addr: + mach->sp--; + stack[mach->sp]._addr = + SLANG_MACHINE_GLOBAL_SIZE * 4 + mach->bp * 4 - (a->param[0] + + a->param[1]) + 4; + break; + case slang_asm_call: + mach->sp--; + stack[mach->sp]._addr = mach->ip; + mach->ip = a->param[0]; + break; + case slang_asm_return: + mach->ip = stack[mach->sp]._addr; + mach->sp++; + break; + case slang_asm_discard: + mach->kill = GL_TRUE; + break; + case slang_asm_exit: + mach->exit = GL_TRUE; + break; + /* GL_MESA_shader_debug */ + case slang_asm_float_print: + _mesa_printf("slang print: %f\n", stack[mach->sp]._float); + ensure_infolog_created(&mach->infolog); + slang_info_log_print(mach->infolog, "%f", stack[mach->sp]._float); + break; + case slang_asm_int_print: + _mesa_printf("slang print: %d\n", (GLint) stack[mach->sp]._float); + ensure_infolog_created(&mach->infolog); + slang_info_log_print(mach->infolog, "%d", + (GLint) (stack[mach->sp]._float)); + break; + case slang_asm_bool_print: + _mesa_printf("slang print: %s\n", + (GLint) stack[mach->sp]._float ? "true" : "false"); + ensure_infolog_created(&mach->infolog); + slang_info_log_print(mach->infolog, "%s", + (GLint) (stack[mach->sp]. + _float) ? "true" : "false"); + break; + /* vec4 */ case slang_asm_float_to_vec4: /* [vec4] | float > [vec4] */ { @@ -660,7 +714,8 @@ _slang_execute2 (const slang_assembly_file *file, slang_machine *mach) mach->mem[da / 4]._float = -mach->mem[da / 4]._float; mach->mem[(da + 4) / 4]._float = -mach->mem[(da + 4) / 4]._float; mach->mem[(da + 8) / 4]._float = -mach->mem[(da + 8) / 4]._float; - mach->mem[(da + 12) / 4]._float = -mach->mem[(da + 12) / 4]._float; + mach->mem[(da + 12) / 4]._float = + -mach->mem[(da + 12) / 4]._float; } break; case slang_asm_vec4_dot: @@ -721,9 +776,8 @@ _slang_execute2 (const slang_assembly_file *file, slang_machine *mach) #if DEBUG_SLANG if (f != NULL) - fclose (f); + fclose(f); #endif return GL_TRUE; } - diff --git a/src/mesa/shader/slang/slang_execute.h b/src/mesa/shader/slang/slang_execute.h index cb152c71420..138f1393081 100644 --- a/src/mesa/shader/slang/slang_execute.h +++ b/src/mesa/shader/slang/slang_execute.h @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.5 + * Version: 6.5.2 * * Copyright (C) 2005-2006 Brian Paul All Rights Reserved. * @@ -22,7 +22,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#if !defined SLANG_EXECUTE_H +#ifndef SLANG_EXECUTE_H #define SLANG_EXECUTE_H #include "slang_assemble.h" @@ -31,55 +31,75 @@ extern "C" { #endif + +/** + * A memory location + */ typedef union slang_machine_slot_ { - GLfloat _float; - GLuint _addr; + GLfloat _float; + GLuint _addr; } slang_machine_slot; #define SLANG_MACHINE_GLOBAL_SIZE 3072 #define SLANG_MACHINE_STACK_SIZE 1024 #define SLANG_MACHINE_MEMORY_SIZE (SLANG_MACHINE_GLOBAL_SIZE + SLANG_MACHINE_STACK_SIZE) + #if defined(USE_X86_ASM) || defined(SLANG_X86) +/** + * Extra machine state for x86 execution. + */ typedef struct { - GLvoid (* compiled_func) (struct slang_machine_ *); - GLuint esp_restore; - GLshort fpucntl_rnd_neg; - GLshort fpucntl_restore; + GLvoid(*compiled_func) (struct slang_machine_ *); + GLuint esp_restore; + GLshort fpucntl_rnd_neg; + GLshort fpucntl_restore; } slang_machine_x86; #endif + +/** + * Runtime shader machine state. + */ typedef struct slang_machine_ { - GLuint ip; /* instruction pointer, for flow control */ - GLuint sp; /* stack pointer, for stack access */ - GLuint bp; /* base pointer, for local variable access */ - GLuint kill; /* discard the fragment */ - GLuint exit; /* terminate the shader */ - slang_machine_slot mem[SLANG_MACHINE_MEMORY_SIZE]; - struct slang_info_log_ *infolog; /* printMESA() support */ + GLuint ip; /**< instruction pointer, for flow control */ + GLuint sp; /**< stack pointer, for stack access */ + GLuint bp; /**< base pointer, for local variable access */ + GLboolean kill; /**< discard the fragment? */ + GLboolean exit; /**< terminate the shader */ + /** Machine memory */ + slang_machine_slot mem[SLANG_MACHINE_MEMORY_SIZE]; + struct slang_info_log_ *infolog; /**< printMESA() support */ #if defined(USE_X86_ASM) || defined(SLANG_X86) - slang_machine_x86 x86; + slang_machine_x86 x86; #endif } slang_machine; -GLvoid slang_machine_ctr (slang_machine *); -GLvoid slang_machine_dtr (slang_machine *); -void slang_machine_init (slang_machine *); +extern GLvoid +slang_machine_ctr(slang_machine *); + +extern GLvoid +slang_machine_dtr(slang_machine *); + +extern void +slang_machine_init(slang_machine *); + +extern GLboolean +_slang_execute2(const slang_assembly_file *, slang_machine *); -GLboolean -_slang_execute2 (const slang_assembly_file *, slang_machine *); #if defined(USE_X86_ASM) || defined(SLANG_X86) -GLboolean _slang_x86_codegen (slang_machine *, slang_assembly_file *, GLuint); +extern GLboolean +_slang_x86_codegen(slang_machine *, slang_assembly_file *, GLuint); #endif + #ifdef __cplusplus } #endif #endif - diff --git a/src/mesa/shader/slang/slang_preprocess.c b/src/mesa/shader/slang/slang_preprocess.c index 43aa9a1e95e..66a6a983927 100644 --- a/src/mesa/shader/slang/slang_preprocess.c +++ b/src/mesa/shader/slang/slang_preprocess.c @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.6 + * Version: 6.5.2 * * Copyright (C) 2005-2006 Brian Paul All Rights Reserved. * @@ -32,15 +32,15 @@ #include "grammar_mesa.h" #include "slang_preprocess.h" -static const char *slang_pp_directives_syn = +LONGSTRING static const char *slang_pp_directives_syn = #include "library/slang_pp_directives_syn.h" ; -static const char *slang_pp_expression_syn = +LONGSTRING static const char *slang_pp_expression_syn = #include "library/slang_pp_expression_syn.h" ; -static const char *slang_pp_version_syn = +LONGSTRING static const char *slang_pp_version_syn = #include "library/slang_pp_version_syn.h" ; diff --git a/src/mesa/shader/slang/slang_utility.c b/src/mesa/shader/slang/slang_utility.c index 54fcc8a2382..256d52455db 100644 --- a/src/mesa/shader/slang/slang_utility.c +++ b/src/mesa/shader/slang/slang_utility.c @@ -131,75 +131,92 @@ slang_string_cstr (slang_string *self) /* slang_atom_pool */ -void slang_atom_pool_construct (slang_atom_pool *pool) +void +slang_atom_pool_construct(slang_atom_pool * pool) { - GLuint i; + GLuint i; - for (i = 0; i < SLANG_ATOM_POOL_SIZE; i++) - pool->entries[i] = NULL; + for (i = 0; i < SLANG_ATOM_POOL_SIZE; i++) + pool->entries[i] = NULL; } -void slang_atom_pool_destruct (slang_atom_pool *pool) +void +slang_atom_pool_destruct (slang_atom_pool * pool) { - GLuint i; + GLuint i; - for (i = 0; i < SLANG_ATOM_POOL_SIZE; i++) - { - slang_atom_entry *entry; + for (i = 0; i < SLANG_ATOM_POOL_SIZE; i++) { + slang_atom_entry * entry; - entry = pool->entries[i]; - while (entry != NULL) - { - slang_atom_entry *next; - - next = entry->next; - slang_alloc_free (entry->id); - slang_alloc_free (entry); - entry = next; + entry = pool->entries[i]; + while (entry != NULL) { + slang_atom_entry *next; + + next = entry->next; + slang_alloc_free(entry->id); + slang_alloc_free(entry); + entry = next; } } } -slang_atom slang_atom_pool_atom (slang_atom_pool *pool, const char *id) +/* + * Search the atom pool for an atom with a given name. + * If atom is not found, create and add it to the pool. + * Returns ATOM_NULL if the atom was not found and the function failed to create a new atom. + */ +slang_atom +slang_atom_pool_atom(slang_atom_pool * pool, const char * id) { - GLuint hash; - const char *p = id; - slang_atom_entry **entry; - - hash = 0; - while (*p != '\0') - { - GLuint g; - - hash = (hash << 4) + (GLuint) *p++; - g = hash & 0xf0000000; - if (g != 0) - hash ^= g >> 24; - hash &= ~g; - } - hash %= SLANG_ATOM_POOL_SIZE; - - entry = &pool->entries[hash]; - while (*entry != NULL) - { - if (slang_string_compare ((**entry).id, id) == 0) - return (slang_atom) (**entry).id; - entry = &(**entry).next; - } - - *entry = (slang_atom_entry *) slang_alloc_malloc (sizeof (slang_atom_entry)); - if (*entry == NULL) - return SLANG_ATOM_NULL; + GLuint hash; + const char * p = id; + slang_atom_entry ** entry; + + /* Hash a given string to a number in the range [0, ATOM_POOL_SIZE). */ + hash = 0; + while (*p != '\0') { + GLuint g; + + hash = (hash << 4) + (GLuint) (*p++); + g = hash & 0xf0000000; + if (g != 0) + hash ^= g >> 24; + hash &= ~g; + } + hash %= SLANG_ATOM_POOL_SIZE; + + /* Now the hash points to a linked list of atoms with names that have the same hash value. + * Search the linked list for a given name. */ + entry = &pool->entries[hash]; + while (*entry != NULL) { + /* If the same, return the associated atom. */ + if (slang_string_compare((**entry).id, id) == 0) + return (slang_atom) (**entry).id; + /* Grab the next atom in the linked list. */ + entry = &(**entry).next; + } - (**entry).next = NULL; - (**entry).id = slang_string_duplicate (id); - if ((**entry).id == NULL) - return SLANG_ATOM_NULL; - return (slang_atom) (**entry).id; + /* Okay, we have not found an atom. Create a new entry for it. + * Note that the points to the last entry's field. */ + *entry = (slang_atom_entry *) (slang_alloc_malloc(sizeof(slang_atom_entry))); + if (*entry == NULL) + return SLANG_ATOM_NULL; + + /* Initialize a new entry. Because we'll need the actual name of the atom, we use the pointer + * to this string as an actual atom's value. */ + (**entry).next = NULL; + (**entry).id = slang_string_duplicate(id); + if ((**entry).id == NULL) + return SLANG_ATOM_NULL; + return (slang_atom) (**entry).id; } -const char *slang_atom_pool_id (slang_atom_pool *pool, slang_atom atom) +/* + * Return the name of a given atom. + */ +const char * +slang_atom_pool_id(slang_atom_pool * pool, slang_atom atom) { - return (const char *) atom; + return (const char *) (atom); } diff --git a/src/mesa/swrast/s_nvfragprog.c b/src/mesa/swrast/s_nvfragprog.c index 7a6785b1d29..028ddc0090d 100644 --- a/src/mesa/swrast/s_nvfragprog.c +++ b/src/mesa/swrast/s_nvfragprog.c @@ -57,6 +57,9 @@ struct fp_machine GLfloat Inputs[MAX_NV_FRAGMENT_PROGRAM_INPUTS][4]; GLfloat Outputs[MAX_NV_FRAGMENT_PROGRAM_OUTPUTS][4]; GLuint CondCodes[4]; /**< COND_* value for x/y/z/w */ + + GLuint CallStack[MAX_PROGRAM_CALL_DEPTH]; /**< For CAL/RET instructions */ + GLuint StackDepth; /**< Index/ptr to top of CallStack[] */ }; @@ -697,6 +700,37 @@ execute_program( GLcontext *ctx, } } break; + case OPCODE_BRA: /* conditional branch */ + { + /* NOTE: The return is conditional! */ + const GLuint swizzle = inst->DstReg.CondSwizzle; + const GLuint condMask = inst->DstReg.CondMask; + if (test_cc(machine->CondCodes[GET_SWZ(swizzle, 0)], condMask) || + test_cc(machine->CondCodes[GET_SWZ(swizzle, 1)], condMask) || + test_cc(machine->CondCodes[GET_SWZ(swizzle, 2)], condMask) || + test_cc(machine->CondCodes[GET_SWZ(swizzle, 3)], condMask)) { + /* take branch */ + pc = inst->BranchTarget; + } + } + break; + case OPCODE_CAL: /* Call subroutine */ + { + /* NOTE: The call is conditional! */ + const GLuint swizzle = inst->DstReg.CondSwizzle; + const GLuint condMask = inst->DstReg.CondMask; + if (test_cc(machine->CondCodes[GET_SWZ(swizzle, 0)], condMask) || + test_cc(machine->CondCodes[GET_SWZ(swizzle, 1)], condMask) || + test_cc(machine->CondCodes[GET_SWZ(swizzle, 2)], condMask) || + test_cc(machine->CondCodes[GET_SWZ(swizzle, 3)], condMask)) { + if (machine->StackDepth >= MAX_PROGRAM_CALL_DEPTH) { + return GL_TRUE; /* Per GL_NV_vertex_program2 spec */ + } + machine->CallStack[machine->StackDepth++] = pc + 1; + pc = inst->BranchTarget; + } + } + break; case OPCODE_CMP: { GLfloat a[4], b[4], c[4], result[4]; @@ -1093,6 +1127,22 @@ execute_program( GLcontext *ctx, store_vector4( inst, machine, result ); } break; + case OPCODE_RET: /* return from subroutine */ + { + /* NOTE: The return is conditional! */ + const GLuint swizzle = inst->DstReg.CondSwizzle; + const GLuint condMask = inst->DstReg.CondMask; + if (test_cc(machine->CondCodes[GET_SWZ(swizzle, 0)], condMask) || + test_cc(machine->CondCodes[GET_SWZ(swizzle, 1)], condMask) || + test_cc(machine->CondCodes[GET_SWZ(swizzle, 2)], condMask) || + test_cc(machine->CondCodes[GET_SWZ(swizzle, 3)], condMask)) { + if (machine->StackDepth == 0) { + return GL_TRUE; /* Per GL_NV_vertex_program2 spec */ + } + pc = machine->CallStack[--machine->StackDepth]; + } + } + break; case OPCODE_RFL: /* reflection vector */ { GLfloat axis[4], dir[4], result[4], tmpX, tmpW; @@ -1539,6 +1589,9 @@ init_machine( GLcontext *ctx, struct fp_machine *machine, machine->CondCodes[1] = COND_EQ; machine->CondCodes[2] = COND_EQ; machine->CondCodes[3] = COND_EQ; + + /* init call stack */ + machine->StackDepth = 0; } diff --git a/src/mesa/tnl/t_save_api.c b/src/mesa/tnl/t_save_api.c index 11d21301d94..dbbd095fe47 100644 --- a/src/mesa/tnl/t_save_api.c +++ b/src/mesa/tnl/t_save_api.c @@ -1413,10 +1413,14 @@ static void GLAPIENTRY _save_OBE_DrawArrays(GLenum mode, GLint start, GLsizei co if (!_mesa_validate_DrawArrays( ctx, mode, start, count )) return; + _ae_map_vbos( ctx ); + _save_NotifyBegin( ctx, mode | PRIM_WEAK ); for (i = 0; i < count; i++) CALL_ArrayElement(GET_DISPATCH(), (start + i)); CALL_End(GET_DISPATCH(), ()); + + _ae_unmap_vbos( ctx ); } @@ -1429,6 +1433,8 @@ static void GLAPIENTRY _save_OBE_DrawElements(GLenum mode, GLsizei count, GLenum if (!_mesa_validate_DrawElements( ctx, mode, count, type, indices )) return; + _ae_map_vbos( ctx ); + _save_NotifyBegin( ctx, mode | PRIM_WEAK ); switch (type) { @@ -1450,6 +1456,8 @@ static void GLAPIENTRY _save_OBE_DrawElements(GLenum mode, GLsizei count, GLenum } CALL_End(GET_DISPATCH(), ()); + + _ae_unmap_vbos( ctx ); } static void GLAPIENTRY _save_OBE_DrawRangeElements(GLenum mode, diff --git a/src/mesa/tnl/t_vp_build.c b/src/mesa/tnl/t_vp_build.c index 894a13b7046..805d05ae728 100644 --- a/src/mesa/tnl/t_vp_build.c +++ b/src/mesa/tnl/t_vp_build.c @@ -33,7 +33,7 @@ #include "glheader.h" #include "macros.h" #include "enums.h" -#include "t_context.h" +#include "t_context.h" /* NOTE: very light dependency on this */ #include "t_vp_build.h" #include "shader/program.h" @@ -386,7 +386,7 @@ static struct ureg register_const4f( struct tnl_program *p, values[1] = s1; values[2] = s2; values[3] = s3; - idx = _mesa_add_unnamed_constant( p->program->Base.Parameters, values ); + idx = _mesa_add_unnamed_constant( p->program->Base.Parameters, values, 4 ); return make_ureg(PROGRAM_STATE_VAR, idx); } -- cgit v1.2.3 From 6238c30913d532e22f03d2eb77ed33478c37da93 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Sun, 26 Nov 2006 02:38:31 +0000 Subject: Revert maintainer and uploaders fields. Integrate latest NMUs into the changelog and be a little more verbose in the debian/rules rewrite changelog entries. --- debian/changelog | 22 +++++++++++++++++++--- debian/control | 4 ++-- 2 files changed, 21 insertions(+), 5 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index ca239b9d547..57589815710 100644 --- a/debian/changelog +++ b/debian/changelog @@ -20,8 +20,9 @@ mesa (6.5.2~rc1-1) experimental; urgency=low mesa (6.5.1-1) experimental; urgency=low - * Provide i686 optimized versions in libgl1-mesa-swx11-i686. - * No longer provide the libgl1-mesa-swx11-dbg package. + * 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 @@ -33,12 +34,27 @@ mesa (6.5.1-1) experimental; urgency=low 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. (Closes: #396498) + * 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.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 diff --git a/debian/control b/debian/control index 12c8db45b9a..46e4464c062 100644 --- a/debian/control +++ b/debian/control @@ -1,8 +1,8 @@ Source: mesa Section: graphics Priority: optional -Maintainer: Debian X Strike Force -Uploaders: Thierry Reding +Maintainer: Mesa package maintainers +Uploaders: Marcelo E. Magallon Standards-Version: 3.7.2 Build-Depends: debhelper (>= 5), quilt (>= 0.40), pkg-config, libdrm-dev (>= 2.2.0) [!hurd-i386], libx11-dev, xutils-dev, x11proto-gl-dev (>= 1.4.8), libxxf86vm-dev, libexpat1-dev, lesstif2-dev, dpkg-dev (>= 1.13.19) -- cgit v1.2.3 From 777d41dd07d8da63f82451b68910b5ccfc61b2e7 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Sun, 26 Nov 2006 02:40:01 +0000 Subject: Mark the latest changelog entries as NMUs. --- debian/changelog | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 57589815710..13aab843476 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,12 +1,14 @@ -mesa (6.5.2~rc2-1) experimental; urgency=low +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. -- Thierry Reding Wed, 22 Nov 2006 20:49:06 +0100 -mesa (6.5.2~rc1-1) experimental; urgency=low +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. @@ -18,8 +20,9 @@ mesa (6.5.2~rc1-1) experimental; urgency=low -- Thierry Reding Sat, 18 Nov 2006 22:23:04 +0100 -mesa (6.5.1-1) experimental; urgency=low +mesa (6.5.1-0.5) 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. -- cgit v1.2.3 From c9c79e7cae4867656343cfe457ab531f700c616a Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Wed, 29 Nov 2006 18:07:26 +0000 Subject: Add manpages to the mesa-utils package. --- debian/glxdemo.1 | 15 +++++++++++++++ debian/glxgears.1 | 29 +++++++++++++++++++++++++++++ debian/glxheads.1 | 30 ++++++++++++++++++++++++++++++ debian/glxinfo.1 | 41 +++++++++++++++++++++++++++++++++++++++++ debian/mesa-utils.manpages | 4 ++++ 5 files changed, 119 insertions(+) create mode 100644 debian/glxdemo.1 create mode 100644 debian/glxgears.1 create mode 100644 debian/glxheads.1 create mode 100644 debian/glxinfo.1 create mode 100644 debian/mesa-utils.manpages (limited to 'debian') diff --git a/debian/glxdemo.1 b/debian/glxdemo.1 new file mode 100644 index 00000000000..fdfed7133e5 --- /dev/null +++ b/debian/glxdemo.1 @@ -0,0 +1,15 @@ +.TH glxdemo 1 "2006-11-29" +.SH NAME +glxdemo \- a demonstration of the GLX functions +.SH SYNOPSIS +.B glxdemo +.SH DESCRIPTION +The \fIglxdemo\fP program shows how to use the GLX functions in order to +create an OpenGL program running on top of an X server. This program is most +useful when studied in its source code form. +.SH AUTHOR +glxdemo was written by Brian Paul . +.PP +This manual page was written by Thierry Reding , for the +Debian project (but may be used by others). + diff --git a/debian/glxgears.1 b/debian/glxgears.1 new file mode 100644 index 00000000000..92c4f7a432c --- /dev/null +++ b/debian/glxgears.1 @@ -0,0 +1,29 @@ +.TH glxgears 1 "2006-11-29" +.SH NAME +glxgears \- ``gears'' demo for GLX +.SH SYNOPSIS +.B glxgears +.RI [ options ] +.SH DESCRIPTION +The \fIglxgears\fP program is a port of the ``gears'' demo to GLX. It displays +a set of rotating gears and prints out the frame rate at regular intervals. It +has become quite popular as basic benchmarking tool. +.SH OPTIONS +.TP 8 +.B \-display \fIdisplay\fP +Specify which X display to run on. +.TP 8 +.B \-info +Display OpenGL renderer information. +.TP 8 +.B \-stereo +Use a stereo enabled GLX visual. +.TP 8 +.B \-fullscreen +Run in fullscreen mode. +.SH AUTHOR +glxgears was written by Brian Paul . +.PP +This manual page was written by Thierry Reding , for the +Debian project (but may be used by others). + diff --git a/debian/glxheads.1 b/debian/glxheads.1 new file mode 100644 index 00000000000..95025569019 --- /dev/null +++ b/debian/glxheads.1 @@ -0,0 +1,30 @@ +.TH glxheads 1 "2006-11-29" +.SH NAME +glxheads \- exercise multiple GLX connections +.SH SYNOPSIS +.B glxheads +[\fIdisplay\fP ...] +.SH DESCRIPTION +The \fIglxheads\fP program will try to open GLX connections on multiple X +displays as specified on the command-line. If a connection can be made it will +try to create a direct GLX context (and fallback to using indirect contexts if +that fails) and open a window displaying a spinning green triangle. +.PP +If no display names are specified, \fIglxheads\fP will default to opening a +single local connection on display 0. +.SH EXAMPLE +To open a local connection on display 0 and two remote connections to the +hosts \fImars\fP (display 0) and \fIvenus\fP (display 1), run glxheads with +the following command-line: +.PP +.RS 3n +.nf +$ glxheads :0 mars:0 venus:1 +.fi +.RE +.SH AUTHOR +glxheads was written by Brian Paul . +.PP +This manual page was written by Thierry Reding for the +Debian project (but may be used by others). + diff --git a/debian/glxinfo.1 b/debian/glxinfo.1 new file mode 100644 index 00000000000..9cce83dd74a --- /dev/null +++ b/debian/glxinfo.1 @@ -0,0 +1,41 @@ +.TH glxinfo 1 "2006-11-29" +.SH NAME +glxinfo \- show information about the GLX implementation +.SH SYNOPSIS +.B glxinfo +.RI [ options ] +.SH DESCRIPTION +The \fIglxinfo\fP program shows information about the OpenGL and GLX +implementations running on a given X display. +.PP +The information includes details about the server- and client-side GLX +implementation, the OpenGL and GLU implementations as well as a list +of available GLX visuals. +.SH OPTIONS +.TP 8 +.B \-v +Print visuals info in verbose form. +.TP 8 +.B \-t +Print verbose table. +.TP 8 +.B \-display \fIdisplay\fP +Specify the X display to interrogate. +.TP 8 +.B \-h +Print usage information. +.TP 8 +.B \-i +Force an indirect rendering context. +.TP 8 +.B \-b +Find the ``best'' visual and print it's number. +.TP 8 +.B \-l +Print interesting OpenGL limits. +.SH AUTHOR +glxinfo was written by Brian Paul . +.PP +This manual page was written by Thierry Reding , for the +Debian project (but may be used by others). + diff --git a/debian/mesa-utils.manpages b/debian/mesa-utils.manpages new file mode 100644 index 00000000000..a3cb2dbb5d0 --- /dev/null +++ b/debian/mesa-utils.manpages @@ -0,0 +1,4 @@ +debian/glxdemo.1 +debian/glxgears.1 +debian/glxheads.1 +debian/glxinfo.1 -- cgit v1.2.3 From 017bade93c5519f3c38617185714495c4a7fad89 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Fri, 1 Dec 2006 00:16:33 +0000 Subject: Update to latest upstream release candidate (6.5.2 RC3). --- Makefile | 12 + debian/changelog | 7 + docs/relnotes-6.5.2.html | 4 + src/glut/fbdev/callback.c | 2 + src/glut/fbdev/colormap.c | 3 +- src/glut/fbdev/cursor.c | 2 + src/glut/fbdev/ext.c | 2 + src/glut/fbdev/fbdev.c | 4 +- src/glut/fbdev/gamemode.c | 1 + src/glut/fbdev/input.c | 6 +- src/glut/fbdev/internal.h | 7 +- src/glut/fbdev/menu.c | 2 + src/glut/fbdev/state.c | 1 + src/glx/x11/XF86dri.c | 4 +- src/mesa/array_cache/sources | 7 + src/mesa/drivers/common/sources | 2 + src/mesa/drivers/dri/i915tex/i830_context.h | 5 + src/mesa/drivers/dri/i915tex/i830_metaops.c | 32 +- src/mesa/drivers/dri/i915tex/i830_vtbl.c | 83 ++- src/mesa/drivers/dri/i915tex/intel_blit.c | 35 +- src/mesa/drivers/dri/i915tex/intel_blit.h | 3 +- src/mesa/drivers/dri/i915tex/intel_pixel.c | 5 +- src/mesa/drivers/dri/i915tex/intel_pixel_copy.c | 11 +- src/mesa/drivers/dri/i915tex/intel_pixel_draw.c | 14 +- src/mesa/drivers/dri/i915tex/intel_pixel_read.c | 8 +- src/mesa/drivers/dri/i915tex/intel_regions.c | 11 +- src/mesa/drivers/dri/i915tex/intel_tex_copy.c | 3 +- src/mesa/drivers/dri/i915tex/intel_tex_image.c | 3 +- src/mesa/drivers/dri/i965/brw_attrib.h | 1 + src/mesa/drivers/dri/i965/brw_draw.c | 2 +- src/mesa/drivers/dri/i965/brw_draw_upload.c | 6 +- src/mesa/drivers/dri/i965/brw_save_api.c | 6 +- src/mesa/drivers/dri/i965/brw_save_draw.c | 26 +- src/mesa/drivers/dri/i965/brw_vs_emit.c | 2 +- src/mesa/drivers/dri/i965/brw_vs_tnl.c | 9 +- src/mesa/drivers/dri/i965/intel_blit.c | 38 +- src/mesa/drivers/dri/i965/intel_blit.h | 3 +- src/mesa/drivers/dri/i965/intel_pixel_copy.c | 8 +- src/mesa/drivers/dri/i965/intel_regions.c | 3 +- src/mesa/drivers/dri/r200/r200_fragshader.c | 37 +- src/mesa/drivers/dri/r300/r300_fragprog.c | 4 +- src/mesa/drivers/x11/sources | 8 + src/mesa/glapi/sources | 12 + src/mesa/main/api_arrayelt.c | 29 +- src/mesa/main/api_loopback.c | 2 +- src/mesa/main/sources | 138 +++++ src/mesa/math/sources | 25 + src/mesa/shader/grammar/sources | 8 + src/mesa/shader/slang/slang_assemble_constructor.c | 623 +++++++++++---------- src/mesa/shader/slang/slang_assemble_constructor.h | 44 +- src/mesa/shader/slang/slang_assemble_typeinfo.c | 2 +- src/mesa/shader/slang/slang_assemble_typeinfo.h | 4 +- src/mesa/shader/slang/slang_compile_function.h | 18 +- src/mesa/shader/slang/slang_compile_operation.h | 152 ++--- src/mesa/shader/slang/slang_compile_variable.c | 550 +++++++++--------- src/mesa/shader/slang/slang_compile_variable.h | 40 +- src/mesa/shader/slang/sources | 44 ++ src/mesa/shader/sources | 28 + src/mesa/swrast/sources | 65 +++ src/mesa/swrast_setup/sources | 10 + src/mesa/tnl/sources | 46 ++ src/mesa/tnl/t_context.c | 5 +- src/mesa/tnl/t_save_playback.c | 1 + src/mesa/tnl/t_vtx_api.c | 3 +- src/mesa/tnl/t_vtx_exec.c | 5 + 65 files changed, 1442 insertions(+), 844 deletions(-) create mode 100644 src/mesa/array_cache/sources create mode 100644 src/mesa/drivers/common/sources create mode 100644 src/mesa/drivers/x11/sources create mode 100644 src/mesa/glapi/sources create mode 100644 src/mesa/main/sources create mode 100644 src/mesa/math/sources create mode 100644 src/mesa/shader/grammar/sources create mode 100644 src/mesa/shader/slang/sources create mode 100644 src/mesa/shader/sources create mode 100644 src/mesa/swrast/sources create mode 100644 src/mesa/swrast_setup/sources create mode 100644 src/mesa/tnl/sources (limited to 'debian') diff --git a/Makefile b/Makefile index b280298daf5..b95cedda8d8 100644 --- a/Makefile +++ b/Makefile @@ -205,25 +205,35 @@ MAIN_FILES = \ $(DIRECTORY)/src/mesa/depend \ $(DIRECTORY)/src/mesa/main/*.[chS] \ $(DIRECTORY)/src/mesa/main/descrip.mms \ + $(DIRECTORY)/src/mesa/main/sources \ $(DIRECTORY)/src/mesa/glapi/*.[chS] \ $(DIRECTORY)/src/mesa/glapi/descrip.mms \ + $(DIRECTORY)/src/mesa/glapi/sources \ $(DIRECTORY)/src/mesa/array_cache/*.[ch] \ $(DIRECTORY)/src/mesa/array_cache/descrip.mms \ + $(DIRECTORY)/src/mesa/array_cache/sources \ $(DIRECTORY)/src/mesa/math/*.[ch] \ $(DIRECTORY)/src/mesa/math/descrip.mms \ + $(DIRECTORY)/src/mesa/math/sources \ $(DIRECTORY)/src/mesa/shader/*.[ch] \ $(DIRECTORY)/src/mesa/shader/descrip.mms \ + $(DIRECTORY)/src/mesa/shader/sources \ $(DIRECTORY)/src/mesa/shader/grammar/*.[ch] \ $(DIRECTORY)/src/mesa/shader/grammar/descrip.mms \ + $(DIRECTORY)/src/mesa/shader/grammar/sources \ $(DIRECTORY)/src/mesa/shader/slang/*.[ch] \ $(DIRECTORY)/src/mesa/shader/slang/descrip.mms \ + $(DIRECTORY)/src/mesa/shader/slang/sources \ $(DIRECTORY)/src/mesa/shader/slang/library/*.[ch] \ $(DIRECTORY)/src/mesa/swrast/*.[ch] \ $(DIRECTORY)/src/mesa/swrast/descrip.mms \ + $(DIRECTORY)/src/mesa/swrast/sources \ $(DIRECTORY)/src/mesa/swrast_setup/*.[ch] \ $(DIRECTORY)/src/mesa/swrast_setup/descrip.mms \ + $(DIRECTORY)/src/mesa/swrast_setup/sources \ $(DIRECTORY)/src/mesa/tnl/*.[chS] \ $(DIRECTORY)/src/mesa/tnl/descrip.mms \ + $(DIRECTORY)/src/mesa/tnl/sources \ $(DIRECTORY)/src/mesa/tnl_dd/*.[ch] \ $(DIRECTORY)/src/mesa/tnl_dd/imm/*.[ch] \ $(DIRECTORY)/src/mesa/tnl_dd/imm/NOTES.imm \ @@ -231,6 +241,7 @@ MAIN_FILES = \ $(DIRECTORY)/src/mesa/drivers/beos/Makefile \ $(DIRECTORY)/src/mesa/drivers/common/*.[ch] \ $(DIRECTORY)/src/mesa/drivers/common/descrip.mms \ + $(DIRECTORY)/src/mesa/drivers/common/sources \ $(DIRECTORY)/src/mesa/drivers/directfb/*.[ch] \ $(DIRECTORY)/src/mesa/drivers/directfb/Makefile \ $(DIRECTORY)/src/mesa/drivers/dos/*.[chS] \ @@ -251,6 +262,7 @@ MAIN_FILES = \ $(DIRECTORY)/src/mesa/drivers/windows/*/*.[ch] \ $(DIRECTORY)/src/mesa/drivers/windows/*/*.def \ $(DIRECTORY)/src/mesa/drivers/x11/descrip.mms \ + $(DIRECTORY)/src/mesa/drivers/x11/sources \ $(DIRECTORY)/src/mesa/drivers/x11/*.[ch] \ $(DIRECTORY)/src/mesa/ppc/*.[ch] \ $(DIRECTORY)/src/mesa/sparc/*.[chS] \ diff --git a/debian/changelog b/debian/changelog index 13aab843476..342741b5a05 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +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. diff --git a/docs/relnotes-6.5.2.html b/docs/relnotes-6.5.2.html index ba99420d7d1..a8eb970cd24 100644 --- a/docs/relnotes-6.5.2.html +++ b/docs/relnotes-6.5.2.html @@ -49,7 +49,10 @@ copy texturing).
  • radeon
  • savage
  • mga
  • +
  • tdfx
  • +
  • Added support for ARB_occlusion_query to the tdfx driver (Ian +Romanick).
  • Bug fixes

    @@ -69,6 +72,7 @@ copy texturing).
  • Fixed glDrawPixels(GL_COLOR_INDEX, GL_BITMAP) segfault (bug 9044)
  • Fixed some gluBuild2DMipmaps() bugs (Greg McGarragh)
  • Fixed broken "mgl" name mangling +
  • Indirect rending was broken for glMap* functions (bug 8899) diff --git a/src/glut/fbdev/callback.c b/src/glut/fbdev/callback.c index 37373672d36..946c8d8c133 100644 --- a/src/glut/fbdev/callback.c +++ b/src/glut/fbdev/callback.c @@ -24,6 +24,8 @@ * Written by Sean D'Epagnier (c) 2006 */ +#include + #include #include "internal.h" diff --git a/src/glut/fbdev/colormap.c b/src/glut/fbdev/colormap.c index 89556ef4a5c..3a81f93657d 100644 --- a/src/glut/fbdev/colormap.c +++ b/src/glut/fbdev/colormap.c @@ -24,6 +24,7 @@ * Written by Sean D'Epagnier (c) 2006 */ +#include #include #include @@ -37,7 +38,7 @@ #define TORMAP(x)(unsigned short)((x<0?0:x>1?1:x)*(GLfloat)(REVERSECMAPSIZE-1)) #define FROMCMAP(x) (GLfloat)x / (GLfloat)((1<<16) - 1) -static struct fb_cmap ColorMap; +static struct fb_cmap ColorMap, OriginalColorMap; unsigned short RedColorMap[256], GreenColorMap[256], BlueColorMap[256]; diff --git a/src/glut/fbdev/cursor.c b/src/glut/fbdev/cursor.c index 88386956a44..6cd087e93c8 100644 --- a/src/glut/fbdev/cursor.c +++ b/src/glut/fbdev/cursor.c @@ -28,8 +28,10 @@ to render the cursor, this is faster, it would be good to use a hardware cursor if it exists instead */ +#include #include #include +#include #include diff --git a/src/glut/fbdev/ext.c b/src/glut/fbdev/ext.c index 4a3c185a16d..65953e705b9 100644 --- a/src/glut/fbdev/ext.c +++ b/src/glut/fbdev/ext.c @@ -24,6 +24,8 @@ * Written by Sean D'Epagnier (c) 2006 */ +#include + #include #include diff --git a/src/glut/fbdev/fbdev.c b/src/glut/fbdev/fbdev.c index ce6419816dd..7b46d545920 100644 --- a/src/glut/fbdev/fbdev.c +++ b/src/glut/fbdev/fbdev.c @@ -571,7 +571,8 @@ void SetVideoMode(void) } /* initialize colormap */ - LoadColorMap(); + if(FixedInfo.visual != FB_VISUAL_TRUECOLOR) + LoadColorMap(); } void CreateBuffer() @@ -786,6 +787,7 @@ void glutDestroyWindow(int win) glFBDevDestroyContext(Context); glFBDevDestroyBuffer(Buffer); glFBDevDestroyVisual(Visual); + Visual = NULL; } diff --git a/src/glut/fbdev/gamemode.c b/src/glut/fbdev/gamemode.c index 9f32d9d7e82..30be36af7af 100644 --- a/src/glut/fbdev/gamemode.c +++ b/src/glut/fbdev/gamemode.c @@ -24,6 +24,7 @@ * Written by Sean D'Epagnier (c) 2006 */ +#include #include #include diff --git a/src/glut/fbdev/input.c b/src/glut/fbdev/input.c index 2528a74a105..d09de22ed7e 100644 --- a/src/glut/fbdev/input.c +++ b/src/glut/fbdev/input.c @@ -53,7 +53,7 @@ int GpmMouse; #endif -int CurrentVT; +int CurrentVT = 0; int ConsoleFD = -1; int KeyboardModifiers; @@ -529,14 +529,14 @@ static void VTSwitchHandler(int sig) /* this is a hack to turn the cursor off */ ioctl(FrameBufferFD, FBIOPUT_VSCREENINFO, &VarInfo); - RestoreColorMap(); + if(FixedInfo.visual != FB_VISUAL_TRUECOLOR) + RestoreColorMap(); Active = 1; Visible = 1; VisibleSwitch = 1; Redisplay = 1; - break; } } diff --git a/src/glut/fbdev/internal.h b/src/glut/fbdev/internal.h index 082cd4f6f3a..8801cc9f6c3 100644 --- a/src/glut/fbdev/internal.h +++ b/src/glut/fbdev/internal.h @@ -72,14 +72,13 @@ extern GLFBDevVisualPtr Visual; #define REVERSECMAPSIZE (1< +#include +#include #include diff --git a/src/glut/fbdev/state.c b/src/glut/fbdev/state.c index bca675c52c4..212a04aa028 100644 --- a/src/glut/fbdev/state.c +++ b/src/glut/fbdev/state.c @@ -24,6 +24,7 @@ * Written by Sean D'Epagnier (c) 2006 */ +#include #include #include diff --git a/src/glx/x11/XF86dri.c b/src/glx/x11/XF86dri.c index 0ce588276be..8909a047721 100644 --- a/src/glx/x11/XF86dri.c +++ b/src/glx/x11/XF86dri.c @@ -203,7 +203,7 @@ PUBLIC Bool XF86DRIOpenConnection(dpy, screen, hSAREA, busIdString) *hSAREA = rep.hSAREALow; if (sizeof(drm_handle_t) == 8) { - const int shift = 32; /* var to prevent warning on next line */ + int shift = 32; /* var to prevent warning on next line */ *hSAREA |= ((drm_handle_t) rep.hSAREAHigh) << shift; } @@ -566,7 +566,7 @@ PUBLIC Bool XF86DRIGetDeviceInfo(dpy, screen, hFrameBuffer, *hFrameBuffer = rep.hFrameBufferLow; if (sizeof(drm_handle_t) == 8) { - const int shift = 32; /* var to prevent warning on next line */ + int shift = 32; /* var to prevent warning on next line */ *hFrameBuffer |= ((drm_handle_t) rep.hFrameBufferHigh) << shift; } diff --git a/src/mesa/array_cache/sources b/src/mesa/array_cache/sources new file mode 100644 index 00000000000..fb3328d10e6 --- /dev/null +++ b/src/mesa/array_cache/sources @@ -0,0 +1,7 @@ +MESA_ARRAY_CACHE_SOURCES = \ +ac_context.c \ +ac_import.c + +MESA_ARRAY_CACHE_HEADERS = \ +ac_context.h \ +acache.h diff --git a/src/mesa/drivers/common/sources b/src/mesa/drivers/common/sources new file mode 100644 index 00000000000..90e29d78d3f --- /dev/null +++ b/src/mesa/drivers/common/sources @@ -0,0 +1,2 @@ +MESA_DRIVER_COMMON_SOURCES = \ +driverfuncs.c diff --git a/src/mesa/drivers/dri/i915tex/i830_context.h b/src/mesa/drivers/dri/i915tex/i830_context.h index e5377b300aa..3d754103c0a 100644 --- a/src/mesa/drivers/dri/i915tex/i830_context.h +++ b/src/mesa/drivers/dri/i915tex/i830_context.h @@ -156,6 +156,11 @@ do { \ */ extern void i830InitVtbl(struct i830_context *i830); +extern void +i830_state_draw_region(struct intel_context *intel, + struct i830_hw_state *state, + struct intel_region *color_region, + struct intel_region *depth_region); /* i830_context.c */ extern GLboolean diff --git a/src/mesa/drivers/dri/i915tex/i830_metaops.c b/src/mesa/drivers/dri/i915tex/i830_metaops.c index c90f5022229..f76646d89db 100644 --- a/src/mesa/drivers/dri/i915tex/i830_metaops.c +++ b/src/mesa/drivers/dri/i915tex/i830_metaops.c @@ -400,40 +400,12 @@ meta_import_pixel_state(struct intel_context *intel) */ static void meta_draw_region(struct intel_context *intel, - struct intel_region *draw_region, + struct intel_region *color_region, struct intel_region *depth_region) { struct i830_context *i830 = i830_context(&intel->ctx); - GLuint format; - GLuint depth_format = DEPTH_FRMT_16_FIXED; - intel_region_release(&i830->meta.draw_region); - intel_region_reference(&i830->meta.draw_region, draw_region); - - intel_region_release(&i830->meta.depth_region); - intel_region_reference(&i830->meta.depth_region, depth_region); - - /* XXX FBO: grab code from i915 meta_draw_region */ - - /* XXX: 555 support? - */ - if (draw_region->cpp == 2) - format = DV_PF_565; - else - format = DV_PF_8888; - - if (depth_region) { - if (depth_region->cpp == 2) - depth_format = DEPTH_FRMT_16_FIXED; - else - depth_format = DEPTH_FRMT_24_FIXED_8_OTHER; - } - - i830->meta.Buffer[I830_DESTREG_DV1] = (DSTORG_HORT_BIAS(0x8) | /* .5 */ - DSTORG_VERT_BIAS(0x8) | /* .5 */ - format | DEPTH_IS_Z | depth_format); - - i830->meta.emitted &= ~I830_UPLOAD_BUFFERS; + i830_state_draw_region(intel, &i830->meta, color_region, depth_region); } diff --git a/src/mesa/drivers/dri/i915tex/i830_vtbl.c b/src/mesa/drivers/dri/i915tex/i830_vtbl.c index 45502da290a..18fc6d4b91f 100644 --- a/src/mesa/drivers/dri/i915tex/i830_vtbl.c +++ b/src/mesa/drivers/dri/i915tex/i830_vtbl.c @@ -518,28 +518,79 @@ i830_destroy_context(struct intel_context *intel) _tnl_free_vertices(&intel->ctx); } -static void -i830_set_draw_region(struct intel_context *intel, - struct intel_region *draw_region, - struct intel_region *depth_region) + +void +i830_state_draw_region(struct intel_context *intel, + struct i830_hw_state *state, + struct intel_region *color_region, + struct intel_region *depth_region) { struct i830_context *i830 = i830_context(&intel->ctx); + GLuint value; - intel_region_release(&i830->state.draw_region); - intel_region_release(&i830->state.depth_region); - intel_region_reference(&i830->state.draw_region, draw_region); - intel_region_reference(&i830->state.depth_region, depth_region); + ASSERT(state == &i830->state || state == &i830->meta); - /* XXX FBO: Need code from i915_set_draw_region() */ + if (state->draw_region != color_region) { + intel_region_release(&state->draw_region); + intel_region_reference(&state->draw_region, color_region); + } + if (state->depth_region != depth_region) { + intel_region_release(&state->depth_region); + intel_region_reference(&state->depth_region, depth_region); + } + + /* + * Set stride/cpp values + */ + if (color_region) { + state->Buffer[I830_DESTREG_CBUFADDR0] = _3DSTATE_BUF_INFO_CMD; + state->Buffer[I830_DESTREG_CBUFADDR1] = + (BUF_3D_ID_COLOR_BACK | + BUF_3D_PITCH(color_region->pitch * color_region->cpp) | + BUF_3D_USE_FENCE); + } + + if (depth_region) { + state->Buffer[I830_DESTREG_DBUFADDR0] = _3DSTATE_BUF_INFO_CMD; + state->Buffer[I830_DESTREG_DBUFADDR1] = + (BUF_3D_ID_DEPTH | + BUF_3D_PITCH(depth_region->pitch * depth_region->cpp) | + BUF_3D_USE_FENCE); + } + + /* + * Compute/set I830_DESTREG_DV1 value + */ + value = (DSTORG_HORT_BIAS(0x8) | /* .5 */ + DSTORG_VERT_BIAS(0x8) | DEPTH_IS_Z); /* .5 */ + + if (color_region && color_region->cpp == 4) { + value |= DV_PF_8888; + } + else { + value |= DV_PF_565; + } + if (depth_region && depth_region->cpp == 4) { + value |= DEPTH_FRMT_24_FIXED_8_OTHER; + } + else { + value |= DEPTH_FRMT_16_FIXED; + } + state->Buffer[I830_DESTREG_DV1] = value; I830_STATECHANGE(i830, I830_UPLOAD_BUFFERS); - I830_STATECHANGE(i830, I830_UPLOAD_BUFFERS); - i830->state.Buffer[I830_DESTREG_CBUFADDR1] = - (BUF_3D_ID_COLOR_BACK | BUF_3D_PITCH(draw_region->pitch) | - BUF_3D_USE_FENCE); - i830->state.Buffer[I830_DESTREG_DBUFADDR1] = - (BUF_3D_ID_DEPTH | BUF_3D_PITCH(depth_region->pitch) | - BUF_3D_USE_FENCE); + + +} + + +static void +i830_set_draw_region(struct intel_context *intel, + struct intel_region *color_region, + struct intel_region *depth_region) +{ + struct i830_context *i830 = i830_context(&intel->ctx); + i830_state_draw_region(intel, &i830->state, color_region, depth_region); } #if 0 diff --git a/src/mesa/drivers/dri/i915tex/intel_blit.c b/src/mesa/drivers/dri/i915tex/intel_blit.c index b6b65439087..550669ab0c8 100644 --- a/src/mesa/drivers/dri/i915tex/intel_blit.c +++ b/src/mesa/drivers/dri/i915tex/intel_blit.c @@ -277,6 +277,30 @@ intelEmitFillBlit(struct intel_context *intel, } +static GLuint translate_raster_op(GLenum logicop) +{ + switch(logicop) { + case GL_CLEAR: return 0x00; + case GL_AND: return 0x88; + case GL_AND_REVERSE: return 0x44; + case GL_COPY: return 0xCC; + case GL_AND_INVERTED: return 0x22; + case GL_NOOP: return 0xAA; + case GL_XOR: return 0x66; + case GL_OR: return 0xEE; + case GL_NOR: return 0x11; + case GL_EQUIV: return 0x99; + case GL_INVERT: return 0x55; + case GL_OR_REVERSE: return 0xDD; + case GL_COPY_INVERTED: return 0x33; + case GL_OR_INVERTED: return 0xBB; + case GL_NAND: return 0x77; + case GL_SET: return 0xFF; + default: return 0; + } +} + + /* Copy BitBlt */ void @@ -289,7 +313,9 @@ intelEmitCopyBlit(struct intel_context *intel, struct _DriBufferObject *dst_buffer, GLuint dst_offset, GLshort src_x, GLshort src_y, - GLshort dst_x, GLshort dst_y, GLshort w, GLshort h) + GLshort dst_x, GLshort dst_y, + GLshort w, GLshort h, + GLenum logic_op) { GLuint CMD, BR13; int dst_y2 = dst_y + h; @@ -309,13 +335,14 @@ intelEmitCopyBlit(struct intel_context *intel, case 1: case 2: case 3: - BR13 = (((GLint) dst_pitch) & 0xffff) | (0xCC << 16) | (1 << 24); + BR13 = (((GLint) dst_pitch) & 0xffff) | + (translate_raster_op(logic_op) << 16) | (1 << 24); CMD = XY_SRC_COPY_BLT_CMD; break; case 4: BR13 = - (((GLint) dst_pitch) & 0xffff) | (0xCC << 16) | (1 << 24) | (1 << - 25); + (((GLint) dst_pitch) & 0xffff) | + (translate_raster_op(logic_op) << 16) | (1 << 24) | (1 << 25); CMD = (XY_SRC_COPY_BLT_CMD | XY_SRC_COPY_BLT_WRITE_ALPHA | XY_SRC_COPY_BLT_WRITE_RGB); diff --git a/src/mesa/drivers/dri/i915tex/intel_blit.h b/src/mesa/drivers/dri/i915tex/intel_blit.h index ee85c626334..e7bc280f58a 100644 --- a/src/mesa/drivers/dri/i915tex/intel_blit.h +++ b/src/mesa/drivers/dri/i915tex/intel_blit.h @@ -47,7 +47,8 @@ extern void intelEmitCopyBlit(struct intel_context *intel, GLuint dst_offset, GLshort srcx, GLshort srcy, GLshort dstx, GLshort dsty, - GLshort w, GLshort h); + GLshort w, GLshort h, + GLenum logicop ); extern void intelEmitFillBlit(struct intel_context *intel, GLuint cpp, diff --git a/src/mesa/drivers/dri/i915tex/intel_pixel.c b/src/mesa/drivers/dri/i915tex/intel_pixel.c index 4fe128deea1..9018e3daef4 100644 --- a/src/mesa/drivers/dri/i915tex/intel_pixel.c +++ b/src/mesa/drivers/dri/i915tex/intel_pixel.c @@ -56,8 +56,9 @@ intel_check_blit_fragment_ops(GLcontext * ctx) !ctx->Color.ColorMask[1] || !ctx->Color.ColorMask[2] || !ctx->Color.ColorMask[3] || - ctx->Color.ColorLogicOpEnabled || - ctx->Texture._EnabledUnits || ctx->FragmentProgram._Enabled); + ctx->Texture._EnabledUnits || + ctx->FragmentProgram._Enabled || + ctx->Color.BlendEnabled); } diff --git a/src/mesa/drivers/dri/i915tex/intel_pixel_copy.c b/src/mesa/drivers/dri/i915tex/intel_pixel_copy.c index 5eb021f008b..9d478283e47 100644 --- a/src/mesa/drivers/dri/i915tex/intel_pixel_copy.c +++ b/src/mesa/drivers/dri/i915tex/intel_pixel_copy.c @@ -95,9 +95,9 @@ intel_check_copypixel_blit_fragment_ops(GLcontext * ctx) !ctx->Color.ColorMask[1] || !ctx->Color.ColorMask[2] || !ctx->Color.ColorMask[3] || - ctx->Color.ColorLogicOpEnabled || ctx->Texture._EnabledUnits || - ctx->FragmentProgram._Enabled); + ctx->FragmentProgram._Enabled || + ctx->Color.BlendEnabled); } /* Doesn't work for overlapping regions. Could do a double copy or @@ -344,9 +344,12 @@ do_blit_copypixels(GLcontext * ctx, intelEmitCopyBlit(intel, dst->cpp, src->pitch, src->buffer, 0, dst->pitch, dst->buffer, 0, - rect.x1 + delta_x, rect.y1 + delta_y, /* srcx, srcy */ + rect.x1 + delta_x, + rect.y1 + delta_y, /* srcx, srcy */ rect.x1, rect.y1, /* dstx, dsty */ - rect.x2 - rect.x1, rect.y2 - rect.y1); + rect.x2 - rect.x1, rect.y2 - rect.y1, + ctx->Color.ColorLogicOpEnabled ? + ctx->Color.LogicOp : GL_COPY); } out: diff --git a/src/mesa/drivers/dri/i915tex/intel_pixel_draw.c b/src/mesa/drivers/dri/i915tex/intel_pixel_draw.c index 616101aef99..10a079896ae 100644 --- a/src/mesa/drivers/dri/i915tex/intel_pixel_draw.c +++ b/src/mesa/drivers/dri/i915tex/intel_pixel_draw.c @@ -252,9 +252,9 @@ do_blit_drawpixels(GLcontext * ctx, return GL_FALSE; } - if (!intel_check_meta_tex_fragment_ops(ctx)) { + if (!intel_check_blit_fragment_ops(ctx)) { if (INTEL_DEBUG & DEBUG_PIXEL) - _mesa_printf("%s - bad GL fragment state for meta tex\n", + _mesa_printf("%s - bad GL fragment state for blitter\n", __FUNCTION__); return GL_FALSE; } @@ -320,17 +320,19 @@ do_blit_drawpixels(GLcontext * ctx, rect.x1 - dest_rect.x1, rect.y2 - dest_rect.y2, rect.x1, - rect.y1, rect.x2 - rect.x1, rect.y2 - rect.y1); + rect.y1, rect.x2 - rect.x1, rect.y2 - rect.y1, + ctx->Color.ColorLogicOpEnabled ? + ctx->Color.LogicOp : GL_COPY); } fence = intel_batchbuffer_flush(intel->batch); driFenceReference(fence); } UNLOCK_HARDWARE(intel); - if (intel->driDrawable->numClipRects) + if (fence) { driFenceFinish(fence, DRM_FENCE_TYPE_EXE | DRM_I915_FENCE_TYPE_RW, GL_FALSE); - - driFenceUnReference(fence); + driFenceUnReference(fence); + } if (INTEL_DEBUG & DEBUG_PIXEL) _mesa_printf("%s - DONE\n", __FUNCTION__); diff --git a/src/mesa/drivers/dri/i915tex/intel_pixel_read.c b/src/mesa/drivers/dri/i915tex/intel_pixel_read.c index c1cc65674d1..24e49ae0663 100644 --- a/src/mesa/drivers/dri/i915tex/intel_pixel_read.c +++ b/src/mesa/drivers/dri/i915tex/intel_pixel_read.c @@ -271,7 +271,8 @@ do_blit_readpixels(GLcontext * ctx, rect.y1, rect.x1 - src_rect.x1, rect.y2 - src_rect.y2, - rect.x2 - rect.x1, rect.y2 - rect.y1); + rect.x2 - rect.x1, rect.y2 - rect.y1, + GL_COPY); } fence = intel_batchbuffer_flush(intel->batch); @@ -280,11 +281,12 @@ do_blit_readpixels(GLcontext * ctx, } UNLOCK_HARDWARE(intel); - if (intel->driDrawable->numClipRects) + if (fence) { driFenceFinish(fence, DRM_FENCE_TYPE_EXE | DRM_I915_FENCE_TYPE_RW, GL_FALSE); + driFenceUnReference(fence); + } - driFenceUnReference(fence); if (INTEL_DEBUG & DEBUG_PIXEL) _mesa_printf("%s - DONE\n", __FUNCTION__); diff --git a/src/mesa/drivers/dri/i915tex/intel_regions.c b/src/mesa/drivers/dri/i915tex/intel_regions.c index 064a34cda81..1205b180ca6 100644 --- a/src/mesa/drivers/dri/i915tex/intel_regions.c +++ b/src/mesa/drivers/dri/i915tex/intel_regions.c @@ -318,7 +318,8 @@ intel_region_copy(intelScreenPrivate *intelScreen, dst->cpp, src->pitch, src->buffer, src_offset, dst->pitch, dst->buffer, dst_offset, - srcx, srcy, dstx, dsty, width, height); + srcx, srcy, dstx, dsty, width, height, + GL_COPY); } /* Fill a rectangular sub-region. Need better logic about when to @@ -433,7 +434,9 @@ intel_region_cow(intelScreenPrivate *intelScreen, struct intel_region *region) region->buffer, 0, region->pitch, pbo->buffer, 0, - 0, 0, 0, 0, region->pitch, region->height); + 0, 0, 0, 0, + region->pitch, region->height, + GL_COPY); intel_batchbuffer_flush(intel->batch); UNLOCK_HARDWARE(intel); @@ -445,7 +448,9 @@ intel_region_cow(intelScreenPrivate *intelScreen, struct intel_region *region) region->buffer, 0, region->pitch, pbo->buffer, 0, - 0, 0, 0, 0, region->pitch, region->height); + 0, 0, 0, 0, + region->pitch, region->height, + GL_COPY); intel_batchbuffer_flush(intel->batch); } diff --git a/src/mesa/drivers/dri/i915tex/intel_tex_copy.c b/src/mesa/drivers/dri/i915tex/intel_tex_copy.c index 88b62e781c0..b85a25642a2 100644 --- a/src/mesa/drivers/dri/i915tex/intel_tex_copy.c +++ b/src/mesa/drivers/dri/i915tex/intel_tex_copy.c @@ -145,7 +145,8 @@ do_copy_texsubimage(struct intel_context *intel, intelImage->mt->pitch, intelImage->mt->region->buffer, image_offset, - x, y + height, dstx, dsty, width, height); + x, y + height, dstx, dsty, width, height, + GL_COPY); /* ? */ intel_batchbuffer_flush(intel->batch); } diff --git a/src/mesa/drivers/dri/i915tex/intel_tex_image.c b/src/mesa/drivers/dri/i915tex/intel_tex_image.c index 79f377a4b72..22221e7322c 100644 --- a/src/mesa/drivers/dri/i915tex/intel_tex_image.c +++ b/src/mesa/drivers/dri/i915tex/intel_tex_image.c @@ -232,7 +232,8 @@ try_pbo_upload(struct intel_context *intel, intelImage->mt->cpp, src_stride, src_buffer, src_offset, dst_stride, dst_buffer, dst_offset, - 0, 0, 0, 0, width, height); + 0, 0, 0, 0, width, height, + GL_COPY); intel_batchbuffer_flush(intel->batch); } diff --git a/src/mesa/drivers/dri/i965/brw_attrib.h b/src/mesa/drivers/dri/i965/brw_attrib.h index a8efc3a528b..12659bd1cf0 100644 --- a/src/mesa/drivers/dri/i965/brw_attrib.h +++ b/src/mesa/drivers/dri/i965/brw_attrib.h @@ -95,6 +95,7 @@ enum { } ; #define BRW_ATTRIB_FIRST_MATERIAL BRW_ATTRIB_MAT_FRONT_AMBIENT +#define BRW_ATTRIB_LAST_MATERIAL BRW_ATTRIB_MAT_BACK_INDEXES #define BRW_MAX_COPIED_VERTS 3 diff --git a/src/mesa/drivers/dri/i965/brw_draw.c b/src/mesa/drivers/dri/i965/brw_draw.c index 5c0c5da7eaa..471fda9f7ef 100644 --- a/src/mesa/drivers/dri/i965/brw_draw.c +++ b/src/mesa/drivers/dri/i965/brw_draw.c @@ -209,7 +209,7 @@ static void brw_merge_inputs( struct brw_context *brw, if (arrays[i] && arrays[i]->Enabled) { brw->vb.inputs[i].glarray = arrays[i]; - brw->vb.info.varying |= 1 << i; + brw->vb.info.varying |= (GLuint64EXT) 1 << i; } else { diff --git a/src/mesa/drivers/dri/i965/brw_draw_upload.c b/src/mesa/drivers/dri/i965/brw_draw_upload.c index cde0aa6481b..57ee294f0cf 100644 --- a/src/mesa/drivers/dri/i965/brw_draw_upload.c +++ b/src/mesa/drivers/dri/i965/brw_draw_upload.c @@ -393,7 +393,7 @@ GLboolean brw_upload_vertices( struct brw_context *brw, { GLcontext *ctx = &brw->intel.ctx; struct intel_context *intel = intel_context(ctx); - GLuint tmp = brw->vs.prog_data->inputs_read; + GLuint64EXT tmp = brw->vs.prog_data->inputs_read; struct brw_vertex_element_packet vep; struct brw_array_state vbp; GLuint i; @@ -414,10 +414,10 @@ GLboolean brw_upload_vertices( struct brw_context *brw, */ while (tmp) { - GLuint i = ffs(tmp)-1; + GLuint i = ffsll(tmp)-1; struct brw_vertex_element *input = &brw->vb.inputs[i]; - tmp &= ~(1<index = i; diff --git a/src/mesa/drivers/dri/i965/brw_save_api.c b/src/mesa/drivers/dri/i965/brw_save_api.c index c541fbe0f46..06ed1d23aa2 100644 --- a/src/mesa/drivers/dri/i965/brw_save_api.c +++ b/src/mesa/drivers/dri/i965/brw_save_api.c @@ -417,7 +417,7 @@ static void _save_copy_to_current( GLcontext *ctx ) struct brw_save_context *save = IMM_CONTEXT(ctx)->save; GLuint i; - for (i = BRW_ATTRIB_POS+1 ; i <= BRW_ATTRIB_INDEX ; i++) { + for (i = BRW_ATTRIB_POS+1 ; i < BRW_ATTRIB_MAX ; i++) { if (save->attrsz[i]) { save->currentsz[i][0] = save->attrsz[i]; COPY_CLEAN_4V(save->current[i], @@ -445,7 +445,7 @@ static void _save_copy_from_current( GLcontext *ctx ) struct brw_save_context *save = IMM_CONTEXT(ctx)->save; GLint i; - for (i = BRW_ATTRIB_POS+1 ; i <= BRW_ATTRIB_INDEX ; i++) + for (i = BRW_ATTRIB_POS+1 ; i < BRW_ATTRIB_MAX ; i++) switch (save->attrsz[i]) { case 4: save->attrptr[i][3] = save->current[i][3]; case 3: save->attrptr[i][2] = save->current[i][2]; @@ -1121,7 +1121,7 @@ static void _save_current_init( GLcontext *ctx ) save->current[i] = ctx->ListState.CurrentAttrib[i]; } - for (i = BRW_ATTRIB_FIRST_MATERIAL; i < BRW_ATTRIB_INDEX; i++) { + for (i = BRW_ATTRIB_FIRST_MATERIAL; i <= BRW_ATTRIB_LAST_MATERIAL; i++) { const GLuint j = i - BRW_ATTRIB_FIRST_MATERIAL; ASSERT(j < MAT_ATTRIB_MAX); save->currentsz[i] = &ctx->ListState.ActiveMaterialSize[j]; diff --git a/src/mesa/drivers/dri/i965/brw_save_draw.c b/src/mesa/drivers/dri/i965/brw_save_draw.c index 84f74d3f6cf..cebdd8d0607 100644 --- a/src/mesa/drivers/dri/i965/brw_save_draw.c +++ b/src/mesa/drivers/dri/i965/brw_save_draw.c @@ -38,7 +38,10 @@ #include "brw_draw.h" #include "brw_fallback.h" - +/* + * After playback, copy everything but the position from the + * last vertex to the saved state + */ static void _playback_copy_to_current( GLcontext *ctx, const struct brw_save_vertex_list *node ) { @@ -47,21 +50,30 @@ static void _playback_copy_to_current( GLcontext *ctx, GLuint i, offset; if (node->count) - offset = node->buffer_offset + (node->count-1) * node->vertex_size; + offset = (node->buffer_offset + + (node->count-1) * node->vertex_size * sizeof(GLfloat)); else offset = node->buffer_offset; - ctx->Driver.GetBufferSubData( ctx, 0, offset, node->vertex_size, + ctx->Driver.GetBufferSubData( ctx, 0, offset, + node->vertex_size * sizeof(GLfloat), data, node->vertex_store->bufferobj ); - for (i = BRW_ATTRIB_POS+1 ; i <= BRW_ATTRIB_INDEX ; i++) { + for (i = 0 ; i < BRW_ATTRIB_MAX ; i++) { if (node->attrsz[i]) { - COPY_CLEAN_4V(save->current[i], node->attrsz[i], data); - data += node->attrsz[i]; + if (i != BRW_ATTRIB_POS) + COPY_CLEAN_4V(save->current[i], node->attrsz[i], data); if (i >= BRW_ATTRIB_MAT_FRONT_AMBIENT && i <= BRW_ATTRIB_MAT_BACK_INDEXES) ctx->NewState |= _NEW_LIGHT; + + /* Edgeflag requires special treatment: + */ + if (i == BRW_ATTRIB_EDGEFLAG) + ctx->Current.EdgeFlag = (data[0] == 1.0); + + data += node->attrsz[i] * sizeof(GLfloat); } } @@ -105,7 +117,7 @@ static void brw_bind_vertex_list( struct brw_save_context *save, memset(arrays, 0, BRW_ATTRIB_MAX * sizeof(arrays[0])); - for (attr = 0; attr <= BRW_ATTRIB_INDEX; attr++) { + for (attr = 0; attr < BRW_ATTRIB_MAX; attr++) { if (node->attrsz[attr]) { arrays[attr].Ptr = (const GLubyte *)data; arrays[attr].Size = node->attrsz[attr]; diff --git a/src/mesa/drivers/dri/i965/brw_vs_emit.c b/src/mesa/drivers/dri/i965/brw_vs_emit.c index da9d3bacb0e..8403e1bd7b6 100644 --- a/src/mesa/drivers/dri/i965/brw_vs_emit.c +++ b/src/mesa/drivers/dri/i965/brw_vs_emit.c @@ -78,7 +78,7 @@ static void brw_vs_alloc_regs( struct brw_vs_compile *c ) */ c->nr_inputs = 0; for (i = 0; i < BRW_ATTRIB_MAX; i++) { - if (c->prog_data.inputs_read & (1<prog_data.inputs_read & ((GLuint64EXT)1<nr_inputs++; c->regs[PROGRAM_INPUT][i] = brw_vec8_grf(reg, 0); reg++; diff --git a/src/mesa/drivers/dri/i965/brw_vs_tnl.c b/src/mesa/drivers/dri/i965/brw_vs_tnl.c index 52bdb9d7614..b7893ca3e55 100644 --- a/src/mesa/drivers/dri/i965/brw_vs_tnl.c +++ b/src/mesa/drivers/dri/i965/brw_vs_tnl.c @@ -146,8 +146,8 @@ static void make_state_key( GLcontext *ctx, struct state_key *key ) } /* BRW_NEW_INPUT_VARYING */ - for (i = BRW_ATTRIB_MAT_FRONT_AMBIENT ; i < BRW_ATTRIB_INDEX ; i++) - if (brw->vb.info.varying & (1<vb.info.varying & ((GLuint64EXT)1<light_material_mask |= 1<<(i-BRW_ATTRIB_MAT_FRONT_AMBIENT); for (i = 0; i < MAX_LIGHTS; i++) { @@ -374,16 +374,17 @@ static void release_temps( struct tnl_program *p ) static struct ureg register_input( struct tnl_program *p, GLuint input ) { + GLuint orig_input = input; /* Cram the material flags into the generic range. We'll translate * them back later. */ if (input >= BRW_ATTRIB_MAT_FRONT_AMBIENT) - input -= BRW_ATTRIB_MAT_FRONT_AMBIENT; + input -= BRW_ATTRIB_MAT_FRONT_AMBIENT - BRW_ATTRIB_GENERIC0; assert(input < 32); p->program->Base.InputsRead |= (1<= 0 ); + assert( logic_op - GL_CLEAR < 0x10 ); + src_pitch *= cpp; dst_pitch *= cpp; @@ -257,11 +284,12 @@ void intelEmitCopyBlit( struct intel_context *intel, case 1: case 2: case 3: - BR13 = (0xCC << 16) | (1<<24); + BR13 = (translate_raster_op(logic_op) << 16) | (1<<24); CMD = XY_SRC_COPY_BLT_CMD; break; case 4: - BR13 = (0xCC << 16) | (1<<24) | (1<<25); + BR13 = (translate_raster_op(logic_op) << 16) | (1<<24) | + (1<<25); CMD = (XY_SRC_COPY_BLT_CMD | XY_SRC_COPY_BLT_WRITE_ALPHA | XY_SRC_COPY_BLT_WRITE_RGB); break; diff --git a/src/mesa/drivers/dri/i965/intel_blit.h b/src/mesa/drivers/dri/i965/intel_blit.h index b15fb1c2b7f..8b0cc65243c 100644 --- a/src/mesa/drivers/dri/i965/intel_blit.h +++ b/src/mesa/drivers/dri/i965/intel_blit.h @@ -49,7 +49,8 @@ extern void intelEmitCopyBlit( struct intel_context *intel, GLboolean dst_tiled, GLshort srcx, GLshort srcy, GLshort dstx, GLshort dsty, - GLshort w, GLshort h ); + GLshort w, GLshort h, + GLenum logic_op ); extern void intelEmitFillBlit( struct intel_context *intel, GLuint cpp, diff --git a/src/mesa/drivers/dri/i965/intel_pixel_copy.c b/src/mesa/drivers/dri/i965/intel_pixel_copy.c index d5d48994529..55b58a8f670 100644 --- a/src/mesa/drivers/dri/i965/intel_pixel_copy.c +++ b/src/mesa/drivers/dri/i965/intel_pixel_copy.c @@ -92,9 +92,9 @@ intel_check_blit_fragment_ops(GLcontext * ctx) !ctx->Color.ColorMask[1] || !ctx->Color.ColorMask[2] || !ctx->Color.ColorMask[3] || /* can do this! */ - ctx->Color.ColorLogicOpEnabled || /* can do this! */ ctx->Texture._EnabledUnits || - ctx->FragmentProgram._Enabled); + ctx->FragmentProgram._Enabled || + ctx->Color.BlendEnabled); } @@ -210,7 +210,9 @@ do_blit_copypixels(GLcontext * ctx, rect.x1 + delta_x, rect.y1 + delta_y, /* srcx, srcy */ rect.x1, rect.y1, /* dstx, dsty */ - rect.x2 - rect.x1, rect.y2 - rect.y1); + rect.x2 - rect.x1, rect.y2 - rect.y1, + ctx->Color.ColorLogicOpEnabled ? + ctx->Color.LogicOp : GL_COPY); } intel->need_flush = GL_TRUE; diff --git a/src/mesa/drivers/dri/i965/intel_regions.c b/src/mesa/drivers/dri/i965/intel_regions.c index 53f05612377..398b0a0a3b5 100644 --- a/src/mesa/drivers/dri/i965/intel_regions.c +++ b/src/mesa/drivers/dri/i965/intel_regions.c @@ -269,7 +269,8 @@ void intel_region_copy( struct intel_context *intel, dst->pitch, dst->buffer, dst_offset, dst->tiled, srcx, srcy, dstx, dsty, - width, height); + width, height, + GL_COPY ); } /* Fill a rectangular sub-region. Need better logic about when to diff --git a/src/mesa/drivers/dri/r200/r200_fragshader.c b/src/mesa/drivers/dri/r200/r200_fragshader.c index c350b9aaf3f..5dd3adaef69 100644 --- a/src/mesa/drivers/dri/r200/r200_fragshader.c +++ b/src/mesa/drivers/dri/r200/r200_fragshader.c @@ -362,7 +362,7 @@ static void r200UpdateFSRouting( GLcontext *ctx ) { if (shader->NumPasses < 2) { for (reg = 0; reg < R200_MAX_TEXTURE_UNITS; reg++) { - struct gl_texture_object *texObj = ctx->Texture.Unit[reg]._Current; + GLbitfield targetbit = ctx->Texture.Unit[reg]._ReallyEnabled; R200_STATECHANGE( rmesa, tex[reg] ); rmesa->hw.tex[reg].cmd[TEX_PP_TXMULTI_CTL] = 0; if (shader->SetupInst[0][reg].Opcode) { @@ -385,15 +385,16 @@ static void r200UpdateFSRouting( GLcontext *ctx ) { else { txformat_x |= R200_TEXCOORD_PROJ; } + rmesa->hw.ctx.cmd[CTX_PP_CNTL] |= R200_TEX_0_ENABLE << reg; } - else if (texObj->Target == GL_TEXTURE_3D) { + else if (targetbit == TEXTURE_3D_BIT) { txformat_x |= R200_TEXCOORD_VOLUME; } - else if (texObj->Target == GL_TEXTURE_CUBE_MAP) { + else if (targetbit == TEXTURE_CUBE_BIT) { txformat_x |= R200_TEXCOORD_CUBIC_ENV; } else if (shader->SetupInst[0][reg].swizzle == GL_SWIZZLE_STR_ATI || - shader->SetupInst[0][reg].swizzle == GL_SWIZZLE_STQ_ATI) { + shader->SetupInst[0][reg].swizzle == GL_SWIZZLE_STQ_ATI) { txformat_x |= R200_TEXCOORD_NONPROJ; } else { @@ -401,16 +402,16 @@ static void r200UpdateFSRouting( GLcontext *ctx ) { } rmesa->hw.tex[reg].cmd[TEX_PP_TXFORMAT] = txformat; rmesa->hw.tex[reg].cmd[TEX_PP_TXFORMAT_X] = txformat_x; - /* is this a good idea? Could potentially sample from not enabled unit. - results are probably undefined anyway (?) but I hope it doesn't lock up... */ - rmesa->hw.ctx.cmd[CTX_PP_CNTL] |= R200_TEX_0_ENABLE << reg; + /* enabling texturing when unit isn't correctly configured may not be safe */ + if (targetbit) + rmesa->hw.ctx.cmd[CTX_PP_CNTL] |= R200_TEX_0_ENABLE << reg; } } } else { /* setup 1st pass */ for (reg = 0; reg < R200_MAX_TEXTURE_UNITS; reg++) { - struct gl_texture_object *texObj = ctx->Texture.Unit[reg]._Current; + GLbitfield targetbit = ctx->Texture.Unit[reg]._ReallyEnabled; R200_STATECHANGE( rmesa, tex[reg] ); GLuint txformat_multi = 0; if (shader->SetupInst[0][reg].Opcode) { @@ -425,11 +426,12 @@ static void r200UpdateFSRouting( GLcontext *ctx ) { else { txformat_multi |= R200_PASS1_TEXCOORD_PROJ; } + rmesa->hw.cst.cmd[CST_PP_CNTL_X] |= R200_PPX_TEX_0_ENABLE << reg; } - else if (texObj->Target == GL_TEXTURE_3D) { + else if (targetbit == TEXTURE_3D_BIT) { txformat_multi |= R200_PASS1_TEXCOORD_VOLUME; } - else if (texObj->Target == GL_TEXTURE_CUBE_MAP) { + else if (targetbit == TEXTURE_CUBE_BIT) { txformat_multi |= R200_PASS1_TEXCOORD_CUBIC_ENV; } else if (shader->SetupInst[0][reg].swizzle == GL_SWIZZLE_STR_ATI || @@ -439,14 +441,15 @@ static void r200UpdateFSRouting( GLcontext *ctx ) { else { txformat_multi |= R200_PASS1_TEXCOORD_PROJ; } - rmesa->hw.cst.cmd[CST_PP_CNTL_X] |= R200_PPX_TEX_0_ENABLE << reg; + if (targetbit) + rmesa->hw.cst.cmd[CST_PP_CNTL_X] |= R200_PPX_TEX_0_ENABLE << reg; } rmesa->hw.tex[reg].cmd[TEX_PP_TXMULTI_CTL] = txformat_multi; } /* setup 2nd pass */ for (reg=0; reg < R200_MAX_TEXTURE_UNITS; reg++) { - struct gl_texture_object *texObj = ctx->Texture.Unit[reg]._Current; + GLbitfield targetbit = ctx->Texture.Unit[reg]._ReallyEnabled; if (shader->SetupInst[1][reg].Opcode) { GLuint coord = shader->SetupInst[1][reg].src; GLuint txformat = rmesa->hw.tex[reg].cmd[TEX_PP_TXFORMAT] @@ -463,15 +466,16 @@ static void r200UpdateFSRouting( GLcontext *ctx ) { else { txformat_x |= R200_TEXCOORD_PROJ; } + rmesa->hw.ctx.cmd[CTX_PP_CNTL] |= R200_TEX_0_ENABLE << reg; } - else if (texObj->Target == GL_TEXTURE_3D) { + else if (targetbit == TEXTURE_3D_BIT) { txformat_x |= R200_TEXCOORD_VOLUME; } - else if (texObj->Target == GL_TEXTURE_CUBE_MAP) { + else if (targetbit == TEXTURE_CUBE_BIT) { txformat_x |= R200_TEXCOORD_CUBIC_ENV; } else if (shader->SetupInst[1][reg].swizzle == GL_SWIZZLE_STR_ATI || - shader->SetupInst[1][reg].swizzle == GL_SWIZZLE_STQ_ATI) { + shader->SetupInst[1][reg].swizzle == GL_SWIZZLE_STQ_ATI) { txformat_x |= R200_TEXCOORD_NONPROJ; } else { @@ -488,7 +492,8 @@ static void r200UpdateFSRouting( GLcontext *ctx ) { } rmesa->hw.tex[reg].cmd[TEX_PP_TXFORMAT_X] = txformat_x; rmesa->hw.tex[reg].cmd[TEX_PP_TXFORMAT] = txformat; - rmesa->hw.ctx.cmd[CTX_PP_CNTL] |= R200_TEX_0_ENABLE << reg; + if (targetbit) + rmesa->hw.ctx.cmd[CTX_PP_CNTL] |= R200_TEX_0_ENABLE << reg; } } } diff --git a/src/mesa/drivers/dri/r300/r300_fragprog.c b/src/mesa/drivers/dri/r300/r300_fragprog.c index cab54512146..32c0128eaa2 100644 --- a/src/mesa/drivers/dri/r300/r300_fragprog.c +++ b/src/mesa/drivers/dri/r300/r300_fragprog.c @@ -544,8 +544,6 @@ static pfs_reg_t t_scalar_src(struct r300_fragment_program *rp, struct prog_src_register src = fpsrc; int sc = GET_SWZ(fpsrc.Swizzle, 0); /* X */ - printf("sc %d\n",sc); - src.Swizzle = ((sc<<0)|(sc<<3)|(sc<<6)|(sc<<9)); return t_src(rp, src); @@ -1670,7 +1668,7 @@ void r300_translate_fragment_shader(struct r300_fragment_program *rp) assert(rp->alu_end >= 0); rp->translated = GL_TRUE; - if (1) dump_program(rp); + if (0) dump_program(rp); } update_params(rp); diff --git a/src/mesa/drivers/x11/sources b/src/mesa/drivers/x11/sources new file mode 100644 index 00000000000..d76d65eaad1 --- /dev/null +++ b/src/mesa/drivers/x11/sources @@ -0,0 +1,8 @@ +# Note: only listing sources needed for X server renderer +MESA_DRIVER_X11_SOURCES = \ +xm_api.c \ +xm_buffer.c \ +xm_dd.c \ +xm_line.c \ +xm_span.c \ +xm_tri.c diff --git a/src/mesa/glapi/sources b/src/mesa/glapi/sources new file mode 100644 index 00000000000..1d5c2528211 --- /dev/null +++ b/src/mesa/glapi/sources @@ -0,0 +1,12 @@ +MESA_GLAPI_SOURCES = \ +glapi.c \ +glthread.c + +MESA_GLAPI_HEADERS = \ +dispatch.h \ +glapi.h \ +glapioffsets.h \ +glapitable.h \ +glapitemp.h \ +glprocs.h \ +glthread.h diff --git a/src/mesa/main/api_arrayelt.c b/src/mesa/main/api_arrayelt.c index 804700118f2..1899975213f 100644 --- a/src/mesa/main/api_arrayelt.c +++ b/src/mesa/main/api_arrayelt.c @@ -1051,7 +1051,7 @@ GLboolean _ae_create_context( GLcontext *ctx ) FogCoordFuncs[6] = _gloffset_FogCoordfvEXT; FogCoordFuncs[7] = _gloffset_FogCoorddvEXT; - ctx->aelt_context = MALLOC( sizeof(AEcontext) ); + ctx->aelt_context = CALLOC( sizeof(AEcontext) ); if (!ctx->aelt_context) return GL_FALSE; @@ -1076,6 +1076,7 @@ static void check_vbo( AEcontext *actx, for (i = 0; i < actx->nr_vbos; i++) if (actx->vbo[i] == vbo) return; + assert(actx->nr_vbos < VERT_ATTRIB_MAX); actx->vbo[actx->nr_vbos++] = vbo; } } @@ -1094,6 +1095,8 @@ static void _ae_update_state( GLcontext *ctx ) AEattrib *at = actx->attribs; GLuint i; + actx->nr_vbos = 0; + /* conventional vertex arrays */ if (ctx->Array.ArrayObj->Index.Enabled) { aa->array = &ctx->Array.ArrayObj->Index; @@ -1143,7 +1146,7 @@ static void _ae_update_state( GLcontext *ctx ) [at->array->Size-1] [TYPE_IDX(at->array->Type)]; at->index = VERT_ATTRIB_TEX0 + i; - check_vbo(actx, aa->array->BufferObj); + check_vbo(actx, at->array->BufferObj); at++; } } @@ -1170,7 +1173,7 @@ static void _ae_update_state( GLcontext *ctx ) [TYPE_IDX(at->array->Type)]; } at->index = i; - check_vbo(actx, aa->array->BufferObj); + check_vbo(actx, at->array->BufferObj); at++; } } @@ -1220,7 +1223,8 @@ void _ae_map_vbos( GLcontext *ctx ) GL_DYNAMIC_DRAW_ARB, actx->vbo[i]); - actx->mapped_vbos = GL_TRUE; + if (actx->nr_vbos) + actx->mapped_vbos = GL_TRUE; } void _ae_unmap_vbos( GLcontext *ctx ) @@ -1295,6 +1299,19 @@ void _ae_invalidate_state( GLcontext *ctx, GLuint new_state ) { AEcontext *actx = AE_CONTEXT(ctx); - assert(!actx->mapped_vbos); - actx->NewState |= new_state; + + /* Only interested in this subset of mesa state. Need to prune + * this down as both tnl/ and the drivers can raise statechanges + * for arcane reasons in the middle of seemingly atomic operations + * like DrawElements, over which we'd like to keep a known set of + * arrays and vbo's mapped. + * + * Luckily, neither the drivers nor tnl muck with the state that + * concerns us here: + */ + new_state &= _NEW_ARRAY | _NEW_PROGRAM; + if (new_state) { + assert(!actx->mapped_vbos); + actx->NewState |= new_state; + } } diff --git a/src/mesa/main/api_loopback.c b/src/mesa/main/api_loopback.c index 51d5af6f5f0..717ef1fc8f0 100644 --- a/src/mesa/main/api_loopback.c +++ b/src/mesa/main/api_loopback.c @@ -510,7 +510,7 @@ loopback_TexCoord2sv( const GLshort *v ) static void GLAPIENTRY loopback_TexCoord3dv( const GLdouble *v ) { - TEXCOORD2((GLfloat) v[0],(GLfloat) v[1]); + TEXCOORD3((GLfloat) v[0],(GLfloat) v[1],(GLfloat) v[2]); } static void GLAPIENTRY diff --git a/src/mesa/main/sources b/src/mesa/main/sources new file mode 100644 index 00000000000..dfcff89e4b6 --- /dev/null +++ b/src/mesa/main/sources @@ -0,0 +1,138 @@ +# List of source files in this directory used for X.org xserver build +MESA_MAIN_SOURCES = \ +accum.c \ +api_arrayelt.c \ +api_loopback.c \ +api_noop.c \ +api_validate.c \ +arrayobj.c \ +attrib.c \ +blend.c \ +bufferobj.c \ +buffers.c \ +clip.c \ +colortab.c \ +context.c \ +convolve.c \ +debug.c \ +depth.c \ +depthstencil.c \ +dlist.c \ +drawpix.c \ +enable.c \ +enums.c \ +eval.c \ +execmem.c \ +extensions.c \ +fbobject.c \ +feedback.c \ +fog.c \ +framebuffer.c \ +get.c \ +getstring.c \ +hash.c \ +hint.c \ +histogram.c \ +image.c \ +imports.c \ +light.c \ +lines.c \ +matrix.c \ +mipmap.c \ +mm.c \ +occlude.c \ +pixel.c \ +points.c \ +polygon.c \ +rastpos.c \ +rbadaptors.c \ +renderbuffer.c \ +state.c \ +stencil.c \ +texcompress.c \ +texcompress_fxt1.c \ +texcompress_s3tc.c \ +texenvprogram.c \ +texformat.c \ +teximage.c \ +texobj.c \ +texrender.c \ +texstate.c \ +texstore.c \ +varray.c \ +$(VSNPRINTF_SOURCES) \ +vtxfmt.c + +MESA_VSNPRINTF_SOURCES = \ +vsnprintf.c + +MESA_MAIN_HEADERS = \ +accum.h \ +api_arrayelt.h \ +api_eval.h \ +api_loopback.h \ +api_noop.h \ +api_validate.h \ +arrayobj.h \ +attrib.h \ +bitset.h \ +blend.h \ +bufferobj.h \ +buffers.h \ +clip.h \ +colormac.h \ +colortab.h \ +config.h \ +context.h \ +convolve.h \ +dd.h \ +debug.h \ +depth.h \ +depthstencil.h \ +dlist.h \ +drawpix.h \ +enable.h \ +enums.h \ +eval.h \ +extensions.h \ +fbobject.h \ +feedback.h \ +fog.h \ +framebuffer.h \ +get.h \ +glheader.h \ +hash.h \ +hint.h \ +histogram.h \ +image.h \ +imports.h \ +light.h \ +lines.h \ +macros.h \ +matrix.h \ +mipmap.h \ +mm.h \ +mtypes.h \ +occlude.h \ +pixel.h \ +points.h \ +polygon.h \ +rastpos.h \ +rbadaptors.h \ +renderbuffer.h \ +simple_list.h \ +state.h \ +stencil.h \ +texcompress.h \ +texenvprogram.h \ +texformat.h \ +texformat_tmp.h \ +teximage.h \ +texobj.h \ +texrender.h \ +texstate.h \ +texstore.h \ +varray.h \ +version.h \ +vtxfmt.h \ +vtxfmt_tmp.h diff --git a/src/mesa/math/sources b/src/mesa/math/sources new file mode 100644 index 00000000000..7c7dcccedfd --- /dev/null +++ b/src/mesa/math/sources @@ -0,0 +1,25 @@ +MESA_MATH_SOURCES = \ +m_debug_clip.c \ +m_debug_norm.c \ +m_debug_xform.c \ +m_eval.c \ +m_matrix.c \ +m_translate.c \ +m_vector.c \ +m_xform.c + +MESA_MATH_HEADERS = \ +m_clip_tmp.h \ +m_copy_tmp.h \ +m_debug.h \ +m_debug_util.h \ +m_dotprod_tmp.h \ +m_eval.h \ +m_matrix.h \ +m_norm_tmp.h \ +m_trans_tmp.h \ +m_translate.h \ +m_vector.h \ +m_xform.h \ +m_xform_tmp.h \ +mathmod.h diff --git a/src/mesa/shader/grammar/sources b/src/mesa/shader/grammar/sources new file mode 100644 index 00000000000..a6bbfd3ffd3 --- /dev/null +++ b/src/mesa/shader/grammar/sources @@ -0,0 +1,8 @@ +MESA_SHADER_GRAMMAR_SOURCES = \ +grammar_mesa.c + +MESA_SHADER_GRAMMAR_HEADERS = \ +grammar.c \ +grammar.h \ +grammar_mesa.h \ +grammar_syn.h diff --git a/src/mesa/shader/slang/slang_assemble_constructor.c b/src/mesa/shader/slang/slang_assemble_constructor.c index 9d1aa707182..8b5458f7661 100644 --- a/src/mesa/shader/slang/slang_assemble_constructor.c +++ b/src/mesa/shader/slang/slang_assemble_constructor.c @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.5 + * Version: 6.5.2 * * Copyright (C) 2005-2006 Brian Paul All Rights Reserved. * @@ -32,348 +32,365 @@ #include "slang_assemble.h" #include "slang_storage.h" -/* _slang_is_swizzle() */ -GLboolean _slang_is_swizzle (const char *field, GLuint rows, slang_swizzle *swz) + +/** + * Checks if a field selector is a general swizzle (an r-value swizzle + * with replicated components or an l-value swizzle mask) for a + * vector. Returns GL_TRUE if this is the case, is filled with + * swizzle information. Returns GL_FALSE otherwise. + */ +GLboolean +_slang_is_swizzle(const char *field, GLuint rows, slang_swizzle * swz) { - GLuint i; - GLboolean xyzw = GL_FALSE, rgba = GL_FALSE, stpq = GL_FALSE; - - /* the swizzle can be at most 4-component long */ - swz->num_components = slang_string_length (field); - if (swz->num_components > 4) - return GL_FALSE; - - for (i = 0; i < swz->num_components; i++) - { - /* mark which swizzle group is used */ - switch (field[i]) - { - case 'x': - case 'y': - case 'z': - case 'w': - xyzw = GL_TRUE; - break; - case 'r': - case 'g': - case 'b': - case 'a': - rgba = GL_TRUE; - break; - case 's': - case 't': - case 'p': - case 'q': - stpq = GL_TRUE; - break; - default: - return GL_FALSE; - } - - /* collect swizzle component */ - switch (field[i]) - { - case 'x': - case 'r': - case 's': - swz->swizzle[i] = 0; - break; - case 'y': - case 'g': - case 't': - swz->swizzle[i] = 1; - break; - case 'z': - case 'b': - case 'p': - swz->swizzle[i] = 2; - break; - case 'w': - case 'a': - case 'q': - swz->swizzle[i] = 3; - break; - } - - /* check if the component is valid for given vector's row count */ - if (rows <= swz->swizzle[i]) - return GL_FALSE; - } - - /* only one swizzle group can be used */ - if ((xyzw && rgba) || (xyzw && stpq) || (rgba && stpq)) - return GL_FALSE; - - return GL_TRUE; + GLuint i; + GLboolean xyzw = GL_FALSE, rgba = GL_FALSE, stpq = GL_FALSE; + + /* the swizzle can be at most 4-component long */ + swz->num_components = slang_string_length(field); + if (swz->num_components > 4) + return GL_FALSE; + + for (i = 0; i < swz->num_components; i++) { + /* mark which swizzle group is used */ + switch (field[i]) { + case 'x': + case 'y': + case 'z': + case 'w': + xyzw = GL_TRUE; + break; + case 'r': + case 'g': + case 'b': + case 'a': + rgba = GL_TRUE; + break; + case 's': + case 't': + case 'p': + case 'q': + stpq = GL_TRUE; + break; + default: + return GL_FALSE; + } + + /* collect swizzle component */ + switch (field[i]) { + case 'x': + case 'r': + case 's': + swz->swizzle[i] = 0; + break; + case 'y': + case 'g': + case 't': + swz->swizzle[i] = 1; + break; + case 'z': + case 'b': + case 'p': + swz->swizzle[i] = 2; + break; + case 'w': + case 'a': + case 'q': + swz->swizzle[i] = 3; + break; + } + + /* check if the component is valid for given vector's row count */ + if (rows <= swz->swizzle[i]) + return GL_FALSE; + } + + /* only one swizzle group can be used */ + if ((xyzw && rgba) || (xyzw && stpq) || (rgba && stpq)) + return GL_FALSE; + + return GL_TRUE; } -/* _slang_is_swizzle_mask() */ -GLboolean _slang_is_swizzle_mask (const slang_swizzle *swz, GLuint rows) + +/** + * Checks if a general swizzle is an l-value swizzle - these swizzles + * do not have duplicated fields. Returns GL_TRUE if this is a + * swizzle mask. Returns GL_FALSE otherwise + */ +GLboolean +_slang_is_swizzle_mask(const slang_swizzle * swz, GLuint rows) { - GLuint i, c = 0; + GLuint i, c = 0; - /* the swizzle may not be longer than the vector dim */ - if (swz->num_components > rows) - return GL_FALSE; + /* the swizzle may not be longer than the vector dim */ + if (swz->num_components > rows) + return GL_FALSE; - /* the swizzle components cannot be duplicated */ - for (i = 0; i < swz->num_components; i++) - { - if ((c & (1 << swz->swizzle[i])) != 0) - return GL_FALSE; - c |= 1 << swz->swizzle[i]; - } + /* the swizzle components cannot be duplicated */ + for (i = 0; i < swz->num_components; i++) { + if ((c & (1 << swz->swizzle[i])) != 0) + return GL_FALSE; + c |= 1 << swz->swizzle[i]; + } - return GL_TRUE; + return GL_TRUE; } -/* _slang_multiply_swizzles() */ -GLvoid _slang_multiply_swizzles (slang_swizzle *dst, const slang_swizzle *left, - const slang_swizzle *right) + +/** + * Combines (multiplies) two swizzles to form single swizzle. + * Example: "vec.wzyx.yx" --> "vec.zw". + */ +GLvoid +_slang_multiply_swizzles(slang_swizzle * dst, const slang_swizzle * left, + const slang_swizzle * right) { - GLuint i; + GLuint i; - dst->num_components = right->num_components; - for (i = 0; i < right->num_components; i++) - dst->swizzle[i] = left->swizzle[right->swizzle[i]]; + dst->num_components = right->num_components; + for (i = 0; i < right->num_components; i++) + dst->swizzle[i] = left->swizzle[right->swizzle[i]]; } -/* _slang_assemble_constructor() */ + static GLboolean -sizeof_argument (slang_assemble_ctx *A, GLuint *size, slang_operation *op) +sizeof_argument(slang_assemble_ctx * A, GLuint * size, slang_operation * op) { slang_assembly_typeinfo ti; GLboolean result = GL_FALSE; slang_storage_aggregate agg; - if (!slang_assembly_typeinfo_construct (&ti)) + if (!slang_assembly_typeinfo_construct(&ti)) return GL_FALSE; - if (!_slang_typeof_operation (A, op, &ti)) + if (!_slang_typeof_operation(A, op, &ti)) goto end1; - if (!slang_storage_aggregate_construct (&agg)) + if (!slang_storage_aggregate_construct(&agg)) goto end1; - if (!_slang_aggregate_variable (&agg, &ti.spec, 0, A->space.funcs, A->space.structs, - A->space.vars, A->mach, A->file, A->atoms)) + if (!_slang_aggregate_variable + (&agg, &ti.spec, 0, A->space.funcs, A->space.structs, A->space.vars, + A->mach, A->file, A->atoms)) goto end; - *size = _slang_sizeof_aggregate (&agg); + *size = _slang_sizeof_aggregate(&agg); result = GL_TRUE; -end: - slang_storage_aggregate_destruct (&agg); -end1: - slang_assembly_typeinfo_destruct (&ti); + end: + slang_storage_aggregate_destruct(&agg); + end1: + slang_assembly_typeinfo_destruct(&ti); return result; } -static GLboolean constructor_aggregate (slang_assemble_ctx *A, const slang_storage_aggregate *flat, - slang_operation *op, GLuint garbage_size) +static GLboolean +constructor_aggregate(slang_assemble_ctx * A, + const slang_storage_aggregate * flat, + slang_operation * op, GLuint garbage_size) { - slang_assembly_typeinfo ti; - GLboolean result = GL_FALSE; - slang_storage_aggregate agg, flat_agg; - - if (!slang_assembly_typeinfo_construct (&ti)) - return GL_FALSE; - if (!_slang_typeof_operation (A, op, &ti)) - goto end1; - - if (!slang_storage_aggregate_construct (&agg)) - goto end1; - if (!_slang_aggregate_variable (&agg, &ti.spec, 0, A->space.funcs, A->space.structs, - A->space.vars, A->mach, A->file, A->atoms)) - goto end2; - - if (!slang_storage_aggregate_construct (&flat_agg)) - goto end2; - if (!_slang_flatten_aggregate (&flat_agg, &agg)) - goto end; - - if (!_slang_assemble_operation (A, op, slang_ref_forbid)) - goto end; - - /* TODO: convert (generic) elements */ - - /* free the garbage */ - if (garbage_size != 0) - { - GLuint i; - - /* move the non-garbage part to the end of the argument */ - if (!slang_assembly_file_push_label (A->file, slang_asm_addr_push, 0)) - goto end; - for (i = flat_agg.count * 4 - garbage_size; i > 0; i -= 4) - { - if (!slang_assembly_file_push_label2 (A->file, slang_asm_float_move, - garbage_size + i, i)) - { - goto end; - } - } - if (!slang_assembly_file_push_label (A->file, slang_asm_local_free, garbage_size + 4)) - goto end; - } - - result = GL_TRUE; -end: - slang_storage_aggregate_destruct (&flat_agg); -end2: - slang_storage_aggregate_destruct (&agg); -end1: - slang_assembly_typeinfo_destruct (&ti); - return result; + slang_assembly_typeinfo ti; + GLboolean result = GL_FALSE; + slang_storage_aggregate agg, flat_agg; + + if (!slang_assembly_typeinfo_construct(&ti)) + return GL_FALSE; + if (!_slang_typeof_operation(A, op, &ti)) + goto end1; + + if (!slang_storage_aggregate_construct(&agg)) + goto end1; + if (!_slang_aggregate_variable + (&agg, &ti.spec, 0, A->space.funcs, A->space.structs, A->space.vars, + A->mach, A->file, A->atoms)) + goto end2; + + if (!slang_storage_aggregate_construct(&flat_agg)) + goto end2; + if (!_slang_flatten_aggregate(&flat_agg, &agg)) + goto end; + + if (!_slang_assemble_operation(A, op, slang_ref_forbid)) + goto end; + + /* TODO: convert (generic) elements */ + + /* free the garbage */ + if (garbage_size != 0) { + GLuint i; + + /* move the non-garbage part to the end of the argument */ + if (!slang_assembly_file_push_label(A->file, slang_asm_addr_push, 0)) + goto end; + for (i = flat_agg.count * 4 - garbage_size; i > 0; i -= 4) { + if (!slang_assembly_file_push_label2(A->file, slang_asm_float_move, + garbage_size + i, i)) { + goto end; + } + } + if (!slang_assembly_file_push_label + (A->file, slang_asm_local_free, garbage_size + 4)) + goto end; + } + + result = GL_TRUE; + end: + slang_storage_aggregate_destruct(&flat_agg); + end2: + slang_storage_aggregate_destruct(&agg); + end1: + slang_assembly_typeinfo_destruct(&ti); + return result; } -GLboolean _slang_assemble_constructor (slang_assemble_ctx *A, slang_operation *op) +GLboolean +_slang_assemble_constructor(slang_assemble_ctx * A, slang_operation * op) { - slang_assembly_typeinfo ti; - GLboolean result = GL_FALSE; - slang_storage_aggregate agg, flat; - GLuint size, i; - GLuint arg_sums[2]; - - /* get typeinfo of the constructor (the result of constructor expression) */ - if (!slang_assembly_typeinfo_construct (&ti)) - return GL_FALSE; - if (!_slang_typeof_operation (A, op, &ti)) - goto end1; - - /* create an aggregate of the constructor */ - if (!slang_storage_aggregate_construct (&agg)) - goto end1; - if (!_slang_aggregate_variable (&agg, &ti.spec, 0, A->space.funcs, A->space.structs, - A->space.vars, A->mach, A->file, A->atoms)) - goto end2; - - /* calculate size of the constructor */ - size = _slang_sizeof_aggregate (&agg); - - /* flatten the constructor */ - if (!slang_storage_aggregate_construct (&flat)) - goto end2; - if (!_slang_flatten_aggregate (&flat, &agg)) - goto end; - - /* collect the last two constructor's argument size sums */ - arg_sums[0] = 0; /* will hold all but the last argument's size sum */ - arg_sums[1] = 0; /* will hold all argument's size sum */ - for (i = 0; i < op->num_children; i++) - { - GLuint arg_size = 0; - - if (!sizeof_argument (A, &arg_size, &op->children[i])) - goto end; - if (i > 0) - arg_sums[0] = arg_sums[1]; - arg_sums[1] += arg_size; - } - - /* check if there are too many arguments */ - if (arg_sums[0] >= size) - { - /* TODO: info log: too many arguments in constructor list */ - goto end; - } - - /* check if there are too few arguments */ - if (arg_sums[1] < size) - { - /* TODO: info log: too few arguments in constructor list */ - goto end; - } - - /* traverse the children that form the constructor expression */ - for (i = op->num_children; i > 0; i--) - { - GLuint garbage_size; - - /* the last argument may be too big - calculate the unnecessary data size */ - if (i == op->num_children) - garbage_size = arg_sums[1] - size; - else - garbage_size = 0; - - if (!constructor_aggregate (A, &flat, &op->children[i - 1], garbage_size)) - goto end; - } - - result = GL_TRUE; -end: - slang_storage_aggregate_destruct (&flat); -end2: - slang_storage_aggregate_destruct (&agg); -end1: - slang_assembly_typeinfo_destruct (&ti); - return result; + slang_assembly_typeinfo ti; + GLboolean result = GL_FALSE; + slang_storage_aggregate agg, flat; + GLuint size, i; + GLuint arg_sums[2]; + + /* get typeinfo of the constructor (the result of constructor expression) */ + if (!slang_assembly_typeinfo_construct(&ti)) + return GL_FALSE; + if (!_slang_typeof_operation(A, op, &ti)) + goto end1; + + /* create an aggregate of the constructor */ + if (!slang_storage_aggregate_construct(&agg)) + goto end1; + if (!_slang_aggregate_variable + (&agg, &ti.spec, 0, A->space.funcs, A->space.structs, A->space.vars, + A->mach, A->file, A->atoms)) + goto end2; + + /* calculate size of the constructor */ + size = _slang_sizeof_aggregate(&agg); + + /* flatten the constructor */ + if (!slang_storage_aggregate_construct(&flat)) + goto end2; + if (!_slang_flatten_aggregate(&flat, &agg)) + goto end; + + /* collect the last two constructor's argument size sums */ + arg_sums[0] = 0; /* will hold all but the last argument's size sum */ + arg_sums[1] = 0; /* will hold all argument's size sum */ + for (i = 0; i < op->num_children; i++) { + GLuint arg_size = 0; + + if (!sizeof_argument(A, &arg_size, &op->children[i])) + goto end; + if (i > 0) + arg_sums[0] = arg_sums[1]; + arg_sums[1] += arg_size; + } + + /* check if there are too many arguments */ + if (arg_sums[0] >= size) { + /* TODO: info log: too many arguments in constructor list */ + goto end; + } + + /* check if there are too few arguments */ + if (arg_sums[1] < size) { + /* TODO: info log: too few arguments in constructor list */ + goto end; + } + + /* traverse the children that form the constructor expression */ + for (i = op->num_children; i > 0; i--) { + GLuint garbage_size; + + /* the last argument may be too big - calculate the unnecessary + * data size + */ + if (i == op->num_children) + garbage_size = arg_sums[1] - size; + else + garbage_size = 0; + + if (!constructor_aggregate + (A, &flat, &op->children[i - 1], garbage_size)) + goto end; + } + + result = GL_TRUE; + end: + slang_storage_aggregate_destruct(&flat); + end2: + slang_storage_aggregate_destruct(&agg); + end1: + slang_assembly_typeinfo_destruct(&ti); + return result; } -/* _slang_assemble_constructor_from_swizzle() */ -GLboolean _slang_assemble_constructor_from_swizzle (slang_assemble_ctx *A, const slang_swizzle *swz, - slang_type_specifier *spec, slang_type_specifier *master_spec) + +GLboolean +_slang_assemble_constructor_from_swizzle(slang_assemble_ctx * A, + const slang_swizzle * swz, + slang_type_specifier * spec, + slang_type_specifier * master_spec) { - GLuint master_rows, i; - - master_rows = _slang_type_dim (master_spec->type); - for (i = 0; i < master_rows; i++) - { - switch (_slang_type_base (master_spec->type)) - { - case slang_spec_bool: - if (!slang_assembly_file_push_label2 (A->file, slang_asm_bool_copy, - (master_rows - i) * 4, i * 4)) - return GL_FALSE; - break; - case slang_spec_int: - if (!slang_assembly_file_push_label2 (A->file, slang_asm_int_copy, - (master_rows - i) * 4, i * 4)) - return GL_FALSE; - break; - case slang_spec_float: - if (!slang_assembly_file_push_label2 (A->file, slang_asm_float_copy, - (master_rows - i) * 4, i * 4)) - return GL_FALSE; - break; - default: - break; - } - } - if (!slang_assembly_file_push_label (A->file, slang_asm_local_free, 4)) - return GL_FALSE; - for (i = swz->num_components; i > 0; i--) - { - GLuint n = i - 1; - - if (!slang_assembly_file_push_label2 (A->file, slang_asm_local_addr, A->local.swizzle_tmp, 16)) - return GL_FALSE; - if (!slang_assembly_file_push_label (A->file, slang_asm_addr_push, swz->swizzle[n] * 4)) - return GL_FALSE; - if (!slang_assembly_file_push (A->file, slang_asm_addr_add)) - return GL_FALSE; - switch (_slang_type_base (master_spec->type)) - { - case slang_spec_bool: - if (!slang_assembly_file_push (A->file, slang_asm_bool_deref)) - return GL_FALSE; - break; - case slang_spec_int: - if (!slang_assembly_file_push (A->file, slang_asm_int_deref)) - return GL_FALSE; - break; - case slang_spec_float: - if (!slang_assembly_file_push (A->file, slang_asm_float_deref)) - return GL_FALSE; - break; - default: - break; - } - } - - return GL_TRUE; + GLuint master_rows, i; + + master_rows = _slang_type_dim(master_spec->type); + for (i = 0; i < master_rows; i++) { + switch (_slang_type_base(master_spec->type)) { + case slang_spec_bool: + if (!slang_assembly_file_push_label2(A->file, slang_asm_bool_copy, + (master_rows - i) * 4, i * 4)) + return GL_FALSE; + break; + case slang_spec_int: + if (!slang_assembly_file_push_label2(A->file, slang_asm_int_copy, + (master_rows - i) * 4, i * 4)) + return GL_FALSE; + break; + case slang_spec_float: + if (!slang_assembly_file_push_label2(A->file, slang_asm_float_copy, + (master_rows - i) * 4, i * 4)) + return GL_FALSE; + break; + default: + break; + } + } + if (!slang_assembly_file_push_label(A->file, slang_asm_local_free, 4)) + return GL_FALSE; + for (i = swz->num_components; i > 0; i--) { + GLuint n = i - 1; + + if (!slang_assembly_file_push_label2 + (A->file, slang_asm_local_addr, A->local.swizzle_tmp, 16)) + return GL_FALSE; + if (!slang_assembly_file_push_label + (A->file, slang_asm_addr_push, swz->swizzle[n] * 4)) + return GL_FALSE; + if (!slang_assembly_file_push(A->file, slang_asm_addr_add)) + return GL_FALSE; + switch (_slang_type_base(master_spec->type)) { + case slang_spec_bool: + if (!slang_assembly_file_push(A->file, slang_asm_bool_deref)) + return GL_FALSE; + break; + case slang_spec_int: + if (!slang_assembly_file_push(A->file, slang_asm_int_deref)) + return GL_FALSE; + break; + case slang_spec_float: + if (!slang_assembly_file_push(A->file, slang_asm_float_deref)) + return GL_FALSE; + break; + default: + break; + } + } + + return GL_TRUE; } - diff --git a/src/mesa/shader/slang/slang_assemble_constructor.h b/src/mesa/shader/slang/slang_assemble_constructor.h index 41a03943cf5..c7aedf3af81 100644 --- a/src/mesa/shader/slang/slang_assemble_constructor.h +++ b/src/mesa/shader/slang/slang_assemble_constructor.h @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.5 + * Version: 6.5.2 * * Copyright (C) 2005-2006 Brian Paul All Rights Reserved. * @@ -22,43 +22,35 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#if !defined SLANG_ASSEMBLE_CONSTRUCTOR_H +#ifndef SLANG_ASSEMBLE_CONSTRUCTOR_H #define SLANG_ASSEMBLE_CONSTRUCTOR_H #if defined __cplusplus extern "C" { #endif -/* - * Checks if a field selector is a general swizzle (an r-value swizzle with replicated - * components or an l-value swizzle mask) for a vector. - * Returns GL_TRUE if this is the case, is filled with swizzle information. - * Returns GL_FALSE otherwise. - */ -GLboolean _slang_is_swizzle (const char *field, GLuint rows, slang_swizzle *swz); -/* - * Checks if a general swizzle is an l-value swizzle - these swizzles do not have - * duplicated fields. - * Returns GL_TRUE if this is a swizzle mask. - * Returns GL_FALSE otherwise - */ -GLboolean _slang_is_swizzle_mask (const slang_swizzle *swz, GLuint rows); +extern GLboolean +_slang_is_swizzle(const char *field, GLuint rows, slang_swizzle *swz); -/* - * Combines (multiplies) two swizzles to form single swizzle. - * Example: "vec.wzyx.yx" --> "vec.zw". - */ -GLvoid _slang_multiply_swizzles (slang_swizzle *, const slang_swizzle *, const slang_swizzle *); +extern GLboolean +_slang_is_swizzle_mask(const slang_swizzle *swz, GLuint rows); + +extern GLvoid +_slang_multiply_swizzles(slang_swizzle *, const slang_swizzle *, + const slang_swizzle *); -GLboolean _slang_assemble_constructor (slang_assemble_ctx *, struct slang_operation_ *); +extern GLboolean +_slang_assemble_constructor(slang_assemble_ctx *, struct slang_operation_ *); -GLboolean _slang_assemble_constructor_from_swizzle (slang_assemble_ctx *, const slang_swizzle *, - slang_type_specifier *, slang_type_specifier *); +extern GLboolean +_slang_assemble_constructor_from_swizzle(slang_assemble_ctx *, + const slang_swizzle *, + slang_type_specifier *, + slang_type_specifier *); #ifdef __cplusplus } #endif -#endif - +#endif /* SLANG_ASSEMBLE_CONSTRUCTOR_H */ diff --git a/src/mesa/shader/slang/slang_assemble_typeinfo.c b/src/mesa/shader/slang/slang_assemble_typeinfo.c index f4ee573df73..265e417dadd 100644 --- a/src/mesa/shader/slang/slang_assemble_typeinfo.c +++ b/src/mesa/shader/slang/slang_assemble_typeinfo.c @@ -594,7 +594,7 @@ _slang_type_base(slang_type_specifier_type ty) /** - * Return the number of elements in a vector or matrix type + * Return the dimensionality of a vector or matrix type. */ GLuint _slang_type_dim(slang_type_specifier_type ty) diff --git a/src/mesa/shader/slang/slang_assemble_typeinfo.h b/src/mesa/shader/slang/slang_assemble_typeinfo.h index 5d951226a1e..777dc21f3a7 100644 --- a/src/mesa/shader/slang/slang_assemble_typeinfo.h +++ b/src/mesa/shader/slang/slang_assemble_typeinfo.h @@ -68,8 +68,8 @@ typedef enum slang_type_specifier_type_ typedef struct slang_type_specifier_ { slang_type_specifier_type type; - struct slang_struct_ *_struct; /**< type: spec_struct */ - struct slang_type_specifier_ *_array; /**< type: spec_array */ + struct slang_struct_ *_struct; /**< used if type == spec_struct */ + struct slang_type_specifier_ *_array; /**< used if type == spec_array */ } slang_type_specifier; diff --git a/src/mesa/shader/slang/slang_compile_function.h b/src/mesa/shader/slang/slang_compile_function.h index 8835544bf38..1a7302f29aa 100644 --- a/src/mesa/shader/slang/slang_compile_function.h +++ b/src/mesa/shader/slang/slang_compile_function.h @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.5 + * Version: 6.5.2 * * Copyright (C) 2005-2006 Brian Paul All Rights Reserved. * @@ -22,7 +22,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#if !defined SLANG_COMPILE_FUNCTION_H +#ifndef SLANG_COMPILE_FUNCTION_H #define SLANG_COMPILE_FUNCTION_H #if defined __cplusplus @@ -63,12 +63,12 @@ extern GLboolean slang_fixup_save(slang_fixup_table *fixups, GLuint address); typedef struct slang_function_ { slang_function_kind kind; - slang_variable header; - slang_variable_scope *parameters; + slang_variable header; /**< The function's name and return type */ + slang_variable_scope *parameters; /**< array [param_count] */ unsigned int param_count; slang_operation *body; /**< The instruction tree */ - unsigned int address; - slang_fixup_table fixups; + unsigned int address; /**< Address of this func in memory */ + slang_fixup_table fixups; /**< Mem locations which need func's address */ } slang_function; extern int slang_function_construct(slang_function *); @@ -99,7 +99,8 @@ extern slang_function * slang_function_scope_find(slang_function_scope *, slang_function *, int); extern GLboolean -_slang_build_export_code_table(slang_export_code_table *, slang_function_scope *, +_slang_build_export_code_table(slang_export_code_table *, + slang_function_scope *, struct slang_code_unit_ *); @@ -107,5 +108,4 @@ _slang_build_export_code_table(slang_export_code_table *, slang_function_scope * } #endif -#endif - +#endif /* SLANG_COMPILE_FUNCTION_H */ diff --git a/src/mesa/shader/slang/slang_compile_operation.h b/src/mesa/shader/slang/slang_compile_operation.h index f5fee1e50e6..f3c45de3c2a 100644 --- a/src/mesa/shader/slang/slang_compile_operation.h +++ b/src/mesa/shader/slang/slang_compile_operation.h @@ -22,13 +22,14 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#if !defined SLANG_COMPILE_OPERATION_H +#ifndef SLANG_COMPILE_OPERATION_H #define SLANG_COMPILE_OPERATION_H #if defined __cplusplus extern "C" { #endif + /** * Types of slang operations. * These are the basic intermediate code representations. @@ -36,94 +37,95 @@ extern "C" { */ typedef enum slang_operation_type_ { - slang_oper_none, - slang_oper_block_no_new_scope, /* "{" sequence "}" */ - slang_oper_block_new_scope, /* "{" sequence "}" */ - slang_oper_variable_decl, /* [type] [var] or [var] = [expr] */ - slang_oper_asm, - slang_oper_break, /* "break" statement */ - slang_oper_continue, /* "continue" statement */ - slang_oper_discard, /* "discard" (kill fragment) statement */ - slang_oper_return, /* "return" [expr] */ - slang_oper_expression, /* [expr] */ - slang_oper_if, /* "if" [0] then [1] else [2] */ - slang_oper_while, /* "while" [cond] [body] */ - slang_oper_do, /* "do" [body] "while" [cond] */ - slang_oper_for, /* "for" [init] [while] [incr] [body] */ - slang_oper_void, /* nop */ - slang_oper_literal_bool, /* "true" or "false" */ - slang_oper_literal_int, /* integer literal */ - slang_oper_literal_float, /* float literal */ - slang_oper_identifier, /* var name, func name, etc */ - slang_oper_sequence, /* [expr] "," [expr] "," etc */ - slang_oper_assign, /* [var] "=" [expr] */ - slang_oper_addassign, /* [var] "+=" [expr] */ - slang_oper_subassign, /* [var] "-=" [expr] */ - slang_oper_mulassign, /* [var] "*=" [expr] */ - slang_oper_divassign, /* [var] "/=" [expr] */ - /*slang_oper_modassign,*/ - /*slang_oper_lshassign,*/ - /*slang_oper_rshassign,*/ - /*slang_oper_orassign,*/ - /*slang_oper_xorassign,*/ - /*slang_oper_andassign,*/ - slang_oper_select, /* [expr] "?" [expr] ":" [expr] */ - slang_oper_logicalor, /* [expr] "||" [expr] */ - slang_oper_logicalxor, /* [expr] "^^" [expr] */ - slang_oper_logicaland, /* [expr] "&&" [expr] */ - /*slang_oper_bitor,*/ - /*slang_oper_bitxor,*/ - /*slang_oper_bitand,*/ - slang_oper_equal, /* [expr] "==" [expr] */ - slang_oper_notequal, /* [expr] "!=" [expr] */ - slang_oper_less, /* [expr] "<" [expr] */ - slang_oper_greater, /* [expr] ">" [expr] */ - slang_oper_lessequal, /* [expr] "<=" [expr] */ - slang_oper_greaterequal, /* [expr] ">=" [expr] */ - /*slang_oper_lshift,*/ - /*slang_oper_rshift,*/ - slang_oper_add, /* [expr] "+" [expr] */ - slang_oper_subtract, /* [expr] "-" [expr] */ - slang_oper_multiply, /* [expr] "*" [expr] */ - slang_oper_divide, /* [expr] "/" [expr] */ - /*slang_oper_modulus,*/ - slang_oper_preincrement, /* "++" [var] */ - slang_oper_predecrement, /* "--" [var] */ - slang_oper_plus, /* "-" [expr] */ - slang_oper_minus, /* "+" [expr] */ - /*slang_oper_complement,*/ - slang_oper_not, /* "!" [expr] */ - slang_oper_subscript, /* [expr] "[" [expr] "]" */ - slang_oper_call, /* [func name] [param] [param] [...] */ - slang_oper_field, /* i.e.: ".next" or ".xzy" or ".xxx" etc */ - slang_oper_postincrement, /* [var] "++" */ - slang_oper_postdecrement /* [var] "--" */ + slang_oper_none, + slang_oper_block_no_new_scope, /* "{" sequence "}" */ + slang_oper_block_new_scope, /* "{" sequence "}" */ + slang_oper_variable_decl, /* [type] [var] or [var] = [expr] */ + slang_oper_asm, + slang_oper_break, /* "break" statement */ + slang_oper_continue, /* "continue" statement */ + slang_oper_discard, /* "discard" (kill fragment) statement */ + slang_oper_return, /* "return" [expr] */ + slang_oper_expression, /* [expr] */ + slang_oper_if, /* "if" [0] then [1] else [2] */ + slang_oper_while, /* "while" [cond] [body] */ + slang_oper_do, /* "do" [body] "while" [cond] */ + slang_oper_for, /* "for" [init] [while] [incr] [body] */ + slang_oper_void, /* nop */ + slang_oper_literal_bool, /* "true" or "false" */ + slang_oper_literal_int, /* integer literal */ + slang_oper_literal_float, /* float literal */ + slang_oper_identifier, /* var name, func name, etc */ + slang_oper_sequence, /* [expr] "," [expr] "," etc */ + slang_oper_assign, /* [var] "=" [expr] */ + slang_oper_addassign, /* [var] "+=" [expr] */ + slang_oper_subassign, /* [var] "-=" [expr] */ + slang_oper_mulassign, /* [var] "*=" [expr] */ + slang_oper_divassign, /* [var] "/=" [expr] */ + /*slang_oper_modassign, */ + /*slang_oper_lshassign, */ + /*slang_oper_rshassign, */ + /*slang_oper_orassign, */ + /*slang_oper_xorassign, */ + /*slang_oper_andassign, */ + slang_oper_select, /* [expr] "?" [expr] ":" [expr] */ + slang_oper_logicalor, /* [expr] "||" [expr] */ + slang_oper_logicalxor, /* [expr] "^^" [expr] */ + slang_oper_logicaland, /* [expr] "&&" [expr] */ + /*slang_oper_bitor, */ + /*slang_oper_bitxor, */ + /*slang_oper_bitand, */ + slang_oper_equal, /* [expr] "==" [expr] */ + slang_oper_notequal, /* [expr] "!=" [expr] */ + slang_oper_less, /* [expr] "<" [expr] */ + slang_oper_greater, /* [expr] ">" [expr] */ + slang_oper_lessequal, /* [expr] "<=" [expr] */ + slang_oper_greaterequal, /* [expr] ">=" [expr] */ + /*slang_oper_lshift, */ + /*slang_oper_rshift, */ + slang_oper_add, /* [expr] "+" [expr] */ + slang_oper_subtract, /* [expr] "-" [expr] */ + slang_oper_multiply, /* [expr] "*" [expr] */ + slang_oper_divide, /* [expr] "/" [expr] */ + /*slang_oper_modulus, */ + slang_oper_preincrement, /* "++" [var] */ + slang_oper_predecrement, /* "--" [var] */ + slang_oper_plus, /* "-" [expr] */ + slang_oper_minus, /* "+" [expr] */ + /*slang_oper_complement, */ + slang_oper_not, /* "!" [expr] */ + slang_oper_subscript, /* [expr] "[" [expr] "]" */ + slang_oper_call, /* [func name] [param] [param] [...] */ + slang_oper_field, /* i.e.: ".next" or ".xzy" or ".xxx" etc */ + slang_oper_postincrement, /* [var] "++" */ + slang_oper_postdecrement /* [var] "--" */ } slang_operation_type; /** * A slang_operation is basically a compiled instruction (such as assignment, - * a while-loop, a conditiona, a function call, etc). + * a while-loop, a conditional, a multiply, a function call, etc). + * NOTE: This structure could have been implemented as a union of simpler + * structs which would correspond to the operation types above. */ typedef struct slang_operation_ { - slang_operation_type type; - struct slang_operation_ *children; - unsigned int num_children; - float literal; /**< Used for float, int and bool values */ - slang_atom a_id; /**< type: asm, identifier, call, field */ - slang_variable_scope *locals; /**< local vars for scope */ + slang_operation_type type; + struct slang_operation_ *children; + unsigned int num_children; + float literal; /**< Used for float, int and bool values */ + slang_atom a_id; /**< type: asm, identifier, call, field */ + slang_variable_scope *locals; /**< local vars for scope */ } slang_operation; -extern int slang_operation_construct (slang_operation *); -extern void slang_operation_destruct (slang_operation *); -extern int slang_operation_copy (slang_operation *, const slang_operation *); +extern int slang_operation_construct(slang_operation *); +extern void slang_operation_destruct(slang_operation *); +extern int slang_operation_copy(slang_operation *, const slang_operation *); #ifdef __cplusplus } #endif -#endif - +#endif /* SLANG_COMPILE_OPERATION_H */ diff --git a/src/mesa/shader/slang/slang_compile_variable.c b/src/mesa/shader/slang/slang_compile_variable.c index 679d93b951a..92951b85bbc 100644 --- a/src/mesa/shader/slang/slang_compile_variable.c +++ b/src/mesa/shader/slang/slang_compile_variable.c @@ -35,89 +35,92 @@ typedef struct { - const char *name; - slang_type_specifier_type type; + const char *name; + slang_type_specifier_type type; } type_specifier_type_name; -static type_specifier_type_name type_specifier_type_names[] = { - { "void", slang_spec_void }, - { "bool", slang_spec_bool }, - { "bvec2", slang_spec_bvec2 }, - { "bvec3", slang_spec_bvec3 }, - { "bvec4", slang_spec_bvec4 }, - { "int", slang_spec_int }, - { "ivec2", slang_spec_ivec2 }, - { "ivec3", slang_spec_ivec3 }, - { "ivec4", slang_spec_ivec4 }, - { "float", slang_spec_float }, - { "vec2", slang_spec_vec2 }, - { "vec3", slang_spec_vec3 }, - { "vec4", slang_spec_vec4 }, - { "mat2", slang_spec_mat2 }, - { "mat3", slang_spec_mat3 }, - { "mat4", slang_spec_mat4 }, - { "sampler1D", slang_spec_sampler1D }, - { "sampler2D", slang_spec_sampler2D }, - { "sampler3D", slang_spec_sampler3D }, - { "samplerCube", slang_spec_samplerCube }, - { "sampler1DShadow", slang_spec_sampler1DShadow }, - { "sampler2DShadow", slang_spec_sampler2DShadow }, - { NULL, slang_spec_void } +static const type_specifier_type_name type_specifier_type_names[] = { + {"void", slang_spec_void}, + {"bool", slang_spec_bool}, + {"bvec2", slang_spec_bvec2}, + {"bvec3", slang_spec_bvec3}, + {"bvec4", slang_spec_bvec4}, + {"int", slang_spec_int}, + {"ivec2", slang_spec_ivec2}, + {"ivec3", slang_spec_ivec3}, + {"ivec4", slang_spec_ivec4}, + {"float", slang_spec_float}, + {"vec2", slang_spec_vec2}, + {"vec3", slang_spec_vec3}, + {"vec4", slang_spec_vec4}, + {"mat2", slang_spec_mat2}, + {"mat3", slang_spec_mat3}, + {"mat4", slang_spec_mat4}, + {"sampler1D", slang_spec_sampler1D}, + {"sampler2D", slang_spec_sampler2D}, + {"sampler3D", slang_spec_sampler3D}, + {"samplerCube", slang_spec_samplerCube}, + {"sampler1DShadow", slang_spec_sampler1DShadow}, + {"sampler2DShadow", slang_spec_sampler2DShadow}, + {NULL, slang_spec_void} }; -slang_type_specifier_type slang_type_specifier_type_from_string (const char *name) +slang_type_specifier_type +slang_type_specifier_type_from_string(const char *name) { - type_specifier_type_name *p = type_specifier_type_names; - while (p->name != NULL) - { - if (slang_string_compare (p->name, name) == 0) - break; - p++; - } - return p->type; + const type_specifier_type_name *p = type_specifier_type_names; + while (p->name != NULL) { + if (slang_string_compare(p->name, name) == 0) + break; + p++; + } + return p->type; } -const char *slang_type_specifier_type_to_string (slang_type_specifier_type type) +const char * +slang_type_specifier_type_to_string(slang_type_specifier_type type) { - type_specifier_type_name *p = type_specifier_type_names; - while (p->name != NULL) - { - if (p->type == type) - break; - p++; - } - return p->name; + const type_specifier_type_name *p = type_specifier_type_names; + while (p->name != NULL) { + if (p->type == type) + break; + p++; + } + return p->name; } /* slang_fully_specified_type */ -int slang_fully_specified_type_construct (slang_fully_specified_type *type) +int +slang_fully_specified_type_construct(slang_fully_specified_type * type) { - type->qualifier = slang_qual_none; - slang_type_specifier_ctr (&type->specifier); - return 1; + type->qualifier = slang_qual_none; + slang_type_specifier_ctr(&type->specifier); + return 1; } -void slang_fully_specified_type_destruct (slang_fully_specified_type *type) +void +slang_fully_specified_type_destruct(slang_fully_specified_type * type) { - slang_type_specifier_dtr (&type->specifier); + slang_type_specifier_dtr(&type->specifier); } -int slang_fully_specified_type_copy (slang_fully_specified_type *x, const slang_fully_specified_type *y) +int +slang_fully_specified_type_copy(slang_fully_specified_type * x, + const slang_fully_specified_type * y) { - slang_fully_specified_type z; - - if (!slang_fully_specified_type_construct (&z)) - return 0; - z.qualifier = y->qualifier; - if (!slang_type_specifier_copy (&z.specifier, &y->specifier)) - { - slang_fully_specified_type_destruct (&z); - return 0; - } - slang_fully_specified_type_destruct (x); - *x = z; - return 1; + slang_fully_specified_type z; + + if (!slang_fully_specified_type_construct(&z)) + return 0; + z.qualifier = y->qualifier; + if (!slang_type_specifier_copy(&z.specifier, &y->specifier)) { + slang_fully_specified_type_destruct(&z); + return 0; + } + slang_fully_specified_type_destruct(x); + *x = z; + return 1; } /* @@ -125,246 +128,255 @@ int slang_fully_specified_type_copy (slang_fully_specified_type *x, const slang_ */ GLvoid -_slang_variable_scope_ctr (slang_variable_scope *self) +_slang_variable_scope_ctr(slang_variable_scope * self) { self->variables = NULL; self->num_variables = 0; self->outer_scope = NULL; } -void slang_variable_scope_destruct (slang_variable_scope *scope) +void +slang_variable_scope_destruct(slang_variable_scope * scope) { - unsigned int i; - - for (i = 0; i < scope->num_variables; i++) - slang_variable_destruct (scope->variables + i); - slang_alloc_free (scope->variables); - /* do not free scope->outer_scope */ + unsigned int i; + + if (!scope) + return; + for (i = 0; i < scope->num_variables; i++) + slang_variable_destruct(scope->variables + i); + slang_alloc_free(scope->variables); + /* do not free scope->outer_scope */ } -int slang_variable_scope_copy (slang_variable_scope *x, const slang_variable_scope *y) +int +slang_variable_scope_copy(slang_variable_scope * x, + const slang_variable_scope * y) { - slang_variable_scope z; - unsigned int i; - - _slang_variable_scope_ctr (&z); - z.variables = (slang_variable *) slang_alloc_malloc (y->num_variables * sizeof (slang_variable)); - if (z.variables == NULL) - { - slang_variable_scope_destruct (&z); - return 0; - } - for (z.num_variables = 0; z.num_variables < y->num_variables; z.num_variables++) - if (!slang_variable_construct (&z.variables[z.num_variables])) - { - slang_variable_scope_destruct (&z); - return 0; - } - for (i = 0; i < z.num_variables; i++) - if (!slang_variable_copy (&z.variables[i], &y->variables[i])) - { - slang_variable_scope_destruct (&z); - return 0; - } - z.outer_scope = y->outer_scope; - slang_variable_scope_destruct (x); - *x = z; - return 1; + slang_variable_scope z; + unsigned int i; + + _slang_variable_scope_ctr(&z); + z.variables = (slang_variable *) + slang_alloc_malloc(y->num_variables * sizeof(slang_variable)); + if (z.variables == NULL) { + slang_variable_scope_destruct(&z); + return 0; + } + for (z.num_variables = 0; z.num_variables < y->num_variables; + z.num_variables++) { + if (!slang_variable_construct(&z.variables[z.num_variables])) { + slang_variable_scope_destruct(&z); + return 0; + } + } + for (i = 0; i < z.num_variables; i++) { + if (!slang_variable_copy(&z.variables[i], &y->variables[i])) { + slang_variable_scope_destruct(&z); + return 0; + } + } + z.outer_scope = y->outer_scope; + slang_variable_scope_destruct(x); + *x = z; + return 1; } /* slang_variable */ -int slang_variable_construct (slang_variable *var) +int +slang_variable_construct(slang_variable * var) { - if (!slang_fully_specified_type_construct (&var->type)) - return 0; - var->a_name = SLANG_ATOM_NULL; - var->array_len = 0; - var->initializer = NULL; - var->address = ~0; - var->size = 0; - var->global = GL_FALSE; - return 1; + if (!slang_fully_specified_type_construct(&var->type)) + return 0; + var->a_name = SLANG_ATOM_NULL; + var->array_len = 0; + var->initializer = NULL; + var->address = ~0; + var->address2 = 0; + var->size = 0; + var->global = GL_FALSE; + return 1; } -void slang_variable_destruct (slang_variable *var) +void +slang_variable_destruct(slang_variable * var) { - slang_fully_specified_type_destruct (&var->type); - if (var->initializer != NULL) - { - slang_operation_destruct (var->initializer); - slang_alloc_free (var->initializer); - } + slang_fully_specified_type_destruct(&var->type); + if (var->initializer != NULL) { + slang_operation_destruct(var->initializer); + slang_alloc_free(var->initializer); + } } -int slang_variable_copy (slang_variable *x, const slang_variable *y) +int +slang_variable_copy(slang_variable * x, const slang_variable * y) { - slang_variable z; - - if (!slang_variable_construct (&z)) - return 0; - if (!slang_fully_specified_type_copy (&z.type, &y->type)) - { - slang_variable_destruct (&z); - return 0; - } - z.a_name = y->a_name; - z.array_len = y->array_len; - if (y->initializer != NULL) - { - z.initializer = (slang_operation *) slang_alloc_malloc (sizeof (slang_operation)); - if (z.initializer == NULL) - { - slang_variable_destruct (&z); - return 0; - } - if (!slang_operation_construct (z.initializer)) - { - slang_alloc_free (z.initializer); - slang_variable_destruct (&z); - return 0; - } - if (!slang_operation_copy (z.initializer, y->initializer)) - { - slang_variable_destruct (&z); - return 0; - } - } - z.address = y->address; - z.size = y->size; - z.global = y->global; - slang_variable_destruct (x); - *x = z; - return 1; + slang_variable z; + + if (!slang_variable_construct(&z)) + return 0; + if (!slang_fully_specified_type_copy(&z.type, &y->type)) { + slang_variable_destruct(&z); + return 0; + } + z.a_name = y->a_name; + z.array_len = y->array_len; + if (y->initializer != NULL) { + z.initializer = + (slang_operation *) slang_alloc_malloc(sizeof(slang_operation)); + if (z.initializer == NULL) { + slang_variable_destruct(&z); + return 0; + } + if (!slang_operation_construct(z.initializer)) { + slang_alloc_free(z.initializer); + slang_variable_destruct(&z); + return 0; + } + if (!slang_operation_copy(z.initializer, y->initializer)) { + slang_variable_destruct(&z); + return 0; + } + } + z.address = y->address; + z.size = y->size; + z.global = y->global; + slang_variable_destruct(x); + *x = z; + return 1; } -slang_variable *_slang_locate_variable (slang_variable_scope *scope, slang_atom a_name, GLboolean all) +slang_variable * +_slang_locate_variable(const slang_variable_scope * scope, + const slang_atom a_name, GLboolean all) { - GLuint i; - - for (i = 0; i < scope->num_variables; i++) - if (a_name == scope->variables[i].a_name) - return &scope->variables[i]; - if (all && scope->outer_scope != NULL) - return _slang_locate_variable (scope->outer_scope, a_name, 1); - return NULL; + GLuint i; + + for (i = 0; i < scope->num_variables; i++) + if (a_name == scope->variables[i].a_name) + return &scope->variables[i]; + if (all && scope->outer_scope != NULL) + return _slang_locate_variable(scope->outer_scope, a_name, 1); + return NULL; } /* * _slang_build_export_data_table() */ -static GLenum gl_type_from_specifier (const slang_type_specifier *type) +static GLenum +gl_type_from_specifier(const slang_type_specifier * type) { - switch (type->type) - { - case slang_spec_bool: - return GL_BOOL_ARB; - case slang_spec_bvec2: - return GL_BOOL_VEC2_ARB; - case slang_spec_bvec3: - return GL_BOOL_VEC3_ARB; - case slang_spec_bvec4: - return GL_BOOL_VEC4_ARB; - case slang_spec_int: - return GL_INT; - case slang_spec_ivec2: - return GL_INT_VEC2_ARB; - case slang_spec_ivec3: - return GL_INT_VEC3_ARB; - case slang_spec_ivec4: - return GL_INT_VEC4_ARB; - case slang_spec_float: - return GL_FLOAT; - case slang_spec_vec2: - return GL_FLOAT_VEC2_ARB; - case slang_spec_vec3: - return GL_FLOAT_VEC3_ARB; - case slang_spec_vec4: - return GL_FLOAT_VEC4_ARB; - case slang_spec_mat2: - return GL_FLOAT_MAT2_ARB; - case slang_spec_mat3: - return GL_FLOAT_MAT3_ARB; - case slang_spec_mat4: - return GL_FLOAT_MAT4_ARB; - case slang_spec_sampler1D: - return GL_SAMPLER_1D_ARB; - case slang_spec_sampler2D: - return GL_SAMPLER_2D_ARB; - case slang_spec_sampler3D: - return GL_SAMPLER_3D_ARB; - case slang_spec_samplerCube: - return GL_SAMPLER_CUBE_ARB; - case slang_spec_sampler1DShadow: - return GL_SAMPLER_1D_SHADOW_ARB; - case slang_spec_sampler2DShadow: - return GL_SAMPLER_2D_SHADOW_ARB; - case slang_spec_array: - return gl_type_from_specifier (type->_array); - default: - return GL_FLOAT; - } + switch (type->type) { + case slang_spec_bool: + return GL_BOOL_ARB; + case slang_spec_bvec2: + return GL_BOOL_VEC2_ARB; + case slang_spec_bvec3: + return GL_BOOL_VEC3_ARB; + case slang_spec_bvec4: + return GL_BOOL_VEC4_ARB; + case slang_spec_int: + return GL_INT; + case slang_spec_ivec2: + return GL_INT_VEC2_ARB; + case slang_spec_ivec3: + return GL_INT_VEC3_ARB; + case slang_spec_ivec4: + return GL_INT_VEC4_ARB; + case slang_spec_float: + return GL_FLOAT; + case slang_spec_vec2: + return GL_FLOAT_VEC2_ARB; + case slang_spec_vec3: + return GL_FLOAT_VEC3_ARB; + case slang_spec_vec4: + return GL_FLOAT_VEC4_ARB; + case slang_spec_mat2: + return GL_FLOAT_MAT2_ARB; + case slang_spec_mat3: + return GL_FLOAT_MAT3_ARB; + case slang_spec_mat4: + return GL_FLOAT_MAT4_ARB; + case slang_spec_sampler1D: + return GL_SAMPLER_1D_ARB; + case slang_spec_sampler2D: + return GL_SAMPLER_2D_ARB; + case slang_spec_sampler3D: + return GL_SAMPLER_3D_ARB; + case slang_spec_samplerCube: + return GL_SAMPLER_CUBE_ARB; + case slang_spec_sampler1DShadow: + return GL_SAMPLER_1D_SHADOW_ARB; + case slang_spec_sampler2DShadow: + return GL_SAMPLER_2D_SHADOW_ARB; + case slang_spec_array: + return gl_type_from_specifier(type->_array); + default: + return GL_FLOAT; + } } -static GLboolean build_quant (slang_export_data_quant *q, slang_variable *var) +static GLboolean +build_quant(slang_export_data_quant * q, const slang_variable * var) { - slang_type_specifier *spec = &var->type.specifier; - - q->name = var->a_name; - q->size = var->size; - if (spec->type == slang_spec_array) - { - q->array_len = var->array_len; - q->size /= var->array_len; - spec = spec->_array; - } - if (spec->type == slang_spec_struct) - { - GLuint i; - - q->u.field_count = spec->_struct->fields->num_variables; - q->structure = (slang_export_data_quant *) slang_alloc_malloc ( - q->u.field_count * sizeof (slang_export_data_quant)); - if (q->structure == NULL) - return GL_FALSE; - - for (i = 0; i < q->u.field_count; i++) - slang_export_data_quant_ctr (&q->structure[i]); - for (i = 0; i < q->u.field_count; i++) - if (!build_quant (&q->structure[i], &spec->_struct->fields->variables[i])) - return GL_FALSE; - } - else - q->u.basic_type = gl_type_from_specifier (spec); - return GL_TRUE; + const slang_type_specifier *spec = &var->type.specifier; + + q->name = var->a_name; + q->size = var->size; + if (spec->type == slang_spec_array) { + q->array_len = var->array_len; + q->size /= var->array_len; + spec = spec->_array; + } + if (spec->type == slang_spec_struct) { + GLuint i; + + q->u.field_count = spec->_struct->fields->num_variables; + q->structure = (slang_export_data_quant *) + slang_alloc_malloc(q->u.field_count + * sizeof(slang_export_data_quant)); + if (q->structure == NULL) + return GL_FALSE; + + for (i = 0; i < q->u.field_count; i++) + slang_export_data_quant_ctr(&q->structure[i]); + for (i = 0; i < q->u.field_count; i++) { + if (!build_quant(&q->structure[i], + &spec->_struct->fields->variables[i])) + return GL_FALSE; + } + } + else + q->u.basic_type = gl_type_from_specifier(spec); + return GL_TRUE; } -GLboolean _slang_build_export_data_table (slang_export_data_table *tbl, slang_variable_scope *vars) +GLboolean +_slang_build_export_data_table(slang_export_data_table * tbl, + slang_variable_scope * vars) { - GLuint i; - - for (i = 0; i < vars->num_variables; i++) - { - slang_variable *var = &vars->variables[i]; - slang_export_data_entry *e; - - e = slang_export_data_table_add (tbl); - if (e == NULL) - return GL_FALSE; - if (!build_quant (&e->quant, var)) - return GL_FALSE; - if (var->type.qualifier == slang_qual_uniform) - e->access = slang_exp_uniform; - else if (var->type.qualifier == slang_qual_attribute) - e->access = slang_exp_attribute; - else - e->access = slang_exp_varying; - e->address = var->address; - } - - if (vars->outer_scope != NULL) - return _slang_build_export_data_table (tbl, vars->outer_scope); - return GL_TRUE; + GLuint i; + + for (i = 0; i < vars->num_variables; i++) { + const slang_variable *var = &vars->variables[i]; + slang_export_data_entry *e; + + e = slang_export_data_table_add(tbl); + if (e == NULL) + return GL_FALSE; + if (!build_quant(&e->quant, var)) + return GL_FALSE; + if (var->type.qualifier == slang_qual_uniform) + e->access = slang_exp_uniform; + else if (var->type.qualifier == slang_qual_attribute) + e->access = slang_exp_attribute; + else + e->access = slang_exp_varying; + e->address = var->address; + } + + if (vars->outer_scope != NULL) + return _slang_build_export_data_table(tbl, vars->outer_scope); + return GL_TRUE; } - diff --git a/src/mesa/shader/slang/slang_compile_variable.h b/src/mesa/shader/slang/slang_compile_variable.h index 3b6e1987c82..2f358860f82 100644 --- a/src/mesa/shader/slang/slang_compile_variable.h +++ b/src/mesa/shader/slang/slang_compile_variable.h @@ -22,7 +22,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#if !defined SLANG_COMPILE_VARIABLE_H +#ifndef SLANG_COMPILE_VARIABLE_H #define SLANG_COMPILE_VARIABLE_H #if defined __cplusplus @@ -68,9 +68,28 @@ slang_fully_specified_type_copy(slang_fully_specified_type *, const slang_fully_specified_type *); +/** + * A shading language program variable. + */ +typedef struct slang_variable_ +{ + slang_fully_specified_type type; /**< Variable's data type */ + slang_atom a_name; /**< The variable's name (char *) */ + GLuint array_len; /**< only if type == slang_spec_array */ + struct slang_operation_ *initializer; /**< Optional initializer code */ + GLuint address; /**< Storage location */ + GLuint address2; /**< Storage location */ + GLuint size; /**< Variable's size in bytes */ + GLboolean global; /**< A global var? */ +} slang_variable; + + +/** + * Basically a list of variables, with a pointer to the parent scope. + */ typedef struct slang_variable_scope_ { - struct slang_variable_ *variables; + slang_variable *variables; /**< Array [num_variables] */ GLuint num_variables; struct slang_variable_scope_ *outer_scope; } slang_variable_scope; @@ -86,18 +105,6 @@ slang_variable_scope_copy(slang_variable_scope *, const slang_variable_scope *); -typedef struct slang_variable_ -{ - slang_fully_specified_type type; - slang_atom a_name; - GLuint array_len; /* type: spec_array */ - struct slang_operation_ *initializer; - unsigned int address; - unsigned int size; - GLboolean global; -} slang_variable; - - extern int slang_variable_construct(slang_variable *); @@ -108,7 +115,7 @@ extern int slang_variable_copy(slang_variable *, const slang_variable *); extern slang_variable * -_slang_locate_variable(slang_variable_scope *, slang_atom a_name, +_slang_locate_variable(const slang_variable_scope *, const slang_atom a_name, GLboolean all); extern GLboolean @@ -116,8 +123,9 @@ _slang_build_export_data_table(slang_export_data_table *, slang_variable_scope *); + #ifdef __cplusplus } #endif -#endif +#endif /* SLANG_COMPILE_VARIABLE_H */ diff --git a/src/mesa/shader/slang/sources b/src/mesa/shader/slang/sources new file mode 100644 index 00000000000..00d617fa8af --- /dev/null +++ b/src/mesa/shader/slang/sources @@ -0,0 +1,44 @@ +MESA_SHADER_SLANG_SOURCES = \ +slang_analyse.c \ +slang_assemble_assignment.c \ +slang_assemble.c \ +slang_assemble_conditional.c \ +slang_assemble_constructor.c \ +slang_assemble_typeinfo.c \ +slang_compile.c \ +slang_compile_function.c \ +slang_compile_operation.c \ +slang_compile_struct.c \ +slang_compile_variable.c \ +slang_execute.c \ +slang_execute_x86.c \ +slang_export.c \ +slang_library_texsample.c \ +slang_library_noise.c \ +slang_link.c \ +slang_preprocess.c \ +slang_storage.c \ +slang_utility.c + +MESA_SHADER_SLANG_HEADERS = \ +slang_analyse.h \ +slang_assemble.h \ +slang_assemble_assignment.h \ +slang_assemble_conditional.h \ +slang_assemble_constructor.h \ +slang_assemble_typeinfo.h \ +slang_compile.h \ +slang_compile_function.h \ +slang_compile_operation.h \ +slang_compile_struct.h \ +slang_compile_variable.h \ +slang_execute.h \ +slang_export.h \ +slang_library_noise.h \ +slang_library_texsample.h \ +slang_link.h \ +slang_mesa.h \ +slang_preprocess.h \ +slang_storage.h \ +slang_utility.h \ +traverse_wrap.h diff --git a/src/mesa/shader/sources b/src/mesa/shader/sources new file mode 100644 index 00000000000..27871872766 --- /dev/null +++ b/src/mesa/shader/sources @@ -0,0 +1,28 @@ +# List of source files in this directory used for X.org xserver build +MESA_SHADER_SOURCES = \ +arbprogparse.c \ +arbprogram.c \ +atifragshader.c \ +nvfragparse.c \ +nvprogram.c \ +nvvertexec.c \ +nvvertparse.c \ +program.c \ +programopt.c \ +shaderobjects.c \ +shaderobjects_3dlabs.c + +MESA_SHADER_HEADERS = \ +arbprogparse.h \ +arbprogram.h \ +arbprogram_syn.h \ +atifragshader.h \ +nvfragparse.h \ +nvprogram.h \ +nvvertexec.h \ +nvvertparse.h \ +programopt.h \ +program.h \ +program_instruction.h \ +shaderobjects.h \ +shaderobjects_3dlabs.h diff --git a/src/mesa/swrast/sources b/src/mesa/swrast/sources new file mode 100644 index 00000000000..9ffd4cca722 --- /dev/null +++ b/src/mesa/swrast/sources @@ -0,0 +1,65 @@ +# List of source files in this directory used for X.org xserver build +MESA_SWRAST_SOURCES = \ +s_aaline.c \ +s_aatriangle.c \ +s_accum.c \ +s_alpha.c \ +s_arbshader.c \ +s_atifragshader.c \ +s_bitmap.c \ +s_blend.c \ +s_blit.c \ +s_buffers.c \ +s_context.c \ +s_copypix.c \ +s_depth.c \ +s_drawpix.c \ +s_feedback.c \ +s_fog.c \ +s_imaging.c \ +s_lines.c \ +s_logic.c \ +s_masking.c \ +s_nvfragprog.c \ +s_points.c \ +s_readpix.c \ +s_span.c \ +s_stencil.c \ +s_texcombine.c \ +s_texfilter.c \ +s_texstore.c \ +s_triangle.c \ +s_zoom.c + +MESA_SWRAST_HEADERS = \ +s_aaline.h \ +s_aalinetemp.h \ +s_aatriangle.h \ +s_aatritemp.h \ +s_accum.h \ +s_alpha.h \ +s_arbshader.h \ +s_atifragshader.h \ +s_blend.h \ +s_context.h \ +s_depth.h \ +s_drawpix.h \ +s_feedback.h \ +s_fog.h \ +s_lines.h \ +s_linetemp.h \ +s_logic.h \ +s_masking.h \ +s_nvfragprog.h \ +s_points.h \ +s_pointtemp.h \ +s_span.h \ +s_spantemp.h \ +s_stencil.h \ +s_texcombine.h \ +s_texfilter.h \ +s_triangle.h \ +s_trispan.h \ +s_tritemp.h \ +s_zoom.h \ +swrast.h diff --git a/src/mesa/swrast_setup/sources b/src/mesa/swrast_setup/sources new file mode 100644 index 00000000000..dee14b6774e --- /dev/null +++ b/src/mesa/swrast_setup/sources @@ -0,0 +1,10 @@ +MESA_SWRAST_SETUP_SOURCES = \ +ss_context.c \ +ss_triangle.c + +MESA_SWRAST_SETUP_HEADERS = \ +ss_context.h \ +ss_triangle.h \ +ss_tritmp.h \ +ss_vb.h \ +swrast_setup.h diff --git a/src/mesa/tnl/sources b/src/mesa/tnl/sources new file mode 100644 index 00000000000..e01f55dbafb --- /dev/null +++ b/src/mesa/tnl/sources @@ -0,0 +1,46 @@ +# List of source files in this directory used for X.org xserver build +MESA_TNL_SOURCES = \ +t_array_api.c \ +t_array_import.c \ +t_context.c \ +t_pipeline.c \ +t_save_api.c \ +t_save_loopback.c \ +t_save_playback.c \ +t_vb_arbprogram.c \ +t_vb_arbprogram_sse.c \ +t_vb_arbshader.c \ +t_vb_cull.c \ +t_vb_fog.c \ +t_vb_light.c \ +t_vb_normals.c \ +t_vb_points.c \ +t_vb_program.c \ +t_vb_render.c \ +t_vb_texgen.c \ +t_vb_texmat.c \ +t_vb_vertex.c \ +t_vertex.c \ +t_vertex_generic.c \ +t_vertex_sse.c \ +t_vp_build.c \ +t_vtx_api.c \ +t_vtx_eval.c \ +t_vtx_exec.c \ +t_vtx_generic.c \ +t_vtx_x86.c + +MESA_TNL_HEADERS = \ +t_array_api.h \ +t_array_import.h \ +t_context.h \ +t_pipeline.h \ +t_save_api.h \ +t_vb_arbprogram.h \ +t_vb_cliptmp.h \ +t_vb_lighttmp.h \ +t_vb_rendertmp.h \ +t_vertex.h \ +t_vp_build.h \ +t_vtx_api.h \ +tnl.h diff --git a/src/mesa/tnl/t_context.c b/src/mesa/tnl/t_context.c index 55b40c0531f..154780cc975 100644 --- a/src/mesa/tnl/t_context.c +++ b/src/mesa/tnl/t_context.c @@ -246,10 +246,7 @@ void _tnl_need_projected_coords( GLcontext *ctx, GLboolean mode ) { TNLcontext *tnl = TNL_CONTEXT(ctx); - if (tnl->NeedNdcCoords != mode) { - tnl->NeedNdcCoords = mode; - _tnl_InvalidateState( ctx, _NEW_PROJECTION ); - } + tnl->NeedNdcCoords = mode; } void diff --git a/src/mesa/tnl/t_save_playback.c b/src/mesa/tnl/t_save_playback.c index 9504f0fe680..426e94372ec 100644 --- a/src/mesa/tnl/t_save_playback.c +++ b/src/mesa/tnl/t_save_playback.c @@ -150,6 +150,7 @@ static void _playback_copy_to_current( GLcontext *ctx, if (node->have_materials) { tnl->Driver.NotifyMaterialChange( ctx ); + ctx->NewState |= _NEW_LIGHT; } /* CurrentExecPrimitive diff --git a/src/mesa/tnl/t_vtx_api.c b/src/mesa/tnl/t_vtx_api.c index b766ce2d2ce..77eec8b3b44 100644 --- a/src/mesa/tnl/t_vtx_api.c +++ b/src/mesa/tnl/t_vtx_api.c @@ -171,11 +171,10 @@ static void _tnl_copy_to_current( GLcontext *ctx ) if (tnl->vtx.have_materials) { tnl->Driver.NotifyMaterialChange( ctx ); + ctx->NewState |= _NEW_LIGHT; } ctx->Driver.NeedFlush &= ~FLUSH_UPDATE_CURRENT; - - ctx->NewState |= _NEW_LIGHT; } diff --git a/src/mesa/tnl/t_vtx_exec.c b/src/mesa/tnl/t_vtx_exec.c index 57d842f05fe..900c4ab6cc1 100644 --- a/src/mesa/tnl/t_vtx_exec.c +++ b/src/mesa/tnl/t_vtx_exec.c @@ -239,6 +239,11 @@ static GLuint _tnl_copy_vertices( GLcontext *ctx ) return 2; } case GL_TRIANGLE_STRIP: + /* no parity issue, but need to make sure the tri is not drawn twice */ + if (nr & 1) { + tnl->vtx.prim[tnl->vtx.prim_count-1].count--; + } + /* fallthrough */ case GL_QUAD_STRIP: switch (nr) { case 0: ovf = 0; break; -- cgit v1.2.3 From 32e9cb0275fe33628d0081af0f47a28f8bb5e897 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Sat, 2 Dec 2006 23:46:07 +0000 Subject: Update to new upstream release (6.5.2). --- Makefile | 1 - configs/linux-dri-x86-64 | 2 +- configs/linux-fbdev | 10 +- debian/changelog | 7 + docs/README.directfb | 2 +- docs/news.html | 8 +- docs/relnotes-6.5.1.html | 2 +- docs/relnotes-6.5.2.html | 6 +- include/GL/directfbgl.h | 89 ------- include/GL/internal/glcore.h | 3 - src/glut/fbdev/callback.c | 3 - src/glut/fbdev/colormap.c | 6 + src/glut/fbdev/cursor.c | 22 +- src/glut/fbdev/fbdev.c | 91 ++++--- src/glut/fbdev/input.c | 282 +++++++++++++-------- src/glut/fbdev/internal.h | 5 +- src/glut/fbdev/menu.c | 2 +- src/glut/fbdev/overlay.c | 1 + src/mesa/Makefile | 4 +- src/mesa/drivers/directfb/idirectfbgl_mesa.c | 187 ++++++++------ src/mesa/drivers/dri/common/dri_util.c | 9 +- src/mesa/drivers/dri/i915/i830_metaops.c | 2 - src/mesa/drivers/dri/i915tex/i830_state.c | 3 +- src/mesa/drivers/dri/i915tex/i830_texstate.c | 32 ++- src/mesa/drivers/dri/i915tex/i830_vtbl.c | 8 +- src/mesa/drivers/dri/i915tex/server/i830_common.h | 8 + src/mesa/drivers/dri/i915tex/server/i830_dri.h | 42 ++- src/mesa/drivers/dri/i915tex/server/intel.h | 5 +- src/mesa/drivers/dri/i915tex/server/intel_dri.c | 81 ++++-- src/mesa/drivers/dri/i965/brw_context.c | 2 + src/mesa/drivers/dri/i965/brw_context.h | 6 +- src/mesa/drivers/dri/i965/brw_fallback.c | 3 + src/mesa/drivers/dri/i965/brw_metaops.c | 100 +++++++- src/mesa/drivers/dri/i965/brw_tex.c | 32 +++ src/mesa/drivers/dri/i965/brw_vtbl.c | 1 + src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 6 + src/mesa/drivers/dri/i965/intel_context.c | 5 + src/mesa/drivers/dri/i965/intel_context.h | 7 +- src/mesa/drivers/dri/i965/intel_pixel_copy.c | 105 +++++++- src/mesa/drivers/dri/i965/intel_tex_validate.c | 3 + src/mesa/drivers/dri/mga/mgatex.c | 3 + src/mesa/drivers/dri/r200/r200_context.h | 2 + src/mesa/drivers/dri/r200/r200_maos_arrays.c | 111 +++++++- src/mesa/drivers/dri/r200/r200_sanity.c | 2 +- src/mesa/drivers/dri/r200/r200_vertprog.c | 7 + src/mesa/main/context.c | 2 +- src/mesa/shader/arbprogram.c | 10 +- src/mesa/shader/atifragshader.c | 2 + src/mesa/shader/program.c | 4 + src/mesa/shader/slang/slang_assemble_assignment.c | 184 +++++++------- src/mesa/shader/slang/slang_assemble_assignment.h | 17 +- src/mesa/shader/slang/slang_assemble_constructor.c | 43 ++-- src/mesa/shader/slang/slang_assemble_constructor.h | 7 +- src/mesa/shader/slang/slang_compile.c | 52 +--- src/mesa/shader/slang/slang_compile_function.h | 4 +- src/mesa/shader/slang/slang_compile_operation.c | 125 +++++---- src/mesa/shader/slang/slang_compile_operation.h | 23 +- src/mesa/shader/slang/slang_compile_variable.c | 26 ++ src/mesa/shader/slang/slang_compile_variable.h | 3 + src/mesa/tnl/t_vb_arbprogram.c | 2 +- 60 files changed, 1171 insertions(+), 651 deletions(-) delete mode 100644 include/GL/directfbgl.h (limited to 'debian') diff --git a/Makefile b/Makefile index b95cedda8d8..74784888981 100644 --- a/Makefile +++ b/Makefile @@ -174,7 +174,6 @@ MAIN_FILES = \ $(DIRECTORY)/include/GL/internal/glcore.h \ $(DIRECTORY)/include/GL/amesa.h \ $(DIRECTORY)/include/GL/dmesa.h \ - $(DIRECTORY)/include/GL/directfbgl.h \ $(DIRECTORY)/include/GL/fxmesa.h \ $(DIRECTORY)/include/GL/ggimesa.h \ $(DIRECTORY)/include/GL/gl.h \ diff --git a/configs/linux-dri-x86-64 b/configs/linux-dri-x86-64 index 4fbd0a0876d..821ab3e3366 100644 --- a/configs/linux-dri-x86-64 +++ b/configs/linux-dri-x86-64 @@ -20,5 +20,5 @@ EXTRA_LIB_PATH=-L/usr/X11R6/lib64 # the new interface. i810 are missing because there is no x86-64 # system where they could *ever* be used. # -DRI_DIRS = i915 mach64 mga r128 r200 radeon tdfx unichrome savage r300 +DRI_DIRS = i915tex i915 i965 mach64 mga r128 r200 radeon tdfx unichrome savage r300 diff --git a/configs/linux-fbdev b/configs/linux-fbdev index 7a5d1b600f9..e36d20a702c 100644 --- a/configs/linux-fbdev +++ b/configs/linux-fbdev @@ -4,17 +4,13 @@ include $(TOP)/configs/linux CONFIG_NAME = linux-fbdev -DRIVER_DIRS = fbdev +CFLAGS = -O3 -ffast-math -ansi -pedantic -fPIC -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DPTHREADS -DUSE_GLFBDEV_DRIVER SRC_DIRS = mesa glu glut/fbdev - -CFLAGS = -O3 -ffast-math -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DPTHREADS -DUSE_GLFBDEV_DRIVER - - -SRC_DIRS = mesa glu glut/fbdev -DRIVER_DIRS = fbdev +DRIVER_DIRS = fbdev osmesa PROGRAM_DIRS = fbdev demos redbook samples GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lm -lpthread +OSMESA_LIB_DEPS = -lm -lpthread GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) $(EXTRA_LIB_PATH) -lgpm -lm diff --git a/debian/changelog b/debian/changelog index 342741b5a05..b24e4e7f845 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +mesa (6.5.2-0.1) experimental; urgency=low + + * Non-maintainer upload. + * New upstream release. + + -- Thierry Reding Sun, 3 Dec 2006 00:45:09 +0100 + mesa (6.5.2~rc3-0.1) experimental; urgency=low * Non-maintainer upload. diff --git a/docs/README.directfb b/docs/README.directfb index 169ebe486ee..e3bada4888b 100644 --- a/docs/README.directfb +++ b/docs/README.directfb @@ -6,7 +6,7 @@ Requirements ============ To build Mesa with DirectFB (DirectFBGL) support you need: - - DirectFB at least 0.9.21 (http://directfb.org) + - DirectFB at least 1.0.0 (http://directfb.org) - pkg-config at least 0.9 (http://pkgconfig.sf.net) diff --git a/docs/news.html b/docs/news.html index 9cd622fe227..c5f68a6e231 100644 --- a/docs/news.html +++ b/docs/news.html @@ -11,6 +11,12 @@

    News

    +

    December 2, 2006

    +

    +Mesa 6.5.2 has been released. +This is a new development release. +

    +

    September 15, 2006

    Mesa 6.5.1 has been released. @@ -1070,6 +1076,6 @@ source code.


    -$Id: news.html,v 3.32 2006/09/21 22:51:16 brianp Exp $ +$Id: news.html,v 3.33 2006/12/02 18:18:41 brianp Exp $ diff --git a/docs/relnotes-6.5.1.html b/docs/relnotes-6.5.1.html index b053203f72a..0f03f931e02 100644 --- a/docs/relnotes-6.5.1.html +++ b/docs/relnotes-6.5.1.html @@ -12,7 +12,7 @@

    Mesa 6.5.1 is a 6.5 follow-on development release mostly consisting of -bug fixes. +bug fixes.

    diff --git a/docs/relnotes-6.5.2.html b/docs/relnotes-6.5.2.html index a8eb970cd24..c4597c9d1a1 100644 --- a/docs/relnotes-6.5.2.html +++ b/docs/relnotes-6.5.2.html @@ -8,11 +8,11 @@ -

    Mesa 6.5.2 Release Notes / (in progress)

    +

    Mesa 6.5.2 Release Notes / December 2, 2006

    -Mesa 6.5.2 is a 6.5 follow-on development release mostly consisting of -bug fixes. +Mesa 6.5.2 is a 6.5 follow-on development release with a few new features +but mostly consisting of bug fixes.

    diff --git a/include/GL/directfbgl.h b/include/GL/directfbgl.h deleted file mode 100644 index 984c4b14279..00000000000 --- a/include/GL/directfbgl.h +++ /dev/null @@ -1,89 +0,0 @@ -/* - (c) Copyright 2001 convergence integrated media GmbH. - All rights reserved. - - Written by Denis Oliver Kropp and - Andreas Hundt . - - 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 2 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, write to the - Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#ifndef __DIRECTFBGL_H__ -#define __DIRECTFBGL_H__ - -#include - -#ifdef __cplusplus -extern "C" -{ -#endif - - -typedef struct { - int buffer_size; - int depth_size; - int stencil_size; - int aux_buffers; - - int red_size; - int green_size; - int blue_size; - int alpha_size; - - int accum_red_size; - int accum_green_size; - int accum_blue_size; - int accum_alpha_size; - - DFBBoolean double_buffer; - DFBBoolean stereo; -} DFBGLAttributes; - - -DEFINE_INTERFACE( IDirectFBGL, - - /** Context handling **/ - - /* - * Acquire the hardware lock. - */ - DFBResult (*Lock) ( - IDirectFBGL *thiz - ); - - /* - * Release the lock. - */ - DFBResult (*Unlock) ( - IDirectFBGL *thiz - ); - - /* - * Query the OpenGL attributes. - */ - DFBResult (*GetAttributes) ( - IDirectFBGL *thiz, - DFBGLAttributes *attributes - ); -) - - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/include/GL/internal/glcore.h b/include/GL/internal/glcore.h index d5cbd3b2a5c..ca3cf5be572 100644 --- a/include/GL/internal/glcore.h +++ b/include/GL/internal/glcore.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/include/GL/internal/glcore.h,v 1.7 2001/03/25 05:32:00 tsi Exp $ */ #ifndef __gl_core_h_ #define __gl_core_h_ @@ -37,9 +36,7 @@ ** */ -#ifndef XFree86LOADER #include -#endif #ifdef CAPI #undef CAPI diff --git a/src/glut/fbdev/callback.c b/src/glut/fbdev/callback.c index 946c8d8c133..8c039f530be 100644 --- a/src/glut/fbdev/callback.c +++ b/src/glut/fbdev/callback.c @@ -74,19 +74,16 @@ void glutKeyboardUpFunc(void (*func)(unsigned char key, int x, int y)) void glutMouseFunc(void (*func)(int button, int state, int x, int y)) { - MouseEnabled = 1; MouseFunc = func; } void glutMotionFunc(void (*func)(int x, int y)) { - MouseEnabled = 1; MotionFunc = func; } void glutPassiveMotionFunc(void (*func)(int x, int y)) { - MouseEnabled = 1; PassiveMotionFunc = func; } diff --git a/src/glut/fbdev/colormap.c b/src/glut/fbdev/colormap.c index 3a81f93657d..3e72a7b0513 100644 --- a/src/glut/fbdev/colormap.c +++ b/src/glut/fbdev/colormap.c @@ -92,12 +92,18 @@ static void FillReverseColorMap(void) void RestoreColorMap(void) { + if(FixedInfo.visual == FB_VISUAL_TRUECOLOR) + return; + if (ioctl(FrameBufferFD, FBIOPUTCMAP, (void *) &ColorMap) < 0) sprintf(exiterror, "ioctl(FBIOPUTCMAP) failed!\n"); } void LoadColorMap(void) { + if(FixedInfo.visual == FB_VISUAL_TRUECOLOR) + return; + ColorMap.start = 0; ColorMap.red = RedColorMap; ColorMap.green = GreenColorMap; diff --git a/src/glut/fbdev/cursor.c b/src/glut/fbdev/cursor.c index 6cd087e93c8..4bb2b7fba01 100644 --- a/src/glut/fbdev/cursor.c +++ b/src/glut/fbdev/cursor.c @@ -66,6 +66,9 @@ void EraseCursor(void) unsigned char *src = MouseBuffer; + if(!MouseVisible || CurrentCursor < 0 || CurrentCursor >= NUM_CURSORS) + return; + for(i = 0; i= NUM_CURSORS) + if(!MouseVisible || CurrentCursor < 0 || CurrentCursor >= NUM_CURSORS) return; px = MouseX - CursorsXOffset[CurrentCursor]; @@ -212,10 +215,12 @@ void SwapCursor(void) int miny = MIN(py, LastMouseY); int sizey = abs(py - LastMouseY); - DrawCursor(); - /* now update the portion of the screen that has changed */ + if(MouseVisible) + DrawCursor(); - if(DisplayMode & GLUT_DOUBLE && (sizex || sizey)) { + /* now update the portion of the screen that has changed, this is also + used to hide the mouse if MouseVisible is 0 */ + if(DisplayMode & GLUT_DOUBLE && ((sizex || sizey) || !MouseVisible)) { int off, stride, i; if(minx < 0) minx = 0; @@ -230,7 +235,7 @@ void SwapCursor(void) + minx * VarInfo.bits_per_pixel / 8; stride = (sizex + CURSOR_WIDTH) * VarInfo.bits_per_pixel / 8; - for(i = 0; i< sizey + CURSOR_HEIGHT; i++) { + for(i = 0; i < sizey + CURSOR_HEIGHT; i++) { memcpy(FrameBuffer+off, BackBuffer+off, stride); off += FixedInfo.line_length; } @@ -260,11 +265,8 @@ void glutSetCursor(int cursor) if(cursor == GLUT_CURSOR_FULL_CROSSHAIR) cursor = GLUT_CURSOR_CROSSHAIR; - if(CurrentCursor >= 0 && CurrentCursor < NUM_CURSORS) - EraseCursor(); - + EraseCursor(); + MouseVisible = 1; CurrentCursor = cursor; - - MouseEnabled = 1; SwapCursor(); } diff --git a/src/glut/fbdev/fbdev.c b/src/glut/fbdev/fbdev.c index 7b46d545920..3b63cd70ea1 100644 --- a/src/glut/fbdev/fbdev.c +++ b/src/glut/fbdev/fbdev.c @@ -74,6 +74,7 @@ int Redisplay; int Visible; int VisibleSwitch; int Active; +static int Resized; /* we have to poll to see if we are visible on a framebuffer that is not active */ int VisiblePoll; @@ -127,8 +128,10 @@ static void Cleanup(void) fprintf(stderr, "ioctl(FBIOPUT_VSCREENINFO failed): %s\n", strerror(errno)); - munmap(FrameBuffer, FixedInfo.smem_len); + if(FrameBuffer) + munmap(FrameBuffer, FixedInfo.smem_len); close(FrameBufferFD); + } /* free allocated back buffer */ @@ -424,6 +427,8 @@ static void ProcessTimers(void) void glutMainLoop(void) { + int idleiters; + if(ReshapeFunc) ReshapeFunc(VarInfo.xres, VarInfo.yres); @@ -440,8 +445,6 @@ void glutMainLoop(void) else if(VisiblePoll) TestVisible(); - else - usleep(1); if(IdleFunc) IdleFunc(); @@ -452,17 +455,48 @@ void glutMainLoop(void) VisibilityFunc(Visible ? GLUT_VISIBLE : GLUT_NOT_VISIBLE); } + if(Resized) { + SetVideoMode(); + CreateBuffer(); + + if(!glFBDevMakeCurrent( Context, Buffer, Buffer )) { + sprintf(exiterror, "Failure to Make Current\n"); + exit(0); + } + + InitializeMenus(); + + if(ReshapeFunc) + ReshapeFunc(VarInfo.xres, VarInfo.yres); + + Redisplay = 1; + Resized = 0; + } + if(Visible && Redisplay) { Redisplay = 0; - if(MouseEnabled) - EraseCursor(); + EraseCursor(); DisplayFunc(); if(!(DisplayMode & GLUT_DOUBLE)) { if(ActiveMenu) DrawMenus(); - if(MouseEnabled) - DrawCursor(); + DrawCursor(); } + idleiters = 0; + } else { + /* we sleep if not receiving redisplays, and + the main loop is running faster than 2khz */ + + static int lasttime; + int time = glutGet(GLUT_ELAPSED_TIME); + if(time > lasttime) { + if(idleiters >= 2) + usleep(100); + + idleiters = 0; + lasttime = time; + } + idleiters++; } } } @@ -536,17 +570,16 @@ int ParseFBModes(int minw, int maxw, int minh, int maxh, int minf, int maxf) return 0; } -/* ---------- Window Management ----------*/ void SetVideoMode(void) { /* set new variable screen info */ if (ioctl(FrameBufferFD, FBIOPUT_VSCREENINFO, &VarInfo)) { - sprintf(exiterror, "ioctl(FBIOPUT_VSCREENINFO failed): %s\n", - strerror(errno)); + sprintf(exiterror, "FBIOPUT_VSCREENINFO failed: %s\n", strerror(errno)); + strcat(exiterror, "Perhaps the device does not support the selected mode\n"); exit(0); } - /* reload the screen info to update offsets */ + /* reload the screen info to update rgb bits */ if (ioctl(FrameBufferFD, FBIOGET_VSCREENINFO, &VarInfo)) { sprintf(exiterror, "error: ioctl(FBIOGET_VSCREENINFO) failed: %s\n", strerror(errno)); @@ -571,11 +604,10 @@ void SetVideoMode(void) } /* initialize colormap */ - if(FixedInfo.visual != FB_VISUAL_TRUECOLOR) - LoadColorMap(); + LoadColorMap(); } -void CreateBuffer() +void CreateBuffer(void) { int size = VarInfo.xres_virtual * VarInfo.yres_virtual * VarInfo.bits_per_pixel / 8; @@ -674,20 +706,6 @@ void CreateVisual(void) } } -static void ResizeVisual(void) -{ - if(!glFBDevMakeCurrent( Context, Buffer, Buffer )) { - sprintf(exiterror, "Failure to Make Current\n"); - exit(0); - } - - InitializeMenus(); - - if(ReshapeFunc) - ReshapeFunc(VarInfo.xres, VarInfo.yres); - Redisplay = 1; -} - static void SignalWinch(int arg) { /* we can't change bitdepth without destroying the visual */ @@ -709,10 +727,7 @@ static void SignalWinch(int arg) VarInfo.blue = blue; VarInfo.transp = transp; - SetVideoMode(); - CreateBuffer(); - - ResizeVisual(); + Resized = 1; } int glutCreateWindow (const char *title) @@ -805,12 +820,14 @@ void glutSwapBuffers(void) { glFlush(); + if(!(DisplayMode & GLUT_DOUBLE)) + return; + if(ActiveMenu) DrawMenus(); - if(MouseEnabled) - DrawCursor(); + DrawCursor(); - if(DisplayMode & GLUT_DOUBLE && Visible) { + if(Visible) { Swapping = 1; glFBDevSwapBuffers(Buffer); Swapping = 0; @@ -839,10 +856,8 @@ void glutReshapeWindow(int width, int height) signal(SIGWINCH, SIG_IGN); SetVideoMode(); - CreateBuffer(); - - ResizeVisual(); signal(SIGWINCH, SignalWinch); + Resized = 1; } void glutFullScreen(void) diff --git a/src/glut/fbdev/input.c b/src/glut/fbdev/input.c index d09de22ed7e..044aa50fd86 100644 --- a/src/glut/fbdev/input.c +++ b/src/glut/fbdev/input.c @@ -65,8 +65,8 @@ double MouseSpeed = 0; int KeyRepeatMode = GLUT_KEY_REPEAT_DEFAULT; -/* only display the mouse if there is a registered callback for it */ -int MouseEnabled = 0; +int MouseVisible = 0; +int LastMouseTime = 0; static int OldKDMode = -1; static int OldMode = KD_TEXT; @@ -79,6 +79,8 @@ static int MouseFD; static int kbdpipe[2]; +static int LastStdinKeyTime, LastStdinSpecialKey = -1, LastStdinCode = -1; + #define MODIFIER(mod) \ KeyboardModifiers = release ? KeyboardModifiers & ~mod \ : KeyboardModifiers | mod; @@ -93,7 +95,6 @@ static void KeyboardHandler(int sig) unsigned char code; while(read(ConsoleFD, &code, 1) == 1) { - int release, labelval; struct kbentry entry; static int lalt; /* only left alt does vt switch */ @@ -163,10 +164,47 @@ static void LedModifier(int led, int release) KeyboardLedState ^= led; releaseflag &= ~led; } + ioctl(ConsoleFD, KDSKBLED, KeyboardLedState); ioctl(ConsoleFD, KDSETLED, 0x80); } +static void HandleKeyPress(unsigned char key, int up) +{ + if(up) { + if(KeyboardUpFunc) + KeyboardUpFunc(key, MouseX, MouseY); + } else + if(KeyboardFunc) + KeyboardFunc(key, MouseX, MouseY); + + /* there was no keyboard handler to provide a way to exit the program */ + if(key == 27) + exit(0); +} + +static void HandleSpecialPress(int key, int up) +{ + if(up) { + if(SpecialUpFunc) + SpecialUpFunc(key, MouseX, MouseY); + } else + if(SpecialFunc) + SpecialFunc(key, MouseX, MouseY); +} + +static void ReleaseStdinKey(void) +{ + if(LastStdinSpecialKey != -1) { + HandleSpecialPress(LastStdinSpecialKey, 1); + LastStdinSpecialKey = -1; + } + if(LastStdinCode != -1) { + HandleKeyPress(LastStdinCode, 1); + LastStdinCode = -1; + } +} + #define READKEY read(kbdpipe[0], &code, 1) static int ReadKey(void) { @@ -175,8 +213,14 @@ static int ReadKey(void) int specialkey = 0; struct kbentry entry; - if(READKEY != 1) + if(READKEY != 1) { + /* if we are reading from stdin, we detect key releases when the key + does not repeat after a given timeout */ + if(ConsoleFD == 0 && LastStdinKeyTime + 100 < glutGet(GLUT_ELAPSED_TIME)) + ReleaseStdinKey(); return 0; + } + if(code == 0) return 0; @@ -185,65 +229,82 @@ static int ReadKey(void) KeyboardModifiers = 0; altset: if(code == 27 && READKEY == 1) { - switch(code) { - case 79: /* function key */ - READKEY; - if(code == 50) { - READKEY; - shiftfunc: - KeyboardModifiers |= GLUT_ACTIVE_SHIFT; - specialkey = GLUT_KEY_F1 + code - 53; - READKEY; - } else { - READKEY; - specialkey = GLUT_KEY_F1 + code - 80; - } - break; - case 91: - READKEY; - switch(code) { - case 68: - specialkey = GLUT_KEY_LEFT; break; - case 65: - specialkey = GLUT_KEY_UP; break; - case 67: - specialkey = GLUT_KEY_RIGHT; break; - case 66: - specialkey = GLUT_KEY_DOWN; break; - case 53: - specialkey = GLUT_KEY_PAGE_UP; READKEY; break; - case 54: - specialkey = GLUT_KEY_PAGE_DOWN; READKEY; break; - case 49: - specialkey = GLUT_KEY_HOME; READKEY; break; - case 52: - specialkey = GLUT_KEY_END; READKEY; break; - case 50: - READKEY; - if(code != 126) - goto shiftfunc; - specialkey = GLUT_KEY_INSERT; - break; - case 51: - code = '\b'; - goto stdkey; - case 91: - READKEY; - specialkey = GLUT_KEY_F1 + code - 65; - break; - default: - return 0; - } - break; - default: + if(code != 91) { KeyboardModifiers |= GLUT_ACTIVE_ALT; goto altset; } + READKEY; + switch(code) { + case 68: + specialkey = GLUT_KEY_LEFT; break; + case 65: + specialkey = GLUT_KEY_UP; break; + case 67: + specialkey = GLUT_KEY_RIGHT; break; + case 66: + specialkey = GLUT_KEY_DOWN; break; + case 52: + specialkey = GLUT_KEY_END; READKEY; break; + case 53: + specialkey = GLUT_KEY_PAGE_UP; READKEY; break; + case 54: + specialkey = GLUT_KEY_PAGE_DOWN; READKEY; break; + case 49: + READKEY; + if(code == 126) + specialkey = GLUT_KEY_HOME; + else { + specialkey = GLUT_KEY_F1 + code - 50; + READKEY; + } + break; + case 50: + READKEY; + if(code == 126) + specialkey = GLUT_KEY_INSERT; + else { + if(code > '1') + code--; + if(code > '6') + code--; + if(code > '3') { + KeyboardModifiers |= GLUT_ACTIVE_SHIFT; + code -= 12; + } + specialkey = GLUT_KEY_F1 + code - 40; + READKEY; + } + break; + case 51: + READKEY; + if(code == 126) { + code = '\b'; + goto stdkey; + } + KeyboardModifiers |= GLUT_ACTIVE_SHIFT; + specialkey = GLUT_KEY_F1 + code - 45; + READKEY; + break; + case 91: + READKEY; + specialkey = GLUT_KEY_F1 + code - 65; + break; + default: + return 0; + } } if(specialkey) { - if(SpecialFunc) - SpecialFunc(specialkey, MouseX, MouseY); + LastStdinKeyTime = glutGet(GLUT_ELAPSED_TIME); + + if(LastStdinSpecialKey != specialkey) { + ReleaseStdinKey(); + HandleSpecialPress(specialkey, 0); + LastStdinSpecialKey = specialkey; + LastStdinKeyTime += 200; /* initial repeat */ + } else + if(KeyRepeatMode != GLUT_KEY_REPEAT_OFF) + HandleSpecialPress(specialkey, 0); } else { if(code >= 1 && code <= 26 && code != '\r') { KeyboardModifiers |= GLUT_ACTIVE_CTRL; @@ -255,8 +316,15 @@ static int ReadKey(void) KeyboardModifiers |= GLUT_ACTIVE_SHIFT; stdkey: - if(KeyboardFunc) - KeyboardFunc(code, MouseX, MouseY); + LastStdinKeyTime = glutGet(GLUT_ELAPSED_TIME); + if(LastStdinCode != code) { + ReleaseStdinKey(); + HandleKeyPress(code, 0); + LastStdinCode = code; + LastStdinKeyTime += 200; /* initial repeat */ + } else + if(KeyRepeatMode != GLUT_KEY_REPEAT_OFF) + HandleSpecialPress(code, 0); } return 1; } @@ -348,12 +416,7 @@ static int ReadKey(void) /* dispatch callback */ if(specialkey) { - if(release) { - if(SpecialUpFunc) - SpecialUpFunc(specialkey, MouseX, MouseY); - } else - if(SpecialFunc) - SpecialFunc(specialkey, MouseX, MouseY); + HandleSpecialPress(specialkey, release); } else { char c = labelval; @@ -364,12 +427,7 @@ static int ReadKey(void) if(c >= 'a' && c <= 'z') c += 'A' - 'a'; } - if(release) { - if(KeyboardUpFunc) - KeyboardUpFunc(c, MouseX, MouseY); - } else - if(KeyboardFunc) - KeyboardFunc(c, MouseX, MouseY); + HandleKeyPress(c, release); } return 1; } @@ -432,28 +490,22 @@ static int ReadMouse(void) dy = event.dy; } else #endif - { - char data[4]; - - if(MouseFD == -1) - return 0; + { + char data[4]; - if(fcntl(MouseFD, F_SETFL, O_NONBLOCK) == -1) { - close(MouseFD); - MouseFD = -1; - return 0; - } + if(MouseFD == -1) + return 0; - if(read(MouseFD, data, 4) != 4) - return 0; + if(read(MouseFD, data, 4) != 4) + return 0; - l = ((data[0] & 0x20) >> 3); - m = ((data[3] & 0x10) >> 3); - r = ((data[0] & 0x10) >> 4); + l = ((data[0] & 0x20) >> 3); + m = ((data[3] & 0x10) >> 3); + r = ((data[0] & 0x10) >> 4); - dx = (((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - dy = (((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - } + dx = (((data[0] & 0x03) << 6) | (data[1] & 0x3F)); + dy = (((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); + } MouseX += dx * MouseSpeed; if(MouseX < 0) @@ -478,7 +530,7 @@ static int ReadMouse(void) ll = l, lm = m, lr = r; - if(dx || dy) { + if(dx || dy || !MouseVisible) { if(l || m || r) { if(MotionFunc) MotionFunc(MouseX, MouseY); @@ -488,12 +540,16 @@ static int ReadMouse(void) EraseCursor(); + MouseVisible = 1; + if(ActiveMenu) Redisplay = 1; else SwapCursor(); } + LastMouseTime = glutGet(GLUT_ELAPSED_TIME); + return 1; } @@ -502,8 +558,14 @@ void ReceiveInput(void) if(ConsoleFD != -1) while(ReadKey()); - if(MouseEnabled) - while(ReadMouse()); + while(ReadMouse()); + + /* implement a 2 second timeout on the mouse */ + if(MouseVisible && glutGet(GLUT_ELAPSED_TIME) - LastMouseTime > 2000) { + EraseCursor(); + MouseVisible = 0; + SwapCursor(); + } } static void VTSwitchHandler(int sig) @@ -526,11 +588,7 @@ static void VTSwitchHandler(int sig) if(st.v_active) ioctl(ConsoleFD, VT_RELDISP, VT_ACKACQ); - /* this is a hack to turn the cursor off */ - ioctl(FrameBufferFD, FBIOPUT_VSCREENINFO, &VarInfo); - - if(FixedInfo.visual != FB_VISUAL_TRUECOLOR) - RestoreColorMap(); + RestoreColorMap(); Active = 1; Visible = 1; @@ -570,11 +628,6 @@ void InitializeVT(int usestdin) exit(0); } - if(fcntl(0, F_SETFL, O_NONBLOCK | O_ASYNC) < 0) { - sprintf(exiterror, "Failed to set keyboard to non-blocking\n"); - exit(0); - } - Active = 1; if(usestdin) { @@ -582,6 +635,12 @@ void InitializeVT(int usestdin) return; } + /* enable sigio for input */ + if(fcntl(0, F_SETFL, O_ASYNC) < 0) { + sprintf(exiterror, "Failed to set O_ASYNC mode on fd 0\n"); + exit(0); + } + /* detect the current vt if it was not specified */ if(CurrentVT == 0) { int fd = open("/dev/tty", O_RDWR | O_NDELAY, 0); @@ -590,15 +649,16 @@ void InitializeVT(int usestdin) sprintf(exiterror, "Failed to open /dev/tty\n"); exit(0); } + if(ioctl(fd, VT_GETSTATE, &st) == -1) { fprintf(stderr, "Could not detect current vt, specify with -vt\n"); fprintf(stderr, "Defaulting to stdin input\n"); ConsoleFD = 0; close(fd); return; - } else - CurrentVT = st.v_active; + } + CurrentVT = st.v_active; close(fd); } @@ -686,10 +746,10 @@ void RestoreVT(void) if (tcsetattr(0, TCSANOW, &OldTermios) < 0) fprintf(stderr, "tcsetattr failed\n"); - /* setting the mode to text from graphics restores the colormap*/ + /* setting the mode to text from graphics restores the colormap */ if( #ifdef HAVE_GPM - GpmMouse || + !GpmMouse || #endif ConsoleFD == 0) if(ioctl(ConsoleFD, KDSETMODE, KD_GRAPHICS) < 0) @@ -725,11 +785,11 @@ void InitializeMouse(void) const char *mousedev = getenv("MOUSE"); if(!mousedev) mousedev = MOUSEDEV; - if((MouseFD = open(mousedev, O_RDONLY)) >= 0) { - if(!MouseSpeed) - MouseSpeed = 1; - NumMouseButtons = 3; - return; + if((MouseFD = open(mousedev, O_RDONLY | O_NONBLOCK)) >= 0) { + if(!MouseSpeed) + MouseSpeed = 1; + NumMouseButtons = 3; + return; } } #ifdef HAVE_GPM diff --git a/src/glut/fbdev/internal.h b/src/glut/fbdev/internal.h index 8801cc9f6c3..0a159d96b0a 100644 --- a/src/glut/fbdev/internal.h +++ b/src/glut/fbdev/internal.h @@ -51,6 +51,8 @@ extern int Swapping, VTSwitch; void TestVisible(void); int ParseFBModes(int, int, int, int, int, int); +void SetVideoMode(void); +void CreateBuffer(void); void CreateVisual(void); extern int FrameBufferFD; @@ -84,7 +86,8 @@ void RestoreColorMap(void); /* --- mouse --- */ extern int MouseX, MouseY; extern int CurrentCursor; -extern int MouseEnabled; +extern int MouseVisible; +extern int LastMouseTime; extern int NumMouseButtons; void InitializeCursor(void); diff --git a/src/glut/fbdev/menu.c b/src/glut/fbdev/menu.c index 18cd58d6a2d..4ab4eb30d46 100644 --- a/src/glut/fbdev/menu.c +++ b/src/glut/fbdev/menu.c @@ -71,6 +71,7 @@ void FreeMenus(void) free(Menus[i].Items[j].name); free(Menus[i].Items); } + free(Menus); } @@ -206,7 +207,6 @@ void CloseMenu(void) int glutCreateMenu(void (*func)(int value)) { - MouseEnabled = 1; CurrentMenu = NumMenus; NumMenus++; Menus = realloc(Menus, sizeof(*Menus) * NumMenus); diff --git a/src/glut/fbdev/overlay.c b/src/glut/fbdev/overlay.c index 8bd207155c0..374cf30e7df 100644 --- a/src/glut/fbdev/overlay.c +++ b/src/glut/fbdev/overlay.c @@ -24,6 +24,7 @@ * Written by Sean D'Epagnier (c) 2006 */ +#include #include void glutEstablishOverlay(void) diff --git a/src/mesa/Makefile b/src/mesa/Makefile index 3f65ecf5cc9..1cd9e5b2bb7 100644 --- a/src/mesa/Makefile +++ b/src/mesa/Makefile @@ -33,8 +33,8 @@ default: $(MAKE) beos ; \ elif [ "$(DRIVER_DIRS)" = "directfb" ]; then \ $(MAKE) directfb ; \ - elif [ "$(DRIVER_DIRS)" = "fbdev" ]; then \ - $(MAKE) fbdev ; \ + elif [ "$(DRIVER_DIRS)" = "fbdev osmesa" ]; then \ + $(MAKE) fbdev ; $(MAKE) osmesa-only ; \ else \ $(MAKE) stand-alone ; \ fi diff --git a/src/mesa/drivers/directfb/idirectfbgl_mesa.c b/src/mesa/drivers/directfb/idirectfbgl_mesa.c index 323cdd67913..3c8c6c256e6 100644 --- a/src/mesa/drivers/directfb/idirectfbgl_mesa.c +++ b/src/mesa/drivers/directfb/idirectfbgl_mesa.c @@ -25,24 +25,16 @@ #include -#include -#include -#include - #include #include -#define VERSION_CODE( M, m, r ) (((M) * 1000) + ((m) * 100) + ((r))) -#define DIRECTFB_VERSION_CODE VERSION_CODE( DIRECTFB_MAJOR_VERSION, \ - DIRECTFB_MINOR_VERSION, \ - DIRECTFB_MICRO_VERSION ) +#include +#include +#include +#include -#ifdef CLAMP -# undef CLAMP -#endif - -#include "GL/directfbgl.h" +#undef CLAMP #include "glheader.h" #include "buffers.h" #include "context.h" @@ -62,6 +54,12 @@ #include "drivers/common/driverfuncs.h" +#define VERSION_CODE( M, m, r ) (((M) * 1000) + ((m) * 100) + ((r))) +#define DIRECTFB_VERSION_CODE VERSION_CODE( DIRECTFB_MAJOR_VERSION, \ + DIRECTFB_MINOR_VERSION, \ + DIRECTFB_MICRO_VERSION ) + + static DFBResult Probe( void *data ); @@ -79,7 +77,7 @@ DIRECT_INTERFACE_IMPLEMENTATION( IDirectFBGL, Mesa ) typedef struct { int ref; /* reference counter */ - DFBBoolean locked; + int locked; IDirectFBSurface *surface; DFBSurfacePixelFormat format; @@ -87,8 +85,8 @@ typedef struct { int height; struct { - __u8 *start; - __u8 *end; + GLubyte *start; + GLubyte *end; int pitch; } video; @@ -185,12 +183,14 @@ IDirectFBGL_Mesa_Lock( IDirectFBGL *thiz ) IDirectFBSurface *surface; int width = 0; int height = 0; - DFBResult err; + DFBResult ret; DIRECT_INTERFACE_GET_DATA( IDirectFBGL ); - if (data->locked) - return DFB_LOCKED; + if (data->locked) { + data->locked++; + return DFB_OK; + } if (directfbgl_lock()) return DFB_LOCKED; @@ -198,11 +198,12 @@ IDirectFBGL_Mesa_Lock( IDirectFBGL *thiz ) surface = data->surface; surface->GetSize( surface, &width, &height ); - err = surface->Lock( surface, DSLF_READ | DSLF_WRITE, + ret = surface->Lock( surface, DSLF_READ | DSLF_WRITE, (void*)&data->video.start, &data->video.pitch ); - if (err != DFB_OK) { + if (ret) { D_ERROR( "DirectFBGL/Mesa: couldn't lock surface.\n" ); - return err; + directfbgl_unlock(); + return ret; } data->video.end = data->video.start + (height-1) * data->video.pitch; @@ -212,13 +213,13 @@ IDirectFBGL_Mesa_Lock( IDirectFBGL *thiz ) &data->framebuffer, &data->framebuffer ); if (data->width != width || data->height != height) { + _mesa_resize_framebuffer( &data->context, + &data->framebuffer, width, height ); data->width = width; - data->height = height; - _mesa_resize_framebuffer(&data->context, - &data->framebuffer, width, height); + data->height = height; } - data->locked = DFB_TRUE; + data->locked++; return DFB_OK; } @@ -230,14 +231,14 @@ IDirectFBGL_Mesa_Unlock( IDirectFBGL *thiz ) if (!data->locked) return DFB_OK; - - _mesa_make_current( NULL, NULL, NULL ); + + if (--data->locked == 0) { + _mesa_make_current( NULL, NULL, NULL ); - data->surface->Unlock( data->surface ); - - directfbgl_unlock(); + data->surface->Unlock( data->surface ); - data->locked = DFB_FALSE; + directfbgl_unlock(); + } return DFB_OK; } @@ -270,12 +271,32 @@ IDirectFBGL_Mesa_GetAttributes( IDirectFBGL *thiz, attributes->accum_green_size = visual->accumGreenBits; attributes->accum_blue_size = visual->accumBlueBits; attributes->accum_alpha_size = visual->accumAlphaBits; - attributes->double_buffer = (caps & DSCAPS_FLIPPING) ? 1 : 0; + attributes->double_buffer = ((caps & DSCAPS_FLIPPING) != 0); attributes->stereo = (visual->stereoMode != 0); return DFB_OK; } +#if DIRECTFBGL_INTERFACE_VERSION >= 1 +static DFBResult +IDirectFBGL_Mesa_GetProcAddress( IDirectFBGL *thiz, + const char *name, + void **ret_address ) +{ + DIRECT_INTERFACE_GET_DATA( IDirectFBGL ); + + if (!name) + return DFB_INVARG; + + if (!ret_address) + return DFB_INVARG; + + *ret_address = _glapi_get_proc_address( name ); + + return (*ret_address) ? DFB_OK : DFB_UNSUPPORTED; +} +#endif + /* exported symbols */ @@ -288,6 +309,8 @@ Probe( void *data ) static DFBResult Construct( IDirectFBGL *thiz, IDirectFBSurface *surface ) { + DFBResult ret; + /* Initialize global resources. */ if (directfbgl_init()) return DFB_INIT; @@ -296,12 +319,17 @@ Construct( IDirectFBGL *thiz, IDirectFBSurface *surface ) DIRECT_ALLOCATE_INTERFACE_DATA( thiz, IDirectFBGL ); /* Initialize interface data. */ - data->ref = 1; - data->surface = surface; + data->ref = 1; - surface->AddRef( surface ); - surface->GetPixelFormat( surface, &data->format ); - surface->GetSize( surface, &data->width, &data->height ); + /* Duplicate destination surface. */ + ret = surface->GetSubSurface( surface, NULL, &data->surface ); + if (ret) { + IDirectFBGL_Mesa_Destruct( thiz ); + return ret; + } + + data->surface->GetPixelFormat( data->surface, &data->format ); + data->surface->GetSize( data->surface, &data->width, &data->height ); /* Configure visual. */ if (!directfbgl_init_visual( &data->visual, data->format )) { @@ -319,11 +347,14 @@ Construct( IDirectFBGL *thiz, IDirectFBSurface *surface ) } /* Assign interface pointers. */ - thiz->AddRef = IDirectFBGL_Mesa_AddRef; - thiz->Release = IDirectFBGL_Mesa_Release; - thiz->Lock = IDirectFBGL_Mesa_Lock; - thiz->Unlock = IDirectFBGL_Mesa_Unlock; - thiz->GetAttributes = IDirectFBGL_Mesa_GetAttributes; + thiz->AddRef = IDirectFBGL_Mesa_AddRef; + thiz->Release = IDirectFBGL_Mesa_Release; + thiz->Lock = IDirectFBGL_Mesa_Lock; + thiz->Unlock = IDirectFBGL_Mesa_Unlock; + thiz->GetAttributes = IDirectFBGL_Mesa_GetAttributes; +#if DIRECTFBGL_INTERFACE_VERSION >= 1 + thiz->GetProcAddress = IDirectFBGL_Mesa_GetProcAddress; +#endif return DFB_OK; } @@ -363,71 +394,54 @@ dfbGetBufferSize( GLframebuffer *buffer, GLuint *width, GLuint *height ) static void dfbSetViewport( GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h ) { - GLuint newWidth, newHeight; - GLframebuffer *buffer = ctx->WinSysDrawBuffer; - dfbGetBufferSize( buffer, &newWidth, &newHeight ); - if (buffer->Width != newWidth || buffer->Height != newHeight) { - _mesa_resize_framebuffer(ctx, buffer, newWidth, newHeight ); - } + /* Nothing to do (the surface can't be resized while it's locked). */ + return; } static void dfbClear( GLcontext *ctx, GLbitfield mask ) { IDirectFBGL_data *data = (IDirectFBGL_data*) ctx->DriverCtx; - int x = ctx->DrawBuffer->_Xmin; - int y = ctx->DrawBuffer->_Ymin; - int width = ctx->DrawBuffer->_Xmax - x; - int height = ctx->DrawBuffer->_Ymax - y; - GLboolean all = (width == ctx->DrawBuffer->Width && height == ctx->DrawBuffer->height) - - if (mask & BUFFER_BIT_FRONT_LEFT && - ctx->Color.ColorMask[0] && - ctx->Color.ColorMask[1] && - ctx->Color.ColorMask[2] && + +#define BUFFER_BIT_MASK (BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_FRONT_RIGHT | \ + BUFFER_BIT_BACK_LEFT | BUFFER_BIT_BACK_RIGHT ) + if (mask & BUFFER_BIT_MASK && + ctx->Color.ColorMask[0] && + ctx->Color.ColorMask[1] && + ctx->Color.ColorMask[2] && ctx->Color.ColorMask[3]) { DFBRegion clip; - __u8 a, r, g, b; + GLubyte a, r, g, b; UNCLAMPED_FLOAT_TO_UBYTE( a, ctx->Color.ClearColor[ACOMP] ); UNCLAMPED_FLOAT_TO_UBYTE( r, ctx->Color.ClearColor[RCOMP] ); UNCLAMPED_FLOAT_TO_UBYTE( g, ctx->Color.ClearColor[GCOMP] ); UNCLAMPED_FLOAT_TO_UBYTE( b, ctx->Color.ClearColor[BCOMP] ); - data->surface->Unlock( data->surface ); - -#if DIRECTFB_VERSION_CODE >= VERSION_CODE(0,9,25) - data->surface->GetClip( data->surface, &clip ); -#else - (void)clip; -#endif + clip.x1 = ctx->DrawBuffer->_Xmin; + clip.y1 = ctx->DrawBuffer->_Ymin; + clip.x2 = ctx->DrawBuffer->_Xmax - 1; + clip.y2 = ctx->DrawBuffer->_Ymax - 1; + data->surface->SetClip( data->surface, &clip ); - if (all) { - data->surface->SetClip( data->surface, NULL ); - } - else { - DFBRegion reg = { x1:x, y1:y, x2:x+width-1, y2:y+height-1 }; - data->surface->SetClip( data->surface, ® ); - } + data->surface->Unlock( data->surface ); data->surface->Clear( data->surface, r, g, b, a ); - -#if DIRECTFB_VERSION_CODE >= VERSION_CODE(0,9,25) - data->surface->SetClip( data->surface, &clip ); -#endif data->surface->Lock( data->surface, DSLF_READ | DSLF_WRITE, (void*)&data->video.start, &data->video.pitch ); + data->video.end = data->video.start + (data->height-1) * data->video.pitch; + data->render.Data = data->video.start; - mask &= ~BUFFER_BIT_FRONT_LEFT; + mask &= ~BUFFER_BIT_MASK; } +#undef BUFFER_BIT_MASK if (mask) _swrast_Clear( ctx, mask ); -} - - +} + /************************ RenderBuffer functions *****************************/ @@ -790,6 +804,7 @@ directfbgl_create_context( GLcontext *context, data->render.GetRow = get_row_RGB332; data->render.GetValues = get_values_RGB332; data->render.PutRow = put_row_RGB332; + data->render.PutRowRGB = put_row_rgb_RGB332; data->render.PutMonoRow = put_mono_row_RGB332; data->render.PutValues = put_values_RGB332; data->render.PutMonoValues = put_mono_values_RGB332; @@ -798,6 +813,7 @@ directfbgl_create_context( GLcontext *context, data->render.GetRow = get_row_ARGB4444; data->render.GetValues = get_values_ARGB4444; data->render.PutRow = put_row_ARGB4444; + data->render.PutRowRGB = put_row_rgb_ARGB4444; data->render.PutMonoRow = put_mono_row_ARGB4444; data->render.PutValues = put_values_ARGB4444; data->render.PutMonoValues = put_mono_values_ARGB4444; @@ -806,6 +822,7 @@ directfbgl_create_context( GLcontext *context, data->render.GetRow = get_row_ARGB2554; data->render.GetValues = get_values_ARGB2554; data->render.PutRow = put_row_ARGB2554; + data->render.PutRowRGB = put_row_rgb_ARGB2554; data->render.PutMonoRow = put_mono_row_ARGB2554; data->render.PutValues = put_values_ARGB2554; data->render.PutMonoValues = put_mono_values_ARGB2554; @@ -814,6 +831,7 @@ directfbgl_create_context( GLcontext *context, data->render.GetRow = get_row_ARGB1555; data->render.GetValues = get_values_ARGB1555; data->render.PutRow = put_row_ARGB1555; + data->render.PutRowRGB = put_row_rgb_ARGB1555; data->render.PutMonoRow = put_mono_row_ARGB1555; data->render.PutValues = put_values_ARGB1555; data->render.PutMonoValues = put_mono_values_ARGB1555; @@ -822,6 +840,7 @@ directfbgl_create_context( GLcontext *context, data->render.GetRow = get_row_RGB16; data->render.GetValues = get_values_RGB16; data->render.PutRow = put_row_RGB16; + data->render.PutRowRGB = put_row_rgb_RGB16; data->render.PutMonoRow = put_mono_row_RGB16; data->render.PutValues = put_values_RGB16; data->render.PutMonoValues = put_mono_values_RGB16; @@ -830,6 +849,7 @@ directfbgl_create_context( GLcontext *context, data->render.GetRow = get_row_RGB24; data->render.GetValues = get_values_RGB24; data->render.PutRow = put_row_RGB24; + data->render.PutRowRGB = put_row_rgb_RGB24; data->render.PutMonoRow = put_mono_row_RGB24; data->render.PutValues = put_values_RGB24; data->render.PutMonoValues = put_mono_values_RGB24; @@ -838,6 +858,7 @@ directfbgl_create_context( GLcontext *context, data->render.GetRow = get_row_RGB32; data->render.GetValues = get_values_RGB32; data->render.PutRow = put_row_RGB32; + data->render.PutRowRGB = put_row_rgb_RGB32; data->render.PutMonoRow = put_mono_row_RGB32; data->render.PutValues = put_values_RGB32; data->render.PutMonoValues = put_mono_values_RGB32; @@ -846,6 +867,7 @@ directfbgl_create_context( GLcontext *context, data->render.GetRow = get_row_ARGB; data->render.GetValues = get_values_ARGB; data->render.PutRow = put_row_ARGB; + data->render.PutRowRGB = put_row_rgb_ARGB; data->render.PutMonoRow = put_mono_row_ARGB; data->render.PutValues = put_values_ARGB; data->render.PutMonoValues = put_mono_values_ARGB; @@ -854,6 +876,7 @@ directfbgl_create_context( GLcontext *context, data->render.GetRow = get_row_AiRGB; data->render.GetValues = get_values_AiRGB; data->render.PutRow = put_row_AiRGB; + data->render.PutRowRGB = put_row_rgb_AiRGB; data->render.PutMonoRow = put_mono_row_AiRGB; data->render.PutValues = put_values_AiRGB; data->render.PutMonoValues = put_mono_values_AiRGB; diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c index e7f07569f4e..ba251a81430 100644 --- a/src/mesa/drivers/dri/common/dri_util.c +++ b/src/mesa/drivers/dri/common/dri_util.c @@ -411,13 +411,18 @@ __driUtilUpdateDrawableInfo(__DRIdrawablePrivate *pdp) if (!pcp || ((pdp != pcp->driDrawablePriv) && (pdp != pcp->driReadablePriv))) { - /* ERROR!!! */ - return; + /* ERROR!!! + * ...but we must ignore it. There can be many contexts bound to a + * drawable. + */ } psp = pdp->driScreenPriv; if (!psp) { /* ERROR!!! */ + _mesa_problem("Warning! Possible infinite loop due to bug " + "in file %s, line %d\n", + __FILE__, __LINE__); return; } diff --git a/src/mesa/drivers/dri/i915/i830_metaops.c b/src/mesa/drivers/dri/i915/i830_metaops.c index dbf5f043498..c1d7fe349c0 100644 --- a/src/mesa/drivers/dri/i915/i830_metaops.c +++ b/src/mesa/drivers/dri/i915/i830_metaops.c @@ -50,7 +50,6 @@ #define SET_STATE( i830, STATE ) \ do { \ - assert(!i830->intel.prim.flush); \ i830->current->emitted = 0; \ i830->current = &i830->STATE; \ i830->current->emitted = 0; \ @@ -907,7 +906,6 @@ i830RotateWindow(intelContextPtr intel, __DRIdrawablePrivate *dPriv, } /* cliprect loop */ - assert(!intel->prim.flush); intelFlushBatchLocked( intel, GL_FALSE, GL_FALSE, GL_FALSE ); done: diff --git a/src/mesa/drivers/dri/i915tex/i830_state.c b/src/mesa/drivers/dri/i915tex/i830_state.c index c0673363f32..812daa65246 100644 --- a/src/mesa/drivers/dri/i915tex/i830_state.c +++ b/src/mesa/drivers/dri/i915tex/i830_state.c @@ -1042,6 +1042,7 @@ i830_init_packets(struct i830_context *i830) i830->state.Buffer[I830_DESTREG_DV0] = _3DSTATE_DST_BUF_VARS_CMD; +#if 0 switch (screen->fbFormat) { case DV_PF_565: i830->state.Buffer[I830_DESTREG_DV1] = (DSTORG_HORT_BIAS(0x8) | /* .5 */ @@ -1058,7 +1059,7 @@ i830_init_packets(struct i830_context *i830) DEPTH_FRMT_24_FIXED_8_OTHER); break; } - +#endif i830->state.Buffer[I830_DESTREG_SENABLE] = (_3DSTATE_SCISSOR_ENABLE_CMD | DISABLE_SCISSOR_RECT); i830->state.Buffer[I830_DESTREG_SR0] = _3DSTATE_SCISSOR_RECT_0_CMD; diff --git a/src/mesa/drivers/dri/i915tex/i830_texstate.c b/src/mesa/drivers/dri/i915tex/i830_texstate.c index ba79cf94599..e3f34e3944a 100644 --- a/src/mesa/drivers/dri/i915tex/i830_texstate.c +++ b/src/mesa/drivers/dri/i915tex/i830_texstate.c @@ -25,21 +25,13 @@ * **************************************************************************/ -#include "glheader.h" -#include "macros.h" #include "mtypes.h" -#include "simple_list.h" #include "enums.h" #include "texformat.h" -#include "texstore.h" +#include "dri_bufmgr.h" -#include "mm.h" - -#include "intel_screen.h" -#include "intel_ioctl.h" -#include "intel_tex.h" #include "intel_mipmap_tree.h" -#include "intel_regions.h" +#include "intel_tex.h" #include "i830_context.h" #include "i830_reg.h" @@ -129,6 +121,13 @@ i830_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) memset(state, 0, sizeof(state)); + /*We need to refcount these. */ + + if (i830->state.tex_buffer[unit] != NULL) { + driBOUnReference(i830->state.tex_buffer[unit]); + i830->state.tex_buffer[unit] = NULL; + } + if (!intel_finalize_mipmap_tree(intel, unit)) return GL_FALSE; @@ -137,7 +136,7 @@ i830_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) */ firstImage = tObj->Image[0][intelObj->firstLevel]; - i830->state.tex_buffer[unit] = intelObj->mt->region->buffer; + i830->state.tex_buffer[unit] = driBOReference(intelObj->mt->region->buffer); i830->state.tex_offset[unit] = intel_miptree_image_offset(intelObj->mt, 0, intelObj-> firstLevel); @@ -298,10 +297,17 @@ i830UpdateTextureState(struct intel_context *intel) case TEXTURE_RECT_BIT: ok = i830_update_tex_unit(intel, i, TEXCOORDS_ARE_IN_TEXELUNITS); break; - case 0: - if (i830->state.active & I830_UPLOAD_TEX(i)) + case 0:{ + struct i830_context *i830 = i830_context(&intel->ctx); + if (i830->state.active & I830_UPLOAD_TEX(i)) I830_ACTIVESTATE(i830, I830_UPLOAD_TEX(i), GL_FALSE); + + if (i830->state.tex_buffer[i] != NULL) { + driBOUnReference(i830->state.tex_buffer[i]); + i830->state.tex_buffer[i] = NULL; + } break; + } case TEXTURE_3D_BIT: default: ok = GL_FALSE; diff --git a/src/mesa/drivers/dri/i915tex/i830_vtbl.c b/src/mesa/drivers/dri/i915tex/i830_vtbl.c index 18fc6d4b91f..dd0670dec37 100644 --- a/src/mesa/drivers/dri/i915tex/i830_vtbl.c +++ b/src/mesa/drivers/dri/i915tex/i830_vtbl.c @@ -451,14 +451,16 @@ i830_emit_state(struct intel_context *intel) OUT_BATCH(state->Buffer[I830_DESTREG_CBUFADDR1]); OUT_RELOC(state->draw_region->buffer, DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_WRITE, - DRM_BO_MASK_MEM | DRM_BO_FLAG_WRITE, 0); + DRM_BO_MASK_MEM | DRM_BO_FLAG_WRITE, + state->draw_region->draw_offset); if (state->depth_region) { OUT_BATCH(state->Buffer[I830_DESTREG_DBUFADDR0]); OUT_BATCH(state->Buffer[I830_DESTREG_DBUFADDR1]); OUT_RELOC(state->depth_region->buffer, DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_WRITE, - DRM_BO_MASK_MEM | DRM_BO_FLAG_WRITE, 0); + DRM_BO_MASK_MEM | DRM_BO_FLAG_WRITE, + state->depth_region->draw_offset); } OUT_BATCH(state->Buffer[I830_DESTREG_DV0]); @@ -469,7 +471,7 @@ i830_emit_state(struct intel_context *intel) OUT_BATCH(state->Buffer[I830_DESTREG_SR2]); ADVANCE_BATCH(); } - + if (dirty & I830_UPLOAD_STIPPLE) { DBG("I830_UPLOAD_STIPPLE:\n"); emit(i830, state->Stipple, sizeof(state->Stipple)); diff --git a/src/mesa/drivers/dri/i915tex/server/i830_common.h b/src/mesa/drivers/dri/i915tex/server/i830_common.h index fb6ceaa52d4..06f28ed19a4 100644 --- a/src/mesa/drivers/dri/i915tex/server/i830_common.h +++ b/src/mesa/drivers/dri/i915tex/server/i830_common.h @@ -52,6 +52,8 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #define DRM_I830_INIT_HEAP 0x0a #define DRM_I830_CMDBUFFER 0x0b #define DRM_I830_DESTROY_HEAP 0x0c +#define DRM_I830_SET_VBLANK_PIPE 0x0d +#define DRM_I830_GET_VBLANK_PIPE 0x0e typedef struct { enum { @@ -208,5 +210,11 @@ typedef struct { int region; } drmI830MemDestroyHeap; +#define DRM_I830_VBLANK_PIPE_A 1 +#define DRM_I830_VBLANK_PIPE_B 2 + +typedef struct { + int pipe; +} drmI830VBlankPipe; #endif /* _I830_DRM_H_ */ diff --git a/src/mesa/drivers/dri/i915tex/server/i830_dri.h b/src/mesa/drivers/dri/i915tex/server/i830_dri.h index 6c9a7090215..c2a3af8cbf7 100644 --- a/src/mesa/drivers/dri/i915tex/server/i830_dri.h +++ b/src/mesa/drivers/dri/i915tex/server/i830_dri.h @@ -9,8 +9,8 @@ #define I830_MAX_DRAWABLES 256 #define I830_MAJOR_VERSION 1 -#define I830_MINOR_VERSION 3 -#define I830_PATCHLEVEL 0 +#define I830_MINOR_VERSION 7 +#define I830_PATCHLEVEL 2 #define I830_REG_SIZE 0x80000 @@ -18,20 +18,20 @@ typedef struct _I830DRIRec { drm_handle_t regs; drmSize regsSize; - drmSize backbufferSize; - drm_handle_t backbuffer; + drmSize unused1; /* backbufferSize */ + drm_handle_t unused2; /* backbuffer */ - drmSize depthbufferSize; - drm_handle_t depthbuffer; + drmSize unused3; /* depthbufferSize */ + drm_handle_t unused4; /* depthbuffer */ - drmSize rotatedSize; - drm_handle_t rotatedbuffer; + drmSize unused5; /* rotatedSize */ + drm_handle_t unused6; /* rotatedbuffer */ - drm_handle_t textures; - int textureSize; + drm_handle_t unused7; /* textures */ + int unused8; /* textureSize */ - drm_handle_t agp_buffers; - drmSize agp_buf_size; + drm_handle_t unused9; /* agp_buffers */ + drmSize unused10; /* agp_buf_size */ int deviceID; int width; @@ -40,20 +40,10 @@ typedef struct _I830DRIRec { int cpp; int bitsPerPixel; - int fbOffset; - int fbStride; - - int backOffset; - int backPitch; - - int depthOffset; - int depthPitch; - - int rotatedOffset; - int rotatedPitch; - - int logTextureGranularity; - int textureOffset; + int unused11[8]; /* was front/back/depth/rotated offset/pitch */ + + int unused12; /* logTextureGranularity */ + int unused13; /* textureOffset */ int irq; int sarea_priv_offset; diff --git a/src/mesa/drivers/dri/i915tex/server/intel.h b/src/mesa/drivers/dri/i915tex/server/intel.h index d7858a20c8d..6ea72499c1c 100644 --- a/src/mesa/drivers/dri/i915tex/server/intel.h +++ b/src/mesa/drivers/dri/i915tex/server/intel.h @@ -75,6 +75,9 @@ #define I830_GMCH_CTRL 0x52 +#define I830_GMCH_MEM_MASK 0x1 +#define I830_GMCH_MEM_64M 0x1 +#define I830_GMCH_MEM_128M 0 #define I830_GMCH_GMS_MASK 0x70 #define I830_GMCH_GMS_DISABLED 0x00 @@ -141,7 +144,7 @@ typedef struct _I830Rec { unsigned char *MMIOBase; unsigned char *FbBase; int cpp; - + uint32_t aper_size; unsigned int bios_version; /* These are set in PreInit and never changed. */ diff --git a/src/mesa/drivers/dri/i915tex/server/intel_dri.c b/src/mesa/drivers/dri/i915tex/server/intel_dri.c index 169fdbece30..4d1ac09f644 100644 --- a/src/mesa/drivers/dri/i915tex/server/intel_dri.c +++ b/src/mesa/drivers/dri/i915tex/server/intel_dri.c @@ -292,15 +292,43 @@ static void I830SetupMemoryTiling(const DRIDriverContext *ctx, I830Rec *pI830) static int I830DetectMemory(const DRIDriverContext *ctx, I830Rec *pI830) { - struct pci_device host_bridge; + struct pci_device host_bridge, ig_dev; uint32_t gmch_ctrl; int memsize = 0; int range; - + uint32_t aper_size; + uint32_t membase2 = 0; + memset(&host_bridge, 0, sizeof(host_bridge)); + memset(&ig_dev, 0, sizeof(ig_dev)); + + ig_dev.dev = 2; pci_device_cfg_read_u32(&host_bridge, &gmch_ctrl, I830_GMCH_CTRL); - + + if (IS_I830(pI830) || IS_845G(pI830)) { + if ((gmch_ctrl & I830_GMCH_MEM_MASK) == I830_GMCH_MEM_128M) { + aper_size = 0x80000000; + } else { + aper_size = 0x40000000; + } + } else { + if (IS_I9XX(pI830)) { + int ret; + ret = pci_device_cfg_read_u32(&ig_dev, &membase2, 0x18); + if (membase2 & 0x08000000) + aper_size = 0x8000000; + else + aper_size = 0x10000000; + + fprintf(stderr,"aper size is %08X %08x %d\n", aper_size, membase2, ret); + } else + aper_size = 0x8000000; + } + + pI830->aper_size = aper_size; + + /* We need to reduce the stolen size, by the GTT and the popup. * The GTT varying according the the FbMapSize and the popup is 4KB */ range = (ctx->shared.fbSize / (1024*1024)) + 4; @@ -576,7 +604,8 @@ I830AllocateMemory(const DRIDriverContext *ctx, I830Rec *pI830) fprintf(stderr,"unable to allocate context buffer %ld\n", ret); return FALSE; } - + +#if 0 memset(&(pI830->TexMem), 0, sizeof(pI830->TexMem)); pI830->TexMem.Key = -1; @@ -587,6 +616,7 @@ I830AllocateMemory(const DRIDriverContext *ctx, I830Rec *pI830) fprintf(stderr,"unable to allocate texture memory %ld\n", ret); return FALSE; } +#endif return TRUE; } @@ -604,12 +634,29 @@ I830BindMemory(const DRIDriverContext *ctx, I830Rec *pI830) return FALSE; if (!BindAgpRange(ctx, &pI830->ContextMem)) return FALSE; +#if 0 if (!BindAgpRange(ctx, &pI830->TexMem)) return FALSE; - +#endif return TRUE; } +static void SetupDRIMM(const DRIDriverContext *ctx, I830Rec *pI830) +{ + unsigned long aperEnd = ROUND_DOWN_TO(pI830->aper_size, GTT_PAGE_SIZE) / GTT_PAGE_SIZE; + unsigned long aperStart = ROUND_TO(pI830->aper_size - KB(32768), GTT_PAGE_SIZE) / GTT_PAGE_SIZE; + + fprintf(stderr, "aper size is %08X\n", ctx->shared.fbSize); + if (drmMMInit(ctx->drmFD, aperStart, aperEnd - aperStart, DRM_BO_MEM_TT)) { + fprintf(stderr, + "DRM MM Initialization Failed\n"); + } else { + fprintf(stderr, + "DRM MM Initialized at offset 0x%lx length %d page\n", aperStart, aperEnd-aperStart); + } + +} + static Bool I830CleanupDma(const DRIDriverContext *ctx) { @@ -809,6 +856,7 @@ I830DRIMapScreenRegions(DRIDriverContext *ctx, I830Rec *pI830, drmI830Sarea *sar fprintf(stderr, "[drm] Depth Buffer = 0x%08x\n", sarea->depth_handle); +#if 0 if (drmAddMap(ctx->drmFD, (drm_handle_t)sarea->tex_offset, sarea->tex_size, DRM_AGP, 0, @@ -819,7 +867,7 @@ I830DRIMapScreenRegions(DRIDriverContext *ctx, I830Rec *pI830, drmI830Sarea *sar } fprintf(stderr, "[drm] textures = 0x%08x\n", sarea->tex_handle); - +#endif return TRUE; } @@ -847,6 +895,7 @@ I830DRIUnmapScreenRegions(const DRIDriverContext *ctx, I830Rec *pI830, drmI830Sa } } +#if 0 static void I830InitTextureHeap(const DRIDriverContext *ctx, I830Rec *pI830, drmI830Sarea *sarea) { @@ -869,6 +918,7 @@ I830InitTextureHeap(const DRIDriverContext *ctx, I830Rec *pI830, drmI830Sarea *s sarea->log_tex_granularity); } } +#endif static Bool I830DRIDoMappings(DRIDriverContext *ctx, I830Rec *pI830, drmI830Sarea *sarea) @@ -891,8 +941,11 @@ I830DRIDoMappings(DRIDriverContext *ctx, I830Rec *pI830, drmI830Sarea *sarea) /* init to zero to be safe */ I830DRIMapScreenRegions(ctx, pI830, sarea); - I830InitTextureHeap(ctx, pI830, sarea); + SetupDRIMM(ctx, pI830); +#if 0 + I830InitTextureHeap(ctx, pI830, sarea); +#endif if (ctx->pciDevice != PCI_CHIP_845_G && ctx->pciDevice != PCI_CHIP_I830_M) { I830SetParam(ctx, I830_SETPARAM_USE_MI_BATCHBUFFER_START, 1 ); @@ -1083,6 +1136,10 @@ I830ScreenInit(DRIDriverContext *ctx, I830Rec *pI830) return FALSE; } + pSAREAPriv->rotated_offset = -1; + pSAREAPriv->rotated_size = 0; + pSAREAPriv->rotated_pitch = ctx->shared.virtualWidth; + pSAREAPriv->front_offset = pI830->FrontBuffer.Start; pSAREAPriv->front_size = pI830->FrontBuffer.Size; pSAREAPriv->width = ctx->shared.virtualWidth; @@ -1094,8 +1151,10 @@ I830ScreenInit(DRIDriverContext *ctx, I830Rec *pI830) pSAREAPriv->back_size = pI830->BackBuffer.Size; pSAREAPriv->depth_offset = pI830->DepthBuffer.Start; pSAREAPriv->depth_size = pI830->DepthBuffer.Size; +#if 0 pSAREAPriv->tex_offset = pI830->TexMem.Start; pSAREAPriv->tex_size = pI830->TexMem.Size; +#endif pSAREAPriv->log_tex_granularity = pI830->TexGranularity; ctx->driverClientMsg = malloc(sizeof(I830DRIRec)); @@ -1107,14 +1166,6 @@ I830ScreenInit(DRIDriverContext *ctx, I830Rec *pI830) pI830DRI->height = ctx->shared.virtualHeight; pI830DRI->mem = ctx->shared.fbSize; pI830DRI->cpp = ctx->cpp; - pI830DRI->backOffset = pI830->BackBuffer.Start; - pI830DRI->backPitch = pI830->BackBuffer.Pitch; - - pI830DRI->depthOffset = pI830->DepthBuffer.Start; - pI830DRI->depthPitch = pI830->DepthBuffer.Pitch; - - pI830DRI->fbOffset = pI830->FrontBuffer.Start; - pI830DRI->fbStride = pI830->FrontBuffer.Pitch; pI830DRI->bitsPerPixel = ctx->bpp; pI830DRI->sarea_priv_offset = sizeof(drm_sarea_t); diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c index c1f6617f3fd..bc422c1a50b 100644 --- a/src/mesa/drivers/dri/i965/brw_context.c +++ b/src/mesa/drivers/dri/i965/brw_context.c @@ -156,6 +156,8 @@ GLboolean brwCreateContext( const __GLcontextModes *mesaVis, brw_ProgramCacheInit( ctx ); + brw_FrameBufferTexInit( brw ); + /* Hook our functions into exec and compile dispatch tables. Only * fallback on out-of-memory situations. */ diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h index 1137bfd2c76..a57c794834f 100644 --- a/src/mesa/drivers/dri/i965/brw_context.h +++ b/src/mesa/drivers/dri/i965/brw_context.h @@ -485,7 +485,7 @@ struct brw_context */ struct brw_state_pointers attribs; struct gl_vertex_program *vp; - struct gl_fragment_program *fp; + struct gl_fragment_program *fp, *fp_tex; struct gl_buffer_object *vbo; @@ -493,6 +493,8 @@ struct brw_context struct intel_region *saved_depth_region; GLuint restore_draw_mask; + struct gl_fragment_program *restore_fp; + GLboolean active; } metaops; @@ -672,6 +674,8 @@ void brw_destroy_state( struct brw_context *brw ); */ void brwUpdateTextureState( struct intel_context *intel ); void brwInitTextureFuncs( struct dd_function_table *functions ); +void brw_FrameBufferTexInit( struct brw_context *brw ); +void brw_FrameBufferTexDestroy( struct brw_context *brw ); /*====================================================================== * brw_metaops.c diff --git a/src/mesa/drivers/dri/i965/brw_fallback.c b/src/mesa/drivers/dri/i965/brw_fallback.c index 4d84ba88137..56e21e339ef 100644 --- a/src/mesa/drivers/dri/i965/brw_fallback.c +++ b/src/mesa/drivers/dri/i965/brw_fallback.c @@ -280,6 +280,9 @@ void brw_loopback_vertex_list( GLcontext *ctx, GLuint i, nr = 0; for (i = 0 ; i <= BRW_ATTRIB_TEX7 ; i++) { + if (i == BRW_ATTRIB_INDEX || i == BRW_ATTRIB_EDGEFLAG) + continue; + if (attrsz[i]) { la[nr].target = i; la[nr].sz = attrsz[i]; diff --git a/src/mesa/drivers/dri/i965/brw_metaops.c b/src/mesa/drivers/dri/i965/brw_metaops.c index 18ca7b13412..2deec5eae3d 100644 --- a/src/mesa/drivers/dri/i965/brw_metaops.c +++ b/src/mesa/drivers/dri/i965/brw_metaops.c @@ -27,6 +27,7 @@ /* * Authors: * Keith Whitwell + * frame buffer texture by Gary Wong */ @@ -144,6 +145,15 @@ static const char *fp_prog = "MOV result.color, fragment.color;\n" "END\n"; +static const char *fp_tex_prog = + "!!ARBfp1.0\n" + "TEMP a;\n" + "ADD a, fragment.position, program.local[0];\n" + "MUL a, a, program.local[1];\n" + "TEX result.color, a, texture[0], 2D;\n" + "MOV result.depth.z, fragment.position;\n" + "END\n"; + /* Derived values of importance: * * FragmentProgram->_Current @@ -170,6 +180,9 @@ static void init_metaops_state( struct brw_context *brw ) brw->metaops.fp = (struct gl_fragment_program *) ctx->Driver.NewProgram(ctx, GL_FRAGMENT_PROGRAM_ARB, 1 ); + brw->metaops.fp_tex = (struct gl_fragment_program *) + ctx->Driver.NewProgram(ctx, GL_FRAGMENT_PROGRAM_ARB, 1 ); + brw->metaops.vp = (struct gl_vertex_program *) ctx->Driver.NewProgram(ctx, GL_VERTEX_PROGRAM_ARB, 1 ); @@ -177,6 +190,10 @@ static void init_metaops_state( struct brw_context *brw ) fp_prog, strlen(fp_prog), brw->metaops.fp); + _mesa_parse_arb_fragment_program(ctx, GL_FRAGMENT_PROGRAM_ARB, + fp_tex_prog, strlen(fp_tex_prog), + brw->metaops.fp_tex); + _mesa_parse_arb_vertex_program(ctx, GL_VERTEX_PROGRAM_ARB, vp_prog, strlen(vp_prog), brw->metaops.vp); @@ -267,7 +284,76 @@ static void meta_color_mask( struct intel_context *intel, GLboolean state ) static void meta_no_texture( struct intel_context *intel ) { - /* Nothing to do */ + struct brw_context *brw = brw_context(&intel->ctx); + + brw->metaops.attribs.FragmentProgram->_Current = brw->metaops.fp; + + brw->metaops.attribs.Texture->CurrentUnit = 0; + brw->metaops.attribs.Texture->_EnabledUnits = 0; + brw->metaops.attribs.Texture->_EnabledCoordUnits = 0; + brw->metaops.attribs.Texture->Unit[ 0 ].Enabled = 0; + brw->metaops.attribs.Texture->Unit[ 0 ]._ReallyEnabled = 0; + + brw->state.dirty.mesa |= _NEW_TEXTURE | _NEW_PROGRAM; +} + +static void meta_texture_blend_replace(struct intel_context *intel) +{ + struct brw_context *brw = brw_context(&intel->ctx); + + brw->metaops.attribs.Texture->CurrentUnit = 0; + brw->metaops.attribs.Texture->_EnabledUnits = 1; + brw->metaops.attribs.Texture->_EnabledCoordUnits = 1; + brw->metaops.attribs.Texture->Unit[ 0 ].Enabled = TEXTURE_2D_BIT; + brw->metaops.attribs.Texture->Unit[ 0 ]._ReallyEnabled = TEXTURE_2D_BIT; + brw->metaops.attribs.Texture->Unit[ 0 ].Current2D = + intel->frame_buffer_texobj; + brw->metaops.attribs.Texture->Unit[ 0 ]._Current = + intel->frame_buffer_texobj; + + brw->state.dirty.mesa |= _NEW_TEXTURE | _NEW_PROGRAM; +} + +static void meta_import_pixel_state(struct intel_context *intel) +{ + struct brw_context *brw = brw_context(&intel->ctx); + + RESTORE(brw, Color, _NEW_COLOR); + RESTORE(brw, Depth, _NEW_DEPTH); + RESTORE(brw, Fog, _NEW_FOG); + RESTORE(brw, Scissor, _NEW_SCISSOR); + RESTORE(brw, Stencil, _NEW_STENCIL); + RESTORE(brw, Texture, _NEW_TEXTURE); + RESTORE(brw, FragmentProgram, _NEW_PROGRAM); +} + +static void meta_frame_buffer_texture( struct intel_context *intel, + GLint xoff, GLint yoff ) +{ + struct brw_context *brw = brw_context(&intel->ctx); + struct intel_region *region = intel_drawbuf_region( intel ); + + INSTALL(brw, FragmentProgram, _NEW_PROGRAM); + + brw->metaops.attribs.FragmentProgram->_Current = brw->metaops.fp_tex; + /* This is unfortunate, but seems to be necessary, since later on we + will end up calling _mesa_load_state_parameters to lookup the + local params (below), and that will want to look in ctx.FragmentProgram + instead of brw->attribs.FragmentProgram. */ + intel->ctx.FragmentProgram.Current = brw->metaops.fp_tex; + + brw->metaops.fp_tex->Base.LocalParams[ 0 ][ 0 ] = xoff; + brw->metaops.fp_tex->Base.LocalParams[ 0 ][ 1 ] = yoff; + brw->metaops.fp_tex->Base.LocalParams[ 0 ][ 2 ] = 0.0; + brw->metaops.fp_tex->Base.LocalParams[ 0 ][ 3 ] = 0.0; + brw->metaops.fp_tex->Base.LocalParams[ 1 ][ 0 ] = + 1.0 / region->pitch; + brw->metaops.fp_tex->Base.LocalParams[ 1 ][ 1 ] = + -1.0 / region->height; + brw->metaops.fp_tex->Base.LocalParams[ 1 ][ 2 ] = 0.0; + brw->metaops.fp_tex->Base.LocalParams[ 1 ][ 3 ] = 1.0; + + brw->state.dirty.mesa |= _NEW_PROGRAM; } @@ -406,7 +492,8 @@ static void meta_draw_quad(struct intel_context *intel, } -static void install_meta_state( struct intel_context *intel ) +static void install_meta_state( struct intel_context *intel, + GLenum state ) { GLcontext *ctx = &intel->ctx; struct brw_context *brw = brw_context(ctx); @@ -416,9 +503,11 @@ static void install_meta_state( struct intel_context *intel ) } install_attribs(brw); + meta_no_texture(&brw->intel); meta_flat_shade(&brw->intel); brw->metaops.restore_draw_mask = ctx->DrawBuffer->_ColorDrawBufferMask[0]; + brw->metaops.restore_fp = ctx->FragmentProgram.Current; /* This works without adjusting refcounts. Fix later? */ @@ -437,6 +526,7 @@ static void leave_meta_state( struct intel_context *intel ) restore_attribs(brw); ctx->DrawBuffer->_ColorDrawBufferMask[0] = brw->metaops.restore_draw_mask; + ctx->FragmentProgram.Current = brw->metaops.restore_fp; brw->state.draw_region = brw->metaops.saved_draw_region; brw->state.depth_region = brw->metaops.saved_depth_region; @@ -463,10 +553,11 @@ void brw_init_metaops( struct brw_context *brw ) brw->intel.vtbl.meta_depth_replace = meta_depth_replace; brw->intel.vtbl.meta_color_mask = meta_color_mask; brw->intel.vtbl.meta_no_texture = meta_no_texture; + brw->intel.vtbl.meta_import_pixel_state = meta_import_pixel_state; + brw->intel.vtbl.meta_frame_buffer_texture = meta_frame_buffer_texture; brw->intel.vtbl.meta_draw_region = meta_draw_region; brw->intel.vtbl.meta_draw_quad = meta_draw_quad; - -/* brw->intel.vtbl.meta_texture_blend_replace = meta_texture_blend_replace; */ + brw->intel.vtbl.meta_texture_blend_replace = meta_texture_blend_replace; /* brw->intel.vtbl.meta_tex_rect_source = meta_tex_rect_source; */ /* brw->intel.vtbl.meta_draw_format = set_draw_format; */ } @@ -479,5 +570,6 @@ void brw_destroy_metaops( struct brw_context *brw ) ctx->Driver.DeleteBuffer( ctx, brw->metaops.vbo ); /* ctx->Driver.DeleteProgram( ctx, brw->metaops.fp ); */ +/* ctx->Driver.DeleteProgram( ctx, brw->metaops.fp_tex ); */ /* ctx->Driver.DeleteProgram( ctx, brw->metaops.vp ); */ } diff --git a/src/mesa/drivers/dri/i965/brw_tex.c b/src/mesa/drivers/dri/i965/brw_tex.c index 8332d869e1d..c3ffa9e6577 100644 --- a/src/mesa/drivers/dri/i965/brw_tex.c +++ b/src/mesa/drivers/dri/i965/brw_tex.c @@ -36,11 +36,14 @@ #include "simple_list.h" #include "enums.h" #include "image.h" +#include "teximage.h" #include "texstore.h" #include "texformat.h" #include "texmem.h" +#include "intel_context.h" #include "intel_ioctl.h" +#include "intel_regions.h" #include "brw_context.h" #include "brw_defines.h" @@ -179,3 +182,32 @@ void brwInitTextureFuncs( struct dd_function_table *functions ) { functions->ChooseTextureFormat = brwChooseTextureFormat; } + +void brw_FrameBufferTexInit( struct brw_context *brw ) +{ + struct intel_context *intel = &brw->intel; + GLcontext *ctx = &intel->ctx; + struct intel_region *region = intel->front_region; + struct gl_texture_object *obj; + struct gl_texture_image *img; + + intel->frame_buffer_texobj = obj = + ctx->Driver.NewTextureObject( ctx, (GLuint) -1, GL_TEXTURE_2D ); + + obj->MinFilter = GL_NEAREST; + obj->MagFilter = GL_NEAREST; + + img = ctx->Driver.NewTextureImage( ctx ); + + _mesa_init_teximage_fields( ctx, GL_TEXTURE_2D, img, + region->pitch, region->height, 1, 0, + region->cpp == 4 ? GL_RGBA : GL_RGB ); + + _mesa_set_tex_image( obj, GL_TEXTURE_2D, 0, img ); +} + +void brw_FrameBufferTexDestroy( struct brw_context *brw ) +{ + brw->intel.ctx.Driver.DeleteTexture( &brw->intel.ctx, + brw->intel.frame_buffer_texobj ); +} diff --git a/src/mesa/drivers/dri/i965/brw_vtbl.c b/src/mesa/drivers/dri/i965/brw_vtbl.c index 4896882034b..ac09754e3ae 100644 --- a/src/mesa/drivers/dri/i965/brw_vtbl.c +++ b/src/mesa/drivers/dri/i965/brw_vtbl.c @@ -72,6 +72,7 @@ static void brw_destroy_context( struct intel_context *intel ) brw_save_destroy( ctx ); brw_ProgramCacheDestroy( ctx ); + brw_FrameBufferTexDestroy( brw ); } /* called from intelDrawBuffer() diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c index 5c7dc500cab..d24c618a668 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c @@ -239,6 +239,12 @@ static void upload_wm_surfaces(struct brw_context *brw ) brw->wm.bind.surf_ss_offset[i+1] = brw_cache_data( &brw->cache[BRW_SS_SURFACE], &surf ); brw->wm.nr_surfaces = i+2; } + else if( texUnit->_ReallyEnabled && + texUnit->_Current == intel->frame_buffer_texobj ) + { + brw->wm.bind.surf_ss_offset[i+1] = brw->wm.bind.surf_ss_offset[0]; + brw->wm.nr_surfaces = i+2; + } else { brw->wm.bind.surf_ss_offset[i+1] = 0; } diff --git a/src/mesa/drivers/dri/i965/intel_context.c b/src/mesa/drivers/dri/i965/intel_context.c index 36edd7db7f5..d13e287fa76 100644 --- a/src/mesa/drivers/dri/i965/intel_context.c +++ b/src/mesa/drivers/dri/i965/intel_context.c @@ -320,6 +320,11 @@ GLboolean intelInitContext( struct intel_context *intel, ctx->Const.MaxPointSizeAA = 3.0; ctx->Const.PointSizeGranularity = 1.0; + /* reinitialize the context point state. + * It depend on constants in __GLcontextRec::Const + */ + _mesa_init_point(ctx); + /* Initialize the software rasterizer and helper modules. */ _swrast_CreateContext( ctx ); _ac_CreateContext( ctx ); diff --git a/src/mesa/drivers/dri/i965/intel_context.h b/src/mesa/drivers/dri/i965/intel_context.h index 2df8faef28e..8367a957109 100644 --- a/src/mesa/drivers/dri/i965/intel_context.h +++ b/src/mesa/drivers/dri/i965/intel_context.h @@ -86,7 +86,6 @@ struct intel_texture_object - struct intel_context { GLcontext ctx; /* the parent class */ @@ -148,9 +147,14 @@ struct intel_context void (*meta_depth_replace)( struct intel_context *intel ); + void (*meta_texture_blend_replace) (struct intel_context * intel); + void (*meta_no_stencil_write)( struct intel_context *intel ); void (*meta_no_depth_write)( struct intel_context *intel ); void (*meta_no_texture)( struct intel_context *intel ); + void (*meta_import_pixel_state) (struct intel_context * intel); + void (*meta_frame_buffer_texture)( struct intel_context *intel, + GLint xoff, GLint yoff ); void (*meta_draw_quad)(struct intel_context *intel, GLfloat x0, GLfloat x1, @@ -218,6 +222,7 @@ struct intel_context int drawY; GLuint numClipRects; /* cliprects for that buffer */ drm_clip_rect_t *pClipRects; + struct gl_texture_object *frame_buffer_texobj; GLboolean scissor; drm_clip_rect_t draw_rect; diff --git a/src/mesa/drivers/dri/i965/intel_pixel_copy.c b/src/mesa/drivers/dri/i965/intel_pixel_copy.c index 55b58a8f670..58dc49505fe 100644 --- a/src/mesa/drivers/dri/i965/intel_pixel_copy.c +++ b/src/mesa/drivers/dri/i965/intel_pixel_copy.c @@ -80,8 +80,6 @@ intel_check_blit_fragment_ops(GLcontext * ctx) if (ctx->NewState) _mesa_update_state(ctx); - /* Could do logicop with the blitter: - */ return !(ctx->_ImageTransferState || ctx->RenderMode != GL_RENDER || ctx->Color.AlphaEnabled || @@ -97,7 +95,107 @@ intel_check_blit_fragment_ops(GLcontext * ctx) ctx->Color.BlendEnabled); } +/* Doesn't work for overlapping regions. Could do a double copy or + * just fallback. + */ +static GLboolean +do_texture_copypixels(GLcontext * ctx, + GLint srcx, GLint srcy, + GLsizei width, GLsizei height, + GLint dstx, GLint dsty, GLenum type) +{ + struct intel_context *intel = intel_context(ctx); + struct intel_region *dst = intel_drawbuf_region(intel); + struct intel_region *src = copypix_src_region(intel, type); + GLenum src_format; + GLenum src_type; + + DBG("%s %d,%d %dx%d --> %d,%d\n", __FUNCTION__, + srcx, srcy, width, height, dstx, dsty); + + if (!src || !dst || type != GL_COLOR || + ctx->_ImageTransferState || + ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F || + ctx->RenderMode != GL_RENDER || + ctx->Texture._EnabledUnits || + ctx->FragmentProgram._Enabled || + src != dst ) + return GL_FALSE; + + /* Can't handle overlapping regions. Don't have sufficient control + * over rasterization to pull it off in-place. Punt on these for + * now. + * + * XXX: do a copy to a temporary. + */ + if (src->buffer == dst->buffer) { + drm_clip_rect_t srcbox; + drm_clip_rect_t dstbox; + drm_clip_rect_t tmp; + + srcbox.x1 = srcx; + srcbox.y1 = srcy; + srcbox.x2 = srcx + width - 1; + srcbox.y2 = srcy + height - 1; + + dstbox.x1 = dstx; + dstbox.y1 = dsty; + dstbox.x2 = dstx + width - 1; + dstbox.y2 = dsty + height - 1; + + DBG("src %d,%d %d,%d\n", srcbox.x1, srcbox.y1, srcbox.x2, srcbox.y2); + DBG("dst %d,%d %d,%d (%dx%d) (%f,%f)\n", dstbox.x1, dstbox.y1, dstbox.x2, dstbox.y2, + width, height, ctx->Pixel.ZoomX, ctx->Pixel.ZoomY); + + if (intel_intersect_cliprects(&tmp, &srcbox, &dstbox)) { + DBG("%s: regions overlap\n", __FUNCTION__); + return GL_FALSE; + } + } + intelFlush(&intel->ctx); + + intel->vtbl.install_meta_state(intel); + + /* Is this true? Also will need to turn depth testing on according + * to state: + */ + intel->vtbl.meta_no_stencil_write(intel); + intel->vtbl.meta_no_depth_write(intel); + + /* Set the 3d engine to draw into the destination region: + */ + intel->vtbl.meta_draw_region(intel, dst, intel->depth_region); + + intel->vtbl.meta_import_pixel_state(intel); + + if (src->cpp == 2) { + src_format = GL_RGB; + src_type = GL_UNSIGNED_SHORT_5_6_5; + } + else { + src_format = GL_BGRA; + src_type = GL_UNSIGNED_BYTE; + } + + /* Set the frontbuffer up as a large rectangular texture. + */ + intel->vtbl.meta_frame_buffer_texture( intel, srcx - dstx, srcy - dsty ); + + intel->vtbl.meta_texture_blend_replace(intel); + + if (intel->driDrawable->numClipRects) + intel->vtbl.meta_draw_quad( intel, + dstx, dstx + width, + dsty, dsty + height, + ctx->Current.RasterPos[ 2 ], + 0, 0, 0, 0, 0.0, 0.0, 0.0, 0.0 ); + + intel->vtbl.leave_meta_state( intel ); + + DBG("%s: success\n", __FUNCTION__); + return GL_TRUE; +} /** * CopyPixels with the blitter. Don't support zooming, pixel transfer, etc. @@ -235,6 +333,9 @@ intelCopyPixels(GLcontext * ctx, if (do_blit_copypixels(ctx, srcx, srcy, width, height, destx, desty, type)) return; + if (do_texture_copypixels(ctx, srcx, srcy, width, height, destx, desty, type)) + return; + if (INTEL_DEBUG & DEBUG_PIXEL) _mesa_printf("fallback to _swrast_CopyPixels\n"); diff --git a/src/mesa/drivers/dri/i965/intel_tex_validate.c b/src/mesa/drivers/dri/i965/intel_tex_validate.c index 91ae0970a04..cb23b9dd879 100644 --- a/src/mesa/drivers/dri/i965/intel_tex_validate.c +++ b/src/mesa/drivers/dri/i965/intel_tex_validate.c @@ -133,6 +133,9 @@ GLuint intel_finalize_mipmap_tree( struct intel_context *intel, GLuint nr_faces = 0; struct gl_texture_image *firstImage; + if( tObj == intel->frame_buffer_texobj ) + return GL_FALSE; + /* We know/require this is true by now: */ assert(intelObj->base.Complete); diff --git a/src/mesa/drivers/dri/mga/mgatex.c b/src/mesa/drivers/dri/mga/mgatex.c index 8caa1f8580f..a7d74317a5b 100644 --- a/src/mesa/drivers/dri/mga/mgatex.c +++ b/src/mesa/drivers/dri/mga/mgatex.c @@ -502,6 +502,9 @@ mgaDeleteTexture( GLcontext *ctx, struct gl_texture_object *tObj ) driDestroyTextureObject( t ); } + + /* Free mipmap images and the texture object itself */ + _mesa_delete_texture_object(ctx, tObj); } diff --git a/src/mesa/drivers/dri/r200/r200_context.h b/src/mesa/drivers/dri/r200/r200_context.h index 9f109e07ff5..fa38a78e263 100644 --- a/src/mesa/drivers/dri/r200/r200_context.h +++ b/src/mesa/drivers/dri/r200/r200_context.h @@ -107,6 +107,8 @@ struct r200_vertex_program { VERTEX_SHADER_INSTRUCTION instr[R200_VSF_MAX_INST + 6]; int pos_end; int inputs[VERT_ATTRIB_MAX]; + int rev_inputs[16]; + int gen_inputs_mapped; int native; int fogpidx; int fogmode; diff --git a/src/mesa/drivers/dri/r200/r200_maos_arrays.c b/src/mesa/drivers/dri/r200/r200_maos_arrays.c index f6ab2f00746..39c1f68911f 100644 --- a/src/mesa/drivers/dri/r200/r200_maos_arrays.c +++ b/src/mesa/drivers/dri/r200/r200_maos_arrays.c @@ -385,6 +385,14 @@ void r200EmitArrays( GLcontext *ctx, GLuint inputs ) GLuint vfmt0 = 0, vfmt1 = 0; GLuint count = VB->Count; GLuint i; + GLuint generic_in_mapped = 0; + struct r200_vertex_program *vp = NULL; + + /* this looks way more complicated than necessary... */ + if (ctx->VertexProgram._Enabled) { + vp = rmesa->curr_vp_hw; + generic_in_mapped = vp->gen_inputs_mapped; + } if (inputs & VERT_BIT_POS) { if (!rmesa->tcl.obj.buf) @@ -404,6 +412,19 @@ void r200EmitArrays( GLcontext *ctx, GLuint inputs ) } component[nr++] = &rmesa->tcl.obj; } + else if (generic_in_mapped & (1 << 0)) { + int geninput = vp->rev_inputs[0] - VERT_ATTRIB_GENERIC0; + if (!rmesa->tcl.generic[geninput].buf) { + emit_vector( ctx, + &(rmesa->tcl.generic[geninput]), + (char *)VB->AttribPtr[geninput + VERT_ATTRIB_GENERIC0]->data, + 4, + VB->AttribPtr[geninput + VERT_ATTRIB_GENERIC0]->stride, + count ); + } + component[nr++] = &rmesa->tcl.generic[geninput]; + vfmt0 |= R200_VTX_W0 | R200_VTX_Z0; + } if (inputs & VERT_BIT_NORMAL) { if (!rmesa->tcl.norm.buf) @@ -463,6 +484,23 @@ void r200EmitArrays( GLcontext *ctx, GLuint inputs ) component[nr++] = &rmesa->tcl.rgba; } +/* vfmt0 |= R200_VTX_PK_RGBA << R200_VTX_COLOR_0_SHIFT; + emit_ubyte_rgba( ctx, &rmesa->tcl.rgba, + (char *)VB->ColorPtr[0]->data, 4, + VB->ColorPtr[0]->stride, count);*/ + else if (generic_in_mapped & (1 << 2)) { + int geninput = vp->rev_inputs[2] - VERT_ATTRIB_GENERIC0; + if (!rmesa->tcl.generic[geninput].buf) { + emit_vector( ctx, + &(rmesa->tcl.generic[geninput]), + (char *)VB->AttribPtr[geninput + VERT_ATTRIB_GENERIC0]->data, + 4, + VB->AttribPtr[geninput + VERT_ATTRIB_GENERIC0]->stride, + count ); + } + component[nr++] = &rmesa->tcl.generic[geninput]; + vfmt0 |= R200_VTX_FP_RGBA << R200_VTX_COLOR_0_SHIFT; + } if (inputs & VERT_BIT_COLOR1) { @@ -480,8 +518,49 @@ void r200EmitArrays( GLcontext *ctx, GLuint inputs ) vfmt0 |= R200_VTX_FP_RGB << R200_VTX_COLOR_1_SHIFT; component[nr++] = &rmesa->tcl.spec; } + else if (generic_in_mapped & (1 << 3)) { + int geninput = vp->rev_inputs[3] - VERT_ATTRIB_GENERIC0; + if (!rmesa->tcl.generic[geninput].buf) { + emit_vector( ctx, + &(rmesa->tcl.generic[geninput]), + (char *)VB->AttribPtr[geninput + VERT_ATTRIB_GENERIC0]->data, + 4, + VB->AttribPtr[geninput + VERT_ATTRIB_GENERIC0]->stride, + count ); + } + component[nr++] = &rmesa->tcl.generic[geninput]; + vfmt0 |= R200_VTX_FP_RGBA << R200_VTX_COLOR_1_SHIFT; + } - for ( i = 0 ; i < ctx->Const.MaxTextureUnits ; i++ ) { + if (generic_in_mapped & (1 << 4)) { + int geninput = vp->rev_inputs[4] - VERT_ATTRIB_GENERIC0; + if (!rmesa->tcl.generic[geninput].buf) { + emit_vector( ctx, + &(rmesa->tcl.generic[geninput]), + (char *)VB->AttribPtr[geninput + VERT_ATTRIB_GENERIC0]->data, + 4, + VB->AttribPtr[geninput + VERT_ATTRIB_GENERIC0]->stride, + count ); + } + component[nr++] = &rmesa->tcl.generic[geninput]; + vfmt0 |= R200_VTX_FP_RGBA << R200_VTX_COLOR_2_SHIFT; + } + + if (generic_in_mapped & (1 << 5)) { + int geninput = vp->rev_inputs[5] - VERT_ATTRIB_GENERIC0; + if (!rmesa->tcl.generic[geninput].buf) { + emit_vector( ctx, + &(rmesa->tcl.generic[geninput]), + (char *)VB->AttribPtr[geninput + VERT_ATTRIB_GENERIC0]->data, + 4, + VB->AttribPtr[geninput + VERT_ATTRIB_GENERIC0]->stride, + count ); + } + component[nr++] = &rmesa->tcl.generic[geninput]; + vfmt0 |= R200_VTX_FP_RGBA << R200_VTX_COLOR_3_SHIFT; + } + + for ( i = 0 ; i < 6 ; i++ ) { if (inputs & (VERT_BIT_TEX0 << i)) { if (!rmesa->tcl.tex[i].buf) emit_vector( ctx, @@ -494,8 +573,37 @@ void r200EmitArrays( GLcontext *ctx, GLuint inputs ) vfmt1 |= VB->TexCoordPtr[i]->size << (i * 3); component[nr++] = &rmesa->tcl.tex[i]; } + else if (generic_in_mapped & (1 << (i + 6))) { + int geninput = vp->rev_inputs[i + 6] - VERT_ATTRIB_GENERIC0; + if (!rmesa->tcl.generic[geninput].buf) { + emit_vector( ctx, + &(rmesa->tcl.generic[geninput]), + (char *)VB->AttribPtr[geninput + VERT_ATTRIB_GENERIC0]->data, + 4, + VB->AttribPtr[geninput + VERT_ATTRIB_GENERIC0]->stride, + count ); + } + component[nr++] = &rmesa->tcl.generic[geninput]; + vfmt1 |= 4 << (R200_VTX_TEX0_COMP_CNT_SHIFT + (i * 3)); + } } + if (generic_in_mapped & (1 << 13)) { + int geninput = vp->rev_inputs[13] - VERT_ATTRIB_GENERIC0; + if (!rmesa->tcl.generic[geninput].buf) { + emit_vector( ctx, + &(rmesa->tcl.generic[geninput]), + (char *)VB->AttribPtr[geninput + VERT_ATTRIB_GENERIC0]->data, + 4, + VB->AttribPtr[geninput + VERT_ATTRIB_GENERIC0]->stride, + count ); + } + component[nr++] = &rmesa->tcl.generic[geninput]; + vfmt0 |= R200_VTX_XY1 | R200_VTX_Z1 | R200_VTX_W1; + } + +/* doesn't work. Wrong order with mixed generic & conventional! */ +/* if (ctx->VertexProgram._Enabled) { int *vp_inputs = rmesa->curr_vp_hw->inputs; for ( i = VERT_ATTRIB_GENERIC0; i < VERT_ATTRIB_MAX; i++ ) { @@ -539,6 +647,7 @@ void r200EmitArrays( GLcontext *ctx, GLuint inputs ) } } } +*/ if (vfmt0 != rmesa->hw.vtx.cmd[VTX_VTXFMT_0] || vfmt1 != rmesa->hw.vtx.cmd[VTX_VTXFMT_1]) { diff --git a/src/mesa/drivers/dri/r200/r200_sanity.c b/src/mesa/drivers/dri/r200/r200_sanity.c index ca5b926a944..3f2a8665309 100644 --- a/src/mesa/drivers/dri/r200/r200_sanity.c +++ b/src/mesa/drivers/dri/r200/r200_sanity.c @@ -978,7 +978,7 @@ static int radeon_emit_veclinear( } } else if ((start >= 0x180) && (start < 0x1c0)) { - for (i = start ; (i < start + sz) ; i += 4) { + for (i = 0 ; i < sz ; i += 4) { fprintf(stderr, "R200_VS_PROG %d OPDST %08x\n", (i >> 2) + start - 0x180 + 0x40, data[i]); fprintf(stderr, "R200_VS_PROG %d SRC1 %08x\n", (i >> 2) + start - 0x180 + 0x40, data[i+1]); fprintf(stderr, "R200_VS_PROG %d SRC2 %08x\n", (i >> 2) + start - 0x180 + 0x40, data[i+2]); diff --git a/src/mesa/drivers/dri/r200/r200_vertprog.c b/src/mesa/drivers/dri/r200/r200_vertprog.c index b5afe51d824..899e84caa0f 100644 --- a/src/mesa/drivers/dri/r200/r200_vertprog.c +++ b/src/mesa/drivers/dri/r200/r200_vertprog.c @@ -405,6 +405,7 @@ static GLboolean r200_translate_vertex_program(GLcontext *ctx, struct r200_verte int dofogfix = 0; int fog_temp_i = 0; int free_inputs; + int free_inputs_conv; int array_count = 0; vp->native = GL_FALSE; @@ -530,6 +531,7 @@ static GLboolean r200_translate_vertex_program(GLcontext *ctx, struct r200_verte array_count++; } } + free_inputs_conv = free_inputs; /* using VERT_ATTRIB_TEX6/7 would be illegal */ /* completely ignore aliasing? */ for (i = VERT_ATTRIB_GENERIC0; i < VERT_ATTRIB_MAX; i++) { @@ -548,11 +550,13 @@ static GLboolean r200_translate_vertex_program(GLcontext *ctx, struct r200_verte if (free_inputs & (1 << j)) { free_inputs &= ~(1 << j); vp->inputs[i] = j; + vp->rev_inputs[j] = i; break; } } } } + vp->gen_inputs_mapped = free_inputs ^ free_inputs_conv; if (!(mesa_vp->Base.OutputsWritten & (1 << VERT_RESULT_HPOS))) { if (R200_DEBUG & DEBUG_FALLBACKS) { @@ -1205,6 +1209,9 @@ r200ProgramStringNotify(GLcontext *ctx, GLenum target, struct gl_program *prog) r200_translate_vertex_program(ctx, vp); rmesa->curr_vp_hw = NULL; break; + case GL_FRAGMENT_SHADER_ATI: + rmesa->afs_loaded = NULL; + break; } /* need this for tcl fallbacks */ _tnl_program_string(ctx, target, prog); diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index 44ee0465690..7ff45cffe8b 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -1086,7 +1086,7 @@ _mesa_init_constants( GLcontext *ctx ) /* If we're running in the X server, do bounds checking to prevent * segfaults and server crashes! */ -#if defined(XFree86LOADER) && defined(IN_MODULE) +#if defined(XFree86Server) ctx->Const.CheckArrayBounds = GL_TRUE; #else ctx->Const.CheckArrayBounds = GL_FALSE; diff --git a/src/mesa/shader/arbprogram.c b/src/mesa/shader/arbprogram.c index 91fb6910381..bff80d7ee3a 100644 --- a/src/mesa/shader/arbprogram.c +++ b/src/mesa/shader/arbprogram.c @@ -195,13 +195,15 @@ _mesa_GetVertexAttribPointervARB(GLuint index, GLenum pname, GLvoid **pointer) GLboolean GLAPIENTRY _mesa_IsProgramARB(GLuint id) { + struct gl_program *prog = NULL; GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE); if (id == 0) return GL_FALSE; - if (_mesa_lookup_program(ctx, id)) + prog = _mesa_lookup_program(ctx, id); + if (prog && (prog != &_mesa_DummyProgram)) return GL_TRUE; else return GL_FALSE; @@ -765,6 +767,7 @@ void GLAPIENTRY _mesa_GetProgramStringARB(GLenum target, GLenum pname, GLvoid *string) { const struct gl_program *prog; + char *dst = (char *) string; GET_CURRENT_CONTEXT(ctx); if (!ctx->_CurrentProgram) @@ -788,5 +791,8 @@ _mesa_GetProgramStringARB(GLenum target, GLenum pname, GLvoid *string) return; } - _mesa_memcpy(string, prog->String, _mesa_strlen((char *) prog->String)); + if (prog->String) + _mesa_memcpy(dst, prog->String, _mesa_strlen((char *) prog->String)); + else + *dst = '\0'; } diff --git a/src/mesa/shader/atifragshader.c b/src/mesa/shader/atifragshader.c index d349a496dc7..4727c1a4365 100644 --- a/src/mesa/shader/atifragshader.c +++ b/src/mesa/shader/atifragshader.c @@ -400,6 +400,8 @@ _mesa_EndFragmentShaderATI(void) } } #endif + if (ctx->Driver.ProgramStringNotify) + ctx->Driver.ProgramStringNotify( ctx, GL_FRAGMENT_SHADER_ATI, NULL ); } void GLAPIENTRY diff --git a/src/mesa/shader/program.c b/src/mesa/shader/program.c index 789d36eba02..ddfad47b894 100644 --- a/src/mesa/shader/program.c +++ b/src/mesa/shader/program.c @@ -207,6 +207,7 @@ _mesa_init_program_struct( GLcontext *ctx, struct gl_program *prog, prog->Target = target; prog->Resident = GL_TRUE; prog->RefCount = 1; + prog->Format = GL_PROGRAM_FORMAT_ASCII_ARB; } return prog; @@ -284,6 +285,9 @@ _mesa_delete_program(GLcontext *ctx, struct gl_program *prog) (void) ctx; ASSERT(prog); + if (prog == &_mesa_DummyProgram) + return; + if (prog->String) _mesa_free(prog->String); diff --git a/src/mesa/shader/slang/slang_assemble_assignment.c b/src/mesa/shader/slang/slang_assemble_assignment.c index d894a8db18c..a1038671c41 100644 --- a/src/mesa/shader/slang/slang_assemble_assignment.c +++ b/src/mesa/shader/slang/slang_assemble_assignment.c @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.5 + * Version: 6.5.2 * * Copyright (C) 2005-2006 Brian Paul All Rights Reserved. * @@ -53,8 +53,11 @@ * +------------------+ */ + + static GLboolean -assign_basic (slang_assemble_ctx *A, slang_storage_type type, GLuint *index, GLuint size) +assign_basic(slang_assemble_ctx * A, slang_storage_type type, GLuint * index, + GLuint size) { GLuint dst_offset, dst_addr_loc; slang_assembly_type ty; @@ -85,22 +88,25 @@ assign_basic (slang_assemble_ctx *A, slang_storage_type type, GLuint *index, GLu ty = slang_asm_none; } - /* Calculate the distance from top of the stack to the destination address. As the - * copy operation progresses, components of the source are being successively popped - * off the stack by the amount of *index increase step. - */ + /* Calculate the distance from top of the stack to the destination + * address. As the copy operation progresses, components of the + * source are being successively popped off the stack by the amount + * of *index increase step. + */ dst_addr_loc = size - *index; - if (!slang_assembly_file_push_label2 (A->file, ty, dst_addr_loc, dst_offset)) + if (!slang_assembly_file_push_label2 + (A->file, ty, dst_addr_loc, dst_offset)) return GL_FALSE; - *index += _slang_sizeof_type (type); + *index += _slang_sizeof_type(type); return GL_TRUE; } + static GLboolean -assign_aggregate (slang_assemble_ctx *A, const slang_storage_aggregate *agg, GLuint *index, - GLuint size) +assign_aggregate(slang_assemble_ctx * A, const slang_storage_aggregate * agg, + GLuint * index, GLuint size) { GLuint i; @@ -110,25 +116,26 @@ assign_aggregate (slang_assemble_ctx *A, const slang_storage_aggregate *agg, GLu for (j = 0; j < arr->length; j++) { if (arr->type == slang_stor_aggregate) { - if (!assign_aggregate (A, arr->aggregate, index, size)) + if (!assign_aggregate(A, arr->aggregate, index, size)) return GL_FALSE; } else { - /* When the destination is swizzled, we are forced to do float_copy, even if - * vec4 extension is enabled with vec4_copy operation. + /* When the destination is swizzled, we are forced to do + * float_copy, even if vec4 extension is enabled with + * vec4_copy operation. */ if (A->swz.num_components != 0 && arr->type == slang_stor_vec4) { - if (!assign_basic (A, slang_stor_float, index, size)) + if (!assign_basic(A, slang_stor_float, index, size)) return GL_FALSE; - if (!assign_basic (A, slang_stor_float, index, size)) + if (!assign_basic(A, slang_stor_float, index, size)) return GL_FALSE; - if (!assign_basic (A, slang_stor_float, index, size)) + if (!assign_basic(A, slang_stor_float, index, size)) return GL_FALSE; - if (!assign_basic (A, slang_stor_float, index, size)) + if (!assign_basic(A, slang_stor_float, index, size)) return GL_FALSE; } else { - if (!assign_basic (A, arr->type, index, size)) + if (!assign_basic(A, arr->type, index, size)) return GL_FALSE; } } @@ -138,80 +145,79 @@ assign_aggregate (slang_assemble_ctx *A, const slang_storage_aggregate *agg, GLu return GL_TRUE; } -GLboolean _slang_assemble_assignment (slang_assemble_ctx *A, slang_operation *op) + +GLboolean +_slang_assemble_assignment(slang_assemble_ctx * A, const slang_operation * op) { - slang_assembly_typeinfo ti; - GLboolean result = GL_FALSE; - slang_storage_aggregate agg; - GLuint index, size; - - if (!slang_assembly_typeinfo_construct (&ti)) - return GL_FALSE; - if (!_slang_typeof_operation (A, op, &ti)) - goto end1; - - if (!slang_storage_aggregate_construct (&agg)) - goto end1; - if (!_slang_aggregate_variable (&agg, &ti.spec, 0, A->space.funcs, A->space.structs, - A->space.vars, A->mach, A->file, A->atoms)) - goto end; - - index = 0; - size = _slang_sizeof_aggregate (&agg); - result = assign_aggregate (A, &agg, &index, size); - -end1: - slang_storage_aggregate_destruct (&agg); -end: - slang_assembly_typeinfo_destruct (&ti); - return result; + slang_assembly_typeinfo ti; + GLboolean result = GL_FALSE; + slang_storage_aggregate agg; + GLuint index, size; + + if (!slang_assembly_typeinfo_construct(&ti)) + return GL_FALSE; + if (!_slang_typeof_operation(A, op, &ti)) + goto end1; + + if (!slang_storage_aggregate_construct(&agg)) + goto end1; + if (!_slang_aggregate_variable(&agg, &ti.spec, 0, A->space.funcs, + A->space.structs, A->space.vars, + A->mach, A->file, A->atoms)) + goto end; + + index = 0; + size = _slang_sizeof_aggregate(&agg); + result = assign_aggregate(A, &agg, &index, size); + + end1: + slang_storage_aggregate_destruct(&agg); + end: + slang_assembly_typeinfo_destruct(&ti); + return result; } -/* - * _slang_assemble_assign() - * - * Performs unary (pre ++ and --) or binary (=, +=, -=, *=, /=) assignment on the operation's - * children. - */ -GLboolean _slang_assemble_assign (slang_assemble_ctx *A, slang_operation *op, const char *oper, - slang_ref_type ref) +/** + * Performs unary (pre ++ and --) or binary (=, +=, -=, *=, /=) + * assignment on the operation's children. + */ +GLboolean +_slang_assemble_assign(slang_assemble_ctx * A, slang_operation * op, + const char *oper, slang_ref_type ref) { - slang_swizzle swz; - - if (ref == slang_ref_forbid) - { - if (!slang_assembly_file_push_label2 (A->file, slang_asm_local_addr, A->local.addr_tmp, 4)) - return GL_FALSE; - } - - if (slang_string_compare ("=", oper) == 0) - { - if (!_slang_assemble_operation (A, &op->children[0], slang_ref_force)) - return GL_FALSE; - swz = A->swz; - if (!_slang_assemble_operation (A, &op->children[1], slang_ref_forbid)) - return GL_FALSE; - A->swz = swz; - if (!_slang_assemble_assignment (A, op->children)) - return GL_FALSE; - } - else - { - if (!_slang_assemble_function_call_name (A, oper, op->children, op->num_children, GL_TRUE)) - return GL_FALSE; - } - - if (ref == slang_ref_forbid) - { - if (!slang_assembly_file_push (A->file, slang_asm_addr_copy)) - return GL_FALSE; - if (!slang_assembly_file_push_label (A->file, slang_asm_local_free, 4)) - return GL_FALSE; - if (!_slang_dereference (A, op->children)) - return GL_FALSE; - } - - return GL_TRUE; -} + slang_swizzle swz; + + if (ref == slang_ref_forbid) { + if (!slang_assembly_file_push_label2 + (A->file, slang_asm_local_addr, A->local.addr_tmp, 4)) + return GL_FALSE; + } + + if (slang_string_compare("=", oper) == 0) { + if (!_slang_assemble_operation(A, &op->children[0], slang_ref_force)) + return GL_FALSE; + swz = A->swz; + if (!_slang_assemble_operation(A, &op->children[1], slang_ref_forbid)) + return GL_FALSE; + A->swz = swz; + if (!_slang_assemble_assignment(A, op->children)) + return GL_FALSE; + } + else { + if (!_slang_assemble_function_call_name + (A, oper, op->children, op->num_children, GL_TRUE)) + return GL_FALSE; + } + + if (ref == slang_ref_forbid) { + if (!slang_assembly_file_push(A->file, slang_asm_addr_copy)) + return GL_FALSE; + if (!slang_assembly_file_push_label(A->file, slang_asm_local_free, 4)) + return GL_FALSE; + if (!_slang_dereference(A, op->children)) + return GL_FALSE; + } + return GL_TRUE; +} diff --git a/src/mesa/shader/slang/slang_assemble_assignment.h b/src/mesa/shader/slang/slang_assemble_assignment.h index 7b993b543b1..3c1ecdedab8 100644 --- a/src/mesa/shader/slang/slang_assemble_assignment.h +++ b/src/mesa/shader/slang/slang_assemble_assignment.h @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.5 + * Version: 6.5.2 * * Copyright (C) 2005-2006 Brian Paul All Rights Reserved. * @@ -22,21 +22,24 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#if !defined SLANG_ASSEMBLE_ASSIGNMENT_H +#ifndef SLANG_ASSEMBLE_ASSIGNMENT_H #define SLANG_ASSEMBLE_ASSIGNMENT_H #if defined __cplusplus extern "C" { #endif -GLboolean _slang_assemble_assignment (slang_assemble_ctx *, struct slang_operation_ *); -GLboolean _slang_assemble_assign (slang_assemble_ctx *, struct slang_operation_ *, const char *, - slang_ref_type); +extern GLboolean +_slang_assemble_assignment(slang_assemble_ctx *, const struct slang_operation_ *); + +extern GLboolean +_slang_assemble_assign(slang_assemble_ctx *, struct slang_operation_ *, + const char *, slang_ref_type); + #ifdef __cplusplus } #endif -#endif - +#endif /* SLANG_ASSEMBLE_ASSIGNMENT_H */ diff --git a/src/mesa/shader/slang/slang_assemble_constructor.c b/src/mesa/shader/slang/slang_assemble_constructor.c index 8b5458f7661..6cd320d4466 100644 --- a/src/mesa/shader/slang/slang_assemble_constructor.c +++ b/src/mesa/shader/slang/slang_assemble_constructor.c @@ -171,9 +171,9 @@ sizeof_argument(slang_assemble_ctx * A, GLuint * size, slang_operation * op) if (!slang_storage_aggregate_construct(&agg)) goto end1; - if (!_slang_aggregate_variable - (&agg, &ti.spec, 0, A->space.funcs, A->space.structs, A->space.vars, - A->mach, A->file, A->atoms)) + if (!_slang_aggregate_variable(&agg, &ti.spec, 0, A->space.funcs, + A->space.structs, A->space.vars, + A->mach, A->file, A->atoms)) goto end; *size = _slang_sizeof_aggregate(&agg); @@ -186,6 +186,7 @@ sizeof_argument(slang_assemble_ctx * A, GLuint * size, slang_operation * op) return result; } + static GLboolean constructor_aggregate(slang_assemble_ctx * A, const slang_storage_aggregate * flat, @@ -202,9 +203,9 @@ constructor_aggregate(slang_assemble_ctx * A, if (!slang_storage_aggregate_construct(&agg)) goto end1; - if (!_slang_aggregate_variable - (&agg, &ti.spec, 0, A->space.funcs, A->space.structs, A->space.vars, - A->mach, A->file, A->atoms)) + if (!_slang_aggregate_variable(&agg, &ti.spec, 0, A->space.funcs, + A->space.structs, A->space.vars, + A->mach, A->file, A->atoms)) goto end2; if (!slang_storage_aggregate_construct(&flat_agg)) @@ -245,8 +246,9 @@ constructor_aggregate(slang_assemble_ctx * A, return result; } + GLboolean -_slang_assemble_constructor(slang_assemble_ctx * A, slang_operation * op) +_slang_assemble_constructor(slang_assemble_ctx * A, const slang_operation * op) { slang_assembly_typeinfo ti; GLboolean result = GL_FALSE; @@ -263,9 +265,9 @@ _slang_assemble_constructor(slang_assemble_ctx * A, slang_operation * op) /* create an aggregate of the constructor */ if (!slang_storage_aggregate_construct(&agg)) goto end1; - if (!_slang_aggregate_variable - (&agg, &ti.spec, 0, A->space.funcs, A->space.structs, A->space.vars, - A->mach, A->file, A->atoms)) + if (!_slang_aggregate_variable(&agg, &ti.spec, 0, A->space.funcs, + A->space.structs, A->space.vars, + A->mach, A->file, A->atoms)) goto end2; /* calculate size of the constructor */ @@ -334,12 +336,12 @@ _slang_assemble_constructor(slang_assemble_ctx * A, slang_operation * op) GLboolean _slang_assemble_constructor_from_swizzle(slang_assemble_ctx * A, const slang_swizzle * swz, - slang_type_specifier * spec, - slang_type_specifier * master_spec) + const slang_type_specifier * spec, + const slang_type_specifier * master_spec) { - GLuint master_rows, i; + const GLuint master_rows = _slang_type_dim(master_spec->type); + GLuint i; - master_rows = _slang_type_dim(master_spec->type); for (i = 0; i < master_rows; i++) { switch (_slang_type_base(master_spec->type)) { case slang_spec_bool: @@ -361,19 +363,22 @@ _slang_assemble_constructor_from_swizzle(slang_assemble_ctx * A, break; } } + if (!slang_assembly_file_push_label(A->file, slang_asm_local_free, 4)) return GL_FALSE; + for (i = swz->num_components; i > 0; i--) { - GLuint n = i - 1; + const GLuint n = i - 1; - if (!slang_assembly_file_push_label2 - (A->file, slang_asm_local_addr, A->local.swizzle_tmp, 16)) + if (!slang_assembly_file_push_label2(A->file, slang_asm_local_addr, + A->local.swizzle_tmp, 16)) return GL_FALSE; - if (!slang_assembly_file_push_label - (A->file, slang_asm_addr_push, swz->swizzle[n] * 4)) + if (!slang_assembly_file_push_label(A->file, slang_asm_addr_push, + swz->swizzle[n] * 4)) return GL_FALSE; if (!slang_assembly_file_push(A->file, slang_asm_addr_add)) return GL_FALSE; + switch (_slang_type_base(master_spec->type)) { case slang_spec_bool: if (!slang_assembly_file_push(A->file, slang_asm_bool_deref)) diff --git a/src/mesa/shader/slang/slang_assemble_constructor.h b/src/mesa/shader/slang/slang_assemble_constructor.h index c7aedf3af81..c0deb913448 100644 --- a/src/mesa/shader/slang/slang_assemble_constructor.h +++ b/src/mesa/shader/slang/slang_assemble_constructor.h @@ -41,13 +41,14 @@ _slang_multiply_swizzles(slang_swizzle *, const slang_swizzle *, const slang_swizzle *); extern GLboolean -_slang_assemble_constructor(slang_assemble_ctx *, struct slang_operation_ *); +_slang_assemble_constructor(slang_assemble_ctx *, + const struct slang_operation_ *); extern GLboolean _slang_assemble_constructor_from_swizzle(slang_assemble_ctx *, const slang_swizzle *, - slang_type_specifier *, - slang_type_specifier *); + const slang_type_specifier *, + const slang_type_specifier *); #ifdef __cplusplus } diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c index 77a293ea45e..c49ab4a68dc 100644 --- a/src/mesa/shader/slang/slang_compile.c +++ b/src/mesa/shader/slang/slang_compile.c @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.6 + * Version: 6.5.2 * * Copyright (C) 2005-2006 Brian Paul All Rights Reserved. * @@ -42,14 +42,16 @@ * may be accepted resulting in undefined behaviour. */ -/* slang_var_pool */ + +/** + * Allocate storage for a variable of 'size' bytes from given pool. + * Return the allocated address for the variable. + */ static GLuint slang_var_pool_alloc(slang_var_pool * pool, unsigned int size) { - GLuint addr; - - addr = pool->next_addr; + const GLuint addr = pool->next_addr; pool->next_addr += size; return addr; } @@ -432,22 +434,11 @@ parse_struct_field(slang_parse_ctx * C, slang_output_ctx * O, return 0; do { - slang_variable *var; - - st->fields->variables = - (slang_variable *) slang_alloc_realloc(st->fields->variables, - st->fields->num_variables * - sizeof(slang_variable), - (st->fields->num_variables + - 1) * sizeof(slang_variable)); - if (st->fields->variables == NULL) { + slang_variable *var = slang_variable_scope_grow(st->fields); + if (!var) { slang_info_log_memory(C->L); return 0; } - var = &st->fields->variables[st->fields->num_variables]; - if (!slang_variable_construct(var)) - return 0; - st->fields->num_variables++; if (!parse_struct_field_var(C, &o, var, sp)) return 0; } @@ -1222,6 +1213,7 @@ parse_expression(slang_parse_ctx * C, slang_output_ctx * O, if (!parse_child_operation(C, O, op, 0)) return 0; C->I++; + if (!C->parsing_builtin && !slang_function_scope_find_by_name(O->funs, op->a_id, 1)) { const char *id; @@ -1479,20 +1471,11 @@ parse_function_prototype(slang_parse_ctx * C, slang_output_ctx * O, /* parse function parameters */ while (*C->I++ == PARAMETER_NEXT) { - slang_variable *p; - - func->parameters->variables = (slang_variable *) - slang_alloc_realloc(func->parameters->variables, - func->parameters->num_variables * sizeof(slang_variable), - (func->parameters->num_variables + 1) * sizeof(slang_variable)); - if (func->parameters->variables == NULL) { + slang_variable *p = slang_variable_scope_grow(func->parameters); + if (!p) { slang_info_log_memory(C->L); return 0; } - p = &func->parameters->variables[func->parameters->num_variables]; - if (!slang_variable_construct(p)) - return 0; - func->parameters->num_variables++; if (!parse_parameter_declaration(C, O, p)) return 0; } @@ -1662,18 +1645,11 @@ parse_init_declarator(slang_parse_ctx * C, slang_output_ctx * O, return 1; /* make room for the new variable and initialize it */ - O->vars->variables = (slang_variable *) - slang_alloc_realloc(O->vars->variables, - O->vars->num_variables * sizeof(slang_variable), - (O->vars->num_variables + 1) * sizeof(slang_variable)); - if (O->vars->variables == NULL) { + var = slang_variable_scope_grow(O->vars); + if (!var) { slang_info_log_memory(C->L); return 0; } - var = &O->vars->variables[O->vars->num_variables]; - if (!slang_variable_construct(var)) - return 0; - O->vars->num_variables++; /* copy the declarator qualifier type, parse the identifier */ var->global = C->global_scope; diff --git a/src/mesa/shader/slang/slang_compile_function.h b/src/mesa/shader/slang/slang_compile_function.h index 1a7302f29aa..c05c6f4d850 100644 --- a/src/mesa/shader/slang/slang_compile_function.h +++ b/src/mesa/shader/slang/slang_compile_function.h @@ -64,8 +64,8 @@ typedef struct slang_function_ { slang_function_kind kind; slang_variable header; /**< The function's name and return type */ - slang_variable_scope *parameters; /**< array [param_count] */ - unsigned int param_count; + slang_variable_scope *parameters; /**< formal parameters AND local vars */ + unsigned int param_count; /**< number of formal params (no locals) */ slang_operation *body; /**< The instruction tree */ unsigned int address; /**< Address of this func in memory */ slang_fixup_table fixups; /**< Mem locations which need func's address */ diff --git a/src/mesa/shader/slang/slang_compile_operation.c b/src/mesa/shader/slang/slang_compile_operation.c index 7e920135597..73f57bfb123 100644 --- a/src/mesa/shader/slang/slang_compile_operation.c +++ b/src/mesa/shader/slang/slang_compile_operation.c @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.5 + * Version: 6.5.2 * * Copyright (C) 2005-2006 Brian Paul All Rights Reserved. * @@ -31,68 +31,85 @@ #include "imports.h" #include "slang_compile.h" -/* slang_operation */ -int slang_operation_construct (slang_operation *oper) +/** + * Init a slang_operation object + */ +GLboolean +slang_operation_construct(slang_operation * oper) { - oper->type = slang_oper_none; - oper->children = NULL; - oper->num_children = 0; - oper->literal = (float) 0; - oper->a_id = SLANG_ATOM_NULL; - oper->locals = (slang_variable_scope *) slang_alloc_malloc (sizeof (slang_variable_scope)); - if (oper->locals == NULL) - return 0; - _slang_variable_scope_ctr (oper->locals); - return 1; + oper->type = slang_oper_none; + oper->children = NULL; + oper->num_children = 0; + oper->literal = (float) 0; + oper->a_id = SLANG_ATOM_NULL; + oper->locals = + (slang_variable_scope *) + slang_alloc_malloc(sizeof(slang_variable_scope)); + if (oper->locals == NULL) + return GL_FALSE; + _slang_variable_scope_ctr(oper->locals); + return GL_TRUE; } -void slang_operation_destruct (slang_operation *oper) +void +slang_operation_destruct(slang_operation * oper) { - unsigned int i; + GLuint i; - for (i = 0; i < oper->num_children; i++) - slang_operation_destruct (oper->children + i); - slang_alloc_free (oper->children); - slang_variable_scope_destruct (oper->locals); - slang_alloc_free (oper->locals); + for (i = 0; i < oper->num_children; i++) + slang_operation_destruct(oper->children + i); + slang_alloc_free(oper->children); + slang_variable_scope_destruct(oper->locals); + slang_alloc_free(oper->locals); } -int slang_operation_copy (slang_operation *x, const slang_operation *y) +/** + * Recursively copy a slang_operation node. + * \return GL_TRUE for success, GL_FALSE if failure + */ +GLboolean +slang_operation_copy(slang_operation * x, const slang_operation * y) { - slang_operation z; - unsigned int i; + slang_operation z; + GLuint i; - if (!slang_operation_construct (&z)) - return 0; - z.type = y->type; - z.children = (slang_operation *) slang_alloc_malloc (y->num_children * sizeof (slang_operation)); - if (z.children == NULL) - { - slang_operation_destruct (&z); - return 0; - } - for (z.num_children = 0; z.num_children < y->num_children; z.num_children++) - if (!slang_operation_construct (&z.children[z.num_children])) - { - slang_operation_destruct (&z); - return 0; - } - for (i = 0; i < z.num_children; i++) - if (!slang_operation_copy (&z.children[i], &y->children[i])) - { - slang_operation_destruct (&z); - return 0; - } - z.literal = y->literal; - z.a_id = y->a_id; - if (!slang_variable_scope_copy (z.locals, y->locals)) - { - slang_operation_destruct (&z); - return 0; - } - slang_operation_destruct (x); - *x = z; - return 1; + if (!slang_operation_construct(&z)) + return GL_FALSE; + z.type = y->type; + z.children = (slang_operation *) + slang_alloc_malloc(y->num_children * sizeof(slang_operation)); + if (z.children == NULL) { + slang_operation_destruct(&z); + return GL_FALSE; + } + for (z.num_children = 0; z.num_children < y->num_children; + z.num_children++) { + if (!slang_operation_construct(&z.children[z.num_children])) { + slang_operation_destruct(&z); + return GL_FALSE; + } + } + for (i = 0; i < z.num_children; i++) { + if (!slang_operation_copy(&z.children[i], &y->children[i])) { + slang_operation_destruct(&z); + return GL_FALSE; + } + } + z.literal = y->literal; + z.a_id = y->a_id; + if (!slang_variable_scope_copy(z.locals, y->locals)) { + slang_operation_destruct(&z); + return GL_FALSE; + } + slang_operation_destruct(x); + *x = z; + return GL_TRUE; } + +slang_operation * +slang_operation_new(GLuint count) +{ + return (slang_operation *) _mesa_calloc(count * sizeof(slang_operation)); +} diff --git a/src/mesa/shader/slang/slang_compile_operation.h b/src/mesa/shader/slang/slang_compile_operation.h index f3c45de3c2a..a9376ec945f 100644 --- a/src/mesa/shader/slang/slang_compile_operation.h +++ b/src/mesa/shader/slang/slang_compile_operation.h @@ -32,7 +32,7 @@ extern "C" { /** * Types of slang operations. - * These are the basic intermediate code representations. + * These are the types of the AST (abstract syntax tree) nodes. * [foo] indicates a sub-tree or reference to another type of node */ typedef enum slang_operation_type_ @@ -105,6 +105,7 @@ typedef enum slang_operation_type_ /** * A slang_operation is basically a compiled instruction (such as assignment, * a while-loop, a conditional, a multiply, a function call, etc). + * The AST (abstract syntax tree) is built from these nodes. * NOTE: This structure could have been implemented as a union of simpler * structs which would correspond to the operation types above. */ @@ -112,16 +113,24 @@ typedef struct slang_operation_ { slang_operation_type type; struct slang_operation_ *children; - unsigned int num_children; - float literal; /**< Used for float, int and bool values */ - slang_atom a_id; /**< type: asm, identifier, call, field */ + GLuint num_children; + GLfloat literal; /**< Used for float, int and bool values */ + slang_atom a_id; /**< type: asm, identifier, call, field */ slang_variable_scope *locals; /**< local vars for scope */ } slang_operation; -extern int slang_operation_construct(slang_operation *); -extern void slang_operation_destruct(slang_operation *); -extern int slang_operation_copy(slang_operation *, const slang_operation *); +extern GLboolean +slang_operation_construct(slang_operation *); + +extern void +slang_operation_destruct(slang_operation *); + +extern GLboolean +slang_operation_copy(slang_operation *, const slang_operation *); + +extern slang_operation * +slang_operation_new(GLuint count); #ifdef __cplusplus diff --git a/src/mesa/shader/slang/slang_compile_variable.c b/src/mesa/shader/slang/slang_compile_variable.c index 92951b85bbc..a8a2d6aa6a0 100644 --- a/src/mesa/shader/slang/slang_compile_variable.c +++ b/src/mesa/shader/slang/slang_compile_variable.c @@ -181,6 +181,32 @@ slang_variable_scope_copy(slang_variable_scope * x, return 1; } + +/** + * Grow the variable list by one. + * \return pointer to space for the new variable (will be initialized) + */ +slang_variable * +slang_variable_scope_grow(slang_variable_scope *scope) +{ + const int n = scope->num_variables; + scope->variables = (slang_variable *) + slang_alloc_realloc(scope->variables, + n * sizeof(slang_variable), + (n + 1) * sizeof(slang_variable)); + if (!scope->variables) + return NULL; + + scope->num_variables++; + + if (!slang_variable_construct(scope->variables + n)) + return NULL; + + return scope->variables + n; +} + + + /* slang_variable */ int diff --git a/src/mesa/shader/slang/slang_compile_variable.h b/src/mesa/shader/slang/slang_compile_variable.h index 2f358860f82..b0910e855ea 100644 --- a/src/mesa/shader/slang/slang_compile_variable.h +++ b/src/mesa/shader/slang/slang_compile_variable.h @@ -81,6 +81,7 @@ typedef struct slang_variable_ GLuint address2; /**< Storage location */ GLuint size; /**< Variable's size in bytes */ GLboolean global; /**< A global var? */ + void *aux; /**< Used during code gen */ } slang_variable; @@ -104,6 +105,8 @@ extern int slang_variable_scope_copy(slang_variable_scope *, const slang_variable_scope *); +slang_variable * +slang_variable_scope_grow(slang_variable_scope *); extern int slang_variable_construct(slang_variable *); diff --git a/src/mesa/tnl/t_vb_arbprogram.c b/src/mesa/tnl/t_vb_arbprogram.c index 71fb45dd95c..bf4c1d52237 100644 --- a/src/mesa/tnl/t_vb_arbprogram.c +++ b/src/mesa/tnl/t_vb_arbprogram.c @@ -1529,7 +1529,7 @@ const struct tnl_pipeline_stage _tnl_arb_vertex_program_stage = void _tnl_program_string(GLcontext *ctx, GLenum target, struct gl_program *program) { - if (program->Target == GL_VERTEX_PROGRAM_ARB) { + if (target == GL_VERTEX_PROGRAM_ARB) { /* free any existing tnl data hanging off the program */ struct gl_vertex_program *vprog = (struct gl_vertex_program *) program; if (vprog->TnlData) { -- cgit v1.2.3 From 01c90575b487f6b0f8f67a1833541aa41dca643d Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Mon, 4 Dec 2006 07:23:14 +0000 Subject: Add missing changelog entry and bug closer. --- debian/changelog | 2 ++ 1 file changed, 2 insertions(+) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index b24e4e7f845..f8366c61903 100644 --- a/debian/changelog +++ b/debian/changelog @@ -17,6 +17,8 @@ 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 -- cgit v1.2.3 From 6eeb18fc684ee073fba8909f19ad2ad7be6ab5ab Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Tue, 5 Dec 2006 00:45:42 +0000 Subject: Build the i915tex DRI module on the i386 and amd64 architectures. --- configs/debian-dri-default | 2 +- debian/changelog | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'debian') diff --git a/configs/debian-dri-default b/configs/debian-dri-default index 31e90479c4a..9aec9f7c6e0 100644 --- a/configs/debian-dri-default +++ b/configs/debian-dri-default @@ -25,7 +25,7 @@ DRI_DIRS = mach64 mga r128 r200 r300 radeon s3v savage tdfx trident ARCH_X86 = i386 amd64 ifneq ($(findstring $(DEB_BUILD_ARCH), $(ARCH_X86)),) - DRI_DIRS += i810 i915 i965 sis unichrome + DRI_DIRS += i810 i915 i915tex i965 sis unichrome endif ifeq ($(DEB_BUILD_ARCH), sparc) diff --git a/debian/changelog b/debian/changelog index f8366c61903..81527cd12df 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,8 +2,9 @@ mesa (6.5.2-0.1) experimental; urgency=low * Non-maintainer upload. * New upstream release. + * Build the i915tex DRI module on the i386 and amd64 architectures. - -- Thierry Reding Sun, 3 Dec 2006 00:45:09 +0100 + -- Thierry Reding Tue, 5 Dec 2006 01:44:53 +0100 mesa (6.5.2~rc3-0.1) experimental; urgency=low -- cgit v1.2.3 From c619abf18a0420ffbecce05744fee500aa774ff7 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Thu, 4 Jan 2007 16:35:14 +0100 Subject: Hijack the package (set XSF as maintainer, add myself to uploaders). \o/ --- debian/changelog | 7 ++++--- debian/control | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 81527cd12df..f41772439c9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,11 @@ -mesa (6.5.2-0.1) experimental; urgency=low +mesa (6.5.2-1) experimental; urgency=low - * Non-maintainer upload. * 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. - -- Thierry Reding Tue, 5 Dec 2006 01:44:53 +0100 + -- Thierry Reding Thu, 4 Jan 2007 16:34:32 +0100 mesa (6.5.2~rc3-0.1) experimental; urgency=low diff --git a/debian/control b/debian/control index 46e4464c062..12c8db45b9a 100644 --- a/debian/control +++ b/debian/control @@ -1,8 +1,8 @@ Source: mesa Section: graphics Priority: optional -Maintainer: Mesa package maintainers -Uploaders: Marcelo E. Magallon +Maintainer: Debian X Strike Force +Uploaders: Thierry Reding Standards-Version: 3.7.2 Build-Depends: debhelper (>= 5), quilt (>= 0.40), pkg-config, libdrm-dev (>= 2.2.0) [!hurd-i386], libx11-dev, xutils-dev, x11proto-gl-dev (>= 1.4.8), libxxf86vm-dev, libexpat1-dev, lesstif2-dev, dpkg-dev (>= 1.13.19) -- cgit v1.2.3 From f70ea0747dad96d9b7b93f889e1382f7d00b9bbd Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Thu, 4 Jan 2007 21:30:49 +0100 Subject: Import changelog entry from the 6.5.1-0.5 NMU. --- debian/changelog | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index f41772439c9..71dbaf0520b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -38,7 +38,7 @@ mesa (6.5.2~rc1-0.1) experimental; urgency=low -- Thierry Reding Sat, 18 Nov 2006 22:23:04 +0100 -mesa (6.5.1-0.5) experimental; urgency=low +mesa (6.5.1-0.6) experimental; urgency=low * Non-maintainer upload. * Rewrote the debian/rules file to make it easier to understand. @@ -50,7 +50,6 @@ mesa (6.5.1-0.5) experimental; urgency=low 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. - * Build with -fno-strict-aliasing. (Closes: #394311) * 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 @@ -61,6 +60,15 @@ mesa (6.5.1-0.5) experimental; urgency=low -- 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). -- cgit v1.2.3 From 44467ca45ec49c8210d11579ea614750cf70c4b1 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Fri, 5 Jan 2007 15:44:51 +0100 Subject: * Drop obsolete depends on xlibs. --- debian/changelog | 6 +++++- debian/control | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 71dbaf0520b..42d955ddc33 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,11 +1,15 @@ 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. - -- Thierry Reding Thu, 4 Jan 2007 16:34:32 +0100 + [ Julien Cristau ] + * Drop obsolete depends on xlibs. + + -- Julien Cristau Fri, 5 Jan 2007 15:44:16 +0100 mesa (6.5.2~rc3-0.1) experimental; urgency=low diff --git a/debian/control b/debian/control index 12c8db45b9a..ddb636432df 100644 --- a/debian/control +++ b/debian/control @@ -78,7 +78,7 @@ Description: A free implementation of the OpenGL API -- runtime [i686 optimized] Package: libgl1-mesa-swx11-dev Section: libdevel Architecture: any -Depends: libgl1-mesa-swx11 (= ${binary:Version}), libc6-dev, libx11-dev | xlibs-dev (>> 4.1.0), libxext6 | xlibs (>> 4.1.0), mesa-common-dev (= ${source:Version}) +Depends: libgl1-mesa-swx11 (= ${binary:Version}), libc6-dev, libx11-dev, libxext6, mesa-common-dev (= ${source:Version}) Provides: libgl-dev, mesag3-widgets, mesag-widgets-dev, libglw-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 -- cgit v1.2.3 From a404143f4c3d555efd478ff434d36964a6b8572a Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Mon, 8 Jan 2007 08:35:42 +0100 Subject: Add patches 04_cleanup-osmesa-configs and 05_static-nonpic. 04_cleanup-osmesa-configs makes the OSMesa configurations behave as expected. That is respect the OPT_FLAGS, PIC_FLAGS, ARCH_FLAGS and DEFINES variables. The patch also makes the files more consistent by inheriting from more general configurations. 05_static-nonpic fixes the linux-static configuration to not use -fPIC for compiling code because it would violate Debian policy. --- debian/changelog | 5 +- debian/patches/04_cleanup-osmesa-configs.patch | 190 +++++++++++++++++++++++++ debian/patches/05_static-nonpic.patch | 12 ++ debian/patches/series | 2 + 4 files changed, 208 insertions(+), 1 deletion(-) create mode 100644 debian/patches/04_cleanup-osmesa-configs.patch create mode 100644 debian/patches/05_static-nonpic.patch (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 42d955ddc33..c26edbd6be7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,11 +5,14 @@ mesa (6.5.2-1) experimental; urgency=low * 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. [ Julien Cristau ] * Drop obsolete depends on xlibs. - -- Julien Cristau Fri, 5 Jan 2007 15:44:16 +0100 + -- Thierry Reding Mon, 8 Jan 2007 07:12:08 +0100 mesa (6.5.2~rc3-0.1) experimental; urgency=low diff --git a/debian/patches/04_cleanup-osmesa-configs.patch b/debian/patches/04_cleanup-osmesa-configs.patch new file mode 100644 index 00000000000..6164e91ec30 --- /dev/null +++ b/debian/patches/04_cleanup-osmesa-configs.patch @@ -0,0 +1,190 @@ +diff --git a/configs/linux-osmesa b/configs/linux-osmesa +index cc1fbbd..aabab59 100644 +--- a/configs/linux-osmesa ++++ b/configs/linux-osmesa +@@ -9,8 +9,18 @@ CONFIG_NAME = linux-osmesa + # Compiler and flags + CC = gcc + CXX = g++ +-CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DPTHREADS +-CXXFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE ++ ++OPT_FLAGS ?= ++PIC_FLAGS = -fPIC ++ ++DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \ ++ -D_BSD_SOURCE -D_GNU_SOURCE \ ++ -DPTHREADS -DUSE_XSHM -DHAVE_POSIX_MEMALIGN ++ ++CFLAGS = -ansi -pedantic $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) \ ++ $(ASM_FLAGS) -ffast-math ++ ++CXXFLAGS = -ansi -pedantic $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) + + + # Directories +@@ -23,3 +33,4 @@ PROGRAM_DIRS = osdemos + OSMESA_LIB_DEPS = -lm -lpthread + GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(OSMESA_LIB) + APP_LIB_DEPS = -lOSMesa -lGLU ++ +diff --git a/configs/linux-osmesa-static b/configs/linux-osmesa-static +index 465f83c..eb3575f 100644 +--- a/configs/linux-osmesa-static ++++ b/configs/linux-osmesa-static +@@ -8,7 +8,8 @@ CONFIG_NAME = linux-osmesa-static + + # Compiler and flags + MKLIB_OPTIONS = -static ++PIC_FLAGS = + + # Library names +-OSMESA_LIB_NAME = libOSMesa.a ++OSMESA_LIB_NAME = lib$(OSMESA_LIB).a + +diff --git a/configs/linux-osmesa16 b/configs/linux-osmesa16 +index 1fb0186..2a06254 100644 +--- a/configs/linux-osmesa16 ++++ b/configs/linux-osmesa16 +@@ -1,28 +1,17 @@ + # Configuration for 16 bits/channel OSMesa library on Linux + +-include $(TOP)/configs/default ++include $(TOP)/configs/linux-osmesa + + CONFIG_NAME = linux-osmesa16 + +-# Compiler and flags +-CC = gcc +-CXX = g++ +-CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include -DCHAN_BITS=16 -DDEFAULT_SOFTWARE_DEPTH_BITS=31 +-CXXFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE +- ++DEFINES += -DCHAN_BITS=16 -DDEFAULT_SOFTWARE_DEPTH_BITS=32 + + # Library names + OSMESA_LIB = OSMesa16 +-OSMESA_LIB_NAME = libOSMesa16.so +- + + # Directories +-SRC_DIRS = mesa glu +-DRIVER_DIRS = osmesa + PROGRAM_DIRS = + +- + # Dependencies +-OSMESA_LIB_DEPS = -lm -lpthread +-GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(OSMESA_LIB) +-APP_LIB_DEPS = -lOSMesa16 ++APP_LIB_DEPS = -l$(OSMESA_LIB) ++ +diff --git a/configs/linux-osmesa16-static b/configs/linux-osmesa16-static +index 6645504..894cf82 100644 +--- a/configs/linux-osmesa16-static ++++ b/configs/linux-osmesa16-static +@@ -1,28 +1,13 @@ + # Configuration for 16 bits/channel OSMesa library on Linux + +-include $(TOP)/configs/default ++include $(TOP)/configs/linux-osmesa16 + + CONFIG_NAME = linux-osmesa16-static + + # Compiler and flags +-CC = gcc +-CXX = g++ +-CFLAGS = -O3 -ansi -pedantic -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include -DCHAN_BITS=16 -DDEFAULT_SOFTWARE_DEPTH_BITS=31 +-CXXFLAGS = -O3 -ansi -pedantic -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE + MKLIB_OPTIONS = -static +- ++PIC_FLAGS = + + # Library names +-OSMESA_LIB = OSMesa16 +-OSMESA_LIB_NAME = libOSMesa16.a +- +- +-# Directories +-SRC_DIRS = mesa glu +-DRIVER_DIRS = osmesa +-PROGRAM_DIRS = +- ++OSMESA_LIB_NAME = lib$(OSMESA_LIB).a + +-# Dependencies +-OSMESA_LIB_DEPS = -lm -lpthread +-APP_LIB_DEPS = -lOSMesa16 +diff --git a/configs/linux-osmesa32 b/configs/linux-osmesa32 +index a1e5a35..5a703f6 100644 +--- a/configs/linux-osmesa32 ++++ b/configs/linux-osmesa32 +@@ -1,28 +1,18 @@ + # Configuration for 32 bits/channel OSMesa library on Linux + +-include $(TOP)/configs/default ++include $(TOP)/configs/linux-osmesa + + CONFIG_NAME = linux-osmesa32 + + # Compiler and flags +-CC = gcc +-CXX = g++ +-CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include -DCHAN_BITS=32 -DDEFAULT_SOFTWARE_DEPTH_BITS=31 +-CXXFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE +- ++DEFINES += -DCHAN_BITS=32 -DDEFAULT_SOFTWARE_DEPTH_BITS=31 + + # Library names + OSMESA_LIB = OSMesa32 +-OSMESA_LIB_NAME = libOSMesa32.so +- + + # Directories +-SRC_DIRS = mesa glu +-DRIVER_DIRS = osmesa + PROGRAM_DIRS = + +- + # Dependencies +-OSMESA_LIB_DEPS = -lm -lpthread +-GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(OSMESA_LIB) +-APP_LIB_DEPS = -lOSMesa32 ++APP_LIB_DEPS = -l$(OSMESA_LIB) ++ +diff --git a/configs/linux-osmesa32-static b/configs/linux-osmesa32-static +index 6db8bc0..ecbb72e 100644 +--- a/configs/linux-osmesa32-static ++++ b/configs/linux-osmesa32-static +@@ -1,28 +1,13 @@ + # Configuration for 32 bits/channel OSMesa library on Linux + +-include $(TOP)/configs/default ++include $(TOP)/configs/linux-osmesa32 + + CONFIG_NAME = linux-osmesa32-static + + # Compiler and flags +-CC = gcc +-CXX = g++ +-CFLAGS = -O3 -ansi -pedantic -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include -DCHAN_BITS=32 -DDEFAULT_SOFTWARE_DEPTH_BITS=31 +-CXXFLAGS = -O3 -ansi -pedantic -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE + MKLIB_OPTIONS = -static +- ++PIC_FLAGS = + + # Library names +-OSMESA_LIB = OSMesa32 +-OSMESA_LIB_NAME = libOSMesa32.a +- +- +-# Directories +-SRC_DIRS = mesa glu +-DRIVER_DIRS = osmesa +-PROGRAM_DIRS = +- ++OSMESA_LIB_NAME = lib$(OSMESA_LIB).a + +-# Dependencies +-OSMESA_LIB_DEPS = -lm -lpthread +-APP_LIB_DEPS = -lOSMesa32 diff --git a/debian/patches/05_static-nonpic.patch b/debian/patches/05_static-nonpic.patch new file mode 100644 index 00000000000..e2df6e8fdd3 --- /dev/null +++ b/debian/patches/05_static-nonpic.patch @@ -0,0 +1,12 @@ +diff --git a/configs/linux-static b/configs/linux-static +index 85141ea..1592668 100644 +--- a/configs/linux-static ++++ b/configs/linux-static +@@ -5,6 +5,7 @@ include $(TOP)/configs/linux + CONFIG_NAME = linux-static + + MKLIB_OPTIONS = -static ++PIC_FLAGS = + + # Library names (actual file names) + GL_LIB_NAME = libGL.a diff --git a/debian/patches/series b/debian/patches/series index b370d514349..280a2f3548e 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -2,3 +2,5 @@ 01_fix-makefile.patch 02_use-ieee-fp-on-s390-and-m68k.patch 03_optional-progs-and-install.patch +04_cleanup-osmesa-configs.patch +05_static-nonpic.patch -- cgit v1.2.3 From 132ecd19f3790e728390054c98a39d412e00e171 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Mon, 8 Jan 2007 10:07:08 +0100 Subject: Do not build any linux*-static configuration with -fPIC. --- debian/patches/05_static-nonpic.patch | 48 +++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'debian') diff --git a/debian/patches/05_static-nonpic.patch b/debian/patches/05_static-nonpic.patch index e2df6e8fdd3..a6b7f4054ee 100644 --- a/debian/patches/05_static-nonpic.patch +++ b/debian/patches/05_static-nonpic.patch @@ -1,3 +1,27 @@ +diff --git a/configs/linux-alpha-static b/configs/linux-alpha-static +index 2a30af9..eb6a08a 100644 +--- a/configs/linux-alpha-static ++++ b/configs/linux-alpha-static +@@ -11,6 +11,7 @@ CFLAGS = -O3 -mcpu=ev5 -ansi -mieee -pedantic -D_XOPEN_SOURCE -DUSE_XSHM + CXXFLAGS = -O3 -mcpu=ev5 -ansi -mieee -pedantic -D_XOPEN_SOURCE + GLUT_CFLAGS = -fexceptions + MKLIB_OPTIONS = -static ++PIC_FLAGS = + + + # Library names (actual file names) +diff --git a/configs/linux-ppc-static b/configs/linux-ppc-static +index d0e1688..3f3dc55 100644 +--- a/configs/linux-ppc-static ++++ b/configs/linux-ppc-static +@@ -5,6 +5,7 @@ include $(TOP)/configs/linux-ppc + CONFIG_NAME = linux-ppc-static + + MKLIB_OPTIONS = -static ++PIC_FLAGS = + + # Library names (actual file names) + GL_LIB_NAME = libGL.a diff --git a/configs/linux-static b/configs/linux-static index 85141ea..1592668 100644 --- a/configs/linux-static @@ -5,6 +29,30 @@ index 85141ea..1592668 100644 @@ -5,6 +5,7 @@ include $(TOP)/configs/linux CONFIG_NAME = linux-static + MKLIB_OPTIONS = -static ++PIC_FLAGS = + + # Library names (actual file names) + GL_LIB_NAME = libGL.a +diff --git a/configs/linux-x86-64-static b/configs/linux-x86-64-static +index 0257430..2d0b664 100644 +--- a/configs/linux-x86-64-static ++++ b/configs/linux-x86-64-static +@@ -5,6 +5,7 @@ include $(TOP)/configs/linux-x86-64 + CONFIG_NAME = linux-x86-64-static + + MKLIB_OPTIONS = -static ++PIC_FLAGS = + + # Library names (actual file names) + GL_LIB_NAME = libGL.a +diff --git a/configs/linux-x86-static b/configs/linux-x86-static +index 9915987..e6a3696 100644 +--- a/configs/linux-x86-static ++++ b/configs/linux-x86-static +@@ -5,6 +5,7 @@ include $(TOP)/configs/linux-x86 + CONFIG_NAME = linux-x86-static + MKLIB_OPTIONS = -static +PIC_FLAGS = -- cgit v1.2.3 From e71d6dbd9ccb0ab6e0a5131569cbfc293304840f Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Mon, 8 Jan 2007 11:41:02 +0100 Subject: Make debugging symbol packages depend on the corresponding binary package and put them into the libdevel section. --- debian/changelog | 4 +++- debian/control | 9 ++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index c26edbd6be7..7d10f0d509a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,11 +8,13 @@ mesa (6.5.2-1) experimental; urgency=low * 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. [ Julien Cristau ] * Drop obsolete depends on xlibs. - -- Thierry Reding Mon, 8 Jan 2007 07:12:08 +0100 + -- Thierry Reding Mon, 8 Jan 2007 11:37:11 +0100 mesa (6.5.2~rc3-0.1) experimental; urgency=low diff --git a/debian/control b/debian/control index ddb636432df..64c64ded739 100644 --- a/debian/control +++ b/debian/control @@ -28,9 +28,10 @@ Description: A free implementation of the OpenGL API -- runtime On Linux, this library is also known as libGL or libGL.so.1. Package: libgl1-mesa-swx11-dbg -Section: libs +Section: libdevel Priority: extra Architecture: any +Depends: libgl1-mesa-swx11 (= ${binary:Version}) Conflicts: libgl1-mesa-swrast-dbg Provides: libgl1-mesa-swrast-dbg Replaces: libgl1-mesa-swrast-dbg @@ -115,9 +116,10 @@ Description: A free implementation of the OpenGL API -- GLX runtime libgl1-mesa-swx11 package. Package: libgl1-mesa-glx-dbg -Section: libs +Section: libdevel Priority: extra Architecture: any +Depends: libgl1-mesa-glx (= ${binary:Version}) Description: A free implementation of the OpenGL API -- GLX runtime -- debugging symbols 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 @@ -171,9 +173,10 @@ Description: A free implementation of the OpenGL API -- DRI modules libgl1-mesa-swx11 package. Package: libgl1-mesa-dri-dbg -Section: libs +Section: libdevel Priority: extra Architecture: any +Depends: libgl1-mesa-dri (= ${binary:Version}) Description: A free implementation of the OpenGL API -- DRI modules -- debugging symbols 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 -- cgit v1.2.3 From 4563723db1e24fe94f827783b6759586d05ff1db Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Mon, 8 Jan 2007 13:36:16 +0100 Subject: Make sure all files in the mesa-swx11-source package have permissions 0644. --- debian/scripts/install-source.sh | 3 +++ 1 file changed, 3 insertions(+) (limited to 'debian') diff --git a/debian/scripts/install-source.sh b/debian/scripts/install-source.sh index f8c92134888..bc0bcd5e34d 100755 --- a/debian/scripts/install-source.sh +++ b/debian/scripts/install-source.sh @@ -41,3 +41,6 @@ TARGET=${TOP}/debian/tmp/usr/share/mesa-source cp -lf "$x" "$TARGET/$DIRNAME" done +# fix permissions +find "$TARGET" -type f | xargs chmod 0644 + -- cgit v1.2.3 From 71d7b7dbe7e7485b401a6f578a3142fc896f0110 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Mon, 8 Jan 2007 13:36:25 +0100 Subject: Drop noop line. --- debian/patches/04_cleanup-osmesa-configs.patch | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'debian') diff --git a/debian/patches/04_cleanup-osmesa-configs.patch b/debian/patches/04_cleanup-osmesa-configs.patch index 6164e91ec30..ffc4de91fc5 100644 --- a/debian/patches/04_cleanup-osmesa-configs.patch +++ b/debian/patches/04_cleanup-osmesa-configs.patch @@ -2,14 +2,13 @@ diff --git a/configs/linux-osmesa b/configs/linux-osmesa index cc1fbbd..aabab59 100644 --- a/configs/linux-osmesa +++ b/configs/linux-osmesa -@@ -9,8 +9,18 @@ CONFIG_NAME = linux-osmesa +@@ -9,8 +9,17 @@ CONFIG_NAME = linux-osmesa # Compiler and flags CC = gcc CXX = g++ -CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DPTHREADS -CXXFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE + -+OPT_FLAGS ?= +PIC_FLAGS = -fPIC + +DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \ -- cgit v1.2.3 From 28cad2b9d94946e8990b131a3b429544b7d90191 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Wed, 10 Jan 2007 13:55:19 +0100 Subject: Bump libgl1-mesa-glx, libgl1-mesa-swx11 and libosmesa6 shlibs files. --- debian/changelog | 4 +++- debian/libgl1-mesa-glx.shlibs | 2 +- debian/libgl1-mesa-swx11.shlibs | 2 +- debian/libosmesa6.shlibs | 6 +++--- 4 files changed, 8 insertions(+), 6 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 7d10f0d509a..d138f40334e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,11 +10,13 @@ mesa (6.5.2-1) experimental; urgency=low * 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 files for the libgl1-mesa-glx, libgl1-mesa-swx11 and + libosmesa6 to account for new symbols. [ Julien Cristau ] * Drop obsolete depends on xlibs. - -- Thierry Reding Mon, 8 Jan 2007 11:37:11 +0100 + -- Thierry Reding Wed, 10 Jan 2007 13:53:11 +0100 mesa (6.5.2~rc3-0.1) experimental; urgency=low diff --git a/debian/libgl1-mesa-glx.shlibs b/debian/libgl1-mesa-glx.shlibs index b8e0fbaaaa5..0ea5280ce65 100644 --- a/debian/libgl1-mesa-glx.shlibs +++ b/debian/libgl1-mesa-glx.shlibs @@ -1 +1 @@ -libGL 1 libgl1-mesa-glx | libgl1 +libGL 1 libgl1-mesa-glx (>= 6.5.2-1) | libgl1 diff --git a/debian/libgl1-mesa-swx11.shlibs b/debian/libgl1-mesa-swx11.shlibs index b8e0fbaaaa5..e89e470d3cd 100644 --- a/debian/libgl1-mesa-swx11.shlibs +++ b/debian/libgl1-mesa-swx11.shlibs @@ -1 +1 @@ -libGL 1 libgl1-mesa-glx | libgl1 +libGL 1 libgl1-mesa-swx11 (>= 6.5.2-1) | libgl1 diff --git a/debian/libosmesa6.shlibs b/debian/libosmesa6.shlibs index 7f57882ef17..3c9ae1a14bc 100644 --- a/debian/libosmesa6.shlibs +++ b/debian/libosmesa6.shlibs @@ -1,3 +1,3 @@ -libOSMesa 6 libosmesa6 | libgl1-mesa-glide3 -libOSMesa16 6 libosmesa6 (>= 6.5.1-1) -libOSMesa32 6 libosmesa6 (>= 6.5.1-1) +libOSMesa 6 libosmesa6 (>= 6.5.2-1) | libgl1-mesa-glide3 +libOSMesa16 6 libosmesa6 (>= 6.5.2-1) +libOSMesa32 6 libosmesa6 (>= 6.5.2-1) -- cgit v1.2.3 From 01894cbf100730755768286762f8f3e69a5f7b41 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Wed, 10 Jan 2007 15:23:29 +0100 Subject: Revert the previous changes to the libgl1-mesa-{glx,swx11} shlibs. --- debian/changelog | 5 ++--- debian/libgl1-mesa-glx.shlibs | 2 +- debian/libgl1-mesa-swx11.shlibs | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index d138f40334e..770d59f3c49 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,13 +10,12 @@ mesa (6.5.2-1) experimental; urgency=low * 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 files for the libgl1-mesa-glx, libgl1-mesa-swx11 and - libosmesa6 to account for new symbols. + * Bump shlibs file for the libosmesa6 package to account for added symbols. [ Julien Cristau ] * Drop obsolete depends on xlibs. - -- Thierry Reding Wed, 10 Jan 2007 13:53:11 +0100 + -- Thierry Reding Wed, 10 Jan 2007 15:22:18 +0100 mesa (6.5.2~rc3-0.1) experimental; urgency=low diff --git a/debian/libgl1-mesa-glx.shlibs b/debian/libgl1-mesa-glx.shlibs index 0ea5280ce65..b8e0fbaaaa5 100644 --- a/debian/libgl1-mesa-glx.shlibs +++ b/debian/libgl1-mesa-glx.shlibs @@ -1 +1 @@ -libGL 1 libgl1-mesa-glx (>= 6.5.2-1) | libgl1 +libGL 1 libgl1-mesa-glx | libgl1 diff --git a/debian/libgl1-mesa-swx11.shlibs b/debian/libgl1-mesa-swx11.shlibs index e89e470d3cd..b8e0fbaaaa5 100644 --- a/debian/libgl1-mesa-swx11.shlibs +++ b/debian/libgl1-mesa-swx11.shlibs @@ -1 +1 @@ -libGL 1 libgl1-mesa-swx11 (>= 6.5.2-1) | libgl1 +libGL 1 libgl1-mesa-glx | libgl1 -- cgit v1.2.3 From 21b6ed7c29110790dd3af3e261d5b866927ab8f2 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Thu, 11 Jan 2007 14:40:10 +0100 Subject: Build the DRI modules with the default optimization flags. --- configs/debian-dri-default | 2 -- debian/changelog | 3 ++- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'debian') diff --git a/configs/debian-dri-default b/configs/debian-dri-default index 9aec9f7c6e0..f92c7eddd01 100644 --- a/configs/debian-dri-default +++ b/configs/debian-dri-default @@ -5,8 +5,6 @@ include $(TOP)/configs/debian-default CONFIG_NAME = debian-dri-default -OPT_FLAGS = -O3 -g - SRC_DIRS = glx/x11 mesa progs DRIVER_DIRS = dri PROGRAM_DIRS = xdemos diff --git a/debian/changelog b/debian/changelog index 770d59f3c49..78489ca021d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -11,11 +11,12 @@ mesa (6.5.2-1) experimental; urgency=low * 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. + * Build the DRI modules with the default optimization flags. [ Julien Cristau ] * Drop obsolete depends on xlibs. - -- Thierry Reding Wed, 10 Jan 2007 15:22:18 +0100 + -- Thierry Reding Thu, 11 Jan 2007 14:39:24 +0100 mesa (6.5.2~rc3-0.1) experimental; urgency=low -- cgit v1.2.3 From 00295242fd5277717b355e58e25e6590e2e99453 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Thu, 11 Jan 2007 14:56:48 +0100 Subject: mesa-common-dev needs to replace libgl1-mesa-swx11-dev and libgl1-mesa-dev. The GLX headers were previously shipped in both packages and have been moved to mesa-common-dev. --- debian/changelog | 4 +++- debian/control | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 78489ca021d..fc08d573b39 100644 --- a/debian/changelog +++ b/debian/changelog @@ -12,11 +12,13 @@ mesa (6.5.2-1) experimental; urgency=low and put them into the libdevel section. * Bump shlibs file for the libosmesa6 package to account for added symbols. * Build the DRI modules with the default optimization flags. + * mesa-common-dev now ships the GLX header files so it needs to replace + libgl1-mesa-swx11-dev and libgl1-mesa-dev. [ Julien Cristau ] * Drop obsolete depends on xlibs. - -- Thierry Reding Thu, 11 Jan 2007 14:39:24 +0100 + -- Thierry Reding Thu, 11 Jan 2007 14:54:17 +0100 mesa (6.5.2~rc3-0.1) experimental; urgency=low diff --git a/debian/control b/debian/control index 64c64ded739..bbf31ff3a68 100644 --- a/debian/control +++ b/debian/control @@ -232,7 +232,7 @@ Description: A free implementation of the OpenGL API -- GLX development support Package: mesa-common-dev Section: devel Architecture: all -Replaces: xlibmesa-gl-dev (<< 1:7), xlibosmesa-dev +Replaces: xlibmesa-gl-dev (<< 1:7), xlibosmesa-dev, libgl1-mesa-swx11-dev (<< 6.5.2), libgl1-mesa-dev (<< 6.5.2) Depends: libx11-dev Description: Developer documentation for Mesa This package includes the specifications for the Mesa-specific OpenGL -- cgit v1.2.3 From e5a31c00ec91080dfeea26fe1c2ee2f34798656b Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Thu, 11 Jan 2007 15:06:42 +0100 Subject: libosmesa6{,-dev} replace libgl1-mesa-swx11{,-dev} and mesa-common-dev. libosmesa6 and libosmesa6-dev are now the only packages to contain OSMesa libraries and header files so they can be installed independent of which libGL is installed. They statically link in the software rasterization code. --- debian/changelog | 5 ++++- debian/control | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index fc08d573b39..ff6499ea6f4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -14,11 +14,14 @@ mesa (6.5.2-1) experimental; urgency=low * Build the DRI modules with the default optimization flags. * mesa-common-dev now ships the GLX header files so it needs to replace libgl1-mesa-swx11-dev and libgl1-mesa-dev. + * 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. [ Julien Cristau ] * Drop obsolete depends on xlibs. - -- Thierry Reding Thu, 11 Jan 2007 14:54:17 +0100 + -- Thierry Reding Thu, 11 Jan 2007 15:03:11 +0100 mesa (6.5.2~rc3-0.1) experimental; urgency=low diff --git a/debian/control b/debian/control index bbf31ff3a68..9136540d064 100644 --- a/debian/control +++ b/debian/control @@ -243,6 +243,7 @@ Package: libosmesa6 Section: libs Architecture: any Depends: ${shlibs: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 @@ -256,7 +257,7 @@ Section: devel Architecture: any Depends: libosmesa6 (= ${binary:Version}), mesa-common-dev (= ${source:Version}) | libgl-dev Conflicts: xlibosmesa-dev, libosmesa4-dev, libosmesa-dev -Replaces: xlibosmesa-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 support files This package provides the required environment for developing programs -- cgit v1.2.3 From 6dcb9a3434ec704f1b1e1aadd4878e979854d26b Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Thu, 11 Jan 2007 15:09:23 +0100 Subject: Give credit where credit is due. --- debian/changelog | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index ff6499ea6f4..b50ee0f1102 100644 --- a/debian/changelog +++ b/debian/changelog @@ -11,17 +11,19 @@ mesa (6.5.2-1) experimental; urgency=low * 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. - * Build the DRI modules with the default optimization flags. + 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. + 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. + mesa-common-dev respectively. Thanks Julien Cristau. [ Julien Cristau ] * Drop obsolete depends on xlibs. - -- Thierry Reding Thu, 11 Jan 2007 15:03:11 +0100 + -- Thierry Reding Thu, 11 Jan 2007 15:06:52 +0100 mesa (6.5.2~rc3-0.1) experimental; urgency=low -- cgit v1.2.3 From 7549426a168f3803d6023622dd9e630a5fa2faf6 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Sun, 28 Jan 2007 18:18:38 +0100 Subject: Sync Section and Priority for all packages with the override. --- debian/changelog | 6 ++++++ debian/control | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index b50ee0f1102..d8c34be4cd6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +mesa (6.5.2-2) UNRELEASED; urgency=low + + * Sync Section/Priority for all packages with the override. + + -- Julien Cristau Sun, 28 Jan 2007 18:17:23 +0100 + mesa (6.5.2-1) experimental; urgency=low [ Thierry Reding ] diff --git a/debian/control b/debian/control index 9136540d064..91419e501ed 100644 --- a/debian/control +++ b/debian/control @@ -28,7 +28,7 @@ Description: A free implementation of the OpenGL API -- runtime On Linux, this library is also known as libGL or libGL.so.1. Package: libgl1-mesa-swx11-dbg -Section: libdevel +Section: libs Priority: extra Architecture: any Depends: libgl1-mesa-swx11 (= ${binary:Version}) @@ -157,6 +157,7 @@ Description: A free implementation of the OpenGL API -- GLX runtime -- debugging Package: libgl1-mesa-dri Section: libs +Priority: optional Architecture: any Depends: ${shlibs:Depends}, libgl1-mesa-glx (= ${binary:Version}) Conflicts: xlibmesa-dri (<< 1:7.0.0) @@ -212,7 +213,7 @@ Description: A free implementation of the OpenGL API -- DRI modules -- debugging # such as AMD Athlon/Opteron, VIA C3 Nehemiah, but not VIA C3 Ezla). Package: libgl1-mesa-dev -Section: libs +Section: libdevel Architecture: all Depends: libc6-dev, mesa-common-dev (= ${source:Version}), libgl1-mesa-glx (>= ${Source-Version}), libgl1-mesa-dri (>= ${Source-Version}) Conflicts: libgl-dev, libgl1-mesa-dri-dev -- cgit v1.2.3 From 544601e9f4093e4bc95cd9d6bcd42d78e34ad638 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Sun, 4 Feb 2007 14:05:23 +0100 Subject: Fix FTBFS on non-i386 archs. Build architecture-independant debs in binary-indep, and use the debhelper -s option for commands in binary-arch, because architectures other than i386 don't have to build libgl1-mesa-swx11-i686. --- debian/changelog | 4 +++- debian/rules | 45 +++++++++++++++++++++++++++++---------------- 2 files changed, 32 insertions(+), 17 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index d8c34be4cd6..f1b9856533c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,10 @@ mesa (6.5.2-2) UNRELEASED; 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. - -- Julien Cristau Sun, 28 Jan 2007 18:17:23 +0100 + -- Julien Cristau Sun, 4 Feb 2007 14:01:55 +0100 mesa (6.5.2-1) experimental; urgency=low diff --git a/debian/rules b/debian/rules index 7d3196ff7dc..7a7025f1f0c 100755 --- a/debian/rules +++ b/debian/rules @@ -96,30 +96,43 @@ clean: unpatch # Build architecture-independent files here. binary-indep: build install -# We have nothing to do by default. + dh_testdir + dh_testroot + dh_installchangelogs -i + dh_installdocs -i + dh_installexamples -i + dh_install --sourcedir=debian/tmp --list-missing -i + dh_installman -i + dh_link -i + dh_compress -i + dh_fixperms -i + dh_installdeb -i + dh_gencontrol -i + dh_md5sums -i + dh_builddeb -i # Build architecture-dependent files here. binary-arch: build install dh_testdir dh_testroot - dh_installchangelogs - dh_installdocs - dh_installexamples - dh_install --sourcedir=debian/tmp --list-missing - dh_installman - dh_link + dh_installchangelogs -s + dh_installdocs -s + dh_installexamples -s + dh_install --sourcedir=debian/tmp --list-missing -s + dh_installman -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 - dh_compress - dh_fixperms - dh_makeshlibs - dh_installdeb - dh_shlibdeps - dh_gencontrol - dh_md5sums - dh_builddeb + dh_strip -s + dh_compress -s + dh_fixperms -s + dh_makeshlibs -s + dh_installdeb -s + dh_shlibdeps -s + dh_gencontrol -s + dh_md5sums -s + dh_builddeb -s binary: binary-indep binary-arch .PHONY: configs build clean binary-indep binary-arch binary install configure -- cgit v1.2.3 From 10011efcd724a5bca826cfb64fa8f151a09ca417 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Sun, 4 Feb 2007 17:21:57 +0100 Subject: Add bug closer for #409638. --- debian/changelog | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index f1b9856533c..f9f9b5476ef 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,9 +2,10 @@ mesa (6.5.2-2) UNRELEASED; 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. + for commands in binary-arch, to fix FTBFS on non-i386 archs, thanks to + Marc 'HE' Brockschmidt (closes: #409638). - -- Julien Cristau Sun, 4 Feb 2007 14:01:55 +0100 + -- Julien Cristau Sun, 4 Feb 2007 17:17:50 +0100 mesa (6.5.2-1) experimental; urgency=low -- cgit v1.2.3 From 7991f7e9366bf82adffd3d0d4761f1eebd3997d9 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Sun, 4 Feb 2007 21:17:18 +0100 Subject: * Add myself to Uploaders. --- debian/changelog | 5 +++-- debian/control | 2 +- src/mesa/shader/grammar/grammar_crt.c | 0 src/mesa/shader/grammar/grammar_crt.h | 0 src/mesa/shader/shaderobjects_3dlabs.c | 0 src/mesa/shader/shaderobjects_3dlabs.h | 0 src/mesa/shader/slang/library/gc_to_bin.c | 0 src/mesa/shader/slang/library/slang_version_syn.h | 0 8 files changed, 4 insertions(+), 3 deletions(-) mode change 100755 => 100644 src/mesa/shader/grammar/grammar_crt.c mode change 100755 => 100644 src/mesa/shader/grammar/grammar_crt.h mode change 100755 => 100644 src/mesa/shader/shaderobjects_3dlabs.c mode change 100755 => 100644 src/mesa/shader/shaderobjects_3dlabs.h mode change 100755 => 100644 src/mesa/shader/slang/library/gc_to_bin.c mode change 100755 => 100644 src/mesa/shader/slang/library/slang_version_syn.h (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index f9f9b5476ef..9744a89783c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,11 +1,12 @@ -mesa (6.5.2-2) UNRELEASED; urgency=low +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 17:17:50 +0100 + -- Julien Cristau Sun, 4 Feb 2007 21:14:02 +0100 mesa (6.5.2-1) experimental; urgency=low diff --git a/debian/control b/debian/control index 91419e501ed..5ac6522abc5 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: mesa Section: graphics Priority: optional Maintainer: Debian X Strike Force -Uploaders: Thierry Reding +Uploaders: Thierry Reding , Julien Cristau Standards-Version: 3.7.2 Build-Depends: debhelper (>= 5), quilt (>= 0.40), pkg-config, libdrm-dev (>= 2.2.0) [!hurd-i386], libx11-dev, xutils-dev, x11proto-gl-dev (>= 1.4.8), libxxf86vm-dev, libexpat1-dev, lesstif2-dev, dpkg-dev (>= 1.13.19) diff --git a/src/mesa/shader/grammar/grammar_crt.c b/src/mesa/shader/grammar/grammar_crt.c old mode 100755 new mode 100644 diff --git a/src/mesa/shader/grammar/grammar_crt.h b/src/mesa/shader/grammar/grammar_crt.h old mode 100755 new mode 100644 diff --git a/src/mesa/shader/shaderobjects_3dlabs.c b/src/mesa/shader/shaderobjects_3dlabs.c old mode 100755 new mode 100644 diff --git a/src/mesa/shader/shaderobjects_3dlabs.h b/src/mesa/shader/shaderobjects_3dlabs.h old mode 100755 new mode 100644 diff --git a/src/mesa/shader/slang/library/gc_to_bin.c b/src/mesa/shader/slang/library/gc_to_bin.c old mode 100755 new mode 100644 diff --git a/src/mesa/shader/slang/library/slang_version_syn.h b/src/mesa/shader/slang/library/slang_version_syn.h old mode 100755 new mode 100644 -- cgit v1.2.3 From d39147a8a192d56798737cd254353546be2d2dbb Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Wed, 7 Feb 2007 23:13:59 +0100 Subject: Fix FTBFS on amd64. 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). --- configs/debian-default | 4 ++++ debian/changelog | 8 ++++++++ 2 files changed, 12 insertions(+) (limited to 'debian') diff --git a/configs/debian-default b/configs/debian-default index d13e5513fef..aa4721a9ee4 100644 --- a/configs/debian-default +++ b/configs/debian-default @@ -5,6 +5,10 @@ CONFIG_NAME = debian-default OPT_FLAGS = -O2 -g CFLAGS += -fno-strict-aliasing +# override settings in configs/linux-x86-64 +LIB_DIR = lib +EXTRA_LIB_PATH = + SRC_DIRS = mesa PROGRAM_DIRS = diff --git a/debian/changelog b/debian/changelog index 9744a89783c..e9446fec73f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +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. -- cgit v1.2.3 From 30f6fe0710a885bac1b573601eb2c3f4da5d9876 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Fri, 30 Mar 2007 14:10:24 +0200 Subject: Have libgl1-mesa-dri suggest libglide3. Add explanation for this in the package description. Closes: #387339. --- debian/changelog | 7 +++++++ debian/control | 4 ++++ 2 files changed, 11 insertions(+) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index e9446fec73f..608d8347e77 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +mesa (6.5.2-4) UNRELEASED; urgency=low + + * debian/control: libgl1-mesa-dri now suggests libglide3, with an + explanation in the description (closes: #387339). + + -- Julien Cristau Fri, 30 Mar 2007 14:06:44 +0200 + mesa (6.5.2-3) experimental; urgency=low * Set LIB_DIR and EXTRA_LIB_PATH in configs/debian-default to override diff --git a/debian/control b/debian/control index 5ac6522abc5..a879d7bfe74 100644 --- a/debian/control +++ b/debian/control @@ -160,6 +160,7 @@ Section: libs Priority: optional Architecture: any Depends: ${shlibs:Depends}, libgl1-mesa-glx (= ${binary:Version}) +Suggests: libglide3 Conflicts: xlibmesa-dri (<< 1:7.0.0) Replaces: xlibmesa-dri (<< 1:7.0.0) Description: A free implementation of the OpenGL API -- DRI modules @@ -172,6 +173,9 @@ Description: A free implementation of the OpenGL API -- DRI modules . For a complete description of Mesa, please look at the libgl1-mesa-swx11 package. + . + The tdfx DRI module uses libglide3 if available to provide better performance, + so installing that package is useful for users of tdfx hardware. Package: libgl1-mesa-dri-dbg Section: libdevel -- cgit v1.2.3 From 12e3f97541efa727984be1d89b6290a168d7252a Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Fri, 30 Mar 2007 17:20:02 +0200 Subject: Fix explanation about libglide3 in libgl1-mesa-dri's description. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Thanks to Michel Dänzer for his help. --- debian/control | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'debian') diff --git a/debian/control b/debian/control index a879d7bfe74..16a6ebb73d2 100644 --- a/debian/control +++ b/debian/control @@ -174,8 +174,7 @@ Description: A free implementation of the OpenGL API -- DRI modules For a complete description of Mesa, please look at the libgl1-mesa-swx11 package. . - The tdfx DRI module uses libglide3 if available to provide better performance, - so installing that package is useful for users of tdfx hardware. + The tdfx DRI module needs libglide3 to enable direct rendering. Package: libgl1-mesa-dri-dbg Section: libdevel -- cgit v1.2.3 From 856ae782c7a924d7cf91fadb107f1b30461a9137 Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Sat, 31 Mar 2007 03:28:32 +0200 Subject: * 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). --- debian/changelog | 8 +++++++- debian/control | 40 ++++++++++++++++++++++++++++++------ debian/libgl1-mesa-swx11-dev.install | 2 -- debian/libglw1-mesa-dev.install | 3 +++ debian/libglw1-mesa.install | 1 + 5 files changed, 45 insertions(+), 9 deletions(-) create mode 100644 debian/libglw1-mesa-dev.install create mode 100644 debian/libglw1-mesa.install (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 608d8347e77..1ece9610261 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,15 @@ mesa (6.5.2-4) UNRELEASED; urgency=low + [ Julien Cristau ] * debian/control: libgl1-mesa-dri now suggests libglide3, with an explanation in the description (closes: #387339). - -- Julien Cristau Fri, 30 Mar 2007 14:06:44 +0200 + [ 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). + + -- Brice Goglin Fri, 30 Mar 2007 19:44:53 +0200 mesa (6.5.2-3) experimental; urgency=low diff --git a/debian/control b/debian/control index 16a6ebb73d2..8400b0414ae 100644 --- a/debian/control +++ b/debian/control @@ -80,7 +80,7 @@ Package: libgl1-mesa-swx11-dev Section: libdevel Architecture: any Depends: libgl1-mesa-swx11 (= ${binary:Version}), libc6-dev, libx11-dev, libxext6, mesa-common-dev (= ${source:Version}) -Provides: libgl-dev, mesag3-widgets, mesag-widgets-dev, libglw-dev, mesag-dev, libgl1-mesa-swrast-dev +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 support files @@ -88,11 +88,6 @@ Description: A free implementation of the OpenGL API -- development support file compiling programs with Mesa. For a complete description of Mesa, please look at the libgl1-mesa-swx11 package. . - This package also provides a simple 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. - . 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. @@ -303,6 +298,39 @@ Description: The OpenGL utility library -- development support files For a complete description of GLU, please look at the libglu1-mesa package. +Package: libglw1-mesa +Section: libs +Architecture: any +Depends: ${shlibs:Depends} +Conflicts: libgl1-mesa-swx11 (<< 6.5.2-4) +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}), libc6-dev, libx11-dev, libxext6, mesa-common-dev (= ${source:Version}) +Provides: mesag3-widgets, mesag-widgets-dev, libglw-dev +Conflicts: libgl1-mesa-swx11-dev (<< 6.5.2-4) +Replaces: libglw-dev +Description: A free implementation of the OpenGL API -- development support 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. + Package: mesa-swx11-source Section: libdevel Architecture: all diff --git a/debian/libgl1-mesa-swx11-dev.install b/debian/libgl1-mesa-swx11-dev.install index 86f5b3e4cb1..f353c5923d6 100644 --- a/debian/libgl1-mesa-swx11-dev.install +++ b/debian/libgl1-mesa-swx11-dev.install @@ -1,4 +1,2 @@ -usr/include/GL/GLw*A.h usr/lib/libGL.a usr/lib/libGL.so -usr/lib/libGLw.a diff --git a/debian/libglw1-mesa-dev.install b/debian/libglw1-mesa-dev.install new file mode 100644 index 00000000000..7c03280c337 --- /dev/null +++ b/debian/libglw1-mesa-dev.install @@ -0,0 +1,3 @@ +usr/include/GL/GLw*A.h +usr/lib/libGLw.a +usr/lib/libGLw.so diff --git a/debian/libglw1-mesa.install b/debian/libglw1-mesa.install new file mode 100644 index 00000000000..9d299c81a51 --- /dev/null +++ b/debian/libglw1-mesa.install @@ -0,0 +1 @@ +usr/lib/libGLw.so.* -- cgit v1.2.3 From 048144074b54d15b3f514452c0fe7c72cba31a53 Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Sun, 1 Apr 2007 00:43:20 +0200 Subject: Fix conflicts for libGLw packages. libglw1-mesa does not have to conflict with earlier libgl1-mesa-swx11 (libGLw was only shipped as development libs/headers within swx11-dev). libglw1-mesa-dev needs to conflicts with libglw-dev. --- debian/control | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'debian') diff --git a/debian/control b/debian/control index 8400b0414ae..c6f0de3d584 100644 --- a/debian/control +++ b/debian/control @@ -302,7 +302,6 @@ Package: libglw1-mesa Section: libs Architecture: any Depends: ${shlibs:Depends} -Conflicts: libgl1-mesa-swx11 (<< 6.5.2-4) 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 @@ -322,7 +321,7 @@ Section: libdevel Architecture: any Depends: libglw1-mesa (= ${binary:Version}), libc6-dev, libx11-dev, libxext6, mesa-common-dev (= ${source:Version}) Provides: mesag3-widgets, mesag-widgets-dev, libglw-dev -Conflicts: libgl1-mesa-swx11-dev (<< 6.5.2-4) +Conflicts: libglw-dev, libgl1-mesa-swx11-dev (<< 6.5.2-4) Replaces: libglw-dev Description: A free implementation of the OpenGL API -- development support files This package provides the development environment required for -- cgit v1.2.3 From 285ed128abf8f08cc98f1e846082cc7d32be11e7 Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Sun, 1 Apr 2007 00:44:29 +0200 Subject: Add a .shlibs file for libglw1-mesa. --- debian/libglw1-mesa.shlibs | 1 + 1 file changed, 1 insertion(+) create mode 100644 debian/libglw1-mesa.shlibs (limited to 'debian') diff --git a/debian/libglw1-mesa.shlibs b/debian/libglw1-mesa.shlibs new file mode 100644 index 00000000000..488d4da327f --- /dev/null +++ b/debian/libglw1-mesa.shlibs @@ -0,0 +1 @@ +libGLw 1 libglw1-mesa | libglw1 -- cgit v1.2.3 From 3832ecadae815bd59e03c55c3431e6565491a9e0 Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Sun, 8 Apr 2007 18:52:31 +0200 Subject: Add 06_fix_texture_data_corruption.patch (closes: #412346) --- debian/changelog | 1 + .../patches/06_fix_texture_data_corruption.patch | 23 ++++++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 25 insertions(+) create mode 100644 debian/patches/06_fix_texture_data_corruption.patch (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 1ece9610261..8598ffe93c8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,6 +8,7 @@ mesa (6.5.2-4) UNRELEASED; urgency=low * 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). + * Add 06_fix_texture_data_corruption.patch (closes: #412346). -- Brice Goglin Fri, 30 Mar 2007 19:44:53 +0200 diff --git a/debian/patches/06_fix_texture_data_corruption.patch b/debian/patches/06_fix_texture_data_corruption.patch new file mode 100644 index 00000000000..5bca17af5a4 --- /dev/null +++ b/debian/patches/06_fix_texture_data_corruption.patch @@ -0,0 +1,23 @@ +From: Michel Dänzer +Date: Thu, 14 Dec 2006 09:01:43 +0000 (+0100) +Subject: _mesa_swizzle_ubyte_image: Only use single swizzle_copy call when strides match. +X-Git-Url: http://gitweb.freedesktop.org/?p=mesa/mesa.git;a=commitdiff;h=9c09259b8bef8f120cc6f4bb1a44f0eae37d71b3 + +_mesa_swizzle_ubyte_image: Only use single swizzle_copy call when strides match. + +This fixes texture data corruption with glTexSubimage (and probably glTexImage +under some circumstances) with the texstore swizzle path. +--- + +--- a/src/mesa/main/texstore.c ++++ b/src/mesa/main/texstore.c +@@ -808,7 +808,8 @@ _mesa_swizzle_ubyte_image(GLcontext *ctx + + /* _mesa_printf("map %d %d %d %d\n", map[0], map[1], map[2], map[3]); */ + +- if (srcRowStride == srcWidth * srcComponents && ++ if (srcRowStride == dstRowStride && ++ srcRowStride == srcWidth * srcComponents && + dimensions < 3) { + /* 1 and 2D images only */ + GLubyte *dstImage = (GLubyte *) dstAddr diff --git a/debian/patches/series b/debian/patches/series index 280a2f3548e..e4a761e6237 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -4,3 +4,4 @@ 03_optional-progs-and-install.patch 04_cleanup-osmesa-configs.patch 05_static-nonpic.patch +06_fix_texture_data_corruption.patch -- cgit v1.2.3 From 04c002abc2ae6f69fe2ae36636247f62f61f0969 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Fri, 20 Apr 2007 05:53:59 +0200 Subject: Revert "Fix conflicts for libGLw packages." This reverts commit 048144074b54d15b3f514452c0fe7c72cba31a53. --- debian/control | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'debian') diff --git a/debian/control b/debian/control index c6f0de3d584..8400b0414ae 100644 --- a/debian/control +++ b/debian/control @@ -302,6 +302,7 @@ Package: libglw1-mesa Section: libs Architecture: any Depends: ${shlibs:Depends} +Conflicts: libgl1-mesa-swx11 (<< 6.5.2-4) 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 @@ -321,7 +322,7 @@ Section: libdevel Architecture: any Depends: libglw1-mesa (= ${binary:Version}), libc6-dev, libx11-dev, libxext6, mesa-common-dev (= ${source:Version}) Provides: mesag3-widgets, mesag-widgets-dev, libglw-dev -Conflicts: libglw-dev, libgl1-mesa-swx11-dev (<< 6.5.2-4) +Conflicts: libgl1-mesa-swx11-dev (<< 6.5.2-4) Replaces: libglw-dev Description: A free implementation of the OpenGL API -- development support files This package provides the development environment required for -- cgit v1.2.3 From f4cc159f532a1a4b9b394019393c7ca9e5603e26 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Fri, 20 Apr 2007 05:55:04 +0200 Subject: Revert " * Split out libGLw libs and headers from libgl1-mesa-swx11 and ship both" This reverts commit 856ae782c7a924d7cf91fadb107f1b30461a9137. Conflicts: debian/changelog --- debian/changelog | 6 +----- debian/control | 40 ++++++------------------------------ debian/libgl1-mesa-swx11-dev.install | 2 ++ debian/libglw1-mesa-dev.install | 3 --- debian/libglw1-mesa.install | 1 - 5 files changed, 9 insertions(+), 43 deletions(-) delete mode 100644 debian/libglw1-mesa-dev.install delete mode 100644 debian/libglw1-mesa.install (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 8598ffe93c8..395422bea08 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,16 +1,12 @@ mesa (6.5.2-4) UNRELEASED; urgency=low - [ Julien Cristau ] * debian/control: libgl1-mesa-dri now suggests libglide3, with an explanation in the description (closes: #387339). [ 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). * Add 06_fix_texture_data_corruption.patch (closes: #412346). - -- Brice Goglin Fri, 30 Mar 2007 19:44:53 +0200 + -- Julien Cristau Fri, 30 Mar 2007 14:06:44 +0200 mesa (6.5.2-3) experimental; urgency=low diff --git a/debian/control b/debian/control index 8400b0414ae..16a6ebb73d2 100644 --- a/debian/control +++ b/debian/control @@ -80,7 +80,7 @@ Package: libgl1-mesa-swx11-dev Section: libdevel Architecture: any Depends: libgl1-mesa-swx11 (= ${binary:Version}), libc6-dev, libx11-dev, libxext6, mesa-common-dev (= ${source:Version}) -Provides: libgl-dev, mesag-dev, libgl1-mesa-swrast-dev +Provides: libgl-dev, mesag3-widgets, mesag-widgets-dev, libglw-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 support files @@ -88,6 +88,11 @@ Description: A free implementation of the OpenGL API -- development support file compiling programs with Mesa. For a complete description of Mesa, please look at the libgl1-mesa-swx11 package. . + This package also provides a simple 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. + . 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. @@ -298,39 +303,6 @@ Description: The OpenGL utility library -- development support files For a complete description of GLU, please look at the libglu1-mesa package. -Package: libglw1-mesa -Section: libs -Architecture: any -Depends: ${shlibs:Depends} -Conflicts: libgl1-mesa-swx11 (<< 6.5.2-4) -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}), libc6-dev, libx11-dev, libxext6, mesa-common-dev (= ${source:Version}) -Provides: mesag3-widgets, mesag-widgets-dev, libglw-dev -Conflicts: libgl1-mesa-swx11-dev (<< 6.5.2-4) -Replaces: libglw-dev -Description: A free implementation of the OpenGL API -- development support 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. - Package: mesa-swx11-source Section: libdevel Architecture: all diff --git a/debian/libgl1-mesa-swx11-dev.install b/debian/libgl1-mesa-swx11-dev.install index f353c5923d6..86f5b3e4cb1 100644 --- a/debian/libgl1-mesa-swx11-dev.install +++ b/debian/libgl1-mesa-swx11-dev.install @@ -1,2 +1,4 @@ +usr/include/GL/GLw*A.h usr/lib/libGL.a usr/lib/libGL.so +usr/lib/libGLw.a diff --git a/debian/libglw1-mesa-dev.install b/debian/libglw1-mesa-dev.install deleted file mode 100644 index 7c03280c337..00000000000 --- a/debian/libglw1-mesa-dev.install +++ /dev/null @@ -1,3 +0,0 @@ -usr/include/GL/GLw*A.h -usr/lib/libGLw.a -usr/lib/libGLw.so diff --git a/debian/libglw1-mesa.install b/debian/libglw1-mesa.install deleted file mode 100644 index 9d299c81a51..00000000000 --- a/debian/libglw1-mesa.install +++ /dev/null @@ -1 +0,0 @@ -usr/lib/libGLw.so.* -- cgit v1.2.3 From 6c0fba2480fa53fbb9cacb492143d39504441b6d Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Fri, 20 Apr 2007 05:58:00 +0200 Subject: Prepare changelog for upload. --- debian/changelog | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 395422bea08..c96993c2f5d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,12 +1,14 @@ -mesa (6.5.2-4) UNRELEASED; urgency=low +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, 30 Mar 2007 14:06:44 +0200 + -- Julien Cristau Fri, 20 Apr 2007 05:57:35 +0200 mesa (6.5.2-3) experimental; urgency=low -- cgit v1.2.3 From e219bf8338ae31ddc4f5f02e088237d6cd5555a9 Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Fri, 20 Apr 2007 18:44:59 +0200 Subject: Add 07_call_radeonSetCliprects_from_radeonMakeCurrent.patch --- debian/changelog | 7 +++ ...radeonSetCliprects_from_radeonMakeCurrent.patch | 56 ++++++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 64 insertions(+) create mode 100644 debian/patches/07_call_radeonSetCliprects_from_radeonMakeCurrent.patch (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index c96993c2f5d..a1a5747de5c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +mesa (6.5.2-5) UNRELEASED; urgency=low + + * Add 07_call_radeonSetCliprects_from_radeonMakeCurrent.patch + (closes: #420164). Thanks to Christian Ohm. + + -- Brice Goglin Fri, 20 Apr 2007 18:36:51 +0200 + mesa (6.5.2-4) unstable; urgency=low [ Julien Cristau ] diff --git a/debian/patches/07_call_radeonSetCliprects_from_radeonMakeCurrent.patch b/debian/patches/07_call_radeonSetCliprects_from_radeonMakeCurrent.patch new file mode 100644 index 00000000000..08f8f70bf9f --- /dev/null +++ b/debian/patches/07_call_radeonSetCliprects_from_radeonMakeCurrent.patch @@ -0,0 +1,56 @@ +From: Michel Dänzer +Date: Tue, 6 Mar 2007 12:22:35 +0000 (+0100) +Subject: r300: Call radeonSetCliprects from radeonMakeCurrent. +X-Git-Url: http://gitweb.freedesktop.org/?p=mesa/mesa.git;a=commitdiff;h=6f9b1afc862851532e4820705c412388b497ad58 + +r300: Call radeonSetCliprects from radeonMakeCurrent. + +Based on a patch by Panagiotis Papadakos. + +Among other things, this makes sure the framebuffer object associated with the +drawable has the correct size when _mesa_make_current is called, so the default +viewport is set up correctly. + +Also update radeon->lastStamp in radeonSetCliprects. +--- + +--- a/src/mesa/drivers/dri/r300/radeon_context.c ++++ b/src/mesa/drivers/dri/r300/radeon_context.c +@@ -51,6 +51,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DE + #include "radeon_macros.h" + #include "radeon_reg.h" + ++#include "radeon_state.h" + #include "r300_state.h" + + #include "utils.h" +@@ -279,6 +280,8 @@ GLboolean radeonMakeCurrent(__DRIcontext + + r300UpdateWindow(radeon->glCtx); + r300UpdateViewportOffset(radeon->glCtx); ++ ++ radeonSetCliprects(radeon); + } + + _mesa_make_current(radeon->glCtx, +--- a/src/mesa/drivers/dri/r300/radeon_lock.c ++++ b/src/mesa/drivers/dri/r300/radeon_lock.c +@@ -90,7 +90,6 @@ static void r300RegainedLock(radeonConte + #else + radeonUpdateScissor(radeon->glCtx); + #endif +- radeon->lastStamp = drawable->lastStamp; + } + + if (sarea->ctx_owner != radeon->dri.hwContext) { +--- a/src/mesa/drivers/dri/r300/radeon_state.c ++++ b/src/mesa/drivers/dri/r300/radeon_state.c +@@ -185,6 +185,8 @@ void radeonSetCliprects(radeonContextPtr + + if (radeon->state.scissor.enabled) + radeonRecalcScissorRects(radeon); ++ ++ radeon->lastStamp = drawable->lastStamp; + } + + diff --git a/debian/patches/series b/debian/patches/series index e4a761e6237..6bb18942ac9 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -5,3 +5,4 @@ 04_cleanup-osmesa-configs.patch 05_static-nonpic.patch 06_fix_texture_data_corruption.patch +07_call_radeonSetCliprects_from_radeonMakeCurrent.patch -- cgit v1.2.3 From 0d830a616cb7e71504d97f4b1c130622e10286e5 Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Fri, 20 Apr 2007 18:53:47 +0200 Subject: Add 08_r300_update_window_state_when_bound_but_stamp_changed.patch --- debian/changelog | 1 + ...window_state_when_bound_but_stamp_changed.patch | 35 ++++++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 37 insertions(+) create mode 100644 debian/patches/08_r300_update_window_state_when_bound_but_stamp_changed.patch (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index a1a5747de5c..86f90032852 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,7 @@ mesa (6.5.2-5) UNRELEASED; urgency=low * 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 -- Brice Goglin Fri, 20 Apr 2007 18:36:51 +0200 diff --git a/debian/patches/08_r300_update_window_state_when_bound_but_stamp_changed.patch b/debian/patches/08_r300_update_window_state_when_bound_but_stamp_changed.patch new file mode 100644 index 00000000000..8bf8db683f6 --- /dev/null +++ b/debian/patches/08_r300_update_window_state_when_bound_but_stamp_changed.patch @@ -0,0 +1,35 @@ +From: Michel Dänzer +Date: Fri, 9 Mar 2007 08:43:17 +0000 (+0100) +Subject: r300: Also update window state when it's already bound but its stamp changed. +X-Git-Url: http://gitweb.freedesktop.org/?p=mesa/mesa.git;a=commitdiff;h=4d9901a1cab8e0d55b1b2309cf3ffec235e53149 + +r300: Also update window state when it's already bound but its stamp changed. + +And set new cliprects before deriving other state from them. This ensures +cliprects aren't accessed after having been freed. + +Thanks to Panagiotis Papadakos for testing various iterations of this. +--- + +--- a/src/mesa/drivers/dri/r300/radeon_context.c ++++ b/src/mesa/drivers/dri/r300/radeon_context.c +@@ -273,15 +273,15 @@ GLboolean radeonMakeCurrent(__DRIcontext + &radeon->vbl_seq); + } + ++ radeon->dri.readable = driReadPriv; ++ + if (radeon->dri.drawable != driDrawPriv || +- radeon->dri.readable != driReadPriv) { ++ radeon->lastStamp != driDrawPriv->lastStamp) { + radeon->dri.drawable = driDrawPriv; +- radeon->dri.readable = driReadPriv; + ++ radeonSetCliprects(radeon); + r300UpdateWindow(radeon->glCtx); + r300UpdateViewportOffset(radeon->glCtx); +- +- radeonSetCliprects(radeon); + } + + _mesa_make_current(radeon->glCtx, diff --git a/debian/patches/series b/debian/patches/series index 6bb18942ac9..56f3fe8fa06 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -6,3 +6,4 @@ 05_static-nonpic.patch 06_fix_texture_data_corruption.patch 07_call_radeonSetCliprects_from_radeonMakeCurrent.patch +08_r300_update_window_state_when_bound_but_stamp_changed.patch -- cgit v1.2.3 From 47c3c706e84ac34fc7af1fd8c0d74929aeb6bcaa Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Sat, 21 Apr 2007 18:00:12 +0200 Subject: Add 09_i915_always_enable_pixel_fog.patch --- debian/changelog | 1 + .../patches/09_i915_always_enable_pixel_fog.patch | 31 ++++++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 33 insertions(+) create mode 100644 debian/patches/09_i915_always_enable_pixel_fog.patch (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 86f90032852..16ffae91cc6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,7 @@ mesa (6.5.2-5) UNRELEASED; urgency=low * 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 -- Brice Goglin Fri, 20 Apr 2007 18:36:51 +0200 diff --git a/debian/patches/09_i915_always_enable_pixel_fog.patch b/debian/patches/09_i915_always_enable_pixel_fog.patch new file mode 100644 index 00000000000..d1056487051 --- /dev/null +++ b/debian/patches/09_i915_always_enable_pixel_fog.patch @@ -0,0 +1,31 @@ +From: Zou Nan hai +Date: Fri, 2 Feb 2007 01:35:17 +0000 (+0800) +Subject: Fix fd.o #9686, when fall into vertex fog, +X-Git-Url: http://gitweb.freedesktop.org/?p=mesa/mesa.git;a=commitdiff;h=2dfb3a217f730d6783fb2ac8b73248dc682f923c + + Fix fd.o #9686, when fall into vertex fog, + fog factors are precomputed in t_vb_fog.c compute_fog_blend_factors, + which is incompatible with appended fragment fog code. + That will make GoogleEarth display abnormally. + always use pixel fog. +--- + +--- a/src/mesa/drivers/dri/i915/i915_state.c ++++ b/src/mesa/drivers/dri/i915/i915_state.c +@@ -611,10 +611,12 @@ void i915_update_fog( GLcontext *ctx ) + i915->state.Ctx[I915_CTXREG_LIS5] &= ~S5_FOG_ENABLE; + } + +- if (enabled) { +- _tnl_allow_vertex_fog( ctx, (i915->vertex_fog == I915_FOG_VERTEX) ); +- _tnl_allow_pixel_fog( ctx, (i915->vertex_fog != I915_FOG_VERTEX) ); +- } ++ /* always enbale pixel fog ++ * vertex fog use precaculted fog coord will conflict with appended ++ * fog program ++ */ ++ _tnl_allow_vertex_fog( ctx, 0 ); ++ _tnl_allow_pixel_fog( ctx, 1 ); + } + + static void i915Fogfv(GLcontext *ctx, GLenum pname, const GLfloat *param) diff --git a/debian/patches/series b/debian/patches/series index 56f3fe8fa06..f8249980eff 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -7,3 +7,4 @@ 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 -- cgit v1.2.3 From 031b539a09ab70536ca15c1beeb73b6467c4610a Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Sat, 31 Mar 2007 03:28:32 +0200 Subject: Split out libGLw libs and headers from libgl1-mesa-swx11. Ship both static and shared libraries for libGLw, creating libglw1-mesa and libglw1-mesa-dev (closes: #374904). --- debian/changelog | 9 ++++++++ debian/control | 40 ++++++++++++++++++++++++++++++------ debian/libgl1-mesa-swx11-dev.install | 2 -- debian/libglw1-mesa-dev.install | 3 +++ debian/libglw1-mesa.install | 1 + 5 files changed, 47 insertions(+), 8 deletions(-) create mode 100644 debian/libglw1-mesa-dev.install create mode 100644 debian/libglw1-mesa.install (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 16ffae91cc6..4d0e3bfe251 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +mesa (6.5.3~rc1-1) UNRELEASED; 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). + + -- Brice Goglin Fri, 30 Mar 2007 19:44:53 +0200 + mesa (6.5.2-5) UNRELEASED; urgency=low * Add 07_call_radeonSetCliprects_from_radeonMakeCurrent.patch diff --git a/debian/control b/debian/control index 16a6ebb73d2..8400b0414ae 100644 --- a/debian/control +++ b/debian/control @@ -80,7 +80,7 @@ Package: libgl1-mesa-swx11-dev Section: libdevel Architecture: any Depends: libgl1-mesa-swx11 (= ${binary:Version}), libc6-dev, libx11-dev, libxext6, mesa-common-dev (= ${source:Version}) -Provides: libgl-dev, mesag3-widgets, mesag-widgets-dev, libglw-dev, mesag-dev, libgl1-mesa-swrast-dev +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 support files @@ -88,11 +88,6 @@ Description: A free implementation of the OpenGL API -- development support file compiling programs with Mesa. For a complete description of Mesa, please look at the libgl1-mesa-swx11 package. . - This package also provides a simple 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. - . 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. @@ -303,6 +298,39 @@ Description: The OpenGL utility library -- development support files For a complete description of GLU, please look at the libglu1-mesa package. +Package: libglw1-mesa +Section: libs +Architecture: any +Depends: ${shlibs:Depends} +Conflicts: libgl1-mesa-swx11 (<< 6.5.2-4) +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}), libc6-dev, libx11-dev, libxext6, mesa-common-dev (= ${source:Version}) +Provides: mesag3-widgets, mesag-widgets-dev, libglw-dev +Conflicts: libgl1-mesa-swx11-dev (<< 6.5.2-4) +Replaces: libglw-dev +Description: A free implementation of the OpenGL API -- development support 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. + Package: mesa-swx11-source Section: libdevel Architecture: all diff --git a/debian/libgl1-mesa-swx11-dev.install b/debian/libgl1-mesa-swx11-dev.install index 86f5b3e4cb1..f353c5923d6 100644 --- a/debian/libgl1-mesa-swx11-dev.install +++ b/debian/libgl1-mesa-swx11-dev.install @@ -1,4 +1,2 @@ -usr/include/GL/GLw*A.h usr/lib/libGL.a usr/lib/libGL.so -usr/lib/libGLw.a diff --git a/debian/libglw1-mesa-dev.install b/debian/libglw1-mesa-dev.install new file mode 100644 index 00000000000..7c03280c337 --- /dev/null +++ b/debian/libglw1-mesa-dev.install @@ -0,0 +1,3 @@ +usr/include/GL/GLw*A.h +usr/lib/libGLw.a +usr/lib/libGLw.so diff --git a/debian/libglw1-mesa.install b/debian/libglw1-mesa.install new file mode 100644 index 00000000000..9d299c81a51 --- /dev/null +++ b/debian/libglw1-mesa.install @@ -0,0 +1 @@ +usr/lib/libGLw.so.* -- cgit v1.2.3 From 5ee9b3ce729c41dff80dc7ee2db8fdc30585c9e2 Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Sun, 1 Apr 2007 00:43:20 +0200 Subject: Fix conflicts for libGLw packages. libglw1-mesa does not have to conflict with earlier libgl1-mesa-swx11 (libGLw was only shipped as development libs/headers within swx11-dev). libglw1-mesa-dev needs to conflicts with libglw-dev. --- debian/control | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'debian') diff --git a/debian/control b/debian/control index 8400b0414ae..c6f0de3d584 100644 --- a/debian/control +++ b/debian/control @@ -302,7 +302,6 @@ Package: libglw1-mesa Section: libs Architecture: any Depends: ${shlibs:Depends} -Conflicts: libgl1-mesa-swx11 (<< 6.5.2-4) 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 @@ -322,7 +321,7 @@ Section: libdevel Architecture: any Depends: libglw1-mesa (= ${binary:Version}), libc6-dev, libx11-dev, libxext6, mesa-common-dev (= ${source:Version}) Provides: mesag3-widgets, mesag-widgets-dev, libglw-dev -Conflicts: libgl1-mesa-swx11-dev (<< 6.5.2-4) +Conflicts: libglw-dev, libgl1-mesa-swx11-dev (<< 6.5.2-4) Replaces: libglw-dev Description: A free implementation of the OpenGL API -- development support files This package provides the development environment required for -- cgit v1.2.3 From d79e80a3d0597444528251d7d9362b2a6eab187c Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Sat, 21 Apr 2007 20:47:01 +0200 Subject: New upstream release candidate. Drop patches included upstream. --- debian/changelog | 9 +++- .../patches/06_fix_texture_data_corruption.patch | 23 --------- ...radeonSetCliprects_from_radeonMakeCurrent.patch | 56 ---------------------- ...window_state_when_bound_but_stamp_changed.patch | 35 -------------- .../patches/09_i915_always_enable_pixel_fog.patch | 31 ------------ debian/patches/series | 4 -- 6 files changed, 8 insertions(+), 150 deletions(-) delete mode 100644 debian/patches/06_fix_texture_data_corruption.patch delete mode 100644 debian/patches/07_call_radeonSetCliprects_from_radeonMakeCurrent.patch delete mode 100644 debian/patches/08_r300_update_window_state_when_bound_but_stamp_changed.patch delete mode 100644 debian/patches/09_i915_always_enable_pixel_fog.patch (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 4d0e3bfe251..d038f8d825c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,7 +5,14 @@ mesa (6.5.3~rc1-1) UNRELEASED; urgency=low static and shared libraries, creating libglw1-mesa and libglw1-mesa-dev (closes: #374904). - -- Brice Goglin Fri, 30 Mar 2007 19:44:53 +0200 + [ 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. + + -- Julien Cristau Sat, 21 Apr 2007 20:43:43 +0200 mesa (6.5.2-5) UNRELEASED; urgency=low diff --git a/debian/patches/06_fix_texture_data_corruption.patch b/debian/patches/06_fix_texture_data_corruption.patch deleted file mode 100644 index 5bca17af5a4..00000000000 --- a/debian/patches/06_fix_texture_data_corruption.patch +++ /dev/null @@ -1,23 +0,0 @@ -From: Michel Dänzer -Date: Thu, 14 Dec 2006 09:01:43 +0000 (+0100) -Subject: _mesa_swizzle_ubyte_image: Only use single swizzle_copy call when strides match. -X-Git-Url: http://gitweb.freedesktop.org/?p=mesa/mesa.git;a=commitdiff;h=9c09259b8bef8f120cc6f4bb1a44f0eae37d71b3 - -_mesa_swizzle_ubyte_image: Only use single swizzle_copy call when strides match. - -This fixes texture data corruption with glTexSubimage (and probably glTexImage -under some circumstances) with the texstore swizzle path. ---- - ---- a/src/mesa/main/texstore.c -+++ b/src/mesa/main/texstore.c -@@ -808,7 +808,8 @@ _mesa_swizzle_ubyte_image(GLcontext *ctx - - /* _mesa_printf("map %d %d %d %d\n", map[0], map[1], map[2], map[3]); */ - -- if (srcRowStride == srcWidth * srcComponents && -+ if (srcRowStride == dstRowStride && -+ srcRowStride == srcWidth * srcComponents && - dimensions < 3) { - /* 1 and 2D images only */ - GLubyte *dstImage = (GLubyte *) dstAddr diff --git a/debian/patches/07_call_radeonSetCliprects_from_radeonMakeCurrent.patch b/debian/patches/07_call_radeonSetCliprects_from_radeonMakeCurrent.patch deleted file mode 100644 index 08f8f70bf9f..00000000000 --- a/debian/patches/07_call_radeonSetCliprects_from_radeonMakeCurrent.patch +++ /dev/null @@ -1,56 +0,0 @@ -From: Michel Dänzer -Date: Tue, 6 Mar 2007 12:22:35 +0000 (+0100) -Subject: r300: Call radeonSetCliprects from radeonMakeCurrent. -X-Git-Url: http://gitweb.freedesktop.org/?p=mesa/mesa.git;a=commitdiff;h=6f9b1afc862851532e4820705c412388b497ad58 - -r300: Call radeonSetCliprects from radeonMakeCurrent. - -Based on a patch by Panagiotis Papadakos. - -Among other things, this makes sure the framebuffer object associated with the -drawable has the correct size when _mesa_make_current is called, so the default -viewport is set up correctly. - -Also update radeon->lastStamp in radeonSetCliprects. ---- - ---- a/src/mesa/drivers/dri/r300/radeon_context.c -+++ b/src/mesa/drivers/dri/r300/radeon_context.c -@@ -51,6 +51,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DE - #include "radeon_macros.h" - #include "radeon_reg.h" - -+#include "radeon_state.h" - #include "r300_state.h" - - #include "utils.h" -@@ -279,6 +280,8 @@ GLboolean radeonMakeCurrent(__DRIcontext - - r300UpdateWindow(radeon->glCtx); - r300UpdateViewportOffset(radeon->glCtx); -+ -+ radeonSetCliprects(radeon); - } - - _mesa_make_current(radeon->glCtx, ---- a/src/mesa/drivers/dri/r300/radeon_lock.c -+++ b/src/mesa/drivers/dri/r300/radeon_lock.c -@@ -90,7 +90,6 @@ static void r300RegainedLock(radeonConte - #else - radeonUpdateScissor(radeon->glCtx); - #endif -- radeon->lastStamp = drawable->lastStamp; - } - - if (sarea->ctx_owner != radeon->dri.hwContext) { ---- a/src/mesa/drivers/dri/r300/radeon_state.c -+++ b/src/mesa/drivers/dri/r300/radeon_state.c -@@ -185,6 +185,8 @@ void radeonSetCliprects(radeonContextPtr - - if (radeon->state.scissor.enabled) - radeonRecalcScissorRects(radeon); -+ -+ radeon->lastStamp = drawable->lastStamp; - } - - diff --git a/debian/patches/08_r300_update_window_state_when_bound_but_stamp_changed.patch b/debian/patches/08_r300_update_window_state_when_bound_but_stamp_changed.patch deleted file mode 100644 index 8bf8db683f6..00000000000 --- a/debian/patches/08_r300_update_window_state_when_bound_but_stamp_changed.patch +++ /dev/null @@ -1,35 +0,0 @@ -From: Michel Dänzer -Date: Fri, 9 Mar 2007 08:43:17 +0000 (+0100) -Subject: r300: Also update window state when it's already bound but its stamp changed. -X-Git-Url: http://gitweb.freedesktop.org/?p=mesa/mesa.git;a=commitdiff;h=4d9901a1cab8e0d55b1b2309cf3ffec235e53149 - -r300: Also update window state when it's already bound but its stamp changed. - -And set new cliprects before deriving other state from them. This ensures -cliprects aren't accessed after having been freed. - -Thanks to Panagiotis Papadakos for testing various iterations of this. ---- - ---- a/src/mesa/drivers/dri/r300/radeon_context.c -+++ b/src/mesa/drivers/dri/r300/radeon_context.c -@@ -273,15 +273,15 @@ GLboolean radeonMakeCurrent(__DRIcontext - &radeon->vbl_seq); - } - -+ radeon->dri.readable = driReadPriv; -+ - if (radeon->dri.drawable != driDrawPriv || -- radeon->dri.readable != driReadPriv) { -+ radeon->lastStamp != driDrawPriv->lastStamp) { - radeon->dri.drawable = driDrawPriv; -- radeon->dri.readable = driReadPriv; - -+ radeonSetCliprects(radeon); - r300UpdateWindow(radeon->glCtx); - r300UpdateViewportOffset(radeon->glCtx); -- -- radeonSetCliprects(radeon); - } - - _mesa_make_current(radeon->glCtx, diff --git a/debian/patches/09_i915_always_enable_pixel_fog.patch b/debian/patches/09_i915_always_enable_pixel_fog.patch deleted file mode 100644 index d1056487051..00000000000 --- a/debian/patches/09_i915_always_enable_pixel_fog.patch +++ /dev/null @@ -1,31 +0,0 @@ -From: Zou Nan hai -Date: Fri, 2 Feb 2007 01:35:17 +0000 (+0800) -Subject: Fix fd.o #9686, when fall into vertex fog, -X-Git-Url: http://gitweb.freedesktop.org/?p=mesa/mesa.git;a=commitdiff;h=2dfb3a217f730d6783fb2ac8b73248dc682f923c - - Fix fd.o #9686, when fall into vertex fog, - fog factors are precomputed in t_vb_fog.c compute_fog_blend_factors, - which is incompatible with appended fragment fog code. - That will make GoogleEarth display abnormally. - always use pixel fog. ---- - ---- a/src/mesa/drivers/dri/i915/i915_state.c -+++ b/src/mesa/drivers/dri/i915/i915_state.c -@@ -611,10 +611,12 @@ void i915_update_fog( GLcontext *ctx ) - i915->state.Ctx[I915_CTXREG_LIS5] &= ~S5_FOG_ENABLE; - } - -- if (enabled) { -- _tnl_allow_vertex_fog( ctx, (i915->vertex_fog == I915_FOG_VERTEX) ); -- _tnl_allow_pixel_fog( ctx, (i915->vertex_fog != I915_FOG_VERTEX) ); -- } -+ /* always enbale pixel fog -+ * vertex fog use precaculted fog coord will conflict with appended -+ * fog program -+ */ -+ _tnl_allow_vertex_fog( ctx, 0 ); -+ _tnl_allow_pixel_fog( ctx, 1 ); - } - - static void i915Fogfv(GLcontext *ctx, GLenum pname, const GLfloat *param) diff --git a/debian/patches/series b/debian/patches/series index f8249980eff..280a2f3548e 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -4,7 +4,3 @@ 03_optional-progs-and-install.patch 04_cleanup-osmesa-configs.patch 05_static-nonpic.patch -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 -- cgit v1.2.3 From 9a42ffad814837adf7512a6f897a33b1fda86733 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Sat, 21 Apr 2007 21:23:21 +0200 Subject: Add build-dependencies on libxdamage-dev and libxfixes-dev. --- debian/changelog | 3 ++- debian/control | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index d038f8d825c..302b11282e7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -11,8 +11,9 @@ mesa (6.5.3~rc1-1) UNRELEASED; urgency=low 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. + * Add build-dependencies on libxdamage-dev and libxfixes-dev. - -- Julien Cristau Sat, 21 Apr 2007 20:43:43 +0200 + -- Julien Cristau Sat, 21 Apr 2007 21:20:46 +0200 mesa (6.5.2-5) UNRELEASED; urgency=low diff --git a/debian/control b/debian/control index c6f0de3d584..8b50e6d469a 100644 --- a/debian/control +++ b/debian/control @@ -4,7 +4,7 @@ Priority: optional Maintainer: Debian X Strike Force Uploaders: Thierry Reding , Julien Cristau Standards-Version: 3.7.2 -Build-Depends: debhelper (>= 5), quilt (>= 0.40), pkg-config, libdrm-dev (>= 2.2.0) [!hurd-i386], libx11-dev, xutils-dev, x11proto-gl-dev (>= 1.4.8), libxxf86vm-dev, libexpat1-dev, lesstif2-dev, dpkg-dev (>= 1.13.19) +Build-Depends: debhelper (>= 5), quilt (>= 0.40), pkg-config, libdrm-dev (>= 2.2.0) [!hurd-i386], libx11-dev, xutils-dev, x11proto-gl-dev (>= 1.4.8), libxxf86vm-dev, libexpat1-dev, lesstif2-dev, dpkg-dev (>= 1.13.19), libxfixes-dev, libxdamage-dev Package: libgl1-mesa-swx11 Section: libs -- cgit v1.2.3 From 77ccf51cb338357e9d8827e4ef16fdffd7b3b82a Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Sun, 22 Apr 2007 00:50:40 +0200 Subject: New upstream release candidate. --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 302b11282e7..509b667b9df 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -mesa (6.5.3~rc1-1) UNRELEASED; urgency=low +mesa (6.5.3~rc2-1) UNRELEASED; urgency=low [ Brice Goglin ] * Split out libGLw libs and headers from libgl1-mesa-swx11 and ship both -- cgit v1.2.3 From c8629c3178f214380137855318d54dfd3f1a6162 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Sun, 22 Apr 2007 00:51:10 +0200 Subject: Resync debian/scripts/install-source.sh. --- debian/changelog | 3 ++- debian/scripts/install-source.sh | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 509b667b9df..babaccaf87e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -12,8 +12,9 @@ mesa (6.5.3~rc2-1) UNRELEASED; urgency=low 08_r300_update_window_state_when_bound_but_stamp_changed.patch, 09_i915_always_enable_pixel_fog.patch: remove, included upstream. * Add build-dependencies on libxdamage-dev and libxfixes-dev. + * Resync debian/scripts/install-source.sh. - -- Julien Cristau Sat, 21 Apr 2007 21:20:46 +0200 + -- Julien Cristau Sun, 22 Apr 2007 00:50:43 +0200 mesa (6.5.2-5) UNRELEASED; urgency=low diff --git a/debian/scripts/install-source.sh b/debian/scripts/install-source.sh index bc0bcd5e34d..5b1dcfb057d 100755 --- a/debian/scripts/install-source.sh +++ b/debian/scripts/install-source.sh @@ -9,7 +9,6 @@ fi SOURCE_DIRS=' include/GL/internal src/glx/x11 - src/mesa/array_cache src/mesa/drivers/common src/mesa/drivers/dri/common src/mesa/drivers/dri/glcore @@ -24,6 +23,7 @@ SOURCE_DIRS=' src/mesa/swrast src/mesa/tnl_dd src/mesa/tnl + src/mesa/vbo src/mesa/x86-64 src/mesa/x86 ' -- cgit v1.2.3 From 4adbd94b100b4bf94e7016691fe9dcd71e8637d9 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Mon, 23 Apr 2007 11:00:09 +0200 Subject: Only install stuff in mesa-swx11-source if we're building arch:all packages. --- debian/changelog | 3 ++- debian/rules | 12 ++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index babaccaf87e..cf425d3105a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -13,8 +13,9 @@ mesa (6.5.3~rc2-1) UNRELEASED; urgency=low 09_i915_always_enable_pixel_fog.patch: remove, included upstream. * Add build-dependencies on libxdamage-dev and libxfixes-dev. * Resync debian/scripts/install-source.sh. + * Build mesa-swx11-source only in binary-indep. - -- Julien Cristau Sun, 22 Apr 2007 00:50:43 +0200 + -- Julien Cristau Sun, 22 Apr 2007 01:06:39 +0200 mesa (6.5.2-5) UNRELEASED; urgency=low diff --git a/debian/rules b/debian/rules index 7a7025f1f0c..3d00bb72401 100755 --- a/debian/rules +++ b/debian/rules @@ -44,8 +44,8 @@ CONFIGS = $(SWX11_GLU_CONFIGS) \ STAMP = $(STAMP_DIR)/$(DEB_BUILD_GNU_TYPE) BUILD_STAMPS = $(addprefix $(STAMP)-build-, $(CONFIGS)) -INSTALL_STAMPS = $(addprefix $(STAMP)-install-, $(CONFIGS)) \ - $(STAMP_DIR)/install-source +ARCH_INSTALL_STAMPS = $(addprefix $(STAMP)-install-, $(CONFIGS)) +INDEP_INSTALL_STAMPS = $(STAMP_DIR)/install-source # list the configurations that will built configs: @@ -72,17 +72,17 @@ $(STAMP)-build-%: patch pre-install: dh_testdir dh_testroot - dh_clean -k --exclude ./Makefile.orig --exclude configs/CVS/Root.bak + dh_clean -k rm -rf $(INSTALL_STAMPS) -install: pre-install $(INSTALL_STAMPS) +install: pre-install $(ARCH_INSTALL_STAMPS) $(STAMP)-install-%: $(STAMP)-build-% # Add here commands to install the package into debian/tmp cd $(DEB_BUILD_DIR)/$* && $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp touch $@ -$(STAMP_DIR)/install-source: +$(STAMP_DIR)/install-source: pre-install # install Mesa source for mesa-swx11-source package chmod a+x debian/scripts/install-source.sh debian/scripts/install-source.sh @@ -95,7 +95,7 @@ clean: unpatch rm -rf $(DEB_BUILD_DIR) $(STAMP_DIR) # Build architecture-independent files here. -binary-indep: build install +binary-indep: build install $(INDEP_INSTALL_STAMPS) dh_testdir dh_testroot dh_installchangelogs -i -- cgit v1.2.3 From 6f2b0fe4638cf838cbcc852777abc35794154399 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Wed, 25 Apr 2007 01:48:33 +0200 Subject: New upstream release candidate. Refresh a couple patches. --- debian/changelog | 5 +++-- debian/patches/01_fix-makefile.patch | 8 +++++--- debian/patches/02_use-ieee-fp-on-s390-and-m68k.patch | 8 +++++--- 3 files changed, 13 insertions(+), 8 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index cf425d3105a..bd193f271a9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -mesa (6.5.3~rc2-1) UNRELEASED; urgency=low +mesa (6.5.3~rc3-1) UNRELEASED; urgency=low [ Brice Goglin ] * Split out libGLw libs and headers from libgl1-mesa-swx11 and ship both @@ -11,11 +11,12 @@ mesa (6.5.3~rc2-1) UNRELEASED; urgency=low 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. - -- Julien Cristau Sun, 22 Apr 2007 01:06:39 +0200 + -- Julien Cristau Wed, 25 Apr 2007 01:46:10 +0200 mesa (6.5.2-5) UNRELEASED; urgency=low diff --git a/debian/patches/01_fix-makefile.patch b/debian/patches/01_fix-makefile.patch index 6711d2fe5cd..41c1c707df4 100644 --- a/debian/patches/01_fix-makefile.patch +++ b/debian/patches/01_fix-makefile.patch @@ -3,9 +3,11 @@ OSMesa in a separate package. This patch by Thierry Reding. ---- a/src/mesa/Makefile -+++ b/src/mesa/Makefile -@@ -107,7 +107,7 @@ +Index: mesa/src/mesa/Makefile +=================================================================== +--- mesa.orig/src/mesa/Makefile 2007-04-25 01:44:31.000000000 +0200 ++++ mesa/src/mesa/Makefile 2007-04-25 01:44:58.000000000 +0200 +@@ -105,7 +105,7 @@ $(OSMESA_DRIVER_OBJECTS) diff --git a/debian/patches/02_use-ieee-fp-on-s390-and-m68k.patch b/debian/patches/02_use-ieee-fp-on-s390-and-m68k.patch index f54457521c5..ddc71983b1e 100644 --- a/debian/patches/02_use-ieee-fp-on-s390-and-m68k.patch +++ b/debian/patches/02_use-ieee-fp-on-s390-and-m68k.patch @@ -2,9 +2,11 @@ Patch that fixes Debian bug #349437. This patch by David Nusinow. ---- a/src/mesa/main/imports.h -+++ b/src/mesa/main/imports.h -@@ -155,8 +155,9 @@ +Index: mesa/src/mesa/main/imports.h +=================================================================== +--- mesa.orig/src/mesa/main/imports.h 2007-04-25 01:44:31.000000000 +0200 ++++ mesa/src/mesa/main/imports.h 2007-04-25 01:45:04.000000000 +0200 +@@ -158,8 +158,9 @@ *** USE_IEEE: Determine if we're using IEEE floating point ***/ #if defined(__i386__) || defined(__386__) || defined(__sparc__) || \ -- cgit v1.2.3 From 30f3c3dfadf424539b62f8497f6e7059c02a96ba Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Wed, 25 Apr 2007 08:42:02 +0200 Subject: Update changelog. --- debian/changelog | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index bd193f271a9..202ed71df90 100644 --- a/debian/changelog +++ b/debian/changelog @@ -15,8 +15,10 @@ mesa (6.5.3~rc3-1) UNRELEASED; urgency=low * 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 01:46:10 +0200 + -- Julien Cristau Wed, 25 Apr 2007 08:40:49 +0200 mesa (6.5.2-5) UNRELEASED; urgency=low -- cgit v1.2.3 From 03cdacfb6a40385242b5df9ccf652974f4fa321b Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Wed, 25 Apr 2007 10:37:10 +0200 Subject: Prepare changelog for upload. --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 202ed71df90..ba9de6a4b9a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -mesa (6.5.3~rc3-1) UNRELEASED; urgency=low +mesa (6.5.3~rc3-1) experimental; urgency=low [ Brice Goglin ] * Split out libGLw libs and headers from libgl1-mesa-swx11 and ship both @@ -18,7 +18,7 @@ mesa (6.5.3~rc3-1) UNRELEASED; urgency=low * Update from upstream git (commit dee1b0d5bbe91f83854813cbbcd3090327bcb5c2). - -- Julien Cristau Wed, 25 Apr 2007 08:40:49 +0200 + -- Julien Cristau Wed, 25 Apr 2007 10:36:50 +0200 mesa (6.5.2-5) UNRELEASED; urgency=low -- cgit v1.2.3 From 1953cfc9542dafe2b92d2c9a0da819513ee2c1a4 Mon Sep 17 00:00:00 2001 From: David Nusinow Date: Mon, 30 Apr 2007 00:08:11 -0400 Subject: Update changelog --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index ba9de6a4b9a..81941606a12 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +mesa (6.5.3-1) experimental; urgency=low + + * New upstream release + + -- David Nusinow Sun, 29 Apr 2007 23:23:06 -0400 + mesa (6.5.3~rc3-1) experimental; urgency=low [ Brice Goglin ] -- cgit v1.2.3 From a8c856d43c1594953a725f63e9c24d5bb658efda Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Wed, 9 May 2007 15:09:12 +0200 Subject: Cherry-pick commmit 65faf023 by Michel Dänzer to fix r300 crash. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit r300: Don't crash in radeonUpdatePageFlipping when !radeon->glCtx->DrawBuffer. This feels like a kludge, maybe there's a better solution. --- debian/changelog | 7 ++++++- src/mesa/drivers/dri/r300/radeon_lock.c | 4 +++- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 81941606a12..80b4df90e35 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,13 @@ mesa (6.5.3-1) experimental; urgency=low + [ David Nusinow ] * New upstream release - -- David Nusinow Sun, 29 Apr 2007 23:23:06 -0400 + [ Julien Cristau ] + * Cherry-pick commit 65faf023679988f93da82b4c7ebdc689f2094459 by Michel + Dänzer to fix r300 crash. + + -- Julien Cristau Wed, 09 May 2007 15:02:12 +0200 mesa (6.5.3~rc3-1) experimental; urgency=low diff --git a/src/mesa/drivers/dri/r300/radeon_lock.c b/src/mesa/drivers/dri/r300/radeon_lock.c index ec501c3dc06..a5f6ec7d662 100644 --- a/src/mesa/drivers/dri/r300/radeon_lock.c +++ b/src/mesa/drivers/dri/r300/radeon_lock.c @@ -59,7 +59,9 @@ static void radeonUpdatePageFlipping(radeonContextPtr radeon) driFlipRenderbuffers(radeon->glCtx->WinSysDrawBuffer, radeon->sarea->pfCurrentPage); } - use_back = (radeon->glCtx->DrawBuffer->_ColorDrawBufferMask[0] == BUFFER_BIT_BACK_LEFT); + use_back = radeon->glCtx->DrawBuffer ? + (radeon->glCtx->DrawBuffer->_ColorDrawBufferMask[0] == + BUFFER_BIT_BACK_LEFT) : 1; use_back ^= (radeon->sarea->pfCurrentPage == 1); if (use_back) { -- cgit v1.2.3 From 1865ef6fd460a5bb6c17cb30d2b4e4c95fe144b5 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Fri, 18 May 2007 13:36:42 +0200 Subject: Prepare changelog for upload. --- debian/changelog | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 16ffae91cc6..53935bc1dc4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,11 +1,12 @@ -mesa (6.5.2-5) UNRELEASED; urgency=low +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 - -- Brice Goglin Fri, 20 Apr 2007 18:36:51 +0200 + -- Julien Cristau Fri, 18 May 2007 13:36:25 +0200 mesa (6.5.2-4) unstable; urgency=low -- cgit v1.2.3 From e1b0715dd6326033b15b6dd2bb2fcbcfdb950df9 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Mon, 21 May 2007 11:35:28 +0200 Subject: Prepare changelog for upload. --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index e896ce998b8..154f99aa8eb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,7 +7,7 @@ mesa (6.5.3-1) experimental; urgency=low * Cherry-pick commit 65faf023679988f93da82b4c7ebdc689f2094459 by Michel Dänzer to fix r300 crash. - -- Julien Cristau Wed, 09 May 2007 15:02:12 +0200 + -- Julien Cristau Mon, 21 May 2007 11:34:51 +0200 mesa (6.5.3~rc3-1) experimental; urgency=low -- cgit v1.2.3 From 74a11701f3cf9360b7f84f9bbebf60ea8de680df Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Wed, 13 Jun 2007 19:36:04 +0200 Subject: Shorten the one-line synopsis of various packages. They're cut off in .changes files if they're too long. Thanks, Marc 'HE' Brockschmidt! --- debian/changelog | 7 +++++++ debian/control | 18 +++++++++--------- 2 files changed, 16 insertions(+), 9 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 154f99aa8eb..1ca677bfff0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +mesa (6.5.3-2) UNRELEASED; urgency=low + + * Modify the short descriptions of various packages so they fit in .changes + files without being cut off. Thanks, Marc 'HE' Brockschmidt! + + -- Julien Cristau Wed, 13 Jun 2007 19:30:06 +0200 + mesa (6.5.3-1) experimental; urgency=low [ David Nusinow ] diff --git a/debian/control b/debian/control index 8b50e6d469a..452de1b450a 100644 --- a/debian/control +++ b/debian/control @@ -57,7 +57,7 @@ Section: libs Priority: extra Architecture: i386 Pre-Depends: libgl1-mesa-swx11 -Description: A free implementation of the OpenGL API -- runtime [i686 optimized] +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 @@ -83,7 +83,7 @@ Depends: libgl1-mesa-swx11 (= ${binary:Version}), libc6-dev, libx11-dev, libxext 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 support files +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. @@ -115,7 +115,7 @@ Section: libdevel Priority: extra Architecture: any Depends: libgl1-mesa-glx (= ${binary:Version}) -Description: A free implementation of the OpenGL API -- GLX runtime -- debugging symbols +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. @@ -176,7 +176,7 @@ Section: libdevel Priority: extra Architecture: any Depends: libgl1-mesa-dri (= ${binary:Version}) -Description: A free implementation of the OpenGL API -- DRI modules -- debugging symbols +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. @@ -217,7 +217,7 @@ Depends: libc6-dev, mesa-common-dev (= ${source:Version}), libgl1-mesa-glx (>= $ 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 support files +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. @@ -258,7 +258,7 @@ Depends: libosmesa6 (= ${binary:Version}), mesa-common-dev (= ${source:Version}) 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 support files +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. . @@ -292,7 +292,7 @@ Depends: libglu1-mesa (= ${binary:Version}), libgl1-mesa-dev | libgl-dev 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 support files +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 @@ -323,7 +323,7 @@ Depends: libglw1-mesa (= ${binary:Version}), libc6-dev, libx11-dev, libxext6, me 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 support files +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. @@ -333,7 +333,7 @@ Description: A free implementation of the OpenGL API -- development support file Package: mesa-swx11-source Section: libdevel Architecture: all -Description: Mesa software rasteriser source -- development support files +Description: Mesa software rasteriser source -- development files This package contains the source to the Mesa software rasteriser, which implements all of Mesa's GL support in software. It powers the X11 and X server backends (assuming unaccelerated indirect). This package is -- cgit v1.2.3 From 7c9762f698b3ccaaeb1b0687fe23fec0bd123c7f Mon Sep 17 00:00:00 2001 From: David Nusinow Date: Wed, 27 Jun 2007 21:32:51 -0400 Subject: Changelog bump --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 81941606a12..ce2f47ec533 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +mesa (7.0.0-1) experimental; urgency=low + + * New upstream release + + -- David Nusinow Wed, 27 Jun 2007 21:32:32 -0400 + mesa (6.5.3-1) experimental; urgency=low * New upstream release -- cgit v1.2.3 From d71d04bf6fb1fe317f6d06e940e7f14434cabc70 Mon Sep 17 00:00:00 2001 From: David Nusinow Date: Wed, 27 Jun 2007 22:54:52 -0400 Subject: Bite the bullet and add myself to uploaders --- debian/changelog | 5 +++-- debian/control | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 3a35eb98cfe..c2e2013d950 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,9 @@ -mesa (7.0.0-1) experimental; urgency=low +mesa (7.0.0-1) UNRELEASED; urgency=low * New upstream release + * Bite the bullet and add myself to uploaders - -- David Nusinow Wed, 27 Jun 2007 21:32:32 -0400 + -- David Nusinow Wed, 27 Jun 2007 22:54:22 -0400 mesa (6.5.3-2) UNRELEASED; urgency=low diff --git a/debian/control b/debian/control index 452de1b450a..e6ad5308986 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: mesa Section: graphics Priority: optional Maintainer: Debian X Strike Force -Uploaders: Thierry Reding , Julien Cristau +Uploaders: Thierry Reding , Julien Cristau , David Nusinow Standards-Version: 3.7.2 Build-Depends: debhelper (>= 5), quilt (>= 0.40), pkg-config, libdrm-dev (>= 2.2.0) [!hurd-i386], libx11-dev, xutils-dev, x11proto-gl-dev (>= 1.4.8), libxxf86vm-dev, libexpat1-dev, lesstif2-dev, dpkg-dev (>= 1.13.19), libxfixes-dev, libxdamage-dev -- cgit v1.2.3 From 0bf8ed523dae0912da0d2d763280a3d7f3fc7a47 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Wed, 27 Jun 2007 17:45:43 +0100 Subject: * Add a shlibs file for libgl1-mesa-swx11-i686. --- debian/changelog | 3 ++- debian/libgl1-mesa-swx11-i686.shlibs | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 debian/libgl1-mesa-swx11-i686.shlibs (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index c2e2013d950..7a0cc0b3819 100644 --- a/debian/changelog +++ b/debian/changelog @@ -9,8 +9,9 @@ mesa (6.5.3-2) UNRELEASED; urgency=low * 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 Wed, 13 Jun 2007 19:30:06 +0200 + -- Julien Cristau Wed, 27 Jun 2007 17:43:35 +0100 mesa (6.5.3-1) experimental; urgency=low diff --git a/debian/libgl1-mesa-swx11-i686.shlibs b/debian/libgl1-mesa-swx11-i686.shlibs new file mode 100644 index 00000000000..b8e0fbaaaa5 --- /dev/null +++ b/debian/libgl1-mesa-swx11-i686.shlibs @@ -0,0 +1 @@ +libGL 1 libgl1-mesa-glx | libgl1 -- cgit v1.2.3 From ecc42e79aee93504d0e43916ab8dec672b3359c2 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Thu, 28 Jun 2007 00:11:18 +0100 Subject: Merge unreleased changelog entries --- debian/changelog | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 7a0cc0b3819..d3df28b1d62 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,17 +1,15 @@ -mesa (7.0.0-1) UNRELEASED; urgency=low +mesa (7.0-1) UNRELEASED; urgency=low + [ David Nusinow ] * New upstream release * Bite the bullet and add myself to uploaders - -- David Nusinow Wed, 27 Jun 2007 22:54:22 -0400 - -mesa (6.5.3-2) UNRELEASED; urgency=low - + [ 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 Wed, 27 Jun 2007 17:43:35 +0100 + -- Julien Cristau Thu, 28 Jun 2007 21:59:50 +0100 mesa (6.5.3-1) experimental; urgency=low -- cgit v1.2.3 From 498b4dbba4589b00c7733f44cabe10c57d0efa0a Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Thu, 28 Jun 2007 22:33:05 +0100 Subject: Fix build on hurd-i386. Build libgl1-mesa-glx without direct rendering support on that arch, and don't build any dri driver. --- configs/debian-indirect-default | 7 +++++++ configs/debian-indirect-hurd-i386 | 9 +++++++++ debian/changelog | 4 +++- debian/control | 4 ++-- debian/scripts/choose-configs | 8 ++++++-- 5 files changed, 27 insertions(+), 5 deletions(-) create mode 100644 configs/debian-indirect-default create mode 100644 configs/debian-indirect-hurd-i386 (limited to 'debian') diff --git a/configs/debian-indirect-default b/configs/debian-indirect-default new file mode 100644 index 00000000000..a6926c95fcc --- /dev/null +++ b/configs/debian-indirect-default @@ -0,0 +1,7 @@ +# Configuration defaults for building GLX-enabled libGL. + +include $(TOP)/configs/debian-dri-default + +CONFIG_NAME = debian-indirect-default + +DRI_DIRS = diff --git a/configs/debian-indirect-hurd-i386 b/configs/debian-indirect-hurd-i386 new file mode 100644 index 00000000000..dd4bb07ca52 --- /dev/null +++ b/configs/debian-indirect-hurd-i386 @@ -0,0 +1,9 @@ +# Configuration for building the DRI drivers on the build architecture. + +include $(TOP)/configs/linux-indirect +include $(TOP)/configs/debian-indirect-default + +CONFIG_NAME = debian-indirect-hurd-i386 + +# vim: ft=make + diff --git a/debian/changelog b/debian/changelog index d3df28b1d62..203972196e5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,8 +8,10 @@ mesa (7.0-1) UNRELEASED; urgency=low * 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. + * 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, 28 Jun 2007 21:59:50 +0100 + -- Julien Cristau Thu, 28 Jun 2007 22:26:10 +0100 mesa (6.5.3-1) experimental; urgency=low diff --git a/debian/control b/debian/control index e6ad5308986..17f1e9ada06 100644 --- a/debian/control +++ b/debian/control @@ -153,7 +153,7 @@ Description: Debugging symbols for the Mesa GLX runtime Package: libgl1-mesa-dri Section: libs Priority: optional -Architecture: any +Architecture: alpha amd64 arm armeb armel hppa i386 ia64 kfreebsd-i386 kfreebsd-amd64 m68k mips mipsel powerpc s390 sparc Depends: ${shlibs:Depends}, libgl1-mesa-glx (= ${binary:Version}) Suggests: libglide3 Conflicts: xlibmesa-dri (<< 1:7.0.0) @@ -174,7 +174,7 @@ Description: A free implementation of the OpenGL API -- DRI modules Package: libgl1-mesa-dri-dbg Section: libdevel Priority: extra -Architecture: any +Architecture: alpha amd64 arm armeb armel hppa i386 ia64 kfreebsd-i386 kfreebsd-amd64 m68k mips mipsel powerpc s390 sparc Depends: libgl1-mesa-dri (= ${binary:Version}) Description: Debugging symbols for the Mesa DRI modules This version of Mesa provides GLX and DRI capabilities: it is capable of diff --git a/debian/scripts/choose-configs b/debian/scripts/choose-configs index 3f5f9868e51..16e00828a76 100644 --- a/debian/scripts/choose-configs +++ b/debian/scripts/choose-configs @@ -22,10 +22,14 @@ else endif # and for the GLX/DRI-enabled libGL -ifneq ($(wildcard configs/debian-dri-$(DEB_BUILD_ARCH)),) - DRI_CONFIGS := debian-dri-$(DEB_BUILD_ARCH) +ifneq ($(wildcard configs/debian-indirect-$(DEB_BUILD_ARCH)),) + DRI_CONFIGS := debian-indirect-$(DEB_BUILD_ARCH) else + ifneq ($(wildcard configs/debian-dri-$(DEB_BUILD_ARCH)),) + DRI_CONFIGS := debian-dri-$(DEB_BUILD_ARCH) + else DRI_CONFIGS := debian-dri-any + endif endif ############################################################################## -- cgit v1.2.3 From 3e21f527962f3403e47538cb08054006016149e3 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Tue, 3 Jul 2007 05:33:21 +0200 Subject: Make libgl1-mesa-swx11 depend on libosmesa6 libgl1-mesa-swx11 used to contain libOSMesa.so.6, so programs linked against it don't necessarily depend on libosmesa6; their dependencies were broken since mesa 6.5.2-1. --- debian/changelog | 9 +++++++++ debian/control | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 53935bc1dc4..b5973776bf3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +mesa (6.5.2-6) UNRELEASED; 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. + + -- Julien Cristau Tue, 03 Jul 2007 05:28:37 +0200 + mesa (6.5.2-5) unstable; urgency=low [ Brice Goglin ] diff --git a/debian/control b/debian/control index 16a6ebb73d2..ae265c850a5 100644 --- a/debian/control +++ b/debian/control @@ -9,7 +9,7 @@ Build-Depends: debhelper (>= 5), quilt (>= 0.40), pkg-config, libdrm-dev (>= 2.2 Package: libgl1-mesa-swx11 Section: libs Architecture: any -Depends: ${shlibs:Depends} +Depends: ${shlibs:Depends}, libosmesa6 (>= 6.5.2-1) 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 -- cgit v1.2.3 From 639eaceee74f0f3787b2b6e1c682c90696c085d4 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Thu, 28 Jun 2007 22:33:05 +0100 Subject: Fix build on hurd-i386. Build libgl1-mesa-glx without direct rendering support on that arch, and don't build any dri driver. --- configs/debian-indirect-default | 7 +++++++ configs/debian-indirect-hurd-i386 | 9 +++++++++ debian/changelog | 4 +++- debian/control | 4 ++-- debian/scripts/choose-configs | 8 ++++++-- 5 files changed, 27 insertions(+), 5 deletions(-) create mode 100644 configs/debian-indirect-default create mode 100644 configs/debian-indirect-hurd-i386 (limited to 'debian') diff --git a/configs/debian-indirect-default b/configs/debian-indirect-default new file mode 100644 index 00000000000..a6926c95fcc --- /dev/null +++ b/configs/debian-indirect-default @@ -0,0 +1,7 @@ +# Configuration defaults for building GLX-enabled libGL. + +include $(TOP)/configs/debian-dri-default + +CONFIG_NAME = debian-indirect-default + +DRI_DIRS = diff --git a/configs/debian-indirect-hurd-i386 b/configs/debian-indirect-hurd-i386 new file mode 100644 index 00000000000..dd4bb07ca52 --- /dev/null +++ b/configs/debian-indirect-hurd-i386 @@ -0,0 +1,9 @@ +# Configuration for building the DRI drivers on the build architecture. + +include $(TOP)/configs/linux-indirect +include $(TOP)/configs/debian-indirect-default + +CONFIG_NAME = debian-indirect-hurd-i386 + +# vim: ft=make + diff --git a/debian/changelog b/debian/changelog index b5973776bf3..5e71fec1d13 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,8 +4,10 @@ mesa (6.5.2-6) UNRELEASED; urgency=low 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 Tue, 03 Jul 2007 05:28:37 +0200 + -- Julien Cristau Thu, 05 Jul 2007 00:47:14 +0200 mesa (6.5.2-5) unstable; urgency=low diff --git a/debian/control b/debian/control index ae265c850a5..83e59078cd4 100644 --- a/debian/control +++ b/debian/control @@ -158,7 +158,7 @@ Description: A free implementation of the OpenGL API -- GLX runtime -- debugging Package: libgl1-mesa-dri Section: libs Priority: optional -Architecture: any +Architecture: alpha amd64 arm armeb armel hppa i386 ia64 kfreebsd-i386 kfreebsd-amd64 m68k mips mipsel powerpc s390 sparc Depends: ${shlibs:Depends}, libgl1-mesa-glx (= ${binary:Version}) Suggests: libglide3 Conflicts: xlibmesa-dri (<< 1:7.0.0) @@ -179,7 +179,7 @@ Description: A free implementation of the OpenGL API -- DRI modules Package: libgl1-mesa-dri-dbg Section: libdevel Priority: extra -Architecture: any +Architecture: alpha amd64 arm armeb armel hppa i386 ia64 kfreebsd-i386 kfreebsd-amd64 m68k mips mipsel powerpc s390 sparc Depends: libgl1-mesa-dri (= ${binary:Version}) Description: A free implementation of the OpenGL API -- DRI modules -- debugging symbols This version of Mesa provides GLX and DRI capabilities: it is capable of diff --git a/debian/scripts/choose-configs b/debian/scripts/choose-configs index 3f5f9868e51..16e00828a76 100644 --- a/debian/scripts/choose-configs +++ b/debian/scripts/choose-configs @@ -22,10 +22,14 @@ else endif # and for the GLX/DRI-enabled libGL -ifneq ($(wildcard configs/debian-dri-$(DEB_BUILD_ARCH)),) - DRI_CONFIGS := debian-dri-$(DEB_BUILD_ARCH) +ifneq ($(wildcard configs/debian-indirect-$(DEB_BUILD_ARCH)),) + DRI_CONFIGS := debian-indirect-$(DEB_BUILD_ARCH) else + ifneq ($(wildcard configs/debian-dri-$(DEB_BUILD_ARCH)),) + DRI_CONFIGS := debian-dri-$(DEB_BUILD_ARCH) + else DRI_CONFIGS := debian-dri-any + endif endif ############################################################################## -- cgit v1.2.3 From 31f3433635e46d76be48f2b0ddeaf76d7c9df77e Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Thu, 5 Jul 2007 00:56:56 +0200 Subject: Prepare changelog for upload. --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 5e71fec1d13..96557246be6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -mesa (6.5.2-6) UNRELEASED; urgency=low +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 @@ -7,7 +7,7 @@ mesa (6.5.2-6) UNRELEASED; urgency=low * 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:47:14 +0200 + -- Julien Cristau Thu, 05 Jul 2007 00:56:35 +0200 mesa (6.5.2-5) unstable; urgency=low -- cgit v1.2.3 From 19e51ecbe65086cbea0ed169d5563f615db13a0c Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Sat, 7 Jul 2007 22:17:35 +0200 Subject: libgl1-mesa-dev does not need to depend on libgl1-mesa-dri, libgl1-mesa-glx is enough. libgl1-mesa-glx was included in libgl1-mesa-dri before 6.4.1-0.1, so libgl1-mesa-dev had to depend on libgl1-mesa-dri at this point. Since libgl1-mesa-dri only contains the DRI modules now, it is not required anymore for libgl1-mesa-dev. --- debian/changelog | 8 ++++++++ debian/control | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 96557246be6..b865d762943 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +mesa (6.5.2-7) UNRELEASED; urgency=low + + * 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! + + -- Brice Goglin Sat, 07 Jul 2007 20:15:36 +0200 + mesa (6.5.2-6) unstable; urgency=low * libgl1-mesa-swx11 needs to depend on libosmesa6 (>= 6.5.2-1) because diff --git a/debian/control b/debian/control index 83e59078cd4..c0b746cd819 100644 --- a/debian/control +++ b/debian/control @@ -218,7 +218,7 @@ Description: A free implementation of the OpenGL API -- DRI modules -- debugging Package: libgl1-mesa-dev Section: libdevel Architecture: all -Depends: libc6-dev, mesa-common-dev (= ${source:Version}), libgl1-mesa-glx (>= ${Source-Version}), libgl1-mesa-dri (>= ${Source-Version}) +Depends: libc6-dev, mesa-common-dev (= ${source:Version}), libgl1-mesa-glx (>= ${Source-Version}) Conflicts: libgl-dev, libgl1-mesa-dri-dev Replaces: libgl-dev, libgl1-mesa-dri-dev Provides: libgl-dev, libgl1-mesa-dri-dev -- cgit v1.2.3 From 250f6b2c8873a2480870aed8c697cb2197a71c16 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Wed, 11 Jul 2007 05:34:30 +0200 Subject: Replace ${Source-Version} with ${source:Version} in one remaining spot. --- debian/changelog | 6 +++++- debian/control | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index b865d762943..020b68b8514 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,14 @@ mesa (6.5.2-7) UNRELEASED; 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! - -- Brice Goglin Sat, 07 Jul 2007 20:15:36 +0200 + [ Julien Cristau ] + * Use ${source:Version} instead of ${Source-Version} in one remaining spot. + + -- Julien Cristau Wed, 11 Jul 2007 05:29:58 +0200 mesa (6.5.2-6) unstable; urgency=low diff --git a/debian/control b/debian/control index c0b746cd819..fa4a289d8e4 100644 --- a/debian/control +++ b/debian/control @@ -218,7 +218,7 @@ Description: A free implementation of the OpenGL API -- DRI modules -- debugging Package: libgl1-mesa-dev Section: libdevel Architecture: all -Depends: libc6-dev, mesa-common-dev (= ${source:Version}), libgl1-mesa-glx (>= ${Source-Version}) +Depends: libc6-dev, mesa-common-dev (= ${source:Version}), libgl1-mesa-glx (>= ${source:Version}) Conflicts: libgl-dev, libgl1-mesa-dri-dev Replaces: libgl-dev, libgl1-mesa-dri-dev Provides: libgl-dev, libgl1-mesa-dri-dev -- cgit v1.2.3 From 45310e219cadc8cae37841a7363db05e3facf279 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Wed, 11 Jul 2007 05:45:30 +0200 Subject: Relax libgl1-mesa-dev dependency on libgl1-mesa-glx. Change the >= ${source:Version} dependency to >= ${source:Upstream-Version}. This way libgl1-mesa-dev stays installable after a minor revision bump on architectures where mesa isn't built yet. --- debian/changelog | 6 +++++- debian/control | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 020b68b8514..a1e8e51baca 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,8 +7,12 @@ mesa (6.5.2-7) UNRELEASED; urgency=low [ Julien Cristau ] * Use ${source:Version} instead of ${Source-Version} in one remaining spot. + * 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:29:58 +0200 + -- Julien Cristau Wed, 11 Jul 2007 05:40:32 +0200 mesa (6.5.2-6) unstable; urgency=low diff --git a/debian/control b/debian/control index fa4a289d8e4..dea95b1a190 100644 --- a/debian/control +++ b/debian/control @@ -218,7 +218,7 @@ Description: A free implementation of the OpenGL API -- DRI modules -- debugging Package: libgl1-mesa-dev Section: libdevel Architecture: all -Depends: libc6-dev, mesa-common-dev (= ${source:Version}), libgl1-mesa-glx (>= ${source:Version}) +Depends: libc6-dev, mesa-common-dev (= ${source:Version}), libgl1-mesa-glx (>= ${source:Upstream-Version}) Conflicts: libgl-dev, libgl1-mesa-dri-dev Replaces: libgl-dev, libgl1-mesa-dri-dev Provides: libgl-dev, libgl1-mesa-dri-dev -- cgit v1.2.3 From 618626158977e8e46b050eb8610b95e3225fb2e5 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Wed, 11 Jul 2007 05:48:27 +0200 Subject: Prepare changelog for upload. --- debian/changelog | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index a1e8e51baca..cbc9b187e70 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -mesa (6.5.2-7) UNRELEASED; urgency=low +mesa (6.5.2-7) unstable; urgency=low [ Brice Goglin ] * libgl1-mesa-dev does not need to depend on libgl1-mesa-dri, @@ -6,13 +6,12 @@ mesa (6.5.2-7) UNRELEASED; urgency=low closes: #432081. Thanks, Samuel Thibault! [ Julien Cristau ] - * Use ${source:Version} instead of ${Source-Version} in one remaining spot. * libgl1-mesa-dev Depends on libgl1-mesa-glx (>= ${source:Upstream-Version}) - instead of >= ${source:Version}. This way it's still installable on + 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:40:32 +0200 + -- Julien Cristau Wed, 11 Jul 2007 05:50:45 +0200 mesa (6.5.2-6) unstable; urgency=low -- cgit v1.2.3 From d3a160e2174eafa68bbdbb0cf7955e23d26ea66b Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Mon, 23 Jul 2007 16:39:48 +0200 Subject: New upstream release candidate. --- debian/changelog | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 2ad0d5beed7..3fdb103c822 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,17 +1,15 @@ -mesa (7.0-1) UNRELEASED; urgency=low +mesa (7.0.1~rc1-1) UNRELEASED; urgency=low [ David Nusinow ] - * New upstream release + * 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. - * 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, 28 Jun 2007 22:26:10 +0100 + -- Julien Cristau Mon, 23 Jul 2007 16:29:27 +0200 mesa (6.5.3-1) experimental; urgency=low -- cgit v1.2.3 From 04b0e43ea694aae628305574f4c606e38e669f78 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Fri, 27 Jul 2007 19:59:38 +0200 Subject: New upstream release candidate. --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 3fdb103c822..3c72d7dbec0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -mesa (7.0.1~rc1-1) UNRELEASED; urgency=low +mesa (7.0.1~rc2-1) UNRELEASED; urgency=low [ David Nusinow ] * New upstream release candidate @@ -9,7 +9,7 @@ mesa (7.0.1~rc1-1) UNRELEASED; urgency=low files without being cut off. Thanks, Marc 'HE' Brockschmidt! * Add a shlibs file for libgl1-mesa-swx11-i686. - -- Julien Cristau Mon, 23 Jul 2007 16:29:27 +0200 + -- Julien Cristau Fri, 27 Jul 2007 19:59:18 +0200 mesa (6.5.3-1) experimental; urgency=low -- cgit v1.2.3 From 593de57fa2b1e798083d3cc4c55a5bc6dbad1ef3 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Fri, 27 Jul 2007 20:18:21 +0200 Subject: Prepare changelog for upload. --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 3c72d7dbec0..b9bb460af7a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -mesa (7.0.1~rc2-1) UNRELEASED; urgency=low +mesa (7.0.1~rc2-1) experimental; urgency=low [ David Nusinow ] * New upstream release candidate @@ -9,7 +9,7 @@ mesa (7.0.1~rc2-1) UNRELEASED; urgency=low files without being cut off. Thanks, Marc 'HE' Brockschmidt! * Add a shlibs file for libgl1-mesa-swx11-i686. - -- Julien Cristau Fri, 27 Jul 2007 19:59:18 +0200 + -- Julien Cristau Fri, 27 Jul 2007 20:17:48 +0200 mesa (6.5.3-1) experimental; urgency=low -- cgit v1.2.3 From 10b828f1931aac608c482da636c7e43c46cb6e63 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Thu, 9 Aug 2007 11:56:00 +0200 Subject: New upstream release. --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index b9bb460af7a..9d743b43561 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +mesa (7.0.1-1) UNRELEASED; urgency=low + + * New upstream release. + + -- Julien Cristau Thu, 09 Aug 2007 11:29:27 +0200 + mesa (7.0.1~rc2-1) experimental; urgency=low [ David Nusinow ] -- cgit v1.2.3 From 34beaefe1cf93adf34d3a992e5bdf863c1a00461 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Thu, 9 Aug 2007 16:00:58 +0200 Subject: Prepare changelog for upload. --- debian/changelog | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 9d743b43561..04740ad7193 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,9 @@ -mesa (7.0.1-1) UNRELEASED; urgency=low +mesa (7.0.1-1) unstable; urgency=low * New upstream release. + * Upload to unstable. - -- Julien Cristau Thu, 09 Aug 2007 11:29:27 +0200 + -- Julien Cristau Thu, 09 Aug 2007 11:56:16 +0200 mesa (7.0.1~rc2-1) experimental; urgency=low -- cgit v1.2.3 From b18500d56e7ee34f8d3a9b12d82b6e2723ea6b4b Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Tue, 28 Aug 2007 11:16:05 +0200 Subject: * 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) --- debian/changelog | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 04740ad7193..b56407cc822 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +mesa (7.0.1-2) UNRELEASED; 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:06:45 +0200 + mesa (7.0.1-1) unstable; urgency=low * New upstream release. -- cgit v1.2.3 From 369cda37527959ae7e64478f17bbb21243d67135 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Tue, 28 Aug 2007 12:11:47 +0200 Subject: Prepare changelog for upload. --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index b56407cc822..b67350d13f1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,11 +1,11 @@ -mesa (7.0.1-2) UNRELEASED; urgency=low +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:06:45 +0200 + -- Julien Cristau Tue, 28 Aug 2007 12:11:30 +0200 mesa (7.0.1-1) unstable; urgency=low -- cgit v1.2.3 From 76556f82646d4a0db15a06e1392e24a6457b1642 Mon Sep 17 00:00:00 2001 From: David Nusinow Date: Thu, 4 Oct 2007 22:49:27 -0400 Subject: * Disable building i915tex. It was previously only built on x86 and amd64. It was never production-ready and relies on a kernel interface that never went upstream. --- configs/debian-dri-default | 2 +- debian/changelog | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'debian') diff --git a/configs/debian-dri-default b/configs/debian-dri-default index f92c7eddd01..2a01bf8b7e3 100644 --- a/configs/debian-dri-default +++ b/configs/debian-dri-default @@ -23,7 +23,7 @@ DRI_DIRS = mach64 mga r128 r200 r300 radeon s3v savage tdfx trident ARCH_X86 = i386 amd64 ifneq ($(findstring $(DEB_BUILD_ARCH), $(ARCH_X86)),) - DRI_DIRS += i810 i915 i915tex i965 sis unichrome + DRI_DIRS += i810 i915 i965 sis unichrome endif ifeq ($(DEB_BUILD_ARCH), sparc) diff --git a/debian/changelog b/debian/changelog index b67350d13f1..ee088f58062 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +mesa (7.0.1-3) unstable; urgency=low + + * Disable building i915tex. + It was previously only built on x86 and amd64. It was never + production-ready and relies on a kernel interface that never went + upstream. + + -- David Nusinow Thu, 04 Oct 2007 22:47:50 -0400 + mesa (7.0.1-2) unstable; urgency=low * Update to latest git (from mesa_7_0_branch) -- cgit v1.2.3 From c3de7b5ade1a46c2abb4ebad40233c8c0e4101bf Mon Sep 17 00:00:00 2001 From: David Nusinow Date: Thu, 4 Oct 2007 23:10:47 -0400 Subject: Don't release just yet. --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index ee088f58062..1d4da47ca7a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -mesa (7.0.1-3) unstable; urgency=low +mesa (7.0.1-3) UNRELEASED; urgency=low * Disable building i915tex. It was previously only built on x86 and amd64. It was never -- cgit v1.2.3 From c00dfefd6fa3b0446c51c965b7766531b9561f21 Mon Sep 17 00:00:00 2001 From: David Nusinow Date: Sat, 6 Oct 2007 17:54:13 -0400 Subject: Revert "Don't release just yet." This reverts commit c3de7b5ade1a46c2abb4ebad40233c8c0e4101bf. --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 1d4da47ca7a..ee088f58062 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -mesa (7.0.1-3) UNRELEASED; urgency=low +mesa (7.0.1-3) unstable; urgency=low * Disable building i915tex. It was previously only built on x86 and amd64. It was never -- cgit v1.2.3 From 8913402b749695ac163f6247e7ad3a06b5b5aa0c Mon Sep 17 00:00:00 2001 From: David Nusinow Date: Sat, 6 Oct 2007 17:54:29 -0400 Subject: Revert "* Disable building i915tex." This reverts commit 76556f82646d4a0db15a06e1392e24a6457b1642. --- configs/debian-dri-default | 2 +- debian/changelog | 9 --------- 2 files changed, 1 insertion(+), 10 deletions(-) (limited to 'debian') diff --git a/configs/debian-dri-default b/configs/debian-dri-default index 2a01bf8b7e3..f92c7eddd01 100644 --- a/configs/debian-dri-default +++ b/configs/debian-dri-default @@ -23,7 +23,7 @@ DRI_DIRS = mach64 mga r128 r200 r300 radeon s3v savage tdfx trident ARCH_X86 = i386 amd64 ifneq ($(findstring $(DEB_BUILD_ARCH), $(ARCH_X86)),) - DRI_DIRS += i810 i915 i965 sis unichrome + DRI_DIRS += i810 i915 i915tex i965 sis unichrome endif ifeq ($(DEB_BUILD_ARCH), sparc) diff --git a/debian/changelog b/debian/changelog index ee088f58062..b67350d13f1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,12 +1,3 @@ -mesa (7.0.1-3) unstable; urgency=low - - * Disable building i915tex. - It was previously only built on x86 and amd64. It was never - production-ready and relies on a kernel interface that never went - upstream. - - -- David Nusinow Thu, 04 Oct 2007 22:47:50 -0400 - mesa (7.0.1-2) unstable; urgency=low * Update to latest git (from mesa_7_0_branch) -- cgit v1.2.3 From e339b4e8da6443ed6f36cdebddf22b63a5ebc41a Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Sun, 11 Nov 2007 00:34:46 +0100 Subject: New upstream release --- debian/changelog | 11 ++++ debian/patches/04_cleanup-osmesa-configs.patch | 86 ++++++++++++++------------ debian/patches/05_static-nonpic.patch | 60 ------------------ debian/patches/series | 1 - 4 files changed, 58 insertions(+), 100 deletions(-) delete mode 100644 debian/patches/05_static-nonpic.patch (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index b67350d13f1..b69f2fdf204 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,14 @@ +mesa (7.0.2-1) UNRELEASED; 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 04_cleanup-osmesa-configs.patch. + + Drop 05_static-nonpic.patch,, applied upstream. + + -- Brice Goglin Sun, 11 Nov 2007 00:25:31 +0100 + mesa (7.0.1-2) unstable; urgency=low * Update to latest git (from mesa_7_0_branch) diff --git a/debian/patches/04_cleanup-osmesa-configs.patch b/debian/patches/04_cleanup-osmesa-configs.patch index ffc4de91fc5..68bd4775e13 100644 --- a/debian/patches/04_cleanup-osmesa-configs.patch +++ b/debian/patches/04_cleanup-osmesa-configs.patch @@ -1,8 +1,8 @@ -diff --git a/configs/linux-osmesa b/configs/linux-osmesa -index cc1fbbd..aabab59 100644 ---- a/configs/linux-osmesa -+++ b/configs/linux-osmesa -@@ -9,8 +9,17 @@ CONFIG_NAME = linux-osmesa +Index: mesa/configs/linux-osmesa +=================================================================== +--- mesa.orig/configs/linux-osmesa 2007-11-11 00:24:07.000000000 +0100 ++++ mesa/configs/linux-osmesa 2007-11-11 00:33:20.000000000 +0100 +@@ -9,8 +9,17 @@ # Compiler and flags CC = gcc CXX = g++ @@ -20,18 +20,18 @@ index cc1fbbd..aabab59 100644 + +CXXFLAGS = -ansi -pedantic $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) - - # Directories -@@ -23,3 +33,4 @@ PROGRAM_DIRS = osdemos + # Work around aliasing bugs - developers should comment this out + CFLAGS += -fno-strict-aliasing +@@ -26,3 +35,4 @@ OSMESA_LIB_DEPS = -lm -lpthread GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(OSMESA_LIB) APP_LIB_DEPS = -lOSMesa -lGLU + -diff --git a/configs/linux-osmesa-static b/configs/linux-osmesa-static -index 465f83c..eb3575f 100644 ---- a/configs/linux-osmesa-static -+++ b/configs/linux-osmesa-static -@@ -8,7 +8,8 @@ CONFIG_NAME = linux-osmesa-static +Index: mesa/configs/linux-osmesa-static +=================================================================== +--- mesa.orig/configs/linux-osmesa-static 2007-11-11 00:24:01.000000000 +0100 ++++ mesa/configs/linux-osmesa-static 2007-11-11 00:33:20.000000000 +0100 +@@ -8,7 +8,8 @@ # Compiler and flags MKLIB_OPTIONS = -static @@ -41,11 +41,11 @@ index 465f83c..eb3575f 100644 -OSMESA_LIB_NAME = libOSMesa.a +OSMESA_LIB_NAME = lib$(OSMESA_LIB).a -diff --git a/configs/linux-osmesa16 b/configs/linux-osmesa16 -index 1fb0186..2a06254 100644 ---- a/configs/linux-osmesa16 -+++ b/configs/linux-osmesa16 -@@ -1,28 +1,17 @@ +Index: mesa/configs/linux-osmesa16 +=================================================================== +--- mesa.orig/configs/linux-osmesa16 2007-11-11 00:24:07.000000000 +0100 ++++ mesa/configs/linux-osmesa16 2007-11-11 00:33:41.000000000 +0100 +@@ -1,31 +1,19 @@ # Configuration for 16 bits/channel OSMesa library on Linux -include $(TOP)/configs/default @@ -58,9 +58,12 @@ index 1fb0186..2a06254 100644 -CXX = g++ -CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include -DCHAN_BITS=16 -DDEFAULT_SOFTWARE_DEPTH_BITS=31 -CXXFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE +- + # Work around aliasing bugs - developers should comment this out + CFLAGS += -fno-strict-aliasing + CXXFLAGS += -fno-strict-aliasing - +DEFINES += -DCHAN_BITS=16 -DDEFAULT_SOFTWARE_DEPTH_BITS=32 - # Library names OSMESA_LIB = OSMesa16 -OSMESA_LIB_NAME = libOSMesa16.so @@ -78,11 +81,11 @@ index 1fb0186..2a06254 100644 -APP_LIB_DEPS = -lOSMesa16 +APP_LIB_DEPS = -l$(OSMESA_LIB) + -diff --git a/configs/linux-osmesa16-static b/configs/linux-osmesa16-static -index 6645504..894cf82 100644 ---- a/configs/linux-osmesa16-static -+++ b/configs/linux-osmesa16-static -@@ -1,28 +1,13 @@ +Index: mesa/configs/linux-osmesa16-static +=================================================================== +--- mesa.orig/configs/linux-osmesa16-static 2007-11-11 00:24:07.000000000 +0100 ++++ mesa/configs/linux-osmesa16-static 2007-11-11 00:33:20.000000000 +0100 +@@ -1,14 +1,10 @@ # Configuration for 16 bits/channel OSMesa library on Linux -include $(TOP)/configs/default @@ -96,29 +99,31 @@ index 6645504..894cf82 100644 -CFLAGS = -O3 -ansi -pedantic -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include -DCHAN_BITS=16 -DDEFAULT_SOFTWARE_DEPTH_BITS=31 -CXXFLAGS = -O3 -ansi -pedantic -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE MKLIB_OPTIONS = -static -- -+PIC_FLAGS = + PIC_FLAGS = + +@@ -17,16 +13,5 @@ + CXXFLAGS += -fno-strict-aliasing # Library names -OSMESA_LIB = OSMesa16 -OSMESA_LIB_NAME = libOSMesa16.a -- ++OSMESA_LIB_NAME = lib$(OSMESA_LIB).a + - -# Directories -SRC_DIRS = mesa glu -DRIVER_DIRS = osmesa -PROGRAM_DIRS = - -+OSMESA_LIB_NAME = lib$(OSMESA_LIB).a - +- -# Dependencies -OSMESA_LIB_DEPS = -lm -lpthread -APP_LIB_DEPS = -lOSMesa16 -diff --git a/configs/linux-osmesa32 b/configs/linux-osmesa32 -index a1e5a35..5a703f6 100644 ---- a/configs/linux-osmesa32 -+++ b/configs/linux-osmesa32 -@@ -1,28 +1,18 @@ +Index: mesa/configs/linux-osmesa32 +=================================================================== +--- mesa.orig/configs/linux-osmesa32 2007-11-11 00:24:07.000000000 +0100 ++++ mesa/configs/linux-osmesa32 2007-11-11 00:33:51.000000000 +0100 +@@ -1,31 +1,22 @@ # Configuration for 32 bits/channel OSMesa library on Linux -include $(TOP)/configs/default @@ -131,7 +136,10 @@ index a1e5a35..5a703f6 100644 -CXX = g++ -CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include -DCHAN_BITS=32 -DDEFAULT_SOFTWARE_DEPTH_BITS=31 -CXXFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -- + + # Work around aliasing bugs - developers should comment this out + CFLAGS += -fno-strict-aliasing + CXXFLAGS += -fno-strict-aliasing +DEFINES += -DCHAN_BITS=32 -DDEFAULT_SOFTWARE_DEPTH_BITS=31 # Library names @@ -151,10 +159,10 @@ index a1e5a35..5a703f6 100644 -APP_LIB_DEPS = -lOSMesa32 +APP_LIB_DEPS = -l$(OSMESA_LIB) + -diff --git a/configs/linux-osmesa32-static b/configs/linux-osmesa32-static -index 6db8bc0..ecbb72e 100644 ---- a/configs/linux-osmesa32-static -+++ b/configs/linux-osmesa32-static +Index: mesa/configs/linux-osmesa32-static +=================================================================== +--- mesa.orig/configs/linux-osmesa32-static 2007-11-11 00:24:01.000000000 +0100 ++++ mesa/configs/linux-osmesa32-static 2007-11-11 00:33:20.000000000 +0100 @@ -1,28 +1,13 @@ # Configuration for 32 bits/channel OSMesa library on Linux diff --git a/debian/patches/05_static-nonpic.patch b/debian/patches/05_static-nonpic.patch deleted file mode 100644 index a6b7f4054ee..00000000000 --- a/debian/patches/05_static-nonpic.patch +++ /dev/null @@ -1,60 +0,0 @@ -diff --git a/configs/linux-alpha-static b/configs/linux-alpha-static -index 2a30af9..eb6a08a 100644 ---- a/configs/linux-alpha-static -+++ b/configs/linux-alpha-static -@@ -11,6 +11,7 @@ CFLAGS = -O3 -mcpu=ev5 -ansi -mieee -pedantic -D_XOPEN_SOURCE -DUSE_XSHM - CXXFLAGS = -O3 -mcpu=ev5 -ansi -mieee -pedantic -D_XOPEN_SOURCE - GLUT_CFLAGS = -fexceptions - MKLIB_OPTIONS = -static -+PIC_FLAGS = - - - # Library names (actual file names) -diff --git a/configs/linux-ppc-static b/configs/linux-ppc-static -index d0e1688..3f3dc55 100644 ---- a/configs/linux-ppc-static -+++ b/configs/linux-ppc-static -@@ -5,6 +5,7 @@ include $(TOP)/configs/linux-ppc - CONFIG_NAME = linux-ppc-static - - MKLIB_OPTIONS = -static -+PIC_FLAGS = - - # Library names (actual file names) - GL_LIB_NAME = libGL.a -diff --git a/configs/linux-static b/configs/linux-static -index 85141ea..1592668 100644 ---- a/configs/linux-static -+++ b/configs/linux-static -@@ -5,6 +5,7 @@ include $(TOP)/configs/linux - CONFIG_NAME = linux-static - - MKLIB_OPTIONS = -static -+PIC_FLAGS = - - # Library names (actual file names) - GL_LIB_NAME = libGL.a -diff --git a/configs/linux-x86-64-static b/configs/linux-x86-64-static -index 0257430..2d0b664 100644 ---- a/configs/linux-x86-64-static -+++ b/configs/linux-x86-64-static -@@ -5,6 +5,7 @@ include $(TOP)/configs/linux-x86-64 - CONFIG_NAME = linux-x86-64-static - - MKLIB_OPTIONS = -static -+PIC_FLAGS = - - # Library names (actual file names) - GL_LIB_NAME = libGL.a -diff --git a/configs/linux-x86-static b/configs/linux-x86-static -index 9915987..e6a3696 100644 ---- a/configs/linux-x86-static -+++ b/configs/linux-x86-static -@@ -5,6 +5,7 @@ include $(TOP)/configs/linux-x86 - CONFIG_NAME = linux-x86-static - - MKLIB_OPTIONS = -static -+PIC_FLAGS = - - # Library names (actual file names) - GL_LIB_NAME = libGL.a diff --git a/debian/patches/series b/debian/patches/series index 280a2f3548e..61b5df2292c 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -3,4 +3,3 @@ 02_use-ieee-fp-on-s390-and-m68k.patch 03_optional-progs-and-install.patch 04_cleanup-osmesa-configs.patch -05_static-nonpic.patch -- cgit v1.2.3 From 0595d32d8af331fffb616011a22ebe888cb05158 Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Sun, 11 Nov 2007 11:48:32 +0100 Subject: Refresh 03_optional-progs-and-install.patch The default Makefile requires libGLU to be built while linking progs/xdemos. However, we don't build libGLU and progs/xdemos at the same time, and these progs don't actually need libGLU. --- debian/changelog | 2 ++ debian/patches/03_optional-progs-and-install.patch | 28 ++++++++++++++++------ 2 files changed, 23 insertions(+), 7 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index b69f2fdf204..f38deceba56 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,8 @@ mesa (7.0.2-1) UNRELEASED; urgency=low + 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. diff --git a/debian/patches/03_optional-progs-and-install.patch b/debian/patches/03_optional-progs-and-install.patch index 66a4771003b..c5f8b12e84f 100644 --- a/debian/patches/03_optional-progs-and-install.patch +++ b/debian/patches/03_optional-progs-and-install.patch @@ -5,19 +5,31 @@ Provide an install target for installing the programs in $(INSTALL_DIR)/bin. This patch by Thierry Reding. Not submitted to Mesa. +-- +Also remove references to GLU library since it is not required +and we don't actually build it at this point. ---- a/progs/xdemos/Makefile -+++ b/progs/xdemos/Makefile -@@ -8,7 +8,7 @@ + +Index: mesa/progs/xdemos/Makefile +=================================================================== +--- mesa.orig/progs/xdemos/Makefile 2007-11-11 00:34:12.000000000 +0100 ++++ mesa/progs/xdemos/Makefile 2007-11-11 02:07:52.000000000 +0100 +@@ -6,11 +6,11 @@ + + INCDIR = $(TOP)/include + +-LIB_DEP = $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) $(TOP)/$(LIB_DIR)/$(GLU_LIB_NAME) ++LIB_DEP = $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) - LIB_DEP = $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) $(TOP)/$(LIB_DIR)/$(GLU_LIB_NAME) +-LIBS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) $(APP_LIB_DEPS) ++LIBS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) $(APP_LIB_DEPS) -PROGS = glthreads \ +PROGS ?= glthreads \ glxdemo \ glxgears \ glxgears_fbconfig \ -@@ -44,6 +44,9 @@ +@@ -46,6 +46,9 @@ default: $(PROGS) @@ -27,8 +39,10 @@ Not submitted to Mesa. clean: -rm -f $(PROGS) ---- a/progs/Makefile -+++ b/progs/Makefile +Index: mesa/progs/Makefile +=================================================================== +--- mesa.orig/progs/Makefile 2007-11-11 00:34:12.000000000 +0100 ++++ mesa/progs/Makefile 2007-11-11 02:06:48.000000000 +0100 @@ -21,8 +21,12 @@ fi \ done -- cgit v1.2.3 From 5cedd4a43e162da644360e1cbb390dcf03285723 Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Sun, 11 Nov 2007 11:49:16 +0100 Subject: Remove DESTDIR from INSTALL_DIR in configs/debian-default ... and update 03_optional-progs-and-install.patch accordingly. --- configs/debian-default | 2 +- debian/changelog | 2 ++ debian/patches/03_optional-progs-and-install.patch | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) (limited to 'debian') diff --git a/configs/debian-default b/configs/debian-default index aa4721a9ee4..f80ec30f0b6 100644 --- a/configs/debian-default +++ b/configs/debian-default @@ -12,7 +12,7 @@ EXTRA_LIB_PATH = SRC_DIRS = mesa PROGRAM_DIRS = -INSTALL_DIR = $(DESTDIR)/usr +INSTALL_DIR = /usr # vim: ft=make diff --git a/debian/changelog b/debian/changelog index f38deceba56..418d5a01210 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,6 +8,8 @@ mesa (7.0.2-1) UNRELEASED; urgency=low 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. -- Brice Goglin Sun, 11 Nov 2007 00:25:31 +0100 diff --git a/debian/patches/03_optional-progs-and-install.patch b/debian/patches/03_optional-progs-and-install.patch index c5f8b12e84f..f802a429601 100644 --- a/debian/patches/03_optional-progs-and-install.patch +++ b/debian/patches/03_optional-progs-and-install.patch @@ -34,8 +34,8 @@ Index: mesa/progs/xdemos/Makefile default: $(PROGS) +install: $(PROGS) -+ $(INSTALL) -d $(INSTALL_DIR)/bin -+ $(INSTALL) -m 755 $(PROGS) $(INSTALL_DIR)/bin ++ $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/bin ++ $(INSTALL) -m 755 $(PROGS) $(DESTDIR)$(INSTALL_DIR)/bin clean: -rm -f $(PROGS) -- cgit v1.2.3 From caf283329bcadae964fdc2a419661ac760a6506a Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Sun, 11 Nov 2007 11:55:05 +0100 Subject: Prepare changelog for upload --- debian/changelog | 5 +++-- debian/control | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 418d5a01210..9b7c8d3a89b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -mesa (7.0.2-1) UNRELEASED; urgency=low +mesa (7.0.2-1) unstable; urgency=low * New upstream release. + Fix Blender crash in triangle_twoside(), closes: #439668, #446315. @@ -10,8 +10,9 @@ mesa (7.0.2-1) UNRELEASED; urgency=low + 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 00:25:31 +0100 + -- Brice Goglin Sun, 11 Nov 2007 11:53:26 +0100 mesa (7.0.1-2) unstable; urgency=low diff --git a/debian/control b/debian/control index 0cfb97165d8..ec78060b267 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: mesa Section: graphics Priority: optional Maintainer: Debian X Strike Force -Uploaders: Thierry Reding , Julien Cristau , David Nusinow +Uploaders: Thierry Reding , Julien Cristau , David Nusinow , Brice Goglin Standards-Version: 3.7.2 Build-Depends: debhelper (>= 5), quilt (>= 0.40), pkg-config, libdrm-dev (>= 2.2.0) [!hurd-i386], libx11-dev, xutils-dev, x11proto-gl-dev (>= 1.4.8), libxxf86vm-dev, libexpat1-dev, lesstif2-dev, dpkg-dev (>= 1.13.19), libxfixes-dev, libxdamage-dev -- cgit v1.2.3 From e1613ab80d7ccfbba99792173f5f94301d2c2af3 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Tue, 13 Nov 2007 20:57:58 +0100 Subject: Don't set -fno-strict-aliasing in configs/debian-default. Upstream uses that since 7.0.2. --- configs/debian-default | 1 - debian/changelog | 7 +++++++ 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'debian') diff --git a/configs/debian-default b/configs/debian-default index f80ec30f0b6..8d1b785ee00 100644 --- a/configs/debian-default +++ b/configs/debian-default @@ -3,7 +3,6 @@ CONFIG_NAME = debian-default OPT_FLAGS = -O2 -g -CFLAGS += -fno-strict-aliasing # override settings in configs/linux-x86-64 LIB_DIR = lib diff --git a/debian/changelog b/debian/changelog index 9b7c8d3a89b..c1878168630 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +mesa (7.0.2-2) UNRELEASED; urgency=low + + * Don't set -fno-strict-aliasing in configs/debian-default. It is set + upstream now. + + -- Julien Cristau Tue, 13 Nov 2007 20:56:41 +0100 + mesa (7.0.2-1) unstable; urgency=low * New upstream release. -- cgit v1.2.3 From 4971a009e0dd9a68be4b4ca679765ab23e37717d Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Tue, 13 Nov 2007 20:59:08 +0100 Subject: * Workaround gcc ICE on hppa: build libOSMesa with -O0 (see bug#451047). --- configs/debian-osmesa-default | 4 ++++ debian/changelog | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'debian') diff --git a/configs/debian-osmesa-default b/configs/debian-osmesa-default index ef5a5ba0c7c..0d5d4137ee2 100644 --- a/configs/debian-osmesa-default +++ b/configs/debian-osmesa-default @@ -6,5 +6,9 @@ CONFIG_NAME = debian-osmesa-default DRIVER_DIRS = osmesa +ifeq ($(DEB_BUILD_ARCH), hppa) + OPT_FLAGS = -g -O0 +endif + # vim: ft=make diff --git a/debian/changelog b/debian/changelog index c1878168630..b8dab0102ec 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,8 +2,9 @@ mesa (7.0.2-2) UNRELEASED; urgency=low * 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). - -- Julien Cristau Tue, 13 Nov 2007 20:56:41 +0100 + -- Julien Cristau Tue, 13 Nov 2007 20:58:22 +0100 mesa (7.0.2-1) unstable; urgency=low -- cgit v1.2.3 From 1bf7ce97c01e391bb3debc04fdc5e24543334e97 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Tue, 13 Nov 2007 21:40:49 +0100 Subject: * Add build-dep on libxext-dev. Thanks, Timo Aaltonen! --- debian/changelog | 3 ++- debian/control | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index b8dab0102ec..dd265598478 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,8 +3,9 @@ mesa (7.0.2-2) UNRELEASED; urgency=low * 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! - -- Julien Cristau Tue, 13 Nov 2007 20:58:22 +0100 + -- Julien Cristau Tue, 13 Nov 2007 21:40:14 +0100 mesa (7.0.2-1) unstable; urgency=low diff --git a/debian/control b/debian/control index ec78060b267..530ac810aa0 100644 --- a/debian/control +++ b/debian/control @@ -4,7 +4,7 @@ Priority: optional Maintainer: Debian X Strike Force Uploaders: Thierry Reding , Julien Cristau , David Nusinow , Brice Goglin Standards-Version: 3.7.2 -Build-Depends: debhelper (>= 5), quilt (>= 0.40), pkg-config, libdrm-dev (>= 2.2.0) [!hurd-i386], libx11-dev, xutils-dev, x11proto-gl-dev (>= 1.4.8), libxxf86vm-dev, libexpat1-dev, lesstif2-dev, dpkg-dev (>= 1.13.19), libxfixes-dev, libxdamage-dev +Build-Depends: debhelper (>= 5), quilt (>= 0.40), pkg-config, libdrm-dev (>= 2.2.0) [!hurd-i386], libx11-dev, xutils-dev, x11proto-gl-dev (>= 1.4.8), libxxf86vm-dev, libexpat1-dev, lesstif2-dev, dpkg-dev (>= 1.13.19), libxfixes-dev, libxdamage-dev, libxext-dev Package: libgl1-mesa-swx11 Section: libs -- cgit v1.2.3 From ae0bf74db93b5c3f9260fefd3546dccfea1e80fc Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Tue, 13 Nov 2007 21:44:00 +0100 Subject: Prepare changelog for upload --- debian/changelog | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index dd265598478..fc46e4e41fe 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,11 +1,12 @@ -mesa (7.0.2-2) UNRELEASED; urgency=low +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! - -- Julien Cristau Tue, 13 Nov 2007 21:40:14 +0100 + -- Brice Goglin Tue, 13 Nov 2007 21:43:40 +0100 mesa (7.0.2-1) unstable; urgency=low -- cgit v1.2.3 From b7f901088b826407e4e52f88a1feb971cc8a87ea Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Tue, 18 Dec 2007 13:32:01 +0100 Subject: Update changelog. --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index fc46e4e41fe..3bba7daa982 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +mesa (7.0.2-3) UNRELEASED; urgency=low + + * Update to mesa_7_0_branch head (commit 0107acde). + + -- Julien Cristau Tue, 18 Dec 2007 12:34:58 +0100 + mesa (7.0.2-2) unstable; urgency=low [ Julien Cristau ] -- cgit v1.2.3 From 942372dcdfa638a86e646f632b90b16e0901ecb0 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Tue, 18 Dec 2007 13:56:55 +0100 Subject: debian/control fixups * 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. --- debian/changelog | 10 ++++++++-- debian/control | 14 ++++++++------ 2 files changed, 16 insertions(+), 8 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 3bba7daa982..455d12faee9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,14 @@ mesa (7.0.2-3) UNRELEASED; urgency=low * Update to mesa_7_0_branch head (commit 0107acde). - - -- Julien Cristau Tue, 18 Dec 2007 12:34:58 +0100 + * 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 13:32:25 +0100 mesa (7.0.2-2) unstable; urgency=low diff --git a/debian/control b/debian/control index 530ac810aa0..ce7d201ab7b 100644 --- a/debian/control +++ b/debian/control @@ -3,11 +3,12 @@ Section: graphics Priority: optional Maintainer: Debian X Strike Force Uploaders: Thierry Reding , Julien Cristau , David Nusinow , Brice Goglin -Standards-Version: 3.7.2 +Standards-Version: 3.7.3 Build-Depends: debhelper (>= 5), quilt (>= 0.40), pkg-config, libdrm-dev (>= 2.2.0) [!hurd-i386], libx11-dev, xutils-dev, x11proto-gl-dev (>= 1.4.8), libxxf86vm-dev, libexpat1-dev, lesstif2-dev, dpkg-dev (>= 1.13.19), libxfixes-dev, libxdamage-dev, libxext-dev Package: libgl1-mesa-swx11 Section: libs +Priority: extra Architecture: any Depends: ${shlibs:Depends}, libosmesa6 (>= 6.5.2-1) Conflicts: mesag3-glide, mesag3-glide2, mesag3+ggi, libgl1, nvidia-glx, mesag3, libgl1-mesa-swrast @@ -28,7 +29,7 @@ Description: A free implementation of the OpenGL API -- runtime On Linux, this library is also known as libGL or libGL.so.1. Package: libgl1-mesa-swx11-dbg -Section: libs +Section: libdevel Priority: extra Architecture: any Depends: libgl1-mesa-swx11 (= ${binary:Version}) @@ -78,6 +79,7 @@ Description: Mesa OpenGL runtime [i686 optimized] Package: libgl1-mesa-swx11-dev Section: libdevel +Priority: extra Architecture: any Depends: libgl1-mesa-swx11 (= ${binary:Version}), libc6-dev, libx11-dev, libxext6, mesa-common-dev (= ${source:Version}) Provides: libgl-dev, mesag-dev, libgl1-mesa-swrast-dev @@ -229,14 +231,14 @@ Description: A free implementation of the OpenGL API -- GLX development files package. Package: mesa-common-dev -Section: devel +Section: libdevel Architecture: all Replaces: xlibmesa-gl-dev (<< 1:7), xlibosmesa-dev, libgl1-mesa-swx11-dev (<< 6.5.2), libgl1-mesa-dev (<< 6.5.2) Depends: libx11-dev Description: Developer documentation for Mesa This package includes the specifications for the Mesa-specific OpenGL - extensions, the complete set of release release notes and the - development header files common to all Mesa packages. + extensions, the complete set of release notes and the development header + files common to all Mesa packages. Package: libosmesa6 Section: libs @@ -252,7 +254,7 @@ Description: Mesa Off-screen rendering extension renderer which do not require external libraries to work. Package: libosmesa6-dev -Section: devel +Section: libdevel Architecture: any Depends: libosmesa6 (= ${binary:Version}), mesa-common-dev (= ${source:Version}) | libgl-dev Conflicts: xlibosmesa-dev, libosmesa4-dev, libosmesa-dev -- cgit v1.2.3 From 9fd22f0e3f50b64c925b5ba6c15f97a587bdd8c5 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Tue, 18 Dec 2007 19:13:27 +0100 Subject: Prepare changelog for upload. --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 455d12faee9..fdec2d04182 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -mesa (7.0.2-3) UNRELEASED; urgency=low +mesa (7.0.2-3) unstable; urgency=low * Update to mesa_7_0_branch head (commit 0107acde). * Bump Standards-Version to 3.7.3. @@ -8,7 +8,7 @@ mesa (7.0.2-3) UNRELEASED; urgency=low libgl1-mesa-swx11-dev to priority extra. * Fix typo in mesa-common-dev's long description. - -- Julien Cristau Tue, 18 Dec 2007 13:32:25 +0100 + -- Julien Cristau Tue, 18 Dec 2007 19:13:18 +0100 mesa (7.0.2-2) unstable; urgency=low -- cgit v1.2.3 From 09504dde1f8e3f2e2b99d7d1bab62df065323922 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Thu, 17 Jan 2008 22:26:48 +0100 Subject: Update changelog; add Vcs-* and Homepage fields in debian/control. --- debian/changelog | 7 +++++++ debian/control | 3 +++ 2 files changed, 10 insertions(+) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index fdec2d04182..155da7e8dd8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +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-3) unstable; urgency=low * Update to mesa_7_0_branch head (commit 0107acde). diff --git a/debian/control b/debian/control index ce7d201ab7b..2fd579f151f 100644 --- a/debian/control +++ b/debian/control @@ -5,6 +5,9 @@ Maintainer: Debian X Strike Force Uploaders: Thierry Reding , Julien Cristau , David Nusinow , Brice Goglin Standards-Version: 3.7.3 Build-Depends: debhelper (>= 5), quilt (>= 0.40), pkg-config, libdrm-dev (>= 2.2.0) [!hurd-i386], libx11-dev, xutils-dev, x11proto-gl-dev (>= 1.4.8), libxxf86vm-dev, libexpat1-dev, lesstif2-dev, dpkg-dev (>= 1.13.19), libxfixes-dev, libxdamage-dev, libxext-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 -- cgit v1.2.3 From 67617c8f89c06b6804d65db1380b00853b97c254 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Thu, 24 Jan 2008 22:52:28 +0100 Subject: Drop -O0 workaround on hppa. Stop building with -O0 on hppa. Bug #451047 should be fixed in recent gcc versions. --- configs/debian-osmesa-default | 4 ---- debian/changelog | 7 +++++++ 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'debian') diff --git a/configs/debian-osmesa-default b/configs/debian-osmesa-default index 0d5d4137ee2..ef5a5ba0c7c 100644 --- a/configs/debian-osmesa-default +++ b/configs/debian-osmesa-default @@ -6,9 +6,5 @@ CONFIG_NAME = debian-osmesa-default DRIVER_DIRS = osmesa -ifeq ($(DEB_BUILD_ARCH), hppa) - OPT_FLAGS = -g -O0 -endif - # vim: ft=make diff --git a/debian/changelog b/debian/changelog index 155da7e8dd8..cb2edef18a6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +mesa (7.0.2-5) UNRELEASED; urgency=low + + * Stop building with -O0 on hppa. Bug #451047 should be fixed in recent gcc + versions. + + -- Julien Cristau Thu, 24 Jan 2008 22:51:04 +0100 + mesa (7.0.2-4) unstable; urgency=low * Update to mesa_7_0_branch head (commit 48ae5cf0). -- cgit v1.2.3 From eaac94c35af22606047dd22f8238406134a795c9 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Fri, 22 Feb 2008 12:16:27 +0100 Subject: Update changelog. --- debian/changelog | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index cb2edef18a6..34fbf409440 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,6 @@ -mesa (7.0.2-5) UNRELEASED; urgency=low +mesa (7.0.3~rc2-1) UNRELEASED; urgency=low + * New upstream release candidate. * Stop building with -O0 on hppa. Bug #451047 should be fixed in recent gcc versions. -- cgit v1.2.3 From ea9c6d3d9e9d27c8ba90c98ca671cff6e333c620 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Sat, 23 Feb 2008 16:08:53 +0100 Subject: 03_optional-progs-and-install.patch: partly applied upstream, fixed up --- debian/changelog | 1 + debian/patches/03_optional-progs-and-install.patch | 38 +++++++++------------- 2 files changed, 16 insertions(+), 23 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 34fbf409440..c348a3e994e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,7 @@ mesa (7.0.3~rc2-1) UNRELEASED; urgency=low * New upstream release candidate. + + 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. diff --git a/debian/patches/03_optional-progs-and-install.patch b/debian/patches/03_optional-progs-and-install.patch index f802a429601..c00280353ec 100644 --- a/debian/patches/03_optional-progs-and-install.patch +++ b/debian/patches/03_optional-progs-and-install.patch @@ -10,39 +10,31 @@ Also remove references to GLU library since it is not required and we don't actually build it at this point. -Index: mesa/progs/xdemos/Makefile -=================================================================== ---- mesa.orig/progs/xdemos/Makefile 2007-11-11 00:34:12.000000000 +0100 -+++ mesa/progs/xdemos/Makefile 2007-11-11 02:07:52.000000000 +0100 -@@ -6,11 +6,11 @@ +--- mesa.orig/progs/xdemos/Makefile ++++ mesa/progs/xdemos/Makefile +@@ -10,7 +10,7 @@ - INCDIR = $(TOP)/include + LIBS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) $(APP_LIB_DEPS) --LIB_DEP = $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) $(TOP)/$(LIB_DIR)/$(GLU_LIB_NAME) -+LIB_DEP = $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) - --LIBS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) $(APP_LIB_DEPS) -+LIBS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) $(APP_LIB_DEPS) - --PROGS = glthreads \ -+PROGS ?= glthreads \ +-PROGS = \ ++PROGS ?= \ + glthreads \ glxdemo \ glxgears \ - glxgears_fbconfig \ -@@ -46,6 +46,9 @@ +@@ -55,6 +55,11 @@ + extra: $(EXTRA_PROGS) - default: $(PROGS) +install: $(PROGS) + $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/bin + $(INSTALL) -m 755 $(PROGS) $(DESTDIR)$(INSTALL_DIR)/bin - ++ ++ clean: - -rm -f $(PROGS) -Index: mesa/progs/Makefile -=================================================================== ---- mesa.orig/progs/Makefile 2007-11-11 00:34:12.000000000 +0100 -+++ mesa/progs/Makefile 2007-11-11 02:06:48.000000000 +0100 + -rm -f $(PROGS) $(EXTRA_PROGS) + -rm -f *.o *~ +--- mesa.orig/progs/Makefile ++++ mesa/progs/Makefile @@ -21,8 +21,12 @@ fi \ done -- cgit v1.2.3 From 31e9d9d4f85740613a828452a2f2beb801de7878 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Sat, 23 Feb 2008 18:18:42 +0100 Subject: Prepare changelog for upload. --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index c348a3e994e..c31d56174a6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,11 +1,11 @@ -mesa (7.0.3~rc2-1) UNRELEASED; urgency=low +mesa (7.0.3~rc2-1) unstable; urgency=low * New upstream release candidate. + 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 Thu, 24 Jan 2008 22:51:04 +0100 + -- Julien Cristau Sat, 23 Feb 2008 18:18:29 +0100 mesa (7.0.2-4) unstable; urgency=low -- cgit v1.2.3 From d89cf0649e2cabff8aa41dea77a6a8e8b9319d0e Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Sun, 24 Feb 2008 10:23:17 +0100 Subject: Add bug closer for #408679. --- debian/changelog | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index c31d56174a6..e643373ea73 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,11 +1,12 @@ 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 Sat, 23 Feb 2008 18:18:29 +0100 + -- Julien Cristau Sun, 24 Feb 2008 10:22:54 +0100 mesa (7.0.2-4) unstable; urgency=low -- cgit v1.2.3 From 5379b84e633d43a80707058f95ef4e8f361dead0 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Mon, 31 Mar 2008 13:11:59 +0200 Subject: Update changelog and add bug closer --- debian/changelog | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index e643373ea73..6c0de48ff2f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +mesa (7.0.3~rc2-2) UNRELEASED; urgency=low + + * Pull from mesa_7_0_branch (1e83d70b). + * Fixes regression in the i965 dri driver (closes: #470984, #470084) + + -- Julien Cristau Mon, 31 Mar 2008 13:02:39 +0200 + mesa (7.0.3~rc2-1) unstable; urgency=low * New upstream release candidate. -- cgit v1.2.3 From b23d9088295bbc4bacc0e60eee1075fa36ebd734 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Mon, 31 Mar 2008 13:17:13 +0200 Subject: Update 02_use-ieee-fp-on-s390-and-m68k.patch. --- debian/changelog | 1 + debian/patches/02_use-ieee-fp-on-s390-and-m68k.patch | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 6c0de48ff2f..101630c21cc 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,7 @@ mesa (7.0.3~rc2-2) UNRELEASED; 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. -- Julien Cristau Mon, 31 Mar 2008 13:02:39 +0200 diff --git a/debian/patches/02_use-ieee-fp-on-s390-and-m68k.patch b/debian/patches/02_use-ieee-fp-on-s390-and-m68k.patch index ddc71983b1e..8168f29d3ef 100644 --- a/debian/patches/02_use-ieee-fp-on-s390-and-m68k.patch +++ b/debian/patches/02_use-ieee-fp-on-s390-and-m68k.patch @@ -12,7 +12,7 @@ Index: mesa/src/mesa/main/imports.h #if defined(__i386__) || defined(__386__) || defined(__sparc__) || \ - defined(__s390x__) || defined(__powerpc__) || \ + defined(__s390__) || defined(__s390x__) || defined(__powerpc__) || \ - defined(__amd64__) || \ + defined(__amd64__) || defined(__x86_64__) || \ + defined(__m68k__) || \ defined(ia64) || defined(__ia64__) || \ defined(__hppa__) || defined(hpux) || \ -- cgit v1.2.3 From 7c614b466679445abeb91764bf90da3d6bd15073 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Mon, 31 Mar 2008 16:47:17 +0200 Subject: Fix libgl1-mesa-swx11-i686's dependencies Change libgl1-mesa-swx11-i686's pre-dependency on libgl1-mesa-swx11 to a regular versioned dependency, and add ${shlibs:Depends}. I'm not sure why this used Pre-Depends in the first place, I don't think that's needed. --- debian/changelog | 2 ++ debian/control | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 101630c21cc..ab79d2a64b3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,8 @@ mesa (7.0.3~rc2-2) UNRELEASED; 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 13:02:39 +0200 diff --git a/debian/control b/debian/control index 2fd579f151f..bf3ce80733e 100644 --- a/debian/control +++ b/debian/control @@ -60,7 +60,7 @@ Package: libgl1-mesa-swx11-i686 Section: libs Priority: extra Architecture: i386 -Pre-Depends: libgl1-mesa-swx11 +Depends: libgl1-mesa-swx11 (= ${binary:Version}), ${shlibs: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 -- cgit v1.2.3 From 2e5a63f365b77a179c837e4a34ee9f18c2056b17 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Mon, 31 Mar 2008 16:47:34 +0200 Subject: Prepare changelog for upload --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index ab79d2a64b3..a332e6fd777 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -mesa (7.0.3~rc2-2) UNRELEASED; urgency=low +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) @@ -6,7 +6,7 @@ mesa (7.0.3~rc2-2) UNRELEASED; urgency=low * 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 13:02:39 +0200 + -- Julien Cristau Mon, 31 Mar 2008 16:47:31 +0200 mesa (7.0.3~rc2-1) unstable; urgency=low -- cgit v1.2.3 From 666e0635da4e14e2f41e1883093079fd013d2b89 Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Fri, 11 Apr 2008 08:41:32 +0200 Subject: New upstream release --- debian/changelog | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index a332e6fd777..fb53586e785 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +mesa (7.0.3-1) UNRELEASED; urgency=low + + * New upstream release. + * Only call ProgramStringNotify if program parsing succeeded, + closes: #473551. + + -- Brice Goglin Fri, 11 Apr 2008 08:40:42 +0200 + mesa (7.0.3~rc2-2) unstable; urgency=low * Pull from mesa_7_0_branch (1e83d70b). -- cgit v1.2.3 From 59c9c40c010ac815668ee4c411003f93aeff857d Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Fri, 11 Apr 2008 08:42:55 +0200 Subject: Prepare changelog for upload --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index fb53586e785..c1262a9a0bc 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,10 @@ -mesa (7.0.3-1) UNRELEASED; urgency=low +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:40:42 +0200 + -- Brice Goglin Fri, 11 Apr 2008 08:42:37 +0200 mesa (7.0.3~rc2-2) unstable; urgency=low -- cgit v1.2.3 From 9676f0cffc30b5414e7cc5bd2119d5bb396596c3 Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Tue, 10 Jun 2008 23:18:28 +0200 Subject: Pull from mesa_7_0_branch --- debian/changelog | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index c1262a9a0bc..a340b444f19 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +mesa (7.0.3-2) UNRELEASED; urgency=low + + * Pull from mesa_7_0_branch (6f4c8b5b). + * 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. + + -- Brice Goglin Tue, 10 Jun 2008 23:15:21 +0200 + mesa (7.0.3-1) unstable; urgency=low * New upstream release. -- cgit v1.2.3 From 2fa795a213ff2671556817dc8f0d57525267cef0 Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Wed, 11 Jun 2008 18:59:59 +0200 Subject: Pull from mesa_7_0_branch --- debian/changelog | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index a340b444f19..04ae30cfec9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,11 +1,14 @@ mesa (7.0.3-2) UNRELEASED; urgency=low - * Pull from mesa_7_0_branch (6f4c8b5b). + * 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 Tue, 10 Jun 2008 23:15:21 +0200 + -- Brice Goglin Wed, 11 Jun 2008 10:56:08 +0200 mesa (7.0.3-1) unstable; urgency=low -- cgit v1.2.3 From fe4264bf4558bf9e3e4b39d5a4b5293f72a5f16e Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Fri, 13 Jun 2008 06:53:55 +0200 Subject: Prepare changelog for upload --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 04ae30cfec9..8870f31c11a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -mesa (7.0.3-2) UNRELEASED; urgency=low +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. @@ -8,7 +8,7 @@ mesa (7.0.3-2) UNRELEASED; urgency=low closes: #451339. * Disable low impact fallback on r300 by default, closes: #440868. - -- Brice Goglin Wed, 11 Jun 2008 10:56:08 +0200 + -- Brice Goglin Fri, 13 Jun 2008 06:53:29 +0200 mesa (7.0.3-1) unstable; urgency=low -- cgit v1.2.3 From 03970183fc9998bcdee9389830493a0b2dcda8d2 Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Tue, 17 Jun 2008 19:31:28 +0200 Subject: Move our configs/ changes from the .diff.gz into our quilt patches with 04_cleanup-osmesa-configs.patch renamed into 04_debian-configs.patch --- configs/debian-default | 17 - configs/debian-dri-amd64 | 9 - configs/debian-dri-any | 9 - configs/debian-dri-default | 36 - configs/debian-dri-i386 | 9 - configs/debian-dri-i386-i686 | 14 - configs/debian-dri-optimized-default | 13 - configs/debian-indirect-default | 7 - configs/debian-indirect-hurd-i386 | 9 - configs/debian-osmesa | 9 - configs/debian-osmesa-default | 10 - configs/debian-osmesa-static | 9 - configs/debian-osmesa16 | 10 - configs/debian-osmesa16-static | 10 - configs/debian-osmesa32 | 10 - configs/debian-osmesa32-static | 10 - configs/debian-swx11+glu-alpha-ev5 | 12 - configs/debian-swx11+glu-amd64 | 10 - configs/debian-swx11+glu-any | 9 - configs/debian-swx11+glu-default | 14 - configs/debian-swx11+glu-i386 | 10 - configs/debian-swx11+glu-i386-i686 | 14 - configs/debian-swx11+glu-powerpc-603 | 13 - configs/debian-swx11+glu-ppc64 | 11 - configs/debian-swx11+glu-sparc | 10 - configs/debian-swx11+glu-sparc-ultrasparc | 13 - configs/debian-swx11+glu-static-amd64 | 10 - configs/debian-swx11+glu-static-any | 10 - configs/debian-swx11+glu-static-i386 | 10 - configs/debian-swx11+glu-static-ppc64 | 11 - configs/default-bp | 75 --- configs/linux-dri-bp | 55 -- configs/linux-osmesa-static | 14 - configs/linux-osmesa32-static | 28 - configs/linux-tcc | 22 - debian/changelog | 8 + debian/patches/04_cleanup-osmesa-configs.patch | 197 ------ debian/patches/04_debian-configs.patch | 892 +++++++++++++++++++++++++ debian/patches/series | 2 +- 39 files changed, 901 insertions(+), 740 deletions(-) delete mode 100644 configs/debian-default delete mode 100644 configs/debian-dri-amd64 delete mode 100644 configs/debian-dri-any delete mode 100644 configs/debian-dri-default delete mode 100644 configs/debian-dri-i386 delete mode 100644 configs/debian-dri-i386-i686 delete mode 100644 configs/debian-dri-optimized-default delete mode 100644 configs/debian-indirect-default delete mode 100644 configs/debian-indirect-hurd-i386 delete mode 100644 configs/debian-osmesa delete mode 100644 configs/debian-osmesa-default delete mode 100644 configs/debian-osmesa-static delete mode 100644 configs/debian-osmesa16 delete mode 100644 configs/debian-osmesa16-static delete mode 100644 configs/debian-osmesa32 delete mode 100644 configs/debian-osmesa32-static delete mode 100644 configs/debian-swx11+glu-alpha-ev5 delete mode 100644 configs/debian-swx11+glu-amd64 delete mode 100644 configs/debian-swx11+glu-any delete mode 100644 configs/debian-swx11+glu-default delete mode 100644 configs/debian-swx11+glu-i386 delete mode 100644 configs/debian-swx11+glu-i386-i686 delete mode 100644 configs/debian-swx11+glu-powerpc-603 delete mode 100644 configs/debian-swx11+glu-ppc64 delete mode 100644 configs/debian-swx11+glu-sparc delete mode 100644 configs/debian-swx11+glu-sparc-ultrasparc delete mode 100644 configs/debian-swx11+glu-static-amd64 delete mode 100644 configs/debian-swx11+glu-static-any delete mode 100644 configs/debian-swx11+glu-static-i386 delete mode 100644 configs/debian-swx11+glu-static-ppc64 delete mode 100644 configs/default-bp delete mode 100644 configs/linux-dri-bp delete mode 100644 configs/linux-osmesa-static delete mode 100644 configs/linux-osmesa32-static delete mode 100644 configs/linux-tcc delete mode 100644 debian/patches/04_cleanup-osmesa-configs.patch create mode 100644 debian/patches/04_debian-configs.patch (limited to 'debian') diff --git a/configs/debian-default b/configs/debian-default deleted file mode 100644 index 8d1b785ee00..00000000000 --- a/configs/debian-default +++ /dev/null @@ -1,17 +0,0 @@ -# Define Debian-specific defaults. - -CONFIG_NAME = debian-default - -OPT_FLAGS = -O2 -g - -# override settings in configs/linux-x86-64 -LIB_DIR = lib -EXTRA_LIB_PATH = - -SRC_DIRS = mesa -PROGRAM_DIRS = - -INSTALL_DIR = /usr - -# vim: ft=make - diff --git a/configs/debian-dri-amd64 b/configs/debian-dri-amd64 deleted file mode 100644 index ff4232b1200..00000000000 --- a/configs/debian-dri-amd64 +++ /dev/null @@ -1,9 +0,0 @@ -# Configuration for building the DRI drivers on i386. - -include $(TOP)/configs/linux-dri-x86-64 -include $(TOP)/configs/debian-dri-default - -CONFIG_NAME = debian-dri-amd64 - -# vim: ft=make - diff --git a/configs/debian-dri-any b/configs/debian-dri-any deleted file mode 100644 index c4b65b0c482..00000000000 --- a/configs/debian-dri-any +++ /dev/null @@ -1,9 +0,0 @@ -# Configuration for building the DRI drivers on the build architecture. - -include $(TOP)/configs/linux-dri -include $(TOP)/configs/debian-dri-default - -CONFIG_NAME = debian-dri-any - -# vim: ft=make - diff --git a/configs/debian-dri-default b/configs/debian-dri-default deleted file mode 100644 index f92c7eddd01..00000000000 --- a/configs/debian-dri-default +++ /dev/null @@ -1,36 +0,0 @@ -# Configuration defaults for building the DRI drivers and DRI/GLX-enabled -# libGL. - -include $(TOP)/configs/debian-default - -CONFIG_NAME = debian-dri-default - -SRC_DIRS = glx/x11 mesa progs -DRIVER_DIRS = dri -PROGRAM_DIRS = xdemos -PROGS = glxdemo \ - glxgears \ - glxheads \ - glxinfo - -LIB_DIR = lib/glx - -DRI_DRIVER_INSTALL_DIR = $(INSTALL_DIR)/lib/dri -DRI_DRIVER_SEARCH_DIR = /usr/lib/dri - -DRI_DIRS = mach64 mga r128 r200 r300 radeon s3v savage tdfx trident - -ARCH_X86 = i386 amd64 - -ifneq ($(findstring $(DEB_BUILD_ARCH), $(ARCH_X86)),) - DRI_DIRS += i810 i915 i915tex i965 sis unichrome -endif - -ifeq ($(DEB_BUILD_ARCH), sparc) - DRI_DIRS += ffb -endif - -APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) - -# vim: ft=make - diff --git a/configs/debian-dri-i386 b/configs/debian-dri-i386 deleted file mode 100644 index 7a0aaa487d2..00000000000 --- a/configs/debian-dri-i386 +++ /dev/null @@ -1,9 +0,0 @@ -# Configuration for building the DRI drivers on i386. - -include $(TOP)/configs/linux-dri-x86 -include $(TOP)/configs/debian-dri-default - -CONFIG_NAME = debian-dri-i386 - -# vim: ft=make - diff --git a/configs/debian-dri-i386-i686 b/configs/debian-dri-i386-i686 deleted file mode 100644 index b15cd77a03d..00000000000 --- a/configs/debian-dri-i386-i686 +++ /dev/null @@ -1,14 +0,0 @@ -# Configuration for building the DRI drivers on i386. - -include $(TOP)/configs/linux-dri-x86 -include $(TOP)/configs/debian-dri-optimized-default - -CONFIG_NAME = debian-dri-i386-i686 - -ARCH_FLAGS = -march=i686 -LIB_DIR = lib/glx/i686/cmov - -DRI_DRIVER_INSTALL_DIR = $(INSTALL_DIR)/lib/dri/i686/cmov - -# vim: ft=make - diff --git a/configs/debian-dri-optimized-default b/configs/debian-dri-optimized-default deleted file mode 100644 index 9c3f68dde7a..00000000000 --- a/configs/debian-dri-optimized-default +++ /dev/null @@ -1,13 +0,0 @@ -# Configuration defaults for CPU-optimized builds of the DRI drivers and -# DRI/GLX-enabled libGL. - -include $(TOP)/configs/debian-dri-default - -CONFIG_NAME = debian-dri-optimized-default - -# override so that the utility programs are not rebuilt with CPU-specific -# optimizations -SRC_DIRS = glx/x11 mesa - -# vim: ft=make - diff --git a/configs/debian-indirect-default b/configs/debian-indirect-default deleted file mode 100644 index a6926c95fcc..00000000000 --- a/configs/debian-indirect-default +++ /dev/null @@ -1,7 +0,0 @@ -# Configuration defaults for building GLX-enabled libGL. - -include $(TOP)/configs/debian-dri-default - -CONFIG_NAME = debian-indirect-default - -DRI_DIRS = diff --git a/configs/debian-indirect-hurd-i386 b/configs/debian-indirect-hurd-i386 deleted file mode 100644 index dd4bb07ca52..00000000000 --- a/configs/debian-indirect-hurd-i386 +++ /dev/null @@ -1,9 +0,0 @@ -# Configuration for building the DRI drivers on the build architecture. - -include $(TOP)/configs/linux-indirect -include $(TOP)/configs/debian-indirect-default - -CONFIG_NAME = debian-indirect-hurd-i386 - -# vim: ft=make - diff --git a/configs/debian-osmesa b/configs/debian-osmesa deleted file mode 100644 index 9b7fc7b2afd..00000000000 --- a/configs/debian-osmesa +++ /dev/null @@ -1,9 +0,0 @@ -# Configuration for building only OSMesa on Debian. - -include $(TOP)/configs/linux-osmesa -include $(TOP)/configs/debian-osmesa-default - -CONFIG_NAME = debian-osmesa - -# vim: ft=make - diff --git a/configs/debian-osmesa-default b/configs/debian-osmesa-default deleted file mode 100644 index ef5a5ba0c7c..00000000000 --- a/configs/debian-osmesa-default +++ /dev/null @@ -1,10 +0,0 @@ -# Configuration defaults for building OSMesa. - -include $(TOP)/configs/debian-default - -CONFIG_NAME = debian-osmesa-default - -DRIVER_DIRS = osmesa - -# vim: ft=make - diff --git a/configs/debian-osmesa-static b/configs/debian-osmesa-static deleted file mode 100644 index 03fe8b5f20e..00000000000 --- a/configs/debian-osmesa-static +++ /dev/null @@ -1,9 +0,0 @@ -# Configuration for building only OSMesa (static version) on Debian. - -include $(TOP)/configs/linux-osmesa-static -include $(TOP)/configs/debian-osmesa-default - -CONFIG_NAME = debian-osmesa-static - -# vim: ft=make - diff --git a/configs/debian-osmesa16 b/configs/debian-osmesa16 deleted file mode 100644 index 0077930188f..00000000000 --- a/configs/debian-osmesa16 +++ /dev/null @@ -1,10 +0,0 @@ -# Configuration for building OSMesa with support for 16 bits per color -# channel. - -include $(TOP)/configs/linux-osmesa16 -include $(TOP)/configs/debian-osmesa-default - -CONFIG_NAME = debian-osmesa16 - -# vim: ft=make - diff --git a/configs/debian-osmesa16-static b/configs/debian-osmesa16-static deleted file mode 100644 index 6ff399e627c..00000000000 --- a/configs/debian-osmesa16-static +++ /dev/null @@ -1,10 +0,0 @@ -# Configuration for building a static version of OSMesa with support for 16 -# bits per color channel. - -include $(TOP)/configs/linux-osmesa16-static -include $(TOP)/configs/debian-osmesa-default - -CONFIG_NAME = debian-osmesa16-static - -# vim: ft=make - diff --git a/configs/debian-osmesa32 b/configs/debian-osmesa32 deleted file mode 100644 index de3b3277c21..00000000000 --- a/configs/debian-osmesa32 +++ /dev/null @@ -1,10 +0,0 @@ -# Configuration for building OSMesa with support for 32 bits per color -# channel. - -include $(TOP)/configs/linux-osmesa32 -include $(TOP)/configs/debian-osmesa-default - -CONFIG_NAME = debian-osmesa32 - -# vim: ft=make - diff --git a/configs/debian-osmesa32-static b/configs/debian-osmesa32-static deleted file mode 100644 index 7fdfcef4013..00000000000 --- a/configs/debian-osmesa32-static +++ /dev/null @@ -1,10 +0,0 @@ -# Configuration for building a static version of OSMesa with support for 32 -# bits per color channel. - -include $(TOP)/configs/linux-osmesa32-static -include $(TOP)/configs/debian-osmesa-default - -CONFIG_NAME = debian-osmesa32-static - -# vim: ft=make - diff --git a/configs/debian-swx11+glu-alpha-ev5 b/configs/debian-swx11+glu-alpha-ev5 deleted file mode 100644 index fd16e49e374..00000000000 --- a/configs/debian-swx11+glu-alpha-ev5 +++ /dev/null @@ -1,12 +0,0 @@ -# Configuration for building Mesa (swx11 and GLU) on alpha (ev5 optimized). - -include $(TOP)/configs/linux-alpha -include $(TOP)/configs/debian-swx11+glu-default - -CONFIG_NAME = debian-swx11+glu-alpha-ev5 - -SRC_DIRS = mesa -LIB_DIR = lib/ev5/cmov - -# vim: ft=make - diff --git a/configs/debian-swx11+glu-amd64 b/configs/debian-swx11+glu-amd64 deleted file mode 100644 index 4bd7e51443a..00000000000 --- a/configs/debian-swx11+glu-amd64 +++ /dev/null @@ -1,10 +0,0 @@ -# Configuration for building Mesa (swx11 and GLU) with runtime-detected -# assembler optimizations on amd64. - -include $(TOP)/configs/linux-x86-64 -include $(TOP)/configs/debian-swx11+glu-default - -CONFIG_NAME = debian-swx11+glu-amd64 - -# vim: ft=make - diff --git a/configs/debian-swx11+glu-any b/configs/debian-swx11+glu-any deleted file mode 100644 index 884c9f9f23e..00000000000 --- a/configs/debian-swx11+glu-any +++ /dev/null @@ -1,9 +0,0 @@ -# Configuration for building Mesa (swx11 and GLU) on the build architecture. - -include $(TOP)/configs/linux -include $(TOP)/configs/debian-swx11+glu-default - -CONFIG_NAME = debian-swx11+glu-any - -# vim: ft=make - diff --git a/configs/debian-swx11+glu-default b/configs/debian-swx11+glu-default deleted file mode 100644 index ccf827639c6..00000000000 --- a/configs/debian-swx11+glu-default +++ /dev/null @@ -1,14 +0,0 @@ -# Configuration defaults for building Mesa (swx11 and GLU). - -include $(TOP)/configs/debian-default - -CONFIG_NAME = debian-swx11+glu-default - -SRC_DIRS = mesa glu glw -DRIVER_DIRS = x11 - -GLW_SOURCES += GLwMDrawA.c -GLW_LIB_DEPS += -lXm - -# vim: ft=make - diff --git a/configs/debian-swx11+glu-i386 b/configs/debian-swx11+glu-i386 deleted file mode 100644 index 0b800c64bba..00000000000 --- a/configs/debian-swx11+glu-i386 +++ /dev/null @@ -1,10 +0,0 @@ -# Configuration for building Mesa (swx11 and GLU) with runtime-detected -# assembler optimizations on i386. - -include $(TOP)/configs/linux-x86 -include $(TOP)/configs/debian-swx11+glu-default - -CONFIG_NAME = debian-swx11+glu-i386 - -# vim: ft=make - diff --git a/configs/debian-swx11+glu-i386-i686 b/configs/debian-swx11+glu-i386-i686 deleted file mode 100644 index c6969b3f830..00000000000 --- a/configs/debian-swx11+glu-i386-i686 +++ /dev/null @@ -1,14 +0,0 @@ -# Configuration for building Mesa (swx11 and GLU) with runtime-detected -# assembler optimizations on i386 (i686 optimized). - -include $(TOP)/configs/linux-x86 -include $(TOP)/configs/debian-swx11+glu-default - -CONFIG_NAME = debian-swx11+glu-i386-i686 - -ARCH_FLAGS += -march=i686 -SRC_DIRS = mesa -LIB_DIR = lib/i686/cmov - -# vim: ft=make - diff --git a/configs/debian-swx11+glu-powerpc-603 b/configs/debian-swx11+glu-powerpc-603 deleted file mode 100644 index 86b3580e380..00000000000 --- a/configs/debian-swx11+glu-powerpc-603 +++ /dev/null @@ -1,13 +0,0 @@ -# Configuration for building Mesa (swx11 and GLU) with runtime-detected -# assembler optimizations on powerpc (603 optimized). - -include $(TOP)/configs/linux-ppc -include $(TOP)/configs/debian-swx11+glu-default - -CONFIG_NAME = debian-swx11+glu-powerpc-603 - -SRC_DIRS = mesa -LIB_DIR = lib/603/cmov - -# vim: ft=make - diff --git a/configs/debian-swx11+glu-ppc64 b/configs/debian-swx11+glu-ppc64 deleted file mode 100644 index 67c59b6eef2..00000000000 --- a/configs/debian-swx11+glu-ppc64 +++ /dev/null @@ -1,11 +0,0 @@ -# Configuration for building Mesa (swx11 and GLU) with runtime-detected -# assembler optimizations on ppc64. - -include $(TOP)/configs/debian-swx11+glu-any - -CONFIG_NAME = debian-swx11+glu-ppc64 - -LIB_DIR = lib64 - -# vim: ft=make - diff --git a/configs/debian-swx11+glu-sparc b/configs/debian-swx11+glu-sparc deleted file mode 100644 index 8854b40d4fc..00000000000 --- a/configs/debian-swx11+glu-sparc +++ /dev/null @@ -1,10 +0,0 @@ -# Configuration for building Mesa (swx11 and GLU) with runtime-detected -# assembler optimizations on sparc. - -include $(TOP)/configs/linux-sparc -include $(TOP)/configs/debian-swx11+glu-default - -CONFIG_NAME = debian-swx11+glu-sparc - -# vim: ft=make - diff --git a/configs/debian-swx11+glu-sparc-ultrasparc b/configs/debian-swx11+glu-sparc-ultrasparc deleted file mode 100644 index 14e38018c46..00000000000 --- a/configs/debian-swx11+glu-sparc-ultrasparc +++ /dev/null @@ -1,13 +0,0 @@ -# Configuration for building Mesa (swx11 and GLU) with runtime-detected -# assembler optimizations on sparc (ultrasparc-optimized). - -include $(TOP)/configs/linux-ultrasparc -include $(TOP)/configs/debian-swx11+glu-default - -CONFIG_NAME = debian-swx11+glu-sparc-ultrasparc - -SRC_DIRS = mesa -LIB_DIR = lib/ultrasparc/cmov - -# vim: ft=make - diff --git a/configs/debian-swx11+glu-static-amd64 b/configs/debian-swx11+glu-static-amd64 deleted file mode 100644 index 2976fbe66f3..00000000000 --- a/configs/debian-swx11+glu-static-amd64 +++ /dev/null @@ -1,10 +0,0 @@ -# Configuration for building static versions of the libraries (swx11 and GLU) -# on amd64. - -include $(TOP)/configs/linux-x86-64-static -include $(TOP)/configs/debian-swx11+glu-default - -CONFIG_NAME = debian-swx11+glu-static-amd64 - -# vim: ft=make - diff --git a/configs/debian-swx11+glu-static-any b/configs/debian-swx11+glu-static-any deleted file mode 100644 index 82f794d28df..00000000000 --- a/configs/debian-swx11+glu-static-any +++ /dev/null @@ -1,10 +0,0 @@ -# Configuration for building static versions of the libraries (swx11 and GLU) -# on the build architecture. - -include $(TOP)/configs/linux-static -include $(TOP)/configs/debian-swx11+glu-default - -CONFIG_NAME = debian-swx11+glu-static-any - -# vim: ft=make - diff --git a/configs/debian-swx11+glu-static-i386 b/configs/debian-swx11+glu-static-i386 deleted file mode 100644 index 62859e42548..00000000000 --- a/configs/debian-swx11+glu-static-i386 +++ /dev/null @@ -1,10 +0,0 @@ -# Configuration for building static versions of the libraries (swx11 and GLU) -# on i386. - -include $(TOP)/configs/linux-x86-static -include $(TOP)/configs/debian-swx11+glu-default - -CONFIG_NAME = debian-swx11+glu-static-i386 - -# vim: ft=make - diff --git a/configs/debian-swx11+glu-static-ppc64 b/configs/debian-swx11+glu-static-ppc64 deleted file mode 100644 index a9ea4a95b31..00000000000 --- a/configs/debian-swx11+glu-static-ppc64 +++ /dev/null @@ -1,11 +0,0 @@ -# Configuration for building static versions of the libraries (swx11 and GLU) -# on ppc64. - -include $(TOP)/configs/debian-swx11+glu-static-any - -CONFIG_NAME = debian-swx11+glu-static-ppc64 - -LIB_DIR = lib64 - -# vim: ft=make - diff --git a/configs/default-bp b/configs/default-bp deleted file mode 100644 index 29faceed817..00000000000 --- a/configs/default-bp +++ /dev/null @@ -1,75 +0,0 @@ -# Default/template configuration - -# This is included by other config files which may override some -# of these variables. - -CONFIG_NAME = default - -# Version info -MESA_MAJOR=6 -MESA_MINOR=3 -MESA_TINY=0 - -# external projects -#DRM_SOURCE_PATH=$(TOP)/../drm -DRM_SOURCE_PATH=/home/projects/DRI-freedesktop/drm - -# Compiler and flags -CC = cc -CXX = CC -CFLAGS = -O -CXXFLAGS = -O -GLU_CFLAGS = - -# Misc tools and flags -MKLIB_OPTIONS = -MKDEP = makedepend -MKDEP_OPTIONS = -fdepend -MAKE = make - -# Library names (base name) -GL_LIB = GL -GLU_LIB = GLU -GLUT_LIB = glut -GLW_LIB = GLw -OSMESA_LIB = OSMesa - - -# Library names (actual file names) -GL_LIB_NAME = lib$(GL_LIB).so -GLU_LIB_NAME = lib$(GLU_LIB).so -GLUT_LIB_NAME = lib$(GLUT_LIB).so -GLW_LIB_NAME = lib$(GLW_LIB).so -OSMESA_LIB_NAME = lib$(OSMesa).so - - -# Optional assembly language optimization files for libGL -ASM_SOURCES = - -# GLw widget sources (Append "GLwMDrawA.c" here and add -lXm to GLW_LIB_DEPS in -# order to build the Motif widget too) -GLW_SOURCES = GLwDrawA.c - - -# Directories -LIB_DIR = $(TOP)/lib -INSTALL_PREFIX = /usr/local -SRC_DIRS = mesa glu glut/glx glw -GLU_DIRS = sgi -DRIVER_DIRS = x11 osmesa -# Which subdirs under $(TOP)/progs/ to enter: -PROGRAM_DIRS = demos redbook samples xdemos - - -# Library/program dependencies -GL_LIB_DEPS = -lX11 -lXext -lm -lpthread -OSMESA_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -GLU_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -lm -GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lXmu -lXt -lXi -lm -GLW_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -lXt -lX11 -APP_LIB_DEPS = -L$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm - - -# Shading language support (set to 0 or 1) -SHADING_LANGUAGE = 0 - diff --git a/configs/linux-dri-bp b/configs/linux-dri-bp deleted file mode 100644 index e9db29fc36b..00000000000 --- a/configs/linux-dri-bp +++ /dev/null @@ -1,55 +0,0 @@ -# -*-makefile-*- -# Configuration for linux-dri: Linux DRI hardware drivers for XFree86 & others - -include $(TOP)/configs/default - -CONFIG_NAME = linux-dri - -# Compiler and flags -CC = gcc -CXX = g++ - -MKDEP = /usr/X11R6/bin/makedepend -#MKDEP = gcc -M -#MKDEP_OPTIONS = -MF depend - -WARN_FLAGS = -Wall -OPT_FLAGS = -g -PIC_FLAGS = -fPIC - -# Add '-DGLX_USE_TLS' to ARCH_FLAGS to enable TLS support. -ARCH_FLAGS ?= - -DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \ - -D_BSD_SOURCE -D_GNU_SOURCE \ - -DDRI_NEW_INTERFACE_ONLY -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 - -X11_INCLUDES = -I/usr/X11R6/include -I/usr/X11R6/include/X11/extensions - -CFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) \ - $(ASM_FLAGS) -std=c99 -ffast-math - -CXXFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) - - -ASM_SOURCES = - -# Library/program dependencies -EXTRA_LIB_PATH=-L/usr/X11R6/lib - -DRI_LIB_DEPS = $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl -GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lm -lpthread -ldl -GLUT_LIB_DEPS = $(EXTRA_LIB_PATH) -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lXmu -lXt -lXi -lm -GLW_LIB_DEPS = $(EXTRA_LIB_PATH) -L$(LIB_DIR) -l$(GL_LIB) -lXt -lX11 - - -# Directories -SRC_DIRS = glx/x11 mesa glu glut/glx glw -DRIVER_DIRS = dri -PROGRAM_DIRS = -WINDOW_SYSTEM=dri - -# ffb and gamma are missing because they have not been converted to use the new -# interface. -DRI_DIRS = dri_client i810 i830 i915 mach64 mga r128 r200 radeon s3v \ - savage sis tdfx trident unichrome fb diff --git a/configs/linux-osmesa-static b/configs/linux-osmesa-static deleted file mode 100644 index 465f83ca058..00000000000 --- a/configs/linux-osmesa-static +++ /dev/null @@ -1,14 +0,0 @@ -# Configuration for building only libOSMesa on Linux, no Xlib driver -# This doesn't really have any Linux dependencies, so it should be usable -# on other (gcc-based) systems. - -include $(TOP)/configs/linux-osmesa - -CONFIG_NAME = linux-osmesa-static - -# Compiler and flags -MKLIB_OPTIONS = -static - -# Library names -OSMESA_LIB_NAME = libOSMesa.a - diff --git a/configs/linux-osmesa32-static b/configs/linux-osmesa32-static deleted file mode 100644 index 6db8bc02370..00000000000 --- a/configs/linux-osmesa32-static +++ /dev/null @@ -1,28 +0,0 @@ -# Configuration for 32 bits/channel OSMesa library on Linux - -include $(TOP)/configs/default - -CONFIG_NAME = linux-osmesa32-static - -# Compiler and flags -CC = gcc -CXX = g++ -CFLAGS = -O3 -ansi -pedantic -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include -DCHAN_BITS=32 -DDEFAULT_SOFTWARE_DEPTH_BITS=31 -CXXFLAGS = -O3 -ansi -pedantic -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -MKLIB_OPTIONS = -static - - -# Library names -OSMESA_LIB = OSMesa32 -OSMESA_LIB_NAME = libOSMesa32.a - - -# Directories -SRC_DIRS = mesa glu -DRIVER_DIRS = osmesa -PROGRAM_DIRS = - - -# Dependencies -OSMESA_LIB_DEPS = -lm -lpthread -APP_LIB_DEPS = -lOSMesa32 diff --git a/configs/linux-tcc b/configs/linux-tcc deleted file mode 100644 index 4371fe21fc7..00000000000 --- a/configs/linux-tcc +++ /dev/null @@ -1,22 +0,0 @@ -# Configuration for debugging on Linux - -include $(TOP)/configs/default - -CONFIG_NAME = linux-tcc - -# Compiler and flags -CC = gcc -CXX = g++ - -TCC_DIR=/home/progs/tcc-0.9.20 - -CFLAGS = -g -ansi -pedantic -Wall -Wmissing-prototypes -Wundef -fPIC -ffast-math -D_POSIX_SOURCE -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R6/include -DUSE_XSHM -DPTHREADS -DDEBUG -DMESA_DEBUG -DUSE_TCC -I$(TCC_DIR) - -CXXFLAGS = -g -ansi -pedantic -Wall -Wundef -fPIC -ffast-math -D_POSIX_SOURCE -D_SVID_SOURCE -D_BSD_SOURCE -DDEBUG -DMESA_DEBUG - -GLUT_CFLAGS = -fexceptions - -GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread -L$(TCC_DIR) -ltcc -ldl -GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm -GLW_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -lXt -L/usr/X11R6/lib -lX11 -APP_LIB_DEPS = -L$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm diff --git a/debian/changelog b/debian/changelog index 8870f31c11a..c156963d542 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +mesa (7.0.3-3) UNRELEASED; urgency=low + + * 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 19:31:32 +0200 + mesa (7.0.3-2) unstable; urgency=low * Pull from mesa_7_0_branch (03447de3). diff --git a/debian/patches/04_cleanup-osmesa-configs.patch b/debian/patches/04_cleanup-osmesa-configs.patch deleted file mode 100644 index 68bd4775e13..00000000000 --- a/debian/patches/04_cleanup-osmesa-configs.patch +++ /dev/null @@ -1,197 +0,0 @@ -Index: mesa/configs/linux-osmesa -=================================================================== ---- mesa.orig/configs/linux-osmesa 2007-11-11 00:24:07.000000000 +0100 -+++ mesa/configs/linux-osmesa 2007-11-11 00:33:20.000000000 +0100 -@@ -9,8 +9,17 @@ - # Compiler and flags - CC = gcc - CXX = g++ --CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DPTHREADS --CXXFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -+ -+PIC_FLAGS = -fPIC -+ -+DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \ -+ -D_BSD_SOURCE -D_GNU_SOURCE \ -+ -DPTHREADS -DUSE_XSHM -DHAVE_POSIX_MEMALIGN -+ -+CFLAGS = -ansi -pedantic $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) \ -+ $(ASM_FLAGS) -ffast-math -+ -+CXXFLAGS = -ansi -pedantic $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) - - # Work around aliasing bugs - developers should comment this out - CFLAGS += -fno-strict-aliasing -@@ -26,3 +35,4 @@ - OSMESA_LIB_DEPS = -lm -lpthread - GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(OSMESA_LIB) - APP_LIB_DEPS = -lOSMesa -lGLU -+ -Index: mesa/configs/linux-osmesa-static -=================================================================== ---- mesa.orig/configs/linux-osmesa-static 2007-11-11 00:24:01.000000000 +0100 -+++ mesa/configs/linux-osmesa-static 2007-11-11 00:33:20.000000000 +0100 -@@ -8,7 +8,8 @@ - - # Compiler and flags - MKLIB_OPTIONS = -static -+PIC_FLAGS = - - # Library names --OSMESA_LIB_NAME = libOSMesa.a -+OSMESA_LIB_NAME = lib$(OSMESA_LIB).a - -Index: mesa/configs/linux-osmesa16 -=================================================================== ---- mesa.orig/configs/linux-osmesa16 2007-11-11 00:24:07.000000000 +0100 -+++ mesa/configs/linux-osmesa16 2007-11-11 00:33:41.000000000 +0100 -@@ -1,31 +1,19 @@ - # Configuration for 16 bits/channel OSMesa library on Linux - --include $(TOP)/configs/default -+include $(TOP)/configs/linux-osmesa - - CONFIG_NAME = linux-osmesa16 - --# Compiler and flags --CC = gcc --CXX = g++ --CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include -DCHAN_BITS=16 -DDEFAULT_SOFTWARE_DEPTH_BITS=31 --CXXFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -- - # Work around aliasing bugs - developers should comment this out - CFLAGS += -fno-strict-aliasing - CXXFLAGS += -fno-strict-aliasing -- -+DEFINES += -DCHAN_BITS=16 -DDEFAULT_SOFTWARE_DEPTH_BITS=32 - # Library names - OSMESA_LIB = OSMesa16 --OSMESA_LIB_NAME = libOSMesa16.so -- - - # Directories --SRC_DIRS = mesa glu --DRIVER_DIRS = osmesa - PROGRAM_DIRS = - -- - # Dependencies --OSMESA_LIB_DEPS = -lm -lpthread --GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(OSMESA_LIB) --APP_LIB_DEPS = -lOSMesa16 -+APP_LIB_DEPS = -l$(OSMESA_LIB) -+ -Index: mesa/configs/linux-osmesa16-static -=================================================================== ---- mesa.orig/configs/linux-osmesa16-static 2007-11-11 00:24:07.000000000 +0100 -+++ mesa/configs/linux-osmesa16-static 2007-11-11 00:33:20.000000000 +0100 -@@ -1,14 +1,10 @@ - # Configuration for 16 bits/channel OSMesa library on Linux - --include $(TOP)/configs/default -+include $(TOP)/configs/linux-osmesa16 - - CONFIG_NAME = linux-osmesa16-static - - # Compiler and flags --CC = gcc --CXX = g++ --CFLAGS = -O3 -ansi -pedantic -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include -DCHAN_BITS=16 -DDEFAULT_SOFTWARE_DEPTH_BITS=31 --CXXFLAGS = -O3 -ansi -pedantic -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE - MKLIB_OPTIONS = -static - PIC_FLAGS = - -@@ -17,16 +13,5 @@ - CXXFLAGS += -fno-strict-aliasing - - # Library names --OSMESA_LIB = OSMesa16 --OSMESA_LIB_NAME = libOSMesa16.a -+OSMESA_LIB_NAME = lib$(OSMESA_LIB).a - -- --# Directories --SRC_DIRS = mesa glu --DRIVER_DIRS = osmesa --PROGRAM_DIRS = -- -- --# Dependencies --OSMESA_LIB_DEPS = -lm -lpthread --APP_LIB_DEPS = -lOSMesa16 -Index: mesa/configs/linux-osmesa32 -=================================================================== ---- mesa.orig/configs/linux-osmesa32 2007-11-11 00:24:07.000000000 +0100 -+++ mesa/configs/linux-osmesa32 2007-11-11 00:33:51.000000000 +0100 -@@ -1,31 +1,22 @@ - # Configuration for 32 bits/channel OSMesa library on Linux - --include $(TOP)/configs/default -+include $(TOP)/configs/linux-osmesa - - CONFIG_NAME = linux-osmesa32 - - # Compiler and flags --CC = gcc --CXX = g++ --CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include -DCHAN_BITS=32 -DDEFAULT_SOFTWARE_DEPTH_BITS=31 --CXXFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE - - # Work around aliasing bugs - developers should comment this out - CFLAGS += -fno-strict-aliasing - CXXFLAGS += -fno-strict-aliasing -+DEFINES += -DCHAN_BITS=32 -DDEFAULT_SOFTWARE_DEPTH_BITS=31 - - # Library names - OSMESA_LIB = OSMesa32 --OSMESA_LIB_NAME = libOSMesa32.so -- - - # Directories --SRC_DIRS = mesa glu --DRIVER_DIRS = osmesa - PROGRAM_DIRS = - -- - # Dependencies --OSMESA_LIB_DEPS = -lm -lpthread --GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(OSMESA_LIB) --APP_LIB_DEPS = -lOSMesa32 -+APP_LIB_DEPS = -l$(OSMESA_LIB) -+ -Index: mesa/configs/linux-osmesa32-static -=================================================================== ---- mesa.orig/configs/linux-osmesa32-static 2007-11-11 00:24:01.000000000 +0100 -+++ mesa/configs/linux-osmesa32-static 2007-11-11 00:33:20.000000000 +0100 -@@ -1,28 +1,13 @@ - # Configuration for 32 bits/channel OSMesa library on Linux - --include $(TOP)/configs/default -+include $(TOP)/configs/linux-osmesa32 - - CONFIG_NAME = linux-osmesa32-static - - # Compiler and flags --CC = gcc --CXX = g++ --CFLAGS = -O3 -ansi -pedantic -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include -DCHAN_BITS=32 -DDEFAULT_SOFTWARE_DEPTH_BITS=31 --CXXFLAGS = -O3 -ansi -pedantic -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE - MKLIB_OPTIONS = -static -- -+PIC_FLAGS = - - # Library names --OSMESA_LIB = OSMesa32 --OSMESA_LIB_NAME = libOSMesa32.a -- -- --# Directories --SRC_DIRS = mesa glu --DRIVER_DIRS = osmesa --PROGRAM_DIRS = -- -+OSMESA_LIB_NAME = lib$(OSMESA_LIB).a - --# Dependencies --OSMESA_LIB_DEPS = -lm -lpthread --APP_LIB_DEPS = -lOSMesa32 diff --git a/debian/patches/04_debian-configs.patch b/debian/patches/04_debian-configs.patch new file mode 100644 index 00000000000..4bb36dd66de --- /dev/null +++ b/debian/patches/04_debian-configs.patch @@ -0,0 +1,892 @@ +--- + configs/debian-default | 17 ++++++ + configs/debian-dri-amd64 | 9 +++ + configs/debian-dri-any | 9 +++ + configs/debian-dri-default | 36 ++++++++++++++ + configs/debian-dri-i386 | 9 +++ + configs/debian-dri-i386-i686 | 14 +++++ + configs/debian-dri-optimized-default | 13 +++++ + configs/debian-indirect-default | 7 ++ + configs/debian-indirect-hurd-i386 | 9 +++ + configs/debian-osmesa | 9 +++ + configs/debian-osmesa-default | 10 ++++ + configs/debian-osmesa-static | 9 +++ + configs/debian-osmesa16 | 10 ++++ + configs/debian-osmesa16-static | 10 ++++ + configs/debian-osmesa32 | 10 ++++ + configs/debian-osmesa32-static | 10 ++++ + configs/debian-swx11+glu-alpha-ev5 | 12 ++++ + configs/debian-swx11+glu-amd64 | 10 ++++ + configs/debian-swx11+glu-any | 9 +++ + configs/debian-swx11+glu-default | 14 +++++ + configs/debian-swx11+glu-i386 | 10 ++++ + configs/debian-swx11+glu-i386-i686 | 14 +++++ + configs/debian-swx11+glu-powerpc-603 | 13 +++++ + configs/debian-swx11+glu-ppc64 | 11 ++++ + configs/debian-swx11+glu-sparc | 10 ++++ + configs/debian-swx11+glu-sparc-ultrasparc | 13 +++++ + configs/debian-swx11+glu-static-amd64 | 10 ++++ + configs/debian-swx11+glu-static-any | 10 ++++ + configs/debian-swx11+glu-static-i386 | 10 ++++ + configs/debian-swx11+glu-static-ppc64 | 11 ++++ + configs/default-bp | 75 ++++++++++++++++++++++++++++++ + configs/linux-dri-bp | 55 ++++++++++++++++++++++ + configs/linux-osmesa | 14 ++++- + configs/linux-osmesa-static | 15 ++++++ + configs/linux-osmesa16 | 20 +------- + configs/linux-osmesa16-static | 19 ------- + configs/linux-osmesa32 | 17 +----- + configs/linux-osmesa32-static | 13 +++++ + configs/linux-tcc | 22 ++++++++ + 39 files changed, 550 insertions(+), 48 deletions(-) + +Index: mesa/configs/debian-default +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ mesa/configs/debian-default 2008-06-17 19:27:49.000000000 +0200 +@@ -0,0 +1,17 @@ ++# Define Debian-specific defaults. ++ ++CONFIG_NAME = debian-default ++ ++OPT_FLAGS = -O2 -g ++ ++# override settings in configs/linux-x86-64 ++LIB_DIR = lib ++EXTRA_LIB_PATH = ++ ++SRC_DIRS = mesa ++PROGRAM_DIRS = ++ ++INSTALL_DIR = /usr ++ ++# vim: ft=make ++ +Index: mesa/configs/debian-dri-amd64 +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ mesa/configs/debian-dri-amd64 2008-06-17 19:27:49.000000000 +0200 +@@ -0,0 +1,9 @@ ++# Configuration for building the DRI drivers on i386. ++ ++include $(TOP)/configs/linux-dri-x86-64 ++include $(TOP)/configs/debian-dri-default ++ ++CONFIG_NAME = debian-dri-amd64 ++ ++# vim: ft=make ++ +Index: mesa/configs/debian-dri-any +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ mesa/configs/debian-dri-any 2008-06-17 19:27:49.000000000 +0200 +@@ -0,0 +1,9 @@ ++# Configuration for building the DRI drivers on the build architecture. ++ ++include $(TOP)/configs/linux-dri ++include $(TOP)/configs/debian-dri-default ++ ++CONFIG_NAME = debian-dri-any ++ ++# vim: ft=make ++ +Index: mesa/configs/debian-dri-default +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ mesa/configs/debian-dri-default 2008-06-17 19:27:49.000000000 +0200 +@@ -0,0 +1,36 @@ ++# Configuration defaults for building the DRI drivers and DRI/GLX-enabled ++# libGL. ++ ++include $(TOP)/configs/debian-default ++ ++CONFIG_NAME = debian-dri-default ++ ++SRC_DIRS = glx/x11 mesa progs ++DRIVER_DIRS = dri ++PROGRAM_DIRS = xdemos ++PROGS = glxdemo \ ++ glxgears \ ++ glxheads \ ++ glxinfo ++ ++LIB_DIR = lib/glx ++ ++DRI_DRIVER_INSTALL_DIR = $(INSTALL_DIR)/lib/dri ++DRI_DRIVER_SEARCH_DIR = /usr/lib/dri ++ ++DRI_DIRS = mach64 mga r128 r200 r300 radeon s3v savage tdfx trident ++ ++ARCH_X86 = i386 amd64 ++ ++ifneq ($(findstring $(DEB_BUILD_ARCH), $(ARCH_X86)),) ++ DRI_DIRS += i810 i915 i915tex i965 sis unichrome ++endif ++ ++ifeq ($(DEB_BUILD_ARCH), sparc) ++ DRI_DIRS += ffb ++endif ++ ++APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) ++ ++# vim: ft=make ++ +Index: mesa/configs/debian-dri-i386 +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ mesa/configs/debian-dri-i386 2008-06-17 19:27:49.000000000 +0200 +@@ -0,0 +1,9 @@ ++# Configuration for building the DRI drivers on i386. ++ ++include $(TOP)/configs/linux-dri-x86 ++include $(TOP)/configs/debian-dri-default ++ ++CONFIG_NAME = debian-dri-i386 ++ ++# vim: ft=make ++ +Index: mesa/configs/debian-dri-i386-i686 +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ mesa/configs/debian-dri-i386-i686 2008-06-17 19:27:49.000000000 +0200 +@@ -0,0 +1,14 @@ ++# Configuration for building the DRI drivers on i386. ++ ++include $(TOP)/configs/linux-dri-x86 ++include $(TOP)/configs/debian-dri-optimized-default ++ ++CONFIG_NAME = debian-dri-i386-i686 ++ ++ARCH_FLAGS = -march=i686 ++LIB_DIR = lib/glx/i686/cmov ++ ++DRI_DRIVER_INSTALL_DIR = $(INSTALL_DIR)/lib/dri/i686/cmov ++ ++# vim: ft=make ++ +Index: mesa/configs/debian-dri-optimized-default +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ mesa/configs/debian-dri-optimized-default 2008-06-17 19:27:49.000000000 +0200 +@@ -0,0 +1,13 @@ ++# Configuration defaults for CPU-optimized builds of the DRI drivers and ++# DRI/GLX-enabled libGL. ++ ++include $(TOP)/configs/debian-dri-default ++ ++CONFIG_NAME = debian-dri-optimized-default ++ ++# override so that the utility programs are not rebuilt with CPU-specific ++# optimizations ++SRC_DIRS = glx/x11 mesa ++ ++# vim: ft=make ++ +Index: mesa/configs/debian-indirect-default +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ mesa/configs/debian-indirect-default 2008-06-17 19:27:49.000000000 +0200 +@@ -0,0 +1,7 @@ ++# Configuration defaults for building GLX-enabled libGL. ++ ++include $(TOP)/configs/debian-dri-default ++ ++CONFIG_NAME = debian-indirect-default ++ ++DRI_DIRS = +Index: mesa/configs/debian-indirect-hurd-i386 +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ mesa/configs/debian-indirect-hurd-i386 2008-06-17 19:27:49.000000000 +0200 +@@ -0,0 +1,9 @@ ++# Configuration for building the DRI drivers on the build architecture. ++ ++include $(TOP)/configs/linux-indirect ++include $(TOP)/configs/debian-indirect-default ++ ++CONFIG_NAME = debian-indirect-hurd-i386 ++ ++# vim: ft=make ++ +Index: mesa/configs/debian-osmesa +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ mesa/configs/debian-osmesa 2008-06-17 19:27:49.000000000 +0200 +@@ -0,0 +1,9 @@ ++# Configuration for building only OSMesa on Debian. ++ ++include $(TOP)/configs/linux-osmesa ++include $(TOP)/configs/debian-osmesa-default ++ ++CONFIG_NAME = debian-osmesa ++ ++# vim: ft=make ++ +Index: mesa/configs/debian-osmesa-default +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ mesa/configs/debian-osmesa-default 2008-06-17 19:27:49.000000000 +0200 +@@ -0,0 +1,10 @@ ++# Configuration defaults for building OSMesa. ++ ++include $(TOP)/configs/debian-default ++ ++CONFIG_NAME = debian-osmesa-default ++ ++DRIVER_DIRS = osmesa ++ ++# vim: ft=make ++ +Index: mesa/configs/debian-osmesa-static +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ mesa/configs/debian-osmesa-static 2008-06-17 19:27:49.000000000 +0200 +@@ -0,0 +1,9 @@ ++# Configuration for building only OSMesa (static version) on Debian. ++ ++include $(TOP)/configs/linux-osmesa-static ++include $(TOP)/configs/debian-osmesa-default ++ ++CONFIG_NAME = debian-osmesa-static ++ ++# vim: ft=make ++ +Index: mesa/configs/debian-osmesa16 +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ mesa/configs/debian-osmesa16 2008-06-17 19:27:49.000000000 +0200 +@@ -0,0 +1,10 @@ ++# Configuration for building OSMesa with support for 16 bits per color ++# channel. ++ ++include $(TOP)/configs/linux-osmesa16 ++include $(TOP)/configs/debian-osmesa-default ++ ++CONFIG_NAME = debian-osmesa16 ++ ++# vim: ft=make ++ +Index: mesa/configs/debian-osmesa16-static +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ mesa/configs/debian-osmesa16-static 2008-06-17 19:27:49.000000000 +0200 +@@ -0,0 +1,10 @@ ++# Configuration for building a static version of OSMesa with support for 16 ++# bits per color channel. ++ ++include $(TOP)/configs/linux-osmesa16-static ++include $(TOP)/configs/debian-osmesa-default ++ ++CONFIG_NAME = debian-osmesa16-static ++ ++# vim: ft=make ++ +Index: mesa/configs/debian-osmesa32 +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ mesa/configs/debian-osmesa32 2008-06-17 19:27:49.000000000 +0200 +@@ -0,0 +1,10 @@ ++# Configuration for building OSMesa with support for 32 bits per color ++# channel. ++ ++include $(TOP)/configs/linux-osmesa32 ++include $(TOP)/configs/debian-osmesa-default ++ ++CONFIG_NAME = debian-osmesa32 ++ ++# vim: ft=make ++ +Index: mesa/configs/debian-osmesa32-static +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ mesa/configs/debian-osmesa32-static 2008-06-17 19:27:49.000000000 +0200 +@@ -0,0 +1,10 @@ ++# Configuration for building a static version of OSMesa with support for 32 ++# bits per color channel. ++ ++include $(TOP)/configs/linux-osmesa32-static ++include $(TOP)/configs/debian-osmesa-default ++ ++CONFIG_NAME = debian-osmesa32-static ++ ++# vim: ft=make ++ +Index: mesa/configs/debian-swx11+glu-alpha-ev5 +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ mesa/configs/debian-swx11+glu-alpha-ev5 2008-06-17 19:27:49.000000000 +0200 +@@ -0,0 +1,12 @@ ++# Configuration for building Mesa (swx11 and GLU) on alpha (ev5 optimized). ++ ++include $(TOP)/configs/linux-alpha ++include $(TOP)/configs/debian-swx11+glu-default ++ ++CONFIG_NAME = debian-swx11+glu-alpha-ev5 ++ ++SRC_DIRS = mesa ++LIB_DIR = lib/ev5/cmov ++ ++# vim: ft=make ++ +Index: mesa/configs/debian-swx11+glu-amd64 +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ mesa/configs/debian-swx11+glu-amd64 2008-06-17 19:27:49.000000000 +0200 +@@ -0,0 +1,10 @@ ++# Configuration for building Mesa (swx11 and GLU) with runtime-detected ++# assembler optimizations on amd64. ++ ++include $(TOP)/configs/linux-x86-64 ++include $(TOP)/configs/debian-swx11+glu-default ++ ++CONFIG_NAME = debian-swx11+glu-amd64 ++ ++# vim: ft=make ++ +Index: mesa/configs/debian-swx11+glu-any +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ mesa/configs/debian-swx11+glu-any 2008-06-17 19:27:49.000000000 +0200 +@@ -0,0 +1,9 @@ ++# Configuration for building Mesa (swx11 and GLU) on the build architecture. ++ ++include $(TOP)/configs/linux ++include $(TOP)/configs/debian-swx11+glu-default ++ ++CONFIG_NAME = debian-swx11+glu-any ++ ++# vim: ft=make ++ +Index: mesa/configs/debian-swx11+glu-default +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ mesa/configs/debian-swx11+glu-default 2008-06-17 19:27:49.000000000 +0200 +@@ -0,0 +1,14 @@ ++# Configuration defaults for building Mesa (swx11 and GLU). ++ ++include $(TOP)/configs/debian-default ++ ++CONFIG_NAME = debian-swx11+glu-default ++ ++SRC_DIRS = mesa glu glw ++DRIVER_DIRS = x11 ++ ++GLW_SOURCES += GLwMDrawA.c ++GLW_LIB_DEPS += -lXm ++ ++# vim: ft=make ++ +Index: mesa/configs/debian-swx11+glu-i386 +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ mesa/configs/debian-swx11+glu-i386 2008-06-17 19:27:49.000000000 +0200 +@@ -0,0 +1,10 @@ ++# Configuration for building Mesa (swx11 and GLU) with runtime-detected ++# assembler optimizations on i386. ++ ++include $(TOP)/configs/linux-x86 ++include $(TOP)/configs/debian-swx11+glu-default ++ ++CONFIG_NAME = debian-swx11+glu-i386 ++ ++# vim: ft=make ++ +Index: mesa/configs/debian-swx11+glu-i386-i686 +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ mesa/configs/debian-swx11+glu-i386-i686 2008-06-17 19:27:49.000000000 +0200 +@@ -0,0 +1,14 @@ ++# Configuration for building Mesa (swx11 and GLU) with runtime-detected ++# assembler optimizations on i386 (i686 optimized). ++ ++include $(TOP)/configs/linux-x86 ++include $(TOP)/configs/debian-swx11+glu-default ++ ++CONFIG_NAME = debian-swx11+glu-i386-i686 ++ ++ARCH_FLAGS += -march=i686 ++SRC_DIRS = mesa ++LIB_DIR = lib/i686/cmov ++ ++# vim: ft=make ++ +Index: mesa/configs/debian-swx11+glu-powerpc-603 +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ mesa/configs/debian-swx11+glu-powerpc-603 2008-06-17 19:27:49.000000000 +0200 +@@ -0,0 +1,13 @@ ++# Configuration for building Mesa (swx11 and GLU) with runtime-detected ++# assembler optimizations on powerpc (603 optimized). ++ ++include $(TOP)/configs/linux-ppc ++include $(TOP)/configs/debian-swx11+glu-default ++ ++CONFIG_NAME = debian-swx11+glu-powerpc-603 ++ ++SRC_DIRS = mesa ++LIB_DIR = lib/603/cmov ++ ++# vim: ft=make ++ +Index: mesa/configs/debian-swx11+glu-ppc64 +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ mesa/configs/debian-swx11+glu-ppc64 2008-06-17 19:27:49.000000000 +0200 +@@ -0,0 +1,11 @@ ++# Configuration for building Mesa (swx11 and GLU) with runtime-detected ++# assembler optimizations on ppc64. ++ ++include $(TOP)/configs/debian-swx11+glu-any ++ ++CONFIG_NAME = debian-swx11+glu-ppc64 ++ ++LIB_DIR = lib64 ++ ++# vim: ft=make ++ +Index: mesa/configs/debian-swx11+glu-sparc +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ mesa/configs/debian-swx11+glu-sparc 2008-06-17 19:27:49.000000000 +0200 +@@ -0,0 +1,10 @@ ++# Configuration for building Mesa (swx11 and GLU) with runtime-detected ++# assembler optimizations on sparc. ++ ++include $(TOP)/configs/linux-sparc ++include $(TOP)/configs/debian-swx11+glu-default ++ ++CONFIG_NAME = debian-swx11+glu-sparc ++ ++# vim: ft=make ++ +Index: mesa/configs/debian-swx11+glu-sparc-ultrasparc +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ mesa/configs/debian-swx11+glu-sparc-ultrasparc 2008-06-17 19:27:49.000000000 +0200 +@@ -0,0 +1,13 @@ ++# Configuration for building Mesa (swx11 and GLU) with runtime-detected ++# assembler optimizations on sparc (ultrasparc-optimized). ++ ++include $(TOP)/configs/linux-ultrasparc ++include $(TOP)/configs/debian-swx11+glu-default ++ ++CONFIG_NAME = debian-swx11+glu-sparc-ultrasparc ++ ++SRC_DIRS = mesa ++LIB_DIR = lib/ultrasparc/cmov ++ ++# vim: ft=make ++ +Index: mesa/configs/debian-swx11+glu-static-amd64 +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ mesa/configs/debian-swx11+glu-static-amd64 2008-06-17 19:27:49.000000000 +0200 +@@ -0,0 +1,10 @@ ++# Configuration for building static versions of the libraries (swx11 and GLU) ++# on amd64. ++ ++include $(TOP)/configs/linux-x86-64-static ++include $(TOP)/configs/debian-swx11+glu-default ++ ++CONFIG_NAME = debian-swx11+glu-static-amd64 ++ ++# vim: ft=make ++ +Index: mesa/configs/debian-swx11+glu-static-any +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ mesa/configs/debian-swx11+glu-static-any 2008-06-17 19:27:49.000000000 +0200 +@@ -0,0 +1,10 @@ ++# Configuration for building static versions of the libraries (swx11 and GLU) ++# on the build architecture. ++ ++include $(TOP)/configs/linux-static ++include $(TOP)/configs/debian-swx11+glu-default ++ ++CONFIG_NAME = debian-swx11+glu-static-any ++ ++# vim: ft=make ++ +Index: mesa/configs/debian-swx11+glu-static-i386 +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ mesa/configs/debian-swx11+glu-static-i386 2008-06-17 19:27:49.000000000 +0200 +@@ -0,0 +1,10 @@ ++# Configuration for building static versions of the libraries (swx11 and GLU) ++# on i386. ++ ++include $(TOP)/configs/linux-x86-static ++include $(TOP)/configs/debian-swx11+glu-default ++ ++CONFIG_NAME = debian-swx11+glu-static-i386 ++ ++# vim: ft=make ++ +Index: mesa/configs/debian-swx11+glu-static-ppc64 +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ mesa/configs/debian-swx11+glu-static-ppc64 2008-06-17 19:27:49.000000000 +0200 +@@ -0,0 +1,11 @@ ++# Configuration for building static versions of the libraries (swx11 and GLU) ++# on ppc64. ++ ++include $(TOP)/configs/debian-swx11+glu-static-any ++ ++CONFIG_NAME = debian-swx11+glu-static-ppc64 ++ ++LIB_DIR = lib64 ++ ++# vim: ft=make ++ +Index: mesa/configs/default-bp +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ mesa/configs/default-bp 2008-06-17 19:27:49.000000000 +0200 +@@ -0,0 +1,75 @@ ++# Default/template configuration ++ ++# This is included by other config files which may override some ++# of these variables. ++ ++CONFIG_NAME = default ++ ++# Version info ++MESA_MAJOR=6 ++MESA_MINOR=3 ++MESA_TINY=0 ++ ++# external projects ++#DRM_SOURCE_PATH=$(TOP)/../drm ++DRM_SOURCE_PATH=/home/projects/DRI-freedesktop/drm ++ ++# Compiler and flags ++CC = cc ++CXX = CC ++CFLAGS = -O ++CXXFLAGS = -O ++GLU_CFLAGS = ++ ++# Misc tools and flags ++MKLIB_OPTIONS = ++MKDEP = makedepend ++MKDEP_OPTIONS = -fdepend ++MAKE = make ++ ++# Library names (base name) ++GL_LIB = GL ++GLU_LIB = GLU ++GLUT_LIB = glut ++GLW_LIB = GLw ++OSMESA_LIB = OSMesa ++ ++ ++# Library names (actual file names) ++GL_LIB_NAME = lib$(GL_LIB).so ++GLU_LIB_NAME = lib$(GLU_LIB).so ++GLUT_LIB_NAME = lib$(GLUT_LIB).so ++GLW_LIB_NAME = lib$(GLW_LIB).so ++OSMESA_LIB_NAME = lib$(OSMesa).so ++ ++ ++# Optional assembly language optimization files for libGL ++ASM_SOURCES = ++ ++# GLw widget sources (Append "GLwMDrawA.c" here and add -lXm to GLW_LIB_DEPS in ++# order to build the Motif widget too) ++GLW_SOURCES = GLwDrawA.c ++ ++ ++# Directories ++LIB_DIR = $(TOP)/lib ++INSTALL_PREFIX = /usr/local ++SRC_DIRS = mesa glu glut/glx glw ++GLU_DIRS = sgi ++DRIVER_DIRS = x11 osmesa ++# Which subdirs under $(TOP)/progs/ to enter: ++PROGRAM_DIRS = demos redbook samples xdemos ++ ++ ++# Library/program dependencies ++GL_LIB_DEPS = -lX11 -lXext -lm -lpthread ++OSMESA_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) ++GLU_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -lm ++GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lXmu -lXt -lXi -lm ++GLW_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -lXt -lX11 ++APP_LIB_DEPS = -L$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm ++ ++ ++# Shading language support (set to 0 or 1) ++SHADING_LANGUAGE = 0 ++ +Index: mesa/configs/linux-dri-bp +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ mesa/configs/linux-dri-bp 2008-06-17 19:27:49.000000000 +0200 +@@ -0,0 +1,55 @@ ++# -*-makefile-*- ++# Configuration for linux-dri: Linux DRI hardware drivers for XFree86 & others ++ ++include $(TOP)/configs/default ++ ++CONFIG_NAME = linux-dri ++ ++# Compiler and flags ++CC = gcc ++CXX = g++ ++ ++MKDEP = /usr/X11R6/bin/makedepend ++#MKDEP = gcc -M ++#MKDEP_OPTIONS = -MF depend ++ ++WARN_FLAGS = -Wall ++OPT_FLAGS = -g ++PIC_FLAGS = -fPIC ++ ++# Add '-DGLX_USE_TLS' to ARCH_FLAGS to enable TLS support. ++ARCH_FLAGS ?= ++ ++DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \ ++ -D_BSD_SOURCE -D_GNU_SOURCE \ ++ -DDRI_NEW_INTERFACE_ONLY -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 ++ ++X11_INCLUDES = -I/usr/X11R6/include -I/usr/X11R6/include/X11/extensions ++ ++CFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) \ ++ $(ASM_FLAGS) -std=c99 -ffast-math ++ ++CXXFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) ++ ++ ++ASM_SOURCES = ++ ++# Library/program dependencies ++EXTRA_LIB_PATH=-L/usr/X11R6/lib ++ ++DRI_LIB_DEPS = $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl ++GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lm -lpthread -ldl ++GLUT_LIB_DEPS = $(EXTRA_LIB_PATH) -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lXmu -lXt -lXi -lm ++GLW_LIB_DEPS = $(EXTRA_LIB_PATH) -L$(LIB_DIR) -l$(GL_LIB) -lXt -lX11 ++ ++ ++# Directories ++SRC_DIRS = glx/x11 mesa glu glut/glx glw ++DRIVER_DIRS = dri ++PROGRAM_DIRS = ++WINDOW_SYSTEM=dri ++ ++# ffb and gamma are missing because they have not been converted to use the new ++# interface. ++DRI_DIRS = dri_client i810 i830 i915 mach64 mga r128 r200 radeon s3v \ ++ savage sis tdfx trident unichrome fb +Index: mesa/configs/linux-osmesa-static +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ mesa/configs/linux-osmesa-static 2008-06-17 19:27:49.000000000 +0200 +@@ -0,0 +1,15 @@ ++# Configuration for building only libOSMesa on Linux, no Xlib driver ++# This doesn't really have any Linux dependencies, so it should be usable ++# on other (gcc-based) systems. ++ ++include $(TOP)/configs/linux-osmesa ++ ++CONFIG_NAME = linux-osmesa-static ++ ++# Compiler and flags ++MKLIB_OPTIONS = -static ++PIC_FLAGS = ++ ++# Library names ++OSMESA_LIB_NAME = lib$(OSMESA_LIB).a ++ +Index: mesa/configs/linux-osmesa32-static +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ mesa/configs/linux-osmesa32-static 2008-06-17 19:27:49.000000000 +0200 +@@ -0,0 +1,13 @@ ++# Configuration for 32 bits/channel OSMesa library on Linux ++ ++include $(TOP)/configs/linux-osmesa32 ++ ++CONFIG_NAME = linux-osmesa32-static ++ ++# Compiler and flags ++MKLIB_OPTIONS = -static ++PIC_FLAGS = ++ ++# Library names ++OSMESA_LIB_NAME = lib$(OSMESA_LIB).a ++ +Index: mesa/configs/linux-tcc +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ mesa/configs/linux-tcc 2008-06-17 19:27:49.000000000 +0200 +@@ -0,0 +1,22 @@ ++# Configuration for debugging on Linux ++ ++include $(TOP)/configs/default ++ ++CONFIG_NAME = linux-tcc ++ ++# Compiler and flags ++CC = gcc ++CXX = g++ ++ ++TCC_DIR=/home/progs/tcc-0.9.20 ++ ++CFLAGS = -g -ansi -pedantic -Wall -Wmissing-prototypes -Wundef -fPIC -ffast-math -D_POSIX_SOURCE -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R6/include -DUSE_XSHM -DPTHREADS -DDEBUG -DMESA_DEBUG -DUSE_TCC -I$(TCC_DIR) ++ ++CXXFLAGS = -g -ansi -pedantic -Wall -Wundef -fPIC -ffast-math -D_POSIX_SOURCE -D_SVID_SOURCE -D_BSD_SOURCE -DDEBUG -DMESA_DEBUG ++ ++GLUT_CFLAGS = -fexceptions ++ ++GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread -L$(TCC_DIR) -ltcc -ldl ++GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm ++GLW_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -lXt -L/usr/X11R6/lib -lX11 ++APP_LIB_DEPS = -L$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm +Index: mesa/configs/linux-osmesa +=================================================================== +--- mesa.orig/configs/linux-osmesa 2008-06-16 00:50:38.000000000 +0200 ++++ mesa/configs/linux-osmesa 2008-06-17 19:27:49.000000000 +0200 +@@ -9,8 +9,17 @@ + # Compiler and flags + CC = gcc + CXX = g++ +-CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DPTHREADS +-CXXFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE ++ ++PIC_FLAGS = -fPIC ++ ++DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \ ++ -D_BSD_SOURCE -D_GNU_SOURCE \ ++ -DPTHREADS -DUSE_XSHM -DHAVE_POSIX_MEMALIGN ++ ++CFLAGS = -ansi -pedantic $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) \ ++ $(ASM_FLAGS) -ffast-math ++ ++CXXFLAGS = -ansi -pedantic $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) + + # Work around aliasing bugs - developers should comment this out + CFLAGS += -fno-strict-aliasing +@@ -26,3 +35,4 @@ + OSMESA_LIB_DEPS = -lm -lpthread + GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(OSMESA_LIB) + APP_LIB_DEPS = -lOSMesa -lGLU ++ +Index: mesa/configs/linux-osmesa16 +=================================================================== +--- mesa.orig/configs/linux-osmesa16 2008-06-16 00:50:38.000000000 +0200 ++++ mesa/configs/linux-osmesa16 2008-06-17 19:27:49.000000000 +0200 +@@ -1,31 +1,19 @@ + # Configuration for 16 bits/channel OSMesa library on Linux + +-include $(TOP)/configs/default ++include $(TOP)/configs/linux-osmesa + + CONFIG_NAME = linux-osmesa16 + +-# Compiler and flags +-CC = gcc +-CXX = g++ +-CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include -DCHAN_BITS=16 -DDEFAULT_SOFTWARE_DEPTH_BITS=31 +-CXXFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE +- + # Work around aliasing bugs - developers should comment this out + CFLAGS += -fno-strict-aliasing + CXXFLAGS += -fno-strict-aliasing +- ++DEFINES += -DCHAN_BITS=16 -DDEFAULT_SOFTWARE_DEPTH_BITS=32 + # Library names + OSMESA_LIB = OSMesa16 +-OSMESA_LIB_NAME = libOSMesa16.so +- + + # Directories +-SRC_DIRS = mesa glu +-DRIVER_DIRS = osmesa + PROGRAM_DIRS = + +- + # Dependencies +-OSMESA_LIB_DEPS = -lm -lpthread +-GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(OSMESA_LIB) +-APP_LIB_DEPS = -lOSMesa16 ++APP_LIB_DEPS = -l$(OSMESA_LIB) ++ +Index: mesa/configs/linux-osmesa16-static +=================================================================== +--- mesa.orig/configs/linux-osmesa16-static 2008-06-16 00:50:38.000000000 +0200 ++++ mesa/configs/linux-osmesa16-static 2008-06-17 19:27:49.000000000 +0200 +@@ -1,14 +1,10 @@ + # Configuration for 16 bits/channel OSMesa library on Linux + +-include $(TOP)/configs/default ++include $(TOP)/configs/linux-osmesa16 + + CONFIG_NAME = linux-osmesa16-static + + # Compiler and flags +-CC = gcc +-CXX = g++ +-CFLAGS = -O3 -ansi -pedantic -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include -DCHAN_BITS=16 -DDEFAULT_SOFTWARE_DEPTH_BITS=31 +-CXXFLAGS = -O3 -ansi -pedantic -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE + MKLIB_OPTIONS = -static + PIC_FLAGS = + +@@ -17,16 +13,5 @@ + CXXFLAGS += -fno-strict-aliasing + + # Library names +-OSMESA_LIB = OSMesa16 +-OSMESA_LIB_NAME = libOSMesa16.a ++OSMESA_LIB_NAME = lib$(OSMESA_LIB).a + +- +-# Directories +-SRC_DIRS = mesa glu +-DRIVER_DIRS = osmesa +-PROGRAM_DIRS = +- +- +-# Dependencies +-OSMESA_LIB_DEPS = -lm -lpthread +-APP_LIB_DEPS = -lOSMesa16 +Index: mesa/configs/linux-osmesa32 +=================================================================== +--- mesa.orig/configs/linux-osmesa32 2008-06-16 00:50:38.000000000 +0200 ++++ mesa/configs/linux-osmesa32 2008-06-17 19:27:49.000000000 +0200 +@@ -1,31 +1,22 @@ + # Configuration for 32 bits/channel OSMesa library on Linux + +-include $(TOP)/configs/default ++include $(TOP)/configs/linux-osmesa + + CONFIG_NAME = linux-osmesa32 + + # Compiler and flags +-CC = gcc +-CXX = g++ +-CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include -DCHAN_BITS=32 -DDEFAULT_SOFTWARE_DEPTH_BITS=31 +-CXXFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE + + # Work around aliasing bugs - developers should comment this out + CFLAGS += -fno-strict-aliasing + CXXFLAGS += -fno-strict-aliasing ++DEFINES += -DCHAN_BITS=32 -DDEFAULT_SOFTWARE_DEPTH_BITS=31 + + # Library names + OSMESA_LIB = OSMesa32 +-OSMESA_LIB_NAME = libOSMesa32.so +- + + # Directories +-SRC_DIRS = mesa glu +-DRIVER_DIRS = osmesa + PROGRAM_DIRS = + +- + # Dependencies +-OSMESA_LIB_DEPS = -lm -lpthread +-GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(OSMESA_LIB) +-APP_LIB_DEPS = -lOSMesa32 ++APP_LIB_DEPS = -l$(OSMESA_LIB) ++ diff --git a/debian/patches/series b/debian/patches/series index 61b5df2292c..a3a8c0592a4 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -2,4 +2,4 @@ 01_fix-makefile.patch 02_use-ieee-fp-on-s390-and-m68k.patch 03_optional-progs-and-install.patch -04_cleanup-osmesa-configs.patch +04_debian-configs.patch -- cgit v1.2.3 From 6a6a9c1c5a915297f0b37b810a0ab8801d3b07a1 Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Tue, 17 Jun 2008 20:00:37 +0200 Subject: Pull from mesa_7_0_branch --- debian/changelog | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index c156963d542..7b51f1ddff8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,13 @@ mesa (7.0.3-3) UNRELEASED; 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 19:31:32 +0200 + -- Brice Goglin Tue, 17 Jun 2008 20:00:04 +0200 mesa (7.0.3-2) unstable; urgency=low -- cgit v1.2.3 From 5033e5b36d192fec0bfcb557ec12ac6ed1519f63 Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Tue, 17 Jun 2008 20:01:01 +0200 Subject: Prepare changelog for upload --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 7b51f1ddff8..e91a66d04e6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -mesa (7.0.3-3) UNRELEASED; urgency=low +mesa (7.0.3-3) unstable; urgency=low * Pull from mesa_7_0_branch (718724de). + Fix intel_batchbuffer_space on i965, closes: #455817. @@ -7,7 +7,7 @@ mesa (7.0.3-3) UNRELEASED; urgency=low with 04_cleanup-osmesa-configs.patch renamed into 04_debian-configs.patch, closes: #485161. - -- Brice Goglin Tue, 17 Jun 2008 20:00:04 +0200 + -- Brice Goglin Tue, 17 Jun 2008 20:00:51 +0200 mesa (7.0.3-2) unstable; urgency=low -- cgit v1.2.3 From f81070dbd50c0d8a48903d360cf964ed15bebb2e Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Wed, 18 Jun 2008 20:55:00 +0200 Subject: Pull from mesa_7_0_branch --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index e91a66d04e6..4a7a5ba8e29 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +mesa (7.0.3-4) UNRELEASED; urgency=low + + * Pull from mesa_7_0_branch (2ac4919d). + + -- Brice Goglin Wed, 18 Jun 2008 20:52:39 +0200 + mesa (7.0.3-3) unstable; urgency=low * Pull from mesa_7_0_branch (718724de). -- cgit v1.2.3 From 7c8ea0899aab2c39f5194031837503982a2f769c Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Wed, 18 Jun 2008 20:55:42 +0200 Subject: Revert "Move our configs/ changes from the .diff.gz into our quilt patches" This reverts commit 03970183fc9998bcdee9389830493a0b2dcda8d2. Conflicts: debian/changelog --- configs/debian-default | 17 + configs/debian-dri-amd64 | 9 + configs/debian-dri-any | 9 + configs/debian-dri-default | 36 + configs/debian-dri-i386 | 9 + configs/debian-dri-i386-i686 | 14 + configs/debian-dri-optimized-default | 13 + configs/debian-indirect-default | 7 + configs/debian-indirect-hurd-i386 | 9 + configs/debian-osmesa | 9 + configs/debian-osmesa-default | 10 + configs/debian-osmesa-static | 9 + configs/debian-osmesa16 | 10 + configs/debian-osmesa16-static | 10 + configs/debian-osmesa32 | 10 + configs/debian-osmesa32-static | 10 + configs/debian-swx11+glu-alpha-ev5 | 12 + configs/debian-swx11+glu-amd64 | 10 + configs/debian-swx11+glu-any | 9 + configs/debian-swx11+glu-default | 14 + configs/debian-swx11+glu-i386 | 10 + configs/debian-swx11+glu-i386-i686 | 14 + configs/debian-swx11+glu-powerpc-603 | 13 + configs/debian-swx11+glu-ppc64 | 11 + configs/debian-swx11+glu-sparc | 10 + configs/debian-swx11+glu-sparc-ultrasparc | 13 + configs/debian-swx11+glu-static-amd64 | 10 + configs/debian-swx11+glu-static-any | 10 + configs/debian-swx11+glu-static-i386 | 10 + configs/debian-swx11+glu-static-ppc64 | 11 + configs/default-bp | 75 +++ configs/linux-dri-bp | 55 ++ configs/linux-osmesa-static | 14 + configs/linux-osmesa32-static | 28 + configs/linux-tcc | 22 + debian/patches/04_cleanup-osmesa-configs.patch | 197 ++++++ debian/patches/04_debian-configs.patch | 892 ------------------------- debian/patches/series | 2 +- 38 files changed, 740 insertions(+), 893 deletions(-) create mode 100644 configs/debian-default create mode 100644 configs/debian-dri-amd64 create mode 100644 configs/debian-dri-any create mode 100644 configs/debian-dri-default create mode 100644 configs/debian-dri-i386 create mode 100644 configs/debian-dri-i386-i686 create mode 100644 configs/debian-dri-optimized-default create mode 100644 configs/debian-indirect-default create mode 100644 configs/debian-indirect-hurd-i386 create mode 100644 configs/debian-osmesa create mode 100644 configs/debian-osmesa-default create mode 100644 configs/debian-osmesa-static create mode 100644 configs/debian-osmesa16 create mode 100644 configs/debian-osmesa16-static create mode 100644 configs/debian-osmesa32 create mode 100644 configs/debian-osmesa32-static create mode 100644 configs/debian-swx11+glu-alpha-ev5 create mode 100644 configs/debian-swx11+glu-amd64 create mode 100644 configs/debian-swx11+glu-any create mode 100644 configs/debian-swx11+glu-default create mode 100644 configs/debian-swx11+glu-i386 create mode 100644 configs/debian-swx11+glu-i386-i686 create mode 100644 configs/debian-swx11+glu-powerpc-603 create mode 100644 configs/debian-swx11+glu-ppc64 create mode 100644 configs/debian-swx11+glu-sparc create mode 100644 configs/debian-swx11+glu-sparc-ultrasparc create mode 100644 configs/debian-swx11+glu-static-amd64 create mode 100644 configs/debian-swx11+glu-static-any create mode 100644 configs/debian-swx11+glu-static-i386 create mode 100644 configs/debian-swx11+glu-static-ppc64 create mode 100644 configs/default-bp create mode 100644 configs/linux-dri-bp create mode 100644 configs/linux-osmesa-static create mode 100644 configs/linux-osmesa32-static create mode 100644 configs/linux-tcc create mode 100644 debian/patches/04_cleanup-osmesa-configs.patch delete mode 100644 debian/patches/04_debian-configs.patch (limited to 'debian') diff --git a/configs/debian-default b/configs/debian-default new file mode 100644 index 00000000000..8d1b785ee00 --- /dev/null +++ b/configs/debian-default @@ -0,0 +1,17 @@ +# Define Debian-specific defaults. + +CONFIG_NAME = debian-default + +OPT_FLAGS = -O2 -g + +# override settings in configs/linux-x86-64 +LIB_DIR = lib +EXTRA_LIB_PATH = + +SRC_DIRS = mesa +PROGRAM_DIRS = + +INSTALL_DIR = /usr + +# vim: ft=make + diff --git a/configs/debian-dri-amd64 b/configs/debian-dri-amd64 new file mode 100644 index 00000000000..ff4232b1200 --- /dev/null +++ b/configs/debian-dri-amd64 @@ -0,0 +1,9 @@ +# Configuration for building the DRI drivers on i386. + +include $(TOP)/configs/linux-dri-x86-64 +include $(TOP)/configs/debian-dri-default + +CONFIG_NAME = debian-dri-amd64 + +# vim: ft=make + diff --git a/configs/debian-dri-any b/configs/debian-dri-any new file mode 100644 index 00000000000..c4b65b0c482 --- /dev/null +++ b/configs/debian-dri-any @@ -0,0 +1,9 @@ +# Configuration for building the DRI drivers on the build architecture. + +include $(TOP)/configs/linux-dri +include $(TOP)/configs/debian-dri-default + +CONFIG_NAME = debian-dri-any + +# vim: ft=make + diff --git a/configs/debian-dri-default b/configs/debian-dri-default new file mode 100644 index 00000000000..f92c7eddd01 --- /dev/null +++ b/configs/debian-dri-default @@ -0,0 +1,36 @@ +# Configuration defaults for building the DRI drivers and DRI/GLX-enabled +# libGL. + +include $(TOP)/configs/debian-default + +CONFIG_NAME = debian-dri-default + +SRC_DIRS = glx/x11 mesa progs +DRIVER_DIRS = dri +PROGRAM_DIRS = xdemos +PROGS = glxdemo \ + glxgears \ + glxheads \ + glxinfo + +LIB_DIR = lib/glx + +DRI_DRIVER_INSTALL_DIR = $(INSTALL_DIR)/lib/dri +DRI_DRIVER_SEARCH_DIR = /usr/lib/dri + +DRI_DIRS = mach64 mga r128 r200 r300 radeon s3v savage tdfx trident + +ARCH_X86 = i386 amd64 + +ifneq ($(findstring $(DEB_BUILD_ARCH), $(ARCH_X86)),) + DRI_DIRS += i810 i915 i915tex i965 sis unichrome +endif + +ifeq ($(DEB_BUILD_ARCH), sparc) + DRI_DIRS += ffb +endif + +APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) + +# vim: ft=make + diff --git a/configs/debian-dri-i386 b/configs/debian-dri-i386 new file mode 100644 index 00000000000..7a0aaa487d2 --- /dev/null +++ b/configs/debian-dri-i386 @@ -0,0 +1,9 @@ +# Configuration for building the DRI drivers on i386. + +include $(TOP)/configs/linux-dri-x86 +include $(TOP)/configs/debian-dri-default + +CONFIG_NAME = debian-dri-i386 + +# vim: ft=make + diff --git a/configs/debian-dri-i386-i686 b/configs/debian-dri-i386-i686 new file mode 100644 index 00000000000..b15cd77a03d --- /dev/null +++ b/configs/debian-dri-i386-i686 @@ -0,0 +1,14 @@ +# Configuration for building the DRI drivers on i386. + +include $(TOP)/configs/linux-dri-x86 +include $(TOP)/configs/debian-dri-optimized-default + +CONFIG_NAME = debian-dri-i386-i686 + +ARCH_FLAGS = -march=i686 +LIB_DIR = lib/glx/i686/cmov + +DRI_DRIVER_INSTALL_DIR = $(INSTALL_DIR)/lib/dri/i686/cmov + +# vim: ft=make + diff --git a/configs/debian-dri-optimized-default b/configs/debian-dri-optimized-default new file mode 100644 index 00000000000..9c3f68dde7a --- /dev/null +++ b/configs/debian-dri-optimized-default @@ -0,0 +1,13 @@ +# Configuration defaults for CPU-optimized builds of the DRI drivers and +# DRI/GLX-enabled libGL. + +include $(TOP)/configs/debian-dri-default + +CONFIG_NAME = debian-dri-optimized-default + +# override so that the utility programs are not rebuilt with CPU-specific +# optimizations +SRC_DIRS = glx/x11 mesa + +# vim: ft=make + diff --git a/configs/debian-indirect-default b/configs/debian-indirect-default new file mode 100644 index 00000000000..a6926c95fcc --- /dev/null +++ b/configs/debian-indirect-default @@ -0,0 +1,7 @@ +# Configuration defaults for building GLX-enabled libGL. + +include $(TOP)/configs/debian-dri-default + +CONFIG_NAME = debian-indirect-default + +DRI_DIRS = diff --git a/configs/debian-indirect-hurd-i386 b/configs/debian-indirect-hurd-i386 new file mode 100644 index 00000000000..dd4bb07ca52 --- /dev/null +++ b/configs/debian-indirect-hurd-i386 @@ -0,0 +1,9 @@ +# Configuration for building the DRI drivers on the build architecture. + +include $(TOP)/configs/linux-indirect +include $(TOP)/configs/debian-indirect-default + +CONFIG_NAME = debian-indirect-hurd-i386 + +# vim: ft=make + diff --git a/configs/debian-osmesa b/configs/debian-osmesa new file mode 100644 index 00000000000..9b7fc7b2afd --- /dev/null +++ b/configs/debian-osmesa @@ -0,0 +1,9 @@ +# Configuration for building only OSMesa on Debian. + +include $(TOP)/configs/linux-osmesa +include $(TOP)/configs/debian-osmesa-default + +CONFIG_NAME = debian-osmesa + +# vim: ft=make + diff --git a/configs/debian-osmesa-default b/configs/debian-osmesa-default new file mode 100644 index 00000000000..ef5a5ba0c7c --- /dev/null +++ b/configs/debian-osmesa-default @@ -0,0 +1,10 @@ +# Configuration defaults for building OSMesa. + +include $(TOP)/configs/debian-default + +CONFIG_NAME = debian-osmesa-default + +DRIVER_DIRS = osmesa + +# vim: ft=make + diff --git a/configs/debian-osmesa-static b/configs/debian-osmesa-static new file mode 100644 index 00000000000..03fe8b5f20e --- /dev/null +++ b/configs/debian-osmesa-static @@ -0,0 +1,9 @@ +# Configuration for building only OSMesa (static version) on Debian. + +include $(TOP)/configs/linux-osmesa-static +include $(TOP)/configs/debian-osmesa-default + +CONFIG_NAME = debian-osmesa-static + +# vim: ft=make + diff --git a/configs/debian-osmesa16 b/configs/debian-osmesa16 new file mode 100644 index 00000000000..0077930188f --- /dev/null +++ b/configs/debian-osmesa16 @@ -0,0 +1,10 @@ +# Configuration for building OSMesa with support for 16 bits per color +# channel. + +include $(TOP)/configs/linux-osmesa16 +include $(TOP)/configs/debian-osmesa-default + +CONFIG_NAME = debian-osmesa16 + +# vim: ft=make + diff --git a/configs/debian-osmesa16-static b/configs/debian-osmesa16-static new file mode 100644 index 00000000000..6ff399e627c --- /dev/null +++ b/configs/debian-osmesa16-static @@ -0,0 +1,10 @@ +# Configuration for building a static version of OSMesa with support for 16 +# bits per color channel. + +include $(TOP)/configs/linux-osmesa16-static +include $(TOP)/configs/debian-osmesa-default + +CONFIG_NAME = debian-osmesa16-static + +# vim: ft=make + diff --git a/configs/debian-osmesa32 b/configs/debian-osmesa32 new file mode 100644 index 00000000000..de3b3277c21 --- /dev/null +++ b/configs/debian-osmesa32 @@ -0,0 +1,10 @@ +# Configuration for building OSMesa with support for 32 bits per color +# channel. + +include $(TOP)/configs/linux-osmesa32 +include $(TOP)/configs/debian-osmesa-default + +CONFIG_NAME = debian-osmesa32 + +# vim: ft=make + diff --git a/configs/debian-osmesa32-static b/configs/debian-osmesa32-static new file mode 100644 index 00000000000..7fdfcef4013 --- /dev/null +++ b/configs/debian-osmesa32-static @@ -0,0 +1,10 @@ +# Configuration for building a static version of OSMesa with support for 32 +# bits per color channel. + +include $(TOP)/configs/linux-osmesa32-static +include $(TOP)/configs/debian-osmesa-default + +CONFIG_NAME = debian-osmesa32-static + +# vim: ft=make + diff --git a/configs/debian-swx11+glu-alpha-ev5 b/configs/debian-swx11+glu-alpha-ev5 new file mode 100644 index 00000000000..fd16e49e374 --- /dev/null +++ b/configs/debian-swx11+glu-alpha-ev5 @@ -0,0 +1,12 @@ +# Configuration for building Mesa (swx11 and GLU) on alpha (ev5 optimized). + +include $(TOP)/configs/linux-alpha +include $(TOP)/configs/debian-swx11+glu-default + +CONFIG_NAME = debian-swx11+glu-alpha-ev5 + +SRC_DIRS = mesa +LIB_DIR = lib/ev5/cmov + +# vim: ft=make + diff --git a/configs/debian-swx11+glu-amd64 b/configs/debian-swx11+glu-amd64 new file mode 100644 index 00000000000..4bd7e51443a --- /dev/null +++ b/configs/debian-swx11+glu-amd64 @@ -0,0 +1,10 @@ +# Configuration for building Mesa (swx11 and GLU) with runtime-detected +# assembler optimizations on amd64. + +include $(TOP)/configs/linux-x86-64 +include $(TOP)/configs/debian-swx11+glu-default + +CONFIG_NAME = debian-swx11+glu-amd64 + +# vim: ft=make + diff --git a/configs/debian-swx11+glu-any b/configs/debian-swx11+glu-any new file mode 100644 index 00000000000..884c9f9f23e --- /dev/null +++ b/configs/debian-swx11+glu-any @@ -0,0 +1,9 @@ +# Configuration for building Mesa (swx11 and GLU) on the build architecture. + +include $(TOP)/configs/linux +include $(TOP)/configs/debian-swx11+glu-default + +CONFIG_NAME = debian-swx11+glu-any + +# vim: ft=make + diff --git a/configs/debian-swx11+glu-default b/configs/debian-swx11+glu-default new file mode 100644 index 00000000000..ccf827639c6 --- /dev/null +++ b/configs/debian-swx11+glu-default @@ -0,0 +1,14 @@ +# Configuration defaults for building Mesa (swx11 and GLU). + +include $(TOP)/configs/debian-default + +CONFIG_NAME = debian-swx11+glu-default + +SRC_DIRS = mesa glu glw +DRIVER_DIRS = x11 + +GLW_SOURCES += GLwMDrawA.c +GLW_LIB_DEPS += -lXm + +# vim: ft=make + diff --git a/configs/debian-swx11+glu-i386 b/configs/debian-swx11+glu-i386 new file mode 100644 index 00000000000..0b800c64bba --- /dev/null +++ b/configs/debian-swx11+glu-i386 @@ -0,0 +1,10 @@ +# Configuration for building Mesa (swx11 and GLU) with runtime-detected +# assembler optimizations on i386. + +include $(TOP)/configs/linux-x86 +include $(TOP)/configs/debian-swx11+glu-default + +CONFIG_NAME = debian-swx11+glu-i386 + +# vim: ft=make + diff --git a/configs/debian-swx11+glu-i386-i686 b/configs/debian-swx11+glu-i386-i686 new file mode 100644 index 00000000000..c6969b3f830 --- /dev/null +++ b/configs/debian-swx11+glu-i386-i686 @@ -0,0 +1,14 @@ +# Configuration for building Mesa (swx11 and GLU) with runtime-detected +# assembler optimizations on i386 (i686 optimized). + +include $(TOP)/configs/linux-x86 +include $(TOP)/configs/debian-swx11+glu-default + +CONFIG_NAME = debian-swx11+glu-i386-i686 + +ARCH_FLAGS += -march=i686 +SRC_DIRS = mesa +LIB_DIR = lib/i686/cmov + +# vim: ft=make + diff --git a/configs/debian-swx11+glu-powerpc-603 b/configs/debian-swx11+glu-powerpc-603 new file mode 100644 index 00000000000..86b3580e380 --- /dev/null +++ b/configs/debian-swx11+glu-powerpc-603 @@ -0,0 +1,13 @@ +# Configuration for building Mesa (swx11 and GLU) with runtime-detected +# assembler optimizations on powerpc (603 optimized). + +include $(TOP)/configs/linux-ppc +include $(TOP)/configs/debian-swx11+glu-default + +CONFIG_NAME = debian-swx11+glu-powerpc-603 + +SRC_DIRS = mesa +LIB_DIR = lib/603/cmov + +# vim: ft=make + diff --git a/configs/debian-swx11+glu-ppc64 b/configs/debian-swx11+glu-ppc64 new file mode 100644 index 00000000000..67c59b6eef2 --- /dev/null +++ b/configs/debian-swx11+glu-ppc64 @@ -0,0 +1,11 @@ +# Configuration for building Mesa (swx11 and GLU) with runtime-detected +# assembler optimizations on ppc64. + +include $(TOP)/configs/debian-swx11+glu-any + +CONFIG_NAME = debian-swx11+glu-ppc64 + +LIB_DIR = lib64 + +# vim: ft=make + diff --git a/configs/debian-swx11+glu-sparc b/configs/debian-swx11+glu-sparc new file mode 100644 index 00000000000..8854b40d4fc --- /dev/null +++ b/configs/debian-swx11+glu-sparc @@ -0,0 +1,10 @@ +# Configuration for building Mesa (swx11 and GLU) with runtime-detected +# assembler optimizations on sparc. + +include $(TOP)/configs/linux-sparc +include $(TOP)/configs/debian-swx11+glu-default + +CONFIG_NAME = debian-swx11+glu-sparc + +# vim: ft=make + diff --git a/configs/debian-swx11+glu-sparc-ultrasparc b/configs/debian-swx11+glu-sparc-ultrasparc new file mode 100644 index 00000000000..14e38018c46 --- /dev/null +++ b/configs/debian-swx11+glu-sparc-ultrasparc @@ -0,0 +1,13 @@ +# Configuration for building Mesa (swx11 and GLU) with runtime-detected +# assembler optimizations on sparc (ultrasparc-optimized). + +include $(TOP)/configs/linux-ultrasparc +include $(TOP)/configs/debian-swx11+glu-default + +CONFIG_NAME = debian-swx11+glu-sparc-ultrasparc + +SRC_DIRS = mesa +LIB_DIR = lib/ultrasparc/cmov + +# vim: ft=make + diff --git a/configs/debian-swx11+glu-static-amd64 b/configs/debian-swx11+glu-static-amd64 new file mode 100644 index 00000000000..2976fbe66f3 --- /dev/null +++ b/configs/debian-swx11+glu-static-amd64 @@ -0,0 +1,10 @@ +# Configuration for building static versions of the libraries (swx11 and GLU) +# on amd64. + +include $(TOP)/configs/linux-x86-64-static +include $(TOP)/configs/debian-swx11+glu-default + +CONFIG_NAME = debian-swx11+glu-static-amd64 + +# vim: ft=make + diff --git a/configs/debian-swx11+glu-static-any b/configs/debian-swx11+glu-static-any new file mode 100644 index 00000000000..82f794d28df --- /dev/null +++ b/configs/debian-swx11+glu-static-any @@ -0,0 +1,10 @@ +# Configuration for building static versions of the libraries (swx11 and GLU) +# on the build architecture. + +include $(TOP)/configs/linux-static +include $(TOP)/configs/debian-swx11+glu-default + +CONFIG_NAME = debian-swx11+glu-static-any + +# vim: ft=make + diff --git a/configs/debian-swx11+glu-static-i386 b/configs/debian-swx11+glu-static-i386 new file mode 100644 index 00000000000..62859e42548 --- /dev/null +++ b/configs/debian-swx11+glu-static-i386 @@ -0,0 +1,10 @@ +# Configuration for building static versions of the libraries (swx11 and GLU) +# on i386. + +include $(TOP)/configs/linux-x86-static +include $(TOP)/configs/debian-swx11+glu-default + +CONFIG_NAME = debian-swx11+glu-static-i386 + +# vim: ft=make + diff --git a/configs/debian-swx11+glu-static-ppc64 b/configs/debian-swx11+glu-static-ppc64 new file mode 100644 index 00000000000..a9ea4a95b31 --- /dev/null +++ b/configs/debian-swx11+glu-static-ppc64 @@ -0,0 +1,11 @@ +# Configuration for building static versions of the libraries (swx11 and GLU) +# on ppc64. + +include $(TOP)/configs/debian-swx11+glu-static-any + +CONFIG_NAME = debian-swx11+glu-static-ppc64 + +LIB_DIR = lib64 + +# vim: ft=make + diff --git a/configs/default-bp b/configs/default-bp new file mode 100644 index 00000000000..29faceed817 --- /dev/null +++ b/configs/default-bp @@ -0,0 +1,75 @@ +# Default/template configuration + +# This is included by other config files which may override some +# of these variables. + +CONFIG_NAME = default + +# Version info +MESA_MAJOR=6 +MESA_MINOR=3 +MESA_TINY=0 + +# external projects +#DRM_SOURCE_PATH=$(TOP)/../drm +DRM_SOURCE_PATH=/home/projects/DRI-freedesktop/drm + +# Compiler and flags +CC = cc +CXX = CC +CFLAGS = -O +CXXFLAGS = -O +GLU_CFLAGS = + +# Misc tools and flags +MKLIB_OPTIONS = +MKDEP = makedepend +MKDEP_OPTIONS = -fdepend +MAKE = make + +# Library names (base name) +GL_LIB = GL +GLU_LIB = GLU +GLUT_LIB = glut +GLW_LIB = GLw +OSMESA_LIB = OSMesa + + +# Library names (actual file names) +GL_LIB_NAME = lib$(GL_LIB).so +GLU_LIB_NAME = lib$(GLU_LIB).so +GLUT_LIB_NAME = lib$(GLUT_LIB).so +GLW_LIB_NAME = lib$(GLW_LIB).so +OSMESA_LIB_NAME = lib$(OSMesa).so + + +# Optional assembly language optimization files for libGL +ASM_SOURCES = + +# GLw widget sources (Append "GLwMDrawA.c" here and add -lXm to GLW_LIB_DEPS in +# order to build the Motif widget too) +GLW_SOURCES = GLwDrawA.c + + +# Directories +LIB_DIR = $(TOP)/lib +INSTALL_PREFIX = /usr/local +SRC_DIRS = mesa glu glut/glx glw +GLU_DIRS = sgi +DRIVER_DIRS = x11 osmesa +# Which subdirs under $(TOP)/progs/ to enter: +PROGRAM_DIRS = demos redbook samples xdemos + + +# Library/program dependencies +GL_LIB_DEPS = -lX11 -lXext -lm -lpthread +OSMESA_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) +GLU_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -lm +GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lXmu -lXt -lXi -lm +GLW_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -lXt -lX11 +APP_LIB_DEPS = -L$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm + + +# Shading language support (set to 0 or 1) +SHADING_LANGUAGE = 0 + diff --git a/configs/linux-dri-bp b/configs/linux-dri-bp new file mode 100644 index 00000000000..e9db29fc36b --- /dev/null +++ b/configs/linux-dri-bp @@ -0,0 +1,55 @@ +# -*-makefile-*- +# Configuration for linux-dri: Linux DRI hardware drivers for XFree86 & others + +include $(TOP)/configs/default + +CONFIG_NAME = linux-dri + +# Compiler and flags +CC = gcc +CXX = g++ + +MKDEP = /usr/X11R6/bin/makedepend +#MKDEP = gcc -M +#MKDEP_OPTIONS = -MF depend + +WARN_FLAGS = -Wall +OPT_FLAGS = -g +PIC_FLAGS = -fPIC + +# Add '-DGLX_USE_TLS' to ARCH_FLAGS to enable TLS support. +ARCH_FLAGS ?= + +DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \ + -D_BSD_SOURCE -D_GNU_SOURCE \ + -DDRI_NEW_INTERFACE_ONLY -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 + +X11_INCLUDES = -I/usr/X11R6/include -I/usr/X11R6/include/X11/extensions + +CFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) \ + $(ASM_FLAGS) -std=c99 -ffast-math + +CXXFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) + + +ASM_SOURCES = + +# Library/program dependencies +EXTRA_LIB_PATH=-L/usr/X11R6/lib + +DRI_LIB_DEPS = $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl +GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lm -lpthread -ldl +GLUT_LIB_DEPS = $(EXTRA_LIB_PATH) -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lXmu -lXt -lXi -lm +GLW_LIB_DEPS = $(EXTRA_LIB_PATH) -L$(LIB_DIR) -l$(GL_LIB) -lXt -lX11 + + +# Directories +SRC_DIRS = glx/x11 mesa glu glut/glx glw +DRIVER_DIRS = dri +PROGRAM_DIRS = +WINDOW_SYSTEM=dri + +# ffb and gamma are missing because they have not been converted to use the new +# interface. +DRI_DIRS = dri_client i810 i830 i915 mach64 mga r128 r200 radeon s3v \ + savage sis tdfx trident unichrome fb diff --git a/configs/linux-osmesa-static b/configs/linux-osmesa-static new file mode 100644 index 00000000000..465f83ca058 --- /dev/null +++ b/configs/linux-osmesa-static @@ -0,0 +1,14 @@ +# Configuration for building only libOSMesa on Linux, no Xlib driver +# This doesn't really have any Linux dependencies, so it should be usable +# on other (gcc-based) systems. + +include $(TOP)/configs/linux-osmesa + +CONFIG_NAME = linux-osmesa-static + +# Compiler and flags +MKLIB_OPTIONS = -static + +# Library names +OSMESA_LIB_NAME = libOSMesa.a + diff --git a/configs/linux-osmesa32-static b/configs/linux-osmesa32-static new file mode 100644 index 00000000000..6db8bc02370 --- /dev/null +++ b/configs/linux-osmesa32-static @@ -0,0 +1,28 @@ +# Configuration for 32 bits/channel OSMesa library on Linux + +include $(TOP)/configs/default + +CONFIG_NAME = linux-osmesa32-static + +# Compiler and flags +CC = gcc +CXX = g++ +CFLAGS = -O3 -ansi -pedantic -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include -DCHAN_BITS=32 -DDEFAULT_SOFTWARE_DEPTH_BITS=31 +CXXFLAGS = -O3 -ansi -pedantic -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE +MKLIB_OPTIONS = -static + + +# Library names +OSMESA_LIB = OSMesa32 +OSMESA_LIB_NAME = libOSMesa32.a + + +# Directories +SRC_DIRS = mesa glu +DRIVER_DIRS = osmesa +PROGRAM_DIRS = + + +# Dependencies +OSMESA_LIB_DEPS = -lm -lpthread +APP_LIB_DEPS = -lOSMesa32 diff --git a/configs/linux-tcc b/configs/linux-tcc new file mode 100644 index 00000000000..4371fe21fc7 --- /dev/null +++ b/configs/linux-tcc @@ -0,0 +1,22 @@ +# Configuration for debugging on Linux + +include $(TOP)/configs/default + +CONFIG_NAME = linux-tcc + +# Compiler and flags +CC = gcc +CXX = g++ + +TCC_DIR=/home/progs/tcc-0.9.20 + +CFLAGS = -g -ansi -pedantic -Wall -Wmissing-prototypes -Wundef -fPIC -ffast-math -D_POSIX_SOURCE -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R6/include -DUSE_XSHM -DPTHREADS -DDEBUG -DMESA_DEBUG -DUSE_TCC -I$(TCC_DIR) + +CXXFLAGS = -g -ansi -pedantic -Wall -Wundef -fPIC -ffast-math -D_POSIX_SOURCE -D_SVID_SOURCE -D_BSD_SOURCE -DDEBUG -DMESA_DEBUG + +GLUT_CFLAGS = -fexceptions + +GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread -L$(TCC_DIR) -ltcc -ldl +GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm +GLW_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -lXt -L/usr/X11R6/lib -lX11 +APP_LIB_DEPS = -L$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm diff --git a/debian/patches/04_cleanup-osmesa-configs.patch b/debian/patches/04_cleanup-osmesa-configs.patch new file mode 100644 index 00000000000..68bd4775e13 --- /dev/null +++ b/debian/patches/04_cleanup-osmesa-configs.patch @@ -0,0 +1,197 @@ +Index: mesa/configs/linux-osmesa +=================================================================== +--- mesa.orig/configs/linux-osmesa 2007-11-11 00:24:07.000000000 +0100 ++++ mesa/configs/linux-osmesa 2007-11-11 00:33:20.000000000 +0100 +@@ -9,8 +9,17 @@ + # Compiler and flags + CC = gcc + CXX = g++ +-CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DPTHREADS +-CXXFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE ++ ++PIC_FLAGS = -fPIC ++ ++DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \ ++ -D_BSD_SOURCE -D_GNU_SOURCE \ ++ -DPTHREADS -DUSE_XSHM -DHAVE_POSIX_MEMALIGN ++ ++CFLAGS = -ansi -pedantic $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) \ ++ $(ASM_FLAGS) -ffast-math ++ ++CXXFLAGS = -ansi -pedantic $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) + + # Work around aliasing bugs - developers should comment this out + CFLAGS += -fno-strict-aliasing +@@ -26,3 +35,4 @@ + OSMESA_LIB_DEPS = -lm -lpthread + GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(OSMESA_LIB) + APP_LIB_DEPS = -lOSMesa -lGLU ++ +Index: mesa/configs/linux-osmesa-static +=================================================================== +--- mesa.orig/configs/linux-osmesa-static 2007-11-11 00:24:01.000000000 +0100 ++++ mesa/configs/linux-osmesa-static 2007-11-11 00:33:20.000000000 +0100 +@@ -8,7 +8,8 @@ + + # Compiler and flags + MKLIB_OPTIONS = -static ++PIC_FLAGS = + + # Library names +-OSMESA_LIB_NAME = libOSMesa.a ++OSMESA_LIB_NAME = lib$(OSMESA_LIB).a + +Index: mesa/configs/linux-osmesa16 +=================================================================== +--- mesa.orig/configs/linux-osmesa16 2007-11-11 00:24:07.000000000 +0100 ++++ mesa/configs/linux-osmesa16 2007-11-11 00:33:41.000000000 +0100 +@@ -1,31 +1,19 @@ + # Configuration for 16 bits/channel OSMesa library on Linux + +-include $(TOP)/configs/default ++include $(TOP)/configs/linux-osmesa + + CONFIG_NAME = linux-osmesa16 + +-# Compiler and flags +-CC = gcc +-CXX = g++ +-CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include -DCHAN_BITS=16 -DDEFAULT_SOFTWARE_DEPTH_BITS=31 +-CXXFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE +- + # Work around aliasing bugs - developers should comment this out + CFLAGS += -fno-strict-aliasing + CXXFLAGS += -fno-strict-aliasing +- ++DEFINES += -DCHAN_BITS=16 -DDEFAULT_SOFTWARE_DEPTH_BITS=32 + # Library names + OSMESA_LIB = OSMesa16 +-OSMESA_LIB_NAME = libOSMesa16.so +- + + # Directories +-SRC_DIRS = mesa glu +-DRIVER_DIRS = osmesa + PROGRAM_DIRS = + +- + # Dependencies +-OSMESA_LIB_DEPS = -lm -lpthread +-GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(OSMESA_LIB) +-APP_LIB_DEPS = -lOSMesa16 ++APP_LIB_DEPS = -l$(OSMESA_LIB) ++ +Index: mesa/configs/linux-osmesa16-static +=================================================================== +--- mesa.orig/configs/linux-osmesa16-static 2007-11-11 00:24:07.000000000 +0100 ++++ mesa/configs/linux-osmesa16-static 2007-11-11 00:33:20.000000000 +0100 +@@ -1,14 +1,10 @@ + # Configuration for 16 bits/channel OSMesa library on Linux + +-include $(TOP)/configs/default ++include $(TOP)/configs/linux-osmesa16 + + CONFIG_NAME = linux-osmesa16-static + + # Compiler and flags +-CC = gcc +-CXX = g++ +-CFLAGS = -O3 -ansi -pedantic -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include -DCHAN_BITS=16 -DDEFAULT_SOFTWARE_DEPTH_BITS=31 +-CXXFLAGS = -O3 -ansi -pedantic -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE + MKLIB_OPTIONS = -static + PIC_FLAGS = + +@@ -17,16 +13,5 @@ + CXXFLAGS += -fno-strict-aliasing + + # Library names +-OSMESA_LIB = OSMesa16 +-OSMESA_LIB_NAME = libOSMesa16.a ++OSMESA_LIB_NAME = lib$(OSMESA_LIB).a + +- +-# Directories +-SRC_DIRS = mesa glu +-DRIVER_DIRS = osmesa +-PROGRAM_DIRS = +- +- +-# Dependencies +-OSMESA_LIB_DEPS = -lm -lpthread +-APP_LIB_DEPS = -lOSMesa16 +Index: mesa/configs/linux-osmesa32 +=================================================================== +--- mesa.orig/configs/linux-osmesa32 2007-11-11 00:24:07.000000000 +0100 ++++ mesa/configs/linux-osmesa32 2007-11-11 00:33:51.000000000 +0100 +@@ -1,31 +1,22 @@ + # Configuration for 32 bits/channel OSMesa library on Linux + +-include $(TOP)/configs/default ++include $(TOP)/configs/linux-osmesa + + CONFIG_NAME = linux-osmesa32 + + # Compiler and flags +-CC = gcc +-CXX = g++ +-CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include -DCHAN_BITS=32 -DDEFAULT_SOFTWARE_DEPTH_BITS=31 +-CXXFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE + + # Work around aliasing bugs - developers should comment this out + CFLAGS += -fno-strict-aliasing + CXXFLAGS += -fno-strict-aliasing ++DEFINES += -DCHAN_BITS=32 -DDEFAULT_SOFTWARE_DEPTH_BITS=31 + + # Library names + OSMESA_LIB = OSMesa32 +-OSMESA_LIB_NAME = libOSMesa32.so +- + + # Directories +-SRC_DIRS = mesa glu +-DRIVER_DIRS = osmesa + PROGRAM_DIRS = + +- + # Dependencies +-OSMESA_LIB_DEPS = -lm -lpthread +-GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(OSMESA_LIB) +-APP_LIB_DEPS = -lOSMesa32 ++APP_LIB_DEPS = -l$(OSMESA_LIB) ++ +Index: mesa/configs/linux-osmesa32-static +=================================================================== +--- mesa.orig/configs/linux-osmesa32-static 2007-11-11 00:24:01.000000000 +0100 ++++ mesa/configs/linux-osmesa32-static 2007-11-11 00:33:20.000000000 +0100 +@@ -1,28 +1,13 @@ + # Configuration for 32 bits/channel OSMesa library on Linux + +-include $(TOP)/configs/default ++include $(TOP)/configs/linux-osmesa32 + + CONFIG_NAME = linux-osmesa32-static + + # Compiler and flags +-CC = gcc +-CXX = g++ +-CFLAGS = -O3 -ansi -pedantic -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include -DCHAN_BITS=32 -DDEFAULT_SOFTWARE_DEPTH_BITS=31 +-CXXFLAGS = -O3 -ansi -pedantic -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE + MKLIB_OPTIONS = -static +- ++PIC_FLAGS = + + # Library names +-OSMESA_LIB = OSMesa32 +-OSMESA_LIB_NAME = libOSMesa32.a +- +- +-# Directories +-SRC_DIRS = mesa glu +-DRIVER_DIRS = osmesa +-PROGRAM_DIRS = +- ++OSMESA_LIB_NAME = lib$(OSMESA_LIB).a + +-# Dependencies +-OSMESA_LIB_DEPS = -lm -lpthread +-APP_LIB_DEPS = -lOSMesa32 diff --git a/debian/patches/04_debian-configs.patch b/debian/patches/04_debian-configs.patch deleted file mode 100644 index 4bb36dd66de..00000000000 --- a/debian/patches/04_debian-configs.patch +++ /dev/null @@ -1,892 +0,0 @@ ---- - configs/debian-default | 17 ++++++ - configs/debian-dri-amd64 | 9 +++ - configs/debian-dri-any | 9 +++ - configs/debian-dri-default | 36 ++++++++++++++ - configs/debian-dri-i386 | 9 +++ - configs/debian-dri-i386-i686 | 14 +++++ - configs/debian-dri-optimized-default | 13 +++++ - configs/debian-indirect-default | 7 ++ - configs/debian-indirect-hurd-i386 | 9 +++ - configs/debian-osmesa | 9 +++ - configs/debian-osmesa-default | 10 ++++ - configs/debian-osmesa-static | 9 +++ - configs/debian-osmesa16 | 10 ++++ - configs/debian-osmesa16-static | 10 ++++ - configs/debian-osmesa32 | 10 ++++ - configs/debian-osmesa32-static | 10 ++++ - configs/debian-swx11+glu-alpha-ev5 | 12 ++++ - configs/debian-swx11+glu-amd64 | 10 ++++ - configs/debian-swx11+glu-any | 9 +++ - configs/debian-swx11+glu-default | 14 +++++ - configs/debian-swx11+glu-i386 | 10 ++++ - configs/debian-swx11+glu-i386-i686 | 14 +++++ - configs/debian-swx11+glu-powerpc-603 | 13 +++++ - configs/debian-swx11+glu-ppc64 | 11 ++++ - configs/debian-swx11+glu-sparc | 10 ++++ - configs/debian-swx11+glu-sparc-ultrasparc | 13 +++++ - configs/debian-swx11+glu-static-amd64 | 10 ++++ - configs/debian-swx11+glu-static-any | 10 ++++ - configs/debian-swx11+glu-static-i386 | 10 ++++ - configs/debian-swx11+glu-static-ppc64 | 11 ++++ - configs/default-bp | 75 ++++++++++++++++++++++++++++++ - configs/linux-dri-bp | 55 ++++++++++++++++++++++ - configs/linux-osmesa | 14 ++++- - configs/linux-osmesa-static | 15 ++++++ - configs/linux-osmesa16 | 20 +------- - configs/linux-osmesa16-static | 19 ------- - configs/linux-osmesa32 | 17 +----- - configs/linux-osmesa32-static | 13 +++++ - configs/linux-tcc | 22 ++++++++ - 39 files changed, 550 insertions(+), 48 deletions(-) - -Index: mesa/configs/debian-default -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ mesa/configs/debian-default 2008-06-17 19:27:49.000000000 +0200 -@@ -0,0 +1,17 @@ -+# Define Debian-specific defaults. -+ -+CONFIG_NAME = debian-default -+ -+OPT_FLAGS = -O2 -g -+ -+# override settings in configs/linux-x86-64 -+LIB_DIR = lib -+EXTRA_LIB_PATH = -+ -+SRC_DIRS = mesa -+PROGRAM_DIRS = -+ -+INSTALL_DIR = /usr -+ -+# vim: ft=make -+ -Index: mesa/configs/debian-dri-amd64 -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ mesa/configs/debian-dri-amd64 2008-06-17 19:27:49.000000000 +0200 -@@ -0,0 +1,9 @@ -+# Configuration for building the DRI drivers on i386. -+ -+include $(TOP)/configs/linux-dri-x86-64 -+include $(TOP)/configs/debian-dri-default -+ -+CONFIG_NAME = debian-dri-amd64 -+ -+# vim: ft=make -+ -Index: mesa/configs/debian-dri-any -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ mesa/configs/debian-dri-any 2008-06-17 19:27:49.000000000 +0200 -@@ -0,0 +1,9 @@ -+# Configuration for building the DRI drivers on the build architecture. -+ -+include $(TOP)/configs/linux-dri -+include $(TOP)/configs/debian-dri-default -+ -+CONFIG_NAME = debian-dri-any -+ -+# vim: ft=make -+ -Index: mesa/configs/debian-dri-default -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ mesa/configs/debian-dri-default 2008-06-17 19:27:49.000000000 +0200 -@@ -0,0 +1,36 @@ -+# Configuration defaults for building the DRI drivers and DRI/GLX-enabled -+# libGL. -+ -+include $(TOP)/configs/debian-default -+ -+CONFIG_NAME = debian-dri-default -+ -+SRC_DIRS = glx/x11 mesa progs -+DRIVER_DIRS = dri -+PROGRAM_DIRS = xdemos -+PROGS = glxdemo \ -+ glxgears \ -+ glxheads \ -+ glxinfo -+ -+LIB_DIR = lib/glx -+ -+DRI_DRIVER_INSTALL_DIR = $(INSTALL_DIR)/lib/dri -+DRI_DRIVER_SEARCH_DIR = /usr/lib/dri -+ -+DRI_DIRS = mach64 mga r128 r200 r300 radeon s3v savage tdfx trident -+ -+ARCH_X86 = i386 amd64 -+ -+ifneq ($(findstring $(DEB_BUILD_ARCH), $(ARCH_X86)),) -+ DRI_DIRS += i810 i915 i915tex i965 sis unichrome -+endif -+ -+ifeq ($(DEB_BUILD_ARCH), sparc) -+ DRI_DIRS += ffb -+endif -+ -+APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -+ -+# vim: ft=make -+ -Index: mesa/configs/debian-dri-i386 -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ mesa/configs/debian-dri-i386 2008-06-17 19:27:49.000000000 +0200 -@@ -0,0 +1,9 @@ -+# Configuration for building the DRI drivers on i386. -+ -+include $(TOP)/configs/linux-dri-x86 -+include $(TOP)/configs/debian-dri-default -+ -+CONFIG_NAME = debian-dri-i386 -+ -+# vim: ft=make -+ -Index: mesa/configs/debian-dri-i386-i686 -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ mesa/configs/debian-dri-i386-i686 2008-06-17 19:27:49.000000000 +0200 -@@ -0,0 +1,14 @@ -+# Configuration for building the DRI drivers on i386. -+ -+include $(TOP)/configs/linux-dri-x86 -+include $(TOP)/configs/debian-dri-optimized-default -+ -+CONFIG_NAME = debian-dri-i386-i686 -+ -+ARCH_FLAGS = -march=i686 -+LIB_DIR = lib/glx/i686/cmov -+ -+DRI_DRIVER_INSTALL_DIR = $(INSTALL_DIR)/lib/dri/i686/cmov -+ -+# vim: ft=make -+ -Index: mesa/configs/debian-dri-optimized-default -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ mesa/configs/debian-dri-optimized-default 2008-06-17 19:27:49.000000000 +0200 -@@ -0,0 +1,13 @@ -+# Configuration defaults for CPU-optimized builds of the DRI drivers and -+# DRI/GLX-enabled libGL. -+ -+include $(TOP)/configs/debian-dri-default -+ -+CONFIG_NAME = debian-dri-optimized-default -+ -+# override so that the utility programs are not rebuilt with CPU-specific -+# optimizations -+SRC_DIRS = glx/x11 mesa -+ -+# vim: ft=make -+ -Index: mesa/configs/debian-indirect-default -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ mesa/configs/debian-indirect-default 2008-06-17 19:27:49.000000000 +0200 -@@ -0,0 +1,7 @@ -+# Configuration defaults for building GLX-enabled libGL. -+ -+include $(TOP)/configs/debian-dri-default -+ -+CONFIG_NAME = debian-indirect-default -+ -+DRI_DIRS = -Index: mesa/configs/debian-indirect-hurd-i386 -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ mesa/configs/debian-indirect-hurd-i386 2008-06-17 19:27:49.000000000 +0200 -@@ -0,0 +1,9 @@ -+# Configuration for building the DRI drivers on the build architecture. -+ -+include $(TOP)/configs/linux-indirect -+include $(TOP)/configs/debian-indirect-default -+ -+CONFIG_NAME = debian-indirect-hurd-i386 -+ -+# vim: ft=make -+ -Index: mesa/configs/debian-osmesa -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ mesa/configs/debian-osmesa 2008-06-17 19:27:49.000000000 +0200 -@@ -0,0 +1,9 @@ -+# Configuration for building only OSMesa on Debian. -+ -+include $(TOP)/configs/linux-osmesa -+include $(TOP)/configs/debian-osmesa-default -+ -+CONFIG_NAME = debian-osmesa -+ -+# vim: ft=make -+ -Index: mesa/configs/debian-osmesa-default -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ mesa/configs/debian-osmesa-default 2008-06-17 19:27:49.000000000 +0200 -@@ -0,0 +1,10 @@ -+# Configuration defaults for building OSMesa. -+ -+include $(TOP)/configs/debian-default -+ -+CONFIG_NAME = debian-osmesa-default -+ -+DRIVER_DIRS = osmesa -+ -+# vim: ft=make -+ -Index: mesa/configs/debian-osmesa-static -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ mesa/configs/debian-osmesa-static 2008-06-17 19:27:49.000000000 +0200 -@@ -0,0 +1,9 @@ -+# Configuration for building only OSMesa (static version) on Debian. -+ -+include $(TOP)/configs/linux-osmesa-static -+include $(TOP)/configs/debian-osmesa-default -+ -+CONFIG_NAME = debian-osmesa-static -+ -+# vim: ft=make -+ -Index: mesa/configs/debian-osmesa16 -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ mesa/configs/debian-osmesa16 2008-06-17 19:27:49.000000000 +0200 -@@ -0,0 +1,10 @@ -+# Configuration for building OSMesa with support for 16 bits per color -+# channel. -+ -+include $(TOP)/configs/linux-osmesa16 -+include $(TOP)/configs/debian-osmesa-default -+ -+CONFIG_NAME = debian-osmesa16 -+ -+# vim: ft=make -+ -Index: mesa/configs/debian-osmesa16-static -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ mesa/configs/debian-osmesa16-static 2008-06-17 19:27:49.000000000 +0200 -@@ -0,0 +1,10 @@ -+# Configuration for building a static version of OSMesa with support for 16 -+# bits per color channel. -+ -+include $(TOP)/configs/linux-osmesa16-static -+include $(TOP)/configs/debian-osmesa-default -+ -+CONFIG_NAME = debian-osmesa16-static -+ -+# vim: ft=make -+ -Index: mesa/configs/debian-osmesa32 -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ mesa/configs/debian-osmesa32 2008-06-17 19:27:49.000000000 +0200 -@@ -0,0 +1,10 @@ -+# Configuration for building OSMesa with support for 32 bits per color -+# channel. -+ -+include $(TOP)/configs/linux-osmesa32 -+include $(TOP)/configs/debian-osmesa-default -+ -+CONFIG_NAME = debian-osmesa32 -+ -+# vim: ft=make -+ -Index: mesa/configs/debian-osmesa32-static -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ mesa/configs/debian-osmesa32-static 2008-06-17 19:27:49.000000000 +0200 -@@ -0,0 +1,10 @@ -+# Configuration for building a static version of OSMesa with support for 32 -+# bits per color channel. -+ -+include $(TOP)/configs/linux-osmesa32-static -+include $(TOP)/configs/debian-osmesa-default -+ -+CONFIG_NAME = debian-osmesa32-static -+ -+# vim: ft=make -+ -Index: mesa/configs/debian-swx11+glu-alpha-ev5 -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ mesa/configs/debian-swx11+glu-alpha-ev5 2008-06-17 19:27:49.000000000 +0200 -@@ -0,0 +1,12 @@ -+# Configuration for building Mesa (swx11 and GLU) on alpha (ev5 optimized). -+ -+include $(TOP)/configs/linux-alpha -+include $(TOP)/configs/debian-swx11+glu-default -+ -+CONFIG_NAME = debian-swx11+glu-alpha-ev5 -+ -+SRC_DIRS = mesa -+LIB_DIR = lib/ev5/cmov -+ -+# vim: ft=make -+ -Index: mesa/configs/debian-swx11+glu-amd64 -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ mesa/configs/debian-swx11+glu-amd64 2008-06-17 19:27:49.000000000 +0200 -@@ -0,0 +1,10 @@ -+# Configuration for building Mesa (swx11 and GLU) with runtime-detected -+# assembler optimizations on amd64. -+ -+include $(TOP)/configs/linux-x86-64 -+include $(TOP)/configs/debian-swx11+glu-default -+ -+CONFIG_NAME = debian-swx11+glu-amd64 -+ -+# vim: ft=make -+ -Index: mesa/configs/debian-swx11+glu-any -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ mesa/configs/debian-swx11+glu-any 2008-06-17 19:27:49.000000000 +0200 -@@ -0,0 +1,9 @@ -+# Configuration for building Mesa (swx11 and GLU) on the build architecture. -+ -+include $(TOP)/configs/linux -+include $(TOP)/configs/debian-swx11+glu-default -+ -+CONFIG_NAME = debian-swx11+glu-any -+ -+# vim: ft=make -+ -Index: mesa/configs/debian-swx11+glu-default -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ mesa/configs/debian-swx11+glu-default 2008-06-17 19:27:49.000000000 +0200 -@@ -0,0 +1,14 @@ -+# Configuration defaults for building Mesa (swx11 and GLU). -+ -+include $(TOP)/configs/debian-default -+ -+CONFIG_NAME = debian-swx11+glu-default -+ -+SRC_DIRS = mesa glu glw -+DRIVER_DIRS = x11 -+ -+GLW_SOURCES += GLwMDrawA.c -+GLW_LIB_DEPS += -lXm -+ -+# vim: ft=make -+ -Index: mesa/configs/debian-swx11+glu-i386 -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ mesa/configs/debian-swx11+glu-i386 2008-06-17 19:27:49.000000000 +0200 -@@ -0,0 +1,10 @@ -+# Configuration for building Mesa (swx11 and GLU) with runtime-detected -+# assembler optimizations on i386. -+ -+include $(TOP)/configs/linux-x86 -+include $(TOP)/configs/debian-swx11+glu-default -+ -+CONFIG_NAME = debian-swx11+glu-i386 -+ -+# vim: ft=make -+ -Index: mesa/configs/debian-swx11+glu-i386-i686 -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ mesa/configs/debian-swx11+glu-i386-i686 2008-06-17 19:27:49.000000000 +0200 -@@ -0,0 +1,14 @@ -+# Configuration for building Mesa (swx11 and GLU) with runtime-detected -+# assembler optimizations on i386 (i686 optimized). -+ -+include $(TOP)/configs/linux-x86 -+include $(TOP)/configs/debian-swx11+glu-default -+ -+CONFIG_NAME = debian-swx11+glu-i386-i686 -+ -+ARCH_FLAGS += -march=i686 -+SRC_DIRS = mesa -+LIB_DIR = lib/i686/cmov -+ -+# vim: ft=make -+ -Index: mesa/configs/debian-swx11+glu-powerpc-603 -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ mesa/configs/debian-swx11+glu-powerpc-603 2008-06-17 19:27:49.000000000 +0200 -@@ -0,0 +1,13 @@ -+# Configuration for building Mesa (swx11 and GLU) with runtime-detected -+# assembler optimizations on powerpc (603 optimized). -+ -+include $(TOP)/configs/linux-ppc -+include $(TOP)/configs/debian-swx11+glu-default -+ -+CONFIG_NAME = debian-swx11+glu-powerpc-603 -+ -+SRC_DIRS = mesa -+LIB_DIR = lib/603/cmov -+ -+# vim: ft=make -+ -Index: mesa/configs/debian-swx11+glu-ppc64 -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ mesa/configs/debian-swx11+glu-ppc64 2008-06-17 19:27:49.000000000 +0200 -@@ -0,0 +1,11 @@ -+# Configuration for building Mesa (swx11 and GLU) with runtime-detected -+# assembler optimizations on ppc64. -+ -+include $(TOP)/configs/debian-swx11+glu-any -+ -+CONFIG_NAME = debian-swx11+glu-ppc64 -+ -+LIB_DIR = lib64 -+ -+# vim: ft=make -+ -Index: mesa/configs/debian-swx11+glu-sparc -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ mesa/configs/debian-swx11+glu-sparc 2008-06-17 19:27:49.000000000 +0200 -@@ -0,0 +1,10 @@ -+# Configuration for building Mesa (swx11 and GLU) with runtime-detected -+# assembler optimizations on sparc. -+ -+include $(TOP)/configs/linux-sparc -+include $(TOP)/configs/debian-swx11+glu-default -+ -+CONFIG_NAME = debian-swx11+glu-sparc -+ -+# vim: ft=make -+ -Index: mesa/configs/debian-swx11+glu-sparc-ultrasparc -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ mesa/configs/debian-swx11+glu-sparc-ultrasparc 2008-06-17 19:27:49.000000000 +0200 -@@ -0,0 +1,13 @@ -+# Configuration for building Mesa (swx11 and GLU) with runtime-detected -+# assembler optimizations on sparc (ultrasparc-optimized). -+ -+include $(TOP)/configs/linux-ultrasparc -+include $(TOP)/configs/debian-swx11+glu-default -+ -+CONFIG_NAME = debian-swx11+glu-sparc-ultrasparc -+ -+SRC_DIRS = mesa -+LIB_DIR = lib/ultrasparc/cmov -+ -+# vim: ft=make -+ -Index: mesa/configs/debian-swx11+glu-static-amd64 -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ mesa/configs/debian-swx11+glu-static-amd64 2008-06-17 19:27:49.000000000 +0200 -@@ -0,0 +1,10 @@ -+# Configuration for building static versions of the libraries (swx11 and GLU) -+# on amd64. -+ -+include $(TOP)/configs/linux-x86-64-static -+include $(TOP)/configs/debian-swx11+glu-default -+ -+CONFIG_NAME = debian-swx11+glu-static-amd64 -+ -+# vim: ft=make -+ -Index: mesa/configs/debian-swx11+glu-static-any -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ mesa/configs/debian-swx11+glu-static-any 2008-06-17 19:27:49.000000000 +0200 -@@ -0,0 +1,10 @@ -+# Configuration for building static versions of the libraries (swx11 and GLU) -+# on the build architecture. -+ -+include $(TOP)/configs/linux-static -+include $(TOP)/configs/debian-swx11+glu-default -+ -+CONFIG_NAME = debian-swx11+glu-static-any -+ -+# vim: ft=make -+ -Index: mesa/configs/debian-swx11+glu-static-i386 -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ mesa/configs/debian-swx11+glu-static-i386 2008-06-17 19:27:49.000000000 +0200 -@@ -0,0 +1,10 @@ -+# Configuration for building static versions of the libraries (swx11 and GLU) -+# on i386. -+ -+include $(TOP)/configs/linux-x86-static -+include $(TOP)/configs/debian-swx11+glu-default -+ -+CONFIG_NAME = debian-swx11+glu-static-i386 -+ -+# vim: ft=make -+ -Index: mesa/configs/debian-swx11+glu-static-ppc64 -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ mesa/configs/debian-swx11+glu-static-ppc64 2008-06-17 19:27:49.000000000 +0200 -@@ -0,0 +1,11 @@ -+# Configuration for building static versions of the libraries (swx11 and GLU) -+# on ppc64. -+ -+include $(TOP)/configs/debian-swx11+glu-static-any -+ -+CONFIG_NAME = debian-swx11+glu-static-ppc64 -+ -+LIB_DIR = lib64 -+ -+# vim: ft=make -+ -Index: mesa/configs/default-bp -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ mesa/configs/default-bp 2008-06-17 19:27:49.000000000 +0200 -@@ -0,0 +1,75 @@ -+# Default/template configuration -+ -+# This is included by other config files which may override some -+# of these variables. -+ -+CONFIG_NAME = default -+ -+# Version info -+MESA_MAJOR=6 -+MESA_MINOR=3 -+MESA_TINY=0 -+ -+# external projects -+#DRM_SOURCE_PATH=$(TOP)/../drm -+DRM_SOURCE_PATH=/home/projects/DRI-freedesktop/drm -+ -+# Compiler and flags -+CC = cc -+CXX = CC -+CFLAGS = -O -+CXXFLAGS = -O -+GLU_CFLAGS = -+ -+# Misc tools and flags -+MKLIB_OPTIONS = -+MKDEP = makedepend -+MKDEP_OPTIONS = -fdepend -+MAKE = make -+ -+# Library names (base name) -+GL_LIB = GL -+GLU_LIB = GLU -+GLUT_LIB = glut -+GLW_LIB = GLw -+OSMESA_LIB = OSMesa -+ -+ -+# Library names (actual file names) -+GL_LIB_NAME = lib$(GL_LIB).so -+GLU_LIB_NAME = lib$(GLU_LIB).so -+GLUT_LIB_NAME = lib$(GLUT_LIB).so -+GLW_LIB_NAME = lib$(GLW_LIB).so -+OSMESA_LIB_NAME = lib$(OSMesa).so -+ -+ -+# Optional assembly language optimization files for libGL -+ASM_SOURCES = -+ -+# GLw widget sources (Append "GLwMDrawA.c" here and add -lXm to GLW_LIB_DEPS in -+# order to build the Motif widget too) -+GLW_SOURCES = GLwDrawA.c -+ -+ -+# Directories -+LIB_DIR = $(TOP)/lib -+INSTALL_PREFIX = /usr/local -+SRC_DIRS = mesa glu glut/glx glw -+GLU_DIRS = sgi -+DRIVER_DIRS = x11 osmesa -+# Which subdirs under $(TOP)/progs/ to enter: -+PROGRAM_DIRS = demos redbook samples xdemos -+ -+ -+# Library/program dependencies -+GL_LIB_DEPS = -lX11 -lXext -lm -lpthread -+OSMESA_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -+GLU_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -lm -+GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lXmu -lXt -lXi -lm -+GLW_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -lXt -lX11 -+APP_LIB_DEPS = -L$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm -+ -+ -+# Shading language support (set to 0 or 1) -+SHADING_LANGUAGE = 0 -+ -Index: mesa/configs/linux-dri-bp -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ mesa/configs/linux-dri-bp 2008-06-17 19:27:49.000000000 +0200 -@@ -0,0 +1,55 @@ -+# -*-makefile-*- -+# Configuration for linux-dri: Linux DRI hardware drivers for XFree86 & others -+ -+include $(TOP)/configs/default -+ -+CONFIG_NAME = linux-dri -+ -+# Compiler and flags -+CC = gcc -+CXX = g++ -+ -+MKDEP = /usr/X11R6/bin/makedepend -+#MKDEP = gcc -M -+#MKDEP_OPTIONS = -MF depend -+ -+WARN_FLAGS = -Wall -+OPT_FLAGS = -g -+PIC_FLAGS = -fPIC -+ -+# Add '-DGLX_USE_TLS' to ARCH_FLAGS to enable TLS support. -+ARCH_FLAGS ?= -+ -+DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \ -+ -D_BSD_SOURCE -D_GNU_SOURCE \ -+ -DDRI_NEW_INTERFACE_ONLY -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -+ -+X11_INCLUDES = -I/usr/X11R6/include -I/usr/X11R6/include/X11/extensions -+ -+CFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) \ -+ $(ASM_FLAGS) -std=c99 -ffast-math -+ -+CXXFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) -+ -+ -+ASM_SOURCES = -+ -+# Library/program dependencies -+EXTRA_LIB_PATH=-L/usr/X11R6/lib -+ -+DRI_LIB_DEPS = $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl -+GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lm -lpthread -ldl -+GLUT_LIB_DEPS = $(EXTRA_LIB_PATH) -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lXmu -lXt -lXi -lm -+GLW_LIB_DEPS = $(EXTRA_LIB_PATH) -L$(LIB_DIR) -l$(GL_LIB) -lXt -lX11 -+ -+ -+# Directories -+SRC_DIRS = glx/x11 mesa glu glut/glx glw -+DRIVER_DIRS = dri -+PROGRAM_DIRS = -+WINDOW_SYSTEM=dri -+ -+# ffb and gamma are missing because they have not been converted to use the new -+# interface. -+DRI_DIRS = dri_client i810 i830 i915 mach64 mga r128 r200 radeon s3v \ -+ savage sis tdfx trident unichrome fb -Index: mesa/configs/linux-osmesa-static -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ mesa/configs/linux-osmesa-static 2008-06-17 19:27:49.000000000 +0200 -@@ -0,0 +1,15 @@ -+# Configuration for building only libOSMesa on Linux, no Xlib driver -+# This doesn't really have any Linux dependencies, so it should be usable -+# on other (gcc-based) systems. -+ -+include $(TOP)/configs/linux-osmesa -+ -+CONFIG_NAME = linux-osmesa-static -+ -+# Compiler and flags -+MKLIB_OPTIONS = -static -+PIC_FLAGS = -+ -+# Library names -+OSMESA_LIB_NAME = lib$(OSMESA_LIB).a -+ -Index: mesa/configs/linux-osmesa32-static -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ mesa/configs/linux-osmesa32-static 2008-06-17 19:27:49.000000000 +0200 -@@ -0,0 +1,13 @@ -+# Configuration for 32 bits/channel OSMesa library on Linux -+ -+include $(TOP)/configs/linux-osmesa32 -+ -+CONFIG_NAME = linux-osmesa32-static -+ -+# Compiler and flags -+MKLIB_OPTIONS = -static -+PIC_FLAGS = -+ -+# Library names -+OSMESA_LIB_NAME = lib$(OSMESA_LIB).a -+ -Index: mesa/configs/linux-tcc -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ mesa/configs/linux-tcc 2008-06-17 19:27:49.000000000 +0200 -@@ -0,0 +1,22 @@ -+# Configuration for debugging on Linux -+ -+include $(TOP)/configs/default -+ -+CONFIG_NAME = linux-tcc -+ -+# Compiler and flags -+CC = gcc -+CXX = g++ -+ -+TCC_DIR=/home/progs/tcc-0.9.20 -+ -+CFLAGS = -g -ansi -pedantic -Wall -Wmissing-prototypes -Wundef -fPIC -ffast-math -D_POSIX_SOURCE -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R6/include -DUSE_XSHM -DPTHREADS -DDEBUG -DMESA_DEBUG -DUSE_TCC -I$(TCC_DIR) -+ -+CXXFLAGS = -g -ansi -pedantic -Wall -Wundef -fPIC -ffast-math -D_POSIX_SOURCE -D_SVID_SOURCE -D_BSD_SOURCE -DDEBUG -DMESA_DEBUG -+ -+GLUT_CFLAGS = -fexceptions -+ -+GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread -L$(TCC_DIR) -ltcc -ldl -+GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm -+GLW_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -lXt -L/usr/X11R6/lib -lX11 -+APP_LIB_DEPS = -L$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm -Index: mesa/configs/linux-osmesa -=================================================================== ---- mesa.orig/configs/linux-osmesa 2008-06-16 00:50:38.000000000 +0200 -+++ mesa/configs/linux-osmesa 2008-06-17 19:27:49.000000000 +0200 -@@ -9,8 +9,17 @@ - # Compiler and flags - CC = gcc - CXX = g++ --CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DPTHREADS --CXXFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -+ -+PIC_FLAGS = -fPIC -+ -+DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \ -+ -D_BSD_SOURCE -D_GNU_SOURCE \ -+ -DPTHREADS -DUSE_XSHM -DHAVE_POSIX_MEMALIGN -+ -+CFLAGS = -ansi -pedantic $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) \ -+ $(ASM_FLAGS) -ffast-math -+ -+CXXFLAGS = -ansi -pedantic $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) - - # Work around aliasing bugs - developers should comment this out - CFLAGS += -fno-strict-aliasing -@@ -26,3 +35,4 @@ - OSMESA_LIB_DEPS = -lm -lpthread - GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(OSMESA_LIB) - APP_LIB_DEPS = -lOSMesa -lGLU -+ -Index: mesa/configs/linux-osmesa16 -=================================================================== ---- mesa.orig/configs/linux-osmesa16 2008-06-16 00:50:38.000000000 +0200 -+++ mesa/configs/linux-osmesa16 2008-06-17 19:27:49.000000000 +0200 -@@ -1,31 +1,19 @@ - # Configuration for 16 bits/channel OSMesa library on Linux - --include $(TOP)/configs/default -+include $(TOP)/configs/linux-osmesa - - CONFIG_NAME = linux-osmesa16 - --# Compiler and flags --CC = gcc --CXX = g++ --CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include -DCHAN_BITS=16 -DDEFAULT_SOFTWARE_DEPTH_BITS=31 --CXXFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -- - # Work around aliasing bugs - developers should comment this out - CFLAGS += -fno-strict-aliasing - CXXFLAGS += -fno-strict-aliasing -- -+DEFINES += -DCHAN_BITS=16 -DDEFAULT_SOFTWARE_DEPTH_BITS=32 - # Library names - OSMESA_LIB = OSMesa16 --OSMESA_LIB_NAME = libOSMesa16.so -- - - # Directories --SRC_DIRS = mesa glu --DRIVER_DIRS = osmesa - PROGRAM_DIRS = - -- - # Dependencies --OSMESA_LIB_DEPS = -lm -lpthread --GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(OSMESA_LIB) --APP_LIB_DEPS = -lOSMesa16 -+APP_LIB_DEPS = -l$(OSMESA_LIB) -+ -Index: mesa/configs/linux-osmesa16-static -=================================================================== ---- mesa.orig/configs/linux-osmesa16-static 2008-06-16 00:50:38.000000000 +0200 -+++ mesa/configs/linux-osmesa16-static 2008-06-17 19:27:49.000000000 +0200 -@@ -1,14 +1,10 @@ - # Configuration for 16 bits/channel OSMesa library on Linux - --include $(TOP)/configs/default -+include $(TOP)/configs/linux-osmesa16 - - CONFIG_NAME = linux-osmesa16-static - - # Compiler and flags --CC = gcc --CXX = g++ --CFLAGS = -O3 -ansi -pedantic -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include -DCHAN_BITS=16 -DDEFAULT_SOFTWARE_DEPTH_BITS=31 --CXXFLAGS = -O3 -ansi -pedantic -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE - MKLIB_OPTIONS = -static - PIC_FLAGS = - -@@ -17,16 +13,5 @@ - CXXFLAGS += -fno-strict-aliasing - - # Library names --OSMESA_LIB = OSMesa16 --OSMESA_LIB_NAME = libOSMesa16.a -+OSMESA_LIB_NAME = lib$(OSMESA_LIB).a - -- --# Directories --SRC_DIRS = mesa glu --DRIVER_DIRS = osmesa --PROGRAM_DIRS = -- -- --# Dependencies --OSMESA_LIB_DEPS = -lm -lpthread --APP_LIB_DEPS = -lOSMesa16 -Index: mesa/configs/linux-osmesa32 -=================================================================== ---- mesa.orig/configs/linux-osmesa32 2008-06-16 00:50:38.000000000 +0200 -+++ mesa/configs/linux-osmesa32 2008-06-17 19:27:49.000000000 +0200 -@@ -1,31 +1,22 @@ - # Configuration for 32 bits/channel OSMesa library on Linux - --include $(TOP)/configs/default -+include $(TOP)/configs/linux-osmesa - - CONFIG_NAME = linux-osmesa32 - - # Compiler and flags --CC = gcc --CXX = g++ --CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include -DCHAN_BITS=32 -DDEFAULT_SOFTWARE_DEPTH_BITS=31 --CXXFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE - - # Work around aliasing bugs - developers should comment this out - CFLAGS += -fno-strict-aliasing - CXXFLAGS += -fno-strict-aliasing -+DEFINES += -DCHAN_BITS=32 -DDEFAULT_SOFTWARE_DEPTH_BITS=31 - - # Library names - OSMESA_LIB = OSMesa32 --OSMESA_LIB_NAME = libOSMesa32.so -- - - # Directories --SRC_DIRS = mesa glu --DRIVER_DIRS = osmesa - PROGRAM_DIRS = - -- - # Dependencies --OSMESA_LIB_DEPS = -lm -lpthread --GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(OSMESA_LIB) --APP_LIB_DEPS = -lOSMesa32 -+APP_LIB_DEPS = -l$(OSMESA_LIB) -+ diff --git a/debian/patches/series b/debian/patches/series index a3a8c0592a4..61b5df2292c 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -2,4 +2,4 @@ 01_fix-makefile.patch 02_use-ieee-fp-on-s390-and-m68k.patch 03_optional-progs-and-install.patch -04_debian-configs.patch +04_cleanup-osmesa-configs.patch -- cgit v1.2.3 From 6ec170290cf20fee464ccd7ccd3087c30069f08f Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Wed, 18 Jun 2008 20:58:35 +0200 Subject: Put all configs/ changes into the .diff.gz 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. --- configs/linux-osmesa | 14 +- configs/linux-osmesa-static | 3 +- configs/linux-osmesa16 | 20 +-- configs/linux-osmesa16-static | 19 +-- configs/linux-osmesa32 | 17 +-- configs/linux-osmesa32-static | 21 +-- debian/changelog | 3 + debian/patches/04_cleanup-osmesa-configs.patch | 197 ------------------------- debian/patches/series | 1 - 9 files changed, 30 insertions(+), 265 deletions(-) delete mode 100644 debian/patches/04_cleanup-osmesa-configs.patch (limited to 'debian') diff --git a/configs/linux-osmesa b/configs/linux-osmesa index 163b1452910..0a9cd316abf 100644 --- a/configs/linux-osmesa +++ b/configs/linux-osmesa @@ -9,8 +9,17 @@ CONFIG_NAME = linux-osmesa # Compiler and flags CC = gcc CXX = g++ -CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DPTHREADS -CXXFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE + +PIC_FLAGS = -fPIC + +DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \ + -D_BSD_SOURCE -D_GNU_SOURCE \ + -DPTHREADS -DUSE_XSHM -DHAVE_POSIX_MEMALIGN + +CFLAGS = -ansi -pedantic $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) \ + $(ASM_FLAGS) -ffast-math + +CXXFLAGS = -ansi -pedantic $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) # Work around aliasing bugs - developers should comment this out CFLAGS += -fno-strict-aliasing @@ -26,3 +35,4 @@ PROGRAM_DIRS = osdemos OSMESA_LIB_DEPS = -lm -lpthread GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(OSMESA_LIB) APP_LIB_DEPS = -lOSMesa -lGLU + diff --git a/configs/linux-osmesa-static b/configs/linux-osmesa-static index 465f83ca058..eb3575f424b 100644 --- a/configs/linux-osmesa-static +++ b/configs/linux-osmesa-static @@ -8,7 +8,8 @@ CONFIG_NAME = linux-osmesa-static # Compiler and flags MKLIB_OPTIONS = -static +PIC_FLAGS = # Library names -OSMESA_LIB_NAME = libOSMesa.a +OSMESA_LIB_NAME = lib$(OSMESA_LIB).a diff --git a/configs/linux-osmesa16 b/configs/linux-osmesa16 index 796fba17806..d06bc461faf 100644 --- a/configs/linux-osmesa16 +++ b/configs/linux-osmesa16 @@ -1,31 +1,19 @@ # Configuration for 16 bits/channel OSMesa library on Linux -include $(TOP)/configs/default +include $(TOP)/configs/linux-osmesa CONFIG_NAME = linux-osmesa16 -# Compiler and flags -CC = gcc -CXX = g++ -CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include -DCHAN_BITS=16 -DDEFAULT_SOFTWARE_DEPTH_BITS=31 -CXXFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE - # Work around aliasing bugs - developers should comment this out CFLAGS += -fno-strict-aliasing CXXFLAGS += -fno-strict-aliasing - +DEFINES += -DCHAN_BITS=16 -DDEFAULT_SOFTWARE_DEPTH_BITS=32 # Library names OSMESA_LIB = OSMesa16 -OSMESA_LIB_NAME = libOSMesa16.so - # Directories -SRC_DIRS = mesa glu -DRIVER_DIRS = osmesa PROGRAM_DIRS = - # Dependencies -OSMESA_LIB_DEPS = -lm -lpthread -GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(OSMESA_LIB) -APP_LIB_DEPS = -lOSMesa16 +APP_LIB_DEPS = -l$(OSMESA_LIB) + diff --git a/configs/linux-osmesa16-static b/configs/linux-osmesa16-static index 0e0d1519f39..515f6cca638 100644 --- a/configs/linux-osmesa16-static +++ b/configs/linux-osmesa16-static @@ -1,14 +1,10 @@ # Configuration for 16 bits/channel OSMesa library on Linux -include $(TOP)/configs/default +include $(TOP)/configs/linux-osmesa16 CONFIG_NAME = linux-osmesa16-static # Compiler and flags -CC = gcc -CXX = g++ -CFLAGS = -O3 -ansi -pedantic -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include -DCHAN_BITS=16 -DDEFAULT_SOFTWARE_DEPTH_BITS=31 -CXXFLAGS = -O3 -ansi -pedantic -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE MKLIB_OPTIONS = -static PIC_FLAGS = @@ -17,16 +13,5 @@ CFLAGS += -fno-strict-aliasing CXXFLAGS += -fno-strict-aliasing # Library names -OSMESA_LIB = OSMesa16 -OSMESA_LIB_NAME = libOSMesa16.a +OSMESA_LIB_NAME = lib$(OSMESA_LIB).a - -# Directories -SRC_DIRS = mesa glu -DRIVER_DIRS = osmesa -PROGRAM_DIRS = - - -# Dependencies -OSMESA_LIB_DEPS = -lm -lpthread -APP_LIB_DEPS = -lOSMesa16 diff --git a/configs/linux-osmesa32 b/configs/linux-osmesa32 index 12d0cb053d0..c1a6d4b5528 100644 --- a/configs/linux-osmesa32 +++ b/configs/linux-osmesa32 @@ -1,31 +1,22 @@ # Configuration for 32 bits/channel OSMesa library on Linux -include $(TOP)/configs/default +include $(TOP)/configs/linux-osmesa CONFIG_NAME = linux-osmesa32 # Compiler and flags -CC = gcc -CXX = g++ -CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include -DCHAN_BITS=32 -DDEFAULT_SOFTWARE_DEPTH_BITS=31 -CXXFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE # Work around aliasing bugs - developers should comment this out CFLAGS += -fno-strict-aliasing CXXFLAGS += -fno-strict-aliasing +DEFINES += -DCHAN_BITS=32 -DDEFAULT_SOFTWARE_DEPTH_BITS=31 # Library names OSMESA_LIB = OSMesa32 -OSMESA_LIB_NAME = libOSMesa32.so - # Directories -SRC_DIRS = mesa glu -DRIVER_DIRS = osmesa PROGRAM_DIRS = - # Dependencies -OSMESA_LIB_DEPS = -lm -lpthread -GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(OSMESA_LIB) -APP_LIB_DEPS = -lOSMesa32 +APP_LIB_DEPS = -l$(OSMESA_LIB) + diff --git a/configs/linux-osmesa32-static b/configs/linux-osmesa32-static index 6db8bc02370..ecbb72ecfde 100644 --- a/configs/linux-osmesa32-static +++ b/configs/linux-osmesa32-static @@ -1,28 +1,13 @@ # Configuration for 32 bits/channel OSMesa library on Linux -include $(TOP)/configs/default +include $(TOP)/configs/linux-osmesa32 CONFIG_NAME = linux-osmesa32-static # Compiler and flags -CC = gcc -CXX = g++ -CFLAGS = -O3 -ansi -pedantic -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include -DCHAN_BITS=32 -DDEFAULT_SOFTWARE_DEPTH_BITS=31 -CXXFLAGS = -O3 -ansi -pedantic -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE MKLIB_OPTIONS = -static - +PIC_FLAGS = # Library names -OSMESA_LIB = OSMesa32 -OSMESA_LIB_NAME = libOSMesa32.a - - -# Directories -SRC_DIRS = mesa glu -DRIVER_DIRS = osmesa -PROGRAM_DIRS = - +OSMESA_LIB_NAME = lib$(OSMESA_LIB).a -# Dependencies -OSMESA_LIB_DEPS = -lm -lpthread -APP_LIB_DEPS = -lOSMesa32 diff --git a/debian/changelog b/debian/changelog index 4a7a5ba8e29..b6898c26050 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,9 @@ mesa (7.0.3-4) UNRELEASED; 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:52:39 +0200 diff --git a/debian/patches/04_cleanup-osmesa-configs.patch b/debian/patches/04_cleanup-osmesa-configs.patch deleted file mode 100644 index 68bd4775e13..00000000000 --- a/debian/patches/04_cleanup-osmesa-configs.patch +++ /dev/null @@ -1,197 +0,0 @@ -Index: mesa/configs/linux-osmesa -=================================================================== ---- mesa.orig/configs/linux-osmesa 2007-11-11 00:24:07.000000000 +0100 -+++ mesa/configs/linux-osmesa 2007-11-11 00:33:20.000000000 +0100 -@@ -9,8 +9,17 @@ - # Compiler and flags - CC = gcc - CXX = g++ --CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DPTHREADS --CXXFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -+ -+PIC_FLAGS = -fPIC -+ -+DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \ -+ -D_BSD_SOURCE -D_GNU_SOURCE \ -+ -DPTHREADS -DUSE_XSHM -DHAVE_POSIX_MEMALIGN -+ -+CFLAGS = -ansi -pedantic $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) \ -+ $(ASM_FLAGS) -ffast-math -+ -+CXXFLAGS = -ansi -pedantic $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) - - # Work around aliasing bugs - developers should comment this out - CFLAGS += -fno-strict-aliasing -@@ -26,3 +35,4 @@ - OSMESA_LIB_DEPS = -lm -lpthread - GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(OSMESA_LIB) - APP_LIB_DEPS = -lOSMesa -lGLU -+ -Index: mesa/configs/linux-osmesa-static -=================================================================== ---- mesa.orig/configs/linux-osmesa-static 2007-11-11 00:24:01.000000000 +0100 -+++ mesa/configs/linux-osmesa-static 2007-11-11 00:33:20.000000000 +0100 -@@ -8,7 +8,8 @@ - - # Compiler and flags - MKLIB_OPTIONS = -static -+PIC_FLAGS = - - # Library names --OSMESA_LIB_NAME = libOSMesa.a -+OSMESA_LIB_NAME = lib$(OSMESA_LIB).a - -Index: mesa/configs/linux-osmesa16 -=================================================================== ---- mesa.orig/configs/linux-osmesa16 2007-11-11 00:24:07.000000000 +0100 -+++ mesa/configs/linux-osmesa16 2007-11-11 00:33:41.000000000 +0100 -@@ -1,31 +1,19 @@ - # Configuration for 16 bits/channel OSMesa library on Linux - --include $(TOP)/configs/default -+include $(TOP)/configs/linux-osmesa - - CONFIG_NAME = linux-osmesa16 - --# Compiler and flags --CC = gcc --CXX = g++ --CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include -DCHAN_BITS=16 -DDEFAULT_SOFTWARE_DEPTH_BITS=31 --CXXFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -- - # Work around aliasing bugs - developers should comment this out - CFLAGS += -fno-strict-aliasing - CXXFLAGS += -fno-strict-aliasing -- -+DEFINES += -DCHAN_BITS=16 -DDEFAULT_SOFTWARE_DEPTH_BITS=32 - # Library names - OSMESA_LIB = OSMesa16 --OSMESA_LIB_NAME = libOSMesa16.so -- - - # Directories --SRC_DIRS = mesa glu --DRIVER_DIRS = osmesa - PROGRAM_DIRS = - -- - # Dependencies --OSMESA_LIB_DEPS = -lm -lpthread --GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(OSMESA_LIB) --APP_LIB_DEPS = -lOSMesa16 -+APP_LIB_DEPS = -l$(OSMESA_LIB) -+ -Index: mesa/configs/linux-osmesa16-static -=================================================================== ---- mesa.orig/configs/linux-osmesa16-static 2007-11-11 00:24:07.000000000 +0100 -+++ mesa/configs/linux-osmesa16-static 2007-11-11 00:33:20.000000000 +0100 -@@ -1,14 +1,10 @@ - # Configuration for 16 bits/channel OSMesa library on Linux - --include $(TOP)/configs/default -+include $(TOP)/configs/linux-osmesa16 - - CONFIG_NAME = linux-osmesa16-static - - # Compiler and flags --CC = gcc --CXX = g++ --CFLAGS = -O3 -ansi -pedantic -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include -DCHAN_BITS=16 -DDEFAULT_SOFTWARE_DEPTH_BITS=31 --CXXFLAGS = -O3 -ansi -pedantic -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE - MKLIB_OPTIONS = -static - PIC_FLAGS = - -@@ -17,16 +13,5 @@ - CXXFLAGS += -fno-strict-aliasing - - # Library names --OSMESA_LIB = OSMesa16 --OSMESA_LIB_NAME = libOSMesa16.a -+OSMESA_LIB_NAME = lib$(OSMESA_LIB).a - -- --# Directories --SRC_DIRS = mesa glu --DRIVER_DIRS = osmesa --PROGRAM_DIRS = -- -- --# Dependencies --OSMESA_LIB_DEPS = -lm -lpthread --APP_LIB_DEPS = -lOSMesa16 -Index: mesa/configs/linux-osmesa32 -=================================================================== ---- mesa.orig/configs/linux-osmesa32 2007-11-11 00:24:07.000000000 +0100 -+++ mesa/configs/linux-osmesa32 2007-11-11 00:33:51.000000000 +0100 -@@ -1,31 +1,22 @@ - # Configuration for 32 bits/channel OSMesa library on Linux - --include $(TOP)/configs/default -+include $(TOP)/configs/linux-osmesa - - CONFIG_NAME = linux-osmesa32 - - # Compiler and flags --CC = gcc --CXX = g++ --CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include -DCHAN_BITS=32 -DDEFAULT_SOFTWARE_DEPTH_BITS=31 --CXXFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE - - # Work around aliasing bugs - developers should comment this out - CFLAGS += -fno-strict-aliasing - CXXFLAGS += -fno-strict-aliasing -+DEFINES += -DCHAN_BITS=32 -DDEFAULT_SOFTWARE_DEPTH_BITS=31 - - # Library names - OSMESA_LIB = OSMesa32 --OSMESA_LIB_NAME = libOSMesa32.so -- - - # Directories --SRC_DIRS = mesa glu --DRIVER_DIRS = osmesa - PROGRAM_DIRS = - -- - # Dependencies --OSMESA_LIB_DEPS = -lm -lpthread --GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(OSMESA_LIB) --APP_LIB_DEPS = -lOSMesa32 -+APP_LIB_DEPS = -l$(OSMESA_LIB) -+ -Index: mesa/configs/linux-osmesa32-static -=================================================================== ---- mesa.orig/configs/linux-osmesa32-static 2007-11-11 00:24:01.000000000 +0100 -+++ mesa/configs/linux-osmesa32-static 2007-11-11 00:33:20.000000000 +0100 -@@ -1,28 +1,13 @@ - # Configuration for 32 bits/channel OSMesa library on Linux - --include $(TOP)/configs/default -+include $(TOP)/configs/linux-osmesa32 - - CONFIG_NAME = linux-osmesa32-static - - # Compiler and flags --CC = gcc --CXX = g++ --CFLAGS = -O3 -ansi -pedantic -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include -DCHAN_BITS=32 -DDEFAULT_SOFTWARE_DEPTH_BITS=31 --CXXFLAGS = -O3 -ansi -pedantic -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE - MKLIB_OPTIONS = -static -- -+PIC_FLAGS = - - # Library names --OSMESA_LIB = OSMesa32 --OSMESA_LIB_NAME = libOSMesa32.a -- -- --# Directories --SRC_DIRS = mesa glu --DRIVER_DIRS = osmesa --PROGRAM_DIRS = -- -+OSMESA_LIB_NAME = lib$(OSMESA_LIB).a - --# Dependencies --OSMESA_LIB_DEPS = -lm -lpthread --APP_LIB_DEPS = -lOSMesa32 diff --git a/debian/patches/series b/debian/patches/series index 61b5df2292c..b370d514349 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -2,4 +2,3 @@ 01_fix-makefile.patch 02_use-ieee-fp-on-s390-and-m68k.patch 03_optional-progs-and-install.patch -04_cleanup-osmesa-configs.patch -- cgit v1.2.3 From 2b831e73f5027850837e613636915c7dd6c7078a Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Wed, 18 Jun 2008 20:59:24 +0200 Subject: Prepare changelog for upload --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index b6898c26050..33f644a8d2e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,11 +1,11 @@ -mesa (7.0.3-4) UNRELEASED; urgency=low +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:52:39 +0200 + -- Brice Goglin Wed, 18 Jun 2008 20:59:14 +0200 mesa (7.0.3-3) unstable; urgency=low -- cgit v1.2.3 From 768d8e056356746e64668f9f7f339d3a633e5c4b Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Tue, 1 Jul 2008 13:46:54 +0200 Subject: update changelog and require libdrm 2.3.1 --- debian/changelog | 7 +++++++ debian/control | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 33f644a8d2e..7ad50e01ff4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +mesa (7.1~rc1-1) UNRELEASED; urgency=low + + * New upstream release candidate. + * Build against libdrm >= 2.3.1. + + -- Julien Cristau Tue, 01 Jul 2008 13:42:31 +0200 + mesa (7.0.3-4) unstable; urgency=low * Pull from mesa_7_0_branch (2ac4919d). diff --git a/debian/control b/debian/control index bf3ce80733e..6b9387c2db9 100644 --- a/debian/control +++ b/debian/control @@ -4,7 +4,7 @@ Priority: optional Maintainer: Debian X Strike Force Uploaders: Thierry Reding , Julien Cristau , David Nusinow , Brice Goglin Standards-Version: 3.7.3 -Build-Depends: debhelper (>= 5), quilt (>= 0.40), pkg-config, libdrm-dev (>= 2.2.0) [!hurd-i386], libx11-dev, xutils-dev, x11proto-gl-dev (>= 1.4.8), libxxf86vm-dev, libexpat1-dev, lesstif2-dev, dpkg-dev (>= 1.13.19), libxfixes-dev, libxdamage-dev, libxext-dev +Build-Depends: debhelper (>= 5), quilt (>= 0.40), pkg-config, libdrm-dev (>= 2.3.1) [!hurd-i386], libx11-dev, xutils-dev, x11proto-gl-dev (>= 1.4.8), libxxf86vm-dev, libexpat1-dev, lesstif2-dev, dpkg-dev (>= 1.13.19), libxfixes-dev, libxdamage-dev, libxext-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/ -- cgit v1.2.3 From 9795ef4348c2e65fdaabef30839730c6b89dd9e3 Mon Sep 17 00:00:00 2001 From: Timo Aaltonen Date: Tue, 1 Jul 2008 16:07:17 +0300 Subject: Refresh patches, and drop obsolete 00_create-libdir.patch and 01_fix-makefile.patch --- debian/changelog | 7 ++++++- debian/patches/00_create-libdir.patch | 17 ----------------- debian/patches/01_fix-makefile.patch | 18 ------------------ debian/patches/02_use-ieee-fp-on-s390-and-m68k.patch | 6 +++--- debian/patches/03_optional-progs-and-install.patch | 18 +++++++++++------- debian/patches/series | 2 -- 6 files changed, 20 insertions(+), 48 deletions(-) delete mode 100644 debian/patches/00_create-libdir.patch delete mode 100644 debian/patches/01_fix-makefile.patch (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 7ad50e01ff4..4292ed097bc 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,14 @@ mesa (7.1~rc1-1) UNRELEASED; urgency=low + [ Julien Cristau ] * New upstream release candidate. * Build against libdrm >= 2.3.1. - -- Julien Cristau Tue, 01 Jul 2008 13:42:31 +0200 + [ Timo Aaltonen ] + * Refresh patches, and drop obsolete 00_create-libdir.patch and + 01_fix-makefile.patch. + + -- Timo Aaltonen Tue, 01 Jul 2008 16:05:21 +0300 mesa (7.0.3-4) unstable; urgency=low diff --git a/debian/patches/00_create-libdir.patch b/debian/patches/00_create-libdir.patch deleted file mode 100644 index cc59325ac74..00000000000 --- a/debian/patches/00_create-libdir.patch +++ /dev/null @@ -1,17 +0,0 @@ -Patch that allows the Mesa makefile to create a LIB_DIR that is more than one -level below TOP. - -This patch by Thierry Reding. -Not submitted to Mesa. - ---- a/src/Makefile -+++ b/src/Makefile -@@ -29,7 +29,7 @@ - done - - $(TOP)/$(LIB_DIR): -- -mkdir $(TOP)/$(LIB_DIR) -+ mkdir -p $(TOP)/$(LIB_DIR) - - - clean: diff --git a/debian/patches/01_fix-makefile.patch b/debian/patches/01_fix-makefile.patch deleted file mode 100644 index 41c1c707df4..00000000000 --- a/debian/patches/01_fix-makefile.patch +++ /dev/null @@ -1,18 +0,0 @@ -Do not build OSMesa for a standalone configuration, since Debian only ships -OSMesa in a separate package. - -This patch by Thierry Reding. - -Index: mesa/src/mesa/Makefile -=================================================================== ---- mesa.orig/src/mesa/Makefile 2007-04-25 01:44:31.000000000 +0200 -+++ mesa/src/mesa/Makefile 2007-04-25 01:44:58.000000000 +0200 -@@ -105,7 +105,7 @@ - $(OSMESA_DRIVER_OBJECTS) - - --stand-alone: depend subdirs $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) $(TOP)/$(LIB_DIR)/$(OSMESA_LIB_NAME) -+stand-alone: depend subdirs $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) - - osmesa-only: depend subdirs $(TOP)/$(LIB_DIR)/$(OSMESA_LIB_NAME) - diff --git a/debian/patches/02_use-ieee-fp-on-s390-and-m68k.patch b/debian/patches/02_use-ieee-fp-on-s390-and-m68k.patch index 8168f29d3ef..6d12ffff625 100644 --- a/debian/patches/02_use-ieee-fp-on-s390-and-m68k.patch +++ b/debian/patches/02_use-ieee-fp-on-s390-and-m68k.patch @@ -4,15 +4,15 @@ This patch by David Nusinow. Index: mesa/src/mesa/main/imports.h =================================================================== ---- mesa.orig/src/mesa/main/imports.h 2007-04-25 01:44:31.000000000 +0200 -+++ mesa/src/mesa/main/imports.h 2007-04-25 01:45:04.000000000 +0200 +--- mesa.orig/src/mesa/main/imports.h 2008-07-01 15:26:57.000000000 +0300 ++++ mesa/src/mesa/main/imports.h 2008-07-01 15:45:49.000000000 +0300 @@ -158,8 +158,9 @@ *** 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(__amd64__) || defined(__x86_64__) || \ + defined(__x86_64__) || \ + defined(__m68k__) || \ defined(ia64) || defined(__ia64__) || \ defined(__hppa__) || defined(hpux) || \ diff --git a/debian/patches/03_optional-progs-and-install.patch b/debian/patches/03_optional-progs-and-install.patch index c00280353ec..211c7a9fb7e 100644 --- a/debian/patches/03_optional-progs-and-install.patch +++ b/debian/patches/03_optional-progs-and-install.patch @@ -10,18 +10,20 @@ Also remove references to GLU library since it is not required and we don't actually build it at this point. ---- mesa.orig/progs/xdemos/Makefile -+++ mesa/progs/xdemos/Makefile +Index: mesa/progs/xdemos/Makefile +=================================================================== +--- mesa.orig/progs/xdemos/Makefile 2008-07-01 15:26:56.000000000 +0300 ++++ mesa/progs/xdemos/Makefile 2008-07-01 15:48:47.000000000 +0300 @@ -10,7 +10,7 @@ LIBS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) $(APP_LIB_DEPS) -PROGS = \ +PROGS ?= \ + corender \ glthreads \ glxdemo \ - glxgears \ -@@ -55,6 +55,11 @@ +@@ -60,6 +60,11 @@ extra: $(EXTRA_PROGS) @@ -33,8 +35,10 @@ and we don't actually build it at this point. clean: -rm -f $(PROGS) $(EXTRA_PROGS) -rm -f *.o *~ ---- mesa.orig/progs/Makefile -+++ mesa/progs/Makefile +Index: mesa/progs/Makefile +=================================================================== +--- mesa.orig/progs/Makefile 2008-07-01 15:26:56.000000000 +0300 ++++ mesa/progs/Makefile 2008-07-01 15:48:07.000000000 +0300 @@ -21,8 +21,12 @@ fi \ done @@ -48,4 +52,4 @@ and we don't actually build it at this point. + done clean: - @for dir in $(SUBDIRS) tests ; do \ + -@for dir in $(SUBDIRS) tests ; do \ diff --git a/debian/patches/series b/debian/patches/series index b370d514349..abb18b908ed 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,4 +1,2 @@ -00_create-libdir.patch -01_fix-makefile.patch 02_use-ieee-fp-on-s390-and-m68k.patch 03_optional-progs-and-install.patch -- cgit v1.2.3 From 4c958fbfb43e046ebd30efc7eb5e380f74b3e858 Mon Sep 17 00:00:00 2001 From: Timo Aaltonen Date: Tue, 1 Jul 2008 16:24:46 +0300 Subject: Build-depend on x11proto-dri2-dev. --- debian/changelog | 3 ++- debian/control | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 4292ed097bc..494acd6d449 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,8 +7,9 @@ mesa (7.1~rc1-1) UNRELEASED; urgency=low [ Timo Aaltonen ] * Refresh patches, and drop obsolete 00_create-libdir.patch and 01_fix-makefile.patch. + * Build-depend on x11proto-dri2-dev. - -- Timo Aaltonen Tue, 01 Jul 2008 16:05:21 +0300 + -- Timo Aaltonen Tue, 01 Jul 2008 16:08:26 +0300 mesa (7.0.3-4) unstable; urgency=low diff --git a/debian/control b/debian/control index 6b9387c2db9..fc8e51223a0 100644 --- a/debian/control +++ b/debian/control @@ -4,7 +4,7 @@ Priority: optional Maintainer: Debian X Strike Force Uploaders: Thierry Reding , Julien Cristau , David Nusinow , Brice Goglin Standards-Version: 3.7.3 -Build-Depends: debhelper (>= 5), quilt (>= 0.40), pkg-config, libdrm-dev (>= 2.3.1) [!hurd-i386], libx11-dev, xutils-dev, x11proto-gl-dev (>= 1.4.8), libxxf86vm-dev, libexpat1-dev, lesstif2-dev, dpkg-dev (>= 1.13.19), libxfixes-dev, libxdamage-dev, libxext-dev +Build-Depends: debhelper (>= 5), quilt (>= 0.40), pkg-config, libdrm-dev (>= 2.3.1) [!hurd-i386], libx11-dev, xutils-dev, x11proto-gl-dev (>= 1.4.8), x11proto-dri2-dev, libxxf86vm-dev, libexpat1-dev, lesstif2-dev, dpkg-dev (>= 1.13.19), libxfixes-dev, libxdamage-dev, libxext-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/ -- cgit v1.2.3 From 24fde3cf34547f489bd03dfc447cd416591a97ba Mon Sep 17 00:00:00 2001 From: Timo Aaltonen Date: Tue, 1 Jul 2008 18:56:38 +0300 Subject: Drop mesa-swx11-source. --- debian/changelog | 3 ++- debian/control | 11 ----------- debian/mesa-swx11-source.install | 1 - debian/rules | 9 +-------- 4 files changed, 3 insertions(+), 21 deletions(-) delete mode 100644 debian/mesa-swx11-source.install (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 494acd6d449..089eaf062e0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,8 +8,9 @@ mesa (7.1~rc1-1) UNRELEASED; urgency=low * Refresh patches, and drop obsolete 00_create-libdir.patch and 01_fix-makefile.patch. * Build-depend on x11proto-dri2-dev. + * Drop mesa-swx11-source. - -- Timo Aaltonen Tue, 01 Jul 2008 16:08:26 +0300 + -- Timo Aaltonen Tue, 01 Jul 2008 18:55:51 +0300 mesa (7.0.3-4) unstable; urgency=low diff --git a/debian/control b/debian/control index fc8e51223a0..daa88abdd80 100644 --- a/debian/control +++ b/debian/control @@ -335,17 +335,6 @@ Description: A free implementation of the OpenGL API -- development files The headers and static libraries for compiling programs that use this library are included. -Package: mesa-swx11-source -Section: libdevel -Architecture: all -Description: Mesa software rasteriser source -- development files - This package contains the source to the Mesa software rasteriser, which - implements all of Mesa's GL support in software. It powers the X11 and - X server backends (assuming unaccelerated indirect). This package is - provided mainly for modular X servers which support GL, and need the - software rasteriser source to build the GLcore module for unaccelerated - indirect rendering. - Package: mesa-utils Section: x11 Priority: optional diff --git a/debian/mesa-swx11-source.install b/debian/mesa-swx11-source.install deleted file mode 100644 index e96b76cde29..00000000000 --- a/debian/mesa-swx11-source.install +++ /dev/null @@ -1 +0,0 @@ -usr/share/mesa-source/* diff --git a/debian/rules b/debian/rules index 3d00bb72401..d35364e1919 100755 --- a/debian/rules +++ b/debian/rules @@ -45,7 +45,6 @@ CONFIGS = $(SWX11_GLU_CONFIGS) \ STAMP = $(STAMP_DIR)/$(DEB_BUILD_GNU_TYPE) BUILD_STAMPS = $(addprefix $(STAMP)-build-, $(CONFIGS)) ARCH_INSTALL_STAMPS = $(addprefix $(STAMP)-install-, $(CONFIGS)) -INDEP_INSTALL_STAMPS = $(STAMP_DIR)/install-source # list the configurations that will built configs: @@ -82,12 +81,6 @@ $(STAMP)-install-%: $(STAMP)-build-% cd $(DEB_BUILD_DIR)/$* && $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp touch $@ -$(STAMP_DIR)/install-source: pre-install - # install Mesa source for mesa-swx11-source package - chmod a+x debian/scripts/install-source.sh - debian/scripts/install-source.sh - touch $@ - clean: unpatch dh_testdir dh_testroot @@ -95,7 +88,7 @@ clean: unpatch rm -rf $(DEB_BUILD_DIR) $(STAMP_DIR) # Build architecture-independent files here. -binary-indep: build install $(INDEP_INSTALL_STAMPS) +binary-indep: build install dh_testdir dh_testroot dh_installchangelogs -i -- cgit v1.2.3 From bc32cd7fc8b94cd3fa8fc426f0f4bb051b667e27 Mon Sep 17 00:00:00 2001 From: Timo Aaltonen Date: Tue, 1 Jul 2008 18:58:17 +0300 Subject: Add dri_interface.h to mesa-common-dev. --- debian/changelog | 3 ++- debian/mesa-common-dev.install | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 089eaf062e0..0f9565cad7c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -9,8 +9,9 @@ mesa (7.1~rc1-1) UNRELEASED; urgency=low 01_fix-makefile.patch. * Build-depend on x11proto-dri2-dev. * Drop mesa-swx11-source. + * Add dri_interface.h to mesa-common-dev. - -- Timo Aaltonen Tue, 01 Jul 2008 18:55:51 +0300 + -- Timo Aaltonen Tue, 01 Jul 2008 18:57:29 +0300 mesa (7.0.3-4) unstable; urgency=low diff --git a/debian/mesa-common-dev.install b/debian/mesa-common-dev.install index 487825f8eb6..f4181b91b0e 100644 --- a/debian/mesa-common-dev.install +++ b/debian/mesa-common-dev.install @@ -2,3 +2,4 @@ usr/include/GL/gl.h usr/include/GL/glext.h usr/include/GL/gl_mangle.h usr/include/GL/glx*.h +usr/include/GL/internal/dri_interface.h -- cgit v1.2.3 From e6a5e6512fe556696ab512ad2c04c386d6f03eae Mon Sep 17 00:00:00 2001 From: Timo Aaltonen Date: Wed, 2 Jul 2008 14:07:23 +0300 Subject: Add gl.pc to libgl1-mesa-dev --- debian/changelog | 3 ++- debian/libgl1-mesa-dev.install | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 0f9565cad7c..c01e0dafba1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,8 +10,9 @@ mesa (7.1~rc1-1) UNRELEASED; urgency=low * 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 - -- Timo Aaltonen Tue, 01 Jul 2008 18:57:29 +0300 + -- Timo Aaltonen Wed, 02 Jul 2008 14:06:18 +0300 mesa (7.0.3-4) unstable; urgency=low diff --git a/debian/libgl1-mesa-dev.install b/debian/libgl1-mesa-dev.install index e1d3bffe3d7..dac5ebda19c 100644 --- a/debian/libgl1-mesa-dev.install +++ b/debian/libgl1-mesa-dev.install @@ -1 +1,2 @@ usr/lib/libGL.so +usr/lib/pkgconfig/gl.pc -- cgit v1.2.3 From 053bf7f5dbd412ddf0419fc9a82c41213e9502ab Mon Sep 17 00:00:00 2001 From: Timo Aaltonen Date: Wed, 2 Jul 2008 17:56:51 +0300 Subject: rules: Replace the old build system with the new autotools-based system. --- debian/changelog | 4 ++- debian/rules | 91 ++++++++++++++++++++++++++++++++++++++++++-------------- 2 files changed, 71 insertions(+), 24 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index c01e0dafba1..317b85bb8af 100644 --- a/debian/changelog +++ b/debian/changelog @@ -11,8 +11,10 @@ mesa (7.1~rc1-1) UNRELEASED; urgency=low * 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. - -- Timo Aaltonen Wed, 02 Jul 2008 14:06:18 +0300 + -- Timo Aaltonen Wed, 02 Jul 2008 17:55:03 +0300 mesa (7.0.3-4) unstable; urgency=low diff --git a/debian/rules b/debian/rules index d35364e1919..ae0f7447809 100755 --- a/debian/rules +++ b/debian/rules @@ -5,11 +5,6 @@ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 -STAMP_DIR = debian/stamp - -QUILT_STAMPFN = $(STAMP_DIR)/patch -include /usr/share/quilt/quilt.make - CFLAGS = -Wall -g ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) CFLAGS += -O0 @@ -21,8 +16,14 @@ ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) endif DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH) +DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) DEB_BUILD_DIR ?= $(CURDIR)/obj-$(DEB_BUILD_GNU_TYPE) +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 export DEB_BUILD_ARCH @@ -33,19 +34,47 @@ DRI_CONFIGS = include debian/scripts/choose-configs # build the following configurations by default -CONFIGS = $(SWX11_GLU_CONFIGS) \ - $(DRI_CONFIGS) \ - debian-osmesa \ - debian-osmesa-static \ - debian-osmesa16 \ - debian-osmesa16-static \ - debian-osmesa32 \ - debian-osmesa32-static +CONFIGS = 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)) ARCH_INSTALL_STAMPS = $(addprefix $(STAMP)-install-, $(CONFIGS)) +QUILT_STAMPFN = $(STAMP_DIR)/patch +include /usr/share/quilt/quilt.make + +confflags-osmesa = --enable-gl-osmesa \ + --with-demos=xdemos + +confflags-osmesa-static = --enable-static \ + --with-driver=osmesa \ + --with-demos= + +confflags-osmesa16 = --with-osmesa-bits=16 \ + --with-driver=osmesa \ + --with-demos= + +confflags-osmesa16-static = --with-osmesa-bits=16 \ + --with-driver=osmesa \ + --enable-static \ + --with-demos= + +confflags-osmesa32 = --with-osmesa-bits=32 \ + --with-driver=osmesa \ + --with-demos= + +confflags-osmesa32-static = --with-osmesa-bits=32 \ + --with-driver=osmesa \ + --enable-static \ + --with-demos= + # list the configurations that will built configs: @echo Building the following configurations: $(CONFIGS) @@ -56,16 +85,21 @@ $(STAMP_DIR): $(QUILT_STAMPFN): $(STAMP_DIR) +build: patch $(BUILD_STAMPS) -build: $(BUILD_STAMPS) - -$(STAMP)-build-%: patch +$(STAMP)-build-%: dh_testdir + mkdir -p $(DEB_BUILD_DIR)/$* find $(CURDIR)/* -maxdepth 0 -not -path '$(DEB_BUILD_DIR)*' | \ xargs cp -rlf -t $(DEB_BUILD_DIR)/$* - ln -sf $* $(DEB_BUILD_DIR)/$*/configs/current + cd $(DEB_BUILD_DIR)/$* && \ + ../../configure --prefix=/usr --mandir=\$${prefix}/share/man \ + --infodir=\$${prefix}/share/info --sysconfdir=/etc \ + --localstatedir=/var $(confflags) $(confflags-$*) \ + CFLAGS="$(CFLAGS)" cd $(DEB_BUILD_DIR)/$* && $(MAKE) + touch $@ pre-install: @@ -78,14 +112,26 @@ install: pre-install $(ARCH_INSTALL_STAMPS) $(STAMP)-install-%: $(STAMP)-build-% # Add here commands to install the package into debian/tmp - cd $(DEB_BUILD_DIR)/$* && $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp + dh_installdirs + + cd $(DEB_BUILD_DIR)/$* && $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install touch $@ clean: unpatch dh_testdir dh_testroot - dh_clean --exclude ./Makefile.orig - rm -rf $(DEB_BUILD_DIR) $(STAMP_DIR) + 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 obj-* + rm -rf $(STAMP_DIR) + # needed for git snapshots + chmod +x configure + + dh_clean # Build architecture-independent files here. binary-indep: build install @@ -111,7 +157,7 @@ binary-arch: build install dh_installchangelogs -s dh_installdocs -s dh_installexamples -s - dh_install --sourcedir=debian/tmp --list-missing -s + dh_install -s --sourcedir=debian/tmp --list-missing dh_installman -s dh_link -s dh_strip -plibgl1-mesa-swx11 --dbg-package=libgl1-mesa-swx11-dbg @@ -128,5 +174,4 @@ binary-arch: build install dh_builddeb -s binary: binary-indep binary-arch -.PHONY: configs build clean binary-indep binary-arch binary install configure - +.PHONY: configs build clean binary-indep binary-arch binary install -- cgit v1.2.3 From 9d72de1fb2cc5c2efc79dfe5f275343307287b4a Mon Sep 17 00:00:00 2001 From: Timo Aaltonen Date: Thu, 3 Jul 2008 00:20:58 +0300 Subject: Run autoreconf before building the various flavours. --- debian/changelog | 3 ++- debian/rules | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 317b85bb8af..2714139de91 100644 --- a/debian/changelog +++ b/debian/changelog @@ -13,8 +13,9 @@ mesa (7.1~rc1-1) UNRELEASED; urgency=low * 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.. - -- Timo Aaltonen Wed, 02 Jul 2008 17:55:03 +0300 + -- Timo Aaltonen Thu, 03 Jul 2008 00:20:15 +0300 mesa (7.0.3-4) unstable; urgency=low diff --git a/debian/rules b/debian/rules index ae0f7447809..96513e651b5 100755 --- a/debian/rules +++ b/debian/rules @@ -75,6 +75,9 @@ confflags-osmesa32-static = --with-osmesa-bits=32 \ --enable-static \ --with-demos= +autoreconf: + autoreconf -vfi + # list the configurations that will built configs: @echo Building the following configurations: $(CONFIGS) @@ -85,7 +88,7 @@ $(STAMP_DIR): $(QUILT_STAMPFN): $(STAMP_DIR) -build: patch $(BUILD_STAMPS) +build: patch autoreconf $(BUILD_STAMPS) $(STAMP)-build-%: dh_testdir -- cgit v1.2.3 From cbaac82c2cf7704203a7eeaa81b02fa6cebba40a Mon Sep 17 00:00:00 2001 From: Timo Aaltonen Date: Thu, 3 Jul 2008 09:26:46 +0300 Subject: Further tweaks to the autoconf stuff. Getting closer but still not there --- debian/rules | 62 +++++++++++++++++++++++++++++-------------- debian/scripts/choose-configs | 24 +++++++++-------- 2 files changed, 55 insertions(+), 31 deletions(-) (limited to 'debian') diff --git a/debian/rules b/debian/rules index 96513e651b5..b91fb430ea8 100755 --- a/debian/rules +++ b/debian/rules @@ -34,14 +34,15 @@ DRI_CONFIGS = include debian/scripts/choose-configs # build the following configurations by default -CONFIGS = osmesa \ +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)) @@ -50,31 +51,53 @@ ARCH_INSTALL_STAMPS = $(addprefix $(STAMP)-install-, $(CONFIGS)) QUILT_STAMPFN = $(STAMP_DIR)/patch include /usr/share/quilt/quilt.make -confflags-osmesa = --enable-gl-osmesa \ - --with-demos=xdemos +confflags-common = --disable-glu --disable-glut --disable-glw \ + CFLAGS="$(CFLAGS)" -confflags-osmesa-static = --enable-static \ - --with-driver=osmesa \ - --with-demos= +confflags-dri = --with-demos=xdemos \ + --libdir=/usr/lib/glx \ + --with-dri-driverdir=/usr/lib/dri \ + $(confflags-common) -confflags-osmesa16 = --with-osmesa-bits=16 \ - --with-driver=osmesa \ - --with-demos= +confflags-osmesa = --with-driver=osmesa \ + --with-demos= \ + $(confflags-common) -confflags-osmesa16-static = --with-osmesa-bits=16 \ - --with-driver=osmesa \ +confflags-osmesa-static = --with-driver=osmesa \ --enable-static \ - --with-demos= + --with-demos= \ + $(confflags-common) + +confflags-osmesa16 = --with-driver=osmesa --with-osmesa-bits=16 \ + --with-demos= \ + $(confflags-common) + +confflags-osmesa16-static = --with-driver=osmesa --with-osmesa-bits=16 \ + --enable-static \ + --with-demos= \ + $(confflags-common) + +confflags-osmesa32 = --with-driver=osmesa --with-osmesa-bits=32 \ + --with-demos= \ + $(confflags-common) + +confflags-osmesa32-static = --with-driver=osmesa --with-osmesa-bits=32 \ + --enable-static \ + --with-demos= \ + $(confflags-common) -confflags-osmesa32 = --with-osmesa-bits=32 \ - --with-driver=osmesa \ - --with-demos= +confflags-swx11+glu = --with-driver=xlib \ + --with-demos= -confflags-osmesa32-static = --with-osmesa-bits=32 \ - --with-driver=osmesa \ +confflags-swx11+glu-static = --with-driver=xlib \ --enable-static \ --with-demos= +confflags-swx11+glu-i386-i686 = --with-driver=xlib \ + --with-demos= \ + --libdir=/usr/lib/i686/cmov \ + CFLAGS="$(CFLAGS) -march=i686" + autoreconf: autoreconf -vfi @@ -99,8 +122,7 @@ $(STAMP)-build-%: cd $(DEB_BUILD_DIR)/$* && \ ../../configure --prefix=/usr --mandir=\$${prefix}/share/man \ --infodir=\$${prefix}/share/info --sysconfdir=/etc \ - --localstatedir=/var $(confflags) $(confflags-$*) \ - CFLAGS="$(CFLAGS)" + --localstatedir=/var $(confflags) $(confflags-$*) cd $(DEB_BUILD_DIR)/$* && $(MAKE) touch $@ diff --git a/debian/scripts/choose-configs b/debian/scripts/choose-configs index 16e00828a76..96050ecadce 100644 --- a/debian/scripts/choose-configs +++ b/debian/scripts/choose-configs @@ -8,18 +8,20 @@ # 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 +#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 +#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 # and for the GLX/DRI-enabled libGL ifneq ($(wildcard configs/debian-indirect-$(DEB_BUILD_ARCH)),) @@ -36,7 +38,7 @@ endif ## CPU-optimized configurations ############################################## ifeq ($(DEB_BUILD_ARCH), i386) - SWX11_GLU_CONFIGS += debian-swx11+glu-i386-i686 + SWX11_GLU_CONFIGS += swx11+glu-i386-i686 # DRI_CONFIGS += debian-dri-i386-i686 endif -- cgit v1.2.3 From 99a35fd4e1002efc0f49f2deb2b3aed5892da02c Mon Sep 17 00:00:00 2001 From: Timo Aaltonen Date: Thu, 3 Jul 2008 09:31:23 +0300 Subject: 01_fix-libdir.patch: libdir handling is broken in configure.ac, fix it. --- debian/changelog | 4 +++- debian/patches/01_fix-libdir.patch | 14 ++++++++++++++ debian/patches/series | 1 + 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 debian/patches/01_fix-libdir.patch (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 2714139de91..9b53749f807 100644 --- a/debian/changelog +++ b/debian/changelog @@ -14,8 +14,10 @@ mesa (7.1~rc1-1) UNRELEASED; urgency=low * rules: Replace the old build system with the new autotools-based system. * Run autoreconf before building the various flavours.. + * 01_fix-libdir.patch: libdir handling is broken in configure.ac, fix + it. - -- Timo Aaltonen Thu, 03 Jul 2008 00:20:15 +0300 + -- Timo Aaltonen Thu, 03 Jul 2008 09:30:30 +0300 mesa (7.0.3-4) unstable; urgency=low diff --git a/debian/patches/01_fix-libdir.patch b/debian/patches/01_fix-libdir.patch new file mode 100644 index 00000000000..c041c941dea --- /dev/null +++ b/debian/patches/01_fix-libdir.patch @@ -0,0 +1,14 @@ +diff --git a/configure.ac b/configure.ac +index f15d9ff..7de1017 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -64,7 +64,7 @@ m4_ifdef([PKG_PROG_PKG_CONFIG],[],[ + PKG_PROG_PKG_CONFIG() + + dnl LIB_DIR - library basename +-LIB_DIR=`echo $libdir | $SED 's%.*/%%'` ++LIB_DIR=`echo $libdir | $SED 's%[^/]*/[^/]*/%%'` + AC_SUBST([LIB_DIR]) + + dnl Cache LDFLAGS so we can add EXTRA_LIB_PATH and restore it later + diff --git a/debian/patches/series b/debian/patches/series index abb18b908ed..fa395b1a4ca 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,2 +1,3 @@ +01_fix-libdir.patch 02_use-ieee-fp-on-s390-and-m68k.patch 03_optional-progs-and-install.patch -- cgit v1.2.3 From 063a487fe12f186d7aab52ca788697572e42390f Mon Sep 17 00:00:00 2001 From: Timo Aaltonen Date: Thu, 3 Jul 2008 13:20:21 +0300 Subject: Fix the configure.ac patch somewhat workaround the problems by setting --libdir for all flavours, otherwise the path used is /usr/usr/lib. --- debian/patches/01_fix-libdir.patch | 2 +- debian/rules | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'debian') diff --git a/debian/patches/01_fix-libdir.patch b/debian/patches/01_fix-libdir.patch index c041c941dea..95a70775376 100644 --- a/debian/patches/01_fix-libdir.patch +++ b/debian/patches/01_fix-libdir.patch @@ -7,7 +7,7 @@ index f15d9ff..7de1017 100644 dnl LIB_DIR - library basename -LIB_DIR=`echo $libdir | $SED 's%.*/%%'` -+LIB_DIR=`echo $libdir | $SED 's%[^/]*/[^/]*/%%'` ++LIB_DIR=`echo $libdir | $SED 's%[[^/]*/[^/]]*/%%'` AC_SUBST([LIB_DIR]) dnl Cache LDFLAGS so we can add EXTRA_LIB_PATH and restore it later diff --git a/debian/rules b/debian/rules index b91fb430ea8..56bb67f6316 100755 --- a/debian/rules +++ b/debian/rules @@ -52,12 +52,14 @@ QUILT_STAMPFN = $(STAMP_DIR)/patch include /usr/share/quilt/quilt.make confflags-common = --disable-glu --disable-glut --disable-glw \ + --libdir=/usr/lib \ CFLAGS="$(CFLAGS)" confflags-dri = --with-demos=xdemos \ --libdir=/usr/lib/glx \ --with-dri-driverdir=/usr/lib/dri \ - $(confflags-common) + --disable-glu --disable-glut --disable-glw \ + CFLAGS="$(CFLAGS)" confflags-osmesa = --with-driver=osmesa \ --with-demos= \ @@ -87,11 +89,13 @@ confflags-osmesa32-static = --with-driver=osmesa --with-osmesa-bits=32 \ $(confflags-common) confflags-swx11+glu = --with-driver=xlib \ - --with-demos= + --with-demos= \ + --libdir=/usr/lib confflags-swx11+glu-static = --with-driver=xlib \ --enable-static \ - --with-demos= + --with-demos= \ + --libdir=/usr/lib confflags-swx11+glu-i386-i686 = --with-driver=xlib \ --with-demos= \ -- cgit v1.2.3 From 6dedd60350f717bfa1cc101267c36f340eb1de9f Mon Sep 17 00:00:00 2001 From: Timo Aaltonen Date: Thu, 3 Jul 2008 15:53:19 +0300 Subject: Further autoconf changes: add automake & autoconf to build-deps add some cleanup rules --- debian/changelog | 3 ++- debian/control | 6 +++++- debian/rules | 3 +++ 3 files changed, 10 insertions(+), 2 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 9b53749f807..de2236bd3fe 100644 --- a/debian/changelog +++ b/debian/changelog @@ -16,8 +16,9 @@ mesa (7.1~rc1-1) UNRELEASED; urgency=low * Run autoreconf before building the various flavours.. * 01_fix-libdir.patch: libdir handling is broken in configure.ac, fix it. + * Add automake & autoconf to build-deps. - -- Timo Aaltonen Thu, 03 Jul 2008 09:30:30 +0300 + -- Timo Aaltonen Thu, 03 Jul 2008 15:51:00 +0300 mesa (7.0.3-4) unstable; urgency=low diff --git a/debian/control b/debian/control index daa88abdd80..80f7198c9ae 100644 --- a/debian/control +++ b/debian/control @@ -4,7 +4,11 @@ Priority: optional Maintainer: Debian X Strike Force Uploaders: Thierry Reding , Julien Cristau , David Nusinow , Brice Goglin Standards-Version: 3.7.3 -Build-Depends: debhelper (>= 5), quilt (>= 0.40), pkg-config, libdrm-dev (>= 2.3.1) [!hurd-i386], libx11-dev, xutils-dev, x11proto-gl-dev (>= 1.4.8), x11proto-dri2-dev, libxxf86vm-dev, libexpat1-dev, lesstif2-dev, dpkg-dev (>= 1.13.19), libxfixes-dev, libxdamage-dev, libxext-dev +Build-Depends: debhelper (>= 5), quilt (>= 0.40), pkg-config, + libdrm-dev (>= 2.3.1) [!hurd-i386], libx11-dev, xutils-dev, + x11proto-gl-dev (>= 1.4.8), x11proto-dri2-dev, libxxf86vm-dev, + libexpat1-dev, lesstif2-dev, dpkg-dev (>= 1.13.19), libxfixes-dev, + libxdamage-dev, libxext-dev, autoconf, automake 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/ diff --git a/debian/rules b/debian/rules index 56bb67f6316..e59ed63027a 100755 --- a/debian/rules +++ b/debian/rules @@ -156,6 +156,9 @@ clean: unpatch rm -f conftest* */conftest* rm -rf autom4te.cache */autom4te.cache rm -rf obj-* + 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) # needed for git snapshots chmod +x configure -- cgit v1.2.3 From e846ebc1a10797b8fa87a216c93564e93d31f8c8 Mon Sep 17 00:00:00 2001 From: Timo Aaltonen Date: Thu, 3 Jul 2008 18:14:25 +0300 Subject: don't chmod configure which does not exist. --- debian/rules | 2 -- 1 file changed, 2 deletions(-) (limited to 'debian') diff --git a/debian/rules b/debian/rules index e59ed63027a..8dabc10b3ac 100755 --- a/debian/rules +++ b/debian/rules @@ -160,8 +160,6 @@ clean: unpatch rm -rf $$(find -name Makefile.in) rm -rf aclocal.m4 missing depcomp install-sh ltmain.sh rm -rf $(STAMP_DIR) - # needed for git snapshots - chmod +x configure dh_clean -- cgit v1.2.3 From 2380f8bd93ff0c5d49fd568d90321e859ed8b534 Mon Sep 17 00:00:00 2001 From: Timo Aaltonen Date: Thu, 3 Jul 2008 18:37:28 +0300 Subject: Remove configs/current on clean. --- debian/changelog | 3 ++- debian/rules | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index de2236bd3fe..40d9b0a1a5b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -17,8 +17,9 @@ mesa (7.1~rc1-1) UNRELEASED; urgency=low * 01_fix-libdir.patch: libdir handling is broken in configure.ac, fix it. * Add automake & autoconf to build-deps. + * Remove configs/current on clean. - -- Timo Aaltonen Thu, 03 Jul 2008 15:51:00 +0300 + -- Timo Aaltonen Thu, 03 Jul 2008 18:36:45 +0300 mesa (7.0.3-4) unstable; urgency=low diff --git a/debian/rules b/debian/rules index 8dabc10b3ac..13a4474c470 100755 --- a/debian/rules +++ b/debian/rules @@ -160,6 +160,7 @@ clean: unpatch rm -rf $$(find -name Makefile.in) rm -rf aclocal.m4 missing depcomp install-sh ltmain.sh rm -rf $(STAMP_DIR) + rm -f configs/current dh_clean -- cgit v1.2.3 From 213803b4d4580bfc5baaf0814968e53219484dd5 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Thu, 3 Jul 2008 18:30:35 +0200 Subject: fix libOSMesa versioning, to revert accidental SONAME bump. --- debian/changelog | 2 ++ debian/patches/04_osmesa_version.diff | 21 +++++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 24 insertions(+) create mode 100644 debian/patches/04_osmesa_version.diff (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 40d9b0a1a5b..5fea75d5b76 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,8 @@ mesa (7.1~rc1-1) UNRELEASED; urgency=low [ Julien Cristau ] * New upstream release candidate. * 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 diff --git a/debian/patches/04_osmesa_version.diff b/debian/patches/04_osmesa_version.diff new file mode 100644 index 00000000000..ba22b2f80d0 --- /dev/null +++ b/debian/patches/04_osmesa_version.diff @@ -0,0 +1,21 @@ +diff -up mesa-20080612/src/mesa/drivers/osmesa/Makefile.osmesa mesa-20080612/src/mesa/drivers/osmesa/Makefile +--- mesa-20080612/src/mesa/drivers/osmesa/Makefile.osmesa 2008-06-12 12:17:27.000000000 +1000 ++++ mesa-20080612/src/mesa/drivers/osmesa/Makefile 2008-06-12 13:14:24.000000000 +1000 +@@ -47,7 +47,7 @@ osmesa8: $(TOP)/lib/$(OSMESA_LIB_NAME) + $(TOP)/lib/$(OSMESA_LIB_NAME): $(OBJECTS) + $(TOP)/bin/mklib -o $(OSMESA_LIB) \ + -linker "$(CC)" \ +- -major $(MESA_MAJOR) -minor $(MESA_MINOR) -patch $(MESA_TINY) \ ++ -major 6 -minor 5 -patch 3 \ + -install $(TOP)/$(LIB_DIR) \ + $(MKLIB_OPTIONS) \ + $(OSMESA_LIB_DEPS) $(OBJECTS) +@@ -60,7 +60,7 @@ $(TOP)/lib/$(OSMESA_LIB_NAME): $(OBJECTS + osmesa16: $(OBJECTS) $(CORE_MESA) + $(TOP)/bin/mklib -o $(OSMESA_LIB) \ + -linker "$(CC)" \ +- -major $(MESA_MAJOR) -minor $(MESA_MINOR) -patch $(MESA_TINY) \ ++ -major 6 -minor 5 -patch 3 \ + -install $(TOP)/$(LIB_DIR) \ + $(MKLIB_OPTIONS) \ + $(OSMESA_LIB_DEPS) $(OBJECTS) $(CORE_MESA) diff --git a/debian/patches/series b/debian/patches/series index fa395b1a4ca..4611842eee3 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,3 +1,4 @@ 01_fix-libdir.patch 02_use-ieee-fp-on-s390-and-m68k.patch 03_optional-progs-and-install.patch +04_osmesa_version.diff -- cgit v1.2.3 From 2954e4c3d7db1978b0758907d673bae0f5e4cdb8 Mon Sep 17 00:00:00 2001 From: Timo Aaltonen Date: Fri, 4 Jul 2008 08:48:33 +0300 Subject: Disable glut for swx11 targets. It was not built before either and would need new build-deps (xi xmu). --- debian/rules | 3 +++ 1 file changed, 3 insertions(+) (limited to 'debian') diff --git a/debian/rules b/debian/rules index 13a4474c470..98a2fb2eb29 100755 --- a/debian/rules +++ b/debian/rules @@ -90,15 +90,18 @@ confflags-osmesa32-static = --with-driver=osmesa --with-osmesa-bits=32 \ confflags-swx11+glu = --with-driver=xlib \ --with-demos= \ + --disable-glut \ --libdir=/usr/lib confflags-swx11+glu-static = --with-driver=xlib \ --enable-static \ --with-demos= \ + --disable-glut \ --libdir=/usr/lib confflags-swx11+glu-i386-i686 = --with-driver=xlib \ --with-demos= \ + --disable-glut \ --libdir=/usr/lib/i686/cmov \ CFLAGS="$(CFLAGS) -march=i686" -- cgit v1.2.3 From 38eb154b39980bc977f4daa6d77a88d335de786d Mon Sep 17 00:00:00 2001 From: root Date: Fri, 4 Jul 2008 10:02:58 +0300 Subject: Use --enable-glx-tls for dri. --- debian/changelog | 3 ++- debian/rules | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 5fea75d5b76..5da80d74e7b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -20,8 +20,9 @@ mesa (7.1~rc1-1) UNRELEASED; urgency=low it. * Add automake & autoconf to build-deps. * Remove configs/current on clean. + * Use --enable-glx-tls for dri. - -- Timo Aaltonen Thu, 03 Jul 2008 18:36:45 +0300 + -- Timo Aaltonen Fri, 04 Jul 2008 10:02:34 +0300 mesa (7.0.3-4) unstable; urgency=low diff --git a/debian/rules b/debian/rules index 98a2fb2eb29..266832e2150 100755 --- a/debian/rules +++ b/debian/rules @@ -59,6 +59,7 @@ confflags-dri = --with-demos=xdemos \ --libdir=/usr/lib/glx \ --with-dri-driverdir=/usr/lib/dri \ --disable-glu --disable-glut --disable-glw \ + --enable-glx-tls \ CFLAGS="$(CFLAGS)" confflags-osmesa = --with-driver=osmesa \ -- cgit v1.2.3 From 08af66d57e9046579a3edd4e55e72ec6292a67e9 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 4 Jul 2008 10:04:45 +0300 Subject: Revert "Remove configs/current on clean." This reverts commit 2380f8bd93ff0c5d49fd568d90321e859ed8b534. Conflicts: debian/changelog --- debian/changelog | 1 - debian/rules | 1 - 2 files changed, 2 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 5da80d74e7b..e0628be22a4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -19,7 +19,6 @@ mesa (7.1~rc1-1) UNRELEASED; urgency=low * 01_fix-libdir.patch: libdir handling is broken in configure.ac, fix it. * Add automake & autoconf to build-deps. - * Remove configs/current on clean. * Use --enable-glx-tls for dri. -- Timo Aaltonen Fri, 04 Jul 2008 10:02:34 +0300 diff --git a/debian/rules b/debian/rules index 266832e2150..688cb176612 100755 --- a/debian/rules +++ b/debian/rules @@ -164,7 +164,6 @@ clean: unpatch rm -rf $$(find -name Makefile.in) rm -rf aclocal.m4 missing depcomp install-sh ltmain.sh rm -rf $(STAMP_DIR) - rm -f configs/current dh_clean -- cgit v1.2.3 From 4aa518a2d7d7aec86b939f677cb83ced0b17d132 Mon Sep 17 00:00:00 2001 From: Timo Aaltonen Date: Fri, 4 Jul 2008 11:00:09 +0300 Subject: Add a patch from upstream to set installdir properly. this also replaces 01_fix-libdir.patch and the need to set --libdir for every target. --- debian/changelog | 6 +- debian/patches/01_fix-installdir.patch | 380 +++++++++++++++++++++++++++++++++ debian/patches/01_fix-libdir.patch | 14 -- debian/patches/series | 2 +- debian/rules | 7 +- 5 files changed, 386 insertions(+), 23 deletions(-) create mode 100644 debian/patches/01_fix-installdir.patch delete mode 100644 debian/patches/01_fix-libdir.patch (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index e0628be22a4..06fa56eb687 100644 --- a/debian/changelog +++ b/debian/changelog @@ -16,12 +16,12 @@ mesa (7.1~rc1-1) UNRELEASED; urgency=low * rules: Replace the old build system with the new autotools-based system. * Run autoreconf before building the various flavours.. - * 01_fix-libdir.patch: libdir handling is broken in configure.ac, fix - it. + * 01_fix-installdir.patch: installdir handling was broken, this patch + from upstream fixes it. * Add automake & autoconf to build-deps. * Use --enable-glx-tls for dri. - -- Timo Aaltonen Fri, 04 Jul 2008 10:02:34 +0300 + -- Timo Aaltonen Fri, 04 Jul 2008 10:59:12 +0300 mesa (7.0.3-4) unstable; urgency=low diff --git a/debian/patches/01_fix-installdir.patch b/debian/patches/01_fix-installdir.patch new file mode 100644 index 00000000000..2148a7ba850 --- /dev/null +++ b/debian/patches/01_fix-installdir.patch @@ -0,0 +1,380 @@ +From 410195da3cddb0e4f0a4d31a25732f00c264af51 Mon Sep 17 00:00:00 2001 +From: Dan Nicholson +Date: Thu, 3 Jul 2008 09:17:44 -0700 +Subject: [PATCH] Set library and header installation directories from configuration + +Currently the installation directories for libraries and headers are +resolved within the install commands. For instance, the libraries will +be installed to $(INSTALL_DIR)/$(LIB_DIR). This limits the flexibility +of the installation, such as when the libraries should be installed to a +subdirectory like /usr/lib/tls. + +This adds the make variables $(INSTALL_LIB_DIR) and $(INSTALL_INC_DIR) +to define the locations that the libraries and headers are installed. +For the static configs, this resolves exactly as before to +$(INSTALL_DIR)/include and $(INSTALL_DIR)/$(LIB_DIR). For autoconf, they +are derived directly from the --libdir and --includedir settings. +--- + configs/autoconf.in | 3 +++ + configs/default | 4 +++- + configure.ac | 1 + + src/glu/Makefile | 11 ++++++----- + src/glu/glu.pc.in | 4 ++-- + src/glut/fbdev/Makefile | 8 ++++---- + src/glut/glx/Makefile | 15 ++++++++------- + src/glut/glx/glut.pc.in | 4 ++-- + src/glut/mini/Makefile | 15 ++++++++------- + src/glut/mini/glut.pc.in | 4 ++-- + src/glw/Makefile | 15 ++++++++------- + src/glw/glw.pc.in | 4 ++-- + src/mesa/Makefile | 19 ++++++++++--------- + src/mesa/drivers/dri/Makefile | 15 +++++++++------ + src/mesa/drivers/dri/dri.pc.in | 4 ++-- + src/mesa/gl.pc.in | 4 ++-- + 16 files changed, 72 insertions(+), 58 deletions(-) + +diff --git a/configs/autoconf.in b/configs/autoconf.in +index ed44a0f..21d224f 100644 +--- a/configs/autoconf.in ++++ b/configs/autoconf.in +@@ -89,9 +89,12 @@ EXPAT_INCLUDES = @EXPAT_INCLUDES@ + prefix = @prefix@ + exec_prefix = @exec_prefix@ + libdir = @libdir@ ++includedir = @includedir@ + + # Installation directories (for make install) + INSTALL_DIR = $(prefix) ++INSTALL_LIB_DIR = $(libdir) ++INSTALL_INC_DIR = $(includedir) + + # DRI installation directories + DRI_DRIVER_INSTALL_DIR = @DRI_DRIVER_INSTALL_DIR@ +diff --git a/configs/default b/configs/default +index 37b6939..d5b40c5 100644 +--- a/configs/default ++++ b/configs/default +@@ -84,7 +84,9 @@ APP_LIB_DEPS = -lm + + # Installation directories (for make install) + INSTALL_DIR = /usr/local +-DRI_DRIVER_INSTALL_DIR = $(INSTALL_DIR)/$(LIB_DIR)/dri ++INSTALL_LIB_DIR = $(INSTALL_DIR)/$(LIB_DIR) ++INSTALL_INC_DIR = $(INSTALL_DIR)/include ++DRI_DRIVER_INSTALL_DIR = $(INSTALL_LIB_DIR)/dri + + # Where libGL will look for DRI hardware drivers + DRI_DRIVER_SEARCH_DIR = $(DRI_DRIVER_INSTALL_DIR) +diff --git a/configure.ac b/configure.ac +index f15d9ff..961a60c 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -994,6 +994,7 @@ echo "" + echo " prefix: $prefix" + echo " exec_prefix: $exec_prefix" + echo " libdir: $libdir" ++echo " includedir: $includedir" + + dnl Driver info + echo "" +diff --git a/src/glu/Makefile b/src/glu/Makefile +index 23161b5..fe19fd1 100644 +--- a/src/glu/Makefile ++++ b/src/glu/Makefile +@@ -16,16 +16,17 @@ default: $(TOP)/configs/current + # GLU pkg-config file + pcedit = sed \ + -e 's,@INSTALL_DIR@,$(INSTALL_DIR),' \ +- -e 's,@LIB_DIR@,$(LIB_DIR),' \ ++ -e 's,@INSTALL_LIB_DIR@,$(INSTALL_LIB_DIR),' \ ++ -e 's,@INSTALL_INC_DIR@,$(INSTALL_INC_DIR),' \ + -e 's,@VERSION@,$(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY),' + glu.pc: glu.pc.in + $(pcedit) $< > $@ + + install: glu.pc +- $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR) +- $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)/pkgconfig +- $(INSTALL) $(TOP)/$(LIB_DIR)/libGLU.* $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR) +- $(INSTALL) -m 644 glu.pc $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)/pkgconfig ++ $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR) ++ $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig ++ $(INSTALL) $(TOP)/$(LIB_DIR)/libGLU.* $(DESTDIR)$(INSTALL_LIB_DIR) ++ $(INSTALL) -m 644 glu.pc $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig + + clean: + -@for dir in $(SUBDIRS) ; do \ +diff --git a/src/glu/glu.pc.in b/src/glu/glu.pc.in +index 5d6e52a..8606b9b 100644 +--- a/src/glu/glu.pc.in ++++ b/src/glu/glu.pc.in +@@ -1,7 +1,7 @@ + prefix=@INSTALL_DIR@ + exec_prefix=${prefix} +-libdir=${exec_prefix}/@LIB_DIR@ +-includedir=${prefix}/include ++libdir=@INSTALL_LIB_DIR@ ++includedir=@INSTALL_INC_DIR@ + + Name: glu + Description: Mesa OpenGL Utility library +diff --git a/src/glut/fbdev/Makefile b/src/glut/fbdev/Makefile +index 95893b7..ff74a28 100644 +--- a/src/glut/fbdev/Makefile ++++ b/src/glut/fbdev/Makefile +@@ -69,10 +69,10 @@ $(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME): depend $(OBJECTS) + $(MKLIB_OPTIONS) $(OBJECTS) + + install: +- $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/include/GL +- $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR) +- $(INSTALL) -m 644 $(TOP)/include/GL/glut.h $(DESTDIR)$(INSTALL_DIR)/include/GL +- $(INSTALL) $(TOP)/$(LIB_DIR)/libglut* $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR) ++ $(INSTALL) -d $(DESTDIR)$(INSTALL_INC_DIR)/GL ++ $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR) ++ $(INSTALL) -m 644 $(TOP)/include/GL/glut.h $(DESTDIR)$(INSTALL_INC_DIR)/GL ++ $(INSTALL) $(TOP)/$(LIB_DIR)/libglut* $(DESTDIR)$(INSTALL_LIB_DIR) + + # Run 'make -f Makefile.solo dep' to update the dependencies if you change + # what's included by any source file. +diff --git a/src/glut/glx/Makefile b/src/glut/glx/Makefile +index 674d5a5..819dfd2 100644 +--- a/src/glut/glx/Makefile ++++ b/src/glut/glx/Makefile +@@ -100,18 +100,19 @@ $(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME): depend $(OBJECTS) + # glut pkgconfig file + pcedit = sed \ + -e 's,@INSTALL_DIR@,$(INSTALL_DIR),' \ +- -e 's,@LIB_DIR@,$(LIB_DIR),' \ ++ -e 's,@INSTALL_LIB_DIR@,$(INSTALL_LIB_DIR),' \ ++ -e 's,@INSTALL_INC_DIR@,$(INSTALL_INC_DIR),' \ + -e 's,@VERSION@,$(GLUT_MAJOR).$(GLUT_MINOR).$(GLUT_TINY),' + glut.pc: glut.pc.in + $(pcedit) $< > $@ + + install: glut.pc +- $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/include/GL +- $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR) +- $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)/pkgconfig +- $(INSTALL) -m 644 $(TOP)/include/GL/glut.h $(DESTDIR)$(INSTALL_DIR)/include/GL +- $(INSTALL) $(TOP)/$(LIB_DIR)/libglut* $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR) +- $(INSTALL) -m 644 glut.pc $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)/pkgconfig ++ $(INSTALL) -d $(DESTDIR)$(INSTALL_INC_DIR)/GL ++ $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR) ++ $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig ++ $(INSTALL) -m 644 $(TOP)/include/GL/glut.h $(DESTDIR)$(INSTALL_INC_DIR)/GL ++ $(INSTALL) $(TOP)/$(LIB_DIR)/libglut* $(DESTDIR)$(INSTALL_LIB_DIR) ++ $(INSTALL) -m 644 glut.pc $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig + + + clean: +diff --git a/src/glut/glx/glut.pc.in b/src/glut/glx/glut.pc.in +index f732f29..e8638fe 100644 +--- a/src/glut/glx/glut.pc.in ++++ b/src/glut/glx/glut.pc.in +@@ -1,7 +1,7 @@ + prefix=@INSTALL_DIR@ + exec_prefix=${prefix} +-libdir=${exec_prefix}/@LIB_DIR@ +-includedir=${prefix}/include ++libdir=@INSTALL_LIB_DIR@ ++includedir=@INSTALL_INC_DIR@ + + Name: glut + Description: Mesa OpenGL Utility Toolkit library +diff --git a/src/glut/mini/Makefile b/src/glut/mini/Makefile +index d386050..6aba2af 100644 +--- a/src/glut/mini/Makefile ++++ b/src/glut/mini/Makefile +@@ -75,18 +75,19 @@ tags: + # glut pkgconfig file + pcedit = sed \ + -e 's,@INSTALL_DIR@,$(INSTALL_DIR),' \ +- -e 's,@LIB_DIR@,$(LIB_DIR),' \ ++ -e 's,@INSTALL_LIB_DIR@,$(INSTALL_LIB_DIR),' \ ++ -e 's,@INSTALL_INC_DIR@,$(INSTALL_INC_DIR),' \ + -e 's,@VERSION@,$(GLUT_MAJOR).$(GLUT_MINOR).$(GLUT_TINY),' + glut.pc: glut.pc.in + $(pcedit) $< > $@ + + install: glut.pc +- $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/include/GL +- $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR) +- $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)/pkgconfig +- $(INSTALL) -m 644 $(TOP)/include/GL/glut.h $(DESTDIR)$(INSTALL_DIR)/include/GL +- $(INSTALL) $(TOP)/$(LIB_DIR)/libglut* $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR) +- $(INSTALL) -m 644 glut.pc $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)/pkgconfig ++ $(INSTALL) -d $(DESTDIR)$(INSTALL_INC_DIR)/GL ++ $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR) ++ $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig ++ $(INSTALL) -m 644 $(TOP)/include/GL/glut.h $(DESTDIR)$(INSTALL_INC_DIR)/GL ++ $(INSTALL) $(TOP)/$(LIB_DIR)/libglut* $(DESTDIR)$(INSTALL_LIB_DIR) ++ $(INSTALL) -m 644 glut.pc $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig + + + # Remove .o and backup files +diff --git a/src/glut/mini/glut.pc.in b/src/glut/mini/glut.pc.in +index f732f29..e8638fe 100644 +--- a/src/glut/mini/glut.pc.in ++++ b/src/glut/mini/glut.pc.in +@@ -1,7 +1,7 @@ + prefix=@INSTALL_DIR@ + exec_prefix=${prefix} +-libdir=${exec_prefix}/@LIB_DIR@ +-includedir=${prefix}/include ++libdir=@INSTALL_LIB_DIR@ ++includedir=@INSTALL_INC_DIR@ + + Name: glut + Description: Mesa OpenGL Utility Toolkit library +diff --git a/src/glw/Makefile b/src/glw/Makefile +index 88bf99d..f0dd1ac 100644 +--- a/src/glw/Makefile ++++ b/src/glw/Makefile +@@ -28,18 +28,19 @@ default: $(TOP)/$(LIB_DIR)/$(GLW_LIB_NAME) + # GLU pkg-config file + pcedit = sed \ + -e 's,@INSTALL_DIR@,$(INSTALL_DIR),' \ +- -e 's,@LIB_DIR@,$(LIB_DIR),' \ ++ -e 's,@INSTALL_LIB_DIR@,$(INSTALL_LIB_DIR),' \ ++ -e 's,@INSTALL_INC_DIR@,$(INSTALL_INC_DIR),' \ + -e 's,@VERSION@,$(MAJOR).$(MINOR).$(TINY),' + glw.pc: glw.pc.in + $(pcedit) $< > $@ + + install: glw.pc +- $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/include/GL +- $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR) +- $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)/pkgconfig +- $(INSTALL) -m 644 *.h $(DESTDIR)$(INSTALL_DIR)/include/GL +- $(INSTALL) $(TOP)/$(LIB_DIR)/libGLw.* $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR) +- $(INSTALL) -m 644 glw.pc $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)/pkgconfig ++ $(INSTALL) -d $(DESTDIR)$(INSTALL_INC_DIR)/GL ++ $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR) ++ $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig ++ $(INSTALL) -m 644 *.h $(DESTDIR)$(INSTALL_INC_DIR)/GL ++ $(INSTALL) $(TOP)/$(LIB_DIR)/libGLw.* $(DESTDIR)$(INSTALL_LIB_DIR) ++ $(INSTALL) -m 644 glw.pc $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig + + clean: + -rm -f depend depend.bak +diff --git a/src/glw/glw.pc.in b/src/glw/glw.pc.in +index 9c2682f..25f3f73 100644 +--- a/src/glw/glw.pc.in ++++ b/src/glw/glw.pc.in +@@ -1,7 +1,7 @@ + prefix=@INSTALL_DIR@ + exec_prefix=${prefix} +-libdir=${exec_prefix}/@LIB_DIR@ +-includedir=${prefix}/include ++libdir=@INSTALL_LIB_DIR@ ++includedir=@INSTALL_INC_DIR@ + + Name: glw + Description: Mesa OpenGL widget library +diff --git a/src/mesa/Makefile b/src/mesa/Makefile +index e0b641b..3827ffb 100644 +--- a/src/mesa/Makefile ++++ b/src/mesa/Makefile +@@ -90,28 +90,29 @@ install: default + + pcedit = sed \ + -e 's,@INSTALL_DIR@,$(INSTALL_DIR),' \ +- -e 's,@LIB_DIR@,$(LIB_DIR),' \ ++ -e 's,@INSTALL_LIB_DIR@,$(INSTALL_LIB_DIR),' \ ++ -e 's,@INSTALL_INC_DIR@,$(INSTALL_INC_DIR),' \ + -e 's,@VERSION@,$(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY),' + + gl.pc: gl.pc.in + $(pcedit) $< > $@ + + install-headers: +- $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/include/GL ++ $(INSTALL) -d $(DESTDIR)$(INSTALL_INC_DIR)/GL + $(INSTALL) -m 644 $(TOP)/include/GL/*.h \ +- $(DESTDIR)$(INSTALL_DIR)/include/GL ++ $(DESTDIR)$(INSTALL_INC_DIR)/GL + + install-libgl: default gl.pc install-headers +- $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR) +- $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)/pkgconfig ++ $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR) ++ $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig + $(INSTALL) $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME)* \ +- $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR) +- $(INSTALL) -m 644 gl.pc $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)/pkgconfig ++ $(DESTDIR)$(INSTALL_LIB_DIR) ++ $(INSTALL) -m 644 gl.pc $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig + + install-osmesa: default +- $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR) ++ $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR) + $(INSTALL) $(TOP)/$(LIB_DIR)/$(OSMESA_LIB_NAME)* \ +- $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR) ++ $(DESTDIR)$(INSTALL_LIB_DIR) + + install-dri: default + cd drivers/dri && $(MAKE) install +diff --git a/src/mesa/drivers/dri/Makefile b/src/mesa/drivers/dri/Makefile +index 3f87782..96118e0 100644 +--- a/src/mesa/drivers/dri/Makefile ++++ b/src/mesa/drivers/dri/Makefile +@@ -22,7 +22,8 @@ subdirs: + + pcedit = sed \ + -e 's,@INSTALL_DIR@,$(INSTALL_DIR),' \ +- -e 's,@LIB_DIR@,$(LIB_DIR),' \ ++ -e 's,@INSTALL_LIB_DIR@,$(INSTALL_LIB_DIR),' \ ++ -e 's,@INSTALL_INC_DIR@,$(INSTALL_INC_DIR),' \ + -e 's,@VERSION@,$(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY),' \ + -e 's,@DRI_DRIVER_DIR@,$(DRI_DRIVER_SEARCH_DIR),' + +@@ -36,11 +37,13 @@ install: dri.pc + (cd $$dir && $(MAKE) install) || exit 1 ; \ + fi \ + done +- $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/include/GL/internal +- $(INSTALL) -m 0644 $(TOP)/include/GL/internal/dri_interface.h $(DESTDIR)$(INSTALL_DIR)/include/GL/internal +- $(INSTALL) -m 0644 $(TOP)/include/GL/internal/dri_sarea.h $(DESTDIR)$(INSTALL_DIR)/include/GL/internal +- $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)/pkgconfig +- $(INSTALL) -m 0644 dri.pc $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)/pkgconfig ++ $(INSTALL) -d $(DESTDIR)$(INSTALL_INC_DIR)/GL/internal ++ $(INSTALL) -m 0644 $(TOP)/include/GL/internal/dri_interface.h \ ++ $(DESTDIR)$(INSTALL_INC_DIR)/GL/internal ++ $(INSTALL) -m 0644 $(TOP)/include/GL/internal/dri_sarea.h \ ++ $(DESTDIR)$(INSTALL_INC_DIR)/GL/internal ++ $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig ++ $(INSTALL) -m 0644 dri.pc $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig + + + clean: +diff --git a/src/mesa/drivers/dri/dri.pc.in b/src/mesa/drivers/dri/dri.pc.in +index 58d890d..c47ee9c 100644 +--- a/src/mesa/drivers/dri/dri.pc.in ++++ b/src/mesa/drivers/dri/dri.pc.in +@@ -1,7 +1,7 @@ + prefix=@INSTALL_DIR@ + exec_prefix=${prefix} +-libdir=${exec_prefix}/@LIB_DIR@ +-includedir=${prefix}/include ++libdir=@INSTALL_LIB_DIR@ ++includedir=@INSTALL_INC_DIR@ + dridriverdir=@DRI_DRIVER_DIR@ + + Name: dri +diff --git a/src/mesa/gl.pc.in b/src/mesa/gl.pc.in +index 4b144ff..1927880 100644 +--- a/src/mesa/gl.pc.in ++++ b/src/mesa/gl.pc.in +@@ -1,7 +1,7 @@ + prefix=@INSTALL_DIR@ + exec_prefix=${prefix} +-libdir=${exec_prefix}/@LIB_DIR@ +-includedir=${prefix}/include ++libdir=@INSTALL_LIB_DIR@ ++includedir=@INSTALL_INC_DIR@ + + Name: gl + Description: Mesa OpenGL library +-- +1.5.3.2 diff --git a/debian/patches/01_fix-libdir.patch b/debian/patches/01_fix-libdir.patch deleted file mode 100644 index 95a70775376..00000000000 --- a/debian/patches/01_fix-libdir.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/configure.ac b/configure.ac -index f15d9ff..7de1017 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -64,7 +64,7 @@ m4_ifdef([PKG_PROG_PKG_CONFIG],[],[ - PKG_PROG_PKG_CONFIG() - - dnl LIB_DIR - library basename --LIB_DIR=`echo $libdir | $SED 's%.*/%%'` -+LIB_DIR=`echo $libdir | $SED 's%[[^/]*/[^/]]*/%%'` - AC_SUBST([LIB_DIR]) - - dnl Cache LDFLAGS so we can add EXTRA_LIB_PATH and restore it later - diff --git a/debian/patches/series b/debian/patches/series index 4611842eee3..72bb74c9716 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,4 +1,4 @@ -01_fix-libdir.patch +01_fix-installdir.patch 02_use-ieee-fp-on-s390-and-m68k.patch 03_optional-progs-and-install.patch 04_osmesa_version.diff diff --git a/debian/rules b/debian/rules index 688cb176612..b44468138af 100755 --- a/debian/rules +++ b/debian/rules @@ -52,7 +52,6 @@ QUILT_STAMPFN = $(STAMP_DIR)/patch include /usr/share/quilt/quilt.make confflags-common = --disable-glu --disable-glut --disable-glw \ - --libdir=/usr/lib \ CFLAGS="$(CFLAGS)" confflags-dri = --with-demos=xdemos \ @@ -91,14 +90,12 @@ confflags-osmesa32-static = --with-driver=osmesa --with-osmesa-bits=32 \ confflags-swx11+glu = --with-driver=xlib \ --with-demos= \ - --disable-glut \ - --libdir=/usr/lib + --disable-glut confflags-swx11+glu-static = --with-driver=xlib \ --enable-static \ --with-demos= \ - --disable-glut \ - --libdir=/usr/lib + --disable-glut confflags-swx11+glu-i386-i686 = --with-driver=xlib \ --with-demos= \ -- cgit v1.2.3 From 0261355a03315c23d8be903403877e6870601ce7 Mon Sep 17 00:00:00 2001 From: Timo Aaltonen Date: Fri, 4 Jul 2008 11:17:55 +0300 Subject: Fix confflags CFLAGS and clean up confflags-dri. --- debian/rules | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'debian') diff --git a/debian/rules b/debian/rules index b44468138af..d1efb8dbf75 100755 --- a/debian/rules +++ b/debian/rules @@ -57,9 +57,8 @@ confflags-common = --disable-glu --disable-glut --disable-glw \ confflags-dri = --with-demos=xdemos \ --libdir=/usr/lib/glx \ --with-dri-driverdir=/usr/lib/dri \ - --disable-glu --disable-glut --disable-glw \ --enable-glx-tls \ - CFLAGS="$(CFLAGS)" + $(confflags-common) confflags-osmesa = --with-driver=osmesa \ --with-demos= \ @@ -90,12 +89,14 @@ confflags-osmesa32-static = --with-driver=osmesa --with-osmesa-bits=32 \ confflags-swx11+glu = --with-driver=xlib \ --with-demos= \ - --disable-glut + --disable-glut \ + CFLAGS="$(CFLAGS)" confflags-swx11+glu-static = --with-driver=xlib \ --enable-static \ --with-demos= \ - --disable-glut + --disable-glut \ + CFLAGS="$(CFLAGS)" confflags-swx11+glu-i386-i686 = --with-driver=xlib \ --with-demos= \ -- cgit v1.2.3 From 4b9b01f0a564b70e01f220081e68aa80893fbb6b Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Sat, 5 Jul 2008 12:59:14 +0200 Subject: Use --with-driver=dri for the dri config the default is xlib on some architectures and dri on others, so we need to set that explicitly --- debian/rules | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'debian') diff --git a/debian/rules b/debian/rules index d1efb8dbf75..8a71a8295df 100755 --- a/debian/rules +++ b/debian/rules @@ -54,11 +54,13 @@ include /usr/share/quilt/quilt.make confflags-common = --disable-glu --disable-glut --disable-glw \ CFLAGS="$(CFLAGS)" -confflags-dri = --with-demos=xdemos \ - --libdir=/usr/lib/glx \ - --with-dri-driverdir=/usr/lib/dri \ - --enable-glx-tls \ - $(confflags-common) +confflags-dri = \ + --with-driver=dri \ + --with-demos=xdemos \ + --libdir=/usr/lib/glx \ + --with-dri-driverdir=/usr/lib/dri \ + --enable-glx-tls \ + $(confflags-common) confflags-osmesa = --with-driver=osmesa \ --with-demos= \ -- cgit v1.2.3 From 46ffb3c0b1b493fd33d552771e0dee89939569fb Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Sat, 5 Jul 2008 13:58:30 +0200 Subject: debian/rules cleanup and fixes * tell configure which dri drivers we want to build, based on the old configs/debian-dri-default * disable direct rendering for the glx libGL on the hurd * make sure patches are applied before we run autoreconf, and autoreconf runs before all builds --- debian/rules | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) (limited to 'debian') diff --git a/debian/rules b/debian/rules index 8a71a8295df..0c716df4423 100755 --- a/debian/rules +++ b/debian/rules @@ -16,8 +16,11 @@ ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) 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_GNU_CPU ?= $(shell dpkg-architecture -qDEB_HOST_GNU_CPU) DEB_BUILD_DIR ?= $(CURDIR)/obj-$(DEB_BUILD_GNU_TYPE) ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE)) confflags += --build=$(DEB_HOST_GNU_TYPE) @@ -28,9 +31,6 @@ endif export DEB_BUILD_ARCH # choose which configurations to build -SWX11_GLU_CONFIGS = -DRI_CONFIGS = - include debian/scripts/choose-configs # build the following configurations by default @@ -54,12 +54,32 @@ include /usr/share/quilt/quilt.make confflags-common = --disable-glu --disable-glut --disable-glw \ CFLAGS="$(CFLAGS)" +DRI_DRIVERS = swrast + +# hurd doesn't do direct rendering +ifeq ($(DEB_HOST_ARCH_OS), hurd) + DIRECT_RENDERING = --disable-driglx-direct +else + DIRECT_RENDERING = --enable-driglx-direct + DRI_DRIVERS += mach64 mga r128 r200 r300 radeon s3v savage tdfx trident +endif + +ifeq ($(DEB_HOST_GNU_CPU), i486) + DRI_DRIVERS += i810 i915 i965 sis unichrome +else ifeq ($(DEB_HOST_GNU_CPU), x86_64) + DRI_DRIVERS += i915 i965 sis unichrome +else ifeq ($(DEB_HOST_ARCH), sparc) + DRI_DRIVERS += ffb +endif + confflags-dri = \ --with-driver=dri \ + --with-dri-drivers="$(DRI_DRIVERS)" \ --with-demos=xdemos \ --libdir=/usr/lib/glx \ --with-dri-driverdir=/usr/lib/dri \ --enable-glx-tls \ + $(DIRECT_RENDERING) \ $(confflags-common) confflags-osmesa = --with-driver=osmesa \ @@ -106,7 +126,7 @@ confflags-swx11+glu-i386-i686 = --with-driver=xlib \ --libdir=/usr/lib/i686/cmov \ CFLAGS="$(CFLAGS) -march=i686" -autoreconf: +configure: $(QUILT_STAMPFN) configure.ac autoreconf -vfi # list the configurations that will built @@ -119,9 +139,9 @@ $(STAMP_DIR): $(QUILT_STAMPFN): $(STAMP_DIR) -build: patch autoreconf $(BUILD_STAMPS) +build: configs $(BUILD_STAMPS) -$(STAMP)-build-%: +$(STAMP)-build-%: configure dh_testdir mkdir -p $(DEB_BUILD_DIR)/$* -- cgit v1.2.3 From dabd09f5a92e5497ac6ac9b4ba26f806ddb25206 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Sun, 6 Jul 2008 14:03:58 +0200 Subject: some more debian/rules adjustments build the software libGL with --disable-gl-osmesa, and try to fix some rules dependencies --- debian/rules | 115 ++++++++++++++++++++++++++++++++++------------------------- 1 file changed, 67 insertions(+), 48 deletions(-) (limited to 'debian') diff --git a/debian/rules b/debian/rules index 0c716df4423..f7a35d2f044 100755 --- a/debian/rules +++ b/debian/rules @@ -51,8 +51,11 @@ ARCH_INSTALL_STAMPS = $(addprefix $(STAMP)-install-, $(CONFIGS)) QUILT_STAMPFN = $(STAMP_DIR)/patch include /usr/share/quilt/quilt.make -confflags-common = --disable-glu --disable-glut --disable-glw \ - CFLAGS="$(CFLAGS)" +confflags-common = \ + --disable-glu \ + --disable-glut \ + --disable-glw \ + CFLAGS="$(CFLAGS)" DRI_DRIVERS = swrast @@ -82,49 +85,65 @@ confflags-dri = \ $(DIRECT_RENDERING) \ $(confflags-common) -confflags-osmesa = --with-driver=osmesa \ - --with-demos= \ - $(confflags-common) - -confflags-osmesa-static = --with-driver=osmesa \ - --enable-static \ - --with-demos= \ - $(confflags-common) - -confflags-osmesa16 = --with-driver=osmesa --with-osmesa-bits=16 \ - --with-demos= \ - $(confflags-common) - -confflags-osmesa16-static = --with-driver=osmesa --with-osmesa-bits=16 \ - --enable-static \ - --with-demos= \ - $(confflags-common) - -confflags-osmesa32 = --with-driver=osmesa --with-osmesa-bits=32 \ - --with-demos= \ - $(confflags-common) - -confflags-osmesa32-static = --with-driver=osmesa --with-osmesa-bits=32 \ - --enable-static \ - --with-demos= \ - $(confflags-common) - -confflags-swx11+glu = --with-driver=xlib \ - --with-demos= \ - --disable-glut \ - CFLAGS="$(CFLAGS)" - -confflags-swx11+glu-static = --with-driver=xlib \ - --enable-static \ - --with-demos= \ - --disable-glut \ - CFLAGS="$(CFLAGS)" - -confflags-swx11+glu-i386-i686 = --with-driver=xlib \ - --with-demos= \ - --disable-glut \ - --libdir=/usr/lib/i686/cmov \ - CFLAGS="$(CFLAGS) -march=i686" +confflags-osmesa = \ + --with-driver=osmesa \ + --with-demos= \ + $(confflags-common) + +confflags-osmesa-static = \ + --with-driver=osmesa \ + --enable-static \ + --with-demos= \ + $(confflags-common) + +confflags-osmesa16 = \ + --with-driver=osmesa \ + --with-osmesa-bits=16 \ + --with-demos= \ + $(confflags-common) + +confflags-osmesa16-static = \ + --with-driver=osmesa \ + --with-osmesa-bits=16 \ + --enable-static \ + --with-demos= \ + $(confflags-common) + +confflags-osmesa32 = \ + --with-driver=osmesa \ + --with-osmesa-bits=32 \ + --with-demos= \ + $(confflags-common) + +confflags-osmesa32-static = \ + --with-driver=osmesa \ + --with-osmesa-bits=32 \ + --enable-static \ + --with-demos= \ + $(confflags-common) + +confflags-swx11+glu = \ + --with-driver=xlib \ + --disable-gl-osmesa \ + --with-demos= \ + --disable-glut \ + CFLAGS="$(CFLAGS)" + +confflags-swx11+glu-static = \ + --with-driver=xlib \ + --disable-gl-osmesa \ + --enable-static \ + --with-demos= \ + --disable-glut \ + CFLAGS="$(CFLAGS)" + +confflags-swx11+glu-i386-i686 = \ + --with-driver=xlib \ + --disable-gl-osmesa \ + --with-demos= \ + --disable-glut \ + --libdir=/usr/lib/i686/cmov \ + CFLAGS="$(CFLAGS) -march=i686" configure: $(QUILT_STAMPFN) configure.ac autoreconf -vfi @@ -139,7 +158,7 @@ $(STAMP_DIR): $(QUILT_STAMPFN): $(STAMP_DIR) -build: configs $(BUILD_STAMPS) +build: $(BUILD_STAMPS) $(STAMP)-build-%: configure dh_testdir @@ -159,7 +178,7 @@ pre-install: dh_testdir dh_testroot dh_clean -k - rm -rf $(INSTALL_STAMPS) + rm -rf $(ARCH_INSTALL_STAMPS) install: pre-install $(ARCH_INSTALL_STAMPS) @@ -188,7 +207,7 @@ clean: unpatch dh_clean # Build architecture-independent files here. -binary-indep: build install +binary-indep: install dh_testdir dh_testroot dh_installchangelogs -i -- cgit v1.2.3 From b04ccc9a03e21837c0d0e21d0895222435c25653 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Tue, 8 Jul 2008 18:18:56 +0200 Subject: Disable the i915tex driver, it doesn't build against libdrm 2.3.1. --- configs/debian-dri-default | 2 +- debian/changelog | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'debian') diff --git a/configs/debian-dri-default b/configs/debian-dri-default index f92c7eddd01..2a01bf8b7e3 100644 --- a/configs/debian-dri-default +++ b/configs/debian-dri-default @@ -23,7 +23,7 @@ DRI_DIRS = mach64 mga r128 r200 r300 radeon s3v savage tdfx trident ARCH_X86 = i386 amd64 ifneq ($(findstring $(DEB_BUILD_ARCH), $(ARCH_X86)),) - DRI_DIRS += i810 i915 i915tex i965 sis unichrome + DRI_DIRS += i810 i915 i965 sis unichrome endif ifeq ($(DEB_BUILD_ARCH), sparc) diff --git a/debian/changelog b/debian/changelog index 33f644a8d2e..20ff8d3b44a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +mesa (7.0.3-5) UNRELEASED; urgency=low + + * Disable the i915tex driver, it doesn't build against libdrm 2.3.1. + + -- Julien Cristau Tue, 08 Jul 2008 18:16:24 +0200 + mesa (7.0.3-4) unstable; urgency=low * Pull from mesa_7_0_branch (2ac4919d). -- cgit v1.2.3 From 34eedc6a9839e6dd551659a7990f5e28161df1e1 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Sat, 12 Jul 2008 18:55:55 +0200 Subject: update changelog --- debian/changelog | 1 + 1 file changed, 1 insertion(+) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 20ff8d3b44a..7c8d4de3a41 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,7 @@ mesa (7.0.3-5) UNRELEASED; urgency=low * Disable the i915tex driver, it doesn't build against libdrm 2.3.1. + * Pull from mesa_7_0_branch (27425708). -- Julien Cristau Tue, 08 Jul 2008 18:16:24 +0200 -- cgit v1.2.3 From e325b764447ffd05e6a052f0aeb33d7dba62e357 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Sat, 12 Jul 2008 18:56:22 +0200 Subject: Prepare changelog for upload --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 7c8d4de3a41..af221845148 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,9 @@ -mesa (7.0.3-5) UNRELEASED; urgency=low +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 Tue, 08 Jul 2008 18:16:24 +0200 + -- Julien Cristau Sat, 12 Jul 2008 18:56:19 +0200 mesa (7.0.3-4) unstable; urgency=low -- cgit v1.2.3 From 868d0accef457f4d5d9e58ea44c54c3402cd4b2c Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Sun, 13 Jul 2008 19:36:56 +0200 Subject: update changelog and patches 01_fix-installdir.patch dropped, applied upstream 04_osmesa_version.diff needed fixing --- debian/changelog | 8 +- debian/patches/01_fix-installdir.patch | 380 --------------------------------- debian/patches/04_osmesa_version.diff | 27 +-- debian/patches/series | 1 - 4 files changed, 17 insertions(+), 399 deletions(-) delete mode 100644 debian/patches/01_fix-installdir.patch (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 06fa56eb687..d82a4c0a73b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,7 +1,7 @@ -mesa (7.1~rc1-1) UNRELEASED; urgency=low +mesa (7.1~rc3-1) UNRELEASED; urgency=low [ Julien Cristau ] - * New upstream release candidate. + * 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. @@ -16,12 +16,10 @@ mesa (7.1~rc1-1) UNRELEASED; urgency=low * rules: Replace the old build system with the new autotools-based system. * Run autoreconf before building the various flavours.. - * 01_fix-installdir.patch: installdir handling was broken, this patch - from upstream fixes it. * Add automake & autoconf to build-deps. * Use --enable-glx-tls for dri. - -- Timo Aaltonen Fri, 04 Jul 2008 10:59:12 +0300 + -- Julien Cristau Sun, 13 Jul 2008 19:22:21 +0200 mesa (7.0.3-4) unstable; urgency=low diff --git a/debian/patches/01_fix-installdir.patch b/debian/patches/01_fix-installdir.patch deleted file mode 100644 index 2148a7ba850..00000000000 --- a/debian/patches/01_fix-installdir.patch +++ /dev/null @@ -1,380 +0,0 @@ -From 410195da3cddb0e4f0a4d31a25732f00c264af51 Mon Sep 17 00:00:00 2001 -From: Dan Nicholson -Date: Thu, 3 Jul 2008 09:17:44 -0700 -Subject: [PATCH] Set library and header installation directories from configuration - -Currently the installation directories for libraries and headers are -resolved within the install commands. For instance, the libraries will -be installed to $(INSTALL_DIR)/$(LIB_DIR). This limits the flexibility -of the installation, such as when the libraries should be installed to a -subdirectory like /usr/lib/tls. - -This adds the make variables $(INSTALL_LIB_DIR) and $(INSTALL_INC_DIR) -to define the locations that the libraries and headers are installed. -For the static configs, this resolves exactly as before to -$(INSTALL_DIR)/include and $(INSTALL_DIR)/$(LIB_DIR). For autoconf, they -are derived directly from the --libdir and --includedir settings. ---- - configs/autoconf.in | 3 +++ - configs/default | 4 +++- - configure.ac | 1 + - src/glu/Makefile | 11 ++++++----- - src/glu/glu.pc.in | 4 ++-- - src/glut/fbdev/Makefile | 8 ++++---- - src/glut/glx/Makefile | 15 ++++++++------- - src/glut/glx/glut.pc.in | 4 ++-- - src/glut/mini/Makefile | 15 ++++++++------- - src/glut/mini/glut.pc.in | 4 ++-- - src/glw/Makefile | 15 ++++++++------- - src/glw/glw.pc.in | 4 ++-- - src/mesa/Makefile | 19 ++++++++++--------- - src/mesa/drivers/dri/Makefile | 15 +++++++++------ - src/mesa/drivers/dri/dri.pc.in | 4 ++-- - src/mesa/gl.pc.in | 4 ++-- - 16 files changed, 72 insertions(+), 58 deletions(-) - -diff --git a/configs/autoconf.in b/configs/autoconf.in -index ed44a0f..21d224f 100644 ---- a/configs/autoconf.in -+++ b/configs/autoconf.in -@@ -89,9 +89,12 @@ EXPAT_INCLUDES = @EXPAT_INCLUDES@ - prefix = @prefix@ - exec_prefix = @exec_prefix@ - libdir = @libdir@ -+includedir = @includedir@ - - # Installation directories (for make install) - INSTALL_DIR = $(prefix) -+INSTALL_LIB_DIR = $(libdir) -+INSTALL_INC_DIR = $(includedir) - - # DRI installation directories - DRI_DRIVER_INSTALL_DIR = @DRI_DRIVER_INSTALL_DIR@ -diff --git a/configs/default b/configs/default -index 37b6939..d5b40c5 100644 ---- a/configs/default -+++ b/configs/default -@@ -84,7 +84,9 @@ APP_LIB_DEPS = -lm - - # Installation directories (for make install) - INSTALL_DIR = /usr/local --DRI_DRIVER_INSTALL_DIR = $(INSTALL_DIR)/$(LIB_DIR)/dri -+INSTALL_LIB_DIR = $(INSTALL_DIR)/$(LIB_DIR) -+INSTALL_INC_DIR = $(INSTALL_DIR)/include -+DRI_DRIVER_INSTALL_DIR = $(INSTALL_LIB_DIR)/dri - - # Where libGL will look for DRI hardware drivers - DRI_DRIVER_SEARCH_DIR = $(DRI_DRIVER_INSTALL_DIR) -diff --git a/configure.ac b/configure.ac -index f15d9ff..961a60c 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -994,6 +994,7 @@ echo "" - echo " prefix: $prefix" - echo " exec_prefix: $exec_prefix" - echo " libdir: $libdir" -+echo " includedir: $includedir" - - dnl Driver info - echo "" -diff --git a/src/glu/Makefile b/src/glu/Makefile -index 23161b5..fe19fd1 100644 ---- a/src/glu/Makefile -+++ b/src/glu/Makefile -@@ -16,16 +16,17 @@ default: $(TOP)/configs/current - # GLU pkg-config file - pcedit = sed \ - -e 's,@INSTALL_DIR@,$(INSTALL_DIR),' \ -- -e 's,@LIB_DIR@,$(LIB_DIR),' \ -+ -e 's,@INSTALL_LIB_DIR@,$(INSTALL_LIB_DIR),' \ -+ -e 's,@INSTALL_INC_DIR@,$(INSTALL_INC_DIR),' \ - -e 's,@VERSION@,$(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY),' - glu.pc: glu.pc.in - $(pcedit) $< > $@ - - install: glu.pc -- $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR) -- $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)/pkgconfig -- $(INSTALL) $(TOP)/$(LIB_DIR)/libGLU.* $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR) -- $(INSTALL) -m 644 glu.pc $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)/pkgconfig -+ $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR) -+ $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig -+ $(INSTALL) $(TOP)/$(LIB_DIR)/libGLU.* $(DESTDIR)$(INSTALL_LIB_DIR) -+ $(INSTALL) -m 644 glu.pc $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig - - clean: - -@for dir in $(SUBDIRS) ; do \ -diff --git a/src/glu/glu.pc.in b/src/glu/glu.pc.in -index 5d6e52a..8606b9b 100644 ---- a/src/glu/glu.pc.in -+++ b/src/glu/glu.pc.in -@@ -1,7 +1,7 @@ - prefix=@INSTALL_DIR@ - exec_prefix=${prefix} --libdir=${exec_prefix}/@LIB_DIR@ --includedir=${prefix}/include -+libdir=@INSTALL_LIB_DIR@ -+includedir=@INSTALL_INC_DIR@ - - Name: glu - Description: Mesa OpenGL Utility library -diff --git a/src/glut/fbdev/Makefile b/src/glut/fbdev/Makefile -index 95893b7..ff74a28 100644 ---- a/src/glut/fbdev/Makefile -+++ b/src/glut/fbdev/Makefile -@@ -69,10 +69,10 @@ $(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME): depend $(OBJECTS) - $(MKLIB_OPTIONS) $(OBJECTS) - - install: -- $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/include/GL -- $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR) -- $(INSTALL) -m 644 $(TOP)/include/GL/glut.h $(DESTDIR)$(INSTALL_DIR)/include/GL -- $(INSTALL) $(TOP)/$(LIB_DIR)/libglut* $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR) -+ $(INSTALL) -d $(DESTDIR)$(INSTALL_INC_DIR)/GL -+ $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR) -+ $(INSTALL) -m 644 $(TOP)/include/GL/glut.h $(DESTDIR)$(INSTALL_INC_DIR)/GL -+ $(INSTALL) $(TOP)/$(LIB_DIR)/libglut* $(DESTDIR)$(INSTALL_LIB_DIR) - - # Run 'make -f Makefile.solo dep' to update the dependencies if you change - # what's included by any source file. -diff --git a/src/glut/glx/Makefile b/src/glut/glx/Makefile -index 674d5a5..819dfd2 100644 ---- a/src/glut/glx/Makefile -+++ b/src/glut/glx/Makefile -@@ -100,18 +100,19 @@ $(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME): depend $(OBJECTS) - # glut pkgconfig file - pcedit = sed \ - -e 's,@INSTALL_DIR@,$(INSTALL_DIR),' \ -- -e 's,@LIB_DIR@,$(LIB_DIR),' \ -+ -e 's,@INSTALL_LIB_DIR@,$(INSTALL_LIB_DIR),' \ -+ -e 's,@INSTALL_INC_DIR@,$(INSTALL_INC_DIR),' \ - -e 's,@VERSION@,$(GLUT_MAJOR).$(GLUT_MINOR).$(GLUT_TINY),' - glut.pc: glut.pc.in - $(pcedit) $< > $@ - - install: glut.pc -- $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/include/GL -- $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR) -- $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)/pkgconfig -- $(INSTALL) -m 644 $(TOP)/include/GL/glut.h $(DESTDIR)$(INSTALL_DIR)/include/GL -- $(INSTALL) $(TOP)/$(LIB_DIR)/libglut* $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR) -- $(INSTALL) -m 644 glut.pc $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)/pkgconfig -+ $(INSTALL) -d $(DESTDIR)$(INSTALL_INC_DIR)/GL -+ $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR) -+ $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig -+ $(INSTALL) -m 644 $(TOP)/include/GL/glut.h $(DESTDIR)$(INSTALL_INC_DIR)/GL -+ $(INSTALL) $(TOP)/$(LIB_DIR)/libglut* $(DESTDIR)$(INSTALL_LIB_DIR) -+ $(INSTALL) -m 644 glut.pc $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig - - - clean: -diff --git a/src/glut/glx/glut.pc.in b/src/glut/glx/glut.pc.in -index f732f29..e8638fe 100644 ---- a/src/glut/glx/glut.pc.in -+++ b/src/glut/glx/glut.pc.in -@@ -1,7 +1,7 @@ - prefix=@INSTALL_DIR@ - exec_prefix=${prefix} --libdir=${exec_prefix}/@LIB_DIR@ --includedir=${prefix}/include -+libdir=@INSTALL_LIB_DIR@ -+includedir=@INSTALL_INC_DIR@ - - Name: glut - Description: Mesa OpenGL Utility Toolkit library -diff --git a/src/glut/mini/Makefile b/src/glut/mini/Makefile -index d386050..6aba2af 100644 ---- a/src/glut/mini/Makefile -+++ b/src/glut/mini/Makefile -@@ -75,18 +75,19 @@ tags: - # glut pkgconfig file - pcedit = sed \ - -e 's,@INSTALL_DIR@,$(INSTALL_DIR),' \ -- -e 's,@LIB_DIR@,$(LIB_DIR),' \ -+ -e 's,@INSTALL_LIB_DIR@,$(INSTALL_LIB_DIR),' \ -+ -e 's,@INSTALL_INC_DIR@,$(INSTALL_INC_DIR),' \ - -e 's,@VERSION@,$(GLUT_MAJOR).$(GLUT_MINOR).$(GLUT_TINY),' - glut.pc: glut.pc.in - $(pcedit) $< > $@ - - install: glut.pc -- $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/include/GL -- $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR) -- $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)/pkgconfig -- $(INSTALL) -m 644 $(TOP)/include/GL/glut.h $(DESTDIR)$(INSTALL_DIR)/include/GL -- $(INSTALL) $(TOP)/$(LIB_DIR)/libglut* $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR) -- $(INSTALL) -m 644 glut.pc $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)/pkgconfig -+ $(INSTALL) -d $(DESTDIR)$(INSTALL_INC_DIR)/GL -+ $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR) -+ $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig -+ $(INSTALL) -m 644 $(TOP)/include/GL/glut.h $(DESTDIR)$(INSTALL_INC_DIR)/GL -+ $(INSTALL) $(TOP)/$(LIB_DIR)/libglut* $(DESTDIR)$(INSTALL_LIB_DIR) -+ $(INSTALL) -m 644 glut.pc $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig - - - # Remove .o and backup files -diff --git a/src/glut/mini/glut.pc.in b/src/glut/mini/glut.pc.in -index f732f29..e8638fe 100644 ---- a/src/glut/mini/glut.pc.in -+++ b/src/glut/mini/glut.pc.in -@@ -1,7 +1,7 @@ - prefix=@INSTALL_DIR@ - exec_prefix=${prefix} --libdir=${exec_prefix}/@LIB_DIR@ --includedir=${prefix}/include -+libdir=@INSTALL_LIB_DIR@ -+includedir=@INSTALL_INC_DIR@ - - Name: glut - Description: Mesa OpenGL Utility Toolkit library -diff --git a/src/glw/Makefile b/src/glw/Makefile -index 88bf99d..f0dd1ac 100644 ---- a/src/glw/Makefile -+++ b/src/glw/Makefile -@@ -28,18 +28,19 @@ default: $(TOP)/$(LIB_DIR)/$(GLW_LIB_NAME) - # GLU pkg-config file - pcedit = sed \ - -e 's,@INSTALL_DIR@,$(INSTALL_DIR),' \ -- -e 's,@LIB_DIR@,$(LIB_DIR),' \ -+ -e 's,@INSTALL_LIB_DIR@,$(INSTALL_LIB_DIR),' \ -+ -e 's,@INSTALL_INC_DIR@,$(INSTALL_INC_DIR),' \ - -e 's,@VERSION@,$(MAJOR).$(MINOR).$(TINY),' - glw.pc: glw.pc.in - $(pcedit) $< > $@ - - install: glw.pc -- $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/include/GL -- $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR) -- $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)/pkgconfig -- $(INSTALL) -m 644 *.h $(DESTDIR)$(INSTALL_DIR)/include/GL -- $(INSTALL) $(TOP)/$(LIB_DIR)/libGLw.* $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR) -- $(INSTALL) -m 644 glw.pc $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)/pkgconfig -+ $(INSTALL) -d $(DESTDIR)$(INSTALL_INC_DIR)/GL -+ $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR) -+ $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig -+ $(INSTALL) -m 644 *.h $(DESTDIR)$(INSTALL_INC_DIR)/GL -+ $(INSTALL) $(TOP)/$(LIB_DIR)/libGLw.* $(DESTDIR)$(INSTALL_LIB_DIR) -+ $(INSTALL) -m 644 glw.pc $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig - - clean: - -rm -f depend depend.bak -diff --git a/src/glw/glw.pc.in b/src/glw/glw.pc.in -index 9c2682f..25f3f73 100644 ---- a/src/glw/glw.pc.in -+++ b/src/glw/glw.pc.in -@@ -1,7 +1,7 @@ - prefix=@INSTALL_DIR@ - exec_prefix=${prefix} --libdir=${exec_prefix}/@LIB_DIR@ --includedir=${prefix}/include -+libdir=@INSTALL_LIB_DIR@ -+includedir=@INSTALL_INC_DIR@ - - Name: glw - Description: Mesa OpenGL widget library -diff --git a/src/mesa/Makefile b/src/mesa/Makefile -index e0b641b..3827ffb 100644 ---- a/src/mesa/Makefile -+++ b/src/mesa/Makefile -@@ -90,28 +90,29 @@ install: default - - pcedit = sed \ - -e 's,@INSTALL_DIR@,$(INSTALL_DIR),' \ -- -e 's,@LIB_DIR@,$(LIB_DIR),' \ -+ -e 's,@INSTALL_LIB_DIR@,$(INSTALL_LIB_DIR),' \ -+ -e 's,@INSTALL_INC_DIR@,$(INSTALL_INC_DIR),' \ - -e 's,@VERSION@,$(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY),' - - gl.pc: gl.pc.in - $(pcedit) $< > $@ - - install-headers: -- $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/include/GL -+ $(INSTALL) -d $(DESTDIR)$(INSTALL_INC_DIR)/GL - $(INSTALL) -m 644 $(TOP)/include/GL/*.h \ -- $(DESTDIR)$(INSTALL_DIR)/include/GL -+ $(DESTDIR)$(INSTALL_INC_DIR)/GL - - install-libgl: default gl.pc install-headers -- $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR) -- $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)/pkgconfig -+ $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR) -+ $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig - $(INSTALL) $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME)* \ -- $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR) -- $(INSTALL) -m 644 gl.pc $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)/pkgconfig -+ $(DESTDIR)$(INSTALL_LIB_DIR) -+ $(INSTALL) -m 644 gl.pc $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig - - install-osmesa: default -- $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR) -+ $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR) - $(INSTALL) $(TOP)/$(LIB_DIR)/$(OSMESA_LIB_NAME)* \ -- $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR) -+ $(DESTDIR)$(INSTALL_LIB_DIR) - - install-dri: default - cd drivers/dri && $(MAKE) install -diff --git a/src/mesa/drivers/dri/Makefile b/src/mesa/drivers/dri/Makefile -index 3f87782..96118e0 100644 ---- a/src/mesa/drivers/dri/Makefile -+++ b/src/mesa/drivers/dri/Makefile -@@ -22,7 +22,8 @@ subdirs: - - pcedit = sed \ - -e 's,@INSTALL_DIR@,$(INSTALL_DIR),' \ -- -e 's,@LIB_DIR@,$(LIB_DIR),' \ -+ -e 's,@INSTALL_LIB_DIR@,$(INSTALL_LIB_DIR),' \ -+ -e 's,@INSTALL_INC_DIR@,$(INSTALL_INC_DIR),' \ - -e 's,@VERSION@,$(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY),' \ - -e 's,@DRI_DRIVER_DIR@,$(DRI_DRIVER_SEARCH_DIR),' - -@@ -36,11 +37,13 @@ install: dri.pc - (cd $$dir && $(MAKE) install) || exit 1 ; \ - fi \ - done -- $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/include/GL/internal -- $(INSTALL) -m 0644 $(TOP)/include/GL/internal/dri_interface.h $(DESTDIR)$(INSTALL_DIR)/include/GL/internal -- $(INSTALL) -m 0644 $(TOP)/include/GL/internal/dri_sarea.h $(DESTDIR)$(INSTALL_DIR)/include/GL/internal -- $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)/pkgconfig -- $(INSTALL) -m 0644 dri.pc $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)/pkgconfig -+ $(INSTALL) -d $(DESTDIR)$(INSTALL_INC_DIR)/GL/internal -+ $(INSTALL) -m 0644 $(TOP)/include/GL/internal/dri_interface.h \ -+ $(DESTDIR)$(INSTALL_INC_DIR)/GL/internal -+ $(INSTALL) -m 0644 $(TOP)/include/GL/internal/dri_sarea.h \ -+ $(DESTDIR)$(INSTALL_INC_DIR)/GL/internal -+ $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig -+ $(INSTALL) -m 0644 dri.pc $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig - - - clean: -diff --git a/src/mesa/drivers/dri/dri.pc.in b/src/mesa/drivers/dri/dri.pc.in -index 58d890d..c47ee9c 100644 ---- a/src/mesa/drivers/dri/dri.pc.in -+++ b/src/mesa/drivers/dri/dri.pc.in -@@ -1,7 +1,7 @@ - prefix=@INSTALL_DIR@ - exec_prefix=${prefix} --libdir=${exec_prefix}/@LIB_DIR@ --includedir=${prefix}/include -+libdir=@INSTALL_LIB_DIR@ -+includedir=@INSTALL_INC_DIR@ - dridriverdir=@DRI_DRIVER_DIR@ - - Name: dri -diff --git a/src/mesa/gl.pc.in b/src/mesa/gl.pc.in -index 4b144ff..1927880 100644 ---- a/src/mesa/gl.pc.in -+++ b/src/mesa/gl.pc.in -@@ -1,7 +1,7 @@ - prefix=@INSTALL_DIR@ - exec_prefix=${prefix} --libdir=${exec_prefix}/@LIB_DIR@ --includedir=${prefix}/include -+libdir=@INSTALL_LIB_DIR@ -+includedir=@INSTALL_INC_DIR@ - - Name: gl - Description: Mesa OpenGL library --- -1.5.3.2 diff --git a/debian/patches/04_osmesa_version.diff b/debian/patches/04_osmesa_version.diff index ba22b2f80d0..6cc11d17b0d 100644 --- a/debian/patches/04_osmesa_version.diff +++ b/debian/patches/04_osmesa_version.diff @@ -1,21 +1,22 @@ -diff -up mesa-20080612/src/mesa/drivers/osmesa/Makefile.osmesa mesa-20080612/src/mesa/drivers/osmesa/Makefile ---- mesa-20080612/src/mesa/drivers/osmesa/Makefile.osmesa 2008-06-12 12:17:27.000000000 +1000 -+++ mesa-20080612/src/mesa/drivers/osmesa/Makefile 2008-06-12 13:14:24.000000000 +1000 -@@ -47,7 +47,7 @@ osmesa8: $(TOP)/lib/$(OSMESA_LIB_NAME) +Index: mesa/src/mesa/drivers/osmesa/Makefile +=================================================================== +--- mesa.orig/src/mesa/drivers/osmesa/Makefile ++++ mesa/src/mesa/drivers/osmesa/Makefile +@@ -46,7 +46,7 @@ + $(TOP)/lib/$(OSMESA_LIB_NAME): $(OBJECTS) - $(TOP)/bin/mklib -o $(OSMESA_LIB) \ - -linker "$(CC)" \ + $(MKLIB) -o $(OSMESA_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \ - -major $(MESA_MAJOR) -minor $(MESA_MINOR) -patch $(MESA_TINY) \ + -major 6 -minor 5 -patch 3 \ - -install $(TOP)/$(LIB_DIR) \ - $(MKLIB_OPTIONS) \ + -install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) \ $(OSMESA_LIB_DEPS) $(OBJECTS) -@@ -60,7 +60,7 @@ $(TOP)/lib/$(OSMESA_LIB_NAME): $(OBJECTS + +@@ -57,7 +57,7 @@ + # with all the other Mesa sources (compiled with -DCHAN_BITS=16/32 osmesa16: $(OBJECTS) $(CORE_MESA) - $(TOP)/bin/mklib -o $(OSMESA_LIB) \ - -linker "$(CC)" \ + $(MKLIB) -o $(OSMESA_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \ - -major $(MESA_MAJOR) -minor $(MESA_MINOR) -patch $(MESA_TINY) \ + -major 6 -minor 5 -patch 3 \ - -install $(TOP)/$(LIB_DIR) \ - $(MKLIB_OPTIONS) \ + -install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) \ $(OSMESA_LIB_DEPS) $(OBJECTS) $(CORE_MESA) + diff --git a/debian/patches/series b/debian/patches/series index 72bb74c9716..86f17dca4fc 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,4 +1,3 @@ -01_fix-installdir.patch 02_use-ieee-fp-on-s390-and-m68k.patch 03_optional-progs-and-install.patch 04_osmesa_version.diff -- cgit v1.2.3 From a8dde163dc3032515cf18c33bca3cb223ef218b9 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Sun, 13 Jul 2008 19:42:01 +0200 Subject: Prepare changelog for upload --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index d82a4c0a73b..db5cdccc3e0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -mesa (7.1~rc3-1) UNRELEASED; urgency=low +mesa (7.1~rc3-1) experimental; urgency=low [ Julien Cristau ] * New upstream release candidate (updated to git commit 4fab47b1). @@ -19,7 +19,7 @@ mesa (7.1~rc3-1) UNRELEASED; urgency=low * Add automake & autoconf to build-deps. * Use --enable-glx-tls for dri. - -- Julien Cristau Sun, 13 Jul 2008 19:22:21 +0200 + -- Julien Cristau Sun, 13 Jul 2008 19:41:42 +0200 mesa (7.0.3-4) unstable; urgency=low -- cgit v1.2.3 From 332dcfb60b9153ce956b05ce24f0edfe1ed42ff3 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Mon, 4 Aug 2008 12:49:03 +0200 Subject: Add parallel build support. --- debian/changelog | 6 ++++++ debian/rules | 11 ++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index db5cdccc3e0..36585144db9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +mesa (7.1~rc3-2) UNRELEASED; urgency=low + + * Add parallel build support. + + -- Julien Cristau Mon, 04 Aug 2008 09:36:31 +0200 + mesa (7.1~rc3-1) experimental; urgency=low [ Julien Cristau ] diff --git a/debian/rules b/debian/rules index f7a35d2f044..370df33db96 100755 --- a/debian/rules +++ b/debian/rules @@ -6,13 +6,14 @@ #export DH_VERBOSE=1 CFLAGS = -Wall -g -ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) +ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS))) CFLAGS += -O0 else CFLAGS += -O2 endif -ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) - INSTALL_PROGRAM += -s +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) @@ -180,9 +181,9 @@ pre-install: dh_clean -k rm -rf $(ARCH_INSTALL_STAMPS) -install: pre-install $(ARCH_INSTALL_STAMPS) +install: $(ARCH_INSTALL_STAMPS) -$(STAMP)-install-%: $(STAMP)-build-% +$(STAMP)-install-%: $(STAMP)-build-% pre-install # Add here commands to install the package into debian/tmp dh_installdirs -- cgit v1.2.3 From ac8771ee997938a246ca68111e695f7d9a704c96 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Sun, 24 Aug 2008 17:38:03 +0200 Subject: Update changelog --- debian/changelog | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 36585144db9..651b033b671 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,9 @@ -mesa (7.1~rc3-2) UNRELEASED; urgency=low +mesa (7.1~rc4-1) UNRELEASED; urgency=low * Add parallel build support. + * New upstream release candidate (updated to git commit 7c81124d, which has + GEM reverted) + + libGLU now only exports its public interface (closes: #319388) -- Julien Cristau Mon, 04 Aug 2008 09:36:31 +0200 -- cgit v1.2.3 From f6a927b45f019d6c8b5fc8113d19ffc2a889e51e Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Wed, 27 Aug 2008 17:29:28 +0200 Subject: Update changelog --- debian/changelog | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 651b033b671..17adca10c9e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,7 @@ -mesa (7.1~rc4-1) UNRELEASED; urgency=low +mesa (7.1-1) UNRELEASED; urgency=low * Add parallel build support. - * New upstream release candidate (updated to git commit 7c81124d, which has - GEM reverted) + * New upstream development release + libGLU now only exports its public interface (closes: #319388) -- Julien Cristau Mon, 04 Aug 2008 09:36:31 +0200 -- cgit v1.2.3 From fd7cc514d29fef38c325f3bd6f3cae96c298a2e7 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Wed, 27 Aug 2008 19:16:33 +0200 Subject: Some more parallel build updates. --- debian/changelog | 1 + debian/rules | 25 +++++++++++-------------- 2 files changed, 12 insertions(+), 14 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 17adca10c9e..8108dca327a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,7 @@ mesa (7.1-1) UNRELEASED; 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 Mon, 04 Aug 2008 09:36:31 +0200 diff --git a/debian/rules b/debian/rules index 370df33db96..84c0553d749 100755 --- a/debian/rules +++ b/debian/rules @@ -47,7 +47,7 @@ CONFIGS = $(SWX11_GLU_CONFIGS) \ STAMP_DIR = debian/stamp STAMP = $(STAMP_DIR)/$(DEB_BUILD_GNU_TYPE) BUILD_STAMPS = $(addprefix $(STAMP)-build-, $(CONFIGS)) -ARCH_INSTALL_STAMPS = $(addprefix $(STAMP)-install-, $(CONFIGS)) +INSTALL_TARGETS = $(addprefix install-, $(CONFIGS)) QUILT_STAMPFN = $(STAMP_DIR)/patch include /usr/share/quilt/quilt.make @@ -153,11 +153,12 @@ configure: $(QUILT_STAMPFN) configure.ac configs: @echo Building the following configurations: $(CONFIGS) -$(STAMP_DIR): +$(STAMP_DIR)/stamp: dh_testdir - mkdir -p $@ + mkdir -p $(STAMP_DIR) + >$@ -$(QUILT_STAMPFN): $(STAMP_DIR) +$(QUILT_STAMPFN): $(STAMP_DIR)/stamp build: $(BUILD_STAMPS) @@ -175,20 +176,16 @@ $(STAMP)-build-%: configure touch $@ -pre-install: +install: + # Add here commands to install the package into debian/tmp dh_testdir dh_testroot dh_clean -k - rm -rf $(ARCH_INSTALL_STAMPS) - -install: $(ARCH_INSTALL_STAMPS) - -$(STAMP)-install-%: $(STAMP)-build-% pre-install - # Add here commands to install the package into debian/tmp dh_installdirs - + $(MAKE) -f debian/rules $(INSTALL_TARGETS) + +install-%: $(STAMP)-build-% cd $(DEB_BUILD_DIR)/$* && $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install - touch $@ clean: unpatch dh_testdir @@ -225,7 +222,7 @@ binary-indep: install dh_builddeb -i # Build architecture-dependent files here. -binary-arch: build install +binary-arch: install dh_testdir dh_testroot dh_installchangelogs -s -- cgit v1.2.3 From f9affb3059a845e7a19a774d64016ceb54f5936a Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Wed, 27 Aug 2008 19:52:30 +0200 Subject: Prepare changelog for upload --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 8108dca327a..dbea6b0187a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,11 +1,11 @@ -mesa (7.1-1) UNRELEASED; urgency=low +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 Mon, 04 Aug 2008 09:36:31 +0200 + -- Julien Cristau Wed, 27 Aug 2008 19:52:24 +0200 mesa (7.1~rc3-1) experimental; urgency=low -- cgit v1.2.3 From 5cd892a4e44ad840e08f075ef1df421d1b25b015 Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Thu, 11 Sep 2008 19:13:46 +0200 Subject: Fix grammar and punctuation in glxinfo(1) --- debian/changelog | 7 +++++++ debian/glxinfo.1 | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index dbea6b0187a..c875cd61219 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +mesa (7.1-2) UNRELEASED; urgency=low + + * Fix grammar and punctuation in glxinfo(1), thanks Sam Hocevar, + closes: #498595. + + -- Brice Goglin Thu, 11 Sep 2008 19:12:45 +0200 + mesa (7.1-1) experimental; urgency=low * Add parallel build support. diff --git a/debian/glxinfo.1 b/debian/glxinfo.1 index 9cce83dd74a..7a3732e17e0 100644 --- a/debian/glxinfo.1 +++ b/debian/glxinfo.1 @@ -29,7 +29,7 @@ Print usage information. Force an indirect rendering context. .TP 8 .B \-b -Find the ``best'' visual and print it's number. +Find the "best" visual and print its number. .TP 8 .B \-l Print interesting OpenGL limits. -- cgit v1.2.3 From 7959b95efa7e451e938b3a04074f034102be095c Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Fri, 19 Sep 2008 18:03:59 +0200 Subject: 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 --- debian/changelog | 8 ++ debian/copyright | 299 +++++-------------------------------------------------- 2 files changed, 32 insertions(+), 275 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index af221845148..ee2978797fb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +mesa (7.0.3-6) UNRELEASED; urgency=low + + * 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 Fri, 19 Sep 2008 18:02:55 +0200 + mesa (7.0.3-5) unstable; urgency=low * Disable the i915tex driver, it doesn't build against libdrm 2.3.1. diff --git a/debian/copyright b/debian/copyright index 03ac1d5b8c6..d38eb4be649 100644 --- a/debian/copyright +++ b/debian/copyright @@ -65,283 +65,32 @@ License: 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 1.1 [02/22/2000]) - -1. Definitions. - -1.1. "Additional Notice Provisions" means such additional provisions as - appear in the Notice in Original Code under the heading "Additional - Notice Provisions." - -1.2. "Covered Code" means the Original Code or Modifications, or any - combination thereof. - -1.3. "Hardware" means any physical device that accepts input, processes - input, stores the results of processing, and/or provides output. - -1.4. "Larger Work" means a work that combines Covered Code or portions - thereof with code not governed by the terms of this License. - -1.5. "Licensable" means having the right to grant, to the maximum extent - possible, whether at the time of the initial grant or subsequently - acquired, any and all of the rights conveyed herein. - -1.6. "License" means this document. - -1.7. "Licensed Patents" means patent claims Licensable by SGI that are - infringed by the use or sale of Original Code or any Modifications - provided by SGI, or any combination thereof. - -1.8. "Modifications" means any addition to or deletion from the - substance or structure of the Original Code or any previous - Modifications. When Covered Code is released as a series of files, - a Modification is: - - A. Any addition to the contents of a file containing Original Code - and/or addition to or deletion from the contents of a file - containing previous Modifications. - - B. Any new file that contains any part of the Original Code or - previous Modifications. - -1.9. "Notice" means any notice in Original Code or Covered Code, as - required by and in compliance with this License. - -1.10. "Original Code" means source code of computer software code that - is described in the source code Notice required by Exhibit A as - Original Code, and updates and error corrections specifically - thereto. - -1.11. "Recipient" means an individual or a legal entity exercising - rights under, and complying with all of the terms of, this License - or a future version of this License issued under Section 8. For - legal entities, "Recipient" includes any entity that controls, is - controlled by, or is under common control with Recipient. For - purposes of this definition, "control" of an entity means (a) the - power, direct or indirect, to direct or manage such entity, or (b) - ownership of fifty percent (50%) or more of the outstanding shares - or beneficial ownership of such entity. - -1.12. "Recipient Patents" means patent claims Licensable by a Recipient - that are infringed by the use or sale of Original Code or any - Modifications provided by SGI, or any combination thereof. - -1.13. "SGI" means Silicon Graphics, Inc. - -1.14. "SGI Patents" means patent claims Licensable by SGI other than the - Licensed Patents. - -2. License Grant and Restrictions. - -2.1. SGI License Grant. Subject to the terms of this License and any - third party intellectual property claims, for the duration of - intellectual property protections inherent in the Original Code, - SGI hereby grants Recipient a worldwide, royalty-free, - non-exclusive license, to do the following: (i) under copyrights - Licensable by SGI, to reproduce, distribute, create derivative - works from, and, to the extent applicable, display and perform the - Original Code and/or any Modifications provided by SGI alone and/or - as part of a Larger Work; and (ii) under any Licensable Patents, to - make, have made, use, sell, offer for sale, import and/or otherwise - transfer the Original Code and/or any Modifications provided by - SGI. Recipient accepts the terms and conditions of this License by - undertaking any of the aforementioned actions. The patent license - shall apply to the Covered Code if, at the time any related - Modification is added, such addition of the Modification causes - such combination to be covered by the Licensed Patents. The patent - license in Section 2.1(ii) shall not apply to any other - combinations that include the Modification. No patent license is - provided under SGI Patents for infringements of SGI Patents by - Modifications not provided by SGI or combinations of Original Code - and Modifications not provided by SGI. - -2.2. Recipient License Grant. Subject to the terms of this License and - any third party intellectual property claims, Recipient hereby - grants SGI and any other Recipients a worldwide, royalty-free, - non-exclusive license, under any Recipient Patents, to make, have - made, use, sell, offer for sale, import and/or otherwise transfer - the Original Code and/or any Modifications provided by SGI. - -2.3. No License For Hardware Implementations. The licenses granted in - Section 2.1 and 2.2 are not applicable to implementation in - Hardware of the algorithms embodied in the Original Code or any - Modifications provided by SGI . - -3. Redistributions. - -3.1. Retention of Notice/Copy of License. The Notice set forth in - Exhibit A, below, must be conspicuously retained or included in any - and all redistributions of Covered Code. For distributions of the - Covered Code in source code form, the Notice must appear in every - file that can include a text comments field; in executable form, - the Notice and a copy of this License must appear in related - documentation or collateral where the Recipient’s rights relating - to Covered Code are described. Any Additional Notice Provisions - which actually appears in the Original Code must also be retained - or included in any and all redistributions of Covered Code. - -3.2. Alternative License. Provided that Recipient is in compliance with - the terms of this License, Recipient may, so long as without - derogation of any of SGI’s rights in and to the Original Code, - distribute the source code and/or executable version(s) of Covered - Code under (1) this License; (2) a license identical to this - License but for only such changes as are necessary in order to - clarify Recipient’s role as licensor of Modifications; and/or (3) a - license of Recipient’s choosing, containing terms different from - this License, provided that the license terms include this Section - 3 and Sections 4, 6, 7, 10, 12, and 13, which terms may not be - modified or superseded by any other terms of such license. If - Recipient elects to use any license other than this License, - Recipient must make it absolutely clear that any of its terms which - differ from this License are offered by Recipient alone, and not by - SGI. It is emphasized that this License is a limited license, and, - regardless of the license form employed by Recipient in accordance - with this Section 3.2, Recipient may relicense only such rights, in - Original Code and Modifications by SGI, as it has actually been - granted by SGI in this License. - -3.3. Indemnity. Recipient hereby agrees to indemnify SGI for any - liability incurred by SGI as a result of any such alternative - license terms Recipient offers. - -4. Termination. This License and the rights granted hereunder will - terminate automatically if Recipient breaches any term herein and - fails to cure such breach within 30 days thereof. Any sublicense to - the Covered Code that is properly granted shall survive any - termination of this License, absent termination by the terms of such - sublicense. Provisions that, by their nature, must remain in effect - beyond the termination of this License, shall survive. - -5. No Trademark Or Other Rights. This License does not grant any rights - to: (i) any software apart from the Covered Code, nor shall any - other rights or licenses not expressly granted hereunder arise by - implication, estoppel or otherwise with respect to the Covered Code; - (ii) any trade name, trademark or service mark whatsoever, including - without limitation any related right for purposes of endorsement or - promotion of products derived from the Covered Code, without prior - written permission of SGI; or (iii) any title to or ownership of the - Original Code, which shall at all times remains with SGI. All rights - in the Original Code not expressly granted under this License are - reserved. - -6. Compliance with Laws; Non-Infringement. There are various worldwide - laws, regulations, and executive orders applicable to dispositions - of Covered Code, including without limitation export, re-export, and - import control laws, regulations, and executive orders, of the U.S. - government and other countries, and Recipient is reminded it is - obliged to obey such laws, regulations, and executive orders. - Recipient may not distribute Covered Code that (i) in any way - infringes (directly or contributorily) any intellectual property - rights of any kind of any other person or entity or (ii) breaches - any representation or warranty, express, implied or statutory, to - which, under any applicable law, it might be deemed to have been - subject. - -7. Claims of Infringement. If Recipient learns of any third party claim - that any disposition of Covered Code and/or functionality wholly or - partially infringes the third party's intellectual property rights, - Recipient will promptly notify SGI of such claim. - -8. Versions of the License. SGI may publish revised and/or new versions - of the License from time to time, each with a distinguishing version - number. Once Covered Code has been published under a particular - version of the License, Recipient may, for the duration of the - license, continue to use it under the terms of that version, or - choose to use such Covered Code under the terms of any subsequent - version published by SGI. Subject to the provisions of Sections 3 - and 4 of this License, only SGI may modify the terms applicable to - Covered Code created under this License. - -9. DISCLAIMER OF WARRANTY. COVERED CODE IS PROVIDED "AS IS." ALL - EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ARE DISCLAIMED, - INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND CONDITIONS - OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR - PURPOSE, AND NON-INFRINGEMENT. SGI ASSUMES NO RISK AS TO THE QUALITY - AND PERFORMANCE OF THE SOFTWARE. SHOULD THE SOFTWARE PROVE DEFECTIVE - IN ANY RESPECT, SGI ASSUMES NO COST OR LIABILITY FOR SERVICING, - REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY IS AN ESSENTIAL - PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED - HEREUNDER EXCEPT SUBJECT TO THIS DISCLAIMER. - -10. LIMITATION OF LIABILITY. UNDER NO CIRCUMSTANCES NOR LEGAL THEORY, - WHETHER TORT (INCLUDING, WITHOUT LIMITATION, NEGLIGENCE OR STRICT - LIABILITY), CONTRACT, OR OTHERWISE, SHALL SGI OR ANY SGI LICENSOR - BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR - CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT - LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, LOSS OF - DATA, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER - COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN - INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF - LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY - RESULTING FROM SGI's NEGLIGENCE TO THE EXTENT APPLICABLE LAW - PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE - EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO - THAT EXCLUSION AND LIMITATION MAY NOT APPLY TO RECIPIENT. - -11. Indemnity. Recipient shall be solely responsible for damages - arising, directly or indirectly, out of its utilization of rights - under this License. Recipient will defend, indemnify and hold - harmless Silicon Graphics, Inc. from and against any loss, - liability, damages, costs or expenses (including the payment of - reasonable attorneys fees) arising out of Recipient's use, - modification, reproduction and distribution of the Covered Code or - out of any representation or warranty made by Recipient. - -12. U.S. Government End Users. The Covered Code is a "commercial item" - consisting of "commercial computer software" as such terms are - defined in title 48 of the Code of Federal Regulations and all U.S. - Government End Users acquire only the rights set forth in this - License and are subject to the terms of this License. - -13. Miscellaneous. This License represents the complete agreement - concerning the its subject matter. If any provision of this License - is held to be unenforceable, such provision shall be reformed so as - to achieve as nearly as possible the same legal and economic effect - as the original provision and the remainder of this License will - remain in effect. This License shall be governed by and construed - in accordance with the laws of the United States and the State of - California as applied to agreements entered into and to be - performed entirely within California between California residents. - Any litigation relating to this License shall be subject to the - exclusive jurisdiction of the Federal Courts of the Northern - District of California (or, absent subject matter jurisdiction in - such courts, the courts of the State of California), with venue - lying exclusively in Santa Clara County, California, with the - losing party responsible for costs, including without limitation, - court costs and reasonable attorneys fees and expenses. The - application of the United Nations Convention on Contracts for the - International Sale of Goods is expressly excluded. Any law or - regulation that provides that the language of a contract shall be - construed against the drafter shall not apply to this License. - -Exhibit A - -License Applicability. Except to the extent portions of this file are -made subject to an alternative license as permitted in the SGI Free -Software License B, Version 1.1 (the "License"), the contents of this -file are subject only to the provisions of the License. You may not use -this file except in compliance with the License. You may obtain a copy -of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: - -http://oss.sgi.com/projects/FreeB - -Note that, as provided in the License, the Software is distributed on an -"AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -PARTICULAR PURPOSE, AND NON-INFRINGEMENT. - -Original Code. The Original Code is: [name of software, version number, -and release date], developed by Silicon Graphics, Inc. The Original Code -is Copyright (c) [dates of first publication, as appearing in the Notice -in the Original Code] Silicon Graphics, Inc. Copyright in any portions -created by third parties is as indicated elsewhere herein. All Rights +SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + +Copyright (C) [dates of first publication] Silicon Graphics, Inc. All Rights Reserved. -Additional Notice Provisions: [such additional provisions, if any, as -appear in the Notice in the Original Code under the heading "Additional -Notice Provisions"] +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. -------------------------------------------------------------------------- -- cgit v1.2.3 From 07c1fcc604379f42ee337300ada421287ba82875 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Sat, 20 Sep 2008 16:31:30 +0200 Subject: Prepare changelog for upload --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index ee2978797fb..299a63d5554 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,10 @@ -mesa (7.0.3-6) UNRELEASED; urgency=low +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 Fri, 19 Sep 2008 18:02:55 +0200 + -- Julien Cristau Sat, 20 Sep 2008 16:30:44 +0200 mesa (7.0.3-5) unstable; urgency=low -- cgit v1.2.3 From e700c5ad99fddb5908313f0d02cd0f22fa135cc3 Mon Sep 17 00:00:00 2001 From: Timo Aaltonen Date: Tue, 23 Sep 2008 16:09:00 +0300 Subject: Update the changelog, refresh patch 04. --- debian/changelog | 9 +++++++-- debian/patches/04_osmesa_version.diff | 10 +++++----- 2 files changed, 12 insertions(+), 7 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index c875cd61219..b5e1f2701c6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,14 @@ -mesa (7.1-2) UNRELEASED; urgency=low +mesa (7.2-1) UNRELEASED; urgency=low + [ Brice Goglin ] * Fix grammar and punctuation in glxinfo(1), thanks Sam Hocevar, closes: #498595. - -- Brice Goglin Thu, 11 Sep 2008 19:12:45 +0200 + [ Timo Aaltonen ] + * New upstream release. + * Refresh patch 04_osmesa_version.diff + + -- Timo Aaltonen Tue, 23 Sep 2008 16:08:48 +0300 mesa (7.1-1) experimental; urgency=low diff --git a/debian/patches/04_osmesa_version.diff b/debian/patches/04_osmesa_version.diff index 6cc11d17b0d..573439702cd 100644 --- a/debian/patches/04_osmesa_version.diff +++ b/debian/patches/04_osmesa_version.diff @@ -1,7 +1,7 @@ Index: mesa/src/mesa/drivers/osmesa/Makefile =================================================================== ---- mesa.orig/src/mesa/drivers/osmesa/Makefile -+++ mesa/src/mesa/drivers/osmesa/Makefile +--- mesa.orig/src/mesa/drivers/osmesa/Makefile 2008-09-12 10:44:02.000000000 +0300 ++++ mesa/src/mesa/drivers/osmesa/Makefile 2008-09-23 16:07:40.000000000 +0300 @@ -46,7 +46,7 @@ $(TOP)/lib/$(OSMESA_LIB_NAME): $(OBJECTS) @@ -9,14 +9,14 @@ Index: mesa/src/mesa/drivers/osmesa/Makefile - -major $(MESA_MAJOR) -minor $(MESA_MINOR) -patch $(MESA_TINY) \ + -major 6 -minor 5 -patch 3 \ -install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) \ + -id $(INSTALL_LIB_DIR)/lib$(OSMESA_LIB).$(MESA_MAJOR).dylib \ $(OSMESA_LIB_DEPS) $(OBJECTS) - -@@ -57,7 +57,7 @@ +@@ -58,7 +58,7 @@ # with all the other Mesa sources (compiled with -DCHAN_BITS=16/32 osmesa16: $(OBJECTS) $(CORE_MESA) $(MKLIB) -o $(OSMESA_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \ - -major $(MESA_MAJOR) -minor $(MESA_MINOR) -patch $(MESA_TINY) \ + -major 6 -minor 5 -patch 3 \ -install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) \ + -id $(INSTALL_LIB_DIR)/lib$(OSMESA_LIB).$(MESA_MAJOR).dylib \ $(OSMESA_LIB_DEPS) $(OBJECTS) $(CORE_MESA) - -- cgit v1.2.3 From ee80a3a623bc9d0f9ea01a3c1e03204300f44097 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Wed, 24 Sep 2008 12:55:15 +0200 Subject: Remove the build-dep on dri2proto, DRI2 support has been removed. --- debian/changelog | 3 +++ debian/control | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index b5e1f2701c6..ea1bf797a1f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,6 +8,9 @@ mesa (7.2-1) UNRELEASED; urgency=low * New upstream release. * Refresh patch 04_osmesa_version.diff + [ Julien Cristau ] + * Remove the build-dep on dri2proto, DRI2 support has been removed. + -- Timo Aaltonen Tue, 23 Sep 2008 16:08:48 +0300 mesa (7.1-1) experimental; urgency=low diff --git a/debian/control b/debian/control index 80f7198c9ae..bfec2bfa828 100644 --- a/debian/control +++ b/debian/control @@ -6,7 +6,7 @@ Uploaders: Thierry Reding , Julien Cristau = 5), quilt (>= 0.40), pkg-config, libdrm-dev (>= 2.3.1) [!hurd-i386], libx11-dev, xutils-dev, - x11proto-gl-dev (>= 1.4.8), x11proto-dri2-dev, libxxf86vm-dev, + x11proto-gl-dev (>= 1.4.8), libxxf86vm-dev, libexpat1-dev, lesstif2-dev, dpkg-dev (>= 1.13.19), libxfixes-dev, libxdamage-dev, libxext-dev, autoconf, automake Vcs-Git: git://git.debian.org/git/pkg-xorg/lib/mesa -- cgit v1.2.3 From 872cb1a0dd16304cc5a0cecc642cc6c6d3781d44 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Wed, 24 Sep 2008 14:25:30 +0200 Subject: intel: don't warn about TTM init failure. --- debian/changelog | 1 + debian/patches/01_disable-intel-classic-warn.diff | 14 ++++++++++++++ debian/patches/series | 1 + 3 files changed, 16 insertions(+) create mode 100644 debian/patches/01_disable-intel-classic-warn.diff (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index ea1bf797a1f..cb8c9f54b36 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,6 +10,7 @@ mesa (7.2-1) UNRELEASED; urgency=low [ Julien Cristau ] * Remove the build-dep on dri2proto, DRI2 support has been removed. + * intel: don't warn about TTM init failure. -- Timo Aaltonen Tue, 23 Sep 2008 16:08:48 +0300 diff --git a/debian/patches/01_disable-intel-classic-warn.diff b/debian/patches/01_disable-intel-classic-warn.diff new file mode 100644 index 00000000000..0725ffe09f7 --- /dev/null +++ b/debian/patches/01_disable-intel-classic-warn.diff @@ -0,0 +1,14 @@ +Index: mesa/src/mesa/drivers/dri/intel/intel_context.c +=================================================================== +--- mesa.orig/src/mesa/drivers/dri/intel/intel_context.c ++++ mesa/src/mesa/drivers/dri/intel/intel_context.c +@@ -490,9 +490,6 @@ + if (intel->bufmgr == NULL) { + if (ttm_disable) { + fprintf(stderr, "TTM buffer manager disabled. Using classic.\n"); +- } else { +- fprintf(stderr, "Failed to initialize TTM buffer manager. " +- "Falling back to classic.\n"); + } + + if (intelScreen->tex.size == 0) { diff --git a/debian/patches/series b/debian/patches/series index 86f17dca4fc..f7ae6157a68 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,3 +1,4 @@ +01_disable-intel-classic-warn.diff 02_use-ieee-fp-on-s390-and-m68k.patch 03_optional-progs-and-install.patch 04_osmesa_version.diff -- cgit v1.2.3 From 84bb8fc6958dc4c61c5a2684724cc6bd06377b5c Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Wed, 24 Sep 2008 14:28:28 +0200 Subject: Prepare changelog for upload --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index cb8c9f54b36..9adcd91a723 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -mesa (7.2-1) UNRELEASED; urgency=low +mesa (7.2-1) experimental; urgency=low [ Brice Goglin ] * Fix grammar and punctuation in glxinfo(1), thanks Sam Hocevar, @@ -12,7 +12,7 @@ mesa (7.2-1) UNRELEASED; urgency=low * Remove the build-dep on dri2proto, DRI2 support has been removed. * intel: don't warn about TTM init failure. - -- Timo Aaltonen Tue, 23 Sep 2008 16:08:48 +0300 + -- Julien Cristau Wed, 24 Sep 2008 14:28:21 +0200 mesa (7.1-1) experimental; urgency=low -- cgit v1.2.3 From 83a4719056284993a5c441c1b1d662d1c2c69de1 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Sun, 26 Oct 2008 15:34:37 +0100 Subject: Update changelog --- debian/changelog | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 299a63d5554..cf2fd6d86e3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +mesa (7.0.3-7) UNRELEASED; urgency=low + + * Cherry-pick patch from upstream: + Use 3Dnow! x86-64 routines only on processors that support 3Dnow! + (closes: #484180). + + -- Julien Cristau Sun, 26 Oct 2008 15:27:10 +0100 + mesa (7.0.3-6) unstable; urgency=high * Update debian/copyright to the SGI Free Software License B, version 2.0. -- cgit v1.2.3 From 0206e20240e5f3f48431567a1afc955272362321 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Sun, 26 Oct 2008 15:58:46 +0100 Subject: Also build the x86-specific dri drivers on kfreebsd (closes: #492894). --- configs/debian-dri-default | 2 +- debian/changelog | 1 + debian/rules | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) (limited to 'debian') diff --git a/configs/debian-dri-default b/configs/debian-dri-default index 2a01bf8b7e3..b42bfc3378d 100644 --- a/configs/debian-dri-default +++ b/configs/debian-dri-default @@ -22,7 +22,7 @@ DRI_DIRS = mach64 mga r128 r200 r300 radeon s3v savage tdfx trident ARCH_X86 = i386 amd64 -ifneq ($(findstring $(DEB_BUILD_ARCH), $(ARCH_X86)),) +ifneq ($(filter $(DEB_HOST_ARCH_CPU), $(ARCH_X86)),) DRI_DIRS += i810 i915 i965 sis unichrome endif diff --git a/debian/changelog b/debian/changelog index cf2fd6d86e3..640eb618873 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,7 @@ mesa (7.0.3-7) UNRELEASED; 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, 26 Oct 2008 15:27:10 +0100 diff --git a/debian/rules b/debian/rules index 3d00bb72401..6a66df11aee 100755 --- a/debian/rules +++ b/debian/rules @@ -22,9 +22,11 @@ endif DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH) 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)/obj-$(DEB_BUILD_GNU_TYPE) export DEB_BUILD_ARCH +export DEB_HOST_ARCH_CPU # choose which configurations to build SWX11_GLU_CONFIGS = -- cgit v1.2.3 From 7593023f0b1be0648edb15986d559744483f3c8c Mon Sep 17 00:00:00 2001 From: Timo Aaltonen Date: Tue, 9 Dec 2008 01:57:44 +0200 Subject: Update the changelog for the snapshot also drop 01_disable-intel-classic-warn.diff since it's obsolete now. --- debian/changelog | 8 ++++++++ debian/patches/01_disable-intel-classic-warn.diff | 14 -------------- debian/patches/series | 1 - 3 files changed, 8 insertions(+), 15 deletions(-) delete mode 100644 debian/patches/01_disable-intel-classic-warn.diff (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 9adcd91a723..488b461f880 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +mesa (7.2+git20081209.a0d5c3cf-1) UNRELEASED; urgency=low + + * New upstream snapshot. + * Remove debian/patches/01_disable-intel-classic-warn.diff, the + warning is gone now. + + -- Timo Aaltonen Tue, 09 Dec 2008 01:38:42 +0200 + mesa (7.2-1) experimental; urgency=low [ Brice Goglin ] diff --git a/debian/patches/01_disable-intel-classic-warn.diff b/debian/patches/01_disable-intel-classic-warn.diff deleted file mode 100644 index 0725ffe09f7..00000000000 --- a/debian/patches/01_disable-intel-classic-warn.diff +++ /dev/null @@ -1,14 +0,0 @@ -Index: mesa/src/mesa/drivers/dri/intel/intel_context.c -=================================================================== ---- mesa.orig/src/mesa/drivers/dri/intel/intel_context.c -+++ mesa/src/mesa/drivers/dri/intel/intel_context.c -@@ -490,9 +490,6 @@ - if (intel->bufmgr == NULL) { - if (ttm_disable) { - fprintf(stderr, "TTM buffer manager disabled. Using classic.\n"); -- } else { -- fprintf(stderr, "Failed to initialize TTM buffer manager. " -- "Falling back to classic.\n"); - } - - if (intelScreen->tex.size == 0) { diff --git a/debian/patches/series b/debian/patches/series index f7ae6157a68..86f17dca4fc 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,4 +1,3 @@ -01_disable-intel-classic-warn.diff 02_use-ieee-fp-on-s390-and-m68k.patch 03_optional-progs-and-install.patch 04_osmesa_version.diff -- cgit v1.2.3 From a7a9398411e04cbd82446242ddefa73b1bf0edcb Mon Sep 17 00:00:00 2001 From: Timo Aaltonen Date: Tue, 9 Dec 2008 02:01:40 +0200 Subject: Build-depend on x11proto-dri2-dev (>= 1.99.3) --- debian/changelog | 2 ++ debian/control | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 488b461f880..06a32a3fcc1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,8 @@ mesa (7.2+git20081209.a0d5c3cf-1) UNRELEASED; urgency=low * New upstream snapshot. * 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) -- Timo Aaltonen Tue, 09 Dec 2008 01:38:42 +0200 diff --git a/debian/control b/debian/control index bfec2bfa828..6aa8bf0b70d 100644 --- a/debian/control +++ b/debian/control @@ -8,7 +8,7 @@ Build-Depends: debhelper (>= 5), quilt (>= 0.40), pkg-config, libdrm-dev (>= 2.3.1) [!hurd-i386], libx11-dev, xutils-dev, x11proto-gl-dev (>= 1.4.8), libxxf86vm-dev, libexpat1-dev, lesstif2-dev, dpkg-dev (>= 1.13.19), libxfixes-dev, - libxdamage-dev, libxext-dev, autoconf, automake + libxdamage-dev, libxext-dev, autoconf, automake, x11proto-dri2-dev (>= 1.99.3) 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/ -- cgit v1.2.3 From 85d882983f6760f699b8248ed3b012e067056b7f Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Sun, 14 Dec 2008 09:59:33 +0530 Subject: Prepare changelog for upload --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 640eb618873..3d28285f7f5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,11 +1,11 @@ -mesa (7.0.3-7) UNRELEASED; urgency=low +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, 26 Oct 2008 15:27:10 +0100 + -- Julien Cristau Sun, 14 Dec 2008 07:34:58 +0530 mesa (7.0.3-6) unstable; urgency=high -- cgit v1.2.3 From a713ba439922e6cfad8fb1de49f5b6dee2e5e21a Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Sat, 10 Jan 2009 20:31:20 +0100 Subject: Update changelog --- debian/changelog | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 06a32a3fcc1..714294ce984 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,8 @@ -mesa (7.2+git20081209.a0d5c3cf-1) UNRELEASED; urgency=low +mesa (7.3~rc1-1) UNRELEASED; urgency=low - * New upstream snapshot. + * New upstream release candidate. + + [ Timo Aaltonen ] * Remove debian/patches/01_disable-intel-classic-warn.diff, the warning is gone now. * debian/control: -- cgit v1.2.3 From 382a8f6e29ad4d1fd2a80d1dd9b079396e29b814 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Sat, 10 Jan 2009 20:41:16 +0100 Subject: Require libdrm-dev 2.4.3. --- debian/changelog | 3 +++ debian/control | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 714294ce984..47ceacb125f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,6 +8,9 @@ mesa (7.3~rc1-1) UNRELEASED; urgency=low * debian/control: - Build-depend on x11proto-dri2-dev (>= 1.99.3) + [ Julien Cristau ] + * Require libdrm-dev 2.4.3. + -- Timo Aaltonen Tue, 09 Dec 2008 01:38:42 +0200 mesa (7.2-1) experimental; urgency=low diff --git a/debian/control b/debian/control index 6aa8bf0b70d..0a8f72f1291 100644 --- a/debian/control +++ b/debian/control @@ -5,7 +5,7 @@ Maintainer: Debian X Strike Force Uploaders: Thierry Reding , Julien Cristau , David Nusinow , Brice Goglin Standards-Version: 3.7.3 Build-Depends: debhelper (>= 5), quilt (>= 0.40), pkg-config, - libdrm-dev (>= 2.3.1) [!hurd-i386], libx11-dev, xutils-dev, + libdrm-dev (>= 2.4.3) [!hurd-i386], libx11-dev, xutils-dev, x11proto-gl-dev (>= 1.4.8), libxxf86vm-dev, libexpat1-dev, lesstif2-dev, dpkg-dev (>= 1.13.19), libxfixes-dev, libxdamage-dev, libxext-dev, autoconf, automake, x11proto-dri2-dev (>= 1.99.3) -- cgit v1.2.3 From 2a6711c0e565127a52a10ae23e3cf49cdd45f84a Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Sat, 10 Jan 2009 21:02:55 +0100 Subject: add bug closers --- debian/changelog | 3 +++ 1 file changed, 3 insertions(+) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 47ceacb125f..62da1dbc53b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,9 @@ mesa (7.3~rc1-1) UNRELEASED; 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 -- cgit v1.2.3 From 54885ff0ad9ba39a5e165dd19858d217826fc88f Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Sat, 10 Jan 2009 21:55:19 +0100 Subject: Delete unused configs/debian-*, and install-source.sh script. We've switched to using autoconf, and mesa-swx11-source is gone. --- configs/debian-default | 17 ------- configs/debian-dri-amd64 | 9 ---- configs/debian-dri-any | 9 ---- configs/debian-dri-default | 36 --------------- configs/debian-dri-i386 | 9 ---- configs/debian-dri-i386-i686 | 14 ------ configs/debian-dri-optimized-default | 13 ------ configs/debian-indirect-default | 7 --- configs/debian-indirect-hurd-i386 | 9 ---- configs/debian-osmesa | 9 ---- configs/debian-osmesa-default | 10 ----- configs/debian-osmesa-static | 9 ---- configs/debian-osmesa16 | 10 ----- configs/debian-osmesa16-static | 10 ----- configs/debian-osmesa32 | 10 ----- configs/debian-osmesa32-static | 10 ----- configs/debian-swx11+glu-alpha-ev5 | 12 ----- configs/debian-swx11+glu-amd64 | 10 ----- configs/debian-swx11+glu-any | 9 ---- configs/debian-swx11+glu-default | 14 ------ configs/debian-swx11+glu-i386 | 10 ----- configs/debian-swx11+glu-i386-i686 | 14 ------ configs/debian-swx11+glu-powerpc-603 | 13 ------ configs/debian-swx11+glu-ppc64 | 11 ----- configs/debian-swx11+glu-sparc | 10 ----- configs/debian-swx11+glu-sparc-ultrasparc | 13 ------ configs/debian-swx11+glu-static-amd64 | 10 ----- configs/debian-swx11+glu-static-any | 10 ----- configs/debian-swx11+glu-static-i386 | 10 ----- configs/debian-swx11+glu-static-ppc64 | 11 ----- configs/default-bp | 75 ------------------------------- configs/linux-osmesa-static | 15 ------- configs/linux-osmesa32-static | 13 ------ debian/changelog | 2 + debian/scripts/install-source.sh | 46 ------------------- 35 files changed, 2 insertions(+), 497 deletions(-) delete mode 100644 configs/debian-default delete mode 100644 configs/debian-dri-amd64 delete mode 100644 configs/debian-dri-any delete mode 100644 configs/debian-dri-default delete mode 100644 configs/debian-dri-i386 delete mode 100644 configs/debian-dri-i386-i686 delete mode 100644 configs/debian-dri-optimized-default delete mode 100644 configs/debian-indirect-default delete mode 100644 configs/debian-indirect-hurd-i386 delete mode 100644 configs/debian-osmesa delete mode 100644 configs/debian-osmesa-default delete mode 100644 configs/debian-osmesa-static delete mode 100644 configs/debian-osmesa16 delete mode 100644 configs/debian-osmesa16-static delete mode 100644 configs/debian-osmesa32 delete mode 100644 configs/debian-osmesa32-static delete mode 100644 configs/debian-swx11+glu-alpha-ev5 delete mode 100644 configs/debian-swx11+glu-amd64 delete mode 100644 configs/debian-swx11+glu-any delete mode 100644 configs/debian-swx11+glu-default delete mode 100644 configs/debian-swx11+glu-i386 delete mode 100644 configs/debian-swx11+glu-i386-i686 delete mode 100644 configs/debian-swx11+glu-powerpc-603 delete mode 100644 configs/debian-swx11+glu-ppc64 delete mode 100644 configs/debian-swx11+glu-sparc delete mode 100644 configs/debian-swx11+glu-sparc-ultrasparc delete mode 100644 configs/debian-swx11+glu-static-amd64 delete mode 100644 configs/debian-swx11+glu-static-any delete mode 100644 configs/debian-swx11+glu-static-i386 delete mode 100644 configs/debian-swx11+glu-static-ppc64 delete mode 100644 configs/default-bp delete mode 100644 configs/linux-osmesa-static delete mode 100644 configs/linux-osmesa32-static delete mode 100755 debian/scripts/install-source.sh (limited to 'debian') diff --git a/configs/debian-default b/configs/debian-default deleted file mode 100644 index 8d1b785ee00..00000000000 --- a/configs/debian-default +++ /dev/null @@ -1,17 +0,0 @@ -# Define Debian-specific defaults. - -CONFIG_NAME = debian-default - -OPT_FLAGS = -O2 -g - -# override settings in configs/linux-x86-64 -LIB_DIR = lib -EXTRA_LIB_PATH = - -SRC_DIRS = mesa -PROGRAM_DIRS = - -INSTALL_DIR = /usr - -# vim: ft=make - diff --git a/configs/debian-dri-amd64 b/configs/debian-dri-amd64 deleted file mode 100644 index ff4232b1200..00000000000 --- a/configs/debian-dri-amd64 +++ /dev/null @@ -1,9 +0,0 @@ -# Configuration for building the DRI drivers on i386. - -include $(TOP)/configs/linux-dri-x86-64 -include $(TOP)/configs/debian-dri-default - -CONFIG_NAME = debian-dri-amd64 - -# vim: ft=make - diff --git a/configs/debian-dri-any b/configs/debian-dri-any deleted file mode 100644 index c4b65b0c482..00000000000 --- a/configs/debian-dri-any +++ /dev/null @@ -1,9 +0,0 @@ -# Configuration for building the DRI drivers on the build architecture. - -include $(TOP)/configs/linux-dri -include $(TOP)/configs/debian-dri-default - -CONFIG_NAME = debian-dri-any - -# vim: ft=make - diff --git a/configs/debian-dri-default b/configs/debian-dri-default deleted file mode 100644 index b42bfc3378d..00000000000 --- a/configs/debian-dri-default +++ /dev/null @@ -1,36 +0,0 @@ -# Configuration defaults for building the DRI drivers and DRI/GLX-enabled -# libGL. - -include $(TOP)/configs/debian-default - -CONFIG_NAME = debian-dri-default - -SRC_DIRS = glx/x11 mesa progs -DRIVER_DIRS = dri -PROGRAM_DIRS = xdemos -PROGS = glxdemo \ - glxgears \ - glxheads \ - glxinfo - -LIB_DIR = lib/glx - -DRI_DRIVER_INSTALL_DIR = $(INSTALL_DIR)/lib/dri -DRI_DRIVER_SEARCH_DIR = /usr/lib/dri - -DRI_DIRS = mach64 mga r128 r200 r300 radeon s3v savage tdfx trident - -ARCH_X86 = i386 amd64 - -ifneq ($(filter $(DEB_HOST_ARCH_CPU), $(ARCH_X86)),) - DRI_DIRS += i810 i915 i965 sis unichrome -endif - -ifeq ($(DEB_BUILD_ARCH), sparc) - DRI_DIRS += ffb -endif - -APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) - -# vim: ft=make - diff --git a/configs/debian-dri-i386 b/configs/debian-dri-i386 deleted file mode 100644 index 7a0aaa487d2..00000000000 --- a/configs/debian-dri-i386 +++ /dev/null @@ -1,9 +0,0 @@ -# Configuration for building the DRI drivers on i386. - -include $(TOP)/configs/linux-dri-x86 -include $(TOP)/configs/debian-dri-default - -CONFIG_NAME = debian-dri-i386 - -# vim: ft=make - diff --git a/configs/debian-dri-i386-i686 b/configs/debian-dri-i386-i686 deleted file mode 100644 index b15cd77a03d..00000000000 --- a/configs/debian-dri-i386-i686 +++ /dev/null @@ -1,14 +0,0 @@ -# Configuration for building the DRI drivers on i386. - -include $(TOP)/configs/linux-dri-x86 -include $(TOP)/configs/debian-dri-optimized-default - -CONFIG_NAME = debian-dri-i386-i686 - -ARCH_FLAGS = -march=i686 -LIB_DIR = lib/glx/i686/cmov - -DRI_DRIVER_INSTALL_DIR = $(INSTALL_DIR)/lib/dri/i686/cmov - -# vim: ft=make - diff --git a/configs/debian-dri-optimized-default b/configs/debian-dri-optimized-default deleted file mode 100644 index 9c3f68dde7a..00000000000 --- a/configs/debian-dri-optimized-default +++ /dev/null @@ -1,13 +0,0 @@ -# Configuration defaults for CPU-optimized builds of the DRI drivers and -# DRI/GLX-enabled libGL. - -include $(TOP)/configs/debian-dri-default - -CONFIG_NAME = debian-dri-optimized-default - -# override so that the utility programs are not rebuilt with CPU-specific -# optimizations -SRC_DIRS = glx/x11 mesa - -# vim: ft=make - diff --git a/configs/debian-indirect-default b/configs/debian-indirect-default deleted file mode 100644 index a6926c95fcc..00000000000 --- a/configs/debian-indirect-default +++ /dev/null @@ -1,7 +0,0 @@ -# Configuration defaults for building GLX-enabled libGL. - -include $(TOP)/configs/debian-dri-default - -CONFIG_NAME = debian-indirect-default - -DRI_DIRS = diff --git a/configs/debian-indirect-hurd-i386 b/configs/debian-indirect-hurd-i386 deleted file mode 100644 index dd4bb07ca52..00000000000 --- a/configs/debian-indirect-hurd-i386 +++ /dev/null @@ -1,9 +0,0 @@ -# Configuration for building the DRI drivers on the build architecture. - -include $(TOP)/configs/linux-indirect -include $(TOP)/configs/debian-indirect-default - -CONFIG_NAME = debian-indirect-hurd-i386 - -# vim: ft=make - diff --git a/configs/debian-osmesa b/configs/debian-osmesa deleted file mode 100644 index 9b7fc7b2afd..00000000000 --- a/configs/debian-osmesa +++ /dev/null @@ -1,9 +0,0 @@ -# Configuration for building only OSMesa on Debian. - -include $(TOP)/configs/linux-osmesa -include $(TOP)/configs/debian-osmesa-default - -CONFIG_NAME = debian-osmesa - -# vim: ft=make - diff --git a/configs/debian-osmesa-default b/configs/debian-osmesa-default deleted file mode 100644 index ef5a5ba0c7c..00000000000 --- a/configs/debian-osmesa-default +++ /dev/null @@ -1,10 +0,0 @@ -# Configuration defaults for building OSMesa. - -include $(TOP)/configs/debian-default - -CONFIG_NAME = debian-osmesa-default - -DRIVER_DIRS = osmesa - -# vim: ft=make - diff --git a/configs/debian-osmesa-static b/configs/debian-osmesa-static deleted file mode 100644 index 03fe8b5f20e..00000000000 --- a/configs/debian-osmesa-static +++ /dev/null @@ -1,9 +0,0 @@ -# Configuration for building only OSMesa (static version) on Debian. - -include $(TOP)/configs/linux-osmesa-static -include $(TOP)/configs/debian-osmesa-default - -CONFIG_NAME = debian-osmesa-static - -# vim: ft=make - diff --git a/configs/debian-osmesa16 b/configs/debian-osmesa16 deleted file mode 100644 index 0077930188f..00000000000 --- a/configs/debian-osmesa16 +++ /dev/null @@ -1,10 +0,0 @@ -# Configuration for building OSMesa with support for 16 bits per color -# channel. - -include $(TOP)/configs/linux-osmesa16 -include $(TOP)/configs/debian-osmesa-default - -CONFIG_NAME = debian-osmesa16 - -# vim: ft=make - diff --git a/configs/debian-osmesa16-static b/configs/debian-osmesa16-static deleted file mode 100644 index 6ff399e627c..00000000000 --- a/configs/debian-osmesa16-static +++ /dev/null @@ -1,10 +0,0 @@ -# Configuration for building a static version of OSMesa with support for 16 -# bits per color channel. - -include $(TOP)/configs/linux-osmesa16-static -include $(TOP)/configs/debian-osmesa-default - -CONFIG_NAME = debian-osmesa16-static - -# vim: ft=make - diff --git a/configs/debian-osmesa32 b/configs/debian-osmesa32 deleted file mode 100644 index de3b3277c21..00000000000 --- a/configs/debian-osmesa32 +++ /dev/null @@ -1,10 +0,0 @@ -# Configuration for building OSMesa with support for 32 bits per color -# channel. - -include $(TOP)/configs/linux-osmesa32 -include $(TOP)/configs/debian-osmesa-default - -CONFIG_NAME = debian-osmesa32 - -# vim: ft=make - diff --git a/configs/debian-osmesa32-static b/configs/debian-osmesa32-static deleted file mode 100644 index 7fdfcef4013..00000000000 --- a/configs/debian-osmesa32-static +++ /dev/null @@ -1,10 +0,0 @@ -# Configuration for building a static version of OSMesa with support for 32 -# bits per color channel. - -include $(TOP)/configs/linux-osmesa32-static -include $(TOP)/configs/debian-osmesa-default - -CONFIG_NAME = debian-osmesa32-static - -# vim: ft=make - diff --git a/configs/debian-swx11+glu-alpha-ev5 b/configs/debian-swx11+glu-alpha-ev5 deleted file mode 100644 index fd16e49e374..00000000000 --- a/configs/debian-swx11+glu-alpha-ev5 +++ /dev/null @@ -1,12 +0,0 @@ -# Configuration for building Mesa (swx11 and GLU) on alpha (ev5 optimized). - -include $(TOP)/configs/linux-alpha -include $(TOP)/configs/debian-swx11+glu-default - -CONFIG_NAME = debian-swx11+glu-alpha-ev5 - -SRC_DIRS = mesa -LIB_DIR = lib/ev5/cmov - -# vim: ft=make - diff --git a/configs/debian-swx11+glu-amd64 b/configs/debian-swx11+glu-amd64 deleted file mode 100644 index 4bd7e51443a..00000000000 --- a/configs/debian-swx11+glu-amd64 +++ /dev/null @@ -1,10 +0,0 @@ -# Configuration for building Mesa (swx11 and GLU) with runtime-detected -# assembler optimizations on amd64. - -include $(TOP)/configs/linux-x86-64 -include $(TOP)/configs/debian-swx11+glu-default - -CONFIG_NAME = debian-swx11+glu-amd64 - -# vim: ft=make - diff --git a/configs/debian-swx11+glu-any b/configs/debian-swx11+glu-any deleted file mode 100644 index 884c9f9f23e..00000000000 --- a/configs/debian-swx11+glu-any +++ /dev/null @@ -1,9 +0,0 @@ -# Configuration for building Mesa (swx11 and GLU) on the build architecture. - -include $(TOP)/configs/linux -include $(TOP)/configs/debian-swx11+glu-default - -CONFIG_NAME = debian-swx11+glu-any - -# vim: ft=make - diff --git a/configs/debian-swx11+glu-default b/configs/debian-swx11+glu-default deleted file mode 100644 index ccf827639c6..00000000000 --- a/configs/debian-swx11+glu-default +++ /dev/null @@ -1,14 +0,0 @@ -# Configuration defaults for building Mesa (swx11 and GLU). - -include $(TOP)/configs/debian-default - -CONFIG_NAME = debian-swx11+glu-default - -SRC_DIRS = mesa glu glw -DRIVER_DIRS = x11 - -GLW_SOURCES += GLwMDrawA.c -GLW_LIB_DEPS += -lXm - -# vim: ft=make - diff --git a/configs/debian-swx11+glu-i386 b/configs/debian-swx11+glu-i386 deleted file mode 100644 index 0b800c64bba..00000000000 --- a/configs/debian-swx11+glu-i386 +++ /dev/null @@ -1,10 +0,0 @@ -# Configuration for building Mesa (swx11 and GLU) with runtime-detected -# assembler optimizations on i386. - -include $(TOP)/configs/linux-x86 -include $(TOP)/configs/debian-swx11+glu-default - -CONFIG_NAME = debian-swx11+glu-i386 - -# vim: ft=make - diff --git a/configs/debian-swx11+glu-i386-i686 b/configs/debian-swx11+glu-i386-i686 deleted file mode 100644 index c6969b3f830..00000000000 --- a/configs/debian-swx11+glu-i386-i686 +++ /dev/null @@ -1,14 +0,0 @@ -# Configuration for building Mesa (swx11 and GLU) with runtime-detected -# assembler optimizations on i386 (i686 optimized). - -include $(TOP)/configs/linux-x86 -include $(TOP)/configs/debian-swx11+glu-default - -CONFIG_NAME = debian-swx11+glu-i386-i686 - -ARCH_FLAGS += -march=i686 -SRC_DIRS = mesa -LIB_DIR = lib/i686/cmov - -# vim: ft=make - diff --git a/configs/debian-swx11+glu-powerpc-603 b/configs/debian-swx11+glu-powerpc-603 deleted file mode 100644 index 86b3580e380..00000000000 --- a/configs/debian-swx11+glu-powerpc-603 +++ /dev/null @@ -1,13 +0,0 @@ -# Configuration for building Mesa (swx11 and GLU) with runtime-detected -# assembler optimizations on powerpc (603 optimized). - -include $(TOP)/configs/linux-ppc -include $(TOP)/configs/debian-swx11+glu-default - -CONFIG_NAME = debian-swx11+glu-powerpc-603 - -SRC_DIRS = mesa -LIB_DIR = lib/603/cmov - -# vim: ft=make - diff --git a/configs/debian-swx11+glu-ppc64 b/configs/debian-swx11+glu-ppc64 deleted file mode 100644 index 67c59b6eef2..00000000000 --- a/configs/debian-swx11+glu-ppc64 +++ /dev/null @@ -1,11 +0,0 @@ -# Configuration for building Mesa (swx11 and GLU) with runtime-detected -# assembler optimizations on ppc64. - -include $(TOP)/configs/debian-swx11+glu-any - -CONFIG_NAME = debian-swx11+glu-ppc64 - -LIB_DIR = lib64 - -# vim: ft=make - diff --git a/configs/debian-swx11+glu-sparc b/configs/debian-swx11+glu-sparc deleted file mode 100644 index 8854b40d4fc..00000000000 --- a/configs/debian-swx11+glu-sparc +++ /dev/null @@ -1,10 +0,0 @@ -# Configuration for building Mesa (swx11 and GLU) with runtime-detected -# assembler optimizations on sparc. - -include $(TOP)/configs/linux-sparc -include $(TOP)/configs/debian-swx11+glu-default - -CONFIG_NAME = debian-swx11+glu-sparc - -# vim: ft=make - diff --git a/configs/debian-swx11+glu-sparc-ultrasparc b/configs/debian-swx11+glu-sparc-ultrasparc deleted file mode 100644 index 14e38018c46..00000000000 --- a/configs/debian-swx11+glu-sparc-ultrasparc +++ /dev/null @@ -1,13 +0,0 @@ -# Configuration for building Mesa (swx11 and GLU) with runtime-detected -# assembler optimizations on sparc (ultrasparc-optimized). - -include $(TOP)/configs/linux-ultrasparc -include $(TOP)/configs/debian-swx11+glu-default - -CONFIG_NAME = debian-swx11+glu-sparc-ultrasparc - -SRC_DIRS = mesa -LIB_DIR = lib/ultrasparc/cmov - -# vim: ft=make - diff --git a/configs/debian-swx11+glu-static-amd64 b/configs/debian-swx11+glu-static-amd64 deleted file mode 100644 index 2976fbe66f3..00000000000 --- a/configs/debian-swx11+glu-static-amd64 +++ /dev/null @@ -1,10 +0,0 @@ -# Configuration for building static versions of the libraries (swx11 and GLU) -# on amd64. - -include $(TOP)/configs/linux-x86-64-static -include $(TOP)/configs/debian-swx11+glu-default - -CONFIG_NAME = debian-swx11+glu-static-amd64 - -# vim: ft=make - diff --git a/configs/debian-swx11+glu-static-any b/configs/debian-swx11+glu-static-any deleted file mode 100644 index 82f794d28df..00000000000 --- a/configs/debian-swx11+glu-static-any +++ /dev/null @@ -1,10 +0,0 @@ -# Configuration for building static versions of the libraries (swx11 and GLU) -# on the build architecture. - -include $(TOP)/configs/linux-static -include $(TOP)/configs/debian-swx11+glu-default - -CONFIG_NAME = debian-swx11+glu-static-any - -# vim: ft=make - diff --git a/configs/debian-swx11+glu-static-i386 b/configs/debian-swx11+glu-static-i386 deleted file mode 100644 index 62859e42548..00000000000 --- a/configs/debian-swx11+glu-static-i386 +++ /dev/null @@ -1,10 +0,0 @@ -# Configuration for building static versions of the libraries (swx11 and GLU) -# on i386. - -include $(TOP)/configs/linux-x86-static -include $(TOP)/configs/debian-swx11+glu-default - -CONFIG_NAME = debian-swx11+glu-static-i386 - -# vim: ft=make - diff --git a/configs/debian-swx11+glu-static-ppc64 b/configs/debian-swx11+glu-static-ppc64 deleted file mode 100644 index a9ea4a95b31..00000000000 --- a/configs/debian-swx11+glu-static-ppc64 +++ /dev/null @@ -1,11 +0,0 @@ -# Configuration for building static versions of the libraries (swx11 and GLU) -# on ppc64. - -include $(TOP)/configs/debian-swx11+glu-static-any - -CONFIG_NAME = debian-swx11+glu-static-ppc64 - -LIB_DIR = lib64 - -# vim: ft=make - diff --git a/configs/default-bp b/configs/default-bp deleted file mode 100644 index 29faceed817..00000000000 --- a/configs/default-bp +++ /dev/null @@ -1,75 +0,0 @@ -# Default/template configuration - -# This is included by other config files which may override some -# of these variables. - -CONFIG_NAME = default - -# Version info -MESA_MAJOR=6 -MESA_MINOR=3 -MESA_TINY=0 - -# external projects -#DRM_SOURCE_PATH=$(TOP)/../drm -DRM_SOURCE_PATH=/home/projects/DRI-freedesktop/drm - -# Compiler and flags -CC = cc -CXX = CC -CFLAGS = -O -CXXFLAGS = -O -GLU_CFLAGS = - -# Misc tools and flags -MKLIB_OPTIONS = -MKDEP = makedepend -MKDEP_OPTIONS = -fdepend -MAKE = make - -# Library names (base name) -GL_LIB = GL -GLU_LIB = GLU -GLUT_LIB = glut -GLW_LIB = GLw -OSMESA_LIB = OSMesa - - -# Library names (actual file names) -GL_LIB_NAME = lib$(GL_LIB).so -GLU_LIB_NAME = lib$(GLU_LIB).so -GLUT_LIB_NAME = lib$(GLUT_LIB).so -GLW_LIB_NAME = lib$(GLW_LIB).so -OSMESA_LIB_NAME = lib$(OSMesa).so - - -# Optional assembly language optimization files for libGL -ASM_SOURCES = - -# GLw widget sources (Append "GLwMDrawA.c" here and add -lXm to GLW_LIB_DEPS in -# order to build the Motif widget too) -GLW_SOURCES = GLwDrawA.c - - -# Directories -LIB_DIR = $(TOP)/lib -INSTALL_PREFIX = /usr/local -SRC_DIRS = mesa glu glut/glx glw -GLU_DIRS = sgi -DRIVER_DIRS = x11 osmesa -# Which subdirs under $(TOP)/progs/ to enter: -PROGRAM_DIRS = demos redbook samples xdemos - - -# Library/program dependencies -GL_LIB_DEPS = -lX11 -lXext -lm -lpthread -OSMESA_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -GLU_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -lm -GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lXmu -lXt -lXi -lm -GLW_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -lXt -lX11 -APP_LIB_DEPS = -L$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm - - -# Shading language support (set to 0 or 1) -SHADING_LANGUAGE = 0 - diff --git a/configs/linux-osmesa-static b/configs/linux-osmesa-static deleted file mode 100644 index eb3575f424b..00000000000 --- a/configs/linux-osmesa-static +++ /dev/null @@ -1,15 +0,0 @@ -# Configuration for building only libOSMesa on Linux, no Xlib driver -# This doesn't really have any Linux dependencies, so it should be usable -# on other (gcc-based) systems. - -include $(TOP)/configs/linux-osmesa - -CONFIG_NAME = linux-osmesa-static - -# Compiler and flags -MKLIB_OPTIONS = -static -PIC_FLAGS = - -# Library names -OSMESA_LIB_NAME = lib$(OSMESA_LIB).a - diff --git a/configs/linux-osmesa32-static b/configs/linux-osmesa32-static deleted file mode 100644 index ecbb72ecfde..00000000000 --- a/configs/linux-osmesa32-static +++ /dev/null @@ -1,13 +0,0 @@ -# Configuration for 32 bits/channel OSMesa library on Linux - -include $(TOP)/configs/linux-osmesa32 - -CONFIG_NAME = linux-osmesa32-static - -# Compiler and flags -MKLIB_OPTIONS = -static -PIC_FLAGS = - -# Library names -OSMESA_LIB_NAME = lib$(OSMESA_LIB).a - diff --git a/debian/changelog b/debian/changelog index 192cfb35ec6..e182e873237 100644 --- a/debian/changelog +++ b/debian/changelog @@ -14,6 +14,8 @@ mesa (7.3~rc1-1) UNRELEASED; urgency=low [ 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. -- Timo Aaltonen Tue, 09 Dec 2008 01:38:42 +0200 diff --git a/debian/scripts/install-source.sh b/debian/scripts/install-source.sh deleted file mode 100755 index 5b1dcfb057d..00000000000 --- a/debian/scripts/install-source.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/sh - -if [ -n "$1" ]; then - TOP="$1" -else - TOP=`pwd` -fi - -SOURCE_DIRS=' - include/GL/internal - src/glx/x11 - src/mesa/drivers/common - src/mesa/drivers/dri/common - src/mesa/drivers/dri/glcore - src/mesa/drivers/x11 - src/mesa/glapi - src/mesa/main - src/mesa/math - src/mesa/ppc - src/mesa/shader - src/mesa/sparc - src/mesa/swrast_setup - src/mesa/swrast - src/mesa/tnl_dd - src/mesa/tnl - src/mesa/vbo - src/mesa/x86-64 - src/mesa/x86 -' - -FILTER="-not -path '*/.svn*'" -TARGET=${TOP}/debian/tmp/usr/share/mesa-source - -( - find $SOURCE_DIRS $FILTER -name '*.[ch]'; - find include/GL $FILTER -name 'xmesa*.h'; -) | \ - while read x; do - DIRNAME=`dirname "$x"` - mkdir -p "$TARGET/$DIRNAME" - cp -lf "$x" "$TARGET/$DIRNAME" - done - -# fix permissions -find "$TARGET" -type f | xargs chmod 0644 - -- cgit v1.2.3 From 47e54545ed7fa852b45b2eab9e4bff3c954c0799 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Sat, 10 Jan 2009 22:13:17 +0100 Subject: Delete some now unused code from debian/rules. --- debian/changelog | 1 + debian/rules | 4 ---- 2 files changed, 1 insertion(+), 4 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index e182e873237..03c2d8b4048 100644 --- a/debian/changelog +++ b/debian/changelog @@ -16,6 +16,7 @@ mesa (7.3~rc1-1) UNRELEASED; urgency=low * 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. -- Timo Aaltonen Tue, 09 Dec 2008 01:38:42 +0200 diff --git a/debian/rules b/debian/rules index b289a48e7c6..120319e8db4 100755 --- a/debian/rules +++ b/debian/rules @@ -22,7 +22,6 @@ 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_GNU_CPU ?= $(shell dpkg-architecture -qDEB_HOST_GNU_CPU) -DEB_HOST_ARCH_CPU ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU) DEB_BUILD_DIR ?= $(CURDIR)/obj-$(DEB_BUILD_GNU_TYPE) ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE)) confflags += --build=$(DEB_HOST_GNU_TYPE) @@ -30,9 +29,6 @@ else confflags += --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE) endif -export DEB_BUILD_ARCH -export DEB_HOST_ARCH_CPU - # choose which configurations to build include debian/scripts/choose-configs -- cgit v1.2.3 From 88083e9bab9fd9b2d6bd5aa3badad1427be0e841 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Sat, 10 Jan 2009 22:34:36 +0100 Subject: Prepare changelog for upload --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 03c2d8b4048..ee0b2dc9c93 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -mesa (7.3~rc1-1) UNRELEASED; urgency=low +mesa (7.3~rc1-1) experimental; urgency=low * New upstream release candidate. + provides DRI2 (closes: #411141). @@ -18,7 +18,7 @@ mesa (7.3~rc1-1) UNRELEASED; urgency=low switched to using autoconf, and mesa-swx11-source is gone. * Delete some now unused code from debian/rules. - -- Timo Aaltonen Tue, 09 Dec 2008 01:38:42 +0200 + -- Julien Cristau Sat, 10 Jan 2009 22:14:55 +0100 mesa (7.2-1) experimental; urgency=low -- cgit v1.2.3 From 1d4756de06e45d0d385fa53f90a7ab13e30681fe Mon Sep 17 00:00:00 2001 From: Timo Aaltonen Date: Fri, 16 Jan 2009 23:12:14 +0200 Subject: Update the changelog. --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index ee0b2dc9c93..8a94518cf2b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +mesa (7.3~rc2-1) UNRELEASED; urgency=low + + * New upstream release candidate. + + -- Timo Aaltonen Fri, 16 Jan 2009 23:06:40 +0200 + mesa (7.3~rc1-1) experimental; urgency=low * New upstream release candidate. -- cgit v1.2.3 From fcfec668657ec360aa748a97da9afc6b8932fdac Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Tue, 20 Jan 2009 18:50:10 +0000 Subject: update changelog --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 8a94518cf2b..052d3db285f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -mesa (7.3~rc2-1) UNRELEASED; urgency=low +mesa (7.3~rc3-1) UNRELEASED; urgency=low * New upstream release candidate. -- cgit v1.2.3 From f1939c868505c59798de1b88a32b633fe292ac03 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Wed, 21 Jan 2009 19:01:17 +0100 Subject: Refresh patches 03 and 04. --- debian/changelog | 4 ++++ debian/patches/03_optional-progs-and-install.patch | 12 ++++++------ debian/patches/04_osmesa_version.diff | 10 +++++----- 3 files changed, 15 insertions(+), 11 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 052d3db285f..b521e3a92f4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,7 +1,11 @@ mesa (7.3~rc3-1) UNRELEASED; urgency=low + [ Timo Aaltonen ] * New upstream release candidate. + [ Julien Cristau ] + * Refresh patches 03 and 04. + -- Timo Aaltonen Fri, 16 Jan 2009 23:06:40 +0200 mesa (7.3~rc1-1) experimental; urgency=low diff --git a/debian/patches/03_optional-progs-and-install.patch b/debian/patches/03_optional-progs-and-install.patch index 211c7a9fb7e..6eac84ae2ba 100644 --- a/debian/patches/03_optional-progs-and-install.patch +++ b/debian/patches/03_optional-progs-and-install.patch @@ -12,8 +12,8 @@ and we don't actually build it at this point. Index: mesa/progs/xdemos/Makefile =================================================================== ---- mesa.orig/progs/xdemos/Makefile 2008-07-01 15:26:56.000000000 +0300 -+++ mesa/progs/xdemos/Makefile 2008-07-01 15:48:47.000000000 +0300 +--- mesa.orig/progs/xdemos/Makefile ++++ mesa/progs/xdemos/Makefile @@ -10,7 +10,7 @@ LIBS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) $(APP_LIB_DEPS) @@ -21,9 +21,9 @@ Index: mesa/progs/xdemos/Makefile -PROGS = \ +PROGS ?= \ corender \ + glsync \ glthreads \ - glxdemo \ -@@ -60,6 +60,11 @@ +@@ -61,6 +61,11 @@ extra: $(EXTRA_PROGS) @@ -37,8 +37,8 @@ Index: mesa/progs/xdemos/Makefile -rm -f *.o *~ Index: mesa/progs/Makefile =================================================================== ---- mesa.orig/progs/Makefile 2008-07-01 15:26:56.000000000 +0300 -+++ mesa/progs/Makefile 2008-07-01 15:48:07.000000000 +0300 +--- mesa.orig/progs/Makefile ++++ mesa/progs/Makefile @@ -21,8 +21,12 @@ fi \ done diff --git a/debian/patches/04_osmesa_version.diff b/debian/patches/04_osmesa_version.diff index 573439702cd..108916c675c 100644 --- a/debian/patches/04_osmesa_version.diff +++ b/debian/patches/04_osmesa_version.diff @@ -1,17 +1,17 @@ Index: mesa/src/mesa/drivers/osmesa/Makefile =================================================================== ---- mesa.orig/src/mesa/drivers/osmesa/Makefile 2008-09-12 10:44:02.000000000 +0300 -+++ mesa/src/mesa/drivers/osmesa/Makefile 2008-09-23 16:07:40.000000000 +0300 -@@ -46,7 +46,7 @@ +--- mesa.orig/src/mesa/drivers/osmesa/Makefile ++++ mesa/src/mesa/drivers/osmesa/Makefile +@@ -45,7 +45,7 @@ - $(TOP)/lib/$(OSMESA_LIB_NAME): $(OBJECTS) + $(TOP)/$(LIB_DIR)/$(OSMESA_LIB_NAME): $(OBJECTS) $(MKLIB) -o $(OSMESA_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \ - -major $(MESA_MAJOR) -minor $(MESA_MINOR) -patch $(MESA_TINY) \ + -major 6 -minor 5 -patch 3 \ -install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) \ -id $(INSTALL_LIB_DIR)/lib$(OSMESA_LIB).$(MESA_MAJOR).dylib \ $(OSMESA_LIB_DEPS) $(OBJECTS) -@@ -58,7 +58,7 @@ +@@ -57,7 +57,7 @@ # with all the other Mesa sources (compiled with -DCHAN_BITS=16/32 osmesa16: $(OBJECTS) $(CORE_MESA) $(MKLIB) -o $(OSMESA_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \ -- cgit v1.2.3 From f5c47105dbc810d7193c4df48bbbe08351e1f5d2 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Wed, 21 Jan 2009 19:01:24 +0100 Subject: Prepare changelog for upload --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index b521e3a92f4..b40e25b4234 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -mesa (7.3~rc3-1) UNRELEASED; urgency=low +mesa (7.3~rc3-1) experimental; urgency=low [ Timo Aaltonen ] * New upstream release candidate. @@ -6,7 +6,7 @@ mesa (7.3~rc3-1) UNRELEASED; urgency=low [ Julien Cristau ] * Refresh patches 03 and 04. - -- Timo Aaltonen Fri, 16 Jan 2009 23:06:40 +0200 + -- Julien Cristau Wed, 21 Jan 2009 19:01:21 +0100 mesa (7.3~rc1-1) experimental; urgency=low -- cgit v1.2.3 From a2dce491582c58673f19e55a98f0bb697ba00b40 Mon Sep 17 00:00:00 2001 From: Timo Aaltonen Date: Sun, 25 Jan 2009 17:51:16 +0200 Subject: New changelog entry for 7.3 --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index b40e25b4234..7b5b11b3a9f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +mesa (7.3-1) UNRELEASED; urgency=low + + * New upstream release. + + -- Timo Aaltonen Sun, 25 Jan 2009 17:31:25 +0200 + mesa (7.3~rc3-1) experimental; urgency=low [ Timo Aaltonen ] -- cgit v1.2.3 From a314c40cc46a75706877381e70df839a465ee969 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Fri, 30 Jan 2009 19:42:38 +0100 Subject: Document my changes in debian/changelog --- debian/changelog | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 7b5b11b3a9f..bd6d20cd43f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,7 +1,12 @@ mesa (7.3-1) UNRELEASED; 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. + -- Timo Aaltonen Sun, 25 Jan 2009 17:31:25 +0200 mesa (7.3~rc3-1) experimental; urgency=low -- cgit v1.2.3 From cff0971f87b6a2897e48416c61dd8919a8178b1a Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Fri, 30 Jan 2009 20:00:37 +0100 Subject: Prepare changelog for upload --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index bd6d20cd43f..09b87fdd791 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -mesa (7.3-1) UNRELEASED; urgency=low +mesa (7.3-1) experimental; urgency=low [ Timo Aaltonen ] * New upstream release. @@ -7,7 +7,7 @@ mesa (7.3-1) UNRELEASED; urgency=low * Try to make the diff a bit smaller by removing directories that are in upstream git but not in tarballs. - -- Timo Aaltonen Sun, 25 Jan 2009 17:31:25 +0200 + -- Julien Cristau Fri, 30 Jan 2009 20:00:34 +0100 mesa (7.3~rc3-1) experimental; urgency=low -- cgit v1.2.3 From 3cad3d28a5eb0dc9c3a5c156286f8fc0326288de Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Sat, 31 Jan 2009 22:07:51 +0100 Subject: mangle upstream version in debian/watch Fix watch file to make uscan not consider release candidates as newer than actual releases. --- debian/changelog | 7 +++++++ debian/watch | 1 + 2 files changed, 8 insertions(+) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 09b87fdd791..e06a1caeda4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +mesa (7.3-2) UNRELEASED; urgency=low + + * Fix watch file to make uscan not consider release candidates as newer than + actual releases. + + -- Julien Cristau Sat, 31 Jan 2009 22:06:36 +0100 + mesa (7.3-1) experimental; urgency=low [ Timo Aaltonen ] diff --git a/debian/watch b/debian/watch index 75441ad9de1..b3b258a5777 100644 --- a/debian/watch +++ b/debian/watch @@ -1,2 +1,3 @@ version=3 +opts="uversionmangle=s/-rc/~rc/" \ http://sf.net/mesa3d/MesaLib-(.*)\.tar\.gz -- cgit v1.2.3 From 4672811541f0e7b53c223568644cb938ec22dff4 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Sat, 31 Jan 2009 22:30:15 +0100 Subject: debian/control: build the dri drivers on lpia add lpia to the Architecture field for libgl1-mesa-dri{,-dbg} to match Ubuntu. --- debian/changelog | 2 ++ debian/control | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index e06a1caeda4..46c0f5adc18 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,8 @@ mesa (7.3-2) UNRELEASED; urgency=low * 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. -- Julien Cristau Sat, 31 Jan 2009 22:06:36 +0100 diff --git a/debian/control b/debian/control index 0a8f72f1291..013329d7388 100644 --- a/debian/control +++ b/debian/control @@ -162,7 +162,7 @@ Description: Debugging symbols for the Mesa GLX runtime Package: libgl1-mesa-dri Section: libs Priority: optional -Architecture: alpha amd64 arm armeb armel hppa i386 ia64 kfreebsd-i386 kfreebsd-amd64 m68k mips mipsel powerpc s390 sparc +Architecture: alpha amd64 arm armeb armel hppa i386 ia64 kfreebsd-i386 kfreebsd-amd64 lpia m68k mips mipsel powerpc s390 sparc Depends: ${shlibs:Depends}, libgl1-mesa-glx (= ${binary:Version}) Suggests: libglide3 Conflicts: xlibmesa-dri (<< 1:7.0.0) @@ -183,7 +183,7 @@ Description: A free implementation of the OpenGL API -- DRI modules Package: libgl1-mesa-dri-dbg Section: libdevel Priority: extra -Architecture: alpha amd64 arm armeb armel hppa i386 ia64 kfreebsd-i386 kfreebsd-amd64 m68k mips mipsel powerpc s390 sparc +Architecture: alpha amd64 arm armeb armel hppa i386 ia64 kfreebsd-i386 kfreebsd-amd64 lpia m68k mips mipsel powerpc s390 sparc Depends: libgl1-mesa-dri (= ${binary:Version}) Description: Debugging symbols for the Mesa DRI modules This version of Mesa provides GLX and DRI capabilities: it is capable of -- cgit v1.2.3 From 9a3a20b2b9f893f5b561aa596699d5c72cbe0f4f Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Sat, 31 Jan 2009 23:04:06 +0100 Subject: debian/rules: on lpia, only build the i915 and i965 dri drivers Based on Ubuntu changes, modified to also build swrast. --- debian/changelog | 2 ++ debian/rules | 13 ++++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 46c0f5adc18..bb619bb39ab 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,8 @@ mesa (7.3-2) UNRELEASED; urgency=low 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). -- Julien Cristau Sat, 31 Jan 2009 22:06:36 +0100 diff --git a/debian/rules b/debian/rules index 120319e8db4..1583dac02ef 100755 --- a/debian/rules +++ b/debian/rules @@ -63,15 +63,18 @@ ifeq ($(DEB_HOST_ARCH_OS), hurd) DIRECT_RENDERING = --disable-driglx-direct else DIRECT_RENDERING = --enable-driglx-direct + ifeq ($(DEB_HOST_ARCH), lpia) + DRI_DRIVERS += i915 i965 + else DRI_DRIVERS += mach64 mga r128 r200 r300 radeon s3v savage tdfx trident -endif - -ifeq ($(DEB_HOST_GNU_CPU), i486) + ifeq ($(DEB_HOST_GNU_CPU), i486) DRI_DRIVERS += i810 i915 i965 sis unichrome -else ifeq ($(DEB_HOST_GNU_CPU), x86_64) + else ifeq ($(DEB_HOST_GNU_CPU), x86_64) DRI_DRIVERS += i915 i965 sis unichrome -else ifeq ($(DEB_HOST_ARCH), sparc) + else ifeq ($(DEB_HOST_ARCH), sparc) DRI_DRIVERS += ffb + endif + endif endif confflags-dri = \ -- cgit v1.2.3 From 8d088cd34f6e68b4ecf96dbfa55e27c8b4151ce3 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Mon, 23 Mar 2009 17:25:04 +0100 Subject: update changelog --- debian/changelog | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index bb619bb39ab..516e1624959 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,6 @@ -mesa (7.3-2) UNRELEASED; urgency=low +mesa (7.4~rc1-1) UNRELEASED; 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 -- cgit v1.2.3 From 7d014295123f273d111900e61695bed364c89204 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Wed, 25 Mar 2009 01:51:02 +0100 Subject: Build-depend on linux-libc-dev >= 2.6.29 on linux archs. The 2.6.28 kernel headers miss some compat defines. --- debian/changelog | 1 + debian/control | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 516e1624959..ae73de0b601 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,6 +7,7 @@ mesa (7.4~rc1-1) UNRELEASED; urgency=low 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 Sat, 31 Jan 2009 22:06:36 +0100 diff --git a/debian/control b/debian/control index 013329d7388..c3f36f4e58d 100644 --- a/debian/control +++ b/debian/control @@ -8,7 +8,8 @@ Build-Depends: debhelper (>= 5), quilt (>= 0.40), pkg-config, libdrm-dev (>= 2.4.3) [!hurd-i386], libx11-dev, xutils-dev, x11proto-gl-dev (>= 1.4.8), libxxf86vm-dev, libexpat1-dev, lesstif2-dev, dpkg-dev (>= 1.13.19), libxfixes-dev, - libxdamage-dev, libxext-dev, autoconf, automake, x11proto-dri2-dev (>= 1.99.3) + libxdamage-dev, libxext-dev, autoconf, automake, x11proto-dri2-dev (>= 1.99.3), + linux-libc-dev (>= 2.6.29) [!hurd-i386 !kfreebsd-amd64 !kfreebsd-i386] 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/ -- cgit v1.2.3 From af3c5684757b152a997df351758955cf44f1b71c Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Wed, 25 Mar 2009 11:34:58 +0100 Subject: Prepare changelog for upload --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index ae73de0b601..d8ec2bd367d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -mesa (7.4~rc1-1) UNRELEASED; urgency=low +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 @@ -9,7 +9,7 @@ mesa (7.4~rc1-1) UNRELEASED; urgency=low Ubuntu changes). * Build-depend on linux-libc-dev >= 2.6.29 on linux archs. - -- Julien Cristau Sat, 31 Jan 2009 22:06:36 +0100 + -- Julien Cristau Wed, 25 Mar 2009 11:34:42 +0100 mesa (7.3-1) experimental; urgency=low -- cgit v1.2.3 From 4830fab603b55ed22d091dc33381895a72053388 Mon Sep 17 00:00:00 2001 From: Timo Aaltonen Date: Mon, 30 Mar 2009 10:41:39 +0300 Subject: update the changelog. --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index d8ec2bd367d..d58b4fbf527 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +mesa (7.4-1) UNRELEASED; urgency=low + + * New upstream release. + + -- Timo Aaltonen Mon, 30 Mar 2009 10:41:04 +0300 + mesa (7.4~rc1-1) experimental; urgency=low * New upstream release candidate. -- cgit v1.2.3 From 99f159339ea2a9b6f64952e4ccac48ba665a57f7 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Wed, 1 Apr 2009 20:25:25 +0200 Subject: Prepare changelog for upload --- debian/changelog | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index d58b4fbf527..5c15ddc3c8e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,9 @@ -mesa (7.4-1) UNRELEASED; urgency=low +mesa (7.4-1) experimental; urgency=low + [ Timo Aaltonen ] * New upstream release. - -- Timo Aaltonen Mon, 30 Mar 2009 10:41:04 +0300 + -- Julien Cristau Wed, 01 Apr 2009 20:25:00 +0200 mesa (7.4~rc1-1) experimental; urgency=low -- cgit v1.2.3 From 3d81e934e583d3f5ce5e3aa7093f54fee3c11cf0 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Wed, 8 Apr 2009 23:53:54 +0100 Subject: Upload to unstable. --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 5c15ddc3c8e..902a6d05470 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +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 ] -- cgit v1.2.3 From c422347bee0b346a7db7fccfe6e8a60f359b28ac Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Wed, 15 Apr 2009 19:27:47 +0200 Subject: 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. --- debian/changelog | 8 ++++++++ debian/control | 12 ++++++------ debian/rules | 14 -------------- 3 files changed, 14 insertions(+), 20 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 902a6d05470..dd2337e5b9f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +mesa (7.4-3) UNRELEASED; urgency=low + + * 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. + + -- Julien Cristau Wed, 15 Apr 2009 19:25:50 +0200 + mesa (7.4-2) unstable; urgency=low * Upload to unstable. diff --git a/debian/control b/debian/control index c3f36f4e58d..97ef61e7c73 100644 --- a/debian/control +++ b/debian/control @@ -89,7 +89,7 @@ Package: libgl1-mesa-swx11-dev Section: libdevel Priority: extra Architecture: any -Depends: libgl1-mesa-swx11 (= ${binary:Version}), libc6-dev, libx11-dev, libxext6, mesa-common-dev (= ${source:Version}) +Depends: libgl1-mesa-swx11 (= ${binary:Version}), libc6-dev, libx11-dev, libxext6, mesa-common-dev (= ${binary:Version}) 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 @@ -222,8 +222,8 @@ Description: Debugging symbols for the Mesa DRI modules Package: libgl1-mesa-dev Section: libdevel -Architecture: all -Depends: libc6-dev, mesa-common-dev (= ${source:Version}), libgl1-mesa-glx (>= ${source:Upstream-Version}) +Architecture: any +Depends: libc6-dev, mesa-common-dev (= ${binary:Version}), libgl1-mesa-glx (= ${binary:Version}) Conflicts: libgl-dev, libgl1-mesa-dri-dev Replaces: libgl-dev, libgl1-mesa-dri-dev Provides: libgl-dev, libgl1-mesa-dri-dev @@ -240,7 +240,7 @@ Description: A free implementation of the OpenGL API -- GLX development files Package: mesa-common-dev Section: libdevel -Architecture: all +Architecture: any Replaces: xlibmesa-gl-dev (<< 1:7), xlibosmesa-dev, libgl1-mesa-swx11-dev (<< 6.5.2), libgl1-mesa-dev (<< 6.5.2) Depends: libx11-dev Description: Developer documentation for Mesa @@ -264,7 +264,7 @@ Description: Mesa Off-screen rendering extension Package: libosmesa6-dev Section: libdevel Architecture: any -Depends: libosmesa6 (= ${binary:Version}), mesa-common-dev (= ${source:Version}) | libgl-dev +Depends: libosmesa6 (= ${binary:Version}), mesa-common-dev (= ${binary:Version}) | libgl-dev 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 @@ -329,7 +329,7 @@ Description: A free implementation of the OpenGL API -- runtime Package: libglw1-mesa-dev Section: libdevel Architecture: any -Depends: libglw1-mesa (= ${binary:Version}), libc6-dev, libx11-dev, libxext6, mesa-common-dev (= ${source:Version}) +Depends: libglw1-mesa (= ${binary:Version}), libc6-dev, libx11-dev, libxext6, mesa-common-dev (= ${binary:Version}) Provides: mesag3-widgets, mesag-widgets-dev, libglw-dev Conflicts: libglw-dev, libgl1-mesa-swx11-dev (<< 6.5.2-4) Replaces: libglw-dev diff --git a/debian/rules b/debian/rules index 1583dac02ef..a73b4da8750 100755 --- a/debian/rules +++ b/debian/rules @@ -207,20 +207,6 @@ clean: unpatch # Build architecture-independent files here. binary-indep: install - dh_testdir - dh_testroot - dh_installchangelogs -i - dh_installdocs -i - dh_installexamples -i - dh_install --sourcedir=debian/tmp --list-missing -i - dh_installman -i - dh_link -i - dh_compress -i - dh_fixperms -i - dh_installdeb -i - dh_gencontrol -i - dh_md5sums -i - dh_builddeb -i # Build architecture-dependent files here. binary-arch: install -- cgit v1.2.3 From 5d4659e7c7824e7650aa1896da3ceedde1845228 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Wed, 15 Apr 2009 21:31:24 +0200 Subject: Install pkgconfig files for libGLU, libOSMesa and libGLw. --- debian/changelog | 1 + debian/libglu1-mesa-dev.install | 1 + debian/libglw1-mesa-dev.install | 1 + debian/libosmesa6-dev.install | 1 + 4 files changed, 4 insertions(+) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index dd2337e5b9f..afdc88c63b9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,7 @@ mesa (7.4-3) UNRELEASED; urgency=low * 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. -- Julien Cristau Wed, 15 Apr 2009 19:25:50 +0200 diff --git a/debian/libglu1-mesa-dev.install b/debian/libglu1-mesa-dev.install index 78ac2b01eda..a3df1f9e7fb 100644 --- a/debian/libglu1-mesa-dev.install +++ b/debian/libglu1-mesa-dev.install @@ -2,3 +2,4 @@ usr/include/GL/glu.h usr/include/GL/glu_mangle.h usr/lib/libGLU.a usr/lib/libGLU.so +usr/lib/pkgconfig/glu.pc diff --git a/debian/libglw1-mesa-dev.install b/debian/libglw1-mesa-dev.install index 7c03280c337..c11a20914e9 100644 --- a/debian/libglw1-mesa-dev.install +++ b/debian/libglw1-mesa-dev.install @@ -1,3 +1,4 @@ usr/include/GL/GLw*A.h usr/lib/libGLw.a usr/lib/libGLw.so +usr/lib/pkgconfig/glw.pc diff --git a/debian/libosmesa6-dev.install b/debian/libosmesa6-dev.install index 149a1bd7891..bea6492b0c0 100644 --- a/debian/libosmesa6-dev.install +++ b/debian/libosmesa6-dev.install @@ -5,3 +5,4 @@ usr/lib/libOSMesa16.a usr/lib/libOSMesa16.so usr/lib/libOSMesa32.a usr/lib/libOSMesa32.so +usr/lib/pkgconfig/osmesa.pc -- cgit v1.2.3 From 4deb679b420fb97c80c2fb4a271f796ec256e119 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Sat, 18 Apr 2009 22:27:47 +0200 Subject: Make libgl1-mesa-dri 'Architecture: any' swrast_dri.so should get built everywhere. --- debian/changelog | 2 ++ debian/control | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index afdc88c63b9..d17afc81b5c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,8 @@ mesa (7.4-3) UNRELEASED; urgency=low 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 'Architecture: any', as swrast_dri.so should get + built everywhere. -- Julien Cristau Wed, 15 Apr 2009 19:25:50 +0200 diff --git a/debian/control b/debian/control index 97ef61e7c73..e012ca62e0e 100644 --- a/debian/control +++ b/debian/control @@ -163,7 +163,7 @@ Description: Debugging symbols for the Mesa GLX runtime Package: libgl1-mesa-dri Section: libs Priority: optional -Architecture: alpha amd64 arm armeb armel hppa i386 ia64 kfreebsd-i386 kfreebsd-amd64 lpia m68k mips mipsel powerpc s390 sparc +Architecture: any Depends: ${shlibs:Depends}, libgl1-mesa-glx (= ${binary:Version}) Suggests: libglide3 Conflicts: xlibmesa-dri (<< 1:7.0.0) -- cgit v1.2.3 From 909afc5304a24499b64579122bcc07abdb5747a3 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Sat, 18 Apr 2009 22:28:35 +0200 Subject: Adjust libgl1-mesa-glx and libgl1-mesa-dri package relationships 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. --- debian/changelog | 6 ++++++ debian/control | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index d17afc81b5c..d4ca3598feb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,6 +6,12 @@ mesa (7.4-3) UNRELEASED; urgency=low * Install pkgconfig files for libGLU, libOSMesa and libGLw. * Make libgl1-mesa-dri '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. -- Julien Cristau Wed, 15 Apr 2009 19:25:50 +0200 diff --git a/debian/control b/debian/control index e012ca62e0e..eeec53b38cf 100644 --- a/debian/control +++ b/debian/control @@ -106,6 +106,7 @@ Package: libgl1-mesa-glx Section: libs Architecture: any Depends: ${shlibs: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 @@ -164,10 +165,11 @@ Package: libgl1-mesa-dri Section: libs Priority: optional Architecture: any -Depends: ${shlibs:Depends}, libgl1-mesa-glx (= ${binary:Version}) +Depends: ${shlibs: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 -- cgit v1.2.3 From 4f2bc058f34f3dc5a7cafe601741e5207b3e7e70 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Sun, 19 Apr 2009 00:46:32 +0200 Subject: Add patch by Samuel Thibault to fix FTBFS on hurd-i386. --- debian/changelog | 1 + debian/patches/05_hurd-ftbfs.diff | 103 ++++++++++++++++++++++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 105 insertions(+) create mode 100644 debian/patches/05_hurd-ftbfs.diff (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index d4ca3598feb..dbdfe0f148c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -12,6 +12,7 @@ mesa (7.4-3) UNRELEASED; urgency=low 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. -- Julien Cristau Wed, 15 Apr 2009 19:25:50 +0200 diff --git a/debian/patches/05_hurd-ftbfs.diff b/debian/patches/05_hurd-ftbfs.diff new file mode 100644 index 00000000000..7037a1d2c70 --- /dev/null +++ b/debian/patches/05_hurd-ftbfs.diff @@ -0,0 +1,103 @@ +From: Samuel Thibault +Subject: Fix build on GNU/Hurd + +Index: mesa/src/glx/x11/dri2.c +=================================================================== +--- mesa.orig/src/glx/x11/dri2.c ++++ mesa/src/glx/x11/dri2.c +@@ -30,6 +30,7 @@ + * Kristian Høgsberg (krh@redhat.com) + */ + ++#ifdef GLX_DIRECT_RENDERING + + #define NEED_REPLIES + #include +@@ -299,3 +300,4 @@ + UnlockDisplay(dpy); + SyncHandle(); + } ++#endif +Index: mesa/include/GL/internal/dri_interface.h +=================================================================== +--- mesa.orig/include/GL/internal/dri_interface.h ++++ mesa/include/GL/internal/dri_interface.h +@@ -41,7 +41,7 @@ + #define DRI_INTERFACE_H + + /* For archs with no drm.h */ +-#if !defined(__APPLE__) && !defined(__CYGWIN__) ++#if !defined(__APPLE__) && !defined(__CYGWIN__) && !defined(__GNU__) + #include + #else + typedef unsigned int drm_context_t; +Index: mesa/configure.ac +=================================================================== +--- mesa.orig/configure.ac ++++ mesa/configure.ac +@@ -87,7 +87,7 @@ + DEFINES="" + AC_SUBST([DEFINES]) + case "$host_os" in +-linux*|*-gnu*) ++linux*|*-gnu*|gnu*) + DEFINES="$DEFINES -D_GNU_SOURCE -DPTHREADS" + ;; + solaris*) +@@ -490,6 +490,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 for DRI @<:@default=enabled@:>@])], ++ [driglx_direct="$enableval"], ++ [driglx_direct="yes"]) ++ + dnl + dnl libGL configuration per driver + dnl +@@ -523,11 +530,13 @@ + 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]) +- GL_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED dri2proto >= $DRI2PROTO_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]) ++ GL_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED dri2proto >= $DRI2PROTO_REQUIRED" ++ DRI_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED" ++ fi + + # find the DRI deps for libGL + if test "$x11_pkgconfig" = yes; then +@@ -594,12 +603,6 @@ + [DRI_DRIVER_INSTALL_DIR="$withval"], + [DRI_DRIVER_INSTALL_DIR='${libdir}/dri']) + AC_SUBST([DRI_DRIVER_INSTALL_DIR]) +-dnl Direct rendering or just indirect rendering +-AC_ARG_ENABLE([driglx-direct], +- [AS_HELP_STRING([--disable-driglx-direct], +- [enable direct rendering in GLX 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...@:>@], +@@ -698,6 +701,10 @@ + unichrome savage sis swrast" + fi + ;; ++ gnu*) ++ DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER" ++ DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING -DHAVE_ALIAS" ++ ;; + solaris*) + DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER" + DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING" diff --git a/debian/patches/series b/debian/patches/series index 86f17dca4fc..807b3503a15 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,3 +1,4 @@ 02_use-ieee-fp-on-s390-and-m68k.patch 03_optional-progs-and-install.patch 04_osmesa_version.diff +05_hurd-ftbfs.diff -- cgit v1.2.3 From d7b9a6c9ef2c825f8c1e94fcbbaa053ae4cf813e Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Mon, 20 Apr 2009 12:34:07 +0200 Subject: Add patch by Aurelien Jarno to fix FTBPS on kfreebsd-i386 --- debian/changelog | 6 +++++- debian/patches/06_kfreebsd-ftbfs.diff | 16 ++++++++++++++++ debian/patches/series | 1 + 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 debian/patches/06_kfreebsd-ftbfs.diff (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index dbdfe0f148c..1d8e94f1de3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,6 @@ mesa (7.4-3) UNRELEASED; 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. @@ -14,7 +15,10 @@ mesa (7.4-3) UNRELEASED; urgency=low incompatibilities. * Add patch by Samuel Thibault to fix FTBFS on hurd-i386. - -- Julien Cristau Wed, 15 Apr 2009 19:25:50 +0200 + [ Brice Goglin ] + * Add patch by Aurelien Jarno to fix FTBFS on kfreebsd-i386, closes: #524690. + + -- Brice Goglin Mon, 20 Apr 2009 12:33:45 +0200 mesa (7.4-2) unstable; urgency=low diff --git a/debian/patches/06_kfreebsd-ftbfs.diff b/debian/patches/06_kfreebsd-ftbfs.diff new file mode 100644 index 00000000000..ee78b28ab2a --- /dev/null +++ b/debian/patches/06_kfreebsd-ftbfs.diff @@ -0,0 +1,16 @@ +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 + +--- mesa-7.4.orig/configure.ac ++++ mesa-7.4/configure.ac +@@ -680,7 +680,7 @@ + ;; + esac + ;; +- freebsd* | dragonfly*) ++ freebsd* | dragonfly* | kfreebsd*-gnu*) + DEFINES="$DEFINES -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1" + DEFINES="$DEFINES -DIN_DRI_DRIVER -DHAVE_ALIAS" diff --git a/debian/patches/series b/debian/patches/series index 807b3503a15..1f29aca4b02 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -2,3 +2,4 @@ 03_optional-progs-and-install.patch 04_osmesa_version.diff 05_hurd-ftbfs.diff +06_kfreebsd-ftbfs.diff -- cgit v1.2.3 From 914edc46fa5e8c0f6807a0fca0f3f7be201d66bb Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Sun, 3 May 2009 14:31:05 +0200 Subject: Update changelog --- debian/changelog | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 1d8e94f1de3..dce00a3978e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -mesa (7.4-3) UNRELEASED; urgency=low +mesa (7.4.1-1) UNRELEASED; urgency=low [ Julien Cristau ] * Make libgl1-mesa-dev and mesa-common-dev 'Architecture: any'. This gets @@ -14,6 +14,7 @@ mesa (7.4-3) UNRELEASED; urgency=low 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). [ Brice Goglin ] * Add patch by Aurelien Jarno to fix FTBFS on kfreebsd-i386, closes: #524690. -- cgit v1.2.3 From ec44d955bb3a3e470e106cafc5020562a81e8543 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Sun, 3 May 2009 16:03:58 +0200 Subject: Move -dbg packages to new 'debug' section. --- debian/changelog | 1 + debian/control | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index dce00a3978e..2e151905f10 100644 --- a/debian/changelog +++ b/debian/changelog @@ -15,6 +15,7 @@ mesa (7.4.1-1) UNRELEASED; urgency=low 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. diff --git a/debian/control b/debian/control index eeec53b38cf..4d28caf888c 100644 --- a/debian/control +++ b/debian/control @@ -37,7 +37,7 @@ Description: A free implementation of the OpenGL API -- runtime On Linux, this library is also known as libGL or libGL.so.1. Package: libgl1-mesa-swx11-dbg -Section: libdevel +Section: debug Priority: extra Architecture: any Depends: libgl1-mesa-swx11 (= ${binary:Version}) @@ -122,7 +122,7 @@ Description: A free implementation of the OpenGL API -- GLX runtime libgl1-mesa-swx11 package. Package: libgl1-mesa-glx-dbg -Section: libdevel +Section: debug Priority: extra Architecture: any Depends: libgl1-mesa-glx (= ${binary:Version}) @@ -184,7 +184,7 @@ Description: A free implementation of the OpenGL API -- DRI modules The tdfx DRI module needs libglide3 to enable direct rendering. Package: libgl1-mesa-dri-dbg -Section: libdevel +Section: debug Priority: extra Architecture: alpha amd64 arm armeb armel hppa i386 ia64 kfreebsd-i386 kfreebsd-amd64 lpia m68k mips mipsel powerpc s390 sparc Depends: libgl1-mesa-dri (= ${binary:Version}) -- cgit v1.2.3 From b651c02dcac897bb138b35ff69bdfe0d06e8620a Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Sun, 3 May 2009 16:04:39 +0200 Subject: Fix Architecture field for libgl1-mesa-dri-dbg --- debian/changelog | 4 ++-- debian/control | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 2e151905f10..e817a17937d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,8 +5,8 @@ mesa (7.4.1-1) UNRELEASED; urgency=low 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 'Architecture: any', as swrast_dri.so should get - built everywhere. + * 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 diff --git a/debian/control b/debian/control index 4d28caf888c..23c35c86c0a 100644 --- a/debian/control +++ b/debian/control @@ -186,7 +186,7 @@ Description: A free implementation of the OpenGL API -- DRI modules Package: libgl1-mesa-dri-dbg Section: debug Priority: extra -Architecture: alpha amd64 arm armeb armel hppa i386 ia64 kfreebsd-i386 kfreebsd-amd64 lpia m68k mips mipsel powerpc s390 sparc +Architecture: any Depends: libgl1-mesa-dri (= ${binary:Version}) Description: Debugging symbols for the Mesa DRI modules This version of Mesa provides GLX and DRI capabilities: it is capable of -- cgit v1.2.3 From 4842cde28f3b07fabf05f26b53305e02deb8db24 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Sun, 3 May 2009 16:05:30 +0200 Subject: Prepare changelog for upload --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index e817a17937d..f074fb4e525 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -mesa (7.4.1-1) UNRELEASED; urgency=low +mesa (7.4.1-1) unstable; urgency=low [ Julien Cristau ] * Make libgl1-mesa-dev and mesa-common-dev 'Architecture: any'. This gets @@ -20,7 +20,7 @@ mesa (7.4.1-1) UNRELEASED; urgency=low [ Brice Goglin ] * Add patch by Aurelien Jarno to fix FTBFS on kfreebsd-i386, closes: #524690. - -- Brice Goglin Mon, 20 Apr 2009 12:33:45 +0200 + -- Julien Cristau Sun, 03 May 2009 16:05:09 +0200 mesa (7.4-2) unstable; urgency=low -- cgit v1.2.3 From 84ae506072f388da99f03060458449031bc2eec2 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Sun, 3 May 2009 19:30:02 +0200 Subject: Don't build hardware dri drivers on s390. --- debian/changelog | 6 ++++++ debian/rules | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index f074fb4e525..a803e08db40 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +mesa (7.4.1-2) UNRELEASED; urgency=low + + * Don't build hardware dri drivers on s390. + + -- Julien Cristau Sun, 03 May 2009 19:22:59 +0200 + mesa (7.4.1-1) unstable; urgency=low [ Julien Cristau ] diff --git a/debian/rules b/debian/rules index a73b4da8750..fa85ef4b268 100755 --- a/debian/rules +++ b/debian/rules @@ -65,7 +65,7 @@ else DIRECT_RENDERING = --enable-driglx-direct ifeq ($(DEB_HOST_ARCH), lpia) DRI_DRIVERS += i915 i965 - else + else ifneq ($(DEB_HOST_ARCH), s390) DRI_DRIVERS += mach64 mga r128 r200 r300 radeon s3v savage tdfx trident ifeq ($(DEB_HOST_GNU_CPU), i486) DRI_DRIVERS += i810 i915 i965 sis unichrome -- cgit v1.2.3 From ab885d7088c450a0761e54c7c6b2d7f997e06d88 Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Sat, 9 May 2009 20:49:15 +0200 Subject: Enable motif in GLw --- debian/changelog | 6 +++++- debian/rules | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index a803e08db40..6cfe95add77 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,12 @@ mesa (7.4.1-2) UNRELEASED; urgency=low + [ Julien Cristau ] * Don't build hardware dri drivers on s390. - -- Julien Cristau Sun, 03 May 2009 19:22:59 +0200 + [ Brice Goglin ] + * Enable motif in GLw, closes: #527483. + + -- Brice Goglin Sat, 09 May 2009 20:48:55 +0200 mesa (7.4.1-1) unstable; urgency=low diff --git a/debian/rules b/debian/rules index fa85ef4b268..17ca3285c34 100755 --- a/debian/rules +++ b/debian/rules @@ -129,6 +129,7 @@ confflags-swx11+glu = \ --disable-gl-osmesa \ --with-demos= \ --disable-glut \ + --enable-motif \ CFLAGS="$(CFLAGS)" confflags-swx11+glu-static = \ @@ -137,6 +138,7 @@ confflags-swx11+glu-static = \ --enable-static \ --with-demos= \ --disable-glut \ + --enable-motif \ CFLAGS="$(CFLAGS)" confflags-swx11+glu-i386-i686 = \ @@ -144,6 +146,7 @@ confflags-swx11+glu-i386-i686 = \ --disable-gl-osmesa \ --with-demos= \ --disable-glut \ + --enable-motif \ --libdir=/usr/lib/i686/cmov \ CFLAGS="$(CFLAGS) -march=i686" -- cgit v1.2.3