diff options
author | Nicolai Haehnle <nhaehnle@gmail.com> | 2008-09-28 18:28:05 +0200 |
---|---|---|
committer | Nicolai Haehnle <nhaehnle@gmail.com> | 2008-09-28 18:47:13 +0200 |
commit | 3dba9178ec5dbf8183a5ceee701c9a36606ad464 (patch) | |
tree | 51276417f55673bb44810780d222516c84672a3e | |
parent | 857362ef14fc4f175a9d425a74f9ca2b691971d6 (diff) | |
parent | 2e5d717007ba6515b094b9af8ed869130185a308 (diff) |
Merge branch 'master' into develop
Conflicts:
src/mesa/drivers/dri/r300/r300_tex.c
src/mesa/drivers/dri/r300/r300_texstate.c
src/mesa/drivers/dri/r300/radeon_context.c
src/mesa/drivers/dri/r300/radeon_context.h
1230 files changed, 26267 insertions, 25034 deletions
@@ -174,10 +174,10 @@ ultrix-gcc: # Rules for making release tarballs -DIRECTORY = Mesa-7.1-rc3 -LIB_NAME = MesaLib-7.1-rc3 -DEMO_NAME = MesaDemos-7.1-rc3 -GLUT_NAME = MesaGLUT-7.1-rc3 +DIRECTORY = Mesa-7.1-rc4 +LIB_NAME = MesaLib-7.1-rc4 +DEMO_NAME = MesaDemos-7.1-rc4 +GLUT_NAME = MesaGLUT-7.1-rc4 MAIN_FILES = \ $(DIRECTORY)/Makefile* \ @@ -340,6 +340,8 @@ SGI_GLU_FILES = \ $(DIRECTORY)/src/glu/sgi/glu.def \ $(DIRECTORY)/src/glu/sgi/dummy.cc \ $(DIRECTORY)/src/glu/sgi/descrip.mms \ + $(DIRECTORY)/src/glu/sgi/glu.exports \ + $(DIRECTORY)/src/glu/sgi/glu.exports.darwin \ $(DIRECTORY)/src/glu/sgi/mesaglu.opt \ $(DIRECTORY)/src/glu/sgi/include/gluos.h \ $(DIRECTORY)/src/glu/sgi/libnurbs/interface/*.h \ @@ -395,7 +397,8 @@ DEMO_FILES = \ $(DIRECTORY)/progs/samples/*.c \ $(DIRECTORY)/progs/glsl/Makefile* \ $(DIRECTORY)/progs/glsl/*.c \ - $(DIRECTORY)/progs/glsl/*.txt \ + $(DIRECTORY)/progs/glsl/*.frag \ + $(DIRECTORY)/progs/glsl/*.vert \ $(DIRECTORY)/progs/windml/Makefile.ugl \ $(DIRECTORY)/progs/windml/*.c \ $(DIRECTORY)/progs/windml/*.bmp \ @@ -43,7 +43,7 @@ ARCH="auto" ARCHOPT="" NOPREFIX=0 EXPORTS="" - +ID="" # # Parse arguments @@ -75,6 +75,7 @@ do echo ' -altopts OPTS alternate options to override all others' echo " -noprefix don't prefix library name with 'lib' nor add any suffix" echo ' -exports FILE only export the symbols listed in FILE' + echo ' -id NAME Sets the id of the dylib (Darwin)' echo ' -h, --help display this information and exit' exit 1 ;; @@ -153,6 +154,10 @@ do shift 1; EXPORTS=$1 ;; + '-id') + shift 1; + ID=$1 + ;; -*) echo "mklib: Unknown option: " $1 ; exit 1 @@ -196,6 +201,7 @@ if [ ] ; then echo PATCH is $PATCH echo DEPS are $DEPS echo "EXPORTS in" $EXPORTS + echo ID is $ID echo "-----------------" fi @@ -630,13 +636,19 @@ case $ARCH in LIBSUFFIX="bundle" OPTS="${ARCHOPT} -bundle -multiply_defined suppress" else - LIBSUFFIX="dylib" - OPTS="${ARCHOPT} -dynamiclib -multiply_defined suppress -current_version ${MAJOR}.${MINOR}.0 -compatibility_version ${MAJOR}.${MINOR}.0 -install_name lib${LIBNAME}.${MAJOR}.${LIBSUFFIX}" + LIBSUFFIX="dylib" + if [ -z "$ID" ] ; then + ID="lib${LIBNAME}.${MAJOR}.${LIBSUFFIX}" + fi + OPTS="${ARCHOPT} -dynamiclib -multiply_defined suppress -current_version ${MAJOR}.${MINOR}.0 -compatibility_version ${MAJOR}.${MINOR}.0 -install_name ${ID}" fi if [ ${EXPORTS} ] ; then + if [ -f ${EXPORTS}".darwin" ] ; then + EXPORTS=$EXPORTS".darwin" + fi OPTS="${OPTS} -exported_symbols_list ${EXPORTS}" - fi + fi LINKNAME="lib${LIBNAME}.${MAJOR}.${LIBSUFFIX}" LINKNAME2="lib${LIBNAME}.${LIBSUFFIX}" diff --git a/configs/darwin b/configs/darwin index c7f94d2bad..42897ac033 100644 --- a/configs/darwin +++ b/configs/darwin @@ -4,22 +4,26 @@ include $(TOP)/configs/default CONFIG_NAME = darwin -DEFINES = -D_DARWIN_C_SOURCE -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L \ - -D_SVID_SOURCE -D_BSD_SOURCE -D_GNU_SOURCE \ - -DPTHREADS -DGLX_ALIAS_UNSUPPORTED -DGLX_INDIRECT_RENDERING +INSTALL_DIR = /usr/X11 # Compiler and flags CC = gcc CXX = gcc -CFLAGS = -I/usr/X11/include -O3 -fPIC -fno-common -ffast-math -funroll-loops -fexpensive-optimizations -no-cpp-precomp -dynamic -Ddarwin $(DEFINES) -CXXFLAGS = -I/usr/X11/include -O3 -fPIC -fno-common -ffast-math -funroll-loops -fexpensive-optimizations -no-cpp-precomp -dynamic -Ddarwin $(DEFINES) +PIC_FLAGS = -fPIC +DEFINES = -D_DARWIN_C_SOURCE -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L \ + -D_BSD_SOURCE -D_SVID_SOURCE -D_GNU_SOURCE -DPTHREADS \ + -DGLX_ALIAS_UNSUPPORTED -DGLX_INDIRECT_RENDERING -CFLAGS += $(RC_CFLAGS) -CXXFLAGS += $(RC_CFLAGS) +# -DGLX_DIRECT_RENDERING - pulls in libdrm stuff in glx/x11 +# -DGLX_USE_APPLEGL - supposed to be used with GLX_DIRECT_RENDERING to use AGL rather than DRM, but doesn't compile +# -DIN_DRI_DRIVER -# Work around aliasing bugs - developers should comment this out -CFLAGS += -fno-strict-aliasing -CXXFLAGS += -fno-strict-aliasing +ARCH_FLAGS += $(RC_CFLAGS) + +CFLAGS = -g -O2 -Wall -Wmissing-prototypes -std=c99 -ffast-math -fno-strict-aliasing \ + -I$(INSTALL_DIR)/include $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(ASM_FLAGS) $(DEFINES) +CXXFLAGS = -g -O2 -Wall -fno-strict-aliasing \ + -I$(INSTALL_DIR)/include $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(ASM_FLAGS) $(DEFINES) # Library names (actual file names) GL_LIB_NAME = libGL.dylib @@ -28,13 +32,24 @@ GLUT_LIB_NAME = libglut.dylib GLW_LIB_NAME = libGLw.dylib OSMESA_LIB_NAME = libOSMesa.dylib -GL_LIB_DEPS = -L/usr/X11/lib -lX11 -lXext -lm -lpthread -OSMESA_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -lGL -GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -lGL -GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -lGL -lGLU -L/usr/X11R6/lib -lX11 -lXmu -lXi -lXext -GLW_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXt $(TOP)/lib/GL.dylib -APP_LIB_DEPS = -L$(TOP)/lib -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11/lib -lX11 -lXmu -lXt -lXi -lm +# globs used to install the lib and all symlinks +GL_LIB_GLOB = libGL.*dylib +GLU_LIB_GLOB = libGLU.*dylib +GLUT_LIB_GLOB = libglut.*dylib +GLW_LIB_GLOB = libGLw.*dylib +OSMESA_LIB_GLOB = libOSMesa.*dylib + +GL_LIB_DEPS = -L$(INSTALL_DIR)/$(LIB_DIR) -lX11 -lXext -lm -lpthread +OSMESA_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) +GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) +GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -lX11 -lXmu -lXi -lXext +GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -lX11 -lXt +APP_LIB_DEPS = -L$(TOP)/lib -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -lX11 -lXmu -lXt -lXi -lm # omit glw lib for now: -SRC_DIRS = glx/x11 glu glut/glx mesa +SRC_DIRS = glx/x11 mesa glu glut/glx +GLU_DIRS = sgi DRIVER_DIRS = osmesa +#DRIVER_DIRS = dri +DRI_DIRS = swrast +PROGRAM_DIRS = xdemos diff --git a/configs/darwin-static b/configs/darwin-static deleted file mode 100644 index 9893d159bd..0000000000 --- a/configs/darwin-static +++ /dev/null @@ -1,28 +0,0 @@ -# Configuration for Darwin / MacOS X, making static libs - -include $(TOP)/configs/darwin - -CONFIG_NAME = darwin-static - -# Compiler and flags -CFLAGS = -I/usr/X11R6/include -O3 -fno-common -ffast-math -funroll-loops -fexpensive-optimizations -no-cpp-precomp -dynamic -Ddarwin -CXXFLAGS = -I/usr/X11R6/include -O3 -fno-common -ffast-math -funroll-loops -fexpensive-optimizations -no-cpp-precomp -dynamic -Ddarwin -MKLIB_OPTIONS = -static - -# Work around aliasing bugs - developers should comment this out -CFLAGS += -fno-strict-aliasing -CXXFLAGS += -fno-strict-aliasing - -# Library names (actual file names) -GL_LIB_NAME = libGL.a -GLU_LIB_NAME = libGLU.a -GLUT_LIB_NAME = libglut.a -GLW_LIB_NAME = libGLw.a -OSMESA_LIB_NAME = libOSMesa.a - -GL_LIB_DEPS = -OSMESA_LIB_DEPS = -GLU_LIB_DEPS = -GLUT_LIB_DEPS = -GLW_LIB_DEPS = -APP_LIB_DEPS = -Wl,-search_paths_first -L$(TOP)/lib -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lstdc++ -lgcc_s.1 -lm diff --git a/configs/darwin-static-x86ppc b/configs/darwin-static-x86ppc deleted file mode 100644 index 7e97474dfe..0000000000 --- a/configs/darwin-static-x86ppc +++ /dev/null @@ -1,30 +0,0 @@ -# Configuration for Darwin / MacOS X, making static libs - -include $(TOP)/configs/darwin - -CONFIG_NAME = darwin-static - -# Compiler and flags -CFLAGS = -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk \ - -I/usr/X11R6/include -O3 -fno-common -ffast-math -funroll-loops -fexpensive-optimizations -no-cpp-precomp -dynamic -Ddarwin -CXXFLAGS = -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk \ - -I/usr/X11R6/include -O3 -fno-common -ffast-math -funroll-loops -fexpensive-optimizations -no-cpp-precomp -dynamic -Ddarwin -MKLIB_OPTIONS = -static -archopt "-isysroot /Developer/SDKs/MacOSX10.4u.sdk" - -# Work around aliasing bugs - developers should comment this out -CFLAGS += -fno-strict-aliasing -CXXFLAGS += -fno-strict-aliasing - -# Library names (actual file names) -GL_LIB_NAME = libGL.a -GLU_LIB_NAME = libGLU.a -GLUT_LIB_NAME = libglut.a -GLW_LIB_NAME = libGLw.a -OSMESA_LIB_NAME = libOSMesa.a - -GL_LIB_DEPS = -OSMESA_LIB_DEPS = -GLU_LIB_DEPS = -GLUT_LIB_DEPS = -GLW_LIB_DEPS = -APP_LIB_DEPS = -Wl,-search_paths_first -L$(TOP)/lib -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lstdc++ -lgcc_s.1 -lm diff --git a/configs/default b/configs/default index 154797265f..21fa0d7f9a 100644 --- a/configs/default +++ b/configs/default @@ -9,7 +9,7 @@ CONFIG_NAME = default # Version info MESA_MAJOR=7 -MESA_MINOR=1 +MESA_MINOR=3 MESA_TINY=0 MESA_VERSION = $(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY) @@ -54,6 +54,12 @@ GLUT_LIB_NAME = lib$(GLUT_LIB).so GLW_LIB_NAME = lib$(GLW_LIB).so OSMESA_LIB_NAME = lib$(OSMESA_LIB).so +# globs used to install the lib and all symlinks +GL_LIB_GLOB = $(GL_LIB_NAME)* +GLU_LIB_GLOB = $(GLU_LIB_NAME)* +GLUT_LIB_GLOB = $(GLUT_LIB_NAME)* +GLW_LIB_GLOB = $(GLW_LIB_NAME)* +OSMESA_LIB_GLOB = $(OSMESA_LIB_NAME)* # Optional assembly language optimization files for libGL ASM_SOURCES = diff --git a/configure.ac b/configure.ac index c87dce6546..463821be6c 100644 --- a/configure.ac +++ b/configure.ac @@ -23,7 +23,7 @@ AC_CANONICAL_HOST dnl Versions for external dependencies LIBDRM_REQUIRED=2.3.1 -DRI2PROTO_REQUIRED=1.1 +DRI2PROTO_REQUIRED=1.99.1 dnl Check for progs AC_PROG_CPP @@ -595,20 +595,6 @@ AC_ARG_ENABLE([driglx-direct], [enable direct rendering in GLX for DRI @<:@default=enabled@:>@])], [driglx_direct="$enableval"], [driglx_direct="yes"]) -dnl ttm support -AC_ARG_ENABLE([ttm-api], - [AS_HELP_STRING([--enable-ttm-api], - [enable TTM API users @<:@default=disabled@:>@])], - [ttmapi="$enableval"], - [ttmapi="no"]) - -if test "x$ttmapi" = "xyes"; then - save_CFLAGS=$CFLAGS - CFLAGS=$LIBDRM_CFLAGS - AC_CHECK_HEADERS([xf86mm.h],[],[AC_MSG_ERROR([xf86mm.h required for TTM.])],[#include "stdint.h"\n#include "drm.h"]) - CFLAGS=$save_CFLAGS -fi - dnl Which drivers to build - default is chosen by platform AC_ARG_WITH([dri-drivers], [AS_HELP_STRING([--with-dri-drivers@<:@=DIRS...@:>@], @@ -650,10 +636,6 @@ if test "$mesa_driver" = dri; then DEFINES="$DEFINES -DGLX_USE_TLS -DPTHREADS" fi - if test "x$ttmapi" = xyes; then - DEFINES="$DEFINES -DTTM_API" - fi - if test "x$USING_EGL" = x1; then PROGRAM_DIRS="egl" fi @@ -1050,7 +1032,6 @@ else echo " DRI drivers: $dri_dirs" fi echo " DRI driver dir: $DRI_DRIVER_INSTALL_DIR" - echo " TTM API support: $ttmapi" fi dnl Libraries diff --git a/docs/MESA_resize_buffers.spec b/docs/MESA_resize_buffers.spec index f79d29c405..533d017c9a 100644 --- a/docs/MESA_resize_buffers.spec +++ b/docs/MESA_resize_buffers.spec @@ -16,7 +16,6 @@ Status Version - $Id: MESA_resize_buffers.spec,v 1.3 2004/03/25 01:42:42 brianp Exp $ Number diff --git a/docs/MESA_shader_debug.spec b/docs/MESA_shader_debug.spec index dbd22b3c66..1f7d42ac91 100644 --- a/docs/MESA_shader_debug.spec +++ b/docs/MESA_shader_debug.spec @@ -19,7 +19,6 @@ Version Last Modified Date: July 30, 2006 Author Revision: 0.2 - $Date: 2006/07/30 14:28:38 $ $Revision: 1.2 $ Number diff --git a/docs/MESA_texture_array.spec b/docs/MESA_texture_array.spec index d3b7752115..9dee65b045 100644 --- a/docs/MESA_texture_array.spec +++ b/docs/MESA_texture_array.spec @@ -20,7 +20,6 @@ Status Version - $Date: 2007/05/16$ $Revision: 0.4$ Number diff --git a/docs/MESA_window_pos.spec b/docs/MESA_window_pos.spec index eb1d0d1f06..4d01f1814c 100644 --- a/docs/MESA_window_pos.spec +++ b/docs/MESA_window_pos.spec @@ -16,7 +16,6 @@ Status Version - $Id: MESA_window_pos.spec,v 1.4 2004/03/25 01:42:42 brianp Exp $ Number diff --git a/docs/MESA_packed_depth_stencil.spec b/docs/OLD/MESA_packed_depth_stencil.spec index 4f7ab1e28c..112b730ecc 100644 --- a/docs/MESA_packed_depth_stencil.spec +++ b/docs/OLD/MESA_packed_depth_stencil.spec @@ -17,7 +17,6 @@ Status Version - $Id: MESA_packed_depth_stencil.spec,v 1.2 2003/09/19 14:58:21 brianp Exp $ Number diff --git a/docs/MESA_program_debug.spec b/docs/OLD/MESA_program_debug.spec index 391d39fa70..7694fdcc42 100644 --- a/docs/MESA_program_debug.spec +++ b/docs/OLD/MESA_program_debug.spec @@ -18,7 +18,6 @@ Version Last Modified Date: July 20, 2003 Author Revision: 1.0 - $Date: 2004/03/25 01:42:41 $ $Revision: 1.4 $ Number diff --git a/docs/MESA_sprite_point.spec b/docs/OLD/MESA_sprite_point.spec index 9422ff5729..b50d78e9e7 100644 --- a/docs/MESA_sprite_point.spec +++ b/docs/OLD/MESA_sprite_point.spec @@ -16,7 +16,6 @@ Status Version - $Id: MESA_sprite_point.spec,v 1.2 2003/09/19 14:58:21 brianp Exp $ Number diff --git a/docs/MESA_trace.spec b/docs/OLD/MESA_trace.spec index f0a79c7df9..dc4166e6b6 100644 --- a/docs/MESA_trace.spec +++ b/docs/OLD/MESA_trace.spec @@ -17,7 +17,6 @@ Status Version - $Id: MESA_trace.spec,v 1.4 2004/03/25 01:42:42 brianp Exp $ Number diff --git a/docs/README.BEOS b/docs/README.BEOS index 5847730af0..efd84e888c 100644 --- a/docs/README.BEOS +++ b/docs/README.BEOS @@ -134,4 +134,3 @@ as of February, 1999. ---------------------------------------------------------------------- -$Id: README.BEOS,v 1.12 2004/10/13 00:35:55 phoudoin Exp $ diff --git a/docs/README.QUAKE b/docs/README.QUAKE index 5a13b7a498..e90c76a083 100644 --- a/docs/README.QUAKE +++ b/docs/README.QUAKE @@ -205,4 +205,3 @@ http://www.linuxgames.com/quake2/ ---------------------------------------------------------------------- -$Id: README.QUAKE,v 1.3 1998/08/23 15:26:26 brianp Exp $ diff --git a/docs/RELNOTES-3.1 b/docs/RELNOTES-3.1 index 4d6e3c2f44..65324eb496 100644 --- a/docs/RELNOTES-3.1 +++ b/docs/RELNOTES-3.1 @@ -143,4 +143,3 @@ code). Anyone want to help? ---------------------------------------------------------------------- -$Id: RELNOTES-3.1,v 1.2 2000/04/07 17:08:06 brianp Exp $ diff --git a/docs/RELNOTES-3.2 b/docs/RELNOTES-3.2 index 7737c28e80..ec7d4f8dc3 100644 --- a/docs/RELNOTES-3.2 +++ b/docs/RELNOTES-3.2 @@ -9,4 +9,3 @@ have been added. For a list of bug fixes please read the VERSIONS file. ---------------------------------------------------------------------- -$Id: RELNOTES-3.2,v 1.2 2000/04/07 17:08:06 brianp Exp $ diff --git a/docs/RELNOTES-3.2.1 b/docs/RELNOTES-3.2.1 index 2ad5b9046a..d34efcc867 100644 --- a/docs/RELNOTES-3.2.1 +++ b/docs/RELNOTES-3.2.1 @@ -29,4 +29,3 @@ GLU library. ---------------------------------------------------------------------- -$Id: RELNOTES-3.2.1,v 1.2 2000/07/21 16:32:33 brianp Exp $ diff --git a/docs/RELNOTES-3.3 b/docs/RELNOTES-3.3 index 362a74ee31..3850767bb1 100644 --- a/docs/RELNOTES-3.3 +++ b/docs/RELNOTES-3.3 @@ -268,4 +268,3 @@ image convolution. This will (hopefully) be done for Mesa 3.5/3.6. ---------------------------------------------------------------------- -$Id: RELNOTES-3.3,v 1.8 2000/07/21 16:26:41 brianp Exp $ diff --git a/docs/RELNOTES-3.4 b/docs/RELNOTES-3.4 index 4aa607a37c..657ccdaab6 100644 --- a/docs/RELNOTES-3.4 +++ b/docs/RELNOTES-3.4 @@ -19,4 +19,3 @@ see the VERSIONS file. ---------------------------------------------------------------------- -$Id: RELNOTES-3.4,v 1.2 2002/03/23 02:37:17 brianp Exp $ diff --git a/docs/RELNOTES-3.4.1 b/docs/RELNOTES-3.4.1 index 18443507c2..73d75c64d2 100644 --- a/docs/RELNOTES-3.4.1 +++ b/docs/RELNOTES-3.4.1 @@ -19,4 +19,3 @@ the Mesa 3.4 release. For details, see the VERSIONS file. ---------------------------------------------------------------------- -$Id: RELNOTES-3.4.1,v 1.2 2001/05/23 14:45:01 brianp Exp $ diff --git a/docs/RELNOTES-3.4.2 b/docs/RELNOTES-3.4.2 index 894ed199ff..9caea900d8 100644 --- a/docs/RELNOTES-3.4.2 +++ b/docs/RELNOTES-3.4.2 @@ -19,4 +19,3 @@ the Mesa 3.4.1 release. For details, see the VERSIONS file. ---------------------------------------------------------------------- -$Id: RELNOTES-3.4.2,v 1.2 2001/05/23 14:45:01 brianp Exp $ diff --git a/docs/RELNOTES-3.5 b/docs/RELNOTES-3.5 index 52097a1cd6..b2aa1b852e 100644 --- a/docs/RELNOTES-3.5 +++ b/docs/RELNOTES-3.5 @@ -225,4 +225,3 @@ In the future I hope to implement support for 32-bit, floating point color channels. ---------------------------------------------------------------------- -$Id: RELNOTES-3.5,v 1.14 2001/06/20 19:02:48 brianp Exp $ diff --git a/docs/RELNOTES-4.0 b/docs/RELNOTES-4.0 index e4249cfa17..2f729db158 100644 --- a/docs/RELNOTES-4.0 +++ b/docs/RELNOTES-4.0 @@ -160,4 +160,3 @@ See the VERSIONS file for more details about bug fixes, etc. in Mesa 4.0. ---------------------------------------------------------------------- -$Id: RELNOTES-4.0,v 3.2 2001/10/17 14:59:21 brianp Exp $ diff --git a/docs/RELNOTES-4.0.1 b/docs/RELNOTES-4.0.1 index b4d7efca81..e84df6bf89 100644 --- a/docs/RELNOTES-4.0.1 +++ b/docs/RELNOTES-4.0.1 @@ -19,4 +19,3 @@ Mesa 4.0.1 only contains bug fixes since version 4.0. See the docs/VERSIONS file for the list of bug fixes. ---------------------------------------------------------------------- -$Id: RELNOTES-4.0.1,v 1.2 2001/12/18 14:08:23 brianp Exp $ diff --git a/docs/RELNOTES-4.0.2 b/docs/RELNOTES-4.0.2 index 1b7eaaa8fe..b476956ba2 100644 --- a/docs/RELNOTES-4.0.2 +++ b/docs/RELNOTES-4.0.2 @@ -47,4 +47,3 @@ D3D needs updating ---------------------------------------------------------------------- -$Id: RELNOTES-4.0.2,v 1.2 2002/03/23 02:38:39 brianp Exp $ diff --git a/docs/RELNOTES-4.0.3 b/docs/RELNOTES-4.0.3 index c69b6a279e..0b3e34befe 100644 --- a/docs/RELNOTES-4.0.3 +++ b/docs/RELNOTES-4.0.3 @@ -49,4 +49,3 @@ D3D needs updating ---------------------------------------------------------------------- -$Id: RELNOTES-4.0.3,v 1.2 2002/06/26 02:36:34 brianp Exp $ diff --git a/docs/RELNOTES-4.1 b/docs/RELNOTES-4.1 index 92cf9196f0..24e9299eb2 100644 --- a/docs/RELNOTES-4.1 +++ b/docs/RELNOTES-4.1 @@ -305,4 +305,3 @@ are some things to change: ---------------------------------------------------------------------- -$Id: RELNOTES-4.1,v 1.22 2002/10/29 15:06:37 brianp Exp $ diff --git a/docs/RELNOTES-5.0 b/docs/RELNOTES-5.0 index 565e4ad78e..1b22996d83 100644 --- a/docs/RELNOTES-5.0 +++ b/docs/RELNOTES-5.0 @@ -82,4 +82,3 @@ driver call the _mesa_enable_1_4_extensions() function. ---------------------------------------------------------------------- -$Id: RELNOTES-5.0,v 3.2 2002/11/13 15:33:51 brianp Exp $ diff --git a/docs/RELNOTES-5.0.1 b/docs/RELNOTES-5.0.1 index 8d72cc44c1..f37e9c4a7f 100644 --- a/docs/RELNOTES-5.0.1 +++ b/docs/RELNOTES-5.0.1 @@ -43,4 +43,3 @@ driver call the _mesa_enable_1_4_extensions() function. ---------------------------------------------------------------------- -$Id: RELNOTES-5.0.1,v 3.1 2003/03/30 16:17:54 brianp Exp $ diff --git a/docs/RELNOTES-5.0.2 b/docs/RELNOTES-5.0.2 index cfc9ad04fd..d0e05b2c73 100644 --- a/docs/RELNOTES-5.0.2 +++ b/docs/RELNOTES-5.0.2 @@ -43,4 +43,3 @@ driver call the _mesa_enable_1_4_extensions() function. ---------------------------------------------------------------------- -$Id: RELNOTES-5.0.2,v 1.1 2003/09/04 23:10:38 brianp Exp $ diff --git a/docs/RELNOTES-6.0 b/docs/RELNOTES-6.0 index de01a879a4..1a3c2fb1aa 100644 --- a/docs/RELNOTES-6.0 +++ b/docs/RELNOTES-6.0 @@ -84,4 +84,3 @@ See the VERSIONS file for more details about bug fixes, etc. in Mesa 6.0. ---------------------------------------------------------------------- -$Id: RELNOTES-6.0,v 1.3 2004/01/15 15:47:57 brianp Exp $ diff --git a/docs/RELNOTES-6.0.1 b/docs/RELNOTES-6.0.1 index e72d9fe891..1444b9fc87 100644 --- a/docs/RELNOTES-6.0.1 +++ b/docs/RELNOTES-6.0.1 @@ -47,4 +47,3 @@ D3D needs updating ---------------------------------------------------------------------- -$Id: RELNOTES-6.0.1,v 3.1 2004/04/02 23:37:02 brianp Exp $ diff --git a/docs/RELNOTES-6.1 b/docs/RELNOTES-6.1 index 830f1e47e7..8de64d1f1c 100644 --- a/docs/RELNOTES-6.1 +++ b/docs/RELNOTES-6.1 @@ -109,4 +109,3 @@ See the VERSIONS file for more details about bug fixes, etc. in Mesa 6.1. ---------------------------------------------------------------------- -$Id: RELNOTES-6.1,v 3.5 2004/08/17 22:58:23 brianp Exp $ diff --git a/docs/RELNOTES-6.2 b/docs/RELNOTES-6.2 index 4043a5655e..06cfba0c75 100644 --- a/docs/RELNOTES-6.2 +++ b/docs/RELNOTES-6.2 @@ -49,4 +49,3 @@ D3D needs updating ---------------------------------------------------------------------- -$Id: RELNOTES-6.2,v 3.4 2004/10/02 15:43:14 brianp Exp $ diff --git a/docs/RELNOTES-6.2.1 b/docs/RELNOTES-6.2.1 index d72560e5af..c7baa5d421 100644 --- a/docs/RELNOTES-6.2.1 +++ b/docs/RELNOTES-6.2.1 @@ -47,4 +47,3 @@ D3D needs updating ---------------------------------------------------------------------- -$Id: RELNOTES-6.2.1,v 3.1 2004/12/09 23:21:36 brianp Exp $ diff --git a/docs/RELNOTES-6.3 b/docs/RELNOTES-6.3 index dde335eec1..6b4dfaaf9a 100644 --- a/docs/RELNOTES-6.3 +++ b/docs/RELNOTES-6.3 @@ -112,4 +112,3 @@ D3D needs updating ---------------------------------------------------------------------- -$Id: RELNOTES-6.3,v 3.13 2005/07/21 15:57:29 brianp Exp $ diff --git a/docs/RELNOTES-6.3.1 b/docs/RELNOTES-6.3.1 index cc6e8be1b2..eacc952aeb 100644 --- a/docs/RELNOTES-6.3.1 +++ b/docs/RELNOTES-6.3.1 @@ -46,4 +46,3 @@ D3D needs updating ---------------------------------------------------------------------- -$Id: RELNOTES-6.3.1,v 3.1 2005/07/21 18:45:54 brianp Exp $ diff --git a/docs/RELNOTES-6.3.2 b/docs/RELNOTES-6.3.2 index f2d47bff19..e5243ef783 100644 --- a/docs/RELNOTES-6.3.2 +++ b/docs/RELNOTES-6.3.2 @@ -34,4 +34,3 @@ D3D needs updating ---------------------------------------------------------------------- -$Id: RELNOTES-6.3.2,v 3.2 2005/08/19 16:57:50 brianp Exp $ diff --git a/docs/RELNOTES-6.4 b/docs/RELNOTES-6.4 index a12600c3c8..1a945a1039 100644 --- a/docs/RELNOTES-6.4 +++ b/docs/RELNOTES-6.4 @@ -47,4 +47,3 @@ in Mesa 6.3. ---------------------------------------------------------------------- -$Id: RELNOTES-6.4,v 3.1 2005/10/24 23:33:27 brianp Exp $ diff --git a/docs/contents.html b/docs/contents.html index 3feb8cae94..257b13f68a 100644 --- a/docs/contents.html +++ b/docs/contents.html @@ -48,6 +48,7 @@ a:visited { <li><a href="lists.html" target="MainFrame">Mailing Lists</a> <li><a href="bugs.html" target="MainFrame">Bug Database</a> <li><a href="webmaster.html" target="MainFrame">Webmaster</a> +<li><a href="http://dri.freedesktop.org/" target="MainFrame">Wiki</a> </ul> <b>User Topics</b> diff --git a/docs/download.html b/docs/download.html index 9533fb81c2..2d587f35f9 100644 --- a/docs/download.html +++ b/docs/download.html @@ -9,7 +9,9 @@ <H1>Downloading</H1> <p> -Last stable release: <b>7.0.3</b> +Current development release: <b>7.1</b> +<br> +Last stable release: <b>7.0.4</b> </p> <p> diff --git a/docs/intro.html b/docs/intro.html index 0e37322823..aae2e6e192 100644 --- a/docs/intro.html +++ b/docs/intro.html @@ -22,9 +22,10 @@ for modern GPUs. <p> Mesa ties into several other open-source projects: the -<a href="http://dri.sf.net/" target="_parent">Direct Rendering Infrastructure</a> -and <a href="http://x.org" target="_parent">X.org</a> to provide OpenGL -support to users of X on Linux, FreeBSD and other operating systems. +<a href="http://dri.freedesktop.org/" target="_parent">Direct Rendering +Infrastructure</a> and <a href="http://x.org" target="_parent">X.org</a> to +provide OpenGL support to users of X on Linux, FreeBSD and other operating +systems. </p> diff --git a/docs/lists.html b/docs/lists.html index a2cad129cf..5227fbd055 100644 --- a/docs/lists.html +++ b/docs/lists.html @@ -9,7 +9,7 @@ <H1>Mailing Lists</H1> -<p>There are four Mesa mailing lists: +<p>There are four Mesa 3D / DRI mailing lists: </p> <ul> @@ -19,14 +19,14 @@ versions are sent to this list. </li> <br> <li><a href="https://lists.sourceforge.net/lists/listinfo/mesa3d-users" -target="_parent">mesa3d-users</a> - intended for users of the Mesa library. +target="_parent">mesa3d-users</a> - intended for users of the Mesa and DRI. Newbie questions are appropriate, but please try the general OpenGL -resources and Mesa documentation first. +resources and Mesa/DRI documentation first. </li> <br> <li><a href="https://lists.sourceforge.net/lists/listinfo/mesa3d-dev" -target="_parent">mesa3d-dev</a> - for discussion of Mesa development. -Not for beginners. +target="_parent">mesa3d-dev</a> - for discussion of Mesa and Direct Rendering +Infrastructure development. Not for beginners. </li> <br> <li><a href="http://lists.freedesktop.org/mailman/listinfo/mesa-commit" @@ -37,6 +37,9 @@ Note: the old mesa3d-cvs list is no longer in use. </li> </ul> +<p>For mailing lists about Direct Rendering Modules (drm) in Linux/BSD +kernels, see <a href="http://dri.freedesktop.org/wiki/MailingLists">wiki</a>. + <p> <b>Notice</b>: non-member posts to any of these lists will be automatically rejected. diff --git a/docs/news.html b/docs/news.html index 79224f1e2b..6d0d83659b 100644 --- a/docs/news.html +++ b/docs/news.html @@ -11,6 +11,23 @@ <H1>News</H1> +<h2>August 26, 2008</h2> +<p> +<a href="relnotes-7.1.html">Mesa 7.1</a> is released. +This is a new development release. +It should be relatively stable, but those especially concerned about +stability should wait for the 7.2 release or use Mesa 7.0.4 (the +previous stable release). +</p> + + +<h2>August 16, 2008</h2> +<p> +<a href="relnotes-7.0.4.html">Mesa 7.0.4</a> is released. +This is a bug-fix release. +</p> + + <h2>April 4, 2008</h2> <p> <a href="relnotes-7.0.3.html">Mesa 7.0.3</a> is released. @@ -1163,6 +1180,5 @@ source code</a>.</p> <hr> -$Id: news.html,v 3.33 2006/12/02 18:18:41 brianp Exp $ </body> </html> diff --git a/docs/relnotes-7.0.4.html b/docs/relnotes-7.0.4.html new file mode 100644 index 0000000000..f100d99f09 --- /dev/null +++ b/docs/relnotes-7.0.4.html @@ -0,0 +1,80 @@ +<HTML> + +<TITLE>Mesa Release Notes</TITLE> + +<head><link rel="stylesheet" type="text/css" href="mesa.css"></head> + +<BODY> + +<body bgcolor="#eeeeee"> + +<H1>Mesa 7.0.4 Release Notes / August 16, 2008</H1> + +<p> +Mesa 7.0.4 is a stable release with bug fixes since version 7.0.3. +</p> + + +<h2>MD5 checksums</h2> +<pre> +909afa3a01ae31478d363837681415ac MesaLib-7.0.4.tar.gz +8d7bacbe0234742a5d08c8088c4619e9 MesaLib-7.0.4.tar.bz2 +5e44261ef85b049a868e1785d9adc276 MesaLib-7.0.4.zip +53dcd77d37a819feaf50b5fcdd0a6e0f MesaDemos-7.0.4.tar.gz +c1215b31c5f7b85f81eed3bfba07d556 MesaDemos-7.0.4.tar.bz2 +b1825a7361f116b28d82d328077630b4 MesaDemos-7.0.4.zip +d7677d015f52602d1bf8b837fb717848 MesaGLUT-7.0.4.tar.gz +f5f8b46f7e763d9f7b7d1d115c1c44ee MesaGLUT-7.0.4.tar.bz2 +a786775271a02c62a3370b13b26bf48d MesaGLUT-7.0.4.zip +</pre> + + +<h2>Bug fixes</h2> +<ul> +<li>define #extension GL_ARB_texture_rectangle in shading language +<li>fixed WIN32 compile problem in libGLU +<li>Fixed a per-vertex glMaterial bug which could cause bad lighting +<li>Fixed potential crash in AA/smoothed triangle rendering when using a fragment shader +<li>Fixed glDrawElement + VBO segfault (bug 16156) +<li>Fixed GLSL linker bug causing generic vertex attributes to get aliased +<li>Fixed stack overflow when using glPixelZoom on Windows +<li>Fixed broken all(bvec2) GLSL function, added misc missing bvec constructors +<li>ARB program "state.clip[n].plane" didn't parse correctly +<li>Fixed broken glGetUniformiv() (bug 13774) +</ul> + +<h2>Changes</h2> +<ul> +<li>Including the latest glext.h and glxext.h header files from Khronos +<li>Added support for DragonFly OS +<li>Added a build config for FreeBSD static libs (Anatolij Shkodin) +<li>Enabled GL_EXT_multi_draw_arrays extension in R200/R300 drivers +<li>Enabled GL_ARB_point_sprite extension in I965 driver +<li>Enabled GL_EXT_texture_sRGB extension in I965 driver +<li>Added support for GL shading language in I965 driver +</ul> + + + + +<h2>Driver Status</h2> + +<pre> +Driver Status +---------------------- ---------------------- +DRI drivers varies with the driver +XMesa/GLX (on Xlib) implements OpenGL 2.1 +OSMesa (off-screen) implements OpenGL 2.1 +Windows/Win32 implements OpenGL 2.1 +Glide (3dfx Voodoo1/2) implements OpenGL 1.3 +SVGA unsupported +Wind River UGL unsupported +DJGPP unsupported +GGI unsupported +BeOS unsupported +Allegro unsupported +D3D unsupported +</pre> + +</body> +</html> diff --git a/docs/relnotes-7.1.html b/docs/relnotes-7.1.html index abcbc3186e..e8a39c8d34 100644 --- a/docs/relnotes-7.1.html +++ b/docs/relnotes-7.1.html @@ -8,28 +8,46 @@ <body bgcolor="#eeeeee"> -<H1>Mesa 7.1 Release Notes / May XX, 2008</H1> +<H1>Mesa 7.1 Release Notes / August 26, 2008</H1> <p> Mesa 7.1 is a new development release. There have been many internal code changes since Mesa 7.0.x. It should be relatively stable, but those who are especially concerned about -stability should wait for Mesa 7.2. +stability should wait for Mesa 7.2 or use Mesa 7.0.4 (the previous stable +release). +</p> +</> +Note that this version of Mesa does not use the GEM memory manager. +The master branch of git uses GEM. +</p> +<p> +DRM version 2.3.1 should be used with Mesa 7.1 </p> <h2>MD5 checksums</h2> <pre> -TBD +971c2fe6e6949dc5ba200a6f97a6dc81 MesaLib-7.1.tar.gz +6bff7f532d16f90f944a400c8bd7074d MesaLib-7.1.tar.bz2 +d48224bf9d54c3da6776adb4869ba024 MesaLib-7.1.zip +3de268420efca43e9a19ab506cdfc993 MesaDemos-7.1.tar.gz +abfc9775e1462363af8ec160d1feb01f MesaDemos-7.1.tar.bz2 +f7b3623387c4036e9895cd9ac0dfad99 MesaDemos-7.1.zip +fdf348f78cd09304b6ff801ef8acc8eb MesaGLUT-7.1.tar.gz +f6d88a4eeb02e98c7e92f1c895d3c76b MesaGLUT-7.1.tar.bz2 +4dc102a5ca51e1c41dde87d3f8c7b22a MesaGLUT-7.1.zip </pre> <h2>New features</h2> <ul> <li>autoconf-based configuration (and clean-up of Makefiles) +<li>Assorted DRI driver enhancements <li>Reduced dependencies between X server and Mesa <li>GL_EXT_texture_from_pixmap extension for Xlib driver <li>Support for the GL shading language with i965 driver (implemented by Intel) +<li>ATI R500 series support (Radeon X1300–X1950) in r300 DRI driver </ul> @@ -37,6 +55,7 @@ TBD <ul> <li>Numerous GLSL fixes <li>Fixed some error code/detection bugs in the GLSL-related API functions +<li>Lots of DRI driver fixes. </ul> diff --git a/docs/relnotes.html b/docs/relnotes.html index b0e0e9f9cf..e305977163 100644 --- a/docs/relnotes.html +++ b/docs/relnotes.html @@ -21,6 +21,7 @@ The release notes summarize what's new or changed in each Mesa release. <UL> <LI><A HREF="relnotes-7.1.html">7.1 release notes</A> +<LI><A HREF="relnotes-7.0.4.html">7.0.4 release notes</A> <LI><A HREF="relnotes-7.0.3.html">7.0.3 release notes</A> <LI><A HREF="relnotes-7.0.2.html">7.0.2 release notes</A> <LI><A HREF="relnotes-7.0.1.html">7.0.1 release notes</A> diff --git a/include/GL/glext.h b/include/GL/glext.h index f7377bb310..17db4b69eb 100644 --- a/include/GL/glext.h +++ b/include/GL/glext.h @@ -46,9 +46,9 @@ extern "C" { /*************************************************************/ /* Header file version number, required by OpenGL ABI for Linux */ -/* glext.h last updated 2008/03/24 */ +/* glext.h last updated 2008/08/10 */ /* Current version at http://www.opengl.org/registry/ */ -#define GL_GLEXT_VERSION 40 +#define GL_GLEXT_VERSION 41 #ifndef GL_VERSION_1_2 #define GL_UNSIGNED_BYTE_3_3_2 0x8032 @@ -479,6 +479,117 @@ extern "C" { #define GL_COMPRESSED_SLUMINANCE_ALPHA 0x8C4B #endif +#ifndef GL_VERSION_3_0 +#define GL_COMPARE_REF_TO_TEXTURE GL_COMPARE_R_TO_TEXTURE_ARB +#define GL_CLIP_DISTANCE0 GL_CLIP_PLANE0 +#define GL_CLIP_DISTANCE1 GL_CLIP_PLANE1 +#define GL_CLIP_DISTANCE2 GL_CLIP_PLANE2 +#define GL_CLIP_DISTANCE3 GL_CLIP_PLANE3 +#define GL_CLIP_DISTANCE4 GL_CLIP_PLANE4 +#define GL_CLIP_DISTANCE5 GL_CLIP_PLANE5 +#define GL_MAX_CLIP_DISTANCES GL_MAX_CLIP_PLANES +#define GL_MAJOR_VERSION 0x821B +#define GL_MINOR_VERSION 0x821C +#define GL_NUM_EXTENSIONS 0x821D +#define GL_CONTEXT_FLAGS 0x821E +#define GL_DEPTH_BUFFER 0x8223 +#define GL_STENCIL_BUFFER 0x8224 +#define GL_COMPRESSED_RED 0x8225 +#define GL_COMPRESSED_RG 0x8226 +#define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x0001 +#define GL_RGBA32F 0x8814 +#define GL_RGB32F 0x8815 +#define GL_RGBA16F 0x881A +#define GL_RGB16F 0x881B +#define GL_VERTEX_ATTRIB_ARRAY_INTEGER 0x88FD +#define GL_MAX_ARRAY_TEXTURE_LAYERS 0x88FF +#define GL_MIN_PROGRAM_TEXEL_OFFSET 0x8904 +#define GL_MAX_PROGRAM_TEXEL_OFFSET 0x8905 +#define GL_CLAMP_VERTEX_COLOR 0x891A +#define GL_CLAMP_FRAGMENT_COLOR 0x891B +#define GL_CLAMP_READ_COLOR 0x891C +#define GL_FIXED_ONLY 0x891D +#define GL_MAX_VARYING_COMPONENTS GL_MAX_VARYING_FLOATS +#define GL_TEXTURE_RED_TYPE 0x8C10 +#define GL_TEXTURE_GREEN_TYPE 0x8C11 +#define GL_TEXTURE_BLUE_TYPE 0x8C12 +#define GL_TEXTURE_ALPHA_TYPE 0x8C13 +#define GL_TEXTURE_LUMINANCE_TYPE 0x8C14 +#define GL_TEXTURE_INTENSITY_TYPE 0x8C15 +#define GL_TEXTURE_DEPTH_TYPE 0x8C16 +#define GL_UNSIGNED_NORMALIZED 0x8C17 +#define GL_TEXTURE_1D_ARRAY 0x8C18 +#define GL_PROXY_TEXTURE_1D_ARRAY 0x8C19 +#define GL_TEXTURE_2D_ARRAY 0x8C1A +#define GL_PROXY_TEXTURE_2D_ARRAY 0x8C1B +#define GL_TEXTURE_BINDING_1D_ARRAY 0x8C1C +#define GL_TEXTURE_BINDING_2D_ARRAY 0x8C1D +#define GL_R11F_G11F_B10F 0x8C3A +#define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B +#define GL_RGB9_E5 0x8C3D +#define GL_UNSIGNED_INT_5_9_9_9_REV 0x8C3E +#define GL_TEXTURE_SHARED_SIZE 0x8C3F +#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH 0x8C76 +#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE 0x8C7F +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS 0x8C80 +#define GL_TRANSFORM_FEEDBACK_VARYINGS 0x8C83 +#define GL_TRANSFORM_FEEDBACK_BUFFER_START 0x8C84 +#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE 0x8C85 +#define GL_PRIMITIVES_GENERATED 0x8C87 +#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 0x8C88 +#define GL_RASTERIZER_DISCARD 0x8C89 +#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS 0x8C8A +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS 0x8C8B +#define GL_INTERLEAVED_ATTRIBS 0x8C8C +#define GL_SEPARATE_ATTRIBS 0x8C8D +#define GL_TRANSFORM_FEEDBACK_BUFFER 0x8C8E +#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING 0x8C8F +#define GL_RGBA32UI 0x8D70 +#define GL_RGB32UI 0x8D71 +#define GL_RGBA16UI 0x8D76 +#define GL_RGB16UI 0x8D77 +#define GL_RGBA8UI 0x8D7C +#define GL_RGB8UI 0x8D7D +#define GL_RGBA32I 0x8D82 +#define GL_RGB32I 0x8D83 +#define GL_RGBA16I 0x8D88 +#define GL_RGB16I 0x8D89 +#define GL_RGBA8I 0x8D8E +#define GL_RGB8I 0x8D8F +#define GL_RED_INTEGER 0x8D94 +#define GL_GREEN_INTEGER 0x8D95 +#define GL_BLUE_INTEGER 0x8D96 +#define GL_ALPHA_INTEGER 0x8D97 +#define GL_RGB_INTEGER 0x8D98 +#define GL_RGBA_INTEGER 0x8D99 +#define GL_BGR_INTEGER 0x8D9A +#define GL_BGRA_INTEGER 0x8D9B +#define GL_SAMPLER_1D_ARRAY 0x8DC0 +#define GL_SAMPLER_2D_ARRAY 0x8DC1 +#define GL_SAMPLER_1D_ARRAY_SHADOW 0x8DC3 +#define GL_SAMPLER_2D_ARRAY_SHADOW 0x8DC4 +#define GL_SAMPLER_CUBE_SHADOW 0x8DC5 +#define GL_UNSIGNED_INT_VEC2 0x8DC6 +#define GL_UNSIGNED_INT_VEC3 0x8DC7 +#define GL_UNSIGNED_INT_VEC4 0x8DC8 +#define GL_INT_SAMPLER_1D 0x8DC9 +#define GL_INT_SAMPLER_2D 0x8DCA +#define GL_INT_SAMPLER_3D 0x8DCB +#define GL_INT_SAMPLER_CUBE 0x8DCC +#define GL_INT_SAMPLER_1D_ARRAY 0x8DCE +#define GL_INT_SAMPLER_2D_ARRAY 0x8DCF +#define GL_UNSIGNED_INT_SAMPLER_1D 0x8DD1 +#define GL_UNSIGNED_INT_SAMPLER_2D 0x8DD2 +#define GL_UNSIGNED_INT_SAMPLER_3D 0x8DD3 +#define GL_UNSIGNED_INT_SAMPLER_CUBE 0x8DD4 +#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY 0x8DD6 +#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY 0x8DD7 +#define GL_QUERY_WAIT 0x8E13 +#define GL_QUERY_NO_WAIT 0x8E14 +#define GL_QUERY_BY_REGION_WAIT 0x8E15 +#define GL_QUERY_BY_REGION_NO_WAIT 0x8E16 +#endif + #ifndef GL_ARB_multitexture #define GL_TEXTURE0_ARB 0x84C0 #define GL_TEXTURE1_ARB 0x84C1 @@ -974,6 +1085,175 @@ extern "C" { #define GL_PIXEL_UNPACK_BUFFER_BINDING_ARB 0x88EF #endif +#ifndef GL_ARB_depth_buffer_float +#define GL_DEPTH_COMPONENT32F 0x8CAC +#define GL_DEPTH32F_STENCIL8 0x8CAD +#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV 0x8DAD +#endif + +#ifndef GL_ARB_draw_instanced +#endif + +#ifndef GL_ARB_framebuffer_object +#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506 +#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210 +#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211 +#define GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE 0x8212 +#define GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE 0x8213 +#define GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE 0x8214 +#define GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE 0x8215 +#define GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE 0x8216 +#define GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE 0x8217 +#define GL_FRAMEBUFFER_DEFAULT 0x8218 +#define GL_FRAMEBUFFER_UNDEFINED 0x8219 +#define GL_DEPTH_STENCIL_ATTACHMENT 0x821A +#define GL_INDEX 0x8222 +#define GL_MAX_RENDERBUFFER_SIZE 0x84E8 +#define GL_DEPTH_STENCIL 0x84F9 +#define GL_UNSIGNED_INT_24_8 0x84FA +#define GL_DEPTH24_STENCIL8 0x88F0 +#define GL_TEXTURE_STENCIL_SIZE 0x88F1 +#define GL_FRAMEBUFFER_BINDING 0x8CA6 +#define GL_DRAW_FRAMEBUFFER_BINDING GL_FRAMEBUFFER_BINDING +#define GL_RENDERBUFFER_BINDING 0x8CA7 +#define GL_READ_FRAMEBUFFER 0x8CA8 +#define GL_DRAW_FRAMEBUFFER 0x8CA9 +#define GL_READ_FRAMEBUFFER_BINDING 0x8CAA +#define GL_RENDERBUFFER_SAMPLES 0x8CAB +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4 +#define GL_FRAMEBUFFER_COMPLETE 0x8CD5 +#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6 +#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7 +#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER 0x8CDB +#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER 0x8CDC +#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD +#define GL_MAX_COLOR_ATTACHMENTS 0x8CDF +#define GL_COLOR_ATTACHMENT0 0x8CE0 +#define GL_COLOR_ATTACHMENT1 0x8CE1 +#define GL_COLOR_ATTACHMENT2 0x8CE2 +#define GL_COLOR_ATTACHMENT3 0x8CE3 +#define GL_COLOR_ATTACHMENT4 0x8CE4 +#define GL_COLOR_ATTACHMENT5 0x8CE5 +#define GL_COLOR_ATTACHMENT6 0x8CE6 +#define GL_COLOR_ATTACHMENT7 0x8CE7 +#define GL_COLOR_ATTACHMENT8 0x8CE8 +#define GL_COLOR_ATTACHMENT9 0x8CE9 +#define GL_COLOR_ATTACHMENT10 0x8CEA +#define GL_COLOR_ATTACHMENT11 0x8CEB +#define GL_COLOR_ATTACHMENT12 0x8CEC +#define GL_COLOR_ATTACHMENT13 0x8CED +#define GL_COLOR_ATTACHMENT14 0x8CEE +#define GL_COLOR_ATTACHMENT15 0x8CEF +#define GL_DEPTH_ATTACHMENT 0x8D00 +#define GL_STENCIL_ATTACHMENT 0x8D20 +#define GL_FRAMEBUFFER 0x8D40 +#define GL_RENDERBUFFER 0x8D41 +#define GL_RENDERBUFFER_WIDTH 0x8D42 +#define GL_RENDERBUFFER_HEIGHT 0x8D43 +#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44 +#define GL_STENCIL_INDEX1 0x8D46 +#define GL_STENCIL_INDEX4 0x8D47 +#define GL_STENCIL_INDEX8 0x8D48 +#define GL_STENCIL_INDEX16 0x8D49 +#define GL_RENDERBUFFER_RED_SIZE 0x8D50 +#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51 +#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52 +#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53 +#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54 +#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55 +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56 +#define GL_MAX_SAMPLES 0x8D57 +#endif + +#ifndef GL_ARB_framebuffer_sRGB +#define GL_FRAMEBUFFER_SRGB 0x8DB9 +#endif + +#ifndef GL_ARB_geometry_shader4 +#define GL_LINES_ADJACENCY_ARB 0x000A +#define GL_LINE_STRIP_ADJACENCY_ARB 0x000B +#define GL_TRIANGLES_ADJACENCY_ARB 0x000C +#define GL_TRIANGLE_STRIP_ADJACENCY_ARB 0x000D +#define GL_PROGRAM_POINT_SIZE_ARB 0x8642 +#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB 0x8C29 +#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_ARB 0x8DA7 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_ARB 0x8DA8 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB 0x8DA9 +#define GL_GEOMETRY_SHADER_ARB 0x8DD9 +#define GL_GEOMETRY_VERTICES_OUT_ARB 0x8DDA +#define GL_GEOMETRY_INPUT_TYPE_ARB 0x8DDB +#define GL_GEOMETRY_OUTPUT_TYPE_ARB 0x8DDC +#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB 0x8DDD +#define GL_MAX_VERTEX_VARYING_COMPONENTS_ARB 0x8DDE +#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB 0x8DDF +#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_ARB 0x8DE0 +#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB 0x8DE1 +#endif + +#ifndef GL_ARB_half_float_vertex +#define GL_HALF_FLOAT 0x140B +#endif + +#ifndef GL_ARB_instanced_arrays +#endif + +#ifndef GL_ARB_map_buffer_range +#define GL_MAP_READ_BIT 0x0001 +#define GL_MAP_WRITE_BIT 0x0002 +#define GL_MAP_INVALIDATE_RANGE_BIT 0x0004 +#define GL_MAP_INVALIDATE_BUFFER_BIT 0x0008 +#define GL_MAP_FLUSH_EXPLICIT_BIT 0x0010 +#define GL_MAP_UNSYNCHRONIZED_BIT 0x0020 +#endif + +#ifndef GL_ARB_texture_buffer_object +#define GL_TEXTURE_BUFFER_ARB 0x8C2A +#define GL_MAX_TEXTURE_BUFFER_SIZE_ARB 0x8C2B +#define GL_TEXTURE_BINDING_BUFFER_ARB 0x8C2C +#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB 0x8C2D +#define GL_TEXTURE_BUFFER_FORMAT_ARB 0x8C2E +#endif + +#ifndef GL_ARB_texture_compression_rgtc +#define GL_COMPRESSED_RED_RGTC1 0x8DBB +#define GL_COMPRESSED_SIGNED_RED_RGTC1 0x8DBC +#define GL_COMPRESSED_RG_RGTC2 0x8DBD +#define GL_COMPRESSED_SIGNED_RG_RGTC2 0x8DBE +#endif + +#ifndef GL_ARB_texture_rg +#define GL_RG 0x8227 +#define GL_RG_INTEGER 0x8228 +#define GL_R8 0x8229 +#define GL_R16 0x822A +#define GL_RG8 0x822B +#define GL_RG16 0x822C +#define GL_R16F 0x822D +#define GL_R32F 0x822E +#define GL_RG16F 0x822F +#define GL_RG32F 0x8230 +#define GL_R8I 0x8231 +#define GL_R8UI 0x8232 +#define GL_R16I 0x8233 +#define GL_R16UI 0x8234 +#define GL_R32I 0x8235 +#define GL_R32UI 0x8236 +#define GL_RG8I 0x8237 +#define GL_RG8UI 0x8238 +#define GL_RG16I 0x8239 +#define GL_RG16UI 0x823A +#define GL_RG32I 0x823B +#define GL_RG32UI 0x823C +#endif + +#ifndef GL_ARB_vertex_array_object +#define GL_VERTEX_ARRAY_BINDING 0x85B5 +#endif + #ifndef GL_EXT_abgr #define GL_ABGR_EXT 0x8000 #endif @@ -3382,6 +3662,40 @@ extern "C" { #ifndef GL_GREMEDY_frame_terminator #endif +#ifndef GL_NV_conditional_render +#define GL_QUERY_WAIT_NV 0x8E13 +#define GL_QUERY_NO_WAIT_NV 0x8E14 +#define GL_QUERY_BY_REGION_WAIT_NV 0x8E15 +#define GL_QUERY_BY_REGION_NO_WAIT_NV 0x8E16 +#endif + +#ifndef GL_NV_present_video +#define GL_FRAME_NV 0x8E26 +#define GL_FIELDS_NV 0x8E27 +#define GL_CURRENT_TIME_NV 0x8E28 +#define GL_NUM_FILL_STREAMS_NV 0x8E29 +#define GL_PRESENT_TIME_NV 0x8E2A +#define GL_PRESENT_DURATION_NV 0x8E2B +#endif + +#ifndef GL_EXT_transform_feedback +#define GL_TRANSFORM_FEEDBACK_BUFFER_EXT 0x8C8E +#define GL_TRANSFORM_FEEDBACK_BUFFER_START_EXT 0x8C84 +#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT 0x8C85 +#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT 0x8C8F +#define GL_INTERLEAVED_ATTRIBS_EXT 0x8C8C +#define GL_SEPARATE_ATTRIBS_EXT 0x8C8D +#define GL_PRIMITIVES_GENERATED_EXT 0x8C87 +#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT 0x8C88 +#define GL_RASTERIZER_DISCARD_EXT 0x8C89 +#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT 0x8C8A +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT 0x8C8B +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT 0x8C80 +#define GL_TRANSFORM_FEEDBACK_VARYINGS_EXT 0x8C83 +#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_EXT 0x8C7F +#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT 0x8C76 +#endif + /*************************************************************/ @@ -3990,6 +4304,10 @@ typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X4FVPROC) (GLint location, GLsizei co typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); #endif +#ifndef GL_VERSION_3_0 +#define GL_VERSION_3_0 1 +#endif + #ifndef GL_ARB_multitexture #define GL_ARB_multitexture 1 #ifdef GL_GLEXT_PROTOTYPES @@ -4569,6 +4887,54 @@ typedef void (APIENTRYP PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp); #define GL_ARB_pixel_buffer_object 1 #endif +#ifndef GL_ARB_depth_buffer_float +#define GL_ARB_depth_buffer_float 1 +#endif + +#ifndef GL_ARB_draw_instanced +#define GL_ARB_draw_instanced 1 +#endif + +#ifndef GL_ARB_framebuffer_object +#define GL_ARB_framebuffer_object 1 +#endif + +#ifndef GL_ARB_framebuffer_sRGB +#define GL_ARB_framebuffer_sRGB 1 +#endif + +#ifndef GL_ARB_geometry_shader4 +#define GL_ARB_geometry_shader4 1 +#endif + +#ifndef GL_ARB_half_float_vertex +#define GL_ARB_half_float_vertex 1 +#endif + +#ifndef GL_ARB_instanced_arrays +#define GL_ARB_instanced_arrays 1 +#endif + +#ifndef GL_ARB_map_buffer_range +#define GL_ARB_map_buffer_range 1 +#endif + +#ifndef GL_ARB_texture_buffer_object +#define GL_ARB_texture_buffer_object 1 +#endif + +#ifndef GL_ARB_texture_compression_rgtc +#define GL_ARB_texture_compression_rgtc 1 +#endif + +#ifndef GL_ARB_texture_rg +#define GL_ARB_texture_rg 1 +#endif + +#ifndef GL_ARB_vertex_array_object +#define GL_ARB_vertex_array_object 1 +#endif + #ifndef GL_EXT_abgr #define GL_EXT_abgr 1 #endif @@ -7263,6 +7629,18 @@ GLAPI void APIENTRY glFrameTerminatorGREMEDY (void); typedef void (APIENTRYP PFNGLFRAMETERMINATORGREMEDYPROC) (void); #endif +#ifndef GL_NV_conditional_render +#define GL_NV_conditional_render 1 +#endif + +#ifndef GL_NV_present_video +#define GL_NV_present_video 1 +#endif + +#ifndef GL_EXT_transform_feedback +#define GL_EXT_transform_feedback 1 +#endif + #ifdef __cplusplus } diff --git a/include/GL/glu.h b/include/GL/glu.h index 7db4b707b5..3cd1113509 100644 --- a/include/GL/glu.h +++ b/include/GL/glu.h @@ -1,31 +1,32 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: This software was created using the -** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has -** not been independently verified as being compliant with the OpenGL(R) -** version 1.2.1 Specification. -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ #ifndef __glu_h__ #define __glu_h__ diff --git a/include/GL/glxext.h b/include/GL/glxext.h index aedc311cbf..5328acd1d9 100644 --- a/include/GL/glxext.h +++ b/include/GL/glxext.h @@ -46,9 +46,9 @@ extern "C" { /*************************************************************/ /* Header file version number, required by OpenGL ABI for Linux */ -/* glxext.h last updated 2007/04/21 */ +/* glxext.h last updated 2008/08/10 */ /* Current version at http://www.opengl.org/registry/ */ -#define GLX_GLXEXT_VERSION 19 +#define GLX_GLXEXT_VERSION 20 #ifndef GLX_VERSION_1_3 #define GLX_WINDOW_BIT 0x00000001 @@ -346,6 +346,26 @@ extern "C" { #define GLX_AUX9_EXT 0x20EB #endif +#ifndef GLX_NV_present_video +#define GLX_GLX_NUM_VIDEO_SLOTS_NV 0x20F0 +#endif + +#ifndef GLX_NV_video_out +#define GLX_GLX_VIDEO_OUT_COLOR_NV 0x20C3 +#define GLX_GLX_VIDEO_OUT_ALPHA_NV 0x20C4 +#define GLX_GLX_VIDEO_OUT_DEPTH_NV 0x20C5 +#define GLX_GLX_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6 +#define GLX_GLX_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7 +#define GLX_GLX_VIDEO_OUT_FRAME_NV 0x20C8 +#define GLX_GLX_VIDEO_OUT_FIELD_1_NV 0x20C9 +#define GLX_GLX_VIDEO_OUT_FIELD_2_NV 0x20CA +#define GLX_GLX_VIDEO_OUT_STACKED_FIELDS_1_2_NV 0x20CB +#define GLX_GLX_VIDEO_OUT_STACKED_FIELDS_2_1_NV 0x20CC +#endif + +#ifndef GLX_NV_swap_group +#endif + /*************************************************************/ @@ -777,6 +797,18 @@ typedef void ( * PFNGLXBINDTEXIMAGEEXTPROC) (Display *dpy, GLXDrawable drawable, typedef void ( * PFNGLXRELEASETEXIMAGEEXTPROC) (Display *dpy, GLXDrawable drawable, int buffer); #endif +#ifndef GLX_NV_present_video +#define GLX_NV_present_video 1 +#endif + +#ifndef GLX_NV_video_out +#define GLX_NV_video_out 1 +#endif + +#ifndef GLX_NV_swap_group +#define GLX_NV_swap_group 1 +#endif + #ifdef __cplusplus } diff --git a/include/GL/internal/dri_interface.h b/include/GL/internal/dri_interface.h index 033d7a4ae4..e4cc16b866 100644 --- a/include/GL/internal/dri_interface.h +++ b/include/GL/internal/dri_interface.h @@ -40,7 +40,14 @@ #ifndef DRI_INTERFACE_H #define DRI_INTERFACE_H +/* Make this something other than __APPLE__ for other arcs with no drm.h */ +#ifndef __APPLE__ #include <drm.h> +#else +typedef unsigned int drm_context_t; +typedef unsigned int drm_drawable_t; +typedef struct drm_clip_rect drm_clip_rect_t; +#endif /** * \name DRI interface structures @@ -68,6 +75,10 @@ typedef struct __DRItexOffsetExtensionRec __DRItexOffsetExtension; typedef struct __DRItexBufferExtensionRec __DRItexBufferExtension; typedef struct __DRIlegacyExtensionRec __DRIlegacyExtension; typedef struct __DRIswrastExtensionRec __DRIswrastExtension; +typedef struct __DRIbufferRec __DRIbuffer; +typedef struct __DRIdri2ExtensionRec __DRIdri2Extension; +typedef struct __DRIdri2LoaderExtensionRec __DRIdri2LoaderExtension; + /*@}*/ @@ -336,29 +347,6 @@ struct __DRIdamageExtensionRec { void *loaderPrivate); }; -/** - * DRI2 Loader extension. This extension describes the basic - * functionality the loader needs to provide for the DRI driver. - */ -#define __DRI_LOADER "DRI_Loader" -#define __DRI_LOADER_VERSION 1 -struct __DRIloaderExtensionRec { - __DRIextension base; - - /** - * Ping the windowing system to get it to reemit info for the - * specified drawable in the DRI2 event buffer. - * - * \param draw the drawable for which to request info - * \param tail the new event buffer tail pointer - */ - void (*reemitDrawableInfo)(__DRIdrawable *draw, unsigned int *tail, - void *loaderPrivate); - - void (*postDamage)(__DRIdrawable *draw, struct drm_clip_rect *rects, - int num_rects, void *loaderPrivate); -}; - #define __DRI_SWRAST_IMAGE_OP_DRAW 1 #define __DRI_SWRAST_IMAGE_OP_CLEAR 2 #define __DRI_SWRAST_IMAGE_OP_SWAP 3 @@ -626,4 +614,60 @@ struct __DRIswrastExtensionRec { void *loaderPrivate); }; +/** + * DRI2 Loader extension. + */ +#define __DRI_BUFFER_FRONT_LEFT 0 +#define __DRI_BUFFER_BACK_LEFT 1 +#define __DRI_BUFFER_FRONT_RIGHT 2 +#define __DRI_BUFFER_BACK_RIGHT 3 +#define __DRI_BUFFER_DEPTH 4 +#define __DRI_BUFFER_STENCIL 5 +#define __DRI_BUFFER_ACCUM 6 + +struct __DRIbufferRec { + unsigned int attachment; + unsigned int name; + unsigned int pitch; + unsigned int cpp; + unsigned int flags; +}; + +#define __DRI_DRI2_LOADER "DRI_DRI2Loader" +#define __DRI_DRI2_LOADER_VERSION 1 +struct __DRIdri2LoaderExtensionRec { + __DRIextension base; + + __DRIbuffer *(*getBuffers)(__DRIdrawable *driDrawable, + int *width, int *height, + unsigned int *attachments, int count, + int *out_count, void *loaderPrivate); +}; + +/** + * This extension provides alternative screen, drawable and context + * constructors for DRI2. + */ +#define __DRI_DRI2 "DRI_DRI2" +#define __DRI_DRI2_VERSION 1 + +struct __DRIdri2ExtensionRec { + __DRIextension base; + + __DRIscreen *(*createNewScreen)(int screen, int fd, + const __DRIextension **extensions, + const __DRIconfig ***driver_configs, + void *loaderPrivate); + + __DRIdrawable *(*createNewDrawable)(__DRIscreen *screen, + const __DRIconfig *config, + void *loaderPrivate); + + __DRIcontext *(*createNewContext)(__DRIscreen *screen, + const __DRIconfig *config, + __DRIcontext *shared, + void *loaderPrivate); + +}; + #endif diff --git a/include/GL/internal/dri_sarea.h b/include/GL/internal/dri_sarea.h deleted file mode 100644 index 849161fbc1..0000000000 --- a/include/GL/internal/dri_sarea.h +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Copyright 2007 Red Hat, Inc - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * on the rights to use, copy, modify, merge, publish, distribute, sub - * license, and/or sell copies of the Software, and to permit persons to whom - * the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL - * 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. - */ - -#ifndef DRI_SAREA_H -#define DRI_SAREA_H - -#include <drm.h> - -/* The DRI2 SAREA holds a list of self-describing blocks. Each block - * is 8 byte aligned and has a common 32-bit header word. The upper - * 16 bits describe the type of the block and the lower 16 bits the - * size. DRI2 only defines a couple of blocks and allows drivers to - * define driver specific blocks using type codes from 0x8000 and up. - * The type code 0x0000 defines the end of the sarea. */ - -#define DRI2_SAREA_BLOCK_HEADER(type, size) (((type) << 16) | (size)) -#define DRI2_SAREA_BLOCK_TYPE(b) ((b) >> 16) -#define DRI2_SAREA_BLOCK_SIZE(b) ((b) & 0xffff) -#define DRI2_SAREA_BLOCK_NEXT(p) \ - ((void *) ((unsigned char *) (p) + \ - DRI2_SAREA_BLOCK_SIZE(*(unsigned int *) p))) - -#define DRI2_SAREA_BLOCK_END 0x0000 -#define DRI2_SAREA_BLOCK_LOCK 0x0001 -#define DRI2_SAREA_BLOCK_EVENT_BUFFER 0x0002 - -/* Chipset specific blocks start at 0x8000, 0xffff is reserved. */ - -typedef struct __DRILock __DRILock; -typedef struct __DRIEventBuffer __DRIEventBuffer; -typedef struct __DRIDrawableBuffer __DRIDrawableBuffer; -typedef struct __DRIDrawableConfigEvent __DRIDrawableConfigEvent; -typedef struct __DRIBufferAttachEvent __DRIBufferAttachEvent; - -struct __DRILock { - unsigned int block_header; - drm_hw_lock_t lock; - - /* We use this with DRM_CAS to allocate lock IDs for the real lock.*/ - unsigned int next_id; -}; - -struct __DRIEventBuffer { - unsigned int block_header; - unsigned int head; /* last valid event */ - unsigned int prealloc; /* event currently being written */ - unsigned int size; /* size of data */ - unsigned char data[0]; -}; - -enum { - /* the four standard color buffers */ - DRI_DRAWABLE_BUFFER_FRONT_LEFT = 0, - DRI_DRAWABLE_BUFFER_BACK_LEFT = 1, - DRI_DRAWABLE_BUFFER_FRONT_RIGHT = 2, - DRI_DRAWABLE_BUFFER_BACK_RIGHT = 3, - /* optional aux buffer */ - DRI_DRAWABLE_BUFFER_AUX0 = 4, - DRI_DRAWABLE_BUFFER_AUX1 = 5, - DRI_DRAWABLE_BUFFER_AUX2 = 6, - DRI_DRAWABLE_BUFFER_AUX3 = 7, - DRI_DRAWABLE_BUFFER_DEPTH = 8, - DRI_DRAWABLE_BUFFER_STENCIL = 9, - DRI_DRAWABLE_BUFFER_ACCUM = 10, - /* generic renderbuffers */ - DRI_DRAWABLE_BUFFER_COLOR0 = 11, - DRI_DRAWABLE_BUFFER_COLOR1 = 12, - DRI_DRAWABLE_BUFFER_COLOR2 = 13, - DRI_DRAWABLE_BUFFER_COLOR3 = 14, - DRI_DRAWABLE_BUFFER_COLOR4 = 15, - DRI_DRAWABLE_BUFFER_COLOR5 = 16, - DRI_DRAWABLE_BUFFER_COLOR6 = 17, - DRI_DRAWABLE_BUFFER_COLOR7 = 18, - DRI_DRAWABLE_BUFFER_COUNT = 19 -}; - -struct __DRIDrawableBuffer { - unsigned int attachment; - unsigned int handle; - unsigned int pitch; - unsigned short cpp; - - /* Upper 8 bits are driver specific, lower 8 bits generic. The - * bits can inidicate buffer properties such as tiled, swizzled etc. */ - unsigned short flags; -}; - -#define DRI2_EVENT_HEADER(type, size) (((type) << 16) | (size)) -#define DRI2_EVENT_TYPE(b) ((b) >> 16) -#define DRI2_EVENT_SIZE(b) ((b) & 0xffff) - -#define DRI2_EVENT_PAD 0x0000 -#define DRI2_EVENT_DRAWABLE_CONFIG 0x0001 -#define DRI2_EVENT_BUFFER_ATTACH 0x0002 - -struct __DRIDrawableConfigEvent { - unsigned int event_header; - unsigned int drawable; - short x; - short y; - unsigned int width; - unsigned int height; - unsigned int num_rects; - struct drm_clip_rect rects[0]; -}; - -struct __DRIBufferAttachEvent { - unsigned int event_header; - unsigned int drawable; - __DRIDrawableBuffer buffer; -}; - -#endif /* DRI_SAREA_H */ diff --git a/include/GL/internal/glcore.h b/include/GL/internal/glcore.h index 1bb63c1aee..99de6c097f 100644 --- a/include/GL/internal/glcore.h +++ b/include/GL/internal/glcore.h @@ -2,39 +2,34 @@ #define __gl_core_h_ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ #include <sys/types.h> diff --git a/include/GL/internal/sarea.h b/include/GL/internal/sarea.h index 77c16e0efe..a0d6084f31 100644 --- a/include/GL/internal/sarea.h +++ b/include/GL/internal/sarea.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/GL/dri/sarea.h,v 1.11 2002/10/30 12:52:03 alanh Exp $ */ /** * \file sarea.h * SAREA definitions. @@ -34,7 +33,6 @@ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/GL/dri/sarea.h,v 1.11 2002/10/30 12:52:03 alanh Exp $ */ #ifndef _SAREA_H_ #define _SAREA_H_ diff --git a/include/GLES/egl.h b/include/GLES/egl.h index f18c86ca62..61a2cc3c9b 100644 --- a/include/GLES/egl.h +++ b/include/GLES/egl.h @@ -2,38 +2,34 @@ #define _EGL_H /* -** 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.0 (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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2004 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ #if 0/*XXX TEMPORARY HACK*/ #include <GLES/gl.h> diff --git a/include/GLES/egltypes.h b/include/GLES/egltypes.h index 65cba8d579..6e98265043 100644 --- a/include/GLES/egltypes.h +++ b/include/GLES/egltypes.h @@ -13,20 +13,20 @@ /* ** These opaque EGL types are implemented as unsigned 32-bit integers: */ -typedef u_int32_t EGLDisplay; -typedef u_int32_t EGLConfig; -typedef u_int32_t EGLSurface; -typedef u_int32_t EGLContext; +typedef uint32_t EGLDisplay; +typedef uint32_t EGLConfig; +typedef uint32_t EGLSurface; +typedef uint32_t EGLContext; /* EGL_MESA_screen_surface */ -typedef u_int32_t EGLModeMESA; -typedef u_int32_t EGLScreenMESA; +typedef uint32_t EGLModeMESA; +typedef uint32_t EGLScreenMESA; /* ** Other basic EGL types: */ -typedef u_int8_t EGLBoolean; +typedef uint8_t EGLBoolean; typedef int32_t EGLint; typedef void * NativeDisplayType; diff --git a/progs/beos/demo.cpp b/progs/beos/demo.cpp index 6b0b9576d6..ae29bb80b2 100644 --- a/progs/beos/demo.cpp +++ b/progs/beos/demo.cpp @@ -1,4 +1,3 @@ -// $Id: demo.cpp,v 1.2 2004/08/14 09:59:16 phoudoin Exp $ // Simple BeOS GLView demo // Written by Brian Paul diff --git a/progs/demos/gearbox.c b/progs/demos/gearbox.c index 3a1662cd62..35bde04417 100644 --- a/progs/demos/gearbox.c +++ b/progs/demos/gearbox.c @@ -264,38 +264,44 @@ draw(void) glLoadIdentity(); glTranslatef(0.0, 0.0, -40.0); + /* clear whole depth buffer */ glDisable(GL_SCISSOR_TEST); glClear(GL_DEPTH_BUFFER_BIT); glEnable(GL_SCISSOR_TEST); - /* draw gears */ + /* clear upper-left corner of color buffer (unused space) */ + glScissor(0, TexHeight, TexWidth, WinHeight - TexHeight); + glClearColor(0.0, 0.0, 0.0, 0.0); + glClear(GL_COLOR_BUFFER_BIT); + + /* clear lower-left corner of color buffer */ glViewport(0, 0, TexWidth, TexHeight); glScissor(0, 0, TexWidth, TexHeight); - glClearColor(0.5, 0.5, 0.8, 0.0); glClearColor(1, 1, 1, 0); glClear(GL_COLOR_BUFFER_BIT); + /* draw gears in lower-left corner */ glMatrixMode(GL_PROJECTION); glLoadIdentity(); glFrustum(-1.0, 1.0, -1.0, 1.0, 5.0, 60.0); glMatrixMode(GL_MODELVIEW); - DrawGears(); + /* copy color buffer to texture */ glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, TexWidth, TexHeight); - /* draw textured cube */ + /* clear right half of color buffer */ glViewport(TexWidth, 0, WinWidth - TexWidth, WinHeight); glScissor(TexWidth, 0, WinWidth - TexWidth, WinHeight); glClearColor(0.5, 0.5, 0.8, 0.0); glClear(GL_COLOR_BUFFER_BIT); + /* draw textured cube in right half of window */ ar = (float) (WinWidth - TexWidth) / WinHeight; glMatrixMode(GL_PROJECTION); glLoadIdentity(); glFrustum(-ar, ar, -1.0, 1.0, 5.0, 60.0); glMatrixMode(GL_MODELVIEW); - DrawCube(); /* finish up */ diff --git a/progs/demos/rain.cxx b/progs/demos/rain.cxx index 5c53d4248c..59b6471ef8 100644 --- a/progs/demos/rain.cxx +++ b/progs/demos/rain.cxx @@ -114,7 +114,7 @@ static void calcposobs(void) rainParticle::setRainingArea(obs[0]-7.0f,-0.2f,obs[2]-7.0f,obs[0]+7.0f,8.0f,obs[2]+7.0f); } -static void printstring(void *font, char *string) +static void printstring(void *font, const char *string) { int len,i; diff --git a/progs/ggi/gears.c b/progs/ggi/gears.c index ac2e9f2a6e..2b3231d8ae 100644 --- a/progs/ggi/gears.c +++ b/progs/ggi/gears.c @@ -1,4 +1,3 @@ -/* $Id: gears.c,v 1.3 1999/08/22 08:56:50 jtaylor Exp $ */ /* * 3-D gear wheels. This program is in the public domain. diff --git a/progs/glsl/CH06-brick.frag.txt b/progs/glsl/CH06-brick.frag index 06ef04e3af..06ef04e3af 100644 --- a/progs/glsl/CH06-brick.frag.txt +++ b/progs/glsl/CH06-brick.frag diff --git a/progs/glsl/CH06-brick.vert.txt b/progs/glsl/CH06-brick.vert index e95e6f42f0..e95e6f42f0 100644 --- a/progs/glsl/CH06-brick.vert.txt +++ b/progs/glsl/CH06-brick.vert diff --git a/progs/glsl/CH11-bumpmap.frag.txt b/progs/glsl/CH11-bumpmap.frag index 063576f5a3..063576f5a3 100644 --- a/progs/glsl/CH11-bumpmap.frag.txt +++ b/progs/glsl/CH11-bumpmap.frag diff --git a/progs/glsl/CH11-bumpmap.vert.txt b/progs/glsl/CH11-bumpmap.vert index d3d19f62ac..d3d19f62ac 100644 --- a/progs/glsl/CH11-bumpmap.vert.txt +++ b/progs/glsl/CH11-bumpmap.vert diff --git a/progs/glsl/CH11-toyball.frag.txt b/progs/glsl/CH11-toyball.frag index 90ec1c27fc..90ec1c27fc 100644 --- a/progs/glsl/CH11-toyball.frag.txt +++ b/progs/glsl/CH11-toyball.frag diff --git a/progs/glsl/CH11-toyball.vert.txt b/progs/glsl/CH11-toyball.vert index b7da3ac839..b7da3ac839 100644 --- a/progs/glsl/CH11-toyball.vert.txt +++ b/progs/glsl/CH11-toyball.vert diff --git a/progs/glsl/CH18-mandel.frag.txt b/progs/glsl/CH18-mandel.frag index a472d81252..a472d81252 100644 --- a/progs/glsl/CH18-mandel.frag.txt +++ b/progs/glsl/CH18-mandel.frag diff --git a/progs/glsl/CH18-mandel.vert.txt b/progs/glsl/CH18-mandel.vert index c4ca66405d..c4ca66405d 100644 --- a/progs/glsl/CH18-mandel.vert.txt +++ b/progs/glsl/CH18-mandel.vert diff --git a/progs/glsl/Makefile b/progs/glsl/Makefile index e3f205cdb9..850b6bdbd1 100644 --- a/progs/glsl/Makefile +++ b/progs/glsl/Makefile @@ -13,11 +13,13 @@ PROGS = \ bitmap \ brick \ bump \ + convolutions \ deriv \ mandelbrot \ multitex \ noise \ points \ + pointcoord \ texdemo1 \ toyball \ twoside \ @@ -89,6 +91,13 @@ bump: bump.o shaderutil.o $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) bump.o shaderutil.o $(LIBS) -o $@ +convolutions.o: convolutions.c readtex.h + $(CC) -c -I$(INCDIR) $(CFLAGS) convolutions.c + +convolutions: convolutions.o readtex.o + $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) convolutions.o readtex.o $(LIBS) -o $@ + + deriv.o: deriv.c extfuncs.h shaderutil.h $(CC) -c -I$(INCDIR) $(CFLAGS) deriv.c @@ -124,6 +133,13 @@ points: points.o shaderutil.o $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) points.o shaderutil.o $(LIBS) -o $@ +pointcoord.o: pointcoord.c readtex.h extfuncs.h shaderutil.h + $(CC) -c -I$(INCDIR) $(CFLAGS) pointcoord.c + +pointcoord: pointcoord.o readtex.o shaderutil.o + $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) pointcoord.o readtex.o shaderutil.o $(LIBS) -o $@ + + texdemo1.o: texdemo1.c readtex.h extfuncs.h shaderutil.h $(CC) -c -I$(INCDIR) $(CFLAGS) texdemo1.c diff --git a/progs/glsl/brick.c b/progs/glsl/brick.c index 4be266622b..526ef0e2e3 100644 --- a/progs/glsl/brick.c +++ b/progs/glsl/brick.c @@ -16,8 +16,8 @@ #include "shaderutil.h" -static char *FragProgFile = "CH06-brick.frag.txt"; -static char *VertProgFile = "CH06-brick.vert.txt"; +static char *FragProgFile = "CH06-brick.frag"; +static char *VertProgFile = "CH06-brick.vert"; /* program/shader objects */ static GLuint fragShader; diff --git a/progs/glsl/bump.c b/progs/glsl/bump.c index e42421d489..a2e0916861 100644 --- a/progs/glsl/bump.c +++ b/progs/glsl/bump.c @@ -16,8 +16,8 @@ #include "shaderutil.h" -static char *FragProgFile = "CH11-bumpmap.frag.txt"; -static char *VertProgFile = "CH11-bumpmap.vert.txt"; +static char *FragProgFile = "CH11-bumpmap.frag"; +static char *VertProgFile = "CH11-bumpmap.vert"; /* program/shader objects */ static GLuint fragShader; diff --git a/progs/glsl/convolution.frag b/progs/glsl/convolution.frag new file mode 100644 index 0000000000..e49b8acf54 --- /dev/null +++ b/progs/glsl/convolution.frag @@ -0,0 +1,21 @@ + +const int KernelSize = 9; + +//texture offsets +uniform vec2 Offset[KernelSize]; +//convolution kernel +uniform vec4 KernelValue[KernelSize]; +uniform sampler2D srcTex; +uniform vec4 ScaleFactor; +uniform vec4 BaseColor; + +void main(void) +{ + int i; + vec4 sum = vec4(0.0); + for (i = 0; i < KernelSize; ++i) { + vec4 tmp = texture2D(srcTex, gl_TexCoord[0].st + Offset[i]); + sum += tmp * KernelValue[i]; + } + gl_FragColor = sum * ScaleFactor + BaseColor; +} diff --git a/progs/glsl/convolution.vert b/progs/glsl/convolution.vert new file mode 100644 index 0000000000..752c54671c --- /dev/null +++ b/progs/glsl/convolution.vert @@ -0,0 +1,5 @@ +void main() { + gl_FrontColor = gl_Color; + gl_TexCoord[0] = gl_MultiTexCoord0; + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} diff --git a/progs/glsl/convolutions.c b/progs/glsl/convolutions.c new file mode 100644 index 0000000000..13c7eab0ea --- /dev/null +++ b/progs/glsl/convolutions.c @@ -0,0 +1,469 @@ +/** + * Convolution with GLSL. + * Note: uses GL_ARB_shader_objects, GL_ARB_vertex_shader, GL_ARB_fragment_shader, + * not the OpenGL 2.0 shader API. + * Author: Zack Rusin + */ + +#define GL_GLEXT_PROTOTYPES +#include "readtex.h" + +#include <GL/glut.h> +#include <stdio.h> +#include <stdlib.h> +#include <assert.h> +#include <math.h> + +enum Filter { + GAUSSIAN_BLUR, + SHARPEN, + MEAN_REMOVAL, + EMBOSS, + EDGE_DETECT, + NO_FILTER, + LAST +}; +#define QUIT LAST + +struct BoundingBox { + float minx, miny, minz; + float maxx, maxy, maxz; +}; +struct Texture { + GLuint id; + GLfloat x; + GLfloat y; + GLint width; + GLint height; + GLenum format; +}; + +static const char *textureLocation = "../images/girl2.rgb"; + +static GLfloat viewRotx = 0.0, viewRoty = 0.0, viewRotz = 0.0; +static struct BoundingBox box; +static struct Texture texture; +static GLuint program; +static GLint menuId; +static enum Filter filter = GAUSSIAN_BLUR; + + +static void checkError(int line) +{ + GLenum err = glGetError(); + if (err) { + printf("GL Error %s (0x%x) at line %d\n", + gluErrorString(err), (int) err, line); + } +} + +static void loadAndCompileShader(GLuint shader, const char *text) +{ + GLint stat; + + glShaderSourceARB(shader, 1, (const GLchar **) &text, NULL); + + glCompileShaderARB(shader); + + glGetObjectParameterivARB(shader, GL_COMPILE_STATUS, &stat); + if (!stat) { + GLchar log[1000]; + GLsizei len; + glGetInfoLogARB(shader, 1000, &len, log); + fprintf(stderr, "Problem compiling shader: %s\n", log); + exit(1); + } + else { + printf("Shader compiled OK\n"); + } +} + +static void readShader(GLuint shader, const char *filename) +{ + const int max = 100*1000; + int n; + char *buffer = (char*) malloc(max); + FILE *f = fopen(filename, "r"); + if (!f) { + fprintf(stderr, "Unable to open shader file %s\n", filename); + exit(1); + } + + n = fread(buffer, 1, max, f); + printf("Read %d bytes from shader file %s\n", n, filename); + if (n > 0) { + buffer[n] = 0; + loadAndCompileShader(shader, buffer); + } + + fclose(f); + free(buffer); +} + + +static void +checkLink(GLuint prog) +{ + GLint stat; + glGetObjectParameterivARB(prog, GL_LINK_STATUS, &stat); + if (!stat) { + GLchar log[1000]; + GLsizei len; + glGetInfoLogARB(prog, 1000, &len, log); + fprintf(stderr, "Linker error:\n%s\n", log); + } + else { + fprintf(stderr, "Link success!\n"); + } +} + +static void fillConvolution(GLint *k, + GLfloat *scale, + GLfloat *color) +{ + switch(filter) { + case GAUSSIAN_BLUR: + k[0] = 1; k[1] = 2; k[2] = 1; + k[3] = 2; k[4] = 4; k[5] = 2; + k[6] = 1; k[7] = 2; k[8] = 1; + + *scale = 1./16.; + break; + case SHARPEN: + k[0] = 0; k[1] = -2; k[2] = 0; + k[3] = -2; k[4] = 11; k[5] = -2; + k[6] = 0; k[7] = -2; k[8] = 0; + + *scale = 1./3.; + break; + case MEAN_REMOVAL: + k[0] = -1; k[1] = -1; k[2] = -1; + k[3] = -1; k[4] = 9; k[5] = -1; + k[6] = -1; k[7] = -1; k[8] = -1; + + *scale = 1./1.; + break; + case EMBOSS: + k[0] = -1; k[1] = 0; k[2] = -1; + k[3] = 0; k[4] = 4; k[5] = 0; + k[6] = -1; k[7] = 0; k[8] = -1; + + *scale = 1./1.; + color[0] = 0.5; + color[1] = 0.5; + color[2] = 0.5; + color[3] = 0.5; + break; + case EDGE_DETECT: + k[0] = 1; k[1] = 1; k[2] = 1; + k[3] = 0; k[4] = 0; k[5] = 0; + k[6] = -1; k[7] = -1; k[8] = -1; + + *scale = 1.; + color[0] = 0.5; + color[1] = 0.5; + color[2] = 0.5; + color[3] = 0.5; + break; + case NO_FILTER: + k[0] = 0; k[1] = 0; k[2] = 0; + k[3] = 0; k[4] = 1; k[5] = 0; + k[6] = 0; k[7] = 0; k[8] = 0; + + *scale = 1.; + break; + default: + assert(!"Unhandled switch value"); + } +} + +static void setupConvolution() +{ + GLint *kernel = (GLint*)malloc(sizeof(GLint) * 9); + GLfloat scale; + GLfloat *vecKer = (GLfloat*)malloc(sizeof(GLfloat) * 9 * 4); + GLuint loc; + GLuint i; + GLfloat baseColor[4]; + baseColor[0] = 0; + baseColor[1] = 0; + baseColor[2] = 0; + baseColor[3] = 0; + + fillConvolution(kernel, &scale, baseColor); + /*vector of 4*/ + for (i = 0; i < 9; ++i) { + vecKer[i*4 + 0] = kernel[i]; + vecKer[i*4 + 1] = kernel[i]; + vecKer[i*4 + 2] = kernel[i]; + vecKer[i*4 + 3] = kernel[i]; + } + + loc = glGetUniformLocationARB(program, "KernelValue"); + glUniform4fvARB(loc, 9, vecKer); + loc = glGetUniformLocationARB(program, "ScaleFactor"); + glUniform4fARB(loc, scale, scale, scale, scale); + loc = glGetUniformLocationARB(program, "BaseColor"); + glUniform4fARB(loc, baseColor[0], baseColor[1], + baseColor[2], baseColor[3]); + + free(vecKer); + free(kernel); +} + +static void createProgram(const char *vertProgFile, + const char *fragProgFile) +{ + GLuint fragShader = 0, vertShader = 0; + + program = glCreateProgram(); + if (vertProgFile) { + vertShader = glCreateShader(GL_VERTEX_SHADER); + readShader(vertShader, vertProgFile); + glAttachShader(program, vertShader); + } + + if (fragProgFile) { + fragShader = glCreateShader(GL_FRAGMENT_SHADER); + readShader(fragShader, fragProgFile); + glAttachShader(program, fragShader); + } + + glLinkProgramARB(program); + checkLink(program); + + glUseProgramObjectARB(program); + + /* + assert(glIsProgram(program)); + assert(glIsShader(fragShader)); + assert(glIsShader(vertShader)); + */ + + checkError(__LINE__); + {/*texture*/ + GLuint texLoc = glGetUniformLocationARB(program, "srcTex"); + glUniform1iARB(texLoc, 0); + } + {/*setup offsets */ + float offsets[] = { 1.0 / texture.width, 1.0 / texture.height, + 0.0 , 1.0 / texture.height, + -1.0 / texture.width, 1.0 / texture.height, + 1.0 / texture.width, 0.0, + 0.0 , 0.0, + -1.0 / texture.width, 0.0, + 1.0 / texture.width, -1.0 / texture.height, + 0.0 , -1.0 / texture.height, + -1.0 / texture.width, -1.0 / texture.height }; + GLuint offsetLoc = glGetUniformLocationARB(program, "Offset"); + glUniform2fvARB(offsetLoc, 9, offsets); + } + setupConvolution(); + + checkError(__LINE__); +} + + +static void readTexture(const char *filename) +{ + GLubyte *data; + + texture.x = 0; + texture.y = 0; + + glGenTextures(1, &texture.id); + glBindTexture(GL_TEXTURE_2D, texture.id); + glTexParameteri(GL_TEXTURE_2D, + GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, + GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); + data = LoadRGBImage(filename, &texture.width, &texture.height, + &texture.format); + if (!data) { + printf("Error: couldn't load texture image '%s'\n", filename); + exit(1); + } + printf("Texture %s (%d x %d)\n", + filename, texture.width, texture.height); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, + texture.width, texture.height, 0, texture.format, + GL_UNSIGNED_BYTE, data); +} + +static void menuSelected(int entry) +{ + switch (entry) { + case QUIT: + exit(0); + break; + default: + filter = (enum Filter)entry; + } + setupConvolution(); + + glutPostRedisplay(); +} + +static void menuInit() +{ + menuId = glutCreateMenu(menuSelected); + + glutAddMenuEntry("Gaussian blur", GAUSSIAN_BLUR); + glutAddMenuEntry("Sharpen", SHARPEN); + glutAddMenuEntry("Mean removal", MEAN_REMOVAL); + glutAddMenuEntry("Emboss", EMBOSS); + glutAddMenuEntry("Edge detect", EDGE_DETECT); + glutAddMenuEntry("None", NO_FILTER); + + glutAddMenuEntry("Quit", QUIT); + + glutAttachMenu(GLUT_RIGHT_BUTTON); +} + +static void init() +{ + if (!glutExtensionSupported("GL_ARB_shader_objects") || + !glutExtensionSupported("GL_ARB_vertex_shader") || + !glutExtensionSupported("GL_ARB_fragment_shader")) { + fprintf(stderr, "Sorry, this program requires GL_ARB_shader_objects, GL_ARB_vertex_shader, and GL_ARB_fragment_shader\n"); + exit(1); + } + fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); + fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); + fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR)); + + menuInit(); + readTexture(textureLocation); + createProgram("convolution.vert", "convolution.frag"); + + glEnable(GL_TEXTURE_2D); + glClearColor(1.0, 1.0, 1.0, 1.0); + /*glShadeModel(GL_SMOOTH);*/ + glShadeModel(GL_FLAT); +} + +static void reshape(int width, int height) +{ + glViewport(0, 0, width, height); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + box.minx = 0; + box.maxx = width; + box.miny = 0; + box.maxy = height; + box.minz = 0; + box.maxz = 1; + glOrtho(box.minx, box.maxx, box.miny, box.maxy, -999999, 999999); + glMatrixMode(GL_MODELVIEW); +} + +static void keyPress(unsigned char key, int x, int y) +{ + switch(key) { + case 27: + exit(0); + default: + return; + } + glutPostRedisplay(); +} + +static void +special(int k, int x, int y) +{ + switch (k) { + case GLUT_KEY_UP: + viewRotx += 2.0; + break; + case GLUT_KEY_DOWN: + viewRotx -= 2.0; + break; + case GLUT_KEY_LEFT: + viewRoty += 2.0; + break; + case GLUT_KEY_RIGHT: + viewRoty -= 2.0; + break; + default: + return; + } + glutPostRedisplay(); +} + + +static void draw() +{ + GLfloat center[2]; + GLfloat anchor[2]; + + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + + glLoadIdentity(); + glPushMatrix(); + + center[0] = box.maxx/2; + center[1] = box.maxy/2; + anchor[0] = center[0] - texture.width/2; + anchor[1] = center[1] - texture.height/2; + + glTranslatef(center[0], center[1], 0); + glRotatef(viewRotx, 1.0, 0.0, 0.0); + glRotatef(viewRoty, 0.0, 1.0, 0.0); + glRotatef(viewRotz, 0.0, 0.0, 1.0); + glTranslatef(-center[0], -center[1], 0); + + glTranslatef(anchor[0], anchor[1], 0); + glBegin(GL_TRIANGLE_STRIP); + { + glColor3f(1., 0., 0.); + glTexCoord2f(0, 0); + glVertex3f(0, 0, 0); + + glColor3f(0., 1., 0.); + glTexCoord2f(0, 1.0); + glVertex3f(0, texture.height, 0); + + glColor3f(1., 0., 0.); + glTexCoord2f(1.0, 0); + glVertex3f(texture.width, 0, 0); + + glColor3f(0., 1., 0.); + glTexCoord2f(1, 1); + glVertex3f(texture.width, texture.height, 0); + } + glEnd(); + + glPopMatrix(); + + glFlush(); + + glutSwapBuffers(); +} + +int main(int argc, char **argv) +{ + glutInit(&argc, argv); + + glutInitWindowPosition(0, 0); + glutInitWindowSize(400, 400); + glutInitDisplayMode(GLUT_RGB | GLUT_ALPHA | GLUT_DOUBLE); + + if (!glutCreateWindow("Image Convolutions")) { + fprintf(stderr, "Couldn't create window!\n"); + exit(1); + } + + init(); + + glutReshapeFunc(reshape); + glutKeyboardFunc(keyPress); + glutSpecialFunc(special); + glutDisplayFunc(draw); + + + glutMainLoop(); + return 0; +} diff --git a/progs/glsl/cubemap.frag.txt b/progs/glsl/cubemap.frag index 9c27648aaf..9c27648aaf 100644 --- a/progs/glsl/cubemap.frag.txt +++ b/progs/glsl/cubemap.frag diff --git a/progs/glsl/mandelbrot.c b/progs/glsl/mandelbrot.c index fa67a3c2ca..e6361b429b 100644 --- a/progs/glsl/mandelbrot.c +++ b/progs/glsl/mandelbrot.c @@ -16,8 +16,8 @@ #include "shaderutil.h" -static char *FragProgFile = "CH18-mandel.frag.txt"; -static char *VertProgFile = "CH18-mandel.vert.txt"; +static char *FragProgFile = "CH18-mandel.frag"; +static char *VertProgFile = "CH18-mandel.vert"; /* program/shader objects */ static GLuint fragShader; diff --git a/progs/glsl/multitex.c b/progs/glsl/multitex.c index 5574ed4139..096d40f64d 100644 --- a/progs/glsl/multitex.c +++ b/progs/glsl/multitex.c @@ -35,8 +35,8 @@ static const char *Demo = "multitex"; -static const char *VertFile = "multitex.vert.txt"; -static const char *FragFile = "multitex.frag.txt"; +static const char *VertFile = "multitex.vert"; +static const char *FragFile = "multitex.frag"; static const char *TexFiles[2] = { diff --git a/progs/glsl/multitex.frag.txt b/progs/glsl/multitex.frag index 86045306af..a2633ceba7 100644 --- a/progs/glsl/multitex.frag.txt +++ b/progs/glsl/multitex.frag @@ -9,7 +9,7 @@ uniform sampler2D tex2; void main() { - vec4 t1 = texture2D(tex1, gl_TexCoord[0].xy, 0.0); - vec4 t2 = texture2D(tex2, gl_TexCoord[1].xy, 0.0); + vec4 t1 = texture2D(tex1, gl_TexCoord[0].xy); + vec4 t2 = texture2D(tex2, gl_TexCoord[1].xy); gl_FragColor = mix(t1, t2, t2.w); } diff --git a/progs/glsl/multitex.vert.txt b/progs/glsl/multitex.vert index 5518ca1ddd..5518ca1ddd 100644 --- a/progs/glsl/multitex.vert.txt +++ b/progs/glsl/multitex.vert diff --git a/progs/glsl/pointcoord.c b/progs/glsl/pointcoord.c new file mode 100644 index 0000000000..b240077c25 --- /dev/null +++ b/progs/glsl/pointcoord.c @@ -0,0 +1,205 @@ +/** + * Test GLSL 1.20 gl_PointCoord fragment program attribute. + * Brian Paul + * 11 Aug 2007 + */ + + +#include <assert.h> +#include <string.h> +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include <GL/gl.h> +#include <GL/glut.h> +#include <GL/glext.h> +#include "extfuncs.h" +#include "shaderutil.h" + + +static GLint WinWidth = 300, WinHeight = 300; +static char *FragProgFile = NULL; +static char *VertProgFile = NULL; +static GLuint fragShader; +static GLuint vertShader; +static GLuint program; +static GLint win = 0; +static GLint tex0; +static GLenum Filter = GL_NEAREST; + + +static void +Redisplay(void) +{ + glClear(GL_COLOR_BUFFER_BIT); + + /* draw one point/sprite */ + glPushMatrix(); + glPointSize(60); + glBegin(GL_POINTS); + glVertex2f(WinWidth / 2.0f, WinHeight / 2.0f); + glEnd(); + glPopMatrix(); + + glutSwapBuffers(); +} + + +static void +Reshape(int width, int height) +{ + glViewport(0, 0, width, height); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + glOrtho(0, width, 0, height, -1, 1); + + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + + WinWidth = width; + WinHeight = height; +} + + +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 27: + CleanUp(); + exit(0); + break; + } + glutPostRedisplay(); +} + + + +static void +MakeTexture(void) +{ +#define SZ 16 + GLubyte image[SZ][SZ][4]; + GLuint i, j; + + for (i = 0; i < SZ; i++) { + for (j = 0; j < SZ; j++) { + if ((i + j) & 1) { + image[i][j][0] = 0; + image[i][j][1] = 0; + image[i][j][2] = 0; + image[i][j][3] = 255; + } + else { + image[i][j][0] = j * 255 / (SZ-1); + image[i][j][1] = i * 255 / (SZ-1); + image[i][j][2] = 0; + image[i][j][3] = 255; + } + } + } + + glActiveTexture(GL_TEXTURE0); /* unit 0 */ + glBindTexture(GL_TEXTURE_2D, 42); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, SZ, SZ, 0, + GL_RGBA, GL_UNSIGNED_BYTE, image); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, Filter); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, Filter); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); +#undef SZ +} + + +static void +Init(void) +{ + static const char *fragShaderText = + "#version 120 \n" + "uniform sampler2D tex0; \n" + "void main() { \n" + " gl_FragColor = texture2D(tex0, gl_PointCoord.xy, 0.0); \n" + "}\n"; + static const char *vertShaderText = + "void main() {\n" + " gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\n" + "}\n"; + + if (!ShadersSupported()) + exit(1); + + GetExtensionFuncs(); + + vertShader = CompileShaderText(GL_VERTEX_SHADER, vertShaderText); + fragShader = CompileShaderText(GL_FRAGMENT_SHADER, fragShaderText); + program = LinkShaders(vertShader, fragShader); + + glUseProgram_func(program); + + tex0 = glGetUniformLocation_func(program, "tex0"); + printf("Uniforms: tex0: %d\n", tex0); + + glUniform1i_func(tex0, 0); /* tex unit 0 */ + + /*assert(glGetError() == 0);*/ + + glClearColor(0.3f, 0.3f, 0.3f, 0.0f); + + printf("GL_RENDERER = %s\n",(const char *) glGetString(GL_RENDERER)); + + assert(glIsProgram_func(program)); + assert(glIsShader_func(fragShader)); + assert(glIsShader_func(vertShader)); + + MakeTexture(); + + glEnable(GL_POINT_SPRITE); + + glColor3f(1, 0, 0); +} + + +static void +ParseOptions(int argc, char *argv[]) +{ + int i; + for (i = 1; i < argc; i++) { + if (strcmp(argv[i], "-fs") == 0) { + FragProgFile = argv[i+1]; + } + else if (strcmp(argv[i], "-vs") == 0) { + VertProgFile = argv[i+1]; + } + } +} + + +int +main(int argc, char *argv[]) +{ + glutInit(&argc, argv); + glutInitWindowPosition( 0, 0); + glutInitWindowSize(WinWidth, WinHeight); + glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE); + win = glutCreateWindow(argv[0]); + glutReshapeFunc(Reshape); + glutKeyboardFunc(Key); + glutDisplayFunc(Redisplay); + ParseOptions(argc, argv); + Init(); + glutMainLoop(); + return 0; +} diff --git a/progs/glsl/reflect.vert.txt b/progs/glsl/reflect.vert index 402be38bf7..402be38bf7 100644 --- a/progs/glsl/reflect.vert.txt +++ b/progs/glsl/reflect.vert diff --git a/progs/glsl/shadowtex.frag.txt b/progs/glsl/shadowtex.frag index a6a80da47f..a6a80da47f 100644 --- a/progs/glsl/shadowtex.frag.txt +++ b/progs/glsl/shadowtex.frag diff --git a/progs/glsl/simple.vert.txt b/progs/glsl/simple.vert index a0abe0dc0b..a0abe0dc0b 100644 --- a/progs/glsl/simple.vert.txt +++ b/progs/glsl/simple.vert diff --git a/progs/glsl/texdemo1.c b/progs/glsl/texdemo1.c index 3dd19eaf4b..41010746ee 100644 --- a/progs/glsl/texdemo1.c +++ b/progs/glsl/texdemo1.c @@ -35,11 +35,11 @@ static const char *Demo = "texdemo1"; -static const char *ReflectVertFile = "reflect.vert.txt"; -static const char *CubeFragFile = "cubemap.frag.txt"; +static const char *ReflectVertFile = "reflect.vert"; +static const char *CubeFragFile = "cubemap.frag"; -static const char *SimpleVertFile = "simple.vert.txt"; -static const char *SimpleTexFragFile = "shadowtex.frag.txt"; +static const char *SimpleVertFile = "simple.vert"; +static const char *SimpleTexFragFile = "shadowtex.frag"; static const char *GroundImage = "../images/tile.rgb"; diff --git a/progs/glsl/toyball.c b/progs/glsl/toyball.c index b870435f66..2daaedd6df 100644 --- a/progs/glsl/toyball.c +++ b/progs/glsl/toyball.c @@ -16,8 +16,8 @@ #include "shaderutil.h" -static char *FragProgFile = "CH11-toyball.frag.txt"; -static char *VertProgFile = "CH11-toyball.vert.txt"; +static char *FragProgFile = "CH11-toyball.frag"; +static char *VertProgFile = "CH11-toyball.vert"; /* program/shader objects */ static GLuint fragShader; diff --git a/progs/glsl/trirast.c b/progs/glsl/trirast.c index 67cbac0546..89df64fc71 100644 --- a/progs/glsl/trirast.c +++ b/progs/glsl/trirast.c @@ -190,7 +190,7 @@ Init(void) "}\n"; static const char *vertShaderText = "void main() {\n" - " gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\n" + " gl_Position = ftransform(); \n" "}\n"; if (!ShadersSupported()) diff --git a/progs/glsl/twoside.c b/progs/glsl/twoside.c index 77977be536..672a00491e 100644 --- a/progs/glsl/twoside.c +++ b/progs/glsl/twoside.c @@ -28,7 +28,7 @@ static GLuint program; static GLint win = 0; static GLboolean anim = 0*GL_TRUE; static GLboolean DetermineInFragProg = GL_TRUE; -static GLfloat Yrot = 0.0f; +static GLfloat Xrot = 30.0f; static GLint u_fragface; static GLenum FrontWinding = GL_CCW; static int prevTime = 0; @@ -41,7 +41,8 @@ static const GLfloat Green[4] = {0, 1, 0, 0}; static void Redisplay(void) { - float xmin = -1, xmax = 1, ymin = -1, ymax = 1; + int i; + float radius = 2; glFrontFace(FrontWinding); @@ -54,18 +55,22 @@ Redisplay(void) glEnable(GL_VERTEX_PROGRAM_TWO_SIDE); } - glClear(GL_COLOR_BUFFER_BIT); + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); glPushMatrix(); - glRotatef(Yrot, 0, 1, 0); + glRotatef(Xrot, 1, 0, 0); - glBegin(GL_POLYGON); + /* Draw a tristrip ring */ + glBegin(GL_TRIANGLE_STRIP); glColor4fv(Red); glSecondaryColor3fv_func(Green); - glVertex2f(xmin, ymin); - glVertex2f(xmax, ymin); - glVertex2f(xmax, ymax); - glVertex2f(xmin, ymax); + for (i = 0; i < 20; i++) { + float a = i / 19.0 * M_PI * 2.0; + float x = radius * cos(a); + float y = radius * sin(a); + glVertex3f(x, -1, y); + glVertex3f(x, +1, y); + } glEnd(); glPopMatrix(); @@ -86,7 +91,7 @@ Idle(void) } prevTime = curTime; - Yrot += dt * 0.1; + Xrot += dt * 0.1; glutPostRedisplay(); } @@ -98,7 +103,7 @@ Reshape(int width, int height) glViewport(0, 0, width, height); glMatrixMode(GL_PROJECTION); glLoadIdentity(); - glFrustum(-ar, ar, -1, 1, 5, 15); + glFrustum(-ar, ar, -1, 1, 3, 25); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glTranslatef(0, 0, -10); @@ -141,12 +146,16 @@ Key(unsigned char key, int x, int y) DetermineInFragProg = GL_FALSE; break; case 'r': - Yrot = 0; + /* reset */ + Xrot = 30; anim = 0; glutIdleFunc(NULL); break; case 's': - Yrot += 5; + Xrot += 5; + break; + case 'S': + Xrot -= 5; break; case 'w': if (FrontWinding == GL_CCW) { @@ -173,12 +182,24 @@ Init(void) static const char *fragShaderText = "uniform bool fragface; \n" "void main() { \n" +#if 0 " if (!fragface || gl_FrontFacing) { \n" " gl_FragColor = gl_Color; \n" " } \n" " else { \n" " gl_FragColor = 0.8 * gl_SecondaryColor; \n" " } \n" +#else + " bool f = gl_FrontFacing; \n" + " if (f) { \n" + " gl_FragColor = vec4(1.0, 0.0, 0.0, 0.0); \n" + " } \n" + " else { \n" + " gl_FragColor = vec4(0.0, 1.0, 0.0, 0.0); \n" + " } \n" + " //float g = float(gl_FrontFacing) * 0.5 + 0.5; \n" + " //gl_FragColor = vec4(g); \n" +#endif "} \n"; static const char *vertShaderText = "uniform bool fragface; \n" @@ -218,6 +239,8 @@ Init(void) assert(glIsProgram_func(program)); assert(glIsShader_func(fragShader)); assert(glIsShader_func(vertShader)); + + glEnable(GL_DEPTH_TEST); } @@ -246,6 +269,7 @@ Usage(void) printf(" a - toggle animation\n"); printf(" s - step rotation\n"); printf(" w - toggle CW, CCW front-face winding\n"); + printf("NOTE: red = front face, green = back face.\n"); } @@ -255,7 +279,7 @@ main(int argc, char *argv[]) glutInit(&argc, argv); glutInitWindowPosition( 0, 0); glutInitWindowSize(WinWidth, WinHeight); - glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE); + glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE); win = glutCreateWindow(argv[0]); glutReshapeFunc(Reshape); glutKeyboardFunc(Key); diff --git a/progs/miniglx/glfbdevtest.c b/progs/miniglx/glfbdevtest.c index c82ca6e5f6..d4efb96930 100644 --- a/progs/miniglx/glfbdevtest.c +++ b/progs/miniglx/glfbdevtest.c @@ -1,4 +1,3 @@ -/* $Id: glfbdevtest.c,v 1.1 2003/08/06 17:47:15 keithw Exp $ */ /* * Test the GLFBDev interface. Only tested with radeonfb driver!!!! diff --git a/progs/miniglx/manytex.c b/progs/miniglx/manytex.c index 36fa10d222..74b06649f6 100644 --- a/progs/miniglx/manytex.c +++ b/progs/miniglx/manytex.c @@ -1,4 +1,3 @@ -/* $Id: manytex.c,v 1.2 2003/08/23 01:28:59 jonsmirl Exp $ */ /* * test handling of many texture maps diff --git a/progs/miniglx/sample_server.c b/progs/miniglx/sample_server.c index 039c04fa40..62456eca25 100644 --- a/progs/miniglx/sample_server.c +++ b/progs/miniglx/sample_server.c @@ -1,4 +1,3 @@ -/* $Id: sample_server.c,v 1.1 2003/08/06 17:47:15 keithw Exp $ */ /* * Sample server that just keeps first available window mapped. diff --git a/progs/miniglx/sample_server2.c b/progs/miniglx/sample_server2.c index 58effcf484..efd382a6d9 100644 --- a/progs/miniglx/sample_server2.c +++ b/progs/miniglx/sample_server2.c @@ -1,4 +1,3 @@ -/* $Id: sample_server2.c,v 1.2 2003/08/23 01:28:59 jonsmirl Exp $ */ /* * Sample server that just keeps first available window mapped. diff --git a/progs/miniglx/texline.c b/progs/miniglx/texline.c index d2a97d2876..098077f247 100644 --- a/progs/miniglx/texline.c +++ b/progs/miniglx/texline.c @@ -1,4 +1,3 @@ -/* $Id: texline.c,v 1.1 2003/08/06 17:47:15 keithw Exp $ */ /* * Test textured lines. diff --git a/progs/tests/Makefile.win b/progs/tests/Makefile.win index 0de6c42e39..d42e3cb654 100644 --- a/progs/tests/Makefile.win +++ b/progs/tests/Makefile.win @@ -1,4 +1,3 @@ -# $Id: Makefile.win,v 1.1 2002/01/16 01:03:25 kschultz Exp $ # Mesa 3-D graphics library # Version: 3.5 diff --git a/progs/tests/antialias.c b/progs/tests/antialias.c index c389bbea3a..f23b5aff32 100644 --- a/progs/tests/antialias.c +++ b/progs/tests/antialias.c @@ -1,4 +1,3 @@ -/* $Id: antialias.c,v 1.2 2003/03/29 16:42:57 brianp Exp $ */ /* * Test multisampling and polygon smoothing. diff --git a/progs/tests/cva.c b/progs/tests/cva.c index bde4c6c827..a9393aef0c 100644 --- a/progs/tests/cva.c +++ b/progs/tests/cva.c @@ -1,4 +1,3 @@ -/* $Id: cva.c,v 1.8 2006/11/22 19:37:21 sroland Exp $ */ /* * Trivial CVA test, good for testing driver fastpaths (especially diff --git a/progs/tests/getprocaddress.py b/progs/tests/getprocaddress.py index d16b2d93d0..8adfc51bd6 100644 --- a/progs/tests/getprocaddress.py +++ b/progs/tests/getprocaddress.py @@ -1,6 +1,5 @@ #!/usr/bin/env python -# $Id: getprocaddress.py,v 1.7 2005/06/21 23:42:43 idr Exp $ # Helper for the getprocaddress.c test. diff --git a/progs/tests/jkrahntest.c b/progs/tests/jkrahntest.c index 85bda8d015..08660b8932 100644 --- a/progs/tests/jkrahntest.c +++ b/progs/tests/jkrahntest.c @@ -1,4 +1,3 @@ -/* $Id: jkrahntest.c,v 1.2 2006/01/30 17:12:10 brianp Exp $ */ /* This is a good test for glXSwapBuffers on non-current windows, * and the glXCopyContext function. Fixed several Mesa/DRI bugs with diff --git a/progs/tests/manytex.c b/progs/tests/manytex.c index 61a1519ae6..74b06649f6 100644 --- a/progs/tests/manytex.c +++ b/progs/tests/manytex.c @@ -1,4 +1,3 @@ -/* $Id: manytex.c,v 1.5 2005/09/15 01:58:39 brianp Exp $ */ /* * test handling of many texture maps diff --git a/progs/tests/multipal.c b/progs/tests/multipal.c index fac652f4e0..7bd4473565 100644 --- a/progs/tests/multipal.c +++ b/progs/tests/multipal.c @@ -1,4 +1,3 @@ -/* $Id: multipal.c,v 1.6 2003/12/08 09:03:36 joukj Exp $ */ /* * Test multitexture and paletted textures. diff --git a/progs/tests/multiwindow.c b/progs/tests/multiwindow.c index e004b0336c..b069bea91c 100644 --- a/progs/tests/multiwindow.c +++ b/progs/tests/multiwindow.c @@ -1,4 +1,3 @@ -/* $Id: multiwindow.c,v 1.1 2001/08/21 14:25:31 brianp Exp $ */ /* * A skeleton/template GLUT program @@ -8,7 +7,6 @@ /* - * $Log: multiwindow.c,v $ * Revision 1.1 2001/08/21 14:25:31 brianp * simple multi-window GLUT test prog * diff --git a/progs/tests/sharedtex.c b/progs/tests/sharedtex.c index 7be90d67f5..c07ebd719c 100644 --- a/progs/tests/sharedtex.c +++ b/progs/tests/sharedtex.c @@ -1,4 +1,3 @@ -/* $Id: sharedtex.c,v 1.2 2002/01/16 14:32:46 joukj Exp $ */ /* * Test sharing of display lists and texture objects between GLX contests. diff --git a/progs/tests/texline.c b/progs/tests/texline.c index d3935b94af..76dfccd9b1 100644 --- a/progs/tests/texline.c +++ b/progs/tests/texline.c @@ -1,4 +1,3 @@ -/* $Id: texline.c,v 1.5 2004/01/28 10:07:48 keithw Exp $ */ /* * Test textured lines. diff --git a/progs/tests/texrect.c b/progs/tests/texrect.c index 61c1fdd6b4..43edc49180 100644 --- a/progs/tests/texrect.c +++ b/progs/tests/texrect.c @@ -1,4 +1,3 @@ -/* $Id: texrect.c,v 1.5 2004/05/06 20:27:32 brianp Exp $ */ /* GL_NV_texture_rectangle test * diff --git a/progs/tests/texwrap.c b/progs/tests/texwrap.c index 6e9fbe0c70..8143256f8a 100644 --- a/progs/tests/texwrap.c +++ b/progs/tests/texwrap.c @@ -1,4 +1,3 @@ -/* $Id: texwrap.c,v 1.8 2005/08/25 03:09:12 brianp Exp $ */ /* * Test texture wrap modes. diff --git a/progs/trivial/Makefile b/progs/trivial/Makefile index e72fb07889..36a5548488 100644 --- a/progs/trivial/Makefile +++ b/progs/trivial/Makefile @@ -47,6 +47,7 @@ SOURCES = \ dlist-edgeflag.c \ dlist-dangling.c \ dlist-edgeflag-dangling.c \ + dlist-degenerate.c \ drawrange.c \ drawelements.c \ drawarrays.c \ diff --git a/progs/trivial/dlist-degenerate.c b/progs/trivial/dlist-degenerate.c new file mode 100644 index 0000000000..c7f2d2a6e9 --- /dev/null +++ b/progs/trivial/dlist-degenerate.c @@ -0,0 +1,153 @@ +/** + * Test display list corner cases. + */ + + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include <GL/glut.h> + + +static int Win; +static GLfloat Xrot = 0, Yrot = 0, Zrot = 0; +static GLboolean Anim = GL_FALSE; +static GLuint List1 = 0, List2 = 0; + + +static void +Idle(void) +{ + Xrot += 3.0; + Yrot += 4.0; + Zrot += 2.0; + glutPostRedisplay(); +} + + +static void +Draw(void) +{ + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + + glPushMatrix(); + glRotatef(Xrot, 1, 0, 0); + glRotatef(Yrot, 0, 1, 0); + glRotatef(Zrot, 0, 0, 1); + + glCallList(List1); + glCallList(List2); + + glPopMatrix(); + + glutSwapBuffers(); +} + + +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.0, 0.0, -15.0); +} + + +static void +Key(unsigned char key, int x, int y) +{ + const GLfloat step = 3.0; + (void) x; + (void) y; + switch (key) { + case 'a': + Anim = !Anim; + if (Anim) + glutIdleFunc(Idle); + else + glutIdleFunc(NULL); + break; + case 'z': + Zrot -= step; + break; + case 'Z': + Zrot += step; + break; + case 27: + glutDestroyWindow(Win); + exit(0); + break; + } + glutPostRedisplay(); +} + + +static void +SpecialKey(int key, int x, int y) +{ + const GLfloat 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(void) +{ + /* List1: start of primitive */ + List1 = glGenLists(1); + glNewList(List1, GL_COMPILE); + glBegin(GL_POLYGON); + glVertex2f(-1, -1); + glVertex2f( 1, -1); + glEndList(); + + /* List2: end of primitive */ + List2 = glGenLists(1); + glNewList(List2, GL_COMPILE); + glVertex2f( 1, 1); + glVertex2f(-1, 1); + glEnd(); + glEndList(); + + glEnable(GL_DEPTH_TEST); +} + + +int +main(int argc, char *argv[]) +{ + glutInit(&argc, argv); + glutInitWindowPosition(0, 0); + glutInitWindowSize(400, 400); + glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH); + Win = glutCreateWindow(argv[0]); + glutReshapeFunc(Reshape); + glutKeyboardFunc(Key); + glutSpecialFunc(SpecialKey); + glutDisplayFunc(Draw); + if (Anim) + glutIdleFunc(Idle); + Init(); + glutMainLoop(); + return 0; +} diff --git a/progs/util/README b/progs/util/README index ca89d34bd3..ea71ebd2b9 100644 --- a/progs/util/README +++ b/progs/util/README @@ -19,4 +19,3 @@ imagesgi.cpp,.h - read SGI image files more to come... ---------------------------------------------------------------------- -$Id: README,v 1.1 1999/08/19 00:55:42 jtg Exp $ diff --git a/progs/util/glstate.c b/progs/util/glstate.c index 4c5db13ec7..21d7e4552d 100644 --- a/progs/util/glstate.c +++ b/progs/util/glstate.c @@ -1,4 +1,3 @@ -/* $Id: glstate.c,v 1.1 1999/08/19 00:55:42 jtg Exp $ */ /* * Print GL state information (for debugging) @@ -21,7 +20,6 @@ /* - * $Log: glstate.c,v $ * Revision 1.1 1999/08/19 00:55:42 jtg * Initial revision * diff --git a/progs/util/glstate.h b/progs/util/glstate.h index 1aa4d21d8e..9216382b7b 100644 --- a/progs/util/glstate.h +++ b/progs/util/glstate.h @@ -1,4 +1,3 @@ -/* $Id: glstate.h,v 1.1 1999/08/19 00:55:42 jtg Exp $ */ /* * Print GL state information (for debugging) @@ -21,7 +20,6 @@ /* - * $Log: glstate.h,v $ * Revision 1.1 1999/08/19 00:55:42 jtg * Initial revision * diff --git a/progs/util/sampleMakefile b/progs/util/sampleMakefile index ebb57ff3dd..71ec150b88 100644 --- a/progs/util/sampleMakefile +++ b/progs/util/sampleMakefile @@ -1,11 +1,9 @@ -# $Id: sampleMakefile,v 1.1 1999/08/19 00:55:42 jtg Exp $ # Sample makefile for compiling OpenGL/Mesa applications on Unix. # This example assumes Linux with gcc. # This makefile is in the public domain -# $Log: sampleMakefile,v $ # Revision 1.1 1999/08/19 00:55:42 jtg # Initial revision # diff --git a/progs/util/shaderutil.c b/progs/util/shaderutil.c index 477209ab45..4f17dd7efa 100644 --- a/progs/util/shaderutil.c +++ b/progs/util/shaderutil.c @@ -27,12 +27,15 @@ Init(void) GLboolean ShadersSupported(void) { - const char *version; - - version = (const char *) glGetString(GL_VERSION); - if (version[0] != '2' || version[1] != '.') { - printf("GL_RENDERER = %s\n",(const char *) glGetString(GL_RENDERER)); - return GL_FALSE; + const char *version = (const char *) glGetString(GL_VERSION); + if (version[0] == '2' && version[1] == '.') { + return GL_TRUE; + } + else if (glutExtensionSupported("GL_ARB_vertex_shader") + && glutExtensionSupported("GL_ARB_fragment_shader") + && glutExtensionSupported("GL_ARB_shader_objects")) { + fprintf(stderr, "Warning: Trying ARB GLSL instead of OpenGL 2.x. This may not work.\n"); + return GL_TRUE; } return GL_TRUE; } diff --git a/progs/windml/ugldrawpix.c b/progs/windml/ugldrawpix.c index b33be2c6ae..154fe55970 100644 --- a/progs/windml/ugldrawpix.c +++ b/progs/windml/ugldrawpix.c @@ -7,7 +7,6 @@ */ /* - * $Log: ugldrawpix.c,v $ * Revision 1.2 2001/09/10 19:21:13 brianp * WindML updates (Stephane Raimbault) * diff --git a/progs/windml/ugltexcyl.c b/progs/windml/ugltexcyl.c index d2fe687b92..db66d1ff67 100644 --- a/progs/windml/ugltexcyl.c +++ b/progs/windml/ugltexcyl.c @@ -7,7 +7,6 @@ */ /* - * $Log: ugltexcyl.c,v $ * Revision 1.2 2001/09/10 19:21:13 brianp * WindML updates (Stephane Raimbault) * diff --git a/progs/xdemos/glxinfo.c b/progs/xdemos/glxinfo.c index 6cf127afa2..445d3ea94b 100644 --- a/progs/xdemos/glxinfo.c +++ b/progs/xdemos/glxinfo.c @@ -447,7 +447,6 @@ print_screen_info(Display *dpy, int scrnum, Bool allowDirect, GLboolean limits) if (!ctx) { fprintf(stderr, "Error: glXCreateContext failed\n"); XFree(visinfo); - XDestroyWindow(dpy, win); return; } diff --git a/progs/xdemos/vgears.c b/progs/xdemos/vgears.c index 13d030a8be..f579e8b421 100644 --- a/progs/xdemos/vgears.c +++ b/progs/xdemos/vgears.c @@ -1,4 +1,3 @@ -/* $ID$ */ /* * Spinning gears demo for Linux SVGA/Mesa interface in 32K color mode. diff --git a/src/egl/main/eglconfig.c b/src/egl/main/eglconfig.c index c180e30d7f..2a62f95b54 100644 --- a/src/egl/main/eglconfig.c +++ b/src/egl/main/eglconfig.c @@ -501,12 +501,12 @@ _eglGetConfigs(_EGLDriver *drv, EGLDisplay dpy, EGLConfig *configs, GLboolean _eglFillInConfigs(_EGLConfig * configs, GLenum fb_format, GLenum fb_type, - const u_int8_t * depth_bits, const u_int8_t * stencil_bits, + const uint8_t * depth_bits, const uint8_t * stencil_bits, unsigned num_depth_stencil_bits, const GLenum * db_modes, unsigned num_db_modes, int visType) { - static const u_int8_t bits_table[3][4] = { + static const uint8_t bits_table[3][4] = { /* R G B A */ { 5, 6, 5, 0 }, /* Any GL_UNSIGNED_SHORT_5_6_5 */ { 8, 8, 8, 0 }, /* Any RGB with any GL_UNSIGNED_INT_8_8_8_8 */ @@ -517,7 +517,7 @@ _eglFillInConfigs(_EGLConfig * configs, * Given the four supported fb_type values, this results in valid array * indices of 3, 4, 5, and 7. */ - static const u_int32_t masks_table_rgb[8][4] = { + static const uint32_t masks_table_rgb[8][4] = { {0x00000000, 0x00000000, 0x00000000, 0x00000000}, {0x00000000, 0x00000000, 0x00000000, 0x00000000}, {0x00000000, 0x00000000, 0x00000000, 0x00000000}, @@ -528,7 +528,7 @@ _eglFillInConfigs(_EGLConfig * configs, {0x000000FF, 0x0000FF00, 0x00FF0000, 0x00000000} /* 8_8_8_8_REV */ }; - static const u_int32_t masks_table_rgba[8][4] = { + static const uint32_t masks_table_rgba[8][4] = { {0x00000000, 0x00000000, 0x00000000, 0x00000000}, {0x00000000, 0x00000000, 0x00000000, 0x00000000}, {0x00000000, 0x00000000, 0x00000000, 0x00000000}, @@ -539,7 +539,7 @@ _eglFillInConfigs(_EGLConfig * configs, {0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000}, /* 8_8_8_8_REV */ }; - static const u_int32_t masks_table_bgr[8][4] = { + static const uint32_t masks_table_bgr[8][4] = { {0x00000000, 0x00000000, 0x00000000, 0x00000000}, {0x00000000, 0x00000000, 0x00000000, 0x00000000}, {0x00000000, 0x00000000, 0x00000000, 0x00000000}, @@ -550,7 +550,7 @@ _eglFillInConfigs(_EGLConfig * configs, {0x00FF0000, 0x0000FF00, 0x000000FF, 0x00000000}, /* 8_8_8_8_REV */ }; - static const u_int32_t masks_table_bgra[8][4] = { + static const uint32_t masks_table_bgra[8][4] = { {0x00000000, 0x00000000, 0x00000000, 0x00000000}, {0x00000000, 0x00000000, 0x00000000, 0x00000000}, {0x00000000, 0x00000000, 0x00000000, 0x00000000}, @@ -561,12 +561,12 @@ _eglFillInConfigs(_EGLConfig * configs, {0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000}, /* 8_8_8_8_REV */ }; - static const u_int8_t bytes_per_pixel[8] = { + static const uint8_t bytes_per_pixel[8] = { 0, 0, 0, 2, 2, 4, 0, 4 }; - const u_int8_t * bits; - const u_int32_t * masks; + const uint8_t * bits; + const uint32_t * masks; const int index = fb_type & 0x07; _EGLConfig *config; unsigned i; diff --git a/src/egl/main/eglconfig.h b/src/egl/main/eglconfig.h index 1fb976e5b4..441b3f4d20 100644 --- a/src/egl/main/eglconfig.h +++ b/src/egl/main/eglconfig.h @@ -55,7 +55,7 @@ _eglSetConfigAttrib(_EGLConfig *config, EGLint attr, EGLint val); extern GLboolean _eglFillInConfigs( _EGLConfig *configs, GLenum fb_format, GLenum fb_type, - const u_int8_t * depth_bits, const u_int8_t * stencil_bits, + const uint8_t * depth_bits, const uint8_t * stencil_bits, unsigned num_depth_stencil_bits, const GLenum * db_modes, unsigned num_db_modes, int visType ); diff --git a/src/glu/Makefile b/src/glu/Makefile index 599b3fc75a..b025a90b67 100644 --- a/src/glu/Makefile +++ b/src/glu/Makefile @@ -25,7 +25,7 @@ glu.pc: glu.pc.in install: glu.pc $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR) $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig - $(INSTALL) $(TOP)/$(LIB_DIR)/libGLU.* $(DESTDIR)$(INSTALL_LIB_DIR) + $(INSTALL) $(TOP)/$(LIB_DIR)/$(GLU_LIB_GLOB) $(DESTDIR)$(INSTALL_LIB_DIR) $(INSTALL) -m 644 glu.pc $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig clean: diff --git a/src/glu/mini/all.h b/src/glu/mini/all.h index d626bee937..874c935925 100644 --- a/src/glu/mini/all.h +++ b/src/glu/mini/all.h @@ -1,4 +1,3 @@ -/* $Id: all.h,v 1.2 2003/08/22 20:11:43 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/glu/mini/glu.c b/src/glu/mini/glu.c index 5c7722c5f0..31429e3343 100644 --- a/src/glu/mini/glu.c +++ b/src/glu/mini/glu.c @@ -1,4 +1,3 @@ -/* $Id: glu.c,v 1.2 2003/08/22 20:11:43 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/glu/mini/gluP.h b/src/glu/mini/gluP.h index 85fbc33c62..a39edce41f 100644 --- a/src/glu/mini/gluP.h +++ b/src/glu/mini/gluP.h @@ -1,4 +1,3 @@ -/* $Id: gluP.h,v 1.2 2003/08/22 20:11:43 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/glu/mini/mipmap.c b/src/glu/mini/mipmap.c index 97297729e7..a655d214e3 100644 --- a/src/glu/mini/mipmap.c +++ b/src/glu/mini/mipmap.c @@ -1,4 +1,3 @@ -/* $Id: mipmap.c,v 1.2 2003/08/22 20:11:43 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/glu/mini/nurbs.c b/src/glu/mini/nurbs.c index 93c0dd3ce2..9f39cacb41 100644 --- a/src/glu/mini/nurbs.c +++ b/src/glu/mini/nurbs.c @@ -1,4 +1,3 @@ -/* $Id: nurbs.c,v 1.2 2003/08/22 20:11:43 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/glu/mini/nurbs.h b/src/glu/mini/nurbs.h index c9c9c094f1..3642e213a8 100644 --- a/src/glu/mini/nurbs.h +++ b/src/glu/mini/nurbs.h @@ -1,4 +1,3 @@ -/* $Id: nurbs.h,v 1.2 2003/08/22 20:11:43 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/glu/mini/nurbscrv.c b/src/glu/mini/nurbscrv.c index 62d91b46d3..e80468fdb0 100644 --- a/src/glu/mini/nurbscrv.c +++ b/src/glu/mini/nurbscrv.c @@ -1,4 +1,3 @@ -/* $Id: nurbscrv.c,v 1.2 2003/08/22 20:11:43 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/glu/mini/polytest.c b/src/glu/mini/polytest.c index 52f272a3cb..1ff966f61c 100644 --- a/src/glu/mini/polytest.c +++ b/src/glu/mini/polytest.c @@ -1,4 +1,3 @@ -/* $Id: polytest.c,v 1.2 2003/08/22 20:11:43 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/glu/mini/project.c b/src/glu/mini/project.c index 71279947cf..2e79cdf084 100644 --- a/src/glu/mini/project.c +++ b/src/glu/mini/project.c @@ -1,4 +1,3 @@ -/* $Id: project.c,v 1.2 2003/08/22 20:11:43 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/glu/mini/quadric.c b/src/glu/mini/quadric.c index 015552e123..0484890ef6 100644 --- a/src/glu/mini/quadric.c +++ b/src/glu/mini/quadric.c @@ -1,4 +1,3 @@ -/* $Id: quadric.c,v 1.2 2003/08/22 20:11:43 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/glu/mini/tess.c b/src/glu/mini/tess.c index 1a384239be..341d29bae3 100644 --- a/src/glu/mini/tess.c +++ b/src/glu/mini/tess.c @@ -1,4 +1,3 @@ -/* $Id: tess.c,v 1.2 2003/08/22 20:11:43 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/glu/mini/tess.h b/src/glu/mini/tess.h index 908e20972c..4e51dddd37 100644 --- a/src/glu/mini/tess.h +++ b/src/glu/mini/tess.h @@ -1,4 +1,3 @@ -/* $Id: tess.h,v 1.2 2003/08/22 20:11:43 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/glu/mini/tesselat.c b/src/glu/mini/tesselat.c index a1102e6e5a..47d230073f 100644 --- a/src/glu/mini/tesselat.c +++ b/src/glu/mini/tesselat.c @@ -1,4 +1,3 @@ -/* $Id: tesselat.c,v 1.2 2003/08/22 20:11:43 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/glu/sgi/Makefile b/src/glu/sgi/Makefile index cd1354cc80..20c3bed0c9 100644 --- a/src/glu/sgi/Makefile +++ b/src/glu/sgi/Makefile @@ -139,7 +139,7 @@ $(TOP)/$(LIB_DIR)/$(GLU_LIB_NAME): $(OBJECTS) $(MKLIB) -o $(GLU_LIB) -linker '$(CXX)' -ldflags '$(LDFLAGS)' \ -major $(GLU_MAJOR) -minor $(GLU_MINOR) -patch $(GLU_TINY) \ -cplusplus $(MKLIB_OPTIONS) -install $(TOP)/$(LIB_DIR) \ - -exports glu.exports \ + -exports glu.exports -id $(INSTALL_LIB_DIR)/lib$(GLU_LIB).$(GLU_MAJOR).dylib \ $(GLU_LIB_DEPS) $(OBJECTS) diff --git a/src/glu/sgi/dummy.cc b/src/glu/sgi/dummy.cc index fac5a63b76..bd905a2608 100644 --- a/src/glu/sgi/dummy.cc +++ b/src/glu/sgi/dummy.cc @@ -1,4 +1,3 @@ -/* $Id: dummy.cc,v 1.1 2001/03/18 13:06:19 pesco Exp $ */ /* * This file contains nothing. It's just there so there's at least a single * source file for libGLU.la in this directory. diff --git a/src/glu/sgi/glu.exports.darwin b/src/glu/sgi/glu.exports.darwin new file mode 100644 index 0000000000..62d20ae1fb --- /dev/null +++ b/src/glu/sgi/glu.exports.darwin @@ -0,0 +1,59 @@ +_gluBeginCurve +_gluBeginPolygon +_gluBeginSurface +_gluBeginTrim +_gluBuild1DMipmapLevels +_gluBuild1DMipmaps +_gluBuild2DMipmapLevels +_gluBuild2DMipmaps +_gluBuild3DMipmapLevels +_gluBuild3DMipmaps +_gluCheckExtension +_gluCylinder +_gluDeleteNurbsRenderer +_gluDeleteQuadric +_gluDeleteTess +_gluDisk +_gluEndCurve +_gluEndPolygon +_gluEndSurface +_gluEndTrim +_gluErrorString +_gluGetNurbsProperty +_gluGetString +_gluGetTessProperty +_gluLoadSamplingMatrices +_gluLookAt +_gluNewNurbsRenderer +_gluNewQuadric +_gluNewTess +_gluNextContour +_gluNurbsCallback +_gluNurbsCallbackData +_gluNurbsCallbackDataEXT +_gluNurbsCurve +_gluNurbsProperty +_gluNurbsSurface +_gluOrtho2D +_gluPartialDisk +_gluPerspective +_gluPickMatrix +_gluProject +_gluPwlCurve +_gluQuadricCallback +_gluQuadricDrawStyle +_gluQuadricNormals +_gluQuadricOrientation +_gluQuadricTexture +_gluScaleImage +_gluSphere +_gluTessBeginContour +_gluTessBeginPolygon +_gluTessCallback +_gluTessEndContour +_gluTessEndPolygon +_gluTessNormal +_gluTessProperty +_gluTessVertex +_gluUnProject +_gluUnProject4 diff --git a/src/glu/sgi/libnurbs/interface/bezierEval.h b/src/glu/sgi/libnurbs/interface/bezierEval.h index 1a9f3c78e7..93e8c69d12 100644 --- a/src/glu/sgi/libnurbs/interface/bezierEval.h +++ b/src/glu/sgi/libnurbs/interface/bezierEval.h @@ -1,40 +1,33 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -** $Date: 2001/03/17 00:25:40 $ $Revision: 1.1 $ -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/interface/bezierEval.h,v 1.1 2001/03/17 00:25:40 brianp Exp $ */ #ifndef _BEZIEREVAL_H diff --git a/src/glu/sgi/libnurbs/interface/bezierPatch.cc b/src/glu/sgi/libnurbs/interface/bezierPatch.cc index 5b7bda1a00..dbab3a1a2b 100644 --- a/src/glu/sgi/libnurbs/interface/bezierPatch.cc +++ b/src/glu/sgi/libnurbs/interface/bezierPatch.cc @@ -31,10 +31,8 @@ ** published by SGI, but has not been independently verified as being ** compliant with the OpenGL(R) version 1.2.1 Specification. ** -** $Date: 2001/03/17 00:25:40 $ $Revision: 1.1 $ */ /* -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/interface/bezierPatch.cc,v 1.1 2001/03/17 00:25:40 brianp Exp $ */ #include "gluos.h" diff --git a/src/glu/sgi/libnurbs/interface/bezierPatch.h b/src/glu/sgi/libnurbs/interface/bezierPatch.h index 31c97ba08f..981183afae 100644 --- a/src/glu/sgi/libnurbs/interface/bezierPatch.h +++ b/src/glu/sgi/libnurbs/interface/bezierPatch.h @@ -1,40 +1,33 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -** $Date: 2001/03/17 00:25:40 $ $Revision: 1.1 $ -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/interface/bezierPatch.h,v 1.1 2001/03/17 00:25:40 brianp Exp $ */ #ifndef _BEZIERPATCH_H diff --git a/src/glu/sgi/libnurbs/interface/bezierPatchMesh.cc b/src/glu/sgi/libnurbs/interface/bezierPatchMesh.cc index 9ff416ad6e..3dc16313ff 100644 --- a/src/glu/sgi/libnurbs/interface/bezierPatchMesh.cc +++ b/src/glu/sgi/libnurbs/interface/bezierPatchMesh.cc @@ -31,10 +31,8 @@ ** published by SGI, but has not been independently verified as being ** compliant with the OpenGL(R) version 1.2.1 Specification. ** -** $Date: 2001/03/17 00:25:40 $ $Revision: 1.1 $ */ /* -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/interface/bezierPatchMesh.cc,v 1.1 2001/03/17 00:25:40 brianp Exp $ */ #include "gluos.h" diff --git a/src/glu/sgi/libnurbs/interface/bezierPatchMesh.h b/src/glu/sgi/libnurbs/interface/bezierPatchMesh.h index 74cf098858..449329665c 100644 --- a/src/glu/sgi/libnurbs/interface/bezierPatchMesh.h +++ b/src/glu/sgi/libnurbs/interface/bezierPatchMesh.h @@ -1,40 +1,33 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -** $Date: 2001/03/17 00:25:40 $ $Revision: 1.1 $ -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/interface/bezierPatchMesh.h,v 1.1 2001/03/17 00:25:40 brianp Exp $ */ #ifndef _BEZIERPATCHMESH_H diff --git a/src/glu/sgi/libnurbs/interface/glcurveval.cc b/src/glu/sgi/libnurbs/interface/glcurveval.cc index 32e4704137..b6591dba0d 100644 --- a/src/glu/sgi/libnurbs/interface/glcurveval.cc +++ b/src/glu/sgi/libnurbs/interface/glcurveval.cc @@ -35,8 +35,6 @@ /* * glcurveval.c++ * - * $Date: 2006/03/29 18:46:46 $ $Revision: 1.7 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/interface/glcurveval.cc,v 1.7 2006/03/29 18:46:46 brianp Exp $ */ /* Polynomial Evaluator Interface */ diff --git a/src/glu/sgi/libnurbs/interface/glcurveval.h b/src/glu/sgi/libnurbs/interface/glcurveval.h index a09a74d04c..8fa493034b 100644 --- a/src/glu/sgi/libnurbs/interface/glcurveval.h +++ b/src/glu/sgi/libnurbs/interface/glcurveval.h @@ -1,36 +1,32 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* * glcurveval.h diff --git a/src/glu/sgi/libnurbs/interface/glimports.h b/src/glu/sgi/libnurbs/interface/glimports.h index 9a9d3e32c9..6e69feb405 100644 --- a/src/glu/sgi/libnurbs/interface/glimports.h +++ b/src/glu/sgi/libnurbs/interface/glimports.h @@ -1,42 +1,36 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* * glimports.h * - * $Date: 2001/03/19 17:52:02 $ $Revision: 1.3 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/interface/glimports.h,v 1.3 2001/03/19 17:52:02 pesco Exp $ */ #ifndef __gluimports_h_ diff --git a/src/glu/sgi/libnurbs/interface/glinterface.cc b/src/glu/sgi/libnurbs/interface/glinterface.cc index dfd16d1722..ba64bcd2dc 100644 --- a/src/glu/sgi/libnurbs/interface/glinterface.cc +++ b/src/glu/sgi/libnurbs/interface/glinterface.cc @@ -31,10 +31,8 @@ ** published by SGI, but has not been independently verified as being ** compliant with the OpenGL(R) version 1.2.1 Specification. ** -** $Date: 2001/07/16 15:46:42 $ $Revision: 1.2 $ */ /* -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/interface/glinterface.cc,v 1.2 2001/07/16 15:46:42 brianp Exp $ */ #include "gluos.h" diff --git a/src/glu/sgi/libnurbs/interface/glrenderer.h b/src/glu/sgi/libnurbs/interface/glrenderer.h index 30f07632a4..3b72d44d1f 100644 --- a/src/glu/sgi/libnurbs/interface/glrenderer.h +++ b/src/glu/sgi/libnurbs/interface/glrenderer.h @@ -1,42 +1,36 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* * glrenderer.h * - * $Date: 2004/02/26 14:58:11 $ $Revision: 1.4 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/interface/glrenderer.h,v 1.4 2004/02/26 14:58:11 brianp Exp $ */ #ifndef __gluglrenderer_h_ diff --git a/src/glu/sgi/libnurbs/interface/glsurfeval.h b/src/glu/sgi/libnurbs/interface/glsurfeval.h index b7a88069f5..1567c6b098 100644 --- a/src/glu/sgi/libnurbs/interface/glsurfeval.h +++ b/src/glu/sgi/libnurbs/interface/glsurfeval.h @@ -1,36 +1,32 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* * glsurfeval.h diff --git a/src/glu/sgi/libnurbs/interface/incurveeval.cc b/src/glu/sgi/libnurbs/interface/incurveeval.cc index 336cca0508..96ea8896ae 100644 --- a/src/glu/sgi/libnurbs/interface/incurveeval.cc +++ b/src/glu/sgi/libnurbs/interface/incurveeval.cc @@ -31,10 +31,8 @@ ** published by SGI, but has not been independently verified as being ** compliant with the OpenGL(R) version 1.2.1 Specification. ** -** $Date: 2004/05/12 15:29:36 $ $Revision: 1.2 $ */ /* -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/interface/incurveeval.cc,v 1.2 2004/05/12 15:29:36 brianp Exp $ */ #include <stdlib.h> diff --git a/src/glu/sgi/libnurbs/interface/insurfeval.cc b/src/glu/sgi/libnurbs/interface/insurfeval.cc index e4ee3ef6a2..9d0c82a91c 100644 --- a/src/glu/sgi/libnurbs/interface/insurfeval.cc +++ b/src/glu/sgi/libnurbs/interface/insurfeval.cc @@ -31,10 +31,8 @@ ** published by SGI, but has not been independently verified as being ** compliant with the OpenGL(R) version 1.2.1 Specification. ** -** $Date: 2004/05/12 15:29:36 $ $Revision: 1.3 $ */ /* -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/interface/insurfeval.cc,v 1.3 2004/05/12 15:29:36 brianp Exp $ */ #include "gluos.h" diff --git a/src/glu/sgi/libnurbs/interface/mystdio.h b/src/glu/sgi/libnurbs/interface/mystdio.h index 6d737257f7..5ab49effd1 100644 --- a/src/glu/sgi/libnurbs/interface/mystdio.h +++ b/src/glu/sgi/libnurbs/interface/mystdio.h @@ -1,49 +1,43 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* * mystdio.h * - * $Date: 2006/03/14 15:08:52 $ $Revision: 1.4 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/interface/mystdio.h,v 1.4 2006/03/14 15:08:52 brianp Exp $ */ #ifndef __glumystdio_h_ #define __glumystdio_h_ #ifdef STANDALONE -inline void _glu_dprintf( char *, ... ) { } +inline void _glu_dprintf( const char *, ... ) { } #endif #ifdef LIBRARYBUILD @@ -51,12 +45,12 @@ inline void _glu_dprintf( char *, ... ) { } #include <stdio.h> #define _glu_dprintf printf #else -inline void _glu_dprintf( char *, ... ) { } +inline void _glu_dprintf( const char *, ... ) { } #endif #endif #ifdef GLBUILD -inline void _glu_dprintf( char *, ... ) { } +inline void _glu_dprintf( const char *, ... ) { } #endif #ifndef NULL diff --git a/src/glu/sgi/libnurbs/interface/mystdlib.h b/src/glu/sgi/libnurbs/interface/mystdlib.h index 0ebbc1299f..ab7a3b273a 100644 --- a/src/glu/sgi/libnurbs/interface/mystdlib.h +++ b/src/glu/sgi/libnurbs/interface/mystdlib.h @@ -1,42 +1,36 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* * mystdlib.h * - * $Date: 2001/03/19 17:52:02 $ $Revision: 1.3 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/interface/mystdlib.h,v 1.3 2001/03/19 17:52:02 pesco Exp $ */ #ifndef __glumystdlib_h_ diff --git a/src/glu/sgi/libnurbs/internals/arc.h b/src/glu/sgi/libnurbs/internals/arc.h index b700a1e826..e986019c3a 100644 --- a/src/glu/sgi/libnurbs/internals/arc.h +++ b/src/glu/sgi/libnurbs/internals/arc.h @@ -1,42 +1,36 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* * arc.h * - * $Date: 2001/08/07 17:34:11 $ $Revision: 1.2 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/arc.h,v 1.2 2001/08/07 17:34:11 brianp Exp $ */ #ifndef __gluarc_h_ diff --git a/src/glu/sgi/libnurbs/internals/arcsorter.cc b/src/glu/sgi/libnurbs/internals/arcsorter.cc index 1a7f4c6911..1f85cb7108 100644 --- a/src/glu/sgi/libnurbs/internals/arcsorter.cc +++ b/src/glu/sgi/libnurbs/internals/arcsorter.cc @@ -35,8 +35,6 @@ /* * arcsorter.c++ * - * $Date: 2006/03/14 15:08:52 $ $Revision: 1.2 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/arcsorter.cc,v 1.2 2006/03/14 15:08:52 brianp Exp $ */ #ifndef __gluarcsorter_c_ diff --git a/src/glu/sgi/libnurbs/internals/arcsorter.h b/src/glu/sgi/libnurbs/internals/arcsorter.h index 989f80a43c..d72dd1e86c 100644 --- a/src/glu/sgi/libnurbs/internals/arcsorter.h +++ b/src/glu/sgi/libnurbs/internals/arcsorter.h @@ -1,42 +1,36 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* * arcsorter.h * - * $Date: 2001/03/17 00:25:40 $ $Revision: 1.1 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/arcsorter.h,v 1.1 2001/03/17 00:25:40 brianp Exp $ */ #ifndef __gluarcsorter_h_ diff --git a/src/glu/sgi/libnurbs/internals/arctess.h b/src/glu/sgi/libnurbs/internals/arctess.h index fc42ea5eb7..7802af90c0 100644 --- a/src/glu/sgi/libnurbs/internals/arctess.h +++ b/src/glu/sgi/libnurbs/internals/arctess.h @@ -1,42 +1,36 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* * arctess.h * - * $Date: 2001/08/07 17:34:11 $ $Revision: 1.2 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/arctess.h,v 1.2 2001/08/07 17:34:11 brianp Exp $ */ #ifndef __gluarctess_h_ diff --git a/src/glu/sgi/libnurbs/internals/backend.cc b/src/glu/sgi/libnurbs/internals/backend.cc index 97775a9768..88dc3f5168 100644 --- a/src/glu/sgi/libnurbs/internals/backend.cc +++ b/src/glu/sgi/libnurbs/internals/backend.cc @@ -35,8 +35,6 @@ /* * backend.c++ * - * $Date: 2004/05/12 15:29:36 $ $Revision: 1.2 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/backend.cc,v 1.2 2004/05/12 15:29:36 brianp Exp $ */ /* Bezier surface backend @@ -246,7 +244,7 @@ Backend::evalVStrip(int n_left, REAL u_left, REAL* left_val, *------------------------------------------------------------------------- */ void -Backend::bgntmesh( char * ) +Backend::bgntmesh( const char * ) { #ifndef NOWIREFRAME diff --git a/src/glu/sgi/libnurbs/internals/backend.h b/src/glu/sgi/libnurbs/internals/backend.h index c1f00b1a01..6840cb19e9 100644 --- a/src/glu/sgi/libnurbs/internals/backend.h +++ b/src/glu/sgi/libnurbs/internals/backend.h @@ -1,42 +1,36 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* * backend.h * - * $Date: 2001/03/17 00:25:40 $ $Revision: 1.1 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/backend.h,v 1.1 2001/03/17 00:25:40 brianp Exp $ */ #ifndef __glubackend_h_ @@ -65,7 +59,7 @@ public: void surfbbox( long, REAL *, REAL * ); void surfgrid( REAL, REAL, long, REAL, REAL, long ); void surfmesh( long, long, long, long ); - void bgntmesh( char * ); + void bgntmesh( const char * ); void endtmesh( void ); void swaptmesh( void ); void tmeshvert( GridTrimVertex * ); diff --git a/src/glu/sgi/libnurbs/internals/basiccrveval.h b/src/glu/sgi/libnurbs/internals/basiccrveval.h index 0a5f66c201..277dc8dc96 100644 --- a/src/glu/sgi/libnurbs/internals/basiccrveval.h +++ b/src/glu/sgi/libnurbs/internals/basiccrveval.h @@ -1,42 +1,36 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* * basiccurveeval.h * - * $Date: 2006/03/29 18:54:00 $ $Revision: 1.2 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/basiccrveval.h,v 1.2 2006/03/29 18:54:00 brianp Exp $ */ #ifndef __glubasiccrveval_h_ diff --git a/src/glu/sgi/libnurbs/internals/basicsurfeval.h b/src/glu/sgi/libnurbs/internals/basicsurfeval.h index a67ded97b5..8fe18a67fb 100644 --- a/src/glu/sgi/libnurbs/internals/basicsurfeval.h +++ b/src/glu/sgi/libnurbs/internals/basicsurfeval.h @@ -1,42 +1,36 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* * basicsurfeval.h * - * $Date: 2006/03/29 18:54:00 $ $Revision: 1.2 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/basicsurfeval.h,v 1.2 2006/03/29 18:54:00 brianp Exp $ */ #ifndef __glubasicsurfeval_h_ diff --git a/src/glu/sgi/libnurbs/internals/bezierarc.h b/src/glu/sgi/libnurbs/internals/bezierarc.h index 64dd31d87d..4acfb09488 100644 --- a/src/glu/sgi/libnurbs/internals/bezierarc.h +++ b/src/glu/sgi/libnurbs/internals/bezierarc.h @@ -1,42 +1,36 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* * bezierarc.h * - * $Date: 2001/03/17 00:25:40 $ $Revision: 1.1 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/bezierarc.h,v 1.1 2001/03/17 00:25:40 brianp Exp $ */ #ifndef __glubezierarc_h diff --git a/src/glu/sgi/libnurbs/internals/bin.cc b/src/glu/sgi/libnurbs/internals/bin.cc index ed427567f9..54b406147b 100644 --- a/src/glu/sgi/libnurbs/internals/bin.cc +++ b/src/glu/sgi/libnurbs/internals/bin.cc @@ -35,8 +35,6 @@ /* * bin.c++ * - * $Date: 2006/03/14 15:08:52 $ $Revision: 1.3 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/bin.cc,v 1.3 2006/03/14 15:08:52 brianp Exp $ */ #include "glimports.h" diff --git a/src/glu/sgi/libnurbs/internals/bin.h b/src/glu/sgi/libnurbs/internals/bin.h index 17d146fdf1..2f976eb9bd 100644 --- a/src/glu/sgi/libnurbs/internals/bin.h +++ b/src/glu/sgi/libnurbs/internals/bin.h @@ -1,42 +1,36 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* * bin.h * - * $Date: 2001/03/17 00:25:40 $ $Revision: 1.1 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/bin.h,v 1.1 2001/03/17 00:25:40 brianp Exp $ */ #ifndef __glubin_h_ diff --git a/src/glu/sgi/libnurbs/internals/bufpool.cc b/src/glu/sgi/libnurbs/internals/bufpool.cc index d8d9c23db3..8cc847ab22 100644 --- a/src/glu/sgi/libnurbs/internals/bufpool.cc +++ b/src/glu/sgi/libnurbs/internals/bufpool.cc @@ -35,8 +35,6 @@ /* * bufpool.c++ * - * $Date: 2004/05/12 15:29:36 $ $Revision: 1.2 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/bufpool.cc,v 1.2 2004/05/12 15:29:36 brianp Exp $ */ #include "glimports.h" @@ -48,7 +46,7 @@ * Pool - allocate a new pool of buffers *----------------------------------------------------------------------------- */ -Pool::Pool( int _buffersize, int initpoolsize, char *n ) +Pool::Pool( int _buffersize, int initpoolsize, const char *n ) { if((unsigned)_buffersize < sizeof(Buffer)) buffersize = sizeof(Buffer); diff --git a/src/glu/sgi/libnurbs/internals/bufpool.h b/src/glu/sgi/libnurbs/internals/bufpool.h index 02e4ff247b..0fa9433750 100644 --- a/src/glu/sgi/libnurbs/internals/bufpool.h +++ b/src/glu/sgi/libnurbs/internals/bufpool.h @@ -1,42 +1,36 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* * bufpool.h * - * $Date: 2006/03/29 18:46:46 $ $Revision: 1.3 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/bufpool.h,v 1.3 2006/03/29 18:46:46 brianp Exp $ */ #ifndef __glubufpool_h_ @@ -55,7 +49,7 @@ class Buffer { class Pool { public: - Pool( int, int, char * ); + Pool( int, int, const char * ); ~Pool( void ); inline void* new_buffer( void ); inline void free_buffer( void * ); @@ -74,7 +68,7 @@ protected: int nextfree; /* byte offset past next free buffer */ int initsize; enum Magic { is_allocated = 0xf3a1, is_free = 0xf1a2 }; - char *name; /* name of the pool */ + const char *name; /* name of the pool */ Magic magic; /* marker for valid pool */ }; diff --git a/src/glu/sgi/libnurbs/internals/cachingeval.cc b/src/glu/sgi/libnurbs/internals/cachingeval.cc index 7245ee3a18..3fab38c106 100644 --- a/src/glu/sgi/libnurbs/internals/cachingeval.cc +++ b/src/glu/sgi/libnurbs/internals/cachingeval.cc @@ -35,8 +35,6 @@ /* * cachingeval.c++ * - * $Date: 2001/03/17 00:25:40 $ $Revision: 1.1 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/cachingeval.cc,v 1.1 2001/03/17 00:25:40 brianp Exp $ */ #include "cachingeval.h" diff --git a/src/glu/sgi/libnurbs/internals/cachingeval.h b/src/glu/sgi/libnurbs/internals/cachingeval.h index 578391707a..b390067a28 100644 --- a/src/glu/sgi/libnurbs/internals/cachingeval.h +++ b/src/glu/sgi/libnurbs/internals/cachingeval.h @@ -1,42 +1,36 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* * cachingeval.h * - * $Date: 2006/03/29 18:54:00 $ $Revision: 1.2 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/cachingeval.h,v 1.2 2006/03/29 18:54:00 brianp Exp $ */ #ifndef __glucachingval_h_ diff --git a/src/glu/sgi/libnurbs/internals/ccw.cc b/src/glu/sgi/libnurbs/internals/ccw.cc index b1bb6276f7..eb01b7781a 100644 --- a/src/glu/sgi/libnurbs/internals/ccw.cc +++ b/src/glu/sgi/libnurbs/internals/ccw.cc @@ -35,8 +35,6 @@ /* * ccw.c++ * - * $Date: 2006/03/14 15:08:52 $ $Revision: 1.3 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/ccw.cc,v 1.3 2006/03/14 15:08:52 brianp Exp $ */ #include "glimports.h" diff --git a/src/glu/sgi/libnurbs/internals/coveandtiler.h b/src/glu/sgi/libnurbs/internals/coveandtiler.h index 4f4077e208..d454202e6d 100644 --- a/src/glu/sgi/libnurbs/internals/coveandtiler.h +++ b/src/glu/sgi/libnurbs/internals/coveandtiler.h @@ -1,42 +1,36 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* * coveandtiler.h * - * $Date: 2001/07/16 15:46:42 $ $Revision: 1.2 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/coveandtiler.h,v 1.2 2001/07/16 15:46:42 brianp Exp $ */ #ifndef __glucoveandtiler_h diff --git a/src/glu/sgi/libnurbs/internals/curve.cc b/src/glu/sgi/libnurbs/internals/curve.cc index 5517afa2db..33e2752643 100644 --- a/src/glu/sgi/libnurbs/internals/curve.cc +++ b/src/glu/sgi/libnurbs/internals/curve.cc @@ -35,8 +35,6 @@ /* * curve.c++ * - * $Date: 2004/05/12 15:29:36 $ $Revision: 1.3 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/curve.cc,v 1.3 2004/05/12 15:29:36 brianp Exp $ */ #include "glimports.h" diff --git a/src/glu/sgi/libnurbs/internals/curve.h b/src/glu/sgi/libnurbs/internals/curve.h index 7b7bd3dc89..0da81c7216 100644 --- a/src/glu/sgi/libnurbs/internals/curve.h +++ b/src/glu/sgi/libnurbs/internals/curve.h @@ -1,42 +1,36 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* * curve.h * - * $Date: 2001/03/17 00:25:40 $ $Revision: 1.1 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/curve.h,v 1.1 2001/03/17 00:25:40 brianp Exp $ */ #ifndef __glucurve_h_ diff --git a/src/glu/sgi/libnurbs/internals/curvelist.cc b/src/glu/sgi/libnurbs/internals/curvelist.cc index e763c62945..872eb5816d 100644 --- a/src/glu/sgi/libnurbs/internals/curvelist.cc +++ b/src/glu/sgi/libnurbs/internals/curvelist.cc @@ -35,8 +35,6 @@ /* * curvelist.c++ * - * $Date: 2001/03/17 00:25:40 $ $Revision: 1.1 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/curvelist.cc,v 1.1 2001/03/17 00:25:40 brianp Exp $ */ #include "glimports.h" diff --git a/src/glu/sgi/libnurbs/internals/curvelist.h b/src/glu/sgi/libnurbs/internals/curvelist.h index d285fb5b98..733a5115d0 100644 --- a/src/glu/sgi/libnurbs/internals/curvelist.h +++ b/src/glu/sgi/libnurbs/internals/curvelist.h @@ -1,42 +1,36 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* * curvelist.h * - * $Date: 2001/03/17 00:25:40 $ $Revision: 1.1 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/curvelist.h,v 1.1 2001/03/17 00:25:40 brianp Exp $ */ #ifndef __glucurvelist_h_ diff --git a/src/glu/sgi/libnurbs/internals/curvesub.cc b/src/glu/sgi/libnurbs/internals/curvesub.cc index 11b15e4174..f85acc269a 100644 --- a/src/glu/sgi/libnurbs/internals/curvesub.cc +++ b/src/glu/sgi/libnurbs/internals/curvesub.cc @@ -35,8 +35,6 @@ /* * curvesub.c++ * - * $Date: 2001/03/17 00:25:40 $ $Revision: 1.1 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/curvesub.cc,v 1.1 2001/03/17 00:25:40 brianp Exp $ */ #include "glimports.h" diff --git a/src/glu/sgi/libnurbs/internals/dataTransform.cc b/src/glu/sgi/libnurbs/internals/dataTransform.cc index 822da02228..55c0fbb159 100644 --- a/src/glu/sgi/libnurbs/internals/dataTransform.cc +++ b/src/glu/sgi/libnurbs/internals/dataTransform.cc @@ -31,10 +31,8 @@ ** published by SGI, but has not been independently verified as being ** compliant with the OpenGL(R) version 1.2.1 Specification. ** -** $Date: 2005/10/28 13:09:23 $ $Revision: 1.2 $ */ /* -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/dataTransform.cc,v 1.2 2005/10/28 13:09:23 brianp Exp $ */ #include <stdlib.h> diff --git a/src/glu/sgi/libnurbs/internals/dataTransform.h b/src/glu/sgi/libnurbs/internals/dataTransform.h index 1032896f13..7898df754d 100644 --- a/src/glu/sgi/libnurbs/internals/dataTransform.h +++ b/src/glu/sgi/libnurbs/internals/dataTransform.h @@ -1,40 +1,33 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -** $Date: 2001/03/17 00:25:40 $ $Revision: 1.1 $ -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/dataTransform.h,v 1.1 2001/03/17 00:25:40 brianp Exp $ */ #ifndef _DATA_TRANSFORM_H diff --git a/src/glu/sgi/libnurbs/internals/defines.h b/src/glu/sgi/libnurbs/internals/defines.h index 77b6088acc..32950d613b 100644 --- a/src/glu/sgi/libnurbs/internals/defines.h +++ b/src/glu/sgi/libnurbs/internals/defines.h @@ -1,42 +1,36 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* * defines.h * - * $Date: 2001/03/17 00:25:40 $ $Revision: 1.1 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/defines.h,v 1.1 2001/03/17 00:25:40 brianp Exp $ */ #ifndef __gludefines_h_ diff --git a/src/glu/sgi/libnurbs/internals/displaylist.cc b/src/glu/sgi/libnurbs/internals/displaylist.cc index 4b39a8991d..48593c6371 100644 --- a/src/glu/sgi/libnurbs/internals/displaylist.cc +++ b/src/glu/sgi/libnurbs/internals/displaylist.cc @@ -35,8 +35,6 @@ /* * displaylist.c++ * - * $Date: 2001/03/17 00:25:40 $ $Revision: 1.1 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/displaylist.cc,v 1.1 2001/03/17 00:25:40 brianp Exp $ */ #include "glimports.h" diff --git a/src/glu/sgi/libnurbs/internals/displaylist.h b/src/glu/sgi/libnurbs/internals/displaylist.h index 13cadaeae8..22cbec3787 100644 --- a/src/glu/sgi/libnurbs/internals/displaylist.h +++ b/src/glu/sgi/libnurbs/internals/displaylist.h @@ -1,42 +1,36 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* * displaylist.h * - * $Date: 2001/03/17 00:25:40 $ $Revision: 1.1 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/displaylist.h,v 1.1 2001/03/17 00:25:40 brianp Exp $ */ #ifndef __gludisplaylist_h_ diff --git a/src/glu/sgi/libnurbs/internals/displaymode.h b/src/glu/sgi/libnurbs/internals/displaymode.h index 791434e6d2..53968b2f1c 100644 --- a/src/glu/sgi/libnurbs/internals/displaymode.h +++ b/src/glu/sgi/libnurbs/internals/displaymode.h @@ -1,40 +1,33 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -** $Date: 2001/03/17 00:25:40 $ $Revision: 1.1 $ -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/displaymode.h,v 1.1 2001/03/17 00:25:40 brianp Exp $ */ #ifndef __gludisplaymode_h_ diff --git a/src/glu/sgi/libnurbs/internals/flist.cc b/src/glu/sgi/libnurbs/internals/flist.cc index 21414fd736..d3162b9f5f 100644 --- a/src/glu/sgi/libnurbs/internals/flist.cc +++ b/src/glu/sgi/libnurbs/internals/flist.cc @@ -35,8 +35,6 @@ /* * flist.c++ * - * $Date: 2001/03/17 00:25:40 $ $Revision: 1.1 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/flist.cc,v 1.1 2001/03/17 00:25:40 brianp Exp $ */ #include "glimports.h" diff --git a/src/glu/sgi/libnurbs/internals/flist.h b/src/glu/sgi/libnurbs/internals/flist.h index 8450caad45..014273ebe5 100644 --- a/src/glu/sgi/libnurbs/internals/flist.h +++ b/src/glu/sgi/libnurbs/internals/flist.h @@ -1,42 +1,36 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* * flist.h * - * $Date: 2001/03/17 00:25:40 $ $Revision: 1.1 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/flist.h,v 1.1 2001/03/17 00:25:40 brianp Exp $ */ #ifndef __gluflist_h_ diff --git a/src/glu/sgi/libnurbs/internals/flistsorter.cc b/src/glu/sgi/libnurbs/internals/flistsorter.cc index 730613224c..d49bdea3e0 100644 --- a/src/glu/sgi/libnurbs/internals/flistsorter.cc +++ b/src/glu/sgi/libnurbs/internals/flistsorter.cc @@ -35,8 +35,6 @@ /* * flistsorter.c++ * - * $Date: 2001/03/17 00:25:40 $ $Revision: 1.1 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/flistsorter.cc,v 1.1 2001/03/17 00:25:40 brianp Exp $ */ #include "glimports.h" diff --git a/src/glu/sgi/libnurbs/internals/flistsorter.h b/src/glu/sgi/libnurbs/internals/flistsorter.h index 753ed255b5..65e6a572e3 100644 --- a/src/glu/sgi/libnurbs/internals/flistsorter.h +++ b/src/glu/sgi/libnurbs/internals/flistsorter.h @@ -1,42 +1,36 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* * flistsorter.h * - * $Date: 2006/03/29 18:54:00 $ $Revision: 1.2 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/flistsorter.h,v 1.2 2006/03/29 18:54:00 brianp Exp $ */ #ifndef __gluflistsorter_h_ diff --git a/src/glu/sgi/libnurbs/internals/gridline.h b/src/glu/sgi/libnurbs/internals/gridline.h index 32b70bbb29..1a92e3b13b 100644 --- a/src/glu/sgi/libnurbs/internals/gridline.h +++ b/src/glu/sgi/libnurbs/internals/gridline.h @@ -1,42 +1,36 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* * gridline.h * - * $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/gridline.h,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ #ifndef __glugridline_h_ diff --git a/src/glu/sgi/libnurbs/internals/gridtrimvertex.h b/src/glu/sgi/libnurbs/internals/gridtrimvertex.h index 70a7029c54..707f649d20 100644 --- a/src/glu/sgi/libnurbs/internals/gridtrimvertex.h +++ b/src/glu/sgi/libnurbs/internals/gridtrimvertex.h @@ -1,42 +1,36 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* * gridtrimvertex.h * - * $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/gridtrimvertex.h,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ #ifndef __glugridtrimvertex_h_ diff --git a/src/glu/sgi/libnurbs/internals/gridvertex.h b/src/glu/sgi/libnurbs/internals/gridvertex.h index 2eac57386a..36a65c7bdd 100644 --- a/src/glu/sgi/libnurbs/internals/gridvertex.h +++ b/src/glu/sgi/libnurbs/internals/gridvertex.h @@ -1,42 +1,36 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* * gridvertex.h * - * $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/gridvertex.h,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ #ifndef __glugridvertex_h_ diff --git a/src/glu/sgi/libnurbs/internals/hull.cc b/src/glu/sgi/libnurbs/internals/hull.cc index 75f7c160d6..389ba66fb8 100644 --- a/src/glu/sgi/libnurbs/internals/hull.cc +++ b/src/glu/sgi/libnurbs/internals/hull.cc @@ -35,8 +35,6 @@ /* * hull.c++ * - * $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/hull.cc,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ #include "glimports.h" diff --git a/src/glu/sgi/libnurbs/internals/hull.h b/src/glu/sgi/libnurbs/internals/hull.h index 34f1593a3e..dfe865267f 100644 --- a/src/glu/sgi/libnurbs/internals/hull.h +++ b/src/glu/sgi/libnurbs/internals/hull.h @@ -1,42 +1,36 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* * hull.h * - * $Date: 2001/08/07 17:34:11 $ $Revision: 1.2 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/hull.h,v 1.2 2001/08/07 17:34:11 brianp Exp $ */ #ifndef __gluhull_h_ diff --git a/src/glu/sgi/libnurbs/internals/intersect.cc b/src/glu/sgi/libnurbs/internals/intersect.cc index 6fb7e3239b..b39ea2121e 100644 --- a/src/glu/sgi/libnurbs/internals/intersect.cc +++ b/src/glu/sgi/libnurbs/internals/intersect.cc @@ -35,8 +35,6 @@ /* * intersect.c++ * - * $Date: 2005/10/28 13:09:23 $ $Revision: 1.3 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/intersect.cc,v 1.3 2005/10/28 13:09:23 brianp Exp $ */ #include "glimports.h" diff --git a/src/glu/sgi/libnurbs/internals/jarcloc.h b/src/glu/sgi/libnurbs/internals/jarcloc.h index 785234f6c0..5297036fa5 100644 --- a/src/glu/sgi/libnurbs/internals/jarcloc.h +++ b/src/glu/sgi/libnurbs/internals/jarcloc.h @@ -1,42 +1,36 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* * jarcloc.h * - * $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/jarcloc.h,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ #ifndef __glujarcloc_h_ diff --git a/src/glu/sgi/libnurbs/internals/knotvector.cc b/src/glu/sgi/libnurbs/internals/knotvector.cc index 610046674c..9eb5cbace9 100644 --- a/src/glu/sgi/libnurbs/internals/knotvector.cc +++ b/src/glu/sgi/libnurbs/internals/knotvector.cc @@ -126,7 +126,7 @@ int Knotvector::validate( void ) return 0; } -void Knotvector::show( char *msg ) +void Knotvector::show( const char *msg ) { #ifndef NDEBUG _glu_dprintf( "%s\n", msg ); diff --git a/src/glu/sgi/libnurbs/internals/knotvector.h b/src/glu/sgi/libnurbs/internals/knotvector.h index bb1e593326..85b162f6f1 100644 --- a/src/glu/sgi/libnurbs/internals/knotvector.h +++ b/src/glu/sgi/libnurbs/internals/knotvector.h @@ -1,42 +1,36 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* * knotvector.h * - * $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/knotvector.h,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ #ifndef __gluknotvector_h_ @@ -49,7 +43,7 @@ struct Knotvector { /* a knot vector */ ~Knotvector( void ); void init( long, long, long, INREAL * ); int validate( void ); - void show( char * ); + void show( const char * ); long order; /* order of spline */ long knotcount; /* number of knots */ diff --git a/src/glu/sgi/libnurbs/internals/mapdesc.cc b/src/glu/sgi/libnurbs/internals/mapdesc.cc index 14d01582b0..d59f8fd395 100644 --- a/src/glu/sgi/libnurbs/internals/mapdesc.cc +++ b/src/glu/sgi/libnurbs/internals/mapdesc.cc @@ -35,8 +35,6 @@ /* * mapdesc.c++ * - * $Date: 2001/11/29 16:16:55 $ $Revision: 1.2 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/mapdesc.cc,v 1.2 2001/11/29 16:16:55 kschultz Exp $ */ #include <stdio.h> diff --git a/src/glu/sgi/libnurbs/internals/mapdesc.h b/src/glu/sgi/libnurbs/internals/mapdesc.h index 3c4ef6ff6c..6f06154f92 100644 --- a/src/glu/sgi/libnurbs/internals/mapdesc.h +++ b/src/glu/sgi/libnurbs/internals/mapdesc.h @@ -1,42 +1,36 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* * mapdesc.h * - * $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/mapdesc.h,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ #ifndef __glumapdesc_h_ diff --git a/src/glu/sgi/libnurbs/internals/mapdescv.cc b/src/glu/sgi/libnurbs/internals/mapdescv.cc index 6e4bb40c90..35b38b141b 100644 --- a/src/glu/sgi/libnurbs/internals/mapdescv.cc +++ b/src/glu/sgi/libnurbs/internals/mapdescv.cc @@ -35,8 +35,6 @@ /* * mapdescv.c++ * - * $Date: 2004/05/12 15:29:36 $ $Revision: 1.3 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/mapdescv.cc,v 1.3 2004/05/12 15:29:36 brianp Exp $ */ #include "glimports.h" diff --git a/src/glu/sgi/libnurbs/internals/maplist.cc b/src/glu/sgi/libnurbs/internals/maplist.cc index 44f8666b7a..f944d1529e 100644 --- a/src/glu/sgi/libnurbs/internals/maplist.cc +++ b/src/glu/sgi/libnurbs/internals/maplist.cc @@ -35,8 +35,6 @@ /* * maplist.c++ * - * $Date: 2005/10/28 13:09:23 $ $Revision: 1.2 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/maplist.cc,v 1.2 2005/10/28 13:09:23 brianp Exp $ */ #include "glimports.h" diff --git a/src/glu/sgi/libnurbs/internals/maplist.h b/src/glu/sgi/libnurbs/internals/maplist.h index ca92def8ca..49720e49b4 100644 --- a/src/glu/sgi/libnurbs/internals/maplist.h +++ b/src/glu/sgi/libnurbs/internals/maplist.h @@ -1,42 +1,36 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* * maplist.h * - * $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/maplist.h,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ #ifndef __glumaplist_h_ diff --git a/src/glu/sgi/libnurbs/internals/mesher.cc b/src/glu/sgi/libnurbs/internals/mesher.cc index 1178eeb516..9cc436adbf 100644 --- a/src/glu/sgi/libnurbs/internals/mesher.cc +++ b/src/glu/sgi/libnurbs/internals/mesher.cc @@ -35,8 +35,6 @@ /* * mesher.c++ * - * $Date: 2001/11/29 16:16:55 $ $Revision: 1.3 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/mesher.cc,v 1.3 2001/11/29 16:16:55 kschultz Exp $ */ #include "glimports.h" diff --git a/src/glu/sgi/libnurbs/internals/mesher.h b/src/glu/sgi/libnurbs/internals/mesher.h index e4cb4466bc..bb65d0f1c7 100644 --- a/src/glu/sgi/libnurbs/internals/mesher.h +++ b/src/glu/sgi/libnurbs/internals/mesher.h @@ -1,42 +1,36 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* * mesher.h * - * $Date: 2001/08/07 17:34:11 $ $Revision: 1.2 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/mesher.h,v 1.2 2001/08/07 17:34:11 brianp Exp $ */ #ifndef __glumesher_h_ diff --git a/src/glu/sgi/libnurbs/internals/monoTriangulationBackend.cc b/src/glu/sgi/libnurbs/internals/monoTriangulationBackend.cc index b08cd91570..2830cc743c 100644 --- a/src/glu/sgi/libnurbs/internals/monoTriangulationBackend.cc +++ b/src/glu/sgi/libnurbs/internals/monoTriangulationBackend.cc @@ -31,10 +31,8 @@ ** published by SGI, but has not been independently verified as being ** compliant with the OpenGL(R) version 1.2.1 Specification. ** -** $Date: 2005/10/28 13:09:23 $ $Revision: 1.3 $ */ /* -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/monoTriangulationBackend.cc,v 1.3 2005/10/28 13:09:23 brianp Exp $ */ #include "monoTriangulation.h" diff --git a/src/glu/sgi/libnurbs/internals/monotonizer.cc b/src/glu/sgi/libnurbs/internals/monotonizer.cc index 7b6685dd06..5845d310ba 100644 --- a/src/glu/sgi/libnurbs/internals/monotonizer.cc +++ b/src/glu/sgi/libnurbs/internals/monotonizer.cc @@ -35,8 +35,6 @@ /* * monotonizer.c++ * - * $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/monotonizer.cc,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ #include "glimports.h" diff --git a/src/glu/sgi/libnurbs/internals/monotonizer.h b/src/glu/sgi/libnurbs/internals/monotonizer.h index f516207cb5..e951084ff0 100644 --- a/src/glu/sgi/libnurbs/internals/monotonizer.h +++ b/src/glu/sgi/libnurbs/internals/monotonizer.h @@ -1,41 +1,36 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* * monotonizer.h * - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/monotonizer.h,v 1.2 2006/04/03 22:23:52 ajax Exp $ */ #ifndef __glumonotonizer_h_ diff --git a/src/glu/sgi/libnurbs/internals/myassert.h b/src/glu/sgi/libnurbs/internals/myassert.h index e222c7e43e..cbd6006f55 100644 --- a/src/glu/sgi/libnurbs/internals/myassert.h +++ b/src/glu/sgi/libnurbs/internals/myassert.h @@ -1,42 +1,36 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* * myassert.h * - * $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/myassert.h,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ #ifndef __glumyassert_h_ diff --git a/src/glu/sgi/libnurbs/internals/mycode.cc b/src/glu/sgi/libnurbs/internals/mycode.cc index c49f64fa21..3625cacd74 100644 --- a/src/glu/sgi/libnurbs/internals/mycode.cc +++ b/src/glu/sgi/libnurbs/internals/mycode.cc @@ -31,10 +31,8 @@ ** published by SGI, but has not been independently verified as being ** compliant with the OpenGL(R) version 1.2.1 Specification. ** -** $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ */ /* -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/mycode.cc,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ #include "mymath.h" diff --git a/src/glu/sgi/libnurbs/internals/mymath.h b/src/glu/sgi/libnurbs/internals/mymath.h index 73078251dd..17ef7237fe 100644 --- a/src/glu/sgi/libnurbs/internals/mymath.h +++ b/src/glu/sgi/libnurbs/internals/mymath.h @@ -1,36 +1,32 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* * mymath.h diff --git a/src/glu/sgi/libnurbs/internals/mysetjmp.h b/src/glu/sgi/libnurbs/internals/mysetjmp.h index bfb9cea98b..2a3f6a87b3 100644 --- a/src/glu/sgi/libnurbs/internals/mysetjmp.h +++ b/src/glu/sgi/libnurbs/internals/mysetjmp.h @@ -1,36 +1,32 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* * mysetjmp.h diff --git a/src/glu/sgi/libnurbs/internals/mystring.h b/src/glu/sgi/libnurbs/internals/mystring.h index 8b9032bf23..d2952da894 100644 --- a/src/glu/sgi/libnurbs/internals/mystring.h +++ b/src/glu/sgi/libnurbs/internals/mystring.h @@ -1,42 +1,36 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* * mystring.h * - * $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/mystring.h,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ #ifndef __glumystring_h_ diff --git a/src/glu/sgi/libnurbs/internals/nurbsconsts.h b/src/glu/sgi/libnurbs/internals/nurbsconsts.h index 7b9dcc39cd..acc5d7f31f 100644 --- a/src/glu/sgi/libnurbs/internals/nurbsconsts.h +++ b/src/glu/sgi/libnurbs/internals/nurbsconsts.h @@ -1,42 +1,36 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* * nurbsconsts.h * - * $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/nurbsconsts.h,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ #ifndef __glunurbsconsts_h_ diff --git a/src/glu/sgi/libnurbs/internals/nurbstess.cc b/src/glu/sgi/libnurbs/internals/nurbstess.cc index adf7c74626..68dfd95f39 100644 --- a/src/glu/sgi/libnurbs/internals/nurbstess.cc +++ b/src/glu/sgi/libnurbs/internals/nurbstess.cc @@ -35,8 +35,6 @@ /* * nurbstess.c++ * - * $Date: 2006/03/14 15:08:52 $ $Revision: 1.2 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/nurbstess.cc,v 1.2 2006/03/14 15:08:52 brianp Exp $ */ #include "glimports.h" @@ -677,7 +675,7 @@ NurbsTessellator::do_nurbserror( int msg ) } int -NurbsTessellator::do_check_knots( Knotvector *knots, char *msg ) +NurbsTessellator::do_check_knots( Knotvector *knots, const char *msg ) { int status = knots->validate(); if( status ) { diff --git a/src/glu/sgi/libnurbs/internals/nurbstess.h b/src/glu/sgi/libnurbs/internals/nurbstess.h index 3577088a9c..a6869002fb 100644 --- a/src/glu/sgi/libnurbs/internals/nurbstess.h +++ b/src/glu/sgi/libnurbs/internals/nurbstess.h @@ -1,36 +1,32 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* * nurbstess.h @@ -112,7 +108,7 @@ protected: private: void resetObjects( void ); - int do_check_knots( Knotvector *, char * ); + int do_check_knots( Knotvector *, const char * ); void do_nurbserror( int ); void do_bgncurve( O_curve * ); void do_endcurve( void ); diff --git a/src/glu/sgi/libnurbs/internals/patch.cc b/src/glu/sgi/libnurbs/internals/patch.cc index 4a524f1de2..808baa69e4 100644 --- a/src/glu/sgi/libnurbs/internals/patch.cc +++ b/src/glu/sgi/libnurbs/internals/patch.cc @@ -35,8 +35,6 @@ /* * patch.c++ * - * $Date: 2006/03/14 15:08:52 $ $Revision: 1.4 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/patch.cc,v 1.4 2006/03/14 15:08:52 brianp Exp $ */ #include <stdio.h> diff --git a/src/glu/sgi/libnurbs/internals/patch.h b/src/glu/sgi/libnurbs/internals/patch.h index a214b571f9..324a25938b 100644 --- a/src/glu/sgi/libnurbs/internals/patch.h +++ b/src/glu/sgi/libnurbs/internals/patch.h @@ -1,42 +1,36 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* * patch.h * - * $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/patch.h,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ #ifndef __glupatch_h_ diff --git a/src/glu/sgi/libnurbs/internals/patchlist.cc b/src/glu/sgi/libnurbs/internals/patchlist.cc index a640893f1b..989d2dd00a 100644 --- a/src/glu/sgi/libnurbs/internals/patchlist.cc +++ b/src/glu/sgi/libnurbs/internals/patchlist.cc @@ -35,8 +35,6 @@ /* * patchlist.c++ * - * $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/patchlist.cc,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ #include <stdio.h> diff --git a/src/glu/sgi/libnurbs/internals/patchlist.h b/src/glu/sgi/libnurbs/internals/patchlist.h index 9fb3795c09..9bfc5b47a2 100644 --- a/src/glu/sgi/libnurbs/internals/patchlist.h +++ b/src/glu/sgi/libnurbs/internals/patchlist.h @@ -1,42 +1,36 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* * patchlist.h * - * $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/patchlist.h,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ #ifndef __glupatchlist_h_ diff --git a/src/glu/sgi/libnurbs/internals/pwlarc.h b/src/glu/sgi/libnurbs/internals/pwlarc.h index 83b7c3f813..2e5175a6f3 100644 --- a/src/glu/sgi/libnurbs/internals/pwlarc.h +++ b/src/glu/sgi/libnurbs/internals/pwlarc.h @@ -1,42 +1,36 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* * pwlarc.h * - * $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/pwlarc.h,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ #ifndef __glupwlarc_h_ diff --git a/src/glu/sgi/libnurbs/internals/quilt.cc b/src/glu/sgi/libnurbs/internals/quilt.cc index f693b370ba..4fc58b7473 100644 --- a/src/glu/sgi/libnurbs/internals/quilt.cc +++ b/src/glu/sgi/libnurbs/internals/quilt.cc @@ -35,8 +35,6 @@ /* * quilt.c++ * - * $Date: 2006/03/14 15:08:52 $ $Revision: 1.3 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/quilt.cc,v 1.3 2006/03/14 15:08:52 brianp Exp $ */ #include "glimports.h" diff --git a/src/glu/sgi/libnurbs/internals/quilt.h b/src/glu/sgi/libnurbs/internals/quilt.h index 336c2574d2..fe1e3309ea 100644 --- a/src/glu/sgi/libnurbs/internals/quilt.h +++ b/src/glu/sgi/libnurbs/internals/quilt.h @@ -1,42 +1,36 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* * quilt.h * - * $Date: 2001/08/07 17:34:11 $ $Revision: 1.2 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/quilt.h,v 1.2 2001/08/07 17:34:11 brianp Exp $ */ #ifndef __gluquilt_h_ diff --git a/src/glu/sgi/libnurbs/internals/reader.cc b/src/glu/sgi/libnurbs/internals/reader.cc index 271a32fbc1..6135eef60e 100644 --- a/src/glu/sgi/libnurbs/internals/reader.cc +++ b/src/glu/sgi/libnurbs/internals/reader.cc @@ -35,8 +35,6 @@ /* * reader.c++ * - * $Date: 2002/11/01 23:35:07 $ $Revision: 1.2 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/reader.cc,v 1.2 2002/11/01 23:35:07 brianp Exp $ */ #include <stdio.h> diff --git a/src/glu/sgi/libnurbs/internals/reader.h b/src/glu/sgi/libnurbs/internals/reader.h index ac86f8a29f..8a8dcebb50 100644 --- a/src/glu/sgi/libnurbs/internals/reader.h +++ b/src/glu/sgi/libnurbs/internals/reader.h @@ -1,42 +1,36 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* * reader.h * - * $Date: 2001/08/07 17:34:11 $ $Revision: 1.2 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/reader.h,v 1.2 2001/08/07 17:34:11 brianp Exp $ */ #ifndef __glureader_h_ diff --git a/src/glu/sgi/libnurbs/internals/renderhints.cc b/src/glu/sgi/libnurbs/internals/renderhints.cc index 6a9d37e013..a3aa62d42c 100644 --- a/src/glu/sgi/libnurbs/internals/renderhints.cc +++ b/src/glu/sgi/libnurbs/internals/renderhints.cc @@ -35,8 +35,6 @@ /* * renderhints.c++ * - * $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/renderhints.cc,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ #include "glimports.h" diff --git a/src/glu/sgi/libnurbs/internals/renderhints.h b/src/glu/sgi/libnurbs/internals/renderhints.h index efa959e3ab..444f649be2 100644 --- a/src/glu/sgi/libnurbs/internals/renderhints.h +++ b/src/glu/sgi/libnurbs/internals/renderhints.h @@ -1,42 +1,36 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* * renderhints.h * - * $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/renderhints.h,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ #ifndef __glurenderhints_h_ diff --git a/src/glu/sgi/libnurbs/internals/simplemath.h b/src/glu/sgi/libnurbs/internals/simplemath.h index f2efee35f1..0a060c57ea 100644 --- a/src/glu/sgi/libnurbs/internals/simplemath.h +++ b/src/glu/sgi/libnurbs/internals/simplemath.h @@ -1,42 +1,36 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* * simplemath.h * - * $Date: 2002/11/01 23:35:07 $ $Revision: 1.2 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/simplemath.h,v 1.2 2002/11/01 23:35:07 brianp Exp $ */ #ifndef __glusimplemath_h_ diff --git a/src/glu/sgi/libnurbs/internals/slicer.cc b/src/glu/sgi/libnurbs/internals/slicer.cc index 3fc7e2723a..27d2a650d1 100644 --- a/src/glu/sgi/libnurbs/internals/slicer.cc +++ b/src/glu/sgi/libnurbs/internals/slicer.cc @@ -35,8 +35,6 @@ /* * slicer.c++ * - * $Date: 2005/10/28 13:09:23 $ $Revision: 1.5 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/slicer.cc,v 1.5 2005/10/28 13:09:23 brianp Exp $ */ #include <stdlib.h> diff --git a/src/glu/sgi/libnurbs/internals/slicer.h b/src/glu/sgi/libnurbs/internals/slicer.h index 6027eaa1c0..e1f5d22ff1 100644 --- a/src/glu/sgi/libnurbs/internals/slicer.h +++ b/src/glu/sgi/libnurbs/internals/slicer.h @@ -1,42 +1,36 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* * slicer.h * - * $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/slicer.h,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ #ifndef __gluslicer_h_ diff --git a/src/glu/sgi/libnurbs/internals/sorter.cc b/src/glu/sgi/libnurbs/internals/sorter.cc index bf13a68d72..7a79941492 100644 --- a/src/glu/sgi/libnurbs/internals/sorter.cc +++ b/src/glu/sgi/libnurbs/internals/sorter.cc @@ -35,8 +35,6 @@ /* * sorter.c++ * - * $Date: 2006/03/14 15:08:52 $ $Revision: 1.3 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/sorter.cc,v 1.3 2006/03/14 15:08:52 brianp Exp $ */ #include "glimports.h" diff --git a/src/glu/sgi/libnurbs/internals/sorter.h b/src/glu/sgi/libnurbs/internals/sorter.h index e9c98affa7..57ea121290 100644 --- a/src/glu/sgi/libnurbs/internals/sorter.h +++ b/src/glu/sgi/libnurbs/internals/sorter.h @@ -1,40 +1,33 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -** $Date: 2006/03/29 18:54:00 $ $Revision: 1.2 $ -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/sorter.h,v 1.2 2006/03/29 18:54:00 brianp Exp $ */ #ifndef __glusorter_h_ diff --git a/src/glu/sgi/libnurbs/internals/splitarcs.cc b/src/glu/sgi/libnurbs/internals/splitarcs.cc index 716f6b9aae..1f79d543fb 100644 --- a/src/glu/sgi/libnurbs/internals/splitarcs.cc +++ b/src/glu/sgi/libnurbs/internals/splitarcs.cc @@ -35,8 +35,6 @@ /* * splitarcs.c++ * - * $Date: 2006/03/14 15:08:52 $ $Revision: 1.2 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/splitarcs.cc,v 1.2 2006/03/14 15:08:52 brianp Exp $ */ #include "glimports.h" diff --git a/src/glu/sgi/libnurbs/internals/subdivider.h b/src/glu/sgi/libnurbs/internals/subdivider.h index 48aff36b44..4d53951818 100644 --- a/src/glu/sgi/libnurbs/internals/subdivider.h +++ b/src/glu/sgi/libnurbs/internals/subdivider.h @@ -1,42 +1,36 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* * subdivider.h * - * $Date: 2001/08/07 17:34:11 $ $Revision: 1.2 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/subdivider.h,v 1.2 2001/08/07 17:34:11 brianp Exp $ */ #ifndef __glusubdivider_h_ diff --git a/src/glu/sgi/libnurbs/internals/tobezier.cc b/src/glu/sgi/libnurbs/internals/tobezier.cc index 95ef3b68b4..531f26bc78 100644 --- a/src/glu/sgi/libnurbs/internals/tobezier.cc +++ b/src/glu/sgi/libnurbs/internals/tobezier.cc @@ -35,8 +35,6 @@ /* * tobezier.c++ * - * $Date: 2006/03/14 15:08:52 $ $Revision: 1.2 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/tobezier.cc,v 1.2 2006/03/14 15:08:52 brianp Exp $ */ #include "glimports.h" diff --git a/src/glu/sgi/libnurbs/internals/trimline.cc b/src/glu/sgi/libnurbs/internals/trimline.cc index 231369b6ef..61f34cd38a 100644 --- a/src/glu/sgi/libnurbs/internals/trimline.cc +++ b/src/glu/sgi/libnurbs/internals/trimline.cc @@ -35,8 +35,6 @@ /* * trimline.c++ * - * $Date: 2005/10/28 13:09:23 $ $Revision: 1.2 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/trimline.cc,v 1.2 2005/10/28 13:09:23 brianp Exp $ */ #include "glimports.h" diff --git a/src/glu/sgi/libnurbs/internals/trimline.h b/src/glu/sgi/libnurbs/internals/trimline.h index d28574d3e5..ecc884284c 100644 --- a/src/glu/sgi/libnurbs/internals/trimline.h +++ b/src/glu/sgi/libnurbs/internals/trimline.h @@ -1,42 +1,36 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* * trimline.h * - * $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/trimline.h,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ #ifndef __glutrimline_h_ diff --git a/src/glu/sgi/libnurbs/internals/trimregion.cc b/src/glu/sgi/libnurbs/internals/trimregion.cc index 64b4ffc10e..efe7893569 100644 --- a/src/glu/sgi/libnurbs/internals/trimregion.cc +++ b/src/glu/sgi/libnurbs/internals/trimregion.cc @@ -35,8 +35,6 @@ /* * trimregion.c++ * - * $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/trimregion.cc,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ #include "glimports.h" diff --git a/src/glu/sgi/libnurbs/internals/trimregion.h b/src/glu/sgi/libnurbs/internals/trimregion.h index 263b8d4719..ee15d7b988 100644 --- a/src/glu/sgi/libnurbs/internals/trimregion.h +++ b/src/glu/sgi/libnurbs/internals/trimregion.h @@ -1,42 +1,36 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* * trimregion.h * - * $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/trimregion.h,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ #ifndef __glutrimregion_h_ diff --git a/src/glu/sgi/libnurbs/internals/trimvertex.h b/src/glu/sgi/libnurbs/internals/trimvertex.h index 8ded26a648..2780b764a5 100644 --- a/src/glu/sgi/libnurbs/internals/trimvertex.h +++ b/src/glu/sgi/libnurbs/internals/trimvertex.h @@ -1,42 +1,36 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* * trimvertex.h * - * $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/trimvertex.h,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ #ifndef __glutrimvertex_h_ diff --git a/src/glu/sgi/libnurbs/internals/trimvertpool.cc b/src/glu/sgi/libnurbs/internals/trimvertpool.cc index 7c12ab3999..3e5bd70380 100644 --- a/src/glu/sgi/libnurbs/internals/trimvertpool.cc +++ b/src/glu/sgi/libnurbs/internals/trimvertpool.cc @@ -35,8 +35,6 @@ /* * trimvertexpool.c++ * - * $Date: 2003/05/08 15:47:00 $ $Revision: 1.2 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/trimvertpool.cc,v 1.2 2003/05/08 15:47:00 brianp Exp $ */ #include "glimports.h" diff --git a/src/glu/sgi/libnurbs/internals/trimvertpool.h b/src/glu/sgi/libnurbs/internals/trimvertpool.h index deb8d4c534..ebd3c04b1f 100644 --- a/src/glu/sgi/libnurbs/internals/trimvertpool.h +++ b/src/glu/sgi/libnurbs/internals/trimvertpool.h @@ -1,42 +1,36 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* * trimvertexpool.h * - * $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/trimvertpool.h,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ #ifndef __glutrimvertpool_h_ diff --git a/src/glu/sgi/libnurbs/internals/types.h b/src/glu/sgi/libnurbs/internals/types.h index d8e7751d0b..8b59625cff 100644 --- a/src/glu/sgi/libnurbs/internals/types.h +++ b/src/glu/sgi/libnurbs/internals/types.h @@ -1,42 +1,36 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* * types.h * - * $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/types.h,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ #ifndef __glutypes_h_ diff --git a/src/glu/sgi/libnurbs/internals/uarray.cc b/src/glu/sgi/libnurbs/internals/uarray.cc index 0cc3c8d273..f0e2364373 100644 --- a/src/glu/sgi/libnurbs/internals/uarray.cc +++ b/src/glu/sgi/libnurbs/internals/uarray.cc @@ -35,8 +35,6 @@ /* * uarray.c++ * - * $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/uarray.cc,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ #include "glimports.h" diff --git a/src/glu/sgi/libnurbs/internals/uarray.h b/src/glu/sgi/libnurbs/internals/uarray.h index e7a7e00d10..cc6fae1b75 100644 --- a/src/glu/sgi/libnurbs/internals/uarray.h +++ b/src/glu/sgi/libnurbs/internals/uarray.h @@ -1,42 +1,36 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* * uarray.h * - * $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/uarray.h,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ #ifndef __gluuarray_h_ diff --git a/src/glu/sgi/libnurbs/internals/varray.cc b/src/glu/sgi/libnurbs/internals/varray.cc index 969bba080e..31cc73a9d0 100644 --- a/src/glu/sgi/libnurbs/internals/varray.cc +++ b/src/glu/sgi/libnurbs/internals/varray.cc @@ -35,8 +35,6 @@ /* * varray.c++ * - * $Date: 2002/11/01 23:35:07 $ $Revision: 1.2 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/varray.cc,v 1.2 2002/11/01 23:35:07 brianp Exp $ */ #include "glimports.h" diff --git a/src/glu/sgi/libnurbs/internals/varray.h b/src/glu/sgi/libnurbs/internals/varray.h index 5fb2541425..b12ff837c8 100644 --- a/src/glu/sgi/libnurbs/internals/varray.h +++ b/src/glu/sgi/libnurbs/internals/varray.h @@ -1,42 +1,36 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* * varray.h * - * $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/varray.h,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ #ifndef __gluvarray_h_ diff --git a/src/glu/sgi/libnurbs/nurbtess/definitions.h b/src/glu/sgi/libnurbs/nurbtess/definitions.h index 216d479b1a..962921da10 100644 --- a/src/glu/sgi/libnurbs/nurbtess/definitions.h +++ b/src/glu/sgi/libnurbs/nurbtess/definitions.h @@ -1,40 +1,33 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -** $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/nurbtess/definitions.h,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ #ifndef _DEFINITIONS_H diff --git a/src/glu/sgi/libnurbs/nurbtess/directedLine.h b/src/glu/sgi/libnurbs/nurbtess/directedLine.h index 009295e61e..4ed0128ca6 100644 --- a/src/glu/sgi/libnurbs/nurbtess/directedLine.h +++ b/src/glu/sgi/libnurbs/nurbtess/directedLine.h @@ -1,40 +1,33 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -** $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/nurbtess/directedLine.h,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ #ifndef _DIRECTEDLINE_H diff --git a/src/glu/sgi/libnurbs/nurbtess/glimports.h b/src/glu/sgi/libnurbs/nurbtess/glimports.h index cb370218c0..6e69feb405 100644 --- a/src/glu/sgi/libnurbs/nurbtess/glimports.h +++ b/src/glu/sgi/libnurbs/nurbtess/glimports.h @@ -1,42 +1,36 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* * glimports.h * - * $Date: 2001/03/19 17:52:03 $ $Revision: 1.3 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/nurbtess/glimports.h,v 1.3 2001/03/19 17:52:03 pesco Exp $ */ #ifndef __gluimports_h_ diff --git a/src/glu/sgi/libnurbs/nurbtess/gridWrap.cc b/src/glu/sgi/libnurbs/nurbtess/gridWrap.cc index 6df10c4385..3c92039bae 100644 --- a/src/glu/sgi/libnurbs/nurbtess/gridWrap.cc +++ b/src/glu/sgi/libnurbs/nurbtess/gridWrap.cc @@ -31,10 +31,8 @@ ** published by SGI, but has not been independently verified as being ** compliant with the OpenGL(R) version 1.2.1 Specification. ** -** $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ */ /* -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/nurbtess/gridWrap.cc,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ #include "gluos.h" diff --git a/src/glu/sgi/libnurbs/nurbtess/gridWrap.h b/src/glu/sgi/libnurbs/nurbtess/gridWrap.h index 1c8237fe27..b6428484f0 100644 --- a/src/glu/sgi/libnurbs/nurbtess/gridWrap.h +++ b/src/glu/sgi/libnurbs/nurbtess/gridWrap.h @@ -1,40 +1,33 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -** $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/nurbtess/gridWrap.h,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ #ifndef _GRIDWRAP_H diff --git a/src/glu/sgi/libnurbs/nurbtess/monoChain.cc b/src/glu/sgi/libnurbs/nurbtess/monoChain.cc index dccbb2bbc0..814bf32fae 100644 --- a/src/glu/sgi/libnurbs/nurbtess/monoChain.cc +++ b/src/glu/sgi/libnurbs/nurbtess/monoChain.cc @@ -31,10 +31,8 @@ ** published by SGI, but has not been independently verified as being ** compliant with the OpenGL(R) version 1.2.1 Specification. ** -** $Date: 2005/10/28 13:09:23 $ $Revision: 1.3 $ */ /* -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/nurbtess/monoChain.cc,v 1.3 2005/10/28 13:09:23 brianp Exp $ */ #include "gluos.h" diff --git a/src/glu/sgi/libnurbs/nurbtess/monoChain.h b/src/glu/sgi/libnurbs/nurbtess/monoChain.h index e25b18028c..999f163190 100644 --- a/src/glu/sgi/libnurbs/nurbtess/monoChain.h +++ b/src/glu/sgi/libnurbs/nurbtess/monoChain.h @@ -1,40 +1,33 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -** $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/nurbtess/monoChain.h,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ #ifndef _MONO_CHAIN_H diff --git a/src/glu/sgi/libnurbs/nurbtess/monoPolyPart.cc b/src/glu/sgi/libnurbs/nurbtess/monoPolyPart.cc index 6405d277fe..8391205bf7 100644 --- a/src/glu/sgi/libnurbs/nurbtess/monoPolyPart.cc +++ b/src/glu/sgi/libnurbs/nurbtess/monoPolyPart.cc @@ -31,7 +31,6 @@ ** published by SGI, but has not been independently verified as being ** compliant with the OpenGL(R) version 1.2.1 Specification. ** -** $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ */ /* *monoPolyPart.C diff --git a/src/glu/sgi/libnurbs/nurbtess/monoPolyPart.h b/src/glu/sgi/libnurbs/nurbtess/monoPolyPart.h index b760862dcb..6877a59c27 100644 --- a/src/glu/sgi/libnurbs/nurbtess/monoPolyPart.h +++ b/src/glu/sgi/libnurbs/nurbtess/monoPolyPart.h @@ -1,38 +1,32 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -** $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* *monoPolyPart.h */ diff --git a/src/glu/sgi/libnurbs/nurbtess/monoTriangulation.cc b/src/glu/sgi/libnurbs/nurbtess/monoTriangulation.cc index d168374c98..8e8d49dda7 100644 --- a/src/glu/sgi/libnurbs/nurbtess/monoTriangulation.cc +++ b/src/glu/sgi/libnurbs/nurbtess/monoTriangulation.cc @@ -31,10 +31,8 @@ ** published by SGI, but has not been independently verified as being ** compliant with the OpenGL(R) version 1.2.1 Specification. ** -** $Date: 2006/03/29 18:46:46 $ $Revision: 1.5 $ */ /* -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/nurbtess/monoTriangulation.cc,v 1.5 2006/03/29 18:46:46 brianp Exp $ */ #include <stdlib.h> diff --git a/src/glu/sgi/libnurbs/nurbtess/monoTriangulation.h b/src/glu/sgi/libnurbs/nurbtess/monoTriangulation.h index 002549ecbd..f78b8f402e 100644 --- a/src/glu/sgi/libnurbs/nurbtess/monoTriangulation.h +++ b/src/glu/sgi/libnurbs/nurbtess/monoTriangulation.h @@ -1,40 +1,33 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -** $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/nurbtess/monoTriangulation.h,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ #ifndef _MONO_TRIANGULATION_H diff --git a/src/glu/sgi/libnurbs/nurbtess/mystdio.h b/src/glu/sgi/libnurbs/nurbtess/mystdio.h index a7594eecd6..a394e0ff95 100644 --- a/src/glu/sgi/libnurbs/nurbtess/mystdio.h +++ b/src/glu/sgi/libnurbs/nurbtess/mystdio.h @@ -1,42 +1,36 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* * mystdio.h * - * $Date: 2006/03/14 15:08:52 $ $Revision: 1.4 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/nurbtess/mystdio.h,v 1.4 2006/03/14 15:08:52 brianp Exp $ */ #ifndef __glumystdio_h_ diff --git a/src/glu/sgi/libnurbs/nurbtess/mystdlib.h b/src/glu/sgi/libnurbs/nurbtess/mystdlib.h index d28e70bd51..ab7a3b273a 100644 --- a/src/glu/sgi/libnurbs/nurbtess/mystdlib.h +++ b/src/glu/sgi/libnurbs/nurbtess/mystdlib.h @@ -1,42 +1,36 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* * mystdlib.h * - * $Date: 2001/03/19 17:52:03 $ $Revision: 1.3 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/nurbtess/mystdlib.h,v 1.3 2001/03/19 17:52:03 pesco Exp $ */ #ifndef __glumystdlib_h_ diff --git a/src/glu/sgi/libnurbs/nurbtess/partitionX.cc b/src/glu/sgi/libnurbs/nurbtess/partitionX.cc index bfe77123c4..e25e30b0f3 100644 --- a/src/glu/sgi/libnurbs/nurbtess/partitionX.cc +++ b/src/glu/sgi/libnurbs/nurbtess/partitionX.cc @@ -31,10 +31,8 @@ ** published by SGI, but has not been independently verified as being ** compliant with the OpenGL(R) version 1.2.1 Specification. ** -** $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ */ /* -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/nurbtess/partitionX.cc,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ #include <stdlib.h> diff --git a/src/glu/sgi/libnurbs/nurbtess/partitionX.h b/src/glu/sgi/libnurbs/nurbtess/partitionX.h index cd18f0eb02..69f2b2df21 100644 --- a/src/glu/sgi/libnurbs/nurbtess/partitionX.h +++ b/src/glu/sgi/libnurbs/nurbtess/partitionX.h @@ -1,40 +1,33 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -** $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/nurbtess/partitionX.h,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ #ifndef _PARTITIONX_H diff --git a/src/glu/sgi/libnurbs/nurbtess/partitionY.cc b/src/glu/sgi/libnurbs/nurbtess/partitionY.cc index 216ac07e06..297c629976 100644 --- a/src/glu/sgi/libnurbs/nurbtess/partitionY.cc +++ b/src/glu/sgi/libnurbs/nurbtess/partitionY.cc @@ -31,10 +31,8 @@ ** published by SGI, but has not been independently verified as being ** compliant with the OpenGL(R) version 1.2.1 Specification. ** -** $Date: 2001/11/29 16:16:55 $ $Revision: 1.2 $ */ /* -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/nurbtess/partitionY.cc,v 1.2 2001/11/29 16:16:55 kschultz Exp $ */ #include <stdlib.h> diff --git a/src/glu/sgi/libnurbs/nurbtess/partitionY.h b/src/glu/sgi/libnurbs/nurbtess/partitionY.h index b810693a5c..8dda409de1 100644 --- a/src/glu/sgi/libnurbs/nurbtess/partitionY.h +++ b/src/glu/sgi/libnurbs/nurbtess/partitionY.h @@ -1,38 +1,32 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -** $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* *partitionY.h: *partition a polygon into a Y-monotone polygon: @@ -53,7 +47,6 @@ *A vertex is an interior cusp if it is a cusp and a reflex. *A vertex is an exterior cusp if it is a cusp but not a reflex. * - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/nurbtess/partitionY.h,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ #ifndef _PARTITIONY_H diff --git a/src/glu/sgi/libnurbs/nurbtess/polyDBG.h b/src/glu/sgi/libnurbs/nurbtess/polyDBG.h index a5125a50d1..74843d8887 100644 --- a/src/glu/sgi/libnurbs/nurbtess/polyDBG.h +++ b/src/glu/sgi/libnurbs/nurbtess/polyDBG.h @@ -1,40 +1,33 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -** $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/nurbtess/polyDBG.h,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ #ifndef _POLYDBG_H diff --git a/src/glu/sgi/libnurbs/nurbtess/polyUtil.cc b/src/glu/sgi/libnurbs/nurbtess/polyUtil.cc index 1a17bcc78a..f9a27f402c 100644 --- a/src/glu/sgi/libnurbs/nurbtess/polyUtil.cc +++ b/src/glu/sgi/libnurbs/nurbtess/polyUtil.cc @@ -31,10 +31,8 @@ ** published by SGI, but has not been independently verified as being ** compliant with the OpenGL(R) version 1.2.1 Specification. ** -** $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ */ /* -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/nurbtess/polyUtil.cc,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ #include <stdlib.h> diff --git a/src/glu/sgi/libnurbs/nurbtess/polyUtil.h b/src/glu/sgi/libnurbs/nurbtess/polyUtil.h index 19c76d37d3..1ca2ebcc07 100644 --- a/src/glu/sgi/libnurbs/nurbtess/polyUtil.h +++ b/src/glu/sgi/libnurbs/nurbtess/polyUtil.h @@ -1,40 +1,33 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -** $Date: 2001/11/29 16:16:55 $ $Revision: 1.2 $ -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/nurbtess/polyUtil.h,v 1.2 2001/11/29 16:16:55 kschultz Exp $ */ #ifndef _POLYUTIL_H diff --git a/src/glu/sgi/libnurbs/nurbtess/primitiveStream.cc b/src/glu/sgi/libnurbs/nurbtess/primitiveStream.cc index 2d54b155ee..26d05342f9 100644 --- a/src/glu/sgi/libnurbs/nurbtess/primitiveStream.cc +++ b/src/glu/sgi/libnurbs/nurbtess/primitiveStream.cc @@ -31,10 +31,8 @@ ** published by SGI, but has not been independently verified as being ** compliant with the OpenGL(R) version 1.2.1 Specification. ** -** $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ */ /* -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/nurbtess/primitiveStream.cc,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ #include "gluos.h" diff --git a/src/glu/sgi/libnurbs/nurbtess/primitiveStream.h b/src/glu/sgi/libnurbs/nurbtess/primitiveStream.h index 438d4ad6b0..b4174f1466 100644 --- a/src/glu/sgi/libnurbs/nurbtess/primitiveStream.h +++ b/src/glu/sgi/libnurbs/nurbtess/primitiveStream.h @@ -1,40 +1,33 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -** $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/nurbtess/primitiveStream.h,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ /*we do not use the constans GL_... so that this file is independent of diff --git a/src/glu/sgi/libnurbs/nurbtess/quicksort.cc b/src/glu/sgi/libnurbs/nurbtess/quicksort.cc index f411aaa82a..9d0b290b39 100644 --- a/src/glu/sgi/libnurbs/nurbtess/quicksort.cc +++ b/src/glu/sgi/libnurbs/nurbtess/quicksort.cc @@ -31,10 +31,8 @@ ** published by SGI, but has not been independently verified as being ** compliant with the OpenGL(R) version 1.2.1 Specification. ** -** $Date: 2002/04/17 19:30:41 $ $Revision: 1.2 $ */ /* -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/nurbtess/quicksort.cc,v 1.2 2002/04/17 19:30:41 brianp Exp $ */ #include <stdlib.h> diff --git a/src/glu/sgi/libnurbs/nurbtess/quicksort.h b/src/glu/sgi/libnurbs/nurbtess/quicksort.h index af245615b3..3a8dcd6a2c 100644 --- a/src/glu/sgi/libnurbs/nurbtess/quicksort.h +++ b/src/glu/sgi/libnurbs/nurbtess/quicksort.h @@ -1,40 +1,33 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -** $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/nurbtess/quicksort.h,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ #ifndef _QUICKSORT_H diff --git a/src/glu/sgi/libnurbs/nurbtess/rectBlock.cc b/src/glu/sgi/libnurbs/nurbtess/rectBlock.cc index 932683ccac..f457b15733 100644 --- a/src/glu/sgi/libnurbs/nurbtess/rectBlock.cc +++ b/src/glu/sgi/libnurbs/nurbtess/rectBlock.cc @@ -31,10 +31,8 @@ ** published by SGI, but has not been independently verified as being ** compliant with the OpenGL(R) version 1.2.1 Specification. ** -** $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ */ /* -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/nurbtess/rectBlock.cc,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ #include "gluos.h" diff --git a/src/glu/sgi/libnurbs/nurbtess/rectBlock.h b/src/glu/sgi/libnurbs/nurbtess/rectBlock.h index d98b5a03e1..8dbd7eb819 100644 --- a/src/glu/sgi/libnurbs/nurbtess/rectBlock.h +++ b/src/glu/sgi/libnurbs/nurbtess/rectBlock.h @@ -1,40 +1,33 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -** $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/nurbtess/rectBlock.h,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ #ifndef _RECTBLOCK_H diff --git a/src/glu/sgi/libnurbs/nurbtess/sampleComp.cc b/src/glu/sgi/libnurbs/nurbtess/sampleComp.cc index b58de10af7..861c71bb38 100644 --- a/src/glu/sgi/libnurbs/nurbtess/sampleComp.cc +++ b/src/glu/sgi/libnurbs/nurbtess/sampleComp.cc @@ -31,10 +31,8 @@ ** published by SGI, but has not been independently verified as being ** compliant with the OpenGL(R) version 1.2.1 Specification. ** -** $Date: 2005/10/28 13:09:23 $ $Revision: 1.2 $ */ /* -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/nurbtess/sampleComp.cc,v 1.2 2005/10/28 13:09:23 brianp Exp $ */ #include <stdlib.h> diff --git a/src/glu/sgi/libnurbs/nurbtess/sampleComp.h b/src/glu/sgi/libnurbs/nurbtess/sampleComp.h index 8bdc4c41eb..a3c1790254 100644 --- a/src/glu/sgi/libnurbs/nurbtess/sampleComp.h +++ b/src/glu/sgi/libnurbs/nurbtess/sampleComp.h @@ -1,40 +1,33 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -** $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/nurbtess/sampleComp.h,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ #ifndef _SAMPLECOMP_H diff --git a/src/glu/sgi/libnurbs/nurbtess/sampleCompBot.cc b/src/glu/sgi/libnurbs/nurbtess/sampleCompBot.cc index b66647aa99..e12f88bab1 100644 --- a/src/glu/sgi/libnurbs/nurbtess/sampleCompBot.cc +++ b/src/glu/sgi/libnurbs/nurbtess/sampleCompBot.cc @@ -31,10 +31,8 @@ ** published by SGI, but has not been independently verified as being ** compliant with the OpenGL(R) version 1.2.1 Specification. ** -** $Date: 2001/11/29 16:16:55 $ $Revision: 1.2 $ */ /* -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/nurbtess/sampleCompBot.cc,v 1.2 2001/11/29 16:16:55 kschultz Exp $ */ #include <stdlib.h> diff --git a/src/glu/sgi/libnurbs/nurbtess/sampleCompBot.h b/src/glu/sgi/libnurbs/nurbtess/sampleCompBot.h index f48dceaea6..7b982794c0 100644 --- a/src/glu/sgi/libnurbs/nurbtess/sampleCompBot.h +++ b/src/glu/sgi/libnurbs/nurbtess/sampleCompBot.h @@ -1,40 +1,33 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -** $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/nurbtess/sampleCompBot.h,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ #ifndef _SAMPLECOMPBOT_H diff --git a/src/glu/sgi/libnurbs/nurbtess/sampleCompRight.cc b/src/glu/sgi/libnurbs/nurbtess/sampleCompRight.cc index e25b53c1a9..d01e50018b 100644 --- a/src/glu/sgi/libnurbs/nurbtess/sampleCompRight.cc +++ b/src/glu/sgi/libnurbs/nurbtess/sampleCompRight.cc @@ -31,10 +31,8 @@ ** published by SGI, but has not been independently verified as being ** compliant with the OpenGL(R) version 1.2.1 Specification. ** -** $Date: 2006/08/30 19:02:45 $ $Revision: 1.4 $ */ /* -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/nurbtess/sampleCompRight.cc,v 1.4 2006/08/30 19:02:45 brianp Exp $ */ #include <stdlib.h> diff --git a/src/glu/sgi/libnurbs/nurbtess/sampleCompRight.h b/src/glu/sgi/libnurbs/nurbtess/sampleCompRight.h index 747e35e6ad..4670b87ca8 100644 --- a/src/glu/sgi/libnurbs/nurbtess/sampleCompRight.h +++ b/src/glu/sgi/libnurbs/nurbtess/sampleCompRight.h @@ -1,40 +1,33 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -** $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/nurbtess/sampleCompRight.h,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ #ifndef _SAMPLECOMPRIGHT_H diff --git a/src/glu/sgi/libnurbs/nurbtess/sampleCompTop.cc b/src/glu/sgi/libnurbs/nurbtess/sampleCompTop.cc index 0d012d47ce..b7b929623a 100644 --- a/src/glu/sgi/libnurbs/nurbtess/sampleCompTop.cc +++ b/src/glu/sgi/libnurbs/nurbtess/sampleCompTop.cc @@ -31,10 +31,8 @@ ** published by SGI, but has not been independently verified as being ** compliant with the OpenGL(R) version 1.2.1 Specification. ** -** $Date: 2001/11/29 16:16:55 $ $Revision: 1.2 $ */ /* -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/nurbtess/sampleCompTop.cc,v 1.2 2001/11/29 16:16:55 kschultz Exp $ */ #include <stdlib.h> diff --git a/src/glu/sgi/libnurbs/nurbtess/sampleCompTop.h b/src/glu/sgi/libnurbs/nurbtess/sampleCompTop.h index 6875ad57e2..95598d63a8 100644 --- a/src/glu/sgi/libnurbs/nurbtess/sampleCompTop.h +++ b/src/glu/sgi/libnurbs/nurbtess/sampleCompTop.h @@ -1,40 +1,33 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -** $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/nurbtess/sampleCompTop.h,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ #ifndef _SAMPLECOMPTOP_H diff --git a/src/glu/sgi/libnurbs/nurbtess/sampleMonoPoly.cc b/src/glu/sgi/libnurbs/nurbtess/sampleMonoPoly.cc index c1b045437c..051f241083 100644 --- a/src/glu/sgi/libnurbs/nurbtess/sampleMonoPoly.cc +++ b/src/glu/sgi/libnurbs/nurbtess/sampleMonoPoly.cc @@ -31,10 +31,8 @@ ** published by SGI, but has not been independently verified as being ** compliant with the OpenGL(R) version 1.2.1 Specification. ** -** $Date: 2005/10/28 13:09:23 $ $Revision: 1.5 $ */ /* -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/nurbtess/sampleMonoPoly.cc,v 1.5 2005/10/28 13:09:23 brianp Exp $ */ #include "gluos.h" diff --git a/src/glu/sgi/libnurbs/nurbtess/sampleMonoPoly.h b/src/glu/sgi/libnurbs/nurbtess/sampleMonoPoly.h index 3bfa0d4393..3a5fa6c91b 100644 --- a/src/glu/sgi/libnurbs/nurbtess/sampleMonoPoly.h +++ b/src/glu/sgi/libnurbs/nurbtess/sampleMonoPoly.h @@ -1,40 +1,33 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -** $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/nurbtess/sampleMonoPoly.h,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ #ifndef _SAMPLEMONOPOLY_H diff --git a/src/glu/sgi/libnurbs/nurbtess/sampledLine.cc b/src/glu/sgi/libnurbs/nurbtess/sampledLine.cc index 15332eb41c..6253a7c09d 100644 --- a/src/glu/sgi/libnurbs/nurbtess/sampledLine.cc +++ b/src/glu/sgi/libnurbs/nurbtess/sampledLine.cc @@ -31,10 +31,8 @@ ** published by SGI, but has not been independently verified as being ** compliant with the OpenGL(R) version 1.2.1 Specification. ** -** $Date: 2001/11/29 16:16:55 $ $Revision: 1.2 $ */ /* -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/nurbtess/sampledLine.cc,v 1.2 2001/11/29 16:16:55 kschultz Exp $ */ #include <stdlib.h> diff --git a/src/glu/sgi/libnurbs/nurbtess/sampledLine.h b/src/glu/sgi/libnurbs/nurbtess/sampledLine.h index 8925197ab3..2cc726948e 100644 --- a/src/glu/sgi/libnurbs/nurbtess/sampledLine.h +++ b/src/glu/sgi/libnurbs/nurbtess/sampledLine.h @@ -1,40 +1,33 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -** $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/nurbtess/sampledLine.h,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ #ifndef _SAMPLEDLINE_H diff --git a/src/glu/sgi/libnurbs/nurbtess/searchTree.cc b/src/glu/sgi/libnurbs/nurbtess/searchTree.cc index 45c2412b48..1865755a48 100644 --- a/src/glu/sgi/libnurbs/nurbtess/searchTree.cc +++ b/src/glu/sgi/libnurbs/nurbtess/searchTree.cc @@ -31,10 +31,8 @@ ** published by SGI, but has not been independently verified as being ** compliant with the OpenGL(R) version 1.2.1 Specification. ** -** $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ */ /* -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/nurbtess/searchTree.cc,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ #include <stdlib.h> diff --git a/src/glu/sgi/libnurbs/nurbtess/searchTree.h b/src/glu/sgi/libnurbs/nurbtess/searchTree.h index 4272248528..d5e33314bb 100644 --- a/src/glu/sgi/libnurbs/nurbtess/searchTree.h +++ b/src/glu/sgi/libnurbs/nurbtess/searchTree.h @@ -1,40 +1,33 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -** $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/nurbtess/searchTree.h,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ #ifndef _SEARCHTREE_H diff --git a/src/glu/sgi/libnurbs/nurbtess/zlassert.h b/src/glu/sgi/libnurbs/nurbtess/zlassert.h index 6a3720853b..b9c0732576 100644 --- a/src/glu/sgi/libnurbs/nurbtess/zlassert.h +++ b/src/glu/sgi/libnurbs/nurbtess/zlassert.h @@ -1,40 +1,33 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -** $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/nurbtess/zlassert.h,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ /*XXXblythe this file should be deleted*/ diff --git a/src/glu/sgi/libtess/README b/src/glu/sgi/libtess/README index 7c314b74a0..66a6011e25 100644 --- a/src/glu/sgi/libtess/README +++ b/src/glu/sgi/libtess/README @@ -1,5 +1,4 @@ /* -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libtess/README,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ General Polygon Tesselation diff --git a/src/glu/sgi/libtess/alg-outline b/src/glu/sgi/libtess/alg-outline index f51d68ce3b..33fd69728a 100644 --- a/src/glu/sgi/libtess/alg-outline +++ b/src/glu/sgi/libtess/alg-outline @@ -1,5 +1,4 @@ /* -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libtess/alg-outline,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ This is only a very brief overview. There is quite a bit of diff --git a/src/glu/sgi/libtess/dict-list.h b/src/glu/sgi/libtess/dict-list.h index f5b82116d8..11331a76ed 100644 --- a/src/glu/sgi/libtess/dict-list.h +++ b/src/glu/sgi/libtess/dict-list.h @@ -1,42 +1,35 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* ** Author: Eric Veach, July 1994. ** -** $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libtess/dict-list.h,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ #ifndef __dict_list_h_ diff --git a/src/glu/sgi/libtess/dict.c b/src/glu/sgi/libtess/dict.c index e3750eea22..49d4f759e7 100644 --- a/src/glu/sgi/libtess/dict.c +++ b/src/glu/sgi/libtess/dict.c @@ -1,42 +1,35 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* ** Author: Eric Veach, July 1994. ** -** $Date: 2006/04/19 14:42:01 $ $Revision: 1.3 $ -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libtess/dict.c,v 1.3 2006/04/19 14:42:01 brianp Exp $ */ #include <stddef.h> diff --git a/src/glu/sgi/libtess/dict.h b/src/glu/sgi/libtess/dict.h index ea3b4064ff..11331a76ed 100644 --- a/src/glu/sgi/libtess/dict.h +++ b/src/glu/sgi/libtess/dict.h @@ -1,42 +1,35 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* ** Author: Eric Veach, July 1994. ** -** $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libtess/dict.h,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ #ifndef __dict_list_h_ diff --git a/src/glu/sgi/libtess/geom.c b/src/glu/sgi/libtess/geom.c index d009e143ad..7d3b8d8a6a 100644 --- a/src/glu/sgi/libtess/geom.c +++ b/src/glu/sgi/libtess/geom.c @@ -1,42 +1,35 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* ** Author: Eric Veach, July 1994. ** -** $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libtess/geom.c,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ #include "gluos.h" diff --git a/src/glu/sgi/libtess/geom.h b/src/glu/sgi/libtess/geom.h index 7e1e86528a..5cb76c7d15 100644 --- a/src/glu/sgi/libtess/geom.h +++ b/src/glu/sgi/libtess/geom.h @@ -1,37 +1,32 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* ** Author: Eric Veach, July 1994. ** diff --git a/src/glu/sgi/libtess/memalloc.c b/src/glu/sgi/libtess/memalloc.c index 61fd59aaed..81879ef782 100644 --- a/src/glu/sgi/libtess/memalloc.c +++ b/src/glu/sgi/libtess/memalloc.c @@ -1,42 +1,35 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* ** Author: Eric Veach, July 1994. ** -** $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libtess/memalloc.c,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ #include "memalloc.h" diff --git a/src/glu/sgi/libtess/memalloc.h b/src/glu/sgi/libtess/memalloc.h index 97f223759d..c2f969b8be 100644 --- a/src/glu/sgi/libtess/memalloc.h +++ b/src/glu/sgi/libtess/memalloc.h @@ -1,42 +1,35 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* ** Author: Eric Veach, July 1994. ** -** $Date: 2003/07/24 22:41:17 $ $Revision: 1.4 $ -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libtess/memalloc.h,v 1.4 2003/07/24 22:41:17 brianp Exp $ */ #ifndef __memalloc_simple_h_ diff --git a/src/glu/sgi/libtess/mesh.c b/src/glu/sgi/libtess/mesh.c index 045954db91..ae861f8642 100644 --- a/src/glu/sgi/libtess/mesh.c +++ b/src/glu/sgi/libtess/mesh.c @@ -1,42 +1,35 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* ** Author: Eric Veach, July 1994. ** -** $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libtess/mesh.c,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ #include "gluos.h" diff --git a/src/glu/sgi/libtess/mesh.h b/src/glu/sgi/libtess/mesh.h index 6224df415b..690c5f2f69 100644 --- a/src/glu/sgi/libtess/mesh.h +++ b/src/glu/sgi/libtess/mesh.h @@ -1,42 +1,35 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* ** Author: Eric Veach, July 1994. ** -** $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libtess/mesh.h,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ #ifndef __mesh_h_ diff --git a/src/glu/sgi/libtess/normal.c b/src/glu/sgi/libtess/normal.c index f69544618c..0a2494be34 100644 --- a/src/glu/sgi/libtess/normal.c +++ b/src/glu/sgi/libtess/normal.c @@ -1,37 +1,32 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* ** Author: Eric Veach, July 1994. ** diff --git a/src/glu/sgi/libtess/normal.h b/src/glu/sgi/libtess/normal.h index c8e334f45f..c376ca4452 100644 --- a/src/glu/sgi/libtess/normal.h +++ b/src/glu/sgi/libtess/normal.h @@ -1,42 +1,35 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* ** Author: Eric Veach, July 1994. ** -** $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libtess/normal.h,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ #ifndef __normal_h_ diff --git a/src/glu/sgi/libtess/priorityq-heap.c b/src/glu/sgi/libtess/priorityq-heap.c index 6b77155e1e..e3a6c6068a 100644 --- a/src/glu/sgi/libtess/priorityq-heap.c +++ b/src/glu/sgi/libtess/priorityq-heap.c @@ -1,42 +1,35 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* ** Author: Eric Veach, July 1994. ** -** $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libtess/priorityq-heap.c,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ #include <stddef.h> diff --git a/src/glu/sgi/libtess/priorityq-heap.h b/src/glu/sgi/libtess/priorityq-heap.h index 39c33c3921..dc9aaef87f 100644 --- a/src/glu/sgi/libtess/priorityq-heap.h +++ b/src/glu/sgi/libtess/priorityq-heap.h @@ -1,42 +1,35 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* ** Author: Eric Veach, July 1994. ** -** $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libtess/priorityq-heap.h,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ #ifndef __priorityq_heap_h_ diff --git a/src/glu/sgi/libtess/priorityq-sort.h b/src/glu/sgi/libtess/priorityq-sort.h index 2439238793..746cf5fa69 100644 --- a/src/glu/sgi/libtess/priorityq-sort.h +++ b/src/glu/sgi/libtess/priorityq-sort.h @@ -1,42 +1,35 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* ** Author: Eric Veach, July 1994. ** -** $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libtess/priorityq-sort.h,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ #ifndef __priorityq_sort_h_ diff --git a/src/glu/sgi/libtess/priorityq.c b/src/glu/sgi/libtess/priorityq.c index fffa1d5255..11f0263ac9 100644 --- a/src/glu/sgi/libtess/priorityq.c +++ b/src/glu/sgi/libtess/priorityq.c @@ -1,42 +1,35 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* ** Author: Eric Veach, July 1994. ** -** $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libtess/priorityq.c,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ #include "gluos.h" diff --git a/src/glu/sgi/libtess/priorityq.h b/src/glu/sgi/libtess/priorityq.h index 97ed707578..746cf5fa69 100644 --- a/src/glu/sgi/libtess/priorityq.h +++ b/src/glu/sgi/libtess/priorityq.h @@ -1,42 +1,35 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* ** Author: Eric Veach, July 1994. ** -** $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libtess/priorityq.h,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ #ifndef __priorityq_sort_h_ diff --git a/src/glu/sgi/libtess/render.c b/src/glu/sgi/libtess/render.c index 97751dc810..4f376f7f42 100644 --- a/src/glu/sgi/libtess/render.c +++ b/src/glu/sgi/libtess/render.c @@ -1,42 +1,35 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* ** Author: Eric Veach, July 1994. ** -** $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libtess/render.c,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ #include "gluos.h" diff --git a/src/glu/sgi/libtess/render.h b/src/glu/sgi/libtess/render.h index 956569bb77..a298c9a948 100644 --- a/src/glu/sgi/libtess/render.h +++ b/src/glu/sgi/libtess/render.h @@ -1,42 +1,35 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* ** Author: Eric Veach, July 1994. ** -** $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libtess/render.h,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ #ifndef __render_h_ diff --git a/src/glu/sgi/libtess/sweep.c b/src/glu/sgi/libtess/sweep.c index 1cfd7788f7..744be6b47d 100644 --- a/src/glu/sgi/libtess/sweep.c +++ b/src/glu/sgi/libtess/sweep.c @@ -1,37 +1,32 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* ** Author: Eric Veach, July 1994. ** diff --git a/src/glu/sgi/libtess/sweep.h b/src/glu/sgi/libtess/sweep.h index 2223f52f59..feb68b0ffe 100644 --- a/src/glu/sgi/libtess/sweep.h +++ b/src/glu/sgi/libtess/sweep.h @@ -1,42 +1,35 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* ** Author: Eric Veach, July 1994. ** -** $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libtess/sweep.h,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ #ifndef __sweep_h_ diff --git a/src/glu/sgi/libtess/tess.c b/src/glu/sgi/libtess/tess.c index 0489350a02..029a02c3ae 100644 --- a/src/glu/sgi/libtess/tess.c +++ b/src/glu/sgi/libtess/tess.c @@ -1,37 +1,32 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* ** Author: Eric Veach, July 1994. ** diff --git a/src/glu/sgi/libtess/tess.h b/src/glu/sgi/libtess/tess.h index 2ba00b6ddb..1624960881 100644 --- a/src/glu/sgi/libtess/tess.h +++ b/src/glu/sgi/libtess/tess.h @@ -1,42 +1,35 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* ** Author: Eric Veach, July 1994. ** -** $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libtess/tess.h,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ #ifndef __tess_h_ diff --git a/src/glu/sgi/libtess/tessmono.c b/src/glu/sgi/libtess/tessmono.c index 77fe0ac619..4d08440059 100644 --- a/src/glu/sgi/libtess/tessmono.c +++ b/src/glu/sgi/libtess/tessmono.c @@ -1,42 +1,35 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* ** Author: Eric Veach, July 1994. ** -** $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libtess/tessmono.c,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ #include "gluos.h" diff --git a/src/glu/sgi/libtess/tessmono.h b/src/glu/sgi/libtess/tessmono.h index 01f244f6ec..8ee1b2fe34 100644 --- a/src/glu/sgi/libtess/tessmono.h +++ b/src/glu/sgi/libtess/tessmono.h @@ -1,42 +1,35 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* ** Author: Eric Veach, July 1994. ** -** $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libtess/tessmono.h,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ #ifndef __tessmono_h_ diff --git a/src/glu/sgi/libutil/error.c b/src/glu/sgi/libutil/error.c index c200056942..e734818ed6 100644 --- a/src/glu/sgi/libutil/error.c +++ b/src/glu/sgi/libutil/error.c @@ -1,39 +1,32 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -** $Date: 2006/06/20 15:30:26 $ $Revision: 1.3 $ -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libutil/error.c,v 1.3 2006/06/20 15:30:26 brianp Exp $ -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ #include "gluos.h" #include "gluint.h" diff --git a/src/glu/sgi/libutil/glue.c b/src/glu/sgi/libutil/glue.c index a0471bbe2e..cd65d65ad2 100644 --- a/src/glu/sgi/libutil/glue.c +++ b/src/glu/sgi/libutil/glue.c @@ -1,39 +1,32 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -** $Date: 2001/09/24 09:40:40 $ $Revision: 1.3 $ -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libutil/glue.c,v 1.3 2001/09/24 09:40:40 joukj Exp $ -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ #include <stdlib.h> #include "gluint.h" diff --git a/src/glu/sgi/libutil/gluint.h b/src/glu/sgi/libutil/gluint.h index f08401df7a..fd513caa69 100644 --- a/src/glu/sgi/libutil/gluint.h +++ b/src/glu/sgi/libutil/gluint.h @@ -1,39 +1,32 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -** $Date: 2001/09/20 21:50:53 $ $Revision: 1.2 $ -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libutil/gluint.h,v 1.2 2001/09/20 21:50:53 kschultz Exp $ -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ #ifndef __gluint_h__ #define __gluint_h__ diff --git a/src/glu/sgi/libutil/mipmap.c b/src/glu/sgi/libutil/mipmap.c index d65b7f689f..af647af73c 100644 --- a/src/glu/sgi/libutil/mipmap.c +++ b/src/glu/sgi/libutil/mipmap.c @@ -1,37 +1,32 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ #include "gluos.h" #include <assert.h> diff --git a/src/glu/sgi/libutil/project.c b/src/glu/sgi/libutil/project.c index 356b46b899..f4bf8839b6 100644 --- a/src/glu/sgi/libutil/project.c +++ b/src/glu/sgi/libutil/project.c @@ -1,39 +1,32 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -** $Date: 2006/05/01 16:01:17 $ $Revision: 1.6 $ -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libutil/project.c,v 1.6 2006/05/01 16:01:17 brianp Exp $ -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ #include "gluos.h" #include <math.h> diff --git a/src/glu/sgi/libutil/quad.c b/src/glu/sgi/libutil/quad.c index 1ae7442c80..d88b20f556 100644 --- a/src/glu/sgi/libutil/quad.c +++ b/src/glu/sgi/libutil/quad.c @@ -1,37 +1,32 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ #include "gluos.h" #include "gluint.h" diff --git a/src/glu/sgi/libutil/registry.c b/src/glu/sgi/libutil/registry.c index e486ffa8ca..2e3b574fb0 100644 --- a/src/glu/sgi/libutil/registry.c +++ b/src/glu/sgi/libutil/registry.c @@ -1,39 +1,32 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -** $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libutil/registry.c,v 1.1 2001/03/17 00:25:41 brianp Exp $ -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ #include "gluos.h" #include <GL/glu.h> diff --git a/src/glut/beos/beos_x11.cpp b/src/glut/beos/beos_x11.cpp index 2d1bc655cb..4f7ec48ac8 100644 --- a/src/glut/beos/beos_x11.cpp +++ b/src/glut/beos/beos_x11.cpp @@ -23,7 +23,6 @@ int DisplayHeight() { /* the following function was stolen from the X sources as indicated. */ /* Copyright Massachusetts Institute of Technology 1985, 1986, 1987 */ -/* $XConsortium: XParseGeom.c,v 11.18 91/02/21 17:23:05 rws Exp $ */ /* Permission to use, copy, modify, distribute, and sell this software and its diff --git a/src/glut/ggi/debug.h b/src/glut/ggi/debug.h index da329a1d9b..09fa960670 100644 --- a/src/glut/ggi/debug.h +++ b/src/glut/ggi/debug.h @@ -1,4 +1,4 @@ -/* $Id: debug.h,v 1.1 2000/11/19 07:41:26 jtaylor Exp $ +/* ****************************************************************************** GGIMesa debugging macros diff --git a/src/glut/glx/Makefile b/src/glut/glx/Makefile index 307a6d2216..7f886f775a 100644 --- a/src/glut/glx/Makefile +++ b/src/glut/glx/Makefile @@ -94,6 +94,7 @@ $(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME): depend $(OBJECTS) $(MKLIB) -o $(GLUT_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \ -major $(GLUT_MAJOR) -minor $(GLUT_MINOR) -patch $(GLUT_TINY) \ $(MKLIB_OPTIONS) -install $(TOP)/$(LIB_DIR) \ + -id $(INSTALL_LIB_DIR)/lib$(GLUT_LIB).$(GLUT_MAJOR).dylib \ $(GLUT_LIB_DEPS) $(OBJECTS) @@ -111,7 +112,7 @@ install: glut.pc $(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) $(TOP)/$(LIB_DIR)/$(GLUT_LIB_GLOB) $(DESTDIR)$(INSTALL_LIB_DIR) $(INSTALL) -m 644 glut.pc $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig diff --git a/src/glut/glx/Makefile.mgw b/src/glut/glx/Makefile.mgw index 9fff2e1503..5e1fde03de 100644 --- a/src/glut/glx/Makefile.mgw +++ b/src/glut/glx/Makefile.mgw @@ -122,7 +122,7 @@ SRCS = \ glut_dstr.c \ glut_event.c \ glut_ext.c \ - glut_fbc.c \ + glut_fcb.c \ glut_fullscrn.c \ glut_gamemode.c \ glut_get.c \ diff --git a/src/glut/glx/stroke.h b/src/glut/glx/stroke.h index fc29680bea..602b2fae9f 100644 --- a/src/glut/glx/stroke.h +++ b/src/glut/glx/stroke.h @@ -1,4 +1,3 @@ -/* $XConsortium: wfont.h,v 5.1 91/02/16 09:46:37 rws Exp $ */ /***************************************************************** Copyright (c) 1989,1990, 1991 by Sun Microsystems, Inc. and the X Consortium. diff --git a/src/glut/glx/win32_x11.c b/src/glut/glx/win32_x11.c index 1d138cfa2a..d00ccdb121 100644 --- a/src/glut/glx/win32_x11.c +++ b/src/glut/glx/win32_x11.c @@ -263,7 +263,6 @@ XPending(Display* display) /* the following function was stolen from the X sources as indicated. */ /* Copyright Massachusetts Institute of Technology 1985, 1986, 1987 */ -/* $XConsortium: XParseGeom.c,v 11.18 91/02/21 17:23:05 rws Exp $ */ /* Permission to use, copy, modify, distribute, and sell this software and its diff --git a/src/glut/os2/WarpWin.cpp b/src/glut/os2/WarpWin.cpp index bd5a6e80c7..71cc8e1bc9 100644 --- a/src/glut/os2/WarpWin.cpp +++ b/src/glut/os2/WarpWin.cpp @@ -417,4 +417,3 @@ void ScreenToClient( HWND hwnd, POINTL *point) point->y -= swp_src.y; } -
\ No newline at end of file diff --git a/src/glut/os2/glut_cindex.cpp b/src/glut/os2/glut_cindex.cpp index 3484185051..fa6d2f12d6 100644 --- a/src/glut/os2/glut_cindex.cpp +++ b/src/glut/os2/glut_cindex.cpp @@ -256,4 +256,3 @@ bla bla bla #endif } /* ENDCENTRY */ -
\ No newline at end of file diff --git a/src/glut/os2/glut_gamemode.cpp b/src/glut/os2/glut_gamemode.cpp index 39918fdf39..1756e8a4b5 100644 --- a/src/glut/os2/glut_gamemode.cpp +++ b/src/glut/os2/glut_gamemode.cpp @@ -677,4 +677,3 @@ glutGameModeGet(GLenum mode) return -1; } } -
\ No newline at end of file diff --git a/src/glut/os2/glut_win.cpp b/src/glut/os2/glut_win.cpp index 53ff5d5d95..63757d7152 100644 --- a/src/glut/os2/glut_win.cpp +++ b/src/glut/os2/glut_win.cpp @@ -1218,4 +1218,3 @@ glutReshapeFunc(GLUTreshapeCB reshapeFunc) __glutCurrentWindow->reshape = __glutDefaultReshape; } } -
\ No newline at end of file diff --git a/src/glut/os2/glut_winmisc.cpp b/src/glut/os2/glut_winmisc.cpp index 456d19a8c1..7cd6699924 100644 --- a/src/glut/os2/glut_winmisc.cpp +++ b/src/glut/os2/glut_winmisc.cpp @@ -124,4 +124,3 @@ glutHideWindow(void) } /* ENDCENTRY */ -
\ No newline at end of file diff --git a/src/glut/os2/os2_glx.cpp b/src/glut/os2/os2_glx.cpp index 5e135bc17e..bf116e49c9 100644 --- a/src/glut/os2/os2_glx.cpp +++ b/src/glut/os2/os2_glx.cpp @@ -143,4 +143,3 @@ XVisualInfo * glXChooseVisual(int mode) #if POKA #endif /* POKA */ -
\ No newline at end of file diff --git a/src/glut/os2/os2_menu.cpp b/src/glut/os2/os2_menu.cpp index 56f2cdef8b..f140e9c79b 100644 --- a/src/glut/os2/os2_menu.cpp +++ b/src/glut/os2/os2_menu.cpp @@ -530,4 +530,3 @@ glutDetachMenu(int button) } } -
\ No newline at end of file diff --git a/src/glut/os2/os2_winproc.cpp b/src/glut/os2/os2_winproc.cpp index 6ffe0d4624..9cbdec1cd2 100644 --- a/src/glut/os2/os2_winproc.cpp +++ b/src/glut/os2/os2_winproc.cpp @@ -1294,4 +1294,3 @@ Bool __glutSetWindowText(Window window, char *text) } #endif -
\ No newline at end of file diff --git a/src/glw/Makefile b/src/glw/Makefile index 6a522eccba..753c4b74d4 100644 --- a/src/glw/Makefile +++ b/src/glw/Makefile @@ -39,7 +39,7 @@ install: glw.pc $(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) $(TOP)/$(LIB_DIR)/$(GLW_LIB_GLOB) $(DESTDIR)$(INSTALL_LIB_DIR) $(INSTALL) -m 644 glw.pc $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig clean: @@ -52,6 +52,7 @@ $(TOP)/$(LIB_DIR)/$(GLW_LIB_NAME): $(OBJECTS) $(MKLIB) -o $(GLW_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \ -major $(MAJOR) -minor $(MINOR) -patch $(TINY) \ $(MKLIB_OPTIONS) -install $(TOP)/$(LIB_DIR) \ + -id $(INSTALL_LIB_DIR)/lib$(GLW_LIB).$(MAJOR).dylib \ $(GLW_LIB_DEPS) $(OBJECTS) diff --git a/src/glx/mini/miniglx_events.c b/src/glx/mini/miniglx_events.c index 969398bc16..a20d5847b3 100644 --- a/src/glx/mini/miniglx_events.c +++ b/src/glx/mini/miniglx_events.c @@ -38,7 +38,6 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/* $Id: miniglx_events.c,v 1.6 2006/04/03 07:31:27 airlied Exp $ */ #include <assert.h> diff --git a/src/glx/x11/Makefile b/src/glx/x11/Makefile index 121f3dfac0..419cb2853b 100644 --- a/src/glx/x11/Makefile +++ b/src/glx/x11/Makefile @@ -50,7 +50,7 @@ OBJECTS = $(SOURCES:.c=.o) $(MESA_GLAPI_OBJECTS) INCLUDES = -I. \ -I$(TOP)/include \ -I$(TOP)/include/GL/internal \ - -I$(TOP)/src/mesa/main \ + -I$(TOP)/src/mesa \ -I$(TOP)/src/mesa/glapi \ $(LIBDRM_CFLAGS) \ $(DRI2PROTO_CFLAGS) \ @@ -73,7 +73,8 @@ default: depend $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME): $(OBJECTS) Makefile $(MKLIB) -o $(GL_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \ -major 1 -minor 2 $(MKLIB_OPTIONS) \ - -install $(TOP)/$(LIB_DIR) $(GL_LIB_DEPS) $(OBJECTS) + -install $(TOP)/$(LIB_DIR) -id $(INSTALL_LIB_DIR)/lib$(GL_LIB).1.dylib \ + $(GL_LIB_DEPS) $(OBJECTS) depend: $(SOURCES) $(MESA_GLAPI_SOURCES) $(MESA_ASM_API) Makefile diff --git a/src/glx/x11/XF86dri.c b/src/glx/x11/XF86dri.c index 5b0bf14afe..cd0adc3930 100644 --- a/src/glx/x11/XF86dri.c +++ b/src/glx/x11/XF86dri.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/dri/XF86dri.c,v 1.13 2002/10/30 12:51:25 alanh Exp $ */ /************************************************************************** Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. @@ -43,9 +42,19 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include <X11/Xlibint.h> #include <X11/extensions/Xext.h> #include <X11/extensions/extutil.h> -#include "glheader.h" #include "xf86dristr.h" + +#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303 +# define PUBLIC __attribute__((visibility("default"))) +# define USED __attribute__((used)) +#else +# define PUBLIC +# define USED +#endif + + + static XExtensionInfo _xf86dri_info_data; static XExtensionInfo *xf86dri_info = &_xf86dri_info_data; static char xf86dri_extension_name[] = XF86DRINAME; @@ -375,7 +384,7 @@ PUBLIC Bool XF86DRICreateContext(dpy, screen, visual, context, hHWContext) context, hHWContext ); } -PUBLIC GLboolean XF86DRIDestroyContext(Display *dpy, int screen, +PUBLIC Bool XF86DRIDestroyContext(Display *dpy, int screen, XID context ) { XExtDisplayInfo *info = find_display (dpy); @@ -396,7 +405,7 @@ PUBLIC GLboolean XF86DRIDestroyContext(Display *dpy, int screen, return True; } -PUBLIC GLboolean XF86DRICreateDrawable(Display *dpy, int screen, +PUBLIC Bool XF86DRICreateDrawable(Display *dpy, int screen, XID drawable, drm_drawable_t * hHWDrawable ) { XExtDisplayInfo *info = find_display (dpy); @@ -430,7 +439,7 @@ static int noopErrorHandler(Display *dpy, XErrorEvent *xerr) return 0; } -PUBLIC GLboolean XF86DRIDestroyDrawable(Display *dpy, int screen, +PUBLIC Bool XF86DRIDestroyDrawable(Display *dpy, int screen, XID drawable ) { XExtDisplayInfo *info = find_display (dpy); @@ -452,7 +461,7 @@ PUBLIC GLboolean XF86DRIDestroyDrawable(Display *dpy, int screen, * the windows is gone, by wrapping the destroy call in an error * handler. */ - XSync(dpy, GL_FALSE); + XSync(dpy, False); oldXErrorHandler = XSetErrorHandler(noopErrorHandler); LockDisplay(dpy); diff --git a/src/glx/x11/clientattrib.c b/src/glx/x11/clientattrib.c index bfb263ced1..fb45f62142 100644 --- a/src/glx/x11/clientattrib.c +++ b/src/glx/x11/clientattrib.c @@ -1,38 +1,32 @@ -/* $XFree86: xc/lib/GL/glx/clientattrib.c,v 1.5 2001/03/21 16:04:39 dawes Exp $ */ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ #include <assert.h> #include "glxclient.h" diff --git a/src/glx/x11/compsize.c b/src/glx/x11/compsize.c index b8c162e8ac..d46d3d41d1 100644 --- a/src/glx/x11/compsize.c +++ b/src/glx/x11/compsize.c @@ -1,38 +1,32 @@ -/* $XFree86: xc/lib/GL/glx/compsize.c,v 1.6 2004/01/28 18:11:38 alanh Exp $ */ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ #include <GL/gl.h> #include "indirect_size.h" diff --git a/src/glx/x11/dri2.c b/src/glx/x11/dri2.c index e7044ab424..5acf7ac531 100644 --- a/src/glx/x11/dri2.c +++ b/src/glx/x11/dri2.c @@ -36,7 +36,6 @@ #include <X11/extensions/Xext.h> #include <X11/extensions/extutil.h> #include <X11/extensions/dri2proto.h> -#include "glheader.h" #include "xf86drm.h" #include "dri2.h" @@ -122,7 +121,11 @@ Bool DRI2Connect(Display *dpy, int screen, return False; } - *sareaHandle = rep.sareaHandle; + if (rep.driverNameLength == 0 && rep.busIdLength == 0) { + UnlockDisplay(dpy); + SyncHandle(); + return False; + } *driverName = Xmalloc(rep.driverNameLength + 1); if (*driverName == NULL) { @@ -150,7 +153,7 @@ Bool DRI2Connect(Display *dpy, int screen, UnlockDisplay(dpy); SyncHandle(); - return rep.sareaHandle != 0; + return True; } Bool DRI2AuthConnection(Display *dpy, int screen, drm_magic_t magic) @@ -179,74 +182,119 @@ Bool DRI2AuthConnection(Display *dpy, int screen, drm_magic_t magic) return rep.authenticated; } -Bool DRI2CreateDrawable(Display *dpy, XID drawable, - unsigned int *handle, unsigned int *head) +void DRI2CreateDrawable(Display *dpy, XID drawable) { XExtDisplayInfo *info = DRI2FindDisplay(dpy); - xDRI2CreateDrawableReply rep; xDRI2CreateDrawableReq *req; - XextCheckExtension (dpy, info, dri2ExtensionName, False); + XextSimpleCheckExtension (dpy, info, dri2ExtensionName); LockDisplay(dpy); GetReq(DRI2CreateDrawable, req); req->reqType = info->codes->major_opcode; req->dri2ReqType = X_DRI2CreateDrawable; req->drawable = drawable; + UnlockDisplay(dpy); + SyncHandle(); +} + +DRI2Buffer *DRI2GetBuffers(Display *dpy, XID drawable, + int *width, int *height, + unsigned int *attachments, int count, + int *outCount) +{ + XExtDisplayInfo *info = DRI2FindDisplay(dpy); + xDRI2GetBuffersReply rep; + xDRI2GetBuffersReq *req; + DRI2Buffer *buffers; + xDRI2Buffer repBuffer; + CARD32 *p; + int i; + + XextCheckExtension (dpy, info, dri2ExtensionName, False); + + LockDisplay(dpy); + GetReqExtra(DRI2GetBuffers, count * 4, req); + req->reqType = info->codes->major_opcode; + req->dri2ReqType = X_DRI2GetBuffers; + req->drawable = drawable; + req->count = count; + p = (CARD32 *) &req[1]; + for (i = 0; i < count; i++) + p[i] = attachments[i]; + if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) { UnlockDisplay(dpy); SyncHandle(); - return False; + return NULL; } + + *width = rep.width; + *height = rep.height; + *outCount = rep.count; + + buffers = Xmalloc(count * sizeof buffers[0]); + if (buffers == NULL) { + _XEatData(dpy, rep.count * sizeof repBuffer); + UnlockDisplay(dpy); + SyncHandle(); + return NULL; + } + + for (i = 0; i < rep.count; i++) { + _XReadPad(dpy, (char *) &repBuffer, sizeof repBuffer); + buffers[i].attachment = repBuffer.attachment; + buffers[i].name = repBuffer.name; + buffers[i].pitch = repBuffer.pitch; + buffers[i].cpp = repBuffer.cpp; + buffers[i].flags = repBuffer.flags; + } + UnlockDisplay(dpy); SyncHandle(); - *handle = rep.handle; - *head = rep.head; - - return True; + return buffers; } -void DRI2DestroyDrawable(Display *dpy, XID drawable) +void DRI2SwapBuffers(Display *dpy, XID drawable, + int x, int y, int width, int height) { XExtDisplayInfo *info = DRI2FindDisplay(dpy); - xDRI2DestroyDrawableReq *req; + xDRI2SwapBuffersReq *req; + xDRI2SwapBuffersReply rep; XextSimpleCheckExtension (dpy, info, dri2ExtensionName); - XSync(dpy, GL_FALSE); - LockDisplay(dpy); - GetReq(DRI2DestroyDrawable, req); + GetReq(DRI2SwapBuffers, req); req->reqType = info->codes->major_opcode; - req->dri2ReqType = X_DRI2DestroyDrawable; + req->dri2ReqType = X_DRI2SwapBuffers; req->drawable = drawable; + req->x = x; + req->y = y; + req->width = width; + req->height = height; + + _XReply(dpy, (xReply *)&rep, 0, xFalse); + UnlockDisplay(dpy); SyncHandle(); } -Bool DRI2ReemitDrawableInfo(Display *dpy, XID drawable, unsigned int *head) +void DRI2DestroyDrawable(Display *dpy, XID drawable) { XExtDisplayInfo *info = DRI2FindDisplay(dpy); - xDRI2ReemitDrawableInfoReply rep; - xDRI2ReemitDrawableInfoReq *req; + xDRI2DestroyDrawableReq *req; - XextCheckExtension (dpy, info, dri2ExtensionName, False); + XextSimpleCheckExtension (dpy, info, dri2ExtensionName); + + XSync(dpy, False); LockDisplay(dpy); - GetReq(DRI2ReemitDrawableInfo, req); + GetReq(DRI2DestroyDrawable, req); req->reqType = info->codes->major_opcode; - req->dri2ReqType = X_DRI2ReemitDrawableInfo; + req->dri2ReqType = X_DRI2DestroyDrawable; req->drawable = drawable; - if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) { - UnlockDisplay(dpy); - SyncHandle(); - return False; - } UnlockDisplay(dpy); SyncHandle(); - - *head = rep.head; - - return True; } diff --git a/src/glx/x11/dri2.h b/src/glx/x11/dri2.h index 1dfd0448b2..e57c4ce644 100644 --- a/src/glx/x11/dri2.h +++ b/src/glx/x11/dri2.h @@ -33,6 +33,14 @@ #ifndef _DRI2_H_ #define _DRI2_H_ +typedef struct { + unsigned int attachment; + unsigned int name; + unsigned int pitch; + unsigned int cpp; + unsigned int flags; +} DRI2Buffer; + extern Bool DRI2QueryExtension(Display *display, int *eventBase, int *errorBase); extern Bool @@ -42,12 +50,17 @@ DRI2Connect(Display *display, int screen, char **driverName, char **busId, unsigned int *sareaHandle); extern Bool DRI2AuthConnection(Display *display, int screen, drm_magic_t magic); -extern Bool -DRI2CreateDrawable(Display *display, XID drawable, - unsigned int *handle, unsigned int *head); +extern void +DRI2CreateDrawable(Display *display, XID drawable); extern void DRI2DestroyDrawable(Display *display, XID handle); -extern Bool -DRI2ReemitDrawableInfo(Display *dpy, XID handle, unsigned int *head); +extern DRI2Buffer * +DRI2GetBuffers(Display *dpy, XID drawable, + int *width, int *height, + unsigned int *attachments, int count, + int *outCount); +extern void +DRI2SwapBuffers(Display *dpy, XID drawable, + int x, int y, int width, int height); #endif diff --git a/src/glx/x11/dri2_glx.c b/src/glx/x11/dri2_glx.c index 0be65bce62..ed9054627f 100644 --- a/src/glx/x11/dri2_glx.c +++ b/src/glx/x11/dri2_glx.c @@ -35,7 +35,6 @@ #include <X11/Xlib.h> #include <X11/extensions/Xfixes.h> #include <X11/extensions/Xdamage.h> -#include "glheader.h" #include "glxclient.h" #include "glcontextmodes.h" #include "xf86dri.h" @@ -49,6 +48,7 @@ typedef struct __GLXDRIdisplayPrivateRec __GLXDRIdisplayPrivate; typedef struct __GLXDRIcontextPrivateRec __GLXDRIcontextPrivate; +typedef struct __GLXDRIdrawablePrivateRec __GLXDRIdrawablePrivate; struct __GLXDRIdisplayPrivateRec { __GLXDRIdisplay base; @@ -67,6 +67,13 @@ struct __GLXDRIcontextPrivateRec { __GLXscreenConfigs *psc; }; +struct __GLXDRIdrawablePrivateRec { + __GLXDRIdrawable base; + __DRIbuffer buffers[5]; + int bufferCount; + int width, height; +}; + static void dri2DestroyContext(__GLXDRIcontext *context, __GLXscreenConfigs *psc, Display *dpy) { @@ -104,7 +111,6 @@ static __GLXDRIcontext *dri2CreateContext(__GLXscreenConfigs *psc, { __GLXDRIcontextPrivate *pcp, *pcp_shared; __GLXDRIconfigPrivate *config = (__GLXDRIconfigPrivate *) mode; - const __DRIcoreExtension *core = psc->core; __DRIcontext *shared = NULL; if (shareList) { @@ -118,8 +124,8 @@ static __GLXDRIcontext *dri2CreateContext(__GLXscreenConfigs *psc, pcp->psc = psc; pcp->driContext = - (*core->createNewContext)(psc->__driScreen, - config->driConfig, shared, pcp); + (*psc->dri2->createNewContext)(psc->__driScreen, + config->driConfig, shared, pcp); gc->__driContext = pcp->driContext; if (pcp->driContext == NULL) { @@ -148,45 +154,40 @@ static __GLXDRIdrawable *dri2CreateDrawable(__GLXscreenConfigs *psc, GLXDrawable drawable, const __GLcontextModes *modes) { - __GLXDRIdrawable *pdraw; + __GLXDRIdrawablePrivate *pdraw; __GLXDRIconfigPrivate *config = (__GLXDRIconfigPrivate *) modes; - unsigned int handle, head; - const __DRIcoreExtension *core = psc->core; pdraw = Xmalloc(sizeof(*pdraw)); if (!pdraw) return NULL; - pdraw->destroyDrawable = dri2DestroyDrawable; - pdraw->xDrawable = xDrawable; - pdraw->drawable = drawable; - pdraw->psc = psc; - - fprintf(stderr, "calling DRI2CreateDrawable, XID 0x%lx, GLX ID 0x%lx\n", - xDrawable, drawable); - - if (!DRI2CreateDrawable(psc->dpy, xDrawable, &handle, &head)) { - Xfree(pdraw); - return NULL; - } + pdraw->base.destroyDrawable = dri2DestroyDrawable; + pdraw->base.xDrawable = xDrawable; + pdraw->base.drawable = drawable; + pdraw->base.psc = psc; - fprintf(stderr, "success, head 0x%x, handle 0x%x\n", head, handle); + DRI2CreateDrawable(psc->dpy, xDrawable); /* Create a new drawable */ - pdraw->driDrawable = - (*core->createNewDrawable)(psc->__driScreen, - config->driConfig, - handle, - head, - pdraw); - - if (!pdraw->driDrawable) { + pdraw->base.driDrawable = + (*psc->dri2->createNewDrawable)(psc->__driScreen, + config->driConfig, pdraw); + + if (!pdraw->base.driDrawable) { DRI2DestroyDrawable(psc->dpy, drawable); Xfree(pdraw); return NULL; } - return pdraw; + return &pdraw->base; +} + +static void dri2SwapBuffers(__GLXDRIdrawable *pdraw) +{ + __GLXDRIdrawablePrivate *priv = (__GLXDRIdrawablePrivate *) pdraw; + + DRI2SwapBuffers(pdraw->psc->dpy, pdraw->drawable, + 0, 0, priv->width, priv->height); } static void dri2DestroyScreen(__GLXscreenConfigs *psc) @@ -197,46 +198,42 @@ static void dri2DestroyScreen(__GLXscreenConfigs *psc) psc->__driScreen = NULL; } - -static void dri2ReemitDrawableInfo(__DRIdrawable *draw, unsigned int *tail, - void *loaderPrivate) +static __DRIbuffer * +dri2GetBuffers(__DRIdrawable *driDrawable, + int *width, int *height, + unsigned int *attachments, int count, + int *out_count, void *loaderPrivate) { - __GLXDRIdrawable *pdraw = loaderPrivate; - - DRI2ReemitDrawableInfo(pdraw->psc->dpy, pdraw->drawable, tail); -} - -static void dri2PostDamage(__DRIdrawable *draw, - struct drm_clip_rect *rects, - int numRects, void *loaderPrivate) -{ - XRectangle *xrects; - XserverRegion region; - __GLXDRIdrawable *glxDraw = loaderPrivate; - __GLXscreenConfigs *psc = glxDraw->psc; - Display *dpy = psc->dpy; + __GLXDRIdrawablePrivate *pdraw = loaderPrivate; + DRI2Buffer *buffers; int i; - xrects = malloc(sizeof(XRectangle) * numRects); - if (xrects == NULL) - return; - - for (i = 0; i < numRects; i++) { - xrects[i].x = rects[i].x1; - xrects[i].y = rects[i].y1; - xrects[i].width = rects[i].x2 - rects[i].x1; - xrects[i].height = rects[i].y2 - rects[i].y1; + buffers = DRI2GetBuffers(pdraw->base.psc->dpy, pdraw->base.xDrawable, + width, height, attachments, count, out_count); + if (buffers == NULL) + return NULL; + + pdraw->width = *width; + pdraw->height = *height; + + /* This assumes the DRI2 buffer attachment tokens matches the + * __DRIbuffer tokens. */ + for (i = 0; i < *out_count; i++) { + pdraw->buffers[i].attachment = buffers[i].attachment; + pdraw->buffers[i].name = buffers[i].name; + pdraw->buffers[i].pitch = buffers[i].pitch; + pdraw->buffers[i].cpp = buffers[i].cpp; + pdraw->buffers[i].flags = buffers[i].flags; } - region = XFixesCreateRegion(dpy, xrects, numRects); - free(xrects); - XDamageAdd(dpy, glxDraw->xDrawable, region); - XFixesDestroyRegion(dpy, region); + + Xfree(buffers); + + return pdraw->buffers; } -static const __DRIloaderExtension dri2LoaderExtension = { - { __DRI_LOADER, __DRI_LOADER_VERSION }, - dri2ReemitDrawableInfo, - dri2PostDamage +static const __DRIdri2LoaderExtension dri2LoaderExtension = { + { __DRI_DRI2_LOADER, __DRI_DRI2_LOADER_VERSION }, + dri2GetBuffers, }; static const __DRIextension *loader_extensions[] = { @@ -279,10 +276,12 @@ static __GLXDRIscreen *dri2CreateScreen(__GLXscreenConfigs *psc, int screen, for (i = 0; extensions[i]; i++) { if (strcmp(extensions[i]->name, __DRI_CORE) == 0) psc->core = (__DRIcoreExtension *) extensions[i]; + if (strcmp(extensions[i]->name, __DRI_DRI2) == 0) + psc->dri2 = (__DRIdri2Extension *) extensions[i]; } - if (psc->core == NULL) { - ErrorMessageF("core dri extension not found\n"); + if (psc->core == NULL || psc->dri2 == NULL) { + ErrorMessageF("core dri or dri2 extension not found\n"); goto handle_error; } @@ -301,7 +300,7 @@ static __GLXDRIscreen *dri2CreateScreen(__GLXscreenConfigs *psc, int screen, } psc->__driScreen = - psc->core->createNewScreen(screen, psc->fd, sareaHandle, + psc->dri2->createNewScreen(screen, psc->fd, loader_extensions, &driver_configs, psc); if (psc->__driScreen == NULL) { ErrorMessageF("failed to create dri screen\n"); @@ -316,6 +315,7 @@ static __GLXDRIscreen *dri2CreateScreen(__GLXscreenConfigs *psc, int screen, psp->destroyScreen = dri2DestroyScreen; psp->createContext = dri2CreateContext; psp->createDrawable = dri2CreateDrawable; + psp->swapBuffers = dri2SwapBuffers; Xfree(driverName); Xfree(busID); diff --git a/src/glx/x11/dri_common.c b/src/glx/x11/dri_common.c index 8175f46c54..fbce6ac3e3 100644 --- a/src/glx/x11/dri_common.c +++ b/src/glx/x11/dri_common.c @@ -37,7 +37,7 @@ #include <unistd.h> #include <dlfcn.h> -#include "glheader.h" +#include <stdarg.h> #include "glxclient.h" #include "glcontextmodes.h" #include "dri_common.h" diff --git a/src/glx/x11/dri_glx.c b/src/glx/x11/dri_glx.c index 82653f1625..47203f5008 100644 --- a/src/glx/x11/dri_glx.c +++ b/src/glx/x11/dri_glx.c @@ -37,7 +37,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include <X11/Xlib.h> #include <X11/extensions/Xfixes.h> #include <X11/extensions/Xdamage.h> -#include "glheader.h" #include "glxclient.h" #include "glcontextmodes.h" #include "xf86dri.h" @@ -445,6 +444,7 @@ static void driDestroyContext(__GLXDRIcontext *context, (*psc->core->destroyContext)(pcp->driContext); XF86DRIDestroyContext(psc->dpy, psc->scr, pcp->hwContextID); + Xfree(pcp); } static Bool driBindContext(__GLXDRIcontext *context, @@ -569,6 +569,11 @@ static __GLXDRIdrawable *driCreateDrawable(__GLXscreenConfigs *psc, return pdraw; } +static void driSwapBuffers(__GLXDRIdrawable *pdraw) +{ + (*pdraw->psc->core->swapBuffers)(pdraw->driDrawable); +} + static void driDestroyScreen(__GLXscreenConfigs *psc) { /* Free the direct rendering per screen data */ @@ -640,6 +645,7 @@ static __GLXDRIscreen *driCreateScreen(__GLXscreenConfigs *psc, int screen, psp->destroyScreen = driDestroyScreen; psp->createContext = driCreateContext; psp->createDrawable = driCreateDrawable; + psp->swapBuffers = driSwapBuffers; return psp; } diff --git a/src/glx/x11/drisw_glx.c b/src/glx/x11/drisw_glx.c index bcf7e144ef..7bb4794f30 100644 --- a/src/glx/x11/drisw_glx.c +++ b/src/glx/x11/drisw_glx.c @@ -24,7 +24,6 @@ #ifdef GLX_DIRECT_RENDERING #include <X11/Xlib.h> -#include "glheader.h" #include "glxclient.h" #include "glcontextmodes.h" #include <dlfcn.h> @@ -335,6 +334,11 @@ static __GLXDRIdrawable *driCreateDrawable(__GLXscreenConfigs *psc, return pdraw; } +static void driSwapBuffers(__GLXDRIdrawable *pdraw) +{ + (*pdraw->psc->core->swapBuffers)(pdraw->driDrawable); +} + static void driDestroyScreen(__GLXscreenConfigs *psc) { /* Free the direct rendering per screen data */ @@ -398,6 +402,7 @@ static __GLXDRIscreen *driCreateScreen(__GLXscreenConfigs *psc, int screen, psp->destroyScreen = driDestroyScreen; psp->createContext = driCreateContext; psp->createDrawable = driCreateDrawable; + psp->swapBuffers = driSwapBuffers; return psp; diff --git a/src/glx/x11/eval.c b/src/glx/x11/eval.c index 0f94e6da6f..58075e2231 100644 --- a/src/glx/x11/eval.c +++ b/src/glx/x11/eval.c @@ -1,38 +1,32 @@ -/* $XFree86$ */ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ #include "packrender.h" diff --git a/src/glx/x11/glx_pbuffer.c b/src/glx/x11/glx_pbuffer.c index 0f878f223f..fb2610a490 100644 --- a/src/glx/x11/glx_pbuffer.c +++ b/src/glx/x11/glx_pbuffer.c @@ -38,7 +38,6 @@ #include "glapi.h" #include "glxextensions.h" #include "glcontextmodes.h" -#include "glheader.h" /** diff --git a/src/glx/x11/glxclient.h b/src/glx/x11/glxclient.h index b0a5d1315a..ad77b92df6 100644 --- a/src/glx/x11/glxclient.h +++ b/src/glx/x11/glxclient.h @@ -1,37 +1,32 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ -/* $XFree86: xc/lib/GL/glx/glxclient.h,v 1.21 2004/02/09 23:46:31 alanh Exp $ */ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /** * \file glxclient.h @@ -58,7 +53,7 @@ #include "GL/glxint.h" #include "GL/glxproto.h" #include "GL/internal/glcore.h" -#include "glapitable.h" +#include "glapi/glapitable.h" #include "glxhash.h" #if defined( USE_XTHREADS ) # include <X11/Xthreads.h> @@ -66,6 +61,25 @@ # include <pthread.h> #endif +#include "glxextensions.h" + + +/* If we build the library with gcc's -fvisibility=hidden flag, we'll + * use the PUBLIC macro to mark functions that are to be exported. + * + * We also need to define a USED attribute, so the optimizer doesn't + * inline a static function that we later use in an alias. - ajax + */ +#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303 +# define PUBLIC __attribute__((visibility("default"))) +# define USED __attribute__((used)) +#else +# define PUBLIC +# define USED +#endif + + + #define GLX_MAJOR_VERSION 1 /* current version numbers */ #define GLX_MINOR_VERSION 4 @@ -121,6 +135,8 @@ struct __GLXDRIscreenRec { XID drawable, GLXDrawable glxDrawable, const __GLcontextModes *modes); + + void (*swapBuffers)(__GLXDRIdrawable *pdraw); }; struct __GLXDRIcontextRec { @@ -139,8 +155,8 @@ struct __GLXDRIdrawableRec { XID xDrawable; XID drawable; __GLXscreenConfigs *psc; - __DRIdrawable *driDrawable; GLenum textureTarget; + __DRIdrawable *driDrawable; }; /* @@ -467,6 +483,7 @@ struct __GLXscreenConfigsRec { const __DRIcoreExtension *core; const __DRIlegacyExtension *legacy; const __DRIswrastExtension *swrast; + const __DRIdri2Extension *dri2; __glxHashTable *drawHash; Display *dpy; int scr, fd; @@ -693,9 +710,10 @@ extern void __glEmptyImage(__GLXcontext*, GLint, GLint, GLint, GLint, GLenum, /* -** Allocate and Initialize Vertex Array client state +** Allocate and Initialize Vertex Array client state, and free. */ -extern void __glXInitVertexArrayState(__GLXcontext*); +extern void __glXInitVertexArrayState(__GLXcontext *); +extern void __glXFreeVertexArrayState(__GLXcontext *); /* ** Inform the Server of the major and minor numbers and of the client diff --git a/src/glx/x11/glxcmds.c b/src/glx/x11/glxcmds.c index 2110b2cd86..cac39a5904 100644 --- a/src/glx/x11/glxcmds.c +++ b/src/glx/x11/glxcmds.c @@ -1,38 +1,32 @@ -/* $XFree86: xc/lib/GL/glx/glxcmds.c,v 1.30 2004/01/30 20:33:06 alanh Exp $ */ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /** * \file glxcmds.c @@ -43,7 +37,6 @@ #include "glapi.h" #include "glxextensions.h" #include "glcontextmodes.h" -#include "glheader.h" #ifdef GLX_DIRECT_RENDERING #include <sys/time.h> @@ -423,7 +416,11 @@ CreateContext(Display *dpy, XVisualInfo *vis, req->visual = vis->visualid; req->screen = vis->screen; req->shareList = shareList ? shareList->xid : None; +#ifdef GLX_DIRECT_RENDERING req->isDirect = gc->driContext != NULL; +#else + req->isDirect = 0; +#endif } else if ( use_glx_1_3 ) { xGLXCreateNewContextReq *req; @@ -437,7 +434,11 @@ CreateContext(Display *dpy, XVisualInfo *vis, req->screen = fbconfig->screen; req->renderType = renderType; req->shareList = shareList ? shareList->xid : None; +#ifdef GLX_DIRECT_RENDERING req->isDirect = gc->driContext != NULL; +#else + req->isDirect = 0; +#endif } else { xGLXVendorPrivateWithReplyReq *vpreq; @@ -455,7 +456,11 @@ CreateContext(Display *dpy, XVisualInfo *vis, req->screen = fbconfig->screen; req->renderType = renderType; req->shareList = shareList ? shareList->xid : None; +#ifdef GLX_DIRECT_RENDERING req->isDirect = gc->driContext != NULL; +#else + req->isDirect = 0; +#endif } UnlockDisplay(dpy); @@ -520,6 +525,8 @@ DestroyContext(Display *dpy, GLXContext gc) } #endif + __glXFreeVertexArrayState(gc); + if (gc->currentDpy) { /* Have to free later cuz it's in use now */ __glXUnlock(); @@ -841,7 +848,8 @@ PUBLIC void glXSwapBuffers(Display *dpy, GLXDrawable drawable) __GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable, NULL); if (pdraw != NULL) { - (*pdraw->psc->core->swapBuffers)(pdraw->driDrawable); + glFlush(); + (*pdraw->psc->driScreen->swapBuffers)(pdraw); return; } #endif @@ -1525,7 +1533,11 @@ glXQueryContext(Display *dpy, GLXContext ctx, int attribute, int *value) int retVal; /* get the information from the server if we don't have it already */ +#ifdef GLX_DIRECT_RENDERING if (!ctx->driContext && (ctx->mode == NULL)) { +#else + if (ctx->mode == NULL) { +#endif retVal = __glXQueryContextInfo(dpy, ctx); if (Success != retVal) return retVal; } diff --git a/src/glx/x11/glxcurrent.c b/src/glx/x11/glxcurrent.c index ad648fd438..67fba59a3f 100644 --- a/src/glx/x11/glxcurrent.c +++ b/src/glx/x11/glxcurrent.c @@ -1,37 +1,32 @@ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /** * \file glxcurrent.c @@ -40,7 +35,6 @@ #include "glxclient.h" #include "glapi.h" -#include "glheader.h" #include "indirect_init.h" #ifdef GLX_DIRECT_RENDERING @@ -399,8 +393,12 @@ static Bool MakeContextCurrent(Display *dpy, GLXDrawable draw, return False; } +#ifdef GLX_DIRECT_RENDERING if ((dpy != oldGC->currentDpy || (gc && gc->driContext)) && !oldGC->isDirect && oldGC != &dummyContext) { +#else + if ((dpy != oldGC->currentDpy) && oldGC != &dummyContext) { +#endif xGLXMakeCurrentReply dummy_reply; /* We are either switching from one dpy to another and have to @@ -462,7 +460,9 @@ static Bool MakeContextCurrent(Display *dpy, GLXDrawable draw, gc->currentDrawable = draw; gc->currentReadable = read; +#ifdef GLX_DIRECT_RENDERING if (!gc->driContext) { +#endif if (!IndirectAPI) IndirectAPI = __glXNewIndirectAPI(); _glapi_set_dispatch(IndirectAPI); @@ -483,10 +483,12 @@ static Bool MakeContextCurrent(Display *dpy, GLXDrawable draw, (void) glGetString(GL_VERSION); __glXInitVertexArrayState(gc); } +#ifdef GLX_DIRECT_RENDERING } else { gc->currentContextTag = -1; } +#endif } else { __glXSetCurrentContextNull(); } diff --git a/src/glx/x11/glxext.c b/src/glx/x11/glxext.c index d13d636699..eaf1ec2dfd 100644 --- a/src/glx/x11/glxext.c +++ b/src/glx/x11/glxext.c @@ -1,39 +1,32 @@ -/* $XFree86: xc/lib/GL/glx/glxext.c,v 1.22 2003/12/08 17:35:28 dawes Exp $ */ - /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /** * \file glxext.c @@ -44,13 +37,13 @@ * \author Kevin E. Martin <kevin@precisioninsight.com> */ +#include <assert.h> #include "glxclient.h" #include <X11/extensions/Xext.h> #include <X11/extensions/extutil.h> #include "glapi.h" #include "glxextensions.h" #include "glcontextmodes.h" -#include "glheader.h" #ifdef USE_XCB #include <X11/Xlib-xcb.h> @@ -156,21 +149,27 @@ static void FreeScreenConfigs(__GLXdisplayPrivate *priv) for (i = 0; i < screens; i++, psc++) { if (psc->configs) { _gl_context_modes_destroy( psc->configs ); - if(psc->effectiveGLXexts) + if (psc->effectiveGLXexts) Xfree(psc->effectiveGLXexts); - psc->configs = NULL; /* NOTE: just for paranoia */ } - Xfree((char*) psc->serverGLXexts); + if (psc->visuals) { + _gl_context_modes_destroy( psc->visuals ); + psc->visuals = NULL; /* NOTE: just for paranoia */ + } + Xfree((char*) psc->serverGLXexts); #ifdef GLX_DIRECT_RENDERING if (psc->driScreen) { psc->driScreen->destroyScreen(psc); __glxHashDestroy(psc->drawHash); + XFree(psc->driScreen); + psc->driScreen = NULL; } #endif } XFree((char*) priv->screenConfigs); + priv->screenConfigs = NULL; } /* @@ -595,9 +594,9 @@ static Bool AllocAndFetchScreenConfigs(Display *dpy, __GLXdisplayPrivate *priv) getVisualConfigs(dpy, priv, i); getFBConfigs(dpy, priv, i); +#ifdef GLX_DIRECT_RENDERING psc->scr = i; psc->dpy = dpy; -#ifdef GLX_DIRECT_RENDERING psc->drawHash = __glxHashCreate(); if (psc->drawHash == NULL) continue; diff --git a/src/glx/x11/glxextensions.c b/src/glx/x11/glxextensions.c index e843718472..f2b169a0e4 100644 --- a/src/glx/x11/glxextensions.c +++ b/src/glx/x11/glxextensions.c @@ -34,7 +34,7 @@ #include <string.h> #include "glapi.h" #include "glxextensions.h" -#include "simple_list.h" + #define SET_BIT(m,b) (m[ (b) / 8 ] |= (1U << ((b) % 8))) #define CLR_BIT(m,b) (m[ (b) / 8 ] &= ~(1U << ((b) % 8))) diff --git a/src/glx/x11/glxextensions.h b/src/glx/x11/glxextensions.h index 9cdd05ed76..b99cebbdfa 100644 --- a/src/glx/x11/glxextensions.h +++ b/src/glx/x11/glxextensions.h @@ -244,7 +244,7 @@ extern GLboolean __glExtensionBitIsEnabled( const struct __GLXcontextRec * gc, unsigned bit ); extern void -__glXEnableDirectExtension(__GLXscreenConfigs *psc, const char *name); +__glXEnableDirectExtension(struct __GLXscreenConfigsRec *psc, const char *name); /* Source-level backwards compatibility with old drivers. They won't * find the respective functions, though. diff --git a/src/glx/x11/glxhash.c b/src/glx/x11/glxhash.c index 9ed0429032..b7b8fb2738 100644 --- a/src/glx/x11/glxhash.c +++ b/src/glx/x11/glxhash.c @@ -101,7 +101,6 @@ typedef struct __glxHashBucket { typedef struct __glxHashTable *__glxHashTablePtr; struct __glxHashTable { unsigned long magic; - unsigned long entries; unsigned long hits; /* At top of linked list */ unsigned long partials; /* Not at top of linked list */ unsigned long misses; /* Not in table */ @@ -146,7 +145,6 @@ _X_HIDDEN __glxHashTable *__glxHashCreate(void) table = HASH_ALLOC(sizeof(*table)); if (!table) return NULL; table->magic = HASH_MAGIC; - table->entries = 0; table->hits = 0; table->partials = 0; table->misses = 0; @@ -319,8 +317,8 @@ static void compute_dist(__glxHashTablePtr table) int i; __glxHashBucketPtr bucket; - printf("Entries = %ld, hits = %ld, partials = %ld, misses = %ld\n", - table->entries, table->hits, table->partials, table->misses); + printf("Hits = %ld, partials = %ld, misses = %ld\n", + table->hits, table->partials, table->misses); clear_dist(); for (i = 0; i < HASH_SIZE; i++) { bucket = table->buckets[i]; diff --git a/src/glx/x11/indirect.c b/src/glx/x11/indirect.c index 871adddb95..3228e2d6fc 100644 --- a/src/glx/x11/indirect.c +++ b/src/glx/x11/indirect.c @@ -5124,10 +5124,13 @@ glAreTexturesResidentEXT(GLsizei n, const GLuint * textures, { __GLXcontext *const gc = __glXGetCurrentContext(); +#ifdef GLX_DIRECT_RENDERING if (gc->driContext) { return CALL_AreTexturesResident(GET_DISPATCH(), (n, textures, residences)); - } else { + } else +#endif + { __GLXcontext *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; GLboolean retval = (GLboolean) 0; @@ -5274,9 +5277,12 @@ glDeleteTexturesEXT(GLsizei n, const GLuint * textures) { __GLXcontext *const gc = __glXGetCurrentContext(); +#ifdef GLX_DIRECT_RENDERING if (gc->driContext) { CALL_DeleteTextures(GET_DISPATCH(), (n, textures)); - } else { + } else +#endif + { __GLXcontext *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; const GLuint cmdlen = 4 + __GLX_PAD((n * 4)); @@ -5342,9 +5348,12 @@ glGenTexturesEXT(GLsizei n, GLuint * textures) { __GLXcontext *const gc = __glXGetCurrentContext(); +#ifdef GLX_DIRECT_RENDERING if (gc->driContext) { CALL_GenTextures(GET_DISPATCH(), (n, textures)); - } else { + } else +#endif + { __GLXcontext *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; const GLuint cmdlen = 4; @@ -5404,9 +5413,12 @@ glIsTextureEXT(GLuint texture) { __GLXcontext *const gc = __glXGetCurrentContext(); +#ifdef GLX_DIRECT_RENDERING if (gc->driContext) { return CALL_IsTexture(GET_DISPATCH(), (texture)); - } else { + } else +#endif + { __GLXcontext *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; GLboolean retval = (GLboolean) 0; @@ -5718,9 +5730,12 @@ glGetColorTableEXT(GLenum target, GLenum format, GLenum type, GLvoid * table) { __GLXcontext *const gc = __glXGetCurrentContext(); +#ifdef GLX_DIRECT_RENDERING if (gc->driContext) { CALL_GetColorTable(GET_DISPATCH(), (target, format, type, table)); - } else { + } else +#endif + { __GLXcontext *const gc = __glXGetCurrentContext(); const __GLXattribute *const state = gc->client_state_private; Display *const dpy = gc->currentDpy; @@ -5791,10 +5806,13 @@ glGetColorTableParameterfvEXT(GLenum target, GLenum pname, GLfloat * params) { __GLXcontext *const gc = __glXGetCurrentContext(); +#ifdef GLX_DIRECT_RENDERING if (gc->driContext) { CALL_GetColorTableParameterfv(GET_DISPATCH(), (target, pname, params)); - } else { + } else +#endif + { __GLXcontext *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; const GLuint cmdlen = 8; @@ -5861,10 +5879,13 @@ glGetColorTableParameterivEXT(GLenum target, GLenum pname, GLint * params) { __GLXcontext *const gc = __glXGetCurrentContext(); +#ifdef GLX_DIRECT_RENDERING if (gc->driContext) { CALL_GetColorTableParameteriv(GET_DISPATCH(), (target, pname, params)); - } else { + } else +#endif + { __GLXcontext *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; const GLuint cmdlen = 8; @@ -6184,10 +6205,13 @@ gl_dispatch_stub_356(GLenum target, GLenum format, GLenum type, { __GLXcontext *const gc = __glXGetCurrentContext(); +#ifdef GLX_DIRECT_RENDERING if (gc->driContext) { CALL_GetConvolutionFilter(GET_DISPATCH(), (target, format, type, image)); - } else { + } else +#endif + { __GLXcontext *const gc = __glXGetCurrentContext(); const __GLXattribute *const state = gc->client_state_private; Display *const dpy = gc->currentDpy; @@ -6259,10 +6283,13 @@ gl_dispatch_stub_357(GLenum target, GLenum pname, GLfloat * params) { __GLXcontext *const gc = __glXGetCurrentContext(); +#ifdef GLX_DIRECT_RENDERING if (gc->driContext) { CALL_GetConvolutionParameterfv(GET_DISPATCH(), (target, pname, params)); - } else { + } else +#endif + { __GLXcontext *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; const GLuint cmdlen = 8; @@ -6329,10 +6356,13 @@ gl_dispatch_stub_358(GLenum target, GLenum pname, GLint * params) { __GLXcontext *const gc = __glXGetCurrentContext(); +#ifdef GLX_DIRECT_RENDERING if (gc->driContext) { CALL_GetConvolutionParameteriv(GET_DISPATCH(), (target, pname, params)); - } else { + } else +#endif + { __GLXcontext *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; const GLuint cmdlen = 8; @@ -6406,10 +6436,13 @@ gl_dispatch_stub_361(GLenum target, GLboolean reset, GLenum format, { __GLXcontext *const gc = __glXGetCurrentContext(); +#ifdef GLX_DIRECT_RENDERING if (gc->driContext) { CALL_GetHistogram(GET_DISPATCH(), (target, reset, format, type, values)); - } else { + } else +#endif + { __GLXcontext *const gc = __glXGetCurrentContext(); const __GLXattribute *const state = gc->client_state_private; Display *const dpy = gc->currentDpy; @@ -6480,9 +6513,12 @@ gl_dispatch_stub_362(GLenum target, GLenum pname, GLfloat * params) { __GLXcontext *const gc = __glXGetCurrentContext(); +#ifdef GLX_DIRECT_RENDERING if (gc->driContext) { CALL_GetHistogramParameterfv(GET_DISPATCH(), (target, pname, params)); - } else { + } else +#endif + { __GLXcontext *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; const GLuint cmdlen = 8; @@ -6548,9 +6584,12 @@ gl_dispatch_stub_363(GLenum target, GLenum pname, GLint * params) { __GLXcontext *const gc = __glXGetCurrentContext(); +#ifdef GLX_DIRECT_RENDERING if (gc->driContext) { CALL_GetHistogramParameteriv(GET_DISPATCH(), (target, pname, params)); - } else { + } else +#endif + { __GLXcontext *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; const GLuint cmdlen = 8; @@ -6620,9 +6659,12 @@ gl_dispatch_stub_364(GLenum target, GLboolean reset, GLenum format, { __GLXcontext *const gc = __glXGetCurrentContext(); +#ifdef GLX_DIRECT_RENDERING if (gc->driContext) { CALL_GetMinmax(GET_DISPATCH(), (target, reset, format, type, values)); - } else { + } else +#endif + { __GLXcontext *const gc = __glXGetCurrentContext(); const __GLXattribute *const state = gc->client_state_private; Display *const dpy = gc->currentDpy; @@ -6691,9 +6733,12 @@ gl_dispatch_stub_365(GLenum target, GLenum pname, GLfloat * params) { __GLXcontext *const gc = __glXGetCurrentContext(); +#ifdef GLX_DIRECT_RENDERING if (gc->driContext) { CALL_GetMinmaxParameterfv(GET_DISPATCH(), (target, pname, params)); - } else { + } else +#endif + { __GLXcontext *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; const GLuint cmdlen = 8; @@ -6756,9 +6801,12 @@ gl_dispatch_stub_366(GLenum target, GLenum pname, GLint * params) { __GLXcontext *const gc = __glXGetCurrentContext(); +#ifdef GLX_DIRECT_RENDERING if (gc->driContext) { CALL_GetMinmaxParameteriv(GET_DISPATCH(), (target, pname, params)); - } else { + } else +#endif + { __GLXcontext *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; const GLuint cmdlen = 8; diff --git a/src/glx/x11/indirect_init.h b/src/glx/x11/indirect_init.h index 62d04ba6dc..72255f1301 100644 --- a/src/glx/x11/indirect_init.h +++ b/src/glx/x11/indirect_init.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/glx/indirect_init.h,v 1.2 2000/02/08 17:18:33 dawes Exp $ */ /************************************************************************** Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. diff --git a/src/glx/x11/indirect_vertex_array.c b/src/glx/x11/indirect_vertex_array.c index 15e3ece148..c7a20e2bc5 100644 --- a/src/glx/x11/indirect_vertex_array.c +++ b/src/glx/x11/indirect_vertex_array.c @@ -101,6 +101,31 @@ const GLuint __glXTypeSize_table[16] = { }; +/** + * Free the per-context array state that was allocated with + * __glXInitVertexArrayState(). + */ +void +__glXFreeVertexArrayState( __GLXcontext * gc ) +{ + __GLXattribute * state = (__GLXattribute *)(gc->client_state_private); + struct array_state_vector* arrays = state->array_state; + + if (arrays) { + if (arrays->stack) { + free(arrays->stack); + arrays->stack = NULL; + } + if (arrays->arrays) { + free(arrays->arrays); + arrays->arrays = NULL; + } + free(arrays); + arrays = NULL; + state->array_state = NULL; + } +} + /** * Initialize vertex array state of a GLX context. diff --git a/src/glx/x11/indirect_vertex_program.c b/src/glx/x11/indirect_vertex_program.c index 8d7cec9dd2..0a1091eaef 100644 --- a/src/glx/x11/indirect_vertex_program.c +++ b/src/glx/x11/indirect_vertex_program.c @@ -23,7 +23,6 @@ * SOFTWARE. */ -#include "glheader.h" #include <inttypes.h> #include <GL/gl.h> #include "indirect.h" @@ -193,7 +192,13 @@ void __indirect_glGetVertexAttribivARB( GLuint index, GLenum pname, get_vertex_attrib( gc, 1303, index, pname, (xReply *) & reply ); if ( reply.size != 0 ) { - if ( ! get_attrib_array_data( state, index, pname, params ) ) { + GLintptr data; + + + if ( get_attrib_array_data( state, index, pname, & data ) ) { + *params = (GLint) data; + } + else { if (reply.size == 1) { *params = (GLint) reply.pad3; } diff --git a/src/glx/x11/packrender.h b/src/glx/x11/packrender.h index ce2a1616de..cee827663a 100644 --- a/src/glx/x11/packrender.h +++ b/src/glx/x11/packrender.h @@ -1,41 +1,35 @@ -/* $XFree86: xc/lib/GL/glx/packrender.h,v 1.7tsi Exp $ */ #ifndef __GLX_packrender_h__ #define __GLX_packrender_h__ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ #include "glxclient.h" diff --git a/src/glx/x11/packsingle.h b/src/glx/x11/packsingle.h index 16b054f1e0..9dbf8ec914 100644 --- a/src/glx/x11/packsingle.h +++ b/src/glx/x11/packsingle.h @@ -1,41 +1,35 @@ -/* $XFree86: xc/lib/GL/glx/packsingle.h,v 1.5tsi Exp $ */ #ifndef __GLX_packsingle_h__ #define __GLX_packsingle_h__ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ #include "packrender.h" diff --git a/src/glx/x11/pixel.c b/src/glx/x11/pixel.c index 3b3a1811ab..2174305b0c 100644 --- a/src/glx/x11/pixel.c +++ b/src/glx/x11/pixel.c @@ -1,38 +1,32 @@ -/* $XFree86: xc/lib/GL/glx/pixel.c,v 1.8 2003/09/28 20:15:04 alanh Exp $ */ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ #include "packrender.h" diff --git a/src/glx/x11/pixelstore.c b/src/glx/x11/pixelstore.c index 8431b29e90..0bc16854ae 100644 --- a/src/glx/x11/pixelstore.c +++ b/src/glx/x11/pixelstore.c @@ -1,40 +1,33 @@ -/* $XFree86: xc/lib/GL/glx/pixelstore.c,v 1.4 2004/01/28 18:11:43 alanh Exp $ */ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ -#include "glheader.h" #include "glxclient.h" #include "indirect.h" diff --git a/src/glx/x11/render2.c b/src/glx/x11/render2.c index 21ba270998..025becbd19 100644 --- a/src/glx/x11/render2.c +++ b/src/glx/x11/render2.c @@ -1,38 +1,32 @@ -/* $XFree86: xc/lib/GL/glx/render2.c,v 1.6 2004/01/31 09:29:33 alanh Exp $ */ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ #include "packrender.h" #include "indirect.h" diff --git a/src/glx/x11/renderpix.c b/src/glx/x11/renderpix.c index b7d01dc679..0b7b77c742 100644 --- a/src/glx/x11/renderpix.c +++ b/src/glx/x11/renderpix.c @@ -1,38 +1,32 @@ -/* $XFree86: xc/lib/GL/glx/renderpix.c,v 1.5 2003/09/28 20:15:04 alanh Exp $ */ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ /* * (C) Copyright IBM Corporation 2005 diff --git a/src/glx/x11/single2.c b/src/glx/x11/single2.c index d535757a9e..a97d4c7def 100644 --- a/src/glx/x11/single2.c +++ b/src/glx/x11/single2.c @@ -1,38 +1,32 @@ -/* $XFree86: xc/lib/GL/glx/single2.c,v 1.10 2004/02/11 19:48:16 dawes Exp $ */ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ #include <stdio.h> #include <assert.h> diff --git a/src/glx/x11/singlepix.c b/src/glx/x11/singlepix.c index 5f97766637..a093931bd2 100644 --- a/src/glx/x11/singlepix.c +++ b/src/glx/x11/singlepix.c @@ -1,40 +1,33 @@ -/* $XFree86: xc/lib/GL/glx/singlepix.c,v 1.3 2001/03/21 16:04:39 dawes Exp $ */ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ - -#include "glheader.h" + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + #include "packsingle.h" #include "indirect.h" #include "dispatch.h" @@ -119,12 +112,14 @@ void NAME(_gloffset_GetSeparableFilter)(GLenum target, GLenum format, GLenum typ { __GLXcontext * const gc = __glXGetCurrentContext(); +#ifdef GLX_DIRECT_RENDERING if (gc->driContext) { CALL_GetSeparableFilter(GET_DISPATCH(), (target, format, type, row, column, span)); return; - } - else { + } else +#endif + { Display *const dpy = gc->currentDpy; const GLuint cmdlen = __GLX_PAD(13); diff --git a/src/glx/x11/vertarr.c b/src/glx/x11/vertarr.c index 483a166ea2..031aa48427 100644 --- a/src/glx/x11/vertarr.c +++ b/src/glx/x11/vertarr.c @@ -1,38 +1,32 @@ -/* $XFree86: xc/lib/GL/glx/vertarr.c,v 1.4 2001/03/25 05:32:00 tsi Exp $ */ /* -** 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: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ #include "glxclient.h" #include "indirect.h" diff --git a/src/glx/x11/xf86dri.h b/src/glx/x11/xf86dri.h index cd650b5829..2aec3211db 100644 --- a/src/glx/x11/xf86dri.h +++ b/src/glx/x11/xf86dri.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/dri/xf86dri.h,v 1.8 2002/10/30 12:51:25 alanh Exp $ */ /************************************************************************** Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. @@ -92,13 +91,13 @@ Bool XF86DRICreateContext( Display *dpy, int screen, Visual *visual, Bool XF86DRICreateContextWithConfig( Display *dpy, int screen, int configID, XID *ptr_to_returned_context_id, drm_context_t *hHWContext ); -extern GLboolean XF86DRIDestroyContext( Display *dpy, int screen, +extern Bool XF86DRIDestroyContext( Display *dpy, int screen, XID context_id ); -extern GLboolean XF86DRICreateDrawable( Display *dpy, int screen, +extern Bool XF86DRICreateDrawable( Display *dpy, int screen, XID drawable, drm_drawable_t *hHWDrawable ); -extern GLboolean XF86DRIDestroyDrawable( Display *dpy, int screen, +extern Bool XF86DRIDestroyDrawable( Display *dpy, int screen, XID drawable); Bool XF86DRIGetDrawableInfo( Display *dpy, int screen, Drawable drawable, diff --git a/src/glx/x11/xf86dristr.h b/src/glx/x11/xf86dristr.h index ac05b183b3..b834bd1a1a 100644 --- a/src/glx/x11/xf86dristr.h +++ b/src/glx/x11/xf86dristr.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/dri/xf86dristr.h,v 1.10 2002/10/30 12:51:25 alanh Exp $ */ /************************************************************************** Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. diff --git a/src/glx/x11/xfont.c b/src/glx/x11/xfont.c index b650c17c55..6ec8c2d6bf 100644 --- a/src/glx/x11/xfont.c +++ b/src/glx/x11/xfont.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/glx/xfont.c,v 1.6 2001/05/02 15:06:02 dawes Exp $ */ /* * Mesa 3-D graphics library * Version: 3.1 diff --git a/src/mesa/Makefile b/src/mesa/Makefile index 605e70083c..ba65ce695f 100644 --- a/src/mesa/Makefile +++ b/src/mesa/Makefile @@ -105,13 +105,13 @@ install-headers: install-libgl: default gl.pc install-headers $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR) $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig - $(INSTALL) $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME)* \ + $(INSTALL) $(TOP)/$(LIB_DIR)/$(GL_LIB_GLOB) \ $(DESTDIR)$(INSTALL_LIB_DIR) $(INSTALL) -m 644 gl.pc $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig install-osmesa: default $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR) - $(INSTALL) $(TOP)/$(LIB_DIR)/$(OSMESA_LIB_NAME)* \ + $(INSTALL) $(TOP)/$(LIB_DIR)/$(OSMESA_LIB_GLOB) \ $(DESTDIR)$(INSTALL_LIB_DIR) install-dri: default diff --git a/src/mesa/Makefile.mgw b/src/mesa/Makefile.mgw index 6244ded876..886b344ec9 100644 --- a/src/mesa/Makefile.mgw +++ b/src/mesa/Makefile.mgw @@ -154,7 +154,7 @@ DRIVER_SOURCES = \ endif endif -SOURCES = $(CORE_SOURCES) $(X86_SOURCES) $(COMMON_DRIVER_SOURCES) $(DRIVER_SOURCES) +SOURCES = $(MESA_SOURCES) $(GLAPI_SOURCES) $(X86_SOURCES) $(DRIVER_SOURCES) OBJECTS = $(addsuffix .o,$(basename $(SOURCES))) diff --git a/src/mesa/drivers/allegro/amesa.c b/src/mesa/drivers/allegro/amesa.c index c12d42148b..ade6251848 100644 --- a/src/mesa/drivers/allegro/amesa.c +++ b/src/mesa/drivers/allegro/amesa.c @@ -21,11 +21,11 @@ #include <stdio.h> #include <stdlib.h> #include <allegro.h> -#include "buffers.h" -#include "context.h" -#include "imports.h" -#include "matrix.h" -#include "mtypes.h" +#include "main/buffers.h" +#include "main/context.h" +#include "main/imports.h" +#include "main/matrix.h" +#include "main/mtypes.h" #include "GL/amesa.h" diff --git a/src/mesa/drivers/common/driverfuncs.c b/src/mesa/drivers/common/driverfuncs.c index e61b9f59cf..986f751bdc 100644 --- a/src/mesa/drivers/common/driverfuncs.c +++ b/src/mesa/drivers/common/driverfuncs.c @@ -23,35 +23,36 @@ */ -#include "glheader.h" -#include "imports.h" -#include "arrayobj.h" -#include "buffers.h" -#include "context.h" -#include "framebuffer.h" -#include "mipmap.h" -#include "queryobj.h" -#include "renderbuffer.h" -#include "texcompress.h" -#include "texformat.h" -#include "teximage.h" -#include "texobj.h" -#include "texstore.h" +#include "main/glheader.h" +#include "main/imports.h" +#include "main/arrayobj.h" +#include "main/buffers.h" +#include "main/context.h" +#include "main/framebuffer.h" +#include "main/mipmap.h" +#include "main/queryobj.h" +#include "main/renderbuffer.h" +#include "main/texcompress.h" +#include "main/texformat.h" +#include "main/teximage.h" +#include "main/texobj.h" +#include "main/texstore.h" #if FEATURE_ARB_vertex_buffer_object -#include "bufferobj.h" +#include "main/bufferobj.h" #endif #if FEATURE_EXT_framebuffer_object -#include "fbobject.h" -#include "texrender.h" +#include "main/fbobject.h" +#include "main/texrender.h" #endif #include "shader/program.h" #include "shader/prog_execute.h" #include "shader/shader_api.h" -#include "driverfuncs.h" #include "tnl/tnl.h" #include "swrast/swrast.h" +#include "driverfuncs.h" + /** @@ -80,6 +81,7 @@ _mesa_init_driver_functions(struct dd_function_table *driver) /* framebuffer/image functions */ driver->Clear = _swrast_Clear; driver->Accum = _swrast_Accum; + driver->RasterPos = _tnl_RasterPos; driver->DrawPixels = _swrast_DrawPixels; driver->ReadPixels = _swrast_ReadPixels; driver->CopyPixels = _swrast_CopyPixels; @@ -227,8 +229,10 @@ _mesa_init_driver_functions(struct dd_function_table *driver) /* query objects */ driver->NewQueryObject = _mesa_new_query_object; - driver->BeginQuery = NULL; - driver->EndQuery = NULL; + driver->DeleteQuery = _mesa_delete_query; + driver->BeginQuery = _mesa_begin_query; + driver->EndQuery = _mesa_end_query; + driver->WaitQuery = _mesa_wait_query; /* APPLE_vertex_array_object */ driver->NewArrayObject = _mesa_new_array_object; diff --git a/src/mesa/drivers/directfb/idirectfbgl_mesa.c b/src/mesa/drivers/directfb/idirectfbgl_mesa.c index a364ada1f1..93593403c1 100644 --- a/src/mesa/drivers/directfb/idirectfbgl_mesa.c +++ b/src/mesa/drivers/directfb/idirectfbgl_mesa.c @@ -36,16 +36,16 @@ #include <direct/interface.h> #undef CLAMP -#include "glheader.h" -#include "buffers.h" -#include "context.h" -#include "extensions.h" -#include "framebuffer.h" -#include "renderbuffer.h" -#include "imports.h" -#include "texformat.h" -#include "teximage.h" -#include "texstore.h" +#include "main/glheader.h" +#include "main/buffers.h" +#include "main/context.h" +#include "main/extensions.h" +#include "main/framebuffer.h" +#include "main/renderbuffer.h" +#include "main/imports.h" +#include "main/texformat.h" +#include "main/teximage.h" +#include "main/texstore.h" #include "vbo/vbo.h" #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" diff --git a/src/mesa/drivers/dos/dmesa.c b/src/mesa/drivers/dos/dmesa.c index ee87e63852..003c06a8ff 100644 --- a/src/mesa/drivers/dos/dmesa.c +++ b/src/mesa/drivers/dos/dmesa.c @@ -31,9 +31,9 @@ */ -#include "context.h" -#include "imports.h" -#include "mtypes.h" +#include "main/context.h" +#include "main/imports.h" +#include "main/mtypes.h" #include "video.h" diff --git a/src/mesa/drivers/dri/Makefile b/src/mesa/drivers/dri/Makefile index 3b3fcf11df..eef68825bc 100644 --- a/src/mesa/drivers/dri/Makefile +++ b/src/mesa/drivers/dri/Makefile @@ -40,8 +40,6 @@ install: dri.pc $(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 diff --git a/src/mesa/drivers/dri/Makefile.template b/src/mesa/drivers/dri/Makefile.template index 95eeecc7c4..2dc3664cc6 100644 --- a/src/mesa/drivers/dri/Makefile.template +++ b/src/mesa/drivers/dri/Makefile.template @@ -10,11 +10,6 @@ COMMON_SOURCES = \ ../common/xmlconfig.c \ ../common/drirenderbuffer.c -COMMON_BM_SOURCES = \ - ../common/dri_bufmgr.c \ - ../common/dri_bufmgr_fake.c - - ifeq ($(WINDOW_SYSTEM),dri) WINOBJ= WINLIB= @@ -44,10 +39,7 @@ SHARED_INCLUDES = \ -I$(TOP)/src/mesa/drivers/dri/common \ -Iserver \ -I$(TOP)/include \ - -I$(TOP)/include/GL/internal \ -I$(TOP)/src/mesa \ - -I$(TOP)/src/mesa/main \ - -I$(TOP)/src/mesa/glapi \ -I$(TOP)/src/egl/main \ -I$(TOP)/src/egl/drivers/dri \ $(LIBDRM_CFLAGS) diff --git a/src/mesa/drivers/dri/common/depthtmp.h b/src/mesa/drivers/dri/common/depthtmp.h index 55199abf6a..fd2dab3b42 100644 --- a/src/mesa/drivers/dri/common/depthtmp.h +++ b/src/mesa/drivers/dri/common/depthtmp.h @@ -29,7 +29,7 @@ static void TAG(WriteDepthSpan)( GLcontext *ctx, { HW_WRITE_LOCK() { - const GLuint *depth = (const GLuint *) values; + const VALUE_TYPE *depth = (const VALUE_TYPE *) values; GLint x1; GLint n1; LOCAL_DEPTH_VARS; @@ -134,7 +134,7 @@ static void TAG(WriteDepthPixels)( GLcontext *ctx, { HW_WRITE_LOCK() { - const GLuint *depth = (const GLuint *) values; + const VALUE_TYPE *depth = (const VALUE_TYPE *) values; GLuint i; LOCAL_DEPTH_VARS; @@ -180,7 +180,7 @@ static void TAG(ReadDepthSpan)( GLcontext *ctx, { HW_READ_LOCK() { - GLuint *depth = (GLuint *) values; + VALUE_TYPE *depth = (VALUE_TYPE *) values; GLint x1, n1; LOCAL_DEPTH_VARS; @@ -215,7 +215,7 @@ static void TAG(ReadDepthPixels)( GLcontext *ctx, { HW_READ_LOCK() { - GLuint *depth = (GLuint *) values; + VALUE_TYPE *depth = (VALUE_TYPE *) values; GLuint i; LOCAL_DEPTH_VARS; @@ -267,3 +267,4 @@ static void TAG(InitDepthPointers)(struct gl_renderbuffer *rb) #undef READ_DEPTH #endif #undef TAG +#undef VALUE_TYPE diff --git a/src/mesa/drivers/dri/common/dri_bufmgr_fake.c b/src/mesa/drivers/dri/common/dri_bufmgr_fake.c deleted file mode 100644 index 9bf3f3437c..0000000000 --- a/src/mesa/drivers/dri/common/dri_bufmgr_fake.c +++ /dev/null @@ -1,1245 +0,0 @@ -/************************************************************************** - * - * 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. - * - **************************************************************************/ - -/* Originally a fake version of the buffer manager so that we can - * prototype the changes in a driver fairly quickly, has been fleshed - * out to a fully functional interim solution. - * - * Basically wraps the old style memory management in the new - * programming interface, but is more expressive and avoids many of - * the bugs in the old texture manager. - */ -#include "mtypes.h" -#include "dri_bufmgr.h" -#include "drm.h" - -#include "simple_list.h" -#include "mm.h" -#include "imports.h" - -#define DBG(...) do { \ - if (bufmgr_fake->bufmgr.debug) \ - _mesa_printf(__VA_ARGS__); \ -} while (0) - -/* Internal flags: - */ -#define BM_NO_BACKING_STORE 0x00000001 -#define BM_NO_FENCE_SUBDATA 0x00000002 -#define BM_PINNED 0x00000004 - -/* Wrapper around mm.c's mem_block, which understands that you must - * wait for fences to expire before memory can be freed. This is - * specific to our use of memcpy for uploads - an upload that was - * processed through the command queue wouldn't need to care about - * fences. - */ -#define MAX_RELOCS 4096 - -struct fake_buffer_reloc -{ - /** Buffer object that the relocation points at. */ - dri_bo *target_buf; - /** Offset of the relocation entry within reloc_buf. */ - GLuint offset; - /** Cached value of the offset when we last performed this relocation. */ - GLuint last_target_offset; - /** Value added to target_buf's offset to get the relocation entry. */ - GLuint delta; - /** Flags to validate the target buffer under. */ - uint64_t validate_flags; -}; - -struct block { - struct block *next, *prev; - struct mem_block *mem; /* BM_MEM_AGP */ - - /** - * Marks that the block is currently in the aperture and has yet to be - * fenced. - */ - unsigned on_hardware:1; - /** - * Marks that the block is currently fenced (being used by rendering) and - * can't be freed until @fence is passed. - */ - unsigned fenced:1; - - /** Fence cookie for the block. */ - unsigned fence; /* Split to read_fence, write_fence */ - - dri_bo *bo; - void *virtual; -}; - -typedef struct _bufmgr_fake { - dri_bufmgr bufmgr; - - unsigned long low_offset; - unsigned long size; - void *virtual; - - struct mem_block *heap; - struct block lru; /* only allocated, non-fence-pending blocks here */ - - unsigned buf_nr; /* for generating ids */ - - struct block on_hardware; /* after bmValidateBuffers */ - struct block fenced; /* after bmFenceBuffers (mi_flush, emit irq, write dword) */ - /* then to bufmgr->lru or free() */ - - unsigned int last_fence; - - unsigned fail:1; - unsigned need_fence:1; - GLboolean thrashing; - - /** - * Driver callback to emit a fence, returning the cookie. - * - * Currently, this also requires that a write flush be emitted before - * emitting the fence, but this should change. - */ - unsigned int (*fence_emit)(void *private); - /** Driver callback to wait for a fence cookie to have passed. */ - int (*fence_wait)(void *private, unsigned int fence_cookie); - /** Driver-supplied argument to driver callbacks */ - void *driver_priv; - - GLboolean debug; - - GLboolean performed_rendering; - - /* keep track of the current total size of objects we have relocs for */ - unsigned long current_total_size; -} dri_bufmgr_fake; - -typedef struct _dri_bo_fake { - dri_bo bo; - - unsigned id; /* debug only */ - const char *name; - - unsigned dirty:1; - unsigned size_accounted:1; /*this buffers size has been accounted against the aperture */ - unsigned card_dirty:1; /* has the card written to this buffer - we make need to copy it back */ - unsigned int refcount; - /* Flags may consist of any of the DRM_BO flags, plus - * DRM_BO_NO_BACKING_STORE and BM_NO_FENCE_SUBDATA, which are the first two - * driver private flags. - */ - uint64_t flags; - unsigned int alignment; - GLboolean is_static, validated; - unsigned int map_count; - - /* Flags for the buffer to be validated with in command submission */ - uint64_t validate_flags; - - /** relocation list */ - struct fake_buffer_reloc *relocs; - GLuint nr_relocs; - - struct block *block; - void *backing_store; - void (*invalidate_cb)(dri_bo *bo, void *ptr); - void *invalidate_ptr; -} dri_bo_fake; - -typedef struct _dri_fence_fake { - dri_fence fence; - - const char *name; - unsigned int refcount; - unsigned int fence_cookie; - GLboolean flushed; -} dri_fence_fake; - -static int clear_fenced(dri_bufmgr_fake *bufmgr_fake, - unsigned int fence_cookie); - -static int dri_fake_check_aperture_space(dri_bo *bo); - -#define MAXFENCE 0x7fffffff - -static GLboolean FENCE_LTE( unsigned a, unsigned b ) -{ - if (a == b) - return GL_TRUE; - - if (a < b && b - a < (1<<24)) - return GL_TRUE; - - if (a > b && MAXFENCE - a + b < (1<<24)) - return GL_TRUE; - - return GL_FALSE; -} - -static unsigned int -_fence_emit_internal(dri_bufmgr_fake *bufmgr_fake) -{ - bufmgr_fake->last_fence = bufmgr_fake->fence_emit(bufmgr_fake->driver_priv); - return bufmgr_fake->last_fence; -} - -static void -_fence_wait_internal(dri_bufmgr_fake *bufmgr_fake, unsigned int cookie) -{ - int ret; - - ret = bufmgr_fake->fence_wait(bufmgr_fake->driver_priv, cookie); - if (ret != 0) { - _mesa_printf("%s:%d: Error %d waiting for fence.\n", - __FILE__, __LINE__); - abort(); - } - clear_fenced(bufmgr_fake, cookie); -} - -static GLboolean -_fence_test(dri_bufmgr_fake *bufmgr_fake, unsigned fence) -{ - /* Slight problem with wrap-around: - */ - return fence == 0 || FENCE_LTE(fence, bufmgr_fake->last_fence); -} - -/** - * Allocate a memory manager block for the buffer. - */ -static GLboolean -alloc_block(dri_bo *bo) -{ - dri_bo_fake *bo_fake = (dri_bo_fake *)bo; - dri_bufmgr_fake *bufmgr_fake= (dri_bufmgr_fake *)bo->bufmgr; - struct block *block = (struct block *)calloc(sizeof *block, 1); - unsigned int align_log2 = _mesa_ffs(bo_fake->alignment) - 1; - GLuint sz; - - if (!block) - return GL_FALSE; - - sz = (bo->size + bo_fake->alignment - 1) & ~(bo_fake->alignment - 1); - - block->mem = mmAllocMem(bufmgr_fake->heap, sz, align_log2, 0); - if (!block->mem) { - free(block); - return GL_FALSE; - } - - make_empty_list(block); - - /* Insert at head or at tail??? - */ - insert_at_tail(&bufmgr_fake->lru, block); - - block->virtual = bufmgr_fake->virtual + - block->mem->ofs - bufmgr_fake->low_offset; - block->bo = bo; - - bo_fake->block = block; - - return GL_TRUE; -} - -/* Release the card storage associated with buf: - */ -static void free_block(dri_bufmgr_fake *bufmgr_fake, struct block *block) -{ - dri_bo_fake *bo_fake; - DBG("free block %p %08x %d %d\n", block, block->mem->ofs, block->on_hardware, block->fenced); - - if (!block) - return; - - bo_fake = (dri_bo_fake *)block->bo; - if (!(bo_fake->flags & BM_NO_BACKING_STORE) && (bo_fake->card_dirty == 1)) { - memcpy(bo_fake->backing_store, block->virtual, block->bo->size); - bo_fake->card_dirty = 1; - bo_fake->dirty = 1; - } - - if (block->on_hardware) { - block->bo = NULL; - } - else if (block->fenced) { - block->bo = NULL; - } - else { - DBG(" - free immediately\n"); - remove_from_list(block); - - mmFreeMem(block->mem); - free(block); - } -} - -static void -alloc_backing_store(dri_bo *bo) -{ - dri_bufmgr_fake *bufmgr_fake = (dri_bufmgr_fake *)bo->bufmgr; - dri_bo_fake *bo_fake = (dri_bo_fake *)bo; - assert(!bo_fake->backing_store); - assert(!(bo_fake->flags & (BM_PINNED|BM_NO_BACKING_STORE))); - - bo_fake->backing_store = ALIGN_MALLOC(bo->size, 64); - - DBG("alloc_backing - buf %d %p %d\n", bo_fake->id, bo_fake->backing_store, bo->size); - assert(bo_fake->backing_store); -} - -static void -free_backing_store(dri_bo *bo) -{ - dri_bo_fake *bo_fake = (dri_bo_fake *)bo; - - if (bo_fake->backing_store) { - assert(!(bo_fake->flags & (BM_PINNED|BM_NO_BACKING_STORE))); - ALIGN_FREE(bo_fake->backing_store); - bo_fake->backing_store = NULL; - } -} - -static void -set_dirty(dri_bo *bo) -{ - dri_bufmgr_fake *bufmgr_fake = (dri_bufmgr_fake *)bo->bufmgr; - dri_bo_fake *bo_fake = (dri_bo_fake *)bo; - - if (bo_fake->flags & BM_NO_BACKING_STORE && bo_fake->invalidate_cb != NULL) - bo_fake->invalidate_cb(bo, bo_fake->invalidate_ptr); - - assert(!(bo_fake->flags & BM_PINNED)); - - DBG("set_dirty - buf %d\n", bo_fake->id); - bo_fake->dirty = 1; -} - -static GLboolean -evict_lru(dri_bufmgr_fake *bufmgr_fake, GLuint max_fence) -{ - struct block *block, *tmp; - - DBG("%s\n", __FUNCTION__); - - foreach_s(block, tmp, &bufmgr_fake->lru) { - dri_bo_fake *bo_fake = (dri_bo_fake *)block->bo; - - if (bo_fake != NULL && (bo_fake->flags & BM_NO_FENCE_SUBDATA)) - continue; - - if (block->fence && max_fence && !FENCE_LTE(block->fence, max_fence)) - return 0; - - set_dirty(&bo_fake->bo); - bo_fake->block = NULL; - - free_block(bufmgr_fake, block); - return GL_TRUE; - } - - return GL_FALSE; -} - -#define foreach_s_rev(ptr, t, list) \ - for(ptr=(list)->prev,t=(ptr)->prev; list != ptr; ptr=t, t=(t)->prev) - -static GLboolean -evict_mru(dri_bufmgr_fake *bufmgr_fake) -{ - struct block *block, *tmp; - - DBG("%s\n", __FUNCTION__); - - foreach_s_rev(block, tmp, &bufmgr_fake->lru) { - dri_bo_fake *bo_fake = (dri_bo_fake *)block->bo; - - if (bo_fake && (bo_fake->flags & BM_NO_FENCE_SUBDATA)) - continue; - - set_dirty(&bo_fake->bo); - bo_fake->block = NULL; - - free_block(bufmgr_fake, block); - return GL_TRUE; - } - - return GL_FALSE; -} - -/** - * Removes all objects from the fenced list older than the given fence. - */ -static int clear_fenced(dri_bufmgr_fake *bufmgr_fake, - unsigned int fence_cookie) -{ - struct block *block, *tmp; - int ret = 0; - - foreach_s(block, tmp, &bufmgr_fake->fenced) { - assert(block->fenced); - - if (_fence_test(bufmgr_fake, block->fence)) { - - block->fenced = 0; - - if (!block->bo) { - DBG("delayed free: offset %x sz %x\n", - block->mem->ofs, block->mem->size); - remove_from_list(block); - mmFreeMem(block->mem); - free(block); - } - else { - DBG("return to lru: offset %x sz %x\n", - block->mem->ofs, block->mem->size); - move_to_tail(&bufmgr_fake->lru, block); - } - - ret = 1; - } - else { - /* Blocks are ordered by fence, so if one fails, all from - * here will fail also: - */ - DBG("fence not passed: offset %x sz %x %d %d \n", - block->mem->ofs, block->mem->size, block->fence, bufmgr_fake->last_fence); - break; - } - } - - DBG("%s: %d\n", __FUNCTION__, ret); - return ret; -} - -static void fence_blocks(dri_bufmgr_fake *bufmgr_fake, unsigned fence) -{ - struct block *block, *tmp; - - foreach_s (block, tmp, &bufmgr_fake->on_hardware) { - DBG("Fence block %p (sz 0x%x ofs %x buf %p) with fence %d\n", block, - block->mem->size, block->mem->ofs, block->bo, fence); - block->fence = fence; - - block->on_hardware = 0; - block->fenced = 1; - - /* Move to tail of pending list here - */ - move_to_tail(&bufmgr_fake->fenced, block); - } - - assert(is_empty_list(&bufmgr_fake->on_hardware)); -} - -static GLboolean evict_and_alloc_block(dri_bo *bo) -{ - dri_bufmgr_fake *bufmgr_fake = (dri_bufmgr_fake *)bo->bufmgr; - dri_bo_fake *bo_fake = (dri_bo_fake *)bo; - - assert(bo_fake->block == NULL); - - /* Search for already free memory: - */ - if (alloc_block(bo)) - return GL_TRUE; - - /* If we're not thrashing, allow lru eviction to dig deeper into - * recently used textures. We'll probably be thrashing soon: - */ - if (!bufmgr_fake->thrashing) { - while (evict_lru(bufmgr_fake, 0)) - if (alloc_block(bo)) - return GL_TRUE; - } - - /* Keep thrashing counter alive? - */ - if (bufmgr_fake->thrashing) - bufmgr_fake->thrashing = 20; - - /* Wait on any already pending fences - here we are waiting for any - * freed memory that has been submitted to hardware and fenced to - * become available: - */ - while (!is_empty_list(&bufmgr_fake->fenced)) { - GLuint fence = bufmgr_fake->fenced.next->fence; - _fence_wait_internal(bufmgr_fake, fence); - - if (alloc_block(bo)) - return GL_TRUE; - } - - if (!is_empty_list(&bufmgr_fake->on_hardware)) { - while (!is_empty_list(&bufmgr_fake->fenced)) { - GLuint fence = bufmgr_fake->fenced.next->fence; - _fence_wait_internal(bufmgr_fake, fence); - } - - if (!bufmgr_fake->thrashing) { - DBG("thrashing\n"); - } - bufmgr_fake->thrashing = 20; - - if (alloc_block(bo)) - return GL_TRUE; - } - - while (evict_mru(bufmgr_fake)) - if (alloc_block(bo)) - return GL_TRUE; - - DBG("%s 0x%x bytes failed\n", __FUNCTION__, bo->size); - - return GL_FALSE; -} - -/*********************************************************************** - * Public functions - */ - -/** - * Wait for hardware idle by emitting a fence and waiting for it. - */ -static void -dri_bufmgr_fake_wait_idle(dri_bufmgr_fake *bufmgr_fake) -{ - unsigned int cookie; - - cookie = bufmgr_fake->fence_emit(bufmgr_fake->driver_priv); - _fence_wait_internal(bufmgr_fake, cookie); -} - -/** - * Wait for execution pending on a buffer - */ -static void -dri_bufmgr_fake_bo_wait_idle(dri_bo *bo) -{ - dri_bufmgr_fake *bufmgr_fake = (dri_bufmgr_fake *)bo->bufmgr; - dri_bo_fake *bo_fake = (dri_bo_fake *)bo; - - if (bo_fake->block == NULL || !bo_fake->block->fenced) - return; - - _fence_wait_internal(bufmgr_fake, bo_fake->block->fence); -} - -/* Specifically ignore texture memory sharing. - * -- just evict everything - * -- and wait for idle - */ -void -dri_bufmgr_fake_contended_lock_take(dri_bufmgr *bufmgr) -{ - dri_bufmgr_fake *bufmgr_fake = (dri_bufmgr_fake *)bufmgr; - struct block *block, *tmp; - - bufmgr_fake->need_fence = 1; - bufmgr_fake->fail = 0; - - /* Wait for hardware idle. We don't know where acceleration has been - * happening, so we'll need to wait anyway before letting anything get - * put on the card again. - */ - dri_bufmgr_fake_wait_idle(bufmgr_fake); - - /* Check that we hadn't released the lock without having fenced the last - * set of buffers. - */ - assert(is_empty_list(&bufmgr_fake->fenced)); - assert(is_empty_list(&bufmgr_fake->on_hardware)); - - foreach_s(block, tmp, &bufmgr_fake->lru) { - assert(_fence_test(bufmgr_fake, block->fence)); - set_dirty(block->bo); - } -} - -static dri_bo * -dri_fake_bo_alloc(dri_bufmgr *bufmgr, const char *name, - unsigned long size, unsigned int alignment, - uint64_t location_mask) -{ - dri_bufmgr_fake *bufmgr_fake; - dri_bo_fake *bo_fake; - - bufmgr_fake = (dri_bufmgr_fake *)bufmgr; - - assert(size != 0); - - bo_fake = calloc(1, sizeof(*bo_fake)); - if (!bo_fake) - return NULL; - - bo_fake->bo.size = size; - bo_fake->bo.offset = -1; - bo_fake->bo.virtual = NULL; - bo_fake->bo.bufmgr = bufmgr; - bo_fake->refcount = 1; - - /* Alignment must be a power of two */ - assert((alignment & (alignment - 1)) == 0); - if (alignment == 0) - alignment = 1; - bo_fake->alignment = alignment; - bo_fake->id = ++bufmgr_fake->buf_nr; - bo_fake->name = name; - bo_fake->flags = 0; - bo_fake->is_static = GL_FALSE; - - DBG("drm_bo_alloc: (buf %d: %s, %d kb)\n", bo_fake->id, bo_fake->name, - bo_fake->bo.size / 1024); - - return &bo_fake->bo; -} - -static dri_bo * -dri_fake_bo_alloc_static(dri_bufmgr *bufmgr, const char *name, - unsigned long offset, unsigned long size, - void *virtual, uint64_t location_mask) -{ - dri_bufmgr_fake *bufmgr_fake; - dri_bo_fake *bo_fake; - - bufmgr_fake = (dri_bufmgr_fake *)bufmgr; - - assert(size != 0); - - bo_fake = calloc(1, sizeof(*bo_fake)); - if (!bo_fake) - return NULL; - - bo_fake->bo.size = size; - bo_fake->bo.offset = offset; - bo_fake->bo.virtual = virtual; - bo_fake->bo.bufmgr = bufmgr; - bo_fake->refcount = 1; - bo_fake->id = ++bufmgr_fake->buf_nr; - bo_fake->name = name; - bo_fake->flags = BM_PINNED | DRM_BO_FLAG_NO_MOVE; - bo_fake->is_static = GL_TRUE; - - DBG("drm_bo_alloc_static: (buf %d: %s, %d kb)\n", bo_fake->id, bo_fake->name, - bo_fake->bo.size / 1024); - - return &bo_fake->bo; -} - -static void -dri_fake_bo_reference(dri_bo *bo) -{ - dri_bo_fake *bo_fake = (dri_bo_fake *)bo; - - bo_fake->refcount++; -} - -static void -dri_fake_bo_unreference(dri_bo *bo) -{ - dri_bufmgr_fake *bufmgr_fake = (dri_bufmgr_fake *)bo->bufmgr; - dri_bo_fake *bo_fake = (dri_bo_fake *)bo; - int i; - - if (!bo) - return; - - if (--bo_fake->refcount == 0) { - assert(bo_fake->map_count == 0); - /* No remaining references, so free it */ - if (bo_fake->block) - free_block(bufmgr_fake, bo_fake->block); - free_backing_store(bo); - - for (i = 0; i < bo_fake->nr_relocs; i++) - dri_bo_unreference(bo_fake->relocs[i].target_buf); - - DBG("drm_bo_unreference: free buf %d %s\n", bo_fake->id, bo_fake->name); - - free(bo_fake->relocs); - free(bo); - - return; - } -} - -/** - * Set the buffer as not requiring backing store, and instead get the callback - * invoked whenever it would be set dirty. - */ -void dri_bo_fake_disable_backing_store(dri_bo *bo, - void (*invalidate_cb)(dri_bo *bo, - void *ptr), - void *ptr) -{ - dri_bufmgr_fake *bufmgr_fake = (dri_bufmgr_fake *)bo->bufmgr; - dri_bo_fake *bo_fake = (dri_bo_fake *)bo; - - if (bo_fake->backing_store) - free_backing_store(bo); - - bo_fake->flags |= BM_NO_BACKING_STORE; - - DBG("disable_backing_store set buf %d dirty\n", bo_fake->id); - bo_fake->dirty = 1; - bo_fake->invalidate_cb = invalidate_cb; - bo_fake->invalidate_ptr = ptr; - - /* Note that it is invalid right from the start. Also note - * invalidate_cb is called with the bufmgr locked, so cannot - * itself make bufmgr calls. - */ - if (invalidate_cb != NULL) - invalidate_cb(bo, ptr); -} - -/** - * Map a buffer into bo->virtual, allocating either card memory space (If - * BM_NO_BACKING_STORE or BM_PINNED) or backing store, as necessary. - */ -static int -dri_fake_bo_map(dri_bo *bo, GLboolean write_enable) -{ - dri_bufmgr_fake *bufmgr_fake = (dri_bufmgr_fake *)bo->bufmgr; - dri_bo_fake *bo_fake = (dri_bo_fake *)bo; - - /* Static buffers are always mapped. */ - if (bo_fake->is_static) - return 0; - - /* Allow recursive mapping. Mesa may recursively map buffers with - * nested display loops, and it is used internally in bufmgr_fake - * for relocation. - */ - if (bo_fake->map_count++ != 0) - return 0; - - { - DBG("drm_bo_map: (buf %d: %s, %d kb)\n", bo_fake->id, bo_fake->name, - bo_fake->bo.size / 1024); - - if (bo->virtual != NULL) { - _mesa_printf("%s: already mapped\n", __FUNCTION__); - abort(); - } - else if (bo_fake->flags & (BM_NO_BACKING_STORE|BM_PINNED)) { - - if (!bo_fake->block && !evict_and_alloc_block(bo)) { - DBG("%s: alloc failed\n", __FUNCTION__); - bufmgr_fake->fail = 1; - return 1; - } - else { - assert(bo_fake->block); - bo_fake->dirty = 0; - - if (!(bo_fake->flags & BM_NO_FENCE_SUBDATA) && - bo_fake->block->fenced) { - dri_bufmgr_fake_bo_wait_idle(bo); - } - - bo->virtual = bo_fake->block->virtual; - } - } - else { - if (write_enable) - set_dirty(bo); - - if (bo_fake->backing_store == 0) - alloc_backing_store(bo); - - bo->virtual = bo_fake->backing_store; - } - } - - return 0; -} - -static int -dri_fake_bo_unmap(dri_bo *bo) -{ - dri_bufmgr_fake *bufmgr_fake = (dri_bufmgr_fake *)bo->bufmgr; - dri_bo_fake *bo_fake = (dri_bo_fake *)bo; - - /* Static buffers are always mapped. */ - if (bo_fake->is_static) - return 0; - - assert(bo_fake->map_count != 0); - if (--bo_fake->map_count != 0) - return 0; - - DBG("drm_bo_unmap: (buf %d: %s, %d kb)\n", bo_fake->id, bo_fake->name, - bo_fake->bo.size / 1024); - - bo->virtual = NULL; - - return 0; -} - -static void -dri_fake_kick_all(dri_bufmgr_fake *bufmgr_fake) -{ - struct block *block, *tmp; - - bufmgr_fake->performed_rendering = GL_FALSE; - /* okay for ever BO that is on the HW kick it off. - seriously not afraid of the POLICE right now */ - foreach_s(block, tmp, &bufmgr_fake->on_hardware) { - dri_bo_fake *bo_fake = (dri_bo_fake *)block->bo; - - block->on_hardware = 0; - free_block(bufmgr_fake, block); - bo_fake->block = NULL; - bo_fake->validated = GL_FALSE; - if (!(bo_fake->flags & BM_NO_BACKING_STORE)) - bo_fake->dirty = 1; - } -} - -static int -dri_fake_bo_validate(dri_bo *bo, uint64_t flags) -{ - dri_bufmgr_fake *bufmgr_fake; - dri_bo_fake *bo_fake = (dri_bo_fake *)bo; - - /* XXX: Sanity-check whether we've already validated this one under - * different flags. See drmAddValidateItem(). - */ - bufmgr_fake = (dri_bufmgr_fake *)bo->bufmgr; - - DBG("drm_bo_validate: (buf %d: %s, %d kb)\n", bo_fake->id, bo_fake->name, - bo_fake->bo.size / 1024); - - /* Sanity check: Buffers should be unmapped before being validated. - * This is not so much of a problem for bufmgr_fake, but TTM refuses, - * and the problem is harder to debug there. - */ - assert(bo_fake->map_count == 0); - - if (bo_fake->is_static) { - /* Add it to the needs-fence list */ - bufmgr_fake->need_fence = 1; - return 0; - } - - /* reset size accounted */ - bo_fake->size_accounted = 0; - - /* Allocate the card memory */ - if (!bo_fake->block && !evict_and_alloc_block(bo)) { - bufmgr_fake->fail = 1; - DBG("Failed to validate buf %d:%s\n", bo_fake->id, bo_fake->name); - return -1; - } - - assert(bo_fake->block); - assert(bo_fake->block->bo == &bo_fake->bo); - - bo->offset = bo_fake->block->mem->ofs; - - /* Upload the buffer contents if necessary */ - if (bo_fake->dirty) { - DBG("Upload dirty buf %d:%s, sz %d offset 0x%x\n", bo_fake->id, - bo_fake->name, bo->size, bo_fake->block->mem->ofs); - - assert(!(bo_fake->flags & - (BM_NO_BACKING_STORE|BM_PINNED))); - - /* Actually, should be able to just wait for a fence on the memory, - * which we would be tracking when we free it. Waiting for idle is - * a sufficiently large hammer for now. - */ - dri_bufmgr_fake_wait_idle(bufmgr_fake); - - /* we may never have mapped this BO so it might not have any backing - * store if this happens it should be rare, but 0 the card memory - * in any case */ - if (bo_fake->backing_store) - memcpy(bo_fake->block->virtual, bo_fake->backing_store, bo->size); - else - memset(bo_fake->block->virtual, 0, bo->size); - - bo_fake->dirty = 0; - } - - bo_fake->block->fenced = 0; - bo_fake->block->on_hardware = 1; - move_to_tail(&bufmgr_fake->on_hardware, bo_fake->block); - - bo_fake->validated = GL_TRUE; - bufmgr_fake->need_fence = 1; - - return 0; -} - -static dri_fence * -dri_fake_fence_validated(dri_bufmgr *bufmgr, const char *name, - GLboolean flushed) -{ - dri_fence_fake *fence_fake; - dri_bufmgr_fake *bufmgr_fake = (dri_bufmgr_fake *)bufmgr; - unsigned int cookie; - - fence_fake = malloc(sizeof(*fence_fake)); - if (!fence_fake) - return NULL; - - fence_fake->refcount = 1; - fence_fake->name = name; - fence_fake->flushed = flushed; - fence_fake->fence.bufmgr = bufmgr; - - cookie = _fence_emit_internal(bufmgr_fake); - fence_fake->fence_cookie = cookie; - fence_blocks(bufmgr_fake, cookie); - - DBG("drm_fence_validated: 0x%08x cookie\n", fence_fake->fence_cookie); - - return &fence_fake->fence; -} - -static void -dri_fake_fence_reference(dri_fence *fence) -{ - dri_fence_fake *fence_fake = (dri_fence_fake *)fence; - - ++fence_fake->refcount; -} - -static void -dri_fake_fence_unreference(dri_fence *fence) -{ - dri_fence_fake *fence_fake = (dri_fence_fake *)fence; - - if (!fence) - return; - - if (--fence_fake->refcount == 0) { - free(fence); - return; - } -} - -static void -dri_fake_fence_wait(dri_fence *fence) -{ - dri_fence_fake *fence_fake = (dri_fence_fake *)fence; - dri_bufmgr_fake *bufmgr_fake = (dri_bufmgr_fake *)fence->bufmgr; - - DBG("drm_fence_wait: 0x%08x cookie\n", fence_fake->fence_cookie); - - _fence_wait_internal(bufmgr_fake, fence_fake->fence_cookie); -} - -static void -dri_fake_destroy(dri_bufmgr *bufmgr) -{ - dri_bufmgr_fake *bufmgr_fake = (dri_bufmgr_fake *)bufmgr; - - mmDestroy(bufmgr_fake->heap); - free(bufmgr); -} - -static int -dri_fake_emit_reloc(dri_bo *reloc_buf, uint64_t flags, GLuint delta, - GLuint offset, dri_bo *target_buf) -{ - dri_bufmgr_fake *bufmgr_fake = (dri_bufmgr_fake *)reloc_buf->bufmgr; - struct fake_buffer_reloc *r; - dri_bo_fake *reloc_fake = (dri_bo_fake *)reloc_buf; - dri_bo_fake *target_fake = (dri_bo_fake *)target_buf; - int i; - - assert(reloc_buf); - assert(target_buf); - - assert(target_fake->is_static || target_fake->size_accounted); - - if (reloc_fake->relocs == NULL) { - reloc_fake->relocs = malloc(sizeof(struct fake_buffer_reloc) * - MAX_RELOCS); - } - - r = &reloc_fake->relocs[reloc_fake->nr_relocs++]; - - assert(reloc_fake->nr_relocs <= MAX_RELOCS); - - dri_bo_reference(target_buf); - - r->target_buf = target_buf; - r->offset = offset; - r->last_target_offset = target_buf->offset; - r->delta = delta; - r->validate_flags = flags; - - if (bufmgr_fake->debug) { - /* Check that a conflicting relocation hasn't already been emitted. */ - for (i = 0; i < reloc_fake->nr_relocs - 1; i++) { - struct fake_buffer_reloc *r2 = &reloc_fake->relocs[i]; - - assert(r->offset != r2->offset); - } - } - - return 0; -} - -/** - * Incorporates the validation flags associated with each relocation into - * the combined validation flags for the buffer on this batchbuffer submission. - */ -static void -dri_fake_calculate_validate_flags(dri_bo *bo) -{ - dri_bo_fake *bo_fake = (dri_bo_fake *)bo; - int i; - - for (i = 0; i < bo_fake->nr_relocs; i++) { - struct fake_buffer_reloc *r = &bo_fake->relocs[i]; - dri_bo_fake *target_fake = (dri_bo_fake *)r->target_buf; - - /* Do the same for the tree of buffers we depend on */ - dri_fake_calculate_validate_flags(r->target_buf); - - if (target_fake->validate_flags == 0) { - target_fake->validate_flags = r->validate_flags; - } else { - /* Mask the memory location to the intersection of all the memory - * locations the buffer is being validated to. - */ - target_fake->validate_flags = - (target_fake->validate_flags & ~DRM_BO_MASK_MEM) | - (r->validate_flags & target_fake->validate_flags & - DRM_BO_MASK_MEM); - /* All the other flags just accumulate. */ - target_fake->validate_flags |= r->validate_flags & ~DRM_BO_MASK_MEM; - } - } -} - - -static int -dri_fake_reloc_and_validate_buffer(dri_bo *bo) -{ - dri_bufmgr_fake *bufmgr_fake = (dri_bufmgr_fake *)bo->bufmgr; - dri_bo_fake *bo_fake = (dri_bo_fake *)bo; - int i, ret; - - assert(bo_fake->map_count == 0); - - for (i = 0; i < bo_fake->nr_relocs; i++) { - struct fake_buffer_reloc *r = &bo_fake->relocs[i]; - dri_bo_fake *target_fake = (dri_bo_fake *)r->target_buf; - uint32_t reloc_data; - - /* Validate the target buffer if that hasn't been done. */ - if (!target_fake->validated) { - ret = dri_fake_reloc_and_validate_buffer(r->target_buf); - if (ret != 0) { - if (bo->virtual != NULL) - dri_bo_unmap(bo); - return ret; - } - } - - /* Calculate the value of the relocation entry. */ - if (r->target_buf->offset != r->last_target_offset) { - reloc_data = r->target_buf->offset + r->delta; - - if (bo->virtual == NULL) - dri_bo_map(bo, GL_TRUE); - - *(uint32_t *)(bo->virtual + r->offset) = reloc_data; - - r->last_target_offset = r->target_buf->offset; - } - } - - if (bo->virtual != NULL) - dri_bo_unmap(bo); - - if (bo_fake->validate_flags & DRM_BO_FLAG_WRITE) { - if (!(bo_fake->flags & (BM_NO_BACKING_STORE|BM_PINNED))) { - if (bo_fake->backing_store == 0) - alloc_backing_store(bo); - - bo_fake->card_dirty = 1; - } - bufmgr_fake->performed_rendering = GL_TRUE; - } - - return dri_fake_bo_validate(bo, bo_fake->validate_flags); -} - -static void * -dri_fake_process_relocs(dri_bo *batch_buf, GLuint *count_p) -{ - dri_bufmgr_fake *bufmgr_fake = (dri_bufmgr_fake *)batch_buf->bufmgr; - dri_bo_fake *batch_fake = (dri_bo_fake *)batch_buf; - int ret; - int retry_count = 0; - - bufmgr_fake->performed_rendering = GL_FALSE; - - dri_fake_calculate_validate_flags(batch_buf); - - batch_fake->validate_flags = DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_READ; - - /* we've ran out of RAM so blow the whole lot away and retry */ - restart: - ret = dri_fake_reloc_and_validate_buffer(batch_buf); - if (bufmgr_fake->fail == 1) { - if (retry_count == 0) { - retry_count++; - dri_fake_kick_all(bufmgr_fake); - bufmgr_fake->fail = 0; - goto restart; - } else /* dump out the memory here */ - mmDumpMemInfo(bufmgr_fake->heap); - } - - assert(ret == 0); - - *count_p = 0; /* junk */ - - bufmgr_fake->current_total_size = 0; - return NULL; -} - -static void -dri_bo_fake_post_submit(dri_bo *bo) -{ - dri_bufmgr_fake *bufmgr_fake = (dri_bufmgr_fake *)bo->bufmgr; - dri_bo_fake *bo_fake = (dri_bo_fake *)bo; - int i; - - for (i = 0; i < bo_fake->nr_relocs; i++) { - struct fake_buffer_reloc *r = &bo_fake->relocs[i]; - dri_bo_fake *target_fake = (dri_bo_fake *)r->target_buf; - - if (target_fake->validated) - dri_bo_fake_post_submit(r->target_buf); - - DBG("%s@0x%08x + 0x%08x -> %s@0x%08x + 0x%08x\n", - bo_fake->name, (uint32_t)bo->offset, r->offset, - target_fake->name, (uint32_t)r->target_buf->offset, r->delta); - } - - assert(bo_fake->map_count == 0); - bo_fake->validated = GL_FALSE; - bo_fake->validate_flags = 0; -} - - -static void -dri_fake_post_submit(dri_bo *batch_buf, dri_fence **last_fence) -{ - dri_bufmgr_fake *bufmgr_fake = (dri_bufmgr_fake *)batch_buf->bufmgr; - dri_fence *fo; - - fo = dri_fake_fence_validated(batch_buf->bufmgr, "Batch fence", GL_TRUE); - - if (bufmgr_fake->performed_rendering) { - dri_fence_unreference(*last_fence); - *last_fence = fo; - } else { - dri_fence_unreference(fo); - } - - dri_bo_fake_post_submit(batch_buf); -} - -static int -dri_fake_check_aperture_space(dri_bo *bo) -{ - dri_bufmgr_fake *bufmgr_fake = (dri_bufmgr_fake *)bo->bufmgr; - dri_bo_fake *bo_fake = (dri_bo_fake *)bo; - GLuint sz; - - sz = (bo->size + bo_fake->alignment - 1) & ~(bo_fake->alignment - 1); - - if (bo_fake->size_accounted || bo_fake->is_static) - return 0; - - if (bufmgr_fake->current_total_size + sz > bufmgr_fake->size) { - DBG("check_space: %s bo %d %d overflowed bufmgr size %d\n", bo_fake->name, bo_fake->id, sz, bufmgr_fake->size); - return -1; - } - - bufmgr_fake->current_total_size += sz; - bo_fake->size_accounted = 1; - DBG("drm_check_space: buf %d, %s %d %d\n", bo_fake->id, bo_fake->name, bo->size, bufmgr_fake->current_total_size); - return 0; -} - -dri_bufmgr * -dri_bufmgr_fake_init(unsigned long low_offset, void *low_virtual, - unsigned long size, - unsigned int (*fence_emit)(void *private), - int (*fence_wait)(void *private, unsigned int cookie), - void *driver_priv) -{ - dri_bufmgr_fake *bufmgr_fake; - - bufmgr_fake = calloc(1, sizeof(*bufmgr_fake)); - - /* Initialize allocator */ - make_empty_list(&bufmgr_fake->fenced); - make_empty_list(&bufmgr_fake->on_hardware); - make_empty_list(&bufmgr_fake->lru); - - bufmgr_fake->low_offset = low_offset; - bufmgr_fake->virtual = low_virtual; - bufmgr_fake->size = size; - bufmgr_fake->heap = mmInit(low_offset, size); - - /* Hook in methods */ - bufmgr_fake->bufmgr.bo_alloc = dri_fake_bo_alloc; - bufmgr_fake->bufmgr.bo_alloc_static = dri_fake_bo_alloc_static; - bufmgr_fake->bufmgr.bo_reference = dri_fake_bo_reference; - bufmgr_fake->bufmgr.bo_unreference = dri_fake_bo_unreference; - bufmgr_fake->bufmgr.bo_map = dri_fake_bo_map; - bufmgr_fake->bufmgr.bo_unmap = dri_fake_bo_unmap; - bufmgr_fake->bufmgr.fence_wait = dri_fake_fence_wait; - bufmgr_fake->bufmgr.fence_reference = dri_fake_fence_reference; - bufmgr_fake->bufmgr.fence_unreference = dri_fake_fence_unreference; - bufmgr_fake->bufmgr.destroy = dri_fake_destroy; - bufmgr_fake->bufmgr.emit_reloc = dri_fake_emit_reloc; - bufmgr_fake->bufmgr.process_relocs = dri_fake_process_relocs; - bufmgr_fake->bufmgr.post_submit = dri_fake_post_submit; - bufmgr_fake->bufmgr.check_aperture_space = dri_fake_check_aperture_space; - bufmgr_fake->bufmgr.debug = GL_FALSE; - - bufmgr_fake->fence_emit = fence_emit; - bufmgr_fake->fence_wait = fence_wait; - bufmgr_fake->driver_priv = driver_priv; - - return &bufmgr_fake->bufmgr; -} - diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c index 9655741bbb..ceedd914fb 100644 --- a/src/mesa/drivers/dri/common/dri_util.c +++ b/src/mesa/drivers/dri/common/dri_util.c @@ -26,7 +26,7 @@ #define MAP_FAILED ((void *)-1) #endif -#include "imports.h" +#include "main/imports.h" #define None 0 #include "dri_util.h" @@ -152,7 +152,6 @@ static int driUnbindContext(__DRIcontext *pcp) return GL_TRUE; } - /** * This function takes both a read buffer and a draw buffer. This is needed * for \c glXMakeCurrentReadSGI or GLX 1.3's \c glXMakeContextCurrent @@ -186,10 +185,7 @@ static int driBindContext(__DRIcontext *pcp, ** initialize the drawable information if has not been done before. */ - if (psp->dri2.enabled) { - __driParseEvents(pcp, pdp); - __driParseEvents(pcp, prp); - } else { + if (!psp->dri2.enabled) { if (!pdp->pStamp || *pdp->pStamp != pdp->lastStamp) { DRM_SPINLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID); __driUtilUpdateDrawableInfo(pdp); @@ -279,139 +275,6 @@ __driUtilUpdateDrawableInfo(__DRIdrawablePrivate *pdp) DRM_SPINLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID); } - -int -__driParseEvents(__DRIcontextPrivate *pcp, __DRIdrawablePrivate *pdp) -{ - __DRIscreenPrivate *psp = pdp->driScreenPriv; - __DRIDrawableConfigEvent *dc, *last_dc; - __DRIBufferAttachEvent *ba, *last_ba; - unsigned int tail, mask, *p, end, total, size, changed; - unsigned char *data; - size_t rect_size; - - /* Check for wraparound. */ - if (pcp && psp->dri2.buffer->prealloc - pdp->dri2.tail > psp->dri2.buffer->size) { - /* If prealloc overlaps into what we just parsed, the - * server overwrote it and we have to reset our tail - * pointer. */ - DRM_UNLOCK(psp->fd, psp->lock, pcp->hHWContext); - (*psp->dri2.loader->reemitDrawableInfo)(pdp, &pdp->dri2.tail, - pdp->loaderPrivate); - DRM_LIGHT_LOCK(psp->fd, psp->lock, pcp->hHWContext); - } - - total = psp->dri2.buffer->head - pdp->dri2.tail; - mask = psp->dri2.buffer->size - 1; - end = psp->dri2.buffer->head; - data = psp->dri2.buffer->data; - - changed = 0; - last_dc = NULL; - last_ba = NULL; - - for (tail = pdp->dri2.tail; tail != end; tail += size) { - p = (unsigned int *) (data + (tail & mask)); - size = DRI2_EVENT_SIZE(*p); - if (size > total || (tail & mask) + size > psp->dri2.buffer->size) { - /* illegal data, bail out. */ - fprintf(stderr, "illegal event size\n"); - break; - } - - switch (DRI2_EVENT_TYPE(*p)) { - case DRI2_EVENT_DRAWABLE_CONFIG: - dc = (__DRIDrawableConfigEvent *) p; - if (dc->drawable == pdp->dri2.drawable_id) - last_dc = dc; - break; - - case DRI2_EVENT_BUFFER_ATTACH: - ba = (__DRIBufferAttachEvent *) p; - if (ba->drawable == pdp->dri2.drawable_id && - ba->buffer.attachment == DRI_DRAWABLE_BUFFER_FRONT_LEFT) - last_ba = ba; - break; - } - } - - if (last_dc) { - if (pdp->w != last_dc->width || pdp->h != last_dc->height) - changed = 1; - - pdp->x = last_dc->x; - pdp->y = last_dc->y; - pdp->w = last_dc->width; - pdp->h = last_dc->height; - - pdp->backX = 0; - pdp->backY = 0; - pdp->numBackClipRects = 1; - pdp->pBackClipRects[0].x1 = 0; - pdp->pBackClipRects[0].y1 = 0; - pdp->pBackClipRects[0].x2 = pdp->w; - pdp->pBackClipRects[0].y2 = pdp->h; - - pdp->numClipRects = last_dc->num_rects; - _mesa_free(pdp->pClipRects); - rect_size = last_dc->num_rects * sizeof last_dc->rects[0]; - pdp->pClipRects = _mesa_malloc(rect_size); - memcpy(pdp->pClipRects, last_dc->rects, rect_size); - } - - /* We only care about the most recent drawable config. */ - if (last_dc && changed) - (*psp->DriverAPI.HandleDrawableConfig)(pdp, pcp, last_dc); - - /* Front buffer attachments are special, they typically mean that - * we're rendering to a redirected window (or a child window of a - * redirected window) and that it got resized. Resizing the root - * window on randr events is a special case of this. Other causes - * may be a window transitioning between redirected and - * non-redirected, or a window getting reparented between parents - * with different window pixmaps (eg two redirected windows). - * These events are special in that the X server allocates the - * buffer and that the buffer may be shared by other child - * windows. When our window share the window pixmap with its - * parent, drawable config events doesn't affect the front buffer. - * We only care about the last such event in the buffer; in fact, - * older events will refer to invalid buffer objects.*/ - if (last_ba) - (*psp->DriverAPI.HandleBufferAttach)(pdp, pcp, last_ba); - - /* If there was a drawable config event in the buffer and it - * changed the size of the window, all buffer auxillary buffer - * attachments prior to that are invalid (as opposed to the front - * buffer case discussed above). In that case we can start - * looking for buffer attachment after the last drawable config - * event. If there is no drawable config event in this batch of - * events, we have to assume that the last batch might have had - * one and process all buffer attach events.*/ - if (last_dc && changed) - tail = (unsigned char *) last_dc - data; - else - tail = pdp->dri2.tail; - - for ( ; tail != end; tail += size) { - ba = (__DRIBufferAttachEvent *) (data + (tail & mask)); - size = DRI2_EVENT_SIZE(ba->event_header); - - if (DRI2_EVENT_TYPE(ba->event_header) != DRI2_EVENT_BUFFER_ATTACH) - continue; - if (ba->drawable != pdp->dri2.drawable_id) - continue; - if (last_ba == ba) - continue; - - (*psp->DriverAPI.HandleBufferAttach)(pdp, pcp, ba); - changed = 1; - } - - pdp->dri2.tail = tail; - - return changed || last_ba; -} - /*@}*/ /*****************************************************************/ @@ -425,12 +288,7 @@ static void driReportDamage(__DRIdrawable *pdp, __DRIscreen *psp = pdp->driScreenPriv; /* Check that we actually have the new damage report method */ - if (psp->dri2.enabled) { - (*psp->dri2.loader->postDamage)(pdp, - pClipRects, - numClipRects, - pdp->loaderPrivate); - } else if (psp->damage) { + if (psp->damage) { /* Report the damage. Currently, all our drivers draw * directly to the front buffer, so we report the damage there * rather than to the backing storein (if any). @@ -460,9 +318,6 @@ static void driSwapBuffers(__DRIdrawable *dPriv) if (!dPriv->numClipRects) return; - if (psp->dri2.enabled) - __driParseEvents(NULL, dPriv); - psp->DriverAPI.SwapBuffers(dPriv); driReportDamage(dPriv, dPriv->pClipRects, dPriv->numClipRects); @@ -512,13 +367,13 @@ static void driCopySubBuffer(__DRIdrawable *dPriv, { drm_clip_rect_t rect; - dPriv->driScreenPriv->DriverAPI.CopySubBuffer(dPriv, x, y, w, h); - rect.x1 = x; rect.y1 = dPriv->h - y - h; rect.x2 = x + w; rect.y2 = rect.y1 + h; driReportDamage(dPriv, &rect, 1); + + dPriv->driScreenPriv->DriverAPI.CopySubBuffer(dPriv, x, y, w, h); } const __DRIcopySubBufferExtension driCopySubBufferExtension = { @@ -602,17 +457,17 @@ driCreateNewDrawable(__DRIscreen *psp, const __DRIconfig *config, static __DRIdrawable * -dri2CreateNewDrawable(__DRIscreen *screen, const __DRIconfig *config, - unsigned int drawable_id, unsigned int head, void *data) +dri2CreateNewDrawable(__DRIscreen *screen, + const __DRIconfig *config, + void *loaderPrivate) { __DRIdrawable *pdraw; - pdraw = driCreateNewDrawable(screen, config, 0, 0, NULL, data); + pdraw = driCreateNewDrawable(screen, config, 0, 0, NULL, loaderPrivate); if (!pdraw) return NULL; - pdraw->dri2.drawable_id = drawable_id; - pdraw->dri2.tail = head; + pdraw->pClipRects = _mesa_malloc(sizeof *pdraw->pBackClipRects); pdraw->pBackClipRects = _mesa_malloc(sizeof *pdraw->pBackClipRects); return pdraw; @@ -723,18 +578,7 @@ static __DRIcontext * dri2CreateNewContext(__DRIscreen *screen, const __DRIconfig *config, __DRIcontext *shared, void *data) { - drm_context_t hwContext; - DRM_CAS_RESULT(ret); - - /* DRI2 doesn't use kernel with context IDs, we just need an ID that's - * different from the kernel context ID to make drmLock() happy. */ - - do { - hwContext = screen->dri2.lock->next_id; - DRM_CAS(&screen->dri2.lock->next_id, hwContext, hwContext + 1, ret); - } while (ret); - - return driCreateNewContext(screen, config, 0, shared, hwContext, data); + return driCreateNewContext(screen, config, 0, shared, 0, data); } @@ -770,12 +614,7 @@ static void driDestroyScreen(__DRIscreen *psp) if (psp->DriverAPI.DestroyScreen) (*psp->DriverAPI.DestroyScreen)(psp); - if (psp->dri2.enabled) { -#ifdef TTM_API - drmBOUnmap(psp->fd, &psp->dri2.sareaBO); - drmBOUnreference(psp->fd, &psp->dri2.sareaBO); -#endif - } else { + if (!psp->dri2.enabled) { (void)drmUnmap((drmAddress)psp->pSAREA, SAREA_MAX); (void)drmUnmap((drmAddress)psp->pFB, psp->fbSize); (void)drmCloseOnce(psp->fd); @@ -798,8 +637,8 @@ setupLoaderExtensions(__DRIscreen *psp, psp->damage = (__DRIdamageExtension *) extensions[i]; if (strcmp(extensions[i]->name, __DRI_SYSTEM_TIME) == 0) psp->systemTime = (__DRIsystemTimeExtension *) extensions[i]; - if (strcmp(extensions[i]->name, __DRI_LOADER) == 0) - psp->dri2.loader = (__DRIloaderExtension *) extensions[i]; + if (strcmp(extensions[i]->name, __DRI_DRI2_LOADER) == 0) + psp->dri2.loader = (__DRIdri2LoaderExtension *) extensions[i]; } } @@ -895,19 +734,16 @@ driCreateNewScreen(int scrn, return psp; } - /** * DRI2 */ static __DRIscreen * -dri2CreateNewScreen(int scrn, int fd, unsigned int sarea_handle, +dri2CreateNewScreen(int scrn, int fd, const __DRIextension **extensions, const __DRIconfig ***driver_configs, void *data) { -#ifdef TTM_API static const __DRIextension *emptyExtensionList[] = { NULL }; __DRIscreen *psp; - unsigned int *p; drmVersionPtr version; if (driDriverAPI.InitScreen2 == NULL) @@ -932,39 +768,9 @@ dri2CreateNewScreen(int scrn, int fd, unsigned int sarea_handle, psp->myNum = scrn; psp->dri2.enabled = GL_TRUE; - if (drmBOReference(psp->fd, sarea_handle, &psp->dri2.sareaBO)) { - fprintf(stderr, "Failed to reference DRI2 sarea BO\n"); - _mesa_free(psp); - return NULL; - } - - if (drmBOMap(psp->fd, &psp->dri2.sareaBO, - DRM_BO_FLAG_READ | DRM_BO_FLAG_WRITE, 0, &psp->dri2.sarea)) { - drmBOUnreference(psp->fd, &psp->dri2.sareaBO); - _mesa_free(psp); - return NULL; - } - - p = psp->dri2.sarea; - while (DRI2_SAREA_BLOCK_TYPE(*p)) { - switch (DRI2_SAREA_BLOCK_TYPE(*p)) { - case DRI2_SAREA_BLOCK_LOCK: - psp->dri2.lock = (__DRILock *) p; - break; - case DRI2_SAREA_BLOCK_EVENT_BUFFER: - psp->dri2.buffer = (__DRIEventBuffer *) p; - break; - } - p = DRI2_SAREA_BLOCK_NEXT(p); - } - - psp->lock = (drmLock *) &psp->dri2.lock->lock; - psp->DriverAPI = driDriverAPI; *driver_configs = driDriverAPI.InitScreen2(psp); if (*driver_configs == NULL) { - drmBOUnmap(psp->fd, &psp->dri2.sareaBO); - drmBOUnreference(psp->fd, &psp->dri2.sareaBO); _mesa_free(psp); return NULL; } @@ -972,9 +778,6 @@ dri2CreateNewScreen(int scrn, int fd, unsigned int sarea_handle, psp->DriverAPI = driDriverAPI; return psp; -#else - return NULL; -#endif } static const __DRIextension **driGetExtensions(__DRIscreen *psp) @@ -982,36 +785,45 @@ static const __DRIextension **driGetExtensions(__DRIscreen *psp) return psp->extensions; } -/** Legacy DRI interface */ -const __DRIlegacyExtension driLegacyExtension = { - { __DRI_LEGACY, __DRI_LEGACY_VERSION }, - driCreateNewScreen, - driCreateNewDrawable, - driCreateNewContext -}; - -/** DRI2 interface */ +/** Core interface */ const __DRIcoreExtension driCoreExtension = { { __DRI_CORE, __DRI_CORE_VERSION }, - dri2CreateNewScreen, + NULL, driDestroyScreen, driGetExtensions, driGetConfigAttrib, driIndexConfigAttrib, - dri2CreateNewDrawable, + NULL, driDestroyDrawable, driSwapBuffers, - dri2CreateNewContext, + NULL, driCopyContext, driDestroyContext, driBindContext, driUnbindContext }; +/** Legacy DRI interface */ +const __DRIlegacyExtension driLegacyExtension = { + { __DRI_LEGACY, __DRI_LEGACY_VERSION }, + driCreateNewScreen, + driCreateNewDrawable, + driCreateNewContext, +}; + +/** Legacy DRI interface */ +const __DRIdri2Extension driDRI2Extension = { + { __DRI_DRI2, __DRI_DRI2_VERSION }, + dri2CreateNewScreen, + dri2CreateNewDrawable, + dri2CreateNewContext, +}; + /* This is the table of extensions that the loader will dlsym() for. */ PUBLIC const __DRIextension *__driDriverExtensions[] = { &driCoreExtension.base, &driLegacyExtension.base, + &driDRI2Extension.base, NULL }; diff --git a/src/mesa/drivers/dri/common/dri_util.h b/src/mesa/drivers/dri/common/dri_util.h index f126d08406..c0e1bea5e0 100644 --- a/src/mesa/drivers/dri/common/dri_util.h +++ b/src/mesa/drivers/dri/common/dri_util.h @@ -53,10 +53,9 @@ #include <drm.h> #include <drm_sarea.h> #include <xf86drm.h> -#include "glheader.h" +#include "main/glheader.h" #include "GL/internal/glcore.h" #include "GL/internal/dri_interface.h" -#include "GL/internal/dri_sarea.h" #define GLX_BAD_CONTEXT 5 @@ -204,16 +203,8 @@ struct __DriverAPIRec { - /* DRI2 Entry points */ + /* DRI2 Entry point */ const __DRIconfig **(*InitScreen2) (__DRIscreen * priv); - void (*HandleDrawableConfig)(__DRIdrawable *dPriv, - __DRIcontext *pcp, - __DRIDrawableConfigEvent *event); - - void (*HandleBufferAttach)(__DRIdrawable *dPriv, - __DRIcontext *pcp, - __DRIBufferAttachEvent *ba); - }; extern const struct __DriverAPIRec driDriverAPI; @@ -223,7 +214,7 @@ struct __DRIswapInfoRec { /** * Number of swapBuffers operations that have been *completed*. */ - u_int64_t swap_count; + uint64_t swap_count; /** * Unadjusted system time of the last buffer swap. This is the time @@ -237,7 +228,7 @@ struct __DRIswapInfoRec { * swap, it has missed its deadline. If swap_interval is 0, then the * swap deadline is 1 frame after the previous swap. */ - u_int64_t swap_missed_count; + uint64_t swap_missed_count; /** * Amount of time used by the last swap that missed its deadline. This @@ -369,10 +360,6 @@ struct __DRIdrawableRec { * GLX_MESA_swap_control. */ unsigned int swap_interval; - struct { - unsigned int tail; - unsigned int drawable_id; - } dri2; }; /** @@ -524,13 +511,7 @@ struct __DRIscreenRec { /* Flag to indicate that this is a DRI2 screen. Many of the above * fields will not be valid or initializaed in that case. */ int enabled; -#ifdef TTM_API - drmBO sareaBO; -#endif - void *sarea; - __DRIEventBuffer *buffer; - __DRILock *lock; - __DRIloaderExtension *loader; + __DRIdri2LoaderExtension *loader; } dri2; /* The lock actually in use, old sarea or DRI2 */ @@ -544,9 +525,6 @@ __driUtilMessage(const char *f, ...); extern void __driUtilUpdateDrawableInfo(__DRIdrawable *pdp); -extern int -__driParseEvents(__DRIcontext *psp, __DRIdrawable *pdp); - extern float driCalculateSwapUsage( __DRIdrawable *dPriv, int64_t last_swap_ust, int64_t current_ust ); diff --git a/src/mesa/drivers/dri/common/drirenderbuffer.c b/src/mesa/drivers/dri/common/drirenderbuffer.c index d36af3e5be..b99bf2033b 100644 --- a/src/mesa/drivers/dri/common/drirenderbuffer.c +++ b/src/mesa/drivers/dri/common/drirenderbuffer.c @@ -1,9 +1,9 @@ -#include "mtypes.h" +#include "main/mtypes.h" +#include "main/framebuffer.h" +#include "main/renderbuffer.h" +#include "main/imports.h" #include "drirenderbuffer.h" -#include "framebuffer.h" -#include "renderbuffer.h" -#include "imports.h" /** diff --git a/src/mesa/drivers/dri/common/drirenderbuffer.h b/src/mesa/drivers/dri/common/drirenderbuffer.h index 747f92fcdb..cf55286b30 100644 --- a/src/mesa/drivers/dri/common/drirenderbuffer.h +++ b/src/mesa/drivers/dri/common/drirenderbuffer.h @@ -10,7 +10,7 @@ #ifndef DRIRENDERBUFFER_H #define DRIRENDERBUFFER_H -#include "mtypes.h" +#include "main/mtypes.h" #include "dri_util.h" diff --git a/src/mesa/drivers/dri/common/extension_helper.h b/src/mesa/drivers/dri/common/extension_helper.h index ea5b9973dd..3143ea2b10 100644 --- a/src/mesa/drivers/dri/common/extension_helper.h +++ b/src/mesa/drivers/dri/common/extension_helper.h @@ -26,7 +26,7 @@ */ #include "utils.h" -#include "dispatch.h" +#include "glapi/dispatch.h" #ifndef NULL # define NULL 0 diff --git a/src/mesa/drivers/dri/common/mmio.h b/src/mesa/drivers/dri/common/mmio.h index 89871aab59..ce95d8c907 100644 --- a/src/mesa/drivers/dri/common/mmio.h +++ b/src/mesa/drivers/dri/common/mmio.h @@ -33,14 +33,14 @@ #ifndef MMIO_H #define MMIO_H -#include "glheader.h" +#include "main/glheader.h" #if defined( __powerpc__ ) -static INLINE u_int32_t +static INLINE uint32_t read_MMIO_LE32( volatile void * base, unsigned long offset ) { - u_int32_t val; + uint32_t val; __asm__ __volatile__( "lwbrx %0, %1, %2 ; eieio" : "=r" (val) @@ -50,10 +50,10 @@ read_MMIO_LE32( volatile void * base, unsigned long offset ) #else -static INLINE u_int32_t +static INLINE uint32_t read_MMIO_LE32( volatile void * base, unsigned long offset ) { - volatile u_int32_t * p = (volatile u_int32_t *) (((volatile char *) base) + offset); + volatile uint32_t * p = (volatile uint32_t *) (((volatile char *) base) + offset); return LE32_TO_CPU( p[0] ); } diff --git a/src/mesa/drivers/dri/common/spantmp2.h b/src/mesa/drivers/dri/common/spantmp2.h index 53f5f846a0..f2868cb58a 100644 --- a/src/mesa/drivers/dri/common/spantmp2.h +++ b/src/mesa/drivers/dri/common/spantmp2.h @@ -33,7 +33,7 @@ * \author Ian Romanick <idr@us.ibm.com> */ -#include "colormac.h" +#include "main/colormac.h" #include "spantmp_common.h" #ifndef DBG @@ -48,36 +48,34 @@ #define HW_WRITE_CLIPLOOP() HW_CLIPLOOP() #endif - #if (SPANTMP_PIXEL_FMT == GL_RGB) && (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_SHORT_5_6_5) /** ** GL_RGB, GL_UNSIGNED_SHORT_5_6_5 **/ +#ifndef GET_VALUE #ifndef GET_PTR #define GET_PTR(_x, _y) (buf + (_x) * 2 + (_y) * pitch) #endif +#define GET_VALUE(_x, _y) *(volatile GLushort *)(GET_PTR(_x, _y)) +#define PUT_VALUE(_x, _y, _v) *(volatile GLushort *)(GET_PTR(_x, _y)) = (_v) +#endif /* GET_VALUE */ + #define INIT_MONO_PIXEL(p, color) \ p = PACK_COLOR_565( color[0], color[1], color[2] ) #define WRITE_RGBA( _x, _y, r, g, b, a ) \ - do { \ - GLshort * _p = (GLshort *) GET_PTR(_x, _y); \ - _p[0] = ((((int)r & 0xf8) << 8) | (((int)g & 0xfc) << 3) | \ - (((int)b & 0xf8) >> 3)); \ - } while(0) + PUT_VALUE(_x, _y, ((((int)r & 0xf8) << 8) | \ + (((int)g & 0xfc) << 3) | \ + (((int)b & 0xf8) >> 3))) \ -#define WRITE_PIXEL( _x, _y, p ) \ - do { \ - GLushort * _p = (GLushort *) GET_PTR(_x, _y); \ - _p[0] = p; \ - } while(0) +#define WRITE_PIXEL( _x, _y, p ) PUT_VALUE(_x, _y, p) #define READ_RGBA( rgba, _x, _y ) \ do { \ - GLushort p = *(volatile GLshort *) GET_PTR(_x, _y); \ + GLushort p = GET_VALUE(_x, _y); \ rgba[0] = ((p >> 8) & 0xf8) * 255 / 0xf8; \ rgba[1] = ((p >> 3) & 0xfc) * 255 / 0xfc; \ rgba[2] = ((p << 3) & 0xf8) * 255 / 0xf8; \ @@ -90,29 +88,30 @@ ** GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV **/ +#ifndef GET_VALUE #ifndef GET_PTR #define GET_PTR(_x, _y) ( buf + (_x) * 4 + (_y) * pitch) #endif +#define GET_VALUE(_x, _y) *(volatile GLuint *)(GET_PTR(_x, _y)) +#define PUT_VALUE(_x, _y, _v) *(volatile GLuint *)(GET_PTR(_x, _y)) = (_v) +#endif /* GET_VALUE */ + # define INIT_MONO_PIXEL(p, color) \ p = PACK_COLOR_8888(color[3], color[0], color[1], color[2]) # define WRITE_RGBA(_x, _y, r, g, b, a) \ - do { \ - GLuint * _p = (GLuint *) GET_PTR(_x, _y); \ - _p[0] = ((r << 16) | (g << 8) | (b << 0) | (a << 24)); \ - } while(0) + PUT_VALUE(_x, _y, ((r << 16) | \ + (g << 8) | \ + (b << 0) | \ + (a << 24))) -#define WRITE_PIXEL(_x, _y, p) \ - do { \ - GLuint * _p = (GLuint *) GET_PTR(_x, _y); \ - _p[0] = p; \ - } while(0) +#define WRITE_PIXEL(_x, _y, p) PUT_VALUE(_x, _y, p) # if defined( USE_X86_ASM ) # define READ_RGBA(rgba, _x, _y) \ do { \ - GLuint p = *(volatile GLuint *) GET_PTR(_x, _y); \ + GLuint p = GET_VALUE(_x, _y); \ __asm__ __volatile__( "bswap %0; rorl $8, %0" \ : "=r" (p) : "0" (p) ); \ ((GLuint *)rgba)[0] = p; \ @@ -123,14 +122,14 @@ */ # define READ_RGBA( rgba, _x, _y ) \ do { \ - GLuint p = *(volatile GLuint *) GET_PTR(_x, _y); \ + GLuint p = GET_VALUE(_x, _y); \ GLuint t = p; \ *((uint32_t *) rgba) = (t >> 24) | (p << 8); \ } while (0) # else # define READ_RGBA( rgba, _x, _y ) \ do { \ - GLuint p = *(volatile GLuint *) GET_PTR(_x, _y); \ + GLuint p = GET_VALUE(_x, _y); \ rgba[0] = (p >> 16) & 0xff; \ rgba[1] = (p >> 8) & 0xff; \ rgba[2] = (p >> 0) & 0xff; \ @@ -389,7 +388,8 @@ static void TAG(ReadRGBASpan)( GLcontext *ctx, } -#if defined(USE_MMX_ASM) && \ +#if defined(GET_PTR) && \ + defined(USE_MMX_ASM) && \ (((SPANTMP_PIXEL_FMT == GL_BGRA) && \ (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_INT_8_8_8_8_REV)) || \ ((SPANTMP_PIXEL_FMT == GL_RGB) && \ @@ -440,7 +440,8 @@ static void TAG2(ReadRGBASpan,_MMX)( GLcontext *ctx, #endif -#if defined(USE_SSE_ASM) && \ +#if defined(GET_PTR) && \ + defined(USE_SSE_ASM) && \ (SPANTMP_PIXEL_FMT == GL_BGRA) && \ (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_INT_8_8_8_8_REV) static void TAG2(ReadRGBASpan,_SSE2)( GLcontext *ctx, @@ -474,7 +475,8 @@ static void TAG2(ReadRGBASpan,_SSE2)( GLcontext *ctx, } #endif -#if defined(USE_SSE_ASM) && \ +#if defined(GET_PTR) && \ + defined(USE_SSE_ASM) && \ (SPANTMP_PIXEL_FMT == GL_BGRA) && \ (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_INT_8_8_8_8_REV) static void TAG2(ReadRGBASpan,_SSE)( GLcontext *ctx, @@ -567,6 +569,7 @@ static void TAG(InitPointers)(struct gl_renderbuffer *rb) rb->PutMonoValues = TAG(WriteMonoRGBAPixels); rb->GetValues = TAG(ReadRGBAPixels); +#if defined(GET_PTR) #if defined(USE_SSE_ASM) && \ (SPANTMP_PIXEL_FMT == GL_BGRA) && \ (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_INT_8_8_8_8_REV) @@ -596,6 +599,7 @@ static void TAG(InitPointers)(struct gl_renderbuffer *rb) } else #endif +#endif /* GET_PTR */ { if (DBG) fprintf( stderr, "Using %s version of GetRow\n", "C" ); rb->GetRow = TAG(ReadRGBASpan); @@ -610,6 +614,8 @@ static void TAG(InitPointers)(struct gl_renderbuffer *rb) #undef READ_RGBA #undef TAG #undef TAG2 +#undef GET_VALUE +#undef PUT_VALUE #undef GET_PTR #undef SPANTMP_PIXEL_FMT #undef SPANTMP_PIXEL_TYPE diff --git a/src/mesa/drivers/dri/common/stenciltmp.h b/src/mesa/drivers/dri/common/stenciltmp.h index 324fc873d3..2b10b9ecfe 100644 --- a/src/mesa/drivers/dri/common/stenciltmp.h +++ b/src/mesa/drivers/dri/common/stenciltmp.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/common/stenciltmp.h,v 1.3 2001/03/21 16:14:20 dawes Exp $ */ #include "spantmp_common.h" diff --git a/src/mesa/drivers/dri/common/texmem.c b/src/mesa/drivers/dri/common/texmem.c index caabac3448..ff174a251d 100644 --- a/src/mesa/drivers/dri/common/texmem.c +++ b/src/mesa/drivers/dri/common/texmem.c @@ -28,7 +28,6 @@ * Kevin E. Martin <kem@users.sourceforge.net> * Gareth Hughes <gareth@nvidia.com> */ -/* $XFree86:$ */ /** \file texmem.c * Implements all of the device-independent texture memory management. @@ -44,10 +43,10 @@ */ #include "texmem.h" -#include "simple_list.h" -#include "imports.h" -#include "macros.h" -#include "texformat.h" +#include "main/simple_list.h" +#include "main/imports.h" +#include "main/macros.h" +#include "main/texformat.h" #include <assert.h> diff --git a/src/mesa/drivers/dri/common/texmem.h b/src/mesa/drivers/dri/common/texmem.h index 6692efcc30..9c065da8b4 100644 --- a/src/mesa/drivers/dri/common/texmem.h +++ b/src/mesa/drivers/dri/common/texmem.h @@ -28,7 +28,6 @@ * Kevin E. Martin <kem@users.sourceforge.net> * Gareth Hughes <gareth@nvidia.com> */ -/* $XFree86:$ */ /** \file texmem.h * Public interface to the DRI texture memory management routines. @@ -39,8 +38,8 @@ #ifndef DRI_TEXMEM_H #define DRI_TEXMEM_H -#include "mtypes.h" -#include "mm.h" +#include "main/mtypes.h" +#include "main/mm.h" #include "xf86drm.h" struct dri_tex_heap; diff --git a/src/mesa/drivers/dri/common/utils.c b/src/mesa/drivers/dri/common/utils.c index 7fbe0d855d..30c860b96c 100644 --- a/src/mesa/drivers/dri/common/utils.c +++ b/src/mesa/drivers/dri/common/utils.c @@ -31,10 +31,10 @@ #include <string.h> #include <stdlib.h> -#include "mtypes.h" -#include "extensions.h" +#include "main/mtypes.h" +#include "main/extensions.h" +#include "glapi/dispatch.h" #include "utils.h" -#include "dispatch.h" int driDispatchRemapTable[ driDispatchRemapTable_size ]; @@ -521,11 +521,11 @@ GLboolean driClipRectToFramebuffer( const GLframebuffer *buffer, */ __DRIconfig ** driCreateConfigs(GLenum fb_format, GLenum fb_type, - const u_int8_t * depth_bits, const u_int8_t * stencil_bits, + const uint8_t * depth_bits, const uint8_t * stencil_bits, unsigned num_depth_stencil_bits, const GLenum * db_modes, unsigned num_db_modes) { - static const u_int8_t bits_table[4][4] = { + static const uint8_t bits_table[4][4] = { /* R G B A */ { 3, 3, 2, 0 }, /* Any GL_UNSIGNED_BYTE_3_3_2 */ { 5, 6, 5, 0 }, /* Any GL_UNSIGNED_SHORT_5_6_5 */ @@ -533,7 +533,7 @@ driCreateConfigs(GLenum fb_format, GLenum fb_type, { 8, 8, 8, 8 } /* Any RGBA with any GL_UNSIGNED_INT_8_8_8_8 */ }; - static const u_int32_t masks_table_rgb[6][4] = { + static const uint32_t masks_table_rgb[6][4] = { { 0x000000E0, 0x0000001C, 0x00000003, 0x00000000 }, /* 3_3_2 */ { 0x00000007, 0x00000038, 0x000000C0, 0x00000000 }, /* 2_3_3_REV */ { 0x0000F800, 0x000007E0, 0x0000001F, 0x00000000 }, /* 5_6_5 */ @@ -542,7 +542,7 @@ driCreateConfigs(GLenum fb_format, GLenum fb_type, { 0x000000FF, 0x0000FF00, 0x00FF0000, 0x00000000 } /* 8_8_8_8_REV */ }; - static const u_int32_t masks_table_rgba[6][4] = { + static const uint32_t masks_table_rgba[6][4] = { { 0x000000E0, 0x0000001C, 0x00000003, 0x00000000 }, /* 3_3_2 */ { 0x00000007, 0x00000038, 0x000000C0, 0x00000000 }, /* 2_3_3_REV */ { 0x0000F800, 0x000007E0, 0x0000001F, 0x00000000 }, /* 5_6_5 */ @@ -551,7 +551,7 @@ driCreateConfigs(GLenum fb_format, GLenum fb_type, { 0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000 }, /* 8_8_8_8_REV */ }; - static const u_int32_t masks_table_bgr[6][4] = { + static const uint32_t masks_table_bgr[6][4] = { { 0x00000007, 0x00000038, 0x000000C0, 0x00000000 }, /* 3_3_2 */ { 0x000000E0, 0x0000001C, 0x00000003, 0x00000000 }, /* 2_3_3_REV */ { 0x0000001F, 0x000007E0, 0x0000F800, 0x00000000 }, /* 5_6_5 */ @@ -560,7 +560,7 @@ driCreateConfigs(GLenum fb_format, GLenum fb_type, { 0x00FF0000, 0x0000FF00, 0x000000FF, 0x00000000 }, /* 8_8_8_8_REV */ }; - static const u_int32_t masks_table_bgra[6][4] = { + static const uint32_t masks_table_bgra[6][4] = { { 0x00000007, 0x00000038, 0x000000C0, 0x00000000 }, /* 3_3_2 */ { 0x000000E0, 0x0000001C, 0x00000003, 0x00000000 }, /* 2_3_3_REV */ { 0x0000001F, 0x000007E0, 0x0000F800, 0x00000000 }, /* 5_6_5 */ @@ -569,7 +569,7 @@ driCreateConfigs(GLenum fb_format, GLenum fb_type, { 0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000 }, /* 8_8_8_8_REV */ }; - static const u_int8_t bytes_per_pixel[6] = { + static const uint8_t bytes_per_pixel[6] = { 1, /* 3_3_2 */ 1, /* 2_3_3_REV */ 2, /* 5_6_5 */ @@ -578,8 +578,8 @@ driCreateConfigs(GLenum fb_format, GLenum fb_type, 4 /* 8_8_8_8_REV */ }; - const u_int8_t * bits; - const u_int32_t * masks; + const uint8_t * bits; + const uint32_t * masks; int index; __DRIconfig **configs, **c; __GLcontextModes *modes; @@ -836,6 +836,10 @@ driGetConfigAttribIndex(const __DRIconfig *config, case __DRI_ATTRIB_SWAP_METHOD: break; + case __DRI_ATTRIB_FLOAT_MODE: + *value = config->modes.floatMode; + break; + default: *value = *(unsigned int *) ((char *) &config->modes + attribMap[index].offset); diff --git a/src/mesa/drivers/dri/common/utils.h b/src/mesa/drivers/dri/common/utils.h index 0c09a7e68f..0c974dbff3 100644 --- a/src/mesa/drivers/dri/common/utils.h +++ b/src/mesa/drivers/dri/common/utils.h @@ -24,14 +24,13 @@ * Authors: * Ian Romanick <idr@us.ibm.com> */ -/* $XFree86:$ */ #ifndef DRI_DEBUG_H #define DRI_DEBUG_H #include <GL/gl.h> #include <GL/internal/dri_interface.h> -#include "context.h" +#include "main/context.h" typedef struct __DRIutilversionRec2 __DRIutilversion2; @@ -130,7 +129,7 @@ struct __DRIconfigRec { extern __DRIconfig ** driCreateConfigs(GLenum fb_format, GLenum fb_type, - const u_int8_t * depth_bits, const u_int8_t * stencil_bits, + const uint8_t * depth_bits, const uint8_t * stencil_bits, unsigned num_depth_stencil_bits, const GLenum * db_modes, unsigned num_db_modes); diff --git a/src/mesa/drivers/dri/common/vblank.c b/src/mesa/drivers/dri/common/vblank.c index dc2cbcc84d..d610253fe6 100644 --- a/src/mesa/drivers/dri/common/vblank.c +++ b/src/mesa/drivers/dri/common/vblank.c @@ -25,13 +25,12 @@ * Authors: * Ian Romanick <idr@us.ibm.com> */ -/* $XFree86:$ */ -#include "glheader.h" +#include "main/glheader.h" #include "xf86drm.h" -#include "mtypes.h" -#include "macros.h" -#include "dd.h" +#include "main/mtypes.h" +#include "main/macros.h" +#include "main/dd.h" #include "vblank.h" #include "xmlpool.h" diff --git a/src/mesa/drivers/dri/common/vblank.h b/src/mesa/drivers/dri/common/vblank.h index 4613c09222..8b2c761a11 100644 --- a/src/mesa/drivers/dri/common/vblank.h +++ b/src/mesa/drivers/dri/common/vblank.h @@ -25,12 +25,11 @@ * Authors: * Ian Romanick <idr@us.ibm.com> */ -/* $XFree86:$ */ #ifndef DRI_VBLANK_H #define DRI_VBLANK_H -#include "context.h" +#include "main/context.h" #include "dri_util.h" #include "xmlconfig.h" diff --git a/src/mesa/drivers/dri/common/xmlconfig.c b/src/mesa/drivers/dri/common/xmlconfig.c index f6ae75520c..46ba2ffbfe 100644 --- a/src/mesa/drivers/dri/common/xmlconfig.c +++ b/src/mesa/drivers/dri/common/xmlconfig.c @@ -27,7 +27,7 @@ * \author Felix Kuehling */ -#include "glheader.h" +#include "main/glheader.h" #include <string.h> #include <assert.h> @@ -35,7 +35,7 @@ #include <fcntl.h> #include <unistd.h> #include <errno.h> -#include "imports.h" +#include "main/imports.h" #include "dri_util.h" #include "xmlconfig.h" diff --git a/src/mesa/drivers/dri/fb/fb_dri.c b/src/mesa/drivers/dri/fb/fb_dri.c index 16efd33368..f1194d7ce8 100644 --- a/src/mesa/drivers/dri/fb/fb_dri.c +++ b/src/mesa/drivers/dri/fb/fb_dri.c @@ -47,14 +47,14 @@ #include "drirenderbuffer.h" #include "buffers.h" -#include "extensions.h" -#include "framebuffer.h" -#include "renderbuffer.h" +#include "main/extensions.h" +#include "main/framebuffer.h" +#include "main/renderbuffer.h" #include "vbo/vbo.h" #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" #include "tnl/tnl.h" -#include "tnl/t_context.h" +#include "tnl/tcontext.h" #include "tnl/t_pipeline.h" #include "drivers/common/driverfuncs.h" @@ -678,8 +678,8 @@ fbFillInModes( __DRIscreenPrivate *psp, GLX_NONE, GLX_SWAP_UNDEFINED_OML /*, GLX_SWAP_COPY_OML */ }; - u_int8_t depth_bits_array[2]; - u_int8_t stencil_bits_array[2]; + uint8_t depth_bits_array[2]; + uint8_t stencil_bits_array[2]; depth_bits_array[0] = depth_bits; diff --git a/src/mesa/drivers/dri/fb/fb_egl.c b/src/mesa/drivers/dri/fb/fb_egl.c index 517e71f888..35c268441c 100644 --- a/src/mesa/drivers/dri/fb/fb_egl.c +++ b/src/mesa/drivers/dri/fb/fb_egl.c @@ -14,20 +14,20 @@ #include "utils.h" #include "buffers.h" -#include "extensions.h" -#include "framebuffer.h" -#include "renderbuffer.h" +#include "main/extensions.h" +#include "main/framebuffer.h" +#include "main/renderbuffer.h" #include "vbo/vbo.h" #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" #include "tnl/tnl.h" -#include "tnl/t_context.h" +#include "tnl/tcontext.h" #include "tnl/t_pipeline.h" #include "drivers/common/driverfuncs.h" #include "drirenderbuffer.h" #include "eglconfig.h" -#include "eglcontext.h" +#include "eglmain/context.h" #include "egldisplay.h" #include "egldriver.h" #include "eglglobals.h" @@ -113,8 +113,8 @@ fbFillInConfigs(_EGLDisplay *disp, unsigned pixel_bits, unsigned depth_bits, GLX_NONE, GLX_SWAP_UNDEFINED_OML /*, GLX_SWAP_COPY_OML */ }; - u_int8_t depth_bits_array[2]; - u_int8_t stencil_bits_array[2]; + uint8_t depth_bits_array[2]; + uint8_t stencil_bits_array[2]; depth_bits_array[0] = 0; depth_bits_array[1] = depth_bits; diff --git a/src/mesa/drivers/dri/ffb/ffb_bitmap.c b/src/mesa/drivers/dri/ffb/ffb_bitmap.c index 7263e83813..f89c0412df 100644 --- a/src/mesa/drivers/dri/ffb/ffb_bitmap.c +++ b/src/mesa/drivers/dri/ffb/ffb_bitmap.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_bitmap.c,v 1.1 2002/02/22 21:32:58 dawes Exp $ +/* * * GLX Hardware Device Driver for Sun Creator/Creator3D * Copyright (C) 2001 David S. Miller @@ -30,8 +30,8 @@ #include "ffb_lock.h" #include "ffb_bitmap.h" #include "swrast/swrast.h" -#include "image.h" -#include "macros.h" +#include "main/image.h" +#include "main/macros.h" /* Compute ceiling of integer quotient of A divided by B: */ #define CEILING( A, B ) ( (A) % (B) == 0 ? (A)/(B) : (A)/(B)+1 ) diff --git a/src/mesa/drivers/dri/ffb/ffb_bitmap.h b/src/mesa/drivers/dri/ffb/ffb_bitmap.h index 4f8d2ea2a6..0ccbc57bd0 100644 --- a/src/mesa/drivers/dri/ffb/ffb_bitmap.h +++ b/src/mesa/drivers/dri/ffb/ffb_bitmap.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_bitmap.h,v 1.1 2002/02/22 21:32:58 dawes Exp $ */ #ifndef _FFB_BITMAP_H #define _FFB_BITMAP_H diff --git a/src/mesa/drivers/dri/ffb/ffb_clear.c b/src/mesa/drivers/dri/ffb/ffb_clear.c index 2aa5836036..776fb487f8 100644 --- a/src/mesa/drivers/dri/ffb/ffb_clear.c +++ b/src/mesa/drivers/dri/ffb/ffb_clear.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_clear.c,v 1.2 2002/02/22 21:32:58 dawes Exp $ +/* * * GLX Hardware Device Driver for Sun Creator/Creator3D * Copyright (C) 2000 David S. Miller @@ -25,10 +25,10 @@ * David S. Miller <davem@redhat.com> */ -#include "mtypes.h" -#include "extensions.h" +#include "main/mtypes.h" +#include "main/extensions.h" -#include "mm.h" +#include "main/mm.h" #include "ffb_dd.h" #include "ffb_span.h" #include "ffb_depth.h" diff --git a/src/mesa/drivers/dri/ffb/ffb_context.h b/src/mesa/drivers/dri/ffb/ffb_context.h index df1b65d748..77f87d41c3 100644 --- a/src/mesa/drivers/dri/ffb/ffb_context.h +++ b/src/mesa/drivers/dri/ffb/ffb_context.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_context.h,v 1.2 2002/02/22 21:32:58 dawes Exp $ */ #ifndef _FFB_CONTEXT_H #define _FFB_CONTEXT_H @@ -6,7 +5,7 @@ #include "dri_util.h" #include "drm.h" -#include "mtypes.h" +#include "main/mtypes.h" #include "ffb_xmesa.h" diff --git a/src/mesa/drivers/dri/ffb/ffb_dd.c b/src/mesa/drivers/dri/ffb/ffb_dd.c index 53423bbae4..cf83b91f0d 100644 --- a/src/mesa/drivers/dri/ffb/ffb_dd.c +++ b/src/mesa/drivers/dri/ffb/ffb_dd.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_dd.c,v 1.4 2002/09/11 19:49:07 tsi Exp $ +/* * * GLX Hardware Device Driver for Sun Creator/Creator3D * Copyright (C) 2000, 2001 David S. Miller @@ -25,8 +25,9 @@ * David S. Miller <davem@redhat.com> */ -#include "mtypes.h" -#include "mm.h" +#include "main/mtypes.h" +#include "main/mm.h" +#include "main/extensions.h" #include "ffb_dd.h" #include "ffb_span.h" #include "ffb_depth.h" @@ -35,7 +36,6 @@ #include "ffb_tris.h" #include "ffb_clear.h" #include "ffb_lock.h" -#include "extensions.h" #define FFB_DATE "20021125" diff --git a/src/mesa/drivers/dri/ffb/ffb_dd.h b/src/mesa/drivers/dri/ffb/ffb_dd.h index 4ffcbe6666..1198cda30a 100644 --- a/src/mesa/drivers/dri/ffb/ffb_dd.h +++ b/src/mesa/drivers/dri/ffb/ffb_dd.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_dd.h,v 1.1 2000/06/20 05:08:38 dawes Exp $ +/* * * GLX Hardware Device Driver for Sun Creator/Creator3D. * Copyright (C) 2000 David S. Miller @@ -28,7 +28,7 @@ #ifndef _FFB_DD_H #define _FFB_DD_H -#include "context.h" +#include "main/context.h" void ffbDDInitDriverFuncs(GLcontext *ctx); void ffbDDExtensionsInit(GLcontext *ctx); diff --git a/src/mesa/drivers/dri/ffb/ffb_depth.c b/src/mesa/drivers/dri/ffb/ffb_depth.c index 68a2450eb7..71f204d21e 100644 --- a/src/mesa/drivers/dri/ffb/ffb_depth.c +++ b/src/mesa/drivers/dri/ffb/ffb_depth.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_depth.c,v 1.2 2002/02/22 21:32:58 dawes Exp $ +/* * * GLX Hardware Device Driver for Sun Creator/Creator3D * Copyright (C) 2000 David S. Miller @@ -25,7 +25,7 @@ * David S. Miller <davem@redhat.com> */ -#include "mtypes.h" +#include "main/mtypes.h" #include "swrast/swrast.h" #include "ffb_dd.h" #include "ffb_span.h" @@ -33,7 +33,6 @@ #include "ffb_depth.h" #include "ffb_lock.h" -#include "swrast/swrast.h" #undef DEPTH_TRACE diff --git a/src/mesa/drivers/dri/ffb/ffb_depth.h b/src/mesa/drivers/dri/ffb/ffb_depth.h index db908e7a63..8a1829ed49 100644 --- a/src/mesa/drivers/dri/ffb/ffb_depth.h +++ b/src/mesa/drivers/dri/ffb/ffb_depth.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_depth.h,v 1.1 2000/06/20 05:08:38 dawes Exp $ */ #ifndef _FFB_DEPTH_H #define _FFB_DEPTH_H diff --git a/src/mesa/drivers/dri/ffb/ffb_fifo.h b/src/mesa/drivers/dri/ffb/ffb_fifo.h index 886d71b76e..a175f38643 100644 --- a/src/mesa/drivers/dri/ffb/ffb_fifo.h +++ b/src/mesa/drivers/dri/ffb/ffb_fifo.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_fifo.h,v 1.2 2002/02/22 21:32:58 dawes Exp $ */ #ifndef _FFB_FIFO_H #define _FFB_FIFO_H diff --git a/src/mesa/drivers/dri/ffb/ffb_lines.c b/src/mesa/drivers/dri/ffb/ffb_lines.c index da1de18f36..19dff50935 100644 --- a/src/mesa/drivers/dri/ffb/ffb_lines.c +++ b/src/mesa/drivers/dri/ffb/ffb_lines.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_lines.c,v 1.2 2002/02/22 21:32:58 dawes Exp $ +/* * * GLX Hardware Device Driver for Sun Creator/Creator3D * Copyright (C) 2000, 2001 David S. Miller @@ -25,8 +25,9 @@ * David S. Miller <davem@redhat.com> */ -#include "mtypes.h" -#include "mm.h" +#include "main/mtypes.h" +#include "main/mm.h" +#include "main/extensions.h" #include "ffb_dd.h" #include "ffb_span.h" #include "ffb_depth.h" @@ -35,7 +36,6 @@ #include "ffb_lines.h" #include "ffb_tris.h" #include "ffb_lock.h" -#include "extensions.h" #undef FFB_LINE_TRACE diff --git a/src/mesa/drivers/dri/ffb/ffb_lines.h b/src/mesa/drivers/dri/ffb/ffb_lines.h index d508c243ea..ddb9365653 100644 --- a/src/mesa/drivers/dri/ffb/ffb_lines.h +++ b/src/mesa/drivers/dri/ffb/ffb_lines.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_lines.h,v 1.2 2002/02/22 21:32:58 dawes Exp $ */ #ifndef _FFB_LINES_H #define _FFB_LINES_H diff --git a/src/mesa/drivers/dri/ffb/ffb_linetmp.h b/src/mesa/drivers/dri/ffb/ffb_linetmp.h index aea84f5f23..10e1375259 100644 --- a/src/mesa/drivers/dri/ffb/ffb_linetmp.h +++ b/src/mesa/drivers/dri/ffb/ffb_linetmp.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_linetmp.h,v 1.2 2002/02/22 21:32:58 dawes Exp $ */ static INLINE void TAG(ffb_line)(GLcontext *ctx, ffb_vertex *v0, ffb_vertex *v1 ) diff --git a/src/mesa/drivers/dri/ffb/ffb_lock.h b/src/mesa/drivers/dri/ffb/ffb_lock.h index 7c49f740f8..1fd3eb5512 100644 --- a/src/mesa/drivers/dri/ffb/ffb_lock.h +++ b/src/mesa/drivers/dri/ffb/ffb_lock.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_lock.h,v 1.2 2002/02/22 21:32:59 dawes Exp $ */ #ifndef _FFB_LOCK_H #define _FFB_LOCK_H diff --git a/src/mesa/drivers/dri/ffb/ffb_points.c b/src/mesa/drivers/dri/ffb/ffb_points.c index a7496dd1d6..9c37a47aeb 100644 --- a/src/mesa/drivers/dri/ffb/ffb_points.c +++ b/src/mesa/drivers/dri/ffb/ffb_points.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_points.c,v 1.2 2002/02/22 21:32:59 dawes Exp $ +/* * * GLX Hardware Device Driver for Sun Creator/Creator3D * Copyright (C) 2000, 2001 David S. Miller @@ -25,7 +25,7 @@ * David S. Miller <davem@redhat.com> */ -#include "mtypes.h" +#include "main/mtypes.h" #include "ffb_dd.h" #include "ffb_context.h" #include "ffb_vb.h" diff --git a/src/mesa/drivers/dri/ffb/ffb_points.h b/src/mesa/drivers/dri/ffb/ffb_points.h index 7d5c1f8a03..a7229de7f1 100644 --- a/src/mesa/drivers/dri/ffb/ffb_points.h +++ b/src/mesa/drivers/dri/ffb/ffb_points.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_points.h,v 1.2 2002/02/22 21:32:59 dawes Exp $ */ #ifndef _FFB_POINTS_H #define _FFB_POINTS_H diff --git a/src/mesa/drivers/dri/ffb/ffb_pointtmp.h b/src/mesa/drivers/dri/ffb/ffb_pointtmp.h index c483e205dd..3003de70c6 100644 --- a/src/mesa/drivers/dri/ffb/ffb_pointtmp.h +++ b/src/mesa/drivers/dri/ffb/ffb_pointtmp.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_pointtmp.h,v 1.3 2002/02/22 21:32:59 dawes Exp $ */ static INLINE void TAG(ffb_draw_point)(GLcontext *ctx, ffb_vertex *tmp ) { diff --git a/src/mesa/drivers/dri/ffb/ffb_rendertmp.h b/src/mesa/drivers/dri/ffb/ffb_rendertmp.h index 26d991b081..64141c2c5f 100644 --- a/src/mesa/drivers/dri/ffb/ffb_rendertmp.h +++ b/src/mesa/drivers/dri/ffb/ffb_rendertmp.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_rendertmp.h,v 1.2 2003/01/29 23:00:40 dawes Exp $ */ #define IMPL_LOCAL_VARS \ ffbContextPtr fmesa = FFB_CONTEXT(ctx); \ diff --git a/src/mesa/drivers/dri/ffb/ffb_span.c b/src/mesa/drivers/dri/ffb/ffb_span.c index fff7fa1d3f..0d3d604095 100644 --- a/src/mesa/drivers/dri/ffb/ffb_span.c +++ b/src/mesa/drivers/dri/ffb/ffb_span.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_span.c,v 1.2 2002/02/22 21:32:59 dawes Exp $ +/* * * GLX Hardware Device Driver for Sun Creator/Creator3D * Copyright (C) 2000 David S. Miller @@ -25,7 +25,7 @@ * David S. Miller <davem@redhat.com> */ -#include "mtypes.h" +#include "main/mtypes.h" #include "ffb_dd.h" #include "ffb_span.h" #include "ffb_context.h" diff --git a/src/mesa/drivers/dri/ffb/ffb_span.h b/src/mesa/drivers/dri/ffb/ffb_span.h index 5ae227910d..37506cf30e 100644 --- a/src/mesa/drivers/dri/ffb/ffb_span.h +++ b/src/mesa/drivers/dri/ffb/ffb_span.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_span.h,v 1.1 2000/06/20 05:08:39 dawes Exp $ */ #ifndef _FFB_SPAN_H #define _FFB_SPAN_H diff --git a/src/mesa/drivers/dri/ffb/ffb_state.c b/src/mesa/drivers/dri/ffb/ffb_state.c index eb13478166..ee0fe4e0db 100644 --- a/src/mesa/drivers/dri/ffb/ffb_state.c +++ b/src/mesa/drivers/dri/ffb/ffb_state.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_state.c,v 1.5 2002/10/30 12:51:27 alanh Exp $ +/* * * GLX Hardware Device Driver for Sun Creator/Creator3D * Copyright (C) 2000, 2001 David S. Miller @@ -25,9 +25,18 @@ * David S. Miller <davem@redhat.com> */ -#include "mtypes.h" -#include "colormac.h" -#include "mm.h" +#include "main/mtypes.h" +#include "main/colormac.h" +#include "main/mm.h" +#include "main/extensions.h" +#include "main/enums.h" + +#include "vbo/vbo.h" +#include "tnl/tnl.h" +#include "tnl/t_pipeline.h" +#include "swrast/swrast.h" +#include "swrast_setup/swrast_setup.h" + #include "ffb_dd.h" #include "ffb_span.h" #include "ffb_depth.h" @@ -36,15 +45,6 @@ #include "ffb_tris.h" #include "ffb_state.h" #include "ffb_lock.h" -#include "extensions.h" -#include "enums.h" - -#include "swrast/swrast.h" -#include "vbo/vbo.h" -#include "tnl/tnl.h" -#include "swrast_setup/swrast_setup.h" - -#include "tnl/t_pipeline.h" #undef STATE_TRACE diff --git a/src/mesa/drivers/dri/ffb/ffb_state.h b/src/mesa/drivers/dri/ffb/ffb_state.h index 17b6fa20ab..19e72085fd 100644 --- a/src/mesa/drivers/dri/ffb/ffb_state.h +++ b/src/mesa/drivers/dri/ffb/ffb_state.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_state.h,v 1.2 2002/02/22 21:32:59 dawes Exp $ */ #ifndef _FFB_STATE_H #define _FFB_STATE_H diff --git a/src/mesa/drivers/dri/ffb/ffb_stencil.c b/src/mesa/drivers/dri/ffb/ffb_stencil.c index 2f13ee9210..921a83d274 100644 --- a/src/mesa/drivers/dri/ffb/ffb_stencil.c +++ b/src/mesa/drivers/dri/ffb/ffb_stencil.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_stencil.c,v 1.2 2002/02/22 21:32:59 dawes Exp $ +/* * * GLX Hardware Device Driver for Sun Creator/Creator3D * Copyright (C) 2000 David S. Miller @@ -25,7 +25,7 @@ * David S. Miller <davem@redhat.com> */ -#include "mtypes.h" +#include "main/mtypes.h" #include "ffb_dd.h" #include "ffb_span.h" #include "ffb_context.h" diff --git a/src/mesa/drivers/dri/ffb/ffb_stencil.h b/src/mesa/drivers/dri/ffb/ffb_stencil.h index c7da1ca681..2d529980d1 100644 --- a/src/mesa/drivers/dri/ffb/ffb_stencil.h +++ b/src/mesa/drivers/dri/ffb/ffb_stencil.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_stencil.h,v 1.1 2000/06/20 05:08:39 dawes Exp $ */ #ifndef _FFB_STENCIL_H #define _FFB_STENCIL_H diff --git a/src/mesa/drivers/dri/ffb/ffb_tex.c b/src/mesa/drivers/dri/ffb/ffb_tex.c index d6763b7cd3..69d30aedba 100644 --- a/src/mesa/drivers/dri/ffb/ffb_tex.c +++ b/src/mesa/drivers/dri/ffb/ffb_tex.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_tex.c,v 1.1 2002/02/22 21:32:59 dawes Exp $ +/* * * GLX Hardware Device Driver for Sun Creator/Creator3D * Copyright (C) 2001 David S. Miller @@ -25,8 +25,8 @@ * David S. Miller <davem@redhat.com> */ -#include "glheader.h" -#include "mtypes.h" +#include "main/glheader.h" +#include "main/mtypes.h" #include "ffb_tex.h" /* No texture unit, all software. */ diff --git a/src/mesa/drivers/dri/ffb/ffb_tex.h b/src/mesa/drivers/dri/ffb/ffb_tex.h index dba0e08af6..4032e73209 100644 --- a/src/mesa/drivers/dri/ffb/ffb_tex.h +++ b/src/mesa/drivers/dri/ffb/ffb_tex.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_tex.h,v 1.1 2002/02/22 21:32:59 dawes Exp $ +/* * * GLX Hardware Device Driver for Sun Creator/Creator3D. * Copyright (C) 2001 David S. Miller diff --git a/src/mesa/drivers/dri/ffb/ffb_tris.c b/src/mesa/drivers/dri/ffb/ffb_tris.c index 9fae8c8283..d785c15718 100644 --- a/src/mesa/drivers/dri/ffb/ffb_tris.c +++ b/src/mesa/drivers/dri/ffb/ffb_tris.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_tris.c,v 1.3 2002/10/30 12:51:28 alanh Exp $ +/* * * GLX Hardware Device Driver for Sun Creator/Creator3D * Copyright (C) 2000, 2001 David S. Miller @@ -25,12 +25,12 @@ * David S. Miller <davem@redhat.com> */ -#include "glheader.h" -#include "mtypes.h" -#include "macros.h" +#include "main/glheader.h" +#include "main/mtypes.h" +#include "main/macros.h" #include "swrast/swrast.h" -#include "swrast_setup/swrast_setup.h" #include "swrast/s_context.h" +#include "swrast_setup/swrast_setup.h" #include "tnl/t_context.h" #include "tnl/t_pipeline.h" diff --git a/src/mesa/drivers/dri/ffb/ffb_tris.h b/src/mesa/drivers/dri/ffb/ffb_tris.h index a803174b3e..116b8e07f1 100644 --- a/src/mesa/drivers/dri/ffb/ffb_tris.h +++ b/src/mesa/drivers/dri/ffb/ffb_tris.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_tris.h,v 1.2 2002/02/22 21:32:59 dawes Exp $ */ #ifndef _FFB_TRIS_H #define _FFB_TRIS_H diff --git a/src/mesa/drivers/dri/ffb/ffb_tritmp.h b/src/mesa/drivers/dri/ffb/ffb_tritmp.h index 612ef2433f..324a871ec4 100644 --- a/src/mesa/drivers/dri/ffb/ffb_tritmp.h +++ b/src/mesa/drivers/dri/ffb/ffb_tritmp.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_tritmp.h,v 1.2 2002/02/22 21:32:59 dawes Exp $ */ static void TAG(ffb_triangle)( GLcontext *ctx, ffb_vertex *v0, diff --git a/src/mesa/drivers/dri/ffb/ffb_vb.c b/src/mesa/drivers/dri/ffb/ffb_vb.c index 6ba1eabbf2..f9c6fd1f31 100644 --- a/src/mesa/drivers/dri/ffb/ffb_vb.c +++ b/src/mesa/drivers/dri/ffb/ffb_vb.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_vb.c,v 1.4 2002/02/22 21:32:59 dawes Exp $ +/* * * GLX Hardware Device Driver for Sun Creator/Creator3D * Copyright (C) 2000, 2001 David S. Miller @@ -28,7 +28,7 @@ #include "ffb_xmesa.h" #include "ffb_context.h" #include "ffb_vb.h" -#include "imports.h" +#include "main/imports.h" #include "tnl/t_context.h" #include "swrast_setup/swrast_setup.h" #include "math/m_translate.h" diff --git a/src/mesa/drivers/dri/ffb/ffb_vb.h b/src/mesa/drivers/dri/ffb/ffb_vb.h index 9eb6759f61..238b9940bf 100644 --- a/src/mesa/drivers/dri/ffb/ffb_vb.h +++ b/src/mesa/drivers/dri/ffb/ffb_vb.h @@ -1,10 +1,9 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_vb.h,v 1.2 2002/02/22 21:32:59 dawes Exp $ */ #ifndef _FFB_VB_H #define _FFB_VB_H -#include "mtypes.h" -#include "macros.h" +#include "main/mtypes.h" +#include "main/macros.h" #include "tnl/t_context.h" #include "swrast/swrast.h" diff --git a/src/mesa/drivers/dri/ffb/ffb_vbtmp.h b/src/mesa/drivers/dri/ffb/ffb_vbtmp.h index a1d1254d97..0495d0e276 100644 --- a/src/mesa/drivers/dri/ffb/ffb_vbtmp.h +++ b/src/mesa/drivers/dri/ffb/ffb_vbtmp.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_vbtmp.h,v 1.1 2002/02/22 21:32:59 dawes Exp $ */ static void TAG(emit)(GLcontext *ctx, GLuint start, GLuint end) { diff --git a/src/mesa/drivers/dri/ffb/ffb_vtxfmt.c b/src/mesa/drivers/dri/ffb/ffb_vtxfmt.c index df0096b18f..90f44b0e91 100644 --- a/src/mesa/drivers/dri/ffb/ffb_vtxfmt.c +++ b/src/mesa/drivers/dri/ffb/ffb_vtxfmt.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_vtxfmt.c,v 1.1 2002/02/22 21:32:59 dawes Exp $ +/* * * GLX Hardware Device Driver for Sun Creator/Creator3D * Copyright (C) 2001 David S. Miller @@ -25,20 +25,20 @@ * David S. Miller <davem@redhat.com> */ -#include "glheader.h" +#include "main/glheader.h" #include "api_noop.h" -#include "context.h" +#include "main/context.h" #include "light.h" -#include "macros.h" -#include "imports.h" -#include "mtypes.h" -#include "simple_list.h" +#include "main/macros.h" +#include "main/imports.h" +#include "main/mtypes.h" +#include "main/simple_list.h" #include "vtxfmt.h" #include "ffb_xmesa.h" #include "ffb_context.h" #include "ffb_vb.h" #include "tnl/tnl.h" -#include "tnl/t_context.h" +#include "tnl/tcontext.h" #include "ffb_vtxfmt.h" diff --git a/src/mesa/drivers/dri/ffb/ffb_vtxfmt.h b/src/mesa/drivers/dri/ffb/ffb_vtxfmt.h index 063bb4923e..4d9125cd15 100644 --- a/src/mesa/drivers/dri/ffb/ffb_vtxfmt.h +++ b/src/mesa/drivers/dri/ffb/ffb_vtxfmt.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_vtxfmt.h,v 1.1 2002/02/22 21:32:59 dawes Exp $ */ #ifndef _FFB_VTXFMT_H #define _FFB_VTXFMT_H diff --git a/src/mesa/drivers/dri/ffb/ffb_xmesa.c b/src/mesa/drivers/dri/ffb/ffb_xmesa.c index 7fd4e570d3..679f8561d2 100644 --- a/src/mesa/drivers/dri/ffb/ffb_xmesa.c +++ b/src/mesa/drivers/dri/ffb/ffb_xmesa.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_xmesa.c,v 1.4 2002/02/22 21:32:59 dawes Exp $ +/* * * GLX Hardware Device Driver for Sun Creator/Creator3D * Copyright (C) 2000, 2001 David S. Miller @@ -26,12 +26,12 @@ */ #include "ffb_xmesa.h" -#include "context.h" -#include "framebuffer.h" -#include "matrix.h" -#include "renderbuffer.h" -#include "simple_list.h" -#include "imports.h" +#include "main/context.h" +#include "main/framebuffer.h" +#include "main/matrix.h" +#include "main/renderbuffer.h" +#include "main/simple_list.h" +#include "main/imports.h" #include "utils.h" #include "swrast/swrast.h" @@ -226,7 +226,7 @@ ffbCreateContext(const __GLcontextModes *mesaVis, fmesa->driScreen = sPriv; fmesa->ffb_sarea = FFB_DRISHARE(sPriv->pSAREA); - /* Register and framebuffer hw pointers. */ + /* Register and framebuffer pointers. */ fmesa->regs = ffbScreen->regs; fmesa->sfb32 = ffbScreen->sfb32; @@ -624,8 +624,8 @@ ffbFillInModes( __DRIscreenPrivate *psp, GLX_NONE, GLX_SWAP_UNDEFINED_OML, GLX_SWAP_COPY_OML }; - u_int8_t depth_bits_array[3]; - u_int8_t stencil_bits_array[3]; + uint8_t depth_bits_array[3]; + uint8_t stencil_bits_array[3]; depth_bits_array[0] = 0; depth_bits_array[1] = depth_bits; diff --git a/src/mesa/drivers/dri/ffb/ffb_xmesa.h b/src/mesa/drivers/dri/ffb/ffb_xmesa.h index b7580780a6..255da4c5f8 100644 --- a/src/mesa/drivers/dri/ffb/ffb_xmesa.h +++ b/src/mesa/drivers/dri/ffb/ffb_xmesa.h @@ -1,11 +1,10 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_xmesa.h,v 1.2 2002/02/22 21:32:59 dawes Exp $ */ #ifndef _FFB_XMESA_H_ #define _FFB_XMESA_H_ #include <sys/time.h> #include "dri_util.h" -#include "mtypes.h" +#include "main/mtypes.h" #include "ffb_drishare.h" #include "ffb_regs.h" #include "ffb_dac.h" diff --git a/src/mesa/drivers/dri/ffb/server/ffb_dac.h b/src/mesa/drivers/dri/ffb/server/ffb_dac.h index 08114282e5..ac4a75b459 100644 --- a/src/mesa/drivers/dri/ffb/server/ffb_dac.h +++ b/src/mesa/drivers/dri/ffb/server/ffb_dac.h @@ -21,7 +21,6 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_dac.h,v 1.2 2001/04/05 17:42:33 dawes Exp $ */ #ifndef _FFB_DAC_H #define _FFB_DAC_H diff --git a/src/mesa/drivers/dri/ffb/server/ffb_drishare.h b/src/mesa/drivers/dri/ffb/server/ffb_drishare.h index baf2f0d0a6..69fefa3f0a 100644 --- a/src/mesa/drivers/dri/ffb/server/ffb_drishare.h +++ b/src/mesa/drivers/dri/ffb/server/ffb_drishare.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_drishare.h,v 1.2 2000/06/21 00:47:37 dawes Exp $ */ #ifndef _FFB_DRISHARE_H #define _FFB_DRISHARE_H diff --git a/src/mesa/drivers/dri/ffb/server/ffb_regs.h b/src/mesa/drivers/dri/ffb/server/ffb_regs.h index 7f383d38d6..bda5840d60 100644 --- a/src/mesa/drivers/dri/ffb/server/ffb_regs.h +++ b/src/mesa/drivers/dri/ffb/server/ffb_regs.h @@ -24,7 +24,6 @@ * USE OR OTHER DEALINGS IN THE SOFTWARE. * */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_regs.h,v 1.1 2000/05/18 23:21:37 dawes Exp $ */ #ifndef FFBREGS_H #define FFBREGS_H diff --git a/src/mesa/drivers/dri/gamma/gamma_client.h b/src/mesa/drivers/dri/gamma/gamma_client.h index 1c1a22ebc4..6dcf2e9438 100644 --- a/src/mesa/drivers/dri/gamma/gamma_client.h +++ b/src/mesa/drivers/dri/gamma/gamma_client.h @@ -31,7 +31,6 @@ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * - * $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_client.h,v 1.3 2002/02/22 21:33:00 dawes Exp $ * */ diff --git a/src/mesa/drivers/dri/gamma/gamma_context.c b/src/mesa/drivers/dri/gamma/gamma_context.c index b1dcbfcdcf..c91bedce3a 100644 --- a/src/mesa/drivers/dri/gamma/gamma_context.c +++ b/src/mesa/drivers/dri/gamma/gamma_context.c @@ -24,7 +24,7 @@ * 3DLabs Gamma driver. * */ -#include "gamma_context.h" +#include "gammacontext.h" #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" @@ -35,16 +35,16 @@ #include "drivers/common/driverfuncs.h" -#include "context.h" -#include "simple_list.h" -#include "imports.h" -#include "matrix.h" -#include "extensions.h" +#include "main/context.h" +#include "main/simple_list.h" +#include "main/imports.h" +#include "main/matrix.h" +#include "main/extensions.h" #if defined(USE_X86_ASM) #include "x86/common_x86_asm.h" #endif -#include "simple_list.h" -#include "mm.h" +#include "main/simple_list.h" +#include "main/mm.h" #include "gamma_vb.h" diff --git a/src/mesa/drivers/dri/gamma/gamma_context.h b/src/mesa/drivers/dri/gamma/gamma_context.h index ef7119c210..a32ccb6007 100644 --- a/src/mesa/drivers/dri/gamma/gamma_context.h +++ b/src/mesa/drivers/dri/gamma/gamma_context.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_context.h,v 1.6 2002/12/16 16:18:50 dawes Exp $ */ /* * Copyright 2001 by Alan Hourihane. * @@ -32,12 +31,12 @@ #include "drm_sarea.h" #include "colormac.h" #include "gamma_regs.h" -#include "gamma_macros.h" +#include "gamma_main/macros.h" #include "gamma_screen.h" -#include "macros.h" -#include "mtypes.h" +#include "main/macros.h" +#include "main/mtypes.h" #include "glint_dri.h" -#include "mm.h" +#include "main/mm.h" typedef union { unsigned int i; @@ -160,13 +159,13 @@ struct gamma_texture_object_t { int internalFormat; } image[GAMMA_TEX_MAXLEVELS]; - u_int32_t TextureBaseAddr[GAMMA_TEX_MAXLEVELS]; - u_int32_t TextureAddressMode; - u_int32_t TextureColorMode; - u_int32_t TextureFilterMode; - u_int32_t TextureFormat; - u_int32_t TextureReadMode; - u_int32_t TextureBorderColor; + uint32_t TextureBaseAddr[GAMMA_TEX_MAXLEVELS]; + uint32_t TextureAddressMode; + uint32_t TextureColorMode; + uint32_t TextureFilterMode; + uint32_t TextureFormat; + uint32_t TextureReadMode; + uint32_t TextureBorderColor; }; #define GAMMA_NO_PALETTE 0x0 @@ -300,18 +299,18 @@ struct gamma_context { unsigned int lastStamp; - u_int32_t ClearColor; - u_int32_t Color; - u_int32_t DitherMode; - u_int32_t ClearDepth; - u_int32_t FogMode; - u_int32_t AreaStippleMode; - u_int32_t LBReadFormat; - u_int32_t LBWriteFormat; - u_int32_t LineMode; - u_int32_t PointMode; - u_int32_t TriangleMode; - u_int32_t AntialiasMode; + uint32_t ClearColor; + uint32_t Color; + uint32_t DitherMode; + uint32_t ClearDepth; + uint32_t FogMode; + uint32_t AreaStippleMode; + uint32_t LBReadFormat; + uint32_t LBWriteFormat; + uint32_t LineMode; + uint32_t PointMode; + uint32_t TriangleMode; + uint32_t AntialiasMode; GLfloat ViewportScaleX; GLfloat ViewportScaleY; GLfloat ViewportScaleZ; diff --git a/src/mesa/drivers/dri/gamma/gamma_dd.c b/src/mesa/drivers/dri/gamma/gamma_dd.c index 63e3ab8fa5..7a81ef5993 100644 --- a/src/mesa/drivers/dri/gamma/gamma_dd.c +++ b/src/mesa/drivers/dri/gamma/gamma_dd.c @@ -23,14 +23,14 @@ * */ -#include "gamma_context.h" +#include "gammacontext.h" #include "gamma_vb.h" #include "gamma_lock.h" #if defined(USE_X86_ASM) #include "x86/common_x86_asm.h" #endif -#include "context.h" +#include "main/context.h" #include "swrast/swrast.h" #define GAMMA_DATE "20021125" diff --git a/src/mesa/drivers/dri/gamma/gamma_inithw.c b/src/mesa/drivers/dri/gamma/gamma_inithw.c index 47eb802b4e..525ad89354 100644 --- a/src/mesa/drivers/dri/gamma/gamma_inithw.c +++ b/src/mesa/drivers/dri/gamma/gamma_inithw.c @@ -23,9 +23,8 @@ * Kevin E. Martin <martin@valinux.com> * */ -/* $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_inithw.c,v 1.9 2002/10/30 12:51:29 alanh Exp $ */ -#include "gamma_context.h" +#include "gammacontext.h" #include "glint_dri.h" void gammaInitHW( gammaContextPtr gmesa ) diff --git a/src/mesa/drivers/dri/gamma/gamma_lock.c b/src/mesa/drivers/dri/gamma/gamma_lock.c index 2ab387fa27..8f2d01688c 100644 --- a/src/mesa/drivers/dri/gamma/gamma_lock.c +++ b/src/mesa/drivers/dri/gamma/gamma_lock.c @@ -1,6 +1,5 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_lock.c,v 1.4 2002/11/05 17:46:07 tsi Exp $ */ -#include "gamma_context.h" +#include "gammacontext.h" #include "gamma_lock.h" #include "drirenderbuffer.h" diff --git a/src/mesa/drivers/dri/gamma/gamma_macros.h b/src/mesa/drivers/dri/gamma/gamma_macros.h index 974fe569df..c15483b770 100644 --- a/src/mesa/drivers/dri/gamma/gamma_macros.h +++ b/src/mesa/drivers/dri/gamma/gamma_macros.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_macros.h,v 1.5 2002/02/22 21:33:02 dawes Exp $ */ /************************************************************************** Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. diff --git a/src/mesa/drivers/dri/gamma/gamma_regs.h b/src/mesa/drivers/dri/gamma/gamma_regs.h index 2edda07227..9e1c735019 100644 --- a/src/mesa/drivers/dri/gamma/gamma_regs.h +++ b/src/mesa/drivers/dri/gamma/gamma_regs.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_regs.h,v 1.5 2002/02/22 21:33:02 dawes Exp $ */ /************************************************************************** Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. diff --git a/src/mesa/drivers/dri/gamma/gamma_render.c b/src/mesa/drivers/dri/gamma/gamma_render.c index 2bc579c3f9..1b9fd169f4 100644 --- a/src/mesa/drivers/dri/gamma/gamma_render.c +++ b/src/mesa/drivers/dri/gamma/gamma_render.c @@ -25,15 +25,15 @@ * */ -#include "glheader.h" -#include "context.h" -#include "macros.h" -#include "imports.h" -#include "mtypes.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/macros.h" +#include "main/imports.h" +#include "main/mtypes.h" -#include "tnl/t_context.h" +#include "tnl/tcontext.h" -#include "gamma_context.h" +#include "gammacontext.h" #include "gamma_tris.h" #include "gamma_vb.h" @@ -74,7 +74,7 @@ static void gamma_emit( GLcontext *ctx, GLuint start, GLuint end) WRITEF(gmesa->buf, Tr4, tc0[i][2]); WRITEF(gmesa->buf, Tt4, tc0[i][0]); WRITEF(gmesa->buf, Ts4, tc0[i][1]); - WRITE(gmesa->buf, PackedColor4, *(u_int32_t*)col[i]); + WRITE(gmesa->buf, PackedColor4, *(uint32_t*)col[i]); WRITEF(gmesa->buf, Vw, coord[i][3]); WRITEF(gmesa->buf, Vz, coord[i][2]); WRITEF(gmesa->buf, Vy, coord[i][1]); @@ -85,7 +85,7 @@ static void gamma_emit( GLcontext *ctx, GLuint start, GLuint end) CHECK_DMA_BUFFER(gmesa, 7); WRITEF(gmesa->buf, Tt2, tc0[i][0]); WRITEF(gmesa->buf, Ts2, tc0[i][1]); - WRITE(gmesa->buf, PackedColor4, *(u_int32_t*)col[i]); + WRITE(gmesa->buf, PackedColor4, *(uint32_t*)col[i]); WRITEF(gmesa->buf, Vw, coord[i][3]); WRITEF(gmesa->buf, Vz, coord[i][2]); WRITEF(gmesa->buf, Vy, coord[i][1]); @@ -94,7 +94,7 @@ static void gamma_emit( GLcontext *ctx, GLuint start, GLuint end) } else { for (i=start; i < end; i++) { CHECK_DMA_BUFFER(gmesa, 4); - WRITE(gmesa->buf, PackedColor4, *(u_int32_t*)col[i]); + WRITE(gmesa->buf, PackedColor4, *(uint32_t*)col[i]); WRITEF(gmesa->buf, Vz, coord[i][2]); WRITEF(gmesa->buf, Vy, coord[i][1]); WRITEF(gmesa->buf, Vx3, coord[i][0]); diff --git a/src/mesa/drivers/dri/gamma/gamma_screen.c b/src/mesa/drivers/dri/gamma/gamma_screen.c index 0b91d059e9..f899ebec96 100644 --- a/src/mesa/drivers/dri/gamma/gamma_screen.c +++ b/src/mesa/drivers/dri/gamma/gamma_screen.c @@ -23,11 +23,11 @@ * */ -#include "gamma_context.h" +#include "gammacontext.h" #include "gamma_vb.h" #include "glint_dri.h" -#include "imports.h" +#include "main/imports.h" gammaScreenPtr gammaCreateScreen( __DRIscreenPrivate *sPriv ) { diff --git a/src/mesa/drivers/dri/gamma/gamma_span.c b/src/mesa/drivers/dri/gamma/gamma_span.c index f62bea9b66..cdaaac3f3a 100644 --- a/src/mesa/drivers/dri/gamma/gamma_span.c +++ b/src/mesa/drivers/dri/gamma/gamma_span.c @@ -1,6 +1,5 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_span.c,v 1.4 2002/11/05 17:46:07 tsi Exp $ */ -#include "gamma_context.h" +#include "gammacontext.h" #include "gamma_lock.h" #include "colormac.h" @@ -112,6 +111,8 @@ do { \ /* 16 bit depthbuffer functions. */ +#define VALUE_TYPE GLushort + #define WRITE_DEPTH( _x, _y, d ) \ *(GLushort *)(buf + (_x)*2 + (_y)*pitch) = d; @@ -125,6 +126,8 @@ do { \ #if 0 /* Unused */ /* 32 bit depthbuffer functions. */ +#define VALUE_TYPE GLuint + #define WRITE_DEPTH( _x, _y, d ) \ *(GLuint *)(buf + (_x)*4 + (_y)*pitch) = d; @@ -138,6 +141,8 @@ do { \ /* 24/8 bit interleaved depth/stencil functions */ +#define VALUE_TYPE GLuint + #define WRITE_DEPTH( _x, _y, d ) { \ GLuint tmp = *(GLuint *)(buf + (_x)*4 + (_y)*pitch); \ tmp &= 0xff; \ @@ -172,10 +177,10 @@ static void gammaReadRGBASpan8888( const GLcontext *ctx, { gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); gammaScreenPtr gammascrn = gmesa->gammaScreen; - u_int32_t dwords1, dwords2, i = 0; + uint32_t dwords1, dwords2, i = 0; char *src = (char *)rgba[0]; GLuint read = n * gammascrn->cpp; /* Number of bytes we are expecting */ - u_int32_t data; + uint32_t data; FLUSH_DMA_BUFFER(gmesa); CHECK_DMA_BUFFER(gmesa, 16); @@ -197,8 +202,8 @@ static void gammaReadRGBASpan8888( const GLcontext *ctx, moredata: - dwords1 = *(volatile u_int32_t*)(void *)(((u_int8_t*)gammascrn->regions[0].map) + (GlintOutFIFOWords)); - dwords2 = *(volatile u_int32_t*)(void *)(((u_int8_t*)gammascrn->regions[2].map) + (GlintOutFIFOWords)); + dwords1 = *(volatile uint32_t*)(void *)(((uint8_t*)gammascrn->regions[0].map) + (GlintOutFIFOWords)); + dwords2 = *(volatile uint32_t*)(void *)(((uint8_t*)gammascrn->regions[2].map) + (GlintOutFIFOWords)); if (dwords1) { memcpy(src, (char*)gammascrn->regions[1].map + 0x1000, dwords1 << 2); diff --git a/src/mesa/drivers/dri/gamma/gamma_state.c b/src/mesa/drivers/dri/gamma/gamma_state.c index 8dbe0a97ca..59272f9bc9 100644 --- a/src/mesa/drivers/dri/gamma/gamma_state.c +++ b/src/mesa/drivers/dri/gamma/gamma_state.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_state.c,v 1.5 2002/11/05 17:46:07 tsi Exp $ */ /* * Copyright 2001 by Alan Hourihane. * @@ -25,10 +24,10 @@ * 3DLabs Gamma driver */ -#include "gamma_context.h" -#include "gamma_macros.h" +#include "gammacontext.h" +#include "gamma_main/macros.h" #include "buffers.h" -#include "macros.h" +#include "main/macros.h" #include "glint_dri.h" #include "colormac.h" #include "swrast/swrast.h" @@ -45,9 +44,9 @@ static void gammaUpdateAlphaMode( GLcontext *ctx ) { gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); - u_int32_t a = gmesa->AlphaTestMode; - u_int32_t b = gmesa->AlphaBlendMode; - u_int32_t f = gmesa->AB_FBReadMode_Save = 0; + uint32_t a = gmesa->AlphaTestMode; + uint32_t b = gmesa->AlphaBlendMode; + uint32_t f = gmesa->AB_FBReadMode_Save = 0; GLubyte refByte = (GLint) (ctx->Color.AlphaRef * 255.0); a &= ~(AT_CompareMask | AT_RefValueMask); @@ -419,10 +418,10 @@ static void gammaDDClear( GLcontext *ctx, GLbitfield mask ) static void gammaUpdateZMode( GLcontext *ctx ) { gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); - u_int32_t z = gmesa->DepthMode; - u_int32_t delta = gmesa->DeltaMode; - u_int32_t window = gmesa->Window; - u_int32_t lbread = gmesa->LBReadMode; + uint32_t z = gmesa->DepthMode; + uint32_t delta = gmesa->DeltaMode; + uint32_t window = gmesa->Window; + uint32_t lbread = gmesa->LBReadMode; z &= ~DM_CompareMask; @@ -538,9 +537,9 @@ static void gammaDDFlush( GLcontext *ctx ) static void gammaUpdateFogAttrib( GLcontext *ctx ) { gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); - u_int32_t f = gmesa->FogMode; - u_int32_t g = gmesa->GeometryMode; - u_int32_t d = gmesa->DeltaMode; + uint32_t f = gmesa->FogMode; + uint32_t g = gmesa->GeometryMode; + uint32_t d = gmesa->DeltaMode; if (ctx->Fog.Enabled) { f |= FogModeEnable; @@ -636,7 +635,7 @@ static void gammaDDPointSize( GLcontext *ctx, GLfloat size ) static void gammaUpdatePolygon( GLcontext *ctx ) { gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); - u_int32_t g = gmesa->GeometryMode; + uint32_t g = gmesa->GeometryMode; g &= ~(GM_PolyOffsetFillEnable | GM_PolyOffsetPointEnable | GM_PolyOffsetLineEnable); @@ -754,7 +753,7 @@ static void gammaDDScissor( GLcontext *ctx, static void gammaUpdateCull( GLcontext *ctx ) { gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); - u_int32_t g = gmesa->GeometryMode; + uint32_t g = gmesa->GeometryMode; g &= ~(GM_PolyCullMask | GM_FFMask); @@ -974,8 +973,8 @@ static void gammaDDLightModelfv( GLcontext *ctx, GLenum pname, static void gammaDDShadeModel( GLcontext *ctx, GLenum mode ) { gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); - u_int32_t g = gmesa->GeometryMode; - u_int32_t c = gmesa->ColorDDAMode; + uint32_t g = gmesa->GeometryMode; + uint32_t c = gmesa->ColorDDAMode; g &= ~GM_ShadingMask; c &= ~ColorDDAShadingMask; @@ -1242,7 +1241,7 @@ static void gammaDDEnable( GLcontext *ctx, GLenum cap, GLboolean state ) case GL_DITHER: do { - u_int32_t d = gmesa->DitherMode; + uint32_t d = gmesa->DitherMode; FLUSH_BATCH( gmesa ); if ( state ) { @@ -1274,7 +1273,7 @@ static void gammaDDEnable( GLcontext *ctx, GLenum cap, GLboolean state ) #if ENABLELIGHTING case GL_LIGHTING: do { - u_int32_t l = gmesa->LightingMode; + uint32_t l = gmesa->LightingMode; FLUSH_BATCH( gmesa ); if ( state ) { @@ -1292,7 +1291,7 @@ static void gammaDDEnable( GLcontext *ctx, GLenum cap, GLboolean state ) case GL_COLOR_MATERIAL: do { - u_int32_t m = gmesa->MaterialMode; + uint32_t m = gmesa->MaterialMode; FLUSH_BATCH( gmesa ); if ( state ) { diff --git a/src/mesa/drivers/dri/gamma/gamma_tex.c b/src/mesa/drivers/dri/gamma/gamma_tex.c index d4fc93f86b..2ffb790f28 100644 --- a/src/mesa/drivers/dri/gamma/gamma_tex.c +++ b/src/mesa/drivers/dri/gamma/gamma_tex.c @@ -1,21 +1,20 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_tex.c,v 1.4 2002/11/05 17:46:07 tsi Exp $ */ #include <stdlib.h> #include <stdio.h> -#include "glheader.h" -#include "mtypes.h" -#include "imports.h" -#include "simple_list.h" -#include "enums.h" -#include "texstore.h" +#include "main/glheader.h" +#include "main/mtypes.h" +#include "main/imports.h" +#include "main/simple_list.h" +#include "main/enums.h" +#include "main/texstore.h" #include "teximage.h" -#include "texformat.h" +#include "main/texformat.h" #include "texobj.h" #include "swrast/swrast.h" -#include "mm.h" -#include "gamma_context.h" +#include "main/mm.h" +#include "gammacontext.h" #include "colormac.h" @@ -32,8 +31,8 @@ static GLuint gammaComputeLodBias(GLfloat bias) static void gammaSetTexWrapping(gammaTextureObjectPtr t, GLenum wraps, GLenum wrapt) { - u_int32_t t1 = t->TextureAddressMode; - u_int32_t t2 = t->TextureReadMode; + uint32_t t1 = t->TextureAddressMode; + uint32_t t2 = t->TextureReadMode; t1 &= ~(TAM_SWrap_Mask | TAM_TWrap_Mask); t2 &= ~(TRM_UWrap_Mask | TRM_VWrap_Mask); @@ -58,8 +57,8 @@ static void gammaSetTexFilter(gammaContextPtr gmesa, GLenum minf, GLenum magf, GLfloat bias) { - u_int32_t t1 = t->TextureAddressMode; - u_int32_t t2 = t->TextureReadMode; + uint32_t t1 = t->TextureAddressMode; + uint32_t t2 = t->TextureReadMode; t2 &= ~(TRM_Mag_Mask | TRM_Min_Mask); diff --git a/src/mesa/drivers/dri/gamma/gamma_texmem.c b/src/mesa/drivers/dri/gamma/gamma_texmem.c index 506b5c4c8f..4cb47e179e 100644 --- a/src/mesa/drivers/dri/gamma/gamma_texmem.c +++ b/src/mesa/drivers/dri/gamma/gamma_texmem.c @@ -1,18 +1,17 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_texmem.c,v 1.5 2002/11/05 17:46:07 tsi Exp $ */ #include <stdlib.h> #include <stdio.h> -#include "glheader.h" +#include "main/glheader.h" #include "colormac.h" -#include "macros.h" -#include "mtypes.h" -#include "simple_list.h" -#include "enums.h" +#include "main/macros.h" +#include "main/mtypes.h" +#include "main/simple_list.h" +#include "main/enums.h" -#include "mm.h" +#include "main/mm.h" #include "glint_dri.h" -#include "gamma_context.h" +#include "gammacontext.h" #include "gamma_lock.h" void gammaDestroyTexObj(gammaContextPtr gmesa, gammaTextureObjectPtr t) diff --git a/src/mesa/drivers/dri/gamma/gamma_texstate.c b/src/mesa/drivers/dri/gamma/gamma_texstate.c index a8d1b253c7..b3a318d581 100644 --- a/src/mesa/drivers/dri/gamma/gamma_texstate.c +++ b/src/mesa/drivers/dri/gamma/gamma_texstate.c @@ -1,16 +1,15 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_texstate.c,v 1.5 2002/11/05 17:46:07 tsi Exp $ */ #include <stdlib.h> #include <stdio.h> -#include "glheader.h" -#include "macros.h" -#include "mtypes.h" -#include "simple_list.h" -#include "enums.h" +#include "main/glheader.h" +#include "main/macros.h" +#include "main/mtypes.h" +#include "main/simple_list.h" +#include "main/enums.h" -#include "mm.h" -#include "gamma_context.h" +#include "main/mm.h" +#include "gammacontext.h" static void gammaSetTexImages( gammaContextPtr gmesa, struct gl_texture_object *tObj ) diff --git a/src/mesa/drivers/dri/gamma/gamma_tris.c b/src/mesa/drivers/dri/gamma/gamma_tris.c index 83bf56a141..2903daf3f1 100644 --- a/src/mesa/drivers/dri/gamma/gamma_tris.c +++ b/src/mesa/drivers/dri/gamma/gamma_tris.c @@ -25,19 +25,19 @@ * 3DLabs Gamma driver. */ -#include "gamma_context.h" +#include "gammacontext.h" #include "gamma_vb.h" #include "gamma_tris.h" -#include "glheader.h" -#include "mtypes.h" -#include "macros.h" +#include "main/glheader.h" +#include "main/mtypes.h" +#include "main/macros.h" #include "colormac.h" #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" #include "tnl/tnl.h" -#include "tnl/t_context.h" +#include "tnl/tcontext.h" #include "tnl/t_pipeline.h" diff --git a/src/mesa/drivers/dri/gamma/gamma_tritmp.h b/src/mesa/drivers/dri/gamma/gamma_tritmp.h index 23459ff156..bea2508d4a 100644 --- a/src/mesa/drivers/dri/gamma/gamma_tritmp.h +++ b/src/mesa/drivers/dri/gamma/gamma_tritmp.h @@ -1,10 +1,9 @@ -/* $XFree86: xc/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_tritmp.h,v 1.2 2004/12/13 22:40:49 tsi Exp $ */ static void TAG(gamma_point)( gammaContextPtr gmesa, const gammaVertex *v0 ) { - u_int32_t vColor; - u_int32_t vBegin; + uint32_t vColor; + uint32_t vBegin; vBegin = gmesa->Begin | B_PrimType_Points; @@ -57,8 +56,8 @@ static void TAG(gamma_line)( gammaContextPtr gmesa, const gammaVertex *v0, const gammaVertex *v1 ) { - u_int32_t vColor; - u_int32_t vBegin; + uint32_t vColor; + uint32_t vBegin; vBegin = gmesa->Begin | B_PrimType_Lines; @@ -166,8 +165,8 @@ static void TAG(gamma_triangle)( gammaContextPtr gmesa, const gammaVertex *v1, const gammaVertex *v2 ) { - u_int32_t vColor; - u_int32_t vBegin; + uint32_t vColor; + uint32_t vBegin; vBegin = gmesa->Begin | B_PrimType_Triangles; @@ -311,8 +310,8 @@ static void TAG(gamma_quad)( gammaContextPtr gmesa, const gammaVertex *v2, const gammaVertex *v3 ) { - u_int32_t vColor; - u_int32_t vBegin; + uint32_t vColor; + uint32_t vBegin; vBegin = gmesa->Begin | B_PrimType_Quads; diff --git a/src/mesa/drivers/dri/gamma/gamma_vb.c b/src/mesa/drivers/dri/gamma/gamma_vb.c index 80d35cba9e..23ca0714c5 100644 --- a/src/mesa/drivers/dri/gamma/gamma_vb.c +++ b/src/mesa/drivers/dri/gamma/gamma_vb.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_vb.c,v 1.4 2003/03/26 20:43:48 tsi Exp $ */ /* * Copyright 2001 by Alan Hourihane. * @@ -26,17 +25,17 @@ * 3DLabs Gamma driver. */ -#include "glheader.h" -#include "mtypes.h" -#include "imports.h" -#include "macros.h" +#include "main/glheader.h" +#include "main/mtypes.h" +#include "main/imports.h" +#include "main/macros.h" #include "colormac.h" #include "swrast_setup/swrast_setup.h" -#include "tnl/t_context.h" +#include "tnl/tcontext.h" #include "tnl/tnl.h" -#include "gamma_context.h" +#include "gammacontext.h" #include "gamma_vb.h" #include "gamma_tris.h" diff --git a/src/mesa/drivers/dri/gamma/gamma_vb.h b/src/mesa/drivers/dri/gamma/gamma_vb.h index feda25c4c6..8701226f59 100644 --- a/src/mesa/drivers/dri/gamma/gamma_vb.h +++ b/src/mesa/drivers/dri/gamma/gamma_vb.h @@ -28,7 +28,7 @@ #ifndef GAMMAVB_INC #define GAMMAVB_INC -#include "mtypes.h" +#include "main/mtypes.h" #include "swrast/swrast.h" #define _GAMMA_NEW_VERTEX (_NEW_TEXTURE | \ diff --git a/src/mesa/drivers/dri/gamma/gamma_xmesa.c b/src/mesa/drivers/dri/gamma/gamma_xmesa.c index 62f0bb578c..2a28902e1e 100644 --- a/src/mesa/drivers/dri/gamma/gamma_xmesa.c +++ b/src/mesa/drivers/dri/gamma/gamma_xmesa.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_xmesa.c,v 1.14 2002/10/30 12:51:30 alanh Exp $ */ /* * Copyright 2001 by Alan Hourihane. * @@ -25,10 +24,10 @@ * 3DLabs Gamma driver */ -#include "gamma_context.h" +#include "gammacontext.h" #include "gamma_vb.h" -#include "context.h" -#include "matrix.h" +#include "main/context.h" +#include "main/matrix.h" #include "glint_dri.h" #include "swrast/swrast.h" diff --git a/src/mesa/drivers/dri/gamma/server/glint_common.h b/src/mesa/drivers/dri/gamma/server/glint_common.h index ec601f942d..36554e4ac2 100644 --- a/src/mesa/drivers/dri/gamma/server/glint_common.h +++ b/src/mesa/drivers/dri/gamma/server/glint_common.h @@ -25,7 +25,6 @@ * Converted to common header format: * Jens Owen <jens@tungstengraphics.com> * - * $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/glint_common.h,v 1.2 2003/04/03 16:52:18 dawes Exp $ * */ diff --git a/src/mesa/drivers/dri/gamma/server/glint_dri.h b/src/mesa/drivers/dri/gamma/server/glint_dri.h index 3952759f83..df1992a5d1 100644 --- a/src/mesa/drivers/dri/gamma/server/glint_dri.h +++ b/src/mesa/drivers/dri/gamma/server/glint_dri.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/glint_dri.h,v 1.7 2002/10/30 12:52:16 alanh Exp $ */ /************************************************************************** Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. diff --git a/src/mesa/drivers/dri/i810/i810_3d_reg.h b/src/mesa/drivers/dri/i810/i810_3d_reg.h index 7cc59d5c86..2fbeb64978 100644 --- a/src/mesa/drivers/dri/i810/i810_3d_reg.h +++ b/src/mesa/drivers/dri/i810/i810_3d_reg.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/i810/i810_3d_reg.h,v 1.7 2002/02/22 21:33:03 dawes Exp $ */ #ifndef I810_3D_REG_H #define I810_3D_REG_H diff --git a/src/mesa/drivers/dri/i810/i810context.c b/src/mesa/drivers/dri/i810/i810context.c index 9e09bddea3..c281a4990e 100644 --- a/src/mesa/drivers/dri/i810/i810context.c +++ b/src/mesa/drivers/dri/i810/i810context.c @@ -24,7 +24,6 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ -/* $XFree86: xc/lib/GL/mesa/src/drv/i810/i810context.c,v 1.3 2002/10/30 12:51:33 alanh Exp $ */ /* * Authors: @@ -33,14 +32,14 @@ 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 "points.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/matrix.h" +#include "main/simple_list.h" +#include "main/extensions.h" +#include "main/framebuffer.h" +#include "main/imports.h" +#include "main/points.h" #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" diff --git a/src/mesa/drivers/dri/i810/i810context.h b/src/mesa/drivers/dri/i810/i810context.h index b83500bbd0..4b8c71d7c6 100644 --- a/src/mesa/drivers/dri/i810/i810context.h +++ b/src/mesa/drivers/dri/i810/i810context.h @@ -21,7 +21,6 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * */ -/* $XFree86: xc/lib/GL/mesa/src/drv/i810/i810context.h,v 1.9 2002/12/16 16:18:51 dawes Exp $ */ #ifndef I810CONTEXT_INC #define I810CONTEXT_INC @@ -31,8 +30,8 @@ typedef struct i810_context_t *i810ContextPtr; typedef struct i810_texture_object_t *i810TextureObjectPtr; #include "drm.h" -#include "mtypes.h" -#include "mm.h" +#include "main/mtypes.h" +#include "main/mm.h" #include "i810screen.h" #include "i810tex.h" diff --git a/src/mesa/drivers/dri/i810/i810ioctl.c b/src/mesa/drivers/dri/i810/i810ioctl.c index 57c84193fa..3df9c2ac47 100644 --- a/src/mesa/drivers/dri/i810/i810ioctl.c +++ b/src/mesa/drivers/dri/i810/i810ioctl.c @@ -1,18 +1,17 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/i810/i810ioctl.c,v 1.7 2002/10/30 12:51:33 alanh Exp $ */ #include <unistd.h> /* for usleep() */ -#include "glheader.h" -#include "mtypes.h" -#include "macros.h" -#include "dd.h" +#include "main/glheader.h" +#include "main/mtypes.h" +#include "main/macros.h" +#include "main/dd.h" #include "swrast/swrast.h" -#include "mm.h" +#include "main/mm.h" #include "i810screen.h" #include "i810_dri.h" -#include "i810context.h" +#include "main/context.h" #include "i810ioctl.h" #include "i810state.h" diff --git a/src/mesa/drivers/dri/i810/i810ioctl.h b/src/mesa/drivers/dri/i810/i810ioctl.h index eda15adfb6..dfd6e21088 100644 --- a/src/mesa/drivers/dri/i810/i810ioctl.h +++ b/src/mesa/drivers/dri/i810/i810ioctl.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/i810/i810ioctl.h,v 1.7 2002/10/30 12:51:33 alanh Exp $ */ #ifndef I810_IOCTL_H #define I810_IOCTL_H diff --git a/src/mesa/drivers/dri/i810/i810render.c b/src/mesa/drivers/dri/i810/i810render.c index d0225969b6..1d98e00688 100644 --- a/src/mesa/drivers/dri/i810/i810render.c +++ b/src/mesa/drivers/dri/i810/i810render.c @@ -31,11 +31,11 @@ * 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 "main/glheader.h" +#include "main/context.h" +#include "main/macros.h" +#include "main/imports.h" +#include "main/mtypes.h" #include "tnl/t_context.h" diff --git a/src/mesa/drivers/dri/i810/i810screen.c b/src/mesa/drivers/dri/i810/i810screen.c index 4bfe6f264f..48603f5d79 100644 --- a/src/mesa/drivers/dri/i810/i810screen.c +++ b/src/mesa/drivers/dri/i810/i810screen.c @@ -24,7 +24,6 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ -/* $XFree86: xc/lib/GL/mesa/src/drv/i810/i810screen.c,v 1.2 2002/10/30 12:51:33 alanh Exp $ */ /* * Authors: @@ -33,14 +32,14 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include "glheader.h" -#include "imports.h" -#include "context.h" -#include "framebuffer.h" -#include "fbobject.h" -#include "matrix.h" -#include "renderbuffer.h" -#include "simple_list.h" +#include "main/glheader.h" +#include "main/imports.h" +#include "main/context.h" +#include "main/framebuffer.h" +#include "main/fbobject.h" +#include "main/matrix.h" +#include "main/renderbuffer.h" +#include "main/simple_list.h" #include "utils.h" #include "i810screen.h" @@ -76,8 +75,8 @@ i810FillInModes( __DRIscreenPrivate *psp, GLX_NONE, GLX_SWAP_UNDEFINED_OML /*, GLX_SWAP_COPY_OML */ }; - u_int8_t depth_bits_array[2]; - u_int8_t stencil_bits_array[2]; + uint8_t depth_bits_array[2]; + uint8_t stencil_bits_array[2]; depth_bits_array[0] = depth_bits; depth_bits_array[1] = depth_bits; diff --git a/src/mesa/drivers/dri/i810/i810span.c b/src/mesa/drivers/dri/i810/i810span.c index 2112800eeb..510723f445 100644 --- a/src/mesa/drivers/dri/i810/i810span.c +++ b/src/mesa/drivers/dri/i810/i810span.c @@ -1,14 +1,14 @@ -#include "glheader.h" -#include "macros.h" -#include "mtypes.h" -#include "colormac.h" +#include "main/glheader.h" +#include "main/macros.h" +#include "main/mtypes.h" +#include "main/colormac.h" +#include "swrast/swrast.h" #include "i810screen.h" #include "i810_dri.h" #include "i810span.h" #include "i810ioctl.h" -#include "swrast/swrast.h" #define DBG 0 @@ -67,6 +67,8 @@ do { \ /* 16 bit depthbuffer functions. */ +#define VALUE_TYPE GLushort + #define WRITE_DEPTH( _x, _y, d ) \ *(GLushort *)(buf + (_x)*2 + (_y)*pitch) = d; diff --git a/src/mesa/drivers/dri/i810/i810state.c b/src/mesa/drivers/dri/i810/i810state.c index 4b3cb873b8..1e7a6cfe47 100644 --- a/src/mesa/drivers/dri/i810/i810state.c +++ b/src/mesa/drivers/dri/i810/i810state.c @@ -1,12 +1,16 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/i810/i810state.c,v 1.9 2002/10/30 12:51:33 alanh Exp $ */ #include <stdio.h> -#include "glheader.h" -#include "context.h" -#include "macros.h" -#include "dd.h" -#include "colormac.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/macros.h" +#include "main/dd.h" +#include "main/colormac.h" +#include "swrast/swrast.h" +#include "tnl/tnl.h" +#include "tnl/t_pipeline.h" +#include "vbo/vbo.h" +#include "swrast_setup/swrast_setup.h" #include "texmem.h" @@ -20,12 +24,6 @@ #include "i810tris.h" #include "i810ioctl.h" -#include "swrast/swrast.h" -#include "tnl/tnl.h" -#include "vbo/vbo.h" -#include "swrast_setup/swrast_setup.h" - -#include "tnl/t_pipeline.h" static INLINE GLuint i810PackColor(GLuint format, GLubyte r, GLubyte g, diff --git a/src/mesa/drivers/dri/i810/i810tex.c b/src/mesa/drivers/dri/i810/i810tex.c index f657abe671..ba4e6b5b0b 100644 --- a/src/mesa/drivers/dri/i810/i810tex.c +++ b/src/mesa/drivers/dri/i810/i810tex.c @@ -21,22 +21,22 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * */ -/* $XFree86: xc/lib/GL/mesa/src/drv/i810/i810tex.c,v 1.9 2002/10/30 12:51:33 alanh Exp $ */ - -#include "glheader.h" -#include "mtypes.h" -#include "imports.h" -#include "simple_list.h" -#include "enums.h" -#include "texstore.h" -#include "texformat.h" -#include "teximage.h" -#include "texmem.h" -#include "texobj.h" + +#include "main/glheader.h" +#include "main/mtypes.h" +#include "main/imports.h" +#include "main/simple_list.h" +#include "main/enums.h" +#include "main/texstore.h" +#include "main/texformat.h" +#include "main/teximage.h" +#include "main/texobj.h" +#include "main/colormac.h" +#include "main/texobj.h" +#include "main/mm.h" #include "swrast/swrast.h" -#include "colormac.h" -#include "texobj.h" -#include "mm.h" + +#include "texmem.h" #include "i810screen.h" #include "i810_dri.h" diff --git a/src/mesa/drivers/dri/i810/i810tex.h b/src/mesa/drivers/dri/i810/i810tex.h index c6ab4c8e6d..d980927030 100644 --- a/src/mesa/drivers/dri/i810/i810tex.h +++ b/src/mesa/drivers/dri/i810/i810tex.h @@ -26,8 +26,8 @@ #ifndef I810TEX_INC #define I810TEX_INC -#include "mtypes.h" -#include "mm.h" +#include "main/mtypes.h" +#include "main/mm.h" #include "i810context.h" #include "i810_3d_reg.h" diff --git a/src/mesa/drivers/dri/i810/i810texmem.c b/src/mesa/drivers/dri/i810/i810texmem.c index 9c24fcd8f5..5ad66dbf5c 100644 --- a/src/mesa/drivers/dri/i810/i810texmem.c +++ b/src/mesa/drivers/dri/i810/i810texmem.c @@ -23,18 +23,17 @@ * */ -#include "glheader.h" -#include "macros.h" -#include "mtypes.h" -#include "simple_list.h" -#include "enums.h" -#include "colormac.h" -#include "mm.h" -#include "texformat.h" +#include "main/glheader.h" +#include "main/macros.h" +#include "main/mtypes.h" +#include "main/simple_list.h" +#include "main/enums.h" +#include "main/colormac.h" +#include "main/mm.h" +#include "main/texformat.h" #include "i810screen.h" #include "i810_dri.h" - #include "i810context.h" #include "i810tex.h" #include "i810state.h" diff --git a/src/mesa/drivers/dri/i810/i810texstate.c b/src/mesa/drivers/dri/i810/i810texstate.c index 558aef9eee..0e09f54c41 100644 --- a/src/mesa/drivers/dri/i810/i810texstate.c +++ b/src/mesa/drivers/dri/i810/i810texstate.c @@ -22,14 +22,13 @@ * */ -#include "glheader.h" -#include "macros.h" -#include "mtypes.h" -#include "texformat.h" -#include "simple_list.h" -#include "enums.h" - -#include "mm.h" +#include "main/glheader.h" +#include "main/macros.h" +#include "main/mtypes.h" +#include "main/texformat.h" +#include "main/simple_list.h" +#include "main/enums.h" +#include "main/mm.h" #include "i810screen.h" #include "i810_dri.h" diff --git a/src/mesa/drivers/dri/i810/i810tris.c b/src/mesa/drivers/dri/i810/i810tris.c index f6dd7a4d22..b508496fb6 100644 --- a/src/mesa/drivers/dri/i810/i810tris.c +++ b/src/mesa/drivers/dri/i810/i810tris.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/i810/i810tris.c,v 1.7 2002/10/30 12:51:33 alanh Exp $ */ /************************************************************************** Copyright 2001 VA Linux Systems Inc., Fremont, California. @@ -31,11 +30,11 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. * Keith Whitwell <keith@tungstengraphics.com> */ -#include "glheader.h" -#include "mtypes.h" -#include "macros.h" -#include "enums.h" -#include "colormac.h" +#include "main/glheader.h" +#include "main/mtypes.h" +#include "main/macros.h" +#include "main/enums.h" +#include "main/colormac.h" #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" diff --git a/src/mesa/drivers/dri/i810/i810tris.h b/src/mesa/drivers/dri/i810/i810tris.h index 06c8b3fcd5..ab026be0a5 100644 --- a/src/mesa/drivers/dri/i810/i810tris.h +++ b/src/mesa/drivers/dri/i810/i810tris.h @@ -22,12 +22,11 @@ * * */ -/* $XFree86: xc/lib/GL/mesa/src/drv/i810/i810tris.h,v 1.10 2002/02/22 21:33:04 dawes Exp $ */ #ifndef I810TRIS_INC #define I810TRIS_INC -#include "mtypes.h" +#include "main/mtypes.h" extern void i810PrintRenderState( const char *msg, GLuint state ); extern void i810InitTriFuncs( GLcontext *ctx ); diff --git a/src/mesa/drivers/dri/i810/i810vb.c b/src/mesa/drivers/dri/i810/i810vb.c index 5ce98a991d..30890dc9b7 100644 --- a/src/mesa/drivers/dri/i810/i810vb.c +++ b/src/mesa/drivers/dri/i810/i810vb.c @@ -22,21 +22,19 @@ * * */ -/* $XFree86: xc/lib/GL/mesa/src/drv/i810/i810vb.c,v 1.13 2003/03/26 20:43:48 tsi Exp $ */ -#include "glheader.h" -#include "mtypes.h" -#include "imports.h" -#include "macros.h" -#include "colormac.h" +#include "main/glheader.h" +#include "main/mtypes.h" +#include "main/imports.h" +#include "main/macros.h" +#include "main/colormac.h" #include "swrast_setup/swrast_setup.h" #include "tnl/t_context.h" #include "i810screen.h" #include "i810_dri.h" - #include "i810context.h" #include "i810vb.h" #include "i810ioctl.h" diff --git a/src/mesa/drivers/dri/i810/i810vb.h b/src/mesa/drivers/dri/i810/i810vb.h index 1cced86ab2..1f704e4569 100644 --- a/src/mesa/drivers/dri/i810/i810vb.h +++ b/src/mesa/drivers/dri/i810/i810vb.h @@ -22,12 +22,11 @@ * * */ -/* $XFree86: xc/lib/GL/mesa/src/drv/i810/i810vb.h,v 1.4 2002/02/22 21:33:04 dawes Exp $ */ #ifndef I810VB_INC #define I810VB_INC -#include "mtypes.h" +#include "main/mtypes.h" #include "swrast/swrast.h" #define _I810_NEW_VERTEX (_NEW_TEXTURE | \ diff --git a/src/mesa/drivers/dri/i810/server/i810_common.h b/src/mesa/drivers/dri/i810/server/i810_common.h index 02e548be0e..29be444b45 100644 --- a/src/mesa/drivers/dri/i810/server/i810_common.h +++ b/src/mesa/drivers/dri/i810/server/i810_common.h @@ -25,7 +25,6 @@ * Converted to common header format: * Jens Owen <jens@tungstengraphics.com> * - * $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_common.h,v 1.1 2002/09/11 00:29:31 dawes Exp $ * */ diff --git a/src/mesa/drivers/dri/i810/server/i810_dri.h b/src/mesa/drivers/dri/i810/server/i810_dri.h index 408a4ebb4d..4a714f0306 100644 --- a/src/mesa/drivers/dri/i810/server/i810_dri.h +++ b/src/mesa/drivers/dri/i810/server/i810_dri.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_dri.h,v 1.10 2002/12/10 01:27:04 dawes Exp $ */ #ifndef _I810_DRI_ #define _I810_DRI_ diff --git a/src/mesa/drivers/dri/i810/server/i810_reg.h b/src/mesa/drivers/dri/i810/server/i810_reg.h index c935982a78..e7e5081038 100644 --- a/src/mesa/drivers/dri/i810/server/i810_reg.h +++ b/src/mesa/drivers/dri/i810/server/i810_reg.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_reg.h,v 1.13 2003/02/06 04:18:04 dawes Exp $ */ /************************************************************************** Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. diff --git a/src/mesa/drivers/dri/i915/Makefile b/src/mesa/drivers/dri/i915/Makefile index bdd3b85260..5858e0ee9f 100644 --- a/src/mesa/drivers/dri/i915/Makefile +++ b/src/mesa/drivers/dri/i915/Makefile @@ -30,8 +30,8 @@ DRIVER_SOURCES = \ intel_pixel.c \ intel_pixel_bitmap.c \ intel_pixel_copy.c \ - intel_pixel_read.c \ intel_pixel_draw.c \ + intel_pixel_read.c \ intel_buffers.c \ intel_blit.c \ i915_tex.c \ @@ -46,18 +46,15 @@ DRIVER_SOURCES = \ i915_vtbl.c \ intel_context.c \ intel_decode.c \ - intel_ioctl.c \ intel_screen.c \ intel_span.c \ intel_state.c \ intel_tris.c \ intel_fbo.c \ - intel_depthstencil.c \ - intel_bufmgr_ttm.c + intel_depthstencil.c C_SOURCES = \ $(COMMON_SOURCES) \ - $(COMMON_BM_SOURCES) \ $(DRIVER_SOURCES) ASM_SOURCES = @@ -66,9 +63,12 @@ DRIVER_DEFINES = -I../intel -I../intel/server -DI915 \ $(shell pkg-config libdrm --atleast-version=2.3.1 \ && echo "-DDRM_VBLANK_FLIP=DRM_VBLANK_FLIP") +DRI_LIB_DEPS += -ldrm_intel + include ../Makefile.template intel_decode.o: ../intel/intel_decode.c + intel_tex_layout.o: ../intel/intel_tex_layout.c symlinks: diff --git a/src/mesa/drivers/dri/i915/i830_context.c b/src/mesa/drivers/dri/i915/i830_context.c index 16c8a8d24f..09b1ec922f 100644 --- a/src/mesa/drivers/dri/i915/i830_context.c +++ b/src/mesa/drivers/dri/i915/i830_context.c @@ -26,7 +26,7 @@ **************************************************************************/ #include "i830_context.h" -#include "imports.h" +#include "main/imports.h" #include "texmem.h" #include "intel_tex.h" #include "tnl/tnl.h" @@ -81,6 +81,9 @@ i830CreateContext(const __GLcontextModes * mesaVis, _tnl_destroy_pipeline(ctx); _tnl_install_pipeline(ctx, intel_pipeline); + if (intel->no_rast) + FALLBACK(intel, INTEL_FALLBACK_USER, 1); + intel->ctx.Const.MaxTextureUnits = I830_TEX_UNITS; intel->ctx.Const.MaxTextureImageUnits = I830_TEX_UNITS; intel->ctx.Const.MaxTextureCoordUnits = I830_TEX_UNITS; diff --git a/src/mesa/drivers/dri/i915/i830_metaops.c b/src/mesa/drivers/dri/i915/i830_metaops.c index 13e4ab3aac..2cce661c86 100644 --- a/src/mesa/drivers/dri/i915/i830_metaops.c +++ b/src/mesa/drivers/dri/i915/i830_metaops.c @@ -25,15 +25,14 @@ * **************************************************************************/ -#include "glheader.h" -#include "enums.h" -#include "mtypes.h" -#include "macros.h" +#include "main/glheader.h" +#include "main/enums.h" +#include "main/mtypes.h" +#include "main/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" diff --git a/src/mesa/drivers/dri/i915/i830_reg.h b/src/mesa/drivers/dri/i915/i830_reg.h index 41280bca7c..d210c2d08e 100644 --- a/src/mesa/drivers/dri/i915/i830_reg.h +++ b/src/mesa/drivers/dri/i915/i830_reg.h @@ -494,10 +494,6 @@ #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 */ @@ -635,8 +631,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/i915/i830_state.c b/src/mesa/drivers/dri/i915/i830_state.c index e44a7dfca1..d9cad0c4bf 100644 --- a/src/mesa/drivers/dri/i915/i830_state.c +++ b/src/mesa/drivers/dri/i915/i830_state.c @@ -26,11 +26,11 @@ **************************************************************************/ -#include "glheader.h" -#include "context.h" -#include "macros.h" -#include "enums.h" -#include "dd.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/macros.h" +#include "main/enums.h" +#include "main/dd.h" #include "texmem.h" diff --git a/src/mesa/drivers/dri/i915/i830_tex.c b/src/mesa/drivers/dri/i915/i830_tex.c index 79b0fcf596..34ac42a78e 100644 --- a/src/mesa/drivers/dri/i915/i830_tex.c +++ b/src/mesa/drivers/dri/i915/i830_tex.c @@ -25,20 +25,18 @@ * **************************************************************************/ -#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 "main/glheader.h" +#include "main/mtypes.h" +#include "main/imports.h" +#include "main/simple_list.h" +#include "main/enums.h" +#include "main/image.h" +#include "main/mm.h" +#include "main/texstore.h" +#include "main/texformat.h" #include "swrast/swrast.h" -#include "mm.h" - -#include "intel_ioctl.h" +#include "texmem.h" #include "i830_context.h" #include "i830_reg.h" diff --git a/src/mesa/drivers/dri/i915/i830_texblend.c b/src/mesa/drivers/dri/i915/i830_texblend.c index 58f220eb7c..09f7f37e76 100644 --- a/src/mesa/drivers/dri/i915/i830_texblend.c +++ b/src/mesa/drivers/dri/i915/i830_texblend.c @@ -25,18 +25,16 @@ * **************************************************************************/ -#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 "main/glheader.h" +#include "main/macros.h" +#include "main/mtypes.h" +#include "main/simple_list.h" +#include "main/enums.h" +#include "main/texformat.h" +#include "main/texstore.h" +#include "main/mm.h" #include "intel_screen.h" -#include "intel_ioctl.h" #include "intel_tex.h" #include "i830_context.h" diff --git a/src/mesa/drivers/dri/i915/i830_texstate.c b/src/mesa/drivers/dri/i915/i830_texstate.c index 4e9b022eae..c718bb0055 100644 --- a/src/mesa/drivers/dri/i915/i830_texstate.c +++ b/src/mesa/drivers/dri/i915/i830_texstate.c @@ -25,10 +25,9 @@ * **************************************************************************/ -#include "mtypes.h" -#include "enums.h" -#include "texformat.h" -#include "dri_bufmgr.h" +#include "main/mtypes.h" +#include "main/enums.h" +#include "main/texformat.h" #include "intel_mipmap_tree.h" #include "intel_tex.h" diff --git a/src/mesa/drivers/dri/i915/i830_vtbl.c b/src/mesa/drivers/dri/i915/i830_vtbl.c index c5a85fe035..773a8b4dd0 100644 --- a/src/mesa/drivers/dri/i915/i830_vtbl.c +++ b/src/mesa/drivers/dri/i915/i830_vtbl.c @@ -25,12 +25,13 @@ * **************************************************************************/ -#include "glapi.h" +#include "glapi/glapi.h" #include "i830_context.h" #include "i830_reg.h" #include "intel_batchbuffer.h" #include "intel_regions.h" +#include "intel_tris.h" #include "tnl/t_context.h" #include "tnl/t_vertex.h" @@ -419,10 +420,12 @@ i830_emit_state(struct intel_context *intel) { struct i830_context *i830 = i830_context(&intel->ctx); struct i830_hw_state *state = i830->current; - int i, ret, count; + int i, count; GLuint dirty; GET_CURRENT_CONTEXT(ctx); BATCH_LOCALS; + dri_bo *aper_array[3 + I830_TEX_UNITS]; + int aper_count; /* We don't hold the lock at this point, so want to make sure that * there won't be a buffer wrap between the state emits and the primitive @@ -435,26 +438,28 @@ i830_emit_state(struct intel_context *intel) * Set the space as LOOP_CLIPRECTS now, since that's what our primitives * will be emitted under. */ - intel_batchbuffer_require_space(intel->batch, get_state_size(state) + 8, + intel_batchbuffer_require_space(intel->batch, + get_state_size(state) + INTEL_PRIM_EMIT_SIZE, LOOP_CLIPRECTS); count = 0; again: + aper_count = 0; dirty = get_dirty(state); - ret = 0; + aper_array[aper_count++] = intel->batch->buf; if (dirty & I830_UPLOAD_BUFFERS) { - ret |= dri_bufmgr_check_aperture_space(state->draw_region->buffer); - ret |= dri_bufmgr_check_aperture_space(state->depth_region->buffer); + aper_array[aper_count++] = state->draw_region->buffer; + aper_array[aper_count++] = state->depth_region->buffer; } - + for (i = 0; i < I830_TEX_UNITS; i++) if (dirty & I830_UPLOAD_TEX(i)) { if (state->tex_buffer[i]) { - ret |= dri_bufmgr_check_aperture_space(state->tex_buffer[i]); + aper_array[aper_count++] = state->tex_buffer[i]; } } - if (ret) { + if (dri_bufmgr_check_aperture_space(aper_array, aper_count)) { if (count == 0) { count++; intel_batchbuffer_flush(intel->batch); @@ -490,14 +495,14 @@ i830_emit_state(struct intel_context *intel) 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, + I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, 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, + I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, state->depth_region->draw_offset); } @@ -524,7 +529,7 @@ i830_emit_state(struct intel_context *intel) if (state->tex_buffer[i]) { OUT_RELOC(state->tex_buffer[i], - DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_READ, + I915_GEM_DOMAIN_SAMPLER, 0, state->tex_offset[i] | TM0S0_USE_FENCE); } else if (state == &i830->meta) { @@ -561,6 +566,13 @@ i830_destroy_context(struct intel_context *intel) GLuint i; struct i830_context *i830 = i830_context(&intel->ctx); + intel_region_release(&i830->state.draw_region); + intel_region_release(&i830->state.depth_region); + intel_region_release(&i830->meta.draw_region); + intel_region_release(&i830->meta.depth_region); + intel_region_release(&i830->initial.draw_region); + intel_region_release(&i830->initial.depth_region); + for (i = 0; i < I830_TEX_UNITS; i++) { if (i830->state.tex_buffer[i] != NULL) { dri_bo_unreference(i830->state.tex_buffer[i]); @@ -717,4 +729,5 @@ i830InitVtbl(struct i830_context *i830) i830->intel.vtbl.render_prevalidate = i830_render_prevalidate; i830->intel.vtbl.assert_not_dirty = i830_assert_not_dirty; i830->intel.vtbl.note_unlock = i830_note_unlock; + i830->intel.vtbl.finish_batch = intel_finish_vb; } diff --git a/src/mesa/drivers/dri/i915/i915_context.c b/src/mesa/drivers/dri/i915/i915_context.c index bd9f1d5f5d..efcac911aa 100644 --- a/src/mesa/drivers/dri/i915/i915_context.c +++ b/src/mesa/drivers/dri/i915/i915_context.c @@ -26,7 +26,7 @@ **************************************************************************/ #include "i915_context.h" -#include "imports.h" +#include "main/imports.h" #include "intel_tex.h" #include "intel_tris.h" #include "tnl/t_context.h" @@ -138,6 +138,9 @@ i915CreateContext(const __GLcontextModes * mesaVis, _tnl_destroy_pipeline(ctx); _tnl_install_pipeline(ctx, intel_pipeline); + if (intel->no_rast) + FALLBACK(intel, INTEL_FALLBACK_USER, 1); + ctx->Const.MaxTextureUnits = I915_TEX_UNITS; ctx->Const.MaxTextureImageUnits = I915_TEX_UNITS; ctx->Const.MaxTextureCoordUnits = I915_TEX_UNITS; diff --git a/src/mesa/drivers/dri/i915/i915_debug.c b/src/mesa/drivers/dri/i915/i915_debug.c index 8eb1c5b49e..f7bb7ea44c 100644 --- a/src/mesa/drivers/dri/i915/i915_debug.c +++ b/src/mesa/drivers/dri/i915/i915_debug.c @@ -25,7 +25,7 @@ * **************************************************************************/ -#include "imports.h" +#include "main/imports.h" #include "i915_reg.h" #include "i915_context.h" @@ -177,7 +177,7 @@ static GLboolean debug_variable_length_prim( struct debug_stream *stream ) #define BITS( dw, hi, lo, ... ) \ do { \ - unsigned himask = ~0UL >> (31 - (hi)); \ + unsigned himask = 0xffffffffU >> (31 - (hi)); \ PRINTF("\t\t "); \ PRINTF(__VA_ARGS__); \ PRINTF(": 0x%x\n", ((dw) & himask) >> (lo)); \ diff --git a/src/mesa/drivers/dri/i915/i915_fragprog.c b/src/mesa/drivers/dri/i915/i915_fragprog.c index 1876218ca0..8bd761ec6a 100644 --- a/src/mesa/drivers/dri/i915/i915_fragprog.c +++ b/src/mesa/drivers/dri/i915/i915_fragprog.c @@ -25,9 +25,9 @@ * **************************************************************************/ -#include "glheader.h" -#include "macros.h" -#include "enums.h" +#include "main/glheader.h" +#include "main/macros.h" +#include "main/enums.h" #include "shader/prog_instruction.h" #include "shader/prog_parameter.h" diff --git a/src/mesa/drivers/dri/i915/i915_metaops.c b/src/mesa/drivers/dri/i915/i915_metaops.c index 73aa63451e..90a78c6082 100644 --- a/src/mesa/drivers/dri/i915/i915_metaops.c +++ b/src/mesa/drivers/dri/i915/i915_metaops.c @@ -25,15 +25,14 @@ * **************************************************************************/ -#include "glheader.h" -#include "enums.h" -#include "mtypes.h" -#include "macros.h" +#include "main/glheader.h" +#include "main/enums.h" +#include "main/mtypes.h" +#include "main/macros.h" #include "utils.h" #include "intel_screen.h" #include "intel_batchbuffer.h" -#include "intel_ioctl.h" #include "intel_regions.h" #include "i915_context.h" diff --git a/src/mesa/drivers/dri/i915/i915_program.c b/src/mesa/drivers/dri/i915/i915_program.c index f79d00ddcf..49193297a8 100644 --- a/src/mesa/drivers/dri/i915/i915_program.c +++ b/src/mesa/drivers/dri/i915/i915_program.c @@ -27,9 +27,9 @@ #include <strings.h> -#include "glheader.h" -#include "macros.h" -#include "enums.h" +#include "main/glheader.h" +#include "main/macros.h" +#include "main/enums.h" #include "tnl/t_context.h" #include "intel_batchbuffer.h" diff --git a/src/mesa/drivers/dri/i915/i915_reg.h b/src/mesa/drivers/dri/i915/i915_reg.h index b5585e70e7..8891e11c6f 100644 --- a/src/mesa/drivers/dri/i915/i915_reg.h +++ b/src/mesa/drivers/dri/i915/i915_reg.h @@ -325,118 +325,6 @@ #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 - - /* Helper macros for blend factors */ #define DST_BLND_FACT(f) ((f)<<S6_CBUF_DST_BLEND_FACT_SHIFT) @@ -855,10 +743,4 @@ #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/i915/i915_state.c b/src/mesa/drivers/dri/i915/i915_state.c index c814f8d532..9d04358e4f 100644 --- a/src/mesa/drivers/dri/i915/i915_state.c +++ b/src/mesa/drivers/dri/i915/i915_state.c @@ -26,11 +26,11 @@ **************************************************************************/ -#include "glheader.h" -#include "context.h" -#include "macros.h" -#include "enums.h" -#include "dd.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/macros.h" +#include "main/enums.h" +#include "main/dd.h" #include "tnl/tnl.h" #include "tnl/t_context.h" diff --git a/src/mesa/drivers/dri/i915/i915_tex.c b/src/mesa/drivers/dri/i915/i915_tex.c index 386617a1ff..e38d8fe79d 100644 --- a/src/mesa/drivers/dri/i915/i915_tex.c +++ b/src/mesa/drivers/dri/i915/i915_tex.c @@ -25,20 +25,18 @@ * **************************************************************************/ -#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 "main/glheader.h" +#include "main/mtypes.h" +#include "main/imports.h" +#include "main/simple_list.h" +#include "main/enums.h" +#include "main/image.h" +#include "main/mm.h" +#include "main/texstore.h" +#include "main/texformat.h" #include "swrast/swrast.h" -#include "mm.h" - -#include "intel_ioctl.h" +#include "texmem.h" #include "i915_context.h" #include "i915_reg.h" diff --git a/src/mesa/drivers/dri/i915/i915_tex_layout.c b/src/mesa/drivers/dri/i915/i915_tex_layout.c index b5085f49d4..d44a2f47b3 100644 --- a/src/mesa/drivers/dri/i915/i915_tex_layout.c +++ b/src/mesa/drivers/dri/i915/i915_tex_layout.c @@ -31,7 +31,7 @@ #include "intel_mipmap_tree.h" #include "intel_tex_layout.h" -#include "macros.h" +#include "main/macros.h" #include "intel_context.h" #define FILE_DEBUG_FLAG DEBUG_TEXTURE diff --git a/src/mesa/drivers/dri/i915/i915_texstate.c b/src/mesa/drivers/dri/i915/i915_texstate.c index 69c1e0755e..ae42b102db 100644 --- a/src/mesa/drivers/dri/i915/i915_texstate.c +++ b/src/mesa/drivers/dri/i915/i915_texstate.c @@ -25,10 +25,9 @@ * **************************************************************************/ -#include "mtypes.h" -#include "enums.h" -#include "texformat.h" -#include "dri_bufmgr.h" +#include "main/mtypes.h" +#include "main/enums.h" +#include "main/texformat.h" #include "intel_mipmap_tree.h" #include "intel_tex.h" @@ -78,7 +77,7 @@ translate_texture_format(GLuint mesa_format, GLenum DepthMode) return (MAPSURF_COMPRESSED | MT_COMPRESS_DXT2_3); case MESA_FORMAT_RGBA_DXT5: return (MAPSURF_COMPRESSED | MT_COMPRESS_DXT4_5); - case MESA_FORMAT_Z24_S8: + case MESA_FORMAT_S8_Z24: return (MAPSURF_32BIT | MT_32BIT_xI824); default: fprintf(stderr, "%s: bad image format %x\n", __FUNCTION__, mesa_format); diff --git a/src/mesa/drivers/dri/i915/i915_vtbl.c b/src/mesa/drivers/dri/i915/i915_vtbl.c index 135bfaa265..7431a9cf76 100644 --- a/src/mesa/drivers/dri/i915/i915_vtbl.c +++ b/src/mesa/drivers/dri/i915/i915_vtbl.c @@ -27,11 +27,11 @@ -#include "glheader.h" -#include "mtypes.h" -#include "imports.h" -#include "macros.h" -#include "colormac.h" +#include "main/glheader.h" +#include "main/mtypes.h" +#include "main/imports.h" +#include "main/macros.h" +#include "main/colormac.h" #include "tnl/t_context.h" #include "tnl/t_vertex.h" @@ -39,11 +39,12 @@ #include "intel_batchbuffer.h" #include "intel_tex.h" #include "intel_regions.h" +#include "intel_tris.h" #include "i915_reg.h" #include "i915_context.h" -#include "glapi.h" +#include "glapi/glapi.h" static void i915_render_prevalidate(struct intel_context *intel) @@ -296,9 +297,9 @@ i915_emit_state(struct intel_context *intel) { struct i915_context *i915 = i915_context(&intel->ctx); struct i915_hw_state *state = i915->current; - int i; - int ret, count; + int i, count, aper_count; GLuint dirty; + dri_bo *aper_array[3 + I915_TEX_UNITS]; GET_CURRENT_CONTEXT(ctx); BATCH_LOCALS; @@ -313,28 +314,32 @@ i915_emit_state(struct intel_context *intel) * Set the space as LOOP_CLIPRECTS now, since that's what our primitives * will be emitted under. */ - intel_batchbuffer_require_space(intel->batch, get_state_size(state) + 8, + intel_batchbuffer_require_space(intel->batch, + get_state_size(state) + INTEL_PRIM_EMIT_SIZE, LOOP_CLIPRECTS); count = 0; again: + aper_count = 0; dirty = get_dirty(state); - ret = 0; + aper_array[aper_count++] = intel->batch->buf; if (dirty & I915_UPLOAD_BUFFERS) { - ret |= dri_bufmgr_check_aperture_space(state->draw_region->buffer); - if (state->depth_region) - ret |= dri_bufmgr_check_aperture_space(state->depth_region->buffer); + aper_array[aper_count++] = state->draw_region->buffer; + if (state->depth_region) + aper_array[aper_count++] = state->depth_region->buffer; } if (dirty & I915_UPLOAD_TEX_ALL) { - for (i = 0; i < I915_TEX_UNITS; i++) - if (dirty & I915_UPLOAD_TEX(i)) { - if (state->tex_buffer[i]) { - ret |= dri_bufmgr_check_aperture_space(state->tex_buffer[i]); - } - } + for (i = 0; i < I915_TEX_UNITS; i++) { + if (dirty & I915_UPLOAD_TEX(i)) { + if (state->tex_buffer[i]) { + aper_array[aper_count++] = state->tex_buffer[i]; + } + } + } } - if (ret) { + + if (dri_bufmgr_check_aperture_space(aper_array, aper_count)) { if (count == 0) { count++; intel_batchbuffer_flush(intel->batch); @@ -377,14 +382,14 @@ i915_emit_state(struct intel_context *intel) 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, + I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, 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, + I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, state->depth_region->draw_offset); } @@ -427,7 +432,7 @@ i915_emit_state(struct intel_context *intel) if (state->tex_buffer[i]) { OUT_RELOC(state->tex_buffer[i], - DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_READ, + I915_GEM_DOMAIN_SAMPLER, 0, state->tex_offset[i]); } else if (state == &i915->meta) { @@ -485,6 +490,13 @@ i915_destroy_context(struct intel_context *intel) GLuint i; struct i915_context *i915 = i915_context(&intel->ctx); + intel_region_release(&i915->state.draw_region); + intel_region_release(&i915->state.depth_region); + intel_region_release(&i915->meta.draw_region); + intel_region_release(&i915->meta.depth_region); + intel_region_release(&i915->initial.draw_region); + intel_region_release(&i915->initial.depth_region); + for (i = 0; i < I915_TEX_UNITS; i++) { if (i915->state.tex_buffer[i] != NULL) { dri_bo_unreference(i915->state.tex_buffer[i]); @@ -629,4 +641,5 @@ i915InitVtbl(struct i915_context *i915) i915->intel.vtbl.flush_cmd = i915_flush_cmd; i915->intel.vtbl.assert_not_dirty = i915_assert_not_dirty; i915->intel.vtbl.note_unlock = i915_note_unlock; + i915->intel.vtbl.finish_batch = intel_finish_vb; } diff --git a/src/mesa/drivers/dri/i915/intel_bufmgr_ttm.c b/src/mesa/drivers/dri/i915/intel_bufmgr_ttm.c deleted file mode 120000 index e9df5c6279..0000000000 --- a/src/mesa/drivers/dri/i915/intel_bufmgr_ttm.c +++ /dev/null @@ -1 +0,0 @@ -../intel/intel_bufmgr_ttm.c
\ No newline at end of file diff --git a/src/mesa/drivers/dri/i915/intel_ioctl.c b/src/mesa/drivers/dri/i915/intel_ioctl.c deleted file mode 120000 index effd0f378d..0000000000 --- a/src/mesa/drivers/dri/i915/intel_ioctl.c +++ /dev/null @@ -1 +0,0 @@ -../intel/intel_ioctl.c
\ No newline at end of file diff --git a/src/mesa/drivers/dri/i915/intel_pixel_read.c b/src/mesa/drivers/dri/i915/intel_pixel_read.c index 2e31656e98..56087aacd4 100644 --- a/src/mesa/drivers/dri/i915/intel_pixel_read.c +++ b/src/mesa/drivers/dri/i915/intel_pixel_read.c @@ -25,17 +25,16 @@ * **************************************************************************/ -#include "glheader.h" -#include "enums.h" -#include "mtypes.h" -#include "macros.h" -#include "image.h" -#include "bufferobj.h" +#include "main/glheader.h" +#include "main/enums.h" +#include "main/mtypes.h" +#include "main/macros.h" +#include "main/image.h" +#include "main/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" @@ -173,7 +172,6 @@ do_blit_readpixels(GLcontext * ctx, struct intel_buffer_object *dst = intel_buffer_object(pack->BufferObj); GLuint dst_offset; GLuint rowLength; - dri_fence *fence = NULL; if (INTEL_DEBUG & DEBUG_PIXEL) _mesa_printf("%s\n", __FUNCTION__); @@ -264,7 +262,7 @@ do_blit_readpixels(GLcontext * ctx, intelEmitCopyBlit(intel, src->cpp, - src->pitch, src->buffer, 0, src->tiled, + src->pitch, src->buffer, 0, src->tiling, rowLength, dst_buffer, dst_offset, GL_FALSE, rect.x1, rect.y1, @@ -273,19 +271,9 @@ do_blit_readpixels(GLcontext * ctx, rect.x2 - rect.x1, rect.y2 - rect.y1, GL_COPY); } - - intel_batchbuffer_flush(intel->batch); - fence = intel->batch->last_fence; - dri_fence_reference(fence); - } UNLOCK_HARDWARE(intel); - if (fence) { - dri_fence_wait(fence); - dri_fence_unreference(fence); - } - if (INTEL_DEBUG & DEBUG_PIXEL) _mesa_printf("%s - DONE\n", __FUNCTION__); diff --git a/src/mesa/drivers/dri/i915/intel_render.c b/src/mesa/drivers/dri/i915/intel_render.c index 5e6500cfa1..467abe4d7c 100644 --- a/src/mesa/drivers/dri/i915/intel_render.c +++ b/src/mesa/drivers/dri/i915/intel_render.c @@ -30,12 +30,12 @@ * 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 "main/glheader.h" +#include "main/context.h" +#include "main/macros.h" +#include "main/imports.h" +#include "main/mtypes.h" +#include "main/enums.h" #include "tnl/t_context.h" #include "tnl/t_vertex.h" @@ -67,7 +67,7 @@ #define HAVE_ELTS 0 -static GLuint hw_prim[GL_POLYGON + 1] = { +static uint32_t hw_prim[GL_POLYGON + 1] = { 0, PRIM3D_LINELIST, PRIM3D_LINESTRIP, @@ -114,7 +114,7 @@ intelDmaPrimitive(struct intel_context *intel, GLenum prim) 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], LOOP_CLIPRECTS); + intel_set_prim(intel, hw_prim[prim]); } @@ -126,12 +126,11 @@ do { \ #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 GET_SUBSEQUENT_VB_MAX_VERTS() (INTEL_VB_SIZE / (intel->vertex_size * 4)) +#define GET_CURRENT_VB_MAX_VERTS() \ + ((INTEL_VB_SIZE - intel->prim.current_offset) / (intel->vertex_size * 4)) -#define ALLOC_VERTS( nr ) \ - intelExtendInlinePrimitive( intel, (nr) * intel->vertex_size ) +#define ALLOC_VERTS(nr) intel_get_prim_space(intel, nr) #define EMIT_VERTS( ctx, j, nr, buf ) \ _tnl_emit_vertices_to_buffer(ctx, j, (j)+(nr), buf ) diff --git a/src/mesa/drivers/dri/i915/intel_state.c b/src/mesa/drivers/dri/i915/intel_state.c index d1ca11dec4..09aa62da36 100644 --- a/src/mesa/drivers/dri/i915/intel_state.c +++ b/src/mesa/drivers/dri/i915/intel_state.c @@ -26,12 +26,12 @@ **************************************************************************/ -#include "glheader.h" -#include "context.h" -#include "macros.h" -#include "enums.h" -#include "colormac.h" -#include "dd.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/macros.h" +#include "main/enums.h" +#include "main/colormac.h" +#include "main/dd.h" #include "intel_screen.h" #include "intel_context.h" diff --git a/src/mesa/drivers/dri/i915/intel_tris.c b/src/mesa/drivers/dri/i915/intel_tris.c index bbb4e0f3cd..06210035af 100644 --- a/src/mesa/drivers/dri/i915/intel_tris.c +++ b/src/mesa/drivers/dri/i915/intel_tris.c @@ -25,13 +25,19 @@ * **************************************************************************/ -#include "glheader.h" -#include "context.h" -#include "macros.h" -#include "enums.h" -#include "texobj.h" -#include "state.h" -#include "dd.h" +/** @file intel_tris.c + * + * This file contains functions for managing the vertex buffer and emitting + * primitives into it. + */ + +#include "main/glheader.h" +#include "main/context.h" +#include "main/macros.h" +#include "main/enums.h" +#include "main/texobj.h" +#include "main/state.h" +#include "main/dd.h" #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" @@ -47,111 +53,186 @@ #include "intel_reg.h" #include "intel_span.h" #include "intel_tex.h" +#include "intel_chipset.h" +#include "i830_context.h" +#include "i830_reg.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) +/** Sets the primitive type for a primitive sequence, flushing as needed. */ +void intel_set_prim(struct intel_context *intel, uint32_t prim) { - GLuint used = intel->batch->ptr - intel->prim.start_ptr; - - assert(intel->prim.primitive != ~0); + if (prim != intel->prim.primitive) { + INTEL_FIREVERTICES(intel); + intel->prim.primitive = prim; + } +} -/* _mesa_printf("/\n"); */ +/** Returns mapped VB space for the given number of vertices */ +uint32_t *intel_get_prim_space(struct intel_context *intel, unsigned int count) +{ + uint32_t *addr; + + /* Check for space in the existing VB */ + if (intel->prim.vb_bo == NULL || + (intel->prim.current_offset + + count * intel->vertex_size * 4) > INTEL_VB_SIZE || + (intel->prim.count + count) >= (1 << 16)) { + /* Flush existing prim if any */ + INTEL_FIREVERTICES(intel); - if (used < 8) - goto do_discard; + intel_finish_vb(intel); - *(int *) intel->prim.start_ptr = (_3DPRIMITIVE | - intel->prim.primitive | (used / 4 - 2)); + /* Start a new VB */ + if (intel->prim.vb == NULL) + intel->prim.vb = malloc(INTEL_VB_SIZE); + intel->prim.vb_bo = dri_bo_alloc(intel->bufmgr, "vb", + INTEL_VB_SIZE, 4); + intel->prim.start_offset = 0; + intel->prim.current_offset = 0; + } - goto finished; + intel->prim.flush = intel_flush_prim; - do_discard: - intel->batch->ptr -= used; + addr = (uint32_t *)(intel->prim.vb + intel->prim.current_offset); + intel->prim.current_offset += intel->vertex_size * 4 * count; + intel->prim.count += count; - finished: - intel->prim.primitive = ~0; - intel->prim.start_ptr = 0; - intel->prim.flush = 0; + return addr; } - -/* Emit a primitive referencing vertices in a vertex buffer. - */ -void -intelStartInlinePrimitive(struct intel_context *intel, - GLuint prim, GLuint batch_flags) +/** Dispatches the accumulated primitive to the batchbuffer. */ +void intel_flush_prim(struct intel_context *intel) { BATCH_LOCALS; + dri_bo *aper_array[2]; + dri_bo *vb_bo; + unsigned int offset, count; + + /* Must be called after an intel_start_prim. */ + assert(intel->prim.primitive != ~0); + + if (intel->prim.count == 0) + return; + + /* Clear the current prims out of the context state so that a batch flush + * flush triggered by wait_flips or emit_state doesn't loop back to + * flush_prim again. + */ + vb_bo = intel->prim.vb_bo; + dri_bo_reference(vb_bo); + count = intel->prim.count; + intel->prim.count = 0; + offset = intel->prim.start_offset; + intel->prim.start_offset = intel->prim.current_offset; + if (!IS_9XX(intel->intelScreen->deviceID)) + intel->prim.start_offset = ALIGN(intel->prim.start_offset, 128); + intel->prim.flush = NULL; intel_wait_flips(intel); intel->vtbl.emit_state(intel); - intel->no_batch_wrap = GL_TRUE; - -/* _mesa_printf("%s *", __progname); */ + aper_array[0] = intel->batch->buf; + aper_array[1] = vb_bo; + if (dri_bufmgr_check_aperture_space(aper_array, 2)) { + intel_batchbuffer_flush(intel->batch); + intel->vtbl.emit_state(intel); + } - /* Emit a slot which will be filled with the inline primitive - * command later. + /* Ensure that we don't start a new batch for the following emit, which + * depends on the state just emitted. emit_state should be making sure we + * have the space for this. */ - BEGIN_BATCH(2, batch_flags); - OUT_BATCH(0); + intel->no_batch_wrap = GL_TRUE; + /* Check that we actually emitted the state into this batch, using the + * UPLOAD_CTX bit as the signal. + */ assert((intel->batch->dirty_state & (1<<1)) == 0); - intel->prim.start_ptr = intel->batch->ptr; - intel->prim.primitive = prim; - intel->prim.flush = intel_flush_inline_primitive; +#if 0 + printf("emitting %d..%d=%d vertices size %d\n", offset, + intel->prim.current_offset, intel->prim.count, + intel->vertex_size * 4); +#endif - OUT_BATCH(0); - ADVANCE_BATCH(); + if (IS_9XX(intel->intelScreen->deviceID)) { + BEGIN_BATCH(5, LOOP_CLIPRECTS); + OUT_BATCH(_3DSTATE_LOAD_STATE_IMMEDIATE_1 | + I1_LOAD_S(0) | I1_LOAD_S(1) | 1); + assert((offset & !S0_VB_OFFSET_MASK) == 0); + OUT_RELOC(vb_bo, I915_GEM_DOMAIN_VERTEX, 0, offset); + OUT_BATCH((intel->vertex_size << S1_VERTEX_WIDTH_SHIFT) | + (intel->vertex_size << S1_VERTEX_PITCH_SHIFT)); + + OUT_BATCH(_3DPRIMITIVE | + PRIM_INDIRECT | + PRIM_INDIRECT_SEQUENTIAL | + intel->prim.primitive | + count); + OUT_BATCH(0); /* Beginning vertex index */ + ADVANCE_BATCH(); + } else { + struct i830_context *i830 = i830_context(&intel->ctx); + + BEGIN_BATCH(5, LOOP_CLIPRECTS); + OUT_BATCH(_3DSTATE_LOAD_STATE_IMMEDIATE_1 | + I1_LOAD_S(0) | I1_LOAD_S(2) | 1); + /* S0 */ + assert((offset & !S0_VB_OFFSET_MASK_830) == 0); + OUT_RELOC(vb_bo, I915_GEM_DOMAIN_VERTEX, 0, + offset | (intel->vertex_size << S0_VB_PITCH_SHIFT_830) | + S0_VB_ENABLE_830); + /* S1 + * This is somewhat unfortunate -- VB width is tied up with + * vertex format data that we've already uploaded through + * _3DSTATE_VFT[01]_CMD. We may want to replace emits of VFT state with + * STATE_IMMEDIATE_1 like this to avoid duplication. + */ + OUT_BATCH((i830->state.Ctx[I830_CTXREG_VF] & VFT0_TEX_COUNT_MASK) >> + VFT0_TEX_COUNT_SHIFT << S2_TEX_COUNT_SHIFT_830 | + (i830->state.Ctx[I830_CTXREG_VF2] << 16) | + intel->vertex_size << S2_VERTEX_0_WIDTH_SHIFT_830); + + OUT_BATCH(_3DPRIMITIVE | + PRIM_INDIRECT | + PRIM_INDIRECT_SEQUENTIAL | + intel->prim.primitive | + count); + OUT_BATCH(0); /* Beginning vertex index */ + ADVANCE_BATCH(); + } intel->no_batch_wrap = GL_FALSE; -/* _mesa_printf(">"); */ -} - - -void -intelWrapInlinePrimitive(struct intel_context *intel) -{ - GLuint prim = intel->prim.primitive; - enum cliprect_mode cliprect_mode = intel->batch->cliprect_mode; - - intel_flush_inline_primitive(intel); - intel_batchbuffer_flush(intel->batch); - intelStartInlinePrimitive(intel, prim, cliprect_mode); /* ??? */ + dri_bo_unreference(vb_bo); } -GLuint * -intelExtendInlinePrimitive(struct intel_context *intel, GLuint dwords) +/** + * Uploads the locally-accumulated VB into the buffer object. + * + * This avoids us thrashing the cachelines in and out as the buffer gets + * filled, dispatched, then reused as the hardware completes rendering from it, + * and also lets us clflush less if we dispatch with a partially-filled VB. + * + * This is called normally from get_space when we're finishing a BO, but also + * at batch flush time so that we don't try accessing the contents of a + * just-dispatched buffer. + */ +void intel_finish_vb(struct intel_context *intel) { - 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; + if (intel->prim.vb_bo == NULL) + return; - return ptr; + dri_bo_subdata(intel->prim.vb_bo, 0, intel->prim.start_offset, + intel->prim.vb); + dri_bo_unreference(intel->prim.vb_bo); + intel->prim.vb_bo = NULL; } - - /*********************************************************************** * Emit primitives as inline vertices * ***********************************************************************/ @@ -182,7 +263,7 @@ intel_draw_quad(struct intel_context *intel, intelVertexPtr v1, intelVertexPtr v2, intelVertexPtr v3) { GLuint vertsize = intel->vertex_size; - GLuint *vb = intelExtendInlinePrimitive(intel, 6 * vertsize); + GLuint *vb = intel_get_prim_space(intel, 6); int j; COPY_DWORDS(j, vb, vertsize, v0); @@ -210,7 +291,7 @@ intel_draw_triangle(struct intel_context *intel, intelVertexPtr v0, intelVertexPtr v1, intelVertexPtr v2) { GLuint vertsize = intel->vertex_size; - GLuint *vb = intelExtendInlinePrimitive(intel, 3 * vertsize); + GLuint *vb = intel_get_prim_space(intel, 3); int j; COPY_DWORDS(j, vb, vertsize, v0); @@ -224,7 +305,7 @@ intel_draw_line(struct intel_context *intel, intelVertexPtr v0, intelVertexPtr v1) { GLuint vertsize = intel->vertex_size; - GLuint *vb = intelExtendInlinePrimitive(intel, 2 * vertsize); + GLuint *vb = intel_get_prim_space(intel, 2); int j; COPY_DWORDS(j, vb, vertsize, v0); @@ -236,7 +317,7 @@ static void intel_draw_point(struct intel_context *intel, intelVertexPtr v0) { GLuint vertsize = intel->vertex_size; - GLuint *vb = intelExtendInlinePrimitive(intel, vertsize); + GLuint *vb = intel_get_prim_space(intel, 1); int j; /* Adjust for sub pixel position -- still required for conform. */ @@ -745,7 +826,7 @@ 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); + GLuint *vb = intel_get_prim_space(intel, (n - 2) * 3); GLubyte *vertptr = (GLubyte *) intel->verts; const GLuint *start = (const GLuint *) V(elts[0]); int i, j; @@ -950,7 +1031,7 @@ intelRasterPrimitive(GLcontext * ctx, GLenum rprim, GLuint hwprim) if (hwprim != intel->prim.primitive) { INTEL_FIREVERTICES(intel); - intelStartInlinePrimitive(intel, hwprim, LOOP_CLIPRECTS); + intel_set_prim(intel, hwprim); } } @@ -1083,15 +1164,18 @@ intel_meta_draw_poly(struct intel_context *intel, union fi *vb; GLint i; GLboolean was_locked = intel->locked; + unsigned int saved_vertex_size = intel->vertex_size; if (!was_locked) LOCK_HARDWARE(intel); + intel->vertex_size = 6; + /* All 3d primitives should be emitted with LOOP_CLIPRECTS, * otherwise the drawing origin (DR4) might not be set correctly. */ - intelStartInlinePrimitive(intel, PRIM3D_TRIFAN, LOOP_CLIPRECTS); - vb = (union fi *) intelExtendInlinePrimitive(intel, n * 6); + intel_set_prim(intel, PRIM3D_TRIFAN); + vb = (union fi *) intel_get_prim_space(intel, n); for (i = 0; i < n; i++) { vb[0].f = xy[i][0]; @@ -1105,6 +1189,8 @@ intel_meta_draw_poly(struct intel_context *intel, INTEL_FIREVERTICES(intel); + intel->vertex_size = saved_vertex_size; + if (!was_locked) UNLOCK_HARDWARE(intel); } diff --git a/src/mesa/drivers/dri/i915/intel_tris.h b/src/mesa/drivers/dri/i915/intel_tris.h index 021e5c6450..55b60a47f9 100644 --- a/src/mesa/drivers/dri/i915/intel_tris.h +++ b/src/mesa/drivers/dri/i915/intel_tris.h @@ -28,9 +28,11 @@ #ifndef INTELTRIS_INC #define INTELTRIS_INC -#include "mtypes.h" - +#include "main/mtypes.h" +#define INTEL_VB_SIZE (32 * 1024) +/** 3 dwords of state_immediate and 2 of 3dprim, in intel_flush_prim */ +#define INTEL_PRIM_EMIT_SIZE (5 * 4) #define _INTEL_NEW_RENDERSTATE (_DD_NEW_LINE_STIPPLE | \ _DD_NEW_TRI_UNFILLED | \ @@ -44,11 +46,9 @@ 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_set_prim(struct intel_context *intel, uint32_t prim); +GLuint *intel_get_prim_space(struct intel_context *intel, unsigned int count); +void intel_flush_prim(struct intel_context *intel); +void intel_finish_vb(struct intel_context *intel); #endif diff --git a/src/mesa/drivers/dri/i965/Makefile b/src/mesa/drivers/dri/i965/Makefile index c561b744d1..c2d555cd0c 100644 --- a/src/mesa/drivers/dri/i965/Makefile +++ b/src/mesa/drivers/dri/i965/Makefile @@ -9,12 +9,10 @@ DRIVER_SOURCES = \ intel_blit.c \ intel_buffer_objects.c \ intel_buffers.c \ - intel_bufmgr_ttm.c \ intel_context.c \ intel_decode.c \ intel_depthstencil.c \ intel_fbo.c \ - intel_ioctl.c \ intel_mipmap_tree.c \ intel_regions.c \ intel_screen.c \ @@ -85,7 +83,6 @@ DRIVER_SOURCES = \ C_SOURCES = \ $(COMMON_SOURCES) \ - $(COMMON_BM_SOURCES) \ $(MINIGLX_SOURCES) \ $(DRIVER_SOURCES) @@ -93,6 +90,8 @@ ASM_SOURCES = DRIVER_DEFINES = -I../intel -I../intel/server +DRI_LIB_DEPS += -ldrm_intel + include ../Makefile.template symlinks: diff --git a/src/mesa/drivers/dri/i965/brw_cc.c b/src/mesa/drivers/dri/i965/brw_cc.c index 9d8984f05c..fa8121e02d 100644 --- a/src/mesa/drivers/dri/i965/brw_cc.c +++ b/src/mesa/drivers/dri/i965/brw_cc.c @@ -34,10 +34,10 @@ #include "brw_state.h" #include "brw_defines.h" #include "brw_util.h" -#include "macros.h" -#include "enums.h" +#include "main/macros.h" +#include "main/enums.h" -static int upload_cc_vp( struct brw_context *brw ) +static void prepare_cc_vp( struct brw_context *brw ) { struct brw_cc_viewport ccv; @@ -48,7 +48,6 @@ static int upload_cc_vp( struct brw_context *brw ) dri_bo_unreference(brw->cc.vp_bo); brw->cc.vp_bo = brw_cache_data( &brw->cache, BRW_CC_VP, &ccv, NULL, 0 ); - return dri_bufmgr_check_aperture_space(brw->cc.vp_bo); } const struct brw_tracked_state brw_cc_vp = { @@ -57,7 +56,7 @@ const struct brw_tracked_state brw_cc_vp = { .brw = BRW_NEW_CONTEXT, .cache = 0 }, - .prepare = upload_cc_vp + .prepare = prepare_cc_vp }; struct brw_cc_unit_key { @@ -256,16 +255,17 @@ cc_unit_create_from_key(struct brw_context *brw, struct brw_cc_unit_key *key) NULL, NULL); /* Emit CC viewport relocation */ - dri_emit_reloc(bo, - DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_READ, - 0, - offsetof(struct brw_cc_unit_state, cc4), - brw->cc.vp_bo); + dri_bo_emit_reloc(bo, + I915_GEM_DOMAIN_INSTRUCTION, + 0, + 0, + offsetof(struct brw_cc_unit_state, cc4), + brw->cc.vp_bo); return bo; } -static int prepare_cc_unit( struct brw_context *brw ) +static void prepare_cc_unit( struct brw_context *brw ) { struct brw_cc_unit_key key; @@ -279,7 +279,6 @@ static int prepare_cc_unit( struct brw_context *brw ) if (brw->cc.state_bo == NULL) brw->cc.state_bo = cc_unit_create_from_key(brw, &key); - return dri_bufmgr_check_aperture_space(brw->cc.state_bo); } const struct brw_tracked_state brw_cc_unit = { diff --git a/src/mesa/drivers/dri/i965/brw_clip.c b/src/mesa/drivers/dri/i965/brw_clip.c index 540108e5f4..38d8b704d7 100644 --- a/src/mesa/drivers/dri/i965/brw_clip.c +++ b/src/mesa/drivers/dri/i965/brw_clip.c @@ -29,9 +29,9 @@ * Keith Whitwell <keith@tungstengraphics.com> */ -#include "glheader.h" -#include "macros.h" -#include "enums.h" +#include "main/glheader.h" +#include "main/macros.h" +#include "main/enums.h" #include "intel_batchbuffer.h" @@ -131,7 +131,7 @@ static void compile_clip_prog( struct brw_context *brw, /* Calculate interpolants for triangle and line rasterization. */ -static int upload_clip_prog( struct brw_context *brw ) +static void upload_clip_prog(struct brw_context *brw) { GLcontext *ctx = &brw->intel.ctx; struct brw_clip_prog_key key; @@ -242,8 +242,6 @@ static int upload_clip_prog( struct brw_context *brw ) &brw->clip.prog_data); if (brw->clip.prog_bo == NULL) compile_clip_prog( brw, &key ); - - return dri_bufmgr_check_aperture_space(brw->clip.prog_bo); } diff --git a/src/mesa/drivers/dri/i965/brw_clip.h b/src/mesa/drivers/dri/i965/brw_clip.h index 2a65697325..e06747864b 100644 --- a/src/mesa/drivers/dri/i965/brw_clip.h +++ b/src/mesa/drivers/dri/i965/brw_clip.h @@ -167,4 +167,9 @@ void brw_clip_copy_colors( struct brw_clip_compile *c, void brw_clip_init_clipmask( struct brw_clip_compile *c ); +struct brw_reg get_tmp( struct brw_clip_compile *c ); + +void brw_clip_project_position(struct brw_clip_compile *c, + struct brw_reg pos ); + #endif diff --git a/src/mesa/drivers/dri/i965/brw_clip_line.c b/src/mesa/drivers/dri/i965/brw_clip_line.c index 0930e6a573..c87e5b9a12 100644 --- a/src/mesa/drivers/dri/i965/brw_clip_line.c +++ b/src/mesa/drivers/dri/i965/brw_clip_line.c @@ -29,11 +29,11 @@ * Keith Whitwell <keith@tungstengraphics.com> */ -#include "glheader.h" -#include "macros.h" -#include "enums.h" - +#include "main/glheader.h" +#include "main/macros.h" +#include "main/enums.h" #include "shader/program.h" + #include "intel_batchbuffer.h" #include "brw_defines.h" diff --git a/src/mesa/drivers/dri/i965/brw_clip_point.c b/src/mesa/drivers/dri/i965/brw_clip_point.c index 2346980a56..d17b199b89 100644 --- a/src/mesa/drivers/dri/i965/brw_clip_point.c +++ b/src/mesa/drivers/dri/i965/brw_clip_point.c @@ -29,11 +29,11 @@ * Keith Whitwell <keith@tungstengraphics.com> */ -#include "glheader.h" -#include "macros.h" -#include "enums.h" - +#include "main/glheader.h" +#include "main/macros.h" +#include "main/enums.h" #include "shader/program.h" + #include "intel_batchbuffer.h" #include "brw_defines.h" diff --git a/src/mesa/drivers/dri/i965/brw_clip_state.c b/src/mesa/drivers/dri/i965/brw_clip_state.c index 2d0b24c5ca..82d1e87357 100644 --- a/src/mesa/drivers/dri/i965/brw_clip_state.c +++ b/src/mesa/drivers/dri/i965/brw_clip_state.c @@ -32,7 +32,7 @@ #include "brw_context.h" #include "brw_state.h" #include "brw_defines.h" -#include "macros.h" +#include "main/macros.h" struct brw_clip_unit_key { unsigned int total_grf; @@ -119,19 +119,19 @@ clip_unit_create_from_key(struct brw_context *brw, /* Emit clip program relocation */ assert(brw->clip.prog_bo); - dri_emit_reloc(bo, - DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_READ, - clip.thread0.grf_reg_count << 1, - offsetof(struct brw_clip_unit_state, thread0), - brw->clip.prog_bo); + dri_bo_emit_reloc(bo, + I915_GEM_DOMAIN_INSTRUCTION, + 0, + clip.thread0.grf_reg_count << 1, + offsetof(struct brw_clip_unit_state, thread0), + brw->clip.prog_bo); return bo; } -static int upload_clip_unit( struct brw_context *brw ) +static void upload_clip_unit( struct brw_context *brw ) { struct brw_clip_unit_key key; - int ret = 0; clip_unit_populate_key(brw, &key); @@ -143,9 +143,6 @@ static int upload_clip_unit( struct brw_context *brw ) if (brw->clip.state_bo == NULL) { brw->clip.state_bo = clip_unit_create_from_key(brw, &key); } - - ret = dri_bufmgr_check_aperture_space(brw->clip.state_bo); - return ret; } const struct brw_tracked_state brw_clip_unit = { diff --git a/src/mesa/drivers/dri/i965/brw_clip_tri.c b/src/mesa/drivers/dri/i965/brw_clip_tri.c index 7c703179fe..8459b59b46 100644 --- a/src/mesa/drivers/dri/i965/brw_clip_tri.c +++ b/src/mesa/drivers/dri/i965/brw_clip_tri.c @@ -29,11 +29,11 @@ * Keith Whitwell <keith@tungstengraphics.com> */ -#include "glheader.h" -#include "macros.h" -#include "enums.h" - +#include "main/glheader.h" +#include "main/macros.h" +#include "main/enums.h" #include "shader/program.h" + #include "intel_batchbuffer.h" #include "brw_defines.h" @@ -42,16 +42,6 @@ #include "brw_util.h" #include "brw_clip.h" -static struct brw_reg get_tmp( struct brw_clip_compile *c ) -{ - struct brw_reg tmp = brw_vec4_grf(c->last_tmp, 0); - - if (++c->last_tmp > c->prog_data.total_grf) - c->prog_data.total_grf = c->last_tmp; - - return tmp; -} - static void release_tmps( struct brw_clip_compile *c ) { c->last_tmp = c->first_tmp; diff --git a/src/mesa/drivers/dri/i965/brw_clip_unfilled.c b/src/mesa/drivers/dri/i965/brw_clip_unfilled.c index 57ebf388f5..d7ca517927 100644 --- a/src/mesa/drivers/dri/i965/brw_clip_unfilled.c +++ b/src/mesa/drivers/dri/i965/brw_clip_unfilled.c @@ -29,11 +29,11 @@ * Keith Whitwell <keith@tungstengraphics.com> */ -#include "glheader.h" -#include "macros.h" -#include "enums.h" - +#include "main/glheader.h" +#include "main/macros.h" +#include "main/enums.h" #include "shader/program.h" + #include "intel_batchbuffer.h" #include "brw_defines.h" @@ -58,10 +58,30 @@ static void compute_tri_direction( struct brw_clip_compile *c ) struct brw_reg v2 = byte_offset(c->reg.vertex[2], c->offset[VERT_RESULT_HPOS]); + struct brw_reg v0n = get_tmp(c); + struct brw_reg v1n = get_tmp(c); + struct brw_reg v2n = get_tmp(c); + + /* Convert to NDC. + * NOTE: We can't modify the original vertex coordinates, + * as it may impact further operations. + * So, we have to keep normalized coordinates in temp registers. + * + * TBD-KC + * Try to optimize unnecessary MOV's. + */ + brw_MOV(p, v0n, v0); + brw_MOV(p, v1n, v1); + brw_MOV(p, v2n, v2); + + brw_clip_project_position(c, v0n); + brw_clip_project_position(c, v1n); + brw_clip_project_position(c, v2n); + /* Calculate the vectors of two edges of the triangle: */ - brw_ADD(p, e, v0, negate(v2)); - brw_ADD(p, f, v1, negate(v2)); + brw_ADD(p, e, v0n, negate(v2n)); + brw_ADD(p, f, v1n, negate(v2n)); /* Take their crossproduct: */ diff --git a/src/mesa/drivers/dri/i965/brw_clip_util.c b/src/mesa/drivers/dri/i965/brw_clip_util.c index 0ca2a6747a..9d3b0be694 100644 --- a/src/mesa/drivers/dri/i965/brw_clip_util.c +++ b/src/mesa/drivers/dri/i965/brw_clip_util.c @@ -30,11 +30,11 @@ */ -#include "glheader.h" -#include "macros.h" -#include "enums.h" - +#include "main/glheader.h" +#include "main/macros.h" +#include "main/enums.h" #include "shader/program.h" + #include "intel_batchbuffer.h" #include "brw_defines.h" @@ -46,8 +46,7 @@ - -static struct brw_reg get_tmp( struct brw_clip_compile *c ) +struct brw_reg get_tmp( struct brw_clip_compile *c ) { struct brw_reg tmp = brw_vec4_grf(c->last_tmp, 0); @@ -90,7 +89,7 @@ void brw_clip_init_planes( struct brw_clip_compile *c ) /* Project 'pos' to screen space (or back again), overwrite with results: */ -static void brw_clip_project_position(struct brw_clip_compile *c, struct brw_reg pos ) +void brw_clip_project_position(struct brw_clip_compile *c, struct brw_reg pos ) { struct brw_compile *p = &c->func; diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c index 1c7ad5c9c8..92629016d9 100644 --- a/src/mesa/drivers/dri/i965/brw_context.c +++ b/src/mesa/drivers/dri/i965/brw_context.c @@ -30,11 +30,15 @@ */ +#include "main/imports.h" +#include "main/api_noop.h" +#include "main/vtxfmt.h" +#include "shader/shader_api.h" + #include "brw_context.h" #include "brw_defines.h" #include "brw_draw.h" #include "brw_vs.h" -#include "imports.h" #include "intel_tex.h" #include "intel_blit.h" #include "intel_batchbuffer.h" @@ -43,10 +47,7 @@ #include "tnl/t_pipeline.h" #include "utils.h" -#include "api_noop.h" -#include "vtxfmt.h" -#include "shader/shader_api.h" /*************************************** * Mesa's Driver Functions @@ -134,7 +135,6 @@ GLboolean brwCreateContext( const __GLcontextModes *mesaVis, ctx->Const.Max3DTextureLevels = 9; ctx->Const.MaxCubeTextureLevels = 12; ctx->Const.MaxTextureRectSize = (1<<11); - ctx->Const.MaxTextureUnits = BRW_MAX_TEX_UNIT; /* ctx->Const.MaxNativeVertexProgramTemps = 32; */ @@ -147,7 +147,8 @@ GLboolean brwCreateContext( const __GLcontextModes *mesaVis, brw->emit_state_always = 0; - ctx->FragmentProgram._MaintainTexEnvProgram = 1; + ctx->VertexProgram._MaintainTnlProgram = GL_TRUE; + ctx->FragmentProgram._MaintainTexEnvProgram = GL_TRUE; brw_draw_init( brw ); diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h index 32e05542e0..b04487ecee 100644 --- a/src/mesa/drivers/dri/i965/brw_context.h +++ b/src/mesa/drivers/dri/i965/brw_context.h @@ -35,7 +35,7 @@ #include "intel_context.h" #include "brw_structs.h" -#include "imports.h" +#include "main/imports.h" /* Glossary: @@ -135,6 +135,8 @@ struct brw_context; #define BRW_NEW_METAOPS 0x1000 #define BRW_NEW_FENCE 0x2000 #define BRW_NEW_LOCK 0x4000 +#define BRW_NEW_INDICES 0x8000 +#define BRW_NEW_VERTICES 0x10000 /** * Used for any batch entry with a relocated pointer that will be used * by any 3D rendering. @@ -332,7 +334,7 @@ struct brw_state_pointers { */ struct brw_tracked_state { struct brw_state_flags dirty; - int (*prepare)( struct brw_context *brw ); + void (*prepare)( struct brw_context *brw ); void (*emit)( struct brw_context *brw ); }; @@ -450,9 +452,22 @@ struct brw_context * for changes to this state: */ struct brw_vertex_info info; + unsigned int min_index, max_index; } vb; struct { + /** + * Index buffer for this draw_prims call. + * + * Updates are signaled by BRW_NEW_INDICES. + */ + const struct _mesa_index_buffer *ib; + + dri_bo *bo; + unsigned int offset; + } ib; + + struct { /* Will be allocated on demand if needed. */ struct brw_state_pointers attribs; @@ -542,6 +557,11 @@ struct brw_context GLfloat *last_buf; GLuint last_bufsz; + /** + * Whether we should create a new bo instead of reusing the old one + * (if we just dispatch the batch pointing at the old one. + */ + GLboolean need_new_bo; } curbe; struct { @@ -641,7 +661,7 @@ GLboolean brwCreateContext( const __GLcontextModes *mesaVis, /*====================================================================== * brw_state.c */ -int brw_validate_state( struct brw_context *brw ); +void brw_validate_state( struct brw_context *brw ); void brw_init_state( struct brw_context *brw ); void brw_destroy_state( struct brw_context *brw ); diff --git a/src/mesa/drivers/dri/i965/brw_curbe.c b/src/mesa/drivers/dri/i965/brw_curbe.c index 5ff4e2964e..7cddd3a7de 100644 --- a/src/mesa/drivers/dri/i965/brw_curbe.c +++ b/src/mesa/drivers/dri/i965/brw_curbe.c @@ -31,10 +31,10 @@ -#include "glheader.h" -#include "context.h" -#include "macros.h" -#include "enums.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/macros.h" +#include "main/enums.h" #include "shader/prog_parameter.h" #include "shader/prog_statevars.h" #include "intel_batchbuffer.h" @@ -46,7 +46,7 @@ /* Partition the CURBE between the various users of constant values: */ -static int calculate_curbe_offsets( struct brw_context *brw ) +static void calculate_curbe_offsets( struct brw_context *brw ) { /* CACHE_NEW_WM_PROG */ GLuint nr_fp_regs = (brw->wm.prog_data->nr_params + 15) / 16; @@ -117,7 +117,6 @@ static int calculate_curbe_offsets( struct brw_context *brw ) brw->state.dirty.brw |= BRW_NEW_CURBE_OFFSETS; } - return 0; } @@ -156,19 +155,7 @@ void brw_upload_constant_buffer_state(struct brw_context *brw) assert(brw->urb.nr_cs_entries); BRW_CACHED_BATCH_STRUCT(brw, &cbs); -} - -#if 0 -const struct brw_tracked_state brw_constant_buffer_state = { - .dirty = { - .mesa = 0, - .brw = BRW_NEW_URB_FENCE, - .cache = 0 - }, - .update = brw_upload_constant_buffer_state -}; -#endif - +} static GLfloat fixed_plane[6][4] = { { 0, 0, -1, 1 }, @@ -183,7 +170,7 @@ static GLfloat fixed_plane[6][4] = { * cache mechanism, but maybe would benefit from a comparison against * the current uploaded set of constants. */ -static int prepare_constant_buffer(struct brw_context *brw) +static void prepare_constant_buffer(struct brw_context *brw) { GLcontext *ctx = &brw->intel.ctx; struct brw_vertex_program *vp = (struct brw_vertex_program *)brw->vertex_program; @@ -207,8 +194,8 @@ static int prepare_constant_buffer(struct brw_context *brw) brw->curbe.last_buf = NULL; brw->curbe.last_bufsz = 0; } - - return 0; + + return; } buf = (GLfloat *)malloc(bufsz); @@ -295,7 +282,8 @@ static int prepare_constant_buffer(struct brw_context *brw) brw->curbe.last_bufsz = bufsz; if (brw->curbe.curbe_bo != NULL && - brw->curbe.curbe_next_offset + bufsz > brw->curbe.curbe_bo->size) + (brw->curbe.need_new_bo || + brw->curbe.curbe_next_offset + bufsz > brw->curbe.curbe_bo->size)) { dri_bo_unreference(brw->curbe.curbe_bo); brw->curbe.curbe_bo = NULL; @@ -306,10 +294,7 @@ static int prepare_constant_buffer(struct brw_context *brw) * They're generally around 64b. */ brw->curbe.curbe_bo = dri_bo_alloc(brw->intel.bufmgr, "CURBE", - 4096, 1 << 6, - DRM_BO_FLAG_MEM_LOCAL | - DRM_BO_FLAG_CACHED | - DRM_BO_FLAG_CACHED_MAPPED); + 4096, 1 << 6); brw->curbe.curbe_next_offset = 0; } @@ -336,9 +321,6 @@ static int prepare_constant_buffer(struct brw_context *brw) * flushes as necessary when doublebuffering of CURBEs isn't * possible. */ - - /* check aperture space for this bo */ - return dri_bufmgr_check_aperture_space(brw->curbe.curbe_bo); } @@ -346,6 +328,13 @@ static void emit_constant_buffer(struct brw_context *brw) { struct intel_context *intel = &brw->intel; GLuint sz = brw->curbe.total_size; + dri_bo *aper_array[] = { + brw->intel.batch->buf, + brw->curbe.curbe_bo, + }; + + if (dri_bufmgr_check_aperture_space(aper_array, ARRAY_SIZE(aper_array))) + intel_batchbuffer_flush(intel->batch); BEGIN_BATCH(2, IGNORE_CLIPRECTS); if (sz == 0) { @@ -353,7 +342,8 @@ static void emit_constant_buffer(struct brw_context *brw) OUT_BATCH(0); } else { OUT_BATCH((CMD_CONST_BUFFER << 16) | (1 << 8) | (2 - 2)); - OUT_RELOC(brw->curbe.curbe_bo, DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_READ, + OUT_RELOC(brw->curbe.curbe_bo, + I915_GEM_DOMAIN_INSTRUCTION, 0, (sz - 1) + brw->curbe.curbe_offset); } ADVANCE_BATCH(); diff --git a/src/mesa/drivers/dri/i965/brw_defines.h b/src/mesa/drivers/dri/i965/brw_defines.h index 92c058ade8..0593e8d5f5 100644 --- a/src/mesa/drivers/dri/i965/brw_defines.h +++ b/src/mesa/drivers/dri/i965/brw_defines.h @@ -33,69 +33,6 @@ #ifndef BRW_DEFINES_H #define BRW_DEFINES_H -/* - */ -#define MI_NOOP 0x00 -#define MI_USER_INTERRUPT 0x02 -#define MI_WAIT_FOR_EVENT 0x03 -#define MI_FLUSH 0x04 -#define MI_REPORT_HEAD 0x07 -#define MI_ARB_ON_OFF 0x08 -#define MI_BATCH_BUFFER_END 0x0A -#define MI_OVERLAY_FLIP 0x11 -#define MI_LOAD_SCAN_LINES_INCL 0x12 -#define MI_LOAD_SCAN_LINES_EXCL 0x13 -#define MI_DISPLAY_BUFFER_INFO 0x14 -#define MI_SET_CONTEXT 0x18 -#define MI_STORE_DATA_IMM 0x20 -#define MI_STORE_DATA_INDEX 0x21 -#define MI_LOAD_REGISTER_IMM 0x22 -#define MI_STORE_REGISTER_MEM 0x24 -#define MI_BATCH_BUFFER_START 0x31 - -#define MI_SYNCHRONOUS_FLIP 0x0 -#define MI_ASYNCHRONOUS_FLIP 0x1 - -#define MI_BUFFER_SECURE 0x0 -#define MI_BUFFER_NONSECURE 0x1 - -#define MI_ARBITRATE_AT_CHAIN_POINTS 0x0 -#define MI_ARBITRATE_BETWEEN_INSTS 0x1 -#define MI_NO_ARBITRATION 0x3 - -#define MI_CONDITION_CODE_WAIT_DISABLED 0x0 -#define MI_CONDITION_CODE_WAIT_0 0x1 -#define MI_CONDITION_CODE_WAIT_1 0x2 -#define MI_CONDITION_CODE_WAIT_2 0x3 -#define MI_CONDITION_CODE_WAIT_3 0x4 -#define MI_CONDITION_CODE_WAIT_4 0x5 - -#define MI_DISPLAY_PIPE_A 0x0 -#define MI_DISPLAY_PIPE_B 0x1 - -#define MI_DISPLAY_PLANE_A 0x0 -#define MI_DISPLAY_PLANE_B 0x1 -#define MI_DISPLAY_PLANE_C 0x2 - -#define MI_STANDARD_FLIP 0x0 -#define MI_ENQUEUE_FLIP_PERFORM_BASE_FRAME_NUMBER_LOAD 0x1 -#define MI_ENQUEUE_FLIP_TARGET_FRAME_NUMBER_RELATIVE 0x2 -#define MI_ENQUEUE_FLIP_ABSOLUTE_TARGET_FRAME_NUMBER 0x3 - -#define MI_PHYSICAL_ADDRESS 0x0 -#define MI_VIRTUAL_ADDRESS 0x1 - -#define MI_BUFFER_MEMORY_MAIN 0x0 -#define MI_BUFFER_MEMORY_GTT 0x2 -#define MI_BUFFER_MEMORY_PER_PROCESS_GTT 0x3 - -#define MI_FLIP_CONTINUE 0x0 -#define MI_FLIP_ON 0x1 -#define MI_FLIP_OFF 0x2 - -#define MI_UNTRUSTED_REGISTER_SPACE 0x0 -#define MI_TRUSTED_REGISTER_SPACE 0x1 - /* 3D state: */ #define _3DOP_3DSTATE_PIPELINED 0x0 @@ -119,7 +56,6 @@ #define _3DSTATE_LINE_STIPPLE 0x08 #define _3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP 0x09 #define _3DCONTROL 0x00 -#define _3DPRIMITIVE 0x00 #define PIPE_CONTROL_NOWRITE 0x00 #define PIPE_CONTROL_WRITEIMMEDIATE 0x01 diff --git a/src/mesa/drivers/dri/i965/brw_draw.c b/src/mesa/drivers/dri/i965/brw_draw.c index f90c5f7b08..39ce8eb4b6 100644 --- a/src/mesa/drivers/dri/i965/brw_draw.c +++ b/src/mesa/drivers/dri/i965/brw_draw.c @@ -27,11 +27,11 @@ #include <stdlib.h> -#include "glheader.h" -#include "context.h" -#include "state.h" -#include "api_validate.h" -#include "enums.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/state.h" +#include "main/api_validate.h" +#include "main/enums.h" #include "brw_draw.h" #include "brw_defines.h" @@ -39,7 +39,6 @@ #include "brw_state.h" #include "brw_fallback.h" -#include "intel_ioctl.h" #include "intel_batchbuffer.h" #include "intel_buffer_objects.h" @@ -83,9 +82,8 @@ static const GLenum reduced_prim[GL_POLYGON+1] = { * programs be immune to the active primitive (ie. cope with all * possibilities). That may not be realistic however. */ -static GLuint brw_set_prim(struct brw_context *brw, GLenum prim, GLboolean *need_flush) +static GLuint brw_set_prim(struct brw_context *brw, GLenum prim) { - int ret; if (INTEL_DEBUG & DEBUG_PRIMS) _mesa_printf("PRIM: %s\n", _mesa_lookup_enum_by_nr(prim)); @@ -106,9 +104,7 @@ static GLuint brw_set_prim(struct brw_context *brw, GLenum prim, GLboolean *need brw->state.dirty.brw |= BRW_NEW_REDUCED_PRIMITIVE; } - ret = brw_validate_state(brw); - if (ret) - *need_flush = GL_TRUE; + brw_validate_state(brw); } return hw_prim[prim]; @@ -131,7 +127,6 @@ static void brw_emit_prim( struct brw_context *brw, { struct brw_3d_primitive prim_packet; - GLboolean need_flush = GL_FALSE; if (INTEL_DEBUG & DEBUG_PRIMS) _mesa_printf("PRIM: %s %d %d\n", _mesa_lookup_enum_by_nr(prim->mode), @@ -140,7 +135,7 @@ static void brw_emit_prim( struct brw_context *brw, prim_packet.header.opcode = CMD_3D_PRIM; prim_packet.header.length = sizeof(prim_packet)/4 - 2; prim_packet.header.pad = 0; - prim_packet.header.topology = brw_set_prim(brw, prim->mode, &need_flush); + prim_packet.header.topology = brw_set_prim(brw, prim->mode); prim_packet.header.indexed = prim->indexed; prim_packet.verts_per_instance = trim(prim->mode, prim->count); @@ -149,22 +144,25 @@ static void brw_emit_prim( struct brw_context *brw, prim_packet.start_instance_location = 0; prim_packet.base_vert_location = 0; + /* Can't wrap here, since we rely on the validated state. */ + brw->no_batch_wrap = GL_TRUE; if (prim_packet.verts_per_instance) { intel_batchbuffer_data( brw->intel.batch, &prim_packet, sizeof(prim_packet), LOOP_CLIPRECTS); } - - assert(need_flush == GL_FALSE); + brw->no_batch_wrap = GL_FALSE; } static void brw_merge_inputs( struct brw_context *brw, const struct gl_client_array *arrays[]) { - struct brw_vertex_element *inputs = brw->vb.inputs; struct brw_vertex_info old = brw->vb.info; GLuint i; - memset(inputs, 0, sizeof(*inputs)); + for (i = 0; i < VERT_ATTRIB_MAX; i++) + dri_bo_unreference(brw->vb.inputs[i].bo); + + memset(&brw->vb.inputs, 0, sizeof(brw->vb.inputs)); memset(&brw->vb.info, 0, sizeof(brw->vb.info)); for (i = 0; i < VERT_ATTRIB_MAX; i++) { @@ -175,7 +173,8 @@ static void brw_merge_inputs( struct brw_context *brw, if (arrays[i]->StrideB != 0) brw->vb.info.varying |= 1 << i; - brw->vb.info.sizes[i/16] |= (inputs[i].glarray->Size - 1) << ((i%16) * 2); + brw->vb.info.sizes[i/16] |= (brw->vb.inputs[i].glarray->Size - 1) << + ((i%16) * 2); } } @@ -258,10 +257,6 @@ static GLboolean brw_try_draw_prims( GLcontext *ctx, struct brw_context *brw = brw_context(ctx); GLboolean retval = GL_FALSE; GLuint i; - GLuint ib_offset; - dri_bo *ib_bo; - GLboolean force_flush = GL_FALSE; - int ret; if (ctx->NewState) _mesa_update_state( ctx ); @@ -271,7 +266,13 @@ static GLboolean brw_try_draw_prims( GLcontext *ctx, /* Bind all inputs, derive varying and size information: */ brw_merge_inputs( brw, arrays ); - + + brw->ib.ib = ib; + brw->state.dirty.brw |= BRW_NEW_INDICES; + + brw->vb.min_index = min_index; + brw->vb.max_index = max_index; + brw->state.dirty.brw |= BRW_NEW_VERTICES; /* Have to validate state quite late. Will rebuild tnl_program, * which depends on varying information. * @@ -294,29 +295,18 @@ static GLboolean brw_try_draw_prims( GLcontext *ctx, * an upper bound of how much we might emit in a single * brw_try_draw_prims(). */ - flush: - if (force_flush) - brw->no_batch_wrap = GL_FALSE; - if (intel->batch->ptr - intel->batch->map > intel->batch->size * 3 / 4 /* brw_emit_prim may change the cliprect_mode to LOOP_CLIPRECTS */ - || intel->batch->cliprect_mode != LOOP_CLIPRECTS || (force_flush == GL_TRUE)) + || intel->batch->cliprect_mode != LOOP_CLIPRECTS) intel_batchbuffer_flush(intel->batch); - force_flush = GL_FALSE; - brw->no_batch_wrap = GL_TRUE; - /* Set the first primitive early, ahead of validate_state: */ - brw_set_prim(brw, prim[0].mode, &force_flush); + brw_set_prim(brw, prim[0].mode); /* XXX: Need to separate validate and upload of state. */ - ret = brw_validate_state( brw ); - if (ret) { - force_flush = GL_TRUE; - goto flush; - } + brw_validate_state( brw ); /* Various fallback checks: */ @@ -326,31 +316,6 @@ static GLboolean brw_try_draw_prims( GLcontext *ctx, if (check_fallbacks( brw, prim, nr_prims )) goto out; - /* need to account for index buffer and vertex buffer */ - if (ib) { - ret = brw_prepare_indices( brw, ib , &ib_bo, &ib_offset); - if (ret) { - force_flush = GL_TRUE; - goto flush; - } - } - - ret = brw_prepare_vertices( brw, min_index, max_index); - if (ret < 0) - goto out; - - if (ret > 0) { - force_flush = GL_TRUE; - goto flush; - } - - /* Upload index, vertex data: - */ - if (ib) - brw_emit_indices( brw, ib, ib_bo, ib_offset); - - brw_emit_vertices( brw, min_index, max_index); - for (i = 0; i < nr_prims; i++) { brw_emit_prim(brw, &prim[i]); } @@ -359,9 +324,6 @@ static GLboolean brw_try_draw_prims( GLcontext *ctx, } out: - - brw->no_batch_wrap = GL_FALSE; - UNLOCK_HARDWARE(intel); if (!retval) @@ -447,8 +409,18 @@ void brw_draw_init( struct brw_context *brw ) void brw_draw_destroy( struct brw_context *brw ) { + int i; + if (brw->vb.upload.bo != NULL) { dri_bo_unreference(brw->vb.upload.bo); brw->vb.upload.bo = NULL; } + + for (i = 0; i < VERT_ATTRIB_MAX; i++) { + dri_bo_unreference(brw->vb.inputs[i].bo); + brw->vb.inputs[i].bo = NULL; + } + + dri_bo_unreference(brw->ib.bo); + brw->ib.bo = NULL; } diff --git a/src/mesa/drivers/dri/i965/brw_draw.h b/src/mesa/drivers/dri/i965/brw_draw.h index b3547400d4..9aebbdb1b8 100644 --- a/src/mesa/drivers/dri/i965/brw_draw.h +++ b/src/mesa/drivers/dri/i965/brw_draw.h @@ -28,10 +28,9 @@ #ifndef BRW_DRAW_H #define BRW_DRAW_H -#include "mtypes.h" /* for GLcontext... */ +#include "main/mtypes.h" /* for GLcontext... */ #include "vbo/vbo.h" -#include "dri_bufmgr.h" struct brw_context; @@ -51,27 +50,4 @@ void brw_draw_destroy( struct brw_context *brw ); void brw_init_current_values(GLcontext *ctx, struct gl_client_array *arrays); - -/* brw_draw_upload.c - */ -int brw_prepare_indices( struct brw_context *brw, - const struct _mesa_index_buffer *index_buffer, - dri_bo **bo_return, - GLuint *offset_return); - -void brw_emit_indices( struct brw_context *brw, - const struct _mesa_index_buffer *index_buffer, - dri_bo *bo, - GLuint offset); - -int brw_prepare_vertices( struct brw_context *brw, - GLuint min_index, - GLuint max_index ); - -void brw_emit_vertices( struct brw_context *brw, - GLuint min_index, - GLuint max_index ); - - - #endif diff --git a/src/mesa/drivers/dri/i965/brw_draw_upload.c b/src/mesa/drivers/dri/i965/brw_draw_upload.c index 2d99238ddc..303eaac5cf 100644 --- a/src/mesa/drivers/dri/i965/brw_draw_upload.c +++ b/src/mesa/drivers/dri/i965/brw_draw_upload.c @@ -27,11 +27,11 @@ #include <stdlib.h> -#include "glheader.h" -#include "context.h" -#include "state.h" -#include "api_validate.h" -#include "enums.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/state.h" +#include "main/api_validate.h" +#include "main/enums.h" #include "brw_draw.h" #include "brw_defines.h" @@ -39,7 +39,6 @@ #include "brw_state.h" #include "brw_fallback.h" -#include "intel_ioctl.h" #include "intel_batchbuffer.h" #include "intel_buffer_objects.h" #include "intel_tex.h" @@ -217,25 +216,6 @@ static GLuint get_index_type(GLenum type) } } -static void copy_strided_array( GLubyte *dest, - const GLubyte *src, - GLuint size, - GLuint stride, - GLuint count ) -{ - if (size == stride) - memcpy(dest, src, count * size); - else { - GLuint i; - - for (i = 0; i < count; i++) { - memcpy(dest, src, size); - src += stride; - dest += size; - } - } -} - static void wrap_buffers( struct brw_context *brw, GLuint size ) { @@ -247,10 +227,7 @@ static void wrap_buffers( struct brw_context *brw, if (brw->vb.upload.bo != NULL) dri_bo_unreference(brw->vb.upload.bo); brw->vb.upload.bo = dri_bo_alloc(brw->intel.bufmgr, "temporary VBO", - size, 1, - DRM_BO_FLAG_MEM_LOCAL | - DRM_BO_FLAG_CACHED | - DRM_BO_FLAG_CACHED_MAPPED); + size, 1); /* Set the internal VBO\ to no-backing-store. We only use them as a * temporary within a brw_try_draw_prims while the lock is held. @@ -296,18 +273,34 @@ copy_array_to_vbo_array( struct brw_context *brw, element->stride = dst_stride; } - dri_bo_map(element->bo, GL_TRUE); - copy_strided_array((unsigned char *)element->bo->virtual + element->offset, - element->glarray->Ptr, - dst_stride, - element->glarray->StrideB, - element->count); - dri_bo_unmap(element->bo); + if (dst_stride == element->glarray->StrideB) { + dri_bo_subdata(element->bo, + element->offset, + size, + element->glarray->Ptr); + } else { + void *data; + char *dest; + const char *src = element->glarray->Ptr; + int i; + + data = _mesa_malloc(dst_stride * element->count); + dest = data; + for (i = 0; i < element->count; i++) { + memcpy(dest, src, dst_stride); + src += element->glarray->StrideB; + dest += dst_stride; + } + + dri_bo_subdata(element->bo, + element->offset, + size, + data); + _mesa_free(data); + } } -int brw_prepare_vertices( struct brw_context *brw, - GLuint min_index, - GLuint max_index ) +static void brw_prepare_vertices(struct brw_context *brw) { GLcontext *ctx = &brw->intel.ctx; struct intel_context *intel = intel_context(ctx); @@ -315,7 +308,8 @@ int brw_prepare_vertices( struct brw_context *brw, GLuint i; const unsigned char *ptr = NULL; GLuint interleave = 0; - int ret = 0; + unsigned int min_index = brw->vb.min_index; + unsigned int max_index = brw->vb.max_index; struct brw_vertex_element *enabled[VERT_ATTRIB_MAX]; GLuint nr_enabled = 0; @@ -343,8 +337,10 @@ int brw_prepare_vertices( struct brw_context *brw, * cases with > 17 vertex attributes enabled, so it probably * isn't an issue at this point. */ - if (nr_enabled >= BRW_VEP_MAX) - return -1; + if (nr_enabled >= BRW_VEP_MAX) { + intel->Fallback = 1; + return; + } for (i = 0; i < nr_enabled; i++) { struct brw_vertex_element *input = enabled[i]; @@ -362,8 +358,6 @@ int brw_prepare_vertices( struct brw_context *brw, dri_bo_reference(input->bo); input->offset = (unsigned long)input->glarray->Ptr; input->stride = input->glarray->StrideB; - - ret |= dri_bufmgr_check_aperture_space(input->bo); } else { /* Queue the buffer object up to be uploaded in the next pass, * when we've decided if we're doing interleaved or not. @@ -372,7 +366,7 @@ int brw_prepare_vertices( struct brw_context *brw, /* Position array not properly enabled: */ if (input->glarray->StrideB == 0) - return -1; + return; interleave = input->glarray->StrideB; ptr = input->glarray->Ptr; @@ -404,7 +398,6 @@ int brw_prepare_vertices( struct brw_context *brw, */ copy_array_to_vbo_array(brw, upload[0], interleave); - ret |= dri_bufmgr_check_aperture_space(upload[0]->bo); for (i = 1; i < nr_uploads; i++) { /* Then, just point upload[i] at upload[0]'s buffer. */ upload[i]->stride = interleave; @@ -418,23 +411,11 @@ int brw_prepare_vertices( struct brw_context *brw, /* Upload non-interleaved arrays */ for (i = 0; i < nr_uploads; i++) { copy_array_to_vbo_array(brw, upload[i], upload[i]->element_size); - if (upload[i]->bo) { - ret |= dri_bufmgr_check_aperture_space(upload[i]->bo); - } } } - - - if (ret) - return 1; - - - return 0; } -void brw_emit_vertices( struct brw_context *brw, - GLuint min_index, - GLuint max_index ) +static void brw_emit_vertices(struct brw_context *brw) { GLcontext *ctx = &brw->intel.ctx; struct intel_context *intel = intel_context(ctx); @@ -470,16 +451,10 @@ void brw_emit_vertices( struct brw_context *brw, BRW_VB0_ACCESS_VERTEXDATA | (input->stride << BRW_VB0_PITCH_SHIFT)); OUT_RELOC(input->bo, - DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_READ, + I915_GEM_DOMAIN_VERTEX, 0, input->offset); - OUT_BATCH(max_index); + OUT_BATCH(brw->vb.max_index); OUT_BATCH(0); /* Instance data step rate */ - - /* Unreference the buffer so it can get freed, now that we won't - * touch it any more. - */ - dri_bo_unreference(input->bo); - input->bo = NULL; } ADVANCE_BATCH(); @@ -516,18 +491,31 @@ void brw_emit_vertices( struct brw_context *brw, ADVANCE_BATCH(); } -int brw_prepare_indices( struct brw_context *brw, - const struct _mesa_index_buffer *index_buffer, - dri_bo **bo_return, - GLuint *offset_return) +const struct brw_tracked_state brw_vertices = { + .dirty = { + .mesa = 0, + .brw = BRW_NEW_BATCH | BRW_NEW_VERTICES, + .cache = 0, + }, + .prepare = brw_prepare_vertices, + .emit = brw_emit_vertices, +}; + +static void brw_prepare_indices(struct brw_context *brw) { GLcontext *ctx = &brw->intel.ctx; struct intel_context *intel = &brw->intel; - GLuint ib_size = get_size(index_buffer->type) * index_buffer->count; + const struct _mesa_index_buffer *index_buffer = brw->ib.ib; + GLuint ib_size; dri_bo *bo; - struct gl_buffer_object *bufferobj = index_buffer->obj; - GLuint offset = (GLuint)index_buffer->ptr; - int ret; + struct gl_buffer_object *bufferobj; + GLuint offset; + + if (index_buffer == NULL) + return; + + ib_size = get_size(index_buffer->type) * index_buffer->count; + bufferobj = index_buffer->obj;; /* Turn into a proper VBO: */ @@ -541,6 +529,8 @@ int brw_prepare_indices( struct brw_context *brw, */ dri_bo_subdata(bo, offset, ib_size, index_buffer->ptr); } else { + offset = (GLuint)index_buffer->ptr; + /* If the index buffer isn't aligned to its element size, we have to * rebase it into a temporary. */ @@ -563,19 +553,22 @@ int brw_prepare_indices( struct brw_context *brw, } } - *bo_return = bo; - *offset_return = offset; - ret = dri_bufmgr_check_aperture_space(bo); - return ret; + dri_bo_unreference(brw->ib.bo); + brw->ib.bo = bo; + brw->ib.offset = offset; } -void brw_emit_indices(struct brw_context *brw, - const struct _mesa_index_buffer *index_buffer, - dri_bo *bo, - GLuint offset) +static void brw_emit_indices(struct brw_context *brw) { struct intel_context *intel = &brw->intel; - GLuint ib_size = get_size(index_buffer->type) * index_buffer->count; + const struct _mesa_index_buffer *index_buffer = brw->ib.ib; + GLuint ib_size; + + if (index_buffer == NULL) + return; + + ib_size = get_size(index_buffer->type) * index_buffer->count; + /* Emit the indexbuffer packet: */ { @@ -591,13 +584,23 @@ void brw_emit_indices(struct brw_context *brw, BEGIN_BATCH(4, IGNORE_CLIPRECTS); OUT_BATCH( ib.header.dword ); - OUT_RELOC( bo, DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_READ, offset); - OUT_RELOC( bo, DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_READ, - offset + ib_size); + OUT_RELOC(brw->ib.bo, + I915_GEM_DOMAIN_VERTEX, 0, + brw->ib.offset); + OUT_RELOC(brw->ib.bo, + I915_GEM_DOMAIN_VERTEX, 0, + brw->ib.offset + ib_size); OUT_BATCH( 0 ); ADVANCE_BATCH(); - - dri_bo_unreference(bo); } } +const struct brw_tracked_state brw_indices = { + .dirty = { + .mesa = 0, + .brw = BRW_NEW_BATCH | BRW_NEW_INDICES, + .cache = 0, + }, + .prepare = brw_prepare_indices, + .emit = brw_emit_indices, +}; diff --git a/src/mesa/drivers/dri/i965/brw_eu_debug.c b/src/mesa/drivers/dri/i965/brw_eu_debug.c index 2dff1ad224..91dbbd5af6 100644 --- a/src/mesa/drivers/dri/i965/brw_eu_debug.c +++ b/src/mesa/drivers/dri/i965/brw_eu_debug.c @@ -30,9 +30,9 @@ */ -#include "mtypes.h" +#include "main/mtypes.h" +#include "main/imports.h" #include "brw_eu.h" -#include "imports.h" void brw_print_reg( struct brw_reg hwreg ) { diff --git a/src/mesa/drivers/dri/i965/brw_eu_emit.c b/src/mesa/drivers/dri/i965/brw_eu_emit.c index 6b97f8b170..0bfbec9d14 100644 --- a/src/mesa/drivers/dri/i965/brw_eu_emit.c +++ b/src/mesa/drivers/dri/i965/brw_eu_emit.c @@ -513,6 +513,8 @@ struct brw_instruction *brw_IF(struct brw_compile *p, GLuint execute_size) insn->header.compression_control = BRW_COMPRESSION_NONE; insn->header.predicate_control = BRW_PREDICATE_NORMAL; insn->header.mask_control = BRW_MASK_ENABLE; + if (!p->single_program_flow) + insn->header.thread_control = BRW_THREAD_SWITCH; p->current->header.predicate_control = BRW_PREDICATE_NONE; @@ -538,6 +540,8 @@ struct brw_instruction *brw_ELSE(struct brw_compile *p, insn->header.compression_control = BRW_COMPRESSION_NONE; insn->header.execution_size = if_insn->header.execution_size; insn->header.mask_control = BRW_MASK_ENABLE; + if (!p->single_program_flow) + insn->header.thread_control = BRW_THREAD_SWITCH; /* Patch the if instruction to point at this instruction. */ @@ -579,6 +583,7 @@ void brw_ENDIF(struct brw_compile *p, insn->header.compression_control = BRW_COMPRESSION_NONE; insn->header.execution_size = patch_insn->header.execution_size; insn->header.mask_control = BRW_MASK_ENABLE; + insn->header.thread_control = BRW_THREAD_SWITCH; assert(patch_insn->bits3.if_else.jump_count == 0); @@ -617,7 +622,7 @@ struct brw_instruction *brw_BREAK(struct brw_compile *p) brw_set_src1(insn, brw_imm_d(0x0)); insn->header.compression_control = BRW_COMPRESSION_NONE; insn->header.execution_size = BRW_EXECUTE_8; - insn->header.mask_control = BRW_MASK_DISABLE; + /* insn->header.mask_control = BRW_MASK_DISABLE; */ insn->bits3.if_else.pad0 = 0; return insn; } @@ -631,7 +636,7 @@ struct brw_instruction *brw_CONT(struct brw_compile *p) brw_set_src1(insn, brw_imm_d(0x0)); insn->header.compression_control = BRW_COMPRESSION_NONE; insn->header.execution_size = BRW_EXECUTE_8; - insn->header.mask_control = BRW_MASK_DISABLE; + /* insn->header.mask_control = BRW_MASK_DISABLE; */ insn->bits3.if_else.pad0 = 0; return insn; } @@ -655,7 +660,7 @@ struct brw_instruction *brw_DO(struct brw_compile *p, GLuint execute_size) insn->header.execution_size = execute_size; insn->header.predicate_control = BRW_PREDICATE_NONE; /* insn->header.mask_control = BRW_MASK_ENABLE; */ - insn->header.mask_control = BRW_MASK_DISABLE; + /* insn->header.mask_control = BRW_MASK_DISABLE; */ return insn; } @@ -694,7 +699,7 @@ struct brw_instruction *brw_WHILE(struct brw_compile *p, /* insn->header.mask_control = BRW_MASK_ENABLE; */ - insn->header.mask_control = BRW_MASK_DISABLE; + /* insn->header.mask_control = BRW_MASK_DISABLE; */ p->current->header.predicate_control = BRW_PREDICATE_NONE; return insn; } diff --git a/src/mesa/drivers/dri/i965/brw_fallback.c b/src/mesa/drivers/dri/i965/brw_fallback.c index 8a8fb50cb9..2f6b7febbd 100644 --- a/src/mesa/drivers/dri/i965/brw_fallback.c +++ b/src/mesa/drivers/dri/i965/brw_fallback.c @@ -25,19 +25,20 @@ * **************************************************************************/ +#include "main/glheader.h" +#include "main/context.h" +#include "main/enums.h" +#include "main/imports.h" +#include "main/macros.h" +#include "main/mtypes.h" + #include "swrast_setup/swrast_setup.h" #include "swrast/swrast.h" #include "tnl/tnl.h" -#include "context.h" #include "brw_context.h" #include "brw_fallback.h" -#include "glheader.h" -#include "enums.h" -#include "glapi.h" -#include "imports.h" -#include "macros.h" -#include "mtypes.h" +#include "glapi/glapi.h" #define FILE_DEBUG_FLAG DEBUG_FALLBACKS @@ -95,10 +96,9 @@ static GLboolean do_check_fallback(struct brw_context *brw) return GL_FALSE; } -static int check_fallback(struct brw_context *brw) +static void check_fallback(struct brw_context *brw) { brw->intel.Fallback = do_check_fallback(brw); - return 0; } const struct brw_tracked_state brw_check_fallback = { diff --git a/src/mesa/drivers/dri/i965/brw_fallback.h b/src/mesa/drivers/dri/i965/brw_fallback.h index 684a46cd17..50dcdacd17 100644 --- a/src/mesa/drivers/dri/i965/brw_fallback.h +++ b/src/mesa/drivers/dri/i965/brw_fallback.h @@ -28,7 +28,7 @@ #ifndef BRW_FALLBACK_H #define BRW_FALLBACK_H -#include "mtypes.h" /* for GLcontext... */ +#include "main/mtypes.h" /* for GLcontext... */ struct brw_context; struct vbo_prim; diff --git a/src/mesa/drivers/dri/i965/brw_gs.c b/src/mesa/drivers/dri/i965/brw_gs.c index 9419315c7a..a8b74a0afe 100644 --- a/src/mesa/drivers/dri/i965/brw_gs.c +++ b/src/mesa/drivers/dri/i965/brw_gs.c @@ -29,9 +29,9 @@ * Keith Whitwell <keith@tungstengraphics.com> */ -#include "glheader.h" -#include "macros.h" -#include "enums.h" +#include "main/glheader.h" +#include "main/macros.h" +#include "main/enums.h" #include "intel_batchbuffer.h" @@ -162,10 +162,9 @@ static void populate_key( struct brw_context *brw, /* Calculate interpolants for triangle and line rasterization. */ -static int prepare_gs_prog( struct brw_context *brw ) +static void prepare_gs_prog(struct brw_context *brw) { struct brw_gs_prog_key key; - int ret = 0; /* Populate the key: */ populate_key(brw, &key); @@ -183,11 +182,7 @@ static int prepare_gs_prog( struct brw_context *brw ) &brw->gs.prog_data); if (brw->gs.prog_bo == NULL) compile_gs_prog( brw, &key ); - - ret |= dri_bufmgr_check_aperture_space(brw->gs.prog_bo); } - - return ret; } diff --git a/src/mesa/drivers/dri/i965/brw_gs_emit.c b/src/mesa/drivers/dri/i965/brw_gs_emit.c index 9abb94d82e..22e0d25c2e 100644 --- a/src/mesa/drivers/dri/i965/brw_gs_emit.c +++ b/src/mesa/drivers/dri/i965/brw_gs_emit.c @@ -30,9 +30,9 @@ */ -#include "glheader.h" -#include "macros.h" -#include "enums.h" +#include "main/glheader.h" +#include "main/macros.h" +#include "main/enums.h" #include "shader/program.h" #include "intel_batchbuffer.h" diff --git a/src/mesa/drivers/dri/i965/brw_gs_state.c b/src/mesa/drivers/dri/i965/brw_gs_state.c index f1f9e018f1..27023cf034 100644 --- a/src/mesa/drivers/dri/i965/brw_gs_state.c +++ b/src/mesa/drivers/dri/i965/brw_gs_state.c @@ -34,7 +34,7 @@ #include "brw_context.h" #include "brw_state.h" #include "brw_defines.h" -#include "macros.h" +#include "main/macros.h" struct brw_gs_unit_key { unsigned int total_grf; @@ -106,17 +106,17 @@ gs_unit_create_from_key(struct brw_context *brw, struct brw_gs_unit_key *key) if (key->prog_active) { /* Emit GS program relocation */ - dri_emit_reloc(bo, - DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_READ, - gs.thread0.grf_reg_count << 1, - offsetof(struct brw_gs_unit_state, thread0), - brw->gs.prog_bo); + dri_bo_emit_reloc(bo, + I915_GEM_DOMAIN_INSTRUCTION, 0, + gs.thread0.grf_reg_count << 1, + offsetof(struct brw_gs_unit_state, thread0), + brw->gs.prog_bo); } return bo; } -static int prepare_gs_unit( struct brw_context *brw ) +static void prepare_gs_unit(struct brw_context *brw) { struct brw_gs_unit_key key; @@ -130,7 +130,6 @@ static int prepare_gs_unit( struct brw_context *brw ) if (brw->gs.state_bo == NULL) { brw->gs.state_bo = gs_unit_create_from_key(brw, &key); } - return dri_bufmgr_check_aperture_space(brw->gs.state_bo); } const struct brw_tracked_state brw_gs_unit = { diff --git a/src/mesa/drivers/dri/i965/brw_metaops.c b/src/mesa/drivers/dri/i965/brw_metaops.c index 252a8996e2..41bfa2e256 100644 --- a/src/mesa/drivers/dri/i965/brw_metaops.c +++ b/src/mesa/drivers/dri/i965/brw_metaops.c @@ -32,9 +32,9 @@ -#include "glheader.h" -#include "context.h" -#include "macros.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/macros.h" #include "shader/arbprogparse.h" diff --git a/src/mesa/drivers/dri/i965/brw_misc_state.c b/src/mesa/drivers/dri/i965/brw_misc_state.c index 62df2590f3..487c638ce2 100644 --- a/src/mesa/drivers/dri/i965/brw_misc_state.c +++ b/src/mesa/drivers/dri/i965/brw_misc_state.c @@ -81,6 +81,13 @@ const struct brw_tracked_state brw_blend_constant_color = { static void upload_binding_table_pointers(struct brw_context *brw) { struct intel_context *intel = &brw->intel; + dri_bo *aper_array[] = { + intel->batch->buf, + brw->wm.bind_bo, + }; + + if (dri_bufmgr_check_aperture_space(aper_array, ARRAY_SIZE(aper_array))) + intel_batchbuffer_flush(intel->batch); BEGIN_BATCH(6, IGNORE_CLIPRECTS); OUT_BATCH(CMD_BINDING_TABLE_PTRS << 16 | (6 - 2)); @@ -88,7 +95,9 @@ static void upload_binding_table_pointers(struct brw_context *brw) OUT_BATCH(0); /* gs */ OUT_BATCH(0); /* clip */ OUT_BATCH(0); /* sf */ - OUT_RELOC(brw->wm.bind_bo, DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_READ, 0); + OUT_RELOC(brw->wm.bind_bo, + I915_GEM_DOMAIN_SAMPLER, 0, + 0); ADVANCE_BATCH(); } @@ -114,49 +123,43 @@ static void upload_pipelined_state_pointers(struct brw_context *brw ) BEGIN_BATCH(7, IGNORE_CLIPRECTS); OUT_BATCH(CMD_PIPELINED_STATE_POINTERS << 16 | (7 - 2)); - OUT_RELOC(brw->vs.state_bo, DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_READ, 0); + OUT_RELOC(brw->vs.state_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 0); if (brw->gs.prog_active) - OUT_RELOC(brw->gs.state_bo, DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_READ, 1); + OUT_RELOC(brw->gs.state_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 1); else OUT_BATCH(0); if (!brw->metaops.active) - OUT_RELOC(brw->clip.state_bo, DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_READ, 1); + OUT_RELOC(brw->clip.state_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 1); else OUT_BATCH(0); - OUT_RELOC(brw->sf.state_bo, DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_READ, 0); - OUT_RELOC(brw->wm.state_bo, DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_READ, 0); - OUT_RELOC(brw->cc.state_bo, DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_READ, 0); + OUT_RELOC(brw->sf.state_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 0); + OUT_RELOC(brw->wm.state_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 0); + OUT_RELOC(brw->cc.state_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 0); ADVANCE_BATCH(); brw->state.dirty.brw |= BRW_NEW_PSP; } -#if 0 -/* Combined into brw_psp_urb_cbs */ -const struct brw_tracked_state brw_pipelined_state_pointers = { - .dirty = { - .mesa = 0, - .brw = BRW_NEW_METAOPS | BRW_NEW_BATCH, - .cache = (CACHE_NEW_VS_UNIT | - CACHE_NEW_GS_UNIT | - CACHE_NEW_GS_PROG | - CACHE_NEW_CLIP_UNIT | - CACHE_NEW_SF_UNIT | - CACHE_NEW_WM_UNIT | - CACHE_NEW_CC_UNIT) - }, - .emit = upload_pipelined_state_pointers -}; -#endif - static void upload_psp_urb_cbs(struct brw_context *brw ) { + struct intel_context *intel = &brw->intel; + dri_bo *aper_array[] = { + intel->batch->buf, + brw->vs.state_bo, + brw->gs.state_bo, + brw->clip.state_bo, + brw->wm.state_bo, + brw->cc.state_bo, + }; + + if (dri_bufmgr_check_aperture_space(aper_array, ARRAY_SIZE(aper_array))) + intel_batchbuffer_flush(intel->batch); + upload_pipelined_state_pointers(brw); brw_upload_urb_fence(brw); brw_upload_constant_buffer_state(brw); } - const struct brw_tracked_state brw_psp_urb_cbs = { .dirty = { .mesa = 0, @@ -172,22 +175,6 @@ const struct brw_tracked_state brw_psp_urb_cbs = { .emit = upload_psp_urb_cbs, }; -/** - * Upload the depthbuffer offset and format. - * - * We have to do this per state validation as we need to emit the relocation - * in the batch buffer. - */ - -static int prepare_depthbuffer(struct brw_context *brw) -{ - struct intel_region *region = brw->state.depth_region; - - if (!region || !region->buffer) - return 0; - return dri_bufmgr_check_aperture_space(region->buffer); -} - static void emit_depthbuffer(struct brw_context *brw) { struct intel_context *intel = &brw->intel; @@ -209,6 +196,10 @@ static void emit_depthbuffer(struct brw_context *brw) ADVANCE_BATCH(); } else { unsigned int format; + dri_bo *aper_array[] = { + intel->batch->buf, + region->buffer + }; switch (region->cpp) { case 2: @@ -225,15 +216,19 @@ static void emit_depthbuffer(struct brw_context *brw) return; } + if (dri_bufmgr_check_aperture_space(aper_array, ARRAY_SIZE(aper_array))) + intel_batchbuffer_flush(intel->batch); + BEGIN_BATCH(len, IGNORE_CLIPRECTS); OUT_BATCH(CMD_DEPTH_BUFFER << 16 | (len - 2)); OUT_BATCH(((region->pitch * region->cpp) - 1) | (format << 18) | (BRW_TILEWALK_YMAJOR << 26) | - (region->tiled << 27) | + ((region->tiling != I915_TILING_NONE) << 27) | (BRW_SURFACE_2D << 29)); OUT_RELOC(region->buffer, - DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_READ | DRM_BO_FLAG_WRITE, 0); + I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, + 0); OUT_BATCH((BRW_SURFACE_MIPMAPLAYOUT_BELOW << 1) | ((region->pitch - 1) << 6) | ((region->height - 1) << 19)); @@ -252,7 +247,6 @@ const struct brw_tracked_state brw_depthbuffer = { .brw = BRW_NEW_DEPTH_BUFFER | BRW_NEW_BATCH, .cache = 0, }, - .prepare = prepare_depthbuffer, .emit = emit_depthbuffer, }; @@ -380,40 +374,6 @@ const struct brw_tracked_state brw_line_stipple = { }; - -/*********************************************************************** - * Misc constant state packets - */ - -static void upload_pipe_control(struct brw_context *brw) -{ - struct brw_pipe_control pc; - - return; - - memset(&pc, 0, sizeof(pc)); - - pc.header.opcode = CMD_PIPE_CONTROL; - pc.header.length = sizeof(pc)/4 - 2; - pc.header.post_sync_operation = PIPE_CONTROL_NOWRITE; - - pc.header.instruction_state_cache_flush_enable = 1; - - pc.bits1.dest_addr_type = PIPE_CONTROL_GTTWRITE_GLOBAL; - - BRW_BATCH_STRUCT(brw, &pc); -} - -const struct brw_tracked_state brw_pipe_control = { - .dirty = { - .mesa = 0, - .brw = BRW_NEW_BATCH, - .cache = 0 - }, - .emit = upload_pipe_control -}; - - /*********************************************************************** * Misc invarient state packets */ diff --git a/src/mesa/drivers/dri/i965/brw_sf.c b/src/mesa/drivers/dri/i965/brw_sf.c index 0b61748321..9dce6cd8e6 100644 --- a/src/mesa/drivers/dri/i965/brw_sf.c +++ b/src/mesa/drivers/dri/i965/brw_sf.c @@ -30,9 +30,9 @@ */ -#include "glheader.h" -#include "macros.h" -#include "enums.h" +#include "main/glheader.h" +#include "main/macros.h" +#include "main/enums.h" #include "intel_batchbuffer.h" @@ -125,7 +125,7 @@ static void compile_sf_prog( struct brw_context *brw, /* Calculate interpolants for triangle and line rasterization. */ -static int upload_sf_prog( struct brw_context *brw ) +static void upload_sf_prog(struct brw_context *brw) { struct brw_sf_prog_key key; @@ -174,7 +174,6 @@ static int upload_sf_prog( struct brw_context *brw ) &brw->sf.prog_data); if (brw->sf.prog_bo == NULL) compile_sf_prog( brw, &key ); - return dri_bufmgr_check_aperture_space(brw->sf.prog_bo); } diff --git a/src/mesa/drivers/dri/i965/brw_sf_emit.c b/src/mesa/drivers/dri/i965/brw_sf_emit.c index 6fba8c8908..ffdb0ae6df 100644 --- a/src/mesa/drivers/dri/i965/brw_sf_emit.c +++ b/src/mesa/drivers/dri/i965/brw_sf_emit.c @@ -30,9 +30,9 @@ */ -#include "glheader.h" -#include "macros.h" -#include "enums.h" +#include "main/glheader.h" +#include "main/macros.h" +#include "main/enums.h" #include "intel_batchbuffer.h" diff --git a/src/mesa/drivers/dri/i965/brw_sf_state.c b/src/mesa/drivers/dri/i965/brw_sf_state.c index 24388b79a5..4f925d1810 100644 --- a/src/mesa/drivers/dri/i965/brw_sf_state.c +++ b/src/mesa/drivers/dri/i965/brw_sf_state.c @@ -34,10 +34,10 @@ #include "brw_context.h" #include "brw_state.h" #include "brw_defines.h" -#include "macros.h" +#include "main/macros.h" #include "intel_fbo.h" -static int upload_sf_vp(struct brw_context *brw) +static void upload_sf_vp(struct brw_context *brw) { GLcontext *ctx = &brw->intel.ctx; const GLfloat depth_scale = 1.0F / ctx->DrawBuffer->_DepthMaxF; @@ -98,8 +98,6 @@ static int upload_sf_vp(struct brw_context *brw) dri_bo_unreference(brw->sf.vp_bo); brw->sf.vp_bo = brw_cache_data( &brw->cache, BRW_SF_VP, &sfv, NULL, 0 ); - - return dri_bufmgr_check_aperture_space(brw->sf.vp_bo); } const struct brw_tracked_state brw_sf_vp = { @@ -253,27 +251,26 @@ sf_unit_create_from_key(struct brw_context *brw, struct brw_sf_unit_key *key, NULL, NULL); /* Emit SF program relocation */ - dri_emit_reloc(bo, - DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_READ, - sf.thread0.grf_reg_count << 1, - offsetof(struct brw_sf_unit_state, thread0), - brw->sf.prog_bo); + dri_bo_emit_reloc(bo, + I915_GEM_DOMAIN_INSTRUCTION, 0, + sf.thread0.grf_reg_count << 1, + offsetof(struct brw_sf_unit_state, thread0), + brw->sf.prog_bo); /* Emit SF viewport relocation */ - dri_emit_reloc(bo, - DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_READ, - sf.sf5.front_winding | (sf.sf5.viewport_transform << 1), - offsetof(struct brw_sf_unit_state, sf5), - brw->sf.vp_bo); + dri_bo_emit_reloc(bo, + I915_GEM_DOMAIN_INSTRUCTION, 0, + sf.sf5.front_winding | (sf.sf5.viewport_transform << 1), + offsetof(struct brw_sf_unit_state, sf5), + brw->sf.vp_bo); return bo; } -static int upload_sf_unit( struct brw_context *brw ) +static void upload_sf_unit( struct brw_context *brw ) { struct brw_sf_unit_key key; dri_bo *reloc_bufs[2]; - int ret = 0; sf_unit_populate_key(brw, &key); @@ -288,15 +285,6 @@ static int upload_sf_unit( struct brw_context *brw ) if (brw->sf.state_bo == NULL) { brw->sf.state_bo = sf_unit_create_from_key(brw, &key, reloc_bufs); } - - if (reloc_bufs[0]) - ret |= dri_bufmgr_check_aperture_space(reloc_bufs[0]); - - if (reloc_bufs[1]) - ret |= dri_bufmgr_check_aperture_space(reloc_bufs[1]); - - ret |= dri_bufmgr_check_aperture_space(brw->sf.state_bo); - return ret; } const struct brw_tracked_state brw_sf_unit = { diff --git a/src/mesa/drivers/dri/i965/brw_state.h b/src/mesa/drivers/dri/i965/brw_state.h index d1fca051ec..3ea6151ae9 100644 --- a/src/mesa/drivers/dri/i965/brw_state.h +++ b/src/mesa/drivers/dri/i965/brw_state.h @@ -80,6 +80,9 @@ const struct brw_tracked_state brw_pipe_control; const struct brw_tracked_state brw_clear_surface_cache; const struct brw_tracked_state brw_clear_batch_cache; +const struct brw_tracked_state brw_indices; +const struct brw_tracked_state brw_vertices; + /*********************************************************************** * brw_state_cache.c */ diff --git a/src/mesa/drivers/dri/i965/brw_state_batch.c b/src/mesa/drivers/dri/i965/brw_state_batch.c index 77e2736d11..94ef924868 100644 --- a/src/mesa/drivers/dri/i965/brw_state_batch.c +++ b/src/mesa/drivers/dri/i965/brw_state_batch.c @@ -33,7 +33,7 @@ #include "brw_state.h" #include "intel_batchbuffer.h" -#include "imports.h" +#include "main/imports.h" diff --git a/src/mesa/drivers/dri/i965/brw_state_cache.c b/src/mesa/drivers/dri/i965/brw_state_cache.c index d617650fad..d5b5166406 100644 --- a/src/mesa/drivers/dri/i965/brw_state_cache.c +++ b/src/mesa/drivers/dri/i965/brw_state_cache.c @@ -58,7 +58,7 @@ #include "brw_state.h" #include "intel_batchbuffer.h" -#include "imports.h" +#include "main/imports.h" /* XXX: Fixme - have to include these to get the sizes of the prog_key * structs: @@ -214,10 +214,7 @@ brw_upload_cache( struct brw_cache *cache, /* Create the buffer object to contain the data */ bo = dri_bo_alloc(cache->brw->intel.bufmgr, - cache->name[cache_id], data_size, 1 << 6, - DRM_BO_FLAG_MEM_LOCAL | - DRM_BO_FLAG_CACHED | - DRM_BO_FLAG_CACHED_MAPPED); + cache->name[cache_id], data_size, 1 << 6); /* Set up the memory containing the key, aux_data, and reloc_bufs */ @@ -500,9 +497,10 @@ void brw_destroy_cache( struct brw_context *brw ) GLuint i; brw_clear_cache(brw); - for (i = 0; i < BRW_MAX_CACHE; i++) + for (i = 0; i < BRW_MAX_CACHE; i++) { + dri_bo_unreference(brw->cache.last_bo[i]); free(brw->cache.name[i]); - + } free(brw->cache.items); brw->cache.items = NULL; brw->cache.size = 0; diff --git a/src/mesa/drivers/dri/i965/brw_state_dump.c b/src/mesa/drivers/dri/i965/brw_state_dump.c index 3a93f9f732..b28c57c2bc 100644 --- a/src/mesa/drivers/dri/i965/brw_state_dump.c +++ b/src/mesa/drivers/dri/i965/brw_state_dump.c @@ -25,7 +25,7 @@ * */ -#include "mtypes.h" +#include "main/mtypes.h" #include "brw_context.h" #include "brw_state.h" diff --git a/src/mesa/drivers/dri/i965/brw_state_upload.c b/src/mesa/drivers/dri/i965/brw_state_upload.c index 3b2ccd48c3..7d4fd467b1 100644 --- a/src/mesa/drivers/dri/i965/brw_state_upload.c +++ b/src/mesa/drivers/dri/i965/brw_state_upload.c @@ -33,7 +33,6 @@ #include "brw_context.h" #include "brw_state.h" -#include "dri_bufmgr.h" #include "intel_batchbuffer.h" /* This is used to initialize brw->state.atoms[]. We could use this @@ -80,7 +79,6 @@ const struct brw_tracked_state *atoms[] = */ &brw_invarient_state, &brw_state_base_address, - &brw_pipe_control, &brw_binding_table_pointers, &brw_blend_constant_color, @@ -102,6 +100,8 @@ const struct brw_tracked_state *atoms[] = &brw_psp_urb_cbs, #endif + &brw_indices, + &brw_vertices, NULL, /* brw_constant_buffer */ }; @@ -173,10 +173,12 @@ static void xor_states( struct brw_state_flags *result, /*********************************************************************** * Emit all state: */ -int brw_validate_state( struct brw_context *brw ) +void brw_validate_state( struct brw_context *brw ) { + struct intel_context *intel = &brw->intel; struct brw_state_flags *state = &brw->state.dirty; - GLuint i, ret, count; + GLuint i, count, pass = 0; + dri_bo *last_batch_bo = NULL; state->mesa |= brw->intel.NewGLState; brw->intel.NewGLState = 0; @@ -202,7 +204,7 @@ int brw_validate_state( struct brw_context *brw ) if (state->mesa == 0 && state->cache == 0 && state->brw == 0) - return 0; + return; if (brw->state.dirty.brw & BRW_NEW_CONTEXT) brw_clear_batch_cache_flush(brw); @@ -220,15 +222,23 @@ int brw_validate_state( struct brw_context *brw ) if (check_state(state, &atom->dirty)) { if (atom->prepare) { - ret = atom->prepare(brw); - if (ret) - return ret; + atom->prepare(brw); } } } if (brw->intel.Fallback) - return 0; + return; + + /* We're about to try to set up a coherent state in the batchbuffer for + * the emission of primitives. If we exceed the aperture size in any of the + * emit() calls, we need to go back to square 1 and try setting up again. + */ +got_flushed: + dri_bo_unreference(last_batch_bo); + last_batch_bo = intel->batch->buf; + dri_bo_reference(last_batch_bo); + assert(pass++ <= 2); if (INTEL_DEBUG) { /* Debug version which enforces various sanity checks on the @@ -251,8 +261,11 @@ int brw_validate_state( struct brw_context *brw ) break; if (check_state(state, &atom->dirty)) { - if (atom->emit) + if (atom->emit) { atom->emit( brw ); + if (intel->batch->buf != last_batch_bo) + goto got_flushed; + } } accumulate_state(&examined, &atom->dirty); @@ -274,13 +287,17 @@ int brw_validate_state( struct brw_context *brw ) break; if (check_state(state, &atom->dirty)) { - if (atom->emit) + if (atom->emit) { atom->emit( brw ); + if (intel->batch->buf != last_batch_bo) + goto got_flushed; + } } } } + dri_bo_unreference(last_batch_bo); + if (!brw->intel.Fallback) memset(state, 0, sizeof(*state)); - return 0; } diff --git a/src/mesa/drivers/dri/i965/brw_tex.c b/src/mesa/drivers/dri/i965/brw_tex.c index 258c6260fb..0bb6f176a0 100644 --- a/src/mesa/drivers/dri/i965/brw_tex.c +++ b/src/mesa/drivers/dri/i965/brw_tex.c @@ -30,19 +30,19 @@ */ -#include "glheader.h" -#include "mtypes.h" -#include "imports.h" -#include "simple_list.h" -#include "enums.h" -#include "image.h" -#include "teximage.h" -#include "texstore.h" -#include "texformat.h" +#include "main/glheader.h" +#include "main/mtypes.h" +#include "main/imports.h" +#include "main/simple_list.h" +#include "main/enums.h" +#include "main/image.h" +#include "main/teximage.h" +#include "main/texstore.h" +#include "main/texformat.h" + #include "texmem.h" #include "intel_context.h" -#include "intel_ioctl.h" #include "intel_regions.h" #include "intel_tex.h" #include "brw_context.h" diff --git a/src/mesa/drivers/dri/i965/brw_tex_layout.c b/src/mesa/drivers/dri/i965/brw_tex_layout.c index e437c411dd..51a617fcb4 100644 --- a/src/mesa/drivers/dri/i965/brw_tex_layout.c +++ b/src/mesa/drivers/dri/i965/brw_tex_layout.c @@ -36,7 +36,7 @@ #include "intel_mipmap_tree.h" #include "intel_tex_layout.h" #include "intel_context.h" -#include "macros.h" +#include "main/macros.h" #define FILE_DEBUG_FLAG DEBUG_MIPTREE diff --git a/src/mesa/drivers/dri/i965/brw_urb.c b/src/mesa/drivers/dri/i965/brw_urb.c index c423dbe7d7..1116ade0a4 100644 --- a/src/mesa/drivers/dri/i965/brw_urb.c +++ b/src/mesa/drivers/dri/i965/brw_urb.c @@ -74,7 +74,7 @@ static GLboolean check_urb_layout( struct brw_context *brw ) /* Most minimal update, forces re-emit of URB fence packet after GS * unit turned on/off. */ -static int recalculate_urb_fence( struct brw_context *brw ) +static void recalculate_urb_fence( struct brw_context *brw ) { GLuint csize = brw->curbe.total_size; GLuint vsize = brw->vs.prog_data->urb_entry_size; @@ -142,7 +142,6 @@ static int recalculate_urb_fence( struct brw_context *brw ) brw->state.dirty.brw |= BRW_NEW_URB_FENCE; } - return 0; } @@ -187,15 +186,3 @@ void brw_upload_urb_fence(struct brw_context *brw) BRW_BATCH_STRUCT(brw, &uf); } - - -#if 0 -const struct brw_tracked_state brw_urb_fence = { - .dirty = { - .mesa = 0, - .brw = BRW_NEW_URB_FENCE | BRW_NEW_PSP, - .cache = 0 - }, - .update = brw_upload_urb_fence -}; -#endif diff --git a/src/mesa/drivers/dri/i965/brw_util.c b/src/mesa/drivers/dri/i965/brw_util.c index d8d35c574e..ce21aa4869 100644 --- a/src/mesa/drivers/dri/i965/brw_util.c +++ b/src/mesa/drivers/dri/i965/brw_util.c @@ -30,7 +30,7 @@ */ -#include "mtypes.h" +#include "main/mtypes.h" #include "shader/prog_parameter.h" #include "brw_util.h" #include "brw_defines.h" diff --git a/src/mesa/drivers/dri/i965/brw_util.h b/src/mesa/drivers/dri/i965/brw_util.h index bd6cc0a268..33e7cd87e4 100644 --- a/src/mesa/drivers/dri/i965/brw_util.h +++ b/src/mesa/drivers/dri/i965/brw_util.h @@ -33,7 +33,7 @@ #ifndef BRW_UTIL_H #define BRW_UTIL_H -#include "mtypes.h" +#include "main/mtypes.h" extern GLuint brw_count_bits( GLuint val ); extern GLuint brw_parameter_list_state_flags(struct gl_program_parameter_list *paramList); diff --git a/src/mesa/drivers/dri/i965/brw_vs.c b/src/mesa/drivers/dri/i965/brw_vs.c index f89b0e14a1..1db7ceebcf 100644 --- a/src/mesa/drivers/dri/i965/brw_vs.c +++ b/src/mesa/drivers/dri/i965/brw_vs.c @@ -83,7 +83,7 @@ static void do_vs_prog( struct brw_context *brw, } -static int brw_upload_vs_prog( struct brw_context *brw ) +static void brw_upload_vs_prog(struct brw_context *brw) { struct brw_vs_prog_key key; struct brw_vertex_program *vp = @@ -115,7 +115,6 @@ static int brw_upload_vs_prog( struct brw_context *brw ) &brw->vs.prog_data); if (brw->vs.prog_bo == NULL) do_vs_prog(brw, vp, &key); - return dri_bufmgr_check_aperture_space(brw->vs.prog_bo); } diff --git a/src/mesa/drivers/dri/i965/brw_vs_constval.c b/src/mesa/drivers/dri/i965/brw_vs_constval.c index a0106b8975..6fbac02de6 100644 --- a/src/mesa/drivers/dri/i965/brw_vs_constval.c +++ b/src/mesa/drivers/dri/i965/brw_vs_constval.c @@ -30,7 +30,7 @@ */ -#include "macros.h" +#include "main/macros.h" #include "brw_context.h" #include "brw_vs.h" @@ -166,7 +166,7 @@ static GLuint get_input_size(struct brw_context *brw, /* Calculate sizes of vertex program outputs. Size is the largest * component index which might vary from [0,0,0,1] */ -static int calc_wm_input_sizes( struct brw_context *brw ) +static void calc_wm_input_sizes( struct brw_context *brw ) { /* BRW_NEW_VERTEX_PROGRAM */ struct brw_vertex_program *vp = @@ -210,7 +210,6 @@ static int calc_wm_input_sizes( struct brw_context *brw ) memcpy(brw->wm.input_size_masks, t.size_masks, sizeof(t.size_masks)); brw->state.dirty.brw |= BRW_NEW_WM_INPUT_DIMENSIONS; } - return 0; } const struct brw_tracked_state brw_wm_input_sizes = { diff --git a/src/mesa/drivers/dri/i965/brw_vs_emit.c b/src/mesa/drivers/dri/i965/brw_vs_emit.c index 7767d1369c..9de05408ba 100644 --- a/src/mesa/drivers/dri/i965/brw_vs_emit.c +++ b/src/mesa/drivers/dri/i965/brw_vs_emit.c @@ -1024,6 +1024,9 @@ void brw_vs_emit(struct brw_vs_compile *c ) case OPCODE_ADD: brw_ADD(p, dst, args[0], args[1]); break; + case OPCODE_COS: + emit_math1(c, BRW_MATH_FUNCTION_COS, dst, args[0], BRW_MATH_PRECISION_FULL); + break; case OPCODE_DP3: brw_DP3(p, dst, args[0], args[1]); break; @@ -1089,6 +1092,9 @@ void brw_vs_emit(struct brw_vs_compile *c ) case OPCODE_SEQ: emit_seq(p, dst, args[0], args[1]); break; + case OPCODE_SIN: + emit_math1(c, BRW_MATH_FUNCTION_SIN, dst, args[0], BRW_MATH_PRECISION_FULL); + break; case OPCODE_SNE: emit_sne(p, dst, args[0], args[1]); break; @@ -1155,14 +1161,39 @@ void brw_vs_emit(struct brw_vs_compile *c ) case OPCODE_ENDSUB: break; default: - _mesa_printf("Unsupport opcode %d in vertex shader\n", inst->Opcode); + _mesa_printf("Unsupported opcode %i (%s) in vertex shader\n", + inst->Opcode, inst->Opcode < MAX_OPCODE ? + _mesa_opcode_string(inst->Opcode) : + "unknown"); break; } - if (inst->DstReg.File == PROGRAM_OUTPUT - &&inst->DstReg.Index != VERT_RESULT_HPOS - &&c->output_regs[inst->DstReg.Index].used_in_src) - brw_MOV(p, get_dst(c, inst->DstReg), dst); + if ((inst->DstReg.File == PROGRAM_OUTPUT) + && (inst->DstReg.Index != VERT_RESULT_HPOS) + && c->output_regs[inst->DstReg.Index].used_in_src) { + brw_MOV(p, get_dst(c, inst->DstReg), dst); + } + + /* Result color clamping. + * + * When destination register is an output register and + * it's primary/secondary front/back color, we have to clamp + * the result to [0,1]. This is done by enabling the + * saturation bit for the last instruction. + * + * We don't use brw_set_saturate() as it modifies + * p->current->header.saturate, which affects all the subsequent + * instructions. Instead, we directly modify the header + * of the last (already stored) instruction. + */ + if (inst->DstReg.File == PROGRAM_OUTPUT) { + if ((inst->DstReg.Index == VERT_RESULT_COL0) + || (inst->DstReg.Index == VERT_RESULT_COL1) + || (inst->DstReg.Index == VERT_RESULT_BFC0) + || (inst->DstReg.Index == VERT_RESULT_BFC1)) { + p->store[p->nr_insn-1].header.saturate = 1; + } + } release_tmps(c); } diff --git a/src/mesa/drivers/dri/i965/brw_vs_state.c b/src/mesa/drivers/dri/i965/brw_vs_state.c index 2a64f3df33..6e66f54524 100644 --- a/src/mesa/drivers/dri/i965/brw_vs_state.c +++ b/src/mesa/drivers/dri/i965/brw_vs_state.c @@ -34,7 +34,7 @@ #include "brw_context.h" #include "brw_state.h" #include "brw_defines.h" -#include "macros.h" +#include "main/macros.h" struct brw_vs_unit_key { unsigned int total_grf; @@ -115,16 +115,16 @@ vs_unit_create_from_key(struct brw_context *brw, struct brw_vs_unit_key *key) NULL, NULL); /* Emit VS program relocation */ - dri_emit_reloc(bo, - DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_READ, - vs.thread0.grf_reg_count << 1, - offsetof(struct brw_vs_unit_state, thread0), - brw->vs.prog_bo); + dri_bo_emit_reloc(bo, + I915_GEM_DOMAIN_INSTRUCTION, 0, + vs.thread0.grf_reg_count << 1, + offsetof(struct brw_vs_unit_state, thread0), + brw->vs.prog_bo); return bo; } -static int prepare_vs_unit( struct brw_context *brw ) +static void prepare_vs_unit(struct brw_context *brw) { struct brw_vs_unit_key key; @@ -138,7 +138,6 @@ static int prepare_vs_unit( struct brw_context *brw ) if (brw->vs.state_bo == NULL) { brw->vs.state_bo = vs_unit_create_from_key(brw, &key); } - return dri_bufmgr_check_aperture_space(brw->vs.state_bo); } const struct brw_tracked_state brw_vs_unit = { diff --git a/src/mesa/drivers/dri/i965/brw_vs_tnl.c b/src/mesa/drivers/dri/i965/brw_vs_tnl.c index e409620bbf..9b04f19112 100644 --- a/src/mesa/drivers/dri/i965/brw_vs_tnl.c +++ b/src/mesa/drivers/dri/i965/brw_vs_tnl.c @@ -30,11 +30,12 @@ */ -#include "glheader.h" -#include "macros.h" -#include "enums.h" +#include "main/glheader.h" +#include "main/macros.h" +#include "main/enums.h" #include "shader/prog_parameter.h" #include "shader/prog_print.h" +#include "shader/prog_statevars.h" #include "brw_vs.h" #include "brw_state.h" @@ -853,7 +854,7 @@ static struct ureg calculate_light_attenuation( struct tnl_program *p, */ if (!p->state->unit[i].light_spotcutoff_is_180) { struct ureg spot_dir_norm = register_param3(p, STATE_INTERNAL, - STATE_SPOT_DIR_NORMALIZED, i); + STATE_LIGHT_SPOT_DIR_NORMALIZED, i); struct ureg spot = get_temp(p); struct ureg slt = get_temp(p); @@ -988,7 +989,7 @@ static void build_lighting( struct tnl_program *p ) * Attenuation never applies to infinite lights. */ VPpli = register_param3(p, STATE_LIGHT, i, - STATE_POSITION_NORMALIZED); + STATE_LIGHT_POSITION_NORMALIZED); if (p->state->light_local_viewer) { struct ureg eye_hat = get_eye_position_normalized(p); half = get_temp(p); @@ -1581,7 +1582,7 @@ static GLuint hash_key( struct state_key *key ) return hash; } -static int prepare_tnl_program( struct brw_context *brw ) +static void prepare_tnl_program( struct brw_context *brw ) { GLcontext *ctx = &brw->intel.ctx; struct state_key key; @@ -1590,7 +1591,7 @@ static int prepare_tnl_program( struct brw_context *brw ) /* _NEW_PROGRAM */ if (brw->attribs.VertexProgram->_Current) - return 0; + return; /* Grab all the relevent state and put it in a single structure: */ @@ -1623,7 +1624,7 @@ static int prepare_tnl_program( struct brw_context *brw ) if (old != brw->tnl_program) brw->state.dirty.brw |= BRW_NEW_TNL_PROGRAM; - return 0; + return; } /* Note: See brw_draw.c - the vertex program must not rely on @@ -1649,7 +1650,7 @@ const struct brw_tracked_state brw_tnl_vertprog = { -static int prepare_active_vertprog( struct brw_context *brw ) +static void prepare_active_vertprog( struct brw_context *brw ) { const struct gl_vertex_program *prev = brw->vertex_program; @@ -1664,8 +1665,6 @@ static int prepare_active_vertprog( struct brw_context *brw ) if (brw->vertex_program != prev) brw->state.dirty.brw |= BRW_NEW_VERTEX_PROGRAM; - - return 0; } diff --git a/src/mesa/drivers/dri/i965/brw_vtbl.c b/src/mesa/drivers/dri/i965/brw_vtbl.c index 31e96a250a..3780d3dad2 100644 --- a/src/mesa/drivers/dri/i965/brw_vtbl.c +++ b/src/mesa/drivers/dri/i965/brw_vtbl.c @@ -32,11 +32,11 @@ -#include "glheader.h" -#include "mtypes.h" -#include "imports.h" -#include "macros.h" -#include "colormac.h" +#include "main/glheader.h" +#include "main/mtypes.h" +#include "main/imports.h" +#include "main/macros.h" +#include "main/colormac.h" #include "intel_batchbuffer.h" #include "intel_regions.h" @@ -51,6 +51,12 @@ #include "brw_vs.h" #include <stdarg.h> +static void +dri_bo_release(dri_bo **bo) +{ + dri_bo_unreference(*bo); + *bo = NULL; +} /* called from intelDestroyContext() */ @@ -58,6 +64,7 @@ static void brw_destroy_context( struct intel_context *intel ) { GLcontext *ctx = &intel->ctx; struct brw_context *brw = brw_context(&intel->ctx); + int i; brw_destroy_metaops(brw); brw_destroy_state(brw); @@ -65,6 +72,33 @@ static void brw_destroy_context( struct intel_context *intel ) brw_ProgramCacheDestroy( ctx ); brw_FrameBufferTexDestroy( brw ); + + for (i = 0; i < brw->state.nr_draw_regions; i++) + intel_region_release(&brw->state.draw_regions[i]); + brw->state.nr_draw_regions = 0; + intel_region_release(&brw->state.depth_region); + + dri_bo_release(&brw->curbe.curbe_bo); + dri_bo_release(&brw->vs.prog_bo); + dri_bo_release(&brw->vs.state_bo); + dri_bo_release(&brw->gs.prog_bo); + dri_bo_release(&brw->gs.state_bo); + dri_bo_release(&brw->clip.prog_bo); + dri_bo_release(&brw->clip.state_bo); + dri_bo_release(&brw->clip.vp_bo); + dri_bo_release(&brw->sf.prog_bo); + dri_bo_release(&brw->sf.state_bo); + dri_bo_release(&brw->sf.vp_bo); + for (i = 0; i < BRW_MAX_TEX_UNIT; i++) + dri_bo_release(&brw->wm.sdc_bo[i]); + dri_bo_release(&brw->wm.bind_bo); + for (i = 0; i < BRW_WM_MAX_SURF; i++) + dri_bo_release(&brw->wm.surf_bo[i]); + dri_bo_release(&brw->wm.prog_bo); + dri_bo_release(&brw->wm.state_bo); + dri_bo_release(&brw->cc.prog_bo); + dri_bo_release(&brw->cc.state_bo); + dri_bo_release(&brw->cc.vp_bo); } /* called from intelDrawBuffer() @@ -97,8 +131,7 @@ static void brw_new_batch( struct intel_context *intel ) /* Check that we didn't just wrap our batchbuffer at a bad time. */ assert(!brw->no_batch_wrap); - dri_bo_unreference(brw->curbe.curbe_bo); - brw->curbe.curbe_bo = NULL; + brw->curbe.need_new_bo = GL_TRUE; /* Mark all context state as needing to be re-emitted. * This is probably not as severe as on 915, since almost all of our state diff --git a/src/mesa/drivers/dri/i965/brw_wm.c b/src/mesa/drivers/dri/i965/brw_wm.c index acbaf178d4..361312c2ca 100644 --- a/src/mesa/drivers/dri/i965/brw_wm.c +++ b/src/mesa/drivers/dri/i965/brw_wm.c @@ -279,12 +279,6 @@ static void brw_wm_populate_key( struct brw_context *brw, const struct gl_texture_object *t = unit->_Current; if (unit->_ReallyEnabled) { - - if (t->CompareMode == GL_COMPARE_R_TO_TEXTURE_ARB && - t->Image[0][t->BaseLevel]->_BaseFormat == GL_DEPTH_COMPONENT) { - key->shadowtex_mask |= 1<<i; - } - if (t->Image[0][t->BaseLevel]->InternalFormat == GL_YCBCR_MESA) { key->yuvtex_mask |= 1<<i; if (t->Image[0][t->BaseLevel]->TexFormat->MesaFormat == @@ -294,6 +288,9 @@ static void brw_wm_populate_key( struct brw_context *brw, } } + /* Shadow */ + key->shadowtex_mask = fp->program.Base.ShadowSamplers; + /* _NEW_BUFFERS */ /* * Include the draw buffer origin and height so that we can calculate @@ -325,7 +322,7 @@ static void brw_wm_populate_key( struct brw_context *brw, } -static int brw_prepare_wm_prog( struct brw_context *brw ) +static void brw_prepare_wm_prog(struct brw_context *brw) { struct brw_wm_prog_key key; struct brw_fragment_program *fp = (struct brw_fragment_program *) @@ -342,8 +339,6 @@ static int brw_prepare_wm_prog( struct brw_context *brw ) &brw->wm.prog_data); if (brw->wm.prog_bo == NULL) do_wm_prog(brw, fp, &key); - - return dri_bufmgr_check_aperture_space(brw->wm.prog_bo); } diff --git a/src/mesa/drivers/dri/i965/brw_wm_emit.c b/src/mesa/drivers/dri/i965/brw_wm_emit.c index 9b919b9cfe..58c78c4b2c 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_emit.c +++ b/src/mesa/drivers/dri/i965/brw_wm_emit.c @@ -30,7 +30,7 @@ */ -#include "macros.h" +#include "main/macros.h" #include "brw_context.h" #include "brw_wm.h" @@ -1302,8 +1302,10 @@ void brw_wm_emit( struct brw_wm_compile *c ) break; default: - _mesa_printf("unsupport opcode %d in fragment program\n", - inst->opcode); + _mesa_printf("Unsupported opcode %i (%s) in fragment shader\n", + inst->opcode, inst->opcode < MAX_OPCODE ? + _mesa_opcode_string(inst->opcode) : + "unknown"); } for (i = 0; i < 4; i++) diff --git a/src/mesa/drivers/dri/i965/brw_wm_fp.c b/src/mesa/drivers/dri/i965/brw_wm_fp.c index ef90260e2a..d3e926c328 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_fp.c +++ b/src/mesa/drivers/dri/i965/brw_wm_fp.c @@ -30,9 +30,9 @@ */ -#include "glheader.h" -#include "macros.h" -#include "enums.h" +#include "main/glheader.h" +#include "main/macros.h" +#include "main/enums.h" #include "brw_context.h" #include "brw_wm.h" #include "brw_util.h" @@ -562,6 +562,7 @@ static void precalc_tex( struct brw_wm_compile *c, { struct prog_src_register coord; struct prog_dst_register tmpcoord; + GLuint unit = c->fp->program.Base.SamplerUnits[inst->TexSrcUnit]; if (inst->TexSrcTarget == TEXTURE_CUBE_INDEX) { struct prog_instruction *out; @@ -618,7 +619,7 @@ static void precalc_tex( struct brw_wm_compile *c, search_or_add_param5( c, STATE_INTERNAL, STATE_TEXRECT_SCALE, - inst->TexSrcUnit, + unit, 0,0 ); tmpcoord = get_temp(c); @@ -644,19 +645,19 @@ static void precalc_tex( struct brw_wm_compile *c, * conversion requires allocating a temporary variable which we * don't have the facility to do that late in the compilation. */ - if (!(c->key.yuvtex_mask & (1<<inst->TexSrcUnit))) { + if (!(c->key.yuvtex_mask & (1<<unit))) { emit_op(c, OPCODE_TEX, inst->DstReg, inst->SaturateMode, - inst->TexSrcUnit, + unit, inst->TexSrcTarget, coord, src_undef(), src_undef()); } else { - GLboolean swap_uv = c->key.yuvtex_swap_mask & (1<<inst->TexSrcUnit); + GLboolean swap_uv = c->key.yuvtex_swap_mask & (1<<unit); /* CONST C0 = { -.5, -.0625, -.5, 1.164 } @@ -682,7 +683,7 @@ static void precalc_tex( struct brw_wm_compile *c, OPCODE_TEX, tmp, inst->SaturateMode, - inst->TexSrcUnit, + unit, inst->TexSrcTarget, coord, src_undef(), @@ -1029,6 +1030,11 @@ void brw_wm_pass_fp( struct brw_wm_compile *c ) precalc_txp(c, inst); break; + case OPCODE_TXB: + out = emit_insn(c, inst); + out->TexSrcUnit = fp->program.Base.SamplerUnits[inst->TexSrcUnit]; + break; + case OPCODE_XPD: out = emit_insn(c, inst); /* This should probably be done in the parser. diff --git a/src/mesa/drivers/dri/i965/brw_wm_glsl.c b/src/mesa/drivers/dri/i965/brw_wm_glsl.c index faa2837fa0..4d5e11f4b6 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_glsl.c +++ b/src/mesa/drivers/dri/i965/brw_wm_glsl.c @@ -1,4 +1,4 @@ -#include "macros.h" +#include "main/macros.h" #include "shader/prog_parameter.h" #include "brw_context.h" #include "brw_eu.h" @@ -850,20 +850,20 @@ static void emit_sop(struct brw_wm_compile *c, struct brw_reg dst, src0, src1; int i; - brw_push_insn_state(p); for (i = 0; i < 4; i++) { if (mask & (1<<i)) { dst = get_dst_reg(c, inst, i, 1); src0 = get_src_reg(c, &inst->SrcReg[0], i, 1); src1 = get_src_reg(c, &inst->SrcReg[1], i, 1); + brw_push_insn_state(p); brw_CMP(p, brw_null_reg(), cond, src0, src1); brw_set_predicate_control(p, BRW_PREDICATE_NONE); brw_MOV(p, dst, brw_imm_f(0.0)); brw_set_predicate_control(p, BRW_PREDICATE_NORMAL); brw_MOV(p, dst, brw_imm_f(1.0)); + brw_pop_insn_state(p); } } - brw_pop_insn_state(p); } static void emit_slt(struct brw_wm_compile *c, @@ -998,6 +998,8 @@ static void emit_txb(struct brw_wm_compile *c, { struct brw_compile *p = &c->func; struct brw_reg dst[4], src[4], payload_reg; + GLuint unit = c->fp->program.Base.SamplerUnits[inst->TexSrcUnit]; + GLuint i; payload_reg = get_reg(c, PROGRAM_PAYLOAD, PAYLOAD_DEPTH, 0, 1, 0, 0); for (i = 0; i < 4; i++) @@ -1029,8 +1031,8 @@ static void emit_txb(struct brw_wm_compile *c, retype(vec8(dst[0]), BRW_REGISTER_TYPE_UW), 1, retype(payload_reg, BRW_REGISTER_TYPE_UW), - inst->TexSrcUnit + MAX_DRAW_BUFFERS, /* surface */ - inst->TexSrcUnit, /* sampler */ + unit + MAX_DRAW_BUFFERS, /* surface */ + unit, /* sampler */ inst->DstReg.WriteMask, BRW_SAMPLER_MESSAGE_SIMD16_SAMPLE_BIAS, 4, @@ -1043,10 +1045,12 @@ static void emit_tex(struct brw_wm_compile *c, { struct brw_compile *p = &c->func; struct brw_reg dst[4], src[4], payload_reg; + GLuint unit = c->fp->program.Base.SamplerUnits[inst->TexSrcUnit]; + GLuint msg_len; GLuint i, nr; GLuint emit; - GLboolean shadow = (c->key.shadowtex_mask & (1<<inst->TexSrcUnit)) ? 1 : 0; + GLboolean shadow = (c->key.shadowtex_mask & (1<<unit)) ? 1 : 0; payload_reg = get_reg(c, PROGRAM_PAYLOAD, PAYLOAD_DEPTH, 0, 1, 0, 0); @@ -1091,8 +1095,8 @@ static void emit_tex(struct brw_wm_compile *c, retype(vec8(dst[0]), BRW_REGISTER_TYPE_UW), 1, retype(payload_reg, BRW_REGISTER_TYPE_UW), - inst->TexSrcUnit + MAX_DRAW_BUFFERS, /* surface */ - inst->TexSrcUnit, /* sampler */ + unit + MAX_DRAW_BUFFERS, /* surface */ + unit, /* sampler */ inst->DstReg.WriteMask, BRW_SAMPLER_MESSAGE_SIMD8_SAMPLE, 4, diff --git a/src/mesa/drivers/dri/i965/brw_wm_iz.c b/src/mesa/drivers/dri/i965/brw_wm_iz.c index ec2b976faa..0bb5d5ba83 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_iz.c +++ b/src/mesa/drivers/dri/i965/brw_wm_iz.c @@ -30,7 +30,7 @@ */ -#include "mtypes.h" +#include "main/mtypes.h" #include "brw_wm.h" diff --git a/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c b/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c index d40332e9ae..e1db31ec08 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c @@ -34,7 +34,7 @@ #include "brw_state.h" #include "brw_defines.h" -#include "macros.h" +#include "main/macros.h" @@ -255,11 +255,10 @@ brw_wm_sampler_populate_key(struct brw_context *brw, * complicates various things. However, this is still too confusing - * FIXME: simplify all the different new texture state flags. */ -static int upload_wm_samplers( struct brw_context *brw ) +static void upload_wm_samplers( struct brw_context *brw ) { struct wm_sampler_key key; int i; - int ret = 0; brw_wm_sampler_populate_key(brw, &key); @@ -271,7 +270,7 @@ static int upload_wm_samplers( struct brw_context *brw ) dri_bo_unreference(brw->wm.sampler_bo); brw->wm.sampler_bo = NULL; if (brw->wm.sampler_count == 0) - return 0; + return; brw->wm.sampler_bo = brw_search_cache(&brw->cache, BRW_SAMPLER, &key, sizeof(key), @@ -304,19 +303,14 @@ static int upload_wm_samplers( struct brw_context *brw ) if (!brw->attribs.Texture->Unit[i]._ReallyEnabled) continue; - ret |= dri_bufmgr_check_aperture_space(brw->wm.sdc_bo[i]); - dri_emit_reloc(brw->wm.sampler_bo, - DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_READ, - 0, - i * sizeof(struct brw_sampler_state) + - offsetof(struct brw_sampler_state, ss2), - brw->wm.sdc_bo[i]); + dri_bo_emit_reloc(brw->wm.sampler_bo, + I915_GEM_DOMAIN_INSTRUCTION, 0, + 0, + i * sizeof(struct brw_sampler_state) + + offsetof(struct brw_sampler_state, ss2), + brw->wm.sdc_bo[i]); } } - - ret |= dri_bufmgr_check_aperture_space(brw->wm.sampler_bo); - return ret; - } const struct brw_tracked_state brw_wm_samplers = { diff --git a/src/mesa/drivers/dri/i965/brw_wm_state.c b/src/mesa/drivers/dri/i965/brw_wm_state.c index f4da0f279e..61fe97a463 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_state.c @@ -34,7 +34,6 @@ #include "brw_context.h" #include "brw_state.h" #include "brw_defines.h" -#include "dri_bufmgr.h" #include "brw_wm.h" /*********************************************************************** @@ -199,40 +198,39 @@ wm_unit_create_from_key(struct brw_context *brw, struct brw_wm_unit_key *key, NULL, NULL); /* Emit WM program relocation */ - dri_emit_reloc(bo, - DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_READ, - wm.thread0.grf_reg_count << 1, - offsetof(struct brw_wm_unit_state, thread0), - brw->wm.prog_bo); + dri_bo_emit_reloc(bo, + I915_GEM_DOMAIN_INSTRUCTION, 0, + wm.thread0.grf_reg_count << 1, + offsetof(struct brw_wm_unit_state, thread0), + brw->wm.prog_bo); /* Emit scratch space relocation */ if (key->total_scratch != 0) { - dri_emit_reloc(bo, - DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_READ | DRM_BO_FLAG_WRITE, - wm.thread2.per_thread_scratch_space, - offsetof(struct brw_wm_unit_state, thread2), - brw->wm.scratch_buffer); + dri_bo_emit_reloc(bo, + 0, 0, + wm.thread2.per_thread_scratch_space, + offsetof(struct brw_wm_unit_state, thread2), + brw->wm.scratch_buffer); } /* Emit sampler state relocation */ if (key->sampler_count != 0) { - dri_emit_reloc(bo, - DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_READ, - wm.wm4.stats_enable | (wm.wm4.sampler_count << 2), - offsetof(struct brw_wm_unit_state, wm4), - brw->wm.sampler_bo); + dri_bo_emit_reloc(bo, + I915_GEM_DOMAIN_INSTRUCTION, 0, + wm.wm4.stats_enable | (wm.wm4.sampler_count << 2), + offsetof(struct brw_wm_unit_state, wm4), + brw->wm.sampler_bo); } return bo; } -static int upload_wm_unit( struct brw_context *brw ) +static void upload_wm_unit( struct brw_context *brw ) { struct intel_context *intel = &brw->intel; struct brw_wm_unit_key key; dri_bo *reloc_bufs[3]; - int ret = 0, i; wm_unit_populate_key(brw, &key); /* Allocate the necessary scratch space if we haven't already. Don't @@ -251,7 +249,7 @@ static int upload_wm_unit( struct brw_context *brw ) brw->wm.scratch_buffer = dri_bo_alloc(intel->bufmgr, "wm scratch", total, - 4096, DRM_BO_FLAG_MEM_TT); + 4096); } } @@ -267,12 +265,6 @@ static int upload_wm_unit( struct brw_context *brw ) if (brw->wm.state_bo == NULL) { brw->wm.state_bo = wm_unit_create_from_key(brw, &key, reloc_bufs); } - - for (i = 0; i < 3; i++) - if (reloc_bufs[i]) - ret |= dri_bufmgr_check_aperture_space(reloc_bufs[i]); - ret |= dri_bufmgr_check_aperture_space(brw->wm.state_bo); - return ret; } const struct brw_tracked_state brw_wm_unit = { 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 2ba3eb4de8..47127c0421 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c @@ -30,9 +30,9 @@ */ -#include "mtypes.h" -#include "texformat.h" -#include "texstore.h" +#include "main/mtypes.h" +#include "main/texformat.h" +#include "main/texstore.h" #include "intel_mipmap_tree.h" #include "intel_batchbuffer.h" @@ -138,7 +138,7 @@ static GLuint translate_tex_format( GLuint mesa_format, GLenum depth_mode ) case MESA_FORMAT_SRGB_DXT1: return BRW_SURFACEFORMAT_BC1_UNORM_SRGB; - case MESA_FORMAT_Z24_S8: + case MESA_FORMAT_S8_Z24: return BRW_SURFACEFORMAT_I24X8_UNORM; default: @@ -154,10 +154,29 @@ struct brw_wm_surface_key { GLint first_level, last_level; GLint width, height, depth; GLint pitch, cpp; - GLboolean tiled; + uint32_t tiling; GLuint offset; }; +static void +brw_set_surface_tiling(struct brw_surface_state *surf, uint32_t tiling) +{ + switch (tiling) { + case I915_TILING_NONE: + surf->ss3.tiled_surface = 0; + surf->ss3.tile_walk = 0; + break; + case I915_TILING_X: + surf->ss3.tiled_surface = 1; + surf->ss3.tile_walk = BRW_TILEWALK_XMAJOR; + break; + case I915_TILING_Y: + surf->ss3.tiled_surface = 1; + surf->ss3.tile_walk = BRW_TILEWALK_YMAJOR; + break; + } +} + static dri_bo * brw_create_texture_surface( struct brw_context *brw, struct brw_wm_surface_key *key ) @@ -192,9 +211,7 @@ brw_create_texture_surface( struct brw_context *brw, surf.ss2.mip_count = key->last_level - key->first_level; surf.ss2.width = key->width - 1; surf.ss2.height = key->height - 1; - - surf.ss3.tile_walk = BRW_TILEWALK_XMAJOR; - surf.ss3.tiled_surface = key->tiled; + brw_set_surface_tiling(&surf, key->tiling); surf.ss3.pitch = (key->pitch * key->cpp) - 1; surf.ss3.depth = key->depth - 1; @@ -214,18 +231,19 @@ brw_create_texture_surface( struct brw_context *brw, &key->bo, key->bo ? 1 : 0, &surf, sizeof(surf), NULL, NULL); + if (key->bo) { /* Emit relocation to surface contents */ - dri_emit_reloc(bo, - DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_READ, - 0, - offsetof(struct brw_surface_state, ss1), - key->bo); + dri_bo_emit_reloc(bo, + I915_GEM_DOMAIN_SAMPLER, 0, + 0, + offsetof(struct brw_surface_state, ss1), + key->bo); } return bo; } -static int +static void brw_update_texture_surface( GLcontext *ctx, GLuint unit ) { struct brw_context *brw = brw_context(ctx); @@ -233,7 +251,6 @@ brw_update_texture_surface( GLcontext *ctx, GLuint unit ) struct intel_texture_object *intelObj = intel_texture_object(tObj); struct gl_texture_image *firstImage = tObj->Image[0][intelObj->firstLevel]; struct brw_wm_surface_key key; - int ret = 0; memset(&key, 0, sizeof(key)); @@ -248,7 +265,6 @@ brw_update_texture_surface( GLcontext *ctx, GLuint unit ) key.depth = firstImage->Depth; key.bo = intelObj->mt->region->buffer; key.offset = 0; - ret |= dri_bufmgr_check_aperture_space(key.bo); } key.target = tObj->Target; @@ -258,7 +274,8 @@ brw_update_texture_surface( GLcontext *ctx, GLuint unit ) key.width = firstImage->Width; key.height = firstImage->Height; key.cpp = intelObj->mt->cpp; - key.tiled = intelObj->mt->region->tiled; + key.depth = firstImage->Depth; + key.tiling = intelObj->mt->region->tiling; dri_bo_unreference(brw->wm.surf_bo[unit + MAX_DRAW_BUFFERS]); brw->wm.surf_bo[unit + MAX_DRAW_BUFFERS] = brw_search_cache(&brw->cache, BRW_SS_SURFACE, @@ -268,9 +285,6 @@ brw_update_texture_surface( GLcontext *ctx, GLuint unit ) if (brw->wm.surf_bo[unit + MAX_DRAW_BUFFERS] == NULL) { brw->wm.surf_bo[unit + MAX_DRAW_BUFFERS] = brw_create_texture_surface(brw, &key); } - - ret |= dri_bufmgr_check_aperture_space(brw->wm.surf_bo[unit + MAX_DRAW_BUFFERS]); - return ret; } /** @@ -278,18 +292,18 @@ brw_update_texture_surface( GLcontext *ctx, GLuint unit ) * While it is only used for the front/back buffer currently, it should be * usable for further buffers when doing ARB_draw_buffer support. */ -static int +static void brw_update_region_surface(struct brw_context *brw, struct intel_region *region, unsigned int unit, GLboolean cached) { dri_bo *region_bo = NULL; - int ret = 0; struct { unsigned int surface_type; unsigned int surface_format; unsigned int width, height, cpp; GLubyte color_mask[4]; - GLboolean tiled, color_blend; + GLboolean color_blend; + uint32_t tiling; } key; memset(&key, 0, sizeof(key)); @@ -302,16 +316,14 @@ brw_update_region_surface(struct brw_context *brw, struct intel_region *region, key.surface_format = BRW_SURFACEFORMAT_B8G8R8A8_UNORM; else key.surface_format = BRW_SURFACEFORMAT_B5G6R5_UNORM; - key.tiled = region->tiled; + key.tiling = region->tiling; key.width = region->pitch; /* XXX: not really! */ key.height = region->height; key.cpp = region->cpp; - - ret |= dri_bufmgr_check_aperture_space(region->buffer); } else { key.surface_type = BRW_SURFACE_NULL; key.surface_format = BRW_SURFACEFORMAT_B8G8R8A8_UNORM; - key.tiled = 0; + key.tiling = 0; key.width = 1; key.height = 1; key.cpp = 4; @@ -341,8 +353,7 @@ brw_update_region_surface(struct brw_context *brw, struct intel_region *region, surf.ss2.width = key.width - 1; surf.ss2.height = key.height - 1; - surf.ss3.tile_walk = BRW_TILEWALK_XMAJOR; - surf.ss3.tiled_surface = key.tiled; + brw_set_surface_tiling(&surf, key.tiling); surf.ss3.pitch = (key.width * key.cpp) - 1; /* _NEW_COLOR */ @@ -359,19 +370,19 @@ brw_update_region_surface(struct brw_context *brw, struct intel_region *region, &surf, sizeof(surf), NULL, NULL); if (region_bo != NULL) { - dri_emit_reloc(brw->wm.surf_bo[unit], - DRM_BO_FLAG_MEM_TT | - DRM_BO_FLAG_READ | - DRM_BO_FLAG_WRITE, - 0, - offsetof(struct brw_surface_state, ss1), - region_bo); + /* We might sample from it, and we might render to it, so flag + * them both. We might be able to figure out from other state + * a more restrictive relocation to emit. + */ + dri_bo_emit_reloc(brw->wm.surf_bo[unit], + I915_GEM_DOMAIN_RENDER | + I915_GEM_DOMAIN_SAMPLER, + I915_GEM_DOMAIN_RENDER, + 0, + offsetof(struct brw_surface_state, ss1), + region_bo); } } - - ret |= dri_bufmgr_check_aperture_space(brw->wm.surf_bo[unit]); - - return ret; } @@ -409,13 +420,11 @@ brw_wm_get_binding_table(struct brw_context *brw) /* Emit binding table relocations to surface state */ for (i = 0; i < BRW_WM_MAX_SURF; i++) { if (brw->wm.surf_bo[i] != NULL) { - dri_emit_reloc(bind_bo, - DRM_BO_FLAG_MEM_TT | - DRM_BO_FLAG_READ | - DRM_BO_FLAG_WRITE, - 0, - i * sizeof(GLuint), - brw->wm.surf_bo[i]); + dri_bo_emit_reloc(bind_bo, + I915_GEM_DOMAIN_INSTRUCTION, 0, + 0, + i * sizeof(GLuint), + brw->wm.surf_bo[i]); } } @@ -425,23 +434,19 @@ brw_wm_get_binding_table(struct brw_context *brw) return bind_bo; } -static int prepare_wm_surfaces(struct brw_context *brw ) +static void prepare_wm_surfaces(struct brw_context *brw ) { GLcontext *ctx = &brw->intel.ctx; struct intel_context *intel = &brw->intel; - GLuint i, ret; + GLuint i; if (brw->state.nr_draw_regions > 1) { for (i = 0; i < brw->state.nr_draw_regions; i++) { - ret = brw_update_region_surface(brw, brw->state.draw_regions[i], i, - GL_FALSE); - if (ret) - return ret; + brw_update_region_surface(brw, brw->state.draw_regions[i], i, + GL_FALSE); } }else { - ret = brw_update_region_surface(brw, brw->state.draw_regions[0], 0, GL_TRUE); - if (ret) - return ret; + brw_update_region_surface(brw, brw->state.draw_regions[0], 0, GL_TRUE); } brw->wm.nr_surfaces = MAX_DRAW_BUFFERS; @@ -457,11 +462,8 @@ static int prepare_wm_surfaces(struct brw_context *brw ) dri_bo_reference(brw->wm.surf_bo[i+MAX_DRAW_BUFFERS]); brw->wm.nr_surfaces = i + MAX_DRAW_BUFFERS + 1; } else { - ret = brw_update_texture_surface(ctx, i); + brw_update_texture_surface(ctx, i); brw->wm.nr_surfaces = i + MAX_DRAW_BUFFERS + 1; - - if (ret) - return ret; } } else { dri_bo_unreference(brw->wm.surf_bo[i+MAX_DRAW_BUFFERS]); @@ -472,8 +474,6 @@ static int prepare_wm_surfaces(struct brw_context *brw ) dri_bo_unreference(brw->wm.bind_bo); brw->wm.bind_bo = brw_wm_get_binding_table(brw); - - return dri_bufmgr_check_aperture_space(brw->wm.bind_bo); } diff --git a/src/mesa/drivers/dri/i965/intel_bufmgr_ttm.c b/src/mesa/drivers/dri/i965/intel_bufmgr_ttm.c deleted file mode 120000 index e9df5c6279..0000000000 --- a/src/mesa/drivers/dri/i965/intel_bufmgr_ttm.c +++ /dev/null @@ -1 +0,0 @@ -../intel/intel_bufmgr_ttm.c
\ No newline at end of file diff --git a/src/mesa/drivers/dri/i965/intel_ioctl.c b/src/mesa/drivers/dri/i965/intel_ioctl.c deleted file mode 120000 index effd0f378d..0000000000 --- a/src/mesa/drivers/dri/i965/intel_ioctl.c +++ /dev/null @@ -1 +0,0 @@ -../intel/intel_ioctl.c
\ No newline at end of file diff --git a/src/mesa/drivers/dri/i965/intel_state.c b/src/mesa/drivers/dri/i965/intel_state.c index 0fba5a771c..67ef5f78c1 100644 --- a/src/mesa/drivers/dri/i965/intel_state.c +++ b/src/mesa/drivers/dri/i965/intel_state.c @@ -26,12 +26,12 @@ **************************************************************************/ -#include "glheader.h" -#include "context.h" -#include "macros.h" -#include "enums.h" -#include "colormac.h" -#include "dd.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/macros.h" +#include "main/enums.h" +#include "main/colormac.h" +#include "main/dd.h" #include "intel_screen.h" #include "intel_context.h" diff --git a/src/mesa/drivers/dri/intel/intel_batchbuffer.c b/src/mesa/drivers/dri/intel/intel_batchbuffer.c index a594fb6cc4..7dbc646370 100644 --- a/src/mesa/drivers/dri/intel/intel_batchbuffer.c +++ b/src/mesa/drivers/dri/intel/intel_batchbuffer.c @@ -25,10 +25,11 @@ * **************************************************************************/ +#include "intel_context.h" #include "intel_batchbuffer.h" -#include "intel_ioctl.h" #include "intel_decode.h" #include "intel_reg.h" +#include "intel_bufmgr.h" /* Relocations in kernel space: * - pass dma buffer seperately @@ -78,19 +79,21 @@ intel_batchbuffer_reset(struct intel_batchbuffer *batch) batch->buf = NULL; } + if (!batch->buffer && intel->ttm == GL_TRUE) + batch->buffer = malloc (intel->maxBatchSize); + batch->buf = dri_bo_alloc(intel->bufmgr, "batchbuffer", - intel->maxBatchSize, 4096, - DRM_BO_FLAG_MEM_LOCAL | DRM_BO_FLAG_CACHED | DRM_BO_FLAG_CACHED_MAPPED); - dri_bo_map(batch->buf, GL_TRUE); - batch->map = batch->buf->virtual; + intel->maxBatchSize, 4096); + if (batch->buffer) + batch->map = batch->buffer; + else { + dri_bo_map(batch->buf, GL_TRUE); + batch->map = batch->buf->virtual; + } batch->size = intel->maxBatchSize; batch->ptr = batch->map; batch->dirty_state = ~0; batch->cliprect_mode = IGNORE_CLIPRECTS; - - /* account batchbuffer in aperture */ - dri_bufmgr_check_aperture_space(batch->buf); - } struct intel_batchbuffer * @@ -99,7 +102,6 @@ intel_batchbuffer_alloc(struct intel_context *intel) struct intel_batchbuffer *batch = calloc(sizeof(*batch), 1); batch->intel = intel; - batch->last_fence = NULL; intel_batchbuffer_reset(batch); return batch; @@ -108,14 +110,13 @@ intel_batchbuffer_alloc(struct intel_context *intel) void intel_batchbuffer_free(struct intel_batchbuffer *batch) { - if (batch->last_fence) { - dri_fence_wait(batch->last_fence); - dri_fence_unreference(batch->last_fence); - batch->last_fence = NULL; - } - if (batch->map) { - dri_bo_unmap(batch->buf); - batch->map = NULL; + if (batch->buffer) + free (batch->buffer); + else { + if (batch->map) { + dri_bo_unmap(batch->buf); + batch->map = NULL; + } } dri_bo_unreference(batch->buf); batch->buf = NULL; @@ -131,11 +132,12 @@ do_flush_locked(struct intel_batchbuffer *batch, GLuint used, GLboolean allow_unlock) { struct intel_context *intel = batch->intel; - void *start; - GLuint count; + int ret = 0; - dri_bo_unmap(batch->buf); - start = dri_process_relocs(batch->buf, &count); + if (batch->buffer) + dri_bo_subdata (batch->buf, 0, used, batch->buffer); + else + dri_bo_unmap(batch->buf); batch->map = NULL; batch->ptr = NULL; @@ -146,23 +148,14 @@ do_flush_locked(struct intel_batchbuffer *batch, */ if (!(intel->numClipRects == 0 && - batch->cliprect_mode == LOOP_CLIPRECTS)) { - if (intel->ttm == GL_TRUE) { - intel_exec_ioctl(batch->intel, - used, - batch->cliprect_mode != LOOP_CLIPRECTS, - allow_unlock, - start, count, &batch->last_fence); - } else { - intel_batch_ioctl(batch->intel, - batch->buf->offset, - used, - batch->cliprect_mode != LOOP_CLIPRECTS, - allow_unlock); - } + batch->cliprect_mode == LOOP_CLIPRECTS) || intel->no_hw) { + dri_bo_exec(batch->buf, used, + intel->pClipRects, + batch->cliprect_mode != LOOP_CLIPRECTS ? + 0 : intel->numClipRects, + (((GLuint) intel->drawX) & 0xffff) | + (((GLuint) intel->drawY) << 16)); } - - dri_post_submit(batch->buf, &batch->last_fence); if (intel->numClipRects == 0 && batch->cliprect_mode == LOOP_CLIPRECTS) { @@ -187,6 +180,10 @@ do_flush_locked(struct intel_batchbuffer *batch, intel->vtbl.debug_batch(intel); } + if (ret != 0) { + UNLOCK_HARDWARE(intel); + exit(1); + } intel->vtbl.new_batch(intel); } @@ -204,21 +201,27 @@ _intel_batchbuffer_flush(struct intel_batchbuffer *batch, const char *file, if (INTEL_DEBUG & DEBUG_BATCH) fprintf(stderr, "%s:%d: Batchbuffer flush with %db used\n", file, line, used); - /* 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; + + /* Emit a flush if the bufmgr doesn't do it for us. */ + if (!intel->ttm) { + *(GLuint *) (batch->ptr) = intel->vtbl.flush_cmd(); + batch->ptr += 4; + used = batch->ptr - batch->map; } - else { - ((int *) batch->ptr)[0] = intel->vtbl.flush_cmd(); - ((int *) batch->ptr)[1] = MI_BATCH_BUFFER_END; - used += 8; + + /* Round batchbuffer usage to 2 DWORDs. */ + + if ((used & 4) == 0) { + *(GLuint *) (batch->ptr) = 0; /* noop */ + batch->ptr += 4; + used = batch->ptr - batch->map; } + /* Mark the end of the buffer. */ + *(GLuint *) (batch->ptr) = MI_BATCH_BUFFER_END; /* noop */ + batch->ptr += 4; + used = batch->ptr - batch->map; + /* Workaround for recursive batchbuffer flushing: If the window is * moved, we can get into a case where we try to flush during a * flush. What happens is that when we try to grab the lock for @@ -230,6 +233,9 @@ _intel_batchbuffer_flush(struct intel_batchbuffer *batch, const char *file, * avoid that in the first place. */ batch->ptr = batch->map; + if (intel->vtbl.finish_batch) + intel->vtbl.finish_batch(intel); + /* TODO: Just pass the relocation list and dma buffer up to the * kernel. */ @@ -243,8 +249,8 @@ _intel_batchbuffer_flush(struct intel_batchbuffer *batch, const char *file, if (INTEL_DEBUG & DEBUG_SYNC) { fprintf(stderr, "waiting for idle\n"); - if (batch->last_fence != NULL) - dri_fence_wait(batch->last_fence); + dri_bo_map(batch->buf, GL_TRUE); + dri_bo_unmap(batch->buf); } /* Reset the buffer: @@ -252,25 +258,22 @@ _intel_batchbuffer_flush(struct intel_batchbuffer *batch, const char *file, intel_batchbuffer_reset(batch); } -void -intel_batchbuffer_finish(struct intel_batchbuffer *batch) -{ - intel_batchbuffer_flush(batch); - if (batch->last_fence != NULL) - dri_fence_wait(batch->last_fence); -} - /* This is the only way buffers get added to the validate list. */ GLboolean intel_batchbuffer_emit_reloc(struct intel_batchbuffer *batch, dri_bo *buffer, - GLuint flags, GLuint delta) + uint32_t read_domains, uint32_t write_domain, + uint32_t delta) { int ret; - ret = dri_emit_reloc(batch->buf, flags, delta, batch->ptr - batch->map, buffer); + if (batch->ptr - batch->map > batch->buf->size) + _mesa_printf ("bad relocation ptr %p map %p offset %d size %d\n", + batch->ptr, batch->map, batch->ptr - batch->map, batch->buf->size); + ret = dri_bo_emit_reloc(batch->buf, read_domains, write_domain, + delta, batch->ptr - batch->map, buffer); /* * Using the old buffer offset, write in what the right data would be, in case diff --git a/src/mesa/drivers/dri/intel/intel_batchbuffer.h b/src/mesa/drivers/dri/intel/intel_batchbuffer.h index 0da602010e..1f8096b32e 100644 --- a/src/mesa/drivers/dri/intel/intel_batchbuffer.h +++ b/src/mesa/drivers/dri/intel/intel_batchbuffer.h @@ -1,11 +1,11 @@ #ifndef INTEL_BATCHBUFFER_H #define INTEL_BATCHBUFFER_H -#include "mtypes.h" +#include "main/mtypes.h" -#include "dri_bufmgr.h" - -struct intel_context; +#include "intel_context.h" +#include "intel_bufmgr.h" +#include "intel_reg.h" #define BATCH_SZ 16384 #define BATCH_RESERVED 16 @@ -40,7 +40,8 @@ struct intel_batchbuffer struct intel_context *intel; dri_bo *buf; - dri_fence *last_fence; + + GLubyte *buffer; GLubyte *map; GLubyte *ptr; @@ -58,8 +59,6 @@ struct intel_batchbuffer *intel_batchbuffer_alloc(struct intel_context void intel_batchbuffer_free(struct intel_batchbuffer *batch); -void intel_batchbuffer_finish(struct intel_batchbuffer *batch); - void _intel_batchbuffer_flush(struct intel_batchbuffer *batch, const char *file, int line); @@ -82,14 +81,16 @@ void intel_batchbuffer_release_space(struct intel_batchbuffer *batch, GLboolean intel_batchbuffer_emit_reloc(struct intel_batchbuffer *batch, dri_bo *buffer, - GLuint flags, GLuint offset); + uint32_t read_domains, + uint32_t write_domain, + uint32_t 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 +static INLINE GLint intel_batchbuffer_space(struct intel_batchbuffer *batch) { return (batch->size - BATCH_RESERVED) - (batch->ptr - batch->map); @@ -136,12 +137,20 @@ intel_batchbuffer_require_space(struct intel_batchbuffer *batch, #define OUT_BATCH(d) intel_batchbuffer_emit_dword(intel->batch, d) -#define OUT_RELOC(buf, cliprect_mode, delta) do { \ +#define OUT_RELOC(buf, read_domains, write_domain, delta) do { \ assert((delta) >= 0); \ - intel_batchbuffer_emit_reloc(intel->batch, buf, cliprect_mode, delta); \ + intel_batchbuffer_emit_reloc(intel->batch, buf, \ + read_domains, write_domain, delta); \ } while (0) #define ADVANCE_BATCH() do { } while(0) +static INLINE void +intel_batchbuffer_emit_mi_flush(struct intel_batchbuffer *batch) +{ + intel_batchbuffer_require_space(batch, 4, IGNORE_CLIPRECTS); + intel_batchbuffer_emit_dword(batch, MI_FLUSH); +} + #endif diff --git a/src/mesa/drivers/dri/intel/intel_blit.c b/src/mesa/drivers/dri/intel/intel_blit.c index 25ac609f13..2917401e02 100644 --- a/src/mesa/drivers/dri/intel/intel_blit.c +++ b/src/mesa/drivers/dri/intel/intel_blit.c @@ -29,17 +29,17 @@ #include <stdio.h> #include <errno.h> -#include "mtypes.h" -#include "context.h" -#include "enums.h" +#include "main/mtypes.h" +#include "main/context.h" +#include "main/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 "intel_batchbuffer.h" #define FILE_DEBUG_FLAG DEBUG_BLIT @@ -54,7 +54,6 @@ intelCopyBuffer(const __DRIdrawablePrivate * dPriv, struct intel_context *intel; const intelScreenPrivate *intelScreen; - int ret; DBG("%s\n", __FUNCTION__); @@ -66,14 +65,6 @@ intelCopyBuffer(const __DRIdrawablePrivate * dPriv, intelScreen = intel->intelScreen; - if (intel->last_swap_fence) { - dri_fence_wait(intel->last_swap_fence); - dri_fence_unreference(intel->last_swap_fence); - intel->last_swap_fence = NULL; - } - intel->last_swap_fence = intel->first_swap_fence; - intel->first_swap_fence = NULL; - /* The LOCK_HARDWARE is required for the cliprects. Buffer offsets * should work regardless. */ @@ -89,6 +80,7 @@ intelCopyBuffer(const __DRIdrawablePrivate * dPriv, unsigned short src_x, src_y; int BR13, CMD; int i; + dri_bo *aper_array[3]; src = intel_get_rb_region(&intel_fb->Base, BUFFER_BACK_LEFT); dst = intel_get_rb_region(&intel_fb->Base, BUFFER_FRONT_LEFT); @@ -114,26 +106,28 @@ intelCopyBuffer(const __DRIdrawablePrivate * dPriv, } #ifndef I915 - if (src->tiled) { + if (src->tiling != I915_TILING_NONE) { CMD |= XY_SRC_TILED; src_pitch /= 4; } - if (dst->tiled) { + if (dst->tiling != I915_TILING_NONE) { CMD |= XY_DST_TILED; dst_pitch /= 4; } #endif /* do space/cliprects check before going any further */ - intel_batchbuffer_require_space(intel->batch, 8 * 4, REFERENCES_CLIPRECTS); + intel_batchbuffer_require_space(intel->batch, 8 * 4, + REFERENCES_CLIPRECTS); again: - ret = dri_bufmgr_check_aperture_space(dst->buffer); - ret |= dri_bufmgr_check_aperture_space(src->buffer); - - if (ret) { + aper_array[0] = intel->batch->buf; + aper_array[1] = dst->buffer; + aper_array[2] = src->buffer; + + if (dri_bufmgr_check_aperture_space(aper_array, 3) != 0) { intel_batchbuffer_flush(intel->batch); goto again; } - + for (i = 0; i < nbox; i++, pbox++) { drm_clip_rect_t box = *pbox; @@ -157,19 +151,22 @@ intelCopyBuffer(const __DRIdrawablePrivate * dPriv, OUT_BATCH((box.y1 << 16) | box.x1); OUT_BATCH((box.y2 << 16) | box.x2); - OUT_RELOC(dst->buffer, DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_WRITE, 0); + OUT_RELOC(dst->buffer, + I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, + 0); OUT_BATCH((src_y << 16) | src_x); OUT_BATCH(src_pitch); - OUT_RELOC(src->buffer, DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_READ, 0); + OUT_RELOC(src->buffer, + I915_GEM_DOMAIN_RENDER, 0, + 0); ADVANCE_BATCH(); } - if (intel->first_swap_fence) - dri_fence_unreference(intel->first_swap_fence); + /* Flush the rendering and the batch so that the results all land on the + * screen in a timely fashion. + */ + intel_batchbuffer_emit_mi_flush(intel->batch); intel_batchbuffer_flush(intel->batch); - intel->first_swap_fence = intel->batch->last_fence; - if (intel->first_swap_fence) - dri_fence_reference(intel->first_swap_fence); } UNLOCK_HARDWARE(intel); @@ -184,7 +181,7 @@ intelEmitFillBlit(struct intel_context *intel, GLshort dst_pitch, dri_bo *dst_buffer, GLuint dst_offset, - GLboolean dst_tiled, + uint32_t dst_tiling, GLshort x, GLshort y, GLshort w, GLshort h, GLuint color) @@ -209,7 +206,7 @@ intelEmitFillBlit(struct intel_context *intel, return; } #ifndef I915 - if (dst_tiled) { + if (dst_tiling != I915_TILING_NONE) { CMD |= XY_DST_TILED; dst_pitch /= 4; } @@ -226,7 +223,9 @@ intelEmitFillBlit(struct intel_context *intel, OUT_BATCH(BR13 | dst_pitch); 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, dst_offset); + OUT_RELOC(dst_buffer, + I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, + dst_offset); OUT_BATCH(color); ADVANCE_BATCH(); } @@ -263,11 +262,11 @@ intelEmitCopyBlit(struct intel_context *intel, GLshort src_pitch, dri_bo *src_buffer, GLuint src_offset, - GLboolean src_tiled, + uint32_t src_tiling, GLshort dst_pitch, dri_bo *dst_buffer, GLuint dst_offset, - GLboolean dst_tiled, + uint32_t dst_tiling, GLshort src_x, GLshort src_y, GLshort dst_x, GLshort dst_y, GLshort w, GLshort h, @@ -276,17 +275,19 @@ intelEmitCopyBlit(struct intel_context *intel, GLuint CMD, BR13; int dst_y2 = dst_y + h; int dst_x2 = dst_x + w; - int ret; + dri_bo *aper_array[3]; BATCH_LOCALS; /* do space/cliprects check before going any further */ intel_batchbuffer_require_space(intel->batch, 8 * 4, NO_LOOP_CLIPRECTS); again: - ret = dri_bufmgr_check_aperture_space(dst_buffer); - ret |= dri_bufmgr_check_aperture_space(src_buffer); - if (ret) { - intel_batchbuffer_flush(intel->batch); - goto again; + aper_array[0] = intel->batch->buf; + aper_array[1] = dst_buffer; + aper_array[2] = src_buffer; + + if (dri_bufmgr_check_aperture_space(aper_array, 3) != 0) { + intel_batchbuffer_flush(intel->batch); + goto again; } DBG("%s src:buf(%p)/%d+%d %d,%d dst:buf(%p)/%d+%d %d,%d sz:%dx%d\n", @@ -315,11 +316,11 @@ intelEmitCopyBlit(struct intel_context *intel, } #ifndef I915 - if (dst_tiled) { + if (dst_tiling != I915_TILING_NONE) { CMD |= XY_DST_TILED; dst_pitch /= 4; } - if (src_tiled) { + if (src_tiling != I915_TILING_NONE) { CMD |= XY_SRC_TILED; src_pitch /= 4; } @@ -345,11 +346,13 @@ intelEmitCopyBlit(struct intel_context *intel, OUT_BATCH(BR13 | dst_pitch); 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, + OUT_RELOC(dst_buffer, + I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, dst_offset); OUT_BATCH((src_y << 16) | src_x); OUT_BATCH(src_pitch); - OUT_RELOC(src_buffer, DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_READ, + OUT_RELOC(src_buffer, + I915_GEM_DOMAIN_RENDER, 0, src_offset); ADVANCE_BATCH(); } @@ -362,14 +365,17 @@ intelEmitCopyBlit(struct intel_context *intel, OUT_BATCH(BR13 | ((uint16_t)dst_pitch)); 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, + OUT_RELOC(dst_buffer, + I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, dst_offset + dst_y * dst_pitch); OUT_BATCH((0 << 16) | src_x); OUT_BATCH(src_pitch); - OUT_RELOC(src_buffer, DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_READ, + OUT_RELOC(src_buffer, + I915_GEM_DOMAIN_RENDER, 0, src_offset + src_y * src_pitch); ADVANCE_BATCH(); } + intel_batchbuffer_emit_mi_flush(intel->batch); } @@ -513,7 +519,7 @@ intelClearWithBlit(GLcontext *ctx, GLbitfield mask) } #ifndef I915 - if (irb_region->tiled) { + if (irb_region->tiling != I915_TILING_NONE) { CMD |= XY_DST_TILED; pitch /= 4; } @@ -541,7 +547,8 @@ intelClearWithBlit(GLcontext *ctx, GLbitfield mask) 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, + OUT_RELOC(write_buffer, + I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, irb_region->draw_offset); OUT_BATCH(clearVal); ADVANCE_BATCH(); @@ -549,7 +556,7 @@ intelClearWithBlit(GLcontext *ctx, GLbitfield mask) } } } - intel_batchbuffer_flush(intel->batch); + intel_batchbuffer_emit_mi_flush(intel->batch); } UNLOCK_HARDWARE(intel); @@ -563,7 +570,7 @@ intelEmitImmediateColorExpandBlit(struct intel_context *intel, GLshort dst_pitch, dri_bo *dst_buffer, GLuint dst_offset, - GLboolean dst_tiled, + uint32_t dst_tiling, GLshort x, GLshort y, GLshort w, GLshort h, GLenum logic_op) @@ -587,13 +594,13 @@ intelEmitImmediateColorExpandBlit(struct intel_context *intel, (8 * 4) + (3 * 4) + dwords, - NO_LOOP_CLIPRECTS ); + REFERENCES_CLIPRECTS ); opcode = XY_SETUP_BLT_CMD; if (cpp == 4) opcode |= XY_BLT_WRITE_ALPHA | XY_BLT_WRITE_RGB; #ifndef I915 - if (dst_tiled) { + if (dst_tiling != I915_TILING_NONE) { opcode |= XY_DST_TILED; dst_pitch /= 4; } @@ -606,15 +613,17 @@ intelEmitImmediateColorExpandBlit(struct intel_context *intel, br13 |= BR13_8888; blit_cmd = XY_TEXT_IMMEDIATE_BLIT_CMD | XY_TEXT_BYTE_PACKED; /* packing? */ - if (dst_tiled) + if (dst_tiling != I915_TILING_NONE) blit_cmd |= XY_DST_TILED; - BEGIN_BATCH(8 + 3, NO_LOOP_CLIPRECTS); + BEGIN_BATCH(8 + 3, REFERENCES_CLIPRECTS); OUT_BATCH(opcode); OUT_BATCH(br13); OUT_BATCH((0 << 16) | 0); /* clip x1, y1 */ OUT_BATCH((100 << 16) | 100); /* clip x2, y2 */ - OUT_RELOC(dst_buffer, DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_WRITE, dst_offset); + OUT_RELOC(dst_buffer, + I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, + dst_offset); OUT_BATCH(0); /* bg */ OUT_BATCH(fg_color); /* fg */ OUT_BATCH(0); /* pattern base addr */ @@ -627,5 +636,7 @@ intelEmitImmediateColorExpandBlit(struct intel_context *intel, intel_batchbuffer_data( intel->batch, src_bits, dwords * 4, - NO_LOOP_CLIPRECTS ); + REFERENCES_CLIPRECTS ); + + intel_batchbuffer_emit_mi_flush(intel->batch); } diff --git a/src/mesa/drivers/dri/intel/intel_blit.h b/src/mesa/drivers/dri/intel/intel_blit.h index fc0620caba..52065b13ed 100644 --- a/src/mesa/drivers/dri/intel/intel_blit.h +++ b/src/mesa/drivers/dri/intel/intel_blit.h @@ -29,8 +29,6 @@ #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); @@ -42,11 +40,11 @@ extern void intelEmitCopyBlit(struct intel_context *intel, GLshort src_pitch, dri_bo *src_buffer, GLuint src_offset, - GLboolean src_tiled, + uint32_t src_tiling, GLshort dst_pitch, dri_bo *dst_buffer, GLuint dst_offset, - GLboolean dst_tiled, + uint32_t dst_tiling, GLshort srcx, GLshort srcy, GLshort dstx, GLshort dsty, GLshort w, GLshort h, @@ -57,7 +55,7 @@ extern void intelEmitFillBlit(struct intel_context *intel, GLshort dst_pitch, dri_bo *dst_buffer, GLuint dst_offset, - GLboolean dst_tiled, + uint32_t dst_tiling, GLshort x, GLshort y, GLshort w, GLshort h, GLuint color); @@ -69,7 +67,7 @@ intelEmitImmediateColorExpandBlit(struct intel_context *intel, GLshort dst_pitch, dri_bo *dst_buffer, GLuint dst_offset, - GLboolean dst_tiled, + uint32_t dst_tiling, GLshort x, GLshort y, GLshort w, GLshort h, GLenum logic_op); diff --git a/src/mesa/drivers/dri/intel/intel_buffer_objects.c b/src/mesa/drivers/dri/intel/intel_buffer_objects.c index 951b8cbfb7..60d7bb3770 100644 --- a/src/mesa/drivers/dri/intel/intel_buffer_objects.c +++ b/src/mesa/drivers/dri/intel/intel_buffer_objects.c @@ -26,14 +26,14 @@ **************************************************************************/ -#include "imports.h" -#include "mtypes.h" -#include "bufferobj.h" +#include "main/imports.h" +#include "main/mtypes.h" +#include "main/bufferobj.h" #include "intel_context.h" #include "intel_buffer_objects.h" +#include "intel_batchbuffer.h" #include "intel_regions.h" -#include "dri_bufmgr.h" static GLboolean intel_bufferobj_unmap(GLcontext * ctx, GLenum target, @@ -45,8 +45,7 @@ intel_bufferobj_alloc_buffer(struct intel_context *intel, struct intel_buffer_object *intel_obj) { intel_obj->buffer = dri_bo_alloc(intel->bufmgr, "bufferobj", - intel_obj->Base.Size, 64, - DRM_BO_FLAG_MEM_LOCAL | DRM_BO_FLAG_CACHED | DRM_BO_FLAG_CACHED_MAPPED); + intel_obj->Base.Size, 64); } /** diff --git a/src/mesa/drivers/dri/intel/intel_buffer_objects.h b/src/mesa/drivers/dri/intel/intel_buffer_objects.h index 7cecc3232d..bf6dbd58f2 100644 --- a/src/mesa/drivers/dri/intel/intel_buffer_objects.h +++ b/src/mesa/drivers/dri/intel/intel_buffer_objects.h @@ -28,7 +28,7 @@ #ifndef INTEL_BUFFEROBJ_H #define INTEL_BUFFEROBJ_H -#include "mtypes.h" +#include "main/mtypes.h" struct intel_context; struct intel_region; diff --git a/src/mesa/drivers/dri/intel/intel_buffers.c b/src/mesa/drivers/dri/intel/intel_buffers.c index 75542a9775..defa5b173d 100644 --- a/src/mesa/drivers/dri/intel/intel_buffers.c +++ b/src/mesa/drivers/dri/intel/intel_buffers.c @@ -35,11 +35,11 @@ #include "intel_regions.h" #include "intel_batchbuffer.h" #include "intel_reg.h" -#include "context.h" +#include "main/context.h" +#include "main/framebuffer.h" +#include "swrast/swrast.h" #include "utils.h" #include "drirenderbuffer.h" -#include "framebuffer.h" -#include "swrast/swrast.h" #include "vblank.h" #include "i915_drm.h" @@ -618,6 +618,9 @@ intel_wait_flips(struct intel_context *intel) BUFFER_FRONT_LEFT ? BUFFER_FRONT_LEFT : BUFFER_BACK_LEFT); + if (intel->intelScreen->driScrnPriv->dri2.enabled) + return; + if (intel_fb->Base.Name == 0 && intel_rb && intel_rb->pf_pending == intel_fb->pf_seq) { GLint pf_planes = intel_fb->pf_planes; @@ -819,6 +822,8 @@ intelSwapBuffers(__DRIdrawablePrivate * dPriv) intel_fb->swap_ust = ust; } + drmCommandNone(intel->driFd, DRM_I915_GEM_THROTTLE); + } else { /* XXX this shouldn't be an error but we can't handle it for now */ diff --git a/src/mesa/drivers/dri/intel/intel_bufmgr_ttm.c b/src/mesa/drivers/dri/intel/intel_bufmgr_ttm.c deleted file mode 100644 index 194814e8fb..0000000000 --- a/src/mesa/drivers/dri/intel/intel_bufmgr_ttm.c +++ /dev/null @@ -1,1122 +0,0 @@ -/************************************************************************** - * - * Copyright © 2007 Red Hat Inc. - * Copyright © 2007 Intel Corporation - * 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 <thomas-at-tungstengraphics-dot-com> - * Keith Whitwell <keithw-at-tungstengraphics-dot-com> - * Eric Anholt <eric@anholt.net> - * Dave Airlie <airlied@linux.ie> - */ - -#include <xf86drm.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <unistd.h> -#include <assert.h> - -#include "errno.h" -#include "mtypes.h" -#include "dri_bufmgr.h" -#include "string.h" -#include "imports.h" - -#include "i915_drm.h" - -#include "intel_bufmgr_ttm.h" -#ifdef TTM_API - -#define DBG(...) do { \ - if (bufmgr_ttm->bufmgr.debug) \ - fprintf(stderr, __VA_ARGS__); \ -} while (0) - -/* - * These bits are always specified in each validation - * request. Other bits are not supported at this point - * as it would require a bit of investigation to figure - * out what mask value should be used. - */ -#define INTEL_BO_MASK (DRM_BO_MASK_MEM | \ - DRM_BO_FLAG_READ | \ - DRM_BO_FLAG_WRITE | \ - DRM_BO_FLAG_EXE) - -struct intel_validate_entry { - dri_bo *bo; - struct drm_i915_op_arg bo_arg; -}; - -struct dri_ttm_bo_bucket_entry { - drmBO drm_bo; - struct dri_ttm_bo_bucket_entry *next; -}; - -struct dri_ttm_bo_bucket { - struct dri_ttm_bo_bucket_entry *head; - struct dri_ttm_bo_bucket_entry **tail; - /** - * Limit on the number of entries in this bucket. - * - * 0 means that this caching at this bucket size is disabled. - * -1 means that there is no limit to caching at this size. - */ - int max_entries; - int num_entries; -}; - -/* Arbitrarily chosen, 16 means that the maximum size we'll cache for reuse - * is 1 << 16 pages, or 256MB. - */ -#define INTEL_TTM_BO_BUCKETS 16 -typedef struct _dri_bufmgr_ttm { - dri_bufmgr bufmgr; - - int fd; - unsigned int fence_type; - unsigned int fence_type_flush; - - uint32_t max_relocs; - - struct intel_validate_entry *validate_array; - int validate_array_size; - int validate_count; - - /** Array of lists of cached drmBOs of power-of-two sizes */ - struct dri_ttm_bo_bucket cache_bucket[INTEL_TTM_BO_BUCKETS]; -} dri_bufmgr_ttm; - -/** - * Private information associated with a relocation that isn't already stored - * in the relocation buffer to be passed to the kernel. - */ -struct dri_ttm_reloc { - dri_bo *target_buf; - uint64_t validate_flags; - /** Offset of target_buf after last execution of this relocation entry. */ - unsigned int last_target_offset; -}; - -typedef struct _dri_bo_ttm { - dri_bo bo; - - int refcount; - unsigned int map_count; - drmBO drm_bo; - const char *name; - - uint64_t last_flags; - - /** - * Index of the buffer within the validation list while preparing a - * batchbuffer execution. - */ - int validate_index; - - /** DRM buffer object containing relocation list */ - uint32_t *reloc_buf_data; - struct dri_ttm_reloc *relocs; - - /** - * Indicates that the buffer may be shared with other processes, so we - * can't hold maps beyond when the user does. - */ - GLboolean shared; - - GLboolean delayed_unmap; - /* Virtual address from the dri_bo_map whose unmap was delayed. */ - void *saved_virtual; -} dri_bo_ttm; - -typedef struct _dri_fence_ttm -{ - dri_fence fence; - - int refcount; - const char *name; - drmFence drm_fence; -} dri_fence_ttm; - -static int -logbase2(int n) -{ - GLint i = 1; - GLint log2 = 0; - - while (n > i) { - i *= 2; - log2++; - } - - return log2; -} - -static struct dri_ttm_bo_bucket * -dri_ttm_bo_bucket_for_size(dri_bufmgr_ttm *bufmgr_ttm, unsigned long size) -{ - int i; - - /* We only do buckets in power of two increments */ - if ((size & (size - 1)) != 0) - return NULL; - - /* We should only see sizes rounded to pages. */ - assert((size % 4096) == 0); - - /* We always allocate in units of pages */ - i = ffs(size / 4096) - 1; - if (i >= INTEL_TTM_BO_BUCKETS) - return NULL; - - return &bufmgr_ttm->cache_bucket[i]; -} - - -static void dri_ttm_dump_validation_list(dri_bufmgr_ttm *bufmgr_ttm) -{ - int i, j; - - for (i = 0; i < bufmgr_ttm->validate_count; i++) { - dri_bo *bo = bufmgr_ttm->validate_array[i].bo; - dri_bo_ttm *bo_ttm = (dri_bo_ttm *)bo; - - if (bo_ttm->reloc_buf_data != NULL) { - for (j = 0; j < (bo_ttm->reloc_buf_data[0] & 0xffff); j++) { - uint32_t *reloc_entry = bo_ttm->reloc_buf_data + - I915_RELOC_HEADER + - j * I915_RELOC0_STRIDE; - dri_bo *target_bo = bo_ttm->relocs[j].target_buf; - dri_bo_ttm *target_ttm = (dri_bo_ttm *)target_bo; - - DBG("%2d: %s@0x%08x -> %s@0x%08lx + 0x%08x\n", - i, - bo_ttm->name, reloc_entry[0], - target_ttm->name, target_bo->offset, - reloc_entry[1]); - } - } else { - DBG("%2d: %s\n", i, bo_ttm->name); - } - } -} - -/** - * Adds the given buffer to the list of buffers to be validated (moved into the - * appropriate memory type) with the next batch submission. - * - * If a buffer is validated multiple times in a batch submission, it ends up - * with the intersection of the memory type flags and the union of the - * access flags. - */ -static void -intel_add_validate_buffer(dri_bo *buf, - uint64_t flags) -{ - dri_bufmgr_ttm *bufmgr_ttm = (dri_bufmgr_ttm *)buf->bufmgr; - dri_bo_ttm *ttm_buf = (dri_bo_ttm *)buf; - - /* If we delayed doing an unmap to mitigate map/unmap syscall thrashing, - * do that now. - */ - if (ttm_buf->delayed_unmap) { - drmBOUnmap(bufmgr_ttm->fd, &ttm_buf->drm_bo); - ttm_buf->delayed_unmap = GL_FALSE; - } - - if (ttm_buf->validate_index == -1) { - struct intel_validate_entry *entry; - struct drm_i915_op_arg *arg; - struct drm_bo_op_req *req; - int index; - - /* Extend the array of validation entries as necessary. */ - if (bufmgr_ttm->validate_count == bufmgr_ttm->validate_array_size) { - int i, new_size = bufmgr_ttm->validate_array_size * 2; - - if (new_size == 0) - new_size = 5; - - bufmgr_ttm->validate_array = - realloc(bufmgr_ttm->validate_array, - sizeof(struct intel_validate_entry) * new_size); - bufmgr_ttm->validate_array_size = new_size; - - /* Update pointers for realloced mem. */ - for (i = 0; i < bufmgr_ttm->validate_count - 1; i++) { - bufmgr_ttm->validate_array[i].bo_arg.next = (unsigned long) - &bufmgr_ttm->validate_array[i + 1].bo_arg; - } - } - - /* Pick out the new array entry for ourselves */ - index = bufmgr_ttm->validate_count; - ttm_buf->validate_index = index; - entry = &bufmgr_ttm->validate_array[index]; - bufmgr_ttm->validate_count++; - - /* Fill in array entry */ - entry->bo = buf; - dri_bo_reference(buf); - - /* Fill in kernel arg */ - arg = &entry->bo_arg; - req = &arg->d.req; - - memset(arg, 0, sizeof(*arg)); - req->bo_req.handle = ttm_buf->drm_bo.handle; - req->op = drm_bo_validate; - req->bo_req.flags = flags; - req->bo_req.hint = 0; -#ifdef DRM_BO_HINT_PRESUMED_OFFSET - /* PRESUMED_OFFSET indicates that all relocations pointing at this - * buffer have the correct offset. If any of our relocations don't, - * this flag will be cleared off the buffer later in the relocation - * processing. - */ - req->bo_req.hint |= DRM_BO_HINT_PRESUMED_OFFSET; - req->bo_req.presumed_offset = buf->offset; -#endif - req->bo_req.mask = INTEL_BO_MASK; - req->bo_req.fence_class = 0; /* Backwards compat. */ - - if (ttm_buf->reloc_buf_data != NULL) - arg->reloc_ptr = (unsigned long)(void *)ttm_buf->reloc_buf_data; - else - arg->reloc_ptr = 0; - - /* Hook up the linked list of args for the kernel */ - arg->next = 0; - if (index != 0) { - bufmgr_ttm->validate_array[index - 1].bo_arg.next = - (unsigned long)arg; - } - } else { - struct intel_validate_entry *entry = - &bufmgr_ttm->validate_array[ttm_buf->validate_index]; - struct drm_i915_op_arg *arg = &entry->bo_arg; - struct drm_bo_op_req *req = &arg->d.req; - uint64_t memFlags = req->bo_req.flags & flags & DRM_BO_MASK_MEM; - uint64_t modeFlags = (req->bo_req.flags | flags) & ~DRM_BO_MASK_MEM; - - /* Buffer was already in the validate list. Extend its flags as - * necessary. - */ - - if (memFlags == 0) { - fprintf(stderr, - "%s: No shared memory types between " - "0x%16llx and 0x%16llx\n", - __FUNCTION__, req->bo_req.flags, flags); - abort(); - } - if (flags & ~INTEL_BO_MASK) { - fprintf(stderr, - "%s: Flags bits 0x%16llx are not supposed to be used in a relocation\n", - __FUNCTION__, flags & ~INTEL_BO_MASK); - abort(); - } - req->bo_req.flags = memFlags | modeFlags; - } -} - - -#define RELOC_BUF_SIZE(x) ((I915_RELOC_HEADER + x * I915_RELOC0_STRIDE) * \ - sizeof(uint32_t)) - -static int -intel_setup_reloc_list(dri_bo *bo) -{ - dri_bo_ttm *bo_ttm = (dri_bo_ttm *)bo; - dri_bufmgr_ttm *bufmgr_ttm = (dri_bufmgr_ttm *)bo->bufmgr; - - bo_ttm->relocs = calloc(bufmgr_ttm->max_relocs, - sizeof(struct dri_ttm_reloc)); - bo_ttm->reloc_buf_data = calloc(1, RELOC_BUF_SIZE(bufmgr_ttm->max_relocs)); - - /* Initialize the relocation list with the header: - * DWORD 0: relocation count - * DWORD 1: relocation type - * DWORD 2+3: handle to next relocation list (currently none) 64-bits - */ - bo_ttm->reloc_buf_data[0] = 0; - bo_ttm->reloc_buf_data[1] = I915_RELOC_TYPE_0; - bo_ttm->reloc_buf_data[2] = 0; - bo_ttm->reloc_buf_data[3] = 0; - - return 0; -} - -#if 0 -int -driFenceSignaled(DriFenceObject * fence, unsigned type) -{ - int signaled; - int ret; - - if (fence == NULL) - return GL_TRUE; - - ret = drmFenceSignaled(bufmgr_ttm->fd, &fence->fence, type, &signaled); - BM_CKFATAL(ret); - return signaled; -} -#endif - -static dri_bo * -dri_ttm_alloc(dri_bufmgr *bufmgr, const char *name, - unsigned long size, unsigned int alignment, - uint64_t location_mask) -{ - dri_bufmgr_ttm *bufmgr_ttm = (dri_bufmgr_ttm *)bufmgr; - dri_bo_ttm *ttm_buf; - unsigned int pageSize = getpagesize(); - int ret; - uint64_t flags; - unsigned int hint; - unsigned long alloc_size; - struct dri_ttm_bo_bucket *bucket; - GLboolean alloc_from_cache = GL_FALSE; - - ttm_buf = calloc(1, sizeof(*ttm_buf)); - if (!ttm_buf) - return NULL; - - /* The mask argument doesn't do anything for us that we want other than - * determine which pool (TTM or local) the buffer is allocated into, so - * just pass all of the allocation class flags. - */ - flags = location_mask | DRM_BO_FLAG_READ | DRM_BO_FLAG_WRITE | - DRM_BO_FLAG_EXE; - /* No hints we want to use. */ - hint = 0; - - /* Round the allocated size up to a power of two number of pages. */ - alloc_size = 1 << logbase2(size); - if (alloc_size < pageSize) - alloc_size = pageSize; - bucket = dri_ttm_bo_bucket_for_size(bufmgr_ttm, alloc_size); - - /* If we don't have caching at this size, don't actually round the - * allocation up. - */ - if (bucket == NULL || bucket->max_entries == 0) - alloc_size = size; - - /* Get a buffer out of the cache if available */ - if (bucket != NULL && bucket->num_entries > 0) { - struct dri_ttm_bo_bucket_entry *entry = bucket->head; - int busy; - - /* Check if the buffer is still in flight. If not, reuse it. */ - ret = drmBOBusy(bufmgr_ttm->fd, &entry->drm_bo, &busy); - alloc_from_cache = (ret == 0 && busy == 0); - - if (alloc_from_cache) { - bucket->head = entry->next; - if (entry->next == NULL) - bucket->tail = &bucket->head; - bucket->num_entries--; - - ttm_buf->drm_bo = entry->drm_bo; - free(entry); - } - } - - if (!alloc_from_cache) { - ret = drmBOCreate(bufmgr_ttm->fd, alloc_size, alignment / pageSize, - NULL, flags, hint, &ttm_buf->drm_bo); - if (ret != 0) { - free(ttm_buf); - return NULL; - } - } - - ttm_buf->bo.size = size; - ttm_buf->bo.offset = ttm_buf->drm_bo.offset; - ttm_buf->bo.virtual = NULL; - ttm_buf->bo.bufmgr = bufmgr; - ttm_buf->name = name; - ttm_buf->refcount = 1; - ttm_buf->reloc_buf_data = NULL; - ttm_buf->relocs = NULL; - ttm_buf->last_flags = ttm_buf->drm_bo.flags; - ttm_buf->shared = GL_FALSE; - ttm_buf->delayed_unmap = GL_FALSE; - ttm_buf->validate_index = -1; - - DBG("bo_create: %p (%s) %ldb\n", &ttm_buf->bo, ttm_buf->name, size); - - return &ttm_buf->bo; -} - -/* Our TTM backend doesn't allow creation of static buffers, as that requires - * privelege for the non-fake case, and the lock in the fake case where we were - * working around the X Server not creating buffers and passing handles to us. - */ -static dri_bo * -dri_ttm_alloc_static(dri_bufmgr *bufmgr, const char *name, - unsigned long offset, unsigned long size, void *virtual, - uint64_t location_mask) -{ - return NULL; -} - -/** - * Returns a dri_bo wrapping the given buffer object handle. - * - * This can be used when one application needs to pass a buffer object - * to another. - */ -dri_bo * -intel_ttm_bo_create_from_handle(dri_bufmgr *bufmgr, const char *name, - unsigned int handle) -{ - dri_bufmgr_ttm *bufmgr_ttm = (dri_bufmgr_ttm *)bufmgr; - dri_bo_ttm *ttm_buf; - int ret; - - ttm_buf = calloc(1, sizeof(*ttm_buf)); - if (!ttm_buf) - return NULL; - - ret = drmBOReference(bufmgr_ttm->fd, handle, &ttm_buf->drm_bo); - if (ret != 0) { - fprintf(stderr, "Couldn't reference %s handle 0x%08x: %s\n", - name, handle, strerror(-ret)); - free(ttm_buf); - return NULL; - } - ttm_buf->bo.size = ttm_buf->drm_bo.size; - ttm_buf->bo.offset = ttm_buf->drm_bo.offset; - ttm_buf->bo.virtual = NULL; - ttm_buf->bo.bufmgr = bufmgr; - ttm_buf->name = name; - ttm_buf->refcount = 1; - ttm_buf->reloc_buf_data = NULL; - ttm_buf->relocs = NULL; - ttm_buf->last_flags = ttm_buf->drm_bo.flags; - ttm_buf->shared = GL_TRUE; - ttm_buf->delayed_unmap = GL_FALSE; - ttm_buf->validate_index = -1; - - DBG("bo_create_from_handle: %p %08x (%s)\n", - &ttm_buf->bo, handle, ttm_buf->name); - - return &ttm_buf->bo; -} - -static void -dri_ttm_bo_reference(dri_bo *buf) -{ - dri_bo_ttm *ttm_buf = (dri_bo_ttm *)buf; - - ttm_buf->refcount++; -} - -static void -dri_ttm_bo_unreference(dri_bo *buf) -{ - dri_bufmgr_ttm *bufmgr_ttm = (dri_bufmgr_ttm *)buf->bufmgr; - dri_bo_ttm *ttm_buf = (dri_bo_ttm *)buf; - - if (!buf) - return; - - if (--ttm_buf->refcount == 0) { - struct dri_ttm_bo_bucket *bucket; - int ret; - - assert(ttm_buf->map_count == 0); - - if (ttm_buf->reloc_buf_data) { - int i; - - /* Unreference all the target buffers */ - for (i = 0; i < (ttm_buf->reloc_buf_data[0] & 0xffff); i++) - dri_bo_unreference(ttm_buf->relocs[i].target_buf); - free(ttm_buf->relocs); - - /* Free the kernel BO containing relocation entries */ - free(ttm_buf->reloc_buf_data); - ttm_buf->reloc_buf_data = NULL; - } - - if (ttm_buf->delayed_unmap) { - int ret = drmBOUnmap(bufmgr_ttm->fd, &ttm_buf->drm_bo); - - if (ret != 0) { - fprintf(stderr, "%s:%d: Error unmapping buffer %s: %s.\n", - __FILE__, __LINE__, ttm_buf->name, strerror(-ret)); - } - } - - bucket = dri_ttm_bo_bucket_for_size(bufmgr_ttm, ttm_buf->drm_bo.size); - /* Put the buffer into our internal cache for reuse if we can. */ - if (!ttm_buf->shared && - bucket != NULL && - (bucket->max_entries == -1 || - (bucket->max_entries > 0 && - bucket->num_entries < bucket->max_entries))) - { - struct dri_ttm_bo_bucket_entry *entry; - - entry = calloc(1, sizeof(*entry)); - entry->drm_bo = ttm_buf->drm_bo; - - entry->next = NULL; - *bucket->tail = entry; - bucket->tail = &entry->next; - bucket->num_entries++; - } else { - /* Decrement the kernel refcount for the buffer. */ - ret = drmBOUnreference(bufmgr_ttm->fd, &ttm_buf->drm_bo); - if (ret != 0) { - fprintf(stderr, "drmBOUnreference failed (%s): %s\n", - ttm_buf->name, strerror(-ret)); - } - } - - DBG("bo_unreference final: %p (%s)\n", &ttm_buf->bo, ttm_buf->name); - - free(buf); - return; - } -} - -static int -dri_ttm_bo_map(dri_bo *buf, GLboolean write_enable) -{ - dri_bufmgr_ttm *bufmgr_ttm; - dri_bo_ttm *ttm_buf = (dri_bo_ttm *)buf; - uint64_t flags; - int ret; - - bufmgr_ttm = (dri_bufmgr_ttm *)buf->bufmgr; - - flags = DRM_BO_FLAG_READ; - if (write_enable) - flags |= DRM_BO_FLAG_WRITE; - - /* Allow recursive mapping. Mesa may recursively map buffers with - * nested display loops. - */ - if (ttm_buf->map_count++ != 0) - return 0; - - assert(buf->virtual == NULL); - - DBG("bo_map: %p (%s)\n", &ttm_buf->bo, ttm_buf->name); - - /* XXX: What about if we're upgrading from READ to WRITE? */ - if (ttm_buf->delayed_unmap) { - buf->virtual = ttm_buf->saved_virtual; - return 0; - } - - ret = drmBOMap(bufmgr_ttm->fd, &ttm_buf->drm_bo, flags, 0, &buf->virtual); - if (ret != 0) { - fprintf(stderr, "%s:%d: Error mapping buffer %s: %s .\n", - __FILE__, __LINE__, ttm_buf->name, strerror(-ret)); - } - - return ret; -} - -static int -dri_ttm_bo_unmap(dri_bo *buf) -{ - dri_bufmgr_ttm *bufmgr_ttm; - dri_bo_ttm *ttm_buf = (dri_bo_ttm *)buf; - int ret; - - if (buf == NULL) - return 0; - - assert(ttm_buf->map_count != 0); - if (--ttm_buf->map_count != 0) - return 0; - - bufmgr_ttm = (dri_bufmgr_ttm *)buf->bufmgr; - - assert(buf->virtual != NULL); - - DBG("bo_unmap: %p (%s)\n", &ttm_buf->bo, ttm_buf->name); - - if (!ttm_buf->shared) { - ttm_buf->saved_virtual = buf->virtual; - ttm_buf->delayed_unmap = GL_TRUE; - buf->virtual = NULL; - - return 0; - } - - buf->virtual = NULL; - - ret = drmBOUnmap(bufmgr_ttm->fd, &ttm_buf->drm_bo); - if (ret != 0) { - fprintf(stderr, "%s:%d: Error unmapping buffer %s: %s.\n", - __FILE__, __LINE__, ttm_buf->name, strerror(-ret)); - } - - return ret; -} - -/** - * Returns a dri_bo wrapping the given buffer object handle. - * - * This can be used when one application needs to pass a buffer object - * to another. - */ -dri_fence * -intel_ttm_fence_create_from_arg(dri_bufmgr *bufmgr, const char *name, - drm_fence_arg_t *arg) -{ - dri_bufmgr_ttm *bufmgr_ttm = (dri_bufmgr_ttm *)bufmgr; - dri_fence_ttm *ttm_fence; - - ttm_fence = malloc(sizeof(*ttm_fence)); - if (!ttm_fence) - return NULL; - - ttm_fence->drm_fence.handle = arg->handle; - ttm_fence->drm_fence.fence_class = arg->fence_class; - ttm_fence->drm_fence.type = arg->type; - ttm_fence->drm_fence.flags = arg->flags; - ttm_fence->drm_fence.signaled = 0; - ttm_fence->drm_fence.sequence = arg->sequence; - - ttm_fence->fence.bufmgr = bufmgr; - ttm_fence->name = name; - ttm_fence->refcount = 1; - - DBG("fence_create_from_handle: %p (%s)\n", - &ttm_fence->fence, ttm_fence->name); - - return &ttm_fence->fence; -} - - -static void -dri_ttm_fence_reference(dri_fence *fence) -{ - dri_fence_ttm *fence_ttm = (dri_fence_ttm *)fence; - dri_bufmgr_ttm *bufmgr_ttm = (dri_bufmgr_ttm *)fence->bufmgr; - - ++fence_ttm->refcount; - DBG("fence_reference: %p (%s)\n", &fence_ttm->fence, fence_ttm->name); -} - -static void -dri_ttm_fence_unreference(dri_fence *fence) -{ - dri_fence_ttm *fence_ttm = (dri_fence_ttm *)fence; - dri_bufmgr_ttm *bufmgr_ttm = (dri_bufmgr_ttm *)fence->bufmgr; - - if (!fence) - return; - - DBG("fence_unreference: %p (%s)\n", &fence_ttm->fence, fence_ttm->name); - - if (--fence_ttm->refcount == 0) { - int ret; - - ret = drmFenceUnreference(bufmgr_ttm->fd, &fence_ttm->drm_fence); - if (ret != 0) { - fprintf(stderr, "drmFenceUnreference failed (%s): %s\n", - fence_ttm->name, strerror(-ret)); - } - - free(fence); - return; - } -} - -static void -dri_ttm_fence_wait(dri_fence *fence) -{ - dri_fence_ttm *fence_ttm = (dri_fence_ttm *)fence; - dri_bufmgr_ttm *bufmgr_ttm = (dri_bufmgr_ttm *)fence->bufmgr; - int ret; - - ret = drmFenceWait(bufmgr_ttm->fd, DRM_FENCE_FLAG_WAIT_LAZY, &fence_ttm->drm_fence, 0); - if (ret != 0) { - fprintf(stderr, "%s:%d: Error waiting for fence %s: %s.\n", - __FILE__, __LINE__, fence_ttm->name, strerror(-ret)); - abort(); - } - - DBG("fence_wait: %p (%s)\n", &fence_ttm->fence, fence_ttm->name); -} - -static void -dri_bufmgr_ttm_destroy(dri_bufmgr *bufmgr) -{ - dri_bufmgr_ttm *bufmgr_ttm = (dri_bufmgr_ttm *)bufmgr; - int i; - - free(bufmgr_ttm->validate_array); - - /* Free any cached buffer objects we were going to reuse */ - for (i = 0; i < INTEL_TTM_BO_BUCKETS; i++) { - struct dri_ttm_bo_bucket *bucket = &bufmgr_ttm->cache_bucket[i]; - struct dri_ttm_bo_bucket_entry *entry; - - while ((entry = bucket->head) != NULL) { - int ret; - - bucket->head = entry->next; - if (entry->next == NULL) - bucket->tail = &bucket->head; - bucket->num_entries--; - - /* Decrement the kernel refcount for the buffer. */ - ret = drmBOUnreference(bufmgr_ttm->fd, &entry->drm_bo); - if (ret != 0) { - fprintf(stderr, "drmBOUnreference failed: %s\n", - strerror(-ret)); - } - - free(entry); - } - } - - free(bufmgr); -} - -/** - * Adds the target buffer to the validation list and adds the relocation - * to the reloc_buffer's relocation list. - * - * The relocation entry at the given offset must already contain the - * precomputed relocation value, because the kernel will optimize out - * the relocation entry write when the buffer hasn't moved from the - * last known offset in target_buf. - */ -static int -dri_ttm_emit_reloc(dri_bo *reloc_buf, uint64_t flags, GLuint delta, - GLuint offset, dri_bo *target_buf) -{ - dri_bufmgr_ttm *bufmgr_ttm = (dri_bufmgr_ttm *)reloc_buf->bufmgr; - dri_bo_ttm *reloc_buf_ttm = (dri_bo_ttm *)reloc_buf; - dri_bo_ttm *target_buf_ttm = (dri_bo_ttm *)target_buf; - int num_relocs; - uint32_t *this_reloc; - - /* Create a new relocation list if needed */ - if (reloc_buf_ttm->reloc_buf_data == NULL) - intel_setup_reloc_list(reloc_buf); - - num_relocs = reloc_buf_ttm->reloc_buf_data[0]; - - /* Check overflow */ - assert(num_relocs < bufmgr_ttm->max_relocs); - - this_reloc = reloc_buf_ttm->reloc_buf_data + I915_RELOC_HEADER + - num_relocs * I915_RELOC0_STRIDE; - - this_reloc[0] = offset; - this_reloc[1] = delta; - this_reloc[2] = target_buf_ttm->drm_bo.handle; /* To be filled in at exec time */ - this_reloc[3] = 0; - - reloc_buf_ttm->relocs[num_relocs].validate_flags = flags; - reloc_buf_ttm->relocs[num_relocs].target_buf = target_buf; - dri_bo_reference(target_buf); - - reloc_buf_ttm->reloc_buf_data[0]++; /* Increment relocation count */ - /* Check wraparound */ - assert(reloc_buf_ttm->reloc_buf_data[0] != 0); - return 0; -} - -/** - * Walk the tree of relocations rooted at BO and accumulate the list of - * validations to be performed and update the relocation buffers with - * index values into the validation list. - */ -static void -dri_ttm_bo_process_reloc(dri_bo *bo) -{ - dri_bufmgr_ttm *bufmgr_ttm = (dri_bufmgr_ttm *)bo->bufmgr; - dri_bo_ttm *bo_ttm = (dri_bo_ttm *)bo; - unsigned int nr_relocs; - int i; - - if (bo_ttm->reloc_buf_data == NULL) - return; - - nr_relocs = bo_ttm->reloc_buf_data[0] & 0xffff; - - for (i = 0; i < nr_relocs; i++) { - struct dri_ttm_reloc *r = &bo_ttm->relocs[i]; - - /* Continue walking the tree depth-first. */ - dri_ttm_bo_process_reloc(r->target_buf); - - /* Add the target to the validate list */ - intel_add_validate_buffer(r->target_buf, r->validate_flags); - - /* Clear the PRESUMED_OFFSET flag from the validate list entry of the - * target if this buffer has a stale relocated pointer at it. - */ - if (r->last_target_offset != r->target_buf->offset) { - dri_bo_ttm *target_buf_ttm = (dri_bo_ttm *)r->target_buf; - struct intel_validate_entry *entry = - &bufmgr_ttm->validate_array[target_buf_ttm->validate_index]; - - entry->bo_arg.d.req.bo_req.hint &= ~DRM_BO_HINT_PRESUMED_OFFSET; - } - } -} - -static void * -dri_ttm_process_reloc(dri_bo *batch_buf, GLuint *count) -{ - dri_bufmgr_ttm *bufmgr_ttm = (dri_bufmgr_ttm *)batch_buf->bufmgr; - - /* Update indices and set up the validate list. */ - dri_ttm_bo_process_reloc(batch_buf); - - /* Add the batch buffer to the validation list. There are no relocations - * pointing to it. - */ - intel_add_validate_buffer(batch_buf, - DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_EXE); - - *count = bufmgr_ttm->validate_count; - return &bufmgr_ttm->validate_array[0].bo_arg; -} - -static const char * -intel_get_flags_mem_type_string(uint64_t flags) -{ - switch (flags & DRM_BO_MASK_MEM) { - case DRM_BO_FLAG_MEM_LOCAL: return "local"; - case DRM_BO_FLAG_MEM_TT: return "ttm"; - case DRM_BO_FLAG_MEM_VRAM: return "vram"; - case DRM_BO_FLAG_MEM_PRIV0: return "priv0"; - case DRM_BO_FLAG_MEM_PRIV1: return "priv1"; - case DRM_BO_FLAG_MEM_PRIV2: return "priv2"; - case DRM_BO_FLAG_MEM_PRIV3: return "priv3"; - case DRM_BO_FLAG_MEM_PRIV4: return "priv4"; - default: return NULL; - } -} - -static const char * -intel_get_flags_caching_string(uint64_t flags) -{ - switch (flags & (DRM_BO_FLAG_CACHED | DRM_BO_FLAG_CACHED_MAPPED)) { - case 0: return "UU"; - case DRM_BO_FLAG_CACHED: return "CU"; - case DRM_BO_FLAG_CACHED_MAPPED: return "UC"; - case DRM_BO_FLAG_CACHED | DRM_BO_FLAG_CACHED_MAPPED: return "CC"; - default: return NULL; - } -} - -static void -intel_update_buffer_offsets (dri_bufmgr_ttm *bufmgr_ttm) -{ - int i; - - for (i = 0; i < bufmgr_ttm->validate_count; i++) { - dri_bo *bo = bufmgr_ttm->validate_array[i].bo; - dri_bo_ttm *bo_ttm = (dri_bo_ttm *)bo; - struct drm_i915_op_arg *arg = &bufmgr_ttm->validate_array[i].bo_arg; - struct drm_bo_arg_rep *rep = &arg->d.rep; - - /* Update the flags */ - if (rep->bo_info.flags != bo_ttm->last_flags) { - DBG("BO %s migrated: %s/%s -> %s/%s\n", - bo_ttm->name, - intel_get_flags_mem_type_string(bo_ttm->last_flags), - intel_get_flags_caching_string(bo_ttm->last_flags), - intel_get_flags_mem_type_string(rep->bo_info.flags), - intel_get_flags_caching_string(rep->bo_info.flags)); - - bo_ttm->last_flags = rep->bo_info.flags; - } - /* Update the buffer offset */ - if (rep->bo_info.offset != bo->offset) { - DBG("BO %s migrated: 0x%08lx -> 0x%08lx\n", - bo_ttm->name, bo->offset, (unsigned long)rep->bo_info.offset); - bo->offset = rep->bo_info.offset; - } - } -} - -/** - * Update the last target offset field of relocation entries for PRESUMED_OFFSET - * computation. - */ -static void -dri_ttm_bo_post_submit(dri_bo *bo) -{ - dri_bo_ttm *bo_ttm = (dri_bo_ttm *)bo; - unsigned int nr_relocs; - int i; - - if (bo_ttm->reloc_buf_data == NULL) - return; - - nr_relocs = bo_ttm->reloc_buf_data[0] & 0xffff; - - for (i = 0; i < nr_relocs; i++) { - struct dri_ttm_reloc *r = &bo_ttm->relocs[i]; - - /* Continue walking the tree depth-first. */ - dri_ttm_bo_post_submit(r->target_buf); - - r->last_target_offset = r->target_buf->offset; - } -} - -static void -dri_ttm_post_submit(dri_bo *batch_buf, dri_fence **last_fence) -{ - dri_bufmgr_ttm *bufmgr_ttm = (dri_bufmgr_ttm *)batch_buf->bufmgr; - int i; - - intel_update_buffer_offsets (bufmgr_ttm); - - dri_ttm_bo_post_submit(batch_buf); - - if (bufmgr_ttm->bufmgr.debug) - dri_ttm_dump_validation_list(bufmgr_ttm); - - for (i = 0; i < bufmgr_ttm->validate_count; i++) { - dri_bo *bo = bufmgr_ttm->validate_array[i].bo; - dri_bo_ttm *bo_ttm = (dri_bo_ttm *)bo; - - /* Disconnect the buffer from the validate list */ - bo_ttm->validate_index = -1; - dri_bo_unreference(bo); - bufmgr_ttm->validate_array[i].bo = NULL; - } - bufmgr_ttm->validate_count = 0; -} - -/** - * Enables unlimited caching of buffer objects for reuse. - * - * This is potentially very memory expensive, as the cache at each bucket - * size is only bounded by how many buffers of that size we've managed to have - * in flight at once. - */ -void -intel_ttm_enable_bo_reuse(dri_bufmgr *bufmgr) -{ - dri_bufmgr_ttm *bufmgr_ttm = (dri_bufmgr_ttm *)bufmgr; - int i; - - for (i = 0; i < INTEL_TTM_BO_BUCKETS; i++) { - bufmgr_ttm->cache_bucket[i].max_entries = -1; - } -} - -/* - * - */ -static int -dri_ttm_check_aperture_space(dri_bo *bo) -{ - return 0; -} - -/** - * Initializes the TTM buffer manager, which uses the kernel to allocate, map, - * and manage map buffer objections. - * - * \param fd File descriptor of the opened DRM device. - * \param fence_type Driver-specific fence type used for fences with no flush. - * \param fence_type_flush Driver-specific fence type used for fences with a - * flush. - */ -dri_bufmgr * -intel_bufmgr_ttm_init(int fd, unsigned int fence_type, - unsigned int fence_type_flush, int batch_size) -{ - dri_bufmgr_ttm *bufmgr_ttm; - int i; - - bufmgr_ttm = calloc(1, sizeof(*bufmgr_ttm)); - bufmgr_ttm->fd = fd; - bufmgr_ttm->fence_type = fence_type; - bufmgr_ttm->fence_type_flush = fence_type_flush; - - /* Let's go with one relocation per every 2 dwords (but round down a bit - * since a power of two will mean an extra page allocation for the reloc - * buffer). - * - * Every 4 was too few for the blender benchmark. - */ - bufmgr_ttm->max_relocs = batch_size / sizeof(uint32_t) / 2 - 2; - - bufmgr_ttm->bufmgr.bo_alloc = dri_ttm_alloc; - bufmgr_ttm->bufmgr.bo_alloc_static = dri_ttm_alloc_static; - bufmgr_ttm->bufmgr.bo_reference = dri_ttm_bo_reference; - bufmgr_ttm->bufmgr.bo_unreference = dri_ttm_bo_unreference; - bufmgr_ttm->bufmgr.bo_map = dri_ttm_bo_map; - bufmgr_ttm->bufmgr.bo_unmap = dri_ttm_bo_unmap; - bufmgr_ttm->bufmgr.fence_reference = dri_ttm_fence_reference; - bufmgr_ttm->bufmgr.fence_unreference = dri_ttm_fence_unreference; - bufmgr_ttm->bufmgr.fence_wait = dri_ttm_fence_wait; - bufmgr_ttm->bufmgr.destroy = dri_bufmgr_ttm_destroy; - bufmgr_ttm->bufmgr.emit_reloc = dri_ttm_emit_reloc; - bufmgr_ttm->bufmgr.process_relocs = dri_ttm_process_reloc; - bufmgr_ttm->bufmgr.post_submit = dri_ttm_post_submit; - bufmgr_ttm->bufmgr.debug = GL_FALSE; - bufmgr_ttm->bufmgr.check_aperture_space = dri_ttm_check_aperture_space; - /* Initialize the linked lists for BO reuse cache. */ - for (i = 0; i < INTEL_TTM_BO_BUCKETS; i++) - bufmgr_ttm->cache_bucket[i].tail = &bufmgr_ttm->cache_bucket[i].head; - - return &bufmgr_ttm->bufmgr; -} -#else -dri_bufmgr * -intel_bufmgr_ttm_init(int fd, unsigned int fence_type, - unsigned int fence_type_flush, int batch_size) -{ - return NULL; -} - -dri_bo * -intel_ttm_bo_create_from_handle(dri_bufmgr *bufmgr, const char *name, - unsigned int handle) -{ - return NULL; -} - -void -intel_ttm_enable_bo_reuse(dri_bufmgr *bufmgr) -{ -} -#endif diff --git a/src/mesa/drivers/dri/intel/intel_bufmgr_ttm.h b/src/mesa/drivers/dri/intel/intel_bufmgr_ttm.h deleted file mode 100644 index f5bd64c90f..0000000000 --- a/src/mesa/drivers/dri/intel/intel_bufmgr_ttm.h +++ /dev/null @@ -1,28 +0,0 @@ - -#ifndef INTEL_BUFMGR_TTM_H -#define INTEL_BUFMGR_TTM_H - -#include "dri_bufmgr.h" - -extern dri_bo *intel_ttm_bo_create_from_handle(dri_bufmgr *bufmgr, const char *name, - unsigned int handle); - -#ifdef TTM_API -dri_fence *intel_ttm_fence_create_from_arg(dri_bufmgr *bufmgr, const char *name, - drm_fence_arg_t *arg); -#endif - - -dri_bufmgr *intel_bufmgr_ttm_init(int fd, unsigned int fence_type, - unsigned int fence_type_flush, int batch_size); - -void -intel_ttm_enable_bo_reuse(dri_bufmgr *bufmgr); - -#ifndef TTM_API -#define DRM_I915_FENCE_CLASS_ACCEL 0 -#define DRM_I915_FENCE_TYPE_RW 2 -#define DRM_I915_FENCE_FLAG_FLUSHED 0x01000000 -#endif - -#endif diff --git a/src/mesa/drivers/dri/intel/intel_chipset.h b/src/mesa/drivers/dri/intel/intel_chipset.h index 15b9ef4312..170efd060a 100644 --- a/src/mesa/drivers/dri/intel/intel_chipset.h +++ b/src/mesa/drivers/dri/intel/intel_chipset.h @@ -58,6 +58,7 @@ #define PCI_CHIP_IGD_E_G 0x2E02 #define PCI_CHIP_Q45_G 0x2E12 #define PCI_CHIP_G45_G 0x2E22 +#define PCI_CHIP_G41_G 0x2E32 #define IS_MOBILE(devid) (devid == PCI_CHIP_I855_GM || \ devid == PCI_CHIP_I915_GM || \ @@ -70,7 +71,8 @@ #define IS_GM45_GM(devid) (devid == PCI_CHIP_GM45_GM) #define IS_G4X(devid) (devid == PCI_CHIP_IGD_E_G || \ devid == PCI_CHIP_Q45_G || \ - devid == PCI_CHIP_G45_G) + devid == PCI_CHIP_G45_G || \ + devid == PCI_CHIP_G41_G) #define IS_915(devid) (devid == PCI_CHIP_I915_G || \ devid == PCI_CHIP_E7221_G || \ diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c index f9f0c7444e..ccd74baa7c 100644 --- a/src/mesa/drivers/dri/intel/intel_context.c +++ b/src/mesa/drivers/dri/intel/intel_context.c @@ -26,14 +26,14 @@ **************************************************************************/ -#include "glheader.h" -#include "context.h" -#include "matrix.h" -#include "simple_list.h" -#include "extensions.h" -#include "framebuffer.h" -#include "imports.h" -#include "points.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/matrix.h" +#include "main/simple_list.h" +#include "main/extensions.h" +#include "main/framebuffer.h" +#include "main/imports.h" +#include "main/points.h" #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" @@ -51,7 +51,6 @@ #include "intel_chipset.h" #include "intel_buffers.h" #include "intel_tex.h" -#include "intel_ioctl.h" #include "intel_batchbuffer.h" #include "intel_blit.h" #include "intel_pixel.h" @@ -59,7 +58,7 @@ #include "intel_buffer_objects.h" #include "intel_fbo.h" #include "intel_decode.h" -#include "intel_bufmgr_ttm.h" +#include "intel_bufmgr.h" #include "drirenderbuffer.h" #include "vblank.h" @@ -96,11 +95,13 @@ int INTEL_DEBUG = (0); #include "extension_helper.h" -#define DRIVER_DATE "20061102" +#define DRIVER_DATE "20080716" +#define DRIVER_DATE_GEM "GEM " DRIVER_DATE static const GLubyte * intelGetString(GLcontext * ctx, GLenum name) { + const struct intel_context *const intel = intel_context(ctx); const char *chipset; static char buffer[128]; @@ -110,7 +111,7 @@ intelGetString(GLcontext * ctx, GLenum name) break; case GL_RENDERER: - switch (intel_context(ctx)->intelScreen->deviceID) { + switch (intel->intelScreen->deviceID) { case PCI_CHIP_845_G: chipset = "Intel(R) 845G"; break; @@ -178,12 +179,17 @@ intelGetString(GLcontext * ctx, GLenum name) case PCI_CHIP_Q45_G: chipset = "Intel(R) Q45/Q43"; break; + case PCI_CHIP_G41_G: + chipset = "Intel(R) G41"; + break; default: chipset = "Unknown Intel Chipset"; break; } - (void) driGetRendererString(buffer, chipset, DRIVER_DATE, 0); + (void) driGetRendererString(buffer, chipset, + (intel->ttm) ? DRIVER_DATE_GEM : DRIVER_DATE, + 0); return (GLubyte *) buffer; default: @@ -191,6 +197,146 @@ intelGetString(GLcontext * ctx, GLenum name) } } +void +intel_update_renderbuffers(__DRIcontext *context, __DRIdrawable *drawable) +{ + struct intel_framebuffer *intel_fb = drawable->driverPrivate; + struct intel_renderbuffer *rb; + struct intel_region *region, *depth_region; + struct intel_context *intel = context->driverPrivate; + __DRIbuffer *buffers; + __DRIscreen *screen; + int i, count; + unsigned int attachments[10]; + uint32_t name; + const char *region_name; + + if (INTEL_DEBUG & DEBUG_DRI) + fprintf(stderr, "enter %s, drawable %p\n", __func__, drawable); + + screen = intel->intelScreen->driScrnPriv; + + i = 0; + if (intel_fb->color_rb[0]) + attachments[i++] = __DRI_BUFFER_FRONT_LEFT; + if (intel_fb->color_rb[1]) + attachments[i++] = __DRI_BUFFER_BACK_LEFT; + if (intel_get_renderbuffer(&intel_fb->Base, BUFFER_DEPTH)) + attachments[i++] = __DRI_BUFFER_DEPTH; + if (intel_get_renderbuffer(&intel_fb->Base, BUFFER_STENCIL)) + attachments[i++] = __DRI_BUFFER_STENCIL; + + buffers = (*screen->dri2.loader->getBuffers)(drawable, + &drawable->w, + &drawable->h, + attachments, i, + &count, + drawable->loaderPrivate); + + if (buffers == NULL) + return; + + drawable->x = 0; + drawable->y = 0; + drawable->backX = 0; + drawable->backY = 0; + drawable->numClipRects = 1; + drawable->pClipRects[0].x1 = 0; + drawable->pClipRects[0].y1 = 0; + drawable->pClipRects[0].x2 = drawable->w; + drawable->pClipRects[0].y2 = drawable->h; + drawable->numBackClipRects = 1; + drawable->pBackClipRects[0].x1 = 0; + drawable->pBackClipRects[0].y1 = 0; + drawable->pBackClipRects[0].x2 = drawable->w; + drawable->pBackClipRects[0].y2 = drawable->h; + + depth_region = NULL; + for (i = 0; i < count; i++) { + switch (buffers[i].attachment) { + case __DRI_BUFFER_FRONT_LEFT: + rb = intel_fb->color_rb[0]; + region_name = "dri2 front buffer"; + break; + + case __DRI_BUFFER_BACK_LEFT: + rb = intel_fb->color_rb[1]; + region_name = "dri2 back buffer"; + break; + + case __DRI_BUFFER_DEPTH: + rb = intel_get_renderbuffer(&intel_fb->Base, BUFFER_DEPTH); + region_name = "dri2 depth buffer"; + break; + + case __DRI_BUFFER_STENCIL: + rb = intel_get_renderbuffer(&intel_fb->Base, BUFFER_STENCIL); + region_name = "dri2 stencil buffer"; + break; + + case __DRI_BUFFER_ACCUM: + default: + fprintf(stderr, + "unhandled buffer attach event, attacment type %d\n", + buffers[i].attachment); + return; + } + + if (rb->region) { + dri_bo_flink(rb->region->buffer, &name); + if (name == buffers[i].name) + continue; + } + + if (INTEL_DEBUG & DEBUG_DRI) + fprintf(stderr, + "attaching buffer %d, at %d, cpp %d, pitch %d\n", + buffers[i].name, buffers[i].attachment, + buffers[i].cpp, buffers[i].pitch); + + if (buffers[i].attachment == __DRI_BUFFER_STENCIL && depth_region) { + if (INTEL_DEBUG & DEBUG_DRI) + fprintf(stderr, "(reusing depth buffer as stencil)\n"); + intel_region_reference(®ion, depth_region); + } + else + region = intel_region_alloc_for_handle(intel, buffers[i].cpp, + drawable->w, + drawable->h, + buffers[i].pitch / buffers[i].cpp, + buffers[i].name, + region_name); + + if (buffers[i].attachment == __DRI_BUFFER_DEPTH) + depth_region = region; + + intel_renderbuffer_set_region(rb, region); + intel_region_release(®ion); + } + + driUpdateFramebufferSize(&intel->ctx, drawable); +} + +static void +intel_viewport(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h) +{ + struct intel_context *intel = intel_context(ctx); + __DRIcontext *driContext = intel->driContext; + + if (!driContext->driScreenPriv->dri2.enabled) + return; + + intel_update_renderbuffers(driContext, driContext->driDrawablePriv); + if (driContext->driDrawablePriv != driContext->driReadablePriv) + intel_update_renderbuffers(driContext, driContext->driReadablePriv); + + ctx->Driver.Viewport = NULL; + intel->driDrawable = driContext->driDrawablePriv; + intelWindowMoved(intel); + intel_draw_buffer(ctx, intel->ctx.DrawBuffer); + ctx->Driver.Viewport = intel_viewport; +} + /** * Extension strings exported by the intel driver. * @@ -262,16 +408,19 @@ static const struct dri_extension brw_extensions[] = { { "GL_ARB_fragment_program", NULL }, { "GL_ARB_shadow", NULL }, { "GL_EXT_shadow_funcs", NULL }, + { "GL_ARB_fragment_program_shadow", NULL }, /* ARB extn won't work if not enabled */ { "GL_SGIX_depth_texture", NULL }, { "GL_EXT_texture_sRGB", NULL}, { NULL, NULL } }; +#ifdef I915_MMIO_READ static const struct dri_extension arb_oc_extensions[] = { {"GL_ARB_occlusion_query", GL_ARB_occlusion_query_functions}, {NULL, NULL} }; +#endif static const struct dri_extension ttm_extensions[] = { {"GL_EXT_framebuffer_object", GL_EXT_framebuffer_object_functions}, @@ -296,10 +445,12 @@ void intelInitExtensions(GLcontext *ctx, GLboolean enable_imaging) if (intel == NULL || intel->ttm) driInitExtensions(ctx, ttm_extensions, GL_FALSE); +#ifdef I915_MMIO_READ if (intel == NULL || (IS_965(intel->intelScreen->deviceID) && intel->intelScreen->drmMinor >= 8)) driInitExtensions(ctx, arb_oc_extensions, GL_FALSE); +#endif if (intel == NULL || IS_965(intel->intelScreen->deviceID)) driInitExtensions(ctx, brw_extensions, GL_FALSE); @@ -366,27 +517,40 @@ intelFlush(GLcontext * ctx) if (!IS_965(intel->intelScreen->deviceID)) INTEL_FIREVERTICES(intel); + /* Emit a flush so that any frontbuffer rendering that might have occurred + * lands onscreen in a timely manner, even if the X Server doesn't trigger + * a flush for us. + */ + intel_batchbuffer_emit_mi_flush(intel->batch); + if (intel->batch->map != intel->batch->ptr) intel_batchbuffer_flush(intel->batch); - - /* XXX: Need to do an MI_FLUSH here. - */ } void intelFinish(GLcontext * ctx) { - struct intel_context *intel = intel_context(ctx); + struct gl_framebuffer *fb = ctx->DrawBuffer; + int i; + intelFlush(ctx); - if (intel->batch->last_fence) { - dri_fence_wait(intel->batch->last_fence); - dri_fence_unreference(intel->batch->last_fence); - intel->batch->last_fence = NULL; + + for (i = 0; i < fb->_NumColorDrawBuffers; i++) { + struct intel_renderbuffer *irb; + + irb = intel_renderbuffer(fb->_ColorDrawBuffers[i]); + + if (irb->region) + dri_bo_wait_rendering(irb->region->buffer); + } + if (fb->_DepthBuffer) { + /* XXX: Wait on buffer idle */ } } +#ifdef I915_MMIO_READ static void -intelBeginQuery(GLcontext *ctx, GLenum target, struct gl_query_object *q) +intelBeginQuery(GLcontext *ctx, struct gl_query_object *q) { struct intel_context *intel = intel_context( ctx ); struct drm_i915_mmio io = { @@ -400,7 +564,7 @@ intelBeginQuery(GLcontext *ctx, GLenum target, struct gl_query_object *q) } static void -intelEndQuery(GLcontext *ctx, GLenum target, struct gl_query_object *q) +intelEndQuery(GLcontext *ctx, struct gl_query_object *q) { struct intel_context *intel = intel_context( ctx ); GLuint64EXT tmp; @@ -415,98 +579,7 @@ intelEndQuery(GLcontext *ctx, GLenum target, struct gl_query_object *q) q->Ready = GL_TRUE; intel->stats_wm--; } - -/** Driver-specific fence emit implementation for the fake memory manager. */ -static unsigned int -intel_fence_emit(void *private) -{ - struct intel_context *intel = (struct intel_context *)private; - unsigned int fence; - - /* XXX: Need to emit a flush, if we haven't already (at least with the - * current batchbuffer implementation, we have). - */ - - fence = intelEmitIrqLocked(intel); - - return fence; -} - -/** Driver-specific fence wait implementation for the fake memory manager. */ -static int -intel_fence_wait(void *private, unsigned int cookie) -{ - struct intel_context *intel = (struct intel_context *)private; - - intelWaitIrq(intel, cookie); - - return 0; -} - -static GLboolean -intel_init_bufmgr(struct intel_context *intel) -{ - intelScreenPrivate *intelScreen = intel->intelScreen; - GLboolean ttm_disable = getenv("INTEL_NO_TTM") != NULL; - GLboolean ttm_supported; - - /* If we've got a new enough DDX that's initializing TTM and giving us - * object handles for the shared buffers, use that. - */ - intel->ttm = GL_FALSE; - if (intel->intelScreen->driScrnPriv->dri2.enabled) - ttm_supported = GL_TRUE; - else if (intel->intelScreen->driScrnPriv->ddx_version.minor >= 9 && - intel->intelScreen->drmMinor >= 11 && - intel->intelScreen->front.bo_handle != -1) - ttm_supported = GL_TRUE; - else - ttm_supported = GL_FALSE; - - if (!ttm_disable && ttm_supported) { - int bo_reuse_mode; - intel->bufmgr = intel_bufmgr_ttm_init(intel->driFd, - DRM_FENCE_TYPE_EXE, - DRM_FENCE_TYPE_EXE | - DRM_I915_FENCE_TYPE_RW, - BATCH_SZ); - if (intel->bufmgr != NULL) - intel->ttm = GL_TRUE; - - bo_reuse_mode = driQueryOptioni(&intel->optionCache, "bo_reuse"); - switch (bo_reuse_mode) { - case DRI_CONF_BO_REUSE_DISABLED: - break; - case DRI_CONF_BO_REUSE_ALL: - intel_ttm_enable_bo_reuse(intel->bufmgr); - break; - } - } - /* Otherwise, use the classic buffer manager. */ - 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) { - fprintf(stderr, "[%s:%u] Error initializing buffer manager.\n", - __func__, __LINE__); - return GL_FALSE; - } - - intel->bufmgr = dri_bufmgr_fake_init(intelScreen->tex.offset, - intelScreen->tex.map, - intelScreen->tex.size, - intel_fence_emit, - intel_fence_wait, - intel); - } - - return GL_TRUE; -} +#endif void intelInitDriverFunctions(struct dd_function_table *functions) @@ -517,14 +590,17 @@ intelInitDriverFunctions(struct dd_function_table *functions) functions->Finish = intelFinish; functions->GetString = intelGetString; functions->UpdateState = intelInvalidateState; + functions->Viewport = intel_viewport; functions->CopyColorTable = _swrast_CopyColorTable; functions->CopyColorSubTable = _swrast_CopyColorSubTable; functions->CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D; functions->CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D; +#ifdef I915_MMIO_READ functions->BeginQuery = intelBeginQuery; functions->EndQuery = intelEndQuery; +#endif intelInitTextureFuncs(functions); intelInitStateFuncs(functions); @@ -544,8 +620,6 @@ intelInitContext(struct intel_context *intel, GLcontext *shareCtx = (GLcontext *) sharedContextPrivate; __DRIscreenPrivate *sPriv = driContextPriv->driScreenPriv; intelScreenPrivate *intelScreen = (intelScreenPrivate *) sPriv->private; - volatile struct drm_i915_sarea *saPriv = (struct drm_i915_sarea *) - (((GLubyte *) sPriv->pSAREA) + intelScreen->sarea_priv_offset); int fthrottle_mode; if (!_mesa_initialize_context(&intel->ctx, mesaVis, shareCtx, @@ -557,7 +631,8 @@ intelInitContext(struct intel_context *intel, driContextPriv->driverPrivate = intel; intel->intelScreen = intelScreen; intel->driScreen = sPriv; - intel->sarea = saPriv; + intel->sarea = intelScreen->sarea; + intel->driContext = driContextPriv; /* Dri stuff */ intel->hHWContext = driContextPriv->hHWContext; @@ -575,8 +650,20 @@ intelInitContext(struct intel_context *intel, else intel->maxBatchSize = BATCH_SZ; - if (!intel_init_bufmgr(intel)) - return GL_FALSE; + intel->bufmgr = intelScreen->bufmgr; + intel->ttm = intelScreen->ttm; + if (intel->ttm) { + int bo_reuse_mode; + + bo_reuse_mode = driQueryOptioni(&intel->optionCache, "bo_reuse"); + switch (bo_reuse_mode) { + case DRI_CONF_BO_REUSE_DISABLED: + break; + case DRI_CONF_BO_REUSE_ALL: + intel_bufmgr_gem_enable_reuse(intel->bufmgr); + break; + } + } ctx->Const.MaxTextureMaxAnisotropy = 2.0; @@ -672,8 +759,6 @@ intelInitContext(struct intel_context *intel, intel_recreate_static_regions(intel); intel->batch = intel_batchbuffer_alloc(intel); - intel->last_swap_fence = NULL; - intel->first_swap_fence = NULL; intel_bufferobj_init(intel); intel_fbo_init(intel); @@ -691,7 +776,6 @@ intelInitContext(struct intel_context *intel, /* Force all software fallbacks */ if (driQueryOptionb(&intel->optionCache, "no_rast")) { fprintf(stderr, "disabling 3D rasterization\n"); - FALLBACK(intel, INTEL_FALLBACK_USER, 1); intel->no_rast = 1; } @@ -726,17 +810,12 @@ intelDestroyContext(__DRIcontextPrivate * driContextPriv) intel->Fallback = 0; /* don't call _swrast_Flush later */ intel_batchbuffer_free(intel->batch); + intel->batch = NULL; - if (intel->last_swap_fence) { - dri_fence_wait(intel->last_swap_fence); - dri_fence_unreference(intel->last_swap_fence); - intel->last_swap_fence = NULL; - } - if (intel->first_swap_fence) { - dri_fence_wait(intel->first_swap_fence); - dri_fence_unreference(intel->first_swap_fence); - intel->first_swap_fence = NULL; - } + free(intel->prim.vb); + intel->prim.vb = NULL; + dri_bo_unreference(intel->prim.vb_bo); + intel->prim.vb_bo = NULL; if (release_texture_heaps) { /* This share group is about to go away, free our private @@ -746,10 +825,15 @@ intelDestroyContext(__DRIcontextPrivate * driContextPriv) fprintf(stderr, "do something to free texture heaps\n"); } + intel_region_release(&intel->front_region); + intel_region_release(&intel->back_region); + intel_region_release(&intel->third_region); + intel_region_release(&intel->depth_region); + + driDestroyOptionCache(&intel->optionCache); + /* free the Mesa context */ _mesa_free_context_data(&intel->ctx); - - dri_bufmgr_destroy(intel->bufmgr); } } @@ -772,11 +856,14 @@ intelMakeCurrent(__DRIcontextPrivate * driContextPriv, struct intel_framebuffer *intel_fb = (struct intel_framebuffer *) driDrawPriv->driverPrivate; GLframebuffer *readFb = (GLframebuffer *) driReadPriv->driverPrivate; - - - /* XXX FBO temporary fix-ups! */ - /* if the renderbuffers don't have regions, init them from the context */ - if (!driContextPriv->driScreenPriv->dri2.enabled) { + + if (driContextPriv->driScreenPriv->dri2.enabled) { + intel_update_renderbuffers(driContextPriv, driDrawPriv); + if (driDrawPriv != driReadPriv) + intel_update_renderbuffers(driContextPriv, driReadPriv); + } else { + /* XXX FBO temporary fix-ups! */ + /* if the renderbuffers don't have regions, init them from the context */ struct intel_renderbuffer *irbDepth = intel_get_renderbuffer(&intel_fb->Base, BUFFER_DEPTH); struct intel_renderbuffer *irbStencil @@ -888,7 +975,7 @@ intelContendedLock(struct intel_context *intel, GLuint flags) */ if (!intel->ttm && sarea->texAge != intel->hHWContext) { sarea->texAge = intel->hHWContext; - dri_bufmgr_fake_contended_lock_take(intel->bufmgr); + intel_bufmgr_fake_contended_lock_take(intel->bufmgr); if (INTEL_DEBUG & DEBUG_BATCH) intel_decode_context_reset(); if (INTEL_DEBUG & DEBUG_BUFMGR) @@ -978,18 +1065,12 @@ void LOCK_HARDWARE( struct intel_context *intel ) intel_fb->vbl_waited = vbl.reply.sequence; } - DRM_CAS(intel->driHwLock, intel->hHWContext, - (DRM_LOCK_HELD|intel->hHWContext), __ret); + if (!sPriv->dri2.enabled) { + DRM_CAS(intel->driHwLock, intel->hHWContext, + (DRM_LOCK_HELD|intel->hHWContext), __ret); - if (sPriv->dri2.enabled) { if (__ret) - drmGetLock(intel->driFd, intel->hHWContext, 0); - if (__driParseEvents(dPriv->driContextPriv, dPriv)) { - intelWindowMoved(intel); - intel_draw_buffer(&intel->ctx, intel->ctx.DrawBuffer); - } - } else if (__ret) { - intelContendedLock( intel, 0 ); + intelContendedLock( intel, 0 ); } @@ -1002,10 +1083,13 @@ void LOCK_HARDWARE( struct intel_context *intel ) */ void UNLOCK_HARDWARE( struct intel_context *intel ) { + __DRIscreen *sPriv = intel->driScreen; + intel->vtbl.note_unlock( intel ); intel->locked = 0; - DRM_UNLOCK(intel->driFd, intel->driHwLock, intel->hHWContext); + if (!sPriv->dri2.enabled) + DRM_UNLOCK(intel->driFd, intel->driHwLock, intel->hHWContext); _glthread_UNLOCK_MUTEX(lockMutex); @@ -1016,6 +1100,7 @@ void UNLOCK_HARDWARE( struct intel_context *intel ) * Nothing should be left in batch outside of LOCK/UNLOCK which references * cliprects. */ - assert(intel->batch->cliprect_mode != REFERENCES_CLIPRECTS); + if (intel->batch->cliprect_mode == REFERENCES_CLIPRECTS) + intel_batchbuffer_flush(intel->batch); } diff --git a/src/mesa/drivers/dri/intel/intel_context.h b/src/mesa/drivers/dri/intel/intel_context.h index df79ab8897..554159ac44 100644 --- a/src/mesa/drivers/dri/intel/intel_context.h +++ b/src/mesa/drivers/dri/intel/intel_context.h @@ -30,11 +30,11 @@ -#include "mtypes.h" -#include "drm.h" -#include "mm.h" +#include "main/mtypes.h" +#include "main/mm.h" #include "texmem.h" -#include "dri_bufmgr.h" +#include "drm.h" +#include "intel_bufmgr.h" #include "intel_screen.h" #include "intel_tex_obj.h" @@ -85,6 +85,7 @@ struct intel_context { void (*destroy) (struct intel_context * intel); void (*emit_state) (struct intel_context * intel); + void (*finish_batch) (struct intel_context * intel); void (*new_batch) (struct intel_context * intel); void (*emit_invarient_state) (struct intel_context * intel); void (*note_fence) (struct intel_context *intel, GLuint fence); @@ -174,9 +175,6 @@ struct intel_context */ GLboolean ttm; - dri_fence *last_swap_fence; - dri_fence *first_swap_fence; - struct intel_batchbuffer *batch; GLboolean no_batch_wrap; unsigned batch_id; @@ -184,9 +182,13 @@ struct intel_context struct { GLuint id; - GLuint primitive; - GLubyte *start_ptr; + uint32_t primitive; /**< Current hardware primitive type */ void (*flush) (struct intel_context *); + dri_bo *vb_bo; + uint8_t *vb; + unsigned int start_offset; /**< Byte offset of primitive sequence */ + unsigned int current_offset; /**< Byte offset of next vertex */ + unsigned int count; /**< Number of vertices in current primitive */ } prim; GLuint stats_wm; @@ -224,7 +226,6 @@ struct intel_context GLenum reduced_primitive; GLuint vertex_size; GLubyte *verts; /* points to tnl->clipspace.vertex_buf */ - struct intel_region *draw_region; /* Fallback rasterization functions */ @@ -254,6 +255,7 @@ struct intel_context drmLock *driHwLock; int driFd; + __DRIcontextPrivate *driContext; __DRIdrawablePrivate *driDrawable; __DRIdrawablePrivate *driReadDrawable; __DRIscreenPrivate *driScreen; @@ -291,6 +293,7 @@ extern char *__progname; #define SUBPIXEL_X 0.125 #define SUBPIXEL_Y 0.125 +#define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0])) #define ALIGN(value, alignment) ((value + alignment - 1) & ~(alignment - 1)) #define INTEL_FIREVERTICES(intel) \ @@ -488,6 +491,8 @@ extern int intel_translate_stencil_op(GLenum op); extern int intel_translate_blend_factor(GLenum factor); extern int intel_translate_logic_op(GLenum opcode); +void intel_update_renderbuffers(__DRIcontext *context, + __DRIdrawable *drawable); /*====================================================================== * Inline conversion functions. diff --git a/src/mesa/drivers/dri/intel/intel_decode.c b/src/mesa/drivers/dri/intel/intel_decode.c index a1240639f4..9c105013c0 100644 --- a/src/mesa/drivers/dri/intel/intel_decode.c +++ b/src/mesa/drivers/dri/intel/intel_decode.c @@ -183,9 +183,10 @@ decode_2d(uint32_t *data, int count, uint32_t hw_offset, int *failures) switch ((data[0] & 0x1fc00000) >> 22) { case 0x50: instr_out(data, hw_offset, 0, - "XY_COLOR_BLT (rgb %sabled, alpha %sabled)\n", + "XY_COLOR_BLT (rgb %sabled, alpha %sabled, dst tile %d)\n", (data[0] & (1 << 20)) ? "en" : "dis", - (data[0] & (1 << 21)) ? "en" : "dis"); + (data[0] & (1 << 21)) ? "en" : "dis", + (data[0] >> 11) & 1); len = (data[0] & 0x000000ff) + 2; if (len != 6) @@ -210,7 +211,8 @@ decode_2d(uint32_t *data, int count, uint32_t hw_offset, int *failures) instr_out(data, hw_offset, 1, "format %s, pitch %d, " "clipping %sabled\n", format, - data[1] & 0xffff, data[1] & (1 << 30) ? "en" : "dis"); + (short)(data[1] & 0xffff), + data[1] & (1 << 30) ? "en" : "dis"); instr_out(data, hw_offset, 2, "(%d,%d)\n", data[2] & 0xffff, data[2] >> 16); instr_out(data, hw_offset, 3, "(%d,%d)\n", @@ -220,9 +222,12 @@ decode_2d(uint32_t *data, int count, uint32_t hw_offset, int *failures) return len; case 0x53: instr_out(data, hw_offset, 0, - "XY_SRC_COPY_BLT (rgb %sabled, alpha %sabled)\n", + "XY_SRC_COPY_BLT (rgb %sabled, alpha %sabled, " + "src tile %d, dst tile %d)\n", (data[0] & (1 << 20)) ? "en" : "dis", - (data[0] & (1 << 21)) ? "en" : "dis"); + (data[0] & (1 << 21)) ? "en" : "dis", + (data[0] >> 15) & 1, + (data[0] >> 11) & 1); len = (data[0] & 0x000000ff) + 2; if (len != 8) @@ -247,16 +252,17 @@ decode_2d(uint32_t *data, int count, uint32_t hw_offset, int *failures) instr_out(data, hw_offset, 1, "format %s, dst pitch %d, " "clipping %sabled\n", format, - data[1] & 0xffff, data[1] & (1 << 30) ? "en" : "dis"); + (short)(data[1] & 0xffff), + data[1] & (1 << 30) ? "en" : "dis"); instr_out(data, hw_offset, 2, "dst (%d,%d)\n", data[2] & 0xffff, data[2] >> 16); instr_out(data, hw_offset, 3, "dst (%d,%d)\n", - data[2] & 0xffff, data[2] >> 16); + data[3] & 0xffff, data[3] >> 16); instr_out(data, hw_offset, 4, "dst offset 0x%08x\n", data[4]); instr_out(data, hw_offset, 5, "src (%d,%d)\n", data[5] & 0xffff, data[5] >> 16); instr_out(data, hw_offset, 6, "src pitch %d\n", - data[6] & 0xffff); + (short)(data[6] & 0xffff)); instr_out(data, hw_offset, 7, "src offset 0x%08x\n", data[7]); return len; } diff --git a/src/mesa/drivers/dri/intel/intel_depthstencil.c b/src/mesa/drivers/dri/intel/intel_depthstencil.c index 90baecd8c2..c2b4d7728b 100644 --- a/src/mesa/drivers/dri/intel/intel_depthstencil.c +++ b/src/mesa/drivers/dri/intel/intel_depthstencil.c @@ -25,21 +25,21 @@ * **************************************************************************/ -#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 "main/glheader.h" +#include "main/imports.h" +#include "main/context.h" +#include "main/depthstencil.h" +#include "main/fbobject.h" +#include "main/framebuffer.h" +#include "main/hash.h" +#include "main/mtypes.h" +#include "main/renderbuffer.h" #include "intel_context.h" #include "intel_fbo.h" #include "intel_depthstencil.h" #include "intel_regions.h" - +#include "intel_span.h" /** * The GL_EXT_framebuffer_object allows the user to create their own @@ -86,68 +86,33 @@ * */ - - -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, depthRb->region); - depthRb->pfMap = depthRb->region->map; - depthRb->pfPitch = depthRb->region->pitch; - } - if (stencilRb && stencilRb->region) { - intel_region_map(intel, 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, depthRb->region); - depthRb->pfMap = NULL; - depthRb->pfPitch = 0; - } - if (stencilRb && stencilRb->region) { - intel_region_unmap(intel, 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) +intel_unpair_depth_stencil(GLcontext *ctx, struct intel_renderbuffer *irb) { + struct intel_context *intel = intel_context(ctx); + struct gl_renderbuffer *rb = &irb->Base; + 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); + ASSERT(rb->_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); + ASSERT(stencilIrb->PairedDepth == rb->Name); + intel_renderbuffer_map(intel, rb); + intel_renderbuffer_map(intel, stencilRb); + _mesa_extract_stencil(ctx, rb, stencilRb); + intel_renderbuffer_unmap(intel, stencilRb); + intel_renderbuffer_unmap(intel, rb); stencilIrb->PairedDepth = 0; } irb->PairedStencil = 0; @@ -157,17 +122,19 @@ intel_unpair_depth_stencil(GLcontext * ctx, struct intel_renderbuffer *irb) struct gl_renderbuffer *depthRb; struct intel_renderbuffer *depthIrb; - ASSERT(irb->Base._ActualFormat == GL_STENCIL_INDEX8_EXT || - irb->Base._ActualFormat == GL_DEPTH24_STENCIL8_EXT); + ASSERT(rb->_ActualFormat == GL_STENCIL_INDEX8_EXT || + rb->_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); + ASSERT(depthIrb->PairedStencil == rb->Name); + intel_renderbuffer_map(intel, rb); + intel_renderbuffer_map(intel, depthRb); + _mesa_extract_stencil(ctx, depthRb, rb); + intel_renderbuffer_unmap(intel, depthRb); + intel_renderbuffer_unmap(intel, rb); depthIrb->PairedStencil = 0; } irb->PairedDepth = 0; @@ -194,6 +161,7 @@ void intel_validate_paired_depth_stencil(GLcontext * ctx, struct gl_framebuffer *fb) { + struct intel_context *intel = intel_context(ctx); struct intel_renderbuffer *depthRb, *stencilRb; depthRb = intel_get_renderbuffer(fb, BUFFER_DEPTH); @@ -230,9 +198,11 @@ intel_validate_paired_depth_stencil(GLcontext * ctx, stencilRb->Base._ActualFormat == GL_DEPTH24_STENCIL8_EXT); /* establish new pairing: interleave stencil into depth buffer */ - map_regions(ctx, depthRb, stencilRb); + intel_renderbuffer_map(intel, &depthRb->Base); + intel_renderbuffer_map(intel, &stencilRb->Base); _mesa_insert_stencil(ctx, &depthRb->Base, &stencilRb->Base); - unmap_regions(ctx, depthRb, stencilRb); + intel_renderbuffer_unmap(intel, &stencilRb->Base); + intel_renderbuffer_unmap(intel, &depthRb->Base); depthRb->PairedStencil = stencilRb->Base.Name; stencilRb->PairedDepth = depthRb->Base.Name; } diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c index b3f6610546..fce5e36b9d 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.c +++ b/src/mesa/drivers/dri/intel/intel_fbo.c @@ -26,14 +26,14 @@ **************************************************************************/ -#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 "main/imports.h" +#include "main/mtypes.h" +#include "main/fbobject.h" +#include "main/framebuffer.h" +#include "main/renderbuffer.h" +#include "main/context.h" +#include "main/texformat.h" +#include "main/texrender.h" #include "intel_context.h" #include "intel_buffers.h" @@ -153,6 +153,9 @@ intel_delete_renderbuffer(struct gl_renderbuffer *rb) intel_unpair_depth_stencil(ctx, irb); } + if (irb->span_cache != NULL) + _mesa_free(irb->span_cache); + if (intel && irb->region) { intel_region_release(&irb->region); } @@ -209,6 +212,14 @@ intel_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb, case GL_RGB10: case GL_RGB12: case GL_RGB16: + rb->_ActualFormat = GL_RGB8; + rb->DataType = GL_UNSIGNED_BYTE; + rb->RedBits = 8; + rb->GreenBits = 8; + rb->BlueBits = 8; + rb->AlphaBits = 0; + cpp = 4; + break; case GL_RGBA: case GL_RGBA2: case GL_RGBA4: @@ -285,7 +296,7 @@ intel_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb, DBG("Allocating %d x %d Intel RBO (pitch %d)\n", width, height, pitch); - irb->region = intel_region_alloc(intel, cpp, pitch, height); + irb->region = intel_region_alloc(intel, cpp, width, height, pitch); if (!irb->region) return GL_FALSE; /* out of memory? */ @@ -294,9 +305,6 @@ intel_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb, rb->Width = width; rb->Height = height; - /* This sets the Get/PutRow/Value functions */ - intel_set_span_functions(&irb->Base); - return GL_TRUE; } } @@ -366,7 +374,6 @@ intel_renderbuffer_set_region(struct intel_renderbuffer *rb, intel_region_reference(&rb->region, region); intel_region_release(&old); - rb->pfMap = region->map; rb->pfPitch = region->pitch; } @@ -446,8 +453,6 @@ intel_create_renderbuffer(GLenum intFormat) 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); return irb; } @@ -519,7 +524,7 @@ intel_framebuffer_renderbuffer(GLcontext * ctx, static GLboolean intel_update_wrapper(GLcontext *ctx, struct intel_renderbuffer *irb, - struct gl_texture_image *texImage) + struct gl_texture_image *texImage) { if (texImage->TexFormat == &_mesa_texformat_argb8888) { irb->Base._ActualFormat = GL_RGBA8; @@ -535,7 +540,7 @@ intel_update_wrapper(GLcontext *ctx, struct intel_renderbuffer *irb, irb->Base._ActualFormat = GL_DEPTH_COMPONENT16; irb->Base._BaseFormat = GL_DEPTH_COMPONENT; DBG("Render to DEPTH16 texture OK\n"); - } else if (texImage->TexFormat == &_mesa_texformat_z24_s8) { + } else if (texImage->TexFormat == &_mesa_texformat_s8_z24) { irb->Base._ActualFormat = GL_DEPTH24_STENCIL8_EXT; irb->Base._BaseFormat = GL_DEPTH_STENCIL_EXT; DBG("Render to DEPTH_STENCIL texture OK\n"); @@ -558,7 +563,6 @@ intel_update_wrapper(GLcontext *ctx, struct intel_renderbuffer *irb, irb->Base.Delete = intel_delete_renderbuffer; irb->Base.AllocStorage = intel_nop_alloc_storage; - intel_set_span_functions(&irb->Base); irb->RenderToTexture = GL_TRUE; diff --git a/src/mesa/drivers/dri/intel/intel_fbo.h b/src/mesa/drivers/dri/intel/intel_fbo.h index c90c84b48c..9d15582d78 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.h +++ b/src/mesa/drivers/dri/intel/intel_fbo.h @@ -28,9 +28,9 @@ #ifndef INTEL_FBO_H #define INTEL_FBO_H +#include "intel_screen.h" struct intel_context; -struct intel_region; /** * Intel framebuffer, derived from gl_framebuffer. @@ -70,7 +70,6 @@ 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? */ @@ -80,6 +79,9 @@ struct intel_renderbuffer GLuint pf_pending; /**< sequence number of pending flip */ GLuint vbl_pending; /**< vblank sequence number of pending flip */ + + uint8_t *span_cache; + unsigned long span_cache_offset; }; extern struct intel_renderbuffer *intel_renderbuffer(struct gl_renderbuffer diff --git a/src/mesa/drivers/dri/intel/intel_ioctl.c b/src/mesa/drivers/dri/intel/intel_ioctl.c deleted file mode 100644 index f4566ba89c..0000000000 --- a/src/mesa/drivers/dri/intel/intel_ioctl.c +++ /dev/null @@ -1,223 +0,0 @@ -/************************************************************************** - * - * 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 <stdio.h> -#include <unistd.h> -#include <errno.h> -#include <sched.h> - -#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" -#include "i915_drm.h" - -#include "intel_bufmgr_ttm.h" - -#define FILE_DEBUG_FLAG DEBUG_IOCTL - -int -intelEmitIrqLocked(struct intel_context *intel) -{ - struct drm_i915_irq_emit ie; - int ret, seq = 1; - - if (intel->no_hw) - return 1; - - /* - assert(((*(int *)intel->driHwLock) & ~DRM_LOCK_CONT) == - (DRM_LOCK_HELD|intel->hHWContext)); - */ - - ie.irq_seq = &seq; - - ret = drmCommandWriteRead(intel->driFd, DRM_I915_IRQ_EMIT, &ie, sizeof(ie)); - if (ret) { - fprintf(stderr, "%s: drm_i915_irq_emit: %d\n", __FUNCTION__, ret); - exit(1); - } - - DBG("%s --> %d\n", __FUNCTION__, seq); - - return seq; -} - -void -intelWaitIrq(struct intel_context *intel, int seq) -{ - struct drm_i915_irq_wait iw; - int ret, lastdispatch; - volatile struct drm_i915_sarea *sarea = intel->sarea; - - if (intel->no_hw) - return; - - DBG("%s %d\n", __FUNCTION__, seq); - - iw.irq_seq = seq; - - do { - lastdispatch = sarea->last_dispatch; - ret = drmCommandWrite(intel->driFd, DRM_I915_IRQ_WAIT, &iw, sizeof(iw)); - } while (ret == -EAGAIN || - ret == -EINTR || - (ret == -EBUSY && lastdispatch != sarea->last_dispatch) || - (ret == 0 && seq > sarea->last_dispatch) || - (ret == 0 && sarea->last_dispatch - seq >= (1 << 24))); - - if (ret) { - fprintf(stderr, "%s: drm_i915_irq_wait: %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) -{ - struct drm_i915_batchbuffer batch; - - if (intel->no_hw) - return; - - 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_I915_BATCHBUFFER, &batch, - sizeof(batch))) { - fprintf(stderr, "DRM_I915_BATCHBUFFER: %d\n", -errno); - UNLOCK_HARDWARE(intel); - exit(1); - } -} - -#ifdef TTM_API -void -intel_exec_ioctl(struct intel_context *intel, - GLuint used, - GLboolean ignore_cliprects, GLboolean allow_unlock, - void *start, GLuint count, dri_fence **fence) -{ - struct drm_i915_execbuffer execbuf; - dri_fence *fo; - int ret; - - assert(intel->locked); - assert(used); - - if (intel->no_hw) - return; - - if (*fence) { - dri_fence_unreference(*fence); - } - - memset(&execbuf, 0, sizeof(execbuf)); - - execbuf.num_buffers = count; - execbuf.batch.used = used; - execbuf.batch.cliprects = intel->pClipRects; - execbuf.batch.num_cliprects = ignore_cliprects ? 0 : intel->numClipRects; - execbuf.batch.DR1 = 0; - execbuf.batch.DR4 = ((((GLuint) intel->drawX) & 0xffff) | - (((GLuint) intel->drawY) << 16)); - - execbuf.ops_list = (unsigned long)start; // TODO - execbuf.fence_arg.flags = DRM_FENCE_FLAG_SHAREABLE | DRM_I915_FENCE_FLAG_FLUSHED; - - do { - ret = drmCommandWriteRead(intel->driFd, DRM_I915_EXECBUFFER, &execbuf, - sizeof(execbuf)); - } while (ret == -EAGAIN); - - if (ret != 0) { - fprintf(stderr, "DRM_I915_EXECBUFFER: %d\n", -errno); - UNLOCK_HARDWARE(intel); - exit(1); - } - - if (execbuf.fence_arg.error != 0) { - - /* - * Fence creation has failed, but the GPU has been - * idled by the kernel. Safe to continue. - */ - - *fence = NULL; - return; - } - - fo = intel_ttm_fence_create_from_arg(intel->bufmgr, "fence buffers", - &execbuf.fence_arg); - if (!fo) { - fprintf(stderr, "failed to fence handle: %08x\n", execbuf.fence_arg.handle); - UNLOCK_HARDWARE(intel); - exit(1); - } - *fence = fo; -} -#else -void -intel_exec_ioctl(struct intel_context *intel, - GLuint used, - GLboolean ignore_cliprects, GLboolean allow_unlock, - void *start, GLuint count, dri_fence **fence) -{ -} -#endif diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c index 1b645c7262..b96ba72853 100644 --- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c +++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c @@ -29,7 +29,7 @@ #include "intel_mipmap_tree.h" #include "intel_regions.h" #include "intel_chipset.h" -#include "enums.h" +#include "main/enums.h" #define FILE_DEBUG_FLAG DEBUG_MIPTREE @@ -117,7 +117,10 @@ intel_miptree_create(struct intel_context *intel, return NULL; mt->region = intel_region_alloc(intel, - mt->cpp, mt->pitch, mt->total_height); + mt->cpp, + mt->pitch, + mt->total_height, + mt->pitch); if (!mt->region) { free(mt); @@ -141,7 +144,7 @@ intel_miptree_create_for_region(struct intel_context *intel, mt = intel_miptree_create_internal(intel, target, internal_format, first_level, last_level, - region->pitch, region->height, depth0, + region->width, region->height, 1, region->cpp, compress_byte); if (!mt) return mt; @@ -442,7 +445,7 @@ intel_miptree_image_data(struct intel_context *intel, height = (height + 3) / 4; intel_region_data(intel, dst->region, - dst_offset + dst_depth_offset[i] * dst->cpp, /* dst_offset */ + dst_offset + dst_depth_offset[i], /* dst_offset */ 0, 0, /* dstx, dsty */ src, src_row_pitch, @@ -479,10 +482,10 @@ intel_miptree_image_copy(struct intel_context *intel, for (i = 0; i < depth; i++) { intel_region_copy(intel, - dst->region, dst_offset + dst_depth_offset[i] * dst->cpp, + dst->region, dst_offset + dst_depth_offset[i], 0, 0, - src->region, src_offset + src_depth_offset[i] * src->cpp, + src->region, src_offset + src_depth_offset[i], 0, 0, width, height); } diff --git a/src/mesa/drivers/dri/intel/intel_pixel.c b/src/mesa/drivers/dri/intel/intel_pixel.c index 6417866b20..f39fac13cf 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel.c +++ b/src/mesa/drivers/dri/intel/intel_pixel.c @@ -25,8 +25,8 @@ * **************************************************************************/ -#include "enums.h" -#include "state.h" +#include "main/enums.h" +#include "main/state.h" #include "swrast/swrast.h" #include "intel_context.h" diff --git a/src/mesa/drivers/dri/intel/intel_pixel.h b/src/mesa/drivers/dri/intel/intel_pixel.h index 9c899b954c..6fa6effe83 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel.h +++ b/src/mesa/drivers/dri/intel/intel_pixel.h @@ -28,7 +28,7 @@ #ifndef INTEL_PIXEL_H #define INTEL_PIXEL_H -#include "mtypes.h" +#include "main/mtypes.h" void intelInitPixelFuncs(struct dd_function_table *functions); diff --git a/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c b/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c index 81238acfe4..8963519893 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c +++ b/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c @@ -25,25 +25,24 @@ * **************************************************************************/ -#include "glheader.h" -#include "enums.h" -#include "image.h" -#include "colormac.h" -#include "mtypes.h" -#include "macros.h" -#include "bufferobj.h" +#include "main/glheader.h" +#include "main/enums.h" +#include "main/image.h" +#include "main/colormac.h" +#include "main/mtypes.h" +#include "main/macros.h" +#include "main/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" #include "intel_buffers.h" #include "intel_pixel.h" - +#include "intel_reg.h" #define FILE_DEBUG_FLAG DEBUG_PIXEL @@ -293,7 +292,7 @@ do_blit_bitmap( GLcontext *ctx, dst->pitch, dst->buffer, 0, - dst->tiled, + dst->tiling, rect.x1 + px, rect.y2 - (py + h), w, h, @@ -301,9 +300,8 @@ do_blit_bitmap( GLcontext *ctx, } } } - out: - intel_batchbuffer_flush(intel->batch); } +out: UNLOCK_HARDWARE(intel); diff --git a/src/mesa/drivers/dri/intel/intel_pixel_copy.c b/src/mesa/drivers/dri/intel/intel_pixel_copy.c index 45f72bac52..1b3cb5adcb 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel_copy.c +++ b/src/mesa/drivers/dri/intel/intel_pixel_copy.c @@ -25,17 +25,16 @@ * **************************************************************************/ -#include "glheader.h" -#include "enums.h" -#include "image.h" -#include "state.h" -#include "mtypes.h" -#include "macros.h" +#include "main/glheader.h" +#include "main/enums.h" +#include "main/image.h" +#include "main/state.h" +#include "main/mtypes.h" +#include "main/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" @@ -136,10 +135,20 @@ do_texture_copypixels(GLcontext * ctx, 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; + if (ctx->Pixel.ZoomX > 0) { + dstbox.x1 = dstx; + dstbox.x2 = dstx + width * ctx->Pixel.ZoomX; + } else { + dstbox.x1 = dstx + width * ctx->Pixel.ZoomX; + dstbox.x2 = dstx; + } + if (ctx->Pixel.ZoomY > 0) { + dstbox.y1 = dsty; + dstbox.y2 = dsty + height * ctx->Pixel.ZoomY; + } else { + dstbox.y1 = dsty + height * ctx->Pixel.ZoomY; + dstbox.y2 = dsty; + } 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, @@ -229,7 +238,7 @@ do_texture_copypixels(GLcontext * ctx, out: intel->vtbl.leave_meta_state(intel); - intel_batchbuffer_flush(intel->batch); + intel_batchbuffer_emit_mi_flush(intel->batch); } UNLOCK_HARDWARE(intel); @@ -337,18 +346,16 @@ do_blit_copypixels(GLcontext * ctx, continue; intelEmitCopyBlit(intel, dst->cpp, - src->pitch, src->buffer, 0, src->tiled, - dst->pitch, dst->buffer, 0, dst->tiled, + src->pitch, src->buffer, 0, src->tiling, + dst->pitch, dst->buffer, 0, dst->tiling, clip_x + delta_x, clip_y + delta_y, /* srcx, srcy */ clip_x, clip_y, /* dstx, dsty */ clip_w, clip_h, ctx->Color.ColorLogicOpEnabled ? ctx->Color.LogicOp : GL_COPY); } - - out: - intel_batchbuffer_flush(intel->batch); } +out: UNLOCK_HARDWARE(intel); DBG("%s: success\n", __FUNCTION__); diff --git a/src/mesa/drivers/dri/intel/intel_pixel_draw.c b/src/mesa/drivers/dri/intel/intel_pixel_draw.c index 34813d2aa0..be213e7b96 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel_draw.c +++ b/src/mesa/drivers/dri/intel/intel_pixel_draw.c @@ -25,17 +25,26 @@ * **************************************************************************/ -#include "glheader.h" -#include "enums.h" -#include "image.h" -#include "mtypes.h" -#include "macros.h" -#include "bufferobj.h" +#include "main/glheader.h" +#include "main/enums.h" +#include "main/image.h" +#include "main/mtypes.h" +#include "main/macros.h" +#include "main/bufferobj.h" +#include "main/teximage.h" +#include "main/texenv.h" +#include "main/texobj.h" +#include "main/texstate.h" +#include "main/texparam.h" +#include "main/matrix.h" +#include "main/varray.h" +#include "main/attrib.h" +#include "main/enable.h" +#include "glapi/dispatch.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" @@ -45,302 +54,123 @@ #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) +intel_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); - - if (!dst) - return GL_FALSE; - - intel->vtbl.render_start(intel); - intel->vtbl.emit_state(intel); - - 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; - } + GLuint texname; + GLfloat vertices[4][4]; + GLfloat texcoords[4][2]; - /* 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. + /* We're going to mess with texturing with no regard to existing texture + * state, so if there is some set up we have to bail. */ - 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__); + if (ctx->Texture._EnabledUnits != 0) 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->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. + /* Can't do textured DrawPixels with a fragment program, unless we were + * to generate a new program that sampled our texture and put the results + * in the fragment color before the user's program started. */ - 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->vtbl.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; - dri_fence *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__); + if (ctx->FragmentProgram.Enabled) 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__); + /* Don't even want to think about it */ + if (format == GL_COLOR_INDEX) return GL_FALSE; - } - if (!intel_check_blit_fragment_ops(ctx, GL_FALSE)) { - if (INTEL_DEBUG & DEBUG_PIXEL) - _mesa_printf("%s - bad GL fragment state for blitter\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__); + /* We don't have a way to generate fragments with stencil values which * + * will set the resulting stencil value. + */ + if (format == GL_STENCIL_INDEX) 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__); + /* To do DEPTH_COMPONENT, we would need to change our setup to not draw to + * the color buffer, and sample the texture values into the fragment depth + * in a program. + */ + if (format == GL_DEPTH_COMPONENT) 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; - dri_bo *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, GL_FALSE, - dest->pitch, dest->buffer, 0, dest->tiled, - rect.x1 - dest_rect.x1, - rect.y2 - dest_rect.y2, - rect.x1, - rect.y1, rect.x2 - rect.x1, rect.y2 - rect.y1, - ctx->Color.ColorLogicOpEnabled ? - ctx->Color.LogicOp : GL_COPY); - } - intel_batchbuffer_flush(intel->batch); - fence = intel->batch->last_fence; - dri_fence_reference(fence); - } - UNLOCK_HARDWARE(intel); - - if (fence) { - dri_fence_wait(fence); - dri_fence_unreference(fence); - } - - if (INTEL_DEBUG & DEBUG_PIXEL) - _mesa_printf("%s - DONE\n", __FUNCTION__); + _mesa_PushAttrib(GL_ENABLE_BIT | GL_TRANSFORM_BIT | GL_TEXTURE_BIT | + GL_CURRENT_BIT); + _mesa_PushClientAttrib(GL_CLIENT_VERTEX_ARRAY_BIT); + + /* XXX: pixel store stuff */ + _mesa_Disable(GL_POLYGON_STIPPLE); + + _mesa_ActiveTextureARB(GL_TEXTURE0_ARB); + _mesa_Enable(GL_TEXTURE_2D); + _mesa_GenTextures(1, &texname); + _mesa_BindTexture(GL_TEXTURE_2D, texname); + _mesa_TexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + _mesa_TexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + _mesa_TexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); + /* + _mesa_TexEnvf(GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_REPLACE); + _mesa_TexEnvf(GL_TEXTURE_ENV, GL_COMBINE_ALPHA, GL_REPLACE); + */ + _mesa_TexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, format, + type, pixels); + + _mesa_MatrixMode(GL_PROJECTION); + _mesa_PushMatrix(); + _mesa_LoadIdentity(); + _mesa_Ortho(0, ctx->DrawBuffer->Width, 0, ctx->DrawBuffer->Height, 1, -1); + + _mesa_MatrixMode(GL_MODELVIEW); + _mesa_PushMatrix(); + _mesa_LoadIdentity(); + + vertices[0][0] = x; + vertices[0][1] = y; + vertices[0][2] = ctx->Current.RasterPos[2]; + vertices[0][3] = ctx->Current.RasterPos[3]; + vertices[1][0] = x + width * ctx->Pixel.ZoomX; + vertices[1][1] = y; + vertices[1][2] = ctx->Current.RasterPos[2]; + vertices[1][3] = ctx->Current.RasterPos[3]; + vertices[2][0] = x + width * ctx->Pixel.ZoomX; + vertices[2][1] = y + height * ctx->Pixel.ZoomY; + vertices[2][2] = ctx->Current.RasterPos[2]; + vertices[2][3] = ctx->Current.RasterPos[3]; + vertices[3][0] = x; + vertices[3][1] = y + height * ctx->Pixel.ZoomY; + vertices[3][2] = ctx->Current.RasterPos[2]; + vertices[3][3] = ctx->Current.RasterPos[3]; + + texcoords[0][0] = 0.0; + texcoords[0][1] = 0.0; + texcoords[1][0] = 1.0; + texcoords[1][1] = 0.0; + texcoords[2][0] = 1.0; + texcoords[2][1] = 1.0; + texcoords[3][0] = 0.0; + texcoords[3][1] = 1.0; + + _mesa_VertexPointer(4, GL_FLOAT, 4 * sizeof(GLfloat), &vertices); + _mesa_TexCoordPointer(2, GL_FLOAT, 2 * sizeof(GLfloat), &texcoords); + _mesa_Enable(GL_VERTEX_ARRAY); + _mesa_Enable(GL_TEXTURE_COORD_ARRAY); + CALL_DrawArrays(ctx->Exec, (GL_TRIANGLE_FAN, 0, 4)); + + _mesa_MatrixMode(GL_PROJECTION); + _mesa_PopMatrix(); + _mesa_MatrixMode(GL_MODELVIEW); + _mesa_PopMatrix(); + _mesa_PopClientAttrib(); + _mesa_PopAttrib(); + + _mesa_DeleteTextures(1, &texname); return GL_TRUE; } - - void intelDrawPixels(GLcontext * ctx, GLint x, GLint y, @@ -350,15 +180,10 @@ intelDrawPixels(GLcontext * ctx, const struct gl_pixelstore_attrib *unpack, const GLvoid * pixels) { - if (do_blit_drawpixels(ctx, x, y, width, height, format, type, - unpack, pixels)) + if (intel_texture_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__); diff --git a/src/mesa/drivers/dri/intel/intel_reg.h b/src/mesa/drivers/dri/intel/intel_reg.h index 37629c07e2..96af7e1a03 100644 --- a/src/mesa/drivers/dri/intel/intel_reg.h +++ b/src/mesa/drivers/dri/intel/intel_reg.h @@ -31,11 +31,140 @@ #define MI_BATCH_BUFFER_END (CMD_MI | 0xA << 23) +#define MI_FLUSH (CMD_MI | (4 << 23)) +#define FLUSH_MAP_CACHE (1 << 0) +#define INHIBIT_FLUSH_RENDER_CACHE (1 << 2) + /* Stalls command execution waiting for the given events to have occurred. */ #define MI_WAIT_FOR_EVENT (CMD_MI | (0x3 << 23)) #define MI_WAIT_FOR_PLANE_B_FLIP (1<<6) #define MI_WAIT_FOR_PLANE_A_FLIP (1<<2) +/* p189 */ +#define _3DSTATE_LOAD_STATE_IMMEDIATE_1 (CMD_3D | (0x1d<<24) | (0x04<<16)) +#define I1_LOAD_S(n) (1<<(4+n)) + +/** @{ + * 915 definitions + */ +#define S0_VB_OFFSET_MASK 0xffffffc +#define S0_AUTO_CACHE_INV_DISABLE (1<<0) +/** @} */ + +/** @{ + * 830 definitions + */ +#define S0_VB_OFFSET_MASK_830 0xffffff8 +#define S0_VB_PITCH_SHIFT_830 1 +#define S0_VB_ENABLE_830 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) +#define S2_TEX_COUNT_SHIFT_830 12 +#define S2_VERTEX_0_WIDTH_SHIFT_830 0 +#define S2_VERTEX_1_WIDTH_SHIFT_830 6 +/* 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 + /* Primitive dispatch on 830-945 */ #define _3DPRIMITIVE (CMD_3D | (0x1f << 24)) #define PRIM_INDIRECT (1<<23) diff --git a/src/mesa/drivers/dri/intel/intel_regions.c b/src/mesa/drivers/dri/intel/intel_regions.c index 8bc548913f..45faf64c71 100644 --- a/src/mesa/drivers/dri/intel/intel_regions.c +++ b/src/mesa/drivers/dri/intel/intel_regions.c @@ -39,13 +39,16 @@ * last moment. */ +#include <sys/ioctl.h> +#include <errno.h> + #include "intel_context.h" #include "intel_regions.h" #include "intel_blit.h" #include "intel_buffer_objects.h" -#include "dri_bufmgr.h" -#include "intel_bufmgr_ttm.h" +#include "intel_bufmgr.h" #include "intel_batchbuffer.h" +#include "intel_chipset.h" #define FILE_DEBUG_FLAG DEBUG_REGION @@ -76,10 +79,35 @@ intel_region_unmap(struct intel_context *intel, struct intel_region *region) } } +static int +intel_set_region_tiling_gem(struct intel_context *intel, + struct intel_region *region, + uint32_t bo_handle) +{ + struct drm_i915_gem_get_tiling get_tiling; + int ret; + + memset(&get_tiling, 0, sizeof(get_tiling)); + + get_tiling.handle = bo_handle; + ret = ioctl(intel->driFd, DRM_IOCTL_I915_GEM_GET_TILING, &get_tiling); + if (ret != 0) { + fprintf(stderr, "Failed to get tiling state for region: %s\n", + strerror(errno)); + return ret; + } + + region->tiling = get_tiling.tiling_mode; + region->bit_6_swizzle = get_tiling.swizzle_mode; + + return 0; +} + static struct intel_region * intel_region_alloc_internal(struct intel_context *intel, - GLuint cpp, GLuint pitch, GLuint height, - GLuint tiled, dri_bo *buffer) + GLuint cpp, + GLuint width, GLuint height, GLuint pitch, + dri_bo *buffer) { struct intel_region *region; @@ -90,46 +118,58 @@ intel_region_alloc_internal(struct intel_context *intel, region = calloc(sizeof(*region), 1); region->cpp = cpp; + region->width = width; + region->height = height; region->pitch = pitch; - region->height = height; /* needed? */ region->refcount = 1; - region->tiled = tiled; region->buffer = buffer; + /* Default to no tiling */ + region->tiling = I915_TILING_NONE; + region->bit_6_swizzle = I915_BIT_6_SWIZZLE_NONE; + return region; } struct intel_region * intel_region_alloc(struct intel_context *intel, - GLuint cpp, GLuint pitch, GLuint height) + GLuint cpp, GLuint width, GLuint height, GLuint pitch) { dri_bo *buffer; buffer = dri_bo_alloc(intel->bufmgr, "region", - pitch * cpp * height, 64, - DRM_BO_FLAG_MEM_LOCAL | - DRM_BO_FLAG_CACHED | - DRM_BO_FLAG_CACHED_MAPPED); + pitch * cpp * height, 64); - return intel_region_alloc_internal(intel, cpp, pitch, height, 0, buffer); + return intel_region_alloc_internal(intel, cpp, width, height, pitch, buffer); } struct intel_region * intel_region_alloc_for_handle(struct intel_context *intel, - GLuint cpp, GLuint pitch, GLuint height, - GLuint tiled, GLuint handle) + GLuint cpp, + GLuint width, GLuint height, GLuint pitch, + GLuint handle, const char *name) { + struct intel_region *region; dri_bo *buffer; - buffer = intel_ttm_bo_create_from_handle(intel->bufmgr, "region", handle); + buffer = intel_bo_gem_create_from_name(intel->bufmgr, name, handle); + + region = intel_region_alloc_internal(intel, cpp, + width, height, pitch, buffer); + if (region == NULL) + return region; + + intel_set_region_tiling_gem(intel, region, handle); - return intel_region_alloc_internal(intel, - cpp, pitch, height, tiled, buffer); + return region; } void intel_region_reference(struct intel_region **dst, struct intel_region *src) { + if (src) + DBG("%s %d\n", __FUNCTION__, src->refcount); + assert(*dst == NULL); if (src) { src->refcount++; @@ -138,26 +178,34 @@ intel_region_reference(struct intel_region **dst, struct intel_region *src) } void -intel_region_release(struct intel_region **region) +intel_region_release(struct intel_region **region_handle) { - if (!*region) + struct intel_region *region = *region_handle; + + if (region == NULL) return; - DBG("%s %d\n", __FUNCTION__, (*region)->refcount - 1); + DBG("%s %d\n", __FUNCTION__, region->refcount - 1); + + ASSERT(region->refcount > 0); + region->refcount--; - ASSERT((*region)->refcount > 0); - (*region)->refcount--; + if (region->refcount == 0) { + assert(region->map_refcount == 0); - if ((*region)->refcount == 0) { - assert((*region)->map_refcount == 0); + if (region->pbo) + region->pbo->region = NULL; + region->pbo = NULL; + dri_bo_unreference(region->buffer); + + if (region->classic_map != NULL) { + drmUnmap(region->classic_map, + region->pitch * region->cpp * region->height); + } - if ((*region)->pbo) - (*region)->pbo->region = NULL; - (*region)->pbo = NULL; - dri_bo_unreference((*region)->buffer); - free(*region); + free(region); } - *region = NULL; + *region_handle = NULL; } /* @@ -272,8 +320,8 @@ intel_region_copy(struct intel_context *intel, intelEmitCopyBlit(intel, dst->cpp, - src->pitch, src->buffer, src_offset, src->tiled, - dst->pitch, dst->buffer, dst_offset, dst->tiled, + src->pitch, src->buffer, src_offset, src->tiling, + dst->pitch, dst->buffer, dst_offset, dst->tiling, srcx, srcy, dstx, dsty, width, height, GL_COPY); } @@ -303,7 +351,7 @@ intel_region_fill(struct intel_context *intel, intelEmitFillBlit(intel, dst->cpp, - dst->pitch, dst->buffer, dst_offset, dst->tiled, + dst->pitch, dst->buffer, dst_offset, dst->tiling, dstx, dsty, width, height, color); } @@ -355,10 +403,7 @@ intel_region_release_pbo(struct intel_context *intel, region->buffer = dri_bo_alloc(intel->bufmgr, "region", region->pitch * region->cpp * region->height, - 64, - DRM_BO_FLAG_MEM_LOCAL | - DRM_BO_FLAG_CACHED | - DRM_BO_FLAG_CACHED_MAPPED); + 64); } /* Break the COW tie to the pbo. Both the pbo and the region end up @@ -382,23 +427,19 @@ intel_region_cow(struct intel_context *intel, struct intel_region *region) /* Now blit from the texture buffer to the new buffer: */ - intel_batchbuffer_flush(intel->batch); - was_locked = intel->locked; - if (intel->locked) + if (!was_locked) LOCK_HARDWARE(intel); intelEmitCopyBlit(intel, region->cpp, - region->pitch, region->buffer, 0, region->tiled, - region->pitch, pbo->buffer, 0, region->tiled, + region->pitch, region->buffer, 0, region->tiling, + region->pitch, pbo->buffer, 0, region->tiling, 0, 0, 0, 0, region->pitch, region->height, GL_COPY); - intel_batchbuffer_flush(intel->batch); - - if (was_locked) + if (!was_locked) UNLOCK_HARDWARE(intel); } @@ -420,10 +461,10 @@ static struct intel_region * intel_recreate_static(struct intel_context *intel, const char *name, struct intel_region *region, - intelRegion *region_desc, - GLuint mem_type) + intelRegion *region_desc) { intelScreenPrivate *intelScreen = intel->intelScreen; + int ret; if (region == NULL) { region = calloc(sizeof(*region), 1); @@ -436,21 +477,55 @@ intel_recreate_static(struct intel_context *intel, region->cpp = intel->ctx.Visual.rgbBits / 8; region->pitch = intelScreen->pitch; region->height = intelScreen->height; /* needed? */ - region->tiled = region_desc->tiled; + + if (region->buffer != NULL) { + dri_bo_unreference(region->buffer); + region->buffer = NULL; + } if (intel->ttm) { assert(region_desc->bo_handle != -1); - region->buffer = intel_ttm_bo_create_from_handle(intel->bufmgr, - name, - region_desc->bo_handle); + region->buffer = intel_bo_gem_create_from_name(intel->bufmgr, + name, + region_desc->bo_handle); + + intel_set_region_tiling_gem(intel, region, region_desc->bo_handle); } else { - region->buffer = dri_bo_alloc_static(intel->bufmgr, - name, - region_desc->offset, - intelScreen->pitch * - intelScreen->height, - region_desc->map, - DRM_BO_FLAG_MEM_TT); + if (region->classic_map != NULL) { + drmUnmap(region->classic_map, + region->pitch * region->cpp * region->height); + region->classic_map = NULL; + } + ret = drmMap(intel->driFd, region_desc->handle, + region->pitch * region->cpp * region->height, + ®ion->classic_map); + if (ret != 0) { + fprintf(stderr, "Failed to drmMap %s buffer\n", name); + free(region); + return NULL; + } + + region->buffer = intel_bo_fake_alloc_static(intel->bufmgr, + name, + region_desc->offset, + region->pitch * region->cpp * + region->height, + region->classic_map); + + /* The sarea just gives us a boolean for whether it's tiled or not, + * instead of which tiling mode it is. Guess. + */ + if (region_desc->tiled) { + if (IS_965(intel->intelScreen->deviceID) && + region_desc == &intelScreen->depth) + region->tiling = I915_TILING_Y; + else + region->tiling = I915_TILING_X; + } else { + region->tiling = I915_TILING_NONE; + } + + region->bit_6_swizzle = I915_BIT_6_SWIZZLE_NONE; } assert(region->buffer != NULL); @@ -477,22 +552,19 @@ intel_recreate_static_regions(struct intel_context *intel) intel->front_region = intel_recreate_static(intel, "front", intel->front_region, - &intelScreen->front, - DRM_BO_FLAG_MEM_TT); + &intelScreen->front); intel->back_region = intel_recreate_static(intel, "back", intel->back_region, - &intelScreen->back, - DRM_BO_FLAG_MEM_TT); + &intelScreen->back); #ifdef I915 if (intelScreen->third.handle) { intel->third_region = intel_recreate_static(intel, "third", intel->third_region, - &intelScreen->third, - DRM_BO_FLAG_MEM_TT); + &intelScreen->third); } #endif /* I915 */ @@ -502,6 +574,5 @@ intel_recreate_static_regions(struct intel_context *intel) intel->depth_region = intel_recreate_static(intel, "depth", intel->depth_region, - &intelScreen->depth, - DRM_BO_FLAG_MEM_TT); + &intelScreen->depth); } diff --git a/src/mesa/drivers/dri/intel/intel_regions.h b/src/mesa/drivers/dri/intel/intel_regions.h index 229f79aeba..4b120ba4ce 100644 --- a/src/mesa/drivers/dri/intel/intel_regions.h +++ b/src/mesa/drivers/dri/intel/intel_regions.h @@ -28,8 +28,16 @@ #ifndef INTEL_REGIONS_H #define INTEL_REGIONS_H -#include "mtypes.h" -#include "dri_bufmgr.h" +/** @file intel_regions.h + * + * Structure definitions and prototypes for intel_region handling, which is + * the basic structure for rectangular collections of pixels stored in a dri_bo. + */ + +#include <xf86drm.h> + +#include "main/mtypes.h" +#include "intel_bufmgr.h" struct intel_context; struct intel_buffer_object; @@ -47,14 +55,16 @@ struct intel_region dri_bo *buffer; /**< buffer manager's buffer */ GLuint refcount; /**< Reference count for region */ GLuint cpp; /**< bytes per pixel */ - GLuint pitch; /**< in pixels */ + GLuint width; /**< in pixels */ GLuint height; /**< in pixels */ + GLuint pitch; /**< 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 */ - GLboolean tiled; /**< True if the region is X or Y-tiled. Used on 965. */ - + uint32_t tiling; /**< Which tiling mode the region is in */ + uint32_t bit_6_swizzle; /**< GEM flag for address swizzling requirement */ + drmAddress classic_map; /**< drmMap of the region when not in GEM mode */ struct intel_buffer_object *pbo; /* zero-copy uploads */ }; @@ -63,13 +73,14 @@ struct intel_region * copied by calling intel_reference_region(). */ struct intel_region *intel_region_alloc(struct intel_context *intel, - GLuint cpp, - GLuint pitch, GLuint height); + GLuint cpp, GLuint width, + GLuint height, GLuint pitch); struct intel_region * intel_region_alloc_for_handle(struct intel_context *intel, - GLuint cpp, GLuint pitch, GLuint height, - GLuint tiled, unsigned int handle); + GLuint cpp, + GLuint width, GLuint height, GLuint pitch, + unsigned int handle, const char *name); void intel_region_reference(struct intel_region **dst, struct intel_region *src); diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c index 5dded4b167..cf09fad745 100644 --- a/src/mesa/drivers/dri/intel/intel_screen.c +++ b/src/mesa/drivers/dri/intel/intel_screen.c @@ -25,12 +25,12 @@ * **************************************************************************/ -#include "glheader.h" -#include "context.h" -#include "framebuffer.h" -#include "matrix.h" -#include "renderbuffer.h" -#include "simple_list.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/framebuffer.h" +#include "main/matrix.h" +#include "main/renderbuffer.h" +#include "main/simple_list.h" #include "utils.h" #include "vblank.h" #include "xmlpool.h" @@ -41,7 +41,6 @@ #include "intel_buffers.h" #include "intel_tex.h" #include "intel_span.h" -#include "intel_ioctl.h" #include "intel_fbo.h" #include "intel_chipset.h" @@ -49,7 +48,7 @@ #include "i830_dri.h" #include "intel_regions.h" #include "intel_batchbuffer.h" -#include "intel_bufmgr_ttm.h" +#include "intel_bufmgr.h" PUBLIC const char __driConfigOptions[] = DRI_CONF_BEGIN @@ -59,7 +58,7 @@ PUBLIC const char __driConfigOptions[] = /* Options correspond to DRI_CONF_BO_REUSE_DISABLED, * DRI_CONF_BO_REUSE_ALL */ - DRI_CONF_OPT_BEGIN_V(bo_reuse, enum, 0, "0:1") + DRI_CONF_OPT_BEGIN_V(bo_reuse, enum, 1, "0:1") DRI_CONF_DESC_BEGIN(en, "Buffer object reuse") DRI_CONF_ENUM(0, "Disable buffer object reuse") DRI_CONF_ENUM(1, "Enable reuse of all sizes of buffer objects") @@ -90,51 +89,6 @@ 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 (intelScreen->third.handle) { - if (0) - _mesa_printf("Third 0x%08x ", intelScreen->third.handle); - if (drmMap(sPriv->fd, - intelScreen->third.handle, - intelScreen->third.size, - (drmAddress *) & intelScreen->third.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 (intelScreen->tex.size != 0) { @@ -147,50 +101,15 @@ intelMapScreenRegions(__DRIscreenPrivate * sPriv) } } - if (0) - printf("Mappings: front: %p back: %p third: %p depth: %p tex: %p\n", - intelScreen->front.map, - intelScreen->back.map, intelScreen->third.map, - intelScreen->depth.map, intelScreen->tex.map); return GL_TRUE; } 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->third.map) { -#if REALLY_UNMAP - if (drmUnmap(intelScreen->third.map, intelScreen->third.size) != 0) - printf("drmUnmap third failed!\n"); -#endif - intelScreen->third.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 } } @@ -221,16 +140,16 @@ intelPrintSAREA(const struct drm_i915_sarea * sarea) 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: 0x%08x size: 0x%x handle: 0x%x tiled: %d\n", sarea->front_offset, sarea->front_size, - (unsigned) sarea->front_handle); + (unsigned) sarea->front_handle, sarea->front_tiled); fprintf(stderr, - "SAREA: back offset: 0x%08x size: 0x%x handle: 0x%x\n", + "SAREA: back offset: 0x%08x size: 0x%x handle: 0x%x tiled: %d\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", + (unsigned) sarea->back_handle, sarea->back_tiled); + fprintf(stderr, "SAREA: depth offset: 0x%08x size: 0x%x handle: 0x%x tiled: %d\n", sarea->depth_offset, sarea->depth_size, - (unsigned) sarea->depth_handle); + (unsigned) sarea->depth_handle, sarea->depth_tiled); fprintf(stderr, "SAREA: tex offset: 0x%08x size: 0x%x handle: 0x%x\n", sarea->tex_offset, sarea->tex_size, (unsigned) sarea->tex_handle); } @@ -291,106 +210,6 @@ intelUpdateScreenFromSAREA(intelScreenPrivate * intelScreen, intelPrintSAREA(sarea); } - -/** - * DRI2 entrypoint - */ -static void -intelHandleDrawableConfig(__DRIdrawablePrivate *dPriv, - __DRIcontextPrivate *pcp, - __DRIDrawableConfigEvent *event) -{ - struct intel_framebuffer *intel_fb = dPriv->driverPrivate; - struct intel_region *region = NULL; - struct intel_renderbuffer *rb, *depth_rb, *stencil_rb; - struct intel_context *intel = pcp->driverPrivate; - int cpp, pitch; - - cpp = intel->ctx.Visual.rgbBits / 8; - pitch = ((cpp * dPriv->w + 63) & ~63) / cpp; - - rb = intel_fb->color_rb[1]; - if (rb) { - region = intel_region_alloc(intel, cpp, pitch, dPriv->h); - intel_renderbuffer_set_region(rb, region); - } - - rb = intel_fb->color_rb[2]; - if (rb) { - region = intel_region_alloc(intel, cpp, pitch, dPriv->h); - intel_renderbuffer_set_region(rb, region); - } - - depth_rb = intel_get_renderbuffer(&intel_fb->Base, BUFFER_DEPTH); - stencil_rb = intel_get_renderbuffer(&intel_fb->Base, BUFFER_STENCIL); - if (depth_rb || stencil_rb) - region = intel_region_alloc(intel, cpp, pitch, dPriv->h); - if (depth_rb) - intel_renderbuffer_set_region(depth_rb, region); - if (stencil_rb) - intel_renderbuffer_set_region(stencil_rb, region); - - /* FIXME: Tell the X server about the regions we just allocated and - * attached. */ -} - -#define BUFFER_FLAG_TILED 0x0100 - -/** - * DRI2 entrypoint - */ -static void -intelHandleBufferAttach(__DRIdrawablePrivate *dPriv, - __DRIcontextPrivate *pcp, - __DRIBufferAttachEvent *ba) -{ - struct intel_framebuffer *intel_fb = dPriv->driverPrivate; - struct intel_renderbuffer *rb; - struct intel_region *region; - struct intel_context *intel = pcp->driverPrivate; - GLuint tiled; - - switch (ba->buffer.attachment) { - case DRI_DRAWABLE_BUFFER_FRONT_LEFT: - rb = intel_fb->color_rb[0]; - break; - - case DRI_DRAWABLE_BUFFER_BACK_LEFT: - rb = intel_fb->color_rb[0]; - break; - - case DRI_DRAWABLE_BUFFER_DEPTH: - rb = intel_get_renderbuffer(&intel_fb->Base, BUFFER_DEPTH); - break; - - case DRI_DRAWABLE_BUFFER_STENCIL: - rb = intel_get_renderbuffer(&intel_fb->Base, BUFFER_STENCIL); - break; - - case DRI_DRAWABLE_BUFFER_ACCUM: - default: - fprintf(stderr, "unhandled buffer attach event, attacment type %d\n", - ba->buffer.attachment); - return; - } - -#if 0 - /* FIXME: Add this so we can filter out when the X server sends us - * attachment events for the buffers we just allocated. Need to - * get the BO handle for a render buffer. */ - if (intel_renderbuffer_get_region_handle(rb) == ba->buffer.handle) - return; -#endif - - tiled = (ba->buffer.flags & BUFFER_FLAG_TILED) > 0; - region = intel_region_alloc_for_handle(intel, ba->buffer.cpp, - ba->buffer.pitch / ba->buffer.cpp, - dPriv->h, tiled, - ba->buffer.handle); - - intel_renderbuffer_set_region(rb, region); -} - static const __DRItexOffsetExtension intelTexOffsetExtension = { { __DRI_TEX_OFFSET }, intelSetTexOffset, @@ -454,9 +273,9 @@ static GLboolean intelInitDriver(__DRIscreenPrivate *sPriv) intelScreen->driScrnPriv = sPriv; sPriv->private = (void *) intelScreen; - intelScreen->sarea_priv_offset = gDRIPriv->sarea_priv_offset; sarea = (struct drm_i915_sarea *) - (((GLubyte *) sPriv->pSAREA) + intelScreen->sarea_priv_offset); + (((GLubyte *) sPriv->pSAREA) + gDRIPriv->sarea_priv_offset); + intelScreen->sarea = sarea; intelScreen->deviceID = gDRIPriv->deviceID; @@ -469,8 +288,6 @@ static GLboolean intelInitDriver(__DRIscreenPrivate *sPriv) return GL_FALSE; } - intelScreen->sarea_priv_offset = gDRIPriv->sarea_priv_offset; - if (0) intelPrintDRIInfo(intelScreen, sPriv, gDRIPriv); @@ -481,11 +298,6 @@ static GLboolean intelInitDriver(__DRIscreenPrivate *sPriv) &intelScreen->irq_active)) return GL_FALSE; - /* Determine if batchbuffers are allowed */ - if (!intel_get_param(sPriv, I915_PARAM_ALLOW_BATCHBUFFER, - &intelScreen->allow_batchbuffer)) - return GL_FALSE; - sPriv->extensions = intelScreenExtensions; return GL_TRUE; @@ -497,6 +309,7 @@ intelDestroyScreen(__DRIscreenPrivate * sPriv) { intelScreenPrivate *intelScreen = (intelScreenPrivate *) sPriv->private; + dri_bufmgr_destroy(intelScreen->bufmgr); intelUnmapScreenRegions(intelScreen); FREE(intelScreen); @@ -530,14 +343,13 @@ intelCreateBuffer(__DRIscreenPrivate * driScrnPriv, _mesa_initialize_framebuffer(&intel_fb->Base, mesaVis); /* setup the hardware-based renderbuffers */ - { - intel_fb->color_rb[0] = intel_create_renderbuffer(rgbFormat); - _mesa_add_renderbuffer(&intel_fb->Base, BUFFER_FRONT_LEFT, - &intel_fb->color_rb[0]->Base); - } + intel_fb->color_rb[0] = intel_create_renderbuffer(rgbFormat); + _mesa_add_renderbuffer(&intel_fb->Base, BUFFER_FRONT_LEFT, + &intel_fb->color_rb[0]->Base); if (mesaVis->doubleBufferMode) { - intel_fb->color_rb[1] = intel_create_renderbuffer(rgbFormat); + intel_fb->color_rb[1] = intel_create_renderbuffer(rgbFormat); + _mesa_add_renderbuffer(&intel_fb->Base, BUFFER_BACK_LEFT, &intel_fb->color_rb[1]->Base); @@ -569,7 +381,7 @@ intelCreateBuffer(__DRIscreenPrivate * driScrnPriv, else if (mesaVis->depthBits == 16) { /* just 16-bit depth buffer, no hw stencil */ struct intel_renderbuffer *depthRb - = intel_create_renderbuffer(GL_DEPTH_COMPONENT16); + = intel_create_renderbuffer(GL_DEPTH_COMPONENT16); _mesa_add_renderbuffer(&intel_fb->Base, BUFFER_DEPTH, &depthRb->Base); } @@ -680,8 +492,8 @@ intelFillInModes(__DRIscreenPrivate *psp, GLX_NONE, GLX_SWAP_UNDEFINED_OML, GLX_SWAP_COPY_OML }; - u_int8_t depth_bits_array[3]; - u_int8_t stencil_bits_array[3]; + uint8_t depth_bits_array[3]; + uint8_t stencil_bits_array[3]; depth_bits_array[0] = 0; depth_bits_array[1] = depth_bits; @@ -732,6 +544,69 @@ intelFillInModes(__DRIscreenPrivate *psp, return configs; } +static GLboolean +intel_init_bufmgr(intelScreenPrivate *intelScreen) +{ + GLboolean gem_disable = getenv("INTEL_NO_GEM") != NULL; + int gem_kernel = 0; + GLboolean gem_supported; + struct drm_i915_getparam gp; + __DRIscreenPrivate *spriv = intelScreen->driScrnPriv; + + intelScreen->no_hw = getenv("INTEL_NO_HW") != NULL; + + gp.param = I915_PARAM_HAS_GEM; + gp.value = &gem_kernel; + + (void) drmCommandWriteRead(spriv->fd, DRM_I915_GETPARAM, &gp, sizeof(gp)); + + /* If we've got a new enough DDX that's initializing GEM and giving us + * object handles for the shared buffers, use that. + */ + intelScreen->ttm = GL_FALSE; + if (intelScreen->driScrnPriv->dri2.enabled) + gem_supported = GL_TRUE; + else if (intelScreen->driScrnPriv->ddx_version.minor >= 9 && + gem_kernel && + intelScreen->front.bo_handle != -1) + gem_supported = GL_TRUE; + else + gem_supported = GL_FALSE; + + if (!gem_disable && gem_supported) { + intelScreen->bufmgr = intel_bufmgr_gem_init(spriv->fd, BATCH_SZ); + if (intelScreen->bufmgr != NULL) + intelScreen->ttm = GL_TRUE; + } + /* Otherwise, use the classic buffer manager. */ + if (intelScreen->bufmgr == NULL) { + if (gem_disable) { + fprintf(stderr, "GEM disabled. Using classic.\n"); + } else { + fprintf(stderr, "Failed to initialize GEM. " + "Falling back to classic.\n"); + } + + if (intelScreen->tex.size == 0) { + fprintf(stderr, "[%s:%u] Error initializing buffer manager.\n", + __func__, __LINE__); + return GL_FALSE; + } + + intelScreen->bufmgr = + intel_bufmgr_fake_init(spriv->fd, + intelScreen->tex.offset, + intelScreen->tex.map, + intelScreen->tex.size, + (unsigned int * volatile) + &intelScreen->sarea->last_dispatch); + } + + /* XXX bufmgr should be per-screen, not per-context */ + intelScreen->ttm = intelScreen->ttm; + + return GL_TRUE; +} /** * This is the driver specific part of the createNewScreen entry point. @@ -743,6 +618,7 @@ intelFillInModes(__DRIscreenPrivate *psp, */ static const __DRIconfig **intelInitScreen(__DRIscreenPrivate *psp) { + intelScreenPrivate *intelScreen; #ifdef I915 static const __DRIversion ddx_expected = { 1, 5, 0 }; #else @@ -776,6 +652,10 @@ static const __DRIconfig **intelInitScreen(__DRIscreenPrivate *psp) psp->extensions = intelScreenExtensions; + intelScreen = psp->private; + if (!intel_init_bufmgr(intelScreen)) + return GL_FALSE; + return (const __DRIconfig **) intelFillInModes(psp, dri_priv->cpp * 8, (dri_priv->cpp == 2) ? 16 : 24, @@ -835,26 +715,15 @@ __DRIconfig **intelInitScreen2(__DRIscreenPrivate *psp) intelScreen->drmMinor = psp->drm_version.minor; - /* Determine chipset ID? */ + /* Determine chipset ID */ if (!intel_get_param(psp, I915_PARAM_CHIPSET_ID, &intelScreen->deviceID)) return GL_FALSE; - /* Determine if IRQs are active? */ - if (!intel_get_param(psp, I915_PARAM_IRQ_ACTIVE, - &intelScreen->irq_active)) - return GL_FALSE; - - /* Determine if batchbuffers are allowed */ - if (!intel_get_param(psp, I915_PARAM_ALLOW_BATCHBUFFER, - &intelScreen->allow_batchbuffer)) - return GL_FALSE; - - if (!intelScreen->allow_batchbuffer) { - fprintf(stderr, "batch buffer not allowed\n"); - return GL_FALSE; - } + if (!intel_init_bufmgr(intelScreen)) + return GL_FALSE; + intelScreen->irq_active = 1; psp->extensions = intelScreenExtensions; return driConcatConfigs(intelFillInModes(psp, 16, 16, 0, 1), @@ -877,6 +746,4 @@ const struct __DriverAPIRec driDriverAPI = { .CopySubBuffer = intelCopySubBuffer, .InitScreen2 = intelInitScreen2, - .HandleDrawableConfig = intelHandleDrawableConfig, - .HandleBufferAttach = intelHandleBufferAttach, }; diff --git a/src/mesa/drivers/dri/intel/intel_screen.h b/src/mesa/drivers/dri/intel/intel_screen.h index e62b2d7c89..fc913da5bf 100644 --- a/src/mesa/drivers/dri/intel/intel_screen.h +++ b/src/mesa/drivers/dri/intel/intel_screen.h @@ -30,6 +30,7 @@ #include <sys/time.h> #include "dri_util.h" +#include "intel_bufmgr.h" #include "i915_drm.h" #include "xmlconfig.h" @@ -67,12 +68,17 @@ typedef struct int logTextureGranularity; __DRIscreenPrivate *driScrnPriv; - unsigned int sarea_priv_offset; + + volatile struct drm_i915_sarea *sarea; int drmMinor; int irq_active; - int allow_batchbuffer; + + GLboolean no_hw; + + int ttm; + dri_bufmgr *bufmgr; /** * Configuration cache with default values for all contexts diff --git a/src/mesa/drivers/dri/intel/intel_span.c b/src/mesa/drivers/dri/intel/intel_span.c index df4f5927a0..8e2b4456f8 100644 --- a/src/mesa/drivers/dri/intel/intel_span.c +++ b/src/mesa/drivers/dri/intel/intel_span.c @@ -25,20 +25,237 @@ * **************************************************************************/ -#include "glheader.h" -#include "macros.h" -#include "mtypes.h" -#include "colormac.h" +#include "main/glheader.h" +#include "main/macros.h" +#include "main/mtypes.h" +#include "main/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" +static void +intel_set_span_functions(struct intel_context *intel, + struct gl_renderbuffer *rb); + +#define SPAN_CACHE_SIZE 4096 + +static void +get_span_cache(struct intel_renderbuffer *irb, uint32_t offset) +{ + if (irb->span_cache == NULL) { + irb->span_cache = _mesa_malloc(SPAN_CACHE_SIZE); + irb->span_cache_offset = -1; + } + + if ((offset & ~(SPAN_CACHE_SIZE - 1)) != irb->span_cache_offset) { + irb->span_cache_offset = offset & ~(SPAN_CACHE_SIZE - 1); + dri_bo_get_subdata(irb->region->buffer, irb->span_cache_offset, + SPAN_CACHE_SIZE, irb->span_cache); + } +} + +static void +clear_span_cache(struct intel_renderbuffer *irb) +{ + irb->span_cache_offset = -1; +} + +static uint32_t +pread_32(struct intel_renderbuffer *irb, uint32_t offset) +{ + get_span_cache(irb, offset); + + return *(uint32_t *)(irb->span_cache + (offset & (SPAN_CACHE_SIZE - 1))); +} + +static uint32_t +pread_xrgb8888(struct intel_renderbuffer *irb, uint32_t offset) +{ + get_span_cache(irb, offset); + + return *(uint32_t *)(irb->span_cache + (offset & (SPAN_CACHE_SIZE - 1))) | + 0xff000000; +} + +static uint16_t +pread_16(struct intel_renderbuffer *irb, uint32_t offset) +{ + get_span_cache(irb, offset); + + return *(uint16_t *)(irb->span_cache + (offset & (SPAN_CACHE_SIZE - 1))); +} + +static uint8_t +pread_8(struct intel_renderbuffer *irb, uint32_t offset) +{ + get_span_cache(irb, offset); + + return *(uint8_t *)(irb->span_cache + (offset & (SPAN_CACHE_SIZE - 1))); +} + +static void +pwrite_32(struct intel_renderbuffer *irb, uint32_t offset, uint32_t val) +{ + clear_span_cache(irb); + + dri_bo_subdata(irb->region->buffer, offset, 4, &val); +} + +static void +pwrite_xrgb8888(struct intel_renderbuffer *irb, uint32_t offset, uint32_t val) +{ + clear_span_cache(irb); + + dri_bo_subdata(irb->region->buffer, offset, 3, &val); +} + +static void +pwrite_16(struct intel_renderbuffer *irb, uint32_t offset, uint16_t val) +{ + clear_span_cache(irb); + + dri_bo_subdata(irb->region->buffer, offset, 2, &val); +} + +static void +pwrite_8(struct intel_renderbuffer *irb, uint32_t offset, uint8_t val) +{ + clear_span_cache(irb); + + dri_bo_subdata(irb->region->buffer, offset, 1, &val); +} + +static uint32_t no_tile_swizzle(struct intel_renderbuffer *irb, + struct intel_context *intel, + int x, int y) +{ + x += intel->drawX; + y += intel->drawY; + + return (y * irb->region->pitch + x) * irb->region->cpp; +} + +/* + * Deal with tiled surfaces + */ + +static uint32_t x_tile_swizzle(struct intel_renderbuffer *irb, + struct intel_context *intel, + int x, int y) +{ + int tile_stride; + int xbyte; + int x_tile_off, y_tile_off; + int x_tile_number, y_tile_number; + int tile_off, tile_base; + + tile_stride = (irb->pfPitch * irb->region->cpp) << 3; + + x += intel->drawX; + y += intel->drawY; + + xbyte = x * irb->region->cpp; + + x_tile_off = xbyte & 0x1ff; + y_tile_off = y & 7; + + x_tile_number = xbyte >> 9; + y_tile_number = y >> 3; + + tile_off = (y_tile_off << 9) + x_tile_off; + + switch (irb->region->bit_6_swizzle) { + case I915_BIT_6_SWIZZLE_NONE: + break; + case I915_BIT_6_SWIZZLE_9: + tile_off ^= ((tile_off >> 3) & 64); + break; + case I915_BIT_6_SWIZZLE_9_10: + tile_off ^= ((tile_off >> 3) & 64) ^ ((tile_off >> 4) & 64); + break; + case I915_BIT_6_SWIZZLE_9_11: + tile_off ^= ((tile_off >> 3) & 64) ^ ((tile_off >> 5) & 64); + break; + case I915_BIT_6_SWIZZLE_9_10_11: + tile_off ^= ((tile_off >> 3) & 64) ^ ((tile_off >> 4) & 64) ^ + ((tile_off >> 5) & 64); + break; + default: + fprintf(stderr, "Unknown tile swizzling mode %d\n", + irb->region->bit_6_swizzle); + exit(1); + } + + tile_base = (x_tile_number << 12) + y_tile_number * tile_stride; + +#if 0 + printf("(%d,%d) -> %d + %d = %d (pitch = %d, tstride = %d)\n", + x, y, tile_off, tile_base, + tile_off + tile_base, + irb->pfPitch, tile_stride); +#endif + + return tile_base + tile_off; +} + +static uint32_t y_tile_swizzle(struct intel_renderbuffer *irb, + struct intel_context *intel, + int x, int y) +{ + int tile_stride; + int xbyte; + int x_tile_off, y_tile_off; + int x_tile_number, y_tile_number; + int tile_off, tile_base; + + tile_stride = (irb->pfPitch * irb->region->cpp) << 5; + + x += intel->drawX; + y += intel->drawY; + + xbyte = x * irb->region->cpp; + + x_tile_off = xbyte & 0x7f; + y_tile_off = y & 0x1f; + + x_tile_number = xbyte >> 7; + y_tile_number = y >> 5; + + tile_off = ((x_tile_off & ~0xf) << 5) + (y_tile_off << 4) + + (x_tile_off & 0xf); + + switch (irb->region->bit_6_swizzle) { + case I915_BIT_6_SWIZZLE_NONE: + break; + case I915_BIT_6_SWIZZLE_9: + tile_off ^= ((tile_off >> 3) & 64); + break; + case I915_BIT_6_SWIZZLE_9_10: + tile_off ^= ((tile_off >> 3) & 64) ^ ((tile_off >> 4) & 64); + break; + case I915_BIT_6_SWIZZLE_9_11: + tile_off ^= ((tile_off >> 3) & 64) ^ ((tile_off >> 5) & 64); + break; + case I915_BIT_6_SWIZZLE_9_10_11: + tile_off ^= ((tile_off >> 3) & 64) ^ ((tile_off >> 4) & 64) ^ + ((tile_off >> 5) & 64); + break; + default: + fprintf(stderr, "Unknown tile swizzling mode %d\n", + irb->region->bit_6_swizzle); + exit(1); + } + + tile_base = (x_tile_number << 12) + y_tile_number * tile_stride; + + return tile_base + tile_off; +} + /* break intelWriteRGBASpan_ARGB8888 */ @@ -51,10 +268,7 @@ 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 @@ -69,12 +283,14 @@ int miny = intel->pClipRects[_nc].y1 - intel->drawY; \ int maxx = intel->pClipRects[_nc].x2 - intel->drawX; \ int maxy = intel->pClipRects[_nc].y2 - intel->drawY; - - - + +#if 0 + }} +#endif #define Y_FLIP(_y) ((_y) * yScale + yBias) +/* XXX with GEM, these need to tell the kernel */ #define HW_LOCK() #define HW_UNLOCK() @@ -86,7 +302,8 @@ #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) +#define GET_VALUE(X, Y) pread_16(irb, no_tile_swizzle(irb, intel, X, Y)) +#define PUT_VALUE(X, Y, V) pwrite_16(irb, no_tile_swizzle(irb, intel, X, Y), V) #include "spantmp2.h" /* 32 bit, ARGB8888 color spanline and pixel functions @@ -96,18 +313,89 @@ #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) +#define GET_VALUE(X, Y) pread_32(irb, no_tile_swizzle(irb, intel, X, Y)) +#define PUT_VALUE(X, Y, V) pwrite_32(irb, no_tile_swizzle(irb, intel, X, Y), V) #include "spantmp2.h" +/* 32 bit, xRGB8888 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##_xRGB8888 +#define TAG2(x,y) intel##x##_xRGB8888##y +#define GET_VALUE(X, Y) pread_xrgb8888(irb, no_tile_swizzle(irb, intel, X, Y)) +#define PUT_VALUE(X, Y, V) pwrite_xrgb8888(irb, no_tile_swizzle(irb, intel, X, Y), V) +#include "spantmp2.h" + +/* 16 bit RGB565 color tile spanline and pixel functions + */ + +#define SPANTMP_PIXEL_FMT GL_RGB +#define SPANTMP_PIXEL_TYPE GL_UNSIGNED_SHORT_5_6_5 + +#define TAG(x) intel_XTile_##x##_RGB565 +#define TAG2(x,y) intel_XTile_##x##_RGB565##y +#define GET_VALUE(X, Y) pread_16(irb, x_tile_swizzle(irb, intel, X, Y)) +#define PUT_VALUE(X, Y, V) pwrite_16(irb, x_tile_swizzle(irb, intel, X, Y), V) +#include "spantmp2.h" + +#define SPANTMP_PIXEL_FMT GL_RGB +#define SPANTMP_PIXEL_TYPE GL_UNSIGNED_SHORT_5_6_5 + +#define TAG(x) intel_YTile_##x##_RGB565 +#define TAG2(x,y) intel_YTile_##x##_RGB565##y +#define GET_VALUE(X, Y) pread_16(irb, y_tile_swizzle(irb, intel, X, Y)) +#define PUT_VALUE(X, Y, V) pwrite_16(irb, y_tile_swizzle(irb, intel, X, Y), V) +#include "spantmp2.h" + +/* 32 bit ARGB888 color tile 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_XTile_##x##_ARGB8888 +#define TAG2(x,y) intel_XTile_##x##_ARGB8888##y +#define GET_VALUE(X, Y) pread_32(irb, x_tile_swizzle(irb, intel, X, Y)) +#define PUT_VALUE(X, Y, V) pwrite_32(irb, x_tile_swizzle(irb, intel, X, Y), V) +#include "spantmp2.h" + +#define SPANTMP_PIXEL_FMT GL_BGRA +#define SPANTMP_PIXEL_TYPE GL_UNSIGNED_INT_8_8_8_8_REV + +#define TAG(x) intel_YTile_##x##_ARGB8888 +#define TAG2(x,y) intel_YTile_##x##_ARGB8888##y +#define GET_VALUE(X, Y) pread_32(irb, y_tile_swizzle(irb, intel, X, Y)) +#define PUT_VALUE(X, Y, V) pwrite_32(irb, y_tile_swizzle(irb, intel, X, Y), V) +#include "spantmp2.h" + +/* 32 bit xRGB888 color tile 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_XTile_##x##_xRGB8888 +#define TAG2(x,y) intel_XTile_##x##_xRGB8888##y +#define GET_VALUE(X, Y) pread_xrgb8888(irb, x_tile_swizzle(irb, intel, X, Y)) +#define PUT_VALUE(X, Y, V) pwrite_xrgb8888(irb, x_tile_swizzle(irb, intel, X, Y), V) +#include "spantmp2.h" + +#define SPANTMP_PIXEL_FMT GL_BGRA +#define SPANTMP_PIXEL_TYPE GL_UNSIGNED_INT_8_8_8_8_REV + +#define TAG(x) intel_YTile_##x##_xRGB8888 +#define TAG2(x,y) intel_YTile_##x##_xRGB8888##y +#define GET_VALUE(X, Y) pread_xrgb8888(irb, y_tile_swizzle(irb, intel, X, Y)) +#define PUT_VALUE(X, Y, V) pwrite_xrgb8888(irb, y_tile_swizzle(irb, intel, X, Y), V) +#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; + const GLint yBias = irb->RenderToTexture ? 0 : irb->Base.Height - 1; #define LOCAL_STENCIL_VARS LOCAL_DEPTH_VARS @@ -115,14 +403,35 @@ /** ** 16-bit depthbuffer functions. **/ -#define WRITE_DEPTH( _x, _y, d ) \ - ((GLushort *)buf)[(_x) + (_y) * pitch] = d; +#define VALUE_TYPE GLushort +#define WRITE_DEPTH(_x, _y, d) \ + pwrite_16(irb, no_tile_swizzle(irb, intel, _x, _y), d) +#define READ_DEPTH(d, _x, _y) \ + d = pread_16(irb, no_tile_swizzle(irb, intel, _x, _y)) +#define TAG(x) intel##x##_z16 +#include "depthtmp.h" -#define READ_DEPTH( d, _x, _y ) \ - d = ((GLushort *)buf)[(_x) + (_y) * pitch]; +/** + ** 16-bit x tile depthbuffer functions. + **/ +#define VALUE_TYPE GLushort +#define WRITE_DEPTH(_x, _y, d) \ + pwrite_16(irb, x_tile_swizzle(irb, intel, _x, _y), d) +#define READ_DEPTH(d, _x, _y) \ + d = pread_16(irb, x_tile_swizzle(irb, intel, _x, _y)) +#define TAG(x) intel_XTile_##x##_z16 +#include "depthtmp.h" -#define TAG(x) intel##x##_z16 +/** + ** 16-bit y tile depthbuffer functions. + **/ +#define VALUE_TYPE GLushort +#define WRITE_DEPTH(_x, _y, d) \ + pwrite_16(irb, y_tile_swizzle(irb, intel, _x, _y), d) +#define READ_DEPTH(d, _x, _y) \ + d = pread_16(irb, y_tile_swizzle(irb, intel, _x, _y)) +#define TAG(x) intel_YTile_##x##_z16 #include "depthtmp.h" @@ -132,15 +441,16 @@ ** The wrappers in main/depthstencil.c are used to extract the depth ** and stencil values. **/ +#define VALUE_TYPE GLuint + /* Change ZZZS -> SZZZ */ -#define WRITE_DEPTH( _x, _y, d ) { \ - GLuint tmp = ((d) >> 8) | ((d) << 24); \ - ((GLuint *)buf)[(_x) + (_y) * pitch] = tmp; \ -} +#define WRITE_DEPTH(_x, _y, d) \ + pwrite_32(irb, no_tile_swizzle(irb, intel, _x, _y), \ + ((d) >> 8) | ((d) << 24)) /* Change SZZZ -> ZZZS */ #define READ_DEPTH( d, _x, _y ) { \ - GLuint tmp = ((GLuint *)buf)[(_x) + (_y) * pitch]; \ + GLuint tmp = pread_32(irb, no_tile_swizzle(irb, intel, _x, _y)); \ d = (tmp << 8) | (tmp >> 24); \ } @@ -149,22 +459,114 @@ /** - ** 8-bit stencil function (XXX FBO: This is obsolete) + ** 24/8-bit x-tile 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. **/ -#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 VALUE_TYPE GLuint + +/* Change ZZZS -> SZZZ */ +#define WRITE_DEPTH(_x, _y, d) \ + pwrite_32(irb, x_tile_swizzle(irb, intel, _x, _y), \ + ((d) >> 8) | ((d) << 24)) \ + +/* Change SZZZ -> ZZZS */ +#define READ_DEPTH( d, _x, _y ) { \ + GLuint tmp = pread_32(irb, x_tile_swizzle(irb, intel, _x, _y)); \ + d = (tmp << 8) | (tmp >> 24); \ +} + +#define TAG(x) intel_XTile_##x##_z24_s8 +#include "depthtmp.h" + +/** + ** 24/8-bit y-tile 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. + **/ +#define VALUE_TYPE GLuint + +/* Change ZZZS -> SZZZ */ +#define WRITE_DEPTH(_x, _y, d) \ + pwrite_32(irb, y_tile_swizzle(irb, intel, _x, _y), \ + ((d) >> 8) | ((d) << 24)) + +/* Change SZZZ -> ZZZS */ +#define READ_DEPTH( d, _x, _y ) { \ + GLuint tmp = pread_32(irb, y_tile_swizzle(irb, intel, _x, _y)); \ + d = (tmp << 8) | (tmp >> 24); \ } -#define READ_STENCIL( d, _x, _y ) \ - d = ((GLuint *)buf)[(_x) + (_y) * pitch] >> 24; +#define TAG(x) intel_YTile_##x##_z24_s8 +#include "depthtmp.h" + + +/** + ** 8-bit stencil function (XXX FBO: This is obsolete) + **/ +#define WRITE_STENCIL(_x, _y, d) \ + pwrite_8(irb, no_tile_swizzle(irb, intel, _x, _y) + 3, d) + +#define READ_STENCIL(d, _x, _y) \ + d = pread_8(irb, no_tile_swizzle(irb, intel, _x, _y) + 3); #define TAG(x) intel##x##_z24_s8 #include "stenciltmp.h" +/** + ** 8-bit x-tile stencil function (XXX FBO: This is obsolete) + **/ +#define WRITE_STENCIL(_x, _y, d) \ + pwrite_8(irb, x_tile_swizzle(irb, intel, _x, _y) + 3, d) +#define READ_STENCIL(d, _x, _y) \ + d = pread_8(irb, x_tile_swizzle(irb, intel, _x, _y) + 3); + +#define TAG(x) intel_XTile_##x##_z24_s8 +#include "stenciltmp.h" + +/** + ** 8-bit y-tile stencil function (XXX FBO: This is obsolete) + **/ +#define WRITE_STENCIL(_x, _y, d) \ + pwrite_8(irb, y_tile_swizzle(irb, intel, _x, _y) + 3, d) + +#define READ_STENCIL(d, _x, _y) \ + d = pread_8(irb, y_tile_swizzle(irb, intel, _x, _y) + 3) + +#define TAG(x) intel_YTile_##x##_z24_s8 +#include "stenciltmp.h" + +void +intel_renderbuffer_map(struct intel_context *intel, struct gl_renderbuffer *rb) +{ + struct intel_renderbuffer *irb = intel_renderbuffer(rb); + + if (irb == NULL || irb->region == NULL) + return; + + irb->pfPitch = irb->region->pitch; + + intel_set_span_functions(intel, rb); +} + +void +intel_renderbuffer_unmap(struct intel_context *intel, + struct gl_renderbuffer *rb) +{ + struct intel_renderbuffer *irb = intel_renderbuffer(rb); + + if (irb == NULL || irb->region == NULL) + return; + + clear_span_cache(irb); + irb->pfPitch = 0; + + rb->GetRow = NULL; + rb->PutRow = NULL; +} /** * Map or unmap all the renderbuffers which we may need during @@ -183,23 +585,13 @@ 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 (j = 0; j < ctx->DrawBuffer->_NumColorDrawBuffers; j++) { - struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[j]; - irb = intel_renderbuffer(rb); - if (irb) { - /* this is a user-created intel_renderbuffer */ - if (irb->region) { - if (map) - intel_region_map(intel, irb->region); - else - intel_region_unmap(intel, irb->region); - irb->pfMap = irb->region->map; - irb->pfPitch = irb->region->pitch; - } - } + if (map) + intel_renderbuffer_map(intel, ctx->DrawBuffer->_ColorDrawBuffers[j]); + else + intel_renderbuffer_unmap(intel, ctx->DrawBuffer->_ColorDrawBuffers[j]); } /* check for render to textures */ @@ -222,77 +614,28 @@ intel_map_unmap_buffers(struct intel_context *intel, GLboolean map) } /* color read buffers */ - irb = intel_renderbuffer(ctx->ReadBuffer->_ColorReadBuffer); - if (irb && irb->region) { - if (map) - intel_region_map(intel, irb->region); - else - intel_region_unmap(intel, 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 + if (map) + intel_renderbuffer_map(intel, ctx->ReadBuffer->_ColorReadBuffer); + else + intel_renderbuffer_unmap(intel, ctx->ReadBuffer->_ColorReadBuffer); /* depth buffer (Note wrapper!) */ if (ctx->DrawBuffer->_DepthBuffer) { - irb = intel_renderbuffer(ctx->DrawBuffer->_DepthBuffer->Wrapped); - if (irb && irb->region) { - if (map) { - intel_region_map(intel, irb->region); - irb->pfMap = irb->region->map; - irb->pfPitch = irb->region->pitch; - } - else { - intel_region_unmap(intel, irb->region); - irb->pfMap = irb->region->map; - irb->pfPitch = irb->region->pitch; - } - } + if (map) + intel_renderbuffer_map(intel, ctx->DrawBuffer->_DepthBuffer->Wrapped); + else + intel_renderbuffer_unmap(intel, + ctx->DrawBuffer->_DepthBuffer->Wrapped); } /* stencil buffer (Note wrapper!) */ if (ctx->DrawBuffer->_StencilBuffer) { - irb = intel_renderbuffer(ctx->DrawBuffer->_StencilBuffer->Wrapped); - if (irb && irb->region) { - if (map) { - intel_region_map(intel, irb->region); - irb->pfMap = irb->region->map; - irb->pfPitch = irb->region->pitch; - } - else { - intel_region_unmap(intel, irb->region); - irb->pfMap = irb->region->map; - irb->pfPitch = irb->region->pitch; - } - } + if (map) + intel_renderbuffer_map(intel, + ctx->DrawBuffer->_StencilBuffer->Wrapped); + else + intel_renderbuffer_unmap(intel, + ctx->DrawBuffer->_StencilBuffer->Wrapped); } } @@ -310,18 +653,9 @@ intelSpanRenderStart(GLcontext * ctx) struct intel_context *intel = intel_context(ctx); GLuint i; - intelFinish(&intel->ctx); + intelFlush(&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, intel->front_region); - intel_region_map(intel, intel->back_region); - intel_region_map(intel, intel->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; @@ -344,14 +678,6 @@ intelSpanRenderFinish(GLcontext * ctx) _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->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; @@ -378,26 +704,108 @@ intelInitSpanFuncs(GLcontext * ctx) * 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) +static void +intel_set_span_functions(struct intel_context *intel, + struct gl_renderbuffer *rb) { + struct intel_renderbuffer *irb = (struct intel_renderbuffer *) rb; + uint32_t tiling; + + /* If in GEM mode, we need to do the tile address swizzling ourselves, + * instead of the fence registers handling it. + */ + if (intel->ttm) + tiling = irb->region->tiling; + else + tiling = I915_TILING_NONE; + if (rb->_ActualFormat == GL_RGB5) { /* 565 RGB */ - intelInitPointers_RGB565(rb); + switch (tiling) { + case I915_TILING_NONE: + default: + intelInitPointers_RGB565(rb); + break; + case I915_TILING_X: + intel_XTile_InitPointers_RGB565(rb); + break; + case I915_TILING_Y: + intel_YTile_InitPointers_RGB565(rb); + break; + } + } + else if (rb->_ActualFormat == GL_RGB8) { + /* 8888 RGBx */ + switch (tiling) { + case I915_TILING_NONE: + default: + intelInitPointers_xRGB8888(rb); + break; + case I915_TILING_X: + intel_XTile_InitPointers_xRGB8888(rb); + break; + case I915_TILING_Y: + intel_YTile_InitPointers_xRGB8888(rb); + break; + } } else if (rb->_ActualFormat == GL_RGBA8) { /* 8888 RGBA */ - intelInitPointers_ARGB8888(rb); + switch (tiling) { + case I915_TILING_NONE: + default: + intelInitPointers_ARGB8888(rb); + break; + case I915_TILING_X: + intel_XTile_InitPointers_ARGB8888(rb); + break; + case I915_TILING_Y: + intel_YTile_InitPointers_ARGB8888(rb); + break; + } } else if (rb->_ActualFormat == GL_DEPTH_COMPONENT16) { - intelInitDepthPointers_z16(rb); + switch (tiling) { + case I915_TILING_NONE: + default: + intelInitDepthPointers_z16(rb); + break; + case I915_TILING_X: + intel_XTile_InitDepthPointers_z16(rb); + break; + case I915_TILING_Y: + intel_YTile_InitDepthPointers_z16(rb); + break; + } } else if (rb->_ActualFormat == GL_DEPTH_COMPONENT24 || /* XXX FBO remove */ rb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT) { - intelInitDepthPointers_z24_s8(rb); + switch (tiling) { + case I915_TILING_NONE: + default: + intelInitDepthPointers_z24_s8(rb); + break; + case I915_TILING_X: + intel_XTile_InitDepthPointers_z24_s8(rb); + break; + case I915_TILING_Y: + intel_YTile_InitDepthPointers_z24_s8(rb); + break; + } } - else if (rb->_ActualFormat == GL_STENCIL_INDEX8_EXT) { /* XXX FBO remove */ - intelInitStencilPointers_z24_s8(rb); + else if (rb->_ActualFormat == GL_STENCIL_INDEX8_EXT) { + switch (tiling) { + case I915_TILING_NONE: + default: + intelInitStencilPointers_z24_s8(rb); + break; + case I915_TILING_X: + intel_XTile_InitStencilPointers_z24_s8(rb); + break; + case I915_TILING_Y: + intel_YTile_InitStencilPointers_z24_s8(rb); + break; + } } else { _mesa_problem(NULL, diff --git a/src/mesa/drivers/dri/intel/intel_span.h b/src/mesa/drivers/dri/intel/intel_span.h index 5201f6d6c6..acbeb4abe1 100644 --- a/src/mesa/drivers/dri/intel/intel_span.h +++ b/src/mesa/drivers/dri/intel/intel_span.h @@ -32,7 +32,9 @@ 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); +void intel_renderbuffer_map(struct intel_context *intel, + struct gl_renderbuffer *rb); +void intel_renderbuffer_unmap(struct intel_context *intel, + struct gl_renderbuffer *rb); #endif diff --git a/src/mesa/drivers/dri/intel/intel_tex.c b/src/mesa/drivers/dri/intel/intel_tex.c index f1d6a6dbfc..23455a4c74 100644 --- a/src/mesa/drivers/dri/intel/intel_tex.c +++ b/src/mesa/drivers/dri/intel/intel_tex.c @@ -1,7 +1,7 @@ #include "swrast/swrast.h" -#include "texobj.h" -#include "teximage.h" -#include "mipmap.h" +#include "main/texobj.h" +#include "main/teximage.h" +#include "main/mipmap.h" #include "intel_context.h" #include "intel_mipmap_tree.h" #include "intel_tex.h" @@ -174,6 +174,7 @@ void intel_generate_mipmap(GLcontext *ctx, GLenum target, struct gl_texture_object *texObj) { + struct intel_context *intel = intel_context(ctx); struct intel_texture_object *intelObj = intel_texture_object(texObj); GLuint nr_faces = (intelObj->base.Target == GL_TEXTURE_CUBE_MAP) ? 6 : 1; int face, i; @@ -193,6 +194,10 @@ intel_generate_mipmap(GLcontext *ctx, GLenum target, intelImage->level = i; intelImage->face = face; + /* Unreference the miptree to signal that the new Data is a bare + * pointer from mesa. + */ + intel_miptree_release(intel, &intelImage->mt); } } } @@ -202,9 +207,9 @@ static void intelGenerateMipmap(GLcontext *ctx, GLenum target, struct gl_texture struct intel_context *intel = intel_context(ctx); struct intel_texture_object *intelObj = intel_texture_object(texObj); - intel_tex_map_images(intel, intelObj); + intel_tex_map_level_images(intel, intelObj, texObj->BaseLevel); intel_generate_mipmap(ctx, target, texObj); - intel_tex_unmap_images(intel, intelObj); + intel_tex_unmap_level_images(intel, intelObj, texObj->BaseLevel); } void diff --git a/src/mesa/drivers/dri/intel/intel_tex.h b/src/mesa/drivers/dri/intel/intel_tex.h index 60ab8203e5..6219c1c953 100644 --- a/src/mesa/drivers/dri/intel/intel_tex.h +++ b/src/mesa/drivers/dri/intel/intel_tex.h @@ -28,7 +28,7 @@ #ifndef INTELTEX_INC #define INTELTEX_INC -#include "mtypes.h" +#include "main/mtypes.h" #include "intel_context.h" #include "texmem.h" @@ -142,6 +142,14 @@ void intelSetTexBuffer(__DRIcontext *pDRICtx, GLuint intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit); +void intel_tex_map_level_images(struct intel_context *intel, + struct intel_texture_object *intelObj, + int level); + +void intel_tex_unmap_level_images(struct intel_context *intel, + struct intel_texture_object *intelObj, + int level); + void intel_tex_map_images(struct intel_context *intel, struct intel_texture_object *intelObj); diff --git a/src/mesa/drivers/dri/intel/intel_tex_copy.c b/src/mesa/drivers/dri/intel/intel_tex_copy.c index 1add7c6188..a7b88b39c0 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_copy.c +++ b/src/mesa/drivers/dri/intel/intel_tex_copy.c @@ -25,11 +25,11 @@ * **************************************************************************/ -#include "mtypes.h" -#include "enums.h" -#include "image.h" -#include "teximage.h" -#include "mipmap.h" +#include "main/mtypes.h" +#include "main/enums.h" +#include "main/image.h" +#include "main/teximage.h" +#include "main/mipmap.h" #include "swrast/swrast.h" #include "intel_screen.h" @@ -144,15 +144,13 @@ do_copy_texsubimage(struct intel_context *intel, -src->pitch, src->buffer, src->height * src->pitch * src->cpp, - GL_FALSE, + src->tiling, intelImage->mt->pitch, intelImage->mt->region->buffer, image_offset, - intelImage->mt->region->tiled, + intelImage->mt->region->tiling, x, y + height, dstx, dsty, width, height, GL_COPY); /* ? */ - - intel_batchbuffer_flush(intel->batch); } } diff --git a/src/mesa/drivers/dri/intel/intel_tex_format.c b/src/mesa/drivers/dri/intel/intel_tex_format.c index 349a29bd71..2be060dd3e 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_format.c +++ b/src/mesa/drivers/dri/intel/intel_tex_format.c @@ -1,7 +1,7 @@ #include "intel_context.h" #include "intel_tex.h" -#include "texformat.h" -#include "enums.h" +#include "main/texformat.h" +#include "main/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 @@ -138,7 +138,7 @@ intelChooseTextureFormat(GLcontext * ctx, GLint internalFormat, case GL_DEPTH_STENCIL_EXT: case GL_DEPTH24_STENCIL8_EXT: - return &_mesa_texformat_z24_s8; + return &_mesa_texformat_s8_z24; #ifndef I915 case GL_SRGB_EXT: diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c index f261034c18..2ac7dceb0f 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_image.c +++ b/src/mesa/drivers/dri/intel/intel_tex_image.c @@ -2,26 +2,25 @@ #include <stdlib.h> #include <stdio.h> -#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 "teximage.h" +#include "main/glheader.h" +#include "main/macros.h" +#include "main/mtypes.h" +#include "main/enums.h" +#include "main/colortab.h" +#include "main/convolve.h" +#include "main/context.h" +#include "main/simple_list.h" +#include "main/texcompress.h" +#include "main/texformat.h" +#include "main/texobj.h" +#include "main/texstore.h" +#include "main/teximage.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" #include "intel_fbo.h" @@ -238,8 +237,6 @@ try_pbo_upload(struct intel_context *intel, dst_stride, dst_buffer, dst_offset, GL_FALSE, 0, 0, 0, 0, width, height, GL_COPY); - - intel_batchbuffer_flush(intel->batch); } UNLOCK_HARDWARE(intel); @@ -400,10 +397,25 @@ intelTexImage(GLcontext * ctx, intel_miptree_reference(&intelImage->mt, intelObj->mt); assert(intelImage->mt); - } + } else if (intelImage->base.Border == 0) { + int comp_byte = 0; + + if (intelImage->base.IsCompressed) { + comp_byte = + intel_compressed_num_bytes(intelImage->base.TexFormat->MesaFormat); + } + + /* Didn't fit in the object miptree, but it's suitable for inclusion in + * a miptree, so create one just for our level and store it in the image. + * It'll get moved into the object miptree at validate time. + */ + intelImage->mt = intel_miptree_create(intel, target, internalFormat, + level, level, + width, height, depth, + intelImage->base.TexFormat->TexelBytes, + comp_byte); - if (!intelImage->mt) - DBG("XXX: Image did not fit into tree - storing in local memory!\n"); + } /* PBO fastpaths: */ @@ -718,9 +730,15 @@ intelSetTexBuffer(__DRIcontext *pDRICtx, GLint target, __DRIdrawable *dPriv) if (!intelObj) return; - __driParseEvents(pDRICtx, dPriv); + intel_update_renderbuffers(pDRICtx, dPriv); rb = intel_fb->color_rb[0]; + /* If the region isn't set, then intel_update_renderbuffers was unable + * to get the buffers for the drawable. + */ + if (rb->region == NULL) + return; + type = GL_BGRA; format = GL_UNSIGNED_BYTE; internalFormat = (rb->region->cpp == 3 ? 3 : 4); @@ -739,7 +757,7 @@ intelSetTexBuffer(__DRIcontext *pDRICtx, GLint target, __DRIdrawable *dPriv) intelObj->mt = mt; texImage = _mesa_get_tex_image(&intel->ctx, texObj, target, level); _mesa_init_teximage_fields(&intel->ctx, target, texImage, - rb->region->pitch, rb->region->height, 1, + rb->region->width, rb->region->height, 1, 0, internalFormat); intelImage = intel_texture_image(texImage); diff --git a/src/mesa/drivers/dri/intel/intel_tex_layout.c b/src/mesa/drivers/dri/intel/intel_tex_layout.c index edc3a2eaa4..e6f9a41779 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_layout.c +++ b/src/mesa/drivers/dri/intel/intel_tex_layout.c @@ -33,7 +33,7 @@ #include "intel_mipmap_tree.h" #include "intel_tex_layout.h" #include "intel_context.h" -#include "macros.h" +#include "main/macros.h" GLuint intel_compressed_alignment(GLenum internalFormat) { diff --git a/src/mesa/drivers/dri/intel/intel_tex_layout.h b/src/mesa/drivers/dri/intel/intel_tex_layout.h index 193699d3f7..dbc90e6f9b 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_layout.h +++ b/src/mesa/drivers/dri/intel/intel_tex_layout.h @@ -30,7 +30,7 @@ * Michel Dänzer <michel@tungstengraphics.com> */ -#include "macros.h" +#include "main/macros.h" static GLuint minify( GLuint d ) diff --git a/src/mesa/drivers/dri/intel/intel_tex_subimage.c b/src/mesa/drivers/dri/intel/intel_tex_subimage.c index 5428a1d068..b752361886 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_subimage.c +++ b/src/mesa/drivers/dri/intel/intel_tex_subimage.c @@ -26,11 +26,11 @@ * **************************************************************************/ -#include "mtypes.h" -#include "texobj.h" -#include "texstore.h" -#include "texcompress.h" -#include "enums.h" +#include "main/mtypes.h" +#include "main/texobj.h" +#include "main/texstore.h" +#include "main/texcompress.h" +#include "main/enums.h" #include "intel_context.h" #include "intel_tex.h" diff --git a/src/mesa/drivers/dri/intel/intel_tex_validate.c b/src/mesa/drivers/dri/intel/intel_tex_validate.c index f56c236e61..3dae738ac2 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_validate.c +++ b/src/mesa/drivers/dri/intel/intel_tex_validate.c @@ -1,5 +1,5 @@ -#include "mtypes.h" -#include "macros.h" +#include "main/mtypes.h" +#include "main/macros.h" #include "intel_context.h" #include "intel_batchbuffer.h" @@ -125,13 +125,10 @@ intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit) struct intel_texture_object *intelObj = intel_texture_object(tObj); int comp_byte = 0; int cpp; - GLuint face, i; GLuint nr_faces = 0; struct intel_texture_image *firstImage; - GLboolean need_flush = GL_FALSE; - /* We know/require this is true by now: */ assert(intelObj->base._Complete); @@ -227,74 +224,77 @@ intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit) */ if (intelObj->mt != intelImage->mt) { copy_image_data_to_tree(intel, intelObj, intelImage); - need_flush = GL_TRUE; } } } -#ifdef I915 - /* XXX: what is this flush about? - * On 965, it causes a batch flush in the middle of the state relocation - * emits, which means that the eventual rendering doesn't have all of the - * required relocations in place. - */ - if (need_flush) - intel_batchbuffer_flush(intel->batch); -#endif - return GL_TRUE; } +void +intel_tex_map_level_images(struct intel_context *intel, + struct intel_texture_object *intelObj, + int level) +{ + GLuint nr_faces = (intelObj->base.Target == GL_TEXTURE_CUBE_MAP) ? 6 : 1; + GLuint face; + for (face = 0; face < nr_faces; face++) { + struct intel_texture_image *intelImage = + intel_texture_image(intelObj->base.Image[face][level]); + + 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_map_images(struct intel_context *intel, - struct intel_texture_object *intelObj) +intel_tex_unmap_level_images(struct intel_context *intel, + struct intel_texture_object *intelObj, + int level) { GLuint nr_faces = (intelObj->base.Target == GL_TEXTURE_CUBE_MAP) ? 6 : 1; - GLuint face, i; - - DBG("%s\n", __FUNCTION__); + GLuint face; 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]); + struct intel_texture_image *intelImage = + intel_texture_image(intelObj->base.Image[face][level]); - 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; */ - } + if (intelImage->mt) { + intel_miptree_image_unmap(intel, intelImage->mt); + intelImage->base.Data = NULL; } } } +void +intel_tex_map_images(struct intel_context *intel, + struct intel_texture_object *intelObj) +{ + int i; + + DBG("%s\n", __FUNCTION__); + for (i = intelObj->firstLevel; i <= intelObj->lastLevel; i++) + intel_tex_map_level_images(intel, intelObj, i); +} 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; + int 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; - } - } - } + for (i = intelObj->firstLevel; i <= intelObj->lastLevel; i++) + intel_tex_unmap_level_images(intel, intelObj, i); } diff --git a/src/mesa/drivers/dri/mach64/mach64_context.c b/src/mesa/drivers/dri/mach64/mach64_context.c index f730c831e4..99abd209b6 100644 --- a/src/mesa/drivers/dri/mach64/mach64_context.c +++ b/src/mesa/drivers/dri/mach64/mach64_context.c @@ -1,4 +1,4 @@ -/* $XFree86$ */ /* -*- mode: c; c-basic-offset: 3 -*- */ +/* -*- mode: c; c-basic-offset: 3 -*- */ /* * Copyright 2000 Gareth Hughes * All Rights Reserved. @@ -29,12 +29,12 @@ * Jos�Fonseca <j_r_fonseca@yahoo.co.uk> */ -#include "glheader.h" -#include "context.h" -#include "simple_list.h" -#include "imports.h" -#include "matrix.h" -#include "extensions.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/simple_list.h" +#include "main/imports.h" +#include "main/matrix.h" +#include "main/extensions.h" #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" diff --git a/src/mesa/drivers/dri/mach64/mach64_context.h b/src/mesa/drivers/dri/mach64/mach64_context.h index c602333024..55e0618ff8 100644 --- a/src/mesa/drivers/dri/mach64/mach64_context.h +++ b/src/mesa/drivers/dri/mach64/mach64_context.h @@ -1,4 +1,4 @@ -/* $XFree86$ */ /* -*- mode: c; c-basic-offset: 3 -*- */ +/* -*- mode: c; c-basic-offset: 3 -*- */ /* * Copyright 2000 Gareth Hughes * All Rights Reserved. @@ -36,7 +36,7 @@ #include "drm.h" #include "mach64_drm.h" -#include "mtypes.h" +#include "main/mtypes.h" #include "mach64_reg.h" diff --git a/src/mesa/drivers/dri/mach64/mach64_dd.c b/src/mesa/drivers/dri/mach64/mach64_dd.c index 17e8d74d9f..e400e9a918 100644 --- a/src/mesa/drivers/dri/mach64/mach64_dd.c +++ b/src/mesa/drivers/dri/mach64/mach64_dd.c @@ -1,4 +1,4 @@ -/* $XFree86$ */ /* -*- mode: c; c-basic-offset: 3 -*- */ +/* -*- mode: c; c-basic-offset: 3 -*- */ /* * Copyright 2000 Gareth Hughes * All Rights Reserved. @@ -35,9 +35,10 @@ #include "mach64_vb.h" #include "mach64_dd.h" -#include "context.h" +#include "main/context.h" +#include "main/framebuffer.h" + #include "utils.h" -#include "framebuffer.h" #define DRIVER_DATE "20051019" diff --git a/src/mesa/drivers/dri/mach64/mach64_dd.h b/src/mesa/drivers/dri/mach64/mach64_dd.h index 74cf1d304f..0a2ce06412 100644 --- a/src/mesa/drivers/dri/mach64/mach64_dd.h +++ b/src/mesa/drivers/dri/mach64/mach64_dd.h @@ -1,4 +1,4 @@ -/* $XFree86$ */ /* -*- mode: c; c-basic-offset: 3 -*- */ +/* -*- mode: c; c-basic-offset: 3 -*- */ /* * Copyright 2000 Gareth Hughes * All Rights Reserved. diff --git a/src/mesa/drivers/dri/mach64/mach64_ioctl.c b/src/mesa/drivers/dri/mach64/mach64_ioctl.c index 3bcec50cf8..ef5c0625c3 100644 --- a/src/mesa/drivers/dri/mach64/mach64_ioctl.c +++ b/src/mesa/drivers/dri/mach64/mach64_ioctl.c @@ -1,4 +1,4 @@ -/* $XFree86$ */ /* -*- mode: c; c-basic-offset: 3 -*- */ +/* -*- mode: c; c-basic-offset: 3 -*- */ /* * Copyright 2000 Gareth Hughes * All Rights Reserved. @@ -35,8 +35,8 @@ #include "mach64_ioctl.h" #include "mach64_tex.h" -#include "imports.h" -#include "macros.h" +#include "main/imports.h" +#include "main/macros.h" #include "swrast/swrast.h" diff --git a/src/mesa/drivers/dri/mach64/mach64_ioctl.h b/src/mesa/drivers/dri/mach64/mach64_ioctl.h index 3e5faff4e6..6ef9bc0bca 100644 --- a/src/mesa/drivers/dri/mach64/mach64_ioctl.h +++ b/src/mesa/drivers/dri/mach64/mach64_ioctl.h @@ -1,4 +1,4 @@ -/* $XFree86$ */ /* -*- mode: c; c-basic-offset: 3 -*- */ +/* -*- mode: c; c-basic-offset: 3 -*- */ /* * Copyright 2000 Gareth Hughes * All Rights Reserved. diff --git a/src/mesa/drivers/dri/mach64/mach64_lock.c b/src/mesa/drivers/dri/mach64/mach64_lock.c index 13e212b81d..d018ba4174 100644 --- a/src/mesa/drivers/dri/mach64/mach64_lock.c +++ b/src/mesa/drivers/dri/mach64/mach64_lock.c @@ -1,4 +1,4 @@ -/* $XFree86$ */ /* -*- mode: c; c-basic-offset: 3 -*- */ +/* -*- mode: c; c-basic-offset: 3 -*- */ /* * Copyright 2000 Gareth Hughes * All Rights Reserved. diff --git a/src/mesa/drivers/dri/mach64/mach64_lock.h b/src/mesa/drivers/dri/mach64/mach64_lock.h index 973880ee25..3130b183e3 100644 --- a/src/mesa/drivers/dri/mach64/mach64_lock.h +++ b/src/mesa/drivers/dri/mach64/mach64_lock.h @@ -1,4 +1,4 @@ -/* $XFree86$ */ /* -*- mode: c; c-basic-offset: 3 -*- */ +/* -*- mode: c; c-basic-offset: 3 -*- */ /* * Copyright 2000 Gareth Hughes * All Rights Reserved. diff --git a/src/mesa/drivers/dri/mach64/mach64_native_vb.c b/src/mesa/drivers/dri/mach64/mach64_native_vb.c index 248fa2a9a2..99f1a14e17 100644 --- a/src/mesa/drivers/dri/mach64/mach64_native_vb.c +++ b/src/mesa/drivers/dri/mach64/mach64_native_vb.c @@ -1,4 +1,4 @@ -/* $XFree86$ */ /* -*- mode: c; c-basic-offset: 3 -*- */ +/* -*- mode: c; c-basic-offset: 3 -*- */ /* * Mesa 3-D graphics library * Version: 3.5 diff --git a/src/mesa/drivers/dri/mach64/mach64_native_vbtmp.h b/src/mesa/drivers/dri/mach64/mach64_native_vbtmp.h index f64b808ee7..684f2acc89 100644 --- a/src/mesa/drivers/dri/mach64/mach64_native_vbtmp.h +++ b/src/mesa/drivers/dri/mach64/mach64_native_vbtmp.h @@ -1,4 +1,4 @@ -/* $XFree86$ */ /* -*- mode: c; c-basic-offset: 3 -*- */ +/* -*- mode: c; c-basic-offset: 3 -*- */ /* * Mesa 3-D graphics library * Version: 3.5 diff --git a/src/mesa/drivers/dri/mach64/mach64_reg.h b/src/mesa/drivers/dri/mach64/mach64_reg.h index abbba295a5..cb944e1023 100644 --- a/src/mesa/drivers/dri/mach64/mach64_reg.h +++ b/src/mesa/drivers/dri/mach64/mach64_reg.h @@ -1,4 +1,4 @@ -/* $XFree86$ */ /* -*- mode: c; c-basic-offset: 3 -*- */ +/* -*- mode: c; c-basic-offset: 3 -*- */ /* * Copyright 2000 Gareth Hughes * All Rights Reserved. diff --git a/src/mesa/drivers/dri/mach64/mach64_screen.c b/src/mesa/drivers/dri/mach64/mach64_screen.c index 2dba50fc1f..6bfb4c32b1 100644 --- a/src/mesa/drivers/dri/mach64/mach64_screen.c +++ b/src/mesa/drivers/dri/mach64/mach64_screen.c @@ -1,4 +1,4 @@ -/* $XFree86$ */ /* -*- mode: c; c-basic-offset: 3 -*- */ +/* -*- mode: c; c-basic-offset: 3 -*- */ /* * Copyright 2000 Gareth Hughes * All Rights Reserved. @@ -35,10 +35,10 @@ #include "mach64_vb.h" #include "mach64_span.h" -#include "context.h" -#include "imports.h" -#include "framebuffer.h" -#include "renderbuffer.h" +#include "main/context.h" +#include "main/imports.h" +#include "main/framebuffer.h" +#include "main/renderbuffer.h" #include "utils.h" #include "vblank.h" @@ -91,8 +91,8 @@ mach64FillInModes( __DRIscreenPrivate *psp, GLX_NONE, GLX_SWAP_UNDEFINED_OML /*, GLX_SWAP_COPY_OML */ }; - u_int8_t depth_bits_array[2]; - u_int8_t stencil_bits_array[2]; + uint8_t depth_bits_array[2]; + uint8_t stencil_bits_array[2]; depth_bits_array[0] = depth_bits; depth_bits_array[1] = depth_bits; diff --git a/src/mesa/drivers/dri/mach64/mach64_screen.h b/src/mesa/drivers/dri/mach64/mach64_screen.h index 766554d7e4..be5e29a3e5 100644 --- a/src/mesa/drivers/dri/mach64/mach64_screen.h +++ b/src/mesa/drivers/dri/mach64/mach64_screen.h @@ -1,4 +1,4 @@ -/* $XFree86$ */ /* -*- mode: c; c-basic-offset: 3 -*- */ +/* -*- mode: c; c-basic-offset: 3 -*- */ /* * Copyright 2000 Gareth Hughes * All Rights Reserved. diff --git a/src/mesa/drivers/dri/mach64/mach64_span.c b/src/mesa/drivers/dri/mach64/mach64_span.c index 3830a28165..91d46ce32e 100644 --- a/src/mesa/drivers/dri/mach64/mach64_span.c +++ b/src/mesa/drivers/dri/mach64/mach64_span.c @@ -1,4 +1,4 @@ -/* $XFree86$ */ /* -*- mode: c; c-basic-offset: 3 -*- */ +/* -*- mode: c; c-basic-offset: 3 -*- */ /* * Copyright 2000 Gareth Hughes * All Rights Reserved. @@ -117,6 +117,8 @@ /* 16 bit depthbuffer functions. */ +#define VALUE_TYPE GLushort + #define WRITE_DEPTH( _x, _y, d ) \ *(GLushort *)(buf + ((_x) + (_y) * drb->pitch) * 2) = d; diff --git a/src/mesa/drivers/dri/mach64/mach64_span.h b/src/mesa/drivers/dri/mach64/mach64_span.h index 0f4c766477..65141d05c3 100644 --- a/src/mesa/drivers/dri/mach64/mach64_span.h +++ b/src/mesa/drivers/dri/mach64/mach64_span.h @@ -1,4 +1,4 @@ -/* $XFree86$ */ /* -*- mode: c; c-basic-offset: 3 -*- */ +/* -*- mode: c; c-basic-offset: 3 -*- */ /* * Copyright 2000 Gareth Hughes * All Rights Reserved. diff --git a/src/mesa/drivers/dri/mach64/mach64_state.c b/src/mesa/drivers/dri/mach64/mach64_state.c index 10a5b40ba1..3a023187ce 100644 --- a/src/mesa/drivers/dri/mach64/mach64_state.c +++ b/src/mesa/drivers/dri/mach64/mach64_state.c @@ -1,4 +1,4 @@ -/* $XFree86$ */ /* -*- mode: c; c-basic-offset: 3 -*- */ +/* -*- mode: c; c-basic-offset: 3 -*- */ /* * Copyright 2000 Gareth Hughes * All Rights Reserved. @@ -36,9 +36,9 @@ #include "mach64_vb.h" #include "mach64_tex.h" -#include "context.h" -#include "enums.h" -#include "colormac.h" +#include "main/context.h" +#include "main/enums.h" +#include "main/colormac.h" #include "swrast/swrast.h" #include "vbo/vbo.h" #include "tnl/tnl.h" diff --git a/src/mesa/drivers/dri/mach64/mach64_state.h b/src/mesa/drivers/dri/mach64/mach64_state.h index 95bcab3653..23081cb2fe 100644 --- a/src/mesa/drivers/dri/mach64/mach64_state.h +++ b/src/mesa/drivers/dri/mach64/mach64_state.h @@ -1,4 +1,4 @@ -/* $XFree86$ */ /* -*- mode: c; c-basic-offset: 3 -*- */ +/* -*- mode: c; c-basic-offset: 3 -*- */ /* * Copyright 2000 Gareth Hughes * All Rights Reserved. diff --git a/src/mesa/drivers/dri/mach64/mach64_tex.c b/src/mesa/drivers/dri/mach64/mach64_tex.c index 5288d321ce..1f9d3c57eb 100644 --- a/src/mesa/drivers/dri/mach64/mach64_tex.c +++ b/src/mesa/drivers/dri/mach64/mach64_tex.c @@ -1,4 +1,4 @@ -/* $XFree86$ */ /* -*- mode: c; c-basic-offset: 3 -*- */ +/* -*- mode: c; c-basic-offset: 3 -*- */ /* * Copyright 2000 Gareth Hughes * All Rights Reserved. @@ -36,15 +36,15 @@ #include "mach64_tris.h" #include "mach64_tex.h" -#include "context.h" -#include "macros.h" -#include "simple_list.h" -#include "enums.h" -#include "texstore.h" -#include "texformat.h" -#include "teximage.h" -#include "texobj.h" -#include "imports.h" +#include "main/context.h" +#include "main/macros.h" +#include "main/simple_list.h" +#include "main/enums.h" +#include "main/texstore.h" +#include "main/texformat.h" +#include "main/teximage.h" +#include "main/texobj.h" +#include "main/imports.h" static void mach64SetTexWrap( mach64TexObjPtr t, diff --git a/src/mesa/drivers/dri/mach64/mach64_tex.h b/src/mesa/drivers/dri/mach64/mach64_tex.h index 933cfbbab4..8e0b23ed15 100644 --- a/src/mesa/drivers/dri/mach64/mach64_tex.h +++ b/src/mesa/drivers/dri/mach64/mach64_tex.h @@ -1,4 +1,4 @@ -/* $XFree86$ */ /* -*- mode: c; c-basic-offset: 3 -*- */ +/* -*- mode: c; c-basic-offset: 3 -*- */ /* * Copyright 2000 Gareth Hughes * All Rights Reserved. diff --git a/src/mesa/drivers/dri/mach64/mach64_texmem.c b/src/mesa/drivers/dri/mach64/mach64_texmem.c index 3b7b93b984..734e547952 100644 --- a/src/mesa/drivers/dri/mach64/mach64_texmem.c +++ b/src/mesa/drivers/dri/mach64/mach64_texmem.c @@ -1,4 +1,4 @@ -/* $XFree86$ */ /* -*- mode: c; c-basic-offset: 3 -*- */ +/* -*- mode: c; c-basic-offset: 3 -*- */ /* * Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc., * Cedar Park, Texas. @@ -38,11 +38,11 @@ #include "mach64_tris.h" #include "mach64_tex.h" -#include "context.h" -#include "macros.h" -#include "simple_list.h" -#include "texformat.h" -#include "imports.h" +#include "main/context.h" +#include "main/macros.h" +#include "main/simple_list.h" +#include "main/texformat.h" +#include "main/imports.h" /* Destroy hardware state associated with texture `t'. diff --git a/src/mesa/drivers/dri/mach64/mach64_texstate.c b/src/mesa/drivers/dri/mach64/mach64_texstate.c index 3ace370d70..fd2369dd88 100644 --- a/src/mesa/drivers/dri/mach64/mach64_texstate.c +++ b/src/mesa/drivers/dri/mach64/mach64_texstate.c @@ -1,4 +1,4 @@ -/* $XFree86$ */ /* -*- mode: c; c-basic-offset: 3 -*- */ +/* -*- mode: c; c-basic-offset: 3 -*- */ /* * Copyright 2000 Gareth Hughes * All Rights Reserved. @@ -29,11 +29,11 @@ * José Fonseca <j_r_fonseca@yahoo.co.uk> */ -#include "glheader.h" -#include "imports.h" -#include "context.h" -#include "macros.h" -#include "texformat.h" +#include "main/glheader.h" +#include "main/imports.h" +#include "main/context.h" +#include "main/macros.h" +#include "main/texformat.h" #include "mach64_context.h" #include "mach64_ioctl.h" diff --git a/src/mesa/drivers/dri/mach64/mach64_tris.c b/src/mesa/drivers/dri/mach64/mach64_tris.c index 5ce348f34d..f2e8e2e3ae 100644 --- a/src/mesa/drivers/dri/mach64/mach64_tris.c +++ b/src/mesa/drivers/dri/mach64/mach64_tris.c @@ -1,4 +1,4 @@ -/* $XFree86$ */ /* -*- mode: c; c-basic-offset: 3 -*- */ +/* -*- mode: c; c-basic-offset: 3 -*- */ /* * Copyright 2000 Gareth Hughes * All Rights Reserved. @@ -29,10 +29,10 @@ * José Fonseca <j_r_fonseca@yahoo.co.uk> */ -#include "glheader.h" -#include "mtypes.h" -#include "colormac.h" -#include "macros.h" +#include "main/glheader.h" +#include "main/mtypes.h" +#include "main/colormac.h" +#include "main/macros.h" #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" diff --git a/src/mesa/drivers/dri/mach64/mach64_tris.h b/src/mesa/drivers/dri/mach64/mach64_tris.h index 208703289d..042df42f5b 100644 --- a/src/mesa/drivers/dri/mach64/mach64_tris.h +++ b/src/mesa/drivers/dri/mach64/mach64_tris.h @@ -1,4 +1,4 @@ -/* $XFree86$ */ /* -*- mode: c; c-basic-offset: 3 -*- */ +/* -*- mode: c; c-basic-offset: 3 -*- */ /* * Copyright 2000 Gareth Hughes * All Rights Reserved. @@ -31,7 +31,7 @@ #ifndef __MACH64_TRIS_H__ #define __MACH64_TRIS_H__ -#include "mtypes.h" +#include "main/mtypes.h" extern void mach64InitTriFuncs( GLcontext *ctx ); diff --git a/src/mesa/drivers/dri/mach64/mach64_vb.c b/src/mesa/drivers/dri/mach64/mach64_vb.c index 83a5f73e6b..e58812e902 100644 --- a/src/mesa/drivers/dri/mach64/mach64_vb.c +++ b/src/mesa/drivers/dri/mach64/mach64_vb.c @@ -1,4 +1,4 @@ -/* $XFree86$ */ /* -*- mode: c; c-basic-offset: 3 -*- */ +/* -*- mode: c; c-basic-offset: 3 -*- */ /* * Copyright 2000 Gareth Hughes * All Rights Reserved. @@ -29,11 +29,11 @@ * José Fonseca <j_r_fonseca@yahoo.co.uk> */ -#include "glheader.h" -#include "mtypes.h" -#include "imports.h" -#include "macros.h" -#include "colormac.h" +#include "main/glheader.h" +#include "main/mtypes.h" +#include "main/imports.h" +#include "main/macros.h" +#include "main/colormac.h" #include "swrast_setup/swrast_setup.h" #include "tnl/t_context.h" diff --git a/src/mesa/drivers/dri/mach64/mach64_vb.h b/src/mesa/drivers/dri/mach64/mach64_vb.h index bcc4759af3..e0b366916b 100644 --- a/src/mesa/drivers/dri/mach64/mach64_vb.h +++ b/src/mesa/drivers/dri/mach64/mach64_vb.h @@ -1,4 +1,4 @@ -/* $XFree86$ */ /* -*- mode: c; c-basic-offset: 3 -*- */ +/* -*- mode: c; c-basic-offset: 3 -*- */ /* * Copyright 2000 Gareth Hughes * All Rights Reserved. @@ -32,7 +32,7 @@ #ifndef __MACH64_VB_H__ #define __MACH64_VB_H__ -#include "mtypes.h" +#include "main/mtypes.h" #include "swrast/swrast.h" #include "mach64_context.h" diff --git a/src/mesa/drivers/dri/mach64/mach64_vbtmp.h b/src/mesa/drivers/dri/mach64/mach64_vbtmp.h index c1207cacd1..938804af9e 100644 --- a/src/mesa/drivers/dri/mach64/mach64_vbtmp.h +++ b/src/mesa/drivers/dri/mach64/mach64_vbtmp.h @@ -1,4 +1,4 @@ -/* $XFree86$ */ /* -*- mode: c; c-basic-offset: 3 -*- */ +/* -*- mode: c; c-basic-offset: 3 -*- */ /* * Mesa 3-D graphics library * Version: 3.5 diff --git a/src/mesa/drivers/dri/mach64/server/mach64_dri.h b/src/mesa/drivers/dri/mach64/server/mach64_dri.h index 139668e3f3..1477443f79 100644 --- a/src/mesa/drivers/dri/mach64/server/mach64_dri.h +++ b/src/mesa/drivers/dri/mach64/server/mach64_dri.h @@ -1,4 +1,4 @@ -/* $XFree86$ */ /* -*- mode: c; c-basic-offset: 3 -*- */ +/* -*- mode: c; c-basic-offset: 3 -*- */ /* * Copyright 2000 Gareth Hughes * All Rights Reserved. diff --git a/src/mesa/drivers/dri/mga/mga_texcombine.c b/src/mesa/drivers/dri/mga/mga_texcombine.c index bbfa29be5f..24083d9651 100644 --- a/src/mesa/drivers/dri/mga/mga_texcombine.c +++ b/src/mesa/drivers/dri/mga/mga_texcombine.c @@ -23,7 +23,7 @@ * Ville Syrjala <syrjala@sci.fi> */ -#include "glheader.h" +#include "main/glheader.h" #include "mgacontext.h" #include "mgatex.h" diff --git a/src/mesa/drivers/dri/mga/mga_texstate.c b/src/mesa/drivers/dri/mga/mga_texstate.c index 71d264b0f1..d4c5b6fd97 100644 --- a/src/mesa/drivers/dri/mga/mga_texstate.c +++ b/src/mesa/drivers/dri/mga/mga_texstate.c @@ -26,23 +26,22 @@ * Ian Romanick <idr@us.ibm.com> * Keith Whitwell <keithw@tungstengraphics.com> */ -/* $XFree86:$ */ #include <stdlib.h> -#include "mm.h" +#include "main/mm.h" #include "mgacontext.h" #include "mgatex.h" #include "mgaregs.h" #include "mgatris.h" #include "mgaioctl.h" -#include "context.h" -#include "enums.h" -#include "macros.h" -#include "imports.h" +#include "main/context.h" +#include "main/enums.h" +#include "main/macros.h" +#include "main/imports.h" -#include "simple_list.h" -#include "texformat.h" +#include "main/simple_list.h" +#include "main/texformat.h" #define MGA_USE_TABLE_FOR_FORMAT #ifdef MGA_USE_TABLE_FOR_FORMAT diff --git a/src/mesa/drivers/dri/mga/mga_xmesa.c b/src/mesa/drivers/dri/mga/mga_xmesa.c index c271c8ef59..86da3a2cac 100644 --- a/src/mesa/drivers/dri/mga/mga_xmesa.c +++ b/src/mesa/drivers/dri/mga/mga_xmesa.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mga_xmesa.c,v 1.19 2003/03/26 20:43:49 tsi Exp $ */ /* * Copyright 2000-2001 VA Linux Systems, Inc. * All Rights Reserved. @@ -35,12 +34,12 @@ #include "drm.h" #include "mga_drm.h" #include "mga_xmesa.h" -#include "context.h" -#include "matrix.h" -#include "simple_list.h" -#include "imports.h" -#include "framebuffer.h" -#include "renderbuffer.h" +#include "main/context.h" +#include "main/matrix.h" +#include "main/simple_list.h" +#include "main/imports.h" +#include "main/framebuffer.h" +#include "main/renderbuffer.h" #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" @@ -65,7 +64,7 @@ #include "utils.h" #include "vblank.h" -#include "extensions.h" +#include "main/extensions.h" #include "drirenderbuffer.h" #include "GL/internal/dri_interface.h" @@ -132,8 +131,8 @@ mgaFillInModes( __DRIscreenPrivate *psp, GLX_NONE, GLX_SWAP_UNDEFINED_OML, GLX_SWAP_COPY_OML }; - u_int8_t depth_bits_array[3]; - u_int8_t stencil_bits_array[3]; + uint8_t depth_bits_array[3]; + uint8_t stencil_bits_array[3]; depth_bits_array[0] = 0; diff --git a/src/mesa/drivers/dri/mga/mga_xmesa.h b/src/mesa/drivers/dri/mga/mga_xmesa.h index 0ab0c63f78..07c22bd596 100644 --- a/src/mesa/drivers/dri/mga/mga_xmesa.h +++ b/src/mesa/drivers/dri/mga/mga_xmesa.h @@ -24,7 +24,6 @@ * Authors: * Keith Whitwell <keith@tungstengraphics.com> */ -/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mga_xmesa.h,v 1.12 2002/12/16 16:18:52 dawes Exp $ */ #ifndef _MGA_INIT_H_ #define _MGA_INIT_H_ @@ -32,7 +31,7 @@ #include <sys/time.h> #include "dri_util.h" #include "mga_drm.h" -#include "mtypes.h" +#include "main/mtypes.h" #include "mgaregs.h" #include "xmlconfig.h" @@ -149,7 +148,7 @@ do { \ #define MGA_BASE( reg ) ((unsigned long)(mmesa->mgaScreen->mmio.map)) #define MGA_ADDR( reg ) (MGA_BASE(reg) + reg) -#define MGA_DEREF( reg ) *(volatile u_int32_t *)MGA_ADDR( reg ) +#define MGA_DEREF( reg ) *(volatile uint32_t *)MGA_ADDR( reg ) #define MGA_READ( reg ) MGA_DEREF( reg ) #endif diff --git a/src/mesa/drivers/dri/mga/mgacontext.h b/src/mesa/drivers/dri/mga/mgacontext.h index 55d823810b..30640a29b3 100644 --- a/src/mesa/drivers/dri/mga/mgacontext.h +++ b/src/mesa/drivers/dri/mga/mgacontext.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgacontext.h,v 1.7 2002/12/16 16:18:52 dawes Exp $*/ /* * Copyright 2000-2001 VA Linux Systems, Inc. * All Rights Reserved. @@ -33,12 +32,12 @@ #include "drm.h" #include "mga_drm.h" #include "dri_util.h" -#include "mtypes.h" #include "xf86drm.h" -#include "mm.h" -#include "colormac.h" +#include "main/mtypes.h" +#include "main/mm.h" +#include "main/colormac.h" +#include "main/macros.h" #include "texmem.h" -#include "macros.h" #include "xmlconfig.h" #define MGA_SET_FIELD(reg,mask,val) reg = ((reg) & (mask)) | ((val) & ~(mask)) diff --git a/src/mesa/drivers/dri/mga/mgadd.c b/src/mesa/drivers/dri/mga/mgadd.c index 6d18bd83d8..3b1ea22b60 100644 --- a/src/mesa/drivers/dri/mga/mgadd.c +++ b/src/mesa/drivers/dri/mga/mgadd.c @@ -24,13 +24,12 @@ * Authors: * Keith Whitwell <keith@tungstengraphics.com> */ -/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgadd.c,v 1.14 2002/10/30 12:51:35 alanh Exp $ */ -#include "mtypes.h" -#include "framebuffer.h" +#include "main/mtypes.h" +#include "main/framebuffer.h" +#include "main/mm.h" -#include "mm.h" #include "mgacontext.h" #include "mgadd.h" #include "mgastate.h" diff --git a/src/mesa/drivers/dri/mga/mgadd.h b/src/mesa/drivers/dri/mga/mgadd.h index f98bfdc878..f92591df45 100644 --- a/src/mesa/drivers/dri/mga/mgadd.h +++ b/src/mesa/drivers/dri/mga/mgadd.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgadd.h,v 1.3 2002/10/30 12:51:35 alanh Exp $ */ /* * Copyright 2000-2001 VA Linux Systems, Inc. * All Rights Reserved. @@ -29,7 +28,7 @@ #ifndef MGADD_INC #define MGADD_INC -#include "context.h" +#include "main/context.h" extern void mgaInitDriverFuncs( struct dd_function_table *functions ); diff --git a/src/mesa/drivers/dri/mga/mgaioctl.c b/src/mesa/drivers/dri/mga/mgaioctl.c index dee9399556..4438bad920 100644 --- a/src/mesa/drivers/dri/mga/mgaioctl.c +++ b/src/mesa/drivers/dri/mga/mgaioctl.c @@ -31,12 +31,12 @@ */ #include <errno.h> -#include "mtypes.h" -#include "macros.h" -#include "dd.h" +#include "main/mtypes.h" +#include "main/macros.h" +#include "main/dd.h" #include "swrast/swrast.h" -#include "mm.h" +#include "main/mm.h" #include "drm.h" #include "mga_drm.h" #include "mgacontext.h" diff --git a/src/mesa/drivers/dri/mga/mgaioctl.h b/src/mesa/drivers/dri/mga/mgaioctl.h index 3a377234e4..dbc823de80 100644 --- a/src/mesa/drivers/dri/mga/mgaioctl.h +++ b/src/mesa/drivers/dri/mga/mgaioctl.h @@ -25,7 +25,6 @@ * Keith Whitwell <keith@tungstengraphics.com> * Gareth Hughes <gareth@valinux.com> */ -/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgaioctl.h,v 1.11 2002/10/30 12:51:36 alanh Exp $ */ #ifndef MGA_IOCTL_H #define MGA_IOCTL_H diff --git a/src/mesa/drivers/dri/mga/mgapixel.c b/src/mesa/drivers/dri/mga/mgapixel.c index 2b9da8c181..9f90047ba5 100644 --- a/src/mesa/drivers/dri/mga/mgapixel.c +++ b/src/mesa/drivers/dri/mga/mgapixel.c @@ -34,10 +34,9 @@ * \author Keith Whitwell <keith@tungstengraphics.com> * \author Gareth Hughes <gareth@valinux.com> */ -/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgapixel.c,v 1.9 2002/11/05 17:46:08 tsi Exp $ */ -#include "mtypes.h" -#include "macros.h" +#include "main/mtypes.h" +#include "main/macros.h" #include "mgadd.h" #include "mgacontext.h" #include "mgaioctl.h" @@ -45,7 +44,7 @@ #include "mgastate.h" #include "swrast/swrast.h" -#include "imports.h" +#include "main/imports.h" #if 0 #define IS_AGP_MEM( mmesa, p ) \ diff --git a/src/mesa/drivers/dri/mga/mgapixel.h b/src/mesa/drivers/dri/mga/mgapixel.h index c44fd769a8..f5f300db56 100644 --- a/src/mesa/drivers/dri/mga/mgapixel.h +++ b/src/mesa/drivers/dri/mga/mgapixel.h @@ -24,12 +24,11 @@ * Authors: * Keith Whitwell <keith@tungstengraphics.com> */ -/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgapixel.h,v 1.5 2002/10/30 12:51:36 alanh Exp $ */ #ifndef MGA_PIXELS_H #define MGA_PIXELS_H -#include "mtypes.h" +#include "main/mtypes.h" extern void mgaDDInitPixelFuncs( GLcontext *ctx ); diff --git a/src/mesa/drivers/dri/mga/mgaregs.h b/src/mesa/drivers/dri/mga/mgaregs.h index e1291ca01b..1ef1e6d24c 100644 --- a/src/mesa/drivers/dri/mga/mgaregs.h +++ b/src/mesa/drivers/dri/mga/mgaregs.h @@ -19,7 +19,6 @@ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgaregs.h,v 1.6 2003/01/12 03:55:46 tsi Exp $ */ #ifndef _MGAREGS_H_ #define _MGAREGS_H_ diff --git a/src/mesa/drivers/dri/mga/mgarender.c b/src/mesa/drivers/dri/mga/mgarender.c index c151f79915..517c3b8f82 100644 --- a/src/mesa/drivers/dri/mga/mgarender.c +++ b/src/mesa/drivers/dri/mga/mgarender.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgarender.c,v 1.4 2002/10/30 12:51:36 alanh Exp $ */ /************************************************************************** Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and @@ -39,11 +38,11 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. * dma buffers. Use strip/fan hardware primitives where possible. * Simulate missing primitives with indexed vertices. */ -#include "glheader.h" -#include "context.h" -#include "macros.h" -#include "imports.h" -#include "mtypes.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/macros.h" +#include "main/imports.h" +#include "main/mtypes.h" #include "tnl/t_context.h" diff --git a/src/mesa/drivers/dri/mga/mgaspan.c b/src/mesa/drivers/dri/mga/mgaspan.c index 05dcbb8526..5b6d323ca9 100644 --- a/src/mesa/drivers/dri/mga/mgaspan.c +++ b/src/mesa/drivers/dri/mga/mgaspan.c @@ -25,7 +25,7 @@ * Keith Whitwell <keith@tungstengraphics.com> */ -#include "mtypes.h" +#include "main/mtypes.h" #include "mgadd.h" #include "mgacontext.h" #include "mgaspan.h" @@ -107,6 +107,8 @@ /* 16 bit depthbuffer functions. */ +#define VALUE_TYPE GLushort + #define WRITE_DEPTH( _x, _y, d ) \ *(GLushort *)(buf + (_x)*2 + (_y)*pitch) = d; @@ -121,6 +123,8 @@ /* 32 bit depthbuffer functions. */ +#define VALUE_TYPE GLuint + #define WRITE_DEPTH( _x, _y, d ) \ *(GLuint *)(buf + (_x)*4 + (_y)*pitch) = d; @@ -134,6 +138,8 @@ /* 24/8 bit interleaved depth/stencil functions */ +#define VALUE_TYPE GLuint + #define WRITE_DEPTH( _x, _y, d ) { \ GLuint tmp = *(GLuint *)(buf + (_x)*4 + (_y)*pitch); \ tmp &= 0xff; \ diff --git a/src/mesa/drivers/dri/mga/mgaspan.h b/src/mesa/drivers/dri/mga/mgaspan.h index f133a51c08..f5e2e49b8a 100644 --- a/src/mesa/drivers/dri/mga/mgaspan.h +++ b/src/mesa/drivers/dri/mga/mgaspan.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgaspan.h,v 1.3 2002/10/30 12:51:36 alanh Exp $ */ /* * Copyright 2000-2001 VA Linux Systems, Inc. * All Rights Reserved. diff --git a/src/mesa/drivers/dri/mga/mgastate.c b/src/mesa/drivers/dri/mga/mgastate.c index 1d413d3473..7c830ec097 100644 --- a/src/mesa/drivers/dri/mga/mgastate.c +++ b/src/mesa/drivers/dri/mga/mgastate.c @@ -26,11 +26,11 @@ */ -#include "mtypes.h" -#include "colormac.h" -#include "dd.h" +#include "main/mtypes.h" +#include "main/colormac.h" +#include "main/dd.h" +#include "main/mm.h" -#include "mm.h" #include "mgacontext.h" #include "mgadd.h" #include "mgastate.h" diff --git a/src/mesa/drivers/dri/mga/mgastate.h b/src/mesa/drivers/dri/mga/mgastate.h index afbe0aaf90..ec65d4e6cd 100644 --- a/src/mesa/drivers/dri/mga/mgastate.h +++ b/src/mesa/drivers/dri/mga/mgastate.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgastate.h,v 1.5 2002/10/30 12:51:36 alanh Exp $ */ /* * Copyright 2000-2001 VA Linux Systems, Inc. * All Rights Reserved. diff --git a/src/mesa/drivers/dri/mga/mgatex.c b/src/mesa/drivers/dri/mga/mgatex.c index a7d74317a5..2392622b90 100644 --- a/src/mesa/drivers/dri/mga/mgatex.c +++ b/src/mesa/drivers/dri/mga/mgatex.c @@ -24,26 +24,25 @@ * Authors: * Keith Whitwell <keith@tungstengraphics.com> */ -/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgatex.c,v 1.14 2002/10/30 12:51:36 alanh Exp $ */ -#include "glheader.h" -#include "mm.h" +#include "main/glheader.h" +#include "main/mm.h" #include "mgacontext.h" #include "mgatex.h" #include "mgaregs.h" #include "mgatris.h" #include "mgaioctl.h" -#include "colormac.h" -#include "context.h" -#include "enums.h" -#include "simple_list.h" -#include "imports.h" -#include "macros.h" -#include "texformat.h" -#include "texstore.h" -#include "teximage.h" -#include "texobj.h" +#include "main/colormac.h" +#include "main/context.h" +#include "main/enums.h" +#include "main/simple_list.h" +#include "main/imports.h" +#include "main/macros.h" +#include "main/texformat.h" +#include "main/texstore.h" +#include "main/teximage.h" +#include "main/texobj.h" #include "swrast/swrast.h" diff --git a/src/mesa/drivers/dri/mga/mgatex.h b/src/mesa/drivers/dri/mga/mgatex.h index fb7ffcff16..789034964a 100644 --- a/src/mesa/drivers/dri/mga/mgatex.h +++ b/src/mesa/drivers/dri/mga/mgatex.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgatex.h,v 1.7 2002/10/30 12:51:36 alanh Exp $ */ /* * Copyright 2000-2001 VA Linux Systems, Inc. * All Rights Reserved. diff --git a/src/mesa/drivers/dri/mga/mgatexmem.c b/src/mesa/drivers/dri/mga/mgatexmem.c index 18743331c6..9a2d62b53b 100644 --- a/src/mesa/drivers/dri/mga/mgatexmem.c +++ b/src/mesa/drivers/dri/mga/mgatexmem.c @@ -24,19 +24,18 @@ * Authors: * Keith Whitwell <keith@tungstengraphics.com> */ -/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgatexmem.c,v 1.7 2002/10/30 12:51:36 alanh Exp $ */ -#include "glheader.h" +#include "main/glheader.h" -#include "mm.h" +#include "main/mm.h" #include "mgacontext.h" #include "mgatex.h" #include "mgaregs.h" #include "mgaioctl.h" #include "mga_xmesa.h" -#include "imports.h" -#include "simple_list.h" +#include "main/imports.h" +#include "main/simple_list.h" /** * Destroy any device-dependent state associated with the texture. This may diff --git a/src/mesa/drivers/dri/mga/mgatris.c b/src/mesa/drivers/dri/mga/mgatris.c index 9f270d7d6c..b93a21c3ac 100644 --- a/src/mesa/drivers/dri/mga/mgatris.c +++ b/src/mesa/drivers/dri/mga/mgatris.c @@ -24,17 +24,16 @@ * Authors: * Keith Whitwell <keith@tungstengraphics.com> */ -/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgatris.c,v 1.10 2002/10/30 12:51:36 alanh Exp $ */ -#include "mtypes.h" -#include "macros.h" -#include "colormac.h" +#include "main/mtypes.h" +#include "main/macros.h" +#include "main/colormac.h" +#include "main/mm.h" #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" #include "tnl/t_context.h" #include "tnl/t_pipeline.h" -#include "mm.h" #include "mgacontext.h" #include "mgaioctl.h" #include "mgatris.h" diff --git a/src/mesa/drivers/dri/mga/mgatris.h b/src/mesa/drivers/dri/mga/mgatris.h index f3ece3a053..43612b80a1 100644 --- a/src/mesa/drivers/dri/mga/mgatris.h +++ b/src/mesa/drivers/dri/mga/mgatris.h @@ -24,12 +24,11 @@ * Authors: * Keith Whitwell <keith@tungstengraphics.com> */ -/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgatris.h,v 1.10 2002/10/30 12:51:36 alanh Exp $ */ #ifndef MGATRIS_INC #define MGATRIS_INC -#include "mtypes.h" +#include "main/mtypes.h" extern void mgaDDInitTriFuncs( GLcontext *ctx ); extern void mgaChooseRenderState( GLcontext *ctx ); diff --git a/src/mesa/drivers/dri/mga/mgavb.c b/src/mesa/drivers/dri/mga/mgavb.c index 902d8bd1c1..1c635b23a6 100644 --- a/src/mesa/drivers/dri/mga/mgavb.c +++ b/src/mesa/drivers/dri/mga/mgavb.c @@ -24,7 +24,6 @@ * Authors: * Keith Whitwell <keith@tungstengraphics.com> */ -/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgavb.c,v 1.15 2003/03/26 20:43:49 tsi Exp $ */ #include <stdlib.h> #include "mgacontext.h" @@ -33,11 +32,11 @@ #include "mgaioctl.h" #include "mga_xmesa.h" -#include "glheader.h" -#include "mtypes.h" -#include "imports.h" -#include "macros.h" -#include "colormac.h" +#include "main/glheader.h" +#include "main/mtypes.h" +#include "main/imports.h" +#include "main/macros.h" +#include "main/colormac.h" #include "tnl/t_context.h" #include "swrast_setup/swrast_setup.h" diff --git a/src/mesa/drivers/dri/mga/mgavb.h b/src/mesa/drivers/dri/mga/mgavb.h index 5f6454aca9..8d24ab7b5f 100644 --- a/src/mesa/drivers/dri/mga/mgavb.h +++ b/src/mesa/drivers/dri/mga/mgavb.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgavb.h,v 1.8 2002/10/30 12:51:36 alanh Exp $ */ /* * Copyright 2000-2001 VA Linux Systems, Inc. * All Rights Reserved. @@ -29,7 +28,7 @@ #ifndef MGAVB_INC #define MGAVB_INC -#include "mtypes.h" +#include "main/mtypes.h" #include "mgacontext.h" #include "swrast/swrast.h" diff --git a/src/mesa/drivers/dri/mga/server/mga.h b/src/mesa/drivers/dri/mga/server/mga.h index 830d48d859..d7790e4779 100644 --- a/src/mesa/drivers/dri/mga/server/mga.h +++ b/src/mesa/drivers/dri/mga/server/mga.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga.h,v 1.85 2002/12/16 16:19:17 dawes Exp $ */ /* * MGA Millennium (MGA2064W) functions * diff --git a/src/mesa/drivers/dri/mga/server/mga_bios.h b/src/mesa/drivers/dri/mga/server/mga_bios.h index 8fbf619e34..5dcfc1614d 100644 --- a/src/mesa/drivers/dri/mga/server/mga_bios.h +++ b/src/mesa/drivers/dri/mga/server/mga_bios.h @@ -1,8 +1,6 @@ -/* $XConsortium: mga_bios.h /main/2 1996/10/28 04:48:23 kaleb $ */ #ifndef MGA_BIOS_H #define MGA_BIOS_H -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_bios.h,v 1.3 1998/07/25 16:55:51 dawes Exp $ */ /* * MGABiosInfo - This struct describes the video BIOS info block. diff --git a/src/mesa/drivers/dri/mga/server/mga_dri.c b/src/mesa/drivers/dri/mga/server/mga_dri.c index 258ace83a0..bc575e62ee 100644 --- a/src/mesa/drivers/dri/mga/server/mga_dri.c +++ b/src/mesa/drivers/dri/mga/server/mga_dri.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dri.c,v 1.28 2003/02/08 21:26:58 dawes Exp $ */ /* * Copyright 2000 VA Linux Systems Inc., Fremont, California. diff --git a/src/mesa/drivers/dri/mga/server/mga_dri.h b/src/mesa/drivers/dri/mga/server/mga_dri.h index 03b8414603..1ce07028f1 100644 --- a/src/mesa/drivers/dri/mga/server/mga_dri.h +++ b/src/mesa/drivers/dri/mga/server/mga_dri.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dri.h,v 1.8 2002/11/29 11:06:42 eich Exp $ */ /* * Copyright 2000 VA Linux Systems Inc., Fremont, California. diff --git a/src/mesa/drivers/dri/mga/server/mga_macros.h b/src/mesa/drivers/dri/mga/server/mga_macros.h index d985081ab6..189e1415d0 100644 --- a/src/mesa/drivers/dri/mga/server/mga_macros.h +++ b/src/mesa/drivers/dri/mga/server/mga_macros.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_macros.h,v 1.22 2002/02/20 17:17:50 dawes Exp $ */ #ifndef _MGA_MACROS_H_ #define _MGA_MACROS_H_ diff --git a/src/mesa/drivers/dri/mga/server/mga_reg.h b/src/mesa/drivers/dri/mga/server/mga_reg.h index b8e3499235..d51366d44e 100644 --- a/src/mesa/drivers/dri/mga/server/mga_reg.h +++ b/src/mesa/drivers/dri/mga/server/mga_reg.h @@ -1,8 +1,6 @@ -/* $XConsortium: mgareg.h /main/2 1996/10/25 10:33:21 kaleb $ */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_reg.h,v 1.18 2001/09/26 12:59:18 alanh Exp $ */ diff --git a/src/mesa/drivers/dri/r128/r128_context.c b/src/mesa/drivers/dri/r128/r128_context.c index cdea77642b..535a98cc01 100644 --- a/src/mesa/drivers/dri/r128/r128_context.c +++ b/src/mesa/drivers/dri/r128/r128_context.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_context.c,v 1.8 2002/10/30 12:51:38 alanh Exp $ */ /************************************************************************** Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc., @@ -33,12 +32,12 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. * */ -#include "glheader.h" -#include "context.h" -#include "simple_list.h" -#include "imports.h" -#include "matrix.h" -#include "extensions.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/simple_list.h" +#include "main/imports.h" +#include "main/matrix.h" +#include "main/extensions.h" #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" diff --git a/src/mesa/drivers/dri/r128/r128_context.h b/src/mesa/drivers/dri/r128/r128_context.h index 3f7416e9cc..0e10209a6a 100644 --- a/src/mesa/drivers/dri/r128/r128_context.h +++ b/src/mesa/drivers/dri/r128/r128_context.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_context.h,v 1.12 2002/12/16 16:18:52 dawes Exp $ */ /************************************************************************** Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc., @@ -40,7 +39,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "drm.h" #include "r128_drm.h" -#include "mtypes.h" +#include "main/mtypes.h" #include "tnl/t_vertex.h" #include "r128_reg.h" @@ -138,9 +137,9 @@ struct r128_context { GLfloat hw_viewport[16]; GLfloat depth_scale; - u_int32_t ClearColor; /* Color used to clear color buffer */ - u_int32_t ClearDepth; /* Value used to clear depth buffer */ - u_int32_t ClearStencil; /* Value used to clear stencil */ + uint32_t ClearColor; /* Color used to clear color buffer */ + uint32_t ClearDepth; /* Value used to clear depth buffer */ + uint32_t ClearStencil; /* Value used to clear stencil */ /* Map GL texture units onto hardware */ diff --git a/src/mesa/drivers/dri/r128/r128_dd.c b/src/mesa/drivers/dri/r128/r128_dd.c index 54f2b21b5d..dfe47f2dd6 100644 --- a/src/mesa/drivers/dri/r128/r128_dd.c +++ b/src/mesa/drivers/dri/r128/r128_dd.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_dd.c,v 1.15 2002/10/30 12:51:38 alanh Exp $ */ /************************************************************************** Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc., @@ -39,8 +38,8 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "r128_dd.h" #include "swrast/swrast.h" -#include "context.h" -#include "framebuffer.h" +#include "main/context.h" +#include "main/framebuffer.h" #include "utils.h" diff --git a/src/mesa/drivers/dri/r128/r128_dd.h b/src/mesa/drivers/dri/r128/r128_dd.h index 7a0abb73f8..ce038853c4 100644 --- a/src/mesa/drivers/dri/r128/r128_dd.h +++ b/src/mesa/drivers/dri/r128/r128_dd.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_dd.h,v 1.3 2001/01/08 01:07:20 martin Exp $ */ /************************************************************************** Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc., diff --git a/src/mesa/drivers/dri/r128/r128_ioctl.c b/src/mesa/drivers/dri/r128/r128_ioctl.c index 034261a535..84ac3d9f79 100644 --- a/src/mesa/drivers/dri/r128/r128_ioctl.c +++ b/src/mesa/drivers/dri/r128/r128_ioctl.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_ioctl.c,v 1.10 2002/12/16 16:18:53 dawes Exp $ */ /************************************************************************** Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc., @@ -37,8 +36,8 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "r128_context.h" #include "r128_state.h" #include "r128_ioctl.h" -#include "imports.h" -#include "macros.h" +#include "main/imports.h" +#include "main/macros.h" #include "swrast/swrast.h" @@ -231,7 +230,7 @@ static int r128WaitForFrameCompletion( r128ContextPtr rmesa ) int wait = 0; while ( 1 ) { - u_int32_t frame = read_MMIO_LE32( R128MMIO, R128_LAST_FRAME_REG ); + uint32_t frame = read_MMIO_LE32( R128MMIO, R128_LAST_FRAME_REG ); if ( rmesa->sarea->last_frame - frame <= R128_MAX_OUTSTANDING ) { break; diff --git a/src/mesa/drivers/dri/r128/r128_ioctl.h b/src/mesa/drivers/dri/r128/r128_ioctl.h index 5ed44559a6..4b0c9cdc7f 100644 --- a/src/mesa/drivers/dri/r128/r128_ioctl.h +++ b/src/mesa/drivers/dri/r128/r128_ioctl.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_ioctl.h,v 1.6 2002/12/16 16:18:53 dawes Exp $ */ /************************************************************************** Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc., @@ -39,7 +38,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "r128_reg.h" #include "r128_lock.h" -#define R128_BUFFER_MAX_DWORDS (R128_BUFFER_SIZE / sizeof(u_int32_t)) +#define R128_BUFFER_MAX_DWORDS (R128_BUFFER_SIZE / sizeof(uint32_t)) extern drmBufPtr r128GetBufferLocked( r128ContextPtr rmesa ); @@ -48,7 +47,7 @@ extern void r128FlushVerticesLocked( r128ContextPtr rmesa ); static INLINE void *r128AllocDmaLow( r128ContextPtr rmesa, int count, int vert_size ) { - u_int32_t *head; + uint32_t *head; int bytes = count * vert_size; if ( !rmesa->vert_buf ) { @@ -62,7 +61,7 @@ static INLINE void *r128AllocDmaLow( r128ContextPtr rmesa, int count, UNLOCK_HARDWARE( rmesa ); } - head = (u_int32_t *)((char *)rmesa->vert_buf->address + rmesa->vert_buf->used); + head = (uint32_t *)((char *)rmesa->vert_buf->address + rmesa->vert_buf->used); rmesa->vert_buf->used += bytes; rmesa->num_verts += count; diff --git a/src/mesa/drivers/dri/r128/r128_lock.c b/src/mesa/drivers/dri/r128/r128_lock.c index ea23b007f3..81488a2742 100644 --- a/src/mesa/drivers/dri/r128/r128_lock.c +++ b/src/mesa/drivers/dri/r128/r128_lock.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_lock.c,v 1.5 2002/10/30 12:51:38 alanh Exp $ */ /************************************************************************** Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc., @@ -59,7 +58,7 @@ r128UpdatePageFlipping( r128ContextPtr rmesa ) rmesa->new_state |= R128_NEW_WINDOW; } -/* Update the hardware state. This is called if another context has +/* Update the hardware state. This is called if another main/context.has * grabbed the hardware lock, which includes the X server. This * function also updates the driver's window state after the X server * moves, resizes or restacks a window -- the change will be reflected diff --git a/src/mesa/drivers/dri/r128/r128_lock.h b/src/mesa/drivers/dri/r128/r128_lock.h index 39bdde9820..1fc8cbe29f 100644 --- a/src/mesa/drivers/dri/r128/r128_lock.h +++ b/src/mesa/drivers/dri/r128/r128_lock.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_lock.h,v 1.4 2001/01/08 01:07:21 martin Exp $ */ /************************************************************************** Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc., diff --git a/src/mesa/drivers/dri/r128/r128_screen.c b/src/mesa/drivers/dri/r128/r128_screen.c index 7b544acf3b..cb3a147dba 100644 --- a/src/mesa/drivers/dri/r128/r128_screen.c +++ b/src/mesa/drivers/dri/r128/r128_screen.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_screen.c,v 1.9 2003/03/26 20:43:49 tsi Exp $ */ /************************************************************************** Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc., @@ -40,10 +39,10 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "r128_span.h" #include "r128_tris.h" -#include "context.h" -#include "imports.h" -#include "framebuffer.h" -#include "renderbuffer.h" +#include "main/context.h" +#include "main/imports.h" +#include "main/framebuffer.h" +#include "main/renderbuffer.h" #include "utils.h" #include "vblank.h" @@ -421,8 +420,8 @@ r128FillInModes( __DRIscreenPrivate *psp, GLX_NONE, GLX_SWAP_UNDEFINED_OML /*, GLX_SWAP_COPY_OML */ }; - u_int8_t depth_bits_array[2]; - u_int8_t stencil_bits_array[2]; + uint8_t depth_bits_array[2]; + uint8_t stencil_bits_array[2]; depth_bits_array[0] = depth_bits; diff --git a/src/mesa/drivers/dri/r128/r128_screen.h b/src/mesa/drivers/dri/r128/r128_screen.h index c333713766..e2fa1677c9 100644 --- a/src/mesa/drivers/dri/r128/r128_screen.h +++ b/src/mesa/drivers/dri/r128/r128_screen.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_screen.h,v 1.7 2002/12/16 16:18:53 dawes Exp $ */ /************************************************************************** Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc., diff --git a/src/mesa/drivers/dri/r128/r128_span.c b/src/mesa/drivers/dri/r128/r128_span.c index 85798c1601..dd177e0def 100644 --- a/src/mesa/drivers/dri/r128/r128_span.c +++ b/src/mesa/drivers/dri/r128/r128_span.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_span.c,v 1.8 2002/10/30 12:51:39 alanh Exp $ */ /************************************************************************** Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc., @@ -131,6 +130,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. /* 16-bit depth buffer functions */ +#define VALUE_TYPE GLushort #define WRITE_DEPTH_SPAN() \ do { \ @@ -207,6 +207,8 @@ do { \ /* 24-bit depth, 8-bit stencil buffer functions */ +#define VALUE_TYPE GLuint + #define WRITE_DEPTH_SPAN() \ do { \ GLuint buf[n]; \ diff --git a/src/mesa/drivers/dri/r128/r128_span.h b/src/mesa/drivers/dri/r128/r128_span.h index fd7c2d1394..9af4058129 100644 --- a/src/mesa/drivers/dri/r128/r128_span.h +++ b/src/mesa/drivers/dri/r128/r128_span.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_span.h,v 1.3 2001/01/08 01:07:21 martin Exp $ */ /************************************************************************** Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc., diff --git a/src/mesa/drivers/dri/r128/r128_state.c b/src/mesa/drivers/dri/r128/r128_state.c index 2abe59056e..451dcd1b55 100644 --- a/src/mesa/drivers/dri/r128/r128_state.c +++ b/src/mesa/drivers/dri/r128/r128_state.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_state.c,v 1.11 2002/10/30 12:51:39 alanh Exp $ */ /************************************************************************** Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc., @@ -40,9 +39,9 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "r128_tris.h" #include "r128_tex.h" -#include "context.h" -#include "enums.h" -#include "colormac.h" +#include "main/context.h" +#include "main/enums.h" +#include "main/colormac.h" #include "swrast/swrast.h" #include "vbo/vbo.h" #include "tnl/tnl.h" diff --git a/src/mesa/drivers/dri/r128/r128_state.h b/src/mesa/drivers/dri/r128/r128_state.h index 6f0a6a6557..a44327dfb3 100644 --- a/src/mesa/drivers/dri/r128/r128_state.h +++ b/src/mesa/drivers/dri/r128/r128_state.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_state.h,v 1.3 2001/01/08 01:07:21 martin Exp $ */ /************************************************************************** Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc., diff --git a/src/mesa/drivers/dri/r128/r128_tex.c b/src/mesa/drivers/dri/r128/r128_tex.c index 3b2d017c1f..3fc9c06cfa 100644 --- a/src/mesa/drivers/dri/r128/r128_tex.c +++ b/src/mesa/drivers/dri/r128/r128_tex.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_tex.c,v 1.14 2002/11/05 17:46:08 tsi Exp $ */ /************************************************************************** Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc., @@ -40,17 +39,17 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "r128_tex.h" #include "r128_texobj.h" -#include "context.h" -#include "macros.h" -#include "simple_list.h" -#include "enums.h" -#include "texstore.h" -#include "texformat.h" -#include "teximage.h" -#include "texobj.h" -#include "imports.h" -#include "colormac.h" -#include "texobj.h" +#include "main/context.h" +#include "main/macros.h" +#include "main/simple_list.h" +#include "main/enums.h" +#include "main/texstore.h" +#include "main/texformat.h" +#include "main/teximage.h" +#include "main/texobj.h" +#include "main/imports.h" +#include "main/colormac.h" +#include "main/texobj.h" #include "xmlpool.h" @@ -462,9 +461,9 @@ static void r128TexEnv( GLcontext *ctx, GLenum target, case GL_TEXTURE_LOD_BIAS: { - u_int32_t t = rmesa->setup.tex_cntl_c; + uint32_t t = rmesa->setup.tex_cntl_c; GLint bias; - u_int32_t b; + uint32_t b; /* GTH: This isn't exactly correct, but gives good results up to a * certain point. It is better than completely ignoring the LOD @@ -484,7 +483,7 @@ static void r128TexEnv( GLcontext *ctx, GLenum target, bias = 127; } - b = (u_int32_t)bias & 0xff; + b = (uint32_t)bias & 0xff; t &= ~R128_LOD_BIAS_MASK; t |= (b << R128_LOD_BIAS_SHIFT); diff --git a/src/mesa/drivers/dri/r128/r128_tex.h b/src/mesa/drivers/dri/r128/r128_tex.h index 40168f83bc..7df8decf76 100644 --- a/src/mesa/drivers/dri/r128/r128_tex.h +++ b/src/mesa/drivers/dri/r128/r128_tex.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_tex.h,v 1.7 2002/02/22 21:44:58 dawes Exp $ */ /************************************************************************** Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc., @@ -68,7 +67,7 @@ extern void r128InitTextureFuncs( struct dd_function_table *functions ); #define R128PACKCOLOR4444( r, g, b, a ) \ ((((a) & 0xf0) << 8) | (((r) & 0xf0) << 4) | ((g) & 0xf0) | ((b) >> 4)) -static INLINE u_int32_t r128PackColor( GLuint cpp, +static INLINE uint32_t r128PackColor( GLuint cpp, GLubyte r, GLubyte g, GLubyte b, GLubyte a ) { diff --git a/src/mesa/drivers/dri/r128/r128_texmem.c b/src/mesa/drivers/dri/r128/r128_texmem.c index d011a75671..111fe1fd74 100644 --- a/src/mesa/drivers/dri/r128/r128_texmem.c +++ b/src/mesa/drivers/dri/r128/r128_texmem.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_texmem.c,v 1.1 2002/02/22 21:44:58 dawes Exp $ */ /************************************************************************** Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc., @@ -39,11 +38,11 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "r128_tris.h" #include "r128_tex.h" -#include "context.h" -#include "macros.h" -#include "simple_list.h" -#include "texformat.h" -#include "imports.h" +#include "main/context.h" +#include "main/macros.h" +#include "main/simple_list.h" +#include "main/texformat.h" +#include "main/imports.h" #define TEX_0 1 #define TEX_1 2 @@ -85,7 +84,7 @@ static void uploadSubImage( r128ContextPtr rmesa, r128TexObjPtr t, int imageWidth, imageHeight; int remaining, rows; int format, dwords; - u_int32_t pitch, offset; + uint32_t pitch, offset; int i; /* Ensure we have a valid texture to upload */ @@ -201,7 +200,7 @@ static void uploadSubImage( r128ContextPtr rmesa, r128TexObjPtr t, remaining > 0 ; remaining -= rows, y += rows, i++ ) { - u_int32_t *dst; + uint32_t *dst; drmBufPtr buffer; assert(image->Data); @@ -212,7 +211,7 @@ static void uploadSubImage( r128ContextPtr rmesa, r128TexObjPtr t, LOCK_HARDWARE( rmesa ); buffer = r128GetBufferLocked( rmesa ); - dst = (u_int32_t *)((char *)buffer->address + R128_HOSTDATA_BLIT_OFFSET); + dst = (uint32_t *)((char *)buffer->address + R128_HOSTDATA_BLIT_OFFSET); /* Copy the next chunck of the texture image into the blit buffer */ { diff --git a/src/mesa/drivers/dri/r128/r128_texobj.h b/src/mesa/drivers/dri/r128/r128_texobj.h index 282e887149..efbbb2df78 100644 --- a/src/mesa/drivers/dri/r128/r128_texobj.h +++ b/src/mesa/drivers/dri/r128/r128_texobj.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_texobj.h,v 1.5 2002/02/22 21:44:58 dawes Exp $ */ /************************************************************************** Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc., @@ -36,7 +35,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #ifndef _R128_TEXOBJ_H_ #define _R128_TEXOBJ_H_ -#include "mm.h" +#include "main/mm.h" /* Individual texture image information. */ @@ -53,14 +52,14 @@ typedef struct r128_tex_obj r128TexObj, *r128TexObjPtr; struct r128_tex_obj { driTextureObject base; - u_int32_t bufAddr; /* Offset to start of locally + uint32_t bufAddr; /* Offset to start of locally shared texture block */ GLuint age; r128TexImage image[R128_MAX_TEXTURE_LEVELS]; /* Image data for all mipmap levels */ - u_int32_t textureFormat; /* Actual hardware format */ + uint32_t textureFormat; /* Actual hardware format */ drm_r128_texture_regs_t setup; /* Setup regs for texture */ }; diff --git a/src/mesa/drivers/dri/r128/r128_texstate.c b/src/mesa/drivers/dri/r128/r128_texstate.c index 6b43f21cd4..a9c9568003 100644 --- a/src/mesa/drivers/dri/r128/r128_texstate.c +++ b/src/mesa/drivers/dri/r128/r128_texstate.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_texstate.c,v 1.1 2002/02/22 21:44:58 dawes Exp $ */ /************************************************************************** Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc., @@ -33,11 +32,11 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. * Brian Paul <brianp@valinux.com> */ -#include "glheader.h" -#include "imports.h" -#include "context.h" -#include "macros.h" -#include "texformat.h" +#include "main/glheader.h" +#include "main/imports.h" +#include "main/context.h" +#include "main/macros.h" +#include "main/texformat.h" #include "r128_context.h" #include "r128_state.h" diff --git a/src/mesa/drivers/dri/r128/r128_tris.c b/src/mesa/drivers/dri/r128/r128_tris.c index f406e928c5..bcc9ffa651 100644 --- a/src/mesa/drivers/dri/r128/r128_tris.c +++ b/src/mesa/drivers/dri/r128/r128_tris.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_tris.c,v 1.8 2002/10/30 12:51:43 alanh Exp $ */ /* -*- c-basic-offset: 3 -*- */ +/* -*- c-basic-offset: 3 -*- */ /************************************************************************** Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and @@ -33,10 +33,10 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. * */ -#include "glheader.h" -#include "mtypes.h" -#include "colormac.h" -#include "macros.h" +#include "main/glheader.h" +#include "main/mtypes.h" +#include "main/colormac.h" +#include "main/macros.h" #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" diff --git a/src/mesa/drivers/dri/r128/r128_tris.h b/src/mesa/drivers/dri/r128/r128_tris.h index 755d3320b0..d90ca31534 100644 --- a/src/mesa/drivers/dri/r128/r128_tris.h +++ b/src/mesa/drivers/dri/r128/r128_tris.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_tris.h,v 1.8 2002/10/30 12:51:43 alanh Exp $ */ /************************************************************************** Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and @@ -36,7 +35,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #ifndef __R128_TRIS_H__ #define __R128_TRIS_H__ -#include "mtypes.h" +#include "main/mtypes.h" extern void r128InitTriFuncs( GLcontext *ctx ); diff --git a/src/mesa/drivers/dri/r128/server/r128.h b/src/mesa/drivers/dri/r128/server/r128.h index ce98b1b915..413c7c6690 100644 --- a/src/mesa/drivers/dri/r128/server/r128.h +++ b/src/mesa/drivers/dri/r128/server/r128.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128.h,v 1.24 2002/12/16 16:19:10 dawes Exp $ */ /* * Copyright 1999, 2000 ATI Technologies Inc., Markham, Ontario, * Precision Insight, Inc., Cedar Park, Texas, and @@ -87,74 +86,74 @@ typedef struct { /* All values in XCLKS */ typedef struct { /* Common registers */ - u_int32_t ovr_clr; - u_int32_t ovr_wid_left_right; - u_int32_t ovr_wid_top_bottom; - u_int32_t ov0_scale_cntl; - u_int32_t mpp_tb_config; - u_int32_t mpp_gp_config; - u_int32_t subpic_cntl; - u_int32_t viph_control; - u_int32_t i2c_cntl_1; - u_int32_t gen_int_cntl; - u_int32_t cap0_trig_cntl; - u_int32_t cap1_trig_cntl; - u_int32_t bus_cntl; - u_int32_t config_cntl; + uint32_t ovr_clr; + uint32_t ovr_wid_left_right; + uint32_t ovr_wid_top_bottom; + uint32_t ov0_scale_cntl; + uint32_t mpp_tb_config; + uint32_t mpp_gp_config; + uint32_t subpic_cntl; + uint32_t viph_control; + uint32_t i2c_cntl_1; + uint32_t gen_int_cntl; + uint32_t cap0_trig_cntl; + uint32_t cap1_trig_cntl; + uint32_t bus_cntl; + uint32_t config_cntl; /* Other registers to save for VT switches */ - u_int32_t dp_datatype; - u_int32_t gen_reset_cntl; - u_int32_t clock_cntl_index; - u_int32_t amcgpio_en_reg; - u_int32_t amcgpio_mask; + uint32_t dp_datatype; + uint32_t gen_reset_cntl; + uint32_t clock_cntl_index; + uint32_t amcgpio_en_reg; + uint32_t amcgpio_mask; /* CRTC registers */ - u_int32_t crtc_gen_cntl; - u_int32_t crtc_ext_cntl; - u_int32_t dac_cntl; - u_int32_t crtc_h_total_disp; - u_int32_t crtc_h_sync_strt_wid; - u_int32_t crtc_v_total_disp; - u_int32_t crtc_v_sync_strt_wid; - u_int32_t crtc_offset; - u_int32_t crtc_offset_cntl; - u_int32_t crtc_pitch; + uint32_t crtc_gen_cntl; + uint32_t crtc_ext_cntl; + uint32_t dac_cntl; + uint32_t crtc_h_total_disp; + uint32_t crtc_h_sync_strt_wid; + uint32_t crtc_v_total_disp; + uint32_t crtc_v_sync_strt_wid; + uint32_t crtc_offset; + uint32_t crtc_offset_cntl; + uint32_t crtc_pitch; /* CRTC2 registers */ - u_int32_t crtc2_gen_cntl; + uint32_t crtc2_gen_cntl; /* Flat panel registers */ - u_int32_t fp_crtc_h_total_disp; - u_int32_t fp_crtc_v_total_disp; - u_int32_t fp_gen_cntl; - u_int32_t fp_h_sync_strt_wid; - u_int32_t fp_horz_stretch; - u_int32_t fp_panel_cntl; - u_int32_t fp_v_sync_strt_wid; - u_int32_t fp_vert_stretch; - u_int32_t lvds_gen_cntl; - u_int32_t tmds_crc; - u_int32_t tmds_transmitter_cntl; + uint32_t fp_crtc_h_total_disp; + uint32_t fp_crtc_v_total_disp; + uint32_t fp_gen_cntl; + uint32_t fp_h_sync_strt_wid; + uint32_t fp_horz_stretch; + uint32_t fp_panel_cntl; + uint32_t fp_v_sync_strt_wid; + uint32_t fp_vert_stretch; + uint32_t lvds_gen_cntl; + uint32_t tmds_crc; + uint32_t tmds_transmitter_cntl; /* Computed values for PLL */ - u_int32_t dot_clock_freq; - u_int32_t pll_output_freq; + uint32_t dot_clock_freq; + uint32_t pll_output_freq; int feedback_div; int post_div; /* PLL registers */ - u_int32_t ppll_ref_div; - u_int32_t ppll_div_3; - u_int32_t htotal_cntl; + uint32_t ppll_ref_div; + uint32_t ppll_div_3; + uint32_t htotal_cntl; /* DDA register */ - u_int32_t dda_config; - u_int32_t dda_on_off; + uint32_t dda_config; + uint32_t dda_on_off; /* Pallet */ GLboolean palette_valid; - u_int32_t palette[256]; + uint32_t palette[256]; } R128SaveRec, *R128SavePtr; typedef struct { @@ -169,8 +168,8 @@ typedef struct { unsigned char *MMIO; /* Map of MMIO region */ unsigned char *FB; /* Map of frame buffer */ - u_int32_t MemCntl; - u_int32_t BusCntl; + uint32_t MemCntl; + uint32_t BusCntl; unsigned long FbMapSize; /* Size of frame buffer, in bytes */ int Flags; /* Saved copy of mode flags */ @@ -201,7 +200,7 @@ typedef struct { /* Computed values for Rage 128 */ int pitch; int datatype; - u_int32_t dp_gui_master_cntl; + uint32_t dp_gui_master_cntl; /* Saved values for ScreenToScreenCopy */ int xdir; @@ -306,18 +305,18 @@ typedef struct { int log2TexGran; /* Saved scissor values */ - u_int32_t sc_left; - u_int32_t sc_right; - u_int32_t sc_top; - u_int32_t sc_bottom; + uint32_t sc_left; + uint32_t sc_right; + uint32_t sc_top; + uint32_t sc_bottom; - u_int32_t re_top_left; - u_int32_t re_width_height; + uint32_t re_top_left; + uint32_t re_width_height; - u_int32_t aux_sc_cntl; + uint32_t aux_sc_cntl; int irq; - u_int32_t gen_int_cntl; + uint32_t gen_int_cntl; GLboolean DMAForXv; @@ -388,7 +387,7 @@ do { \ #define R128_VERBOSE 0 -#define RING_LOCALS u_int32_t *__head; int __count; +#define RING_LOCALS uint32_t *__head; int __count; #define R128CCE_REFRESH(pScrn, info) \ do { \ @@ -429,12 +428,12 @@ do { \ fprintf(stderr, \ "ADVANCE_RING() used: %d+%d=%d/%d\n", \ info->indirectBuffer->used - info->indirectStart, \ - __count * sizeof(u_int32_t), \ + __count * sizeof(uint32_t), \ info->indirectBuffer->used - info->indirectStart + \ - __count * sizeof(u_int32_t), \ + __count * sizeof(uint32_t), \ info->indirectBuffer->total - info->indirectStart ); \ } \ - info->indirectBuffer->used += __count * (int)sizeof(u_int32_t); \ + info->indirectBuffer->used += __count * (int)sizeof(uint32_t); \ } while (0) #define OUT_RING( x ) do { \ diff --git a/src/mesa/drivers/dri/r128/server/r128_dri.c b/src/mesa/drivers/dri/r128/server/r128_dri.c index 5edf1e1003..6e3db948af 100644 --- a/src/mesa/drivers/dri/r128/server/r128_dri.c +++ b/src/mesa/drivers/dri/r128/server/r128_dri.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_dri.c,v 1.28 2003/02/07 20:41:14 martin Exp $ */ /* * Copyright 1999, 2000 ATI Technologies Inc., Markham, Ontario, * Precision Insight, Inc., Cedar Park, Texas, and @@ -272,7 +271,7 @@ static GLboolean R128DRIPciInit(const DRIDriverContext *ctx) { R128InfoPtr info = ctx->driverPrivate; unsigned char *R128MMIO = ctx->MMIOAddress; - u_int32_t chunk; + uint32_t chunk; int ret; int flags; diff --git a/src/mesa/drivers/dri/r128/server/r128_dri.h b/src/mesa/drivers/dri/r128/server/r128_dri.h index 67ade70de4..430e5f580b 100644 --- a/src/mesa/drivers/dri/r128/server/r128_dri.h +++ b/src/mesa/drivers/dri/r128/server/r128_dri.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_dri.h,v 1.7 2002/10/30 12:52:12 alanh Exp $ */ /* * Copyright 1999, 2000 ATI Technologies Inc., Markham, Ontario, * Precision Insight, Inc., Cedar Park, Texas, and diff --git a/src/mesa/drivers/dri/r128/server/r128_macros.h b/src/mesa/drivers/dri/r128/server/r128_macros.h index 93b7feb02c..f7b945da93 100644 --- a/src/mesa/drivers/dri/r128/server/r128_macros.h +++ b/src/mesa/drivers/dri/r128/server/r128_macros.h @@ -35,7 +35,6 @@ * DEALINGS IN THE SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/R128_reg.h,v 1.20 2002/10/12 01:38:07 martin Exp $ */ #ifndef _R128_MACROS_H_ #define _R128_MACROS_H_ diff --git a/src/mesa/drivers/dri/r128/server/r128_reg.h b/src/mesa/drivers/dri/r128/server/r128_reg.h index 5669452d74..50033540b9 100644 --- a/src/mesa/drivers/dri/r128/server/r128_reg.h +++ b/src/mesa/drivers/dri/r128/server/r128_reg.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_reg.h,v 1.15 2002/12/16 16:19:11 dawes Exp $ */ /* * Copyright 1999, 2000 ATI Technologies Inc., Markham, Ontario, * Precision Insight, Inc., Cedar Park, Texas, and diff --git a/src/mesa/drivers/dri/r128/server/r128_version.h b/src/mesa/drivers/dri/r128/server/r128_version.h index 589d8d40bc..783711ef97 100644 --- a/src/mesa/drivers/dri/r128/server/r128_version.h +++ b/src/mesa/drivers/dri/r128/server/r128_version.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_version.h,v 1.6 2003/01/01 19:16:35 tsi Exp $ */ /* * Copyright 2000 through 2003 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * diff --git a/src/mesa/drivers/dri/r200/r200_cmdbuf.c b/src/mesa/drivers/dri/r200/r200_cmdbuf.c index c1d51e8700..e1633772a1 100644 --- a/src/mesa/drivers/dri/r200/r200_cmdbuf.c +++ b/src/mesa/drivers/dri/r200/r200_cmdbuf.c @@ -31,12 +31,12 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * Keith Whitwell <keith@tungstengraphics.com> */ -#include "glheader.h" -#include "imports.h" -#include "macros.h" -#include "context.h" +#include "main/glheader.h" +#include "main/imports.h" +#include "main/macros.h" +#include "main/context.h" #include "swrast/swrast.h" -#include "simple_list.h" +#include "main/simple_list.h" #include "r200_context.h" #include "r200_state.h" diff --git a/src/mesa/drivers/dri/r200/r200_context.c b/src/mesa/drivers/dri/r200/r200_context.c index c567349335..5531e0a739 100644 --- a/src/mesa/drivers/dri/r200/r200_context.c +++ b/src/mesa/drivers/dri/r200/r200_context.c @@ -32,15 +32,15 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * Keith Whitwell <keith@tungstengraphics.com> */ -#include "glheader.h" -#include "api_arrayelt.h" -#include "context.h" -#include "simple_list.h" -#include "imports.h" -#include "matrix.h" -#include "extensions.h" -#include "framebuffer.h" -#include "state.h" +#include "main/glheader.h" +#include "main/api_arrayelt.h" +#include "main/context.h" +#include "main/simple_list.h" +#include "main/imports.h" +#include "main/matrix.h" +#include "main/extensions.h" +#include "main/framebuffer.h" +#include "main/state.h" #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" diff --git a/src/mesa/drivers/dri/r200/r200_context.h b/src/mesa/drivers/dri/r200/r200_context.h index ee478e7d3c..14a1dda46a 100644 --- a/src/mesa/drivers/dri/r200/r200_context.h +++ b/src/mesa/drivers/dri/r200/r200_context.h @@ -41,9 +41,9 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "dri_util.h" #include "texmem.h" -#include "macros.h" -#include "mtypes.h" -#include "colormac.h" +#include "main/macros.h" +#include "main/mtypes.h" +#include "main/colormac.h" #include "r200_reg.h" #include "r200_vertprog.h" @@ -63,7 +63,7 @@ typedef union { GLfloat f; uint32_t ui32; } float_ui32_type; #include "r200_lock.h" #include "radeon_screen.h" -#include "mm.h" +#include "main/mm.h" /* Flags for software fallback cases */ /* See correponding strings in r200_swtcl.c */ diff --git a/src/mesa/drivers/dri/r200/r200_ioctl.c b/src/mesa/drivers/dri/r200/r200_ioctl.c index 20482a4124..0741e57af7 100644 --- a/src/mesa/drivers/dri/r200/r200_ioctl.c +++ b/src/mesa/drivers/dri/r200/r200_ioctl.c @@ -35,10 +35,10 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include <sched.h> #include <errno.h> -#include "glheader.h" -#include "imports.h" -#include "macros.h" -#include "context.h" +#include "main/glheader.h" +#include "main/imports.h" +#include "main/macros.h" +#include "main/context.h" #include "swrast/swrast.h" #include "r200_context.h" @@ -333,11 +333,11 @@ void r200AllocDmaRegion( r200ContextPtr rmesa, * SwapBuffers with client-side throttling */ -static u_int32_t r200GetLastFrame(r200ContextPtr rmesa) +static uint32_t r200GetLastFrame(r200ContextPtr rmesa) { drm_radeon_getparam_t gp; int ret; - u_int32_t frame; + uint32_t frame; gp.param = RADEON_PARAM_LAST_FRAME; gp.value = (int *)&frame; diff --git a/src/mesa/drivers/dri/r200/r200_ioctl.h b/src/mesa/drivers/dri/r200/r200_ioctl.h index 31431b7b03..f7458e4a0e 100644 --- a/src/mesa/drivers/dri/r200/r200_ioctl.h +++ b/src/mesa/drivers/dri/r200/r200_ioctl.h @@ -35,7 +35,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #ifndef __R200_IOCTL_H__ #define __R200_IOCTL_H__ -#include "simple_list.h" +#include "main/simple_list.h" #include "radeon_dri.h" #include "r200_lock.h" diff --git a/src/mesa/drivers/dri/r200/r200_lock.c b/src/mesa/drivers/dri/r200/r200_lock.c index f89b526a31..99661a4bfb 100644 --- a/src/mesa/drivers/dri/r200/r200_lock.c +++ b/src/mesa/drivers/dri/r200/r200_lock.c @@ -60,7 +60,7 @@ r200UpdatePageFlipping( r200ContextPtr rmesa ) -/* Update the hardware state. This is called if another context has +/* Update the hardware state. This is called if another main/context.has * grabbed the hardware lock, which includes the X server. This * function also updates the driver's window state after the X server * moves, resizes or restacks a window -- the change will be reflected diff --git a/src/mesa/drivers/dri/r200/r200_maos_arrays.c b/src/mesa/drivers/dri/r200/r200_maos_arrays.c index 7bc05e2f0b..8512b9af47 100644 --- a/src/mesa/drivers/dri/r200/r200_maos_arrays.c +++ b/src/mesa/drivers/dri/r200/r200_maos_arrays.c @@ -32,11 +32,11 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * Keith Whitwell <keith@tungstengraphics.com> */ -#include "glheader.h" -#include "mtypes.h" -#include "colormac.h" -#include "imports.h" -#include "macros.h" +#include "main/glheader.h" +#include "main/mtypes.h" +#include "main/colormac.h" +#include "main/imports.h" +#include "main/macros.h" #include "swrast_setup/swrast_setup.h" #include "math/m_translate.h" diff --git a/src/mesa/drivers/dri/r200/r200_pixel.c b/src/mesa/drivers/dri/r200/r200_pixel.c index 46d230767a..be68821dc1 100644 --- a/src/mesa/drivers/dri/r200/r200_pixel.c +++ b/src/mesa/drivers/dri/r200/r200_pixel.c @@ -31,10 +31,10 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * Keith Whitwell <keith@tungstengraphics.com> */ -#include "glheader.h" -#include "enums.h" -#include "mtypes.h" -#include "macros.h" +#include "main/glheader.h" +#include "main/enums.h" +#include "main/mtypes.h" +#include "main/macros.h" #include "swrast/swrast.h" #include "r200_context.h" diff --git a/src/mesa/drivers/dri/r200/r200_sanity.c b/src/mesa/drivers/dri/r200/r200_sanity.c index 00d2f65c99..36530c224e 100644 --- a/src/mesa/drivers/dri/r200/r200_sanity.c +++ b/src/mesa/drivers/dri/r200/r200_sanity.c @@ -34,8 +34,8 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include <errno.h> -#include "glheader.h" -#include "imports.h" +#include "main/glheader.h" +#include "main/imports.h" #include "r200_context.h" #include "r200_ioctl.h" diff --git a/src/mesa/drivers/dri/r200/r200_span.c b/src/mesa/drivers/dri/r200/r200_span.c index ff2eb01122..9783678028 100644 --- a/src/mesa/drivers/dri/r200/r200_span.c +++ b/src/mesa/drivers/dri/r200/r200_span.c @@ -32,10 +32,10 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * Keith Whitwell <keith@tungstengraphics.com> */ -#include "glheader.h" -#include "imports.h" +#include "main/glheader.h" +#include "main/imports.h" +#include "main/colormac.h" #include "swrast/swrast.h" -#include "colormac.h" #include "r200_context.h" #include "r200_ioctl.h" @@ -172,6 +172,7 @@ r200_mba_z16( driRenderbuffer *drb, GLint x, GLint y ) /* 16-bit depth buffer functions */ +#define VALUE_TYPE GLushort #define WRITE_DEPTH( _x, _y, d ) \ *(GLushort *)(buf + r200_mba_z16( drb, _x + xo, _y + yo )) = d; @@ -185,6 +186,7 @@ r200_mba_z16( driRenderbuffer *drb, GLint x, GLint y ) /* 24 bit depth, 8 bit stencil depthbuffer functions */ +#define VALUE_TYPE GLuint #define WRITE_DEPTH( _x, _y, d ) \ do { \ diff --git a/src/mesa/drivers/dri/r200/r200_state.c b/src/mesa/drivers/dri/r200/r200_state.c index cf375171c8..0eaaaf69ac 100644 --- a/src/mesa/drivers/dri/r200/r200_state.c +++ b/src/mesa/drivers/dri/r200/r200_state.c @@ -33,13 +33,13 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * Keith Whitwell <keith@tungstengraphics.com> */ -#include "glheader.h" -#include "imports.h" -#include "api_arrayelt.h" -#include "enums.h" -#include "colormac.h" -#include "light.h" -#include "framebuffer.h" +#include "main/glheader.h" +#include "main/imports.h" +#include "main/api_arrayelt.h" +#include "main/enums.h" +#include "main/colormac.h" +#include "main/light.h" +#include "main/framebuffer.h" #include "swrast/swrast.h" #include "vbo/vbo.h" @@ -902,7 +902,7 @@ static void r200PolygonMode( GLcontext *ctx, GLenum face, GLenum mode ) static void r200UpdateSpecular( GLcontext *ctx ) { r200ContextPtr rmesa = R200_CONTEXT(ctx); - u_int32_t p = rmesa->hw.ctx.cmd[CTX_PP_CNTL]; + uint32_t p = rmesa->hw.ctx.cmd[CTX_PP_CNTL]; R200_STATECHANGE( rmesa, tcl ); R200_STATECHANGE( rmesa, vtx ); diff --git a/src/mesa/drivers/dri/r200/r200_state_init.c b/src/mesa/drivers/dri/r200/r200_state_init.c index 0c36cefc16..9e4677eda4 100644 --- a/src/mesa/drivers/dri/r200/r200_state_init.c +++ b/src/mesa/drivers/dri/r200/r200_state_init.c @@ -31,11 +31,11 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * Keith Whitwell <keith@tungstengraphics.com> */ -#include "glheader.h" -#include "imports.h" -#include "enums.h" -#include "colormac.h" -#include "api_arrayelt.h" +#include "main/glheader.h" +#include "main/imports.h" +#include "main/enums.h" +#include "main/colormac.h" +#include "main/api_arrayelt.h" #include "swrast/swrast.h" #include "vbo/vbo.h" diff --git a/src/mesa/drivers/dri/r200/r200_swtcl.c b/src/mesa/drivers/dri/r200/r200_swtcl.c index a1ea0198be..b25f028244 100644 --- a/src/mesa/drivers/dri/r200/r200_swtcl.c +++ b/src/mesa/drivers/dri/r200/r200_swtcl.c @@ -32,13 +32,13 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * Keith Whitwell <keith@tungstengraphics.com> */ -#include "glheader.h" -#include "mtypes.h" -#include "colormac.h" -#include "enums.h" -#include "image.h" -#include "imports.h" -#include "macros.h" +#include "main/glheader.h" +#include "main/mtypes.h" +#include "main/colormac.h" +#include "main/enums.h" +#include "main/image.h" +#include "main/imports.h" +#include "main/macros.h" #include "swrast/s_context.h" #include "swrast/s_fog.h" diff --git a/src/mesa/drivers/dri/r200/r200_swtcl.h b/src/mesa/drivers/dri/r200/r200_swtcl.h index 7458c54928..8c29fd0c99 100644 --- a/src/mesa/drivers/dri/r200/r200_swtcl.h +++ b/src/mesa/drivers/dri/r200/r200_swtcl.h @@ -34,7 +34,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #ifndef __R200_SWTCL_H__ #define __R200_SWTCL_H__ -#include "mtypes.h" +#include "main/mtypes.h" #include "swrast/swrast.h" #include "r200_context.h" diff --git a/src/mesa/drivers/dri/r200/r200_tcl.c b/src/mesa/drivers/dri/r200/r200_tcl.c index 78347d3cc2..99aecfe1e9 100644 --- a/src/mesa/drivers/dri/r200/r200_tcl.c +++ b/src/mesa/drivers/dri/r200/r200_tcl.c @@ -32,12 +32,12 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * Keith Whitwell <keith@tungstengraphics.com> */ -#include "glheader.h" -#include "imports.h" -#include "mtypes.h" -#include "enums.h" -#include "colormac.h" -#include "light.h" +#include "main/glheader.h" +#include "main/imports.h" +#include "main/mtypes.h" +#include "main/enums.h" +#include "main/colormac.h" +#include "main/light.h" #include "vbo/vbo.h" #include "tnl/tnl.h" diff --git a/src/mesa/drivers/dri/r200/r200_tex.c b/src/mesa/drivers/dri/r200/r200_tex.c index 24b9b3b696..5a4db33f44 100644 --- a/src/mesa/drivers/dri/r200/r200_tex.c +++ b/src/mesa/drivers/dri/r200/r200_tex.c @@ -31,18 +31,19 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * Keith Whitwell <keith@tungstengraphics.com> */ -#include "glheader.h" -#include "imports.h" -#include "colormac.h" -#include "context.h" -#include "enums.h" -#include "image.h" -#include "simple_list.h" -#include "texformat.h" -#include "texstore.h" +#include "main/glheader.h" +#include "main/imports.h" +#include "main/colormac.h" +#include "main/context.h" +#include "main/enums.h" +#include "main/image.h" +#include "main/simple_list.h" +#include "main/texformat.h" +#include "main/texstore.h" +#include "main/teximage.h" +#include "main/texobj.h" + #include "texmem.h" -#include "teximage.h" -#include "texobj.h" #include "r200_context.h" #include "r200_state.h" diff --git a/src/mesa/drivers/dri/r200/r200_texmem.c b/src/mesa/drivers/dri/r200/r200_texmem.c index 183c4ca424..3b81ac0c80 100644 --- a/src/mesa/drivers/dri/r200/r200_texmem.c +++ b/src/mesa/drivers/dri/r200/r200_texmem.c @@ -37,11 +37,11 @@ SOFTWARE. #include <errno.h> -#include "glheader.h" -#include "imports.h" -#include "context.h" -#include "colormac.h" -#include "macros.h" +#include "main/glheader.h" +#include "main/imports.h" +#include "main/context.h" +#include "main/colormac.h" +#include "main/macros.h" #include "r200_context.h" #include "r200_ioctl.h" #include "r200_tex.h" diff --git a/src/mesa/drivers/dri/r200/r200_texstate.c b/src/mesa/drivers/dri/r200/r200_texstate.c index 4edf304438..3f9a2f4ac1 100644 --- a/src/mesa/drivers/dri/r200/r200_texstate.c +++ b/src/mesa/drivers/dri/r200/r200_texstate.c @@ -32,13 +32,13 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * Keith Whitwell <keith@tungstengraphics.com> */ -#include "glheader.h" -#include "imports.h" -#include "context.h" -#include "macros.h" -#include "texformat.h" -#include "texobj.h" -#include "enums.h" +#include "main/glheader.h" +#include "main/imports.h" +#include "main/context.h" +#include "main/macros.h" +#include "main/texformat.h" +#include "main/texobj.h" +#include "main/enums.h" #include "r200_context.h" #include "r200_state.h" diff --git a/src/mesa/drivers/dri/r300/Makefile b/src/mesa/drivers/dri/r300/Makefile index 3bb1ff498d..acadf1e503 100644 --- a/src/mesa/drivers/dri/r300/Makefile +++ b/src/mesa/drivers/dri/r300/Makefile @@ -41,6 +41,7 @@ DRIVER_SOURCES = \ r300_shader.c \ r300_emit.c \ r300_swtcl.c \ + radeon_dri_bufmgr.c \ $(EGL_SOURCES) C_SOURCES = $(COMMON_SOURCES) $(COMMON_BM_SOURCES) $(DRIVER_SOURCES) @@ -61,7 +62,9 @@ COMMON_SYMLINKS = \ radeon_screen.c \ radeon_screen.h \ radeon_span.h \ - radeon_buffer.h + radeon_buffer.h \ + radeon_dri_bufmgr.h \ + radeon_dri_bufmgr.c ##### TARGETS ##### diff --git a/src/mesa/drivers/dri/r300/r300_cmdbuf.c b/src/mesa/drivers/dri/r300/r300_cmdbuf.c index 493b0ac0d1..c8e49ea7c6 100644 --- a/src/mesa/drivers/dri/r300/r300_cmdbuf.c +++ b/src/mesa/drivers/dri/r300/r300_cmdbuf.c @@ -33,17 +33,18 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * \author Nicolai Haehnle <prefect_@gmx.net> */ -#include "glheader.h" -#include "state.h" -#include "imports.h" -#include "macros.h" -#include "context.h" +#include "main/glheader.h" +#include "main/state.h" +#include "main/imports.h" +#include "main/macros.h" +#include "main/context.h" +#include "main/simple_list.h" #include "swrast/swrast.h" -#include "simple_list.h" #include "drm.h" #include "radeon_drm.h" +#include "radeon_buffer.h" #include "radeon_ioctl.h" #include "r300_context.h" #include "r300_ioctl.h" diff --git a/src/mesa/drivers/dri/r300/r300_context.c b/src/mesa/drivers/dri/r300/r300_context.c index cc9c11a4f9..3854976d56 100644 --- a/src/mesa/drivers/dri/r300/r300_context.c +++ b/src/mesa/drivers/dri/r300/r300_context.c @@ -35,15 +35,15 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * \author Nicolai Haehnle <prefect_@gmx.net> */ -#include "glheader.h" -#include "api_arrayelt.h" -#include "context.h" -#include "simple_list.h" -#include "imports.h" -#include "matrix.h" -#include "extensions.h" -#include "state.h" -#include "bufferobj.h" +#include "main/glheader.h" +#include "main/api_arrayelt.h" +#include "main/context.h" +#include "main/simple_list.h" +#include "main/imports.h" +#include "main/matrix.h" +#include "main/extensions.h" +#include "main/state.h" +#include "main/bufferobj.h" #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" @@ -323,7 +323,7 @@ GLboolean r300CreateContext(const __GLcontextModes * glVisual, ctx->Const.FragmentProgram.MaxNativeTexIndirections = PFS_MAX_TEX_INDIRECT; ctx->Const.FragmentProgram.MaxNativeAddressRegs = 0; /* and these are?? */ - _tnl_ProgramCacheInit(ctx); + ctx->VertexProgram._MaintainTnlProgram = GL_TRUE; ctx->FragmentProgram._MaintainTexEnvProgram = GL_TRUE; driInitExtensions(ctx, card_extensions, GL_TRUE); @@ -399,7 +399,6 @@ void r300DestroyContext(__DRIcontextPrivate * driContextPriv) if (r300) { _swsetup_DestroyContext(r300->radeon.glCtx); - _tnl_ProgramCacheDestroy(r300->radeon.glCtx); _tnl_DestroyContext(r300->radeon.glCtx); _vbo_DestroyContext(r300->radeon.glCtx); _swrast_DestroyContext(r300->radeon.glCtx); diff --git a/src/mesa/drivers/dri/r300/r300_context.h b/src/mesa/drivers/dri/r300/r300_context.h index 59bfd9c595..65d3403386 100644 --- a/src/mesa/drivers/dri/r300/r300_context.h +++ b/src/mesa/drivers/dri/r300/r300_context.h @@ -40,13 +40,13 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "tnl/t_vertex.h" #include "drm.h" #include "radeon_drm.h" -#include "dri_bufmgr.h" +#include "radeon_dri_bufmgr.h" #include "dri_util.h" #include "texmem.h" -#include "macros.h" -#include "mtypes.h" -#include "colormac.h" +#include "main/macros.h" +#include "main/mtypes.h" +#include "main/colormac.h" struct r300_context; typedef struct r300_context r300ContextRec; @@ -54,7 +54,7 @@ typedef struct r300_context *r300ContextPtr; typedef struct radeon_bufmgr radeon_bufmgr; #include "radeon_lock.h" -#include "mm.h" +#include "main/mm.h" /* From http://gcc.gnu.org/onlinedocs/gcc-3.2.3/gcc/Variadic-Macros.html . I suppose we could inline this and use macro to fetch out __LINE__ and stuff in case we run into trouble diff --git a/src/mesa/drivers/dri/r300/r300_emit.c b/src/mesa/drivers/dri/r300/r300_emit.c index 5e2afd58bd..6ed263813c 100644 --- a/src/mesa/drivers/dri/r300/r300_emit.c +++ b/src/mesa/drivers/dri/r300/r300_emit.c @@ -33,12 +33,12 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * \author Keith Whitwell <keith@tungstengraphics.com> */ -#include "glheader.h" -#include "mtypes.h" -#include "colormac.h" -#include "imports.h" -#include "macros.h" -#include "image.h" +#include "main/glheader.h" +#include "main/mtypes.h" +#include "main/colormac.h" +#include "main/imports.h" +#include "main/macros.h" +#include "main/image.h" #include "swrast_setup/swrast_setup.h" #include "math/m_translate.h" diff --git a/src/mesa/drivers/dri/r300/r300_emit.h b/src/mesa/drivers/dri/r300/r300_emit.h index 179983de98..7e116043d1 100644 --- a/src/mesa/drivers/dri/r300/r300_emit.h +++ b/src/mesa/drivers/dri/r300/r300_emit.h @@ -39,7 +39,7 @@ #ifndef __R300_EMIT_H__ #define __R300_EMIT_H__ -#include "glheader.h" +#include "main/glheader.h" #include "r300_context.h" #include "r300_cmdbuf.h" #include "radeon_reg.h" diff --git a/src/mesa/drivers/dri/r300/r300_fragprog.c b/src/mesa/drivers/dri/r300/r300_fragprog.c index 453dda7431..4ef7f2bd78 100644 --- a/src/mesa/drivers/dri/r300/r300_fragprog.c +++ b/src/mesa/drivers/dri/r300/r300_fragprog.c @@ -36,9 +36,9 @@ * \author Jerome Glisse <j.glisse@gmail.com> */ -#include "glheader.h" -#include "macros.h" -#include "enums.h" +#include "main/glheader.h" +#include "main/macros.h" +#include "main/enums.h" #include "shader/prog_instruction.h" #include "shader/prog_parameter.h" #include "shader/prog_print.h" diff --git a/src/mesa/drivers/dri/r300/r300_fragprog.h b/src/mesa/drivers/dri/r300/r300_fragprog.h index b3a3cd2e04..94fb554fb3 100644 --- a/src/mesa/drivers/dri/r300/r300_fragprog.h +++ b/src/mesa/drivers/dri/r300/r300_fragprog.h @@ -33,9 +33,9 @@ #ifndef __R300_FRAGPROG_H_ #define __R300_FRAGPROG_H_ -#include "glheader.h" -#include "macros.h" -#include "enums.h" +#include "main/glheader.h" +#include "main/macros.h" +#include "main/enums.h" #include "shader/program.h" #include "shader/prog_instruction.h" diff --git a/src/mesa/drivers/dri/r300/r300_fragprog_swizzle.h b/src/mesa/drivers/dri/r300/r300_fragprog_swizzle.h index 3da99a9dbe..231bf4eef5 100644 --- a/src/mesa/drivers/dri/r300/r300_fragprog_swizzle.h +++ b/src/mesa/drivers/dri/r300/r300_fragprog_swizzle.h @@ -28,7 +28,7 @@ #ifndef __R300_FRAGPROG_SWIZZLE_H_ #define __R300_FRAGPROG_SWIZZLE_H_ -#include "glheader.h" +#include "main/glheader.h" #include "shader/prog_instruction.h" struct nqssadce_state; diff --git a/src/mesa/drivers/dri/r300/r300_ioctl.c b/src/mesa/drivers/dri/r300/r300_ioctl.c index 046f9a21c7..1b3fc58d85 100644 --- a/src/mesa/drivers/dri/r300/r300_ioctl.c +++ b/src/mesa/drivers/dri/r300/r300_ioctl.c @@ -40,12 +40,13 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include <sched.h> #include <errno.h> -#include "glheader.h" -#include "imports.h" -#include "macros.h" -#include "context.h" +#include "main/glheader.h" +#include "main/imports.h" +#include "main/macros.h" +#include "main/context.h" #include "swrast/swrast.h" +#include "radeon_buffer.h" #include "r300_context.h" #include "radeon_ioctl.h" #include "r300_ioctl.h" diff --git a/src/mesa/drivers/dri/r300/r300_mem.c b/src/mesa/drivers/dri/r300/r300_mem.c index 95feeb86aa..91076136b0 100644 --- a/src/mesa/drivers/dri/r300/r300_mem.c +++ b/src/mesa/drivers/dri/r300/r300_mem.c @@ -39,8 +39,9 @@ #include <errno.h> #include <unistd.h> -#include "simple_list.h" +#include "main/simple_list.h" +#include "radeon_buffer.h" #include "radeon_ioctl.h" #include "r300_cmdbuf.h" diff --git a/src/mesa/drivers/dri/r300/r300_mem.h b/src/mesa/drivers/dri/r300/r300_mem.h index 4e9be65a5a..734aef9bc6 100644 --- a/src/mesa/drivers/dri/r300/r300_mem.h +++ b/src/mesa/drivers/dri/r300/r300_mem.h @@ -1,8 +1,8 @@ #ifndef __R300_MEM_H__ #define __R300_MEM_H__ -#include "glheader.h" -#include "dri_bufmgr.h" +#include "main/glheader.h" +#include "radeon_dri_bufmgr.h" #include "r300_context.h" diff --git a/src/mesa/drivers/dri/r300/r300_mipmap_tree.c b/src/mesa/drivers/dri/r300/r300_mipmap_tree.c index c27e9b8aba..bfd46b8bd1 100644 --- a/src/mesa/drivers/dri/r300/r300_mipmap_tree.c +++ b/src/mesa/drivers/dri/r300/r300_mipmap_tree.c @@ -30,10 +30,11 @@ #include <errno.h> #include <unistd.h> -#include "simple_list.h" -#include "texcompress.h" -#include "texformat.h" +#include "main/simple_list.h" +#include "main/texcompress.h" +#include "main/texformat.h" +#include "radeon_buffer.h" #include "r300_mem.h" static GLuint r300_compressed_texture_size(GLcontext *ctx, diff --git a/src/mesa/drivers/dri/r300/r300_reg.h b/src/mesa/drivers/dri/r300/r300_reg.h index 562cd6afdb..778db96cc1 100644 --- a/src/mesa/drivers/dri/r300/r300_reg.h +++ b/src/mesa/drivers/dri/r300/r300_reg.h @@ -1458,8 +1458,8 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. # define R300_TX_FORMAT_X32 0x1e /* 0x16 - some 16 bit green format.. ?? */ -# define R300_TX_FORMAT_UNK25 (1 << 25) /* no swizzle */ -# define R300_TX_FORMAT_CUBIC_MAP (1 << 26) +# define R300_TX_FORMAT_3D (1 << 25) +# define R300_TX_FORMAT_CUBIC_MAP (2 << 25) /* gap */ /* Floating point formats */ diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c index 209fae9de5..11ffbca64e 100644 --- a/src/mesa/drivers/dri/r300/r300_render.c +++ b/src/mesa/drivers/dri/r300/r300_render.c @@ -50,15 +50,15 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. * no bugs... */ -#include "glheader.h" -#include "state.h" -#include "imports.h" -#include "enums.h" -#include "macros.h" -#include "context.h" -#include "dd.h" -#include "simple_list.h" -#include "api_arrayelt.h" +#include "main/glheader.h" +#include "main/state.h" +#include "main/imports.h" +#include "main/enums.h" +#include "main/macros.h" +#include "main/context.h" +#include "main/dd.h" +#include "main/simple_list.h" +#include "main/api_arrayelt.h" #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" #include "vbo/vbo.h" diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index 93f7568c82..935f948e48 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -35,23 +35,23 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * \author Nicolai Haehnle <prefect_@gmx.net> */ -#include "glheader.h" -#include "state.h" -#include "imports.h" -#include "enums.h" -#include "macros.h" -#include "context.h" -#include "dd.h" -#include "simple_list.h" - -#include "api_arrayelt.h" +#include "main/glheader.h" +#include "main/state.h" +#include "main/imports.h" +#include "main/enums.h" +#include "main/macros.h" +#include "main/context.h" +#include "main/dd.h" +#include "main/simple_list.h" +#include "main/api_arrayelt.h" +#include "main/texformat.h" + #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" #include "shader/prog_parameter.h" #include "shader/prog_statevars.h" #include "vbo/vbo.h" #include "tnl/tnl.h" -#include "texformat.h" #include "radeon_ioctl.h" #include "radeon_state.h" @@ -748,8 +748,6 @@ static void r300Fogfv(GLcontext * ctx, GLenum pname, const GLfloat * param) switch (pname) { case GL_FOG_MODE: - if (!ctx->Fog.Enabled) - return; switch (ctx->Fog.Mode) { case GL_LINEAR: R300_STATECHANGE(r300, fogs); @@ -2583,6 +2581,16 @@ static void r500SetupPixelShader(r300ContextPtr rmesa) } code = &fp->code; + if (fp->mesa_program.FogOption != GL_NONE) { + /* Enable HW fog. Try not to squish GL context. + * (Anybody sane remembered to set glFog() opts first!) */ + r300SetFogState(ctx, GL_TRUE); + ctx->Fog.Mode = fp->mesa_program.FogOption; + r300Fogfv(ctx, GL_FOG_MODE, NULL); + } else + /* Make sure HW is matching GL context. */ + r300SetFogState(ctx, ctx->Fog.Enabled); + r300SetupTextures(ctx); R300_STATECHANGE(rmesa, fp); diff --git a/src/mesa/drivers/dri/r300/r300_swtcl.c b/src/mesa/drivers/dri/r300/r300_swtcl.c index f4a0b7fb80..4d73ee3438 100644 --- a/src/mesa/drivers/dri/r300/r300_swtcl.c +++ b/src/mesa/drivers/dri/r300/r300_swtcl.c @@ -34,14 +34,14 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "glheader.h" -#include "mtypes.h" -#include "colormac.h" -#include "enums.h" -#include "image.h" -#include "imports.h" -#include "light.h" -#include "macros.h" +#include "main/glheader.h" +#include "main/mtypes.h" +#include "main/colormac.h" +#include "main/enums.h" +#include "main/image.h" +#include "main/imports.h" +#include "main/light.h" +#include "main/macros.h" #include "swrast/s_context.h" #include "swrast/s_fog.h" diff --git a/src/mesa/drivers/dri/r300/r300_swtcl.h b/src/mesa/drivers/dri/r300/r300_swtcl.h index 2ea6ceded7..55df53c1ad 100644 --- a/src/mesa/drivers/dri/r300/r300_swtcl.h +++ b/src/mesa/drivers/dri/r300/r300_swtcl.h @@ -35,7 +35,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #ifndef __R300_SWTCL_H__ #define __R300_SWTCL_H__ -#include "mtypes.h" +#include "main/mtypes.h" #include "swrast/swrast.h" #include "r300_context.h" diff --git a/src/mesa/drivers/dri/r300/r300_tex.c b/src/mesa/drivers/dri/r300/r300_tex.c index 3c10acc420..bdb971aa82 100644 --- a/src/mesa/drivers/dri/r300/r300_tex.c +++ b/src/mesa/drivers/dri/r300/r300_tex.c @@ -32,19 +32,20 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * \author Keith Whitwell <keith@tungstengraphics.com> */ -#include "glheader.h" -#include "imports.h" -#include "colormac.h" -#include "context.h" -#include "enums.h" -#include "image.h" -#include "mipmap.h" -#include "simple_list.h" -#include "texformat.h" -#include "texstore.h" +#include "main/glheader.h" +#include "main/imports.h" +#include "main/colormac.h" +#include "main/context.h" +#include "main/enums.h" +#include "main/image.h" +#include "main/mipmap.h" +#include "main/simple_list.h" +#include "main/texformat.h" +#include "main/texstore.h" +#include "main/teximage.h" +#include "main/texobj.h" + #include "texmem.h" -#include "teximage.h" -#include "texobj.h" #include "r300_context.h" #include "r300_state.h" diff --git a/src/mesa/drivers/dri/r300/r300_texmem.c b/src/mesa/drivers/dri/r300/r300_texmem.c index a45f2d4409..bacf12f258 100644 --- a/src/mesa/drivers/dri/r300/r300_texmem.c +++ b/src/mesa/drivers/dri/r300/r300_texmem.c @@ -38,12 +38,12 @@ SOFTWARE. #include <errno.h> -#include "glheader.h" -#include "imports.h" -#include "context.h" -#include "colormac.h" -#include "macros.h" -#include "simple_list.h" +#include "main/glheader.h" +#include "main/imports.h" +#include "main/context.h" +#include "main/colormac.h" +#include "main/macros.h" +#include "main/simple_list.h" #include "radeon_reg.h" /* gets definition for usleep */ #include "r300_context.h" #include "r300_state.h" diff --git a/src/mesa/drivers/dri/r300/r300_texstate.c b/src/mesa/drivers/dri/r300/r300_texstate.c index f81f5b30fa..ca148de535 100644 --- a/src/mesa/drivers/dri/r300/r300_texstate.c +++ b/src/mesa/drivers/dri/r300/r300_texstate.c @@ -35,14 +35,14 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * \todo Enable R300 texture tiling code? */ -#include "glheader.h" -#include "imports.h" -#include "context.h" -#include "macros.h" -#include "texformat.h" -#include "teximage.h" -#include "texobj.h" -#include "enums.h" +#include "main/glheader.h" +#include "main/imports.h" +#include "main/context.h" +#include "main/macros.h" +#include "main/texformat.h" +#include "main/teximage.h" +#include "main/texobj.h" +#include "main/enums.h" #include "r300_context.h" #include "r300_state.h" @@ -219,6 +219,8 @@ static void setup_hardware_state(r300ContextPtr rmesa, r300TexObj *t) if (t->base.Target == GL_TEXTURE_CUBE_MAP) t->format |= R300_TX_FORMAT_CUBIC_MAP; + if (t->base.Target == GL_TEXTURE_3D) + t->format |= R300_TX_FORMAT_3D; t->size = (((firstImage->Width - 1) << R300_TX_WIDTHMASK_SHIFT) | ((firstImage->Height - 1) << R300_TX_HEIGHTMASK_SHIFT)) diff --git a/src/mesa/drivers/dri/r300/r500_fragprog.c b/src/mesa/drivers/dri/r300/r500_fragprog.c index a84ba13c12..75dae86fa8 100644 --- a/src/mesa/drivers/dri/r300/r500_fragprog.c +++ b/src/mesa/drivers/dri/r300/r500_fragprog.c @@ -317,6 +317,14 @@ static GLboolean is_native_swizzle(GLuint opcode, struct prog_src_register reg) return GL_FALSE; return GL_TRUE; + } else if (opcode == OPCODE_DDX || opcode == OPCODE_DDY) { + /* DDX/MDH and DDY/MDV explicitly ignore incoming swizzles; + * if it doesn't fit perfectly into a .xyzw case... */ + if (reg.Swizzle == SWIZZLE_NOOP && !reg.Abs + && !reg.NegateBase && !reg.NegateAbs) + return GL_TRUE; + + return GL_FALSE; } else { /* ALU instructions support almost everything */ if (reg.Abs) @@ -439,13 +447,14 @@ void r500TranslateFragmentShader(r300ContextPtr r300, insert_WPOS_trailer(&compiler); - struct radeon_program_transformation transformations[3] = { + struct radeon_program_transformation transformations[] = { { &transform_TEX, &compiler }, { &radeonTransformALU, 0 }, + { &radeonTransformDeriv, 0 }, { &radeonTransformTrigScale, 0 } }; radeonLocalTransform(r300->radeon.glCtx, compiler.program, - 3, transformations); + 4, transformations); if (RADEON_DEBUG & DEBUG_PIXEL) { _mesa_printf("Compiler: after native rewrite:\n"); diff --git a/src/mesa/drivers/dri/r300/r500_fragprog.h b/src/mesa/drivers/dri/r300/r500_fragprog.h index 8641ceeb8f..1e45538f80 100644 --- a/src/mesa/drivers/dri/r300/r500_fragprog.h +++ b/src/mesa/drivers/dri/r300/r500_fragprog.h @@ -33,9 +33,9 @@ #ifndef __R500_FRAGPROG_H_ #define __R500_FRAGPROG_H_ -#include "glheader.h" -#include "macros.h" -#include "enums.h" +#include "main/glheader.h" +#include "main/macros.h" +#include "main/enums.h" #include "shader/prog_parameter.h" #include "shader/prog_print.h" #include "shader/program.h" diff --git a/src/mesa/drivers/dri/r300/r500_fragprog_emit.c b/src/mesa/drivers/dri/r300/r500_fragprog_emit.c index b6f52474e2..4631235f0d 100644 --- a/src/mesa/drivers/dri/r300/r500_fragprog_emit.c +++ b/src/mesa/drivers/dri/r300/r500_fragprog_emit.c @@ -89,6 +89,8 @@ static GLuint translate_rgb_op(GLuint opcode) { switch(opcode) { case OPCODE_CMP: return R500_ALU_RGBA_OP_CMP; + case OPCODE_DDX: return R500_ALU_RGBA_OP_MDH; + case OPCODE_DDY: return R500_ALU_RGBA_OP_MDV; case OPCODE_DP3: return R500_ALU_RGBA_OP_DP3; case OPCODE_DP4: return R500_ALU_RGBA_OP_DP4; case OPCODE_FRC: return R500_ALU_RGBA_OP_FRC; @@ -109,6 +111,8 @@ static GLuint translate_alpha_op(GLuint opcode) switch(opcode) { case OPCODE_CMP: return R500_ALPHA_OP_CMP; case OPCODE_COS: return R500_ALPHA_OP_COS; + case OPCODE_DDX: return R500_ALPHA_OP_MDH; + case OPCODE_DDY: return R500_ALPHA_OP_MDV; case OPCODE_DP3: return R500_ALPHA_OP_DP; case OPCODE_DP4: return R500_ALPHA_OP_DP; case OPCODE_EX2: return R500_ALPHA_OP_EX2; diff --git a/src/mesa/drivers/dri/r300/radeon_context.c b/src/mesa/drivers/dri/r300/radeon_context.c index 20bc2f5dee..0d531716c1 100644 --- a/src/mesa/drivers/dri/r300/radeon_context.c +++ b/src/mesa/drivers/dri/r300/radeon_context.c @@ -36,17 +36,17 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include <dlfcn.h> -#include "glheader.h" -#include "imports.h" -#include "context.h" -#include "state.h" -#include "matrix.h" -#include "framebuffer.h" -#include "drirenderbuffer.h" +#include "main/glheader.h" +#include "main/imports.h" +#include "main/context.h" +#include "main/state.h" +#include "main/matrix.h" +#include "main/framebuffer.h" #include "drivers/common/driverfuncs.h" #include "swrast/swrast.h" +#include "radeon_buffer.h" #include "radeon_screen.h" #include "radeon_ioctl.h" #include "radeon_macros.h" @@ -58,6 +58,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "utils.h" #include "vblank.h" #include "xmlpool.h" /* for symbolic values of enum-type options */ +#include "drirenderbuffer.h" #define DRIVER_DATE "20060815" diff --git a/src/mesa/drivers/dri/r300/radeon_context.h b/src/mesa/drivers/dri/r300/radeon_context.h index 828853bf02..effca13ea1 100644 --- a/src/mesa/drivers/dri/r300/radeon_context.h +++ b/src/mesa/drivers/dri/r300/radeon_context.h @@ -43,12 +43,11 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #ifndef __RADEON_CONTEXT_H__ #define __RADEON_CONTEXT_H__ -#include "mtypes.h" +#include "main/mtypes.h" +#include "main/colormac.h" #include "radeon_screen.h" #include "drm.h" #include "dri_util.h" -#include "colormac.h" -#include "radeon_buffer.h" struct radeon_context; typedef struct radeon_context radeonContextRec; diff --git a/src/mesa/drivers/dri/r300/radeon_ioctl.c b/src/mesa/drivers/dri/r300/radeon_ioctl.c index 486ce8eae7..6186d1f555 100644 --- a/src/mesa/drivers/dri/r300/radeon_ioctl.c +++ b/src/mesa/drivers/dri/r300/radeon_ioctl.c @@ -35,10 +35,10 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include <sched.h> #include <errno.h> -#include "glheader.h" -#include "imports.h" -#include "macros.h" -#include "context.h" +#include "main/glheader.h" +#include "main/imports.h" +#include "main/macros.h" +#include "main/context.h" #include "swrast/swrast.h" #include "r300_context.h" #include "radeon_ioctl.h" diff --git a/src/mesa/drivers/dri/r300/radeon_ioctl.h b/src/mesa/drivers/dri/r300/radeon_ioctl.h index 210001e8e0..3add775b82 100644 --- a/src/mesa/drivers/dri/r300/radeon_ioctl.h +++ b/src/mesa/drivers/dri/r300/radeon_ioctl.h @@ -35,14 +35,14 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #ifndef __RADEON_IOCTL_H__ #define __RADEON_IOCTL_H__ -#include "simple_list.h" +#include "main/simple_list.h" #include "radeon_dri.h" #include "radeon_lock.h" #include "xf86drm.h" #include "drm.h" #if 0 -#include "r200_context.h" +#include "r200context.h" #endif #include "radeon_drm.h" diff --git a/src/mesa/drivers/dri/r300/radeon_lock.c b/src/mesa/drivers/dri/r300/radeon_lock.c index 4df6a9c6ad..9e59c7693d 100644 --- a/src/mesa/drivers/dri/r300/radeon_lock.c +++ b/src/mesa/drivers/dri/r300/radeon_lock.c @@ -46,7 +46,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "r300_state.h" #include "r300_mem.h" -#include "framebuffer.h" +#include "main/framebuffer.h" #include "drirenderbuffer.h" diff --git a/src/mesa/drivers/dri/r300/radeon_nqssadce.c b/src/mesa/drivers/dri/r300/radeon_nqssadce.c index f10ba4004a..97ce016c99 100644 --- a/src/mesa/drivers/dri/r300/radeon_nqssadce.c +++ b/src/mesa/drivers/dri/r300/radeon_nqssadce.c @@ -218,6 +218,8 @@ static void process_instruction(struct nqssadce_state* s) * might change the instruction stream under us, so we have * to be careful with the inst pointer. */ switch (inst->Opcode) { + case OPCODE_DDX: + case OPCODE_DDY: case OPCODE_FRC: case OPCODE_MOV: inst = track_used_srcreg(s, inst, 0, inst->DstReg.WriteMask); diff --git a/src/mesa/drivers/dri/r300/radeon_program.h b/src/mesa/drivers/dri/r300/radeon_program.h index 2e01dd496b..b411f69bc8 100644 --- a/src/mesa/drivers/dri/r300/radeon_program.h +++ b/src/mesa/drivers/dri/r300/radeon_program.h @@ -28,9 +28,9 @@ #ifndef __RADEON_PROGRAM_H_ #define __RADEON_PROGRAM_H_ -#include "glheader.h" -#include "macros.h" -#include "enums.h" +#include "main/glheader.h" +#include "main/macros.h" +#include "main/enums.h" #include "shader/program.h" #include "shader/prog_instruction.h" diff --git a/src/mesa/drivers/dri/r300/radeon_program_alu.c b/src/mesa/drivers/dri/r300/radeon_program_alu.c index e0a2bd0e93..1ef71e74dc 100644 --- a/src/mesa/drivers/dri/r300/radeon_program_alu.c +++ b/src/mesa/drivers/dri/r300/radeon_program_alu.c @@ -629,3 +629,30 @@ GLboolean radeonTransformTrigScale(struct radeon_transform_context* t, return GL_TRUE; } + +/** + * Rewrite DDX/DDY instructions to properly work with r5xx shaders. + * The r5xx MDH/MDV instruction provides per-quad partial derivatives. + * It takes the form A*B+C. A and C are set by setting src0. B should be -1. + * + * @warning This explicitly changes the form of DDX and DDY! + */ + +GLboolean radeonTransformDeriv(struct radeon_transform_context* t, + struct prog_instruction* inst, + void* unused) +{ + if (inst->Opcode != OPCODE_DDX && inst->Opcode != OPCODE_DDY) + return GL_FALSE; + + struct prog_src_register B = inst->SrcReg[1]; + + B.Swizzle = MAKE_SWIZZLE4(SWIZZLE_ONE, SWIZZLE_ONE, + SWIZZLE_ONE, SWIZZLE_ONE); + B.NegateBase = NEGATE_XYZW; + + emit2(t->Program, inst->Opcode, inst->SaturateMode, inst->DstReg, + inst->SrcReg[0], B); + + return GL_TRUE; +} diff --git a/src/mesa/drivers/dri/r300/radeon_program_alu.h b/src/mesa/drivers/dri/r300/radeon_program_alu.h index ea9d5bb669..b45958115c 100644 --- a/src/mesa/drivers/dri/r300/radeon_program_alu.h +++ b/src/mesa/drivers/dri/r300/radeon_program_alu.h @@ -45,4 +45,9 @@ GLboolean radeonTransformTrigScale( struct prog_instruction*, void*); +GLboolean radeonTransformDeriv( + struct radeon_transform_context *t, + struct prog_instruction*, + void*); + #endif /* __RADEON_PROGRAM_ALU_H_ */ diff --git a/src/mesa/drivers/dri/r300/radeon_program_pair.c b/src/mesa/drivers/dri/r300/radeon_program_pair.c index 4307994d74..5ad50d2863 100644 --- a/src/mesa/drivers/dri/r300/radeon_program_pair.c +++ b/src/mesa/drivers/dri/r300/radeon_program_pair.c @@ -305,6 +305,8 @@ static void classify_instruction(struct pair_state *s, switch(inst->Opcode) { case OPCODE_ADD: case OPCODE_CMP: + case OPCODE_DDX: + case OPCODE_DDY: case OPCODE_FRC: case OPCODE_MAD: case OPCODE_MAX: @@ -673,8 +675,6 @@ static int alloc_pair_source(struct pair_state *s, struct radeon_pair_instructio return candidate; } - - /** * Fill the given ALU instruction's opcodes and source operands into the given pair, * if possible. @@ -704,6 +704,14 @@ static GLboolean fill_instruction_into_pair(struct pair_state *s, struct radeon_ int nargs = _mesa_num_inst_src_regs(inst->Opcode); int i; + /* Special case for DDX/DDY (MDH/MDV). */ + if (inst->Opcode == OPCODE_DDX || inst->Opcode == OPCODE_DDY) { + if (pair->RGB.Src[0].Used || pair->Alpha.Src[0].Used) + return GL_FALSE; + else + nargs++; + } + for(i = 0; i < nargs; ++i) { int source; if (pairinst->NeedRGB && !pairinst->IsTranscendent) { diff --git a/src/mesa/drivers/dri/r300/radeon_span.c b/src/mesa/drivers/dri/r300/radeon_span.c index e617faf6d2..de94888d6d 100644 --- a/src/mesa/drivers/dri/r300/radeon_span.c +++ b/src/mesa/drivers/dri/r300/radeon_span.c @@ -40,7 +40,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * */ -#include "glheader.h" +#include "main/glheader.h" #include "swrast/swrast.h" #include "r300_state.h" @@ -173,6 +173,8 @@ radeon_mba_z16(const struct radeon_renderbuffer *rrb, GLint x, GLint y) /* 16-bit depth buffer functions */ +#define VALUE_TYPE GLushort + #define WRITE_DEPTH( _x, _y, d ) \ *(GLushort *)(buf + radeon_mba_z16( rrb, _x + xo, _y + yo )) = d; @@ -187,6 +189,8 @@ radeon_mba_z16(const struct radeon_renderbuffer *rrb, GLint x, GLint y) * Careful: It looks like the R300 uses ZZZS byte order while the R200 * uses SZZZ for 24 bit depth, 8 bit stencil mode. */ +#define VALUE_TYPE GLuint + #ifdef COMPILE_R300 #define WRITE_DEPTH( _x, _y, d ) \ do { \ diff --git a/src/mesa/drivers/dri/r300/radeon_state.c b/src/mesa/drivers/dri/r300/radeon_state.c index a7720daafa..024190317b 100644 --- a/src/mesa/drivers/dri/r300/radeon_state.c +++ b/src/mesa/drivers/dri/r300/radeon_state.c @@ -33,12 +33,13 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * Keith Whitwell <keith@tungstengraphics.com> */ -#include "glheader.h" -#include "imports.h" -#include "api_arrayelt.h" -#include "enums.h" -#include "colormac.h" -#include "light.h" +#include "main/glheader.h" +#include "main/imports.h" +#include "main/api_arrayelt.h" +#include "main/enums.h" +#include "main/framebuffer.h" +#include "main/colormac.h" +#include "main/light.h" #include "swrast/swrast.h" #include "vbo/vbo.h" @@ -49,7 +50,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "radeon_ioctl.h" #include "radeon_state.h" #include "r300_ioctl.h" -#include "framebuffer.h" + /* ============================================================= * Scissoring diff --git a/src/mesa/drivers/dri/radeon/radeon_buffer.h b/src/mesa/drivers/dri/radeon/radeon_buffer.h index 730c40b082..621e39a4b1 100644 --- a/src/mesa/drivers/dri/radeon/radeon_buffer.h +++ b/src/mesa/drivers/dri/radeon/radeon_buffer.h @@ -26,7 +26,8 @@ #ifndef RADEON_BUFFER_H #define RADEON_BUFFER_H -#include "dri_bufmgr.h" +#include "radeon_dri_bufmgr.h" +#include "dri_util.h" struct radeon_renderbuffer { diff --git a/src/mesa/drivers/dri/radeon/radeon_compat.c b/src/mesa/drivers/dri/radeon/radeon_compat.c index 1cbe3407ba..46b490d61f 100644 --- a/src/mesa/drivers/dri/radeon/radeon_compat.c +++ b/src/mesa/drivers/dri/radeon/radeon_compat.c @@ -1,4 +1,3 @@ -/* $XFree86$ */ /************************************************************************** Copyright 2002 ATI Technologies Inc., Ontario, Canada, and @@ -33,8 +32,8 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. * */ -#include "glheader.h" -#include "imports.h" +#include "main/glheader.h" +#include "main/imports.h" #include "radeon_context.h" #include "radeon_state.h" diff --git a/src/mesa/drivers/dri/radeon/radeon_context.c b/src/mesa/drivers/dri/radeon/radeon_context.c index 7aa0e3eac8..1e992c0b3d 100644 --- a/src/mesa/drivers/dri/radeon/radeon_context.c +++ b/src/mesa/drivers/dri/radeon/radeon_context.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_context.c,v 1.9 2003/09/24 02:43:12 dawes Exp $ */ /************************************************************************** Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and diff --git a/src/mesa/drivers/dri/radeon/radeon_context.h b/src/mesa/drivers/dri/radeon/radeon_context.h index bc43fc5960..53df766f8c 100644 --- a/src/mesa/drivers/dri/radeon/radeon_context.h +++ b/src/mesa/drivers/dri/radeon/radeon_context.h @@ -49,9 +49,9 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "radeon_drm.h" #include "texmem.h" -#include "macros.h" -#include "mtypes.h" -#include "colormac.h" +#include "main/macros.h" +#include "main/mtypes.h" +#include "main/colormac.h" struct radeon_context; typedef struct radeon_context radeonContextRec; @@ -66,7 +66,7 @@ typedef union { #include "radeon_lock.h" #include "radeon_screen.h" -#include "mm.h" +#include "main/mm.h" #include "math/m_vector.h" diff --git a/src/mesa/drivers/dri/common/dri_bufmgr.c b/src/mesa/drivers/dri/radeon/radeon_dri_bufmgr.c index 8b5cb7628e..0bae2b5449 100644 --- a/src/mesa/drivers/dri/common/dri_bufmgr.c +++ b/src/mesa/drivers/dri/radeon/radeon_dri_bufmgr.c @@ -28,8 +28,8 @@ #include <string.h> #include <stdlib.h> #include <assert.h> -#include "mtypes.h" -#include "dri_bufmgr.h" +#include "main/mtypes.h" +#include "radeon_dri_bufmgr.h" /** @file dri_bufmgr.c * diff --git a/src/mesa/drivers/dri/common/dri_bufmgr.h b/src/mesa/drivers/dri/radeon/radeon_dri_bufmgr.h index 0a726dc108..0a726dc108 100644 --- a/src/mesa/drivers/dri/common/dri_bufmgr.h +++ b/src/mesa/drivers/dri/radeon/radeon_dri_bufmgr.h diff --git a/src/mesa/drivers/dri/radeon/radeon_ioctl.c b/src/mesa/drivers/dri/radeon/radeon_ioctl.c index 446025b631..09acf6b4f8 100644 --- a/src/mesa/drivers/dri/radeon/radeon_ioctl.c +++ b/src/mesa/drivers/dri/radeon/radeon_ioctl.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_ioctl.c,v 1.11 2003/01/29 22:04:59 dawes Exp $ */ /************************************************************************** Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and @@ -38,9 +37,9 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include <sched.h> #include <errno.h> -#include "glheader.h" -#include "imports.h" -#include "simple_list.h" +#include "main/glheader.h" +#include "main/imports.h" +#include "main/simple_list.h" #include "swrast/swrast.h" #include "radeon_context.h" @@ -778,11 +777,11 @@ void radeonAllocDmaRegion( radeonContextPtr rmesa, * SwapBuffers with client-side throttling */ -static u_int32_t radeonGetLastFrame (radeonContextPtr rmesa) +static uint32_t radeonGetLastFrame (radeonContextPtr rmesa) { drm_radeon_getparam_t gp; int ret; - u_int32_t frame; + uint32_t frame; gp.param = RADEON_PARAM_LAST_FRAME; gp.value = (int *)&frame; @@ -1032,7 +1031,7 @@ static void radeonClear( GLcontext *ctx, GLbitfield mask ) radeonContextPtr rmesa = RADEON_CONTEXT(ctx); __DRIdrawablePrivate *dPriv = rmesa->dri.drawable; drm_radeon_sarea_t *sarea = rmesa->sarea; - u_int32_t clear; + uint32_t clear; GLuint flags = 0; GLuint color_mask = 0; GLint ret, i; diff --git a/src/mesa/drivers/dri/radeon/radeon_ioctl.h b/src/mesa/drivers/dri/radeon/radeon_ioctl.h index b3c287fb2b..4e3a44df07 100644 --- a/src/mesa/drivers/dri/radeon/radeon_ioctl.h +++ b/src/mesa/drivers/dri/radeon/radeon_ioctl.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_ioctl.h,v 1.6 2002/12/16 16:18:58 dawes Exp $ */ /************************************************************************** Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and @@ -37,7 +36,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #ifndef __RADEON_IOCTL_H__ #define __RADEON_IOCTL_H__ -#include "simple_list.h" +#include "main/simple_list.h" #include "radeon_lock.h" diff --git a/src/mesa/drivers/dri/radeon/radeon_lighting.c b/src/mesa/drivers/dri/radeon/radeon_lighting.c index 44e00af0ef..6d9ccfa24d 100644 --- a/src/mesa/drivers/dri/radeon/radeon_lighting.c +++ b/src/mesa/drivers/dri/radeon/radeon_lighting.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_state.c,v 1.5 2002/09/16 18:05:20 eich Exp $ */ /* * Copyright 2000, 2001 VA Linux Systems Inc., Fremont, California. * @@ -28,11 +27,11 @@ * Keith Whitwell <keith@tungstengraphics.com> */ -#include "glheader.h" -#include "imports.h" +#include "main/glheader.h" +#include "main/imports.h" #include "api_arrayelt.h" /* #include "mmath.h" */ -#include "enums.h" +#include "main/enums.h" #include "colormac.h" diff --git a/src/mesa/drivers/dri/radeon/radeon_lock.c b/src/mesa/drivers/dri/radeon/radeon_lock.c index 30a0c3863c..64bb3ca103 100644 --- a/src/mesa/drivers/dri/radeon/radeon_lock.c +++ b/src/mesa/drivers/dri/radeon/radeon_lock.c @@ -39,8 +39,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * Kevin E. Martin <martin@valinux.com> */ -#include "glheader.h" -#include "mtypes.h" +#include "main/glheader.h" +#include "main/mtypes.h" #include "radeon_context.h" #include "radeon_lock.h" #include "radeon_tex.h" diff --git a/src/mesa/drivers/dri/radeon/radeon_maos.h b/src/mesa/drivers/dri/radeon/radeon_maos.h index 09039d6840..b8935e84a0 100644 --- a/src/mesa/drivers/dri/radeon/radeon_maos.h +++ b/src/mesa/drivers/dri/radeon/radeon_maos.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_maos.h,v 1.1 2002/10/30 12:51:55 alanh Exp $ */ /************************************************************************** Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and diff --git a/src/mesa/drivers/dri/radeon/radeon_maos_arrays.c b/src/mesa/drivers/dri/radeon/radeon_maos_arrays.c index 49118b5e37..de3c3a15a7 100644 --- a/src/mesa/drivers/dri/radeon/radeon_maos_arrays.c +++ b/src/mesa/drivers/dri/radeon/radeon_maos_arrays.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_maos_arrays.c,v 1.1 2002/10/30 12:51:55 alanh Exp $ */ /************************************************************************** Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and @@ -33,15 +32,15 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * Keith Whitwell <keith@tungstengraphics.com> */ -#include "glheader.h" -#include "imports.h" -#include "mtypes.h" -#include "macros.h" +#include "main/glheader.h" +#include "main/imports.h" +#include "main/mtypes.h" +#include "main/macros.h" #include "swrast_setup/swrast_setup.h" #include "math/m_translate.h" #include "tnl/tnl.h" -#include "tnl/t_context.h" +#include "tnl/tcontext.h" #include "radeon_context.h" #include "radeon_ioctl.h" diff --git a/src/mesa/drivers/dri/radeon/radeon_maos_verts.c b/src/mesa/drivers/dri/radeon/radeon_maos_verts.c index 65dbecf7a6..126d0727c6 100644 --- a/src/mesa/drivers/dri/radeon/radeon_maos_verts.c +++ b/src/mesa/drivers/dri/radeon/radeon_maos_verts.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_maos_verts.c,v 1.1 2002/10/30 12:51:55 alanh Exp $ */ /************************************************************************** Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and @@ -33,9 +32,9 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * Keith Whitwell <keith@tungstengraphics.com> */ -#include "glheader.h" -#include "imports.h" -#include "mtypes.h" +#include "main/glheader.h" +#include "main/imports.h" +#include "main/mtypes.h" #include "vbo/vbo.h" #include "math/m_translate.h" diff --git a/src/mesa/drivers/dri/radeon/radeon_sanity.c b/src/mesa/drivers/dri/radeon/radeon_sanity.c index 557057784c..6613757fce 100644 --- a/src/mesa/drivers/dri/radeon/radeon_sanity.c +++ b/src/mesa/drivers/dri/radeon/radeon_sanity.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_sanity.c,v 1.1 2002/10/30 12:51:55 alanh Exp $ */ /************************************************************************** Copyright 2002 ATI Technologies Inc., Ontario, Canada, and @@ -34,7 +33,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include <errno.h> -#include "glheader.h" +#include "main/glheader.h" #include "radeon_context.h" #include "radeon_ioctl.h" diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.c b/src/mesa/drivers/dri/radeon/radeon_screen.c index 212c73b7bc..d8e570f311 100644 --- a/src/mesa/drivers/dri/radeon/radeon_screen.c +++ b/src/mesa/drivers/dri/radeon/radeon_screen.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_screen.c,v 1.7 2003/03/26 20:43:51 tsi Exp $ */ /************************************************************************** Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and @@ -36,11 +35,11 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * \author Gareth Hughes <gareth@valinux.com> */ -#include "glheader.h" -#include "imports.h" -#include "mtypes.h" -#include "framebuffer.h" -#include "renderbuffer.h" +#include "main/glheader.h" +#include "main/imports.h" +#include "main/mtypes.h" +#include "main/framebuffer.h" +#include "main/renderbuffer.h" #define STANDALONE_MMIO #include "radeon_chipset.h" @@ -64,7 +63,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #endif #include "utils.h" -#include "context.h" #include "vblank.h" #include "drirenderbuffer.h" @@ -275,8 +273,8 @@ radeonFillInModes( __DRIscreenPrivate *psp, GLX_NONE, GLX_SWAP_UNDEFINED_OML /*, GLX_SWAP_COPY_OML */ }; - u_int8_t depth_bits_array[2]; - u_int8_t stencil_bits_array[2]; + uint8_t depth_bits_array[2]; + uint8_t stencil_bits_array[2]; depth_bits_array[0] = depth_bits; @@ -447,7 +445,7 @@ radeonCreateScreen( __DRIscreenPrivate *sPriv ) __driUtilMessage("%s: drmMap (2) failed\n", __FUNCTION__ ); return NULL; } - screen->scratch = (__volatile__ u_int32_t *) + screen->scratch = (__volatile__ uint32_t *) ((GLubyte *)screen->status.map + RADEON_SCRATCH_REG_OFFSET); screen->buffers = drmMapBufs( sPriv->fd ); diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.h b/src/mesa/drivers/dri/radeon/radeon_screen.h index ab859d55bd..b84c70bfae 100644 --- a/src/mesa/drivers/dri/radeon/radeon_screen.h +++ b/src/mesa/drivers/dri/radeon/radeon_screen.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_screen.h,v 1.5 2002/12/16 16:18:58 dawes Exp $ */ /************************************************************************** Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and @@ -84,7 +83,7 @@ typedef struct { drmBufMapPtr buffers; - __volatile__ u_int32_t *scratch; + __volatile__ uint32_t *scratch; __DRIscreenPrivate *driScreen; unsigned int sarea_priv_offset; diff --git a/src/mesa/drivers/dri/radeon/radeon_span.c b/src/mesa/drivers/dri/radeon/radeon_span.c index 732a85ecf0..12051ff1c8 100644 --- a/src/mesa/drivers/dri/radeon/radeon_span.c +++ b/src/mesa/drivers/dri/radeon/radeon_span.c @@ -40,7 +40,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * */ -#include "glheader.h" +#include "main/glheader.h" #include "swrast/swrast.h" #include "radeon_context.h" @@ -173,6 +173,8 @@ radeon_mba_z16(const driRenderbuffer * drb, GLint x, GLint y) /* 16-bit depth buffer functions */ +#define VALUE_TYPE GLushort + #define WRITE_DEPTH( _x, _y, d ) \ *(GLushort *)(buf + radeon_mba_z16( drb, _x + xo, _y + yo )) = d; @@ -187,6 +189,8 @@ radeon_mba_z16(const driRenderbuffer * drb, GLint x, GLint y) * Careful: It looks like the R300 uses ZZZS byte order while the R200 * uses SZZZ for 24 bit depth, 8 bit stencil mode. */ +#define VALUE_TYPE GLuint + #ifdef COMPILE_R300 #define WRITE_DEPTH( _x, _y, d ) \ do { \ diff --git a/src/mesa/drivers/dri/radeon/radeon_state.c b/src/mesa/drivers/dri/radeon/radeon_state.c index ae83c91d25..32bcff3360 100644 --- a/src/mesa/drivers/dri/radeon/radeon_state.c +++ b/src/mesa/drivers/dri/radeon/radeon_state.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_state.c,v 1.8 2002/12/16 16:18:58 dawes Exp $ */ /************************************************************************** Copyright 2000, 2001 VA Linux Systems Inc., Fremont, California. @@ -33,14 +32,14 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * Keith Whitwell <keith@tungstengraphics.com> */ -#include "glheader.h" -#include "imports.h" -#include "api_arrayelt.h" -#include "enums.h" -#include "light.h" -#include "state.h" -#include "context.h" -#include "framebuffer.h" +#include "main/glheader.h" +#include "main/imports.h" +#include "main/api_arrayelt.h" +#include "main/enums.h" +#include "main/light.h" +#include "main/state.h" +#include "main/context.h" +#include "main/framebuffer.h" #include "vbo/vbo.h" #include "tnl/tnl.h" @@ -688,7 +687,7 @@ static void radeonPolygonMode( GLcontext *ctx, GLenum face, GLenum mode ) static void radeonUpdateSpecular( GLcontext *ctx ) { radeonContextPtr rmesa = RADEON_CONTEXT(ctx); - u_int32_t p = rmesa->hw.ctx.cmd[CTX_PP_CNTL]; + uint32_t p = rmesa->hw.ctx.cmd[CTX_PP_CNTL]; GLuint flag = 0; RADEON_STATECHANGE( rmesa, tcl ); diff --git a/src/mesa/drivers/dri/radeon/radeon_state.h b/src/mesa/drivers/dri/radeon/radeon_state.h index ad7db3b677..2171879f75 100644 --- a/src/mesa/drivers/dri/radeon/radeon_state.h +++ b/src/mesa/drivers/dri/radeon/radeon_state.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_state.h,v 1.5 2002/11/05 17:46:09 tsi Exp $ */ /************************************************************************** Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and diff --git a/src/mesa/drivers/dri/radeon/radeon_state_init.c b/src/mesa/drivers/dri/radeon/radeon_state_init.c index 5fc34f0933..57dc380050 100644 --- a/src/mesa/drivers/dri/radeon/radeon_state_init.c +++ b/src/mesa/drivers/dri/radeon/radeon_state_init.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_state_init.c,v 1.3 2003/02/22 06:21:11 dawes Exp $ */ /* * Copyright 2000, 2001 VA Linux Systems Inc., Fremont, California. * @@ -28,9 +27,9 @@ * Keith Whitwell <keith@tungstengraphics.com> */ -#include "glheader.h" -#include "imports.h" -#include "api_arrayelt.h" +#include "main/glheader.h" +#include "main/imports.h" +#include "main/api_arrayelt.h" #include "swrast/swrast.h" #include "vbo/vbo.h" diff --git a/src/mesa/drivers/dri/radeon/radeon_swtcl.c b/src/mesa/drivers/dri/radeon/radeon_swtcl.c index 7ce1fa67cf..ebea1fecdc 100644 --- a/src/mesa/drivers/dri/radeon/radeon_swtcl.c +++ b/src/mesa/drivers/dri/radeon/radeon_swtcl.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_swtcl.c,v 1.6 2003/05/06 23:52:08 daenzer Exp $ */ /************************************************************************** Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and @@ -33,12 +32,12 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * Keith Whitwell <keith@tungstengraphics.com> */ -#include "glheader.h" -#include "mtypes.h" -#include "colormac.h" -#include "enums.h" -#include "imports.h" -#include "macros.h" +#include "main/glheader.h" +#include "main/mtypes.h" +#include "main/colormac.h" +#include "main/enums.h" +#include "main/imports.h" +#include "main/macros.h" #include "swrast_setup/swrast_setup.h" #include "math/m_translate.h" diff --git a/src/mesa/drivers/dri/radeon/radeon_swtcl.h b/src/mesa/drivers/dri/radeon/radeon_swtcl.h index 64f9019513..e485052ad7 100644 --- a/src/mesa/drivers/dri/radeon/radeon_swtcl.h +++ b/src/mesa/drivers/dri/radeon/radeon_swtcl.h @@ -1,4 +1,3 @@ -/* $XFree86$ */ /************************************************************************** Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and @@ -36,7 +35,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #ifndef __RADEON_TRIS_H__ #define __RADEON_TRIS_H__ -#include "mtypes.h" +#include "main/mtypes.h" #include "swrast/swrast.h" #include "radeon_context.h" diff --git a/src/mesa/drivers/dri/radeon/radeon_tcl.c b/src/mesa/drivers/dri/radeon/radeon_tcl.c index 0f4baf2e7d..779e9ae5df 100644 --- a/src/mesa/drivers/dri/radeon/radeon_tcl.c +++ b/src/mesa/drivers/dri/radeon/radeon_tcl.c @@ -1,4 +1,3 @@ -/* $XFree86$ */ /************************************************************************** Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and @@ -33,11 +32,11 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * Keith Whitwell <keith@tungstengraphics.com> */ -#include "glheader.h" -#include "imports.h" -#include "light.h" -#include "mtypes.h" -#include "enums.h" +#include "main/glheader.h" +#include "main/imports.h" +#include "main/light.h" +#include "main/mtypes.h" +#include "main/enums.h" #include "vbo/vbo.h" #include "tnl/tnl.h" diff --git a/src/mesa/drivers/dri/radeon/radeon_tcl.h b/src/mesa/drivers/dri/radeon/radeon_tcl.h index 168ab958a2..dccbea5fdb 100644 --- a/src/mesa/drivers/dri/radeon/radeon_tcl.h +++ b/src/mesa/drivers/dri/radeon/radeon_tcl.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_tcl.h,v 1.2 2003/02/08 21:26:45 dawes Exp $ */ /************************************************************************** Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and diff --git a/src/mesa/drivers/dri/radeon/radeon_tex.c b/src/mesa/drivers/dri/radeon/radeon_tex.c index edaea6c209..b0aec21670 100644 --- a/src/mesa/drivers/dri/radeon/radeon_tex.c +++ b/src/mesa/drivers/dri/radeon/radeon_tex.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_tex.c,v 1.6 2002/09/16 18:05:20 eich Exp $ */ /* Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and VA Linux Systems Inc., Fremont, California. @@ -32,18 +31,17 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * Brian Paul <brianp@valinux.com> */ -#include "glheader.h" -#include "imports.h" -#include "colormac.h" -#include "context.h" -#include "enums.h" -#include "image.h" -#include "simple_list.h" -#include "texformat.h" -#include "texstore.h" -#include "teximage.h" -#include "texobj.h" - +#include "main/glheader.h" +#include "main/imports.h" +#include "main/colormac.h" +#include "main/context.h" +#include "main/enums.h" +#include "main/image.h" +#include "main/simple_list.h" +#include "main/texformat.h" +#include "main/texstore.h" +#include "main/teximage.h" +#include "main/texobj.h" #include "radeon_context.h" #include "radeon_state.h" diff --git a/src/mesa/drivers/dri/radeon/radeon_tex.h b/src/mesa/drivers/dri/radeon/radeon_tex.h index 0b955eda14..8000880828 100644 --- a/src/mesa/drivers/dri/radeon/radeon_tex.h +++ b/src/mesa/drivers/dri/radeon/radeon_tex.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_tex.h,v 1.3 2002/02/22 21:45:01 dawes Exp $ */ /************************************************************************** Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and diff --git a/src/mesa/drivers/dri/radeon/radeon_texmem.c b/src/mesa/drivers/dri/radeon/radeon_texmem.c index 0a3d745bd0..5f7bbe6a4c 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texmem.c +++ b/src/mesa/drivers/dri/radeon/radeon_texmem.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_texmem.c,v 1.7 2002/12/16 16:18:59 dawes Exp $ */ /************************************************************************** Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and @@ -37,10 +36,10 @@ SOFTWARE. */ #include <errno.h> -#include "glheader.h" -#include "imports.h" -#include "context.h" -#include "macros.h" +#include "main/glheader.h" +#include "main/imports.h" +#include "main/context.h" +#include "main/macros.h" #include "radeon_context.h" #include "radeon_ioctl.h" diff --git a/src/mesa/drivers/dri/radeon/radeon_texstate.c b/src/mesa/drivers/dri/radeon/radeon_texstate.c index ecd375473b..1e2f654add 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texstate.c +++ b/src/mesa/drivers/dri/radeon/radeon_texstate.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_texstate.c,v 1.6 2002/12/16 16:18:59 dawes Exp $ */ /************************************************************************** Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and @@ -34,14 +33,14 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * Gareth Hughes <gareth@valinux.com> */ -#include "glheader.h" -#include "imports.h" -#include "colormac.h" -#include "context.h" -#include "macros.h" -#include "texformat.h" -#include "texobj.h" -#include "enums.h" +#include "main/glheader.h" +#include "main/imports.h" +#include "main/colormac.h" +#include "main/context.h" +#include "main/macros.h" +#include "main/texformat.h" +#include "main/texobj.h" +#include "main/enums.h" #include "radeon_context.h" #include "radeon_state.h" diff --git a/src/mesa/drivers/dri/radeon/server/radeon.h b/src/mesa/drivers/dri/radeon/server/radeon.h index 6f6c2e6d25..3fb1e37c53 100644 --- a/src/mesa/drivers/dri/radeon/server/radeon.h +++ b/src/mesa/drivers/dri/radeon/server/radeon.h @@ -31,7 +31,6 @@ * DEALINGS IN THE SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon.h,v 1.29 2002/10/12 01:38:07 martin Exp $ */ #ifndef _RADEON_H_ #define _RADEON_H_ diff --git a/src/mesa/drivers/dri/radeon/server/radeon_dri.h b/src/mesa/drivers/dri/radeon/server/radeon_dri.h index ecd5323339..dc51372107 100644 --- a/src/mesa/drivers/dri/radeon/server/radeon_dri.h +++ b/src/mesa/drivers/dri/radeon/server/radeon_dri.h @@ -34,7 +34,6 @@ * DEALINGS IN THE SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_dri.h,v 1.3 2002/04/24 16:20:40 martin Exp $ */ #ifndef _RADEON_DRI_ #define _RADEON_DRI_ diff --git a/src/mesa/drivers/dri/radeon/server/radeon_egl.c b/src/mesa/drivers/dri/radeon/server/radeon_egl.c index 2f6ea55903..c16d66e4ec 100644 --- a/src/mesa/drivers/dri/radeon/server/radeon_egl.c +++ b/src/mesa/drivers/dri/radeon/server/radeon_egl.c @@ -935,8 +935,8 @@ radeonFillInConfigs(_EGLDisplay *disp, unsigned pixel_bits, GLX_NONE, GLX_SWAP_UNDEFINED_OML /*, GLX_SWAP_COPY_OML */ }; - u_int8_t depth_bits_array[2]; - u_int8_t stencil_bits_array[2]; + uint8_t depth_bits_array[2]; + uint8_t stencil_bits_array[2]; depth_bits_array[0] = depth_bits; depth_bits_array[1] = depth_bits; diff --git a/src/mesa/drivers/dri/radeon/server/radeon_macros.h b/src/mesa/drivers/dri/radeon/server/radeon_macros.h index 60f0fa2d35..355262c9ba 100644 --- a/src/mesa/drivers/dri/radeon/server/radeon_macros.h +++ b/src/mesa/drivers/dri/radeon/server/radeon_macros.h @@ -35,7 +35,6 @@ * DEALINGS IN THE SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_reg.h,v 1.20 2002/10/12 01:38:07 martin Exp $ */ #ifndef _RADEON_MACROS_H_ #define _RADEON_MACROS_H_ diff --git a/src/mesa/drivers/dri/radeon/server/radeon_reg.h b/src/mesa/drivers/dri/radeon/server/radeon_reg.h index 4dcce63846..596a8aa715 100644 --- a/src/mesa/drivers/dri/radeon/server/radeon_reg.h +++ b/src/mesa/drivers/dri/radeon/server/radeon_reg.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_reg.h,v 1.30 2003/10/07 22:47:12 martin Exp $ */ /* * Copyright 2000 ATI Technologies Inc., Markham, Ontario, and * VA Linux Systems Inc., Fremont, California. diff --git a/src/mesa/drivers/dri/s3v/s3v_context.c b/src/mesa/drivers/dri/s3v/s3v_context.c index 2d2f704ad7..14502f95ae 100644 --- a/src/mesa/drivers/dri/s3v/s3v_context.c +++ b/src/mesa/drivers/dri/s3v/s3v_context.c @@ -11,15 +11,15 @@ #include "tnl/tnl.h" #include "tnl/t_pipeline.h" -#include "context.h" -#include "simple_list.h" -#include "matrix.h" -#include "extensions.h" +#include "main/context.h" +#include "main/simple_list.h" +#include "main/matrix.h" +#include "main/extensions.h" #if defined(USE_X86_ASM) #include "x86/common_x86_asm.h" #endif -#include "simple_list.h" -#include "mm.h" +#include "main/simple_list.h" +#include "main/mm.h" #include "drivers/common/driverfuncs.h" #include "s3v_vb.h" diff --git a/src/mesa/drivers/dri/s3v/s3v_context.h b/src/mesa/drivers/dri/s3v/s3v_context.h index ed698103ff..671ba90d78 100644 --- a/src/mesa/drivers/dri/s3v/s3v_context.h +++ b/src/mesa/drivers/dri/s3v/s3v_context.h @@ -11,11 +11,11 @@ #include "s3v_regs.h" #include "s3v_macros.h" #include "s3v_screen.h" -#include "colormac.h" -#include "macros.h" -#include "mtypes.h" +#include "main/colormac.h" +#include "main/macros.h" +#include "main/mtypes.h" #include "drm.h" -#include "mm.h" +#include "main/mm.h" #include "drirenderbuffer.h" /* Flags for context */ diff --git a/src/mesa/drivers/dri/s3v/s3v_dd.c b/src/mesa/drivers/dri/s3v/s3v_dd.c index 1cbe890319..e340116f5e 100644 --- a/src/mesa/drivers/dri/s3v/s3v_dd.c +++ b/src/mesa/drivers/dri/s3v/s3v_dd.c @@ -9,8 +9,8 @@ #include "x86/common_x86_asm.h" #endif -#include "context.h" -#include "framebuffer.h" +#include "main/context.h" +#include "main/framebuffer.h" #include "swrast/swrast.h" #define S3V_DATE "20020207" diff --git a/src/mesa/drivers/dri/s3v/s3v_render.c b/src/mesa/drivers/dri/s3v/s3v_render.c index fa3f85e52b..5023f3c464 100644 --- a/src/mesa/drivers/dri/s3v/s3v_render.c +++ b/src/mesa/drivers/dri/s3v/s3v_render.c @@ -2,10 +2,10 @@ * Author: Max Lingua <sunmax@libero.it> */ -#include "glheader.h" -#include "context.h" -#include "macros.h" -#include "mtypes.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/macros.h" +#include "main/mtypes.h" #include "tnl/t_context.h" diff --git a/src/mesa/drivers/dri/s3v/s3v_screen.h b/src/mesa/drivers/dri/s3v/s3v_screen.h index 0c4f69efac..c49bc8587d 100644 --- a/src/mesa/drivers/dri/s3v/s3v_screen.h +++ b/src/mesa/drivers/dri/s3v/s3v_screen.h @@ -2,7 +2,7 @@ * Author: Max Lingua <sunmax@libero.it> */ -#include "mtypes.h" +#include "main/mtypes.h" typedef struct _s3vRegion { drm_handle_t handle; diff --git a/src/mesa/drivers/dri/s3v/s3v_span.c b/src/mesa/drivers/dri/s3v/s3v_span.c index de78f9f6b1..f9f7c0d1ee 100644 --- a/src/mesa/drivers/dri/s3v/s3v_span.c +++ b/src/mesa/drivers/dri/s3v/s3v_span.c @@ -128,6 +128,8 @@ do { \ /* 16 bit depthbuffer functions. */ +#define VALUE_TYPE GLushort + #define WRITE_DEPTH( _x, _y, d ) \ *(GLushort *)(buf + _x*2 + _y*dPriv->w*2) = d @@ -143,6 +145,8 @@ do { \ /* 32 bit depthbuffer functions. */ #if 0 +#define VALUE_TYPE GLuint + #define WRITE_DEPTH( _x, _y, d ) \ *(GLuint *)(buf + _x*4 + _y*pitch) = d; @@ -157,6 +161,8 @@ do { \ /* 24/8 bit interleaved depth/stencil functions */ #if 0 +#define VALUE_TYPE GLuint + #define WRITE_DEPTH( _x, _y, d ) { \ GLuint tmp = *(GLuint *)(buf + _x*4 + _y*pitch); \ tmp &= 0xff; \ diff --git a/src/mesa/drivers/dri/s3v/s3v_state.c b/src/mesa/drivers/dri/s3v/s3v_state.c index b86b618c11..c71c89a3e1 100644 --- a/src/mesa/drivers/dri/s3v/s3v_state.c +++ b/src/mesa/drivers/dri/s3v/s3v_state.c @@ -5,9 +5,9 @@ #include <X11/Xlibint.h> #include "s3v_context.h" #include "s3v_macros.h" -#include "macros.h" #include "s3v_dri.h" -#include "colormac.h" +#include "main/macros.h" +#include "main/colormac.h" #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" #include "vbo/vbo.h" diff --git a/src/mesa/drivers/dri/s3v/s3v_tex.c b/src/mesa/drivers/dri/s3v/s3v_tex.c index 5bee051b09..8bf2ea9878 100644 --- a/src/mesa/drivers/dri/s3v/s3v_tex.c +++ b/src/mesa/drivers/dri/s3v/s3v_tex.c @@ -5,16 +5,16 @@ #include <stdlib.h> #include <stdio.h> -#include "glheader.h" -#include "mtypes.h" -#include "simple_list.h" -#include "enums.h" -#include "texstore.h" -#include "texformat.h" -#include "teximage.h" +#include "main/glheader.h" +#include "main/mtypes.h" +#include "main/simple_list.h" +#include "main/enums.h" +#include "main/mm.h" +#include "main/texstore.h" +#include "main/texformat.h" +#include "main/teximage.h" #include "swrast/swrast.h" -#include "mm.h" #include "s3v_context.h" #include "s3v_tex.h" diff --git a/src/mesa/drivers/dri/s3v/s3v_texmem.c b/src/mesa/drivers/dri/s3v/s3v_texmem.c index 5b44340d19..705d105f55 100644 --- a/src/mesa/drivers/dri/s3v/s3v_texmem.c +++ b/src/mesa/drivers/dri/s3v/s3v_texmem.c @@ -5,13 +5,13 @@ #include <stdlib.h> #include <stdio.h> -#include "glheader.h" -#include "macros.h" -#include "mtypes.h" -#include "simple_list.h" -#include "enums.h" +#include "main/glheader.h" +#include "main/macros.h" +#include "main/mtypes.h" +#include "main/simple_list.h" +#include "main/enums.h" -#include "mm.h" +#include "main/mm.h" #include "s3v_context.h" #include "s3v_lock.h" #include "s3v_tex.h" diff --git a/src/mesa/drivers/dri/s3v/s3v_texstate.c b/src/mesa/drivers/dri/s3v/s3v_texstate.c index 2719de3663..455bae6301 100644 --- a/src/mesa/drivers/dri/s3v/s3v_texstate.c +++ b/src/mesa/drivers/dri/s3v/s3v_texstate.c @@ -5,13 +5,13 @@ #include <stdlib.h> #include <stdio.h> -#include "glheader.h" -#include "macros.h" -#include "mtypes.h" -#include "simple_list.h" -#include "enums.h" +#include "main/glheader.h" +#include "main/macros.h" +#include "main/mtypes.h" +#include "main/simple_list.h" +#include "main/enums.h" -#include "mm.h" +#include "main/mm.h" #include "s3v_context.h" #include "s3v_tex.h" diff --git a/src/mesa/drivers/dri/s3v/s3v_tris.c b/src/mesa/drivers/dri/s3v/s3v_tris.c index d6cceddd45..fafd38480c 100644 --- a/src/mesa/drivers/dri/s3v/s3v_tris.c +++ b/src/mesa/drivers/dri/s3v/s3v_tris.c @@ -11,10 +11,10 @@ #include "s3v_vb.h" #include "s3v_tris.h" -#include "glheader.h" -#include "mtypes.h" -#include "macros.h" -#include "colormac.h" +#include "main/glheader.h" +#include "main/mtypes.h" +#include "main/macros.h" +#include "main/colormac.h" #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" diff --git a/src/mesa/drivers/dri/s3v/s3v_vb.c b/src/mesa/drivers/dri/s3v/s3v_vb.c index dadf2b4891..00e375c6c4 100644 --- a/src/mesa/drivers/dri/s3v/s3v_vb.c +++ b/src/mesa/drivers/dri/s3v/s3v_vb.c @@ -2,10 +2,10 @@ * Author: Max Lingua <sunmax@libero.it> */ -#include "glheader.h" -#include "mtypes.h" -#include "macros.h" -#include "colormac.h" +#include "main/glheader.h" +#include "main/mtypes.h" +#include "main/macros.h" +#include "main/colormac.h" #include "swrast_setup/swrast_setup.h" #include "tnl/t_context.h" diff --git a/src/mesa/drivers/dri/s3v/s3v_vb.h b/src/mesa/drivers/dri/s3v/s3v_vb.h index b35d804e62..0fd5437380 100644 --- a/src/mesa/drivers/dri/s3v/s3v_vb.h +++ b/src/mesa/drivers/dri/s3v/s3v_vb.h @@ -5,7 +5,7 @@ #ifndef S3VVB_INC #define S3VVB_INC -#include "mtypes.h" +#include "main/mtypes.h" #include "swrast/swrast.h" #define _S3V_NEW_VERTEX (_NEW_TEXTURE | \ diff --git a/src/mesa/drivers/dri/s3v/s3v_xmesa.c b/src/mesa/drivers/dri/s3v/s3v_xmesa.c index 663dabdb91..b18c8763c3 100644 --- a/src/mesa/drivers/dri/s3v/s3v_xmesa.c +++ b/src/mesa/drivers/dri/s3v/s3v_xmesa.c @@ -4,11 +4,11 @@ #include "s3v_context.h" #include "s3v_vb.h" -#include "context.h" -#include "matrix.h" +#include "main/context.h" +#include "main/matrix.h" #include "s3v_dri.h" -#include "framebuffer.h" -#include "renderbuffer.h" +#include "main/framebuffer.h" +#include "main/renderbuffer.h" #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" diff --git a/src/mesa/drivers/dri/savage/savage_3d_reg.h b/src/mesa/drivers/dri/savage/savage_3d_reg.h index bc81d73296..45733cdf92 100644 --- a/src/mesa/drivers/dri/savage/savage_3d_reg.h +++ b/src/mesa/drivers/dri/savage/savage_3d_reg.h @@ -43,7 +43,7 @@ typedef union unsigned reserved : 4; unsigned ofs : 28; }ni; - u_int32_t ui; + uint32_t ui; } savageRegZPixelOffset; /* This reg exists only on Savage4. */ @@ -60,7 +60,7 @@ typedef union unsigned passZpassOp : 3; unsigned reserved : 3; }ni; - u_int32_t ui; + uint32_t ui; } savageRegStencilCtrl; /************************** @@ -85,7 +85,7 @@ typedef union unsigned palSize : 2; unsigned newPal : 1; }ni; - u_int32_t ui; + uint32_t ui; } savageRegTexDescr_s4; typedef union { @@ -102,7 +102,7 @@ typedef union unsigned reserved3 : 10; unsigned newPal : 1; }ni; - u_int32_t ui; + uint32_t ui; } savageRegTexDescr_s3d; /* The layout of this reg is the same on Savage4 and Savage3D, @@ -116,7 +116,7 @@ typedef union unsigned reserved : 1; unsigned addr : 29; }ni; - u_int32_t ui; + uint32_t ui; } savageRegTexAddr; /* The layout of this reg is the same on Savage4 and Savage3D. */ @@ -127,7 +127,7 @@ typedef union unsigned reserved : 3; unsigned addr : 29; }ni; - u_int32_t ui; + uint32_t ui; } savageRegTexPalAddr; /* The layout of this reg on Savage4 and Savage3D are very similar. */ @@ -138,7 +138,7 @@ typedef union unsigned xprClr0 : 16; unsigned xprClr1 : 16; /* this is reserved on Savage3D */ }ni; - u_int32_t ui; + uint32_t ui; } savageRegTexXprClr; /* transparency color in RGB565 format*/ /* The layout of this reg differs between Savage4 and Savage3D. @@ -164,7 +164,7 @@ typedef union unsigned alphaArg1Invert : 1; unsigned alphaArg2Invert : 1; }ni; - u_int32_t ui; + uint32_t ui; } savageRegTexCtrl_s4; typedef union { @@ -187,7 +187,7 @@ typedef union unsigned texXprEn : 1; unsigned reserved2 : 11; }ni; - u_int32_t ui; + uint32_t ui; } savageRegTexCtrl_s3d; /* This reg exists only on Savage4. */ @@ -218,7 +218,7 @@ typedef union unsigned colorDoDiffMul : 1; unsigned LeftShiftVal : 2; }ni; - u_int32_t ui; + uint32_t ui; } savageRegTexBlendCtrl; /* This reg exists only on Savage4. */ @@ -231,7 +231,7 @@ typedef union unsigned red : 8; unsigned alpha : 8; }ni; - u_int32_t ui; + uint32_t ui; } savageRegTexBlendColor; /******************************** @@ -247,7 +247,7 @@ typedef union unsigned widthInTile : 6; unsigned bitPerPixel : 1; }ni; - u_int32_t ui; + uint32_t ui; } savageRegTiledSurface; /******************************** @@ -264,7 +264,7 @@ typedef union unsigned scissorYStart : 12; unsigned alphaRefVal : 8; }ni; - u_int32_t ui; + uint32_t ui; } savageRegDrawCtrl0; /* This reg exists only on Savage4. */ @@ -281,7 +281,7 @@ typedef union unsigned alphaTestCmpFunc : 3; unsigned alphaTestEn : 1; }ni; - u_int32_t ui; + uint32_t ui; } savageRegDrawCtrl1; /* This reg exists only on Savage4. */ @@ -312,7 +312,7 @@ typedef union unsigned flushPdDestWrites : 1; unsigned flushPdZbufWrites : 1; }ni; - u_int32_t ui; + uint32_t ui; } savageRegDrawLocalCtrl; /* This reg exists only on Savage3D. */ @@ -342,7 +342,7 @@ typedef union */ unsigned interpMode : 1; }ni; - u_int32_t ui; + uint32_t ui; } savageRegDrawCtrl; #define SAVAGETBC_DECAL_S3D 0 @@ -364,7 +364,7 @@ typedef union unsigned scissorYStart : 11; unsigned reserved2 : 5; } ni; - u_int32_t ui; + uint32_t ui; } savageRegScissorsStart; /* This reg exists only on Savage3D. */ @@ -377,7 +377,7 @@ typedef union unsigned scissorYEnd : 11; unsigned reserved2 : 5; } ni; - u_int32_t ui; + uint32_t ui; } savageRegScissorsEnd; /******************************** @@ -396,7 +396,7 @@ typedef union unsigned reserved : 1; unsigned addr : 29; /*quad word aligned*/ }ni; - u_int32_t ui; + uint32_t ui; } savageRegVertBufAddr; /* I havn't found a Savage3D equivalent of this reg in the Utah-driver. @@ -411,7 +411,7 @@ typedef union unsigned reserved : 1; unsigned addr : 29; /*4-quad word aligned*/ }ni; - u_int32_t ui; + uint32_t ui; } savageRegDMABufAddr; /******************************** @@ -439,7 +439,7 @@ typedef union unsigned reserved : 17; unsigned kickOff : 1; }ni; - u_int32_t ui; + uint32_t ui; } savageRegFlag; /******************************** @@ -464,7 +464,7 @@ typedef union unsigned floatZEn : 1; unsigned wToZEn : 1; }ni; - u_int32_t ui; + uint32_t ui; } savageRegZBufCtrl_s4; typedef union { @@ -486,7 +486,7 @@ typedef union unsigned wrZafterAlphaTst : 1; unsigned reserved2 : 15; }ni; - u_int32_t ui; + uint32_t ui; } savageRegZBufCtrl_s3d; /* The layout of this reg on Savage4 and Savage3D is very similar. */ @@ -507,7 +507,7 @@ typedef union */ unsigned zDepthSelect : 1; }ni; - u_int32_t ui; + uint32_t ui; } savageRegZBufOffset; /* The layout of this reg is the same on Savage4 and Savage3D. */ @@ -524,7 +524,7 @@ typedef union unsigned wHigh : 6; unsigned reserved4 : 2; }ni; - u_int32_t ui; + uint32_t ui; } savageRegZWatermarks; /******************************** @@ -542,7 +542,7 @@ typedef union unsigned fogMode : 1; unsigned fogEndShift : 2; }ni; - u_int32_t ui; + uint32_t ui; } savageRegFogCtrl; /*not in spec, but tempo for pp and driver*/ @@ -553,7 +553,7 @@ typedef union unsigned fogDensity : 16; unsigned fogStart : 16; }ni; - u_int32_t ui; + uint32_t ui; } savageRegFogParam; /************************************** @@ -577,7 +577,7 @@ typedef union unsigned antiAliasMode : 2; unsigned dstPixFmt : 1; }ni; - u_int32_t ui; + uint32_t ui; } savageRegDestCtrl; /* The layout of this reg on Savage4 and Savage3D are very similar. */ @@ -596,7 +596,7 @@ typedef union * However, it is not used in either driver. */ unsigned destFlush : 2; }ni; - u_int32_t ui; + uint32_t ui; } savageRegDestTexWatermarks; /* Savage4/Twister/ProSavage register BCI addresses */ @@ -641,7 +641,7 @@ typedef union #define SAVAGE_FIRST_REG 0x18 #define SAVAGE_NR_REGS 34 typedef struct savage_registers_s4_t { - u_int32_t unused1[6]; /* 0x18-0x1d */ + uint32_t unused1[6]; /* 0x18-0x1d */ savageRegDrawLocalCtrl drawLocalCtrl; /* 0x1e */ savageRegTexPalAddr texPalAddr; /* 0x1f */ savageRegTexCtrl_s4 texCtrl[2]; /* 0x20, 0x21 */ @@ -649,7 +649,7 @@ typedef struct savage_registers_s4_t { savageRegTexBlendCtrl texBlendCtrl[2]; /* 0x24, 0x25 */ savageRegTexXprClr texXprClr; /* 0x26 */ savageRegTexDescr_s4 texDescr; /* 0x27 */ - u_int8_t fogTable[32]; /* 0x28-0x2f (8dwords) */ + uint8_t fogTable[32]; /* 0x28-0x2f (8dwords) */ savageRegFogCtrl fogCtrl; /* 0x30 */ savageRegStencilCtrl stencilCtrl; /* 0x31 */ savageRegZBufCtrl_s4 zBufCtrl; /* 0x32 */ @@ -667,8 +667,8 @@ typedef struct savage_registers_s3d_t { savageRegTexAddr texAddr; /* 0x1a */ savageRegTexDescr_s3d texDescr; /* 0x1b */ savageRegTexCtrl_s3d texCtrl; /* 0x1c */ - u_int32_t unused1[3]; /* 0x1d-0x1f */ - u_int8_t fogTable[64]; /* 0x20-0x2f (16dwords) */ + uint32_t unused1[3]; /* 0x1d-0x1f */ + uint8_t fogTable[64]; /* 0x20-0x2f (16dwords) */ savageRegFogCtrl fogCtrl; /* 0x30 */ savageRegDrawCtrl drawCtrl; /* 0x31 */ savageRegZBufCtrl_s3d zBufCtrl; /* 0x32 */ @@ -678,12 +678,12 @@ typedef struct savage_registers_s3d_t { savageRegScissorsEnd scissorsEnd; /* 0x36 */ savageRegZWatermarks zWatermarks; /* 0x37 */ savageRegDestTexWatermarks destTexWatermarks; /* 0x38 */ - u_int32_t unused2; /* 0x39 */ + uint32_t unused2; /* 0x39 */ } savageRegistersS3D; typedef union savage_registers_t { savageRegistersS4 s4; savageRegistersS3D s3d; - u_int32_t ui[SAVAGE_NR_REGS]; + uint32_t ui[SAVAGE_NR_REGS]; } savageRegisters; diff --git a/src/mesa/drivers/dri/savage/savage_init.h b/src/mesa/drivers/dri/savage/savage_init.h index 43fb969c69..abb8440fc4 100644 --- a/src/mesa/drivers/dri/savage/savage_init.h +++ b/src/mesa/drivers/dri/savage/savage_init.h @@ -28,7 +28,7 @@ #include <sys/time.h> #include "dri_util.h" -#include "mtypes.h" +#include "main/mtypes.h" #include "xmlconfig.h" diff --git a/src/mesa/drivers/dri/savage/savage_xmesa.c b/src/mesa/drivers/dri/savage/savage_xmesa.c index 6f1cbd6951..a344aab71b 100644 --- a/src/mesa/drivers/dri/savage/savage_xmesa.c +++ b/src/mesa/drivers/dri/savage/savage_xmesa.c @@ -26,16 +26,16 @@ #include <X11/Xlibint.h> #include <stdio.h> -#include "savagecontext.h" -#include "context.h" -#include "matrix.h" -#include "framebuffer.h" -#include "renderbuffer.h" -#include "simple_list.h" +#include "main/context.h" +#include "main/context.h" +#include "main/matrix.h" +#include "main/framebuffer.h" +#include "main/renderbuffer.h" +#include "main/simple_list.h" #include "utils.h" -#include "extensions.h" +#include "main/extensions.h" #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" @@ -457,7 +457,7 @@ savageCreateContext( const __GLcontextModes *mesaVis, imesa->clientVtxBuf.total = imesa->bufferSize / 4; imesa->clientVtxBuf.used = 0; imesa->clientVtxBuf.flushed = 0; - imesa->clientVtxBuf.buf = (u_int32_t *)malloc(imesa->bufferSize); + imesa->clientVtxBuf.buf = (uint32_t *)malloc(imesa->bufferSize); imesa->vtxBuf = &imesa->clientVtxBuf; @@ -912,8 +912,8 @@ savageFillInModes( __DRIscreenPrivate *psp, GLX_NONE, GLX_SWAP_UNDEFINED_OML /*, GLX_SWAP_COPY_OML */ }; - u_int8_t depth_bits_array[2]; - u_int8_t stencil_bits_array[2]; + uint8_t depth_bits_array[2]; + uint8_t stencil_bits_array[2]; depth_bits_array[0] = depth_bits; diff --git a/src/mesa/drivers/dri/savage/savagecontext.h b/src/mesa/drivers/dri/savage/savagecontext.h index c4573b0da4..fd6399d6a6 100644 --- a/src/mesa/drivers/dri/savage/savagecontext.h +++ b/src/mesa/drivers/dri/savage/savagecontext.h @@ -33,13 +33,13 @@ typedef struct savage_texture_object_t *savageTextureObjectPtr; #include <X11/Xlibint.h> #include "dri_util.h" -#include "mtypes.h" +#include "main/mtypes.h" #include "xf86drm.h" #include "drm.h" #include "savage_drm.h" #include "savage_init.h" #include "savage_3d_reg.h" -#include "mm.h" +#include "main/mm.h" #include "tnl/t_vertex.h" #include "texmem.h" @@ -130,7 +130,7 @@ typedef void (*savage_point_func)( savageContextPtr, savageVertex * ); struct savage_vtxbuf_t { GLuint total, used, flushed; /* in 32 bit units */ GLuint idx; /* for DMA buffers */ - u_int32_t *buf; + uint32_t *buf; }; struct savage_cmdbuf_t { diff --git a/src/mesa/drivers/dri/savage/savagedd.c b/src/mesa/drivers/dri/savage/savagedd.c index a5c5310e28..32ca86de8a 100644 --- a/src/mesa/drivers/dri/savage/savagedd.c +++ b/src/mesa/drivers/dri/savage/savagedd.c @@ -23,12 +23,12 @@ */ -#include "mtypes.h" -#include "framebuffer.h" +#include "main/mtypes.h" +#include "main/framebuffer.h" #include <stdio.h> -#include "mm.h" +#include "main/mm.h" #include "swrast/swrast.h" #include "savagedd.h" @@ -37,7 +37,7 @@ #include "savagetex.h" #include "savagetris.h" #include "savagecontext.h" -#include "extensions.h" +#include "main/extensions.h" #include "utils.h" diff --git a/src/mesa/drivers/dri/savage/savagedd.h b/src/mesa/drivers/dri/savage/savagedd.h index ae167be700..698a8d5de9 100644 --- a/src/mesa/drivers/dri/savage/savagedd.h +++ b/src/mesa/drivers/dri/savage/savagedd.h @@ -26,7 +26,7 @@ #ifndef SAVAGEDD_INC #define SAVAGEDD_INC -#include "context.h" +#include "main/context.h" void savageDDInitDriverFuncs( GLcontext *ctx ); #endif diff --git a/src/mesa/drivers/dri/savage/savageioctl.c b/src/mesa/drivers/dri/savage/savageioctl.c index 4eac1fb349..948ed18419 100644 --- a/src/mesa/drivers/dri/savage/savageioctl.c +++ b/src/mesa/drivers/dri/savage/savageioctl.c @@ -27,14 +27,14 @@ #include <unistd.h> #include <sys/mman.h> -#include "mtypes.h" -#include "macros.h" -#include "dd.h" -#include "context.h" +#include "main/mtypes.h" +#include "main/macros.h" +#include "main/dd.h" +#include "main/context.h" +#include "main/colormac.h" +#include "main/mm.h" #include "swrast/swrast.h" -#include "colormac.h" -#include "mm.h" #include "savagecontext.h" #include "savageioctl.h" #include "savage_bci.h" @@ -112,7 +112,7 @@ void savageGetDMABuffer( savageContextPtr imesa ) imesa->dmaVtxBuf.used = 0; imesa->dmaVtxBuf.flushed = 0; imesa->dmaVtxBuf.idx = buf->idx; - imesa->dmaVtxBuf.buf = (u_int32_t *)buf->address; + imesa->dmaVtxBuf.buf = (uint32_t *)buf->address; if (SAVAGE_DEBUG & DEBUG_DMA) fprintf(stderr, "finished getbuffer\n"); @@ -137,7 +137,7 @@ static void savage_BCI_clear(GLcontext *ctx, drm_savage_clear_t *pclear) unsigned int y = pbox->y1; unsigned int width = pbox->x2 - x; unsigned int height = pbox->y2 - y; - u_int32_t *bciptr; + uint32_t *bciptr; if (pbox->x1 > pbox->x2 || pbox->y1 > pbox->y2 || @@ -147,27 +147,27 @@ static void savage_BCI_clear(GLcontext *ctx, drm_savage_clear_t *pclear) if ( pclear->flags & SAVAGE_FRONT ) { bciptr = savageDMAAlloc (imesa, 8); - WRITE_CMD((bciptr) , 0x4BCC8C00,u_int32_t); - WRITE_CMD((bciptr) , imesa->savageScreen->frontOffset,u_int32_t); - WRITE_CMD((bciptr) , imesa->savageScreen->frontBitmapDesc,u_int32_t); - WRITE_CMD((bciptr) , pclear->clear_color,u_int32_t); - WRITE_CMD((bciptr) , (y <<16) | x,u_int32_t); - WRITE_CMD((bciptr) , (height << 16) | width,u_int32_t); + WRITE_CMD((bciptr) , 0x4BCC8C00,uint32_t); + WRITE_CMD((bciptr) , imesa->savageScreen->frontOffset,uint32_t); + WRITE_CMD((bciptr) , imesa->savageScreen->frontBitmapDesc,uint32_t); + WRITE_CMD((bciptr) , pclear->clear_color,uint32_t); + WRITE_CMD((bciptr) , (y <<16) | x,uint32_t); + WRITE_CMD((bciptr) , (height << 16) | width,uint32_t); savageDMACommit (imesa, bciptr); } if ( pclear->flags & SAVAGE_BACK ) { bciptr = savageDMAAlloc (imesa, 8); - WRITE_CMD((bciptr) , 0x4BCC8C00,u_int32_t); - WRITE_CMD((bciptr) , imesa->savageScreen->backOffset,u_int32_t); - WRITE_CMD((bciptr) , imesa->savageScreen->backBitmapDesc,u_int32_t); - WRITE_CMD((bciptr) , pclear->clear_color,u_int32_t); - WRITE_CMD((bciptr) , (y <<16) | x,u_int32_t); - WRITE_CMD((bciptr) , (height << 16) | width,u_int32_t); + WRITE_CMD((bciptr) , 0x4BCC8C00,uint32_t); + WRITE_CMD((bciptr) , imesa->savageScreen->backOffset,uint32_t); + WRITE_CMD((bciptr) , imesa->savageScreen->backBitmapDesc,uint32_t); + WRITE_CMD((bciptr) , pclear->clear_color,uint32_t); + WRITE_CMD((bciptr) , (y <<16) | x,uint32_t); + WRITE_CMD((bciptr) , (height << 16) | width,uint32_t); savageDMACommit (imesa, bciptr); } if ( pclear->flags & (SAVAGE_DEPTH |SAVAGE_STENCIL) ) { - u_int32_t writeMask = 0x0; + uint32_t writeMask = 0x0; if(imesa->hw_stencil) { if(pclear->flags & SAVAGE_STENCIL) @@ -199,8 +199,8 @@ static void savage_BCI_clear(GLcontext *ctx, drm_savage_clear_t *pclear) bciptr = savageDMAAlloc (imesa, 10); if(writeMask != 0xFFFFFFFF) { - WRITE_CMD((bciptr) , 0x960100D7,u_int32_t); - WRITE_CMD((bciptr) , writeMask,u_int32_t); + WRITE_CMD((bciptr) , 0x960100D7,uint32_t); + WRITE_CMD((bciptr) , writeMask,uint32_t); } } else @@ -208,18 +208,18 @@ static void savage_BCI_clear(GLcontext *ctx, drm_savage_clear_t *pclear) bciptr = savageDMAAlloc (imesa, 6); } - WRITE_CMD((bciptr) , 0x4BCC8C00,u_int32_t); - WRITE_CMD((bciptr) , imesa->savageScreen->depthOffset,u_int32_t); - WRITE_CMD((bciptr) , imesa->savageScreen->depthBitmapDesc,u_int32_t); - WRITE_CMD((bciptr) , pclear->clear_depth,u_int32_t); - WRITE_CMD((bciptr) , (y <<16) | x,u_int32_t); - WRITE_CMD((bciptr) , (height << 16) | width,u_int32_t); + WRITE_CMD((bciptr) , 0x4BCC8C00,uint32_t); + WRITE_CMD((bciptr) , imesa->savageScreen->depthOffset,uint32_t); + WRITE_CMD((bciptr) , imesa->savageScreen->depthBitmapDesc,uint32_t); + WRITE_CMD((bciptr) , pclear->clear_depth,uint32_t); + WRITE_CMD((bciptr) , (y <<16) | x,uint32_t); + WRITE_CMD((bciptr) , (height << 16) | width,uint32_t); if(imesa->hw_stencil) { if(writeMask != 0xFFFFFFFF) { - WRITE_CMD((bciptr) , 0x960100D7,u_int32_t); - WRITE_CMD((bciptr) , 0xFFFFFFFF,u_int32_t); + WRITE_CMD((bciptr) , 0x960100D7,uint32_t); + WRITE_CMD((bciptr) , 0xFFFFFFFF,uint32_t); } } savageDMACommit (imesa, bciptr); @@ -236,7 +236,7 @@ static void savage_BCI_swap(savageContextPtr imesa) int nbox = imesa->sarea->nbox; drm_clip_rect_t *pbox = imesa->sarea->boxes; int i; - volatile u_int32_t *bciptr; + volatile uint32_t *bciptr; if (nbox > SAVAGE_NR_SAREA_CLIPRECTS) nbox = SAVAGE_NR_SAREA_CLIPRECTS; diff --git a/src/mesa/drivers/dri/savage/savageioctl.h b/src/mesa/drivers/dri/savage/savageioctl.h index 50dce848a2..639605cc51 100644 --- a/src/mesa/drivers/dri/savage/savageioctl.h +++ b/src/mesa/drivers/dri/savage/savageioctl.h @@ -77,10 +77,10 @@ GLboolean savageHaveIndexedVerts( savageContextPtr imesa ) } static INLINE -u_int32_t *savageAllocVtxBuf( savageContextPtr imesa, GLuint words ) +uint32_t *savageAllocVtxBuf( savageContextPtr imesa, GLuint words ) { struct savage_vtxbuf_t *buffer = imesa->vtxBuf; - u_int32_t *head; + uint32_t *head; if (buffer == &imesa->dmaVtxBuf) { if (!buffer->total) { @@ -116,9 +116,9 @@ u_int32_t *savageAllocVtxBuf( savageContextPtr imesa, GLuint words ) } static INLINE -u_int32_t *savageAllocIndexedVerts( savageContextPtr imesa, GLuint n ) +uint32_t *savageAllocIndexedVerts( savageContextPtr imesa, GLuint n ) { - u_int32_t *ret; + uint32_t *ret; savageFlushVertices(imesa); ret = savageAllocVtxBuf(imesa, n*imesa->HwVertexSize); imesa->firstElt = imesa->vtxBuf->flushed / imesa->HwVertexSize; @@ -172,9 +172,9 @@ drm_savage_cmd_header_t *savageAllocCmdBuf( savageContextPtr imesa, GLuint bytes * - increments the number of elts. Final allocation is done in savageFlushElts */ static INLINE -u_int16_t *savageAllocElts( savageContextPtr imesa, GLuint n ) +uint16_t *savageAllocElts( savageContextPtr imesa, GLuint n ) { - u_int16_t *ret; + uint16_t *ret; GLuint qwords; assert (savageHaveIndexedVerts(imesa)); @@ -195,7 +195,7 @@ u_int16_t *savageAllocElts( savageContextPtr imesa, GLuint n ) imesa->elts.n = 0; } - ret = (u_int16_t *)(imesa->elts.cmd+1) + imesa->elts.n; + ret = (uint16_t *)(imesa->elts.cmd+1) + imesa->elts.n; imesa->elts.n += n; return ret; } diff --git a/src/mesa/drivers/dri/savage/savagerender.c b/src/mesa/drivers/dri/savage/savagerender.c index f2f19984b1..32c74f9467 100644 --- a/src/mesa/drivers/dri/savage/savagerender.c +++ b/src/mesa/drivers/dri/savage/savagerender.c @@ -27,11 +27,11 @@ * dma buffers. Use strip/fan hardware primitives where possible. * Simulate missing primitives with indexed vertices. */ -#include "glheader.h" -#include "context.h" -#include "macros.h" -#include "imports.h" -#include "mtypes.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/macros.h" +#include "main/imports.h" +#include "main/mtypes.h" #include "tnl/t_context.h" diff --git a/src/mesa/drivers/dri/savage/savagespan.c b/src/mesa/drivers/dri/savage/savagespan.c index 61ab9e6d64..9615e34013 100644 --- a/src/mesa/drivers/dri/savage/savagespan.c +++ b/src/mesa/drivers/dri/savage/savagespan.c @@ -22,7 +22,7 @@ * DEALINGS IN THE SOFTWARE. */ -#include "mtypes.h" +#include "main/mtypes.h" #include "savagedd.h" #include "savagespan.h" #include "savageioctl.h" @@ -93,6 +93,8 @@ /* 16 bit integer depthbuffer functions * Depth range is reversed. See also savageCalcViewport. */ +#define VALUE_TYPE GLushort + #define WRITE_DEPTH( _x, _y, d ) \ *(GLushort *)(buf + ((_x)<<1) + (_y)*pitch) = 0xFFFF - d @@ -107,6 +109,8 @@ /* 16 bit float depthbuffer functions */ +#define VALUE_TYPE GLushort + #define WRITE_DEPTH( _x, _y, d ) \ *(GLushort *)(buf + ((_x)<<1) + (_y)*pitch) = \ savageEncodeFloat16( 1.0 - (GLfloat)d/65535.0 ) @@ -125,6 +129,8 @@ /* 8-bit stencil /24-bit integer depth depthbuffer functions. * Depth range is reversed. See also savageCalcViewport. */ +#define VALUE_TYPE GLuint + #define WRITE_DEPTH( _x, _y, d ) do { \ GLuint tmp = *(GLuint *)(buf + ((_x)<<2) + (_y)*pitch); \ tmp &= 0xFF000000; \ @@ -143,6 +149,8 @@ /* 24 bit float depthbuffer functions */ +#define VALUE_TYPE GLuint + #define WRITE_DEPTH( _x, _y, d ) do { \ GLuint tmp = *(GLuint *)(buf + ((_x)<<2) + (_y)*pitch); \ tmp &= 0xFF000000; \ diff --git a/src/mesa/drivers/dri/savage/savagestate.c b/src/mesa/drivers/dri/savage/savagestate.c index c5ef47f258..73d85ed57b 100644 --- a/src/mesa/drivers/dri/savage/savagestate.c +++ b/src/mesa/drivers/dri/savage/savagestate.c @@ -25,12 +25,12 @@ #include <stdio.h> -#include "mtypes.h" -#include "enums.h" -#include "macros.h" -#include "dd.h" +#include "main/mtypes.h" +#include "main/enums.h" +#include "main/macros.h" +#include "main/dd.h" -#include "mm.h" +#include "main/mm.h" #include "savagedd.h" #include "savagecontext.h" @@ -122,9 +122,9 @@ static void savageDDBlendEquationSeparate(GLcontext *ctx, static void savageBlendFunc_s4(GLcontext *ctx) { savageContextPtr imesa = SAVAGE_CONTEXT(ctx); - u_int32_t drawLocalCtrl = imesa->regs.s4.drawLocalCtrl.ui; - u_int32_t drawCtrl0 = imesa->regs.s4.drawCtrl0.ui; - u_int32_t drawCtrl1 = imesa->regs.s4.drawCtrl1.ui; + uint32_t drawLocalCtrl = imesa->regs.s4.drawLocalCtrl.ui; + uint32_t drawCtrl0 = imesa->regs.s4.drawCtrl0.ui; + uint32_t drawCtrl1 = imesa->regs.s4.drawCtrl1.ui; /* set up draw control register (including blending, alpha * test, and shading model) @@ -297,8 +297,8 @@ static void savageBlendFunc_s4(GLcontext *ctx) static void savageBlendFunc_s3d(GLcontext *ctx) { savageContextPtr imesa = SAVAGE_CONTEXT(ctx); - u_int32_t drawCtrl = imesa->regs.s3d.drawCtrl.ui; - u_int32_t zBufCtrl = imesa->regs.s3d.zBufCtrl.ui; + uint32_t drawCtrl = imesa->regs.s3d.drawCtrl.ui; + uint32_t zBufCtrl = imesa->regs.s3d.zBufCtrl.ui; /* set up draw control register (including blending, alpha * test, dithering, and shading model) @@ -486,9 +486,9 @@ static void savageDDDepthFunc_s4(GLcontext *ctx, GLenum func) { savageContextPtr imesa = SAVAGE_CONTEXT(ctx); ZCmpFunc zmode; - u_int32_t drawLocalCtrl = imesa->regs.s4.drawLocalCtrl.ui; - u_int32_t zBufCtrl = imesa->regs.s4.zBufCtrl.ui; - u_int32_t zWatermarks = imesa->regs.s4.zWatermarks.ui; /* FIXME: in DRM */ + uint32_t drawLocalCtrl = imesa->regs.s4.drawLocalCtrl.ui; + uint32_t zBufCtrl = imesa->regs.s4.zBufCtrl.ui; + uint32_t zWatermarks = imesa->regs.s4.zWatermarks.ui; /* FIXME: in DRM */ /* set up z-buffer control register (global) * set up z-buffer offset register (global) @@ -550,9 +550,9 @@ static void savageDDDepthFunc_s3d(GLcontext *ctx, GLenum func) { savageContextPtr imesa = SAVAGE_CONTEXT(ctx); ZCmpFunc zmode; - u_int32_t drawCtrl = imesa->regs.s3d.drawCtrl.ui; - u_int32_t zBufCtrl = imesa->regs.s3d.zBufCtrl.ui; - u_int32_t zWatermarks = imesa->regs.s3d.zWatermarks.ui; /* FIXME: in DRM */ + uint32_t drawCtrl = imesa->regs.s3d.drawCtrl.ui; + uint32_t zBufCtrl = imesa->regs.s3d.zBufCtrl.ui; + uint32_t zWatermarks = imesa->regs.s3d.zWatermarks.ui; /* FIXME: in DRM */ /* set up z-buffer control register (global) * set up z-buffer offset register (global) @@ -638,7 +638,7 @@ static void savageDDScissor( GLcontext *ctx, GLint x, GLint y, static void savageDDDrawBuffer(GLcontext *ctx, GLenum mode ) { savageContextPtr imesa = SAVAGE_CONTEXT(ctx); - u_int32_t destCtrl = imesa->regs.s4.destCtrl.ui; + uint32_t destCtrl = imesa->regs.s4.destCtrl.ui; if (ctx->DrawBuffer->_NumColorDrawBuffers != 1) { FALLBACK( ctx, SAVAGE_FALLBACK_DRAW_BUFFER, GL_TRUE ); @@ -867,7 +867,7 @@ static void savageDDColorMask_s3d(GLcontext *ctx, static void savageUpdateSpecular_s4(GLcontext *ctx) { savageContextPtr imesa = SAVAGE_CONTEXT( ctx ); - u_int32_t drawLocalCtrl = imesa->regs.s4.drawLocalCtrl.ui; + uint32_t drawLocalCtrl = imesa->regs.s4.drawLocalCtrl.ui; if (NEED_SECONDARY_COLOR(ctx)) { imesa->regs.s4.drawLocalCtrl.ni.specShadeEn = GL_TRUE; @@ -881,7 +881,7 @@ static void savageUpdateSpecular_s4(GLcontext *ctx) { static void savageUpdateSpecular_s3d(GLcontext *ctx) { savageContextPtr imesa = SAVAGE_CONTEXT( ctx ); - u_int32_t drawCtrl = imesa->regs.s3d.drawCtrl.ui; + uint32_t drawCtrl = imesa->regs.s3d.drawCtrl.ui; if (NEED_SECONDARY_COLOR(ctx)) { imesa->regs.s3d.drawCtrl.ni.specShadeEn = GL_TRUE; @@ -907,7 +907,7 @@ static void savageDDLightModelfv_s3d(GLcontext *ctx, GLenum pname, static void savageDDShadeModel_s4(GLcontext *ctx, GLuint mod) { savageContextPtr imesa = SAVAGE_CONTEXT( ctx ); - u_int32_t drawLocalCtrl = imesa->regs.s4.drawLocalCtrl.ui; + uint32_t drawLocalCtrl = imesa->regs.s4.drawLocalCtrl.ui; if (mod == GL_SMOOTH) { @@ -924,7 +924,7 @@ static void savageDDShadeModel_s4(GLcontext *ctx, GLuint mod) static void savageDDShadeModel_s3d(GLcontext *ctx, GLuint mod) { savageContextPtr imesa = SAVAGE_CONTEXT( ctx ); - u_int32_t drawCtrl = imesa->regs.s3d.drawCtrl.ui; + uint32_t drawCtrl = imesa->regs.s3d.drawCtrl.ui; if (mod == GL_SMOOTH) { @@ -950,7 +950,7 @@ static void savageDDFogfv(GLcontext *ctx, GLenum pname, const GLfloat *param) { savageContextPtr imesa = SAVAGE_CONTEXT(ctx); GLuint fogClr; - u_int32_t fogCtrl = imesa->regs.s4.fogCtrl.ui; + uint32_t fogCtrl = imesa->regs.s4.fogCtrl.ui; /*if ((ctx->Fog.Enabled) &&(pname == GL_FOG_COLOR))*/ if (ctx->Fog.Enabled) @@ -982,8 +982,8 @@ savageDDStencilFuncSeparate(GLcontext *ctx, GLenum face, GLenum func, { savageContextPtr imesa = SAVAGE_CONTEXT(ctx); unsigned a=0; - const u_int32_t zBufCtrl = imesa->regs.s4.zBufCtrl.ui; - const u_int32_t stencilCtrl = imesa->regs.s4.stencilCtrl.ui; + const uint32_t zBufCtrl = imesa->regs.s4.zBufCtrl.ui; + const uint32_t stencilCtrl = imesa->regs.s4.stencilCtrl.ui; imesa->regs.s4.zBufCtrl.ni.stencilRefVal = ctx->Stencil.Ref[0] & 0xff; imesa->regs.s4.stencilCtrl.ni.readMask = ctx->Stencil.ValueMask[0] & 0xff; @@ -1043,7 +1043,7 @@ savageDDStencilOpSeparate(GLcontext *ctx, GLenum face, GLenum fail, GLenum zfail, GLenum zpass) { savageContextPtr imesa = SAVAGE_CONTEXT(ctx); - const u_int32_t stencilCtrl = imesa->regs.s4.stencilCtrl.ui; + const uint32_t stencilCtrl = imesa->regs.s4.stencilCtrl.ui; imesa->regs.s4.stencilCtrl.ni.failOp = get_stencil_op_value( ctx->Stencil.FailFunc[0] ); imesa->regs.s4.stencilCtrl.ni.passZfailOp = get_stencil_op_value( ctx->Stencil.ZFailFunc[0] ); @@ -1615,8 +1615,8 @@ static void savageDDInitState_s3d( savageContextPtr imesa ) imesa->globalRegMask.s3d.zBufCtrl.ni.zBufEn = 0x1; } void savageDDInitState( savageContextPtr imesa ) { - memset (imesa->regs.ui, 0, SAVAGE_NR_REGS*sizeof(u_int32_t)); - memset (imesa->globalRegMask.ui, 0xff, SAVAGE_NR_REGS*sizeof(u_int32_t)); + memset (imesa->regs.ui, 0, SAVAGE_NR_REGS*sizeof(uint32_t)); + memset (imesa->globalRegMask.ui, 0xff, SAVAGE_NR_REGS*sizeof(uint32_t)); if (imesa->savageScreen->chipset >= S3_SAVAGE4) savageDDInitState_s4 (imesa); else @@ -1658,7 +1658,7 @@ void savageDDInitState( savageContextPtr imesa ) { imesa->regs.s4.zBufOffset.ni.zDepthSelect = 1; } - memcpy (imesa->oldRegs.ui, imesa->regs.ui, SAVAGE_NR_REGS*sizeof(u_int32_t)); + memcpy (imesa->oldRegs.ui, imesa->regs.ui, SAVAGE_NR_REGS*sizeof(uint32_t)); /* Emit the initial state to the (empty) command buffer. */ assert (imesa->cmdBuf.write == imesa->cmdBuf.base); diff --git a/src/mesa/drivers/dri/savage/savagetex.c b/src/mesa/drivers/dri/savage/savagetex.c index 9b81756eb9..a3bebfa8cf 100644 --- a/src/mesa/drivers/dri/savage/savagetex.c +++ b/src/mesa/drivers/dri/savage/savagetex.c @@ -28,22 +28,21 @@ #include <GL/gl.h> -#include "mm.h" +#include "main/mm.h" #include "savagecontext.h" #include "savagetex.h" #include "savagetris.h" #include "savageioctl.h" -#include "simple_list.h" -#include "enums.h" +#include "main/simple_list.h" +#include "main/enums.h" #include "savage_bci.h" -#include "macros.h" -#include "texformat.h" -#include "texstore.h" -#include "texobj.h" - -#include "convolve.h" -#include "colormac.h" +#include "main/macros.h" +#include "main/texformat.h" +#include "main/texstore.h" +#include "main/texobj.h" +#include "main/convolve.h" +#include "main/colormac.h" #include "swrast/swrast.h" @@ -1365,7 +1364,7 @@ static void savageUpdateTex0State_s4( GLcontext *ctx ) if (imesa->regs.s4.texDescr.ni.tex1En) imesa->regs.s4.texDescr.ni.texBLoopEn = GL_TRUE; - imesa->regs.s4.texAddr[0].ui = (u_int32_t) t->setup.physAddr | 0x2; + imesa->regs.s4.texAddr[0].ui = (uint32_t) t->setup.physAddr | 0x2; if(t->base.heap->heapId == SAVAGE_AGP_HEAP) imesa->regs.s4.texAddr[0].ui |= 0x1; @@ -1550,7 +1549,7 @@ static void savageUpdateTex1State_s4( GLcontext *ctx ) imesa->regs.s4.texCtrl[1].ni.dMax = t->base.lastLevel - t->base.firstLevel; imesa->regs.s4.texDescr.ni.texBLoopEn = GL_TRUE; - imesa->regs.s4.texAddr[1].ui = (u_int32_t) t->setup.physAddr | 2; + imesa->regs.s4.texAddr[1].ui = (uint32_t) t->setup.physAddr | 2; if(t->base.heap->heapId == SAVAGE_AGP_HEAP) imesa->regs.s4.texAddr[1].ui |= 0x1; } @@ -1701,7 +1700,7 @@ static void savageUpdateTexState_s3d( GLcontext *ctx ) assert (t->hwFormat <= 7); imesa->regs.s3d.texDescr.ni.texFmt = t->hwFormat; - imesa->regs.s3d.texAddr.ui = (u_int32_t) t->setup.physAddr | 2; + imesa->regs.s3d.texAddr.ui = (uint32_t) t->setup.physAddr | 2; if(t->base.heap->heapId == SAVAGE_AGP_HEAP) imesa->regs.s3d.texAddr.ui |= 0x1; } diff --git a/src/mesa/drivers/dri/savage/savagetex.h b/src/mesa/drivers/dri/savage/savagetex.h index f1ee722414..e5f8a80f85 100644 --- a/src/mesa/drivers/dri/savage/savagetex.h +++ b/src/mesa/drivers/dri/savage/savagetex.h @@ -26,7 +26,7 @@ #ifndef SAVAGETEX_INC #define SAVAGETEX_INC -#include "mtypes.h" +#include "main/mtypes.h" #include "savagecontext.h" #include "texmem.h" diff --git a/src/mesa/drivers/dri/savage/savagetris.c b/src/mesa/drivers/dri/savage/savagetris.c index c67045c8b5..c04763b40e 100644 --- a/src/mesa/drivers/dri/savage/savagetris.c +++ b/src/mesa/drivers/dri/savage/savagetris.c @@ -1,4 +1,4 @@ -/* $XFree86$ */ /* -*- c-basic-offset: 3 -*- */ +/* -*- c-basic-offset: 3 -*- */ /************************************************************************** Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and @@ -37,10 +37,10 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include <stdio.h> #include <math.h> -#include "glheader.h" -#include "mtypes.h" -#include "colormac.h" -#include "macros.h" +#include "main/glheader.h" +#include "main/mtypes.h" +#include "main/colormac.h" +#include "main/macros.h" #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" @@ -100,7 +100,7 @@ static void INLINE savage_draw_triangle (savageContextPtr imesa, savageVertexPtr v1, savageVertexPtr v2) { GLuint vertsize = imesa->HwVertexSize; - u_int32_t *vb = savageAllocVtxBuf (imesa, 3*vertsize); + uint32_t *vb = savageAllocVtxBuf (imesa, 3*vertsize); GLuint j; EMIT_VERT (j, vb, vertsize, 0, v0); @@ -114,7 +114,7 @@ static void INLINE savage_draw_quad (savageContextPtr imesa, savageVertexPtr v2, savageVertexPtr v3) { GLuint vertsize = imesa->HwVertexSize; - u_int32_t *vb = savageAllocVtxBuf (imesa, 6*vertsize); + uint32_t *vb = savageAllocVtxBuf (imesa, 6*vertsize); GLuint j; EMIT_VERT (j, vb, vertsize, 0, v0); @@ -128,7 +128,7 @@ static void INLINE savage_draw_quad (savageContextPtr imesa, static INLINE void savage_draw_point (savageContextPtr imesa, savageVertexPtr tmp) { GLuint vertsize = imesa->HwVertexSize; - u_int32_t *vb = savageAllocVtxBuf (imesa, 6*vertsize); + uint32_t *vb = savageAllocVtxBuf (imesa, 6*vertsize); const GLfloat x = tmp->v.x; const GLfloat y = tmp->v.y; const GLfloat sz = 0.5 * CLAMP(imesa->glCtx->Point.Size, @@ -165,7 +165,7 @@ static INLINE void savage_draw_line (savageContextPtr imesa, savageVertexPtr v0, savageVertexPtr v1 ) { GLuint vertsize = imesa->HwVertexSize; - u_int32_t *vb = savageAllocVtxBuf (imesa, 6*vertsize); + uint32_t *vb = savageAllocVtxBuf (imesa, 6*vertsize); const GLfloat width = CLAMP(imesa->glCtx->Line.Width, imesa->glCtx->Const.MinLineWidth, imesa->glCtx->Const.MaxLineWidth); @@ -224,7 +224,7 @@ static void INLINE savage_ptex_tri (savageContextPtr imesa, savageVertexPtr v1, savageVertexPtr v2) { GLuint vertsize = imesa->HwVertexSize; - u_int32_t *vb = savageAllocVtxBuf (imesa, 3*vertsize); + uint32_t *vb = savageAllocVtxBuf (imesa, 3*vertsize); savageVertex tmp; GLuint j; @@ -237,7 +237,7 @@ static INLINE void savage_ptex_line (savageContextPtr imesa, savageVertexPtr v0, savageVertexPtr v1 ) { GLuint vertsize = imesa->HwVertexSize; - u_int32_t *vb = savageAllocVtxBuf (imesa, 6*vertsize); + uint32_t *vb = savageAllocVtxBuf (imesa, 6*vertsize); const GLfloat width = CLAMP(imesa->glCtx->Line.Width, imesa->glCtx->Const.MinLineWidth, imesa->glCtx->Const.MaxLineWidth); @@ -284,7 +284,7 @@ static INLINE void savage_ptex_line (savageContextPtr imesa, static INLINE void savage_ptex_point (savageContextPtr imesa, savageVertexPtr v0) { GLuint vertsize = imesa->HwVertexSize; - u_int32_t *vb = savageAllocVtxBuf (imesa, 6*vertsize); + uint32_t *vb = savageAllocVtxBuf (imesa, 6*vertsize); const GLfloat x = v0->v.x; const GLfloat y = v0->v.y; const GLfloat sz = 0.5 * CLAMP(imesa->glCtx->Point.Size, diff --git a/src/mesa/drivers/dri/savage/savagetris.h b/src/mesa/drivers/dri/savage/savagetris.h index 00803e7ff3..a2a9375ed5 100644 --- a/src/mesa/drivers/dri/savage/savagetris.h +++ b/src/mesa/drivers/dri/savage/savagetris.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_tris.h,v 1.4 2001/01/08 01:07:24 martin Exp $ */ /************************************************************************** Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and @@ -37,7 +36,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #ifndef __R128_TRIS_H__ #define __R128_TRIS_H__ -#include "mtypes.h" +#include "main/mtypes.h" extern void savageInitTriFuncs( GLcontext *ctx ); diff --git a/src/mesa/drivers/dri/sis/server/sis_common.h b/src/mesa/drivers/dri/sis/server/sis_common.h index cbddf0c737..bd9bab846f 100644 --- a/src/mesa/drivers/dri/sis/server/sis_common.h +++ b/src/mesa/drivers/dri/sis/server/sis_common.h @@ -1,4 +1,3 @@ -/* * $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_common.h,v 1.1 2003/08/29 08:52:12 twini Exp $ */ /* * Common header definitions for SiS 2D/3D/DRM suite * diff --git a/src/mesa/drivers/dri/sis/server/sis_dri.h b/src/mesa/drivers/dri/sis/server/sis_dri.h index a05662430e..f0171f3c0f 100644 --- a/src/mesa/drivers/dri/sis/server/sis_dri.h +++ b/src/mesa/drivers/dri/sis/server/sis_dri.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dri.h,v 1.9 2003/08/29 08:50:54 twini Exp $ */ /* modified from tdfx_dri.h */ diff --git a/src/mesa/drivers/dri/sis/sis6326_clear.c b/src/mesa/drivers/dri/sis/sis6326_clear.c index 48db19566c..d46ecc9cd2 100644 --- a/src/mesa/drivers/dri/sis/sis6326_clear.c +++ b/src/mesa/drivers/dri/sis/sis6326_clear.c @@ -32,7 +32,7 @@ #include "sis_reg.h" #include "swrast/swrast.h" -#include "macros.h" +#include "main/macros.h" static void sis_clear_front_buffer(GLcontext *ctx, GLenum mask, GLint x, GLint y, GLint width, GLint height); diff --git a/src/mesa/drivers/dri/sis/sis6326_state.c b/src/mesa/drivers/dri/sis/sis6326_state.c index e47e663c35..65d4c06466 100644 --- a/src/mesa/drivers/dri/sis/sis6326_state.c +++ b/src/mesa/drivers/dri/sis/sis6326_state.c @@ -33,9 +33,9 @@ #include "sis_tex.h" #include "sis_reg.h" -#include "context.h" -#include "enums.h" -#include "colormac.h" +#include "main/context.h" +#include "main/enums.h" +#include "main/colormac.h" #include "swrast/swrast.h" #include "vbo/vbo.h" #include "tnl/tnl.h" diff --git a/src/mesa/drivers/dri/sis/sis_alloc.c b/src/mesa/drivers/dri/sis/sis_alloc.c index b696eeb51a..4ca4052803 100644 --- a/src/mesa/drivers/dri/sis/sis_alloc.c +++ b/src/mesa/drivers/dri/sis/sis_alloc.c @@ -24,7 +24,6 @@ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ -/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_alloc.c,v 1.7 2001/01/08 01:07:29 martin Exp $ */ /* * Authors: diff --git a/src/mesa/drivers/dri/sis/sis_alloc.h b/src/mesa/drivers/dri/sis/sis_alloc.h index e76fc53fe2..eb784afad9 100644 --- a/src/mesa/drivers/dri/sis/sis_alloc.h +++ b/src/mesa/drivers/dri/sis/sis_alloc.h @@ -22,7 +22,6 @@ 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$ */ /* * Authors: diff --git a/src/mesa/drivers/dri/sis/sis_clear.c b/src/mesa/drivers/dri/sis/sis_clear.c index fb92d06c73..323383da62 100644 --- a/src/mesa/drivers/dri/sis/sis_clear.c +++ b/src/mesa/drivers/dri/sis/sis_clear.c @@ -24,7 +24,6 @@ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ -/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_clear.c,v 1.5 2000/09/26 15:56:48 tsi Exp $ */ /* * Authors: @@ -37,7 +36,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "sis_lock.h" #include "swrast/swrast.h" -#include "macros.h" +#include "main/macros.h" static GLbitfield sis_3D_Clear( GLcontext * ctx, GLbitfield mask, GLint x, GLint y, GLint width, diff --git a/src/mesa/drivers/dri/sis/sis_context.c b/src/mesa/drivers/dri/sis/sis_context.c index b21df0a61e..00d17da3ba 100644 --- a/src/mesa/drivers/dri/sis/sis_context.c +++ b/src/mesa/drivers/dri/sis/sis_context.c @@ -24,7 +24,6 @@ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ -/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_ctx.c,v 1.3 2000/09/26 15:56:48 tsi Exp $ */ /* * Authors: @@ -43,11 +42,11 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "sis_tris.h" #include "sis_alloc.h" -#include "imports.h" -#include "matrix.h" -#include "extensions.h" +#include "main/imports.h" +#include "main/matrix.h" +#include "main/extensions.h" #include "utils.h" -#include "framebuffer.h" +#include "main/framebuffer.h" #include "drivers/common/driverfuncs.h" diff --git a/src/mesa/drivers/dri/sis/sis_context.h b/src/mesa/drivers/dri/sis/sis_context.h index 5fc8267879..bc53cb5efa 100644 --- a/src/mesa/drivers/dri/sis/sis_context.h +++ b/src/mesa/drivers/dri/sis/sis_context.h @@ -24,7 +24,6 @@ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ -/* $XFree86$ */ /* * Authors: @@ -35,7 +34,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #ifndef _sis_ctx_h_ #define _sis_ctx_h_ -#include "context.h" +#include "main/context.h" #include "dri_util.h" #include "drm.h" #include "drm_sarea.h" diff --git a/src/mesa/drivers/dri/sis/sis_dd.c b/src/mesa/drivers/dri/sis/sis_dd.c index 8fc7896b87..bddc4a9285 100644 --- a/src/mesa/drivers/dri/sis/sis_dd.c +++ b/src/mesa/drivers/dri/sis/sis_dd.c @@ -24,7 +24,6 @@ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ -/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_ctx.c,v 1.3 2000/09/26 15:56:48 tsi Exp $ */ /* * Authors: @@ -42,8 +41,8 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "sis_tris.h" #include "swrast/swrast.h" -#include "framebuffer.h" -#include "renderbuffer.h" +#include "main/framebuffer.h" +#include "main/renderbuffer.h" #include "utils.h" diff --git a/src/mesa/drivers/dri/sis/sis_dd.h b/src/mesa/drivers/dri/sis/sis_dd.h index da76596e92..b141243a59 100644 --- a/src/mesa/drivers/dri/sis/sis_dd.h +++ b/src/mesa/drivers/dri/sis/sis_dd.h @@ -22,7 +22,6 @@ 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$ */ /* * Authors: diff --git a/src/mesa/drivers/dri/sis/sis_fog.c b/src/mesa/drivers/dri/sis/sis_fog.c index fe9a3c95d6..517d5722e6 100644 --- a/src/mesa/drivers/dri/sis/sis_fog.c +++ b/src/mesa/drivers/dri/sis/sis_fog.c @@ -24,7 +24,6 @@ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ -/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_fog.c,v 1.3 2000/09/26 15:56:48 tsi Exp $ */ /* * Authors: @@ -36,7 +35,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "sis_state.h" #include "swrast/swrast.h" -#include "macros.h" +#include "main/macros.h" static GLint convertFtToFogFt( GLfloat dwInValue ); static GLint doFPtoFixedNoRound( GLfloat dwInValue, int nFraction ); diff --git a/src/mesa/drivers/dri/sis/sis_lock.c b/src/mesa/drivers/dri/sis/sis_lock.c index 70ca8e6cbc..806110cad4 100644 --- a/src/mesa/drivers/dri/sis/sis_lock.c +++ b/src/mesa/drivers/dri/sis/sis_lock.c @@ -1,4 +1,3 @@ -/* $XFree86$ */ /************************************************************************** Copyright 2003 Eric Anholt @@ -29,7 +28,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * Eric Anholt <anholt@FreeBSD.org> */ -#include "context.h" +#include "main/context.h" #include "sis_context.h" #include "sis_lock.h" #include "sis_dd.h" diff --git a/src/mesa/drivers/dri/sis/sis_lock.h b/src/mesa/drivers/dri/sis/sis_lock.h index fef9931963..54844e9b09 100644 --- a/src/mesa/drivers/dri/sis/sis_lock.h +++ b/src/mesa/drivers/dri/sis/sis_lock.h @@ -24,7 +24,6 @@ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ -/* $XFree86$ */ /* * Authors: diff --git a/src/mesa/drivers/dri/sis/sis_reg.h b/src/mesa/drivers/dri/sis/sis_reg.h index 78c6660181..e40c4371bf 100644 --- a/src/mesa/drivers/dri/sis/sis_reg.h +++ b/src/mesa/drivers/dri/sis/sis_reg.h @@ -25,7 +25,6 @@ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ -/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_reg.h,v 1.3 2000/09/26 15:56:48 tsi Exp $ */ /* * Authors: diff --git a/src/mesa/drivers/dri/sis/sis_screen.c b/src/mesa/drivers/dri/sis/sis_screen.c index bf0b1ce276..b1a5d15236 100644 --- a/src/mesa/drivers/dri/sis/sis_screen.c +++ b/src/mesa/drivers/dri/sis/sis_screen.c @@ -1,4 +1,3 @@ -/* $XFree86$ */ /************************************************************************** Copyright 2003 Eric Anholt @@ -31,11 +30,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "dri_util.h" -#include "context.h" +#include "main/context.h" #include "utils.h" -#include "imports.h" -#include "framebuffer.h" -#include "renderbuffer.h" +#include "main/imports.h" +#include "main/framebuffer.h" +#include "main/renderbuffer.h" #include "sis_context.h" #include "sis_dri.h" @@ -76,8 +75,8 @@ sisFillInModes(__DRIscreenPrivate *psp, int bpp) static const GLenum back_buffer_modes[] = { GLX_NONE, GLX_SWAP_UNDEFINED_OML }; - u_int8_t depth_bits_array[4]; - u_int8_t stencil_bits_array[4]; + uint8_t depth_bits_array[4]; + uint8_t stencil_bits_array[4]; depth_bits_array[0] = 0; stencil_bits_array[0] = 0; diff --git a/src/mesa/drivers/dri/sis/sis_screen.h b/src/mesa/drivers/dri/sis/sis_screen.h index d5b2101e98..07c29cfa09 100644 --- a/src/mesa/drivers/dri/sis/sis_screen.h +++ b/src/mesa/drivers/dri/sis/sis_screen.h @@ -22,7 +22,6 @@ 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$ */ /* * Authors: diff --git a/src/mesa/drivers/dri/sis/sis_span.c b/src/mesa/drivers/dri/sis/sis_span.c index ea6db6781d..9e9a509755 100644 --- a/src/mesa/drivers/dri/sis/sis_span.c +++ b/src/mesa/drivers/dri/sis/sis_span.c @@ -24,7 +24,6 @@ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ -/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_span.c,v 1.5 2001/03/21 16:14:26 dawes Exp $ */ /* * Authors: @@ -85,6 +84,8 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. /* 16 bit depthbuffer functions. */ +#define VALUE_TYPE GLushort + #define WRITE_DEPTH( _x, _y, d ) \ *(GLushort *)(buf + (_x)*2 + (_y)*srb->pitch) = d; @@ -97,6 +98,8 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. /* 32 bit depthbuffer functions. */ +#define VALUE_TYPE GLuint + #define WRITE_DEPTH( _x, _y, d ) \ *(GLuint *)(buf + (_x)*4 + (_y)*srb->pitch) = d; @@ -109,6 +112,8 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. /* 8/24 bit interleaved depth/stencil functions */ +#define VALUE_TYPE GLuint + #define WRITE_DEPTH( _x, _y, d ) { \ GLuint tmp = *(GLuint *)(buf + (_x)*4 + (_y)*srb->pitch); \ tmp &= 0xff000000; \ diff --git a/src/mesa/drivers/dri/sis/sis_span.h b/src/mesa/drivers/dri/sis/sis_span.h index 4b0add2ac2..a1f817c44c 100644 --- a/src/mesa/drivers/dri/sis/sis_span.h +++ b/src/mesa/drivers/dri/sis/sis_span.h @@ -22,7 +22,6 @@ 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$ */ /* * Authors: diff --git a/src/mesa/drivers/dri/sis/sis_state.c b/src/mesa/drivers/dri/sis/sis_state.c index b7454d4a07..98e8d02fab 100644 --- a/src/mesa/drivers/dri/sis/sis_state.c +++ b/src/mesa/drivers/dri/sis/sis_state.c @@ -24,7 +24,6 @@ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ -/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_ctx.c,v 1.3 2000/09/26 15:56:48 tsi Exp $ */ /* * Authors: @@ -38,9 +37,9 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "sis_lock.h" #include "sis_tex.h" -#include "context.h" -#include "enums.h" -#include "colormac.h" +#include "main/context.h" +#include "main/enums.h" +#include "main/colormac.h" #include "swrast/swrast.h" #include "vbo/vbo.h" #include "tnl/tnl.h" diff --git a/src/mesa/drivers/dri/sis/sis_state.h b/src/mesa/drivers/dri/sis/sis_state.h index 8f7e2acb92..2d0ea9c5fb 100644 --- a/src/mesa/drivers/dri/sis/sis_state.h +++ b/src/mesa/drivers/dri/sis/sis_state.h @@ -22,7 +22,6 @@ 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$ */ /* * Authors: diff --git a/src/mesa/drivers/dri/sis/sis_stencil.c b/src/mesa/drivers/dri/sis/sis_stencil.c index a1ce2966e8..55c0440eba 100644 --- a/src/mesa/drivers/dri/sis/sis_stencil.c +++ b/src/mesa/drivers/dri/sis/sis_stencil.c @@ -24,7 +24,6 @@ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ -/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_stencil.c,v 1.3 2000/09/26 15:56:49 tsi Exp $ */ /* * Authors: diff --git a/src/mesa/drivers/dri/sis/sis_stencil.h b/src/mesa/drivers/dri/sis/sis_stencil.h index 4a36c98f3d..6b556c4378 100644 --- a/src/mesa/drivers/dri/sis/sis_stencil.h +++ b/src/mesa/drivers/dri/sis/sis_stencil.h @@ -22,7 +22,6 @@ 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$ */ /* * Authors: diff --git a/src/mesa/drivers/dri/sis/sis_tex.c b/src/mesa/drivers/dri/sis/sis_tex.c index 8fd7b26ba5..28ced6cfd5 100644 --- a/src/mesa/drivers/dri/sis/sis_tex.c +++ b/src/mesa/drivers/dri/sis/sis_tex.c @@ -22,7 +22,6 @@ 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$ */ /* * Authors: @@ -34,11 +33,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "sis_tex.h" #include "swrast/swrast.h" -#include "imports.h" -#include "texformat.h" -#include "texstore.h" -#include "teximage.h" -#include "texobj.h" +#include "main/imports.h" +#include "main/texformat.h" +#include "main/texstore.h" +#include "main/teximage.h" +#include "main/texobj.h" #include "xmlpool.h" diff --git a/src/mesa/drivers/dri/sis/sis_tex.h b/src/mesa/drivers/dri/sis/sis_tex.h index 8ddc7c469e..c499e80e86 100644 --- a/src/mesa/drivers/dri/sis/sis_tex.h +++ b/src/mesa/drivers/dri/sis/sis_tex.h @@ -22,7 +22,6 @@ 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$ */ /* * Authors: diff --git a/src/mesa/drivers/dri/sis/sis_texstate.c b/src/mesa/drivers/dri/sis/sis_texstate.c index 7ef20f880c..63f23fc014 100644 --- a/src/mesa/drivers/dri/sis/sis_texstate.c +++ b/src/mesa/drivers/dri/sis/sis_texstate.c @@ -24,7 +24,6 @@ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ -/* $XFree86$ */ /* * Authors: @@ -32,12 +31,12 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. * Eric Anholt <anholt@FreeBSD.org> */ -#include "glheader.h" -#include "imports.h" -#include "colormac.h" -#include "context.h" -#include "macros.h" -#include "texformat.h" +#include "main/glheader.h" +#include "main/imports.h" +#include "main/colormac.h" +#include "main/context.h" +#include "main/macros.h" +#include "main/texformat.h" #include "sis_context.h" #include "sis_state.h" diff --git a/src/mesa/drivers/dri/sis/sis_tris.c b/src/mesa/drivers/dri/sis/sis_tris.c index adbbb8ae13..095941aea2 100644 --- a/src/mesa/drivers/dri/sis/sis_tris.c +++ b/src/mesa/drivers/dri/sis/sis_tris.c @@ -32,10 +32,10 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. * Eric Anholt <anholt@FreeBSD.org> */ -#include "glheader.h" -#include "mtypes.h" -#include "colormac.h" -#include "macros.h" +#include "main/glheader.h" +#include "main/mtypes.h" +#include "main/colormac.h" +#include "main/macros.h" #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" diff --git a/src/mesa/drivers/dri/sis/sis_tris.h b/src/mesa/drivers/dri/sis/sis_tris.h index 250949a83c..b34fe8c7c9 100644 --- a/src/mesa/drivers/dri/sis/sis_tris.h +++ b/src/mesa/drivers/dri/sis/sis_tris.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_tris.h,v 1.8 2002/10/30 12:51:43 alanh Exp $ */ /************************************************************************** Copyright 2003 Eric Anholt @@ -33,7 +32,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define __SIS_TRIS_H__ #include "sis_lock.h" -#include "mtypes.h" +#include "main/mtypes.h" extern void sisInitTriFuncs( GLcontext *ctx ); extern void sisFlushPrims( sisContextPtr smesa ); diff --git a/src/mesa/drivers/dri/swrast/swrast.c b/src/mesa/drivers/dri/swrast/swrast.c index 304d07729e..49f1b8b9ee 100644 --- a/src/mesa/drivers/dri/swrast/swrast.c +++ b/src/mesa/drivers/dri/swrast/swrast.c @@ -31,11 +31,11 @@ * The back-buffer is allocated by the driver and is private. */ -#include "context.h" -#include "extensions.h" -#include "framebuffer.h" -#include "imports.h" -#include "renderbuffer.h" +#include "main/context.h" +#include "main/extensions.h" +#include "main/framebuffer.h" +#include "main/imports.h" +#include "main/renderbuffer.h" #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" #include "tnl/tnl.h" @@ -143,8 +143,8 @@ swrastFillInModes(__DRIscreen *psp, GLX_NONE, GLX_SWAP_UNDEFINED_OML }; - u_int8_t depth_bits_array[4]; - u_int8_t stencil_bits_array[4]; + uint8_t depth_bits_array[4]; + uint8_t stencil_bits_array[4]; depth_bits_array[0] = 0; depth_bits_array[1] = 0; diff --git a/src/mesa/drivers/dri/swrast/swrast_priv.h b/src/mesa/drivers/dri/swrast/swrast_priv.h index a614823aa0..a707ffc40a 100644 --- a/src/mesa/drivers/dri/swrast/swrast_priv.h +++ b/src/mesa/drivers/dri/swrast/swrast_priv.h @@ -33,7 +33,7 @@ #include <GL/gl.h> #include <GL/internal/dri_interface.h> -#include "mtypes.h" +#include "main/mtypes.h" /** diff --git a/src/mesa/drivers/dri/swrast/swrast_spantemp.h b/src/mesa/drivers/dri/swrast/swrast_spantemp.h index 187a240ea2..e0cb241429 100644 --- a/src/mesa/drivers/dri/swrast/swrast_spantemp.h +++ b/src/mesa/drivers/dri/swrast/swrast_spantemp.h @@ -110,7 +110,7 @@ GET_ROW( GLcontext *glCtx, GLint x, GLint y, GLuint n, char *row ) * ignored otherwise. */ -#include "macros.h" +#include "main/macros.h" #ifdef CI_MODE diff --git a/src/mesa/drivers/dri/tdfx/X86/fx_3dnow_fastpath.S b/src/mesa/drivers/dri/tdfx/X86/fx_3dnow_fastpath.S index 0f4cc45089..500c97c536 100644 --- a/src/mesa/drivers/dri/tdfx/X86/fx_3dnow_fastpath.S +++ b/src/mesa/drivers/dri/tdfx/X86/fx_3dnow_fastpath.S @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/X86/fx_3dnow_fastpath.S,v 1.2 2000/09/26 15:56:51 tsi Exp $ */ #include "../../X86/assyntax.h" diff --git a/src/mesa/drivers/dri/tdfx/X86/fx_3dnow_fasttmp.h b/src/mesa/drivers/dri/tdfx/X86/fx_3dnow_fasttmp.h index 9ec4935d78..78c5fef746 100644 --- a/src/mesa/drivers/dri/tdfx/X86/fx_3dnow_fasttmp.h +++ b/src/mesa/drivers/dri/tdfx/X86/fx_3dnow_fasttmp.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/X86/fx_3dnow_fasttmp.h,v 1.2 2000/09/26 15:56:51 tsi Exp $ */ #if !defined(NASM_ASSEMBLER) && !defined(MASM_ASSEMBLER) #define TAGLLBL(a) TAG(.L##a) diff --git a/src/mesa/drivers/dri/tdfx/dri_glide.h b/src/mesa/drivers/dri/tdfx/dri_glide.h index 52a53f7dd3..3ad2bf68c6 100644 --- a/src/mesa/drivers/dri/tdfx/dri_glide.h +++ b/src/mesa/drivers/dri/tdfx/dri_glide.h @@ -23,7 +23,6 @@ * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/dri_glide.h,v 1.1 2001/03/21 16:14:26 dawes Exp $ */ /* * Original rewrite: diff --git a/src/mesa/drivers/dri/tdfx/server/tdfx_dri.h b/src/mesa/drivers/dri/tdfx/server/tdfx_dri.h index acd0b9ae5b..dc29984a27 100644 --- a/src/mesa/drivers/dri/tdfx/server/tdfx_dri.h +++ b/src/mesa/drivers/dri/tdfx/server/tdfx_dri.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_dri.h,v 1.5 2001/03/21 17:02:26 dawes Exp $ */ #ifndef _TDFX_DRI_ #define _TDFX_DRI_ diff --git a/src/mesa/drivers/dri/tdfx/tdfx_context.c b/src/mesa/drivers/dri/tdfx/tdfx_context.c index b4eea2566f..ef688d103d 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_context.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_context.c @@ -43,9 +43,9 @@ #include "tdfx_render.h" #include "tdfx_span.h" #include "tdfx_texman.h" -#include "extensions.h" -#include "hash.h" -#include "texobj.h" +#include "main/extensions.h" +#include "main/hash.h" +#include "main/texobj.h" #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" diff --git a/src/mesa/drivers/dri/tdfx/tdfx_context.h b/src/mesa/drivers/dri/tdfx/tdfx_context.h index dc8ece5939..3bcb545119 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_context.h +++ b/src/mesa/drivers/dri/tdfx/tdfx_context.h @@ -23,7 +23,6 @@ * 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.h,v 1.5 2002/02/24 21:51:10 dawes Exp $ */ /* * New fixes: @@ -45,7 +44,7 @@ #ifdef XFree86Server #include "GL/xf86glx.h" #else -#include "glheader.h" +#include "main/glheader.h" #endif #if defined(__linux__) #include <signal.h> @@ -56,12 +55,12 @@ #include "tdfx_glide.h" #include "xmlconfig.h" -#include "clip.h" -#include "context.h" -#include "macros.h" -#include "matrix.h" -#include "imports.h" -#include "mtypes.h" +#include "main/clip.h" +#include "main/context.h" +#include "main/macros.h" +#include "main/matrix.h" +#include "main/imports.h" +#include "main/mtypes.h" #include "tdfx_screen.h" diff --git a/src/mesa/drivers/dri/tdfx/tdfx_dd.c b/src/mesa/drivers/dri/tdfx/tdfx_dd.c index adbe0c0f33..2cef079515 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_dd.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_dd.c @@ -39,9 +39,9 @@ #include "tdfx_pixels.h" #include "utils.h" -#include "context.h" -#include "enums.h" -#include "framebuffer.h" +#include "main/context.h" +#include "main/enums.h" +#include "main/framebuffer.h" #include "swrast/swrast.h" #if defined(USE_X86_ASM) #include "x86/common_x86_asm.h" diff --git a/src/mesa/drivers/dri/tdfx/tdfx_dd.h b/src/mesa/drivers/dri/tdfx/tdfx_dd.h index 5ceba9d5f0..f419c8426a 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_dd.h +++ b/src/mesa/drivers/dri/tdfx/tdfx_dd.h @@ -23,7 +23,6 @@ * 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.h,v 1.1 2001/03/21 16:14:27 dawes Exp $ */ /* * Original rewrite: @@ -37,7 +36,7 @@ #ifndef __TDFX_DD_H__ #define __TDFX_DD_H__ -#include "context.h" +#include "main/context.h" extern void tdfxDDInitDriverFuncs( const __GLcontextModes *visual, struct dd_function_table *functions ); diff --git a/src/mesa/drivers/dri/tdfx/tdfx_glide.h b/src/mesa/drivers/dri/tdfx/tdfx_glide.h index f077aa678b..69e5399e72 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_glide.h +++ b/src/mesa/drivers/dri/tdfx/tdfx_glide.h @@ -2,7 +2,6 @@ * This file defines macros and types necessary for accessing glide3. */ -/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_glide.h,v 1.1 2002/02/22 21:45:03 dawes Exp $ */ #ifndef NEWGLIDE_H #define NEWGLIDE_H diff --git a/src/mesa/drivers/dri/tdfx/tdfx_lock.c b/src/mesa/drivers/dri/tdfx/tdfx_lock.c index a20c91d030..17cdc51ee1 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_lock.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_lock.c @@ -23,7 +23,6 @@ * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_lock.c,v 1.5 2002/12/16 16:19:00 dawes Exp $ */ /* * Original rewrite: diff --git a/src/mesa/drivers/dri/tdfx/tdfx_lock.h b/src/mesa/drivers/dri/tdfx/tdfx_lock.h index 616e65b2a1..74e3f5c9cc 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_lock.h +++ b/src/mesa/drivers/dri/tdfx/tdfx_lock.h @@ -23,7 +23,6 @@ * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_lock.h,v 1.3 2002/02/22 21:45:03 dawes Exp $ */ /* * Original rewrite: diff --git a/src/mesa/drivers/dri/tdfx/tdfx_pixels.c b/src/mesa/drivers/dri/tdfx/tdfx_pixels.c index 732270b2bd..9ab9c05f2b 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_pixels.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_pixels.c @@ -23,7 +23,6 @@ * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_pixels.c,v 1.4 2002/02/22 21:45:03 dawes Exp $ */ /* * Original rewrite: @@ -45,7 +44,7 @@ #include "swrast/swrast.h" -#include "image.h" +#include "main/image.h" #define FX_grLfbWriteRegion(fxMesa,dst_buffer,dst_x,dst_y,src_format,src_width,src_height,src_stride,src_data) \ diff --git a/src/mesa/drivers/dri/tdfx/tdfx_pixels.h b/src/mesa/drivers/dri/tdfx/tdfx_pixels.h index c38ce070ca..f5e5427653 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_pixels.h +++ b/src/mesa/drivers/dri/tdfx/tdfx_pixels.h @@ -23,7 +23,6 @@ * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_pixels.h,v 1.2 2002/02/22 21:45:03 dawes Exp $ */ /* * Original rewrite: @@ -39,7 +38,7 @@ #ifndef __TDFX_PIXELS_H__ #define __TDFX_PIXELS_H__ -#include "context.h" +#include "main/context.h" extern void tdfx_bitmap_R5G6B5( GLcontext *ctx, GLint px, GLint py, diff --git a/src/mesa/drivers/dri/tdfx/tdfx_render.c b/src/mesa/drivers/dri/tdfx/tdfx_render.c index 7b3ce36d1b..cf840c57a7 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_render.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_render.c @@ -23,7 +23,6 @@ * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_render.c,v 1.4 2002/02/22 21:45:03 dawes Exp $ */ /* * New fixes: diff --git a/src/mesa/drivers/dri/tdfx/tdfx_render.h b/src/mesa/drivers/dri/tdfx/tdfx_render.h index 09d0d90197..18c6168333 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_render.h +++ b/src/mesa/drivers/dri/tdfx/tdfx_render.h @@ -23,7 +23,6 @@ * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_render.h,v 1.1 2001/03/21 16:14:28 dawes Exp $ */ /* * Original rewrite: diff --git a/src/mesa/drivers/dri/tdfx/tdfx_screen.c b/src/mesa/drivers/dri/tdfx/tdfx_screen.c index fd21d8d51b..cd22b84951 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_screen.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_screen.c @@ -23,7 +23,6 @@ * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_screen.c,v 1.3 2002/02/22 21:45:03 dawes Exp $ */ /* * Original rewrite: @@ -41,8 +40,8 @@ #include "tdfx_span.h" #include "tdfx_tris.h" -#include "framebuffer.h" -#include "renderbuffer.h" +#include "main/framebuffer.h" +#include "main/renderbuffer.h" #include "xmlpool.h" #include "utils.h" @@ -65,6 +64,7 @@ DRI_CONF_END; static const __DRIextension *tdfxExtensions[] = { &driReadDrawableExtension, + NULL }; static const GLuint __driNConfigOptions = 1; @@ -350,12 +350,7 @@ tdfxFillInModes(__DRIscreenPrivate *psp, unsigned stencil_bits, GLboolean have_back_buffer) { - __DRIconfig **configs, **c; - __GLcontextModes *m; - unsigned num_modes; - unsigned vis[2] = { GLX_TRUE_COLOR, GLX_DIRECT_COLOR }; unsigned deep = (depth_bits > 17); - unsigned i, db, depth, accum, stencil; /* Right now GLX_SWAP_COPY_OML isn't supported, but it would be easy * enough to add support. Basically, if a context is created with an @@ -363,55 +358,32 @@ tdfxFillInModes(__DRIscreenPrivate *psp, * will never be used. */ - num_modes = (depth_bits == 16) ? 32 : 16; - - configs = _mesa_malloc(num_modes * sizeof *configs); - c = configs; - - for (i = 0; i <= 1; i++) { - for (db = 0; db <= 1; db++) { - for (depth = 0; depth <= 1; depth++) { - for (accum = 0; accum <= 1; accum++) { - for (stencil = 0; stencil <= !deep; stencil++) { - *c = _mesa_malloc(sizeof **c); - m = &(*c++)->modes; - if (deep) stencil = depth; - m->redBits = deep ? 8 : 5; - m->greenBits = deep ? 8 : 6; - m->blueBits = deep ? 8 : 5; - m->alphaBits = deep ? 8 : 0; - m->redMask = deep ?0xFF000000 :0x0000F800; - m->greenMask = deep ?0x00FF0000 :0x000007E0; - m->blueMask = deep ?0x0000FF00 :0x0000001F; - m->alphaMask = deep ? 0x000000FF : 0; - m->rgbBits = m->redBits + m->greenBits + - m->blueBits + m->alphaBits; - m->accumRedBits = accum ? 16 : 0; - m->accumGreenBits = accum ? 16 : 0; - m->accumBlueBits = accum ? 16 : 0; - m->accumAlphaBits = (accum && deep) ? 16 : 0; - m->stencilBits = stencil ? 8 : 0; - m->depthBits = deep - ? (depth ? 24 : 0) - : (depth ? 0 : depth_bits); - m->visualType = vis[i]; - m->renderType = GLX_RGBA_BIT; - m->drawableType = GLX_WINDOW_BIT; - m->rgbMode = GL_TRUE; - m->doubleBufferMode = db ? GL_TRUE : GL_FALSE; - if (db) - m->swapMethod = GLX_SWAP_UNDEFINED_OML; - m->visualRating = ((stencil && !deep) || accum) - ? GLX_SLOW_CONFIG - : GLX_NONE; - if (deep) stencil = 0; - } - } - } - } + static const GLenum db_modes[2] = { GLX_NONE, GLX_SWAP_UNDEFINED_OML }; + uint8_t depth_bits_array[4]; + uint8_t stencil_bits_array[4]; + if(deep) { + depth_bits_array[0] = 0; + depth_bits_array[1] = 24; + stencil_bits_array[0] = 0; + stencil_bits_array[1] = 8; + } else { + depth_bits_array[0] = depth_bits; + depth_bits_array[1] = 0; + depth_bits_array[2] = depth_bits; + depth_bits_array[3] = 0; + stencil_bits_array[0] = 0; + stencil_bits_array[1] = 0; + stencil_bits_array[2] = 8; + stencil_bits_array[3] = 8; } - return (const __DRIconfig **) configs; + return driCreateConfigs( + deep ? GL_RGBA : GL_RGB, + deep ? GL_UNSIGNED_INT_8_8_8_8 : GL_UNSIGNED_SHORT_5_6_5, + depth_bits_array, + stencil_bits_array, + deep ? 2 : 4, + db_modes, 2); } /** diff --git a/src/mesa/drivers/dri/tdfx/tdfx_screen.h b/src/mesa/drivers/dri/tdfx/tdfx_screen.h index 90be89a352..5a68898b36 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_screen.h +++ b/src/mesa/drivers/dri/tdfx/tdfx_screen.h @@ -23,7 +23,6 @@ * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_screen.h,v 1.2 2002/02/22 21:45:03 dawes Exp $ */ /* * Original rewrite: diff --git a/src/mesa/drivers/dri/tdfx/tdfx_span.c b/src/mesa/drivers/dri/tdfx/tdfx_span.c index d9d52d2b6f..6b38fa5a01 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_span.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_span.c @@ -23,7 +23,6 @@ * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_span.c,v 1.7 2002/10/30 12:52:00 alanh Exp $ */ /* * Original rewrite: diff --git a/src/mesa/drivers/dri/tdfx/tdfx_span.h b/src/mesa/drivers/dri/tdfx/tdfx_span.h index 62044144f0..6973f8d140 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_span.h +++ b/src/mesa/drivers/dri/tdfx/tdfx_span.h @@ -23,7 +23,6 @@ * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_span.h,v 1.1 2001/03/21 16:14:28 dawes Exp $ */ /* * Original rewrite: @@ -38,7 +37,7 @@ #ifndef __TDFX_SPAN_H__ #define __TDFX_SPAN_H__ -#include "context.h" +#include "main/context.h" #include "drirenderbuffer.h" extern void tdfxDDInitSpanFuncs( GLcontext *ctx ); diff --git a/src/mesa/drivers/dri/tdfx/tdfx_state.c b/src/mesa/drivers/dri/tdfx/tdfx_state.c index e4d77e6742..a2d7bcd97d 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_state.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_state.c @@ -23,7 +23,6 @@ * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_state.c,v 1.7 2002/10/30 12:52:00 alanh Exp $ */ /* * New fixes: @@ -39,11 +38,11 @@ * */ -#include "mtypes.h" -#include "colormac.h" -#include "texformat.h" -#include "texstore.h" -#include "teximage.h" +#include "main/mtypes.h" +#include "main/colormac.h" +#include "main/texformat.h" +#include "main/texstore.h" +#include "main/teximage.h" #include "swrast/swrast.h" #include "vbo/vbo.h" diff --git a/src/mesa/drivers/dri/tdfx/tdfx_state.h b/src/mesa/drivers/dri/tdfx/tdfx_state.h index b10c38f591..4880b990fc 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_state.h +++ b/src/mesa/drivers/dri/tdfx/tdfx_state.h @@ -23,7 +23,6 @@ * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_state.h,v 1.2 2002/02/22 21:45:04 dawes Exp $ */ /* * Original rewrite: @@ -38,7 +37,7 @@ #ifndef __TDFX_STATE_H__ #define __TDFX_STATE_H__ -#include "context.h" +#include "main/context.h" #include "tdfx_context.h" extern void tdfxDDInitStateFuncs( GLcontext *ctx ); diff --git a/src/mesa/drivers/dri/tdfx/tdfx_tex.c b/src/mesa/drivers/dri/tdfx/tdfx_tex.c index 64946385b6..1f7257eaea 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_tex.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_tex.c @@ -23,7 +23,6 @@ * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_tex.c,v 1.7 2002/11/05 17:46:10 tsi Exp $ */ /* * New fixes: @@ -39,14 +38,14 @@ */ -#include "enums.h" -#include "image.h" -#include "mipmap.h" -#include "texcompress.h" -#include "texformat.h" -#include "teximage.h" -#include "texstore.h" -#include "texobj.h" +#include "main/enums.h" +#include "main/image.h" +#include "main/mipmap.h" +#include "main/texcompress.h" +#include "main/texformat.h" +#include "main/teximage.h" +#include "main/texstore.h" +#include "main/texobj.h" #include "tdfx_context.h" #include "tdfx_tex.h" #include "tdfx_texman.h" diff --git a/src/mesa/drivers/dri/tdfx/tdfx_tex.h b/src/mesa/drivers/dri/tdfx/tdfx_tex.h index f536c25a2f..a445935a01 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_tex.h +++ b/src/mesa/drivers/dri/tdfx/tdfx_tex.h @@ -23,7 +23,6 @@ * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_tex.h,v 1.2 2002/02/22 21:45:04 dawes Exp $ */ /* * Original rewrite: diff --git a/src/mesa/drivers/dri/tdfx/tdfx_texman.c b/src/mesa/drivers/dri/tdfx/tdfx_texman.c index 6f782f687f..35636ee5ef 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_texman.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_texman.c @@ -23,7 +23,6 @@ * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_texman.c,v 1.5 2002/02/22 21:45:04 dawes Exp $ */ /* * Original rewrite: @@ -38,8 +37,8 @@ #include "tdfx_context.h" #include "tdfx_tex.h" #include "tdfx_texman.h" -#include "texobj.h" -#include "hash.h" +#include "main/texobj.h" +#include "main/hash.h" #define BAD_ADDRESS ((FxU32) -1) diff --git a/src/mesa/drivers/dri/tdfx/tdfx_texman.h b/src/mesa/drivers/dri/tdfx/tdfx_texman.h index 739d4e142f..a9af4cb7c5 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_texman.h +++ b/src/mesa/drivers/dri/tdfx/tdfx_texman.h @@ -23,7 +23,6 @@ * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_texman.h,v 1.2 2002/02/22 21:45:04 dawes Exp $ */ /* * Original rewrite: diff --git a/src/mesa/drivers/dri/tdfx/tdfx_texstate.c b/src/mesa/drivers/dri/tdfx/tdfx_texstate.c index fda9ce5684..bbd2c8cfee 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_texstate.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_texstate.c @@ -23,7 +23,6 @@ * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_texstate.c,v 1.2 2002/02/22 21:45:04 dawes Exp $ */ /* * New fixes: diff --git a/src/mesa/drivers/dri/tdfx/tdfx_texstate.h b/src/mesa/drivers/dri/tdfx/tdfx_texstate.h index 234ed4439a..0c5c4101ca 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_texstate.h +++ b/src/mesa/drivers/dri/tdfx/tdfx_texstate.h @@ -23,7 +23,6 @@ * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_texstate.h,v 1.1 2002/02/22 21:45:04 dawes Exp $ */ /* * Original rewrite: diff --git a/src/mesa/drivers/dri/tdfx/tdfx_tris.c b/src/mesa/drivers/dri/tdfx/tdfx_tris.c index 7252a7e7dc..8824988895 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_tris.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_tris.c @@ -23,7 +23,6 @@ * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_tris.c,v 1.4 2002/10/30 12:52:01 alanh Exp $ */ /* New fixes: * Daniel Borca <dborca@users.sourceforge.net>, 19 Jul 2004 @@ -32,10 +31,10 @@ * Keith Whitwell <keith@tungstengraphics.com> */ -#include "glheader.h" -#include "mtypes.h" -#include "macros.h" -#include "colormac.h" +#include "main/glheader.h" +#include "main/mtypes.h" +#include "main/macros.h" +#include "main/colormac.h" #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" diff --git a/src/mesa/drivers/dri/tdfx/tdfx_tris.h b/src/mesa/drivers/dri/tdfx/tdfx_tris.h index 57e5d9b0ae..ec48a48692 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_tris.h +++ b/src/mesa/drivers/dri/tdfx/tdfx_tris.h @@ -29,12 +29,11 @@ * Keith Whitwell <keith@tungstengraphics.com> * */ -/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_tris.h,v 1.5 2002/10/30 12:52:01 alanh Exp $ */ #ifndef TDFX_TRIS_INC #define TDFX_TRIS_INC -#include "mtypes.h" +#include "main/mtypes.h" extern void tdfxDDInitTriFuncs( GLcontext *ctx ); diff --git a/src/mesa/drivers/dri/tdfx/tdfx_vb.c b/src/mesa/drivers/dri/tdfx/tdfx_vb.c index 0580135d1b..4928802232 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_vb.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_vb.c @@ -22,13 +22,12 @@ * * */ -/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_vb.c,v 1.3 2002/10/30 12:52:01 alanh Exp $ */ -#include "glheader.h" -#include "mtypes.h" -#include "imports.h" -#include "macros.h" -#include "colormac.h" +#include "main/glheader.h" +#include "main/mtypes.h" +#include "main/imports.h" +#include "main/macros.h" +#include "main/colormac.h" #include "math/m_translate.h" #include "swrast_setup/swrast_setup.h" diff --git a/src/mesa/drivers/dri/tdfx/tdfx_vb.h b/src/mesa/drivers/dri/tdfx/tdfx_vb.h index 7b7cd9065a..1e190e85f6 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_vb.h +++ b/src/mesa/drivers/dri/tdfx/tdfx_vb.h @@ -22,12 +22,11 @@ * * */ -/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_vb.h,v 1.2 2002/02/22 21:45:04 dawes Exp $ */ #ifndef TDFXVB_INC #define TDFXVB_INC -#include "mtypes.h" +#include "main/mtypes.h" #include "tnl/tnl.h" #include "tnl/t_context.h" diff --git a/src/mesa/drivers/dri/trident/trident_context.c b/src/mesa/drivers/dri/trident/trident_context.c index 2b6d19c4a5..e134cfcf8e 100644 --- a/src/mesa/drivers/dri/trident/trident_context.c +++ b/src/mesa/drivers/dri/trident/trident_context.c @@ -35,17 +35,17 @@ #include "tnl/tnl.h" #include "tnl/t_pipeline.h" -#include "context.h" -#include "simple_list.h" -#include "matrix.h" -#include "extensions.h" -#include "framebuffer.h" -#include "renderbuffer.h" +#include "main/context.h" +#include "main/simple_list.h" +#include "main/matrix.h" +#include "main/extensions.h" +#include "main/framebuffer.h" +#include "main/renderbuffer.h" #if defined(USE_X86_ASM) #include "x86/common_x86_asm.h" #endif -#include "simple_list.h" -#include "mm.h" +#include "main/simple_list.h" +#include "main/mm.h" #include "drirenderbuffer.h" #include "drivers/common/driverfuncs.h" diff --git a/src/mesa/drivers/dri/trident/trident_context.h b/src/mesa/drivers/dri/trident/trident_context.h index 82b53df884..fbbb4a96e7 100644 --- a/src/mesa/drivers/dri/trident/trident_context.h +++ b/src/mesa/drivers/dri/trident/trident_context.h @@ -28,10 +28,10 @@ #define _TRIDENT_CONTEXT_H_ #include "dri_util.h" -#include "macros.h" -#include "mtypes.h" +#include "main/macros.h" +#include "main/mtypes.h" #include "drm.h" -#include "mm.h" +#include "main/mm.h" #define SUBPIXEL_X (0.0F) #define SUBPIXEL_Y (0.125F) diff --git a/src/mesa/drivers/dri/trident/trident_dd.c b/src/mesa/drivers/dri/trident/trident_dd.c index 4639b3a15e..faa40c36a2 100644 --- a/src/mesa/drivers/dri/trident/trident_dd.c +++ b/src/mesa/drivers/dri/trident/trident_dd.c @@ -31,8 +31,8 @@ #endif #include "swrast/swrast.h" -#include "context.h" -#include "framebuffer.h" +#include "main/context.h" +#include "main/framebuffer.h" #define TRIDENT_DATE "20041223" diff --git a/src/mesa/drivers/dri/trident/trident_state.c b/src/mesa/drivers/dri/trident/trident_state.c index cc2e52ab27..e68d3a73c6 100644 --- a/src/mesa/drivers/dri/trident/trident_state.c +++ b/src/mesa/drivers/dri/trident/trident_state.c @@ -30,7 +30,7 @@ #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" #include "tnl/tnl.h" -#include "framebuffer.h" +#include "main/framebuffer.h" #define TRIDENTPACKCOLOR332(r, g, b) \ (((r) & 0xe0) | (((g) & 0xe0) >> 3) | (((b) & 0xc0) >> 6)) diff --git a/src/mesa/drivers/dri/trident/trident_vb.c b/src/mesa/drivers/dri/trident/trident_vb.c index 77e4d9b76e..b231f5ef15 100644 --- a/src/mesa/drivers/dri/trident/trident_vb.c +++ b/src/mesa/drivers/dri/trident/trident_vb.c @@ -24,10 +24,10 @@ * Trident CyberBladeXP driver. * */ -#include "glheader.h" -#include "mtypes.h" -#include "macros.h" -#include "colormac.h" +#include "main/glheader.h" +#include "main/mtypes.h" +#include "main/macros.h" +#include "main/colormac.h" #include "swrast_setup/swrast_setup.h" #include "swrast/swrast.h" diff --git a/src/mesa/drivers/dri/unichrome/server/via_dri.c b/src/mesa/drivers/dri/unichrome/server/via_dri.c index 6944bd66f9..74034485e2 100644 --- a/src/mesa/drivers/dri/unichrome/server/via_dri.c +++ b/src/mesa/drivers/dri/unichrome/server/via_dri.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/via/via_dri.c,v 1.4 2003/09/24 02:43:30 dawes Exp $ */ /* * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved. * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved. @@ -53,9 +52,9 @@ static int VIADRIFinishScreenInit(DRIDriverContext * ctx); /* _SOLO : missing macros normally defined by X code */ #define xf86DrvMsg(a, b, ...) fprintf(stderr, __VA_ARGS__) -#define MMIO_IN8(base, addr) ((*(((volatile u_int8_t*)base)+(addr)))+0) -#define MMIO_OUT8(base, addr, val) ((*(((volatile u_int8_t*)base)+(addr)))=((u_int8_t)val)) -#define MMIO_OUT16(base, addr, val) ((*(volatile u_int16_t*)(((u_int8_t*)base)+(addr)))=((u_int16_t)val)) +#define MMIO_IN8(base, addr) ((*(((volatile uint8_t*)base)+(addr)))+0) +#define MMIO_OUT8(base, addr, val) ((*(((volatile uint8_t*)base)+(addr)))=((uint8_t)val)) +#define MMIO_OUT16(base, addr, val) ((*(volatile uint16_t*)(((uint8_t*)base)+(addr)))=((uint16_t)val)) #define VIDEO 0 #define AGP 1 @@ -524,9 +523,9 @@ static int VIADRIKernelInit(DRIDriverContext * ctx, VIAPtr pVia) drmInfo.fb_offset = pVia->FrameBufferBase; drmInfo.mmio_offset = pVia->registerHandle; if (pVia->IsPCI) - drmInfo.agpAddr = (u_int32_t)NULL; + drmInfo.agpAddr = (uint32_t)NULL; else - drmInfo.agpAddr = (u_int32_t)pVia->agpAddr; + drmInfo.agpAddr = (uint32_t)pVia->agpAddr; if ((drmCommandWrite(pVia->drmFD, DRM_VIA_MAP_INIT,&drmInfo, sizeof(drm_via_init_t))) < 0) @@ -632,7 +631,7 @@ static void VIADisableMMIO(DRIDriverContext * ctx) static void VIADisableExtendedFIFO(DRIDriverContext *ctx) { VIAPtr pVia = VIAPTR(ctx); - u_int32_t dwGE230, dwGE298; + uint32_t dwGE230, dwGE298; /* Cause of exit XWindow will dump back register value, others chipset no * need to set extended fifo value */ @@ -654,8 +653,8 @@ static void VIADisableExtendedFIFO(DRIDriverContext *ctx) static void VIAEnableExtendedFIFO(DRIDriverContext *ctx) { VIAPtr pVia = VIAPTR(ctx); - u_int8_t bRegTemp; - u_int32_t dwGE230, dwGE298; + uint8_t bRegTemp; + uint32_t dwGE230, dwGE298; switch (pVia->Chipset) { case VIA_CLE266: @@ -850,7 +849,7 @@ static void VIAEnableExtendedFIFO(DRIDriverContext *ctx) SR1C[7:0], SR1D[1:0] (10bits) *=*/ wRegTemp = (pBIOSInfo->offsetWidthByQWord >> 1) + 4; VGAOUT8(0x3c4, 0x1c); - VGAOUT8(0x3c5, (u_int8_t)(wRegTemp & 0xFF)); + VGAOUT8(0x3c5, (uint8_t)(wRegTemp & 0xFF)); VGAOUT8(0x3c4, 0x1d); bRegTemp = VGAIN8(0x3c5) & ~0x03; VGAOUT8(0x3c5, bRegTemp | ((wRegTemp & 0x300) >> 8)); @@ -896,7 +895,7 @@ static void VIAEnableExtendedFIFO(DRIDriverContext *ctx) SR1C[7:0], SR1D[1:0] (10bits) *=*/ wRegTemp = (pBIOSInfo->offsetWidthByQWord >> 1) + 4; VGAOUT8(0x3c4, 0x1c); - VGAOUT8(0x3c5, (u_int8_t)(wRegTemp & 0xFF)); + VGAOUT8(0x3c5, (uint8_t)(wRegTemp & 0xFF)); VGAOUT8(0x3c4, 0x1d); bRegTemp = VGAIN8(0x3c5) & ~0x03; VGAOUT8(0x3c5, bRegTemp | ((wRegTemp & 0x300) >> 8)); @@ -924,9 +923,9 @@ static void VIAEnableExtendedFIFO(DRIDriverContext *ctx) static void VIAInitialize2DEngine(DRIDriverContext *ctx) { VIAPtr pVia = VIAPTR(ctx); - u_int32_t dwVQStartAddr, dwVQEndAddr; - u_int32_t dwVQLen, dwVQStartL, dwVQEndL, dwVQStartEndH; - u_int32_t dwGEMode; + uint32_t dwVQStartAddr, dwVQEndAddr; + uint32_t dwVQLen, dwVQStartL, dwVQEndL, dwVQStartEndH; + uint32_t dwGEMode; /* init 2D engine regs to reset 2D engine */ VIASETREG(0x04, 0x0); @@ -1069,14 +1068,14 @@ static void VIAInitialize3DEngine(DRIDriverContext *ctx) for (i = 0; i <= 0x7D; i++) { - VIASETREG(0x440, (u_int32_t) i << 24); + VIASETREG(0x440, (uint32_t) i << 24); } VIASETREG(0x43C, 0x00020000); for (i = 0; i <= 0x94; i++) { - VIASETREG(0x440, (u_int32_t) i << 24); + VIASETREG(0x440, (uint32_t) i << 24); } VIASETREG(0x440, 0x82400000); @@ -1086,7 +1085,7 @@ static void VIAInitialize3DEngine(DRIDriverContext *ctx) for (i = 0; i <= 0x94; i++) { - VIASETREG(0x440, (u_int32_t) i << 24); + VIASETREG(0x440, (uint32_t) i << 24); } VIASETREG(0x440, 0x82400000); @@ -1094,7 +1093,7 @@ static void VIAInitialize3DEngine(DRIDriverContext *ctx) for (i = 0; i <= 0x03; i++) { - VIASETREG(0x440, (u_int32_t) i << 24); + VIASETREG(0x440, (uint32_t) i << 24); } VIASETREG(0x43C, 0x00030000); diff --git a/src/mesa/drivers/dri/unichrome/server/via_driver.h b/src/mesa/drivers/dri/unichrome/server/via_driver.h index 997b2e41a7..cd3b038bfd 100644 --- a/src/mesa/drivers/dri/unichrome/server/via_driver.h +++ b/src/mesa/drivers/dri/unichrome/server/via_driver.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/via/via_driver.h,v 1.7 2003/11/06 18:38:11 tsi Exp $ */ /* * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved. * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved. @@ -212,12 +211,12 @@ typedef struct _VIA { XAAInfoRecPtr AccelInfoRec; xRectangle Rect; #endif - u_int32_t SavedCmd; - u_int32_t SavedFgColor; - u_int32_t SavedBgColor; - u_int32_t SavedPattern0; - u_int32_t SavedPattern1; - u_int32_t SavedPatternAddr; + uint32_t SavedCmd; + uint32_t SavedFgColor; + uint32_t SavedBgColor; + uint32_t SavedPattern0; + uint32_t SavedPattern1; + uint32_t SavedPatternAddr; #if 0 /* Support for Int10 processing */ @@ -255,8 +254,8 @@ typedef struct _VIA { #endif /* - u_int32_t Cap0_Deinterlace; - u_int32_t Cap1_Deinterlace; + uint32_t Cap0_Deinterlace; + uint32_t Cap1_Deinterlace; int Cap0_FieldSwap; int NoCap0_HFilter; @@ -272,7 +271,7 @@ typedef struct _VIA { VIAConfigPrivPtr pVisualConfigsPriv; unsigned long agpHandle; unsigned long registerHandle; - u_int32_t agpAddr; + uint32_t agpAddr; unsigned char *agpBase; unsigned int agpSize; int IsPCI; @@ -288,11 +287,11 @@ typedef struct _VIA { #endif int V4LEnabled; - u_int16_t ActiveDevice; /* if SAMM, non-equal pBIOSInfo->ActiveDevice */ + uint16_t ActiveDevice; /* if SAMM, non-equal pBIOSInfo->ActiveDevice */ unsigned char *CursorImage; - u_int32_t CursorFG; - u_int32_t CursorBG; - u_int32_t CursorMC; + uint32_t CursorFG; + uint32_t CursorBG; + uint32_t CursorMC; unsigned char MemClk; int EnableExtendedFIFO; diff --git a/src/mesa/drivers/dri/unichrome/server/via_priv.h b/src/mesa/drivers/dri/unichrome/server/via_priv.h index 587531b37c..352eac0597 100644 --- a/src/mesa/drivers/dri/unichrome/server/via_priv.h +++ b/src/mesa/drivers/dri/unichrome/server/via_priv.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/via/via_priv.h,v 1.3 2003/08/27 15:16:12 tsi Exp $ */ #ifndef _VIA_PRIV_H_ #define _VIA_PRIV_H_ 1 diff --git a/src/mesa/drivers/dri/unichrome/via_context.c b/src/mesa/drivers/dri/unichrome/via_context.c index ed7001d48d..f5bdb65eb0 100644 --- a/src/mesa/drivers/dri/unichrome/via_context.c +++ b/src/mesa/drivers/dri/unichrome/via_context.c @@ -30,14 +30,14 @@ * \author Others at S3 Graphics? */ -#include "glheader.h" -#include "context.h" -#include "matrix.h" -#include "state.h" -#include "simple_list.h" -#include "extensions.h" -#include "framebuffer.h" -#include "renderbuffer.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/matrix.h" +#include "main/state.h" +#include "main/simple_list.h" +#include "main/extensions.h" +#include "main/framebuffer.h" +#include "main/renderbuffer.h" #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" @@ -59,7 +59,7 @@ #include "via_fb.h" #include <stdio.h> -#include "macros.h" +#include "main/macros.h" #include "drirenderbuffer.h" #define need_GL_ARB_multisample diff --git a/src/mesa/drivers/dri/unichrome/via_context.h b/src/mesa/drivers/dri/unichrome/via_context.h index acd6f2e2b1..4cc9e475c2 100644 --- a/src/mesa/drivers/dri/unichrome/via_context.h +++ b/src/mesa/drivers/dri/unichrome/via_context.h @@ -28,9 +28,10 @@ #include "dri_util.h" -#include "mtypes.h" #include "drm.h" -#include "mm.h" + +#include "main/mtypes.h" +#include "main/mm.h" #include "tnl/t_vertex.h" #include "via_screen.h" diff --git a/src/mesa/drivers/dri/unichrome/via_fb.c b/src/mesa/drivers/dri/unichrome/via_fb.c index 48c7ed4caa..e4fb29f6c6 100644 --- a/src/mesa/drivers/dri/unichrome/via_fb.c +++ b/src/mesa/drivers/dri/unichrome/via_fb.c @@ -28,8 +28,8 @@ #include "via_ioctl.h" #include "via_fb.h" #include "xf86drm.h" -#include "imports.h" -#include "simple_list.h" +#include "main/imports.h" +#include "main/simple_list.h" #include <sys/ioctl.h> GLboolean diff --git a/src/mesa/drivers/dri/unichrome/via_ioctl.c b/src/mesa/drivers/dri/unichrome/via_ioctl.c index 482a1a63d7..6746f552ae 100644 --- a/src/mesa/drivers/dri/unichrome/via_ioctl.c +++ b/src/mesa/drivers/dri/unichrome/via_ioctl.c @@ -24,13 +24,13 @@ #include <stdio.h> #include <unistd.h> -#include "glheader.h" -#include "mtypes.h" -#include "macros.h" -#include "dd.h" +#include "main/glheader.h" +#include "main/mtypes.h" +#include "main/macros.h" +#include "main/dd.h" #include "swrast/swrast.h" -#include "mm.h" +#include "main/mm.h" #include "via_context.h" #include "via_tris.h" #include "via_ioctl.h" diff --git a/src/mesa/drivers/dri/unichrome/via_render.c b/src/mesa/drivers/dri/unichrome/via_render.c index d7e373d7dd..f676cc13c8 100644 --- a/src/mesa/drivers/dri/unichrome/via_render.c +++ b/src/mesa/drivers/dri/unichrome/via_render.c @@ -28,10 +28,10 @@ * dma buffers. Use strip/fan hardware acceleration where possible. * */ -#include "glheader.h" -#include "context.h" -#include "macros.h" -#include "mtypes.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/macros.h" +#include "main/mtypes.h" #include "tnl/t_context.h" diff --git a/src/mesa/drivers/dri/unichrome/via_screen.c b/src/mesa/drivers/dri/unichrome/via_screen.c index 3648710533..988f9935ac 100644 --- a/src/mesa/drivers/dri/unichrome/via_screen.c +++ b/src/mesa/drivers/dri/unichrome/via_screen.c @@ -26,12 +26,12 @@ #include "dri_util.h" #include "utils.h" -#include "glheader.h" -#include "context.h" -#include "framebuffer.h" -#include "renderbuffer.h" -#include "matrix.h" -#include "simple_list.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/framebuffer.h" +#include "main/renderbuffer.h" +#include "main/matrix.h" +#include "main/simple_list.h" #include "vblank.h" #include "via_state.h" @@ -340,8 +340,8 @@ viaFillInModes( __DRIscreenPrivate *psp, /* The 32-bit depth-buffer mode isn't supported yet, so don't actually * enable it. */ - static const u_int8_t depth_bits_array[4] = { 0, 16, 24, 32 }; - static const u_int8_t stencil_bits_array[4] = { 0, 0, 8, 0 }; + static const uint8_t depth_bits_array[4] = { 0, 16, 24, 32 }; + static const uint8_t stencil_bits_array[4] = { 0, 0, 8, 0 }; const unsigned depth_buffer_factor = 3; if ( pixel_bits == 16 ) { diff --git a/src/mesa/drivers/dri/unichrome/via_span.c b/src/mesa/drivers/dri/unichrome/via_span.c index 3a16dadd23..b908f0fb23 100644 --- a/src/mesa/drivers/dri/unichrome/via_span.c +++ b/src/mesa/drivers/dri/unichrome/via_span.c @@ -22,10 +22,10 @@ * DEALINGS IN THE SOFTWARE. */ -#include "glheader.h" -#include "macros.h" -#include "mtypes.h" -#include "colormac.h" +#include "main/glheader.h" +#include "main/macros.h" +#include "main/mtypes.h" +#include "main/colormac.h" #include "via_context.h" #include "via_span.h" #include "via_ioctl.h" @@ -86,6 +86,7 @@ #define LOCAL_STENCIL_VARS LOCAL_DEPTH_VARS +#define VALUE_TYPE GLushort #define WRITE_DEPTH(_x, _y, d) \ *(GLushort *)(buf + (_x) * 2 + (_y) * depth_pitch) = d; @@ -98,6 +99,8 @@ /* 32 bit depthbuffer functions. */ +#define VALUE_TYPE GLuint + #define WRITE_DEPTH(_x, _y, d) \ *(GLuint *)(buf + (_x) * 4 + (_y) * depth_pitch) = d; @@ -111,6 +114,8 @@ /* 24/8 bit interleaved depth/stencil functions */ +#define VALUE_TYPE GLuint + #define WRITE_DEPTH( _x, _y, d ) { \ GLuint tmp = *(GLuint *)(buf + (_x)*4 + (_y)*depth_pitch); \ tmp &= 0x000000ff; \ diff --git a/src/mesa/drivers/dri/unichrome/via_state.c b/src/mesa/drivers/dri/unichrome/via_state.c index 645c58aa40..1cef01ab03 100644 --- a/src/mesa/drivers/dri/unichrome/via_state.c +++ b/src/mesa/drivers/dri/unichrome/via_state.c @@ -24,14 +24,14 @@ #include <stdio.h> -#include "glheader.h" -#include "context.h" -#include "macros.h" -#include "colormac.h" -#include "enums.h" -#include "dd.h" - -#include "mm.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/macros.h" +#include "main/colormac.h" +#include "main/enums.h" +#include "main/dd.h" +#include "main/mm.h" + #include "via_context.h" #include "via_state.h" #include "via_tex.h" @@ -778,10 +778,10 @@ void viaInitState(GLcontext *ctx) /** * Convert S and T texture coordinate wrap modes to hardware bits. */ -static u_int32_t +static uint32_t get_wrap_mode( GLenum sWrap, GLenum tWrap ) { - u_int32_t v = 0; + uint32_t v = 0; switch( sWrap ) { @@ -813,10 +813,10 @@ get_wrap_mode( GLenum sWrap, GLenum tWrap ) return v; } -static u_int32_t +static uint32_t get_minmag_filter( GLenum min, GLenum mag ) { - u_int32_t v = 0; + uint32_t v = 0; switch (min) { case GL_NEAREST: diff --git a/src/mesa/drivers/dri/unichrome/via_tex.c b/src/mesa/drivers/dri/unichrome/via_tex.c index 15f15a89a6..d2010f0907 100644 --- a/src/mesa/drivers/dri/unichrome/via_tex.c +++ b/src/mesa/drivers/dri/unichrome/via_tex.c @@ -26,21 +26,21 @@ #include <stdlib.h> #include <stdio.h> -#include "glheader.h" -#include "macros.h" -#include "mtypes.h" -#include "enums.h" -#include "colortab.h" -#include "convolve.h" -#include "context.h" -#include "mipmap.h" -#include "simple_list.h" -#include "texcompress.h" -#include "texformat.h" -#include "texobj.h" -#include "texstore.h" - -#include "mm.h" +#include "main/glheader.h" +#include "main/macros.h" +#include "main/mtypes.h" +#include "main/enums.h" +#include "main/colortab.h" +#include "main/convolve.h" +#include "main/context.h" +#include "main/mipmap.h" +#include "main/simple_list.h" +#include "main/texcompress.h" +#include "main/texformat.h" +#include "main/texobj.h" +#include "main/texstore.h" + +#include "main/mm.h" #include "via_context.h" #include "via_fb.h" #include "via_tex.h" diff --git a/src/mesa/drivers/dri/unichrome/via_tex.h b/src/mesa/drivers/dri/unichrome/via_tex.h index 73cfa91add..25eeee32f3 100644 --- a/src/mesa/drivers/dri/unichrome/via_tex.h +++ b/src/mesa/drivers/dri/unichrome/via_tex.h @@ -26,7 +26,7 @@ #ifndef _VIATEX_H #define _VIATEX_H -#include "mtypes.h" +#include "main/mtypes.h" struct via_context; diff --git a/src/mesa/drivers/dri/unichrome/via_texcombine.c b/src/mesa/drivers/dri/unichrome/via_texcombine.c index d604457bfd..b646897848 100644 --- a/src/mesa/drivers/dri/unichrome/via_texcombine.c +++ b/src/mesa/drivers/dri/unichrome/via_texcombine.c @@ -31,11 +31,11 @@ #include <stdio.h> -#include "glheader.h" -#include "context.h" -#include "macros.h" -#include "colormac.h" -#include "enums.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/macros.h" +#include "main/colormac.h" +#include "main/enums.h" #include "via_context.h" #include "via_state.h" diff --git a/src/mesa/drivers/dri/unichrome/via_tris.c b/src/mesa/drivers/dri/unichrome/via_tris.c index b97dacde24..79e67620c9 100644 --- a/src/mesa/drivers/dri/unichrome/via_tris.c +++ b/src/mesa/drivers/dri/unichrome/via_tris.c @@ -25,12 +25,12 @@ #include <stdio.h> #include <math.h> -#include "glheader.h" -#include "context.h" -#include "mtypes.h" -#include "macros.h" -#include "colormac.h" -#include "enums.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/mtypes.h" +#include "main/macros.h" +#include "main/colormac.h" +#include "main/enums.h" #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" diff --git a/src/mesa/drivers/dri/unichrome/via_tris.h b/src/mesa/drivers/dri/unichrome/via_tris.h index b4f0880a7a..bc6ef4e4eb 100644 --- a/src/mesa/drivers/dri/unichrome/via_tris.h +++ b/src/mesa/drivers/dri/unichrome/via_tris.h @@ -25,7 +25,7 @@ #ifndef _VIATRIS_H #define _VIATRIS_H -#include "mtypes.h" +#include "main/mtypes.h" extern void viaPrintRenderState(const char *msg, GLuint state); extern void viaInitTriFuncs(GLcontext *ctx); diff --git a/src/mesa/drivers/fbdev/glfbdev.c b/src/mesa/drivers/fbdev/glfbdev.c index f3da4a5ba2..3c874ba57a 100644 --- a/src/mesa/drivers/fbdev/glfbdev.c +++ b/src/mesa/drivers/fbdev/glfbdev.c @@ -41,19 +41,19 @@ #ifdef USE_GLFBDEV_DRIVER -#include "glheader.h" #include <linux/fb.h> #include "GL/glfbdev.h" -#include "buffers.h" -#include "context.h" -#include "extensions.h" -#include "fbobject.h" -#include "framebuffer.h" -#include "imports.h" -#include "renderbuffer.h" -#include "texformat.h" -#include "teximage.h" -#include "texstore.h" +#include "main/glheader.h" +#include "main/buffers.h" +#include "main/context.h" +#include "main/extensions.h" +#include "main/fbobject.h" +#include "main/framebuffer.h" +#include "main/imports.h" +#include "main/renderbuffer.h" +#include "main/texformat.h" +#include "main/teximage.h" +#include "main/texstore.h" #include "vbo/vbo.h" #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" diff --git a/src/mesa/drivers/ggi/default/genkgi.h b/src/mesa/drivers/ggi/default/genkgi.h index 022189138f..6d0963416f 100644 --- a/src/mesa/drivers/ggi/default/genkgi.h +++ b/src/mesa/drivers/ggi/default/genkgi.h @@ -1,4 +1,4 @@ -/* $Id: genkgi.h,v 1.3 1999/08/22 08:56:50 jtaylor Exp $ +/* ****************************************************************************** GGIMesa - KGIcon specific overrides for fbcon-mesa diff --git a/src/mesa/drivers/ggi/default/genkgi_mode.c b/src/mesa/drivers/ggi/default/genkgi_mode.c index 938024789f..f81d6a45bd 100644 --- a/src/mesa/drivers/ggi/default/genkgi_mode.c +++ b/src/mesa/drivers/ggi/default/genkgi_mode.c @@ -1,4 +1,4 @@ -/* $Id: genkgi_mode.c,v 1.4 2000/01/07 08:34:44 jtaylor Exp $ +/* ****************************************************************************** display-fbdev-kgicon-generic-mesa diff --git a/src/mesa/drivers/ggi/default/genkgi_visual.c b/src/mesa/drivers/ggi/default/genkgi_visual.c index 17ef9679bb..d7838cae6e 100644 --- a/src/mesa/drivers/ggi/default/genkgi_visual.c +++ b/src/mesa/drivers/ggi/default/genkgi_visual.c @@ -1,4 +1,4 @@ -/* $Id: genkgi_visual.c,v 1.7 2000/06/11 20:11:55 jtaylor Exp $ +/* ****************************************************************************** genkgi_visual.c: visual handling for the generic KGI helper diff --git a/src/mesa/drivers/ggi/ggimesa.c b/src/mesa/drivers/ggi/ggimesa.c index 85592d98da..bc08144d66 100644 --- a/src/mesa/drivers/ggi/ggimesa.c +++ b/src/mesa/drivers/ggi/ggimesa.c @@ -29,20 +29,20 @@ #include <ggi/mesa/ggimesa_int.h> #include <ggi/mesa/debug.h> -#include "extensions.h" -#include "buffers.h" -#include "colormac.h" -#include "imports.h" -#include "matrix.h" +#include "main/extensions.h" +#include "main/buffers.h" +#include "main/colormac.h" +#include "main/imports.h" +#include "main/matrix.h" +#include "main/teximage.h" +#include "main/texformat.h" +#include "main/texstore.h" #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" #include "tnl/tnl.h" #include "tnl/t_context.h" #include "tnl/t_pipeline.h" #include "vbo/vbo.h" -#include "teximage.h" -#include "texformat.h" -#include "texstore.h" /* We use LibGG to manage config files */ #include <ggi/gg.h> diff --git a/src/mesa/drivers/ggi/include/ggi/mesa/debug.h b/src/mesa/drivers/ggi/include/ggi/mesa/debug.h index 35d11624c6..f461fee72c 100644 --- a/src/mesa/drivers/ggi/include/ggi/mesa/debug.h +++ b/src/mesa/drivers/ggi/include/ggi/mesa/debug.h @@ -1,4 +1,4 @@ -/* $Id: debug.h,v 1.5 2003/09/22 15:18:51 brianp Exp $ +/* ****************************************************************************** GGIMesa debugging macros diff --git a/src/mesa/drivers/glide/fxapi.c b/src/mesa/drivers/glide/fxapi.c index 00b9d29fac..b7708fd636 100644 --- a/src/mesa/drivers/glide/fxapi.c +++ b/src/mesa/drivers/glide/fxapi.c @@ -43,7 +43,7 @@ #include "fxdrv.h" #include "drivers/common/driverfuncs.h" -#include "framebuffer.h" +#include "main/framebuffer.h" #ifndef TDFX_DEBUG int TDFX_DEBUG = (0 diff --git a/src/mesa/drivers/glide/fxdd.c b/src/mesa/drivers/glide/fxdd.c index c082fd827f..213ef2382f 100644 --- a/src/mesa/drivers/glide/fxdd.c +++ b/src/mesa/drivers/glide/fxdd.c @@ -40,15 +40,15 @@ #if defined(FX) -#include "image.h" -#include "mtypes.h" +#include "main/image.h" +#include "main/mtypes.h" #include "fxdrv.h" -#include "buffers.h" -#include "enums.h" -#include "extensions.h" -#include "macros.h" -#include "texstore.h" -#include "teximage.h" +#include "main/buffers.h" +#include "main/enums.h" +#include "main/extensions.h" +#include "main/macros.h" +#include "main/texstore.h" +#include "main/teximage.h" #include "swrast/swrast.h" #include "swrast/s_context.h" #include "swrast_setup/swrast_setup.h" diff --git a/src/mesa/drivers/glide/fxddspan.c b/src/mesa/drivers/glide/fxddspan.c index 3ea9f73dd2..d3a58a301c 100644 --- a/src/mesa/drivers/glide/fxddspan.c +++ b/src/mesa/drivers/glide/fxddspan.c @@ -275,6 +275,8 @@ #undef BYTESPERPIXEL #define BYTESPERPIXEL 2 +#define VALUE_TYPE GLushort + #define WRITE_DEPTH( _x, _y, d ) \ *(GLushort *)(buf + _x*BYTESPERPIXEL + _y*pitch) = d @@ -302,6 +304,8 @@ #undef BYTESPERPIXEL #define BYTESPERPIXEL 4 +#define VALUE_TYPE GLuint + #define WRITE_DEPTH( _x, _y, d ) \ *(GLuint *)(buf + _x*BYTESPERPIXEL + _y*pitch) = d << 8 diff --git a/src/mesa/drivers/glide/fxddtex.c b/src/mesa/drivers/glide/fxddtex.c index cb2c8554b1..f3cd908181 100644 --- a/src/mesa/drivers/glide/fxddtex.c +++ b/src/mesa/drivers/glide/fxddtex.c @@ -39,13 +39,13 @@ #if defined(FX) #include "fxdrv.h" -#include "enums.h" -#include "image.h" -#include "teximage.h" -#include "texformat.h" -#include "texcompress.h" -#include "texobj.h" -#include "texstore.h" +#include "main/enums.h" +#include "main/image.h" +#include "main/teximage.h" +#include "main/texformat.h" +#include "main/texcompress.h" +#include "main/texobj.h" +#include "main/texstore.h" /* no borders! can't halve 1x1! (stride > width * comp) not allowed */ diff --git a/src/mesa/drivers/glide/fxdrv.h b/src/mesa/drivers/glide/fxdrv.h index dc19a912da..bee10de2f4 100644 --- a/src/mesa/drivers/glide/fxdrv.h +++ b/src/mesa/drivers/glide/fxdrv.h @@ -48,11 +48,11 @@ #include <signal.h> #endif -#include "context.h" -#include "imports.h" -#include "macros.h" -#include "matrix.h" -#include "mtypes.h" +#include "main/context.h" +#include "main/imports.h" +#include "main/macros.h" +#include "main/matrix.h" +#include "main/mtypes.h" #include "GL/fxmesa.h" #include "fxglidew.h" diff --git a/src/mesa/drivers/glide/fxsetup.c b/src/mesa/drivers/glide/fxsetup.c index 240e5e0b59..d48726a62a 100644 --- a/src/mesa/drivers/glide/fxsetup.c +++ b/src/mesa/drivers/glide/fxsetup.c @@ -41,11 +41,11 @@ #if defined(FX) #include "fxdrv.h" -#include "enums.h" -#include "tnl.h" +#include "main/enums.h" +#include "main/texstore.h" +#include "tnl/tnl.h" #include "tnl/t_context.h" -#include "swrast.h" -#include "texstore.h" +#include "swrast/swrast.h" static void diff --git a/src/mesa/drivers/glide/fxtris.c b/src/mesa/drivers/glide/fxtris.c index 0b9b3be582..aff91fe7d4 100644 --- a/src/mesa/drivers/glide/fxtris.c +++ b/src/mesa/drivers/glide/fxtris.c @@ -31,10 +31,10 @@ #ifdef FX -#include "imports.h" -#include "mtypes.h" -#include "macros.h" -#include "colormac.h" +#include "main/imports.h" +#include "main/mtypes.h" +#include "main/macros.h" +#include "main/colormac.h" #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" #include "tnl/t_context.h" diff --git a/src/mesa/drivers/glide/fxvb.c b/src/mesa/drivers/glide/fxvb.c index 34ada61f4e..1dc5f9891a 100644 --- a/src/mesa/drivers/glide/fxvb.c +++ b/src/mesa/drivers/glide/fxvb.c @@ -34,11 +34,11 @@ #ifdef FX -#include "glheader.h" -#include "mtypes.h" -#include "imports.h" -#include "macros.h" -#include "colormac.h" +#include "main/glheader.h" +#include "main/mtypes.h" +#include "main/imports.h" +#include "main/macros.h" +#include "main/colormac.h" #include "math/m_translate.h" #include "swrast_setup/swrast_setup.h" diff --git a/src/mesa/drivers/glslcompiler/glslcompiler.c b/src/mesa/drivers/glslcompiler/glslcompiler.c index 016b53d57a..62a366858c 100644 --- a/src/mesa/drivers/glslcompiler/glslcompiler.c +++ b/src/mesa/drivers/glslcompiler/glslcompiler.c @@ -45,11 +45,11 @@ */ -#include "imports.h" -#include "context.h" -#include "extensions.h" -#include "framebuffer.h" -#include "shaders.h" +#include "main/imports.h" +#include "main/context.h" +#include "main/extensions.h" +#include "main/framebuffer.h" +#include "main/shaders.h" #include "shader/shader_api.h" #include "shader/prog_print.h" #include "drivers/common/driverfuncs.h" diff --git a/src/mesa/drivers/osmesa/Makefile b/src/mesa/drivers/osmesa/Makefile index 8b2feee6b0..d6a18b1d75 100644 --- a/src/mesa/drivers/osmesa/Makefile +++ b/src/mesa/drivers/osmesa/Makefile @@ -48,6 +48,7 @@ $(TOP)/lib/$(OSMESA_LIB_NAME): $(OBJECTS) $(MKLIB) -o $(OSMESA_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \ -major $(MESA_MAJOR) -minor $(MESA_MINOR) -patch $(MESA_TINY) \ -install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) \ + -id $(INSTALL_LIB_DIR)/lib$(OSMESA_LIB).$(MESA_MAJOR).dylib \ $(OSMESA_LIB_DEPS) $(OBJECTS) @@ -59,6 +60,7 @@ osmesa16: $(OBJECTS) $(CORE_MESA) $(MKLIB) -o $(OSMESA_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \ -major $(MESA_MAJOR) -minor $(MESA_MINOR) -patch $(MESA_TINY) \ -install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) \ + -id $(INSTALL_LIB_DIR)/lib$(OSMESA_LIB).$(MESA_MAJOR).dylib \ $(OSMESA_LIB_DEPS) $(OBJECTS) $(CORE_MESA) diff --git a/src/mesa/drivers/svga/svgamesa.c b/src/mesa/drivers/svga/svgamesa.c index d138587569..5afa8e188b 100644 --- a/src/mesa/drivers/svga/svgamesa.c +++ b/src/mesa/drivers/svga/svgamesa.c @@ -1,4 +1,3 @@ -/* $Id: svgamesa.c,v 1.27 2006/10/15 18:51:22 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -39,12 +38,12 @@ #include <string.h> #include <vga.h> #include "GL/svgamesa.h" -#include "buffers.h" -#include "context.h" -#include "extensions.h" -#include "imports.h" -#include "matrix.h" -#include "mtypes.h" +#include "main/buffers.h" +#include "main/context.h" +#include "main/extensions.h" +#include "main/imports.h" +#include "main/matrix.h" +#include "main/mtypes.h" #include "swrast/swrast.h" #include "svgapix.h" #include "svgamesa8.h" diff --git a/src/mesa/drivers/svga/svgamesa15.c b/src/mesa/drivers/svga/svgamesa15.c index ae5104d0c0..934aaa33fb 100644 --- a/src/mesa/drivers/svga/svgamesa15.c +++ b/src/mesa/drivers/svga/svgamesa15.c @@ -1,4 +1,3 @@ -/* $Id: svgamesa15.c,v 1.11.36.1 2006/11/02 12:02:17 alanh Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/drivers/svga/svgamesa15.h b/src/mesa/drivers/svga/svgamesa15.h index 3ed7db82ee..d453fb8d35 100644 --- a/src/mesa/drivers/svga/svgamesa15.h +++ b/src/mesa/drivers/svga/svgamesa15.h @@ -1,4 +1,3 @@ -/* $Id: svgamesa15.h,v 1.7 2002/11/11 18:42:39 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/drivers/svga/svgamesa16.c b/src/mesa/drivers/svga/svgamesa16.c index a59937bfb4..9fc8c786e8 100644 --- a/src/mesa/drivers/svga/svgamesa16.c +++ b/src/mesa/drivers/svga/svgamesa16.c @@ -1,4 +1,3 @@ -/* $Id: svgamesa16.c,v 1.11.36.1 2006/11/02 12:02:17 alanh Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/drivers/svga/svgamesa16.h b/src/mesa/drivers/svga/svgamesa16.h index 247c1f4045..b80cd3dd7e 100644 --- a/src/mesa/drivers/svga/svgamesa16.h +++ b/src/mesa/drivers/svga/svgamesa16.h @@ -1,4 +1,3 @@ -/* $Id: svgamesa16.h,v 1.6 2002/11/11 18:42:41 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/drivers/svga/svgamesa24.c b/src/mesa/drivers/svga/svgamesa24.c index 794c24c625..f2ec9c0364 100644 --- a/src/mesa/drivers/svga/svgamesa24.c +++ b/src/mesa/drivers/svga/svgamesa24.c @@ -1,4 +1,3 @@ -/* $Id: svgamesa24.c,v 1.12.36.1 2006/11/02 12:02:17 alanh Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/drivers/svga/svgamesa24.h b/src/mesa/drivers/svga/svgamesa24.h index 54d1a8298b..df5fa68c44 100644 --- a/src/mesa/drivers/svga/svgamesa24.h +++ b/src/mesa/drivers/svga/svgamesa24.h @@ -1,4 +1,3 @@ -/* $Id: svgamesa24.h,v 1.6 2002/11/11 18:42:41 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/drivers/svga/svgamesa32.c b/src/mesa/drivers/svga/svgamesa32.c index be4e51f778..8eea3cbe64 100644 --- a/src/mesa/drivers/svga/svgamesa32.c +++ b/src/mesa/drivers/svga/svgamesa32.c @@ -1,4 +1,3 @@ -/* $Id: svgamesa32.c,v 1.12.36.1 2006/11/02 12:02:17 alanh Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/drivers/svga/svgamesa32.h b/src/mesa/drivers/svga/svgamesa32.h index f518e11ad5..6cf8315300 100644 --- a/src/mesa/drivers/svga/svgamesa32.h +++ b/src/mesa/drivers/svga/svgamesa32.h @@ -1,4 +1,3 @@ -/* $Id: svgamesa32.h,v 1.6 2002/11/11 18:42:42 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/drivers/svga/svgamesa8.c b/src/mesa/drivers/svga/svgamesa8.c index 4264fcd959..2f7048a930 100644 --- a/src/mesa/drivers/svga/svgamesa8.c +++ b/src/mesa/drivers/svga/svgamesa8.c @@ -1,4 +1,3 @@ -/* $Id: svgamesa8.c,v 1.9.10.1 2006/11/02 12:02:17 alanh Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/drivers/svga/svgamesa8.h b/src/mesa/drivers/svga/svgamesa8.h index 1aa25f93fc..d2b0509480 100644 --- a/src/mesa/drivers/svga/svgamesa8.h +++ b/src/mesa/drivers/svga/svgamesa8.h @@ -1,4 +1,3 @@ -/* $Id: svgamesa8.h,v 1.4 2001/02/06 00:03:48 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/drivers/svga/svgapix.h b/src/mesa/drivers/svga/svgapix.h index 0b19551bf6..c8cee37ca6 100644 --- a/src/mesa/drivers/svga/svgapix.h +++ b/src/mesa/drivers/svga/svgapix.h @@ -1,4 +1,3 @@ -/* $Id: svgapix.h,v 1.5 2002/11/11 18:42:44 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -33,8 +32,8 @@ #include "GL/gl.h" #include "GL/svgamesa.h" -#include "context.h" -#include "colormac.h" +#include "main/context.h" +#include "main/colormac.h" #include "vga.h" struct svgamesa_context { diff --git a/src/mesa/drivers/windows/gdi/wgl.c b/src/mesa/drivers/windows/gdi/wgl.c index 0e2d2b3ca8..9f0bb9122a 100644 --- a/src/mesa/drivers/windows/gdi/wgl.c +++ b/src/mesa/drivers/windows/gdi/wgl.c @@ -1,4 +1,3 @@ -/* $Id: wgl.c,v 1.12 2006/03/30 07:58:24 kschultz Exp $ */ /* * This library is free software; you can redistribute it and/or diff --git a/src/mesa/drivers/windows/gdi/wmesa.c b/src/mesa/drivers/windows/gdi/wmesa.c index 1c179eb3bb..9dafb74723 100644 --- a/src/mesa/drivers/windows/gdi/wmesa.c +++ b/src/mesa/drivers/windows/gdi/wmesa.c @@ -118,6 +118,7 @@ static void wmSetPixelFormat(WMesaFramebuffer pwfb, HDC hDC) /* Only 16 and 32 bit targets are supported now */ assert(pwfb->cColorBits == 0 || pwfb->cColorBits == 16 || + pwfb->cColorBits == 24 || pwfb->cColorBits == 32); switch(pwfb->cColorBits){ @@ -127,6 +128,7 @@ static void wmSetPixelFormat(WMesaFramebuffer pwfb, HDC hDC) case 16: pwfb->pixelformat = PF_5R6G5B; break; + case 24: case 32: pwfb->pixelformat = PF_8R8G8B; break; @@ -856,6 +858,195 @@ static void read_rgba_pixels_32(const GLcontext *ctx, /*********************************************************************/ +/* DOUBLE BUFFER 24-bit */ + +#define WMSETPIXEL24(pwc, y, x, r, g, b) { \ +LPBYTE lpb = ((LPBYTE)((pwc)->pbPixels + (pwc)->ScanWidth * (y)) + (3 * x)); \ +lpb[0] = (b); \ +lpb[1] = (g); \ +lpb[2] = (r); } + +/* Write a horizontal span of RGBA color pixels with a boolean mask. */ +static void write_rgba_span_24(const GLcontext *ctx, + struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, + const GLubyte rgba[][4], + const GLubyte mask[] ) +{ + WMesaContext pwc = wmesa_context(ctx); + WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer); + GLuint i; + LPBYTE lpb; + + (void) ctx; + + y=FLIP(y); + lpb = ((LPBYTE)(pwfb->pbPixels + pwfb->ScanWidth * y)) + (3 * x); + if (mask) { + for (i=0; i<n; i++) + if (mask[i]) { + lpb[3*i] = rgba[i][BCOMP]; + lpb[3*i+1] = rgba[i][GCOMP]; + lpb[3*i+2] = rgba[i][RCOMP]; + } + } + else { + for (i=0; i<n; i++) { + *lpb++ = rgba[i][BCOMP]; + *lpb++ = rgba[i][GCOMP]; + *lpb++ = rgba[i][RCOMP]; + } + } +} + + +/* Write a horizontal span of RGB color pixels with a boolean mask. */ +static void write_rgb_span_24(const GLcontext *ctx, + struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, + const GLubyte rgb[][3], + const GLubyte mask[] ) +{ + WMesaContext pwc = wmesa_context(ctx); + WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer); + GLuint i; + LPBYTE lpb; + + (void) ctx; + + y=FLIP(y); + lpb = ((LPBYTE)(pwfb->pbPixels + pwfb->ScanWidth * y)) + (3 * x); + if (mask) { + for (i=0; i<n; i++) + if (mask[i]) { + lpb[3*i] = rgb[i][BCOMP]; + lpb[3*i+1] = rgb[i][GCOMP]; + lpb[3*i+2] = rgb[i][RCOMP]; + } + } + else { + for (i=0; i<n; i++) { + *lpb++ = rgb[i][BCOMP]; + *lpb++ = rgb[i][GCOMP]; + *lpb++ = rgb[i][RCOMP]; + } + } +} + +/* + * Write a horizontal span of pixels with a boolean mask. The current color + * is used for all pixels. + */ +static void write_mono_rgba_span_24(const GLcontext *ctx, + struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, + const GLchan color[4], + const GLubyte mask[]) +{ + LPBYTE lpb; + GLuint i; + WMesaContext pwc = wmesa_context(ctx); + WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer); + lpb = ((LPBYTE)(pwfb->pbPixels + pwfb->ScanWidth * y)) + (3 * x); + y=FLIP(y); + if (mask) { + for (i=0; i<n; i++) + if (mask[i]) { + lpb[3*i] = color[BCOMP]; + lpb[3*i+1] = color[GCOMP]; + lpb[3*i+2] = color[RCOMP]; + } + } + else + for (i=0; i<n; i++) { + *lpb++ = color[BCOMP]; + *lpb++ = color[GCOMP]; + *lpb++ = color[RCOMP]; + } +} + +/* Write an array of RGBA pixels with a boolean mask. */ +static void write_rgba_pixels_24(const GLcontext *ctx, + struct gl_renderbuffer *rb, + GLuint n, const GLint x[], const GLint y[], + const GLubyte rgba[][4], + const GLubyte mask[]) +{ + GLuint i; + WMesaContext pwc = wmesa_context(ctx); + WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer); + for (i=0; i<n; i++) + if (mask[i]) + WMSETPIXEL24(pwfb, FLIP(y[i]), x[i], + rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP]); +} + +/* + * Write an array of pixels with a boolean mask. The current color + * is used for all pixels. + */ +static void write_mono_rgba_pixels_24(const GLcontext *ctx, + struct gl_renderbuffer *rb, + GLuint n, + const GLint x[], const GLint y[], + const GLchan color[4], + const GLubyte mask[]) +{ + GLuint i; + WMesaContext pwc = wmesa_context(ctx); + WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer); + for (i=0; i<n; i++) + if (mask[i]) + WMSETPIXEL24(pwfb, FLIP(y[i]),x[i],color[RCOMP], + color[GCOMP], color[BCOMP]); +} + +/* Read a horizontal span of color pixels. */ +static void read_rgba_span_24(const GLcontext *ctx, + struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, + GLubyte rgba[][4] ) +{ + GLuint i; + LPBYTE lpb; + WMesaContext pwc = wmesa_context(ctx); + WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer); + + y = FLIP(y); + lpb = ((LPBYTE)(pwfb->pbPixels + pwfb->ScanWidth * y)) + (3 * x); + for (i=0; i<n; i++) { + rgba[i][RCOMP] = lpb[3*i+2]; + rgba[i][GCOMP] = lpb[3*i+1]; + rgba[i][BCOMP] = lpb[3*i]; + rgba[i][ACOMP] = 255; + } +} + + +/* Read an array of color pixels. */ +static void read_rgba_pixels_24(const GLcontext *ctx, + struct gl_renderbuffer *rb, + GLuint n, const GLint x[], const GLint y[], + GLubyte rgba[][4]) +{ + GLuint i; + LPBYTE lpb; + WMesaContext pwc = wmesa_context(ctx); + WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer); + + for (i=0; i<n; i++) { + GLint y2 = FLIP(y[i]); + lpb = ((LPBYTE)(pwfb->pbPixels + pwfb->ScanWidth * y2)) + (3 * x[i]); + rgba[i][RCOMP] = lpb[3*i+2]; + rgba[i][GCOMP] = lpb[3*i+1]; + rgba[i][BCOMP] = lpb[3*i]; + rgba[i][ACOMP] = 255; + } +} + + +/*********************************************************************/ + /* DOUBLE BUFFER 16-bit */ #define WMSETPIXEL16(pwc, y, x, r, g, b) { \ @@ -1077,7 +1268,7 @@ wmesa_renderbuffer_storage(GLcontext *ctx, * on if we're drawing to the front or back color buffer. */ void wmesa_set_renderbuffer_funcs(struct gl_renderbuffer *rb, int pixelformat, - int double_buffer) + BYTE cColorBits, int double_buffer) { if (double_buffer) { /* back buffer */ @@ -1097,16 +1288,32 @@ void wmesa_set_renderbuffer_funcs(struct gl_renderbuffer *rb, int pixelformat, rb->BlueBits = 5; break; case PF_8R8G8B: - rb->PutRow = write_rgba_span_32; - rb->PutRowRGB = write_rgb_span_32; - rb->PutMonoRow = write_mono_rgba_span_32; - rb->PutValues = write_rgba_pixels_32; - rb->PutMonoValues = write_mono_rgba_pixels_32; - rb->GetRow = read_rgba_span_32; - rb->GetValues = read_rgba_pixels_32; + if (cColorBits == 24) + { + rb->PutRow = write_rgba_span_24; + rb->PutRowRGB = write_rgb_span_24; + rb->PutMonoRow = write_mono_rgba_span_24; + rb->PutValues = write_rgba_pixels_24; + rb->PutMonoValues = write_mono_rgba_pixels_24; + rb->GetRow = read_rgba_span_24; + rb->GetValues = read_rgba_pixels_24; + rb->RedBits = 8; + rb->GreenBits = 8; + rb->BlueBits = 8; + } + else + { + rb->PutRow = write_rgba_span_32; + rb->PutRowRGB = write_rgb_span_32; + rb->PutMonoRow = write_mono_rgba_span_32; + rb->PutValues = write_rgba_pixels_32; + rb->PutMonoValues = write_mono_rgba_pixels_32; + rb->GetRow = read_rgba_span_32; + rb->GetValues = read_rgba_pixels_32; rb->RedBits = 8; rb->GreenBits = 8; rb->BlueBits = 8; + } break; default: break; @@ -1413,11 +1620,11 @@ void WMesaMakeCurrent(WMesaContext c, HDC hdc) if (visual->doubleBufferMode == 1) { rb = wmesa_new_renderbuffer(); _mesa_add_renderbuffer(&pwfb->Base, BUFFER_BACK_LEFT, rb); - wmesa_set_renderbuffer_funcs(rb, pwfb->pixelformat, 1); + wmesa_set_renderbuffer_funcs(rb, pwfb->pixelformat, pwfb->cColorBits, 1); } rb = wmesa_new_renderbuffer(); _mesa_add_renderbuffer(&pwfb->Base, BUFFER_FRONT_LEFT, rb); - wmesa_set_renderbuffer_funcs(rb, pwfb->pixelformat, 0); + wmesa_set_renderbuffer_funcs(rb, pwfb->pixelformat, pwfb->cColorBits, 0); /* Let Mesa own the Depth, Stencil, and Accum buffers */ _mesa_add_soft_renderbuffers(&pwfb->Base, diff --git a/src/mesa/drivers/windows/gldirect/dx7/gld_vb_mesa_render_dx7.c b/src/mesa/drivers/windows/gldirect/dx7/gld_vb_mesa_render_dx7.c index ecc40e8f8b..72e5e1308c 100644 --- a/src/mesa/drivers/windows/gldirect/dx7/gld_vb_mesa_render_dx7.c +++ b/src/mesa/drivers/windows/gldirect/dx7/gld_vb_mesa_render_dx7.c @@ -1,4 +1,3 @@ -/* $Id: gld_vb_mesa_render_dx7.c,v 1.6 2005/08/27 13:56:08 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/drivers/windows/gldirect/dx8/gld_vb_mesa_render_dx8.c b/src/mesa/drivers/windows/gldirect/dx8/gld_vb_mesa_render_dx8.c index 414a2f64bf..9ab562010c 100644 --- a/src/mesa/drivers/windows/gldirect/dx8/gld_vb_mesa_render_dx8.c +++ b/src/mesa/drivers/windows/gldirect/dx8/gld_vb_mesa_render_dx8.c @@ -1,4 +1,3 @@ -/* $Id: gld_vb_mesa_render_dx8.c,v 1.6 2005/08/27 13:56:08 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/drivers/windows/gldirect/dx9/gld_vb_mesa_render_dx9.c b/src/mesa/drivers/windows/gldirect/dx9/gld_vb_mesa_render_dx9.c index c71fdefbae..64acab2d2a 100644 --- a/src/mesa/drivers/windows/gldirect/dx9/gld_vb_mesa_render_dx9.c +++ b/src/mesa/drivers/windows/gldirect/dx9/gld_vb_mesa_render_dx9.c @@ -1,4 +1,3 @@ -/* $Id: gld_vb_mesa_render_dx9.c,v 1.6 2005/08/27 13:56:08 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/drivers/windows/gldirect/gld_debug_clip.c b/src/mesa/drivers/windows/gldirect/gld_debug_clip.c index 1eb19ca84b..044d2e66f4 100644 --- a/src/mesa/drivers/windows/gldirect/gld_debug_clip.c +++ b/src/mesa/drivers/windows/gldirect/gld_debug_clip.c @@ -1,4 +1,3 @@ -/* $Id: gld_debug_clip.c,v 1.1 2004/04/20 11:13:11 alanh Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/drivers/windows/gldirect/gld_debug_norm.c b/src/mesa/drivers/windows/gldirect/gld_debug_norm.c index 00c428bd26..c20362bb24 100644 --- a/src/mesa/drivers/windows/gldirect/gld_debug_norm.c +++ b/src/mesa/drivers/windows/gldirect/gld_debug_norm.c @@ -1,4 +1,3 @@ -/* $Id: gld_debug_norm.c,v 1.1 2004/04/20 11:13:11 alanh Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/drivers/windows/gldirect/gld_debug_xform.c b/src/mesa/drivers/windows/gldirect/gld_debug_xform.c index d6e64b8ffd..73439dc3b6 100644 --- a/src/mesa/drivers/windows/gldirect/gld_debug_xform.c +++ b/src/mesa/drivers/windows/gldirect/gld_debug_xform.c @@ -1,4 +1,3 @@ -/* $Id: gld_debug_xform.c,v 1.1 2004/04/20 11:13:11 alanh Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/drivers/windows/gldirect/mesasw/colors.h b/src/mesa/drivers/windows/gldirect/mesasw/colors.h index 17371a96cc..9c1f2a0540 100644 --- a/src/mesa/drivers/windows/gldirect/mesasw/colors.h +++ b/src/mesa/drivers/windows/gldirect/mesasw/colors.h @@ -18,12 +18,11 @@ * (mark@rsinc.com). */ -/* $Log: ddcolors.h 1997/6/14 by Li Wei(liwei@aiar.xjtu.edu.cn) +/* * Macros for pixel format defined */ /* - * $Log: colors.h,v $ * Revision 1.1 2004/04/20 11:13:11 alanh * add SciTech's GLDirect driver for Windows. * @@ -46,7 +45,6 @@ */ /* - * $Log: colors.h,v $ * Revision 1.1 2004/04/20 11:13:11 alanh * add SciTech's GLDirect driver for Windows. * @@ -69,7 +67,6 @@ */ /* - * $Log: colors.h,v $ * Revision 1.1 2004/04/20 11:13:11 alanh * add SciTech's GLDirect driver for Windows. * @@ -520,4 +517,4 @@ char unsigned const aWinGHalftoneTranslation[216] = 225, 226, 255, -};
\ No newline at end of file +}; diff --git a/src/mesa/drivers/x11/Makefile b/src/mesa/drivers/x11/Makefile index b025246e63..d2780e62c9 100644 --- a/src/mesa/drivers/x11/Makefile +++ b/src/mesa/drivers/x11/Makefile @@ -58,6 +58,7 @@ $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME): $(OBJECTS) $(CORE_MESA) @ $(MKLIB) -o $(GL_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \ -major $(GL_MAJOR) -minor $(GL_MINOR) -patch $(GL_TINY) \ -install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) \ + -id $(INSTALL_LIB_DIR)/lib$(GL_LIB).$(GL_MAJOR).dylib \ $(GL_LIB_DEPS) $(OBJECTS) $(CORE_MESA) diff --git a/src/mesa/drivers/x11/fakeglx.c b/src/mesa/drivers/x11/fakeglx.c index e5cd8f0b80..827d39f995 100644 --- a/src/mesa/drivers/x11/fakeglx.c +++ b/src/mesa/drivers/x11/fakeglx.c @@ -43,12 +43,12 @@ #include "glxheader.h" #include "glxapi.h" #include "GL/xmesa.h" -#include "context.h" -#include "config.h" -#include "macros.h" -#include "imports.h" -#include "mtypes.h" -#include "version.h" +#include "main/context.h" +#include "main/config.h" +#include "main/macros.h" +#include "main/imports.h" +#include "main/mtypes.h" +#include "main/version.h" #include "xfonts.h" #include "xmesaP.h" diff --git a/src/mesa/drivers/x11/glxheader.h b/src/mesa/drivers/x11/glxheader.h index 15e8390583..d88afba20e 100644 --- a/src/mesa/drivers/x11/glxheader.h +++ b/src/mesa/drivers/x11/glxheader.h @@ -30,7 +30,7 @@ #include <GL/vms_x_fix.h> #endif -#include "glheader.h" +#include "main/glheader.h" #ifdef XFree86Server diff --git a/src/mesa/drivers/x11/xfonts.c b/src/mesa/drivers/x11/xfonts.c index d72c600bd1..f732c94586 100644 --- a/src/mesa/drivers/x11/xfonts.c +++ b/src/mesa/drivers/x11/xfonts.c @@ -33,8 +33,8 @@ #endif #include "glxheader.h" -#include "context.h" -#include "imports.h" +#include "main/context.h" +#include "main/imports.h" #include "xfonts.h" diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c index 5bae69a472..c9009bad03 100644 --- a/src/mesa/drivers/x11/xm_api.c +++ b/src/mesa/drivers/x11/xm_api.c @@ -68,11 +68,11 @@ #include "main/context.h" #include "main/extensions.h" #include "main/framebuffer.h" -#include "glapi/glthread.h" #include "main/imports.h" #include "main/macros.h" #include "main/renderbuffer.h" #include "main/teximage.h" +#include "glapi/glthread.h" #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" #include "vbo/vbo.h" diff --git a/src/mesa/drivers/x11/xm_buffer.c b/src/mesa/drivers/x11/xm_buffer.c index 51d183bb43..f104d44d05 100644 --- a/src/mesa/drivers/x11/xm_buffer.c +++ b/src/mesa/drivers/x11/xm_buffer.c @@ -32,9 +32,9 @@ #include "glxheader.h" #include "GL/xmesa.h" #include "xmesaP.h" -#include "imports.h" -#include "framebuffer.h" -#include "renderbuffer.h" +#include "main/imports.h" +#include "main/framebuffer.h" +#include "main/renderbuffer.h" #if defined(USE_XSHM) && !defined(XFree86Server) diff --git a/src/mesa/drivers/x11/xm_dd.c b/src/mesa/drivers/x11/xm_dd.c index 54acbfe3cb..305df548fa 100644 --- a/src/mesa/drivers/x11/xm_dd.c +++ b/src/mesa/drivers/x11/xm_dd.c @@ -29,29 +29,29 @@ */ #include "glxheader.h" -#include "bufferobj.h" -#include "buffers.h" -#include "context.h" -#include "colormac.h" -#include "depth.h" -#include "drawpix.h" -#include "extensions.h" -#include "framebuffer.h" -#include "macros.h" -#include "image.h" -#include "imports.h" -#include "mtypes.h" -#include "state.h" -#include "texobj.h" -#include "teximage.h" -#include "texstore.h" -#include "texformat.h" -#include "xmesaP.h" +#include "main/bufferobj.h" +#include "main/buffers.h" +#include "main/context.h" +#include "main/colormac.h" +#include "main/depth.h" +#include "main/drawpix.h" +#include "main/extensions.h" +#include "main/framebuffer.h" +#include "main/macros.h" +#include "main/image.h" +#include "main/imports.h" +#include "main/mtypes.h" +#include "main/state.h" +#include "main/texobj.h" +#include "main/teximage.h" +#include "main/texstore.h" +#include "main/texformat.h" #include "swrast/swrast.h" #include "swrast/s_context.h" #include "swrast_setup/swrast_setup.h" #include "tnl/tnl.h" #include "tnl/t_context.h" +#include "xmesaP.h" @@ -1086,9 +1086,9 @@ xmesa_new_query_object(GLcontext *ctx, GLuint id) static void -xmesa_begin_query(GLcontext *ctx, GLenum target, struct gl_query_object *q) +xmesa_begin_query(GLcontext *ctx, struct gl_query_object *q) { - if (target == GL_TIME_ELAPSED_EXT) { + if (q->Target == GL_TIME_ELAPSED_EXT) { struct xmesa_query_object *xq = (struct xmesa_query_object *) q; (void) gettimeofday(&xq->StartTime, NULL); } @@ -1113,9 +1113,9 @@ time_diff(const struct timeval *t0, const struct timeval *t1) static void -xmesa_end_query(GLcontext *ctx, GLenum target, struct gl_query_object *q) +xmesa_end_query(GLcontext *ctx, struct gl_query_object *q) { - if (target == GL_TIME_ELAPSED_EXT) { + if (q->Target == GL_TIME_ELAPSED_EXT) { struct xmesa_query_object *xq = (struct xmesa_query_object *) q; struct timeval endTime; (void) gettimeofday(&endTime, NULL); diff --git a/src/mesa/drivers/x11/xm_line.c b/src/mesa/drivers/x11/xm_line.c index 9833b4c9f0..f643b6d3a7 100644 --- a/src/mesa/drivers/x11/xm_line.c +++ b/src/mesa/drivers/x11/xm_line.c @@ -31,9 +31,9 @@ #include "glxheader.h" -#include "depth.h" -#include "macros.h" -#include "mtypes.h" +#include "main/depth.h" +#include "main/macros.h" +#include "main/mtypes.h" #include "xmesaP.h" /* Internal swrast includes: diff --git a/src/mesa/drivers/x11/xm_span.c b/src/mesa/drivers/x11/xm_span.c index a24966b3ae..57b5749448 100644 --- a/src/mesa/drivers/x11/xm_span.c +++ b/src/mesa/drivers/x11/xm_span.c @@ -23,15 +23,15 @@ */ #include "glxheader.h" -#include "colormac.h" -#include "context.h" -#include "depth.h" -#include "drawpix.h" -#include "extensions.h" -#include "macros.h" -#include "imports.h" -#include "mtypes.h" -#include "state.h" +#include "main/colormac.h" +#include "main/context.h" +#include "main/depth.h" +#include "main/drawpix.h" +#include "main/extensions.h" +#include "main/macros.h" +#include "main/imports.h" +#include "main/mtypes.h" +#include "main/state.h" #include "xmesaP.h" #include "swrast/swrast.h" diff --git a/src/mesa/drivers/x11/xm_tri.c b/src/mesa/drivers/x11/xm_tri.c index 77fceec194..3a0cf80139 100644 --- a/src/mesa/drivers/x11/xm_tri.c +++ b/src/mesa/drivers/x11/xm_tri.c @@ -30,11 +30,11 @@ */ +#include "main/depth.h" +#include "main/macros.h" +#include "main/imports.h" +#include "main/mtypes.h" #include "glxheader.h" -#include "depth.h" -#include "macros.h" -#include "imports.h" -#include "mtypes.h" #include "xmesaP.h" /* Internal swrast includes: diff --git a/src/mesa/drivers/x11/xmesaP.h b/src/mesa/drivers/x11/xmesaP.h index 95c41c3a41..98867ac710 100644 --- a/src/mesa/drivers/x11/xmesaP.h +++ b/src/mesa/drivers/x11/xmesaP.h @@ -28,7 +28,7 @@ #include "GL/xmesa.h" -#include "mtypes.h" +#include "main/mtypes.h" #if defined(FX) #include "GL/fxmesa.h" #include "xm_glide.h" diff --git a/src/mesa/glapi/dispatch.h b/src/mesa/glapi/dispatch.h index 7123156085..98f654f402 100644 --- a/src/mesa/glapi/dispatch.h +++ b/src/mesa/glapi/dispatch.h @@ -28,6 +28,9 @@ #if !defined( _DISPATCH_H_ ) # define _DISPATCH_H_ +#include "glapitable.h" + + /** * \file dispatch.h * Macros for handling GL dispatch tables. diff --git a/src/mesa/glapi/gl_table.py b/src/mesa/glapi/gl_table.py index 69f7bd7c7b..7023a4b71a 100644 --- a/src/mesa/glapi/gl_table.py +++ b/src/mesa/glapi/gl_table.py @@ -56,7 +56,6 @@ class PrintGlTable(gl_XML.gl_print_base): print '# define GLAPIENTRYP GLAPIENTRY *' print '#endif' print '' - print 'typedef void (*_glapi_proc)(void); /* generic function pointer */' print '' print 'struct _glapi_table' print '{' diff --git a/src/mesa/glapi/gl_x86_asm.py b/src/mesa/glapi/gl_x86_asm.py index 403e87261b..651cb03f14 100644 --- a/src/mesa/glapi/gl_x86_asm.py +++ b/src/mesa/glapi/gl_x86_asm.py @@ -51,7 +51,7 @@ class PrintGenericStubs(gl_XML.gl_print_base): def printRealHeader(self): print '#include "assyntax.h"' - print '#include "glapioffsets.h"' + print '#include "glapi/glapioffsets.h"' print '' print '#if defined(STDCALL_API)' print '# if defined(USE_MGL_NAMESPACE)' diff --git a/src/mesa/glapi/glapi.c b/src/mesa/glapi/glapi.c index 08a26980e1..c3ebf60719 100644 --- a/src/mesa/glapi/glapi.c +++ b/src/mesa/glapi/glapi.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.5 + * Version: 7.1 * - * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2008 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"), @@ -57,7 +57,7 @@ #else -#include "glheader.h" +#include "main/glheader.h" #endif @@ -71,18 +71,12 @@ #include "glapioffsets.h" #include "glapitable.h" + /***** BEGIN NO-OP DISPATCH *****/ static GLboolean WarnFlag = GL_FALSE; static _glapi_warning_func warning_func; -#if defined(PTHREADS) || defined(GLX_USE_TLS) -static void init_glapi_relocs(void); -#endif - -static _glapi_proc generate_entrypoint(GLuint functionOffset); -static void fill_in_entrypoint_offset(_glapi_proc entrypoint, GLuint offset); - /* * Enable/disable printing of warning messages. */ @@ -221,21 +215,6 @@ PUBLIC void *_glapi_Context = NULL; /*@}*/ -/** - * strdup() is actually not a standard ANSI C or POSIX routine. - * Irix will not define it if ANSI mode is in effect. - */ -static char * -str_dup(const char *str) -{ - char *copy; - copy = (char*) malloc(strlen(str) + 1); - if (!copy) - return NULL; - strcpy(copy, str); - return copy; -} - /** @@ -311,6 +290,56 @@ _glapi_get_context(void) #endif } +#ifdef USE_X86_ASM + +#if defined( GLX_USE_TLS ) +extern GLubyte gl_dispatch_functions_start[]; +extern GLubyte gl_dispatch_functions_end[]; +#else +extern const GLubyte gl_dispatch_functions_start[]; +#endif + +#endif /* USE_X86_ASM */ + + +#if defined(USE_X64_64_ASM) && defined(GLX_USE_TLS) +# define DISPATCH_FUNCTION_SIZE 16 +#elif defined(USE_X86_ASM) +# if defined(THREADS) && !defined(GLX_USE_TLS) +# define DISPATCH_FUNCTION_SIZE 32 +# else +# define DISPATCH_FUNCTION_SIZE 16 +# endif +#endif + +#if !defined(DISPATCH_FUNCTION_SIZE) && !defined(XFree86Server) && !defined(XGLServer) +# define NEED_FUNCTION_POINTER +#endif + +#if defined(PTHREADS) || defined(GLX_USE_TLS) +/** + * Perform platform-specific GL API entry-point fixups. + */ +static void +init_glapi_relocs( void ) +{ +#if defined(USE_X86_ASM) && defined(GLX_USE_TLS) && !defined(GLX_X86_READONLY_TEXT) + extern unsigned long _x86_get_dispatch(void); + char run_time_patch[] = { + 0x65, 0xa1, 0, 0, 0, 0 /* movl %gs:0,%eax */ + }; + GLuint *offset = (GLuint *) &run_time_patch[2]; /* 32-bits for x86/32 */ + const GLubyte * const get_disp = (const GLubyte *) run_time_patch; + GLubyte * curr_func = (GLubyte *) gl_dispatch_functions_start; + + *offset = _x86_get_dispatch(); + while ( curr_func != (GLubyte *) gl_dispatch_functions_end ) { + (void) memcpy( curr_func, get_disp, sizeof(run_time_patch)); + curr_func += DISPATCH_FUNCTION_SIZE; + } +#endif +} +#endif /* defined(PTHREADS) || defined(GLX_USE_TLS) */ /** @@ -369,132 +398,6 @@ _glapi_get_dispatch(void) -/*** - *** The rest of this file is pretty much concerned with GetProcAddress - *** functionality. - ***/ - -#if defined(USE_X64_64_ASM) && defined(GLX_USE_TLS) -# define DISPATCH_FUNCTION_SIZE 16 -#elif defined(USE_X86_ASM) -# if defined(THREADS) && !defined(GLX_USE_TLS) -# define DISPATCH_FUNCTION_SIZE 32 -# else -# define DISPATCH_FUNCTION_SIZE 16 -# endif -#endif - -#if !defined(DISPATCH_FUNCTION_SIZE) && !defined(XFree86Server) && !defined(XGLServer) -# define NEED_FUNCTION_POINTER -#endif - -/* The code in this file is auto-generated with Python */ -#include "glprocs.h" - - -/** - * Search the table of static entrypoint functions for the named function - * and return the corresponding glprocs_table_t entry. - */ -static const glprocs_table_t * -find_entry( const char * n ) -{ - GLuint i; - for (i = 0; static_functions[i].Name_offset >= 0; i++) { - const char *testName = gl_string_table + static_functions[i].Name_offset; - if (strcmp(testName, n) == 0) { - return &static_functions[i]; - } - } - return NULL; -} - - -/** - * Return dispatch table offset of the named static (built-in) function. - * Return -1 if function not found. - */ -static GLint -get_static_proc_offset(const char *funcName) -{ - const glprocs_table_t * const f = find_entry( funcName ); - if (f) { - return f->Offset; - } - return -1; -} - - -#if !defined(XFree86Server) && !defined(XGLServer) -#ifdef USE_X86_ASM - -#if defined( GLX_USE_TLS ) -extern GLubyte gl_dispatch_functions_start[]; -extern GLubyte gl_dispatch_functions_end[]; -#else -extern const GLubyte gl_dispatch_functions_start[]; -#endif - -#endif /* USE_X86_ASM */ - - -/** - * Return dispatch function address for the named static (built-in) function. - * Return NULL if function not found. - */ -static _glapi_proc -get_static_proc_address(const char *funcName) -{ - const glprocs_table_t * const f = find_entry( funcName ); - if (f) { -#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 - return f->Address; -#endif - } - else { - return NULL; - } -} - -#endif /* !defined(XFree86Server) && !defined(XGLServer) */ - - - -/** - * Return the name of the function at the given offset in the dispatch - * table. For debugging only. - */ -static const char * -get_static_proc_name( GLuint offset ) -{ - GLuint i; - for (i = 0; static_functions[i].Name_offset >= 0; i++) { - if (static_functions[i].Offset == offset) { - return gl_string_table + static_functions[i].Name_offset; - } - } - return NULL; -} - - - -/********************************************************************** - * Extension function management. - */ - -/* - * Number of extension functions which we can dynamically add at runtime. - */ -#define MAX_EXTENSION_FUNCS 300 - /* * The dispatch table size (number of entries) is the size of the @@ -506,450 +409,6 @@ get_static_proc_name( GLuint offset ) /** - * Track information about a function added to the GL API. - */ -struct _glapi_function { - /** - * Name of the function. - */ - const char * name; - - - /** - * Text string that describes the types of the parameters passed to the - * named function. Parameter types are converted to characters using the - * following rules: - * - 'i' for \c GLint, \c GLuint, and \c GLenum - * - 'p' for any pointer type - * - 'f' for \c GLfloat and \c GLclampf - * - 'd' for \c GLdouble and \c GLclampd - */ - const char * parameter_signature; - - - /** - * Offset in the dispatch table where the pointer to the real function is - * located. If the driver has not requested that the named function be - * added to the dispatch table, this will have the value ~0. - */ - unsigned dispatch_offset; - - - /** - * Pointer to the dispatch stub for the named function. - * - * \todo - * The semantic of this field should be changed slightly. Currently, it - * is always expected to be non-\c NULL. However, it would be better to - * only allocate the entry-point stub when the application requests the - * function via \c glXGetProcAddress. This would save memory for all the - * functions that the driver exports but that the application never wants - * to call. - */ - _glapi_proc dispatch_stub; -}; - - -static struct _glapi_function ExtEntryTable[MAX_EXTENSION_FUNCS]; -static GLuint NumExtEntryPoints = 0; - -#ifdef USE_SPARC_ASM -extern void __glapi_sparc_icache_flush(unsigned int *); -#endif - -/** - * Generate a dispatch function (entrypoint) which jumps through - * the given slot number (offset) in the current dispatch table. - * We need assembly language in order to accomplish this. - */ -static _glapi_proc -generate_entrypoint(GLuint functionOffset) -{ -#if defined(USE_X86_ASM) - /* 32 is chosen as something of a magic offset. For x86, the dispatch - * at offset 32 is the first one where the offset in the - * "jmp OFFSET*4(%eax)" can't be encoded in a single byte. - */ - const GLubyte * const template_func = gl_dispatch_functions_start - + (DISPATCH_FUNCTION_SIZE * 32); - GLubyte * const code = (GLubyte *) malloc(DISPATCH_FUNCTION_SIZE); - - - if ( code != NULL ) { - (void) memcpy(code, template_func, DISPATCH_FUNCTION_SIZE); - fill_in_entrypoint_offset( (_glapi_proc) code, functionOffset ); - } - - return (_glapi_proc) code; -#elif defined(USE_SPARC_ASM) - -#ifdef __arch64__ - static const unsigned int insn_template[] = { - 0x05000000, /* sethi %uhi(_glapi_Dispatch), %g2 */ - 0x03000000, /* sethi %hi(_glapi_Dispatch), %g1 */ - 0x8410a000, /* or %g2, %ulo(_glapi_Dispatch), %g2 */ - 0x82106000, /* or %g1, %lo(_glapi_Dispatch), %g1 */ - 0x8528b020, /* sllx %g2, 32, %g2 */ - 0xc2584002, /* ldx [%g1 + %g2], %g1 */ - 0x05000000, /* sethi %hi(8 * glapioffset), %g2 */ - 0x8410a000, /* or %g2, %lo(8 * glapioffset), %g2 */ - 0xc6584002, /* ldx [%g1 + %g2], %g3 */ - 0x81c0c000, /* jmpl %g3, %g0 */ - 0x01000000 /* nop */ - }; -#else - static const unsigned int insn_template[] = { - 0x03000000, /* sethi %hi(_glapi_Dispatch), %g1 */ - 0xc2006000, /* ld [%g1 + %lo(_glapi_Dispatch)], %g1 */ - 0xc6006000, /* ld [%g1 + %lo(4*glapioffset)], %g3 */ - 0x81c0c000, /* jmpl %g3, %g0 */ - 0x01000000 /* nop */ - }; -#endif /* __arch64__ */ - unsigned int *code = (unsigned int *) malloc(sizeof(insn_template)); - unsigned long glapi_addr = (unsigned long) &_glapi_Dispatch; - if (code) { - memcpy(code, insn_template, sizeof(insn_template)); - -#ifdef __arch64__ - code[0] |= (glapi_addr >> (32 + 10)); - code[1] |= ((glapi_addr & 0xffffffff) >> 10); - __glapi_sparc_icache_flush(&code[0]); - code[2] |= ((glapi_addr >> 32) & ((1 << 10) - 1)); - code[3] |= (glapi_addr & ((1 << 10) - 1)); - __glapi_sparc_icache_flush(&code[2]); - code[6] |= ((functionOffset * 8) >> 10); - code[7] |= ((functionOffset * 8) & ((1 << 10) - 1)); - __glapi_sparc_icache_flush(&code[6]); -#else - code[0] |= (glapi_addr >> 10); - code[1] |= (glapi_addr & ((1 << 10) - 1)); - __glapi_sparc_icache_flush(&code[0]); - code[2] |= (functionOffset * 4); - __glapi_sparc_icache_flush(&code[2]); -#endif /* __arch64__ */ - } - return (_glapi_proc) code; -#else - (void) functionOffset; - return NULL; -#endif /* USE_*_ASM */ -} - - -/** - * This function inserts a new dispatch offset into the assembly language - * stub that was generated with the preceeding function. - */ -static void -fill_in_entrypoint_offset(_glapi_proc entrypoint, GLuint offset) -{ -#if defined(USE_X86_ASM) - GLubyte * const code = (GLubyte *) entrypoint; - -#if DISPATCH_FUNCTION_SIZE == 32 - *((unsigned int *)(code + 11)) = 4 * offset; - *((unsigned int *)(code + 22)) = 4 * offset; -#elif DISPATCH_FUNCTION_SIZE == 16 && defined( GLX_USE_TLS ) - *((unsigned int *)(code + 8)) = 4 * offset; -#elif DISPATCH_FUNCTION_SIZE == 16 - *((unsigned int *)(code + 7)) = 4 * offset; -#else -# error Invalid DISPATCH_FUNCTION_SIZE! -#endif - -#elif defined(USE_SPARC_ASM) - - /* XXX this hasn't been tested! */ - unsigned int *code = (unsigned int *) entrypoint; -#ifdef __arch64__ - code[6] = 0x05000000; /* sethi %hi(8 * glapioffset), %g2 */ - code[7] = 0x8410a000; /* or %g2, %lo(8 * glapioffset), %g2 */ - code[6] |= ((offset * 8) >> 10); - code[7] |= ((offset * 8) & ((1 << 10) - 1)); - __glapi_sparc_icache_flush(&code[6]); -#else /* __arch64__ */ - code[2] = 0xc6006000; /* ld [%g1 + %lo(4*glapioffset)], %g3 */ - code[2] |= (offset * 4); - __glapi_sparc_icache_flush(&code[2]); -#endif /* __arch64__ */ - -#else - - /* an unimplemented architecture */ - (void) entrypoint; - (void) offset; - -#endif /* USE_*_ASM */ -} - - -/** - * Generate new entrypoint - * - * Use a temporary dispatch offset of ~0 (i.e. -1). Later, when the driver - * calls \c _glapi_add_dispatch we'll put in the proper offset. If that - * never happens, and the user calls this function, he'll segfault. That's - * what you get when you try calling a GL function that doesn't really exist. - * - * \param funcName Name of the function to create an entry-point for. - * - * \sa _glapi_add_entrypoint - */ - -static struct _glapi_function * -add_function_name( const char * funcName ) -{ - struct _glapi_function * entry = NULL; - - if (NumExtEntryPoints < MAX_EXTENSION_FUNCS) { - _glapi_proc entrypoint = generate_entrypoint(~0); - if (entrypoint != NULL) { - entry = & ExtEntryTable[NumExtEntryPoints]; - - ExtEntryTable[NumExtEntryPoints].name = str_dup(funcName); - ExtEntryTable[NumExtEntryPoints].parameter_signature = NULL; - ExtEntryTable[NumExtEntryPoints].dispatch_offset = ~0; - ExtEntryTable[NumExtEntryPoints].dispatch_stub = entrypoint; - NumExtEntryPoints++; - } - } - - return entry; -} - - -/** - * Fill-in the dispatch stub for the named function. - * - * This function is intended to be called by a hardware driver. When called, - * a dispatch stub may be created created for the function. A pointer to this - * dispatch function will be returned by glXGetProcAddress. - * - * \param function_names Array of pointers to function names that should - * share a common dispatch offset. - * \param parameter_signature String representing the types of the parameters - * passed to the named function. Parameter types - * are converted to characters using the following - * rules: - * - 'i' for \c GLint, \c GLuint, and \c GLenum - * - 'p' for any pointer type - * - 'f' for \c GLfloat and \c GLclampf - * - 'd' for \c GLdouble and \c GLclampd - * - * \returns - * The offset in the dispatch table of the named function. A pointer to the - * driver's implementation of the named function should be stored at - * \c dispatch_table[\c offset]. Return -1 if error/problem. - * - * \sa glXGetProcAddress - * - * \warning - * This function can only handle up to 8 names at a time. As far as I know, - * the maximum number of names ever associated with an existing GL function is - * 4 (\c glPointParameterfSGIS, \c glPointParameterfEXT, - * \c glPointParameterfARB, and \c glPointParameterf), so this should not be - * too painful of a limitation. - * - * \todo - * Determine whether or not \c parameter_signature should be allowed to be - * \c NULL. It doesn't seem like much of a hardship for drivers to have to - * pass in an empty string. - * - * \todo - * Determine if code should be added to reject function names that start with - * 'glX'. - * - * \bug - * Add code to compare \c parameter_signature with the parameter signature of - * a static function. In order to do that, we need to find a way to \b get - * the parameter signature of a static function. - */ - -PUBLIC int -_glapi_add_dispatch( const char * const * function_names, - const char * parameter_signature ) -{ - static int next_dynamic_offset = _gloffset_FIRST_DYNAMIC; - const char * const real_sig = (parameter_signature != NULL) - ? parameter_signature : ""; - struct _glapi_function * entry[8]; - GLboolean is_static[8]; - unsigned i; - unsigned j; - int offset = ~0; - int new_offset; - - - (void) memset( is_static, 0, sizeof( is_static ) ); - (void) memset( entry, 0, sizeof( entry ) ); - - for ( i = 0 ; function_names[i] != NULL ; i++ ) { - /* Do some trivial validation on the name of the function. - */ - - if (!function_names[i] || function_names[i][0] != 'g' || function_names[i][1] != 'l') - return -1; - - /* Determine if the named function already exists. If the function does - * exist, it must have the same parameter signature as the function - * being added. - */ - - new_offset = get_static_proc_offset(function_names[i]); - if (new_offset >= 0) { - /* FIXME: Make sure the parameter signatures match! How do we get - * FIXME: the parameter signature for static functions? - */ - - if ( (offset != ~0) && (new_offset != offset) ) { - return -1; - } - - is_static[i] = GL_TRUE; - offset = new_offset; - } - - - for ( j = 0 ; j < NumExtEntryPoints ; j++ ) { - if (strcmp(ExtEntryTable[j].name, function_names[i]) == 0) { - /* The offset may be ~0 if the function name was added by - * glXGetProcAddress but never filled in by the driver. - */ - - if (ExtEntryTable[j].dispatch_offset != ~0) { - if (strcmp(real_sig, ExtEntryTable[j].parameter_signature) - != 0) { - return -1; - } - - if ( (offset != ~0) && (ExtEntryTable[j].dispatch_offset != offset) ) { - return -1; - } - - offset = ExtEntryTable[j].dispatch_offset; - } - - entry[i] = & ExtEntryTable[j]; - break; - } - } - } - - if (offset == ~0) { - offset = next_dynamic_offset; - next_dynamic_offset++; - } - - for ( i = 0 ; function_names[i] != NULL ; i++ ) { - if (! is_static[i] ) { - if (entry[i] == NULL) { - entry[i] = add_function_name( function_names[i] ); - if (entry[i] == NULL) { - /* FIXME: Possible memory leak here. - */ - return -1; - } - } - - entry[i]->parameter_signature = str_dup(real_sig); - fill_in_entrypoint_offset(entry[i]->dispatch_stub, offset); - entry[i]->dispatch_offset = offset; - } - } - - return offset; -} - - -/** - * Return offset of entrypoint for named function within dispatch table. - */ -PUBLIC GLint -_glapi_get_proc_offset(const char *funcName) -{ - /* search extension functions first */ - GLuint i; - for (i = 0; i < NumExtEntryPoints; i++) { - if (strcmp(ExtEntryTable[i].name, funcName) == 0) { - return ExtEntryTable[i].dispatch_offset; - } - } - /* search static functions */ - return get_static_proc_offset(funcName); -} - - - -/** - * Return pointer to the named function. If the function name isn't found - * in the name of static functions, try generating a new API entrypoint on - * the fly with assembly language. - */ -_glapi_proc -_glapi_get_proc_address(const char *funcName) -{ - struct _glapi_function * entry; - GLuint i; - -#ifdef MANGLE - if (funcName[0] != 'm' || funcName[1] != 'g' || funcName[2] != 'l') - return NULL; -#else - if (funcName[0] != 'g' || funcName[1] != 'l') - return NULL; -#endif - - /* search extension functions first */ - for (i = 0; i < NumExtEntryPoints; i++) { - if (strcmp(ExtEntryTable[i].name, funcName) == 0) { - return ExtEntryTable[i].dispatch_stub; - } - } - -#if !defined( XFree86Server ) && !defined( XGLServer ) - /* search static functions */ - { - const _glapi_proc func = get_static_proc_address(funcName); - if (func) - return func; - } -#endif /* !defined( XFree86Server ) */ - - entry = add_function_name(funcName); - return (entry == NULL) ? NULL : entry->dispatch_stub; -} - - - -/** - * Return the name of the function at the given dispatch offset. - * This is only intended for debugging. - */ -const char * -_glapi_get_proc_name(GLuint offset) -{ - GLuint i; - const char * n; - - /* search built-in functions */ - n = get_static_proc_name(offset); - if ( n != NULL ) { - return n; - } - - /* search added extension functions */ - for (i = 0; i < NumExtEntryPoints; i++) { - if (ExtEntryTable[i].dispatch_offset == offset) { - return ExtEntryTable[i].name; - } - } - return NULL; -} - - - -/** * Return size of dispatch table struct as number of functions (or * slots). */ @@ -960,7 +419,6 @@ _glapi_get_dispatch_table_size(void) } - /** * Make sure there are no NULL pointers in the given dispatch table. * Intended for debugging purposes. @@ -968,7 +426,7 @@ _glapi_get_dispatch_table_size(void) void _glapi_check_table(const struct _glapi_table *table) { -#ifdef DEBUG +#ifdef EXTRA_DEBUG const GLuint entries = _glapi_get_dispatch_table_size(); const void **tab = (const void **) table; GLuint i; @@ -1039,29 +497,3 @@ _glapi_check_table(const struct _glapi_table *table) (void) table; #endif } - - -#if defined(PTHREADS) || defined(GLX_USE_TLS) -/** - * Perform platform-specific GL API entry-point fixups. - */ -static void -init_glapi_relocs( void ) -{ -#if defined(USE_X86_ASM) && defined(GLX_USE_TLS) && !defined(GLX_X86_READONLY_TEXT) - extern unsigned long _x86_get_dispatch(void); - char run_time_patch[] = { - 0x65, 0xa1, 0, 0, 0, 0 /* movl %gs:0,%eax */ - }; - GLuint *offset = (GLuint *) &run_time_patch[2]; /* 32-bits for x86/32 */ - const GLubyte * const get_disp = (const GLubyte *) run_time_patch; - GLubyte * curr_func = (GLubyte *) gl_dispatch_functions_start; - - *offset = _x86_get_dispatch(); - while ( curr_func != (GLubyte *) gl_dispatch_functions_end ) { - (void) memcpy( curr_func, get_disp, sizeof(run_time_patch)); - curr_func += DISPATCH_FUNCTION_SIZE; - } -#endif -} -#endif /* defined(PTHREADS) || defined(GLX_USE_TLS) */ diff --git a/src/mesa/glapi/glapi.h b/src/mesa/glapi/glapi.h index ddfb1cffb9..8f2cf66218 100644 --- a/src/mesa/glapi/glapi.h +++ b/src/mesa/glapi/glapi.h @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.5 + * Version: 7.1 * - * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2008 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"), @@ -44,12 +44,17 @@ #ifndef _GLAPI_H #define _GLAPI_H +#define GL_GLEXT_PROTOTYPES #include "GL/gl.h" -#include "glapitable.h" +#include "GL/glext.h" #include "glthread.h" +struct _glapi_table; + +typedef void (*_glapi_proc)(void); /* generic function pointer */ + typedef void (*_glapi_warning_func)(void *ctx, const char *str, ...); @@ -63,6 +68,12 @@ typedef void (*_glapi_warning_func)(void *ctx, const char *str, ...); #endif +/* + * Number of extension functions which we can dynamically add at runtime. + */ +#define MAX_EXTENSION_FUNCS 300 + + /** ** Define the GET_CURRENT_CONTEXT() macro. ** \param C local variable which will hold the current context. diff --git a/src/mesa/glapi/glapi_getproc.c b/src/mesa/glapi/glapi_getproc.c new file mode 100644 index 0000000000..6d40b495c7 --- /dev/null +++ b/src/mesa/glapi/glapi_getproc.c @@ -0,0 +1,619 @@ +/* + * Mesa 3-D graphics library + * Version: 7.1 + * + * Copyright (C) 1999-2008 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 glapi_getproc. + * + * Code for implementing glXGetProcAddress(), etc. + * This was originally in glapi.c but refactored out. + */ + + +#include <stdlib.h> +#include <string.h> +#include "main/glheader.h" +#include "glapi.h" +#include "glapioffsets.h" +#include "glapitable.h" + + +static void +fill_in_entrypoint_offset(_glapi_proc entrypoint, GLuint offset); + + +/** + * strdup() is actually not a standard ANSI C or POSIX routine. + * Irix will not define it if ANSI mode is in effect. + */ +static char * +str_dup(const char *str) +{ + char *copy; + copy = (char*) malloc(strlen(str) + 1); + if (!copy) + return NULL; + strcpy(copy, str); + return copy; +} + + + +#if defined(USE_X64_64_ASM) && defined(GLX_USE_TLS) +# define DISPATCH_FUNCTION_SIZE 16 +#elif defined(USE_X86_ASM) +# if defined(THREADS) && !defined(GLX_USE_TLS) +# define DISPATCH_FUNCTION_SIZE 32 +# else +# define DISPATCH_FUNCTION_SIZE 16 +# endif +#endif + +#if !defined(DISPATCH_FUNCTION_SIZE) && !defined(XFree86Server) && !defined(XGLServer) +# define NEED_FUNCTION_POINTER +#endif + +/* The code in this file is auto-generated with Python */ +#include "glprocs.h" + + +/** + * Search the table of static entrypoint functions for the named function + * and return the corresponding glprocs_table_t entry. + */ +static const glprocs_table_t * +find_entry( const char * n ) +{ + GLuint i; + for (i = 0; static_functions[i].Name_offset >= 0; i++) { + const char *testName = gl_string_table + static_functions[i].Name_offset; + if (strcmp(testName, n) == 0) { + return &static_functions[i]; + } + } + return NULL; +} + + +/** + * Return dispatch table offset of the named static (built-in) function. + * Return -1 if function not found. + */ +static GLint +get_static_proc_offset(const char *funcName) +{ + const glprocs_table_t * const f = find_entry( funcName ); + if (f) { + return f->Offset; + } + return -1; +} + + +#if !defined(XFree86Server) && !defined(XGLServer) +#ifdef USE_X86_ASM + +#if defined( GLX_USE_TLS ) +extern GLubyte gl_dispatch_functions_start[]; +extern GLubyte gl_dispatch_functions_end[]; +#else +extern const GLubyte gl_dispatch_functions_start[]; +#endif + +#endif /* USE_X86_ASM */ + + +/** + * Return dispatch function address for the named static (built-in) function. + * Return NULL if function not found. + */ +static _glapi_proc +get_static_proc_address(const char *funcName) +{ + const glprocs_table_t * const f = find_entry( funcName ); + if (f) { +#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 + return f->Address; +#endif + } + else { + return NULL; + } +} + +#endif /* !defined(XFree86Server) && !defined(XGLServer) */ + + + +/** + * Return the name of the function at the given offset in the dispatch + * table. For debugging only. + */ +static const char * +get_static_proc_name( GLuint offset ) +{ + GLuint i; + for (i = 0; static_functions[i].Name_offset >= 0; i++) { + if (static_functions[i].Offset == offset) { + return gl_string_table + static_functions[i].Name_offset; + } + } + return NULL; +} + + + +/********************************************************************** + * Extension function management. + */ + + +/** + * Track information about a function added to the GL API. + */ +struct _glapi_function { + /** + * Name of the function. + */ + const char * name; + + + /** + * Text string that describes the types of the parameters passed to the + * named function. Parameter types are converted to characters using the + * following rules: + * - 'i' for \c GLint, \c GLuint, and \c GLenum + * - 'p' for any pointer type + * - 'f' for \c GLfloat and \c GLclampf + * - 'd' for \c GLdouble and \c GLclampd + */ + const char * parameter_signature; + + + /** + * Offset in the dispatch table where the pointer to the real function is + * located. If the driver has not requested that the named function be + * added to the dispatch table, this will have the value ~0. + */ + unsigned dispatch_offset; + + + /** + * Pointer to the dispatch stub for the named function. + * + * \todo + * The semantic of this field should be changed slightly. Currently, it + * is always expected to be non-\c NULL. However, it would be better to + * only allocate the entry-point stub when the application requests the + * function via \c glXGetProcAddress. This would save memory for all the + * functions that the driver exports but that the application never wants + * to call. + */ + _glapi_proc dispatch_stub; +}; + + +static struct _glapi_function ExtEntryTable[MAX_EXTENSION_FUNCS]; +static GLuint NumExtEntryPoints = 0; + +#ifdef USE_SPARC_ASM +extern void __glapi_sparc_icache_flush(unsigned int *); +#endif + +/** + * Generate a dispatch function (entrypoint) which jumps through + * the given slot number (offset) in the current dispatch table. + * We need assembly language in order to accomplish this. + */ +static _glapi_proc +generate_entrypoint(GLuint functionOffset) +{ +#if defined(USE_X86_ASM) + /* 32 is chosen as something of a magic offset. For x86, the dispatch + * at offset 32 is the first one where the offset in the + * "jmp OFFSET*4(%eax)" can't be encoded in a single byte. + */ + const GLubyte * const template_func = gl_dispatch_functions_start + + (DISPATCH_FUNCTION_SIZE * 32); + GLubyte * const code = (GLubyte *) malloc(DISPATCH_FUNCTION_SIZE); + + + if ( code != NULL ) { + (void) memcpy(code, template_func, DISPATCH_FUNCTION_SIZE); + fill_in_entrypoint_offset( (_glapi_proc) code, functionOffset ); + } + + return (_glapi_proc) code; +#elif defined(USE_SPARC_ASM) + +#ifdef __arch64__ + static const unsigned int insn_template[] = { + 0x05000000, /* sethi %uhi(_glapi_Dispatch), %g2 */ + 0x03000000, /* sethi %hi(_glapi_Dispatch), %g1 */ + 0x8410a000, /* or %g2, %ulo(_glapi_Dispatch), %g2 */ + 0x82106000, /* or %g1, %lo(_glapi_Dispatch), %g1 */ + 0x8528b020, /* sllx %g2, 32, %g2 */ + 0xc2584002, /* ldx [%g1 + %g2], %g1 */ + 0x05000000, /* sethi %hi(8 * glapioffset), %g2 */ + 0x8410a000, /* or %g2, %lo(8 * glapioffset), %g2 */ + 0xc6584002, /* ldx [%g1 + %g2], %g3 */ + 0x81c0c000, /* jmpl %g3, %g0 */ + 0x01000000 /* nop */ + }; +#else + static const unsigned int insn_template[] = { + 0x03000000, /* sethi %hi(_glapi_Dispatch), %g1 */ + 0xc2006000, /* ld [%g1 + %lo(_glapi_Dispatch)], %g1 */ + 0xc6006000, /* ld [%g1 + %lo(4*glapioffset)], %g3 */ + 0x81c0c000, /* jmpl %g3, %g0 */ + 0x01000000 /* nop */ + }; +#endif /* __arch64__ */ + unsigned int *code = (unsigned int *) malloc(sizeof(insn_template)); + unsigned long glapi_addr = (unsigned long) &_glapi_Dispatch; + if (code) { + memcpy(code, insn_template, sizeof(insn_template)); + +#ifdef __arch64__ + code[0] |= (glapi_addr >> (32 + 10)); + code[1] |= ((glapi_addr & 0xffffffff) >> 10); + __glapi_sparc_icache_flush(&code[0]); + code[2] |= ((glapi_addr >> 32) & ((1 << 10) - 1)); + code[3] |= (glapi_addr & ((1 << 10) - 1)); + __glapi_sparc_icache_flush(&code[2]); + code[6] |= ((functionOffset * 8) >> 10); + code[7] |= ((functionOffset * 8) & ((1 << 10) - 1)); + __glapi_sparc_icache_flush(&code[6]); +#else + code[0] |= (glapi_addr >> 10); + code[1] |= (glapi_addr & ((1 << 10) - 1)); + __glapi_sparc_icache_flush(&code[0]); + code[2] |= (functionOffset * 4); + __glapi_sparc_icache_flush(&code[2]); +#endif /* __arch64__ */ + } + return (_glapi_proc) code; +#else + (void) functionOffset; + return NULL; +#endif /* USE_*_ASM */ +} + + +/** + * This function inserts a new dispatch offset into the assembly language + * stub that was generated with the preceeding function. + */ +static void +fill_in_entrypoint_offset(_glapi_proc entrypoint, GLuint offset) +{ +#if defined(USE_X86_ASM) + GLubyte * const code = (GLubyte *) entrypoint; + +#if DISPATCH_FUNCTION_SIZE == 32 + *((unsigned int *)(code + 11)) = 4 * offset; + *((unsigned int *)(code + 22)) = 4 * offset; +#elif DISPATCH_FUNCTION_SIZE == 16 && defined( GLX_USE_TLS ) + *((unsigned int *)(code + 8)) = 4 * offset; +#elif DISPATCH_FUNCTION_SIZE == 16 + *((unsigned int *)(code + 7)) = 4 * offset; +#else +# error Invalid DISPATCH_FUNCTION_SIZE! +#endif + +#elif defined(USE_SPARC_ASM) + + /* XXX this hasn't been tested! */ + unsigned int *code = (unsigned int *) entrypoint; +#ifdef __arch64__ + code[6] = 0x05000000; /* sethi %hi(8 * glapioffset), %g2 */ + code[7] = 0x8410a000; /* or %g2, %lo(8 * glapioffset), %g2 */ + code[6] |= ((offset * 8) >> 10); + code[7] |= ((offset * 8) & ((1 << 10) - 1)); + __glapi_sparc_icache_flush(&code[6]); +#else /* __arch64__ */ + code[2] = 0xc6006000; /* ld [%g1 + %lo(4*glapioffset)], %g3 */ + code[2] |= (offset * 4); + __glapi_sparc_icache_flush(&code[2]); +#endif /* __arch64__ */ + +#else + + /* an unimplemented architecture */ + (void) entrypoint; + (void) offset; + +#endif /* USE_*_ASM */ +} + + +/** + * Generate new entrypoint + * + * Use a temporary dispatch offset of ~0 (i.e. -1). Later, when the driver + * calls \c _glapi_add_dispatch we'll put in the proper offset. If that + * never happens, and the user calls this function, he'll segfault. That's + * what you get when you try calling a GL function that doesn't really exist. + * + * \param funcName Name of the function to create an entry-point for. + * + * \sa _glapi_add_entrypoint + */ + +static struct _glapi_function * +add_function_name( const char * funcName ) +{ + struct _glapi_function * entry = NULL; + + if (NumExtEntryPoints < MAX_EXTENSION_FUNCS) { + _glapi_proc entrypoint = generate_entrypoint(~0); + if (entrypoint != NULL) { + entry = & ExtEntryTable[NumExtEntryPoints]; + + ExtEntryTable[NumExtEntryPoints].name = str_dup(funcName); + ExtEntryTable[NumExtEntryPoints].parameter_signature = NULL; + ExtEntryTable[NumExtEntryPoints].dispatch_offset = ~0; + ExtEntryTable[NumExtEntryPoints].dispatch_stub = entrypoint; + NumExtEntryPoints++; + } + } + + return entry; +} + + +/** + * Fill-in the dispatch stub for the named function. + * + * This function is intended to be called by a hardware driver. When called, + * a dispatch stub may be created created for the function. A pointer to this + * dispatch function will be returned by glXGetProcAddress. + * + * \param function_names Array of pointers to function names that should + * share a common dispatch offset. + * \param parameter_signature String representing the types of the parameters + * passed to the named function. Parameter types + * are converted to characters using the following + * rules: + * - 'i' for \c GLint, \c GLuint, and \c GLenum + * - 'p' for any pointer type + * - 'f' for \c GLfloat and \c GLclampf + * - 'd' for \c GLdouble and \c GLclampd + * + * \returns + * The offset in the dispatch table of the named function. A pointer to the + * driver's implementation of the named function should be stored at + * \c dispatch_table[\c offset]. Return -1 if error/problem. + * + * \sa glXGetProcAddress + * + * \warning + * This function can only handle up to 8 names at a time. As far as I know, + * the maximum number of names ever associated with an existing GL function is + * 4 (\c glPointParameterfSGIS, \c glPointParameterfEXT, + * \c glPointParameterfARB, and \c glPointParameterf), so this should not be + * too painful of a limitation. + * + * \todo + * Determine whether or not \c parameter_signature should be allowed to be + * \c NULL. It doesn't seem like much of a hardship for drivers to have to + * pass in an empty string. + * + * \todo + * Determine if code should be added to reject function names that start with + * 'glX'. + * + * \bug + * Add code to compare \c parameter_signature with the parameter signature of + * a static function. In order to do that, we need to find a way to \b get + * the parameter signature of a static function. + */ + +PUBLIC int +_glapi_add_dispatch( const char * const * function_names, + const char * parameter_signature ) +{ + static int next_dynamic_offset = _gloffset_FIRST_DYNAMIC; + const char * const real_sig = (parameter_signature != NULL) + ? parameter_signature : ""; + struct _glapi_function * entry[8]; + GLboolean is_static[8]; + unsigned i; + unsigned j; + int offset = ~0; + int new_offset; + + + (void) memset( is_static, 0, sizeof( is_static ) ); + (void) memset( entry, 0, sizeof( entry ) ); + + for ( i = 0 ; function_names[i] != NULL ; i++ ) { + /* Do some trivial validation on the name of the function. + */ + + if (!function_names[i] || function_names[i][0] != 'g' || function_names[i][1] != 'l') + return -1; + + /* Determine if the named function already exists. If the function does + * exist, it must have the same parameter signature as the function + * being added. + */ + + new_offset = get_static_proc_offset(function_names[i]); + if (new_offset >= 0) { + /* FIXME: Make sure the parameter signatures match! How do we get + * FIXME: the parameter signature for static functions? + */ + + if ( (offset != ~0) && (new_offset != offset) ) { + return -1; + } + + is_static[i] = GL_TRUE; + offset = new_offset; + } + + + for ( j = 0 ; j < NumExtEntryPoints ; j++ ) { + if (strcmp(ExtEntryTable[j].name, function_names[i]) == 0) { + /* The offset may be ~0 if the function name was added by + * glXGetProcAddress but never filled in by the driver. + */ + + if (ExtEntryTable[j].dispatch_offset != ~0) { + if (strcmp(real_sig, ExtEntryTable[j].parameter_signature) + != 0) { + return -1; + } + + if ( (offset != ~0) && (ExtEntryTable[j].dispatch_offset != offset) ) { + return -1; + } + + offset = ExtEntryTable[j].dispatch_offset; + } + + entry[i] = & ExtEntryTable[j]; + break; + } + } + } + + if (offset == ~0) { + offset = next_dynamic_offset; + next_dynamic_offset++; + } + + for ( i = 0 ; function_names[i] != NULL ; i++ ) { + if (! is_static[i] ) { + if (entry[i] == NULL) { + entry[i] = add_function_name( function_names[i] ); + if (entry[i] == NULL) { + /* FIXME: Possible memory leak here. + */ + return -1; + } + } + + entry[i]->parameter_signature = str_dup(real_sig); + fill_in_entrypoint_offset(entry[i]->dispatch_stub, offset); + entry[i]->dispatch_offset = offset; + } + } + + return offset; +} + + +/** + * Return offset of entrypoint for named function within dispatch table. + */ +PUBLIC GLint +_glapi_get_proc_offset(const char *funcName) +{ + /* search extension functions first */ + GLuint i; + for (i = 0; i < NumExtEntryPoints; i++) { + if (strcmp(ExtEntryTable[i].name, funcName) == 0) { + return ExtEntryTable[i].dispatch_offset; + } + } + /* search static functions */ + return get_static_proc_offset(funcName); +} + + + +/** + * Return pointer to the named function. If the function name isn't found + * in the name of static functions, try generating a new API entrypoint on + * the fly with assembly language. + */ +_glapi_proc +_glapi_get_proc_address(const char *funcName) +{ + struct _glapi_function * entry; + GLuint i; + +#ifdef MANGLE + if (funcName[0] != 'm' || funcName[1] != 'g' || funcName[2] != 'l') + return NULL; +#else + if (funcName[0] != 'g' || funcName[1] != 'l') + return NULL; +#endif + + /* search extension functions first */ + for (i = 0; i < NumExtEntryPoints; i++) { + if (strcmp(ExtEntryTable[i].name, funcName) == 0) { + return ExtEntryTable[i].dispatch_stub; + } + } + +#if !defined( XFree86Server ) && !defined( XGLServer ) + /* search static functions */ + { + const _glapi_proc func = get_static_proc_address(funcName); + if (func) + return func; + } +#endif /* !defined( XFree86Server ) */ + + entry = add_function_name(funcName); + return (entry == NULL) ? NULL : entry->dispatch_stub; +} + + + +/** + * Return the name of the function at the given dispatch offset. + * This is only intended for debugging. + */ +const char * +_glapi_get_proc_name(GLuint offset) +{ + GLuint i; + const char * n; + + /* search built-in functions */ + n = get_static_proc_name(offset); + if ( n != NULL ) { + return n; + } + + /* search added extension functions */ + for (i = 0; i < NumExtEntryPoints; i++) { + if (ExtEntryTable[i].dispatch_offset == offset) { + return ExtEntryTable[i].name; + } + } + return NULL; +} diff --git a/src/mesa/glapi/glapitable.h b/src/mesa/glapi/glapitable.h index 48941f5590..5d9d40a8a2 100644 --- a/src/mesa/glapi/glapitable.h +++ b/src/mesa/glapi/glapitable.h @@ -37,7 +37,6 @@ # define GLAPIENTRYP GLAPIENTRY * #endif -typedef void (*_glapi_proc)(void); /* generic function pointer */ struct _glapi_table { diff --git a/src/mesa/glapi/glthread.c b/src/mesa/glapi/glthread.c index 813d6f9dbc..b818f4e26e 100644 --- a/src/mesa/glapi/glthread.c +++ b/src/mesa/glapi/glthread.c @@ -34,6 +34,7 @@ #endif #include <stdlib.h> +#include <stdio.h> #include "glthread.h" diff --git a/src/mesa/glapi/mesadef.py b/src/mesa/glapi/mesadef.py index 097348dae0..0f410fc482 100644 --- a/src/mesa/glapi/mesadef.py +++ b/src/mesa/glapi/mesadef.py @@ -1,6 +1,5 @@ #!/usr/bin/env python -# $Id: mesadef.py,v 1.4 2006/01/25 15:05:36 brianp Exp $ # Mesa 3-D graphics library # Version: 4.1 diff --git a/src/mesa/main/api_arrayelt.c b/src/mesa/main/api_arrayelt.c index 72091b0789..d124c724c9 100644 --- a/src/mesa/main/api_arrayelt.c +++ b/src/mesa/main/api_arrayelt.c @@ -166,7 +166,7 @@ static void GLAPIENTRY VertexAttrib1NbvNV(GLuint index, const GLbyte *v) static void GLAPIENTRY VertexAttrib1bvNV(GLuint index, const GLbyte *v) { - CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, v[0])); + CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, (GLfloat)v[0])); } static void GLAPIENTRY VertexAttrib2NbvNV(GLuint index, const GLbyte *v) @@ -176,7 +176,7 @@ static void GLAPIENTRY VertexAttrib2NbvNV(GLuint index, const GLbyte *v) static void GLAPIENTRY VertexAttrib2bvNV(GLuint index, const GLbyte *v) { - CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, v[0], v[1])); + CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1])); } static void GLAPIENTRY VertexAttrib3NbvNV(GLuint index, const GLbyte *v) @@ -188,7 +188,7 @@ static void GLAPIENTRY VertexAttrib3NbvNV(GLuint index, const GLbyte *v) static void GLAPIENTRY VertexAttrib3bvNV(GLuint index, const GLbyte *v) { - CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, v[0], v[1], v[2])); + CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2])); } static void GLAPIENTRY VertexAttrib4NbvNV(GLuint index, const GLbyte *v) @@ -201,7 +201,7 @@ static void GLAPIENTRY VertexAttrib4NbvNV(GLuint index, const GLbyte *v) static void GLAPIENTRY VertexAttrib4bvNV(GLuint index, const GLbyte *v) { - CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, v[0], v[1], v[2], v[3])); + CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2], (GLfloat)v[3])); } /* GL_UNSIGNED_BYTE attributes */ @@ -213,7 +213,7 @@ static void GLAPIENTRY VertexAttrib1NubvNV(GLuint index, const GLubyte *v) static void GLAPIENTRY VertexAttrib1ubvNV(GLuint index, const GLubyte *v) { - CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, v[0])); + CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, (GLfloat)v[0])); } static void GLAPIENTRY VertexAttrib2NubvNV(GLuint index, const GLubyte *v) @@ -224,7 +224,7 @@ static void GLAPIENTRY VertexAttrib2NubvNV(GLuint index, const GLubyte *v) static void GLAPIENTRY VertexAttrib2ubvNV(GLuint index, const GLubyte *v) { - CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, v[0], v[1])); + CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1])); } static void GLAPIENTRY VertexAttrib3NubvNV(GLuint index, const GLubyte *v) @@ -235,7 +235,7 @@ static void GLAPIENTRY VertexAttrib3NubvNV(GLuint index, const GLubyte *v) } static void GLAPIENTRY VertexAttrib3ubvNV(GLuint index, const GLubyte *v) { - CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, v[0], v[1], v[2])); + CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2])); } static void GLAPIENTRY VertexAttrib4NubvNV(GLuint index, const GLubyte *v) @@ -248,7 +248,7 @@ static void GLAPIENTRY VertexAttrib4NubvNV(GLuint index, const GLubyte *v) static void GLAPIENTRY VertexAttrib4ubvNV(GLuint index, const GLubyte *v) { - CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, v[0], v[1], v[2], v[3])); + CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2], (GLfloat)v[3])); } /* GL_SHORT attributes */ @@ -260,7 +260,7 @@ static void GLAPIENTRY VertexAttrib1NsvNV(GLuint index, const GLshort *v) static void GLAPIENTRY VertexAttrib1svNV(GLuint index, const GLshort *v) { - CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, v[0])); + CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, (GLfloat)v[0])); } static void GLAPIENTRY VertexAttrib2NsvNV(GLuint index, const GLshort *v) @@ -271,7 +271,7 @@ static void GLAPIENTRY VertexAttrib2NsvNV(GLuint index, const GLshort *v) static void GLAPIENTRY VertexAttrib2svNV(GLuint index, const GLshort *v) { - CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, v[0], v[1])); + CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1])); } static void GLAPIENTRY VertexAttrib3NsvNV(GLuint index, const GLshort *v) @@ -283,7 +283,7 @@ static void GLAPIENTRY VertexAttrib3NsvNV(GLuint index, const GLshort *v) static void GLAPIENTRY VertexAttrib3svNV(GLuint index, const GLshort *v) { - CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, v[0], v[1], v[2])); + CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2])); } static void GLAPIENTRY VertexAttrib4NsvNV(GLuint index, const GLshort *v) @@ -296,7 +296,7 @@ static void GLAPIENTRY VertexAttrib4NsvNV(GLuint index, const GLshort *v) static void GLAPIENTRY VertexAttrib4svNV(GLuint index, const GLshort *v) { - CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, v[0], v[1], v[2], v[3])); + CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2], (GLfloat)v[3])); } /* GL_UNSIGNED_SHORT attributes */ @@ -308,7 +308,7 @@ static void GLAPIENTRY VertexAttrib1NusvNV(GLuint index, const GLushort *v) static void GLAPIENTRY VertexAttrib1usvNV(GLuint index, const GLushort *v) { - CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, v[0])); + CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, (GLfloat)v[0])); } static void GLAPIENTRY VertexAttrib2NusvNV(GLuint index, const GLushort *v) @@ -319,7 +319,7 @@ static void GLAPIENTRY VertexAttrib2NusvNV(GLuint index, const GLushort *v) static void GLAPIENTRY VertexAttrib2usvNV(GLuint index, const GLushort *v) { - CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, v[0], v[1])); + CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1])); } static void GLAPIENTRY VertexAttrib3NusvNV(GLuint index, const GLushort *v) @@ -331,7 +331,7 @@ static void GLAPIENTRY VertexAttrib3NusvNV(GLuint index, const GLushort *v) static void GLAPIENTRY VertexAttrib3usvNV(GLuint index, const GLushort *v) { - CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, v[0], v[1], v[2])); + CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2])); } static void GLAPIENTRY VertexAttrib4NusvNV(GLuint index, const GLushort *v) @@ -344,7 +344,7 @@ static void GLAPIENTRY VertexAttrib4NusvNV(GLuint index, const GLushort *v) static void GLAPIENTRY VertexAttrib4usvNV(GLuint index, const GLushort *v) { - CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, v[0], v[1], v[2], v[3])); + CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2], (GLfloat)v[3])); } /* GL_INT attributes */ @@ -356,7 +356,7 @@ static void GLAPIENTRY VertexAttrib1NivNV(GLuint index, const GLint *v) static void GLAPIENTRY VertexAttrib1ivNV(GLuint index, const GLint *v) { - CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, v[0])); + CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, (GLfloat)v[0])); } static void GLAPIENTRY VertexAttrib2NivNV(GLuint index, const GLint *v) @@ -367,7 +367,7 @@ static void GLAPIENTRY VertexAttrib2NivNV(GLuint index, const GLint *v) static void GLAPIENTRY VertexAttrib2ivNV(GLuint index, const GLint *v) { - CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, v[0], v[1])); + CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1])); } static void GLAPIENTRY VertexAttrib3NivNV(GLuint index, const GLint *v) @@ -379,7 +379,7 @@ static void GLAPIENTRY VertexAttrib3NivNV(GLuint index, const GLint *v) static void GLAPIENTRY VertexAttrib3ivNV(GLuint index, const GLint *v) { - CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, v[0], v[1], v[2])); + CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2])); } static void GLAPIENTRY VertexAttrib4NivNV(GLuint index, const GLint *v) @@ -392,7 +392,7 @@ static void GLAPIENTRY VertexAttrib4NivNV(GLuint index, const GLint *v) static void GLAPIENTRY VertexAttrib4ivNV(GLuint index, const GLint *v) { - CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, v[0], v[1], v[2], v[3])); + CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2], (GLfloat)v[3])); } /* GL_UNSIGNED_INT attributes */ @@ -404,7 +404,7 @@ static void GLAPIENTRY VertexAttrib1NuivNV(GLuint index, const GLuint *v) static void GLAPIENTRY VertexAttrib1uivNV(GLuint index, const GLuint *v) { - CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, v[0])); + CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, (GLfloat)v[0])); } static void GLAPIENTRY VertexAttrib2NuivNV(GLuint index, const GLuint *v) @@ -415,7 +415,7 @@ static void GLAPIENTRY VertexAttrib2NuivNV(GLuint index, const GLuint *v) static void GLAPIENTRY VertexAttrib2uivNV(GLuint index, const GLuint *v) { - CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, v[0], v[1])); + CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1])); } static void GLAPIENTRY VertexAttrib3NuivNV(GLuint index, const GLuint *v) @@ -427,7 +427,7 @@ static void GLAPIENTRY VertexAttrib3NuivNV(GLuint index, const GLuint *v) static void GLAPIENTRY VertexAttrib3uivNV(GLuint index, const GLuint *v) { - CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, v[0], v[1], v[2])); + CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2])); } static void GLAPIENTRY VertexAttrib4NuivNV(GLuint index, const GLuint *v) @@ -440,7 +440,7 @@ static void GLAPIENTRY VertexAttrib4NuivNV(GLuint index, const GLuint *v) static void GLAPIENTRY VertexAttrib4uivNV(GLuint index, const GLuint *v) { - CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, v[0], v[1], v[2], v[3])); + CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2], (GLfloat)v[3])); } /* GL_FLOAT attributes */ @@ -602,7 +602,7 @@ static void GLAPIENTRY VertexAttrib1NbvARB(GLuint index, const GLbyte *v) static void GLAPIENTRY VertexAttrib1bvARB(GLuint index, const GLbyte *v) { - CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, v[0])); + CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, (GLfloat)v[0])); } static void GLAPIENTRY VertexAttrib2NbvARB(GLuint index, const GLbyte *v) @@ -612,7 +612,7 @@ static void GLAPIENTRY VertexAttrib2NbvARB(GLuint index, const GLbyte *v) static void GLAPIENTRY VertexAttrib2bvARB(GLuint index, const GLbyte *v) { - CALL_VertexAttrib2fARB(GET_DISPATCH(), (index, v[0], v[1])); + CALL_VertexAttrib2fARB(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1])); } static void GLAPIENTRY VertexAttrib3NbvARB(GLuint index, const GLbyte *v) @@ -624,7 +624,7 @@ static void GLAPIENTRY VertexAttrib3NbvARB(GLuint index, const GLbyte *v) static void GLAPIENTRY VertexAttrib3bvARB(GLuint index, const GLbyte *v) { - CALL_VertexAttrib3fARB(GET_DISPATCH(), (index, v[0], v[1], v[2])); + CALL_VertexAttrib3fARB(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2])); } static void GLAPIENTRY VertexAttrib4NbvARB(GLuint index, const GLbyte *v) @@ -637,7 +637,7 @@ static void GLAPIENTRY VertexAttrib4NbvARB(GLuint index, const GLbyte *v) static void GLAPIENTRY VertexAttrib4bvARB(GLuint index, const GLbyte *v) { - CALL_VertexAttrib4fARB(GET_DISPATCH(), (index, v[0], v[1], v[2], v[3])); + CALL_VertexAttrib4fARB(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2], (GLfloat)v[3])); } /* GL_UNSIGNED_BYTE attributes */ @@ -649,7 +649,7 @@ static void GLAPIENTRY VertexAttrib1NubvARB(GLuint index, const GLubyte *v) static void GLAPIENTRY VertexAttrib1ubvARB(GLuint index, const GLubyte *v) { - CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, v[0])); + CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, (GLfloat)v[0])); } static void GLAPIENTRY VertexAttrib2NubvARB(GLuint index, const GLubyte *v) @@ -660,7 +660,7 @@ static void GLAPIENTRY VertexAttrib2NubvARB(GLuint index, const GLubyte *v) static void GLAPIENTRY VertexAttrib2ubvARB(GLuint index, const GLubyte *v) { - CALL_VertexAttrib2fARB(GET_DISPATCH(), (index, v[0], v[1])); + CALL_VertexAttrib2fARB(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1])); } static void GLAPIENTRY VertexAttrib3NubvARB(GLuint index, const GLubyte *v) @@ -671,7 +671,7 @@ static void GLAPIENTRY VertexAttrib3NubvARB(GLuint index, const GLubyte *v) } static void GLAPIENTRY VertexAttrib3ubvARB(GLuint index, const GLubyte *v) { - CALL_VertexAttrib3fARB(GET_DISPATCH(), (index, v[0], v[1], v[2])); + CALL_VertexAttrib3fARB(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2])); } static void GLAPIENTRY VertexAttrib4NubvARB(GLuint index, const GLubyte *v) @@ -684,7 +684,7 @@ static void GLAPIENTRY VertexAttrib4NubvARB(GLuint index, const GLubyte *v) static void GLAPIENTRY VertexAttrib4ubvARB(GLuint index, const GLubyte *v) { - CALL_VertexAttrib4fARB(GET_DISPATCH(), (index, v[0], v[1], v[2], v[3])); + CALL_VertexAttrib4fARB(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2], (GLfloat)v[3])); } /* GL_SHORT attributes */ @@ -696,7 +696,7 @@ static void GLAPIENTRY VertexAttrib1NsvARB(GLuint index, const GLshort *v) static void GLAPIENTRY VertexAttrib1svARB(GLuint index, const GLshort *v) { - CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, v[0])); + CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, (GLfloat)v[0])); } static void GLAPIENTRY VertexAttrib2NsvARB(GLuint index, const GLshort *v) @@ -707,7 +707,7 @@ static void GLAPIENTRY VertexAttrib2NsvARB(GLuint index, const GLshort *v) static void GLAPIENTRY VertexAttrib2svARB(GLuint index, const GLshort *v) { - CALL_VertexAttrib2fARB(GET_DISPATCH(), (index, v[0], v[1])); + CALL_VertexAttrib2fARB(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1])); } static void GLAPIENTRY VertexAttrib3NsvARB(GLuint index, const GLshort *v) @@ -719,7 +719,7 @@ static void GLAPIENTRY VertexAttrib3NsvARB(GLuint index, const GLshort *v) static void GLAPIENTRY VertexAttrib3svARB(GLuint index, const GLshort *v) { - CALL_VertexAttrib3fARB(GET_DISPATCH(), (index, v[0], v[1], v[2])); + CALL_VertexAttrib3fARB(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2])); } static void GLAPIENTRY VertexAttrib4NsvARB(GLuint index, const GLshort *v) @@ -732,7 +732,7 @@ static void GLAPIENTRY VertexAttrib4NsvARB(GLuint index, const GLshort *v) static void GLAPIENTRY VertexAttrib4svARB(GLuint index, const GLshort *v) { - CALL_VertexAttrib4fARB(GET_DISPATCH(), (index, v[0], v[1], v[2], v[3])); + CALL_VertexAttrib4fARB(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2], (GLfloat)v[3])); } /* GL_UNSIGNED_SHORT attributes */ @@ -744,7 +744,7 @@ static void GLAPIENTRY VertexAttrib1NusvARB(GLuint index, const GLushort *v) static void GLAPIENTRY VertexAttrib1usvARB(GLuint index, const GLushort *v) { - CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, v[0])); + CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, (GLfloat)v[0])); } static void GLAPIENTRY VertexAttrib2NusvARB(GLuint index, const GLushort *v) @@ -755,7 +755,7 @@ static void GLAPIENTRY VertexAttrib2NusvARB(GLuint index, const GLushort *v) static void GLAPIENTRY VertexAttrib2usvARB(GLuint index, const GLushort *v) { - CALL_VertexAttrib2fARB(GET_DISPATCH(), (index, v[0], v[1])); + CALL_VertexAttrib2fARB(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1])); } static void GLAPIENTRY VertexAttrib3NusvARB(GLuint index, const GLushort *v) @@ -767,7 +767,7 @@ static void GLAPIENTRY VertexAttrib3NusvARB(GLuint index, const GLushort *v) static void GLAPIENTRY VertexAttrib3usvARB(GLuint index, const GLushort *v) { - CALL_VertexAttrib3fARB(GET_DISPATCH(), (index, v[0], v[1], v[2])); + CALL_VertexAttrib3fARB(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2])); } static void GLAPIENTRY VertexAttrib4NusvARB(GLuint index, const GLushort *v) @@ -780,7 +780,7 @@ static void GLAPIENTRY VertexAttrib4NusvARB(GLuint index, const GLushort *v) static void GLAPIENTRY VertexAttrib4usvARB(GLuint index, const GLushort *v) { - CALL_VertexAttrib4fARB(GET_DISPATCH(), (index, v[0], v[1], v[2], v[3])); + CALL_VertexAttrib4fARB(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2], (GLfloat)v[3])); } /* GL_INT attributes */ @@ -792,7 +792,7 @@ static void GLAPIENTRY VertexAttrib1NivARB(GLuint index, const GLint *v) static void GLAPIENTRY VertexAttrib1ivARB(GLuint index, const GLint *v) { - CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, v[0])); + CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, (GLfloat)v[0])); } static void GLAPIENTRY VertexAttrib2NivARB(GLuint index, const GLint *v) @@ -803,7 +803,7 @@ static void GLAPIENTRY VertexAttrib2NivARB(GLuint index, const GLint *v) static void GLAPIENTRY VertexAttrib2ivARB(GLuint index, const GLint *v) { - CALL_VertexAttrib2fARB(GET_DISPATCH(), (index, v[0], v[1])); + CALL_VertexAttrib2fARB(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1])); } static void GLAPIENTRY VertexAttrib3NivARB(GLuint index, const GLint *v) @@ -815,7 +815,7 @@ static void GLAPIENTRY VertexAttrib3NivARB(GLuint index, const GLint *v) static void GLAPIENTRY VertexAttrib3ivARB(GLuint index, const GLint *v) { - CALL_VertexAttrib3fARB(GET_DISPATCH(), (index, v[0], v[1], v[2])); + CALL_VertexAttrib3fARB(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2])); } static void GLAPIENTRY VertexAttrib4NivARB(GLuint index, const GLint *v) @@ -828,7 +828,7 @@ static void GLAPIENTRY VertexAttrib4NivARB(GLuint index, const GLint *v) static void GLAPIENTRY VertexAttrib4ivARB(GLuint index, const GLint *v) { - CALL_VertexAttrib4fARB(GET_DISPATCH(), (index, v[0], v[1], v[2], v[3])); + CALL_VertexAttrib4fARB(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2], (GLfloat)v[3])); } /* GL_UNSIGNED_INT attributes */ @@ -840,7 +840,7 @@ static void GLAPIENTRY VertexAttrib1NuivARB(GLuint index, const GLuint *v) static void GLAPIENTRY VertexAttrib1uivARB(GLuint index, const GLuint *v) { - CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, v[0])); + CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, (GLfloat)v[0])); } static void GLAPIENTRY VertexAttrib2NuivARB(GLuint index, const GLuint *v) @@ -851,7 +851,7 @@ static void GLAPIENTRY VertexAttrib2NuivARB(GLuint index, const GLuint *v) static void GLAPIENTRY VertexAttrib2uivARB(GLuint index, const GLuint *v) { - CALL_VertexAttrib2fARB(GET_DISPATCH(), (index, v[0], v[1])); + CALL_VertexAttrib2fARB(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1])); } static void GLAPIENTRY VertexAttrib3NuivARB(GLuint index, const GLuint *v) @@ -863,7 +863,7 @@ static void GLAPIENTRY VertexAttrib3NuivARB(GLuint index, const GLuint *v) static void GLAPIENTRY VertexAttrib3uivARB(GLuint index, const GLuint *v) { - CALL_VertexAttrib3fARB(GET_DISPATCH(), (index, v[0], v[1], v[2])); + CALL_VertexAttrib3fARB(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2])); } static void GLAPIENTRY VertexAttrib4NuivARB(GLuint index, const GLuint *v) @@ -876,7 +876,7 @@ static void GLAPIENTRY VertexAttrib4NuivARB(GLuint index, const GLuint *v) static void GLAPIENTRY VertexAttrib4uivARB(GLuint index, const GLuint *v) { - CALL_VertexAttrib4fARB(GET_DISPATCH(), (index, v[0], v[1], v[2], v[3])); + CALL_VertexAttrib4fARB(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2], (GLfloat)v[3])); } /* GL_FLOAT attributes */ diff --git a/src/mesa/main/api_exec.c b/src/mesa/main/api_exec.c new file mode 100644 index 0000000000..0c3c9c4de4 --- /dev/null +++ b/src/mesa/main/api_exec.c @@ -0,0 +1,884 @@ +/* + * Mesa 3-D graphics library + * Version: 7.1 + * + * Copyright (C) 1999-2008 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 api_exec.c + * Initialize dispatch table with the immidiate mode functions. + */ + + +#include "glheader.h" +#if FEATURE_accum +#include "accum.h" +#endif +#include "api_loopback.h" +#include "api_exec.h" +#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program +#include "shader/arbprogram.h" +#endif +#if FEATURE_ATI_fragment_shader +#include "shader/atifragshader.h" +#endif +#if FEATURE_attrib_stack +#include "attrib.h" +#endif +#include "blend.h" +#if FEATURE_ARB_vertex_buffer_object +#include "bufferobj.h" +#endif +#include "arrayobj.h" +#if FEATURE_draw_read_buffer +#include "buffers.h" +#endif +#include "clear.h" +#include "clip.h" +#if FEATURE_colortable +#include "colortab.h" +#endif +#include "context.h" +#if FEATURE_convolution +#include "convolve.h" +#endif +#include "depth.h" +#if FEATURE_dlist +#include "dlist.h" +#endif +#if FEATURE_drawpix +#include "drawpix.h" +#include "rastpos.h" +#endif +#include "enable.h" +#if FEATURE_evaluators +#include "eval.h" +#endif +#include "get.h" +#if FEATURE_feedback +#include "feedback.h" +#endif +#include "fog.h" +#if FEATURE_EXT_framebuffer_object +#include "fbobject.h" +#endif +#include "ffvertex_prog.h" +#include "framebuffer.h" +#include "hint.h" +#if FEATURE_histogram +#include "histogram.h" +#endif +#include "imports.h" +#include "light.h" +#include "lines.h" +#include "macros.h" +#include "matrix.h" +#include "multisample.h" +#if FEATURE_pixel_transfer +#include "pixel.h" +#endif +#include "pixelstore.h" +#include "points.h" +#include "polygon.h" +#if FEATURE_ARB_occlusion_query || FEATURE_EXT_timer_query +#include "queryobj.h" +#endif +#include "readpix.h" +#include "scissor.h" +#include "state.h" +#include "stencil.h" +#include "texenv.h" +#include "teximage.h" +#if FEATURE_texgen +#include "texgen.h" +#endif +#include "texobj.h" +#include "texparam.h" +#include "texstate.h" +#include "mtypes.h" +#include "varray.h" +#if FEATURE_NV_vertex_program +#include "shader/nvprogram.h" +#endif +#if FEATURE_NV_fragment_program +#include "shader/nvprogram.h" +#include "shader/program.h" +#include "texenvprogram.h" +#endif +#if FEATURE_ARB_shader_objects +#include "shaders.h" +#endif +#include "debug.h" +#include "glapi/dispatch.h" + + + +/** + * Initialize a dispatch table with pointers to Mesa's immediate-mode + * commands. + * + * Pointers to glBegin()/glEnd() object commands and a few others + * are provided via the GLvertexformat interface. + * + * \param ctx GL context to which \c exec belongs. + * \param exec dispatch table. + */ +void +_mesa_init_exec_table(struct _glapi_table *exec) +{ +#if _HAVE_FULL_GL + _mesa_loopback_init_api_table( exec ); +#endif + + /* load the dispatch slots we understand */ + SET_AlphaFunc(exec, _mesa_AlphaFunc); + SET_BlendFunc(exec, _mesa_BlendFunc); + SET_Clear(exec, _mesa_Clear); + SET_ClearColor(exec, _mesa_ClearColor); + SET_ClearStencil(exec, _mesa_ClearStencil); + SET_ColorMask(exec, _mesa_ColorMask); + SET_CullFace(exec, _mesa_CullFace); + SET_Disable(exec, _mesa_Disable); +#if FEATURE_draw_read_buffer + SET_DrawBuffer(exec, _mesa_DrawBuffer); + SET_ReadBuffer(exec, _mesa_ReadBuffer); +#endif + SET_Enable(exec, _mesa_Enable); + SET_Finish(exec, _mesa_Finish); + SET_Flush(exec, _mesa_Flush); + SET_FrontFace(exec, _mesa_FrontFace); + SET_Frustum(exec, _mesa_Frustum); + SET_GetError(exec, _mesa_GetError); + SET_GetFloatv(exec, _mesa_GetFloatv); + SET_GetString(exec, _mesa_GetString); + SET_LineStipple(exec, _mesa_LineStipple); + SET_LineWidth(exec, _mesa_LineWidth); + SET_LoadIdentity(exec, _mesa_LoadIdentity); + SET_LoadMatrixf(exec, _mesa_LoadMatrixf); + SET_LogicOp(exec, _mesa_LogicOp); + SET_MatrixMode(exec, _mesa_MatrixMode); + SET_MultMatrixf(exec, _mesa_MultMatrixf); + SET_Ortho(exec, _mesa_Ortho); + SET_PixelStorei(exec, _mesa_PixelStorei); + SET_PopMatrix(exec, _mesa_PopMatrix); + SET_PushMatrix(exec, _mesa_PushMatrix); + SET_Rotatef(exec, _mesa_Rotatef); + SET_Scalef(exec, _mesa_Scalef); + SET_Scissor(exec, _mesa_Scissor); + SET_ShadeModel(exec, _mesa_ShadeModel); + SET_StencilFunc(exec, _mesa_StencilFunc); + SET_StencilMask(exec, _mesa_StencilMask); + SET_StencilOp(exec, _mesa_StencilOp); + SET_TexEnvfv(exec, _mesa_TexEnvfv); + SET_TexEnvi(exec, _mesa_TexEnvi); + SET_TexImage2D(exec, _mesa_TexImage2D); + SET_TexParameteri(exec, _mesa_TexParameteri); + SET_Translatef(exec, _mesa_Translatef); + SET_Viewport(exec, _mesa_Viewport); +#if FEATURE_accum + SET_Accum(exec, _mesa_Accum); + SET_ClearAccum(exec, _mesa_ClearAccum); +#endif +#if FEATURE_dlist + SET_CallList(exec, _mesa_CallList); + SET_CallLists(exec, _mesa_CallLists); + SET_DeleteLists(exec, _mesa_DeleteLists); + SET_EndList(exec, _mesa_EndList); + SET_GenLists(exec, _mesa_GenLists); + SET_IsList(exec, _mesa_IsList); + SET_ListBase(exec, _mesa_ListBase); + SET_NewList(exec, _mesa_NewList); +#endif + SET_ClearDepth(exec, _mesa_ClearDepth); + SET_ClearIndex(exec, _mesa_ClearIndex); + SET_ClipPlane(exec, _mesa_ClipPlane); + SET_ColorMaterial(exec, _mesa_ColorMaterial); + SET_CullParameterfvEXT(exec, _mesa_CullParameterfvEXT); + SET_CullParameterdvEXT(exec, _mesa_CullParameterdvEXT); + SET_DepthFunc(exec, _mesa_DepthFunc); + SET_DepthMask(exec, _mesa_DepthMask); + SET_DepthRange(exec, _mesa_DepthRange); +#if FEATURE_drawpix + SET_Bitmap(exec, _mesa_Bitmap); + SET_CopyPixels(exec, _mesa_CopyPixels); + SET_DrawPixels(exec, _mesa_DrawPixels); +#endif +#if FEATURE_feedback + SET_InitNames(exec, _mesa_InitNames); + SET_FeedbackBuffer(exec, _mesa_FeedbackBuffer); + SET_LoadName(exec, _mesa_LoadName); + SET_PassThrough(exec, _mesa_PassThrough); + SET_PopName(exec, _mesa_PopName); + SET_PushName(exec, _mesa_PushName); + SET_SelectBuffer(exec, _mesa_SelectBuffer); + SET_RenderMode(exec, _mesa_RenderMode); +#endif + SET_FogCoordPointerEXT(exec, _mesa_FogCoordPointerEXT); + SET_Fogf(exec, _mesa_Fogf); + SET_Fogfv(exec, _mesa_Fogfv); + SET_Fogi(exec, _mesa_Fogi); + SET_Fogiv(exec, _mesa_Fogiv); + SET_GetClipPlane(exec, _mesa_GetClipPlane); + SET_GetBooleanv(exec, _mesa_GetBooleanv); + SET_GetDoublev(exec, _mesa_GetDoublev); + SET_GetIntegerv(exec, _mesa_GetIntegerv); + SET_GetLightfv(exec, _mesa_GetLightfv); + SET_GetLightiv(exec, _mesa_GetLightiv); + SET_GetMaterialfv(exec, _mesa_GetMaterialfv); + SET_GetMaterialiv(exec, _mesa_GetMaterialiv); + SET_GetPolygonStipple(exec, _mesa_GetPolygonStipple); + SET_GetTexEnvfv(exec, _mesa_GetTexEnvfv); + SET_GetTexEnviv(exec, _mesa_GetTexEnviv); + SET_GetTexLevelParameterfv(exec, _mesa_GetTexLevelParameterfv); + SET_GetTexLevelParameteriv(exec, _mesa_GetTexLevelParameteriv); + SET_GetTexParameterfv(exec, _mesa_GetTexParameterfv); + SET_GetTexParameteriv(exec, _mesa_GetTexParameteriv); + SET_GetTexImage(exec, _mesa_GetTexImage); + SET_Hint(exec, _mesa_Hint); + SET_IndexMask(exec, _mesa_IndexMask); + SET_IsEnabled(exec, _mesa_IsEnabled); + SET_LightModelf(exec, _mesa_LightModelf); + SET_LightModelfv(exec, _mesa_LightModelfv); + SET_LightModeli(exec, _mesa_LightModeli); + SET_LightModeliv(exec, _mesa_LightModeliv); + SET_Lightf(exec, _mesa_Lightf); + SET_Lightfv(exec, _mesa_Lightfv); + SET_Lighti(exec, _mesa_Lighti); + SET_Lightiv(exec, _mesa_Lightiv); + SET_LoadMatrixd(exec, _mesa_LoadMatrixd); +#if FEATURE_evaluators + SET_GetMapdv(exec, _mesa_GetMapdv); + SET_GetMapfv(exec, _mesa_GetMapfv); + SET_GetMapiv(exec, _mesa_GetMapiv); + SET_Map1d(exec, _mesa_Map1d); + SET_Map1f(exec, _mesa_Map1f); + SET_Map2d(exec, _mesa_Map2d); + SET_Map2f(exec, _mesa_Map2f); + SET_MapGrid1d(exec, _mesa_MapGrid1d); + SET_MapGrid1f(exec, _mesa_MapGrid1f); + SET_MapGrid2d(exec, _mesa_MapGrid2d); + SET_MapGrid2f(exec, _mesa_MapGrid2f); +#endif + SET_MultMatrixd(exec, _mesa_MultMatrixd); +#if FEATURE_pixel_transfer + SET_GetPixelMapfv(exec, _mesa_GetPixelMapfv); + SET_GetPixelMapuiv(exec, _mesa_GetPixelMapuiv); + SET_GetPixelMapusv(exec, _mesa_GetPixelMapusv); + SET_PixelMapfv(exec, _mesa_PixelMapfv); + SET_PixelMapuiv(exec, _mesa_PixelMapuiv); + SET_PixelMapusv(exec, _mesa_PixelMapusv); + SET_PixelTransferf(exec, _mesa_PixelTransferf); + SET_PixelTransferi(exec, _mesa_PixelTransferi); + SET_PixelZoom(exec, _mesa_PixelZoom); +#endif + SET_PixelStoref(exec, _mesa_PixelStoref); + SET_PointSize(exec, _mesa_PointSize); + SET_PolygonMode(exec, _mesa_PolygonMode); + SET_PolygonOffset(exec, _mesa_PolygonOffset); + SET_PolygonStipple(exec, _mesa_PolygonStipple); +#if FEATURE_attrib_stack + SET_PopAttrib(exec, _mesa_PopAttrib); + SET_PushAttrib(exec, _mesa_PushAttrib); + SET_PopClientAttrib(exec, _mesa_PopClientAttrib); + SET_PushClientAttrib(exec, _mesa_PushClientAttrib); +#endif +#if FEATURE_drawpix + SET_RasterPos2f(exec, _mesa_RasterPos2f); + SET_RasterPos2fv(exec, _mesa_RasterPos2fv); + SET_RasterPos2i(exec, _mesa_RasterPos2i); + SET_RasterPos2iv(exec, _mesa_RasterPos2iv); + SET_RasterPos2d(exec, _mesa_RasterPos2d); + SET_RasterPos2dv(exec, _mesa_RasterPos2dv); + SET_RasterPos2s(exec, _mesa_RasterPos2s); + SET_RasterPos2sv(exec, _mesa_RasterPos2sv); + SET_RasterPos3d(exec, _mesa_RasterPos3d); + SET_RasterPos3dv(exec, _mesa_RasterPos3dv); + SET_RasterPos3f(exec, _mesa_RasterPos3f); + SET_RasterPos3fv(exec, _mesa_RasterPos3fv); + SET_RasterPos3i(exec, _mesa_RasterPos3i); + SET_RasterPos3iv(exec, _mesa_RasterPos3iv); + SET_RasterPos3s(exec, _mesa_RasterPos3s); + SET_RasterPos3sv(exec, _mesa_RasterPos3sv); + SET_RasterPos4d(exec, _mesa_RasterPos4d); + SET_RasterPos4dv(exec, _mesa_RasterPos4dv); + SET_RasterPos4f(exec, _mesa_RasterPos4f); + SET_RasterPos4fv(exec, _mesa_RasterPos4fv); + SET_RasterPos4i(exec, _mesa_RasterPos4i); + SET_RasterPos4iv(exec, _mesa_RasterPos4iv); + SET_RasterPos4s(exec, _mesa_RasterPos4s); + SET_RasterPos4sv(exec, _mesa_RasterPos4sv); +#endif + SET_ReadPixels(exec, _mesa_ReadPixels); + SET_Rotated(exec, _mesa_Rotated); + SET_Scaled(exec, _mesa_Scaled); + SET_SecondaryColorPointerEXT(exec, _mesa_SecondaryColorPointerEXT); + SET_TexEnvf(exec, _mesa_TexEnvf); + SET_TexEnviv(exec, _mesa_TexEnviv); + +#if FEATURE_texgen + SET_GetTexGendv(exec, _mesa_GetTexGendv); + SET_GetTexGenfv(exec, _mesa_GetTexGenfv); + SET_GetTexGeniv(exec, _mesa_GetTexGeniv); + SET_TexGend(exec, _mesa_TexGend); + SET_TexGendv(exec, _mesa_TexGendv); + SET_TexGenf(exec, _mesa_TexGenf); + SET_TexGenfv(exec, _mesa_TexGenfv); + SET_TexGeni(exec, _mesa_TexGeni); + SET_TexGeniv(exec, _mesa_TexGeniv); +#endif + + SET_TexImage1D(exec, _mesa_TexImage1D); + SET_TexParameterf(exec, _mesa_TexParameterf); + SET_TexParameterfv(exec, _mesa_TexParameterfv); + SET_TexParameteriv(exec, _mesa_TexParameteriv); + SET_Translated(exec, _mesa_Translated); + + /* 1.1 */ + SET_BindTexture(exec, _mesa_BindTexture); + SET_DeleteTextures(exec, _mesa_DeleteTextures); + SET_GenTextures(exec, _mesa_GenTextures); +#if _HAVE_FULL_GL + SET_AreTexturesResident(exec, _mesa_AreTexturesResident); + SET_ColorPointer(exec, _mesa_ColorPointer); + SET_CopyTexImage1D(exec, _mesa_CopyTexImage1D); + SET_CopyTexImage2D(exec, _mesa_CopyTexImage2D); + SET_CopyTexSubImage1D(exec, _mesa_CopyTexSubImage1D); + SET_CopyTexSubImage2D(exec, _mesa_CopyTexSubImage2D); + SET_DisableClientState(exec, _mesa_DisableClientState); + SET_EdgeFlagPointer(exec, _mesa_EdgeFlagPointer); + SET_EnableClientState(exec, _mesa_EnableClientState); + SET_GetPointerv(exec, _mesa_GetPointerv); + SET_IndexPointer(exec, _mesa_IndexPointer); + SET_InterleavedArrays(exec, _mesa_InterleavedArrays); + SET_IsTexture(exec, _mesa_IsTexture); + SET_NormalPointer(exec, _mesa_NormalPointer); + SET_PrioritizeTextures(exec, _mesa_PrioritizeTextures); + SET_TexCoordPointer(exec, _mesa_TexCoordPointer); + SET_TexSubImage1D(exec, _mesa_TexSubImage1D); + SET_TexSubImage2D(exec, _mesa_TexSubImage2D); + SET_VertexPointer(exec, _mesa_VertexPointer); +#endif + + /* 1.2 */ +#if _HAVE_FULL_GL + SET_CopyTexSubImage3D(exec, _mesa_CopyTexSubImage3D); + SET_TexImage3D(exec, _mesa_TexImage3D); + SET_TexSubImage3D(exec, _mesa_TexSubImage3D); +#endif + + /* OpenGL 1.2 GL_ARB_imaging */ + SET_BlendColor(exec, _mesa_BlendColor); + SET_BlendEquation(exec, _mesa_BlendEquation); + SET_BlendEquationSeparateEXT(exec, _mesa_BlendEquationSeparateEXT); + +#if FEATURE_colortable + SET_ColorSubTable(exec, _mesa_ColorSubTable); + SET_ColorTable(exec, _mesa_ColorTable); + SET_ColorTableParameterfv(exec, _mesa_ColorTableParameterfv); + SET_ColorTableParameteriv(exec, _mesa_ColorTableParameteriv); + SET_CopyColorSubTable(exec, _mesa_CopyColorSubTable); + SET_CopyColorTable(exec, _mesa_CopyColorTable); + SET_GetColorTable(exec, _mesa_GetColorTable); + SET_GetColorTableParameterfv(exec, _mesa_GetColorTableParameterfv); + SET_GetColorTableParameteriv(exec, _mesa_GetColorTableParameteriv); +#endif + +#if FEATURE_convolution + SET_ConvolutionFilter1D(exec, _mesa_ConvolutionFilter1D); + SET_ConvolutionFilter2D(exec, _mesa_ConvolutionFilter2D); + SET_ConvolutionParameterf(exec, _mesa_ConvolutionParameterf); + SET_ConvolutionParameterfv(exec, _mesa_ConvolutionParameterfv); + SET_ConvolutionParameteri(exec, _mesa_ConvolutionParameteri); + SET_ConvolutionParameteriv(exec, _mesa_ConvolutionParameteriv); + SET_CopyConvolutionFilter1D(exec, _mesa_CopyConvolutionFilter1D); + SET_CopyConvolutionFilter2D(exec, _mesa_CopyConvolutionFilter2D); + SET_GetConvolutionFilter(exec, _mesa_GetConvolutionFilter); + SET_GetConvolutionParameterfv(exec, _mesa_GetConvolutionParameterfv); + SET_GetConvolutionParameteriv(exec, _mesa_GetConvolutionParameteriv); + SET_SeparableFilter2D(exec, _mesa_SeparableFilter2D); +#endif +#if FEATURE_histogram + SET_GetHistogram(exec, _mesa_GetHistogram); + SET_GetHistogramParameterfv(exec, _mesa_GetHistogramParameterfv); + SET_GetHistogramParameteriv(exec, _mesa_GetHistogramParameteriv); + SET_GetMinmax(exec, _mesa_GetMinmax); + SET_GetMinmaxParameterfv(exec, _mesa_GetMinmaxParameterfv); + SET_GetMinmaxParameteriv(exec, _mesa_GetMinmaxParameteriv); + SET_GetSeparableFilter(exec, _mesa_GetSeparableFilter); + SET_Histogram(exec, _mesa_Histogram); + SET_Minmax(exec, _mesa_Minmax); + SET_ResetHistogram(exec, _mesa_ResetHistogram); + SET_ResetMinmax(exec, _mesa_ResetMinmax); +#endif + + /* OpenGL 2.0 */ + 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 +/* SET_BlendColorEXT(exec, _mesa_BlendColorEXT); */ +#endif + + /* 3. GL_EXT_polygon_offset */ +#if _HAVE_FULL_GL + SET_PolygonOffsetEXT(exec, _mesa_PolygonOffsetEXT); +#endif + + /* 6. GL_EXT_texture3d */ +#if 0 +/* SET_CopyTexSubImage3DEXT(exec, _mesa_CopyTexSubImage3D); */ +/* SET_TexImage3DEXT(exec, _mesa_TexImage3DEXT); */ +/* SET_TexSubImage3DEXT(exec, _mesa_TexSubImage3D); */ +#endif + + /* 11. GL_EXT_histogram */ +#if 0 + SET_GetHistogramEXT(exec, _mesa_GetHistogram); + SET_GetHistogramParameterfvEXT(exec, _mesa_GetHistogramParameterfv); + SET_GetHistogramParameterivEXT(exec, _mesa_GetHistogramParameteriv); + SET_GetMinmaxEXT(exec, _mesa_GetMinmax); + SET_GetMinmaxParameterfvEXT(exec, _mesa_GetMinmaxParameterfv); + SET_GetMinmaxParameterivEXT(exec, _mesa_GetMinmaxParameteriv); +#endif + + /* 14. SGI_color_table */ +#if 0 + SET_ColorTableSGI(exec, _mesa_ColorTable); + SET_ColorSubTableSGI(exec, _mesa_ColorSubTable); + SET_GetColorTableSGI(exec, _mesa_GetColorTable); + SET_GetColorTableParameterfvSGI(exec, _mesa_GetColorTableParameterfv); + SET_GetColorTableParameterivSGI(exec, _mesa_GetColorTableParameteriv); +#endif + + /* 30. GL_EXT_vertex_array */ +#if _HAVE_FULL_GL + SET_ColorPointerEXT(exec, _mesa_ColorPointerEXT); + SET_EdgeFlagPointerEXT(exec, _mesa_EdgeFlagPointerEXT); + SET_IndexPointerEXT(exec, _mesa_IndexPointerEXT); + SET_NormalPointerEXT(exec, _mesa_NormalPointerEXT); + SET_TexCoordPointerEXT(exec, _mesa_TexCoordPointerEXT); + SET_VertexPointerEXT(exec, _mesa_VertexPointerEXT); +#endif + + /* 37. GL_EXT_blend_minmax */ +#if 0 + SET_BlendEquationEXT(exec, _mesa_BlendEquationEXT); +#endif + + /* 54. GL_EXT_point_parameters */ +#if _HAVE_FULL_GL + SET_PointParameterfEXT(exec, _mesa_PointParameterf); + SET_PointParameterfvEXT(exec, _mesa_PointParameterfv); +#endif + + /* 97. GL_EXT_compiled_vertex_array */ +#if _HAVE_FULL_GL + SET_LockArraysEXT(exec, _mesa_LockArraysEXT); + SET_UnlockArraysEXT(exec, _mesa_UnlockArraysEXT); +#endif + + /* 148. GL_EXT_multi_draw_arrays */ +#if _HAVE_FULL_GL + SET_MultiDrawArraysEXT(exec, _mesa_MultiDrawArraysEXT); + SET_MultiDrawElementsEXT(exec, _mesa_MultiDrawElementsEXT); +#endif + + /* 173. GL_INGR_blend_func_separate */ +#if _HAVE_FULL_GL + SET_BlendFuncSeparateEXT(exec, _mesa_BlendFuncSeparateEXT); +#endif + + /* 196. GL_MESA_resize_buffers */ +#if _HAVE_FULL_GL + SET_ResizeBuffersMESA(exec, _mesa_ResizeBuffersMESA); +#endif + + /* 197. GL_MESA_window_pos */ +#if FEATURE_drawpix + SET_WindowPos2dMESA(exec, _mesa_WindowPos2dMESA); + SET_WindowPos2dvMESA(exec, _mesa_WindowPos2dvMESA); + SET_WindowPos2fMESA(exec, _mesa_WindowPos2fMESA); + SET_WindowPos2fvMESA(exec, _mesa_WindowPos2fvMESA); + SET_WindowPos2iMESA(exec, _mesa_WindowPos2iMESA); + SET_WindowPos2ivMESA(exec, _mesa_WindowPos2ivMESA); + SET_WindowPos2sMESA(exec, _mesa_WindowPos2sMESA); + SET_WindowPos2svMESA(exec, _mesa_WindowPos2svMESA); + SET_WindowPos3dMESA(exec, _mesa_WindowPos3dMESA); + SET_WindowPos3dvMESA(exec, _mesa_WindowPos3dvMESA); + SET_WindowPos3fMESA(exec, _mesa_WindowPos3fMESA); + SET_WindowPos3fvMESA(exec, _mesa_WindowPos3fvMESA); + SET_WindowPos3iMESA(exec, _mesa_WindowPos3iMESA); + SET_WindowPos3ivMESA(exec, _mesa_WindowPos3ivMESA); + SET_WindowPos3sMESA(exec, _mesa_WindowPos3sMESA); + SET_WindowPos3svMESA(exec, _mesa_WindowPos3svMESA); + SET_WindowPos4dMESA(exec, _mesa_WindowPos4dMESA); + SET_WindowPos4dvMESA(exec, _mesa_WindowPos4dvMESA); + SET_WindowPos4fMESA(exec, _mesa_WindowPos4fMESA); + SET_WindowPos4fvMESA(exec, _mesa_WindowPos4fvMESA); + SET_WindowPos4iMESA(exec, _mesa_WindowPos4iMESA); + SET_WindowPos4ivMESA(exec, _mesa_WindowPos4ivMESA); + SET_WindowPos4sMESA(exec, _mesa_WindowPos4sMESA); + SET_WindowPos4svMESA(exec, _mesa_WindowPos4svMESA); +#endif + + /* 200. GL_IBM_multimode_draw_arrays */ +#if _HAVE_FULL_GL + SET_MultiModeDrawArraysIBM(exec, _mesa_MultiModeDrawArraysIBM); + SET_MultiModeDrawElementsIBM(exec, _mesa_MultiModeDrawElementsIBM); +#endif + + /* 233. GL_NV_vertex_program */ +#if FEATURE_NV_vertex_program + SET_BindProgramNV(exec, _mesa_BindProgram); + SET_DeleteProgramsNV(exec, _mesa_DeletePrograms); + SET_ExecuteProgramNV(exec, _mesa_ExecuteProgramNV); + SET_GenProgramsNV(exec, _mesa_GenPrograms); + SET_AreProgramsResidentNV(exec, _mesa_AreProgramsResidentNV); + SET_RequestResidentProgramsNV(exec, _mesa_RequestResidentProgramsNV); + SET_GetProgramParameterfvNV(exec, _mesa_GetProgramParameterfvNV); + SET_GetProgramParameterdvNV(exec, _mesa_GetProgramParameterdvNV); + SET_GetProgramivNV(exec, _mesa_GetProgramivNV); + SET_GetProgramStringNV(exec, _mesa_GetProgramStringNV); + SET_GetTrackMatrixivNV(exec, _mesa_GetTrackMatrixivNV); + SET_GetVertexAttribdvNV(exec, _mesa_GetVertexAttribdvNV); + SET_GetVertexAttribfvNV(exec, _mesa_GetVertexAttribfvNV); + SET_GetVertexAttribivNV(exec, _mesa_GetVertexAttribivNV); + SET_GetVertexAttribPointervNV(exec, _mesa_GetVertexAttribPointervNV); + SET_IsProgramNV(exec, _mesa_IsProgramARB); + SET_LoadProgramNV(exec, _mesa_LoadProgramNV); + SET_ProgramEnvParameter4dARB(exec, _mesa_ProgramEnvParameter4dARB); /* alias to ProgramParameter4dNV */ + SET_ProgramEnvParameter4dvARB(exec, _mesa_ProgramEnvParameter4dvARB); /* alias to ProgramParameter4dvNV */ + SET_ProgramEnvParameter4fARB(exec, _mesa_ProgramEnvParameter4fARB); /* alias to ProgramParameter4fNV */ + SET_ProgramEnvParameter4fvARB(exec, _mesa_ProgramEnvParameter4fvARB); /* alias to ProgramParameter4fvNV */ + SET_ProgramParameters4dvNV(exec, _mesa_ProgramParameters4dvNV); + SET_ProgramParameters4fvNV(exec, _mesa_ProgramParameters4fvNV); + SET_TrackMatrixNV(exec, _mesa_TrackMatrixNV); + SET_VertexAttribPointerNV(exec, _mesa_VertexAttribPointerNV); + /* glVertexAttrib*NV functions handled in api_loopback.c */ +#endif + + /* 273. GL_APPLE_vertex_array_object */ + SET_BindVertexArrayAPPLE(exec, _mesa_BindVertexArrayAPPLE); + SET_DeleteVertexArraysAPPLE(exec, _mesa_DeleteVertexArraysAPPLE); + SET_GenVertexArraysAPPLE(exec, _mesa_GenVertexArraysAPPLE); + SET_IsVertexArrayAPPLE(exec, _mesa_IsVertexArrayAPPLE); + + /* 282. GL_NV_fragment_program */ +#if FEATURE_NV_fragment_program + SET_ProgramNamedParameter4fNV(exec, _mesa_ProgramNamedParameter4fNV); + SET_ProgramNamedParameter4dNV(exec, _mesa_ProgramNamedParameter4dNV); + SET_ProgramNamedParameter4fvNV(exec, _mesa_ProgramNamedParameter4fvNV); + SET_ProgramNamedParameter4dvNV(exec, _mesa_ProgramNamedParameter4dvNV); + SET_GetProgramNamedParameterfvNV(exec, _mesa_GetProgramNamedParameterfvNV); + SET_GetProgramNamedParameterdvNV(exec, _mesa_GetProgramNamedParameterdvNV); + SET_ProgramLocalParameter4dARB(exec, _mesa_ProgramLocalParameter4dARB); + SET_ProgramLocalParameter4dvARB(exec, _mesa_ProgramLocalParameter4dvARB); + SET_ProgramLocalParameter4fARB(exec, _mesa_ProgramLocalParameter4fARB); + SET_ProgramLocalParameter4fvARB(exec, _mesa_ProgramLocalParameter4fvARB); + SET_GetProgramLocalParameterdvARB(exec, _mesa_GetProgramLocalParameterdvARB); + SET_GetProgramLocalParameterfvARB(exec, _mesa_GetProgramLocalParameterfvARB); +#endif + + /* 262. GL_NV_point_sprite */ +#if _HAVE_FULL_GL + SET_PointParameteriNV(exec, _mesa_PointParameteri); + SET_PointParameterivNV(exec, _mesa_PointParameteriv); +#endif + + /* 268. GL_EXT_stencil_two_side */ +#if _HAVE_FULL_GL + SET_ActiveStencilFaceEXT(exec, _mesa_ActiveStencilFaceEXT); +#endif + + /* ???. GL_EXT_depth_bounds_test */ + SET_DepthBoundsEXT(exec, _mesa_DepthBoundsEXT); + + /* ARB 1. GL_ARB_multitexture */ +#if _HAVE_FULL_GL + SET_ActiveTextureARB(exec, _mesa_ActiveTextureARB); + SET_ClientActiveTextureARB(exec, _mesa_ClientActiveTextureARB); +#endif + + /* ARB 3. GL_ARB_transpose_matrix */ +#if _HAVE_FULL_GL + SET_LoadTransposeMatrixdARB(exec, _mesa_LoadTransposeMatrixdARB); + SET_LoadTransposeMatrixfARB(exec, _mesa_LoadTransposeMatrixfARB); + SET_MultTransposeMatrixdARB(exec, _mesa_MultTransposeMatrixdARB); + SET_MultTransposeMatrixfARB(exec, _mesa_MultTransposeMatrixfARB); +#endif + + /* ARB 5. GL_ARB_multisample */ +#if _HAVE_FULL_GL + SET_SampleCoverageARB(exec, _mesa_SampleCoverageARB); +#endif + + /* ARB 12. GL_ARB_texture_compression */ +#if _HAVE_FULL_GL + SET_CompressedTexImage3DARB(exec, _mesa_CompressedTexImage3DARB); + SET_CompressedTexImage2DARB(exec, _mesa_CompressedTexImage2DARB); + SET_CompressedTexImage1DARB(exec, _mesa_CompressedTexImage1DARB); + SET_CompressedTexSubImage3DARB(exec, _mesa_CompressedTexSubImage3DARB); + SET_CompressedTexSubImage2DARB(exec, _mesa_CompressedTexSubImage2DARB); + SET_CompressedTexSubImage1DARB(exec, _mesa_CompressedTexSubImage1DARB); + SET_GetCompressedTexImageARB(exec, _mesa_GetCompressedTexImageARB); +#endif + + /* ARB 14. GL_ARB_point_parameters */ + /* reuse EXT_point_parameters functions */ + + /* ARB 26. GL_ARB_vertex_program */ + /* ARB 27. GL_ARB_fragment_program */ +#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program + /* glVertexAttrib1sARB aliases glVertexAttrib1sNV */ + /* glVertexAttrib1fARB aliases glVertexAttrib1fNV */ + /* glVertexAttrib1dARB aliases glVertexAttrib1dNV */ + /* glVertexAttrib2sARB aliases glVertexAttrib2sNV */ + /* glVertexAttrib2fARB aliases glVertexAttrib2fNV */ + /* glVertexAttrib2dARB aliases glVertexAttrib2dNV */ + /* glVertexAttrib3sARB aliases glVertexAttrib3sNV */ + /* glVertexAttrib3fARB aliases glVertexAttrib3fNV */ + /* glVertexAttrib3dARB aliases glVertexAttrib3dNV */ + /* glVertexAttrib4sARB aliases glVertexAttrib4sNV */ + /* glVertexAttrib4fARB aliases glVertexAttrib4fNV */ + /* glVertexAttrib4dARB aliases glVertexAttrib4dNV */ + /* glVertexAttrib4NubARB aliases glVertexAttrib4NubNV */ + /* glVertexAttrib1svARB aliases glVertexAttrib1svNV */ + /* glVertexAttrib1fvARB aliases glVertexAttrib1fvNV */ + /* glVertexAttrib1dvARB aliases glVertexAttrib1dvNV */ + /* glVertexAttrib2svARB aliases glVertexAttrib2svNV */ + /* glVertexAttrib2fvARB aliases glVertexAttrib2fvNV */ + /* glVertexAttrib2dvARB aliases glVertexAttrib2dvNV */ + /* glVertexAttrib3svARB aliases glVertexAttrib3svNV */ + /* glVertexAttrib3fvARB aliases glVertexAttrib3fvNV */ + /* glVertexAttrib3dvARB aliases glVertexAttrib3dvNV */ + /* glVertexAttrib4svARB aliases glVertexAttrib4svNV */ + /* glVertexAttrib4fvARB aliases glVertexAttrib4fvNV */ + /* glVertexAttrib4dvARB aliases glVertexAttrib4dvNV */ + /* glVertexAttrib4NubvARB aliases glVertexAttrib4NubvNV */ + /* glVertexAttrib4bvARB handled in api_loopback.c */ + /* glVertexAttrib4ivARB handled in api_loopback.c */ + /* glVertexAttrib4ubvARB handled in api_loopback.c */ + /* glVertexAttrib4usvARB handled in api_loopback.c */ + /* glVertexAttrib4uivARB handled in api_loopback.c */ + /* glVertexAttrib4NbvARB handled in api_loopback.c */ + /* glVertexAttrib4NsvARB handled in api_loopback.c */ + /* glVertexAttrib4NivARB handled in api_loopback.c */ + /* glVertexAttrib4NusvARB handled in api_loopback.c */ + /* glVertexAttrib4NuivARB handled in api_loopback.c */ + SET_VertexAttribPointerARB(exec, _mesa_VertexAttribPointerARB); + SET_EnableVertexAttribArrayARB(exec, _mesa_EnableVertexAttribArrayARB); + SET_DisableVertexAttribArrayARB(exec, _mesa_DisableVertexAttribArrayARB); + SET_ProgramStringARB(exec, _mesa_ProgramStringARB); + /* glBindProgramARB aliases glBindProgramNV */ + /* glDeleteProgramsARB aliases glDeleteProgramsNV */ + /* glGenProgramsARB aliases glGenProgramsNV */ + /* glIsProgramARB aliases glIsProgramNV */ + SET_GetVertexAttribdvARB(exec, _mesa_GetVertexAttribdvARB); + SET_GetVertexAttribfvARB(exec, _mesa_GetVertexAttribfvARB); + SET_GetVertexAttribivARB(exec, _mesa_GetVertexAttribivARB); + /* glGetVertexAttribPointervARB aliases glGetVertexAttribPointervNV */ + SET_ProgramEnvParameter4dARB(exec, _mesa_ProgramEnvParameter4dARB); + SET_ProgramEnvParameter4dvARB(exec, _mesa_ProgramEnvParameter4dvARB); + SET_ProgramEnvParameter4fARB(exec, _mesa_ProgramEnvParameter4fARB); + SET_ProgramEnvParameter4fvARB(exec, _mesa_ProgramEnvParameter4fvARB); + SET_ProgramLocalParameter4dARB(exec, _mesa_ProgramLocalParameter4dARB); + SET_ProgramLocalParameter4dvARB(exec, _mesa_ProgramLocalParameter4dvARB); + SET_ProgramLocalParameter4fARB(exec, _mesa_ProgramLocalParameter4fARB); + SET_ProgramLocalParameter4fvARB(exec, _mesa_ProgramLocalParameter4fvARB); + SET_GetProgramEnvParameterdvARB(exec, _mesa_GetProgramEnvParameterdvARB); + SET_GetProgramEnvParameterfvARB(exec, _mesa_GetProgramEnvParameterfvARB); + SET_GetProgramLocalParameterdvARB(exec, _mesa_GetProgramLocalParameterdvARB); + SET_GetProgramLocalParameterfvARB(exec, _mesa_GetProgramLocalParameterfvARB); + SET_GetProgramivARB(exec, _mesa_GetProgramivARB); + SET_GetProgramStringARB(exec, _mesa_GetProgramStringARB); +#endif + + /* ARB 28. GL_ARB_vertex_buffer_object */ +#if FEATURE_ARB_vertex_buffer_object + SET_BindBufferARB(exec, _mesa_BindBufferARB); + SET_BufferDataARB(exec, _mesa_BufferDataARB); + SET_BufferSubDataARB(exec, _mesa_BufferSubDataARB); + SET_DeleteBuffersARB(exec, _mesa_DeleteBuffersARB); + SET_GenBuffersARB(exec, _mesa_GenBuffersARB); + SET_GetBufferParameterivARB(exec, _mesa_GetBufferParameterivARB); + SET_GetBufferPointervARB(exec, _mesa_GetBufferPointervARB); + SET_GetBufferSubDataARB(exec, _mesa_GetBufferSubDataARB); + SET_IsBufferARB(exec, _mesa_IsBufferARB); + SET_MapBufferARB(exec, _mesa_MapBufferARB); + SET_UnmapBufferARB(exec, _mesa_UnmapBufferARB); +#endif + + /* ARB 29. GL_ARB_occlusion_query */ +#if FEATURE_ARB_occlusion_query + SET_GenQueriesARB(exec, _mesa_GenQueriesARB); + SET_DeleteQueriesARB(exec, _mesa_DeleteQueriesARB); + SET_IsQueryARB(exec, _mesa_IsQueryARB); + SET_BeginQueryARB(exec, _mesa_BeginQueryARB); + SET_EndQueryARB(exec, _mesa_EndQueryARB); + SET_GetQueryivARB(exec, _mesa_GetQueryivARB); + SET_GetQueryObjectivARB(exec, _mesa_GetQueryObjectivARB); + SET_GetQueryObjectuivARB(exec, _mesa_GetQueryObjectuivARB); +#endif + + /* ARB 37. GL_ARB_draw_buffers */ +#if FEATURE_draw_read_buffer + SET_DrawBuffersARB(exec, _mesa_DrawBuffersARB); +#endif + +#if FEATURE_ARB_shader_objects + SET_DeleteObjectARB(exec, _mesa_DeleteObjectARB); + SET_GetHandleARB(exec, _mesa_GetHandleARB); + SET_DetachObjectARB(exec, _mesa_DetachObjectARB); + SET_CreateShaderObjectARB(exec, _mesa_CreateShaderObjectARB); + SET_ShaderSourceARB(exec, _mesa_ShaderSourceARB); + SET_CompileShaderARB(exec, _mesa_CompileShaderARB); + SET_CreateProgramObjectARB(exec, _mesa_CreateProgramObjectARB); + SET_AttachObjectARB(exec, _mesa_AttachObjectARB); + SET_LinkProgramARB(exec, _mesa_LinkProgramARB); + SET_UseProgramObjectARB(exec, _mesa_UseProgramObjectARB); + SET_ValidateProgramARB(exec, _mesa_ValidateProgramARB); + SET_Uniform1fARB(exec, _mesa_Uniform1fARB); + SET_Uniform2fARB(exec, _mesa_Uniform2fARB); + SET_Uniform3fARB(exec, _mesa_Uniform3fARB); + SET_Uniform4fARB(exec, _mesa_Uniform4fARB); + SET_Uniform1iARB(exec, _mesa_Uniform1iARB); + SET_Uniform2iARB(exec, _mesa_Uniform2iARB); + SET_Uniform3iARB(exec, _mesa_Uniform3iARB); + SET_Uniform4iARB(exec, _mesa_Uniform4iARB); + SET_Uniform1fvARB(exec, _mesa_Uniform1fvARB); + SET_Uniform2fvARB(exec, _mesa_Uniform2fvARB); + SET_Uniform3fvARB(exec, _mesa_Uniform3fvARB); + SET_Uniform4fvARB(exec, _mesa_Uniform4fvARB); + SET_Uniform1ivARB(exec, _mesa_Uniform1ivARB); + SET_Uniform2ivARB(exec, _mesa_Uniform2ivARB); + SET_Uniform3ivARB(exec, _mesa_Uniform3ivARB); + SET_Uniform4ivARB(exec, _mesa_Uniform4ivARB); + SET_UniformMatrix2fvARB(exec, _mesa_UniformMatrix2fvARB); + SET_UniformMatrix3fvARB(exec, _mesa_UniformMatrix3fvARB); + SET_UniformMatrix4fvARB(exec, _mesa_UniformMatrix4fvARB); + SET_GetObjectParameterfvARB(exec, _mesa_GetObjectParameterfvARB); + SET_GetObjectParameterivARB(exec, _mesa_GetObjectParameterivARB); + SET_GetInfoLogARB(exec, _mesa_GetInfoLogARB); + SET_GetAttachedObjectsARB(exec, _mesa_GetAttachedObjectsARB); + SET_GetUniformLocationARB(exec, _mesa_GetUniformLocationARB); + SET_GetActiveUniformARB(exec, _mesa_GetActiveUniformARB); + SET_GetUniformfvARB(exec, _mesa_GetUniformfvARB); + SET_GetUniformivARB(exec, _mesa_GetUniformivARB); + SET_GetShaderSourceARB(exec, _mesa_GetShaderSourceARB); +#endif /* FEATURE_ARB_shader_objects */ + +#if FEATURE_ARB_vertex_shader + SET_BindAttribLocationARB(exec, _mesa_BindAttribLocationARB); + SET_GetActiveAttribARB(exec, _mesa_GetActiveAttribARB); + SET_GetAttribLocationARB(exec, _mesa_GetAttribLocationARB); +#endif /* FEATURE_ARB_vertex_shader */ + + /* GL_ATI_fragment_shader */ +#if FEATURE_ATI_fragment_shader + SET_GenFragmentShadersATI(exec, _mesa_GenFragmentShadersATI); + SET_BindFragmentShaderATI(exec, _mesa_BindFragmentShaderATI); + SET_DeleteFragmentShaderATI(exec, _mesa_DeleteFragmentShaderATI); + SET_BeginFragmentShaderATI(exec, _mesa_BeginFragmentShaderATI); + SET_EndFragmentShaderATI(exec, _mesa_EndFragmentShaderATI); + SET_PassTexCoordATI(exec, _mesa_PassTexCoordATI); + SET_SampleMapATI(exec, _mesa_SampleMapATI); + SET_ColorFragmentOp1ATI(exec, _mesa_ColorFragmentOp1ATI); + SET_ColorFragmentOp2ATI(exec, _mesa_ColorFragmentOp2ATI); + SET_ColorFragmentOp3ATI(exec, _mesa_ColorFragmentOp3ATI); + SET_AlphaFragmentOp1ATI(exec, _mesa_AlphaFragmentOp1ATI); + SET_AlphaFragmentOp2ATI(exec, _mesa_AlphaFragmentOp2ATI); + SET_AlphaFragmentOp3ATI(exec, _mesa_AlphaFragmentOp3ATI); + SET_SetFragmentShaderConstantATI(exec, _mesa_SetFragmentShaderConstantATI); +#endif + +#if FEATURE_EXT_framebuffer_object + SET_IsRenderbufferEXT(exec, _mesa_IsRenderbufferEXT); + SET_BindRenderbufferEXT(exec, _mesa_BindRenderbufferEXT); + SET_DeleteRenderbuffersEXT(exec, _mesa_DeleteRenderbuffersEXT); + SET_GenRenderbuffersEXT(exec, _mesa_GenRenderbuffersEXT); + SET_RenderbufferStorageEXT(exec, _mesa_RenderbufferStorageEXT); + SET_GetRenderbufferParameterivEXT(exec, _mesa_GetRenderbufferParameterivEXT); + SET_IsFramebufferEXT(exec, _mesa_IsFramebufferEXT); + SET_BindFramebufferEXT(exec, _mesa_BindFramebufferEXT); + SET_DeleteFramebuffersEXT(exec, _mesa_DeleteFramebuffersEXT); + SET_GenFramebuffersEXT(exec, _mesa_GenFramebuffersEXT); + SET_CheckFramebufferStatusEXT(exec, _mesa_CheckFramebufferStatusEXT); + SET_FramebufferTexture1DEXT(exec, _mesa_FramebufferTexture1DEXT); + SET_FramebufferTexture2DEXT(exec, _mesa_FramebufferTexture2DEXT); + SET_FramebufferTexture3DEXT(exec, _mesa_FramebufferTexture3DEXT); + SET_FramebufferRenderbufferEXT(exec, _mesa_FramebufferRenderbufferEXT); + SET_GetFramebufferAttachmentParameterivEXT(exec, _mesa_GetFramebufferAttachmentParameterivEXT); + SET_GenerateMipmapEXT(exec, _mesa_GenerateMipmapEXT); +#endif + +#if FEATURE_EXT_timer_query + SET_GetQueryObjecti64vEXT(exec, _mesa_GetQueryObjecti64vEXT); + SET_GetQueryObjectui64vEXT(exec, _mesa_GetQueryObjectui64vEXT); +#endif + +#if FEATURE_EXT_framebuffer_blit + SET_BlitFramebufferEXT(exec, _mesa_BlitFramebufferEXT); +#endif + + /* GL_EXT_gpu_program_parameters */ +#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program + SET_ProgramEnvParameters4fvEXT(exec, _mesa_ProgramEnvParameters4fvEXT); + SET_ProgramLocalParameters4fvEXT(exec, _mesa_ProgramLocalParameters4fvEXT); +#endif + + /* GL_MESA_texture_array / GL_EXT_texture_array */ +#if FEATURE_EXT_framebuffer_object + SET_FramebufferTextureLayerEXT(exec, _mesa_FramebufferTextureLayerEXT); +#endif + + /* GL_ATI_separate_stencil */ + SET_StencilFuncSeparateATI(exec, _mesa_StencilFuncSeparateATI); +} + diff --git a/src/mesa/swrast/s_drawpix.h b/src/mesa/main/api_exec.h index 66067115dd..4bd715053a 100644 --- a/src/mesa/swrast/s_drawpix.h +++ b/src/mesa/main/api_exec.h @@ -1,9 +1,8 @@ - /* * Mesa 3-D graphics library - * Version: 3.5 + * Version: 7.1 * - * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2008 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"), @@ -24,13 +23,15 @@ */ -#ifndef S_DRAWPIXELS_H -#define S_DRAWPIXELS_H +#ifndef API_EXEC_H +#define API_EXEC_H + + +struct _glapi_table; -#include "mtypes.h" -#include "swrast.h" +extern void +_mesa_init_exec_table(struct _glapi_table *exec); -/* XXX kill this header? */ #endif diff --git a/src/mesa/main/api_noop.c b/src/mesa/main/api_noop.c index 3df64362ea..a1cc3a2a4b 100644 --- a/src/mesa/main/api_noop.c +++ b/src/mesa/main/api_noop.c @@ -30,7 +30,9 @@ #include "context.h" #include "light.h" #include "macros.h" +#if FEATURE_dlist #include "dlist.h" +#endif #include "glapi/dispatch.h" @@ -621,6 +623,8 @@ static void GLAPIENTRY _mesa_noop_Vertex4f( GLfloat a, GLfloat b, GLfloat c, GLf (void) a; (void) b; (void) c; (void) d; } + +#if FEATURE_evaluators /* Similarly, these have no effect outside begin/end: */ static void GLAPIENTRY _mesa_noop_EvalCoord1f( GLfloat a ) @@ -652,6 +656,7 @@ static void GLAPIENTRY _mesa_noop_EvalPoint2( GLint a, GLint b ) { (void) a; (void) b; } +#endif /* FEATURE_evaluators */ /* Begin -- call into driver, should result in the vtxfmt being @@ -904,20 +909,24 @@ _mesa_noop_vtxfmt_init( GLvertexformat *vfmt ) { vfmt->ArrayElement = _ae_loopback_array_elt; /* generic helper */ vfmt->Begin = _mesa_noop_Begin; +#if FEATURE_dlist vfmt->CallList = _mesa_CallList; vfmt->CallLists = _mesa_CallLists; +#endif vfmt->Color3f = _mesa_noop_Color3f; vfmt->Color3fv = _mesa_noop_Color3fv; vfmt->Color4f = _mesa_noop_Color4f; vfmt->Color4fv = _mesa_noop_Color4fv; vfmt->EdgeFlag = _mesa_noop_EdgeFlag; vfmt->End = _mesa_noop_End; +#if FEATURE_evaluators vfmt->EvalCoord1f = _mesa_noop_EvalCoord1f; vfmt->EvalCoord1fv = _mesa_noop_EvalCoord1fv; vfmt->EvalCoord2f = _mesa_noop_EvalCoord2f; vfmt->EvalCoord2fv = _mesa_noop_EvalCoord2fv; vfmt->EvalPoint1 = _mesa_noop_EvalPoint1; vfmt->EvalPoint2 = _mesa_noop_EvalPoint2; +#endif vfmt->FogCoordfEXT = _mesa_noop_FogCoordfEXT; vfmt->FogCoordfvEXT = _mesa_noop_FogCoordfvEXT; vfmt->Indexf = _mesa_noop_Indexf; diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c index 5a19993976..98dfbb105f 100644 --- a/src/mesa/main/api_validate.c +++ b/src/mesa/main/api_validate.c @@ -131,7 +131,7 @@ _mesa_validate_DrawElements(GLcontext *ctx, } /* make sure count doesn't go outside buffer bounds */ - if (indexBytes > ctx->Array.ElementArrayBufferObj->Size) { + if (indexBytes > (GLuint) ctx->Array.ElementArrayBufferObj->Size) { _mesa_warning(ctx, "glDrawElements index out of buffer bounds"); return GL_FALSE; } diff --git a/src/mesa/main/arrayobj.c b/src/mesa/main/arrayobj.c index f08f99d8e1..1461239317 100644 --- a/src/mesa/main/arrayobj.c +++ b/src/mesa/main/arrayobj.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.5 + * Version: 7.2 * - * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. * (C) Copyright IBM Corporation 2006 * * Permission is hereby granted, free of charge, to any person obtaining a @@ -77,7 +77,7 @@ lookup_arrayobj(GLcontext *ctx, GLuint id) struct gl_array_object * _mesa_new_array_object( GLcontext *ctx, GLuint name ) { - struct gl_array_object *obj = MALLOC_STRUCT(gl_array_object); + struct gl_array_object *obj = CALLOC_STRUCT(gl_array_object); if (obj) _mesa_initialize_array_object(ctx, obj, name); return obj; @@ -164,6 +164,15 @@ _mesa_initialize_array_object( GLcontext *ctx, obj->VertexAttrib[i].Normalized = GL_FALSE; } +#if FEATURE_point_size_array + obj->PointSize.Type = GL_FLOAT; + obj->PointSize.Stride = 0; + obj->PointSize.StrideB = 0; + obj->PointSize.Ptr = NULL; + obj->PointSize.Enabled = GL_FALSE; + obj->PointSize.BufferObj = ctx->Array.NullBufferObj; +#endif + #if FEATURE_ARB_vertex_buffer_object /* Vertex array buffers */ obj->Vertex.BufferObj = ctx->Array.NullBufferObj; @@ -210,6 +219,15 @@ _mesa_remove_array_object( GLcontext *ctx, struct gl_array_object *obj ) } +static void +unbind_buffer_object( GLcontext *ctx, struct gl_buffer_object *bufObj ) +{ + if (bufObj != ctx->Array.NullBufferObj) { + _mesa_reference_buffer_object(ctx, &bufObj, NULL); + } +} + + /**********************************************************************/ /* API Functions */ /**********************************************************************/ @@ -311,18 +329,18 @@ _mesa_DeleteVertexArraysAPPLE(GLsizei n, const GLuint *ids) /* Unbind any buffer objects that might be bound to arrays in * this array object. */ - _mesa_unbind_buffer_object( ctx, obj->Vertex.BufferObj ); - _mesa_unbind_buffer_object( ctx, obj->Normal.BufferObj ); - _mesa_unbind_buffer_object( ctx, obj->Color.BufferObj ); - _mesa_unbind_buffer_object( ctx, obj->SecondaryColor.BufferObj ); - _mesa_unbind_buffer_object( ctx, obj->FogCoord.BufferObj ); - _mesa_unbind_buffer_object( ctx, obj->Index.BufferObj ); + unbind_buffer_object( ctx, obj->Vertex.BufferObj ); + unbind_buffer_object( ctx, obj->Normal.BufferObj ); + unbind_buffer_object( ctx, obj->Color.BufferObj ); + unbind_buffer_object( ctx, obj->SecondaryColor.BufferObj ); + unbind_buffer_object( ctx, obj->FogCoord.BufferObj ); + unbind_buffer_object( ctx, obj->Index.BufferObj ); for (i = 0; i < MAX_TEXTURE_UNITS; i++) { - _mesa_unbind_buffer_object( ctx, obj->TexCoord[i].BufferObj ); + unbind_buffer_object( ctx, obj->TexCoord[i].BufferObj ); } - _mesa_unbind_buffer_object( ctx, obj->EdgeFlag.BufferObj ); + unbind_buffer_object( ctx, obj->EdgeFlag.BufferObj ); for (i = 0; i < VERT_ATTRIB_MAX; i++) { - _mesa_unbind_buffer_object( ctx, obj->VertexAttrib[i].BufferObj ); + unbind_buffer_object( ctx, obj->VertexAttrib[i].BufferObj ); } #endif diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c index c3c1f927fd..dc85da2518 100644 --- a/src/mesa/main/attrib.c +++ b/src/mesa/main/attrib.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 7.1 + * Version: 7.2 * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2008 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,6 +30,7 @@ #include "blend.h" #include "buffers.h" #include "bufferobj.h" +#include "clear.h" #include "colormac.h" #include "colortab.h" #include "context.h" @@ -41,11 +42,16 @@ #include "light.h" #include "lines.h" #include "matrix.h" +#include "multisample.h" #include "points.h" #include "polygon.h" +#include "scissor.h" #include "simple_list.h" #include "stencil.h" +#include "texenv.h" +#include "texgen.h" #include "texobj.h" +#include "texparam.h" #include "texstate.h" #include "varray.h" #include "mtypes.h" @@ -1085,14 +1091,14 @@ _mesa_PopAttrib(void) _mesa_PointSize(point->Size); _mesa_set_enable(ctx, GL_POINT_SMOOTH, point->SmoothFlag); if (ctx->Extensions.EXT_point_parameters) { - _mesa_PointParameterfvEXT(GL_DISTANCE_ATTENUATION_EXT, - point->Params); - _mesa_PointParameterfEXT(GL_POINT_SIZE_MIN_EXT, - point->MinSize); - _mesa_PointParameterfEXT(GL_POINT_SIZE_MAX_EXT, - point->MaxSize); - _mesa_PointParameterfEXT(GL_POINT_FADE_THRESHOLD_SIZE_EXT, - point->Threshold); + _mesa_PointParameterfv(GL_DISTANCE_ATTENUATION_EXT, + point->Params); + _mesa_PointParameterf(GL_POINT_SIZE_MIN_EXT, + point->MinSize); + _mesa_PointParameterf(GL_POINT_SIZE_MAX_EXT, + point->MaxSize); + _mesa_PointParameterf(GL_POINT_FADE_THRESHOLD_SIZE_EXT, + point->Threshold); } if (ctx->Extensions.NV_point_sprite || ctx->Extensions.ARB_point_sprite) { @@ -1103,10 +1109,10 @@ _mesa_PopAttrib(void) } _mesa_set_enable(ctx, GL_POINT_SPRITE_NV,point->PointSprite); if (ctx->Extensions.NV_point_sprite) - _mesa_PointParameteriNV(GL_POINT_SPRITE_R_MODE_NV, - ctx->Point.SpriteRMode); - _mesa_PointParameterfEXT(GL_POINT_SPRITE_COORD_ORIGIN, - (GLfloat)ctx->Point.SpriteOrigin); + _mesa_PointParameteri(GL_POINT_SPRITE_R_MODE_NV, + ctx->Point.SpriteRMode); + _mesa_PointParameterf(GL_POINT_SPRITE_COORD_ORIGIN, + (GLfloat)ctx->Point.SpriteOrigin); } } break; @@ -1274,6 +1280,29 @@ adjust_buffer_object_ref_counts(struct gl_array_attrib *array, GLint step) } +/** + * Copy gl_pixelstore_attrib from src to dst, updating buffer + * object refcounts. + */ +static void +copy_pixelstore(GLcontext *ctx, + struct gl_pixelstore_attrib *dst, + const struct gl_pixelstore_attrib *src) +{ + dst->Alignment = src->Alignment; + dst->RowLength = src->RowLength; + dst->SkipPixels = src->SkipPixels; + dst->SkipRows = src->SkipRows; + dst->ImageHeight = src->ImageHeight; + dst->SkipImages = src->SkipImages; + dst->SwapBytes = src->SwapBytes; + dst->LsbFirst = src->LsbFirst; + dst->ClientStorage = src->ClientStorage; + dst->Invert = src->Invert; + _mesa_reference_buffer_object(ctx, &dst->BufferObj, src->BufferObj); +} + + #define GL_CLIENT_PACK_BIT (1<<20) #define GL_CLIENT_UNPACK_BIT (1<<21) @@ -1292,31 +1321,29 @@ _mesa_PushClientAttrib(GLbitfield mask) return; } - /* Build linked list of attribute nodes which save all attribute */ - /* groups specified by the mask. */ + /* Build linked list of attribute nodes which save all attribute + * groups specified by the mask. + */ head = NULL; if (mask & GL_CLIENT_PIXEL_STORE_BIT) { struct gl_pixelstore_attrib *attr; -#if FEATURE_EXT_pixel_buffer_object - ctx->Pack.BufferObj->RefCount++; - ctx->Unpack.BufferObj->RefCount++; -#endif /* packing attribs */ - attr = MALLOC_STRUCT( gl_pixelstore_attrib ); - MEMCPY( attr, &ctx->Pack, sizeof(struct gl_pixelstore_attrib) ); + attr = CALLOC_STRUCT( gl_pixelstore_attrib ); + copy_pixelstore(ctx, attr, &ctx->Pack); newnode = new_attrib_node( GL_CLIENT_PACK_BIT ); newnode->data = attr; newnode->next = head; head = newnode; /* unpacking attribs */ - attr = MALLOC_STRUCT( gl_pixelstore_attrib ); - MEMCPY( attr, &ctx->Unpack, sizeof(struct gl_pixelstore_attrib) ); + attr = CALLOC_STRUCT( gl_pixelstore_attrib ); + copy_pixelstore(ctx, attr, &ctx->Unpack); newnode = new_attrib_node( GL_CLIENT_UNPACK_BIT ); newnode->data = attr; newnode->next = head; head = newnode; } + if (mask & GL_CLIENT_VERTEX_ARRAY_BIT) { struct gl_array_attrib *attr; struct gl_array_object *obj; @@ -1353,7 +1380,7 @@ _mesa_PushClientAttrib(GLbitfield mask) void GLAPIENTRY _mesa_PopClientAttrib(void) { - struct gl_attrib_node *attr, *next; + struct gl_attrib_node *node, *next; GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); @@ -1364,37 +1391,31 @@ _mesa_PopClientAttrib(void) } ctx->ClientAttribStackDepth--; - attr = ctx->ClientAttribStack[ctx->ClientAttribStackDepth]; + node = ctx->ClientAttribStack[ctx->ClientAttribStackDepth]; - while (attr) { - switch (attr->kind) { + while (node) { + switch (node->kind) { case GL_CLIENT_PACK_BIT: -#if FEATURE_EXT_pixel_buffer_object - ctx->Pack.BufferObj->RefCount--; - if (ctx->Pack.BufferObj->RefCount <= 0) { - _mesa_remove_buffer_object( ctx, ctx->Pack.BufferObj ); - (*ctx->Driver.DeleteBuffer)( ctx, ctx->Pack.BufferObj ); + { + struct gl_pixelstore_attrib *store = + (struct gl_pixelstore_attrib *) node->data; + copy_pixelstore(ctx, &ctx->Pack, store); + _mesa_reference_buffer_object(ctx, &store->BufferObj, NULL); } -#endif - MEMCPY( &ctx->Pack, attr->data, - sizeof(struct gl_pixelstore_attrib) ); ctx->NewState |= _NEW_PACKUNPACK; break; case GL_CLIENT_UNPACK_BIT: -#if FEATURE_EXT_pixel_buffer_object - ctx->Unpack.BufferObj->RefCount--; - if (ctx->Unpack.BufferObj->RefCount <= 0) { - _mesa_remove_buffer_object( ctx, ctx->Unpack.BufferObj ); - (*ctx->Driver.DeleteBuffer)( ctx, ctx->Unpack.BufferObj ); + { + struct gl_pixelstore_attrib *store = + (struct gl_pixelstore_attrib *) node->data; + copy_pixelstore(ctx, &ctx->Unpack, store); + _mesa_reference_buffer_object(ctx, &store->BufferObj, NULL); } -#endif - MEMCPY( &ctx->Unpack, attr->data, - sizeof(struct gl_pixelstore_attrib) ); ctx->NewState |= _NEW_PACKUNPACK; break; case GL_CLIENT_VERTEX_ARRAY_BIT: { struct gl_array_attrib * data = - (struct gl_array_attrib *) attr->data; + (struct gl_array_attrib *) node->data; adjust_buffer_object_ref_counts(&ctx->Array, -1); @@ -1431,10 +1452,10 @@ _mesa_PopClientAttrib(void) break; } - next = attr->next; - FREE( attr->data ); - FREE( attr ); - attr = next; + next = node->next; + FREE( node->data ); + FREE( node ); + node = next; } } diff --git a/src/mesa/main/blend.c b/src/mesa/main/blend.c index 81bd4c2f32..4d4a897141 100644 --- a/src/mesa/main/blend.c +++ b/src/mesa/main/blend.c @@ -36,6 +36,7 @@ #include "enums.h" #include "macros.h" #include "mtypes.h" +#include "glapi/glapitable.h" /** @@ -45,19 +46,11 @@ * \param dfactor destination factor operator. * * \sa glBlendFunc, glBlendFuncSeparateEXT - * - * Swizzles the inputs and calls \c glBlendFuncSeparateEXT. This is done - * using the \c CurrentDispatch table in the context, so this same function - * can be used while compiling display lists. Therefore, there is no need - * for the display list code to save and restore this function. */ void GLAPIENTRY _mesa_BlendFunc( GLenum sfactor, GLenum dfactor ) { - GET_CURRENT_CONTEXT(ctx); - - (*ctx->CurrentDispatch->BlendFuncSeparateEXT)( sfactor, dfactor, - sfactor, dfactor ); + _mesa_BlendFuncSeparateEXT(sfactor, dfactor, sfactor, dfactor); } diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c index eb418610a7..918e87246f 100644 --- a/src/mesa/main/bufferobj.c +++ b/src/mesa/main/bufferobj.c @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 7.1 + * Version: 7.2 * * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. * @@ -166,22 +166,78 @@ _mesa_delete_buffer_object( GLcontext *ctx, struct gl_buffer_object *bufObj ) if (bufObj->Data) _mesa_free(bufObj->Data); + + /* assign strange values here to help w/ debugging */ + bufObj->RefCount = -1000; + bufObj->Name = ~0; + _mesa_free(bufObj); } + +/** + * Set ptr to bufObj w/ reference counting. + */ void -_mesa_unbind_buffer_object( GLcontext *ctx, struct gl_buffer_object *bufObj ) +_mesa_reference_buffer_object(GLcontext *ctx, + struct gl_buffer_object **ptr, + struct gl_buffer_object *bufObj) { - if (bufObj != ctx->Array.NullBufferObj) { - bufObj->RefCount--; - if (bufObj->RefCount <= 0) { + if (*ptr == bufObj) + return; + + if (*ptr) { + /* Unreference the old texture */ + GLboolean deleteFlag = GL_FALSE; + struct gl_buffer_object *oldObj = *ptr; + + /*_glthread_LOCK_MUTEX(oldObj->Mutex);*/ + ASSERT(oldObj->RefCount > 0); + oldObj->RefCount--; +#if 0 + printf("BufferObj %p %d DECR to %d\n", + (void *) oldObj, oldObj->Name, oldObj->RefCount); +#endif + deleteFlag = (oldObj->RefCount == 0); + /*_glthread_UNLOCK_MUTEX(oldObj->Mutex);*/ + + if (deleteFlag) { + + /* some sanity checking: don't delete a buffer still in use */ +#if 0 + /* unfortunately, these tests are invalid during context tear-down */ ASSERT(ctx->Array.ArrayBufferObj != bufObj); ASSERT(ctx->Array.ElementArrayBufferObj != bufObj); ASSERT(ctx->Array.ArrayObj->Vertex.BufferObj != bufObj); +#endif + ASSERT(ctx->Driver.DeleteBuffer); - ctx->Driver.DeleteBuffer(ctx, bufObj); + ctx->Driver.DeleteBuffer(ctx, oldObj); + } + + *ptr = NULL; + } + ASSERT(!*ptr); + + if (bufObj) { + /* reference new texture */ + /*_glthread_LOCK_MUTEX(tex->Mutex);*/ + if (bufObj->RefCount == 0) { + /* this buffer's being deleted (look just above) */ + /* Not sure this can every really happen. Warn if it does. */ + _mesa_problem(NULL, "referencing deleted buffer object"); + *ptr = NULL; + } + else { + bufObj->RefCount++; +#if 0 + printf("BufferObj %p %d INCR to %d\n", + (void *) bufObj, bufObj->Name, bufObj->RefCount); +#endif + *ptr = bufObj; } + /*_glthread_UNLOCK_MUTEX(tex->Mutex);*/ } } @@ -204,33 +260,6 @@ _mesa_initialize_buffer_object( struct gl_buffer_object *obj, /** - * Add the given buffer object to the buffer object pool. - */ -void -_mesa_save_buffer_object( GLcontext *ctx, struct gl_buffer_object *obj ) -{ - if (obj->Name > 0) { - /* insert into hash table */ - _mesa_HashInsert(ctx->Shared->BufferObjects, obj->Name, obj); - } -} - - -/** - * Remove the given buffer object from the buffer object pool. - * Do not deallocate the buffer object though. - */ -void -_mesa_remove_buffer_object( GLcontext *ctx, struct gl_buffer_object *bufObj ) -{ - if (bufObj->Name > 0) { - /* remove from hash table */ - _mesa_HashRemove(ctx->Shared->BufferObjects, bufObj->Name); - } -} - - -/** * Allocate space for and store data in a buffer object. Any data that was * previously stored in the buffer object is lost. If \c data is \c NULL, * memory will be allocated, but no copy will occur. @@ -400,6 +429,7 @@ _mesa_init_buffer_objects( GLcontext *ctx ) { /* Allocate the default buffer object and set refcount so high that * it never gets deleted. + * XXX with recent/improved refcounting this may not longer be needed. */ ctx->Array.NullBufferObj = _mesa_new_buffer_object(ctx, 0, 0); if (ctx->Array.NullBufferObj) @@ -462,28 +492,16 @@ bind_buffer_object(GLcontext *ctx, GLenum target, GLuint buffer) _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBindBufferARB"); return; } - _mesa_save_buffer_object(ctx, newBufObj); + _mesa_HashInsert(ctx->Shared->BufferObjects, buffer, newBufObj); } } - /* Make new binding */ - *bindTarget = newBufObj; - newBufObj->RefCount++; + /* bind new buffer */ + _mesa_reference_buffer_object(ctx, bindTarget, newBufObj); /* Pass BindBuffer call to device driver */ if (ctx->Driver.BindBuffer && newBufObj) ctx->Driver.BindBuffer( ctx, target, newBufObj ); - - /* decr ref count on old buffer obj, delete if needed */ - if (oldBufObj) { - oldBufObj->RefCount--; - assert(oldBufObj->RefCount >= 0); - if (oldBufObj->RefCount == 0) { - assert(oldBufObj->Name != 0); - ASSERT(ctx->Driver.DeleteBuffer); - ctx->Driver.DeleteBuffer( ctx, oldBufObj ); - } - } } @@ -716,6 +734,23 @@ _mesa_lookup_bufferobj(GLcontext *ctx, GLuint buffer) } +/** + * If *ptr points to obj, set ptr = the Null/default buffer object. + * This is a helper for buffer object deletion. + * The GL spec says that deleting a buffer object causes it to get + * unbound from all arrays in the current context. + */ +static void +unbind(GLcontext *ctx, + struct gl_buffer_object **ptr, + struct gl_buffer_object *obj) +{ + if (*ptr == obj) { + _mesa_reference_buffer_object(ctx, ptr, ctx->Array.NullBufferObj); + } +} + + /**********************************************************************/ /* API Functions */ @@ -759,54 +794,18 @@ _mesa_DeleteBuffersARB(GLsizei n, const GLuint *ids) ASSERT(bufObj->Name == ids[i]); - if (ctx->Array.ArrayObj->Vertex.BufferObj == bufObj) { - bufObj->RefCount--; - ctx->Array.ArrayObj->Vertex.BufferObj = ctx->Array.NullBufferObj; - ctx->Array.NullBufferObj->RefCount++; - } - if (ctx->Array.ArrayObj->Normal.BufferObj == bufObj) { - bufObj->RefCount--; - ctx->Array.ArrayObj->Normal.BufferObj = ctx->Array.NullBufferObj; - ctx->Array.NullBufferObj->RefCount++; - } - if (ctx->Array.ArrayObj->Color.BufferObj == bufObj) { - bufObj->RefCount--; - ctx->Array.ArrayObj->Color.BufferObj = ctx->Array.NullBufferObj; - ctx->Array.NullBufferObj->RefCount++; - } - if (ctx->Array.ArrayObj->SecondaryColor.BufferObj == bufObj) { - bufObj->RefCount--; - ctx->Array.ArrayObj->SecondaryColor.BufferObj = ctx->Array.NullBufferObj; - ctx->Array.NullBufferObj->RefCount++; - } - if (ctx->Array.ArrayObj->FogCoord.BufferObj == bufObj) { - bufObj->RefCount--; - ctx->Array.ArrayObj->FogCoord.BufferObj = ctx->Array.NullBufferObj; - ctx->Array.NullBufferObj->RefCount++; - } - if (ctx->Array.ArrayObj->Index.BufferObj == bufObj) { - bufObj->RefCount--; - ctx->Array.ArrayObj->Index.BufferObj = ctx->Array.NullBufferObj; - ctx->Array.NullBufferObj->RefCount++; - } - if (ctx->Array.ArrayObj->EdgeFlag.BufferObj == bufObj) { - bufObj->RefCount--; - ctx->Array.ArrayObj->EdgeFlag.BufferObj = ctx->Array.NullBufferObj; - ctx->Array.NullBufferObj->RefCount++; - } + unbind(ctx, &ctx->Array.ArrayObj->Vertex.BufferObj, bufObj); + unbind(ctx, &ctx->Array.ArrayObj->Normal.BufferObj, bufObj); + unbind(ctx, &ctx->Array.ArrayObj->Color.BufferObj, bufObj); + unbind(ctx, &ctx->Array.ArrayObj->SecondaryColor.BufferObj, bufObj); + unbind(ctx, &ctx->Array.ArrayObj->FogCoord.BufferObj, bufObj); + unbind(ctx, &ctx->Array.ArrayObj->Index.BufferObj, bufObj); + unbind(ctx, &ctx->Array.ArrayObj->EdgeFlag.BufferObj, bufObj); for (j = 0; j < MAX_TEXTURE_UNITS; j++) { - if (ctx->Array.ArrayObj->TexCoord[j].BufferObj == bufObj) { - bufObj->RefCount--; - ctx->Array.ArrayObj->TexCoord[j].BufferObj = ctx->Array.NullBufferObj; - ctx->Array.NullBufferObj->RefCount++; - } + unbind(ctx, &ctx->Array.ArrayObj->TexCoord[j].BufferObj, bufObj); } for (j = 0; j < VERT_ATTRIB_MAX; j++) { - if (ctx->Array.ArrayObj->VertexAttrib[j].BufferObj == bufObj) { - bufObj->RefCount--; - ctx->Array.ArrayObj->VertexAttrib[j].BufferObj = ctx->Array.NullBufferObj; - ctx->Array.NullBufferObj->RefCount++; - } + unbind(ctx, &ctx->Array.ArrayObj->VertexAttrib[j].BufferObj, bufObj); } if (ctx->Array.ArrayBufferObj == bufObj) { @@ -824,8 +823,8 @@ _mesa_DeleteBuffersARB(GLsizei n, const GLuint *ids) } /* The ID is immediately freed for re-use */ - _mesa_remove_buffer_object(ctx, bufObj); - _mesa_unbind_buffer_object(ctx, bufObj); + _mesa_HashRemove(ctx->Shared->BufferObjects, bufObj->Name); + _mesa_reference_buffer_object(ctx, &bufObj, NULL); } } @@ -874,7 +873,7 @@ _mesa_GenBuffersARB(GLsizei n, GLuint *buffer) _mesa_error(ctx, GL_OUT_OF_MEMORY, "glGenBuffersARB"); return; } - _mesa_save_buffer_object(ctx, bufObj); + _mesa_HashInsert(ctx->Shared->BufferObjects, first + i, bufObj); buffer[i] = first + i; } diff --git a/src/mesa/main/bufferobj.h b/src/mesa/main/bufferobj.h index 8baa59d617..163fe241aa 100644 --- a/src/mesa/main/bufferobj.h +++ b/src/mesa/main/bufferobj.h @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 7.1 + * Version: 7.2 * * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. * @@ -55,10 +55,9 @@ _mesa_initialize_buffer_object( struct gl_buffer_object *obj, GLuint name, GLenum target ); extern void -_mesa_save_buffer_object( GLcontext *ctx, struct gl_buffer_object *obj ); - -extern void -_mesa_remove_buffer_object( GLcontext *ctx, struct gl_buffer_object *bufObj ); +_mesa_reference_buffer_object(GLcontext *ctx, + struct gl_buffer_object **ptr, + struct gl_buffer_object *bufObj); extern void _mesa_buffer_data( GLcontext *ctx, GLenum target, GLsizeiptrARB size, @@ -118,8 +117,6 @@ _mesa_unmap_readpix_pbo(GLcontext *ctx, const struct gl_pixelstore_attrib *pack); -extern void -_mesa_unbind_buffer_object( GLcontext *ctx, struct gl_buffer_object *bufObj ); /* * API functions diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c index 5ab969e0eb..b23d2f612b 100644 --- a/src/mesa/main/buffers.c +++ b/src/mesa/main/buffers.c @@ -25,7 +25,7 @@ /** * \file buffers.c - * General framebuffer-related functions, like glClear, glScissor, etc. + * glReadBuffer, DrawBuffer functions. */ @@ -42,151 +42,6 @@ #define BAD_MASK ~0u -#if _HAVE_FULL_GL -void GLAPIENTRY -_mesa_ClearIndex( GLfloat c ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (ctx->Color.ClearIndex == (GLuint) c) - return; - - FLUSH_VERTICES(ctx, _NEW_COLOR); - ctx->Color.ClearIndex = (GLuint) c; - - if (!ctx->Visual.rgbMode && ctx->Driver.ClearIndex) { - /* it's OK to call glClearIndex in RGBA mode but it should be a NOP */ - (*ctx->Driver.ClearIndex)( ctx, ctx->Color.ClearIndex ); - } -} -#endif - - -/** - * Specify the clear values for the color buffers. - * - * \param red red color component. - * \param green green color component. - * \param blue blue color component. - * \param alpha alpha component. - * - * \sa glClearColor(). - * - * Clamps the parameters and updates gl_colorbuffer_attrib::ClearColor. On a - * change, flushes the vertices and notifies the driver via the - * dd_function_table::ClearColor callback. - */ -void GLAPIENTRY -_mesa_ClearColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ) -{ - GLfloat tmp[4]; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - tmp[0] = CLAMP(red, 0.0F, 1.0F); - tmp[1] = CLAMP(green, 0.0F, 1.0F); - tmp[2] = CLAMP(blue, 0.0F, 1.0F); - tmp[3] = CLAMP(alpha, 0.0F, 1.0F); - - if (TEST_EQ_4V(tmp, ctx->Color.ClearColor)) - return; /* no change */ - - FLUSH_VERTICES(ctx, _NEW_COLOR); - COPY_4V(ctx->Color.ClearColor, tmp); - - if (ctx->Visual.rgbMode && ctx->Driver.ClearColor) { - /* it's OK to call glClearColor in CI mode but it should be a NOP */ - (*ctx->Driver.ClearColor)(ctx, ctx->Color.ClearColor); - } -} - - -/** - * Clear buffers. - * - * \param mask bit-mask indicating the buffers to be cleared. - * - * Flushes the vertices and verifies the parameter. If __GLcontextRec::NewState - * is set then calls _mesa_update_state() to update gl_frame_buffer::_Xmin, - * etc. If the rasterization mode is set to GL_RENDER then requests the driver - * to clear the buffers, via the dd_function_table::Clear callback. - */ -void GLAPIENTRY -_mesa_Clear( GLbitfield mask ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - if (MESA_VERBOSE & VERBOSE_API) - _mesa_debug(ctx, "glClear 0x%x\n", mask); - - if (mask & ~(GL_COLOR_BUFFER_BIT | - GL_DEPTH_BUFFER_BIT | - GL_STENCIL_BUFFER_BIT | - GL_ACCUM_BUFFER_BIT)) { - /* invalid bit set */ - _mesa_error( ctx, GL_INVALID_VALUE, "glClear(0x%x)", mask); - return; - } - - if (ctx->NewState) { - _mesa_update_state( ctx ); /* update _Xmin, etc */ - } - - if (ctx->DrawBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) { - _mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION_EXT, - "glClear(incomplete framebuffer)"); - return; - } - - if (ctx->DrawBuffer->Width == 0 || ctx->DrawBuffer->Height == 0 || - ctx->DrawBuffer->_Xmin >= ctx->DrawBuffer->_Xmax || - ctx->DrawBuffer->_Ymin >= ctx->DrawBuffer->_Ymax) - return; - - if (ctx->RenderMode == GL_RENDER) { - GLbitfield bufferMask; - - /* don't clear depth buffer if depth writing disabled */ - if (!ctx->Depth.Mask) - mask &= ~GL_DEPTH_BUFFER_BIT; - - /* Build the bitmask to send to device driver's Clear function. - * Note that the GL_COLOR_BUFFER_BIT flag will expand to 0, 1, 2 or 4 - * of the BUFFER_BIT_FRONT/BACK_LEFT/RIGHT flags, or one of the - * BUFFER_BIT_COLORn flags. - */ - bufferMask = 0; - if (mask & GL_COLOR_BUFFER_BIT) { - GLuint i; - for (i = 0; i < ctx->DrawBuffer->_NumColorDrawBuffers; i++) { - bufferMask |= (1 << ctx->DrawBuffer->_ColorDrawBufferIndexes[i]); - } - } - - if ((mask & GL_DEPTH_BUFFER_BIT) - && ctx->DrawBuffer->Visual.haveDepthBuffer) { - bufferMask |= BUFFER_BIT_DEPTH; - } - - if ((mask & GL_STENCIL_BUFFER_BIT) - && ctx->DrawBuffer->Visual.haveStencilBuffer) { - bufferMask |= BUFFER_BIT_STENCIL; - } - - if ((mask & GL_ACCUM_BUFFER_BIT) - && ctx->DrawBuffer->Visual.haveAccumBuffer) { - bufferMask |= BUFFER_BIT_ACCUM; - } - - ASSERT(ctx->Driver.Clear); - ctx->Driver.Clear(ctx, bufferMask); - } -} - - - /** * Return bitmask of BUFFER_BIT_* flags indicating which color buffers are * available to the rendering context (for drawing or reading). @@ -646,195 +501,3 @@ _mesa_ReadBuffer(GLenum buffer) if (ctx->Driver.ReadBuffer) (*ctx->Driver.ReadBuffer)(ctx, 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 - * the current window is. If it's a new size, we'll call the driver's - * ResizeBuffers function. The driver will then resize its color buffers - * as needed, and maybe call the swrast's routine for reallocating - * swrast-managed depth/stencil/accum/etc buffers. - * \note This function should only be called through the GL API, not - * from device drivers (as was done in the past). - */ - -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; - - assert(buffer->Name == 0); - - /* ask device driver for size of output buffer */ - ctx->Driver.GetBufferSize( buffer, &newWidth, &newHeight ); - - /* see if size of device driver's color buffer (window) has changed */ - if (buffer->Width != newWidth || buffer->Height != newHeight) { - if (ctx->Driver.ResizeBuffers) - ctx->Driver.ResizeBuffers(ctx, buffer, newWidth, newHeight ); - } - } - - if (ctx->WinSysReadBuffer - && ctx->WinSysReadBuffer != ctx->WinSysDrawBuffer) { - GLuint newWidth, newHeight; - GLframebuffer *buffer = ctx->WinSysReadBuffer; - - assert(buffer->Name == 0); - - /* ask device driver for size of read buffer */ - ctx->Driver.GetBufferSize( buffer, &newWidth, &newHeight ); - - /* see if size of device driver's color buffer (window) has changed */ - if (buffer->Width != newWidth || buffer->Height != newHeight) { - if (ctx->Driver.ResizeBuffers) - ctx->Driver.ResizeBuffers(ctx, buffer, newWidth, newHeight ); - } - } - - ctx->NewState |= _NEW_BUFFERS; /* to update scissor / window bounds */ -} - - -/* - * 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? - */ -void GLAPIENTRY -_mesa_SampleCoverageARB(GLclampf value, GLboolean invert) -{ - GET_CURRENT_CONTEXT(ctx); - - if (!ctx->Extensions.ARB_multisample) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glSampleCoverageARB"); - return; - } - - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH( ctx ); - ctx->Multisample.SampleCoverageValue = (GLfloat) CLAMP(value, 0.0, 1.0); - ctx->Multisample.SampleCoverageInvert = invert; - ctx->NewState |= _NEW_MULTISAMPLE; -} - -#endif /* _HAVE_FULL_GL */ - - - -/** - * Define the scissor box. - * - * \param x, y coordinates of the scissor box lower-left corner. - * \param width width of the scissor box. - * \param height height of the scissor box. - * - * \sa glScissor(). - * - * Verifies the parameters and updates __GLcontextRec::Scissor. On a - * change flushes the vertices and notifies the driver via - * the dd_function_table::Scissor callback. - */ -void -_mesa_set_scissor(GLcontext *ctx, - GLint x, GLint y, GLsizei width, GLsizei height) -{ - if (x == ctx->Scissor.X && - y == ctx->Scissor.Y && - width == ctx->Scissor.Width && - height == ctx->Scissor.Height) - return; - - FLUSH_VERTICES(ctx, _NEW_SCISSOR); - ctx->Scissor.X = x; - ctx->Scissor.Y = y; - ctx->Scissor.Width = width; - ctx->Scissor.Height = height; - - if (ctx->Driver.Scissor) - ctx->Driver.Scissor( ctx, x, y, width, height ); -} - - -void GLAPIENTRY -_mesa_Scissor( GLint x, GLint y, GLsizei width, GLsizei height ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (width < 0 || height < 0) { - _mesa_error( ctx, GL_INVALID_VALUE, "glScissor" ); - return; - } - - if (MESA_VERBOSE & VERBOSE_API) - _mesa_debug(ctx, "glScissor %d %d %d %d\n", x, y, width, height); - - _mesa_set_scissor(ctx, x, y, width, height); -} - - - -/**********************************************************************/ -/** \name Initialization */ -/*@{*/ - -/** - * Initialize the context's scissor state. - * \param ctx the GL context. - */ -void -_mesa_init_scissor(GLcontext *ctx) -{ - /* Scissor group */ - ctx->Scissor.Enabled = GL_FALSE; - ctx->Scissor.X = 0; - ctx->Scissor.Y = 0; - ctx->Scissor.Width = 0; - ctx->Scissor.Height = 0; -} - - -/** - * Initialize the context's multisample state. - * \param ctx the GL context. - */ -void -_mesa_init_multisample(GLcontext *ctx) -{ - ctx->Multisample.Enabled = GL_TRUE; - ctx->Multisample.SampleAlphaToCoverage = GL_FALSE; - ctx->Multisample.SampleAlphaToOne = GL_FALSE; - ctx->Multisample.SampleCoverage = GL_FALSE; - ctx->Multisample.SampleCoverageValue = 1.0; - ctx->Multisample.SampleCoverageInvert = GL_FALSE; -} - -/*@}*/ diff --git a/src/mesa/main/buffers.h b/src/mesa/main/buffers.h index 9c0070e00f..8a7e7b5c1f 100644 --- a/src/mesa/main/buffers.h +++ b/src/mesa/main/buffers.h @@ -37,16 +37,6 @@ extern void GLAPIENTRY -_mesa_ClearIndex( GLfloat c ); - -extern void GLAPIENTRY -_mesa_ClearColor( GLclampf red, GLclampf green, - GLclampf blue, GLclampf alpha ); - -extern void GLAPIENTRY -_mesa_Clear( GLbitfield mask ); - -extern void GLAPIENTRY _mesa_DrawBuffer( GLenum mode ); extern void GLAPIENTRY @@ -62,25 +52,5 @@ _mesa_readbuffer(GLcontext *ctx, GLenum buffer, GLint bufferIndex); extern void GLAPIENTRY _mesa_ReadBuffer( GLenum mode ); -extern void GLAPIENTRY -_mesa_ResizeBuffersMESA( void ); - -extern void GLAPIENTRY -_mesa_Scissor( GLint x, GLint y, GLsizei width, GLsizei height ); - -extern void GLAPIENTRY -_mesa_SampleCoverageARB(GLclampf value, GLboolean invert); - -extern void -_mesa_init_scissor(GLcontext *ctx); - -extern void -_mesa_init_multisample(GLcontext *ctx); - -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/clear.c b/src/mesa/main/clear.c new file mode 100644 index 0000000000..63388f42ee --- /dev/null +++ b/src/mesa/main/clear.c @@ -0,0 +1,184 @@ +/* + * Mesa 3-D graphics library + * Version: 7.1 + * + * Copyright (C) 1999-2007 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 clear.c + * glClearColor, glClearIndex, glClear() functions. + */ + + + +#include "glheader.h" +#include "clear.h" +#include "context.h" +#include "colormac.h" +#include "state.h" + + + +#if _HAVE_FULL_GL +void GLAPIENTRY +_mesa_ClearIndex( GLfloat c ) +{ + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END(ctx); + + if (ctx->Color.ClearIndex == (GLuint) c) + return; + + FLUSH_VERTICES(ctx, _NEW_COLOR); + ctx->Color.ClearIndex = (GLuint) c; + + if (!ctx->Visual.rgbMode && ctx->Driver.ClearIndex) { + /* it's OK to call glClearIndex in RGBA mode but it should be a NOP */ + (*ctx->Driver.ClearIndex)( ctx, ctx->Color.ClearIndex ); + } +} +#endif + + +/** + * Specify the clear values for the color buffers. + * + * \param red red color component. + * \param green green color component. + * \param blue blue color component. + * \param alpha alpha component. + * + * \sa glClearColor(). + * + * Clamps the parameters and updates gl_colorbuffer_attrib::ClearColor. On a + * change, flushes the vertices and notifies the driver via the + * dd_function_table::ClearColor callback. + */ +void GLAPIENTRY +_mesa_ClearColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ) +{ + GLfloat tmp[4]; + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END(ctx); + + tmp[0] = CLAMP(red, 0.0F, 1.0F); + tmp[1] = CLAMP(green, 0.0F, 1.0F); + tmp[2] = CLAMP(blue, 0.0F, 1.0F); + tmp[3] = CLAMP(alpha, 0.0F, 1.0F); + + if (TEST_EQ_4V(tmp, ctx->Color.ClearColor)) + return; /* no change */ + + FLUSH_VERTICES(ctx, _NEW_COLOR); + COPY_4V(ctx->Color.ClearColor, tmp); + + if (ctx->Visual.rgbMode && ctx->Driver.ClearColor) { + /* it's OK to call glClearColor in CI mode but it should be a NOP */ + (*ctx->Driver.ClearColor)(ctx, ctx->Color.ClearColor); + } +} + + +/** + * Clear buffers. + * + * \param mask bit-mask indicating the buffers to be cleared. + * + * Flushes the vertices and verifies the parameter. If __GLcontextRec::NewState + * is set then calls _mesa_update_state() to update gl_frame_buffer::_Xmin, + * etc. If the rasterization mode is set to GL_RENDER then requests the driver + * to clear the buffers, via the dd_function_table::Clear callback. + */ +void GLAPIENTRY +_mesa_Clear( GLbitfield mask ) +{ + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); + + FLUSH_CURRENT(ctx, 0); + + if (MESA_VERBOSE & VERBOSE_API) + _mesa_debug(ctx, "glClear 0x%x\n", mask); + + if (mask & ~(GL_COLOR_BUFFER_BIT | + GL_DEPTH_BUFFER_BIT | + GL_STENCIL_BUFFER_BIT | + GL_ACCUM_BUFFER_BIT)) { + /* invalid bit set */ + _mesa_error( ctx, GL_INVALID_VALUE, "glClear(0x%x)", mask); + return; + } + + if (ctx->NewState) { + _mesa_update_state( ctx ); /* update _Xmin, etc */ + } + + if (ctx->DrawBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) { + _mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION_EXT, + "glClear(incomplete framebuffer)"); + return; + } + + if (ctx->DrawBuffer->Width == 0 || ctx->DrawBuffer->Height == 0 || + ctx->DrawBuffer->_Xmin >= ctx->DrawBuffer->_Xmax || + ctx->DrawBuffer->_Ymin >= ctx->DrawBuffer->_Ymax) + return; + + if (ctx->RenderMode == GL_RENDER) { + GLbitfield bufferMask; + + /* don't clear depth buffer if depth writing disabled */ + if (!ctx->Depth.Mask) + mask &= ~GL_DEPTH_BUFFER_BIT; + + /* Build the bitmask to send to device driver's Clear function. + * Note that the GL_COLOR_BUFFER_BIT flag will expand to 0, 1, 2 or 4 + * of the BUFFER_BIT_FRONT/BACK_LEFT/RIGHT flags, or one of the + * BUFFER_BIT_COLORn flags. + */ + bufferMask = 0; + if (mask & GL_COLOR_BUFFER_BIT) { + GLuint i; + for (i = 0; i < ctx->DrawBuffer->_NumColorDrawBuffers; i++) { + bufferMask |= (1 << ctx->DrawBuffer->_ColorDrawBufferIndexes[i]); + } + } + + if ((mask & GL_DEPTH_BUFFER_BIT) + && ctx->DrawBuffer->Visual.haveDepthBuffer) { + bufferMask |= BUFFER_BIT_DEPTH; + } + + if ((mask & GL_STENCIL_BUFFER_BIT) + && ctx->DrawBuffer->Visual.haveStencilBuffer) { + bufferMask |= BUFFER_BIT_STENCIL; + } + + if ((mask & GL_ACCUM_BUFFER_BIT) + && ctx->DrawBuffer->Visual.haveAccumBuffer) { + bufferMask |= BUFFER_BIT_ACCUM; + } + + ASSERT(ctx->Driver.Clear); + ctx->Driver.Clear(ctx, bufferMask); + } +} diff --git a/src/mesa/main/api_eval.h b/src/mesa/main/clear.h index d6cb38c9f8..9a54ba14bc 100644 --- a/src/mesa/main/api_eval.h +++ b/src/mesa/main/clear.h @@ -1,9 +1,8 @@ - /* * Mesa 3-D graphics library - * Version: 3.5 + * Version: 7.1 * - * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2007 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"), @@ -24,19 +23,22 @@ */ -#ifndef API_EVAL_H -#define API_EVAL_H +#ifndef CLEAR_H +#define CLEAR_H -#include "mtypes.h" -extern void _mesa_EvalPoint1( GLint i ); -extern void _mesa_EvalPoint2( GLint i, GLint j ); -extern void _mesa_EvalCoord1f( GLfloat u ); -extern void _mesa_EvalCoord2f( GLfloat u, GLfloat v ); -extern void _mesa_EvalCoord1fv( const GLfloat *u ); -extern void _mesa_EvalCoord2fv( const GLfloat *u ); +#include "main/mtypes.h" -#endif +extern void GLAPIENTRY +_mesa_ClearIndex( GLfloat c ); + +extern void GLAPIENTRY +_mesa_ClearColor( GLclampf red, GLclampf green, + GLclampf blue, GLclampf alpha ); +extern void GLAPIENTRY +_mesa_Clear( GLbitfield mask ); + +#endif diff --git a/src/mesa/main/config.h b/src/mesa/main/config.h index 94e6055907..882e2f224a 100644 --- a/src/mesa/main/config.h +++ b/src/mesa/main/config.h @@ -31,6 +31,10 @@ #ifndef MESA_CONFIG_H_INCLUDED #define MESA_CONFIG_H_INCLUDED + +#include "main/mfeatures.h" + + /** * \name OpenGL implementation limits */ @@ -186,8 +190,8 @@ #define MAX_PROGRAM_CALL_DEPTH 8 #define MAX_PROGRAM_TEMPS 128 #define MAX_PROGRAM_ADDRESS_REGS 2 -#define MAX_UNIFORMS 128 -#define MAX_VARYING 8 +#define MAX_UNIFORMS 128 /**< number of float components */ +#define MAX_VARYING 8 /**< number of float[4] vectors */ #define MAX_SAMPLERS 8 /*@}*/ @@ -283,41 +287,6 @@ #define ACOMP 3 -/* - * Enable/disable features (blocks of code) by setting FEATURE_xyz to 0 or 1. - */ -#ifndef _HAVE_FULL_GL -#define _HAVE_FULL_GL 1 -#endif - -#define FEATURE_userclip _HAVE_FULL_GL -#define FEATURE_texgen _HAVE_FULL_GL -#define FEATURE_windowpos _HAVE_FULL_GL -#define FEATURE_ARB_occlusion_query _HAVE_FULL_GL -#define FEATURE_ARB_fragment_program _HAVE_FULL_GL -#define FEATURE_ARB_vertex_buffer_object _HAVE_FULL_GL -#define FEATURE_ARB_vertex_program _HAVE_FULL_GL - -#define FEATURE_ARB_vertex_shader _HAVE_FULL_GL -#define FEATURE_ARB_fragment_shader _HAVE_FULL_GL -#define FEATURE_ARB_shader_objects (FEATURE_ARB_vertex_shader || FEATURE_ARB_fragment_shader) -#define FEATURE_ARB_shading_language_100 FEATURE_ARB_shader_objects -#define FEATURE_ARB_shading_language_120 FEATURE_ARB_shader_objects -#define FEATURE_es2_glsl 0 - -#define FEATURE_EXT_framebuffer_blit _HAVE_FULL_GL -#define FEATURE_EXT_framebuffer_object _HAVE_FULL_GL -#define FEATURE_EXT_pixel_buffer_object _HAVE_FULL_GL -#define FEATURE_EXT_texture_sRGB _HAVE_FULL_GL -#define FEATURE_EXT_timer_query _HAVE_FULL_GL -#define FEATURE_ATI_fragment_shader _HAVE_FULL_GL -#define FEATURE_MESA_program_debug _HAVE_FULL_GL -#define FEATURE_NV_fence _HAVE_FULL_GL -#define FEATURE_NV_fragment_program _HAVE_FULL_GL -#define FEATURE_NV_vertex_program _HAVE_FULL_GL -/*@}*/ - - /** * Maximum number of temporary vertices required for clipping. * diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index aa9d112999..a41cb42952 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -78,37 +78,59 @@ #include "glheader.h" #include "imports.h" +#if FEATURE_accum #include "accum.h" +#endif +#include "api_exec.h" #include "arrayobj.h" +#if FEATURE_attrib_stack #include "attrib.h" +#endif #include "blend.h" #include "buffers.h" #include "bufferobj.h" +#if FEATURE_colortable #include "colortab.h" +#endif #include "context.h" #include "debug.h" #include "depth.h" +#if FEATURE_dlist #include "dlist.h" +#endif +#if FEATURE_evaluators #include "eval.h" +#endif #include "enums.h" #include "extensions.h" #include "fbobject.h" +#if FEATURE_feedback #include "feedback.h" +#endif #include "fog.h" #include "framebuffer.h" #include "get.h" +#if FEATURE_histogram #include "histogram.h" +#endif #include "hint.h" #include "hash.h" #include "light.h" #include "lines.h" #include "macros.h" #include "matrix.h" +#include "multisample.h" #include "pixel.h" +#include "pixelstore.h" #include "points.h" #include "polygon.h" +#if FEATURE_ARB_occlusion_query #include "queryobj.h" +#endif +#if FEATURE_drawpix #include "rastpos.h" +#endif +#include "scissor.h" #include "simple_list.h" #include "state.h" #include "stencil.h" @@ -121,11 +143,15 @@ #include "version.h" #include "vtxfmt.h" #include "glapi/glthread.h" +#include "glapi/glapioffsets.h" +#include "glapi/glapitable.h" #if FEATURE_NV_vertex_program || FEATURE_NV_fragment_program #include "shader/program.h" #endif #include "shader/shader_api.h" +#if FEATURE_ATI_fragment_shader #include "shader/atifragshader.h" +#endif #if _HAVE_FULL_GL #include "math/m_translate.h" #include "math/m_matrix.h" @@ -413,9 +439,7 @@ alloc_shared_state( GLcontext *ctx ) ss->DisplayList = _mesa_NewHashTable(); ss->TexObjects = _mesa_NewHashTable(); -#if FEATURE_NV_vertex_program || FEATURE_NV_fragment_program ss->Programs = _mesa_NewHashTable(); -#endif #if FEATURE_ARB_vertex_program ss->DefaultVertexProgram = (struct gl_vertex_program *) @@ -497,10 +521,8 @@ cleanup: _mesa_DeleteHashTable(ss->DisplayList); if (ss->TexObjects) _mesa_DeleteHashTable(ss->TexObjects); -#if FEATURE_NV_vertex_program if (ss->Programs) _mesa_DeleteHashTable(ss->Programs); -#endif #if FEATURE_ARB_vertex_program _mesa_reference_vertprog(ctx, &ss->DefaultVertexProgram, NULL); #endif @@ -558,9 +580,11 @@ cleanup: static void delete_displaylist_cb(GLuint id, void *data, void *userData) { +#if FEATURE_dlist struct mesa_display_list *list = (struct mesa_display_list *) data; GLcontext *ctx = (GLcontext *) userData; _mesa_delete_list(ctx, list); +#endif } /** @@ -716,10 +740,9 @@ free_shared_state( GLcontext *ctx, struct gl_shared_state *ss ) _mesa_DeleteHashTable(ss->ShaderObjects); #endif -#if defined(FEATURE_NV_vertex_program) || defined(FEATURE_NV_fragment_program) _mesa_HashDeleteAll(ss->Programs, delete_program_cb, ctx); _mesa_DeleteHashTable(ss->Programs); -#endif + #if FEATURE_ARB_vertex_program _mesa_reference_vertprog(ctx, &ss->DefaultVertexProgram, NULL); #endif @@ -974,31 +997,52 @@ init_attrib_groups(GLcontext *ctx) _mesa_init_extensions( ctx ); /* Attribute Groups */ +#if FEATURE_accum _mesa_init_accum( ctx ); +#endif +#if FEATURE_attrib_stack _mesa_init_attrib( ctx ); +#endif _mesa_init_buffer_objects( ctx ); _mesa_init_color( ctx ); +#if FEATURE_colortable _mesa_init_colortables( ctx ); +#endif _mesa_init_current( ctx ); _mesa_init_depth( ctx ); _mesa_init_debug( ctx ); +#if FEATURE_dlist _mesa_init_display_list( ctx ); +#endif +#if FEATURE_evaluators _mesa_init_eval( ctx ); +#endif _mesa_init_fbobjects( ctx ); +#if FEATURE_feedback _mesa_init_feedback( ctx ); +#else + ctx->RenderMode = GL_RENDER; +#endif _mesa_init_fog( ctx ); +#if FEATURE_histogram _mesa_init_histogram( ctx ); +#endif _mesa_init_hint( ctx ); _mesa_init_line( ctx ); _mesa_init_lighting( ctx ); _mesa_init_matrix( ctx ); _mesa_init_multisample( ctx ); _mesa_init_pixel( ctx ); + _mesa_init_pixelstore( ctx ); _mesa_init_point( ctx ); _mesa_init_polygon( ctx ); _mesa_init_program( ctx ); +#if FEATURE_ARB_occlusion_query _mesa_init_query( ctx ); +#endif +#if FEATURE_drawpix _mesa_init_rastpos( ctx ); +#endif _mesa_init_scissor( ctx ); _mesa_init_shader_state( ctx ); _mesa_init_stencil( ctx ); @@ -1009,8 +1053,12 @@ init_attrib_groups(GLcontext *ctx) if (!_mesa_init_texture( ctx )) return GL_FALSE; +#if FEATURE_texture_s3tc _mesa_init_texture_s3tc( ctx ); +#endif +#if FEATURE_texture_fxt1 _mesa_init_texture_fxt1( ctx ); +#endif /* Miscellaneous */ ctx->NewState = _NEW_ALL; @@ -1162,16 +1210,18 @@ _mesa_initialize_context(GLcontext *ctx, if (ctx->Exec) _mesa_free(ctx->Exec); } +#if FEATURE_dispatch _mesa_init_exec_table(ctx->Exec); +#endif ctx->CurrentDispatch = ctx->Exec; -#if _HAVE_FULL_GL +#if FEATURE_dlist _mesa_init_dlist_table(ctx->Save); _mesa_install_save_vtxfmt( ctx, &ctx->ListState.ListVtxfmt ); +#endif /* Neutral tnl module stuff */ _mesa_init_exec_vtxfmt( ctx ); ctx->TnlModule.Current = NULL; ctx->TnlModule.SwapCount = 0; -#endif ctx->FragmentProgram._MaintainTexEnvProgram = (_mesa_getenv("MESA_TEX_PROG") != NULL); @@ -1184,6 +1234,10 @@ _mesa_initialize_context(GLcontext *ctx, ctx->FragmentProgram._MaintainTexEnvProgram = GL_TRUE; } +#ifdef FEATURE_extra_context_init + _mesa_initialize_context_extra(ctx); +#endif + ctx->FirstTimeCurrent = GL_TRUE; return GL_TRUE; @@ -1263,14 +1317,20 @@ _mesa_free_context_data( GLcontext *ctx ) _mesa_free_attrib_data(ctx); _mesa_free_lighting_data( ctx ); +#if FEATURE_evaluators _mesa_free_eval_data( ctx ); +#endif _mesa_free_texture_data( ctx ); _mesa_free_matrix_data( ctx ); _mesa_free_viewport_data( ctx ); +#if FEATURE_colortable _mesa_free_colortables_data( ctx ); +#endif _mesa_free_program_data(ctx); _mesa_free_shader_state(ctx); +#if FEATURE_ARB_occlusion_query _mesa_free_query_data(ctx); +#endif #if FEATURE_ARB_vertex_buffer_object _mesa_delete_buffer_object(ctx, ctx->Array.NullBufferObj); diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h index bb6f3acf06..54f1af911d 100644 --- a/src/mesa/main/context.h +++ b/src/mesa/main/context.h @@ -115,6 +115,9 @@ _mesa_initialize_context( GLcontext *ctx, void *driverContext ); extern void +_mesa_initialize_context_extra(GLcontext *ctx); + +extern void _mesa_free_context_data( GLcontext *ctx ); extern void diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h index 8edcfaf8c6..ddb38030bf 100644 --- a/src/mesa/main/dd.h +++ b/src/mesa/main/dd.h @@ -111,6 +111,11 @@ struct dd_function_table { /** + * Execute glRasterPos, updating the ctx->Current.Raster fields + */ + void (*RasterPos)( GLcontext *ctx, const GLfloat v[4] ); + + /** * \name Image-related functions */ /*@{*/ @@ -817,9 +822,11 @@ struct dd_function_table { */ /*@{*/ struct gl_query_object * (*NewQueryObject)(GLcontext *ctx, GLuint id); - void (*BeginQuery)(GLcontext *ctx, GLenum target, - struct gl_query_object *q); - void (*EndQuery)(GLcontext *ctx, GLenum target, struct gl_query_object *q); + void (*DeleteQuery)(GLcontext *ctx, struct gl_query_object *q); + void (*BeginQuery)(GLcontext *ctx, struct gl_query_object *q); + void (*EndQuery)(GLcontext *ctx, struct gl_query_object *q); + void (*CheckQuery)(GLcontext *ctx, struct gl_query_object *q); + void (*WaitQuery)(GLcontext *ctx, struct gl_query_object *q); /*@}*/ @@ -912,9 +919,9 @@ struct dd_function_table { void (*ValidateTnlModule)( GLcontext *ctx, GLuint new_state ); -#define PRIM_OUTSIDE_BEGIN_END GL_POLYGON+1 -#define PRIM_INSIDE_UNKNOWN_PRIM GL_POLYGON+2 -#define PRIM_UNKNOWN GL_POLYGON+3 +#define PRIM_OUTSIDE_BEGIN_END (GL_POLYGON+1) +#define PRIM_INSIDE_UNKNOWN_PRIM (GL_POLYGON+2) +#define PRIM_UNKNOWN (GL_POLYGON+3) /** * Set by the driver-supplied T&L engine. diff --git a/src/mesa/main/dispatch.c b/src/mesa/main/dispatch.c index 05c1c36c0d..34127cb248 100644 --- a/src/mesa/main/dispatch.c +++ b/src/mesa/main/dispatch.c @@ -39,10 +39,10 @@ #ifndef GLX_USE_APPLEGL -#include "glheader.h" -#include "glapi.h" -#include "glapitable.h" -#include "glthread.h" +#include "main/glheader.h" +#include "glapi/glapi.h" +#include "glapi/glapitable.h" +#include "glapi/glthread.h" #if !(defined(USE_X86_ASM) || defined(USE_X86_64_ASM) || defined(USE_SPARC_ASM)) @@ -87,8 +87,8 @@ #define GLAPIENTRY #endif -#include "dispatch.h" -#include "glapitemp.h" +#include "glapi/dispatch.h" +#include "glapi/glapitemp.h" #endif /* USE_X86_ASM */ diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index 63a00e04f5..f7660930a9 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -52,6 +52,7 @@ #include "eval.h" #include "extensions.h" #include "feedback.h" +#include "framebuffer.h" #include "get.h" #include "glapi/glapi.h" #include "hash.h" @@ -928,6 +929,13 @@ save_BlendFuncSeparateEXT(GLenum sfactorRGB, GLenum dfactorRGB, static void GLAPIENTRY +save_BlendFunc(GLenum srcfactor, GLenum dstfactor) +{ + save_BlendFuncSeparateEXT(srcfactor, dstfactor, srcfactor, dstfactor); +} + + +static void GLAPIENTRY save_BlendColor(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) { GET_CURRENT_CONTEXT(ctx); @@ -5101,7 +5109,7 @@ save_Indexfv(const GLfloat * v) static void GLAPIENTRY save_EdgeFlag(GLboolean x) { - save_Attr1fNV(VERT_ATTRIB_EDGEFLAG, x ? 1.0 : 0.0); + save_Attr1fNV(VERT_ATTRIB_EDGEFLAG, x ? (GLfloat)1.0 : (GLfloat)0.0); } static void GLAPIENTRY @@ -6788,6 +6796,11 @@ _mesa_EndList(void) _mesa_error(ctx, GL_INVALID_OPERATION, "glEndList"); return; } + + /* Call before emitting END_OF_LIST, in case the driver wants to + * emit opcodes itself. + */ + ctx->Driver.EndList(ctx); (void) ALLOC_INSTRUCTION(ctx, OPCODE_END_OF_LIST, 0); @@ -6801,8 +6814,6 @@ _mesa_EndList(void) if (MESA_VERBOSE & VERBOSE_DISPLAY_LIST) mesa_print_display_list(ctx->ListState.CurrentListNum); - ctx->Driver.EndList(ctx); - ctx->ListState.CurrentList = NULL; ctx->ListState.CurrentListNum = 0; ctx->ListState.CurrentListPtr = NULL; @@ -7659,7 +7670,7 @@ _mesa_init_dlist_table(struct _glapi_table *table) SET_Accum(table, save_Accum); SET_AlphaFunc(table, save_AlphaFunc); SET_Bitmap(table, save_Bitmap); - SET_BlendFunc(table, _mesa_BlendFunc); /* loops-back to BlendFuncSeparate */ + SET_BlendFunc(table, save_BlendFunc); SET_CallList(table, _mesa_save_CallList); SET_CallLists(table, _mesa_save_CallLists); SET_Clear(table, save_Clear); diff --git a/src/mesa/main/drawpix.c b/src/mesa/main/drawpix.c index fde9338430..ac97bc1ff9 100644 --- a/src/mesa/main/drawpix.c +++ b/src/mesa/main/drawpix.c @@ -30,113 +30,10 @@ #include "feedback.h" #include "framebuffer.h" #include "image.h" +#include "readpix.h" #include "state.h" -/** - * Do error checking of the format/type parameters to glReadPixels and - * glDrawPixels. - * \param drawing if GL_TRUE do checking for DrawPixels, else do checking - * for ReadPixels. - * \return GL_TRUE if error detected, GL_FALSE if no errors - */ -static GLboolean -error_check_format_type(GLcontext *ctx, GLenum format, GLenum type, - GLboolean drawing) -{ - const char *readDraw = drawing ? "Draw" : "Read"; - - if (ctx->Extensions.EXT_packed_depth_stencil - && type == GL_UNSIGNED_INT_24_8_EXT - && format != GL_DEPTH_STENCIL_EXT) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "gl%sPixels(format is not GL_DEPTH_STENCIL_EXT)", readDraw); - return GL_TRUE; - } - - /* basic combinations test */ - if (!_mesa_is_legal_format_and_type(ctx, format, type)) { - _mesa_error(ctx, GL_INVALID_ENUM, - "gl%sPixels(format or type)", readDraw); - return GL_TRUE; - } - - /* additional checks */ - switch (format) { - case GL_RED: - case GL_GREEN: - case GL_BLUE: - case GL_ALPHA: - case GL_LUMINANCE: - case GL_LUMINANCE_ALPHA: - case GL_RGB: - case GL_BGR: - case GL_RGBA: - case GL_BGRA: - case GL_ABGR_EXT: - if (drawing && !ctx->Visual.rgbMode) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glDrawPixels(drawing RGB pixels into color index buffer)"); - return GL_TRUE; - } - if (!drawing && !_mesa_dest_buffer_exists(ctx, GL_COLOR)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glReadPixels(no color buffer)"); - return GL_TRUE; - } - break; - case GL_COLOR_INDEX: - if (!drawing && ctx->Visual.rgbMode) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glReadPixels(reading color index format from RGB buffer)"); - return GL_TRUE; - } - if (!drawing && !_mesa_dest_buffer_exists(ctx, GL_COLOR)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glReadPixels(no color buffer)"); - return GL_TRUE; - } - break; - case GL_STENCIL_INDEX: - if ((drawing && !_mesa_dest_buffer_exists(ctx, format)) || - (!drawing && !_mesa_source_buffer_exists(ctx, format))) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "gl%sPixels(no stencil buffer)", readDraw); - return GL_TRUE; - } - break; - case GL_DEPTH_COMPONENT: - if (!drawing && !_mesa_source_buffer_exists(ctx, format)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "gl%sPixels(no depth buffer)", readDraw); - return GL_TRUE; - } - break; - case GL_DEPTH_STENCIL_EXT: - if (!ctx->Extensions.EXT_packed_depth_stencil || - type != GL_UNSIGNED_INT_24_8_EXT) { - _mesa_error(ctx, GL_INVALID_ENUM, "gl%sPixels(type)", readDraw); - return GL_TRUE; - } - if ((drawing && !_mesa_dest_buffer_exists(ctx, format)) || - (!drawing && !_mesa_source_buffer_exists(ctx, format))) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "gl%sPixels(no depth or stencil buffer)", readDraw); - return GL_TRUE; - } - break; - default: - /* this should have been caught in _mesa_is_legal_format_type() */ - _mesa_problem(ctx, "unexpected format in _mesa_%sPixels", readDraw); - return GL_TRUE; - } - - /* no errors */ - return GL_FALSE; -} - - - #if _HAVE_FULL_GL /* @@ -164,7 +61,7 @@ _mesa_DrawPixels( GLsizei width, GLsizei height, return; } - if (error_check_format_type(ctx, format, type, GL_TRUE)) { + if (_mesa_error_check_format_type(ctx, format, type, GL_TRUE)) { /* found an error */ return; } @@ -287,59 +184,6 @@ _mesa_CopyPixels( GLint srcx, GLint srcy, GLsizei width, GLsizei height, void GLAPIENTRY -_mesa_ReadPixels( GLint x, GLint y, GLsizei width, GLsizei height, - GLenum format, GLenum type, GLvoid *pixels ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - if (width < 0 || height < 0) { - _mesa_error( ctx, GL_INVALID_VALUE, - "glReadPixels(width=%d height=%d)", width, height ); - return; - } - - if (ctx->NewState) - _mesa_update_state(ctx); - - if (error_check_format_type(ctx, format, type, GL_FALSE)) { - /* found an error */ - return; - } - - if (ctx->ReadBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) { - _mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION_EXT, - "glReadPixels(incomplete framebuffer)" ); - return; - } - - if (!_mesa_source_buffer_exists(ctx, format)) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glReadPixels(no readbuffer)"); - return; - } - - if (ctx->Pack.BufferObj->Name) { - if (!_mesa_validate_pbo_access(2, &ctx->Pack, width, height, 1, - format, type, pixels)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glReadPixels(invalid PBO access)"); - return; - } - - if (ctx->Pack.BufferObj->Pointer) { - /* buffer is mapped - that's an error */ - _mesa_error(ctx, GL_INVALID_OPERATION, "glReadPixels(PBO is mapped)"); - return; - } - } - - ctx->Driver.ReadPixels(ctx, x, y, width, height, - format, type, &ctx->Pack, pixels); -} - - - -void GLAPIENTRY _mesa_Bitmap( GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap ) @@ -374,7 +218,7 @@ _mesa_Bitmap( GLsizei width, GLsizei height, if (ctx->RenderMode == GL_RENDER) { /* Truncate, to satisfy conformance tests (matches SGI's OpenGL). */ - const GLfloat epsilon = 0.0001; + const GLfloat epsilon = (const GLfloat)0.0001; GLint x = IFLOOR(ctx->Current.RasterPos[0] + epsilon - xorig); GLint y = IFLOOR(ctx->Current.RasterPos[1] + epsilon - yorig); diff --git a/src/mesa/main/drawpix.h b/src/mesa/main/drawpix.h index 2a2d7de8d8..6177adad6d 100644 --- a/src/mesa/main/drawpix.h +++ b/src/mesa/main/drawpix.h @@ -1,9 +1,8 @@ - /* * Mesa 3-D graphics library - * Version: 3.5 + * Version: 7.1 * - * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2008 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,7 +27,7 @@ #define DRAWPIXELS_H -#include "mtypes.h" +#include "main/glheader.h" extern void GLAPIENTRY @@ -37,11 +36,6 @@ _mesa_DrawPixels( GLsizei width, GLsizei height, extern void GLAPIENTRY -_mesa_ReadPixels( GLint x, GLint y, GLsizei width, GLsizei height, - GLenum format, GLenum type, GLvoid *pixels ); - - -extern void GLAPIENTRY _mesa_CopyPixels( GLint srcx, GLint srcy, GLsizei width, GLsizei height, GLenum type ); diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c index 9fe979a6b2..e0483a72e8 100644 --- a/src/mesa/main/enable.c +++ b/src/mesa/main/enable.c @@ -38,6 +38,7 @@ #include "enums.h" #include "math/m_matrix.h" #include "math/m_xform.h" +#include "api_arrayelt.h" @@ -92,6 +93,13 @@ client_state(GLcontext *ctx, GLenum cap, GLboolean state) flag = _NEW_ARRAY_COLOR1; break; +#if FEATURE_point_size_array + case GL_POINT_SIZE_ARRAY_OES: + var = &ctx->Array.ArrayObj->PointSize.Enabled; + flag = _NEW_ARRAY_POINT_SIZE; + break; +#endif + #if FEATURE_NV_vertex_program case GL_VERTEX_ATTRIB_ARRAY0_NV: case GL_VERTEX_ATTRIB_ARRAY1_NV: @@ -129,6 +137,9 @@ client_state(GLcontext *ctx, GLenum cap, GLboolean state) FLUSH_VERTICES(ctx, _NEW_ARRAY); ctx->Array.NewState |= flag; + + _ae_invalidate_state(ctx, _NEW_ARRAY); + *var = state; if (state) @@ -661,6 +672,7 @@ _mesa_set_enable(GLcontext *ctx, GLenum cap, GLboolean state) case GL_EDGE_FLAG_ARRAY: case GL_FOG_COORDINATE_ARRAY_EXT: case GL_SECONDARY_COLOR_ARRAY_EXT: + case GL_POINT_SIZE_ARRAY_OES: client_state( ctx, cap, state ); return; @@ -1185,6 +1197,10 @@ _mesa_IsEnabled( GLenum cap ) case GL_SECONDARY_COLOR_ARRAY_EXT: CHECK_EXTENSION(EXT_secondary_color); return (ctx->Array.ArrayObj->SecondaryColor.Enabled != 0); +#if FEATURE_point_size_array + case GL_POINT_SIZE_ARRAY_OES: + return (ctx->Array.ArrayObj->PointSize.Enabled != 0); +#endif /* GL_EXT_histogram */ case GL_HISTOGRAM: diff --git a/src/mesa/main/enums.c b/src/mesa/main/enums.c index a9c102e4f2..15e7d5b96c 100644 --- a/src/mesa/main/enums.c +++ b/src/mesa/main/enums.c @@ -4866,8 +4866,8 @@ const char *_mesa_lookup_enum_by_nr( int nr ) { unsigned * i; - i = (unsigned *)bsearch( & nr, reduced_enums, Elements(reduced_enums), - sizeof(reduced_enums[0]), (cfunc) compar_nr ); + i = (unsigned *)_mesa_bsearch( & nr, reduced_enums, Elements(reduced_enums), + sizeof(reduced_enums[0]), (cfunc) compar_nr ); if ( i != NULL ) { return & enum_string_table[ all_enums[ *i ].offset ]; @@ -4884,8 +4884,8 @@ int _mesa_lookup_enum_by_name( const char *symbol ) enum_elt * f = NULL; if ( symbol != NULL ) { - f = (enum_elt *)bsearch( symbol, all_enums, Elements(all_enums), - sizeof( enum_elt ), (cfunc) compar_name ); + f = (enum_elt *)_mesa_bsearch( symbol, all_enums, Elements(all_enums), + sizeof( enum_elt ), (cfunc) compar_name ); } return (f != NULL) ? f->n : -1; diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 3774d56369..ddcb44f06b 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.5.1 + * Version: 7.1 * - * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2008 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/fbobject.c b/src/mesa/main/fbobject.c index 4190a95e41..4c92d1fb5a 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -508,6 +508,7 @@ _mesa_test_framebuffer_completeness(GLcontext *ctx, struct gl_framebuffer *fb) } } +#ifndef FEATURE_OES_framebuffer_object /* Check that all DrawBuffers are present */ for (j = 0; j < ctx->Const.MaxDrawBuffers; j++) { if (fb->ColorDrawBuffer[j] != GL_NONE) { @@ -533,6 +534,7 @@ _mesa_test_framebuffer_completeness(GLcontext *ctx, struct gl_framebuffer *fb) return; } } +#endif if (numImages == 0) { fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT; @@ -1513,7 +1515,12 @@ _mesa_GetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment, return; case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT: if (att->Type == GL_TEXTURE) { - *params = GL_TEXTURE_CUBE_MAP_POSITIVE_X + att->CubeMapFace; + if (att->Texture && att->Texture->Target == GL_TEXTURE_CUBE_MAP) { + *params = GL_TEXTURE_CUBE_MAP_POSITIVE_X + att->CubeMapFace; + } + else { + *params = 0; + } } else { _mesa_error(ctx, GL_INVALID_ENUM, @@ -1522,7 +1529,12 @@ _mesa_GetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment, return; case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT: if (att->Type == GL_TEXTURE) { - *params = att->Zoffset; + if (att->Texture && att->Texture->Target == GL_TEXTURE_3D) { + *params = att->Zoffset; + } + else { + *params = 0; + } } else { _mesa_error(ctx, GL_INVALID_ENUM, diff --git a/src/mesa/main/ffvertex_prog.c b/src/mesa/main/ffvertex_prog.c new file mode 100644 index 0000000000..787672be9f --- /dev/null +++ b/src/mesa/main/ffvertex_prog.c @@ -0,0 +1,1753 @@ +/************************************************************************** + * + * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + +/** + * \file ffvertex_prog. + * + * Create a vertex program to execute the current fixed function T&L pipeline. + * \author Keith Whitwell + */ + + +#include "main/glheader.h" +#include "main/mtypes.h" +#include "main/macros.h" +#include "main/enums.h" +#include "main/ffvertex_prog.h" +#include "shader/program.h" +#include "shader/prog_cache.h" +#include "shader/prog_instruction.h" +#include "shader/prog_parameter.h" +#include "shader/prog_print.h" +#include "shader/prog_statevars.h" + + +struct state_key { + unsigned light_global_enabled:1; + unsigned light_local_viewer:1; + unsigned light_twoside:1; + unsigned light_color_material:1; + unsigned light_color_material_mask:12; + unsigned light_material_mask:12; + unsigned material_shininess_is_zero:1; + + unsigned need_eye_coords:1; + unsigned normalize:1; + unsigned rescale_normals:1; + unsigned fog_source_is_depth:1; + unsigned tnl_do_vertex_fog:1; + unsigned separate_specular:1; + unsigned fog_mode:2; + unsigned point_attenuated:1; + unsigned point_array:1; + unsigned texture_enabled_global:1; + unsigned fragprog_inputs_read:12; + + struct { + unsigned light_enabled:1; + unsigned light_eyepos3_is_zero:1; + unsigned light_spotcutoff_is_180:1; + unsigned light_attenuated:1; + unsigned texunit_really_enabled:1; + unsigned texmat_enabled:1; + unsigned texgen_enabled:4; + unsigned texgen_mode0:4; + unsigned texgen_mode1:4; + unsigned texgen_mode2:4; + unsigned texgen_mode3:4; + } unit[8]; +}; + + + +#define FOG_NONE 0 +#define FOG_LINEAR 1 +#define FOG_EXP 2 +#define FOG_EXP2 3 + +static GLuint translate_fog_mode( GLenum mode ) +{ + switch (mode) { + case GL_LINEAR: return FOG_LINEAR; + case GL_EXP: return FOG_EXP; + case GL_EXP2: return FOG_EXP2; + default: return FOG_NONE; + } +} + +#define TXG_NONE 0 +#define TXG_OBJ_LINEAR 1 +#define TXG_EYE_LINEAR 2 +#define TXG_SPHERE_MAP 3 +#define TXG_REFLECTION_MAP 4 +#define TXG_NORMAL_MAP 5 + +static GLuint translate_texgen( GLboolean enabled, GLenum mode ) +{ + if (!enabled) + return TXG_NONE; + + switch (mode) { + case GL_OBJECT_LINEAR: return TXG_OBJ_LINEAR; + case GL_EYE_LINEAR: return TXG_EYE_LINEAR; + case GL_SPHERE_MAP: return TXG_SPHERE_MAP; + case GL_REFLECTION_MAP_NV: return TXG_REFLECTION_MAP; + case GL_NORMAL_MAP_NV: return TXG_NORMAL_MAP; + default: return TXG_NONE; + } +} + + +/** + * Returns bitmask of flags indicating which materials are set per-vertex + * in the current VB. + * XXX get these from the VBO... + */ +static GLbitfield +tnl_get_per_vertex_materials(GLcontext *ctx) +{ + GLbitfield mask = 0x0; +#if 0 + TNLcontext *tnl = TNL_CONTEXT(ctx); + struct vertex_buffer *VB = &tnl->vb; + GLuint i; + + for (i = _TNL_FIRST_MAT; i <= _TNL_LAST_MAT; i++) + if (VB->AttribPtr[i] && VB->AttribPtr[i]->stride) + mask |= 1 << (i - _TNL_FIRST_MAT); +#endif + return mask; +} + +/** + * Should fog be computed per-vertex? + */ +static GLboolean +tnl_get_per_vertex_fog(GLcontext *ctx) +{ +#if 0 + TNLcontext *tnl = TNL_CONTEXT(ctx); + return tnl->_DoVertexFog; +#else + return GL_FALSE; +#endif +} + +static GLboolean check_active_shininess( GLcontext *ctx, + const struct state_key *key, + GLuint side ) +{ + GLuint bit = 1 << (MAT_ATTRIB_FRONT_SHININESS + side); + + if (key->light_color_material_mask & bit) + return GL_TRUE; + + if (key->light_material_mask & bit) + return GL_TRUE; + + if (ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_SHININESS + side][0] != 0.0F) + return GL_TRUE; + + return GL_FALSE; +} + + + + +static struct state_key *make_state_key( GLcontext *ctx ) +{ + const struct gl_fragment_program *fp; + struct state_key *key = CALLOC_STRUCT(state_key); + GLuint i; + + fp = ctx->FragmentProgram._Current; + + /* This now relies on texenvprogram.c being active: + */ + assert(fp); + + key->need_eye_coords = ctx->_NeedEyeCoords; + + key->fragprog_inputs_read = fp->Base.InputsRead; + + if (ctx->RenderMode == GL_FEEDBACK) { + /* make sure the vertprog emits color and tex0 */ + key->fragprog_inputs_read |= (FRAG_BIT_COL0 | FRAG_BIT_TEX0); + } + + key->separate_specular = (ctx->Light.Model.ColorControl == + GL_SEPARATE_SPECULAR_COLOR); + + if (ctx->Light.Enabled) { + key->light_global_enabled = 1; + + if (ctx->Light.Model.LocalViewer) + key->light_local_viewer = 1; + + if (ctx->Light.Model.TwoSide) + key->light_twoside = 1; + + if (ctx->Light.ColorMaterialEnabled) { + key->light_color_material = 1; + key->light_color_material_mask = ctx->Light.ColorMaterialBitmask; + } + + key->light_material_mask = tnl_get_per_vertex_materials(ctx); + + for (i = 0; i < MAX_LIGHTS; i++) { + struct gl_light *light = &ctx->Light.Light[i]; + + if (light->Enabled) { + key->unit[i].light_enabled = 1; + + if (light->EyePosition[3] == 0.0) + key->unit[i].light_eyepos3_is_zero = 1; + + if (light->SpotCutoff == 180.0) + key->unit[i].light_spotcutoff_is_180 = 1; + + if (light->ConstantAttenuation != 1.0 || + light->LinearAttenuation != 0.0 || + light->QuadraticAttenuation != 0.0) + key->unit[i].light_attenuated = 1; + } + } + + if (check_active_shininess(ctx, key, 0)) { + key->material_shininess_is_zero = 0; + } + else if (key->light_twoside && + check_active_shininess(ctx, key, 1)) { + key->material_shininess_is_zero = 0; + } + else { + key->material_shininess_is_zero = 1; + } + } + + if (ctx->Transform.Normalize) + key->normalize = 1; + + if (ctx->Transform.RescaleNormals) + key->rescale_normals = 1; + + key->fog_mode = translate_fog_mode(fp->FogOption); + + if (ctx->Fog.FogCoordinateSource == GL_FRAGMENT_DEPTH_EXT) + key->fog_source_is_depth = 1; + + key->tnl_do_vertex_fog = tnl_get_per_vertex_fog(ctx); + + if (ctx->Point._Attenuated) + key->point_attenuated = 1; + +#if FEATURE_point_size_array + if (ctx->Array.ArrayObj->PointSize.Enabled) + key->point_array = 1; +#endif + + if (ctx->Texture._TexGenEnabled || + ctx->Texture._TexMatEnabled || + ctx->Texture._EnabledUnits) + key->texture_enabled_global = 1; + + for (i = 0; i < MAX_TEXTURE_UNITS; i++) { + struct gl_texture_unit *texUnit = &ctx->Texture.Unit[i]; + + if (texUnit->_ReallyEnabled) + key->unit[i].texunit_really_enabled = 1; + + if (ctx->Texture._TexMatEnabled & ENABLE_TEXMAT(i)) + key->unit[i].texmat_enabled = 1; + + if (texUnit->TexGenEnabled) { + key->unit[i].texgen_enabled = 1; + + key->unit[i].texgen_mode0 = + translate_texgen( texUnit->TexGenEnabled & (1<<0), + texUnit->GenModeS ); + key->unit[i].texgen_mode1 = + translate_texgen( texUnit->TexGenEnabled & (1<<1), + texUnit->GenModeT ); + key->unit[i].texgen_mode2 = + translate_texgen( texUnit->TexGenEnabled & (1<<2), + texUnit->GenModeR ); + key->unit[i].texgen_mode3 = + translate_texgen( texUnit->TexGenEnabled & (1<<3), + texUnit->GenModeQ ); + } + } + + return key; +} + + + +/* Very useful debugging tool - produces annotated listing of + * generated program with line/function references for each + * instruction back into this file: + */ +#define DISASSEM 0 + +/* Should be tunable by the driver - do we want to do matrix + * multiplications with DP4's or with MUL/MAD's? SSE works better + * with the latter, drivers may differ. + */ +#define PREFER_DP4 0 + + +/* Use uregs to represent registers internally, translate to Mesa's + * expected formats on emit. + * + * NOTE: These are passed by value extensively in this file rather + * than as usual by pointer reference. If this disturbs you, try + * remembering they are just 32bits in size. + * + * GCC is smart enough to deal with these dword-sized structures in + * much the same way as if I had defined them as dwords and was using + * macros to access and set the fields. This is much nicer and easier + * to evolve. + */ +struct ureg { + GLuint file:4; + GLint idx:9; /* relative addressing may be negative */ + /* sizeof(idx) should == sizeof(prog_src_reg::Index) */ + GLuint negate:1; + GLuint swz:12; + GLuint pad:6; +}; + + +struct tnl_program { + const struct state_key *state; + struct gl_vertex_program *program; + GLint max_inst; /** number of instructions allocated for program */ + + GLuint temp_in_use; + GLuint temp_reserved; + + struct ureg eye_position; + struct ureg eye_position_z; + struct ureg eye_position_normalized; + struct ureg transformed_normal; + struct ureg identity; + + GLuint materials; + GLuint color_materials; +}; + + +static const struct ureg undef = { + PROGRAM_UNDEFINED, + 0, + 0, + 0, + 0 +}; + +/* Local shorthand: + */ +#define X SWIZZLE_X +#define Y SWIZZLE_Y +#define Z SWIZZLE_Z +#define W SWIZZLE_W + + +/* Construct a ureg: + */ +static struct ureg make_ureg(GLuint file, GLint idx) +{ + struct ureg reg; + reg.file = file; + reg.idx = idx; + reg.negate = 0; + reg.swz = SWIZZLE_NOOP; + reg.pad = 0; + return reg; +} + + + +static struct ureg negate( struct ureg reg ) +{ + reg.negate ^= 1; + return reg; +} + + +static struct ureg swizzle( struct ureg reg, int x, int y, int z, int w ) +{ + reg.swz = MAKE_SWIZZLE4(GET_SWZ(reg.swz, x), + GET_SWZ(reg.swz, y), + GET_SWZ(reg.swz, z), + GET_SWZ(reg.swz, w)); + + return reg; +} + +static struct ureg swizzle1( struct ureg reg, int x ) +{ + return swizzle(reg, x, x, x, x); +} + +static struct ureg get_temp( struct tnl_program *p ) +{ + int bit = _mesa_ffs( ~p->temp_in_use ); + if (!bit) { + _mesa_problem(NULL, "%s: out of temporaries\n", __FILE__); + _mesa_exit(1); + } + + if ((GLuint) bit > p->program->Base.NumTemporaries) + p->program->Base.NumTemporaries = bit; + + p->temp_in_use |= 1<<(bit-1); + return make_ureg(PROGRAM_TEMPORARY, bit-1); +} + +static struct ureg reserve_temp( struct tnl_program *p ) +{ + struct ureg temp = get_temp( p ); + p->temp_reserved |= 1<<temp.idx; + return temp; +} + +static void release_temp( struct tnl_program *p, struct ureg reg ) +{ + if (reg.file == PROGRAM_TEMPORARY) { + p->temp_in_use &= ~(1<<reg.idx); + p->temp_in_use |= p->temp_reserved; /* can't release reserved temps */ + } +} + +static void release_temps( struct tnl_program *p ) +{ + p->temp_in_use = p->temp_reserved; +} + + + +/** + * \param input one of VERT_ATTRIB_x tokens. + */ +static struct ureg register_input( struct tnl_program *p, GLuint input ) +{ + p->program->Base.InputsRead |= (1<<input); + return make_ureg(PROGRAM_INPUT, input); +} + +/** + * \param input one of VERT_RESULT_x tokens. + */ +static struct ureg register_output( struct tnl_program *p, GLuint output ) +{ + p->program->Base.OutputsWritten |= (1<<output); + return make_ureg(PROGRAM_OUTPUT, output); +} + +static struct ureg register_const4f( struct tnl_program *p, + GLfloat s0, + GLfloat s1, + GLfloat s2, + GLfloat s3) +{ + GLfloat values[4]; + GLint idx; + GLuint swizzle; + values[0] = s0; + values[1] = s1; + values[2] = s2; + values[3] = s3; + idx = _mesa_add_unnamed_constant( p->program->Base.Parameters, values, 4, + &swizzle ); + ASSERT(swizzle == SWIZZLE_NOOP); + return make_ureg(PROGRAM_CONSTANT, idx); +} + +#define register_const1f(p, s0) register_const4f(p, s0, 0, 0, 1) +#define register_scalar_const(p, s0) register_const4f(p, s0, s0, s0, s0) +#define register_const2f(p, s0, s1) register_const4f(p, s0, s1, 0, 1) +#define register_const3f(p, s0, s1, s2) register_const4f(p, s0, s1, s2, 1) + +static GLboolean is_undef( struct ureg reg ) +{ + return reg.file == PROGRAM_UNDEFINED; +} + +static struct ureg get_identity_param( struct tnl_program *p ) +{ + if (is_undef(p->identity)) + p->identity = register_const4f(p, 0,0,0,1); + + return p->identity; +} + +static struct ureg register_param5(struct tnl_program *p, + GLint s0, + GLint s1, + GLint s2, + GLint s3, + GLint s4) +{ + gl_state_index tokens[STATE_LENGTH]; + GLint idx; + tokens[0] = s0; + tokens[1] = s1; + tokens[2] = s2; + tokens[3] = s3; + tokens[4] = s4; + idx = _mesa_add_state_reference( p->program->Base.Parameters, tokens ); + return make_ureg(PROGRAM_STATE_VAR, idx); +} + + +#define register_param1(p,s0) register_param5(p,s0,0,0,0,0) +#define register_param2(p,s0,s1) register_param5(p,s0,s1,0,0,0) +#define register_param3(p,s0,s1,s2) register_param5(p,s0,s1,s2,0,0) +#define register_param4(p,s0,s1,s2,s3) register_param5(p,s0,s1,s2,s3,0) + + +static void register_matrix_param5( struct tnl_program *p, + GLint s0, /* modelview, projection, etc */ + GLint s1, /* texture matrix number */ + GLint s2, /* first row */ + GLint s3, /* last row */ + GLint s4, /* inverse, transpose, etc */ + struct ureg *matrix ) +{ + GLint i; + + /* This is a bit sad as the support is there to pull the whole + * matrix out in one go: + */ + for (i = 0; i <= s3 - s2; i++) + matrix[i] = register_param5( p, s0, s1, i, i, s4 ); +} + + +static void emit_arg( struct prog_src_register *src, + struct ureg reg ) +{ + src->File = reg.file; + src->Index = reg.idx; + src->Swizzle = reg.swz; + src->NegateBase = reg.negate ? NEGATE_XYZW : 0; + src->Abs = 0; + src->NegateAbs = 0; + src->RelAddr = 0; + /* Check that bitfield sizes aren't exceeded */ + ASSERT(src->Index == reg.idx); +} + +static void emit_dst( struct prog_dst_register *dst, + struct ureg reg, GLuint mask ) +{ + dst->File = reg.file; + dst->Index = reg.idx; + /* allow zero as a shorthand for xyzw */ + dst->WriteMask = mask ? mask : WRITEMASK_XYZW; + dst->CondMask = COND_TR; /* always pass cond test */ + dst->CondSwizzle = SWIZZLE_NOOP; + dst->CondSrc = 0; + dst->pad = 0; + /* Check that bitfield sizes aren't exceeded */ + ASSERT(dst->Index == reg.idx); +} + +static void debug_insn( struct prog_instruction *inst, const char *fn, + GLuint line ) +{ + if (DISASSEM) { + static const char *last_fn; + + if (fn != last_fn) { + last_fn = fn; + _mesa_printf("%s:\n", fn); + } + + _mesa_printf("%d:\t", line); + _mesa_print_instruction(inst); + } +} + + +static void emit_op3fn(struct tnl_program *p, + enum prog_opcode op, + struct ureg dest, + GLuint mask, + struct ureg src0, + struct ureg src1, + struct ureg src2, + const char *fn, + GLuint line) +{ + GLuint nr; + struct prog_instruction *inst; + + assert((GLint) p->program->Base.NumInstructions <= p->max_inst); + + if (p->program->Base.NumInstructions == p->max_inst) { + /* need to extend the program's instruction array */ + struct prog_instruction *newInst; + + /* double the size */ + p->max_inst *= 2; + + newInst = _mesa_alloc_instructions(p->max_inst); + if (!newInst) { + _mesa_error(NULL, GL_OUT_OF_MEMORY, "vertex program build"); + return; + } + + _mesa_copy_instructions(newInst, + p->program->Base.Instructions, + p->program->Base.NumInstructions); + + _mesa_free_instructions(p->program->Base.Instructions, + p->program->Base.NumInstructions); + + p->program->Base.Instructions = newInst; + } + + nr = p->program->Base.NumInstructions++; + + inst = &p->program->Base.Instructions[nr]; + inst->Opcode = (enum prog_opcode) op; + inst->StringPos = 0; + inst->Data = 0; + + emit_arg( &inst->SrcReg[0], src0 ); + emit_arg( &inst->SrcReg[1], src1 ); + emit_arg( &inst->SrcReg[2], src2 ); + + emit_dst( &inst->DstReg, dest, mask ); + + debug_insn(inst, fn, line); +} + + +#define emit_op3(p, op, dst, mask, src0, src1, src2) \ + emit_op3fn(p, op, dst, mask, src0, src1, src2, __FUNCTION__, __LINE__) + +#define emit_op2(p, op, dst, mask, src0, src1) \ + emit_op3fn(p, op, dst, mask, src0, src1, undef, __FUNCTION__, __LINE__) + +#define emit_op1(p, op, dst, mask, src0) \ + emit_op3fn(p, op, dst, mask, src0, undef, undef, __FUNCTION__, __LINE__) + + +static struct ureg make_temp( struct tnl_program *p, struct ureg reg ) +{ + if (reg.file == PROGRAM_TEMPORARY && + !(p->temp_reserved & (1<<reg.idx))) + return reg; + else { + struct ureg temp = get_temp(p); + emit_op1(p, OPCODE_MOV, temp, 0, reg); + return temp; + } +} + + +/* Currently no tracking performed of input/output/register size or + * active elements. Could be used to reduce these operations, as + * could the matrix type. + */ +static void emit_matrix_transform_vec4( struct tnl_program *p, + struct ureg dest, + const struct ureg *mat, + struct ureg src) +{ + emit_op2(p, OPCODE_DP4, dest, WRITEMASK_X, src, mat[0]); + emit_op2(p, OPCODE_DP4, dest, WRITEMASK_Y, src, mat[1]); + emit_op2(p, OPCODE_DP4, dest, WRITEMASK_Z, src, mat[2]); + emit_op2(p, OPCODE_DP4, dest, WRITEMASK_W, src, mat[3]); +} + +/* This version is much easier to implement if writemasks are not + * supported natively on the target or (like SSE), the target doesn't + * have a clean/obvious dotproduct implementation. + */ +static void emit_transpose_matrix_transform_vec4( struct tnl_program *p, + struct ureg dest, + const struct ureg *mat, + struct ureg src) +{ + struct ureg tmp; + + if (dest.file != PROGRAM_TEMPORARY) + tmp = get_temp(p); + else + tmp = dest; + + emit_op2(p, OPCODE_MUL, tmp, 0, swizzle1(src,X), mat[0]); + emit_op3(p, OPCODE_MAD, tmp, 0, swizzle1(src,Y), mat[1], tmp); + emit_op3(p, OPCODE_MAD, tmp, 0, swizzle1(src,Z), mat[2], tmp); + emit_op3(p, OPCODE_MAD, dest, 0, swizzle1(src,W), mat[3], tmp); + + if (dest.file != PROGRAM_TEMPORARY) + release_temp(p, tmp); +} + +static void emit_matrix_transform_vec3( struct tnl_program *p, + struct ureg dest, + const struct ureg *mat, + struct ureg src) +{ + emit_op2(p, OPCODE_DP3, dest, WRITEMASK_X, src, mat[0]); + emit_op2(p, OPCODE_DP3, dest, WRITEMASK_Y, src, mat[1]); + emit_op2(p, OPCODE_DP3, dest, WRITEMASK_Z, src, mat[2]); +} + + +static void emit_normalize_vec3( struct tnl_program *p, + struct ureg dest, + struct ureg src ) +{ + struct ureg tmp = get_temp(p); + emit_op2(p, OPCODE_DP3, tmp, WRITEMASK_X, src, src); + emit_op1(p, OPCODE_RSQ, tmp, WRITEMASK_X, tmp); + emit_op2(p, OPCODE_MUL, dest, 0, src, swizzle1(tmp, X)); + release_temp(p, tmp); +} + +static void emit_passthrough( struct tnl_program *p, + GLuint input, + GLuint output ) +{ + struct ureg out = register_output(p, output); + emit_op1(p, OPCODE_MOV, out, 0, register_input(p, input)); +} + +static struct ureg get_eye_position( struct tnl_program *p ) +{ + if (is_undef(p->eye_position)) { + struct ureg pos = register_input( p, VERT_ATTRIB_POS ); + struct ureg modelview[4]; + + p->eye_position = reserve_temp(p); + + if (PREFER_DP4) { + register_matrix_param5( p, STATE_MODELVIEW_MATRIX, 0, 0, 3, + 0, modelview ); + + emit_matrix_transform_vec4(p, p->eye_position, modelview, pos); + } + else { + register_matrix_param5( p, STATE_MODELVIEW_MATRIX, 0, 0, 3, + STATE_MATRIX_TRANSPOSE, modelview ); + + emit_transpose_matrix_transform_vec4(p, p->eye_position, modelview, pos); + } + } + + return p->eye_position; +} + + +static struct ureg get_eye_position_z( struct tnl_program *p ) +{ + if (!is_undef(p->eye_position)) + return swizzle1(p->eye_position, Z); + + if (is_undef(p->eye_position_z)) { + struct ureg pos = register_input( p, VERT_ATTRIB_POS ); + struct ureg modelview[4]; + + p->eye_position_z = reserve_temp(p); + + register_matrix_param5( p, STATE_MODELVIEW_MATRIX, 0, 0, 3, + 0, modelview ); + + emit_op2(p, OPCODE_DP4, p->eye_position_z, 0, pos, modelview[2]); + } + + return p->eye_position_z; +} + + + +static struct ureg get_eye_position_normalized( struct tnl_program *p ) +{ + if (is_undef(p->eye_position_normalized)) { + struct ureg eye = get_eye_position(p); + p->eye_position_normalized = reserve_temp(p); + emit_normalize_vec3(p, p->eye_position_normalized, eye); + } + + return p->eye_position_normalized; +} + + +static struct ureg get_transformed_normal( struct tnl_program *p ) +{ + if (is_undef(p->transformed_normal) && + !p->state->need_eye_coords && + !p->state->normalize && + !(p->state->need_eye_coords == p->state->rescale_normals)) + { + p->transformed_normal = register_input(p, VERT_ATTRIB_NORMAL ); + } + else if (is_undef(p->transformed_normal)) + { + struct ureg normal = register_input(p, VERT_ATTRIB_NORMAL ); + struct ureg mvinv[3]; + struct ureg transformed_normal = reserve_temp(p); + + if (p->state->need_eye_coords) { + register_matrix_param5( p, STATE_MODELVIEW_MATRIX, 0, 0, 2, + STATE_MATRIX_INVTRANS, mvinv ); + + /* Transform to eye space: + */ + emit_matrix_transform_vec3( p, transformed_normal, mvinv, normal ); + normal = transformed_normal; + } + + /* Normalize/Rescale: + */ + if (p->state->normalize) { + emit_normalize_vec3( p, transformed_normal, normal ); + normal = transformed_normal; + } + else if (p->state->need_eye_coords == p->state->rescale_normals) { + /* This is already adjusted for eye/non-eye rendering: + */ + struct ureg rescale = register_param2(p, STATE_INTERNAL, + STATE_NORMAL_SCALE); + + emit_op2( p, OPCODE_MUL, transformed_normal, 0, normal, rescale ); + normal = transformed_normal; + } + + assert(normal.file == PROGRAM_TEMPORARY); + p->transformed_normal = normal; + } + + return p->transformed_normal; +} + + + +static void build_hpos( struct tnl_program *p ) +{ + struct ureg pos = register_input( p, VERT_ATTRIB_POS ); + struct ureg hpos = register_output( p, VERT_RESULT_HPOS ); + struct ureg mvp[4]; + + if (PREFER_DP4) { + register_matrix_param5( p, STATE_MVP_MATRIX, 0, 0, 3, + 0, mvp ); + emit_matrix_transform_vec4( p, hpos, mvp, pos ); + } + else { + register_matrix_param5( p, STATE_MVP_MATRIX, 0, 0, 3, + STATE_MATRIX_TRANSPOSE, mvp ); + emit_transpose_matrix_transform_vec4( p, hpos, mvp, pos ); + } +} + + +static GLuint material_attrib( GLuint side, GLuint property ) +{ + return ((property - STATE_AMBIENT) * 2 + + side); +} + +/* Get a bitmask of which material values vary on a per-vertex basis. + */ +static void set_material_flags( struct tnl_program *p ) +{ + p->color_materials = 0; + p->materials = 0; + + if (p->state->light_color_material) { + p->materials = + p->color_materials = p->state->light_color_material_mask; + } + + p->materials |= p->state->light_material_mask; +} + + +/* XXX temporary!!! */ +#define _TNL_ATTRIB_MAT_FRONT_AMBIENT 32 + +static struct ureg get_material( struct tnl_program *p, GLuint side, + GLuint property ) +{ + GLuint attrib = material_attrib(side, property); + + if (p->color_materials & (1<<attrib)) + return register_input(p, VERT_ATTRIB_COLOR0); + else if (p->materials & (1<<attrib)) + return register_input( p, attrib + _TNL_ATTRIB_MAT_FRONT_AMBIENT ); + else + return register_param3( p, STATE_MATERIAL, side, property ); +} + +#define SCENE_COLOR_BITS(side) (( MAT_BIT_FRONT_EMISSION | \ + MAT_BIT_FRONT_AMBIENT | \ + MAT_BIT_FRONT_DIFFUSE) << (side)) + +/* Either return a precalculated constant value or emit code to + * calculate these values dynamically in the case where material calls + * are present between begin/end pairs. + * + * Probably want to shift this to the program compilation phase - if + * we always emitted the calculation here, a smart compiler could + * detect that it was constant (given a certain set of inputs), and + * lift it out of the main loop. That way the programs created here + * would be independent of the vertex_buffer details. + */ +static struct ureg get_scenecolor( struct tnl_program *p, GLuint side ) +{ + if (p->materials & SCENE_COLOR_BITS(side)) { + struct ureg lm_ambient = register_param1(p, STATE_LIGHTMODEL_AMBIENT); + struct ureg material_emission = get_material(p, side, STATE_EMISSION); + struct ureg material_ambient = get_material(p, side, STATE_AMBIENT); + struct ureg material_diffuse = get_material(p, side, STATE_DIFFUSE); + struct ureg tmp = make_temp(p, material_diffuse); + emit_op3(p, OPCODE_MAD, tmp, WRITEMASK_XYZ, lm_ambient, + material_ambient, material_emission); + return tmp; + } + else + return register_param2( p, STATE_LIGHTMODEL_SCENECOLOR, side ); +} + + +static struct ureg get_lightprod( struct tnl_program *p, GLuint light, + GLuint side, GLuint property ) +{ + GLuint attrib = material_attrib(side, property); + if (p->materials & (1<<attrib)) { + struct ureg light_value = + register_param3(p, STATE_LIGHT, light, property); + struct ureg material_value = get_material(p, side, property); + struct ureg tmp = get_temp(p); + emit_op2(p, OPCODE_MUL, tmp, 0, light_value, material_value); + return tmp; + } + else + return register_param4(p, STATE_LIGHTPROD, light, side, property); +} + +static struct ureg calculate_light_attenuation( struct tnl_program *p, + GLuint i, + struct ureg VPpli, + struct ureg dist ) +{ + struct ureg attenuation = register_param3(p, STATE_LIGHT, i, + STATE_ATTENUATION); + struct ureg att = get_temp(p); + + /* Calculate spot attenuation: + */ + if (!p->state->unit[i].light_spotcutoff_is_180) { + struct ureg spot_dir_norm = register_param3(p, STATE_INTERNAL, + STATE_LIGHT_SPOT_DIR_NORMALIZED, i); + struct ureg spot = get_temp(p); + struct ureg slt = get_temp(p); + + emit_op2(p, OPCODE_DP3, spot, 0, negate(VPpli), spot_dir_norm); + emit_op2(p, OPCODE_SLT, slt, 0, swizzle1(spot_dir_norm,W), spot); + emit_op2(p, OPCODE_POW, spot, 0, spot, swizzle1(attenuation, W)); + emit_op2(p, OPCODE_MUL, att, 0, slt, spot); + + release_temp(p, spot); + release_temp(p, slt); + } + + /* Calculate distance attenuation: + */ + if (p->state->unit[i].light_attenuated) { + + /* 1/d,d,d,1/d */ + emit_op1(p, OPCODE_RCP, dist, WRITEMASK_YZ, dist); + /* 1,d,d*d,1/d */ + emit_op2(p, OPCODE_MUL, dist, WRITEMASK_XZ, dist, swizzle1(dist,Y)); + /* 1/dist-atten */ + emit_op2(p, OPCODE_DP3, dist, 0, attenuation, dist); + + if (!p->state->unit[i].light_spotcutoff_is_180) { + /* dist-atten */ + emit_op1(p, OPCODE_RCP, dist, 0, dist); + /* spot-atten * dist-atten */ + emit_op2(p, OPCODE_MUL, att, 0, dist, att); + } else { + /* dist-atten */ + emit_op1(p, OPCODE_RCP, att, 0, dist); + } + } + + return att; +} + + +/** + * Compute: + * lit.y = MAX(0, dots.x) + * lit.z = SLT(0, dots.x) + */ +static void emit_degenerate_lit( struct tnl_program *p, + struct ureg lit, + struct ureg dots ) +{ + struct ureg id = get_identity_param(p); /* id = {0,0,0,1} */ + + /* Note that lit.x & lit.w will not be examined. Note also that + * dots.xyzw == dots.xxxx. + */ + + /* MAX lit, id, dots; + */ + emit_op2(p, OPCODE_MAX, lit, WRITEMASK_XYZW, id, dots); + + /* result[2] = (in > 0 ? 1 : 0) + * SLT lit.z, id.z, dots; # lit.z = (0 < dots.z) ? 1 : 0 + */ + emit_op2(p, OPCODE_SLT, lit, WRITEMASK_Z, swizzle1(id,Z), dots); +} + + +/* Need to add some addtional parameters to allow lighting in object + * space - STATE_SPOT_DIRECTION and STATE_HALF_VECTOR implicitly assume eye + * space lighting. + */ +static void build_lighting( struct tnl_program *p ) +{ + const GLboolean twoside = p->state->light_twoside; + const GLboolean separate = p->state->separate_specular; + GLuint nr_lights = 0, count = 0; + struct ureg normal = get_transformed_normal(p); + struct ureg lit = get_temp(p); + struct ureg dots = get_temp(p); + struct ureg _col0 = undef, _col1 = undef; + struct ureg _bfc0 = undef, _bfc1 = undef; + GLuint i; + + /* + * NOTE: + * dot.x = dot(normal, VPpli) + * dot.y = dot(normal, halfAngle) + * dot.z = back.shininess + * dot.w = front.shininess + */ + + for (i = 0; i < MAX_LIGHTS; i++) + if (p->state->unit[i].light_enabled) + nr_lights++; + + set_material_flags(p); + + { + if (!p->state->material_shininess_is_zero) { + struct ureg shininess = get_material(p, 0, STATE_SHININESS); + emit_op1(p, OPCODE_MOV, dots, WRITEMASK_W, swizzle1(shininess,X)); + release_temp(p, shininess); + } + + _col0 = make_temp(p, get_scenecolor(p, 0)); + if (separate) + _col1 = make_temp(p, get_identity_param(p)); + else + _col1 = _col0; + + } + + if (twoside) { + if (!p->state->material_shininess_is_zero) { + struct ureg shininess = get_material(p, 1, STATE_SHININESS); + emit_op1(p, OPCODE_MOV, dots, WRITEMASK_Z, + negate(swizzle1(shininess,X))); + release_temp(p, shininess); + } + + _bfc0 = make_temp(p, get_scenecolor(p, 1)); + if (separate) + _bfc1 = make_temp(p, get_identity_param(p)); + else + _bfc1 = _bfc0; + } + + /* If no lights, still need to emit the scenecolor. + */ + { + struct ureg res0 = register_output( p, VERT_RESULT_COL0 ); + emit_op1(p, OPCODE_MOV, res0, 0, _col0); + } + + if (separate) { + struct ureg res1 = register_output( p, VERT_RESULT_COL1 ); + emit_op1(p, OPCODE_MOV, res1, 0, _col1); + } + + if (twoside) { + struct ureg res0 = register_output( p, VERT_RESULT_BFC0 ); + emit_op1(p, OPCODE_MOV, res0, 0, _bfc0); + } + + if (twoside && separate) { + struct ureg res1 = register_output( p, VERT_RESULT_BFC1 ); + emit_op1(p, OPCODE_MOV, res1, 0, _bfc1); + } + + if (nr_lights == 0) { + release_temps(p); + return; + } + + for (i = 0; i < MAX_LIGHTS; i++) { + if (p->state->unit[i].light_enabled) { + struct ureg half = undef; + struct ureg att = undef, VPpli = undef; + + count++; + + if (p->state->unit[i].light_eyepos3_is_zero) { + /* Can used precomputed constants in this case. + * Attenuation never applies to infinite lights. + */ + VPpli = register_param3(p, STATE_INTERNAL, + STATE_LIGHT_POSITION_NORMALIZED, i); + + if (!p->state->material_shininess_is_zero) { + if (p->state->light_local_viewer) { + struct ureg eye_hat = get_eye_position_normalized(p); + half = get_temp(p); + emit_op2(p, OPCODE_SUB, half, 0, VPpli, eye_hat); + emit_normalize_vec3(p, half, half); + } else { + half = register_param3(p, STATE_INTERNAL, + STATE_LIGHT_HALF_VECTOR, i); + } + } + } + else { + struct ureg Ppli = register_param3(p, STATE_INTERNAL, + STATE_LIGHT_POSITION, i); + struct ureg V = get_eye_position(p); + struct ureg dist = get_temp(p); + + VPpli = get_temp(p); + + /* Calculate VPpli vector + */ + emit_op2(p, OPCODE_SUB, VPpli, 0, Ppli, V); + + /* Normalize VPpli. The dist value also used in + * attenuation below. + */ + emit_op2(p, OPCODE_DP3, dist, 0, VPpli, VPpli); + emit_op1(p, OPCODE_RSQ, dist, 0, dist); + emit_op2(p, OPCODE_MUL, VPpli, 0, VPpli, dist); + + /* Calculate attenuation: + */ + if (!p->state->unit[i].light_spotcutoff_is_180 || + p->state->unit[i].light_attenuated) { + att = calculate_light_attenuation(p, i, VPpli, dist); + } + + /* Calculate viewer direction, or use infinite viewer: + */ + if (!p->state->material_shininess_is_zero) { + half = get_temp(p); + + if (p->state->light_local_viewer) { + struct ureg eye_hat = get_eye_position_normalized(p); + emit_op2(p, OPCODE_SUB, half, 0, VPpli, eye_hat); + } + else { + struct ureg z_dir = swizzle(get_identity_param(p),X,Y,W,Z); + emit_op2(p, OPCODE_ADD, half, 0, VPpli, z_dir); + } + + emit_normalize_vec3(p, half, half); + } + + release_temp(p, dist); + } + + /* Calculate dot products: + */ + if (p->state->material_shininess_is_zero) { + emit_op2(p, OPCODE_DP3, dots, 0, normal, VPpli); + } + else { + emit_op2(p, OPCODE_DP3, dots, WRITEMASK_X, normal, VPpli); + emit_op2(p, OPCODE_DP3, dots, WRITEMASK_Y, normal, half); + } + + /* Front face lighting: + */ + { + struct ureg ambient = get_lightprod(p, i, 0, STATE_AMBIENT); + struct ureg diffuse = get_lightprod(p, i, 0, STATE_DIFFUSE); + struct ureg specular = get_lightprod(p, i, 0, STATE_SPECULAR); + struct ureg res0, res1; + GLuint mask0, mask1; + + + if (count == nr_lights) { + if (separate) { + mask0 = WRITEMASK_XYZ; + mask1 = WRITEMASK_XYZ; + res0 = register_output( p, VERT_RESULT_COL0 ); + res1 = register_output( p, VERT_RESULT_COL1 ); + } + else { + mask0 = 0; + mask1 = WRITEMASK_XYZ; + res0 = _col0; + res1 = register_output( p, VERT_RESULT_COL0 ); + } + } else { + mask0 = 0; + mask1 = 0; + res0 = _col0; + res1 = _col1; + } + + + if (!is_undef(att)) { + /* light is attenuated by distance */ + emit_op1(p, OPCODE_LIT, lit, 0, dots); + emit_op2(p, OPCODE_MUL, lit, 0, lit, att); + emit_op3(p, OPCODE_MAD, _col0, 0, swizzle1(lit,X), ambient, _col0); + } + else if (!p->state->material_shininess_is_zero) { + /* there's a non-zero specular term */ + emit_op1(p, OPCODE_LIT, lit, 0, dots); + emit_op2(p, OPCODE_ADD, _col0, 0, ambient, _col0); + } + else { + /* no attenutation, no specular */ + emit_degenerate_lit(p, lit, dots); + emit_op2(p, OPCODE_ADD, _col0, 0, ambient, _col0); + } + + emit_op3(p, OPCODE_MAD, res0, mask0, swizzle1(lit,Y), diffuse, _col0); + emit_op3(p, OPCODE_MAD, res1, mask1, swizzle1(lit,Z), specular, _col1); + + release_temp(p, ambient); + release_temp(p, diffuse); + release_temp(p, specular); + } + + /* Back face lighting: + */ + if (twoside) { + struct ureg ambient = get_lightprod(p, i, 1, STATE_AMBIENT); + struct ureg diffuse = get_lightprod(p, i, 1, STATE_DIFFUSE); + struct ureg specular = get_lightprod(p, i, 1, STATE_SPECULAR); + struct ureg res0, res1; + GLuint mask0, mask1; + + if (count == nr_lights) { + if (separate) { + mask0 = WRITEMASK_XYZ; + mask1 = WRITEMASK_XYZ; + res0 = register_output( p, VERT_RESULT_BFC0 ); + res1 = register_output( p, VERT_RESULT_BFC1 ); + } + else { + mask0 = 0; + mask1 = WRITEMASK_XYZ; + res0 = _bfc0; + res1 = register_output( p, VERT_RESULT_BFC0 ); + } + } else { + res0 = _bfc0; + res1 = _bfc1; + mask0 = 0; + mask1 = 0; + } + + dots = negate(swizzle(dots,X,Y,W,Z)); + + if (!is_undef(att)) { + emit_op1(p, OPCODE_LIT, lit, 0, dots); + emit_op2(p, OPCODE_MUL, lit, 0, lit, att); + emit_op3(p, OPCODE_MAD, _bfc0, 0, swizzle1(lit,X), ambient, _bfc0); + } + else if (!p->state->material_shininess_is_zero) { + emit_op1(p, OPCODE_LIT, lit, 0, dots); + emit_op2(p, OPCODE_ADD, _col0, 0, ambient, _col0); + } + else { + emit_degenerate_lit(p, lit, dots); + emit_op2(p, OPCODE_ADD, _col0, 0, ambient, _col0); + } + + emit_op2(p, OPCODE_ADD, _bfc0, 0, ambient, _bfc0); + emit_op3(p, OPCODE_MAD, res0, mask0, swizzle1(lit,Y), diffuse, _bfc0); + emit_op3(p, OPCODE_MAD, res1, mask1, swizzle1(lit,Z), specular, _bfc1); + + release_temp(p, ambient); + release_temp(p, diffuse); + release_temp(p, specular); + } + + release_temp(p, half); + release_temp(p, VPpli); + release_temp(p, att); + } + } + + release_temps( p ); +} + + +static void build_fog( struct tnl_program *p ) +{ + struct ureg fog = register_output(p, VERT_RESULT_FOGC); + struct ureg input; + + if (p->state->fog_source_is_depth) { + input = get_eye_position_z(p); + } + else { + input = swizzle1(register_input(p, VERT_ATTRIB_FOG), X); + } + + if (p->state->fog_mode && p->state->tnl_do_vertex_fog) { + struct ureg params = register_param2(p, STATE_INTERNAL, + STATE_FOG_PARAMS_OPTIMIZED); + struct ureg tmp = get_temp(p); + GLboolean useabs = (p->state->fog_mode != FOG_EXP2); + + if (useabs) { + emit_op1(p, OPCODE_ABS, tmp, 0, input); + } + + switch (p->state->fog_mode) { + case FOG_LINEAR: { + struct ureg id = get_identity_param(p); + emit_op3(p, OPCODE_MAD, tmp, 0, useabs ? tmp : input, + swizzle1(params,X), swizzle1(params,Y)); + emit_op2(p, OPCODE_MAX, tmp, 0, tmp, swizzle1(id,X)); /* saturate */ + emit_op2(p, OPCODE_MIN, fog, WRITEMASK_X, tmp, swizzle1(id,W)); + break; + } + case FOG_EXP: + emit_op2(p, OPCODE_MUL, tmp, 0, useabs ? tmp : input, + swizzle1(params,Z)); + emit_op1(p, OPCODE_EX2, fog, WRITEMASK_X, negate(tmp)); + break; + case FOG_EXP2: + emit_op2(p, OPCODE_MUL, tmp, 0, input, swizzle1(params,W)); + emit_op2(p, OPCODE_MUL, tmp, 0, tmp, tmp); + emit_op1(p, OPCODE_EX2, fog, WRITEMASK_X, negate(tmp)); + break; + } + + release_temp(p, tmp); + } + else { + /* results = incoming fog coords (compute fog per-fragment later) + * + * KW: Is it really necessary to do anything in this case? + * BP: Yes, we always need to compute the absolute value, unless + * we want to push that down into the fragment program... + */ + GLboolean useabs = GL_TRUE; + emit_op1(p, useabs ? OPCODE_ABS : OPCODE_MOV, fog, WRITEMASK_X, input); + } +} + +static void build_reflect_texgen( struct tnl_program *p, + struct ureg dest, + GLuint writemask ) +{ + struct ureg normal = get_transformed_normal(p); + struct ureg eye_hat = get_eye_position_normalized(p); + struct ureg tmp = get_temp(p); + + /* n.u */ + emit_op2(p, OPCODE_DP3, tmp, 0, normal, eye_hat); + /* 2n.u */ + emit_op2(p, OPCODE_ADD, tmp, 0, tmp, tmp); + /* (-2n.u)n + u */ + emit_op3(p, OPCODE_MAD, dest, writemask, negate(tmp), normal, eye_hat); + + release_temp(p, tmp); +} + +static void build_sphere_texgen( struct tnl_program *p, + struct ureg dest, + GLuint writemask ) +{ + struct ureg normal = get_transformed_normal(p); + struct ureg eye_hat = get_eye_position_normalized(p); + struct ureg tmp = get_temp(p); + struct ureg half = register_scalar_const(p, .5); + struct ureg r = get_temp(p); + struct ureg inv_m = get_temp(p); + struct ureg id = get_identity_param(p); + + /* Could share the above calculations, but it would be + * a fairly odd state for someone to set (both sphere and + * reflection active for different texture coordinate + * components. Of course - if two texture units enable + * reflect and/or sphere, things start to tilt in favour + * of seperating this out: + */ + + /* n.u */ + emit_op2(p, OPCODE_DP3, tmp, 0, normal, eye_hat); + /* 2n.u */ + emit_op2(p, OPCODE_ADD, tmp, 0, tmp, tmp); + /* (-2n.u)n + u */ + emit_op3(p, OPCODE_MAD, r, 0, negate(tmp), normal, eye_hat); + /* r + 0,0,1 */ + emit_op2(p, OPCODE_ADD, tmp, 0, r, swizzle(id,X,Y,W,Z)); + /* rx^2 + ry^2 + (rz+1)^2 */ + emit_op2(p, OPCODE_DP3, tmp, 0, tmp, tmp); + /* 2/m */ + emit_op1(p, OPCODE_RSQ, tmp, 0, tmp); + /* 1/m */ + emit_op2(p, OPCODE_MUL, inv_m, 0, tmp, half); + /* r/m + 1/2 */ + emit_op3(p, OPCODE_MAD, dest, writemask, r, inv_m, half); + + release_temp(p, tmp); + release_temp(p, r); + release_temp(p, inv_m); +} + + +static void build_texture_transform( struct tnl_program *p ) +{ + GLuint i, j; + + for (i = 0; i < MAX_TEXTURE_UNITS; i++) { + + if (!(p->state->fragprog_inputs_read & FRAG_BIT_TEX(i))) + continue; + + if (p->state->unit[i].texgen_enabled || + p->state->unit[i].texmat_enabled) { + + GLuint texmat_enabled = p->state->unit[i].texmat_enabled; + struct ureg out = register_output(p, VERT_RESULT_TEX0 + i); + struct ureg out_texgen = undef; + + if (p->state->unit[i].texgen_enabled) { + GLuint copy_mask = 0; + GLuint sphere_mask = 0; + GLuint reflect_mask = 0; + GLuint normal_mask = 0; + GLuint modes[4]; + + if (texmat_enabled) + out_texgen = get_temp(p); + else + out_texgen = out; + + modes[0] = p->state->unit[i].texgen_mode0; + modes[1] = p->state->unit[i].texgen_mode1; + modes[2] = p->state->unit[i].texgen_mode2; + modes[3] = p->state->unit[i].texgen_mode3; + + for (j = 0; j < 4; j++) { + switch (modes[j]) { + case TXG_OBJ_LINEAR: { + struct ureg obj = register_input(p, VERT_ATTRIB_POS); + struct ureg plane = + register_param3(p, STATE_TEXGEN, i, + STATE_TEXGEN_OBJECT_S + j); + + emit_op2(p, OPCODE_DP4, out_texgen, WRITEMASK_X << j, + obj, plane ); + break; + } + case TXG_EYE_LINEAR: { + struct ureg eye = get_eye_position(p); + struct ureg plane = + register_param3(p, STATE_TEXGEN, i, + STATE_TEXGEN_EYE_S + j); + + emit_op2(p, OPCODE_DP4, out_texgen, WRITEMASK_X << j, + eye, plane ); + break; + } + case TXG_SPHERE_MAP: + sphere_mask |= WRITEMASK_X << j; + break; + case TXG_REFLECTION_MAP: + reflect_mask |= WRITEMASK_X << j; + break; + case TXG_NORMAL_MAP: + normal_mask |= WRITEMASK_X << j; + break; + case TXG_NONE: + copy_mask |= WRITEMASK_X << j; + } + + } + + + if (sphere_mask) { + build_sphere_texgen(p, out_texgen, sphere_mask); + } + + if (reflect_mask) { + build_reflect_texgen(p, out_texgen, reflect_mask); + } + + if (normal_mask) { + struct ureg normal = get_transformed_normal(p); + emit_op1(p, OPCODE_MOV, out_texgen, normal_mask, normal ); + } + + if (copy_mask) { + struct ureg in = register_input(p, VERT_ATTRIB_TEX0+i); + emit_op1(p, OPCODE_MOV, out_texgen, copy_mask, in ); + } + } + + if (texmat_enabled) { + struct ureg texmat[4]; + struct ureg in = (!is_undef(out_texgen) ? + out_texgen : + register_input(p, VERT_ATTRIB_TEX0+i)); + if (PREFER_DP4) { + register_matrix_param5( p, STATE_TEXTURE_MATRIX, i, 0, 3, + 0, texmat ); + emit_matrix_transform_vec4( p, out, texmat, in ); + } + else { + register_matrix_param5( p, STATE_TEXTURE_MATRIX, i, 0, 3, + STATE_MATRIX_TRANSPOSE, texmat ); + emit_transpose_matrix_transform_vec4( p, out, texmat, in ); + } + } + + release_temps(p); + } + else { + emit_passthrough(p, VERT_ATTRIB_TEX0+i, VERT_RESULT_TEX0+i); + } + } +} + + +/** + * Point size attenuation computation. + */ +static void build_atten_pointsize( struct tnl_program *p ) +{ + struct ureg eye = get_eye_position_z(p); + struct ureg state_size = register_param1(p, STATE_POINT_SIZE); + struct ureg state_attenuation = register_param1(p, STATE_POINT_ATTENUATION); + struct ureg out = register_output(p, VERT_RESULT_PSIZ); + struct ureg ut = get_temp(p); + + /* dist = |eyez| */ + emit_op1(p, OPCODE_ABS, ut, WRITEMASK_Y, swizzle1(eye, Z)); + /* p1 + dist * (p2 + dist * p3); */ + emit_op3(p, OPCODE_MAD, ut, WRITEMASK_X, swizzle1(ut, Y), + swizzle1(state_attenuation, Z), swizzle1(state_attenuation, Y)); + emit_op3(p, OPCODE_MAD, ut, WRITEMASK_X, swizzle1(ut, Y), + ut, swizzle1(state_attenuation, X)); + + /* 1 / sqrt(factor) */ + emit_op1(p, OPCODE_RSQ, ut, WRITEMASK_X, ut ); + +#if 0 + /* out = pointSize / sqrt(factor) */ + emit_op2(p, OPCODE_MUL, out, WRITEMASK_X, ut, state_size); +#else + /* this is a good place to clamp the point size since there's likely + * no hardware registers to clamp point size at rasterization time. + */ + emit_op2(p, OPCODE_MUL, ut, WRITEMASK_X, ut, state_size); + emit_op2(p, OPCODE_MAX, ut, WRITEMASK_X, ut, swizzle1(state_size, Y)); + emit_op2(p, OPCODE_MIN, out, WRITEMASK_X, ut, swizzle1(state_size, Z)); +#endif + + release_temp(p, ut); +} + +/** + * Emit constant point size. + */ +static void build_constant_pointsize( struct tnl_program *p ) +{ + struct ureg state_size = register_param1(p, STATE_POINT_SIZE); + struct ureg out = register_output(p, VERT_RESULT_PSIZ); + emit_op1(p, OPCODE_MOV, out, WRITEMASK_X, state_size); +} + +/** + * Pass-though per-vertex point size, from user's point size array. + */ +static void build_array_pointsize( struct tnl_program *p ) +{ + struct ureg in = register_input(p, VERT_ATTRIB_POINT_SIZE); + struct ureg out = register_output(p, VERT_RESULT_PSIZ); + emit_op1(p, OPCODE_MOV, out, WRITEMASK_X, in); +} + + +static void build_tnl_program( struct tnl_program *p ) +{ /* Emit the program, starting with modelviewproject: + */ + build_hpos(p); + + /* Lighting calculations: + */ + if (p->state->fragprog_inputs_read & (FRAG_BIT_COL0|FRAG_BIT_COL1)) { + if (p->state->light_global_enabled) + build_lighting(p); + else { + if (p->state->fragprog_inputs_read & FRAG_BIT_COL0) + emit_passthrough(p, VERT_ATTRIB_COLOR0, VERT_RESULT_COL0); + + if (p->state->fragprog_inputs_read & FRAG_BIT_COL1) + emit_passthrough(p, VERT_ATTRIB_COLOR1, VERT_RESULT_COL1); + } + } + + if ((p->state->fragprog_inputs_read & FRAG_BIT_FOGC) || + p->state->fog_mode != FOG_NONE) + build_fog(p); + + if (p->state->fragprog_inputs_read & FRAG_BITS_TEX_ANY) + build_texture_transform(p); + + if (p->state->point_attenuated) + build_atten_pointsize(p); + else if (p->state->point_array) + build_array_pointsize(p); +#if 0 + else + build_constant_pointsize(p); +#else + (void) build_constant_pointsize; +#endif + + /* Finish up: + */ + emit_op1(p, OPCODE_END, undef, 0, undef); + + /* Disassemble: + */ + if (DISASSEM) { + _mesa_printf ("\n"); + } +} + + +static void +create_new_program( const struct state_key *key, + struct gl_vertex_program *program, + GLuint max_temps) +{ + struct tnl_program p; + + _mesa_memset(&p, 0, sizeof(p)); + p.state = key; + p.program = program; + p.eye_position = undef; + p.eye_position_z = undef; + p.eye_position_normalized = undef; + p.transformed_normal = undef; + p.identity = undef; + p.temp_in_use = 0; + + if (max_temps >= sizeof(int) * 8) + p.temp_reserved = 0; + else + p.temp_reserved = ~((1<<max_temps)-1); + + /* Start by allocating 32 instructions. + * If we need more, we'll grow the instruction array as needed. + */ + p.max_inst = 32; + p.program->Base.Instructions = _mesa_alloc_instructions(p.max_inst); + p.program->Base.String = NULL; + p.program->Base.NumInstructions = + 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; + p.program->Base.OutputsWritten = 0; + + build_tnl_program( &p ); +} + + +/** + * Return a vertex program which implements the current fixed-function + * transform/lighting/texgen operations. + * XXX move this into core mesa (main/) + */ +struct gl_vertex_program * +_mesa_get_fixed_func_vertex_program(GLcontext *ctx) +{ + struct gl_vertex_program *prog; + struct state_key *key; + + /* Grab all the relevent state and put it in a single structure: + */ + key = make_state_key(ctx); + + /* Look for an already-prepared program for this state: + */ + prog = (struct gl_vertex_program *) + _mesa_search_program_cache(ctx->VertexProgram.Cache, key, sizeof(*key)); + + if (!prog) { + /* OK, we'll have to build a new one */ + if (0) + _mesa_printf("Build new TNL program\n"); + + prog = (struct gl_vertex_program *) + ctx->Driver.NewProgram(ctx, GL_VERTEX_PROGRAM_ARB, 0); + if (!prog) + return NULL; + + create_new_program( key, prog, + ctx->Const.VertexProgram.MaxTemps ); + +#if 0 + if (ctx->Driver.ProgramStringNotify) + ctx->Driver.ProgramStringNotify( ctx, GL_VERTEX_PROGRAM_ARB, + &prog->Base ); +#endif + _mesa_program_cache_insert(ctx, ctx->VertexProgram.Cache, + key, sizeof(*key), &prog->Base); + } + + _mesa_free(key); + + return prog; +} diff --git a/src/mesa/drivers/dri/intel/intel_ioctl.h b/src/mesa/main/ffvertex_prog.h index 8674aef723..38dc5fbb8d 100644 --- a/src/mesa/drivers/dri/intel/intel_ioctl.h +++ b/src/mesa/main/ffvertex_prog.h @@ -1,6 +1,6 @@ /************************************************************************** * - * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. + * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a @@ -25,22 +25,16 @@ * **************************************************************************/ -#ifndef INTEL_IOCTL_H -#define INTEL_IOCTL_H -#include "intel_context.h" +#ifndef FFVERTEX_PROG_H +#define FFVERTEX_PROG_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 ); -void intel_exec_ioctl(struct intel_context *intel, - GLuint used, - GLboolean ignore_cliprects, GLboolean allow_unlock, - void *start, GLuint count, dri_fence **fence); +#include "main/mtypes.h" -#endif +struct gl_vertex_program * +_mesa_get_fixed_func_vertex_program(GLcontext *ctx); + + + +#endif /* FFVERTEX_PROG_H */ diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c index d62af98f8a..af78363ad3 100644 --- a/src/mesa/main/framebuffer.c +++ b/src/mesa/main/framebuffer.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.5.1 + * Version: 7.2 * - * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2008 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"), @@ -69,7 +69,7 @@ compute_depth_max(struct gl_framebuffer *fb) fb->_DepthMaxF = (GLfloat) fb->_DepthMax; /* Minimum resolvable depth value, for polygon offset */ - fb->_MRD = 1.0 / fb->_DepthMaxF; + fb->_MRD = (GLfloat)1.0 / fb->_DepthMaxF; } @@ -337,6 +337,84 @@ _mesa_resize_framebuffer(GLcontext *ctx, struct gl_framebuffer *fb, } + +/** + * 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 + * the current window is. If it's a new size, we'll call the driver's + * ResizeBuffers function. The driver will then resize its color buffers + * as needed, and maybe call the swrast's routine for reallocating + * swrast-managed depth/stencil/accum/etc buffers. + * \note This function should only be called through the GL API, not + * from device drivers (as was done in the past). + */ +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; + + assert(buffer->Name == 0); + + /* ask device driver for size of output buffer */ + ctx->Driver.GetBufferSize( buffer, &newWidth, &newHeight ); + + /* see if size of device driver's color buffer (window) has changed */ + if (buffer->Width != newWidth || buffer->Height != newHeight) { + if (ctx->Driver.ResizeBuffers) + ctx->Driver.ResizeBuffers(ctx, buffer, newWidth, newHeight ); + } + } + + if (ctx->WinSysReadBuffer + && ctx->WinSysReadBuffer != ctx->WinSysDrawBuffer) { + GLuint newWidth, newHeight; + GLframebuffer *buffer = ctx->WinSysReadBuffer; + + assert(buffer->Name == 0); + + /* ask device driver for size of read buffer */ + ctx->Driver.GetBufferSize( buffer, &newWidth, &newHeight ); + + /* see if size of device driver's color buffer (window) has changed */ + if (buffer->Width != newWidth || buffer->Height != newHeight) { + if (ctx->Driver.ResizeBuffers) + ctx->Driver.ResizeBuffers(ctx, buffer, newWidth, newHeight ); + } + } + + ctx->NewState |= _NEW_BUFFERS; /* to update scissor / window bounds */ +} + + +/* + * XXX THIS IS OBSOLETE + */ +void GLAPIENTRY +_mesa_ResizeBuffersMESA( void ) +{ + GET_CURRENT_CONTEXT(ctx); + + if (ctx->Extensions.MESA_resize_buffers) + _mesa_resizebuffers( ctx ); +} + + + /** * Examine all the framebuffer's renderbuffers to update the Width/Height * fields of the framebuffer. If we have renderbuffers with different @@ -491,13 +569,13 @@ _mesa_update_framebuffer_visual(struct gl_framebuffer *fb) if (fb->Attachment[BUFFER_ACCUM].Renderbuffer) { fb->Visual.haveAccumBuffer = GL_TRUE; fb->Visual.accumRedBits - = fb->Attachment[BUFFER_DEPTH].Renderbuffer->RedBits; + = fb->Attachment[BUFFER_ACCUM].Renderbuffer->RedBits; fb->Visual.accumGreenBits - = fb->Attachment[BUFFER_DEPTH].Renderbuffer->GreenBits; + = fb->Attachment[BUFFER_ACCUM].Renderbuffer->GreenBits; fb->Visual.accumBlueBits - = fb->Attachment[BUFFER_DEPTH].Renderbuffer->BlueBits; + = fb->Attachment[BUFFER_ACCUM].Renderbuffer->BlueBits; fb->Visual.accumAlphaBits - = fb->Attachment[BUFFER_DEPTH].Renderbuffer->AlphaBits; + = fb->Attachment[BUFFER_ACCUM].Renderbuffer->AlphaBits; } compute_depth_max(fb); diff --git a/src/mesa/main/framebuffer.h b/src/mesa/main/framebuffer.h index 4d76f3a90f..e9eeed28cb 100644 --- a/src/mesa/main/framebuffer.h +++ b/src/mesa/main/framebuffer.h @@ -53,6 +53,14 @@ extern void _mesa_resize_framebuffer(GLcontext *ctx, struct gl_framebuffer *fb, GLuint width, GLuint height); + +extern void +_mesa_resizebuffers( GLcontext *ctx ); + +extern void GLAPIENTRY +_mesa_ResizeBuffersMESA( void ); + + extern void _mesa_update_draw_buffer_bounds(GLcontext *ctx); diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index b36154afff..f72aa6a288 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -19,10 +19,6 @@ #define INT_TO_BOOLEAN(I) ( (I) ? GL_TRUE : GL_FALSE ) -#define ENUM_TO_BOOLEAN(E) ( (E) ? GL_TRUE : GL_FALSE ) -#define ENUM_TO_INT(E) ( (GLint) (E) ) -#define ENUM_TO_FLOAT(E) ( (GLfloat) (E) ) - #define BOOLEAN_TO_INT(B) ( (GLint) (B) ) #define BOOLEAN_TO_FLOAT(B) ( (B) ? 1.0F : 0.0F ) @@ -1096,7 +1092,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) GLuint i, n = _mesa_get_compressed_formats(ctx, formats, GL_FALSE); ASSERT(n <= 100); for (i = 0; i < n; i++) - params[i] = ENUM_TO_INT(formats[i]); + params[i] = ENUM_TO_BOOLEAN(formats[i]); } break; case GL_ARRAY_ELEMENT_LOCK_FIRST_EXT: @@ -2944,7 +2940,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) GLuint i, n = _mesa_get_compressed_formats(ctx, formats, GL_FALSE); ASSERT(n <= 100); for (i = 0; i < n; i++) - params[i] = ENUM_TO_INT(formats[i]); + params[i] = ENUM_TO_FLOAT(formats[i]); } break; case GL_ARRAY_ELEMENT_LOCK_FIRST_EXT: @@ -3989,7 +3985,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) params[0] = ctx->DrawBuffer->Visual.depthBits; break; case GL_DEPTH_CLEAR_VALUE: - params[0] = IROUND(ctx->Depth.Clear); + params[0] = FLOAT_TO_INT(ctx->Depth.Clear); break; case GL_DEPTH_FUNC: params[0] = ENUM_TO_INT(ctx->Depth.Func); diff --git a/src/mesa/main/get_gen.py b/src/mesa/main/get_gen.py index 1c0279c026..152e378b4f 100644 --- a/src/mesa/main/get_gen.py +++ b/src/mesa/main/get_gen.py @@ -50,7 +50,8 @@ TypeStrings = { # - the GL state name, such as GL_CURRENT_COLOR # - the state datatype, one of GLint, GLfloat, GLboolean or GLenum # - list of code fragments to get the state, such as ["ctx->Foo.Bar"] -# - optional extra code or empty string +# - optional extra code or empty string. If present, "CONVERSION" will be +# replaced by ENUM_TO_FLOAT, INT_TO_FLOAT, etc. # - optional extensions to check, or None # StateVars = [ @@ -179,7 +180,7 @@ StateVars = [ ( "GL_DEPTH_BIAS", GLfloat, ["ctx->Pixel.DepthBias"], "", None ), ( "GL_DEPTH_BITS", GLint, ["ctx->DrawBuffer->Visual.depthBits"], "", None ), - ( "GL_DEPTH_CLEAR_VALUE", GLfloat, ["ctx->Depth.Clear"], "", None ), + ( "GL_DEPTH_CLEAR_VALUE", GLfloatN, ["ctx->Depth.Clear"], "", None ), ( "GL_DEPTH_FUNC", GLenum, ["ctx->Depth.Func"], "", None ), ( "GL_DEPTH_RANGE", GLfloatN, [ "ctx->Viewport.Near", "ctx->Viewport.Far" ], "", None ), @@ -532,7 +533,7 @@ StateVars = [ GLuint i, n = _mesa_get_compressed_formats(ctx, formats, GL_FALSE); ASSERT(n <= 100); for (i = 0; i < n; i++) - params[i] = ENUM_TO_INT(formats[i]);""", + params[i] = CONVERSION(formats[i]);""", ["ARB_texture_compression"] ), # GL_EXT_compiled_vertex_array @@ -1083,10 +1084,11 @@ def EmitGetFunction(stateVars, returnType): assert len(extensions) == 4 print (' CHECK_EXT4(%s, %s, %s, %s, "%s");' % (extensions[0], extensions[1], extensions[2], extensions[3], function)) + conversion = ConversionFunc(varType, returnType) if optionalCode: + optionalCode = string.replace(optionalCode, "CONVERSION", conversion); print " {" print " " + optionalCode - conversion = ConversionFunc(varType, returnType) n = len(state) for i in range(n): if conversion: @@ -1129,10 +1131,6 @@ def EmitHeader(): #define INT_TO_BOOLEAN(I) ( (I) ? GL_TRUE : GL_FALSE ) -#define ENUM_TO_BOOLEAN(E) ( (E) ? GL_TRUE : GL_FALSE ) -#define ENUM_TO_INT(E) ( (GLint) (E) ) -#define ENUM_TO_FLOAT(E) ( (GLfloat) (E) ) - #define BOOLEAN_TO_INT(B) ( (GLint) (B) ) #define BOOLEAN_TO_FLOAT(B) ( (B) ? 1.0F : 0.0F ) diff --git a/src/mesa/main/getstring.c b/src/mesa/main/getstring.c index 48c815772d..1a82ccce59 100644 --- a/src/mesa/main/getstring.c +++ b/src/mesa/main/getstring.c @@ -85,7 +85,7 @@ compute_version(const GLcontext *ctx) ctx->Extensions.ARB_texture_non_power_of_two && ctx->Extensions.EXT_blend_equation_separate); const GLboolean ver_2_1 = (ver_2_0 && - ctx->Extensions.ARB_shading_language_120 && + /*ctx->Extensions.ARB_shading_language_120 &&*/ ctx->Extensions.EXT_pixel_buffer_object && ctx->Extensions.EXT_texture_sRGB); if (ver_2_1) @@ -121,12 +121,6 @@ _mesa_GetString( GLenum name ) static const char *vendor = "Brian Paul"; static const char *renderer = "Mesa"; -#if FEATURE_ARB_shading_language_120_foo /* support not complete! */ - static const char *sl_version = "1.20"; -#elif FEATURE_ARB_shading_language_100 - static const char *sl_version = "1.10"; -#endif - if (!ctx) return NULL; @@ -154,8 +148,10 @@ _mesa_GetString( GLenum name ) return (const GLubyte *) ctx->Extensions.String; #if FEATURE_ARB_shading_language_100 case GL_SHADING_LANGUAGE_VERSION_ARB: - if (ctx->Extensions.ARB_shading_language_100) - return (const GLubyte *) sl_version; + if (ctx->Extensions.ARB_shading_language_120) + return (const GLubyte *) "1.20"; + else if (ctx->Extensions.ARB_shading_language_100) + return (const GLubyte *) "1.10"; goto error; #endif #if FEATURE_NV_fragment_program || FEATURE_ARB_fragment_program || \ diff --git a/src/mesa/main/glheader.h b/src/mesa/main/glheader.h index 6f3b2089c3..1d0f178dc4 100644 --- a/src/mesa/main/glheader.h +++ b/src/mesa/main/glheader.h @@ -82,15 +82,6 @@ # include <inttypes.h> #endif -/* For platforms that have the C99 standard uint*_t, - but not the commonly used u_int*_t */ -#if defined(__sun) -# define u_int8_t uint8_t -# define u_int16_t uint16_t -# define u_int32_t uint32_t -# define u_int64_t uint64_t -# define u_intptr_t uintptr_t -#endif /* Sun compilers define __i386 instead of the gcc-style __i386__ */ #ifdef __SUNPRO_C @@ -170,6 +161,25 @@ #include "GL/glext.h" +#ifndef GL_FIXED +#define GL_FIXED 0x140C +#endif + + +#ifndef GL_OES_point_size_array +#define GL_POINT_SIZE_ARRAY_OES 0x8B9C +#define GL_POINT_SIZE_ARRAY_TYPE_OES 0x898A +#define GL_POINT_SIZE_ARRAY_STRIDE_OES 0x898B +#define GL_POINT_SIZE_ARRAY_POINTER_OES 0x898C +#define GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES 0x8B9F +#endif + + +#ifndef GL_OES_draw_texture +#define GL_TEXTURE_CROP_RECT_OES 0x8B9D +#endif + + #if !defined(CAPI) && defined(WIN32) && !defined(BUILD_FOR_SNAP) #define CAPI _cdecl #endif @@ -259,6 +269,7 @@ #endif +#if !defined(_WIN32_WCE) #if defined(BUILD_FOR_SNAP) && defined(CHECKED) # define ASSERT(X) _CHECK(X) #elif defined(DEBUG) @@ -266,6 +277,7 @@ #else # define ASSERT(X) #endif +#endif #if (!defined(__GNUC__) || __GNUC__ < 3) && (!defined(__IBMC__) || __IBMC__ < 900) diff --git a/src/mesa/main/histogram.c b/src/mesa/main/histogram.c index 6a7f09489c..77c458d540 100644 --- a/src/mesa/main/histogram.c +++ b/src/mesa/main/histogram.c @@ -31,71 +31,6 @@ #include "histogram.h" -/********************************************************************** - * Internal functions - */ - - -/* - * Update the min/max values from an array of fragment colors. - */ -void -_mesa_update_minmax(GLcontext *ctx, GLuint n, const GLfloat rgba[][4]) -{ - GLuint i; - for (i = 0; i < n; i++) { - /* update mins */ - if (rgba[i][RCOMP] < ctx->MinMax.Min[RCOMP]) - ctx->MinMax.Min[RCOMP] = rgba[i][RCOMP]; - if (rgba[i][GCOMP] < ctx->MinMax.Min[GCOMP]) - ctx->MinMax.Min[GCOMP] = rgba[i][GCOMP]; - if (rgba[i][BCOMP] < ctx->MinMax.Min[BCOMP]) - ctx->MinMax.Min[BCOMP] = rgba[i][BCOMP]; - if (rgba[i][ACOMP] < ctx->MinMax.Min[ACOMP]) - ctx->MinMax.Min[ACOMP] = rgba[i][ACOMP]; - - /* update maxs */ - if (rgba[i][RCOMP] > ctx->MinMax.Max[RCOMP]) - ctx->MinMax.Max[RCOMP] = rgba[i][RCOMP]; - if (rgba[i][GCOMP] > ctx->MinMax.Max[GCOMP]) - ctx->MinMax.Max[GCOMP] = rgba[i][GCOMP]; - if (rgba[i][BCOMP] > ctx->MinMax.Max[BCOMP]) - ctx->MinMax.Max[BCOMP] = rgba[i][BCOMP]; - if (rgba[i][ACOMP] > ctx->MinMax.Max[ACOMP]) - ctx->MinMax.Max[ACOMP] = rgba[i][ACOMP]; - } -} - - -/* - * Update the histogram values from an array of fragment colors. - */ -void -_mesa_update_histogram(GLcontext *ctx, GLuint n, const GLfloat rgba[][4]) -{ - const GLint max = ctx->Histogram.Width - 1; - GLfloat w = (GLfloat) max; - GLuint i; - - if (ctx->Histogram.Width == 0) - return; - - for (i = 0; i < n; i++) { - GLint ri = IROUND(rgba[i][RCOMP] * w); - GLint gi = IROUND(rgba[i][GCOMP] * w); - GLint bi = IROUND(rgba[i][BCOMP] * w); - GLint ai = IROUND(rgba[i][ACOMP] * w); - ri = CLAMP(ri, 0, max); - gi = CLAMP(gi, 0, max); - bi = CLAMP(bi, 0, max); - ai = CLAMP(ai, 0, max); - ctx->Histogram.Count[ri][RCOMP]++; - ctx->Histogram.Count[gi][GCOMP]++; - ctx->Histogram.Count[bi][BCOMP]++; - ctx->Histogram.Count[ai][ACOMP]++; - } -} - /* * XXX the packed pixel formats haven't been tested. diff --git a/src/mesa/main/histogram.h b/src/mesa/main/histogram.h index 974447231d..367e9b11ba 100644 --- a/src/mesa/main/histogram.h +++ b/src/mesa/main/histogram.h @@ -71,12 +71,6 @@ _mesa_ResetHistogram(GLenum target); extern void GLAPIENTRY _mesa_ResetMinmax(GLenum target); -extern void -_mesa_update_minmax(GLcontext *ctx, GLuint n, const GLfloat rgba[][4]); - -extern void -_mesa_update_histogram(GLcontext *ctx, GLuint n, const GLfloat rgba[][4]); - extern void _mesa_init_histogram( GLcontext * ctx ); #else diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c index 8034daecae..1a6e864b98 100644 --- a/src/mesa/main/image.c +++ b/src/mesa/main/image.c @@ -2,7 +2,7 @@ * Mesa 3-D graphics library * Version: 7.1 * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2008 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"), @@ -34,7 +34,6 @@ #include "context.h" #include "image.h" #include "imports.h" -#include "histogram.h" #include "macros.h" #include "pixel.h" @@ -1011,6 +1010,488 @@ _mesa_pack_bitmap( GLint width, GLint height, const GLubyte *source, } +/**********************************************************************/ +/***** Pixel processing functions ******/ +/**********************************************************************/ + +/* + * Apply scale and bias factors to an array of RGBA pixels. + */ +void +_mesa_scale_and_bias_rgba(GLuint n, GLfloat rgba[][4], + GLfloat rScale, GLfloat gScale, + GLfloat bScale, GLfloat aScale, + GLfloat rBias, GLfloat gBias, + GLfloat bBias, GLfloat aBias) +{ + if (rScale != 1.0 || rBias != 0.0) { + GLuint i; + for (i = 0; i < n; i++) { + rgba[i][RCOMP] = rgba[i][RCOMP] * rScale + rBias; + } + } + if (gScale != 1.0 || gBias != 0.0) { + GLuint i; + for (i = 0; i < n; i++) { + rgba[i][GCOMP] = rgba[i][GCOMP] * gScale + gBias; + } + } + if (bScale != 1.0 || bBias != 0.0) { + GLuint i; + for (i = 0; i < n; i++) { + rgba[i][BCOMP] = rgba[i][BCOMP] * bScale + bBias; + } + } + if (aScale != 1.0 || aBias != 0.0) { + GLuint i; + for (i = 0; i < n; i++) { + rgba[i][ACOMP] = rgba[i][ACOMP] * aScale + aBias; + } + } +} + + +/* + * Apply pixel mapping to an array of floating point RGBA pixels. + */ +void +_mesa_map_rgba( const GLcontext *ctx, GLuint n, GLfloat rgba[][4] ) +{ + const GLfloat rscale = (GLfloat) (ctx->PixelMaps.RtoR.Size - 1); + const GLfloat gscale = (GLfloat) (ctx->PixelMaps.GtoG.Size - 1); + const GLfloat bscale = (GLfloat) (ctx->PixelMaps.BtoB.Size - 1); + const GLfloat ascale = (GLfloat) (ctx->PixelMaps.AtoA.Size - 1); + const GLfloat *rMap = ctx->PixelMaps.RtoR.Map; + const GLfloat *gMap = ctx->PixelMaps.GtoG.Map; + const GLfloat *bMap = ctx->PixelMaps.BtoB.Map; + const GLfloat *aMap = ctx->PixelMaps.AtoA.Map; + GLuint i; + for (i=0;i<n;i++) { + GLfloat r = CLAMP(rgba[i][RCOMP], 0.0F, 1.0F); + GLfloat g = CLAMP(rgba[i][GCOMP], 0.0F, 1.0F); + GLfloat b = CLAMP(rgba[i][BCOMP], 0.0F, 1.0F); + GLfloat a = CLAMP(rgba[i][ACOMP], 0.0F, 1.0F); + rgba[i][RCOMP] = rMap[IROUND(r * rscale)]; + rgba[i][GCOMP] = gMap[IROUND(g * gscale)]; + rgba[i][BCOMP] = bMap[IROUND(b * bscale)]; + rgba[i][ACOMP] = aMap[IROUND(a * ascale)]; + } +} + + +/* + * Apply the color matrix and post color matrix scaling and biasing. + */ +void +_mesa_transform_rgba(const GLcontext *ctx, GLuint n, GLfloat rgba[][4]) +{ + const GLfloat rs = ctx->Pixel.PostColorMatrixScale[0]; + const GLfloat rb = ctx->Pixel.PostColorMatrixBias[0]; + const GLfloat gs = ctx->Pixel.PostColorMatrixScale[1]; + const GLfloat gb = ctx->Pixel.PostColorMatrixBias[1]; + const GLfloat bs = ctx->Pixel.PostColorMatrixScale[2]; + const GLfloat bb = ctx->Pixel.PostColorMatrixBias[2]; + const GLfloat as = ctx->Pixel.PostColorMatrixScale[3]; + const GLfloat ab = ctx->Pixel.PostColorMatrixBias[3]; + const GLfloat *m = ctx->ColorMatrixStack.Top->m; + GLuint i; + for (i = 0; i < n; i++) { + const GLfloat r = rgba[i][RCOMP]; + const GLfloat g = rgba[i][GCOMP]; + const GLfloat b = rgba[i][BCOMP]; + const GLfloat a = rgba[i][ACOMP]; + rgba[i][RCOMP] = (m[0] * r + m[4] * g + m[ 8] * b + m[12] * a) * rs + rb; + rgba[i][GCOMP] = (m[1] * r + m[5] * g + m[ 9] * b + m[13] * a) * gs + gb; + rgba[i][BCOMP] = (m[2] * r + m[6] * g + m[10] * b + m[14] * a) * bs + bb; + rgba[i][ACOMP] = (m[3] * r + m[7] * g + m[11] * b + m[15] * a) * as + ab; + } +} + + +/** + * Apply a color table lookup to an array of floating point RGBA colors. + */ +void +_mesa_lookup_rgba_float(const struct gl_color_table *table, + GLuint n, GLfloat rgba[][4]) +{ + 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 */ + 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 */ + 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 */ + 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 */ + 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 */ + 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 */ + 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: + _mesa_problem(NULL, "Bad format in _mesa_lookup_rgba_float"); + return; + } +} + + + +/** + * Apply a color table lookup to an array of ubyte/RGBA colors. + */ +void +_mesa_lookup_rgba_ubyte(const struct gl_color_table *table, + GLuint n, GLubyte rgba[][4]) +{ + const GLubyte *lut = table->TableUB; + const GLfloat scale = (GLfloat) (table->Size - 1) / (GLfloat)255.0; + GLuint i; + + if (!table->TableUB || table->Size == 0) + return; + + switch (table->_BaseFormat) { + 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 { + 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->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 { + 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_ALPHA: + /* replace A with A */ + if (table->Size == 256) { + for (i = 0; i < n; i++) { + rgba[i][ACOMP] = lut[rgba[i][ACOMP]]; + } + } + else { + for (i = 0; i < n; i++) { + GLint j = IROUND((GLfloat) rgba[i][ACOMP] * scale); + rgba[i][ACOMP] = lut[j]; + } + } + 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 { + 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_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 { + 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; + 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; 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; + default: + _mesa_problem(NULL, "Bad format in _mesa_lookup_rgba_chan"); + return; + } +} + + + +/* + * Map color indexes to float rgba values. + */ +void +_mesa_map_ci_to_rgba( const GLcontext *ctx, GLuint n, + const GLuint index[], GLfloat rgba[][4] ) +{ + GLuint rmask = ctx->PixelMaps.ItoR.Size - 1; + GLuint gmask = ctx->PixelMaps.ItoG.Size - 1; + GLuint bmask = ctx->PixelMaps.ItoB.Size - 1; + GLuint amask = ctx->PixelMaps.ItoA.Size - 1; + const GLfloat *rMap = ctx->PixelMaps.ItoR.Map; + const GLfloat *gMap = ctx->PixelMaps.ItoG.Map; + const GLfloat *bMap = ctx->PixelMaps.ItoB.Map; + const GLfloat *aMap = ctx->PixelMaps.ItoA.Map; + GLuint i; + for (i=0;i<n;i++) { + rgba[i][RCOMP] = rMap[index[i] & rmask]; + rgba[i][GCOMP] = gMap[index[i] & gmask]; + rgba[i][BCOMP] = bMap[index[i] & bmask]; + rgba[i][ACOMP] = aMap[index[i] & amask]; + } +} + + +/** + * Map ubyte color indexes to ubyte/RGBA values. + */ +void +_mesa_map_ci8_to_rgba8(const GLcontext *ctx, GLuint n, const GLubyte index[], + GLubyte rgba[][4]) +{ + GLuint rmask = ctx->PixelMaps.ItoR.Size - 1; + GLuint gmask = ctx->PixelMaps.ItoG.Size - 1; + GLuint bmask = ctx->PixelMaps.ItoB.Size - 1; + GLuint amask = ctx->PixelMaps.ItoA.Size - 1; + const GLubyte *rMap = ctx->PixelMaps.ItoR.Map8; + const GLubyte *gMap = ctx->PixelMaps.ItoG.Map8; + const GLubyte *bMap = ctx->PixelMaps.ItoB.Map8; + const GLubyte *aMap = ctx->PixelMaps.ItoA.Map8; + GLuint i; + for (i=0;i<n;i++) { + rgba[i][RCOMP] = rMap[index[i] & rmask]; + rgba[i][GCOMP] = gMap[index[i] & gmask]; + rgba[i][BCOMP] = bMap[index[i] & bmask]; + rgba[i][ACOMP] = aMap[index[i] & amask]; + } +} + + +void +_mesa_scale_and_bias_depth(const GLcontext *ctx, GLuint n, + GLfloat depthValues[]) +{ + const GLfloat scale = ctx->Pixel.DepthScale; + const GLfloat bias = ctx->Pixel.DepthBias; + GLuint i; + for (i = 0; i < n; i++) { + GLfloat d = depthValues[i] * scale + bias; + depthValues[i] = CLAMP(d, 0.0F, 1.0F); + } +} + + +void +_mesa_scale_and_bias_depth_uint(const GLcontext *ctx, GLuint n, + GLuint depthValues[]) +{ + const GLdouble max = (double) 0xffffffff; + const GLdouble scale = ctx->Pixel.DepthScale; + const GLdouble bias = ctx->Pixel.DepthBias * max; + GLuint i; + for (i = 0; i < n; i++) { + GLdouble d = (GLdouble) depthValues[i] * scale + bias; + d = CLAMP(d, 0.0, max); + depthValues[i] = (GLuint) d; + } +} + + + +/* + * Update the min/max values from an array of fragment colors. + */ +static void +update_minmax(GLcontext *ctx, GLuint n, const GLfloat rgba[][4]) +{ + GLuint i; + for (i = 0; i < n; i++) { + /* update mins */ + if (rgba[i][RCOMP] < ctx->MinMax.Min[RCOMP]) + ctx->MinMax.Min[RCOMP] = rgba[i][RCOMP]; + if (rgba[i][GCOMP] < ctx->MinMax.Min[GCOMP]) + ctx->MinMax.Min[GCOMP] = rgba[i][GCOMP]; + if (rgba[i][BCOMP] < ctx->MinMax.Min[BCOMP]) + ctx->MinMax.Min[BCOMP] = rgba[i][BCOMP]; + if (rgba[i][ACOMP] < ctx->MinMax.Min[ACOMP]) + ctx->MinMax.Min[ACOMP] = rgba[i][ACOMP]; + + /* update maxs */ + if (rgba[i][RCOMP] > ctx->MinMax.Max[RCOMP]) + ctx->MinMax.Max[RCOMP] = rgba[i][RCOMP]; + if (rgba[i][GCOMP] > ctx->MinMax.Max[GCOMP]) + ctx->MinMax.Max[GCOMP] = rgba[i][GCOMP]; + if (rgba[i][BCOMP] > ctx->MinMax.Max[BCOMP]) + ctx->MinMax.Max[BCOMP] = rgba[i][BCOMP]; + if (rgba[i][ACOMP] > ctx->MinMax.Max[ACOMP]) + ctx->MinMax.Max[ACOMP] = rgba[i][ACOMP]; + } +} + + +/* + * Update the histogram values from an array of fragment colors. + */ +static void +update_histogram(GLcontext *ctx, GLuint n, const GLfloat rgba[][4]) +{ + const GLint max = ctx->Histogram.Width - 1; + GLfloat w = (GLfloat) max; + GLuint i; + + if (ctx->Histogram.Width == 0) + return; + + for (i = 0; i < n; i++) { + GLint ri = IROUND(rgba[i][RCOMP] * w); + GLint gi = IROUND(rgba[i][GCOMP] * w); + GLint bi = IROUND(rgba[i][BCOMP] * w); + GLint ai = IROUND(rgba[i][ACOMP] * w); + ri = CLAMP(ri, 0, max); + gi = CLAMP(gi, 0, max); + bi = CLAMP(bi, 0, max); + ai = CLAMP(ai, 0, max); + ctx->Histogram.Count[ri][RCOMP]++; + ctx->Histogram.Count[gi][GCOMP]++; + ctx->Histogram.Count[bi][BCOMP]++; + ctx->Histogram.Count[ai][ACOMP]++; + } +} + + /** * Apply various pixel transfer operations to an array of RGBA pixels * as indicated by the transferOps bitmask @@ -1066,11 +1547,11 @@ _mesa_apply_rgba_transfer_ops(GLcontext *ctx, GLbitfield transferOps, } /* update histogram count */ if (transferOps & IMAGE_HISTOGRAM_BIT) { - _mesa_update_histogram(ctx, n, (CONST GLfloat (*)[4]) rgba); + update_histogram(ctx, n, (CONST GLfloat (*)[4]) rgba); } /* update min/max values */ if (transferOps & IMAGE_MIN_MAX_BIT) { - _mesa_update_minmax(ctx, n, (CONST GLfloat (*)[4]) rgba); + update_minmax(ctx, n, (CONST GLfloat (*)[4]) rgba); } /* clamping to [0,1] */ if (transferOps & IMAGE_CLAMP_BIT) { @@ -1169,7 +1650,7 @@ _mesa_apply_stencil_transfer_ops(const GLcontext *ctx, GLuint n, GLuint mask = ctx->PixelMaps.StoS.Size - 1; GLuint i; for (i = 0; i < n; i++) { - stencil[i] = ctx->PixelMaps.StoS.Map[ stencil[i] & mask ]; + stencil[i] = (GLstencil)ctx->PixelMaps.StoS.Map[ stencil[i] & mask ]; } } } @@ -3680,7 +4161,7 @@ _mesa_unpack_stencil_span( const GLcontext *ctx, GLuint n, const GLuint mask = ctx->PixelMaps.StoS.Size - 1; GLuint i; for (i = 0; i < n; i++) { - indexes[i] = ctx->PixelMaps.StoS.Map[ indexes[i] & mask ]; + indexes[i] = (GLuint)ctx->PixelMaps.StoS.Map[ indexes[i] & mask ]; } } @@ -4032,7 +4513,7 @@ _mesa_unpack_depth_span( const GLcontext *ctx, GLuint n, if (needClamp) { GLuint i; for (i = 0; i < n; i++) { - depthValues[i] = CLAMP(depthValues[i], 0.0, 1.0); + depthValues[i] = (GLfloat)CLAMP(depthValues[i], 0.0, 1.0); } } @@ -4622,6 +5103,37 @@ _mesa_clip_readpixels(const GLcontext *ctx, /** + * Do clipping for a glCopyTexSubImage call. + * The framebuffer source region might extend outside the framebuffer + * bounds. Clip the source region against the framebuffer bounds and + * adjust the texture/dest position and size accordingly. + * + * \return GL_FALSE if region is totally clipped, GL_TRUE otherwise. + */ +GLboolean +_mesa_clip_copytexsubimage(const GLcontext *ctx, + GLint *destX, GLint *destY, + GLint *srcX, GLint *srcY, + GLsizei *width, GLsizei *height) +{ + const struct gl_framebuffer *fb = ctx->ReadBuffer; + const GLint srcX0 = *srcX, srcY0 = *srcY; + + if (_mesa_clip_to_region(fb->_Xmin, fb->_Ymin, fb->_Xmax, fb->_Ymax, + srcX, srcY, width, height)) { + *destX = *destX + *srcX - srcX0; + *destY = *destY + *srcY - srcY0; + + return GL_TRUE; + } + else { + return GL_FALSE; + } +} + + + +/** * Clip the rectangle defined by (x, y, width, height) against the bounds * specified by [xmin, xmax) and [ymin, ymax). * \return GL_FALSE if rect is totally clipped, GL_TRUE otherwise. diff --git a/src/mesa/main/image.h b/src/mesa/main/image.h index 2a16989fa7..38e1374c20 100644 --- a/src/mesa/main/image.h +++ b/src/mesa/main/image.h @@ -2,7 +2,7 @@ * Mesa 3-D graphics library * Version: 7.1 * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2008 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"), @@ -111,6 +111,51 @@ _mesa_pack_bitmap( GLint width, GLint height, const GLubyte *source, GLubyte *dest, const struct gl_pixelstore_attrib *packing ); +/** \name Pixel processing functions */ +/*@{*/ + +extern void +_mesa_scale_and_bias_rgba(GLuint n, GLfloat rgba[][4], + GLfloat rScale, GLfloat gScale, + GLfloat bScale, GLfloat aScale, + GLfloat rBias, GLfloat gBias, + GLfloat bBias, GLfloat aBias); + +extern void +_mesa_map_rgba(const GLcontext *ctx, GLuint n, GLfloat rgba[][4]); + + +extern void +_mesa_transform_rgba(const GLcontext *ctx, GLuint n, GLfloat rgba[][4]); + + +extern void +_mesa_lookup_rgba_float(const struct gl_color_table *table, + GLuint n, GLfloat rgba[][4]); + +extern void +_mesa_lookup_rgba_ubyte(const struct gl_color_table *table, + GLuint n, GLubyte rgba[][4]); + + +extern void +_mesa_map_ci_to_rgba(const GLcontext *ctx, + GLuint n, const GLuint index[], GLfloat rgba[][4]); + + +extern void +_mesa_map_ci8_to_rgba8(const GLcontext *ctx, GLuint n, const GLubyte index[], + GLubyte rgba[][4]); + + +extern void +_mesa_scale_and_bias_depth(const GLcontext *ctx, GLuint n, + GLfloat depthValues[]); + +extern void +_mesa_scale_and_bias_depth_uint(const GLcontext *ctx, GLuint n, + GLuint depthValues[]); + extern void _mesa_apply_rgba_transfer_ops(GLcontext *ctx, GLbitfield transferOps, GLuint n, GLfloat rgba[][4]); @@ -225,6 +270,12 @@ _mesa_clip_readpixels(const GLcontext *ctx, struct gl_pixelstore_attrib *pack); extern GLboolean +_mesa_clip_copytexsubimage(const GLcontext *ctx, + GLint *destX, GLint *destY, + GLint *srcX, GLint *srcY, + GLsizei *width, GLsizei *height); + +extern GLboolean _mesa_clip_to_region(GLint xmin, GLint ymin, GLint xmax, GLint ymax, GLint *x, GLint *y, diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index 1aebb25163..13cb84ca4b 100644 --- a/src/mesa/main/imports.c +++ b/src/mesa/main/imports.c @@ -559,7 +559,7 @@ _mesa_pow(double x, double y) int _mesa_ffs(int i) { -#if (defined(_WIN32) && !defined(__MINGW32__) ) || defined(__IBMC__) || defined(__IBMCPP__) +#if (defined(_WIN32) ) || defined(__IBMC__) || defined(__IBMCPP__) register int bit = 0; if (i != 0) { if ((i & 0xffff) == 0) { @@ -786,7 +786,24 @@ void * _mesa_bsearch( const void *key, const void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *) ) { +#if defined(_WIN32_WCE) + void *mid; + int cmp; + while (nmemb) { + nmemb >>= 1; + mid = (char *)base + nmemb * size; + cmp = (*compar)(key, mid); + if (cmp == 0) + return mid; + if (cmp > 0) { + base = (char *)mid + size; + --nmemb; + } + } + return NULL; +#else return bsearch(key, base, nmemb, size, compar); +#endif } /*@}*/ @@ -802,7 +819,7 @@ _mesa_bsearch( const void *key, const void *base, size_t nmemb, size_t size, char * _mesa_getenv( const char *var ) { -#if defined(_XBOX) +#if defined(_XBOX) || defined(_WIN32_WCE) return NULL; #else return getenv(var); diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h index 00a18d3f15..89d0662f79 100644 --- a/src/mesa/main/imports.h +++ b/src/mesa/main/imports.h @@ -333,7 +333,7 @@ static INLINE int iround(float f) return r; } #define IROUND(x) iround(x) -#elif defined(USE_X86_ASM) && defined(__MSC__) && defined(__WIN32__) +#elif defined(USE_X86_ASM) && defined(_MSC_VER) static INLINE int iround(float f) { int r; diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c index 6dd334e16d..10ee088a2d 100644 --- a/src/mesa/main/light.c +++ b/src/mesa/main/light.c @@ -184,6 +184,7 @@ _mesa_Lightfv( GLenum light, GLenum pname, const GLfloat *params ) GET_CURRENT_CONTEXT(ctx); GLint i = (GLint) (light - GL_LIGHT0); GLfloat temp[4]; + ASSERT_OUTSIDE_BEGIN_END(ctx); if (i < 0 || i >= (GLint) ctx->Const.MaxLights) { _mesa_error( ctx, GL_INVALID_ENUM, "glLight(light=0x%x)", light ); @@ -1128,7 +1129,7 @@ compute_light_positions( GLcontext *ctx ) } else { /* positional light w/ homogeneous coordinate, divide by W */ - GLfloat wInv = 1.0 / light->_Position[3]; + GLfloat wInv = (GLfloat)1.0 / light->_Position[3]; light->_Position[0] *= wInv; light->_Position[1] *= wInv; light->_Position[2] *= wInv; diff --git a/src/mesa/main/macros.h b/src/mesa/main/macros.h index fbbcd4e269..2630855a0e 100644 --- a/src/mesa/main/macros.h +++ b/src/mesa/main/macros.h @@ -657,4 +657,11 @@ do { \ #define LEN_SQUARED_2FV( V ) ((V)[0]*(V)[0]+(V)[1]*(V)[1]) +/** casts to silence warnings with some compilers */ +#define ENUM_TO_INT(E) ((GLint)(E)) +#define ENUM_TO_FLOAT(E) ((GLfloat)(GLint)(E)) +#define ENUM_TO_DOUBLE(E) ((GLdouble)(GLint)(E)) +#define ENUM_TO_BOOLEAN(E) ((E) ? GL_TRUE : GL_FALSE) + + #endif diff --git a/src/mesa/main/mfeatures.h b/src/mesa/main/mfeatures.h new file mode 100644 index 0000000000..ed78f57edf --- /dev/null +++ b/src/mesa/main/mfeatures.h @@ -0,0 +1,83 @@ +/* + * Mesa 3-D graphics library + * Version: 7.1 + * + * Copyright (C) 1999-2008 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 mfeatures.h + * Flags to enable/disable specific parts of the API. + */ + +#ifndef FEATURES_H +#define FEATURES_H + + +#ifndef _HAVE_FULL_GL +#define _HAVE_FULL_GL 1 +#endif + +#define FEATURE_accum _HAVE_FULL_GL +#define FEATURE_attrib_stack _HAVE_FULL_GL +#define FEATURE_colortable _HAVE_FULL_GL +#define FEATURE_convolution _HAVE_FULL_GL +#define FEATURE_dispatch _HAVE_FULL_GL +#define FEATURE_dlist _HAVE_FULL_GL +#define FEATURE_draw_read_buffer _HAVE_FULL_GL +#define FEATURE_drawpix _HAVE_FULL_GL +#define FEATURE_evaluators _HAVE_FULL_GL +#define FEATURE_feedback _HAVE_FULL_GL +#define FEATURE_fixedpt 0 +#define FEATURE_histogram _HAVE_FULL_GL +#define FEATURE_pixel_transfer _HAVE_FULL_GL +#define FEATURE_point_size_array 0 +#define FEATURE_texgen _HAVE_FULL_GL +#define FEATURE_texture_fxt1 _HAVE_FULL_GL +#define FEATURE_texture_s3tc _HAVE_FULL_GL +#define FEATURE_userclip _HAVE_FULL_GL +#define FEATURE_vertex_array_byte 0 +#define FEATURE_windowpos _HAVE_FULL_GL +#define FEATURE_es2_glsl 0 + +#define FEATURE_ARB_occlusion_query _HAVE_FULL_GL +#define FEATURE_ARB_fragment_program _HAVE_FULL_GL +#define FEATURE_ARB_vertex_buffer_object _HAVE_FULL_GL +#define FEATURE_ARB_vertex_program _HAVE_FULL_GL +#define FEATURE_ARB_vertex_shader _HAVE_FULL_GL +#define FEATURE_ARB_fragment_shader _HAVE_FULL_GL +#define FEATURE_ARB_shader_objects (FEATURE_ARB_vertex_shader || FEATURE_ARB_fragment_shader) +#define FEATURE_ARB_shading_language_100 FEATURE_ARB_shader_objects +#define FEATURE_ARB_shading_language_120 FEATURE_ARB_shader_objects + +#define FEATURE_EXT_framebuffer_blit _HAVE_FULL_GL +#define FEATURE_EXT_framebuffer_object _HAVE_FULL_GL +#define FEATURE_EXT_pixel_buffer_object _HAVE_FULL_GL +#define FEATURE_EXT_texture_sRGB _HAVE_FULL_GL +#define FEATURE_EXT_timer_query _HAVE_FULL_GL +#define FEATURE_ATI_fragment_shader _HAVE_FULL_GL +#define FEATURE_MESA_program_debug _HAVE_FULL_GL +#define FEATURE_NV_fence _HAVE_FULL_GL +#define FEATURE_NV_fragment_program _HAVE_FULL_GL +#define FEATURE_NV_vertex_program _HAVE_FULL_GL + + +#endif /* FEATURES_H */ diff --git a/src/mesa/main/mipmap.c b/src/mesa/main/mipmap.c index fe2fbb8f7f..fe49faf2bc 100644 --- a/src/mesa/main/mipmap.c +++ b/src/mesa/main/mipmap.c @@ -36,462 +36,377 @@ +static GLint +bytes_per_pixel(GLenum datatype, GLuint comps) +{ + GLint b = _mesa_sizeof_packed_type(datatype); + assert(b >= 0); + return b * comps; +} + + /** * 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. + * \param datatype GL_UNSIGNED_BYTE, GL_UNSIGNED_SHORT, GL_FLOAT, etc. + * \param comps number of components per pixel (1..4) */ static void -do_row(const struct gl_texture_format *format, GLint srcWidth, +do_row(GLenum datatype, GLuint comps, 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; + ASSERT(comps >= 1); + ASSERT(comps <= 4); + /* 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; - } + if (datatype == GL_UNSIGNED_BYTE && comps == 4) { + 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_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; - } + } + else if (datatype == GL_UNSIGNED_BYTE && comps == 3) { + 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_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; - } + } + else if (datatype == GL_UNSIGNED_BYTE && comps == 2) { + 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_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; - } + } + else if (datatype == GL_UNSIGNED_BYTE && comps == 1) { + 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_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; - } + } + + else if (datatype == GL_UNSIGNED_SHORT && comps == 4) { + GLuint i, j, k; + const GLushort(*rowA)[4] = (const GLushort(*)[4]) srcRowA; + const GLushort(*rowB)[4] = (const GLushort(*)[4]) srcRowB; + GLushort(*dst)[4] = (GLushort(*)[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; - /* 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; - } + } + else if (datatype == GL_UNSIGNED_SHORT && comps == 3) { + GLuint i, j, k; + const GLushort(*rowA)[3] = (const GLushort(*)[3]) srcRowA; + const GLushort(*rowB)[3] = (const GLushort(*)[3]) srcRowB; + GLushort(*dst)[3] = (GLushort(*)[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_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; - } + } + else if (datatype == GL_UNSIGNED_SHORT && comps == 2) { + GLuint i, j, k; + const GLushort(*rowA)[2] = (const GLushort(*)[2]) srcRowA; + const GLushort(*rowB)[2] = (const GLushort(*)[2]) srcRowB; + GLushort(*dst)[2] = (GLushort(*)[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_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; - } + } + else if (datatype == GL_UNSIGNED_SHORT && comps == 1) { + 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; - 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; - } + } + + else if (datatype == GL_FLOAT && comps == 4) { + 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_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; - } + } + else if (datatype == GL_FLOAT && comps == 3) { + 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_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; - } + } + else if (datatype == GL_FLOAT && comps == 2) { + 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_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; - } + } + else if (datatype == GL_FLOAT && comps == 1) { + 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_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; + } + + else if (datatype == GL_HALF_FLOAT_ARB && comps == 4) { + 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_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; + } + else if (datatype == GL_HALF_FLOAT_ARB && comps == 3) { + 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_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); - } + } + else if (datatype == GL_HALF_FLOAT_ARB && comps == 2) { + 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_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; - } + } + else if (datatype == GL_HALF_FLOAT_ARB && comps == 1) { + 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; - 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); - } - } + } + + else if (datatype == GL_UNSIGNED_INT && comps == 1) { + 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] = (GLfloat)(rowA[j] / 4 + rowA[k] / 4 + rowB[j] / 4 + rowB[k] / 4); } - 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; - } + } + + else if (datatype == GL_UNSIGNED_SHORT_5_6_5 && comps == 3) { + 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_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); - } - } + } + else if (datatype == GL_UNSIGNED_SHORT_4_4_4_4 && comps == 4) { + 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_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; - } + } + else if (datatype == GL_UNSIGNED_SHORT_1_5_5_5_REV && comps == 4) { + 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_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); - } + } + else if (datatype == GL_UNSIGNED_BYTE_3_3_2 && comps == 3) { + 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; - - default: + } + else { _mesa_problem(NULL, "bad format in do_row()"); } } @@ -504,11 +419,11 @@ do_row(const struct gl_texture_format *format, GLint srcWidth, */ static void -make_1d_mipmap(const struct gl_texture_format *format, GLint border, +make_1d_mipmap(GLenum datatype, GLuint comps, GLint border, GLint srcWidth, const GLubyte *srcPtr, GLint dstWidth, GLubyte *dstPtr) { - const GLint bpt = format->TexelBytes; + const GLint bpt = bytes_per_pixel(datatype, comps); const GLubyte *src; GLubyte *dst; @@ -517,7 +432,7 @@ make_1d_mipmap(const struct gl_texture_format *format, GLint border, dst = dstPtr + border * bpt; /* we just duplicate the input row, kind of hack, saves code */ - do_row(format, srcWidth - 2 * border, src, src, + do_row(datatype, comps, srcWidth - 2 * border, src, src, dstWidth - 2 * border, dst); if (border) { @@ -532,13 +447,13 @@ make_1d_mipmap(const struct gl_texture_format *format, GLint border, static void -make_2d_mipmap(const struct gl_texture_format *format, GLint border, +make_2d_mipmap(GLenum datatype, GLuint comps, GLint border, GLint srcWidth, GLint srcHeight, const GLubyte *srcPtr, GLint srcRowStride, GLint dstWidth, GLint dstHeight, GLubyte *dstPtr, GLint dstRowStride) { - const GLint bpt = format->TexelBytes; + const GLint bpt = bytes_per_pixel(datatype, comps); const GLint srcWidthNB = srcWidth - 2 * border; /* sizes w/out border */ const GLint dstWidthNB = dstWidth - 2 * border; const GLint dstHeightNB = dstHeight - 2 * border; @@ -557,7 +472,7 @@ make_2d_mipmap(const struct gl_texture_format *format, GLint border, dst = dstPtr + border * ((dstWidth + 1) * bpt); for (row = 0; row < dstHeightNB; row++) { - do_row(format, srcWidthNB, srcA, srcB, + do_row(datatype, comps, srcWidthNB, srcA, srcB, dstWidthNB, dst); srcA += 2 * srcRowBytes; srcB += 2 * srcRowBytes; @@ -579,12 +494,12 @@ make_2d_mipmap(const struct gl_texture_format *format, GLint border, MEMCPY(dstPtr + (dstWidth * dstHeight - 1) * bpt, srcPtr + (srcWidth * srcHeight - 1) * bpt, bpt); /* lower border */ - do_row(format, srcWidthNB, + do_row(datatype, comps, srcWidthNB, srcPtr + bpt, srcPtr + bpt, dstWidthNB, dstPtr + bpt); /* upper border */ - do_row(format, srcWidthNB, + do_row(datatype, comps, srcWidthNB, srcPtr + (srcWidth * (srcHeight - 1) + 1) * bpt, srcPtr + (srcWidth * (srcHeight - 1) + 1) * bpt, dstWidthNB, @@ -602,11 +517,11 @@ make_2d_mipmap(const struct gl_texture_format *format, GLint border, else { /* average two src pixels each dest pixel */ for (row = 0; row < dstHeightNB; row += 2) { - do_row(format, 1, + do_row(datatype, comps, 1, srcPtr + (srcWidth * (row * 2 + 1)) * bpt, srcPtr + (srcWidth * (row * 2 + 2)) * bpt, 1, dstPtr + (dstWidth * row + 1) * bpt); - do_row(format, 1, + do_row(datatype, comps, 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); @@ -617,13 +532,13 @@ make_2d_mipmap(const struct gl_texture_format *format, GLint border, static void -make_3d_mipmap(const struct gl_texture_format *format, GLint border, +make_3d_mipmap(GLenum datatype, GLuint comps, GLint border, GLint srcWidth, GLint srcHeight, GLint srcDepth, const GLubyte *srcPtr, GLint srcRowStride, GLint dstWidth, GLint dstHeight, GLint dstDepth, GLubyte *dstPtr, GLint dstRowStride) { - const GLint bpt = format->TexelBytes; + const GLint bpt = bytes_per_pixel(datatype, comps); const GLint srcWidthNB = srcWidth - 2 * border; /* sizes w/out border */ const GLint srcDepthNB = srcDepth - 2 * border; const GLint dstWidthNB = dstWidth - 2 * border; @@ -693,13 +608,13 @@ make_3d_mipmap(const struct gl_texture_format *format, GLint border, for (row = 0; row < dstHeightNB; row++) { /* Average together two rows from first src image */ - do_row(format, srcWidthNB, srcImgARowA, srcImgARowB, + do_row(datatype, comps, srcWidthNB, srcImgARowA, srcImgARowB, srcWidthNB, tmpRowA); /* Average together two rows from second src image */ - do_row(format, srcWidthNB, srcImgBRowA, srcImgBRowB, + do_row(datatype, comps, srcWidthNB, srcImgBRowA, srcImgBRowB, srcWidthNB, tmpRowB); /* Average together the temp rows to make the final row */ - do_row(format, srcWidthNB, tmpRowA, tmpRowB, + do_row(datatype, comps, srcWidthNB, tmpRowA, tmpRowB, dstWidthNB, dstImgRow); /* advance to next rows */ srcImgARowA += bytesPerSrcRow + srcRowOffset; @@ -716,10 +631,10 @@ make_3d_mipmap(const struct gl_texture_format *format, GLint border, /* 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, srcRowStride, + make_2d_mipmap(datatype, comps, 1, srcWidth, srcHeight, srcPtr, srcRowStride, dstWidth, dstHeight, dstPtr, dstRowStride); /* do back border image */ - make_2d_mipmap(format, 1, srcWidth, srcHeight, + make_2d_mipmap(datatype, comps, 1, srcWidth, srcHeight, srcPtr + bytesPerSrcImage * (srcDepth - 1), srcRowStride, dstWidth, dstHeight, dstPtr + bytesPerDstImage * (dstDepth - 1), dstRowStride); @@ -767,28 +682,28 @@ make_3d_mipmap(const struct gl_texture_format *format, GLint border, /* 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_row(datatype, comps, 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_row(datatype, comps, 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_row(datatype, comps, 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); + do_row(datatype, comps, 1, src, src + srcImageOffset, 1, dst); } } } @@ -796,12 +711,12 @@ make_3d_mipmap(const struct gl_texture_format *format, GLint border, static void -make_1d_stack_mipmap(const struct gl_texture_format *format, GLint border, +make_1d_stack_mipmap(GLenum datatype, GLuint comps, GLint border, GLint srcWidth, const GLubyte *srcPtr, GLuint srcRowStride, GLint dstWidth, GLint dstHeight, GLubyte *dstPtr, GLuint dstRowStride ) { - const GLint bpt = format->TexelBytes; + const GLint bpt = bytes_per_pixel(datatype, comps); const GLint srcWidthNB = srcWidth - 2 * border; /* sizes w/out border */ const GLint dstWidthNB = dstWidth - 2 * border; const GLint dstHeightNB = dstHeight - 2 * border; @@ -816,7 +731,7 @@ make_1d_stack_mipmap(const struct gl_texture_format *format, GLint border, dst = dstPtr + border * ((dstWidth + 1) * bpt); for (row = 0; row < dstHeightNB; row++) { - do_row(format, srcWidthNB, src, src, + do_row(datatype, comps, srcWidthNB, src, src, dstWidthNB, dst); src += srcRowBytes; dst += dstRowBytes; @@ -839,13 +754,13 @@ make_1d_stack_mipmap(const struct gl_texture_format *format, GLint border, * and \c make_2d_mipmap. */ static void -make_2d_stack_mipmap(const struct gl_texture_format *format, GLint border, +make_2d_stack_mipmap(GLenum datatype, GLuint comps, GLint border, GLint srcWidth, GLint srcHeight, const GLubyte *srcPtr, GLint srcRowStride, GLint dstWidth, GLint dstHeight, GLint dstDepth, GLubyte *dstPtr, GLint dstRowStride) { - const GLint bpt = format->TexelBytes; + const GLint bpt = bytes_per_pixel(datatype, comps); const GLint srcWidthNB = srcWidth - 2 * border; /* sizes w/out border */ const GLint dstWidthNB = dstWidth - 2 * border; const GLint dstHeightNB = dstHeight - 2 * border; @@ -867,7 +782,7 @@ make_2d_stack_mipmap(const struct gl_texture_format *format, GLint border, for (layer = 0; layer < dstDepthNB; layer++) { for (row = 0; row < dstHeightNB; row++) { - do_row(format, srcWidthNB, srcA, srcB, + do_row(datatype, comps, srcWidthNB, srcA, srcB, dstWidthNB, dst); srcA += 2 * srcRowBytes; srcB += 2 * srcRowBytes; @@ -889,12 +804,12 @@ make_2d_stack_mipmap(const struct gl_texture_format *format, GLint border, MEMCPY(dstPtr + (dstWidth * dstHeight - 1) * bpt, srcPtr + (srcWidth * srcHeight - 1) * bpt, bpt); /* lower border */ - do_row(format, srcWidthNB, + do_row(datatype, comps, srcWidthNB, srcPtr + bpt, srcPtr + bpt, dstWidthNB, dstPtr + bpt); /* upper border */ - do_row(format, srcWidthNB, + do_row(datatype, comps, srcWidthNB, srcPtr + (srcWidth * (srcHeight - 1) + 1) * bpt, srcPtr + (srcWidth * (srcHeight - 1) + 1) * bpt, dstWidthNB, @@ -912,11 +827,11 @@ make_2d_stack_mipmap(const struct gl_texture_format *format, GLint border, else { /* average two src pixels each dest pixel */ for (row = 0; row < dstHeightNB; row += 2) { - do_row(format, 1, + do_row(datatype, comps, 1, srcPtr + (srcWidth * (row * 2 + 1)) * bpt, srcPtr + (srcWidth * (row * 2 + 2)) * bpt, 1, dstPtr + (dstWidth * row + 1) * bpt); - do_row(format, 1, + do_row(datatype, comps, 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); @@ -928,6 +843,115 @@ make_2d_stack_mipmap(const struct gl_texture_format *format, GLint border, /** + * Down-sample a texture image to produce the next lower mipmap level. + */ +void +_mesa_generate_mipmap_level(GLenum target, + GLenum datatype, GLuint comps, + GLint border, + GLint srcWidth, GLint srcHeight, GLint srcDepth, + const GLubyte *srcData, + GLint srcRowStride, + GLint dstWidth, GLint dstHeight, GLint dstDepth, + GLubyte *dstData, + GLint dstRowStride) +{ + /* + * We use simple 2x2 averaging to compute the next mipmap level. + */ + switch (target) { + case GL_TEXTURE_1D: + make_1d_mipmap(datatype, comps, 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(datatype, comps, border, + srcWidth, srcHeight, srcData, srcRowStride, + dstWidth, dstHeight, dstData, dstRowStride); + break; + case GL_TEXTURE_3D: + make_3d_mipmap(datatype, comps, border, + srcWidth, srcHeight, srcDepth, + srcData, srcRowStride, + dstWidth, dstHeight, dstDepth, + dstData, dstRowStride); + break; + case GL_TEXTURE_1D_ARRAY_EXT: + make_1d_stack_mipmap(datatype, comps, border, + srcWidth, srcData, srcRowStride, + dstWidth, dstHeight, + dstData, dstRowStride); + break; + case GL_TEXTURE_2D_ARRAY_EXT: + make_2d_stack_mipmap(datatype, comps, border, + srcWidth, srcHeight, + srcData, srcRowStride, + dstWidth, dstHeight, + dstDepth, dstData, dstRowStride); + break; + case GL_TEXTURE_RECTANGLE_NV: + /* no mipmaps, do nothing */ + break; + default: + _mesa_problem(NULL, "bad dimensions in _mesa_generate_mipmaps"); + return; + } +} + + +/** + * compute next (level+1) image size + * \return GL_FALSE if no smaller size can be generated (eg. src is 1x1x1 size) + */ +static GLboolean +next_mipmap_level_size(GLenum target, GLint border, + GLint srcWidth, GLint srcHeight, GLint srcDepth, + GLint *dstWidth, GLint *dstHeight, GLint *dstDepth) +{ + if (srcWidth - 2 * border > 1) { + *dstWidth = (srcWidth - 2 * border) / 2 + 2 * border; + } + else { + *dstWidth = srcWidth; /* can't go smaller */ + } + + if ((srcHeight - 2 * border > 1) && + (target != GL_TEXTURE_1D_ARRAY_EXT)) { + *dstHeight = (srcHeight - 2 * border) / 2 + 2 * border; + } + else { + *dstHeight = srcHeight; /* can't go smaller */ + } + + if ((srcDepth - 2 * border > 1) && + (target != GL_TEXTURE_2D_ARRAY_EXT)) { + *dstDepth = (srcDepth - 2 * border) / 2 + 2 * border; + } + else { + *dstDepth = srcDepth; /* can't go smaller */ + } + + if (*dstWidth == srcWidth && + *dstHeight == srcHeight && + *dstDepth == srcDepth) { + return GL_FALSE; + } + else { + return GL_TRUE; + } +} + + + + +/** * 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. @@ -941,6 +965,8 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target, const GLubyte *srcData = NULL; GLubyte *dstData = NULL; GLint level, maxLevels; + GLenum datatype; + GLuint comps; ASSERT(texObj); /* XXX choose cube map face here??? */ @@ -1004,6 +1030,8 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target, convertFormat = srcImage->TexFormat; } + _mesa_format_to_type_and_comps(convertFormat, &datatype, &comps); + for (level = texObj->BaseLevel; level < texObj->MaxLevel && level < maxLevels - 1; level++) { /* generate image[level+1] from image[level] */ @@ -1012,6 +1040,7 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target, GLint srcWidth, srcHeight, srcDepth; GLint dstWidth, dstHeight, dstDepth; GLint border, bytesPerTexel; + GLboolean nextLevel; /* get src image parameters */ srcImage = _mesa_select_tex_image(ctx, texObj, target, level); @@ -1021,31 +1050,10 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target, 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) && - (texObj->Target != GL_TEXTURE_1D_ARRAY_EXT)) { - dstHeight = (srcHeight - 2 * border) / 2 + 2 * border; - } - else { - dstHeight = srcHeight; /* can't go smaller */ - } - if ((srcDepth - 2 * border > 1) && - (texObj->Target != GL_TEXTURE_2D_ARRAY_EXT)) { - dstDepth = (srcDepth - 2 * border) / 2 + 2 * border; - } - else { - dstDepth = srcDepth; /* can't go smaller */ - } - - if (dstWidth == srcWidth && - dstHeight == srcHeight && - dstDepth == srcDepth) { + nextLevel = next_mipmap_level_size(target, border, + srcWidth, srcHeight, srcDepth, + &dstWidth, &dstHeight, &dstDepth); + if (!nextLevel) { /* all done */ if (srcImage->IsCompressed) { _mesa_free((void *) srcData); @@ -1114,53 +1122,12 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target, 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, srcImage->RowStride, - dstWidth, dstHeight, dstData, dstImage->RowStride); - break; - case GL_TEXTURE_3D: - make_3d_mipmap(convertFormat, border, - srcWidth, srcHeight, srcDepth, - srcData, srcImage->RowStride, - dstWidth, dstHeight, dstDepth, - dstData, dstImage->RowStride); - break; - case GL_TEXTURE_1D_ARRAY_EXT: - make_1d_stack_mipmap(convertFormat, border, - srcWidth, srcData, srcImage->RowStride, - dstWidth, dstHeight, - dstData, dstImage->RowStride); - break; - case GL_TEXTURE_2D_ARRAY_EXT: - make_2d_stack_mipmap(convertFormat, border, - srcWidth, srcHeight, - srcData, srcImage->RowStride, - dstWidth, dstHeight, - dstDepth, dstData, dstImage->RowStride); - break; - case GL_TEXTURE_RECTANGLE_NV: - /* no mipmaps, do nothing */ - break; - default: - _mesa_problem(ctx, "bad dimensions in _mesa_generate_mipmaps"); - return; - } + _mesa_generate_mipmap_level(target, datatype, comps, border, + srcWidth, srcHeight, srcDepth, + srcData, srcImage->RowStride, + dstWidth, dstHeight, dstDepth, + dstData, dstImage->RowStride); + if (dstImage->IsCompressed) { GLubyte *temp; diff --git a/src/mesa/main/mipmap.h b/src/mesa/main/mipmap.h index 46e16902c8..22094c3437 100644 --- a/src/mesa/main/mipmap.h +++ b/src/mesa/main/mipmap.h @@ -28,6 +28,19 @@ #include "mtypes.h" + +extern void +_mesa_generate_mipmap_level(GLenum target, + GLenum datatype, GLuint comps, + GLint border, + GLint srcWidth, GLint srcHeight, GLint srcDepth, + const GLubyte *srcData, + GLint srcRowStride, + GLint dstWidth, GLint dstHeight, GLint dstDepth, + GLubyte *dstData, + GLint dstRowStride); + + extern void _mesa_generate_mipmap(GLcontext *ctx, GLenum target, struct gl_texture_object *texObj); diff --git a/src/mesa/main/mm.c b/src/mesa/main/mm.c index fb7809ed22..d430bcdb84 100644 --- a/src/mesa/main/mm.c +++ b/src/mesa/main/mm.c @@ -53,11 +53,11 @@ mmDumpMemInfo(const struct mem_block *heap) } struct mem_block * -mmInit(unsigned int ofs, int size) +mmInit(unsigned ofs, unsigned size) { struct mem_block *heap, *block; - if (size <= 0) + if (!size) return NULL; heap = (struct mem_block *) _mesa_calloc(sizeof(struct mem_block)); @@ -91,8 +91,8 @@ mmInit(unsigned int ofs, int size) static struct mem_block * SliceBlock(struct mem_block *p, - unsigned int startofs, int size, - int reserved, int alignment) + unsigned startofs, unsigned size, + unsigned reserved, unsigned alignment) { struct mem_block *newblock; @@ -160,14 +160,14 @@ SliceBlock(struct mem_block *p, struct mem_block * -mmAllocMem(struct mem_block *heap, int size, int align2, int startSearch) +mmAllocMem(struct mem_block *heap, unsigned size, unsigned align2, unsigned startSearch) { struct mem_block *p; - const int mask = (1 << align2)-1; - unsigned int startofs = 0; - unsigned int endofs; + const unsigned mask = (1 << align2)-1; + unsigned startofs = 0; + unsigned endofs; - if (!heap || align2 < 0 || size <= 0) + if (!heap || !size) return NULL; for (p = heap->next_free; p != heap; p = p->next_free) { @@ -193,7 +193,7 @@ mmAllocMem(struct mem_block *heap, int size, int align2, int startSearch) struct mem_block * -mmFindBlock(struct mem_block *heap, int start) +mmFindBlock(struct mem_block *heap, unsigned start) { struct mem_block *p; diff --git a/src/mesa/main/mm.h b/src/mesa/main/mm.h index 5ad3ffd6d1..df340808ac 100644 --- a/src/mesa/main/mm.h +++ b/src/mesa/main/mm.h @@ -39,10 +39,10 @@ struct mem_block { struct mem_block *next, *prev; struct mem_block *next_free, *prev_free; struct mem_block *heap; - unsigned int ofs; - int size; - unsigned int free:1; - unsigned int reserved:1; + unsigned ofs; + unsigned size; + unsigned free:1; + unsigned reserved:1; }; @@ -51,7 +51,7 @@ struct mem_block { * input: total size in bytes * return: a heap pointer if OK, NULL if error */ -extern struct mem_block *mmInit(unsigned int ofs, int size); +extern struct mem_block *mmInit(unsigned ofs, unsigned size); /** * Allocate 'size' bytes with 2^align2 bytes alignment, @@ -63,8 +63,8 @@ extern struct mem_block *mmInit(unsigned int ofs, int size); * startSearch = linear offset from start of heap to begin search * return: pointer to the allocated block, 0 if error */ -extern struct mem_block *mmAllocMem(struct mem_block *heap, int size, int align2, - int startSearch); +extern struct mem_block *mmAllocMem(struct mem_block *heap, unsigned size, + unsigned align2, unsigned startSearch); /** * Free block starts at offset @@ -78,7 +78,7 @@ extern int mmFreeMem(struct mem_block *b); * input: pointer to a heap, start offset * return: pointer to a block */ -extern struct mem_block *mmFindBlock(struct mem_block *heap, int start); +extern struct mem_block *mmFindBlock(struct mem_block *heap, unsigned start); /** * destroy MM diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 6f17e46d0e..19cf6f56d1 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -38,8 +38,7 @@ #include "glheader.h" #include <GL/internal/glcore.h> /* __GLcontextModes (GLvisual) */ #include "config.h" /* Hardwired parameters */ -#include "glapi/glapitable.h" -#include "glapi/glthread.h" +#include "glapi/glapi.h" #include "math/m_matrix.h" /* GLmatrix */ #include "bitset.h" @@ -123,6 +122,7 @@ typedef int GLfixed; /*@{*/ struct _mesa_HashTable; struct gl_pixelstore_attrib; +struct gl_program_cache; struct gl_texture_format; struct gl_texture_image; struct gl_texture_object; @@ -149,6 +149,7 @@ enum VERT_ATTRIB_COLOR1 = 4, VERT_ATTRIB_FOG = 5, VERT_ATTRIB_COLOR_INDEX = 6, + VERT_ATTRIB_POINT_SIZE = 6, /*alias*/ VERT_ATTRIB_EDGEFLAG = 7, VERT_ATTRIB_TEX0 = 8, VERT_ATTRIB_TEX1 = 9, @@ -1431,6 +1432,7 @@ struct gl_texture_object GLenum DepthMode; /**< GL_ARB_depth_texture */ GLint _MaxLevel; /**< actual max mipmap level (q in the spec) */ GLfloat _MaxLambda; /**< = _MaxLevel - BaseLevel (q - b in spec) */ + GLint CropRect[4]; /**< GL_OES_draw_texture */ GLboolean GenerateMipmap; /**< GL_SGIS_generate_mipmap */ GLboolean _Complete; /**< Is texture object complete? */ @@ -1440,7 +1442,6 @@ struct gl_texture_object /** GL_EXT_paletted_texture */ struct gl_color_table Palette; - /** * \name For device driver. * Note: instead of attaching driver data to this pointer, it's preferable @@ -1546,15 +1547,6 @@ struct gl_texture_unit }; -struct texenvprog_cache_item; - -struct texenvprog_cache -{ - struct texenvprog_cache_item **items; - GLuint size, n_items; - GLcontext *ctx; -}; - /** * Texture attribute group (GL_TEXTURE_BIT). @@ -1581,9 +1573,6 @@ struct gl_texture_attrib /** GL_EXT_shared_texture_palette */ GLboolean SharedPalette; struct gl_color_table Palette; - - /** Cached texenv fragment programs */ - struct texenvprog_cache env_fp_cache; }; @@ -1704,6 +1693,7 @@ struct gl_array_object struct gl_client_array Index; struct gl_client_array EdgeFlag; struct gl_client_array TexCoord[MAX_TEXTURE_COORD_UNITS]; + struct gl_client_array PointSize; /*@}*/ /** Generic arrays for vertex programs/shaders */ @@ -1942,7 +1932,10 @@ struct gl_fragment_program { struct gl_program Base; /**< base class */ GLenum FogOption; - GLboolean UsesKill; + GLboolean UsesKill; /**< shader uses KIL instruction */ + GLboolean UsesPointCoord; /**< shader uses gl_PointCoord */ + GLboolean UsesFrontFacing; /**< shader used gl_FrontFacing */ + GLboolean UsesFogFragCoord; /**< shader used gl_FogFragCoord */ }; @@ -1984,6 +1977,9 @@ struct gl_vertex_program_state /** Program to emulate fixed-function T&L (see above) */ struct gl_vertex_program *_TnlProgram; + /** Cache of fixed-function programs */ + struct gl_program_cache *Cache; + #if FEATURE_MESA_program_debug GLprogramcallbackMESA Callback; GLvoid *CallbackData; @@ -2017,6 +2013,9 @@ struct gl_fragment_program_state /** Program to emulate fixed-function texture env/combine (see above) */ struct gl_fragment_program *_TexEnvProgram; + /** Cache of fixed-function programs */ + struct gl_program_cache *Cache; + #if FEATURE_MESA_program_debug GLprogramcallbackMESA Callback; GLvoid *CallbackData; @@ -2074,10 +2073,11 @@ struct gl_ati_fragment_shader_state */ struct gl_query_object { - GLuint Id; - GLuint64EXT Result; /* the counter */ - GLboolean Active; /* inside Begin/EndQuery */ - GLboolean Ready; /* result is ready */ + GLenum Target; /**< The query target, when active */ + GLuint Id; /**< hash table ID/name */ + GLuint64EXT Result; /**< the counter */ + GLboolean Active; /**< inside Begin/EndQuery */ + GLboolean Ready; /**< result is ready? */ }; @@ -2125,12 +2125,14 @@ struct gl_shader_program GLuint NumShaders; /**< number of attached shaders */ struct gl_shader **Shaders; /**< List of attached the shaders */ + /** User-defined attribute bindings (glBindAttribLocation) */ + struct gl_program_parameter_list *Attributes; + /* post-link info: */ struct gl_vertex_program *VertexProgram; /**< Linked vertex program */ struct gl_fragment_program *FragmentProgram; /**< Linked fragment prog */ struct gl_uniform_list *Uniforms; struct gl_program_parameter_list *Varying; - struct gl_program_parameter_list *Attributes; /**< Vertex attributes */ GLboolean LinkStatus; /**< GL_LINK_STATUS */ GLboolean Validated; GLchar *InfoLog; @@ -2498,7 +2500,7 @@ struct gl_constants GLuint MaxRenderbufferSize; /* GL_ARB_vertex_shader */ GLuint MaxVertexTextureImageUnits; - GLuint MaxVarying; + GLuint MaxVarying; /**< Number of float[4] vectors */ }; @@ -2736,6 +2738,7 @@ struct gl_matrix_stack #define _NEW_ARRAY_FOGCOORD VERT_BIT_FOG #define _NEW_ARRAY_INDEX VERT_BIT_COLOR_INDEX #define _NEW_ARRAY_EDGEFLAG VERT_BIT_EDGEFLAG +#define _NEW_ARRAY_POINT_SIZE VERT_BIT_COLOR_INDEX /* aliased */ #define _NEW_ARRAY_TEXCOORD_0 VERT_BIT_TEX0 #define _NEW_ARRAY_TEXCOORD_1 VERT_BIT_TEX1 #define _NEW_ARRAY_TEXCOORD_2 VERT_BIT_TEX2 @@ -2753,6 +2756,7 @@ struct gl_matrix_stack /*@}*/ + /** * \name A bunch of flags that we think might be useful to drivers. * diff --git a/src/mesa/main/multisample.c b/src/mesa/main/multisample.c new file mode 100644 index 0000000000..b9cfad9216 --- /dev/null +++ b/src/mesa/main/multisample.c @@ -0,0 +1,66 @@ +/* + * Mesa 3-D graphics library + * Version: 7.1 + * + * Copyright (C) 1999-2007 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. + */ + + +#include "main/glheader.h" +#include "main/context.h" +#include "main/macros.h" +#include "main/multisample.h" + + +/** + * Called via glSampleCoverageARB + */ +void GLAPIENTRY +_mesa_SampleCoverageARB(GLclampf value, GLboolean invert) +{ + GET_CURRENT_CONTEXT(ctx); + + if (!ctx->Extensions.ARB_multisample) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glSampleCoverageARB"); + return; + } + + ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH( ctx ); + + ctx->Multisample.SampleCoverageValue = (GLfloat) CLAMP(value, 0.0, 1.0); + ctx->Multisample.SampleCoverageInvert = invert; + ctx->NewState |= _NEW_MULTISAMPLE; +} + + +/** + * Initialize the context's multisample state. + * \param ctx the GL context. + */ +void +_mesa_init_multisample(GLcontext *ctx) +{ + ctx->Multisample.Enabled = GL_TRUE; + ctx->Multisample.SampleAlphaToCoverage = GL_FALSE; + ctx->Multisample.SampleAlphaToOne = GL_FALSE; + ctx->Multisample.SampleCoverage = GL_FALSE; + ctx->Multisample.SampleCoverageValue = 1.0; + ctx->Multisample.SampleCoverageInvert = GL_FALSE; +} diff --git a/src/mesa/main/multisample.h b/src/mesa/main/multisample.h new file mode 100644 index 0000000000..4305900cc4 --- /dev/null +++ b/src/mesa/main/multisample.h @@ -0,0 +1,38 @@ +/* + * Mesa 3-D graphics library + * Version: 7.1 + * + * Copyright (C) 1999-2007 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 MULTISAMPLE_H +#define MULTISAMPLE_H + + +extern void GLAPIENTRY +_mesa_SampleCoverageARB(GLclampf value, GLboolean invert); + + +extern void +_mesa_init_multisample(GLcontext *ctx); + + +#endif diff --git a/src/mesa/main/pixel.c b/src/mesa/main/pixel.c index eb4fd6e7c9..c98506b2bb 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.3 + * Version: 7.1 * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2008 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,6 +22,12 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +/** + * \file pixel.c + * Pixel transfer functions (glPixelZoom, glPixelMap, glPixelTransfer) + */ + #include "glheader.h" #include "bufferobj.h" #include "colormac.h" @@ -36,8 +42,6 @@ /***** glPixelZoom *****/ /**********************************************************************/ - - void GLAPIENTRY _mesa_PixelZoom( GLfloat xfactor, GLfloat yfactor ) { @@ -55,200 +59,6 @@ _mesa_PixelZoom( GLfloat xfactor, GLfloat yfactor ) /**********************************************************************/ -/***** glPixelStore *****/ -/**********************************************************************/ - - -void GLAPIENTRY -_mesa_PixelStorei( GLenum pname, GLint param ) -{ - /* NOTE: this call can't be compiled into the display list */ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - switch (pname) { - case GL_PACK_SWAP_BYTES: - if (param == (GLint)ctx->Pack.SwapBytes) - return; - FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); - ctx->Pack.SwapBytes = param ? GL_TRUE : GL_FALSE; - break; - case GL_PACK_LSB_FIRST: - if (param == (GLint)ctx->Pack.LsbFirst) - return; - FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); - ctx->Pack.LsbFirst = param ? GL_TRUE : GL_FALSE; - break; - case GL_PACK_ROW_LENGTH: - if (param<0) { - _mesa_error( ctx, GL_INVALID_VALUE, "glPixelStore(param)" ); - return; - } - if (ctx->Pack.RowLength == param) - return; - FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); - ctx->Pack.RowLength = param; - break; - case GL_PACK_IMAGE_HEIGHT: - if (param<0) { - _mesa_error( ctx, GL_INVALID_VALUE, "glPixelStore(param)" ); - return; - } - if (ctx->Pack.ImageHeight == param) - return; - FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); - ctx->Pack.ImageHeight = param; - break; - case GL_PACK_SKIP_PIXELS: - if (param<0) { - _mesa_error( ctx, GL_INVALID_VALUE, "glPixelStore(param)" ); - return; - } - if (ctx->Pack.SkipPixels == param) - return; - FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); - ctx->Pack.SkipPixels = param; - break; - case GL_PACK_SKIP_ROWS: - if (param<0) { - _mesa_error( ctx, GL_INVALID_VALUE, "glPixelStore(param)" ); - return; - } - if (ctx->Pack.SkipRows == param) - return; - FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); - ctx->Pack.SkipRows = param; - break; - case GL_PACK_SKIP_IMAGES: - if (param<0) { - _mesa_error( ctx, GL_INVALID_VALUE, "glPixelStore(param)" ); - return; - } - if (ctx->Pack.SkipImages == param) - return; - FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); - ctx->Pack.SkipImages = param; - break; - case GL_PACK_ALIGNMENT: - if (param!=1 && param!=2 && param!=4 && param!=8) { - _mesa_error( ctx, GL_INVALID_VALUE, "glPixelStore(param)" ); - return; - } - if (ctx->Pack.Alignment == param) - return; - FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); - ctx->Pack.Alignment = param; - break; - case GL_PACK_INVERT_MESA: - if (!ctx->Extensions.MESA_pack_invert) { - _mesa_error( ctx, GL_INVALID_ENUM, "glPixelstore(pname)" ); - return; - } - if (ctx->Pack.Invert == param) - return; - FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); - ctx->Pack.Invert = param; - break; - - case GL_UNPACK_SWAP_BYTES: - if (param == (GLint)ctx->Unpack.SwapBytes) - return; - if ((GLint)ctx->Unpack.SwapBytes == param) - return; - FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); - ctx->Unpack.SwapBytes = param ? GL_TRUE : GL_FALSE; - break; - case GL_UNPACK_LSB_FIRST: - if (param == (GLint)ctx->Unpack.LsbFirst) - return; - if ((GLint)ctx->Unpack.LsbFirst == param) - return; - FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); - ctx->Unpack.LsbFirst = param ? GL_TRUE : GL_FALSE; - break; - case GL_UNPACK_ROW_LENGTH: - if (param<0) { - _mesa_error( ctx, GL_INVALID_VALUE, "glPixelStore(param)" ); - return; - } - if (ctx->Unpack.RowLength == param) - return; - FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); - ctx->Unpack.RowLength = param; - break; - case GL_UNPACK_IMAGE_HEIGHT: - if (param<0) { - _mesa_error( ctx, GL_INVALID_VALUE, "glPixelStore(param)" ); - return; - } - if (ctx->Unpack.ImageHeight == param) - return; - - FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); - ctx->Unpack.ImageHeight = param; - break; - case GL_UNPACK_SKIP_PIXELS: - if (param<0) { - _mesa_error( ctx, GL_INVALID_VALUE, "glPixelStore(param)" ); - return; - } - if (ctx->Unpack.SkipPixels == param) - return; - FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); - ctx->Unpack.SkipPixels = param; - break; - case GL_UNPACK_SKIP_ROWS: - if (param<0) { - _mesa_error( ctx, GL_INVALID_VALUE, "glPixelStore(param)" ); - return; - } - if (ctx->Unpack.SkipRows == param) - return; - FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); - ctx->Unpack.SkipRows = param; - break; - case GL_UNPACK_SKIP_IMAGES: - if (param < 0) { - _mesa_error( ctx, GL_INVALID_VALUE, "glPixelStore(param)" ); - return; - } - if (ctx->Unpack.SkipImages == param) - return; - FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); - ctx->Unpack.SkipImages = param; - break; - case GL_UNPACK_ALIGNMENT: - if (param!=1 && param!=2 && param!=4 && param!=8) { - _mesa_error( ctx, GL_INVALID_VALUE, "glPixelStore" ); - return; - } - if (ctx->Unpack.Alignment == param) - return; - FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); - ctx->Unpack.Alignment = param; - break; - case GL_UNPACK_CLIENT_STORAGE_APPLE: - if (param == (GLint)ctx->Unpack.ClientStorage) - return; - FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); - ctx->Unpack.ClientStorage = param ? GL_TRUE : GL_FALSE; - break; - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glPixelStore" ); - return; - } -} - - -void GLAPIENTRY -_mesa_PixelStoref( GLenum pname, GLfloat param ) -{ - _mesa_PixelStorei( pname, (GLint) param ); -} - - - -/**********************************************************************/ /***** glPixelMap *****/ /**********************************************************************/ @@ -304,7 +114,7 @@ store_pixelmap(GLcontext *ctx, GLenum map, GLsizei mapsize, /* special case */ ctx->PixelMaps.StoS.Size = mapsize; for (i = 0; i < mapsize; i++) { - ctx->PixelMaps.StoS.Map[i] = IROUND(values[i]); + ctx->PixelMaps.StoS.Map[i] = (GLfloat)IROUND(values[i]); } break; case GL_PIXEL_MAP_I_TO_I: @@ -938,411 +748,6 @@ _mesa_PixelTransferi( GLenum pname, GLint param ) /**********************************************************************/ -/***** Pixel processing functions ******/ -/**********************************************************************/ - -/* - * Apply scale and bias factors to an array of RGBA pixels. - */ -void -_mesa_scale_and_bias_rgba(GLuint n, GLfloat rgba[][4], - GLfloat rScale, GLfloat gScale, - GLfloat bScale, GLfloat aScale, - GLfloat rBias, GLfloat gBias, - GLfloat bBias, GLfloat aBias) -{ - if (rScale != 1.0 || rBias != 0.0) { - GLuint i; - for (i = 0; i < n; i++) { - rgba[i][RCOMP] = rgba[i][RCOMP] * rScale + rBias; - } - } - if (gScale != 1.0 || gBias != 0.0) { - GLuint i; - for (i = 0; i < n; i++) { - rgba[i][GCOMP] = rgba[i][GCOMP] * gScale + gBias; - } - } - if (bScale != 1.0 || bBias != 0.0) { - GLuint i; - for (i = 0; i < n; i++) { - rgba[i][BCOMP] = rgba[i][BCOMP] * bScale + bBias; - } - } - if (aScale != 1.0 || aBias != 0.0) { - GLuint i; - for (i = 0; i < n; i++) { - rgba[i][ACOMP] = rgba[i][ACOMP] * aScale + aBias; - } - } -} - - -/* - * Apply pixel mapping to an array of floating point RGBA pixels. - */ -void -_mesa_map_rgba( const GLcontext *ctx, GLuint n, GLfloat rgba[][4] ) -{ - const GLfloat rscale = (GLfloat) (ctx->PixelMaps.RtoR.Size - 1); - const GLfloat gscale = (GLfloat) (ctx->PixelMaps.GtoG.Size - 1); - const GLfloat bscale = (GLfloat) (ctx->PixelMaps.BtoB.Size - 1); - const GLfloat ascale = (GLfloat) (ctx->PixelMaps.AtoA.Size - 1); - const GLfloat *rMap = ctx->PixelMaps.RtoR.Map; - const GLfloat *gMap = ctx->PixelMaps.GtoG.Map; - const GLfloat *bMap = ctx->PixelMaps.BtoB.Map; - const GLfloat *aMap = ctx->PixelMaps.AtoA.Map; - GLuint i; - for (i=0;i<n;i++) { - GLfloat r = CLAMP(rgba[i][RCOMP], 0.0F, 1.0F); - GLfloat g = CLAMP(rgba[i][GCOMP], 0.0F, 1.0F); - GLfloat b = CLAMP(rgba[i][BCOMP], 0.0F, 1.0F); - GLfloat a = CLAMP(rgba[i][ACOMP], 0.0F, 1.0F); - rgba[i][RCOMP] = rMap[IROUND(r * rscale)]; - rgba[i][GCOMP] = gMap[IROUND(g * gscale)]; - rgba[i][BCOMP] = bMap[IROUND(b * bscale)]; - rgba[i][ACOMP] = aMap[IROUND(a * ascale)]; - } -} - - -/* - * Apply the color matrix and post color matrix scaling and biasing. - */ -void -_mesa_transform_rgba(const GLcontext *ctx, GLuint n, GLfloat rgba[][4]) -{ - const GLfloat rs = ctx->Pixel.PostColorMatrixScale[0]; - const GLfloat rb = ctx->Pixel.PostColorMatrixBias[0]; - const GLfloat gs = ctx->Pixel.PostColorMatrixScale[1]; - const GLfloat gb = ctx->Pixel.PostColorMatrixBias[1]; - const GLfloat bs = ctx->Pixel.PostColorMatrixScale[2]; - const GLfloat bb = ctx->Pixel.PostColorMatrixBias[2]; - const GLfloat as = ctx->Pixel.PostColorMatrixScale[3]; - const GLfloat ab = ctx->Pixel.PostColorMatrixBias[3]; - const GLfloat *m = ctx->ColorMatrixStack.Top->m; - GLuint i; - for (i = 0; i < n; i++) { - const GLfloat r = rgba[i][RCOMP]; - const GLfloat g = rgba[i][GCOMP]; - const GLfloat b = rgba[i][BCOMP]; - const GLfloat a = rgba[i][ACOMP]; - rgba[i][RCOMP] = (m[0] * r + m[4] * g + m[ 8] * b + m[12] * a) * rs + rb; - rgba[i][GCOMP] = (m[1] * r + m[5] * g + m[ 9] * b + m[13] * a) * gs + gb; - rgba[i][BCOMP] = (m[2] * r + m[6] * g + m[10] * b + m[14] * a) * bs + bb; - rgba[i][ACOMP] = (m[3] * r + m[7] * g + m[11] * b + m[15] * a) * as + ab; - } -} - - -/** - * Apply a color table lookup to an array of floating point RGBA colors. - */ -void -_mesa_lookup_rgba_float(const struct gl_color_table *table, - GLuint n, GLfloat rgba[][4]) -{ - 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 */ - 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 */ - 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 */ - 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 */ - 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 */ - 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 */ - 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: - _mesa_problem(NULL, "Bad format in _mesa_lookup_rgba_float"); - return; - } -} - - - -/** - * Apply a color table lookup to an array of ubyte/RGBA colors. - */ -void -_mesa_lookup_rgba_ubyte(const struct gl_color_table *table, - GLuint n, GLubyte rgba[][4]) -{ - 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->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 { - 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->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 { - 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_ALPHA: - /* replace A with A */ - if (table->Size == 256) { - for (i = 0; i < n; i++) { - rgba[i][ACOMP] = lut[rgba[i][ACOMP]]; - } - } - else { - for (i = 0; i < n; i++) { - GLint j = IROUND((GLfloat) rgba[i][ACOMP] * scale); - rgba[i][ACOMP] = lut[j]; - } - } - 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 { - 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_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 { - 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; - 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; 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; - default: - _mesa_problem(NULL, "Bad format in _mesa_lookup_rgba_chan"); - return; - } -} - - - -/* - * Map color indexes to float rgba values. - */ -void -_mesa_map_ci_to_rgba( const GLcontext *ctx, GLuint n, - const GLuint index[], GLfloat rgba[][4] ) -{ - GLuint rmask = ctx->PixelMaps.ItoR.Size - 1; - GLuint gmask = ctx->PixelMaps.ItoG.Size - 1; - GLuint bmask = ctx->PixelMaps.ItoB.Size - 1; - GLuint amask = ctx->PixelMaps.ItoA.Size - 1; - const GLfloat *rMap = ctx->PixelMaps.ItoR.Map; - const GLfloat *gMap = ctx->PixelMaps.ItoG.Map; - const GLfloat *bMap = ctx->PixelMaps.ItoB.Map; - const GLfloat *aMap = ctx->PixelMaps.ItoA.Map; - GLuint i; - for (i=0;i<n;i++) { - rgba[i][RCOMP] = rMap[index[i] & rmask]; - rgba[i][GCOMP] = gMap[index[i] & gmask]; - rgba[i][BCOMP] = bMap[index[i] & bmask]; - rgba[i][ACOMP] = aMap[index[i] & amask]; - } -} - - -/** - * Map ubyte color indexes to ubyte/RGBA values. - */ -void -_mesa_map_ci8_to_rgba8(const GLcontext *ctx, GLuint n, const GLubyte index[], - GLubyte rgba[][4]) -{ - GLuint rmask = ctx->PixelMaps.ItoR.Size - 1; - GLuint gmask = ctx->PixelMaps.ItoG.Size - 1; - GLuint bmask = ctx->PixelMaps.ItoB.Size - 1; - GLuint amask = ctx->PixelMaps.ItoA.Size - 1; - const GLubyte *rMap = ctx->PixelMaps.ItoR.Map8; - const GLubyte *gMap = ctx->PixelMaps.ItoG.Map8; - const GLubyte *bMap = ctx->PixelMaps.ItoB.Map8; - const GLubyte *aMap = ctx->PixelMaps.ItoA.Map8; - GLuint i; - for (i=0;i<n;i++) { - rgba[i][RCOMP] = rMap[index[i] & rmask]; - rgba[i][GCOMP] = gMap[index[i] & gmask]; - rgba[i][BCOMP] = bMap[index[i] & bmask]; - rgba[i][ACOMP] = aMap[index[i] & amask]; - } -} - - -void -_mesa_scale_and_bias_depth(const GLcontext *ctx, GLuint n, - GLfloat depthValues[]) -{ - const GLfloat scale = ctx->Pixel.DepthScale; - const GLfloat bias = ctx->Pixel.DepthBias; - GLuint i; - for (i = 0; i < n; i++) { - GLfloat d = depthValues[i] * scale + bias; - depthValues[i] = CLAMP(d, 0.0F, 1.0F); - } -} - - - -/**********************************************************************/ /***** State Management *****/ /**********************************************************************/ @@ -1413,6 +818,9 @@ update_image_transfer_state(GLcontext *ctx) } +/** + * Update meas pixel transfer derived state. + */ void _mesa_update_pixel( GLcontext *ctx, GLuint new_state ) { if (new_state & _NEW_COLOR_MATRIX) @@ -1502,54 +910,6 @@ _mesa_init_pixel( GLcontext *ctx ) ASSIGN_4V(ctx->Pixel.TextureColorTableScale, 1.0, 1.0, 1.0, 1.0); ASSIGN_4V(ctx->Pixel.TextureColorTableBias, 0.0, 0.0, 0.0, 0.0); - /* Pixel transfer */ - ctx->Pack.Alignment = 4; - ctx->Pack.RowLength = 0; - ctx->Pack.ImageHeight = 0; - ctx->Pack.SkipPixels = 0; - ctx->Pack.SkipRows = 0; - ctx->Pack.SkipImages = 0; - ctx->Pack.SwapBytes = GL_FALSE; - ctx->Pack.LsbFirst = GL_FALSE; - ctx->Pack.ClientStorage = GL_FALSE; - ctx->Pack.Invert = GL_FALSE; -#if FEATURE_EXT_pixel_buffer_object - ctx->Pack.BufferObj = ctx->Array.NullBufferObj; -#endif - ctx->Unpack.Alignment = 4; - ctx->Unpack.RowLength = 0; - ctx->Unpack.ImageHeight = 0; - ctx->Unpack.SkipPixels = 0; - ctx->Unpack.SkipRows = 0; - ctx->Unpack.SkipImages = 0; - ctx->Unpack.SwapBytes = GL_FALSE; - ctx->Unpack.LsbFirst = GL_FALSE; - ctx->Unpack.ClientStorage = GL_FALSE; - ctx->Unpack.Invert = GL_FALSE; -#if FEATURE_EXT_pixel_buffer_object - ctx->Unpack.BufferObj = ctx->Array.NullBufferObj; -#endif - - /* - * _mesa_unpack_image() returns image data in this format. When we - * execute image commands (glDrawPixels(), glTexImage(), etc) from - * within display lists we have to be sure to set the current - * unpacking parameters to these values! - */ - ctx->DefaultPacking.Alignment = 1; - ctx->DefaultPacking.RowLength = 0; - ctx->DefaultPacking.SkipPixels = 0; - ctx->DefaultPacking.SkipRows = 0; - ctx->DefaultPacking.ImageHeight = 0; - ctx->DefaultPacking.SkipImages = 0; - ctx->DefaultPacking.SwapBytes = GL_FALSE; - ctx->DefaultPacking.LsbFirst = GL_FALSE; - ctx->DefaultPacking.ClientStorage = GL_FALSE; - ctx->DefaultPacking.Invert = GL_FALSE; -#if FEATURE_EXT_pixel_buffer_object - ctx->DefaultPacking.BufferObj = ctx->Array.NullBufferObj; -#endif - if (ctx->Visual.doubleBufferMode) { ctx->Pixel.ReadBuffer = GL_BACK; } diff --git a/src/mesa/main/pixel.h b/src/mesa/main/pixel.h index 09155cfd70..cb6c5262a3 100644 --- a/src/mesa/main/pixel.h +++ b/src/mesa/main/pixel.h @@ -1,13 +1,8 @@ -/** - * \file pixel.h - * Pixel operations. - */ - /* * Mesa 3-D graphics library - * Version: 6.5.2 + * Version: 7.1 * - * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2008 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,6 +23,12 @@ */ +/** + * \file pixel.h + * Pixel operations. + */ + + #ifndef PIXEL_H #define PIXEL_H @@ -57,13 +58,6 @@ extern void GLAPIENTRY _mesa_PixelMapusv(GLenum map, GLsizei mapsize, const GLushort *values ); extern void GLAPIENTRY -_mesa_PixelStoref( GLenum pname, GLfloat param ); - - -extern void GLAPIENTRY -_mesa_PixelStorei( GLenum pname, GLint param ); - -extern void GLAPIENTRY _mesa_PixelTransferf( GLenum pname, GLfloat param ); extern void GLAPIENTRY @@ -75,48 +69,6 @@ _mesa_PixelZoom( GLfloat xfactor, GLfloat yfactor ); /*@}*/ -/** \name Pixel processing functions */ -/*@{*/ - -extern void -_mesa_scale_and_bias_rgba(GLuint n, GLfloat rgba[][4], - GLfloat rScale, GLfloat gScale, - GLfloat bScale, GLfloat aScale, - GLfloat rBias, GLfloat gBias, - GLfloat bBias, GLfloat aBias); - -extern void -_mesa_map_rgba(const GLcontext *ctx, GLuint n, GLfloat rgba[][4]); - - -extern void -_mesa_transform_rgba(const GLcontext *ctx, GLuint n, GLfloat rgba[][4]); - - -extern void -_mesa_lookup_rgba_float(const struct gl_color_table *table, - GLuint n, GLfloat rgba[][4]); - -extern void -_mesa_lookup_rgba_ubyte(const struct gl_color_table *table, - GLuint n, GLubyte rgba[][4]); - - -extern void -_mesa_map_ci_to_rgba(const GLcontext *ctx, - GLuint n, const GLuint index[], GLfloat rgba[][4]); - - -extern void -_mesa_map_ci8_to_rgba8(const GLcontext *ctx, GLuint n, const GLubyte index[], - GLubyte rgba[][4]); - - -extern void -_mesa_scale_and_bias_depth(const GLcontext *ctx, GLuint n, - GLfloat depthValues[]); - - extern void _mesa_update_pixel( GLcontext *ctx, GLuint newstate ); diff --git a/src/mesa/main/pixelstore.c b/src/mesa/main/pixelstore.c new file mode 100644 index 0000000000..ff1a6344cc --- /dev/null +++ b/src/mesa/main/pixelstore.c @@ -0,0 +1,283 @@ +/* + * Mesa 3-D graphics library + * Version: 7.1 + * + * Copyright (C) 1999-2008 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 pixelstore.c + * glPixelStore functions. + */ + + +#include "glheader.h" +#include "bufferobj.h" +#include "colormac.h" +#include "context.h" +#include "image.h" +#include "macros.h" +#include "pixelstore.h" +#include "mtypes.h" + + +void GLAPIENTRY +_mesa_PixelStorei( GLenum pname, GLint param ) +{ + /* NOTE: this call can't be compiled into the display list */ + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END(ctx); + + switch (pname) { + case GL_PACK_SWAP_BYTES: + if (param == (GLint)ctx->Pack.SwapBytes) + return; + FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); + ctx->Pack.SwapBytes = param ? GL_TRUE : GL_FALSE; + break; + case GL_PACK_LSB_FIRST: + if (param == (GLint)ctx->Pack.LsbFirst) + return; + FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); + ctx->Pack.LsbFirst = param ? GL_TRUE : GL_FALSE; + break; + case GL_PACK_ROW_LENGTH: + if (param<0) { + _mesa_error( ctx, GL_INVALID_VALUE, "glPixelStore(param)" ); + return; + } + if (ctx->Pack.RowLength == param) + return; + FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); + ctx->Pack.RowLength = param; + break; + case GL_PACK_IMAGE_HEIGHT: + if (param<0) { + _mesa_error( ctx, GL_INVALID_VALUE, "glPixelStore(param)" ); + return; + } + if (ctx->Pack.ImageHeight == param) + return; + FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); + ctx->Pack.ImageHeight = param; + break; + case GL_PACK_SKIP_PIXELS: + if (param<0) { + _mesa_error( ctx, GL_INVALID_VALUE, "glPixelStore(param)" ); + return; + } + if (ctx->Pack.SkipPixels == param) + return; + FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); + ctx->Pack.SkipPixels = param; + break; + case GL_PACK_SKIP_ROWS: + if (param<0) { + _mesa_error( ctx, GL_INVALID_VALUE, "glPixelStore(param)" ); + return; + } + if (ctx->Pack.SkipRows == param) + return; + FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); + ctx->Pack.SkipRows = param; + break; + case GL_PACK_SKIP_IMAGES: + if (param<0) { + _mesa_error( ctx, GL_INVALID_VALUE, "glPixelStore(param)" ); + return; + } + if (ctx->Pack.SkipImages == param) + return; + FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); + ctx->Pack.SkipImages = param; + break; + case GL_PACK_ALIGNMENT: + if (param!=1 && param!=2 && param!=4 && param!=8) { + _mesa_error( ctx, GL_INVALID_VALUE, "glPixelStore(param)" ); + return; + } + if (ctx->Pack.Alignment == param) + return; + FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); + ctx->Pack.Alignment = param; + break; + case GL_PACK_INVERT_MESA: + if (!ctx->Extensions.MESA_pack_invert) { + _mesa_error( ctx, GL_INVALID_ENUM, "glPixelstore(pname)" ); + return; + } + if (ctx->Pack.Invert == param) + return; + FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); + ctx->Pack.Invert = param; + break; + + case GL_UNPACK_SWAP_BYTES: + if (param == (GLint)ctx->Unpack.SwapBytes) + return; + if ((GLint)ctx->Unpack.SwapBytes == param) + return; + FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); + ctx->Unpack.SwapBytes = param ? GL_TRUE : GL_FALSE; + break; + case GL_UNPACK_LSB_FIRST: + if (param == (GLint)ctx->Unpack.LsbFirst) + return; + if ((GLint)ctx->Unpack.LsbFirst == param) + return; + FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); + ctx->Unpack.LsbFirst = param ? GL_TRUE : GL_FALSE; + break; + case GL_UNPACK_ROW_LENGTH: + if (param<0) { + _mesa_error( ctx, GL_INVALID_VALUE, "glPixelStore(param)" ); + return; + } + if (ctx->Unpack.RowLength == param) + return; + FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); + ctx->Unpack.RowLength = param; + break; + case GL_UNPACK_IMAGE_HEIGHT: + if (param<0) { + _mesa_error( ctx, GL_INVALID_VALUE, "glPixelStore(param)" ); + return; + } + if (ctx->Unpack.ImageHeight == param) + return; + + FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); + ctx->Unpack.ImageHeight = param; + break; + case GL_UNPACK_SKIP_PIXELS: + if (param<0) { + _mesa_error( ctx, GL_INVALID_VALUE, "glPixelStore(param)" ); + return; + } + if (ctx->Unpack.SkipPixels == param) + return; + FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); + ctx->Unpack.SkipPixels = param; + break; + case GL_UNPACK_SKIP_ROWS: + if (param<0) { + _mesa_error( ctx, GL_INVALID_VALUE, "glPixelStore(param)" ); + return; + } + if (ctx->Unpack.SkipRows == param) + return; + FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); + ctx->Unpack.SkipRows = param; + break; + case GL_UNPACK_SKIP_IMAGES: + if (param < 0) { + _mesa_error( ctx, GL_INVALID_VALUE, "glPixelStore(param)" ); + return; + } + if (ctx->Unpack.SkipImages == param) + return; + FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); + ctx->Unpack.SkipImages = param; + break; + case GL_UNPACK_ALIGNMENT: + if (param!=1 && param!=2 && param!=4 && param!=8) { + _mesa_error( ctx, GL_INVALID_VALUE, "glPixelStore" ); + return; + } + if (ctx->Unpack.Alignment == param) + return; + FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); + ctx->Unpack.Alignment = param; + break; + case GL_UNPACK_CLIENT_STORAGE_APPLE: + if (param == (GLint)ctx->Unpack.ClientStorage) + return; + FLUSH_VERTICES(ctx, _NEW_PACKUNPACK); + ctx->Unpack.ClientStorage = param ? GL_TRUE : GL_FALSE; + break; + default: + _mesa_error( ctx, GL_INVALID_ENUM, "glPixelStore" ); + return; + } +} + + +void GLAPIENTRY +_mesa_PixelStoref( GLenum pname, GLfloat param ) +{ + _mesa_PixelStorei( pname, (GLint) param ); +} + + + +/** + * Initialize the context's pixel store state. + */ +void +_mesa_init_pixelstore( GLcontext *ctx ) +{ + /* Pixel transfer */ + ctx->Pack.Alignment = 4; + ctx->Pack.RowLength = 0; + ctx->Pack.ImageHeight = 0; + ctx->Pack.SkipPixels = 0; + ctx->Pack.SkipRows = 0; + ctx->Pack.SkipImages = 0; + ctx->Pack.SwapBytes = GL_FALSE; + ctx->Pack.LsbFirst = GL_FALSE; + ctx->Pack.ClientStorage = GL_FALSE; + ctx->Pack.Invert = GL_FALSE; +#if FEATURE_EXT_pixel_buffer_object + ctx->Pack.BufferObj = ctx->Array.NullBufferObj; +#endif + ctx->Unpack.Alignment = 4; + ctx->Unpack.RowLength = 0; + ctx->Unpack.ImageHeight = 0; + ctx->Unpack.SkipPixels = 0; + ctx->Unpack.SkipRows = 0; + ctx->Unpack.SkipImages = 0; + ctx->Unpack.SwapBytes = GL_FALSE; + ctx->Unpack.LsbFirst = GL_FALSE; + ctx->Unpack.ClientStorage = GL_FALSE; + ctx->Unpack.Invert = GL_FALSE; +#if FEATURE_EXT_pixel_buffer_object + ctx->Unpack.BufferObj = ctx->Array.NullBufferObj; +#endif + + /* + * _mesa_unpack_image() returns image data in this format. When we + * execute image commands (glDrawPixels(), glTexImage(), etc) from + * within display lists we have to be sure to set the current + * unpacking parameters to these values! + */ + ctx->DefaultPacking.Alignment = 1; + ctx->DefaultPacking.RowLength = 0; + ctx->DefaultPacking.SkipPixels = 0; + ctx->DefaultPacking.SkipRows = 0; + ctx->DefaultPacking.ImageHeight = 0; + ctx->DefaultPacking.SkipImages = 0; + ctx->DefaultPacking.SwapBytes = GL_FALSE; + ctx->DefaultPacking.LsbFirst = GL_FALSE; + ctx->DefaultPacking.ClientStorage = GL_FALSE; + ctx->DefaultPacking.Invert = GL_FALSE; +#if FEATURE_EXT_pixel_buffer_object + ctx->DefaultPacking.BufferObj = ctx->Array.NullBufferObj; +#endif +} diff --git a/src/mesa/main/pixelstore.h b/src/mesa/main/pixelstore.h new file mode 100644 index 0000000000..ee963f9ba3 --- /dev/null +++ b/src/mesa/main/pixelstore.h @@ -0,0 +1,50 @@ +/* + * Mesa 3-D graphics library + * Version: 7.1 + * + * Copyright (C) 1999-2008 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 pixelstore.h + * glPixelStore functions. + */ + + +#ifndef PIXELSTORE_H +#define PIXELSTORE_H + + +#include "glheader.h" + + +extern void GLAPIENTRY +_mesa_PixelStorei( GLenum pname, GLint param ); + + +extern void GLAPIENTRY +_mesa_PixelStoref( GLenum pname, GLfloat param ); + + +extern void +_mesa_init_pixelstore( GLcontext *ctx ); + + +#endif diff --git a/src/mesa/main/points.c b/src/mesa/main/points.c index 1458c90ab9..7e189a0a8c 100644 --- a/src/mesa/main/points.c +++ b/src/mesa/main/points.c @@ -65,22 +65,17 @@ _mesa_PointSize( GLfloat size ) #if _HAVE_FULL_GL -/* - * Added by GL_NV_point_sprite - */ + void GLAPIENTRY -_mesa_PointParameteriNV( GLenum pname, GLint param ) +_mesa_PointParameteri( GLenum pname, GLint param ) { const GLfloat value = (GLfloat) param; - _mesa_PointParameterfvEXT(pname, &value); + _mesa_PointParameterfv(pname, &value); } -/* - * Added by GL_NV_point_sprite - */ void GLAPIENTRY -_mesa_PointParameterivNV( GLenum pname, const GLint *params ) +_mesa_PointParameteriv( GLenum pname, const GLint *params ) { GLfloat p[3]; p[0] = (GLfloat) params[0]; @@ -88,27 +83,19 @@ _mesa_PointParameterivNV( GLenum pname, const GLint *params ) p[1] = (GLfloat) params[1]; p[2] = (GLfloat) params[2]; } - _mesa_PointParameterfvEXT(pname, p); + _mesa_PointParameterfv(pname, p); } - -/* - * Same for both GL_EXT_point_parameters and GL_ARB_point_parameters. - */ void GLAPIENTRY -_mesa_PointParameterfEXT( GLenum pname, GLfloat param) +_mesa_PointParameterf( GLenum pname, GLfloat param) { - _mesa_PointParameterfvEXT(pname, ¶m); + _mesa_PointParameterfv(pname, ¶m); } - -/* - * Same for both GL_EXT_point_parameters and GL_ARB_point_parameters. - */ void GLAPIENTRY -_mesa_PointParameterfvEXT( GLenum pname, const GLfloat *params) +_mesa_PointParameterfv( GLenum pname, const GLfloat *params) { GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); diff --git a/src/mesa/main/points.h b/src/mesa/main/points.h index 951ff677db..156641eab9 100644 --- a/src/mesa/main/points.h +++ b/src/mesa/main/points.h @@ -39,16 +39,16 @@ extern void GLAPIENTRY _mesa_PointSize( GLfloat size ); extern void GLAPIENTRY -_mesa_PointParameteriNV( GLenum pname, GLint param ); +_mesa_PointParameteri( GLenum pname, GLint param ); extern void GLAPIENTRY -_mesa_PointParameterivNV( GLenum pname, const GLint *params ); +_mesa_PointParameteriv( GLenum pname, const GLint *params ); extern void GLAPIENTRY -_mesa_PointParameterfEXT( GLenum pname, GLfloat param ); +_mesa_PointParameterf( GLenum pname, GLfloat param ); extern void GLAPIENTRY -_mesa_PointParameterfvEXT( GLenum pname, const GLfloat *params ); +_mesa_PointParameterfv( GLenum pname, const GLfloat *params ); extern void _mesa_init_point( GLcontext * ctx ); diff --git a/src/mesa/main/queryobj.c b/src/mesa/main/queryobj.c index 0e59ba615a..a1e32e70ba 100644 --- a/src/mesa/main/queryobj.c +++ b/src/mesa/main/queryobj.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.5.1 + * Version: 7.1 * - * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2007 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,14 +54,50 @@ _mesa_new_query_object(GLcontext *ctx, GLuint id) /** + * Begin a query. Software driver fallback. + * Called via ctx->Driver.BeginQuery(). + */ +void +_mesa_begin_query(GLcontext *ctx, struct gl_query_object *q) +{ + /* no-op */ +} + + +/** + * End a query. Software driver fallback. + * Called via ctx->Driver.EndQuery(). + */ +void +_mesa_end_query(GLcontext *ctx, struct gl_query_object *q) +{ + q->Ready = GL_TRUE; +} + + +/** + * Wait for query to complete. Software driver fallback. + * Called via ctx->Driver.WaitQuery(). + */ +void +_mesa_wait_query(GLcontext *ctx, struct gl_query_object *q) +{ + /* For software drivers, _mesa_end_query() should have completed the query. + * For real hardware, implement a proper WaitQuery() driver function. + */ + assert(q->Ready); +} + + +/** * Delete an occlusion query object. * Not removed from hash table here. * XXX maybe add Delete() method to gl_query_object class and call that instead */ -static void -delete_query_object(struct gl_query_object *q) +void +_mesa_delete_query(struct gl_query_object *q) { - FREE(q); + _mesa_free(q); } @@ -135,7 +171,7 @@ _mesa_DeleteQueriesARB(GLsizei n, const GLuint *ids) if (q) { ASSERT(!q->Active); /* should be caught earlier */ _mesa_HashRemove(ctx->Query.QueryObjects, ids[i]); - delete_query_object(q); + ctx->Driver.DeleteQuery(ctx, q); } } } @@ -216,6 +252,7 @@ _mesa_BeginQueryARB(GLenum target, GLuint id) } } + q->Target = target; q->Active = GL_TRUE; q->Result = 0; q->Ready = GL_FALSE; @@ -229,9 +266,7 @@ _mesa_BeginQueryARB(GLenum target, GLuint id) } #endif - if (ctx->Driver.BeginQuery) { - ctx->Driver.BeginQuery(ctx, target, q); - } + ctx->Driver.BeginQuery(ctx, q); } @@ -275,13 +310,7 @@ _mesa_EndQueryARB(GLenum target) } q->Active = GL_FALSE; - if (ctx->Driver.EndQuery) { - ctx->Driver.EndQuery(ctx, target, q); - } - else { - /* if we're using software rendering/querying */ - q->Ready = GL_TRUE; - } + ctx->Driver.EndQuery(ctx, q); } @@ -346,23 +375,19 @@ _mesa_GetQueryObjectivARB(GLuint id, GLenum pname, GLint *params) switch (pname) { case GL_QUERY_RESULT_ARB: - while (!q->Ready) { - /* Wait for the query to finish! */ - /* If using software rendering, the result will always be ready - * by time we get here. Otherwise, we must be using hardware! - */ - ASSERT(ctx->Driver.EndQuery); - } + if (!q->Ready) + ctx->Driver.WaitQuery(ctx, q); /* if result is too large for returned type, clamp to max value */ if (q->Result > 0x7fffffff) { *params = 0x7fffffff; } else { - *params = q->Result; + *params = (GLint)q->Result; } break; case GL_QUERY_RESULT_AVAILABLE_ARB: - /* XXX revisit when we have a hardware implementation! */ + if (!q->Ready) + ctx->Driver.CheckQuery( ctx, q ); *params = q->Ready; break; default: @@ -390,23 +415,19 @@ _mesa_GetQueryObjectuivARB(GLuint id, GLenum pname, GLuint *params) switch (pname) { case GL_QUERY_RESULT_ARB: - while (!q->Ready) { - /* Wait for the query to finish! */ - /* If using software rendering, the result will always be ready - * by time we get here. Otherwise, we must be using hardware! - */ - ASSERT(ctx->Driver.EndQuery); - } + if (!q->Ready) + ctx->Driver.WaitQuery(ctx, q); /* if result is too large for returned type, clamp to max value */ if (q->Result > 0xffffffff) { *params = 0xffffffff; } else { - *params = q->Result; + *params = (GLuint)q->Result; } break; case GL_QUERY_RESULT_AVAILABLE_ARB: - /* XXX revisit when we have a hardware implementation! */ + if (!q->Ready) + ctx->Driver.CheckQuery( ctx, q ); *params = q->Ready; break; default: @@ -439,17 +460,13 @@ _mesa_GetQueryObjecti64vEXT(GLuint id, GLenum pname, GLint64EXT *params) switch (pname) { case GL_QUERY_RESULT_ARB: - while (!q->Ready) { - /* Wait for the query to finish! */ - /* If using software rendering, the result will always be ready - * by time we get here. Otherwise, we must be using hardware! - */ - ASSERT(ctx->Driver.EndQuery); - } + if (!q->Ready) + ctx->Driver.WaitQuery(ctx, q); *params = q->Result; break; case GL_QUERY_RESULT_AVAILABLE_ARB: - /* XXX revisit when we have a hardware implementation! */ + if (!q->Ready) + ctx->Driver.CheckQuery( ctx, q ); *params = q->Ready; break; default: @@ -480,17 +497,13 @@ _mesa_GetQueryObjectui64vEXT(GLuint id, GLenum pname, GLuint64EXT *params) switch (pname) { case GL_QUERY_RESULT_ARB: - while (!q->Ready) { - /* Wait for the query to finish! */ - /* If using software rendering, the result will always be ready - * by time we get here. Otherwise, we must be using hardware! - */ - ASSERT(ctx->Driver.EndQuery); - } + if (!q->Ready) + ctx->Driver.WaitQuery(ctx, q); *params = q->Result; break; case GL_QUERY_RESULT_AVAILABLE_ARB: - /* XXX revisit when we have a hardware implementation! */ + if (!q->Ready) + ctx->Driver.CheckQuery( ctx, q ); *params = q->Ready; break; default: @@ -522,8 +535,8 @@ static void delete_queryobj_cb(GLuint id, void *data, void *userData) { struct gl_query_object *q= (struct gl_query_object *) data; - (void) userData; - delete_query_object(q); + GLcontext *ctx = (GLcontext *)userData; + ctx->Driver.DeleteQuery(ctx, q); } diff --git a/src/mesa/main/queryobj.h b/src/mesa/main/queryobj.h index ada8cf8356..c05a1f3da8 100644 --- a/src/mesa/main/queryobj.h +++ b/src/mesa/main/queryobj.h @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.5 + * Version: 7.1 * - * Copyright (C) 1999-2005 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2007 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"), @@ -36,6 +36,19 @@ _mesa_init_query(GLcontext *ctx); extern void _mesa_free_query_data(GLcontext *ctx); +extern void +_mesa_delete_query(struct gl_query_object *q); + +extern void +_mesa_begin_query(GLcontext *ctx, struct gl_query_object *q); + +extern void +_mesa_end_query(GLcontext *ctx, struct gl_query_object *q); + +extern void +_mesa_wait_query(GLcontext *ctx, struct gl_query_object *q); + + extern void GLAPIENTRY _mesa_GenQueriesARB(GLsizei n, GLuint *ids); diff --git a/src/mesa/main/rastpos.c b/src/mesa/main/rastpos.c index 2d71014a18..155140f3cc 100644 --- a/src/mesa/main/rastpos.c +++ b/src/mesa/main/rastpos.c @@ -29,674 +29,181 @@ */ #include "glheader.h" -#include "colormac.h" #include "context.h" #include "feedback.h" -#include "light.h" #include "macros.h" #include "rastpos.h" #include "state.h" -#include "simple_list.h" -#include "mtypes.h" - -#include "math/m_matrix.h" - - -/** - * Clip a point against the view volume. - * - * \param v vertex vector describing the point to clip. - * - * \return zero if outside view volume, or one if inside. - */ -static GLuint -viewclip_point( const GLfloat v[] ) -{ - if ( v[0] > v[3] || v[0] < -v[3] - || v[1] > v[3] || v[1] < -v[3] - || v[2] > v[3] || v[2] < -v[3] ) { - return 0; - } - else { - return 1; - } -} - - -/** - * Clip a point against the far/near Z clipping planes. - * - * \param v vertex vector describing the point to clip. - * - * \return zero if outside view volume, or one if inside. - */ -static GLuint -viewclip_point_z( const GLfloat v[] ) -{ - if (v[2] > v[3] || v[2] < -v[3] ) { - return 0; - } - else { - return 1; - } -} - - -/** - * Clip a point against the user clipping planes. - * - * \param ctx GL context. - * \param v vertex vector describing the point to clip. - * - * \return zero if the point was clipped, or one otherwise. - */ -static GLuint -userclip_point( GLcontext *ctx, const GLfloat v[] ) -{ - GLuint p; - - for (p = 0; p < ctx->Const.MaxClipPlanes; p++) { - if (ctx->Transform.ClipPlanesEnabled & (1 << p)) { - GLfloat dot = v[0] * ctx->Transform._ClipUserPlane[p][0] - + v[1] * ctx->Transform._ClipUserPlane[p][1] - + v[2] * ctx->Transform._ClipUserPlane[p][2] - + v[3] * ctx->Transform._ClipUserPlane[p][3]; - if (dot < 0.0F) { - return 0; - } - } - } - - return 1; -} /** - * Compute lighting for the raster position. Both RGB and CI modes computed. - * \param ctx the context - * \param vertex vertex location - * \param normal normal vector - * \param Rcolor returned color - * \param Rspec returned specular color (if separate specular enabled) - * \param Rindex returned color index + * Helper function for all the RasterPos functions. */ static void -shade_rastpos(GLcontext *ctx, - const GLfloat vertex[4], - const GLfloat normal[3], - GLfloat Rcolor[4], - GLfloat Rspec[4], - GLfloat *Rindex) -{ - /*const*/ GLfloat (*base)[3] = ctx->Light._BaseColor; - const struct gl_light *light; - GLfloat diffuseColor[4], specularColor[4]; /* for RGB mode only */ - GLfloat diffuseCI = 0.0, specularCI = 0.0; /* for CI mode only */ - - _mesa_validate_all_lighting_tables( ctx ); - - COPY_3V(diffuseColor, base[0]); - diffuseColor[3] = CLAMP( - ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_DIFFUSE][3], 0.0F, 1.0F ); - ASSIGN_4V(specularColor, 0.0, 0.0, 0.0, 1.0); - - foreach (light, &ctx->Light.EnabledList) { - GLfloat attenuation = 1.0; - GLfloat VP[3]; /* vector from vertex to light pos */ - GLfloat n_dot_VP; - GLfloat diffuseContrib[3], specularContrib[3]; - - if (!(light->_Flags & LIGHT_POSITIONAL)) { - /* light at infinity */ - COPY_3V(VP, light->_VP_inf_norm); - attenuation = light->_VP_inf_spot_attenuation; - } - else { - /* local/positional light */ - GLfloat d; - - /* VP = vector from vertex pos to light[i].pos */ - SUB_3V(VP, light->_Position, vertex); - /* d = length(VP) */ - d = (GLfloat) LEN_3FV( VP ); - if (d > 1.0e-6) { - /* normalize VP */ - GLfloat invd = 1.0F / d; - SELF_SCALE_SCALAR_3V(VP, invd); - } - - /* atti */ - attenuation = 1.0F / (light->ConstantAttenuation + d * - (light->LinearAttenuation + d * - light->QuadraticAttenuation)); - - if (light->_Flags & LIGHT_SPOT) { - GLfloat PV_dot_dir = - DOT3(VP, light->_NormDirection); - - if (PV_dot_dir<light->_CosCutoff) { - continue; - } - else { - double x = PV_dot_dir * (EXP_TABLE_SIZE-1); - int k = (int) x; - GLfloat spot = (GLfloat) (light->_SpotExpTable[k][0] - + (x-k)*light->_SpotExpTable[k][1]); - attenuation *= spot; - } - } - } - - if (attenuation < 1e-3) - continue; - - n_dot_VP = DOT3( normal, VP ); - - if (n_dot_VP < 0.0F) { - ACC_SCALE_SCALAR_3V(diffuseColor, attenuation, light->_MatAmbient[0]); - continue; - } - - /* Ambient + diffuse */ - COPY_3V(diffuseContrib, light->_MatAmbient[0]); - ACC_SCALE_SCALAR_3V(diffuseContrib, n_dot_VP, light->_MatDiffuse[0]); - diffuseCI += n_dot_VP * light->_dli * attenuation; - - /* Specular */ - { - const GLfloat *h; - GLfloat n_dot_h; - - ASSIGN_3V(specularContrib, 0.0, 0.0, 0.0); - - if (ctx->Light.Model.LocalViewer) { - GLfloat v[3]; - COPY_3V(v, vertex); - NORMALIZE_3FV(v); - SUB_3V(VP, VP, v); - NORMALIZE_3FV(VP); - h = VP; - } - else if (light->_Flags & LIGHT_POSITIONAL) { - ACC_3V(VP, ctx->_EyeZDir); - NORMALIZE_3FV(VP); - h = VP; - } - else { - h = light->_h_inf_norm; - } - - n_dot_h = DOT3(normal, h); - - if (n_dot_h > 0.0F) { - GLfloat spec_coef; - GET_SHINE_TAB_ENTRY( ctx->_ShineTable[0], n_dot_h, spec_coef ); - - if (spec_coef > 1.0e-10) { - if (ctx->Light.Model.ColorControl==GL_SEPARATE_SPECULAR_COLOR) { - ACC_SCALE_SCALAR_3V( specularContrib, spec_coef, - light->_MatSpecular[0]); - } - else { - ACC_SCALE_SCALAR_3V( diffuseContrib, spec_coef, - light->_MatSpecular[0]); - } - /*assert(light->_sli > 0.0);*/ - specularCI += spec_coef * light->_sli * attenuation; - } - } - } - - ACC_SCALE_SCALAR_3V( diffuseColor, attenuation, diffuseContrib ); - ACC_SCALE_SCALAR_3V( specularColor, attenuation, specularContrib ); - } - - if (ctx->Visual.rgbMode) { - Rcolor[0] = CLAMP(diffuseColor[0], 0.0F, 1.0F); - Rcolor[1] = CLAMP(diffuseColor[1], 0.0F, 1.0F); - Rcolor[2] = CLAMP(diffuseColor[2], 0.0F, 1.0F); - Rcolor[3] = CLAMP(diffuseColor[3], 0.0F, 1.0F); - Rspec[0] = CLAMP(specularColor[0], 0.0F, 1.0F); - Rspec[1] = CLAMP(specularColor[1], 0.0F, 1.0F); - Rspec[2] = CLAMP(specularColor[2], 0.0F, 1.0F); - Rspec[3] = CLAMP(specularColor[3], 0.0F, 1.0F); - } - else { - GLfloat *ind = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_INDEXES]; - GLfloat d_a = ind[MAT_INDEX_DIFFUSE] - ind[MAT_INDEX_AMBIENT]; - GLfloat s_a = ind[MAT_INDEX_SPECULAR] - ind[MAT_INDEX_AMBIENT]; - GLfloat i = (ind[MAT_INDEX_AMBIENT] - + diffuseCI * (1.0F-specularCI) * d_a - + specularCI * s_a); - if (i > ind[MAT_INDEX_SPECULAR]) { - i = ind[MAT_INDEX_SPECULAR]; - } - *Rindex = i; - } -} - - -/** - * Do texgen needed for glRasterPos. - * \param ctx rendering context - * \param vObj object-space vertex coordinate - * \param vEye eye-space vertex coordinate - * \param normal vertex normal - * \param unit texture unit number - * \param texcoord incoming texcoord and resulting texcoord - */ -static void -compute_texgen(GLcontext *ctx, const GLfloat vObj[4], const GLfloat vEye[4], - const GLfloat normal[3], GLuint unit, GLfloat texcoord[4]) -{ - const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; - - /* always compute sphere map terms, just in case */ - GLfloat u[3], two_nu, rx, ry, rz, m, mInv; - COPY_3V(u, vEye); - NORMALIZE_3FV(u); - two_nu = 2.0F * DOT3(normal, u); - rx = u[0] - normal[0] * two_nu; - ry = u[1] - normal[1] * two_nu; - rz = u[2] - normal[2] * two_nu; - m = rx * rx + ry * ry + (rz + 1.0F) * (rz + 1.0F); - if (m > 0.0F) - mInv = 0.5F * _mesa_inv_sqrtf(m); - else - mInv = 0.0F; - - if (texUnit->TexGenEnabled & S_BIT) { - switch (texUnit->GenModeS) { - case GL_OBJECT_LINEAR: - texcoord[0] = DOT4(vObj, texUnit->ObjectPlaneS); - break; - case GL_EYE_LINEAR: - texcoord[0] = DOT4(vEye, texUnit->EyePlaneS); - break; - case GL_SPHERE_MAP: - texcoord[0] = rx * mInv + 0.5F; - break; - case GL_REFLECTION_MAP: - texcoord[0] = rx; - break; - case GL_NORMAL_MAP: - texcoord[0] = normal[0]; - break; - default: - _mesa_problem(ctx, "Bad S texgen in compute_texgen()"); - return; - } - } - - if (texUnit->TexGenEnabled & T_BIT) { - switch (texUnit->GenModeT) { - case GL_OBJECT_LINEAR: - texcoord[1] = DOT4(vObj, texUnit->ObjectPlaneT); - break; - case GL_EYE_LINEAR: - texcoord[1] = DOT4(vEye, texUnit->EyePlaneT); - break; - case GL_SPHERE_MAP: - texcoord[1] = ry * mInv + 0.5F; - break; - case GL_REFLECTION_MAP: - texcoord[1] = ry; - break; - case GL_NORMAL_MAP: - texcoord[1] = normal[1]; - break; - default: - _mesa_problem(ctx, "Bad T texgen in compute_texgen()"); - return; - } - } - - if (texUnit->TexGenEnabled & R_BIT) { - switch (texUnit->GenModeR) { - case GL_OBJECT_LINEAR: - texcoord[2] = DOT4(vObj, texUnit->ObjectPlaneR); - break; - case GL_EYE_LINEAR: - texcoord[2] = DOT4(vEye, texUnit->EyePlaneR); - break; - case GL_REFLECTION_MAP: - texcoord[2] = rz; - break; - case GL_NORMAL_MAP: - texcoord[2] = normal[2]; - break; - default: - _mesa_problem(ctx, "Bad R texgen in compute_texgen()"); - return; - } - } - - if (texUnit->TexGenEnabled & Q_BIT) { - switch (texUnit->GenModeQ) { - case GL_OBJECT_LINEAR: - texcoord[3] = DOT4(vObj, texUnit->ObjectPlaneQ); - break; - case GL_EYE_LINEAR: - texcoord[3] = DOT4(vEye, texUnit->EyePlaneQ); - break; - default: - _mesa_problem(ctx, "Bad Q texgen in compute_texgen()"); - return; - } - } -} - - - -/** - * Set the raster position for pixel operations. - * - * All glRasterPos command call this function to update the current - * raster position. - * - * \param ctx GL context. - * \param x x coordinate for the raster position. - * \param y y coordinate for the raster position. - * \param z z coordinate for the raster position. - * \param w w coordinate for the raster position. - * - * \sa Called by _mesa_RasterPos4f(). - * - * Flushes the vertices, transforms and clips the vertex coordinates, and - * finally sets the current raster position and associated data in - * __GLcontextRec::Current. When in selection mode calls - * _mesa_update_hitflag() with the current raster position. - */ -static void -raster_pos4f(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z, GLfloat w) +rasterpos(GLfloat x, GLfloat y, GLfloat z, GLfloat w) { - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - FLUSH_CURRENT(ctx, 0); + GET_CURRENT_CONTEXT(ctx); + GLfloat p[4]; + + p[0] = x; + p[1] = y; + p[2] = z; + p[3] = w; if (ctx->NewState) _mesa_update_state( ctx ); - if (ctx->VertexProgram._Enabled) { - /* XXX implement this */ - _mesa_problem(ctx, "Vertex programs not implemented for glRasterPos"); - return; - } - else { - GLfloat obj[4], eye[4], clip[4], ndc[3], d; - GLfloat *norm, eyenorm[3]; - GLfloat *objnorm = ctx->Current.Attrib[VERT_ATTRIB_NORMAL]; - - ASSIGN_4V( obj, x, y, z, w ); - /* apply modelview matrix: eye = MV * obj */ - TRANSFORM_POINT( eye, ctx->ModelviewMatrixStack.Top->m, obj ); - /* apply projection matrix: clip = Proj * eye */ - TRANSFORM_POINT( clip, ctx->ProjectionMatrixStack.Top->m, eye ); - - /* clip to view volume */ - if (ctx->Transform.RasterPositionUnclipped) { - /* GL_IBM_rasterpos_clip: only clip against Z */ - if (viewclip_point_z(clip) == 0) { - ctx->Current.RasterPosValid = GL_FALSE; - return; - } - } - else if (viewclip_point(clip) == 0) { - /* Normal OpenGL behaviour */ - ctx->Current.RasterPosValid = GL_FALSE; - return; - } - - /* clip to user clipping planes */ - if (ctx->Transform.ClipPlanesEnabled && !userclip_point(ctx, clip)) { - ctx->Current.RasterPosValid = GL_FALSE; - return; - } - - /* ndc = clip / W */ - d = (clip[3] == 0.0F) ? 1.0F : 1.0F / clip[3]; - ndc[0] = clip[0] * d; - ndc[1] = clip[1] * d; - ndc[2] = clip[2] * d; - /* wincoord = viewport_mapping(ndc) */ - ctx->Current.RasterPos[0] = (ndc[0] * ctx->Viewport._WindowMap.m[MAT_SX] - + ctx->Viewport._WindowMap.m[MAT_TX]); - ctx->Current.RasterPos[1] = (ndc[1] * ctx->Viewport._WindowMap.m[MAT_SY] - + ctx->Viewport._WindowMap.m[MAT_TY]); - ctx->Current.RasterPos[2] = (ndc[2] * ctx->Viewport._WindowMap.m[MAT_SZ] - + ctx->Viewport._WindowMap.m[MAT_TZ]) - / ctx->DrawBuffer->_DepthMaxF; - ctx->Current.RasterPos[3] = clip[3]; - - /* compute raster distance */ - if (ctx->Fog.FogCoordinateSource == GL_FOG_COORDINATE_EXT) - ctx->Current.RasterDistance = ctx->Current.Attrib[VERT_ATTRIB_FOG][0]; - else - ctx->Current.RasterDistance = - SQRTF( eye[0]*eye[0] + eye[1]*eye[1] + eye[2]*eye[2] ); - - /* compute transformed normal vector (for lighting or texgen) */ - if (ctx->_NeedEyeCoords) { - const GLfloat *inv = ctx->ModelviewMatrixStack.Top->inv; - TRANSFORM_NORMAL( eyenorm, objnorm, inv ); - norm = eyenorm; - } - else { - norm = objnorm; - } - - /* update raster color */ - if (ctx->Light.Enabled) { - /* lighting */ - shade_rastpos( ctx, obj, norm, - ctx->Current.RasterColor, - ctx->Current.RasterSecondaryColor, - &ctx->Current.RasterIndex ); - } - else { - /* use current color or index */ - if (ctx->Visual.rgbMode) { - COPY_4FV(ctx->Current.RasterColor, - ctx->Current.Attrib[VERT_ATTRIB_COLOR0]); - COPY_4FV(ctx->Current.RasterSecondaryColor, - ctx->Current.Attrib[VERT_ATTRIB_COLOR1]); - } - else { - ctx->Current.RasterIndex - = ctx->Current.Attrib[VERT_ATTRIB_COLOR_INDEX][0]; - } - } - - /* texture coords */ - { - GLuint u; - for (u = 0; u < ctx->Const.MaxTextureCoordUnits; u++) { - GLfloat tc[4]; - COPY_4V(tc, ctx->Current.Attrib[VERT_ATTRIB_TEX0 + u]); - if (ctx->Texture.Unit[u].TexGenEnabled) { - compute_texgen(ctx, obj, eye, norm, u, tc); - } - TRANSFORM_POINT(ctx->Current.RasterTexCoords[u], - ctx->TextureMatrixStack[u].Top->m, tc); - } - } - - ctx->Current.RasterPosValid = GL_TRUE; - } + ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); + FLUSH_CURRENT(ctx, 0); - if (ctx->RenderMode == GL_SELECT) { - _mesa_update_hitflag( ctx, ctx->Current.RasterPos[2] ); - } + ctx->Driver.RasterPos(ctx, p); } -/** Calls _mesa_RasterPos4f() */ void GLAPIENTRY _mesa_RasterPos2d(GLdouble x, GLdouble y) { - _mesa_RasterPos4f((GLfloat) x, (GLfloat) y, 0.0F, 1.0F); + rasterpos((GLfloat)x, (GLfloat)y, (GLfloat)0.0, (GLfloat)1.0); } -/** Calls _mesa_RasterPos4f() */ void GLAPIENTRY _mesa_RasterPos2f(GLfloat x, GLfloat y) { - _mesa_RasterPos4f(x, y, 0.0F, 1.0F); + rasterpos(x, y, 0.0F, 1.0F); } -/** Calls _mesa_RasterPos4f() */ void GLAPIENTRY _mesa_RasterPos2i(GLint x, GLint y) { - _mesa_RasterPos4f((GLfloat) x, (GLfloat) y, 0.0F, 1.0F); + rasterpos((GLfloat) x, (GLfloat) y, 0.0F, 1.0F); } -/** Calls _mesa_RasterPos4f() */ void GLAPIENTRY _mesa_RasterPos2s(GLshort x, GLshort y) { - _mesa_RasterPos4f(x, y, 0.0F, 1.0F); + rasterpos(x, y, 0.0F, 1.0F); } -/** Calls _mesa_RasterPos4f() */ void GLAPIENTRY _mesa_RasterPos3d(GLdouble x, GLdouble y, GLdouble z) { - _mesa_RasterPos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F); + rasterpos((GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F); } -/** Calls _mesa_RasterPos4f() */ void GLAPIENTRY _mesa_RasterPos3f(GLfloat x, GLfloat y, GLfloat z) { - _mesa_RasterPos4f(x, y, z, 1.0F); + rasterpos(x, y, z, 1.0F); } -/** Calls _mesa_RasterPos4f() */ void GLAPIENTRY _mesa_RasterPos3i(GLint x, GLint y, GLint z) { - _mesa_RasterPos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F); + rasterpos((GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F); } -/** Calls _mesa_RasterPos4f() */ void GLAPIENTRY _mesa_RasterPos3s(GLshort x, GLshort y, GLshort z) { - _mesa_RasterPos4f(x, y, z, 1.0F); + rasterpos(x, y, z, 1.0F); } -/** Calls _mesa_RasterPos4f() */ void GLAPIENTRY _mesa_RasterPos4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w) { - _mesa_RasterPos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w); + rasterpos((GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w); } -/** Calls raster_pos4f() */ void GLAPIENTRY _mesa_RasterPos4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w) { - GET_CURRENT_CONTEXT(ctx); - raster_pos4f(ctx, x, y, z, w); + rasterpos(x, y, z, w); } -/** Calls _mesa_RasterPos4f() */ void GLAPIENTRY _mesa_RasterPos4i(GLint x, GLint y, GLint z, GLint w) { - _mesa_RasterPos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w); + rasterpos((GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w); } -/** Calls _mesa_RasterPos4f() */ void GLAPIENTRY _mesa_RasterPos4s(GLshort x, GLshort y, GLshort z, GLshort w) { - _mesa_RasterPos4f(x, y, z, w); + rasterpos(x, y, z, w); } -/** Calls _mesa_RasterPos4f() */ void GLAPIENTRY _mesa_RasterPos2dv(const GLdouble *v) { - _mesa_RasterPos4f((GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F); + rasterpos((GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F); } -/** Calls _mesa_RasterPos4f() */ void GLAPIENTRY _mesa_RasterPos2fv(const GLfloat *v) { - _mesa_RasterPos4f(v[0], v[1], 0.0F, 1.0F); + rasterpos(v[0], v[1], 0.0F, 1.0F); } -/** Calls _mesa_RasterPos4f() */ void GLAPIENTRY _mesa_RasterPos2iv(const GLint *v) { - _mesa_RasterPos4f((GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F); + rasterpos((GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F); } -/** Calls _mesa_RasterPos4f() */ void GLAPIENTRY _mesa_RasterPos2sv(const GLshort *v) { - _mesa_RasterPos4f(v[0], v[1], 0.0F, 1.0F); + rasterpos(v[0], v[1], 0.0F, 1.0F); } -/** Calls _mesa_RasterPos4f() */ void GLAPIENTRY _mesa_RasterPos3dv(const GLdouble *v) { - _mesa_RasterPos4f((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F); + rasterpos((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F); } -/** Calls _mesa_RasterPos4f() */ void GLAPIENTRY _mesa_RasterPos3fv(const GLfloat *v) { - _mesa_RasterPos4f(v[0], v[1], v[2], 1.0F); + rasterpos(v[0], v[1], v[2], 1.0F); } -/** Calls _mesa_RasterPos4f() */ void GLAPIENTRY _mesa_RasterPos3iv(const GLint *v) { - _mesa_RasterPos4f((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F); + rasterpos((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F); } -/** Calls _mesa_RasterPos4f() */ void GLAPIENTRY _mesa_RasterPos3sv(const GLshort *v) { - _mesa_RasterPos4f(v[0], v[1], v[2], 1.0F); + rasterpos(v[0], v[1], v[2], 1.0F); } -/** Calls _mesa_RasterPos4f() */ void GLAPIENTRY _mesa_RasterPos4dv(const GLdouble *v) { - _mesa_RasterPos4f((GLfloat) v[0], (GLfloat) v[1], + rasterpos((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat) v[3]); } -/** Calls _mesa_RasterPos4f() */ void GLAPIENTRY _mesa_RasterPos4fv(const GLfloat *v) { - _mesa_RasterPos4f(v[0], v[1], v[2], v[3]); + rasterpos(v[0], v[1], v[2], v[3]); } -/** Calls _mesa_RasterPos4f() */ void GLAPIENTRY _mesa_RasterPos4iv(const GLint *v) { - _mesa_RasterPos4f((GLfloat) v[0], (GLfloat) v[1], + rasterpos((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat) v[3]); } -/** Calls _mesa_RasterPos4f() */ void GLAPIENTRY _mesa_RasterPos4sv(const GLshort *v) { - _mesa_RasterPos4f(v[0], v[1], v[2], v[3]); + rasterpos(v[0], v[1], v[2], v[3]); } @@ -704,7 +211,7 @@ _mesa_RasterPos4sv(const GLshort *v) /*** GL_ARB_window_pos / GL_MESA_window_pos ***/ /**********************************************************************/ -#if FEATURE_windowpos +#if FEATURE_drawpix /** * All glWindowPosMESA and glWindowPosARB commands call this function to * update the current raster position. diff --git a/src/mesa/main/readpix.c b/src/mesa/main/readpix.c new file mode 100644 index 0000000000..dfdd297b6e --- /dev/null +++ b/src/mesa/main/readpix.c @@ -0,0 +1,190 @@ +/* + * Mesa 3-D graphics library + * Version: 7.1 + * + * Copyright (C) 1999-2008 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. + */ + +#include "glheader.h" +#include "imports.h" +#include "bufferobj.h" +#include "context.h" +#include "readpix.h" +#include "framebuffer.h" +#include "image.h" +#include "state.h" + + +/** + * Do error checking of the format/type parameters to glReadPixels and + * glDrawPixels. + * \param drawing if GL_TRUE do checking for DrawPixels, else do checking + * for ReadPixels. + * \return GL_TRUE if error detected, GL_FALSE if no errors + */ +GLboolean +_mesa_error_check_format_type(GLcontext *ctx, GLenum format, GLenum type, + GLboolean drawing) +{ + const char *readDraw = drawing ? "Draw" : "Read"; + + if (ctx->Extensions.EXT_packed_depth_stencil + && type == GL_UNSIGNED_INT_24_8_EXT + && format != GL_DEPTH_STENCIL_EXT) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "gl%sPixels(format is not GL_DEPTH_STENCIL_EXT)", readDraw); + return GL_TRUE; + } + + /* basic combinations test */ + if (!_mesa_is_legal_format_and_type(ctx, format, type)) { + _mesa_error(ctx, GL_INVALID_ENUM, + "gl%sPixels(format or type)", readDraw); + return GL_TRUE; + } + + /* additional checks */ + switch (format) { + case GL_RED: + case GL_GREEN: + case GL_BLUE: + case GL_ALPHA: + case GL_LUMINANCE: + case GL_LUMINANCE_ALPHA: + case GL_RGB: + case GL_BGR: + case GL_RGBA: + case GL_BGRA: + case GL_ABGR_EXT: + if (drawing && !ctx->Visual.rgbMode) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glDrawPixels(drawing RGB pixels into color index buffer)"); + return GL_TRUE; + } + if (!drawing && !_mesa_dest_buffer_exists(ctx, GL_COLOR)) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glReadPixels(no color buffer)"); + return GL_TRUE; + } + break; + case GL_COLOR_INDEX: + if (!drawing && ctx->Visual.rgbMode) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glReadPixels(reading color index format from RGB buffer)"); + return GL_TRUE; + } + if (!drawing && !_mesa_dest_buffer_exists(ctx, GL_COLOR)) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glReadPixels(no color buffer)"); + return GL_TRUE; + } + break; + case GL_STENCIL_INDEX: + if ((drawing && !_mesa_dest_buffer_exists(ctx, format)) || + (!drawing && !_mesa_source_buffer_exists(ctx, format))) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "gl%sPixels(no stencil buffer)", readDraw); + return GL_TRUE; + } + break; + case GL_DEPTH_COMPONENT: + if ((drawing && !_mesa_dest_buffer_exists(ctx, format))) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "gl%sPixels(no depth buffer)", readDraw); + return GL_TRUE; + } + break; + case GL_DEPTH_STENCIL_EXT: + if (!ctx->Extensions.EXT_packed_depth_stencil || + type != GL_UNSIGNED_INT_24_8_EXT) { + _mesa_error(ctx, GL_INVALID_ENUM, "gl%sPixels(type)", readDraw); + return GL_TRUE; + } + if ((drawing && !_mesa_dest_buffer_exists(ctx, format)) || + (!drawing && !_mesa_source_buffer_exists(ctx, format))) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "gl%sPixels(no depth or stencil buffer)", readDraw); + return GL_TRUE; + } + break; + default: + /* this should have been caught in _mesa_is_legal_format_type() */ + _mesa_problem(ctx, "unexpected format in _mesa_%sPixels", readDraw); + return GL_TRUE; + } + + /* no errors */ + return GL_FALSE; +} + + + +void GLAPIENTRY +_mesa_ReadPixels( GLint x, GLint y, GLsizei width, GLsizei height, + GLenum format, GLenum type, GLvoid *pixels ) +{ + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); + + FLUSH_CURRENT(ctx, 0); + + if (width < 0 || height < 0) { + _mesa_error( ctx, GL_INVALID_VALUE, + "glReadPixels(width=%d height=%d)", width, height ); + return; + } + + if (ctx->NewState) + _mesa_update_state(ctx); + + if (_mesa_error_check_format_type(ctx, format, type, GL_FALSE)) { + /* found an error */ + return; + } + + if (ctx->ReadBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) { + _mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION_EXT, + "glReadPixels(incomplete framebuffer)" ); + return; + } + + if (!_mesa_source_buffer_exists(ctx, format)) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glReadPixels(no readbuffer)"); + return; + } + + if (ctx->Pack.BufferObj->Name) { + if (!_mesa_validate_pbo_access(2, &ctx->Pack, width, height, 1, + format, type, pixels)) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glReadPixels(invalid PBO access)"); + return; + } + + if (ctx->Pack.BufferObj->Pointer) { + /* buffer is mapped - that's an error */ + _mesa_error(ctx, GL_INVALID_OPERATION, "glReadPixels(PBO is mapped)"); + return; + } + } + + ctx->Driver.ReadPixels(ctx, x, y, width, height, + format, type, &ctx->Pack, pixels); +} diff --git a/src/mesa/main/readpix.h b/src/mesa/main/readpix.h new file mode 100644 index 0000000000..1bf02fb8e4 --- /dev/null +++ b/src/mesa/main/readpix.h @@ -0,0 +1,42 @@ +/* + * Mesa 3-D graphics library + * Version: 7.1 + * + * Copyright (C) 1999-2008 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 READPIXELS_H +#define READPIXELS_H + + +#include "main/mtypes.h" + + +extern GLboolean +_mesa_error_check_format_type(GLcontext *ctx, GLenum format, GLenum type, + GLboolean drawing); + +extern void GLAPIENTRY +_mesa_ReadPixels( GLint x, GLint y, GLsizei width, GLsizei height, + GLenum format, GLenum type, GLvoid *pixels ); + + +#endif diff --git a/src/mesa/main/scissor.c b/src/mesa/main/scissor.c new file mode 100644 index 0000000000..b5f4cde789 --- /dev/null +++ b/src/mesa/main/scissor.c @@ -0,0 +1,99 @@ +/* + * Mesa 3-D graphics library + * Version: 7.1 + * + * Copyright (C) 1999-2007 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. + */ + + +#include "main/glheader.h" +#include "main/context.h" +#include "main/scissor.h" + + +/** + * Called via glScissor + */ +void GLAPIENTRY +_mesa_Scissor( GLint x, GLint y, GLsizei width, GLsizei height ) +{ + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END(ctx); + + if (width < 0 || height < 0) { + _mesa_error( ctx, GL_INVALID_VALUE, "glScissor" ); + return; + } + + if (MESA_VERBOSE & VERBOSE_API) + _mesa_debug(ctx, "glScissor %d %d %d %d\n", x, y, width, height); + + _mesa_set_scissor(ctx, x, y, width, height); +} + + +/** + * Define the scissor box. + * + * \param x, y coordinates of the scissor box lower-left corner. + * \param width width of the scissor box. + * \param height height of the scissor box. + * + * \sa glScissor(). + * + * Verifies the parameters and updates __GLcontextRec::Scissor. On a + * change flushes the vertices and notifies the driver via + * the dd_function_table::Scissor callback. + */ +void +_mesa_set_scissor(GLcontext *ctx, + GLint x, GLint y, GLsizei width, GLsizei height) +{ + if (x == ctx->Scissor.X && + y == ctx->Scissor.Y && + width == ctx->Scissor.Width && + height == ctx->Scissor.Height) + return; + + FLUSH_VERTICES(ctx, _NEW_SCISSOR); + ctx->Scissor.X = x; + ctx->Scissor.Y = y; + ctx->Scissor.Width = width; + ctx->Scissor.Height = height; + + if (ctx->Driver.Scissor) + ctx->Driver.Scissor( ctx, x, y, width, height ); +} + + +/** + * Initialize the context's scissor state. + * \param ctx the GL context. + */ +void +_mesa_init_scissor(GLcontext *ctx) +{ + /* Scissor group */ + ctx->Scissor.Enabled = GL_FALSE; + ctx->Scissor.X = 0; + ctx->Scissor.Y = 0; + ctx->Scissor.Width = 0; + ctx->Scissor.Height = 0; +} diff --git a/src/mesa/main/scissor.h b/src/mesa/main/scissor.h new file mode 100644 index 0000000000..b852a2122d --- /dev/null +++ b/src/mesa/main/scissor.h @@ -0,0 +1,46 @@ +/* + * Mesa 3-D graphics library + * Version: 7.1 + * + * Copyright (C) 1999-2007 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 SCISSOR_H +#define SCISSOR_H + + +#include "main/mtypes.h" + + +extern void GLAPIENTRY +_mesa_Scissor( GLint x, GLint y, GLsizei width, GLsizei height ); + + +extern void +_mesa_set_scissor(GLcontext *ctx, + GLint x, GLint y, GLsizei width, GLsizei height); + + +extern void +_mesa_init_scissor(GLcontext *ctx); + + +#endif diff --git a/src/mesa/main/sources b/src/mesa/main/sources new file mode 100644 index 0000000000..eb8cd900ee --- /dev/null +++ b/src/mesa/main/sources @@ -0,0 +1,156 @@ +# List of source files in this directory used for X.org xserver build +MESA_MAIN_SOURCES = \ +accum.c \ +api_arrayelt.c \ +api_exec.c \ +api_loopback.c \ +api_noop.c \ +api_validate.c \ +arrayobj.c \ +attrib.c \ +blend.c \ +bufferobj.c \ +buffers.c \ +clear.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 \ +multisample.c \ +occlude.c \ +pixel.c \ +pixelstore.c \ +points.c \ +polygon.c \ +readpix.c \ +rastpos.c \ +rbadaptors.c \ +renderbuffer.c \ +scissor.c \ +state.c \ +stencil.c \ +texcompress.c \ +texcompress_fxt1.c \ +texcompress_s3tc.c \ +texenv.c \ +texenvprogram.c \ +texformat.c \ +texgen.c \ +teximage.c \ +texobj.c \ +texparam.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_exec.h \ +api_loopback.h \ +api_noop.h \ +api_validate.h \ +arrayobj.h \ +attrib.h \ +bitset.h \ +blend.h \ +bufferobj.h \ +buffers.h \ +clear.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 \ +multisample.h \ +occlude.h \ +pixel.h \ +pixelstore.h \ +points.h \ +polygon.h \ +rastpos.h \ +rbadaptors.h \ +readpix.h \ +renderbuffer.h \ +simple_list.h \ +scissor.h \ +state.h \ +stencil.h \ +texcompress.h \ +texenv.h \ +texenvprogram.h \ +texformat.h \ +texformat_tmp.h \ +texgen.h \ +teximage.h \ +texobj.h \ +texparam.h \ +texrender.h \ +texstate.h \ +texstore.h \ +varray.h \ +version.h \ +vtxfmt.h \ +vtxfmt_tmp.h diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c index 7192bed4a3..48656bd35e 100644 --- a/src/mesa/main/state.c +++ b/src/mesa/main/state.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.5.1 + * Version: 7.1 * - * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2008 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"), @@ -27,806 +27,28 @@ * \file state.c * State management. * - * This file manages recalculation of derived values in the __GLcontextRec. - * Also, this is where we initialize the API dispatch table. + * This file manages recalculation of derived values in GLcontext. */ + #include "glheader.h" -#include "accum.h" -#include "api_loopback.h" -#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program -#include "shader/arbprogram.h" -#endif -#if FEATURE_ATI_fragment_shader -#include "shader/atifragshader.h" -#endif -#include "attrib.h" -#include "blend.h" -#if FEATURE_ARB_vertex_buffer_object -#include "bufferobj.h" -#endif -#include "arrayobj.h" -#include "buffers.h" -#include "clip.h" -#include "colortab.h" +#include "mtypes.h" #include "context.h" -#include "convolve.h" -#include "depth.h" -#include "dlist.h" -#include "drawpix.h" -#include "enable.h" -#include "eval.h" -#include "get.h" -#include "feedback.h" -#include "fog.h" -#if FEATURE_EXT_framebuffer_object -#include "fbobject.h" -#endif +#include "debug.h" +#include "macros.h" +#include "ffvertex_prog.h" #include "framebuffer.h" -#include "hint.h" -#include "histogram.h" -#include "imports.h" #include "light.h" -#include "lines.h" -#include "macros.h" #include "matrix.h" +#if FEATURE_pixel_transfer #include "pixel.h" -#include "points.h" -#include "polygon.h" -#if FEATURE_ARB_occlusion_query || FEATURE_EXT_timer_query -#include "queryobj.h" #endif -#include "rastpos.h" +#include "shader/program.h" #include "state.h" #include "stencil.h" -#include "teximage.h" +#include "texenvprogram.h" #include "texobj.h" #include "texstate.h" -#include "mtypes.h" -#include "varray.h" -#if FEATURE_NV_vertex_program -#include "shader/nvprogram.h" -#endif -#if FEATURE_NV_fragment_program -#include "shader/nvprogram.h" -#include "shader/program.h" -#include "texenvprogram.h" -#endif -#if FEATURE_ARB_shader_objects -#include "shaders.h" -#endif -#include "debug.h" -#include "glapi/dispatch.h" - - - -/** - * Initialize a dispatch table with pointers to Mesa's immediate-mode - * commands. - * - * Pointers to glBegin()/glEnd() object commands and a few others - * are provided via the GLvertexformat interface. - * - * \param ctx GL context to which \c exec belongs. - * \param exec dispatch table. - */ -void -_mesa_init_exec_table(struct _glapi_table *exec) -{ -#if _HAVE_FULL_GL - _mesa_loopback_init_api_table( exec ); -#endif - - /* load the dispatch slots we understand */ - SET_AlphaFunc(exec, _mesa_AlphaFunc); - SET_BlendFunc(exec, _mesa_BlendFunc); - SET_Clear(exec, _mesa_Clear); - SET_ClearColor(exec, _mesa_ClearColor); - SET_ClearStencil(exec, _mesa_ClearStencil); - SET_ColorMask(exec, _mesa_ColorMask); - SET_CullFace(exec, _mesa_CullFace); - SET_Disable(exec, _mesa_Disable); - SET_DrawBuffer(exec, _mesa_DrawBuffer); - SET_Enable(exec, _mesa_Enable); - SET_Finish(exec, _mesa_Finish); - SET_Flush(exec, _mesa_Flush); - SET_FrontFace(exec, _mesa_FrontFace); - SET_Frustum(exec, _mesa_Frustum); - SET_GetError(exec, _mesa_GetError); - SET_GetFloatv(exec, _mesa_GetFloatv); - SET_GetString(exec, _mesa_GetString); - SET_InitNames(exec, _mesa_InitNames); - SET_LineStipple(exec, _mesa_LineStipple); - SET_LineWidth(exec, _mesa_LineWidth); - SET_LoadIdentity(exec, _mesa_LoadIdentity); - SET_LoadMatrixf(exec, _mesa_LoadMatrixf); - SET_LoadName(exec, _mesa_LoadName); - SET_LogicOp(exec, _mesa_LogicOp); - SET_MatrixMode(exec, _mesa_MatrixMode); - SET_MultMatrixf(exec, _mesa_MultMatrixf); - SET_Ortho(exec, _mesa_Ortho); - SET_PixelStorei(exec, _mesa_PixelStorei); - SET_PopMatrix(exec, _mesa_PopMatrix); - SET_PopName(exec, _mesa_PopName); - SET_PushMatrix(exec, _mesa_PushMatrix); - SET_PushName(exec, _mesa_PushName); - SET_RasterPos2f(exec, _mesa_RasterPos2f); - SET_RasterPos2fv(exec, _mesa_RasterPos2fv); - SET_RasterPos2i(exec, _mesa_RasterPos2i); - SET_RasterPos2iv(exec, _mesa_RasterPos2iv); - SET_ReadBuffer(exec, _mesa_ReadBuffer); - SET_RenderMode(exec, _mesa_RenderMode); - SET_Rotatef(exec, _mesa_Rotatef); - SET_Scalef(exec, _mesa_Scalef); - SET_Scissor(exec, _mesa_Scissor); - SET_SelectBuffer(exec, _mesa_SelectBuffer); - SET_ShadeModel(exec, _mesa_ShadeModel); - SET_StencilFunc(exec, _mesa_StencilFunc); - SET_StencilMask(exec, _mesa_StencilMask); - SET_StencilOp(exec, _mesa_StencilOp); - SET_TexEnvfv(exec, _mesa_TexEnvfv); - SET_TexEnvi(exec, _mesa_TexEnvi); - SET_TexImage2D(exec, _mesa_TexImage2D); - SET_TexParameteri(exec, _mesa_TexParameteri); - SET_Translatef(exec, _mesa_Translatef); - SET_Viewport(exec, _mesa_Viewport); -#if _HAVE_FULL_GL - SET_Accum(exec, _mesa_Accum); - SET_Bitmap(exec, _mesa_Bitmap); - SET_CallList(exec, _mesa_CallList); - SET_CallLists(exec, _mesa_CallLists); - SET_ClearAccum(exec, _mesa_ClearAccum); - SET_ClearDepth(exec, _mesa_ClearDepth); - SET_ClearIndex(exec, _mesa_ClearIndex); - SET_ClipPlane(exec, _mesa_ClipPlane); - SET_ColorMaterial(exec, _mesa_ColorMaterial); - SET_CopyPixels(exec, _mesa_CopyPixels); - SET_CullParameterfvEXT(exec, _mesa_CullParameterfvEXT); - SET_CullParameterdvEXT(exec, _mesa_CullParameterdvEXT); - SET_DeleteLists(exec, _mesa_DeleteLists); - SET_DepthFunc(exec, _mesa_DepthFunc); - SET_DepthMask(exec, _mesa_DepthMask); - SET_DepthRange(exec, _mesa_DepthRange); - SET_DrawPixels(exec, _mesa_DrawPixels); - SET_EndList(exec, _mesa_EndList); - SET_FeedbackBuffer(exec, _mesa_FeedbackBuffer); - SET_FogCoordPointerEXT(exec, _mesa_FogCoordPointerEXT); - SET_Fogf(exec, _mesa_Fogf); - SET_Fogfv(exec, _mesa_Fogfv); - SET_Fogi(exec, _mesa_Fogi); - SET_Fogiv(exec, _mesa_Fogiv); - SET_GenLists(exec, _mesa_GenLists); - SET_GetClipPlane(exec, _mesa_GetClipPlane); - SET_GetBooleanv(exec, _mesa_GetBooleanv); - SET_GetDoublev(exec, _mesa_GetDoublev); - SET_GetIntegerv(exec, _mesa_GetIntegerv); - SET_GetLightfv(exec, _mesa_GetLightfv); - SET_GetLightiv(exec, _mesa_GetLightiv); - SET_GetMapdv(exec, _mesa_GetMapdv); - SET_GetMapfv(exec, _mesa_GetMapfv); - SET_GetMapiv(exec, _mesa_GetMapiv); - SET_GetMaterialfv(exec, _mesa_GetMaterialfv); - SET_GetMaterialiv(exec, _mesa_GetMaterialiv); - SET_GetPixelMapfv(exec, _mesa_GetPixelMapfv); - SET_GetPixelMapuiv(exec, _mesa_GetPixelMapuiv); - SET_GetPixelMapusv(exec, _mesa_GetPixelMapusv); - SET_GetPolygonStipple(exec, _mesa_GetPolygonStipple); - SET_GetTexEnvfv(exec, _mesa_GetTexEnvfv); - SET_GetTexEnviv(exec, _mesa_GetTexEnviv); - SET_GetTexLevelParameterfv(exec, _mesa_GetTexLevelParameterfv); - SET_GetTexLevelParameteriv(exec, _mesa_GetTexLevelParameteriv); - SET_GetTexParameterfv(exec, _mesa_GetTexParameterfv); - SET_GetTexParameteriv(exec, _mesa_GetTexParameteriv); - SET_GetTexGendv(exec, _mesa_GetTexGendv); - SET_GetTexGenfv(exec, _mesa_GetTexGenfv); - SET_GetTexGeniv(exec, _mesa_GetTexGeniv); - SET_GetTexImage(exec, _mesa_GetTexImage); - SET_Hint(exec, _mesa_Hint); - SET_IndexMask(exec, _mesa_IndexMask); - SET_IsEnabled(exec, _mesa_IsEnabled); - SET_IsList(exec, _mesa_IsList); - SET_LightModelf(exec, _mesa_LightModelf); - SET_LightModelfv(exec, _mesa_LightModelfv); - SET_LightModeli(exec, _mesa_LightModeli); - SET_LightModeliv(exec, _mesa_LightModeliv); - SET_Lightf(exec, _mesa_Lightf); - SET_Lightfv(exec, _mesa_Lightfv); - SET_Lighti(exec, _mesa_Lighti); - SET_Lightiv(exec, _mesa_Lightiv); - SET_ListBase(exec, _mesa_ListBase); - SET_LoadMatrixd(exec, _mesa_LoadMatrixd); - SET_Map1d(exec, _mesa_Map1d); - SET_Map1f(exec, _mesa_Map1f); - SET_Map2d(exec, _mesa_Map2d); - SET_Map2f(exec, _mesa_Map2f); - SET_MapGrid1d(exec, _mesa_MapGrid1d); - SET_MapGrid1f(exec, _mesa_MapGrid1f); - SET_MapGrid2d(exec, _mesa_MapGrid2d); - SET_MapGrid2f(exec, _mesa_MapGrid2f); - SET_MultMatrixd(exec, _mesa_MultMatrixd); - SET_NewList(exec, _mesa_NewList); - SET_PassThrough(exec, _mesa_PassThrough); - SET_PixelMapfv(exec, _mesa_PixelMapfv); - SET_PixelMapuiv(exec, _mesa_PixelMapuiv); - SET_PixelMapusv(exec, _mesa_PixelMapusv); - SET_PixelStoref(exec, _mesa_PixelStoref); - SET_PixelTransferf(exec, _mesa_PixelTransferf); - SET_PixelTransferi(exec, _mesa_PixelTransferi); - SET_PixelZoom(exec, _mesa_PixelZoom); - SET_PointSize(exec, _mesa_PointSize); - SET_PolygonMode(exec, _mesa_PolygonMode); - SET_PolygonOffset(exec, _mesa_PolygonOffset); - SET_PolygonStipple(exec, _mesa_PolygonStipple); - SET_PopAttrib(exec, _mesa_PopAttrib); - SET_PushAttrib(exec, _mesa_PushAttrib); - SET_RasterPos2d(exec, _mesa_RasterPos2d); - SET_RasterPos2dv(exec, _mesa_RasterPos2dv); - SET_RasterPos2s(exec, _mesa_RasterPos2s); - SET_RasterPos2sv(exec, _mesa_RasterPos2sv); - SET_RasterPos3d(exec, _mesa_RasterPos3d); - SET_RasterPos3dv(exec, _mesa_RasterPos3dv); - SET_RasterPos3f(exec, _mesa_RasterPos3f); - SET_RasterPos3fv(exec, _mesa_RasterPos3fv); - SET_RasterPos3i(exec, _mesa_RasterPos3i); - SET_RasterPos3iv(exec, _mesa_RasterPos3iv); - SET_RasterPos3s(exec, _mesa_RasterPos3s); - SET_RasterPos3sv(exec, _mesa_RasterPos3sv); - SET_RasterPos4d(exec, _mesa_RasterPos4d); - SET_RasterPos4dv(exec, _mesa_RasterPos4dv); - SET_RasterPos4f(exec, _mesa_RasterPos4f); - SET_RasterPos4fv(exec, _mesa_RasterPos4fv); - SET_RasterPos4i(exec, _mesa_RasterPos4i); - SET_RasterPos4iv(exec, _mesa_RasterPos4iv); - SET_RasterPos4s(exec, _mesa_RasterPos4s); - SET_RasterPos4sv(exec, _mesa_RasterPos4sv); - SET_ReadPixels(exec, _mesa_ReadPixels); - SET_Rotated(exec, _mesa_Rotated); - SET_Scaled(exec, _mesa_Scaled); - SET_SecondaryColorPointerEXT(exec, _mesa_SecondaryColorPointerEXT); - SET_TexEnvf(exec, _mesa_TexEnvf); - SET_TexEnviv(exec, _mesa_TexEnviv); - SET_TexGend(exec, _mesa_TexGend); - SET_TexGendv(exec, _mesa_TexGendv); - SET_TexGenf(exec, _mesa_TexGenf); - SET_TexGenfv(exec, _mesa_TexGenfv); - SET_TexGeni(exec, _mesa_TexGeni); - SET_TexGeniv(exec, _mesa_TexGeniv); - SET_TexImage1D(exec, _mesa_TexImage1D); - SET_TexParameterf(exec, _mesa_TexParameterf); - SET_TexParameterfv(exec, _mesa_TexParameterfv); - SET_TexParameteriv(exec, _mesa_TexParameteriv); - SET_Translated(exec, _mesa_Translated); -#endif - - /* 1.1 */ - SET_BindTexture(exec, _mesa_BindTexture); - SET_DeleteTextures(exec, _mesa_DeleteTextures); - SET_GenTextures(exec, _mesa_GenTextures); -#if _HAVE_FULL_GL - SET_AreTexturesResident(exec, _mesa_AreTexturesResident); - SET_ColorPointer(exec, _mesa_ColorPointer); - SET_CopyTexImage1D(exec, _mesa_CopyTexImage1D); - SET_CopyTexImage2D(exec, _mesa_CopyTexImage2D); - SET_CopyTexSubImage1D(exec, _mesa_CopyTexSubImage1D); - SET_CopyTexSubImage2D(exec, _mesa_CopyTexSubImage2D); - SET_DisableClientState(exec, _mesa_DisableClientState); - SET_EdgeFlagPointer(exec, _mesa_EdgeFlagPointer); - SET_EnableClientState(exec, _mesa_EnableClientState); - SET_GetPointerv(exec, _mesa_GetPointerv); - SET_IndexPointer(exec, _mesa_IndexPointer); - SET_InterleavedArrays(exec, _mesa_InterleavedArrays); - SET_IsTexture(exec, _mesa_IsTexture); - SET_NormalPointer(exec, _mesa_NormalPointer); - SET_PopClientAttrib(exec, _mesa_PopClientAttrib); - SET_PrioritizeTextures(exec, _mesa_PrioritizeTextures); - SET_PushClientAttrib(exec, _mesa_PushClientAttrib); - SET_TexCoordPointer(exec, _mesa_TexCoordPointer); - SET_TexSubImage1D(exec, _mesa_TexSubImage1D); - SET_TexSubImage2D(exec, _mesa_TexSubImage2D); - SET_VertexPointer(exec, _mesa_VertexPointer); -#endif - - /* 1.2 */ -#if _HAVE_FULL_GL - SET_CopyTexSubImage3D(exec, _mesa_CopyTexSubImage3D); - SET_TexImage3D(exec, _mesa_TexImage3D); - SET_TexSubImage3D(exec, _mesa_TexSubImage3D); -#endif - - /* OpenGL 1.2 GL_ARB_imaging */ -#if _HAVE_FULL_GL - SET_BlendColor(exec, _mesa_BlendColor); - SET_BlendEquation(exec, _mesa_BlendEquation); - SET_BlendEquationSeparateEXT(exec, _mesa_BlendEquationSeparateEXT); - SET_ColorSubTable(exec, _mesa_ColorSubTable); - SET_ColorTable(exec, _mesa_ColorTable); - SET_ColorTableParameterfv(exec, _mesa_ColorTableParameterfv); - SET_ColorTableParameteriv(exec, _mesa_ColorTableParameteriv); - SET_ConvolutionFilter1D(exec, _mesa_ConvolutionFilter1D); - SET_ConvolutionFilter2D(exec, _mesa_ConvolutionFilter2D); - SET_ConvolutionParameterf(exec, _mesa_ConvolutionParameterf); - SET_ConvolutionParameterfv(exec, _mesa_ConvolutionParameterfv); - SET_ConvolutionParameteri(exec, _mesa_ConvolutionParameteri); - SET_ConvolutionParameteriv(exec, _mesa_ConvolutionParameteriv); - SET_CopyColorSubTable(exec, _mesa_CopyColorSubTable); - SET_CopyColorTable(exec, _mesa_CopyColorTable); - SET_CopyConvolutionFilter1D(exec, _mesa_CopyConvolutionFilter1D); - SET_CopyConvolutionFilter2D(exec, _mesa_CopyConvolutionFilter2D); - SET_GetColorTable(exec, _mesa_GetColorTable); - SET_GetColorTableParameterfv(exec, _mesa_GetColorTableParameterfv); - SET_GetColorTableParameteriv(exec, _mesa_GetColorTableParameteriv); - SET_GetConvolutionFilter(exec, _mesa_GetConvolutionFilter); - SET_GetConvolutionParameterfv(exec, _mesa_GetConvolutionParameterfv); - SET_GetConvolutionParameteriv(exec, _mesa_GetConvolutionParameteriv); - SET_GetHistogram(exec, _mesa_GetHistogram); - SET_GetHistogramParameterfv(exec, _mesa_GetHistogramParameterfv); - SET_GetHistogramParameteriv(exec, _mesa_GetHistogramParameteriv); - SET_GetMinmax(exec, _mesa_GetMinmax); - SET_GetMinmaxParameterfv(exec, _mesa_GetMinmaxParameterfv); - SET_GetMinmaxParameteriv(exec, _mesa_GetMinmaxParameteriv); - SET_GetSeparableFilter(exec, _mesa_GetSeparableFilter); - SET_Histogram(exec, _mesa_Histogram); - SET_Minmax(exec, _mesa_Minmax); - SET_ResetHistogram(exec, _mesa_ResetHistogram); - SET_ResetMinmax(exec, _mesa_ResetMinmax); - SET_SeparableFilter2D(exec, _mesa_SeparableFilter2D); -#endif - - /* OpenGL 2.0 */ - 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 -/* SET_BlendColorEXT(exec, _mesa_BlendColorEXT); */ -#endif - - /* 3. GL_EXT_polygon_offset */ -#if _HAVE_FULL_GL - SET_PolygonOffsetEXT(exec, _mesa_PolygonOffsetEXT); -#endif - - /* 6. GL_EXT_texture3d */ -#if 0 -/* SET_CopyTexSubImage3DEXT(exec, _mesa_CopyTexSubImage3D); */ -/* SET_TexImage3DEXT(exec, _mesa_TexImage3DEXT); */ -/* SET_TexSubImage3DEXT(exec, _mesa_TexSubImage3D); */ -#endif - - /* 11. GL_EXT_histogram */ -#if 0 - SET_GetHistogramEXT(exec, _mesa_GetHistogram); - SET_GetHistogramParameterfvEXT(exec, _mesa_GetHistogramParameterfv); - SET_GetHistogramParameterivEXT(exec, _mesa_GetHistogramParameteriv); - SET_GetMinmaxEXT(exec, _mesa_GetMinmax); - SET_GetMinmaxParameterfvEXT(exec, _mesa_GetMinmaxParameterfv); - SET_GetMinmaxParameterivEXT(exec, _mesa_GetMinmaxParameteriv); -#endif - - /* 14. SGI_color_table */ -#if 0 - SET_ColorTableSGI(exec, _mesa_ColorTable); - SET_ColorSubTableSGI(exec, _mesa_ColorSubTable); - SET_GetColorTableSGI(exec, _mesa_GetColorTable); - SET_GetColorTableParameterfvSGI(exec, _mesa_GetColorTableParameterfv); - SET_GetColorTableParameterivSGI(exec, _mesa_GetColorTableParameteriv); -#endif - - /* 30. GL_EXT_vertex_array */ -#if _HAVE_FULL_GL - SET_ColorPointerEXT(exec, _mesa_ColorPointerEXT); - SET_EdgeFlagPointerEXT(exec, _mesa_EdgeFlagPointerEXT); - SET_IndexPointerEXT(exec, _mesa_IndexPointerEXT); - SET_NormalPointerEXT(exec, _mesa_NormalPointerEXT); - SET_TexCoordPointerEXT(exec, _mesa_TexCoordPointerEXT); - SET_VertexPointerEXT(exec, _mesa_VertexPointerEXT); -#endif - - /* 37. GL_EXT_blend_minmax */ -#if 0 - SET_BlendEquationEXT(exec, _mesa_BlendEquationEXT); -#endif - - /* 54. GL_EXT_point_parameters */ -#if _HAVE_FULL_GL - SET_PointParameterfEXT(exec, _mesa_PointParameterfEXT); - SET_PointParameterfvEXT(exec, _mesa_PointParameterfvEXT); -#endif - - /* 97. GL_EXT_compiled_vertex_array */ -#if _HAVE_FULL_GL - SET_LockArraysEXT(exec, _mesa_LockArraysEXT); - SET_UnlockArraysEXT(exec, _mesa_UnlockArraysEXT); -#endif - - /* 148. GL_EXT_multi_draw_arrays */ -#if _HAVE_FULL_GL - SET_MultiDrawArraysEXT(exec, _mesa_MultiDrawArraysEXT); - SET_MultiDrawElementsEXT(exec, _mesa_MultiDrawElementsEXT); -#endif - - /* 173. GL_INGR_blend_func_separate */ -#if _HAVE_FULL_GL - SET_BlendFuncSeparateEXT(exec, _mesa_BlendFuncSeparateEXT); -#endif - - /* 196. GL_MESA_resize_buffers */ -#if _HAVE_FULL_GL - SET_ResizeBuffersMESA(exec, _mesa_ResizeBuffersMESA); -#endif - - /* 197. GL_MESA_window_pos */ -#if _HAVE_FULL_GL - SET_WindowPos2dMESA(exec, _mesa_WindowPos2dMESA); - SET_WindowPos2dvMESA(exec, _mesa_WindowPos2dvMESA); - SET_WindowPos2fMESA(exec, _mesa_WindowPos2fMESA); - SET_WindowPos2fvMESA(exec, _mesa_WindowPos2fvMESA); - SET_WindowPos2iMESA(exec, _mesa_WindowPos2iMESA); - SET_WindowPos2ivMESA(exec, _mesa_WindowPos2ivMESA); - SET_WindowPos2sMESA(exec, _mesa_WindowPos2sMESA); - SET_WindowPos2svMESA(exec, _mesa_WindowPos2svMESA); - SET_WindowPos3dMESA(exec, _mesa_WindowPos3dMESA); - SET_WindowPos3dvMESA(exec, _mesa_WindowPos3dvMESA); - SET_WindowPos3fMESA(exec, _mesa_WindowPos3fMESA); - SET_WindowPos3fvMESA(exec, _mesa_WindowPos3fvMESA); - SET_WindowPos3iMESA(exec, _mesa_WindowPos3iMESA); - SET_WindowPos3ivMESA(exec, _mesa_WindowPos3ivMESA); - SET_WindowPos3sMESA(exec, _mesa_WindowPos3sMESA); - SET_WindowPos3svMESA(exec, _mesa_WindowPos3svMESA); - SET_WindowPos4dMESA(exec, _mesa_WindowPos4dMESA); - SET_WindowPos4dvMESA(exec, _mesa_WindowPos4dvMESA); - SET_WindowPos4fMESA(exec, _mesa_WindowPos4fMESA); - SET_WindowPos4fvMESA(exec, _mesa_WindowPos4fvMESA); - SET_WindowPos4iMESA(exec, _mesa_WindowPos4iMESA); - SET_WindowPos4ivMESA(exec, _mesa_WindowPos4ivMESA); - SET_WindowPos4sMESA(exec, _mesa_WindowPos4sMESA); - SET_WindowPos4svMESA(exec, _mesa_WindowPos4svMESA); -#endif - - /* 200. GL_IBM_multimode_draw_arrays */ -#if _HAVE_FULL_GL - SET_MultiModeDrawArraysIBM(exec, _mesa_MultiModeDrawArraysIBM); - SET_MultiModeDrawElementsIBM(exec, _mesa_MultiModeDrawElementsIBM); -#endif - - /* 233. GL_NV_vertex_program */ -#if FEATURE_NV_vertex_program - SET_BindProgramNV(exec, _mesa_BindProgram); - SET_DeleteProgramsNV(exec, _mesa_DeletePrograms); - SET_ExecuteProgramNV(exec, _mesa_ExecuteProgramNV); - SET_GenProgramsNV(exec, _mesa_GenPrograms); - SET_AreProgramsResidentNV(exec, _mesa_AreProgramsResidentNV); - SET_RequestResidentProgramsNV(exec, _mesa_RequestResidentProgramsNV); - SET_GetProgramParameterfvNV(exec, _mesa_GetProgramParameterfvNV); - SET_GetProgramParameterdvNV(exec, _mesa_GetProgramParameterdvNV); - SET_GetProgramivNV(exec, _mesa_GetProgramivNV); - SET_GetProgramStringNV(exec, _mesa_GetProgramStringNV); - SET_GetTrackMatrixivNV(exec, _mesa_GetTrackMatrixivNV); - SET_GetVertexAttribdvNV(exec, _mesa_GetVertexAttribdvNV); - SET_GetVertexAttribfvNV(exec, _mesa_GetVertexAttribfvNV); - SET_GetVertexAttribivNV(exec, _mesa_GetVertexAttribivNV); - SET_GetVertexAttribPointervNV(exec, _mesa_GetVertexAttribPointervNV); - SET_IsProgramNV(exec, _mesa_IsProgramARB); - SET_LoadProgramNV(exec, _mesa_LoadProgramNV); - SET_ProgramEnvParameter4dARB(exec, _mesa_ProgramEnvParameter4dARB); /* alias to ProgramParameter4dNV */ - SET_ProgramEnvParameter4dvARB(exec, _mesa_ProgramEnvParameter4dvARB); /* alias to ProgramParameter4dvNV */ - SET_ProgramEnvParameter4fARB(exec, _mesa_ProgramEnvParameter4fARB); /* alias to ProgramParameter4fNV */ - SET_ProgramEnvParameter4fvARB(exec, _mesa_ProgramEnvParameter4fvARB); /* alias to ProgramParameter4fvNV */ - SET_ProgramParameters4dvNV(exec, _mesa_ProgramParameters4dvNV); - SET_ProgramParameters4fvNV(exec, _mesa_ProgramParameters4fvNV); - SET_TrackMatrixNV(exec, _mesa_TrackMatrixNV); - SET_VertexAttribPointerNV(exec, _mesa_VertexAttribPointerNV); - /* glVertexAttrib*NV functions handled in api_loopback.c */ -#endif - - /* 273. GL_APPLE_vertex_array_object */ - SET_BindVertexArrayAPPLE(exec, _mesa_BindVertexArrayAPPLE); - SET_DeleteVertexArraysAPPLE(exec, _mesa_DeleteVertexArraysAPPLE); - SET_GenVertexArraysAPPLE(exec, _mesa_GenVertexArraysAPPLE); - SET_IsVertexArrayAPPLE(exec, _mesa_IsVertexArrayAPPLE); - - /* 282. GL_NV_fragment_program */ -#if FEATURE_NV_fragment_program - SET_ProgramNamedParameter4fNV(exec, _mesa_ProgramNamedParameter4fNV); - SET_ProgramNamedParameter4dNV(exec, _mesa_ProgramNamedParameter4dNV); - SET_ProgramNamedParameter4fvNV(exec, _mesa_ProgramNamedParameter4fvNV); - SET_ProgramNamedParameter4dvNV(exec, _mesa_ProgramNamedParameter4dvNV); - SET_GetProgramNamedParameterfvNV(exec, _mesa_GetProgramNamedParameterfvNV); - SET_GetProgramNamedParameterdvNV(exec, _mesa_GetProgramNamedParameterdvNV); - SET_ProgramLocalParameter4dARB(exec, _mesa_ProgramLocalParameter4dARB); - SET_ProgramLocalParameter4dvARB(exec, _mesa_ProgramLocalParameter4dvARB); - SET_ProgramLocalParameter4fARB(exec, _mesa_ProgramLocalParameter4fARB); - SET_ProgramLocalParameter4fvARB(exec, _mesa_ProgramLocalParameter4fvARB); - SET_GetProgramLocalParameterdvARB(exec, _mesa_GetProgramLocalParameterdvARB); - SET_GetProgramLocalParameterfvARB(exec, _mesa_GetProgramLocalParameterfvARB); -#endif - - /* 262. GL_NV_point_sprite */ -#if _HAVE_FULL_GL - SET_PointParameteriNV(exec, _mesa_PointParameteriNV); - SET_PointParameterivNV(exec, _mesa_PointParameterivNV); -#endif - - /* 268. GL_EXT_stencil_two_side */ -#if _HAVE_FULL_GL - SET_ActiveStencilFaceEXT(exec, _mesa_ActiveStencilFaceEXT); -#endif - - /* ???. GL_EXT_depth_bounds_test */ - SET_DepthBoundsEXT(exec, _mesa_DepthBoundsEXT); - - /* ARB 1. GL_ARB_multitexture */ -#if _HAVE_FULL_GL - SET_ActiveTextureARB(exec, _mesa_ActiveTextureARB); - SET_ClientActiveTextureARB(exec, _mesa_ClientActiveTextureARB); -#endif - - /* ARB 3. GL_ARB_transpose_matrix */ -#if _HAVE_FULL_GL - SET_LoadTransposeMatrixdARB(exec, _mesa_LoadTransposeMatrixdARB); - SET_LoadTransposeMatrixfARB(exec, _mesa_LoadTransposeMatrixfARB); - SET_MultTransposeMatrixdARB(exec, _mesa_MultTransposeMatrixdARB); - SET_MultTransposeMatrixfARB(exec, _mesa_MultTransposeMatrixfARB); -#endif - - /* ARB 5. GL_ARB_multisample */ -#if _HAVE_FULL_GL - SET_SampleCoverageARB(exec, _mesa_SampleCoverageARB); -#endif - - /* ARB 12. GL_ARB_texture_compression */ -#if _HAVE_FULL_GL - SET_CompressedTexImage3DARB(exec, _mesa_CompressedTexImage3DARB); - SET_CompressedTexImage2DARB(exec, _mesa_CompressedTexImage2DARB); - SET_CompressedTexImage1DARB(exec, _mesa_CompressedTexImage1DARB); - SET_CompressedTexSubImage3DARB(exec, _mesa_CompressedTexSubImage3DARB); - SET_CompressedTexSubImage2DARB(exec, _mesa_CompressedTexSubImage2DARB); - SET_CompressedTexSubImage1DARB(exec, _mesa_CompressedTexSubImage1DARB); - SET_GetCompressedTexImageARB(exec, _mesa_GetCompressedTexImageARB); -#endif - - /* ARB 14. GL_ARB_point_parameters */ - /* reuse EXT_point_parameters functions */ - - /* ARB 26. GL_ARB_vertex_program */ - /* ARB 27. GL_ARB_fragment_program */ -#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program - /* glVertexAttrib1sARB aliases glVertexAttrib1sNV */ - /* glVertexAttrib1fARB aliases glVertexAttrib1fNV */ - /* glVertexAttrib1dARB aliases glVertexAttrib1dNV */ - /* glVertexAttrib2sARB aliases glVertexAttrib2sNV */ - /* glVertexAttrib2fARB aliases glVertexAttrib2fNV */ - /* glVertexAttrib2dARB aliases glVertexAttrib2dNV */ - /* glVertexAttrib3sARB aliases glVertexAttrib3sNV */ - /* glVertexAttrib3fARB aliases glVertexAttrib3fNV */ - /* glVertexAttrib3dARB aliases glVertexAttrib3dNV */ - /* glVertexAttrib4sARB aliases glVertexAttrib4sNV */ - /* glVertexAttrib4fARB aliases glVertexAttrib4fNV */ - /* glVertexAttrib4dARB aliases glVertexAttrib4dNV */ - /* glVertexAttrib4NubARB aliases glVertexAttrib4NubNV */ - /* glVertexAttrib1svARB aliases glVertexAttrib1svNV */ - /* glVertexAttrib1fvARB aliases glVertexAttrib1fvNV */ - /* glVertexAttrib1dvARB aliases glVertexAttrib1dvNV */ - /* glVertexAttrib2svARB aliases glVertexAttrib2svNV */ - /* glVertexAttrib2fvARB aliases glVertexAttrib2fvNV */ - /* glVertexAttrib2dvARB aliases glVertexAttrib2dvNV */ - /* glVertexAttrib3svARB aliases glVertexAttrib3svNV */ - /* glVertexAttrib3fvARB aliases glVertexAttrib3fvNV */ - /* glVertexAttrib3dvARB aliases glVertexAttrib3dvNV */ - /* glVertexAttrib4svARB aliases glVertexAttrib4svNV */ - /* glVertexAttrib4fvARB aliases glVertexAttrib4fvNV */ - /* glVertexAttrib4dvARB aliases glVertexAttrib4dvNV */ - /* glVertexAttrib4NubvARB aliases glVertexAttrib4NubvNV */ - /* glVertexAttrib4bvARB handled in api_loopback.c */ - /* glVertexAttrib4ivARB handled in api_loopback.c */ - /* glVertexAttrib4ubvARB handled in api_loopback.c */ - /* glVertexAttrib4usvARB handled in api_loopback.c */ - /* glVertexAttrib4uivARB handled in api_loopback.c */ - /* glVertexAttrib4NbvARB handled in api_loopback.c */ - /* glVertexAttrib4NsvARB handled in api_loopback.c */ - /* glVertexAttrib4NivARB handled in api_loopback.c */ - /* glVertexAttrib4NusvARB handled in api_loopback.c */ - /* glVertexAttrib4NuivARB handled in api_loopback.c */ - SET_VertexAttribPointerARB(exec, _mesa_VertexAttribPointerARB); - SET_EnableVertexAttribArrayARB(exec, _mesa_EnableVertexAttribArrayARB); - SET_DisableVertexAttribArrayARB(exec, _mesa_DisableVertexAttribArrayARB); - SET_ProgramStringARB(exec, _mesa_ProgramStringARB); - /* glBindProgramARB aliases glBindProgramNV */ - /* glDeleteProgramsARB aliases glDeleteProgramsNV */ - /* glGenProgramsARB aliases glGenProgramsNV */ - /* glIsProgramARB aliases glIsProgramNV */ - SET_GetVertexAttribdvARB(exec, _mesa_GetVertexAttribdvARB); - SET_GetVertexAttribfvARB(exec, _mesa_GetVertexAttribfvARB); - SET_GetVertexAttribivARB(exec, _mesa_GetVertexAttribivARB); - /* glGetVertexAttribPointervARB aliases glGetVertexAttribPointervNV */ - SET_ProgramEnvParameter4dARB(exec, _mesa_ProgramEnvParameter4dARB); - SET_ProgramEnvParameter4dvARB(exec, _mesa_ProgramEnvParameter4dvARB); - SET_ProgramEnvParameter4fARB(exec, _mesa_ProgramEnvParameter4fARB); - SET_ProgramEnvParameter4fvARB(exec, _mesa_ProgramEnvParameter4fvARB); - SET_ProgramLocalParameter4dARB(exec, _mesa_ProgramLocalParameter4dARB); - SET_ProgramLocalParameter4dvARB(exec, _mesa_ProgramLocalParameter4dvARB); - SET_ProgramLocalParameter4fARB(exec, _mesa_ProgramLocalParameter4fARB); - SET_ProgramLocalParameter4fvARB(exec, _mesa_ProgramLocalParameter4fvARB); - SET_GetProgramEnvParameterdvARB(exec, _mesa_GetProgramEnvParameterdvARB); - SET_GetProgramEnvParameterfvARB(exec, _mesa_GetProgramEnvParameterfvARB); - SET_GetProgramLocalParameterdvARB(exec, _mesa_GetProgramLocalParameterdvARB); - SET_GetProgramLocalParameterfvARB(exec, _mesa_GetProgramLocalParameterfvARB); - SET_GetProgramivARB(exec, _mesa_GetProgramivARB); - SET_GetProgramStringARB(exec, _mesa_GetProgramStringARB); -#endif - - /* ARB 28. GL_ARB_vertex_buffer_object */ -#if FEATURE_ARB_vertex_buffer_object - SET_BindBufferARB(exec, _mesa_BindBufferARB); - SET_BufferDataARB(exec, _mesa_BufferDataARB); - SET_BufferSubDataARB(exec, _mesa_BufferSubDataARB); - SET_DeleteBuffersARB(exec, _mesa_DeleteBuffersARB); - SET_GenBuffersARB(exec, _mesa_GenBuffersARB); - SET_GetBufferParameterivARB(exec, _mesa_GetBufferParameterivARB); - SET_GetBufferPointervARB(exec, _mesa_GetBufferPointervARB); - SET_GetBufferSubDataARB(exec, _mesa_GetBufferSubDataARB); - SET_IsBufferARB(exec, _mesa_IsBufferARB); - SET_MapBufferARB(exec, _mesa_MapBufferARB); - SET_UnmapBufferARB(exec, _mesa_UnmapBufferARB); -#endif - - /* ARB 29. GL_ARB_occlusion_query */ -#if FEATURE_ARB_occlusion_query - SET_GenQueriesARB(exec, _mesa_GenQueriesARB); - SET_DeleteQueriesARB(exec, _mesa_DeleteQueriesARB); - SET_IsQueryARB(exec, _mesa_IsQueryARB); - SET_BeginQueryARB(exec, _mesa_BeginQueryARB); - SET_EndQueryARB(exec, _mesa_EndQueryARB); - SET_GetQueryivARB(exec, _mesa_GetQueryivARB); - SET_GetQueryObjectivARB(exec, _mesa_GetQueryObjectivARB); - SET_GetQueryObjectuivARB(exec, _mesa_GetQueryObjectuivARB); -#endif - - /* ARB 37. GL_ARB_draw_buffers */ - SET_DrawBuffersARB(exec, _mesa_DrawBuffersARB); - -#if FEATURE_ARB_shader_objects - SET_DeleteObjectARB(exec, _mesa_DeleteObjectARB); - SET_GetHandleARB(exec, _mesa_GetHandleARB); - SET_DetachObjectARB(exec, _mesa_DetachObjectARB); - SET_CreateShaderObjectARB(exec, _mesa_CreateShaderObjectARB); - SET_ShaderSourceARB(exec, _mesa_ShaderSourceARB); - SET_CompileShaderARB(exec, _mesa_CompileShaderARB); - SET_CreateProgramObjectARB(exec, _mesa_CreateProgramObjectARB); - SET_AttachObjectARB(exec, _mesa_AttachObjectARB); - SET_LinkProgramARB(exec, _mesa_LinkProgramARB); - SET_UseProgramObjectARB(exec, _mesa_UseProgramObjectARB); - SET_ValidateProgramARB(exec, _mesa_ValidateProgramARB); - SET_Uniform1fARB(exec, _mesa_Uniform1fARB); - SET_Uniform2fARB(exec, _mesa_Uniform2fARB); - SET_Uniform3fARB(exec, _mesa_Uniform3fARB); - SET_Uniform4fARB(exec, _mesa_Uniform4fARB); - SET_Uniform1iARB(exec, _mesa_Uniform1iARB); - SET_Uniform2iARB(exec, _mesa_Uniform2iARB); - SET_Uniform3iARB(exec, _mesa_Uniform3iARB); - SET_Uniform4iARB(exec, _mesa_Uniform4iARB); - SET_Uniform1fvARB(exec, _mesa_Uniform1fvARB); - SET_Uniform2fvARB(exec, _mesa_Uniform2fvARB); - SET_Uniform3fvARB(exec, _mesa_Uniform3fvARB); - SET_Uniform4fvARB(exec, _mesa_Uniform4fvARB); - SET_Uniform1ivARB(exec, _mesa_Uniform1ivARB); - SET_Uniform2ivARB(exec, _mesa_Uniform2ivARB); - SET_Uniform3ivARB(exec, _mesa_Uniform3ivARB); - SET_Uniform4ivARB(exec, _mesa_Uniform4ivARB); - SET_UniformMatrix2fvARB(exec, _mesa_UniformMatrix2fvARB); - SET_UniformMatrix3fvARB(exec, _mesa_UniformMatrix3fvARB); - SET_UniformMatrix4fvARB(exec, _mesa_UniformMatrix4fvARB); - SET_GetObjectParameterfvARB(exec, _mesa_GetObjectParameterfvARB); - SET_GetObjectParameterivARB(exec, _mesa_GetObjectParameterivARB); - SET_GetInfoLogARB(exec, _mesa_GetInfoLogARB); - SET_GetAttachedObjectsARB(exec, _mesa_GetAttachedObjectsARB); - SET_GetUniformLocationARB(exec, _mesa_GetUniformLocationARB); - SET_GetActiveUniformARB(exec, _mesa_GetActiveUniformARB); - SET_GetUniformfvARB(exec, _mesa_GetUniformfvARB); - SET_GetUniformivARB(exec, _mesa_GetUniformivARB); - SET_GetShaderSourceARB(exec, _mesa_GetShaderSourceARB); -#endif /* FEATURE_ARB_shader_objects */ - -#if FEATURE_ARB_vertex_shader - SET_BindAttribLocationARB(exec, _mesa_BindAttribLocationARB); - SET_GetActiveAttribARB(exec, _mesa_GetActiveAttribARB); - SET_GetAttribLocationARB(exec, _mesa_GetAttribLocationARB); -#endif /* FEATURE_ARB_vertex_shader */ - - /* GL_ATI_fragment_shader */ -#if FEATURE_ATI_fragment_shader - SET_GenFragmentShadersATI(exec, _mesa_GenFragmentShadersATI); - SET_BindFragmentShaderATI(exec, _mesa_BindFragmentShaderATI); - SET_DeleteFragmentShaderATI(exec, _mesa_DeleteFragmentShaderATI); - SET_BeginFragmentShaderATI(exec, _mesa_BeginFragmentShaderATI); - SET_EndFragmentShaderATI(exec, _mesa_EndFragmentShaderATI); - SET_PassTexCoordATI(exec, _mesa_PassTexCoordATI); - SET_SampleMapATI(exec, _mesa_SampleMapATI); - SET_ColorFragmentOp1ATI(exec, _mesa_ColorFragmentOp1ATI); - SET_ColorFragmentOp2ATI(exec, _mesa_ColorFragmentOp2ATI); - SET_ColorFragmentOp3ATI(exec, _mesa_ColorFragmentOp3ATI); - SET_AlphaFragmentOp1ATI(exec, _mesa_AlphaFragmentOp1ATI); - SET_AlphaFragmentOp2ATI(exec, _mesa_AlphaFragmentOp2ATI); - SET_AlphaFragmentOp3ATI(exec, _mesa_AlphaFragmentOp3ATI); - SET_SetFragmentShaderConstantATI(exec, _mesa_SetFragmentShaderConstantATI); -#endif - -#if FEATURE_EXT_framebuffer_object - SET_IsRenderbufferEXT(exec, _mesa_IsRenderbufferEXT); - SET_BindRenderbufferEXT(exec, _mesa_BindRenderbufferEXT); - SET_DeleteRenderbuffersEXT(exec, _mesa_DeleteRenderbuffersEXT); - SET_GenRenderbuffersEXT(exec, _mesa_GenRenderbuffersEXT); - SET_RenderbufferStorageEXT(exec, _mesa_RenderbufferStorageEXT); - SET_GetRenderbufferParameterivEXT(exec, _mesa_GetRenderbufferParameterivEXT); - SET_IsFramebufferEXT(exec, _mesa_IsFramebufferEXT); - SET_BindFramebufferEXT(exec, _mesa_BindFramebufferEXT); - SET_DeleteFramebuffersEXT(exec, _mesa_DeleteFramebuffersEXT); - SET_GenFramebuffersEXT(exec, _mesa_GenFramebuffersEXT); - SET_CheckFramebufferStatusEXT(exec, _mesa_CheckFramebufferStatusEXT); - SET_FramebufferTexture1DEXT(exec, _mesa_FramebufferTexture1DEXT); - SET_FramebufferTexture2DEXT(exec, _mesa_FramebufferTexture2DEXT); - SET_FramebufferTexture3DEXT(exec, _mesa_FramebufferTexture3DEXT); - SET_FramebufferRenderbufferEXT(exec, _mesa_FramebufferRenderbufferEXT); - SET_GetFramebufferAttachmentParameterivEXT(exec, _mesa_GetFramebufferAttachmentParameterivEXT); - SET_GenerateMipmapEXT(exec, _mesa_GenerateMipmapEXT); -#endif - -#if FEATURE_EXT_timer_query - SET_GetQueryObjecti64vEXT(exec, _mesa_GetQueryObjecti64vEXT); - SET_GetQueryObjectui64vEXT(exec, _mesa_GetQueryObjectui64vEXT); -#endif - -#if FEATURE_EXT_framebuffer_blit - SET_BlitFramebufferEXT(exec, _mesa_BlitFramebufferEXT); -#endif - - /* GL_EXT_gpu_program_parameters */ -#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program - SET_ProgramEnvParameters4fvEXT(exec, _mesa_ProgramEnvParameters4fvEXT); - SET_ProgramLocalParameters4fvEXT(exec, _mesa_ProgramLocalParameters4fvEXT); -#endif - - /* GL_MESA_texture_array / GL_EXT_texture_array */ -#if FEATURE_EXT_framebuffer_object - SET_FramebufferTextureLayerEXT(exec, _mesa_FramebufferTextureLayerEXT); -#endif - - /* GL_ATI_separate_stencil */ - SET_StencilFuncSeparateATI(exec, _mesa_StencilFuncSeparateATI); -} - - - -/**********************************************************************/ -/** \name State update logic */ -/*@{*/ static void @@ -951,13 +173,12 @@ update_arrays( GLcontext *ctx ) } -/** - * Update derived vertex/fragment program state. - */ static void update_program(GLcontext *ctx) { const struct gl_shader_program *shProg = ctx->Shader.CurrentProgram; + const struct gl_vertex_program *prevVP = ctx->VertexProgram._Current; + const struct gl_fragment_program *prevFP = ctx->FragmentProgram._Current; /* These _Enabled flags indicate if the program is enabled AND valid. */ ctx->VertexProgram._Enabled = ctx->VertexProgram.Enabled @@ -969,13 +190,18 @@ update_program(GLcontext *ctx) /* * Set the ctx->VertexProgram._Current and ctx->FragmentProgram._Current - * pointers to the programs that should be enabled/used. + * pointers to the programs that should be enabled/used. These will only + * be NULL if we need to use the fixed-function code. * * These programs may come from several sources. The priority is as * follows: * 1. OpenGL 2.0/ARB vertex/fragment shaders * 2. ARB/NV vertex/fragment programs * 3. Programs derived from fixed-function state. + * + * Note: it's possible for a vertex shader to get used with a fragment + * program (and vice versa) here, but in practice that shouldn't ever + * come up, or matter. */ _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._Current, NULL); @@ -991,23 +217,6 @@ update_program(GLcontext *ctx) shProg->FragmentProgram); } else { - if (ctx->VertexProgram._Enabled) { - /* use user-defined vertex program */ - _mesa_reference_vertprog(ctx, &ctx->VertexProgram._Current, - ctx->VertexProgram.Current); - } - else if (ctx->VertexProgram._MaintainTnlProgram) { - /* Use vertex program generated from fixed-function state. - * The _Current pointer will get set in - * _tnl_UpdateFixedFunctionProgram() later if appropriate. - */ - _mesa_reference_vertprog(ctx, &ctx->VertexProgram._Current, NULL); - } - else { - /* no vertex program */ - _mesa_reference_vertprog(ctx, &ctx->VertexProgram._Current, NULL); - } - if (ctx->FragmentProgram._Enabled) { /* use user-defined vertex program */ _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._Current, @@ -1015,29 +224,62 @@ update_program(GLcontext *ctx) } else if (ctx->FragmentProgram._MaintainTexEnvProgram) { /* Use fragment program generated from fixed-function state. - * The _Current pointer will get set in _mesa_UpdateTexEnvProgram() - * later if appropriate. */ - _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._Current, NULL); + _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._Current, + _mesa_get_fixed_func_fragment_program(ctx)); + _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._TexEnvProgram, + ctx->FragmentProgram._Current); } else { /* no fragment program */ _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._Current, NULL); } - } - - if (ctx->VertexProgram._Current) - assert(ctx->VertexProgram._Current->Base.Parameters); - if (ctx->FragmentProgram._Current) - assert(ctx->FragmentProgram._Current->Base.Parameters); + /* Examine vertex program after fragment program as + * _mesa_get_fixed_func_vertex_program() needs to know active + * fragprog inputs. + */ + if (ctx->VertexProgram._Enabled) { + /* use user-defined vertex program */ + _mesa_reference_vertprog(ctx, &ctx->VertexProgram._Current, + ctx->VertexProgram.Current); + } + else if (ctx->VertexProgram._MaintainTnlProgram) { + /* Use vertex program generated from fixed-function state. + */ + _mesa_reference_vertprog(ctx, &ctx->VertexProgram._Current, + _mesa_get_fixed_func_vertex_program(ctx)); + _mesa_reference_vertprog(ctx, &ctx->VertexProgram._TnlProgram, + ctx->VertexProgram._Current); + } + else { + /* no vertex program */ + _mesa_reference_vertprog(ctx, &ctx->VertexProgram._Current, NULL); + } + } + /* XXX: get rid of _Active flag. + */ +#if 1 ctx->FragmentProgram._Active = ctx->FragmentProgram._Enabled; if (ctx->FragmentProgram._MaintainTexEnvProgram && !ctx->FragmentProgram._Enabled) { if (ctx->FragmentProgram._UseTexEnvProgram) ctx->FragmentProgram._Active = GL_TRUE; } +#endif + + /* Let the driver know what's happening: + */ + if (ctx->FragmentProgram._Current != prevFP && ctx->Driver.BindProgram) { + ctx->Driver.BindProgram(ctx, GL_FRAGMENT_PROGRAM_ARB, + (struct gl_program *) ctx->FragmentProgram._Current); + } + + if (ctx->VertexProgram._Current != prevVP && ctx->Driver.BindProgram) { + ctx->Driver.BindProgram(ctx, GL_VERTEX_PROGRAM_ARB, + (struct gl_program *) ctx->VertexProgram._Current); + } } @@ -1067,10 +309,10 @@ static void update_multisample(GLcontext *ctx) { ctx->Multisample._Enabled = GL_FALSE; - if (ctx->DrawBuffer) { - if (ctx->DrawBuffer->Visual.sampleBuffers) - ctx->Multisample._Enabled = GL_TRUE; - } + if (ctx->Multisample.Enabled && + ctx->DrawBuffer && + ctx->DrawBuffer->Visual.sampleBuffers) + ctx->Multisample._Enabled = GL_TRUE; } @@ -1197,13 +439,11 @@ void _mesa_update_state_locked( GLcontext *ctx ) { GLbitfield new_state = ctx->NewState; + GLbitfield prog_flags = _NEW_PROGRAM; if (MESA_VERBOSE & VERBOSE_STATE) _mesa_print_state("_mesa_update_state", new_state); - if (new_state & _NEW_PROGRAM) - update_program( ctx ); - if (new_state & (_NEW_MODELVIEW|_NEW_PROJECTION)) _mesa_update_modelview_project( ctx, new_state ); @@ -1225,8 +465,10 @@ _mesa_update_state_locked( GLcontext *ctx ) if (new_state & _NEW_STENCIL) _mesa_update_stencil( ctx ); +#if FEATURE_pixel_transfer if (new_state & _IMAGE_NEW_TRANSFER_STATE) _mesa_update_pixel( ctx, new_state ); +#endif if (new_state & _DD_NEW_SEPARATE_SPECULAR) update_separate_specular( ctx ); @@ -1249,11 +491,6 @@ _mesa_update_state_locked( GLcontext *ctx ) update_tricaps( ctx, new_state ); #endif - if (ctx->FragmentProgram._MaintainTexEnvProgram) { - if (new_state & (_NEW_TEXTURE | _DD_NEW_SEPARATE_SPECULAR | _NEW_FOG)) - _mesa_UpdateTexEnvProgram(ctx); - } - /* ctx->_NeedEyeCoords is now up to date. * * If the truth value of this variable has changed, update for the @@ -1266,6 +503,20 @@ _mesa_update_state_locked( GLcontext *ctx ) if (new_state & _MESA_NEW_NEED_EYE_COORDS) _mesa_update_tnl_spaces( ctx, new_state ); + if (ctx->FragmentProgram._MaintainTexEnvProgram) { + prog_flags |= (_NEW_TEXTURE | _NEW_FOG | _DD_NEW_SEPARATE_SPECULAR); + } + if (ctx->VertexProgram._MaintainTnlProgram) { + prog_flags |= (_NEW_ARRAY | _NEW_TEXTURE | _NEW_TEXTURE_MATRIX | + _NEW_TRANSFORM | _NEW_POINT | + _NEW_FOG | _NEW_LIGHT | + _MESA_NEW_NEED_EYE_COORDS); + } + if (new_state & prog_flags) + update_program( ctx ); + + + /* * Give the driver a chance to act upon the new_state flags. * The driver might plug in different span functions, for example. @@ -1291,9 +542,3 @@ _mesa_update_state( GLcontext *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 5240d4bf93..bb7cb8f32a 100644 --- a/src/mesa/main/state.h +++ b/src/mesa/main/state.h @@ -1,13 +1,8 @@ -/** - * \file state.h - * State management. - */ - /* * Mesa 3-D graphics library - * Version: 6.3 + * Version: 7.1 * - * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2008 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"), @@ -34,9 +29,6 @@ #include "mtypes.h" extern void -_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 diff --git a/src/mesa/main/texenv.c b/src/mesa/main/texenv.c new file mode 100644 index 0000000000..e072cea136 --- /dev/null +++ b/src/mesa/main/texenv.c @@ -0,0 +1,861 @@ +/* + * Mesa 3-D graphics library + * Version: 7.1 + * + * Copyright (C) 1999-2008 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 texenv.c + * + * glTexEnv-related functions + */ + + +#include "main/glheader.h" +#include "main/context.h" +#include "main/enums.h" +#include "main/macros.h" +#include "main/texenv.h" +#include "math/m_xform.h" + + + +void GLAPIENTRY +_mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param ) +{ + GLuint maxUnit; + GET_CURRENT_CONTEXT(ctx); + struct gl_texture_unit *texUnit; + ASSERT_OUTSIDE_BEGIN_END(ctx); + + maxUnit = (target == GL_POINT_SPRITE_NV && pname == GL_COORD_REPLACE_NV) + ? ctx->Const.MaxTextureCoordUnits : ctx->Const.MaxTextureImageUnits; + if (ctx->Texture.CurrentUnit >= maxUnit) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glTexEnvfv(current unit)"); + return; + } + + texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; + +#define TE_ERROR(errCode, msg, value) \ + _mesa_error(ctx, errCode, msg, _mesa_lookup_enum_by_nr(value)); + + if (target == GL_TEXTURE_ENV) { + switch (pname) { + case GL_TEXTURE_ENV_MODE: + { + GLenum mode = (GLenum) (GLint) *param; + if (mode == GL_REPLACE_EXT) + mode = GL_REPLACE; + if (texUnit->EnvMode == mode) + return; + if (mode == GL_MODULATE || + mode == GL_BLEND || + mode == GL_DECAL || + mode == GL_REPLACE || + (mode == GL_ADD && ctx->Extensions.EXT_texture_env_add) || + (mode == GL_COMBINE && + (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine))) { + /* legal */ + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texUnit->EnvMode = mode; + } + else { + TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode); + return; + } + } + break; + case GL_TEXTURE_ENV_COLOR: + { + GLfloat tmp[4]; + tmp[0] = CLAMP( param[0], 0.0F, 1.0F ); + tmp[1] = CLAMP( param[1], 0.0F, 1.0F ); + tmp[2] = CLAMP( param[2], 0.0F, 1.0F ); + tmp[3] = CLAMP( param[3], 0.0F, 1.0F ); + if (TEST_EQ_4V(tmp, texUnit->EnvColor)) + return; + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + COPY_4FV(texUnit->EnvColor, tmp); + } + break; + case GL_COMBINE_RGB: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + const GLenum mode = (GLenum) (GLint) *param; + if (texUnit->Combine.ModeRGB == mode) + return; + switch (mode) { + case GL_REPLACE: + case GL_MODULATE: + case GL_ADD: + case GL_ADD_SIGNED: + case GL_INTERPOLATE: + /* OK */ + break; + case GL_SUBTRACT: + if (!ctx->Extensions.ARB_texture_env_combine) { + TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode); + return; + } + break; + case GL_DOT3_RGB_EXT: + case GL_DOT3_RGBA_EXT: + if (!ctx->Extensions.EXT_texture_env_dot3) { + TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode); + return; + } + break; + case GL_DOT3_RGB: + case GL_DOT3_RGBA: + if (!ctx->Extensions.ARB_texture_env_dot3) { + TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode); + return; + } + break; + case GL_MODULATE_ADD_ATI: + case GL_MODULATE_SIGNED_ADD_ATI: + case GL_MODULATE_SUBTRACT_ATI: + if (!ctx->Extensions.ATI_texture_env_combine3) { + TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode); + return; + } + break; + default: + TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode); + return; + } + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texUnit->Combine.ModeRGB = mode; + } + else { + TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); + return; + } + break; + case GL_COMBINE_ALPHA: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + const GLenum mode = (GLenum) (GLint) *param; + if (texUnit->Combine.ModeA == mode) + return; + switch (mode) { + case GL_REPLACE: + case GL_MODULATE: + case GL_ADD: + case GL_ADD_SIGNED: + case GL_INTERPOLATE: + /* OK */ + break; + case GL_SUBTRACT: + if (!ctx->Extensions.ARB_texture_env_combine) { + TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode); + return; + } + break; + case GL_MODULATE_ADD_ATI: + case GL_MODULATE_SIGNED_ADD_ATI: + case GL_MODULATE_SUBTRACT_ATI: + if (!ctx->Extensions.ATI_texture_env_combine3) { + TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode); + return; + } + break; + default: + TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode); + return; + } + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texUnit->Combine.ModeA = mode; + } + else { + TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); + return; + } + break; + case GL_SOURCE0_RGB: + case GL_SOURCE1_RGB: + case GL_SOURCE2_RGB: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + const GLenum source = (GLenum) (GLint) *param; + const GLuint s = pname - GL_SOURCE0_RGB; + if (texUnit->Combine.SourceRGB[s] == source) + return; + if (source == GL_TEXTURE || + source == GL_CONSTANT || + source == GL_PRIMARY_COLOR || + source == GL_PREVIOUS || + (ctx->Extensions.ARB_texture_env_crossbar && + source >= GL_TEXTURE0 && + source < GL_TEXTURE0 + ctx->Const.MaxTextureUnits) || + (ctx->Extensions.ATI_texture_env_combine3 && + (source == GL_ZERO || source == GL_ONE))) { + /* legal */ + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texUnit->Combine.SourceRGB[s] = source; + } + else { + TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", source); + return; + } + } + else { + TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); + return; + } + break; + case GL_SOURCE0_ALPHA: + case GL_SOURCE1_ALPHA: + case GL_SOURCE2_ALPHA: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + const GLenum source = (GLenum) (GLint) *param; + const GLuint s = pname - GL_SOURCE0_ALPHA; + if (texUnit->Combine.SourceA[s] == source) + return; + if (source == GL_TEXTURE || + source == GL_CONSTANT || + source == GL_PRIMARY_COLOR || + source == GL_PREVIOUS || + (ctx->Extensions.ARB_texture_env_crossbar && + source >= GL_TEXTURE0 && + source < GL_TEXTURE0 + ctx->Const.MaxTextureUnits) || + (ctx->Extensions.ATI_texture_env_combine3 && + (source == GL_ZERO || source == GL_ONE))) { + /* legal */ + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texUnit->Combine.SourceA[s] = source; + } + else { + TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", source); + return; + } + } + else { + TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); + return; + } + break; + case GL_OPERAND0_RGB: + case GL_OPERAND1_RGB: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + const GLenum operand = (GLenum) (GLint) *param; + const GLuint s = pname - GL_OPERAND0_RGB; + if (texUnit->Combine.OperandRGB[s] == operand) + return; + switch (operand) { + case GL_SRC_COLOR: + case GL_ONE_MINUS_SRC_COLOR: + case GL_SRC_ALPHA: + case GL_ONE_MINUS_SRC_ALPHA: + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texUnit->Combine.OperandRGB[s] = operand; + break; + default: + TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", operand); + return; + } + } + else { + TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); + return; + } + break; + case GL_OPERAND0_ALPHA: + case GL_OPERAND1_ALPHA: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + const GLenum operand = (GLenum) (GLint) *param; + if (texUnit->Combine.OperandA[pname-GL_OPERAND0_ALPHA] == operand) + return; + switch (operand) { + case GL_SRC_ALPHA: + case GL_ONE_MINUS_SRC_ALPHA: + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texUnit->Combine.OperandA[pname-GL_OPERAND0_ALPHA] = operand; + break; + default: + TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", operand); + return; + } + } + else { + TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); + return; + } + break; + case GL_OPERAND2_RGB: + if (ctx->Extensions.ARB_texture_env_combine) { + const GLenum operand = (GLenum) (GLint) *param; + if (texUnit->Combine.OperandRGB[2] == operand) + return; + switch (operand) { + case GL_SRC_COLOR: /* ARB combine only */ + case GL_ONE_MINUS_SRC_COLOR: /* ARB combine only */ + case GL_SRC_ALPHA: + case GL_ONE_MINUS_SRC_ALPHA: /* ARB combine only */ + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texUnit->Combine.OperandRGB[2] = operand; + break; + default: + TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", operand); + return; + } + } + else if (ctx->Extensions.EXT_texture_env_combine) { + const GLenum operand = (GLenum) (GLint) *param; + if (texUnit->Combine.OperandRGB[2] == operand) + return; + /* operand must be GL_SRC_ALPHA which is the initial value - thus + don't need to actually compare the operand to the possible value */ + else { + TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", operand); + return; + } + } + else { + TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); + return; + } + break; + case GL_OPERAND2_ALPHA: + if (ctx->Extensions.ARB_texture_env_combine) { + const GLenum operand = (GLenum) (GLint) *param; + if (texUnit->Combine.OperandA[2] == operand) + return; + switch (operand) { + case GL_SRC_ALPHA: + case GL_ONE_MINUS_SRC_ALPHA: /* ARB combine only */ + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texUnit->Combine.OperandA[2] = operand; + break; + default: + TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", operand); + return; + } + } + else if (ctx->Extensions.EXT_texture_env_combine) { + const GLenum operand = (GLenum) (GLint) *param; + if (texUnit->Combine.OperandA[2] == operand) + return; + /* operand must be GL_SRC_ALPHA which is the initial value - thus + don't need to actually compare the operand to the possible value */ + else { + TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", operand); + return; + } + } + else { + TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); + return; + } + break; + case GL_RGB_SCALE: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + GLuint newshift; + if (*param == 1.0) { + newshift = 0; + } + else if (*param == 2.0) { + newshift = 1; + } + else if (*param == 4.0) { + newshift = 2; + } + else { + _mesa_error( ctx, GL_INVALID_VALUE, + "glTexEnv(GL_RGB_SCALE not 1, 2 or 4)" ); + return; + } + if (texUnit->Combine.ScaleShiftRGB == newshift) + return; + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texUnit->Combine.ScaleShiftRGB = newshift; + } + else { + TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); + return; + } + break; + case GL_ALPHA_SCALE: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + GLuint newshift; + if (*param == 1.0) { + newshift = 0; + } + else if (*param == 2.0) { + newshift = 1; + } + else if (*param == 4.0) { + newshift = 2; + } + else { + _mesa_error( ctx, GL_INVALID_VALUE, + "glTexEnv(GL_ALPHA_SCALE not 1, 2 or 4)" ); + return; + } + if (texUnit->Combine.ScaleShiftA == newshift) + return; + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texUnit->Combine.ScaleShiftA = newshift; + } + else { + TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); + return; + } + break; + default: + _mesa_error( ctx, GL_INVALID_ENUM, "glTexEnv(pname)" ); + return; + } + } + else if (target == GL_TEXTURE_FILTER_CONTROL_EXT) { + /* GL_EXT_texture_lod_bias */ + if (!ctx->Extensions.EXT_texture_lod_bias) { + _mesa_error( ctx, GL_INVALID_ENUM, "glTexEnv(target=0x%x)", target ); + return; + } + if (pname == GL_TEXTURE_LOD_BIAS_EXT) { + if (texUnit->LodBias == param[0]) + return; + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texUnit->LodBias = param[0]; + } + else { + TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); + return; + } + } + else if (target == GL_POINT_SPRITE_NV) { + /* GL_ARB_point_sprite / GL_NV_point_sprite */ + if (!ctx->Extensions.NV_point_sprite + && !ctx->Extensions.ARB_point_sprite) { + _mesa_error( ctx, GL_INVALID_ENUM, "glTexEnv(target=0x%x)", target ); + return; + } + if (pname == GL_COORD_REPLACE_NV) { + const GLenum value = (GLenum) param[0]; + if (value == GL_TRUE || value == GL_FALSE) { + /* It's kind of weird to set point state via glTexEnv, + * but that's what the spec calls for. + */ + const GLboolean state = (GLboolean) value; + if (ctx->Point.CoordReplace[ctx->Texture.CurrentUnit] == state) + return; + FLUSH_VERTICES(ctx, _NEW_POINT); + ctx->Point.CoordReplace[ctx->Texture.CurrentUnit] = state; + } + else { + _mesa_error( ctx, GL_INVALID_VALUE, "glTexEnv(param=0x%x)", value); + return; + } + } + else { + _mesa_error( ctx, GL_INVALID_ENUM, "glTexEnv(pname=0x%x)", pname ); + return; + } + } + else { + _mesa_error( ctx, GL_INVALID_ENUM, "glTexEnv(target=0x%x)",target ); + return; + } + + if (MESA_VERBOSE&(VERBOSE_API|VERBOSE_TEXTURE)) + _mesa_debug(ctx, "glTexEnv %s %s %.1f(%s) ...\n", + _mesa_lookup_enum_by_nr(target), + _mesa_lookup_enum_by_nr(pname), + *param, + _mesa_lookup_enum_by_nr((GLenum) (GLint) *param)); + + /* Tell device driver about the new texture environment */ + if (ctx->Driver.TexEnv) { + (*ctx->Driver.TexEnv)( ctx, target, pname, param ); + } +} + + +void GLAPIENTRY +_mesa_TexEnvf( GLenum target, GLenum pname, GLfloat param ) +{ + _mesa_TexEnvfv( target, pname, ¶m ); +} + + + +void GLAPIENTRY +_mesa_TexEnvi( GLenum target, GLenum pname, GLint param ) +{ + GLfloat p[4]; + p[0] = (GLfloat) param; + p[1] = p[2] = p[3] = 0.0; + _mesa_TexEnvfv( target, pname, p ); +} + + +void GLAPIENTRY +_mesa_TexEnviv( GLenum target, GLenum pname, const GLint *param ) +{ + GLfloat p[4]; + if (pname == GL_TEXTURE_ENV_COLOR) { + p[0] = INT_TO_FLOAT( param[0] ); + p[1] = INT_TO_FLOAT( param[1] ); + p[2] = INT_TO_FLOAT( param[2] ); + p[3] = INT_TO_FLOAT( param[3] ); + } + else { + p[0] = (GLfloat) param[0]; + p[1] = p[2] = p[3] = 0; /* init to zero, just to be safe */ + } + _mesa_TexEnvfv( target, pname, p ); +} + + +void GLAPIENTRY +_mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params ) +{ + GLuint maxUnit; + const struct gl_texture_unit *texUnit; + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END(ctx); + + maxUnit = (target == GL_POINT_SPRITE_NV && pname == GL_COORD_REPLACE_NV) + ? ctx->Const.MaxTextureCoordUnits : ctx->Const.MaxTextureImageUnits; + if (ctx->Texture.CurrentUnit >= maxUnit) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexEnvfv(current unit)"); + return; + } + + texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; + + if (target == GL_TEXTURE_ENV) { + switch (pname) { + case GL_TEXTURE_ENV_MODE: + *params = ENUM_TO_FLOAT(texUnit->EnvMode); + break; + case GL_TEXTURE_ENV_COLOR: + COPY_4FV( params, texUnit->EnvColor ); + break; + case GL_COMBINE_RGB: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + *params = (GLfloat) texUnit->Combine.ModeRGB; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); + } + break; + case GL_COMBINE_ALPHA: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + *params = (GLfloat) texUnit->Combine.ModeA; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); + } + break; + case GL_SOURCE0_RGB: + case GL_SOURCE1_RGB: + case GL_SOURCE2_RGB: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + const unsigned rgb_idx = pname - GL_SOURCE0_RGB; + *params = (GLfloat) texUnit->Combine.SourceRGB[rgb_idx]; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); + } + break; + case GL_SOURCE0_ALPHA: + case GL_SOURCE1_ALPHA: + case GL_SOURCE2_ALPHA: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + const unsigned alpha_idx = pname - GL_SOURCE0_ALPHA; + *params = (GLfloat) texUnit->Combine.SourceA[alpha_idx]; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); + } + break; + case GL_OPERAND0_RGB: + case GL_OPERAND1_RGB: + case GL_OPERAND2_RGB: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + const unsigned op_rgb = pname - GL_OPERAND0_RGB; + *params = (GLfloat) texUnit->Combine.OperandRGB[op_rgb]; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); + } + break; + case GL_OPERAND0_ALPHA: + case GL_OPERAND1_ALPHA: + case GL_OPERAND2_ALPHA: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + const unsigned op_alpha = pname - GL_OPERAND0_ALPHA; + *params = (GLfloat) texUnit->Combine.OperandA[op_alpha]; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); + } + break; + case GL_RGB_SCALE: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + if (texUnit->Combine.ScaleShiftRGB == 0) + *params = 1.0; + else if (texUnit->Combine.ScaleShiftRGB == 1) + *params = 2.0; + else + *params = 4.0; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); + return; + } + break; + case GL_ALPHA_SCALE: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + if (texUnit->Combine.ScaleShiftA == 0) + *params = 1.0; + else if (texUnit->Combine.ScaleShiftA == 1) + *params = 2.0; + else + *params = 4.0; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); + return; + } + break; + default: + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname=0x%x)", pname); + } + } + else if (target == GL_TEXTURE_FILTER_CONTROL_EXT) { + /* GL_EXT_texture_lod_bias */ + if (!ctx->Extensions.EXT_texture_lod_bias) { + _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnvfv(target)" ); + return; + } + if (pname == GL_TEXTURE_LOD_BIAS_EXT) { + *params = texUnit->LodBias; + } + else { + _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)" ); + return; + } + } + else if (target == GL_POINT_SPRITE_NV) { + /* GL_ARB_point_sprite / GL_NV_point_sprite */ + if (!ctx->Extensions.NV_point_sprite + && !ctx->Extensions.ARB_point_sprite) { + _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnvfv(target)" ); + return; + } + if (pname == GL_COORD_REPLACE_NV) { + *params = (GLfloat) ctx->Point.CoordReplace[ctx->Texture.CurrentUnit]; + } + else { + _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)" ); + return; + } + } + else { + _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnvfv(target)" ); + return; + } +} + + +void GLAPIENTRY +_mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params ) +{ + GLuint maxUnit; + const struct gl_texture_unit *texUnit; + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END(ctx); + + maxUnit = (target == GL_POINT_SPRITE_NV && pname == GL_COORD_REPLACE_NV) + ? ctx->Const.MaxTextureCoordUnits : ctx->Const.MaxTextureImageUnits; + if (ctx->Texture.CurrentUnit >= maxUnit) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexEnviv(current unit)"); + return; + } + + texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; + + if (target == GL_TEXTURE_ENV) { + switch (pname) { + case GL_TEXTURE_ENV_MODE: + *params = (GLint) texUnit->EnvMode; + break; + case GL_TEXTURE_ENV_COLOR: + params[0] = FLOAT_TO_INT( texUnit->EnvColor[0] ); + params[1] = FLOAT_TO_INT( texUnit->EnvColor[1] ); + params[2] = FLOAT_TO_INT( texUnit->EnvColor[2] ); + params[3] = FLOAT_TO_INT( texUnit->EnvColor[3] ); + break; + case GL_COMBINE_RGB: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + *params = (GLint) texUnit->Combine.ModeRGB; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); + } + break; + case GL_COMBINE_ALPHA: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + *params = (GLint) texUnit->Combine.ModeA; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); + } + break; + case GL_SOURCE0_RGB: + case GL_SOURCE1_RGB: + case GL_SOURCE2_RGB: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + const unsigned rgb_idx = pname - GL_SOURCE0_RGB; + *params = (GLint) texUnit->Combine.SourceRGB[rgb_idx]; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); + } + break; + case GL_SOURCE0_ALPHA: + case GL_SOURCE1_ALPHA: + case GL_SOURCE2_ALPHA: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + const unsigned alpha_idx = pname - GL_SOURCE0_ALPHA; + *params = (GLint) texUnit->Combine.SourceA[alpha_idx]; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); + } + break; + case GL_OPERAND0_RGB: + case GL_OPERAND1_RGB: + case GL_OPERAND2_RGB: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + const unsigned op_rgb = pname - GL_OPERAND0_RGB; + *params = (GLint) texUnit->Combine.OperandRGB[op_rgb]; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); + } + break; + case GL_OPERAND0_ALPHA: + case GL_OPERAND1_ALPHA: + case GL_OPERAND2_ALPHA: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + const unsigned op_alpha = pname - GL_OPERAND0_ALPHA; + *params = (GLint) texUnit->Combine.OperandA[op_alpha]; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); + } + break; + case GL_RGB_SCALE: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + if (texUnit->Combine.ScaleShiftRGB == 0) + *params = 1; + else if (texUnit->Combine.ScaleShiftRGB == 1) + *params = 2; + else + *params = 4; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); + return; + } + break; + case GL_ALPHA_SCALE: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + if (texUnit->Combine.ScaleShiftA == 0) + *params = 1; + else if (texUnit->Combine.ScaleShiftA == 1) + *params = 2; + else + *params = 4; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); + return; + } + break; + default: + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname=0x%x)", + pname); + } + } + else if (target == GL_TEXTURE_FILTER_CONTROL_EXT) { + /* GL_EXT_texture_lod_bias */ + if (!ctx->Extensions.EXT_texture_lod_bias) { + _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnviv(target)" ); + return; + } + if (pname == GL_TEXTURE_LOD_BIAS_EXT) { + *params = (GLint) texUnit->LodBias; + } + else { + _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)" ); + return; + } + } + else if (target == GL_POINT_SPRITE_NV) { + /* GL_ARB_point_sprite / GL_NV_point_sprite */ + if (!ctx->Extensions.NV_point_sprite + && !ctx->Extensions.ARB_point_sprite) { + _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnviv(target)" ); + return; + } + if (pname == GL_COORD_REPLACE_NV) { + *params = (GLint) ctx->Point.CoordReplace[ctx->Texture.CurrentUnit]; + } + else { + _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)" ); + return; + } + } + else { + _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnviv(target)" ); + return; + } +} + + diff --git a/src/mesa/main/texenv.h b/src/mesa/main/texenv.h new file mode 100644 index 0000000000..bdff7fdb82 --- /dev/null +++ b/src/mesa/main/texenv.h @@ -0,0 +1,52 @@ +/* + * Mesa 3-D graphics library + * Version: 7.1 + * + * Copyright (C) 1999-2008 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 TEXENV_H +#define TEXENV_H + + +#include "main/glheader.h" + + +extern void GLAPIENTRY +_mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params ); + +extern void GLAPIENTRY +_mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params ); + +extern void GLAPIENTRY +_mesa_TexEnvf( GLenum target, GLenum pname, GLfloat param ); + +extern void GLAPIENTRY +_mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param ); + +extern void GLAPIENTRY +_mesa_TexEnvi( GLenum target, GLenum pname, GLint param ); + +extern void GLAPIENTRY +_mesa_TexEnviv( GLenum target, GLenum pname, const GLint *param ); + + +#endif /* TEXENV_H */ diff --git a/src/mesa/main/texenvprogram.c b/src/mesa/main/texenvprogram.c index 512d52704d..dcd7f90567 100644 --- a/src/mesa/main/texenvprogram.c +++ b/src/mesa/main/texenvprogram.c @@ -1,6 +1,6 @@ /************************************************************************** * - * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. + * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a @@ -30,9 +30,11 @@ #include "enums.h" #include "shader/program.h" #include "shader/prog_parameter.h" +#include "shader/prog_cache.h" #include "shader/prog_instruction.h" #include "shader/prog_print.h" #include "shader/prog_statevars.h" +#include "shader/programopt.h" #include "texenvprogram.h" @@ -411,9 +413,9 @@ static struct ureg get_tex_temp( struct texenv_fragment_program *p ) } -static void release_temps( struct texenv_fragment_program *p ) +static void release_temps(GLcontext *ctx, struct texenv_fragment_program *p ) { - GLuint max_temp = p->ctx->Const.FragmentProgram.MaxTemps; + GLuint max_temp = ctx->Const.FragmentProgram.MaxTemps; /* KW: To support tex_env_crossbar, don't release the registers in * temps_output. @@ -593,7 +595,7 @@ static struct ureg register_const4f( struct texenv_fragment_program *p, idx = _mesa_add_unnamed_constant( p->program->Base.Parameters, values, 4, &swizzle ); ASSERT(swizzle == SWIZZLE_NOOP); - return make_ureg(PROGRAM_STATE_VAR, idx); + return make_ureg(PROGRAM_CONSTANT, idx); } #define register_scalar_const(p, s0) register_const4f(p, s0, s0, s0, s0) @@ -915,14 +917,14 @@ emit_texenv(struct texenv_fragment_program *p, GLuint unit) */ if (alpha_shift || rgb_shift) { if (rgb_shift == alpha_shift) { - shift = register_scalar_const(p, 1<<rgb_shift); + shift = register_scalar_const(p, (GLfloat)(1<<rgb_shift)); } else { shift = register_const4f(p, - 1<<rgb_shift, - 1<<rgb_shift, - 1<<rgb_shift, - 1<<alpha_shift); + (GLfloat)(1<<rgb_shift), + (GLfloat)(1<<rgb_shift), + (GLfloat)(1<<rgb_shift), + (GLfloat)(1<<alpha_shift)); } return emit_arith( p, OPCODE_MUL, dest, WRITEMASK_XYZW, saturate, out, shift, undef ); @@ -953,7 +955,14 @@ static void load_texture( struct texenv_fragment_program *p, GLuint unit ) unit, dim, texcoord ); if (p->state->unit[unit].shadow) p->program->Base.ShadowSamplers |= 1 << unit; - } else + + p->program->Base.SamplersUsed |= (1 << unit); + /* This identity mapping should already be in place + * (see _mesa_init_program_struct()) but let's be safe. + */ + p->program->Base.SamplerUnits[unit] = unit; + } + else p->src_texture[unit] = get_zero(p); } } @@ -1051,7 +1060,7 @@ create_new_program(GLcontext *ctx, struct state_key *key, p.one = undef; p.last_tex_stage = 0; - release_temps(&p); + release_temps(ctx, &p); if (key->enabled_units) { /* First pass - to support texture_env_crossbar, first identify @@ -1069,7 +1078,7 @@ create_new_program(GLcontext *ctx, struct state_key *key, for (unit = 0 ; unit < ctx->Const.MaxTextureUnits; unit++) if (key->enabled_units & (1<<unit)) { p.src_previous = emit_texenv( &p, unit ); - release_temps(&p); /* release all temps */ + release_temps(ctx, &p); /* release all temps */ } } @@ -1099,6 +1108,7 @@ create_new_program(GLcontext *ctx, struct state_key *key, * a reduced value and not what is expected in FogOption */ p.program->FogOption = ctx->Fog.Mode; + p.program->Base.InputsRead |= FRAG_BIT_FOGC; /* XXX new */ } else p.program->FogOption = GL_NONE; @@ -1114,15 +1124,21 @@ create_new_program(GLcontext *ctx, struct state_key *key, ASSERT(p.program->Base.NumInstructions <= MAX_INSTRUCTIONS); /* Allocate final instruction array */ - program->Base.Instructions - = _mesa_alloc_instructions(program->Base.NumInstructions); - if (!program->Base.Instructions) { + p.program->Base.Instructions + = _mesa_alloc_instructions(p.program->Base.NumInstructions); + if (!p.program->Base.Instructions) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "generating tex env program"); return; } - _mesa_copy_instructions(program->Base.Instructions, instBuffer, - program->Base.NumInstructions); + _mesa_copy_instructions(p.program->Base.Instructions, instBuffer, + p.program->Base.NumInstructions); + + if (p.program->FogOption) { + _mesa_append_fog_code(ctx, p.program); + p.program->FogOption = GL_NONE; + } + /* Notify driver the fragment program has (actually) changed. */ @@ -1138,106 +1154,35 @@ create_new_program(GLcontext *ctx, struct state_key *key, } -static struct gl_fragment_program * -search_cache(const struct texenvprog_cache *cache, - GLuint hash, - const void *key, - GLuint keysize) -{ - struct texenvprog_cache_item *c; - - for (c = cache->items[hash % cache->size]; c; c = c->next) { - if (c->hash == hash && memcmp(c->key, key, keysize) == 0) - return c->data; - } - - return NULL; -} - -static void rehash( struct texenvprog_cache *cache ) -{ - struct texenvprog_cache_item **items; - struct texenvprog_cache_item *c, *next; - GLuint size, i; - - size = cache->size * 3; - items = (struct texenvprog_cache_item**) _mesa_malloc(size * sizeof(*items)); - _mesa_memset(items, 0, size * sizeof(*items)); - - for (i = 0; i < cache->size; i++) - for (c = cache->items[i]; c; c = next) { - next = c->next; - c->next = items[c->hash % size]; - items[c->hash % size] = c; - } - - _mesa_free(cache->items); - cache->items = items; - cache->size = size; -} - -static void clear_cache(GLcontext *ctx, struct texenvprog_cache *cache) -{ - struct texenvprog_cache_item *c, *next; - GLuint i; - - for (i = 0; i < cache->size; i++) { - for (c = cache->items[i]; c; c = next) { - next = c->next; - _mesa_free(c->key); - _mesa_reference_fragprog(ctx, &c->data, NULL); - _mesa_free(c); - } - cache->items[i] = NULL; - } - - - cache->n_items = 0; -} - - -static void cache_item( GLcontext *ctx, - struct texenvprog_cache *cache, - GLuint hash, - const struct state_key *key, - struct gl_fragment_program *prog) +/** + * Return a fragment program which implements the current + * fixed-function texture, fog and color-sum operations. + */ +struct gl_fragment_program * +_mesa_get_fixed_func_fragment_program(GLcontext *ctx) { - struct texenvprog_cache_item *c = CALLOC_STRUCT(texenvprog_cache_item); - c->hash = hash; + struct gl_fragment_program *prog; + struct state_key key; + + make_state_key(ctx, &key); + + prog = (struct gl_fragment_program *) + _mesa_search_program_cache(ctx->FragmentProgram.Cache, + &key, sizeof(key)); - c->key = _mesa_malloc(sizeof(*key)); - memcpy(c->key, key, sizeof(*key)); + if (!prog) { + prog = (struct gl_fragment_program *) + ctx->Driver.NewProgram(ctx, GL_FRAGMENT_PROGRAM_ARB, 0); - c->data = prog; + create_new_program(ctx, &key, prog); - if (cache->n_items > cache->size * 1.5) { - if (cache->size < 1000) - rehash(cache); - else - clear_cache(ctx, cache); + _mesa_program_cache_insert(ctx, ctx->FragmentProgram.Cache, + &key, sizeof(key), &prog->Base); } - cache->n_items++; - c->next = cache->items[hash % cache->size]; - cache->items[hash % cache->size] = c; + return prog; } -static GLuint hash_key( const struct state_key *key ) -{ - GLuint *ikey = (GLuint *)key; - GLuint hash = 0, i; - - /* Make a slightly better attempt at a hash function: - */ - for (i = 0; i < sizeof(*key)/sizeof(*ikey); i++) - { - hash += ikey[i]; - hash += (hash << 10); - hash ^= (hash >> 6); - } - - return hash; -} /** @@ -1248,44 +1193,22 @@ static GLuint hash_key( const struct state_key *key ) void _mesa_UpdateTexEnvProgram( GLcontext *ctx ) { - struct state_key key; - GLuint hash; const struct gl_fragment_program *prev = ctx->FragmentProgram._Current; ASSERT(ctx->FragmentProgram._MaintainTexEnvProgram); /* If a conventional fragment program/shader isn't in effect... */ if (!ctx->FragmentProgram._Enabled && - (!ctx->Shader.CurrentProgram || !ctx->Shader.CurrentProgram->FragmentProgram)) { + (!ctx->Shader.CurrentProgram || + !ctx->Shader.CurrentProgram->FragmentProgram) ) + { struct gl_fragment_program *newProg; - make_state_key(ctx, &key); - hash = hash_key(&key); - - newProg = search_cache(&ctx->Texture.env_fp_cache, hash, &key, sizeof(key)); - - if (!newProg) { - /* create new tex env program */ - - if (0) - _mesa_printf("Building new texenv proggy for key %x\n", hash); - - newProg = (struct gl_fragment_program *) - ctx->Driver.NewProgram(ctx, GL_FRAGMENT_PROGRAM_ARB, 0); - - create_new_program(ctx, &key, newProg); - - /* Our ownership of newProg is transferred to the cache */ - cache_item(ctx, &ctx->Texture.env_fp_cache, hash, &key, newProg); - } + newProg = _mesa_get_fixed_func_fragment_program(ctx); _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._Current, newProg); _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._TexEnvProgram, newProg); } - else { - /* _Current pointer has been updated in update_program */ - /* ctx->FragmentProgram._Current = ctx->FragmentProgram.Current; */ - } /* Tell the driver about the change. Could define a new target for * this? @@ -1295,21 +1218,3 @@ _mesa_UpdateTexEnvProgram( GLcontext *ctx ) (struct gl_program *) ctx->FragmentProgram._Current); } } - - -void _mesa_TexEnvProgramCacheInit( GLcontext *ctx ) -{ - ctx->Texture.env_fp_cache.ctx = ctx; - ctx->Texture.env_fp_cache.size = 17; - ctx->Texture.env_fp_cache.n_items = 0; - ctx->Texture.env_fp_cache.items = (struct texenvprog_cache_item **) - _mesa_calloc(ctx->Texture.env_fp_cache.size * - sizeof(struct texenvprog_cache_item)); -} - - -void _mesa_TexEnvProgramCacheDestroy( GLcontext *ctx ) -{ - clear_cache(ctx, &ctx->Texture.env_fp_cache); - _mesa_free(ctx->Texture.env_fp_cache.items); -} diff --git a/src/mesa/main/texenvprogram.h b/src/mesa/main/texenvprogram.h index 6f017767c8..a7aa60cf37 100644 --- a/src/mesa/main/texenvprogram.h +++ b/src/mesa/main/texenvprogram.h @@ -1,13 +1,8 @@ -/** - * \file texenvprogram.h - * Texture state management. - */ - /* * Mesa 3-D graphics library - * Version: 5.1 + * Version: 7.1 * - * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2007 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"), @@ -34,8 +29,9 @@ #include "mtypes.h" +extern struct gl_fragment_program * +_mesa_get_fixed_func_fragment_program(GLcontext *ctx); + extern void _mesa_UpdateTexEnvProgram( GLcontext *ctx ); -extern void _mesa_TexEnvProgramCacheInit( GLcontext *ctx ); -extern void _mesa_TexEnvProgramCacheDestroy( GLcontext *ctx ); #endif diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c index acc268e622..d4ccdf9fa0 100644 --- a/src/mesa/main/texformat.c +++ b/src/mesa/main/texformat.c @@ -55,10 +55,10 @@ nonlinear_to_linear(GLubyte cs8) for (i = 0; i < 256; i++) { const GLfloat cs = UBYTE_TO_FLOAT(i); if (cs <= 0.04045) { - table[i] = cs / 12.92; + table[i] = cs / 12.92f; } else { - table[i] = _mesa_pow((cs + 0.055) / 1.055, 2.4); + table[i] = (GLfloat) _mesa_pow((cs + 0.055) / 1.055, 2.4); } } tableReady = GL_TRUE; @@ -1207,6 +1207,30 @@ const struct gl_texture_format _mesa_texformat_z24_s8 = { store_texel_z24_s8 /* StoreTexel */ }; +const struct gl_texture_format _mesa_texformat_s8_z24 = { + MESA_FORMAT_S8_Z24, /* MesaFormat */ + GL_DEPTH_STENCIL_EXT, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ + 0, /* RedBits */ + 0, /* GreenBits */ + 0, /* BlueBits */ + 0, /* AlphaBits */ + 0, /* LuminanceBits */ + 0, /* IntensityBits */ + 0, /* IndexBits */ + 24, /* DepthBits */ + 8, /* StencilBits */ + 4, /* TexelBytes */ + _mesa_texstore_s8_z24, /* StoreTexImageFunc */ + NULL, /* FetchTexel1D */ + NULL, /* FetchTexel2D */ + NULL, /* FetchTexel3D */ + fetch_texel_1d_f_s8_z24, /* FetchTexel1Df */ + fetch_texel_2d_f_s8_z24, /* FetchTexel2Df */ + fetch_texel_3d_f_s8_z24, /* FetchTexel3Df */ + store_texel_s8_z24 /* StoreTexel */ +}; + const struct gl_texture_format _mesa_texformat_z16 = { MESA_FORMAT_Z16, /* MesaFormat */ GL_DEPTH_COMPONENT, /* BaseFormat */ @@ -1421,21 +1445,27 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, case GL_COMPRESSED_INTENSITY_ARB: return &_mesa_texformat_intensity; case GL_COMPRESSED_RGB_ARB: +#if FEATURE_texture_fxt1 if (ctx->Extensions.TDFX_texture_compression_FXT1) return &_mesa_texformat_rgb_fxt1; - else if (ctx->Extensions.EXT_texture_compression_s3tc || - ctx->Extensions.S3_s3tc) +#endif +#if FEATURE_texture_s3tc + if (ctx->Extensions.EXT_texture_compression_s3tc || + ctx->Extensions.S3_s3tc) return &_mesa_texformat_rgb_dxt1; - else - return &_mesa_texformat_rgb; +#endif + return &_mesa_texformat_rgb; case GL_COMPRESSED_RGBA_ARB: +#if FEATURE_texture_fxt1 if (ctx->Extensions.TDFX_texture_compression_FXT1) return &_mesa_texformat_rgba_fxt1; - else if (ctx->Extensions.EXT_texture_compression_s3tc || - ctx->Extensions.S3_s3tc) +#endif +#if FEATURE_texture_s3tc + if (ctx->Extensions.EXT_texture_compression_s3tc || + ctx->Extensions.S3_s3tc) return &_mesa_texformat_rgba_dxt3; /* Not rgba_dxt1, see spec */ - else - return &_mesa_texformat_rgba; +#endif + return &_mesa_texformat_rgba; default: ; /* fallthrough */ } @@ -1450,6 +1480,7 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, } } +#if FEATURE_texture_fxt1 if (ctx->Extensions.TDFX_texture_compression_FXT1) { switch (internalFormat) { case GL_COMPRESSED_RGB_FXT1_3DFX: @@ -1460,7 +1491,9 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, ; /* fallthrough */ } } +#endif +#if FEATURE_texture_s3tc if (ctx->Extensions.EXT_texture_compression_s3tc) { switch (internalFormat) { case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: @@ -1488,6 +1521,7 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, ; /* fallthrough */ } } +#endif if (ctx->Extensions.ARB_texture_float) { switch (internalFormat) { @@ -1569,3 +1603,174 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, _mesa_problem(ctx, "unexpected format in _mesa_choose_tex_format()"); return NULL; } + + + +/** + * Return datatype and number of components per texel for the + * given gl_texture_format. + */ +void +_mesa_format_to_type_and_comps(const struct gl_texture_format *format, + GLenum *datatype, GLuint *comps) +{ + switch (format->MesaFormat) { + case MESA_FORMAT_RGBA8888: + case MESA_FORMAT_RGBA8888_REV: + case MESA_FORMAT_ARGB8888: + case MESA_FORMAT_ARGB8888_REV: + *datatype = CHAN_TYPE; + *comps = 4; + return; + case MESA_FORMAT_RGB888: + case MESA_FORMAT_BGR888: + *datatype = GL_UNSIGNED_BYTE; + *comps = 3; + return; + case MESA_FORMAT_RGB565: + case MESA_FORMAT_RGB565_REV: + *datatype = GL_UNSIGNED_SHORT_5_6_5; + *comps = 3; + return; + + case MESA_FORMAT_ARGB4444: + case MESA_FORMAT_ARGB4444_REV: + *datatype = GL_UNSIGNED_SHORT_4_4_4_4; + *comps = 4; + return; + + case MESA_FORMAT_ARGB1555: + case MESA_FORMAT_ARGB1555_REV: + *datatype = GL_UNSIGNED_SHORT_1_5_5_5_REV; + *comps = 3; + return; + + case MESA_FORMAT_AL88: + case MESA_FORMAT_AL88_REV: + *datatype = GL_UNSIGNED_BYTE; + *comps = 2; + return; + case MESA_FORMAT_RGB332: + *datatype = GL_UNSIGNED_BYTE_3_3_2; + *comps = 3; + return; + + case MESA_FORMAT_A8: + case MESA_FORMAT_L8: + case MESA_FORMAT_I8: + case MESA_FORMAT_CI8: + *datatype = GL_UNSIGNED_BYTE; + *comps = 1; + return; + + case MESA_FORMAT_YCBCR: + case MESA_FORMAT_YCBCR_REV: + *datatype = GL_UNSIGNED_SHORT; + *comps = 2; + return; + + case MESA_FORMAT_Z24_S8: + *datatype = GL_UNSIGNED_INT; + *comps = 1; /* XXX OK? */ + return; + + case MESA_FORMAT_Z16: + *datatype = GL_UNSIGNED_SHORT; + *comps = 1; + return; + + case MESA_FORMAT_Z32: + *datatype = GL_UNSIGNED_INT; + *comps = 1; + return; + + case MESA_FORMAT_SRGB8: + *datatype = GL_UNSIGNED_BYTE; + *comps = 3; + return; + case MESA_FORMAT_SRGBA8: + *datatype = GL_UNSIGNED_BYTE; + *comps = 4; + return; + case MESA_FORMAT_SL8: + *datatype = GL_UNSIGNED_BYTE; + *comps = 1; + return; + case MESA_FORMAT_SLA8: + *datatype = GL_UNSIGNED_BYTE; + *comps = 2; + return; + + case MESA_FORMAT_RGB_FXT1: + case MESA_FORMAT_RGBA_FXT1: + case MESA_FORMAT_RGB_DXT1: + case MESA_FORMAT_RGBA_DXT1: + case MESA_FORMAT_RGBA_DXT3: + case MESA_FORMAT_RGBA_DXT5: + /* XXX generate error instead? */ + *datatype = GL_UNSIGNED_BYTE; + *comps = 0; + return; + + case MESA_FORMAT_RGBA: + *datatype = CHAN_TYPE; + *comps = 4; + return; + case MESA_FORMAT_RGB: + *datatype = CHAN_TYPE; + *comps = 3; + return; + case MESA_FORMAT_LUMINANCE_ALPHA: + *datatype = CHAN_TYPE; + *comps = 2; + return; + case MESA_FORMAT_ALPHA: + case MESA_FORMAT_LUMINANCE: + case MESA_FORMAT_INTENSITY: + *datatype = CHAN_TYPE; + *comps = 1; + return; + + case MESA_FORMAT_RGBA_FLOAT32: + *datatype = GL_FLOAT; + *comps = 4; + return; + case MESA_FORMAT_RGBA_FLOAT16: + *datatype = GL_HALF_FLOAT_ARB; + *comps = 4; + return; + case MESA_FORMAT_RGB_FLOAT32: + *datatype = GL_FLOAT; + *comps = 3; + return; + case MESA_FORMAT_RGB_FLOAT16: + *datatype = GL_HALF_FLOAT_ARB; + *comps = 3; + return; + case MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32: + *datatype = GL_FLOAT; + *comps = 2; + return; + case MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16: + *datatype = GL_HALF_FLOAT_ARB; + *comps = 2; + return; + case MESA_FORMAT_ALPHA_FLOAT32: + case MESA_FORMAT_LUMINANCE_FLOAT32: + case MESA_FORMAT_INTENSITY_FLOAT32: + *datatype = GL_FLOAT; + *comps = 1; + return; + case MESA_FORMAT_ALPHA_FLOAT16: + case MESA_FORMAT_LUMINANCE_FLOAT16: + case MESA_FORMAT_INTENSITY_FLOAT16: + *datatype = GL_HALF_FLOAT_ARB; + *comps = 1; + return; + + default: + _mesa_problem(NULL, "bad format in _mesa_format_to_type_and_comps"); + *datatype = 0; + *comps = 1; + } +} diff --git a/src/mesa/main/texformat.h b/src/mesa/main/texformat.h index 82023b946d..18900fe08b 100644 --- a/src/mesa/main/texformat.h +++ b/src/mesa/main/texformat.h @@ -84,6 +84,7 @@ enum _format { MESA_FORMAT_YCBCR, /* YYYY YYYY UorV UorV */ MESA_FORMAT_YCBCR_REV, /* UorV UorV YYYY YYYY */ MESA_FORMAT_Z24_S8, /* ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ SSSS SSSS */ + MESA_FORMAT_S8_Z24, /* SSSS SSSS ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ */ MESA_FORMAT_Z16, /* ZZZZ ZZZZ ZZZZ ZZZZ */ MESA_FORMAT_Z32, /* ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ */ /*@}*/ @@ -211,6 +212,7 @@ extern const struct gl_texture_format _mesa_texformat_l8; extern const struct gl_texture_format _mesa_texformat_i8; extern const struct gl_texture_format _mesa_texformat_ci8; extern const struct gl_texture_format _mesa_texformat_z24_s8; +extern const struct gl_texture_format _mesa_texformat_s8_z24; extern const struct gl_texture_format _mesa_texformat_z16; extern const struct gl_texture_format _mesa_texformat_z32; /*@}*/ @@ -241,4 +243,10 @@ extern const struct gl_texture_format * _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, GLenum format, GLenum type ); + +extern void +_mesa_format_to_type_and_comps(const struct gl_texture_format *format, + GLenum *datatype, GLuint *comps); + + #endif diff --git a/src/mesa/main/texformat_tmp.h b/src/mesa/main/texformat_tmp.h index 99785da1a0..7499ba7b36 100644 --- a/src/mesa/main/texformat_tmp.h +++ b/src/mesa/main/texformat_tmp.h @@ -1117,6 +1117,7 @@ static void FETCH(ci8)( const struct gl_texture_image *texImage, break;; default: _mesa_problem(ctx, "Bad palette format in fetch_texel_ci8"); + return; } #if CHAN_TYPE == GL_UNSIGNED_BYTE COPY_4UBV(texel, texelUB); @@ -1363,6 +1364,32 @@ static void store_texel_z24_s8(struct gl_texture_image *texImage, #endif +/* MESA_TEXFORMAT_S8_Z24 ***************************************************/ + +static void FETCH(f_s8_z24)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + /* only return Z, not stencil data */ + const GLuint *src = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + const GLfloat scale = 1.0F / (GLfloat) 0xffffff; + texel[0] = ((*src) & 0x00ffffff) * scale; + ASSERT(texImage->TexFormat->MesaFormat == MESA_FORMAT_S8_Z24); + ASSERT(texel[0] >= 0.0F); + ASSERT(texel[0] <= 1.0F); +} + +#if DIM == 3 +static void store_texel_s8_z24(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + /* only store Z, not stencil */ + GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + GLfloat depth = *((GLfloat *) texel); + GLuint zi = (GLuint) (depth * 0xffffff); + *dst = zi | (*dst & 0xff000000); +} +#endif + #undef TEXEL_ADDR #undef DIM diff --git a/src/mesa/main/texgen.c b/src/mesa/main/texgen.c new file mode 100644 index 0000000000..244c7aaafc --- /dev/null +++ b/src/mesa/main/texgen.c @@ -0,0 +1,601 @@ +/* + * Mesa 3-D graphics library + * Version: 7.1 + * + * Copyright (C) 1999-2008 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 texgen.c + * + * glTexGen-related functions + */ + + +#include "main/glheader.h" +#include "main/context.h" +#include "main/enums.h" +#include "main/macros.h" +#include "main/texgen.h" +#include "math/m_xform.h" + + + +void GLAPIENTRY +_mesa_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params ) +{ + GET_CURRENT_CONTEXT(ctx); + struct gl_texture_unit *texUnit; + ASSERT_OUTSIDE_BEGIN_END(ctx); + + if (MESA_VERBOSE&(VERBOSE_API|VERBOSE_TEXTURE)) + _mesa_debug(ctx, "glTexGen %s %s %.1f(%s)...\n", + _mesa_lookup_enum_by_nr(coord), + _mesa_lookup_enum_by_nr(pname), + *params, + _mesa_lookup_enum_by_nr((GLenum) (GLint) *params)); + + if (ctx->Texture.CurrentUnit >= ctx->Const.MaxTextureCoordUnits) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glTexGen(current unit)"); + return; + } + + texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; + + switch (coord) { + case GL_S: + if (pname==GL_TEXTURE_GEN_MODE) { + GLenum mode = (GLenum) (GLint) *params; + GLbitfield bits; + switch (mode) { + case GL_OBJECT_LINEAR: + bits = TEXGEN_OBJ_LINEAR; + break; + case GL_EYE_LINEAR: + bits = TEXGEN_EYE_LINEAR; + break; + case GL_REFLECTION_MAP_NV: + bits = TEXGEN_REFLECTION_MAP_NV; + break; + case GL_NORMAL_MAP_NV: + bits = TEXGEN_NORMAL_MAP_NV; + break; + case GL_SPHERE_MAP: + bits = TEXGEN_SPHERE_MAP; + break; + default: + _mesa_error( ctx, GL_INVALID_ENUM, "glTexGenfv(param)" ); + return; + } + if (texUnit->GenModeS == mode) + return; + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texUnit->GenModeS = mode; + texUnit->_GenBitS = bits; + } + else if (pname==GL_OBJECT_PLANE) { + if (TEST_EQ_4V(texUnit->ObjectPlaneS, params)) + return; + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + COPY_4FV(texUnit->ObjectPlaneS, params); + } + else if (pname==GL_EYE_PLANE) { + GLfloat tmp[4]; + /* Transform plane equation by the inverse modelview matrix */ + if (_math_matrix_is_dirty(ctx->ModelviewMatrixStack.Top)) { + _math_matrix_analyse( ctx->ModelviewMatrixStack.Top ); + } + _mesa_transform_vector( tmp, params, ctx->ModelviewMatrixStack.Top->inv ); + if (TEST_EQ_4V(texUnit->EyePlaneS, tmp)) + return; + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + COPY_4FV(texUnit->EyePlaneS, tmp); + } + else { + _mesa_error( ctx, GL_INVALID_ENUM, "glTexGenfv(pname)" ); + return; + } + break; + case GL_T: + if (pname==GL_TEXTURE_GEN_MODE) { + GLenum mode = (GLenum) (GLint) *params; + GLbitfield bitt; + switch (mode) { + case GL_OBJECT_LINEAR: + bitt = TEXGEN_OBJ_LINEAR; + break; + case GL_EYE_LINEAR: + bitt = TEXGEN_EYE_LINEAR; + break; + case GL_REFLECTION_MAP_NV: + bitt = TEXGEN_REFLECTION_MAP_NV; + break; + case GL_NORMAL_MAP_NV: + bitt = TEXGEN_NORMAL_MAP_NV; + break; + case GL_SPHERE_MAP: + bitt = TEXGEN_SPHERE_MAP; + break; + default: + _mesa_error( ctx, GL_INVALID_ENUM, "glTexGenfv(param)" ); + return; + } + if (texUnit->GenModeT == mode) + return; + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texUnit->GenModeT = mode; + texUnit->_GenBitT = bitt; + } + else if (pname==GL_OBJECT_PLANE) { + if (TEST_EQ_4V(texUnit->ObjectPlaneT, params)) + return; + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + COPY_4FV(texUnit->ObjectPlaneT, params); + } + else if (pname==GL_EYE_PLANE) { + GLfloat tmp[4]; + /* Transform plane equation by the inverse modelview matrix */ + if (_math_matrix_is_dirty(ctx->ModelviewMatrixStack.Top)) { + _math_matrix_analyse( ctx->ModelviewMatrixStack.Top ); + } + _mesa_transform_vector( tmp, params, ctx->ModelviewMatrixStack.Top->inv ); + if (TEST_EQ_4V(texUnit->EyePlaneT, tmp)) + return; + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + COPY_4FV(texUnit->EyePlaneT, tmp); + } + else { + _mesa_error( ctx, GL_INVALID_ENUM, "glTexGenfv(pname)" ); + return; + } + break; + case GL_R: + if (pname==GL_TEXTURE_GEN_MODE) { + GLenum mode = (GLenum) (GLint) *params; + GLbitfield bitr; + switch (mode) { + case GL_OBJECT_LINEAR: + bitr = TEXGEN_OBJ_LINEAR; + break; + case GL_REFLECTION_MAP_NV: + bitr = TEXGEN_REFLECTION_MAP_NV; + break; + case GL_NORMAL_MAP_NV: + bitr = TEXGEN_NORMAL_MAP_NV; + break; + case GL_EYE_LINEAR: + bitr = TEXGEN_EYE_LINEAR; + break; + default: + _mesa_error( ctx, GL_INVALID_ENUM, "glTexGenfv(param)" ); + return; + } + if (texUnit->GenModeR == mode) + return; + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texUnit->GenModeR = mode; + texUnit->_GenBitR = bitr; + } + else if (pname==GL_OBJECT_PLANE) { + if (TEST_EQ_4V(texUnit->ObjectPlaneR, params)) + return; + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + COPY_4FV(texUnit->ObjectPlaneR, params); + } + else if (pname==GL_EYE_PLANE) { + GLfloat tmp[4]; + /* Transform plane equation by the inverse modelview matrix */ + if (_math_matrix_is_dirty(ctx->ModelviewMatrixStack.Top)) { + _math_matrix_analyse( ctx->ModelviewMatrixStack.Top ); + } + _mesa_transform_vector( tmp, params, ctx->ModelviewMatrixStack.Top->inv ); + if (TEST_EQ_4V(texUnit->EyePlaneR, tmp)) + return; + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + COPY_4FV(texUnit->EyePlaneR, tmp); + } + else { + _mesa_error( ctx, GL_INVALID_ENUM, "glTexGenfv(pname)" ); + return; + } + break; + case GL_Q: + if (pname==GL_TEXTURE_GEN_MODE) { + GLenum mode = (GLenum) (GLint) *params; + GLbitfield bitq; + switch (mode) { + case GL_OBJECT_LINEAR: + bitq = TEXGEN_OBJ_LINEAR; + break; + case GL_EYE_LINEAR: + bitq = TEXGEN_EYE_LINEAR; + break; + default: + _mesa_error( ctx, GL_INVALID_ENUM, "glTexGenfv(param)" ); + return; + } + if (texUnit->GenModeQ == mode) + return; + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texUnit->GenModeQ = mode; + texUnit->_GenBitQ = bitq; + } + else if (pname==GL_OBJECT_PLANE) { + if (TEST_EQ_4V(texUnit->ObjectPlaneQ, params)) + return; + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + COPY_4FV(texUnit->ObjectPlaneQ, params); + } + else if (pname==GL_EYE_PLANE) { + GLfloat tmp[4]; + /* Transform plane equation by the inverse modelview matrix */ + if (_math_matrix_is_dirty(ctx->ModelviewMatrixStack.Top)) { + _math_matrix_analyse( ctx->ModelviewMatrixStack.Top ); + } + _mesa_transform_vector( tmp, params, ctx->ModelviewMatrixStack.Top->inv ); + if (TEST_EQ_4V(texUnit->EyePlaneQ, tmp)) + return; + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + COPY_4FV(texUnit->EyePlaneQ, tmp); + } + else { + _mesa_error( ctx, GL_INVALID_ENUM, "glTexGenfv(pname)" ); + return; + } + break; + default: + _mesa_error( ctx, GL_INVALID_ENUM, "glTexGenfv(coord)" ); + return; + } + + if (ctx->Driver.TexGen) + ctx->Driver.TexGen( ctx, coord, pname, params ); +} + + +void GLAPIENTRY +_mesa_TexGeniv(GLenum coord, GLenum pname, const GLint *params ) +{ + GLfloat p[4]; + p[0] = (GLfloat) params[0]; + if (pname == GL_TEXTURE_GEN_MODE) { + p[1] = p[2] = p[3] = 0.0F; + } + else { + p[1] = (GLfloat) params[1]; + p[2] = (GLfloat) params[2]; + p[3] = (GLfloat) params[3]; + } + _mesa_TexGenfv(coord, pname, p); +} + + +void GLAPIENTRY +_mesa_TexGend(GLenum coord, GLenum pname, GLdouble param ) +{ + GLfloat p = (GLfloat) param; + _mesa_TexGenfv( coord, pname, &p ); +} + + +void GLAPIENTRY +_mesa_TexGendv(GLenum coord, GLenum pname, const GLdouble *params ) +{ + GLfloat p[4]; + p[0] = (GLfloat) params[0]; + if (pname == GL_TEXTURE_GEN_MODE) { + p[1] = p[2] = p[3] = 0.0F; + } + else { + p[1] = (GLfloat) params[1]; + p[2] = (GLfloat) params[2]; + p[3] = (GLfloat) params[3]; + } + _mesa_TexGenfv( coord, pname, p ); +} + + +void GLAPIENTRY +_mesa_TexGenf( GLenum coord, GLenum pname, GLfloat param ) +{ + _mesa_TexGenfv(coord, pname, ¶m); +} + + +void GLAPIENTRY +_mesa_TexGeni( GLenum coord, GLenum pname, GLint param ) +{ + _mesa_TexGeniv( coord, pname, ¶m ); +} + + + +void GLAPIENTRY +_mesa_GetTexGendv( GLenum coord, GLenum pname, GLdouble *params ) +{ + const struct gl_texture_unit *texUnit; + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END(ctx); + + if (ctx->Texture.CurrentUnit >= ctx->Const.MaxTextureCoordUnits) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexGendv(current unit)"); + return; + } + + texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; + + switch (coord) { + case GL_S: + if (pname==GL_TEXTURE_GEN_MODE) { + params[0] = ENUM_TO_DOUBLE(texUnit->GenModeS); + } + else if (pname==GL_OBJECT_PLANE) { + COPY_4V( params, texUnit->ObjectPlaneS ); + } + else if (pname==GL_EYE_PLANE) { + COPY_4V( params, texUnit->EyePlaneS ); + } + else { + _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexGendv(pname)" ); + return; + } + break; + case GL_T: + if (pname==GL_TEXTURE_GEN_MODE) { + params[0] = ENUM_TO_DOUBLE(texUnit->GenModeT); + } + else if (pname==GL_OBJECT_PLANE) { + COPY_4V( params, texUnit->ObjectPlaneT ); + } + else if (pname==GL_EYE_PLANE) { + COPY_4V( params, texUnit->EyePlaneT ); + } + else { + _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexGendv(pname)" ); + return; + } + break; + case GL_R: + if (pname==GL_TEXTURE_GEN_MODE) { + params[0] = ENUM_TO_DOUBLE(texUnit->GenModeR); + } + else if (pname==GL_OBJECT_PLANE) { + COPY_4V( params, texUnit->ObjectPlaneR ); + } + else if (pname==GL_EYE_PLANE) { + COPY_4V( params, texUnit->EyePlaneR ); + } + else { + _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexGendv(pname)" ); + return; + } + break; + case GL_Q: + if (pname==GL_TEXTURE_GEN_MODE) { + params[0] = ENUM_TO_DOUBLE(texUnit->GenModeQ); + } + else if (pname==GL_OBJECT_PLANE) { + COPY_4V( params, texUnit->ObjectPlaneQ ); + } + else if (pname==GL_EYE_PLANE) { + COPY_4V( params, texUnit->EyePlaneQ ); + } + else { + _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexGendv(pname)" ); + return; + } + break; + default: + _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexGendv(coord)" ); + return; + } +} + + + +void GLAPIENTRY +_mesa_GetTexGenfv( GLenum coord, GLenum pname, GLfloat *params ) +{ + const struct gl_texture_unit *texUnit; + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END(ctx); + + if (ctx->Texture.CurrentUnit >= ctx->Const.MaxTextureCoordUnits) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexGenfv(current unit)"); + return; + } + + texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; + + switch (coord) { + case GL_S: + if (pname==GL_TEXTURE_GEN_MODE) { + params[0] = ENUM_TO_FLOAT(texUnit->GenModeS); + } + else if (pname==GL_OBJECT_PLANE) { + COPY_4V( params, texUnit->ObjectPlaneS ); + } + else if (pname==GL_EYE_PLANE) { + COPY_4V( params, texUnit->EyePlaneS ); + } + else { + _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexGenfv(pname)" ); + return; + } + break; + case GL_T: + if (pname==GL_TEXTURE_GEN_MODE) { + params[0] = ENUM_TO_FLOAT(texUnit->GenModeT); + } + else if (pname==GL_OBJECT_PLANE) { + COPY_4V( params, texUnit->ObjectPlaneT ); + } + else if (pname==GL_EYE_PLANE) { + COPY_4V( params, texUnit->EyePlaneT ); + } + else { + _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexGenfv(pname)" ); + return; + } + break; + case GL_R: + if (pname==GL_TEXTURE_GEN_MODE) { + params[0] = ENUM_TO_FLOAT(texUnit->GenModeR); + } + else if (pname==GL_OBJECT_PLANE) { + COPY_4V( params, texUnit->ObjectPlaneR ); + } + else if (pname==GL_EYE_PLANE) { + COPY_4V( params, texUnit->EyePlaneR ); + } + else { + _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexGenfv(pname)" ); + return; + } + break; + case GL_Q: + if (pname==GL_TEXTURE_GEN_MODE) { + params[0] = ENUM_TO_FLOAT(texUnit->GenModeQ); + } + else if (pname==GL_OBJECT_PLANE) { + COPY_4V( params, texUnit->ObjectPlaneQ ); + } + else if (pname==GL_EYE_PLANE) { + COPY_4V( params, texUnit->EyePlaneQ ); + } + else { + _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexGenfv(pname)" ); + return; + } + break; + default: + _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexGenfv(coord)" ); + return; + } +} + + + +void GLAPIENTRY +_mesa_GetTexGeniv( GLenum coord, GLenum pname, GLint *params ) +{ + const struct gl_texture_unit *texUnit; + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END(ctx); + + if (ctx->Texture.CurrentUnit >= ctx->Const.MaxTextureCoordUnits) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexGeniv(current unit)"); + return; + } + + texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; + + switch (coord) { + case GL_S: + if (pname==GL_TEXTURE_GEN_MODE) { + params[0] = texUnit->GenModeS; + } + else if (pname==GL_OBJECT_PLANE) { + params[0] = (GLint) texUnit->ObjectPlaneS[0]; + params[1] = (GLint) texUnit->ObjectPlaneS[1]; + params[2] = (GLint) texUnit->ObjectPlaneS[2]; + params[3] = (GLint) texUnit->ObjectPlaneS[3]; + } + else if (pname==GL_EYE_PLANE) { + params[0] = (GLint) texUnit->EyePlaneS[0]; + params[1] = (GLint) texUnit->EyePlaneS[1]; + params[2] = (GLint) texUnit->EyePlaneS[2]; + params[3] = (GLint) texUnit->EyePlaneS[3]; + } + else { + _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexGeniv(pname)" ); + return; + } + break; + case GL_T: + if (pname==GL_TEXTURE_GEN_MODE) { + params[0] = texUnit->GenModeT; + } + else if (pname==GL_OBJECT_PLANE) { + params[0] = (GLint) texUnit->ObjectPlaneT[0]; + params[1] = (GLint) texUnit->ObjectPlaneT[1]; + params[2] = (GLint) texUnit->ObjectPlaneT[2]; + params[3] = (GLint) texUnit->ObjectPlaneT[3]; + } + else if (pname==GL_EYE_PLANE) { + params[0] = (GLint) texUnit->EyePlaneT[0]; + params[1] = (GLint) texUnit->EyePlaneT[1]; + params[2] = (GLint) texUnit->EyePlaneT[2]; + params[3] = (GLint) texUnit->EyePlaneT[3]; + } + else { + _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexGeniv(pname)" ); + return; + } + break; + case GL_R: + if (pname==GL_TEXTURE_GEN_MODE) { + params[0] = texUnit->GenModeR; + } + else if (pname==GL_OBJECT_PLANE) { + params[0] = (GLint) texUnit->ObjectPlaneR[0]; + params[1] = (GLint) texUnit->ObjectPlaneR[1]; + params[2] = (GLint) texUnit->ObjectPlaneR[2]; + params[3] = (GLint) texUnit->ObjectPlaneR[3]; + } + else if (pname==GL_EYE_PLANE) { + params[0] = (GLint) texUnit->EyePlaneR[0]; + params[1] = (GLint) texUnit->EyePlaneR[1]; + params[2] = (GLint) texUnit->EyePlaneR[2]; + params[3] = (GLint) texUnit->EyePlaneR[3]; + } + else { + _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexGeniv(pname)" ); + return; + } + break; + case GL_Q: + if (pname==GL_TEXTURE_GEN_MODE) { + params[0] = texUnit->GenModeQ; + } + else if (pname==GL_OBJECT_PLANE) { + params[0] = (GLint) texUnit->ObjectPlaneQ[0]; + params[1] = (GLint) texUnit->ObjectPlaneQ[1]; + params[2] = (GLint) texUnit->ObjectPlaneQ[2]; + params[3] = (GLint) texUnit->ObjectPlaneQ[3]; + } + else if (pname==GL_EYE_PLANE) { + params[0] = (GLint) texUnit->EyePlaneQ[0]; + params[1] = (GLint) texUnit->EyePlaneQ[1]; + params[2] = (GLint) texUnit->EyePlaneQ[2]; + params[3] = (GLint) texUnit->EyePlaneQ[3]; + } + else { + _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexGeniv(pname)" ); + return; + } + break; + default: + _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexGeniv(coord)" ); + return; + } +} + + diff --git a/src/mesa/main/texgen.h b/src/mesa/main/texgen.h new file mode 100644 index 0000000000..073588efcd --- /dev/null +++ b/src/mesa/main/texgen.h @@ -0,0 +1,62 @@ +/* + * Mesa 3-D graphics library + * Version: 7.1 + * + * Copyright (C) 1999-2008 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 TEXGEN_H +#define TEXGEN_H + + +#include "main/glheader.h" + + +extern void GLAPIENTRY +_mesa_GetTexGendv( GLenum coord, GLenum pname, GLdouble *params ); + +extern void GLAPIENTRY +_mesa_GetTexGenfv( GLenum coord, GLenum pname, GLfloat *params ); + +extern void GLAPIENTRY +_mesa_GetTexGeniv( GLenum coord, GLenum pname, GLint *params ); + +extern void GLAPIENTRY +_mesa_TexGend( GLenum coord, GLenum pname, GLdouble param ); + +extern void GLAPIENTRY +_mesa_TexGendv( GLenum coord, GLenum pname, const GLdouble *params ); + +extern void GLAPIENTRY +_mesa_TexGenf( GLenum coord, GLenum pname, GLfloat param ); + +extern void GLAPIENTRY +_mesa_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params ); + +extern void GLAPIENTRY +_mesa_TexGeni( GLenum coord, GLenum pname, GLint param ); + +extern void GLAPIENTRY +_mesa_TexGeniv( GLenum coord, GLenum pname, const GLint *params ); + + + +#endif /* TEXGEN_H */ diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index adf3d37597..b0a2d6ddb3 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -32,7 +32,9 @@ #include "glheader.h" #include "bufferobj.h" #include "context.h" +#if FEATURE_convolve #include "convolve.h" +#endif #include "fbobject.h" #include "framebuffer.h" #include "image.h" @@ -595,8 +597,12 @@ is_compressed_format(GLcontext *ctx, GLenum internalFormat) } -static GLuint -texture_face(GLenum target) +/** + * For cube map faces, return a face index in [0,5]. + * For other targets return 0; + */ +GLuint +_mesa_tex_target_to_face(GLenum target) { if (target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB && target <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB) @@ -625,6 +631,7 @@ _mesa_set_tex_image(struct gl_texture_object *tObj, { ASSERT(tObj); ASSERT(texImage); + /* XXX simplify this with _mesa_tex_target_to_face() */ switch (target) { case GL_TEXTURE_1D: case GL_TEXTURE_2D: @@ -828,6 +835,7 @@ _mesa_select_tex_image(GLcontext *ctx, const struct gl_texture_object *texObj, if (level < 0 || level >= MAX_TEXTURE_LEVELS) return NULL; + /* XXX simplify this with _mesa_tex_target_to_face() */ switch (target) { case GL_TEXTURE_1D: case GL_PROXY_TEXTURE_1D: @@ -2412,16 +2420,18 @@ _mesa_TexImage1D( GLenum target, GLint level, GLint internalFormat, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); +#if FEATURE_convolve if (is_color_format(internalFormat)) { _mesa_adjust_image_for_convolution(ctx, 1, &postConvWidth, NULL); } +#endif if (target == GL_TEXTURE_1D) { /* non-proxy target */ struct gl_texture_unit *texUnit; struct gl_texture_object *texObj; struct gl_texture_image *texImage; - const GLuint face = texture_face(target); + const GLuint face = _mesa_tex_target_to_face(target); if (texture_error_check(ctx, target, level, internalFormat, format, type, 1, postConvWidth, 1, 1, border)) { @@ -2507,10 +2517,12 @@ _mesa_TexImage2D( GLenum target, GLint level, GLint internalFormat, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); +#if FEATURE_convolve if (is_color_format(internalFormat)) { _mesa_adjust_image_for_convolution(ctx, 2, &postConvWidth, &postConvHeight); } +#endif if (target == GL_TEXTURE_2D || (ctx->Extensions.ARB_texture_cube_map && @@ -2524,7 +2536,7 @@ _mesa_TexImage2D( GLenum target, GLint level, GLint internalFormat, struct gl_texture_unit *texUnit; struct gl_texture_object *texObj; struct gl_texture_image *texImage; - const GLuint face = texture_face(target); + const GLuint face = _mesa_tex_target_to_face(target); if (texture_error_check(ctx, target, level, internalFormat, format, type, 2, postConvWidth, postConvHeight, @@ -2626,7 +2638,7 @@ _mesa_TexImage3D( GLenum target, GLint level, GLint internalFormat, struct gl_texture_unit *texUnit; struct gl_texture_object *texObj; struct gl_texture_image *texImage; - const GLuint face = texture_face(target); + const GLuint face = _mesa_tex_target_to_face(target); if (texture_error_check(ctx, target, level, (GLint) internalFormat, format, type, 3, width, height, depth, border)) { @@ -2729,10 +2741,12 @@ _mesa_TexSubImage1D( GLenum target, GLint level, if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE) _mesa_update_state(ctx); +#if FEATURE_convolve /* XXX should test internal format */ if (is_color_format(format)) { _mesa_adjust_image_for_convolution(ctx, 1, &postConvWidth, NULL); } +#endif if (subtexture_error_check(ctx, 1, target, level, xoffset, 0, 0, postConvWidth, 1, 1, format, type)) { @@ -2787,11 +2801,13 @@ _mesa_TexSubImage2D( GLenum target, GLint level, if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE) _mesa_update_state(ctx); +#if FEATURE_convolve /* XXX should test internal format */ if (is_color_format(format)) { _mesa_adjust_image_for_convolution(ctx, 2, &postConvWidth, &postConvHeight); } +#endif if (subtexture_error_check(ctx, 2, target, level, xoffset, yoffset, 0, postConvWidth, postConvHeight, 1, format, type)) { @@ -2894,16 +2910,18 @@ _mesa_CopyTexImage1D( GLenum target, GLint level, struct gl_texture_object *texObj; struct gl_texture_image *texImage; GLsizei postConvWidth = width; - const GLuint face = texture_face(target); + const GLuint face = _mesa_tex_target_to_face(target); GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE) _mesa_update_state(ctx); +#if FEATURE_convolve if (is_color_format(internalFormat)) { _mesa_adjust_image_for_convolution(ctx, 1, &postConvWidth, NULL); } +#endif if (copytexture_error_check(ctx, 1, target, level, internalFormat, postConvWidth, 1, border)) @@ -2957,18 +2975,19 @@ _mesa_CopyTexImage2D( GLenum target, GLint level, GLenum internalFormat, struct gl_texture_object *texObj; struct gl_texture_image *texImage; GLsizei postConvWidth = width, postConvHeight = height; - const GLuint face = texture_face(target); + const GLuint face = _mesa_tex_target_to_face(target); GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE) _mesa_update_state(ctx); +#if FEATURE_convolve if (is_color_format(internalFormat)) { _mesa_adjust_image_for_convolution(ctx, 2, &postConvWidth, &postConvHeight); } - +#endif if (copytexture_error_check(ctx, 2, target, level, internalFormat, postConvWidth, postConvHeight, border)) return; @@ -3021,14 +3040,19 @@ _mesa_CopyTexSubImage1D( GLenum target, GLint level, struct gl_texture_object *texObj; struct gl_texture_image *texImage; GLsizei postConvWidth = width; + GLint yoffset = 0; + GLsizei height = 1; + GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE) _mesa_update_state(ctx); +#if FEATURE_convolve /* XXX should test internal format */ _mesa_adjust_image_for_convolution(ctx, 1, &postConvWidth, NULL); +#endif if (copytexsubimage_error_check(ctx, 1, target, level, xoffset, 0, 0, postConvWidth, 1)) @@ -3050,8 +3074,13 @@ _mesa_CopyTexSubImage1D( GLenum target, GLint level, /* 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); + if (_mesa_clip_copytexsubimage(ctx, &xoffset, &yoffset, &x, &y, + &width, &height)) { + ASSERT(ctx->Driver.CopyTexSubImage1D); + ctx->Driver.CopyTexSubImage1D(ctx, target, level, + xoffset, x, y, width); + } + ctx->NewState |= _NEW_TEXTURE; } out: @@ -3075,8 +3104,10 @@ _mesa_CopyTexSubImage2D( GLenum target, GLint level, if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE) _mesa_update_state(ctx); +#if FEATURE_convolve /* XXX should test internal format */ _mesa_adjust_image_for_convolution(ctx, 2, &postConvWidth, &postConvHeight); +#endif if (copytexsubimage_error_check(ctx, 2, target, level, xoffset, yoffset, 0, postConvWidth, postConvHeight)) @@ -3096,10 +3127,14 @@ _mesa_CopyTexSubImage2D( GLenum target, GLint level, /* 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, + + if (_mesa_clip_copytexsubimage(ctx, &xoffset, &yoffset, &x, &y, + &width, &height)) { + ASSERT(ctx->Driver.CopyTexSubImage2D); + ctx->Driver.CopyTexSubImage2D(ctx, target, level, xoffset, yoffset, x, y, width, height); + } + ctx->NewState |= _NEW_TEXTURE; } out: @@ -3123,8 +3158,10 @@ _mesa_CopyTexSubImage3D( GLenum target, GLint level, if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE) _mesa_update_state(ctx); +#if FEATURE_convolve /* XXX should test internal format */ _mesa_adjust_image_for_convolution(ctx, 2, &postConvWidth, &postConvHeight); +#endif if (copytexsubimage_error_check(ctx, 3, target, level, xoffset, yoffset, zoffset, postConvWidth, postConvHeight)) @@ -3147,10 +3184,14 @@ _mesa_CopyTexSubImage3D( GLenum target, GLint level, yoffset += texImage->Border; zoffset += texImage->Border; - ASSERT(ctx->Driver.CopyTexSubImage3D); - (*ctx->Driver.CopyTexSubImage3D)(ctx, target, level, + if (_mesa_clip_copytexsubimage(ctx, &xoffset, &yoffset, &x, &y, + &width, &height)) { + ASSERT(ctx->Driver.CopyTexSubImage3D); + ctx->Driver.CopyTexSubImage3D(ctx, target, level, xoffset, yoffset, zoffset, x, y, width, height); + } + ctx->NewState |= _NEW_TEXTURE; } out: diff --git a/src/mesa/main/teximage.h b/src/mesa/main/teximage.h index f2cad7eb2d..b718c0046d 100644 --- a/src/mesa/main/teximage.h +++ b/src/mesa/main/teximage.h @@ -107,6 +107,11 @@ _mesa_test_proxy_teximage(GLcontext *ctx, GLenum target, GLint level, GLint width, GLint height, GLint depth, GLint border); +extern GLuint +_mesa_tex_target_to_face(GLenum target); + + + /** * Lock a texture for updating. See also _mesa_lock_context_textures(). */ diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index 24d8110b00..2a54ff7ff9 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -29,7 +29,9 @@ #include "glheader.h" +#if FEATURE_colortable #include "colortab.h" +#endif #include "context.h" #include "enums.h" #include "fbobject.h" @@ -140,6 +142,34 @@ _mesa_initialize_texture_object( struct gl_texture_object *obj, /** + * Some texture initialization can't be finished until we know which + * target it's getting bound to (GL_TEXTURE_1D/2D/etc). + */ +static void +finish_texture_init(GLcontext *ctx, GLenum target, + struct gl_texture_object *obj) +{ + assert(obj->Target == 0); + + if (target == GL_TEXTURE_RECTANGLE_NV) { + /* have to init wrap and filter state here - kind of klunky */ + obj->WrapS = GL_CLAMP_TO_EDGE; + obj->WrapT = GL_CLAMP_TO_EDGE; + obj->WrapR = GL_CLAMP_TO_EDGE; + obj->MinFilter = GL_LINEAR; + if (ctx->Driver.TexParameter) { + static const GLfloat fparam_wrap[1] = {(GLfloat) GL_CLAMP_TO_EDGE}; + static const GLfloat fparam_filter[1] = {(GLfloat) GL_LINEAR}; + ctx->Driver.TexParameter(ctx, target, obj, GL_TEXTURE_WRAP_S, fparam_wrap); + ctx->Driver.TexParameter(ctx, target, obj, GL_TEXTURE_WRAP_T, fparam_wrap); + ctx->Driver.TexParameter(ctx, target, obj, GL_TEXTURE_WRAP_R, fparam_wrap); + ctx->Driver.TexParameter(ctx, target, obj, GL_TEXTURE_MIN_FILTER, fparam_filter); + } + } +} + + +/** * Deallocate a texture object struct. It should have already been * removed from the texture object pool. * Called via ctx->Driver.DeleteTexture() if not overriden by a driver. @@ -159,7 +189,9 @@ _mesa_delete_texture_object( GLcontext *ctx, struct gl_texture_object *texObj ) */ texObj->Target = 0x99; +#if FEATURE_colortable _mesa_free_colortable_data(&texObj->Palette); +#endif /* free the texture images */ for (face = 0; face < 6; face++) { @@ -826,44 +858,45 @@ _mesa_BindTexture( GLenum target, GLuint texName ) GET_CURRENT_CONTEXT(ctx); const GLuint unit = ctx->Texture.CurrentUnit; struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; - struct gl_texture_object *newTexObj = NULL; + struct gl_texture_object *newTexObj = NULL, *defaultTexObj = NULL; ASSERT_OUTSIDE_BEGIN_END(ctx); if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) _mesa_debug(ctx, "glBindTexture %s %d\n", _mesa_lookup_enum_by_nr(target), (GLint) texName); + switch (target) { + case GL_TEXTURE_1D: + defaultTexObj = ctx->Shared->Default1D; + break; + case GL_TEXTURE_2D: + defaultTexObj = ctx->Shared->Default2D; + break; + case GL_TEXTURE_3D: + defaultTexObj = ctx->Shared->Default3D; + break; + case GL_TEXTURE_CUBE_MAP_ARB: + defaultTexObj = ctx->Shared->DefaultCubeMap; + break; + case GL_TEXTURE_RECTANGLE_NV: + defaultTexObj = ctx->Shared->DefaultRect; + break; + case GL_TEXTURE_1D_ARRAY_EXT: + defaultTexObj = ctx->Shared->Default1DArray; + break; + case GL_TEXTURE_2D_ARRAY_EXT: + defaultTexObj = ctx->Shared->Default2DArray; + break; + default: + _mesa_error(ctx, GL_INVALID_ENUM, "glBindTexture(target)"); + return; + } + /* * Get pointer to new texture object (newTexObj) */ if (texName == 0) { - /* newTexObj = a default texture object */ - switch (target) { - case GL_TEXTURE_1D: - newTexObj = ctx->Shared->Default1D; - break; - case GL_TEXTURE_2D: - newTexObj = ctx->Shared->Default2D; - break; - case GL_TEXTURE_3D: - newTexObj = ctx->Shared->Default3D; - break; - case GL_TEXTURE_CUBE_MAP_ARB: - newTexObj = ctx->Shared->DefaultCubeMap; - break; - case GL_TEXTURE_RECTANGLE_NV: - newTexObj = ctx->Shared->DefaultRect; - break; - case GL_TEXTURE_1D_ARRAY_EXT: - newTexObj = ctx->Shared->Default1DArray; - break; - case GL_TEXTURE_2D_ARRAY_EXT: - newTexObj = ctx->Shared->Default2DArray; - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glBindTexture(target)"); - return; - } + newTexObj = defaultTexObj; } else { /* non-default texture object */ @@ -871,25 +904,13 @@ _mesa_BindTexture( GLenum target, GLuint texName ) if (newTexObj) { /* error checking */ if (newTexObj->Target != 0 && newTexObj->Target != target) { - /* the named texture object's dimensions don't match the target */ + /* the named texture object's target doesn't match the given target */ _mesa_error( ctx, GL_INVALID_OPERATION, - "glBindTexture(wrong dimensionality)" ); + "glBindTexture(target mismatch)" ); return; } - if (newTexObj->Target == 0 && target == GL_TEXTURE_RECTANGLE_NV) { - /* have to init wrap and filter state here - kind of klunky */ - newTexObj->WrapS = GL_CLAMP_TO_EDGE; - newTexObj->WrapT = GL_CLAMP_TO_EDGE; - newTexObj->WrapR = GL_CLAMP_TO_EDGE; - newTexObj->MinFilter = GL_LINEAR; - if (ctx->Driver.TexParameter) { - static const GLfloat fparam_wrap[1] = {(GLfloat) GL_CLAMP_TO_EDGE}; - static const GLfloat fparam_filter[1] = {(GLfloat) GL_LINEAR}; - (*ctx->Driver.TexParameter)( ctx, target, newTexObj, GL_TEXTURE_WRAP_S, fparam_wrap ); - (*ctx->Driver.TexParameter)( ctx, target, newTexObj, GL_TEXTURE_WRAP_T, fparam_wrap ); - (*ctx->Driver.TexParameter)( ctx, target, newTexObj, GL_TEXTURE_WRAP_R, fparam_wrap ); - (*ctx->Driver.TexParameter)( ctx, target, newTexObj, GL_TEXTURE_MIN_FILTER, fparam_filter ); - } + if (newTexObj->Target == 0) { + finish_texture_init(ctx, target, newTexObj); } } else { diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c new file mode 100644 index 0000000000..acddb6663b --- /dev/null +++ b/src/mesa/main/texparam.c @@ -0,0 +1,1066 @@ +/* + * Mesa 3-D graphics library + * Version: 7.1 + * + * Copyright (C) 1999-2008 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 texparam.c + * + * glTexParameter-related functions + */ + + +#include "main/glheader.h" +#include "main/context.h" +#include "main/enums.h" +#include "main/colormac.h" +#include "main/macros.h" +#include "main/texcompress.h" +#include "main/texparam.h" +#include "main/teximage.h" + + +/** + * Check if a coordinate wrap mode is supported for the texture target. + * \return GL_TRUE if legal, GL_FALSE otherwise + */ +static GLboolean +validate_texture_wrap_mode(GLcontext * ctx, GLenum target, GLenum wrap) +{ + const struct gl_extensions * const e = & ctx->Extensions; + + if (wrap == GL_CLAMP || wrap == GL_CLAMP_TO_EDGE || + (wrap == GL_CLAMP_TO_BORDER && e->ARB_texture_border_clamp)) { + /* any texture target */ + return GL_TRUE; + } + else if (target != GL_TEXTURE_RECTANGLE_NV && + (wrap == GL_REPEAT || + (wrap == GL_MIRRORED_REPEAT && + e->ARB_texture_mirrored_repeat) || + (wrap == GL_MIRROR_CLAMP_EXT && + (e->ATI_texture_mirror_once || e->EXT_texture_mirror_clamp)) || + (wrap == GL_MIRROR_CLAMP_TO_EDGE_EXT && + (e->ATI_texture_mirror_once || e->EXT_texture_mirror_clamp)) || + (wrap == GL_MIRROR_CLAMP_TO_BORDER_EXT && + (e->EXT_texture_mirror_clamp)))) { + /* non-rectangle texture */ + return GL_TRUE; + } + + _mesa_error( ctx, GL_INVALID_VALUE, "glTexParameter(param)" ); + return GL_FALSE; +} + + +void GLAPIENTRY +_mesa_TexParameterf( GLenum target, GLenum pname, GLfloat param ) +{ + _mesa_TexParameterfv(target, pname, ¶m); +} + + +void GLAPIENTRY +_mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params ) +{ + const GLenum eparam = (GLenum) (GLint) params[0]; + struct gl_texture_unit *texUnit; + struct gl_texture_object *texObj; + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END(ctx); + + if (MESA_VERBOSE&(VERBOSE_API|VERBOSE_TEXTURE)) + _mesa_debug(ctx, "glTexParameter %s %s %.1f(%s)...\n", + _mesa_lookup_enum_by_nr(target), + _mesa_lookup_enum_by_nr(pname), + *params, + _mesa_lookup_enum_by_nr(eparam)); + + if (ctx->Texture.CurrentUnit >= ctx->Const.MaxTextureImageUnits) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glTexParameterfv(current unit)"); + return; + } + + texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; + + switch (target) { + case GL_TEXTURE_1D: + texObj = texUnit->Current1D; + break; + case GL_TEXTURE_2D: + texObj = texUnit->Current2D; + break; + case GL_TEXTURE_3D: + texObj = texUnit->Current3D; + break; + case GL_TEXTURE_CUBE_MAP: + if (!ctx->Extensions.ARB_texture_cube_map) { + _mesa_error( ctx, GL_INVALID_ENUM, "glTexParameter(target)" ); + return; + } + texObj = texUnit->CurrentCubeMap; + break; + case GL_TEXTURE_RECTANGLE_NV: + if (!ctx->Extensions.NV_texture_rectangle) { + _mesa_error( ctx, GL_INVALID_ENUM, "glTexParameter(target)" ); + return; + } + texObj = texUnit->CurrentRect; + break; + case GL_TEXTURE_1D_ARRAY_EXT: + if (!ctx->Extensions.MESA_texture_array) { + _mesa_error( ctx, GL_INVALID_ENUM, "glTexParameter(target)" ); + return; + } + texObj = texUnit->Current1DArray; + break; + case GL_TEXTURE_2D_ARRAY_EXT: + if (!ctx->Extensions.MESA_texture_array) { + _mesa_error( ctx, GL_INVALID_ENUM, "glTexParameter(target)" ); + return; + } + texObj = texUnit->Current2DArray; + break; + default: + _mesa_error( ctx, GL_INVALID_ENUM, "glTexParameter(target)" ); + return; + } + + switch (pname) { + case GL_TEXTURE_MIN_FILTER: + /* A small optimization */ + if (texObj->MinFilter == eparam) + return; + if (eparam==GL_NEAREST || eparam==GL_LINEAR) { + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texObj->MinFilter = eparam; + } + else if ((eparam==GL_NEAREST_MIPMAP_NEAREST || + eparam==GL_LINEAR_MIPMAP_NEAREST || + eparam==GL_NEAREST_MIPMAP_LINEAR || + eparam==GL_LINEAR_MIPMAP_LINEAR) && + texObj->Target != GL_TEXTURE_RECTANGLE_NV) { + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texObj->MinFilter = eparam; + } + else { + _mesa_error( ctx, GL_INVALID_VALUE, "glTexParameter(param)" ); + return; + } + break; + case GL_TEXTURE_MAG_FILTER: + /* A small optimization */ + if (texObj->MagFilter == eparam) + return; + + if (eparam==GL_NEAREST || eparam==GL_LINEAR) { + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texObj->MagFilter = eparam; + } + else { + _mesa_error( ctx, GL_INVALID_VALUE, "glTexParameter(param)" ); + return; + } + break; + case GL_TEXTURE_WRAP_S: + if (texObj->WrapS == eparam) + return; + if (validate_texture_wrap_mode(ctx, texObj->Target, eparam)) { + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texObj->WrapS = eparam; + } + else { + return; + } + break; + case GL_TEXTURE_WRAP_T: + if (texObj->WrapT == eparam) + return; + if (validate_texture_wrap_mode(ctx, texObj->Target, eparam)) { + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texObj->WrapT = eparam; + } + else { + return; + } + break; + case GL_TEXTURE_WRAP_R: + if (texObj->WrapR == eparam) + return; + if (validate_texture_wrap_mode(ctx, texObj->Target, eparam)) { + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texObj->WrapR = eparam; + } + else { + return; + } + break; + case GL_TEXTURE_BORDER_COLOR: + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texObj->BorderColor[RCOMP] = params[0]; + texObj->BorderColor[GCOMP] = params[1]; + texObj->BorderColor[BCOMP] = params[2]; + texObj->BorderColor[ACOMP] = params[3]; + UNCLAMPED_FLOAT_TO_CHAN(texObj->_BorderChan[RCOMP], params[0]); + UNCLAMPED_FLOAT_TO_CHAN(texObj->_BorderChan[GCOMP], params[1]); + UNCLAMPED_FLOAT_TO_CHAN(texObj->_BorderChan[BCOMP], params[2]); + UNCLAMPED_FLOAT_TO_CHAN(texObj->_BorderChan[ACOMP], params[3]); + break; + case GL_TEXTURE_MIN_LOD: + if (texObj->MinLod == params[0]) + return; + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texObj->MinLod = params[0]; + break; + case GL_TEXTURE_MAX_LOD: + if (texObj->MaxLod == params[0]) + return; + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texObj->MaxLod = params[0]; + break; + case GL_TEXTURE_BASE_LEVEL: + if (params[0] < 0.0) { + _mesa_error(ctx, GL_INVALID_VALUE, "glTexParameter(param)"); + return; + } + if (target == GL_TEXTURE_RECTANGLE_ARB && params[0] != 0.0) { + _mesa_error(ctx, GL_INVALID_VALUE, "glTexParameter(param)"); + return; + } + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texObj->BaseLevel = (GLint) params[0]; + break; + case GL_TEXTURE_MAX_LEVEL: + if (params[0] < 0.0) { + _mesa_error(ctx, GL_INVALID_VALUE, "glTexParameter(param)"); + return; + } + if (target == GL_TEXTURE_RECTANGLE_ARB) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glTexParameter(param)"); + return; + } + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texObj->MaxLevel = (GLint) params[0]; + break; + case GL_TEXTURE_PRIORITY: + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texObj->Priority = CLAMP( params[0], 0.0F, 1.0F ); + break; + case GL_TEXTURE_MAX_ANISOTROPY_EXT: + if (ctx->Extensions.EXT_texture_filter_anisotropic) { + if (params[0] < 1.0) { + _mesa_error(ctx, GL_INVALID_VALUE, "glTexParameter(param)" ); + return; + } + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + /* clamp to max, that's what NVIDIA does */ + texObj->MaxAnisotropy = MIN2(params[0], + ctx->Const.MaxTextureMaxAnisotropy); + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, + "glTexParameter(pname=GL_TEXTURE_MAX_ANISOTROPY_EXT)"); + return; + } + break; + case GL_TEXTURE_COMPARE_SGIX: + if (ctx->Extensions.SGIX_shadow) { + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texObj->CompareFlag = params[0] ? GL_TRUE : GL_FALSE; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, + "glTexParameter(pname=GL_TEXTURE_COMPARE_SGIX)"); + return; + } + break; + case GL_TEXTURE_COMPARE_OPERATOR_SGIX: + if (ctx->Extensions.SGIX_shadow) { + GLenum op = (GLenum) params[0]; + if (op == GL_TEXTURE_LEQUAL_R_SGIX || + op == GL_TEXTURE_GEQUAL_R_SGIX) { + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texObj->CompareOperator = op; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glTexParameter(param)"); + } + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, + "glTexParameter(pname=GL_TEXTURE_COMPARE_OPERATOR_SGIX)"); + return; + } + break; + case GL_SHADOW_AMBIENT_SGIX: /* aka GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ + if (ctx->Extensions.SGIX_shadow_ambient) { + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texObj->ShadowAmbient = CLAMP(params[0], 0.0F, 1.0F); + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, + "glTexParameter(pname=GL_SHADOW_AMBIENT_SGIX)"); + return; + } + break; + case GL_GENERATE_MIPMAP_SGIS: + if (ctx->Extensions.SGIS_generate_mipmap) { + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texObj->GenerateMipmap = params[0] ? GL_TRUE : GL_FALSE; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, + "glTexParameter(pname=GL_GENERATE_MIPMAP_SGIS)"); + return; + } + break; + case GL_TEXTURE_COMPARE_MODE_ARB: + if (ctx->Extensions.ARB_shadow) { + const GLenum mode = (GLenum) params[0]; + if (mode == GL_NONE || mode == GL_COMPARE_R_TO_TEXTURE_ARB) { + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texObj->CompareMode = mode; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, + "glTexParameter(bad GL_TEXTURE_COMPARE_MODE_ARB: 0x%x)", mode); + return; + } + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, + "glTexParameter(pname=GL_TEXTURE_COMPARE_MODE_ARB)"); + return; + } + break; + case GL_TEXTURE_COMPARE_FUNC_ARB: + if (ctx->Extensions.ARB_shadow) { + const GLenum func = (GLenum) params[0]; + if (func == GL_LEQUAL || func == GL_GEQUAL) { + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texObj->CompareFunc = func; + } + else if (ctx->Extensions.EXT_shadow_funcs && + (func == GL_EQUAL || + func == GL_NOTEQUAL || + func == GL_LESS || + func == GL_GREATER || + func == GL_ALWAYS || + func == GL_NEVER)) { + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texObj->CompareFunc = func; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, + "glTexParameter(bad GL_TEXTURE_COMPARE_FUNC_ARB)"); + return; + } + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, + "glTexParameter(pname=GL_TEXTURE_COMPARE_FUNC_ARB)"); + return; + } + break; + case GL_DEPTH_TEXTURE_MODE_ARB: + if (ctx->Extensions.ARB_depth_texture) { + const GLenum result = (GLenum) params[0]; + if (result == GL_LUMINANCE || result == GL_INTENSITY + || result == GL_ALPHA) { + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texObj->DepthMode = result; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, + "glTexParameter(bad GL_DEPTH_TEXTURE_MODE_ARB)"); + return; + } + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, + "glTexParameter(pname=GL_DEPTH_TEXTURE_MODE_ARB)"); + return; + } + break; + case GL_TEXTURE_LOD_BIAS: + /* NOTE: this is really part of OpenGL 1.4, not EXT_texture_lod_bias*/ + if (ctx->Extensions.EXT_texture_lod_bias) { + if (texObj->LodBias != params[0]) { + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texObj->LodBias = params[0]; + } + } + break; +#ifdef FEATURE_OES_draw_texture + case GL_TEXTURE_CROP_RECT_OES: + texObj->CropRect[0] = (GLint) params[0]; + texObj->CropRect[1] = (GLint) params[1]; + texObj->CropRect[2] = (GLint) params[2]; + texObj->CropRect[3] = (GLint) params[3]; + break; +#endif + + default: + _mesa_error(ctx, GL_INVALID_ENUM, + "glTexParameter(pname=0x%x)", pname); + return; + } + + texObj->_Complete = GL_FALSE; + + if (ctx->Driver.TexParameter) { + (*ctx->Driver.TexParameter)( ctx, target, texObj, pname, params ); + } +} + + +void GLAPIENTRY +_mesa_TexParameteri( GLenum target, GLenum pname, GLint param ) +{ + GLfloat fparam[4]; + if (pname == GL_TEXTURE_PRIORITY) + fparam[0] = INT_TO_FLOAT(param); + else + fparam[0] = (GLfloat) param; + fparam[1] = fparam[2] = fparam[3] = 0.0; + _mesa_TexParameterfv(target, pname, fparam); +} + + +void GLAPIENTRY +_mesa_TexParameteriv( GLenum target, GLenum pname, const GLint *params ) +{ + GLfloat fparam[4]; + if (pname == GL_TEXTURE_BORDER_COLOR) { + fparam[0] = INT_TO_FLOAT(params[0]); + fparam[1] = INT_TO_FLOAT(params[1]); + fparam[2] = INT_TO_FLOAT(params[2]); + fparam[3] = INT_TO_FLOAT(params[3]); + } + else if (pname == GL_TEXTURE_CROP_RECT_OES) { + fparam[0] = (GLfloat) params[0]; + fparam[1] = (GLfloat) params[1]; + fparam[2] = (GLfloat) params[2]; + fparam[3] = (GLfloat) params[3]; + } + else { + if (pname == GL_TEXTURE_PRIORITY) + fparam[0] = INT_TO_FLOAT(params[0]); + else + fparam[0] = (GLfloat) params[0]; + fparam[1] = fparam[2] = fparam[3] = 0.0F; + } + _mesa_TexParameterfv(target, pname, fparam); +} + + +void GLAPIENTRY +_mesa_GetTexLevelParameterfv( GLenum target, GLint level, + GLenum pname, GLfloat *params ) +{ + GLint iparam; + _mesa_GetTexLevelParameteriv( target, level, pname, &iparam ); + *params = (GLfloat) iparam; +} + + +static GLuint +tex_image_dimensions(GLcontext *ctx, GLenum target) +{ + switch (target) { + case GL_TEXTURE_1D: + case GL_PROXY_TEXTURE_1D: + return 1; + case GL_TEXTURE_2D: + case GL_PROXY_TEXTURE_2D: + return 2; + case GL_TEXTURE_3D: + case GL_PROXY_TEXTURE_3D: + return 3; + case GL_TEXTURE_CUBE_MAP: + case GL_PROXY_TEXTURE_CUBE_MAP: + case GL_TEXTURE_CUBE_MAP_POSITIVE_X: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_X: + case GL_TEXTURE_CUBE_MAP_POSITIVE_Y: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: + case GL_TEXTURE_CUBE_MAP_POSITIVE_Z: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: + return ctx->Extensions.ARB_texture_cube_map ? 2 : 0; + case GL_TEXTURE_RECTANGLE_NV: + case GL_PROXY_TEXTURE_RECTANGLE_NV: + return ctx->Extensions.NV_texture_rectangle ? 2 : 0; + case GL_TEXTURE_1D_ARRAY_EXT: + case GL_PROXY_TEXTURE_1D_ARRAY_EXT: + return ctx->Extensions.MESA_texture_array ? 2 : 0; + case GL_TEXTURE_2D_ARRAY_EXT: + case GL_PROXY_TEXTURE_2D_ARRAY_EXT: + return ctx->Extensions.MESA_texture_array ? 3 : 0; + default: + _mesa_problem(ctx, "bad target in _mesa_tex_target_dimensions()"); + return 0; + } +} + + +void GLAPIENTRY +_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; + GLint maxLevels; + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END(ctx); + + if (ctx->Texture.CurrentUnit >= ctx->Const.MaxTextureImageUnits) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glGetTexLevelParameteriv(current unit)"); + return; + } + + texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; + + /* this will catch bad target values */ + dimensions = tex_image_dimensions(ctx, target); /* 1, 2 or 3 */ + if (dimensions == 0) { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexLevelParameter[if]v(target)"); + return; + } + + maxLevels = _mesa_max_texture_levels(ctx, target); + if (maxLevels == 0) { + /* should not happen since <target> was just checked above */ + _mesa_problem(ctx, "maxLevels=0 in _mesa_GetTexLevelParameter"); + return; + } + + if (level < 0 || level >= maxLevels) { + _mesa_error( ctx, GL_INVALID_VALUE, "glGetTexLevelParameter[if]v" ); + return; + } + + 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; + goto out; + } + + isProxy = _mesa_is_proxy_texture(target); + + switch (pname) { + case GL_TEXTURE_WIDTH: + *params = img->Width; + break; + case GL_TEXTURE_HEIGHT: + *params = img->Height; + break; + case GL_TEXTURE_DEPTH: + *params = img->Depth; + break; + case GL_TEXTURE_INTERNAL_FORMAT: + *params = img->InternalFormat; + break; + case GL_TEXTURE_BORDER: + *params = img->Border; + break; + case GL_TEXTURE_RED_SIZE: + if (img->_BaseFormat == GL_RGB || img->_BaseFormat == GL_RGBA) + *params = img->TexFormat->RedBits; + else + *params = 0; + break; + case GL_TEXTURE_GREEN_SIZE: + if (img->_BaseFormat == GL_RGB || img->_BaseFormat == GL_RGBA) + *params = img->TexFormat->GreenBits; + else + *params = 0; + break; + case GL_TEXTURE_BLUE_SIZE: + if (img->_BaseFormat == GL_RGB || img->_BaseFormat == GL_RGBA) + *params = img->TexFormat->BlueBits; + else + *params = 0; + break; + case GL_TEXTURE_ALPHA_SIZE: + if (img->_BaseFormat == GL_ALPHA || + img->_BaseFormat == GL_LUMINANCE_ALPHA || + img->_BaseFormat == GL_RGBA) + *params = img->TexFormat->AlphaBits; + else + *params = 0; + break; + case GL_TEXTURE_INTENSITY_SIZE: + if (img->_BaseFormat != GL_INTENSITY) + *params = 0; + else if (img->TexFormat->IntensityBits > 0) + *params = img->TexFormat->IntensityBits; + else /* intensity probably stored as rgb texture */ + *params = MIN2(img->TexFormat->RedBits, img->TexFormat->GreenBits); + break; + case GL_TEXTURE_LUMINANCE_SIZE: + if (img->_BaseFormat != GL_LUMINANCE && + img->_BaseFormat != GL_LUMINANCE_ALPHA) + *params = 0; + else if (img->TexFormat->LuminanceBits > 0) + *params = img->TexFormat->LuminanceBits; + else /* luminance probably stored as rgb texture */ + *params = MIN2(img->TexFormat->RedBits, img->TexFormat->GreenBits); + break; + case GL_TEXTURE_INDEX_SIZE_EXT: + if (img->_BaseFormat == GL_COLOR_INDEX) + *params = img->TexFormat->IndexBits; + else + *params = 0; + break; + case GL_TEXTURE_DEPTH_SIZE_ARB: + if (ctx->Extensions.SGIX_depth_texture || + ctx->Extensions.ARB_depth_texture) + *params = img->TexFormat->DepthBits; + else + _mesa_error(ctx, GL_INVALID_ENUM, + "glGetTexLevelParameter[if]v(pname)"); + break; + case GL_TEXTURE_STENCIL_SIZE_EXT: + if (ctx->Extensions.EXT_packed_depth_stencil) { + *params = img->TexFormat->StencilBits; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, + "glGetTexLevelParameter[if]v(pname)"); + } + break; + + /* GL_ARB_texture_compression */ + case GL_TEXTURE_COMPRESSED_IMAGE_SIZE: + if (ctx->Extensions.ARB_texture_compression) { + if (img->IsCompressed && !isProxy) { + /* Don't use ctx->Driver.CompressedTextureSize() since that + * may returned a padded hardware size. + */ + *params = _mesa_compressed_texture_size(ctx, img->Width, + img->Height, img->Depth, + img->TexFormat->MesaFormat); + } + else { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glGetTexLevelParameter[if]v(pname)"); + } + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, + "glGetTexLevelParameter[if]v(pname)"); + } + break; + case GL_TEXTURE_COMPRESSED: + if (ctx->Extensions.ARB_texture_compression) { + *params = (GLint) img->IsCompressed; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, + "glGetTexLevelParameter[if]v(pname)"); + } + break; + + /* GL_ARB_texture_float */ + case GL_TEXTURE_RED_TYPE_ARB: + if (ctx->Extensions.ARB_texture_float) { + *params = img->TexFormat->RedBits ? img->TexFormat->DataType : GL_NONE; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, + "glGetTexLevelParameter[if]v(pname)"); + } + break; + case GL_TEXTURE_GREEN_TYPE_ARB: + if (ctx->Extensions.ARB_texture_float) { + *params = img->TexFormat->GreenBits ? img->TexFormat->DataType : GL_NONE; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, + "glGetTexLevelParameter[if]v(pname)"); + } + break; + case GL_TEXTURE_BLUE_TYPE_ARB: + if (ctx->Extensions.ARB_texture_float) { + *params = img->TexFormat->BlueBits ? img->TexFormat->DataType : GL_NONE; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, + "glGetTexLevelParameter[if]v(pname)"); + } + break; + case GL_TEXTURE_ALPHA_TYPE_ARB: + if (ctx->Extensions.ARB_texture_float) { + *params = img->TexFormat->AlphaBits ? img->TexFormat->DataType : GL_NONE; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, + "glGetTexLevelParameter[if]v(pname)"); + } + break; + case GL_TEXTURE_LUMINANCE_TYPE_ARB: + if (ctx->Extensions.ARB_texture_float) { + *params = img->TexFormat->LuminanceBits ? img->TexFormat->DataType : GL_NONE; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, + "glGetTexLevelParameter[if]v(pname)"); + } + break; + case GL_TEXTURE_INTENSITY_TYPE_ARB: + if (ctx->Extensions.ARB_texture_float) { + *params = img->TexFormat->IntensityBits ? img->TexFormat->DataType : GL_NONE; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, + "glGetTexLevelParameter[if]v(pname)"); + } + break; + case GL_TEXTURE_DEPTH_TYPE_ARB: + if (ctx->Extensions.ARB_texture_float) { + *params = img->TexFormat->DepthBits ? img->TexFormat->DataType : GL_NONE; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, + "glGetTexLevelParameter[if]v(pname)"); + } + break; + + default: + _mesa_error(ctx, GL_INVALID_ENUM, + "glGetTexLevelParameter[if]v(pname)"); + } + + out: + _mesa_unlock_texture(ctx, texObj); +} + + + +void GLAPIENTRY +_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); + + if (ctx->Texture.CurrentUnit >= ctx->Const.MaxTextureImageUnits) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glGetTexParameterfv(current unit)"); + return; + } + + texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; + + obj = _mesa_select_tex_object(ctx, texUnit, target); + if (!obj) { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexParameterfv(target)"); + return; + } + + _mesa_lock_texture(ctx, obj); + switch (pname) { + case GL_TEXTURE_MAG_FILTER: + *params = ENUM_TO_FLOAT(obj->MagFilter); + break; + case GL_TEXTURE_MIN_FILTER: + *params = ENUM_TO_FLOAT(obj->MinFilter); + break; + case GL_TEXTURE_WRAP_S: + *params = ENUM_TO_FLOAT(obj->WrapS); + break; + case GL_TEXTURE_WRAP_T: + *params = ENUM_TO_FLOAT(obj->WrapT); + break; + case GL_TEXTURE_WRAP_R: + *params = ENUM_TO_FLOAT(obj->WrapR); + 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); + break; + case GL_TEXTURE_RESIDENT: + { + GLboolean resident; + if (ctx->Driver.IsTextureResident) + resident = ctx->Driver.IsTextureResident(ctx, obj); + else + resident = GL_TRUE; + *params = ENUM_TO_FLOAT(resident); + } + break; + case GL_TEXTURE_PRIORITY: + *params = obj->Priority; + break; + case GL_TEXTURE_MIN_LOD: + *params = obj->MinLod; + break; + case GL_TEXTURE_MAX_LOD: + *params = obj->MaxLod; + break; + case GL_TEXTURE_BASE_LEVEL: + *params = (GLfloat) obj->BaseLevel; + break; + case GL_TEXTURE_MAX_LEVEL: + *params = (GLfloat) obj->MaxLevel; + break; + case GL_TEXTURE_MAX_ANISOTROPY_EXT: + if (ctx->Extensions.EXT_texture_filter_anisotropic) { + *params = obj->MaxAnisotropy; + } + else + error = 1; + break; + case GL_TEXTURE_COMPARE_SGIX: + if (ctx->Extensions.SGIX_shadow) { + *params = (GLfloat) obj->CompareFlag; + } + else + error = 1; + break; + case GL_TEXTURE_COMPARE_OPERATOR_SGIX: + if (ctx->Extensions.SGIX_shadow) { + *params = (GLfloat) obj->CompareOperator; + } + 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; + } + else + error = 1; + break; + case GL_GENERATE_MIPMAP_SGIS: + if (ctx->Extensions.SGIS_generate_mipmap) { + *params = (GLfloat) obj->GenerateMipmap; + } + else + error = 1; + break; + case GL_TEXTURE_COMPARE_MODE_ARB: + if (ctx->Extensions.ARB_shadow) { + *params = (GLfloat) obj->CompareMode; + } + else + error = 1; + break; + case GL_TEXTURE_COMPARE_FUNC_ARB: + if (ctx->Extensions.ARB_shadow) { + *params = (GLfloat) obj->CompareFunc; + } + else + error = 1; + break; + case GL_DEPTH_TEXTURE_MODE_ARB: + if (ctx->Extensions.ARB_depth_texture) { + *params = (GLfloat) obj->DepthMode; + } + else + error = 1; + break; + case GL_TEXTURE_LOD_BIAS: + if (ctx->Extensions.EXT_texture_lod_bias) { + *params = obj->LodBias; + } + else + error = 1; + break; +#ifdef FEATURE_OES_draw_texture + case GL_TEXTURE_CROP_RECT_OES: + params[0] = obj->CropRect[0]; + params[1] = obj->CropRect[1]; + params[2] = obj->CropRect[2]; + params[3] = obj->CropRect[3]; + break; +#endif + default: + error = 1; + break; + } + if (error) + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexParameterfv(pname=0x%x)", + pname); + + _mesa_unlock_texture(ctx, obj); +} + + +void GLAPIENTRY +_mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params ) +{ + struct gl_texture_unit *texUnit; + struct gl_texture_object *obj; + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END(ctx); + + if (ctx->Texture.CurrentUnit >= ctx->Const.MaxTextureImageUnits) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glGetTexParameteriv(current unit)"); + return; + } + + texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; + + obj = _mesa_select_tex_object(ctx, texUnit, target); + if (!obj) { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexParameteriv(target)"); + return; + } + + switch (pname) { + case GL_TEXTURE_MAG_FILTER: + *params = (GLint) obj->MagFilter; + return; + case GL_TEXTURE_MIN_FILTER: + *params = (GLint) obj->MinFilter; + return; + case GL_TEXTURE_WRAP_S: + *params = (GLint) obj->WrapS; + return; + case GL_TEXTURE_WRAP_T: + *params = (GLint) obj->WrapT; + return; + case GL_TEXTURE_WRAP_R: + *params = (GLint) obj->WrapR; + return; + case GL_TEXTURE_BORDER_COLOR: + { + GLfloat b[4]; + b[0] = CLAMP(obj->BorderColor[0], 0.0F, 1.0F); + b[1] = CLAMP(obj->BorderColor[1], 0.0F, 1.0F); + b[2] = CLAMP(obj->BorderColor[2], 0.0F, 1.0F); + b[3] = CLAMP(obj->BorderColor[3], 0.0F, 1.0F); + params[0] = FLOAT_TO_INT(b[0]); + params[1] = FLOAT_TO_INT(b[1]); + params[2] = FLOAT_TO_INT(b[2]); + params[3] = FLOAT_TO_INT(b[3]); + } + return; + case GL_TEXTURE_RESIDENT: + { + GLboolean resident; + if (ctx->Driver.IsTextureResident) + resident = ctx->Driver.IsTextureResident(ctx, obj); + else + resident = GL_TRUE; + *params = (GLint) resident; + } + return; + case GL_TEXTURE_PRIORITY: + *params = FLOAT_TO_INT(obj->Priority); + return; + case GL_TEXTURE_MIN_LOD: + *params = (GLint) obj->MinLod; + return; + case GL_TEXTURE_MAX_LOD: + *params = (GLint) obj->MaxLod; + return; + case GL_TEXTURE_BASE_LEVEL: + *params = obj->BaseLevel; + return; + case GL_TEXTURE_MAX_LEVEL: + *params = obj->MaxLevel; + return; + case GL_TEXTURE_MAX_ANISOTROPY_EXT: + if (ctx->Extensions.EXT_texture_filter_anisotropic) { + *params = (GLint) obj->MaxAnisotropy; + return; + } + break; + case GL_TEXTURE_COMPARE_SGIX: + if (ctx->Extensions.SGIX_shadow) { + *params = (GLint) obj->CompareFlag; + return; + } + break; + case GL_TEXTURE_COMPARE_OPERATOR_SGIX: + if (ctx->Extensions.SGIX_shadow) { + *params = (GLint) obj->CompareOperator; + return; + } + break; + case GL_SHADOW_AMBIENT_SGIX: /* aka GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ + if (ctx->Extensions.SGIX_shadow_ambient) { + *params = (GLint) FLOAT_TO_INT(obj->ShadowAmbient); + return; + } + break; + case GL_GENERATE_MIPMAP_SGIS: + if (ctx->Extensions.SGIS_generate_mipmap) { + *params = (GLint) obj->GenerateMipmap; + return; + } + break; + case GL_TEXTURE_COMPARE_MODE_ARB: + if (ctx->Extensions.ARB_shadow) { + *params = (GLint) obj->CompareMode; + return; + } + break; + case GL_TEXTURE_COMPARE_FUNC_ARB: + if (ctx->Extensions.ARB_shadow) { + *params = (GLint) obj->CompareFunc; + return; + } + break; + case GL_DEPTH_TEXTURE_MODE_ARB: + if (ctx->Extensions.ARB_depth_texture) { + *params = (GLint) obj->DepthMode; + return; + } + break; + case GL_TEXTURE_LOD_BIAS: + if (ctx->Extensions.EXT_texture_lod_bias) { + *params = (GLint) obj->LodBias; + return; + } + break; +#ifdef FEATURE_OES_draw_texture + case GL_TEXTURE_CROP_RECT_OES: + params[0] = obj->CropRect[0]; + params[1] = obj->CropRect[1]; + params[2] = obj->CropRect[2]; + params[3] = obj->CropRect[3]; + break; +#endif + default: + ; /* silence warnings */ + } + /* If we get here, pname was an unrecognized enum */ + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexParameteriv(pname=0x%x)", pname); +} diff --git a/src/mesa/main/texparam.h b/src/mesa/main/texparam.h new file mode 100644 index 0000000000..454b96350e --- /dev/null +++ b/src/mesa/main/texparam.h @@ -0,0 +1,63 @@ +/* + * Mesa 3-D graphics library + * Version: 7.1 + * + * Copyright (C) 1999-2008 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 TEXPARAM_H +#define TEXPARAM_H + + +#include "main/glheader.h" + + +extern void GLAPIENTRY +_mesa_GetTexLevelParameterfv( GLenum target, GLint level, + GLenum pname, GLfloat *params ); + +extern void GLAPIENTRY +_mesa_GetTexLevelParameteriv( GLenum target, GLint level, + GLenum pname, GLint *params ); + +extern void GLAPIENTRY +_mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params ); + +extern void GLAPIENTRY +_mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params ); + + + +extern void GLAPIENTRY +_mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params ); + +extern void GLAPIENTRY +_mesa_TexParameterf( GLenum target, GLenum pname, GLfloat param ); + + +extern void GLAPIENTRY +_mesa_TexParameteri( GLenum target, GLenum pname, GLint param ); + +extern void GLAPIENTRY +_mesa_TexParameteriv( GLenum target, GLenum pname, const GLint *params ); + + +#endif /* TEXPARAM_H */ diff --git a/src/mesa/main/texrender.c b/src/mesa/main/texrender.c index 8d5468aff0..163bda4501 100644 --- a/src/mesa/main/texrender.c +++ b/src/mesa/main/texrender.c @@ -159,7 +159,7 @@ texture_put_row(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, const GLuint *zValues = (const GLuint *) values; for (i = 0; i < count; i++) { if (!mask || mask[i]) { - GLfloat flt = (zValues[i] >> 8) * (1.0 / 0xffffff); + GLfloat flt = (GLfloat) ((zValues[i] >> 8) * (1.0 / 0xffffff)); trb->Store(trb->TexImage, x + i, y, z, &flt); } } @@ -199,7 +199,7 @@ texture_put_mono_row(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, } else if (rb->DataType == GL_UNSIGNED_INT_24_8_EXT) { const GLuint zValue = *((const GLuint *) value); - const GLfloat flt = (zValue >> 8) * (1.0 / 0xffffff); + const GLfloat flt = (GLfloat) ((zValue >> 8) * (1.0 / 0xffffff)); for (i = 0; i < count; i++) { if (!mask || mask[i]) { trb->Store(trb->TexImage, x + i, y, z, &flt); @@ -244,7 +244,7 @@ texture_put_values(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, const GLuint *zValues = (const GLuint *) values; for (i = 0; i < count; i++) { if (!mask || mask[i]) { - GLfloat flt = (zValues[i] >> 8) * (1.0 / 0xffffff); + GLfloat flt = (GLfloat) ((zValues[i] >> 8) * (1.0 / 0xffffff)); trb->Store(trb->TexImage, x[i], y[i] + trb->Yoffset, z, &flt); } } @@ -283,7 +283,7 @@ texture_put_mono_values(GLcontext *ctx, struct gl_renderbuffer *rb, } else if (rb->DataType == GL_UNSIGNED_INT_24_8_EXT) { const GLuint zValue = *((const GLuint *) value); - const GLfloat flt = (zValue >> 8) * (1.0 / 0xffffff); + const GLfloat flt = (GLfloat) ((zValue >> 8) * (1.0 / 0xffffff)); for (i = 0; i < count; i++) { if (!mask || mask[i]) { trb->Store(trb->TexImage, x[i], y[i] + trb->Yoffset, z, &flt); diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c index a6c92cb1af..f019377041 100644 --- a/src/mesa/main/texstate.c +++ b/src/mesa/main/texstate.c @@ -30,7 +30,9 @@ #include "glheader.h" #include "colormac.h" +#if FEATURE_colortable #include "colortab.h" +#endif #include "context.h" #include "enums.h" #include "macros.h" @@ -43,9 +45,6 @@ #include "math/m_xform.h" -#define ENUM_TO_FLOAT(X) ((GLfloat)(GLint)(X)) -#define ENUM_TO_DOUBLE(X) ((GLdouble)(GLint)(X)) - /** * Default texture combine environment state. This is used to initialize @@ -294,2396 +293,6 @@ calculate_derived_texenv( struct gl_tex_env_combine_state *state, } -void GLAPIENTRY -_mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param ) -{ - GLuint maxUnit; - GET_CURRENT_CONTEXT(ctx); - struct gl_texture_unit *texUnit; - ASSERT_OUTSIDE_BEGIN_END(ctx); - - maxUnit = (target == GL_POINT_SPRITE_NV && pname == GL_COORD_REPLACE_NV) - ? ctx->Const.MaxTextureCoordUnits : ctx->Const.MaxTextureImageUnits; - if (ctx->Texture.CurrentUnit >= maxUnit) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glTexEnvfv(current unit)"); - return; - } - - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - -#define TE_ERROR(errCode, msg, value) \ - _mesa_error(ctx, errCode, msg, _mesa_lookup_enum_by_nr(value)); - - if (target == GL_TEXTURE_ENV) { - switch (pname) { - case GL_TEXTURE_ENV_MODE: - { - GLenum mode = (GLenum) (GLint) *param; - if (mode == GL_REPLACE_EXT) - mode = GL_REPLACE; - if (texUnit->EnvMode == mode) - return; - if (mode == GL_MODULATE || - mode == GL_BLEND || - mode == GL_DECAL || - mode == GL_REPLACE || - (mode == GL_ADD && ctx->Extensions.EXT_texture_env_add) || - (mode == GL_COMBINE && - (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine))) { - /* legal */ - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->EnvMode = mode; - } - else { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode); - return; - } - } - break; - case GL_TEXTURE_ENV_COLOR: - { - GLfloat tmp[4]; - tmp[0] = CLAMP( param[0], 0.0F, 1.0F ); - tmp[1] = CLAMP( param[1], 0.0F, 1.0F ); - tmp[2] = CLAMP( param[2], 0.0F, 1.0F ); - tmp[3] = CLAMP( param[3], 0.0F, 1.0F ); - if (TEST_EQ_4V(tmp, texUnit->EnvColor)) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - COPY_4FV(texUnit->EnvColor, tmp); - } - break; - case GL_COMBINE_RGB: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - const GLenum mode = (GLenum) (GLint) *param; - if (texUnit->Combine.ModeRGB == mode) - return; - switch (mode) { - case GL_REPLACE: - case GL_MODULATE: - case GL_ADD: - case GL_ADD_SIGNED: - case GL_INTERPOLATE: - /* OK */ - break; - case GL_SUBTRACT: - if (!ctx->Extensions.ARB_texture_env_combine) { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode); - return; - } - break; - case GL_DOT3_RGB_EXT: - case GL_DOT3_RGBA_EXT: - if (!ctx->Extensions.EXT_texture_env_dot3) { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode); - return; - } - break; - case GL_DOT3_RGB: - case GL_DOT3_RGBA: - if (!ctx->Extensions.ARB_texture_env_dot3) { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode); - return; - } - break; - case GL_MODULATE_ADD_ATI: - case GL_MODULATE_SIGNED_ADD_ATI: - case GL_MODULATE_SUBTRACT_ATI: - if (!ctx->Extensions.ATI_texture_env_combine3) { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode); - return; - } - break; - default: - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode); - return; - } - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->Combine.ModeRGB = mode; - } - else { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); - return; - } - break; - case GL_COMBINE_ALPHA: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - const GLenum mode = (GLenum) (GLint) *param; - if (texUnit->Combine.ModeA == mode) - return; - switch (mode) { - case GL_REPLACE: - case GL_MODULATE: - case GL_ADD: - case GL_ADD_SIGNED: - case GL_INTERPOLATE: - /* OK */ - break; - case GL_SUBTRACT: - if (!ctx->Extensions.ARB_texture_env_combine) { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode); - return; - } - break; - case GL_MODULATE_ADD_ATI: - case GL_MODULATE_SIGNED_ADD_ATI: - case GL_MODULATE_SUBTRACT_ATI: - if (!ctx->Extensions.ATI_texture_env_combine3) { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode); - return; - } - break; - default: - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode); - return; - } - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->Combine.ModeA = mode; - } - else { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); - return; - } - break; - case GL_SOURCE0_RGB: - case GL_SOURCE1_RGB: - case GL_SOURCE2_RGB: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - const GLenum source = (GLenum) (GLint) *param; - const GLuint s = pname - GL_SOURCE0_RGB; - if (texUnit->Combine.SourceRGB[s] == source) - return; - if (source == GL_TEXTURE || - source == GL_CONSTANT || - source == GL_PRIMARY_COLOR || - source == GL_PREVIOUS || - (ctx->Extensions.ARB_texture_env_crossbar && - source >= GL_TEXTURE0 && - source < GL_TEXTURE0 + ctx->Const.MaxTextureUnits) || - (ctx->Extensions.ATI_texture_env_combine3 && - (source == GL_ZERO || source == GL_ONE))) { - /* legal */ - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->Combine.SourceRGB[s] = source; - } - else { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", source); - return; - } - } - else { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); - return; - } - break; - case GL_SOURCE0_ALPHA: - case GL_SOURCE1_ALPHA: - case GL_SOURCE2_ALPHA: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - const GLenum source = (GLenum) (GLint) *param; - const GLuint s = pname - GL_SOURCE0_ALPHA; - if (texUnit->Combine.SourceA[s] == source) - return; - if (source == GL_TEXTURE || - source == GL_CONSTANT || - source == GL_PRIMARY_COLOR || - source == GL_PREVIOUS || - (ctx->Extensions.ARB_texture_env_crossbar && - source >= GL_TEXTURE0 && - source < GL_TEXTURE0 + ctx->Const.MaxTextureUnits) || - (ctx->Extensions.ATI_texture_env_combine3 && - (source == GL_ZERO || source == GL_ONE))) { - /* legal */ - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->Combine.SourceA[s] = source; - } - else { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", source); - return; - } - } - else { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); - return; - } - break; - case GL_OPERAND0_RGB: - case GL_OPERAND1_RGB: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - const GLenum operand = (GLenum) (GLint) *param; - const GLuint s = pname - GL_OPERAND0_RGB; - if (texUnit->Combine.OperandRGB[s] == operand) - return; - switch (operand) { - case GL_SRC_COLOR: - case GL_ONE_MINUS_SRC_COLOR: - case GL_SRC_ALPHA: - case GL_ONE_MINUS_SRC_ALPHA: - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->Combine.OperandRGB[s] = operand; - break; - default: - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", operand); - return; - } - } - else { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); - return; - } - break; - case GL_OPERAND0_ALPHA: - case GL_OPERAND1_ALPHA: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - const GLenum operand = (GLenum) (GLint) *param; - if (texUnit->Combine.OperandA[pname-GL_OPERAND0_ALPHA] == operand) - return; - switch (operand) { - case GL_SRC_ALPHA: - case GL_ONE_MINUS_SRC_ALPHA: - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->Combine.OperandA[pname-GL_OPERAND0_ALPHA] = operand; - break; - default: - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", operand); - return; - } - } - else { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); - return; - } - break; - case GL_OPERAND2_RGB: - if (ctx->Extensions.ARB_texture_env_combine) { - const GLenum operand = (GLenum) (GLint) *param; - if (texUnit->Combine.OperandRGB[2] == operand) - return; - switch (operand) { - case GL_SRC_COLOR: /* ARB combine only */ - case GL_ONE_MINUS_SRC_COLOR: /* ARB combine only */ - case GL_SRC_ALPHA: - case GL_ONE_MINUS_SRC_ALPHA: /* ARB combine only */ - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->Combine.OperandRGB[2] = operand; - break; - default: - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", operand); - return; - } - } - else if (ctx->Extensions.EXT_texture_env_combine) { - const GLenum operand = (GLenum) (GLint) *param; - if (texUnit->Combine.OperandRGB[2] == operand) - return; - /* operand must be GL_SRC_ALPHA which is the initial value - thus - don't need to actually compare the operand to the possible value */ - else { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", operand); - return; - } - } - else { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); - return; - } - break; - case GL_OPERAND2_ALPHA: - if (ctx->Extensions.ARB_texture_env_combine) { - const GLenum operand = (GLenum) (GLint) *param; - if (texUnit->Combine.OperandA[2] == operand) - return; - switch (operand) { - case GL_SRC_ALPHA: - case GL_ONE_MINUS_SRC_ALPHA: /* ARB combine only */ - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->Combine.OperandA[2] = operand; - break; - default: - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", operand); - return; - } - } - else if (ctx->Extensions.EXT_texture_env_combine) { - const GLenum operand = (GLenum) (GLint) *param; - if (texUnit->Combine.OperandA[2] == operand) - return; - /* operand must be GL_SRC_ALPHA which is the initial value - thus - don't need to actually compare the operand to the possible value */ - else { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", operand); - return; - } - } - else { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); - return; - } - break; - case GL_RGB_SCALE: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - GLuint newshift; - if (*param == 1.0) { - newshift = 0; - } - else if (*param == 2.0) { - newshift = 1; - } - else if (*param == 4.0) { - newshift = 2; - } - else { - _mesa_error( ctx, GL_INVALID_VALUE, - "glTexEnv(GL_RGB_SCALE not 1, 2 or 4)" ); - return; - } - if (texUnit->Combine.ScaleShiftRGB == newshift) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->Combine.ScaleShiftRGB = newshift; - } - else { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); - return; - } - break; - case GL_ALPHA_SCALE: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - GLuint newshift; - if (*param == 1.0) { - newshift = 0; - } - else if (*param == 2.0) { - newshift = 1; - } - else if (*param == 4.0) { - newshift = 2; - } - else { - _mesa_error( ctx, GL_INVALID_VALUE, - "glTexEnv(GL_ALPHA_SCALE not 1, 2 or 4)" ); - return; - } - if (texUnit->Combine.ScaleShiftA == newshift) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->Combine.ScaleShiftA = newshift; - } - else { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); - return; - } - break; - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glTexEnv(pname)" ); - return; - } - } - else if (target == GL_TEXTURE_FILTER_CONTROL_EXT) { - /* GL_EXT_texture_lod_bias */ - if (!ctx->Extensions.EXT_texture_lod_bias) { - _mesa_error( ctx, GL_INVALID_ENUM, "glTexEnv(target=0x%x)", target ); - return; - } - if (pname == GL_TEXTURE_LOD_BIAS_EXT) { - if (texUnit->LodBias == param[0]) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->LodBias = param[0]; - } - else { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); - return; - } - } - else if (target == GL_POINT_SPRITE_NV) { - /* GL_ARB_point_sprite / GL_NV_point_sprite */ - if (!ctx->Extensions.NV_point_sprite - && !ctx->Extensions.ARB_point_sprite) { - _mesa_error( ctx, GL_INVALID_ENUM, "glTexEnv(target=0x%x)", target ); - return; - } - if (pname == GL_COORD_REPLACE_NV) { - const GLenum value = (GLenum) param[0]; - if (value == GL_TRUE || value == GL_FALSE) { - /* It's kind of weird to set point state via glTexEnv, - * but that's what the spec calls for. - */ - const GLboolean state = (GLboolean) value; - if (ctx->Point.CoordReplace[ctx->Texture.CurrentUnit] == state) - return; - FLUSH_VERTICES(ctx, _NEW_POINT); - ctx->Point.CoordReplace[ctx->Texture.CurrentUnit] = state; - } - else { - _mesa_error( ctx, GL_INVALID_VALUE, "glTexEnv(param=0x%x)", value); - return; - } - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glTexEnv(pname=0x%x)", pname ); - return; - } - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glTexEnv(target=0x%x)",target ); - return; - } - - if (MESA_VERBOSE&(VERBOSE_API|VERBOSE_TEXTURE)) - _mesa_debug(ctx, "glTexEnv %s %s %.1f(%s) ...\n", - _mesa_lookup_enum_by_nr(target), - _mesa_lookup_enum_by_nr(pname), - *param, - _mesa_lookup_enum_by_nr((GLenum) (GLint) *param)); - - /* Tell device driver about the new texture environment */ - if (ctx->Driver.TexEnv) { - (*ctx->Driver.TexEnv)( ctx, target, pname, param ); - } -} - - -void GLAPIENTRY -_mesa_TexEnvf( GLenum target, GLenum pname, GLfloat param ) -{ - _mesa_TexEnvfv( target, pname, ¶m ); -} - - - -void GLAPIENTRY -_mesa_TexEnvi( GLenum target, GLenum pname, GLint param ) -{ - GLfloat p[4]; - p[0] = (GLfloat) param; - p[1] = p[2] = p[3] = 0.0; - _mesa_TexEnvfv( target, pname, p ); -} - - -void GLAPIENTRY -_mesa_TexEnviv( GLenum target, GLenum pname, const GLint *param ) -{ - GLfloat p[4]; - if (pname == GL_TEXTURE_ENV_COLOR) { - p[0] = INT_TO_FLOAT( param[0] ); - p[1] = INT_TO_FLOAT( param[1] ); - p[2] = INT_TO_FLOAT( param[2] ); - p[3] = INT_TO_FLOAT( param[3] ); - } - else { - p[0] = (GLfloat) param[0]; - p[1] = p[2] = p[3] = 0; /* init to zero, just to be safe */ - } - _mesa_TexEnvfv( target, pname, p ); -} - - -void GLAPIENTRY -_mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params ) -{ - GLuint maxUnit; - const struct gl_texture_unit *texUnit; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - maxUnit = (target == GL_POINT_SPRITE_NV && pname == GL_COORD_REPLACE_NV) - ? ctx->Const.MaxTextureCoordUnits : ctx->Const.MaxTextureImageUnits; - if (ctx->Texture.CurrentUnit >= maxUnit) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexEnvfv(current unit)"); - return; - } - - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - - if (target == GL_TEXTURE_ENV) { - switch (pname) { - case GL_TEXTURE_ENV_MODE: - *params = ENUM_TO_FLOAT(texUnit->EnvMode); - break; - case GL_TEXTURE_ENV_COLOR: - COPY_4FV( params, texUnit->EnvColor ); - break; - case GL_COMBINE_RGB: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - *params = (GLfloat) texUnit->Combine.ModeRGB; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); - } - break; - case GL_COMBINE_ALPHA: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - *params = (GLfloat) texUnit->Combine.ModeA; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); - } - break; - case GL_SOURCE0_RGB: - case GL_SOURCE1_RGB: - case GL_SOURCE2_RGB: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - const unsigned rgb_idx = pname - GL_SOURCE0_RGB; - *params = (GLfloat) texUnit->Combine.SourceRGB[rgb_idx]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); - } - break; - case GL_SOURCE0_ALPHA: - case GL_SOURCE1_ALPHA: - case GL_SOURCE2_ALPHA: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - const unsigned alpha_idx = pname - GL_SOURCE0_ALPHA; - *params = (GLfloat) texUnit->Combine.SourceA[alpha_idx]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); - } - break; - case GL_OPERAND0_RGB: - case GL_OPERAND1_RGB: - case GL_OPERAND2_RGB: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - const unsigned op_rgb = pname - GL_OPERAND0_RGB; - *params = (GLfloat) texUnit->Combine.OperandRGB[op_rgb]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); - } - break; - case GL_OPERAND0_ALPHA: - case GL_OPERAND1_ALPHA: - case GL_OPERAND2_ALPHA: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - const unsigned op_alpha = pname - GL_OPERAND0_ALPHA; - *params = (GLfloat) texUnit->Combine.OperandA[op_alpha]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); - } - break; - case GL_RGB_SCALE: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - if (texUnit->Combine.ScaleShiftRGB == 0) - *params = 1.0; - else if (texUnit->Combine.ScaleShiftRGB == 1) - *params = 2.0; - else - *params = 4.0; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); - return; - } - break; - case GL_ALPHA_SCALE: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - if (texUnit->Combine.ScaleShiftA == 0) - *params = 1.0; - else if (texUnit->Combine.ScaleShiftA == 1) - *params = 2.0; - else - *params = 4.0; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); - return; - } - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname=0x%x)", pname); - } - } - else if (target == GL_TEXTURE_FILTER_CONTROL_EXT) { - /* GL_EXT_texture_lod_bias */ - if (!ctx->Extensions.EXT_texture_lod_bias) { - _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnvfv(target)" ); - return; - } - if (pname == GL_TEXTURE_LOD_BIAS_EXT) { - *params = texUnit->LodBias; - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)" ); - return; - } - } - else if (target == GL_POINT_SPRITE_NV) { - /* GL_ARB_point_sprite / GL_NV_point_sprite */ - if (!ctx->Extensions.NV_point_sprite - && !ctx->Extensions.ARB_point_sprite) { - _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnvfv(target)" ); - return; - } - if (pname == GL_COORD_REPLACE_NV) { - *params = (GLfloat) ctx->Point.CoordReplace[ctx->Texture.CurrentUnit]; - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)" ); - return; - } - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnvfv(target)" ); - return; - } -} - - -void GLAPIENTRY -_mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params ) -{ - GLuint maxUnit; - const struct gl_texture_unit *texUnit; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - maxUnit = (target == GL_POINT_SPRITE_NV && pname == GL_COORD_REPLACE_NV) - ? ctx->Const.MaxTextureCoordUnits : ctx->Const.MaxTextureImageUnits; - if (ctx->Texture.CurrentUnit >= maxUnit) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexEnviv(current unit)"); - return; - } - - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - - if (target == GL_TEXTURE_ENV) { - switch (pname) { - case GL_TEXTURE_ENV_MODE: - *params = (GLint) texUnit->EnvMode; - break; - case GL_TEXTURE_ENV_COLOR: - params[0] = FLOAT_TO_INT( texUnit->EnvColor[0] ); - params[1] = FLOAT_TO_INT( texUnit->EnvColor[1] ); - params[2] = FLOAT_TO_INT( texUnit->EnvColor[2] ); - params[3] = FLOAT_TO_INT( texUnit->EnvColor[3] ); - break; - case GL_COMBINE_RGB: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - *params = (GLint) texUnit->Combine.ModeRGB; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); - } - break; - case GL_COMBINE_ALPHA: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - *params = (GLint) texUnit->Combine.ModeA; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); - } - break; - case GL_SOURCE0_RGB: - case GL_SOURCE1_RGB: - case GL_SOURCE2_RGB: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - const unsigned rgb_idx = pname - GL_SOURCE0_RGB; - *params = (GLint) texUnit->Combine.SourceRGB[rgb_idx]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); - } - break; - case GL_SOURCE0_ALPHA: - case GL_SOURCE1_ALPHA: - case GL_SOURCE2_ALPHA: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - const unsigned alpha_idx = pname - GL_SOURCE0_ALPHA; - *params = (GLint) texUnit->Combine.SourceA[alpha_idx]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); - } - break; - case GL_OPERAND0_RGB: - case GL_OPERAND1_RGB: - case GL_OPERAND2_RGB: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - const unsigned op_rgb = pname - GL_OPERAND0_RGB; - *params = (GLint) texUnit->Combine.OperandRGB[op_rgb]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); - } - break; - case GL_OPERAND0_ALPHA: - case GL_OPERAND1_ALPHA: - case GL_OPERAND2_ALPHA: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - const unsigned op_alpha = pname - GL_OPERAND0_ALPHA; - *params = (GLint) texUnit->Combine.OperandA[op_alpha]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); - } - break; - case GL_RGB_SCALE: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - if (texUnit->Combine.ScaleShiftRGB == 0) - *params = 1; - else if (texUnit->Combine.ScaleShiftRGB == 1) - *params = 2; - else - *params = 4; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); - return; - } - break; - case GL_ALPHA_SCALE: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - if (texUnit->Combine.ScaleShiftA == 0) - *params = 1; - else if (texUnit->Combine.ScaleShiftA == 1) - *params = 2; - else - *params = 4; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); - return; - } - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname=0x%x)", - pname); - } - } - else if (target == GL_TEXTURE_FILTER_CONTROL_EXT) { - /* GL_EXT_texture_lod_bias */ - if (!ctx->Extensions.EXT_texture_lod_bias) { - _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnviv(target)" ); - return; - } - if (pname == GL_TEXTURE_LOD_BIAS_EXT) { - *params = (GLint) texUnit->LodBias; - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)" ); - return; - } - } - else if (target == GL_POINT_SPRITE_NV) { - /* GL_ARB_point_sprite / GL_NV_point_sprite */ - if (!ctx->Extensions.NV_point_sprite - && !ctx->Extensions.ARB_point_sprite) { - _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnviv(target)" ); - return; - } - if (pname == GL_COORD_REPLACE_NV) { - *params = (GLint) ctx->Point.CoordReplace[ctx->Texture.CurrentUnit]; - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)" ); - return; - } - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnviv(target)" ); - return; - } -} - - - - -/**********************************************************************/ -/* Texture Parameters */ -/**********************************************************************/ - -/** - * Check if a coordinate wrap mode is supported for the texture target. - * \return GL_TRUE if legal, GL_FALSE otherwise - */ -static GLboolean -validate_texture_wrap_mode(GLcontext * ctx, GLenum target, GLenum wrap) -{ - const struct gl_extensions * const e = & ctx->Extensions; - - if (wrap == GL_CLAMP || wrap == GL_CLAMP_TO_EDGE || - (wrap == GL_CLAMP_TO_BORDER && e->ARB_texture_border_clamp)) { - /* any texture target */ - return GL_TRUE; - } - else if (target != GL_TEXTURE_RECTANGLE_NV && - (wrap == GL_REPEAT || - (wrap == GL_MIRRORED_REPEAT && - e->ARB_texture_mirrored_repeat) || - (wrap == GL_MIRROR_CLAMP_EXT && - (e->ATI_texture_mirror_once || e->EXT_texture_mirror_clamp)) || - (wrap == GL_MIRROR_CLAMP_TO_EDGE_EXT && - (e->ATI_texture_mirror_once || e->EXT_texture_mirror_clamp)) || - (wrap == GL_MIRROR_CLAMP_TO_BORDER_EXT && - (e->EXT_texture_mirror_clamp)))) { - /* non-rectangle texture */ - return GL_TRUE; - } - - _mesa_error( ctx, GL_INVALID_VALUE, "glTexParameter(param)" ); - return GL_FALSE; -} - - -void GLAPIENTRY -_mesa_TexParameterf( GLenum target, GLenum pname, GLfloat param ) -{ - _mesa_TexParameterfv(target, pname, ¶m); -} - - -void GLAPIENTRY -_mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params ) -{ - const GLenum eparam = (GLenum) (GLint) params[0]; - struct gl_texture_unit *texUnit; - struct gl_texture_object *texObj; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (MESA_VERBOSE&(VERBOSE_API|VERBOSE_TEXTURE)) - _mesa_debug(ctx, "glTexParameter %s %s %.1f(%s)...\n", - _mesa_lookup_enum_by_nr(target), - _mesa_lookup_enum_by_nr(pname), - *params, - _mesa_lookup_enum_by_nr(eparam)); - - if (ctx->Texture.CurrentUnit >= ctx->Const.MaxTextureImageUnits) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glTexParameterfv(current unit)"); - return; - } - - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - - switch (target) { - case GL_TEXTURE_1D: - texObj = texUnit->Current1D; - break; - case GL_TEXTURE_2D: - texObj = texUnit->Current2D; - break; - case GL_TEXTURE_3D: - texObj = texUnit->Current3D; - break; - case GL_TEXTURE_CUBE_MAP: - if (!ctx->Extensions.ARB_texture_cube_map) { - _mesa_error( ctx, GL_INVALID_ENUM, "glTexParameter(target)" ); - return; - } - texObj = texUnit->CurrentCubeMap; - break; - case GL_TEXTURE_RECTANGLE_NV: - if (!ctx->Extensions.NV_texture_rectangle) { - _mesa_error( ctx, GL_INVALID_ENUM, "glTexParameter(target)" ); - return; - } - texObj = texUnit->CurrentRect; - break; - case GL_TEXTURE_1D_ARRAY_EXT: - if (!ctx->Extensions.MESA_texture_array) { - _mesa_error( ctx, GL_INVALID_ENUM, "glTexParameter(target)" ); - return; - } - texObj = texUnit->Current1DArray; - break; - case GL_TEXTURE_2D_ARRAY_EXT: - if (!ctx->Extensions.MESA_texture_array) { - _mesa_error( ctx, GL_INVALID_ENUM, "glTexParameter(target)" ); - return; - } - texObj = texUnit->Current2DArray; - break; - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glTexParameter(target)" ); - return; - } - - switch (pname) { - case GL_TEXTURE_MIN_FILTER: - /* A small optimization */ - if (texObj->MinFilter == eparam) - return; - if (eparam==GL_NEAREST || eparam==GL_LINEAR) { - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->MinFilter = eparam; - } - else if ((eparam==GL_NEAREST_MIPMAP_NEAREST || - eparam==GL_LINEAR_MIPMAP_NEAREST || - eparam==GL_NEAREST_MIPMAP_LINEAR || - eparam==GL_LINEAR_MIPMAP_LINEAR) && - texObj->Target != GL_TEXTURE_RECTANGLE_NV) { - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->MinFilter = eparam; - } - else { - _mesa_error( ctx, GL_INVALID_VALUE, "glTexParameter(param)" ); - return; - } - break; - case GL_TEXTURE_MAG_FILTER: - /* A small optimization */ - if (texObj->MagFilter == eparam) - return; - - if (eparam==GL_NEAREST || eparam==GL_LINEAR) { - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->MagFilter = eparam; - } - else { - _mesa_error( ctx, GL_INVALID_VALUE, "glTexParameter(param)" ); - return; - } - break; - case GL_TEXTURE_WRAP_S: - if (texObj->WrapS == eparam) - return; - if (validate_texture_wrap_mode(ctx, texObj->Target, eparam)) { - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->WrapS = eparam; - } - else { - return; - } - break; - case GL_TEXTURE_WRAP_T: - if (texObj->WrapT == eparam) - return; - if (validate_texture_wrap_mode(ctx, texObj->Target, eparam)) { - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->WrapT = eparam; - } - else { - return; - } - break; - case GL_TEXTURE_WRAP_R: - if (texObj->WrapR == eparam) - return; - if (validate_texture_wrap_mode(ctx, texObj->Target, eparam)) { - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->WrapR = eparam; - } - else { - return; - } - break; - case GL_TEXTURE_BORDER_COLOR: - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->BorderColor[RCOMP] = params[0]; - texObj->BorderColor[GCOMP] = params[1]; - texObj->BorderColor[BCOMP] = params[2]; - texObj->BorderColor[ACOMP] = params[3]; - UNCLAMPED_FLOAT_TO_CHAN(texObj->_BorderChan[RCOMP], params[0]); - UNCLAMPED_FLOAT_TO_CHAN(texObj->_BorderChan[GCOMP], params[1]); - UNCLAMPED_FLOAT_TO_CHAN(texObj->_BorderChan[BCOMP], params[2]); - UNCLAMPED_FLOAT_TO_CHAN(texObj->_BorderChan[ACOMP], params[3]); - break; - case GL_TEXTURE_MIN_LOD: - if (texObj->MinLod == params[0]) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->MinLod = params[0]; - break; - case GL_TEXTURE_MAX_LOD: - if (texObj->MaxLod == params[0]) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->MaxLod = params[0]; - break; - case GL_TEXTURE_BASE_LEVEL: - if (params[0] < 0.0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glTexParameter(param)"); - return; - } - if (target == GL_TEXTURE_RECTANGLE_ARB && params[0] != 0.0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glTexParameter(param)"); - return; - } - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->BaseLevel = (GLint) params[0]; - break; - case GL_TEXTURE_MAX_LEVEL: - if (params[0] < 0.0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glTexParameter(param)"); - return; - } - if (target == GL_TEXTURE_RECTANGLE_ARB) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glTexParameter(param)"); - return; - } - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->MaxLevel = (GLint) params[0]; - break; - case GL_TEXTURE_PRIORITY: - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->Priority = CLAMP( params[0], 0.0F, 1.0F ); - break; - case GL_TEXTURE_MAX_ANISOTROPY_EXT: - if (ctx->Extensions.EXT_texture_filter_anisotropic) { - if (params[0] < 1.0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glTexParameter(param)" ); - return; - } - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - /* clamp to max, that's what NVIDIA does */ - texObj->MaxAnisotropy = MIN2(params[0], - ctx->Const.MaxTextureMaxAnisotropy); - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glTexParameter(pname=GL_TEXTURE_MAX_ANISOTROPY_EXT)"); - return; - } - break; - case GL_TEXTURE_COMPARE_SGIX: - if (ctx->Extensions.SGIX_shadow) { - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->CompareFlag = params[0] ? GL_TRUE : GL_FALSE; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glTexParameter(pname=GL_TEXTURE_COMPARE_SGIX)"); - return; - } - break; - case GL_TEXTURE_COMPARE_OPERATOR_SGIX: - if (ctx->Extensions.SGIX_shadow) { - GLenum op = (GLenum) params[0]; - if (op == GL_TEXTURE_LEQUAL_R_SGIX || - op == GL_TEXTURE_GEQUAL_R_SGIX) { - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->CompareOperator = op; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glTexParameter(param)"); - } - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glTexParameter(pname=GL_TEXTURE_COMPARE_OPERATOR_SGIX)"); - return; - } - break; - case GL_SHADOW_AMBIENT_SGIX: /* aka GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ - if (ctx->Extensions.SGIX_shadow_ambient) { - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->ShadowAmbient = CLAMP(params[0], 0.0F, 1.0F); - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glTexParameter(pname=GL_SHADOW_AMBIENT_SGIX)"); - return; - } - break; - case GL_GENERATE_MIPMAP_SGIS: - if (ctx->Extensions.SGIS_generate_mipmap) { - texObj->GenerateMipmap = params[0] ? GL_TRUE : GL_FALSE; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glTexParameter(pname=GL_GENERATE_MIPMAP_SGIS)"); - return; - } - break; - case GL_TEXTURE_COMPARE_MODE_ARB: - if (ctx->Extensions.ARB_shadow) { - const GLenum mode = (GLenum) params[0]; - if (mode == GL_NONE || mode == GL_COMPARE_R_TO_TEXTURE_ARB) { - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->CompareMode = mode; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glTexParameter(bad GL_TEXTURE_COMPARE_MODE_ARB: 0x%x)", mode); - return; - } - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glTexParameter(pname=GL_TEXTURE_COMPARE_MODE_ARB)"); - return; - } - break; - case GL_TEXTURE_COMPARE_FUNC_ARB: - if (ctx->Extensions.ARB_shadow) { - const GLenum func = (GLenum) params[0]; - if (func == GL_LEQUAL || func == GL_GEQUAL) { - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->CompareFunc = func; - } - else if (ctx->Extensions.EXT_shadow_funcs && - (func == GL_EQUAL || - func == GL_NOTEQUAL || - func == GL_LESS || - func == GL_GREATER || - func == GL_ALWAYS || - func == GL_NEVER)) { - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->CompareFunc = func; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glTexParameter(bad GL_TEXTURE_COMPARE_FUNC_ARB)"); - return; - } - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glTexParameter(pname=GL_TEXTURE_COMPARE_FUNC_ARB)"); - return; - } - break; - case GL_DEPTH_TEXTURE_MODE_ARB: - if (ctx->Extensions.ARB_depth_texture) { - const GLenum result = (GLenum) params[0]; - if (result == GL_LUMINANCE || result == GL_INTENSITY - || result == GL_ALPHA) { - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->DepthMode = result; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glTexParameter(bad GL_DEPTH_TEXTURE_MODE_ARB)"); - return; - } - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glTexParameter(pname=GL_DEPTH_TEXTURE_MODE_ARB)"); - return; - } - break; - case GL_TEXTURE_LOD_BIAS: - /* NOTE: this is really part of OpenGL 1.4, not EXT_texture_lod_bias*/ - if (ctx->Extensions.EXT_texture_lod_bias) { - if (texObj->LodBias != params[0]) { - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->LodBias = params[0]; - } - } - break; - - default: - _mesa_error(ctx, GL_INVALID_ENUM, - "glTexParameter(pname=0x%x)", pname); - return; - } - - texObj->_Complete = GL_FALSE; - - if (ctx->Driver.TexParameter) { - (*ctx->Driver.TexParameter)( ctx, target, texObj, pname, params ); - } -} - - -void GLAPIENTRY -_mesa_TexParameteri( GLenum target, GLenum pname, GLint param ) -{ - GLfloat fparam[4]; - if (pname == GL_TEXTURE_PRIORITY) - fparam[0] = INT_TO_FLOAT(param); - else - fparam[0] = (GLfloat) param; - fparam[1] = fparam[2] = fparam[3] = 0.0; - _mesa_TexParameterfv(target, pname, fparam); -} - - -void GLAPIENTRY -_mesa_TexParameteriv( GLenum target, GLenum pname, const GLint *params ) -{ - GLfloat fparam[4]; - if (pname == GL_TEXTURE_BORDER_COLOR) { - fparam[0] = INT_TO_FLOAT(params[0]); - fparam[1] = INT_TO_FLOAT(params[1]); - fparam[2] = INT_TO_FLOAT(params[2]); - fparam[3] = INT_TO_FLOAT(params[3]); - } - else { - if (pname == GL_TEXTURE_PRIORITY) - fparam[0] = INT_TO_FLOAT(params[0]); - else - fparam[0] = (GLfloat) params[0]; - fparam[1] = fparam[2] = fparam[3] = 0.0F; - } - _mesa_TexParameterfv(target, pname, fparam); -} - - -void GLAPIENTRY -_mesa_GetTexLevelParameterfv( GLenum target, GLint level, - GLenum pname, GLfloat *params ) -{ - GLint iparam; - _mesa_GetTexLevelParameteriv( target, level, pname, &iparam ); - *params = (GLfloat) iparam; -} - - -static GLuint -tex_image_dimensions(GLcontext *ctx, GLenum target) -{ - switch (target) { - case GL_TEXTURE_1D: - case GL_PROXY_TEXTURE_1D: - return 1; - case GL_TEXTURE_2D: - case GL_PROXY_TEXTURE_2D: - return 2; - case GL_TEXTURE_3D: - case GL_PROXY_TEXTURE_3D: - return 3; - case GL_TEXTURE_CUBE_MAP: - case GL_PROXY_TEXTURE_CUBE_MAP: - case GL_TEXTURE_CUBE_MAP_POSITIVE_X: - case GL_TEXTURE_CUBE_MAP_NEGATIVE_X: - case GL_TEXTURE_CUBE_MAP_POSITIVE_Y: - case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: - case GL_TEXTURE_CUBE_MAP_POSITIVE_Z: - case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: - return ctx->Extensions.ARB_texture_cube_map ? 2 : 0; - case GL_TEXTURE_RECTANGLE_NV: - case GL_PROXY_TEXTURE_RECTANGLE_NV: - return ctx->Extensions.NV_texture_rectangle ? 2 : 0; - case GL_TEXTURE_1D_ARRAY_EXT: - case GL_PROXY_TEXTURE_1D_ARRAY_EXT: - return ctx->Extensions.MESA_texture_array ? 2 : 0; - case GL_TEXTURE_2D_ARRAY_EXT: - case GL_PROXY_TEXTURE_2D_ARRAY_EXT: - return ctx->Extensions.MESA_texture_array ? 3 : 0; - default: - _mesa_problem(ctx, "bad target in _mesa_tex_target_dimensions()"); - return 0; - } -} - - -void GLAPIENTRY -_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; - GLint maxLevels; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (ctx->Texture.CurrentUnit >= ctx->Const.MaxTextureImageUnits) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetTexLevelParameteriv(current unit)"); - return; - } - - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - - /* this will catch bad target values */ - dimensions = tex_image_dimensions(ctx, target); /* 1, 2 or 3 */ - if (dimensions == 0) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexLevelParameter[if]v(target)"); - return; - } - - maxLevels = _mesa_max_texture_levels(ctx, target); - if (maxLevels == 0) { - /* should not happen since <target> was just checked above */ - _mesa_problem(ctx, "maxLevels=0 in _mesa_GetTexLevelParameter"); - return; - } - - if (level < 0 || level >= maxLevels) { - _mesa_error( ctx, GL_INVALID_VALUE, "glGetTexLevelParameter[if]v" ); - return; - } - - 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; - goto out; - } - - isProxy = _mesa_is_proxy_texture(target); - - switch (pname) { - case GL_TEXTURE_WIDTH: - *params = img->Width; - break; - case GL_TEXTURE_HEIGHT: - *params = img->Height; - break; - case GL_TEXTURE_DEPTH: - *params = img->Depth; - break; - case GL_TEXTURE_INTERNAL_FORMAT: - *params = img->InternalFormat; - break; - case GL_TEXTURE_BORDER: - *params = img->Border; - break; - case GL_TEXTURE_RED_SIZE: - if (img->_BaseFormat == GL_RGB || img->_BaseFormat == GL_RGBA) - *params = img->TexFormat->RedBits; - else - *params = 0; - break; - case GL_TEXTURE_GREEN_SIZE: - if (img->_BaseFormat == GL_RGB || img->_BaseFormat == GL_RGBA) - *params = img->TexFormat->GreenBits; - else - *params = 0; - break; - case GL_TEXTURE_BLUE_SIZE: - if (img->_BaseFormat == GL_RGB || img->_BaseFormat == GL_RGBA) - *params = img->TexFormat->BlueBits; - else - *params = 0; - break; - case GL_TEXTURE_ALPHA_SIZE: - if (img->_BaseFormat == GL_ALPHA || - img->_BaseFormat == GL_LUMINANCE_ALPHA || - img->_BaseFormat == GL_RGBA) - *params = img->TexFormat->AlphaBits; - else - *params = 0; - break; - case GL_TEXTURE_INTENSITY_SIZE: - if (img->_BaseFormat != GL_INTENSITY) - *params = 0; - else if (img->TexFormat->IntensityBits > 0) - *params = img->TexFormat->IntensityBits; - else /* intensity probably stored as rgb texture */ - *params = MIN2(img->TexFormat->RedBits, img->TexFormat->GreenBits); - break; - case GL_TEXTURE_LUMINANCE_SIZE: - if (img->_BaseFormat != GL_LUMINANCE && - img->_BaseFormat != GL_LUMINANCE_ALPHA) - *params = 0; - else if (img->TexFormat->LuminanceBits > 0) - *params = img->TexFormat->LuminanceBits; - else /* luminance probably stored as rgb texture */ - *params = MIN2(img->TexFormat->RedBits, img->TexFormat->GreenBits); - break; - case GL_TEXTURE_INDEX_SIZE_EXT: - if (img->_BaseFormat == GL_COLOR_INDEX) - *params = img->TexFormat->IndexBits; - else - *params = 0; - break; - case GL_TEXTURE_DEPTH_SIZE_ARB: - if (ctx->Extensions.SGIX_depth_texture || - ctx->Extensions.ARB_depth_texture) - *params = img->TexFormat->DepthBits; - else - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetTexLevelParameter[if]v(pname)"); - break; - case GL_TEXTURE_STENCIL_SIZE_EXT: - if (ctx->Extensions.EXT_packed_depth_stencil) { - *params = img->TexFormat->StencilBits; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetTexLevelParameter[if]v(pname)"); - } - break; - - /* GL_ARB_texture_compression */ - case GL_TEXTURE_COMPRESSED_IMAGE_SIZE: - if (ctx->Extensions.ARB_texture_compression) { - if (img->IsCompressed && !isProxy) { - /* Don't use ctx->Driver.CompressedTextureSize() since that - * may returned a padded hardware size. - */ - *params = _mesa_compressed_texture_size(ctx, img->Width, - img->Height, img->Depth, - img->TexFormat->MesaFormat); - } - else { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetTexLevelParameter[if]v(pname)"); - } - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetTexLevelParameter[if]v(pname)"); - } - break; - case GL_TEXTURE_COMPRESSED: - if (ctx->Extensions.ARB_texture_compression) { - *params = (GLint) img->IsCompressed; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetTexLevelParameter[if]v(pname)"); - } - break; - - /* GL_ARB_texture_float */ - case GL_TEXTURE_RED_TYPE_ARB: - if (ctx->Extensions.ARB_texture_float) { - *params = img->TexFormat->RedBits ? img->TexFormat->DataType : GL_NONE; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetTexLevelParameter[if]v(pname)"); - } - break; - case GL_TEXTURE_GREEN_TYPE_ARB: - if (ctx->Extensions.ARB_texture_float) { - *params = img->TexFormat->GreenBits ? img->TexFormat->DataType : GL_NONE; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetTexLevelParameter[if]v(pname)"); - } - break; - case GL_TEXTURE_BLUE_TYPE_ARB: - if (ctx->Extensions.ARB_texture_float) { - *params = img->TexFormat->BlueBits ? img->TexFormat->DataType : GL_NONE; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetTexLevelParameter[if]v(pname)"); - } - break; - case GL_TEXTURE_ALPHA_TYPE_ARB: - if (ctx->Extensions.ARB_texture_float) { - *params = img->TexFormat->AlphaBits ? img->TexFormat->DataType : GL_NONE; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetTexLevelParameter[if]v(pname)"); - } - break; - case GL_TEXTURE_LUMINANCE_TYPE_ARB: - if (ctx->Extensions.ARB_texture_float) { - *params = img->TexFormat->LuminanceBits ? img->TexFormat->DataType : GL_NONE; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetTexLevelParameter[if]v(pname)"); - } - break; - case GL_TEXTURE_INTENSITY_TYPE_ARB: - if (ctx->Extensions.ARB_texture_float) { - *params = img->TexFormat->IntensityBits ? img->TexFormat->DataType : GL_NONE; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetTexLevelParameter[if]v(pname)"); - } - break; - case GL_TEXTURE_DEPTH_TYPE_ARB: - if (ctx->Extensions.ARB_texture_float) { - *params = img->TexFormat->DepthBits ? img->TexFormat->DataType : GL_NONE; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetTexLevelParameter[if]v(pname)"); - } - break; - - default: - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetTexLevelParameter[if]v(pname)"); - } - - out: - _mesa_unlock_texture(ctx, texObj); -} - - - -void GLAPIENTRY -_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); - - if (ctx->Texture.CurrentUnit >= ctx->Const.MaxTextureImageUnits) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetTexParameterfv(current unit)"); - return; - } - - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - - obj = _mesa_select_tex_object(ctx, texUnit, target); - if (!obj) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexParameterfv(target)"); - return; - } - - _mesa_lock_texture(ctx, obj); - switch (pname) { - case GL_TEXTURE_MAG_FILTER: - *params = ENUM_TO_FLOAT(obj->MagFilter); - break; - case GL_TEXTURE_MIN_FILTER: - *params = ENUM_TO_FLOAT(obj->MinFilter); - break; - case GL_TEXTURE_WRAP_S: - *params = ENUM_TO_FLOAT(obj->WrapS); - break; - case GL_TEXTURE_WRAP_T: - *params = ENUM_TO_FLOAT(obj->WrapT); - break; - case GL_TEXTURE_WRAP_R: - *params = ENUM_TO_FLOAT(obj->WrapR); - 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); - break; - case GL_TEXTURE_RESIDENT: - { - GLboolean resident; - if (ctx->Driver.IsTextureResident) - resident = ctx->Driver.IsTextureResident(ctx, obj); - else - resident = GL_TRUE; - *params = ENUM_TO_FLOAT(resident); - } - break; - case GL_TEXTURE_PRIORITY: - *params = obj->Priority; - break; - case GL_TEXTURE_MIN_LOD: - *params = obj->MinLod; - break; - case GL_TEXTURE_MAX_LOD: - *params = obj->MaxLod; - break; - case GL_TEXTURE_BASE_LEVEL: - *params = (GLfloat) obj->BaseLevel; - break; - case GL_TEXTURE_MAX_LEVEL: - *params = (GLfloat) obj->MaxLevel; - break; - case GL_TEXTURE_MAX_ANISOTROPY_EXT: - if (ctx->Extensions.EXT_texture_filter_anisotropic) { - *params = obj->MaxAnisotropy; - } - else - error = 1; - break; - case GL_TEXTURE_COMPARE_SGIX: - if (ctx->Extensions.SGIX_shadow) { - *params = (GLfloat) obj->CompareFlag; - } - else - error = 1; - break; - case GL_TEXTURE_COMPARE_OPERATOR_SGIX: - if (ctx->Extensions.SGIX_shadow) { - *params = (GLfloat) obj->CompareOperator; - } - 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; - } - else - error = 1; - break; - case GL_GENERATE_MIPMAP_SGIS: - if (ctx->Extensions.SGIS_generate_mipmap) { - *params = (GLfloat) obj->GenerateMipmap; - } - else - error = 1; - break; - case GL_TEXTURE_COMPARE_MODE_ARB: - if (ctx->Extensions.ARB_shadow) { - *params = (GLfloat) obj->CompareMode; - } - else - error = 1; - break; - case GL_TEXTURE_COMPARE_FUNC_ARB: - if (ctx->Extensions.ARB_shadow) { - *params = (GLfloat) obj->CompareFunc; - } - else - error = 1; - break; - case GL_DEPTH_TEXTURE_MODE_ARB: - if (ctx->Extensions.ARB_depth_texture) { - *params = (GLfloat) obj->DepthMode; - } - else - error = 1; - break; - case GL_TEXTURE_LOD_BIAS: - if (ctx->Extensions.EXT_texture_lod_bias) { - *params = obj->LodBias; - } - else - error = 1; - break; - default: - error = 1; - break; - } - if (error) - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexParameterfv(pname=0x%x)", - pname); - - _mesa_unlock_texture(ctx, obj); -} - - -void GLAPIENTRY -_mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params ) -{ - struct gl_texture_unit *texUnit; - struct gl_texture_object *obj; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (ctx->Texture.CurrentUnit >= ctx->Const.MaxTextureImageUnits) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetTexParameteriv(current unit)"); - return; - } - - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - - obj = _mesa_select_tex_object(ctx, texUnit, target); - if (!obj) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexParameteriv(target)"); - return; - } - - switch (pname) { - case GL_TEXTURE_MAG_FILTER: - *params = (GLint) obj->MagFilter; - return; - case GL_TEXTURE_MIN_FILTER: - *params = (GLint) obj->MinFilter; - return; - case GL_TEXTURE_WRAP_S: - *params = (GLint) obj->WrapS; - return; - case GL_TEXTURE_WRAP_T: - *params = (GLint) obj->WrapT; - return; - case GL_TEXTURE_WRAP_R: - *params = (GLint) obj->WrapR; - return; - case GL_TEXTURE_BORDER_COLOR: - { - GLfloat b[4]; - b[0] = CLAMP(obj->BorderColor[0], 0.0F, 1.0F); - b[1] = CLAMP(obj->BorderColor[1], 0.0F, 1.0F); - b[2] = CLAMP(obj->BorderColor[2], 0.0F, 1.0F); - b[3] = CLAMP(obj->BorderColor[3], 0.0F, 1.0F); - params[0] = FLOAT_TO_INT(b[0]); - params[1] = FLOAT_TO_INT(b[1]); - params[2] = FLOAT_TO_INT(b[2]); - params[3] = FLOAT_TO_INT(b[3]); - } - return; - case GL_TEXTURE_RESIDENT: - { - GLboolean resident; - if (ctx->Driver.IsTextureResident) - resident = ctx->Driver.IsTextureResident(ctx, obj); - else - resident = GL_TRUE; - *params = (GLint) resident; - } - return; - case GL_TEXTURE_PRIORITY: - *params = FLOAT_TO_INT(obj->Priority); - return; - case GL_TEXTURE_MIN_LOD: - *params = (GLint) obj->MinLod; - return; - case GL_TEXTURE_MAX_LOD: - *params = (GLint) obj->MaxLod; - return; - case GL_TEXTURE_BASE_LEVEL: - *params = obj->BaseLevel; - return; - case GL_TEXTURE_MAX_LEVEL: - *params = obj->MaxLevel; - return; - case GL_TEXTURE_MAX_ANISOTROPY_EXT: - if (ctx->Extensions.EXT_texture_filter_anisotropic) { - *params = (GLint) obj->MaxAnisotropy; - return; - } - break; - case GL_TEXTURE_COMPARE_SGIX: - if (ctx->Extensions.SGIX_shadow) { - *params = (GLint) obj->CompareFlag; - return; - } - break; - case GL_TEXTURE_COMPARE_OPERATOR_SGIX: - if (ctx->Extensions.SGIX_shadow) { - *params = (GLint) obj->CompareOperator; - return; - } - break; - case GL_SHADOW_AMBIENT_SGIX: /* aka GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ - if (ctx->Extensions.SGIX_shadow_ambient) { - *params = (GLint) FLOAT_TO_INT(obj->ShadowAmbient); - return; - } - break; - case GL_GENERATE_MIPMAP_SGIS: - if (ctx->Extensions.SGIS_generate_mipmap) { - *params = (GLint) obj->GenerateMipmap; - return; - } - break; - case GL_TEXTURE_COMPARE_MODE_ARB: - if (ctx->Extensions.ARB_shadow) { - *params = (GLint) obj->CompareMode; - return; - } - break; - case GL_TEXTURE_COMPARE_FUNC_ARB: - if (ctx->Extensions.ARB_shadow) { - *params = (GLint) obj->CompareFunc; - return; - } - break; - case GL_DEPTH_TEXTURE_MODE_ARB: - if (ctx->Extensions.ARB_depth_texture) { - *params = (GLint) obj->DepthMode; - return; - } - break; - case GL_TEXTURE_LOD_BIAS: - if (ctx->Extensions.EXT_texture_lod_bias) { - *params = (GLint) obj->LodBias; - return; - } - break; - default: - ; /* silence warnings */ - } - /* If we get here, pname was an unrecognized enum */ - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexParameteriv(pname=0x%x)", pname); -} - - - - -/**********************************************************************/ -/* Texture Coord Generation */ -/**********************************************************************/ - -#if FEATURE_texgen -void GLAPIENTRY -_mesa_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params ) -{ - GET_CURRENT_CONTEXT(ctx); - struct gl_texture_unit *texUnit; - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (MESA_VERBOSE&(VERBOSE_API|VERBOSE_TEXTURE)) - _mesa_debug(ctx, "glTexGen %s %s %.1f(%s)...\n", - _mesa_lookup_enum_by_nr(coord), - _mesa_lookup_enum_by_nr(pname), - *params, - _mesa_lookup_enum_by_nr((GLenum) (GLint) *params)); - - if (ctx->Texture.CurrentUnit >= ctx->Const.MaxTextureCoordUnits) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glTexGen(current unit)"); - return; - } - - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - - switch (coord) { - case GL_S: - if (pname==GL_TEXTURE_GEN_MODE) { - GLenum mode = (GLenum) (GLint) *params; - GLbitfield bits; - switch (mode) { - case GL_OBJECT_LINEAR: - bits = TEXGEN_OBJ_LINEAR; - break; - case GL_EYE_LINEAR: - bits = TEXGEN_EYE_LINEAR; - break; - case GL_REFLECTION_MAP_NV: - bits = TEXGEN_REFLECTION_MAP_NV; - break; - case GL_NORMAL_MAP_NV: - bits = TEXGEN_NORMAL_MAP_NV; - break; - case GL_SPHERE_MAP: - bits = TEXGEN_SPHERE_MAP; - break; - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glTexGenfv(param)" ); - return; - } - if (texUnit->GenModeS == mode) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->GenModeS = mode; - texUnit->_GenBitS = bits; - } - else if (pname==GL_OBJECT_PLANE) { - if (TEST_EQ_4V(texUnit->ObjectPlaneS, params)) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - COPY_4FV(texUnit->ObjectPlaneS, params); - } - else if (pname==GL_EYE_PLANE) { - GLfloat tmp[4]; - /* Transform plane equation by the inverse modelview matrix */ - if (_math_matrix_is_dirty(ctx->ModelviewMatrixStack.Top)) { - _math_matrix_analyse( ctx->ModelviewMatrixStack.Top ); - } - _mesa_transform_vector( tmp, params, ctx->ModelviewMatrixStack.Top->inv ); - if (TEST_EQ_4V(texUnit->EyePlaneS, tmp)) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - COPY_4FV(texUnit->EyePlaneS, tmp); - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glTexGenfv(pname)" ); - return; - } - break; - case GL_T: - if (pname==GL_TEXTURE_GEN_MODE) { - GLenum mode = (GLenum) (GLint) *params; - GLbitfield bitt; - switch (mode) { - case GL_OBJECT_LINEAR: - bitt = TEXGEN_OBJ_LINEAR; - break; - case GL_EYE_LINEAR: - bitt = TEXGEN_EYE_LINEAR; - break; - case GL_REFLECTION_MAP_NV: - bitt = TEXGEN_REFLECTION_MAP_NV; - break; - case GL_NORMAL_MAP_NV: - bitt = TEXGEN_NORMAL_MAP_NV; - break; - case GL_SPHERE_MAP: - bitt = TEXGEN_SPHERE_MAP; - break; - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glTexGenfv(param)" ); - return; - } - if (texUnit->GenModeT == mode) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->GenModeT = mode; - texUnit->_GenBitT = bitt; - } - else if (pname==GL_OBJECT_PLANE) { - if (TEST_EQ_4V(texUnit->ObjectPlaneT, params)) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - COPY_4FV(texUnit->ObjectPlaneT, params); - } - else if (pname==GL_EYE_PLANE) { - GLfloat tmp[4]; - /* Transform plane equation by the inverse modelview matrix */ - if (_math_matrix_is_dirty(ctx->ModelviewMatrixStack.Top)) { - _math_matrix_analyse( ctx->ModelviewMatrixStack.Top ); - } - _mesa_transform_vector( tmp, params, ctx->ModelviewMatrixStack.Top->inv ); - if (TEST_EQ_4V(texUnit->EyePlaneT, tmp)) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - COPY_4FV(texUnit->EyePlaneT, tmp); - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glTexGenfv(pname)" ); - return; - } - break; - case GL_R: - if (pname==GL_TEXTURE_GEN_MODE) { - GLenum mode = (GLenum) (GLint) *params; - GLbitfield bitr; - switch (mode) { - case GL_OBJECT_LINEAR: - bitr = TEXGEN_OBJ_LINEAR; - break; - case GL_REFLECTION_MAP_NV: - bitr = TEXGEN_REFLECTION_MAP_NV; - break; - case GL_NORMAL_MAP_NV: - bitr = TEXGEN_NORMAL_MAP_NV; - break; - case GL_EYE_LINEAR: - bitr = TEXGEN_EYE_LINEAR; - break; - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glTexGenfv(param)" ); - return; - } - if (texUnit->GenModeR == mode) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->GenModeR = mode; - texUnit->_GenBitR = bitr; - } - else if (pname==GL_OBJECT_PLANE) { - if (TEST_EQ_4V(texUnit->ObjectPlaneR, params)) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - COPY_4FV(texUnit->ObjectPlaneR, params); - } - else if (pname==GL_EYE_PLANE) { - GLfloat tmp[4]; - /* Transform plane equation by the inverse modelview matrix */ - if (_math_matrix_is_dirty(ctx->ModelviewMatrixStack.Top)) { - _math_matrix_analyse( ctx->ModelviewMatrixStack.Top ); - } - _mesa_transform_vector( tmp, params, ctx->ModelviewMatrixStack.Top->inv ); - if (TEST_EQ_4V(texUnit->EyePlaneR, tmp)) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - COPY_4FV(texUnit->EyePlaneR, tmp); - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glTexGenfv(pname)" ); - return; - } - break; - case GL_Q: - if (pname==GL_TEXTURE_GEN_MODE) { - GLenum mode = (GLenum) (GLint) *params; - GLbitfield bitq; - switch (mode) { - case GL_OBJECT_LINEAR: - bitq = TEXGEN_OBJ_LINEAR; - break; - case GL_EYE_LINEAR: - bitq = TEXGEN_EYE_LINEAR; - break; - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glTexGenfv(param)" ); - return; - } - if (texUnit->GenModeQ == mode) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->GenModeQ = mode; - texUnit->_GenBitQ = bitq; - } - else if (pname==GL_OBJECT_PLANE) { - if (TEST_EQ_4V(texUnit->ObjectPlaneQ, params)) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - COPY_4FV(texUnit->ObjectPlaneQ, params); - } - else if (pname==GL_EYE_PLANE) { - GLfloat tmp[4]; - /* Transform plane equation by the inverse modelview matrix */ - if (_math_matrix_is_dirty(ctx->ModelviewMatrixStack.Top)) { - _math_matrix_analyse( ctx->ModelviewMatrixStack.Top ); - } - _mesa_transform_vector( tmp, params, ctx->ModelviewMatrixStack.Top->inv ); - if (TEST_EQ_4V(texUnit->EyePlaneQ, tmp)) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - COPY_4FV(texUnit->EyePlaneQ, tmp); - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glTexGenfv(pname)" ); - return; - } - break; - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glTexGenfv(coord)" ); - return; - } - - if (ctx->Driver.TexGen) - ctx->Driver.TexGen( ctx, coord, pname, params ); -} - - -void GLAPIENTRY -_mesa_TexGeniv(GLenum coord, GLenum pname, const GLint *params ) -{ - GLfloat p[4]; - p[0] = (GLfloat) params[0]; - if (pname == GL_TEXTURE_GEN_MODE) { - p[1] = p[2] = p[3] = 0.0F; - } - else { - p[1] = (GLfloat) params[1]; - p[2] = (GLfloat) params[2]; - p[3] = (GLfloat) params[3]; - } - _mesa_TexGenfv(coord, pname, p); -} - - -void GLAPIENTRY -_mesa_TexGend(GLenum coord, GLenum pname, GLdouble param ) -{ - GLfloat p = (GLfloat) param; - _mesa_TexGenfv( coord, pname, &p ); -} - - -void GLAPIENTRY -_mesa_TexGendv(GLenum coord, GLenum pname, const GLdouble *params ) -{ - GLfloat p[4]; - p[0] = (GLfloat) params[0]; - if (pname == GL_TEXTURE_GEN_MODE) { - p[1] = p[2] = p[3] = 0.0F; - } - else { - p[1] = (GLfloat) params[1]; - p[2] = (GLfloat) params[2]; - p[3] = (GLfloat) params[3]; - } - _mesa_TexGenfv( coord, pname, p ); -} - - -void GLAPIENTRY -_mesa_TexGenf( GLenum coord, GLenum pname, GLfloat param ) -{ - _mesa_TexGenfv(coord, pname, ¶m); -} - - -void GLAPIENTRY -_mesa_TexGeni( GLenum coord, GLenum pname, GLint param ) -{ - _mesa_TexGeniv( coord, pname, ¶m ); -} - - - -void GLAPIENTRY -_mesa_GetTexGendv( GLenum coord, GLenum pname, GLdouble *params ) -{ - const struct gl_texture_unit *texUnit; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (ctx->Texture.CurrentUnit >= ctx->Const.MaxTextureCoordUnits) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexGendv(current unit)"); - return; - } - - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - - switch (coord) { - case GL_S: - if (pname==GL_TEXTURE_GEN_MODE) { - params[0] = ENUM_TO_DOUBLE(texUnit->GenModeS); - } - else if (pname==GL_OBJECT_PLANE) { - COPY_4V( params, texUnit->ObjectPlaneS ); - } - else if (pname==GL_EYE_PLANE) { - COPY_4V( params, texUnit->EyePlaneS ); - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexGendv(pname)" ); - return; - } - break; - case GL_T: - if (pname==GL_TEXTURE_GEN_MODE) { - params[0] = ENUM_TO_DOUBLE(texUnit->GenModeT); - } - else if (pname==GL_OBJECT_PLANE) { - COPY_4V( params, texUnit->ObjectPlaneT ); - } - else if (pname==GL_EYE_PLANE) { - COPY_4V( params, texUnit->EyePlaneT ); - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexGendv(pname)" ); - return; - } - break; - case GL_R: - if (pname==GL_TEXTURE_GEN_MODE) { - params[0] = ENUM_TO_DOUBLE(texUnit->GenModeR); - } - else if (pname==GL_OBJECT_PLANE) { - COPY_4V( params, texUnit->ObjectPlaneR ); - } - else if (pname==GL_EYE_PLANE) { - COPY_4V( params, texUnit->EyePlaneR ); - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexGendv(pname)" ); - return; - } - break; - case GL_Q: - if (pname==GL_TEXTURE_GEN_MODE) { - params[0] = ENUM_TO_DOUBLE(texUnit->GenModeQ); - } - else if (pname==GL_OBJECT_PLANE) { - COPY_4V( params, texUnit->ObjectPlaneQ ); - } - else if (pname==GL_EYE_PLANE) { - COPY_4V( params, texUnit->EyePlaneQ ); - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexGendv(pname)" ); - return; - } - break; - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexGendv(coord)" ); - return; - } -} - - - -void GLAPIENTRY -_mesa_GetTexGenfv( GLenum coord, GLenum pname, GLfloat *params ) -{ - const struct gl_texture_unit *texUnit; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (ctx->Texture.CurrentUnit >= ctx->Const.MaxTextureCoordUnits) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexGenfv(current unit)"); - return; - } - - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - - switch (coord) { - case GL_S: - if (pname==GL_TEXTURE_GEN_MODE) { - params[0] = ENUM_TO_FLOAT(texUnit->GenModeS); - } - else if (pname==GL_OBJECT_PLANE) { - COPY_4V( params, texUnit->ObjectPlaneS ); - } - else if (pname==GL_EYE_PLANE) { - COPY_4V( params, texUnit->EyePlaneS ); - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexGenfv(pname)" ); - return; - } - break; - case GL_T: - if (pname==GL_TEXTURE_GEN_MODE) { - params[0] = ENUM_TO_FLOAT(texUnit->GenModeT); - } - else if (pname==GL_OBJECT_PLANE) { - COPY_4V( params, texUnit->ObjectPlaneT ); - } - else if (pname==GL_EYE_PLANE) { - COPY_4V( params, texUnit->EyePlaneT ); - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexGenfv(pname)" ); - return; - } - break; - case GL_R: - if (pname==GL_TEXTURE_GEN_MODE) { - params[0] = ENUM_TO_FLOAT(texUnit->GenModeR); - } - else if (pname==GL_OBJECT_PLANE) { - COPY_4V( params, texUnit->ObjectPlaneR ); - } - else if (pname==GL_EYE_PLANE) { - COPY_4V( params, texUnit->EyePlaneR ); - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexGenfv(pname)" ); - return; - } - break; - case GL_Q: - if (pname==GL_TEXTURE_GEN_MODE) { - params[0] = ENUM_TO_FLOAT(texUnit->GenModeQ); - } - else if (pname==GL_OBJECT_PLANE) { - COPY_4V( params, texUnit->ObjectPlaneQ ); - } - else if (pname==GL_EYE_PLANE) { - COPY_4V( params, texUnit->EyePlaneQ ); - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexGenfv(pname)" ); - return; - } - break; - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexGenfv(coord)" ); - return; - } -} - - - -void GLAPIENTRY -_mesa_GetTexGeniv( GLenum coord, GLenum pname, GLint *params ) -{ - const struct gl_texture_unit *texUnit; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (ctx->Texture.CurrentUnit >= ctx->Const.MaxTextureCoordUnits) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexGeniv(current unit)"); - return; - } - - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - - switch (coord) { - case GL_S: - if (pname==GL_TEXTURE_GEN_MODE) { - params[0] = texUnit->GenModeS; - } - else if (pname==GL_OBJECT_PLANE) { - params[0] = (GLint) texUnit->ObjectPlaneS[0]; - params[1] = (GLint) texUnit->ObjectPlaneS[1]; - params[2] = (GLint) texUnit->ObjectPlaneS[2]; - params[3] = (GLint) texUnit->ObjectPlaneS[3]; - } - else if (pname==GL_EYE_PLANE) { - params[0] = (GLint) texUnit->EyePlaneS[0]; - params[1] = (GLint) texUnit->EyePlaneS[1]; - params[2] = (GLint) texUnit->EyePlaneS[2]; - params[3] = (GLint) texUnit->EyePlaneS[3]; - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexGeniv(pname)" ); - return; - } - break; - case GL_T: - if (pname==GL_TEXTURE_GEN_MODE) { - params[0] = texUnit->GenModeT; - } - else if (pname==GL_OBJECT_PLANE) { - params[0] = (GLint) texUnit->ObjectPlaneT[0]; - params[1] = (GLint) texUnit->ObjectPlaneT[1]; - params[2] = (GLint) texUnit->ObjectPlaneT[2]; - params[3] = (GLint) texUnit->ObjectPlaneT[3]; - } - else if (pname==GL_EYE_PLANE) { - params[0] = (GLint) texUnit->EyePlaneT[0]; - params[1] = (GLint) texUnit->EyePlaneT[1]; - params[2] = (GLint) texUnit->EyePlaneT[2]; - params[3] = (GLint) texUnit->EyePlaneT[3]; - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexGeniv(pname)" ); - return; - } - break; - case GL_R: - if (pname==GL_TEXTURE_GEN_MODE) { - params[0] = texUnit->GenModeR; - } - else if (pname==GL_OBJECT_PLANE) { - params[0] = (GLint) texUnit->ObjectPlaneR[0]; - params[1] = (GLint) texUnit->ObjectPlaneR[1]; - params[2] = (GLint) texUnit->ObjectPlaneR[2]; - params[3] = (GLint) texUnit->ObjectPlaneR[3]; - } - else if (pname==GL_EYE_PLANE) { - params[0] = (GLint) texUnit->EyePlaneR[0]; - params[1] = (GLint) texUnit->EyePlaneR[1]; - params[2] = (GLint) texUnit->EyePlaneR[2]; - params[3] = (GLint) texUnit->EyePlaneR[3]; - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexGeniv(pname)" ); - return; - } - break; - case GL_Q: - if (pname==GL_TEXTURE_GEN_MODE) { - params[0] = texUnit->GenModeQ; - } - else if (pname==GL_OBJECT_PLANE) { - params[0] = (GLint) texUnit->ObjectPlaneQ[0]; - params[1] = (GLint) texUnit->ObjectPlaneQ[1]; - params[2] = (GLint) texUnit->ObjectPlaneQ[2]; - params[3] = (GLint) texUnit->ObjectPlaneQ[3]; - } - else if (pname==GL_EYE_PLANE) { - params[0] = (GLint) texUnit->EyePlaneQ[0]; - params[1] = (GLint) texUnit->EyePlaneQ[1]; - params[2] = (GLint) texUnit->EyePlaneQ[2]; - params[3] = (GLint) texUnit->EyePlaneQ[3]; - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexGeniv(pname)" ); - return; - } - break; - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexGeniv(coord)" ); - return; - } -} -#endif /* GL_ARB_multitexture */ @@ -3166,7 +775,9 @@ _mesa_init_texture(GLcontext *ctx) ctx->Texture.CurrentUnit = 0; /* multitexture */ ctx->Texture._EnabledUnits = 0; ctx->Texture.SharedPalette = GL_FALSE; +#if FEATURE_colortable _mesa_init_colortable(&ctx->Texture.Palette); +#endif for (i = 0; i < MAX_TEXTURE_UNITS; i++) init_texture_unit( ctx, i ); @@ -3176,8 +787,6 @@ _mesa_init_texture(GLcontext *ctx) */ assert(ctx->Shared->Default1D->RefCount >= MAX_TEXTURE_UNITS + 1); - _mesa_TexEnvProgramCacheInit( ctx ); - /* Allocate proxy textures */ if (!alloc_proxy_textures( ctx )) return GL_FALSE; @@ -3210,10 +819,13 @@ _mesa_free_texture_data(GLcontext *ctx) for (tgt = 0; tgt < NUM_TEXTURE_TARGETS; tgt++) ctx->Driver.DeleteTexture(ctx, ctx->Texture.ProxyTex[tgt]); - for (u = 0; u < MAX_TEXTURE_IMAGE_UNITS; u++) - _mesa_free_colortable_data( &ctx->Texture.Unit[u].ColorTable ); - - _mesa_TexEnvProgramCacheDestroy( ctx ); +#if FEATURE_colortable + { + GLuint i; + for (i = 0; i < MAX_TEXTURE_IMAGE_UNITS; i++) + _mesa_free_colortable_data( &ctx->Texture.Unit[i].ColorTable ); + } +#endif } diff --git a/src/mesa/main/texstate.h b/src/mesa/main/texstate.h index b978654116..a7d7088c62 100644 --- a/src/mesa/main/texstate.h +++ b/src/mesa/main/texstate.h @@ -48,81 +48,6 @@ _mesa_print_texunit_state( GLcontext *ctx, GLuint unit ); */ /*@{*/ -extern void GLAPIENTRY -_mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params ); - -extern void GLAPIENTRY -_mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params ); - -extern void GLAPIENTRY -_mesa_GetTexGendv( GLenum coord, GLenum pname, GLdouble *params ); - -extern void GLAPIENTRY -_mesa_GetTexGenfv( GLenum coord, GLenum pname, GLfloat *params ); - -extern void GLAPIENTRY -_mesa_GetTexGeniv( GLenum coord, GLenum pname, GLint *params ); - -extern void GLAPIENTRY -_mesa_GetTexLevelParameterfv( GLenum target, GLint level, - GLenum pname, GLfloat *params ); - -extern void GLAPIENTRY -_mesa_GetTexLevelParameteriv( GLenum target, GLint level, - GLenum pname, GLint *params ); - -extern void GLAPIENTRY -_mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params ); - -extern void GLAPIENTRY -_mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params ); - - -extern void GLAPIENTRY -_mesa_TexEnvf( GLenum target, GLenum pname, GLfloat param ); - -extern void GLAPIENTRY -_mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param ); - -extern void GLAPIENTRY -_mesa_TexEnvi( GLenum target, GLenum pname, GLint param ); - -extern void GLAPIENTRY -_mesa_TexEnviv( GLenum target, GLenum pname, const GLint *param ); - - -extern void GLAPIENTRY -_mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params ); - -extern void GLAPIENTRY -_mesa_TexParameterf( GLenum target, GLenum pname, GLfloat param ); - - -extern void GLAPIENTRY -_mesa_TexParameteri( GLenum target, GLenum pname, GLint param ); - -extern void GLAPIENTRY -_mesa_TexParameteriv( GLenum target, GLenum pname, const GLint *params ); - - -extern void GLAPIENTRY -_mesa_TexGend( GLenum coord, GLenum pname, GLdouble param ); - -extern void GLAPIENTRY -_mesa_TexGendv( GLenum coord, GLenum pname, const GLdouble *params ); - -extern void GLAPIENTRY -_mesa_TexGenf( GLenum coord, GLenum pname, GLfloat param ); - -extern void GLAPIENTRY -_mesa_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params ); - -extern void GLAPIENTRY -_mesa_TexGeni( GLenum coord, GLenum pname, GLint param ); - -extern void GLAPIENTRY -_mesa_TexGeniv( GLenum coord, GLenum pname, const GLint *params ); - /* * GL_ARB_multitexture diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index 853205ac95..56f5b2ebaa 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.5.1 + * Version: 7.1 * - * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2008 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"), @@ -55,7 +55,9 @@ #include "bufferobj.h" #include "colormac.h" #include "context.h" +#if FEATURE_convolve #include "convolve.h" +#endif #include "image.h" #include "macros.h" #include "mipmap.h" @@ -269,6 +271,16 @@ compute_component_mapping(GLenum inFormat, GLenum outFormat, } +#if !FEATURE_convolve +static void +_mesa_adjust_image_for_convolution(GLcontext *ctx, GLuint dims, + GLsizei *srcWidth, GLsizei *srcHeight) +{ + /* no-op */ +} +#endif + + /** * Make a temporary (color) texture image with GLfloat components. * Apply all needed pixel unpacking and pixel transfer operations. @@ -372,6 +384,7 @@ make_temp_float_image(GLcontext *ctx, GLuint dims, convWidth = srcWidth; convHeight = srcHeight; +#if FEATURE_convolve /* do convolution */ { GLfloat *src = tempImage + img * (srcWidth * srcHeight * 4); @@ -391,7 +404,7 @@ make_temp_float_image(GLcontext *ctx, GLuint dims, } } } - +#endif /* do post-convolution transfer and pack into tempImage */ { const GLint logComponents @@ -548,6 +561,7 @@ _mesa_make_temp_chan_image(GLcontext *ctx, GLuint dims, textureBaseFormat == GL_ALPHA || textureBaseFormat == GL_INTENSITY); +#if FEATURE_convolve if ((dims == 1 && ctx->Pixel.Convolution1DEnabled) || (dims >= 2 && ctx->Pixel.Convolution2DEnabled) || (dims >= 2 && ctx->Pixel.Separable2DEnabled)) { @@ -569,6 +583,7 @@ _mesa_make_temp_chan_image(GLcontext *ctx, GLuint dims, transferOps = 0; freeSrcImage = GL_TRUE; } +#endif /* unpack and transfer the source image */ tempImage = (GLchan *) _mesa_malloc(srcWidth * srcHeight * srcDepth @@ -663,56 +678,116 @@ static void swizzle_copy(GLubyte *dst, GLuint dstComponents, const GLubyte *src, GLuint srcComponents, const GLubyte *map, GLuint count) { +#define SWZ_CPY(dst, src, count, dstComps, srcComps) \ + do { \ + GLuint i; \ + for (i = 0; i < count; i++) { \ + GLuint j; \ + if (srcComps == 4) { \ + COPY_4UBV(tmp, src); \ + } \ + else { \ + for (j = 0; j < srcComps; j++) { \ + tmp[j] = src[j]; \ + } \ + } \ + src += srcComps; \ + for (j = 0; j < dstComps; j++) { \ + dst[j] = tmp[map[j]]; \ + } \ + dst += dstComps; \ + } \ + } while (0) + GLubyte tmp[6]; - GLuint i; tmp[ZERO] = 0x0; tmp[ONE] = 0xff; + ASSERT(srcComponents <= 4); + ASSERT(dstComponents <= 4); + switch (dstComponents) { case 4: - for (i = 0; i < count; i++) { - COPY_4UBV(tmp, src); - src += srcComponents; - dst[0] = tmp[map[0]]; - dst[1] = tmp[map[1]]; - dst[2] = tmp[map[2]]; - dst[3] = tmp[map[3]]; - dst += 4; + switch (srcComponents) { + case 4: + SWZ_CPY(dst, src, count, 4, 4); + break; + case 3: + SWZ_CPY(dst, src, count, 4, 3); + break; + case 2: + SWZ_CPY(dst, src, count, 4, 2); + break; + case 1: + SWZ_CPY(dst, src, count, 4, 1); + break; + default: + ; } break; case 3: - for (i = 0; i < count; i++) { - COPY_4UBV(tmp, src); - src += srcComponents; - dst[0] = tmp[map[0]]; - dst[1] = tmp[map[1]]; - dst[2] = tmp[map[2]]; - dst += 3; + switch (srcComponents) { + case 4: + SWZ_CPY(dst, src, count, 3, 4); + break; + case 3: + SWZ_CPY(dst, src, count, 3, 3); + break; + case 2: + SWZ_CPY(dst, src, count, 3, 2); + break; + case 1: + SWZ_CPY(dst, src, count, 3, 1); + break; + default: + ; } break; case 2: - for (i = 0; i < count; i++) { - COPY_4UBV(tmp, src); - src += srcComponents; - dst[0] = tmp[map[0]]; - dst[1] = tmp[map[1]]; - dst += 2; + switch (srcComponents) { + case 4: + SWZ_CPY(dst, src, count, 2, 4); + break; + case 3: + SWZ_CPY(dst, src, count, 2, 3); + break; + case 2: + SWZ_CPY(dst, src, count, 2, 2); + break; + case 1: + SWZ_CPY(dst, src, count, 2, 1); + break; + default: + ; } 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; + switch (srcComponents) { + case 4: + SWZ_CPY(dst, src, count, 1, 4); + break; + case 3: + SWZ_CPY(dst, src, count, 1, 3); + break; + case 2: + SWZ_CPY(dst, src, count, 1, 2); + break; + case 1: + SWZ_CPY(dst, src, count, 1, 1); + break; + default: + ; } break; + default: + ; } +#undef SWZ_CPY } + static const GLubyte map_identity[6] = { 0, 1, 2, 3, ZERO, ONE }; static const GLubyte map_3210[6] = { 3, 2, 1, 0, ZERO, ONE }; @@ -1085,7 +1160,8 @@ _mesa_texstore_z32(TEXSTORE_PARAMS) ASSERT(dstFormat == &_mesa_texformat_z32); ASSERT(dstFormat->TexelBytes == sizeof(GLuint)); - if (!ctx->_ImageTransferState && + if (ctx->Pixel.DepthScale == 1.0f && + ctx->Pixel.DepthBias == 0.0f && !srcPacking->SwapBytes && baseInternalFormat == GL_DEPTH_COMPONENT && srcFormat == GL_DEPTH_COMPONENT && @@ -1132,7 +1208,8 @@ _mesa_texstore_z16(TEXSTORE_PARAMS) ASSERT(dstFormat == &_mesa_texformat_z16); ASSERT(dstFormat->TexelBytes == sizeof(GLushort)); - if (!ctx->_ImageTransferState && + if (ctx->Pixel.DepthScale == 1.0f && + ctx->Pixel.DepthBias == 0.0f && !srcPacking->SwapBytes && baseInternalFormat == GL_DEPTH_COMPONENT && srcFormat == GL_DEPTH_COMPONENT && @@ -2330,7 +2407,8 @@ _mesa_texstore_z24_s8(TEXSTORE_PARAMS) ASSERT(srcFormat == GL_DEPTH_STENCIL_EXT); ASSERT(srcType == GL_UNSIGNED_INT_24_8_EXT); - if (!ctx->_ImageTransferState && + if (ctx->Pixel.DepthScale == 1.0f && + ctx->Pixel.DepthBias == 0.0f && !srcPacking->SwapBytes) { /* simple path */ memcpy_texture(ctx, dims, @@ -2364,7 +2442,7 @@ _mesa_texstore_z24_s8(TEXSTORE_PARAMS) _mesa_unpack_depth_span(ctx, srcWidth, GL_UNSIGNED_INT_24_8_EXT, /* dst type */ dstRow, /* dst addr */ - depthScale, + (GLuint) depthScale, srcType, src, srcPacking); /* get the 8-bit stencil values */ _mesa_unpack_stencil_span(ctx, srcWidth, @@ -2385,6 +2463,88 @@ _mesa_texstore_z24_s8(TEXSTORE_PARAMS) } +/** + * Store a combined depth/stencil texture image. + */ +GLboolean +_mesa_texstore_s8_z24(TEXSTORE_PARAMS) +{ + const GLuint depthScale = 0xffffff; + const GLint srcRowStride + = _mesa_image_row_stride(srcPacking, srcWidth, srcFormat, srcType) + / sizeof(GLuint); + GLint img, row; + + ASSERT(dstFormat == &_mesa_texformat_s8_z24); + ASSERT(srcFormat == GL_DEPTH_STENCIL_EXT || srcFormat == GL_DEPTH_COMPONENT); + ASSERT(srcFormat != GL_DEPTH_STENCIL_EXT || srcType == GL_UNSIGNED_INT_24_8_EXT); + + /* In case we only upload depth we need to preserve the stencil */ + if (srcFormat == GL_DEPTH_COMPONENT) { + for (img = 0; img < srcDepth; img++) { + GLuint *dstRow = (GLuint *) dstAddr + + dstImageOffsets[dstZoffset + img] + + dstYoffset * dstRowStride / sizeof(GLuint) + + dstXoffset; + const GLuint *src + = (const GLuint *) _mesa_image_address(dims, srcPacking, srcAddr, + srcWidth, srcHeight, + srcFormat, srcType, + img, 0, 0); + for (row = 0; row < srcHeight; row++) { + GLuint depth[MAX_WIDTH]; + GLint i; + _mesa_unpack_depth_span(ctx, srcWidth, + GL_UNSIGNED_INT, /* dst type */ + depth, /* dst addr */ + depthScale, + srcType, src, srcPacking); + + for (i = 0; i < srcWidth; i++) + dstRow[i] = depth[i] | (dstRow[i] & 0xFF000000); + + src += srcRowStride; + dstRow += dstRowStride / sizeof(GLuint); + } + } + } + else { + for (img = 0; img < srcDepth; img++) { + GLuint *dstRow = (GLuint *) dstAddr + + dstImageOffsets[dstZoffset + img] + + dstYoffset * dstRowStride / sizeof(GLuint) + + dstXoffset; + const GLuint *src + = (const GLuint *) _mesa_image_address(dims, srcPacking, srcAddr, + srcWidth, srcHeight, + srcFormat, srcType, + img, 0, 0); + for (row = 0; row < srcHeight; row++) { + GLubyte stencil[MAX_WIDTH]; + GLint i; + /* the 24 depth bits will be in the low position: */ + _mesa_unpack_depth_span(ctx, srcWidth, + GL_UNSIGNED_INT, /* dst type */ + dstRow, /* dst addr */ + depthScale, + srcType, src, srcPacking); + /* get the 8-bit stencil values */ + _mesa_unpack_stencil_span(ctx, srcWidth, + GL_UNSIGNED_BYTE, /* dst type */ + stencil, /* dst addr */ + srcType, src, srcPacking, + ctx->_ImageTransferState); + /* merge stencil values into depth values */ + for (i = 0; i < srcWidth; i++) + dstRow[i] |= stencil[i] << 24; + + src += srcRowStride; + dstRow += dstRowStride / sizeof(GLuint); + } + } + } + return GL_TRUE; +} /** * Store an image in any of the formats: diff --git a/src/mesa/main/texstore.h b/src/mesa/main/texstore.h index 5128bc5827..c9edf14dbc 100644 --- a/src/mesa/main/texstore.h +++ b/src/mesa/main/texstore.h @@ -57,6 +57,7 @@ extern GLboolean _mesa_texstore_a8(TEXSTORE_PARAMS); extern GLboolean _mesa_texstore_ci8(TEXSTORE_PARAMS); extern GLboolean _mesa_texstore_ycbcr(TEXSTORE_PARAMS); extern GLboolean _mesa_texstore_z24_s8(TEXSTORE_PARAMS); +extern GLboolean _mesa_texstore_s8_z24(TEXSTORE_PARAMS); extern GLboolean _mesa_texstore_z16(TEXSTORE_PARAMS); extern GLboolean _mesa_texstore_z32(TEXSTORE_PARAMS); extern GLboolean _mesa_texstore_rgba_float32(TEXSTORE_PARAMS); diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c index 22a55ac707..9d9b28b518 100644 --- a/src/mesa/main/varray.c +++ b/src/mesa/main/varray.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.5.1 + * Version: 7.2 * - * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2008 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,14 +62,9 @@ update_array(GLcontext *ctx, struct gl_client_array *array, array->Normalized = normalized; array->Ptr = (const GLubyte *) ptr; #if FEATURE_ARB_vertex_buffer_object - array->BufferObj->RefCount--; - if (array->BufferObj->RefCount <= 0) { - ASSERT(array->BufferObj->Name); - _mesa_remove_buffer_object( ctx, array->BufferObj ); - (*ctx->Driver.DeleteBuffer)( ctx, array->BufferObj ); - } - array->BufferObj = ctx->Array.ArrayBufferObj; - array->BufferObj->RefCount++; + _mesa_reference_buffer_object(ctx, &array->BufferObj, + ctx->Array.ArrayBufferObj); + /* Compute the index of the last array element that's inside the buffer. * Later in glDrawArrays we'll check if start + count > _MaxElement to * be sure we won't go out of bounds. @@ -121,6 +116,16 @@ _mesa_VertexPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr) case GL_DOUBLE: elementSize = size * sizeof(GLdouble); break; +#if FEATURE_fixedpt + case GL_FIXED: + elementSize = size * sizeof(GLfixed); + break; +#endif +#if FEATURE_vertex_array_byte + case GL_BYTE: + elementSize = size * sizeof(GLbyte); + break; +#endif default: _mesa_error( ctx, GL_INVALID_ENUM, "glVertexPointer(type)" ); return; @@ -166,6 +171,11 @@ _mesa_NormalPointer(GLenum type, GLsizei stride, const GLvoid *ptr ) case GL_DOUBLE: elementSize = 3 * sizeof(GLdouble); break; +#if FEATURE_fixedpt + case GL_FIXED: + elementSize = 3 * sizeof(GLfixed); + break; +#endif default: _mesa_error( ctx, GL_INVALID_ENUM, "glNormalPointer(type)" ); return; @@ -224,6 +234,11 @@ _mesa_ColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr) case GL_DOUBLE: elementSize = size * sizeof(GLdouble); break; +#if FEATURE_fixedpt + case GL_FIXED: + elementSize = size * sizeof(GLfixed); + break; +#endif default: _mesa_error( ctx, GL_INVALID_ENUM, "glColorPointer(type)" ); return; @@ -405,6 +420,16 @@ _mesa_TexCoordPointer(GLint size, GLenum type, GLsizei stride, case GL_DOUBLE: elementSize = size * sizeof(GLdouble); break; +#if FEATURE_fixedpt + case GL_FIXED: + elementSize = size * sizeof(GLfixed); + break; +#endif +#if FEATURE_vertex_array_byte + case GL_BYTE: + elementSize = size * sizeof(GLbyte); + break; +#endif default: _mesa_error( ctx, GL_INVALID_ENUM, "glTexCoordPointer(type)" ); return; @@ -438,6 +463,37 @@ _mesa_EdgeFlagPointer(GLsizei stride, const GLvoid *ptr) } +void GLAPIENTRY +_mesa_PointSizePointer(GLenum type, GLsizei stride, const GLvoid *ptr) +{ + GLsizei elementSize; + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); + + if (stride < 0) { + _mesa_error( ctx, GL_INVALID_VALUE, "glPointSizePointer(stride)" ); + return; + } + + switch (type) { + case GL_FLOAT: + elementSize = sizeof(GLfloat); + break; +#if FEATURE_fixedpt + case GL_FIXED: + elementSize = sizeof(GLfixed); + break; +#endif + default: + _mesa_error( ctx, GL_INVALID_ENUM, "glPointSizePointer(type)" ); + return; + } + + update_array(ctx, &ctx->Array.ArrayObj->PointSize, _NEW_ARRAY_POINT_SIZE, + elementSize, 1, type, stride, GL_FALSE, ptr); +} + + #if FEATURE_NV_vertex_program void GLAPIENTRY _mesa_VertexAttribPointerNV(GLuint index, GLint size, GLenum type, @@ -550,6 +606,11 @@ _mesa_VertexAttribPointerARB(GLuint index, GLint size, GLenum type, case GL_DOUBLE: elementSize = size * sizeof(GLdouble); break; +#if FEATURE_fixedpt + case GL_FIXED: + elementSize = size * sizeof(GLfixed); + break; +#endif default: _mesa_error( ctx, GL_INVALID_ENUM, "glVertexAttribPointerARB(type)" ); return; diff --git a/src/mesa/main/varray.h b/src/mesa/main/varray.h index bb2d21b469..6385689fcc 100644 --- a/src/mesa/main/varray.h +++ b/src/mesa/main/varray.h @@ -112,6 +112,10 @@ _mesa_SecondaryColorPointerEXT(GLint size, GLenum type, extern void GLAPIENTRY +_mesa_PointSizePointer(GLenum type, GLsizei stride, const GLvoid *ptr); + + +extern void GLAPIENTRY _mesa_VertexAttribPointerNV(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); diff --git a/src/mesa/main/version.h b/src/mesa/main/version.h index 4258a114ed..81034a35d1 100644 --- a/src/mesa/main/version.h +++ b/src/mesa/main/version.h @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 7.1 + * Version: 7.3 * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2008 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,9 +29,9 @@ /* Mesa version */ #define MESA_MAJOR 7 -#define MESA_MINOR 1 +#define MESA_MINOR 3 #define MESA_PATCH 0 -#define MESA_VERSION_STRING "7.1 rc3" +#define MESA_VERSION_STRING "7.3-devel" /* To make version comparison easy */ #define MESA_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) diff --git a/src/mesa/math/m_debug_clip.c b/src/mesa/math/m_debug_clip.c index ab28818359..460fed4a75 100644 --- a/src/mesa/math/m_debug_clip.c +++ b/src/mesa/math/m_debug_clip.c @@ -25,10 +25,10 @@ * Gareth Hughes */ -#include "glheader.h" -#include "context.h" -#include "macros.h" -#include "imports.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/macros.h" +#include "main/imports.h" #include "m_matrix.h" #include "m_xform.h" diff --git a/src/mesa/math/m_debug_norm.c b/src/mesa/math/m_debug_norm.c index 11cae6bba7..89c632e7d5 100644 --- a/src/mesa/math/m_debug_norm.c +++ b/src/mesa/math/m_debug_norm.c @@ -26,10 +26,10 @@ * Gareth Hughes */ -#include "glheader.h" -#include "context.h" -#include "macros.h" -#include "imports.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/macros.h" +#include "main/imports.h" #include "m_matrix.h" #include "m_xform.h" diff --git a/src/mesa/math/m_debug_util.h b/src/mesa/math/m_debug_util.h index 2d1d8b1880..7abe6f2565 100644 --- a/src/mesa/math/m_debug_util.h +++ b/src/mesa/math/m_debug_util.h @@ -303,7 +303,7 @@ enum { NIL = 0, ONE = 1, NEG = -1, VAR = 2 }; */ #if defined(__GNUC__) # define ALIGN16(type, array) type array __attribute__ ((aligned (16))) -#elif defined(__MSC__) +#elif defined(_MSC_VER) # define ALIGN16(type, array) type array __declspec(align(16)) /* GH: Does this work? */ #elif defined(__WATCOMC__) # define ALIGN16(type, array) /* Watcom does not support this */ diff --git a/src/mesa/math/m_debug_xform.c b/src/mesa/math/m_debug_xform.c index 2af837cf64..ec22c7052d 100644 --- a/src/mesa/math/m_debug_xform.c +++ b/src/mesa/math/m_debug_xform.c @@ -26,10 +26,10 @@ * Updated for P6 architecture by Gareth Hughes. */ -#include "glheader.h" -#include "context.h" -#include "macros.h" -#include "imports.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/macros.h" +#include "main/imports.h" #include "m_matrix.h" #include "m_xform.h" diff --git a/src/mesa/math/m_matrix.c b/src/mesa/math/m_matrix.c index b4ba1bc2a0..84b4cae4ad 100644 --- a/src/mesa/math/m_matrix.c +++ b/src/mesa/math/m_matrix.c @@ -34,10 +34,10 @@ */ -#include "glheader.h" -#include "imports.h" -#include "macros.h" -#include "imports.h" +#include "main/glheader.h" +#include "main/imports.h" +#include "main/macros.h" +#include "main/imports.h" #include "m_matrix.h" diff --git a/src/mesa/math/m_translate.c b/src/mesa/math/m_translate.c index c7423e9d9d..4a20f45ee4 100644 --- a/src/mesa/math/m_translate.c +++ b/src/mesa/math/m_translate.c @@ -28,9 +28,9 @@ */ -#include "glheader.h" -#include "mtypes.h" /* GLchan hack */ -#include "colormac.h" +#include "main/glheader.h" +#include "main/mtypes.h" /* GLchan hack */ +#include "main/colormac.h" #include "m_translate.h" diff --git a/src/mesa/math/m_vector.c b/src/mesa/math/m_vector.c index 3ad81d468b..c5e2fd1de1 100644 --- a/src/mesa/math/m_vector.c +++ b/src/mesa/math/m_vector.c @@ -28,10 +28,10 @@ */ -#include "glheader.h" -#include "imports.h" -#include "macros.h" -#include "imports.h" +#include "main/glheader.h" +#include "main/imports.h" +#include "main/macros.h" +#include "main/imports.h" #include "m_vector.h" diff --git a/src/mesa/math/m_vector.h b/src/mesa/math/m_vector.h index 222b47f6e1..647388ac7d 100644 --- a/src/mesa/math/m_vector.h +++ b/src/mesa/math/m_vector.h @@ -1,9 +1,8 @@ - /* * Mesa 3-D graphics library - * Version: 3.5 + * Version: 7.3 * - * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2008 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"), @@ -31,8 +30,8 @@ #ifndef _M_VECTOR_H_ #define _M_VECTOR_H_ -#include "glheader.h" -#include "mtypes.h" /* hack for GLchan */ +#include "main/glheader.h" +#include "main/mtypes.h" /* hack for GLchan */ #define VEC_DIRTY_0 0x1 diff --git a/src/mesa/math/m_xform.h b/src/mesa/math/m_xform.h index 99b071a46b..24e8ddbd57 100644 --- a/src/mesa/math/m_xform.h +++ b/src/mesa/math/m_xform.h @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.5.1 + * Version: 7.3 * - * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2008 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"), @@ -27,8 +27,8 @@ #define _M_XFORM_H -#include "glheader.h" -#include "config.h" +#include "main/glheader.h" +#include "main/config.h" #include "math/m_vector.h" #include "math/m_matrix.h" diff --git a/src/mesa/ppc/common_ppc.c b/src/mesa/ppc/common_ppc.c index 13526df78c..786e1817ac 100644 --- a/src/mesa/ppc/common_ppc.c +++ b/src/mesa/ppc/common_ppc.c @@ -38,6 +38,9 @@ #include <elf.h> #endif +#include "common_ppc_features.h" + + unsigned long _mesa_ppc_cpu_features = 0; /** diff --git a/src/mesa/ppc/common_ppc_features.h b/src/mesa/ppc/common_ppc_features.h index 4d46ca04c9..9cde422d72 100644 --- a/src/mesa/ppc/common_ppc_features.h +++ b/src/mesa/ppc/common_ppc_features.h @@ -48,4 +48,7 @@ extern unsigned long _mesa_ppc_cpu_features; #define cpu_has_fpu ((_mesa_ppc_cpu_features & PPC_FEATURE_HAS_FPU) != 0) #endif /* USE_PPC_ASM */ + +extern void _mesa_init_all_ppc_transform_asm( void ); + #endif /* COMMON_PPC_FEATURES_H */ diff --git a/src/mesa/shader/arbprogparse.c b/src/mesa/shader/arbprogparse.c index f10233e5fe..8ce5348c09 100644 --- a/src/mesa/shader/arbprogparse.c +++ b/src/mesa/shader/arbprogparse.c @@ -32,14 +32,14 @@ #include "main/glheader.h" #include "main/imports.h" +#include "main/context.h" +#include "main/macros.h" +#include "main/mtypes.h" #include "shader/grammar/grammar_mesa.h" #include "arbprogparse.h" #include "program.h" #include "prog_parameter.h" #include "prog_statevars.h" -#include "context.h" -#include "macros.h" -#include "mtypes.h" #include "prog_instruction.h" diff --git a/src/mesa/shader/arbprogparse.h b/src/mesa/shader/arbprogparse.h index 4574e5cd55..980d39fb9f 100644 --- a/src/mesa/shader/arbprogparse.h +++ b/src/mesa/shader/arbprogparse.h @@ -26,7 +26,7 @@ #ifndef ARBPROGPARSE_H #define ARBPROGPARSE_H -#include "mtypes.h" +#include "main/mtypes.h" extern void _mesa_parse_arb_vertex_program(GLcontext *ctx, GLenum target, diff --git a/src/mesa/shader/arbprogram.c b/src/mesa/shader/arbprogram.c index 81c20a0150..760dac2399 100644 --- a/src/mesa/shader/arbprogram.c +++ b/src/mesa/shader/arbprogram.c @@ -29,14 +29,14 @@ */ -#include "glheader.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/hash.h" +#include "main/imports.h" +#include "main/macros.h" +#include "main/mtypes.h" #include "arbprogram.h" #include "arbprogparse.h" -#include "context.h" -#include "hash.h" -#include "imports.h" -#include "macros.h" -#include "mtypes.h" #include "program.h" diff --git a/src/mesa/shader/atifragshader.c b/src/mesa/shader/atifragshader.c index 854c911874..ac087d415c 100644 --- a/src/mesa/shader/atifragshader.c +++ b/src/mesa/shader/atifragshader.c @@ -21,13 +21,13 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include "glheader.h" -#include "context.h" -#include "hash.h" -#include "imports.h" -#include "macros.h" -#include "enums.h" -#include "mtypes.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/hash.h" +#include "main/imports.h" +#include "main/macros.h" +#include "main/enums.h" +#include "main/mtypes.h" #include "atifragshader.h" #define MESA_DEBUG_ATI_FS 0 diff --git a/src/mesa/shader/grammar/grammar_crt.c b/src/mesa/shader/grammar/grammar_crt.c index bdf2da9b2e..d2c95d1c8e 100644 --- a/src/mesa/shader/grammar/grammar_crt.c +++ b/src/mesa/shader/grammar/grammar_crt.c @@ -10,17 +10,17 @@ void grammar_alloc_free (void *ptr) free (ptr); } -void *grammar_alloc_malloc (unsigned int size) +void *grammar_alloc_malloc (size_t size) { return malloc (size); } -void *grammar_alloc_realloc (void *ptr, unsigned int old_size, unsigned int size) +void *grammar_alloc_realloc (void *ptr, size_t old_size, size_t size) { return realloc (ptr, size); } -void *grammar_memory_copy (void *dst, const void * src, unsigned int size) +void *grammar_memory_copy (void *dst, const void * src, size_t size) { return memcpy (dst, src, size); } @@ -30,7 +30,7 @@ int grammar_string_compare (const byte *str1, const byte *str2) return strcmp ((const char *) str1, (const char *) str2); } -int grammar_string_compare_n (const byte *str1, const byte *str2, unsigned int n) +int grammar_string_compare_n (const byte *str1, const byte *str2, size_t n) { return strncmp ((const char *) str1, (const char *) str2, n); } @@ -40,7 +40,7 @@ byte *grammar_string_copy (byte *dst, const byte *src) return (byte *) strcpy ((char *) dst, (const char *) src); } -byte *grammar_string_copy_n (byte *dst, const byte *src, unsigned int n) +byte *grammar_string_copy_n (byte *dst, const byte *src, size_t n) { return (byte *) strncpy ((char *) dst, (const char *) src, n); } diff --git a/src/mesa/shader/grammar/grammar_mesa.h b/src/mesa/shader/grammar/grammar_mesa.h index c14033a9d4..6c92c5812d 100644 --- a/src/mesa/shader/grammar/grammar_mesa.h +++ b/src/mesa/shader/grammar/grammar_mesa.h @@ -26,7 +26,7 @@ #define GRAMMAR_MESA_H -#include "imports.h" +#include "main/imports.h" /* NOTE: include Mesa 3-D specific headers here */ diff --git a/src/mesa/shader/nvfragparse.c b/src/mesa/shader/nvfragparse.c index 0f1a1eade4..20e4781372 100644 --- a/src/mesa/shader/nvfragparse.c +++ b/src/mesa/shader/nvfragparse.c @@ -37,14 +37,14 @@ * including any use thereof or modifications thereto. */ -#include "glheader.h" -#include "context.h" -#include "imports.h" -#include "macros.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/imports.h" +#include "main/macros.h" +#include "program.h" #include "prog_parameter.h" #include "prog_instruction.h" #include "nvfragparse.h" -#include "program.h" #define INPUT_1V 1 diff --git a/src/mesa/shader/nvprogram.c b/src/mesa/shader/nvprogram.c index 409c61cdc1..88272fff3f 100644 --- a/src/mesa/shader/nvprogram.c +++ b/src/mesa/shader/nvprogram.c @@ -37,17 +37,17 @@ * including any use thereof or modifications thereto. */ -#include "glheader.h" -#include "context.h" -#include "hash.h" -#include "imports.h" -#include "macros.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/hash.h" +#include "main/imports.h" +#include "main/macros.h" +#include "program.h" #include "prog_parameter.h" #include "prog_instruction.h" #include "nvfragparse.h" #include "nvvertparse.h" #include "nvprogram.h" -#include "program.h" diff --git a/src/mesa/shader/nvvertparse.c b/src/mesa/shader/nvvertparse.c index ac96d4a60e..08538c0ee4 100644 --- a/src/mesa/shader/nvvertparse.c +++ b/src/mesa/shader/nvvertparse.c @@ -37,10 +37,10 @@ * including any use thereof or modifications thereto. */ -#include "glheader.h" -#include "context.h" -#include "imports.h" -#include "macros.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/imports.h" +#include "main/macros.h" #include "nvprogram.h" #include "nvvertparse.h" #include "prog_instruction.h" diff --git a/src/mesa/shader/prog_cache.c b/src/mesa/shader/prog_cache.c new file mode 100644 index 0000000000..36a25377c5 --- /dev/null +++ b/src/mesa/shader/prog_cache.c @@ -0,0 +1,193 @@ +/************************************************************************** + * + * 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 "main/glheader.h" +#include "main/mtypes.h" +#include "main/imports.h" +#include "shader/prog_cache.h" +#include "shader/program.h" + + +struct cache_item +{ + GLuint hash; + void *key; + struct gl_program *program; + struct cache_item *next; +}; + +struct gl_program_cache +{ + struct cache_item **items; + GLuint size, n_items; +}; + + + +/** + * Compute hash index from state key. + */ +static GLuint +hash_key(const void *key, GLuint key_size) +{ + const GLuint *ikey = (const GLuint *) key; + GLuint hash = 0, i; + + assert(key_size >= 4); + + /* Make a slightly better attempt at a hash function: + */ + for (i = 0; i < key_size / sizeof(*ikey); i++) + { + hash += ikey[i]; + hash += (hash << 10); + hash ^= (hash >> 6); + } + + return hash; +} + + +/** + * Rebuild/expand the hash table to accomodate more entries + */ +static void +rehash(struct gl_program_cache *cache) +{ + struct cache_item **items; + struct cache_item *c, *next; + GLuint size, i; + + size = cache->size * 3; + items = (struct cache_item**) _mesa_malloc(size * sizeof(*items)); + _mesa_memset(items, 0, size * sizeof(*items)); + + for (i = 0; i < cache->size; i++) + for (c = cache->items[i]; c; c = next) { + next = c->next; + c->next = items[c->hash % size]; + items[c->hash % size] = c; + } + + _mesa_free(cache->items); + cache->items = items; + cache->size = size; +} + + +static void +clear_cache(GLcontext *ctx, struct gl_program_cache *cache) +{ + struct cache_item *c, *next; + GLuint i; + + for (i = 0; i < cache->size; i++) { + for (c = cache->items[i]; c; c = next) { + next = c->next; + _mesa_free(c->key); + _mesa_reference_program(ctx, &c->program, NULL); + _mesa_free(c); + } + cache->items[i] = NULL; + } + + + cache->n_items = 0; +} + + + +struct gl_program_cache * +_mesa_new_program_cache(void) +{ + struct gl_program_cache *cache = CALLOC_STRUCT(gl_program_cache); + if (cache) { + cache->size = 17; + cache->items = (struct cache_item **) + _mesa_calloc(cache->size * sizeof(struct cache_item)); + if (!cache->items) { + _mesa_free(cache); + return NULL; + } + } + return cache; +} + + +void +_mesa_delete_program_cache(GLcontext *ctx, struct gl_program_cache *cache) +{ + clear_cache(ctx, cache); + _mesa_free(cache->items); + _mesa_free(cache); +} + + +struct gl_program * +_mesa_search_program_cache(const struct gl_program_cache *cache, + const void *key, GLuint keysize) +{ + const GLuint hash = hash_key(key, keysize); + struct cache_item *c; + + for (c = cache->items[hash % cache->size]; c; c = c->next) { + if (c->hash == hash && memcmp(c->key, key, keysize) == 0) + return c->program; + } + + return NULL; +} + + +void +_mesa_program_cache_insert(GLcontext *ctx, + struct gl_program_cache *cache, + const void *key, GLuint keysize, + struct gl_program *program) +{ + const GLuint hash = hash_key(key, keysize); + struct cache_item *c = CALLOC_STRUCT(cache_item); + + c->hash = hash; + + c->key = _mesa_malloc(keysize); + memcpy(c->key, key, keysize); + + c->program = program; /* no refcount change */ + + if (cache->n_items > cache->size * 1.5) { + if (cache->size < 1000) + rehash(cache); + else + clear_cache(ctx, cache); + } + + cache->n_items++; + c->next = cache->items[hash % cache->size]; + cache->items[hash % cache->size] = c; +} diff --git a/src/mesa/shader/prog_cache.h b/src/mesa/shader/prog_cache.h new file mode 100644 index 0000000000..a8c91fba01 --- /dev/null +++ b/src/mesa/shader/prog_cache.h @@ -0,0 +1,55 @@ +/************************************************************************** + * + * 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 PROG_CACHE_H +#define PROG_CACHE_H + + +/** Opaque type */ +struct gl_program_cache; + + +extern struct gl_program_cache * +_mesa_new_program_cache(void); + +extern void +_mesa_delete_program_cache(GLcontext *ctx, struct gl_program_cache *pc); + + +extern struct gl_program * +_mesa_search_program_cache(const struct gl_program_cache *cache, + const void *key, GLuint keysize); + +extern void +_mesa_program_cache_insert(GLcontext *ctx, + struct gl_program_cache *cache, + const void *key, GLuint keysize, + struct gl_program *program); + + +#endif /* PROG_CACHE_H */ diff --git a/src/mesa/shader/prog_debug.c b/src/mesa/shader/prog_debug.c index 57929fcbca..7bcb2ef734 100644 --- a/src/mesa/shader/prog_debug.c +++ b/src/mesa/shader/prog_debug.c @@ -23,9 +23,9 @@ */ -#include "glheader.h" -#include "context.h" -#include "macros.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/macros.h" #include "nvfragparse.h" #include "nvvertparse.h" #include "program.h" diff --git a/src/mesa/shader/prog_execute.c b/src/mesa/shader/prog_execute.c index b9b7712f3f..32b6ff4fd4 100644 --- a/src/mesa/shader/prog_execute.c +++ b/src/mesa/shader/prog_execute.c @@ -35,9 +35,9 @@ */ -#include "glheader.h" -#include "colormac.h" -#include "context.h" +#include "main/glheader.h" +#include "main/colormac.h" +#include "main/context.h" #include "program.h" #include "prog_execute.h" #include "prog_instruction.h" @@ -93,7 +93,7 @@ get_register_pointer(const struct prog_src_register *source, source->File == PROGRAM_STATE_VAR || source->File == PROGRAM_UNIFORM); params = machine->CurProgram->Parameters; - if (reg < 0 || reg >= params->NumParameters) + if (reg < 0 || reg >= (GLint)params->NumParameters) return ZeroVec; else return params->ParameterValues[reg]; @@ -228,7 +228,7 @@ fetch_vector4_deriv(GLcontext * ctx, const struct gl_program_machine *machine, char xOrY, GLfloat result[4]) { - if (source->File == PROGRAM_INPUT && source->Index < machine->NumDeriv) { + if (source->File == PROGRAM_INPUT && source->Index < (GLint)machine->NumDeriv) { const GLint col = machine->CurElement; const GLfloat w = machine->Attribs[FRAG_ATTRIB_WPOS][col][3]; const GLfloat invQ = 1.0f / w; @@ -507,7 +507,7 @@ _mesa_execute_program(GLcontext * ctx, { const GLuint numInst = program->NumInstructions; const GLuint maxExec = 10000; - GLint pc, numExec = 0; + GLuint pc, numExec = 0; machine->CurProgram = program; diff --git a/src/mesa/shader/prog_instruction.c b/src/mesa/shader/prog_instruction.c index bea5d0551e..1033496d97 100644 --- a/src/mesa/shader/prog_instruction.c +++ b/src/mesa/shader/prog_instruction.c @@ -23,9 +23,9 @@ */ -#include "glheader.h" -#include "imports.h" -#include "mtypes.h" +#include "main/glheader.h" +#include "main/imports.h" +#include "main/mtypes.h" #include "prog_instruction.h" diff --git a/src/mesa/shader/prog_parameter.c b/src/mesa/shader/prog_parameter.c index d87e8f6e15..2dfd923a0f 100644 --- a/src/mesa/shader/prog_parameter.c +++ b/src/mesa/shader/prog_parameter.c @@ -29,9 +29,9 @@ */ -#include "glheader.h" -#include "imports.h" -#include "macros.h" +#include "main/glheader.h" +#include "main/imports.h" +#include "main/macros.h" #include "prog_instruction.h" #include "prog_parameter.h" #include "prog_statevars.h" @@ -278,6 +278,26 @@ _mesa_add_uniform(struct gl_program_parameter_list *paramList, /** + * Mark the named uniform as 'used'. + */ +void +_mesa_use_uniform(struct gl_program_parameter_list *paramList, + const char *name) +{ + GLuint i; + for (i = 0; i < paramList->NumParameters; i++) { + struct gl_program_parameter *p = paramList->Parameters + i; + if (p->Type == PROGRAM_UNIFORM && _mesa_strcmp(p->Name, name) == 0) { + p->Used = GL_TRUE; + /* Note that large uniforms may occupy several slots so we're + * not done searching yet. + */ + } + } +} + + +/** * Add a sampler to the parameter list. * \param name uniform's name * \param datatype GL_SAMPLER_2D, GL_SAMPLER_2D_RECT_ARB, etc. @@ -591,21 +611,24 @@ _mesa_clone_parameter_list(const struct gl_program_parameter_list *list) /** Not too efficient, but correct */ for (i = 0; i < list->NumParameters; i++) { struct gl_program_parameter *p = list->Parameters + i; + struct gl_program_parameter *pCopy; GLuint size = MIN2(p->Size, 4); GLint j = _mesa_add_parameter(clone, p->Type, p->Name, size, p->DataType, list->ParameterValues[i], NULL); ASSERT(j >= 0); + pCopy = clone->Parameters + j; + pCopy->Used = p->Used; /* copy state indexes */ if (p->Type == PROGRAM_STATE_VAR) { GLint k; - struct gl_program_parameter *q = clone->Parameters + j; for (k = 0; k < STATE_LENGTH; k++) { - q->StateIndexes[k] = p->StateIndexes[k]; + pCopy->StateIndexes[k] = p->StateIndexes[k]; } } else { clone->Parameters[j].Size = p->Size; } + } clone->StateFlags = list->StateFlags; diff --git a/src/mesa/shader/prog_parameter.h b/src/mesa/shader/prog_parameter.h index dfb8c39ca4..e8d3e9ec33 100644 --- a/src/mesa/shader/prog_parameter.h +++ b/src/mesa/shader/prog_parameter.h @@ -31,7 +31,7 @@ #ifndef PROG_PARAMETER_H #define PROG_PARAMETER_H -#include "mtypes.h" +#include "main/mtypes.h" #include "prog_statevars.h" @@ -48,6 +48,7 @@ struct gl_program_parameter enum register_file Type; /**< PROGRAM_NAMED_PARAM, CONSTANT or STATE_VAR */ GLenum DataType; /**< GL_FLOAT, GL_FLOAT_VEC2, etc */ GLuint Size; /**< Number of components (1..4) */ + GLboolean Used; /**< Helper flag for GLSL uniform tracking */ /** * A sequence of STATE_* tokens and integers to identify GL state. */ @@ -112,6 +113,10 @@ extern GLint _mesa_add_uniform(struct gl_program_parameter_list *paramList, const char *name, GLuint size, GLenum datatype); +extern void +_mesa_use_uniform(struct gl_program_parameter_list *paramList, + const char *name); + extern GLint _mesa_add_sampler(struct gl_program_parameter_list *paramList, const char *name, GLenum datatype); diff --git a/src/mesa/shader/prog_print.c b/src/mesa/shader/prog_print.c index 7343b761a2..32708ed706 100644 --- a/src/mesa/shader/prog_print.c +++ b/src/mesa/shader/prog_print.c @@ -28,9 +28,9 @@ * \author Brian Paul */ -#include "glheader.h" -#include "context.h" -#include "imports.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/imports.h" #include "prog_instruction.h" #include "prog_parameter.h" #include "prog_print.h" diff --git a/src/mesa/shader/prog_statevars.c b/src/mesa/shader/prog_statevars.c index 91392650a3..971eb25a49 100644 --- a/src/mesa/shader/prog_statevars.c +++ b/src/mesa/shader/prog_statevars.c @@ -29,15 +29,14 @@ */ -#include "glheader.h" -#include "context.h" -#include "hash.h" -#include "imports.h" -#include "macros.h" -#include "mtypes.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/hash.h" +#include "main/imports.h" +#include "main/macros.h" +#include "main/mtypes.h" #include "prog_statevars.h" #include "prog_parameter.h" -#include "nvvertparse.h" /** @@ -134,10 +133,6 @@ _mesa_fetch_state(GLcontext *ctx, const gl_state_index state[], value[3] = 1.0; } return; - case STATE_POSITION_NORMALIZED: - COPY_4V(value, ctx->Light.Light[ln].EyePosition); - NORMALIZE_3FV( value ); - return; default: _mesa_problem(ctx, "Invalid light state in fetch_state"); return; @@ -401,7 +396,11 @@ _mesa_fetch_state(GLcontext *ctx, const gl_state_index state[], case STATE_INTERNAL: switch (state[1]) { case STATE_NORMAL_SCALE: - ASSIGN_4V(value, ctx->_ModelViewInvScale, 0, 0, 1); + ASSIGN_4V(value, + ctx->_ModelViewInvScale, + ctx->_ModelViewInvScale, + ctx->_ModelViewInvScale, + 1); return; case STATE_TEXRECT_SCALE: { @@ -428,18 +427,48 @@ _mesa_fetch_state(GLcontext *ctx, const gl_state_index state[], value[0] = (ctx->Fog.End == ctx->Fog.Start) ? 1.0f : (GLfloat)(-1.0F / (ctx->Fog.End - ctx->Fog.Start)); value[1] = ctx->Fog.End * -value[0]; - value[2] = ctx->Fog.Density * ONE_DIV_LN2; - value[3] = ctx->Fog.Density * ONE_DIV_SQRT_LN2; + value[2] = (GLfloat)(ctx->Fog.Density * ONE_DIV_LN2); + value[3] = (GLfloat)(ctx->Fog.Density * ONE_DIV_SQRT_LN2); return; - case STATE_SPOT_DIR_NORMALIZED: { + + case STATE_LIGHT_SPOT_DIR_NORMALIZED: { /* here, state[2] is the light number */ /* pre-normalize spot dir */ const GLuint ln = (GLuint) state[2]; - COPY_3V(value, ctx->Light.Light[ln].EyeDirection); - NORMALIZE_3FV(value); + COPY_3V(value, ctx->Light.Light[ln]._NormDirection); value[3] = ctx->Light.Light[ln]._CosCutoff; return; } + + case STATE_LIGHT_POSITION: { + const GLuint ln = (GLuint) state[2]; + COPY_4V(value, ctx->Light.Light[ln]._Position); + return; + } + + case STATE_LIGHT_POSITION_NORMALIZED: { + const GLuint ln = (GLuint) state[2]; + COPY_4V(value, ctx->Light.Light[ln]._Position); + NORMALIZE_3FV( value ); + return; + } + + case STATE_LIGHT_HALF_VECTOR: { + const GLuint ln = (GLuint) state[2]; + GLfloat p[3]; + /* Compute infinite half angle vector: + * halfVector = normalize(normalize(lightPos) + (0, 0, 1)) + * light.EyePosition.w should be 0 for infinite lights. + */ + COPY_3V(p, ctx->Light.Light[ln]._Position); + NORMALIZE_3FV(p); + ADD_3V(value, p, ctx->_EyeZDir); + NORMALIZE_3FV(value); + value[3] = 1.0; + return; + } + + case STATE_PT_SCALE: value[0] = ctx->Pixel.RedScale; value[1] = ctx->Pixel.GreenScale; @@ -711,7 +740,6 @@ append_token(char *dst, gl_state_index k) append(dst, "normalScale"); break; case STATE_INTERNAL: - case STATE_POSITION_NORMALIZED: append(dst, "(internal)"); break; case STATE_PT_SCALE: diff --git a/src/mesa/shader/prog_statevars.h b/src/mesa/shader/prog_statevars.h index da75ca77a1..d3091147f8 100644 --- a/src/mesa/shader/prog_statevars.h +++ b/src/mesa/shader/prog_statevars.h @@ -25,7 +25,7 @@ #ifndef PROG_STATEVARS_H #define PROG_STATEVARS_H -#include "mtypes.h" +#include "main/mtypes.h" /** @@ -106,9 +106,11 @@ typedef enum gl_state_index_ { STATE_INTERNAL, /* Mesa additions */ STATE_NORMAL_SCALE, STATE_TEXRECT_SCALE, - STATE_POSITION_NORMALIZED, /* normalized light position */ STATE_FOG_PARAMS_OPTIMIZED, /* for faster fog calc */ - STATE_SPOT_DIR_NORMALIZED, /* pre-normalized spot dir */ + STATE_LIGHT_SPOT_DIR_NORMALIZED, /* pre-normalized spot dir */ + STATE_LIGHT_POSITION, /* object vs eye space */ + STATE_LIGHT_POSITION_NORMALIZED, /* object vs eye space */ + STATE_LIGHT_HALF_VECTOR, /* object vs eye space */ STATE_PT_SCALE, /**< Pixel transfer RGBA scale */ STATE_PT_BIAS, /**< Pixel transfer RGBA bias */ STATE_PCM_SCALE, /**< Post color matrix RGBA scale */ diff --git a/src/mesa/shader/prog_uniform.c b/src/mesa/shader/prog_uniform.c index 0b1d0232a0..f57df3d86d 100644 --- a/src/mesa/shader/prog_uniform.c +++ b/src/mesa/shader/prog_uniform.c @@ -135,7 +135,7 @@ _mesa_longest_uniform_name(const struct gl_uniform_list *list) GLuint i; for (i = 0; list && i < list->NumUniforms; i++) { GLuint len = _mesa_strlen(list->Uniforms[i].Name); - if (len > max) + if (len > (GLuint)max) max = len; } return max; diff --git a/src/mesa/shader/program.c b/src/mesa/shader/program.c index 693d73baa2..738891a029 100644 --- a/src/mesa/shader/program.c +++ b/src/mesa/shader/program.c @@ -29,10 +29,11 @@ */ -#include "glheader.h" -#include "context.h" -#include "hash.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/hash.h" #include "program.h" +#include "prog_cache.h" #include "prog_parameter.h" #include "prog_instruction.h" @@ -57,7 +58,11 @@ _mesa_init_program(GLcontext *ctx) #if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program ctx->VertexProgram.Enabled = GL_FALSE; +#if FEATURE_es2_glsl + ctx->VertexProgram.PointSizeEnabled = GL_TRUE; +#else ctx->VertexProgram.PointSizeEnabled = GL_FALSE; +#endif ctx->VertexProgram.TwoSideEnabled = GL_FALSE; _mesa_reference_vertprog(ctx, &ctx->VertexProgram.Current, ctx->Shared->DefaultVertexProgram); @@ -66,6 +71,7 @@ _mesa_init_program(GLcontext *ctx) ctx->VertexProgram.TrackMatrix[i] = GL_NONE; ctx->VertexProgram.TrackMatrixTransform[i] = GL_IDENTITY_NV; } + ctx->VertexProgram.Cache = _mesa_new_program_cache(); #endif #if FEATURE_NV_fragment_program || FEATURE_ARB_fragment_program @@ -73,8 +79,10 @@ _mesa_init_program(GLcontext *ctx) _mesa_reference_fragprog(ctx, &ctx->FragmentProgram.Current, ctx->Shared->DefaultFragmentProgram); assert(ctx->FragmentProgram.Current); + ctx->FragmentProgram.Cache = _mesa_new_program_cache(); #endif + /* XXX probably move this stuff */ #if FEATURE_ATI_fragment_shader ctx->ATIFragmentShader.Enabled = GL_FALSE; @@ -93,9 +101,11 @@ _mesa_free_program_data(GLcontext *ctx) { #if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program _mesa_reference_vertprog(ctx, &ctx->VertexProgram.Current, NULL); + _mesa_delete_program_cache(ctx, ctx->VertexProgram.Cache); #endif #if FEATURE_NV_fragment_program || FEATURE_ARB_fragment_program _mesa_reference_fragprog(ctx, &ctx->FragmentProgram.Current, NULL); + _mesa_delete_program_cache(ctx, ctx->FragmentProgram.Cache); #endif /* XXX probably move this stuff */ #if FEATURE_ATI_fragment_shader @@ -362,7 +372,11 @@ _mesa_reference_program(GLcontext *ctx, assert(ptr); if (*ptr && prog) { /* sanity check */ - ASSERT((*ptr)->Target == prog->Target); + if ((*ptr)->Target == GL_VERTEX_PROGRAM_ARB) + ASSERT(prog->Target == GL_VERTEX_PROGRAM_ARB); + else if ((*ptr)->Target == GL_FRAGMENT_PROGRAM_ARB) + ASSERT(prog->Target == GL_FRAGMENT_PROGRAM_ARB || + prog->Target == GL_FRAGMENT_PROGRAM_NV); } if (*ptr == prog) { return; /* no change */ @@ -507,7 +521,7 @@ _mesa_insert_instructions(struct gl_program *prog, GLuint start, GLuint count) for (i = 0; i < prog->NumInstructions; i++) { struct prog_instruction *inst = prog->Instructions + i; if (inst->BranchTarget > 0) { - if (inst->BranchTarget >= start) { + if ((GLuint)inst->BranchTarget >= start) { inst->BranchTarget += count; } } diff --git a/src/mesa/shader/program.h b/src/mesa/shader/program.h index d227aaa1ca..48176162c3 100644 --- a/src/mesa/shader/program.h +++ b/src/mesa/shader/program.h @@ -40,7 +40,7 @@ #ifndef PROGRAM_H #define PROGRAM_H -#include "mtypes.h" +#include "main/mtypes.h" extern struct gl_program _mesa_DummyProgram; diff --git a/src/mesa/shader/programopt.c b/src/mesa/shader/programopt.c index f3511ba00e..56f1eb832e 100644 --- a/src/mesa/shader/programopt.c +++ b/src/mesa/shader/programopt.c @@ -31,8 +31,8 @@ */ -#include "glheader.h" -#include "context.h" +#include "main/glheader.h" +#include "main/context.h" #include "prog_parameter.h" #include "prog_statevars.h" #include "program.h" @@ -368,9 +368,9 @@ _mesa_count_texture_instructions(struct gl_program *prog) /** * Scan/rewrite program to remove reads of custom (output) registers. - * The passed type has to be either PROGRAM_VARYING or PROGRAM_OUTPUT. - * In GLSL vertex shaders, varying vars can be read and written. - * Normally, vertex varying vars are implemented as output registers. + * The passed type has to be either PROGRAM_OUTPUT or PROGRAM_VARYING + * (for vertex shaders). + * In GLSL shaders, varying vars can be read and written. * On some hardware, trying to read an output register causes trouble. * So, rewrite the program to use a temporary register in this case. */ @@ -381,8 +381,8 @@ _mesa_remove_output_reads(struct gl_program *prog, enum register_file type) GLint outputMap[VERT_RESULT_MAX]; GLuint numVaryingReads = 0; - assert(prog->Target == GL_VERTEX_PROGRAM_ARB); assert(type == PROGRAM_VARYING || type == PROGRAM_OUTPUT); + assert(prog->Target == GL_VERTEX_PROGRAM_ARB || type != PROGRAM_VARYING); for (i = 0; i < VERT_RESULT_MAX; i++) outputMap[i] = -1; diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c index 92bf3ecb5c..3c530d1727 100644 --- a/src/mesa/shader/shader_api.c +++ b/src/mesa/shader/shader_api.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 7.0 + * Version: 7.2 * - * Copyright (C) 2004-2007 Brian Paul All Rights Reserved. + * Copyright (C) 2004-2008 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"), @@ -35,21 +35,26 @@ */ -#include "glheader.h" -#include "context.h" -#include "hash.h" -#include "macros.h" -#include "program.h" -#include "prog_parameter.h" -#include "prog_print.h" -#include "prog_statevars.h" -#include "prog_uniform.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/hash.h" +#include "main/macros.h" +#include "shader/program.h" +#include "shader/prog_parameter.h" +#include "shader/prog_print.h" +#include "shader/prog_statevars.h" +#include "shader/prog_uniform.h" #include "shader/shader_api.h" #include "shader/slang/slang_compile.h" #include "shader/slang/slang_link.h" +#ifndef GL_PROGRAM_BINARY_LENGTH_OES +#define GL_PROGRAM_BINARY_LENGTH_OES 0x8741 +#endif + + /** * Allocate a new gl_shader_program object, initialize it. */ @@ -492,10 +497,14 @@ _mesa_get_attrib_location(GLcontext *ctx, GLuint program, if (!name) return -1; - if (shProg->Attributes) { - GLint i = _mesa_lookup_parameter_index(shProg->Attributes, -1, name); - if (i >= 0) { - return shProg->Attributes->Parameters[i].StateIndexes[0]; + if (shProg->VertexProgram) { + const struct gl_program_parameter_list *attribs = + shProg->VertexProgram->Base.Attributes; + if (attribs) { + GLint i = _mesa_lookup_parameter_index(attribs, -1, name); + if (i >= 0) { + return attribs->Parameters[i].StateIndexes[0]; + } } } return -1; @@ -546,12 +555,10 @@ _mesa_bind_attrib_location(GLcontext *ctx, GLuint program, GLuint index, return; } - if (shProg->VertexProgram && oldIndex >= 0 && oldIndex != index) { - /* If the index changed, need to search/replace references to that attribute - * in the vertex program. - */ - _slang_remap_attribute(&shProg->VertexProgram->Base, oldIndex, index); - } + /* + * Note that this attribute binding won't go into effect until + * glLinkProgram is called again. + */ } @@ -715,6 +722,17 @@ sizeof_glsl_type(GLenum type) case GL_FLOAT: case GL_INT: case GL_BOOL: + case GL_SAMPLER_1D: + case GL_SAMPLER_2D: + case GL_SAMPLER_3D: + case GL_SAMPLER_CUBE: + case GL_SAMPLER_1D_SHADOW: + case GL_SAMPLER_2D_SHADOW: + case GL_SAMPLER_2D_RECT_ARB: + case GL_SAMPLER_2D_RECT_SHADOW_ARB: + case GL_SAMPLER_1D_ARRAY_SHADOW_EXT: + case GL_SAMPLER_2D_ARRAY_SHADOW_EXT: + case GL_SAMPLER_CUBE_SHADOW_EXT: return 1; case GL_FLOAT_VEC2: case GL_INT_VEC2: @@ -747,29 +765,88 @@ sizeof_glsl_type(GLenum type) } +static GLboolean +is_boolean_type(GLenum type) +{ + switch (type) { + case GL_BOOL: + case GL_BOOL_VEC2: + case GL_BOOL_VEC3: + case GL_BOOL_VEC4: + return GL_TRUE; + default: + return GL_FALSE; + } +} + + +static GLboolean +is_integer_type(GLenum type) +{ + switch (type) { + case GL_INT: + case GL_INT_VEC2: + case GL_INT_VEC3: + case GL_INT_VEC4: + return GL_TRUE; + default: + return GL_FALSE; + } +} + + static void _mesa_get_active_attrib(GLcontext *ctx, GLuint program, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLchar *nameOut) { + const struct gl_program_parameter_list *attribs = NULL; struct gl_shader_program *shProg; shProg = _mesa_lookup_shader_program_err(ctx, program, "glGetActiveAttrib"); if (!shProg) return; - if (!shProg->Attributes || index >= shProg->Attributes->NumParameters) { + if (shProg->VertexProgram) + attribs = shProg->VertexProgram->Base.Attributes; + + if (!attribs || index >= attribs->NumParameters) { _mesa_error(ctx, GL_INVALID_VALUE, "glGetActiveAttrib(index)"); return; } - copy_string(nameOut, maxLength, length, - shProg->Attributes->Parameters[index].Name); + copy_string(nameOut, maxLength, length, attribs->Parameters[index].Name); + if (size) - *size = shProg->Attributes->Parameters[index].Size - / sizeof_glsl_type(shProg->Attributes->Parameters[index].DataType); + *size = attribs->Parameters[index].Size + / sizeof_glsl_type(attribs->Parameters[index].DataType); + if (type) - *type = shProg->Attributes->Parameters[index].DataType; + *type = attribs->Parameters[index].DataType; +} + + +static struct gl_program_parameter * +get_uniform_parameter(const struct gl_shader_program *shProg, GLuint index) +{ + const struct gl_program *prog; + GLint progPos; + + progPos = shProg->Uniforms->Uniforms[index].VertPos; + if (progPos >= 0) { + prog = &shProg->VertexProgram->Base; + } + else { + progPos = shProg->Uniforms->Uniforms[index].FragPos; + if (progPos >= 0) { + prog = &shProg->FragmentProgram->Base; + } + } + + if (!prog || progPos < 0) + return NULL; /* should never happen */ + + return &prog->Parameters->Parameters[progPos]; } @@ -867,6 +944,7 @@ static void _mesa_get_programiv(GLcontext *ctx, GLuint program, GLenum pname, GLint *params) { + const struct gl_program_parameter_list *attribs; struct gl_shader_program *shProg = _mesa_lookup_shader_program(ctx, program); @@ -875,6 +953,11 @@ _mesa_get_programiv(GLcontext *ctx, GLuint program, return; } + if (shProg->VertexProgram) + attribs = shProg->VertexProgram->Base.Attributes; + else + attribs = NULL; + switch (pname) { case GL_DELETE_STATUS: *params = shProg->DeletePending; @@ -892,11 +975,10 @@ _mesa_get_programiv(GLcontext *ctx, GLuint program, *params = shProg->NumShaders; break; case GL_ACTIVE_ATTRIBUTES: - *params = shProg->Attributes ? shProg->Attributes->NumParameters : 0; + *params = attribs ? attribs->NumParameters : 0; break; case GL_ACTIVE_ATTRIBUTE_MAX_LENGTH: - *params = _mesa_longest_parameter_name(shProg->Attributes, - PROGRAM_INPUT) + 1; + *params = _mesa_longest_parameter_name(attribs, PROGRAM_INPUT) + 1; break; case GL_ACTIVE_UNIFORMS: *params = shProg->Uniforms ? shProg->Uniforms->NumUniforms : 0; @@ -906,6 +988,9 @@ _mesa_get_programiv(GLcontext *ctx, GLuint program, if (*params > 0) (*params)++; /* add one for terminating zero */ break; + case GL_PROGRAM_BINARY_LENGTH_OES: + *params = 0; + break; default: _mesa_error(ctx, GL_INVALID_ENUM, "glGetProgramiv(pname)"); return; @@ -988,6 +1073,71 @@ _mesa_get_shader_source(GLcontext *ctx, GLuint shader, GLsizei maxLength, } +static void +get_matrix_dims(GLenum type, GLint *rows, GLint *cols) +{ + switch (type) { + case GL_FLOAT_MAT2: + *rows = *cols = 2; + break; + case GL_FLOAT_MAT2x3: + *rows = 3; + *cols = 2; + break; + case GL_FLOAT_MAT2x4: + *rows = 4; + *cols = 2; + break; + case GL_FLOAT_MAT3: + *rows = 3; + *cols = 3; + break; + case GL_FLOAT_MAT3x2: + *rows = 2; + *cols = 3; + break; + case GL_FLOAT_MAT3x4: + *rows = 4; + *cols = 3; + break; + case GL_FLOAT_MAT4: + *rows = 4; + *cols = 4; + break; + case GL_FLOAT_MAT4x2: + *rows = 2; + *cols = 4; + break; + case GL_FLOAT_MAT4x3: + *rows = 3; + *cols = 4; + break; + default: + *rows = *cols = 0; + } +} + + +/** + * Determine the number of rows and columns occupied by a uniform + * according to its datatype. + */ +static void +get_uniform_rows_cols(const struct gl_program_parameter *p, + GLint *rows, GLint *cols) +{ + get_matrix_dims(p->DataType, rows, cols); + if (*rows == 0 && *cols == 0) { + /* not a matrix type, probably a float or vector */ + *rows = p->Size / 4 + 1; + if (p->Size % 4 == 0) + *cols = 4; + else + *cols = p->Size % 4; + } +} + + #define MAX_UNIFORM_ELEMENTS 16 /** @@ -999,12 +1149,11 @@ get_uniformfv(GLcontext *ctx, GLuint program, GLint location, GLfloat *params) { struct gl_shader_program *shProg - = _mesa_lookup_shader_program(ctx, program); + = _mesa_lookup_shader_program_err(ctx, program, "glGetUniform[if]v"); if (shProg) { if (shProg->Uniforms && location >= 0 && location < (GLint) shProg->Uniforms->NumUniforms) { GLint progPos; - GLuint i; const struct gl_program *prog = NULL; progPos = shProg->Uniforms->Uniforms[location].VertPos; @@ -1020,22 +1169,29 @@ get_uniformfv(GLcontext *ctx, GLuint program, GLint location, ASSERT(prog); if (prog) { + const struct gl_program_parameter *p = + &prog->Parameters->Parameters[progPos]; + GLint rows, cols, i, j, k; + /* See uniformiv() below */ - assert(prog->Parameters->Parameters[progPos].Size <= MAX_UNIFORM_ELEMENTS); + assert(p->Size <= MAX_UNIFORM_ELEMENTS); - for (i = 0; i < prog->Parameters->Parameters[progPos].Size; i++) { - params[i] = prog->Parameters->ParameterValues[progPos][i]; + get_uniform_rows_cols(p, &rows, &cols); + + k = 0; + for (i = 0; i < rows; i++) { + for (j = 0; j < cols; j++ ) { + params[k++] = prog->Parameters->ParameterValues[progPos+i][j]; + } } - return prog->Parameters->Parameters[progPos].Size; + + return p->Size; } } else { _mesa_error(ctx, GL_INVALID_OPERATION, "glGetUniformfv(location)"); } } - else { - _mesa_error(ctx, GL_INVALID_OPERATION, "glGetUniformfv(program)"); - } return 0; } @@ -1069,11 +1225,41 @@ _mesa_get_uniformiv(GLcontext *ctx, GLuint program, GLint location, /** + * The value returned by GetUniformLocation actually encodes two things: + * 1. the index into the prog->Uniforms[] array for the uniform + * 2. an offset in the prog->ParameterValues[] array for specifying array + * elements or structure fields. + * This function merges those two values. + */ +static void +merge_location_offset(GLint *location, GLint offset) +{ + *location = *location | (offset << 16); +} + + +/** + * Seperate the uniform location and parameter offset. See above. + */ +static void +split_location_offset(GLint *location, GLint *offset) +{ + *offset = (*location >> 16); + *location = *location & 0xffff; +} + + +/** * Called via ctx->Driver.GetUniformLocation(). + * + * The return value will encode two values, the uniform location and an + * offset (used for arrays, structs). */ static GLint _mesa_get_uniform_location(GLcontext *ctx, GLuint program, const GLchar *name) { + GLint offset = 0, location = -1; + struct gl_shader_program *shProg = _mesa_lookup_shader_program_err(ctx, program, "glGetUniformLocation"); @@ -1089,7 +1275,54 @@ _mesa_get_uniform_location(GLcontext *ctx, GLuint program, const GLchar *name) * actually used. */ - return _mesa_lookup_uniform(shProg->Uniforms, name); + /* XXX we need to be able to parse uniform names for structs and arrays + * such as: + * mymatrix[1] + * mystruct.field1 + */ + + { + /* handle 1-dimension arrays here... */ + char *c = strchr(name, '['); + if (c) { + /* truncate name at [ */ + const GLint len = c - name; + GLchar *newName = _mesa_malloc(len + 1); + if (!newName) + return -1; /* out of mem */ + _mesa_memcpy(newName, name, len); + newName[len] = 0; + + location = _mesa_lookup_uniform(shProg->Uniforms, newName); + if (location >= 0) { + const GLint element = _mesa_atoi(c + 1); + if (element > 0) { + /* get type of the uniform array element */ + struct gl_program_parameter *p; + p = get_uniform_parameter(shProg, location); + if (p) { + GLint rows, cols; + get_matrix_dims(p->DataType, &rows, &cols); + if (rows < 1) + rows = 1; + offset = element * rows; + } + } + } + + _mesa_free(newName); + } + } + + if (location < 0) { + location = _mesa_lookup_uniform(shProg->Uniforms, name); + } + + if (location >= 0) { + merge_location_offset(&location, offset); + } + + return location; } @@ -1262,23 +1495,33 @@ compatible_types(GLenum userType, GLenum targetType) /** * Set the value of a program's uniform variable. * \param program the program whose uniform to update - * \param location the location/index of the uniform + * \param index the index of the program parameter for the uniform + * \param offset additional parameter slot offset (for arrays) * \param type the datatype of the uniform * \param count the number of uniforms to set * \param elems number of elements per uniform * \param values the new values */ static void -set_program_uniform(GLcontext *ctx, struct gl_program *program, GLint location, - GLenum type, GLsizei count, GLint elems, const void *values) +set_program_uniform(GLcontext *ctx, struct gl_program *program, + GLint index, GLint offset, + GLenum type, GLsizei count, GLint elems, + const void *values) { + assert(offset >= 0); + if (!compatible_types(type, - program->Parameters->Parameters[location].DataType)) { + program->Parameters->Parameters[index].DataType)) { _mesa_error(ctx, GL_INVALID_OPERATION, "glUniform(type mismatch)"); return; } - if (program->Parameters->Parameters[location].Type == PROGRAM_SAMPLER) { + if (index + offset > program->Parameters->Size) { + /* out of bounds! */ + return; + } + + if (program->Parameters->Parameters[index].Type == PROGRAM_SAMPLER) { /* This controls which texture unit which is used by a sampler */ GLuint texUnit, sampler; @@ -1290,7 +1533,7 @@ set_program_uniform(GLcontext *ctx, struct gl_program *program, GLint location, return; } - sampler = (GLuint) program->Parameters->ParameterValues[location][0]; + sampler = (GLuint) program->Parameters->ParameterValues[index][0]; texUnit = ((GLuint *) values)[0]; /* check that the sampler (tex unit index) is legal */ @@ -1309,18 +1552,19 @@ set_program_uniform(GLcontext *ctx, struct gl_program *program, GLint location, else { /* ordinary uniform variable */ GLsizei k, i; + GLint slots = (program->Parameters->Parameters[index].Size + 3) / 4; - if (count * elems > (GLint) program->Parameters->Parameters[location].Size) { + if (count * elems > (GLint) program->Parameters->Parameters[index].Size) { _mesa_error(ctx, GL_INVALID_OPERATION, "glUniform(count too large)"); return; } + if (count > slots) + count = slots; + for (k = 0; k < count; k++) { - GLfloat *uniformVal = program->Parameters->ParameterValues[location + k]; - if (type == GL_INT || - type == GL_INT_VEC2 || - type == GL_INT_VEC3 || - type == GL_INT_VEC4) { + GLfloat *uniformVal = program->Parameters->ParameterValues[index + offset + k]; + if (is_integer_type(type)) { const GLint *iValues = ((const GLint *) values) + k * elems; for (i = 0; i < elems; i++) { uniformVal[i] = (GLfloat) iValues[i]; @@ -1332,6 +1576,13 @@ set_program_uniform(GLcontext *ctx, struct gl_program *program, GLint location, uniformVal[i] = fValues[i]; } } + + /* if the uniform is bool-valued, convert to 1.0 or 0.0 */ + if (is_boolean_type(program->Parameters->Parameters[index].DataType)) { + for (i = 0; i < elems; i++) { + uniformVal[i] = uniformVal[i] ? 1.0 : 0.0; + } + } } } } @@ -1345,7 +1596,7 @@ _mesa_uniform(GLcontext *ctx, GLint location, GLsizei count, const GLvoid *values, GLenum type) { struct gl_shader_program *shProg = ctx->Shader.CurrentProgram; - GLint elems; + GLint elems, offset; if (!shProg || !shProg->LinkStatus) { _mesa_error(ctx, GL_INVALID_OPERATION, "glUniform(program not linked)"); @@ -1355,6 +1606,8 @@ _mesa_uniform(GLcontext *ctx, GLint location, GLsizei count, if (location == -1) return; /* The standard specifies this as a no-op */ + split_location_offset(&location, &offset); + if (location < 0 || location >= (GLint) shProg->Uniforms->NumUniforms) { _mesa_error(ctx, GL_INVALID_VALUE, "glUniform(location)"); return; @@ -1393,83 +1646,48 @@ _mesa_uniform(GLcontext *ctx, GLint location, GLsizei count, * shader. We may need to update one or both shader's uniform here: */ if (shProg->VertexProgram) { - GLint loc = shProg->Uniforms->Uniforms[location].VertPos; - if (loc >= 0) { + /* convert uniform location to program parameter index */ + GLint index = shProg->Uniforms->Uniforms[location].VertPos; + if (index >= 0) { set_program_uniform(ctx, &shProg->VertexProgram->Base, - loc, type, count, elems, values); + index, offset, type, count, elems, values); } } if (shProg->FragmentProgram) { - GLint loc = shProg->Uniforms->Uniforms[location].FragPos; - if (loc >= 0) { + /* convert uniform location to program parameter index */ + GLint index = shProg->Uniforms->Uniforms[location].FragPos; + if (index >= 0) { set_program_uniform(ctx, &shProg->FragmentProgram->Base, - loc, type, count, elems, values); + index, offset, type, count, elems, values); } } } -static void -get_matrix_dims(GLenum type, GLint *rows, GLint *cols) -{ - switch (type) { - case GL_FLOAT_MAT2: - *rows = *cols = 2; - break; - case GL_FLOAT_MAT2x3: - *rows = 3; - *cols = 2; - break; - case GL_FLOAT_MAT2x4: - *rows = 4; - *cols = 2; - break; - case GL_FLOAT_MAT3: - *rows = 3; - *cols = 3; - break; - case GL_FLOAT_MAT3x2: - *rows = 2; - *cols = 3; - break; - case GL_FLOAT_MAT3x4: - *rows = 4; - *cols = 3; - break; - case GL_FLOAT_MAT4: - *rows = 4; - *cols = 4; - break; - case GL_FLOAT_MAT4x2: - *rows = 2; - *cols = 4; - break; - case GL_FLOAT_MAT4x3: - *rows = 3; - *cols = 4; - break; - default: - *rows = *cols = 0; - } -} - - +/** + * Set a matrix-valued program parameter. + */ static void set_program_uniform_matrix(GLcontext *ctx, struct gl_program *program, - GLuint location, GLuint count, - GLuint rows, GLuint cols, + GLuint index, GLuint offset, + GLuint count, GLuint rows, GLuint cols, GLboolean transpose, const GLfloat *values) { GLuint mat, row, col; - GLuint dst = location, src = 0; + GLuint dst = index + offset, src = 0; GLint nr, nc; /* check that the number of rows, columns is correct */ - get_matrix_dims(program->Parameters->Parameters[location].DataType, &nr, &nc); + get_matrix_dims(program->Parameters->Parameters[index].DataType, &nr, &nc); if (rows != nr || cols != nc) { _mesa_error(ctx, GL_INVALID_OPERATION, - "glUniformMatrix(matrix size mismatch"); + "glUniformMatrix(matrix size mismatch)"); + return; + } + + if (index + offset > program->Parameters->Size) { + /* out of bounds! */ return; } @@ -1510,6 +1728,7 @@ _mesa_uniform_matrix(GLcontext *ctx, GLint cols, GLint rows, GLenum matrixType, GLint location, GLsizei count, GLboolean transpose, const GLfloat *values) { + GLint offset; struct gl_shader_program *shProg = ctx->Shader.CurrentProgram; if (!shProg || !shProg->LinkStatus) { @@ -1521,6 +1740,8 @@ _mesa_uniform_matrix(GLcontext *ctx, GLint cols, GLint rows, if (location == -1) return; /* The standard specifies this as a no-op */ + split_location_offset(&location, &offset); + if (location < 0 || location >= (GLint) shProg->Uniforms->NumUniforms) { _mesa_error(ctx, GL_INVALID_VALUE, "glUniformMatrix(location)"); return; @@ -1533,18 +1754,22 @@ _mesa_uniform_matrix(GLcontext *ctx, GLint cols, GLint rows, FLUSH_VERTICES(ctx, _NEW_PROGRAM); if (shProg->VertexProgram) { - GLint loc = shProg->Uniforms->Uniforms[location].VertPos; - if (loc >= 0) { + /* convert uniform location to program parameter index */ + GLint index = shProg->Uniforms->Uniforms[location].VertPos; + if (index >= 0) { set_program_uniform_matrix(ctx, &shProg->VertexProgram->Base, - loc, count, rows, cols, transpose, values); + index, offset, + count, rows, cols, transpose, values); } } if (shProg->FragmentProgram) { - GLint loc = shProg->Uniforms->Uniforms[location].FragPos; - if (loc >= 0) { + /* convert uniform location to program parameter index */ + GLint index = shProg->Uniforms->Uniforms[location].FragPos; + if (index >= 0) { set_program_uniform_matrix(ctx, &shProg->FragmentProgram->Base, - loc, count, rows, cols, transpose, values); + index, offset, + count, rows, cols, transpose, values); } } } diff --git a/src/mesa/shader/shader_api.h b/src/mesa/shader/shader_api.h index 5521c585b5..e7f1266915 100644 --- a/src/mesa/shader/shader_api.h +++ b/src/mesa/shader/shader_api.h @@ -27,8 +27,8 @@ #define SHADER_API_H -#include "glheader.h" -#include "mtypes.h" +#include "main/glheader.h" +#include "main/mtypes.h" /** diff --git a/src/mesa/shader/slang/library/slang_120_core_gc.h b/src/mesa/shader/slang/library/slang_120_core_gc.h index 1bd781ffe5..3ee03e7ec3 100644 --- a/src/mesa/shader/slang/library/slang_120_core_gc.h +++ b/src/mesa/shader/slang/library/slang_120_core_gc.h @@ -2,709 +2,715 @@ /* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED FROM THE FOLLOWING FILE: */ /* slang_120_core.gc */ -3,1,0,26,1,1,1,0,9,102,48,48,0,0,1,1,0,9,102,49,48,0,0,1,1,0,9,102,50,48,0,0,1,1,0,9,102,48,49,0,0, -1,1,0,9,102,49,49,0,0,1,1,0,9,102,50,49,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59, -120,0,18,102,48,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,121,0,18,102,49,48,0, -20,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,122,0,18,102,50,48,0,20,0,9,18,95,95,114, +4,1,0,0,26,1,1,1,0,9,102,48,48,0,0,1,1,0,9,102,49,48,0,0,1,1,0,9,102,50,48,0,0,1,1,0,9,102,48,49,0, +0,1,1,0,9,102,49,49,0,0,1,1,0,9,102,50,49,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57, +59,120,0,18,102,48,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,121,0,18,102,49,48, +0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,122,0,18,102,50,48,0,20,0,9,18,95,95,114, 101,116,86,97,108,0,16,10,49,0,57,59,120,0,18,102,48,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0, 16,10,49,0,57,59,121,0,18,102,49,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,122, -0,18,102,50,49,0,20,0,0,1,0,26,1,1,1,0,9,102,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97, -116,50,120,51,0,18,102,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,18,102,0,0,17,48,0, -48,0,0,0,0,20,0,0,1,0,26,1,1,1,0,5,105,0,0,0,1,3,2,1,9,1,102,0,2,58,102,108,111,97,116,0,18,105,0, -0,0,0,0,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,51,0,18,102,0,0,0,20,0,0,1,0,26,1, -1,1,0,1,98,0,0,0,1,3,2,1,9,1,102,0,2,58,102,108,111,97,116,0,18,98,0,0,0,0,0,9,18,95,95,114,101, -116,86,97,108,0,58,109,97,116,50,120,51,0,18,102,0,0,0,20,0,0,1,0,26,1,1,1,0,11,99,48,0,0,1,1,0,11, -99,49,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,99,48,0,20,0,9,18,95,95,114,101, -116,86,97,108,0,16,10,49,0,57,18,99,49,0,20,0,0,1,0,28,1,1,1,0,9,102,48,48,0,0,1,1,0,9,102,49,48,0, -0,1,1,0,9,102,50,48,0,0,1,1,0,9,102,51,48,0,0,1,1,0,9,102,48,49,0,0,1,1,0,9,102,49,49,0,0,1,1,0,9, -102,50,49,0,0,1,1,0,9,102,51,49,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,120,0, -18,102,48,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,121,0,18,102,49,48,0,20,0,9, -18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,122,0,18,102,50,48,0,20,0,9,18,95,95,114,101,116, -86,97,108,0,16,8,48,0,57,59,119,0,18,102,51,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49, +0,18,102,50,49,0,20,0,0,1,0,0,26,1,1,1,0,9,102,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109, +97,116,50,120,51,0,18,102,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,18,102,0,0,17,48, +0,48,0,0,0,0,20,0,0,1,0,0,26,1,1,1,0,5,105,0,0,0,1,3,2,1,0,9,1,102,0,2,58,102,108,111,97,116,0,18, +105,0,0,0,0,0,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,51,0,18,102,0,0,0,20,0,0,1,0, +0,26,1,1,1,0,1,98,0,0,0,1,3,2,1,0,9,1,102,0,2,58,102,108,111,97,116,0,18,98,0,0,0,0,0,9,18,95,95, +114,101,116,86,97,108,0,58,109,97,116,50,120,51,0,18,102,0,0,0,20,0,0,1,0,0,26,1,1,1,0,11,99,48,0, +0,1,1,0,11,99,49,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,99,48,0,20,0,9,18,95, +95,114,101,116,86,97,108,0,16,10,49,0,57,18,99,49,0,20,0,0,1,0,0,28,1,1,1,0,9,102,48,48,0,0,1,1,0, +9,102,49,48,0,0,1,1,0,9,102,50,48,0,0,1,1,0,9,102,51,48,0,0,1,1,0,9,102,48,49,0,0,1,1,0,9,102,49, +49,0,0,1,1,0,9,102,50,49,0,0,1,1,0,9,102,51,49,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48, +0,57,59,120,0,18,102,48,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,121,0,18,102, +49,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,122,0,18,102,50,48,0,20,0,9,18,95, +95,114,101,116,86,97,108,0,16,8,48,0,57,59,119,0,18,102,51,48,0,20,0,9,18,95,95,114,101,116,86,97, +108,0,16,10,49,0,57,59,120,0,18,102,48,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57, +59,121,0,18,102,49,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,122,0,18,102,50, +49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,119,0,18,102,51,49,0,20,0,0,1,0,0,28, +1,1,1,0,9,102,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,52,0,18,102,0,0,17, +48,0,48,0,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,18,102,0,0,17,48,0,48,0,0,0,17,48, +0,48,0,0,0,0,20,0,0,1,0,0,28,1,1,1,0,5,105,0,0,0,1,3,2,1,0,9,1,102,0,2,58,102,108,111,97,116,0,18, +105,0,0,0,0,0,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,52,0,18,102,0,0,0,20,0,0,1,0, +0,28,1,1,1,0,1,98,0,0,0,1,3,2,1,0,9,1,102,0,2,58,102,108,111,97,116,0,18,98,0,0,0,0,0,9,18,95,95, +114,101,116,86,97,108,0,58,109,97,116,50,120,52,0,18,102,0,0,0,20,0,0,1,0,0,28,1,1,1,0,12,99,48,0, +0,1,1,0,12,99,49,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,99,48,0,20,0,9,18,95, +95,114,101,116,86,97,108,0,16,10,49,0,57,18,99,49,0,20,0,0,1,0,0,27,1,1,1,0,9,102,48,48,0,0,1,1,0, +9,102,49,48,0,0,1,1,0,9,102,48,49,0,0,1,1,0,9,102,49,49,0,0,1,1,0,9,102,48,50,0,0,1,1,0,9,102,49, +50,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,120,0,18,102,48,48,0,20,0,9,18,95,95, +114,101,116,86,97,108,0,16,8,48,0,57,59,121,0,18,102,49,48,0,20,0,9,18,95,95,114,101,116,86,97,108, +0,16,10,49,0,57,59,120,0,18,102,48,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59, +121,0,18,102,49,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,59,120,0,18,102,48,50,0, +20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,59,121,0,18,102,49,50,0,20,0,0,1,0,0,27,1,1, +1,0,9,102,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,120,50,0,18,102,0,0,17,48,0, +48,0,0,0,17,48,0,48,0,0,0,18,102,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,0,20,0,0,1,0,0,27,1,1,1,0,5, +105,0,0,0,1,3,2,1,0,9,1,102,0,2,58,102,108,111,97,116,0,18,105,0,0,0,0,0,9,18,95,95,114,101,116,86, +97,108,0,58,109,97,116,51,120,50,0,18,102,0,0,0,20,0,0,1,0,0,27,1,1,1,0,1,98,0,0,0,1,3,2,1,0,9,1, +102,0,2,58,102,108,111,97,116,0,18,98,0,0,0,0,0,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116, +51,120,50,0,18,102,0,0,0,20,0,0,1,0,0,27,1,1,1,0,10,99,48,0,0,1,1,0,10,99,49,0,0,1,1,0,10,99,50,0, +0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,99,48,0,20,0,9,18,95,95,114,101,116,86,97, +108,0,16,10,49,0,57,18,99,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,99,50,0,20, +0,0,1,0,0,30,1,1,1,0,9,102,48,48,0,0,1,1,0,9,102,49,48,0,0,1,1,0,9,102,50,48,0,0,1,1,0,9,102,51,48, +0,0,1,1,0,9,102,48,49,0,0,1,1,0,9,102,49,49,0,0,1,1,0,9,102,50,49,0,0,1,1,0,9,102,51,49,0,0,1,1,0, +9,102,48,50,0,0,1,1,0,9,102,49,50,0,0,1,1,0,9,102,50,50,0,0,1,1,0,9,102,51,50,0,0,0,1,9,18,95,95, +114,101,116,86,97,108,0,16,8,48,0,57,59,120,0,18,102,48,48,0,20,0,9,18,95,95,114,101,116,86,97,108, +0,16,8,48,0,57,59,121,0,18,102,49,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,122, +0,18,102,50,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,119,0,18,102,51,48,0,20,0, +9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,120,0,18,102,48,49,0,20,0,9,18,95,95,114,101, +116,86,97,108,0,16,10,49,0,57,59,121,0,18,102,49,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16, +10,49,0,57,59,122,0,18,102,50,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,119,0, +18,102,51,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,59,120,0,18,102,48,50,0,20,0, +9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,59,121,0,18,102,49,50,0,20,0,9,18,95,95,114,101, +116,86,97,108,0,16,10,50,0,57,59,122,0,18,102,50,50,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16, +10,50,0,57,59,119,0,18,102,51,50,0,20,0,0,1,0,0,30,1,1,1,0,9,102,0,0,0,1,9,18,95,95,114,101,116,86, +97,108,0,58,109,97,116,51,120,52,0,18,102,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0, +17,48,0,48,0,0,0,18,102,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,18, +102,0,0,17,48,0,48,0,0,0,0,20,0,0,1,0,0,30,1,1,1,0,5,105,0,0,0,1,3,2,1,0,9,1,102,0,2,58,102,108, +111,97,116,0,18,105,0,0,0,0,0,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,120,52,0,18,102, +0,0,0,20,0,0,1,0,0,30,1,1,1,0,1,98,0,0,0,1,3,2,1,0,9,1,102,0,2,58,102,108,111,97,116,0,18,98,0,0,0, +0,0,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,120,52,0,18,102,0,0,0,20,0,0,1,0,0,30,1,1, +1,0,12,99,48,0,0,1,1,0,12,99,49,0,0,1,1,0,12,99,50,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8, +48,0,57,18,99,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,99,49,0,20,0,9,18,95, +95,114,101,116,86,97,108,0,16,10,50,0,57,18,99,50,0,20,0,0,1,0,0,29,1,1,1,0,9,102,48,48,0,0,1,1,0, +9,102,49,48,0,0,1,1,0,9,102,48,49,0,0,1,1,0,9,102,49,49,0,0,1,1,0,9,102,48,50,0,0,1,1,0,9,102,49, +50,0,0,1,1,0,9,102,48,51,0,0,1,1,0,9,102,49,51,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48, +0,57,59,120,0,18,102,48,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,121,0,18,102, +49,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,120,0,18,102,48,49,0,20,0,9,18,95, +95,114,101,116,86,97,108,0,16,10,49,0,57,59,121,0,18,102,49,49,0,20,0,9,18,95,95,114,101,116,86,97, +108,0,16,10,50,0,57,59,120,0,18,102,48,50,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57, +59,121,0,18,102,49,50,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,59,120,0,18,102,48, +51,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,59,121,0,18,102,49,51,0,20,0,0,1,0,0,29, +1,1,1,0,9,102,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,120,50,0,18,102,0,0,17, +48,0,48,0,0,0,17,48,0,48,0,0,0,16,10,52,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,17, +48,0,48,0,0,0,0,20,0,0,1,0,0,29,1,1,1,0,5,105,0,0,0,1,3,2,1,0,9,1,102,0,2,58,102,108,111,97,116,0, +18,105,0,0,0,0,0,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,120,50,0,18,102,0,0,0,20,0,0, +1,0,0,29,1,1,1,0,1,98,0,0,0,1,3,2,1,0,9,1,102,0,2,58,102,108,111,97,116,0,18,98,0,0,0,0,0,9,18,95, +95,114,101,116,86,97,108,0,58,109,97,116,52,120,50,0,18,102,0,0,0,20,0,0,1,0,0,29,1,1,1,0,10,99,48, +0,0,1,1,0,10,99,49,0,0,1,1,0,10,99,50,0,0,1,1,0,10,99,51,0,0,0,1,9,18,95,95,114,101,116,86,97,108, +0,16,8,48,0,57,18,99,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,99,49,0,20,0,9, +18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,99,50,0,20,0,9,18,95,95,114,101,116,86,97,108,0, +16,10,51,0,57,18,99,51,0,20,0,0,1,0,0,31,1,1,1,0,9,102,48,48,0,0,1,1,0,9,102,49,48,0,0,1,1,0,9,102, +50,48,0,0,1,1,0,9,102,48,49,0,0,1,1,0,9,102,49,49,0,0,1,1,0,9,102,50,49,0,0,1,1,0,9,102,48,50,0,0, +1,1,0,9,102,49,50,0,0,1,1,0,9,102,50,50,0,0,1,1,0,9,102,48,51,0,0,1,1,0,9,102,49,51,0,0,1,1,0,9, +102,50,51,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,120,0,18,102,48,48,0,20,0,9, +18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,121,0,18,102,49,48,0,20,0,9,18,95,95,114,101,116, +86,97,108,0,16,8,48,0,57,59,122,0,18,102,50,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49, 0,57,59,120,0,18,102,48,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,121,0,18,102, 49,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,122,0,18,102,50,49,0,20,0,9,18,95, -95,114,101,116,86,97,108,0,16,10,49,0,57,59,119,0,18,102,51,49,0,20,0,0,1,0,28,1,1,1,0,9,102,0,0,0, -1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,52,0,18,102,0,0,17,48,0,48,0,0,0,17,48,0, -48,0,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,18,102,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,0,20,0,0,1, -0,28,1,1,1,0,5,105,0,0,0,1,3,2,1,9,1,102,0,2,58,102,108,111,97,116,0,18,105,0,0,0,0,0,9,18,95,95, -114,101,116,86,97,108,0,58,109,97,116,50,120,52,0,18,102,0,0,0,20,0,0,1,0,28,1,1,1,0,1,98,0,0,0,1, -3,2,1,9,1,102,0,2,58,102,108,111,97,116,0,18,98,0,0,0,0,0,9,18,95,95,114,101,116,86,97,108,0,58, -109,97,116,50,120,52,0,18,102,0,0,0,20,0,0,1,0,28,1,1,1,0,12,99,48,0,0,1,1,0,12,99,49,0,0,0,1,9,18, -95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,99,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16, -10,49,0,57,18,99,49,0,20,0,0,1,0,27,1,1,1,0,9,102,48,48,0,0,1,1,0,9,102,49,48,0,0,1,1,0,9,102,48, -49,0,0,1,1,0,9,102,49,49,0,0,1,1,0,9,102,48,50,0,0,1,1,0,9,102,49,50,0,0,0,1,9,18,95,95,114,101, -116,86,97,108,0,16,8,48,0,57,59,120,0,18,102,48,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,8, -48,0,57,59,121,0,18,102,49,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,120,0,18, -102,48,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,121,0,18,102,49,49,0,20,0,9, -18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,59,120,0,18,102,48,50,0,20,0,9,18,95,95,114,101,116, -86,97,108,0,16,10,50,0,57,59,121,0,18,102,49,50,0,20,0,0,1,0,27,1,1,1,0,9,102,0,0,0,1,9,18,95,95, -114,101,116,86,97,108,0,58,109,97,116,51,120,50,0,18,102,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,18, -102,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,0,20,0,0,1,0,27,1,1,1,0,5,105,0,0,0,1,3,2,1,9,1,102,0,2, -58,102,108,111,97,116,0,18,105,0,0,0,0,0,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,120, -50,0,18,102,0,0,0,20,0,0,1,0,27,1,1,1,0,1,98,0,0,0,1,3,2,1,9,1,102,0,2,58,102,108,111,97,116,0,18, -98,0,0,0,0,0,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,120,50,0,18,102,0,0,0,20,0,0,1,0, -27,1,1,1,0,10,99,48,0,0,1,1,0,10,99,49,0,0,1,1,0,10,99,50,0,0,0,1,9,18,95,95,114,101,116,86,97,108, -0,16,8,48,0,57,18,99,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,99,49,0,20,0,9, -18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,99,50,0,20,0,0,1,0,30,1,1,1,0,9,102,48,48,0,0,1, -1,0,9,102,49,48,0,0,1,1,0,9,102,50,48,0,0,1,1,0,9,102,51,48,0,0,1,1,0,9,102,48,49,0,0,1,1,0,9,102, -49,49,0,0,1,1,0,9,102,50,49,0,0,1,1,0,9,102,51,49,0,0,1,1,0,9,102,48,50,0,0,1,1,0,9,102,49,50,0,0, -1,1,0,9,102,50,50,0,0,1,1,0,9,102,51,50,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59, -120,0,18,102,48,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,121,0,18,102,49,48,0, -20,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,122,0,18,102,50,48,0,20,0,9,18,95,95,114, -101,116,86,97,108,0,16,8,48,0,57,59,119,0,18,102,51,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0, -16,10,49,0,57,59,120,0,18,102,48,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,121, -0,18,102,49,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,122,0,18,102,50,49,0,20, -0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,119,0,18,102,51,49,0,20,0,9,18,95,95,114,101, -116,86,97,108,0,16,10,50,0,57,59,120,0,18,102,48,50,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16, -10,50,0,57,59,121,0,18,102,49,50,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,59,122,0, -18,102,50,50,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,59,119,0,18,102,51,50,0,20,0, -0,1,0,30,1,1,1,0,9,102,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,120,52,0,18,102, -0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,18,102,0,0,17,48,0,48,0,0, -0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,18,102,0,0,17,48,0,48,0,0,0,0,20,0,0,1,0,30,1, -1,1,0,5,105,0,0,0,1,3,2,1,9,1,102,0,2,58,102,108,111,97,116,0,18,105,0,0,0,0,0,9,18,95,95,114,101, -116,86,97,108,0,58,109,97,116,51,120,52,0,18,102,0,0,0,20,0,0,1,0,30,1,1,1,0,1,98,0,0,0,1,3,2,1,9, -1,102,0,2,58,102,108,111,97,116,0,18,98,0,0,0,0,0,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116, -51,120,52,0,18,102,0,0,0,20,0,0,1,0,30,1,1,1,0,12,99,48,0,0,1,1,0,12,99,49,0,0,1,1,0,12,99,50,0,0, +95,114,101,116,86,97,108,0,16,10,50,0,57,59,120,0,18,102,48,50,0,20,0,9,18,95,95,114,101,116,86,97, +108,0,16,10,50,0,57,59,121,0,18,102,49,50,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57, +59,122,0,18,102,50,50,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,59,120,0,18,102,48, +51,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,59,121,0,18,102,49,51,0,20,0,9,18,95,95, +114,101,116,86,97,108,0,16,10,51,0,57,59,122,0,18,102,50,51,0,20,0,0,1,0,0,31,1,1,1,0,9,102,0,0,0, +1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,120,51,0,18,102,0,0,17,48,0,48,0,0,0,17,48,0, +48,0,0,0,17,48,0,48,0,0,0,18,102,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,18,102,0,0, +17,48,0,48,0,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,0,20,0,0,1,0,0,31,1,1,1,0,5,105,0,0,0,1,3,2,1,0, +9,1,102,0,2,58,102,108,111,97,116,0,18,105,0,0,0,0,0,9,18,95,95,114,101,116,86,97,108,0,58,109,97, +116,52,120,51,0,18,102,0,0,0,20,0,0,1,0,0,31,1,1,1,0,1,98,0,0,0,1,3,2,1,0,9,1,102,0,2,58,102,108, +111,97,116,0,18,98,0,0,0,0,0,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,120,51,0,18,102,0, +0,0,20,0,0,1,0,0,31,1,1,1,0,11,99,48,0,0,1,1,0,11,99,49,0,0,1,1,0,11,99,50,0,0,1,1,0,11,99,51,0,0, 0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,99,48,0,20,0,9,18,95,95,114,101,116,86,97, 108,0,16,10,49,0,57,18,99,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,99,50,0,20, -0,0,1,0,29,1,1,1,0,9,102,48,48,0,0,1,1,0,9,102,49,48,0,0,1,1,0,9,102,48,49,0,0,1,1,0,9,102,49,49,0, -0,1,1,0,9,102,48,50,0,0,1,1,0,9,102,49,50,0,0,1,1,0,9,102,48,51,0,0,1,1,0,9,102,49,51,0,0,0,1,9,18, -95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,120,0,18,102,48,48,0,20,0,9,18,95,95,114,101,116,86, -97,108,0,16,8,48,0,57,59,121,0,18,102,49,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0, -57,59,120,0,18,102,48,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,121,0,18,102, -49,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,59,120,0,18,102,48,50,0,20,0,9,18,95, -95,114,101,116,86,97,108,0,16,10,50,0,57,59,121,0,18,102,49,50,0,20,0,9,18,95,95,114,101,116,86,97, -108,0,16,10,51,0,57,59,120,0,18,102,48,51,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57, -59,121,0,18,102,49,51,0,20,0,0,1,0,29,1,1,1,0,9,102,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58, -109,97,116,52,120,50,0,18,102,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,16,10,52,0,0,17,48,0,48,0,0,0, -17,48,0,48,0,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,0,20,0,0,1,0,29,1,1,1,0,5,105,0,0,0,1,3,2,1,9,1, -102,0,2,58,102,108,111,97,116,0,18,105,0,0,0,0,0,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116, -52,120,50,0,18,102,0,0,0,20,0,0,1,0,29,1,1,1,0,1,98,0,0,0,1,3,2,1,9,1,102,0,2,58,102,108,111,97, -116,0,18,98,0,0,0,0,0,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,120,50,0,18,102,0,0,0,20, -0,0,1,0,29,1,1,1,0,10,99,48,0,0,1,1,0,10,99,49,0,0,1,1,0,10,99,50,0,0,1,1,0,10,99,51,0,0,0,1,9,18, -95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,99,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16, -10,49,0,57,18,99,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,99,50,0,20,0,9,18, -95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,99,51,0,20,0,0,1,0,31,1,1,1,0,9,102,48,48,0,0,1,1,0, -9,102,49,48,0,0,1,1,0,9,102,50,48,0,0,1,1,0,9,102,48,49,0,0,1,1,0,9,102,49,49,0,0,1,1,0,9,102,50, -49,0,0,1,1,0,9,102,48,50,0,0,1,1,0,9,102,49,50,0,0,1,1,0,9,102,50,50,0,0,1,1,0,9,102,48,51,0,0,1,1, -0,9,102,49,51,0,0,1,1,0,9,102,50,51,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,120, -0,18,102,48,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,121,0,18,102,49,48,0,20,0, -9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,122,0,18,102,50,48,0,20,0,9,18,95,95,114,101, -116,86,97,108,0,16,10,49,0,57,59,120,0,18,102,48,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16, -10,49,0,57,59,121,0,18,102,49,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,122,0, -18,102,50,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,59,120,0,18,102,48,50,0,20,0, -9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,59,121,0,18,102,49,50,0,20,0,9,18,95,95,114,101, -116,86,97,108,0,16,10,50,0,57,59,122,0,18,102,50,50,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16, -10,51,0,57,59,120,0,18,102,48,51,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,59,121,0, -18,102,49,51,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,59,122,0,18,102,50,51,0,20,0, -0,1,0,31,1,1,1,0,9,102,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,120,51,0,18,102, -0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,18,102,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0, -0,17,48,0,48,0,0,0,18,102,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,0,20,0,0,1,0,31,1, -1,1,0,5,105,0,0,0,1,3,2,1,9,1,102,0,2,58,102,108,111,97,116,0,18,105,0,0,0,0,0,9,18,95,95,114,101, -116,86,97,108,0,58,109,97,116,52,120,51,0,18,102,0,0,0,20,0,0,1,0,31,1,1,1,0,1,98,0,0,0,1,3,2,1,9, -1,102,0,2,58,102,108,111,97,116,0,18,98,0,0,0,0,0,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116, -52,120,51,0,18,102,0,0,0,20,0,0,1,0,31,1,1,1,0,11,99,48,0,0,1,1,0,11,99,49,0,0,1,1,0,11,99,50,0,0, -1,1,0,11,99,51,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,99,48,0,20,0,9,18,95,95, -114,101,116,86,97,108,0,16,10,49,0,57,18,99,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50, -0,57,18,99,50,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,99,51,0,20,0,0,1,0,13,1,1, -1,0,13,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,0,13,1,1,1,0,27,109,0,0,0, -1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,0,18,109,0,16,8,48,0,57,0,18,109,0,16,10,49, -0,57,0,0,20,0,0,1,0,13,1,1,1,0,29,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50, -0,18,109,0,16,8,48,0,57,0,18,109,0,16,10,49,0,57,0,0,20,0,0,1,0,13,1,1,1,0,26,109,0,0,0,1,9,18,95, -95,114,101,116,86,97,108,0,58,109,97,116,50,0,18,109,0,16,8,48,0,57,59,120,121,0,0,18,109,0,16,10, -49,0,57,59,120,121,0,0,0,20,0,0,1,0,13,1,1,1,0,28,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, -58,109,97,116,50,0,18,109,0,16,8,48,0,57,59,120,121,0,0,18,109,0,16,10,49,0,57,59,120,121,0,0,0,20, -0,0,1,0,13,1,1,1,0,14,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,0,18,109,0, -16,8,48,0,57,59,120,121,0,0,18,109,0,16,10,49,0,57,59,120,121,0,0,0,20,0,0,1,0,13,1,1,1,0,30,109,0, -0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,0,18,109,0,16,8,48,0,57,59,120,121,0,0, -18,109,0,16,10,49,0,57,59,120,121,0,0,0,20,0,0,1,0,13,1,1,1,0,31,109,0,0,0,1,9,18,95,95,114,101, -116,86,97,108,0,58,109,97,116,50,0,18,109,0,16,8,48,0,57,59,120,121,0,0,18,109,0,16,10,49,0,57,59, -120,121,0,0,0,20,0,0,1,0,13,1,1,1,0,15,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97, -116,50,0,18,109,0,16,8,48,0,57,59,120,121,0,0,18,109,0,16,10,49,0,57,59,120,121,0,0,0,20,0,0,1,0, -26,1,1,1,0,26,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,0,26,1,1,1,0,14,109, +0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,99,51,0,20,0,0,1,0,0,13,1,1,1,0,13,109,0,0,0, +1,9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,0,0,13,1,1,1,0,27,109,0,0,0,1,9,18,95,95, +114,101,116,86,97,108,0,58,109,97,116,50,0,18,109,0,16,8,48,0,57,0,18,109,0,16,10,49,0,57,0,0,20,0, +0,1,0,0,13,1,1,1,0,29,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,0,18,109,0, +16,8,48,0,57,0,18,109,0,16,10,49,0,57,0,0,20,0,0,1,0,0,13,1,1,1,0,26,109,0,0,0,1,9,18,95,95,114, +101,116,86,97,108,0,58,109,97,116,50,0,18,109,0,16,8,48,0,57,59,120,121,0,0,18,109,0,16,10,49,0,57, +59,120,121,0,0,0,20,0,0,1,0,0,13,1,1,1,0,28,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109, +97,116,50,0,18,109,0,16,8,48,0,57,59,120,121,0,0,18,109,0,16,10,49,0,57,59,120,121,0,0,0,20,0,0,1, +0,0,13,1,1,1,0,14,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,0,18,109,0,16,8, +48,0,57,59,120,121,0,0,18,109,0,16,10,49,0,57,59,120,121,0,0,0,20,0,0,1,0,0,13,1,1,1,0,30,109,0,0, +0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,0,18,109,0,16,8,48,0,57,59,120,121,0,0,18, +109,0,16,10,49,0,57,59,120,121,0,0,0,20,0,0,1,0,0,13,1,1,1,0,31,109,0,0,0,1,9,18,95,95,114,101,116, +86,97,108,0,58,109,97,116,50,0,18,109,0,16,8,48,0,57,59,120,121,0,0,18,109,0,16,10,49,0,57,59,120, +121,0,0,0,20,0,0,1,0,0,13,1,1,1,0,15,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116, +50,0,18,109,0,16,8,48,0,57,59,120,121,0,0,18,109,0,16,10,49,0,57,59,120,121,0,0,0,20,0,0,1,0,0,26, +1,1,1,0,26,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,0,0,26,1,1,1,0,14,109, 0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,51,0,18,109,0,16,8,48,0,57,0,18, -109,0,16,10,49,0,57,0,0,20,0,0,1,0,26,1,1,1,0,31,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58, -109,97,116,50,120,51,0,18,109,0,16,8,48,0,57,0,18,109,0,16,10,49,0,57,0,0,20,0,0,1,0,26,1,1,1,0,28, -109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,51,0,18,109,0,16,8,48,0,57,59, -120,121,122,0,0,18,109,0,16,10,49,0,57,59,120,121,122,0,0,0,20,0,0,1,0,26,1,1,1,0,30,109,0,0,0,1,9, +109,0,16,10,49,0,57,0,0,20,0,0,1,0,0,26,1,1,1,0,31,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, +58,109,97,116,50,120,51,0,18,109,0,16,8,48,0,57,0,18,109,0,16,10,49,0,57,0,0,20,0,0,1,0,0,26,1,1,1, +0,28,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,51,0,18,109,0,16,8,48,0, +57,59,120,121,122,0,0,18,109,0,16,10,49,0,57,59,120,121,122,0,0,0,20,0,0,1,0,0,26,1,1,1,0,30,109,0, +0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,51,0,18,109,0,16,8,48,0,57,59,120, +121,122,0,0,18,109,0,16,10,49,0,57,59,120,121,122,0,0,0,20,0,0,1,0,0,26,1,1,1,0,15,109,0,0,0,1,9, 18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,51,0,18,109,0,16,8,48,0,57,59,120,121,122,0, -0,18,109,0,16,10,49,0,57,59,120,121,122,0,0,0,20,0,0,1,0,26,1,1,1,0,15,109,0,0,0,1,9,18,95,95,114, -101,116,86,97,108,0,58,109,97,116,50,120,51,0,18,109,0,16,8,48,0,57,59,120,121,122,0,0,18,109,0,16, -10,49,0,57,59,120,121,122,0,0,0,20,0,0,1,0,26,1,1,1,0,13,109,0,0,0,1,9,18,95,95,114,101,116,86,97, -108,0,58,109,97,116,50,120,51,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0, -17,48,0,48,0,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,121,0,0,17,48,0,48,0, -0,0,0,20,0,0,1,0,26,1,1,1,0,27,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120, +0,18,109,0,16,10,49,0,57,59,120,121,122,0,0,0,20,0,0,1,0,0,26,1,1,1,0,13,109,0,0,0,1,9,18,95,95, +114,101,116,86,97,108,0,58,109,97,116,50,120,51,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,8, +48,0,57,59,121,0,0,17,48,0,48,0,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59, +121,0,0,17,48,0,48,0,0,0,0,20,0,0,1,0,0,26,1,1,1,0,27,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108, +0,58,109,97,116,50,120,51,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,17, +48,0,48,0,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,121,0,0,17,48,0,48,0,0,0, +0,20,0,0,1,0,0,26,1,1,1,0,29,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120, 51,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,17,48,0,48,0,0,0,18,109,0, -16,10,49,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,121,0,0,17,48,0,48,0,0,0,0,20,0,0,1,0,26,1,1,1, -0,29,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,51,0,18,109,0,16,8,48,0, -57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,17,48,0,48,0,0,0,18,109,0,16,10,49,0,57,59,120,0,0, -18,109,0,16,10,49,0,57,59,121,0,0,17,48,0,48,0,0,0,0,20,0,0,1,0,28,1,1,1,0,28,109,0,0,0,1,9,18,95, -95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,0,28,1,1,1,0,30,109,0,0,0,1,9,18,95,95,114,101,116,86, -97,108,0,58,109,97,116,50,120,52,0,18,109,0,16,8,48,0,57,0,18,109,0,16,10,49,0,57,0,0,20,0,0,1,0, -28,1,1,1,0,15,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,52,0,18,109,0,16, -8,48,0,57,0,18,109,0,16,10,49,0,57,0,0,20,0,0,1,0,28,1,1,1,0,26,109,0,0,0,1,9,18,95,95,114,101,116, -86,97,108,0,58,109,97,116,50,120,52,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59, -121,0,0,18,109,0,16,8,48,0,57,59,122,0,0,17,48,0,48,0,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109, -0,16,10,49,0,57,59,121,0,0,18,109,0,16,10,49,0,57,59,122,0,0,17,48,0,48,0,0,0,0,20,0,0,1,0,28,1,1, -1,0,14,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,52,0,18,109,0,16,8,48,0, -57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,18,109,0,16,8,48,0,57,59,122,0,0,17,48,0,48,0,0,0, -18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,121,0,0,18,109,0,16,10,49,0,57,59,122, -0,0,17,48,0,48,0,0,0,0,20,0,0,1,0,28,1,1,1,0,31,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58, -109,97,116,50,120,52,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,18,109,0, -16,8,48,0,57,59,122,0,0,17,48,0,48,0,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16,10,49,0,57, -59,121,0,0,18,109,0,16,10,49,0,57,59,122,0,0,17,48,0,48,0,0,0,0,20,0,0,1,0,28,1,1,1,0,13,109,0,0,0, +16,10,49,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,121,0,0,17,48,0,48,0,0,0,0,20,0,0,1,0,0,28,1,1, +1,0,28,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,0,0,28,1,1,1,0,30,109,0,0, +0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,52,0,18,109,0,16,8,48,0,57,0,18,109,0, +16,10,49,0,57,0,0,20,0,0,1,0,0,28,1,1,1,0,15,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109, +97,116,50,120,52,0,18,109,0,16,8,48,0,57,0,18,109,0,16,10,49,0,57,0,0,20,0,0,1,0,0,28,1,1,1,0,26, +109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,52,0,18,109,0,16,8,48,0,57,59, +120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,18,109,0,16,8,48,0,57,59,122,0,0,17,48,0,48,0,0,0,18,109, +0,16,10,49,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,121,0,0,18,109,0,16,10,49,0,57,59,122,0,0,17, +48,0,48,0,0,0,0,20,0,0,1,0,0,28,1,1,1,0,14,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109, +97,116,50,120,52,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,18,109,0,16,8, +48,0,57,59,122,0,0,17,48,0,48,0,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59, +121,0,0,18,109,0,16,10,49,0,57,59,122,0,0,17,48,0,48,0,0,0,0,20,0,0,1,0,0,28,1,1,1,0,31,109,0,0,0, 1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,52,0,18,109,0,16,8,48,0,57,59,120,0,0,18, -109,0,16,10,49,0,57,59,121,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,18,109,0,16,10,49,0,57,59,120,0,0, -18,109,0,16,10,49,0,57,59,121,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,0,20,0,0,1,0,28,1,1,1,0,27,109, -0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,52,0,18,109,0,16,8,48,0,57,59,120, -0,0,18,109,0,16,8,48,0,57,59,121,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,18,109,0,16,10,49,0,57,59, -120,0,0,18,109,0,16,10,49,0,57,59,121,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,0,20,0,0,1,0,28,1,1,1, -0,29,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,52,0,18,109,0,16,8,48,0, -57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,18,109,0,16,10,49, -0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,121,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,0,20,0,0,1,0, -27,1,1,1,0,27,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,0,27,1,1,1,0,29,109, -0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,120,50,0,18,109,0,16,8,48,0,57,0,18, -109,0,16,10,49,0,57,0,18,109,0,16,10,50,0,57,0,0,20,0,0,1,0,27,1,1,1,0,14,109,0,0,0,1,9,18,95,95, -114,101,116,86,97,108,0,58,109,97,116,51,120,50,0,18,109,0,16,8,48,0,57,0,18,109,0,16,10,49,0,57,0, -18,109,0,16,10,50,0,57,0,0,20,0,0,1,0,27,1,1,1,0,30,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, -58,109,97,116,51,120,50,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,18,109, -0,16,10,49,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,121,0,0,18,109,0,16,10,50,0,57,59,120,0,0,18, -109,0,16,10,50,0,57,59,121,0,0,0,20,0,0,1,0,27,1,1,1,0,31,109,0,0,0,1,9,18,95,95,114,101,116,86,97, -108,0,58,109,97,116,51,120,50,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0, -18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,121,0,0,18,109,0,16,10,50,0,57,59,120, -0,0,18,109,0,16,10,50,0,57,59,121,0,0,0,20,0,0,1,0,27,1,1,1,0,15,109,0,0,0,1,9,18,95,95,114,101, -116,86,97,108,0,58,109,97,116,51,120,50,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,8,48,0,57, -59,121,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,121,0,0,17,48,0,48,0,0,0,17, -48,0,48,0,0,0,0,20,0,0,1,0,27,1,1,1,0,13,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97, -116,51,120,50,0,18,109,0,16,8,48,0,57,0,18,109,0,16,10,49,0,57,0,58,118,101,99,50,0,17,48,0,48,0,0, -0,0,0,0,20,0,0,1,0,27,1,1,1,0,26,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51, -120,50,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,18,109,0,16,10,49,0,57, -59,120,0,0,18,109,0,16,10,49,0,57,59,121,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,0,20,0,0,1,0,27,1,1, -1,0,28,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,120,50,0,18,109,0,16,8,48,0, -57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16,10,49, -0,57,59,121,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,0,20,0,0,1,0,14,1,1,1,0,14,109,0,0,0,1,9,18,95, -95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,0,14,1,1,1,0,31,109,0,0,0,1,9,18,95,95,114,101,116,86, -97,108,0,58,109,97,116,51,0,18,109,0,16,8,48,0,57,0,18,109,0,16,10,49,0,57,0,18,109,0,16,10,50,0, -57,0,0,20,0,0,1,0,14,1,1,1,0,30,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,0, -18,109,0,16,8,48,0,57,59,120,121,122,0,0,18,109,0,16,10,49,0,57,59,120,121,122,0,0,18,109,0,16,10, -50,0,57,59,120,121,122,0,0,0,20,0,0,1,0,14,1,1,1,0,15,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108, -0,58,109,97,116,51,0,18,109,0,16,8,48,0,57,59,120,121,122,0,0,18,109,0,16,10,49,0,57,59,120,121, -122,0,0,18,109,0,16,10,50,0,57,59,120,121,122,0,0,0,20,0,0,1,0,14,1,1,1,0,26,109,0,0,0,1,9,18,95, -95,114,101,116,86,97,108,0,58,109,97,116,51,0,18,109,0,16,8,48,0,57,0,18,109,0,16,10,49,0,57,0,17, -48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,0,20,0,0,1,0,14,1,1,1,0,28,109,0,0,0,1,9,18,95,95,114,101, -116,86,97,108,0,58,109,97,116,51,0,18,109,0,16,8,48,0,57,59,120,121,122,0,0,18,109,0,16,10,49,0,57, -59,120,121,122,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,0,20,0,0,1,0,14,1,1,1,0,27,109,0,0,0, -1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,0,18,109,0,16,8,48,0,57,0,17,48,0,0,0,0,18, -109,0,16,10,49,0,57,0,17,48,0,0,0,0,18,109,0,16,10,50,0,57,0,17,49,0,0,0,0,0,20,0,0,1,0,14,1,1,1,0, -29,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,0,18,109,0,16,8,48,0,57,0,17,48, -0,0,0,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,18,109,0,16,10,50,0,57,0,17,49,0,0,0,0,0,20,0,0,1,0, -14,1,1,1,0,13,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,0,18,109,0,16,8,48,0, -57,0,17,48,0,0,0,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0, -0,0,20,0,0,1,0,30,1,1,1,0,30,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,0,30, -1,1,1,0,15,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,120,52,0,18,109,0,16,8, -48,0,57,0,18,109,0,16,10,49,0,57,0,18,109,0,16,10,50,0,57,0,0,20,0,0,1,0,30,1,1,1,0,14,109,0,0,0,1, -9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,120,52,0,18,109,0,16,8,48,0,57,0,17,48,0,0,0,0, -18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,18,109,0,16,10,50,0,57,0,17,48,0,0,0,0,0,20,0,0,1,0,30,1,1, -1,0,31,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,120,52,0,18,109,0,16,8,48,0, -57,0,17,48,0,0,0,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,18,109,0,16,10,50,0,57,0,17,48,0,0,0,0,0, -20,0,0,1,0,30,1,1,1,0,28,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,120,52,0, -18,109,0,16,8,48,0,57,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,17,48,0, -0,0,0,0,20,0,0,1,0,30,1,1,1,0,26,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51, -120,52,0,18,109,0,16,8,48,0,57,0,17,48,0,0,0,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,17,48,0,0,0, -0,17,48,0,0,0,0,17,49,0,0,0,0,17,48,0,0,0,0,0,20,0,0,1,0,30,1,1,1,0,27,109,0,0,0,1,9,18,95,95,114, -101,116,86,97,108,0,58,109,97,116,51,120,52,0,18,109,0,16,8,48,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0, -18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,18,109,0,16,10,50,0,57,0,17,49,0,0,0,0,17,48, -0,0,0,0,0,20,0,0,1,0,30,1,1,1,0,29,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51, -120,52,0,18,109,0,16,8,48,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0, -0,17,48,0,0,0,0,18,109,0,16,10,50,0,57,0,17,49,0,0,0,0,17,48,0,0,0,0,0,20,0,0,1,0,30,1,1,1,0,13, -109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,120,52,0,18,109,0,16,8,48,0,57,0, -17,48,0,0,0,0,17,48,0,0,0,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17, -48,0,0,0,0,17,49,0,0,0,0,17,48,0,0,0,0,0,20,0,0,1,0,29,1,1,1,0,29,109,0,0,0,1,9,18,95,95,114,101, -116,86,97,108,0,18,109,0,20,0,0,1,0,29,1,1,1,0,31,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, -58,109,97,116,52,120,50,0,18,109,0,16,8,48,0,57,59,120,121,0,0,18,109,0,16,10,49,0,57,59,120,121,0, -0,18,109,0,16,10,50,0,57,59,120,121,0,0,18,109,0,16,10,51,0,57,59,120,121,0,0,0,20,0,0,1,0,29,1,1, -1,0,15,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,120,50,0,18,109,0,16,8,48,0, -57,59,120,121,0,0,18,109,0,16,10,49,0,57,59,120,121,0,0,18,109,0,16,10,50,0,57,59,120,121,0,0,18, -109,0,16,10,51,0,57,59,120,121,0,0,0,20,0,0,1,0,29,1,1,1,0,27,109,0,0,0,1,9,18,95,95,114,101,116, -86,97,108,0,58,109,97,116,52,120,50,0,18,109,0,16,8,48,0,57,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0, -0,17,48,0,0,0,0,0,20,0,0,1,0,29,1,1,1,0,14,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109, -97,116,52,120,50,0,18,109,0,16,8,48,0,57,59,120,121,0,0,18,109,0,16,10,49,0,57,59,120,121,0,0,18, -109,0,16,10,50,0,57,59,120,121,0,0,17,48,0,0,0,0,17,48,0,0,0,0,0,20,0,0,1,0,29,1,1,1,0,30,109,0,0, -0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,120,50,0,18,109,0,16,8,48,0,57,59,120,121, -0,0,18,109,0,16,10,49,0,57,59,120,121,0,0,18,109,0,16,10,50,0,57,59,120,121,0,0,17,48,0,0,0,0,17, -48,0,0,0,0,0,20,0,0,1,0,29,1,1,1,0,13,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116, -52,120,50,0,18,109,0,16,8,48,0,57,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0, -0,0,17,48,0,0,0,0,0,20,0,0,1,0,29,1,1,1,0,26,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109, -97,116,52,120,50,0,18,109,0,16,8,48,0,57,59,120,121,0,0,18,109,0,16,10,49,0,57,59,120,121,0,0,17, -48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,0,20,0,0,1,0,29,1,1,1,0,28,109,0,0,0,1,9,18, -95,95,114,101,116,86,97,108,0,58,109,97,116,52,120,50,0,18,109,0,16,8,48,0,57,59,120,121,0,0,18, -109,0,16,10,49,0,57,59,120,121,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,0,20,0, -0,1,0,31,1,1,1,0,31,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,0,31,1,1,1,0, -15,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,120,51,0,18,109,0,16,8,48,0,57, +109,0,16,8,48,0,57,59,121,0,0,18,109,0,16,8,48,0,57,59,122,0,0,17,48,0,48,0,0,0,18,109,0,16,10,49, +0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,121,0,0,18,109,0,16,10,49,0,57,59,122,0,0,17,48,0,48,0,0, +0,0,20,0,0,1,0,0,28,1,1,1,0,13,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120, +52,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,121,0,0,17,48,0,48,0,0,0,17,48,0, +48,0,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,121,0,0,17,48,0,48,0,0,0,17, +48,0,48,0,0,0,0,20,0,0,1,0,0,28,1,1,1,0,27,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109, +97,116,50,120,52,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,17,48,0,48,0, +0,0,17,48,0,48,0,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,121,0,0,17,48,0, +48,0,0,0,17,48,0,48,0,0,0,0,20,0,0,1,0,0,28,1,1,1,0,29,109,0,0,0,1,9,18,95,95,114,101,116,86,97, +108,0,58,109,97,116,50,120,52,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0, +17,48,0,48,0,0,0,17,48,0,48,0,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,121, +0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,0,20,0,0,1,0,0,27,1,1,1,0,27,109,0,0,0,1,9,18,95,95,114,101, +116,86,97,108,0,18,109,0,20,0,0,1,0,0,27,1,1,1,0,29,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, +58,109,97,116,51,120,50,0,18,109,0,16,8,48,0,57,0,18,109,0,16,10,49,0,57,0,18,109,0,16,10,50,0,57, +0,0,20,0,0,1,0,0,27,1,1,1,0,14,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,120, +50,0,18,109,0,16,8,48,0,57,0,18,109,0,16,10,49,0,57,0,18,109,0,16,10,50,0,57,0,0,20,0,0,1,0,0,27,1, +1,1,0,30,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,120,50,0,18,109,0,16,8,48, +0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16,10, +49,0,57,59,121,0,0,18,109,0,16,10,50,0,57,59,120,0,0,18,109,0,16,10,50,0,57,59,121,0,0,0,20,0,0,1, +0,0,27,1,1,1,0,31,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,120,50,0,18,109, +0,16,8,48,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18, +109,0,16,10,49,0,57,59,121,0,0,18,109,0,16,10,50,0,57,59,120,0,0,18,109,0,16,10,50,0,57,59,121,0,0, +0,20,0,0,1,0,0,27,1,1,1,0,15,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,120, +50,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,18,109,0,16,10,49,0,57,59, +120,0,0,18,109,0,16,10,49,0,57,59,121,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,0,20,0,0,1,0,0,27,1,1, +1,0,13,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,120,50,0,18,109,0,16,8,48,0, +57,0,18,109,0,16,10,49,0,57,0,58,118,101,99,50,0,17,48,0,48,0,0,0,0,0,0,20,0,0,1,0,0,27,1,1,1,0,26, +109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,120,50,0,18,109,0,16,8,48,0,57,59, +120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16,10,49,0,57, +59,121,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,0,20,0,0,1,0,0,27,1,1,1,0,28,109,0,0,0,1,9,18,95,95, +114,101,116,86,97,108,0,58,109,97,116,51,120,50,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,8, +48,0,57,59,121,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,121,0,0,17,48,0,48, +0,0,0,17,48,0,48,0,0,0,0,20,0,0,1,0,0,14,1,1,1,0,14,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, +18,109,0,20,0,0,1,0,0,14,1,1,1,0,31,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116, +51,0,18,109,0,16,8,48,0,57,0,18,109,0,16,10,49,0,57,0,18,109,0,16,10,50,0,57,0,0,20,0,0,1,0,0,14,1, +1,1,0,30,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,0,18,109,0,16,8,48,0,57, 59,120,121,122,0,0,18,109,0,16,10,49,0,57,59,120,121,122,0,0,18,109,0,16,10,50,0,57,59,120,121,122, -0,0,18,109,0,16,10,51,0,57,59,120,121,122,0,0,0,20,0,0,1,0,31,1,1,1,0,14,109,0,0,0,1,9,18,95,95, -114,101,116,86,97,108,0,58,109,97,116,52,120,51,0,18,109,0,16,8,48,0,57,0,18,109,0,16,10,49,0,57,0, -18,109,0,16,10,50,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,0,20,0,0,1,0,31,1,1,1,0,30,109, -0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,120,51,0,18,109,0,16,8,48,0,57,59,120, -121,122,0,0,18,109,0,16,10,49,0,57,59,120,121,122,0,0,18,109,0,16,10,50,0,57,59,120,121,122,0,0,17, -48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,0,20,0,0,1,0,31,1,1,1,0,29,109,0,0,0,1,9,18,95,95,114,101, -116,86,97,108,0,58,109,97,116,52,120,51,0,18,109,0,16,8,48,0,57,0,17,48,0,0,0,0,18,109,0,16,10,49, -0,57,0,17,48,0,0,0,0,18,109,0,16,10,50,0,57,0,17,49,0,0,0,0,18,109,0,16,10,51,0,57,0,17,48,0,0,0,0, -0,20,0,0,1,0,31,1,1,1,0,26,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,120,51, -0,18,109,0,16,8,48,0,57,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,17,48, -0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,0,20,0,0,1,0,31,1,1,1,0,27,109,0,0,0,1,9,18,95,95,114,101,116, -86,97,108,0,58,109,97,116,52,120,51,0,18,109,0,16,8,48,0,57,0,17,48,0,0,0,0,18,109,0,16,10,49,0,57, -0,17,48,0,0,0,0,18,109,0,16,10,50,0,57,0,17,49,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,0, -20,0,0,1,0,31,1,1,1,0,28,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,120,51,0, -18,109,0,16,8,48,0,57,59,120,121,122,0,0,18,109,0,16,10,49,0,57,59,120,121,122,0,0,17,48,0,0,0,0, -17,48,0,0,0,0,17,49,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,0,20,0,0,1,0,31,1,1,1,0,13, +0,0,0,20,0,0,1,0,0,14,1,1,1,0,15,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,0, +18,109,0,16,8,48,0,57,59,120,121,122,0,0,18,109,0,16,10,49,0,57,59,120,121,122,0,0,18,109,0,16,10, +50,0,57,59,120,121,122,0,0,0,20,0,0,1,0,0,14,1,1,1,0,26,109,0,0,0,1,9,18,95,95,114,101,116,86,97, +108,0,58,109,97,116,51,0,18,109,0,16,8,48,0,57,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,17,48,0,0, +0,0,17,49,0,0,0,0,0,20,0,0,1,0,0,14,1,1,1,0,28,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58, +109,97,116,51,0,18,109,0,16,8,48,0,57,59,120,121,122,0,0,18,109,0,16,10,49,0,57,59,120,121,122,0,0, +17,48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,0,20,0,0,1,0,0,14,1,1,1,0,27,109,0,0,0,1,9,18,95,95,114, +101,116,86,97,108,0,58,109,97,116,51,0,18,109,0,16,8,48,0,57,0,17,48,0,0,0,0,18,109,0,16,10,49,0, +57,0,17,48,0,0,0,0,18,109,0,16,10,50,0,57,0,17,49,0,0,0,0,0,20,0,0,1,0,0,14,1,1,1,0,29,109,0,0,0,1, +9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,0,18,109,0,16,8,48,0,57,0,17,48,0,0,0,0,18,109, +0,16,10,49,0,57,0,17,48,0,0,0,0,18,109,0,16,10,50,0,57,0,17,49,0,0,0,0,0,20,0,0,1,0,0,14,1,1,1,0, +13,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,0,18,109,0,16,8,48,0,57,0,17,48, +0,0,0,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,0,20,0,0, +1,0,0,30,1,1,1,0,30,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,0,0,30,1,1,1, +0,15,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,120,52,0,18,109,0,16,8,48,0, +57,0,18,109,0,16,10,49,0,57,0,18,109,0,16,10,50,0,57,0,0,20,0,0,1,0,0,30,1,1,1,0,14,109,0,0,0,1,9, +18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,120,52,0,18,109,0,16,8,48,0,57,0,17,48,0,0,0,0, +18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,18,109,0,16,10,50,0,57,0,17,48,0,0,0,0,0,20,0,0,1,0,0,30,1, +1,1,0,31,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,120,52,0,18,109,0,16,8,48, +0,57,0,17,48,0,0,0,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,18,109,0,16,10,50,0,57,0,17,48,0,0,0,0, +0,20,0,0,1,0,0,30,1,1,1,0,28,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,120, +52,0,18,109,0,16,8,48,0,57,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,17, +48,0,0,0,0,0,20,0,0,1,0,0,30,1,1,1,0,26,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97, +116,51,120,52,0,18,109,0,16,8,48,0,57,0,17,48,0,0,0,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,17,48, +0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,17,48,0,0,0,0,0,20,0,0,1,0,0,30,1,1,1,0,27,109,0,0,0,1,9,18,95, +95,114,101,116,86,97,108,0,58,109,97,116,51,120,52,0,18,109,0,16,8,48,0,57,0,17,48,0,0,0,0,17,48,0, +0,0,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,18,109,0,16,10,50,0,57,0,17,49,0,0,0,0, +17,48,0,0,0,0,0,20,0,0,1,0,0,30,1,1,1,0,29,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109, +97,116,51,120,52,0,18,109,0,16,8,48,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,18,109,0,16,10,49,0,57,0,17, +48,0,0,0,0,17,48,0,0,0,0,18,109,0,16,10,50,0,57,0,17,49,0,0,0,0,17,48,0,0,0,0,0,20,0,0,1,0,0,30,1, +1,1,0,13,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,120,52,0,18,109,0,16,8,48, +0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0, +0,0,17,48,0,0,0,0,17,49,0,0,0,0,17,48,0,0,0,0,0,20,0,0,1,0,0,29,1,1,1,0,29,109,0,0,0,1,9,18,95,95, +114,101,116,86,97,108,0,18,109,0,20,0,0,1,0,0,29,1,1,1,0,31,109,0,0,0,1,9,18,95,95,114,101,116,86, +97,108,0,58,109,97,116,52,120,50,0,18,109,0,16,8,48,0,57,59,120,121,0,0,18,109,0,16,10,49,0,57,59, +120,121,0,0,18,109,0,16,10,50,0,57,59,120,121,0,0,18,109,0,16,10,51,0,57,59,120,121,0,0,0,20,0,0,1, +0,0,29,1,1,1,0,15,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,120,50,0,18,109, +0,16,8,48,0,57,59,120,121,0,0,18,109,0,16,10,49,0,57,59,120,121,0,0,18,109,0,16,10,50,0,57,59,120, +121,0,0,18,109,0,16,10,51,0,57,59,120,121,0,0,0,20,0,0,1,0,0,29,1,1,1,0,27,109,0,0,0,1,9,18,95,95, +114,101,116,86,97,108,0,58,109,97,116,52,120,50,0,18,109,0,16,8,48,0,57,0,18,109,0,16,10,49,0,57,0, +17,48,0,0,0,0,17,48,0,0,0,0,0,20,0,0,1,0,0,29,1,1,1,0,14,109,0,0,0,1,9,18,95,95,114,101,116,86,97, +108,0,58,109,97,116,52,120,50,0,18,109,0,16,8,48,0,57,59,120,121,0,0,18,109,0,16,10,49,0,57,59,120, +121,0,0,18,109,0,16,10,50,0,57,59,120,121,0,0,17,48,0,0,0,0,17,48,0,0,0,0,0,20,0,0,1,0,0,29,1,1,1, +0,30,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,120,50,0,18,109,0,16,8,48,0, +57,59,120,121,0,0,18,109,0,16,10,49,0,57,59,120,121,0,0,18,109,0,16,10,50,0,57,59,120,121,0,0,17, +48,0,0,0,0,17,48,0,0,0,0,0,20,0,0,1,0,0,29,1,1,1,0,13,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108, +0,58,109,97,116,52,120,50,0,18,109,0,16,8,48,0,57,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,17,48,0, +0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,0,20,0,0,1,0,0,29,1,1,1,0,26,109,0,0,0,1,9,18,95,95,114,101,116, +86,97,108,0,58,109,97,116,52,120,50,0,18,109,0,16,8,48,0,57,59,120,121,0,0,18,109,0,16,10,49,0,57, +59,120,121,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,0,20,0,0,1,0,0,29,1,1,1,0, +28,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,120,50,0,18,109,0,16,8,48,0,57, +59,120,121,0,0,18,109,0,16,10,49,0,57,59,120,121,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17, +48,0,0,0,0,0,20,0,0,1,0,0,31,1,1,1,0,31,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,109,0,20, +0,0,1,0,0,31,1,1,1,0,15,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,120,51,0, +18,109,0,16,8,48,0,57,59,120,121,122,0,0,18,109,0,16,10,49,0,57,59,120,121,122,0,0,18,109,0,16,10, +50,0,57,59,120,121,122,0,0,18,109,0,16,10,51,0,57,59,120,121,122,0,0,0,20,0,0,1,0,0,31,1,1,1,0,14, 109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,120,51,0,18,109,0,16,8,48,0,57,0, -17,48,0,0,0,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,17, -48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,0,20,0,0,1,0,15,1,1,1,0,15,109,0,0,0,1,9,18,95,95,114,101, -116,86,97,108,0,18,109,0,20,0,0,1,0,15,1,1,1,0,30,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, -58,109,97,116,52,0,18,109,0,16,8,48,0,57,0,18,109,0,16,10,49,0,57,0,18,109,0,16,10,50,0,57,0,17,48, -0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,0,20,0,0,1,0,15,1,1,1,0,31,109,0,0,0,1,9,18,95, -95,114,101,116,86,97,108,0,58,109,97,116,52,0,18,109,0,16,8,48,0,57,0,17,48,0,0,0,0,18,109,0,16,10, -49,0,57,0,17,48,0,0,0,0,18,109,0,16,10,50,0,57,0,17,48,0,0,0,0,18,109,0,16,10,51,0,57,0,17,49,0,0, -0,0,0,20,0,0,1,0,15,1,1,1,0,28,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,0, -18,109,0,16,8,48,0,57,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,17,48,0, -0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,0,20,0,0,1,0,15,1,1,1,0,29,109,0,0,0, -1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,0,18,109,0,16,8,48,0,57,0,17,48,0,0,0,0,17, -48,0,0,0,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,18,109,0,16,10,50,0,57,0,17,49,0,0, -0,0,17,48,0,0,0,0,18,109,0,16,10,51,0,57,0,17,48,0,0,0,0,17,49,0,0,0,0,0,20,0,0,1,0,15,1,1,1,0,14, -109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,0,18,109,0,16,8,48,0,57,0,17,48,0, -0,0,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,18,109,0,16,10,50,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0, -17,48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,0,20,0,0,1,0,15,1,1,1,0,26,109,0,0,0,1,9,18,95,95,114, -101,116,86,97,108,0,58,109,97,116,52,0,18,109,0,16,8,48,0,57,0,17,48,0,0,0,0,18,109,0,16,10,49,0, -57,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0, -0,0,17,48,0,0,0,0,17,49,0,0,0,0,0,20,0,0,1,0,15,1,1,1,0,27,109,0,0,0,1,9,18,95,95,114,101,116,86, -97,108,0,58,109,97,116,52,0,18,109,0,16,8,48,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,18,109,0,16,10,49, -0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,18,109,0,16,10,50,0,57,0,17,49,0,0,0,0,17,48,0,0,0,0,17,48,0,0, -0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,0,20,0,0,1,0,15,1,1,1,0,13,109,0,0,0,1,9,18,95,95, -114,101,116,86,97,108,0,58,109,97,116,52,0,18,109,0,16,8,48,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,18, -109,0,16,10,49,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,17,48, -0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,0,20,0,0,1,0,0,2,1,1,0,2,26,109,0, -0,1,1,0,26,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,21,0,9,18,109,0,16,10,49,0,57, -18,110,0,16,10,49,0,57,21,0,0,1,0,0,2,1,1,0,2,28,109,0,0,1,1,0,28,110,0,0,0,1,9,18,109,0,16,8,48,0, -57,18,110,0,16,8,48,0,57,21,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,21,0,0,1,0,0,2,1,1,0, -2,27,109,0,0,1,1,0,27,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,21,0,9,18,109,0,16, -10,49,0,57,18,110,0,16,10,49,0,57,21,0,9,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,21,0,0,1,0, -0,2,1,1,0,2,30,109,0,0,1,1,0,30,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,21,0,9, -18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,21,0,9,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57, -21,0,0,1,0,0,2,1,1,0,2,29,109,0,0,1,1,0,29,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0, -57,21,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,21,0,9,18,109,0,16,10,50,0,57,18,110,0,16, -10,50,0,57,21,0,9,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,21,0,0,1,0,0,2,1,1,0,2,31,109,0,0, -1,1,0,31,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,21,0,9,18,109,0,16,10,49,0,57, -18,110,0,16,10,49,0,57,21,0,9,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,21,0,9,18,109,0,16,10, -51,0,57,18,110,0,16,10,51,0,57,21,0,0,1,0,0,2,2,1,0,2,26,109,0,0,1,1,0,26,110,0,0,0,1,9,18,109,0, -16,8,48,0,57,18,110,0,16,8,48,0,57,22,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,22,0,0,1,0, -0,2,2,1,0,2,28,109,0,0,1,1,0,28,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,22,0,9, -18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,22,0,0,1,0,0,2,2,1,0,2,27,109,0,0,1,1,0,27,110,0,0,0, -1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,22,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0, -57,22,0,9,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,22,0,0,1,0,0,2,2,1,0,2,30,109,0,0,1,1,0,30, -110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,22,0,9,18,109,0,16,10,49,0,57,18,110,0, -16,10,49,0,57,22,0,9,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,22,0,0,1,0,0,2,2,1,0,2,29,109,0, -0,1,1,0,29,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,22,0,9,18,109,0,16,10,49,0,57, -18,110,0,16,10,49,0,57,22,0,9,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,22,0,9,18,109,0,16,10, -51,0,57,18,110,0,16,10,51,0,57,22,0,0,1,0,0,2,2,1,0,2,31,109,0,0,1,1,0,31,110,0,0,0,1,9,18,109,0, -16,8,48,0,57,18,110,0,16,8,48,0,57,22,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,22,0,9,18, -109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,22,0,9,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,22, -0,0,1,0,0,2,4,1,0,2,26,109,0,0,1,1,0,26,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57, -24,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,24,0,0,1,0,0,2,4,1,0,2,28,109,0,0,1,1,0,28, -110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,24,0,9,18,109,0,16,10,49,0,57,18,110,0, -16,10,49,0,57,24,0,0,1,0,0,2,4,1,0,2,27,109,0,0,1,1,0,27,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18, -110,0,16,8,48,0,57,24,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,24,0,9,18,109,0,16,10,50,0, -57,18,110,0,16,10,50,0,57,24,0,0,1,0,0,2,4,1,0,2,30,109,0,0,1,1,0,30,110,0,0,0,1,9,18,109,0,16,8, -48,0,57,18,110,0,16,8,48,0,57,24,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,24,0,9,18,109,0, -16,10,50,0,57,18,110,0,16,10,50,0,57,24,0,0,1,0,0,2,4,1,0,2,29,109,0,0,1,1,0,29,110,0,0,0,1,9,18, -109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,24,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,24,0, -9,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,24,0,9,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0, -57,24,0,0,1,0,0,2,4,1,0,2,31,109,0,0,1,1,0,31,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48, +18,109,0,16,10,49,0,57,0,18,109,0,16,10,50,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,0,20,0, +0,1,0,0,31,1,1,1,0,30,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,120,51,0,18, +109,0,16,8,48,0,57,59,120,121,122,0,0,18,109,0,16,10,49,0,57,59,120,121,122,0,0,18,109,0,16,10,50, +0,57,59,120,121,122,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,0,20,0,0,1,0,0,31,1,1,1,0,29,109, +0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,120,51,0,18,109,0,16,8,48,0,57,0,17,48, +0,0,0,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,18,109,0,16,10,50,0,57,0,17,49,0,0,0,0,18,109,0,16, +10,51,0,57,0,17,48,0,0,0,0,0,20,0,0,1,0,0,31,1,1,1,0,26,109,0,0,0,1,9,18,95,95,114,101,116,86,97, +108,0,58,109,97,116,52,120,51,0,18,109,0,16,8,48,0,57,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,17, +48,0,0,0,0,17,49,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,0,20,0,0,1,0,0,31,1,1,1,0,27, +109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,120,51,0,18,109,0,16,8,48,0,57,0, +17,48,0,0,0,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,18,109,0,16,10,50,0,57,0,17,49,0,0,0,0,17,48, +0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,0,20,0,0,1,0,0,31,1,1,1,0,28,109,0,0,0,1,9,18,95,95,114,101, +116,86,97,108,0,58,109,97,116,52,120,51,0,18,109,0,16,8,48,0,57,59,120,121,122,0,0,18,109,0,16,10, +49,0,57,59,120,121,122,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0, +17,48,0,0,0,0,0,20,0,0,1,0,0,31,1,1,1,0,13,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109, +97,116,52,120,51,0,18,109,0,16,8,48,0,57,0,17,48,0,0,0,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,17, +48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,0,20,0,0,1,0,0,15, +1,1,1,0,15,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,0,0,15,1,1,1,0,30,109, +0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,0,18,109,0,16,8,48,0,57,0,18,109,0,16, +10,49,0,57,0,18,109,0,16,10,50,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,0,20, +0,0,1,0,0,15,1,1,1,0,31,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,0,18,109,0, +16,8,48,0,57,0,17,48,0,0,0,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,18,109,0,16,10,50,0,57,0,17,48, +0,0,0,0,18,109,0,16,10,51,0,57,0,17,49,0,0,0,0,0,20,0,0,1,0,0,15,1,1,1,0,28,109,0,0,0,1,9,18,95,95, +114,101,116,86,97,108,0,58,109,97,116,52,0,18,109,0,16,8,48,0,57,0,18,109,0,16,10,49,0,57,0,17,48, +0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,49, +0,0,0,0,0,20,0,0,1,0,0,15,1,1,1,0,29,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116, +52,0,18,109,0,16,8,48,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,17, +48,0,0,0,0,18,109,0,16,10,50,0,57,0,17,49,0,0,0,0,17,48,0,0,0,0,18,109,0,16,10,51,0,57,0,17,48,0,0, +0,0,17,49,0,0,0,0,0,20,0,0,1,0,0,15,1,1,1,0,14,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58, +109,97,116,52,0,18,109,0,16,8,48,0,57,0,17,48,0,0,0,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,18, +109,0,16,10,50,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,0,20,0, +0,1,0,0,15,1,1,1,0,26,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,0,18,109,0, +16,8,48,0,57,0,17,48,0,0,0,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17, +49,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,0,20,0,0,1,0,0,15, +1,1,1,0,27,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,0,18,109,0,16,8,48,0,57, +0,17,48,0,0,0,0,17,48,0,0,0,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,18,109,0,16,10, +50,0,57,0,17,49,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,0,20, +0,0,1,0,0,15,1,1,1,0,13,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,0,18,109,0, +16,8,48,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,17, +48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17, +49,0,0,0,0,0,20,0,0,1,0,0,0,2,1,1,0,2,26,109,0,0,1,1,0,26,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18, +110,0,16,8,48,0,57,21,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,21,0,0,1,0,0,0,2,1,1,0,2, +28,109,0,0,1,1,0,28,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,21,0,9,18,109,0,16, +10,49,0,57,18,110,0,16,10,49,0,57,21,0,0,1,0,0,0,2,1,1,0,2,27,109,0,0,1,1,0,27,110,0,0,0,1,9,18, +109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,21,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,21,0, +9,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,21,0,0,1,0,0,0,2,1,1,0,2,30,109,0,0,1,1,0,30,110,0, +0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,21,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10, +49,0,57,21,0,9,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,21,0,0,1,0,0,0,2,1,1,0,2,29,109,0,0,1, +1,0,29,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,21,0,9,18,109,0,16,10,49,0,57,18, +110,0,16,10,49,0,57,21,0,9,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,21,0,9,18,109,0,16,10,51, +0,57,18,110,0,16,10,51,0,57,21,0,0,1,0,0,0,2,1,1,0,2,31,109,0,0,1,1,0,31,110,0,0,0,1,9,18,109,0,16, +8,48,0,57,18,110,0,16,8,48,0,57,21,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,21,0,9,18,109, +0,16,10,50,0,57,18,110,0,16,10,50,0,57,21,0,9,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,21,0,0, +1,0,0,0,2,2,1,0,2,26,109,0,0,1,1,0,26,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,22, +0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,22,0,0,1,0,0,0,2,2,1,0,2,28,109,0,0,1,1,0,28,110, +0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,22,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10, +49,0,57,22,0,0,1,0,0,0,2,2,1,0,2,27,109,0,0,1,1,0,27,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0, +16,8,48,0,57,22,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,22,0,9,18,109,0,16,10,50,0,57,18, +110,0,16,10,50,0,57,22,0,0,1,0,0,0,2,2,1,0,2,30,109,0,0,1,1,0,30,110,0,0,0,1,9,18,109,0,16,8,48,0, +57,18,110,0,16,8,48,0,57,22,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,22,0,9,18,109,0,16, +10,50,0,57,18,110,0,16,10,50,0,57,22,0,0,1,0,0,0,2,2,1,0,2,29,109,0,0,1,1,0,29,110,0,0,0,1,9,18, +109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,22,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,22,0, +9,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,22,0,9,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0, +57,22,0,0,1,0,0,0,2,2,1,0,2,31,109,0,0,1,1,0,31,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8, +48,0,57,22,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,22,0,9,18,109,0,16,10,50,0,57,18,110, +0,16,10,50,0,57,22,0,9,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,22,0,0,1,0,0,0,2,4,1,0,2,26, +109,0,0,1,1,0,26,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,24,0,9,18,109,0,16,10, +49,0,57,18,110,0,16,10,49,0,57,24,0,0,1,0,0,0,2,4,1,0,2,28,109,0,0,1,1,0,28,110,0,0,0,1,9,18,109,0, +16,8,48,0,57,18,110,0,16,8,48,0,57,24,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,24,0,0,1,0, +0,0,2,4,1,0,2,27,109,0,0,1,1,0,27,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,24,0,9, +18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,24,0,9,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57, +24,0,0,1,0,0,0,2,4,1,0,2,30,109,0,0,1,1,0,30,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48, 0,57,24,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,24,0,9,18,109,0,16,10,50,0,57,18,110,0, -16,10,50,0,57,24,0,9,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,24,0,0,1,0,11,2,21,1,1,0,26,109, -0,0,1,1,0,10,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18,118,0,59,120,0,18,109,0,16, -8,48,0,57,59,120,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,120,0,48,46,20,0,9,18,95,95,114, -101,116,86,97,108,0,59,121,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,121,0,48,18,118,0,59,121,0, -18,109,0,16,10,49,0,57,59,121,0,48,46,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,18,118,0,59, -120,0,18,109,0,16,8,48,0,57,59,122,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,122,0,48,46,20, -0,0,1,0,12,2,21,1,1,0,28,109,0,0,1,1,0,10,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0, -18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,120,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59, -120,0,48,46,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,18,118,0,59,120,0,18,109,0,16,8,48,0, -57,59,121,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,121,0,48,46,20,0,9,18,95,95,114,101,116, -86,97,108,0,59,122,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,122,0,48,18,118,0,59,121,0,18,109, -0,16,10,49,0,57,59,122,0,48,46,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,18,118,0,59,120,0, -18,109,0,16,8,48,0,57,59,119,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,119,0,48,46,20,0,0,1, -0,10,2,21,1,1,0,27,109,0,0,1,1,0,11,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18,118, -0,59,120,0,18,109,0,16,8,48,0,57,59,120,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,120,0,48, -46,18,118,0,59,122,0,18,109,0,16,10,50,0,57,59,120,0,48,46,20,0,9,18,95,95,114,101,116,86,97,108,0, +16,10,50,0,57,24,0,0,1,0,0,0,2,4,1,0,2,29,109,0,0,1,1,0,29,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18, +110,0,16,8,48,0,57,24,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,24,0,9,18,109,0,16,10,50,0, +57,18,110,0,16,10,50,0,57,24,0,9,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,24,0,0,1,0,0,0,2,4, +1,0,2,31,109,0,0,1,1,0,31,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,24,0,9,18,109, +0,16,10,49,0,57,18,110,0,16,10,49,0,57,24,0,9,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,24,0,9, +18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,24,0,0,1,0,0,11,2,21,1,1,0,26,109,0,0,1,1,0,10,118,0, +0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,120,0, +48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,120,0,48,46,20,0,9,18,95,95,114,101,116,86,97,108,0, 59,121,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,121,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0, -57,59,121,0,48,46,18,118,0,59,122,0,18,109,0,16,10,50,0,57,59,121,0,48,46,20,0,0,1,0,12,2,21,1,1,0, -30,109,0,0,1,1,0,11,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18,118,0,59,120,0,18, +57,59,121,0,48,46,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,18,118,0,59,120,0,18,109,0,16,8, +48,0,57,59,122,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,122,0,48,46,20,0,0,1,0,0,12,2,21,1, +1,0,28,109,0,0,1,1,0,10,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18,118,0,59,120,0, +18,109,0,16,8,48,0,57,59,120,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,120,0,48,46,20,0,9, +18,95,95,114,101,116,86,97,108,0,59,121,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,121,0,48,18, +118,0,59,121,0,18,109,0,16,10,49,0,57,59,121,0,48,46,20,0,9,18,95,95,114,101,116,86,97,108,0,59, +122,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,122,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57, +59,122,0,48,46,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,18,118,0,59,120,0,18,109,0,16,8,48, +0,57,59,119,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,119,0,48,46,20,0,0,1,0,0,10,2,21,1,1, +0,27,109,0,0,1,1,0,11,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18,118,0,59,120,0,18, 109,0,16,8,48,0,57,59,120,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,120,0,48,46,18,118,0,59, 122,0,18,109,0,16,10,50,0,57,59,120,0,48,46,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,18, 118,0,59,120,0,18,109,0,16,8,48,0,57,59,121,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,121,0, -48,46,18,118,0,59,122,0,18,109,0,16,10,50,0,57,59,121,0,48,46,20,0,9,18,95,95,114,101,116,86,97, -108,0,59,122,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,122,0,48,18,118,0,59,121,0,18,109,0,16, -10,49,0,57,59,122,0,48,46,18,118,0,59,122,0,18,109,0,16,10,50,0,57,59,122,0,48,46,20,0,9,18,95,95, -114,101,116,86,97,108,0,59,119,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,119,0,48,18,118,0,59, -121,0,18,109,0,16,10,49,0,57,59,119,0,48,46,18,118,0,59,122,0,18,109,0,16,10,50,0,57,59,119,0,48, -46,20,0,0,1,0,10,2,21,1,1,0,29,109,0,0,1,1,0,12,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59, -120,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,120,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57, -59,120,0,48,46,18,118,0,59,122,0,18,109,0,16,10,50,0,57,59,120,0,48,46,18,118,0,59,119,0,18,109,0, -16,10,51,0,57,59,120,0,48,46,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,18,118,0,59,120,0,18, -109,0,16,8,48,0,57,59,121,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,121,0,48,46,18,118,0,59, -122,0,18,109,0,16,10,50,0,57,59,121,0,48,46,18,118,0,59,119,0,18,109,0,16,10,51,0,57,59,121,0,48, -46,20,0,0,1,0,11,2,21,1,1,0,31,109,0,0,1,1,0,12,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59, -120,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,120,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57, -59,120,0,48,46,18,118,0,59,122,0,18,109,0,16,10,50,0,57,59,120,0,48,46,18,118,0,59,119,0,18,109,0, -16,10,51,0,57,59,120,0,48,46,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,18,118,0,59,120,0,18, -109,0,16,8,48,0,57,59,121,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,121,0,48,46,18,118,0,59, -122,0,18,109,0,16,10,50,0,57,59,121,0,48,46,18,118,0,59,119,0,18,109,0,16,10,51,0,57,59,121,0,48, -46,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,122, -0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,122,0,48,46,18,118,0,59,122,0,18,109,0,16,10,50,0, -57,59,122,0,48,46,18,118,0,59,119,0,18,109,0,16,10,51,0,57,59,122,0,48,46,20,0,0,1,0,27,2,21,1,1,0, -13,109,0,0,1,1,0,27,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,18,110,0, -16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,18,110,0,16,10,49,0, -57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,18,110,0,16,10,50,0,57,48,20, -0,0,1,0,29,2,21,1,1,0,13,109,0,0,1,1,0,29,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0, +48,46,18,118,0,59,122,0,18,109,0,16,10,50,0,57,59,121,0,48,46,20,0,0,1,0,0,12,2,21,1,1,0,30,109,0, +0,1,1,0,11,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18,118,0,59,120,0,18,109,0,16,8, +48,0,57,59,120,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,120,0,48,46,18,118,0,59,122,0,18, +109,0,16,10,50,0,57,59,120,0,48,46,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,18,118,0,59, +120,0,18,109,0,16,8,48,0,57,59,121,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,121,0,48,46,18, +118,0,59,122,0,18,109,0,16,10,50,0,57,59,121,0,48,46,20,0,9,18,95,95,114,101,116,86,97,108,0,59, +122,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,122,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57, +59,122,0,48,46,18,118,0,59,122,0,18,109,0,16,10,50,0,57,59,122,0,48,46,20,0,9,18,95,95,114,101,116, +86,97,108,0,59,119,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,119,0,48,18,118,0,59,121,0,18,109, +0,16,10,49,0,57,59,119,0,48,46,18,118,0,59,122,0,18,109,0,16,10,50,0,57,59,119,0,48,46,20,0,0,1,0, +0,10,2,21,1,1,0,29,109,0,0,1,1,0,12,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18,118, +0,59,120,0,18,109,0,16,8,48,0,57,59,120,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,120,0,48, +46,18,118,0,59,122,0,18,109,0,16,10,50,0,57,59,120,0,48,46,18,118,0,59,119,0,18,109,0,16,10,51,0, +57,59,120,0,48,46,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,18,118,0,59,120,0,18,109,0,16,8, +48,0,57,59,121,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,121,0,48,46,18,118,0,59,122,0,18, +109,0,16,10,50,0,57,59,121,0,48,46,18,118,0,59,119,0,18,109,0,16,10,51,0,57,59,121,0,48,46,20,0,0, +1,0,0,11,2,21,1,1,0,31,109,0,0,1,1,0,12,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18, +118,0,59,120,0,18,109,0,16,8,48,0,57,59,120,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,120,0, +48,46,18,118,0,59,122,0,18,109,0,16,10,50,0,57,59,120,0,48,46,18,118,0,59,119,0,18,109,0,16,10,51, +0,57,59,120,0,48,46,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,18,118,0,59,120,0,18,109,0,16, +8,48,0,57,59,121,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,121,0,48,46,18,118,0,59,122,0,18, +109,0,16,10,50,0,57,59,121,0,48,46,18,118,0,59,119,0,18,109,0,16,10,51,0,57,59,121,0,48,46,20,0,9, +18,95,95,114,101,116,86,97,108,0,59,122,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,122,0,48,18, +118,0,59,121,0,18,109,0,16,10,49,0,57,59,122,0,48,46,18,118,0,59,122,0,18,109,0,16,10,50,0,57,59, +122,0,48,46,18,118,0,59,119,0,18,109,0,16,10,51,0,57,59,122,0,48,46,20,0,0,1,0,0,27,2,21,1,1,0,13, +109,0,0,1,1,0,27,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,18,110,0,16, +8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,18,110,0,16,10,49,0,57, +48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,18,110,0,16,10,50,0,57,48,20,0,0, +1,0,0,29,2,21,1,1,0,13,109,0,0,1,1,0,29,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0, 57,18,109,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109, 0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,18,110, 0,16,10,50,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,109,0,18,110,0,16,10, -51,0,57,48,20,0,0,1,0,26,2,21,1,1,0,26,109,0,0,1,1,0,13,110,0,0,0,1,9,18,95,95,114,101,116,86,97, +51,0,57,48,20,0,0,1,0,0,26,2,21,1,1,0,26,109,0,0,1,1,0,13,110,0,0,0,1,9,18,95,95,114,101,116,86,97, 108,0,16,8,48,0,57,18,109,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10, -49,0,57,18,109,0,18,110,0,16,10,49,0,57,48,20,0,0,1,0,14,2,21,1,1,0,26,109,0,0,1,1,0,27,110,0,0,0, -1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95, +49,0,57,18,109,0,18,110,0,16,10,49,0,57,48,20,0,0,1,0,0,14,2,21,1,1,0,26,109,0,0,1,1,0,27,110,0,0, +0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95, 95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114, -101,116,86,97,108,0,16,10,50,0,57,18,109,0,18,110,0,16,10,50,0,57,48,20,0,0,1,0,31,2,21,1,1,0,26, +101,116,86,97,108,0,16,10,50,0,57,18,109,0,18,110,0,16,10,50,0,57,48,20,0,0,1,0,0,31,2,21,1,1,0,26, 109,0,0,1,1,0,29,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,18,110,0,16, 8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,18,110,0,16,10,49,0,57, 48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,18,110,0,16,10,50,0,57,48,20,0,9, -18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,109,0,18,110,0,16,10,51,0,57,48,20,0,0,1,0,28,2, -21,1,1,0,28,109,0,0,1,1,0,13,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0, -18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,18,110,0, -16,10,49,0,57,48,20,0,0,1,0,30,2,21,1,1,0,28,109,0,0,1,1,0,27,110,0,0,0,1,9,18,95,95,114,101,116, +18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,109,0,18,110,0,16,10,51,0,57,48,20,0,0,1,0,0,28, +2,21,1,1,0,28,109,0,0,1,1,0,13,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109, +0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,18,110,0, +16,10,49,0,57,48,20,0,0,1,0,0,30,2,21,1,1,0,28,109,0,0,1,1,0,27,110,0,0,0,1,9,18,95,95,114,101,116, 86,97,108,0,16,8,48,0,57,18,109,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0, 16,10,49,0,57,18,109,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50, -0,57,18,109,0,18,110,0,16,10,50,0,57,48,20,0,0,1,0,15,2,21,1,1,0,28,109,0,0,1,1,0,29,110,0,0,0,1,9, -18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95, +0,57,18,109,0,18,110,0,16,10,50,0,57,48,20,0,0,1,0,0,15,2,21,1,1,0,28,109,0,0,1,1,0,29,110,0,0,0,1, +9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95, 114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101, 116,86,97,108,0,16,10,50,0,57,18,109,0,18,110,0,16,10,50,0,57,48,20,0,9,18,95,95,114,101,116,86,97, -108,0,16,10,51,0,57,18,109,0,18,110,0,16,10,51,0,57,48,20,0,0,1,0,13,2,21,1,1,0,27,109,0,0,1,1,0, +108,0,16,10,51,0,57,18,109,0,18,110,0,16,10,51,0,57,48,20,0,0,1,0,0,13,2,21,1,1,0,27,109,0,0,1,1,0, 26,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,18,110,0,16,8,48,0,57,48, 20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,18,110,0,16,10,49,0,57,48,20,0,0,1, -0,27,2,21,1,1,0,27,109,0,0,1,1,0,14,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18, -109,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,18, -110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,18,110,0,16, -10,50,0,57,48,20,0,0,1,0,29,2,21,1,1,0,27,109,0,0,1,1,0,31,110,0,0,0,1,9,18,95,95,114,101,116,86, -97,108,0,16,8,48,0,57,18,109,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16, -10,49,0,57,18,109,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0, -57,18,109,0,18,110,0,16,10,50,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,109, -0,18,110,0,16,10,51,0,57,48,20,0,0,1,0,26,2,21,1,1,0,14,109,0,0,1,1,0,26,110,0,0,0,1,9,18,95,95, -114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116, -86,97,108,0,16,10,49,0,57,18,109,0,18,110,0,16,10,49,0,57,48,20,0,0,1,0,31,2,21,1,1,0,14,109,0,0,1, -1,0,31,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,18,110,0,16,8,48,0,57, -48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,18,110,0,16,10,49,0,57,48,20,0,9, -18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,18,110,0,16,10,50,0,57,48,20,0,9,18,95,95, -114,101,116,86,97,108,0,16,10,51,0,57,18,109,0,18,110,0,16,10,51,0,57,48,20,0,0,1,0,28,2,21,1,1,0, -30,109,0,0,1,1,0,26,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,18,110,0, -16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,18,110,0,16,10,49,0, -57,48,20,0,0,1,0,30,2,21,1,1,0,30,109,0,0,1,1,0,14,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, -16,8,48,0,57,18,109,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0, -57,18,109,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109, -0,18,110,0,16,10,50,0,57,48,20,0,0,1,0,15,2,21,1,1,0,30,109,0,0,1,1,0,31,110,0,0,0,1,9,18,95,95, -114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116, -86,97,108,0,16,10,49,0,57,18,109,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108, -0,16,10,50,0,57,18,109,0,18,110,0,16,10,50,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10, -51,0,57,18,109,0,18,110,0,16,10,51,0,57,48,20,0,0,1,0,13,2,21,1,1,0,29,109,0,0,1,1,0,28,110,0,0,0, -1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95, -95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,18,110,0,16,10,49,0,57,48,20,0,0,1,0,27,2,21,1,1, -0,29,109,0,0,1,1,0,30,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,18,110, -0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,18,110,0,16,10,49, -0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,18,110,0,16,10,50,0,57,48, -20,0,0,1,0,29,2,21,1,1,0,29,109,0,0,1,1,0,15,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8, -48,0,57,18,109,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18, -109,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,18, -110,0,16,10,50,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,109,0,18,110,0,16, -10,51,0,57,48,20,0,0,1,0,26,2,21,1,1,0,31,109,0,0,1,1,0,28,110,0,0,0,1,9,18,95,95,114,101,116,86, -97,108,0,16,8,48,0,57,18,109,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16, -10,49,0,57,18,109,0,18,110,0,16,10,49,0,57,48,20,0,0,1,0,14,2,21,1,1,0,31,109,0,0,1,1,0,30,110,0,0, -0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95, -95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114, -101,116,86,97,108,0,16,10,50,0,57,18,109,0,18,110,0,16,10,50,0,57,48,20,0,0,1,0,31,2,21,1,1,0,31, -109,0,0,1,1,0,15,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,18,110,0,16, -8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,18,110,0,16,10,49,0,57, -48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,18,110,0,16,10,50,0,57,48,20,0,9, -18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,109,0,18,110,0,16,10,51,0,57,48,20,0,0,1,0,28,2, -21,1,1,0,15,109,0,0,1,1,0,28,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0, +0,0,27,2,21,1,1,0,27,109,0,0,1,1,0,14,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57, +18,109,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0, +18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,18,110,0, +16,10,50,0,57,48,20,0,0,1,0,0,29,2,21,1,1,0,27,109,0,0,1,1,0,31,110,0,0,0,1,9,18,95,95,114,101,116, +86,97,108,0,16,8,48,0,57,18,109,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0, +16,10,49,0,57,18,109,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50, +0,57,18,109,0,18,110,0,16,10,50,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18, +109,0,18,110,0,16,10,51,0,57,48,20,0,0,1,0,0,26,2,21,1,1,0,14,109,0,0,1,1,0,26,110,0,0,0,1,9,18,95, +95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101, +116,86,97,108,0,16,10,49,0,57,18,109,0,18,110,0,16,10,49,0,57,48,20,0,0,1,0,0,31,2,21,1,1,0,14,109, +0,0,1,1,0,31,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,18,110,0,16,8,48, +0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,18,110,0,16,10,49,0,57,48, +20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,18,110,0,16,10,50,0,57,48,20,0,9,18, +95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,109,0,18,110,0,16,10,51,0,57,48,20,0,0,1,0,0,28,2, +21,1,1,0,30,109,0,0,1,1,0,26,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0, 18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,18,110,0, -16,10,49,0,57,48,20,0,0,1,0,30,2,21,1,1,0,15,109,0,0,1,1,0,30,110,0,0,0,1,9,18,95,95,114,101,116, +16,10,49,0,57,48,20,0,0,1,0,0,30,2,21,1,1,0,30,109,0,0,1,1,0,14,110,0,0,0,1,9,18,95,95,114,101,116, 86,97,108,0,16,8,48,0,57,18,109,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0, 16,10,49,0,57,18,109,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50, -0,57,18,109,0,18,110,0,16,10,50,0,57,48,20,0,0,1,0,0,2,3,1,0,2,26,109,0,0,1,1,0,13,110,0,0,0,1,9, -18,109,0,18,109,0,18,110,0,48,20,0,0,1,0,0,2,3,1,0,2,28,109,0,0,1,1,0,13,110,0,0,0,1,9,18,109,0,18, -109,0,18,110,0,48,20,0,0,1,0,0,2,3,1,0,2,27,109,0,0,1,1,0,14,110,0,0,0,1,9,18,109,0,18,109,0,18, -110,0,48,20,0,0,1,0,0,2,3,1,0,2,30,109,0,0,1,1,0,14,110,0,0,0,1,9,18,109,0,18,109,0,18,110,0,48,20, -0,0,1,0,0,2,3,1,0,2,29,109,0,0,1,1,0,15,110,0,0,0,1,9,18,109,0,18,109,0,18,110,0,48,20,0,0,1,0,0,2, -3,1,0,2,31,109,0,0,1,1,0,15,110,0,0,0,1,9,18,109,0,18,109,0,18,110,0,48,20,0,0,1,0,11,2,21,1,1,0, -10,118,0,0,1,1,0,27,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,100,111,116,0,18, +0,57,18,109,0,18,110,0,16,10,50,0,57,48,20,0,0,1,0,0,15,2,21,1,1,0,30,109,0,0,1,1,0,31,110,0,0,0,1, +9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95, +114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101, +116,86,97,108,0,16,10,50,0,57,18,109,0,18,110,0,16,10,50,0,57,48,20,0,9,18,95,95,114,101,116,86,97, +108,0,16,10,51,0,57,18,109,0,18,110,0,16,10,51,0,57,48,20,0,0,1,0,0,13,2,21,1,1,0,29,109,0,0,1,1,0, +28,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,18,110,0,16,8,48,0,57,48, +20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,18,110,0,16,10,49,0,57,48,20,0,0,1, +0,0,27,2,21,1,1,0,29,109,0,0,1,1,0,30,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57, +18,109,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0, +18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,18,110,0, +16,10,50,0,57,48,20,0,0,1,0,0,29,2,21,1,1,0,29,109,0,0,1,1,0,15,110,0,0,0,1,9,18,95,95,114,101,116, +86,97,108,0,16,8,48,0,57,18,109,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0, +16,10,49,0,57,18,109,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50, +0,57,18,109,0,18,110,0,16,10,50,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18, +109,0,18,110,0,16,10,51,0,57,48,20,0,0,1,0,0,26,2,21,1,1,0,31,109,0,0,1,1,0,28,110,0,0,0,1,9,18,95, +95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101, +116,86,97,108,0,16,10,49,0,57,18,109,0,18,110,0,16,10,49,0,57,48,20,0,0,1,0,0,14,2,21,1,1,0,31,109, +0,0,1,1,0,30,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,18,110,0,16,8,48, +0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,18,110,0,16,10,49,0,57,48, +20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,18,110,0,16,10,50,0,57,48,20,0,0,1, +0,0,31,2,21,1,1,0,31,109,0,0,1,1,0,15,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57, +18,109,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0, +18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,18,110,0, +16,10,50,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,109,0,18,110,0,16,10,51, +0,57,48,20,0,0,1,0,0,28,2,21,1,1,0,15,109,0,0,1,1,0,28,110,0,0,0,1,9,18,95,95,114,101,116,86,97, +108,0,16,8,48,0,57,18,109,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10, +49,0,57,18,109,0,18,110,0,16,10,49,0,57,48,20,0,0,1,0,0,30,2,21,1,1,0,15,109,0,0,1,1,0,30,110,0,0, +0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95, +95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114, +101,116,86,97,108,0,16,10,50,0,57,18,109,0,18,110,0,16,10,50,0,57,48,20,0,0,1,0,0,0,2,3,1,0,2,26, +109,0,0,1,1,0,13,110,0,0,0,1,9,18,109,0,18,109,0,18,110,0,48,20,0,0,1,0,0,0,2,3,1,0,2,28,109,0,0,1, +1,0,13,110,0,0,0,1,9,18,109,0,18,109,0,18,110,0,48,20,0,0,1,0,0,0,2,3,1,0,2,27,109,0,0,1,1,0,14, +110,0,0,0,1,9,18,109,0,18,109,0,18,110,0,48,20,0,0,1,0,0,0,2,3,1,0,2,30,109,0,0,1,1,0,14,110,0,0,0, +1,9,18,109,0,18,109,0,18,110,0,48,20,0,0,1,0,0,0,2,3,1,0,2,29,109,0,0,1,1,0,15,110,0,0,0,1,9,18, +109,0,18,109,0,18,110,0,48,20,0,0,1,0,0,0,2,3,1,0,2,31,109,0,0,1,1,0,15,110,0,0,0,1,9,18,109,0,18, +109,0,18,110,0,48,20,0,0,1,0,0,11,2,21,1,1,0,10,118,0,0,1,1,0,27,109,0,0,0,1,9,18,95,95,114,101, +116,86,97,108,0,59,120,0,58,100,111,116,0,18,118,0,0,18,109,0,16,8,48,0,57,0,0,20,0,9,18,95,95,114, +101,116,86,97,108,0,59,121,0,58,100,111,116,0,18,118,0,0,18,109,0,16,10,49,0,57,0,0,20,0,9,18,95, +95,114,101,116,86,97,108,0,59,122,0,58,100,111,116,0,18,118,0,0,18,109,0,16,10,50,0,57,0,0,20,0,0, +1,0,0,12,2,21,1,1,0,10,118,0,0,1,1,0,29,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58, +100,111,116,0,18,118,0,0,18,109,0,16,8,48,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121, +0,58,100,111,116,0,18,118,0,0,18,109,0,16,10,49,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0, +59,122,0,58,100,111,116,0,18,118,0,0,18,109,0,16,10,50,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97, +108,0,59,119,0,58,100,111,116,0,18,118,0,0,18,109,0,16,10,51,0,57,0,0,20,0,0,1,0,0,10,2,21,1,1,0, +11,118,0,0,1,1,0,26,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,100,111,116,0,18, 118,0,0,18,109,0,16,8,48,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,100,111,116, -0,18,118,0,0,18,109,0,16,10,49,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,100, -111,116,0,18,118,0,0,18,109,0,16,10,50,0,57,0,0,20,0,0,1,0,12,2,21,1,1,0,10,118,0,0,1,1,0,29,109,0, -0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,100,111,116,0,18,118,0,0,18,109,0,16,8,48,0, -57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,100,111,116,0,18,118,0,0,18,109,0,16,10, -49,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,100,111,116,0,18,118,0,0,18,109,0, -16,10,50,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,100,111,116,0,18,118,0,0,18, -109,0,16,10,51,0,57,0,0,20,0,0,1,0,10,2,21,1,1,0,11,118,0,0,1,1,0,26,109,0,0,0,1,9,18,95,95,114, -101,116,86,97,108,0,59,120,0,58,100,111,116,0,18,118,0,0,18,109,0,16,8,48,0,57,0,0,20,0,9,18,95,95, -114,101,116,86,97,108,0,59,121,0,58,100,111,116,0,18,118,0,0,18,109,0,16,10,49,0,57,0,0,20,0,0,1,0, -12,2,21,1,1,0,11,118,0,0,1,1,0,31,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,100, +0,18,118,0,0,18,109,0,16,10,49,0,57,0,0,20,0,0,1,0,0,12,2,21,1,1,0,11,118,0,0,1,1,0,31,109,0,0,0,1, +9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,100,111,116,0,18,118,0,0,18,109,0,16,8,48,0,57,0,0, +20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,100,111,116,0,18,118,0,0,18,109,0,16,10,49,0, +57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,100,111,116,0,18,118,0,0,18,109,0,16,10, +50,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,100,111,116,0,18,118,0,0,18,109,0, +16,10,51,0,57,0,0,20,0,0,1,0,0,10,2,21,1,1,0,12,118,0,0,1,1,0,28,109,0,0,0,1,9,18,95,95,114,101, +116,86,97,108,0,59,120,0,58,100,111,116,0,18,118,0,0,18,109,0,16,8,48,0,57,0,0,20,0,9,18,95,95,114, +101,116,86,97,108,0,59,121,0,58,100,111,116,0,18,118,0,0,18,109,0,16,10,49,0,57,0,0,20,0,0,1,0,0, +11,2,21,1,1,0,12,118,0,0,1,1,0,30,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,100, 111,116,0,18,118,0,0,18,109,0,16,8,48,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58, 100,111,116,0,18,118,0,0,18,109,0,16,10,49,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122, -0,58,100,111,116,0,18,118,0,0,18,109,0,16,10,50,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0, -59,119,0,58,100,111,116,0,18,118,0,0,18,109,0,16,10,51,0,57,0,0,20,0,0,1,0,10,2,21,1,1,0,12,118,0, -0,1,1,0,28,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,100,111,116,0,18,118,0,0,18, -109,0,16,8,48,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,100,111,116,0,18,118,0, -0,18,109,0,16,10,49,0,57,0,0,20,0,0,1,0,11,2,21,1,1,0,12,118,0,0,1,1,0,30,109,0,0,0,1,9,18,95,95, -114,101,116,86,97,108,0,59,120,0,58,100,111,116,0,18,118,0,0,18,109,0,16,8,48,0,57,0,0,20,0,9,18, -95,95,114,101,116,86,97,108,0,59,121,0,58,100,111,116,0,18,118,0,0,18,109,0,16,10,49,0,57,0,0,20,0, -9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,100,111,116,0,18,118,0,0,18,109,0,16,10,50,0,57,0,0, -20,0,0,1,0,0,2,1,1,0,2,26,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,21,0,9,18,109, -0,16,10,49,0,57,18,97,0,21,0,0,1,0,0,2,1,1,0,2,28,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0, -57,18,97,0,21,0,9,18,109,0,16,10,49,0,57,18,97,0,21,0,0,1,0,0,2,1,1,0,2,27,109,0,0,1,1,0,9,97,0,0, -0,1,9,18,109,0,16,8,48,0,57,18,97,0,21,0,9,18,109,0,16,10,49,0,57,18,97,0,21,0,9,18,109,0,16,10,50, -0,57,18,97,0,21,0,0,1,0,0,2,1,1,0,2,30,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0, -21,0,9,18,109,0,16,10,49,0,57,18,97,0,21,0,9,18,109,0,16,10,50,0,57,18,97,0,21,0,0,1,0,0,2,1,1,0,2, -29,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,21,0,9,18,109,0,16,10,49,0,57,18,97, -0,21,0,9,18,109,0,16,10,50,0,57,18,97,0,21,0,9,18,109,0,16,10,51,0,57,18,97,0,21,0,0,1,0,0,2,1,1,0, -2,31,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,21,0,9,18,109,0,16,10,49,0,57,18, -97,0,21,0,9,18,109,0,16,10,50,0,57,18,97,0,21,0,9,18,109,0,16,10,51,0,57,18,97,0,21,0,0,1,0,0,2,2, -1,0,2,26,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,22,0,9,18,109,0,16,10,49,0,57, -18,97,0,22,0,0,1,0,0,2,2,1,0,2,28,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,22,0, -9,18,109,0,16,10,49,0,57,18,97,0,22,0,0,1,0,0,2,2,1,0,2,27,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0, -16,8,48,0,57,18,97,0,22,0,9,18,109,0,16,10,49,0,57,18,97,0,22,0,9,18,109,0,16,10,50,0,57,18,97,0, -22,0,0,1,0,0,2,2,1,0,2,30,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,22,0,9,18,109, -0,16,10,49,0,57,18,97,0,22,0,9,18,109,0,16,10,50,0,57,18,97,0,22,0,0,1,0,0,2,2,1,0,2,29,109,0,0,1, -1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,22,0,9,18,109,0,16,10,49,0,57,18,97,0,22,0,9,18, -109,0,16,10,50,0,57,18,97,0,22,0,9,18,109,0,16,10,51,0,57,18,97,0,22,0,0,1,0,0,2,2,1,0,2,31,109,0, -0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,22,0,9,18,109,0,16,10,49,0,57,18,97,0,22,0,9, -18,109,0,16,10,50,0,57,18,97,0,22,0,9,18,109,0,16,10,51,0,57,18,97,0,22,0,0,1,0,0,2,3,1,0,2,26,109, -0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,23,0,9,18,109,0,16,10,49,0,57,18,97,0,23,0, -0,1,0,0,2,3,1,0,2,28,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,23,0,9,18,109,0,16, -10,49,0,57,18,97,0,23,0,0,1,0,0,2,3,1,0,2,27,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18, -97,0,23,0,9,18,109,0,16,10,49,0,57,18,97,0,23,0,9,18,109,0,16,10,50,0,57,18,97,0,23,0,0,1,0,0,2,3, -1,0,2,30,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,23,0,9,18,109,0,16,10,49,0,57, -18,97,0,23,0,9,18,109,0,16,10,50,0,57,18,97,0,23,0,0,1,0,0,2,3,1,0,2,29,109,0,0,1,1,0,9,97,0,0,0,1, +0,58,100,111,116,0,18,118,0,0,18,109,0,16,10,50,0,57,0,0,20,0,0,1,0,0,0,2,1,1,0,2,26,109,0,0,1,1,0, +9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,21,0,9,18,109,0,16,10,49,0,57,18,97,0,21,0,0,1,0,0,0, +2,1,1,0,2,28,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,21,0,9,18,109,0,16,10,49,0, +57,18,97,0,21,0,0,1,0,0,0,2,1,1,0,2,27,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0, +21,0,9,18,109,0,16,10,49,0,57,18,97,0,21,0,9,18,109,0,16,10,50,0,57,18,97,0,21,0,0,1,0,0,0,2,1,1,0, +2,30,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,21,0,9,18,109,0,16,10,49,0,57,18, +97,0,21,0,9,18,109,0,16,10,50,0,57,18,97,0,21,0,0,1,0,0,0,2,1,1,0,2,29,109,0,0,1,1,0,9,97,0,0,0,1, +9,18,109,0,16,8,48,0,57,18,97,0,21,0,9,18,109,0,16,10,49,0,57,18,97,0,21,0,9,18,109,0,16,10,50,0, +57,18,97,0,21,0,9,18,109,0,16,10,51,0,57,18,97,0,21,0,0,1,0,0,0,2,1,1,0,2,31,109,0,0,1,1,0,9,97,0, +0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,21,0,9,18,109,0,16,10,49,0,57,18,97,0,21,0,9,18,109,0,16,10, +50,0,57,18,97,0,21,0,9,18,109,0,16,10,51,0,57,18,97,0,21,0,0,1,0,0,0,2,2,1,0,2,26,109,0,0,1,1,0,9, +97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,22,0,9,18,109,0,16,10,49,0,57,18,97,0,22,0,0,1,0,0,0,2, +2,1,0,2,28,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,22,0,9,18,109,0,16,10,49,0, +57,18,97,0,22,0,0,1,0,0,0,2,2,1,0,2,27,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0, +22,0,9,18,109,0,16,10,49,0,57,18,97,0,22,0,9,18,109,0,16,10,50,0,57,18,97,0,22,0,0,1,0,0,0,2,2,1,0, +2,30,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,22,0,9,18,109,0,16,10,49,0,57,18, +97,0,22,0,9,18,109,0,16,10,50,0,57,18,97,0,22,0,0,1,0,0,0,2,2,1,0,2,29,109,0,0,1,1,0,9,97,0,0,0,1, +9,18,109,0,16,8,48,0,57,18,97,0,22,0,9,18,109,0,16,10,49,0,57,18,97,0,22,0,9,18,109,0,16,10,50,0, +57,18,97,0,22,0,9,18,109,0,16,10,51,0,57,18,97,0,22,0,0,1,0,0,0,2,2,1,0,2,31,109,0,0,1,1,0,9,97,0, +0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,22,0,9,18,109,0,16,10,49,0,57,18,97,0,22,0,9,18,109,0,16,10, +50,0,57,18,97,0,22,0,9,18,109,0,16,10,51,0,57,18,97,0,22,0,0,1,0,0,0,2,3,1,0,2,26,109,0,0,1,1,0,9, +97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,23,0,9,18,109,0,16,10,49,0,57,18,97,0,23,0,0,1,0,0,0,2, +3,1,0,2,28,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,23,0,9,18,109,0,16,10,49,0, +57,18,97,0,23,0,0,1,0,0,0,2,3,1,0,2,27,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0, +23,0,9,18,109,0,16,10,49,0,57,18,97,0,23,0,9,18,109,0,16,10,50,0,57,18,97,0,23,0,0,1,0,0,0,2,3,1,0, +2,30,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,23,0,9,18,109,0,16,10,49,0,57,18, +97,0,23,0,9,18,109,0,16,10,50,0,57,18,97,0,23,0,0,1,0,0,0,2,3,1,0,2,29,109,0,0,1,1,0,9,97,0,0,0,1, 9,18,109,0,16,8,48,0,57,18,97,0,23,0,9,18,109,0,16,10,49,0,57,18,97,0,23,0,9,18,109,0,16,10,50,0, -57,18,97,0,23,0,9,18,109,0,16,10,51,0,57,18,97,0,23,0,0,1,0,0,2,3,1,0,2,31,109,0,0,1,1,0,9,97,0,0, -0,1,9,18,109,0,16,8,48,0,57,18,97,0,23,0,9,18,109,0,16,10,49,0,57,18,97,0,23,0,9,18,109,0,16,10,50, -0,57,18,97,0,23,0,9,18,109,0,16,10,51,0,57,18,97,0,23,0,0,1,0,0,2,4,1,0,2,26,109,0,0,1,1,0,9,97,0, -0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,24,0,9,18,109,0,16,10,49,0,57,18,97,0,24,0,0,1,0,0,2,4,1,0,2, -28,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,24,0,9,18,109,0,16,10,49,0,57,18,97, -0,24,0,0,1,0,0,2,4,1,0,2,27,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,24,0,9,18, -109,0,16,10,49,0,57,18,97,0,24,0,9,18,109,0,16,10,50,0,57,18,97,0,24,0,0,1,0,0,2,4,1,0,2,30,109,0, -0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,24,0,9,18,109,0,16,10,49,0,57,18,97,0,24,0,9, -18,109,0,16,10,50,0,57,18,97,0,24,0,0,1,0,0,2,4,1,0,2,29,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16, -8,48,0,57,18,97,0,24,0,9,18,109,0,16,10,49,0,57,18,97,0,24,0,9,18,109,0,16,10,50,0,57,18,97,0,24,0, -9,18,109,0,16,10,51,0,57,18,97,0,24,0,0,1,0,0,2,4,1,0,2,31,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0, -16,8,48,0,57,18,97,0,24,0,9,18,109,0,16,10,49,0,57,18,97,0,24,0,9,18,109,0,16,10,50,0,57,18,97,0, -24,0,9,18,109,0,16,10,51,0,57,18,97,0,24,0,0,1,0,26,2,26,1,1,0,26,109,0,0,1,1,0,26,110,0,0,0,1,8, -58,109,97,116,50,120,51,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,46,0,18,109,0,16,10,49,0,57, -18,110,0,16,10,49,0,57,46,0,0,0,0,1,0,28,2,26,1,1,0,28,109,0,0,1,1,0,28,110,0,0,0,1,8,58,109,97, -116,50,120,52,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,46,0,18,109,0,16,10,49,0,57,18,110,0, -16,10,49,0,57,46,0,0,0,0,1,0,27,2,26,1,1,0,27,109,0,0,1,1,0,27,110,0,0,0,1,8,58,109,97,116,51,120, -50,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,46,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0, -57,46,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,46,0,0,0,0,1,0,30,2,26,1,1,0,30,109,0,0,1,1, -0,30,110,0,0,0,1,8,58,109,97,116,51,120,52,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,46,0,18, -109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,46,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,46,0, -0,0,0,1,0,29,2,26,1,1,0,29,109,0,0,1,1,0,29,110,0,0,0,1,8,58,109,97,116,52,120,50,0,18,109,0,16,8, -48,0,57,18,110,0,16,8,48,0,57,46,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,46,0,18,109,0,16, -10,50,0,57,18,110,0,16,10,50,0,57,46,0,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,46,0,0,0,0,1, -0,31,2,26,1,1,0,31,109,0,0,1,1,0,31,110,0,0,0,1,8,58,109,97,116,52,120,51,0,18,109,0,16,8,48,0,57, -18,110,0,16,8,48,0,57,46,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,46,0,18,109,0,16,10,50,0, -57,18,110,0,16,10,50,0,57,46,0,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,46,0,0,0,0,1,0,26,2, -27,1,1,0,26,109,0,0,1,1,0,26,110,0,0,0,1,8,58,109,97,116,50,120,51,0,18,109,0,16,8,48,0,57,18,110, -0,16,8,48,0,57,47,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,47,0,0,0,0,1,0,28,2,27,1,1,0,28, -109,0,0,1,1,0,28,110,0,0,0,1,8,58,109,97,116,50,120,52,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0, -57,47,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,47,0,0,0,0,1,0,27,2,27,1,1,0,27,109,0,0,1,1, -0,27,110,0,0,0,1,8,58,109,97,116,51,120,50,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,47,0,18, -109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,47,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,47,0, -0,0,0,1,0,30,2,27,1,1,0,30,109,0,0,1,1,0,30,110,0,0,0,1,8,58,109,97,116,51,120,52,0,18,109,0,16,8, -48,0,57,18,110,0,16,8,48,0,57,47,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,47,0,18,109,0,16, -10,50,0,57,18,110,0,16,10,50,0,57,47,0,0,0,0,1,0,29,2,27,1,1,0,29,109,0,0,1,1,0,29,110,0,0,0,1,8, -58,109,97,116,52,120,50,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,47,0,18,109,0,16,10,49,0,57, -18,110,0,16,10,49,0,57,47,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,47,0,18,109,0,16,10,51,0, -57,18,110,0,16,10,51,0,57,47,0,0,0,0,1,0,31,2,27,1,1,0,31,109,0,0,1,1,0,31,110,0,0,0,1,8,58,109,97, -116,52,120,51,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,47,0,18,109,0,16,10,49,0,57,18,110,0, -16,10,49,0,57,47,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,47,0,18,109,0,16,10,51,0,57,18, -110,0,16,10,51,0,57,47,0,0,0,0,1,0,26,2,22,1,1,0,26,109,0,0,1,1,0,26,110,0,0,0,1,8,58,109,97,116, -50,120,51,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,49,0,18,109,0,16,10,49,0,57,18,110,0,16,10, -49,0,57,49,0,0,0,0,1,0,28,2,22,1,1,0,28,109,0,0,1,1,0,28,110,0,0,0,1,8,58,109,97,116,50,120,52,0, +57,18,97,0,23,0,9,18,109,0,16,10,51,0,57,18,97,0,23,0,0,1,0,0,0,2,3,1,0,2,31,109,0,0,1,1,0,9,97,0, +0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,23,0,9,18,109,0,16,10,49,0,57,18,97,0,23,0,9,18,109,0,16,10, +50,0,57,18,97,0,23,0,9,18,109,0,16,10,51,0,57,18,97,0,23,0,0,1,0,0,0,2,4,1,0,2,26,109,0,0,1,1,0,9, +97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,24,0,9,18,109,0,16,10,49,0,57,18,97,0,24,0,0,1,0,0,0,2, +4,1,0,2,28,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,24,0,9,18,109,0,16,10,49,0, +57,18,97,0,24,0,0,1,0,0,0,2,4,1,0,2,27,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0, +24,0,9,18,109,0,16,10,49,0,57,18,97,0,24,0,9,18,109,0,16,10,50,0,57,18,97,0,24,0,0,1,0,0,0,2,4,1,0, +2,30,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,24,0,9,18,109,0,16,10,49,0,57,18, +97,0,24,0,9,18,109,0,16,10,50,0,57,18,97,0,24,0,0,1,0,0,0,2,4,1,0,2,29,109,0,0,1,1,0,9,97,0,0,0,1, +9,18,109,0,16,8,48,0,57,18,97,0,24,0,9,18,109,0,16,10,49,0,57,18,97,0,24,0,9,18,109,0,16,10,50,0, +57,18,97,0,24,0,9,18,109,0,16,10,51,0,57,18,97,0,24,0,0,1,0,0,0,2,4,1,0,2,31,109,0,0,1,1,0,9,97,0, +0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,24,0,9,18,109,0,16,10,49,0,57,18,97,0,24,0,9,18,109,0,16,10, +50,0,57,18,97,0,24,0,9,18,109,0,16,10,51,0,57,18,97,0,24,0,0,1,0,0,26,2,26,1,1,0,26,109,0,0,1,1,0, +26,110,0,0,0,1,8,58,109,97,116,50,120,51,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,46,0,18,109, +0,16,10,49,0,57,18,110,0,16,10,49,0,57,46,0,0,0,0,1,0,0,28,2,26,1,1,0,28,109,0,0,1,1,0,28,110,0,0, +0,1,8,58,109,97,116,50,120,52,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,46,0,18,109,0,16,10,49, +0,57,18,110,0,16,10,49,0,57,46,0,0,0,0,1,0,0,27,2,26,1,1,0,27,109,0,0,1,1,0,27,110,0,0,0,1,8,58, +109,97,116,51,120,50,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,46,0,18,109,0,16,10,49,0,57,18, +110,0,16,10,49,0,57,46,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,46,0,0,0,0,1,0,0,30,2,26,1, +1,0,30,109,0,0,1,1,0,30,110,0,0,0,1,8,58,109,97,116,51,120,52,0,18,109,0,16,8,48,0,57,18,110,0,16, +8,48,0,57,46,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,46,0,18,109,0,16,10,50,0,57,18,110,0, +16,10,50,0,57,46,0,0,0,0,1,0,0,29,2,26,1,1,0,29,109,0,0,1,1,0,29,110,0,0,0,1,8,58,109,97,116,52, +120,50,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,46,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49, +0,57,46,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,46,0,18,109,0,16,10,51,0,57,18,110,0,16,10, +51,0,57,46,0,0,0,0,1,0,0,31,2,26,1,1,0,31,109,0,0,1,1,0,31,110,0,0,0,1,8,58,109,97,116,52,120,51,0, +18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,46,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,46, +0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,46,0,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57, +46,0,0,0,0,1,0,0,26,2,27,1,1,0,26,109,0,0,1,1,0,26,110,0,0,0,1,8,58,109,97,116,50,120,51,0,18,109, +0,16,8,48,0,57,18,110,0,16,8,48,0,57,47,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,47,0,0,0,0, +1,0,0,28,2,27,1,1,0,28,109,0,0,1,1,0,28,110,0,0,0,1,8,58,109,97,116,50,120,52,0,18,109,0,16,8,48,0, +57,18,110,0,16,8,48,0,57,47,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,47,0,0,0,0,1,0,0,27,2, +27,1,1,0,27,109,0,0,1,1,0,27,110,0,0,0,1,8,58,109,97,116,51,120,50,0,18,109,0,16,8,48,0,57,18,110, +0,16,8,48,0,57,47,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,47,0,18,109,0,16,10,50,0,57,18, +110,0,16,10,50,0,57,47,0,0,0,0,1,0,0,30,2,27,1,1,0,30,109,0,0,1,1,0,30,110,0,0,0,1,8,58,109,97,116, +51,120,52,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,47,0,18,109,0,16,10,49,0,57,18,110,0,16,10, +49,0,57,47,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,47,0,0,0,0,1,0,0,29,2,27,1,1,0,29,109,0, +0,1,1,0,29,110,0,0,0,1,8,58,109,97,116,52,120,50,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,47, +0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,47,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57, +47,0,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,47,0,0,0,0,1,0,0,31,2,27,1,1,0,31,109,0,0,1,1,0, +31,110,0,0,0,1,8,58,109,97,116,52,120,51,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,47,0,18,109, +0,16,10,49,0,57,18,110,0,16,10,49,0,57,47,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,47,0,18, +109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,47,0,0,0,0,1,0,0,26,2,22,1,1,0,26,109,0,0,1,1,0,26,110, +0,0,0,1,8,58,109,97,116,50,120,51,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,49,0,18,109,0,16, +10,49,0,57,18,110,0,16,10,49,0,57,49,0,0,0,0,1,0,0,28,2,22,1,1,0,28,109,0,0,1,1,0,28,110,0,0,0,1,8, +58,109,97,116,50,120,52,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,49,0,18,109,0,16,10,49,0,57, +18,110,0,16,10,49,0,57,49,0,0,0,0,1,0,0,27,2,22,1,1,0,27,109,0,0,1,1,0,27,110,0,0,0,1,8,58,109,97, +116,51,120,50,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,49,0,18,109,0,16,10,49,0,57,18,110,0, +16,10,49,0,57,49,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,49,0,0,0,0,1,0,0,30,2,22,1,1,0,30, +109,0,0,1,1,0,30,110,0,0,0,1,8,58,109,97,116,51,120,52,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0, +57,49,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,49,0,18,109,0,16,10,50,0,57,18,110,0,16,10, +50,0,57,49,0,0,0,0,1,0,0,29,2,22,1,1,0,29,109,0,0,1,1,0,29,110,0,0,0,1,8,58,109,97,116,52,120,50,0, 18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,49,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,49, -0,0,0,0,1,0,27,2,22,1,1,0,27,109,0,0,1,1,0,27,110,0,0,0,1,8,58,109,97,116,51,120,50,0,18,109,0,16, -8,48,0,57,18,110,0,16,8,48,0,57,49,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,49,0,18,109,0, -16,10,50,0,57,18,110,0,16,10,50,0,57,49,0,0,0,0,1,0,30,2,22,1,1,0,30,109,0,0,1,1,0,30,110,0,0,0,1, -8,58,109,97,116,51,120,52,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,49,0,18,109,0,16,10,49,0, -57,18,110,0,16,10,49,0,57,49,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,49,0,0,0,0,1,0,29,2, -22,1,1,0,29,109,0,0,1,1,0,29,110,0,0,0,1,8,58,109,97,116,52,120,50,0,18,109,0,16,8,48,0,57,18,110, -0,16,8,48,0,57,49,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,49,0,18,109,0,16,10,50,0,57,18, -110,0,16,10,50,0,57,49,0,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,49,0,0,0,0,1,0,31,2,22,1,1, -0,31,109,0,0,1,1,0,31,110,0,0,0,1,8,58,109,97,116,52,120,51,0,18,109,0,16,8,48,0,57,18,110,0,16,8, -48,0,57,49,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,49,0,18,109,0,16,10,50,0,57,18,110,0,16, -10,50,0,57,49,0,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,49,0,0,0,0,1,0,26,2,26,1,1,0,9,97,0, -0,1,1,0,26,110,0,0,0,1,8,58,109,97,116,50,120,51,0,18,97,0,18,110,0,16,8,48,0,57,46,0,18,97,0,18, -110,0,16,10,49,0,57,46,0,0,0,0,1,0,26,2,26,1,1,0,26,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,50, -120,51,0,18,109,0,16,8,48,0,57,18,98,0,46,0,18,109,0,16,10,49,0,57,18,98,0,46,0,0,0,0,1,0,28,2,26, -1,1,0,9,97,0,0,1,1,0,28,110,0,0,0,1,8,58,109,97,116,50,120,52,0,18,97,0,18,110,0,16,8,48,0,57,46,0, -18,97,0,18,110,0,16,10,49,0,57,46,0,0,0,0,1,0,28,2,26,1,1,0,28,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109, -97,116,50,120,52,0,18,109,0,16,8,48,0,57,18,98,0,46,0,18,109,0,16,10,49,0,57,18,98,0,46,0,0,0,0,1, -0,27,2,26,1,1,0,9,97,0,0,1,1,0,27,110,0,0,0,1,8,58,109,97,116,51,120,50,0,18,97,0,18,110,0,16,8,48, -0,57,46,0,18,97,0,18,110,0,16,10,49,0,57,46,0,18,97,0,18,110,0,16,10,50,0,57,46,0,0,0,0,1,0,27,2, -26,1,1,0,27,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,51,120,50,0,18,109,0,16,8,48,0,57,18,98,0, -46,0,18,109,0,16,10,49,0,57,18,98,0,46,0,18,109,0,16,10,50,0,57,18,98,0,46,0,0,0,0,1,0,30,2,26,1,1, -0,9,97,0,0,1,1,0,30,110,0,0,0,1,8,58,109,97,116,51,120,52,0,18,97,0,18,110,0,16,8,48,0,57,46,0,18, -97,0,18,110,0,16,10,49,0,57,46,0,18,97,0,18,110,0,16,10,50,0,57,46,0,0,0,0,1,0,30,2,26,1,1,0,30, -109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,51,120,52,0,18,109,0,16,8,48,0,57,18,98,0,46,0,18,109,0, -16,10,49,0,57,18,98,0,46,0,18,109,0,16,10,50,0,57,18,98,0,46,0,0,0,0,1,0,29,2,26,1,1,0,29,109,0,0, -1,1,0,9,98,0,0,0,1,8,58,109,97,116,52,120,50,0,18,109,0,16,8,48,0,57,18,98,0,46,0,18,109,0,16,10, -49,0,57,18,98,0,46,0,18,109,0,16,10,50,0,57,18,98,0,46,0,18,109,0,16,10,51,0,57,18,98,0,46,0,0,0,0, -1,0,29,2,26,1,1,0,9,97,0,0,1,1,0,29,110,0,0,0,1,8,58,109,97,116,52,120,50,0,18,97,0,18,110,0,16,8, -48,0,57,46,0,18,97,0,18,110,0,16,10,49,0,57,46,0,18,97,0,18,110,0,16,10,50,0,57,46,0,18,97,0,18, -110,0,16,10,51,0,57,46,0,0,0,0,1,0,31,2,26,1,1,0,31,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,52, -120,51,0,18,109,0,16,8,48,0,57,18,98,0,46,0,18,109,0,16,10,49,0,57,18,98,0,46,0,18,109,0,16,10,50, -0,57,18,98,0,46,0,18,109,0,16,10,51,0,57,18,98,0,46,0,0,0,0,1,0,31,2,26,1,1,0,9,97,0,0,1,1,0,31, -110,0,0,0,1,8,58,109,97,116,52,120,51,0,18,97,0,18,110,0,16,8,48,0,57,46,0,18,97,0,18,110,0,16,10, -49,0,57,46,0,18,97,0,18,110,0,16,10,50,0,57,46,0,18,97,0,18,110,0,16,10,51,0,57,46,0,0,0,0,1,0,26, -2,27,1,1,0,9,97,0,0,1,1,0,26,110,0,0,0,1,8,58,109,97,116,50,120,51,0,18,97,0,18,110,0,16,8,48,0,57, -47,0,18,97,0,18,110,0,16,10,49,0,57,47,0,0,0,0,1,0,26,2,27,1,1,0,26,109,0,0,1,1,0,9,98,0,0,0,1,8, -58,109,97,116,50,120,51,0,18,109,0,16,8,48,0,57,18,98,0,47,0,18,109,0,16,10,49,0,57,18,98,0,47,0,0, -0,0,1,0,28,2,27,1,1,0,9,97,0,0,1,1,0,28,110,0,0,0,1,8,58,109,97,116,50,120,52,0,18,97,0,18,110,0, -16,8,48,0,57,47,0,18,97,0,18,110,0,16,10,49,0,57,47,0,0,0,0,1,0,28,2,27,1,1,0,28,109,0,0,1,1,0,9, -98,0,0,0,1,8,58,109,97,116,50,120,52,0,18,109,0,16,8,48,0,57,18,98,0,47,0,18,109,0,16,10,49,0,57, -18,98,0,47,0,0,0,0,1,0,27,2,27,1,1,0,9,97,0,0,1,1,0,27,110,0,0,0,1,8,58,109,97,116,51,120,50,0,18, -97,0,18,110,0,16,8,48,0,57,47,0,18,97,0,18,110,0,16,10,49,0,57,47,0,18,97,0,18,110,0,16,10,50,0,57, -47,0,0,0,0,1,0,27,2,27,1,1,0,27,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,51,120,50,0,18,109,0,16, -8,48,0,57,18,98,0,47,0,18,109,0,16,10,49,0,57,18,98,0,47,0,18,109,0,16,10,50,0,57,18,98,0,47,0,0,0, -0,1,0,30,2,27,1,1,0,9,97,0,0,1,1,0,30,110,0,0,0,1,8,58,109,97,116,51,120,52,0,18,97,0,18,110,0,16, -8,48,0,57,47,0,18,97,0,18,110,0,16,10,49,0,57,47,0,18,97,0,18,110,0,16,10,50,0,57,47,0,0,0,0,1,0, -30,2,27,1,1,0,30,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,51,120,52,0,18,109,0,16,8,48,0,57,18, -98,0,47,0,18,109,0,16,10,49,0,57,18,98,0,47,0,18,109,0,16,10,50,0,57,18,98,0,47,0,0,0,0,1,0,29,2, -27,1,1,0,29,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,52,120,50,0,18,109,0,16,8,48,0,57,18,98,0, -47,0,18,109,0,16,10,49,0,57,18,98,0,47,0,18,109,0,16,10,50,0,57,18,98,0,47,0,18,109,0,16,10,51,0, -57,18,98,0,47,0,0,0,0,1,0,29,2,27,1,1,0,9,97,0,0,1,1,0,29,110,0,0,0,1,8,58,109,97,116,52,120,50,0, -18,97,0,18,110,0,16,8,48,0,57,47,0,18,97,0,18,110,0,16,10,49,0,57,47,0,18,97,0,18,110,0,16,10,50,0, -57,47,0,18,97,0,18,110,0,16,10,51,0,57,47,0,0,0,0,1,0,31,2,27,1,1,0,31,109,0,0,1,1,0,9,98,0,0,0,1, -8,58,109,97,116,52,120,51,0,18,109,0,16,8,48,0,57,18,98,0,47,0,18,109,0,16,10,49,0,57,18,98,0,47,0, -18,109,0,16,10,50,0,57,18,98,0,47,0,18,109,0,16,10,51,0,57,18,98,0,47,0,0,0,0,1,0,31,2,27,1,1,0,9, -97,0,0,1,1,0,31,110,0,0,0,1,8,58,109,97,116,52,120,51,0,18,97,0,18,110,0,16,8,48,0,57,47,0,18,97,0, -18,110,0,16,10,49,0,57,47,0,18,97,0,18,110,0,16,10,50,0,57,47,0,18,97,0,18,110,0,16,10,51,0,57,47, -0,0,0,0,1,0,26,2,21,1,1,0,9,97,0,0,1,1,0,26,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48, -0,57,18,97,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,97, -0,18,110,0,16,10,49,0,57,48,20,0,0,1,0,26,2,21,1,1,0,26,109,0,0,1,1,0,9,98,0,0,0,1,9,18,95,95,114, -101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86, -97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,98,0,48,20,0,0,1,0,28,2,21,1,1,0,9,97,0,0,1,1,0, -28,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,97,0,18,110,0,16,8,48,0,57,48,20, -0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,97,0,18,110,0,16,10,49,0,57,48,20,0,0,1,0,28, -2,21,1,1,0,28,109,0,0,1,1,0,9,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0, -16,8,48,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0, -57,18,98,0,48,20,0,0,1,0,27,2,21,1,1,0,9,97,0,0,1,1,0,27,110,0,0,0,1,9,18,95,95,114,101,116,86,97, -108,0,16,8,48,0,57,18,97,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10, -49,0,57,18,97,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18, -97,0,18,110,0,16,10,50,0,57,48,20,0,0,1,0,27,2,21,1,1,0,27,109,0,0,1,1,0,9,98,0,0,0,1,9,18,95,95, -114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116, -86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108, -0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,98,0,48,20,0,0,1,0,30,2,21,1,1,0,9,97,0,0,1,1,0,30,110,0, -0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,97,0,18,110,0,16,8,48,0,57,48,20,0,9,18, -95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,97,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114, -101,116,86,97,108,0,16,10,50,0,57,18,97,0,18,110,0,16,10,50,0,57,48,20,0,0,1,0,30,2,21,1,1,0,30, -109,0,0,1,1,0,9,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57, -18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,98,0,48, -20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,98,0,48,20,0,0,1,0, -29,2,21,1,1,0,29,109,0,0,1,1,0,9,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109, -0,16,8,48,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49, -0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,98, -0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,109,0,16,10,51,0,57,18,98,0,48,20,0, -0,1,0,29,2,21,1,1,0,9,97,0,0,1,1,0,29,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57, -18,97,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,97,0,18, -110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,97,0,18,110,0,16, -10,50,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,97,0,18,110,0,16,10,51,0,57, -48,20,0,0,1,0,31,2,21,1,1,0,31,109,0,0,1,1,0,9,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8, -48,0,57,18,109,0,16,8,48,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18, -109,0,16,10,49,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,16, -10,50,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,109,0,16,10,51,0,57, -18,98,0,48,20,0,0,1,0,31,2,21,1,1,0,9,97,0,0,1,1,0,31,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108, -0,16,8,48,0,57,18,97,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0, -57,18,97,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,97,0, -18,110,0,16,10,50,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,97,0,18,110,0, -16,10,51,0,57,48,20,0,0,1,0,26,2,22,1,1,0,9,97,0,0,1,1,0,26,110,0,0,0,1,3,2,1,9,1,105,110,118,0,2, +0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,49,0,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57, +49,0,0,0,0,1,0,0,31,2,22,1,1,0,31,109,0,0,1,1,0,31,110,0,0,0,1,8,58,109,97,116,52,120,51,0,18,109, +0,16,8,48,0,57,18,110,0,16,8,48,0,57,49,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,49,0,18, +109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,49,0,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,49,0, +0,0,0,1,0,0,26,2,26,1,1,0,9,97,0,0,1,1,0,26,110,0,0,0,1,8,58,109,97,116,50,120,51,0,18,97,0,18,110, +0,16,8,48,0,57,46,0,18,97,0,18,110,0,16,10,49,0,57,46,0,0,0,0,1,0,0,26,2,26,1,1,0,26,109,0,0,1,1,0, +9,98,0,0,0,1,8,58,109,97,116,50,120,51,0,18,109,0,16,8,48,0,57,18,98,0,46,0,18,109,0,16,10,49,0,57, +18,98,0,46,0,0,0,0,1,0,0,28,2,26,1,1,0,9,97,0,0,1,1,0,28,110,0,0,0,1,8,58,109,97,116,50,120,52,0, +18,97,0,18,110,0,16,8,48,0,57,46,0,18,97,0,18,110,0,16,10,49,0,57,46,0,0,0,0,1,0,0,28,2,26,1,1,0, +28,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,50,120,52,0,18,109,0,16,8,48,0,57,18,98,0,46,0,18, +109,0,16,10,49,0,57,18,98,0,46,0,0,0,0,1,0,0,27,2,26,1,1,0,9,97,0,0,1,1,0,27,110,0,0,0,1,8,58,109, +97,116,51,120,50,0,18,97,0,18,110,0,16,8,48,0,57,46,0,18,97,0,18,110,0,16,10,49,0,57,46,0,18,97,0, +18,110,0,16,10,50,0,57,46,0,0,0,0,1,0,0,27,2,26,1,1,0,27,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97, +116,51,120,50,0,18,109,0,16,8,48,0,57,18,98,0,46,0,18,109,0,16,10,49,0,57,18,98,0,46,0,18,109,0,16, +10,50,0,57,18,98,0,46,0,0,0,0,1,0,0,30,2,26,1,1,0,9,97,0,0,1,1,0,30,110,0,0,0,1,8,58,109,97,116,51, +120,52,0,18,97,0,18,110,0,16,8,48,0,57,46,0,18,97,0,18,110,0,16,10,49,0,57,46,0,18,97,0,18,110,0, +16,10,50,0,57,46,0,0,0,0,1,0,0,30,2,26,1,1,0,30,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,51,120, +52,0,18,109,0,16,8,48,0,57,18,98,0,46,0,18,109,0,16,10,49,0,57,18,98,0,46,0,18,109,0,16,10,50,0,57, +18,98,0,46,0,0,0,0,1,0,0,29,2,26,1,1,0,29,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,52,120,50,0, +18,109,0,16,8,48,0,57,18,98,0,46,0,18,109,0,16,10,49,0,57,18,98,0,46,0,18,109,0,16,10,50,0,57,18, +98,0,46,0,18,109,0,16,10,51,0,57,18,98,0,46,0,0,0,0,1,0,0,29,2,26,1,1,0,9,97,0,0,1,1,0,29,110,0,0, +0,1,8,58,109,97,116,52,120,50,0,18,97,0,18,110,0,16,8,48,0,57,46,0,18,97,0,18,110,0,16,10,49,0,57, +46,0,18,97,0,18,110,0,16,10,50,0,57,46,0,18,97,0,18,110,0,16,10,51,0,57,46,0,0,0,0,1,0,0,31,2,26,1, +1,0,31,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,52,120,51,0,18,109,0,16,8,48,0,57,18,98,0,46,0, +18,109,0,16,10,49,0,57,18,98,0,46,0,18,109,0,16,10,50,0,57,18,98,0,46,0,18,109,0,16,10,51,0,57,18, +98,0,46,0,0,0,0,1,0,0,31,2,26,1,1,0,9,97,0,0,1,1,0,31,110,0,0,0,1,8,58,109,97,116,52,120,51,0,18, +97,0,18,110,0,16,8,48,0,57,46,0,18,97,0,18,110,0,16,10,49,0,57,46,0,18,97,0,18,110,0,16,10,50,0,57, +46,0,18,97,0,18,110,0,16,10,51,0,57,46,0,0,0,0,1,0,0,26,2,27,1,1,0,9,97,0,0,1,1,0,26,110,0,0,0,1,8, +58,109,97,116,50,120,51,0,18,97,0,18,110,0,16,8,48,0,57,47,0,18,97,0,18,110,0,16,10,49,0,57,47,0,0, +0,0,1,0,0,26,2,27,1,1,0,26,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,50,120,51,0,18,109,0,16,8,48, +0,57,18,98,0,47,0,18,109,0,16,10,49,0,57,18,98,0,47,0,0,0,0,1,0,0,28,2,27,1,1,0,9,97,0,0,1,1,0,28, +110,0,0,0,1,8,58,109,97,116,50,120,52,0,18,97,0,18,110,0,16,8,48,0,57,47,0,18,97,0,18,110,0,16,10, +49,0,57,47,0,0,0,0,1,0,0,28,2,27,1,1,0,28,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,50,120,52,0, +18,109,0,16,8,48,0,57,18,98,0,47,0,18,109,0,16,10,49,0,57,18,98,0,47,0,0,0,0,1,0,0,27,2,27,1,1,0,9, +97,0,0,1,1,0,27,110,0,0,0,1,8,58,109,97,116,51,120,50,0,18,97,0,18,110,0,16,8,48,0,57,47,0,18,97,0, +18,110,0,16,10,49,0,57,47,0,18,97,0,18,110,0,16,10,50,0,57,47,0,0,0,0,1,0,0,27,2,27,1,1,0,27,109,0, +0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,51,120,50,0,18,109,0,16,8,48,0,57,18,98,0,47,0,18,109,0,16,10, +49,0,57,18,98,0,47,0,18,109,0,16,10,50,0,57,18,98,0,47,0,0,0,0,1,0,0,30,2,27,1,1,0,9,97,0,0,1,1,0, +30,110,0,0,0,1,8,58,109,97,116,51,120,52,0,18,97,0,18,110,0,16,8,48,0,57,47,0,18,97,0,18,110,0,16, +10,49,0,57,47,0,18,97,0,18,110,0,16,10,50,0,57,47,0,0,0,0,1,0,0,30,2,27,1,1,0,30,109,0,0,1,1,0,9, +98,0,0,0,1,8,58,109,97,116,51,120,52,0,18,109,0,16,8,48,0,57,18,98,0,47,0,18,109,0,16,10,49,0,57, +18,98,0,47,0,18,109,0,16,10,50,0,57,18,98,0,47,0,0,0,0,1,0,0,29,2,27,1,1,0,29,109,0,0,1,1,0,9,98,0, +0,0,1,8,58,109,97,116,52,120,50,0,18,109,0,16,8,48,0,57,18,98,0,47,0,18,109,0,16,10,49,0,57,18,98, +0,47,0,18,109,0,16,10,50,0,57,18,98,0,47,0,18,109,0,16,10,51,0,57,18,98,0,47,0,0,0,0,1,0,0,29,2,27, +1,1,0,9,97,0,0,1,1,0,29,110,0,0,0,1,8,58,109,97,116,52,120,50,0,18,97,0,18,110,0,16,8,48,0,57,47,0, +18,97,0,18,110,0,16,10,49,0,57,47,0,18,97,0,18,110,0,16,10,50,0,57,47,0,18,97,0,18,110,0,16,10,51, +0,57,47,0,0,0,0,1,0,0,31,2,27,1,1,0,31,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,52,120,51,0,18, +109,0,16,8,48,0,57,18,98,0,47,0,18,109,0,16,10,49,0,57,18,98,0,47,0,18,109,0,16,10,50,0,57,18,98,0, +47,0,18,109,0,16,10,51,0,57,18,98,0,47,0,0,0,0,1,0,0,31,2,27,1,1,0,9,97,0,0,1,1,0,31,110,0,0,0,1,8, +58,109,97,116,52,120,51,0,18,97,0,18,110,0,16,8,48,0,57,47,0,18,97,0,18,110,0,16,10,49,0,57,47,0, +18,97,0,18,110,0,16,10,50,0,57,47,0,18,97,0,18,110,0,16,10,51,0,57,47,0,0,0,0,1,0,0,26,2,21,1,1,0, +9,97,0,0,1,1,0,26,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,97,0,18,110,0,16, +8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,97,0,18,110,0,16,10,49,0,57, +48,20,0,0,1,0,0,26,2,21,1,1,0,26,109,0,0,1,1,0,9,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16, +8,48,0,57,18,109,0,16,8,48,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57, +18,109,0,16,10,49,0,57,18,98,0,48,20,0,0,1,0,0,28,2,21,1,1,0,9,97,0,0,1,1,0,28,110,0,0,0,1,9,18,95, +95,114,101,116,86,97,108,0,16,8,48,0,57,18,97,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101, +116,86,97,108,0,16,10,49,0,57,18,97,0,18,110,0,16,10,49,0,57,48,20,0,0,1,0,0,28,2,21,1,1,0,28,109, +0,0,1,1,0,9,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,98, +0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,98,0,48,20,0, +0,1,0,0,27,2,21,1,1,0,9,97,0,0,1,1,0,27,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0, +57,18,97,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,97,0, +18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,97,0,18,110,0, +16,10,50,0,57,48,20,0,0,1,0,0,27,2,21,1,1,0,27,109,0,0,1,1,0,9,98,0,0,0,1,9,18,95,95,114,101,116, +86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0, +16,10,49,0,57,18,109,0,16,10,49,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0, +57,18,109,0,16,10,50,0,57,18,98,0,48,20,0,0,1,0,0,30,2,21,1,1,0,9,97,0,0,1,1,0,30,110,0,0,0,1,9,18, +95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,97,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114, +101,116,86,97,108,0,16,10,49,0,57,18,97,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101,116,86, +97,108,0,16,10,50,0,57,18,97,0,18,110,0,16,10,50,0,57,48,20,0,0,1,0,0,30,2,21,1,1,0,30,109,0,0,1,1, +0,9,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,98,0,48,20, +0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,98,0,48,20,0,9,18,95, +95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,98,0,48,20,0,0,1,0,0,29,2,21,1, +1,0,29,109,0,0,1,1,0,9,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48, +0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,98, +0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,98,0,48,20,0, +9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,109,0,16,10,51,0,57,18,98,0,48,20,0,0,1,0,0,29, +2,21,1,1,0,9,97,0,0,1,1,0,29,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,97,0, +18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,97,0,18,110,0,16, +10,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,97,0,18,110,0,16,10,50,0,57, +48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,97,0,18,110,0,16,10,51,0,57,48,20,0,0, +1,0,0,31,2,21,1,1,0,31,109,0,0,1,1,0,9,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57, +18,109,0,16,8,48,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16, +10,49,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,16,10,50,0,57, +18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,109,0,16,10,51,0,57,18,98,0,48, +20,0,0,1,0,0,31,2,21,1,1,0,9,97,0,0,1,1,0,31,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8, +48,0,57,18,97,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18, +97,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,97,0,18, +110,0,16,10,50,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,97,0,18,110,0,16, +10,51,0,57,48,20,0,0,1,0,0,26,2,22,1,1,0,9,97,0,0,1,1,0,26,110,0,0,0,1,3,2,1,0,9,1,105,110,118,0,2, 17,49,0,48,0,0,18,97,0,49,0,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,105,110,118,0,18, 110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,105,110,118,0,18, -110,0,16,10,49,0,57,48,20,0,0,1,0,26,2,22,1,1,0,26,109,0,0,1,1,0,9,98,0,0,0,1,3,2,1,9,1,105,110, -118,0,2,17,49,0,48,0,0,18,98,0,49,0,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16, -8,48,0,57,18,105,110,118,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10, -49,0,57,18,105,110,118,0,48,20,0,0,1,0,28,2,22,1,1,0,9,97,0,0,1,1,0,28,110,0,0,0,1,3,2,1,9,1,105, -110,118,0,2,17,49,0,48,0,0,18,97,0,49,0,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,105, -110,118,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,105, -110,118,0,18,110,0,16,10,49,0,57,48,20,0,0,1,0,28,2,22,1,1,0,28,109,0,0,1,1,0,9,98,0,0,0,1,3,2,1,9, -1,105,110,118,0,2,17,49,0,48,0,0,18,98,0,49,0,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18, -109,0,16,8,48,0,57,18,105,110,118,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18, -109,0,16,10,49,0,57,18,105,110,118,0,48,20,0,0,1,0,27,2,22,1,1,0,9,97,0,0,1,1,0,27,110,0,0,0,1,3,2, -1,9,1,105,110,118,0,2,17,49,0,48,0,0,18,97,0,49,0,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0, -57,18,105,110,118,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57, -18,105,110,118,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57, -18,105,110,118,0,18,110,0,16,10,50,0,57,48,20,0,0,1,0,27,2,22,1,1,0,27,109,0,0,1,1,0,9,98,0,0,0,1, -3,2,1,9,1,105,110,118,0,2,17,49,0,48,0,0,18,98,0,49,0,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48, +110,0,16,10,49,0,57,48,20,0,0,1,0,0,26,2,22,1,1,0,26,109,0,0,1,1,0,9,98,0,0,0,1,3,2,1,0,9,1,105, +110,118,0,2,17,49,0,48,0,0,18,98,0,49,0,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0, +16,8,48,0,57,18,105,110,118,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16, +10,49,0,57,18,105,110,118,0,48,20,0,0,1,0,0,28,2,22,1,1,0,9,97,0,0,1,1,0,28,110,0,0,0,1,3,2,1,0,9, +1,105,110,118,0,2,17,49,0,48,0,0,18,97,0,49,0,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18, +105,110,118,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18, +105,110,118,0,18,110,0,16,10,49,0,57,48,20,0,0,1,0,0,28,2,22,1,1,0,28,109,0,0,1,1,0,9,98,0,0,0,1,3, +2,1,0,9,1,105,110,118,0,2,17,49,0,48,0,0,18,98,0,49,0,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48, 0,57,18,109,0,16,8,48,0,57,18,105,110,118,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0, -57,18,109,0,16,10,49,0,57,18,105,110,118,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0, -57,18,109,0,16,10,50,0,57,18,105,110,118,0,48,20,0,0,1,0,30,2,22,1,1,0,9,97,0,0,1,1,0,30,110,0,0,0, -1,3,2,1,9,1,105,110,118,0,2,17,49,0,48,0,0,18,97,0,49,0,0,9,18,95,95,114,101,116,86,97,108,0,16,8, -48,0,57,18,105,110,118,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49, -0,57,18,105,110,118,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0, -57,18,105,110,118,0,18,110,0,16,10,50,0,57,48,20,0,0,1,0,30,2,22,1,1,0,30,109,0,0,1,1,0,9,98,0,0,0, -1,3,2,1,9,1,105,110,118,0,2,17,49,0,48,0,0,18,98,0,49,0,0,9,18,95,95,114,101,116,86,97,108,0,16,8, -48,0,57,18,109,0,16,8,48,0,57,18,105,110,118,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49, -0,57,18,109,0,16,10,49,0,57,18,105,110,118,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0, -57,18,109,0,16,10,50,0,57,18,105,110,118,0,48,20,0,0,1,0,29,2,22,1,1,0,29,109,0,0,1,1,0,9,98,0,0,0, -1,3,2,1,9,1,105,110,118,0,2,17,49,0,48,0,0,18,98,0,49,0,0,9,18,95,95,114,101,116,86,97,108,0,16,8, -48,0,57,18,109,0,16,8,48,0,57,18,105,110,118,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49, -0,57,18,109,0,16,10,49,0,57,18,105,110,118,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0, -57,18,109,0,16,10,50,0,57,18,105,110,118,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0, -57,18,109,0,16,10,51,0,57,18,105,110,118,0,48,20,0,0,1,0,29,2,22,1,1,0,9,97,0,0,1,1,0,29,110,0,0,0, -1,3,2,1,9,1,105,110,118,0,2,17,49,0,48,0,0,18,97,0,49,0,0,9,18,95,95,114,101,116,86,97,108,0,16,8, -48,0,57,18,105,110,118,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49, -0,57,18,105,110,118,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0, -57,18,105,110,118,0,18,110,0,16,10,50,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0, -57,18,105,110,118,0,18,110,0,16,10,51,0,57,48,20,0,0,1,0,31,2,22,1,1,0,31,109,0,0,1,1,0,9,98,0,0,0, -1,3,2,1,9,1,105,110,118,0,2,17,49,0,48,0,0,18,98,0,49,0,0,9,18,95,95,114,101,116,86,97,108,0,16,8, -48,0,57,18,109,0,16,8,48,0,57,18,105,110,118,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49, -0,57,18,109,0,16,10,49,0,57,18,105,110,118,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0, -57,18,109,0,16,10,50,0,57,18,105,110,118,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0, -57,18,109,0,16,10,51,0,57,18,105,110,118,0,48,20,0,0,1,0,31,2,22,1,1,0,9,97,0,0,1,1,0,31,110,0,0,0, -1,3,2,1,9,1,105,110,118,0,2,17,49,0,48,0,0,18,97,0,49,0,0,9,18,95,95,114,101,116,86,97,108,0,16,8, -48,0,57,18,105,110,118,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49, -0,57,18,105,110,118,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0, -57,18,105,110,118,0,18,110,0,16,10,50,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0, -57,18,105,110,118,0,18,110,0,16,10,51,0,57,48,20,0,0,1,0,26,2,27,1,1,0,26,109,0,0,0,1,8,58,109,97, -116,50,120,51,0,18,109,0,16,8,48,0,57,54,0,18,109,0,16,10,49,0,57,54,0,0,0,0,1,0,28,2,27,1,1,0,28, -109,0,0,0,1,8,58,109,97,116,50,120,52,0,18,109,0,16,8,48,0,57,54,0,18,109,0,16,10,49,0,57,54,0,0,0, -0,1,0,27,2,27,1,1,0,27,109,0,0,0,1,8,58,109,97,116,51,120,50,0,18,109,0,16,8,48,0,57,54,0,18,109,0, -16,10,49,0,57,54,0,18,109,0,16,10,50,0,57,54,0,0,0,0,1,0,30,2,27,1,1,0,30,109,0,0,0,1,8,58,109,97, -116,51,120,52,0,18,109,0,16,8,48,0,57,54,0,18,109,0,16,10,49,0,57,54,0,18,109,0,16,10,50,0,57,54,0, -0,0,0,1,0,29,2,27,1,1,0,29,109,0,0,0,1,8,58,109,97,116,52,120,50,0,18,109,0,16,8,48,0,57,54,0,18, -109,0,16,10,49,0,57,54,0,18,109,0,16,10,50,0,57,54,0,18,109,0,16,10,51,0,57,54,0,0,0,0,1,0,31,2,27, -1,1,0,31,109,0,0,0,1,8,58,109,97,116,52,120,51,0,18,109,0,16,8,48,0,57,54,0,18,109,0,16,10,49,0,57, -54,0,18,109,0,16,10,50,0,57,54,0,18,109,0,16,10,51,0,57,54,0,0,0,0,1,0,0,2,25,1,0,2,26,109,0,0,0,1, -9,18,109,0,16,8,48,0,57,52,0,9,18,109,0,16,10,49,0,57,52,0,0,1,0,0,2,25,1,0,2,28,109,0,0,0,1,9,18, -109,0,16,8,48,0,57,52,0,9,18,109,0,16,10,49,0,57,52,0,0,1,0,0,2,25,1,0,2,27,109,0,0,0,1,9,18,109,0, -16,8,48,0,57,52,0,9,18,109,0,16,10,49,0,57,52,0,9,18,109,0,16,10,50,0,57,52,0,0,1,0,0,2,25,1,0,2, -30,109,0,0,0,1,9,18,109,0,16,8,48,0,57,52,0,9,18,109,0,16,10,49,0,57,52,0,9,18,109,0,16,10,50,0,57, -52,0,0,1,0,0,2,25,1,0,2,29,109,0,0,0,1,9,18,109,0,16,8,48,0,57,52,0,9,18,109,0,16,10,49,0,57,52,0, -9,18,109,0,16,10,50,0,57,52,0,9,18,109,0,16,10,51,0,57,52,0,0,1,0,0,2,25,1,0,2,31,109,0,0,0,1,9,18, -109,0,16,8,48,0,57,52,0,9,18,109,0,16,10,49,0,57,52,0,9,18,109,0,16,10,50,0,57,52,0,9,18,109,0,16, -10,51,0,57,52,0,0,1,0,0,2,24,1,0,2,26,109,0,0,0,1,9,18,109,0,16,8,48,0,57,51,0,9,18,109,0,16,10,49, -0,57,51,0,0,1,0,0,2,24,1,0,2,28,109,0,0,0,1,9,18,109,0,16,8,48,0,57,51,0,9,18,109,0,16,10,49,0,57, -51,0,0,1,0,0,2,24,1,0,2,27,109,0,0,0,1,9,18,109,0,16,8,48,0,57,51,0,9,18,109,0,16,10,49,0,57,51,0, -9,18,109,0,16,10,50,0,57,51,0,0,1,0,0,2,24,1,0,2,30,109,0,0,0,1,9,18,109,0,16,8,48,0,57,51,0,9,18, -109,0,16,10,49,0,57,51,0,9,18,109,0,16,10,50,0,57,51,0,0,1,0,0,2,24,1,0,2,29,109,0,0,0,1,9,18,109, -0,16,8,48,0,57,51,0,9,18,109,0,16,10,49,0,57,51,0,9,18,109,0,16,10,50,0,57,51,0,9,18,109,0,16,10, -51,0,57,51,0,0,1,0,0,2,24,1,0,2,31,109,0,0,0,1,9,18,109,0,16,8,48,0,57,51,0,9,18,109,0,16,10,49,0, +57,18,109,0,16,10,49,0,57,18,105,110,118,0,48,20,0,0,1,0,0,27,2,22,1,1,0,9,97,0,0,1,1,0,27,110,0,0, +0,1,3,2,1,0,9,1,105,110,118,0,2,17,49,0,48,0,0,18,97,0,49,0,0,9,18,95,95,114,101,116,86,97,108,0, +16,8,48,0,57,18,105,110,118,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16, +10,49,0,57,18,105,110,118,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16, +10,50,0,57,18,105,110,118,0,18,110,0,16,10,50,0,57,48,20,0,0,1,0,0,27,2,22,1,1,0,27,109,0,0,1,1,0, +9,98,0,0,0,1,3,2,1,0,9,1,105,110,118,0,2,17,49,0,48,0,0,18,98,0,49,0,0,9,18,95,95,114,101,116,86, +97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,105,110,118,0,48,20,0,9,18,95,95,114,101,116,86,97, +108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,105,110,118,0,48,20,0,9,18,95,95,114,101,116,86,97, +108,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,105,110,118,0,48,20,0,0,1,0,0,30,2,22,1,1,0,9,97,0,0, +1,1,0,30,110,0,0,0,1,3,2,1,0,9,1,105,110,118,0,2,17,49,0,48,0,0,18,97,0,49,0,0,9,18,95,95,114,101, +116,86,97,108,0,16,8,48,0,57,18,105,110,118,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116, +86,97,108,0,16,10,49,0,57,18,105,110,118,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101,116, +86,97,108,0,16,10,50,0,57,18,105,110,118,0,18,110,0,16,10,50,0,57,48,20,0,0,1,0,0,30,2,22,1,1,0,30, +109,0,0,1,1,0,9,98,0,0,0,1,3,2,1,0,9,1,105,110,118,0,2,17,49,0,48,0,0,18,98,0,49,0,0,9,18,95,95, +114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,105,110,118,0,48,20,0,9,18,95,95,114, +101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,105,110,118,0,48,20,0,9,18,95,95,114, +101,116,86,97,108,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,105,110,118,0,48,20,0,0,1,0,0,29,2,22, +1,1,0,29,109,0,0,1,1,0,9,98,0,0,0,1,3,2,1,0,9,1,105,110,118,0,2,17,49,0,48,0,0,18,98,0,49,0,0,9,18, +95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,105,110,118,0,48,20,0,9,18,95, +95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,105,110,118,0,48,20,0,9,18,95, +95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,105,110,118,0,48,20,0,9,18,95, +95,114,101,116,86,97,108,0,16,10,51,0,57,18,109,0,16,10,51,0,57,18,105,110,118,0,48,20,0,0,1,0,0, +29,2,22,1,1,0,9,97,0,0,1,1,0,29,110,0,0,0,1,3,2,1,0,9,1,105,110,118,0,2,17,49,0,48,0,0,18,97,0,49, +0,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,105,110,118,0,18,110,0,16,8,48,0,57,48,20,0, +9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,105,110,118,0,18,110,0,16,10,49,0,57,48,20,0,9, +18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,105,110,118,0,18,110,0,16,10,50,0,57,48,20,0,9, +18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,105,110,118,0,18,110,0,16,10,51,0,57,48,20,0,0,1, +0,0,31,2,22,1,1,0,31,109,0,0,1,1,0,9,98,0,0,0,1,3,2,1,0,9,1,105,110,118,0,2,17,49,0,48,0,0,18,98,0, +49,0,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,105,110,118,0,48, +20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,105,110,118,0,48, +20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,105,110,118,0,48, +20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,109,0,16,10,51,0,57,18,105,110,118,0,48, +20,0,0,1,0,0,31,2,22,1,1,0,9,97,0,0,1,1,0,31,110,0,0,0,1,3,2,1,0,9,1,105,110,118,0,2,17,49,0,48,0, +0,18,97,0,49,0,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,105,110,118,0,18,110,0,16,8,48, +0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,105,110,118,0,18,110,0,16,10,49,0, +57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,105,110,118,0,18,110,0,16,10,50,0, +57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,105,110,118,0,18,110,0,16,10,51,0, +57,48,20,0,0,1,0,0,26,2,27,1,1,0,26,109,0,0,0,1,8,58,109,97,116,50,120,51,0,18,109,0,16,8,48,0,57, +54,0,18,109,0,16,10,49,0,57,54,0,0,0,0,1,0,0,28,2,27,1,1,0,28,109,0,0,0,1,8,58,109,97,116,50,120, +52,0,18,109,0,16,8,48,0,57,54,0,18,109,0,16,10,49,0,57,54,0,0,0,0,1,0,0,27,2,27,1,1,0,27,109,0,0,0, +1,8,58,109,97,116,51,120,50,0,18,109,0,16,8,48,0,57,54,0,18,109,0,16,10,49,0,57,54,0,18,109,0,16, +10,50,0,57,54,0,0,0,0,1,0,0,30,2,27,1,1,0,30,109,0,0,0,1,8,58,109,97,116,51,120,52,0,18,109,0,16,8, +48,0,57,54,0,18,109,0,16,10,49,0,57,54,0,18,109,0,16,10,50,0,57,54,0,0,0,0,1,0,0,29,2,27,1,1,0,29, +109,0,0,0,1,8,58,109,97,116,52,120,50,0,18,109,0,16,8,48,0,57,54,0,18,109,0,16,10,49,0,57,54,0,18, +109,0,16,10,50,0,57,54,0,18,109,0,16,10,51,0,57,54,0,0,0,0,1,0,0,31,2,27,1,1,0,31,109,0,0,0,1,8,58, +109,97,116,52,120,51,0,18,109,0,16,8,48,0,57,54,0,18,109,0,16,10,49,0,57,54,0,18,109,0,16,10,50,0, +57,54,0,18,109,0,16,10,51,0,57,54,0,0,0,0,1,0,0,0,2,25,1,0,2,26,109,0,0,0,1,9,18,109,0,16,8,48,0, +57,52,0,9,18,109,0,16,10,49,0,57,52,0,0,1,0,0,0,2,25,1,0,2,28,109,0,0,0,1,9,18,109,0,16,8,48,0,57, +52,0,9,18,109,0,16,10,49,0,57,52,0,0,1,0,0,0,2,25,1,0,2,27,109,0,0,0,1,9,18,109,0,16,8,48,0,57,52, +0,9,18,109,0,16,10,49,0,57,52,0,9,18,109,0,16,10,50,0,57,52,0,0,1,0,0,0,2,25,1,0,2,30,109,0,0,0,1, +9,18,109,0,16,8,48,0,57,52,0,9,18,109,0,16,10,49,0,57,52,0,9,18,109,0,16,10,50,0,57,52,0,0,1,0,0,0, +2,25,1,0,2,29,109,0,0,0,1,9,18,109,0,16,8,48,0,57,52,0,9,18,109,0,16,10,49,0,57,52,0,9,18,109,0,16, +10,50,0,57,52,0,9,18,109,0,16,10,51,0,57,52,0,0,1,0,0,0,2,25,1,0,2,31,109,0,0,0,1,9,18,109,0,16,8, +48,0,57,52,0,9,18,109,0,16,10,49,0,57,52,0,9,18,109,0,16,10,50,0,57,52,0,9,18,109,0,16,10,51,0,57, +52,0,0,1,0,0,0,2,24,1,0,2,26,109,0,0,0,1,9,18,109,0,16,8,48,0,57,51,0,9,18,109,0,16,10,49,0,57,51, +0,0,1,0,0,0,2,24,1,0,2,28,109,0,0,0,1,9,18,109,0,16,8,48,0,57,51,0,9,18,109,0,16,10,49,0,57,51,0,0, +1,0,0,0,2,24,1,0,2,27,109,0,0,0,1,9,18,109,0,16,8,48,0,57,51,0,9,18,109,0,16,10,49,0,57,51,0,9,18, +109,0,16,10,50,0,57,51,0,0,1,0,0,0,2,24,1,0,2,30,109,0,0,0,1,9,18,109,0,16,8,48,0,57,51,0,9,18,109, +0,16,10,49,0,57,51,0,9,18,109,0,16,10,50,0,57,51,0,0,1,0,0,0,2,24,1,0,2,29,109,0,0,0,1,9,18,109,0, +16,8,48,0,57,51,0,9,18,109,0,16,10,49,0,57,51,0,9,18,109,0,16,10,50,0,57,51,0,9,18,109,0,16,10,51, +0,57,51,0,0,1,0,0,0,2,24,1,0,2,31,109,0,0,0,1,9,18,109,0,16,8,48,0,57,51,0,9,18,109,0,16,10,49,0, 57,51,0,9,18,109,0,16,10,50,0,57,51,0,9,18,109,0,16,10,51,0,57,51,0,0,0 diff --git a/src/mesa/shader/slang/library/slang_builtin_120_common_gc.h b/src/mesa/shader/slang/library/slang_builtin_120_common_gc.h index fc1a944217..94ff0e74cf 100644 --- a/src/mesa/shader/slang/library/slang_builtin_120_common_gc.h +++ b/src/mesa/shader/slang/library/slang_builtin_120_common_gc.h @@ -2,103 +2,103 @@ /* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED FROM THE FOLLOWING FILE: */ /* slang_builtin_120_common.gc */ -3,1,0,26,0,109,97,116,114,105,120,67,111,109,112,77,117,108,116,0,1,0,0,26,109,0,0,1,0,0,26,110,0, -0,0,1,8,58,109,97,116,50,120,51,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,48,0,18,109,0,16,10, -49,0,57,18,110,0,16,10,49,0,57,48,0,0,0,0,1,0,28,0,109,97,116,114,105,120,67,111,109,112,77,117, -108,116,0,1,0,0,28,109,0,0,1,0,0,28,110,0,0,0,1,8,58,109,97,116,50,120,52,0,18,109,0,16,8,48,0,57, -18,110,0,16,8,48,0,57,48,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,48,0,0,0,0,1,0,27,0,109, -97,116,114,105,120,67,111,109,112,77,117,108,116,0,1,0,0,27,109,0,0,1,0,0,27,110,0,0,0,1,8,58,109, -97,116,51,120,50,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,48,0,18,109,0,16,10,49,0,57,18,110, -0,16,10,49,0,57,48,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,48,0,0,0,0,1,0,30,0,109,97,116, -114,105,120,67,111,109,112,77,117,108,116,0,1,0,0,30,109,0,0,1,0,0,30,110,0,0,0,1,8,58,109,97,116, -51,120,52,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,48,0,18,109,0,16,10,49,0,57,18,110,0,16,10, -49,0,57,48,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,48,0,0,0,0,1,0,29,0,109,97,116,114,105, -120,67,111,109,112,77,117,108,116,0,1,0,0,29,109,0,0,1,0,0,29,110,0,0,0,1,8,58,109,97,116,52,120, -50,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,48,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0, -57,48,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,48,0,18,109,0,16,10,51,0,57,18,110,0,16,10, -51,0,57,48,0,0,0,0,1,0,31,0,109,97,116,114,105,120,67,111,109,112,77,117,108,116,0,1,0,0,31,109,0, -0,1,0,0,31,110,0,0,0,1,8,58,109,97,116,52,120,51,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,48, -0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,48,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57, -48,0,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,48,0,0,0,0,1,0,13,0,111,117,116,101,114,80,114, -111,100,117,99,116,0,1,0,0,10,99,0,0,1,0,0,10,114,0,0,0,1,8,58,109,97,116,50,0,18,99,0,59,120,0,18, -114,0,59,120,0,48,0,18,99,0,59,121,0,18,114,0,59,120,0,48,0,18,99,0,59,120,0,18,114,0,59,121,0,48, -0,18,99,0,59,121,0,18,114,0,59,121,0,48,0,0,0,0,1,0,14,0,111,117,116,101,114,80,114,111,100,117,99, -116,0,1,0,0,11,99,0,0,1,0,0,11,114,0,0,0,1,8,58,109,97,116,51,0,18,99,0,59,120,0,18,114,0,59,120,0, +4,1,0,0,26,0,109,97,116,114,105,120,67,111,109,112,77,117,108,116,0,1,0,0,26,109,0,0,1,0,0,26,110, +0,0,0,1,8,58,109,97,116,50,120,51,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,48,0,18,109,0,16, +10,49,0,57,18,110,0,16,10,49,0,57,48,0,0,0,0,1,0,0,28,0,109,97,116,114,105,120,67,111,109,112,77, +117,108,116,0,1,0,0,28,109,0,0,1,0,0,28,110,0,0,0,1,8,58,109,97,116,50,120,52,0,18,109,0,16,8,48,0, +57,18,110,0,16,8,48,0,57,48,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,48,0,0,0,0,1,0,0,27,0, +109,97,116,114,105,120,67,111,109,112,77,117,108,116,0,1,0,0,27,109,0,0,1,0,0,27,110,0,0,0,1,8,58, +109,97,116,51,120,50,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,48,0,18,109,0,16,10,49,0,57,18, +110,0,16,10,49,0,57,48,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,48,0,0,0,0,1,0,0,30,0,109, +97,116,114,105,120,67,111,109,112,77,117,108,116,0,1,0,0,30,109,0,0,1,0,0,30,110,0,0,0,1,8,58,109, +97,116,51,120,52,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,48,0,18,109,0,16,10,49,0,57,18,110, +0,16,10,49,0,57,48,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,48,0,0,0,0,1,0,0,29,0,109,97, +116,114,105,120,67,111,109,112,77,117,108,116,0,1,0,0,29,109,0,0,1,0,0,29,110,0,0,0,1,8,58,109,97, +116,52,120,50,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,48,0,18,109,0,16,10,49,0,57,18,110,0, +16,10,49,0,57,48,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,48,0,18,109,0,16,10,51,0,57,18, +110,0,16,10,51,0,57,48,0,0,0,0,1,0,0,31,0,109,97,116,114,105,120,67,111,109,112,77,117,108,116,0,1, +0,0,31,109,0,0,1,0,0,31,110,0,0,0,1,8,58,109,97,116,52,120,51,0,18,109,0,16,8,48,0,57,18,110,0,16, +8,48,0,57,48,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,48,0,18,109,0,16,10,50,0,57,18,110,0, +16,10,50,0,57,48,0,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,48,0,0,0,0,1,0,0,13,0,111,117,116, +101,114,80,114,111,100,117,99,116,0,1,0,0,10,99,0,0,1,0,0,10,114,0,0,0,1,8,58,109,97,116,50,0,18, +99,0,59,120,0,18,114,0,59,120,0,48,0,18,99,0,59,121,0,18,114,0,59,120,0,48,0,18,99,0,59,120,0,18, +114,0,59,121,0,48,0,18,99,0,59,121,0,18,114,0,59,121,0,48,0,0,0,0,1,0,0,14,0,111,117,116,101,114, +80,114,111,100,117,99,116,0,1,0,0,11,99,0,0,1,0,0,11,114,0,0,0,1,8,58,109,97,116,51,0,18,99,0,59, +120,0,18,114,0,59,120,0,48,0,18,99,0,59,121,0,18,114,0,59,120,0,48,0,18,99,0,59,122,0,18,114,0,59, +120,0,48,0,18,99,0,59,120,0,18,114,0,59,121,0,48,0,18,99,0,59,121,0,18,114,0,59,121,0,48,0,18,99,0, +59,122,0,18,114,0,59,121,0,48,0,18,99,0,59,120,0,18,114,0,59,122,0,48,0,18,99,0,59,121,0,18,114,0, +59,122,0,48,0,18,99,0,59,122,0,18,114,0,59,122,0,48,0,0,0,0,1,0,0,15,0,111,117,116,101,114,80,114, +111,100,117,99,116,0,1,0,0,12,99,0,0,1,0,0,12,114,0,0,0,1,8,58,109,97,116,52,0,18,99,0,59,120,0,18, +114,0,59,120,0,48,0,18,99,0,59,121,0,18,114,0,59,120,0,48,0,18,99,0,59,122,0,18,114,0,59,120,0,48, +0,18,99,0,59,119,0,18,114,0,59,120,0,48,0,18,99,0,59,120,0,18,114,0,59,121,0,48,0,18,99,0,59,121,0, +18,114,0,59,121,0,48,0,18,99,0,59,122,0,18,114,0,59,121,0,48,0,18,99,0,59,119,0,18,114,0,59,121,0, +48,0,18,99,0,59,120,0,18,114,0,59,122,0,48,0,18,99,0,59,121,0,18,114,0,59,122,0,48,0,18,99,0,59, +122,0,18,114,0,59,122,0,48,0,18,99,0,59,119,0,18,114,0,59,122,0,48,0,18,99,0,59,120,0,18,114,0,59, +119,0,48,0,18,99,0,59,121,0,18,114,0,59,119,0,48,0,18,99,0,59,122,0,18,114,0,59,119,0,48,0,18,99,0, +59,119,0,18,114,0,59,119,0,48,0,0,0,0,1,0,0,26,0,111,117,116,101,114,80,114,111,100,117,99,116,0,1, +0,0,11,99,0,0,1,0,0,10,114,0,0,0,1,8,58,109,97,116,50,120,51,0,18,99,0,59,120,0,18,114,0,59,120,0, 48,0,18,99,0,59,121,0,18,114,0,59,120,0,48,0,18,99,0,59,122,0,18,114,0,59,120,0,48,0,18,99,0,59, 120,0,18,114,0,59,121,0,48,0,18,99,0,59,121,0,18,114,0,59,121,0,48,0,18,99,0,59,122,0,18,114,0,59, -121,0,48,0,18,99,0,59,120,0,18,114,0,59,122,0,48,0,18,99,0,59,121,0,18,114,0,59,122,0,48,0,18,99,0, -59,122,0,18,114,0,59,122,0,48,0,0,0,0,1,0,15,0,111,117,116,101,114,80,114,111,100,117,99,116,0,1,0, -0,12,99,0,0,1,0,0,12,114,0,0,0,1,8,58,109,97,116,52,0,18,99,0,59,120,0,18,114,0,59,120,0,48,0,18, -99,0,59,121,0,18,114,0,59,120,0,48,0,18,99,0,59,122,0,18,114,0,59,120,0,48,0,18,99,0,59,119,0,18, -114,0,59,120,0,48,0,18,99,0,59,120,0,18,114,0,59,121,0,48,0,18,99,0,59,121,0,18,114,0,59,121,0,48, -0,18,99,0,59,122,0,18,114,0,59,121,0,48,0,18,99,0,59,119,0,18,114,0,59,121,0,48,0,18,99,0,59,120,0, -18,114,0,59,122,0,48,0,18,99,0,59,121,0,18,114,0,59,122,0,48,0,18,99,0,59,122,0,18,114,0,59,122,0, -48,0,18,99,0,59,119,0,18,114,0,59,122,0,48,0,18,99,0,59,120,0,18,114,0,59,119,0,48,0,18,99,0,59, -121,0,18,114,0,59,119,0,48,0,18,99,0,59,122,0,18,114,0,59,119,0,48,0,18,99,0,59,119,0,18,114,0,59, -119,0,48,0,0,0,0,1,0,26,0,111,117,116,101,114,80,114,111,100,117,99,116,0,1,0,0,11,99,0,0,1,0,0,10, -114,0,0,0,1,8,58,109,97,116,50,120,51,0,18,99,0,59,120,0,18,114,0,59,120,0,48,0,18,99,0,59,121,0, -18,114,0,59,120,0,48,0,18,99,0,59,122,0,18,114,0,59,120,0,48,0,18,99,0,59,120,0,18,114,0,59,121,0, -48,0,18,99,0,59,121,0,18,114,0,59,121,0,48,0,18,99,0,59,122,0,18,114,0,59,121,0,48,0,0,0,0,1,0,27, -0,111,117,116,101,114,80,114,111,100,117,99,116,0,1,0,0,10,99,0,0,1,0,0,11,114,0,0,0,1,8,58,109,97, -116,51,120,50,0,18,99,0,59,120,0,18,114,0,59,120,0,48,0,18,99,0,59,121,0,18,114,0,59,120,0,48,0,18, -99,0,59,120,0,18,114,0,59,121,0,48,0,18,99,0,59,121,0,18,114,0,59,121,0,48,0,18,99,0,59,120,0,18, -114,0,59,122,0,48,0,18,99,0,59,121,0,18,114,0,59,122,0,48,0,0,0,0,1,0,28,0,111,117,116,101,114,80, -114,111,100,117,99,116,0,1,0,0,12,99,0,0,1,0,0,10,114,0,0,0,1,8,58,109,97,116,50,120,52,0,18,99,0, -59,120,0,18,114,0,59,120,0,48,0,18,99,0,59,121,0,18,114,0,59,120,0,48,0,18,99,0,59,122,0,18,114,0, -59,120,0,48,0,18,99,0,59,119,0,18,114,0,59,120,0,48,0,18,99,0,59,120,0,18,114,0,59,121,0,48,0,18, -99,0,59,121,0,18,114,0,59,121,0,48,0,18,99,0,59,122,0,18,114,0,59,121,0,48,0,18,99,0,59,119,0,18, -114,0,59,121,0,48,0,0,0,0,1,0,29,0,111,117,116,101,114,80,114,111,100,117,99,116,0,1,0,0,10,99,0,0, -1,0,0,12,114,0,0,0,1,8,58,109,97,116,52,120,50,0,18,99,0,59,120,0,18,114,0,59,120,0,48,0,18,99,0, -59,121,0,18,114,0,59,120,0,48,0,18,99,0,59,120,0,18,114,0,59,121,0,48,0,18,99,0,59,121,0,18,114,0, -59,121,0,48,0,18,99,0,59,120,0,18,114,0,59,122,0,48,0,18,99,0,59,121,0,18,114,0,59,122,0,48,0,18, -99,0,59,120,0,18,114,0,59,119,0,48,0,18,99,0,59,121,0,18,114,0,59,119,0,48,0,0,0,0,1,0,30,0,111, -117,116,101,114,80,114,111,100,117,99,116,0,1,0,0,12,99,0,0,1,0,0,11,114,0,0,0,1,8,58,109,97,116, -51,120,52,0,18,99,0,59,120,0,18,114,0,59,120,0,48,0,18,99,0,59,121,0,18,114,0,59,120,0,48,0,18,99, -0,59,122,0,18,114,0,59,120,0,48,0,18,99,0,59,119,0,18,114,0,59,120,0,48,0,18,99,0,59,120,0,18,114, -0,59,121,0,48,0,18,99,0,59,121,0,18,114,0,59,121,0,48,0,18,99,0,59,122,0,18,114,0,59,121,0,48,0,18, -99,0,59,119,0,18,114,0,59,121,0,48,0,18,99,0,59,120,0,18,114,0,59,122,0,48,0,18,99,0,59,121,0,18, -114,0,59,122,0,48,0,18,99,0,59,122,0,18,114,0,59,122,0,48,0,18,99,0,59,119,0,18,114,0,59,122,0,48, -0,0,0,0,1,0,31,0,111,117,116,101,114,80,114,111,100,117,99,116,0,1,0,0,11,99,0,0,1,0,0,12,114,0,0, -0,1,8,58,109,97,116,52,120,51,0,18,99,0,59,120,0,18,114,0,59,120,0,48,0,18,99,0,59,121,0,18,114,0, -59,120,0,48,0,18,99,0,59,122,0,18,114,0,59,120,0,48,0,18,99,0,59,120,0,18,114,0,59,121,0,48,0,18, -99,0,59,121,0,18,114,0,59,121,0,48,0,18,99,0,59,122,0,18,114,0,59,121,0,48,0,18,99,0,59,120,0,18, -114,0,59,122,0,48,0,18,99,0,59,121,0,18,114,0,59,122,0,48,0,18,99,0,59,122,0,18,114,0,59,122,0,48, -0,18,99,0,59,120,0,18,114,0,59,119,0,48,0,18,99,0,59,121,0,18,114,0,59,119,0,48,0,18,99,0,59,122,0, -18,114,0,59,119,0,48,0,0,0,0,1,0,13,0,116,114,97,110,115,112,111,115,101,0,1,0,0,13,109,0,0,0,1,8, -58,109,97,116,50,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16, -8,48,0,57,59,121,0,0,18,109,0,16,10,49,0,57,59,121,0,0,0,0,0,1,0,14,0,116,114,97,110,115,112,111, -115,101,0,1,0,0,14,109,0,0,0,1,8,58,109,97,116,51,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16, -10,49,0,57,59,120,0,0,18,109,0,16,10,50,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,18,109,0, -16,10,49,0,57,59,121,0,0,18,109,0,16,10,50,0,57,59,121,0,0,18,109,0,16,8,48,0,57,59,122,0,0,18,109, -0,16,10,49,0,57,59,122,0,0,18,109,0,16,10,50,0,57,59,122,0,0,0,0,0,1,0,15,0,116,114,97,110,115,112, -111,115,101,0,1,0,0,15,109,0,0,0,1,8,58,109,97,116,52,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0, -16,10,49,0,57,59,120,0,0,18,109,0,16,10,50,0,57,59,120,0,0,18,109,0,16,10,51,0,57,59,120,0,0,18, -109,0,16,8,48,0,57,59,121,0,0,18,109,0,16,10,49,0,57,59,121,0,0,18,109,0,16,10,50,0,57,59,121,0,0, -18,109,0,16,10,51,0,57,59,121,0,0,18,109,0,16,8,48,0,57,59,122,0,0,18,109,0,16,10,49,0,57,59,122,0, -0,18,109,0,16,10,50,0,57,59,122,0,0,18,109,0,16,10,51,0,57,59,122,0,0,18,109,0,16,8,48,0,57,59,119, -0,0,18,109,0,16,10,49,0,57,59,119,0,0,18,109,0,16,10,50,0,57,59,119,0,0,18,109,0,16,10,51,0,57,59, -119,0,0,0,0,0,1,0,26,0,116,114,97,110,115,112,111,115,101,0,1,0,0,27,109,0,0,0,1,8,58,109,97,116, -50,120,51,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16,10,50,0, -57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,18,109,0,16,10,49,0,57,59,121,0,0,18,109,0,16,10,50, -0,57,59,121,0,0,0,0,0,1,0,27,0,116,114,97,110,115,112,111,115,101,0,1,0,0,26,109,0,0,0,1,8,58,109, -97,116,51,120,50,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16, -8,48,0,57,59,121,0,0,18,109,0,16,10,49,0,57,59,121,0,0,18,109,0,16,8,48,0,57,59,122,0,0,18,109,0, -16,10,49,0,57,59,122,0,0,0,0,0,1,0,28,0,116,114,97,110,115,112,111,115,101,0,1,0,0,29,109,0,0,0,1, -8,58,109,97,116,50,120,52,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18, -109,0,16,10,50,0,57,59,120,0,0,18,109,0,16,10,51,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0, -18,109,0,16,10,49,0,57,59,121,0,0,18,109,0,16,10,50,0,57,59,121,0,0,18,109,0,16,10,51,0,57,59,121, -0,0,0,0,0,1,0,29,0,116,114,97,110,115,112,111,115,101,0,1,0,0,28,109,0,0,0,1,8,58,109,97,116,52, -120,50,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16,8,48,0,57, -59,121,0,0,18,109,0,16,10,49,0,57,59,121,0,0,18,109,0,16,8,48,0,57,59,122,0,0,18,109,0,16,10,49,0, -57,59,122,0,0,18,109,0,16,8,48,0,57,59,119,0,0,18,109,0,16,10,49,0,57,59,119,0,0,0,0,0,1,0,30,0, -116,114,97,110,115,112,111,115,101,0,1,0,0,31,109,0,0,0,1,8,58,109,97,116,51,120,52,0,18,109,0,16, +121,0,48,0,0,0,0,1,0,0,27,0,111,117,116,101,114,80,114,111,100,117,99,116,0,1,0,0,10,99,0,0,1,0,0, +11,114,0,0,0,1,8,58,109,97,116,51,120,50,0,18,99,0,59,120,0,18,114,0,59,120,0,48,0,18,99,0,59,121, +0,18,114,0,59,120,0,48,0,18,99,0,59,120,0,18,114,0,59,121,0,48,0,18,99,0,59,121,0,18,114,0,59,121, +0,48,0,18,99,0,59,120,0,18,114,0,59,122,0,48,0,18,99,0,59,121,0,18,114,0,59,122,0,48,0,0,0,0,1,0,0, +28,0,111,117,116,101,114,80,114,111,100,117,99,116,0,1,0,0,12,99,0,0,1,0,0,10,114,0,0,0,1,8,58,109, +97,116,50,120,52,0,18,99,0,59,120,0,18,114,0,59,120,0,48,0,18,99,0,59,121,0,18,114,0,59,120,0,48,0, +18,99,0,59,122,0,18,114,0,59,120,0,48,0,18,99,0,59,119,0,18,114,0,59,120,0,48,0,18,99,0,59,120,0, +18,114,0,59,121,0,48,0,18,99,0,59,121,0,18,114,0,59,121,0,48,0,18,99,0,59,122,0,18,114,0,59,121,0, +48,0,18,99,0,59,119,0,18,114,0,59,121,0,48,0,0,0,0,1,0,0,29,0,111,117,116,101,114,80,114,111,100, +117,99,116,0,1,0,0,10,99,0,0,1,0,0,12,114,0,0,0,1,8,58,109,97,116,52,120,50,0,18,99,0,59,120,0,18, +114,0,59,120,0,48,0,18,99,0,59,121,0,18,114,0,59,120,0,48,0,18,99,0,59,120,0,18,114,0,59,121,0,48, +0,18,99,0,59,121,0,18,114,0,59,121,0,48,0,18,99,0,59,120,0,18,114,0,59,122,0,48,0,18,99,0,59,121,0, +18,114,0,59,122,0,48,0,18,99,0,59,120,0,18,114,0,59,119,0,48,0,18,99,0,59,121,0,18,114,0,59,119,0, +48,0,0,0,0,1,0,0,30,0,111,117,116,101,114,80,114,111,100,117,99,116,0,1,0,0,12,99,0,0,1,0,0,11,114, +0,0,0,1,8,58,109,97,116,51,120,52,0,18,99,0,59,120,0,18,114,0,59,120,0,48,0,18,99,0,59,121,0,18, +114,0,59,120,0,48,0,18,99,0,59,122,0,18,114,0,59,120,0,48,0,18,99,0,59,119,0,18,114,0,59,120,0,48, +0,18,99,0,59,120,0,18,114,0,59,121,0,48,0,18,99,0,59,121,0,18,114,0,59,121,0,48,0,18,99,0,59,122,0, +18,114,0,59,121,0,48,0,18,99,0,59,119,0,18,114,0,59,121,0,48,0,18,99,0,59,120,0,18,114,0,59,122,0, +48,0,18,99,0,59,121,0,18,114,0,59,122,0,48,0,18,99,0,59,122,0,18,114,0,59,122,0,48,0,18,99,0,59, +119,0,18,114,0,59,122,0,48,0,0,0,0,1,0,0,31,0,111,117,116,101,114,80,114,111,100,117,99,116,0,1,0, +0,11,99,0,0,1,0,0,12,114,0,0,0,1,8,58,109,97,116,52,120,51,0,18,99,0,59,120,0,18,114,0,59,120,0,48, +0,18,99,0,59,121,0,18,114,0,59,120,0,48,0,18,99,0,59,122,0,18,114,0,59,120,0,48,0,18,99,0,59,120,0, +18,114,0,59,121,0,48,0,18,99,0,59,121,0,18,114,0,59,121,0,48,0,18,99,0,59,122,0,18,114,0,59,121,0, +48,0,18,99,0,59,120,0,18,114,0,59,122,0,48,0,18,99,0,59,121,0,18,114,0,59,122,0,48,0,18,99,0,59, +122,0,18,114,0,59,122,0,48,0,18,99,0,59,120,0,18,114,0,59,119,0,48,0,18,99,0,59,121,0,18,114,0,59, +119,0,48,0,18,99,0,59,122,0,18,114,0,59,119,0,48,0,0,0,0,1,0,0,13,0,116,114,97,110,115,112,111,115, +101,0,1,0,0,13,109,0,0,0,1,8,58,109,97,116,50,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,10,49, +0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,18,109,0,16,10,49,0,57,59,121,0,0,0,0,0,1,0,0,14, +0,116,114,97,110,115,112,111,115,101,0,1,0,0,14,109,0,0,0,1,8,58,109,97,116,51,0,18,109,0,16,8,48, +0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16,10,50,0,57,59,120,0,0,18,109,0,16,8, +48,0,57,59,121,0,0,18,109,0,16,10,49,0,57,59,121,0,0,18,109,0,16,10,50,0,57,59,121,0,0,18,109,0,16, +8,48,0,57,59,122,0,0,18,109,0,16,10,49,0,57,59,122,0,0,18,109,0,16,10,50,0,57,59,122,0,0,0,0,0,1,0, +0,15,0,116,114,97,110,115,112,111,115,101,0,1,0,0,15,109,0,0,0,1,8,58,109,97,116,52,0,18,109,0,16, 8,48,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16,10,50,0,57,59,120,0,0,18,109,0, 16,10,51,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,18,109,0,16,10,49,0,57,59,121,0,0,18,109, 0,16,10,50,0,57,59,121,0,0,18,109,0,16,10,51,0,57,59,121,0,0,18,109,0,16,8,48,0,57,59,122,0,0,18, 109,0,16,10,49,0,57,59,122,0,0,18,109,0,16,10,50,0,57,59,122,0,0,18,109,0,16,10,51,0,57,59,122,0,0, -0,0,0,1,0,31,0,116,114,97,110,115,112,111,115,101,0,1,0,0,30,109,0,0,0,1,8,58,109,97,116,52,120,51, -0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16,10,50,0,57,59,120, -0,0,18,109,0,16,8,48,0,57,59,121,0,0,18,109,0,16,10,49,0,57,59,121,0,0,18,109,0,16,10,50,0,57,59, -121,0,0,18,109,0,16,8,48,0,57,59,122,0,0,18,109,0,16,10,49,0,57,59,122,0,0,18,109,0,16,10,50,0,57, -59,122,0,0,18,109,0,16,8,48,0,57,59,119,0,0,18,109,0,16,10,49,0,57,59,119,0,0,18,109,0,16,10,50,0, -57,59,119,0,0,0,0,0,0 +18,109,0,16,8,48,0,57,59,119,0,0,18,109,0,16,10,49,0,57,59,119,0,0,18,109,0,16,10,50,0,57,59,119,0, +0,18,109,0,16,10,51,0,57,59,119,0,0,0,0,0,1,0,0,26,0,116,114,97,110,115,112,111,115,101,0,1,0,0,27, +109,0,0,0,1,8,58,109,97,116,50,120,51,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59, +120,0,0,18,109,0,16,10,50,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,18,109,0,16,10,49,0,57, +59,121,0,0,18,109,0,16,10,50,0,57,59,121,0,0,0,0,0,1,0,0,27,0,116,114,97,110,115,112,111,115,101,0, +1,0,0,26,109,0,0,0,1,8,58,109,97,116,51,120,50,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,10, +49,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,18,109,0,16,10,49,0,57,59,121,0,0,18,109,0,16, +8,48,0,57,59,122,0,0,18,109,0,16,10,49,0,57,59,122,0,0,0,0,0,1,0,0,28,0,116,114,97,110,115,112,111, +115,101,0,1,0,0,29,109,0,0,0,1,8,58,109,97,116,50,120,52,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109, +0,16,10,49,0,57,59,120,0,0,18,109,0,16,10,50,0,57,59,120,0,0,18,109,0,16,10,51,0,57,59,120,0,0,18, +109,0,16,8,48,0,57,59,121,0,0,18,109,0,16,10,49,0,57,59,121,0,0,18,109,0,16,10,50,0,57,59,121,0,0, +18,109,0,16,10,51,0,57,59,121,0,0,0,0,0,1,0,0,29,0,116,114,97,110,115,112,111,115,101,0,1,0,0,28, +109,0,0,0,1,8,58,109,97,116,52,120,50,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59, +120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,18,109,0,16,10,49,0,57,59,121,0,0,18,109,0,16,8,48,0,57, +59,122,0,0,18,109,0,16,10,49,0,57,59,122,0,0,18,109,0,16,8,48,0,57,59,119,0,0,18,109,0,16,10,49,0, +57,59,119,0,0,0,0,0,1,0,0,30,0,116,114,97,110,115,112,111,115,101,0,1,0,0,31,109,0,0,0,1,8,58,109, +97,116,51,120,52,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16, +10,50,0,57,59,120,0,0,18,109,0,16,10,51,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,18,109,0, +16,10,49,0,57,59,121,0,0,18,109,0,16,10,50,0,57,59,121,0,0,18,109,0,16,10,51,0,57,59,121,0,0,18, +109,0,16,8,48,0,57,59,122,0,0,18,109,0,16,10,49,0,57,59,122,0,0,18,109,0,16,10,50,0,57,59,122,0,0, +18,109,0,16,10,51,0,57,59,122,0,0,0,0,0,1,0,0,31,0,116,114,97,110,115,112,111,115,101,0,1,0,0,30, +109,0,0,0,1,8,58,109,97,116,52,120,51,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59, +120,0,0,18,109,0,16,10,50,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,18,109,0,16,10,49,0,57, +59,121,0,0,18,109,0,16,10,50,0,57,59,121,0,0,18,109,0,16,8,48,0,57,59,122,0,0,18,109,0,16,10,49,0, +57,59,122,0,0,18,109,0,16,10,50,0,57,59,122,0,0,18,109,0,16,8,48,0,57,59,119,0,0,18,109,0,16,10,49, +0,57,59,119,0,0,18,109,0,16,10,50,0,57,59,119,0,0,0,0,0,0 diff --git a/src/mesa/shader/slang/library/slang_builtin_120_fragment_gc.h b/src/mesa/shader/slang/library/slang_builtin_120_fragment_gc.h index 2400b273d8..72d86fb25d 100644 --- a/src/mesa/shader/slang/library/slang_builtin_120_fragment_gc.h +++ b/src/mesa/shader/slang/library/slang_builtin_120_fragment_gc.h @@ -2,4 +2,4 @@ /* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED FROM THE FOLLOWING FILE: */ /* slang_builtin_120_fragment.gc */ -3,2,2,3,10,1,103,108,95,80,111,105,110,116,67,111,111,114,100,0,0,0,0 +4,2,2,3,0,10,1,103,108,95,80,111,105,110,116,67,111,111,114,100,0,0,0,0 diff --git a/src/mesa/shader/slang/library/slang_common_builtin.gc b/src/mesa/shader/slang/library/slang_common_builtin.gc index 3726335471..561e94f6ba 100644 --- a/src/mesa/shader/slang/library/slang_common_builtin.gc +++ b/src/mesa/shader/slang/library/slang_common_builtin.gc @@ -171,7 +171,7 @@ uniform gl_FogParameters gl_Fog; float radians(const float deg) { const float c = 3.1415926 / 180.0; - __asm vec4_multiply __retVal.x, deg, c; + __asm vec4_multiply __retVal, deg, c; } vec2 radians(const vec2 deg) @@ -198,7 +198,7 @@ vec4 radians(const vec4 deg) float degrees(const float rad) { const float c = 180.0 / 3.1415926; - __asm vec4_multiply __retVal.x, rad, c; + __asm vec4_multiply __retVal, rad, c; } vec2 degrees(const vec2 rad) @@ -224,7 +224,7 @@ vec4 degrees(const vec4 rad) float sin(const float radians) { - __asm float_sine __retVal.x, radians; + __asm float_sine __retVal, radians; } vec2 sin(const vec2 radians) @@ -253,7 +253,7 @@ vec4 sin(const vec4 radians) float cos(const float radians) { - __asm float_cosine __retVal.x, radians; + __asm float_cosine __retVal, radians; } vec2 cos(const vec2 radians) @@ -444,7 +444,7 @@ vec4 atan(const vec4 u, const vec4 v) float pow(const float a, const float b) { - __asm float_power __retVal.x, a, b; + __asm float_power __retVal, a, b; } vec2 pow(const vec2 a, const vec2 b) @@ -473,32 +473,33 @@ vec4 pow(const vec4 a, const vec4 b) float exp(const float a) { - const float e = 2.71828; - __asm float_power __retVal, e, a; + // NOTE: log2(e) = 1.44269502 + float t = a * 1.44269502; + __asm float_exp2 __retVal, t; } vec2 exp(const vec2 a) { - const float e = 2.71828; - __asm float_power __retVal.x, e, a.x; - __asm float_power __retVal.y, e, a.y; + vec2 t = a * 1.44269502; + __asm float_exp2 __retVal.x, t.x; + __asm float_exp2 __retVal.y, t.y; } vec3 exp(const vec3 a) { - const float e = 2.71828; - __asm float_power __retVal.x, e, a.x; - __asm float_power __retVal.y, e, a.y; - __asm float_power __retVal.z, e, a.z; + vec3 t = a * 1.44269502; + __asm float_exp2 __retVal.x, t.x; + __asm float_exp2 __retVal.y, t.y; + __asm float_exp2 __retVal.z, t.z; } vec4 exp(const vec4 a) { - const float e = 2.71828; - __asm float_power __retVal.x, e, a.x; - __asm float_power __retVal.y, e, a.y; - __asm float_power __retVal.z, e, a.z; - __asm float_power __retVal.w, e, a.w; + vec4 t = a * 1.44269502; + __asm float_exp2 __retVal.x, t.x; + __asm float_exp2 __retVal.y, t.y; + __asm float_exp2 __retVal.z, t.z; + __asm float_exp2 __retVal.w, t.w; } @@ -507,7 +508,7 @@ vec4 exp(const vec4 a) float log2(const float x) { - __asm float_log2 __retVal.x, x; + __asm float_log2 __retVal, x; } vec2 log2(const vec2 v) @@ -566,7 +567,7 @@ vec4 log(const vec4 v) float exp2(const float a) { - __asm float_exp2 __retVal.x, a; + __asm float_exp2 __retVal, a; } vec2 exp2(const vec2 a) @@ -597,7 +598,7 @@ float sqrt(const float x) { float r; __asm float_rsq r, x; - __asm float_rcp __retVal.x, r; + __asm float_rcp __retVal, r; } vec2 sqrt(const vec2 v) @@ -667,13 +668,13 @@ vec4 inversesqrt(const vec4 v) float normalize(const float x) { - __retVal.x = 1.0; + __retVal = 1.0; } vec2 normalize(const vec2 v) { const float s = inversesqrt(dot(v, v)); - __asm vec4_multiply __retVal.xy, v, s.xx; + __asm vec4_multiply __retVal.xy, v, s; } vec3 normalize(const vec3 v) @@ -686,7 +687,7 @@ vec3 normalize(const vec3 v) float tmp; __asm vec3_dot tmp, v, v; __asm float_rsq tmp, tmp; - __asm vec4_multiply __retVal.xyz, v, tmp.xxx; + __asm vec4_multiply __retVal.xyz, v, tmp; } vec4 normalize(const vec4 v) @@ -694,7 +695,7 @@ vec4 normalize(const vec4 v) float tmp; __asm vec4_dot tmp, v, v; __asm float_rsq tmp, tmp; - __asm vec4_multiply __retVal.xyz, v, tmp.xxx; + __asm vec4_multiply __retVal.xyz, v, tmp; } @@ -708,7 +709,7 @@ vec4 normalize(const vec4 v) float abs(const float a) { - __asm vec4_abs __retVal.x, a; + __asm vec4_abs __retVal, a; } vec2 abs(const vec2 a) @@ -732,9 +733,9 @@ vec4 abs(const vec4 a) float sign(const float x) { float p, n; - __asm vec4_sgt p.x, x, 0.0; // p = (x > 0) - __asm vec4_sgt n.x, 0.0, x; // n = (x < 0) - __asm vec4_subtract __retVal.x, p, n; // sign = p - n + __asm vec4_sgt p, x, 0.0; // p = (x > 0) + __asm vec4_sgt n, 0.0, x; // n = (x < 0) + __asm vec4_subtract __retVal, p, n; // sign = p - n } vec2 sign(const vec2 v) @@ -766,7 +767,7 @@ vec4 sign(const vec4 v) float floor(const float a) { - __asm vec4_floor __retVal.x, a; + __asm vec4_floor __retVal, a; } vec2 floor(const vec2 a) @@ -792,7 +793,7 @@ float ceil(const float a) // XXX this could be improved float b = -a; __asm vec4_floor b, b; - __retVal.x = -b; + __retVal = -b; } vec2 ceil(const vec2 a) @@ -821,7 +822,7 @@ vec4 ceil(const vec4 a) float fract(const float a) { - __asm vec4_frac __retVal.x, a; + __asm vec4_frac __retVal, a; } vec2 fract(const vec2 a) @@ -846,7 +847,7 @@ float mod(const float a, const float b) { float oneOverB; __asm float_rcp oneOverB, b; - __retVal.x = a - b * floor(a * oneOverB); + __retVal = a - b * floor(a * oneOverB); } vec2 mod(const vec2 a, const float b) @@ -872,35 +873,29 @@ vec4 mod(const vec4 a, const float b) vec2 mod(const vec2 a, const vec2 b) { - float oneOverBx, oneOverBy; - __asm float_rcp oneOverBx, b.x; - __asm float_rcp oneOverBy, b.y; - __retVal.x = a.x - b.x * floor(a.x * oneOverBx); - __retVal.y = a.y - b.y * floor(a.y * oneOverBy); + vec2 oneOverB; + __asm float_rcp oneOverB.x, b.x; + __asm float_rcp oneOverB.y, b.y; + __retVal = a - b * floor(a * oneOverB); } vec3 mod(const vec3 a, const vec3 b) { - float oneOverBx, oneOverBy, oneOverBz; - __asm float_rcp oneOverBx, b.x; - __asm float_rcp oneOverBy, b.y; - __asm float_rcp oneOverBz, b.z; - __retVal.x = a.x - b.x * floor(a.x * oneOverBx); - __retVal.y = a.y - b.y * floor(a.y * oneOverBy); - __retVal.z = a.z - b.z * floor(a.z * oneOverBz); + vec3 oneOverB; + __asm float_rcp oneOverB.x, b.x; + __asm float_rcp oneOverB.y, b.y; + __asm float_rcp oneOverB.z, b.z; + __retVal = a - b * floor(a * oneOverB); } vec4 mod(const vec4 a, const vec4 b) { - float oneOverBx, oneOverBy, oneOverBz, oneOverBw; - __asm float_rcp oneOverBx, b.x; - __asm float_rcp oneOverBy, b.y; - __asm float_rcp oneOverBz, b.z; - __asm float_rcp oneOverBw, b.w; - __retVal.x = a.x - b.x * floor(a.x * oneOverBx); - __retVal.y = a.y - b.y * floor(a.y * oneOverBy); - __retVal.z = a.z - b.z * floor(a.z * oneOverBz); - __retVal.w = a.w - b.w * floor(a.w * oneOverBw); + vec4 oneOverB; + __asm float_rcp oneOverB.x, b.x; + __asm float_rcp oneOverB.y, b.y; + __asm float_rcp oneOverB.z, b.z; + __asm float_rcp oneOverB.w, b.w; + __retVal = a - b * floor(a * oneOverB); } @@ -908,7 +903,7 @@ vec4 mod(const vec4 a, const vec4 b) float min(const float a, const float b) { - __asm vec4_min __retVal.x, a.x, b.x; + __asm vec4_min __retVal, a, b; } vec2 min(const vec2 a, const vec2 b) @@ -928,17 +923,17 @@ vec4 min(const vec4 a, const vec4 b) vec2 min(const vec2 a, const float b) { - __asm vec4_min __retVal, a.xy, b.xx; + __asm vec4_min __retVal, a.xy, b; } vec3 min(const vec3 a, const float b) { - __asm vec4_min __retVal, a.xyz, b.xxx; + __asm vec4_min __retVal, a.xyz, b; } vec4 min(const vec4 a, const float b) { - __asm vec4_min __retVal, a, b.xxxx; + __asm vec4_min __retVal, a, b; } @@ -946,7 +941,7 @@ vec4 min(const vec4 a, const float b) float max(const float a, const float b) { - __asm vec4_max __retVal.x, a.x, b.x; + __asm vec4_max __retVal, a, b; } vec2 max(const vec2 a, const vec2 b) @@ -966,17 +961,17 @@ vec4 max(const vec4 a, const vec4 b) vec2 max(const vec2 a, const float b) { - __asm vec4_max __retVal, a.xy, b.xx; + __asm vec4_max __retVal, a.xy, b; } vec3 max(const vec3 a, const float b) { - __asm vec4_max __retVal, a.xyz, b.xxx; + __asm vec4_max __retVal, a.xyz, b; } vec4 max(const vec4 a, const float b) { - __asm vec4_max __retVal, a, b.xxxx; + __asm vec4_max __retVal, a, b; } @@ -1056,45 +1051,45 @@ vec4 mix(const vec4 x, const vec4 y, const vec4 a) } -//// step (untested) +//// step float step(const float edge, const float x) { - __asm vec4_sgt __retVal.x, x, edge; + __asm vec4_sge __retVal, x, edge; } vec2 step(const vec2 edge, const vec2 x) { - __asm vec4_sgt __retVal.xy, x, edge; + __asm vec4_sge __retVal.xy, x, edge; } vec3 step(const vec3 edge, const vec3 x) { - __asm vec4_sgt __retVal.xyz, x, edge; + __asm vec4_sge __retVal.xyz, x, edge; } vec4 step(const vec4 edge, const vec4 x) { - __asm vec4_sgt __retVal, x, edge; + __asm vec4_sge __retVal, x, edge; } vec2 step(const float edge, const vec2 v) { - __asm vec4_sgt __retVal.xy, v, edge.xx; + __asm vec4_sge __retVal.xy, v, edge; } vec3 step(const float edge, const vec3 v) { - __asm vec4_sgt __retVal.xyz, v, edge.xxx; + __asm vec4_sge __retVal.xyz, v, edge; } vec4 step(const float edge, const vec4 v) { - __asm vec4_sgt __retVal, v, edge.xxxx; + __asm vec4_sge __retVal, v, edge; } -//// smoothstep (untested) +//// smoothstep float smoothstep(const float edge0, const float edge1, const float x) { @@ -1165,7 +1160,7 @@ float length(const vec3 v) float r; const float p = dot(v, v); // p = v.x * v.x + v.y * v.y + v.z * v.z __asm float_rsq r, p; // r = 1 / sqrt(p) - __asm float_rcp __retVal.x, r; // retVal = 1 / r + __asm float_rcp __retVal, r; // retVal = 1 / r } float length(const vec4 v) @@ -1173,7 +1168,7 @@ float length(const vec4 v) float r; const float p = dot(v, v); // p = v.x * v.x + v.y * v.y + ... __asm float_rsq r, p; // r = 1 / sqrt(p) - __asm float_rcp __retVal.x, r; // retVal = 1 / r + __asm float_rcp __retVal, r; // retVal = 1 / r } @@ -1219,7 +1214,7 @@ float faceforward(const float N, const float I, const float Nref) // this could probably be done better const float d = dot(Nref, I); float s; - __asm vec4_sgt s.x, 0.0, d; // s = (0.0 > d) ? 1 : 0 + __asm vec4_sgt s, 0.0, d; // s = (0.0 > d) ? 1 : 0 return mix(-N, N, s); } @@ -1228,7 +1223,7 @@ vec2 faceforward(const vec2 N, const vec2 I, const vec2 Nref) // this could probably be done better const float d = dot(Nref, I); float s; - __asm vec4_sgt s.x, 0.0, d; // s = (0.0 > d) ? 1 : 0 + __asm vec4_sgt s, 0.0, d; // s = (0.0 > d) ? 1 : 0 return mix(-N, N, s); } @@ -1237,7 +1232,7 @@ vec3 faceforward(const vec3 N, const vec3 I, const vec3 Nref) // this could probably be done better const float d = dot(Nref, I); float s; - __asm vec4_sgt s.x, 0.0, d; // s = (0.0 > d) ? 1 : 0 + __asm vec4_sgt s, 0.0, d; // s = (0.0 > d) ? 1 : 0 return mix(-N, N, s); } @@ -1246,7 +1241,7 @@ vec4 faceforward(const vec4 N, const vec4 I, const vec4 Nref) // this could probably be done better const float d = dot(Nref, I); float s; - __asm vec4_sgt s.x, 0.0, d; // s = (0.0 > d) ? 1 : 0 + __asm vec4_sgt s, 0.0, d; // s = (0.0 > d) ? 1 : 0 return mix(-N, N, s); } @@ -1277,34 +1272,50 @@ vec4 reflect(const vec4 I, const vec4 N) float refract(const float I, const float N, const float eta) { - float k = 1.0 - eta * eta * (1.0 - dot(N, I) * dot(N, I)); + float n_dot_i = dot(N, I); + float k = 1.0 - eta * eta * (1.0 - n_dot_i * n_dot_i); + float retval; if (k < 0.0) - return 0.0; - return eta * I - (eta * dot(N, I) + sqrt(k)) * N; + retval = 0.0; + else + retval = eta * I - (eta * n_dot_i + sqrt(k)) * N; + return retval; } vec2 refract(const vec2 I, const vec2 N, const float eta) { - float k = 1.0 - eta * eta * (1.0 - dot(N, I) * dot(N, I)); + float n_dot_i = dot(N, I); + float k = 1.0 - eta * eta * (1.0 - n_dot_i * n_dot_i); + vec2 retval; if (k < 0.0) - return 0.0; - return eta * I - (eta * dot(N, I) + sqrt(k)) * N; + retval = vec2(0.0); + else + retval = eta * I - (eta * n_dot_i + sqrt(k)) * N; + return retval; } vec3 refract(const vec3 I, const vec3 N, const float eta) { - float k = 1.0 - eta * eta * (1.0 - dot(N, I) * dot(N, I)); + float n_dot_i = dot(N, I); + float k = 1.0 - eta * eta * (1.0 - n_dot_i * n_dot_i); + vec3 retval; if (k < 0.0) - return 0.0; - return eta * I - (eta * dot(N, I) + sqrt(k)) * N; + retval = vec3(0.0); + else + retval = eta * I - (eta * n_dot_i + sqrt(k)) * N; + return retval; } vec4 refract(const vec4 I, const vec4 N, const float eta) { - float k = 1.0 - eta * eta * (1.0 - dot(N, I) * dot(N, I)); + float n_dot_i = dot(N, I); + float k = 1.0 - eta * eta * (1.0 - n_dot_i * n_dot_i); + vec4 retval; if (k < 0.0) - return 0.0; - return eta * I - (eta * dot(N, I) + sqrt(k)) * N; + retval = vec4(0.0); + else + retval = eta * I - (eta * n_dot_i + sqrt(k)) * N; + return retval; } @@ -1418,7 +1429,7 @@ bvec4 greaterThan(const vec4 u, const vec4 v) bvec2 greaterThan(const ivec2 u, const ivec2 v) { - __asm vec4_sgt __retVal.xy, u, v; + __asm vec4_sgt __retVal.xy, u.xy, v.xy; } bvec3 greaterThan(const ivec3 u, const ivec3 v) @@ -1596,26 +1607,25 @@ bool any(const bvec4 v) bool all (const bvec2 v) { float prod; - __asm vec4_multiply prod.x, v.x, v.y; - __asm vec4_sne __retVal.x, prod.x, 0.0; - return v.x && v.y; + __asm vec4_multiply prod, v.x, v.y; + __asm vec4_sne __retVal, prod, 0.0; } bool all (const bvec3 v) { float prod; - __asm vec4_multiply prod.x, v.x, v.y; - __asm vec4_multiply prod.x, prod.x, v.z; - __asm vec4_sne __retVal.x, prod.x, 0.0; + __asm vec4_multiply prod, v.x, v.y; + __asm vec4_multiply prod, prod, v.z; + __asm vec4_sne __retVal, prod, 0.0; } bool all (const bvec4 v) { float prod; - __asm vec4_multiply prod.x, v.x, v.y; - __asm vec4_multiply prod.x, prod.x, v.z; - __asm vec4_multiply prod.x, prod.x, v.w; - __asm vec4_sne __retVal.x, prod.x, 0.0; + __asm vec4_multiply prod, v.x, v.y; + __asm vec4_multiply prod, prod, v.z; + __asm vec4_multiply prod, prod, v.w; + __asm vec4_sne __retVal, prod, 0.0; } diff --git a/src/mesa/shader/slang/library/slang_common_builtin_gc.h b/src/mesa/shader/slang/library/slang_common_builtin_gc.h index 0a43cad2a3..d20240543a 100644 --- a/src/mesa/shader/slang/library/slang_common_builtin_gc.h +++ b/src/mesa/shader/slang/library/slang_common_builtin_gc.h @@ -2,820 +2,815 @@ /* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED FROM THE FOLLOWING FILE: */ /* slang_common_builtin.gc */ -3,2,2,1,5,1,103,108,95,77,97,120,76,105,103,104,116,115,0,2,16,10,56,0,0,0,2,2,1,5,1,103,108,95,77, -97,120,67,108,105,112,80,108,97,110,101,115,0,2,16,10,54,0,0,0,2,2,1,5,1,103,108,95,77,97,120,84, -101,120,116,117,114,101,85,110,105,116,115,0,2,16,10,56,0,0,0,2,2,1,5,1,103,108,95,77,97,120,84, -101,120,116,117,114,101,67,111,111,114,100,115,0,2,16,10,56,0,0,0,2,2,1,5,1,103,108,95,77,97,120, -86,101,114,116,101,120,65,116,116,114,105,98,115,0,2,16,10,49,54,0,0,0,2,2,1,5,1,103,108,95,77,97, -120,86,101,114,116,101,120,85,110,105,102,111,114,109,67,111,109,112,111,110,101,110,116,115,0,2, -16,10,53,49,50,0,0,0,2,2,1,5,1,103,108,95,77,97,120,86,97,114,121,105,110,103,70,108,111,97,116, -115,0,2,16,10,51,50,0,0,0,2,2,1,5,1,103,108,95,77,97,120,86,101,114,116,101,120,84,101,120,116,117, -114,101,73,109,97,103,101,85,110,105,116,115,0,2,16,8,48,0,0,0,2,2,1,5,1,103,108,95,77,97,120,67, -111,109,98,105,110,101,100,84,101,120,116,117,114,101,73,109,97,103,101,85,110,105,116,115,0,2,16, -10,50,0,0,0,2,2,1,5,1,103,108,95,77,97,120,84,101,120,116,117,114,101,73,109,97,103,101,85,110,105, -116,115,0,2,16,10,50,0,0,0,2,2,1,5,1,103,108,95,77,97,120,70,114,97,103,109,101,110,116,85,110,105, -102,111,114,109,67,111,109,112,111,110,101,110,116,115,0,2,16,10,54,52,0,0,0,2,2,1,5,1,103,108,95, -77,97,120,68,114,97,119,66,117,102,102,101,114,115,0,2,16,10,49,0,0,0,2,2,4,15,1,103,108,95,77,111, -100,101,108,86,105,101,119,77,97,116,114,105,120,0,0,0,2,2,4,15,1,103,108,95,80,114,111,106,101,99, -116,105,111,110,77,97,116,114,105,120,0,0,0,2,2,4,15,1,103,108,95,77,111,100,101,108,86,105,101, -119,80,114,111,106,101,99,116,105,111,110,77,97,116,114,105,120,0,0,0,2,2,4,15,1,103,108,95,84,101, -120,116,117,114,101,77,97,116,114,105,120,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114,101, -67,111,111,114,100,115,0,0,0,2,2,4,14,1,103,108,95,78,111,114,109,97,108,77,97,116,114,105,120,0,0, -0,2,2,4,14,1,95,95,78,111,114,109,97,108,77,97,116,114,105,120,84,114,97,110,115,112,111,115,101,0, -0,0,2,2,4,15,1,103,108,95,77,111,100,101,108,86,105,101,119,77,97,116,114,105,120,73,110,118,101, -114,115,101,0,0,0,2,2,4,15,1,103,108,95,80,114,111,106,101,99,116,105,111,110,77,97,116,114,105, -120,73,110,118,101,114,115,101,0,0,0,2,2,4,15,1,103,108,95,77,111,100,101,108,86,105,101,119,80, -114,111,106,101,99,116,105,111,110,77,97,116,114,105,120,73,110,118,101,114,115,101,0,0,0,2,2,4,15, -1,103,108,95,84,101,120,116,117,114,101,77,97,116,114,105,120,73,110,118,101,114,115,101,0,3,18, -103,108,95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,4,15,1,103,108,95, -77,111,100,101,108,86,105,101,119,77,97,116,114,105,120,84,114,97,110,115,112,111,115,101,0,0,0,2, -2,4,15,1,103,108,95,80,114,111,106,101,99,116,105,111,110,77,97,116,114,105,120,84,114,97,110,115, -112,111,115,101,0,0,0,2,2,4,15,1,103,108,95,77,111,100,101,108,86,105,101,119,80,114,111,106,101, -99,116,105,111,110,77,97,116,114,105,120,84,114,97,110,115,112,111,115,101,0,0,0,2,2,4,15,1,103, -108,95,84,101,120,116,117,114,101,77,97,116,114,105,120,84,114,97,110,115,112,111,115,101,0,3,18, -103,108,95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,4,15,1,103,108,95, -77,111,100,101,108,86,105,101,119,77,97,116,114,105,120,73,110,118,101,114,115,101,84,114,97,110, -115,112,111,115,101,0,0,0,2,2,4,15,1,103,108,95,80,114,111,106,101,99,116,105,111,110,77,97,116, -114,105,120,73,110,118,101,114,115,101,84,114,97,110,115,112,111,115,101,0,0,0,2,2,4,15,1,103,108, -95,77,111,100,101,108,86,105,101,119,80,114,111,106,101,99,116,105,111,110,77,97,116,114,105,120, -73,110,118,101,114,115,101,84,114,97,110,115,112,111,115,101,0,0,0,2,2,4,15,1,103,108,95,84,101, -120,116,117,114,101,77,97,116,114,105,120,73,110,118,101,114,115,101,84,114,97,110,115,112,111,115, -101,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,4,9,1, -103,108,95,78,111,114,109,97,108,83,99,97,108,101,0,0,0,2,2,0,24,103,108,95,68,101,112,116,104,82, -97,110,103,101,80,97,114,97,109,101,116,101,114,115,0,9,110,101,97,114,0,0,0,1,9,102,97,114,0,0,0, -1,9,100,105,102,102,0,0,0,0,0,0,2,2,4,25,103,108,95,68,101,112,116,104,82,97,110,103,101,80,97,114, -97,109,101,116,101,114,115,0,1,103,108,95,68,101,112,116,104,82,97,110,103,101,0,0,0,2,2,4,12,1, -103,108,95,67,108,105,112,80,108,97,110,101,0,3,18,103,108,95,77,97,120,67,108,105,112,80,108,97, -110,101,115,0,0,0,2,2,0,24,103,108,95,80,111,105,110,116,80,97,114,97,109,101,116,101,114,115,0,9, -115,105,122,101,0,0,0,1,9,115,105,122,101,77,105,110,0,0,0,1,9,115,105,122,101,77,97,120,0,0,0,1,9, -102,97,100,101,84,104,114,101,115,104,111,108,100,83,105,122,101,0,0,0,1,9,100,105,115,116,97,110, -99,101,67,111,110,115,116,97,110,116,65,116,116,101,110,117,97,116,105,111,110,0,0,0,1,9,100,105, -115,116,97,110,99,101,76,105,110,101,97,114,65,116,116,101,110,117,97,116,105,111,110,0,0,0,1,9, -100,105,115,116,97,110,99,101,81,117,97,100,114,97,116,105,99,65,116,116,101,110,117,97,116,105, -111,110,0,0,0,0,0,0,2,2,4,25,103,108,95,80,111,105,110,116,80,97,114,97,109,101,116,101,114,115,0, -1,103,108,95,80,111,105,110,116,0,0,0,2,2,0,24,103,108,95,77,97,116,101,114,105,97,108,80,97,114, -97,109,101,116,101,114,115,0,12,101,109,105,115,115,105,111,110,0,0,0,1,12,97,109,98,105,101,110, -116,0,0,0,1,12,100,105,102,102,117,115,101,0,0,0,1,12,115,112,101,99,117,108,97,114,0,0,0,1,9,115, -104,105,110,105,110,101,115,115,0,0,0,0,0,0,2,2,4,25,103,108,95,77,97,116,101,114,105,97,108,80,97, -114,97,109,101,116,101,114,115,0,1,103,108,95,70,114,111,110,116,77,97,116,101,114,105,97,108,0,0, -0,2,2,4,25,103,108,95,77,97,116,101,114,105,97,108,80,97,114,97,109,101,116,101,114,115,0,1,103, -108,95,66,97,99,107,77,97,116,101,114,105,97,108,0,0,0,2,2,0,24,103,108,95,76,105,103,104,116,83, -111,117,114,99,101,80,97,114,97,109,101,116,101,114,115,0,12,97,109,98,105,101,110,116,0,0,0,1,12, -100,105,102,102,117,115,101,0,0,0,1,12,115,112,101,99,117,108,97,114,0,0,0,1,12,112,111,115,105, -116,105,111,110,0,0,0,1,12,104,97,108,102,86,101,99,116,111,114,0,0,0,1,11,115,112,111,116,68,105, -114,101,99,116,105,111,110,0,0,0,1,9,115,112,111,116,69,120,112,111,110,101,110,116,0,0,0,1,9,115, -112,111,116,67,117,116,111,102,102,0,0,0,1,9,115,112,111,116,67,111,115,67,117,116,111,102,102,0,0, -0,1,9,99,111,110,115,116,97,110,116,65,116,116,101,110,117,97,116,105,111,110,0,0,0,1,9,108,105, -110,101,97,114,65,116,116,101,110,117,97,116,105,111,110,0,0,0,1,9,113,117,97,100,114,97,116,105, -99,65,116,116,101,110,117,97,116,105,111,110,0,0,0,0,0,0,2,2,4,25,103,108,95,76,105,103,104,116,83, -111,117,114,99,101,80,97,114,97,109,101,116,101,114,115,0,1,103,108,95,76,105,103,104,116,83,111, -117,114,99,101,0,3,18,103,108,95,77,97,120,76,105,103,104,116,115,0,0,0,2,2,0,24,103,108,95,76,105, -103,104,116,77,111,100,101,108,80,97,114,97,109,101,116,101,114,115,0,12,97,109,98,105,101,110,116, -0,0,0,0,0,0,2,2,4,25,103,108,95,76,105,103,104,116,77,111,100,101,108,80,97,114,97,109,101,116,101, -114,115,0,1,103,108,95,76,105,103,104,116,77,111,100,101,108,0,0,0,2,2,0,24,103,108,95,76,105,103, -104,116,77,111,100,101,108,80,114,111,100,117,99,116,115,0,12,115,99,101,110,101,67,111,108,111, -114,0,0,0,0,0,0,2,2,4,25,103,108,95,76,105,103,104,116,77,111,100,101,108,80,114,111,100,117,99, -116,115,0,1,103,108,95,70,114,111,110,116,76,105,103,104,116,77,111,100,101,108,80,114,111,100,117, -99,116,0,0,0,2,2,4,25,103,108,95,76,105,103,104,116,77,111,100,101,108,80,114,111,100,117,99,116, -115,0,1,103,108,95,66,97,99,107,76,105,103,104,116,77,111,100,101,108,80,114,111,100,117,99,116,0, -0,0,2,2,0,24,103,108,95,76,105,103,104,116,80,114,111,100,117,99,116,115,0,12,97,109,98,105,101, -110,116,0,0,0,1,12,100,105,102,102,117,115,101,0,0,0,1,12,115,112,101,99,117,108,97,114,0,0,0,0,0, -0,2,2,4,25,103,108,95,76,105,103,104,116,80,114,111,100,117,99,116,115,0,1,103,108,95,70,114,111, -110,116,76,105,103,104,116,80,114,111,100,117,99,116,0,3,18,103,108,95,77,97,120,76,105,103,104, -116,115,0,0,0,2,2,4,25,103,108,95,76,105,103,104,116,80,114,111,100,117,99,116,115,0,1,103,108,95, -66,97,99,107,76,105,103,104,116,80,114,111,100,117,99,116,0,3,18,103,108,95,77,97,120,76,105,103, -104,116,115,0,0,0,2,2,4,12,1,103,108,95,84,101,120,116,117,114,101,69,110,118,67,111,108,111,114,0, -3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,73,109,97,103,101,85,110,105,116,115,0,0,0,2, -2,4,12,1,103,108,95,69,121,101,80,108,97,110,101,83,0,3,18,103,108,95,77,97,120,84,101,120,116,117, -114,101,67,111,111,114,100,115,0,0,0,2,2,4,12,1,103,108,95,69,121,101,80,108,97,110,101,84,0,3,18, -103,108,95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,4,12,1,103,108,95, -69,121,101,80,108,97,110,101,82,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,67,111,111, -114,100,115,0,0,0,2,2,4,12,1,103,108,95,69,121,101,80,108,97,110,101,81,0,3,18,103,108,95,77,97, -120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,4,12,1,103,108,95,79,98,106,101,99, +4,2,2,1,0,5,1,103,108,95,77,97,120,76,105,103,104,116,115,0,2,16,10,56,0,0,0,2,2,1,0,5,1,103,108, +95,77,97,120,67,108,105,112,80,108,97,110,101,115,0,2,16,10,54,0,0,0,2,2,1,0,5,1,103,108,95,77,97, +120,84,101,120,116,117,114,101,85,110,105,116,115,0,2,16,10,56,0,0,0,2,2,1,0,5,1,103,108,95,77,97, +120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,2,16,10,56,0,0,0,2,2,1,0,5,1,103,108,95,77, +97,120,86,101,114,116,101,120,65,116,116,114,105,98,115,0,2,16,10,49,54,0,0,0,2,2,1,0,5,1,103,108, +95,77,97,120,86,101,114,116,101,120,85,110,105,102,111,114,109,67,111,109,112,111,110,101,110,116, +115,0,2,16,10,53,49,50,0,0,0,2,2,1,0,5,1,103,108,95,77,97,120,86,97,114,121,105,110,103,70,108,111, +97,116,115,0,2,16,10,51,50,0,0,0,2,2,1,0,5,1,103,108,95,77,97,120,86,101,114,116,101,120,84,101, +120,116,117,114,101,73,109,97,103,101,85,110,105,116,115,0,2,16,8,48,0,0,0,2,2,1,0,5,1,103,108,95, +77,97,120,67,111,109,98,105,110,101,100,84,101,120,116,117,114,101,73,109,97,103,101,85,110,105, +116,115,0,2,16,10,50,0,0,0,2,2,1,0,5,1,103,108,95,77,97,120,84,101,120,116,117,114,101,73,109,97, +103,101,85,110,105,116,115,0,2,16,10,50,0,0,0,2,2,1,0,5,1,103,108,95,77,97,120,70,114,97,103,109, +101,110,116,85,110,105,102,111,114,109,67,111,109,112,111,110,101,110,116,115,0,2,16,10,54,52,0,0, +0,2,2,1,0,5,1,103,108,95,77,97,120,68,114,97,119,66,117,102,102,101,114,115,0,2,16,10,49,0,0,0,2,2, +4,0,15,1,103,108,95,77,111,100,101,108,86,105,101,119,77,97,116,114,105,120,0,0,0,2,2,4,0,15,1,103, +108,95,80,114,111,106,101,99,116,105,111,110,77,97,116,114,105,120,0,0,0,2,2,4,0,15,1,103,108,95, +77,111,100,101,108,86,105,101,119,80,114,111,106,101,99,116,105,111,110,77,97,116,114,105,120,0,0, +0,2,2,4,0,15,1,103,108,95,84,101,120,116,117,114,101,77,97,116,114,105,120,0,3,18,103,108,95,77,97, +120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,4,0,14,1,103,108,95,78,111,114,109, +97,108,77,97,116,114,105,120,0,0,0,2,2,4,0,14,1,95,95,78,111,114,109,97,108,77,97,116,114,105,120, +84,114,97,110,115,112,111,115,101,0,0,0,2,2,4,0,15,1,103,108,95,77,111,100,101,108,86,105,101,119, +77,97,116,114,105,120,73,110,118,101,114,115,101,0,0,0,2,2,4,0,15,1,103,108,95,80,114,111,106,101, +99,116,105,111,110,77,97,116,114,105,120,73,110,118,101,114,115,101,0,0,0,2,2,4,0,15,1,103,108,95, +77,111,100,101,108,86,105,101,119,80,114,111,106,101,99,116,105,111,110,77,97,116,114,105,120,73, +110,118,101,114,115,101,0,0,0,2,2,4,0,15,1,103,108,95,84,101,120,116,117,114,101,77,97,116,114,105, +120,73,110,118,101,114,115,101,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,67,111,111, +114,100,115,0,0,0,2,2,4,0,15,1,103,108,95,77,111,100,101,108,86,105,101,119,77,97,116,114,105,120, +84,114,97,110,115,112,111,115,101,0,0,0,2,2,4,0,15,1,103,108,95,80,114,111,106,101,99,116,105,111, +110,77,97,116,114,105,120,84,114,97,110,115,112,111,115,101,0,0,0,2,2,4,0,15,1,103,108,95,77,111, +100,101,108,86,105,101,119,80,114,111,106,101,99,116,105,111,110,77,97,116,114,105,120,84,114,97, +110,115,112,111,115,101,0,0,0,2,2,4,0,15,1,103,108,95,84,101,120,116,117,114,101,77,97,116,114,105, +120,84,114,97,110,115,112,111,115,101,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,67, +111,111,114,100,115,0,0,0,2,2,4,0,15,1,103,108,95,77,111,100,101,108,86,105,101,119,77,97,116,114, +105,120,73,110,118,101,114,115,101,84,114,97,110,115,112,111,115,101,0,0,0,2,2,4,0,15,1,103,108,95, +80,114,111,106,101,99,116,105,111,110,77,97,116,114,105,120,73,110,118,101,114,115,101,84,114,97, +110,115,112,111,115,101,0,0,0,2,2,4,0,15,1,103,108,95,77,111,100,101,108,86,105,101,119,80,114,111, +106,101,99,116,105,111,110,77,97,116,114,105,120,73,110,118,101,114,115,101,84,114,97,110,115,112, +111,115,101,0,0,0,2,2,4,0,15,1,103,108,95,84,101,120,116,117,114,101,77,97,116,114,105,120,73,110, +118,101,114,115,101,84,114,97,110,115,112,111,115,101,0,3,18,103,108,95,77,97,120,84,101,120,116, +117,114,101,67,111,111,114,100,115,0,0,0,2,2,4,0,9,1,103,108,95,78,111,114,109,97,108,83,99,97,108, +101,0,0,0,2,2,0,0,24,103,108,95,68,101,112,116,104,82,97,110,103,101,80,97,114,97,109,101,116,101, +114,115,0,9,110,101,97,114,0,0,0,1,9,102,97,114,0,0,0,1,9,100,105,102,102,0,0,0,0,0,0,2,2,4,0,25, +103,108,95,68,101,112,116,104,82,97,110,103,101,80,97,114,97,109,101,116,101,114,115,0,1,103,108, +95,68,101,112,116,104,82,97,110,103,101,0,0,0,2,2,4,0,12,1,103,108,95,67,108,105,112,80,108,97,110, +101,0,3,18,103,108,95,77,97,120,67,108,105,112,80,108,97,110,101,115,0,0,0,2,2,0,0,24,103,108,95, +80,111,105,110,116,80,97,114,97,109,101,116,101,114,115,0,9,115,105,122,101,0,0,0,1,9,115,105,122, +101,77,105,110,0,0,0,1,9,115,105,122,101,77,97,120,0,0,0,1,9,102,97,100,101,84,104,114,101,115,104, +111,108,100,83,105,122,101,0,0,0,1,9,100,105,115,116,97,110,99,101,67,111,110,115,116,97,110,116, +65,116,116,101,110,117,97,116,105,111,110,0,0,0,1,9,100,105,115,116,97,110,99,101,76,105,110,101, +97,114,65,116,116,101,110,117,97,116,105,111,110,0,0,0,1,9,100,105,115,116,97,110,99,101,81,117,97, +100,114,97,116,105,99,65,116,116,101,110,117,97,116,105,111,110,0,0,0,0,0,0,2,2,4,0,25,103,108,95, +80,111,105,110,116,80,97,114,97,109,101,116,101,114,115,0,1,103,108,95,80,111,105,110,116,0,0,0,2, +2,0,0,24,103,108,95,77,97,116,101,114,105,97,108,80,97,114,97,109,101,116,101,114,115,0,12,101,109, +105,115,115,105,111,110,0,0,0,1,12,97,109,98,105,101,110,116,0,0,0,1,12,100,105,102,102,117,115, +101,0,0,0,1,12,115,112,101,99,117,108,97,114,0,0,0,1,9,115,104,105,110,105,110,101,115,115,0,0,0,0, +0,0,2,2,4,0,25,103,108,95,77,97,116,101,114,105,97,108,80,97,114,97,109,101,116,101,114,115,0,1, +103,108,95,70,114,111,110,116,77,97,116,101,114,105,97,108,0,0,0,2,2,4,0,25,103,108,95,77,97,116, +101,114,105,97,108,80,97,114,97,109,101,116,101,114,115,0,1,103,108,95,66,97,99,107,77,97,116,101, +114,105,97,108,0,0,0,2,2,0,0,24,103,108,95,76,105,103,104,116,83,111,117,114,99,101,80,97,114,97, +109,101,116,101,114,115,0,12,97,109,98,105,101,110,116,0,0,0,1,12,100,105,102,102,117,115,101,0,0, +0,1,12,115,112,101,99,117,108,97,114,0,0,0,1,12,112,111,115,105,116,105,111,110,0,0,0,1,12,104,97, +108,102,86,101,99,116,111,114,0,0,0,1,11,115,112,111,116,68,105,114,101,99,116,105,111,110,0,0,0,1, +9,115,112,111,116,69,120,112,111,110,101,110,116,0,0,0,1,9,115,112,111,116,67,117,116,111,102,102, +0,0,0,1,9,115,112,111,116,67,111,115,67,117,116,111,102,102,0,0,0,1,9,99,111,110,115,116,97,110, +116,65,116,116,101,110,117,97,116,105,111,110,0,0,0,1,9,108,105,110,101,97,114,65,116,116,101,110, +117,97,116,105,111,110,0,0,0,1,9,113,117,97,100,114,97,116,105,99,65,116,116,101,110,117,97,116, +105,111,110,0,0,0,0,0,0,2,2,4,0,25,103,108,95,76,105,103,104,116,83,111,117,114,99,101,80,97,114, +97,109,101,116,101,114,115,0,1,103,108,95,76,105,103,104,116,83,111,117,114,99,101,0,3,18,103,108, +95,77,97,120,76,105,103,104,116,115,0,0,0,2,2,0,0,24,103,108,95,76,105,103,104,116,77,111,100,101, +108,80,97,114,97,109,101,116,101,114,115,0,12,97,109,98,105,101,110,116,0,0,0,0,0,0,2,2,4,0,25,103, +108,95,76,105,103,104,116,77,111,100,101,108,80,97,114,97,109,101,116,101,114,115,0,1,103,108,95, +76,105,103,104,116,77,111,100,101,108,0,0,0,2,2,0,0,24,103,108,95,76,105,103,104,116,77,111,100, +101,108,80,114,111,100,117,99,116,115,0,12,115,99,101,110,101,67,111,108,111,114,0,0,0,0,0,0,2,2,4, +0,25,103,108,95,76,105,103,104,116,77,111,100,101,108,80,114,111,100,117,99,116,115,0,1,103,108,95, +70,114,111,110,116,76,105,103,104,116,77,111,100,101,108,80,114,111,100,117,99,116,0,0,0,2,2,4,0, +25,103,108,95,76,105,103,104,116,77,111,100,101,108,80,114,111,100,117,99,116,115,0,1,103,108,95, +66,97,99,107,76,105,103,104,116,77,111,100,101,108,80,114,111,100,117,99,116,0,0,0,2,2,0,0,24,103, +108,95,76,105,103,104,116,80,114,111,100,117,99,116,115,0,12,97,109,98,105,101,110,116,0,0,0,1,12, +100,105,102,102,117,115,101,0,0,0,1,12,115,112,101,99,117,108,97,114,0,0,0,0,0,0,2,2,4,0,25,103, +108,95,76,105,103,104,116,80,114,111,100,117,99,116,115,0,1,103,108,95,70,114,111,110,116,76,105, +103,104,116,80,114,111,100,117,99,116,0,3,18,103,108,95,77,97,120,76,105,103,104,116,115,0,0,0,2,2, +4,0,25,103,108,95,76,105,103,104,116,80,114,111,100,117,99,116,115,0,1,103,108,95,66,97,99,107,76, +105,103,104,116,80,114,111,100,117,99,116,0,3,18,103,108,95,77,97,120,76,105,103,104,116,115,0,0,0, +2,2,4,0,12,1,103,108,95,84,101,120,116,117,114,101,69,110,118,67,111,108,111,114,0,3,18,103,108,95, +77,97,120,84,101,120,116,117,114,101,73,109,97,103,101,85,110,105,116,115,0,0,0,2,2,4,0,12,1,103, +108,95,69,121,101,80,108,97,110,101,83,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,67, +111,111,114,100,115,0,0,0,2,2,4,0,12,1,103,108,95,69,121,101,80,108,97,110,101,84,0,3,18,103,108, +95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,4,0,12,1,103,108,95,69, +121,101,80,108,97,110,101,82,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,67,111,111,114, +100,115,0,0,0,2,2,4,0,12,1,103,108,95,69,121,101,80,108,97,110,101,81,0,3,18,103,108,95,77,97,120, +84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,4,0,12,1,103,108,95,79,98,106,101,99, 116,80,108,97,110,101,83,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100, -115,0,0,0,2,2,4,12,1,103,108,95,79,98,106,101,99,116,80,108,97,110,101,84,0,3,18,103,108,95,77,97, -120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,4,12,1,103,108,95,79,98,106,101,99, -116,80,108,97,110,101,82,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100, -115,0,0,0,2,2,4,12,1,103,108,95,79,98,106,101,99,116,80,108,97,110,101,81,0,3,18,103,108,95,77,97, -120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,0,24,103,108,95,70,111,103,80,97, -114,97,109,101,116,101,114,115,0,12,99,111,108,111,114,0,0,0,1,9,100,101,110,115,105,116,121,0,0,0, -1,9,115,116,97,114,116,0,0,0,1,9,101,110,100,0,0,0,1,9,115,99,97,108,101,0,0,0,0,0,0,2,2,4,25,103, -108,95,70,111,103,80,97,114,97,109,101,116,101,114,115,0,1,103,108,95,70,111,103,0,0,0,1,0,9,0,114, -97,100,105,97,110,115,0,1,1,0,9,100,101,103,0,0,0,1,3,2,1,9,1,99,0,2,17,51,0,49,52,49,53,57,50,54, -0,0,17,49,56,48,0,48,0,0,49,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114, -101,116,86,97,108,0,59,120,0,0,18,100,101,103,0,0,18,99,0,0,0,0,1,0,10,0,114,97,100,105,97,110,115, -0,1,1,0,10,100,101,103,0,0,0,1,3,2,1,9,1,99,0,2,17,51,0,49,52,49,53,57,50,54,0,0,17,49,56,48,0,48, -0,0,49,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0, -59,120,121,0,0,18,100,101,103,0,59,120,121,0,0,18,99,0,59,120,120,0,0,0,0,1,0,11,0,114,97,100,105, -97,110,115,0,1,1,0,11,100,101,103,0,0,0,1,3,2,1,9,1,99,0,2,17,51,0,49,52,49,53,57,50,54,0,0,17,49, +115,0,0,0,2,2,4,0,12,1,103,108,95,79,98,106,101,99,116,80,108,97,110,101,84,0,3,18,103,108,95,77, +97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,4,0,12,1,103,108,95,79,98,106, +101,99,116,80,108,97,110,101,82,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,67,111,111, +114,100,115,0,0,0,2,2,4,0,12,1,103,108,95,79,98,106,101,99,116,80,108,97,110,101,81,0,3,18,103,108, +95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,0,0,24,103,108,95,70,111, +103,80,97,114,97,109,101,116,101,114,115,0,12,99,111,108,111,114,0,0,0,1,9,100,101,110,115,105,116, +121,0,0,0,1,9,115,116,97,114,116,0,0,0,1,9,101,110,100,0,0,0,1,9,115,99,97,108,101,0,0,0,0,0,0,2,2, +4,0,25,103,108,95,70,111,103,80,97,114,97,109,101,116,101,114,115,0,1,103,108,95,70,111,103,0,0,0, +1,0,0,9,0,114,97,100,105,97,110,115,0,1,1,0,9,100,101,103,0,0,0,1,3,2,1,0,9,1,99,0,2,17,51,0,49,52, +49,53,57,50,54,0,0,17,49,56,48,0,48,0,0,49,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121, +0,18,95,95,114,101,116,86,97,108,0,0,18,100,101,103,0,0,18,99,0,0,0,0,1,0,0,10,0,114,97,100,105,97, +110,115,0,1,1,0,10,100,101,103,0,0,0,1,3,2,1,0,9,1,99,0,2,17,51,0,49,52,49,53,57,50,54,0,0,17,49, 56,48,0,48,0,0,49,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86, -97,108,0,59,120,121,122,0,0,18,100,101,103,0,59,120,121,122,0,0,18,99,0,59,120,120,120,0,0,0,0,1,0, -12,0,114,97,100,105,97,110,115,0,1,1,0,12,100,101,103,0,0,0,1,3,2,1,9,1,99,0,2,17,51,0,49,52,49,53, -57,50,54,0,0,17,49,56,48,0,48,0,0,49,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18, -95,95,114,101,116,86,97,108,0,0,18,100,101,103,0,0,18,99,0,59,120,120,120,120,0,0,0,0,1,0,9,0,100, -101,103,114,101,101,115,0,1,1,0,9,114,97,100,0,0,0,1,3,2,1,9,1,99,0,2,17,49,56,48,0,48,0,0,17,51,0, -49,52,49,53,57,50,54,0,0,49,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114, -101,116,86,97,108,0,59,120,0,0,18,114,97,100,0,0,18,99,0,0,0,0,1,0,10,0,100,101,103,114,101,101, -115,0,1,1,0,10,114,97,100,0,0,0,1,3,2,1,9,1,99,0,2,17,49,56,48,0,48,0,0,17,51,0,49,52,49,53,57,50, -54,0,0,49,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108, -0,59,120,121,0,0,18,114,97,100,0,59,120,121,0,0,18,99,0,59,120,120,0,0,0,0,1,0,11,0,100,101,103, -114,101,101,115,0,1,1,0,11,114,97,100,0,0,0,1,3,2,1,9,1,99,0,2,17,49,56,48,0,48,0,0,17,51,0,49,52, -49,53,57,50,54,0,0,49,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101, -116,86,97,108,0,59,120,121,122,0,0,18,114,97,100,0,59,120,121,122,0,0,18,99,0,59,120,120,120,0,0,0, -0,1,0,12,0,100,101,103,114,101,101,115,0,1,1,0,12,114,97,100,0,0,0,1,3,2,1,9,1,99,0,2,17,49,56,48, +97,108,0,59,120,121,0,0,18,100,101,103,0,59,120,121,0,0,18,99,0,59,120,120,0,0,0,0,1,0,0,11,0,114, +97,100,105,97,110,115,0,1,1,0,11,100,101,103,0,0,0,1,3,2,1,0,9,1,99,0,2,17,51,0,49,52,49,53,57,50, +54,0,0,17,49,56,48,0,48,0,0,49,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95, +114,101,116,86,97,108,0,59,120,121,122,0,0,18,100,101,103,0,59,120,121,122,0,0,18,99,0,59,120,120, +120,0,0,0,0,1,0,0,12,0,114,97,100,105,97,110,115,0,1,1,0,12,100,101,103,0,0,0,1,3,2,1,0,9,1,99,0,2, +17,51,0,49,52,49,53,57,50,54,0,0,17,49,56,48,0,48,0,0,49,0,0,4,118,101,99,52,95,109,117,108,116, +105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,0,18,100,101,103,0,0,18,99,0,59,120,120,120,120, +0,0,0,0,1,0,0,9,0,100,101,103,114,101,101,115,0,1,1,0,9,114,97,100,0,0,0,1,3,2,1,0,9,1,99,0,2,17, +49,56,48,0,48,0,0,17,51,0,49,52,49,53,57,50,54,0,0,49,0,0,4,118,101,99,52,95,109,117,108,116,105, +112,108,121,0,18,95,95,114,101,116,86,97,108,0,0,18,114,97,100,0,0,18,99,0,0,0,0,1,0,0,10,0,100, +101,103,114,101,101,115,0,1,1,0,10,114,97,100,0,0,0,1,3,2,1,0,9,1,99,0,2,17,49,56,48,0,48,0,0,17, +51,0,49,52,49,53,57,50,54,0,0,49,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95, +114,101,116,86,97,108,0,59,120,121,0,0,18,114,97,100,0,59,120,121,0,0,18,99,0,59,120,120,0,0,0,0,1, +0,0,11,0,100,101,103,114,101,101,115,0,1,1,0,11,114,97,100,0,0,0,1,3,2,1,0,9,1,99,0,2,17,49,56,48, 0,48,0,0,17,51,0,49,52,49,53,57,50,54,0,0,49,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108, -121,0,18,95,95,114,101,116,86,97,108,0,0,18,114,97,100,0,0,18,99,0,59,120,120,120,120,0,0,0,0,1,0, -9,0,115,105,110,0,1,1,0,9,114,97,100,105,97,110,115,0,0,0,1,4,102,108,111,97,116,95,115,105,110, -101,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,114,97,100,105,97,110,115,0,0,0,0,1,0,10,0, -115,105,110,0,1,1,0,10,114,97,100,105,97,110,115,0,0,0,1,4,102,108,111,97,116,95,115,105,110,101,0, -18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,114,97,100,105,97,110,115,0,59,120,0,0,0,4,102,108, -111,97,116,95,115,105,110,101,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,114,97,100,105,97, -110,115,0,59,121,0,0,0,0,1,0,11,0,115,105,110,0,1,1,0,11,114,97,100,105,97,110,115,0,0,0,1,4,102, -108,111,97,116,95,115,105,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,114,97,100,105, -97,110,115,0,59,120,0,0,0,4,102,108,111,97,116,95,115,105,110,101,0,18,95,95,114,101,116,86,97,108, -0,59,121,0,0,18,114,97,100,105,97,110,115,0,59,121,0,0,0,4,102,108,111,97,116,95,115,105,110,101,0, -18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,114,97,100,105,97,110,115,0,59,122,0,0,0,0,1,0,12,0, -115,105,110,0,1,1,0,12,114,97,100,105,97,110,115,0,0,0,1,4,102,108,111,97,116,95,115,105,110,101,0, -18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,114,97,100,105,97,110,115,0,59,120,0,0,0,4,102,108, -111,97,116,95,115,105,110,101,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,114,97,100,105,97, -110,115,0,59,121,0,0,0,4,102,108,111,97,116,95,115,105,110,101,0,18,95,95,114,101,116,86,97,108,0, -59,122,0,0,18,114,97,100,105,97,110,115,0,59,122,0,0,0,4,102,108,111,97,116,95,115,105,110,101,0, -18,95,95,114,101,116,86,97,108,0,59,119,0,0,18,114,97,100,105,97,110,115,0,59,119,0,0,0,0,1,0,9,0, -99,111,115,0,1,1,0,9,114,97,100,105,97,110,115,0,0,0,1,4,102,108,111,97,116,95,99,111,115,105,110, -101,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,114,97,100,105,97,110,115,0,0,0,0,1,0,10,0,99, -111,115,0,1,1,0,10,114,97,100,105,97,110,115,0,0,0,1,4,102,108,111,97,116,95,99,111,115,105,110, -101,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,114,97,100,105,97,110,115,0,59,120,0,0,0,4, -102,108,111,97,116,95,99,111,115,105,110,101,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,114, -97,100,105,97,110,115,0,59,121,0,0,0,0,1,0,11,0,99,111,115,0,1,1,0,11,114,97,100,105,97,110,115,0, -0,0,1,4,102,108,111,97,116,95,99,111,115,105,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0, -18,114,97,100,105,97,110,115,0,59,120,0,0,0,4,102,108,111,97,116,95,99,111,115,105,110,101,0,18,95, -95,114,101,116,86,97,108,0,59,121,0,0,18,114,97,100,105,97,110,115,0,59,121,0,0,0,4,102,108,111,97, -116,95,99,111,115,105,110,101,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,114,97,100,105,97, -110,115,0,59,122,0,0,0,0,1,0,12,0,99,111,115,0,1,1,0,12,114,97,100,105,97,110,115,0,0,0,1,4,102, -108,111,97,116,95,99,111,115,105,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,114,97, -100,105,97,110,115,0,59,120,0,0,0,4,102,108,111,97,116,95,99,111,115,105,110,101,0,18,95,95,114, +121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,114,97,100,0,59,120,121,122,0,0,18,99, +0,59,120,120,120,0,0,0,0,1,0,0,12,0,100,101,103,114,101,101,115,0,1,1,0,12,114,97,100,0,0,0,1,3,2, +1,0,9,1,99,0,2,17,49,56,48,0,48,0,0,17,51,0,49,52,49,53,57,50,54,0,0,49,0,0,4,118,101,99,52,95,109, +117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,0,18,114,97,100,0,0,18,99,0,59,120, +120,120,120,0,0,0,0,1,0,0,9,0,115,105,110,0,1,1,0,9,114,97,100,105,97,110,115,0,0,0,1,4,102,108, +111,97,116,95,115,105,110,101,0,18,95,95,114,101,116,86,97,108,0,0,18,114,97,100,105,97,110,115,0, +0,0,0,1,0,0,10,0,115,105,110,0,1,1,0,10,114,97,100,105,97,110,115,0,0,0,1,4,102,108,111,97,116,95, +115,105,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,114,97,100,105,97,110,115,0,59, +120,0,0,0,4,102,108,111,97,116,95,115,105,110,101,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18, +114,97,100,105,97,110,115,0,59,121,0,0,0,0,1,0,0,11,0,115,105,110,0,1,1,0,11,114,97,100,105,97,110, +115,0,0,0,1,4,102,108,111,97,116,95,115,105,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0, +18,114,97,100,105,97,110,115,0,59,120,0,0,0,4,102,108,111,97,116,95,115,105,110,101,0,18,95,95,114, 101,116,86,97,108,0,59,121,0,0,18,114,97,100,105,97,110,115,0,59,121,0,0,0,4,102,108,111,97,116,95, -99,111,115,105,110,101,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,114,97,100,105,97,110,115, -0,59,122,0,0,0,4,102,108,111,97,116,95,99,111,115,105,110,101,0,18,95,95,114,101,116,86,97,108,0, -59,119,0,0,18,114,97,100,105,97,110,115,0,59,119,0,0,0,0,1,0,9,0,116,97,110,0,1,1,0,9,97,110,103, -108,101,0,0,0,1,3,2,1,9,1,115,0,2,58,115,105,110,0,18,97,110,103,108,101,0,0,0,0,0,3,2,1,9,1,99,0, -2,58,99,111,115,0,18,97,110,103,108,101,0,0,0,0,0,8,18,115,0,18,99,0,49,0,0,1,0,10,0,116,97,110,0, -1,1,0,10,97,110,103,108,101,0,0,0,1,3,2,1,10,1,115,0,2,58,115,105,110,0,18,97,110,103,108,101,0,0, -0,0,0,3,2,1,10,1,99,0,2,58,99,111,115,0,18,97,110,103,108,101,0,0,0,0,0,8,18,115,0,18,99,0,49,0,0, -1,0,11,0,116,97,110,0,1,1,0,11,97,110,103,108,101,0,0,0,1,3,2,1,11,1,115,0,2,58,115,105,110,0,18, -97,110,103,108,101,0,0,0,0,0,3,2,1,11,1,99,0,2,58,99,111,115,0,18,97,110,103,108,101,0,0,0,0,0,8, -18,115,0,18,99,0,49,0,0,1,0,12,0,116,97,110,0,1,1,0,12,97,110,103,108,101,0,0,0,1,3,2,1,12,1,115,0, -2,58,115,105,110,0,18,97,110,103,108,101,0,0,0,0,0,3,2,1,12,1,99,0,2,58,99,111,115,0,18,97,110,103, -108,101,0,0,0,0,0,8,18,115,0,18,99,0,49,0,0,1,0,9,0,97,115,105,110,0,1,1,0,9,120,0,0,0,1,3,2,1,9,1, -97,48,0,2,17,49,0,53,55,48,55,50,56,56,0,0,0,0,3,2,1,9,1,97,49,0,2,17,48,0,50,49,50,49,49,52,52,0, -0,54,0,0,3,2,1,9,1,97,50,0,2,17,48,0,48,55,52,50,54,49,48,0,0,0,0,3,2,1,9,1,104,97,108,102,80,105, -0,2,17,51,0,49,52,49,53,57,50,54,0,0,17,48,0,53,0,0,48,0,0,3,2,1,9,1,121,0,2,58,97,98,115,0,18,120, -0,0,0,0,0,9,18,95,95,114,101,116,86,97,108,0,18,104,97,108,102,80,105,0,58,115,113,114,116,0,17,49, -0,48,0,0,18,121,0,47,0,0,18,97,48,0,18,121,0,18,97,49,0,18,97,50,0,18,121,0,48,46,48,46,48,47,58, -115,105,103,110,0,18,120,0,0,0,48,20,0,0,1,0,10,0,97,115,105,110,0,1,1,0,10,118,0,0,0,1,9,18,95,95, -114,101,116,86,97,108,0,59,120,0,58,97,115,105,110,0,18,118,0,59,120,0,0,0,20,0,9,18,95,95,114,101, -116,86,97,108,0,59,121,0,58,97,115,105,110,0,18,118,0,59,121,0,0,0,20,0,0,1,0,11,0,97,115,105,110, -0,1,1,0,11,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,97,115,105,110,0,18,118,0,59, -120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,97,115,105,110,0,18,118,0,59,121,0,0, -0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,97,115,105,110,0,18,118,0,59,122,0,0,0,20,0, -0,1,0,12,0,97,115,105,110,0,1,1,0,12,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,97, -115,105,110,0,18,118,0,59,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,97,115,105, -110,0,18,118,0,59,121,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,97,115,105,110,0, -18,118,0,59,122,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,97,115,105,110,0,18,118, -0,59,119,0,0,0,20,0,0,1,0,9,0,97,99,111,115,0,1,1,0,9,120,0,0,0,1,3,2,1,9,1,104,97,108,102,80,105, -0,2,17,51,0,49,52,49,53,57,50,54,0,0,17,48,0,53,0,0,48,0,0,9,18,95,95,114,101,116,86,97,108,0,18, -104,97,108,102,80,105,0,58,97,115,105,110,0,18,120,0,0,0,47,20,0,0,1,0,10,0,97,99,111,115,0,1,1,0, -10,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,97,99,111,115,0,18,118,0,59,120,0,0, -0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,97,99,111,115,0,18,118,0,59,121,0,0,0,20,0,0, -1,0,11,0,97,99,111,115,0,1,1,0,11,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,97,99, -111,115,0,18,118,0,59,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,97,99,111,115, -0,18,118,0,59,121,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,97,99,111,115,0,18,118, -0,59,122,0,0,0,20,0,0,1,0,12,0,97,99,111,115,0,1,1,0,12,118,0,0,0,1,9,18,95,95,114,101,116,86,97, -108,0,59,120,0,58,97,99,111,115,0,18,118,0,59,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59, -121,0,58,97,99,111,115,0,18,118,0,59,121,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58, -97,99,111,115,0,18,118,0,59,122,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,97,99, -111,115,0,18,118,0,59,119,0,0,0,20,0,0,1,0,9,0,97,116,97,110,0,1,1,0,9,120,0,0,0,1,9,18,95,95,114, +115,105,110,101,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,114,97,100,105,97,110,115,0,59, +122,0,0,0,0,1,0,0,12,0,115,105,110,0,1,1,0,12,114,97,100,105,97,110,115,0,0,0,1,4,102,108,111,97, +116,95,115,105,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,114,97,100,105,97,110,115, +0,59,120,0,0,0,4,102,108,111,97,116,95,115,105,110,101,0,18,95,95,114,101,116,86,97,108,0,59,121,0, +0,18,114,97,100,105,97,110,115,0,59,121,0,0,0,4,102,108,111,97,116,95,115,105,110,101,0,18,95,95, +114,101,116,86,97,108,0,59,122,0,0,18,114,97,100,105,97,110,115,0,59,122,0,0,0,4,102,108,111,97, +116,95,115,105,110,101,0,18,95,95,114,101,116,86,97,108,0,59,119,0,0,18,114,97,100,105,97,110,115, +0,59,119,0,0,0,0,1,0,0,9,0,99,111,115,0,1,1,0,9,114,97,100,105,97,110,115,0,0,0,1,4,102,108,111,97, +116,95,99,111,115,105,110,101,0,18,95,95,114,101,116,86,97,108,0,0,18,114,97,100,105,97,110,115,0, +0,0,0,1,0,0,10,0,99,111,115,0,1,1,0,10,114,97,100,105,97,110,115,0,0,0,1,4,102,108,111,97,116,95, +99,111,115,105,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,114,97,100,105,97,110,115, +0,59,120,0,0,0,4,102,108,111,97,116,95,99,111,115,105,110,101,0,18,95,95,114,101,116,86,97,108,0, +59,121,0,0,18,114,97,100,105,97,110,115,0,59,121,0,0,0,0,1,0,0,11,0,99,111,115,0,1,1,0,11,114,97, +100,105,97,110,115,0,0,0,1,4,102,108,111,97,116,95,99,111,115,105,110,101,0,18,95,95,114,101,116, +86,97,108,0,59,120,0,0,18,114,97,100,105,97,110,115,0,59,120,0,0,0,4,102,108,111,97,116,95,99,111, +115,105,110,101,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,114,97,100,105,97,110,115,0,59, +121,0,0,0,4,102,108,111,97,116,95,99,111,115,105,110,101,0,18,95,95,114,101,116,86,97,108,0,59,122, +0,0,18,114,97,100,105,97,110,115,0,59,122,0,0,0,0,1,0,0,12,0,99,111,115,0,1,1,0,12,114,97,100,105, +97,110,115,0,0,0,1,4,102,108,111,97,116,95,99,111,115,105,110,101,0,18,95,95,114,101,116,86,97,108, +0,59,120,0,0,18,114,97,100,105,97,110,115,0,59,120,0,0,0,4,102,108,111,97,116,95,99,111,115,105, +110,101,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,114,97,100,105,97,110,115,0,59,121,0,0,0, +4,102,108,111,97,116,95,99,111,115,105,110,101,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18, +114,97,100,105,97,110,115,0,59,122,0,0,0,4,102,108,111,97,116,95,99,111,115,105,110,101,0,18,95,95, +114,101,116,86,97,108,0,59,119,0,0,18,114,97,100,105,97,110,115,0,59,119,0,0,0,0,1,0,0,9,0,116,97, +110,0,1,1,0,9,97,110,103,108,101,0,0,0,1,3,2,1,0,9,1,115,0,2,58,115,105,110,0,18,97,110,103,108, +101,0,0,0,0,0,3,2,1,0,9,1,99,0,2,58,99,111,115,0,18,97,110,103,108,101,0,0,0,0,0,8,18,115,0,18,99, +0,49,0,0,1,0,0,10,0,116,97,110,0,1,1,0,10,97,110,103,108,101,0,0,0,1,3,2,1,0,10,1,115,0,2,58,115, +105,110,0,18,97,110,103,108,101,0,0,0,0,0,3,2,1,0,10,1,99,0,2,58,99,111,115,0,18,97,110,103,108, +101,0,0,0,0,0,8,18,115,0,18,99,0,49,0,0,1,0,0,11,0,116,97,110,0,1,1,0,11,97,110,103,108,101,0,0,0, +1,3,2,1,0,11,1,115,0,2,58,115,105,110,0,18,97,110,103,108,101,0,0,0,0,0,3,2,1,0,11,1,99,0,2,58,99, +111,115,0,18,97,110,103,108,101,0,0,0,0,0,8,18,115,0,18,99,0,49,0,0,1,0,0,12,0,116,97,110,0,1,1,0, +12,97,110,103,108,101,0,0,0,1,3,2,1,0,12,1,115,0,2,58,115,105,110,0,18,97,110,103,108,101,0,0,0,0, +0,3,2,1,0,12,1,99,0,2,58,99,111,115,0,18,97,110,103,108,101,0,0,0,0,0,8,18,115,0,18,99,0,49,0,0,1, +0,0,9,0,97,115,105,110,0,1,1,0,9,120,0,0,0,1,3,2,1,0,9,1,97,48,0,2,17,49,0,53,55,48,55,50,56,56,0, +0,0,0,3,2,1,0,9,1,97,49,0,2,17,48,0,50,49,50,49,49,52,52,0,0,54,0,0,3,2,1,0,9,1,97,50,0,2,17,48,0, +48,55,52,50,54,49,48,0,0,0,0,3,2,1,0,9,1,104,97,108,102,80,105,0,2,17,51,0,49,52,49,53,57,50,54,0, +0,17,48,0,53,0,0,48,0,0,3,2,1,0,9,1,121,0,2,58,97,98,115,0,18,120,0,0,0,0,0,9,18,95,95,114,101,116, +86,97,108,0,18,104,97,108,102,80,105,0,58,115,113,114,116,0,17,49,0,48,0,0,18,121,0,47,0,0,18,97, +48,0,18,121,0,18,97,49,0,18,97,50,0,18,121,0,48,46,48,46,48,47,58,115,105,103,110,0,18,120,0,0,0, +48,20,0,0,1,0,0,10,0,97,115,105,110,0,1,1,0,10,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59, +120,0,58,97,115,105,110,0,18,118,0,59,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0, +58,97,115,105,110,0,18,118,0,59,121,0,0,0,20,0,0,1,0,0,11,0,97,115,105,110,0,1,1,0,11,118,0,0,0,1, +9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,97,115,105,110,0,18,118,0,59,120,0,0,0,20,0,9,18,95, +95,114,101,116,86,97,108,0,59,121,0,58,97,115,105,110,0,18,118,0,59,121,0,0,0,20,0,9,18,95,95,114, +101,116,86,97,108,0,59,122,0,58,97,115,105,110,0,18,118,0,59,122,0,0,0,20,0,0,1,0,0,12,0,97,115, +105,110,0,1,1,0,12,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,97,115,105,110,0,18, +118,0,59,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,97,115,105,110,0,18,118,0, +59,121,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,97,115,105,110,0,18,118,0,59,122, +0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,97,115,105,110,0,18,118,0,59,119,0,0,0, +20,0,0,1,0,0,9,0,97,99,111,115,0,1,1,0,9,120,0,0,0,1,3,2,1,0,9,1,104,97,108,102,80,105,0,2,17,51,0, +49,52,49,53,57,50,54,0,0,17,48,0,53,0,0,48,0,0,9,18,95,95,114,101,116,86,97,108,0,18,104,97,108, +102,80,105,0,58,97,115,105,110,0,18,120,0,0,0,47,20,0,0,1,0,0,10,0,97,99,111,115,0,1,1,0,10,118,0, +0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,97,99,111,115,0,18,118,0,59,120,0,0,0,20,0,9, +18,95,95,114,101,116,86,97,108,0,59,121,0,58,97,99,111,115,0,18,118,0,59,121,0,0,0,20,0,0,1,0,0,11, +0,97,99,111,115,0,1,1,0,11,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,97,99,111, +115,0,18,118,0,59,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,97,99,111,115,0,18, +118,0,59,121,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,97,99,111,115,0,18,118,0,59, +122,0,0,0,20,0,0,1,0,0,12,0,97,99,111,115,0,1,1,0,12,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108, +0,59,120,0,58,97,99,111,115,0,18,118,0,59,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121, +0,58,97,99,111,115,0,18,118,0,59,121,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,97, +99,111,115,0,18,118,0,59,122,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,97,99,111, +115,0,18,118,0,59,119,0,0,0,20,0,0,1,0,0,9,0,97,116,97,110,0,1,1,0,9,120,0,0,0,1,9,18,95,95,114, 101,116,86,97,108,0,58,97,115,105,110,0,18,120,0,58,105,110,118,101,114,115,101,115,113,114,116,0, -18,120,0,18,120,0,48,17,49,0,48,0,0,46,0,0,48,0,0,20,0,0,1,0,10,0,97,116,97,110,0,1,1,0,10,121,95, -111,118,101,114,95,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,97,116,97,110,0,18, -121,95,111,118,101,114,95,120,0,59,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58, -97,116,97,110,0,18,121,95,111,118,101,114,95,120,0,59,121,0,0,0,20,0,0,1,0,11,0,97,116,97,110,0,1, -1,0,11,121,95,111,118,101,114,95,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,97,116, -97,110,0,18,121,95,111,118,101,114,95,120,0,59,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0, -59,121,0,58,97,116,97,110,0,18,121,95,111,118,101,114,95,120,0,59,121,0,0,0,20,0,9,18,95,95,114, +18,120,0,18,120,0,48,17,49,0,48,0,0,46,0,0,48,0,0,20,0,0,1,0,0,10,0,97,116,97,110,0,1,1,0,10,121, +95,111,118,101,114,95,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,97,116,97,110,0, +18,121,95,111,118,101,114,95,120,0,59,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0, +58,97,116,97,110,0,18,121,95,111,118,101,114,95,120,0,59,121,0,0,0,20,0,0,1,0,0,11,0,97,116,97,110, +0,1,1,0,11,121,95,111,118,101,114,95,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,97, +116,97,110,0,18,121,95,111,118,101,114,95,120,0,59,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108, +0,59,121,0,58,97,116,97,110,0,18,121,95,111,118,101,114,95,120,0,59,121,0,0,0,20,0,9,18,95,95,114, 101,116,86,97,108,0,59,122,0,58,97,116,97,110,0,18,121,95,111,118,101,114,95,120,0,59,122,0,0,0,20, -0,0,1,0,12,0,97,116,97,110,0,1,1,0,12,121,95,111,118,101,114,95,120,0,0,0,1,9,18,95,95,114,101,116, -86,97,108,0,59,120,0,58,97,116,97,110,0,18,121,95,111,118,101,114,95,120,0,59,120,0,0,0,20,0,9,18, -95,95,114,101,116,86,97,108,0,59,121,0,58,97,116,97,110,0,18,121,95,111,118,101,114,95,120,0,59, +0,0,1,0,0,12,0,97,116,97,110,0,1,1,0,12,121,95,111,118,101,114,95,120,0,0,0,1,9,18,95,95,114,101, +116,86,97,108,0,59,120,0,58,97,116,97,110,0,18,121,95,111,118,101,114,95,120,0,59,120,0,0,0,20,0,9, +18,95,95,114,101,116,86,97,108,0,59,121,0,58,97,116,97,110,0,18,121,95,111,118,101,114,95,120,0,59, 121,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,97,116,97,110,0,18,121,95,111,118, 101,114,95,120,0,59,122,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,97,116,97,110,0, -18,121,95,111,118,101,114,95,120,0,59,119,0,0,0,20,0,0,1,0,9,0,97,116,97,110,0,1,1,0,9,121,0,0,1,1, -0,9,120,0,0,0,1,3,2,0,9,1,114,0,0,0,10,58,97,98,115,0,18,120,0,0,0,17,49,0,48,0,45,52,0,41,0,2,9, -18,114,0,58,97,116,97,110,0,18,121,0,18,120,0,49,0,0,20,0,10,18,120,0,17,48,0,48,0,0,40,0,2,9,18, +18,121,95,111,118,101,114,95,120,0,59,119,0,0,0,20,0,0,1,0,0,9,0,97,116,97,110,0,1,1,0,9,121,0,0,1, +1,0,9,120,0,0,0,1,3,2,0,0,9,1,114,0,0,0,10,58,97,98,115,0,18,120,0,0,0,17,49,0,48,0,45,52,0,41,0,2, +9,18,114,0,58,97,116,97,110,0,18,121,0,18,120,0,49,0,0,20,0,10,18,120,0,17,48,0,48,0,0,40,0,2,9,18, 114,0,18,114,0,58,115,105,103,110,0,18,121,0,0,0,17,51,0,49,52,49,53,57,51,0,0,48,46,20,0,0,9,14,0, 0,2,9,18,114,0,58,115,105,103,110,0,18,121,0,0,0,17,49,0,53,55,48,55,57,54,53,0,0,48,20,0,0,8,18, -114,0,0,0,1,0,10,0,97,116,97,110,0,1,1,0,10,117,0,0,1,1,0,10,118,0,0,0,1,9,18,95,95,114,101,116,86, -97,108,0,59,120,0,58,97,116,97,110,0,18,117,0,59,120,0,0,18,118,0,59,120,0,0,0,20,0,9,18,95,95,114, -101,116,86,97,108,0,59,121,0,58,97,116,97,110,0,18,117,0,59,121,0,0,18,118,0,59,121,0,0,0,20,0,0,1, -0,11,0,97,116,97,110,0,1,1,0,11,117,0,0,1,1,0,11,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59, -120,0,58,97,116,97,110,0,18,117,0,59,120,0,0,18,118,0,59,120,0,0,0,20,0,9,18,95,95,114,101,116,86, -97,108,0,59,121,0,58,97,116,97,110,0,18,117,0,59,121,0,0,18,118,0,59,121,0,0,0,20,0,9,18,95,95,114, -101,116,86,97,108,0,59,122,0,58,97,116,97,110,0,18,117,0,59,122,0,0,18,118,0,59,122,0,0,0,20,0,0,1, -0,12,0,97,116,97,110,0,1,1,0,12,117,0,0,1,1,0,12,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59, -120,0,58,97,116,97,110,0,18,117,0,59,120,0,0,18,118,0,59,120,0,0,0,20,0,9,18,95,95,114,101,116,86, -97,108,0,59,121,0,58,97,116,97,110,0,18,117,0,59,121,0,0,18,118,0,59,121,0,0,0,20,0,9,18,95,95,114, -101,116,86,97,108,0,59,122,0,58,97,116,97,110,0,18,117,0,59,122,0,0,18,118,0,59,122,0,0,0,20,0,9, -18,95,95,114,101,116,86,97,108,0,59,119,0,58,97,116,97,110,0,18,117,0,59,119,0,0,18,118,0,59,119,0, -0,0,20,0,0,1,0,9,0,112,111,119,0,1,1,0,9,97,0,0,1,1,0,9,98,0,0,0,1,4,102,108,111,97,116,95,112,111, -119,101,114,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,97,0,0,18,98,0,0,0,0,1,0,10,0,112,111, -119,0,1,1,0,10,97,0,0,1,1,0,10,98,0,0,0,1,4,102,108,111,97,116,95,112,111,119,101,114,0,18,95,95, -114,101,116,86,97,108,0,59,120,0,0,18,97,0,59,120,0,0,18,98,0,59,120,0,0,0,4,102,108,111,97,116,95, -112,111,119,101,114,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,97,0,59,121,0,0,18,98,0,59, -121,0,0,0,0,1,0,11,0,112,111,119,0,1,1,0,11,97,0,0,1,1,0,11,98,0,0,0,1,4,102,108,111,97,116,95,112, -111,119,101,114,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,97,0,59,120,0,0,18,98,0,59,120,0, -0,0,4,102,108,111,97,116,95,112,111,119,101,114,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18, -97,0,59,121,0,0,18,98,0,59,121,0,0,0,4,102,108,111,97,116,95,112,111,119,101,114,0,18,95,95,114, -101,116,86,97,108,0,59,122,0,0,18,97,0,59,122,0,0,18,98,0,59,122,0,0,0,0,1,0,12,0,112,111,119,0,1, -1,0,12,97,0,0,1,1,0,12,98,0,0,0,1,4,102,108,111,97,116,95,112,111,119,101,114,0,18,95,95,114,101, -116,86,97,108,0,59,120,0,0,18,97,0,59,120,0,0,18,98,0,59,120,0,0,0,4,102,108,111,97,116,95,112,111, -119,101,114,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,97,0,59,121,0,0,18,98,0,59,121,0,0,0, -4,102,108,111,97,116,95,112,111,119,101,114,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,97,0, -59,122,0,0,18,98,0,59,122,0,0,0,4,102,108,111,97,116,95,112,111,119,101,114,0,18,95,95,114,101,116, -86,97,108,0,59,119,0,0,18,97,0,59,119,0,0,18,98,0,59,119,0,0,0,0,1,0,9,0,101,120,112,0,1,1,0,9,97, -0,0,0,1,3,2,1,9,1,101,0,2,17,50,0,55,49,56,50,56,0,0,0,0,4,102,108,111,97,116,95,112,111,119,101, -114,0,18,95,95,114,101,116,86,97,108,0,0,18,101,0,0,18,97,0,0,0,0,1,0,10,0,101,120,112,0,1,1,0,10, -97,0,0,0,1,3,2,1,9,1,101,0,2,17,50,0,55,49,56,50,56,0,0,0,0,4,102,108,111,97,116,95,112,111,119, -101,114,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,101,0,0,18,97,0,59,120,0,0,0,4,102,108, -111,97,116,95,112,111,119,101,114,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,101,0,0,18,97,0, -59,121,0,0,0,0,1,0,11,0,101,120,112,0,1,1,0,11,97,0,0,0,1,3,2,1,9,1,101,0,2,17,50,0,55,49,56,50,56, -0,0,0,0,4,102,108,111,97,116,95,112,111,119,101,114,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0, -18,101,0,0,18,97,0,59,120,0,0,0,4,102,108,111,97,116,95,112,111,119,101,114,0,18,95,95,114,101,116, -86,97,108,0,59,121,0,0,18,101,0,0,18,97,0,59,121,0,0,0,4,102,108,111,97,116,95,112,111,119,101,114, -0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,101,0,0,18,97,0,59,122,0,0,0,0,1,0,12,0,101,120, -112,0,1,1,0,12,97,0,0,0,1,3,2,1,9,1,101,0,2,17,50,0,55,49,56,50,56,0,0,0,0,4,102,108,111,97,116,95, -112,111,119,101,114,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,101,0,0,18,97,0,59,120,0,0,0, -4,102,108,111,97,116,95,112,111,119,101,114,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,101,0, -0,18,97,0,59,121,0,0,0,4,102,108,111,97,116,95,112,111,119,101,114,0,18,95,95,114,101,116,86,97, -108,0,59,122,0,0,18,101,0,0,18,97,0,59,122,0,0,0,4,102,108,111,97,116,95,112,111,119,101,114,0,18, -95,95,114,101,116,86,97,108,0,59,119,0,0,18,101,0,0,18,97,0,59,119,0,0,0,0,1,0,9,0,108,111,103,50, -0,1,1,0,9,120,0,0,0,1,4,102,108,111,97,116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59, -120,0,0,18,120,0,0,0,0,1,0,10,0,108,111,103,50,0,1,1,0,10,118,0,0,0,1,4,102,108,111,97,116,95,108, -111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,118,0,59,120,0,0,0,4,102,108,111,97, -116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,118,0,59,121,0,0,0,0,1,0,11, -0,108,111,103,50,0,1,1,0,11,118,0,0,0,1,4,102,108,111,97,116,95,108,111,103,50,0,18,95,95,114,101, -116,86,97,108,0,59,120,0,0,18,118,0,59,120,0,0,0,4,102,108,111,97,116,95,108,111,103,50,0,18,95,95, -114,101,116,86,97,108,0,59,121,0,0,18,118,0,59,121,0,0,0,4,102,108,111,97,116,95,108,111,103,50,0, -18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,118,0,59,122,0,0,0,0,1,0,12,0,108,111,103,50,0,1,1, -0,12,118,0,0,0,1,4,102,108,111,97,116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,120, -0,0,18,118,0,59,120,0,0,0,4,102,108,111,97,116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108, -0,59,121,0,0,18,118,0,59,121,0,0,0,4,102,108,111,97,116,95,108,111,103,50,0,18,95,95,114,101,116, -86,97,108,0,59,122,0,0,18,118,0,59,122,0,0,0,4,102,108,111,97,116,95,108,111,103,50,0,18,95,95,114, -101,116,86,97,108,0,59,119,0,0,18,118,0,59,119,0,0,0,0,1,0,9,0,108,111,103,0,1,1,0,9,120,0,0,0,1,3, -2,1,9,1,99,0,2,17,48,0,54,57,51,49,52,55,49,56,49,0,0,0,0,8,58,108,111,103,50,0,18,120,0,0,0,18,99, -0,48,0,0,1,0,10,0,108,111,103,0,1,1,0,10,118,0,0,0,1,3,2,1,9,1,99,0,2,17,48,0,54,57,51,49,52,55,49, -56,49,0,0,0,0,8,58,108,111,103,50,0,18,118,0,0,0,18,99,0,48,0,0,1,0,11,0,108,111,103,0,1,1,0,11, -118,0,0,0,1,3,2,1,9,1,99,0,2,17,48,0,54,57,51,49,52,55,49,56,49,0,0,0,0,8,58,108,111,103,50,0,18, -118,0,0,0,18,99,0,48,0,0,1,0,12,0,108,111,103,0,1,1,0,12,118,0,0,0,1,3,2,1,9,1,99,0,2,17,48,0,54, -57,51,49,52,55,49,56,49,0,0,0,0,8,58,108,111,103,50,0,18,118,0,0,0,18,99,0,48,0,0,1,0,9,0,101,120, -112,50,0,1,1,0,9,97,0,0,0,1,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97, -108,0,59,120,0,0,18,97,0,0,0,0,1,0,10,0,101,120,112,50,0,1,1,0,10,97,0,0,0,1,4,102,108,111,97,116, -95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,97,0,59,120,0,0,0,4,102,108,111, -97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,97,0,59,121,0,0,0,0,1,0, -11,0,101,120,112,50,0,1,1,0,11,97,0,0,0,1,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114, -101,116,86,97,108,0,59,120,0,0,18,97,0,59,120,0,0,0,4,102,108,111,97,116,95,101,120,112,50,0,18,95, -95,114,101,116,86,97,108,0,59,121,0,0,18,97,0,59,121,0,0,0,4,102,108,111,97,116,95,101,120,112,50, -0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,97,0,59,122,0,0,0,0,1,0,12,0,101,120,112,50,0,1,1, -0,12,97,0,0,0,1,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,59,120,0, +114,0,0,0,1,0,0,10,0,97,116,97,110,0,1,1,0,10,117,0,0,1,1,0,10,118,0,0,0,1,9,18,95,95,114,101,116, +86,97,108,0,59,120,0,58,97,116,97,110,0,18,117,0,59,120,0,0,18,118,0,59,120,0,0,0,20,0,9,18,95,95, +114,101,116,86,97,108,0,59,121,0,58,97,116,97,110,0,18,117,0,59,121,0,0,18,118,0,59,121,0,0,0,20,0, +0,1,0,0,11,0,97,116,97,110,0,1,1,0,11,117,0,0,1,1,0,11,118,0,0,0,1,9,18,95,95,114,101,116,86,97, +108,0,59,120,0,58,97,116,97,110,0,18,117,0,59,120,0,0,18,118,0,59,120,0,0,0,20,0,9,18,95,95,114, +101,116,86,97,108,0,59,121,0,58,97,116,97,110,0,18,117,0,59,121,0,0,18,118,0,59,121,0,0,0,20,0,9, +18,95,95,114,101,116,86,97,108,0,59,122,0,58,97,116,97,110,0,18,117,0,59,122,0,0,18,118,0,59,122,0, +0,0,20,0,0,1,0,0,12,0,97,116,97,110,0,1,1,0,12,117,0,0,1,1,0,12,118,0,0,0,1,9,18,95,95,114,101,116, +86,97,108,0,59,120,0,58,97,116,97,110,0,18,117,0,59,120,0,0,18,118,0,59,120,0,0,0,20,0,9,18,95,95, +114,101,116,86,97,108,0,59,121,0,58,97,116,97,110,0,18,117,0,59,121,0,0,18,118,0,59,121,0,0,0,20,0, +9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,97,116,97,110,0,18,117,0,59,122,0,0,18,118,0,59,122, +0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,97,116,97,110,0,18,117,0,59,119,0,0,18, +118,0,59,119,0,0,0,20,0,0,1,0,0,9,0,112,111,119,0,1,1,0,9,97,0,0,1,1,0,9,98,0,0,0,1,4,102,108,111, +97,116,95,112,111,119,101,114,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,0,0, +10,0,112,111,119,0,1,1,0,10,97,0,0,1,1,0,10,98,0,0,0,1,4,102,108,111,97,116,95,112,111,119,101,114, +0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,97,0,59,120,0,0,18,98,0,59,120,0,0,0,4,102,108, +111,97,116,95,112,111,119,101,114,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,97,0,59,121,0,0, +18,98,0,59,121,0,0,0,0,1,0,0,11,0,112,111,119,0,1,1,0,11,97,0,0,1,1,0,11,98,0,0,0,1,4,102,108,111, +97,116,95,112,111,119,101,114,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,97,0,59,120,0,0,18, +98,0,59,120,0,0,0,4,102,108,111,97,116,95,112,111,119,101,114,0,18,95,95,114,101,116,86,97,108,0, +59,121,0,0,18,97,0,59,121,0,0,18,98,0,59,121,0,0,0,4,102,108,111,97,116,95,112,111,119,101,114,0, +18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,97,0,59,122,0,0,18,98,0,59,122,0,0,0,0,1,0,0,12,0, +112,111,119,0,1,1,0,12,97,0,0,1,1,0,12,98,0,0,0,1,4,102,108,111,97,116,95,112,111,119,101,114,0,18, +95,95,114,101,116,86,97,108,0,59,120,0,0,18,97,0,59,120,0,0,18,98,0,59,120,0,0,0,4,102,108,111,97, +116,95,112,111,119,101,114,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,97,0,59,121,0,0,18,98, +0,59,121,0,0,0,4,102,108,111,97,116,95,112,111,119,101,114,0,18,95,95,114,101,116,86,97,108,0,59, +122,0,0,18,97,0,59,122,0,0,18,98,0,59,122,0,0,0,4,102,108,111,97,116,95,112,111,119,101,114,0,18, +95,95,114,101,116,86,97,108,0,59,119,0,0,18,97,0,59,119,0,0,18,98,0,59,119,0,0,0,0,1,0,0,9,0,101, +120,112,0,1,1,0,9,97,0,0,0,1,3,2,0,0,9,1,116,0,2,18,97,0,17,49,0,52,52,50,54,57,53,48,50,0,0,48,0, +0,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,0,18,116,0,0,0,0,1,0,0, +10,0,101,120,112,0,1,1,0,10,97,0,0,0,1,3,2,0,0,10,1,116,0,2,18,97,0,17,49,0,52,52,50,54,57,53,48, +50,0,0,48,0,0,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0, +18,116,0,59,120,0,0,0,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,59, +121,0,0,18,116,0,59,121,0,0,0,0,1,0,0,11,0,101,120,112,0,1,1,0,11,97,0,0,0,1,3,2,0,0,11,1,116,0,2, +18,97,0,17,49,0,52,52,50,54,57,53,48,50,0,0,48,0,0,4,102,108,111,97,116,95,101,120,112,50,0,18,95, +95,114,101,116,86,97,108,0,59,120,0,0,18,116,0,59,120,0,0,0,4,102,108,111,97,116,95,101,120,112,50, +0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,116,0,59,121,0,0,0,4,102,108,111,97,116,95,101, +120,112,50,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,116,0,59,122,0,0,0,0,1,0,0,12,0,101, +120,112,0,1,1,0,12,97,0,0,0,1,3,2,0,0,12,1,116,0,2,18,97,0,17,49,0,52,52,50,54,57,53,48,50,0,0,48, +0,0,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,116,0, +59,120,0,0,0,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0, +18,116,0,59,121,0,0,0,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,59, +122,0,0,18,116,0,59,122,0,0,0,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97, +108,0,59,119,0,0,18,116,0,59,119,0,0,0,0,1,0,0,9,0,108,111,103,50,0,1,1,0,9,120,0,0,0,1,4,102,108, +111,97,116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,0,0,10,0,108, +111,103,50,0,1,1,0,10,118,0,0,0,1,4,102,108,111,97,116,95,108,111,103,50,0,18,95,95,114,101,116,86, +97,108,0,59,120,0,0,18,118,0,59,120,0,0,0,4,102,108,111,97,116,95,108,111,103,50,0,18,95,95,114, +101,116,86,97,108,0,59,121,0,0,18,118,0,59,121,0,0,0,0,1,0,0,11,0,108,111,103,50,0,1,1,0,11,118,0, +0,0,1,4,102,108,111,97,116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,118, +0,59,120,0,0,0,4,102,108,111,97,116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,121,0, +0,18,118,0,59,121,0,0,0,4,102,108,111,97,116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0, +59,122,0,0,18,118,0,59,122,0,0,0,0,1,0,0,12,0,108,111,103,50,0,1,1,0,12,118,0,0,0,1,4,102,108,111, +97,116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,118,0,59,120,0,0,0,4,102, +108,111,97,116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,118,0,59,121,0,0, +0,4,102,108,111,97,116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,118,0,59, +122,0,0,0,4,102,108,111,97,116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,119,0,0,18, +118,0,59,119,0,0,0,0,1,0,0,9,0,108,111,103,0,1,1,0,9,120,0,0,0,1,3,2,1,0,9,1,99,0,2,17,48,0,54,57, +51,49,52,55,49,56,49,0,0,0,0,8,58,108,111,103,50,0,18,120,0,0,0,18,99,0,48,0,0,1,0,0,10,0,108,111, +103,0,1,1,0,10,118,0,0,0,1,3,2,1,0,9,1,99,0,2,17,48,0,54,57,51,49,52,55,49,56,49,0,0,0,0,8,58,108, +111,103,50,0,18,118,0,0,0,18,99,0,48,0,0,1,0,0,11,0,108,111,103,0,1,1,0,11,118,0,0,0,1,3,2,1,0,9,1, +99,0,2,17,48,0,54,57,51,49,52,55,49,56,49,0,0,0,0,8,58,108,111,103,50,0,18,118,0,0,0,18,99,0,48,0, +0,1,0,0,12,0,108,111,103,0,1,1,0,12,118,0,0,0,1,3,2,1,0,9,1,99,0,2,17,48,0,54,57,51,49,52,55,49,56, +49,0,0,0,0,8,58,108,111,103,50,0,18,118,0,0,0,18,99,0,48,0,0,1,0,0,9,0,101,120,112,50,0,1,1,0,9,97, +0,0,0,1,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,0,0, +1,0,0,10,0,101,120,112,50,0,1,1,0,10,97,0,0,0,1,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95, +114,101,116,86,97,108,0,59,120,0,0,18,97,0,59,120,0,0,0,4,102,108,111,97,116,95,101,120,112,50,0, +18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,97,0,59,121,0,0,0,0,1,0,0,11,0,101,120,112,50,0,1,1, +0,11,97,0,0,0,1,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,59,120,0, 0,18,97,0,59,120,0,0,0,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0, 59,121,0,0,18,97,0,59,121,0,0,0,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86, -97,108,0,59,122,0,0,18,97,0,59,122,0,0,0,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101, -116,86,97,108,0,59,119,0,0,18,97,0,59,119,0,0,0,0,1,0,9,0,115,113,114,116,0,1,1,0,9,120,0,0,0,1,3, -2,0,9,1,114,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18,120,0,0,0,4,102,108,111,97, -116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,114,0,0,0,0,1,0,10,0,115,113, -114,116,0,1,1,0,10,118,0,0,0,1,3,2,0,9,1,114,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0, -0,18,118,0,59,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59, -120,0,0,18,114,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18,118,0,59,121,0,0,0,4,102, -108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,114,0,0,0,0,1,0,11,0, -115,113,114,116,0,1,1,0,11,118,0,0,0,1,3,2,0,9,1,114,0,0,0,4,102,108,111,97,116,95,114,115,113,0, -18,114,0,0,18,118,0,59,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97, -108,0,59,120,0,0,18,114,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18,118,0,59,121,0,0, -0,4,102,108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,114,0,0,0,4, -102,108,111,97,116,95,114,115,113,0,18,114,0,0,18,118,0,59,122,0,0,0,4,102,108,111,97,116,95,114, -99,112,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,114,0,0,0,0,1,0,12,0,115,113,114,116,0,1,1, -0,12,118,0,0,0,1,3,2,0,9,1,114,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18,118,0,59, -120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,114, -0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18,118,0,59,121,0,0,0,4,102,108,111,97,116, -95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,114,0,0,0,4,102,108,111,97,116,95, -114,115,113,0,18,114,0,0,18,118,0,59,122,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95,95,114, -101,116,86,97,108,0,59,122,0,0,18,114,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18, -118,0,59,119,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59,119,0, -0,18,114,0,0,0,0,1,0,9,0,105,110,118,101,114,115,101,115,113,114,116,0,1,1,0,9,120,0,0,0,1,4,102, -108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,120,0,0,0,0,1,0,10, -0,105,110,118,101,114,115,101,115,113,114,116,0,1,1,0,10,118,0,0,0,1,4,102,108,111,97,116,95,114, -115,113,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,118,0,59,120,0,0,0,4,102,108,111,97,116, -95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,118,0,59,121,0,0,0,0,1,0,11,0,105, -110,118,101,114,115,101,115,113,114,116,0,1,1,0,11,118,0,0,0,1,4,102,108,111,97,116,95,114,115,113, -0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,118,0,59,120,0,0,0,4,102,108,111,97,116,95,114, -115,113,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,118,0,59,121,0,0,0,4,102,108,111,97,116, -95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,118,0,59,122,0,0,0,0,1,0,12,0,105, -110,118,101,114,115,101,115,113,114,116,0,1,1,0,12,118,0,0,0,1,4,102,108,111,97,116,95,114,115,113, -0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,118,0,59,120,0,0,0,4,102,108,111,97,116,95,114, -115,113,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,118,0,59,121,0,0,0,4,102,108,111,97,116, -95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,118,0,59,122,0,0,0,4,102,108,111, -97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,119,0,0,18,118,0,59,119,0,0,0,0,1,0,9, -0,110,111,114,109,97,108,105,122,101,0,1,1,0,9,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59, -120,0,17,49,0,48,0,0,20,0,0,1,0,10,0,110,111,114,109,97,108,105,122,101,0,1,1,0,10,118,0,0,0,1,3,2, -1,9,1,115,0,2,58,105,110,118,101,114,115,101,115,113,114,116,0,58,100,111,116,0,18,118,0,0,18,118, -0,0,0,0,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108, -0,59,120,121,0,0,18,118,0,0,18,115,0,59,120,120,0,0,0,0,1,0,11,0,110,111,114,109,97,108,105,122, -101,0,1,1,0,11,118,0,0,0,1,3,2,0,9,1,116,109,112,0,0,0,4,118,101,99,51,95,100,111,116,0,18,116,109, -112,0,0,18,118,0,0,18,118,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,116,109,112,0,0,18,116, -109,112,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108, -0,59,120,121,122,0,0,18,118,0,0,18,116,109,112,0,59,120,120,120,0,0,0,0,1,0,12,0,110,111,114,109, -97,108,105,122,101,0,1,1,0,12,118,0,0,0,1,3,2,0,9,1,116,109,112,0,0,0,4,118,101,99,52,95,100,111, -116,0,18,116,109,112,0,0,18,118,0,0,18,118,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,116,109, -112,0,0,18,116,109,112,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101, -116,86,97,108,0,59,120,121,122,0,0,18,118,0,0,18,116,109,112,0,59,120,120,120,0,0,0,0,1,0,9,0,97, -98,115,0,1,1,0,9,97,0,0,0,1,4,118,101,99,52,95,97,98,115,0,18,95,95,114,101,116,86,97,108,0,59,120, -0,0,18,97,0,0,0,0,1,0,10,0,97,98,115,0,1,1,0,10,97,0,0,0,1,4,118,101,99,52,95,97,98,115,0,18,95,95, -114,101,116,86,97,108,0,59,120,121,0,0,18,97,0,0,0,0,1,0,11,0,97,98,115,0,1,1,0,11,97,0,0,0,1,4, -118,101,99,52,95,97,98,115,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,97,0,0,0,0,1,0, -12,0,97,98,115,0,1,1,0,12,97,0,0,0,1,4,118,101,99,52,95,97,98,115,0,18,95,95,114,101,116,86,97,108, -0,0,18,97,0,0,0,0,1,0,9,0,115,105,103,110,0,1,1,0,9,120,0,0,0,1,3,2,0,9,1,112,0,0,1,1,110,0,0,0,4, -118,101,99,52,95,115,103,116,0,18,112,0,59,120,0,0,18,120,0,0,17,48,0,48,0,0,0,0,4,118,101,99,52, -95,115,103,116,0,18,110,0,59,120,0,0,17,48,0,48,0,0,0,18,120,0,0,0,4,118,101,99,52,95,115,117,98, -116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,112,0,0,18,110,0,0,0,0,1,0,10,0, -115,105,103,110,0,1,1,0,10,118,0,0,0,1,3,2,0,10,1,112,0,0,1,1,110,0,0,0,4,118,101,99,52,95,115,103, -116,0,18,112,0,59,120,121,0,0,18,118,0,0,17,48,0,48,0,0,0,0,4,118,101,99,52,95,115,103,116,0,18, -110,0,59,120,121,0,0,17,48,0,48,0,0,0,18,118,0,0,0,4,118,101,99,52,95,115,117,98,116,114,97,99,116, -0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,112,0,0,18,110,0,0,0,0,1,0,11,0,115,105,103, -110,0,1,1,0,11,118,0,0,0,1,3,2,0,11,1,112,0,0,1,1,110,0,0,0,4,118,101,99,52,95,115,103,116,0,18, -112,0,59,120,121,122,0,0,18,118,0,0,17,48,0,48,0,0,0,0,4,118,101,99,52,95,115,103,116,0,18,110,0, -59,120,121,122,0,0,17,48,0,48,0,0,0,18,118,0,0,0,4,118,101,99,52,95,115,117,98,116,114,97,99,116,0, -18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,112,0,0,18,110,0,0,0,0,1,0,12,0,115,105,103, -110,0,1,1,0,12,118,0,0,0,1,3,2,0,12,1,112,0,0,1,1,110,0,0,0,4,118,101,99,52,95,115,103,116,0,18, -112,0,0,18,118,0,0,17,48,0,48,0,0,0,0,4,118,101,99,52,95,115,103,116,0,18,110,0,0,17,48,0,48,0,0,0, -18,118,0,0,0,4,118,101,99,52,95,115,117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,0, -18,112,0,0,18,110,0,0,0,0,1,0,9,0,102,108,111,111,114,0,1,1,0,9,97,0,0,0,1,4,118,101,99,52,95,102, -108,111,111,114,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,97,0,0,0,0,1,0,10,0,102,108,111, -111,114,0,1,1,0,10,97,0,0,0,1,4,118,101,99,52,95,102,108,111,111,114,0,18,95,95,114,101,116,86,97, -108,0,59,120,121,0,0,18,97,0,0,0,0,1,0,11,0,102,108,111,111,114,0,1,1,0,11,97,0,0,0,1,4,118,101,99, -52,95,102,108,111,111,114,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,97,0,0,0,0,1,0, -12,0,102,108,111,111,114,0,1,1,0,12,97,0,0,0,1,4,118,101,99,52,95,102,108,111,111,114,0,18,95,95, -114,101,116,86,97,108,0,0,18,97,0,0,0,0,1,0,9,0,99,101,105,108,0,1,1,0,9,97,0,0,0,1,3,2,0,9,1,98,0, -2,18,97,0,54,0,0,4,118,101,99,52,95,102,108,111,111,114,0,18,98,0,0,18,98,0,0,0,9,18,95,95,114,101, -116,86,97,108,0,59,120,0,18,98,0,54,20,0,0,1,0,10,0,99,101,105,108,0,1,1,0,10,97,0,0,0,1,3,2,0,10, -1,98,0,2,18,97,0,54,0,0,4,118,101,99,52,95,102,108,111,111,114,0,18,98,0,0,18,98,0,0,0,9,18,95,95, -114,101,116,86,97,108,0,59,120,121,0,18,98,0,54,20,0,0,1,0,11,0,99,101,105,108,0,1,1,0,11,97,0,0,0, -1,3,2,0,11,1,98,0,2,18,97,0,54,0,0,4,118,101,99,52,95,102,108,111,111,114,0,18,98,0,0,18,98,0,0,0, -9,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,18,98,0,54,20,0,0,1,0,12,0,99,101,105,108,0,1, -1,0,12,97,0,0,0,1,3,2,0,12,1,98,0,2,18,97,0,54,0,0,4,118,101,99,52,95,102,108,111,111,114,0,18,98, -0,0,18,98,0,0,0,9,18,95,95,114,101,116,86,97,108,0,18,98,0,54,20,0,0,1,0,9,0,102,114,97,99,116,0,1, -1,0,9,97,0,0,0,1,4,118,101,99,52,95,102,114,97,99,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18, -97,0,0,0,0,1,0,10,0,102,114,97,99,116,0,1,1,0,10,97,0,0,0,1,4,118,101,99,52,95,102,114,97,99,0,18, -95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,97,0,0,0,0,1,0,11,0,102,114,97,99,116,0,1,1,0,11, -97,0,0,0,1,4,118,101,99,52,95,102,114,97,99,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0, -18,97,0,0,0,0,1,0,12,0,102,114,97,99,116,0,1,1,0,12,97,0,0,0,1,4,118,101,99,52,95,102,114,97,99,0, -18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,0,0,1,0,9,0,109,111,100,0,1,1,0,9,97,0,0,1,1,0,9,98,0, -0,0,1,3,2,0,9,1,111,110,101,79,118,101,114,66,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,111, -110,101,79,118,101,114,66,0,0,18,98,0,0,0,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18,97,0,18, -98,0,58,102,108,111,111,114,0,18,97,0,18,111,110,101,79,118,101,114,66,0,48,0,0,48,47,20,0,0,1,0, -10,0,109,111,100,0,1,1,0,10,97,0,0,1,1,0,9,98,0,0,0,1,3,2,0,9,1,111,110,101,79,118,101,114,66,0,0, -0,4,102,108,111,97,116,95,114,99,112,0,18,111,110,101,79,118,101,114,66,0,0,18,98,0,0,0,9,18,95,95, -114,101,116,86,97,108,0,59,120,121,0,18,97,0,18,98,0,58,102,108,111,111,114,0,18,97,0,18,111,110, -101,79,118,101,114,66,0,48,0,0,48,47,20,0,0,1,0,11,0,109,111,100,0,1,1,0,11,97,0,0,1,1,0,9,98,0,0, -0,1,3,2,0,9,1,111,110,101,79,118,101,114,66,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,111,110, -101,79,118,101,114,66,0,0,18,98,0,0,0,9,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,18,97,0, -18,98,0,58,102,108,111,111,114,0,18,97,0,18,111,110,101,79,118,101,114,66,0,48,0,0,48,47,20,0,0,1, -0,12,0,109,111,100,0,1,1,0,12,97,0,0,1,1,0,9,98,0,0,0,1,3,2,0,9,1,111,110,101,79,118,101,114,66,0, -0,0,4,102,108,111,97,116,95,114,99,112,0,18,111,110,101,79,118,101,114,66,0,0,18,98,0,0,0,9,18,95, -95,114,101,116,86,97,108,0,18,97,0,18,98,0,58,102,108,111,111,114,0,18,97,0,18,111,110,101,79,118, -101,114,66,0,48,0,0,48,47,20,0,0,1,0,10,0,109,111,100,0,1,1,0,10,97,0,0,1,1,0,10,98,0,0,0,1,3,2,0, -9,1,111,110,101,79,118,101,114,66,120,0,0,1,1,111,110,101,79,118,101,114,66,121,0,0,0,4,102,108, -111,97,116,95,114,99,112,0,18,111,110,101,79,118,101,114,66,120,0,0,18,98,0,59,120,0,0,0,4,102,108, -111,97,116,95,114,99,112,0,18,111,110,101,79,118,101,114,66,121,0,0,18,98,0,59,121,0,0,0,9,18,95, -95,114,101,116,86,97,108,0,59,120,0,18,97,0,59,120,0,18,98,0,59,120,0,58,102,108,111,111,114,0,18, -97,0,59,120,0,18,111,110,101,79,118,101,114,66,120,0,48,0,0,48,47,20,0,9,18,95,95,114,101,116,86, -97,108,0,59,121,0,18,97,0,59,121,0,18,98,0,59,121,0,58,102,108,111,111,114,0,18,97,0,59,121,0,18, -111,110,101,79,118,101,114,66,121,0,48,0,0,48,47,20,0,0,1,0,11,0,109,111,100,0,1,1,0,11,97,0,0,1,1, -0,11,98,0,0,0,1,3,2,0,9,1,111,110,101,79,118,101,114,66,120,0,0,1,1,111,110,101,79,118,101,114,66, -121,0,0,1,1,111,110,101,79,118,101,114,66,122,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,111, -110,101,79,118,101,114,66,120,0,0,18,98,0,59,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,111, -110,101,79,118,101,114,66,121,0,0,18,98,0,59,121,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,111, -110,101,79,118,101,114,66,122,0,0,18,98,0,59,122,0,0,0,9,18,95,95,114,101,116,86,97,108,0,59,120,0, -18,97,0,59,120,0,18,98,0,59,120,0,58,102,108,111,111,114,0,18,97,0,59,120,0,18,111,110,101,79,118, -101,114,66,120,0,48,0,0,48,47,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,18,97,0,59,121,0,18, -98,0,59,121,0,58,102,108,111,111,114,0,18,97,0,59,121,0,18,111,110,101,79,118,101,114,66,121,0,48, -0,0,48,47,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,18,97,0,59,122,0,18,98,0,59,122,0,58, -102,108,111,111,114,0,18,97,0,59,122,0,18,111,110,101,79,118,101,114,66,122,0,48,0,0,48,47,20,0,0, -1,0,12,0,109,111,100,0,1,1,0,12,97,0,0,1,1,0,12,98,0,0,0,1,3,2,0,9,1,111,110,101,79,118,101,114,66, -120,0,0,1,1,111,110,101,79,118,101,114,66,121,0,0,1,1,111,110,101,79,118,101,114,66,122,0,0,1,1, -111,110,101,79,118,101,114,66,119,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,111,110,101,79,118, -101,114,66,120,0,0,18,98,0,59,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,111,110,101,79,118, -101,114,66,121,0,0,18,98,0,59,121,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,111,110,101,79,118, -101,114,66,122,0,0,18,98,0,59,122,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,111,110,101,79,118, -101,114,66,119,0,0,18,98,0,59,119,0,0,0,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18,97,0,59,120, -0,18,98,0,59,120,0,58,102,108,111,111,114,0,18,97,0,59,120,0,18,111,110,101,79,118,101,114,66,120, -0,48,0,0,48,47,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,18,97,0,59,121,0,18,98,0,59,121,0, -58,102,108,111,111,114,0,18,97,0,59,121,0,18,111,110,101,79,118,101,114,66,121,0,48,0,0,48,47,20,0, -9,18,95,95,114,101,116,86,97,108,0,59,122,0,18,97,0,59,122,0,18,98,0,59,122,0,58,102,108,111,111, -114,0,18,97,0,59,122,0,18,111,110,101,79,118,101,114,66,122,0,48,0,0,48,47,20,0,9,18,95,95,114,101, -116,86,97,108,0,59,119,0,18,97,0,59,119,0,18,98,0,59,119,0,58,102,108,111,111,114,0,18,97,0,59,119, -0,18,111,110,101,79,118,101,114,66,119,0,48,0,0,48,47,20,0,0,1,0,9,0,109,105,110,0,1,1,0,9,97,0,0, -1,1,0,9,98,0,0,0,1,4,118,101,99,52,95,109,105,110,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18, -97,0,59,120,0,0,18,98,0,59,120,0,0,0,0,1,0,10,0,109,105,110,0,1,1,0,10,97,0,0,1,1,0,10,98,0,0,0,1, -4,118,101,99,52,95,109,105,110,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,97,0,59,120, -121,0,0,18,98,0,59,120,121,0,0,0,0,1,0,11,0,109,105,110,0,1,1,0,11,97,0,0,1,1,0,11,98,0,0,0,1,4, -118,101,99,52,95,109,105,110,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,97,0,59,120, -121,122,0,0,18,98,0,59,120,121,122,0,0,0,0,1,0,12,0,109,105,110,0,1,1,0,12,97,0,0,1,1,0,12,98,0,0, -0,1,4,118,101,99,52,95,109,105,110,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1, -0,10,0,109,105,110,0,1,1,0,10,97,0,0,1,1,0,9,98,0,0,0,1,4,118,101,99,52,95,109,105,110,0,18,95,95, -114,101,116,86,97,108,0,0,18,97,0,59,120,121,0,0,18,98,0,59,120,120,0,0,0,0,1,0,11,0,109,105,110,0, -1,1,0,11,97,0,0,1,1,0,9,98,0,0,0,1,4,118,101,99,52,95,109,105,110,0,18,95,95,114,101,116,86,97,108, -0,0,18,97,0,59,120,121,122,0,0,18,98,0,59,120,120,120,0,0,0,0,1,0,12,0,109,105,110,0,1,1,0,12,97,0, -0,1,1,0,9,98,0,0,0,1,4,118,101,99,52,95,109,105,110,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0, -18,98,0,59,120,120,120,120,0,0,0,0,1,0,9,0,109,97,120,0,1,1,0,9,97,0,0,1,1,0,9,98,0,0,0,1,4,118, -101,99,52,95,109,97,120,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,97,0,59,120,0,0,18,98,0, -59,120,0,0,0,0,1,0,10,0,109,97,120,0,1,1,0,10,97,0,0,1,1,0,10,98,0,0,0,1,4,118,101,99,52,95,109,97, -120,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,97,0,59,120,121,0,0,18,98,0,59,120,121,0, -0,0,0,1,0,11,0,109,97,120,0,1,1,0,11,97,0,0,1,1,0,11,98,0,0,0,1,4,118,101,99,52,95,109,97,120,0,18, -95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,97,0,59,120,121,122,0,0,18,98,0,59,120,121,122, -0,0,0,0,1,0,12,0,109,97,120,0,1,1,0,12,97,0,0,1,1,0,12,98,0,0,0,1,4,118,101,99,52,95,109,97,120,0, -18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,0,10,0,109,97,120,0,1,1,0,10,97,0,0,1, -1,0,9,98,0,0,0,1,4,118,101,99,52,95,109,97,120,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,59,120, -121,0,0,18,98,0,59,120,120,0,0,0,0,1,0,11,0,109,97,120,0,1,1,0,11,97,0,0,1,1,0,9,98,0,0,0,1,4,118, -101,99,52,95,109,97,120,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,59,120,121,122,0,0,18,98,0,59, -120,120,120,0,0,0,0,1,0,12,0,109,97,120,0,1,1,0,12,97,0,0,1,1,0,9,98,0,0,0,1,4,118,101,99,52,95, -109,97,120,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,59,120,120,120,120,0,0,0,0,1,0,9, -0,99,108,97,109,112,0,1,1,0,9,118,97,108,0,0,1,1,0,9,109,105,110,86,97,108,0,0,1,1,0,9,109,97,120, +97,108,0,59,122,0,0,18,97,0,59,122,0,0,0,0,1,0,0,12,0,101,120,112,50,0,1,1,0,12,97,0,0,0,1,4,102, +108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,97,0,59,120,0,0, +0,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,97,0,59, +121,0,0,0,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18, +97,0,59,122,0,0,0,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,59,119, +0,0,18,97,0,59,119,0,0,0,0,1,0,0,9,0,115,113,114,116,0,1,1,0,9,120,0,0,0,1,3,2,0,0,9,1,114,0,0,0,4, +102,108,111,97,116,95,114,115,113,0,18,114,0,0,18,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0, +18,95,95,114,101,116,86,97,108,0,0,18,114,0,0,0,0,1,0,0,10,0,115,113,114,116,0,1,1,0,10,118,0,0,0, +1,3,2,0,0,9,1,114,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18,118,0,59,120,0,0,0,4, +102,108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,114,0,0,0,4,102, +108,111,97,116,95,114,115,113,0,18,114,0,0,18,118,0,59,121,0,0,0,4,102,108,111,97,116,95,114,99, +112,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,114,0,0,0,0,1,0,0,11,0,115,113,114,116,0,1,1, +0,11,118,0,0,0,1,3,2,0,0,9,1,114,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18,118,0, +59,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18, +114,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18,118,0,59,121,0,0,0,4,102,108,111,97, +116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,114,0,0,0,4,102,108,111,97,116, +95,114,115,113,0,18,114,0,0,18,118,0,59,122,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95,95, +114,101,116,86,97,108,0,59,122,0,0,18,114,0,0,0,0,1,0,0,12,0,115,113,114,116,0,1,1,0,12,118,0,0,0, +1,3,2,0,0,9,1,114,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18,118,0,59,120,0,0,0,4, +102,108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,114,0,0,0,4,102, +108,111,97,116,95,114,115,113,0,18,114,0,0,18,118,0,59,121,0,0,0,4,102,108,111,97,116,95,114,99, +112,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,114,0,0,0,4,102,108,111,97,116,95,114,115,113, +0,18,114,0,0,18,118,0,59,122,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97, +108,0,59,122,0,0,18,114,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18,118,0,59,119,0,0, +0,4,102,108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59,119,0,0,18,114,0,0,0,0, +1,0,0,9,0,105,110,118,101,114,115,101,115,113,114,116,0,1,1,0,9,120,0,0,0,1,4,102,108,111,97,116, +95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,120,0,0,0,0,1,0,0,10,0,105,110,118, +101,114,115,101,115,113,114,116,0,1,1,0,10,118,0,0,0,1,4,102,108,111,97,116,95,114,115,113,0,18,95, +95,114,101,116,86,97,108,0,59,120,0,0,18,118,0,59,120,0,0,0,4,102,108,111,97,116,95,114,115,113,0, +18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,118,0,59,121,0,0,0,0,1,0,0,11,0,105,110,118,101,114, +115,101,115,113,114,116,0,1,1,0,11,118,0,0,0,1,4,102,108,111,97,116,95,114,115,113,0,18,95,95,114, +101,116,86,97,108,0,59,120,0,0,18,118,0,59,120,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,95, +95,114,101,116,86,97,108,0,59,121,0,0,18,118,0,59,121,0,0,0,4,102,108,111,97,116,95,114,115,113,0, +18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,118,0,59,122,0,0,0,0,1,0,0,12,0,105,110,118,101,114, +115,101,115,113,114,116,0,1,1,0,12,118,0,0,0,1,4,102,108,111,97,116,95,114,115,113,0,18,95,95,114, +101,116,86,97,108,0,59,120,0,0,18,118,0,59,120,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,95, +95,114,101,116,86,97,108,0,59,121,0,0,18,118,0,59,121,0,0,0,4,102,108,111,97,116,95,114,115,113,0, +18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,118,0,59,122,0,0,0,4,102,108,111,97,116,95,114,115, +113,0,18,95,95,114,101,116,86,97,108,0,59,119,0,0,18,118,0,59,119,0,0,0,0,1,0,0,9,0,110,111,114, +109,97,108,105,122,101,0,1,1,0,9,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,17,49,0,48,0,0,20, +0,0,1,0,0,10,0,110,111,114,109,97,108,105,122,101,0,1,1,0,10,118,0,0,0,1,3,2,1,0,9,1,115,0,2,58, +105,110,118,101,114,115,101,115,113,114,116,0,58,100,111,116,0,18,118,0,0,18,118,0,0,0,0,0,0,0,4, +118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0, +18,118,0,0,18,115,0,0,0,0,1,0,0,11,0,110,111,114,109,97,108,105,122,101,0,1,1,0,11,118,0,0,0,1,3,2, +0,0,9,1,116,109,112,0,0,0,4,118,101,99,51,95,100,111,116,0,18,116,109,112,0,0,18,118,0,0,18,118,0, +0,0,4,102,108,111,97,116,95,114,115,113,0,18,116,109,112,0,0,18,116,109,112,0,0,0,4,118,101,99,52, +95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0, +0,18,116,109,112,0,0,0,0,1,0,0,12,0,110,111,114,109,97,108,105,122,101,0,1,1,0,12,118,0,0,0,1,3,2, +0,0,9,1,116,109,112,0,0,0,4,118,101,99,52,95,100,111,116,0,18,116,109,112,0,0,18,118,0,0,18,118,0, +0,0,4,102,108,111,97,116,95,114,115,113,0,18,116,109,112,0,0,18,116,109,112,0,0,0,4,118,101,99,52, +95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0, +0,18,116,109,112,0,0,0,0,1,0,0,9,0,97,98,115,0,1,1,0,9,97,0,0,0,1,4,118,101,99,52,95,97,98,115,0, +18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,0,0,1,0,0,10,0,97,98,115,0,1,1,0,10,97,0,0,0,1,4,118, +101,99,52,95,97,98,115,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,97,0,0,0,0,1,0,0,11,0, +97,98,115,0,1,1,0,11,97,0,0,0,1,4,118,101,99,52,95,97,98,115,0,18,95,95,114,101,116,86,97,108,0,59, +120,121,122,0,0,18,97,0,0,0,0,1,0,0,12,0,97,98,115,0,1,1,0,12,97,0,0,0,1,4,118,101,99,52,95,97,98, +115,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,0,0,1,0,0,9,0,115,105,103,110,0,1,1,0,9,120,0,0, +0,1,3,2,0,0,9,1,112,0,0,1,1,110,0,0,0,4,118,101,99,52,95,115,103,116,0,18,112,0,0,18,120,0,0,17,48, +0,48,0,0,0,0,4,118,101,99,52,95,115,103,116,0,18,110,0,0,17,48,0,48,0,0,0,18,120,0,0,0,4,118,101, +99,52,95,115,117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,112,0,0,18,110,0,0,0, +0,1,0,0,10,0,115,105,103,110,0,1,1,0,10,118,0,0,0,1,3,2,0,0,10,1,112,0,0,1,1,110,0,0,0,4,118,101, +99,52,95,115,103,116,0,18,112,0,59,120,121,0,0,18,118,0,0,17,48,0,48,0,0,0,0,4,118,101,99,52,95, +115,103,116,0,18,110,0,59,120,121,0,0,17,48,0,48,0,0,0,18,118,0,0,0,4,118,101,99,52,95,115,117,98, +116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,112,0,0,18,110,0,0,0,0,1,0, +0,11,0,115,105,103,110,0,1,1,0,11,118,0,0,0,1,3,2,0,0,11,1,112,0,0,1,1,110,0,0,0,4,118,101,99,52, +95,115,103,116,0,18,112,0,59,120,121,122,0,0,18,118,0,0,17,48,0,48,0,0,0,0,4,118,101,99,52,95,115, +103,116,0,18,110,0,59,120,121,122,0,0,17,48,0,48,0,0,0,18,118,0,0,0,4,118,101,99,52,95,115,117,98, +116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,112,0,0,18,110,0,0,0,0, +1,0,0,12,0,115,105,103,110,0,1,1,0,12,118,0,0,0,1,3,2,0,0,12,1,112,0,0,1,1,110,0,0,0,4,118,101,99, +52,95,115,103,116,0,18,112,0,0,18,118,0,0,17,48,0,48,0,0,0,0,4,118,101,99,52,95,115,103,116,0,18, +110,0,0,17,48,0,48,0,0,0,18,118,0,0,0,4,118,101,99,52,95,115,117,98,116,114,97,99,116,0,18,95,95, +114,101,116,86,97,108,0,0,18,112,0,0,18,110,0,0,0,0,1,0,0,9,0,102,108,111,111,114,0,1,1,0,9,97,0,0, +0,1,4,118,101,99,52,95,102,108,111,111,114,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,0,0,1,0, +0,10,0,102,108,111,111,114,0,1,1,0,10,97,0,0,0,1,4,118,101,99,52,95,102,108,111,111,114,0,18,95,95, +114,101,116,86,97,108,0,59,120,121,0,0,18,97,0,0,0,0,1,0,0,11,0,102,108,111,111,114,0,1,1,0,11,97, +0,0,0,1,4,118,101,99,52,95,102,108,111,111,114,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0, +0,18,97,0,0,0,0,1,0,0,12,0,102,108,111,111,114,0,1,1,0,12,97,0,0,0,1,4,118,101,99,52,95,102,108, +111,111,114,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,0,0,1,0,0,9,0,99,101,105,108,0,1,1,0,9, +97,0,0,0,1,3,2,0,0,9,1,98,0,2,18,97,0,54,0,0,4,118,101,99,52,95,102,108,111,111,114,0,18,98,0,0,18, +98,0,0,0,9,18,95,95,114,101,116,86,97,108,0,18,98,0,54,20,0,0,1,0,0,10,0,99,101,105,108,0,1,1,0,10, +97,0,0,0,1,3,2,0,0,10,1,98,0,2,18,97,0,54,0,0,4,118,101,99,52,95,102,108,111,111,114,0,18,98,0,0, +18,98,0,0,0,9,18,95,95,114,101,116,86,97,108,0,59,120,121,0,18,98,0,54,20,0,0,1,0,0,11,0,99,101, +105,108,0,1,1,0,11,97,0,0,0,1,3,2,0,0,11,1,98,0,2,18,97,0,54,0,0,4,118,101,99,52,95,102,108,111, +111,114,0,18,98,0,0,18,98,0,0,0,9,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,18,98,0,54,20, +0,0,1,0,0,12,0,99,101,105,108,0,1,1,0,12,97,0,0,0,1,3,2,0,0,12,1,98,0,2,18,97,0,54,0,0,4,118,101, +99,52,95,102,108,111,111,114,0,18,98,0,0,18,98,0,0,0,9,18,95,95,114,101,116,86,97,108,0,18,98,0,54, +20,0,0,1,0,0,9,0,102,114,97,99,116,0,1,1,0,9,97,0,0,0,1,4,118,101,99,52,95,102,114,97,99,0,18,95, +95,114,101,116,86,97,108,0,0,18,97,0,0,0,0,1,0,0,10,0,102,114,97,99,116,0,1,1,0,10,97,0,0,0,1,4, +118,101,99,52,95,102,114,97,99,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,97,0,0,0,0,1,0, +0,11,0,102,114,97,99,116,0,1,1,0,11,97,0,0,0,1,4,118,101,99,52,95,102,114,97,99,0,18,95,95,114,101, +116,86,97,108,0,59,120,121,122,0,0,18,97,0,0,0,0,1,0,0,12,0,102,114,97,99,116,0,1,1,0,12,97,0,0,0, +1,4,118,101,99,52,95,102,114,97,99,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,0,0,1,0,0,9,0, +109,111,100,0,1,1,0,9,97,0,0,1,1,0,9,98,0,0,0,1,3,2,0,0,9,1,111,110,101,79,118,101,114,66,0,0,0,4, +102,108,111,97,116,95,114,99,112,0,18,111,110,101,79,118,101,114,66,0,0,18,98,0,0,0,9,18,95,95,114, +101,116,86,97,108,0,18,97,0,18,98,0,58,102,108,111,111,114,0,18,97,0,18,111,110,101,79,118,101,114, +66,0,48,0,0,48,47,20,0,0,1,0,0,10,0,109,111,100,0,1,1,0,10,97,0,0,1,1,0,9,98,0,0,0,1,3,2,0,0,9,1, +111,110,101,79,118,101,114,66,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,111,110,101,79,118,101, +114,66,0,0,18,98,0,0,0,9,18,95,95,114,101,116,86,97,108,0,59,120,121,0,18,97,0,18,98,0,58,102,108, +111,111,114,0,18,97,0,18,111,110,101,79,118,101,114,66,0,48,0,0,48,47,20,0,0,1,0,0,11,0,109,111, +100,0,1,1,0,11,97,0,0,1,1,0,9,98,0,0,0,1,3,2,0,0,9,1,111,110,101,79,118,101,114,66,0,0,0,4,102,108, +111,97,116,95,114,99,112,0,18,111,110,101,79,118,101,114,66,0,0,18,98,0,0,0,9,18,95,95,114,101,116, +86,97,108,0,59,120,121,122,0,18,97,0,18,98,0,58,102,108,111,111,114,0,18,97,0,18,111,110,101,79, +118,101,114,66,0,48,0,0,48,47,20,0,0,1,0,0,12,0,109,111,100,0,1,1,0,12,97,0,0,1,1,0,9,98,0,0,0,1,3, +2,0,0,9,1,111,110,101,79,118,101,114,66,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,111,110,101, +79,118,101,114,66,0,0,18,98,0,0,0,9,18,95,95,114,101,116,86,97,108,0,18,97,0,18,98,0,58,102,108, +111,111,114,0,18,97,0,18,111,110,101,79,118,101,114,66,0,48,0,0,48,47,20,0,0,1,0,0,10,0,109,111, +100,0,1,1,0,10,97,0,0,1,1,0,10,98,0,0,0,1,3,2,0,0,10,1,111,110,101,79,118,101,114,66,0,0,0,4,102, +108,111,97,116,95,114,99,112,0,18,111,110,101,79,118,101,114,66,0,59,120,0,0,18,98,0,59,120,0,0,0, +4,102,108,111,97,116,95,114,99,112,0,18,111,110,101,79,118,101,114,66,0,59,121,0,0,18,98,0,59,121, +0,0,0,9,18,95,95,114,101,116,86,97,108,0,18,97,0,18,98,0,58,102,108,111,111,114,0,18,97,0,18,111, +110,101,79,118,101,114,66,0,48,0,0,48,47,20,0,0,1,0,0,11,0,109,111,100,0,1,1,0,11,97,0,0,1,1,0,11, +98,0,0,0,1,3,2,0,0,11,1,111,110,101,79,118,101,114,66,0,0,0,4,102,108,111,97,116,95,114,99,112,0, +18,111,110,101,79,118,101,114,66,0,59,120,0,0,18,98,0,59,120,0,0,0,4,102,108,111,97,116,95,114,99, +112,0,18,111,110,101,79,118,101,114,66,0,59,121,0,0,18,98,0,59,121,0,0,0,4,102,108,111,97,116,95, +114,99,112,0,18,111,110,101,79,118,101,114,66,0,59,122,0,0,18,98,0,59,122,0,0,0,9,18,95,95,114,101, +116,86,97,108,0,18,97,0,18,98,0,58,102,108,111,111,114,0,18,97,0,18,111,110,101,79,118,101,114,66, +0,48,0,0,48,47,20,0,0,1,0,0,12,0,109,111,100,0,1,1,0,12,97,0,0,1,1,0,12,98,0,0,0,1,3,2,0,0,12,1, +111,110,101,79,118,101,114,66,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,111,110,101,79,118,101, +114,66,0,59,120,0,0,18,98,0,59,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,111,110,101,79, +118,101,114,66,0,59,121,0,0,18,98,0,59,121,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,111,110, +101,79,118,101,114,66,0,59,122,0,0,18,98,0,59,122,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18, +111,110,101,79,118,101,114,66,0,59,119,0,0,18,98,0,59,119,0,0,0,9,18,95,95,114,101,116,86,97,108,0, +18,97,0,18,98,0,58,102,108,111,111,114,0,18,97,0,18,111,110,101,79,118,101,114,66,0,48,0,0,48,47, +20,0,0,1,0,0,9,0,109,105,110,0,1,1,0,9,97,0,0,1,1,0,9,98,0,0,0,1,4,118,101,99,52,95,109,105,110,0, +18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,0,0,10,0,109,105,110,0,1,1,0,10,97,0, +0,1,1,0,10,98,0,0,0,1,4,118,101,99,52,95,109,105,110,0,18,95,95,114,101,116,86,97,108,0,59,120,121, +0,0,18,97,0,59,120,121,0,0,18,98,0,59,120,121,0,0,0,0,1,0,0,11,0,109,105,110,0,1,1,0,11,97,0,0,1,1, +0,11,98,0,0,0,1,4,118,101,99,52,95,109,105,110,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0, +0,18,97,0,59,120,121,122,0,0,18,98,0,59,120,121,122,0,0,0,0,1,0,0,12,0,109,105,110,0,1,1,0,12,97,0, +0,1,1,0,12,98,0,0,0,1,4,118,101,99,52,95,109,105,110,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0, +0,18,98,0,0,0,0,1,0,0,10,0,109,105,110,0,1,1,0,10,97,0,0,1,1,0,9,98,0,0,0,1,4,118,101,99,52,95,109, +105,110,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,59,120,121,0,0,18,98,0,0,0,0,1,0,0,11,0,109, +105,110,0,1,1,0,11,97,0,0,1,1,0,9,98,0,0,0,1,4,118,101,99,52,95,109,105,110,0,18,95,95,114,101,116, +86,97,108,0,0,18,97,0,59,120,121,122,0,0,18,98,0,0,0,0,1,0,0,12,0,109,105,110,0,1,1,0,12,97,0,0,1, +1,0,9,98,0,0,0,1,4,118,101,99,52,95,109,105,110,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18, +98,0,0,0,0,1,0,0,9,0,109,97,120,0,1,1,0,9,97,0,0,1,1,0,9,98,0,0,0,1,4,118,101,99,52,95,109,97,120, +0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,0,0,10,0,109,97,120,0,1,1,0,10,97,0, +0,1,1,0,10,98,0,0,0,1,4,118,101,99,52,95,109,97,120,0,18,95,95,114,101,116,86,97,108,0,59,120,121, +0,0,18,97,0,59,120,121,0,0,18,98,0,59,120,121,0,0,0,0,1,0,0,11,0,109,97,120,0,1,1,0,11,97,0,0,1,1, +0,11,98,0,0,0,1,4,118,101,99,52,95,109,97,120,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0, +0,18,97,0,59,120,121,122,0,0,18,98,0,59,120,121,122,0,0,0,0,1,0,0,12,0,109,97,120,0,1,1,0,12,97,0, +0,1,1,0,12,98,0,0,0,1,4,118,101,99,52,95,109,97,120,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0, +18,98,0,0,0,0,1,0,0,10,0,109,97,120,0,1,1,0,10,97,0,0,1,1,0,9,98,0,0,0,1,4,118,101,99,52,95,109,97, +120,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,59,120,121,0,0,18,98,0,0,0,0,1,0,0,11,0,109,97, +120,0,1,1,0,11,97,0,0,1,1,0,9,98,0,0,0,1,4,118,101,99,52,95,109,97,120,0,18,95,95,114,101,116,86, +97,108,0,0,18,97,0,59,120,121,122,0,0,18,98,0,0,0,0,1,0,0,12,0,109,97,120,0,1,1,0,12,97,0,0,1,1,0, +9,98,0,0,0,1,4,118,101,99,52,95,109,97,120,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0, +0,0,0,1,0,0,9,0,99,108,97,109,112,0,1,1,0,9,118,97,108,0,0,1,1,0,9,109,105,110,86,97,108,0,0,1,1,0, +9,109,97,120,86,97,108,0,0,0,1,4,118,101,99,52,95,99,108,97,109,112,0,18,95,95,114,101,116,86,97, +108,0,0,18,118,97,108,0,0,18,109,105,110,86,97,108,0,0,18,109,97,120,86,97,108,0,0,0,0,1,0,0,10,0, +99,108,97,109,112,0,1,1,0,10,118,97,108,0,0,1,1,0,9,109,105,110,86,97,108,0,0,1,1,0,9,109,97,120, 86,97,108,0,0,0,1,4,118,101,99,52,95,99,108,97,109,112,0,18,95,95,114,101,116,86,97,108,0,0,18,118, -97,108,0,0,18,109,105,110,86,97,108,0,0,18,109,97,120,86,97,108,0,0,0,0,1,0,10,0,99,108,97,109,112, -0,1,1,0,10,118,97,108,0,0,1,1,0,9,109,105,110,86,97,108,0,0,1,1,0,9,109,97,120,86,97,108,0,0,0,1,4, -118,101,99,52,95,99,108,97,109,112,0,18,95,95,114,101,116,86,97,108,0,0,18,118,97,108,0,0,18,109, -105,110,86,97,108,0,0,18,109,97,120,86,97,108,0,0,0,0,1,0,11,0,99,108,97,109,112,0,1,1,0,11,118,97, -108,0,0,1,1,0,9,109,105,110,86,97,108,0,0,1,1,0,9,109,97,120,86,97,108,0,0,0,1,4,118,101,99,52,95, -99,108,97,109,112,0,18,95,95,114,101,116,86,97,108,0,0,18,118,97,108,0,0,18,109,105,110,86,97,108, -0,0,18,109,97,120,86,97,108,0,0,0,0,1,0,12,0,99,108,97,109,112,0,1,1,0,12,118,97,108,0,0,1,1,0,9, -109,105,110,86,97,108,0,0,1,1,0,9,109,97,120,86,97,108,0,0,0,1,4,118,101,99,52,95,99,108,97,109, -112,0,18,95,95,114,101,116,86,97,108,0,0,18,118,97,108,0,0,18,109,105,110,86,97,108,0,0,18,109,97, -120,86,97,108,0,0,0,0,1,0,10,0,99,108,97,109,112,0,1,1,0,10,118,97,108,0,0,1,1,0,10,109,105,110,86, -97,108,0,0,1,1,0,10,109,97,120,86,97,108,0,0,0,1,4,118,101,99,52,95,99,108,97,109,112,0,18,95,95, -114,101,116,86,97,108,0,0,18,118,97,108,0,0,18,109,105,110,86,97,108,0,0,18,109,97,120,86,97,108,0, -0,0,0,1,0,11,0,99,108,97,109,112,0,1,1,0,11,118,97,108,0,0,1,1,0,11,109,105,110,86,97,108,0,0,1,1, -0,11,109,97,120,86,97,108,0,0,0,1,4,118,101,99,52,95,99,108,97,109,112,0,18,95,95,114,101,116,86, -97,108,0,0,18,118,97,108,0,0,18,109,105,110,86,97,108,0,0,18,109,97,120,86,97,108,0,0,0,0,1,0,12,0, -99,108,97,109,112,0,1,1,0,12,118,97,108,0,0,1,1,0,12,109,105,110,86,97,108,0,0,1,1,0,12,109,97,120, -86,97,108,0,0,0,1,4,118,101,99,52,95,99,108,97,109,112,0,18,95,95,114,101,116,86,97,108,0,0,18,118, -97,108,0,0,18,109,105,110,86,97,108,0,0,18,109,97,120,86,97,108,0,0,0,0,1,0,9,0,109,105,120,0,1,1, -0,9,120,0,0,1,1,0,9,121,0,0,1,1,0,9,97,0,0,0,1,4,118,101,99,52,95,108,114,112,0,18,95,95,114,101, -116,86,97,108,0,0,18,97,0,0,18,121,0,0,18,120,0,0,0,0,1,0,10,0,109,105,120,0,1,1,0,10,120,0,0,1,1, -0,10,121,0,0,1,1,0,9,97,0,0,0,1,4,118,101,99,52,95,108,114,112,0,18,95,95,114,101,116,86,97,108,0, -0,18,97,0,0,18,121,0,0,18,120,0,0,0,0,1,0,11,0,109,105,120,0,1,1,0,11,120,0,0,1,1,0,11,121,0,0,1,1, -0,9,97,0,0,0,1,4,118,101,99,52,95,108,114,112,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18, -121,0,0,18,120,0,0,0,0,1,0,12,0,109,105,120,0,1,1,0,12,120,0,0,1,1,0,12,121,0,0,1,1,0,9,97,0,0,0,1, -4,118,101,99,52,95,108,114,112,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,121,0,0,18,120,0, -0,0,0,1,0,10,0,109,105,120,0,1,1,0,10,120,0,0,1,1,0,10,121,0,0,1,1,0,10,97,0,0,0,1,4,118,101,99,52, -95,108,114,112,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,121,0,0,18,120,0,0,0,0,1,0,11,0, -109,105,120,0,1,1,0,11,120,0,0,1,1,0,11,121,0,0,1,1,0,11,97,0,0,0,1,4,118,101,99,52,95,108,114,112, -0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,121,0,0,18,120,0,0,0,0,1,0,12,0,109,105,120,0,1, -1,0,12,120,0,0,1,1,0,12,121,0,0,1,1,0,12,97,0,0,0,1,4,118,101,99,52,95,108,114,112,0,18,95,95,114, -101,116,86,97,108,0,0,18,97,0,0,18,121,0,0,18,120,0,0,0,0,1,0,9,0,115,116,101,112,0,1,1,0,9,101, -100,103,101,0,0,1,1,0,9,120,0,0,0,1,4,118,101,99,52,95,115,103,116,0,18,95,95,114,101,116,86,97, -108,0,59,120,0,0,18,120,0,0,18,101,100,103,101,0,0,0,0,1,0,10,0,115,116,101,112,0,1,1,0,10,101,100, -103,101,0,0,1,1,0,10,120,0,0,0,1,4,118,101,99,52,95,115,103,116,0,18,95,95,114,101,116,86,97,108,0, -59,120,121,0,0,18,120,0,0,18,101,100,103,101,0,0,0,0,1,0,11,0,115,116,101,112,0,1,1,0,11,101,100, -103,101,0,0,1,1,0,11,120,0,0,0,1,4,118,101,99,52,95,115,103,116,0,18,95,95,114,101,116,86,97,108,0, -59,120,121,122,0,0,18,120,0,0,18,101,100,103,101,0,0,0,0,1,0,12,0,115,116,101,112,0,1,1,0,12,101, -100,103,101,0,0,1,1,0,12,120,0,0,0,1,4,118,101,99,52,95,115,103,116,0,18,95,95,114,101,116,86,97, -108,0,0,18,120,0,0,18,101,100,103,101,0,0,0,0,1,0,10,0,115,116,101,112,0,1,1,0,9,101,100,103,101,0, -0,1,1,0,10,118,0,0,0,1,4,118,101,99,52,95,115,103,116,0,18,95,95,114,101,116,86,97,108,0,59,120, -121,0,0,18,118,0,0,18,101,100,103,101,0,59,120,120,0,0,0,0,1,0,11,0,115,116,101,112,0,1,1,0,9,101, -100,103,101,0,0,1,1,0,11,118,0,0,0,1,4,118,101,99,52,95,115,103,116,0,18,95,95,114,101,116,86,97, -108,0,59,120,121,122,0,0,18,118,0,0,18,101,100,103,101,0,59,120,120,120,0,0,0,0,1,0,12,0,115,116, -101,112,0,1,1,0,9,101,100,103,101,0,0,1,1,0,12,118,0,0,0,1,4,118,101,99,52,95,115,103,116,0,18,95, -95,114,101,116,86,97,108,0,0,18,118,0,0,18,101,100,103,101,0,59,120,120,120,120,0,0,0,0,1,0,9,0, -115,109,111,111,116,104,115,116,101,112,0,1,1,0,9,101,100,103,101,48,0,0,1,1,0,9,101,100,103,101, -49,0,0,1,1,0,9,120,0,0,0,1,3,2,0,9,1,116,0,2,58,99,108,97,109,112,0,18,120,0,18,101,100,103,101,48, -0,47,18,101,100,103,101,49,0,18,101,100,103,101,48,0,47,49,0,17,48,0,48,0,0,0,17,49,0,48,0,0,0,0,0, -0,8,18,116,0,18,116,0,48,17,51,0,48,0,0,17,50,0,48,0,0,18,116,0,48,47,48,0,0,1,0,10,0,115,109,111, -111,116,104,115,116,101,112,0,1,1,0,10,101,100,103,101,48,0,0,1,1,0,10,101,100,103,101,49,0,0,1,1, -0,10,118,0,0,0,1,3,2,0,10,1,116,0,2,58,99,108,97,109,112,0,18,118,0,18,101,100,103,101,48,0,47,18, +97,108,0,0,18,109,105,110,86,97,108,0,0,18,109,97,120,86,97,108,0,0,0,0,1,0,0,11,0,99,108,97,109, +112,0,1,1,0,11,118,97,108,0,0,1,1,0,9,109,105,110,86,97,108,0,0,1,1,0,9,109,97,120,86,97,108,0,0,0, +1,4,118,101,99,52,95,99,108,97,109,112,0,18,95,95,114,101,116,86,97,108,0,0,18,118,97,108,0,0,18, +109,105,110,86,97,108,0,0,18,109,97,120,86,97,108,0,0,0,0,1,0,0,12,0,99,108,97,109,112,0,1,1,0,12, +118,97,108,0,0,1,1,0,9,109,105,110,86,97,108,0,0,1,1,0,9,109,97,120,86,97,108,0,0,0,1,4,118,101,99, +52,95,99,108,97,109,112,0,18,95,95,114,101,116,86,97,108,0,0,18,118,97,108,0,0,18,109,105,110,86, +97,108,0,0,18,109,97,120,86,97,108,0,0,0,0,1,0,0,10,0,99,108,97,109,112,0,1,1,0,10,118,97,108,0,0, +1,1,0,10,109,105,110,86,97,108,0,0,1,1,0,10,109,97,120,86,97,108,0,0,0,1,4,118,101,99,52,95,99,108, +97,109,112,0,18,95,95,114,101,116,86,97,108,0,0,18,118,97,108,0,0,18,109,105,110,86,97,108,0,0,18, +109,97,120,86,97,108,0,0,0,0,1,0,0,11,0,99,108,97,109,112,0,1,1,0,11,118,97,108,0,0,1,1,0,11,109, +105,110,86,97,108,0,0,1,1,0,11,109,97,120,86,97,108,0,0,0,1,4,118,101,99,52,95,99,108,97,109,112,0, +18,95,95,114,101,116,86,97,108,0,0,18,118,97,108,0,0,18,109,105,110,86,97,108,0,0,18,109,97,120,86, +97,108,0,0,0,0,1,0,0,12,0,99,108,97,109,112,0,1,1,0,12,118,97,108,0,0,1,1,0,12,109,105,110,86,97, +108,0,0,1,1,0,12,109,97,120,86,97,108,0,0,0,1,4,118,101,99,52,95,99,108,97,109,112,0,18,95,95,114, +101,116,86,97,108,0,0,18,118,97,108,0,0,18,109,105,110,86,97,108,0,0,18,109,97,120,86,97,108,0,0,0, +0,1,0,0,9,0,109,105,120,0,1,1,0,9,120,0,0,1,1,0,9,121,0,0,1,1,0,9,97,0,0,0,1,4,118,101,99,52,95, +108,114,112,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,121,0,0,18,120,0,0,0,0,1,0,0,10,0, +109,105,120,0,1,1,0,10,120,0,0,1,1,0,10,121,0,0,1,1,0,9,97,0,0,0,1,4,118,101,99,52,95,108,114,112, +0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,121,0,0,18,120,0,0,0,0,1,0,0,11,0,109,105,120,0, +1,1,0,11,120,0,0,1,1,0,11,121,0,0,1,1,0,9,97,0,0,0,1,4,118,101,99,52,95,108,114,112,0,18,95,95,114, +101,116,86,97,108,0,0,18,97,0,0,18,121,0,0,18,120,0,0,0,0,1,0,0,12,0,109,105,120,0,1,1,0,12,120,0, +0,1,1,0,12,121,0,0,1,1,0,9,97,0,0,0,1,4,118,101,99,52,95,108,114,112,0,18,95,95,114,101,116,86,97, +108,0,0,18,97,0,0,18,121,0,0,18,120,0,0,0,0,1,0,0,10,0,109,105,120,0,1,1,0,10,120,0,0,1,1,0,10,121, +0,0,1,1,0,10,97,0,0,0,1,4,118,101,99,52,95,108,114,112,0,18,95,95,114,101,116,86,97,108,0,0,18,97, +0,0,18,121,0,0,18,120,0,0,0,0,1,0,0,11,0,109,105,120,0,1,1,0,11,120,0,0,1,1,0,11,121,0,0,1,1,0,11, +97,0,0,0,1,4,118,101,99,52,95,108,114,112,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,121,0, +0,18,120,0,0,0,0,1,0,0,12,0,109,105,120,0,1,1,0,12,120,0,0,1,1,0,12,121,0,0,1,1,0,12,97,0,0,0,1,4, +118,101,99,52,95,108,114,112,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,121,0,0,18,120,0,0, +0,0,1,0,0,9,0,115,116,101,112,0,1,1,0,9,101,100,103,101,0,0,1,1,0,9,120,0,0,0,1,4,118,101,99,52,95, +115,103,101,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,18,101,100,103,101,0,0,0,0,1,0,0,10,0, +115,116,101,112,0,1,1,0,10,101,100,103,101,0,0,1,1,0,10,120,0,0,0,1,4,118,101,99,52,95,115,103,101, +0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,120,0,0,18,101,100,103,101,0,0,0,0,1,0,0,11,0, +115,116,101,112,0,1,1,0,11,101,100,103,101,0,0,1,1,0,11,120,0,0,0,1,4,118,101,99,52,95,115,103,101, +0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,120,0,0,18,101,100,103,101,0,0,0,0,1,0,0, +12,0,115,116,101,112,0,1,1,0,12,101,100,103,101,0,0,1,1,0,12,120,0,0,0,1,4,118,101,99,52,95,115, +103,101,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,18,101,100,103,101,0,0,0,0,1,0,0,10,0,115, +116,101,112,0,1,1,0,9,101,100,103,101,0,0,1,1,0,10,118,0,0,0,1,4,118,101,99,52,95,115,103,101,0,18, +95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,118,0,0,18,101,100,103,101,0,0,0,0,1,0,0,11,0,115, +116,101,112,0,1,1,0,9,101,100,103,101,0,0,1,1,0,11,118,0,0,0,1,4,118,101,99,52,95,115,103,101,0,18, +95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0,0,18,101,100,103,101,0,0,0,0,1,0,0,12,0, +115,116,101,112,0,1,1,0,9,101,100,103,101,0,0,1,1,0,12,118,0,0,0,1,4,118,101,99,52,95,115,103,101, +0,18,95,95,114,101,116,86,97,108,0,0,18,118,0,0,18,101,100,103,101,0,0,0,0,1,0,0,9,0,115,109,111, +111,116,104,115,116,101,112,0,1,1,0,9,101,100,103,101,48,0,0,1,1,0,9,101,100,103,101,49,0,0,1,1,0, +9,120,0,0,0,1,3,2,0,0,9,1,116,0,2,58,99,108,97,109,112,0,18,120,0,18,101,100,103,101,48,0,47,18, 101,100,103,101,49,0,18,101,100,103,101,48,0,47,49,0,17,48,0,48,0,0,0,17,49,0,48,0,0,0,0,0,0,8,18, -116,0,18,116,0,48,17,51,0,48,0,0,17,50,0,48,0,0,18,116,0,48,47,48,0,0,1,0,11,0,115,109,111,111,116, +116,0,18,116,0,48,17,51,0,48,0,0,17,50,0,48,0,0,18,116,0,48,47,48,0,0,1,0,0,10,0,115,109,111,111, +116,104,115,116,101,112,0,1,1,0,10,101,100,103,101,48,0,0,1,1,0,10,101,100,103,101,49,0,0,1,1,0,10, +118,0,0,0,1,3,2,0,0,10,1,116,0,2,58,99,108,97,109,112,0,18,118,0,18,101,100,103,101,48,0,47,18,101, +100,103,101,49,0,18,101,100,103,101,48,0,47,49,0,17,48,0,48,0,0,0,17,49,0,48,0,0,0,0,0,0,8,18,116, +0,18,116,0,48,17,51,0,48,0,0,17,50,0,48,0,0,18,116,0,48,47,48,0,0,1,0,0,11,0,115,109,111,111,116, 104,115,116,101,112,0,1,1,0,11,101,100,103,101,48,0,0,1,1,0,11,101,100,103,101,49,0,0,1,1,0,11,118, -0,0,0,1,3,2,0,11,1,116,0,2,58,99,108,97,109,112,0,18,118,0,18,101,100,103,101,48,0,47,18,101,100, +0,0,0,1,3,2,0,0,11,1,116,0,2,58,99,108,97,109,112,0,18,118,0,18,101,100,103,101,48,0,47,18,101,100, 103,101,49,0,18,101,100,103,101,48,0,47,49,0,17,48,0,48,0,0,0,17,49,0,48,0,0,0,0,0,0,8,18,116,0,18, -116,0,48,17,51,0,48,0,0,17,50,0,48,0,0,18,116,0,48,47,48,0,0,1,0,12,0,115,109,111,111,116,104,115, -116,101,112,0,1,1,0,12,101,100,103,101,48,0,0,1,1,0,12,101,100,103,101,49,0,0,1,1,0,12,118,0,0,0,1, -3,2,0,12,1,116,0,2,58,99,108,97,109,112,0,18,118,0,18,101,100,103,101,48,0,47,18,101,100,103,101, +116,0,48,17,51,0,48,0,0,17,50,0,48,0,0,18,116,0,48,47,48,0,0,1,0,0,12,0,115,109,111,111,116,104, +115,116,101,112,0,1,1,0,12,101,100,103,101,48,0,0,1,1,0,12,101,100,103,101,49,0,0,1,1,0,12,118,0,0, +0,1,3,2,0,0,12,1,116,0,2,58,99,108,97,109,112,0,18,118,0,18,101,100,103,101,48,0,47,18,101,100,103, +101,49,0,18,101,100,103,101,48,0,47,49,0,17,48,0,48,0,0,0,17,49,0,48,0,0,0,0,0,0,8,18,116,0,18,116, +0,48,17,51,0,48,0,0,17,50,0,48,0,0,18,116,0,48,47,48,0,0,1,0,0,10,0,115,109,111,111,116,104,115, +116,101,112,0,1,1,0,9,101,100,103,101,48,0,0,1,1,0,9,101,100,103,101,49,0,0,1,1,0,10,118,0,0,0,1,3, +2,0,0,10,1,116,0,2,58,99,108,97,109,112,0,18,118,0,18,101,100,103,101,48,0,47,18,101,100,103,101, 49,0,18,101,100,103,101,48,0,47,49,0,17,48,0,48,0,0,0,17,49,0,48,0,0,0,0,0,0,8,18,116,0,18,116,0, -48,17,51,0,48,0,0,17,50,0,48,0,0,18,116,0,48,47,48,0,0,1,0,10,0,115,109,111,111,116,104,115,116, -101,112,0,1,1,0,9,101,100,103,101,48,0,0,1,1,0,9,101,100,103,101,49,0,0,1,1,0,10,118,0,0,0,1,3,2,0, -10,1,116,0,2,58,99,108,97,109,112,0,18,118,0,18,101,100,103,101,48,0,47,18,101,100,103,101,49,0,18, +48,17,51,0,48,0,0,17,50,0,48,0,0,18,116,0,48,47,48,0,0,1,0,0,11,0,115,109,111,111,116,104,115,116, +101,112,0,1,1,0,9,101,100,103,101,48,0,0,1,1,0,9,101,100,103,101,49,0,0,1,1,0,11,118,0,0,0,1,3,2,0, +0,11,1,116,0,2,58,99,108,97,109,112,0,18,118,0,18,101,100,103,101,48,0,47,18,101,100,103,101,49,0, +18,101,100,103,101,48,0,47,49,0,17,48,0,48,0,0,0,17,49,0,48,0,0,0,0,0,0,8,18,116,0,18,116,0,48,17, +51,0,48,0,0,17,50,0,48,0,0,18,116,0,48,47,48,0,0,1,0,0,12,0,115,109,111,111,116,104,115,116,101, +112,0,1,1,0,9,101,100,103,101,48,0,0,1,1,0,9,101,100,103,101,49,0,0,1,1,0,12,118,0,0,0,1,3,2,0,0, +12,1,116,0,2,58,99,108,97,109,112,0,18,118,0,18,101,100,103,101,48,0,47,18,101,100,103,101,49,0,18, 101,100,103,101,48,0,47,49,0,17,48,0,48,0,0,0,17,49,0,48,0,0,0,0,0,0,8,18,116,0,18,116,0,48,17,51, -0,48,0,0,17,50,0,48,0,0,18,116,0,48,47,48,0,0,1,0,11,0,115,109,111,111,116,104,115,116,101,112,0,1, -1,0,9,101,100,103,101,48,0,0,1,1,0,9,101,100,103,101,49,0,0,1,1,0,11,118,0,0,0,1,3,2,0,11,1,116,0, -2,58,99,108,97,109,112,0,18,118,0,18,101,100,103,101,48,0,47,18,101,100,103,101,49,0,18,101,100, -103,101,48,0,47,49,0,17,48,0,48,0,0,0,17,49,0,48,0,0,0,0,0,0,8,18,116,0,18,116,0,48,17,51,0,48,0,0, -17,50,0,48,0,0,18,116,0,48,47,48,0,0,1,0,12,0,115,109,111,111,116,104,115,116,101,112,0,1,1,0,9, -101,100,103,101,48,0,0,1,1,0,9,101,100,103,101,49,0,0,1,1,0,12,118,0,0,0,1,3,2,0,12,1,116,0,2,58, -99,108,97,109,112,0,18,118,0,18,101,100,103,101,48,0,47,18,101,100,103,101,49,0,18,101,100,103,101, -48,0,47,49,0,17,48,0,48,0,0,0,17,49,0,48,0,0,0,0,0,0,8,18,116,0,18,116,0,48,17,51,0,48,0,0,17,50,0, -48,0,0,18,116,0,48,47,48,0,0,1,0,9,0,108,101,110,103,116,104,0,1,1,0,9,120,0,0,0,1,8,58,97,98,115, -0,18,120,0,0,0,0,0,1,0,9,0,108,101,110,103,116,104,0,1,1,0,10,118,0,0,0,1,3,2,0,9,1,114,0,0,0,3,2, -1,9,1,112,0,2,58,100,111,116,0,18,118,0,0,18,118,0,0,0,0,0,4,102,108,111,97,116,95,114,115,113,0, -18,114,0,0,18,112,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59, -120,0,0,18,114,0,0,0,0,1,0,9,0,108,101,110,103,116,104,0,1,1,0,11,118,0,0,0,1,3,2,0,9,1,114,0,0,0, -3,2,1,9,1,112,0,2,58,100,111,116,0,18,118,0,0,18,118,0,0,0,0,0,4,102,108,111,97,116,95,114,115,113, -0,18,114,0,0,18,112,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59, -120,0,0,18,114,0,0,0,0,1,0,9,0,108,101,110,103,116,104,0,1,1,0,12,118,0,0,0,1,3,2,0,9,1,114,0,0,0, -3,2,1,9,1,112,0,2,58,100,111,116,0,18,118,0,0,18,118,0,0,0,0,0,4,102,108,111,97,116,95,114,115,113, -0,18,114,0,0,18,112,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59, -120,0,0,18,114,0,0,0,0,1,0,9,0,100,105,115,116,97,110,99,101,0,1,1,0,9,120,0,0,1,1,0,9,121,0,0,0,1, -3,2,1,9,1,100,0,2,18,120,0,18,121,0,47,0,0,9,18,95,95,114,101,116,86,97,108,0,58,108,101,110,103, -116,104,0,18,100,0,0,0,20,0,0,1,0,9,0,100,105,115,116,97,110,99,101,0,1,1,0,10,118,0,0,1,1,0,10, -117,0,0,0,1,3,2,1,10,1,100,50,0,2,18,118,0,18,117,0,47,0,0,9,18,95,95,114,101,116,86,97,108,0,58, -108,101,110,103,116,104,0,18,100,50,0,0,0,20,0,0,1,0,9,0,100,105,115,116,97,110,99,101,0,1,1,0,11, -118,0,0,1,1,0,11,117,0,0,0,1,3,2,1,11,1,100,51,0,2,18,118,0,18,117,0,47,0,0,9,18,95,95,114,101,116, -86,97,108,0,58,108,101,110,103,116,104,0,18,100,51,0,0,0,20,0,0,1,0,9,0,100,105,115,116,97,110,99, -101,0,1,1,0,12,118,0,0,1,1,0,12,117,0,0,0,1,3,2,1,12,1,100,52,0,2,18,118,0,18,117,0,47,0,0,9,18,95, -95,114,101,116,86,97,108,0,58,108,101,110,103,116,104,0,18,100,52,0,0,0,20,0,0,1,0,11,0,99,114,111, -115,115,0,1,1,0,11,118,0,0,1,1,0,11,117,0,0,0,1,4,118,101,99,51,95,99,114,111,115,115,0,18,95,95, -114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0,0,18,117,0,0,0,0,1,0,9,0,102,97,99,101,102,111, -114,119,97,114,100,0,1,1,0,9,78,0,0,1,1,0,9,73,0,0,1,1,0,9,78,114,101,102,0,0,0,1,3,2,1,9,1,100,0, -2,58,100,111,116,0,18,78,114,101,102,0,0,18,73,0,0,0,0,0,3,2,0,9,1,115,0,0,0,4,118,101,99,52,95, -115,103,116,0,18,115,0,59,120,0,0,17,48,0,48,0,0,0,18,100,0,0,0,8,58,109,105,120,0,18,78,0,54,0,18, -78,0,0,18,115,0,0,0,0,0,1,0,10,0,102,97,99,101,102,111,114,119,97,114,100,0,1,1,0,10,78,0,0,1,1,0, -10,73,0,0,1,1,0,10,78,114,101,102,0,0,0,1,3,2,1,9,1,100,0,2,58,100,111,116,0,18,78,114,101,102,0,0, -18,73,0,0,0,0,0,3,2,0,9,1,115,0,0,0,4,118,101,99,52,95,115,103,116,0,18,115,0,59,120,0,0,17,48,0, -48,0,0,0,18,100,0,0,0,8,58,109,105,120,0,18,78,0,54,0,18,78,0,0,18,115,0,0,0,0,0,1,0,11,0,102,97, -99,101,102,111,114,119,97,114,100,0,1,1,0,11,78,0,0,1,1,0,11,73,0,0,1,1,0,11,78,114,101,102,0,0,0, -1,3,2,1,9,1,100,0,2,58,100,111,116,0,18,78,114,101,102,0,0,18,73,0,0,0,0,0,3,2,0,9,1,115,0,0,0,4, -118,101,99,52,95,115,103,116,0,18,115,0,59,120,0,0,17,48,0,48,0,0,0,18,100,0,0,0,8,58,109,105,120, -0,18,78,0,54,0,18,78,0,0,18,115,0,0,0,0,0,1,0,12,0,102,97,99,101,102,111,114,119,97,114,100,0,1,1, -0,12,78,0,0,1,1,0,12,73,0,0,1,1,0,12,78,114,101,102,0,0,0,1,3,2,1,9,1,100,0,2,58,100,111,116,0,18, -78,114,101,102,0,0,18,73,0,0,0,0,0,3,2,0,9,1,115,0,0,0,4,118,101,99,52,95,115,103,116,0,18,115,0, -59,120,0,0,17,48,0,48,0,0,0,18,100,0,0,0,8,58,109,105,120,0,18,78,0,54,0,18,78,0,0,18,115,0,0,0,0, -0,1,0,9,0,114,101,102,108,101,99,116,0,1,1,0,9,73,0,0,1,1,0,9,78,0,0,0,1,8,18,73,0,17,50,0,48,0,0, -58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,18,78,0,48,47,0,0,1,0,10,0,114,101,102,108,101,99,116,0, -1,1,0,10,73,0,0,1,1,0,10,78,0,0,0,1,8,18,73,0,17,50,0,48,0,0,58,100,111,116,0,18,78,0,0,18,73,0,0, -0,48,18,78,0,48,47,0,0,1,0,11,0,114,101,102,108,101,99,116,0,1,1,0,11,73,0,0,1,1,0,11,78,0,0,0,1,8, -18,73,0,17,50,0,48,0,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,18,78,0,48,47,0,0,1,0,12,0,114, -101,102,108,101,99,116,0,1,1,0,12,73,0,0,1,1,0,12,78,0,0,0,1,8,18,73,0,17,50,0,48,0,0,58,100,111, -116,0,18,78,0,0,18,73,0,0,0,48,18,78,0,48,47,0,0,1,0,9,0,114,101,102,114,97,99,116,0,1,1,0,9,73,0, -0,1,1,0,9,78,0,0,1,1,0,9,101,116,97,0,0,0,1,3,2,0,9,1,107,0,2,17,49,0,48,0,0,18,101,116,97,0,18, -101,116,97,0,48,17,49,0,48,0,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,58,100,111,116,0,18,78,0,0, -18,73,0,0,0,48,47,48,47,0,0,10,18,107,0,17,48,0,48,0,0,40,0,8,17,48,0,48,0,0,0,9,14,0,8,18,101,116, -97,0,18,73,0,48,18,101,116,97,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,58,115,113,114,116,0,18, -107,0,0,0,46,18,78,0,48,47,0,0,1,0,10,0,114,101,102,114,97,99,116,0,1,1,0,10,73,0,0,1,1,0,10,78,0, -0,1,1,0,9,101,116,97,0,0,0,1,3,2,0,9,1,107,0,2,17,49,0,48,0,0,18,101,116,97,0,18,101,116,97,0,48, -17,49,0,48,0,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,47, -48,47,0,0,10,18,107,0,17,48,0,48,0,0,40,0,8,17,48,0,48,0,0,0,9,14,0,8,18,101,116,97,0,18,73,0,48, -18,101,116,97,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,58,115,113,114,116,0,18,107,0,0,0,46,18, -78,0,48,47,0,0,1,0,11,0,114,101,102,114,97,99,116,0,1,1,0,11,73,0,0,1,1,0,11,78,0,0,1,1,0,9,101, -116,97,0,0,0,1,3,2,0,9,1,107,0,2,17,49,0,48,0,0,18,101,116,97,0,18,101,116,97,0,48,17,49,0,48,0,0, -58,100,111,116,0,18,78,0,0,18,73,0,0,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,47,48,47,0,0,10, -18,107,0,17,48,0,48,0,0,40,0,8,17,48,0,48,0,0,0,9,14,0,8,18,101,116,97,0,18,73,0,48,18,101,116,97, -0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,58,115,113,114,116,0,18,107,0,0,0,46,18,78,0,48,47,0,0, -1,0,12,0,114,101,102,114,97,99,116,0,1,1,0,12,73,0,0,1,1,0,12,78,0,0,1,1,0,9,101,116,97,0,0,0,1,3, -2,0,9,1,107,0,2,17,49,0,48,0,0,18,101,116,97,0,18,101,116,97,0,48,17,49,0,48,0,0,58,100,111,116,0, -18,78,0,0,18,73,0,0,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,47,48,47,0,0,10,18,107,0,17,48,0, -48,0,0,40,0,8,17,48,0,48,0,0,0,9,14,0,8,18,101,116,97,0,18,73,0,48,18,101,116,97,0,58,100,111,116, -0,18,78,0,0,18,73,0,0,0,48,58,115,113,114,116,0,18,107,0,0,0,46,18,78,0,48,47,0,0,1,0,13,0,109,97, -116,114,105,120,67,111,109,112,77,117,108,116,0,1,0,0,13,109,0,0,1,0,0,13,110,0,0,0,1,8,58,109,97, -116,50,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,48,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49, -0,57,48,0,0,0,0,1,0,14,0,109,97,116,114,105,120,67,111,109,112,77,117,108,116,0,1,0,0,14,109,0,0,1, -0,0,14,110,0,0,0,1,8,58,109,97,116,51,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,48,0,18,109,0, -16,10,49,0,57,18,110,0,16,10,49,0,57,48,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,48,0,0,0,0, -1,0,15,0,109,97,116,114,105,120,67,111,109,112,77,117,108,116,0,1,0,0,15,109,0,0,1,0,0,15,110,0,0, -0,1,8,58,109,97,116,52,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,48,0,18,109,0,16,10,49,0,57, -18,110,0,16,10,49,0,57,48,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,48,0,18,109,0,16,10,51,0, -57,18,110,0,16,10,51,0,57,48,0,0,0,0,1,0,2,0,108,101,115,115,84,104,97,110,0,1,1,0,10,117,0,0,1,1, -0,10,118,0,0,0,1,4,118,101,99,52,95,115,108,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0, -18,117,0,0,18,118,0,0,0,0,1,0,3,0,108,101,115,115,84,104,97,110,0,1,1,0,11,117,0,0,1,1,0,11,118,0, -0,0,1,4,118,101,99,52,95,115,108,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117, -0,0,18,118,0,0,0,0,1,0,4,0,108,101,115,115,84,104,97,110,0,1,1,0,12,117,0,0,1,1,0,12,118,0,0,0,1,4, -118,101,99,52,95,115,108,116,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,0,2, -0,108,101,115,115,84,104,97,110,0,1,1,0,6,117,0,0,1,1,0,6,118,0,0,0,1,4,118,101,99,52,95,115,108, -116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,0,3,0,108,101, +0,48,0,0,17,50,0,48,0,0,18,116,0,48,47,48,0,0,1,0,0,9,0,108,101,110,103,116,104,0,1,1,0,9,120,0,0, +0,1,8,58,97,98,115,0,18,120,0,0,0,0,0,1,0,0,9,0,108,101,110,103,116,104,0,1,1,0,10,118,0,0,0,1,3,2, +0,0,9,1,114,0,0,0,3,2,1,0,9,1,112,0,2,58,100,111,116,0,18,118,0,0,18,118,0,0,0,0,0,4,102,108,111, +97,116,95,114,115,113,0,18,114,0,0,18,112,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95,95,114, +101,116,86,97,108,0,59,120,0,0,18,114,0,0,0,0,1,0,0,9,0,108,101,110,103,116,104,0,1,1,0,11,118,0,0, +0,1,3,2,0,0,9,1,114,0,0,0,3,2,1,0,9,1,112,0,2,58,100,111,116,0,18,118,0,0,18,118,0,0,0,0,0,4,102, +108,111,97,116,95,114,115,113,0,18,114,0,0,18,112,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95, +95,114,101,116,86,97,108,0,0,18,114,0,0,0,0,1,0,0,9,0,108,101,110,103,116,104,0,1,1,0,12,118,0,0,0, +1,3,2,0,0,9,1,114,0,0,0,3,2,1,0,9,1,112,0,2,58,100,111,116,0,18,118,0,0,18,118,0,0,0,0,0,4,102,108, +111,97,116,95,114,115,113,0,18,114,0,0,18,112,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95,95, +114,101,116,86,97,108,0,0,18,114,0,0,0,0,1,0,0,9,0,100,105,115,116,97,110,99,101,0,1,1,0,9,120,0,0, +1,1,0,9,121,0,0,0,1,3,2,1,0,9,1,100,0,2,18,120,0,18,121,0,47,0,0,9,18,95,95,114,101,116,86,97,108, +0,58,108,101,110,103,116,104,0,18,100,0,0,0,20,0,0,1,0,0,9,0,100,105,115,116,97,110,99,101,0,1,1,0, +10,118,0,0,1,1,0,10,117,0,0,0,1,3,2,1,0,10,1,100,50,0,2,18,118,0,18,117,0,47,0,0,9,18,95,95,114, +101,116,86,97,108,0,58,108,101,110,103,116,104,0,18,100,50,0,0,0,20,0,0,1,0,0,9,0,100,105,115,116, +97,110,99,101,0,1,1,0,11,118,0,0,1,1,0,11,117,0,0,0,1,3,2,1,0,11,1,100,51,0,2,18,118,0,18,117,0,47, +0,0,9,18,95,95,114,101,116,86,97,108,0,58,108,101,110,103,116,104,0,18,100,51,0,0,0,20,0,0,1,0,0,9, +0,100,105,115,116,97,110,99,101,0,1,1,0,12,118,0,0,1,1,0,12,117,0,0,0,1,3,2,1,0,12,1,100,52,0,2,18, +118,0,18,117,0,47,0,0,9,18,95,95,114,101,116,86,97,108,0,58,108,101,110,103,116,104,0,18,100,52,0, +0,0,20,0,0,1,0,0,11,0,99,114,111,115,115,0,1,1,0,11,118,0,0,1,1,0,11,117,0,0,0,1,4,118,101,99,51, +95,99,114,111,115,115,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0,0,18,117,0,0, +0,0,1,0,0,9,0,102,97,99,101,102,111,114,119,97,114,100,0,1,1,0,9,78,0,0,1,1,0,9,73,0,0,1,1,0,9,78, +114,101,102,0,0,0,1,3,2,1,0,9,1,100,0,2,58,100,111,116,0,18,78,114,101,102,0,0,18,73,0,0,0,0,0,3,2, +0,0,9,1,115,0,0,0,4,118,101,99,52,95,115,103,116,0,18,115,0,0,17,48,0,48,0,0,0,18,100,0,0,0,8,58, +109,105,120,0,18,78,0,54,0,18,78,0,0,18,115,0,0,0,0,0,1,0,0,10,0,102,97,99,101,102,111,114,119,97, +114,100,0,1,1,0,10,78,0,0,1,1,0,10,73,0,0,1,1,0,10,78,114,101,102,0,0,0,1,3,2,1,0,9,1,100,0,2,58, +100,111,116,0,18,78,114,101,102,0,0,18,73,0,0,0,0,0,3,2,0,0,9,1,115,0,0,0,4,118,101,99,52,95,115, +103,116,0,18,115,0,0,17,48,0,48,0,0,0,18,100,0,0,0,8,58,109,105,120,0,18,78,0,54,0,18,78,0,0,18, +115,0,0,0,0,0,1,0,0,11,0,102,97,99,101,102,111,114,119,97,114,100,0,1,1,0,11,78,0,0,1,1,0,11,73,0, +0,1,1,0,11,78,114,101,102,0,0,0,1,3,2,1,0,9,1,100,0,2,58,100,111,116,0,18,78,114,101,102,0,0,18,73, +0,0,0,0,0,3,2,0,0,9,1,115,0,0,0,4,118,101,99,52,95,115,103,116,0,18,115,0,0,17,48,0,48,0,0,0,18, +100,0,0,0,8,58,109,105,120,0,18,78,0,54,0,18,78,0,0,18,115,0,0,0,0,0,1,0,0,12,0,102,97,99,101,102, +111,114,119,97,114,100,0,1,1,0,12,78,0,0,1,1,0,12,73,0,0,1,1,0,12,78,114,101,102,0,0,0,1,3,2,1,0,9, +1,100,0,2,58,100,111,116,0,18,78,114,101,102,0,0,18,73,0,0,0,0,0,3,2,0,0,9,1,115,0,0,0,4,118,101, +99,52,95,115,103,116,0,18,115,0,0,17,48,0,48,0,0,0,18,100,0,0,0,8,58,109,105,120,0,18,78,0,54,0,18, +78,0,0,18,115,0,0,0,0,0,1,0,0,9,0,114,101,102,108,101,99,116,0,1,1,0,9,73,0,0,1,1,0,9,78,0,0,0,1,8, +18,73,0,17,50,0,48,0,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,18,78,0,48,47,0,0,1,0,0,10,0,114, +101,102,108,101,99,116,0,1,1,0,10,73,0,0,1,1,0,10,78,0,0,0,1,8,18,73,0,17,50,0,48,0,0,58,100,111, +116,0,18,78,0,0,18,73,0,0,0,48,18,78,0,48,47,0,0,1,0,0,11,0,114,101,102,108,101,99,116,0,1,1,0,11, +73,0,0,1,1,0,11,78,0,0,0,1,8,18,73,0,17,50,0,48,0,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,18, +78,0,48,47,0,0,1,0,0,12,0,114,101,102,108,101,99,116,0,1,1,0,12,73,0,0,1,1,0,12,78,0,0,0,1,8,18,73, +0,17,50,0,48,0,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,18,78,0,48,47,0,0,1,0,0,9,0,114,101,102, +114,97,99,116,0,1,1,0,9,73,0,0,1,1,0,9,78,0,0,1,1,0,9,101,116,97,0,0,0,1,3,2,0,0,9,1,110,95,100, +111,116,95,105,0,2,58,100,111,116,0,18,78,0,0,18,73,0,0,0,0,0,3,2,0,0,9,1,107,0,2,17,49,0,48,0,0, +18,101,116,97,0,18,101,116,97,0,48,17,49,0,48,0,0,18,110,95,100,111,116,95,105,0,18,110,95,100,111, +116,95,105,0,48,47,48,47,0,0,3,2,0,0,9,1,114,101,116,118,97,108,0,0,0,10,18,107,0,17,48,0,48,0,0, +40,0,9,18,114,101,116,118,97,108,0,17,48,0,48,0,0,20,0,9,18,114,101,116,118,97,108,0,18,101,116,97, +0,18,73,0,48,18,101,116,97,0,18,110,95,100,111,116,95,105,0,48,58,115,113,114,116,0,18,107,0,0,0, +46,18,78,0,48,47,20,0,8,18,114,101,116,118,97,108,0,0,0,1,0,0,10,0,114,101,102,114,97,99,116,0,1,1, +0,10,73,0,0,1,1,0,10,78,0,0,1,1,0,9,101,116,97,0,0,0,1,3,2,0,0,9,1,110,95,100,111,116,95,105,0,2, +58,100,111,116,0,18,78,0,0,18,73,0,0,0,0,0,3,2,0,0,9,1,107,0,2,17,49,0,48,0,0,18,101,116,97,0,18, +101,116,97,0,48,17,49,0,48,0,0,18,110,95,100,111,116,95,105,0,18,110,95,100,111,116,95,105,0,48,47, +48,47,0,0,3,2,0,0,10,1,114,101,116,118,97,108,0,0,0,10,18,107,0,17,48,0,48,0,0,40,0,9,18,114,101, +116,118,97,108,0,58,118,101,99,50,0,17,48,0,48,0,0,0,0,20,0,9,18,114,101,116,118,97,108,0,18,101, +116,97,0,18,73,0,48,18,101,116,97,0,18,110,95,100,111,116,95,105,0,48,58,115,113,114,116,0,18,107, +0,0,0,46,18,78,0,48,47,20,0,8,18,114,101,116,118,97,108,0,0,0,1,0,0,11,0,114,101,102,114,97,99,116, +0,1,1,0,11,73,0,0,1,1,0,11,78,0,0,1,1,0,9,101,116,97,0,0,0,1,3,2,0,0,9,1,110,95,100,111,116,95,105, +0,2,58,100,111,116,0,18,78,0,0,18,73,0,0,0,0,0,3,2,0,0,9,1,107,0,2,17,49,0,48,0,0,18,101,116,97,0, +18,101,116,97,0,48,17,49,0,48,0,0,18,110,95,100,111,116,95,105,0,18,110,95,100,111,116,95,105,0,48, +47,48,47,0,0,3,2,0,0,11,1,114,101,116,118,97,108,0,0,0,10,18,107,0,17,48,0,48,0,0,40,0,9,18,114, +101,116,118,97,108,0,58,118,101,99,51,0,17,48,0,48,0,0,0,0,20,0,9,18,114,101,116,118,97,108,0,18, +101,116,97,0,18,73,0,48,18,101,116,97,0,18,110,95,100,111,116,95,105,0,48,58,115,113,114,116,0,18, +107,0,0,0,46,18,78,0,48,47,20,0,8,18,114,101,116,118,97,108,0,0,0,1,0,0,12,0,114,101,102,114,97,99, +116,0,1,1,0,12,73,0,0,1,1,0,12,78,0,0,1,1,0,9,101,116,97,0,0,0,1,3,2,0,0,9,1,110,95,100,111,116,95, +105,0,2,58,100,111,116,0,18,78,0,0,18,73,0,0,0,0,0,3,2,0,0,9,1,107,0,2,17,49,0,48,0,0,18,101,116, +97,0,18,101,116,97,0,48,17,49,0,48,0,0,18,110,95,100,111,116,95,105,0,18,110,95,100,111,116,95,105, +0,48,47,48,47,0,0,3,2,0,0,12,1,114,101,116,118,97,108,0,0,0,10,18,107,0,17,48,0,48,0,0,40,0,9,18, +114,101,116,118,97,108,0,58,118,101,99,52,0,17,48,0,48,0,0,0,0,20,0,9,18,114,101,116,118,97,108,0, +18,101,116,97,0,18,73,0,48,18,101,116,97,0,18,110,95,100,111,116,95,105,0,48,58,115,113,114,116,0, +18,107,0,0,0,46,18,78,0,48,47,20,0,8,18,114,101,116,118,97,108,0,0,0,1,0,0,13,0,109,97,116,114,105, +120,67,111,109,112,77,117,108,116,0,1,0,0,13,109,0,0,1,0,0,13,110,0,0,0,1,8,58,109,97,116,50,0,18, +109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,48,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,48,0,0, +0,0,1,0,0,14,0,109,97,116,114,105,120,67,111,109,112,77,117,108,116,0,1,0,0,14,109,0,0,1,0,0,14, +110,0,0,0,1,8,58,109,97,116,51,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,48,0,18,109,0,16,10, +49,0,57,18,110,0,16,10,49,0,57,48,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,48,0,0,0,0,1,0,0, +15,0,109,97,116,114,105,120,67,111,109,112,77,117,108,116,0,1,0,0,15,109,0,0,1,0,0,15,110,0,0,0,1, +8,58,109,97,116,52,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,48,0,18,109,0,16,10,49,0,57,18, +110,0,16,10,49,0,57,48,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,48,0,18,109,0,16,10,51,0,57, +18,110,0,16,10,51,0,57,48,0,0,0,0,1,0,0,2,0,108,101,115,115,84,104,97,110,0,1,1,0,10,117,0,0,1,1,0, +10,118,0,0,0,1,4,118,101,99,52,95,115,108,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18, +117,0,0,18,118,0,0,0,0,1,0,0,3,0,108,101,115,115,84,104,97,110,0,1,1,0,11,117,0,0,1,1,0,11,118,0,0, +0,1,4,118,101,99,52,95,115,108,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0, +0,18,118,0,0,0,0,1,0,0,4,0,108,101,115,115,84,104,97,110,0,1,1,0,12,117,0,0,1,1,0,12,118,0,0,0,1,4, +118,101,99,52,95,115,108,116,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,0,0, +2,0,108,101,115,115,84,104,97,110,0,1,1,0,6,117,0,0,1,1,0,6,118,0,0,0,1,4,118,101,99,52,95,115,108, +116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,0,0,3,0,108,101, 115,115,84,104,97,110,0,1,1,0,7,117,0,0,1,1,0,7,118,0,0,0,1,4,118,101,99,52,95,115,108,116,0,18,95, -95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,0,4,0,108,101,115,115,84, -104,97,110,0,1,1,0,8,117,0,0,1,1,0,8,118,0,0,0,1,4,118,101,99,52,95,115,108,116,0,18,95,95,114,101, -116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,0,2,0,108,101,115,115,84,104,97,110,69,113,117,97, -108,0,1,1,0,10,117,0,0,1,1,0,10,118,0,0,0,1,4,118,101,99,52,95,115,108,101,0,18,95,95,114,101,116, -86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,0,3,0,108,101,115,115,84,104,97,110,69,113, -117,97,108,0,1,1,0,11,117,0,0,1,1,0,11,118,0,0,0,1,4,118,101,99,52,95,115,108,101,0,18,95,95,114, -101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,0,4,0,108,101,115,115,84,104,97, -110,69,113,117,97,108,0,1,1,0,12,117,0,0,1,1,0,12,118,0,0,0,1,4,118,101,99,52,95,115,108,101,0,18, -95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,0,2,0,108,101,115,115,84,104,97,110,69, -113,117,97,108,0,1,1,0,6,117,0,0,1,1,0,6,118,0,0,0,1,4,118,101,99,52,95,115,108,101,0,18,95,95,114, -101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,0,3,0,108,101,115,115,84,104,97,110, -69,113,117,97,108,0,1,1,0,7,117,0,0,1,1,0,7,118,0,0,0,1,4,118,101,99,52,95,115,108,101,0,18,95,95, -114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,0,4,0,108,101,115,115,84, -104,97,110,69,113,117,97,108,0,1,1,0,8,117,0,0,1,1,0,8,118,0,0,0,1,4,118,101,99,52,95,115,108,101, -0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,0,2,0,103,114,101,97,116,101,114, -84,104,97,110,0,1,1,0,10,117,0,0,1,1,0,10,118,0,0,0,1,4,118,101,99,52,95,115,103,116,0,18,95,95, -114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,0,3,0,103,114,101,97,116,101, -114,84,104,97,110,0,1,1,0,11,117,0,0,1,1,0,11,118,0,0,0,1,4,118,101,99,52,95,115,103,116,0,18,95, -95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,0,4,0,103,114,101,97,116, -101,114,84,104,97,110,0,1,1,0,12,117,0,0,1,1,0,12,118,0,0,0,1,4,118,101,99,52,95,115,103,116,0,18, -95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,0,2,0,103,114,101,97,116,101,114,84, -104,97,110,0,1,1,0,6,117,0,0,1,1,0,6,118,0,0,0,1,4,118,101,99,52,95,115,103,116,0,18,95,95,114,101, -116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,0,3,0,103,114,101,97,116,101,114,84,104, -97,110,0,1,1,0,7,117,0,0,1,1,0,7,118,0,0,0,1,4,118,101,99,52,95,115,103,116,0,18,95,95,114,101,116, -86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,0,4,0,103,114,101,97,116,101,114,84,104, -97,110,0,1,1,0,8,117,0,0,1,1,0,8,118,0,0,0,1,4,118,101,99,52,95,115,103,116,0,18,95,95,114,101,116, -86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,0,2,0,103,114,101,97,116,101,114,84,104,97,110,69,113, -117,97,108,0,1,1,0,10,117,0,0,1,1,0,10,118,0,0,0,1,4,118,101,99,52,95,115,103,101,0,18,95,95,114, -101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,0,3,0,103,114,101,97,116,101,114,84, -104,97,110,69,113,117,97,108,0,1,1,0,11,117,0,0,1,1,0,11,118,0,0,0,1,4,118,101,99,52,95,115,103, -101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,0,4,0,103, -114,101,97,116,101,114,84,104,97,110,69,113,117,97,108,0,1,1,0,12,117,0,0,1,1,0,12,118,0,0,0,1,4, -118,101,99,52,95,115,103,101,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,0,2, -0,103,114,101,97,116,101,114,84,104,97,110,69,113,117,97,108,0,1,1,0,6,117,0,0,1,1,0,6,118,0,0,0,1, -4,118,101,99,52,95,115,103,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118, -0,0,0,0,1,0,3,0,103,114,101,97,116,101,114,84,104,97,110,69,113,117,97,108,0,1,1,0,7,117,0,0,1,1,0, -7,118,0,0,0,1,4,118,101,99,52,95,115,103,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0, -18,117,0,0,18,118,0,0,0,0,1,0,4,0,103,114,101,97,116,101,114,84,104,97,110,69,113,117,97,108,0,1,1, -0,8,117,0,0,1,1,0,8,118,0,0,0,1,4,118,101,99,52,95,115,103,101,0,18,95,95,114,101,116,86,97,108,0, -0,18,117,0,0,18,118,0,0,0,0,1,0,2,0,101,113,117,97,108,0,1,1,0,10,117,0,0,1,1,0,10,118,0,0,0,1,4, +95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,0,0,4,0,108,101,115,115, +84,104,97,110,0,1,1,0,8,117,0,0,1,1,0,8,118,0,0,0,1,4,118,101,99,52,95,115,108,116,0,18,95,95,114, +101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,0,0,2,0,108,101,115,115,84,104,97,110,69,113,117, +97,108,0,1,1,0,10,117,0,0,1,1,0,10,118,0,0,0,1,4,118,101,99,52,95,115,108,101,0,18,95,95,114,101, +116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,0,0,3,0,108,101,115,115,84,104,97,110, +69,113,117,97,108,0,1,1,0,11,117,0,0,1,1,0,11,118,0,0,0,1,4,118,101,99,52,95,115,108,101,0,18,95, +95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,0,0,4,0,108,101,115,115, +84,104,97,110,69,113,117,97,108,0,1,1,0,12,117,0,0,1,1,0,12,118,0,0,0,1,4,118,101,99,52,95,115,108, +101,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,0,0,2,0,108,101,115,115,84, +104,97,110,69,113,117,97,108,0,1,1,0,6,117,0,0,1,1,0,6,118,0,0,0,1,4,118,101,99,52,95,115,108,101, +0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,0,0,3,0,108,101,115, +115,84,104,97,110,69,113,117,97,108,0,1,1,0,7,117,0,0,1,1,0,7,118,0,0,0,1,4,118,101,99,52,95,115, +108,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,0,0,4,0, +108,101,115,115,84,104,97,110,69,113,117,97,108,0,1,1,0,8,117,0,0,1,1,0,8,118,0,0,0,1,4,118,101,99, +52,95,115,108,101,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,0,0,2,0,103,114, +101,97,116,101,114,84,104,97,110,0,1,1,0,10,117,0,0,1,1,0,10,118,0,0,0,1,4,118,101,99,52,95,115, +103,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,0,0,3,0,103, +114,101,97,116,101,114,84,104,97,110,0,1,1,0,11,117,0,0,1,1,0,11,118,0,0,0,1,4,118,101,99,52,95, +115,103,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,0,0, +4,0,103,114,101,97,116,101,114,84,104,97,110,0,1,1,0,12,117,0,0,1,1,0,12,118,0,0,0,1,4,118,101,99, +52,95,115,103,116,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,0,0,2,0,103,114, +101,97,116,101,114,84,104,97,110,0,1,1,0,6,117,0,0,1,1,0,6,118,0,0,0,1,4,118,101,99,52,95,115,103, +116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,59,120,121,0,0,18,118,0,59,120,121, +0,0,0,0,1,0,0,3,0,103,114,101,97,116,101,114,84,104,97,110,0,1,1,0,7,117,0,0,1,1,0,7,118,0,0,0,1,4, +118,101,99,52,95,115,103,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18, +118,0,0,0,0,1,0,0,4,0,103,114,101,97,116,101,114,84,104,97,110,0,1,1,0,8,117,0,0,1,1,0,8,118,0,0,0, +1,4,118,101,99,52,95,115,103,116,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1, +0,0,2,0,103,114,101,97,116,101,114,84,104,97,110,69,113,117,97,108,0,1,1,0,10,117,0,0,1,1,0,10,118, +0,0,0,1,4,118,101,99,52,95,115,103,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0, +0,18,118,0,0,0,0,1,0,0,3,0,103,114,101,97,116,101,114,84,104,97,110,69,113,117,97,108,0,1,1,0,11, +117,0,0,1,1,0,11,118,0,0,0,1,4,118,101,99,52,95,115,103,101,0,18,95,95,114,101,116,86,97,108,0,59, +120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,0,0,4,0,103,114,101,97,116,101,114,84,104,97,110,69, +113,117,97,108,0,1,1,0,12,117,0,0,1,1,0,12,118,0,0,0,1,4,118,101,99,52,95,115,103,101,0,18,95,95, +114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,0,0,2,0,103,114,101,97,116,101,114,84,104,97, +110,69,113,117,97,108,0,1,1,0,6,117,0,0,1,1,0,6,118,0,0,0,1,4,118,101,99,52,95,115,103,101,0,18,95, +95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,0,0,3,0,103,114,101,97,116, +101,114,84,104,97,110,69,113,117,97,108,0,1,1,0,7,117,0,0,1,1,0,7,118,0,0,0,1,4,118,101,99,52,95, +115,103,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,0,0, +4,0,103,114,101,97,116,101,114,84,104,97,110,69,113,117,97,108,0,1,1,0,8,117,0,0,1,1,0,8,118,0,0,0, +1,4,118,101,99,52,95,115,103,101,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1, +0,0,2,0,101,113,117,97,108,0,1,1,0,10,117,0,0,1,1,0,10,118,0,0,0,1,4,118,101,99,52,95,115,101,113, +0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,0,0,3,0,101,113,117, +97,108,0,1,1,0,11,117,0,0,1,1,0,11,118,0,0,0,1,4,118,101,99,52,95,115,101,113,0,18,95,95,114,101, +116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,0,0,4,0,101,113,117,97,108,0,1,1,0, +12,117,0,0,1,1,0,12,118,0,0,0,1,4,118,101,99,52,95,115,101,113,0,18,95,95,114,101,116,86,97,108,0, +0,18,117,0,0,18,118,0,0,0,0,1,0,0,2,0,101,113,117,97,108,0,1,1,0,6,117,0,0,1,1,0,6,118,0,0,0,1,4, 118,101,99,52,95,115,101,113,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0, -0,0,0,1,0,3,0,101,113,117,97,108,0,1,1,0,11,117,0,0,1,1,0,11,118,0,0,0,1,4,118,101,99,52,95,115, -101,113,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,0,4,0, -101,113,117,97,108,0,1,1,0,12,117,0,0,1,1,0,12,118,0,0,0,1,4,118,101,99,52,95,115,101,113,0,18,95, -95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,0,2,0,101,113,117,97,108,0,1,1,0,6,117,0, -0,1,1,0,6,118,0,0,0,1,4,118,101,99,52,95,115,101,113,0,18,95,95,114,101,116,86,97,108,0,59,120,121, -0,0,18,117,0,0,18,118,0,0,0,0,1,0,3,0,101,113,117,97,108,0,1,1,0,7,117,0,0,1,1,0,7,118,0,0,0,1,4, +0,0,0,1,0,0,3,0,101,113,117,97,108,0,1,1,0,7,117,0,0,1,1,0,7,118,0,0,0,1,4,118,101,99,52,95,115, +101,113,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,0,0,4,0, +101,113,117,97,108,0,1,1,0,8,117,0,0,1,1,0,8,118,0,0,0,1,4,118,101,99,52,95,115,101,113,0,18,95,95, +114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,0,0,2,0,101,113,117,97,108,0,1,1,0,2,117,0,0, +1,1,0,2,118,0,0,0,1,4,118,101,99,52,95,115,101,113,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0, +0,18,117,0,0,18,118,0,0,0,0,1,0,0,3,0,101,113,117,97,108,0,1,1,0,3,117,0,0,1,1,0,3,118,0,0,0,1,4, 118,101,99,52,95,115,101,113,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18, -118,0,0,0,0,1,0,4,0,101,113,117,97,108,0,1,1,0,8,117,0,0,1,1,0,8,118,0,0,0,1,4,118,101,99,52,95, -115,101,113,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,0,2,0,101,113,117,97, -108,0,1,1,0,2,117,0,0,1,1,0,2,118,0,0,0,1,4,118,101,99,52,95,115,101,113,0,18,95,95,114,101,116,86, -97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,0,3,0,101,113,117,97,108,0,1,1,0,3,117,0,0,1,1, -0,3,118,0,0,0,1,4,118,101,99,52,95,115,101,113,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0, -0,18,117,0,0,18,118,0,0,0,0,1,0,4,0,101,113,117,97,108,0,1,1,0,4,117,0,0,1,1,0,4,118,0,0,0,1,4,118, -101,99,52,95,115,101,113,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,0,2,0, -110,111,116,69,113,117,97,108,0,1,1,0,10,117,0,0,1,1,0,10,118,0,0,0,1,4,118,101,99,52,95,115,110, -101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,0,3,0,110,111, -116,69,113,117,97,108,0,1,1,0,11,117,0,0,1,1,0,11,118,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18, -95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,0,4,0,110,111,116,69, -113,117,97,108,0,1,1,0,12,117,0,0,1,1,0,12,118,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95, -114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,0,2,0,110,111,116,69,113,117,97,108,0,1,1,0, -6,117,0,0,1,1,0,6,118,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59, -120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,0,3,0,110,111,116,69,113,117,97,108,0,1,1,0,7,117,0,0,1,1, -0,7,118,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0, -0,18,117,0,0,18,118,0,0,0,0,1,0,4,0,110,111,116,69,113,117,97,108,0,1,1,0,8,117,0,0,1,1,0,8,118,0, +118,0,0,0,0,1,0,0,4,0,101,113,117,97,108,0,1,1,0,4,117,0,0,1,1,0,4,118,0,0,0,1,4,118,101,99,52,95, +115,101,113,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,0,0,2,0,110,111,116, +69,113,117,97,108,0,1,1,0,10,117,0,0,1,1,0,10,118,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95, +95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,0,0,3,0,110,111,116,69,113, +117,97,108,0,1,1,0,11,117,0,0,1,1,0,11,118,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95,114, +101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,0,0,4,0,110,111,116,69,113,117, +97,108,0,1,1,0,12,117,0,0,1,1,0,12,118,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101, +116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,0,0,2,0,110,111,116,69,113,117,97,108,0,1,1,0,6,117, +0,0,1,1,0,6,118,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120, +121,0,0,18,117,0,0,18,118,0,0,0,0,1,0,0,3,0,110,111,116,69,113,117,97,108,0,1,1,0,7,117,0,0,1,1,0, +7,118,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0, +18,117,0,0,18,118,0,0,0,0,1,0,0,4,0,110,111,116,69,113,117,97,108,0,1,1,0,8,117,0,0,1,1,0,8,118,0, 0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0, -0,1,0,2,0,110,111,116,69,113,117,97,108,0,1,1,0,2,117,0,0,1,1,0,2,118,0,0,0,1,4,118,101,99,52,95, -115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,0,3,0, +0,1,0,0,2,0,110,111,116,69,113,117,97,108,0,1,1,0,2,117,0,0,1,1,0,2,118,0,0,0,1,4,118,101,99,52,95, +115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,0,0,3,0, 110,111,116,69,113,117,97,108,0,1,1,0,3,117,0,0,1,1,0,3,118,0,0,0,1,4,118,101,99,52,95,115,110,101, -0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,0,4,0,110,111, +0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,0,0,4,0,110,111, 116,69,113,117,97,108,0,1,1,0,4,117,0,0,1,1,0,4,118,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95, -95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,0,1,0,97,110,121,0,1,1,0,2,118,0,0,0,1,3, -2,0,9,1,115,117,109,0,0,0,4,118,101,99,52,95,97,100,100,0,18,115,117,109,0,59,120,0,0,18,118,0,59, -120,0,0,18,118,0,59,121,0,0,0,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59, -120,0,0,18,115,117,109,0,59,120,0,0,17,48,0,48,0,0,0,0,0,1,0,1,0,97,110,121,0,1,1,0,3,118,0,0,0,1, -3,2,0,9,1,115,117,109,0,0,0,4,118,101,99,52,95,97,100,100,0,18,115,117,109,0,59,120,0,0,18,118,0, -59,120,0,0,18,118,0,59,121,0,0,0,4,118,101,99,52,95,97,100,100,0,18,115,117,109,0,59,120,0,0,18, -115,117,109,0,59,120,0,0,18,118,0,59,122,0,0,0,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101, -116,86,97,108,0,59,120,0,0,18,115,117,109,0,59,120,0,0,17,48,0,48,0,0,0,0,0,1,0,1,0,97,110,121,0,1, -1,0,4,118,0,0,0,1,3,2,0,9,1,115,117,109,0,0,0,4,118,101,99,52,95,97,100,100,0,18,115,117,109,0,59, -120,0,0,18,118,0,59,120,0,0,18,118,0,59,121,0,0,0,4,118,101,99,52,95,97,100,100,0,18,115,117,109,0, -59,120,0,0,18,115,117,109,0,59,120,0,0,18,118,0,59,122,0,0,0,4,118,101,99,52,95,97,100,100,0,18, -115,117,109,0,59,120,0,0,18,115,117,109,0,59,120,0,0,18,118,0,59,119,0,0,0,4,118,101,99,52,95,115, -110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,115,117,109,0,59,120,0,0,17,48,0,48,0,0,0, -0,0,1,0,1,0,97,108,108,0,1,1,0,2,118,0,0,0,1,3,2,0,9,1,112,114,111,100,0,0,0,4,118,101,99,52,95, -109,117,108,116,105,112,108,121,0,18,112,114,111,100,0,59,120,0,0,18,118,0,59,120,0,0,18,118,0,59, -121,0,0,0,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,112,114, -111,100,0,59,120,0,0,17,48,0,48,0,0,0,0,8,18,118,0,59,120,0,18,118,0,59,121,0,34,0,0,1,0,1,0,97, -108,108,0,1,1,0,3,118,0,0,0,1,3,2,0,9,1,112,114,111,100,0,0,0,4,118,101,99,52,95,109,117,108,116, -105,112,108,121,0,18,112,114,111,100,0,59,120,0,0,18,118,0,59,120,0,0,18,118,0,59,121,0,0,0,4,118, -101,99,52,95,109,117,108,116,105,112,108,121,0,18,112,114,111,100,0,59,120,0,0,18,112,114,111,100, -0,59,120,0,0,18,118,0,59,122,0,0,0,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108, -0,59,120,0,0,18,112,114,111,100,0,59,120,0,0,17,48,0,48,0,0,0,0,0,1,0,1,0,97,108,108,0,1,1,0,4,118, -0,0,0,1,3,2,0,9,1,112,114,111,100,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18, -112,114,111,100,0,59,120,0,0,18,118,0,59,120,0,0,18,118,0,59,121,0,0,0,4,118,101,99,52,95,109,117, -108,116,105,112,108,121,0,18,112,114,111,100,0,59,120,0,0,18,112,114,111,100,0,59,120,0,0,18,118,0, -59,122,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,112,114,111,100,0,59,120,0,0, -18,112,114,111,100,0,59,120,0,0,18,118,0,59,119,0,0,0,4,118,101,99,52,95,115,110,101,0,18,95,95, -114,101,116,86,97,108,0,59,120,0,0,18,112,114,111,100,0,59,120,0,0,17,48,0,48,0,0,0,0,0,1,0,2,0, -110,111,116,0,1,1,0,2,118,0,0,0,1,4,118,101,99,52,95,115,101,113,0,18,95,95,114,101,116,86,97,108, -0,59,120,121,0,0,18,118,0,0,17,48,0,48,0,0,0,0,0,1,0,3,0,110,111,116,0,1,1,0,3,118,0,0,0,1,4,118, -101,99,52,95,115,101,113,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0,0,17,48,0, -48,0,0,0,0,0,1,0,4,0,110,111,116,0,1,1,0,4,118,0,0,0,1,4,118,101,99,52,95,115,101,113,0,18,95,95, -114,101,116,86,97,108,0,0,18,118,0,0,17,48,0,48,0,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,49, -68,0,1,1,0,16,115,97,109,112,108,101,114,0,0,1,1,0,9,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95, -116,101,120,49,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99, -111,111,114,100,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,49,68,80,114,111,106,0,1,1,0,16,115, -97,109,112,108,101,114,0,0,1,1,0,10,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,112, -49,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114, -100,0,59,120,121,121,121,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,49,68,80,114,111,106,0,1,1,0, -16,115,97,109,112,108,101,114,0,0,1,1,0,12,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101, -120,112,49,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111, -111,114,100,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,50,68,0,1,1,0,17,115,97,109,112,108,101, -114,0,0,1,1,0,10,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,50,100,0,18,95,95,114, -101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,0,12,0,116, -101,120,116,117,114,101,50,68,80,114,111,106,0,1,1,0,17,115,97,109,112,108,101,114,0,0,1,1,0,11,99, -111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,112,50,100,0,18,95,95,114,101,116,86,97,108, -0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,59,120,121,122,122,0,0,0,0,1,0,12,0, -116,101,120,116,117,114,101,50,68,80,114,111,106,0,1,1,0,17,115,97,109,112,108,101,114,0,0,1,1,0, -12,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,112,50,100,0,18,95,95,114,101,116,86, -97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,0,12,0,116,101,120, -116,117,114,101,51,68,0,1,1,0,18,115,97,109,112,108,101,114,0,0,1,1,0,11,99,111,111,114,100,0,0,0, -1,4,118,101,99,52,95,116,101,120,51,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108, -101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,51,68,80,114,111, -106,0,1,1,0,18,115,97,109,112,108,101,114,0,0,1,1,0,12,99,111,111,114,100,0,0,0,1,4,118,101,99,52, -95,116,101,120,112,51,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0, -18,99,111,111,114,100,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,67,117,98,101,0,1,1,0,19,115,97, -109,112,108,101,114,0,0,1,1,0,11,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,99,117, -98,101,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114, -100,0,0,0,0,1,0,12,0,115,104,97,100,111,119,49,68,0,1,1,0,20,115,97,109,112,108,101,114,0,0,1,1,0, -11,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,49,100,0,18,95,95,114,101,116,86,97, -108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,0,12,0,115,104,97,100, -111,119,49,68,80,114,111,106,0,1,1,0,20,115,97,109,112,108,101,114,0,0,1,1,0,12,99,111,111,114,100, -0,0,0,1,4,118,101,99,52,95,116,101,120,112,49,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97, -109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,0,12,0,115,104,97,100,111,119,50,68,0,1,1, -0,21,115,97,109,112,108,101,114,0,0,1,1,0,11,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101, -120,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111, -114,100,0,0,0,0,1,0,12,0,115,104,97,100,111,119,50,68,80,114,111,106,0,1,1,0,21,115,97,109,112,108, -101,114,0,0,1,1,0,12,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,112,50,100,0,18,95, -95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,0, -12,0,116,101,120,116,117,114,101,50,68,82,101,99,116,0,1,1,0,22,115,97,109,112,108,101,114,0,0,1,1, -0,10,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95,114,101,99,116,0,18,95,95,114, -101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,0,12,0,116, -101,120,116,117,114,101,50,68,82,101,99,116,80,114,111,106,0,1,1,0,22,115,97,109,112,108,101,114,0, -0,1,1,0,11,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,112,95,114,101,99,116,0,18,95, -95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,59,120,121, -122,122,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,50,68,82,101,99,116,80,114,111,106,0,1,1,0,22, +95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,0,0,1,0,97,110,121,0,1,1,0,2,118,0,0,0,1, +3,2,0,0,9,1,115,117,109,0,0,0,4,118,101,99,52,95,97,100,100,0,18,115,117,109,0,59,120,0,0,18,118,0, +59,120,0,0,18,118,0,59,121,0,0,0,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0, +59,120,0,0,18,115,117,109,0,59,120,0,0,17,48,0,48,0,0,0,0,0,1,0,0,1,0,97,110,121,0,1,1,0,3,118,0,0, +0,1,3,2,0,0,9,1,115,117,109,0,0,0,4,118,101,99,52,95,97,100,100,0,18,115,117,109,0,59,120,0,0,18, +118,0,59,120,0,0,18,118,0,59,121,0,0,0,4,118,101,99,52,95,97,100,100,0,18,115,117,109,0,59,120,0,0, +18,115,117,109,0,59,120,0,0,18,118,0,59,122,0,0,0,4,118,101,99,52,95,115,110,101,0,18,95,95,114, +101,116,86,97,108,0,59,120,0,0,18,115,117,109,0,59,120,0,0,17,48,0,48,0,0,0,0,0,1,0,0,1,0,97,110, +121,0,1,1,0,4,118,0,0,0,1,3,2,0,0,9,1,115,117,109,0,0,0,4,118,101,99,52,95,97,100,100,0,18,115,117, +109,0,59,120,0,0,18,118,0,59,120,0,0,18,118,0,59,121,0,0,0,4,118,101,99,52,95,97,100,100,0,18,115, +117,109,0,59,120,0,0,18,115,117,109,0,59,120,0,0,18,118,0,59,122,0,0,0,4,118,101,99,52,95,97,100, +100,0,18,115,117,109,0,59,120,0,0,18,115,117,109,0,59,120,0,0,18,118,0,59,119,0,0,0,4,118,101,99, +52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,115,117,109,0,59,120,0,0,17,48, +0,48,0,0,0,0,0,1,0,0,1,0,97,108,108,0,1,1,0,2,118,0,0,0,1,3,2,0,0,9,1,112,114,111,100,0,0,0,4,118, +101,99,52,95,109,117,108,116,105,112,108,121,0,18,112,114,111,100,0,0,18,118,0,59,120,0,0,18,118,0, +59,121,0,0,0,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,0,18,112,114,111, +100,0,0,17,48,0,48,0,0,0,0,0,1,0,0,1,0,97,108,108,0,1,1,0,3,118,0,0,0,1,3,2,0,0,9,1,112,114,111, +100,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,112,114,111,100,0,0,18,118,0,59, +120,0,0,18,118,0,59,121,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,112,114,111, +100,0,0,18,112,114,111,100,0,0,18,118,0,59,122,0,0,0,4,118,101,99,52,95,115,110,101,0,18,95,95,114, +101,116,86,97,108,0,0,18,112,114,111,100,0,0,17,48,0,48,0,0,0,0,0,1,0,0,1,0,97,108,108,0,1,1,0,4, +118,0,0,0,1,3,2,0,0,9,1,112,114,111,100,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0, +18,112,114,111,100,0,0,18,118,0,59,120,0,0,18,118,0,59,121,0,0,0,4,118,101,99,52,95,109,117,108, +116,105,112,108,121,0,18,112,114,111,100,0,0,18,112,114,111,100,0,0,18,118,0,59,122,0,0,0,4,118, +101,99,52,95,109,117,108,116,105,112,108,121,0,18,112,114,111,100,0,0,18,112,114,111,100,0,0,18, +118,0,59,119,0,0,0,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,0,18,112,114, +111,100,0,0,17,48,0,48,0,0,0,0,0,1,0,0,2,0,110,111,116,0,1,1,0,2,118,0,0,0,1,4,118,101,99,52,95, +115,101,113,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,118,0,0,17,48,0,48,0,0,0,0,0,1,0, +0,3,0,110,111,116,0,1,1,0,3,118,0,0,0,1,4,118,101,99,52,95,115,101,113,0,18,95,95,114,101,116,86, +97,108,0,59,120,121,122,0,0,18,118,0,0,17,48,0,48,0,0,0,0,0,1,0,0,4,0,110,111,116,0,1,1,0,4,118,0, +0,0,1,4,118,101,99,52,95,115,101,113,0,18,95,95,114,101,116,86,97,108,0,0,18,118,0,0,17,48,0,48,0, +0,0,0,0,1,0,0,12,0,116,101,120,116,117,114,101,49,68,0,1,1,0,16,115,97,109,112,108,101,114,0,0,1,1, +0,9,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,49,100,0,18,95,95,114,101,116,86,97, +108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,0,0,12,0,116,101,120,116, +117,114,101,49,68,80,114,111,106,0,1,1,0,16,115,97,109,112,108,101,114,0,0,1,1,0,10,99,111,111,114, +100,0,0,0,1,4,118,101,99,52,95,116,101,120,112,49,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115, +97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,59,120,121,121,121,0,0,0,0,1,0,0,12,0,116,101, +120,116,117,114,101,49,68,80,114,111,106,0,1,1,0,16,115,97,109,112,108,101,114,0,0,1,1,0,12,99,111, +111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,112,49,100,0,18,95,95,114,101,116,86,97,108,0,0, +18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,0,0,12,0,116,101,120,116,117,114, +101,50,68,0,1,1,0,17,115,97,109,112,108,101,114,0,0,1,1,0,10,99,111,111,114,100,0,0,0,1,4,118,101, +99,52,95,116,101,120,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0, +18,99,111,111,114,100,0,0,0,0,1,0,0,12,0,116,101,120,116,117,114,101,50,68,80,114,111,106,0,1,1,0, +17,115,97,109,112,108,101,114,0,0,1,1,0,11,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101, +120,112,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111, +111,114,100,0,59,120,121,122,122,0,0,0,0,1,0,0,12,0,116,101,120,116,117,114,101,50,68,80,114,111, +106,0,1,1,0,17,115,97,109,112,108,101,114,0,0,1,1,0,12,99,111,111,114,100,0,0,0,1,4,118,101,99,52, +95,116,101,120,112,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0, +18,99,111,111,114,100,0,0,0,0,1,0,0,12,0,116,101,120,116,117,114,101,51,68,0,1,1,0,18,115,97,109, +112,108,101,114,0,0,1,1,0,11,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,51,100,0,18, +95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1, +0,0,12,0,116,101,120,116,117,114,101,51,68,80,114,111,106,0,1,1,0,18,115,97,109,112,108,101,114,0, +0,1,1,0,12,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,112,51,100,0,18,95,95,114,101, +116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,0,0,12,0,116, +101,120,116,117,114,101,67,117,98,101,0,1,1,0,19,115,97,109,112,108,101,114,0,0,1,1,0,11,99,111, +111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,99,117,98,101,0,18,95,95,114,101,116,86,97,108, +0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,0,0,12,0,115,104,97,100,111, +119,49,68,0,1,1,0,20,115,97,109,112,108,101,114,0,0,1,1,0,11,99,111,111,114,100,0,0,0,1,4,118,101, +99,52,95,116,101,120,49,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0, +18,99,111,111,114,100,0,0,0,0,1,0,0,12,0,115,104,97,100,111,119,49,68,80,114,111,106,0,1,1,0,20, 115,97,109,112,108,101,114,0,0,1,1,0,12,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120, -112,95,114,101,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99, -99,111,111,114,100,0,0,0,0,1,0,12,0,115,104,97,100,111,119,50,68,82,101,99,116,0,1,1,0,23,115,97, -109,112,108,101,114,0,0,1,1,0,11,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95,114, -101,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111, -114,100,0,0,0,0,1,0,12,0,115,104,97,100,111,119,50,68,82,101,99,116,80,114,111,106,0,1,1,0,23,115, -97,109,112,108,101,114,0,0,1,1,0,12,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,112, -95,114,101,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111, -111,114,100,0,0,0,0,1,0,9,0,110,111,105,115,101,49,0,1,1,0,9,120,0,0,0,1,4,102,108,111,97,116,95, -110,111,105,115,101,49,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,0,9,0,110,111,105,115, -101,49,0,1,1,0,10,120,0,0,0,1,4,102,108,111,97,116,95,110,111,105,115,101,50,0,18,95,95,114,101, -116,86,97,108,0,0,18,120,0,0,0,0,1,0,9,0,110,111,105,115,101,49,0,1,1,0,11,120,0,0,0,1,4,102,108, -111,97,116,95,110,111,105,115,101,51,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,0,9,0, -110,111,105,115,101,49,0,1,1,0,12,120,0,0,0,1,4,102,108,111,97,116,95,110,111,105,115,101,52,0,18, -95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,0,10,0,110,111,105,115,101,50,0,1,1,0,9,120,0,0,0, -1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0,0,0,20,0,9,18, -95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,17,49,57,0,51,52,0,0, -46,0,0,20,0,0,1,0,10,0,110,111,105,115,101,50,0,1,1,0,10,120,0,0,0,1,9,18,95,95,114,101,116,86,97, -108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59, -121,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,50,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54, -0,0,0,0,46,0,0,20,0,0,1,0,10,0,110,111,105,115,101,50,0,1,1,0,11,120,0,0,0,1,9,18,95,95,114,101, -116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86, -97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,51,0,17,49,57,0,51,52,0,0,0, -17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,0,46,0,0,20,0,0,1,0,10,0,110,111,105,115,101,50,0,1,1,0,12, -120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0,0,0, -20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101, -99,52,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,17,50,0,55,55,0,0,0,0,46,0, -0,20,0,0,1,0,11,0,110,111,105,115,101,51,0,1,1,0,9,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, -59,120,0,58,110,111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0, -58,110,111,105,115,101,49,0,18,120,0,17,49,57,0,51,52,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97, -108,0,59,122,0,58,110,111,105,115,101,49,0,18,120,0,17,53,0,52,55,0,0,46,0,0,20,0,0,1,0,11,0,110, -111,105,115,101,51,0,1,1,0,10,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111, -105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115, -101,49,0,18,120,0,58,118,101,99,50,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,0,46,0,0,20,0,9,18, -95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,50,0,17, -53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,0,46,0,0,20,0,0,1,0,11,0,110,111,105,115,101,51,0,1,1,0,11, +112,49,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111, +114,100,0,0,0,0,1,0,0,12,0,115,104,97,100,111,119,50,68,0,1,1,0,21,115,97,109,112,108,101,114,0,0, +1,1,0,11,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,50,100,0,18,95,95,114,101,116, +86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,0,0,12,0,115,104, +97,100,111,119,50,68,80,114,111,106,0,1,1,0,21,115,97,109,112,108,101,114,0,0,1,1,0,12,99,111,111, +114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,112,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18, +115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,0,0,12,0,116,101,120,116,117,114, +101,50,68,82,101,99,116,0,1,1,0,22,115,97,109,112,108,101,114,0,0,1,1,0,10,99,111,111,114,100,0,0, +0,1,4,118,101,99,52,95,116,101,120,95,114,101,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,115, +97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,0,0,12,0,116,101,120,116,117,114,101,50, +68,82,101,99,116,80,114,111,106,0,1,1,0,22,115,97,109,112,108,101,114,0,0,1,1,0,11,99,111,111,114, +100,0,0,0,1,4,118,101,99,52,95,116,101,120,112,95,114,101,99,116,0,18,95,95,114,101,116,86,97,108, +0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,59,120,121,122,122,0,0,0,0,1,0,0,12, +0,116,101,120,116,117,114,101,50,68,82,101,99,116,80,114,111,106,0,1,1,0,22,115,97,109,112,108,101, +114,0,0,1,1,0,12,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,112,95,114,101,99,116,0, +18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,99,111,111,114,100,0,0, +0,0,1,0,0,12,0,115,104,97,100,111,119,50,68,82,101,99,116,0,1,1,0,23,115,97,109,112,108,101,114,0, +0,1,1,0,11,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95,114,101,99,116,0,18,95,95, +114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,0,0,12, +0,115,104,97,100,111,119,50,68,82,101,99,116,80,114,111,106,0,1,1,0,23,115,97,109,112,108,101,114, +0,0,1,1,0,12,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,112,95,114,101,99,116,0,18, +95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1, +0,0,9,0,110,111,105,115,101,49,0,1,1,0,9,120,0,0,0,1,4,102,108,111,97,116,95,110,111,105,115,101, +49,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,0,0,9,0,110,111,105,115,101,49,0,1,1,0,10, +120,0,0,0,1,4,102,108,111,97,116,95,110,111,105,115,101,50,0,18,95,95,114,101,116,86,97,108,0,0,18, +120,0,0,0,0,1,0,0,9,0,110,111,105,115,101,49,0,1,1,0,11,120,0,0,0,1,4,102,108,111,97,116,95,110, +111,105,115,101,51,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,0,0,9,0,110,111,105,115, +101,49,0,1,1,0,12,120,0,0,0,1,4,102,108,111,97,116,95,110,111,105,115,101,52,0,18,95,95,114,101, +116,86,97,108,0,0,18,120,0,0,0,0,1,0,0,10,0,110,111,105,115,101,50,0,1,1,0,9,120,0,0,0,1,9,18,95, +95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95,114, +101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,17,49,57,0,51,52,0,0,46,0,0,20,0, +0,1,0,0,10,0,110,111,105,115,101,50,0,1,1,0,10,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59, +120,0,58,110,111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58, +110,111,105,115,101,49,0,18,120,0,58,118,101,99,50,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,0, +46,0,0,20,0,0,1,0,0,10,0,110,111,105,115,101,50,0,1,1,0,11,120,0,0,0,1,9,18,95,95,114,101,116,86, +97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0, +59,121,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,51,0,17,49,57,0,51,52,0,0,0,17,55,0,54, +54,0,0,0,17,51,0,50,51,0,0,0,0,46,0,0,20,0,0,1,0,0,10,0,110,111,105,115,101,50,0,1,1,0,12,120,0,0, +0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0,0,0,20,0,9,18, +95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,52,0,17, +49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,17,50,0,55,55,0,0,0,0,46,0,0,20,0,0,1, +0,0,11,0,110,111,105,115,101,51,0,1,1,0,9,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0, +58,110,111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110, +111,105,115,101,49,0,18,120,0,17,49,57,0,51,52,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0, +59,122,0,58,110,111,105,115,101,49,0,18,120,0,17,53,0,52,55,0,0,46,0,0,20,0,0,1,0,0,11,0,110,111, +105,115,101,51,0,1,1,0,10,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105, +115,101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101, +49,0,18,120,0,58,118,101,99,50,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,0,46,0,0,20,0,9,18,95, +95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,50,0,17,53, +0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,0,46,0,0,20,0,0,1,0,0,11,0,110,111,105,115,101,51,0,1,1,0,11, 120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0,0,0, 20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101, 99,51,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,0,46,0,0,20,0,9,18,95,95, 114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,51,0,17,53,0, -52,55,0,0,0,17,49,55,0,56,53,0,0,0,17,49,49,0,48,52,0,0,0,0,46,0,0,20,0,0,1,0,11,0,110,111,105,115, -101,51,0,1,1,0,12,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101, +52,55,0,0,0,17,49,55,0,56,53,0,0,0,17,49,49,0,48,52,0,0,0,0,46,0,0,20,0,0,1,0,0,11,0,110,111,105, +115,101,51,0,1,1,0,12,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115, +101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0, +18,120,0,58,118,101,99,52,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,17,50,0, +55,55,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0, +18,120,0,58,118,101,99,52,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,17,49,49,0,48,52,0,0,0,17, +49,51,0,49,57,0,0,0,0,46,0,0,20,0,0,1,0,0,12,0,110,111,105,115,101,52,0,1,1,0,9,120,0,0,0,1,9,18, +95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95, +114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,17,49,57,0,51,52,0,0,46,0,0, +20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,18,120,0,17,53,0,52, +55,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,110,111,105,115,101,49,0,18,120, +0,17,50,51,0,53,52,0,0,46,0,0,20,0,0,1,0,0,12,0,110,111,105,115,101,52,0,1,1,0,10,120,0,0,0,1,9,18, +95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95, +114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,50,0,17,49,57, +0,51,52,0,0,0,17,55,0,54,54,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110, +111,105,115,101,49,0,18,120,0,58,118,101,99,50,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,0,46,0, +0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101, +99,50,0,17,50,51,0,53,52,0,0,0,17,50,57,0,49,49,0,0,0,0,46,0,0,20,0,0,1,0,0,12,0,110,111,105,115, +101,52,0,1,1,0,11,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101, 49,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,18, -120,0,58,118,101,99,52,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,17,50,0,55, -55,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,18, -120,0,58,118,101,99,52,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,17,49,49,0,48,52,0,0,0,17,49, -51,0,49,57,0,0,0,0,46,0,0,20,0,0,1,0,12,0,110,111,105,115,101,52,0,1,1,0,9,120,0,0,0,1,9,18,95,95, -114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101, -116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,17,49,57,0,51,52,0,0,46,0,0,20,0,9, -18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,18,120,0,17,53,0,52,55,0,0, -46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,110,111,105,115,101,49,0,18,120,0,17,50, -51,0,53,52,0,0,46,0,0,20,0,0,1,0,12,0,110,111,105,115,101,52,0,1,1,0,10,120,0,0,0,1,9,18,95,95,114, -101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116, -86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,50,0,17,49,57,0,51,52,0,0, -0,17,55,0,54,54,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115, -101,49,0,18,120,0,58,118,101,99,50,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,0,46,0,0,20,0,9,18, -95,95,114,101,116,86,97,108,0,59,119,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,50,0,17, -50,51,0,53,52,0,0,0,17,50,57,0,49,49,0,0,0,0,46,0,0,20,0,0,1,0,12,0,110,111,105,115,101,52,0,1,1,0, -11,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0,0, -0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101, -99,51,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,0,46,0,0,20,0,9,18,95,95, -114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,51,0,17,53,0, -52,55,0,0,0,17,49,55,0,56,53,0,0,0,17,49,49,0,48,52,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86, -97,108,0,59,119,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,51,0,17,50,51,0,53,52,0,0,0, -17,50,57,0,49,49,0,0,0,17,51,49,0,57,49,0,0,0,0,46,0,0,20,0,0,1,0,12,0,110,111,105,115,101,52,0,1, -1,0,12,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120, -0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,58,118, -101,99,52,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,17,50,0,55,55,0,0,0,0, -46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,18,120,0,58, -118,101,99,52,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,17,49,49,0,48,52,0,0,0,17,49,51,0,49,57, -0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,110,111,105,115,101,49,0,18,120, -0,58,118,101,99,52,0,17,50,51,0,53,52,0,0,0,17,50,57,0,49,49,0,0,0,17,51,49,0,57,49,0,0,0,17,51,55, -0,52,56,0,0,0,0,46,0,0,20,0,0,0 +120,0,58,118,101,99,51,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,0,46,0,0, +20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101, +99,51,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,17,49,49,0,48,52,0,0,0,0,46,0,0,20,0,9,18,95,95, +114,101,116,86,97,108,0,59,119,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,51,0,17,50,51, +0,53,52,0,0,0,17,50,57,0,49,49,0,0,0,17,51,49,0,57,49,0,0,0,0,46,0,0,20,0,0,1,0,0,12,0,110,111,105, +115,101,52,0,1,1,0,12,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115, +101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0, +18,120,0,58,118,101,99,52,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,17,50,0, +55,55,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0, +18,120,0,58,118,101,99,52,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,17,49,49,0,48,52,0,0,0,17, +49,51,0,49,57,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,110,111,105,115, +101,49,0,18,120,0,58,118,101,99,52,0,17,50,51,0,53,52,0,0,0,17,50,57,0,49,49,0,0,0,17,51,49,0,57, +49,0,0,0,17,51,55,0,52,56,0,0,0,0,46,0,0,20,0,0,0 diff --git a/src/mesa/shader/slang/library/slang_core.gc b/src/mesa/shader/slang/library/slang_core.gc index 1f57997051..10a6bb5cb1 100644 --- a/src/mesa/shader/slang/library/slang_core.gc +++ b/src/mesa/shader/slang/library/slang_core.gc @@ -107,7 +107,7 @@ int __constructor(const float f) { - __asm float_to_int __retVal, f; + __asm vec4_to_ivec4 __retVal, f; } int __constructor(const bool b) @@ -122,14 +122,12 @@ int __constructor(const int i) bool __constructor(const int i) { - const float zero = 0.0; - __asm vec4_sne __retVal, i, zero; + __asm vec4_sne __retVal, i, 0.0; } bool __constructor(const float f) { - const float zero = 0.0; - __asm vec4_sne __retVal, f, zero; + __asm vec4_sne __retVal, f, 0.0; } bool __constructor(const bool b) @@ -139,12 +137,12 @@ bool __constructor(const bool b) float __constructor(const int i) { - __asm int_to_float __retVal, i; + __asm ivec4_to_vec4 __retVal, i; } float __constructor(const bool b) { - __retVal = b; + __asm ivec4_to_vec4 __retVal, b; } float __constructor(const float f) @@ -163,32 +161,33 @@ vec2 __constructor(const float x, const float y) vec2 __constructor(const float f) { - __retVal.xy = f.xx; + __asm vec4_move __retVal.xy, f; } vec2 __constructor(const int i) { - __retVal.xy = i.xx; + __asm ivec4_to_vec4 __retVal.xy, i; } vec2 __constructor(const bool b) { - __retVal.xy = b.xx; + __asm ivec4_to_vec4 __retVal.xy, b; } vec2 __constructor(const bvec2 b) { - __retVal = b; +// __retVal = b; + __asm ivec4_to_vec4 __retVal.xy, b; } vec2 __constructor(const vec3 v) { - __retVal.xy = v.xy; + __asm vec4_move __retVal.xy, v.xy; } vec2 __constructor(const vec4 v) { - __retVal.st = v.xy; + __asm vec4_move __retVal.xy, v.xy; } @@ -203,27 +202,28 @@ vec3 __constructor(const float x, const float y, const float z) vec3 __constructor(const float f) { - __retVal.xyz = f.xxx; + // Note: this could be "__retVal.xyz = f" but that's an illegal assignment + __asm vec4_move __retVal.xyz, f; } vec3 __constructor(const int i) { - __asm int_to_float __retVal.xyz, i.xxx; + __asm ivec4_to_vec4 __retVal.xyz, i; } vec3 __constructor(const bool b) { - __retVal.xyz = b.xxx; + __asm ivec4_to_vec4 __retVal.xyz, b; } vec3 __constructor(const bvec3 b) { - __retVal = b; + __asm ivec4_to_vec4 __retVal.xyz, b; } vec3 __constructor(const vec4 v) { - __retVal.xyz = v.xyz; + __asm vec4_move __retVal.xyz, v; } @@ -239,22 +239,28 @@ vec4 __constructor(const float x, const float y, const float z, const float w) vec4 __constructor(const float f) { - __retVal = f.xxxx; + // Note: this could be "__retVal = f" but that's an illegal assignment + __asm vec4_move __retVal, f; } vec4 __constructor(const int i) { - __retVal = i.xxxx; + __asm ivec4_to_vec4 __retVal, i; } vec4 __constructor(const bool b) { - __retVal = b.xxxx; + __asm ivec4_to_vec4 __retVal, b; } vec4 __constructor(const bvec4 b) { - __retVal = b; + __asm ivec4_to_vec4 __retVal, b; +} + +vec4 __constructor(const ivec4 i) +{ + __asm ivec4_to_vec4 __retVal, i; } vec4 __constructor(const vec3 v3, const float f) @@ -283,17 +289,17 @@ ivec2 __constructor(const int i, const int j) ivec2 __constructor(const int i) { - __retVal.xy = i.xx; + __asm vec4_move __retVal.xy, i; } ivec2 __constructor(const float f) { - __asm float_to_int __retVal.xy, f.xx; + __asm vec4_to_ivec4 __retVal.xy, f; } ivec2 __constructor(const bool b) { - __asm float_to_int __retVal.xy, b.xx; + __asm vec4_to_ivec4 __retVal.xy, b; } @@ -308,17 +314,17 @@ ivec3 __constructor(const int i, const int j, const int k) ivec3 __constructor(const int i) { - __retVal.xyz = i.xxx; + __asm vec4_move __retVal.xyz, i; } ivec3 __constructor(const float f) { - __retVal.xyz = f.xxx; + __asm vec4_to_ivec4 __retVal.xyz, f; } ivec3 __constructor(const bool b) { - __retVal.xyz = b.xxx; + __asm vec4_move __retVal.xyz, b; } @@ -334,17 +340,17 @@ ivec4 __constructor(const int x, const int y, const int z, const int w) ivec4 __constructor(const int i) { - __retVal = i.xxxx; + __asm vec4_move __retVal, i; } ivec4 __constructor(const float f) { - __asm float_to_int __retVal, f.xxxx; + __asm vec4_to_ivec4 __retVal, f; } ivec4 __constructor(const bool b) { - __retVal = b.xxxx; + __asm vec4_to_ivec4 __retVal, b; } @@ -356,21 +362,26 @@ bvec2 __constructor(const bool b1, const bool b2) __retVal.y = b2; } +bvec2 __constructor(const int i1, const int i2) +{ + __asm vec4_sne __retVal.x, i1, 0.0; + __asm vec4_sne __retVal.y, i2, 0.0; +} + + bvec2 __constructor(const bool b) { - __retVal.xy = b.xx; + __asm vec4_move __retVal.xy, b; } bvec2 __constructor(const float f) { - const vec2 zero = vec2(0.0, 0.0); - __asm vec4_sne __retVal.xy, f.xx, zero; + __asm vec4_sne __retVal.xy, f, 0.0; } bvec2 __constructor(const int i) { - const ivec2 zero = ivec2(0, 0); - __asm vec4_sne __retVal.xy, i.xx, zero; + __asm vec4_sne __retVal.xy, i, 0.0; } bvec2 __constructor(const vec2 v) @@ -380,8 +391,7 @@ bvec2 __constructor(const vec2 v) bvec2 __constructor(const ivec2 v) { - const ivec2 zero = ivec2(0, 0); - __asm vec4_sne __retVal.xy, v, zero; + __asm vec4_sne __retVal.xy, v, 0.0; } @@ -395,33 +405,36 @@ bvec3 __constructor(const bool b1, const bool b2, const bool b3) __retVal.z = b3; } +bvec3 __constructor(const float f1, const float f2, const float f3) +{ + __asm vec4_sne __retVal.x, f1, 0.0; + __asm vec4_sne __retVal.y, f2, 0.0; + __asm vec4_sne __retVal.z, f3, 0.0; +} + bvec3 __constructor(const bool b) { - __retVal.xyz = b.xxx; + __asm vec4_move __retVal.xyz, b; } bvec3 __constructor(const float f) { - const vec3 zero = vec3(0.0, 0.0, 0.0); - __asm vec4_sne __retVal.xyz, f.xxx, zero; + __asm vec4_sne __retVal.xyz, f, 0.0; } bvec3 __constructor(const int i) { - const ivec3 zero = ivec3(0, 0, 0); - __asm vec4_sne __retVal.xyz, i.xxx, zero; + __asm vec4_sne __retVal.xyz, i, 0.0; } bvec3 __constructor(const vec3 v) { - const vec3 zero = vec3(0.0, 0.0, 0.0); - __asm vec4_sne __retVal.xyz, v, zero; + __asm vec4_sne __retVal.xyz, v, 0.0; } bvec3 __constructor(const ivec3 v) { - const ivec3 zero = ivec3(0, 0, 0); - __asm vec4_sne __retVal.xyz, v, zero; + __asm vec4_sne __retVal.xyz, v, 0.0; } @@ -436,33 +449,38 @@ bvec4 __constructor(const bool b1, const bool b2, const bool b3, const bool b4) __retVal.w = b4; } +bvec4 __constructor(const float f1, const float f2, const float f3, const float f4) +{ + const float zero = 0.0; + __asm vec4_sne __retVal.x, f1, zero; + __asm vec4_sne __retVal.y, f2, zero; + __asm vec4_sne __retVal.z, f3, zero; + __asm vec4_sne __retVal.w, f4, zero; +} + bvec4 __constructor(const bool b) { - __retVal.xyzw = b.xxxx; + __asm vec4_move __retVal.xyzw, b; } bvec4 __constructor(const float f) { - const vec4 zero = vec4(0.0, 0.0, 0.0, 0.0); - __asm vec4_sne __retVal, f.xxxx, zero; + __asm vec4_sne __retVal.xyzw, f, 0.0; } bvec4 __constructor(const int i) { - const ivec4 zero = ivec4(0, 0, 0, 0); - __asm vec4_sne __retVal, i.xxxx, zero; + __asm vec4_sne __retVal.xyzw, i, 0.0; } bvec4 __constructor(const vec4 v) { - const vec4 zero = vec4(0.0, 0.0, 0.0, 0.0); - __asm vec4_sne __retVal, v, zero; + __asm vec4_sne __retVal.xyzw, v, 0.0; } bvec4 __constructor(const ivec4 v) { - const ivec4 zero = ivec4(0, 0, 0, 0); - __asm vec4_sne __retVal, v, zero; + __asm vec4_sne __retVal.xyzw, v, 0.0; } @@ -605,30 +623,17 @@ mat4 __constructor(const vec4 c0, const vec4 c1, const vec4 c2, const vec4 c3) int __operator + (const int a, const int b) { -// XXX If we ever have int registers, we'll do something like this: -// XXX For now, mostly treat ints as floats. -// float x, y; -// __asm int_to_float x, a; -// __asm int_to_float y, b; -// __asm vec4_add x.x, x.x, y.x; -// __asm float_to_int __retVal, x; - float x; - __asm vec4_add x, a, b; - __asm float_to_int __retVal, x; + __asm vec4_add __retVal, a, b; } int __operator - (const int a, const int b) { - float x; - __asm vec4_subtract x, a, b; - __asm float_to_int __retVal, x; + __asm vec4_subtract __retVal, a, b; } int __operator * (const int a, const int b) { - float x; - __asm vec4_multiply x, a, b; - __asm float_to_int __retVal, x; + __asm vec4_multiply __retVal, a, b; } int __operator / (const int a, const int b) @@ -636,7 +641,7 @@ int __operator / (const int a, const int b) float bInv, x; __asm float_rcp bInv, b; __asm vec4_multiply x, a, bInv; - __asm float_to_int __retVal, x; + __asm vec4_to_ivec4 __retVal, x; } @@ -644,23 +649,17 @@ int __operator / (const int a, const int b) ivec2 __operator + (const ivec2 a, const ivec2 b) { - vec2 x; - __asm vec4_add x, a, b; - __asm float_to_int __retVal, x; + __asm vec4_add __retVal, a, b; } ivec2 __operator - (const ivec2 a, const ivec2 b) { - vec2 x; - __asm vec4_subtract x, a, b; - __asm float_to_int __retVal, x; + __asm vec4_subtract __retVal, a, b; } ivec2 __operator * (const ivec2 a, const ivec2 b) { - vec2 x; - __asm vec4_multiply x, a, b; - __asm float_to_int __retVal, x; + __asm vec4_multiply __retVal, a, b; } ivec2 __operator / (const ivec2 a, const ivec2 b) @@ -669,7 +668,7 @@ ivec2 __operator / (const ivec2 a, const ivec2 b) __asm float_rcp bInv.x, b.x; __asm float_rcp bInv.y, b.y; __asm vec4_multiply x, a, bInv; - __asm float_to_int __retVal, x; + __asm vec4_to_ivec4 __retVal, x; } @@ -677,23 +676,17 @@ ivec2 __operator / (const ivec2 a, const ivec2 b) ivec3 __operator + (const ivec3 a, const ivec3 b) { - vec3 x; - __asm vec4_add x, a, b; - __asm float_to_int __retVal, x; + __asm vec4_add __retVal, a, b; } ivec3 __operator - (const ivec3 a, const ivec3 b) { - vec3 x; - __asm vec4_subtract x, a, b; - __asm float_to_int __retVal, x; + __asm vec4_subtract __retVal, a, b; } ivec3 __operator * (const ivec3 a, const ivec3 b) { - vec3 x; - __asm vec4_multiply x, a, b; - __asm float_to_int __retVal, x; + __asm vec4_multiply __retVal, a, b; } ivec3 __operator / (const ivec3 a, const ivec3 b) @@ -703,7 +696,7 @@ ivec3 __operator / (const ivec3 a, const ivec3 b) __asm float_rcp bInv.y, b.y; __asm float_rcp bInv.z, b.z; __asm vec4_multiply x, a, bInv; - __asm float_to_int __retVal, x; + __asm vec4_to_ivec4 __retVal, x; } @@ -711,23 +704,17 @@ ivec3 __operator / (const ivec3 a, const ivec3 b) ivec4 __operator + (const ivec4 a, const ivec4 b) { - vec3 x; - __asm vec4_add x, a, b; - __asm float_to_int __retVal, x; + __asm vec4_add __retVal, a, b; } ivec4 __operator - (const ivec4 a, const ivec4 b) { - vec4 x; - __asm vec4_subtract x, a, b; - __asm float_to_int __retVal, x; + __asm vec4_subtract __retVal, a, b; } ivec4 __operator * (const ivec4 a, const ivec4 b) { - vec4 x; - __asm vec4_multiply x, a, b; - __asm float_to_int __retVal, x; + __asm vec4_multiply __retVal, a, b; } ivec4 __operator / (const ivec4 a, const ivec4 b) @@ -738,7 +725,7 @@ ivec4 __operator / (const ivec4 a, const ivec4 b) __asm float_rcp bInv.z, b.z; __asm float_rcp bInv.w, b.w; __asm vec4_multiply x, a, bInv; - __asm float_to_int __retVal, x; + __asm vec4_to_ivec4 __retVal, x; } @@ -746,24 +733,24 @@ ivec4 __operator / (const ivec4 a, const ivec4 b) float __operator + (const float a, const float b) { - __asm vec4_add __retVal.x, a, b; + __asm vec4_add __retVal, a, b; } float __operator - (const float a, const float b) { - __asm vec4_subtract __retVal.x, a, b; + __asm vec4_subtract __retVal, a, b; } float __operator * (const float a, const float b) { - __asm vec4_multiply __retVal.x, a, b; + __asm vec4_multiply __retVal, a, b; } float __operator / (const float a, const float b) { float bInv; - __asm float_rcp bInv.x, b.x; - __asm vec4_multiply __retVal.x, a, bInv; + __asm float_rcp bInv.x, b; + __asm vec4_multiply __retVal, a, bInv; } @@ -854,32 +841,32 @@ vec4 __operator / (const vec4 v, const vec4 u) vec2 __operator + (const float a, const vec2 u) { - __asm vec4_add __retVal.xy, a.xx, u.xy; + __asm vec4_add __retVal.xy, a, u.xy; } vec2 __operator + (const vec2 v, const float b) { - __asm vec4_add __retVal.xy, v.xy, b.xx; + __asm vec4_add __retVal.xy, v.xy, b; } vec2 __operator - (const float a, const vec2 u) { - __asm vec4_subtract __retVal.xy, a.xx, u.xy; + __asm vec4_subtract __retVal.xy, a, u.xy; } vec2 __operator - (const vec2 v, const float b) { - __asm vec4_subtract __retVal.xy, v.xy, b.xx; + __asm vec4_subtract __retVal.xy, v.xy, b; } vec2 __operator * (const float a, const vec2 u) { - __asm vec4_multiply __retVal.xy, a.xx, u.xy; + __asm vec4_multiply __retVal.xy, a, u.xy; } vec2 __operator * (const vec2 v, const float b) { - __asm vec4_multiply __retVal.xy, v.xy, b.xx; + __asm vec4_multiply __retVal.xy, v.xy, b; } vec2 __operator / (const float a, const vec2 u) @@ -887,14 +874,14 @@ vec2 __operator / (const float a, const vec2 u) vec2 invU; __asm float_rcp invU.x, u.x; __asm float_rcp invU.y, u.y; - __asm vec4_multiply __retVal.xy, a.xx, invU.xy; + __asm vec4_multiply __retVal.xy, a, invU.xy; } vec2 __operator / (const vec2 v, const float b) { float invB; __asm float_rcp invB, b; - __asm vec4_multiply __retVal.xy, v.xy, invB.xx; + __asm vec4_multiply __retVal.xy, v.xy, invB; } @@ -902,32 +889,32 @@ vec2 __operator / (const vec2 v, const float b) vec3 __operator + (const float a, const vec3 u) { - __asm vec4_add __retVal.xyz, a.xxx, u.xyz; + __asm vec4_add __retVal.xyz, a, u.xyz; } vec3 __operator + (const vec3 v, const float b) { - __asm vec4_add __retVal.xyz, v.xyz, b.xxx; + __asm vec4_add __retVal.xyz, v.xyz, b; } vec3 __operator - (const float a, const vec3 u) { - __asm vec4_subtract __retVal.xyz, a.xxx, u.xyz; + __asm vec4_subtract __retVal.xyz, a, u.xyz; } vec3 __operator - (const vec3 v, const float b) { - __asm vec4_subtract __retVal.xyz, v.xyz, b.xxx; + __asm vec4_subtract __retVal.xyz, v.xyz, b; } vec3 __operator * (const float a, const vec3 u) { - __asm vec4_multiply __retVal.xyz, a.xxx, u.xyz; + __asm vec4_multiply __retVal.xyz, a, u.xyz; } vec3 __operator * (const vec3 v, const float b) { - __asm vec4_multiply __retVal.xyz, v.xyz, b.xxx; + __asm vec4_multiply __retVal.xyz, v.xyz, b; } vec3 __operator / (const float a, const vec3 u) @@ -936,14 +923,14 @@ vec3 __operator / (const float a, const vec3 u) __asm float_rcp invU.x, u.x; __asm float_rcp invU.y, u.y; __asm float_rcp invU.z, u.z; - __asm vec4_multiply __retVal.xyz, a.xxx, invU.xyz; + __asm vec4_multiply __retVal.xyz, a, invU.xyz; } vec3 __operator / (const vec3 v, const float b) { float invB; __asm float_rcp invB, b; - __asm vec4_multiply __retVal.xyz, v.xyz, invB.xxx; + __asm vec4_multiply __retVal.xyz, v.xyz, invB; } @@ -951,32 +938,32 @@ vec3 __operator / (const vec3 v, const float b) vec4 __operator + (const float a, const vec4 u) { - __asm vec4_add __retVal, a.xxxx, u; + __asm vec4_add __retVal, a, u; } vec4 __operator + (const vec4 v, const float b) { - __asm vec4_add __retVal, v, b.xxxx; + __asm vec4_add __retVal, v, b; } vec4 __operator - (const float a, const vec4 u) { - __asm vec4_subtract __retVal, a.xxxx, u; + __asm vec4_subtract __retVal, a, u; } vec4 __operator - (const vec4 v, const float b) { - __asm vec4_subtract __retVal, v, b.xxxx; + __asm vec4_subtract __retVal, v, b; } vec4 __operator * (const float a, const vec4 u) { - __asm vec4_multiply __retVal, a.xxxx, u; + __asm vec4_multiply __retVal, a, u; } vec4 __operator * (const vec4 v, const float b) { - __asm vec4_multiply __retVal, v, b.xxxx; + __asm vec4_multiply __retVal, v, b; } vec4 __operator / (const float a, const vec4 u) @@ -986,14 +973,14 @@ vec4 __operator / (const float a, const vec4 u) __asm float_rcp invU.y, u.y; __asm float_rcp invU.z, u.z; __asm float_rcp invU.w, u.w; - __asm vec4_multiply __retVal, a.xxxx, invU; + __asm vec4_multiply __retVal, a, invU; } vec4 __operator / (const vec4 v, const float b) { float invB; __asm float_rcp invB, b; - __asm vec4_multiply __retVal, v, invB.xxxx; + __asm vec4_multiply __retVal, v, invB; } @@ -1240,7 +1227,7 @@ void __operator /= (inout int a, const int b) float invB; __asm float_rcp invB, b; __asm vec4_multiply a, a, invB; - __asm float_to_int a, a; + __asm vec4_to_ivec4 a, a; } @@ -1267,7 +1254,7 @@ void __operator /= (inout ivec2 v, const ivec2 u) __asm float_rcp inv.x, u.x; __asm float_rcp inv.y, u.y; __asm vec4_multiply z, v, inv; - __asm float_to_int v, z; + __asm vec4_to_ivec4 v, z; } @@ -1294,7 +1281,7 @@ void __operator /= (inout ivec3 v, const ivec3 u) __asm float_rcp inv.x, u.x; __asm float_rcp inv.y, u.y; __asm vec4_multiply z, v, inv; - __asm float_to_int v, z; + __asm vec4_to_ivec4 v, z; } @@ -1321,7 +1308,7 @@ void __operator /= (inout ivec4 v, const ivec4 u) __asm float_rcp inv.x, u.x; __asm float_rcp inv.y, u.y; __asm vec4_multiply z, v, inv; - __asm float_to_int v, z; + __asm vec4_to_ivec4 v, z; } @@ -1436,17 +1423,17 @@ void __operator /= (inout vec4 v, const vec4 u) void __operator += (inout ivec2 v, const int a) { - __asm vec4_add v.xy, v.xy, a.xx; + __asm vec4_add v.xy, v.xy, a; } void __operator -= (inout ivec2 v, const int a) { - __asm vec4_subtract v.xy, v.xy, a.xx; + __asm vec4_subtract v.xy, v.xy, a; } void __operator *= (inout ivec2 v, const int a) { - __asm vec4_multiply v.xy, v.xy, a.xx; + __asm vec4_multiply v.xy, v.xy, a; v.x *= a; v.y *= a; } @@ -1463,17 +1450,17 @@ void __operator /= (inout ivec2 v, const int a) void __operator += (inout ivec3 v, const int a) { - __asm vec4_add v.xyz, v.xyz, a.xxx; + __asm vec4_add v.xyz, v.xyz, a; } void __operator -= (inout ivec3 v, const int a) { - __asm vec4_subtract v.xyz, v.xyz, a.xxx; + __asm vec4_subtract v.xyz, v.xyz, a; } void __operator *= (inout ivec3 v, const int a) { - __asm vec4_multiply v.xyz, v.xyz, a.xxx; + __asm vec4_multiply v.xyz, v.xyz, a; } void __operator /= (inout ivec3 v, const int a) @@ -1489,17 +1476,17 @@ void __operator /= (inout ivec3 v, const int a) void __operator += (inout ivec4 v, const int a) { - __asm vec4_add v, v, a.xxxx; + __asm vec4_add v, v, a; } void __operator -= (inout ivec4 v, const int a) { - __asm vec4_subtract v, v, a.xxxx; + __asm vec4_subtract v, v, a; } void __operator *= (inout ivec4 v, const int a) { - __asm vec4_multiply v, v, a.xxxx; + __asm vec4_multiply v, v, a; } void __operator /= (inout ivec4 v, const int a) @@ -1516,24 +1503,24 @@ void __operator /= (inout ivec4 v, const int a) void __operator += (inout vec2 v, const float a) { - __asm vec4_add v.xy, v, a.xx; + __asm vec4_add v.xy, v, a; } void __operator -= (inout vec2 v, const float a) { - __asm vec4_subtract v.xy, v, a.xx; + __asm vec4_subtract v.xy, v, a; } void __operator *= (inout vec2 v, const float a) { - __asm vec4_multiply v.xy, v, a.xx; + __asm vec4_multiply v.xy, v, a; } void __operator /= (inout vec2 v, const float a) { float invA; __asm float_rcp invA, a; - __asm vec4_multiply v.xy, v.xy, invA.xx; + __asm vec4_multiply v.xy, v.xy, invA; } @@ -1541,24 +1528,24 @@ void __operator /= (inout vec2 v, const float a) void __operator += (inout vec3 v, const float a) { - __asm vec4_add v.xyz, v, a.xxx; + __asm vec4_add v.xyz, v, a; } void __operator -= (inout vec3 v, const float a) { - __asm vec4_subtract v.xyz, v, a.xxx; + __asm vec4_subtract v.xyz, v, a; } void __operator *= (inout vec3 v, const float a) { - __asm vec4_multiply v.xyz, v, a.xxx; + __asm vec4_multiply v.xyz, v, a; } void __operator /= (inout vec3 v, const float a) { float invA; __asm float_rcp invA, a; - __asm vec4_multiply v.xyz, v.xyz, invA.xxx; + __asm vec4_multiply v.xyz, v.xyz, invA; } @@ -1566,24 +1553,24 @@ void __operator /= (inout vec3 v, const float a) void __operator += (inout vec4 v, const float a) { - __asm vec4_add v, v, a.xxxx; + __asm vec4_add v, v, a; } void __operator -= (inout vec4 v, const float a) { - __asm vec4_subtract v, v, a.xxxx; + __asm vec4_subtract v, v, a; } void __operator *= (inout vec4 v, const float a) { - __asm vec4_multiply v, v, a.xxxx; + __asm vec4_multiply v, v, a; } void __operator /= (inout vec4 v, const float a) { float invA; __asm float_rcp invA, a; - __asm vec4_multiply v, v, invA.xxxx; + __asm vec4_multiply v, v, invA; } diff --git a/src/mesa/shader/slang/library/slang_core_gc.h b/src/mesa/shader/slang/library/slang_core_gc.h index 44170946ce..e8b8041914 100644 --- a/src/mesa/shader/slang/library/slang_core_gc.h +++ b/src/mesa/shader/slang/library/slang_core_gc.h @@ -2,822 +2,819 @@ /* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED FROM THE FOLLOWING FILE: */ /* slang_core.gc */ -3,1,0,5,1,1,1,0,9,102,0,0,0,1,4,102,108,111,97,116,95,116,111,95,105,110,116,0,18,95,95,114,101, -116,86,97,108,0,0,18,102,0,0,0,0,1,0,5,1,1,1,0,1,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18, -98,0,20,0,0,1,0,5,1,1,1,0,5,105,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,105,0,20,0,0,1,0,1,1, -1,1,0,5,105,0,0,0,1,3,2,1,9,1,122,101,114,111,0,2,17,48,0,48,0,0,0,0,4,118,101,99,52,95,115,110, -101,0,18,95,95,114,101,116,86,97,108,0,0,18,105,0,0,18,122,101,114,111,0,0,0,0,1,0,1,1,1,1,0,9,102, -0,0,0,1,3,2,1,9,1,122,101,114,111,0,2,17,48,0,48,0,0,0,0,4,118,101,99,52,95,115,110,101,0,18,95,95, -114,101,116,86,97,108,0,0,18,102,0,0,18,122,101,114,111,0,0,0,0,1,0,1,1,1,1,0,1,98,0,0,0,1,9,18,95, -95,114,101,116,86,97,108,0,18,98,0,20,0,0,1,0,9,1,1,1,0,5,105,0,0,0,1,4,105,110,116,95,116,111,95, -102,108,111,97,116,0,18,95,95,114,101,116,86,97,108,0,0,18,105,0,0,0,0,1,0,9,1,1,1,0,1,98,0,0,0,1, -9,18,95,95,114,101,116,86,97,108,0,18,98,0,20,0,0,1,0,9,1,1,1,0,9,102,0,0,0,1,9,18,95,95,114,101, -116,86,97,108,0,18,102,0,20,0,0,1,0,10,1,1,1,0,9,120,0,0,1,1,0,9,121,0,0,0,1,9,18,95,95,114,101, -116,86,97,108,0,59,120,0,18,120,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,18,121,0,20,0,0, -1,0,10,1,1,1,0,9,102,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,121,0,18,102,0,59,120,120,0, -20,0,0,1,0,10,1,1,1,0,5,105,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,121,0,18,105,0,59, -120,120,0,20,0,0,1,0,10,1,1,1,0,1,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,121,0,18,98, -0,59,120,120,0,20,0,0,1,0,10,1,1,1,0,2,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,98,0,20,0, -0,1,0,10,1,1,1,0,11,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,121,0,18,118,0,59,120, -121,0,20,0,0,1,0,10,1,1,1,0,12,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,115,116,0,18,118, -0,59,120,121,0,20,0,0,1,0,11,1,1,1,0,9,120,0,0,1,1,0,9,121,0,0,1,1,0,9,122,0,0,0,1,9,18,95,95,114, +4,1,0,0,5,1,1,1,0,9,102,0,0,0,1,4,118,101,99,52,95,116,111,95,105,118,101,99,52,0,18,95,95,114,101, +116,86,97,108,0,0,18,102,0,0,0,0,1,0,0,5,1,1,1,0,1,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, +18,98,0,20,0,0,1,0,0,5,1,1,1,0,5,105,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,105,0,20,0,0,1, +0,0,1,1,1,1,0,5,105,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,0,18, +105,0,0,17,48,0,48,0,0,0,0,0,1,0,0,1,1,1,1,0,9,102,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95, +95,114,101,116,86,97,108,0,0,18,102,0,0,17,48,0,48,0,0,0,0,0,1,0,0,1,1,1,1,0,1,98,0,0,0,1,9,18,95, +95,114,101,116,86,97,108,0,18,98,0,20,0,0,1,0,0,9,1,1,1,0,5,105,0,0,0,1,4,105,118,101,99,52,95,116, +111,95,118,101,99,52,0,18,95,95,114,101,116,86,97,108,0,0,18,105,0,0,0,0,1,0,0,9,1,1,1,0,1,98,0,0, +0,1,4,105,118,101,99,52,95,116,111,95,118,101,99,52,0,18,95,95,114,101,116,86,97,108,0,0,18,98,0,0, +0,0,1,0,0,9,1,1,1,0,9,102,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,102,0,20,0,0,1,0,0,10,1,1, +1,0,9,120,0,0,1,1,0,9,121,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18,120,0,20,0,9,18, +95,95,114,101,116,86,97,108,0,59,121,0,18,121,0,20,0,0,1,0,0,10,1,1,1,0,9,102,0,0,0,1,4,118,101,99, +52,95,109,111,118,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,102,0,0,0,0,1,0,0,10,1, +1,1,0,5,105,0,0,0,1,4,105,118,101,99,52,95,116,111,95,118,101,99,52,0,18,95,95,114,101,116,86,97, +108,0,59,120,121,0,0,18,105,0,0,0,0,1,0,0,10,1,1,1,0,1,98,0,0,0,1,4,105,118,101,99,52,95,116,111, +95,118,101,99,52,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,98,0,0,0,0,1,0,0,10,1,1,1,0, +2,98,0,0,0,1,4,105,118,101,99,52,95,116,111,95,118,101,99,52,0,18,95,95,114,101,116,86,97,108,0,59, +120,121,0,0,18,98,0,0,0,0,1,0,0,10,1,1,1,0,11,118,0,0,0,1,4,118,101,99,52,95,109,111,118,101,0,18, +95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,118,0,59,120,121,0,0,0,0,1,0,0,10,1,1,1,0,12,118,0, +0,0,1,4,118,101,99,52,95,109,111,118,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,118, +0,59,120,121,0,0,0,0,1,0,0,11,1,1,1,0,9,120,0,0,1,1,0,9,121,0,0,1,1,0,9,122,0,0,0,1,9,18,95,95,114, 101,116,86,97,108,0,59,120,0,18,120,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,18,121,0,20, -0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,18,122,0,20,0,0,1,0,11,1,1,1,0,9,102,0,0,0,1,9,18,95, -95,114,101,116,86,97,108,0,59,120,121,122,0,18,102,0,59,120,120,120,0,20,0,0,1,0,11,1,1,1,0,5,105, -0,0,0,1,4,105,110,116,95,116,111,95,102,108,111,97,116,0,18,95,95,114,101,116,86,97,108,0,59,120, -121,122,0,0,18,105,0,59,120,120,120,0,0,0,0,1,0,11,1,1,1,0,1,98,0,0,0,1,9,18,95,95,114,101,116,86, -97,108,0,59,120,121,122,0,18,98,0,59,120,120,120,0,20,0,0,1,0,11,1,1,1,0,3,98,0,0,0,1,9,18,95,95, -114,101,116,86,97,108,0,18,98,0,20,0,0,1,0,11,1,1,1,0,12,118,0,0,0,1,9,18,95,95,114,101,116,86,97, -108,0,59,120,121,122,0,18,118,0,59,120,121,122,0,20,0,0,1,0,12,1,1,1,0,9,120,0,0,1,1,0,9,121,0,0,1, -1,0,9,122,0,0,1,1,0,9,119,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18,120,0,20,0,9,18, -95,95,114,101,116,86,97,108,0,59,121,0,18,121,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0, -18,122,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,18,119,0,20,0,0,1,0,12,1,1,1,0,9,102,0,0, -0,1,9,18,95,95,114,101,116,86,97,108,0,18,102,0,59,120,120,120,120,0,20,0,0,1,0,12,1,1,1,0,5,105,0, -0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,105,0,59,120,120,120,120,0,20,0,0,1,0,12,1,1,1,0,1,98, -0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,98,0,59,120,120,120,120,0,20,0,0,1,0,12,1,1,1,0,4,98, -0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,98,0,20,0,0,1,0,12,1,1,1,0,11,118,51,0,0,1,1,0,9,102, -0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,18,118,51,0,20,0,9,18,95,95,114,101, -116,86,97,108,0,59,119,0,18,102,0,20,0,0,1,0,12,1,1,1,0,10,118,50,0,0,1,1,0,9,102,49,0,0,1,1,0,9, -102,50,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,121,0,18,118,50,0,20,0,9,18,95,95,114,101, -116,86,97,108,0,59,122,0,18,102,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,18,102,50,0, -20,0,0,1,0,6,1,1,1,0,5,105,0,0,1,1,0,5,106,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18, -105,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,18,106,0,20,0,0,1,0,6,1,1,1,0,5,105,0,0,0,1, -9,18,95,95,114,101,116,86,97,108,0,59,120,121,0,18,105,0,59,120,120,0,20,0,0,1,0,6,1,1,1,0,9,102,0, -0,0,1,4,102,108,111,97,116,95,116,111,95,105,110,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121, -0,0,18,102,0,59,120,120,0,0,0,0,1,0,6,1,1,1,0,1,98,0,0,0,1,4,102,108,111,97,116,95,116,111,95,105, -110,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,98,0,59,120,120,0,0,0,0,1,0,7,1,1,1,0, -5,105,0,0,1,1,0,5,106,0,0,1,1,0,5,107,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18,105,0, -20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,18,106,0,20,0,9,18,95,95,114,101,116,86,97,108,0, -59,122,0,18,107,0,20,0,0,1,0,7,1,1,1,0,5,105,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,121, -122,0,18,105,0,59,120,120,120,0,20,0,0,1,0,7,1,1,1,0,9,102,0,0,0,1,9,18,95,95,114,101,116,86,97, -108,0,59,120,121,122,0,18,102,0,59,120,120,120,0,20,0,0,1,0,7,1,1,1,0,1,98,0,0,0,1,9,18,95,95,114, -101,116,86,97,108,0,59,120,121,122,0,18,98,0,59,120,120,120,0,20,0,0,1,0,8,1,1,1,0,5,120,0,0,1,1,0, +0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,18,122,0,20,0,0,1,0,0,11,1,1,1,0,9,102,0,0,0,1,4,118, +101,99,52,95,109,111,118,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,102,0,0,0,0, +1,0,0,11,1,1,1,0,5,105,0,0,0,1,4,105,118,101,99,52,95,116,111,95,118,101,99,52,0,18,95,95,114,101, +116,86,97,108,0,59,120,121,122,0,0,18,105,0,0,0,0,1,0,0,11,1,1,1,0,1,98,0,0,0,1,4,105,118,101,99, +52,95,116,111,95,118,101,99,52,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,98,0,0,0,0, +1,0,0,11,1,1,1,0,3,98,0,0,0,1,4,105,118,101,99,52,95,116,111,95,118,101,99,52,0,18,95,95,114,101, +116,86,97,108,0,59,120,121,122,0,0,18,98,0,0,0,0,1,0,0,11,1,1,1,0,12,118,0,0,0,1,4,118,101,99,52, +95,109,111,118,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0,0,0,0,1,0,0,12,1, +1,1,0,9,120,0,0,1,1,0,9,121,0,0,1,1,0,9,122,0,0,1,1,0,9,119,0,0,0,1,9,18,95,95,114,101,116,86,97, +108,0,59,120,0,18,120,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,18,121,0,20,0,9,18,95,95, +114,101,116,86,97,108,0,59,122,0,18,122,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,18,119, +0,20,0,0,1,0,0,12,1,1,1,0,9,102,0,0,0,1,4,118,101,99,52,95,109,111,118,101,0,18,95,95,114,101,116, +86,97,108,0,0,18,102,0,0,0,0,1,0,0,12,1,1,1,0,5,105,0,0,0,1,4,105,118,101,99,52,95,116,111,95,118, +101,99,52,0,18,95,95,114,101,116,86,97,108,0,0,18,105,0,0,0,0,1,0,0,12,1,1,1,0,1,98,0,0,0,1,4,105, +118,101,99,52,95,116,111,95,118,101,99,52,0,18,95,95,114,101,116,86,97,108,0,0,18,98,0,0,0,0,1,0,0, +12,1,1,1,0,4,98,0,0,0,1,4,105,118,101,99,52,95,116,111,95,118,101,99,52,0,18,95,95,114,101,116,86, +97,108,0,0,18,98,0,0,0,0,1,0,0,12,1,1,1,0,8,105,0,0,0,1,4,105,118,101,99,52,95,116,111,95,118,101, +99,52,0,18,95,95,114,101,116,86,97,108,0,0,18,105,0,0,0,0,1,0,0,12,1,1,1,0,11,118,51,0,0,1,1,0,9, +102,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,18,118,51,0,20,0,9,18,95,95,114, +101,116,86,97,108,0,59,119,0,18,102,0,20,0,0,1,0,0,12,1,1,1,0,10,118,50,0,0,1,1,0,9,102,49,0,0,1,1, +0,9,102,50,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,121,0,18,118,50,0,20,0,9,18,95,95,114, +101,116,86,97,108,0,59,122,0,18,102,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,18,102, +50,0,20,0,0,1,0,0,6,1,1,1,0,5,105,0,0,1,1,0,5,106,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59, +120,0,18,105,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,18,106,0,20,0,0,1,0,0,6,1,1,1,0,5, +105,0,0,0,1,4,118,101,99,52,95,109,111,118,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0, +18,105,0,0,0,0,1,0,0,6,1,1,1,0,9,102,0,0,0,1,4,118,101,99,52,95,116,111,95,105,118,101,99,52,0,18, +95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,102,0,0,0,0,1,0,0,6,1,1,1,0,1,98,0,0,0,1,4,118,101, +99,52,95,116,111,95,105,118,101,99,52,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,98,0,0, +0,0,1,0,0,7,1,1,1,0,5,105,0,0,1,1,0,5,106,0,0,1,1,0,5,107,0,0,0,1,9,18,95,95,114,101,116,86,97,108, +0,59,120,0,18,105,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,18,106,0,20,0,9,18,95,95,114, +101,116,86,97,108,0,59,122,0,18,107,0,20,0,0,1,0,0,7,1,1,1,0,5,105,0,0,0,1,4,118,101,99,52,95,109, +111,118,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,105,0,0,0,0,1,0,0,7,1,1,1,0,9, +102,0,0,0,1,4,118,101,99,52,95,116,111,95,105,118,101,99,52,0,18,95,95,114,101,116,86,97,108,0,59, +120,121,122,0,0,18,102,0,0,0,0,1,0,0,7,1,1,1,0,1,98,0,0,0,1,4,118,101,99,52,95,109,111,118,101,0, +18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,98,0,0,0,0,1,0,0,8,1,1,1,0,5,120,0,0,1,1,0, 5,121,0,0,1,1,0,5,122,0,0,1,1,0,5,119,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18,120,0, 20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,18,121,0,20,0,9,18,95,95,114,101,116,86,97,108,0, -59,122,0,18,122,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,18,119,0,20,0,0,1,0,8,1,1,1,0,5, -105,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,105,0,59,120,120,120,120,0,20,0,0,1,0,8,1,1,1,0, -9,102,0,0,0,1,4,102,108,111,97,116,95,116,111,95,105,110,116,0,18,95,95,114,101,116,86,97,108,0,0, -18,102,0,59,120,120,120,120,0,0,0,0,1,0,8,1,1,1,0,1,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, -18,98,0,59,120,120,120,120,0,20,0,0,1,0,2,1,1,1,0,1,98,49,0,0,1,1,0,1,98,50,0,0,0,1,9,18,95,95,114, -101,116,86,97,108,0,59,120,0,18,98,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,18,98,50, -0,20,0,0,1,0,2,1,1,1,0,1,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,121,0,18,98,0,59,120, -120,0,20,0,0,1,0,2,1,1,1,0,9,102,0,0,0,1,3,2,1,10,1,122,101,114,111,0,2,58,118,101,99,50,0,17,48,0, -48,0,0,0,17,48,0,48,0,0,0,0,0,0,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0, -59,120,121,0,0,18,102,0,59,120,120,0,0,18,122,101,114,111,0,0,0,0,1,0,2,1,1,1,0,5,105,0,0,0,1,3,2, -1,6,1,122,101,114,111,0,2,58,105,118,101,99,50,0,16,8,48,0,0,16,8,48,0,0,0,0,0,4,118,101,99,52,95, -115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,105,0,59,120,120,0,0,18,122,101, -114,111,0,0,0,0,1,0,2,1,1,1,0,10,118,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116, -86,97,108,0,59,120,121,0,0,18,118,0,0,17,48,0,48,0,0,0,0,0,1,0,2,1,1,1,0,6,118,0,0,0,1,3,2,1,6,1, -122,101,114,111,0,2,58,105,118,101,99,50,0,16,8,48,0,0,16,8,48,0,0,0,0,0,4,118,101,99,52,95,115, -110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,118,0,0,18,122,101,114,111,0,0,0,0,1, -0,3,1,1,1,0,1,98,49,0,0,1,1,0,1,98,50,0,0,1,1,0,1,98,51,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, -59,120,0,18,98,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,18,98,50,0,20,0,9,18,95,95, -114,101,116,86,97,108,0,59,122,0,18,98,51,0,20,0,0,1,0,3,1,1,1,0,1,98,0,0,0,1,9,18,95,95,114,101, -116,86,97,108,0,59,120,121,122,0,18,98,0,59,120,120,120,0,20,0,0,1,0,3,1,1,1,0,9,102,0,0,0,1,3,2,1, -11,1,122,101,114,111,0,2,58,118,101,99,51,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,0,0, -0,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,102,0,59, -120,120,120,0,0,18,122,101,114,111,0,0,0,0,1,0,3,1,1,1,0,5,105,0,0,0,1,3,2,1,7,1,122,101,114,111,0, -2,58,105,118,101,99,51,0,16,8,48,0,0,16,8,48,0,0,16,8,48,0,0,0,0,0,4,118,101,99,52,95,115,110,101, -0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,105,0,59,120,120,120,0,0,18,122,101,114, -111,0,0,0,0,1,0,3,1,1,1,0,11,118,0,0,0,1,3,2,1,11,1,122,101,114,111,0,2,58,118,101,99,51,0,17,48,0, -48,0,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,0,0,0,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101, -116,86,97,108,0,59,120,121,122,0,0,18,118,0,0,18,122,101,114,111,0,0,0,0,1,0,3,1,1,1,0,7,118,0,0,0, -1,3,2,1,7,1,122,101,114,111,0,2,58,105,118,101,99,51,0,16,8,48,0,0,16,8,48,0,0,16,8,48,0,0,0,0,0,4, -118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0,0,18, -122,101,114,111,0,0,0,0,1,0,4,1,1,1,0,1,98,49,0,0,1,1,0,1,98,50,0,0,1,1,0,1,98,51,0,0,1,1,0,1,98, -52,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18,98,49,0,20,0,9,18,95,95,114,101,116,86, -97,108,0,59,121,0,18,98,50,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,18,98,51,0,20,0,9,18, -95,95,114,101,116,86,97,108,0,59,119,0,18,98,52,0,20,0,0,1,0,4,1,1,1,0,1,98,0,0,0,1,9,18,95,95,114, -101,116,86,97,108,0,59,120,121,122,119,0,18,98,0,59,120,120,120,120,0,20,0,0,1,0,4,1,1,1,0,9,102,0, -0,0,1,3,2,1,12,1,122,101,114,111,0,2,58,118,101,99,52,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,17,48,0, -48,0,0,0,17,48,0,48,0,0,0,0,0,0,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0, -0,18,102,0,59,120,120,120,120,0,0,18,122,101,114,111,0,0,0,0,1,0,4,1,1,1,0,5,105,0,0,0,1,3,2,1,8,1, -122,101,114,111,0,2,58,105,118,101,99,52,0,16,8,48,0,0,16,8,48,0,0,16,8,48,0,0,16,8,48,0,0,0,0,0,4, -118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,0,18,105,0,59,120,120,120,120,0,0, -18,122,101,114,111,0,0,0,0,1,0,4,1,1,1,0,12,118,0,0,0,1,3,2,1,12,1,122,101,114,111,0,2,58,118,101, -99,52,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,0,0,0,4,118,101,99,52, -95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,0,18,118,0,0,18,122,101,114,111,0,0,0,0,1,0,4,1, -1,1,0,8,118,0,0,0,1,3,2,1,8,1,122,101,114,111,0,2,58,105,118,101,99,52,0,16,8,48,0,0,16,8,48,0,0, -16,8,48,0,0,16,8,48,0,0,0,0,0,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,0, -18,118,0,0,18,122,101,114,111,0,0,0,0,1,0,13,1,1,1,0,9,109,48,48,0,0,1,1,0,9,109,49,48,0,0,1,1,0,9, -109,48,49,0,0,1,1,0,9,109,49,49,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,120,0, -18,109,48,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,121,0,18,109,49,48,0,20,0,9, -18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,120,0,18,109,48,49,0,20,0,9,18,95,95,114,101,116, -86,97,108,0,16,10,49,0,57,59,121,0,18,109,49,49,0,20,0,0,1,0,13,1,1,1,0,9,102,0,0,0,1,9,18,95,95, -114,101,116,86,97,108,0,16,8,48,0,57,59,120,0,18,102,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16, -8,48,0,57,59,121,0,17,48,0,48,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,120,0, -17,48,0,48,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,121,0,18,102,0,20,0,0,1,0, -13,1,1,1,0,5,105,0,0,0,1,8,58,109,97,116,50,0,58,102,108,111,97,116,0,18,105,0,0,0,0,0,0,0,1,0,13, -1,1,1,0,1,98,0,0,0,1,8,58,109,97,116,50,0,58,102,108,111,97,116,0,18,98,0,0,0,0,0,0,0,1,0,13,1,1,1, -0,10,99,48,0,0,1,1,0,10,99,49,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,99,48,0, -20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,99,49,0,20,0,0,1,0,14,1,1,1,0,9,109,48,48, -0,0,1,1,0,9,109,49,48,0,0,1,1,0,9,109,50,48,0,0,1,1,0,9,109,48,49,0,0,1,1,0,9,109,49,49,0,0,1,1,0, -9,109,50,49,0,0,1,1,0,9,109,48,50,0,0,1,1,0,9,109,49,50,0,0,1,1,0,9,109,50,50,0,0,0,1,9,18,95,95, -114,101,116,86,97,108,0,16,8,48,0,57,59,120,0,18,109,48,48,0,20,0,9,18,95,95,114,101,116,86,97,108, -0,16,8,48,0,57,59,121,0,18,109,49,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,122, -0,18,109,50,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,120,0,18,109,48,49,0,20, -0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,121,0,18,109,49,49,0,20,0,9,18,95,95,114,101, -116,86,97,108,0,16,10,49,0,57,59,122,0,18,109,50,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16, -10,50,0,57,59,120,0,18,109,48,50,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,59,121,0, -18,109,49,50,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,59,122,0,18,109,50,50,0,20,0, -0,1,0,14,1,1,1,0,9,102,0,0,0,1,3,2,0,10,1,118,0,2,58,118,101,99,50,0,18,102,0,0,17,48,0,48,0,0,0,0, -0,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,118,0,59,120,121,121,0,20,0,9,18,95,95,114, -101,116,86,97,108,0,16,10,49,0,57,18,118,0,59,121,120,121,0,20,0,9,18,95,95,114,101,116,86,97,108, -0,16,10,50,0,57,18,118,0,59,121,121,120,0,20,0,0,1,0,14,1,1,1,0,5,105,0,0,0,1,8,58,109,97,116,51,0, -58,102,108,111,97,116,0,18,105,0,0,0,0,0,0,0,1,0,14,1,1,1,0,1,98,0,0,0,1,8,58,109,97,116,51,0,58, -102,108,111,97,116,0,18,98,0,0,0,0,0,0,0,1,0,14,1,1,1,0,11,99,48,0,0,1,1,0,11,99,49,0,0,1,1,0,11, -99,50,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,99,48,0,20,0,9,18,95,95,114,101, -116,86,97,108,0,16,10,49,0,57,18,99,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18, -99,50,0,20,0,0,1,0,15,1,1,1,0,9,109,48,48,0,0,1,1,0,9,109,49,48,0,0,1,1,0,9,109,50,48,0,0,1,1,0,9, -109,51,48,0,0,1,1,0,9,109,48,49,0,0,1,1,0,9,109,49,49,0,0,1,1,0,9,109,50,49,0,0,1,1,0,9,109,51,49, -0,0,1,1,0,9,109,48,50,0,0,1,1,0,9,109,49,50,0,0,1,1,0,9,109,50,50,0,0,1,1,0,9,109,51,50,0,0,1,1,0, -9,109,48,51,0,0,1,1,0,9,109,49,51,0,0,1,1,0,9,109,50,51,0,0,1,1,0,9,109,51,51,0,0,0,1,9,18,95,95, -114,101,116,86,97,108,0,16,8,48,0,57,59,120,0,18,109,48,48,0,20,0,9,18,95,95,114,101,116,86,97,108, -0,16,8,48,0,57,59,121,0,18,109,49,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,122, -0,18,109,50,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,119,0,18,109,51,48,0,20,0, -9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,120,0,18,109,48,49,0,20,0,9,18,95,95,114,101, -116,86,97,108,0,16,10,49,0,57,59,121,0,18,109,49,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16, -10,49,0,57,59,122,0,18,109,50,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,119,0, -18,109,51,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,59,120,0,18,109,48,50,0,20,0, -9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,59,121,0,18,109,49,50,0,20,0,9,18,95,95,114,101, -116,86,97,108,0,16,10,50,0,57,59,122,0,18,109,50,50,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16, -10,50,0,57,59,119,0,18,109,51,50,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,59,120,0, -18,109,48,51,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,59,121,0,18,109,49,51,0,20,0, -9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,59,122,0,18,109,50,51,0,20,0,9,18,95,95,114,101, -116,86,97,108,0,16,10,51,0,57,59,119,0,18,109,51,51,0,20,0,0,1,0,15,1,1,1,0,9,102,0,0,0,1,3,2,0,10, -1,118,0,2,58,118,101,99,50,0,18,102,0,0,17,48,0,48,0,0,0,0,0,0,9,18,95,95,114,101,116,86,97,108,0, -16,8,48,0,57,18,118,0,59,120,121,121,121,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57, -18,118,0,59,121,120,121,121,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,118,0,59, -121,121,120,121,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,118,0,59,121,121,121, -120,0,20,0,0,1,0,15,1,1,1,0,5,105,0,0,0,1,8,58,109,97,116,52,0,58,102,108,111,97,116,0,18,105,0,0, -0,0,0,0,0,1,0,15,1,1,1,0,1,98,0,0,0,1,8,58,109,97,116,52,0,58,102,108,111,97,116,0,18,98,0,0,0,0,0, -0,0,1,0,15,1,1,1,0,12,99,48,0,0,1,1,0,12,99,49,0,0,1,1,0,12,99,50,0,0,1,1,0,12,99,51,0,0,0,1,9,18, -95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,99,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16, -10,49,0,57,18,99,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,99,50,0,20,0,9,18, -95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,99,51,0,20,0,0,1,0,5,2,26,1,1,0,5,97,0,0,1,1,0,5,98, -0,0,0,1,3,2,0,9,1,120,0,0,0,4,118,101,99,52,95,97,100,100,0,18,120,0,0,18,97,0,0,18,98,0,0,0,4,102, -108,111,97,116,95,116,111,95,105,110,116,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,0,5, -2,27,1,1,0,5,97,0,0,1,1,0,5,98,0,0,0,1,3,2,0,9,1,120,0,0,0,4,118,101,99,52,95,115,117,98,116,114, -97,99,116,0,18,120,0,0,18,97,0,0,18,98,0,0,0,4,102,108,111,97,116,95,116,111,95,105,110,116,0,18, -95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,0,5,2,21,1,1,0,5,97,0,0,1,1,0,5,98,0,0,0,1,3,2,0, -9,1,120,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,120,0,0,18,97,0,0,18,98,0,0, -0,4,102,108,111,97,116,95,116,111,95,105,110,116,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0, -0,1,0,5,2,22,1,1,0,5,97,0,0,1,1,0,5,98,0,0,0,1,3,2,0,9,1,98,73,110,118,0,0,1,1,120,0,0,0,4,102,108, -111,97,116,95,114,99,112,0,18,98,73,110,118,0,0,18,98,0,0,0,4,118,101,99,52,95,109,117,108,116,105, -112,108,121,0,18,120,0,0,18,97,0,0,18,98,73,110,118,0,0,0,4,102,108,111,97,116,95,116,111,95,105, -110,116,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,0,6,2,26,1,1,0,6,97,0,0,1,1,0,6,98,0, -0,0,1,3,2,0,10,1,120,0,0,0,4,118,101,99,52,95,97,100,100,0,18,120,0,0,18,97,0,0,18,98,0,0,0,4,102, -108,111,97,116,95,116,111,95,105,110,116,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,0,6, -2,27,1,1,0,6,97,0,0,1,1,0,6,98,0,0,0,1,3,2,0,10,1,120,0,0,0,4,118,101,99,52,95,115,117,98,116,114, -97,99,116,0,18,120,0,0,18,97,0,0,18,98,0,0,0,4,102,108,111,97,116,95,116,111,95,105,110,116,0,18, -95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,0,6,2,21,1,1,0,6,97,0,0,1,1,0,6,98,0,0,0,1,3,2,0, -10,1,120,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,120,0,0,18,97,0,0,18,98,0,0, -0,4,102,108,111,97,116,95,116,111,95,105,110,116,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0, -0,1,0,6,2,22,1,1,0,6,97,0,0,1,1,0,6,98,0,0,0,1,3,2,0,10,1,98,73,110,118,0,0,1,1,120,0,0,0,4,102, -108,111,97,116,95,114,99,112,0,18,98,73,110,118,0,59,120,0,0,18,98,0,59,120,0,0,0,4,102,108,111,97, -116,95,114,99,112,0,18,98,73,110,118,0,59,121,0,0,18,98,0,59,121,0,0,0,4,118,101,99,52,95,109,117, -108,116,105,112,108,121,0,18,120,0,0,18,97,0,0,18,98,73,110,118,0,0,0,4,102,108,111,97,116,95,116, -111,95,105,110,116,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,0,7,2,26,1,1,0,7,97,0,0,1, -1,0,7,98,0,0,0,1,3,2,0,11,1,120,0,0,0,4,118,101,99,52,95,97,100,100,0,18,120,0,0,18,97,0,0,18,98,0, -0,0,4,102,108,111,97,116,95,116,111,95,105,110,116,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0, -0,0,1,0,7,2,27,1,1,0,7,97,0,0,1,1,0,7,98,0,0,0,1,3,2,0,11,1,120,0,0,0,4,118,101,99,52,95,115,117, -98,116,114,97,99,116,0,18,120,0,0,18,97,0,0,18,98,0,0,0,4,102,108,111,97,116,95,116,111,95,105,110, -116,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,0,7,2,21,1,1,0,7,97,0,0,1,1,0,7,98,0,0,0, -1,3,2,0,11,1,120,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,120,0,0,18,97,0,0, -18,98,0,0,0,4,102,108,111,97,116,95,116,111,95,105,110,116,0,18,95,95,114,101,116,86,97,108,0,0,18, -120,0,0,0,0,1,0,7,2,22,1,1,0,7,97,0,0,1,1,0,7,98,0,0,0,1,3,2,0,11,1,98,73,110,118,0,0,1,1,120,0,0, -0,4,102,108,111,97,116,95,114,99,112,0,18,98,73,110,118,0,59,120,0,0,18,98,0,59,120,0,0,0,4,102, -108,111,97,116,95,114,99,112,0,18,98,73,110,118,0,59,121,0,0,18,98,0,59,121,0,0,0,4,102,108,111,97, -116,95,114,99,112,0,18,98,73,110,118,0,59,122,0,0,18,98,0,59,122,0,0,0,4,118,101,99,52,95,109,117, -108,116,105,112,108,121,0,18,120,0,0,18,97,0,0,18,98,73,110,118,0,0,0,4,102,108,111,97,116,95,116, -111,95,105,110,116,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,0,8,2,26,1,1,0,8,97,0,0,1, -1,0,8,98,0,0,0,1,3,2,0,11,1,120,0,0,0,4,118,101,99,52,95,97,100,100,0,18,120,0,0,18,97,0,0,18,98,0, -0,0,4,102,108,111,97,116,95,116,111,95,105,110,116,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0, -0,0,1,0,8,2,27,1,1,0,8,97,0,0,1,1,0,8,98,0,0,0,1,3,2,0,12,1,120,0,0,0,4,118,101,99,52,95,115,117, -98,116,114,97,99,116,0,18,120,0,0,18,97,0,0,18,98,0,0,0,4,102,108,111,97,116,95,116,111,95,105,110, -116,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,0,8,2,21,1,1,0,8,97,0,0,1,1,0,8,98,0,0,0, -1,3,2,0,12,1,120,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,120,0,0,18,97,0,0, -18,98,0,0,0,4,102,108,111,97,116,95,116,111,95,105,110,116,0,18,95,95,114,101,116,86,97,108,0,0,18, -120,0,0,0,0,1,0,8,2,22,1,1,0,8,97,0,0,1,1,0,8,98,0,0,0,1,3,2,0,12,1,98,73,110,118,0,0,1,1,120,0,0, -0,4,102,108,111,97,116,95,114,99,112,0,18,98,73,110,118,0,59,120,0,0,18,98,0,59,120,0,0,0,4,102, -108,111,97,116,95,114,99,112,0,18,98,73,110,118,0,59,121,0,0,18,98,0,59,121,0,0,0,4,102,108,111,97, -116,95,114,99,112,0,18,98,73,110,118,0,59,122,0,0,18,98,0,59,122,0,0,0,4,102,108,111,97,116,95,114, -99,112,0,18,98,73,110,118,0,59,119,0,0,18,98,0,59,119,0,0,0,4,118,101,99,52,95,109,117,108,116,105, -112,108,121,0,18,120,0,0,18,97,0,0,18,98,73,110,118,0,0,0,4,102,108,111,97,116,95,116,111,95,105, -110,116,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,0,9,2,26,1,1,0,9,97,0,0,1,1,0,9,98,0, -0,0,1,4,118,101,99,52,95,97,100,100,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,97,0,0,18,98, -0,0,0,0,1,0,9,2,27,1,1,0,9,97,0,0,1,1,0,9,98,0,0,0,1,4,118,101,99,52,95,115,117,98,116,114,97,99, -116,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,97,0,0,18,98,0,0,0,0,1,0,9,2,21,1,1,0,9,97,0, -0,1,1,0,9,98,0,0,0,1,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86, -97,108,0,59,120,0,0,18,97,0,0,18,98,0,0,0,0,1,0,9,2,22,1,1,0,9,97,0,0,1,1,0,9,98,0,0,0,1,3,2,0,9,1, -98,73,110,118,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,98,73,110,118,0,59,120,0,0,18,98,0,59, -120,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59, -120,0,0,18,97,0,0,18,98,73,110,118,0,0,0,0,1,0,10,2,26,1,1,0,10,118,0,0,1,1,0,10,117,0,0,0,1,4,118, -101,99,52,95,97,100,100,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,118,0,0,18,117,0,0,0, -0,1,0,10,2,27,1,1,0,10,118,0,0,1,1,0,10,117,0,0,0,1,4,118,101,99,52,95,115,117,98,116,114,97,99, -116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,118,0,0,18,117,0,0,0,0,1,0,10,2,21,1,1,0, -10,118,0,0,1,1,0,10,117,0,0,0,1,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114, -101,116,86,97,108,0,59,120,121,0,0,18,118,0,0,18,117,0,0,0,0,1,0,10,2,22,1,1,0,10,118,0,0,1,1,0,10, -117,0,0,0,1,3,2,0,10,1,119,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,119,0,59,120,0,0,18,117,0, -59,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,119,0,59,121,0,0,18,117,0,59,121,0,0,0,4,118, +59,122,0,18,122,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,18,119,0,20,0,0,1,0,0,8,1,1,1,0, +5,105,0,0,0,1,4,118,101,99,52,95,109,111,118,101,0,18,95,95,114,101,116,86,97,108,0,0,18,105,0,0,0, +0,1,0,0,8,1,1,1,0,9,102,0,0,0,1,4,118,101,99,52,95,116,111,95,105,118,101,99,52,0,18,95,95,114,101, +116,86,97,108,0,0,18,102,0,0,0,0,1,0,0,8,1,1,1,0,1,98,0,0,0,1,4,118,101,99,52,95,116,111,95,105, +118,101,99,52,0,18,95,95,114,101,116,86,97,108,0,0,18,98,0,0,0,0,1,0,0,2,1,1,1,0,1,98,49,0,0,1,1,0, +1,98,50,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18,98,49,0,20,0,9,18,95,95,114,101,116, +86,97,108,0,59,121,0,18,98,50,0,20,0,0,1,0,0,2,1,1,1,0,5,105,49,0,0,1,1,0,5,105,50,0,0,0,1,4,118, +101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,105,49,0,0,17,48,0,48,0, +0,0,0,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,105,50,0,0, +17,48,0,48,0,0,0,0,0,1,0,0,2,1,1,1,0,1,98,0,0,0,1,4,118,101,99,52,95,109,111,118,101,0,18,95,95, +114,101,116,86,97,108,0,59,120,121,0,0,18,98,0,0,0,0,1,0,0,2,1,1,1,0,9,102,0,0,0,1,4,118,101,99,52, +95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,102,0,0,17,48,0,48,0,0,0,0,0,1, +0,0,2,1,1,1,0,5,105,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59, +120,121,0,0,18,105,0,0,17,48,0,48,0,0,0,0,0,1,0,0,2,1,1,1,0,10,118,0,0,0,1,4,118,101,99,52,95,115, +110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,118,0,0,17,48,0,48,0,0,0,0,0,1,0,0,2, +1,1,1,0,6,118,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121, +0,0,18,118,0,0,17,48,0,48,0,0,0,0,0,1,0,0,3,1,1,1,0,1,98,49,0,0,1,1,0,1,98,50,0,0,1,1,0,1,98,51,0, +0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18,98,49,0,20,0,9,18,95,95,114,101,116,86,97,108, +0,59,121,0,18,98,50,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,18,98,51,0,20,0,0,1,0,0,3,1, +1,1,0,9,102,49,0,0,1,1,0,9,102,50,0,0,1,1,0,9,102,51,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18, +95,95,114,101,116,86,97,108,0,59,120,0,0,18,102,49,0,0,17,48,0,48,0,0,0,0,4,118,101,99,52,95,115, +110,101,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,102,50,0,0,17,48,0,48,0,0,0,0,4,118,101, +99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,102,51,0,0,17,48,0,48,0,0,0, +0,0,1,0,0,3,1,1,1,0,1,98,0,0,0,1,4,118,101,99,52,95,109,111,118,101,0,18,95,95,114,101,116,86,97, +108,0,59,120,121,122,0,0,18,98,0,0,0,0,1,0,0,3,1,1,1,0,9,102,0,0,0,1,4,118,101,99,52,95,115,110, +101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,102,0,0,17,48,0,48,0,0,0,0,0,1,0,0,3, +1,1,1,0,5,105,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121, +122,0,0,18,105,0,0,17,48,0,48,0,0,0,0,0,1,0,0,3,1,1,1,0,11,118,0,0,0,1,4,118,101,99,52,95,115,110, +101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0,0,17,48,0,48,0,0,0,0,0,1,0,0,3, +1,1,1,0,7,118,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121, +122,0,0,18,118,0,0,17,48,0,48,0,0,0,0,0,1,0,0,4,1,1,1,0,1,98,49,0,0,1,1,0,1,98,50,0,0,1,1,0,1,98, +51,0,0,1,1,0,1,98,52,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18,98,49,0,20,0,9,18,95, +95,114,101,116,86,97,108,0,59,121,0,18,98,50,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,18, +98,51,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,18,98,52,0,20,0,0,1,0,0,4,1,1,1,0,9,102, +49,0,0,1,1,0,9,102,50,0,0,1,1,0,9,102,51,0,0,1,1,0,9,102,52,0,0,0,1,3,2,1,0,9,1,122,101,114,111,0, +2,17,48,0,48,0,0,0,0,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0, +18,102,49,0,0,18,122,101,114,111,0,0,0,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97, +108,0,59,121,0,0,18,102,50,0,0,18,122,101,114,111,0,0,0,4,118,101,99,52,95,115,110,101,0,18,95,95, +114,101,116,86,97,108,0,59,122,0,0,18,102,51,0,0,18,122,101,114,111,0,0,0,4,118,101,99,52,95,115, +110,101,0,18,95,95,114,101,116,86,97,108,0,59,119,0,0,18,102,52,0,0,18,122,101,114,111,0,0,0,0,1,0, +0,4,1,1,1,0,1,98,0,0,0,1,4,118,101,99,52,95,109,111,118,101,0,18,95,95,114,101,116,86,97,108,0,59, +120,121,122,119,0,0,18,98,0,0,0,0,1,0,0,4,1,1,1,0,9,102,0,0,0,1,4,118,101,99,52,95,115,110,101,0, +18,95,95,114,101,116,86,97,108,0,59,120,121,122,119,0,0,18,102,0,0,17,48,0,48,0,0,0,0,0,1,0,0,4,1, +1,1,0,5,105,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121, +122,119,0,0,18,105,0,0,17,48,0,48,0,0,0,0,0,1,0,0,4,1,1,1,0,12,118,0,0,0,1,4,118,101,99,52,95,115, +110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,119,0,0,18,118,0,0,17,48,0,48,0,0,0,0,0, +1,0,0,4,1,1,1,0,8,118,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59, +120,121,122,119,0,0,18,118,0,0,17,48,0,48,0,0,0,0,0,1,0,0,13,1,1,1,0,9,109,48,48,0,0,1,1,0,9,109, +49,48,0,0,1,1,0,9,109,48,49,0,0,1,1,0,9,109,49,49,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8, +48,0,57,59,120,0,18,109,48,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,121,0,18, +109,49,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,120,0,18,109,48,49,0,20,0,9, +18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,121,0,18,109,49,49,0,20,0,0,1,0,0,13,1,1,1,0,9, +102,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,120,0,18,102,0,20,0,9,18,95,95,114, +101,116,86,97,108,0,16,8,48,0,57,59,121,0,17,48,0,48,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0, +16,10,49,0,57,59,120,0,17,48,0,48,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,121, +0,18,102,0,20,0,0,1,0,0,13,1,1,1,0,5,105,0,0,0,1,8,58,109,97,116,50,0,58,102,108,111,97,116,0,18, +105,0,0,0,0,0,0,0,1,0,0,13,1,1,1,0,1,98,0,0,0,1,8,58,109,97,116,50,0,58,102,108,111,97,116,0,18,98, +0,0,0,0,0,0,0,1,0,0,13,1,1,1,0,10,99,48,0,0,1,1,0,10,99,49,0,0,0,1,9,18,95,95,114,101,116,86,97, +108,0,16,8,48,0,57,18,99,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,99,49,0,20, +0,0,1,0,0,14,1,1,1,0,9,109,48,48,0,0,1,1,0,9,109,49,48,0,0,1,1,0,9,109,50,48,0,0,1,1,0,9,109,48,49, +0,0,1,1,0,9,109,49,49,0,0,1,1,0,9,109,50,49,0,0,1,1,0,9,109,48,50,0,0,1,1,0,9,109,49,50,0,0,1,1,0, +9,109,50,50,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,120,0,18,109,48,48,0,20,0,9, +18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,121,0,18,109,49,48,0,20,0,9,18,95,95,114,101,116, +86,97,108,0,16,8,48,0,57,59,122,0,18,109,50,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49, +0,57,59,120,0,18,109,48,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,121,0,18,109, +49,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,122,0,18,109,50,49,0,20,0,9,18,95, +95,114,101,116,86,97,108,0,16,10,50,0,57,59,120,0,18,109,48,50,0,20,0,9,18,95,95,114,101,116,86,97, +108,0,16,10,50,0,57,59,121,0,18,109,49,50,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57, +59,122,0,18,109,50,50,0,20,0,0,1,0,0,14,1,1,1,0,9,102,0,0,0,1,3,2,0,0,10,1,118,0,2,58,118,101,99, +50,0,18,102,0,0,17,48,0,48,0,0,0,0,0,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,118,0,59, +120,121,121,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,118,0,59,121,120,121,0,20,0, +9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,118,0,59,121,121,120,0,20,0,0,1,0,0,14,1,1,1,0, +5,105,0,0,0,1,8,58,109,97,116,51,0,58,102,108,111,97,116,0,18,105,0,0,0,0,0,0,0,1,0,0,14,1,1,1,0,1, +98,0,0,0,1,8,58,109,97,116,51,0,58,102,108,111,97,116,0,18,98,0,0,0,0,0,0,0,1,0,0,14,1,1,1,0,11,99, +48,0,0,1,1,0,11,99,49,0,0,1,1,0,11,99,50,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57, +18,99,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,99,49,0,20,0,9,18,95,95,114, +101,116,86,97,108,0,16,10,50,0,57,18,99,50,0,20,0,0,1,0,0,15,1,1,1,0,9,109,48,48,0,0,1,1,0,9,109, +49,48,0,0,1,1,0,9,109,50,48,0,0,1,1,0,9,109,51,48,0,0,1,1,0,9,109,48,49,0,0,1,1,0,9,109,49,49,0,0, +1,1,0,9,109,50,49,0,0,1,1,0,9,109,51,49,0,0,1,1,0,9,109,48,50,0,0,1,1,0,9,109,49,50,0,0,1,1,0,9, +109,50,50,0,0,1,1,0,9,109,51,50,0,0,1,1,0,9,109,48,51,0,0,1,1,0,9,109,49,51,0,0,1,1,0,9,109,50,51, +0,0,1,1,0,9,109,51,51,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,120,0,18,109,48, +48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,121,0,18,109,49,48,0,20,0,9,18,95,95, +114,101,116,86,97,108,0,16,8,48,0,57,59,122,0,18,109,50,48,0,20,0,9,18,95,95,114,101,116,86,97,108, +0,16,8,48,0,57,59,119,0,18,109,51,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59, +120,0,18,109,48,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,121,0,18,109,49,49,0, +20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,122,0,18,109,50,49,0,20,0,9,18,95,95,114, +101,116,86,97,108,0,16,10,49,0,57,59,119,0,18,109,51,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0, +16,10,50,0,57,59,120,0,18,109,48,50,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,59,121, +0,18,109,49,50,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,59,122,0,18,109,50,50,0,20, +0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,59,119,0,18,109,51,50,0,20,0,9,18,95,95,114,101, +116,86,97,108,0,16,10,51,0,57,59,120,0,18,109,48,51,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16, +10,51,0,57,59,121,0,18,109,49,51,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,59,122,0, +18,109,50,51,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,59,119,0,18,109,51,51,0,20,0, +0,1,0,0,15,1,1,1,0,9,102,0,0,0,1,3,2,0,0,10,1,118,0,2,58,118,101,99,50,0,18,102,0,0,17,48,0,48,0,0, +0,0,0,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,118,0,59,120,121,121,121,0,20,0,9,18,95, +95,114,101,116,86,97,108,0,16,10,49,0,57,18,118,0,59,121,120,121,121,0,20,0,9,18,95,95,114,101,116, +86,97,108,0,16,10,50,0,57,18,118,0,59,121,121,120,121,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16, +10,51,0,57,18,118,0,59,121,121,121,120,0,20,0,0,1,0,0,15,1,1,1,0,5,105,0,0,0,1,8,58,109,97,116,52, +0,58,102,108,111,97,116,0,18,105,0,0,0,0,0,0,0,1,0,0,15,1,1,1,0,1,98,0,0,0,1,8,58,109,97,116,52,0, +58,102,108,111,97,116,0,18,98,0,0,0,0,0,0,0,1,0,0,15,1,1,1,0,12,99,48,0,0,1,1,0,12,99,49,0,0,1,1,0, +12,99,50,0,0,1,1,0,12,99,51,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,99,48,0,20, +0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,99,49,0,20,0,9,18,95,95,114,101,116,86,97, +108,0,16,10,50,0,57,18,99,50,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,99,51,0,20, +0,0,1,0,0,5,2,26,1,1,0,5,97,0,0,1,1,0,5,98,0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,95,95,114, +101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,0,0,5,2,27,1,1,0,5,97,0,0,1,1,0,5,98,0,0,0,1,4,118, +101,99,52,95,115,117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0, +0,0,1,0,0,5,2,21,1,1,0,5,97,0,0,1,1,0,5,98,0,0,0,1,4,118,101,99,52,95,109,117,108,116,105,112,108, +121,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,0,0,5,2,22,1,1,0,5,97,0,0,1,1,0, +5,98,0,0,0,1,3,2,0,0,9,1,98,73,110,118,0,0,1,1,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18, +98,73,110,118,0,0,18,98,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,120,0,0,18, +97,0,0,18,98,73,110,118,0,0,0,4,118,101,99,52,95,116,111,95,105,118,101,99,52,0,18,95,95,114,101, +116,86,97,108,0,0,18,120,0,0,0,0,1,0,0,6,2,26,1,1,0,6,97,0,0,1,1,0,6,98,0,0,0,1,4,118,101,99,52,95, +97,100,100,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,0,0,6,2,27,1,1,0,6,97,0, +0,1,1,0,6,98,0,0,0,1,4,118,101,99,52,95,115,117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97, +108,0,0,18,97,0,0,18,98,0,0,0,0,1,0,0,6,2,21,1,1,0,6,97,0,0,1,1,0,6,98,0,0,0,1,4,118,101,99,52,95, +109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,0,0, +6,2,22,1,1,0,6,97,0,0,1,1,0,6,98,0,0,0,1,3,2,0,0,10,1,98,73,110,118,0,0,1,1,120,0,0,0,4,102,108, +111,97,116,95,114,99,112,0,18,98,73,110,118,0,59,120,0,0,18,98,0,59,120,0,0,0,4,102,108,111,97,116, +95,114,99,112,0,18,98,73,110,118,0,59,121,0,0,18,98,0,59,121,0,0,0,4,118,101,99,52,95,109,117,108, +116,105,112,108,121,0,18,120,0,0,18,97,0,0,18,98,73,110,118,0,0,0,4,118,101,99,52,95,116,111,95, +105,118,101,99,52,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,0,0,7,2,26,1,1,0,7,97,0,0, +1,1,0,7,98,0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18, +98,0,0,0,0,1,0,0,7,2,27,1,1,0,7,97,0,0,1,1,0,7,98,0,0,0,1,4,118,101,99,52,95,115,117,98,116,114,97, +99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,0,0,7,2,21,1,1,0,7,97,0,0,1, +1,0,7,98,0,0,0,1,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97, +108,0,0,18,97,0,0,18,98,0,0,0,0,1,0,0,7,2,22,1,1,0,7,97,0,0,1,1,0,7,98,0,0,0,1,3,2,0,0,11,1,98,73, +110,118,0,0,1,1,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,98,73,110,118,0,59,120,0,0,18,98, +0,59,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,98,73,110,118,0,59,121,0,0,18,98,0,59,121,0, +0,0,4,102,108,111,97,116,95,114,99,112,0,18,98,73,110,118,0,59,122,0,0,18,98,0,59,122,0,0,0,4,118, +101,99,52,95,109,117,108,116,105,112,108,121,0,18,120,0,0,18,97,0,0,18,98,73,110,118,0,0,0,4,118, +101,99,52,95,116,111,95,105,118,101,99,52,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,0, +0,8,2,26,1,1,0,8,97,0,0,1,1,0,8,98,0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,95,95,114,101,116,86, +97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,0,0,8,2,27,1,1,0,8,97,0,0,1,1,0,8,98,0,0,0,1,4,118,101,99,52, +95,115,117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,0,0, +8,2,21,1,1,0,8,97,0,0,1,1,0,8,98,0,0,0,1,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18, +95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,0,0,8,2,22,1,1,0,8,97,0,0,1,1,0,8,98,0,0, +0,1,3,2,0,0,12,1,98,73,110,118,0,0,1,1,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,98,73,110, +118,0,59,120,0,0,18,98,0,59,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,98,73,110,118,0,59, +121,0,0,18,98,0,59,121,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,98,73,110,118,0,59,122,0,0,18, +98,0,59,122,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,98,73,110,118,0,59,119,0,0,18,98,0,59, +119,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,120,0,0,18,97,0,0,18,98,73,110, +118,0,0,0,4,118,101,99,52,95,116,111,95,105,118,101,99,52,0,18,95,95,114,101,116,86,97,108,0,0,18, +120,0,0,0,0,1,0,0,9,2,26,1,1,0,9,97,0,0,1,1,0,9,98,0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,95, +95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,0,0,9,2,27,1,1,0,9,97,0,0,1,1,0,9,98,0,0,0, +1,4,118,101,99,52,95,115,117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0, +18,98,0,0,0,0,1,0,0,9,2,21,1,1,0,9,97,0,0,1,1,0,9,98,0,0,0,1,4,118,101,99,52,95,109,117,108,116, +105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,0,0,9,2,22,1,1,0,9, +97,0,0,1,1,0,9,98,0,0,0,1,3,2,0,0,9,1,98,73,110,118,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18, +98,73,110,118,0,59,120,0,0,18,98,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95, +95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,73,110,118,0,0,0,0,1,0,0,10,2,26,1,1,0,10,118,0,0,1,1, +0,10,117,0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0, +18,118,0,0,18,117,0,0,0,0,1,0,0,10,2,27,1,1,0,10,118,0,0,1,1,0,10,117,0,0,0,1,4,118,101,99,52,95, +115,117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,118,0,0,18,117,0, +0,0,0,1,0,0,10,2,21,1,1,0,10,118,0,0,1,1,0,10,117,0,0,0,1,4,118,101,99,52,95,109,117,108,116,105, +112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,118,0,0,18,117,0,0,0,0,1,0,0,10,2, +22,1,1,0,10,118,0,0,1,1,0,10,117,0,0,0,1,3,2,0,0,10,1,119,0,0,0,4,102,108,111,97,116,95,114,99,112, +0,18,119,0,59,120,0,0,18,117,0,59,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,119,0,59,121,0, +0,18,117,0,59,121,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116, +86,97,108,0,59,120,121,0,0,18,118,0,0,18,119,0,0,0,0,1,0,0,11,2,26,1,1,0,11,118,0,0,1,1,0,11,117,0, +0,0,1,4,118,101,99,52,95,97,100,100,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0, +0,18,117,0,0,0,0,1,0,0,11,2,27,1,1,0,11,118,0,0,1,1,0,11,117,0,0,0,1,4,118,101,99,52,95,115,117,98, +116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0,0,18,117,0,0,0,0, +1,0,0,11,2,21,1,1,0,11,118,0,0,1,1,0,11,117,0,0,0,1,4,118,101,99,52,95,109,117,108,116,105,112,108, +121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0,0,18,117,0,0,0,0,1,0,0,11,2,22, +1,1,0,11,118,0,0,1,1,0,11,117,0,0,0,1,3,2,0,0,11,1,119,0,0,0,4,102,108,111,97,116,95,114,99,112,0, +18,119,0,59,120,0,0,18,117,0,59,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,119,0,59,121,0,0, +18,117,0,59,121,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,119,0,59,122,0,0,18,117,0,59,122,0,0, +0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121, +122,0,0,18,118,0,0,18,119,0,0,0,0,1,0,0,12,2,26,1,1,0,12,118,0,0,1,1,0,12,117,0,0,0,1,4,118,101,99, +52,95,97,100,100,0,18,95,95,114,101,116,86,97,108,0,0,18,118,0,0,18,117,0,0,0,0,1,0,0,12,2,27,1,1, +0,12,118,0,0,1,1,0,12,117,0,0,0,1,4,118,101,99,52,95,115,117,98,116,114,97,99,116,0,18,95,95,114, +101,116,86,97,108,0,0,18,118,0,0,18,117,0,0,0,0,1,0,0,12,2,21,1,1,0,12,118,0,0,1,1,0,12,117,0,0,0, +1,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,0,18,118,0, +0,18,117,0,0,0,0,1,0,0,12,2,22,1,1,0,12,118,0,0,1,1,0,12,117,0,0,0,1,3,2,0,0,12,1,119,0,0,0,4,102, +108,111,97,116,95,114,99,112,0,18,119,0,59,120,0,0,18,117,0,59,120,0,0,0,4,102,108,111,97,116,95, +114,99,112,0,18,119,0,59,121,0,0,18,117,0,59,121,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,119, +0,59,122,0,0,18,117,0,59,122,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,119,0,59,119,0,0,18,117, +0,59,119,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108, +0,0,18,118,0,0,18,119,0,0,0,0,1,0,0,10,2,26,1,1,0,9,97,0,0,1,1,0,10,117,0,0,0,1,4,118,101,99,52,95, +97,100,100,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,97,0,0,18,117,0,59,120,121,0,0,0,0, +1,0,0,10,2,26,1,1,0,10,118,0,0,1,1,0,9,98,0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,95,95,114,101, +116,86,97,108,0,59,120,121,0,0,18,118,0,59,120,121,0,0,18,98,0,0,0,0,1,0,0,10,2,27,1,1,0,9,97,0,0, +1,1,0,10,117,0,0,0,1,4,118,101,99,52,95,115,117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97, +108,0,59,120,121,0,0,18,97,0,0,18,117,0,59,120,121,0,0,0,0,1,0,0,10,2,27,1,1,0,10,118,0,0,1,1,0,9, +98,0,0,0,1,4,118,101,99,52,95,115,117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,59, +120,121,0,0,18,118,0,59,120,121,0,0,18,98,0,0,0,0,1,0,0,10,2,21,1,1,0,9,97,0,0,1,1,0,10,117,0,0,0, +1,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121, +0,0,18,97,0,0,18,117,0,59,120,121,0,0,0,0,1,0,0,10,2,21,1,1,0,10,118,0,0,1,1,0,9,98,0,0,0,1,4,118, 101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18, -118,0,0,18,119,0,0,0,0,1,0,11,2,26,1,1,0,11,118,0,0,1,1,0,11,117,0,0,0,1,4,118,101,99,52,95,97,100, -100,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0,0,18,117,0,0,0,0,1,0,11,2,27,1, -1,0,11,118,0,0,1,1,0,11,117,0,0,0,1,4,118,101,99,52,95,115,117,98,116,114,97,99,116,0,18,95,95,114, -101,116,86,97,108,0,59,120,121,122,0,0,18,118,0,0,18,117,0,0,0,0,1,0,11,2,21,1,1,0,11,118,0,0,1,1, -0,11,117,0,0,0,1,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97, -108,0,59,120,121,122,0,0,18,118,0,0,18,117,0,0,0,0,1,0,11,2,22,1,1,0,11,118,0,0,1,1,0,11,117,0,0,0, -1,3,2,0,11,1,119,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,119,0,59,120,0,0,18,117,0,59,120,0, -0,0,4,102,108,111,97,116,95,114,99,112,0,18,119,0,59,121,0,0,18,117,0,59,121,0,0,0,4,102,108,111, -97,116,95,114,99,112,0,18,119,0,59,122,0,0,18,117,0,59,122,0,0,0,4,118,101,99,52,95,109,117,108, -116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0,0,18,119,0,0,0, -0,1,0,12,2,26,1,1,0,12,118,0,0,1,1,0,12,117,0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,95,95,114, -101,116,86,97,108,0,0,18,118,0,0,18,117,0,0,0,0,1,0,12,2,27,1,1,0,12,118,0,0,1,1,0,12,117,0,0,0,1, -4,118,101,99,52,95,115,117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,118,0,0,18, -117,0,0,0,0,1,0,12,2,21,1,1,0,12,118,0,0,1,1,0,12,117,0,0,0,1,4,118,101,99,52,95,109,117,108,116, -105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,0,18,118,0,0,18,117,0,0,0,0,1,0,12,2,22,1,1,0, -12,118,0,0,1,1,0,12,117,0,0,0,1,3,2,0,12,1,119,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,119,0, -59,120,0,0,18,117,0,59,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,119,0,59,121,0,0,18,117,0, -59,121,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,119,0,59,122,0,0,18,117,0,59,122,0,0,0,4,102, -108,111,97,116,95,114,99,112,0,18,119,0,59,119,0,0,18,117,0,59,119,0,0,0,4,118,101,99,52,95,109, -117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,0,18,118,0,0,18,119,0,0,0,0,1,0,10, -2,26,1,1,0,9,97,0,0,1,1,0,10,117,0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,95,95,114,101,116,86, -97,108,0,59,120,121,0,0,18,97,0,59,120,120,0,0,18,117,0,59,120,121,0,0,0,0,1,0,10,2,26,1,1,0,10, -118,0,0,1,1,0,9,98,0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,95,95,114,101,116,86,97,108,0,59,120, -121,0,0,18,118,0,59,120,121,0,0,18,98,0,59,120,120,0,0,0,0,1,0,10,2,27,1,1,0,9,97,0,0,1,1,0,10,117, -0,0,0,1,4,118,101,99,52,95,115,117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,59,120, -121,0,0,18,97,0,59,120,120,0,0,18,117,0,59,120,121,0,0,0,0,1,0,10,2,27,1,1,0,10,118,0,0,1,1,0,9,98, -0,0,0,1,4,118,101,99,52,95,115,117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,59,120, -121,0,0,18,118,0,59,120,121,0,0,18,98,0,59,120,120,0,0,0,0,1,0,10,2,21,1,1,0,9,97,0,0,1,1,0,10,117, -0,0,0,1,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59, -120,121,0,0,18,97,0,59,120,120,0,0,18,117,0,59,120,121,0,0,0,0,1,0,10,2,21,1,1,0,10,118,0,0,1,1,0, -9,98,0,0,0,1,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0, -59,120,121,0,0,18,118,0,59,120,121,0,0,18,98,0,59,120,120,0,0,0,0,1,0,10,2,22,1,1,0,9,97,0,0,1,1,0, -10,117,0,0,0,1,3,2,0,10,1,105,110,118,85,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,105,110,118, -85,0,59,120,0,0,18,117,0,59,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,105,110,118,85,0,59, -121,0,0,18,117,0,59,121,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114, -101,116,86,97,108,0,59,120,121,0,0,18,97,0,59,120,120,0,0,18,105,110,118,85,0,59,120,121,0,0,0,0,1, -0,10,2,22,1,1,0,10,118,0,0,1,1,0,9,98,0,0,0,1,3,2,0,9,1,105,110,118,66,0,0,0,4,102,108,111,97,116, -95,114,99,112,0,18,105,110,118,66,0,0,18,98,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108, -121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,118,0,59,120,121,0,0,18,105,110,118,66,0, -59,120,120,0,0,0,0,1,0,11,2,26,1,1,0,9,97,0,0,1,1,0,11,117,0,0,0,1,4,118,101,99,52,95,97,100,100,0, -18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,97,0,59,120,120,120,0,0,18,117,0,59,120,121, -122,0,0,0,0,1,0,11,2,26,1,1,0,11,118,0,0,1,1,0,9,98,0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,95, -95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0,59,120,121,122,0,0,18,98,0,59,120,120,120,0, -0,0,0,1,0,11,2,27,1,1,0,9,97,0,0,1,1,0,11,117,0,0,0,1,4,118,101,99,52,95,115,117,98,116,114,97,99, -116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,97,0,59,120,120,120,0,0,18,117,0,59, -120,121,122,0,0,0,0,1,0,11,2,27,1,1,0,11,118,0,0,1,1,0,9,98,0,0,0,1,4,118,101,99,52,95,115,117,98, -116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0,59,120,121,122,0, -0,18,98,0,59,120,120,120,0,0,0,0,1,0,11,2,21,1,1,0,9,97,0,0,1,1,0,11,117,0,0,0,1,4,118,101,99,52, -95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,97,0, -59,120,120,120,0,0,18,117,0,59,120,121,122,0,0,0,0,1,0,11,2,21,1,1,0,11,118,0,0,1,1,0,9,98,0,0,0,1, -4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121, -122,0,0,18,118,0,59,120,121,122,0,0,18,98,0,59,120,120,120,0,0,0,0,1,0,11,2,22,1,1,0,9,97,0,0,1,1, -0,11,117,0,0,0,1,3,2,0,11,1,105,110,118,85,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,105,110, -118,85,0,59,120,0,0,18,117,0,59,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,105,110,118,85,0, -59,121,0,0,18,117,0,59,121,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,105,110,118,85,0,59,122,0, -0,18,117,0,59,122,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116, -86,97,108,0,59,120,121,122,0,0,18,97,0,59,120,120,120,0,0,18,105,110,118,85,0,59,120,121,122,0,0,0, -0,1,0,11,2,22,1,1,0,11,118,0,0,1,1,0,9,98,0,0,0,1,3,2,0,9,1,105,110,118,66,0,0,0,4,102,108,111,97, -116,95,114,99,112,0,18,105,110,118,66,0,0,18,98,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112, -108,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0,59,120,121,122,0,0,18,105, -110,118,66,0,59,120,120,120,0,0,0,0,1,0,12,2,26,1,1,0,9,97,0,0,1,1,0,12,117,0,0,0,1,4,118,101,99, -52,95,97,100,100,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,59,120,120,120,120,0,0,18,117,0,0,0, -0,1,0,12,2,26,1,1,0,12,118,0,0,1,1,0,9,98,0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,95,95,114,101, -116,86,97,108,0,0,18,118,0,0,18,98,0,59,120,120,120,120,0,0,0,0,1,0,12,2,27,1,1,0,9,97,0,0,1,1,0, -12,117,0,0,0,1,4,118,101,99,52,95,115,117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0, -0,18,97,0,59,120,120,120,120,0,0,18,117,0,0,0,0,1,0,12,2,27,1,1,0,12,118,0,0,1,1,0,9,98,0,0,0,1,4, -118,101,99,52,95,115,117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,118,0,0,18, -98,0,59,120,120,120,120,0,0,0,0,1,0,12,2,21,1,1,0,9,97,0,0,1,1,0,12,117,0,0,0,1,4,118,101,99,52,95, -109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,59,120,120,120,120,0, -0,18,117,0,0,0,0,1,0,12,2,21,1,1,0,12,118,0,0,1,1,0,9,98,0,0,0,1,4,118,101,99,52,95,109,117,108, -116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,0,18,118,0,0,18,98,0,59,120,120,120,120,0,0, -0,0,1,0,12,2,22,1,1,0,9,97,0,0,1,1,0,12,117,0,0,0,1,3,2,0,12,1,105,110,118,85,0,0,0,4,102,108,111, -97,116,95,114,99,112,0,18,105,110,118,85,0,59,120,0,0,18,117,0,59,120,0,0,0,4,102,108,111,97,116, -95,114,99,112,0,18,105,110,118,85,0,59,121,0,0,18,117,0,59,121,0,0,0,4,102,108,111,97,116,95,114, -99,112,0,18,105,110,118,85,0,59,122,0,0,18,117,0,59,122,0,0,0,4,102,108,111,97,116,95,114,99,112,0, -18,105,110,118,85,0,59,119,0,0,18,117,0,59,119,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112, -108,121,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,59,120,120,120,120,0,0,18,105,110,118,85,0,0, -0,0,1,0,12,2,22,1,1,0,12,118,0,0,1,1,0,9,98,0,0,0,1,3,2,0,9,1,105,110,118,66,0,0,0,4,102,108,111, +118,0,59,120,121,0,0,18,98,0,0,0,0,1,0,0,10,2,22,1,1,0,9,97,0,0,1,1,0,10,117,0,0,0,1,3,2,0,0,10,1, +105,110,118,85,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,105,110,118,85,0,59,120,0,0,18,117,0, +59,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,105,110,118,85,0,59,121,0,0,18,117,0,59,121,0, +0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120, +121,0,0,18,97,0,0,18,105,110,118,85,0,59,120,121,0,0,0,0,1,0,0,10,2,22,1,1,0,10,118,0,0,1,1,0,9,98, +0,0,0,1,3,2,0,0,9,1,105,110,118,66,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,105,110,118,66,0, +0,18,98,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108, +0,59,120,121,0,0,18,118,0,59,120,121,0,0,18,105,110,118,66,0,0,0,0,1,0,0,11,2,26,1,1,0,9,97,0,0,1, +1,0,11,117,0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122, +0,0,18,97,0,0,18,117,0,59,120,121,122,0,0,0,0,1,0,0,11,2,26,1,1,0,11,118,0,0,1,1,0,9,98,0,0,0,1,4, +118,101,99,52,95,97,100,100,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0,59,120, +121,122,0,0,18,98,0,0,0,0,1,0,0,11,2,27,1,1,0,9,97,0,0,1,1,0,11,117,0,0,0,1,4,118,101,99,52,95,115, +117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,97,0,0,18,117,0, +59,120,121,122,0,0,0,0,1,0,0,11,2,27,1,1,0,11,118,0,0,1,1,0,9,98,0,0,0,1,4,118,101,99,52,95,115, +117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0,59,120,121, +122,0,0,18,98,0,0,0,0,1,0,0,11,2,21,1,1,0,9,97,0,0,1,1,0,11,117,0,0,0,1,4,118,101,99,52,95,109,117, +108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,97,0,0,18,117,0, +59,120,121,122,0,0,0,0,1,0,0,11,2,21,1,1,0,11,118,0,0,1,1,0,9,98,0,0,0,1,4,118,101,99,52,95,109, +117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0,59,120, +121,122,0,0,18,98,0,0,0,0,1,0,0,11,2,22,1,1,0,9,97,0,0,1,1,0,11,117,0,0,0,1,3,2,0,0,11,1,105,110, +118,85,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,105,110,118,85,0,59,120,0,0,18,117,0,59,120,0, +0,0,4,102,108,111,97,116,95,114,99,112,0,18,105,110,118,85,0,59,121,0,0,18,117,0,59,121,0,0,0,4, +102,108,111,97,116,95,114,99,112,0,18,105,110,118,85,0,59,122,0,0,18,117,0,59,122,0,0,0,4,118,101, +99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18, +97,0,0,18,105,110,118,85,0,59,120,121,122,0,0,0,0,1,0,0,11,2,22,1,1,0,11,118,0,0,1,1,0,9,98,0,0,0, +1,3,2,0,0,9,1,105,110,118,66,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,105,110,118,66,0,0,18, +98,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59, +120,121,122,0,0,18,118,0,59,120,121,122,0,0,18,105,110,118,66,0,0,0,0,1,0,0,12,2,26,1,1,0,9,97,0,0, +1,1,0,12,117,0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0, +18,117,0,0,0,0,1,0,0,12,2,26,1,1,0,12,118,0,0,1,1,0,9,98,0,0,0,1,4,118,101,99,52,95,97,100,100,0, +18,95,95,114,101,116,86,97,108,0,0,18,118,0,0,18,98,0,0,0,0,1,0,0,12,2,27,1,1,0,9,97,0,0,1,1,0,12, +117,0,0,0,1,4,118,101,99,52,95,115,117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,0, +18,97,0,0,18,117,0,0,0,0,1,0,0,12,2,27,1,1,0,12,118,0,0,1,1,0,9,98,0,0,0,1,4,118,101,99,52,95,115, +117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,118,0,0,18,98,0,0,0,0,1,0,0,12,2, +21,1,1,0,9,97,0,0,1,1,0,12,117,0,0,0,1,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95, +95,114,101,116,86,97,108,0,0,18,97,0,0,18,117,0,0,0,0,1,0,0,12,2,21,1,1,0,12,118,0,0,1,1,0,9,98,0, +0,0,1,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,0,18, +118,0,0,18,98,0,0,0,0,1,0,0,12,2,22,1,1,0,9,97,0,0,1,1,0,12,117,0,0,0,1,3,2,0,0,12,1,105,110,118, +85,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,105,110,118,85,0,59,120,0,0,18,117,0,59,120,0,0,0, +4,102,108,111,97,116,95,114,99,112,0,18,105,110,118,85,0,59,121,0,0,18,117,0,59,121,0,0,0,4,102, +108,111,97,116,95,114,99,112,0,18,105,110,118,85,0,59,122,0,0,18,117,0,59,122,0,0,0,4,102,108,111, +97,116,95,114,99,112,0,18,105,110,118,85,0,59,119,0,0,18,117,0,59,119,0,0,0,4,118,101,99,52,95,109, +117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,105,110,118,85,0,0,0, +0,1,0,0,12,2,22,1,1,0,12,118,0,0,1,1,0,9,98,0,0,0,1,3,2,0,0,9,1,105,110,118,66,0,0,0,4,102,108,111, 97,116,95,114,99,112,0,18,105,110,118,66,0,0,18,98,0,0,0,4,118,101,99,52,95,109,117,108,116,105, -112,108,121,0,18,95,95,114,101,116,86,97,108,0,0,18,118,0,0,18,105,110,118,66,0,59,120,120,120,120, -0,0,0,0,1,0,6,2,26,1,1,0,5,97,0,0,1,1,0,6,117,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,105, -118,101,99,50,0,18,97,0,0,0,18,117,0,46,20,0,0,1,0,6,2,26,1,1,0,6,118,0,0,1,1,0,5,98,0,0,0,1,9,18, -95,95,114,101,116,86,97,108,0,18,118,0,58,105,118,101,99,50,0,18,98,0,0,0,46,20,0,0,1,0,6,2,27,1,1, -0,5,97,0,0,1,1,0,6,117,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,105,118,101,99,50,0,18,97,0,0, -0,18,117,0,47,20,0,0,1,0,6,2,27,1,1,0,6,118,0,0,1,1,0,5,98,0,0,0,1,9,18,95,95,114,101,116,86,97, -108,0,18,118,0,58,105,118,101,99,50,0,18,98,0,0,0,47,20,0,0,1,0,6,2,21,1,1,0,5,97,0,0,1,1,0,6,117, -0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,105,118,101,99,50,0,18,97,0,0,0,18,117,0,48,20,0,0,1, -0,6,2,21,1,1,0,6,118,0,0,1,1,0,5,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,58,105,118, -101,99,50,0,18,98,0,0,0,48,20,0,0,1,0,6,2,22,1,1,0,5,97,0,0,1,1,0,6,117,0,0,0,1,9,18,95,95,114,101, -116,86,97,108,0,58,105,118,101,99,50,0,18,97,0,0,0,18,117,0,49,20,0,0,1,0,6,2,22,1,1,0,6,118,0,0,1, -1,0,5,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,58,105,118,101,99,50,0,18,98,0,0,0,49, -20,0,0,1,0,7,2,26,1,1,0,5,97,0,0,1,1,0,7,117,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,105,118, -101,99,51,0,18,97,0,0,0,18,117,0,46,20,0,0,1,0,7,2,26,1,1,0,7,118,0,0,1,1,0,5,98,0,0,0,1,9,18,95, -95,114,101,116,86,97,108,0,18,118,0,58,105,118,101,99,51,0,18,98,0,0,0,46,20,0,0,1,0,7,2,27,1,1,0, -5,97,0,0,1,1,0,7,117,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,105,118,101,99,51,0,18,97,0,0,0, -18,117,0,47,20,0,0,1,0,7,2,27,1,1,0,7,118,0,0,1,1,0,5,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108, -0,18,118,0,58,105,118,101,99,51,0,18,98,0,0,0,47,20,0,0,1,0,7,2,21,1,1,0,5,97,0,0,1,1,0,7,117,0,0, -0,1,9,18,95,95,114,101,116,86,97,108,0,58,105,118,101,99,51,0,18,97,0,0,0,18,117,0,48,20,0,0,1,0,7, -2,21,1,1,0,7,118,0,0,1,1,0,5,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,58,105,118,101, -99,51,0,18,98,0,0,0,48,20,0,0,1,0,7,2,22,1,1,0,5,97,0,0,1,1,0,7,117,0,0,0,1,9,18,95,95,114,101,116, -86,97,108,0,58,105,118,101,99,51,0,18,97,0,0,0,18,117,0,49,20,0,0,1,0,7,2,22,1,1,0,7,118,0,0,1,1,0, -5,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,58,105,118,101,99,51,0,18,98,0,0,0,49,20, -0,0,1,0,8,2,26,1,1,0,5,97,0,0,1,1,0,8,117,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,105,118, -101,99,52,0,18,97,0,0,0,18,117,0,46,20,0,0,1,0,8,2,26,1,1,0,8,118,0,0,1,1,0,5,98,0,0,0,1,9,18,95, -95,114,101,116,86,97,108,0,18,118,0,58,105,118,101,99,52,0,18,98,0,0,0,46,20,0,0,1,0,8,2,27,1,1,0, -5,97,0,0,1,1,0,8,117,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,105,118,101,99,52,0,18,97,0,0,0, -18,117,0,47,20,0,0,1,0,8,2,27,1,1,0,8,118,0,0,1,1,0,5,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108, -0,18,118,0,58,105,118,101,99,52,0,18,98,0,0,0,47,20,0,0,1,0,8,2,21,1,1,0,5,97,0,0,1,1,0,8,117,0,0, -0,1,9,18,95,95,114,101,116,86,97,108,0,58,105,118,101,99,52,0,18,97,0,0,0,18,117,0,48,20,0,0,1,0,8, -2,21,1,1,0,8,118,0,0,1,1,0,5,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,58,105,118,101, -99,52,0,18,98,0,0,0,48,20,0,0,1,0,8,2,22,1,1,0,5,97,0,0,1,1,0,8,117,0,0,0,1,9,18,95,95,114,101,116, -86,97,108,0,58,105,118,101,99,52,0,18,97,0,0,0,18,117,0,49,20,0,0,1,0,8,2,22,1,1,0,8,118,0,0,1,1,0, -5,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,58,105,118,101,99,52,0,18,98,0,0,0,49,20, -0,0,1,0,5,2,27,1,1,0,5,97,0,0,0,1,4,118,101,99,52,95,110,101,103,97,116,101,0,18,95,95,114,101,116, -86,97,108,0,59,120,0,0,18,97,0,0,0,0,1,0,6,2,27,1,1,0,6,118,0,0,0,1,4,118,101,99,52,95,110,101,103, -97,116,101,0,18,95,95,114,101,116,86,97,108,0,0,18,118,0,0,0,0,1,0,7,2,27,1,1,0,7,118,0,0,0,1,4, -118,101,99,52,95,110,101,103,97,116,101,0,18,95,95,114,101,116,86,97,108,0,0,18,118,0,0,0,0,1,0,8, -2,27,1,1,0,8,118,0,0,0,1,4,118,101,99,52,95,110,101,103,97,116,101,0,18,95,95,114,101,116,86,97, -108,0,0,18,118,0,0,0,0,1,0,9,2,27,1,1,0,9,97,0,0,0,1,4,118,101,99,52,95,110,101,103,97,116,101,0, -18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,97,0,0,0,0,1,0,10,2,27,1,1,0,10,118,0,0,0,1,4,118, -101,99,52,95,110,101,103,97,116,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,118,0,59, -120,121,0,0,0,0,1,0,11,2,27,1,1,0,11,118,0,0,0,1,4,118,101,99,52,95,110,101,103,97,116,101,0,18,95, -95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0,59,120,121,122,0,0,0,0,1,0,12,2,27,1,1,0,12, -118,0,0,0,1,4,118,101,99,52,95,110,101,103,97,116,101,0,18,95,95,114,101,116,86,97,108,0,0,18,118, -0,0,0,0,1,0,13,2,27,1,1,0,13,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0, -16,8,48,0,57,54,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,54,20, -0,0,1,0,14,2,27,1,1,0,14,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8, -48,0,57,54,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,54,20,0,9, -18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,16,10,50,0,57,54,20,0,0,1,0,15,2,27,1,1,0, -15,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,54,20,0,9,18, -95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,54,20,0,9,18,95,95,114,101,116, -86,97,108,0,16,10,50,0,57,18,109,0,16,10,50,0,57,54,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10, -51,0,57,18,109,0,16,10,51,0,57,54,20,0,0,1,0,9,0,100,111,116,0,1,1,0,9,97,0,0,1,1,0,9,98,0,0,0,1,9, -18,95,95,114,101,116,86,97,108,0,18,97,0,18,98,0,48,20,0,0,1,0,9,0,100,111,116,0,1,1,0,10,97,0,0,1, -1,0,10,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,97,0,59,120,0,18,98,0,59,120,0,48,18,97,0, -59,121,0,18,98,0,59,121,0,48,46,20,0,0,1,0,9,0,100,111,116,0,1,1,0,11,97,0,0,1,1,0,11,98,0,0,0,1,4, -118,101,99,51,95,100,111,116,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,0,9,0, -100,111,116,0,1,1,0,12,97,0,0,1,1,0,12,98,0,0,0,1,4,118,101,99,52,95,100,111,116,0,18,95,95,114, -101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,0,0,2,1,1,0,2,5,97,0,0,1,1,0,5,98,0,0,0,1,4,118, -101,99,52,95,97,100,100,0,18,97,0,0,18,97,0,0,18,98,0,0,0,0,1,0,0,2,2,1,0,2,5,97,0,0,1,1,0,5,98,0, -0,0,1,4,118,101,99,52,95,115,117,98,116,114,97,99,116,0,18,97,0,0,18,97,0,0,18,98,0,0,0,0,1,0,0,2, -3,1,0,2,5,97,0,0,1,1,0,5,98,0,0,0,1,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,97,0,0, -18,97,0,0,18,98,0,0,0,0,1,0,0,2,4,1,0,2,5,97,0,0,1,1,0,5,98,0,0,0,1,3,2,0,9,1,105,110,118,66,0,0,0, -4,102,108,111,97,116,95,114,99,112,0,18,105,110,118,66,0,0,18,98,0,0,0,4,118,101,99,52,95,109,117, -108,116,105,112,108,121,0,18,97,0,0,18,97,0,0,18,105,110,118,66,0,0,0,4,102,108,111,97,116,95,116, -111,95,105,110,116,0,18,97,0,0,18,97,0,0,0,0,1,0,0,2,1,1,0,2,6,118,0,0,1,1,0,6,117,0,0,0,1,4,118, -101,99,52,95,97,100,100,0,18,118,0,0,18,118,0,0,18,117,0,0,0,0,1,0,0,2,2,1,0,2,6,118,0,0,1,1,0,6, +112,108,121,0,18,95,95,114,101,116,86,97,108,0,0,18,118,0,0,18,105,110,118,66,0,0,0,0,1,0,0,6,2,26, +1,1,0,5,97,0,0,1,1,0,6,117,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,105,118,101,99,50,0,18,97, +0,0,0,18,117,0,46,20,0,0,1,0,0,6,2,26,1,1,0,6,118,0,0,1,1,0,5,98,0,0,0,1,9,18,95,95,114,101,116,86, +97,108,0,18,118,0,58,105,118,101,99,50,0,18,98,0,0,0,46,20,0,0,1,0,0,6,2,27,1,1,0,5,97,0,0,1,1,0,6, +117,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,105,118,101,99,50,0,18,97,0,0,0,18,117,0,47,20,0, +0,1,0,0,6,2,27,1,1,0,6,118,0,0,1,1,0,5,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,58, +105,118,101,99,50,0,18,98,0,0,0,47,20,0,0,1,0,0,6,2,21,1,1,0,5,97,0,0,1,1,0,6,117,0,0,0,1,9,18,95, +95,114,101,116,86,97,108,0,58,105,118,101,99,50,0,18,97,0,0,0,18,117,0,48,20,0,0,1,0,0,6,2,21,1,1, +0,6,118,0,0,1,1,0,5,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,58,105,118,101,99,50,0, +18,98,0,0,0,48,20,0,0,1,0,0,6,2,22,1,1,0,5,97,0,0,1,1,0,6,117,0,0,0,1,9,18,95,95,114,101,116,86,97, +108,0,58,105,118,101,99,50,0,18,97,0,0,0,18,117,0,49,20,0,0,1,0,0,6,2,22,1,1,0,6,118,0,0,1,1,0,5, +98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,58,105,118,101,99,50,0,18,98,0,0,0,49,20,0, +0,1,0,0,7,2,26,1,1,0,5,97,0,0,1,1,0,7,117,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,105,118, +101,99,51,0,18,97,0,0,0,18,117,0,46,20,0,0,1,0,0,7,2,26,1,1,0,7,118,0,0,1,1,0,5,98,0,0,0,1,9,18,95, +95,114,101,116,86,97,108,0,18,118,0,58,105,118,101,99,51,0,18,98,0,0,0,46,20,0,0,1,0,0,7,2,27,1,1, +0,5,97,0,0,1,1,0,7,117,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,105,118,101,99,51,0,18,97,0,0, +0,18,117,0,47,20,0,0,1,0,0,7,2,27,1,1,0,7,118,0,0,1,1,0,5,98,0,0,0,1,9,18,95,95,114,101,116,86,97, +108,0,18,118,0,58,105,118,101,99,51,0,18,98,0,0,0,47,20,0,0,1,0,0,7,2,21,1,1,0,5,97,0,0,1,1,0,7, +117,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,105,118,101,99,51,0,18,97,0,0,0,18,117,0,48,20,0, +0,1,0,0,7,2,21,1,1,0,7,118,0,0,1,1,0,5,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,58, +105,118,101,99,51,0,18,98,0,0,0,48,20,0,0,1,0,0,7,2,22,1,1,0,5,97,0,0,1,1,0,7,117,0,0,0,1,9,18,95, +95,114,101,116,86,97,108,0,58,105,118,101,99,51,0,18,97,0,0,0,18,117,0,49,20,0,0,1,0,0,7,2,22,1,1, +0,7,118,0,0,1,1,0,5,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,58,105,118,101,99,51,0, +18,98,0,0,0,49,20,0,0,1,0,0,8,2,26,1,1,0,5,97,0,0,1,1,0,8,117,0,0,0,1,9,18,95,95,114,101,116,86,97, +108,0,58,105,118,101,99,52,0,18,97,0,0,0,18,117,0,46,20,0,0,1,0,0,8,2,26,1,1,0,8,118,0,0,1,1,0,5, +98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,58,105,118,101,99,52,0,18,98,0,0,0,46,20,0, +0,1,0,0,8,2,27,1,1,0,5,97,0,0,1,1,0,8,117,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,105,118, +101,99,52,0,18,97,0,0,0,18,117,0,47,20,0,0,1,0,0,8,2,27,1,1,0,8,118,0,0,1,1,0,5,98,0,0,0,1,9,18,95, +95,114,101,116,86,97,108,0,18,118,0,58,105,118,101,99,52,0,18,98,0,0,0,47,20,0,0,1,0,0,8,2,21,1,1, +0,5,97,0,0,1,1,0,8,117,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,105,118,101,99,52,0,18,97,0,0, +0,18,117,0,48,20,0,0,1,0,0,8,2,21,1,1,0,8,118,0,0,1,1,0,5,98,0,0,0,1,9,18,95,95,114,101,116,86,97, +108,0,18,118,0,58,105,118,101,99,52,0,18,98,0,0,0,48,20,0,0,1,0,0,8,2,22,1,1,0,5,97,0,0,1,1,0,8, +117,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,105,118,101,99,52,0,18,97,0,0,0,18,117,0,49,20,0, +0,1,0,0,8,2,22,1,1,0,8,118,0,0,1,1,0,5,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,58, +105,118,101,99,52,0,18,98,0,0,0,49,20,0,0,1,0,0,5,2,27,1,1,0,5,97,0,0,0,1,4,118,101,99,52,95,110, +101,103,97,116,101,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,97,0,0,0,0,1,0,0,6,2,27,1,1,0, +6,118,0,0,0,1,4,118,101,99,52,95,110,101,103,97,116,101,0,18,95,95,114,101,116,86,97,108,0,0,18, +118,0,0,0,0,1,0,0,7,2,27,1,1,0,7,118,0,0,0,1,4,118,101,99,52,95,110,101,103,97,116,101,0,18,95,95, +114,101,116,86,97,108,0,0,18,118,0,0,0,0,1,0,0,8,2,27,1,1,0,8,118,0,0,0,1,4,118,101,99,52,95,110, +101,103,97,116,101,0,18,95,95,114,101,116,86,97,108,0,0,18,118,0,0,0,0,1,0,0,9,2,27,1,1,0,9,97,0,0, +0,1,4,118,101,99,52,95,110,101,103,97,116,101,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,97, +0,0,0,0,1,0,0,10,2,27,1,1,0,10,118,0,0,0,1,4,118,101,99,52,95,110,101,103,97,116,101,0,18,95,95, +114,101,116,86,97,108,0,59,120,121,0,0,18,118,0,59,120,121,0,0,0,0,1,0,0,11,2,27,1,1,0,11,118,0,0, +0,1,4,118,101,99,52,95,110,101,103,97,116,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0, +0,18,118,0,59,120,121,122,0,0,0,0,1,0,0,12,2,27,1,1,0,12,118,0,0,0,1,4,118,101,99,52,95,110,101, +103,97,116,101,0,18,95,95,114,101,116,86,97,108,0,0,18,118,0,0,0,0,1,0,0,13,2,27,1,1,0,13,109,0,0, +0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,54,20,0,9,18,95,95,114, +101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,54,20,0,0,1,0,0,14,2,27,1,1,0,14,109,0,0, +0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,54,20,0,9,18,95,95,114, +101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,54,20,0,9,18,95,95,114,101,116,86,97,108, +0,16,10,50,0,57,18,109,0,16,10,50,0,57,54,20,0,0,1,0,0,15,2,27,1,1,0,15,109,0,0,0,1,9,18,95,95,114, +101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,54,20,0,9,18,95,95,114,101,116,86,97,108,0, +16,10,49,0,57,18,109,0,16,10,49,0,57,54,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18, +109,0,16,10,50,0,57,54,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,109,0,16,10,51,0, +57,54,20,0,0,1,0,0,9,0,100,111,116,0,1,1,0,9,97,0,0,1,1,0,9,98,0,0,0,1,9,18,95,95,114,101,116,86, +97,108,0,18,97,0,18,98,0,48,20,0,0,1,0,0,9,0,100,111,116,0,1,1,0,10,97,0,0,1,1,0,10,98,0,0,0,1,9, +18,95,95,114,101,116,86,97,108,0,18,97,0,59,120,0,18,98,0,59,120,0,48,18,97,0,59,121,0,18,98,0,59, +121,0,48,46,20,0,0,1,0,0,9,0,100,111,116,0,1,1,0,11,97,0,0,1,1,0,11,98,0,0,0,1,4,118,101,99,51,95, +100,111,116,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,0,0,9,0,100,111,116,0,1, +1,0,12,97,0,0,1,1,0,12,98,0,0,0,1,4,118,101,99,52,95,100,111,116,0,18,95,95,114,101,116,86,97,108, +0,0,18,97,0,0,18,98,0,0,0,0,1,0,0,0,2,1,1,0,2,5,97,0,0,1,1,0,5,98,0,0,0,1,4,118,101,99,52,95,97, +100,100,0,18,97,0,0,18,97,0,0,18,98,0,0,0,0,1,0,0,0,2,2,1,0,2,5,97,0,0,1,1,0,5,98,0,0,0,1,4,118, +101,99,52,95,115,117,98,116,114,97,99,116,0,18,97,0,0,18,97,0,0,18,98,0,0,0,0,1,0,0,0,2,3,1,0,2,5, +97,0,0,1,1,0,5,98,0,0,0,1,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,97,0,0,18,97,0,0, +18,98,0,0,0,0,1,0,0,0,2,4,1,0,2,5,97,0,0,1,1,0,5,98,0,0,0,1,3,2,0,0,9,1,105,110,118,66,0,0,0,4,102, +108,111,97,116,95,114,99,112,0,18,105,110,118,66,0,0,18,98,0,0,0,4,118,101,99,52,95,109,117,108, +116,105,112,108,121,0,18,97,0,0,18,97,0,0,18,105,110,118,66,0,0,0,4,118,101,99,52,95,116,111,95, +105,118,101,99,52,0,18,97,0,0,18,97,0,0,0,0,1,0,0,0,2,1,1,0,2,6,118,0,0,1,1,0,6,117,0,0,0,1,4,118, +101,99,52,95,97,100,100,0,18,118,0,0,18,118,0,0,18,117,0,0,0,0,1,0,0,0,2,2,1,0,2,6,118,0,0,1,1,0,6, 117,0,0,0,1,4,118,101,99,52,95,115,117,98,116,114,97,99,116,0,18,118,0,0,18,118,0,0,18,117,0,0,0,0, -1,0,0,2,3,1,0,2,6,118,0,0,1,1,0,6,117,0,0,0,1,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0, -18,118,0,0,18,118,0,0,18,117,0,0,0,0,1,0,0,2,4,1,0,2,6,118,0,0,1,1,0,6,117,0,0,0,1,3,2,0,6,1,105, -110,118,0,0,1,1,122,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,105,110,118,0,59,120,0,0,18,117, -0,59,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,105,110,118,0,59,121,0,0,18,117,0,59,121,0, -0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,122,0,0,18,118,0,0,18,105,110,118,0,0, -0,4,102,108,111,97,116,95,116,111,95,105,110,116,0,18,118,0,0,18,122,0,0,0,0,1,0,0,2,1,1,0,2,7,118, -0,0,1,1,0,7,117,0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,118,0,0,18,118,0,0,18,117,0,0,0,0,1,0,0, -2,2,1,0,2,7,118,0,0,1,1,0,7,117,0,0,0,1,4,118,101,99,52,95,115,117,98,116,114,97,99,116,0,18,118,0, -0,18,118,0,0,18,117,0,0,0,0,1,0,0,2,3,1,0,2,7,118,0,0,1,1,0,7,117,0,0,0,1,4,118,101,99,52,95,109, -117,108,116,105,112,108,121,0,18,118,0,0,18,118,0,0,18,117,0,0,0,0,1,0,0,2,4,1,0,2,7,118,0,0,1,1,0, -7,117,0,0,0,1,3,2,0,7,1,105,110,118,0,0,1,1,122,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,105, -110,118,0,59,120,0,0,18,117,0,59,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,105,110,118,0, -59,121,0,0,18,117,0,59,121,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,122,0,0, -18,118,0,0,18,105,110,118,0,0,0,4,102,108,111,97,116,95,116,111,95,105,110,116,0,18,118,0,0,18,122, -0,0,0,0,1,0,0,2,1,1,0,2,8,118,0,0,1,1,0,8,117,0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,118,0,0, -18,118,0,0,18,117,0,0,0,0,1,0,0,2,2,1,0,2,8,118,0,0,1,1,0,8,117,0,0,0,1,4,118,101,99,52,95,115,117, -98,116,114,97,99,116,0,18,118,0,0,18,118,0,0,18,117,0,0,0,0,1,0,0,2,3,1,0,2,8,118,0,0,1,1,0,8,117, -0,0,0,1,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,118,0,0,18,118,0,0,18,117,0,0,0,0, -1,0,0,2,4,1,0,2,8,118,0,0,1,1,0,8,117,0,0,0,1,3,2,0,8,1,105,110,118,0,0,1,1,122,0,0,0,4,102,108, -111,97,116,95,114,99,112,0,18,105,110,118,0,59,120,0,0,18,117,0,59,120,0,0,0,4,102,108,111,97,116, -95,114,99,112,0,18,105,110,118,0,59,121,0,0,18,117,0,59,121,0,0,0,4,118,101,99,52,95,109,117,108, -116,105,112,108,121,0,18,122,0,0,18,118,0,0,18,105,110,118,0,0,0,4,102,108,111,97,116,95,116,111, -95,105,110,116,0,18,118,0,0,18,122,0,0,0,0,1,0,0,2,1,1,0,2,9,97,0,0,1,1,0,9,98,0,0,0,1,4,118,101, -99,52,95,97,100,100,0,18,97,0,59,120,0,0,18,97,0,59,120,0,0,18,98,0,59,120,0,0,0,0,1,0,0,2,2,1,0,2, -9,97,0,0,1,1,0,9,98,0,0,0,1,4,118,101,99,52,95,115,117,98,116,114,97,99,116,0,18,97,0,59,120,0,0, -18,97,0,0,18,98,0,0,0,0,1,0,0,2,3,1,0,2,9,97,0,0,1,1,0,9,98,0,0,0,1,4,118,101,99,52,95,109,117,108, -116,105,112,108,121,0,18,97,0,59,120,0,0,18,97,0,0,18,98,0,0,0,0,1,0,0,2,4,1,0,2,9,97,0,0,1,1,0,9, -98,0,0,0,1,3,2,0,9,1,119,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,119,0,59,120,0,0,18,98,0,0, -0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,97,0,59,120,0,0,18,97,0,0,18,119,0,0,0,0, -1,0,0,2,1,1,0,2,10,118,0,0,1,1,0,10,117,0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,118,0,59,120, -121,0,0,18,118,0,59,120,121,0,0,18,117,0,59,120,121,0,0,0,0,1,0,0,2,2,1,0,2,10,118,0,0,1,1,0,10, -117,0,0,0,1,4,118,101,99,52,95,115,117,98,116,114,97,99,116,0,18,118,0,59,120,121,0,0,18,118,0,59, -120,121,0,0,18,117,0,59,120,121,0,0,0,0,1,0,0,2,3,1,0,2,10,118,0,0,1,1,0,10,117,0,0,0,1,4,118,101, -99,52,95,109,117,108,116,105,112,108,121,0,18,118,0,59,120,121,0,0,18,118,0,59,120,121,0,0,18,117, -0,59,120,121,0,0,0,0,1,0,0,2,4,1,0,2,10,118,0,0,1,1,0,10,117,0,0,0,1,3,2,0,10,1,119,0,0,0,4,102, -108,111,97,116,95,114,99,112,0,18,119,0,59,120,0,0,18,117,0,59,120,0,0,0,4,102,108,111,97,116,95, -114,99,112,0,18,119,0,59,121,0,0,18,117,0,59,121,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112, -108,121,0,18,118,0,59,120,121,0,0,18,118,0,59,120,121,0,0,18,119,0,59,120,121,0,0,0,0,1,0,0,2,1,1, -0,2,11,118,0,0,1,1,0,11,117,0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,118,0,59,120,121,122,0,0,18, -118,0,0,18,117,0,0,0,0,1,0,0,2,2,1,0,2,11,118,0,0,1,1,0,11,117,0,0,0,1,4,118,101,99,52,95,115,117, -98,116,114,97,99,116,0,18,118,0,59,120,121,122,0,0,18,118,0,0,18,117,0,0,0,0,1,0,0,2,3,1,0,2,11, -118,0,0,1,1,0,11,117,0,0,0,1,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,118,0,59,120, -121,122,0,0,18,118,0,0,18,117,0,0,0,0,1,0,0,2,4,1,0,2,11,118,0,0,1,1,0,11,117,0,0,0,1,3,2,0,11,1, -119,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,119,0,59,120,0,0,18,117,0,59,120,0,0,0,4,102,108, -111,97,116,95,114,99,112,0,18,119,0,59,121,0,0,18,117,0,59,121,0,0,0,4,102,108,111,97,116,95,114, -99,112,0,18,119,0,59,122,0,0,18,117,0,59,122,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108, -121,0,18,118,0,59,120,121,122,0,0,18,118,0,59,120,121,122,0,0,18,119,0,59,120,121,122,0,0,0,0,1,0, -0,2,1,1,0,2,12,118,0,0,1,1,0,12,117,0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,118,0,0,18,118,0,0, -18,117,0,0,0,0,1,0,0,2,2,1,0,2,12,118,0,0,1,1,0,12,117,0,0,0,1,4,118,101,99,52,95,115,117,98,116, -114,97,99,116,0,18,118,0,0,18,118,0,0,18,117,0,0,0,0,1,0,0,2,3,1,0,2,12,118,0,0,1,1,0,12,117,0,0,0, -1,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,118,0,0,18,118,0,0,18,117,0,0,0,0,1,0,0, -2,4,1,0,2,12,118,0,0,1,1,0,12,117,0,0,0,1,3,2,0,12,1,119,0,0,0,4,102,108,111,97,116,95,114,99,112, -0,18,119,0,59,120,0,0,18,117,0,59,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,119,0,59,121,0, -0,18,117,0,59,121,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,119,0,59,122,0,0,18,117,0,59,122,0, -0,0,4,102,108,111,97,116,95,114,99,112,0,18,119,0,59,119,0,0,18,117,0,59,119,0,0,0,4,118,101,99,52, -95,109,117,108,116,105,112,108,121,0,18,118,0,0,18,118,0,0,18,119,0,0,0,0,1,0,0,2,1,1,0,2,6,118,0, -0,1,1,0,5,97,0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,118,0,59,120,121,0,0,18,118,0,59,120,121,0, -0,18,97,0,59,120,120,0,0,0,0,1,0,0,2,2,1,0,2,6,118,0,0,1,1,0,5,97,0,0,0,1,4,118,101,99,52,95,115, -117,98,116,114,97,99,116,0,18,118,0,59,120,121,0,0,18,118,0,59,120,121,0,0,18,97,0,59,120,120,0,0, -0,0,1,0,0,2,3,1,0,2,6,118,0,0,1,1,0,5,97,0,0,0,1,4,118,101,99,52,95,109,117,108,116,105,112,108, -121,0,18,118,0,59,120,121,0,0,18,118,0,59,120,121,0,0,18,97,0,59,120,120,0,0,0,9,18,118,0,59,120,0, -18,97,0,23,0,9,18,118,0,59,121,0,18,97,0,23,0,0,1,0,0,2,4,1,0,2,6,118,0,0,1,1,0,5,97,0,0,0,1,9,18, -118,0,59,120,0,18,97,0,24,0,9,18,118,0,59,121,0,18,97,0,24,0,0,1,0,0,2,1,1,0,2,7,118,0,0,1,1,0,5, -97,0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,118,0,59,120,121,122,0,0,18,118,0,59,120,121,122,0,0, -18,97,0,59,120,120,120,0,0,0,0,1,0,0,2,2,1,0,2,7,118,0,0,1,1,0,5,97,0,0,0,1,4,118,101,99,52,95,115, -117,98,116,114,97,99,116,0,18,118,0,59,120,121,122,0,0,18,118,0,59,120,121,122,0,0,18,97,0,59,120, -120,120,0,0,0,0,1,0,0,2,3,1,0,2,7,118,0,0,1,1,0,5,97,0,0,0,1,4,118,101,99,52,95,109,117,108,116, -105,112,108,121,0,18,118,0,59,120,121,122,0,0,18,118,0,59,120,121,122,0,0,18,97,0,59,120,120,120,0, -0,0,0,1,0,0,2,4,1,0,2,7,118,0,0,1,1,0,5,97,0,0,0,1,9,18,118,0,59,120,0,18,97,0,24,0,9,18,118,0,59, -121,0,18,97,0,24,0,9,18,118,0,59,122,0,18,97,0,24,0,0,1,0,0,2,1,1,0,2,8,118,0,0,1,1,0,5,97,0,0,0,1, -4,118,101,99,52,95,97,100,100,0,18,118,0,0,18,118,0,0,18,97,0,59,120,120,120,120,0,0,0,0,1,0,0,2,2, -1,0,2,8,118,0,0,1,1,0,5,97,0,0,0,1,4,118,101,99,52,95,115,117,98,116,114,97,99,116,0,18,118,0,0,18, -118,0,0,18,97,0,59,120,120,120,120,0,0,0,0,1,0,0,2,3,1,0,2,8,118,0,0,1,1,0,5,97,0,0,0,1,4,118,101, -99,52,95,109,117,108,116,105,112,108,121,0,18,118,0,0,18,118,0,0,18,97,0,59,120,120,120,120,0,0,0, -0,1,0,0,2,4,1,0,2,8,118,0,0,1,1,0,5,97,0,0,0,1,9,18,118,0,59,120,0,18,97,0,24,0,9,18,118,0,59,121, -0,18,97,0,24,0,9,18,118,0,59,122,0,18,97,0,24,0,9,18,118,0,59,119,0,18,97,0,24,0,0,1,0,0,2,1,1,0,2, -10,118,0,0,1,1,0,9,97,0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,118,0,59,120,121,0,0,18,118,0,0, -18,97,0,59,120,120,0,0,0,0,1,0,0,2,2,1,0,2,10,118,0,0,1,1,0,9,97,0,0,0,1,4,118,101,99,52,95,115, -117,98,116,114,97,99,116,0,18,118,0,59,120,121,0,0,18,118,0,0,18,97,0,59,120,120,0,0,0,0,1,0,0,2,3, -1,0,2,10,118,0,0,1,1,0,9,97,0,0,0,1,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,118,0, -59,120,121,0,0,18,118,0,0,18,97,0,59,120,120,0,0,0,0,1,0,0,2,4,1,0,2,10,118,0,0,1,1,0,9,97,0,0,0,1, -3,2,0,9,1,105,110,118,65,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,105,110,118,65,0,0,18,97,0, -0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,118,0,59,120,121,0,0,18,118,0,59,120, -121,0,0,18,105,110,118,65,0,59,120,120,0,0,0,0,1,0,0,2,1,1,0,2,11,118,0,0,1,1,0,9,97,0,0,0,1,4,118, -101,99,52,95,97,100,100,0,18,118,0,59,120,121,122,0,0,18,118,0,0,18,97,0,59,120,120,120,0,0,0,0,1, -0,0,2,2,1,0,2,11,118,0,0,1,1,0,9,97,0,0,0,1,4,118,101,99,52,95,115,117,98,116,114,97,99,116,0,18, -118,0,59,120,121,122,0,0,18,118,0,0,18,97,0,59,120,120,120,0,0,0,0,1,0,0,2,3,1,0,2,11,118,0,0,1,1, -0,9,97,0,0,0,1,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,118,0,59,120,121,122,0,0,18, -118,0,0,18,97,0,59,120,120,120,0,0,0,0,1,0,0,2,4,1,0,2,11,118,0,0,1,1,0,9,97,0,0,0,1,3,2,0,9,1,105, -110,118,65,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,105,110,118,65,0,0,18,97,0,0,0,4,118,101, -99,52,95,109,117,108,116,105,112,108,121,0,18,118,0,59,120,121,122,0,0,18,118,0,59,120,121,122,0,0, -18,105,110,118,65,0,59,120,120,120,0,0,0,0,1,0,0,2,1,1,0,2,12,118,0,0,1,1,0,9,97,0,0,0,1,4,118,101, -99,52,95,97,100,100,0,18,118,0,0,18,118,0,0,18,97,0,59,120,120,120,120,0,0,0,0,1,0,0,2,2,1,0,2,12, -118,0,0,1,1,0,9,97,0,0,0,1,4,118,101,99,52,95,115,117,98,116,114,97,99,116,0,18,118,0,0,18,118,0,0, -18,97,0,59,120,120,120,120,0,0,0,0,1,0,0,2,3,1,0,2,12,118,0,0,1,1,0,9,97,0,0,0,1,4,118,101,99,52, -95,109,117,108,116,105,112,108,121,0,18,118,0,0,18,118,0,0,18,97,0,59,120,120,120,120,0,0,0,0,1,0, -0,2,4,1,0,2,12,118,0,0,1,1,0,9,97,0,0,0,1,3,2,0,9,1,105,110,118,65,0,0,0,4,102,108,111,97,116,95, -114,99,112,0,18,105,110,118,65,0,0,18,97,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121, -0,18,118,0,0,18,118,0,0,18,105,110,118,65,0,59,120,120,120,120,0,0,0,0,1,0,13,2,26,1,1,0,13,109,0, -0,1,1,0,13,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18, -110,0,16,8,48,0,57,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57, -18,110,0,16,10,49,0,57,46,20,0,0,1,0,13,2,27,1,1,0,13,109,0,0,1,1,0,13,110,0,0,0,1,9,18,95,95,114, -101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,47,20,0,9,18,95,95, -114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,47,20,0,0,1,0, -13,2,21,1,1,0,13,109,0,0,1,1,0,13,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18, -109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,59,120,120,0,48,18,109,0,16,10,49,0,57,18,110,0,16,8,48,0, -57,59,121,121,0,48,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,8,48,0,57, -18,110,0,16,10,49,0,57,59,120,120,0,48,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,59,121,121,0, -48,46,20,0,0,1,0,13,2,22,1,1,0,13,109,0,0,1,1,0,13,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, -16,8,48,0,57,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,49,20,0,9,18,95,95,114,101,116,86,97,108, -0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,49,20,0,0,1,0,14,2,26,1,1,0,14,109,0, +1,0,0,0,2,3,1,0,2,6,118,0,0,1,1,0,6,117,0,0,0,1,4,118,101,99,52,95,109,117,108,116,105,112,108,121, +0,18,118,0,0,18,118,0,0,18,117,0,0,0,0,1,0,0,0,2,4,1,0,2,6,118,0,0,1,1,0,6,117,0,0,0,1,3,2,0,0,6,1, +105,110,118,0,0,1,1,122,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,105,110,118,0,59,120,0,0,18, +117,0,59,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,105,110,118,0,59,121,0,0,18,117,0,59, +121,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,122,0,0,18,118,0,0,18,105,110, +118,0,0,0,4,118,101,99,52,95,116,111,95,105,118,101,99,52,0,18,118,0,0,18,122,0,0,0,0,1,0,0,0,2,1, +1,0,2,7,118,0,0,1,1,0,7,117,0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,118,0,0,18,118,0,0,18,117,0, +0,0,0,1,0,0,0,2,2,1,0,2,7,118,0,0,1,1,0,7,117,0,0,0,1,4,118,101,99,52,95,115,117,98,116,114,97,99, +116,0,18,118,0,0,18,118,0,0,18,117,0,0,0,0,1,0,0,0,2,3,1,0,2,7,118,0,0,1,1,0,7,117,0,0,0,1,4,118, +101,99,52,95,109,117,108,116,105,112,108,121,0,18,118,0,0,18,118,0,0,18,117,0,0,0,0,1,0,0,0,2,4,1, +0,2,7,118,0,0,1,1,0,7,117,0,0,0,1,3,2,0,0,7,1,105,110,118,0,0,1,1,122,0,0,0,4,102,108,111,97,116, +95,114,99,112,0,18,105,110,118,0,59,120,0,0,18,117,0,59,120,0,0,0,4,102,108,111,97,116,95,114,99, +112,0,18,105,110,118,0,59,121,0,0,18,117,0,59,121,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112, +108,121,0,18,122,0,0,18,118,0,0,18,105,110,118,0,0,0,4,118,101,99,52,95,116,111,95,105,118,101,99, +52,0,18,118,0,0,18,122,0,0,0,0,1,0,0,0,2,1,1,0,2,8,118,0,0,1,1,0,8,117,0,0,0,1,4,118,101,99,52,95, +97,100,100,0,18,118,0,0,18,118,0,0,18,117,0,0,0,0,1,0,0,0,2,2,1,0,2,8,118,0,0,1,1,0,8,117,0,0,0,1, +4,118,101,99,52,95,115,117,98,116,114,97,99,116,0,18,118,0,0,18,118,0,0,18,117,0,0,0,0,1,0,0,0,2,3, +1,0,2,8,118,0,0,1,1,0,8,117,0,0,0,1,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,118,0, +0,18,118,0,0,18,117,0,0,0,0,1,0,0,0,2,4,1,0,2,8,118,0,0,1,1,0,8,117,0,0,0,1,3,2,0,0,8,1,105,110, +118,0,0,1,1,122,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,105,110,118,0,59,120,0,0,18,117,0,59, +120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,105,110,118,0,59,121,0,0,18,117,0,59,121,0,0,0,4, +118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,122,0,0,18,118,0,0,18,105,110,118,0,0,0,4, +118,101,99,52,95,116,111,95,105,118,101,99,52,0,18,118,0,0,18,122,0,0,0,0,1,0,0,0,2,1,1,0,2,9,97,0, +0,1,1,0,9,98,0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,97,0,59,120,0,0,18,97,0,59,120,0,0,18,98,0, +59,120,0,0,0,0,1,0,0,0,2,2,1,0,2,9,97,0,0,1,1,0,9,98,0,0,0,1,4,118,101,99,52,95,115,117,98,116,114, +97,99,116,0,18,97,0,59,120,0,0,18,97,0,0,18,98,0,0,0,0,1,0,0,0,2,3,1,0,2,9,97,0,0,1,1,0,9,98,0,0,0, +1,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,97,0,59,120,0,0,18,97,0,0,18,98,0,0,0,0, +1,0,0,0,2,4,1,0,2,9,97,0,0,1,1,0,9,98,0,0,0,1,3,2,0,0,9,1,119,0,0,0,4,102,108,111,97,116,95,114,99, +112,0,18,119,0,59,120,0,0,18,98,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,97,0, +59,120,0,0,18,97,0,0,18,119,0,0,0,0,1,0,0,0,2,1,1,0,2,10,118,0,0,1,1,0,10,117,0,0,0,1,4,118,101,99, +52,95,97,100,100,0,18,118,0,59,120,121,0,0,18,118,0,59,120,121,0,0,18,117,0,59,120,121,0,0,0,0,1,0, +0,0,2,2,1,0,2,10,118,0,0,1,1,0,10,117,0,0,0,1,4,118,101,99,52,95,115,117,98,116,114,97,99,116,0,18, +118,0,59,120,121,0,0,18,118,0,59,120,121,0,0,18,117,0,59,120,121,0,0,0,0,1,0,0,0,2,3,1,0,2,10,118, +0,0,1,1,0,10,117,0,0,0,1,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,118,0,59,120,121, +0,0,18,118,0,59,120,121,0,0,18,117,0,59,120,121,0,0,0,0,1,0,0,0,2,4,1,0,2,10,118,0,0,1,1,0,10,117, +0,0,0,1,3,2,0,0,10,1,119,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,119,0,59,120,0,0,18,117,0, +59,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,119,0,59,121,0,0,18,117,0,59,121,0,0,0,4,118, +101,99,52,95,109,117,108,116,105,112,108,121,0,18,118,0,59,120,121,0,0,18,118,0,59,120,121,0,0,18, +119,0,59,120,121,0,0,0,0,1,0,0,0,2,1,1,0,2,11,118,0,0,1,1,0,11,117,0,0,0,1,4,118,101,99,52,95,97, +100,100,0,18,118,0,59,120,121,122,0,0,18,118,0,0,18,117,0,0,0,0,1,0,0,0,2,2,1,0,2,11,118,0,0,1,1,0, +11,117,0,0,0,1,4,118,101,99,52,95,115,117,98,116,114,97,99,116,0,18,118,0,59,120,121,122,0,0,18, +118,0,0,18,117,0,0,0,0,1,0,0,0,2,3,1,0,2,11,118,0,0,1,1,0,11,117,0,0,0,1,4,118,101,99,52,95,109, +117,108,116,105,112,108,121,0,18,118,0,59,120,121,122,0,0,18,118,0,0,18,117,0,0,0,0,1,0,0,0,2,4,1, +0,2,11,118,0,0,1,1,0,11,117,0,0,0,1,3,2,0,0,11,1,119,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18, +119,0,59,120,0,0,18,117,0,59,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,119,0,59,121,0,0,18, +117,0,59,121,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,119,0,59,122,0,0,18,117,0,59,122,0,0,0, +4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,118,0,59,120,121,122,0,0,18,118,0,59,120, +121,122,0,0,18,119,0,59,120,121,122,0,0,0,0,1,0,0,0,2,1,1,0,2,12,118,0,0,1,1,0,12,117,0,0,0,1,4, +118,101,99,52,95,97,100,100,0,18,118,0,0,18,118,0,0,18,117,0,0,0,0,1,0,0,0,2,2,1,0,2,12,118,0,0,1, +1,0,12,117,0,0,0,1,4,118,101,99,52,95,115,117,98,116,114,97,99,116,0,18,118,0,0,18,118,0,0,18,117, +0,0,0,0,1,0,0,0,2,3,1,0,2,12,118,0,0,1,1,0,12,117,0,0,0,1,4,118,101,99,52,95,109,117,108,116,105, +112,108,121,0,18,118,0,0,18,118,0,0,18,117,0,0,0,0,1,0,0,0,2,4,1,0,2,12,118,0,0,1,1,0,12,117,0,0,0, +1,3,2,0,0,12,1,119,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,119,0,59,120,0,0,18,117,0,59,120, +0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,119,0,59,121,0,0,18,117,0,59,121,0,0,0,4,102,108,111, +97,116,95,114,99,112,0,18,119,0,59,122,0,0,18,117,0,59,122,0,0,0,4,102,108,111,97,116,95,114,99, +112,0,18,119,0,59,119,0,0,18,117,0,59,119,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121, +0,18,118,0,0,18,118,0,0,18,119,0,0,0,0,1,0,0,0,2,1,1,0,2,6,118,0,0,1,1,0,5,97,0,0,0,1,4,118,101,99, +52,95,97,100,100,0,18,118,0,59,120,121,0,0,18,118,0,59,120,121,0,0,18,97,0,0,0,0,1,0,0,0,2,2,1,0,2, +6,118,0,0,1,1,0,5,97,0,0,0,1,4,118,101,99,52,95,115,117,98,116,114,97,99,116,0,18,118,0,59,120,121, +0,0,18,118,0,59,120,121,0,0,18,97,0,0,0,0,1,0,0,0,2,3,1,0,2,6,118,0,0,1,1,0,5,97,0,0,0,1,4,118,101, +99,52,95,109,117,108,116,105,112,108,121,0,18,118,0,59,120,121,0,0,18,118,0,59,120,121,0,0,18,97,0, +0,0,9,18,118,0,59,120,0,18,97,0,23,0,9,18,118,0,59,121,0,18,97,0,23,0,0,1,0,0,0,2,4,1,0,2,6,118,0, +0,1,1,0,5,97,0,0,0,1,9,18,118,0,59,120,0,18,97,0,24,0,9,18,118,0,59,121,0,18,97,0,24,0,0,1,0,0,0,2, +1,1,0,2,7,118,0,0,1,1,0,5,97,0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,118,0,59,120,121,122,0,0, +18,118,0,59,120,121,122,0,0,18,97,0,0,0,0,1,0,0,0,2,2,1,0,2,7,118,0,0,1,1,0,5,97,0,0,0,1,4,118,101, +99,52,95,115,117,98,116,114,97,99,116,0,18,118,0,59,120,121,122,0,0,18,118,0,59,120,121,122,0,0,18, +97,0,0,0,0,1,0,0,0,2,3,1,0,2,7,118,0,0,1,1,0,5,97,0,0,0,1,4,118,101,99,52,95,109,117,108,116,105, +112,108,121,0,18,118,0,59,120,121,122,0,0,18,118,0,59,120,121,122,0,0,18,97,0,0,0,0,1,0,0,0,2,4,1, +0,2,7,118,0,0,1,1,0,5,97,0,0,0,1,9,18,118,0,59,120,0,18,97,0,24,0,9,18,118,0,59,121,0,18,97,0,24,0, +9,18,118,0,59,122,0,18,97,0,24,0,0,1,0,0,0,2,1,1,0,2,8,118,0,0,1,1,0,5,97,0,0,0,1,4,118,101,99,52, +95,97,100,100,0,18,118,0,0,18,118,0,0,18,97,0,0,0,0,1,0,0,0,2,2,1,0,2,8,118,0,0,1,1,0,5,97,0,0,0,1, +4,118,101,99,52,95,115,117,98,116,114,97,99,116,0,18,118,0,0,18,118,0,0,18,97,0,0,0,0,1,0,0,0,2,3, +1,0,2,8,118,0,0,1,1,0,5,97,0,0,0,1,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,118,0,0, +18,118,0,0,18,97,0,0,0,0,1,0,0,0,2,4,1,0,2,8,118,0,0,1,1,0,5,97,0,0,0,1,9,18,118,0,59,120,0,18,97, +0,24,0,9,18,118,0,59,121,0,18,97,0,24,0,9,18,118,0,59,122,0,18,97,0,24,0,9,18,118,0,59,119,0,18,97, +0,24,0,0,1,0,0,0,2,1,1,0,2,10,118,0,0,1,1,0,9,97,0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,118,0, +59,120,121,0,0,18,118,0,0,18,97,0,0,0,0,1,0,0,0,2,2,1,0,2,10,118,0,0,1,1,0,9,97,0,0,0,1,4,118,101, +99,52,95,115,117,98,116,114,97,99,116,0,18,118,0,59,120,121,0,0,18,118,0,0,18,97,0,0,0,0,1,0,0,0,2, +3,1,0,2,10,118,0,0,1,1,0,9,97,0,0,0,1,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,118, +0,59,120,121,0,0,18,118,0,0,18,97,0,0,0,0,1,0,0,0,2,4,1,0,2,10,118,0,0,1,1,0,9,97,0,0,0,1,3,2,0,0, +9,1,105,110,118,65,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,105,110,118,65,0,0,18,97,0,0,0,4, +118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,118,0,59,120,121,0,0,18,118,0,59,120,121,0,0, +18,105,110,118,65,0,0,0,0,1,0,0,0,2,1,1,0,2,11,118,0,0,1,1,0,9,97,0,0,0,1,4,118,101,99,52,95,97, +100,100,0,18,118,0,59,120,121,122,0,0,18,118,0,0,18,97,0,0,0,0,1,0,0,0,2,2,1,0,2,11,118,0,0,1,1,0, +9,97,0,0,0,1,4,118,101,99,52,95,115,117,98,116,114,97,99,116,0,18,118,0,59,120,121,122,0,0,18,118, +0,0,18,97,0,0,0,0,1,0,0,0,2,3,1,0,2,11,118,0,0,1,1,0,9,97,0,0,0,1,4,118,101,99,52,95,109,117,108, +116,105,112,108,121,0,18,118,0,59,120,121,122,0,0,18,118,0,0,18,97,0,0,0,0,1,0,0,0,2,4,1,0,2,11, +118,0,0,1,1,0,9,97,0,0,0,1,3,2,0,0,9,1,105,110,118,65,0,0,0,4,102,108,111,97,116,95,114,99,112,0, +18,105,110,118,65,0,0,18,97,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,118,0,59, +120,121,122,0,0,18,118,0,59,120,121,122,0,0,18,105,110,118,65,0,0,0,0,1,0,0,0,2,1,1,0,2,12,118,0,0, +1,1,0,9,97,0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,118,0,0,18,118,0,0,18,97,0,0,0,0,1,0,0,0,2,2, +1,0,2,12,118,0,0,1,1,0,9,97,0,0,0,1,4,118,101,99,52,95,115,117,98,116,114,97,99,116,0,18,118,0,0, +18,118,0,0,18,97,0,0,0,0,1,0,0,0,2,3,1,0,2,12,118,0,0,1,1,0,9,97,0,0,0,1,4,118,101,99,52,95,109, +117,108,116,105,112,108,121,0,18,118,0,0,18,118,0,0,18,97,0,0,0,0,1,0,0,0,2,4,1,0,2,12,118,0,0,1,1, +0,9,97,0,0,0,1,3,2,0,0,9,1,105,110,118,65,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,105,110, +118,65,0,0,18,97,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,118,0,0,18,118,0,0, +18,105,110,118,65,0,0,0,0,1,0,0,13,2,26,1,1,0,13,109,0,0,1,1,0,13,110,0,0,0,1,9,18,95,95,114,101, +116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,46,20,0,9,18,95,95,114, +101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,46,20,0,0,1,0,0,13, +2,27,1,1,0,13,109,0,0,1,1,0,13,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109, +0,16,8,48,0,57,18,110,0,16,8,48,0,57,47,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18, +109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,47,20,0,0,1,0,0,13,2,21,1,1,0,13,109,0,0,1,1,0,13,110,0, +0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57, +59,120,120,0,48,18,109,0,16,10,49,0,57,18,110,0,16,8,48,0,57,59,121,121,0,48,46,20,0,9,18,95,95, +114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,8,48,0,57,18,110,0,16,10,49,0,57,59,120,120,0,48, +18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,59,121,121,0,48,46,20,0,0,1,0,0,13,2,22,1,1,0,13,109, +0,0,1,1,0,13,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18, +110,0,16,8,48,0,57,49,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57, +18,110,0,16,10,49,0,57,49,20,0,0,1,0,0,14,2,26,1,1,0,14,109,0,0,1,1,0,14,110,0,0,0,1,9,18,95,95, +114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,46,20,0,9,18,95, +95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,46,20,0,9, +18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,46,20, +0,0,1,0,0,14,2,27,1,1,0,14,109,0,0,1,1,0,14,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48, +0,57,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,47,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10, +49,0,57,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,47,20,0,9,18,95,95,114,101,116,86,97,108,0, +16,10,50,0,57,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,47,20,0,0,1,0,0,14,2,21,1,1,0,14,109,0, 0,1,1,0,14,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18, -110,0,16,8,48,0,57,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57, -18,110,0,16,10,49,0,57,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,16,10,50, -0,57,18,110,0,16,10,50,0,57,46,20,0,0,1,0,14,2,27,1,1,0,14,109,0,0,1,1,0,14,110,0,0,0,1,9,18,95,95, -114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,47,20,0,9,18,95, -95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,47,20,0,9, -18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,47,20, -0,0,1,0,14,2,21,1,1,0,14,109,0,0,1,1,0,14,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0, -57,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,59,120,120,120,0,48,18,109,0,16,10,49,0,57,18,110,0, -16,8,48,0,57,59,121,121,121,0,48,46,18,109,0,16,10,50,0,57,18,110,0,16,8,48,0,57,59,122,122,122,0, -48,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,8,48,0,57,18,110,0,16,10, -49,0,57,59,120,120,120,0,48,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,59,121,121,121,0,48,46, -18,109,0,16,10,50,0,57,18,110,0,16,10,49,0,57,59,122,122,122,0,48,46,20,0,9,18,95,95,114,101,116, -86,97,108,0,16,10,50,0,57,18,109,0,16,8,48,0,57,18,110,0,16,10,50,0,57,59,120,120,120,0,48,18,109, -0,16,10,49,0,57,18,110,0,16,10,50,0,57,59,121,121,121,0,48,46,18,109,0,16,10,50,0,57,18,110,0,16, -10,50,0,57,59,122,122,122,0,48,46,20,0,0,1,0,14,2,22,1,1,0,14,109,0,0,1,1,0,14,110,0,0,0,1,9,18,95, -95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,49,20,0,9,18, -95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,49,20,0, -9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,49, -20,0,0,1,0,15,2,26,1,1,0,15,109,0,0,1,1,0,15,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8, -48,0,57,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16, -10,49,0,57,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,46,20,0,9,18,95,95,114,101,116,86,97,108, -0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,46,20,0,9,18,95,95,114,101,116,86,97, -108,0,16,10,51,0,57,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,46,20,0,0,1,0,15,2,27,1,1,0,15, -109,0,0,1,1,0,15,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57, -18,110,0,16,8,48,0,57,47,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0, -57,18,110,0,16,10,49,0,57,47,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,16,10, -50,0,57,18,110,0,16,10,50,0,57,47,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,109,0, -16,10,51,0,57,18,110,0,16,10,51,0,57,47,20,0,0,1,0,15,2,21,1,1,0,15,109,0,0,1,1,0,15,110,0,0,0,1,9, -18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,59,120, -120,120,120,0,48,18,109,0,16,10,49,0,57,18,110,0,16,8,48,0,57,59,121,121,121,121,0,48,46,18,109,0, -16,10,50,0,57,18,110,0,16,8,48,0,57,59,122,122,122,122,0,48,46,18,109,0,16,10,51,0,57,18,110,0,16, -8,48,0,57,59,119,119,119,119,0,48,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109, -0,16,8,48,0,57,18,110,0,16,10,49,0,57,59,120,120,120,120,0,48,18,109,0,16,10,49,0,57,18,110,0,16, -10,49,0,57,59,121,121,121,121,0,48,46,18,109,0,16,10,50,0,57,18,110,0,16,10,49,0,57,59,122,122,122, -122,0,48,46,18,109,0,16,10,51,0,57,18,110,0,16,10,49,0,57,59,119,119,119,119,0,48,46,20,0,9,18,95, -95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,16,8,48,0,57,18,110,0,16,10,50,0,57,59,120,120, -120,120,0,48,18,109,0,16,10,49,0,57,18,110,0,16,10,50,0,57,59,121,121,121,121,0,48,46,18,109,0,16, -10,50,0,57,18,110,0,16,10,50,0,57,59,122,122,122,122,0,48,46,18,109,0,16,10,51,0,57,18,110,0,16,10, -50,0,57,59,119,119,119,119,0,48,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,109,0, -16,8,48,0,57,18,110,0,16,10,51,0,57,59,120,120,120,120,0,48,18,109,0,16,10,49,0,57,18,110,0,16,10, -51,0,57,59,121,121,121,121,0,48,46,18,109,0,16,10,50,0,57,18,110,0,16,10,51,0,57,59,122,122,122, -122,0,48,46,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,59,119,119,119,119,0,48,46,20,0,0,1,0,15, -2,22,1,1,0,15,109,0,0,1,1,0,15,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109, -0,16,8,48,0,57,18,110,0,16,8,48,0,57,49,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18, -109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,49,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0, -57,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,49,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10, -51,0,57,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,49,20,0,0,1,0,13,2,26,1,1,0,9,97,0,0,1,1,0, -13,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,97,0,18,110,0,16,8,48,0,57,46,20, -0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,97,0,18,110,0,16,10,49,0,57,46,20,0,0,1,0,13, -2,26,1,1,0,13,109,0,0,1,1,0,9,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0, -16,8,48,0,57,18,98,0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0, -57,18,98,0,46,20,0,0,1,0,13,2,27,1,1,0,9,97,0,0,1,1,0,13,110,0,0,0,1,9,18,95,95,114,101,116,86,97, -108,0,16,8,48,0,57,18,97,0,18,110,0,16,8,48,0,57,47,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10, -49,0,57,18,97,0,18,110,0,16,10,49,0,57,47,20,0,0,1,0,13,2,27,1,1,0,13,109,0,0,1,1,0,9,98,0,0,0,1,9, -18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,98,0,47,20,0,9,18,95,95,114, -101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,98,0,47,20,0,0,1,0,13,2,21,1,1,0,9,97, -0,0,1,1,0,13,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,97,0,18,110,0,16,8,48, -0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,97,0,18,110,0,16,10,49,0,57,48,20, -0,0,1,0,13,2,21,1,1,0,13,109,0,0,1,1,0,9,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0, -57,18,109,0,16,8,48,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0, -16,10,49,0,57,18,98,0,48,20,0,0,1,0,13,2,22,1,1,0,9,97,0,0,1,1,0,13,110,0,0,0,1,9,18,95,95,114,101, -116,86,97,108,0,16,8,48,0,57,18,97,0,18,110,0,16,8,48,0,57,49,20,0,9,18,95,95,114,101,116,86,97, -108,0,16,10,49,0,57,18,97,0,18,110,0,16,10,49,0,57,49,20,0,0,1,0,13,2,22,1,1,0,13,109,0,0,1,1,0,9, -98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,98,0,49,20,0,9, -18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,98,0,49,20,0,0,1,0,14,2, -26,1,1,0,9,97,0,0,1,1,0,14,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,97,0,18, -110,0,16,8,48,0,57,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,97,0,18,110,0,16,10, -49,0,57,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,97,0,18,110,0,16,10,50,0,57,46, -20,0,0,1,0,14,2,26,1,1,0,14,109,0,0,1,1,0,9,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48, -0,57,18,109,0,16,8,48,0,57,18,98,0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109, -0,16,10,49,0,57,18,98,0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,16,10,50, -0,57,18,98,0,46,20,0,0,1,0,14,2,27,1,1,0,9,97,0,0,1,1,0,14,110,0,0,0,1,9,18,95,95,114,101,116,86, -97,108,0,16,8,48,0,57,18,97,0,18,110,0,16,8,48,0,57,47,20,0,9,18,95,95,114,101,116,86,97,108,0,16, -10,49,0,57,18,97,0,18,110,0,16,10,49,0,57,47,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57, -18,97,0,18,110,0,16,10,50,0,57,47,20,0,0,1,0,14,2,27,1,1,0,14,109,0,0,1,1,0,9,98,0,0,0,1,9,18,95, -95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,98,0,47,20,0,9,18,95,95,114,101, -116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,98,0,47,20,0,9,18,95,95,114,101,116,86,97, -108,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,98,0,47,20,0,0,1,0,14,2,21,1,1,0,9,97,0,0,1,1,0,14, -110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,97,0,18,110,0,16,8,48,0,57,48,20,0, -9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,97,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95, -114,101,116,86,97,108,0,16,10,50,0,57,18,97,0,18,110,0,16,10,50,0,57,48,20,0,0,1,0,14,2,21,1,1,0, -14,109,0,0,1,1,0,9,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0, -57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,98,0, -48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,98,0,48,20,0,0, -1,0,14,2,22,1,1,0,9,97,0,0,1,1,0,14,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18, -97,0,18,110,0,16,8,48,0,57,49,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,97,0,18,110, -0,16,10,49,0,57,49,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,97,0,18,110,0,16,10,50, -0,57,49,20,0,0,1,0,14,2,22,1,1,0,14,109,0,0,1,1,0,9,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, +110,0,16,8,48,0,57,59,120,120,120,0,48,18,109,0,16,10,49,0,57,18,110,0,16,8,48,0,57,59,121,121,121, +0,48,46,18,109,0,16,10,50,0,57,18,110,0,16,8,48,0,57,59,122,122,122,0,48,46,20,0,9,18,95,95,114, +101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,8,48,0,57,18,110,0,16,10,49,0,57,59,120,120,120,0,48, +18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,59,121,121,121,0,48,46,18,109,0,16,10,50,0,57,18,110, +0,16,10,49,0,57,59,122,122,122,0,48,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18, +109,0,16,8,48,0,57,18,110,0,16,10,50,0,57,59,120,120,120,0,48,18,109,0,16,10,49,0,57,18,110,0,16, +10,50,0,57,59,121,121,121,0,48,46,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,59,122,122,122,0, +48,46,20,0,0,1,0,0,14,2,22,1,1,0,14,109,0,0,1,1,0,14,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108, +0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,49,20,0,9,18,95,95,114,101,116,86,97, +108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,49,20,0,9,18,95,95,114,101,116, +86,97,108,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,49,20,0,0,1,0,0,15,2,26,1, +1,0,15,109,0,0,1,1,0,15,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8, +48,0,57,18,110,0,16,8,48,0,57,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16, +10,49,0,57,18,110,0,16,10,49,0,57,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109, +0,16,10,50,0,57,18,110,0,16,10,50,0,57,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18, +109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,46,20,0,0,1,0,0,15,2,27,1,1,0,15,109,0,0,1,1,0,15,110,0, +0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57, +47,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,110,0,16,10,49, +0,57,47,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,110,0,16, +10,50,0,57,47,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,109,0,16,10,51,0,57,18,110, +0,16,10,51,0,57,47,20,0,0,1,0,0,15,2,21,1,1,0,15,109,0,0,1,1,0,15,110,0,0,0,1,9,18,95,95,114,101, +116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,59,120,120,120,120,0,48, +18,109,0,16,10,49,0,57,18,110,0,16,8,48,0,57,59,121,121,121,121,0,48,46,18,109,0,16,10,50,0,57,18, +110,0,16,8,48,0,57,59,122,122,122,122,0,48,46,18,109,0,16,10,51,0,57,18,110,0,16,8,48,0,57,59,119, +119,119,119,0,48,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,8,48,0,57,18, +110,0,16,10,49,0,57,59,120,120,120,120,0,48,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,59,121, +121,121,121,0,48,46,18,109,0,16,10,50,0,57,18,110,0,16,10,49,0,57,59,122,122,122,122,0,48,46,18, +109,0,16,10,51,0,57,18,110,0,16,10,49,0,57,59,119,119,119,119,0,48,46,20,0,9,18,95,95,114,101,116, +86,97,108,0,16,10,50,0,57,18,109,0,16,8,48,0,57,18,110,0,16,10,50,0,57,59,120,120,120,120,0,48,18, +109,0,16,10,49,0,57,18,110,0,16,10,50,0,57,59,121,121,121,121,0,48,46,18,109,0,16,10,50,0,57,18, +110,0,16,10,50,0,57,59,122,122,122,122,0,48,46,18,109,0,16,10,51,0,57,18,110,0,16,10,50,0,57,59, +119,119,119,119,0,48,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,109,0,16,8,48,0, +57,18,110,0,16,10,51,0,57,59,120,120,120,120,0,48,18,109,0,16,10,49,0,57,18,110,0,16,10,51,0,57,59, +121,121,121,121,0,48,46,18,109,0,16,10,50,0,57,18,110,0,16,10,51,0,57,59,122,122,122,122,0,48,46, +18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,59,119,119,119,119,0,48,46,20,0,0,1,0,0,15,2,22,1,1, +0,15,109,0,0,1,1,0,15,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48, +0,57,18,110,0,16,8,48,0,57,49,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10, +49,0,57,18,110,0,16,10,49,0,57,49,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0, +16,10,50,0,57,18,110,0,16,10,50,0,57,49,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18, +109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,49,20,0,0,1,0,0,13,2,26,1,1,0,9,97,0,0,1,1,0,13,110,0,0, +0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,97,0,18,110,0,16,8,48,0,57,46,20,0,9,18,95, +95,114,101,116,86,97,108,0,16,10,49,0,57,18,97,0,18,110,0,16,10,49,0,57,46,20,0,0,1,0,0,13,2,26,1, +1,0,13,109,0,0,1,1,0,9,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48, +0,57,18,98,0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,98, +0,46,20,0,0,1,0,0,13,2,27,1,1,0,9,97,0,0,1,1,0,13,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, +16,8,48,0,57,18,97,0,18,110,0,16,8,48,0,57,47,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0, +57,18,97,0,18,110,0,16,10,49,0,57,47,20,0,0,1,0,0,13,2,27,1,1,0,13,109,0,0,1,1,0,9,98,0,0,0,1,9,18, +95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,98,0,47,20,0,9,18,95,95,114, +101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,98,0,47,20,0,0,1,0,0,13,2,21,1,1,0,9, +97,0,0,1,1,0,13,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,97,0,18,110,0,16,8, +48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,97,0,18,110,0,16,10,49,0,57,48, +20,0,0,1,0,0,13,2,21,1,1,0,13,109,0,0,1,1,0,9,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8, +48,0,57,18,109,0,16,8,48,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18, +109,0,16,10,49,0,57,18,98,0,48,20,0,0,1,0,0,13,2,22,1,1,0,9,97,0,0,1,1,0,13,110,0,0,0,1,9,18,95,95, +114,101,116,86,97,108,0,16,8,48,0,57,18,97,0,18,110,0,16,8,48,0,57,49,20,0,9,18,95,95,114,101,116, +86,97,108,0,16,10,49,0,57,18,97,0,18,110,0,16,10,49,0,57,49,20,0,0,1,0,0,13,2,22,1,1,0,13,109,0,0, +1,1,0,9,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,98,0, +49,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,98,0,49,20,0,0, +1,0,0,14,2,26,1,1,0,9,97,0,0,1,1,0,14,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57, +18,97,0,18,110,0,16,8,48,0,57,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,97,0,18, +110,0,16,10,49,0,57,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,97,0,18,110,0,16, +10,50,0,57,46,20,0,0,1,0,0,14,2,26,1,1,0,14,109,0,0,1,1,0,9,98,0,0,0,1,9,18,95,95,114,101,116,86, +97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,98,0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16, +10,49,0,57,18,109,0,16,10,49,0,57,18,98,0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57, +18,109,0,16,10,50,0,57,18,98,0,46,20,0,0,1,0,0,14,2,27,1,1,0,9,97,0,0,1,1,0,14,110,0,0,0,1,9,18,95, +95,114,101,116,86,97,108,0,16,8,48,0,57,18,97,0,18,110,0,16,8,48,0,57,47,20,0,9,18,95,95,114,101, +116,86,97,108,0,16,10,49,0,57,18,97,0,18,110,0,16,10,49,0,57,47,20,0,9,18,95,95,114,101,116,86,97, +108,0,16,10,50,0,57,18,97,0,18,110,0,16,10,50,0,57,47,20,0,0,1,0,0,14,2,27,1,1,0,14,109,0,0,1,1,0, +9,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,98,0,47,20,0, +9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,98,0,47,20,0,9,18,95,95, +114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,98,0,47,20,0,0,1,0,0,14,2,21,1,1,0, +9,97,0,0,1,1,0,14,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,97,0,18,110,0,16, +8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,97,0,18,110,0,16,10,49,0,57, +48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,97,0,18,110,0,16,10,50,0,57,48,20,0,0, +1,0,0,14,2,21,1,1,0,14,109,0,0,1,1,0,9,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57, +18,109,0,16,8,48,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16, +10,49,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,16,10,50,0,57, +18,98,0,48,20,0,0,1,0,0,14,2,22,1,1,0,9,97,0,0,1,1,0,14,110,0,0,0,1,9,18,95,95,114,101,116,86,97, +108,0,16,8,48,0,57,18,97,0,18,110,0,16,8,48,0,57,49,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10, +49,0,57,18,97,0,18,110,0,16,10,49,0,57,49,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18, +97,0,18,110,0,16,10,50,0,57,49,20,0,0,1,0,0,14,2,22,1,1,0,14,109,0,0,1,1,0,9,98,0,0,0,1,9,18,95,95, +114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,98,0,49,20,0,9,18,95,95,114,101,116, +86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,98,0,49,20,0,9,18,95,95,114,101,116,86,97,108, +0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,98,0,49,20,0,0,1,0,0,15,2,26,1,1,0,9,97,0,0,1,1,0,15,110, +0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,97,0,18,110,0,16,8,48,0,57,46,20,0,9,18, +95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,97,0,18,110,0,16,10,49,0,57,46,20,0,9,18,95,95,114, +101,116,86,97,108,0,16,10,50,0,57,18,97,0,18,110,0,16,10,50,0,57,46,20,0,9,18,95,95,114,101,116,86, +97,108,0,16,10,51,0,57,18,97,0,18,110,0,16,10,51,0,57,46,20,0,0,1,0,0,15,2,26,1,1,0,15,109,0,0,1,1, +0,9,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,98,0,46,20, +0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,98,0,46,20,0,9,18,95, +95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,98,0,46,20,0,9,18,95,95,114,101, +116,86,97,108,0,16,10,51,0,57,18,109,0,16,10,51,0,57,18,98,0,46,20,0,0,1,0,0,15,2,27,1,1,0,9,97,0, +0,1,1,0,15,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,97,0,18,110,0,16,8,48,0, +57,47,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,97,0,18,110,0,16,10,49,0,57,47,20,0, +9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,97,0,18,110,0,16,10,50,0,57,47,20,0,9,18,95,95, +114,101,116,86,97,108,0,16,10,51,0,57,18,97,0,18,110,0,16,10,51,0,57,47,20,0,0,1,0,0,15,2,27,1,1,0, +15,109,0,0,1,1,0,9,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0, +57,18,98,0,47,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,98,0, +47,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,98,0,47,20,0,9, +18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,109,0,16,10,51,0,57,18,98,0,47,20,0,0,1,0,0,15,2, +21,1,1,0,9,97,0,0,1,1,0,15,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,97,0,18, +110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,97,0,18,110,0,16,10, +49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,97,0,18,110,0,16,10,50,0,57,48, +20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,97,0,18,110,0,16,10,51,0,57,48,20,0,0,1,0, +0,15,2,21,1,1,0,15,109,0,0,1,1,0,9,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18, +109,0,16,8,48,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10, +49,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18, +98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,109,0,16,10,51,0,57,18,98,0,48,20, +0,0,1,0,0,15,2,22,1,1,0,9,97,0,0,1,1,0,15,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0, +57,18,97,0,18,110,0,16,8,48,0,57,49,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,97,0, +18,110,0,16,10,49,0,57,49,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,97,0,18,110,0, +16,10,50,0,57,49,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,97,0,18,110,0,16,10,51,0, +57,49,20,0,0,1,0,0,15,2,22,1,1,0,15,109,0,0,1,1,0,9,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, 16,8,48,0,57,18,109,0,16,8,48,0,57,18,98,0,49,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0, 57,18,109,0,16,10,49,0,57,18,98,0,49,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109, -0,16,10,50,0,57,18,98,0,49,20,0,0,1,0,15,2,26,1,1,0,9,97,0,0,1,1,0,15,110,0,0,0,1,9,18,95,95,114, -101,116,86,97,108,0,16,8,48,0,57,18,97,0,18,110,0,16,8,48,0,57,46,20,0,9,18,95,95,114,101,116,86, -97,108,0,16,10,49,0,57,18,97,0,18,110,0,16,10,49,0,57,46,20,0,9,18,95,95,114,101,116,86,97,108,0, -16,10,50,0,57,18,97,0,18,110,0,16,10,50,0,57,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0, -57,18,97,0,18,110,0,16,10,51,0,57,46,20,0,0,1,0,15,2,26,1,1,0,15,109,0,0,1,1,0,9,98,0,0,0,1,9,18, -95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,98,0,46,20,0,9,18,95,95,114, -101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,98,0,46,20,0,9,18,95,95,114,101,116,86, -97,108,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,98,0,46,20,0,9,18,95,95,114,101,116,86,97,108,0, -16,10,51,0,57,18,109,0,16,10,51,0,57,18,98,0,46,20,0,0,1,0,15,2,27,1,1,0,9,97,0,0,1,1,0,15,110,0,0, -0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,97,0,18,110,0,16,8,48,0,57,47,20,0,9,18,95, -95,114,101,116,86,97,108,0,16,10,49,0,57,18,97,0,18,110,0,16,10,49,0,57,47,20,0,9,18,95,95,114,101, -116,86,97,108,0,16,10,50,0,57,18,97,0,18,110,0,16,10,50,0,57,47,20,0,9,18,95,95,114,101,116,86,97, -108,0,16,10,51,0,57,18,97,0,18,110,0,16,10,51,0,57,47,20,0,0,1,0,15,2,27,1,1,0,15,109,0,0,1,1,0,9, -98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,98,0,47,20,0,9, -18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,98,0,47,20,0,9,18,95,95, -114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,98,0,47,20,0,9,18,95,95,114,101, -116,86,97,108,0,16,10,51,0,57,18,109,0,16,10,51,0,57,18,98,0,47,20,0,0,1,0,15,2,21,1,1,0,9,97,0,0, -1,1,0,15,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,97,0,18,110,0,16,8,48,0,57, -48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,97,0,18,110,0,16,10,49,0,57,48,20,0,9, -18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,97,0,18,110,0,16,10,50,0,57,48,20,0,9,18,95,95, -114,101,116,86,97,108,0,16,10,51,0,57,18,97,0,18,110,0,16,10,51,0,57,48,20,0,0,1,0,15,2,21,1,1,0, -15,109,0,0,1,1,0,9,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0, -57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,98,0, -48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,98,0,48,20,0,9, -18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,109,0,16,10,51,0,57,18,98,0,48,20,0,0,1,0,15,2, -22,1,1,0,9,97,0,0,1,1,0,15,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,97,0,18, -110,0,16,8,48,0,57,49,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,97,0,18,110,0,16,10, -49,0,57,49,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,97,0,18,110,0,16,10,50,0,57,49, -20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,97,0,18,110,0,16,10,51,0,57,49,20,0,0,1,0, -15,2,22,1,1,0,15,109,0,0,1,1,0,9,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109, -0,16,8,48,0,57,18,98,0,49,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49, -0,57,18,98,0,49,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,98, -0,49,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,109,0,16,10,51,0,57,18,98,0,49,20,0, -0,1,0,10,2,21,1,1,0,13,109,0,0,1,1,0,10,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,109,0,16, -8,48,0,57,18,118,0,59,120,120,0,48,18,109,0,16,10,49,0,57,18,118,0,59,121,121,0,48,46,20,0,0,1,0, -10,2,21,1,1,0,10,118,0,0,1,1,0,13,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,100, -111,116,0,18,118,0,0,18,109,0,16,8,48,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58, -100,111,116,0,18,118,0,0,18,109,0,16,10,49,0,57,0,0,20,0,0,1,0,11,2,21,1,1,0,14,109,0,0,1,1,0,11, -118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,109,0,16,8,48,0,57,18,118,0,59,120,120,120,0,48, -18,109,0,16,10,49,0,57,18,118,0,59,121,121,121,0,48,46,18,109,0,16,10,50,0,57,18,118,0,59,122,122, -122,0,48,46,20,0,0,1,0,11,2,21,1,1,0,11,118,0,0,1,1,0,14,109,0,0,0,1,9,18,95,95,114,101,116,86,97, -108,0,59,120,0,58,100,111,116,0,18,118,0,0,18,109,0,16,8,48,0,57,0,0,20,0,9,18,95,95,114,101,116, -86,97,108,0,59,121,0,58,100,111,116,0,18,118,0,0,18,109,0,16,10,49,0,57,0,0,20,0,9,18,95,95,114, -101,116,86,97,108,0,59,122,0,58,100,111,116,0,18,118,0,0,18,109,0,16,10,50,0,57,0,0,20,0,0,1,0,12, -2,21,1,1,0,15,109,0,0,1,1,0,12,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,109,0,16,8,48,0, -57,18,118,0,59,120,120,120,120,0,48,18,109,0,16,10,49,0,57,18,118,0,59,121,121,121,121,0,48,46,18, -109,0,16,10,50,0,57,18,118,0,59,122,122,122,122,0,48,46,18,109,0,16,10,51,0,57,18,118,0,59,119,119, -119,119,0,48,46,20,0,0,1,0,12,2,21,1,1,0,12,118,0,0,1,1,0,15,109,0,0,0,1,9,18,95,95,114,101,116,86, +0,16,10,50,0,57,18,98,0,49,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,109,0,16,10,51, +0,57,18,98,0,49,20,0,0,1,0,0,10,2,21,1,1,0,13,109,0,0,1,1,0,10,118,0,0,0,1,9,18,95,95,114,101,116, +86,97,108,0,18,109,0,16,8,48,0,57,18,118,0,59,120,120,0,48,18,109,0,16,10,49,0,57,18,118,0,59,121, +121,0,48,46,20,0,0,1,0,0,10,2,21,1,1,0,10,118,0,0,1,1,0,13,109,0,0,0,1,9,18,95,95,114,101,116,86, 97,108,0,59,120,0,58,100,111,116,0,18,118,0,0,18,109,0,16,8,48,0,57,0,0,20,0,9,18,95,95,114,101, -116,86,97,108,0,59,121,0,58,100,111,116,0,18,118,0,0,18,109,0,16,10,49,0,57,0,0,20,0,9,18,95,95, -114,101,116,86,97,108,0,59,122,0,58,100,111,116,0,18,118,0,0,18,109,0,16,10,50,0,57,0,0,20,0,9,18, -95,95,114,101,116,86,97,108,0,59,119,0,58,100,111,116,0,18,118,0,0,18,109,0,16,10,51,0,57,0,0,20,0, -0,1,0,0,2,1,1,0,2,13,109,0,0,1,1,0,13,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,21, -0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,21,0,0,1,0,0,2,2,1,0,2,13,109,0,0,1,1,0,13,110,0, -0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,22,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10, -49,0,57,22,0,0,1,0,0,2,3,1,0,2,13,109,0,0,1,1,0,13,110,0,0,0,1,9,18,109,0,18,109,0,18,110,0,48,20, -0,0,1,0,0,2,4,1,0,2,13,109,0,0,1,1,0,13,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57, -24,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,24,0,0,1,0,0,2,1,1,0,2,14,109,0,0,1,1,0,14, -110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,21,0,9,18,109,0,16,10,49,0,57,18,110,0, -16,10,49,0,57,21,0,9,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,21,0,0,1,0,0,2,2,1,0,2,14,109,0, -0,1,1,0,14,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,22,0,9,18,109,0,16,10,49,0,57, -18,110,0,16,10,49,0,57,22,0,9,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,22,0,0,1,0,0,2,3,1,0,2, -14,109,0,0,1,1,0,14,110,0,0,0,1,9,18,109,0,18,109,0,18,110,0,48,20,0,0,1,0,0,2,4,1,0,2,14,109,0,0, -1,1,0,14,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,24,0,9,18,109,0,16,10,49,0,57, -18,110,0,16,10,49,0,57,24,0,9,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,24,0,0,1,0,0,2,1,1,0,2, -15,109,0,0,1,1,0,15,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,21,0,9,18,109,0,16, -10,49,0,57,18,110,0,16,10,49,0,57,21,0,9,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,21,0,9,18, -109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,21,0,0,1,0,0,2,2,1,0,2,15,109,0,0,1,1,0,15,110,0,0,0,1, -9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,22,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57, -22,0,9,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,22,0,9,18,109,0,16,10,51,0,57,18,110,0,16,10, -51,0,57,22,0,0,1,0,0,2,3,1,0,2,15,109,0,0,1,1,0,15,110,0,0,0,1,9,18,109,0,18,109,0,18,110,0,48,20, -0,0,1,0,0,2,4,1,0,2,15,109,0,0,1,1,0,15,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57, -24,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,24,0,9,18,109,0,16,10,50,0,57,18,110,0,16,10, -50,0,57,24,0,9,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,24,0,0,1,0,0,2,1,1,0,2,13,109,0,0,1,1, -0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,21,0,9,18,109,0,16,10,49,0,57,18,97,0,21,0,0,1,0,0, -2,2,1,0,2,13,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,22,0,9,18,109,0,16,10,49,0, -57,18,97,0,22,0,0,1,0,0,2,3,1,0,2,13,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,23, -0,9,18,109,0,16,10,49,0,57,18,97,0,23,0,0,1,0,0,2,4,1,0,2,13,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0, -16,8,48,0,57,18,97,0,24,0,9,18,109,0,16,10,49,0,57,18,97,0,24,0,0,1,0,0,2,1,1,0,2,14,109,0,0,1,1,0, -9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,21,0,9,18,109,0,16,10,49,0,57,18,97,0,21,0,9,18,109,0, -16,10,50,0,57,18,97,0,21,0,0,1,0,0,2,2,1,0,2,14,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57, -18,97,0,22,0,9,18,109,0,16,10,49,0,57,18,97,0,22,0,9,18,109,0,16,10,50,0,57,18,97,0,22,0,0,1,0,0,2, -3,1,0,2,14,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,23,0,9,18,109,0,16,10,49,0, -57,18,97,0,23,0,9,18,109,0,16,10,50,0,57,18,97,0,23,0,0,1,0,0,2,4,1,0,2,14,109,0,0,1,1,0,9,97,0,0, -0,1,9,18,109,0,16,8,48,0,57,18,97,0,24,0,9,18,109,0,16,10,49,0,57,18,97,0,24,0,9,18,109,0,16,10,50, -0,57,18,97,0,24,0,0,1,0,0,2,1,1,0,2,15,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0, -21,0,9,18,109,0,16,10,49,0,57,18,97,0,21,0,9,18,109,0,16,10,50,0,57,18,97,0,21,0,9,18,109,0,16,10, -51,0,57,18,97,0,21,0,0,1,0,0,2,2,1,0,2,15,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97, -0,22,0,9,18,109,0,16,10,49,0,57,18,97,0,22,0,9,18,109,0,16,10,50,0,57,18,97,0,22,0,9,18,109,0,16, -10,51,0,57,18,97,0,22,0,0,1,0,0,2,3,1,0,2,15,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18, -97,0,23,0,9,18,109,0,16,10,49,0,57,18,97,0,23,0,9,18,109,0,16,10,50,0,57,18,97,0,23,0,9,18,109,0, -16,10,51,0,57,18,97,0,23,0,0,1,0,0,2,4,1,0,2,15,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57, -18,97,0,24,0,9,18,109,0,16,10,49,0,57,18,97,0,24,0,9,18,109,0,16,10,50,0,57,18,97,0,24,0,9,18,109, -0,16,10,51,0,57,18,97,0,24,0,0,1,0,0,2,3,1,0,2,10,118,0,0,1,1,0,13,109,0,0,0,1,9,18,118,0,18,118,0, -18,109,0,48,20,0,0,1,0,0,2,3,1,0,2,11,118,0,0,1,1,0,14,109,0,0,0,1,9,18,118,0,18,118,0,18,109,0,48, -20,0,0,1,0,0,2,3,1,0,2,12,118,0,0,1,1,0,15,109,0,0,0,1,9,18,118,0,18,118,0,18,109,0,48,20,0,0,1,0, -5,2,25,1,0,2,5,97,0,0,0,1,9,18,97,0,18,97,0,16,10,49,0,47,20,0,9,18,95,95,114,101,116,86,97,108,0, -18,97,0,20,0,0,1,0,6,2,25,1,0,2,6,118,0,0,0,1,9,18,118,0,18,118,0,58,105,118,101,99,50,0,16,10,49, -0,0,0,47,20,0,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,0,1,0,7,2,25,1,0,2,7,118,0,0,0,1,9, -18,118,0,18,118,0,58,105,118,101,99,51,0,16,10,49,0,0,0,47,20,0,9,18,95,95,114,101,116,86,97,108,0, -18,118,0,20,0,0,1,0,8,2,25,1,0,2,8,118,0,0,0,1,9,18,118,0,18,118,0,58,105,118,101,99,52,0,16,10,49, -0,0,0,47,20,0,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,0,1,0,9,2,25,1,0,2,9,97,0,0,0,1,9, -18,97,0,18,97,0,17,49,0,48,0,0,47,20,0,9,18,95,95,114,101,116,86,97,108,0,18,97,0,20,0,0,1,0,10,2, -25,1,0,2,10,118,0,0,0,1,9,18,118,0,18,118,0,58,118,101,99,50,0,17,49,0,48,0,0,0,0,47,20,0,9,18,95, -95,114,101,116,86,97,108,0,18,118,0,20,0,0,1,0,11,2,25,1,0,2,11,118,0,0,0,1,9,18,118,0,18,118,0,58, +116,86,97,108,0,59,121,0,58,100,111,116,0,18,118,0,0,18,109,0,16,10,49,0,57,0,0,20,0,0,1,0,0,11,2, +21,1,1,0,14,109,0,0,1,1,0,11,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,109,0,16,8,48,0,57, +18,118,0,59,120,120,120,0,48,18,109,0,16,10,49,0,57,18,118,0,59,121,121,121,0,48,46,18,109,0,16,10, +50,0,57,18,118,0,59,122,122,122,0,48,46,20,0,0,1,0,0,11,2,21,1,1,0,11,118,0,0,1,1,0,14,109,0,0,0,1, +9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,100,111,116,0,18,118,0,0,18,109,0,16,8,48,0,57,0,0, +20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,100,111,116,0,18,118,0,0,18,109,0,16,10,49,0, +57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,100,111,116,0,18,118,0,0,18,109,0,16,10, +50,0,57,0,0,20,0,0,1,0,0,12,2,21,1,1,0,15,109,0,0,1,1,0,12,118,0,0,0,1,9,18,95,95,114,101,116,86, +97,108,0,18,109,0,16,8,48,0,57,18,118,0,59,120,120,120,120,0,48,18,109,0,16,10,49,0,57,18,118,0,59, +121,121,121,121,0,48,46,18,109,0,16,10,50,0,57,18,118,0,59,122,122,122,122,0,48,46,18,109,0,16,10, +51,0,57,18,118,0,59,119,119,119,119,0,48,46,20,0,0,1,0,0,12,2,21,1,1,0,12,118,0,0,1,1,0,15,109,0,0, +0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,100,111,116,0,18,118,0,0,18,109,0,16,8,48,0,57, +0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,100,111,116,0,18,118,0,0,18,109,0,16,10,49, +0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,100,111,116,0,18,118,0,0,18,109,0,16, +10,50,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,100,111,116,0,18,118,0,0,18,109, +0,16,10,51,0,57,0,0,20,0,0,1,0,0,0,2,1,1,0,2,13,109,0,0,1,1,0,13,110,0,0,0,1,9,18,109,0,16,8,48,0, +57,18,110,0,16,8,48,0,57,21,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,21,0,0,1,0,0,0,2,2,1, +0,2,13,109,0,0,1,1,0,13,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,22,0,9,18,109,0, +16,10,49,0,57,18,110,0,16,10,49,0,57,22,0,0,1,0,0,0,2,3,1,0,2,13,109,0,0,1,1,0,13,110,0,0,0,1,9,18, +109,0,18,109,0,18,110,0,48,20,0,0,1,0,0,0,2,4,1,0,2,13,109,0,0,1,1,0,13,110,0,0,0,1,9,18,109,0,16, +8,48,0,57,18,110,0,16,8,48,0,57,24,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,24,0,0,1,0,0, +0,2,1,1,0,2,14,109,0,0,1,1,0,14,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,21,0,9, +18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,21,0,9,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57, +21,0,0,1,0,0,0,2,2,1,0,2,14,109,0,0,1,1,0,14,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48, +0,57,22,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,22,0,9,18,109,0,16,10,50,0,57,18,110,0, +16,10,50,0,57,22,0,0,1,0,0,0,2,3,1,0,2,14,109,0,0,1,1,0,14,110,0,0,0,1,9,18,109,0,18,109,0,18,110, +0,48,20,0,0,1,0,0,0,2,4,1,0,2,14,109,0,0,1,1,0,14,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16, +8,48,0,57,24,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,24,0,9,18,109,0,16,10,50,0,57,18, +110,0,16,10,50,0,57,24,0,0,1,0,0,0,2,1,1,0,2,15,109,0,0,1,1,0,15,110,0,0,0,1,9,18,109,0,16,8,48,0, +57,18,110,0,16,8,48,0,57,21,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,21,0,9,18,109,0,16, +10,50,0,57,18,110,0,16,10,50,0,57,21,0,9,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,21,0,0,1,0, +0,0,2,2,1,0,2,15,109,0,0,1,1,0,15,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,22,0,9, +18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,22,0,9,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57, +22,0,9,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,22,0,0,1,0,0,0,2,3,1,0,2,15,109,0,0,1,1,0,15, +110,0,0,0,1,9,18,109,0,18,109,0,18,110,0,48,20,0,0,1,0,0,0,2,4,1,0,2,15,109,0,0,1,1,0,15,110,0,0,0, +1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,24,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0, +57,24,0,9,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,24,0,9,18,109,0,16,10,51,0,57,18,110,0,16, +10,51,0,57,24,0,0,1,0,0,0,2,1,1,0,2,13,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0, +21,0,9,18,109,0,16,10,49,0,57,18,97,0,21,0,0,1,0,0,0,2,2,1,0,2,13,109,0,0,1,1,0,9,97,0,0,0,1,9,18, +109,0,16,8,48,0,57,18,97,0,22,0,9,18,109,0,16,10,49,0,57,18,97,0,22,0,0,1,0,0,0,2,3,1,0,2,13,109,0, +0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,23,0,9,18,109,0,16,10,49,0,57,18,97,0,23,0,0, +1,0,0,0,2,4,1,0,2,13,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,24,0,9,18,109,0,16, +10,49,0,57,18,97,0,24,0,0,1,0,0,0,2,1,1,0,2,14,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57, +18,97,0,21,0,9,18,109,0,16,10,49,0,57,18,97,0,21,0,9,18,109,0,16,10,50,0,57,18,97,0,21,0,0,1,0,0,0, +2,2,1,0,2,14,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,22,0,9,18,109,0,16,10,49,0, +57,18,97,0,22,0,9,18,109,0,16,10,50,0,57,18,97,0,22,0,0,1,0,0,0,2,3,1,0,2,14,109,0,0,1,1,0,9,97,0, +0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,23,0,9,18,109,0,16,10,49,0,57,18,97,0,23,0,9,18,109,0,16,10, +50,0,57,18,97,0,23,0,0,1,0,0,0,2,4,1,0,2,14,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18, +97,0,24,0,9,18,109,0,16,10,49,0,57,18,97,0,24,0,9,18,109,0,16,10,50,0,57,18,97,0,24,0,0,1,0,0,0,2, +1,1,0,2,15,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,21,0,9,18,109,0,16,10,49,0, +57,18,97,0,21,0,9,18,109,0,16,10,50,0,57,18,97,0,21,0,9,18,109,0,16,10,51,0,57,18,97,0,21,0,0,1,0, +0,0,2,2,1,0,2,15,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,22,0,9,18,109,0,16,10, +49,0,57,18,97,0,22,0,9,18,109,0,16,10,50,0,57,18,97,0,22,0,9,18,109,0,16,10,51,0,57,18,97,0,22,0,0, +1,0,0,0,2,3,1,0,2,15,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,23,0,9,18,109,0,16, +10,49,0,57,18,97,0,23,0,9,18,109,0,16,10,50,0,57,18,97,0,23,0,9,18,109,0,16,10,51,0,57,18,97,0,23, +0,0,1,0,0,0,2,4,1,0,2,15,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,24,0,9,18,109, +0,16,10,49,0,57,18,97,0,24,0,9,18,109,0,16,10,50,0,57,18,97,0,24,0,9,18,109,0,16,10,51,0,57,18,97, +0,24,0,0,1,0,0,0,2,3,1,0,2,10,118,0,0,1,1,0,13,109,0,0,0,1,9,18,118,0,18,118,0,18,109,0,48,20,0,0, +1,0,0,0,2,3,1,0,2,11,118,0,0,1,1,0,14,109,0,0,0,1,9,18,118,0,18,118,0,18,109,0,48,20,0,0,1,0,0,0,2, +3,1,0,2,12,118,0,0,1,1,0,15,109,0,0,0,1,9,18,118,0,18,118,0,18,109,0,48,20,0,0,1,0,0,5,2,25,1,0,2, +5,97,0,0,0,1,9,18,97,0,18,97,0,16,10,49,0,47,20,0,9,18,95,95,114,101,116,86,97,108,0,18,97,0,20,0, +0,1,0,0,6,2,25,1,0,2,6,118,0,0,0,1,9,18,118,0,18,118,0,58,105,118,101,99,50,0,16,10,49,0,0,0,47,20, +0,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,0,1,0,0,7,2,25,1,0,2,7,118,0,0,0,1,9,18,118,0, +18,118,0,58,105,118,101,99,51,0,16,10,49,0,0,0,47,20,0,9,18,95,95,114,101,116,86,97,108,0,18,118,0, +20,0,0,1,0,0,8,2,25,1,0,2,8,118,0,0,0,1,9,18,118,0,18,118,0,58,105,118,101,99,52,0,16,10,49,0,0,0, +47,20,0,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,0,1,0,0,9,2,25,1,0,2,9,97,0,0,0,1,9,18,97, +0,18,97,0,17,49,0,48,0,0,47,20,0,9,18,95,95,114,101,116,86,97,108,0,18,97,0,20,0,0,1,0,0,10,2,25,1, +0,2,10,118,0,0,0,1,9,18,118,0,18,118,0,58,118,101,99,50,0,17,49,0,48,0,0,0,0,47,20,0,9,18,95,95, +114,101,116,86,97,108,0,18,118,0,20,0,0,1,0,0,11,2,25,1,0,2,11,118,0,0,0,1,9,18,118,0,18,118,0,58, 118,101,99,51,0,17,49,0,48,0,0,0,0,47,20,0,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,0,1,0, -12,2,25,1,0,2,12,118,0,0,0,1,9,18,118,0,18,118,0,58,118,101,99,52,0,17,49,0,48,0,0,0,0,47,20,0,9, -18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,0,1,0,13,2,25,1,0,2,13,109,0,0,0,1,9,18,109,0,16,8, -48,0,57,18,109,0,16,8,48,0,57,58,118,101,99,50,0,17,49,0,48,0,0,0,0,47,20,0,9,18,109,0,16,10,49,0, -57,18,109,0,16,10,49,0,57,58,118,101,99,50,0,17,49,0,48,0,0,0,0,47,20,0,9,18,95,95,114,101,116,86, -97,108,0,18,109,0,20,0,0,1,0,14,2,25,1,0,2,14,109,0,0,0,1,9,18,109,0,16,8,48,0,57,18,109,0,16,8,48, -0,57,58,118,101,99,51,0,17,49,0,48,0,0,0,0,47,20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49,0,57, -58,118,101,99,51,0,17,49,0,48,0,0,0,0,47,20,0,9,18,109,0,16,10,50,0,57,18,109,0,16,10,50,0,57,58, -118,101,99,51,0,17,49,0,48,0,0,0,0,47,20,0,9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,0, -15,2,25,1,0,2,15,109,0,0,0,1,9,18,109,0,16,8,48,0,57,18,109,0,16,8,48,0,57,58,118,101,99,52,0,17, -49,0,48,0,0,0,0,47,20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49,0,57,58,118,101,99,52,0,17,49,0, -48,0,0,0,0,47,20,0,9,18,109,0,16,10,50,0,57,18,109,0,16,10,50,0,57,58,118,101,99,52,0,17,49,0,48,0, -0,0,0,47,20,0,9,18,109,0,16,10,51,0,57,18,109,0,16,10,51,0,57,58,118,101,99,52,0,17,49,0,48,0,0,0, -0,47,20,0,9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,0,5,2,24,1,0,2,5,97,0,0,0,1,9,18,97, -0,18,97,0,16,10,49,0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,18,97,0,20,0,0,1,0,6,2,24,1,0,2,6, -118,0,0,0,1,9,18,118,0,18,118,0,58,105,118,101,99,50,0,16,10,49,0,0,0,46,20,0,9,18,95,95,114,101, -116,86,97,108,0,18,118,0,20,0,0,1,0,7,2,24,1,0,2,7,118,0,0,0,1,9,18,118,0,18,118,0,58,105,118,101, -99,51,0,16,10,49,0,0,0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,0,1,0,8,2,24,1,0,2, -8,118,0,0,0,1,9,18,118,0,18,118,0,58,105,118,101,99,52,0,16,10,49,0,0,0,46,20,0,9,18,95,95,114,101, -116,86,97,108,0,18,118,0,20,0,0,1,0,9,2,24,1,0,2,9,97,0,0,0,1,9,18,97,0,18,97,0,17,49,0,48,0,0,46, -20,0,9,18,95,95,114,101,116,86,97,108,0,18,97,0,20,0,0,1,0,10,2,24,1,0,2,10,118,0,0,0,1,9,18,118,0, -18,118,0,58,118,101,99,50,0,17,49,0,48,0,0,0,0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,18,118,0, -20,0,0,1,0,11,2,24,1,0,2,11,118,0,0,0,1,9,18,118,0,18,118,0,58,118,101,99,51,0,17,49,0,48,0,0,0,0, -46,20,0,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,0,1,0,12,2,24,1,0,2,12,118,0,0,0,1,9,18, -118,0,18,118,0,58,118,101,99,52,0,17,49,0,48,0,0,0,0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,18, -118,0,20,0,0,1,0,13,2,24,1,0,2,13,109,0,0,0,1,9,18,109,0,16,8,48,0,57,18,109,0,16,8,48,0,57,58,118, -101,99,50,0,17,49,0,48,0,0,0,0,46,20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49,0,57,58,118,101, -99,50,0,17,49,0,48,0,0,0,0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,0,14,2,24, -1,0,2,14,109,0,0,0,1,9,18,109,0,16,8,48,0,57,18,109,0,16,8,48,0,57,58,118,101,99,51,0,17,49,0,48,0, -0,0,0,46,20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49,0,57,58,118,101,99,51,0,17,49,0,48,0,0,0, -0,46,20,0,9,18,109,0,16,10,50,0,57,18,109,0,16,10,50,0,57,58,118,101,99,51,0,17,49,0,48,0,0,0,0,46, -20,0,9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,0,15,2,24,1,0,2,15,109,0,0,0,1,9,18,109, -0,16,8,48,0,57,18,109,0,16,8,48,0,57,58,118,101,99,52,0,17,49,0,48,0,0,0,0,46,20,0,9,18,109,0,16, -10,49,0,57,18,109,0,16,10,49,0,57,58,118,101,99,52,0,17,49,0,48,0,0,0,0,46,20,0,9,18,109,0,16,10, -50,0,57,18,109,0,16,10,50,0,57,58,118,101,99,52,0,17,49,0,48,0,0,0,0,46,20,0,9,18,109,0,16,10,51,0, -57,18,109,0,16,10,51,0,57,58,118,101,99,52,0,17,49,0,48,0,0,0,0,46,20,0,9,18,95,95,114,101,116,86, -97,108,0,18,109,0,20,0,0,1,0,5,0,95,95,112,111,115,116,68,101,99,114,0,1,0,2,5,97,0,0,0,1,9,18,95, -95,114,101,116,86,97,108,0,18,97,0,20,0,9,18,97,0,18,97,0,16,10,49,0,47,20,0,0,1,0,6,0,95,95,112, -111,115,116,68,101,99,114,0,1,0,2,6,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,9, -18,118,0,18,118,0,58,105,118,101,99,50,0,16,10,49,0,0,0,47,20,0,0,1,0,7,0,95,95,112,111,115,116,68, -101,99,114,0,1,0,2,7,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,9,18,118,0,18, -118,0,58,105,118,101,99,51,0,16,10,49,0,0,0,47,20,0,0,1,0,8,0,95,95,112,111,115,116,68,101,99,114, -0,1,0,2,8,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,9,18,118,0,18,118,0,58,105, -118,101,99,52,0,16,10,49,0,0,0,47,20,0,0,1,0,9,0,95,95,112,111,115,116,68,101,99,114,0,1,0,2,9,97, -0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,97,0,20,0,9,18,97,0,18,97,0,17,49,0,48,0,0,47,20,0,0, -1,0,10,0,95,95,112,111,115,116,68,101,99,114,0,1,0,2,10,118,0,0,0,1,9,18,95,95,114,101,116,86,97, -108,0,18,118,0,20,0,9,18,118,0,18,118,0,58,118,101,99,50,0,17,49,0,48,0,0,0,0,47,20,0,0,1,0,11,0, -95,95,112,111,115,116,68,101,99,114,0,1,0,2,11,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18, -118,0,20,0,9,18,118,0,18,118,0,58,118,101,99,51,0,17,49,0,48,0,0,0,0,47,20,0,0,1,0,12,0,95,95,112, -111,115,116,68,101,99,114,0,1,0,2,12,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0, -9,18,118,0,18,118,0,58,118,101,99,52,0,17,49,0,48,0,0,0,0,47,20,0,0,1,0,13,0,95,95,112,111,115,116, -68,101,99,114,0,1,0,2,13,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,9,18,109,0, -16,8,48,0,57,18,109,0,16,8,48,0,57,58,118,101,99,50,0,17,49,0,48,0,0,0,0,47,20,0,9,18,109,0,16,10, -49,0,57,18,109,0,16,10,49,0,57,58,118,101,99,50,0,17,49,0,48,0,0,0,0,47,20,0,0,1,0,14,0,95,95,112, -111,115,116,68,101,99,114,0,1,0,2,14,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0, -9,18,109,0,16,8,48,0,57,18,109,0,16,8,48,0,57,58,118,101,99,51,0,17,49,0,48,0,0,0,0,47,20,0,9,18, -109,0,16,10,49,0,57,18,109,0,16,10,49,0,57,58,118,101,99,51,0,17,49,0,48,0,0,0,0,47,20,0,9,18,109, -0,16,10,50,0,57,18,109,0,16,10,50,0,57,58,118,101,99,51,0,17,49,0,48,0,0,0,0,47,20,0,0,1,0,15,0,95, -95,112,111,115,116,68,101,99,114,0,1,0,2,15,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,109, -0,20,0,9,18,109,0,16,8,48,0,57,18,109,0,16,8,48,0,57,58,118,101,99,52,0,17,49,0,48,0,0,0,0,47,20,0, -9,18,109,0,16,10,49,0,57,18,109,0,16,10,49,0,57,58,118,101,99,52,0,17,49,0,48,0,0,0,0,47,20,0,9,18, -109,0,16,10,50,0,57,18,109,0,16,10,50,0,57,58,118,101,99,52,0,17,49,0,48,0,0,0,0,47,20,0,9,18,109, -0,16,10,51,0,57,18,109,0,16,10,51,0,57,58,118,101,99,52,0,17,49,0,48,0,0,0,0,47,20,0,0,1,0,9,0,95, -95,112,111,115,116,73,110,99,114,0,1,0,2,9,97,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,97,0, -20,0,9,18,97,0,18,97,0,16,10,49,0,46,20,0,0,1,0,10,0,95,95,112,111,115,116,73,110,99,114,0,1,0,2, -10,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,9,18,118,0,18,118,0,58,118,101,99, -50,0,17,49,0,48,0,0,0,0,46,20,0,0,1,0,11,0,95,95,112,111,115,116,73,110,99,114,0,1,0,2,11,118,0,0, -0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,9,18,118,0,18,118,0,58,118,101,99,51,0,17,49, -0,48,0,0,0,0,46,20,0,0,1,0,12,0,95,95,112,111,115,116,73,110,99,114,0,1,0,2,12,118,0,0,0,1,9,18,95, +0,12,2,25,1,0,2,12,118,0,0,0,1,9,18,118,0,18,118,0,58,118,101,99,52,0,17,49,0,48,0,0,0,0,47,20,0,9, +18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,0,1,0,0,13,2,25,1,0,2,13,109,0,0,0,1,9,18,109,0,16, +8,48,0,57,18,109,0,16,8,48,0,57,58,118,101,99,50,0,17,49,0,48,0,0,0,0,47,20,0,9,18,109,0,16,10,49, +0,57,18,109,0,16,10,49,0,57,58,118,101,99,50,0,17,49,0,48,0,0,0,0,47,20,0,9,18,95,95,114,101,116, +86,97,108,0,18,109,0,20,0,0,1,0,0,14,2,25,1,0,2,14,109,0,0,0,1,9,18,109,0,16,8,48,0,57,18,109,0,16, +8,48,0,57,58,118,101,99,51,0,17,49,0,48,0,0,0,0,47,20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49, +0,57,58,118,101,99,51,0,17,49,0,48,0,0,0,0,47,20,0,9,18,109,0,16,10,50,0,57,18,109,0,16,10,50,0,57, +58,118,101,99,51,0,17,49,0,48,0,0,0,0,47,20,0,9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,0,1, +0,0,15,2,25,1,0,2,15,109,0,0,0,1,9,18,109,0,16,8,48,0,57,18,109,0,16,8,48,0,57,58,118,101,99,52,0, +17,49,0,48,0,0,0,0,47,20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49,0,57,58,118,101,99,52,0,17, +49,0,48,0,0,0,0,47,20,0,9,18,109,0,16,10,50,0,57,18,109,0,16,10,50,0,57,58,118,101,99,52,0,17,49,0, +48,0,0,0,0,47,20,0,9,18,109,0,16,10,51,0,57,18,109,0,16,10,51,0,57,58,118,101,99,52,0,17,49,0,48,0, +0,0,0,47,20,0,9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,0,0,5,2,24,1,0,2,5,97,0,0,0,1,9, +18,97,0,18,97,0,16,10,49,0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,18,97,0,20,0,0,1,0,0,6,2,24, +1,0,2,6,118,0,0,0,1,9,18,118,0,18,118,0,58,105,118,101,99,50,0,16,10,49,0,0,0,46,20,0,9,18,95,95, +114,101,116,86,97,108,0,18,118,0,20,0,0,1,0,0,7,2,24,1,0,2,7,118,0,0,0,1,9,18,118,0,18,118,0,58, +105,118,101,99,51,0,16,10,49,0,0,0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,0,1,0, +0,8,2,24,1,0,2,8,118,0,0,0,1,9,18,118,0,18,118,0,58,105,118,101,99,52,0,16,10,49,0,0,0,46,20,0,9, +18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,0,1,0,0,9,2,24,1,0,2,9,97,0,0,0,1,9,18,97,0,18,97,0, +17,49,0,48,0,0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,18,97,0,20,0,0,1,0,0,10,2,24,1,0,2,10, +118,0,0,0,1,9,18,118,0,18,118,0,58,118,101,99,50,0,17,49,0,48,0,0,0,0,46,20,0,9,18,95,95,114,101, +116,86,97,108,0,18,118,0,20,0,0,1,0,0,11,2,24,1,0,2,11,118,0,0,0,1,9,18,118,0,18,118,0,58,118,101, +99,51,0,17,49,0,48,0,0,0,0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,0,1,0,0,12,2, +24,1,0,2,12,118,0,0,0,1,9,18,118,0,18,118,0,58,118,101,99,52,0,17,49,0,48,0,0,0,0,46,20,0,9,18,95, +95,114,101,116,86,97,108,0,18,118,0,20,0,0,1,0,0,13,2,24,1,0,2,13,109,0,0,0,1,9,18,109,0,16,8,48,0, +57,18,109,0,16,8,48,0,57,58,118,101,99,50,0,17,49,0,48,0,0,0,0,46,20,0,9,18,109,0,16,10,49,0,57,18, +109,0,16,10,49,0,57,58,118,101,99,50,0,17,49,0,48,0,0,0,0,46,20,0,9,18,95,95,114,101,116,86,97,108, +0,18,109,0,20,0,0,1,0,0,14,2,24,1,0,2,14,109,0,0,0,1,9,18,109,0,16,8,48,0,57,18,109,0,16,8,48,0,57, +58,118,101,99,51,0,17,49,0,48,0,0,0,0,46,20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49,0,57,58, +118,101,99,51,0,17,49,0,48,0,0,0,0,46,20,0,9,18,109,0,16,10,50,0,57,18,109,0,16,10,50,0,57,58,118, +101,99,51,0,17,49,0,48,0,0,0,0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,0,0,15, +2,24,1,0,2,15,109,0,0,0,1,9,18,109,0,16,8,48,0,57,18,109,0,16,8,48,0,57,58,118,101,99,52,0,17,49,0, +48,0,0,0,0,46,20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49,0,57,58,118,101,99,52,0,17,49,0,48,0, +0,0,0,46,20,0,9,18,109,0,16,10,50,0,57,18,109,0,16,10,50,0,57,58,118,101,99,52,0,17,49,0,48,0,0,0, +0,46,20,0,9,18,109,0,16,10,51,0,57,18,109,0,16,10,51,0,57,58,118,101,99,52,0,17,49,0,48,0,0,0,0,46, +20,0,9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,0,0,5,0,95,95,112,111,115,116,68,101,99, +114,0,1,0,2,5,97,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,97,0,20,0,9,18,97,0,18,97,0,16,10, +49,0,47,20,0,0,1,0,0,6,0,95,95,112,111,115,116,68,101,99,114,0,1,0,2,6,118,0,0,0,1,9,18,95,95,114, +101,116,86,97,108,0,18,118,0,20,0,9,18,118,0,18,118,0,58,105,118,101,99,50,0,16,10,49,0,0,0,47,20, +0,0,1,0,0,7,0,95,95,112,111,115,116,68,101,99,114,0,1,0,2,7,118,0,0,0,1,9,18,95,95,114,101,116,86, +97,108,0,18,118,0,20,0,9,18,118,0,18,118,0,58,105,118,101,99,51,0,16,10,49,0,0,0,47,20,0,0,1,0,0,8, +0,95,95,112,111,115,116,68,101,99,114,0,1,0,2,8,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18, +118,0,20,0,9,18,118,0,18,118,0,58,105,118,101,99,52,0,16,10,49,0,0,0,47,20,0,0,1,0,0,9,0,95,95,112, +111,115,116,68,101,99,114,0,1,0,2,9,97,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,97,0,20,0,9, +18,97,0,18,97,0,17,49,0,48,0,0,47,20,0,0,1,0,0,10,0,95,95,112,111,115,116,68,101,99,114,0,1,0,2,10, +118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,9,18,118,0,18,118,0,58,118,101,99,50, +0,17,49,0,48,0,0,0,0,47,20,0,0,1,0,0,11,0,95,95,112,111,115,116,68,101,99,114,0,1,0,2,11,118,0,0,0, +1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,9,18,118,0,18,118,0,58,118,101,99,51,0,17,49,0, +48,0,0,0,0,47,20,0,0,1,0,0,12,0,95,95,112,111,115,116,68,101,99,114,0,1,0,2,12,118,0,0,0,1,9,18,95, 95,114,101,116,86,97,108,0,18,118,0,20,0,9,18,118,0,18,118,0,58,118,101,99,52,0,17,49,0,48,0,0,0,0, -46,20,0,0,1,0,5,0,95,95,112,111,115,116,73,110,99,114,0,1,0,2,5,97,0,0,0,1,9,18,95,95,114,101,116, -86,97,108,0,18,97,0,20,0,9,18,97,0,18,97,0,16,10,49,0,46,20,0,0,1,0,6,0,95,95,112,111,115,116,73, -110,99,114,0,1,0,2,6,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,9,18,118,0,18, -118,0,58,105,118,101,99,50,0,16,10,49,0,0,0,46,20,0,0,1,0,7,0,95,95,112,111,115,116,73,110,99,114, -0,1,0,2,7,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,9,18,118,0,18,118,0,58,105, -118,101,99,51,0,16,10,49,0,0,0,46,20,0,0,1,0,8,0,95,95,112,111,115,116,73,110,99,114,0,1,0,2,8,118, -0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,9,18,118,0,18,118,0,58,105,118,101,99,51, -0,16,10,49,0,0,0,46,20,0,0,1,0,13,0,95,95,112,111,115,116,73,110,99,114,0,1,0,2,13,109,0,0,0,1,3,2, -0,13,1,110,0,2,18,109,0,0,0,9,18,109,0,16,8,48,0,57,18,109,0,16,8,48,0,57,58,118,101,99,50,0,17,49, -0,48,0,0,0,0,46,20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49,0,57,58,118,101,99,50,0,17,49,0,48, -0,0,0,0,46,20,0,8,18,110,0,0,0,1,0,14,0,95,95,112,111,115,116,73,110,99,114,0,1,0,2,14,109,0,0,0,1, -3,2,0,14,1,110,0,2,18,109,0,0,0,9,18,109,0,16,8,48,0,57,18,109,0,16,8,48,0,57,58,118,101,99,51,0, -17,49,0,48,0,0,0,0,46,20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49,0,57,58,118,101,99,51,0,17, -49,0,48,0,0,0,0,46,20,0,9,18,109,0,16,10,50,0,57,18,109,0,16,10,50,0,57,58,118,101,99,51,0,17,49,0, -48,0,0,0,0,46,20,0,8,18,110,0,0,0,1,0,15,0,95,95,112,111,115,116,73,110,99,114,0,1,0,2,15,109,0,0, -0,1,3,2,0,15,1,110,0,2,18,109,0,0,0,9,18,109,0,16,8,48,0,57,18,109,0,16,8,48,0,57,58,118,101,99,52, -0,17,49,0,48,0,0,0,0,46,20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49,0,57,58,118,101,99,52,0,17, -49,0,48,0,0,0,0,46,20,0,9,18,109,0,16,10,50,0,57,18,109,0,16,10,50,0,57,58,118,101,99,52,0,17,49,0, -48,0,0,0,0,46,20,0,9,18,109,0,16,10,51,0,57,18,109,0,16,10,51,0,57,58,118,101,99,52,0,17,49,0,48,0, -0,0,0,46,20,0,8,18,110,0,0,0,1,0,1,2,15,1,1,0,9,97,0,0,1,1,0,9,98,0,0,0,1,4,118,101,99,52,95,115, -103,116,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,98,0,0,18,97,0,0,0,0,1,0,1,2,15,1,1,0,5, -97,0,0,1,1,0,5,98,0,0,0,1,8,58,102,108,111,97,116,0,18,97,0,0,0,58,102,108,111,97,116,0,18,98,0,0, -0,40,0,0,1,0,1,2,16,1,1,0,9,97,0,0,1,1,0,9,98,0,0,0,1,3,2,0,1,1,99,0,0,0,4,102,108,111,97,116,95, -108,101,115,115,0,18,99,0,0,18,98,0,0,18,97,0,0,0,8,18,99,0,0,0,1,0,1,2,16,1,1,0,5,97,0,0,1,1,0,5, -98,0,0,0,1,8,58,102,108,111,97,116,0,18,97,0,0,0,58,102,108,111,97,116,0,18,98,0,0,0,41,0,0,1,0,1, -2,18,1,1,0,9,97,0,0,1,1,0,9,98,0,0,0,1,3,2,0,1,1,103,0,0,1,1,101,0,0,0,4,102,108,111,97,116,95,108, -101,115,115,0,18,103,0,0,18,98,0,0,18,97,0,0,0,4,102,108,111,97,116,95,101,113,117,97,108,0,18,101, -0,0,18,97,0,0,18,98,0,0,0,8,18,103,0,18,101,0,32,0,0,1,0,1,2,18,1,1,0,5,97,0,0,1,1,0,5,98,0,0,0,1, -8,58,102,108,111,97,116,0,18,97,0,0,0,58,102,108,111,97,116,0,18,98,0,0,0,43,0,0,1,0,1,2,17,1,1,0, -9,97,0,0,1,1,0,9,98,0,0,0,1,3,2,0,1,1,103,0,0,1,1,101,0,0,0,4,102,108,111,97,116,95,108,101,115, +47,20,0,0,1,0,0,13,0,95,95,112,111,115,116,68,101,99,114,0,1,0,2,13,109,0,0,0,1,9,18,95,95,114,101, +116,86,97,108,0,18,109,0,20,0,9,18,109,0,16,8,48,0,57,18,109,0,16,8,48,0,57,58,118,101,99,50,0,17, +49,0,48,0,0,0,0,47,20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49,0,57,58,118,101,99,50,0,17,49,0, +48,0,0,0,0,47,20,0,0,1,0,0,14,0,95,95,112,111,115,116,68,101,99,114,0,1,0,2,14,109,0,0,0,1,9,18,95, +95,114,101,116,86,97,108,0,18,109,0,20,0,9,18,109,0,16,8,48,0,57,18,109,0,16,8,48,0,57,58,118,101, +99,51,0,17,49,0,48,0,0,0,0,47,20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49,0,57,58,118,101,99, +51,0,17,49,0,48,0,0,0,0,47,20,0,9,18,109,0,16,10,50,0,57,18,109,0,16,10,50,0,57,58,118,101,99,51,0, +17,49,0,48,0,0,0,0,47,20,0,0,1,0,0,15,0,95,95,112,111,115,116,68,101,99,114,0,1,0,2,15,109,0,0,0,1, +9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,9,18,109,0,16,8,48,0,57,18,109,0,16,8,48,0,57,58, +118,101,99,52,0,17,49,0,48,0,0,0,0,47,20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49,0,57,58,118, +101,99,52,0,17,49,0,48,0,0,0,0,47,20,0,9,18,109,0,16,10,50,0,57,18,109,0,16,10,50,0,57,58,118,101, +99,52,0,17,49,0,48,0,0,0,0,47,20,0,9,18,109,0,16,10,51,0,57,18,109,0,16,10,51,0,57,58,118,101,99, +52,0,17,49,0,48,0,0,0,0,47,20,0,0,1,0,0,9,0,95,95,112,111,115,116,73,110,99,114,0,1,0,2,9,97,0,0,0, +1,9,18,95,95,114,101,116,86,97,108,0,18,97,0,20,0,9,18,97,0,18,97,0,16,10,49,0,46,20,0,0,1,0,0,10, +0,95,95,112,111,115,116,73,110,99,114,0,1,0,2,10,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18, +118,0,20,0,9,18,118,0,18,118,0,58,118,101,99,50,0,17,49,0,48,0,0,0,0,46,20,0,0,1,0,0,11,0,95,95, +112,111,115,116,73,110,99,114,0,1,0,2,11,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0, +20,0,9,18,118,0,18,118,0,58,118,101,99,51,0,17,49,0,48,0,0,0,0,46,20,0,0,1,0,0,12,0,95,95,112,111, +115,116,73,110,99,114,0,1,0,2,12,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,9,18, +118,0,18,118,0,58,118,101,99,52,0,17,49,0,48,0,0,0,0,46,20,0,0,1,0,0,5,0,95,95,112,111,115,116,73, +110,99,114,0,1,0,2,5,97,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,97,0,20,0,9,18,97,0,18,97,0, +16,10,49,0,46,20,0,0,1,0,0,6,0,95,95,112,111,115,116,73,110,99,114,0,1,0,2,6,118,0,0,0,1,9,18,95, +95,114,101,116,86,97,108,0,18,118,0,20,0,9,18,118,0,18,118,0,58,105,118,101,99,50,0,16,10,49,0,0,0, +46,20,0,0,1,0,0,7,0,95,95,112,111,115,116,73,110,99,114,0,1,0,2,7,118,0,0,0,1,9,18,95,95,114,101, +116,86,97,108,0,18,118,0,20,0,9,18,118,0,18,118,0,58,105,118,101,99,51,0,16,10,49,0,0,0,46,20,0,0, +1,0,0,8,0,95,95,112,111,115,116,73,110,99,114,0,1,0,2,8,118,0,0,0,1,9,18,95,95,114,101,116,86,97, +108,0,18,118,0,20,0,9,18,118,0,18,118,0,58,105,118,101,99,51,0,16,10,49,0,0,0,46,20,0,0,1,0,0,13,0, +95,95,112,111,115,116,73,110,99,114,0,1,0,2,13,109,0,0,0,1,3,2,0,0,13,1,110,0,2,18,109,0,0,0,9,18, +109,0,16,8,48,0,57,18,109,0,16,8,48,0,57,58,118,101,99,50,0,17,49,0,48,0,0,0,0,46,20,0,9,18,109,0, +16,10,49,0,57,18,109,0,16,10,49,0,57,58,118,101,99,50,0,17,49,0,48,0,0,0,0,46,20,0,8,18,110,0,0,0, +1,0,0,14,0,95,95,112,111,115,116,73,110,99,114,0,1,0,2,14,109,0,0,0,1,3,2,0,0,14,1,110,0,2,18,109, +0,0,0,9,18,109,0,16,8,48,0,57,18,109,0,16,8,48,0,57,58,118,101,99,51,0,17,49,0,48,0,0,0,0,46,20,0, +9,18,109,0,16,10,49,0,57,18,109,0,16,10,49,0,57,58,118,101,99,51,0,17,49,0,48,0,0,0,0,46,20,0,9,18, +109,0,16,10,50,0,57,18,109,0,16,10,50,0,57,58,118,101,99,51,0,17,49,0,48,0,0,0,0,46,20,0,8,18,110, +0,0,0,1,0,0,15,0,95,95,112,111,115,116,73,110,99,114,0,1,0,2,15,109,0,0,0,1,3,2,0,0,15,1,110,0,2, +18,109,0,0,0,9,18,109,0,16,8,48,0,57,18,109,0,16,8,48,0,57,58,118,101,99,52,0,17,49,0,48,0,0,0,0, +46,20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49,0,57,58,118,101,99,52,0,17,49,0,48,0,0,0,0,46, +20,0,9,18,109,0,16,10,50,0,57,18,109,0,16,10,50,0,57,58,118,101,99,52,0,17,49,0,48,0,0,0,0,46,20,0, +9,18,109,0,16,10,51,0,57,18,109,0,16,10,51,0,57,58,118,101,99,52,0,17,49,0,48,0,0,0,0,46,20,0,8,18, +110,0,0,0,1,0,0,1,2,15,1,1,0,9,97,0,0,1,1,0,9,98,0,0,0,1,4,118,101,99,52,95,115,103,116,0,18,95,95, +114,101,116,86,97,108,0,59,120,0,0,18,98,0,0,18,97,0,0,0,0,1,0,0,1,2,15,1,1,0,5,97,0,0,1,1,0,5,98, +0,0,0,1,8,58,102,108,111,97,116,0,18,97,0,0,0,58,102,108,111,97,116,0,18,98,0,0,0,40,0,0,1,0,0,1,2, +16,1,1,0,9,97,0,0,1,1,0,9,98,0,0,0,1,3,2,0,0,1,1,99,0,0,0,4,102,108,111,97,116,95,108,101,115,115, +0,18,99,0,0,18,98,0,0,18,97,0,0,0,8,18,99,0,0,0,1,0,0,1,2,16,1,1,0,5,97,0,0,1,1,0,5,98,0,0,0,1,8, +58,102,108,111,97,116,0,18,97,0,0,0,58,102,108,111,97,116,0,18,98,0,0,0,41,0,0,1,0,0,1,2,18,1,1,0, +9,97,0,0,1,1,0,9,98,0,0,0,1,3,2,0,0,1,1,103,0,0,1,1,101,0,0,0,4,102,108,111,97,116,95,108,101,115, +115,0,18,103,0,0,18,98,0,0,18,97,0,0,0,4,102,108,111,97,116,95,101,113,117,97,108,0,18,101,0,0,18, +97,0,0,18,98,0,0,0,8,18,103,0,18,101,0,32,0,0,1,0,0,1,2,18,1,1,0,5,97,0,0,1,1,0,5,98,0,0,0,1,8,58, +102,108,111,97,116,0,18,97,0,0,0,58,102,108,111,97,116,0,18,98,0,0,0,43,0,0,1,0,0,1,2,17,1,1,0,9, +97,0,0,1,1,0,9,98,0,0,0,1,3,2,0,0,1,1,103,0,0,1,1,101,0,0,0,4,102,108,111,97,116,95,108,101,115, 115,0,18,103,0,0,18,97,0,0,18,98,0,0,0,4,102,108,111,97,116,95,101,113,117,97,108,0,18,101,0,0,18, -97,0,0,18,98,0,0,0,8,18,103,0,18,101,0,32,0,0,1,0,1,2,17,1,1,0,5,97,0,0,1,1,0,5,98,0,0,0,1,8,58, -102,108,111,97,116,0,18,97,0,0,0,58,102,108,111,97,116,0,18,98,0,0,0,42,0,0,1,0,0,0,112,114,105, +97,0,0,18,98,0,0,0,8,18,103,0,18,101,0,32,0,0,1,0,0,1,2,17,1,1,0,5,97,0,0,1,1,0,5,98,0,0,0,1,8,58, +102,108,111,97,116,0,18,97,0,0,0,58,102,108,111,97,116,0,18,98,0,0,0,42,0,0,1,0,0,0,0,112,114,105, 110,116,77,69,83,65,0,1,1,0,9,102,0,0,0,1,4,102,108,111,97,116,95,112,114,105,110,116,0,18,102,0,0, -0,0,1,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,5,105,0,0,0,1,4,105,110,116,95,112,114,105,110, -116,0,18,105,0,0,0,0,1,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,1,98,0,0,0,1,4,98,111,111,108, -95,112,114,105,110,116,0,18,98,0,0,0,0,1,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,10,118,0,0, -0,1,9,58,112,114,105,110,116,77,69,83,65,0,18,118,0,59,120,0,0,0,0,9,58,112,114,105,110,116,77,69, -83,65,0,18,118,0,59,121,0,0,0,0,0,1,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,11,118,0,0,0,1,9, +0,0,1,0,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,5,105,0,0,0,1,4,105,110,116,95,112,114,105, +110,116,0,18,105,0,0,0,0,1,0,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,1,98,0,0,0,1,4,98,111, +111,108,95,112,114,105,110,116,0,18,98,0,0,0,0,1,0,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0, +10,118,0,0,0,1,9,58,112,114,105,110,116,77,69,83,65,0,18,118,0,59,120,0,0,0,0,9,58,112,114,105,110, +116,77,69,83,65,0,18,118,0,59,121,0,0,0,0,0,1,0,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,11, +118,0,0,0,1,9,58,112,114,105,110,116,77,69,83,65,0,18,118,0,59,120,0,0,0,0,9,58,112,114,105,110, +116,77,69,83,65,0,18,118,0,59,121,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,18,118,0,59,122,0, +0,0,0,0,1,0,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,12,118,0,0,0,1,9,58,112,114,105,110,116, +77,69,83,65,0,18,118,0,59,120,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,18,118,0,59,121,0,0,0, +0,9,58,112,114,105,110,116,77,69,83,65,0,18,118,0,59,122,0,0,0,0,9,58,112,114,105,110,116,77,69,83, +65,0,18,118,0,59,119,0,0,0,0,0,1,0,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,6,118,0,0,0,1,9, 58,112,114,105,110,116,77,69,83,65,0,18,118,0,59,120,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65, -0,18,118,0,59,121,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,18,118,0,59,122,0,0,0,0,0,1,0,0,0, -112,114,105,110,116,77,69,83,65,0,1,1,0,12,118,0,0,0,1,9,58,112,114,105,110,116,77,69,83,65,0,18, +0,18,118,0,59,121,0,0,0,0,0,1,0,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,7,118,0,0,0,1,9,58, +112,114,105,110,116,77,69,83,65,0,18,118,0,59,120,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0, +18,118,0,59,121,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,18,118,0,59,122,0,0,0,0,0,1,0,0,0,0, +112,114,105,110,116,77,69,83,65,0,1,1,0,8,118,0,0,0,1,9,58,112,114,105,110,116,77,69,83,65,0,18, 118,0,59,120,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,18,118,0,59,121,0,0,0,0,9,58,112,114, 105,110,116,77,69,83,65,0,18,118,0,59,122,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,18,118,0, -59,119,0,0,0,0,0,1,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,6,118,0,0,0,1,9,58,112,114,105, +59,119,0,0,0,0,0,1,0,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,2,118,0,0,0,1,9,58,112,114,105, 110,116,77,69,83,65,0,18,118,0,59,120,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,18,118,0,59, -121,0,0,0,0,0,1,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,7,118,0,0,0,1,9,58,112,114,105,110, +121,0,0,0,0,0,1,0,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,3,118,0,0,0,1,9,58,112,114,105,110, 116,77,69,83,65,0,18,118,0,59,120,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,18,118,0,59,121,0, -0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,18,118,0,59,122,0,0,0,0,0,1,0,0,0,112,114,105,110,116, -77,69,83,65,0,1,1,0,8,118,0,0,0,1,9,58,112,114,105,110,116,77,69,83,65,0,18,118,0,59,120,0,0,0,0,9, -58,112,114,105,110,116,77,69,83,65,0,18,118,0,59,121,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65, -0,18,118,0,59,122,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,18,118,0,59,119,0,0,0,0,0,1,0,0,0, -112,114,105,110,116,77,69,83,65,0,1,1,0,2,118,0,0,0,1,9,58,112,114,105,110,116,77,69,83,65,0,18, -118,0,59,120,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,18,118,0,59,121,0,0,0,0,0,1,0,0,0,112, -114,105,110,116,77,69,83,65,0,1,1,0,3,118,0,0,0,1,9,58,112,114,105,110,116,77,69,83,65,0,18,118,0, -59,120,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,18,118,0,59,121,0,0,0,0,9,58,112,114,105,110, -116,77,69,83,65,0,18,118,0,59,122,0,0,0,0,0,1,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,4,118, -0,0,0,1,9,58,112,114,105,110,116,77,69,83,65,0,18,118,0,59,120,0,0,0,0,9,58,112,114,105,110,116,77, -69,83,65,0,18,118,0,59,121,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,18,118,0,59,122,0,0,0,0, -9,58,112,114,105,110,116,77,69,83,65,0,18,118,0,59,119,0,0,0,0,0,1,0,0,0,112,114,105,110,116,77,69, -83,65,0,1,1,0,13,109,0,0,0,1,9,58,112,114,105,110,116,77,69,83,65,0,18,109,0,16,8,48,0,57,0,0,0,9, -58,112,114,105,110,116,77,69,83,65,0,18,109,0,16,10,49,0,57,0,0,0,0,1,0,0,0,112,114,105,110,116,77, -69,83,65,0,1,1,0,14,109,0,0,0,1,9,58,112,114,105,110,116,77,69,83,65,0,18,109,0,16,8,48,0,57,0,0,0, -9,58,112,114,105,110,116,77,69,83,65,0,18,109,0,16,10,49,0,57,0,0,0,9,58,112,114,105,110,116,77,69, -83,65,0,18,109,0,16,10,50,0,57,0,0,0,0,1,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,15,109,0,0, -0,1,9,58,112,114,105,110,116,77,69,83,65,0,18,109,0,16,8,48,0,57,0,0,0,9,58,112,114,105,110,116,77, -69,83,65,0,18,109,0,16,10,49,0,57,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,18,109,0,16,10,50,0, -57,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,18,109,0,16,10,51,0,57,0,0,0,0,1,0,0,0,112,114,105, -110,116,77,69,83,65,0,1,1,0,16,101,0,0,0,1,4,105,110,116,95,112,114,105,110,116,0,18,101,0,0,0,0,1, -0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,17,101,0,0,0,1,4,105,110,116,95,112,114,105,110,116, -0,18,101,0,0,0,0,1,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,18,101,0,0,0,1,4,105,110,116,95, -112,114,105,110,116,0,18,101,0,0,0,0,1,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,19,101,0,0,0, -1,4,105,110,116,95,112,114,105,110,116,0,18,101,0,0,0,0,1,0,0,0,112,114,105,110,116,77,69,83,65,0, -1,1,0,20,101,0,0,0,1,4,105,110,116,95,112,114,105,110,116,0,18,101,0,0,0,0,1,0,0,0,112,114,105,110, -116,77,69,83,65,0,1,1,0,21,101,0,0,0,1,4,105,110,116,95,112,114,105,110,116,0,18,101,0,0,0,0,0 +0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,18,118,0,59,122,0,0,0,0,0,1,0,0,0,0,112,114,105,110, +116,77,69,83,65,0,1,1,0,4,118,0,0,0,1,9,58,112,114,105,110,116,77,69,83,65,0,18,118,0,59,120,0,0,0, +0,9,58,112,114,105,110,116,77,69,83,65,0,18,118,0,59,121,0,0,0,0,9,58,112,114,105,110,116,77,69,83, +65,0,18,118,0,59,122,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,18,118,0,59,119,0,0,0,0,0,1,0, +0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,13,109,0,0,0,1,9,58,112,114,105,110,116,77,69,83,65, +0,18,109,0,16,8,48,0,57,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,18,109,0,16,10,49,0,57,0,0,0, +0,1,0,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,14,109,0,0,0,1,9,58,112,114,105,110,116,77,69, +83,65,0,18,109,0,16,8,48,0,57,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,18,109,0,16,10,49,0,57, +0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,18,109,0,16,10,50,0,57,0,0,0,0,1,0,0,0,0,112,114,105, +110,116,77,69,83,65,0,1,1,0,15,109,0,0,0,1,9,58,112,114,105,110,116,77,69,83,65,0,18,109,0,16,8,48, +0,57,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,18,109,0,16,10,49,0,57,0,0,0,9,58,112,114,105, +110,116,77,69,83,65,0,18,109,0,16,10,50,0,57,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,18,109,0, +16,10,51,0,57,0,0,0,0,1,0,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,16,101,0,0,0,1,4,105,110, +116,95,112,114,105,110,116,0,18,101,0,0,0,0,1,0,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,17, +101,0,0,0,1,4,105,110,116,95,112,114,105,110,116,0,18,101,0,0,0,0,1,0,0,0,0,112,114,105,110,116,77, +69,83,65,0,1,1,0,18,101,0,0,0,1,4,105,110,116,95,112,114,105,110,116,0,18,101,0,0,0,0,1,0,0,0,0, +112,114,105,110,116,77,69,83,65,0,1,1,0,19,101,0,0,0,1,4,105,110,116,95,112,114,105,110,116,0,18, +101,0,0,0,0,1,0,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,20,101,0,0,0,1,4,105,110,116,95,112, +114,105,110,116,0,18,101,0,0,0,0,1,0,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,21,101,0,0,0,1, +4,105,110,116,95,112,114,105,110,116,0,18,101,0,0,0,0,0 diff --git a/src/mesa/shader/slang/library/slang_fragment_builtin_gc.h b/src/mesa/shader/slang/library/slang_fragment_builtin_gc.h index 8b8202ea2f..ae69c37ebe 100644 --- a/src/mesa/shader/slang/library/slang_fragment_builtin_gc.h +++ b/src/mesa/shader/slang/library/slang_fragment_builtin_gc.h @@ -2,98 +2,100 @@ /* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED FROM THE FOLLOWING FILE: */ /* slang_fragment_builtin.gc */ -3,2,2,6,12,1,103,108,95,70,114,97,103,67,111,111,114,100,0,0,0,2,2,6,1,1,103,108,95,70,114,111,110, -116,70,97,99,105,110,103,0,0,0,2,2,5,12,1,103,108,95,70,114,97,103,67,111,108,111,114,0,0,0,2,2,5, -12,1,103,108,95,70,114,97,103,68,97,116,97,0,3,18,103,108,95,77,97,120,68,114,97,119,66,117,102, -102,101,114,115,0,0,0,2,2,5,9,1,103,108,95,70,114,97,103,68,101,112,116,104,0,0,0,2,2,3,12,1,103, -108,95,67,111,108,111,114,0,0,0,2,2,3,12,1,103,108,95,83,101,99,111,110,100,97,114,121,67,111,108, -111,114,0,0,0,2,2,3,12,1,103,108,95,84,101,120,67,111,111,114,100,0,3,18,103,108,95,77,97,120,84, -101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,3,9,1,103,108,95,70,111,103,70,114,97,103, -67,111,111,114,100,0,0,0,1,0,12,0,116,101,120,116,117,114,101,49,68,0,1,1,0,16,115,97,109,112,108, -101,114,0,0,1,1,0,9,99,111,111,114,100,0,0,1,1,0,9,98,105,97,115,0,0,0,1,3,2,0,12,1,99,111,111,114, -100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,0,18,99,111,111,114,100,0,20,0,9,18,99,111,111, -114,100,52,0,59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95,116,101,120,98,49,100,0,18,95,95, -114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,0, -12,0,116,101,120,116,117,114,101,49,68,80,114,111,106,0,1,1,0,16,115,97,109,112,108,101,114,0,0,1, -1,0,10,99,111,111,114,100,0,0,1,1,0,9,98,105,97,115,0,0,0,1,3,2,0,12,1,112,99,111,111,114,100,0,0, -0,9,18,112,99,111,111,114,100,0,59,120,0,18,99,111,111,114,100,0,59,120,0,18,99,111,111,114,100,0, -59,121,0,49,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95, +4,2,2,6,0,12,1,103,108,95,70,114,97,103,67,111,111,114,100,0,0,0,2,2,6,0,1,1,103,108,95,70,114,111, +110,116,70,97,99,105,110,103,0,0,0,2,2,5,0,12,1,103,108,95,70,114,97,103,67,111,108,111,114,0,0,0, +2,2,5,0,12,1,103,108,95,70,114,97,103,68,97,116,97,0,3,18,103,108,95,77,97,120,68,114,97,119,66, +117,102,102,101,114,115,0,0,0,2,2,5,0,9,1,103,108,95,70,114,97,103,68,101,112,116,104,0,0,0,2,2,3, +0,12,1,103,108,95,67,111,108,111,114,0,0,0,2,2,3,0,12,1,103,108,95,83,101,99,111,110,100,97,114, +121,67,111,108,111,114,0,0,0,2,2,3,0,12,1,103,108,95,84,101,120,67,111,111,114,100,0,3,18,103,108, +95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,3,0,9,1,103,108,95,70,111, +103,70,114,97,103,67,111,111,114,100,0,0,0,1,0,0,12,0,116,101,120,116,117,114,101,49,68,0,1,1,0,16, +115,97,109,112,108,101,114,0,0,1,1,0,9,99,111,111,114,100,0,0,1,1,0,9,98,105,97,115,0,0,0,1,3,2,0, +0,12,1,99,111,111,114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,0,18,99,111,111,114,100,0, +20,0,9,18,99,111,111,114,100,52,0,59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95,116,101,120, +98,49,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114, +100,52,0,0,0,0,1,0,0,12,0,116,101,120,116,117,114,101,49,68,80,114,111,106,0,1,1,0,16,115,97,109, +112,108,101,114,0,0,1,1,0,10,99,111,111,114,100,0,0,1,1,0,9,98,105,97,115,0,0,0,1,3,2,0,0,12,1,112, +99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,0,18,99,111,111,114,100,0,59,120,0, +18,99,111,111,114,100,0,59,121,0,49,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,98,105,97,115,0, +20,0,4,118,101,99,52,95,116,101,120,98,49,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109, +112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,0,0,12,0,116,101,120,116,117,114,101,49,68, +80,114,111,106,0,1,1,0,16,115,97,109,112,108,101,114,0,0,1,1,0,12,99,111,111,114,100,0,0,1,1,0,9, +98,105,97,115,0,0,0,1,3,2,0,0,12,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59, +120,0,18,99,111,111,114,100,0,59,120,0,18,99,111,111,114,100,0,59,122,0,49,20,0,9,18,112,99,111, +111,114,100,0,59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95,116,101,120,98,49,100,0,18,95,95, +114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,0, +0,12,0,116,101,120,116,117,114,101,50,68,0,1,1,0,17,115,97,109,112,108,101,114,0,0,1,1,0,10,99,111, +111,114,100,0,0,1,1,0,9,98,105,97,115,0,0,0,1,3,2,0,0,12,1,99,111,111,114,100,52,0,0,0,9,18,99,111, +111,114,100,52,0,59,120,121,0,18,99,111,111,114,100,0,59,120,121,0,20,0,9,18,99,111,111,114,100,52, +0,59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95,116,101,120,98,50,100,0,18,95,95,114,101,116, +86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,0,0,12,0,116, +101,120,116,117,114,101,50,68,80,114,111,106,0,1,1,0,17,115,97,109,112,108,101,114,0,0,1,1,0,11,99, +111,111,114,100,0,0,1,1,0,9,98,105,97,115,0,0,0,1,3,2,0,0,12,1,112,99,111,111,114,100,0,0,0,9,18, +112,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0, +59,122,0,49,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95, +116,101,120,98,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18, +112,99,111,111,114,100,0,0,0,0,1,0,0,12,0,116,101,120,116,117,114,101,50,68,80,114,111,106,0,1,1,0, +17,115,97,109,112,108,101,114,0,0,1,1,0,12,99,111,111,114,100,0,0,1,1,0,9,98,105,97,115,0,0,0,1,3, +2,0,0,12,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,121,0,18,99,111,111, +114,100,0,59,120,121,0,18,99,111,111,114,100,0,59,119,0,49,20,0,9,18,112,99,111,111,114,100,0,59, +119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95,116,101,120,98,50,100,0,18,95,95,114,101,116,86, +97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,0,0,12,0,116,101, +120,116,117,114,101,51,68,0,1,1,0,18,115,97,109,112,108,101,114,0,0,1,1,0,11,99,111,111,114,100,0, +0,1,1,0,9,98,105,97,115,0,0,0,1,3,2,0,0,12,1,99,111,111,114,100,52,0,0,0,9,18,99,111,111,114,100, +52,0,59,120,121,122,0,18,99,111,111,114,100,0,59,120,121,122,0,20,0,9,18,99,111,111,114,100,52,0, +59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95,116,101,120,98,51,100,0,18,95,95,114,101,116, +86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,0,0,12,0,116, +101,120,116,117,114,101,51,68,80,114,111,106,0,1,1,0,18,115,97,109,112,108,101,114,0,0,1,1,0,12,99, +111,111,114,100,0,0,1,1,0,9,98,105,97,115,0,0,0,1,3,2,0,0,12,1,112,99,111,111,114,100,0,0,0,9,18, +112,99,111,111,114,100,0,59,120,121,122,0,18,99,111,111,114,100,0,59,120,121,122,0,18,99,111,111, +114,100,0,59,119,0,49,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,98,105,97,115,0,20,0,4,118, +101,99,52,95,116,101,120,98,51,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101, +114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,0,0,12,0,116,101,120,116,117,114,101,67,117,98,101,0,1, +1,0,19,115,97,109,112,108,101,114,0,0,1,1,0,11,99,111,111,114,100,0,0,1,1,0,9,98,105,97,115,0,0,0, +1,3,2,0,0,12,1,99,111,111,114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,121,122,0,18,99,111, +111,114,100,0,20,0,9,18,99,111,111,114,100,52,0,59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52, +95,116,101,120,99,117,98,101,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0, +0,18,99,111,111,114,100,52,0,0,0,0,1,0,0,12,0,115,104,97,100,111,119,49,68,0,1,1,0,20,115,97,109, +112,108,101,114,0,0,1,1,0,11,99,111,111,114,100,0,0,1,1,0,9,98,105,97,115,0,0,0,1,3,2,0,0,12,1,99, +111,111,114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,121,122,0,18,99,111,111,114,100,0,20, +0,9,18,99,111,111,114,100,52,0,59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95,116,101,120,98, +49,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114, +100,52,0,0,0,0,1,0,0,12,0,115,104,97,100,111,119,49,68,80,114,111,106,0,1,1,0,20,115,97,109,112, +108,101,114,0,0,1,1,0,12,99,111,111,114,100,0,0,1,1,0,9,98,105,97,115,0,0,0,1,3,2,0,0,12,1,112,99, +111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,0,18,99,111,111,114,100,0,59,120,0,18, +99,111,111,114,100,0,59,119,0,49,20,0,9,18,112,99,111,111,114,100,0,59,122,0,18,99,111,111,114,100, +0,59,122,0,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95, 116,101,120,98,49,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18, -112,99,111,111,114,100,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,49,68,80,114,111,106,0,1,1,0, -16,115,97,109,112,108,101,114,0,0,1,1,0,12,99,111,111,114,100,0,0,1,1,0,9,98,105,97,115,0,0,0,1,3, -2,0,12,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,0,18,99,111,111,114,100, -0,59,120,0,18,99,111,111,114,100,0,59,122,0,49,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,98, -105,97,115,0,20,0,4,118,101,99,52,95,116,101,120,98,49,100,0,18,95,95,114,101,116,86,97,108,0,0,18, -115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,0,12,0,116,101,120,116,117,114, -101,50,68,0,1,1,0,17,115,97,109,112,108,101,114,0,0,1,1,0,10,99,111,111,114,100,0,0,1,1,0,9,98,105, -97,115,0,0,0,1,3,2,0,12,1,99,111,111,114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,121,0,18, -99,111,111,114,100,0,59,120,121,0,20,0,9,18,99,111,111,114,100,52,0,59,119,0,18,98,105,97,115,0,20, -0,4,118,101,99,52,95,116,101,120,98,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112, -108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,50,68,80,114, -111,106,0,1,1,0,17,115,97,109,112,108,101,114,0,0,1,1,0,11,99,111,111,114,100,0,0,1,1,0,9,98,105, -97,115,0,0,0,1,3,2,0,12,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,121,0, -18,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59,122,0,49,20,0,9,18,112,99,111,111, -114,100,0,59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95,116,101,120,98,50,100,0,18,95,95,114, -101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,0,12,0, -116,101,120,116,117,114,101,50,68,80,114,111,106,0,1,1,0,17,115,97,109,112,108,101,114,0,0,1,1,0, -12,99,111,111,114,100,0,0,1,1,0,9,98,105,97,115,0,0,0,1,3,2,0,12,1,112,99,111,111,114,100,0,0,0,9, -18,112,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114, -100,0,59,119,0,49,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,98,105,97,115,0,20,0,4,118,101,99, -52,95,116,101,120,98,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0, -18,112,99,111,111,114,100,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,51,68,0,1,1,0,18,115,97,109, -112,108,101,114,0,0,1,1,0,11,99,111,111,114,100,0,0,1,1,0,9,98,105,97,115,0,0,0,1,3,2,0,12,1,99, -111,111,114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,121,122,0,18,99,111,111,114,100,0,59, -120,121,122,0,20,0,9,18,99,111,111,114,100,52,0,59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52, -95,116,101,120,98,51,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18, -99,111,111,114,100,52,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,51,68,80,114,111,106,0,1,1,0,18, -115,97,109,112,108,101,114,0,0,1,1,0,12,99,111,111,114,100,0,0,1,1,0,9,98,105,97,115,0,0,0,1,3,2,0, -12,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,121,122,0,18,99,111,111,114, -100,0,59,120,121,122,0,18,99,111,111,114,100,0,59,119,0,49,20,0,9,18,112,99,111,111,114,100,0,59, -119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95,116,101,120,98,51,100,0,18,95,95,114,101,116,86, -97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,0,12,0,116,101, -120,116,117,114,101,67,117,98,101,0,1,1,0,19,115,97,109,112,108,101,114,0,0,1,1,0,11,99,111,111, -114,100,0,0,1,1,0,9,98,105,97,115,0,0,0,1,3,2,0,12,1,99,111,111,114,100,52,0,0,0,9,18,99,111,111, -114,100,52,0,59,120,121,122,0,18,99,111,111,114,100,0,20,0,9,18,99,111,111,114,100,52,0,59,119,0, -18,98,105,97,115,0,20,0,4,118,101,99,52,95,116,101,120,99,117,98,101,0,18,95,95,114,101,116,86,97, -108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,0,12,0,115,104,97,100, -111,119,49,68,0,1,1,0,20,115,97,109,112,108,101,114,0,0,1,1,0,11,99,111,111,114,100,0,0,1,1,0,9,98, -105,97,115,0,0,0,1,3,2,0,12,1,99,111,111,114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,121, -122,0,18,99,111,111,114,100,0,20,0,9,18,99,111,111,114,100,52,0,59,119,0,18,98,105,97,115,0,20,0,4, -118,101,99,52,95,116,101,120,98,49,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108, -101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,0,12,0,115,104,97,100,111,119,49,68,80,114,111,106, -0,1,1,0,20,115,97,109,112,108,101,114,0,0,1,1,0,12,99,111,111,114,100,0,0,1,1,0,9,98,105,97,115,0, -0,0,1,3,2,0,12,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,0,18,99,111,111, -114,100,0,59,120,0,18,99,111,111,114,100,0,59,119,0,49,20,0,9,18,112,99,111,111,114,100,0,59,122,0, -18,99,111,111,114,100,0,59,122,0,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,98,105,97,115,0,20, -0,4,118,101,99,52,95,116,101,120,98,49,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112, -108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,0,12,0,115,104,97,100,111,119,50,68,0,1,1,0,21, -115,97,109,112,108,101,114,0,0,1,1,0,11,99,111,111,114,100,0,0,1,1,0,9,98,105,97,115,0,0,0,1,3,2,0, -12,1,99,111,111,114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,121,122,0,18,99,111,111,114, -100,0,20,0,9,18,99,111,111,114,100,52,0,59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95,116, -101,120,98,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111, -111,114,100,52,0,0,0,0,1,0,12,0,115,104,97,100,111,119,50,68,80,114,111,106,0,1,1,0,21,115,97,109, -112,108,101,114,0,0,1,1,0,12,99,111,111,114,100,0,0,1,1,0,9,98,105,97,115,0,0,0,1,3,2,0,12,1,112, -99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59,120, -121,0,18,99,111,111,114,100,0,59,119,0,49,20,0,9,18,112,99,111,111,114,100,0,59,122,0,18,99,111, -111,114,100,0,59,122,0,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,98,105,97,115,0,20,0,4,118, -101,99,52,95,116,101,120,98,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101, -114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,0,9,0,100,70,100,120,0,1,1,0,9,112,0,0,0,1,4,118,101, -99,52,95,100,100,120,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,112,0,59,120,120,120,120,0,0, -0,0,1,0,10,0,100,70,100,120,0,1,1,0,10,112,0,0,0,1,4,118,101,99,52,95,100,100,120,0,18,95,95,114, -101,116,86,97,108,0,59,120,121,0,0,18,112,0,59,120,121,121,121,0,0,0,0,1,0,11,0,100,70,100,120,0,1, -1,0,11,112,0,0,0,1,4,118,101,99,52,95,100,100,120,0,18,95,95,114,101,116,86,97,108,0,59,120,121, -122,0,0,18,112,0,59,120,121,122,122,0,0,0,0,1,0,12,0,100,70,100,120,0,1,1,0,12,112,0,0,0,1,4,118, -101,99,52,95,100,100,120,0,18,95,95,114,101,116,86,97,108,0,0,18,112,0,0,0,0,1,0,9,0,100,70,100, -121,0,1,1,0,9,112,0,0,0,1,4,118,101,99,52,95,100,100,121,0,18,95,95,114,101,116,86,97,108,0,59,120, -0,0,18,112,0,59,120,120,120,120,0,0,0,0,1,0,10,0,100,70,100,121,0,1,1,0,10,112,0,0,0,1,4,118,101, -99,52,95,100,100,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,112,0,59,120,121,121,121, -0,0,0,0,1,0,11,0,100,70,100,121,0,1,1,0,11,112,0,0,0,1,4,118,101,99,52,95,100,100,121,0,18,95,95, -114,101,116,86,97,108,0,59,120,121,122,0,0,18,112,0,59,120,121,122,122,0,0,0,0,1,0,12,0,100,70,100, -121,0,1,1,0,12,112,0,0,0,1,4,118,101,99,52,95,100,100,121,0,18,95,95,114,101,116,86,97,108,0,0,18, -112,0,0,0,0,1,0,9,0,102,119,105,100,116,104,0,1,1,0,9,112,0,0,0,1,8,58,97,98,115,0,58,100,70,100, -120,0,18,112,0,0,0,0,0,58,97,98,115,0,58,100,70,100,121,0,18,112,0,0,0,0,0,46,0,0,1,0,10,0,102,119, -105,100,116,104,0,1,1,0,10,112,0,0,0,1,8,58,97,98,115,0,58,100,70,100,120,0,18,112,0,0,0,0,0,58,97, -98,115,0,58,100,70,100,121,0,18,112,0,0,0,0,0,46,0,0,1,0,11,0,102,119,105,100,116,104,0,1,1,0,11, -112,0,0,0,1,8,58,97,98,115,0,58,100,70,100,120,0,18,112,0,0,0,0,0,58,97,98,115,0,58,100,70,100,121, -0,18,112,0,0,0,0,0,46,0,0,1,0,12,0,102,119,105,100,116,104,0,1,1,0,12,112,0,0,0,1,8,58,97,98,115,0, -58,100,70,100,120,0,18,112,0,0,0,0,0,58,97,98,115,0,58,100,70,100,121,0,18,112,0,0,0,0,0,46,0,0,0 +112,99,111,111,114,100,0,0,0,0,1,0,0,12,0,115,104,97,100,111,119,50,68,0,1,1,0,21,115,97,109,112, +108,101,114,0,0,1,1,0,11,99,111,111,114,100,0,0,1,1,0,9,98,105,97,115,0,0,0,1,3,2,0,0,12,1,99,111, +111,114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,121,122,0,18,99,111,111,114,100,0,20,0,9, +18,99,111,111,114,100,52,0,59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95,116,101,120,98,50, +100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100, +52,0,0,0,0,1,0,0,12,0,115,104,97,100,111,119,50,68,80,114,111,106,0,1,1,0,21,115,97,109,112,108, +101,114,0,0,1,1,0,12,99,111,111,114,100,0,0,1,1,0,9,98,105,97,115,0,0,0,1,3,2,0,0,12,1,112,99,111, +111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59,120,121,0, +18,99,111,111,114,100,0,59,119,0,49,20,0,9,18,112,99,111,111,114,100,0,59,122,0,18,99,111,111,114, +100,0,59,122,0,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52, +95,116,101,120,98,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18, +112,99,111,111,114,100,0,0,0,0,1,0,0,9,0,100,70,100,120,0,1,1,0,9,112,0,0,0,1,4,118,101,99,52,95, +100,100,120,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,112,0,59,120,120,120,120,0,0,0,0,1,0, +0,10,0,100,70,100,120,0,1,1,0,10,112,0,0,0,1,4,118,101,99,52,95,100,100,120,0,18,95,95,114,101,116, +86,97,108,0,59,120,121,0,0,18,112,0,59,120,121,121,121,0,0,0,0,1,0,0,11,0,100,70,100,120,0,1,1,0, +11,112,0,0,0,1,4,118,101,99,52,95,100,100,120,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0, +0,18,112,0,59,120,121,122,122,0,0,0,0,1,0,0,12,0,100,70,100,120,0,1,1,0,12,112,0,0,0,1,4,118,101, +99,52,95,100,100,120,0,18,95,95,114,101,116,86,97,108,0,0,18,112,0,0,0,0,1,0,0,9,0,100,70,100,121, +0,1,1,0,9,112,0,0,0,1,4,118,101,99,52,95,100,100,121,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0, +18,112,0,59,120,120,120,120,0,0,0,0,1,0,0,10,0,100,70,100,121,0,1,1,0,10,112,0,0,0,1,4,118,101,99, +52,95,100,100,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,112,0,59,120,121,121,121,0, +0,0,0,1,0,0,11,0,100,70,100,121,0,1,1,0,11,112,0,0,0,1,4,118,101,99,52,95,100,100,121,0,18,95,95, +114,101,116,86,97,108,0,59,120,121,122,0,0,18,112,0,59,120,121,122,122,0,0,0,0,1,0,0,12,0,100,70, +100,121,0,1,1,0,12,112,0,0,0,1,4,118,101,99,52,95,100,100,121,0,18,95,95,114,101,116,86,97,108,0,0, +18,112,0,0,0,0,1,0,0,9,0,102,119,105,100,116,104,0,1,1,0,9,112,0,0,0,1,8,58,97,98,115,0,58,100,70, +100,120,0,18,112,0,0,0,0,0,58,97,98,115,0,58,100,70,100,121,0,18,112,0,0,0,0,0,46,0,0,1,0,0,10,0, +102,119,105,100,116,104,0,1,1,0,10,112,0,0,0,1,8,58,97,98,115,0,58,100,70,100,120,0,18,112,0,0,0,0, +0,58,97,98,115,0,58,100,70,100,121,0,18,112,0,0,0,0,0,46,0,0,1,0,0,11,0,102,119,105,100,116,104,0, +1,1,0,11,112,0,0,0,1,8,58,97,98,115,0,58,100,70,100,120,0,18,112,0,0,0,0,0,58,97,98,115,0,58,100, +70,100,121,0,18,112,0,0,0,0,0,46,0,0,1,0,0,12,0,102,119,105,100,116,104,0,1,1,0,12,112,0,0,0,1,8, +58,97,98,115,0,58,100,70,100,120,0,18,112,0,0,0,0,0,58,97,98,115,0,58,100,70,100,121,0,18,112,0,0, +0,0,0,46,0,0,0 diff --git a/src/mesa/shader/slang/library/slang_pp_directives.syn b/src/mesa/shader/slang/library/slang_pp_directives.syn index d4a321034d..d4a321034d 100755..100644 --- a/src/mesa/shader/slang/library/slang_pp_directives.syn +++ b/src/mesa/shader/slang/library/slang_pp_directives.syn diff --git a/src/mesa/shader/slang/library/slang_pp_expression.syn b/src/mesa/shader/slang/library/slang_pp_expression.syn index bfdb220bf5..bfdb220bf5 100755..100644 --- a/src/mesa/shader/slang/library/slang_pp_expression.syn +++ b/src/mesa/shader/slang/library/slang_pp_expression.syn diff --git a/src/mesa/shader/slang/library/slang_pp_version.syn b/src/mesa/shader/slang/library/slang_pp_version.syn index d5e9317b5d..3fe1a57ba2 100644 --- a/src/mesa/shader/slang/library/slang_pp_version.syn +++ b/src/mesa/shader/slang/library/slang_pp_version.syn @@ -31,11 +31,9 @@ .syntax version_directive; version_directive - version_directive_1 .and .loop version_directive_2; + version_directive_1; version_directive_1 prior_optional_spaces .and optional_version_directive .and .true .emit $; -version_directive_2 - prior_optional_spaces .and version_directive_body .and .true .emit $; optional_version_directive version_directive_body .or .true .emit 10 .emit 1; @@ -45,13 +43,16 @@ version_directive_body new_line; version_number - version_number_110 .or version_number_120; + version_number_100 .or version_number_110 .or version_number_120; + +version_number_100 + leading_zeroes .and "100" .emit 0 .emit 1; version_number_110 leading_zeroes .and "110" .emit 10 .emit 1; version_number_120 - leading_zeroes .and "120" .emit 20 .emit 1; + leading_zeroes .and "120" .emit 20 .emit 1; leading_zeroes .loop zero; diff --git a/src/mesa/shader/slang/library/slang_pp_version_syn.h b/src/mesa/shader/slang/library/slang_pp_version_syn.h index a75cf7509f..54aee3ff28 100644 --- a/src/mesa/shader/slang/library/slang_pp_version_syn.h +++ b/src/mesa/shader/slang/library/slang_pp_version_syn.h @@ -3,22 +3,22 @@ ".syntax version_directive;\n" "version_directive\n" -" version_directive_1 .and .loop version_directive_2;\n" +" version_directive_1;\n" "version_directive_1\n" " prior_optional_spaces .and optional_version_directive .and .true .emit $;\n" -"version_directive_2\n" -" prior_optional_spaces .and version_directive_body .and .true .emit $;\n" "optional_version_directive\n" " version_directive_body .or .true .emit 10 .emit 1;\n" "version_directive_body\n" " '#' .and optional_space .and \"version\" .and space .and version_number .and optional_space .and\n" " new_line;\n" "version_number\n" -" version_number_110 .or version_number_120;\n" +" version_number_100 .or version_number_110 .or version_number_120;\n" +"version_number_100\n" +" leading_zeroes .and \"100\" .emit 0 .emit 1;\n" "version_number_110\n" " leading_zeroes .and \"110\" .emit 10 .emit 1;\n" "version_number_120\n" -" leading_zeroes .and \"120\" .emit 20 .emit 1;\n" +" leading_zeroes .and \"120\" .emit 20 .emit 1;\n" "leading_zeroes\n" " .loop zero;\n" "zero\n" diff --git a/src/mesa/shader/slang/library/slang_shader.syn b/src/mesa/shader/slang/library/slang_shader.syn index 52a792ad17..06bd8ac883 100644 --- a/src/mesa/shader/slang/library/slang_shader.syn +++ b/src/mesa/shader/slang/library/slang_shader.syn @@ -49,7 +49,7 @@ .syntax translation_unit; /* revision number - increment after each change affecting emitted output */ -.emtcode REVISION 3 +.emtcode REVISION 4 /* external declaration (or precision or invariant stmt) */ .emtcode EXTERNAL_NULL 0 @@ -59,9 +59,10 @@ .emtcode INVARIANT_STMT 4 /* precision */ -.emtcode PRECISION_LOW 0 -.emtcode PRECISION_MEDIUM 1 -.emtcode PRECISION_HIGH 2 +.emtcode PRECISION_DEFAULT 0 +.emtcode PRECISION_LOW 1 +.emtcode PRECISION_MEDIUM 2 +.emtcode PRECISION_HIGH 3 /* declaration */ .emtcode DECLARATION_FUNCTION_PROTOTYPE 1 @@ -242,7 +243,9 @@ .emtcode PARAMETER_ARRAY_NOT_PRESENT 0 .emtcode PARAMETER_ARRAY_PRESENT 1 -.errtext INVALID_EXTERNAL_DECLARATION "2001: Invalid external declaration." +/* INVALID_EXTERNAL_DECLARATION seems to be reported when there's */ +/* any syntax errors... */ +.errtext INVALID_EXTERNAL_DECLARATION "2001: Syntax error." .errtext INVALID_OPERATOR_OVERRIDE "2002: Invalid operator override." .errtext LBRACE_EXPECTED "2003: '{' expected but '$err_token$' found." .errtext LPAREN_EXPECTED "2004: '(' expected but '$err_token$' found." @@ -853,15 +856,21 @@ single_declaration_6 /* <fully_specified_type> ::= <type_specifier> | <type_qualifier> <type_specifier> + | <precision> <type_specifier> + | <type_qualifier> <precision> <type_specifier> */ fully_specified_type_space - fully_specified_type_1 .and type_specifier_space; + fully_specified_type_optqual .and fully_specified_type_optprec .and type_specifier_space; fully_specified_type_nospace - fully_specified_type_1 .and type_specifier_nospace; -fully_specified_type_1 - fully_specified_type_2 .or .true .emit TYPE_QUALIFIER_NONE; -fully_specified_type_2 + fully_specified_type_optqual .and fully_specified_type_optprec .and type_specifier_nospace; +fully_specified_type_optqual + fully_specified_type_qual .or .true .emit TYPE_QUALIFIER_NONE; +fully_specified_type_qual type_qualifier .and space; +fully_specified_type_optprec + fully_specified_type_prec .or .true .emit PRECISION_DEFAULT; +fully_specified_type_prec + precision .and space; /* <type_qualifier> ::= "const" diff --git a/src/mesa/shader/slang/library/slang_shader_syn.h b/src/mesa/shader/slang/library/slang_shader_syn.h index c0fef6e4e3..1b258fcdc1 100644 --- a/src/mesa/shader/slang/library/slang_shader_syn.h +++ b/src/mesa/shader/slang/library/slang_shader_syn.h @@ -2,15 +2,16 @@ /* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED FROM THE .syn FILE */ ".syntax translation_unit;\n" -".emtcode REVISION 3\n" +".emtcode REVISION 4\n" ".emtcode EXTERNAL_NULL 0\n" ".emtcode EXTERNAL_FUNCTION_DEFINITION 1\n" ".emtcode EXTERNAL_DECLARATION 2\n" ".emtcode DEFAULT_PRECISION 3\n" ".emtcode INVARIANT_STMT 4\n" -".emtcode PRECISION_LOW 0\n" -".emtcode PRECISION_MEDIUM 1\n" -".emtcode PRECISION_HIGH 2\n" +".emtcode PRECISION_DEFAULT 0\n" +".emtcode PRECISION_LOW 1\n" +".emtcode PRECISION_MEDIUM 2\n" +".emtcode PRECISION_HIGH 3\n" ".emtcode DECLARATION_FUNCTION_PROTOTYPE 1\n" ".emtcode DECLARATION_INIT_DECLARATOR_LIST 2\n" ".emtcode FUNCTION_ORDINARY 0\n" @@ -46,7 +47,6 @@ ".emtcode TYPE_QUALIFIER_UNIFORM 4\n" ".emtcode TYPE_QUALIFIER_FIXEDOUTPUT 5\n" ".emtcode TYPE_QUALIFIER_FIXEDINPUT 6\n" -".emtcode TYPE_QUALIFIER_INVARIANT_VARYING 7\n" ".emtcode TYPE_SPECIFIER_VOID 0\n" ".emtcode TYPE_SPECIFIER_BOOL 1\n" ".emtcode TYPE_SPECIFIER_BVEC2 2\n" @@ -138,7 +138,7 @@ ".emtcode PARAMETER_NEXT 1\n" ".emtcode PARAMETER_ARRAY_NOT_PRESENT 0\n" ".emtcode PARAMETER_ARRAY_PRESENT 1\n" -".errtext INVALID_EXTERNAL_DECLARATION \"2001: Invalid external declaration.\"\n" +".errtext INVALID_EXTERNAL_DECLARATION \"2001: Syntax error.\"\n" ".errtext INVALID_OPERATOR_OVERRIDE \"2002: Invalid operator override.\"\n" ".errtext LBRACE_EXPECTED \"2003: '{' expected but '$err_token$' found.\"\n" ".errtext LPAREN_EXPECTED \"2004: '(' expected but '$err_token$' found.\"\n" @@ -414,13 +414,17 @@ "single_declaration_6\n" " constant_expression .emit VARIABLE_ARRAY_EXPLICIT .or .true .emit VARIABLE_ARRAY_UNKNOWN;\n" "fully_specified_type_space\n" -" fully_specified_type_1 .and type_specifier_space;\n" +" fully_specified_type_optqual .and fully_specified_type_optprec .and type_specifier_space;\n" "fully_specified_type_nospace\n" -" fully_specified_type_1 .and type_specifier_nospace;\n" -"fully_specified_type_1\n" -" fully_specified_type_2 .or .true .emit TYPE_QUALIFIER_NONE;\n" -"fully_specified_type_2\n" +" fully_specified_type_optqual .and fully_specified_type_optprec .and type_specifier_nospace;\n" +"fully_specified_type_optqual\n" +" fully_specified_type_qual .or .true .emit TYPE_QUALIFIER_NONE;\n" +"fully_specified_type_qual\n" " type_qualifier .and space;\n" +"fully_specified_type_optprec\n" +" fully_specified_type_prec .or .true .emit PRECISION_DEFAULT;\n" +"fully_specified_type_prec\n" +" precision .and space;\n" "type_qualifier\n" " \"const\" .emit TYPE_QUALIFIER_CONST .or\n" " .if (shader_type == 2) \"attribute\" .emit TYPE_QUALIFIER_ATTRIBUTE .or\n" diff --git a/src/mesa/shader/slang/library/slang_version.syn b/src/mesa/shader/slang/library/slang_version.syn index aaf8bef342..aaf8bef342 100755..100644 --- a/src/mesa/shader/slang/library/slang_version.syn +++ b/src/mesa/shader/slang/library/slang_version.syn diff --git a/src/mesa/shader/slang/library/slang_version_syn.h b/src/mesa/shader/slang/library/slang_version_syn.h index 3b94d85927..3b94d85927 100755..100644 --- a/src/mesa/shader/slang/library/slang_version_syn.h +++ b/src/mesa/shader/slang/library/slang_version_syn.h diff --git a/src/mesa/shader/slang/library/slang_vertex_builtin_gc.h b/src/mesa/shader/slang/library/slang_vertex_builtin_gc.h index d47d62f909..1a08a54d7e 100644 --- a/src/mesa/shader/slang/library/slang_vertex_builtin_gc.h +++ b/src/mesa/shader/slang/library/slang_vertex_builtin_gc.h @@ -2,92 +2,93 @@ /* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED FROM THE FOLLOWING FILE: */ /* slang_vertex_builtin.gc */ -3,2,2,5,12,1,103,108,95,80,111,115,105,116,105,111,110,0,0,0,2,2,5,9,1,103,108,95,80,111,105,110, -116,83,105,122,101,0,0,0,2,2,5,12,1,103,108,95,67,108,105,112,86,101,114,116,101,120,0,0,0,2,2,2, -12,1,103,108,95,67,111,108,111,114,0,0,0,2,2,2,12,1,103,108,95,83,101,99,111,110,100,97,114,121,67, -111,108,111,114,0,0,0,2,2,2,11,1,103,108,95,78,111,114,109,97,108,0,0,0,2,2,2,12,1,103,108,95,86, -101,114,116,101,120,0,0,0,2,2,2,12,1,103,108,95,77,117,108,116,105,84,101,120,67,111,111,114,100, -48,0,0,0,2,2,2,12,1,103,108,95,77,117,108,116,105,84,101,120,67,111,111,114,100,49,0,0,0,2,2,2,12, -1,103,108,95,77,117,108,116,105,84,101,120,67,111,111,114,100,50,0,0,0,2,2,2,12,1,103,108,95,77, -117,108,116,105,84,101,120,67,111,111,114,100,51,0,0,0,2,2,2,12,1,103,108,95,77,117,108,116,105,84, -101,120,67,111,111,114,100,52,0,0,0,2,2,2,12,1,103,108,95,77,117,108,116,105,84,101,120,67,111,111, -114,100,53,0,0,0,2,2,2,12,1,103,108,95,77,117,108,116,105,84,101,120,67,111,111,114,100,54,0,0,0,2, -2,2,12,1,103,108,95,77,117,108,116,105,84,101,120,67,111,111,114,100,55,0,0,0,2,2,2,9,1,103,108,95, -70,111,103,67,111,111,114,100,0,0,0,2,2,3,12,1,103,108,95,70,114,111,110,116,67,111,108,111,114,0, -0,0,2,2,3,12,1,103,108,95,66,97,99,107,67,111,108,111,114,0,0,0,2,2,3,12,1,103,108,95,70,114,111, -110,116,83,101,99,111,110,100,97,114,121,67,111,108,111,114,0,0,0,2,2,3,12,1,103,108,95,66,97,99, -107,83,101,99,111,110,100,97,114,121,67,111,108,111,114,0,0,0,2,2,3,12,1,103,108,95,84,101,120,67, -111,111,114,100,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0, -0,2,2,3,9,1,103,108,95,70,111,103,70,114,97,103,67,111,111,114,100,0,0,0,1,0,12,0,102,116,114,97, -110,115,102,111,114,109,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,103,108,95,86,101,114,116,101, -120,0,18,103,108,95,77,111,100,101,108,86,105,101,119,80,114,111,106,101,99,116,105,111,110,77,97, -116,114,105,120,84,114,97,110,115,112,111,115,101,0,48,20,0,0,1,0,12,0,116,101,120,116,117,114,101, -49,68,76,111,100,0,1,1,0,16,115,97,109,112,108,101,114,0,0,1,1,0,9,99,111,111,114,100,0,0,1,1,0,9, -108,111,100,0,0,0,1,3,2,0,12,1,99,111,111,114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,0, -18,99,111,111,114,100,0,20,0,9,18,99,111,111,114,100,52,0,59,119,0,18,108,111,100,0,20,0,4,118,101, -99,52,95,116,101,120,98,49,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114, -0,0,18,99,111,111,114,100,52,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,49,68,80,114,111,106,76, -111,100,0,1,1,0,16,115,97,109,112,108,101,114,0,0,1,1,0,10,99,111,111,114,100,0,0,1,1,0,9,108,111, -100,0,0,0,1,3,2,0,12,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,0,18,99, -111,111,114,100,0,59,120,0,18,99,111,111,114,100,0,59,121,0,49,20,0,9,18,112,99,111,111,114,100,0, -59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,98,49,100,0,18,95,95,114,101,116,86, -97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,0,12,0,116,101, -120,116,117,114,101,49,68,80,114,111,106,76,111,100,0,1,1,0,16,115,97,109,112,108,101,114,0,0,1,1, -0,12,99,111,111,114,100,0,0,1,1,0,9,108,111,100,0,0,0,1,3,2,0,12,1,112,99,111,111,114,100,0,0,0,9, -18,112,99,111,111,114,100,0,59,120,0,18,99,111,111,114,100,0,59,120,0,18,99,111,111,114,100,0,59, -122,0,49,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116, -101,120,98,49,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99, -111,111,114,100,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,50,68,76,111,100,0,1,1,0,17,115,97, -109,112,108,101,114,0,0,1,1,0,10,99,111,111,114,100,0,0,1,1,0,9,108,111,100,0,0,0,1,3,2,0,12,1,99, -111,111,114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,121,0,18,99,111,111,114,100,0,59,120, -121,0,20,0,9,18,99,111,111,114,100,52,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101, -120,98,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111, -114,100,52,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,50,68,80,114,111,106,76,111,100,0,1,1,0,17, -115,97,109,112,108,101,114,0,0,1,1,0,11,99,111,111,114,100,0,0,1,1,0,9,108,111,100,0,0,0,1,3,2,0, -12,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100, -0,59,120,121,0,18,99,111,111,114,100,0,59,122,0,49,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18, -108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,98,50,100,0,18,95,95,114,101,116,86,97,108,0,0, -18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,0,12,0,116,101,120,116,117, -114,101,50,68,80,114,111,106,76,111,100,0,1,1,0,17,115,97,109,112,108,101,114,0,0,1,1,0,12,99,111, -111,114,100,0,0,1,1,0,9,108,111,100,0,0,0,1,3,2,0,12,1,112,99,111,111,114,100,0,0,0,9,18,112,99, -111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59,122, -0,49,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101, -120,98,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111, -111,114,100,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,51,68,76,111,100,0,1,1,0,18,115,97,109, -112,108,101,114,0,0,1,1,0,11,99,111,111,114,100,0,0,1,1,0,9,108,111,100,0,0,0,1,3,2,0,12,1,99,111, -111,114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,121,122,0,18,99,111,111,114,100,0,59,120, -121,122,0,20,0,9,18,99,111,111,114,100,52,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116, -101,120,98,51,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111, -111,114,100,52,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,51,68,80,114,111,106,76,111,100,0,1,1, -0,18,115,97,109,112,108,101,114,0,0,1,1,0,12,99,111,111,114,100,0,0,1,1,0,9,108,111,100,0,0,0,1,3, -2,0,12,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,121,122,0,18,99,111,111, -114,100,0,59,120,121,122,0,18,99,111,111,114,100,0,59,119,0,49,20,0,9,18,112,99,111,111,114,100,0, -59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,98,51,100,0,18,95,95,114,101,116,86, -97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,0,12,0,116,101, -120,116,117,114,101,67,117,98,101,76,111,100,0,1,1,0,19,115,97,109,112,108,101,114,0,0,1,1,0,11,99, -111,111,114,100,0,0,1,1,0,9,108,111,100,0,0,0,1,3,2,0,12,1,99,111,111,114,100,52,0,0,0,9,18,99,111, +4,2,2,5,0,12,1,103,108,95,80,111,115,105,116,105,111,110,0,0,0,2,2,5,0,9,1,103,108,95,80,111,105, +110,116,83,105,122,101,0,0,0,2,2,5,0,12,1,103,108,95,67,108,105,112,86,101,114,116,101,120,0,0,0,2, +2,2,0,12,1,103,108,95,67,111,108,111,114,0,0,0,2,2,2,0,12,1,103,108,95,83,101,99,111,110,100,97, +114,121,67,111,108,111,114,0,0,0,2,2,2,0,11,1,103,108,95,78,111,114,109,97,108,0,0,0,2,2,2,0,12,1, +103,108,95,86,101,114,116,101,120,0,0,0,2,2,2,0,12,1,103,108,95,77,117,108,116,105,84,101,120,67, +111,111,114,100,48,0,0,0,2,2,2,0,12,1,103,108,95,77,117,108,116,105,84,101,120,67,111,111,114,100, +49,0,0,0,2,2,2,0,12,1,103,108,95,77,117,108,116,105,84,101,120,67,111,111,114,100,50,0,0,0,2,2,2,0, +12,1,103,108,95,77,117,108,116,105,84,101,120,67,111,111,114,100,51,0,0,0,2,2,2,0,12,1,103,108,95, +77,117,108,116,105,84,101,120,67,111,111,114,100,52,0,0,0,2,2,2,0,12,1,103,108,95,77,117,108,116, +105,84,101,120,67,111,111,114,100,53,0,0,0,2,2,2,0,12,1,103,108,95,77,117,108,116,105,84,101,120, +67,111,111,114,100,54,0,0,0,2,2,2,0,12,1,103,108,95,77,117,108,116,105,84,101,120,67,111,111,114, +100,55,0,0,0,2,2,2,0,9,1,103,108,95,70,111,103,67,111,111,114,100,0,0,0,2,2,3,0,12,1,103,108,95,70, +114,111,110,116,67,111,108,111,114,0,0,0,2,2,3,0,12,1,103,108,95,66,97,99,107,67,111,108,111,114,0, +0,0,2,2,3,0,12,1,103,108,95,70,114,111,110,116,83,101,99,111,110,100,97,114,121,67,111,108,111,114, +0,0,0,2,2,3,0,12,1,103,108,95,66,97,99,107,83,101,99,111,110,100,97,114,121,67,111,108,111,114,0,0, +0,2,2,3,0,12,1,103,108,95,84,101,120,67,111,111,114,100,0,3,18,103,108,95,77,97,120,84,101,120,116, +117,114,101,67,111,111,114,100,115,0,0,0,2,2,3,0,9,1,103,108,95,70,111,103,70,114,97,103,67,111, +111,114,100,0,0,0,1,0,0,12,0,102,116,114,97,110,115,102,111,114,109,0,0,1,9,18,95,95,114,101,116, +86,97,108,0,18,103,108,95,86,101,114,116,101,120,0,18,103,108,95,77,111,100,101,108,86,105,101,119, +80,114,111,106,101,99,116,105,111,110,77,97,116,114,105,120,84,114,97,110,115,112,111,115,101,0,48, +20,0,0,1,0,0,12,0,116,101,120,116,117,114,101,49,68,76,111,100,0,1,1,0,16,115,97,109,112,108,101, +114,0,0,1,1,0,9,99,111,111,114,100,0,0,1,1,0,9,108,111,100,0,0,0,1,3,2,0,0,12,1,99,111,111,114,100, +52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,0,18,99,111,111,114,100,0,20,0,9,18,99,111,111,114, +100,52,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,98,49,100,0,18,95,95,114, +101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,0,0,12, +0,116,101,120,116,117,114,101,49,68,80,114,111,106,76,111,100,0,1,1,0,16,115,97,109,112,108,101, +114,0,0,1,1,0,10,99,111,111,114,100,0,0,1,1,0,9,108,111,100,0,0,0,1,3,2,0,0,12,1,112,99,111,111, +114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,0,18,99,111,111,114,100,0,59,120,0,18,99,111, +111,114,100,0,59,121,0,49,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,108,111,100,0,20,0,4,118, +101,99,52,95,116,101,120,98,49,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101, +114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,0,0,12,0,116,101,120,116,117,114,101,49,68,80,114,111, +106,76,111,100,0,1,1,0,16,115,97,109,112,108,101,114,0,0,1,1,0,12,99,111,111,114,100,0,0,1,1,0,9, +108,111,100,0,0,0,1,3,2,0,0,12,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120, +0,18,99,111,111,114,100,0,59,120,0,18,99,111,111,114,100,0,59,122,0,49,20,0,9,18,112,99,111,111, +114,100,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,98,49,100,0,18,95,95,114, +101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,0,0,12, +0,116,101,120,116,117,114,101,50,68,76,111,100,0,1,1,0,17,115,97,109,112,108,101,114,0,0,1,1,0,10, +99,111,111,114,100,0,0,1,1,0,9,108,111,100,0,0,0,1,3,2,0,0,12,1,99,111,111,114,100,52,0,0,0,9,18, +99,111,111,114,100,52,0,59,120,121,0,18,99,111,111,114,100,0,59,120,121,0,20,0,9,18,99,111,111,114, +100,52,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,98,50,100,0,18,95,95,114, +101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,0,0,12, +0,116,101,120,116,117,114,101,50,68,80,114,111,106,76,111,100,0,1,1,0,17,115,97,109,112,108,101, +114,0,0,1,1,0,11,99,111,111,114,100,0,0,1,1,0,9,108,111,100,0,0,0,1,3,2,0,0,12,1,112,99,111,111, +114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59,120,121,0,18, +99,111,111,114,100,0,59,122,0,49,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,108,111,100,0,20,0, +4,118,101,99,52,95,116,101,120,98,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112, +108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,0,0,12,0,116,101,120,116,117,114,101,50,68,80, +114,111,106,76,111,100,0,1,1,0,17,115,97,109,112,108,101,114,0,0,1,1,0,12,99,111,111,114,100,0,0,1, +1,0,9,108,111,100,0,0,0,1,3,2,0,0,12,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0, +59,120,121,0,18,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59,122,0,49,20,0,9,18, +112,99,111,111,114,100,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,98,50,100,0, +18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0, +0,0,1,0,0,12,0,116,101,120,116,117,114,101,51,68,76,111,100,0,1,1,0,18,115,97,109,112,108,101,114, +0,0,1,1,0,11,99,111,111,114,100,0,0,1,1,0,9,108,111,100,0,0,0,1,3,2,0,0,12,1,99,111,111,114,100,52, +0,0,0,9,18,99,111,111,114,100,52,0,59,120,121,122,0,18,99,111,111,114,100,0,59,120,121,122,0,20,0, +9,18,99,111,111,114,100,52,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,98,51, +100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100, +52,0,0,0,0,1,0,0,12,0,116,101,120,116,117,114,101,51,68,80,114,111,106,76,111,100,0,1,1,0,18,115, +97,109,112,108,101,114,0,0,1,1,0,12,99,111,111,114,100,0,0,1,1,0,9,108,111,100,0,0,0,1,3,2,0,0,12, +1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,121,122,0,18,99,111,111,114, +100,0,59,120,121,122,0,18,99,111,111,114,100,0,59,119,0,49,20,0,9,18,112,99,111,111,114,100,0,59, +119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,98,51,100,0,18,95,95,114,101,116,86,97, +108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,0,0,12,0,116,101,120, +116,117,114,101,67,117,98,101,76,111,100,0,1,1,0,19,115,97,109,112,108,101,114,0,0,1,1,0,11,99,111, +111,114,100,0,0,1,1,0,9,108,111,100,0,0,0,1,3,2,0,0,12,1,99,111,111,114,100,52,0,0,0,9,18,99,111, 111,114,100,52,0,59,120,121,122,0,18,99,111,111,114,100,0,20,0,9,18,99,111,111,114,100,52,0,59,119, 0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,99,117,98,101,0,18,95,95,114,101,116,86,97, -108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,0,12,0,115,104,97,100, -111,119,49,68,76,111,100,0,1,1,0,20,115,97,109,112,108,101,114,0,0,1,1,0,11,99,111,111,114,100,0,0, -1,1,0,9,108,111,100,0,0,0,1,3,2,0,12,1,99,111,111,114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,59, -120,121,122,0,18,99,111,111,114,100,0,20,0,9,18,99,111,111,114,100,52,0,59,119,0,18,108,111,100,0, -20,0,4,118,101,99,52,95,116,101,120,98,49,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109, -112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,0,12,0,115,104,97,100,111,119,49,68,80,114, -111,106,76,111,100,0,1,1,0,20,115,97,109,112,108,101,114,0,0,1,1,0,12,99,111,111,114,100,0,0,1,1,0, -9,108,111,100,0,0,0,1,3,2,0,12,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120, -0,18,99,111,111,114,100,0,59,120,0,18,99,111,111,114,100,0,59,119,0,49,20,0,9,18,112,99,111,111, -114,100,0,59,122,0,18,99,111,111,114,100,0,59,122,0,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18, -108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,98,49,100,0,18,95,95,114,101,116,86,97,108,0,0, -18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,0,12,0,115,104,97,100,111, -119,50,68,76,111,100,0,1,1,0,21,115,97,109,112,108,101,114,0,0,1,1,0,11,99,111,111,114,100,0,0,1,1, -0,9,108,111,100,0,0,0,1,3,2,0,12,1,99,111,111,114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120, -121,122,0,18,99,111,111,114,100,0,20,0,9,18,99,111,111,114,100,52,0,59,119,0,18,108,111,100,0,20,0, -4,118,101,99,52,95,116,101,120,98,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112, -108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,0,12,0,115,104,97,100,111,119,50,68,80,114,111, -106,76,111,100,0,1,1,0,21,115,97,109,112,108,101,114,0,0,1,1,0,12,99,111,111,114,100,0,0,1,1,0,9, -108,111,100,0,0,0,1,3,2,0,12,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120, -121,0,18,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59,119,0,49,20,0,9,18,112,99, -111,111,114,100,0,59,122,0,18,99,111,111,114,100,0,59,122,0,20,0,9,18,112,99,111,111,114,100,0,59, -119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,98,50,100,0,18,95,95,114,101,116,86,97, -108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,0 +108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,0,0,12,0,115,104,97, +100,111,119,49,68,76,111,100,0,1,1,0,20,115,97,109,112,108,101,114,0,0,1,1,0,11,99,111,111,114,100, +0,0,1,1,0,9,108,111,100,0,0,0,1,3,2,0,0,12,1,99,111,111,114,100,52,0,0,0,9,18,99,111,111,114,100, +52,0,59,120,121,122,0,18,99,111,111,114,100,0,20,0,9,18,99,111,111,114,100,52,0,59,119,0,18,108, +111,100,0,20,0,4,118,101,99,52,95,116,101,120,98,49,100,0,18,95,95,114,101,116,86,97,108,0,0,18, +115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,0,0,12,0,115,104,97,100,111,119, +49,68,80,114,111,106,76,111,100,0,1,1,0,20,115,97,109,112,108,101,114,0,0,1,1,0,12,99,111,111,114, +100,0,0,1,1,0,9,108,111,100,0,0,0,1,3,2,0,0,12,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111, +114,100,0,59,120,0,18,99,111,111,114,100,0,59,120,0,18,99,111,111,114,100,0,59,119,0,49,20,0,9,18, +112,99,111,111,114,100,0,59,122,0,18,99,111,111,114,100,0,59,122,0,20,0,9,18,112,99,111,111,114, +100,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,98,49,100,0,18,95,95,114,101, +116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,0,0,12,0, +115,104,97,100,111,119,50,68,76,111,100,0,1,1,0,21,115,97,109,112,108,101,114,0,0,1,1,0,11,99,111, +111,114,100,0,0,1,1,0,9,108,111,100,0,0,0,1,3,2,0,0,12,1,99,111,111,114,100,52,0,0,0,9,18,99,111, +111,114,100,52,0,59,120,121,122,0,18,99,111,111,114,100,0,20,0,9,18,99,111,111,114,100,52,0,59,119, +0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,98,50,100,0,18,95,95,114,101,116,86,97,108, +0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,0,0,12,0,115,104,97,100, +111,119,50,68,80,114,111,106,76,111,100,0,1,1,0,21,115,97,109,112,108,101,114,0,0,1,1,0,12,99,111, +111,114,100,0,0,1,1,0,9,108,111,100,0,0,0,1,3,2,0,0,12,1,112,99,111,111,114,100,0,0,0,9,18,112,99, +111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59,119, +0,49,20,0,9,18,112,99,111,111,114,100,0,59,122,0,18,99,111,111,114,100,0,59,122,0,20,0,9,18,112,99, +111,111,114,100,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,98,50,100,0,18,95, +95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,0 diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index ad9cf06e27..72a3c0ef9e 100644 --- a/src/mesa/shader/slang/slang_codegen.c +++ b/src/mesa/shader/slang/slang_codegen.c @@ -425,6 +425,7 @@ static slang_asm_info AsmInfo[] = { { "vec4_sle", IR_SLE, 1, 2 }, { "vec4_slt", IR_SLT, 1, 2 }, /* vec4 unary */ + { "vec4_move", IR_MOVE, 1, 1 }, { "vec4_floor", IR_FLOOR, 1, 1 }, { "vec4_frac", IR_FRAC, 1, 1 }, { "vec4_abs", IR_ABS, 1, 1 }, @@ -448,8 +449,8 @@ static slang_asm_info AsmInfo[] = { { "vec4_texp_rect", IR_TEX, 1, 2 },/* rectangle w/ projection */ /* unary op */ - { "int_to_float", IR_I_TO_F, 1, 1 }, - { "float_to_int", IR_F_TO_I, 1, 1 }, + { "ivec4_to_vec4", IR_I_TO_F, 1, 1 }, /* int[4] to float[4] */ + { "vec4_to_ivec4", IR_F_TO_I, 1, 1 }, /* float[4] to int[4] */ { "float_exp", IR_EXP, 1, 1 }, { "float_exp2", IR_EXP2, 1, 1 }, { "float_log2", IR_LOG2, 1, 1 }, @@ -1480,7 +1481,7 @@ _slang_simple_writemask(GLuint writemask, GLuint swizzle) * \return GL_FALSE for simple writemasks, GL_TRUE for non-simple */ static GLboolean -swizzle_to_writemask(GLuint swizzle, +swizzle_to_writemask(slang_assemble_ctx *A, GLuint swizzle, GLuint *writemaskOut, GLuint *swizzleOut) { GLuint mask = 0x0, newSwizzle[4]; @@ -1494,6 +1495,18 @@ swizzle_to_writemask(GLuint swizzle, break; } assert(swz >= 0 && swz <= 3); + + if (swizzle != SWIZZLE_XXXX && + swizzle != SWIZZLE_YYYY && + swizzle != SWIZZLE_ZZZZ && + swizzle != SWIZZLE_WWWW && + (mask & (1 << swz))) { + /* a channel can't be specified twice (ex: ".xyyz") */ + slang_info_log_error(A->log, "Invalid writemask '%s'", + _mesa_swizzle_string(swizzle, 0, 0)); + return GL_FALSE; + } + mask |= (1 << swz); } assert(mask <= 0xf); @@ -1589,11 +1602,11 @@ resolve_swizzle(const slang_operation *oper) * As above, but produce a writemask. */ static GLuint -resolve_writemask(const slang_operation *oper) +resolve_writemask(slang_assemble_ctx *A, const slang_operation *oper) { GLuint swizzle = resolve_swizzle(oper); GLuint writemask, swizzleOut; - swizzle_to_writemask(swizzle, &writemask, &swizzleOut); + swizzle_to_writemask(A, swizzle, &writemask, &swizzleOut); return writemask; } @@ -1667,18 +1680,16 @@ _slang_gen_asm(slang_assemble_ctx *A, slang_operation *oper, dest_oper = &oper->children[0]; - writemask = resolve_writemask(dest_oper); + writemask = resolve_writemask(A, dest_oper); n0 = _slang_gen_operation(A, dest_oper); if (!n0) return NULL; assert(!n->Store); - n->Store = get_store(n0); - n->Writemask = writemask; + n->Store = n0->Store; - assert(n->Store->File != PROGRAM_UNDEFINED || - n->Store->Parent); + assert(n->Store->File != PROGRAM_UNDEFINED || n->Store->Parent); _slang_free(n0); } @@ -1957,6 +1968,7 @@ _slang_gen_function_call_name(slang_assemble_ctx *A, const char *name, slang_atom atom; slang_function *fun; GLboolean error; + slang_ir_node *n; atom = slang_atom_pool_atom(A->atoms, name); if (atom == SLANG_ATOM_NULL) @@ -1980,6 +1992,12 @@ _slang_gen_function_call_name(slang_assemble_ctx *A, const char *name, fun = _slang_locate_struct_constructor(A, name); } + /* + * At this point, some heuristics are used to try to find a function + * that matches the calling signature by means of casting or "unrolling" + * of constructors. + */ + if (!fun && _slang_is_vec_mat_type(name)) { /* Next, if this call looks like a vec() or mat() constructor call, * try "unwinding" the args to satisfy a constructor. @@ -1995,7 +2013,7 @@ _slang_gen_function_call_name(slang_assemble_ctx *A, const char *name, } } - if (!fun) { + if (!fun && _slang_is_vec_mat_type(name)) { /* Next, try casting args to the types of the formal parameters */ int numArgs = oper->num_children; fun = _slang_find_function_by_argc(A->space.funcs, name, numArgs); @@ -2008,7 +2026,24 @@ _slang_gen_function_call_name(slang_assemble_ctx *A, const char *name, assert(fun); } - return _slang_gen_function_call(A, fun, oper, dest); + if (!fun) { + slang_info_log_error(A->log, + "Function '%s' not found (check argument types)", + name); + return NULL; + } + + n = _slang_gen_function_call(A, fun, oper, dest); + + if (n && !n->Store && !dest + && fun->header.type.specifier.type != SLANG_SPEC_VOID) { + /* setup n->Store for the result of the function call */ + GLint size = _slang_sizeof_type_specifier(&fun->header.type.specifier); + n->Store = _slang_new_ir_storage(PROGRAM_TEMPORARY, -1, size); + /*printf("Alloc storage for function result, size %d \n", size);*/ + } + + return n; } @@ -2050,6 +2085,23 @@ _slang_is_scalar_or_boolean(slang_assemble_ctx *A, slang_operation *oper) /** + * Test if an operation is boolean. + */ +static GLboolean +_slang_is_boolean(slang_assemble_ctx *A, slang_operation *oper) +{ + slang_typeinfo type; + GLboolean isBool; + + slang_typeinfo_construct(&type); + _slang_typeof_operation(A, oper, &type); + isBool = (type.spec.type == SLANG_SPEC_BOOL); + slang_typeinfo_destruct(&type); + return isBool; +} + + +/** * Generate loop code using high-level IR_LOOP instruction */ static slang_ir_node * @@ -2064,7 +2116,7 @@ _slang_gen_while(slang_assemble_ctx * A, const slang_operation *oper) GLboolean isConst, constTrue; /* type-check expression */ - if (!_slang_is_scalar_or_boolean(A, &oper->children[0])) { + if (!_slang_is_boolean(A, &oper->children[0])) { slang_info_log_error(A->log, "scalar/boolean expression expected for 'while'"); return NULL; } @@ -2127,7 +2179,7 @@ _slang_gen_do(slang_assemble_ctx * A, const slang_operation *oper) GLboolean isConst, constTrue; /* type-check expression */ - if (!_slang_is_scalar_or_boolean(A, &oper->children[1])) { + if (!_slang_is_boolean(A, &oper->children[1])) { slang_info_log_error(A->log, "scalar/boolean expression expected for 'do/while'"); return NULL; } @@ -2256,6 +2308,11 @@ _slang_gen_if(slang_assemble_ctx * A, const slang_operation *oper) GLboolean isConst, constTrue; /* type-check expression */ + if (!_slang_is_boolean(A, &oper->children[0])) { + slang_info_log_error(A->log, "boolean expression expected for 'while'"); + return NULL; + } + if (!_slang_is_scalar_or_boolean(A, &oper->children[0])) { slang_info_log_error(A->log, "scalar/boolean expression expected for 'if'"); return NULL; @@ -2382,7 +2439,11 @@ _slang_gen_var_decl(slang_assemble_ctx *A, slang_variable *var) /*assert(!var->declared);*/ var->declared = GL_TRUE; - assert(!is_sampler_type(&var->type)); + if(is_sampler_type(&var->type)) { + slang_info_log_error(A->log, "redeclaration of sampler '%s'", + (char*) var->a_name); + return NULL; + } n = new_node0(IR_VAR_DECL); if (n) { @@ -2408,11 +2469,19 @@ _slang_gen_var_decl(slang_assemble_ctx *A, slang_variable *var) if (var->array_len > 0) { /* this is an array */ - /* round up element size to mult of 4 */ - GLint sz = (n->Store->Size + 3) & ~3; - /* mult by array size */ - sz *= var->array_len; - n->Store->Size = sz; + /* cannot be const-qualified */ + if (var->type.qualifier == SLANG_QUAL_CONST) { + slang_info_log_error(A->log, "array '%s' cannot be const", + (char*) var->a_name); + return NULL; + } + else { + /* round up element size to mult of 4 */ + GLint sz = (n->Store->Size + 3) & ~3; + /* mult by array size */ + sz *= var->array_len; + n->Store->Size = sz; + } } assert(n->Store->Size > 0); @@ -2433,8 +2502,6 @@ _slang_gen_var_decl(slang_assemble_ctx *A, slang_variable *var) */ n->Store->Swizzle = SWIZZLE_NOOP; } - - A->program->NumTemporaries++; /* an approximation */ } return n; } @@ -2451,16 +2518,36 @@ _slang_gen_select(slang_assemble_ctx *A, slang_operation *oper) { slang_ir_node *cond, *ifNode, *trueExpr, *falseExpr, *trueNode, *falseNode; slang_ir_node *tmpDecl, *tmpVar, *tree; - slang_typeinfo type; - int size; + slang_typeinfo type0, type1, type2; + int size, isBool, isEqual; assert(oper->type == SLANG_OPER_SELECT); assert(oper->num_children == 3); + /* type of children[0] must be boolean */ + slang_typeinfo_construct(&type0); + _slang_typeof_operation(A, &oper->children[0], &type0); + isBool = (type0.spec.type == SLANG_SPEC_BOOL); + slang_typeinfo_destruct(&type0); + if (!isBool) { + slang_info_log_error(A->log, "selector type is not boolean"); + return NULL; + } + + slang_typeinfo_construct(&type1); + slang_typeinfo_construct(&type2); + _slang_typeof_operation(A, &oper->children[1], &type1); + _slang_typeof_operation(A, &oper->children[2], &type2); + isEqual = slang_type_specifier_equal(&type1.spec, &type2.spec); + slang_typeinfo_destruct(&type1); + slang_typeinfo_destruct(&type2); + if (!isEqual) { + slang_info_log_error(A->log, "incompatible types for ?: operator"); + return NULL; + } + /* size of x or y's type */ - slang_typeinfo_construct(&type); - _slang_typeof_operation(A, &oper->children[1], &type); - size = _slang_sizeof_type_specifier(&type.spec); + size = _slang_sizeof_type_specifier(&type1.spec); assert(size > 0); /* temporary var */ @@ -2474,13 +2561,13 @@ _slang_gen_select(slang_assemble_ctx *A, slang_operation *oper) tmpVar = new_node0(IR_VAR); tmpVar->Store = tmpDecl->Store; trueExpr = _slang_gen_operation(A, &oper->children[1]); - trueNode = new_node2(IR_MOVE, tmpVar, trueExpr); + trueNode = new_node2(IR_COPY, tmpVar, trueExpr); /* if-false body (child 2) */ tmpVar = new_node0(IR_VAR); tmpVar->Store = tmpDecl->Store; falseExpr = _slang_gen_operation(A, &oper->children[2]); - falseNode = new_node2(IR_MOVE, tmpVar, falseExpr); + falseNode = new_node2(IR_COPY, tmpVar, falseExpr); ifNode = new_if(cond, trueNode, falseNode); @@ -2622,6 +2709,92 @@ _slang_gen_return(slang_assemble_ctx * A, slang_operation *oper) /** + * Determine if the given operation/expression is const-valued. + */ +static GLboolean +_slang_is_constant_expr(const slang_operation *oper) +{ + slang_variable *var; + GLuint i; + + switch (oper->type) { + case SLANG_OPER_IDENTIFIER: + var = _slang_locate_variable(oper->locals, oper->a_id, GL_TRUE); + if (var && var->type.qualifier == SLANG_QUAL_CONST) + return GL_TRUE; + return GL_FALSE; + default: + for (i = 0; i < oper->num_children; i++) { + if (!_slang_is_constant_expr(&oper->children[i])) + return GL_FALSE; + } + return GL_TRUE; + } +} + + +/** + * Check if an assignment of type t1 to t0 is legal. + * XXX more cases needed. + */ +static GLboolean +_slang_assignment_compatible(slang_assemble_ctx *A, + slang_operation *op0, + slang_operation *op1) +{ + slang_typeinfo t0, t1; + GLuint sz0, sz1; + + if (op0->type == SLANG_OPER_POSTINCREMENT || + op0->type == SLANG_OPER_POSTDECREMENT) { + return GL_FALSE; + } + + slang_typeinfo_construct(&t0); + _slang_typeof_operation(A, op0, &t0); + + slang_typeinfo_construct(&t1); + _slang_typeof_operation(A, op1, &t1); + + sz0 = _slang_sizeof_type_specifier(&t0.spec); + sz1 = _slang_sizeof_type_specifier(&t1.spec); + +#if 1 + if (sz0 != sz1) { + /*printf("assignment size mismatch %u vs %u\n", sz0, sz1);*/ + return GL_FALSE; + } +#endif + + if (t0.spec.type == SLANG_SPEC_STRUCT && + t1.spec.type == SLANG_SPEC_STRUCT && + t0.spec._struct->a_name != t1.spec._struct->a_name) + return GL_FALSE; + + if (t0.spec.type == SLANG_SPEC_FLOAT && + t1.spec.type == SLANG_SPEC_BOOL) + return GL_FALSE; + +#if 0 /* not used just yet - causes problems elsewhere */ + if (t0.spec.type == SLANG_SPEC_INT && + t1.spec.type == SLANG_SPEC_FLOAT) + return GL_FALSE; +#endif + + if (t0.spec.type == SLANG_SPEC_BOOL && + t1.spec.type == SLANG_SPEC_FLOAT) + return GL_FALSE; + + if (t0.spec.type == SLANG_SPEC_BOOL && + t1.spec.type == SLANG_SPEC_INT) + return GL_FALSE; + + return GL_TRUE; +} + + + +/** * Generate IR tree for a variable declaration. */ static slang_ir_node * @@ -2631,12 +2804,24 @@ _slang_gen_declaration(slang_assemble_ctx *A, slang_operation *oper) slang_ir_node *varDecl; slang_variable *v; const char *varName = (char *) oper->a_id; + slang_operation *initializer; - assert(oper->num_children == 0 || oper->num_children == 1); + assert(oper->type == SLANG_OPER_VARIABLE_DECL); + assert(oper->num_children <= 1); v = _slang_locate_variable(oper->locals, oper->a_id, GL_TRUE); - /*printf("Declare %s at %p\n", varName, v);*/ - assert(v); + if (!v) + return NULL; /* "shouldn't happen" */ + + if (v->type.qualifier == SLANG_QUAL_ATTRIBUTE || + v->type.qualifier == SLANG_QUAL_VARYING || + v->type.qualifier == SLANG_QUAL_UNIFORM) { + /* can't declare attribute/uniform vars inside functions */ + slang_info_log_error(A->log, + "local variable '%s' cannot be an attribute/uniform/varying", + varName); + return NULL; + } #if 0 if (v->declared) { @@ -2646,57 +2831,78 @@ _slang_gen_declaration(slang_assemble_ctx *A, slang_operation *oper) #endif varDecl = _slang_gen_var_decl(A, v); + if (!varDecl) + return NULL; + /* check if the var has an initializer */ if (oper->num_children > 0) { - /* child is initializer */ - slang_ir_node *var, *init, *rhs; assert(oper->num_children == 1); - var = new_var(A, oper, oper->a_id); - if (!var) { - slang_info_log_error(A->log, "undefined variable '%s'", varName); - return NULL; - } - /* XXX make copy of this initializer? */ - rhs = _slang_gen_operation(A, &oper->children[0]); - if (!rhs) - return NULL; /* must have found an error */ - init = new_node2(IR_MOVE, var, rhs); - /*assert(rhs->Opcode != IR_SEQ);*/ - n = new_seq(varDecl, init); + initializer = &oper->children[0]; } else if (v->initializer) { - slang_ir_node *var, *init, *rhs; + initializer = v->initializer; + } + else { + initializer = NULL; + } + + if (v->type.qualifier == SLANG_QUAL_CONST && !initializer) { + slang_info_log_error(A->log, + "const-qualified variable '%s' requires initializer", + varName); + return NULL; + } + + + if (initializer) { + slang_ir_node *var, *init; + + /* type check/compare var and initializer */ + if (!_slang_assignment_compatible(A, oper, initializer)) { + slang_info_log_error(A->log, "incompatible types in assignment"); + return NULL; + } + var = new_var(A, oper, oper->a_id); if (!var) { slang_info_log_error(A->log, "undefined variable '%s'", varName); return NULL; } + + if (v->type.qualifier == SLANG_QUAL_CONST) { + /* if the variable is const, the initializer must be a const + * expression as well. + */ #if 0 - /* XXX make copy of this initializer? */ - { - slang_operation dup; - slang_operation_construct(&dup); - slang_operation_copy(&dup, v->initializer); - _slang_simplify(&dup, &A->space, A->atoms); - rhs = _slang_gen_operation(A, &dup); - } -#else - _slang_simplify(v->initializer, &A->space, A->atoms); - rhs = _slang_gen_operation(A, v->initializer); + if (!_slang_is_constant_expr(initializer)) { + slang_info_log_error(A->log, + "initializer for %s not constant", varName); + return NULL; + } #endif - if (!rhs) + } + + _slang_simplify(initializer, &A->space, A->atoms); + + init = _slang_gen_operation(A, initializer); + if (!init) return NULL; - assert(rhs); - init = new_node2(IR_MOVE, var, rhs); - /* - assert(rhs->Opcode != IR_SEQ); - */ - n = new_seq(varDecl, init); + /*assert(init->Store);*/ + + /* XXX remove this when type checking is added above */ + if (init->Store && var->Store->Size != init->Store->Size) { + slang_info_log_error(A->log, "invalid assignment (wrong types)"); + return NULL; + } + + n = new_node2(IR_COPY, var, init); + n = new_seq(varDecl, n); } else { n = varDecl; } + return n; } @@ -2753,6 +2959,24 @@ _slang_gen_swizzle(slang_ir_node *child, GLuint swizzle) } +static GLboolean +is_store_writable(const slang_assemble_ctx *A, const slang_ir_storage *store) +{ + while (store->Parent) + store = store->Parent; + + if (!(store->File == PROGRAM_OUTPUT || + store->File == PROGRAM_TEMPORARY || + (store->File == PROGRAM_VARYING && + A->program->Target == GL_VERTEX_PROGRAM_ARB))) { + return GL_FALSE; + } + else { + return GL_TRUE; + } +} + + /** * Generate IR tree for an assignment (=). */ @@ -2798,37 +3022,45 @@ _slang_gen_assignment(slang_assemble_ctx * A, slang_operation *oper) } else { slang_ir_node *n, *lhs, *rhs; + + /* lhs and rhs type checking */ + if (!_slang_assignment_compatible(A, + &oper->children[0], + &oper->children[1])) { + slang_info_log_error(A->log, "incompatible types in assignment"); + return NULL; + } + lhs = _slang_gen_operation(A, &oper->children[0]); + if (!lhs) { + return NULL; + } - if (lhs) { - if (!lhs->Store) { - slang_info_log_error(A->log, - "invalid left hand side for assignment"); - return NULL; - } - if (!(lhs->Store->File == PROGRAM_OUTPUT || - lhs->Store->File == PROGRAM_TEMPORARY || - (lhs->Store->File == PROGRAM_VARYING && - A->program->Target == GL_VERTEX_PROGRAM_ARB) || - lhs->Store->File == PROGRAM_UNDEFINED)) { - slang_info_log_error(A->log, - "illegal assignment to read-only l-value"); - return NULL; - } + if (!lhs->Store) { + slang_info_log_error(A->log, + "invalid left hand side for assignment"); + return NULL; + } + + /* check that lhs is writable */ + if (!is_store_writable(A, lhs->Store)) { + slang_info_log_error(A->log, + "illegal assignment to read-only l-value"); + return NULL; } rhs = _slang_gen_operation(A, &oper->children[1]); if (lhs && rhs) { /* convert lhs swizzle into writemask */ GLuint writemask, newSwizzle; - if (!swizzle_to_writemask(lhs->Store->Swizzle, + if (!swizzle_to_writemask(A, lhs->Store->Swizzle, &writemask, &newSwizzle)) { /* Non-simple writemask, need to swizzle right hand side in * order to put components into the right place. */ rhs = _slang_gen_swizzle(rhs, newSwizzle); } - n = new_node2(IR_MOVE, lhs, rhs); + n = new_node2(IR_COPY, lhs, rhs); n->Writemask = writemask; return n; } @@ -3057,6 +3289,48 @@ _slang_gen_array_element(slang_assemble_ctx * A, slang_operation *oper) } +static slang_ir_node * +_slang_gen_compare(slang_assemble_ctx *A, slang_operation *oper, + slang_ir_opcode opcode) +{ + slang_typeinfo t0, t1; + slang_ir_node *n; + + slang_typeinfo_construct(&t0); + _slang_typeof_operation(A, &oper->children[0], &t0); + + slang_typeinfo_construct(&t1); + _slang_typeof_operation(A, &oper->children[0], &t1); + + if (t0.spec.type == SLANG_SPEC_ARRAY || + t1.spec.type == SLANG_SPEC_ARRAY) { + slang_info_log_error(A->log, "Illegal array comparison"); + return NULL; + } + + if (oper->type != SLANG_OPER_EQUAL && + oper->type != SLANG_OPER_NOTEQUAL) { + /* <, <=, >, >= can only be used with scalars */ + if ((t0.spec.type != SLANG_SPEC_INT && + t0.spec.type != SLANG_SPEC_FLOAT) || + (t1.spec.type != SLANG_SPEC_INT && + t1.spec.type != SLANG_SPEC_FLOAT)) { + slang_info_log_error(A->log, "Incompatible type(s) for inequality operator"); + return NULL; + } + } + + n = new_node2(opcode, + _slang_gen_operation(A, &oper->children[0]), + _slang_gen_operation(A, &oper->children[1])); + + /* result is a bool (size 1) */ + n->Store = _slang_new_ir_storage(PROGRAM_TEMPORARY, -1, 1); + + return n; +} + + #if 0 static void print_vars(slang_variable_scope *s) @@ -3165,29 +3439,17 @@ _slang_gen_operation(slang_assemble_ctx * A, slang_operation *oper) return new_node0(IR_KILL); case SLANG_OPER_EQUAL: - return new_node2(IR_EQUAL, - _slang_gen_operation(A, &oper->children[0]), - _slang_gen_operation(A, &oper->children[1])); + return _slang_gen_compare(A, oper, IR_EQUAL); case SLANG_OPER_NOTEQUAL: - return new_node2(IR_NOTEQUAL, - _slang_gen_operation(A, &oper->children[0]), - _slang_gen_operation(A, &oper->children[1])); + return _slang_gen_compare(A, oper, IR_NOTEQUAL); case SLANG_OPER_GREATER: - return new_node2(IR_SGT, - _slang_gen_operation(A, &oper->children[0]), - _slang_gen_operation(A, &oper->children[1])); + return _slang_gen_compare(A, oper, IR_SGT); case SLANG_OPER_LESS: - return new_node2(IR_SLT, - _slang_gen_operation(A, &oper->children[0]), - _slang_gen_operation(A, &oper->children[1])); + return _slang_gen_compare(A, oper, IR_SLT); case SLANG_OPER_GREATEREQUAL: - return new_node2(IR_SGE, - _slang_gen_operation(A, &oper->children[0]), - _slang_gen_operation(A, &oper->children[1])); + return _slang_gen_compare(A, oper, IR_SGE); case SLANG_OPER_LESSEQUAL: - return new_node2(IR_SLE, - _slang_gen_operation(A, &oper->children[0]), - _slang_gen_operation(A, &oper->children[1])); + return _slang_gen_compare(A, oper, IR_SLE); case SLANG_OPER_ADD: { slang_ir_node *n; @@ -3346,6 +3608,8 @@ _slang_gen_operation(slang_assemble_ctx * A, slang_operation *oper) for (i = 0; i < oper->num_children; i++) { slang_ir_node *n = _slang_gen_operation(A, &oper->children[i]); tree = new_seq(tree, n); + if (n) + tree->Store = n->Store; } if (oper->type == SLANG_OPER_NON_INLINED_CALL) { tree = new_function_call(tree, oper->label); @@ -3418,19 +3682,45 @@ _slang_codegen_global_variable(slang_assemble_ctx *A, slang_variable *var, * store->Index = sampler number (0..7, typically) * store->Size = texture type index (1D, 2D, 3D, cube, etc) */ - GLint sampNum = _mesa_add_sampler(prog->Parameters, varName, datatype); - store = _slang_new_ir_storage(PROGRAM_SAMPLER, sampNum, texIndex); + if (var->initializer) { + slang_info_log_error(A->log, "illegal assignment to '%s'", varName); + return GL_FALSE; + } +#if FEATURE_es2_glsl /* XXX should use FEATURE_texture_rect */ + /* disallow rect samplers */ + if (var->type.specifier.type == SLANG_SPEC_SAMPLER2DRECT || + var->type.specifier.type == SLANG_SPEC_SAMPLER2DRECTSHADOW) { + slang_info_log_error(A->log, "invalid sampler type for '%s'", varName); + return GL_FALSE; + } +#endif + { + GLint sampNum = _mesa_add_sampler(prog->Parameters, varName, datatype); + store = _slang_new_ir_storage(PROGRAM_SAMPLER, sampNum, texIndex); + } if (dbg) printf("SAMPLER "); } else if (var->type.qualifier == SLANG_QUAL_UNIFORM) { /* Uniform variable */ const GLint totalSize = array_size(size, var->array_len); const GLuint swizzle = _slang_var_swizzle(totalSize, 0); + + if (var->initializer) { + slang_info_log_error(A->log, "illegal initializer for uniform '%s'", varName); + return GL_FALSE; + } + if (prog) { /* user-defined uniform */ if (datatype == GL_NONE) { if (var->type.specifier.type == SLANG_SPEC_STRUCT) { - _mesa_problem(NULL, "user-declared uniform structs not supported yet"); + /* temporary work-around */ + GLenum datatype = GL_FLOAT; + GLint uniformLoc = _mesa_add_uniform(prog->Parameters, varName, + totalSize, datatype); + store = _slang_new_ir_storage_swz(PROGRAM_UNIFORM, uniformLoc, + totalSize, swizzle); + /* XXX what we need to do is unroll the struct into its * basic types, creating a uniform variable for each. * For example: @@ -3448,9 +3738,9 @@ _slang_codegen_global_variable(slang_assemble_ctx *A, slang_variable *var, else { slang_info_log_error(A->log, "invalid datatype for uniform variable %s", - (char *) var->a_name); + varName); + return GL_FALSE; } - return GL_FALSE; } else { GLint uniformLoc = _mesa_add_uniform(prog->Parameters, varName, @@ -3470,12 +3760,29 @@ _slang_codegen_global_variable(slang_assemble_ctx *A, slang_variable *var, if (dbg) printf("UNIFORM (sz %d) ", totalSize); } else if (var->type.qualifier == SLANG_QUAL_VARYING) { + const GLint totalSize = array_size(size, var->array_len); + + /* varyings must be float, vec or mat */ + if (!_slang_type_is_float_vec_mat(var->type.specifier.type) && + var->type.specifier.type != SLANG_SPEC_ARRAY) { + slang_info_log_error(A->log, + "varying '%s' must be float/vector/matrix", + varName); + return GL_FALSE; + } + + if (var->initializer) { + slang_info_log_error(A->log, "illegal initializer for varying '%s'", + varName); + return GL_FALSE; + } + if (prog) { /* user-defined varying */ - GLint varyingLoc = _mesa_add_varying(prog->Varying, varName, size); + GLint varyingLoc = _mesa_add_varying(prog->Varying, varName, totalSize); GLuint swizzle = _slang_var_swizzle(size, 0); store = _slang_new_ir_storage_swz(PROGRAM_VARYING, varyingLoc, - size, swizzle); + totalSize, swizzle); } else { /* pre-defined varying, like gl_Color or gl_TexCoord */ @@ -3504,6 +3811,14 @@ _slang_codegen_global_variable(slang_assemble_ctx *A, slang_variable *var, if (dbg) printf("VARYING "); } else if (var->type.qualifier == SLANG_QUAL_ATTRIBUTE) { + /* attributes must be float, vec or mat */ + if (!_slang_type_is_float_vec_mat(var->type.specifier.type)) { + slang_info_log_error(A->log, + "attribute '%s' must be float/vector/matrix", + varName); + return GL_FALSE; + } + if (prog) { /* user-defined vertex attribute */ const GLint attr = -1; /* unknown */ @@ -3559,7 +3874,7 @@ _slang_codegen_global_variable(slang_assemble_ctx *A, slang_variable *var, if (var->initializer) { slang_ir_node *lhs, *rhs, *init; - /* Generate IR_MOVE instruction to initialize the variable */ + /* Generate IR_COPY instruction to initialize the variable */ lhs = new_node0(IR_VAR); lhs->Var = var; lhs->Store = n->Store; @@ -3569,7 +3884,7 @@ _slang_codegen_global_variable(slang_assemble_ctx *A, slang_variable *var, rhs = _slang_gen_operation(A, var->initializer); assert(rhs); - init = new_node2(IR_MOVE, lhs, rhs); + init = new_node2(IR_COPY, lhs, rhs); n = new_seq(n, init); } diff --git a/src/mesa/shader/slang/slang_codegen.h b/src/mesa/shader/slang/slang_codegen.h index 821d396162..ba7ca4c142 100644 --- a/src/mesa/shader/slang/slang_codegen.h +++ b/src/mesa/shader/slang/slang_codegen.h @@ -27,7 +27,7 @@ #define SLANG_CODEGEN_H -#include "imports.h" +#include "main/imports.h" #include "slang_compile.h" diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c index 82df9b95d3..9cf0f8b81a 100644 --- a/src/mesa/shader/slang/slang_compile.c +++ b/src/mesa/shader/slang/slang_compile.c @@ -61,6 +61,20 @@ /** + * Check if the given identifier is legal. + */ +static GLboolean +legal_identifier(slang_atom name) +{ + /* "gl_" is a reserved prefix */ + if (_mesa_strncmp((char *) name, "gl_", 3) == 0) { + return GL_FALSE; + } + return GL_TRUE; +} + + +/** * Allocate storage for a variable of 'size' bytes from given pool. * Return the allocated address for the variable. */ @@ -223,7 +237,7 @@ parse_float(slang_parse_ctx * C, float *number) } /* revision number - increment after each change affecting emitted output */ -#define REVISION 3 +#define REVISION 4 static int check_revision(slang_parse_ctx * C) @@ -677,14 +691,49 @@ parse_type_specifier(slang_parse_ctx * C, slang_output_ctx * O, return 1; } +#define PRECISION_DEFAULT 0 +#define PRECISION_LOW 1 +#define PRECISION_MEDIUM 2 +#define PRECISION_HIGH 3 + static int parse_fully_specified_type(slang_parse_ctx * C, slang_output_ctx * O, slang_fully_specified_type * type) { + GLuint precision; + if (!parse_type_qualifier(C, &type->qualifier)) return 0; + precision = *C->I++; if (!parse_type_specifier(C, O, &type->specifier)) return 0; + + switch (precision) { + case PRECISION_DEFAULT: + assert(type->specifier.type < TYPE_SPECIFIER_COUNT); + if (type->specifier.type < TYPE_SPECIFIER_COUNT) + type->precision = O->default_precision[type->specifier.type]; + break; + case PRECISION_LOW: + type->precision = SLANG_PREC_LOW; + break; + case PRECISION_MEDIUM: + type->precision = SLANG_PREC_MEDIUM; + break; + case PRECISION_HIGH: + type->precision = SLANG_PREC_HIGH; + break; + default: + return 0; + } + +#if !FEATURE_es2_glsl + if (precision != PRECISION_DEFAULT) { + slang_info_log_error(C->L, "precision qualifiers not allowed"); + return 0; + } +#endif + return 1; } @@ -835,6 +884,12 @@ parse_statement(slang_parse_ctx * C, slang_output_ctx * O, o->type = SLANG_OPER_VARIABLE_DECL; o->locals->outer_scope = O->vars; o->a_id = O->vars->variables[i]->a_name; + + if (!legal_identifier(o->a_id)) { + slang_info_log_error(C->L, "illegal variable name '%s'", + (char *) o->a_id); + return 0; + } } } } @@ -1404,6 +1459,7 @@ parse_operator_name(slang_parse_ctx * C) return 0; } + static int parse_function_prototype(slang_parse_ctx * C, slang_output_ctx * O, slang_function * func) @@ -1441,6 +1497,12 @@ parse_function_prototype(slang_parse_ctx * C, slang_output_ctx * O, return 0; } + if (!legal_identifier(func->header.a_name)) { + slang_info_log_error(C->L, "illegal function name '%s'", + (char *) func->header.a_name); + return 0; + } + /* parse function parameters */ while (*C->I++ == PARAMETER_NEXT) { slang_variable *p = slang_variable_scope_grow(func->parameters); @@ -1842,11 +1904,6 @@ parse_declaration(slang_parse_ctx * C, slang_output_ctx * O) return 1; } - -#define PRECISION_LOW 0 -#define PRECISION_MEDIUM 1 -#define PRECISION_HIGH 2 - static int parse_default_precision(slang_parse_ctx * C, slang_output_ctx * O) { @@ -2025,6 +2082,12 @@ parse_code_unit(slang_parse_ctx * C, slang_code_unit * unit, A.vartable = o.vartable; A.log = C->L; + /* main() takes no parameters */ + if (mainFunc->param_count > 0) { + slang_info_log_error(A.log, "main() takes no arguments"); + return GL_FALSE; + } + _slang_codegen_function(&A, mainFunc); shader->Main = GL_TRUE; /* this shader defines main() */ @@ -2368,19 +2431,20 @@ _slang_compile(GLcontext *ctx, struct gl_shader *shader) _slang_delete_mempool((slang_mempool *) ctx->Shader.MemPool); ctx->Shader.MemPool = NULL; - if (shader->Type == GL_VERTEX_SHADER) { - /* remove any reads of varying (output) registers */ + /* remove any reads of output registers */ #if 0 - printf("Pre-remove output reads:\n"); - _mesa_print_program(shader->Programs); + printf("Pre-remove output reads:\n"); + _mesa_print_program(shader->Program); #endif + _mesa_remove_output_reads(shader->Program, PROGRAM_OUTPUT); + if (shader->Type == GL_VERTEX_SHADER) { + /* and remove writes to varying vars in vertex programs */ _mesa_remove_output_reads(shader->Program, PROGRAM_VARYING); - _mesa_remove_output_reads(shader->Program, PROGRAM_OUTPUT); + } #if 0 - printf("Post-remove output reads:\n"); - _mesa_print_program(shader->Programs); + printf("Post-remove output reads:\n"); + _mesa_print_program(shader->Program); #endif - } return success; } diff --git a/src/mesa/shader/slang/slang_compile.h b/src/mesa/shader/slang/slang_compile.h index 0f1f820d2e..35e468b44e 100644 --- a/src/mesa/shader/slang/slang_compile.h +++ b/src/mesa/shader/slang/slang_compile.h @@ -25,8 +25,8 @@ #if !defined SLANG_COMPILE_H #define SLANG_COMPILE_H -#include "imports.h" -#include "mtypes.h" +#include "main/imports.h" +#include "main/mtypes.h" #include "slang_typeinfo.h" #include "slang_compile_variable.h" #include "slang_compile_struct.h" diff --git a/src/mesa/shader/slang/slang_compile_function.c b/src/mesa/shader/slang/slang_compile_function.c index 80769b33ae..8405d7f778 100644 --- a/src/mesa/shader/slang/slang_compile_function.c +++ b/src/mesa/shader/slang/slang_compile_function.c @@ -28,7 +28,7 @@ * \author Michal Krol */ -#include "imports.h" +#include "main/imports.h" #include "slang_compile.h" #include "slang_mem.h" diff --git a/src/mesa/shader/slang/slang_compile_operation.c b/src/mesa/shader/slang/slang_compile_operation.c index 4d2fd5b666..c0d469c829 100644 --- a/src/mesa/shader/slang/slang_compile_operation.c +++ b/src/mesa/shader/slang/slang_compile_operation.c @@ -28,7 +28,7 @@ * \author Michal Krol */ -#include "imports.h" +#include "main/imports.h" #include "slang_compile.h" #include "slang_mem.h" diff --git a/src/mesa/shader/slang/slang_compile_struct.c b/src/mesa/shader/slang/slang_compile_struct.c index 063db37709..e6c38730d7 100644 --- a/src/mesa/shader/slang/slang_compile_struct.c +++ b/src/mesa/shader/slang/slang_compile_struct.c @@ -28,7 +28,7 @@ * \author Michal Krol */ -#include "imports.h" +#include "main/imports.h" #include "slang_mem.h" #include "slang_compile.h" @@ -124,8 +124,7 @@ slang_struct_destruct(slang_struct * stru) { slang_variable_scope_destruct(stru->fields); _slang_free(stru->fields); - if (stru->structs) - slang_struct_scope_destruct(stru->structs); + slang_struct_scope_destruct(stru->structs); _slang_free(stru->structs); } diff --git a/src/mesa/shader/slang/slang_compile_variable.c b/src/mesa/shader/slang/slang_compile_variable.c index 09ad26f62f..3428b49e16 100644 --- a/src/mesa/shader/slang/slang_compile_variable.c +++ b/src/mesa/shader/slang/slang_compile_variable.c @@ -28,7 +28,7 @@ * \author Michal Krol */ -#include "imports.h" +#include "main/imports.h" #include "slang_compile.h" #include "slang_mem.h" diff --git a/src/mesa/shader/slang/slang_compile_variable.h b/src/mesa/shader/slang/slang_compile_variable.h index 9b0f85859a..d81a3d2869 100644 --- a/src/mesa/shader/slang/slang_compile_variable.h +++ b/src/mesa/shader/slang/slang_compile_variable.h @@ -51,10 +51,20 @@ slang_type_specifier_type_to_string(slang_type_specifier_type); +typedef enum slang_type_precision_ +{ + SLANG_PREC_DEFAULT, + SLANG_PREC_LOW, + SLANG_PREC_MEDIUM, + SLANG_PREC_HIGH +} slang_type_precision; + + typedef struct slang_fully_specified_type_ { slang_type_qualifier qualifier; slang_type_specifier specifier; + slang_type_precision precision; } slang_fully_specified_type; extern int diff --git a/src/mesa/shader/slang/slang_emit.c b/src/mesa/shader/slang/slang_emit.c index 9991a7caee..9e8daa1051 100644 --- a/src/mesa/shader/slang/slang_emit.c +++ b/src/mesa/shader/slang/slang_emit.c @@ -108,7 +108,9 @@ writemask_to_swizzle(GLuint writemask) /** - * Swizzle a swizzle. That is, return swz2(swz1) + * Swizzle a swizzle (function composition). + * That is, return swz2(swz1), or said another way: swz1.szw2 + * Example: swizzle_swizzle(".zwxx", ".xxyw") yields ".zzwx" */ GLuint _slang_swizzle_swizzle(GLuint swz1, GLuint swz2) @@ -127,22 +129,33 @@ _slang_swizzle_swizzle(GLuint swz1, GLuint swz2) /** - * Allocate temporary storage for an intermediate result (such as for - * a multiply or add, etc. + * Allocate storage for the given node (if it hasn't already been allocated). + * + * Typically this is temporary storage for an intermediate result (such as + * for a multiply or add, etc). + * + * If n->Store does not exist it will be created and will be of the size + * specified by defaultSize. */ static GLboolean -alloc_temp_storage(slang_emit_info *emitInfo, slang_ir_node *n, GLint size) +alloc_node_storage(slang_emit_info *emitInfo, slang_ir_node *n, + GLint defaultSize) { assert(!n->Var); - assert(!n->Store); - assert(size > 0); - n->Store = _slang_new_ir_storage(PROGRAM_TEMPORARY, -1, size); - if (!_slang_alloc_temp(emitInfo->vt, n->Store)) { - slang_info_log_error(emitInfo->log, - "Ran out of registers, too many temporaries"); - _slang_free(n->Store); - n->Store = NULL; - return GL_FALSE; + if (!n->Store) { + assert(defaultSize > 0); + n->Store = _slang_new_ir_storage(PROGRAM_TEMPORARY, -1, defaultSize); + } + + /* now allocate actual register(s). I.e. set n->Store->Index >= 0 */ + if (n->Store->Index < 0) { + if (!_slang_alloc_temp(emitInfo->vt, n->Store)) { + slang_info_log_error(emitInfo->log, + "Ran out of registers, too many temporaries"); + _slang_free(n->Store); + n->Store = NULL; + return GL_FALSE; + } } return GL_TRUE; } @@ -153,7 +166,7 @@ alloc_temp_storage(slang_emit_info *emitInfo, slang_ir_node *n, GLint size) * Otherwise, no-op. */ static void -free_temp_storage(slang_var_table *vt, slang_ir_node *n) +free_node_storage(slang_var_table *vt, slang_ir_node *n) { if (n->Store->File == PROGRAM_TEMPORARY && n->Store->Index >= 0 && @@ -167,6 +180,22 @@ free_temp_storage(slang_var_table *vt, slang_ir_node *n) } +/** + * Helper function to allocate a short-term temporary. + * Free it with _slang_free_temp(). + */ +static GLboolean +alloc_local_temp(slang_emit_info *emitInfo, slang_ir_storage *temp, GLint size) +{ + assert(size >= 1); + assert(size <= 4); + _mesa_bzero(temp, sizeof(*temp)); + temp->Size = size; + temp->File = PROGRAM_TEMPORARY; + temp->Index = -1; + return _slang_alloc_temp(emitInfo->vt, temp); +} + /** * Remove any SWIZZLE_NIL terms from given swizzle mask. @@ -252,7 +281,7 @@ storage_to_src_reg(struct prog_src_register *src, const slang_ir_storage *st) while (st->Parent) { st = st->Parent; index += st->Index; - swizzle = _slang_swizzle_swizzle(st->Swizzle, swizzle); + swizzle = _slang_swizzle_swizzle(fix_swizzle(st->Swizzle), swizzle); } assert(st->File >= 0); @@ -584,19 +613,15 @@ emit_arith(slang_emit_info *emitInfo, slang_ir_node *n) } /* result storage */ - if (!n->Store) { - GLint size = info->ResultSize; - if (!alloc_temp_storage(emitInfo, n, size)) - return NULL; -#if 0000 /* this should work, but doesn't yet */ - if (size == 2) - n->Writemask = WRITEMASK_XY; - else if (size == 3) - n->Writemask = WRITEMASK_XYZ; - else if (size == 1) - n->Writemask = WRITEMASK_X << GET_SWZ(n->Store->Swizzle,0); -#endif - } + alloc_node_storage(emitInfo, n, -1); + assert(n->Store->Index >= 0); + if (n->Store->Size == 2) + n->Writemask = WRITEMASK_XY; + else if (n->Store->Size == 3) + n->Writemask = WRITEMASK_XYZ; + else if (n->Store->Size == 1) + n->Writemask = WRITEMASK_X << GET_SWZ(n->Store->Swizzle, 0); + storage_to_dst_reg(&inst->DstReg, n->Store, n->Writemask); @@ -608,7 +633,7 @@ emit_arith(slang_emit_info *emitInfo, slang_ir_node *n) /* really free temps now */ for (i = 0; i < 3; i++) if (temps[i]) - free_temp_storage(emitInfo->vt, temps[i]); + free_node_storage(emitInfo->vt, temps[i]); /*_mesa_print_instruction(inst);*/ return inst; @@ -636,16 +661,15 @@ emit_compare(slang_emit_info *emitInfo, slang_ir_node *n) return NULL; } + /* final result is 1 bool */ + if (!alloc_node_storage(emitInfo, n, 1)) + return NULL; + size = n->Children[0]->Store->Size; if (size == 1) { gl_inst_opcode opcode; - if (!n->Store) { - if (!alloc_temp_storage(emitInfo, n, 1)) /* 1 bool */ - return NULL; - } - opcode = n->Opcode == IR_EQUAL ? OPCODE_SEQ : OPCODE_SNE; inst = new_instruction(emitInfo, opcode); storage_to_src_reg(&inst->SrcReg[0], n->Children[0]->Store); @@ -655,11 +679,11 @@ emit_compare(slang_emit_info *emitInfo, slang_ir_node *n) else if (size <= 4) { GLuint swizzle; gl_inst_opcode dotOp; - - assert(!n->Store); - if (!n->Store) { - if (!alloc_temp_storage(emitInfo, n, size)) /* 'size' bools */ - return NULL; + slang_ir_storage tempStore; + + if (!alloc_local_temp(emitInfo, &tempStore, 4)) { + return NULL; + /* out of temps */ } if (size == 4) { @@ -676,26 +700,25 @@ emit_compare(slang_emit_info *emitInfo, slang_ir_node *n) swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Y, SWIZZLE_Y); } - /* Compute equality, inequality (tmp1 = (A ?= B)) */ + /* Compute inequality (temp = (A != B)) */ inst = new_instruction(emitInfo, OPCODE_SNE); + storage_to_dst_reg(&inst->DstReg, &tempStore, n->Writemask); storage_to_src_reg(&inst->SrcReg[0], n->Children[0]->Store); storage_to_src_reg(&inst->SrcReg[1], n->Children[1]->Store); - storage_to_dst_reg(&inst->DstReg, n->Store, n->Writemask); inst->Comment = _mesa_strdup("Compare values"); - /* Compute tmp2 = DOT(tmp1, tmp1) (reduction) */ + /* Compute val = DOT(temp, temp) (reduction) */ inst = new_instruction(emitInfo, dotOp); - storage_to_src_reg(&inst->SrcReg[0], n->Store); - storage_to_src_reg(&inst->SrcReg[1], n->Store); - inst->SrcReg[0].Swizzle = inst->SrcReg[1].Swizzle = swizzle; /*override*/ - free_temp_storage(emitInfo->vt, n); /* free tmp1 */ - if (!alloc_temp_storage(emitInfo, n, 1)) /* alloc tmp2 */ - return NULL; storage_to_dst_reg(&inst->DstReg, n->Store, n->Writemask); + storage_to_src_reg(&inst->SrcReg[0], &tempStore); + storage_to_src_reg(&inst->SrcReg[1], &tempStore); + inst->SrcReg[0].Swizzle = inst->SrcReg[1].Swizzle = swizzle; /*override*/ inst->Comment = _mesa_strdup("Reduce vec to bool"); + _slang_free_temp(emitInfo->vt, &tempStore); /* free temp */ + if (n->Opcode == IR_EQUAL) { - /* compute tmp2.x = !tmp2.x via tmp2.x = (tmp2.x == 0) */ + /* compute val = !val.x with SEQ val, val, 0; */ inst = new_instruction(emitInfo, OPCODE_SEQ); storage_to_src_reg(&inst->SrcReg[0], n->Store); constant_to_src_reg(&inst->SrcReg[1], 0.0, emitInfo); @@ -708,73 +731,59 @@ emit_compare(slang_emit_info *emitInfo, slang_ir_node *n) * XXX this won't work reliably for structs with padding!! */ GLint i, num = (n->Children[0]->Store->Size + 3) / 4; - slang_ir_storage accTemp; + slang_ir_storage accTemp, sneTemp; - if (!n->Store) { - if (!alloc_temp_storage(emitInfo, n, 4)) - return NULL; - } + if (!alloc_local_temp(emitInfo, &accTemp, 4)) + return NULL; - accTemp.Size = 4; - accTemp.File = PROGRAM_TEMPORARY; - if (!_slang_alloc_temp(emitInfo->vt, &accTemp)) { + if (!alloc_local_temp(emitInfo, &sneTemp, 4)) return NULL; - /* out of temps */ - } for (i = 0; i < num; i++) { - /* SNE t0, left[i], right[i] */ + /* SNE sneTemp, left[i], right[i] */ inst = new_instruction(emitInfo, OPCODE_SNE); storage_to_src_reg(&inst->SrcReg[0], n->Children[0]->Store); storage_to_src_reg(&inst->SrcReg[1], n->Children[1]->Store); inst->SrcReg[0].Index += i; inst->SrcReg[1].Index += i; if (i == 0) { - inst->DstReg.File = accTemp.File; - inst->DstReg.Index = accTemp.Index; + storage_to_dst_reg(&inst->DstReg, &accTemp, WRITEMASK_XYZW); inst->Comment = _mesa_strdup("Begin struct/array comparison"); } else { - inst->DstReg.File = n->Store->File; - inst->DstReg.Index = n->Store->Index; - } - if (i > 0) { - /* ADD accTemp, accTemp, temp; # like logical-OR */ + storage_to_dst_reg(&inst->DstReg, &sneTemp, WRITEMASK_XYZW); + + /* ADD accTemp, accTemp, sneTemp; # like logical-OR */ inst = new_instruction(emitInfo, OPCODE_ADD); - inst->SrcReg[0].File = accTemp.File; - inst->SrcReg[0].Index = accTemp.Index; - inst->SrcReg[1].File = n->Store->File; - inst->SrcReg[1].Index = n->Store->Index; - inst->DstReg.File = accTemp.File; - inst->DstReg.Index = accTemp.Index; + storage_to_dst_reg(&inst->DstReg, &accTemp, WRITEMASK_XYZW); + storage_to_src_reg(&inst->SrcReg[0], &accTemp); + storage_to_src_reg(&inst->SrcReg[1], &sneTemp); } } /* compute accTemp.x || accTemp.y || accTemp.z || accTemp.w with DOT4 */ inst = new_instruction(emitInfo, OPCODE_DP4); - inst->SrcReg[0].File = accTemp.File; - inst->SrcReg[0].Index = accTemp.Index; - inst->SrcReg[1].File = accTemp.File; - inst->SrcReg[1].Index = accTemp.Index; - inst->DstReg.File = n->Store->File; - inst->DstReg.Index = n->Store->Index; + storage_to_dst_reg(&inst->DstReg, n->Store, n->Writemask); + storage_to_src_reg(&inst->SrcReg[0], &accTemp); + storage_to_src_reg(&inst->SrcReg[1], &accTemp); inst->Comment = _mesa_strdup("End struct/array comparison"); if (n->Opcode == IR_EQUAL) { /* compute tmp.x = !tmp.x via tmp.x = (tmp.x == 0) */ inst = new_instruction(emitInfo, OPCODE_SEQ); + storage_to_dst_reg(&inst->DstReg, n->Store, n->Writemask); storage_to_src_reg(&inst->SrcReg[0], n->Store); constant_to_src_reg(&inst->SrcReg[1], 0.0, emitInfo); - storage_to_dst_reg(&inst->DstReg, n->Store, n->Writemask); inst->Comment = _mesa_strdup("Invert true/false"); } _slang_free_temp(emitInfo->vt, &accTemp); + _slang_free_temp(emitInfo->vt, &sneTemp); } /* free temps */ - free_temp_storage(emitInfo->vt, n->Children[0]); - free_temp_storage(emitInfo->vt, n->Children[1]); + free_node_storage(emitInfo->vt, n->Children[0]); + free_node_storage(emitInfo->vt, n->Children[1]); return inst; } @@ -827,9 +836,8 @@ emit_clamp(slang_emit_info *emitInfo, slang_ir_node *n) } #endif - if (!n->Store) - if (!alloc_temp_storage(emitInfo, n, n->Children[0]->Store->Size)) - return NULL; + if (!alloc_node_storage(emitInfo, n, n->Children[0]->Store->Size)) + return NULL; emit(emitInfo, n->Children[1]); emit(emitInfo, n->Children[2]); @@ -839,7 +847,7 @@ emit_clamp(slang_emit_info *emitInfo, slang_ir_node *n) * the intermediate result. Use a temp register instead. */ _mesa_bzero(&tmpNode, sizeof(tmpNode)); - alloc_temp_storage(emitInfo, &tmpNode, n->Store->Size); + alloc_node_storage(emitInfo, &tmpNode, n->Store->Size); /* tmp = max(ch[0], ch[1]) */ inst = new_instruction(emitInfo, OPCODE_MAX); @@ -853,7 +861,7 @@ emit_clamp(slang_emit_info *emitInfo, slang_ir_node *n) storage_to_src_reg(&inst->SrcReg[0], tmpNode.Store); storage_to_src_reg(&inst->SrcReg[1], n->Children[2]->Store); - free_temp_storage(emitInfo->vt, &tmpNode); + free_node_storage(emitInfo->vt, &tmpNode); return inst; } @@ -870,9 +878,8 @@ emit_negation(slang_emit_info *emitInfo, slang_ir_node *n) emit(emitInfo, n->Children[0]); - if (!n->Store) - if (!alloc_temp_storage(emitInfo, n, n->Children[0]->Store->Size)) - return NULL; + if (!alloc_node_storage(emitInfo, n, n->Children[0]->Store->Size)) + return NULL; inst = new_instruction(emitInfo, OPCODE_MOV); storage_to_dst_reg(&inst->DstReg, n->Store, n->Writemask); @@ -986,7 +993,7 @@ emit_kill(slang_emit_info *emitInfo) * Note that ARB-KILL depends on sign of vector operand. */ inst = new_instruction(emitInfo, OPCODE_KIL_NV); - inst->DstReg.CondMask = COND_TR; /* always branch */ + inst->DstReg.CondMask = COND_TR; /* always kill */ assert(emitInfo->prog->Target == GL_FRAGMENT_PROGRAM_ARB); fp = (struct gl_fragment_program *) emitInfo->prog; @@ -1014,14 +1021,12 @@ emit_tex(slang_emit_info *emitInfo, slang_ir_node *n) inst = new_instruction(emitInfo, OPCODE_TXP); } - if (!n->Store) - if (!alloc_temp_storage(emitInfo, n, 4)) - return NULL; + if (!alloc_node_storage(emitInfo, n, 4)) + return NULL; storage_to_dst_reg(&inst->DstReg, n->Store, n->Writemask); /* Child[1] is the coord */ - /*assert(n->Children[1]->Store->File != PROGRAM_UNDEFINED);*/ assert(n->Children[1]->Store->Index >= 0); storage_to_src_reg(&inst->SrcReg[0], n->Children[1]->Store); @@ -1046,12 +1051,15 @@ emit_tex(slang_emit_info *emitInfo, slang_ir_node *n) } +/** + * Assignment/copy + */ static struct prog_instruction * -emit_move(slang_emit_info *emitInfo, slang_ir_node *n) +emit_copy(slang_emit_info *emitInfo, slang_ir_node *n) { struct prog_instruction *inst; - assert(n->Opcode == IR_MOVE); + assert(n->Opcode == IR_COPY); /* lhs */ emit(emitInfo, n->Children[0]); @@ -1116,7 +1124,7 @@ emit_move(slang_emit_info *emitInfo, slang_ir_node *n) srcStore.Size = 4; while (size >= 4) { inst = new_instruction(emitInfo, OPCODE_MOV); - inst->Comment = _mesa_strdup("IR_MOVE block"); + inst->Comment = _mesa_strdup("IR_COPY block"); storage_to_dst_reg(&inst->DstReg, &dstStore, n->Writemask); storage_to_src_reg(&inst->SrcReg[0], &srcStore); srcStore.Index++; @@ -1136,7 +1144,7 @@ emit_move(slang_emit_info *emitInfo, slang_ir_node *n) inst->Comment = instruction_annotation(inst->Opcode, dstAnnot, srcAnnot, NULL, NULL); } - free_temp_storage(emitInfo->vt, n->Children[1]); + free_node_storage(emitInfo->vt, n->Children[1]); return inst; } } @@ -1185,7 +1193,7 @@ emit_cond(slang_emit_info *emitInfo, slang_ir_node *n) * is normally generated for the expression "i". * Generate a move instruction just to set condition codes. */ - if (!alloc_temp_storage(emitInfo, n, 1)) + if (!alloc_node_storage(emitInfo, n, 1)) return NULL; inst = new_instruction(emitInfo, OPCODE_MOV); inst->CondUpdate = GL_TRUE; @@ -1241,15 +1249,14 @@ emit_not(slang_emit_info *emitInfo, slang_ir_node *n) #endif /* else, invert using SEQ (v = v == 0) */ - if (!n->Store) - if (!alloc_temp_storage(emitInfo, n, n->Children[0]->Store->Size)) - return NULL; + if (!alloc_node_storage(emitInfo, n, n->Children[0]->Store->Size)) + return NULL; inst = new_instruction(emitInfo, OPCODE_SEQ); storage_to_dst_reg(&inst->DstReg, n->Store, n->Writemask); storage_to_src_reg(&inst->SrcReg[0], n->Children[0]->Store); constant_to_src_reg(&inst->SrcReg[1], 0.0, emitInfo); - free_temp_storage(emitInfo->vt, n->Children[0]); + free_node_storage(emitInfo->vt, n->Children[0]); inst->Comment = _mesa_strdup("NOT"); return inst; @@ -1622,11 +1629,97 @@ emit_struct_field(slang_emit_info *emitInfo, slang_ir_node *n) return NULL; } } + else { + /* do codegen for struct */ + emit(emitInfo, n->Children[0]); + } return NULL; /* no instruction */ } +/** + * Emit code for a variable declaration. + * This usually doesn't result in any code generation, but just + * memory allocation. + */ +static struct prog_instruction * +emit_var_decl(slang_emit_info *emitInfo, slang_ir_node *n) +{ + struct prog_instruction *inst; + + assert(n->Store); + assert(n->Store->File != PROGRAM_UNDEFINED); + assert(n->Store->Size > 0); + /*assert(n->Store->Index < 0);*/ + + if (!n->Var || n->Var->isTemp) { + /* a nameless/temporary variable, will be freed after first use */ + /*NEW*/ + if (n->Store->Index < 0 && !_slang_alloc_temp(emitInfo->vt, n->Store)) { + slang_info_log_error(emitInfo->log, + "Ran out of registers, too many temporaries"); + return NULL; + } + } + else { + /* a regular variable */ + _slang_add_variable(emitInfo->vt, n->Var); + if (!_slang_alloc_var(emitInfo->vt, n->Store)) { + slang_info_log_error(emitInfo->log, + "Ran out of registers, too many variables"); + return NULL; + } + /* + printf("IR_VAR_DECL %s %d store %p\n", + (char*) n->Var->a_name, n->Store->Index, (void*) n->Store); + */ + assert(n->Var->aux == n->Store); + } + if (emitInfo->EmitComments) { + /* emit NOP with comment describing the variable's storage location */ + char s[1000]; + sprintf(s, "TEMP[%d]%s = variable %s (size %d)", + n->Store->Index, + _mesa_swizzle_string(n->Store->Swizzle, 0, GL_FALSE), + (n->Var ? (char *) n->Var->a_name : "anonymous"), + n->Store->Size); + inst = emit_comment(emitInfo, s); + return inst; + } + return NULL; +} + + +/** + * Emit code for a reference to a variable. + * Actually, no code is generated but we may do some memory alloation. + * In particular, state vars (uniforms) are allocated on an as-needed basis. + */ +static struct prog_instruction * +emit_var_ref(slang_emit_info *emitInfo, slang_ir_node *n) +{ + assert(n->Store); + assert(n->Store->File != PROGRAM_UNDEFINED); + + if (n->Store->File == PROGRAM_STATE_VAR && n->Store->Index < 0) { + n->Store->Index = _slang_alloc_statevar(n, emitInfo->prog->Parameters); + } + else if (n->Store->File == PROGRAM_UNIFORM) { + /* mark var as used */ + _mesa_use_uniform(emitInfo->prog->Parameters, (char *) n->Var->a_name); + } + + if (n->Store->Index < 0) { + /* probably ran out of registers */ + return NULL; + } + assert(n->Store->Size > 0); + + return NULL; +} + + static struct prog_instruction * emit(slang_emit_info *emitInfo, slang_ir_node *n) { @@ -1634,12 +1727,18 @@ emit(slang_emit_info *emitInfo, slang_ir_node *n) if (!n) return NULL; + if (emitInfo->log->error_flag) { + return NULL; + } + switch (n->Opcode) { case IR_SEQ: /* sequence of two sub-trees */ assert(n->Children[0]); assert(n->Children[1]); emit(emitInfo, n->Children[0]); + if (emitInfo->log->error_flag) + return NULL; inst = emit(emitInfo, n->Children[1]); #if 0 assert(!n->Store); @@ -1656,64 +1755,14 @@ emit(slang_emit_info *emitInfo, slang_ir_node *n) case IR_VAR_DECL: /* Variable declaration - allocate a register for it */ - assert(n->Store); - assert(n->Store->File != PROGRAM_UNDEFINED); - assert(n->Store->Size > 0); - /*assert(n->Store->Index < 0);*/ - if (!n->Var || n->Var->isTemp) { - /* a nameless/temporary variable, will be freed after first use */ - /*NEW*/ - if (n->Store->Index < 0 && !_slang_alloc_temp(emitInfo->vt, n->Store)) { - slang_info_log_error(emitInfo->log, - "Ran out of registers, too many temporaries"); - return NULL; - } - } - else { - /* a regular variable */ - _slang_add_variable(emitInfo->vt, n->Var); - if (!_slang_alloc_var(emitInfo->vt, n->Store)) { - slang_info_log_error(emitInfo->log, - "Ran out of registers, too many variables"); - return NULL; - } - /* - printf("IR_VAR_DECL %s %d store %p\n", - (char*) n->Var->a_name, n->Store->Index, (void*) n->Store); - */ - assert(n->Var->aux == n->Store); - } - if (emitInfo->EmitComments) { - /* emit NOP with comment describing the variable's storage location */ - char s[1000]; - sprintf(s, "TEMP[%d]%s = variable %s (size %d)", - n->Store->Index, - _mesa_swizzle_string(n->Store->Swizzle, 0, GL_FALSE), - (n->Var ? (char *) n->Var->a_name : "anonymous"), - n->Store->Size); - inst = emit_comment(emitInfo, s); - return inst; - } - return NULL; + inst = emit_var_decl(emitInfo, n); + return inst; case IR_VAR: /* Reference to a variable * Storage should have already been resolved/allocated. */ - assert(n->Store); - assert(n->Store->File != PROGRAM_UNDEFINED); - - if (n->Store->File == PROGRAM_STATE_VAR && - n->Store->Index < 0) { - n->Store->Index = _slang_alloc_statevar(n, emitInfo->prog->Parameters); - } - - if (n->Store->Index < 0) { - /* probably ran out of registers */ - return NULL; - } - assert(n->Store->Size > 0); - break; + return emit_var_ref(emitInfo, n); case IR_ELEMENT: return emit_array_element(emitInfo, n); @@ -1722,27 +1771,15 @@ emit(slang_emit_info *emitInfo, slang_ir_node *n) case IR_SWIZZLE: return emit_swizzle(emitInfo, n); - case IR_I_TO_F: - /* just move */ - emit(emitInfo, n->Children[0]); - inst = new_instruction(emitInfo, OPCODE_MOV); - if (!n->Store) { - if (!alloc_temp_storage(emitInfo, n, 1)) - return NULL; - } - storage_to_dst_reg(&inst->DstReg, n->Store, n->Writemask); - storage_to_src_reg(&inst->SrcReg[0], n->Children[0]->Store); - if (emitInfo->EmitComments) - inst->Comment = _mesa_strdup("int to float"); - return NULL; - /* Simple arithmetic */ /* unary */ + case IR_MOVE: case IR_RSQ: case IR_RCP: case IR_FLOOR: case IR_FRAC: case IR_F_TO_I: + case IR_I_TO_F: case IR_ABS: case IR_SIN: case IR_COS: @@ -1799,8 +1836,8 @@ emit(slang_emit_info *emitInfo, slang_ir_node *n) } return NULL; - case IR_MOVE: - return emit_move(emitInfo, n); + case IR_COPY: + return emit_copy(emitInfo, n); case IR_COND: return emit_cond(emitInfo, n); @@ -1936,6 +1973,7 @@ _slang_emit_code(slang_ir_node *n, slang_var_table *vt, GET_CURRENT_CONTEXT(ctx); GLboolean success; slang_emit_info emitInfo; + GLuint maxUniforms; emitInfo.log = log; emitInfo.vt = vt; @@ -1952,6 +1990,19 @@ _slang_emit_code(slang_ir_node *n, slang_var_table *vt, emitInfo.EmitHighLevelInstructions = GL_TRUE; } + /* Check uniform/constant limits */ + if (prog->Target == GL_FRAGMENT_PROGRAM_ARB) { + maxUniforms = ctx->Const.FragmentProgram.MaxUniformComponents / 4; + } + else { + assert(prog->Target == GL_VERTEX_PROGRAM_ARB); + maxUniforms = ctx->Const.VertexProgram.MaxUniformComponents / 4; + } + if (prog->Parameters->NumParameters > maxUniforms) { + slang_info_log_error(log, "Constant/uniform register limit exceeded"); + return GL_FALSE; + } + (void) emit(&emitInfo, n); /* finish up by adding the END opcode to program */ diff --git a/src/mesa/shader/slang/slang_emit.h b/src/mesa/shader/slang/slang_emit.h index 153e872d74..4db4bbe562 100644 --- a/src/mesa/shader/slang/slang_emit.h +++ b/src/mesa/shader/slang/slang_emit.h @@ -26,10 +26,10 @@ #define SLANG_EMIT_H -#include "imports.h" +#include "main/imports.h" #include "slang_compile.h" #include "slang_ir.h" -#include "mtypes.h" +#include "main/mtypes.h" extern void diff --git a/src/mesa/shader/slang/slang_ir.c b/src/mesa/shader/slang/slang_ir.c index a414036a36..3a0b8bf3a0 100644 --- a/src/mesa/shader/slang/slang_ir.c +++ b/src/mesa/shader/slang/slang_ir.c @@ -23,8 +23,8 @@ */ -#include "imports.h" -#include "context.h" +#include "main/imports.h" +#include "main/context.h" #include "slang_ir.h" #include "slang_mem.h" #include "shader/prog_print.h" @@ -54,7 +54,8 @@ static const slang_ir_info IrInfo[] = { { IR_NOTEQUAL, "IR_NOTEQUAL", OPCODE_NOP, 1, 2 }, /* unary ops */ - { IR_I_TO_F, "IR_I_TO_F", OPCODE_NOP, 1, 1 }, + { IR_MOVE, "IR_MOVE", OPCODE_MOV, 4, 1 }, + { IR_I_TO_F, "IR_I_TO_F", OPCODE_MOV, 4, 1 }, /* int[4] to float[4] */ { IR_F_TO_I, "IR_F_TO_I", OPCODE_INT, 4, 1 }, /* 4 floats to 4 ints */ { IR_EXP, "IR_EXP", OPCODE_EXP, 1, 1 }, { IR_EXP2, "IR_EXP2", OPCODE_EX2, 1, 1 }, @@ -82,7 +83,7 @@ static const slang_ir_info IrInfo[] = { { IR_KILL, "IR_KILL", OPCODE_NOP, 0, 0 }, { IR_COND, "IR_COND", OPCODE_NOP, 0, 0 }, { IR_CALL, "IR_CALL", OPCODE_NOP, 0, 0 }, - { IR_MOVE, "IR_MOVE", OPCODE_NOP, 0, 1 }, + { IR_COPY, "IR_COPY", OPCODE_NOP, 0, 1 }, { IR_NOT, "IR_NOT", OPCODE_NOP, 1, 1 }, { IR_VAR, "IR_VAR", OPCODE_NOP, 0, 0 }, { IR_VAR_DECL, "IR_VAR_DECL", OPCODE_NOP, 0, 0 }, @@ -326,8 +327,8 @@ _slang_print_ir_tree(const slang_ir_node *n, int indent) assert(!n->Children[1]); _slang_print_ir_tree(n->Children[0], indent + 3); break; - case IR_MOVE: - printf("MOVE (writemask = %s)\n", writemask_string(n->Writemask)); + case IR_COPY: + printf("COPY (writemask = %s)\n", writemask_string(n->Writemask)); _slang_print_ir_tree(n->Children[0], indent+3); _slang_print_ir_tree(n->Children[1], indent+3); break; diff --git a/src/mesa/shader/slang/slang_ir.h b/src/mesa/shader/slang/slang_ir.h index 61ff649e5c..f64f9a93b7 100644 --- a/src/mesa/shader/slang/slang_ir.h +++ b/src/mesa/shader/slang/slang_ir.h @@ -33,10 +33,10 @@ #define SLANG_IR_H -#include "imports.h" +#include "main/imports.h" #include "slang_compile.h" #include "slang_label.h" -#include "mtypes.h" +#include "main/mtypes.h" /** @@ -70,14 +70,14 @@ typedef enum /* n->Parent = ptr to parent IR_LOOP Node */ IR_BREAK, /* break loop */ - IR_BREAK_IF_TRUE, + IR_BREAK_IF_TRUE, /**< Children[0] = the condition expression */ IR_CONT_IF_TRUE, - /* Children[0] = the condition expression */ - IR_MOVE, + IR_COPY, /**< assignment/copy */ + IR_MOVE, /**< assembly MOV instruction */ /* vector ops: */ - IR_ADD, + IR_ADD, /**< assembly ADD instruction */ IR_SUB, IR_MUL, IR_DIV, diff --git a/src/mesa/shader/slang/slang_library_noise.c b/src/mesa/shader/slang/slang_library_noise.c index 46075c492c..25a05657cc 100644 --- a/src/mesa/shader/slang/slang_library_noise.c +++ b/src/mesa/shader/slang/slang_library_noise.c @@ -49,7 +49,7 @@ */ -#include "imports.h" +#include "main/imports.h" #include "slang_library_noise.h" #define FASTFLOOR(x) ( ((x)>0) ? ((int)x) : (((int)x)-1) ) diff --git a/src/mesa/shader/slang/slang_link.c b/src/mesa/shader/slang/slang_link.c index 26959d9d15..dd7d5be6d8 100644 --- a/src/mesa/shader/slang/slang_link.c +++ b/src/mesa/shader/slang/slang_link.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.5.3 + * Version: 7.2 * - * Copyright (C) 2007 Brian Paul All Rights Reserved. + * Copyright (C) 2008 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"), @@ -42,6 +42,38 @@ #include "slang_link.h" +/** cast wrapper */ +static struct gl_vertex_program * +vertex_program(struct gl_program *prog) +{ + assert(prog->Target == GL_VERTEX_PROGRAM_ARB); + return (struct gl_vertex_program *) prog; +} + + +/** cast wrapper */ +static struct gl_fragment_program * +fragment_program(struct gl_program *prog) +{ + assert(prog->Target == GL_FRAGMENT_PROGRAM_ARB); + return (struct gl_fragment_program *) prog; +} + + +/** + * Record a linking error. + */ +static void +link_error(struct gl_shader_program *shProg, const char *msg) +{ + if (shProg->InfoLog) { + _mesa_free(shProg->InfoLog); + } + shProg->InfoLog = _mesa_strdup(msg); + shProg->LinkStatus = GL_FALSE; +} + + /** * Linking varying vars involves rearranging varying vars so that the @@ -52,7 +84,6 @@ static GLboolean link_varying_vars(struct gl_shader_program *shProg, struct gl_program *prog) { GLuint *map, i, firstVarying, newFile; - GLbitfield varsWritten, varsRead; map = (GLuint *) malloc(prog->Varying->NumParameters * sizeof(GLuint)); if (!map) @@ -60,14 +91,13 @@ link_varying_vars(struct gl_shader_program *shProg, struct gl_program *prog) for (i = 0; i < prog->Varying->NumParameters; i++) { /* see if this varying is in the linked varying list */ - const struct gl_program_parameter *var - = prog->Varying->Parameters + i; - + const struct gl_program_parameter *var = prog->Varying->Parameters + i; GLint j = _mesa_lookup_parameter_index(shProg->Varying, -1, var->Name); if (j >= 0) { /* already in list, check size */ if (var->Size != shProg->Varying->Parameters[j].Size) { /* error */ + link_error(shProg, "mismatched varying variable types"); return GL_FALSE; } } @@ -75,9 +105,19 @@ link_varying_vars(struct gl_shader_program *shProg, struct gl_program *prog) /* not already in linked list */ j = _mesa_add_varying(shProg->Varying, var->Name, var->Size); } - ASSERT(j >= 0); - map[i] = j; + /* map varying[i] to varying[j]. + * Note: the loop here takes care of arrays or large (sz>4) vars. + */ + { + GLint sz = var->Size; + while (sz > 0) { + /*printf("Link varying from %d to %d\n", i, j);*/ + map[i++] = j++; + sz -= 4; + } + i--; /* go back one */ + } } @@ -96,9 +136,6 @@ link_varying_vars(struct gl_shader_program *shProg, struct gl_program *prog) newFile = PROGRAM_INPUT; } - /* keep track of which varying vars we read and write */ - varsWritten = varsRead = 0x0; - /* OK, now scan the program/shader instructions looking for varying vars, * replacing the old index with the new index. */ @@ -109,30 +146,22 @@ link_varying_vars(struct gl_shader_program *shProg, struct gl_program *prog) if (inst->DstReg.File == PROGRAM_VARYING) { inst->DstReg.File = newFile; inst->DstReg.Index = map[ inst->DstReg.Index ] + firstVarying; - varsWritten |= (1 << inst->DstReg.Index); } for (j = 0; j < 3; j++) { if (inst->SrcReg[j].File == PROGRAM_VARYING) { inst->SrcReg[j].File = newFile; inst->SrcReg[j].Index = map[ inst->SrcReg[j].Index ] + firstVarying; - varsRead |= (1 << inst->SrcReg[j].Index); } } } - if (prog->Target == GL_VERTEX_PROGRAM_ARB) { - prog->OutputsWritten |= varsWritten; - /*printf("VERT OUTPUTS: 0x%x \n", varsWritten);*/ - } - else { - assert(prog->Target == GL_FRAGMENT_PROGRAM_ARB); - prog->InputsRead |= varsRead; - /*printf("FRAG INPUTS: 0x%x\n", varsRead);*/ - } - free(map); + /* these will get recomputed before linking is completed */ + prog->InputsRead = 0x0; + prog->OutputsWritten = 0x0; + return GL_TRUE; } @@ -162,7 +191,7 @@ link_uniform_vars(struct gl_shader_program *shProg, * Furthermore, we'll need to fix the state-var's size/datatype info. */ - if (p->Type == PROGRAM_UNIFORM || + if ((p->Type == PROGRAM_UNIFORM && p->Used) || p->Type == PROGRAM_SAMPLER) { _mesa_append_uniform(shProg->Uniforms, p->Name, prog->Target, i); } @@ -204,169 +233,197 @@ link_uniform_vars(struct gl_shader_program *shProg, * For example, if the vertex shader declared "attribute vec4 foobar" we'll * allocate a generic vertex attribute for "foobar" and plug that value into * the vertex program instructions. + * But if the user called glBindAttributeLocation(), those bindings will + * have priority. */ static GLboolean _slang_resolve_attributes(struct gl_shader_program *shProg, - struct gl_program *prog) + const struct gl_program *origProg, + struct gl_program *linkedProg) { + GLint attribMap[MAX_VERTEX_ATTRIBS]; GLuint i, j; GLbitfield usedAttributes; - assert(prog->Target == GL_VERTEX_PROGRAM_ARB); + assert(origProg != linkedProg); + assert(origProg->Target == GL_VERTEX_PROGRAM_ARB); + assert(linkedProg->Target == GL_VERTEX_PROGRAM_ARB); if (!shProg->Attributes) shProg->Attributes = _mesa_new_parameter_list(); + if (linkedProg->Attributes) { + _mesa_free_parameter_list(linkedProg->Attributes); + } + linkedProg->Attributes = _mesa_new_parameter_list(); + + /* Build a bitmask indicating which attribute indexes have been * explicitly bound by the user with glBindAttributeLocation(). */ usedAttributes = 0x0; for (i = 0; i < shProg->Attributes->NumParameters; i++) { GLint attr = shProg->Attributes->Parameters[i].StateIndexes[0]; - usedAttributes |= attr; + usedAttributes |= (1 << attr); + } + + /* initialize the generic attribute map entries to -1 */ + for (i = 0; i < MAX_VERTEX_ATTRIBS; i++) { + attribMap[i] = -1; } /* * Scan program for generic attribute references */ - for (i = 0; i < prog->NumInstructions; i++) { - struct prog_instruction *inst = prog->Instructions + i; + for (i = 0; i < linkedProg->NumInstructions; i++) { + struct prog_instruction *inst = linkedProg->Instructions + i; for (j = 0; j < 3; j++) { if (inst->SrcReg[j].File == PROGRAM_INPUT && inst->SrcReg[j].Index >= VERT_ATTRIB_GENERIC0) { - /* this is a generic attrib */ - const GLint k = inst->SrcReg[j].Index - VERT_ATTRIB_GENERIC0; - const char *name = prog->Attributes->Parameters[k].Name; - /* See if this attrib name is in the program's attribute list - * (i.e. was bound by the user). + /* + * OK, we've found a generic vertex attribute reference. */ - GLint index = _mesa_lookup_parameter_index(shProg->Attributes, - -1, name); - GLint attr; - if (index >= 0) { - /* found, user must have specified a binding */ - attr = shProg->Attributes->Parameters[index].StateIndexes[0]; - } - else { - /* Not found, choose our own attribute number. - * Start at 1 since generic attribute 0 always aliases - * glVertex/position. + const GLint k = inst->SrcReg[j].Index - VERT_ATTRIB_GENERIC0; + + GLint attr = attribMap[k]; + + if (attr < 0) { + /* Need to figure out attribute mapping now. */ - GLint size = prog->Attributes->Parameters[k].Size; - GLenum datatype = prog->Attributes->Parameters[k].DataType; - for (attr = 1; attr < MAX_VERTEX_ATTRIBS; attr++) { - if (((1 << attr) & usedAttributes) == 0) - break; + const char *name = origProg->Attributes->Parameters[k].Name; + const GLint size = origProg->Attributes->Parameters[k].Size; + const GLenum type =origProg->Attributes->Parameters[k].DataType; + GLint index; + + /* See if there's a user-defined attribute binding for + * this name. + */ + index = _mesa_lookup_parameter_index(shProg->Attributes, + -1, name); + if (index >= 0) { + /* Found a user-defined binding */ + attr = shProg->Attributes->Parameters[index].StateIndexes[0]; } - if (attr == MAX_VERTEX_ATTRIBS) { - /* too many! XXX record error log */ - return GL_FALSE; + else { + /* No user-defined binding, choose our own attribute number. + * Start at 1 since generic attribute 0 always aliases + * glVertex/position. + */ + for (attr = 1; attr < MAX_VERTEX_ATTRIBS; attr++) { + if (((1 << attr) & usedAttributes) == 0) + break; + } + if (attr == MAX_VERTEX_ATTRIBS) { + link_error(shProg, "Too many vertex attributes"); + return GL_FALSE; + } + + /* mark this attribute as used */ + usedAttributes |= (1 << attr); } - _mesa_add_attribute(shProg->Attributes, name, size, datatype,attr); - /* set the attribute as used */ - usedAttributes |= 1<<attr; + attribMap[k] = attr; + + /* Save the final name->attrib binding so it can be queried + * with glGetAttributeLocation(). + */ + _mesa_add_attribute(linkedProg->Attributes, name, + size, type, attr); } + assert(attr >= 0); + + /* update the instruction's src reg */ inst->SrcReg[j].Index = VERT_ATTRIB_GENERIC0 + attr; } } } + return GL_TRUE; } /** - * Scan program instructions to update the program's InputsRead and - * OutputsWritten fields. + * Scan program instructions to update the program's NumTemporaries field. + * Note: this implemenation relies on the code generator allocating + * temps in increasing order (0, 1, 2, ... ). */ static void -_slang_update_inputs_outputs(struct gl_program *prog) +_slang_count_temporaries(struct gl_program *prog) { GLuint i, j; - - prog->InputsRead = 0x0; - prog->OutputsWritten = 0x0; + GLint maxIndex = -1; for (i = 0; i < prog->NumInstructions; i++) { const struct prog_instruction *inst = prog->Instructions + i; const GLuint numSrc = _mesa_num_inst_src_regs(inst->Opcode); for (j = 0; j < numSrc; j++) { - if (inst->SrcReg[j].File == PROGRAM_INPUT) { - prog->InputsRead |= 1 << inst->SrcReg[j].Index; + if (inst->SrcReg[j].File == PROGRAM_TEMPORARY) { + if (maxIndex < inst->SrcReg[j].Index) + maxIndex = inst->SrcReg[j].Index; + } + if (inst->DstReg.File == PROGRAM_TEMPORARY) { + if (maxIndex < (GLint) inst->DstReg.Index) + maxIndex = inst->DstReg.Index; } - } - if (inst->DstReg.File == PROGRAM_OUTPUT) { - prog->OutputsWritten |= 1 << inst->DstReg.Index; } } + + prog->NumTemporaries = (GLuint) (maxIndex + 1); } /** - * Scan a vertex program looking for instances of - * (PROGRAM_INPUT, VERT_ATTRIB_GENERIC0 + oldAttrib) and replace with - * (PROGRAM_INPUT, VERT_ATTRIB_GENERIC0 + newAttrib). - * This is used when the user calls glBindAttribLocation on an already linked - * shader program. + * Scan program instructions to update the program's InputsRead and + * OutputsWritten fields. */ -void -_slang_remap_attribute(struct gl_program *prog, GLuint oldAttrib, GLuint newAttrib) +static void +_slang_update_inputs_outputs(struct gl_program *prog) { GLuint i, j; + GLuint maxAddrReg = 0; - assert(prog->Target == GL_VERTEX_PROGRAM_ARB); + prog->InputsRead = 0x0; + prog->OutputsWritten = 0x0; for (i = 0; i < prog->NumInstructions; i++) { - struct prog_instruction *inst = prog->Instructions + i; - for (j = 0; j < 3; j++) { + const struct prog_instruction *inst = prog->Instructions + i; + const GLuint numSrc = _mesa_num_inst_src_regs(inst->Opcode); + for (j = 0; j < numSrc; j++) { if (inst->SrcReg[j].File == PROGRAM_INPUT) { - if (inst->SrcReg[j].Index == VERT_ATTRIB_GENERIC0 + oldAttrib) { - inst->SrcReg[j].Index = VERT_ATTRIB_GENERIC0 + newAttrib; + prog->InputsRead |= 1 << inst->SrcReg[j].Index; + if (prog->Target == GL_FRAGMENT_PROGRAM_ARB && + inst->SrcReg[j].Index == FRAG_ATTRIB_FOGC) { + /* The fragment shader FOGC input is used for fog, + * front-facing and sprite/point coord. + */ + struct gl_fragment_program *fp = fragment_program(prog); + const GLint swz = GET_SWZ(inst->SrcReg[j].Swizzle, 0); + if (swz == SWIZZLE_X) + fp->UsesFogFragCoord = GL_TRUE; + else if (swz == SWIZZLE_Y) + fp->UsesFrontFacing = GL_TRUE; + else if (swz == SWIZZLE_Z || swz == SWIZZLE_W) + fp->UsesPointCoord = GL_TRUE; } } + else if (inst->SrcReg[j].File == PROGRAM_ADDRESS) { + maxAddrReg = MAX2(maxAddrReg, inst->SrcReg[j].Index + 1); + } + } + if (inst->DstReg.File == PROGRAM_OUTPUT) { + prog->OutputsWritten |= 1 << inst->DstReg.Index; + } + else if (inst->DstReg.File == PROGRAM_ADDRESS) { + maxAddrReg = MAX2(maxAddrReg, inst->DstReg.Index + 1); } } - _slang_update_inputs_outputs(prog); -} - - - -/** cast wrapper */ -static struct gl_vertex_program * -vertex_program(struct gl_program *prog) -{ - assert(prog->Target == GL_VERTEX_PROGRAM_ARB); - return (struct gl_vertex_program *) prog; -} - - -/** cast wrapper */ -static struct gl_fragment_program * -fragment_program(struct gl_program *prog) -{ - assert(prog->Target == GL_FRAGMENT_PROGRAM_ARB); - return (struct gl_fragment_program *) prog; + prog->NumAddressRegs = maxAddrReg; } /** - * Record a linking error. - */ -static void -link_error(struct gl_shader_program *shProg, const char *msg) -{ - if (shProg->InfoLog) { - _mesa_free(shProg->InfoLog); - } - shProg->InfoLog = _mesa_strdup(msg); - shProg->LinkStatus = GL_FALSE; -} - - - -/** * Shader linker. Currently: * * 1. The last attached vertex shader and fragment shader are linked. @@ -415,6 +472,18 @@ _slang_link(GLcontext *ctx, _mesa_problem(ctx, "unexpected shader target in slang_link()"); } +#if FEATURE_es2_glsl + /* must have both a vertex and fragment program for ES2 */ + if (!vertProg) { + link_error(shProg, "missing vertex shader\n"); + return; + } + if (!fragProg) { + link_error(shProg, "missing fragment shader\n"); + return; + } +#endif + /* * Make copies of the vertex/fragment programs now since we'll be * changing src/dst registers after merging the uniforms and varying vars. @@ -436,10 +505,14 @@ _slang_link(GLcontext *ctx, } /* link varying vars */ - if (shProg->VertexProgram) - link_varying_vars(shProg, &shProg->VertexProgram->Base); - if (shProg->FragmentProgram) - link_varying_vars(shProg, &shProg->FragmentProgram->Base); + if (shProg->VertexProgram) { + if (!link_varying_vars(shProg, &shProg->VertexProgram->Base)) + return; + } + if (shProg->FragmentProgram) { + if (!link_varying_vars(shProg, &shProg->FragmentProgram->Base)) + return; + } /* link uniform vars */ if (shProg->VertexProgram) @@ -450,15 +523,15 @@ _slang_link(GLcontext *ctx, /*_mesa_print_uniforms(shProg->Uniforms);*/ if (shProg->VertexProgram) { - if (!_slang_resolve_attributes(shProg, &shProg->VertexProgram->Base)) { - /*goto cleanup;*/ - _mesa_problem(ctx, "_slang_resolve_attributes() failed"); + if (!_slang_resolve_attributes(shProg, &vertProg->Base, + &shProg->VertexProgram->Base)) { return; } } if (shProg->VertexProgram) { _slang_update_inputs_outputs(&shProg->VertexProgram->Base); + _slang_count_temporaries(&shProg->VertexProgram->Base); if (!(shProg->VertexProgram->Base.OutputsWritten & (1 << VERT_RESULT_HPOS))) { /* the vertex program did not compute a vertex position */ link_error(shProg, @@ -466,8 +539,10 @@ _slang_link(GLcontext *ctx, return; } } - if (shProg->FragmentProgram) + if (shProg->FragmentProgram) { + _slang_count_temporaries(&shProg->FragmentProgram->Base); _slang_update_inputs_outputs(&shProg->FragmentProgram->Base); + } /* Check that all the varying vars needed by the fragment shader are * actually produced by the vertex shader. @@ -484,12 +559,6 @@ _slang_link(GLcontext *ctx, } } - /* Check that the vertex program doesn't use too many sampler units */ - if (shProg->VertexProgram && - _mesa_bitcount(shProg->VertexProgram->Base.SamplersUsed) > ctx->Const.MaxVertexTextureImageUnits) { - link_error(shProg, "Vertex program uses too many samplers.\n"); - return; - } if (fragProg && shProg->FragmentProgram) { /* notify driver that a new fragment program has been compiled/linked */ diff --git a/src/mesa/shader/slang/slang_link.h b/src/mesa/shader/slang/slang_link.h index 8ef8a6b4b3..2b44d20787 100644 --- a/src/mesa/shader/slang/slang_link.h +++ b/src/mesa/shader/slang/slang_link.h @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.5.3 + * Version: 7.2 * - * Copyright (C) 2007 Brian Paul All Rights Reserved. + * Copyright (C) 2008 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,10 +32,6 @@ extern void _slang_link(GLcontext *ctx, GLhandleARB h, struct gl_shader_program *shProg); -extern void -_slang_remap_attribute(struct gl_program *prog, GLuint oldAttrib, - GLuint newAttrib); - #endif diff --git a/src/mesa/shader/slang/slang_log.c b/src/mesa/shader/slang/slang_log.c index c963914fe3..01591ceba5 100644 --- a/src/mesa/shader/slang/slang_log.c +++ b/src/mesa/shader/slang/slang_log.c @@ -22,7 +22,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include "imports.h" +#include "main/imports.h" #include "slang_log.h" #include "slang_utility.h" diff --git a/src/mesa/shader/slang/slang_mem.c b/src/mesa/shader/slang/slang_mem.c index e1d1e6ba14..21d6bfce88 100644 --- a/src/mesa/shader/slang/slang_mem.c +++ b/src/mesa/shader/slang/slang_mem.c @@ -32,8 +32,8 @@ * \author Brian Paul */ -#include "context.h" -#include "macros.h" +#include "main/context.h" +#include "main/macros.h" #include "slang_mem.h" diff --git a/src/mesa/shader/slang/slang_mem.h b/src/mesa/shader/slang/slang_mem.h index 49885b6c98..b5bfae2479 100644 --- a/src/mesa/shader/slang/slang_mem.h +++ b/src/mesa/shader/slang/slang_mem.h @@ -27,7 +27,7 @@ #define SLANG_MEM_H -#include "imports.h" +#include "main/imports.h" typedef struct slang_mempool_ slang_mempool; diff --git a/src/mesa/shader/slang/slang_preprocess.c b/src/mesa/shader/slang/slang_preprocess.c index d3f412c211..786f6467c9 100644 --- a/src/mesa/shader/slang/slang_preprocess.c +++ b/src/mesa/shader/slang/slang_preprocess.c @@ -28,7 +28,7 @@ * \author Michal Krol */ -#include "imports.h" +#include "main/imports.h" #include "shader/grammar/grammar_mesa.h" #include "slang_preprocess.h" @@ -537,7 +537,11 @@ pp_state_init (pp_state *self, slang_info_log *elog) { self->line = 0; self->file = 1; +#if FEATURE_es2_glsl + self->version = 100; +#else self->version = 110; +#endif pp_symbols_init (&self->symbols); pp_ext_init (&self->ext); self->elog = elog; diff --git a/src/mesa/shader/slang/slang_print.c b/src/mesa/shader/slang/slang_print.c index f48762fb11..4422f70159 100644 --- a/src/mesa/shader/slang/slang_print.c +++ b/src/mesa/shader/slang/slang_print.c @@ -4,7 +4,7 @@ */ -#include "imports.h" +#include "main/imports.h" #include "slang_compile.h" #include "slang_print.h" diff --git a/src/mesa/shader/slang/slang_simplify.c b/src/mesa/shader/slang/slang_simplify.c index d45e71574c..6ef95c48f9 100644 --- a/src/mesa/shader/slang/slang_simplify.c +++ b/src/mesa/shader/slang/slang_simplify.c @@ -27,6 +27,7 @@ * call casting. */ + #include "main/imports.h" #include "main/macros.h" #include "main/get.h" @@ -36,6 +37,15 @@ #include "slang_print.h" +#ifndef GL_MAX_FRAGMENT_UNIFORM_VECTORS +#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD +#endif +#ifndef GL_MAX_VERTEX_UNIFORM_VECTORS +#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB +#endif +#ifndef GL_MAX_VARYING_VECTORS +#define GL_MAX_VARYING_VECTORS 0x8DFC +#endif /** @@ -62,6 +72,11 @@ _slang_lookup_constant(const char *name) { "gl_MaxVaryingFloats", GL_MAX_VARYING_FLOATS }, { "gl_MaxVertexTextureImageUnits", GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS }, { "gl_MaxTextureImageUnits", GL_MAX_TEXTURE_IMAGE_UNITS }, +#if FEATURE_es2_glsl + { "gl_MaxVertexUniformVectors", GL_MAX_VERTEX_UNIFORM_VECTORS }, + { "gl_MaxVaryingVectors", GL_MAX_VARYING_VECTORS }, + { "gl_MaxFragmentUniformVectors", GL_MAX_FRAGMENT_UNIFORM_VECTORS }, +#endif { NULL, 0 } }; GLuint i; @@ -79,6 +94,15 @@ _slang_lookup_constant(const char *name) } +static slang_operation_type +literal_type(slang_operation_type t1, slang_operation_type t2) +{ + if (t1 == SLANG_OPER_LITERAL_FLOAT || t2 == SLANG_OPER_LITERAL_FLOAT) + return SLANG_OPER_LITERAL_FLOAT; + else + return SLANG_OPER_LITERAL_INT; +} + /** * Recursively traverse an AST tree, applying simplifications wherever @@ -99,6 +123,7 @@ _slang_simplify(slang_operation *oper, if (oper->type == SLANG_OPER_IDENTIFIER) { /* see if it's a named constant */ GLint value = _slang_lookup_constant((char *) oper->a_id); + /*printf("value[%s] = %d\n", (char*) oper->a_id, value);*/ if (value >= 0) { oper->literal[0] = oper->literal[1] = @@ -107,6 +132,29 @@ _slang_simplify(slang_operation *oper, oper->type = SLANG_OPER_LITERAL_INT; return; } + /* look for user-defined constant */ + { + slang_variable *var; + var = _slang_locate_variable(oper->locals, oper->a_id, GL_TRUE); + if (var) { + if (var->type.qualifier == SLANG_QUAL_CONST && + var->initializer && + (var->initializer->type == SLANG_OPER_LITERAL_INT || + var->initializer->type == SLANG_OPER_LITERAL_FLOAT)) { + oper->literal[0] = var->initializer->literal[0]; + oper->literal[1] = var->initializer->literal[1]; + oper->literal[2] = var->initializer->literal[2]; + oper->literal[3] = var->initializer->literal[3]; + oper->literal_size = var->initializer->literal_size; + oper->type = var->initializer->type; + /* + printf("value[%s] = %f\n", + (char*) oper->a_id, oper->literal[0]); + */ + return; + } + } + } } /* first, simplify children */ @@ -131,8 +179,9 @@ _slang_simplify(slang_operation *oper, = oper->children[0].literal[i] + oper->children[1].literal[i]; } oper->literal_size = oper->children[0].literal_size; - slang_operation_destruct(oper); - oper->type = SLANG_OPER_LITERAL_FLOAT; + oper->type = literal_type(oper->children[0].type, + oper->children[1].type); + slang_operation_destruct(oper); /* frees unused children */ return; case SLANG_OPER_SUBTRACT: for (i = 0; i < 4; i++) { @@ -140,8 +189,9 @@ _slang_simplify(slang_operation *oper, = oper->children[0].literal[i] - oper->children[1].literal[i]; } oper->literal_size = oper->children[0].literal_size; + oper->type = literal_type(oper->children[0].type, + oper->children[1].type); slang_operation_destruct(oper); - oper->type = SLANG_OPER_LITERAL_FLOAT; return; case SLANG_OPER_MULTIPLY: for (i = 0; i < 4; i++) { @@ -149,8 +199,9 @@ _slang_simplify(slang_operation *oper, = oper->children[0].literal[i] * oper->children[1].literal[i]; } oper->literal_size = oper->children[0].literal_size; + oper->type = literal_type(oper->children[0].type, + oper->children[1].type); slang_operation_destruct(oper); - oper->type = SLANG_OPER_LITERAL_FLOAT; return; case SLANG_OPER_DIVIDE: for (i = 0; i < 4; i++) { @@ -158,8 +209,9 @@ _slang_simplify(slang_operation *oper, = oper->children[0].literal[i] / oper->children[1].literal[i]; } oper->literal_size = oper->children[0].literal_size; + oper->type = literal_type(oper->children[0].type, + oper->children[1].type); slang_operation_destruct(oper); - oper->type = SLANG_OPER_LITERAL_FLOAT; return; default: ; /* nothing */ diff --git a/src/mesa/shader/slang/slang_storage.c b/src/mesa/shader/slang/slang_storage.c index bc32aa4b02..e8b0fb7747 100644 --- a/src/mesa/shader/slang/slang_storage.c +++ b/src/mesa/shader/slang/slang_storage.c @@ -28,7 +28,7 @@ * \author Michal Krol */ -#include "imports.h" +#include "main/imports.h" #include "slang_storage.h" #include "slang_mem.h" diff --git a/src/mesa/shader/slang/slang_typeinfo.c b/src/mesa/shader/slang/slang_typeinfo.c index 26f9f6ca85..b2f0f14995 100644 --- a/src/mesa/shader/slang/slang_typeinfo.c +++ b/src/mesa/shader/slang/slang_typeinfo.c @@ -273,7 +273,7 @@ slang_type_specifier_compatible(const slang_type_specifier * x, GLboolean slang_typeinfo_construct(slang_typeinfo * ti) { - /*_mesa_bzero(ti, sizeof(*ti));*/ + _mesa_bzero(ti, sizeof(*ti)); slang_type_specifier_ctr(&ti->spec); ti->array_len = 0; return GL_TRUE; @@ -392,7 +392,6 @@ _slang_typeof_operation_(slang_operation * op, 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: @@ -477,6 +476,7 @@ _slang_typeof_operation_(slang_operation * op, } break; case SLANG_OPER_IDENTIFIER: + case SLANG_OPER_VARIABLE_DECL: { slang_variable *var; var = _slang_locate_variable(op->locals, op->a_id, GL_TRUE); @@ -875,6 +875,34 @@ _slang_type_is_vector(slang_type_specifier_type ty) /** + * Determine if a type is a float, float vector or float matrix. + * \return GL_TRUE if so, GL_FALSE otherwise + */ +GLboolean +_slang_type_is_float_vec_mat(slang_type_specifier_type ty) +{ + switch (ty) { + case SLANG_SPEC_FLOAT: + case SLANG_SPEC_VEC2: + case SLANG_SPEC_VEC3: + case SLANG_SPEC_VEC4: + case SLANG_SPEC_MAT2: + case SLANG_SPEC_MAT3: + case SLANG_SPEC_MAT4: + case SLANG_SPEC_MAT23: + case SLANG_SPEC_MAT32: + case SLANG_SPEC_MAT24: + case SLANG_SPEC_MAT42: + case SLANG_SPEC_MAT34: + case SLANG_SPEC_MAT43: + return GL_TRUE; + default: + return GL_FALSE; + } +} + + +/** * Given a vector type, return the type of the vector's elements. * For a matrix, return the type of the columns. */ diff --git a/src/mesa/shader/slang/slang_typeinfo.h b/src/mesa/shader/slang/slang_typeinfo.h index fc89fd9345..b3ad06b65c 100644 --- a/src/mesa/shader/slang/slang_typeinfo.h +++ b/src/mesa/shader/slang/slang_typeinfo.h @@ -25,8 +25,8 @@ #ifndef SLANG_TYPEINFO_H #define SLANG_TYPEINFO_H 1 -#include "imports.h" -#include "mtypes.h" +#include "main/imports.h" +#include "main/mtypes.h" #include "slang_log.h" #include "slang_utility.h" #include "slang_vartable.h" @@ -191,6 +191,9 @@ _slang_type_is_matrix(slang_type_specifier_type); extern GLboolean _slang_type_is_vector(slang_type_specifier_type); +extern GLboolean +_slang_type_is_float_vec_mat(slang_type_specifier_type); + extern slang_type_specifier_type _slang_type_base(slang_type_specifier_type); diff --git a/src/mesa/shader/slang/slang_utility.c b/src/mesa/shader/slang/slang_utility.c index 2a2dc8e54f..3631e32b3c 100644 --- a/src/mesa/shader/slang/slang_utility.c +++ b/src/mesa/shader/slang/slang_utility.c @@ -28,7 +28,7 @@ * \author Michal Krol */ -#include "imports.h" +#include "main/imports.h" #include "slang_utility.h" #include "slang_mem.h" diff --git a/src/mesa/shader/slang/slang_vartable.c b/src/mesa/shader/slang/slang_vartable.c index aba47f9929..9b607e6403 100644 --- a/src/mesa/shader/slang/slang_vartable.c +++ b/src/mesa/shader/slang/slang_vartable.c @@ -110,9 +110,10 @@ _slang_pop_var_table(slang_var_table *vt) slang_ir_storage *store = (slang_ir_storage *) t->Vars[i]->aux; GLint j; GLuint comp; - if (dbg) printf(" Free var %s, size %d at %d\n", + if (dbg) printf(" Free var %s, size %d at %d.%s\n", (char*) t->Vars[i]->a_name, store->Size, - store->Index); + store->Index, + _mesa_swizzle_string(store->Swizzle, 0, 0)); if (store->Size == 1) comp = GET_SWZ(store->Swizzle, 0); @@ -159,7 +160,7 @@ _slang_add_variable(slang_var_table *vt, slang_variable *v) assert(vt); t = vt->Top; assert(t); - if (dbg) printf("Adding var %s\n", (char *) v->a_name); + if (dbg) printf("Adding var %s, store %p\n", (char *) v->a_name, v->aux); t->Vars = (slang_variable **) _slang_realloc(t->Vars, t->NumVars * sizeof(slang_variable *), @@ -262,10 +263,11 @@ _slang_alloc_var(slang_var_table *vt, slang_ir_storage *store) } if (dbg) - printf("Alloc var sz %d at %d.%s (level %d)\n", + printf("Alloc var storage sz %d at %d.%s (level %d) store %p\n", store->Size, store->Index, _mesa_swizzle_string(store->Swizzle, 0, 0), - t->Level); + t->Level, + (void*) store); return GL_TRUE; } @@ -283,19 +285,29 @@ _slang_alloc_temp(slang_var_table *vt, slang_ir_storage *store) if (i < 0) return GL_FALSE; + assert(store->Index < 0); + store->Index = i / 4; if (store->Size == 1) { const GLuint comp = i % 4; store->Swizzle = MAKE_SWIZZLE4(comp, comp, comp, comp); - if (dbg) printf("Alloc temp sz %d at %d.%c (level %d)\n", - store->Size, store->Index, "xyzw"[comp], t->Level); } else { /* XXX improve swizzled for size=2/3, use for writemask... */ +#if 1 + if (store->Size == 2) { + store->Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, + SWIZZLE_NIL, SWIZZLE_NIL); + } +#endif store->Swizzle = SWIZZLE_NOOP; - if (dbg) printf("Alloc temp sz %d at %d.xyzw (level %d)\n", - store->Size, store->Index, t->Level); } + + if (dbg) printf("Alloc temp sz %d at %d.%s (level %d) store %p\n", + store->Size, store->Index, + _mesa_swizzle_string(store->Swizzle, 0, 0), t->Level, + (void *) store); + return GL_TRUE; } @@ -309,12 +321,20 @@ _slang_free_temp(slang_var_table *vt, slang_ir_storage *store) assert(store->Size > 0); assert(r >= 0); assert(r + store->Size <= vt->MaxRegisters * 4); - if (dbg) printf("Free temp sz %d at %d (level %d)\n", store->Size, r, t->Level); + if (dbg) printf("Free temp sz %d at %d.%s (level %d) store %p\n", + store->Size, r, + _mesa_swizzle_string(store->Swizzle, 0, 0), + t->Level, (void *) store); if (store->Size == 1) { const GLuint comp = GET_SWZ(store->Swizzle, 0); + /* we can actually fail some of these assertions because of the + * troublesome IR_SWIZZLE handling. + */ +#if 0 assert(store->Swizzle == MAKE_SWIZZLE4(comp, comp, comp, comp)); assert(comp < 4); assert(t->ValSize[r * 4 + comp] == 1); +#endif assert(t->Temps[r * 4 + comp] == TEMP); t->Temps[r * 4 + comp] = FREE; } diff --git a/src/mesa/sources b/src/mesa/sources index 2db1843239..9b9eb991fd 100644 --- a/src/mesa/sources +++ b/src/mesa/sources @@ -2,6 +2,7 @@ MAIN_SOURCES = \ main/api_arrayelt.c \ + main/api_exec.c \ main/api_loopback.c \ main/api_noop.c \ main/api_validate.c \ @@ -11,6 +12,7 @@ MAIN_SOURCES = \ main/blend.c \ main/bufferobj.c \ main/buffers.c \ + main/clear.c \ main/clip.c \ main/colortab.c \ main/context.c \ @@ -27,6 +29,7 @@ MAIN_SOURCES = \ main/extensions.c \ main/fbobject.c \ main/feedback.c \ + main/ffvertex_prog.c \ main/fog.c \ main/framebuffer.c \ main/get.c \ @@ -41,23 +44,30 @@ MAIN_SOURCES = \ main/matrix.c \ main/mipmap.c \ main/mm.c \ + main/multisample.c \ main/pixel.c \ + main/pixelstore.c \ main/points.c \ main/polygon.c \ main/queryobj.c \ main/rastpos.c \ main/rbadaptors.c \ + main/readpix.c \ main/renderbuffer.c \ + main/scissor.c \ main/shaders.c \ main/state.c \ main/stencil.c \ main/texcompress.c \ main/texcompress_s3tc.c \ main/texcompress_fxt1.c \ + main/texenv.c \ main/texenvprogram.c \ main/texformat.c \ + main/texgen.c \ main/teximage.c \ main/texobj.c \ + main/texparam.c \ main/texrender.c \ main/texstate.c \ main/texstore.c \ @@ -67,6 +77,7 @@ MAIN_SOURCES = \ GLAPI_SOURCES = \ main/dispatch.c \ glapi/glapi.c \ + glapi/glapi_getproc.c \ glapi/glthread.c MATH_SOURCES = \ @@ -118,6 +129,7 @@ TNL_SOURCES = \ tnl/t_context.c \ tnl/t_pipeline.c \ tnl/t_draw.c \ + tnl/t_rasterpos.c \ tnl/t_vb_program.c \ tnl/t_vb_render.c \ tnl/t_vb_texgen.c \ @@ -159,6 +171,7 @@ SHADER_SOURCES = \ shader/nvprogram.c \ shader/nvvertparse.c \ shader/program.c \ + shader/prog_cache.c \ shader/prog_debug.c \ shader/prog_execute.c \ shader/prog_instruction.c \ @@ -281,16 +294,11 @@ COMMON_DRIVER_OBJECTS = $(COMMON_DRIVER_SOURCES:.c=.o) ### Include directories +### XXX we should be able to trim this down to just -Iinclude/ and -Isrc/mesa/ +### since most #includes have been changed from #include "mtypes.h" to +### #include "main/mtypes.h", etc. INCLUDE_DIRS = \ -I$(TOP)/include \ -I$(TOP)/src/mesa \ - -I$(TOP)/src/mesa/main \ - -I$(TOP)/src/mesa/glapi \ - -I$(TOP)/src/mesa/math \ - -I$(TOP)/src/mesa/tnl \ - -I$(TOP)/src/mesa/shader \ - -I$(TOP)/src/mesa/shader/grammar \ - -I$(TOP)/src/mesa/shader/slang \ - -I$(TOP)/src/mesa/swrast \ - -I$(TOP)/src/mesa/swrast_setup + -I$(TOP)/src/mesa/main diff --git a/src/mesa/sparc/norm.S b/src/mesa/sparc/norm.S index 713cd5b375..44950a10a5 100644 --- a/src/mesa/sparc/norm.S +++ b/src/mesa/sparc/norm.S @@ -1,4 +1,3 @@ -/* $Id: norm.S,v 1.5 2005/07/28 00:11:11 idr Exp $ */ #include "sparc_matrix.h" diff --git a/src/mesa/sparc/sparc.c b/src/mesa/sparc/sparc.c index 1b77b0bb7b..84e8ac6723 100644 --- a/src/mesa/sparc/sparc.c +++ b/src/mesa/sparc/sparc.c @@ -31,7 +31,7 @@ #ifdef USE_SPARC_ASM -#include "context.h" +#include "main/context.h" #include "math/m_xform.h" #include "tnl/t_context.h" diff --git a/src/mesa/sparc/sparc.h b/src/mesa/sparc/sparc.h index 55ab12122d..a98e4d0e40 100644 --- a/src/mesa/sparc/sparc.h +++ b/src/mesa/sparc/sparc.h @@ -1,4 +1,3 @@ -/* $Id: sparc.h,v 1.3 2001/06/06 22:55:28 davem69 Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/sparc/xform.S b/src/mesa/sparc/xform.S index f44ec794e9..f2b9674bf2 100644 --- a/src/mesa/sparc/xform.S +++ b/src/mesa/sparc/xform.S @@ -1,4 +1,3 @@ -/* $Id: xform.S,v 1.4 2005/07/28 00:11:11 idr Exp $ */ /* TODO * diff --git a/src/mesa/swrast/s_aaline.c b/src/mesa/swrast/s_aaline.c index d6a9afb421..9bfa8f2e61 100644 --- a/src/mesa/swrast/s_aaline.c +++ b/src/mesa/swrast/s_aaline.c @@ -23,14 +23,14 @@ */ -#include "glheader.h" -#include "imports.h" -#include "macros.h" +#include "main/glheader.h" +#include "main/imports.h" +#include "main/macros.h" +#include "main/mtypes.h" #include "swrast/s_aaline.h" #include "swrast/s_context.h" #include "swrast/s_span.h" #include "swrast/swrast.h" -#include "mtypes.h" #define SUB_PIXEL 4 diff --git a/src/mesa/swrast/s_aaline.h b/src/mesa/swrast/s_aaline.h index 41e7e5fd4d..f1d708ec80 100644 --- a/src/mesa/swrast/s_aaline.h +++ b/src/mesa/swrast/s_aaline.h @@ -28,7 +28,6 @@ #define S_AALINE_H -#include "mtypes.h" #include "swrast.h" diff --git a/src/mesa/swrast/s_aatriangle.c b/src/mesa/swrast/s_aatriangle.c index 66891f9fec..078f16aea0 100644 --- a/src/mesa/swrast/s_aatriangle.c +++ b/src/mesa/swrast/s_aatriangle.c @@ -28,12 +28,12 @@ */ -#include "glheader.h" -#include "context.h" -#include "colormac.h" -#include "context.h" -#include "macros.h" -#include "imports.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/colormac.h" +#include "main/context.h" +#include "main/macros.h" +#include "main/imports.h" #include "s_aatriangle.h" #include "s_context.h" #include "s_span.h" diff --git a/src/mesa/swrast/s_aatriangle.h b/src/mesa/swrast/s_aatriangle.h index ebb828eb19..4b57fa73a2 100644 --- a/src/mesa/swrast/s_aatriangle.h +++ b/src/mesa/swrast/s_aatriangle.h @@ -28,7 +28,6 @@ #define S_AATRIANGLE_H -#include "mtypes.h" #include "swrast.h" diff --git a/src/mesa/swrast/s_accum.c b/src/mesa/swrast/s_accum.c index b74f794d09..ff741777e7 100644 --- a/src/mesa/swrast/s_accum.c +++ b/src/mesa/swrast/s_accum.c @@ -23,11 +23,11 @@ */ -#include "glheader.h" -#include "context.h" -#include "macros.h" -#include "imports.h" -#include "fbobject.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/macros.h" +#include "main/imports.h" +#include "main/fbobject.h" #include "s_accum.h" #include "s_context.h" diff --git a/src/mesa/swrast/s_accum.h b/src/mesa/swrast/s_accum.h index 97d2bef4c3..42e38cf02b 100644 --- a/src/mesa/swrast/s_accum.h +++ b/src/mesa/swrast/s_accum.h @@ -27,7 +27,7 @@ #define S_ACCUM_H -#include "mtypes.h" +#include "main/mtypes.h" extern void diff --git a/src/mesa/swrast/s_alpha.c b/src/mesa/swrast/s_alpha.c index 3c55d3e9e3..5761bb00b4 100644 --- a/src/mesa/swrast/s_alpha.c +++ b/src/mesa/swrast/s_alpha.c @@ -27,10 +27,10 @@ * \brief Functions to apply alpha test. */ -#include "glheader.h" -#include "context.h" -#include "colormac.h" -#include "macros.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/colormac.h" +#include "main/macros.h" #include "s_alpha.h" #include "s_context.h" diff --git a/src/mesa/swrast/s_alpha.h b/src/mesa/swrast/s_alpha.h index a85ef8a83a..7a5b72e650 100644 --- a/src/mesa/swrast/s_alpha.h +++ b/src/mesa/swrast/s_alpha.h @@ -28,7 +28,6 @@ #define S_ALPHA_H -#include "mtypes.h" #include "s_context.h" diff --git a/src/mesa/swrast/s_atifragshader.c b/src/mesa/swrast/s_atifragshader.c index 55ec757ee0..21cbd3cf37 100644 --- a/src/mesa/swrast/s_atifragshader.c +++ b/src/mesa/swrast/s_atifragshader.c @@ -1,5 +1,4 @@ /* - * * Copyright (C) 2004 David Airlie All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a @@ -20,10 +19,10 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include "glheader.h" -#include "colormac.h" -#include "context.h" -#include "macros.h" +#include "main/glheader.h" +#include "main/colormac.h" +#include "main/context.h" +#include "main/macros.h" #include "shader/program.h" #include "shader/atifragshader.h" #include "swrast/s_atifragshader.h" diff --git a/src/mesa/swrast/s_bitmap.c b/src/mesa/swrast/s_bitmap.c index f3dda12e25..35b34e654f 100644 --- a/src/mesa/swrast/s_bitmap.c +++ b/src/mesa/swrast/s_bitmap.c @@ -28,11 +28,11 @@ * \author Brian Paul */ -#include "glheader.h" -#include "bufferobj.h" -#include "image.h" -#include "macros.h" -#include "pixel.h" +#include "main/glheader.h" +#include "main/bufferobj.h" +#include "main/image.h" +#include "main/macros.h" +#include "main/pixel.h" #include "s_context.h" #include "s_span.h" diff --git a/src/mesa/swrast/s_blend.c b/src/mesa/swrast/s_blend.c index 82c5e84294..95c83432a9 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.5.2 + * Version: 7.1 * - * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2008 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"), @@ -35,10 +35,10 @@ -#include "glheader.h" -#include "context.h" -#include "colormac.h" -#include "macros.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/colormac.h" +#include "main/macros.h" #include "s_blend.h" #include "s_context.h" @@ -880,7 +880,8 @@ blend_general(GLcontext *ctx, GLuint n, const GLubyte mask[], } } else { - blend_general_float(ctx, n, mask, rgbaF, destF, chanType); + blend_general_float(ctx, n, mask, (GLfloat (*)[4]) src, + (GLfloat (*)[4]) dst, chanType); } } diff --git a/src/mesa/swrast/s_blend.h b/src/mesa/swrast/s_blend.h index 0b8cbed1a0..8d5a81635d 100644 --- a/src/mesa/swrast/s_blend.h +++ b/src/mesa/swrast/s_blend.h @@ -27,7 +27,6 @@ #define S_BLEND_H -#include "mtypes.h" #include "s_context.h" diff --git a/src/mesa/swrast/s_blit.c b/src/mesa/swrast/s_blit.c index af4350990c..bc4b2ac625 100644 --- a/src/mesa/swrast/s_blit.c +++ b/src/mesa/swrast/s_blit.c @@ -23,8 +23,8 @@ */ -#include "glheader.h" -#include "macros.h" +#include "main/glheader.h" +#include "main/macros.h" #include "s_context.h" diff --git a/src/mesa/swrast/s_buffers.c b/src/mesa/swrast/s_buffers.c index 0d1e9bac1c..9e87d6d485 100644 --- a/src/mesa/swrast/s_buffers.c +++ b/src/mesa/swrast/s_buffers.c @@ -24,11 +24,11 @@ /** XXX This file should be named s_clear.c */ -#include "glheader.h" -#include "colormac.h" -#include "macros.h" -#include "imports.h" -#include "mtypes.h" +#include "main/glheader.h" +#include "main/colormac.h" +#include "main/macros.h" +#include "main/imports.h" +#include "main/mtypes.h" #include "s_accum.h" #include "s_context.h" diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c index eab9ff3a9e..62857ddeb0 100644 --- a/src/mesa/swrast/s_context.c +++ b/src/mesa/swrast/s_context.c @@ -2,7 +2,7 @@ * Mesa 3-D graphics library * Version: 7.1 * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2008 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"), @@ -26,14 +26,15 @@ * Brian Paul */ -#include "imports.h" -#include "bufferobj.h" -#include "context.h" -#include "colormac.h" -#include "mtypes.h" -#include "teximage.h" -#include "swrast.h" +#include "main/imports.h" +#include "main/bufferobj.h" +#include "main/context.h" +#include "main/colormac.h" +#include "main/mtypes.h" +#include "main/teximage.h" +#include "shader/prog_parameter.h" #include "shader/prog_statevars.h" +#include "swrast.h" #include "s_blend.h" #include "s_context.h" #include "s_lines.h" @@ -501,6 +502,13 @@ _swrast_invalidate_state( GLcontext *ctx, GLbitfield new_state ) new_state = ~0; } + { + const struct gl_fragment_program *fp = ctx->FragmentProgram._Current; + if (fp && (fp->Base.Parameters->StateFlags & new_state)) { + _mesa_load_state_parameters(ctx, fp->Base.Parameters); + } + } + if (new_state & swrast->InvalidateTriangleMask) swrast->Triangle = _swrast_validate_triangle; diff --git a/src/mesa/swrast/s_copypix.c b/src/mesa/swrast/s_copypix.c index 3962721a61..fc5990b261 100644 --- a/src/mesa/swrast/s_copypix.c +++ b/src/mesa/swrast/s_copypix.c @@ -23,15 +23,15 @@ */ -#include "glheader.h" -#include "context.h" -#include "colormac.h" -#include "convolve.h" -#include "histogram.h" -#include "image.h" -#include "macros.h" -#include "imports.h" -#include "pixel.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/colormac.h" +#include "main/convolve.h" +#include "main/histogram.h" +#include "main/image.h" +#include "main/macros.h" +#include "main/imports.h" +#include "main/pixel.h" #include "s_context.h" #include "s_depth.h" diff --git a/src/mesa/swrast/s_depth.c b/src/mesa/swrast/s_depth.c index 408174c990..293eb8628e 100644 --- a/src/mesa/swrast/s_depth.c +++ b/src/mesa/swrast/s_depth.c @@ -23,11 +23,11 @@ */ -#include "glheader.h" -#include "context.h" -#include "macros.h" -#include "imports.h" -#include "fbobject.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/macros.h" +#include "main/imports.h" +#include "main/fbobject.h" #include "s_depth.h" #include "s_context.h" diff --git a/src/mesa/swrast/s_depth.h b/src/mesa/swrast/s_depth.h index d1ed050efd..3688625683 100644 --- a/src/mesa/swrast/s_depth.h +++ b/src/mesa/swrast/s_depth.h @@ -27,7 +27,6 @@ #define S_DEPTH_H -#include "mtypes.h" #include "s_context.h" diff --git a/src/mesa/swrast/s_drawpix.c b/src/mesa/swrast/s_drawpix.c index 730798c908..7af3e3dad1 100644 --- a/src/mesa/swrast/s_drawpix.c +++ b/src/mesa/swrast/s_drawpix.c @@ -23,18 +23,17 @@ */ -#include "glheader.h" -#include "bufferobj.h" -#include "context.h" -#include "convolve.h" -#include "image.h" -#include "macros.h" -#include "imports.h" -#include "pixel.h" -#include "state.h" +#include "main/glheader.h" +#include "main/bufferobj.h" +#include "main/context.h" +#include "main/convolve.h" +#include "main/image.h" +#include "main/macros.h" +#include "main/imports.h" +#include "main/pixel.h" +#include "main/state.h" #include "s_context.h" -#include "s_drawpix.h" #include "s_span.h" #include "s_stencil.h" #include "s_zoom.h" diff --git a/src/mesa/swrast/s_feedback.c b/src/mesa/swrast/s_feedback.c index 07b7409ab5..aa79531277 100644 --- a/src/mesa/swrast/s_feedback.c +++ b/src/mesa/swrast/s_feedback.c @@ -22,12 +22,12 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include "glheader.h" -#include "colormac.h" -#include "context.h" -#include "enums.h" -#include "feedback.h" -#include "macros.h" +#include "main/glheader.h" +#include "main/colormac.h" +#include "main/context.h" +#include "main/enums.h" +#include "main/feedback.h" +#include "main/macros.h" #include "s_context.h" #include "s_feedback.h" diff --git a/src/mesa/swrast/s_feedback.h b/src/mesa/swrast/s_feedback.h index 73f45c10be..9feab75dbb 100644 --- a/src/mesa/swrast/s_feedback.h +++ b/src/mesa/swrast/s_feedback.h @@ -28,7 +28,6 @@ #define S_FEEDBACK_H -#include "mtypes.h" #include "swrast.h" diff --git a/src/mesa/swrast/s_fog.c b/src/mesa/swrast/s_fog.c index 7b143f6e5b..b9ba265db6 100644 --- a/src/mesa/swrast/s_fog.c +++ b/src/mesa/swrast/s_fog.c @@ -23,10 +23,10 @@ */ -#include "glheader.h" -#include "colormac.h" -#include "context.h" -#include "macros.h" +#include "main/glheader.h" +#include "main/colormac.h" +#include "main/context.h" +#include "main/macros.h" #include "s_context.h" #include "s_fog.h" diff --git a/src/mesa/swrast/s_fog.h b/src/mesa/swrast/s_fog.h index 9639bee2cc..50760d88af 100644 --- a/src/mesa/swrast/s_fog.h +++ b/src/mesa/swrast/s_fog.h @@ -28,7 +28,6 @@ #define S_FOG_H -#include "mtypes.h" #include "swrast.h" diff --git a/src/mesa/swrast/s_fragprog.c b/src/mesa/swrast/s_fragprog.c index bf7a1de03b..525cf9d724 100644 --- a/src/mesa/swrast/s_fragprog.c +++ b/src/mesa/swrast/s_fragprog.c @@ -129,6 +129,7 @@ init_machine(GLcontext *ctx, struct gl_program_machine *machine, if (ctx->Shader.CurrentProgram) { /* Store front/back facing value in register FOGC.Y */ machine->Attribs[FRAG_ATTRIB_FOGC][col][1] = 1.0 - span->facing; + /* Note FOGC.ZW is gl_PointCoord if drawing a sprite */ } machine->CurElement = col; diff --git a/src/mesa/swrast/s_imaging.c b/src/mesa/swrast/s_imaging.c index 73aaba1ec9..591857c342 100644 --- a/src/mesa/swrast/s_imaging.c +++ b/src/mesa/swrast/s_imaging.c @@ -27,10 +27,11 @@ * extensions into either swrast or a sister module. */ +#include "main/glheader.h" +#include "main/colortab.h" +#include "main/convolve.h" #include "s_context.h" #include "s_span.h" -#include "colortab.h" -#include "convolve.h" void diff --git a/src/mesa/swrast/s_lines.c b/src/mesa/swrast/s_lines.c index 3de438760b..23cb9b57ef 100644 --- a/src/mesa/swrast/s_lines.c +++ b/src/mesa/swrast/s_lines.c @@ -23,10 +23,10 @@ */ -#include "glheader.h" -#include "context.h" -#include "colormac.h" -#include "macros.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/colormac.h" +#include "main/macros.h" #include "s_aaline.h" #include "s_context.h" #include "s_depth.h" diff --git a/src/mesa/swrast/s_lines.h b/src/mesa/swrast/s_lines.h index 5372b99b91..22979a02b6 100644 --- a/src/mesa/swrast/s_lines.h +++ b/src/mesa/swrast/s_lines.h @@ -27,7 +27,7 @@ #ifndef S_LINES_H #define S_LINES_H -#include "mtypes.h" +#include "swrast.h" void _swrast_choose_line( GLcontext *ctx ); diff --git a/src/mesa/swrast/s_logic.c b/src/mesa/swrast/s_logic.c index 0af9063968..f0274b4c0b 100644 --- a/src/mesa/swrast/s_logic.c +++ b/src/mesa/swrast/s_logic.c @@ -23,10 +23,10 @@ */ -#include "glheader.h" -#include "context.h" -#include "imports.h" -#include "macros.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/imports.h" +#include "main/macros.h" #include "s_context.h" #include "s_logic.h" diff --git a/src/mesa/swrast/s_logic.h b/src/mesa/swrast/s_logic.h index 0bc2c3f8a8..ba20cd7b32 100644 --- a/src/mesa/swrast/s_logic.h +++ b/src/mesa/swrast/s_logic.h @@ -27,7 +27,6 @@ #define S_LOGIC_H -#include "mtypes.h" #include "swrast.h" diff --git a/src/mesa/swrast/s_masking.c b/src/mesa/swrast/s_masking.c index a69720e83a..df779b0739 100644 --- a/src/mesa/swrast/s_masking.c +++ b/src/mesa/swrast/s_masking.c @@ -28,8 +28,8 @@ */ -#include "glheader.h" -#include "macros.h" +#include "main/glheader.h" +#include "main/macros.h" #include "s_context.h" #include "s_masking.h" diff --git a/src/mesa/swrast/s_masking.h b/src/mesa/swrast/s_masking.h index 0596cb3f45..3260ca34e3 100644 --- a/src/mesa/swrast/s_masking.h +++ b/src/mesa/swrast/s_masking.h @@ -27,7 +27,6 @@ #define S_MASKING_H -#include "mtypes.h" #include "swrast.h" diff --git a/src/mesa/swrast/s_points.c b/src/mesa/swrast/s_points.c index 1a8fd7d6db..846c485f15 100644 --- a/src/mesa/swrast/s_points.c +++ b/src/mesa/swrast/s_points.c @@ -23,11 +23,11 @@ */ -#include "glheader.h" -#include "colormac.h" -#include "context.h" -#include "macros.h" -#include "texstate.h" +#include "main/glheader.h" +#include "main/colormac.h" +#include "main/context.h" +#include "main/macros.h" +#include "main/texstate.h" #include "s_context.h" #include "s_feedback.h" #include "s_points.h" diff --git a/src/mesa/swrast/s_points.h b/src/mesa/swrast/s_points.h index 40b442e951..9e39c601ef 100644 --- a/src/mesa/swrast/s_points.h +++ b/src/mesa/swrast/s_points.h @@ -27,7 +27,7 @@ #ifndef S_POINTS_H #define S_POINTS_H -#include "mtypes.h" +#include "swrast.h" extern void _swrast_choose_point( GLcontext *ctx ); diff --git a/src/mesa/swrast/s_readpix.c b/src/mesa/swrast/s_readpix.c index 9140d12ea0..f263045170 100644 --- a/src/mesa/swrast/s_readpix.c +++ b/src/mesa/swrast/s_readpix.c @@ -23,17 +23,17 @@ */ -#include "glheader.h" -#include "bufferobj.h" -#include "colormac.h" -#include "convolve.h" -#include "context.h" -#include "feedback.h" -#include "image.h" -#include "macros.h" -#include "imports.h" -#include "pixel.h" -#include "state.h" +#include "main/glheader.h" +#include "main/bufferobj.h" +#include "main/colormac.h" +#include "main/convolve.h" +#include "main/context.h" +#include "main/feedback.h" +#include "main/image.h" +#include "main/macros.h" +#include "main/imports.h" +#include "main/pixel.h" +#include "main/state.h" #include "s_context.h" #include "s_depth.h" diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c index 4c58f8de87..214c2a1b6f 100644 --- a/src/mesa/swrast/s_span.c +++ b/src/mesa/swrast/s_span.c @@ -30,12 +30,12 @@ * \author Brian Paul */ -#include "glheader.h" -#include "colormac.h" -#include "context.h" -#include "macros.h" -#include "imports.h" -#include "image.h" +#include "main/glheader.h" +#include "main/colormac.h" +#include "main/context.h" +#include "main/macros.h" +#include "main/imports.h" +#include "main/image.h" #include "s_atifragshader.h" #include "s_alpha.h" diff --git a/src/mesa/swrast/s_span.h b/src/mesa/swrast/s_span.h index 512134db0f..c4b47df58f 100644 --- a/src/mesa/swrast/s_span.h +++ b/src/mesa/swrast/s_span.h @@ -27,7 +27,6 @@ #define S_SPAN_H -#include "mtypes.h" #include "swrast.h" diff --git a/src/mesa/swrast/s_spantemp.h b/src/mesa/swrast/s_spantemp.h index 1eef81eb91..bab2ca7378 100644 --- a/src/mesa/swrast/s_spantemp.h +++ b/src/mesa/swrast/s_spantemp.h @@ -43,7 +43,7 @@ * ignored otherwise. */ -#include "macros.h" +#include "main/macros.h" #ifdef CI_MODE diff --git a/src/mesa/swrast/s_stencil.c b/src/mesa/swrast/s_stencil.c index cae1e09929..c925922463 100644 --- a/src/mesa/swrast/s_stencil.c +++ b/src/mesa/swrast/s_stencil.c @@ -23,9 +23,9 @@ */ -#include "glheader.h" -#include "context.h" -#include "imports.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/imports.h" #include "s_context.h" #include "s_depth.h" diff --git a/src/mesa/swrast/s_stencil.h b/src/mesa/swrast/s_stencil.h index 1fcb538fec..cd6cbc57b0 100644 --- a/src/mesa/swrast/s_stencil.h +++ b/src/mesa/swrast/s_stencil.h @@ -27,7 +27,6 @@ #define S_STENCIL_H -#include "mtypes.h" #include "swrast.h" diff --git a/src/mesa/swrast/s_texcombine.c b/src/mesa/swrast/s_texcombine.c index 4ac7222daa..4e3d329075 100644 --- a/src/mesa/swrast/s_texcombine.c +++ b/src/mesa/swrast/s_texcombine.c @@ -23,12 +23,12 @@ */ -#include "glheader.h" -#include "context.h" -#include "colormac.h" -#include "imports.h" -#include "macros.h" -#include "pixel.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/colormac.h" +#include "main/imports.h" +#include "main/macros.h" +#include "main/pixel.h" #include "s_context.h" #include "s_texcombine.h" diff --git a/src/mesa/swrast/s_texcombine.h b/src/mesa/swrast/s_texcombine.h index 3bf70e0b86..9ed96efb87 100644 --- a/src/mesa/swrast/s_texcombine.h +++ b/src/mesa/swrast/s_texcombine.h @@ -27,7 +27,6 @@ #define S_TEXCOMBINE_H -#include "mtypes.h" #include "swrast.h" extern void diff --git a/src/mesa/swrast/s_texfilter.c b/src/mesa/swrast/s_texfilter.c index c9e9db132f..9e44fba3da 100644 --- a/src/mesa/swrast/s_texfilter.c +++ b/src/mesa/swrast/s_texfilter.c @@ -23,11 +23,11 @@ */ -#include "glheader.h" -#include "context.h" -#include "colormac.h" -#include "imports.h" -#include "texformat.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/colormac.h" +#include "main/imports.h" +#include "main/texformat.h" #include "s_context.h" #include "s_texfilter.h" @@ -342,6 +342,7 @@ lerp_rgba_3d(GLchan result[4], GLfloat a, GLfloat b, GLfloat c, break; \ default: \ _mesa_problem(ctx, "Bad wrap mode"); \ + return; \ } \ } @@ -462,6 +463,7 @@ lerp_rgba_3d(GLchan result[4], GLfloat a, GLfloat b, GLfloat c, break; \ default: \ _mesa_problem(ctx, "Bad wrap mode"); \ + return; \ } \ } diff --git a/src/mesa/swrast/s_texfilter.h b/src/mesa/swrast/s_texfilter.h index e4445e79a0..2e265d685c 100644 --- a/src/mesa/swrast/s_texfilter.h +++ b/src/mesa/swrast/s_texfilter.h @@ -27,7 +27,6 @@ #define S_TEXFILTER_H -#include "mtypes.h" #include "swrast.h" diff --git a/src/mesa/swrast/s_texstore.c b/src/mesa/swrast/s_texstore.c index 547d5b9ea0..15d52aa587 100644 --- a/src/mesa/swrast/s_texstore.c +++ b/src/mesa/swrast/s_texstore.c @@ -36,17 +36,17 @@ -#include "glheader.h" -#include "imports.h" -#include "colormac.h" -#include "context.h" -#include "convolve.h" -#include "image.h" -#include "macros.h" -#include "mipmap.h" -#include "texformat.h" -#include "teximage.h" -#include "texstore.h" +#include "main/glheader.h" +#include "main/imports.h" +#include "main/colormac.h" +#include "main/context.h" +#include "main/convolve.h" +#include "main/image.h" +#include "main/macros.h" +#include "main/mipmap.h" +#include "main/texformat.h" +#include "main/teximage.h" +#include "main/texstore.h" #include "s_context.h" #include "s_depth.h" diff --git a/src/mesa/swrast/s_triangle.c b/src/mesa/swrast/s_triangle.c index 59e15645f3..2033ab5529 100644 --- a/src/mesa/swrast/s_triangle.c +++ b/src/mesa/swrast/s_triangle.c @@ -29,12 +29,12 @@ * functions to draw triangles. */ -#include "glheader.h" -#include "context.h" -#include "colormac.h" -#include "imports.h" -#include "macros.h" -#include "texformat.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/colormac.h" +#include "main/imports.h" +#include "main/macros.h" +#include "main/texformat.h" #include "s_aatriangle.h" #include "s_context.h" diff --git a/src/mesa/swrast/s_triangle.h b/src/mesa/swrast/s_triangle.h index 0de812500c..b81932c730 100644 --- a/src/mesa/swrast/s_triangle.h +++ b/src/mesa/swrast/s_triangle.h @@ -28,7 +28,6 @@ #define S_TRIANGLES_H -#include "mtypes.h" #include "swrast.h" diff --git a/src/mesa/swrast/s_zoom.c b/src/mesa/swrast/s_zoom.c index 4473078b78..a48eae1925 100644 --- a/src/mesa/swrast/s_zoom.c +++ b/src/mesa/swrast/s_zoom.c @@ -22,10 +22,10 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include "glheader.h" -#include "macros.h" -#include "imports.h" -#include "colormac.h" +#include "main/glheader.h" +#include "main/macros.h" +#include "main/imports.h" +#include "main/colormac.h" #include "s_context.h" #include "s_span.h" diff --git a/src/mesa/swrast/s_zoom.h b/src/mesa/swrast/s_zoom.h index 6ca11ac211..d2815b41a0 100644 --- a/src/mesa/swrast/s_zoom.h +++ b/src/mesa/swrast/s_zoom.h @@ -25,7 +25,6 @@ #ifndef S_ZOOM_H #define S_ZOOM_H -#include "mtypes.h" #include "swrast.h" diff --git a/src/mesa/swrast_setup/ss_context.c b/src/mesa/swrast_setup/ss_context.c index a4f949ddfe..f4d90c514b 100644 --- a/src/mesa/swrast_setup/ss_context.c +++ b/src/mesa/swrast_setup/ss_context.c @@ -25,16 +25,17 @@ * Keith Whitwell <keith@tungstengraphics.com> */ -#include "glheader.h" -#include "imports.h" -#include "colormac.h" -#include "ss_context.h" -#include "ss_triangle.h" -#include "swrast_setup.h" +#include "main/glheader.h" +#include "main/imports.h" +#include "main/colormac.h" #include "tnl/tnl.h" #include "tnl/t_context.h" #include "tnl/t_pipeline.h" #include "tnl/t_vertex.h" +#include "swrast_setup.h" +#include "ss_context.h" +#include "ss_triangle.h" + /* Need to check lighting state and vertex program state to know * if two-sided lighting is in effect. diff --git a/src/mesa/swrast_setup/ss_context.h b/src/mesa/swrast_setup/ss_context.h index 11f9ded3ff..1ec293fade 100644 --- a/src/mesa/swrast_setup/ss_context.h +++ b/src/mesa/swrast_setup/ss_context.h @@ -28,7 +28,7 @@ #ifndef SS_CONTEXT_H #define SS_CONTEXT_H -#include "mtypes.h" +#include "main/mtypes.h" #include "swrast/swrast.h" #include "swrast_setup.h" #include "tnl/t_context.h" diff --git a/src/mesa/swrast_setup/ss_triangle.c b/src/mesa/swrast_setup/ss_triangle.c index 5a0f1f2429..54e24c4c44 100644 --- a/src/mesa/swrast_setup/ss_triangle.c +++ b/src/mesa/swrast_setup/ss_triangle.c @@ -25,10 +25,10 @@ * Keith Whitwell <keith@tungstengraphics.com> */ -#include "glheader.h" -#include "colormac.h" -#include "macros.h" -#include "mtypes.h" +#include "main/glheader.h" +#include "main/colormac.h" +#include "main/macros.h" +#include "main/mtypes.h" #include "tnl/t_context.h" diff --git a/src/mesa/swrast_setup/ss_triangle.h b/src/mesa/swrast_setup/ss_triangle.h index 78833269e6..007fa2e914 100644 --- a/src/mesa/swrast_setup/ss_triangle.h +++ b/src/mesa/swrast_setup/ss_triangle.h @@ -29,7 +29,6 @@ #ifndef SS_TRIANGLE_H #define SS_TRIANGLE_H -#include "mtypes.h" #include "ss_context.h" diff --git a/src/mesa/swrast_setup/ss_vb.h b/src/mesa/swrast_setup/ss_vb.h index 6ea0cb1a70..2ad1f56f39 100644 --- a/src/mesa/swrast_setup/ss_vb.h +++ b/src/mesa/swrast_setup/ss_vb.h @@ -29,7 +29,7 @@ #ifndef SS_VB_H #define SS_VB_H -#include "mtypes.h" +#include "main/mtypes.h" #include "swrast_setup.h" void _swsetup_vb_init( GLcontext *ctx ); diff --git a/src/mesa/tnl/t_context.c b/src/mesa/tnl/t_context.c index e772a06eda..8977fadcca 100644 --- a/src/mesa/tnl/t_context.c +++ b/src/mesa/tnl/t_context.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.5.2 + * Version: 7.2 * - * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2008 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"), @@ -61,7 +61,6 @@ _tnl_CreateContext( GLcontext *ctx ) /* Initialize tnl state. */ if (ctx->VertexProgram._MaintainTnlProgram) { - _tnl_ProgramCacheInit( ctx ); _tnl_install_pipeline( ctx, _tnl_vp_pipeline ); } else { _tnl_install_pipeline( ctx, _tnl_default_pipeline ); @@ -90,9 +89,6 @@ _tnl_DestroyContext( GLcontext *ctx ) _tnl_destroy_pipeline( ctx ); - if (ctx->VertexProgram._MaintainTnlProgram) - _tnl_ProgramCacheDestroy( ctx ); - FREE(tnl); ctx->swtnl_context = NULL; } @@ -137,11 +133,19 @@ _tnl_InvalidateState( GLcontext *ctx, GLuint new_state ) RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_COLOR_INDEX ); } - if (ctx->Fog.Enabled || - ((ctx->FragmentProgram._Active || ctx->FragmentProgram._Current) && - (ctx->FragmentProgram._Current->FogOption != GL_NONE || - (ctx->FragmentProgram._Current->Base.InputsRead & FRAG_BIT_FOGC)))) + if (ctx->Fog.Enabled) { + /* fixed-function fog */ RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_FOG ); + } + else if (ctx->FragmentProgram._Active || ctx->FragmentProgram._Current) { + struct gl_fragment_program *fp = ctx->FragmentProgram._Current; + if (fp) { + if (fp->FogOption != GL_NONE || (fp->Base.InputsRead & FRAG_BIT_FOGC)) { + /* fragment program needs fog coord */ + RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_FOG ); + } + } + } if (ctx->Polygon.FrontMode != GL_FILL || ctx->Polygon.BackMode != GL_FILL) diff --git a/src/mesa/tnl/t_context.h b/src/mesa/tnl/t_context.h index 1ac508f033..0a6ce04614 100644 --- a/src/mesa/tnl/t_context.h +++ b/src/mesa/tnl/t_context.h @@ -385,19 +385,6 @@ struct tnl_clipspace }; -struct tnl_cache_item { - GLuint hash; - void *key; - struct gl_vertex_program *prog; - struct tnl_cache_item *next; -}; - -struct tnl_cache { - struct tnl_cache_item **items; - GLuint size, n_items; -}; - - struct tnl_device_driver { /*** @@ -549,10 +536,6 @@ typedef struct GLubyte *block[VERT_ATTRIB_MAX]; GLuint nr_blocks; - /* Cache of fixed-function-replacing vertex programs: - */ - struct tnl_cache *vp_cache; - } TNLcontext; diff --git a/src/mesa/tnl/t_draw.c b/src/mesa/tnl/t_draw.c index 46b8b536a2..fd647c1f4a 100644 --- a/src/mesa/tnl/t_draw.c +++ b/src/mesa/tnl/t_draw.c @@ -25,13 +25,13 @@ * Keith Whitwell <keith@tungstengraphics.com> */ -#include "glheader.h" -#include "context.h" -#include "imports.h" -#include "state.h" -#include "mtypes.h" -#include "macros.h" -#include "enums.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/imports.h" +#include "main/state.h" +#include "main/mtypes.h" +#include "main/macros.h" +#include "main/enums.h" #include "t_context.h" #include "t_pipeline.h" diff --git a/src/mesa/tnl/t_pipeline.h b/src/mesa/tnl/t_pipeline.h index 0952854b85..d110010f04 100644 --- a/src/mesa/tnl/t_pipeline.h +++ b/src/mesa/tnl/t_pipeline.h @@ -30,7 +30,7 @@ #ifndef _T_PIPELINE_H_ #define _T_PIPELINE_H_ -#include "mtypes.h" +#include "main/mtypes.h" #include "t_context.h" extern void _tnl_run_pipeline( GLcontext *ctx ); diff --git a/src/mesa/tnl/t_rasterpos.c b/src/mesa/tnl/t_rasterpos.c new file mode 100644 index 0000000000..dfbe0f1806 --- /dev/null +++ b/src/mesa/tnl/t_rasterpos.c @@ -0,0 +1,505 @@ +/* + * Mesa 3-D graphics library + * Version: 7.1 + * + * Copyright (C) 1999-2007 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. + */ + + +#include "main/glheader.h" +#include "main/colormac.h" +#include "main/context.h" +#include "feedback.h" +#include "light.h" +#include "main/macros.h" +#include "rastpos.h" +#include "simple_list.h" +#include "main/mtypes.h" + +#include "math/m_matrix.h" +#include "tnl/tnl.h" + + + +/** + * Clip a point against the view volume. + * + * \param v vertex vector describing the point to clip. + * + * \return zero if outside view volume, or one if inside. + */ +static GLuint +viewclip_point( const GLfloat v[] ) +{ + if ( v[0] > v[3] || v[0] < -v[3] + || v[1] > v[3] || v[1] < -v[3] + || v[2] > v[3] || v[2] < -v[3] ) { + return 0; + } + else { + return 1; + } +} + + +/** + * Clip a point against the far/near Z clipping planes. + * + * \param v vertex vector describing the point to clip. + * + * \return zero if outside view volume, or one if inside. + */ +static GLuint +viewclip_point_z( const GLfloat v[] ) +{ + if (v[2] > v[3] || v[2] < -v[3] ) { + return 0; + } + else { + return 1; + } +} + + +/** + * Clip a point against the user clipping planes. + * + * \param ctx GL context. + * \param v vertex vector describing the point to clip. + * + * \return zero if the point was clipped, or one otherwise. + */ +static GLuint +userclip_point( GLcontext *ctx, const GLfloat v[] ) +{ + GLuint p; + + for (p = 0; p < ctx->Const.MaxClipPlanes; p++) { + if (ctx->Transform.ClipPlanesEnabled & (1 << p)) { + GLfloat dot = v[0] * ctx->Transform._ClipUserPlane[p][0] + + v[1] * ctx->Transform._ClipUserPlane[p][1] + + v[2] * ctx->Transform._ClipUserPlane[p][2] + + v[3] * ctx->Transform._ClipUserPlane[p][3]; + if (dot < 0.0F) { + return 0; + } + } + } + + return 1; +} + + +/** + * Compute lighting for the raster position. Both RGB and CI modes computed. + * \param ctx the context + * \param vertex vertex location + * \param normal normal vector + * \param Rcolor returned color + * \param Rspec returned specular color (if separate specular enabled) + * \param Rindex returned color index + */ +static void +shade_rastpos(GLcontext *ctx, + const GLfloat vertex[4], + const GLfloat normal[3], + GLfloat Rcolor[4], + GLfloat Rspec[4], + GLfloat *Rindex) +{ + /*const*/ GLfloat (*base)[3] = ctx->Light._BaseColor; + const struct gl_light *light; + GLfloat diffuseColor[4], specularColor[4]; /* for RGB mode only */ + GLfloat diffuseCI = 0.0, specularCI = 0.0; /* for CI mode only */ + + _mesa_validate_all_lighting_tables( ctx ); + + COPY_3V(diffuseColor, base[0]); + diffuseColor[3] = CLAMP( + ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_DIFFUSE][3], 0.0F, 1.0F ); + ASSIGN_4V(specularColor, 0.0, 0.0, 0.0, 1.0); + + foreach (light, &ctx->Light.EnabledList) { + GLfloat attenuation = 1.0; + GLfloat VP[3]; /* vector from vertex to light pos */ + GLfloat n_dot_VP; + GLfloat diffuseContrib[3], specularContrib[3]; + + if (!(light->_Flags & LIGHT_POSITIONAL)) { + /* light at infinity */ + COPY_3V(VP, light->_VP_inf_norm); + attenuation = light->_VP_inf_spot_attenuation; + } + else { + /* local/positional light */ + GLfloat d; + + /* VP = vector from vertex pos to light[i].pos */ + SUB_3V(VP, light->_Position, vertex); + /* d = length(VP) */ + d = (GLfloat) LEN_3FV( VP ); + if (d > 1.0e-6) { + /* normalize VP */ + GLfloat invd = 1.0F / d; + SELF_SCALE_SCALAR_3V(VP, invd); + } + + /* atti */ + attenuation = 1.0F / (light->ConstantAttenuation + d * + (light->LinearAttenuation + d * + light->QuadraticAttenuation)); + + if (light->_Flags & LIGHT_SPOT) { + GLfloat PV_dot_dir = - DOT3(VP, light->_NormDirection); + + if (PV_dot_dir<light->_CosCutoff) { + continue; + } + else { + double x = PV_dot_dir * (EXP_TABLE_SIZE-1); + int k = (int) x; + GLfloat spot = (GLfloat) (light->_SpotExpTable[k][0] + + (x-k)*light->_SpotExpTable[k][1]); + attenuation *= spot; + } + } + } + + if (attenuation < 1e-3) + continue; + + n_dot_VP = DOT3( normal, VP ); + + if (n_dot_VP < 0.0F) { + ACC_SCALE_SCALAR_3V(diffuseColor, attenuation, light->_MatAmbient[0]); + continue; + } + + /* Ambient + diffuse */ + COPY_3V(diffuseContrib, light->_MatAmbient[0]); + ACC_SCALE_SCALAR_3V(diffuseContrib, n_dot_VP, light->_MatDiffuse[0]); + diffuseCI += n_dot_VP * light->_dli * attenuation; + + /* Specular */ + { + const GLfloat *h; + GLfloat n_dot_h; + + ASSIGN_3V(specularContrib, 0.0, 0.0, 0.0); + + if (ctx->Light.Model.LocalViewer) { + GLfloat v[3]; + COPY_3V(v, vertex); + NORMALIZE_3FV(v); + SUB_3V(VP, VP, v); + NORMALIZE_3FV(VP); + h = VP; + } + else if (light->_Flags & LIGHT_POSITIONAL) { + ACC_3V(VP, ctx->_EyeZDir); + NORMALIZE_3FV(VP); + h = VP; + } + else { + h = light->_h_inf_norm; + } + + n_dot_h = DOT3(normal, h); + + if (n_dot_h > 0.0F) { + GLfloat spec_coef; + GET_SHINE_TAB_ENTRY( ctx->_ShineTable[0], n_dot_h, spec_coef ); + + if (spec_coef > 1.0e-10) { + if (ctx->Light.Model.ColorControl==GL_SEPARATE_SPECULAR_COLOR) { + ACC_SCALE_SCALAR_3V( specularContrib, spec_coef, + light->_MatSpecular[0]); + } + else { + ACC_SCALE_SCALAR_3V( diffuseContrib, spec_coef, + light->_MatSpecular[0]); + } + /*assert(light->_sli > 0.0);*/ + specularCI += spec_coef * light->_sli * attenuation; + } + } + } + + ACC_SCALE_SCALAR_3V( diffuseColor, attenuation, diffuseContrib ); + ACC_SCALE_SCALAR_3V( specularColor, attenuation, specularContrib ); + } + + if (ctx->Visual.rgbMode) { + Rcolor[0] = CLAMP(diffuseColor[0], 0.0F, 1.0F); + Rcolor[1] = CLAMP(diffuseColor[1], 0.0F, 1.0F); + Rcolor[2] = CLAMP(diffuseColor[2], 0.0F, 1.0F); + Rcolor[3] = CLAMP(diffuseColor[3], 0.0F, 1.0F); + Rspec[0] = CLAMP(specularColor[0], 0.0F, 1.0F); + Rspec[1] = CLAMP(specularColor[1], 0.0F, 1.0F); + Rspec[2] = CLAMP(specularColor[2], 0.0F, 1.0F); + Rspec[3] = CLAMP(specularColor[3], 0.0F, 1.0F); + } + else { + GLfloat *ind = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_INDEXES]; + GLfloat d_a = ind[MAT_INDEX_DIFFUSE] - ind[MAT_INDEX_AMBIENT]; + GLfloat s_a = ind[MAT_INDEX_SPECULAR] - ind[MAT_INDEX_AMBIENT]; + GLfloat i = (ind[MAT_INDEX_AMBIENT] + + diffuseCI * (1.0F-specularCI) * d_a + + specularCI * s_a); + if (i > ind[MAT_INDEX_SPECULAR]) { + i = ind[MAT_INDEX_SPECULAR]; + } + *Rindex = i; + } +} + + +/** + * Do texgen needed for glRasterPos. + * \param ctx rendering context + * \param vObj object-space vertex coordinate + * \param vEye eye-space vertex coordinate + * \param normal vertex normal + * \param unit texture unit number + * \param texcoord incoming texcoord and resulting texcoord + */ +static void +compute_texgen(GLcontext *ctx, const GLfloat vObj[4], const GLfloat vEye[4], + const GLfloat normal[3], GLuint unit, GLfloat texcoord[4]) +{ + const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; + + /* always compute sphere map terms, just in case */ + GLfloat u[3], two_nu, rx, ry, rz, m, mInv; + COPY_3V(u, vEye); + NORMALIZE_3FV(u); + two_nu = 2.0F * DOT3(normal, u); + rx = u[0] - normal[0] * two_nu; + ry = u[1] - normal[1] * two_nu; + rz = u[2] - normal[2] * two_nu; + m = rx * rx + ry * ry + (rz + 1.0F) * (rz + 1.0F); + if (m > 0.0F) + mInv = 0.5F * _mesa_inv_sqrtf(m); + else + mInv = 0.0F; + + if (texUnit->TexGenEnabled & S_BIT) { + switch (texUnit->GenModeS) { + case GL_OBJECT_LINEAR: + texcoord[0] = DOT4(vObj, texUnit->ObjectPlaneS); + break; + case GL_EYE_LINEAR: + texcoord[0] = DOT4(vEye, texUnit->EyePlaneS); + break; + case GL_SPHERE_MAP: + texcoord[0] = rx * mInv + 0.5F; + break; + case GL_REFLECTION_MAP: + texcoord[0] = rx; + break; + case GL_NORMAL_MAP: + texcoord[0] = normal[0]; + break; + default: + _mesa_problem(ctx, "Bad S texgen in compute_texgen()"); + return; + } + } + + if (texUnit->TexGenEnabled & T_BIT) { + switch (texUnit->GenModeT) { + case GL_OBJECT_LINEAR: + texcoord[1] = DOT4(vObj, texUnit->ObjectPlaneT); + break; + case GL_EYE_LINEAR: + texcoord[1] = DOT4(vEye, texUnit->EyePlaneT); + break; + case GL_SPHERE_MAP: + texcoord[1] = ry * mInv + 0.5F; + break; + case GL_REFLECTION_MAP: + texcoord[1] = ry; + break; + case GL_NORMAL_MAP: + texcoord[1] = normal[1]; + break; + default: + _mesa_problem(ctx, "Bad T texgen in compute_texgen()"); + return; + } + } + + if (texUnit->TexGenEnabled & R_BIT) { + switch (texUnit->GenModeR) { + case GL_OBJECT_LINEAR: + texcoord[2] = DOT4(vObj, texUnit->ObjectPlaneR); + break; + case GL_EYE_LINEAR: + texcoord[2] = DOT4(vEye, texUnit->EyePlaneR); + break; + case GL_REFLECTION_MAP: + texcoord[2] = rz; + break; + case GL_NORMAL_MAP: + texcoord[2] = normal[2]; + break; + default: + _mesa_problem(ctx, "Bad R texgen in compute_texgen()"); + return; + } + } + + if (texUnit->TexGenEnabled & Q_BIT) { + switch (texUnit->GenModeQ) { + case GL_OBJECT_LINEAR: + texcoord[3] = DOT4(vObj, texUnit->ObjectPlaneQ); + break; + case GL_EYE_LINEAR: + texcoord[3] = DOT4(vEye, texUnit->EyePlaneQ); + break; + default: + _mesa_problem(ctx, "Bad Q texgen in compute_texgen()"); + return; + } + } +} + + +/** + * glRasterPos transformation. Typically called via ctx->Driver.RasterPos(). + * XXX some of this code (such as viewport xform, clip testing and setting + * of ctx->Current.Raster* fields) could get lifted up into the + * main/rasterpos.c code. + * + * \param vObj vertex position in object space + */ +void +_tnl_RasterPos(GLcontext *ctx, const GLfloat vObj[4]) +{ + if (ctx->VertexProgram._Enabled) { + /* XXX implement this */ + _mesa_problem(ctx, "Vertex programs not implemented for glRasterPos"); + return; + } + else { + GLfloat eye[4], clip[4], ndc[3], d; + GLfloat *norm, eyenorm[3]; + GLfloat *objnorm = ctx->Current.Attrib[VERT_ATTRIB_NORMAL]; + + /* apply modelview matrix: eye = MV * obj */ + TRANSFORM_POINT( eye, ctx->ModelviewMatrixStack.Top->m, vObj ); + /* apply projection matrix: clip = Proj * eye */ + TRANSFORM_POINT( clip, ctx->ProjectionMatrixStack.Top->m, eye ); + + /* clip to view volume */ + if (ctx->Transform.RasterPositionUnclipped) { + /* GL_IBM_rasterpos_clip: only clip against Z */ + if (viewclip_point_z(clip) == 0) { + ctx->Current.RasterPosValid = GL_FALSE; + return; + } + } + else if (viewclip_point(clip) == 0) { + /* Normal OpenGL behaviour */ + ctx->Current.RasterPosValid = GL_FALSE; + return; + } + + /* clip to user clipping planes */ + if (ctx->Transform.ClipPlanesEnabled && !userclip_point(ctx, clip)) { + ctx->Current.RasterPosValid = GL_FALSE; + return; + } + + /* ndc = clip / W */ + d = (clip[3] == 0.0F) ? 1.0F : 1.0F / clip[3]; + ndc[0] = clip[0] * d; + ndc[1] = clip[1] * d; + ndc[2] = clip[2] * d; + /* wincoord = viewport_mapping(ndc) */ + ctx->Current.RasterPos[0] = (ndc[0] * ctx->Viewport._WindowMap.m[MAT_SX] + + ctx->Viewport._WindowMap.m[MAT_TX]); + ctx->Current.RasterPos[1] = (ndc[1] * ctx->Viewport._WindowMap.m[MAT_SY] + + ctx->Viewport._WindowMap.m[MAT_TY]); + ctx->Current.RasterPos[2] = (ndc[2] * ctx->Viewport._WindowMap.m[MAT_SZ] + + ctx->Viewport._WindowMap.m[MAT_TZ]) + / ctx->DrawBuffer->_DepthMaxF; + ctx->Current.RasterPos[3] = clip[3]; + + /* compute raster distance */ + if (ctx->Fog.FogCoordinateSource == GL_FOG_COORDINATE_EXT) + ctx->Current.RasterDistance = ctx->Current.Attrib[VERT_ATTRIB_FOG][0]; + else + ctx->Current.RasterDistance = + SQRTF( eye[0]*eye[0] + eye[1]*eye[1] + eye[2]*eye[2] ); + + /* compute transformed normal vector (for lighting or texgen) */ + if (ctx->_NeedEyeCoords) { + const GLfloat *inv = ctx->ModelviewMatrixStack.Top->inv; + TRANSFORM_NORMAL( eyenorm, objnorm, inv ); + norm = eyenorm; + } + else { + norm = objnorm; + } + + /* update raster color */ + if (ctx->Light.Enabled) { + /* lighting */ + shade_rastpos( ctx, vObj, norm, + ctx->Current.RasterColor, + ctx->Current.RasterSecondaryColor, + &ctx->Current.RasterIndex ); + } + else { + /* use current color or index */ + if (ctx->Visual.rgbMode) { + COPY_4FV(ctx->Current.RasterColor, + ctx->Current.Attrib[VERT_ATTRIB_COLOR0]); + COPY_4FV(ctx->Current.RasterSecondaryColor, + ctx->Current.Attrib[VERT_ATTRIB_COLOR1]); + } + else { + ctx->Current.RasterIndex + = ctx->Current.Attrib[VERT_ATTRIB_COLOR_INDEX][0]; + } + } + + /* texture coords */ + { + GLuint u; + for (u = 0; u < ctx->Const.MaxTextureCoordUnits; u++) { + GLfloat tc[4]; + COPY_4V(tc, ctx->Current.Attrib[VERT_ATTRIB_TEX0 + u]); + if (ctx->Texture.Unit[u].TexGenEnabled) { + compute_texgen(ctx, vObj, eye, norm, u, tc); + } + TRANSFORM_POINT(ctx->Current.RasterTexCoords[u], + ctx->TextureMatrixStack[u].Top->m, tc); + } + } + + ctx->Current.RasterPosValid = GL_TRUE; + } + + if (ctx->RenderMode == GL_SELECT) { + _mesa_update_hitflag( ctx, ctx->Current.RasterPos[2] ); + } +} diff --git a/src/mesa/tnl/t_vb_cull.c b/src/mesa/tnl/t_vb_cull.c index 21a32e5b1d..712901acf3 100644 --- a/src/mesa/tnl/t_vb_cull.c +++ b/src/mesa/tnl/t_vb_cull.c @@ -26,12 +26,12 @@ */ -#include "glheader.h" -#include "colormac.h" -#include "context.h" -#include "macros.h" -#include "imports.h" -#include "mtypes.h" +#include "main/glheader.h" +#include "main/colormac.h" +#include "main/context.h" +#include "main/macros.h" +#include "main/imports.h" +#include "main/mtypes.h" #include "math/m_xform.h" diff --git a/src/mesa/tnl/t_vb_fog.c b/src/mesa/tnl/t_vb_fog.c index 99e5a09c75..f3a7bd49f4 100644 --- a/src/mesa/tnl/t_vb_fog.c +++ b/src/mesa/tnl/t_vb_fog.c @@ -26,12 +26,12 @@ */ -#include "glheader.h" -#include "colormac.h" -#include "context.h" -#include "macros.h" -#include "imports.h" -#include "mtypes.h" +#include "main/glheader.h" +#include "main/colormac.h" +#include "main/context.h" +#include "main/macros.h" +#include "main/imports.h" +#include "main/mtypes.h" #include "math/m_xform.h" diff --git a/src/mesa/tnl/t_vb_light.c b/src/mesa/tnl/t_vb_light.c index 12f2cc7735..f47f99397c 100644 --- a/src/mesa/tnl/t_vb_light.c +++ b/src/mesa/tnl/t_vb_light.c @@ -24,13 +24,13 @@ -#include "glheader.h" -#include "colormac.h" -#include "light.h" -#include "macros.h" -#include "imports.h" -#include "simple_list.h" -#include "mtypes.h" +#include "main/glheader.h" +#include "main/colormac.h" +#include "main/light.h" +#include "main/macros.h" +#include "main/imports.h" +#include "main/simple_list.h" +#include "main/mtypes.h" #include "math/m_translate.h" diff --git a/src/mesa/tnl/t_vb_normals.c b/src/mesa/tnl/t_vb_normals.c index 01fad0cee2..a4821cc1cc 100644 --- a/src/mesa/tnl/t_vb_normals.c +++ b/src/mesa/tnl/t_vb_normals.c @@ -26,12 +26,12 @@ */ -#include "glheader.h" -#include "colormac.h" -#include "context.h" -#include "macros.h" -#include "imports.h" -#include "mtypes.h" +#include "main/glheader.h" +#include "main/colormac.h" +#include "main/context.h" +#include "main/macros.h" +#include "main/imports.h" +#include "main/mtypes.h" #include "math/m_xform.h" diff --git a/src/mesa/tnl/t_vb_points.c b/src/mesa/tnl/t_vb_points.c index 1ac14fedf9..01d055c1dd 100644 --- a/src/mesa/tnl/t_vb_points.c +++ b/src/mesa/tnl/t_vb_points.c @@ -25,8 +25,8 @@ * Brian Paul */ -#include "mtypes.h" -#include "imports.h" +#include "main/mtypes.h" +#include "main/imports.h" #include "t_context.h" #include "t_pipeline.h" diff --git a/src/mesa/tnl/t_vb_render.c b/src/mesa/tnl/t_vb_render.c index c38f0745e1..c1bebc9942 100644 --- a/src/mesa/tnl/t_vb_render.c +++ b/src/mesa/tnl/t_vb_render.c @@ -38,12 +38,12 @@ */ -#include "glheader.h" -#include "context.h" -#include "enums.h" -#include "macros.h" -#include "imports.h" -#include "mtypes.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/enums.h" +#include "main/macros.h" +#include "main/imports.h" +#include "main/mtypes.h" #include "t_pipeline.h" diff --git a/src/mesa/tnl/t_vb_texgen.c b/src/mesa/tnl/t_vb_texgen.c index e98ab743c5..14d3876e54 100644 --- a/src/mesa/tnl/t_vb_texgen.c +++ b/src/mesa/tnl/t_vb_texgen.c @@ -35,12 +35,12 @@ * including any use thereof or modifications thereto. */ -#include "glheader.h" -#include "colormac.h" -#include "context.h" -#include "macros.h" -#include "imports.h" -#include "mtypes.h" +#include "main/glheader.h" +#include "main/colormac.h" +#include "main/context.h" +#include "main/macros.h" +#include "main/imports.h" +#include "main/mtypes.h" #include "math/m_xform.h" diff --git a/src/mesa/tnl/t_vb_texmat.c b/src/mesa/tnl/t_vb_texmat.c index 674d36f8cb..0abe8cc35d 100644 --- a/src/mesa/tnl/t_vb_texmat.c +++ b/src/mesa/tnl/t_vb_texmat.c @@ -26,12 +26,12 @@ */ -#include "glheader.h" -#include "colormac.h" -#include "context.h" -#include "macros.h" -#include "imports.h" -#include "mtypes.h" +#include "main/glheader.h" +#include "main/colormac.h" +#include "main/context.h" +#include "main/macros.h" +#include "main/imports.h" +#include "main/mtypes.h" #include "math/m_xform.h" diff --git a/src/mesa/tnl/t_vb_vertex.c b/src/mesa/tnl/t_vb_vertex.c index 276305b5e6..30aa7c4086 100644 --- a/src/mesa/tnl/t_vb_vertex.c +++ b/src/mesa/tnl/t_vb_vertex.c @@ -26,12 +26,12 @@ */ -#include "glheader.h" -#include "colormac.h" -#include "context.h" -#include "macros.h" -#include "imports.h" -#include "mtypes.h" +#include "main/glheader.h" +#include "main/colormac.h" +#include "main/context.h" +#include "main/macros.h" +#include "main/imports.h" +#include "main/mtypes.h" #include "math/m_xform.h" diff --git a/src/mesa/tnl/t_vertex.c b/src/mesa/tnl/t_vertex.c index a6728c318f..b661524c87 100644 --- a/src/mesa/tnl/t_vertex.c +++ b/src/mesa/tnl/t_vertex.c @@ -25,9 +25,9 @@ * Keith Whitwell <keithw@tungstengraphics.com> */ -#include "glheader.h" -#include "context.h" -#include "colormac.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/colormac.h" #include "t_context.h" #include "t_vertex.h" diff --git a/src/mesa/tnl/t_vertex.h b/src/mesa/tnl/t_vertex.h index fda8f151d3..712311a146 100644 --- a/src/mesa/tnl/t_vertex.h +++ b/src/mesa/tnl/t_vertex.h @@ -28,7 +28,7 @@ #ifndef _TNL_VERTEX_H #define _TNL_VERTEX_H -#include "mtypes.h" +#include "main/mtypes.h" #include "t_context.h" /* New mechanism to specify hardware vertices so that tnl can build diff --git a/src/mesa/tnl/t_vertex_generic.c b/src/mesa/tnl/t_vertex_generic.c index 236a5bedc8..db70ad4dad 100644 --- a/src/mesa/tnl/t_vertex_generic.c +++ b/src/mesa/tnl/t_vertex_generic.c @@ -26,12 +26,12 @@ * Keith Whitwell <keithw@tungstengraphics.com> */ -#include "glheader.h" -#include "context.h" -#include "colormac.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/colormac.h" +#include "main/simple_list.h" #include "t_context.h" #include "t_vertex.h" -#include "simple_list.h" diff --git a/src/mesa/tnl/t_vertex_sse.c b/src/mesa/tnl/t_vertex_sse.c index f1c98fe2d1..76043bd1b5 100644 --- a/src/mesa/tnl/t_vertex_sse.c +++ b/src/mesa/tnl/t_vertex_sse.c @@ -25,13 +25,13 @@ * Keith Whitwell <keithw@tungstengraphics.com> */ -#include "glheader.h" -#include "context.h" -#include "colormac.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/colormac.h" +#include "main/simple_list.h" +#include "main/enums.h" #include "t_context.h" #include "t_vertex.h" -#include "simple_list.h" -#include "enums.h" #if defined(USE_SSE_ASM) diff --git a/src/mesa/tnl/t_vp_build.c b/src/mesa/tnl/t_vp_build.c index d79f84f1eb..7be4d95af6 100644 --- a/src/mesa/tnl/t_vp_build.c +++ b/src/mesa/tnl/t_vp_build.c @@ -30,1555 +30,23 @@ */ -#include "glheader.h" -#include "macros.h" -#include "enums.h" -#include "shader/program.h" -#include "shader/prog_instruction.h" -#include "shader/prog_parameter.h" -#include "shader/prog_print.h" -#include "shader/prog_statevars.h" -#include "t_context.h" /* NOTE: very light dependency on this */ +#include "main/glheader.h" +#include "main/ffvertex_prog.h" #include "t_vp_build.h" -struct state_key { - unsigned light_global_enabled:1; - unsigned light_local_viewer:1; - unsigned light_twoside:1; - unsigned light_color_material:1; - unsigned light_color_material_mask:12; - unsigned light_material_mask:12; - - unsigned normalize:1; - unsigned rescale_normals:1; - unsigned fog_source_is_depth:1; - unsigned tnl_do_vertex_fog:1; - unsigned separate_specular:1; - unsigned fog_mode:2; - unsigned point_attenuated:1; - unsigned texture_enabled_global:1; - unsigned fragprog_inputs_read:12; - - struct { - unsigned light_enabled:1; - unsigned light_eyepos3_is_zero:1; - unsigned light_spotcutoff_is_180:1; - unsigned light_attenuated:1; - unsigned texunit_really_enabled:1; - unsigned texmat_enabled:1; - unsigned texgen_enabled:4; - unsigned texgen_mode0:4; - unsigned texgen_mode1:4; - unsigned texgen_mode2:4; - unsigned texgen_mode3:4; - } unit[8]; -}; - - - -#define FOG_NONE 0 -#define FOG_LINEAR 1 -#define FOG_EXP 2 -#define FOG_EXP2 3 - -static GLuint translate_fog_mode( GLenum mode ) -{ - switch (mode) { - case GL_LINEAR: return FOG_LINEAR; - case GL_EXP: return FOG_EXP; - case GL_EXP2: return FOG_EXP2; - default: return FOG_NONE; - } -} - -#define TXG_NONE 0 -#define TXG_OBJ_LINEAR 1 -#define TXG_EYE_LINEAR 2 -#define TXG_SPHERE_MAP 3 -#define TXG_REFLECTION_MAP 4 -#define TXG_NORMAL_MAP 5 - -static GLuint translate_texgen( GLboolean enabled, GLenum mode ) -{ - if (!enabled) - return TXG_NONE; - - switch (mode) { - case GL_OBJECT_LINEAR: return TXG_OBJ_LINEAR; - case GL_EYE_LINEAR: return TXG_EYE_LINEAR; - case GL_SPHERE_MAP: return TXG_SPHERE_MAP; - case GL_REFLECTION_MAP_NV: return TXG_REFLECTION_MAP; - case GL_NORMAL_MAP_NV: return TXG_NORMAL_MAP; - default: return TXG_NONE; - } -} - -static struct state_key *make_state_key( GLcontext *ctx ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - struct vertex_buffer *VB = &tnl->vb; - const struct gl_fragment_program *fp = ctx->FragmentProgram._Current; - struct state_key *key = CALLOC_STRUCT(state_key); - GLuint i; - - /* This now relies on texenvprogram.c being active: - */ - assert(fp); - - key->fragprog_inputs_read = fp->Base.InputsRead; - - key->separate_specular = (ctx->Light.Model.ColorControl == - GL_SEPARATE_SPECULAR_COLOR); - - if (ctx->Light.Enabled) { - key->light_global_enabled = 1; - - if (ctx->Light.Model.LocalViewer) - key->light_local_viewer = 1; - - if (ctx->Light.Model.TwoSide) - key->light_twoside = 1; - - if (ctx->Light.ColorMaterialEnabled) { - key->light_color_material = 1; - key->light_color_material_mask = ctx->Light.ColorMaterialBitmask; - } - - for (i = _TNL_FIRST_MAT; i <= _TNL_LAST_MAT; i++) - if (VB->AttribPtr[i]->stride) - key->light_material_mask |= 1<<(i-_TNL_ATTRIB_MAT_FRONT_AMBIENT); - - for (i = 0; i < MAX_LIGHTS; i++) { - struct gl_light *light = &ctx->Light.Light[i]; - - if (light->Enabled) { - key->unit[i].light_enabled = 1; - - if (light->EyePosition[3] == 0.0) - key->unit[i].light_eyepos3_is_zero = 1; - - if (light->SpotCutoff == 180.0) - key->unit[i].light_spotcutoff_is_180 = 1; - - if (light->ConstantAttenuation != 1.0 || - light->LinearAttenuation != 0.0 || - light->QuadraticAttenuation != 0.0) - key->unit[i].light_attenuated = 1; - } - } - } - - if (ctx->Transform.Normalize) - key->normalize = 1; - - if (ctx->Transform.RescaleNormals) - key->rescale_normals = 1; - - key->fog_mode = translate_fog_mode(fp->FogOption); - - if (ctx->Fog.FogCoordinateSource == GL_FRAGMENT_DEPTH_EXT) - key->fog_source_is_depth = 1; - - if (tnl->_DoVertexFog) - key->tnl_do_vertex_fog = 1; - - if (ctx->Point._Attenuated) - key->point_attenuated = 1; - - if (ctx->Texture._TexGenEnabled || - ctx->Texture._TexMatEnabled || - ctx->Texture._EnabledUnits) - key->texture_enabled_global = 1; - - for (i = 0; i < MAX_TEXTURE_UNITS; i++) { - struct gl_texture_unit *texUnit = &ctx->Texture.Unit[i]; - - if (texUnit->_ReallyEnabled) - key->unit[i].texunit_really_enabled = 1; - - if (ctx->Texture._TexMatEnabled & ENABLE_TEXMAT(i)) - key->unit[i].texmat_enabled = 1; - - if (texUnit->TexGenEnabled) { - key->unit[i].texgen_enabled = 1; - - key->unit[i].texgen_mode0 = - translate_texgen( texUnit->TexGenEnabled & (1<<0), - texUnit->GenModeS ); - key->unit[i].texgen_mode1 = - translate_texgen( texUnit->TexGenEnabled & (1<<1), - texUnit->GenModeT ); - key->unit[i].texgen_mode2 = - translate_texgen( texUnit->TexGenEnabled & (1<<2), - texUnit->GenModeR ); - key->unit[i].texgen_mode3 = - translate_texgen( texUnit->TexGenEnabled & (1<<3), - texUnit->GenModeQ ); - } - } - - return key; -} - - - -/* Very useful debugging tool - produces annotated listing of - * generated program with line/function references for each - * instruction back into this file: - */ -#define DISASSEM (MESA_VERBOSE&VERBOSE_DISASSEM) - -/* Should be tunable by the driver - do we want to do matrix - * multiplications with DP4's or with MUL/MAD's? SSE works better - * with the latter, drivers may differ. - */ -#define PREFER_DP4 0 - -#define MAX_INSN 256 - -/* Use uregs to represent registers internally, translate to Mesa's - * expected formats on emit. - * - * NOTE: These are passed by value extensively in this file rather - * than as usual by pointer reference. If this disturbs you, try - * remembering they are just 32bits in size. - * - * GCC is smart enough to deal with these dword-sized structures in - * much the same way as if I had defined them as dwords and was using - * macros to access and set the fields. This is much nicer and easier - * to evolve. - */ -struct ureg { - GLuint file:4; - GLint idx:8; /* relative addressing may be negative */ - GLuint negate:1; - GLuint swz:12; - GLuint pad:7; -}; - - -struct tnl_program { - const struct state_key *state; - struct gl_vertex_program *program; - - GLuint temp_in_use; - GLuint temp_reserved; - - struct ureg eye_position; - struct ureg eye_position_normalized; - struct ureg eye_normal; - struct ureg identity; - - GLuint materials; - GLuint color_materials; -}; - - -static const struct ureg undef = { - PROGRAM_UNDEFINED, - ~0, - 0, - 0, - 0 -}; - -/* Local shorthand: - */ -#define X SWIZZLE_X -#define Y SWIZZLE_Y -#define Z SWIZZLE_Z -#define W SWIZZLE_W - - -/* Construct a ureg: - */ -static struct ureg make_ureg(GLuint file, GLint idx) -{ - struct ureg reg; - reg.file = file; - reg.idx = idx; - reg.negate = 0; - reg.swz = SWIZZLE_NOOP; - reg.pad = 0; - return reg; -} - - - -static struct ureg negate( struct ureg reg ) -{ - reg.negate ^= 1; - return reg; -} - - -static struct ureg swizzle( struct ureg reg, int x, int y, int z, int w ) -{ - reg.swz = MAKE_SWIZZLE4(GET_SWZ(reg.swz, x), - GET_SWZ(reg.swz, y), - GET_SWZ(reg.swz, z), - GET_SWZ(reg.swz, w)); - - return reg; -} - -static struct ureg swizzle1( struct ureg reg, int x ) -{ - return swizzle(reg, x, x, x, x); -} - -static struct ureg get_temp( struct tnl_program *p ) -{ - int bit = _mesa_ffs( ~p->temp_in_use ); - if (!bit) { - _mesa_problem(NULL, "%s: out of temporaries\n", __FILE__); - _mesa_exit(1); - } - - if ((GLuint) bit > p->program->Base.NumTemporaries) - p->program->Base.NumTemporaries = bit; - - p->temp_in_use |= 1<<(bit-1); - return make_ureg(PROGRAM_TEMPORARY, bit-1); -} - -static struct ureg reserve_temp( struct tnl_program *p ) -{ - struct ureg temp = get_temp( p ); - p->temp_reserved |= 1<<temp.idx; - return temp; -} - -static void release_temp( struct tnl_program *p, struct ureg reg ) -{ - if (reg.file == PROGRAM_TEMPORARY) { - p->temp_in_use &= ~(1<<reg.idx); - p->temp_in_use |= p->temp_reserved; /* can't release reserved temps */ - } -} - -static void release_temps( struct tnl_program *p ) -{ - p->temp_in_use = p->temp_reserved; -} - - - -static struct ureg register_input( struct tnl_program *p, GLuint input ) -{ - p->program->Base.InputsRead |= (1<<input); - return make_ureg(PROGRAM_INPUT, input); -} - -static struct ureg register_output( struct tnl_program *p, GLuint output ) -{ - p->program->Base.OutputsWritten |= (1<<output); - return make_ureg(PROGRAM_OUTPUT, output); -} - -static struct ureg register_const4f( struct tnl_program *p, - GLfloat s0, - GLfloat s1, - GLfloat s2, - GLfloat s3) -{ - GLfloat values[4]; - GLint idx; - GLuint swizzle; - values[0] = s0; - values[1] = s1; - values[2] = s2; - values[3] = s3; - idx = _mesa_add_unnamed_constant( p->program->Base.Parameters, values, 4, - &swizzle ); - ASSERT(swizzle == SWIZZLE_NOOP); - return make_ureg(PROGRAM_STATE_VAR, idx); -} - -#define register_const1f(p, s0) register_const4f(p, s0, 0, 0, 1) -#define register_scalar_const(p, s0) register_const4f(p, s0, s0, s0, s0) -#define register_const2f(p, s0, s1) register_const4f(p, s0, s1, 0, 1) -#define register_const3f(p, s0, s1, s2) register_const4f(p, s0, s1, s2, 1) - -static GLboolean is_undef( struct ureg reg ) -{ - return reg.file == PROGRAM_UNDEFINED; -} - -static struct ureg get_identity_param( struct tnl_program *p ) -{ - if (is_undef(p->identity)) - p->identity = register_const4f(p, 0,0,0,1); - - return p->identity; -} - -static struct ureg register_param5(struct tnl_program *p, - GLint s0, - GLint s1, - GLint s2, - GLint s3, - GLint s4) -{ - gl_state_index tokens[STATE_LENGTH]; - GLint idx; - tokens[0] = s0; - tokens[1] = s1; - tokens[2] = s2; - tokens[3] = s3; - tokens[4] = s4; - idx = _mesa_add_state_reference( p->program->Base.Parameters, tokens ); - return make_ureg(PROGRAM_STATE_VAR, idx); -} - - -#define register_param1(p,s0) register_param5(p,s0,0,0,0,0) -#define register_param2(p,s0,s1) register_param5(p,s0,s1,0,0,0) -#define register_param3(p,s0,s1,s2) register_param5(p,s0,s1,s2,0,0) -#define register_param4(p,s0,s1,s2,s3) register_param5(p,s0,s1,s2,s3,0) - - -static void register_matrix_param5( struct tnl_program *p, - GLint s0, /* modelview, projection, etc */ - GLint s1, /* texture matrix number */ - GLint s2, /* first row */ - GLint s3, /* last row */ - GLint s4, /* inverse, transpose, etc */ - struct ureg *matrix ) -{ - GLint i; - - /* This is a bit sad as the support is there to pull the whole - * matrix out in one go: - */ - for (i = 0; i <= s3 - s2; i++) - matrix[i] = register_param5( p, s0, s1, i, i, s4 ); -} - - -/** - * Convert a ureg source register to a prog_src_register. - */ -static void emit_arg( struct prog_src_register *src, - struct ureg reg ) -{ - assert(reg.file != PROGRAM_OUTPUT); - src->File = reg.file; - src->Index = reg.idx; - src->Swizzle = reg.swz; - src->NegateBase = reg.negate ? NEGATE_XYZW : 0; - src->Abs = 0; - src->NegateAbs = 0; - src->RelAddr = 0; -} - /** - * Convert a ureg dest register to a prog_dst_register. - */ -static void emit_dst( struct prog_dst_register *dst, - struct ureg reg, GLuint mask ) -{ - /* Check for legal output register type. UNDEFINED will occur in - * instruction that don't produce a result (like END). - */ - assert(reg.file == PROGRAM_TEMPORARY || - reg.file == PROGRAM_OUTPUT || - reg.file == PROGRAM_UNDEFINED); - dst->File = reg.file; - dst->Index = reg.idx; - /* allow zero as a shorthand for xyzw */ - dst->WriteMask = mask ? mask : WRITEMASK_XYZW; - dst->CondMask = COND_TR; /* always pass cond test */ - dst->CondSwizzle = SWIZZLE_NOOP; - dst->CondSrc = 0; - dst->pad = 0; -} - -static void debug_insn( struct prog_instruction *inst, const char *fn, - GLuint line ) -{ - if (DISASSEM) { - static const char *last_fn; - - if (fn != last_fn) { - last_fn = fn; - _mesa_printf("%s:\n", fn); - } - - _mesa_printf("%d:\t", line); - _mesa_print_instruction(inst); - } -} - - -static void emit_op3fn(struct tnl_program *p, - enum prog_opcode op, - struct ureg dest, - GLuint mask, - struct ureg src0, - struct ureg src1, - struct ureg src2, - const char *fn, - GLuint line) -{ - GLuint nr = p->program->Base.NumInstructions++; - struct prog_instruction *inst = &p->program->Base.Instructions[nr]; - - if (p->program->Base.NumInstructions > MAX_INSN) { - _mesa_problem(0, "Out of instructions in emit_op3fn\n"); - return; - } - - inst->Opcode = (enum prog_opcode) op; - inst->StringPos = 0; - inst->Data = 0; - - emit_arg( &inst->SrcReg[0], src0 ); - emit_arg( &inst->SrcReg[1], src1 ); - emit_arg( &inst->SrcReg[2], src2 ); - - emit_dst( &inst->DstReg, dest, mask ); - - debug_insn(inst, fn, line); -} - - -#define emit_op3(p, op, dst, mask, src0, src1, src2) \ - emit_op3fn(p, op, dst, mask, src0, src1, src2, __FUNCTION__, __LINE__) - -#define emit_op2(p, op, dst, mask, src0, src1) \ - emit_op3fn(p, op, dst, mask, src0, src1, undef, __FUNCTION__, __LINE__) - -#define emit_op1(p, op, dst, mask, src0) \ - emit_op3fn(p, op, dst, mask, src0, undef, undef, __FUNCTION__, __LINE__) - - -static struct ureg make_temp( struct tnl_program *p, struct ureg reg ) -{ - if (reg.file == PROGRAM_TEMPORARY && - !(p->temp_reserved & (1<<reg.idx))) - return reg; - else { - struct ureg temp = get_temp(p); - emit_op1(p, OPCODE_MOV, temp, 0, reg); - return temp; - } -} - - -/* Currently no tracking performed of input/output/register size or - * active elements. Could be used to reduce these operations, as - * could the matrix type. - */ -static void emit_matrix_transform_vec4( struct tnl_program *p, - struct ureg dest, - const struct ureg *mat, - struct ureg src) -{ - emit_op2(p, OPCODE_DP4, dest, WRITEMASK_X, src, mat[0]); - emit_op2(p, OPCODE_DP4, dest, WRITEMASK_Y, src, mat[1]); - emit_op2(p, OPCODE_DP4, dest, WRITEMASK_Z, src, mat[2]); - emit_op2(p, OPCODE_DP4, dest, WRITEMASK_W, src, mat[3]); -} - -/* This version is much easier to implement if writemasks are not - * supported natively on the target or (like SSE), the target doesn't - * have a clean/obvious dotproduct implementation. - */ -static void emit_transpose_matrix_transform_vec4( struct tnl_program *p, - struct ureg dest, - const struct ureg *mat, - struct ureg src) -{ - struct ureg tmp; - - if (dest.file != PROGRAM_TEMPORARY) - tmp = get_temp(p); - else - tmp = dest; - - emit_op2(p, OPCODE_MUL, tmp, 0, swizzle1(src,X), mat[0]); - emit_op3(p, OPCODE_MAD, tmp, 0, swizzle1(src,Y), mat[1], tmp); - emit_op3(p, OPCODE_MAD, tmp, 0, swizzle1(src,Z), mat[2], tmp); - emit_op3(p, OPCODE_MAD, dest, 0, swizzle1(src,W), mat[3], tmp); - - if (dest.file != PROGRAM_TEMPORARY) - release_temp(p, tmp); -} - -static void emit_matrix_transform_vec3( struct tnl_program *p, - struct ureg dest, - const struct ureg *mat, - struct ureg src) -{ - emit_op2(p, OPCODE_DP3, dest, WRITEMASK_X, src, mat[0]); - emit_op2(p, OPCODE_DP3, dest, WRITEMASK_Y, src, mat[1]); - emit_op2(p, OPCODE_DP3, dest, WRITEMASK_Z, src, mat[2]); -} - - -static void emit_normalize_vec3( struct tnl_program *p, - struct ureg dest, - struct ureg src ) -{ - struct ureg tmp = get_temp(p); - emit_op2(p, OPCODE_DP3, tmp, 0, src, src); - emit_op1(p, OPCODE_RSQ, tmp, 0, tmp); - emit_op2(p, OPCODE_MUL, dest, 0, src, tmp); - release_temp(p, tmp); -} - -static void emit_passthrough( struct tnl_program *p, - GLuint input, - GLuint output ) -{ - struct ureg out = register_output(p, output); - emit_op1(p, OPCODE_MOV, out, 0, register_input(p, input)); -} - -static struct ureg get_eye_position( struct tnl_program *p ) -{ - if (is_undef(p->eye_position)) { - struct ureg pos = register_input( p, VERT_ATTRIB_POS ); - struct ureg modelview[4]; - - p->eye_position = reserve_temp(p); - - if (PREFER_DP4) { - register_matrix_param5( p, STATE_MODELVIEW_MATRIX, 0, 0, 3, - 0, modelview ); - - emit_matrix_transform_vec4(p, p->eye_position, modelview, pos); - } - else { - register_matrix_param5( p, STATE_MODELVIEW_MATRIX, 0, 0, 3, - STATE_MATRIX_TRANSPOSE, modelview ); - - emit_transpose_matrix_transform_vec4(p, p->eye_position, modelview, pos); - } - } - - return p->eye_position; -} - - -static struct ureg get_eye_position_normalized( struct tnl_program *p ) -{ - if (is_undef(p->eye_position_normalized)) { - struct ureg eye = get_eye_position(p); - p->eye_position_normalized = reserve_temp(p); - emit_normalize_vec3(p, p->eye_position_normalized, eye); - } - - return p->eye_position_normalized; -} - - -static struct ureg get_eye_normal( struct tnl_program *p ) -{ - if (is_undef(p->eye_normal)) { - struct ureg normal = register_input(p, VERT_ATTRIB_NORMAL ); - struct ureg mvinv[3]; - - register_matrix_param5( p, STATE_MODELVIEW_MATRIX, 0, 0, 2, - STATE_MATRIX_INVTRANS, mvinv ); - - p->eye_normal = reserve_temp(p); - - /* Transform to eye space: - */ - emit_matrix_transform_vec3( p, p->eye_normal, mvinv, normal ); - - /* Normalize/Rescale: - */ - if (p->state->normalize) { - emit_normalize_vec3( p, p->eye_normal, p->eye_normal ); - } - else if (p->state->rescale_normals) { - struct ureg rescale = register_param2(p, STATE_INTERNAL, - STATE_NORMAL_SCALE); - - emit_op2( p, OPCODE_MUL, p->eye_normal, 0, p->eye_normal, - swizzle1(rescale, X)); - } - } - - return p->eye_normal; -} - - - -static void build_hpos( struct tnl_program *p ) -{ - struct ureg pos = register_input( p, VERT_ATTRIB_POS ); - struct ureg hpos = register_output( p, VERT_RESULT_HPOS ); - struct ureg mvp[4]; - - if (PREFER_DP4) { - register_matrix_param5( p, STATE_MVP_MATRIX, 0, 0, 3, - 0, mvp ); - emit_matrix_transform_vec4( p, hpos, mvp, pos ); - } - else { - register_matrix_param5( p, STATE_MVP_MATRIX, 0, 0, 3, - STATE_MATRIX_TRANSPOSE, mvp ); - emit_transpose_matrix_transform_vec4( p, hpos, mvp, pos ); - } -} - - -static GLuint material_attrib( GLuint side, GLuint property ) -{ - return ((property - STATE_AMBIENT) * 2 + - side); -} - -/* Get a bitmask of which material values vary on a per-vertex basis. - */ -static void set_material_flags( struct tnl_program *p ) -{ - p->color_materials = 0; - p->materials = 0; - - if (p->state->light_color_material) { - p->materials = - p->color_materials = p->state->light_color_material_mask; - } - - p->materials |= p->state->light_material_mask; -} - - -static struct ureg get_material( struct tnl_program *p, GLuint side, - GLuint property ) -{ - GLuint attrib = material_attrib(side, property); - - if (p->color_materials & (1<<attrib)) - return register_input(p, VERT_ATTRIB_COLOR0); - else if (p->materials & (1<<attrib)) - return register_input( p, attrib + _TNL_ATTRIB_MAT_FRONT_AMBIENT ); - else - return register_param3( p, STATE_MATERIAL, side, property ); -} - -#define SCENE_COLOR_BITS(side) (( MAT_BIT_FRONT_EMISSION | \ - MAT_BIT_FRONT_AMBIENT | \ - MAT_BIT_FRONT_DIFFUSE) << (side)) - -/* Either return a precalculated constant value or emit code to - * calculate these values dynamically in the case where material calls - * are present between begin/end pairs. - * - * Probably want to shift this to the program compilation phase - if - * we always emitted the calculation here, a smart compiler could - * detect that it was constant (given a certain set of inputs), and - * lift it out of the main loop. That way the programs created here - * would be independent of the vertex_buffer details. + * XXX This should go away someday, but still referenced by some drivers... */ -static struct ureg get_scenecolor( struct tnl_program *p, GLuint side ) -{ - if (p->materials & SCENE_COLOR_BITS(side)) { - struct ureg lm_ambient = register_param1(p, STATE_LIGHTMODEL_AMBIENT); - struct ureg material_emission = get_material(p, side, STATE_EMISSION); - struct ureg material_ambient = get_material(p, side, STATE_AMBIENT); - struct ureg material_diffuse = get_material(p, side, STATE_DIFFUSE); - struct ureg tmp = make_temp(p, material_diffuse); - emit_op3(p, OPCODE_MAD, tmp, WRITEMASK_XYZ, lm_ambient, - material_ambient, material_emission); - return tmp; - } - else - return register_param2( p, STATE_LIGHTMODEL_SCENECOLOR, side ); -} - - -static struct ureg get_lightprod( struct tnl_program *p, GLuint light, - GLuint side, GLuint property ) -{ - GLuint attrib = material_attrib(side, property); - if (p->materials & (1<<attrib)) { - struct ureg light_value = - register_param3(p, STATE_LIGHT, light, property); - struct ureg material_value = get_material(p, side, property); - struct ureg tmp = get_temp(p); - emit_op2(p, OPCODE_MUL, tmp, 0, light_value, material_value); - return tmp; - } - else - return register_param4(p, STATE_LIGHTPROD, light, side, property); -} - -static struct ureg calculate_light_attenuation( struct tnl_program *p, - GLuint i, - struct ureg VPpli, - struct ureg dist ) -{ - struct ureg attenuation = register_param3(p, STATE_LIGHT, i, - STATE_ATTENUATION); - struct ureg att = get_temp(p); - - /* Calculate spot attenuation: - */ - if (!p->state->unit[i].light_spotcutoff_is_180) { - struct ureg spot_dir_norm = register_param3(p, STATE_INTERNAL, - STATE_SPOT_DIR_NORMALIZED, i); - struct ureg spot = get_temp(p); - struct ureg slt = get_temp(p); - - emit_op2(p, OPCODE_DP3, spot, 0, negate(VPpli), spot_dir_norm); - emit_op2(p, OPCODE_SLT, slt, 0, swizzle1(spot_dir_norm,W), spot); - emit_op2(p, OPCODE_POW, spot, 0, spot, swizzle1(attenuation, W)); - emit_op2(p, OPCODE_MUL, att, 0, slt, spot); - - release_temp(p, spot); - release_temp(p, slt); - } - - /* Calculate distance attenuation: - */ - if (p->state->unit[i].light_attenuated) { - - /* 1/d,d,d,1/d */ - emit_op1(p, OPCODE_RCP, dist, WRITEMASK_YZ, dist); - /* 1,d,d*d,1/d */ - emit_op2(p, OPCODE_MUL, dist, WRITEMASK_XZ, dist, swizzle1(dist,Y)); - /* 1/dist-atten */ - emit_op2(p, OPCODE_DP3, dist, 0, attenuation, dist); - - if (!p->state->unit[i].light_spotcutoff_is_180) { - /* dist-atten */ - emit_op1(p, OPCODE_RCP, dist, 0, dist); - /* spot-atten * dist-atten */ - emit_op2(p, OPCODE_MUL, att, 0, dist, att); - } else { - /* dist-atten */ - emit_op1(p, OPCODE_RCP, att, 0, dist); - } - } - - return att; -} - - - - - -/* Need to add some addtional parameters to allow lighting in object - * space - STATE_SPOT_DIRECTION and STATE_HALF_VECTOR implicitly assume eye - * space lighting. - */ -static void build_lighting( struct tnl_program *p ) -{ - const GLboolean twoside = p->state->light_twoside; - const GLboolean separate = p->state->separate_specular; - GLuint nr_lights = 0, count = 0; - struct ureg normal = get_eye_normal(p); - struct ureg lit = get_temp(p); - struct ureg dots = get_temp(p); - struct ureg _col0 = undef, _col1 = undef; - struct ureg _bfc0 = undef, _bfc1 = undef; - GLuint i; - - for (i = 0; i < MAX_LIGHTS; i++) - if (p->state->unit[i].light_enabled) - nr_lights++; - - set_material_flags(p); - - { - struct ureg shininess = get_material(p, 0, STATE_SHININESS); - emit_op1(p, OPCODE_MOV, dots, WRITEMASK_W, swizzle1(shininess,X)); - - _col0 = make_temp(p, get_scenecolor(p, 0)); - if (separate) - _col1 = make_temp(p, get_identity_param(p)); - else - _col1 = _col0; - - } - - if (twoside) { - struct ureg shininess = get_material(p, 1, STATE_SHININESS); - emit_op1(p, OPCODE_MOV, dots, WRITEMASK_Z, - negate(swizzle1(shininess,X))); - - _bfc0 = make_temp(p, get_scenecolor(p, 1)); - if (separate) - _bfc1 = make_temp(p, get_identity_param(p)); - else - _bfc1 = _bfc0; - } - - - /* If no lights, still need to emit the scenecolor. - */ - { - struct ureg res0 = register_output( p, VERT_RESULT_COL0 ); - emit_op1(p, OPCODE_MOV, res0, 0, _col0); - } - - if (separate) { - struct ureg res1 = register_output( p, VERT_RESULT_COL1 ); - emit_op1(p, OPCODE_MOV, res1, 0, _col1); - } - - if (twoside) { - struct ureg res0 = register_output( p, VERT_RESULT_BFC0 ); - emit_op1(p, OPCODE_MOV, res0, 0, _bfc0); - } - - if (twoside && separate) { - struct ureg res1 = register_output( p, VERT_RESULT_BFC1 ); - emit_op1(p, OPCODE_MOV, res1, 0, _bfc1); - } - - if (nr_lights == 0) { - release_temps(p); - return; - } - - - for (i = 0; i < MAX_LIGHTS; i++) { - if (p->state->unit[i].light_enabled) { - struct ureg half = undef; - struct ureg att = undef, VPpli = undef; - - count++; - - if (p->state->unit[i].light_eyepos3_is_zero) { - /* Can used precomputed constants in this case. - * Attenuation never applies to infinite lights. - */ - VPpli = register_param3(p, STATE_LIGHT, i, - STATE_POSITION_NORMALIZED); - if (p->state->light_local_viewer) { - struct ureg eye_hat = get_eye_position_normalized(p); - half = get_temp(p); - emit_op2(p, OPCODE_SUB, half, 0, VPpli, eye_hat); - emit_normalize_vec3(p, half, half); - } else { - half = register_param3(p, STATE_LIGHT, i, STATE_HALF_VECTOR); - } - } - else { - struct ureg Ppli = register_param3(p, STATE_LIGHT, i, - STATE_POSITION); - struct ureg V = get_eye_position(p); - struct ureg dist = get_temp(p); - struct ureg tmpPpli = get_temp(p); - - VPpli = get_temp(p); - - /* In homogeneous object coordinates - */ - emit_op1(p, OPCODE_RCP, dist, 0, swizzle1(Ppli, W)); - emit_op2(p, OPCODE_MUL, tmpPpli, 0, Ppli, dist); - - /* Calculate VPpli vector - */ - emit_op2(p, OPCODE_SUB, VPpli, 0, tmpPpli, V); - - /* we're done with tmpPpli now */ - release_temp(p, tmpPpli); - - /* Normalize VPpli. The dist value also used in - * attenuation below. - */ - emit_op2(p, OPCODE_DP3, dist, 0, VPpli, VPpli); - emit_op1(p, OPCODE_RSQ, dist, 0, dist); - emit_op2(p, OPCODE_MUL, VPpli, 0, VPpli, dist); - - - /* Calculate attenuation: - */ - if (!p->state->unit[i].light_spotcutoff_is_180 || - p->state->unit[i].light_attenuated) { - att = calculate_light_attenuation(p, i, VPpli, dist); - } - - /* We're done with dist now */ - release_temp(p, dist); - - - /* Calculate viewer direction, or use infinite viewer: - */ - half = get_temp(p); - if (p->state->light_local_viewer) { - struct ureg eye_hat = get_eye_position_normalized(p); - emit_op2(p, OPCODE_SUB, half, 0, VPpli, eye_hat); - } - else { - struct ureg z_dir = swizzle(get_identity_param(p),X,Y,W,Z); - emit_op2(p, OPCODE_ADD, half, 0, VPpli, z_dir); - } - - emit_normalize_vec3(p, half, half); - } - - /* Calculate dot products: - */ - emit_op2(p, OPCODE_DP3, dots, WRITEMASK_X, normal, VPpli); - emit_op2(p, OPCODE_DP3, dots, WRITEMASK_Y, normal, half); - - /* we're done with VPpli and half now, so free them as to not drive up - our temp usage unnecessary */ - release_temp(p, VPpli); - release_temp(p, half); - - /* Front face lighting: - */ - { - struct ureg ambient = get_lightprod(p, i, 0, STATE_AMBIENT); - struct ureg diffuse = get_lightprod(p, i, 0, STATE_DIFFUSE); - struct ureg specular = get_lightprod(p, i, 0, STATE_SPECULAR); - struct ureg res0, res1; - GLuint mask0, mask1; - - emit_op1(p, OPCODE_LIT, lit, 0, dots); - - if (!is_undef(att)) - emit_op2(p, OPCODE_MUL, lit, 0, lit, att); - - - if (count == nr_lights) { - if (separate) { - mask0 = WRITEMASK_XYZ; - mask1 = WRITEMASK_XYZ; - res0 = register_output( p, VERT_RESULT_COL0 ); - res1 = register_output( p, VERT_RESULT_COL1 ); - } - else { - mask0 = 0; - mask1 = WRITEMASK_XYZ; - res0 = _col0; - res1 = register_output( p, VERT_RESULT_COL0 ); - } - } else { - mask0 = 0; - mask1 = 0; - res0 = _col0; - res1 = _col1; - } - - emit_op3(p, OPCODE_MAD, _col0, 0, swizzle1(lit,X), ambient, _col0); - emit_op3(p, OPCODE_MAD, res0, mask0, swizzle1(lit,Y), diffuse, _col0); - emit_op3(p, OPCODE_MAD, res1, mask1, swizzle1(lit,Z), specular, _col1); - - release_temp(p, ambient); - release_temp(p, diffuse); - release_temp(p, specular); - } - - /* Back face lighting: - */ - if (twoside) { - struct ureg ambient = get_lightprod(p, i, 1, STATE_AMBIENT); - struct ureg diffuse = get_lightprod(p, i, 1, STATE_DIFFUSE); - struct ureg specular = get_lightprod(p, i, 1, STATE_SPECULAR); - struct ureg res0, res1; - GLuint mask0, mask1; - - emit_op1(p, OPCODE_LIT, lit, 0, negate(swizzle(dots,X,Y,W,Z))); - - if (!is_undef(att)) - emit_op2(p, OPCODE_MUL, lit, 0, lit, att); - - if (count == nr_lights) { - if (separate) { - mask0 = WRITEMASK_XYZ; - mask1 = WRITEMASK_XYZ; - res0 = register_output( p, VERT_RESULT_BFC0 ); - res1 = register_output( p, VERT_RESULT_BFC1 ); - } - else { - mask0 = 0; - mask1 = WRITEMASK_XYZ; - res0 = _bfc0; - res1 = register_output( p, VERT_RESULT_BFC0 ); - } - } else { - res0 = _bfc0; - res1 = _bfc1; - mask0 = 0; - mask1 = 0; - } - - emit_op3(p, OPCODE_MAD, _bfc0, 0, swizzle1(lit,X), ambient, _bfc0); - emit_op3(p, OPCODE_MAD, res0, mask0, swizzle1(lit,Y), diffuse, _bfc0); - emit_op3(p, OPCODE_MAD, res1, mask1, swizzle1(lit,Z), specular, _bfc1); - - release_temp(p, ambient); - release_temp(p, diffuse); - release_temp(p, specular); - } - - release_temp(p, att); - } - } - - release_temps( p ); -} - - -static void build_fog( struct tnl_program *p ) -{ - struct ureg fog = register_output(p, VERT_RESULT_FOGC); - struct ureg input; - - if (p->state->fog_source_is_depth) { - input = swizzle1(get_eye_position(p), Z); - } - else { - input = swizzle1(register_input(p, VERT_ATTRIB_FOG), X); - } - - if (p->state->fog_mode && p->state->tnl_do_vertex_fog) { - struct ureg params = register_param2(p, STATE_INTERNAL, - STATE_FOG_PARAMS_OPTIMIZED); - struct ureg tmp = get_temp(p); - GLboolean useabs = (p->state->fog_mode != FOG_EXP2); - - if (useabs) { - emit_op1(p, OPCODE_ABS, tmp, 0, input); - } - - switch (p->state->fog_mode) { - case FOG_LINEAR: { - struct ureg id = get_identity_param(p); - emit_op3(p, OPCODE_MAD, tmp, 0, useabs ? tmp : input, - swizzle1(params,X), swizzle1(params,Y)); - emit_op2(p, OPCODE_MAX, tmp, 0, tmp, swizzle1(id,X)); /* saturate */ - emit_op2(p, OPCODE_MIN, fog, WRITEMASK_X, tmp, swizzle1(id,W)); - break; - } - case FOG_EXP: - emit_op2(p, OPCODE_MUL, tmp, 0, useabs ? tmp : input, - swizzle1(params,Z)); - emit_op1(p, OPCODE_EX2, fog, WRITEMASK_X, negate(tmp)); - break; - case FOG_EXP2: - emit_op2(p, OPCODE_MUL, tmp, 0, input, swizzle1(params,W)); - emit_op2(p, OPCODE_MUL, tmp, 0, tmp, tmp); - emit_op1(p, OPCODE_EX2, fog, WRITEMASK_X, negate(tmp)); - break; - } - - release_temp(p, tmp); - } - else { - /* results = incoming fog coords (compute fog per-fragment later) - * - * KW: Is it really necessary to do anything in this case? - * BP: Yes, we always need to compute the absolute value, unless - * we want to push that down into the fragment program... - */ - GLboolean useabs = GL_TRUE; - emit_op1(p, useabs ? OPCODE_ABS : OPCODE_MOV, fog, WRITEMASK_X, input); - } -} - -static void build_reflect_texgen( struct tnl_program *p, - struct ureg dest, - GLuint writemask ) -{ - struct ureg normal = get_eye_normal(p); - struct ureg eye_hat = get_eye_position_normalized(p); - struct ureg tmp = get_temp(p); - - /* n.u */ - emit_op2(p, OPCODE_DP3, tmp, 0, normal, eye_hat); - /* 2n.u */ - emit_op2(p, OPCODE_ADD, tmp, 0, tmp, tmp); - /* (-2n.u)n + u */ - emit_op3(p, OPCODE_MAD, dest, writemask, negate(tmp), normal, eye_hat); - - release_temp(p, tmp); -} - -static void build_sphere_texgen( struct tnl_program *p, - struct ureg dest, - GLuint writemask ) -{ - struct ureg normal = get_eye_normal(p); - struct ureg eye_hat = get_eye_position_normalized(p); - struct ureg tmp = get_temp(p); - struct ureg half = register_scalar_const(p, .5); - struct ureg r = get_temp(p); - struct ureg inv_m = get_temp(p); - struct ureg id = get_identity_param(p); - - /* Could share the above calculations, but it would be - * a fairly odd state for someone to set (both sphere and - * reflection active for different texture coordinate - * components. Of course - if two texture units enable - * reflect and/or sphere, things start to tilt in favour - * of seperating this out: - */ - - /* n.u */ - emit_op2(p, OPCODE_DP3, tmp, 0, normal, eye_hat); - /* 2n.u */ - emit_op2(p, OPCODE_ADD, tmp, 0, tmp, tmp); - /* (-2n.u)n + u */ - emit_op3(p, OPCODE_MAD, r, 0, negate(tmp), normal, eye_hat); - /* r + 0,0,1 */ - emit_op2(p, OPCODE_ADD, tmp, 0, r, swizzle(id,X,Y,W,Z)); - /* rx^2 + ry^2 + (rz+1)^2 */ - emit_op2(p, OPCODE_DP3, tmp, 0, tmp, tmp); - /* 2/m */ - emit_op1(p, OPCODE_RSQ, tmp, 0, tmp); - /* 1/m */ - emit_op2(p, OPCODE_MUL, inv_m, 0, tmp, half); - /* r/m + 1/2 */ - emit_op3(p, OPCODE_MAD, dest, writemask, r, inv_m, half); - - release_temp(p, tmp); - release_temp(p, r); - release_temp(p, inv_m); -} - - -static void build_texture_transform( struct tnl_program *p ) -{ - GLuint i, j; - - for (i = 0; i < MAX_TEXTURE_UNITS; i++) { - - if (!(p->state->fragprog_inputs_read & FRAG_BIT_TEX(i))) - continue; - - if (p->state->unit[i].texgen_enabled || - p->state->unit[i].texmat_enabled) { - - GLuint texmat_enabled = p->state->unit[i].texmat_enabled; - struct ureg out = register_output(p, VERT_RESULT_TEX0 + i); - struct ureg out_texgen = undef; - - if (p->state->unit[i].texgen_enabled) { - GLuint copy_mask = 0; - GLuint sphere_mask = 0; - GLuint reflect_mask = 0; - GLuint normal_mask = 0; - GLuint modes[4]; - - if (texmat_enabled) - out_texgen = get_temp(p); - else - out_texgen = out; - - modes[0] = p->state->unit[i].texgen_mode0; - modes[1] = p->state->unit[i].texgen_mode1; - modes[2] = p->state->unit[i].texgen_mode2; - modes[3] = p->state->unit[i].texgen_mode3; - - for (j = 0; j < 4; j++) { - switch (modes[j]) { - case TXG_OBJ_LINEAR: { - struct ureg obj = register_input(p, VERT_ATTRIB_POS); - struct ureg plane = - register_param3(p, STATE_TEXGEN, i, - STATE_TEXGEN_OBJECT_S + j); - - emit_op2(p, OPCODE_DP4, out_texgen, WRITEMASK_X << j, - obj, plane ); - break; - } - case TXG_EYE_LINEAR: { - struct ureg eye = get_eye_position(p); - struct ureg plane = - register_param3(p, STATE_TEXGEN, i, - STATE_TEXGEN_EYE_S + j); - - emit_op2(p, OPCODE_DP4, out_texgen, WRITEMASK_X << j, - eye, plane ); - break; - } - case TXG_SPHERE_MAP: - sphere_mask |= WRITEMASK_X << j; - break; - case TXG_REFLECTION_MAP: - reflect_mask |= WRITEMASK_X << j; - break; - case TXG_NORMAL_MAP: - normal_mask |= WRITEMASK_X << j; - break; - case TXG_NONE: - copy_mask |= WRITEMASK_X << j; - } - - } - - - if (sphere_mask) { - build_sphere_texgen(p, out_texgen, sphere_mask); - } - - if (reflect_mask) { - build_reflect_texgen(p, out_texgen, reflect_mask); - } - - if (normal_mask) { - struct ureg normal = get_eye_normal(p); - emit_op1(p, OPCODE_MOV, out_texgen, normal_mask, normal ); - } - - if (copy_mask) { - struct ureg in = register_input(p, VERT_ATTRIB_TEX0+i); - emit_op1(p, OPCODE_MOV, out_texgen, copy_mask, in ); - } - } - - if (texmat_enabled) { - struct ureg texmat[4]; - struct ureg in = (!is_undef(out_texgen) ? - out_texgen : - register_input(p, VERT_ATTRIB_TEX0+i)); - if (PREFER_DP4) { - register_matrix_param5( p, STATE_TEXTURE_MATRIX, i, 0, 3, - 0, texmat ); - emit_matrix_transform_vec4( p, out, texmat, in ); - } - else { - register_matrix_param5( p, STATE_TEXTURE_MATRIX, i, 0, 3, - STATE_MATRIX_TRANSPOSE, texmat ); - emit_transpose_matrix_transform_vec4( p, out, texmat, in ); - } - } - - release_temps(p); - } - else { - emit_passthrough(p, VERT_ATTRIB_TEX0+i, VERT_RESULT_TEX0+i); - } - } -} - - -static void build_pointsize( struct tnl_program *p ) -{ - struct ureg eye = get_eye_position(p); - struct ureg state_size = register_param1(p, STATE_POINT_SIZE); - struct ureg state_attenuation = register_param1(p, STATE_POINT_ATTENUATION); - struct ureg out = register_output(p, VERT_RESULT_PSIZ); - struct ureg ut = get_temp(p); - - /* dist = |eyez| */ - emit_op1(p, OPCODE_ABS, ut, WRITEMASK_Y, swizzle1(eye, Z)); - /* p1 + dist * (p2 + dist * p3); */ - emit_op3(p, OPCODE_MAD, ut, WRITEMASK_X, swizzle1(ut, Y), - swizzle1(state_attenuation, Z), swizzle1(state_attenuation, Y)); - emit_op3(p, OPCODE_MAD, ut, WRITEMASK_X, swizzle1(ut, Y), - ut, swizzle1(state_attenuation, X)); - - /* 1 / sqrt(factor) */ - emit_op1(p, OPCODE_RSQ, ut, WRITEMASK_X, ut ); - -#if 1 - /* out = pointSize / sqrt(factor) */ - emit_op2(p, OPCODE_MUL, out, WRITEMASK_X, ut, state_size); -#else - /* not sure, might make sense to do clamping here, - but it's not done in t_vb_points neither */ - emit_op2(p, OPCODE_MUL, ut, WRITEMASK_X, ut, state_size); - emit_op2(p, OPCODE_MAX, ut, WRITEMASK_X, ut, swizzle1(state_size, Y)); - emit_op2(p, OPCODE_MIN, out, WRITEMASK_X, ut, swizzle1(state_size, Z)); -#endif - - release_temp(p, ut); -} - -static void build_tnl_program( struct tnl_program *p ) -{ /* Emit the program, starting with modelviewproject: - */ - build_hpos(p); - - /* Lighting calculations: - */ - if (p->state->fragprog_inputs_read & (FRAG_BIT_COL0|FRAG_BIT_COL1)) { - if (p->state->light_global_enabled) - build_lighting(p); - else { - if (p->state->fragprog_inputs_read & FRAG_BIT_COL0) - emit_passthrough(p, VERT_ATTRIB_COLOR0, VERT_RESULT_COL0); - - if (p->state->fragprog_inputs_read & FRAG_BIT_COL1) - emit_passthrough(p, VERT_ATTRIB_COLOR1, VERT_RESULT_COL1); - } - } - - if ((p->state->fragprog_inputs_read & FRAG_BIT_FOGC) || - p->state->fog_mode != FOG_NONE) - build_fog(p); - - if (p->state->fragprog_inputs_read & FRAG_BITS_TEX_ANY) - build_texture_transform(p); - - if (p->state->point_attenuated) - build_pointsize(p); - - /* Finish up: - */ - emit_op1(p, OPCODE_END, undef, 0, undef); - - /* Disassemble: - */ - if (DISASSEM) { - _mesa_printf ("\n"); - } -} - - -static void -create_new_program( const struct state_key *key, - struct gl_vertex_program *program, - GLuint max_temps) -{ - struct tnl_program p; - - _mesa_memset(&p, 0, sizeof(p)); - p.state = key; - p.program = program; - p.eye_position = undef; - p.eye_position_normalized = undef; - p.eye_normal = undef; - p.identity = undef; - p.temp_in_use = 0; - - if (max_temps >= sizeof(int) * 8) - p.temp_reserved = 0; - else - p.temp_reserved = ~((1<<max_temps)-1); - - p.program->Base.Instructions = _mesa_alloc_instructions(MAX_INSN); - p.program->Base.String = NULL; - p.program->Base.NumInstructions = - 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; - p.program->Base.OutputsWritten = 0; - - build_tnl_program( &p ); -} - - -static struct gl_vertex_program * -search_cache(struct tnl_cache *cache, GLuint hash, - const void *key, GLuint keysize) -{ - struct tnl_cache_item *c; - - for (c = cache->items[hash % cache->size]; c; c = c->next) { - if (c->hash == hash && _mesa_memcmp(c->key, key, keysize) == 0) - return c->prog; - } - - return NULL; -} - - -static void rehash( struct tnl_cache *cache ) -{ - struct tnl_cache_item **items; - struct tnl_cache_item *c, *next; - GLuint size, i; - - size = cache->size * 3; - items = (struct tnl_cache_item**) _mesa_malloc(size * sizeof(*items)); - _mesa_memset(items, 0, size * sizeof(*items)); - - for (i = 0; i < cache->size; i++) - for (c = cache->items[i]; c; c = next) { - next = c->next; - c->next = items[c->hash % size]; - items[c->hash % size] = c; - } - - FREE(cache->items); - cache->items = items; - cache->size = size; -} - -static void cache_item( GLcontext *ctx, - struct tnl_cache *cache, - GLuint hash, - void *key, - struct gl_vertex_program *prog ) -{ - struct tnl_cache_item *c = CALLOC_STRUCT(tnl_cache_item); - c->hash = hash; - c->key = key; - - c->prog = prog; - - if (++cache->n_items > cache->size * 1.5) - rehash(cache); - - c->next = cache->items[hash % cache->size]; - cache->items[hash % cache->size] = c; -} - -static GLuint hash_key( struct state_key *key ) -{ - GLuint *ikey = (GLuint *)key; - GLuint hash = 0, i; - - /* I'm sure this can be improved on, but speed is important: - */ - for (i = 0; i < sizeof(*key)/sizeof(GLuint); i++) - hash ^= ikey[i]; - - return hash; -} - void _tnl_UpdateFixedFunctionProgram( GLcontext *ctx ) { - TNLcontext *tnl = TNL_CONTEXT(ctx); - struct state_key *key; - GLuint hash; const struct gl_vertex_program *prev = ctx->VertexProgram._Current; if (!ctx->VertexProgram._Current || ctx->VertexProgram._Current == ctx->VertexProgram._TnlProgram) { - struct gl_vertex_program *newProg; - - /* Grab all the relevent state and put it in a single structure: - */ - key = make_state_key(ctx); - hash = hash_key(key); - - /* Look for an already-prepared program for this state: - */ - newProg = search_cache( tnl->vp_cache, hash, key, sizeof(*key)); - - /* OK, we'll have to build a new one: - */ - if (!newProg) { - - if (0) - _mesa_printf("Build new TNL program\n"); - - newProg = (struct gl_vertex_program *) - ctx->Driver.NewProgram(ctx, GL_VERTEX_PROGRAM_ARB, 0); - - create_new_program( key, newProg, ctx->Const.VertexProgram.MaxTemps ); - - if (ctx->Driver.ProgramStringNotify) - ctx->Driver.ProgramStringNotify( ctx, GL_VERTEX_PROGRAM_ARB, - &newProg->Base ); - - /* Our ownership of newProg is transferred to the cache */ - cache_item(ctx, tnl->vp_cache, hash, key, newProg); - } - else { - FREE(key); - } - - _mesa_reference_vertprog(ctx, &ctx->VertexProgram._TnlProgram, newProg); - _mesa_reference_vertprog(ctx, &ctx->VertexProgram._Current, newProg); + ctx->VertexProgram._Current + = ctx->VertexProgram._TnlProgram + = _mesa_get_fixed_func_vertex_program(ctx); } /* Tell the driver about the change. Could define a new target for @@ -1589,32 +57,3 @@ void _tnl_UpdateFixedFunctionProgram( GLcontext *ctx ) (struct gl_program *) ctx->VertexProgram._Current); } } - -void _tnl_ProgramCacheInit( GLcontext *ctx ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - - tnl->vp_cache = (struct tnl_cache *) MALLOC(sizeof(*tnl->vp_cache)); - tnl->vp_cache->size = 17; - tnl->vp_cache->n_items = 0; - tnl->vp_cache->items = (struct tnl_cache_item**) - _mesa_calloc(tnl->vp_cache->size * sizeof(*tnl->vp_cache->items)); -} - -void _tnl_ProgramCacheDestroy( GLcontext *ctx ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - struct tnl_cache_item *c, *next; - GLuint i; - - for (i = 0; i < tnl->vp_cache->size; i++) - for (c = tnl->vp_cache->items[i]; c; c = next) { - next = c->next; - FREE(c->key); - _mesa_reference_vertprog(ctx, &c->prog, NULL); - FREE(c); - } - - FREE(tnl->vp_cache->items); - FREE(tnl->vp_cache); -} diff --git a/src/mesa/tnl/t_vp_build.h b/src/mesa/tnl/t_vp_build.h index 4a98fff026..d1c147ff03 100644 --- a/src/mesa/tnl/t_vp_build.h +++ b/src/mesa/tnl/t_vp_build.h @@ -17,20 +17,19 @@ * 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 - * TUNGSTEN GRAPHICS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * TUNGSTEN GRAPHICS 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 _T_ARB_BUILD_H -#define _T_ARB_BUILD_H +#ifndef T_VP_BUILD_H +#define T_VP_BUILD_H -#include "mtypes.h" +#include "main/mtypes.h" -extern void _tnl_UpdateFixedFunctionProgram( GLcontext *ctx ); -extern void _tnl_ProgramCacheInit( GLcontext *ctx ); -extern void _tnl_ProgramCacheDestroy( GLcontext *ctx ); +extern void _tnl_UpdateFixedFunctionProgram( GLcontext *ctx ); #endif diff --git a/src/mesa/tnl/tnl.h b/src/mesa/tnl/tnl.h index c2b1f71caa..9a1717bf89 100644 --- a/src/mesa/tnl/tnl.h +++ b/src/mesa/tnl/tnl.h @@ -81,4 +81,8 @@ _tnl_draw_prims( GLcontext *ctx, GLuint min_index, GLuint max_index); + +extern void +_tnl_RasterPos(GLcontext *ctx, const GLfloat vObj[4]); + #endif diff --git a/src/mesa/vbo/vbo.h b/src/mesa/vbo/vbo.h index 04c59c05b2..4c51b44cda 100644 --- a/src/mesa/vbo/vbo.h +++ b/src/mesa/vbo/vbo.h @@ -114,4 +114,7 @@ void vbo_rebase_prims( GLcontext *ctx, vbo_draw_func draw ); +void vbo_use_buffer_objects(GLcontext *ctx); + + #endif diff --git a/src/mesa/vbo/vbo_context.c b/src/mesa/vbo/vbo_context.c index 3813254350..a73a46b9c8 100644 --- a/src/mesa/vbo/vbo_context.c +++ b/src/mesa/vbo/vbo_context.c @@ -219,9 +219,10 @@ GLboolean _vbo_CreateContext( GLcontext *ctx ) * vtxfmt mechanism can be removed now. */ vbo_exec_init( ctx ); +#if FEATURE_dlist vbo_save_init( ctx ); +#endif - return GL_TRUE; } @@ -240,7 +241,9 @@ void _vbo_DestroyContext( GLcontext *ctx ) } vbo_exec_destroy(ctx); +#if FEATURE_dlist vbo_save_destroy(ctx); +#endif FREE(vbo_context(ctx)); ctx->swtnl_im = NULL; } diff --git a/src/mesa/vbo/vbo_context.h b/src/mesa/vbo/vbo_context.h index 013f81bdd5..bf405eb693 100644 --- a/src/mesa/vbo/vbo_context.h +++ b/src/mesa/vbo/vbo_context.h @@ -53,8 +53,10 @@ #include "vbo.h" #include "vbo_attrib.h" -#include "vbo_save.h" #include "vbo_exec.h" +#if FEATURE_dlist +#include "vbo_save.h" +#endif struct vbo_context { @@ -74,7 +76,9 @@ struct vbo_context { struct vbo_exec_context exec; +#if FEATURE_dlist struct vbo_save_context save; +#endif /* Callback into the driver. This must always succeed, the driver * is responsible for initiating any fallback actions required: diff --git a/src/mesa/vbo/vbo_exec.c b/src/mesa/vbo/vbo_exec.c index 1efa74945d..635f239acc 100644 --- a/src/mesa/vbo/vbo_exec.c +++ b/src/mesa/vbo/vbo_exec.c @@ -32,7 +32,6 @@ #include "main/context.h" #include "main/macros.h" #include "main/mtypes.h" -#include "main/dlist.h" #include "main/vtxfmt.h" #include "vbo_context.h" diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c index d07d5ba80a..d48f5230cb 100644 --- a/src/mesa/vbo/vbo_exec_api.c +++ b/src/mesa/vbo/vbo_exec_api.c @@ -1,6 +1,6 @@ /************************************************************************** -Copyright 2002 Tungsten Graphics Inc., Cedar Park, Texas. +Copyright 2002-2008 Tungsten Graphics Inc., Cedar Park, Texas. All Rights Reserved. @@ -31,10 +31,13 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "main/glheader.h" +#include "main/bufferobj.h" #include "main/context.h" #include "main/macros.h" #include "main/vtxfmt.h" +#if FEATURE_dlist #include "main/dlist.h" +#endif #include "main/state.h" #include "main/light.h" #include "main/api_arrayelt.h" @@ -65,7 +68,7 @@ static void vbo_exec_wrap_buffers( struct vbo_exec_context *exec ) GLuint last_begin = exec->vtx.prim[exec->vtx.prim_count-1].begin; GLuint last_count; - if (exec->ctx->Driver.CurrentExecPrimitive != GL_POLYGON+1) { + if (exec->ctx->Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END) { GLint i = exec->vtx.prim_count - 1; assert(i >= 0); exec->vtx.prim[i].count = (exec->vtx.vert_count - @@ -87,7 +90,7 @@ static void vbo_exec_wrap_buffers( struct vbo_exec_context *exec ) */ assert(exec->vtx.prim_count == 0); - if (exec->ctx->Driver.CurrentExecPrimitive != GL_POLYGON+1) { + if (exec->ctx->Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END) { exec->vtx.prim[0].mode = exec->ctx->Driver.CurrentExecPrimitive; exec->vtx.prim[0].start = 0; exec->vtx.prim[0].count = 0; @@ -501,7 +504,7 @@ static void GLAPIENTRY vbo_exec_Begin( GLenum mode ) { GET_CURRENT_CONTEXT( ctx ); - if (ctx->Driver.CurrentExecPrimitive == GL_POLYGON+1) { + if (ctx->Driver.CurrentExecPrimitive == PRIM_OUTSIDE_BEGIN_END) { struct vbo_exec_context *exec = &vbo_context(ctx)->exec; int i; @@ -545,7 +548,7 @@ static void GLAPIENTRY vbo_exec_End( void ) { GET_CURRENT_CONTEXT( ctx ); - if (ctx->Driver.CurrentExecPrimitive != GL_POLYGON+1) { + if (ctx->Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END) { struct vbo_exec_context *exec = &vbo_context(ctx)->exec; int idx = exec->vtx.vert_count; int i = exec->vtx.prim_count - 1; @@ -553,7 +556,7 @@ static void GLAPIENTRY vbo_exec_End( void ) exec->vtx.prim[i].end = 1; exec->vtx.prim[i].count = idx - exec->vtx.prim[i].start; - ctx->Driver.CurrentExecPrimitive = GL_POLYGON+1; + ctx->Driver.CurrentExecPrimitive = PRIM_OUTSIDE_BEGIN_END; if (exec->vtx.prim_count == VBO_MAX_PRIM) vbo_exec_vtx_flush( exec ); @@ -569,8 +572,10 @@ static void vbo_exec_vtxfmt_init( struct vbo_exec_context *exec ) vfmt->ArrayElement = _ae_loopback_array_elt; /* generic helper */ vfmt->Begin = vbo_exec_Begin; +#if FEATURE_dlist vfmt->CallList = _mesa_CallList; vfmt->CallLists = _mesa_CallLists; +#endif vfmt->End = vbo_exec_End; vfmt->EvalCoord1f = vbo_exec_EvalCoord1f; vfmt->EvalCoord1fv = vbo_exec_EvalCoord1fv; @@ -646,6 +651,41 @@ static void vbo_exec_vtxfmt_init( struct vbo_exec_context *exec ) } +/** + * Tell the VBO module to use a real OpenGL vertex buffer object to + * store accumulated immediate-mode vertex data. + * This replaces the malloced buffer which was created in + * vb_exec_vtx_init() below. + */ +void vbo_use_buffer_objects(GLcontext *ctx) +{ + struct vbo_exec_context *exec = &vbo_context(ctx)->exec; + /* Any buffer name but 0 can be used here since this bufferobj won't + * go into the bufferobj hashtable. + */ + GLuint bufName = 0xaabbccdd; + GLenum target = GL_ARRAY_BUFFER_ARB; + GLenum access = GL_READ_WRITE_ARB; + GLenum usage = GL_STREAM_DRAW_ARB; + GLsizei size = VBO_VERT_BUFFER_SIZE * sizeof(GLfloat); + + /* Make sure this func is only used once */ + assert(exec->vtx.bufferobj == ctx->Array.NullBufferObj); + if (exec->vtx.buffer_map) { + _mesa_align_free(exec->vtx.buffer_map); + } + + /* Allocate a real buffer object now */ + exec->vtx.bufferobj = ctx->Driver.NewBufferObject(ctx, bufName, target); + ctx->Driver.BufferData(ctx, target, size, NULL, usage, exec->vtx.bufferobj); + + /* and map it */ + exec->vtx.buffer_map + = ctx->Driver.MapBuffer(ctx, target, access, exec->vtx.bufferobj); +} + + + void vbo_exec_vtx_init( struct vbo_exec_context *exec ) { GLcontext *ctx = exec->ctx; @@ -655,9 +695,12 @@ void vbo_exec_vtx_init( struct vbo_exec_context *exec ) /* Allocate a buffer object. Will just reuse this object * continuously. */ - exec->vtx.bufferobj = ctx->Array.NullBufferObj; - exec->vtx.buffer_map = ALIGN_MALLOC(VBO_VERT_BUFFER_SIZE * sizeof(GLfloat), 64); + _mesa_reference_buffer_object(ctx, + &exec->vtx.bufferobj, + ctx->Array.NullBufferObj); + ASSERT(!exec->vtx.buffer_map); + exec->vtx.buffer_map = ALIGN_MALLOC(VBO_VERT_BUFFER_SIZE * sizeof(GLfloat), 64); vbo_exec_vtxfmt_init( exec ); /* Hook our functions into the dispatch table. @@ -682,9 +725,17 @@ void vbo_exec_vtx_init( struct vbo_exec_context *exec ) void vbo_exec_vtx_destroy( struct vbo_exec_context *exec ) { - if (exec->vtx.buffer_map) { - ALIGN_FREE(exec->vtx.buffer_map); - exec->vtx.buffer_map = NULL; + if (exec->vtx.bufferobj->Name) { + /* using a real VBO for vertex data */ + GLcontext *ctx = exec->ctx; + _mesa_reference_buffer_object(ctx, &exec->vtx.bufferobj, NULL); + } + else { + /* just using malloc'd space for vertex data */ + if (exec->vtx.buffer_map) { + ALIGN_FREE(exec->vtx.buffer_map); + exec->vtx.buffer_map = NULL; + } } } diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c index 1a782da1ea..82f4db17d1 100644 --- a/src/mesa/vbo/vbo_exec_array.c +++ b/src/mesa/vbo/vbo_exec_array.c @@ -40,14 +40,14 @@ static void get_minmax_index( GLuint count, GLuint type, GLuint *min_index, GLuint *max_index) { - GLint i; + GLuint i; switch(type) { case GL_UNSIGNED_INT: { const GLuint *ui_indices = (const GLuint *)indices; - GLuint max_ui = ui_indices[0]; + GLuint max_ui = ui_indices[count-1]; GLuint min_ui = ui_indices[0]; - for (i = 1; i < count; i++) { + for (i = 0; i < count; i++) { if (ui_indices[i] > max_ui) max_ui = ui_indices[i]; if (ui_indices[i] < min_ui) min_ui = ui_indices[i]; } @@ -57,9 +57,9 @@ static void get_minmax_index( GLuint count, GLuint type, } case GL_UNSIGNED_SHORT: { const GLushort *us_indices = (const GLushort *)indices; - GLuint max_us = us_indices[0]; + GLuint max_us = us_indices[count-1]; GLuint min_us = us_indices[0]; - for (i = 1; i < count; i++) { + for (i = 0; i < count; i++) { if (us_indices[i] > max_us) max_us = us_indices[i]; if (us_indices[i] < min_us) min_us = us_indices[i]; } @@ -69,9 +69,9 @@ static void get_minmax_index( GLuint count, GLuint type, } case GL_UNSIGNED_BYTE: { const GLubyte *ub_indices = (const GLubyte *)indices; - GLuint max_ub = ub_indices[0]; + GLuint max_ub = ub_indices[count-1]; GLuint min_ub = ub_indices[0]; - for (i = 1; i < count; i++) { + for (i = 0; i < count; i++) { if (ub_indices[i] > max_ub) max_ub = ub_indices[i]; if (ub_indices[i] < min_ub) min_ub = ub_indices[i]; } @@ -105,6 +105,10 @@ static void bind_array_obj( GLcontext *ctx ) exec->array.legacy_array[VERT_ATTRIB_COLOR1] = &ctx->Array.ArrayObj->SecondaryColor; exec->array.legacy_array[VERT_ATTRIB_FOG] = &ctx->Array.ArrayObj->FogCoord; exec->array.legacy_array[VERT_ATTRIB_COLOR_INDEX] = &ctx->Array.ArrayObj->Index; + if (ctx->Array.ArrayObj->PointSize.Enabled) { + /* this aliases COLOR_INDEX */ + exec->array.legacy_array[VERT_ATTRIB_POINT_SIZE] = &ctx->Array.ArrayObj->PointSize; + } exec->array.legacy_array[VERT_ATTRIB_EDGEFLAG] = &ctx->Array.ArrayObj->EdgeFlag; for (i = 0; i < 8; i++) diff --git a/src/mesa/vbo/vbo_exec_draw.c b/src/mesa/vbo/vbo_exec_draw.c index 68ce7ba837..92356ba977 100644 --- a/src/mesa/vbo/vbo_exec_draw.c +++ b/src/mesa/vbo/vbo_exec_draw.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 5.1 + * Version: 7.2 * - * Copyright (C) 1999-2003 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2008 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"), @@ -26,6 +26,7 @@ */ #include "main/glheader.h" +#include "main/bufferobj.h" #include "main/context.h" #include "main/enums.h" #include "main/state.h" @@ -128,7 +129,7 @@ static GLuint vbo_copy_vertices( struct vbo_exec_context *exec ) for (i = 0 ; i < ovf ; i++) _mesa_memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz * sizeof(GLfloat) ); return i; - case GL_POLYGON+1: + case PRIM_OUTSIDE_BEGIN_END: return 0; default: assert(0); @@ -155,8 +156,12 @@ static void vbo_exec_bind_arrays( GLcontext *ctx ) */ switch (get_program_mode(exec->ctx)) { case VP_NONE: - memcpy(arrays, vbo->legacy_currval, 16 * sizeof(arrays[0])); - memcpy(arrays + 16, vbo->mat_currval, MAT_ATTRIB_MAX * sizeof(arrays[0])); + for (attr = 0; attr < 16; attr++) { + exec->vtx.inputs[attr] = &vbo->legacy_currval[attr]; + } + for (attr = 0; attr < MAT_ATTRIB_MAX; attr++) { + exec->vtx.inputs[attr + 16] = &vbo->mat_currval[attr]; + } map = vbo->map_vp_none; break; case VP_NV: @@ -165,8 +170,10 @@ static void vbo_exec_bind_arrays( GLcontext *ctx ) * occurred. NV vertex programs cannot access material values, * nor attributes greater than VERT_ATTRIB_TEX7. */ - memcpy(arrays, vbo->legacy_currval, 16 * sizeof(arrays[0])); - memcpy(arrays + 16, vbo->generic_currval, 16 * sizeof(arrays[0])); + for (attr = 0; attr < 16; attr++) { + exec->vtx.inputs[attr] = &vbo->legacy_currval[attr]; + exec->vtx.inputs[attr + 16] = &vbo->generic_currval[attr]; + } map = vbo->map_vp_arb; break; } @@ -175,16 +182,32 @@ static void vbo_exec_bind_arrays( GLcontext *ctx ) * arrays of floats. */ for (attr = 0; attr < VERT_ATTRIB_MAX ; attr++) { - GLuint src = map[attr]; + const GLuint src = map[attr]; if (exec->vtx.attrsz[src]) { - arrays[attr].Ptr = (void *)data; + /* override the default array set above */ + exec->vtx.inputs[attr] = &arrays[attr]; + + if (exec->vtx.bufferobj->Name) { + /* a real buffer obj: Ptr is an offset, not a pointer*/ + int offset; + assert(exec->vtx.bufferobj->Pointer); /* buf should be mapped */ + offset = (GLbyte *) data - (GLbyte *) exec->vtx.bufferobj->Pointer; + assert(offset >= 0); + arrays[attr].Ptr = (void *) offset; + } + else { + /* Ptr into ordinary app memory */ + arrays[attr].Ptr = (void *) data; + } arrays[attr].Size = exec->vtx.attrsz[src]; arrays[attr].StrideB = exec->vtx.vertex_size * sizeof(GLfloat); arrays[attr].Stride = exec->vtx.vertex_size * sizeof(GLfloat); arrays[attr].Type = GL_FLOAT; arrays[attr].Enabled = 1; - arrays[attr].BufferObj = exec->vtx.bufferobj; /* NullBufferObj */ + _mesa_reference_buffer_object(ctx, + &arrays[attr].BufferObj, + exec->vtx.bufferobj); arrays[attr]._MaxElement = count; /* ??? */ data += exec->vtx.attrsz[src] * sizeof(GLfloat); @@ -210,8 +233,21 @@ void vbo_exec_vtx_flush( struct vbo_exec_context *exec ) if (exec->vtx.copied.nr != exec->vtx.vert_count) { GLcontext *ctx = exec->ctx; + GLenum target = GL_ARRAY_BUFFER_ARB; + GLenum access = GL_READ_WRITE_ARB; + GLenum usage = GL_STREAM_DRAW_ARB; + GLsizei size = VBO_VERT_BUFFER_SIZE * sizeof(GLfloat); + + /* Before the unmap (why?) + */ vbo_exec_bind_arrays( ctx ); + /* if using a real VBO, unmap it before drawing */ + if (exec->vtx.bufferobj->Name) { + ctx->Driver.UnmapBuffer(ctx, target, exec->vtx.bufferobj); + exec->vtx.buffer_map = NULL; + } + vbo_context(ctx)->draw_prims( ctx, exec->vtx.inputs, exec->vtx.prim, @@ -219,6 +255,13 @@ void vbo_exec_vtx_flush( struct vbo_exec_context *exec ) NULL, 0, exec->vtx.vert_count - 1); + + /* If using a real VBO, get new storage */ + if (exec->vtx.bufferobj->Name) { + ctx->Driver.BufferData(ctx, target, size, NULL, usage, exec->vtx.bufferobj); + exec->vtx.buffer_map = + ctx->Driver.MapBuffer(ctx, target, access, exec->vtx.bufferobj); + } } } diff --git a/src/mesa/vbo/vbo_exec_eval.c b/src/mesa/vbo/vbo_exec_eval.c index 0ba5585d24..0c691b3a5c 100644 --- a/src/mesa/vbo/vbo_exec_eval.c +++ b/src/mesa/vbo/vbo_exec_eval.c @@ -26,7 +26,6 @@ */ #include "main/glheader.h" -#include "main/api_eval.h" #include "main/context.h" #include "main/macros.h" #include "math/m_eval.h" diff --git a/src/mesa/vbo/vbo_save.c b/src/mesa/vbo/vbo_save.c index 8dd87141c0..9757c3d9f6 100644 --- a/src/mesa/vbo/vbo_save.c +++ b/src/mesa/vbo/vbo_save.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.3 + * Version: 7.2 * - * Copyright (C) 1999-2005 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2008 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"), @@ -27,6 +27,7 @@ #include "main/mtypes.h" +#include "main/bufferobj.h" #include "main/dlist.h" #include "main/vtxfmt.h" #include "main/imports.h" @@ -71,19 +72,24 @@ void vbo_save_destroy( GLcontext *ctx ) { struct vbo_context *vbo = vbo_context(ctx); struct vbo_save_context *save = &vbo->save; + GLuint i; + if (save->prim_store) { if ( --save->prim_store->refcount == 0 ) { FREE( save->prim_store ); save->prim_store = NULL; } if ( --save->vertex_store->refcount == 0 ) { - if (save->vertex_store->bufferobj) - ctx->Driver.DeleteBuffer( ctx, save->vertex_store->bufferobj ); - + _mesa_reference_buffer_object(ctx, + &save->vertex_store->bufferobj, NULL); FREE( save->vertex_store ); save->vertex_store = NULL; } } + + for (i = 0; i < VBO_ATTRIB_MAX; i++) { + _mesa_reference_buffer_object(ctx, &save->arrays[i].BufferObj, NULL); + } } diff --git a/src/mesa/vbo/vbo_save_api.c b/src/mesa/vbo/vbo_save_api.c index f62be5c14c..f69a33d817 100644 --- a/src/mesa/vbo/vbo_save_api.c +++ b/src/mesa/vbo/vbo_save_api.c @@ -1,6 +1,6 @@ /************************************************************************** -Copyright 2002 Tungsten Graphics Inc., Cedar Park, Texas. +Copyright 2002-2008 Tungsten Graphics Inc., Cedar Park, Texas. All Rights Reserved. @@ -68,6 +68,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "main/glheader.h" +#include "main/bufferobj.h" #include "main/context.h" #include "main/dlist.h" #include "main/enums.h" @@ -85,6 +86,10 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #endif +/* An interesting VBO number/name to help with debugging */ +#define VBO_BUF_ID 12345 + + /* * NOTE: Old 'parity' issue is gone, but copying can still be * wrong-footed on replay. @@ -170,7 +175,9 @@ static struct vbo_save_vertex_store *alloc_vertex_store( GLcontext *ctx ) * user. Perhaps there could be a special number for internal * buffers: */ - vertex_store->bufferobj = ctx->Driver.NewBufferObject(ctx, 1, GL_ARRAY_BUFFER_ARB); + vertex_store->bufferobj = ctx->Driver.NewBufferObject(ctx, + VBO_BUF_ID, + GL_ARRAY_BUFFER_ARB); ctx->Driver.BufferData( ctx, GL_ARRAY_BUFFER_ARB, @@ -190,8 +197,9 @@ static void free_vertex_store( GLcontext *ctx, struct vbo_save_vertex_store *ver { assert(!vertex_store->buffer); - if (vertex_store->bufferobj) - ctx->Driver.DeleteBuffer( ctx, vertex_store->bufferobj ); + if (vertex_store->bufferobj) { + _mesa_reference_buffer_object(ctx, &vertex_store->bufferobj, NULL); + } FREE( vertex_store ); } @@ -1037,6 +1045,32 @@ void vbo_save_NewList( GLcontext *ctx, GLuint list, GLenum mode ) void vbo_save_EndList( GLcontext *ctx ) { struct vbo_save_context *save = &vbo_context(ctx)->save; + + /* EndList called inside a (saved) Begin/End pair? + */ + if (ctx->Driver.CurrentSavePrimitive != PRIM_OUTSIDE_BEGIN_END) { + + if (save->prim_count > 0) { + GLint i = save->prim_count - 1; + ctx->Driver.CurrentSavePrimitive = PRIM_OUTSIDE_BEGIN_END; + save->prim[i].end = 0; + save->prim[i].count = (save->vert_count - + save->prim[i].start); + } + + /* Make sure this vertex list gets replayed by the "loopback" + * mechanism: + */ + save->dangling_attr_ref = 1; + vbo_save_SaveFlushVertices( ctx ); + + /* Swap out this vertex format while outside begin/end. Any color, + * etc. received between here and the next begin will be compiled + * as opcodes. + */ + _mesa_install_save_vtxfmt( ctx, &ctx->ListState.ListVtxfmt ); + } + unmap_vertex_store( ctx, save->vertex_store ); assert(save->vertex_size == 0); @@ -1139,6 +1173,7 @@ void vbo_save_api_init( struct vbo_save_context *save ) _save_vtxfmt_init( ctx ); _save_current_init( ctx ); + /* These will actually get set again when binding/drawing */ for (i = 0; i < VBO_ATTRIB_MAX; i++) save->inputs[i] = &save->arrays[i]; diff --git a/src/mesa/vbo/vbo_save_draw.c b/src/mesa/vbo/vbo_save_draw.c index bf5c6d4eef..ed82f09958 100644 --- a/src/mesa/vbo/vbo_save_draw.c +++ b/src/mesa/vbo/vbo_save_draw.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.1 + * Version: 7.2 * - * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2008 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"), @@ -27,6 +27,7 @@ */ #include "main/glheader.h" +#include "main/bufferobj.h" #include "main/context.h" #include "main/imports.h" #include "main/mtypes.h" @@ -115,8 +116,12 @@ static void vbo_bind_vertex_list( GLcontext *ctx, */ switch (get_program_mode(ctx)) { case VP_NONE: - memcpy(arrays, vbo->legacy_currval, 16 * sizeof(arrays[0])); - memcpy(arrays + 16, vbo->mat_currval, MAT_ATTRIB_MAX * sizeof(arrays[0])); + for (attr = 0; attr < 16; attr++) { + save->inputs[attr] = &vbo->legacy_currval[attr]; + } + for (attr = 0; attr < MAT_ATTRIB_MAX; attr++) { + save->inputs[attr + 16] = &vbo->mat_currval[attr]; + } map = vbo->map_vp_none; break; case VP_NV: @@ -125,8 +130,10 @@ static void vbo_bind_vertex_list( GLcontext *ctx, * occurred. NV vertex programs cannot access material values, * nor attributes greater than VERT_ATTRIB_TEX7. */ - memcpy(arrays, vbo->legacy_currval, 16 * sizeof(arrays[0])); - memcpy(arrays + 16, vbo->generic_currval, 16 * sizeof(arrays[0])); + for (attr = 0; attr < 16; attr++) { + save->inputs[attr] = &vbo->legacy_currval[attr]; + save->inputs[attr + 16] = &vbo->generic_currval[attr]; + } map = vbo->map_vp_arb; break; } @@ -135,13 +142,18 @@ static void vbo_bind_vertex_list( GLcontext *ctx, GLuint src = map[attr]; if (node->attrsz[src]) { - arrays[attr].Ptr = (const GLubyte *)data; + /* override the default array set above */ + save->inputs[attr] = &arrays[attr]; + + arrays[attr].Ptr = (const GLubyte *) data; arrays[attr].Size = node->attrsz[src]; arrays[attr].StrideB = node->vertex_size * sizeof(GLfloat); arrays[attr].Stride = node->vertex_size * sizeof(GLfloat); arrays[attr].Type = GL_FLOAT; arrays[attr].Enabled = 1; - arrays[attr].BufferObj = node->vertex_store->bufferobj; + _mesa_reference_buffer_object(ctx, + &arrays[attr].BufferObj, + node->vertex_store->bufferobj); arrays[attr]._MaxElement = node->count; /* ??? */ assert(arrays[attr].BufferObj->Name); diff --git a/src/mesa/vbo/vbo_split_inplace.c b/src/mesa/vbo/vbo_split_inplace.c index 958afccd0c..fbc856e93b 100644 --- a/src/mesa/vbo/vbo_split_inplace.c +++ b/src/mesa/vbo/vbo_split_inplace.c @@ -58,7 +58,7 @@ struct split_context { static void flush_vertex( struct split_context *split ) { - GLint min_index, max_index; + GLuint min_index, max_index; if (!split->dstprim_nr) return; diff --git a/src/mesa/x86-64/Makefile b/src/mesa/x86-64/Makefile index c6b69bafe8..9c3e9d2adf 100644 --- a/src/mesa/x86-64/Makefile +++ b/src/mesa/x86-64/Makefile @@ -24,6 +24,6 @@ clean: # need some special rules here, unfortunately matypes.h: ../main/mtypes.h ../tnl/t_context.h ../x86/gen_matypes - ../x86/gen_matypes | grep -v '#include "assyntax.h' > matypes.h + ../x86/gen_matypes > matypes.h xform4.o: matypes.h diff --git a/src/mesa/x86-64/x86-64.c b/src/mesa/x86-64/x86-64.c index 09508b66d5..9ec43c841d 100644 --- a/src/mesa/x86-64/x86-64.c +++ b/src/mesa/x86-64/x86-64.c @@ -1,4 +1,3 @@ -/* $Id: x86-64.c,v 1.4 2006/10/17 17:03:21 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -31,8 +30,8 @@ #ifdef USE_X86_64_ASM -#include "glheader.h" -#include "context.h" +#include "main/glheader.h" +#include "main/context.h" #include "math/m_xform.h" #include "tnl/t_context.h" #include "x86-64.h" diff --git a/src/mesa/x86-64/x86-64.h b/src/mesa/x86-64/x86-64.h index fdbd154d5d..1d931fa345 100644 --- a/src/mesa/x86-64/x86-64.h +++ b/src/mesa/x86-64/x86-64.h @@ -1,4 +1,3 @@ -/* $Id: x86-64.h,v 1.1 2005/05/07 16:59:59 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/x86/3dnow.c b/src/mesa/x86/3dnow.c index 032aa661f4..c037a61761 100644 --- a/src/mesa/x86/3dnow.c +++ b/src/mesa/x86/3dnow.c @@ -1,4 +1,3 @@ -/* $Id: 3dnow.c,v 1.24 2005/10/07 17:18:52 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -29,8 +28,8 @@ * Holger Waechtler <holger@akaflieg.extern.tu-berlin.de> */ -#include "glheader.h" -#include "context.h" +#include "main/glheader.h" +#include "main/context.h" #include "math/m_xform.h" #include "tnl/t_context.h" diff --git a/src/mesa/x86/3dnow.h b/src/mesa/x86/3dnow.h index 1f2fd8e8b4..df9f2638d7 100644 --- a/src/mesa/x86/3dnow.h +++ b/src/mesa/x86/3dnow.h @@ -1,4 +1,3 @@ -/* $Id: 3dnow.h,v 1.6 2002/04/09 14:58:03 keithw Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/x86/3dnow_normal.S b/src/mesa/x86/3dnow_normal.S index f3bbcb27b7..7f5f6b357f 100644 --- a/src/mesa/x86/3dnow_normal.S +++ b/src/mesa/x86/3dnow_normal.S @@ -1,4 +1,3 @@ -/* $Id: 3dnow_normal.S,v 1.10 2006/04/17 18:58:24 krh Exp $ */ /* * Mesa 3-D graphics library @@ -30,6 +29,7 @@ #ifdef USE_3DNOW_ASM +#include "assyntax.h" #include "matypes.h" #include "norm_args.h" diff --git a/src/mesa/x86/3dnow_xform1.S b/src/mesa/x86/3dnow_xform1.S index 22b12cca06..a73301a8d6 100644 --- a/src/mesa/x86/3dnow_xform1.S +++ b/src/mesa/x86/3dnow_xform1.S @@ -1,4 +1,3 @@ -/* $Id: 3dnow_xform1.S,v 1.4 2006/04/17 18:58:24 krh Exp $ */ /* * Mesa 3-D graphics library @@ -25,6 +24,7 @@ */ #ifdef USE_3DNOW_ASM +#include "assyntax.h" #include "matypes.h" #include "xform_args.h" diff --git a/src/mesa/x86/3dnow_xform2.S b/src/mesa/x86/3dnow_xform2.S index d9e96d04e2..2988fb7bfd 100644 --- a/src/mesa/x86/3dnow_xform2.S +++ b/src/mesa/x86/3dnow_xform2.S @@ -1,4 +1,3 @@ -/* $Id: 3dnow_xform2.S,v 1.4 2006/04/17 18:58:24 krh Exp $ */ /* * Mesa 3-D graphics library @@ -25,6 +24,7 @@ */ #ifdef USE_3DNOW_ASM +#include "assyntax.h" #include "matypes.h" #include "xform_args.h" diff --git a/src/mesa/x86/3dnow_xform3.S b/src/mesa/x86/3dnow_xform3.S index babee1caa0..a356aaee76 100644 --- a/src/mesa/x86/3dnow_xform3.S +++ b/src/mesa/x86/3dnow_xform3.S @@ -1,4 +1,3 @@ -/* $Id: 3dnow_xform3.S,v 1.5 2006/04/17 18:58:24 krh Exp $ */ /* * Mesa 3-D graphics library @@ -25,6 +24,7 @@ */ #ifdef USE_3DNOW_ASM +#include "assyntax.h" #include "matypes.h" #include "xform_args.h" diff --git a/src/mesa/x86/3dnow_xform4.S b/src/mesa/x86/3dnow_xform4.S index b16d2b12dd..b2b7c64f23 100644 --- a/src/mesa/x86/3dnow_xform4.S +++ b/src/mesa/x86/3dnow_xform4.S @@ -1,4 +1,3 @@ -/* $Id: 3dnow_xform4.S,v 1.5 2006/04/17 18:58:24 krh Exp $ */ /* * Mesa 3-D graphics library @@ -25,6 +24,7 @@ */ #ifdef USE_3DNOW_ASM +#include "assyntax.h" #include "matypes.h" #include "xform_args.h" diff --git a/src/mesa/x86/clip_args.h b/src/mesa/x86/clip_args.h index cccf801981..796611fbfd 100644 --- a/src/mesa/x86/clip_args.h +++ b/src/mesa/x86/clip_args.h @@ -1,4 +1,3 @@ -/* $Id: clip_args.h,v 1.5 2002/10/29 20:28:57 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/x86/common_x86.c b/src/mesa/x86/common_x86.c index 0caa36a5a0..5321547935 100644 --- a/src/mesa/x86/common_x86.c +++ b/src/mesa/x86/common_x86.c @@ -48,8 +48,8 @@ #include <machine/cpu.h> #endif +#include "main/imports.h" #include "common_x86_asm.h" -#include "imports.h" int _mesa_x86_cpu_features = 0; diff --git a/src/mesa/x86/common_x86_asm.S b/src/mesa/x86/common_x86_asm.S index ef3cc9eb59..ea4047a0e1 100644 --- a/src/mesa/x86/common_x86_asm.S +++ b/src/mesa/x86/common_x86_asm.S @@ -40,6 +40,7 @@ */ #include "matypes.h" +#include "assyntax.h" #include "common_x86_features.h" SEG_TEXT diff --git a/src/mesa/x86/common_x86_asm.h b/src/mesa/x86/common_x86_asm.h index 9977298328..89312b2437 100644 --- a/src/mesa/x86/common_x86_asm.h +++ b/src/mesa/x86/common_x86_asm.h @@ -1,4 +1,3 @@ -/* $Id: common_x86_asm.h,v 1.12 2005/07/16 00:56:20 ajax Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/x86/common_x86_features.h b/src/mesa/x86/common_x86_features.h index 90509775cf..676af8c1f8 100644 --- a/src/mesa/x86/common_x86_features.h +++ b/src/mesa/x86/common_x86_features.h @@ -1,4 +1,3 @@ -/* $Id: common_x86_features.h,v 1.6 2003/01/21 16:14:00 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/x86/common_x86_macros.h b/src/mesa/x86/common_x86_macros.h index ba155caae1..462f32b3f2 100644 --- a/src/mesa/x86/common_x86_macros.h +++ b/src/mesa/x86/common_x86_macros.h @@ -1,4 +1,3 @@ -/* $Id: common_x86_macros.h,v 1.3 2002/10/29 20:28:58 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/x86/gen_matypes.c b/src/mesa/x86/gen_matypes.c index e95f3d4f3d..afb4b11529 100644 --- a/src/mesa/x86/gen_matypes.c +++ b/src/mesa/x86/gen_matypes.c @@ -92,7 +92,6 @@ int main( int argc, char **argv ) printf( "#ifndef __ASM_TYPES_H__\n" ); printf( "#define __ASM_TYPES_H__\n" ); printf( "\n" ); - printf( "#include \"assyntax.h\"\n" ); /* GLcontext offsets: diff --git a/src/mesa/x86/glapi_x86.S b/src/mesa/x86/glapi_x86.S index 9a5d875e21..b99c2b6520 100644 --- a/src/mesa/x86/glapi_x86.S +++ b/src/mesa/x86/glapi_x86.S @@ -27,7 +27,7 @@ */ #include "assyntax.h" -#include "glapioffsets.h" +#include "glapi/glapioffsets.h" #if defined(STDCALL_API) # if defined(USE_MGL_NAMESPACE) diff --git a/src/mesa/x86/mmx_blend.S b/src/mesa/x86/mmx_blend.S index 20ac5a20ad..eeaf43ea93 100644 --- a/src/mesa/x86/mmx_blend.S +++ b/src/mesa/x86/mmx_blend.S @@ -1,10 +1,11 @@ ; /* - * Written by José Fonseca <j_r_fonseca@yahoo.co.uk> + * Written by Jos� Fonseca <j_r_fonseca@yahoo.co.uk> */ #ifdef USE_MMX_ASM +#include "assyntax.h" #include "matypes.h" /* integer multiplication - alpha plus one diff --git a/src/mesa/x86/norm_args.h b/src/mesa/x86/norm_args.h index 1b43d57a20..5d352838be 100644 --- a/src/mesa/x86/norm_args.h +++ b/src/mesa/x86/norm_args.h @@ -1,4 +1,3 @@ -/* $Id: norm_args.h,v 1.4 2003/11/26 08:32:36 dborca Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/x86/rtasm/x86sse.c b/src/mesa/x86/rtasm/x86sse.c index 772471c723..e68f8dfec1 100644 --- a/src/mesa/x86/rtasm/x86sse.c +++ b/src/mesa/x86/rtasm/x86sse.c @@ -1,6 +1,6 @@ #if defined(__i386__) || defined(__386__) -#include "imports.h" +#include "main/imports.h" #include "x86sse.h" #define DISASSEM 0 diff --git a/src/mesa/x86/sse.c b/src/mesa/x86/sse.c index 4b016a1e85..1c185387c6 100644 --- a/src/mesa/x86/sse.c +++ b/src/mesa/x86/sse.c @@ -27,8 +27,8 @@ * Andre Werthmann <wertmann@cs.uni-potsdam.de> */ -#include "glheader.h" -#include "context.h" +#include "main/glheader.h" +#include "main/context.h" #include "math/m_xform.h" #include "tnl/t_context.h" diff --git a/src/mesa/x86/sse.h b/src/mesa/x86/sse.h index 98146a9047..521f91e411 100644 --- a/src/mesa/x86/sse.h +++ b/src/mesa/x86/sse.h @@ -1,4 +1,3 @@ -/* $Id: sse.h,v 1.2 2002/04/09 14:58:03 keithw Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/x86/sse_normal.S b/src/mesa/x86/sse_normal.S index 066d46e5ef..a8c0d38c7e 100644 --- a/src/mesa/x86/sse_normal.S +++ b/src/mesa/x86/sse_normal.S @@ -1,4 +1,3 @@ -/* $Id: sse_normal.S,v 1.6 2006/04/17 18:58:24 krh Exp $ */ /* * Mesa 3-D graphics library @@ -32,6 +31,7 @@ */ #ifdef USE_SSE_ASM +#include "assyntax.h" #include "matypes.h" #include "norm_args.h" diff --git a/src/mesa/x86/sse_xform1.S b/src/mesa/x86/sse_xform1.S index 4051f606a7..4aa9de607c 100644 --- a/src/mesa/x86/sse_xform1.S +++ b/src/mesa/x86/sse_xform1.S @@ -1,4 +1,3 @@ -/* $Id: sse_xform1.S,v 1.4 2006/04/17 18:58:24 krh Exp $ */ /* * Mesa 3-D graphics library @@ -32,6 +31,7 @@ */ #ifdef USE_SSE_ASM +#include "assyntax.h" #include "matypes.h" #include "xform_args.h" diff --git a/src/mesa/x86/sse_xform2.S b/src/mesa/x86/sse_xform2.S index 06fe086bd4..91b82e7297 100644 --- a/src/mesa/x86/sse_xform2.S +++ b/src/mesa/x86/sse_xform2.S @@ -1,4 +1,3 @@ -/* $Id: sse_xform2.S,v 1.4 2006/04/17 18:58:24 krh Exp $ */ /* * Mesa 3-D graphics library @@ -32,6 +31,7 @@ */ #ifdef USE_SSE_ASM +#include "assyntax.h" #include "matypes.h" #include "xform_args.h" diff --git a/src/mesa/x86/sse_xform3.S b/src/mesa/x86/sse_xform3.S index eafbe34288..1fc79ef21b 100644 --- a/src/mesa/x86/sse_xform3.S +++ b/src/mesa/x86/sse_xform3.S @@ -1,4 +1,3 @@ -/* $Id: sse_xform3.S,v 1.4 2006/04/17 18:58:24 krh Exp $ */ /* * Mesa 3-D graphics library @@ -32,6 +31,7 @@ */ #ifdef USE_SSE_ASM +#include "assyntax.h" #include "matypes.h" #include "xform_args.h" diff --git a/src/mesa/x86/sse_xform4.S b/src/mesa/x86/sse_xform4.S index 24c323194f..fb1fa741c0 100644 --- a/src/mesa/x86/sse_xform4.S +++ b/src/mesa/x86/sse_xform4.S @@ -1,4 +1,3 @@ -/* $Id: sse_xform4.S,v 1.4 2006/04/17 18:58:24 krh Exp $ */ /* * Mesa 3-D graphics library @@ -25,6 +24,7 @@ */ #ifdef USE_SSE_ASM +#include "assyntax.h" #include "matypes.h" #include "xform_args.h" diff --git a/src/mesa/x86/x86.c b/src/mesa/x86/x86.c index 6b74e9e375..ce649f66b0 100644 --- a/src/mesa/x86/x86.c +++ b/src/mesa/x86/x86.c @@ -1,4 +1,3 @@ -/* $Id: x86.c,v 1.26 2005/10/07 17:18:52 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -28,8 +27,8 @@ * Intel x86 assembly code by Josh Vanderhoof */ -#include "glheader.h" -#include "context.h" +#include "main/glheader.h" +#include "main/context.h" #include "math/m_xform.h" #include "tnl/t_context.h" diff --git a/src/mesa/x86/x86.h b/src/mesa/x86/x86.h index a646aff46b..97651ec6ee 100644 --- a/src/mesa/x86/x86.h +++ b/src/mesa/x86/x86.h @@ -1,4 +1,3 @@ -/* $Id: x86.h,v 1.5 2002/04/09 14:58:03 keithw Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/x86/x86_cliptest.S b/src/mesa/x86/x86_cliptest.S index 5a45ee6ae6..e413aee61e 100644 --- a/src/mesa/x86/x86_cliptest.S +++ b/src/mesa/x86/x86_cliptest.S @@ -1,4 +1,3 @@ -/* $Id: x86_cliptest.S,v 1.12 2006/04/17 18:58:24 krh Exp $ */ /* * Mesa 3-D graphics library @@ -30,6 +29,7 @@ * in there will break the build on some platforms. */ +#include "assyntax.h" #include "matypes.h" #include "clip_args.h" diff --git a/src/mesa/x86/x86_xform2.S b/src/mesa/x86/x86_xform2.S index 94f6989d42..980725ef51 100644 --- a/src/mesa/x86/x86_xform2.S +++ b/src/mesa/x86/x86_xform2.S @@ -1,4 +1,3 @@ -/* $Id: x86_xform2.S,v 1.4 2006/04/17 18:58:24 krh Exp $ */ /* * Mesa 3-D graphics library @@ -30,6 +29,7 @@ * in there will break the build on some platforms. */ +#include "assyntax.h" #include "matypes.h" #include "xform_args.h" diff --git a/src/mesa/x86/x86_xform3.S b/src/mesa/x86/x86_xform3.S index 747e2f4d28..1c782f1c5c 100644 --- a/src/mesa/x86/x86_xform3.S +++ b/src/mesa/x86/x86_xform3.S @@ -1,4 +1,3 @@ -/* $Id: x86_xform3.S,v 1.4 2006/04/17 18:58:24 krh Exp $ */ /* * Mesa 3-D graphics library @@ -30,6 +29,7 @@ * in there will break the build on some platforms. */ +#include "assyntax.h" #include "matypes.h" #include "xform_args.h" diff --git a/src/mesa/x86/x86_xform4.S b/src/mesa/x86/x86_xform4.S index def3c1ceb9..97a841138e 100644 --- a/src/mesa/x86/x86_xform4.S +++ b/src/mesa/x86/x86_xform4.S @@ -1,4 +1,3 @@ -/* $Id: x86_xform4.S,v 1.4 2006/04/17 18:58:24 krh Exp $ */ /* * Mesa 3-D graphics library @@ -30,6 +29,7 @@ * in there will break the build on some platforms. */ +#include "assyntax.h" #include "matypes.h" #include "xform_args.h" diff --git a/src/mesa/x86/xform_args.h b/src/mesa/x86/xform_args.h index 89a04205c1..b773f5198d 100644 --- a/src/mesa/x86/xform_args.h +++ b/src/mesa/x86/xform_args.h @@ -1,4 +1,3 @@ -/* $Id: xform_args.h,v 1.5 2002/10/29 20:28:58 brianp Exp $ */ /* * Mesa 3-D graphics library |