--- mesa-glw-7.4.orig/autogen.sh +++ mesa-glw-7.4/autogen.sh @@ -0,0 +1,16 @@ +#! /bin/sh + +srcdir=`dirname "$0"` +test -z "$srcdir" && srcdir=. + +SRCDIR=`(cd "$srcdir" && pwd)` +ORIGDIR=`pwd` + +if test "x$SRCDIR" != "x$ORIGDIR"; then + echo "Mesa cannot be built when srcdir != builddir" 1>&2 + exit 1 +fi + +autoreconf -v --install || exit 1 + +"$srcdir"/configure "$@" --- mesa-glw-7.4.orig/bin/installmesa +++ mesa-glw-7.4/bin/installmesa @@ -0,0 +1,74 @@ +#!/bin/sh + +# +# Simple shell script for installing Mesa's header and library files. +# If the copy commands below don't work on a particular system (i.e. the +# -f or -d flags), we may need to branch on `uname` to do the right thing. +# + + +TOP=. + +INCLUDE_DIR="/usr/local/include" +LIB_DIR="/usr/local/lib" + +if [ "x$#" = "x0" ] ; then +echo +echo "***** Mesa installation - You may need root privileges to do this *****" +echo +echo "Default directory for header files is:" ${INCLUDE_DIR} +echo "Enter new directory or press to accept this default." + +read INPUT +if [ "x${INPUT}" != "x" ] ; then + INCLUDE_DIR=${INPUT} +fi + +echo +echo "Default directory for library files is:" ${LIB_DIR} +echo "Enter new directory or press to accept this default." + +read INPUT +if [ "x${INPUT}" != "x" ] ; then + LIB_DIR=${INPUT} +fi + +echo +echo "About to install Mesa header files (GL/*.h) in: " ${INCLUDE_DIR}/GL +echo "and Mesa library files (libGL.*, etc) in: " ${LIB_DIR} +echo "Press to continue, or -C to abort." + +read INPUT + +else +INCLUDE_DIR=$1/include +LIB_DIR=$1/lib +fi + +# flags: +# -f = force +# -d = preserve symlinks (does not work on BSD) + +if [ `uname` = "FreeBSD" ] ; then + CP_FLAGS="-f" +elif [ `uname` = "Darwin" ] ; then + CP_FLAGS="-f" +elif [ `uname` = "AIX" ] ; then + CP_FLAGS="-fh" +else + CP_FLAGS="-fd" +fi + + +set -v + +mkdir -p ${INCLUDE_DIR} +mkdir -p ${INCLUDE_DIR}/GL +# NOT YET: mkdir -p ${INCLUDE_DIR}/GLES +mkdir -p ${LIB_DIR} +cp -f ${TOP}/include/GL/*.h ${INCLUDE_DIR}/GL +cp -f ${TOP}/src/glw/*.h ${INCLUDE_DIR}/GL +# NOT YET: cp -f ${TOP}/include/GLES/*.h ${INCLUDE_DIR}/GLES +cp ${CP_FLAGS} ${TOP}/lib*/lib* ${LIB_DIR} + +echo "Done." --- mesa-glw-7.4.orig/bin/confdiff.sh +++ mesa-glw-7.4/bin/confdiff.sh @@ -0,0 +1,48 @@ +#!/bin/bash -e + +usage() +{ + echo "Usage: $0 " + echo "Highlight differences between Mesa configs" + echo "Example:" + echo " $0 linux linux-x86" +} + +die() +{ + echo "$@" >&2 + return 1 +} + +case "$1" in +-h|--help) usage; exit 0;; +esac + +[ $# -lt 2 ] && die 2 targets needed. See $0 --help +target1=$1 +target2=$2 + +topdir=$(cd "`dirname $0`"/..; pwd) +cd "$topdir" + +[ -f "./configs/$target1" ] || die Missing configs/$target1 +[ -f "./configs/$target2" ] || die Missing configs/$target2 + +trap 'rm -f "$t1" "$t2"' 0 + +t1=$(mktemp) +t2=$(mktemp) + +make -f- -n -p < $t1 +TOP = . +include \$(TOP)/configs/$target1 +default: +EOF + +make -f- -n -p < $t2 +TOP = . +include \$(TOP)/configs/$target2 +default: +EOF + +diff -pu -I'^#' $t1 $t2 --- mesa-glw-7.4.orig/docs/enums.txt +++ mesa-glw-7.4/docs/enums.txt @@ -0,0 +1,47 @@ + +Blocks allocated to Mesa: + 0x8750-0x875F + 0x8BB0-0x8BBF + + +GL_MESA_packed_depth_stencil + GL_DEPTH_STENCIL_MESA 0x8750 + GL_UNSIGNED_INT_24_8_MESA 0x8751 + GL_UNSIGNED_INT_8_24_REV_MESA 0x8752 + GL_UNSIGNED_SHORT_15_1_MESA 0x8753 + GL_UNSIGNED_SHORT_1_15_REV_MESA 0x8754 + +GL_MESA_trace.spec: + GL_TRACE_ALL_BITS_MESA 0xFFFF + GL_TRACE_OPERATIONS_BIT_MESA 0x0001 + GL_TRACE_PRIMITIVES_BIT_MESA 0x0002 + GL_TRACE_ARRAYS_BIT_MESA 0x0004 + GL_TRACE_TEXTURES_BIT_MESA 0x0008 + GL_TRACE_PIXELS_BIT_MESA 0x0010 + GL_TRACE_ERRORS_BIT_MESA 0x0020 + GL_TRACE_MASK_MESA 0x8755 + GL_TRACE_NAME_MESA 0x8756 + +MESA_ycbcr_texture.spec: + GL_YCBCR_MESA 0x8757 + GL_UNSIGNED_SHORT_8_8_MESA 0x85BA /* same as Apple's */ + GL_UNSIGNED_SHORT_8_8_REV_MESA 0x85BB /* same as Apple's */ + +GL_MESA_pack_invert.spec + GL_PACK_INVERT_MESA 0x8758 + +GL_MESA_shader_debug.spec: + GL_DEBUG_OBJECT_MESA 0x8759 + GL_DEBUG_PRINT_MESA 0x875A + GL_DEBUG_ASSERT_MESA 0x875B + +GL_MESA_program_debug.spec: + GL_FRAGMENT_PROGRAM_CALLBACK_MESA 0x???? + GL_VERTEX_PROGRAM_CALLBACK_MESA 0x???? + GL_FRAGMENT_PROGRAM_POSITION_MESA 0x???? + GL_VERTEX_PROGRAM_POSITION_MESA 0x???? + GL_FRAGMENT_PROGRAM_CALLBACK_FUNC_MESA 0x???? + GL_FRAGMENT_PROGRAM_CALLBACK_DATA_MESA 0x???? + GL_VERTEX_PROGRAM_CALLBACK_FUNC_MESA 0x???? + GL_VERTEX_PROGRAM_CALLBACK_DATA_MESA 0x???? + --- mesa-glw-7.4.orig/docs/VERSIONS +++ mesa-glw-7.4/docs/VERSIONS @@ -0,0 +1,1514 @@ + + +Mesa Version History +==================== + +1.0 beta February 1995 + Initial release + +1.1 beta March 4, 1995 + Changes: + faster point and line drawing (2x faster) + more systems supported, better Makefiles + Renamed lib*.a files to avoid collisions + many small bug fixes + New: + pseudo-GLX functions added + new implementation of evaluators (eval2.c) + GLUT support + +1.1.1 beta March 7, 1995 + Changes: + Reverted from eval2.c to eval.c due to FPE on Linux + more speed improvements + more Makefile changes + +1.1.2 beta March 14, 1995 + New: + implementation of SGI's blending extensions + glXUseXFont implemented + added MESA_DEBUG environment variable support + Changes: + Using eval2.c again + more FPE-prevention checks (0-length normals are OK) + a few small bug fixes + much faster pixel logic ops! + faster transformation arithmetic + +1.1.3 beta March 31, 1995 + New: + gluScaleImage() and gluBuild2DMipMaps() implemented + Mesa widgets for Xt/Motif + blendEXT demos + added environment variables for selecting visuals + Changes: + almost all GLUT demos work correctly now + faster X device driver functions + more bug fixes + +1.1.4 beta April 20, 1995 + Bug fixes: + - missing #define SEEK_SET in src-tk/image.c + - compile glShadeModel into display lists + - fixed pow() domain error in src/light.c + - fixed "flickering bitmaps" in double buffer mode + - fixed tk.h and aux.h for C++ + - state of LIGHT_MODEL_LOCAL_VIEWER was inverted + New features: + - MUCH, MUCH nicer dithering in 8-bit RGB mode + - updated widgets and widget demos + - Implemented GLXPixmap functions + - Added GLU 1.1 and GLX 1.1 functions + - Changed the X/Mesa interface API, more versatile + - Implemented gluPartialDisk() + +1.2 May 22, 1995 + Bug fixes: + - IRIX 4.x makefile problem + - modified tk to share root colormap as needed + - gluLookAt normalization problem + - suppress Expose, NoExpose events in swapbuffers + - glBitmap() and glDrawPixels() clipping + New features: + - GL_BLEND, GL_MODULATE, GL_DECAL, and GL_REPLACE_EXT texture + modes implemented + - texture maps stored more efficiently + - texture maps can be compiled into display lists + - Bogdan Sikorski's GLU polygon tesselation code + - Linas Vepstas's sweep and extrusion library + - glXCreateContext()'s shareList parameter works as it's supposed to. + XMesaCreateContext() updated to accept a shareList parameter too. + - Mesa can be compiled with real OpenGL .h files + - MESA_BACK_BUFFER environment variable + - better GLX error checking + +1.2.1 June 22, 1995 + Bug fixes: + - X/Mesa double buffer window resize crash + - widgets now pass PointerMotion events + - X/Mesa incorrect default clear color and drawing color + - more robust X MIT-SHM support in X/Mesa + - glTexImage( format=GL_LUMINANCE ) didn't work + - GL_LINE mode polygons with line width > 1.0 could cause a crash + - numerous feedback bugs + - glReadPixels() from depth buffer was wrong + - error prone depth and stencil buffer allocation + New features: + - Preliminary Microsoft Windows driver + - Implemented a number of missing functions: glEvalCoord[12][df]v(), + glGet...(), etc. + - Added a few missing symbols to gl.h and glu.h + - Faster rendering of smooth-shaded, RGBA, depth-buffered polygons. + - Faster rendering of lines when width=2.0 + - Stencil-related functions now work in display lists + Changes: + - renamed aux.h as glaux.h (MS-DOS names can't start with aux) + - most filenames are in 8.3 format to accomodate MS-DOS + - use GLubytes to store arrays of colors instead of GLints + +1.2.2 August 2, 1995 + New features: + - texture mapped points and lines + - NURBS! (but not 100% complete) + - viewports may safely extend beyond window boundaries + - MESA_PRIVATE_CMAP environment variable + - Grayscale X display support + - two new demos: demos/gears.c and demos/shadow.c + - MachTen for Macintosh configuration + Bug fixes: + - glGet*(GL_DEPTH_BITS) returned bytes, not bits + - point, line, and bitmap rasterization suffered from roundoff errors + - fixed a division by zero error in line clippping + - occasional wrong default background color really fixed! + - glDepthFunc(GL_ALWAYS) with glDepthMask(GL_FALSE) didn't work + - gluBuild2DMipmaps malloc problem fixed + - view volume clipping of smooth shaded lines resulted in bad colors + Changes: + - new visual selection method in glXChooseVisual() + - improved GLU quadric functions + - call XSync for glFinish and XFlush for glFlush + - glVertex() calls now use a function pointer to avoid conditionals + - removed contrib directory from Mesa tar file (available on ftp site) + - AIX shared library support + - Removed GLUenum type as it's not in OpenGL + +1.2.3 September 26, 1995 + New features: + - Mesa header files now equivalent to SGI OpenGL headers + - Support for HP's Color Recovery dithering displays + - Faster vertex transformation + - Faster raster operations into X windows under certain conditions + - New configurations: HP w/ shared libs, Ultrix w/ GCC, Data General + - 4-bit visuals now supported + Bug fixes: + - glScissor bug fixed + - round-off errors in clipping lines against clip planes fixed + - byte swapping between hosts and display servers implemented + - glGetError() can be called without a current rendering context + - problem with accidentally culled polygons is fixed + - fixed some widget compilation problems + +1.2.4 November 17, 1995 + New features: + - More speed improvements (lighting, fogging, polygon drawing) + - Window system and OS-independent off-screen rendering + - Preliminary Fortran bindings + - glPolygonOffsetEXT implemented + - glColorMask and glIndexMask now fully implemented + - glPixelZoom implemented + - display lists fully implemented + - gamma correction + - dithering in 8-bit TrueColor/DirectColor visuals + Changes: + - Improved device driver interface + - tk.h renamed to gltk.h to avoid conflicts with Tcl's Tk + - Dithering support moved from core into device driver + Bug fixes: + - glEnable/Disable( GL_LIGHTING ) didn't always take effect + - glReadPixels byte swapping was broken + - glMaterial with pname==GL_AMBIENT_AND_DIFFUSE was broken + - duplicate glColor4b() prototype in GL/gl.h removed + - stripes in wave -ci demo fixed + - GL_LINEAR_MIPMAP_NEAREST had wrong value + - bugs in HP Color Recovery support fixed + - fixed bug when blending lines, points, bitmaps outside of window + +1.2.5 November 30, 1995 + New Features: + - updated MS Windows driver + - new implementation of StaticGray/GrayScale visual support + Bug fixes: + - pixelzooming with gamma correction or blending didn't work + - HP color recovery visual wasn't being picked by glXChooseVisual + - glClear didn't always observe glColorMask changes + - olympic and offset demos didn't compile on some Suns + - texcoord clamping wasn't correct + - a polygon optimization introduced an occasional sampling problem + +1.2.6 January 26, 1996 + New Features: + - faster line and polygon rendering under certain conditions. See + Performance Tips 9 and 10 in README + - profiling + - lighting is a bit faster + - better perspective corrected texture mapping + - Amiga AmiWin (X11) support + - preliminary Linux SVGA driver + Changes: + - now using a 16-bit depth buffer, faster, smaller + - GL_NORMALIZE is disabled by default + Bug fixes: + - projective texture mapping + - fixed a memory leak in the context destroy function + - GL_POLYGON with less than 3 vertices caused a crash + - glGet*() returned wrong result for GL_INDEX_MODE + - reading pixels from an unmapped X window caused a BadMatch error + +1.2.7 March 5, 1996 + New: + - faster lighting + - faster 16-bit TrueColor rendering on Linux + - faster 32-bit TrueColor rendering on Linux, HP, IBM + - non-depth-buffered XImage polygons are faster + - vertex array extension + - software alpha planes + - updated Macintosh driver + - new NeXT driver + - GLU quadric functions generate texture coordinates + - reflect.c demo - reflective, textured surface demo + Changes: + - gamma correction code moved into the X driver for better performance + Bug fixes: + - multiple glClipPlane()'s didn't work reliably + - glPolygonMode() didn't always work + - glCullFace( GL_FRONT_AND_BACK ) didn't work + - texture mapping with gamma correction was buggy + - floating point exceptions in texture coordinate interpolation + - XImage byte swapping didn't always work + - polygon edge flags weren't always used correctly + +1.2.8 May 22, 1996 + New: + - overlay planes on X servers with the SERVER_OVERLAY_VISUALS property + - better monochrome output + - more IRIX 6.x configurations + - more robust RGB mode color allocation + - added MESA_XSYNC environment variable + - GLX_MESA_pixmap_colormap and GLX_EXT_visual_info extensions + - GL_MESA_window_pos extension + - faster glReadPixels/glDrawPixels for GL_DEPTH and GL_UNSIGNED_SHORT + and GL_UNSIGNED_INT + - driver for prototype Cirrus Mondello 3-D board + - updated AmigaDOS driver + - a few small speed optimizations in polygon rendering + Changes: + - internal device driver interface modified to simplify device + driver implementations and to support hardware Z buffers + - several changes to the X/Mesa interface (xmesa.h) + Bug fixes: + - fixed pow(0,0) domain error triggered on some systems + - glStencilClear() in a display list caused an infinite loop + - glRasterPos*() was sometimes off by +/-0.5 in X and Y + - color masking and blending were performed in wrong order + - auxSolidCylinder() sometimes drew a wire-frame cylinder + - fixed file writing bug in osdemo.c + - pixel mapping didn't always work + - the GL_GEQUAL stencil func didn't work + - the GL_INVERT stencil op didn't work + - the stencil write mask didn't work + - glPush/PopAttrib() didn't do enough error checking + - glIsList() didn't always work correctly + +2.0 October 10, 1996 + New: + - Implements OpenGL 1.1 API functions + - all texture filtering modes supported (mipmapping) + - faster texture mapping, see Performance Tip 11 in README + - antialiased RGB points + - X support for line and polygon stippling + - glDrawBuffer( GL_FRONT_AND_BACK ) works + - util/ directory of useful stuff + - demos/texobj demo of texture objects + Changes: + - major internal changes for thread-safeness + - new device driver interface + - MESA_ALPHA env variable removed + - triangle rasterizer replaces polygon rasterizer + Bug fixes: + - glPopAttrib() bug + - glDrawBuffer(GL_NONE) works now + +2.1 December 14, 1996 + New: + - VMS support + - MS-DOS driver + - OpenStep support + - updated, combined Windows 95/NT driver + - implemented glGetLighti() and glGetTexGen*() + - GLX does garbage collection of ancillary buffers + Bug fixes: + - removed unused _EXT constants from gl.h + - fixed polygon offset bugs + - Z coordinates of clipped lines were incorrect + - glEdgeFlag() in display lists didn't always work + - glLight*() in display lists didn't work + - fixed X line stipple bugs (Michael Pichler) + - glXUseXfonts XFreeFont/XFreeFontInfo bug fixed + - fixed a feedback bug + - glTexGen*() now transforms GL_EYE_PLANE by inverse modelview matrix + - polygons were sometimes culled instead of clipped + - triangle rasterizer suffered from float/int overflow exceptions + - fixed FP underflow exception in lighting (specular exponent) + - glEnable/glDisable of GL_EXT_vertex_array enums didn't work + - fixed free(NULL) in GLU tesselator code + - using 24-bit color on some X servers resulted in garbage rendering + - 32-bit per pixel mode for XFree86 now works + - glRotate(a,0,0,0) gave unpredictable results + - GL_LINE_STRIP with > 480 vertices had occasional clipping problems + - 8-bit TrueColor GLXPixmap rendering incorrectly required a colormap + - glMaterial() wasn't ignored when GL_COLOR_MATERIAL was enabled + - glEnable(GL_COLOR_MATERIAL) followed by glColor() didn't work right + - accumulation buffer was limited to positive values + - projective textures didn't work + - selection buffer overflows weren't handled correctly + Changes: + - restored the GL_EXT_polygon_offset extension + - slightly faster RGB dithering + - the SVGA driver works again + - Amiga driver now distributed separately + - NeXT driver updated for Mesa 2.x + +2.2 March 14, 1997 + New: + - better color selection when dithering + - added GL_EXT_texture_object extension + - updated MS-DOS driver for DJGPP + - added openbsd make configuration + - faster dithered flat-shaded triangles + - various compilation problems with Motif widgets fixed + - gl.h, glx.h and glu.h name mangling option + - BeOS driver + - 3D texture mapping extension + - GL_MESA_resize_buffers extension + - morph3d, stex3d and spectex demos + - 3Dfx support + Bug fixes: + - glColorMaterial should finally work right in all respects + - linear interpolation of mipmap levels was incorrectly weighted + - readpix.c didn't compile on Macintosh + - GL_INVERT and related logic ops didn't work right + - glTexImage[12]D() didn't check its parameters consistantly + - fixed a memory leak in glTexImage[12]D() + - kludged around a SunOS 5.x/GCC compiler bug in the feedback code + - glReadPixels aborted instead of normally catching some errors + - a few 1.1 constants were missing or misnamed in gl.h + - glBegin(p); glBegin(q); didn't generate an error + - fixed a memory leak in GLX code + - clipping of concave polygons could cause a core dump + - 1-component alpha texture maps didn't work + - fixed a GLU polygon tesselator bug + - polygons with colinear vertices were sometimes culled + - feedback triangle colors were wrong when using smooth shading + - textures with borders didn't work correctly + - colors returned in feedback mode were wrong when using lighting + - spotlights didn't effect ambient lighting correctly + - gluPartialDisk() had a few bugs + Changes: + - device driver interface expanded to support texture mapping + - faster matrix inversion subroutine + - commented out #include "wmesa_extend.h" from src/wmesa.c + - fixed many compiler warnings in the demo programs + +2.3 June 30, 1997 + New: + - Mesa distribution divided into two pieces: library code and demos + - faster vertex transformation, clip testing, lighting + - faster line drawing + - TrueColor visuals how have dithering (for depths < 24 bits) + - added MESA_NO_DITHER environment variable + - new device driver function: NearFar(), RenderVB(), RasterSetup() + - added LynxOS configuration + - added cygnus Win32 configuration + - added texcyl.c GLUT demo + - added XMesaDitherColor() to X/Mesa interface + - new NURBS code from Bogdan Sikorski + - added demos/shape.c (non-rectangular X window!) + Bug fixes: + - glEnable/DisableClientState() were missing from GL/gl.h + - GL_SPHERE_MAP texcoord generation didn't work correctly + - glXGetConfig() returned wrong number of depth, stencil, accum bits + - glDrawPixels feedback/selection didn't examine RasterPos valid bit + - black and white were reversed on some monochrome displays + - fixed potential image memory leak (wasn't setting reference counter) + - glDrawPixels sometimes didn't recognize some GL state changes + - gluProject/UnProject() didn't check for divide by zero + - stex3d demo called random() and srandom(), not portable + - fixed memory leaks in context.c and drawpix.c + - fixed NULL dereferencing problem in gl_update_texture_state() + - glReadPixels between glBegin/glEnd didn't generate an error. + - fixed memory leak in polygon tesselator (Randy Frank) + - fixed seg fault bug drawing flat-shaded, depth-tested lines + - clipped GL_TRIANGLE_STRIPs sometimes had wrong color when flat-shaded + - glBindTexture sometimes didn't work + - fixed a bug deep in glXReleaseBuffersMESA() + - fog was mistakenly applied to alpha + - glPopMatrix didn't set "dirty matrix" flag + - glPolygonStipple pattern was sometimes wrong + - glClear wasn't disabled during feedback and selection + - fixed memory leak in glTexSubImage[123]D + Changes: + - many library source files reorganized + - faster X color allocation, colors also freed when finished with them + - new texture sampling function pointer in texture objects + - incorporated 3Dfx VooDoo driver v0.16 into main source tree + - many 3Dfx driver updates + - cygnus Makefiles now included + - updated DOS driver + - made a few changes to dosmesa.c and wmesa.c (VB->Unclipped) + - internally, colors now stored in GLubytes, not GLfixed + - optimized changing of GL_SHININESS parameter + +2.4 September 18, 1997 + New: + - updated 3Dfx Glide driver + - hacks for 3Dfx rendering into an X window or fullscreen + - added depth buffer access functions to X/Mesa and OS/Mesa interfaces + Bug fixes: + - pixel buffer could overflow with long, wide lines + - fixed FP underflow problems in lighting + - glTexSubImage1D() had an unitialized variable + - incomplete texture objects could cause a segfault + - glDrawPixels with GL_COMPILE_AND_EXECUTE caused infinite loop + - flat-shaded quads in a strip were miscolored if clipped + - mipmapped triangle lod computation now works correctly + - fixed a few under/overflow bugs in triangle rasterizer + - glArrayElement() assigned bad normal if normal array disabled + - changed argument to glXReleaseBuffersMESA() + - fixed small triangle underflow bugs in tritemp.h (hopefully) + - glBindTexture(target, 0) caused a crash + - glTexImage[123]D() with NULL image pointer caused crash + - glPixelStore parameters are now ignored during display list execution + - fixed a two-sided lighting w/ clipping bug (black vertices) + - textures with width!=height were sometimes mis-rendered + - "weird" projection matrices could cause div by 0, other fp errors + Changes: + - changed precompiled header symbol from PCH to PC_HEADER + - split api.c into api1.c and api2.c + - added hash.c source file (but not used yet) + - a few Sun and HP configuration file changes + - MESA_GLX_FX env var replaces MESA_FX_WINDOW and MESA_FX_FULLSCREEN + - fixed a few cygnus build problems (src/Makefile.cygnus, src/wmesa.c) + +2.5 November 20, 1997 + New: + - updated 3Dfx driver (v20) for GLQuake + - added GL_EXT_paletted_texture extension + - added GL_EXT_shared_texture_palette extension + - added GL_EXT_point_parameters extension + - now including Mark Kilgard's GLUT library v3.6 + - new GLUT-based demos in gdemos/ + - added a few more Unix config targets + - added Intel X86 assembly language vertex transformation code + - 3Dfx/Glide driver for Mesa now recognizes SST_SCREENREFRESH env var + - Windows 95 S3 Virge driver + Bug fixes: + - glCopyTexImage?D would crash due to uninitialized variable + - glColor w/ glColorMaterial in a display list caused a bug + - fixed several glDrawPixels() and ReadPixels() bugs in 3Dfx driver + - glVertex4*() vertices weren't always projected correctly + - trying to use mipmapped textured points or lines caused crash + - glColor[34][fd]() values now clamped to [0,1] before int conversion + Changes: + - new device driver functions for texture mapping + - hash tables used for display list and texture object lookup + - fixed GLX visual handling code to avoid saving redundant visuals + - 3Dfx Glide libraries automatically linked to libMesaGL.so + - dropped the Cirrus Logic Mondello code since it's obsolete + - updated Cygnus Makefiles (Stephane Rehel) + - updated Windows MSVC++ Makefiles (Oleg Letsinsky) + - procedure for making library files has changed: scripts now take + a major and minor version arguments. Make-config changed a lot. + - new implementation of glTexSubImage2D() + - updated widgets-mesa directory to create libMesaGLwM.a (Motif widget) + - separate linux-glide and linux-386-glide configurations + +2.6 February 12, 1998 + New: + - Windows WGL functions + - updated VMS, DOS, Windows, Cygnus, BeOS, Amiga compilation support + - v0.22 of 3Dfx Glide driver + - more X86 assembly language optimizations + - faster blending for some modes + - XMesaSetFXmode() to switch between 3Dfx window and full-screen mode + - added preliminary thread support + - added GLX_MESA_copy_sub_buffer extension + - some clipping optimizations + Bug fixes: + - fixed shading/material bug when drawing long primitive strips + - fixed clipping problem in long primitive strips + - fixed clipping bug when using 3Dfx driver + - fixed a problem when trying to use X fonts w/ 3Dfx driver + - fixed a texture filter bug in 3Dfx/Glide driver + - fixed bug in 3Dfx/Glide driver involving depth mask & clearing + - glLoadMatrix to set projection matrix confused the 3Dfx driver + - non-identity texture matrices didn't work with linux-386 configs + - glGenTextures() didn't reserve the returned texture IDs + - NULL proxy image sent to glTexImageXD() caused crash + - added texture state validation optimization (Henk Kok) + - fixed colormap reuse problem when using both RGB and CI windows + - 32bpp True/DirectColor X visuals weren't recognized + - fixed potential problem in evaluators memory allocation + - fixed assorted demo compilation bugs + Changes: + - replaced old Mesa/windows/ directory with Mesa/WIN32/ directory + - converted a few old glaux/gltk demos to GLUT + - renamed directories: demos -> xdemos, gdemos -> demos + + +3.0 September 17, 1998 + New: + - OpenGL 1.2 API + - GL_EXT_abgr pixel format extension + - GL_SGIS_texture_edge_clamp extension + - GL_SGIS_multitexture extension (to be replaced by GL_ARB_multitex) + - GL_EXT_multitexture extension (to be replaced by GL_ARB_multitex) + - GL_EXT_rescale_normal extension and renormal.c demo + - GLX_SGI_video_sync extension (a no-op) + - antialiased lines + - glGetTexImage() now implemented + - glDraw/Copy/ReadPixels() optimizations + - optimized textured triangle code (Marten Stromberg) + - more optimization of dithered TrueColor triangles in X driver + - Linux GGI driver + - updated MGL driver + Bug fixes: + - lots of assorted compilation fixes + - glInitNames didn't write initial hit record + - glBitmap didn't always check for invalid raster position + - switching between GLX and OSMesa contexts caused a crash + - fixed uninitialized variable in Mesa widget code + - fixed typo in texture code which caused book/texgen to crash + - fixed texture sampling bug when filter=GL_LINEAR and wrap=GL_CLAMP + - gluDisk() in POINT or LINE mode sometimes failed + - fixed texture + fog bug + - GL_COMPILE_AND_EXECUTE mode didn't work reliably + - glMultMatrix in projection matrix mode w/ 3Dfx driver could fail + - glDrawPixels(color index pixels) weren't converted to RGBA + - fixed possible getenv() buffer overflow security bug + - glBitmap in feedback mode was offset by xOrig, yOrig params + - device driver's DrawPixels hook was never used + - glDrawPixels with zoomY!=1 and top/bottom clipping didn't work + - glDrawPixels optimized for GL_LUMINANCE, GL_LUMINANCE_ALPHA, GLubyte + - fixed MakeCurrent bug in GLwRedrawObjects() in MesaWorkstation.c + - glCopyTexSubImage2D() didn't work with 3Dfx driver + - lines with width = 2 could cause crash + - glClear with scissor rect sometimes cleared whole buffer + - glTexSubImage2D( .. GL_COLOR_INDEX .. ) didn't work + - glTexImageXD( .. GL_ABGR_EXT .. ) didn't work + - computation of inverse modelview matrix sometimes failed + - fixed GL_CLAMP mode texture sampling bug + - textured line interpolation was somewhat broken + - textured triangle interpolation was also somewhat broken + - glGet(MODELVIEW/PROJECTION/TEXTURE_MATRIX_STACK_DEPTH) off by one + - evaluator state wasn't fully initialized + - texture coordinate clipping was buggy + - evaluator surfaces could be mis-colored + - glAccum(GL_RETURN, s) didn't obey glColorMask() settings + - zero area polygons shouldn't be culled if polygon mode is point/line + - clipped width and height of glReadPixels was sometimes off by one + - blending with alpha = 0 or 1.0 wasn't always exact + - reading of pixels from clipped region was buggy + - minor tweaking of X visual management in GLX emulator + - glPolygonStipple now obeys pixel unpacking parameters + - glGetPolygonStipple now obeys pixel packing parameters + - interleaved vertex array texture coordinates were broken + - query of proxy texture internal format was broken + - alpha channel wasn't reliably cleared + - fixed divide by zero error in gluScaleImage if dest size = 1 x 1 + Conformance bug fixes: + - GL_SELECTION_BUFFER_POINTER and GL_SELECTION_BUFFER_SIZE were missing + - GL_TEXTURE_INTERNAL_FORMAT was missing + - glGet*(GL_POLYGON_STIPPLE) was broken + - glPush/PopAttrib() didn't save/restore all texture state + - glBitmap in feedback mode didn't work + - feedback of texture coords didn't always work + - glDrawPixels w/ format=GL_DEPTH_COMPONENT, type=GLbyte was broke + - glDrawPixels w/ format=GL_DEPTH_COMPONENT, type=GLubyte was broke + - glDrawPixels w/ format=GL_STENCIL_INDEX, type=GL_BITMAP was broke + Changes: + - upgraded GLUT to version 3.7 + - only GL and GLU library code included in MesaLib.tar.gz + - GLUT and all demos now in MesaDemos.tar.gz + - glaux and gltk libraries removed + - IRIX -n32 and -64 libs go in lib32/ and lib64/ directories + + +3.1 beta 1 November 19, 1998 + New: + - GL_EXT_stencil_wrap extension + - GL_INGR_blend_func_separate extension + - GL_ARB_multitexture extension + - GL_NV_texgen_reflection extension + - newly optimized vertex transformation code + - updated GLUT 3.7 code + - better precision when using 32-bit Z buffer + - Allegro DJGPP driver + Bug fixes: + - glCopyPixels between front/back buffers didn't copy alpha correctly + - fixed out-of-bounds memory access in optimized 2-D texture code + - glPixelStorei didn't accept GL_PACK/UNPACK_IMAGE_HEIGHT parameter + - glGet*() didn't accept GL_MAX_3D_TEXTURE_SIZE parameter + - clipping of texture coordinates sometimes had bad R,Q values + - GL_CLAMP_TO_EDGE texture sampling was off by 0.5 texels + - glEdgeFlagPointer() now takes a GLvoid * instead of GLboolean * + - texture was sometimes applied twice with 3Dfx driver + - glPush/PopAttrib() fouled up texture object reference counts + - glDeleteLists(0, n) caused assertion failure + - bilinear texture sampling wasn't accurate enough + - glClear w/ glDepthMask(GL_FALSE) didn't work right on 3Dfx + - color components were reversed on big endian 32 bpp X visuals + Changes: + - removed GL_EXT_multitexture extension + + +3.1 beta 2 May 24, 1999 + New: + - multi-textured points and lines (mjk@nvidia.com) + - optimized 24bpp X rendering (bernd.paysan@gmx.de) + - added allegro support (bernie-t@geocities.com) + - cleaned-up Windows-related stuff (Ted Jump) + - minor stereo changes (KendallB@scitechsoft.com) + - new BeOS driver which implements BGLView class + - new Direct3D driver (see src/D3D) + - more efficient filled gluCylinder() function + - utilities: util/showbuffer.[ch] and util/glstate.[ch] + - fixed some IRIX compiler warnings + - added support for building Mesa in XFree86 with + SGI's GLX (kevin@precisioninsight.com) + Bug fixes: + - a variety of Windows/Mesa bug fixes (mjk@nvidia.com) + - packed pixel images weren't unpacked correctly + - patches some win32 files in GLUT (mjk@nvidia.com) + - glTexImage[123]D() didn't accept internalFormat == GL_COLOR_INDEX + - fixed lighting bug in Keith's new shading code + - fixed texture segfault seen in Lament screensaver + - fixed miscellaneous low-memory bugs + - glClear(GL_COLOR_BUFFER_BIT) with RGBA or CI masking was broken + - GL_LINEAR sampling of 3D textures was broken + - fixed SVR4 'cc' compiler macro problem (dawes@xfree86.org) + - added GL_TEXTURE_PRIORITY fix (keithh@netcomuk.co.uk) + - fixed wide point and wide line conformance bugs (brianp) + Changes: + - some device driver changes (see src/dd.h) + - new copyright on core Mesa code + + +3.1 beta 3 September 17, 1999 + New: + - optimized glAccum function + - optimized 24bpp rendering in XMesa driver + - GLU 1.2 polygon tessellator + Bug Fixes: + - glGetTexLevelParameter wasn't fully implemented + - glXUseXFont now handles multi-byte fonts + - glIsEnabled(GL_TEXTURE_2D / 3D) returned wrong result + - alpha channel of blending points, lines was sometimes incorrect + Changes: + - New library names: "libGL" instead of "libMesaGL" + - New library numbering: libGL.so.1.2.310 + - New subdirectories: docs/ and bin/ + - New Makefile-system (autoconf,automake,libtool) + + +3.1 final December 14, 1999 + New: + - added demos/gloss.c + - added xdemos/glxdpyinfo.c + - added GLX_ARB_get_proc_address extension + - rewritten glTexImage code paths (faster, less memory, bug fixes) + Bug Fixes: + - several vertex array bug fixes + - overlapping glCopyPixels with pixel zooming now works + - glXUseXFont() bitmaps were vertically shifted by one pixel + - glCopyPixels with pixel zooming now works + + +3.2 final April 24, 2000 + Bug fixes: + - fixed memcpy bugs in span.c + - fixed missing glEnd problem in demos/tessdemo.c + - fixed bug when clearing 24bpp Ximages + - fixed clipping problem found in Unreal Tournament + - fixed Loki's "ice bug" and "crazy triangles" seen in Heretic2 + - fixed Loki's 3dfx RGB vs BGR bug + - fixed Loki's 3dfx smooth/flat shading bug in SoF + Changes: + - updated docs/README file + - use bcopy() optimizations on FreeBSD + - re-enabled the optimized persp_textured_triangle() function + + +3.2.1 July 19, 2000 + Bug fixes: + - gluBuild2DMipmaps() didn't accept GL_BGRA + - Fixed compile/makefile problems on IRIX + - fixed segfault in 3dfx driver when using GL selection/feedback + - no longer cull very, very tiny triangles + - blending w/ drawbuffer==GL_FRONT_BACK caused segfault (sw rendering) + - fixed Motif detection code in widgets-mesa/configure.in + - glColorMaterial and glMaterial updates to emissive and ambient + didn't always work right + - Specular highlights weren't always in the right place + - clipped GL_LINE mode polygons had interior lines appear + - blend term GL_ONE_MINUS_CONSTANT_ALPHA was broken + - GL_NICEST fog didn't always work with flat shading + - glRect commands in display lists were sometimes miscolored + - Line Z offset didn't always work + - fixed texgen normal vector problem (gloss's teapot) + - numerous GL conformance bugs fixed + Changes: + - glColorMask(false, false, false, false) handled better/faster + - reverted to old GLU polygon tessellator, GLU 1.1 + - updated Win32 build files + + +3.3 July 21, 2000 + New: + - antialiased triangles now implemented + - GL_EXT_texture_env_add texture mode extension + - GLX 1.3 API + - support for separate draw/read buffers (ie GL_SGI_make_current_read) + - thread-safe API dispath + - improved glxinfo program + - demos/texdown program to measure texture download performance + - glext.h header file + - demos/geartrain program + - GL_EXT_texture_lod_bias extension + - demos/lodbias program + - further optimized glRead/DrawPixels for 16-bit TrueColor X visuals + - GLX_EXT_visual_rating extension (a no-op, however) + - GL_HP_occlusion_test extension (for X and OS/Mesa drivers) + - demos/occlude program + - GL_SGIS_pixel_texture and GL_SGIX_pixel_texture extensions + - demos/pixeltex program + - GL_SGI_color_matrix extension + - GL_SGI_color_table extension + - GL_EXT_histogram extension + - GL_ARB_texture_cube_map extension + - added xdemos/glxheads and xdemos/manywin + - demos/texenv.c demo + - GL_EXT_texture_env_combine extension (by Holger Waechtler) + - Xlib driver is now thread-safe (see xdemos/glthreads) + Bug Fixes: + - various GL conformance failures fixed since 3.2.1 + Changes: + - gl.h now uses #defines instead of C enums for all tokens + - glu.h now uses #defines instead of C enums for all tokens + - moved programs from 3Dfx/demos/ into demos/ directory + + +3.4 November 3, 2000 + New: + - optimized glDrawPixels for glPixelZoom(1,-1) + Bug Fixes: + - widgets-mesa/src/*.c files were missing from 3.3 distro + - include/GL/mesa_wgl.h file was missing from 3.3 distro + - fixed some Win32 compile problems + - texture object priorities weren't getting initialized to 1.0 + - glAreTexturesResident return value was wrong when using hardware + - glXUseXFont segfaulted when using 3dfx driver (via MESA_GLX_FX) + - glReadPixels with GLushort packed types was broken + - fixed a few bugs in the GL_EXT_texture_env_combine texture code + - glPush/PopAttrib(GL_ENABLE_BIT) mishandled multi-texture enables + - fixed some typos/bugs in the VB code + - glDrawPixels(GL_COLOR_INDEX) to RGB window didn't work + - optimized glDrawPixels paths weren't being used + - per-fragment fog calculation didn't work without a Z buffer + - improved blending accuracy, fixes Glean blendFunc test failures + - glPixelStore(GL_PACK/UNPACK_SKIP_IMAGES) wasn't handled correctly + - glXGetProcAddressARB() didn't always return the right address + - gluBuild[12]DMipmaps() didn't grok the GL_BGR pixel format + - texture matrix changes weren't always detected (GLUT projtex demo) + - fixed random color problem in vertex fog code + - fixed Glide-related bug that let Quake get a 24-bit Z buffer + Changes: + - finished internal support for compressed textures for DRI + + +3.4.1 February 14, 2001 + New: + - fixed some Linux build problems + - fixed some Windows build problems + - GL_EXT_texture_env_dot3 extension (Gareth Hughes) + Bug fixes: + - added RENDER_START/RENDER_FINISH macros for glCopyTexImage in DRI + - various state-update code changes needed for DRI bugs + - disabled pixel transfer ops in glColorTable commands, not needed + - fixed bugs in glCopyConvolutionFilter1D/2D, glGetConvolutionFilter + - updated sources and fixed compile problems in widgets-mesa/ + - GLX_PBUFFER enum value was wrong in glx.h + - fixed a glColorMaterial lighting bug + - fixed bad args to Read/WriteStencilSpan in h/w stencil clear function + - glXCopySubBufferMESA() Y position was off by one + - Error checking of glTexSubImage3D() was broken (bug 128775) + - glPopAttrib() didn't restore all derived Mesa state correctly + - Better glReadPixels accuracy for 16bpp color - fixes lots of OpenGL + conformance problems at 16bpp. + - clearing depth buffer with scissoring was broken, would segfault + - OSMesaGetDepthBuffer() returned bad bytesPerValue value + - fixed a line clipping bug (reported by Craig McDaniel) + - fixed RGB color over/underflow bug for very tiny triangles + Known problems: + - NURBS or evaluator surfaces inside display lists don't always work + + +3.4.2 May 17, 2001 + Bug fixes: + - deleting the currently bound texture could cause bad problems + - using fog could result in random vertex alpha values + - AA triangle rendering could touch pixels outside right window bound + - fixed byteswapping problem in clear_32bit_ximage() function + - fixed bugs in wglUseFontBitmapsA(), by Frank Warmerdam + - fixed memory leak in glXUseXFont() + - fragment sampling in AA triangle function was off by 1/2 pixel + - Windows: reading pixels from framebuffer didn't always work + - glConvolutionFilter2D could segfault or cause FP exception + - fixed segfaults in FX and X drivers when using tex unit 1 but not 0 + - GL_NAND logicop didn't work right in RGBA mode + - fixed a memory corruption bug in vertex buffer reset code + - clearing the softwara alpha buffer with scissoring was broken + - fixed a few color index mode fog bugs + - fixed some bad assertions in color index mode + - fixed FX line 'stipple' bug #420091 + - fixed stencil buffer clear width/height typo + - fixed GL error glitches in gl[Client]ActiveTextureARB() + - fixed Windows compilation problem in texutil.c + - fixed 1/8-pixel AA triangle sampling error + Changes: + - optimized writing mono-colored pixel spans to X pixmaps + - increased max viewport size to 2048 x 2048 + + +3.5 June 21, 2001 + New: + - internals of Mesa divided into modular pieces (Keith Whitwell) + - 100% OpenGL 1.2 conformance (passes all conformance tests) + - new AA line algorithm + - GL_EXT_convolution extension + - GL_ARB_imaging subset + - OSMesaCreateContextExt() function + - GL_ARB_texture_env_add extension (same as GL_EXT_texture_env_add) + - GL_MAX_TEXTURE_UNITS_ARB now defaults to eight + - GL_EXT_fog_coord extension (Keith Whitwell) + - GL_EXT_secondary_color extension (Keith Whitwell) + - GL_ARB_texture_env_add extension (same as GL_EXT_texture_env_add) + - GL_SGIX_depth_texture extension + - GL_SGIX_shadow and GL_SGIX_shadow_ambient extensions + - demos/shadowtex.c demo of GL_SGIX_depth_texture and GL_SGIX_shadow + - GL_ARB_texture_env_combine extension + - GL_ARB_texture_env_dot3 extension + - GL_ARB_texture_border_clamp (aka GL_SGIS_texture_border_clamp) + - OSMesaCreateContextExt() function + - libOSMesa.so library, contains the OSMesa driver interface + - GL/glxext.h header file for GLX extensions + - somewhat faster software texturing, fogging, depth testing + - all color-index conformance tests now pass (only 8bpp tested) + - SPARC assembly language TCL optimizations (David Miller) + - GL_SGIS_generate_mipmap extension + Bug Fixes: + - fbiRev and tmuRev were unitialized when using Glide3 + - fixed a few color index mode conformance failures; all pass now + - now appling antialiasing coverage to alpha after texturing + - colors weren't getting clamped to [0,1] before color table lookup + - fixed RISC alignment errors caused by COPY_4UBV macro + - drawing wide, flat-shaded lines could cause a segfault + - vertices now snapped to 1/16 pixel to fix rendering of tiny triangles + Changes: + - SGI's Sample Implementation (SI) 1.3 GLU library replaces Mesa GLU + - new libOSMesa.so library, contains the OSMesa driver interface + + +4.0 October 22, 2001 + New: + - Mesa 4.0 implements the OpenGL 1.3 specification + - GL_IBM_rasterpos_clip extension + - GL_EXT_texture_edge_clamp extension (aka GL_SGIS_texture_edge_clamp) + - GL_ARB_texture_mirrored_repeat extension + - WindML UGL driver (Stephane Raimbault) + - added OSMESA_MAX_WIDTH/HEIGHT queries + - attempted compiliation fixes for Solaris 5, 7 and 8 + - updated glext.h and glxext.h files + - updated Windows driver (Karl Schultz) + Bug fixes: + - added some missing GLX 1.3 tokens to include/GL/glx.h + - GL_COLOR_MATRIX changes weren't recognized by teximage functions + - glCopyPixels with scale and bias was broken + - glRasterPos with lighting could segfault + - glDeleteTextures could leave a dangling pointer + - Proxy textures for cube maps didn't work + - fixed a number of 16-bit color channel bugs + - fixed a few minor memory leaks + - GLX context sharing was broken in 3.5 + - fixed state-update bugs in glPopClientAttrib() + - fixed glDrawRangeElements() bug + - fixed a glPush/PopAttrib() bug related to texture binding + - flat-shaded, textured lines were broken + - fixed a dangling pointer problem in the XMesa code (Chris Burghart) + - lighting didn't always produce the correct alpha value + - fixed 3DNow! code to not read past end of arrays (Andrew Lewycky) + + +4.0.1 December 17, 2001 + New: + - better sub-pixel sample positions for AA triangles (Ray Tice) + - slightly faster blending for (GL_ZERO, GL_ONE) and (GL_ONE, GL_ZERO) + Bug fixes: + - added missing break statements in glGet*() for multisample cases + - fixed uninitialized hash table mutex bug (display lists / texobjs) + - fixed bad teximage error check conditional (bug 476846) + - fixed demos readtex.c compilation problem on Windows (Karl Schultz) + - added missing glGet() query for GL_MAX_TEXTURE_LOD_BIAS_EXT + - silence some compiler warnings (gcc 2.96) + - enable the #define GL_VERSION_1_3 in GL/gl.h + - added GL 1.3 and GLX 1.4 entries to gl_mangle.h and glx_mangle.h + - fixed glu.h typedef problem found with MSDev 6.0 + - build libGL.so with -Bsymbolic (fixes bug found with Chromium) + - added missing 'const' to glXGetContextIDEXT() in glxext.h + - fixed a few glXGetProcAddress() errors (texture compression, etc) + - fixed start index bug in compiled vertex arrays (Keith) + - fixed compilation problems in src/SPARC/glapi_sparc.S + - fixed triangle strip "parity" bug found in VTK medical1 demo (Keith) + - use glXGetProcAddressARB in GLUT to avoid extension linking problems + - provoking vertex of flat-shaded, color-index triangles was wrong + - fixed a few display list bugs (GLUT walker, molecule, etc) (Keith) + - glTexParameter didn't flush the vertex buffer (Ray Tice) + - feedback attributes for glDraw/CopyPixels and glBitmap were wrong + - fixed bug in normal length caching (ParaView lighting bug) + - fixed separate_specular color bug found in Chimera (18 Dec 2001) + + +4.0.2 April 2, 2002 + New: + - New DOS (DJGPP) driver written by Daniel Borca + - New driver interface functions for TCL drivers (such as Radeon DRI) + - GL_RENDERER string returns "Mesa Offscreen16" or "Mesa Offscreen32" + if using deep color channels + - latest GL/glext.h and GL/glxext.h headers from SGI + Bug fixes: + - GL_BLEND with non-black texture env color wasn't always correct + - GL_REPLACE with GL_RGB texture format wasn't always correct (alpha) + - glTexEnviv( pname != GL_TEXTURE_ENV_COLOR ) was broken + - glReadPixels was sometimes mistakenly clipped by the scissor box + - glDraw/ReadPixels didn't catch all the errors that they should have + - Fixed 24bpp rendering problem in Windows driver (Karl Schultz) + - 16-bit GLchan mode fixes (m_trans_tmp.h, s_triangle.c) + - Fixed 1-bit float->int conversion bug in glDrawPixels(GL_DEPTH_COMP) + - glColorMask as sometimes effecting glXSwapBuffers() + - fixed a potential bug in XMesaGarbageCollect() + - N threads rendering into one window didn't work reliably + - glCopyPixels didn't work for deep color channels + - improved 8 -> 16bit/channel texture image conversion (Gerk Huisma) + - glPopAttrib() didn't correctly restore user clip planes + - user clip planes failed for some perspective projections (Chromium) + Known bugs: + - mipmap LOD computation + + +4.0.3 June 25, 2002 + New: + - updated GL/glext.h file (version 15) + - corrected MMX blend code (Jose Fonseca) + - support for software-based alpha planes in Windows driver + - updated GGI driver (Filip Spacek) + Bug fixes: + - glext.h had wrong values for GL_DOT3_RGB[A]_EXT tokens + - OSMesaMakeCurrent() didn't recognize buffer size changes + - assorted conformance fixes for 16-bit/channel rendering + - texcombine alpha subtraction mode was broken + - fixed lighting bug with non-uniform scaling and display lists + - fixed bug when deleting shared display lists + - disabled SPARC cliptest assembly code (Mesa bug 544665) + - fixed a couple Solaris compilation/link problems + - blending clipped glDrawPixels didn't always work + - glGetTexImage() didn't accept packed pixel types + - glPixelMapu[is]v() could explode given too large of pixelmap + - glGetTexParameter[if]v() didn't accept GL_TEXTURE_MAX_ANISOTROPY_EXT + - glXCopyContext() could lead to segfaults + - glCullFace(GL_FRONT_AND_BACK) didn't work (bug 572665) + Changes: + - lots of C++ (g++) code clean-ups + - lots of T&L updates for the Radeon DRI driver + Known bugs: + - mipmap LOD computation (fixed for Mesa 4.1) + + +4.0.4 October 3, 2002 + New: + - GL_NV_texture_rectangle extension + - updated glext.h header (version 17) + - updated DOS driver (Daniel Borca) + - updated BeOS R5 driver (Philippe Houdoin) + - added GL_IBM_texture_mirror_repeat + - glxinfo now takes -l option to print interesting OpenGL limits info + - GL_MESA_ycbcr_texture extension + - GL_APPLE_client_storage extension (for some DRI drivers only) + - GL_MESA_pack_invert extension + Bug fixes: + - fixed GL_LINEAR fog bug by adding clamping + - fixed FP exceptions found using Alpha CPU + - 3dfx MESA_GLX_FX=window (render to window) didn't work + - fixed memory leak in wglCreateContest (Karl Schultz) + - define GLAPIENTRY and GLAPI if undefined in glu.h + - wglGetProcAddress didn't handle all API functions + - when testing for OpenGL 1.2 vs 1.3, check for GL_ARB_texture_cube_map + - removed GL_MAX_CONVOLUTION_WIDTH/HEIGHT from glGetInteger/Float/etc() + - error checking in compressed tex image functions had some glitches + - fixed AIX compile problem in src/config.c + - glGetTexImage was using pixel unpacking instead of packing params + - auto-mipmap generation for cube maps was incorrect + Changes: + - max texture units reduced to six to accomodate texture rectangles + - removed unfinished GL_MESA_sprite_point extension code + + +4.1 October 29, 2002 + New: + - GL_NV_vertex_program extension + - GL_NV_vertex_program1_1 extension + - GL_ARB_window_pos extension + - GL_ARB_depth_texture extension + - GL_ARB_shadow extension + - GL_ARB_shadow_ambient extension + - GL_EXT_shadow_funcs extension + - GL_ARB_point_parameters extension + - GL_ARB_texture_env_crossbar + - GL_NV_point_sprite extension + - GL_NV_texture_rectangle extension + - GL_EXT_multi_draw_arrays extension + - GL_EXT_stencil_two_side extension + - GLX_SGIX_fbconfig and GLX_SGIX_pbuffer extensions + - GL_ATI_texture_mirror_once extension (Ian Romanick) + - massive overhaul/simplification of software rasterizer module, + many contributions from Klaus Niederkrueger + - faster software texturing in some cases (i.e. trilinear filtering) + - new OSMesaGetProcAddress() function + - more blend modes implemented with MMX code (Jose Fonseca) + - added glutGetProcAddress() to GLUT + - added GLUT_FPS env var to compute frames/second in glutSwapBuffers() + - pbinfo and pbdemo PBuffer programs + - glxinfo -v prints transprent pixel info (Gerd Sussner) + Bug fixes: + - better mipmap LOD computation (prevents excessive blurriness) + - OSMesaMakeCurrent() didn't recognize buffer size changes + - assorted conformance fixes for 16-bit/channel rendering + - texcombine alpha subtraction mode was broken + - fixed some blend problems when GLchan==GLfloat (Gerk Huisma) + - clamp colors to [0,inf] in OSMesa if GLchan==GLfloat (Gerk Huisma) + - fixed divide by zero error in NURBS tessellator (Jon Perry) + - fixed GL_LINEAR fog bug by adding clamping + - fixed FP exceptions found using Alpha CPU + - 3dfx/glide driver render-to-window feature was broken + - added missing GLX_TRANSPARENT_RGB token to glx.h + - fixed error checking related to paletted textures + - fixed reference count error in glDeleteTextures (Randy Fayan) + Changes: + - New spec file and Python code to generate some GL dispatch files + - Glide driver defaults to "no" with autoconf/automake + - updated demos/stex3d with new options + + +5.0 November 13, 2002 + New: + - OpenGL 1.4 support (glGetString(GL_VERSION) returns "1.4") + - removed some overlooked debugging code + - glxinfo updated to support GLX_ARB_multisample + - GLUT now support GLX_ARB_multisample + - updated DOS driver (Daniel Borca) + Bug fixes: + - GL_POINT and GL_LINE-mode polygons didn't obey cull state + - fixed potential bug in _mesa_align_malloc/calloc() + - fixed missing triangle bug when running vertex programs + - fixed a few HPUX compilation problems + - FX (Glide) driver didn't compile + - setting GL_TEXTURE_BORDER_COLOR with glTexParameteriv() didn't work + - a few EXT functions, like glGenTexturesEXT, were no-ops + - a few OpenGL 1.4 functions like glFogCoord*, glBlendFuncSeparate, + glMultiDrawArrays and glMultiDrawElements were missing + - glGet*(GL_ACTIVE_STENCIL_FACE_EXT) was broken + - Pentium 4 Mobile was mistakenly identified as having 3DNow! + - fixed one-bit error in point/line fragment Z calculation + - fixed potential segfault in fakeglx code + - fixed color overflow problem in DOT3 texture env mode + + +5.0.1 March 30, 2003 + New: + - DOS driver updates from Daniel Borca + - updated GL/gl_mangle.h file (Bill Hoffman) + Bug fixes: + - auto mipmap generation for cube maps was broken (bug 641363) + - writing/clearing software alpha channels was unreliable + - minor compilation fixes for OS/2 (Evgeny Kotsuba) + - fixed some bad assertions found with shadowtex demo + - fixed error checking bug in glCopyTexSubImage2D (bug 659020) + - glRotate(angle, -x, 0, 0) was incorrect (bug 659677) + - fixed potential segfault in texture object validation (bug 659012) + - fixed some bogus code in _mesa_test_os_sse_exception_support (Linus) + - fix fog stride bug in tnl code for h/w drivers (Michel Danzer) + - fixed glActiveTexture / glMatrixMode(GL_TEXTURE) bug (#669080) + - glGet(GL_CURRENT_SECONDARY_COLOR) should return 4 values, not 3 + - fixed compilation problem on Solaris7/x86 (bug 536406) + - fixed prefetch bug in 3DNow! code (Felix Kuhling) + - fixed NeXT build problem (FABSF macro) + - glDrawPixels Z values when glPixelZoom!=1 were invalid (bug 687811) + - zoomed glDraw/CopyPixels with clipping sometimes failed (bug 689964) + - AA line and triangle Z values are now rounded, not truncated + - fixed color interpolation bug when GLchan==GLfloat (bug 694461) + - glArePrograms/TexturesResident() wasn't 100% correct (Jose Fonseca) + - fixed a minor GL_COLOR_MATERIAL bug + - NV vertex program EXP instruction was broken + - glColorMask misbehaved with X window / pixmap rendering + - fix autoconf/libtool GLU C++ linker problem on Linux (a total hack) + - attempt to fix GGI compilation problem when MesaDemos not present + - NV vertex program ARL-relative fetches didn't work + Changes: + - use glPolygonOffset in gloss demo to avoid z-fighting artifacts + - updated winpos and pointblast demos to use ARB extensions + - disable SPARC normal transformation code (bug 673938) + - GLU fixes for OS/2 (Evgeny Kotsuba) + + +5.0.2 September 5, 2003 + Bug fixes: + - fixed texgen problem causing texcoord's Q to be zero (stex3d) + - default GL_TEXTURE_COMPARE_MODE_ARB was wrong + - GL_CURRENT_MATRIX_NV query was wrong + - GL_CURRENT_MATRIX_STACK_DEPTH_NV query was off by one + - GL_LIST_MODE query wasn't correct + - GL_FOG_COORDINATE_SOURCE_EXT query wasn't supported + - GL_SECONDARY_COLOR_ARRAY_SIZE_EXT query returned wrong value + - blended, wide lines didn't always work correctly (bug 711595) + - glVertexAttrib4svNV w component was always 1 + - fixed bug in GL_IBM_rasterpos_clip (missing return) + - GL_DEPTH_TEXTURE_MODE = GL_ALPHA didn't work correctly + - a few Solaris compilation fixes + - fixed glClear() problem for DRI drivers (non-existant stencil, etc) + - fixed int/REAL mixup in GLU NURBS curve evaluator (Eric Cazeaux) + - fixed delete [] bug in SI GLU (bug 721765) (Diego Santa Cruz) + - glFog() didn't clamp fog colors + - fixed bad float/int conversion for GL_TEXTURE_PRIORITY in the + gl[Get]TexParameteri[v] functions + - fixed invalid memory references in glTexGen functions (bug 781602) + - integer-valued color arrays weren't handled correctly + - glDrawPixels(GL_DEPTH_COMPONENT) with glPixelZoom didn't work + - GL_EXT_texture_lod_bias is part of 1.4, overlooked in 5.0.1 + Changes: + - build GLUT with -fexceptions so C++ apps propogate exceptions + + +5.1 December 17, 2003 + New: + - reorganized directory tree + - GL_ARB_vertex/fragment_program extensions (Michal Krol & Karl Rasche) + - GL_ATI_texture_env_combine3 extension (Ian Romanick) + - GL_SGI_texture_color_table extension (Eric Plante) + - GL_NV_fragment_program extension + - GL_NV_light_max_exponent extension + - GL_EXT_texture_rectangle (identical to GL_NV_texture_rectangle) + - GL_ARB_occlusion_query extension + - GL_ARB_point_sprite extension + - GL_ARB_texture_non_power_of_two extension + - GL_IBM_multimode_draw_arrays extension + - GL_EXT_texture_mirror_clamp extension (Ian Romanick) + - GL_ARB_vertex_buffer_object extension + - new X86 feature detection code (Petr Sebor) + - less memory used for display lists and vertex buffers + - demo of per-pixel lighting with a fragment program (demos/fplight.c) + - new version (18) of glext.h header + - new spriteblast.c demo of GL_ARB_point_sprite + - faster glDrawPixels in X11 driver in some cases (see RELNOTES-5.1) + - faster glCopyPixels in X11 driver in some cases (see RELNOTES-5.1) + Bug fixes: + - really enable OpenGL 1.4 features in DOS driver. + - fixed issues in glDrawPixels and glCopyPixels for very wide images + - glPixelMapf/ui/usv()'s size parameter is GLsizei, not GLint + - fixed some texgen bugs reported by Daniel Borca + - fixed wglMakeCurrent(NULL, NULL) bug (#835861) + - fixed glTexSubImage3D z-offset bug (Cedric Gautier) + - fixed RGBA blend enable bug (Ville Syrjala) + - glAccum is supposed to be a no-op in selection/feedback mode + - fixed texgen bug #597589 (John Popplewell) + Changes: + - dropped API trace feature (src/Trace/) + - documentation overhaul. merged with website content. more html. + - glxgears.c demo updated to use GLX swap rate extensions + - glTexImage1/2/3D now allows width/height/depth = 0 + - disable SPARC asm code on Linux (bug 852204) + + +6.0 January 16, 2004 + New: + - full OpenGL 1.5 support + - updated GL/glext.h file to version 21 + Changes: + - changed max framebuffer size to 4Kx4K (MAX_WIDTH/HEIGHT in config.h) + Bug fixes: + - fixed bug in UNCLAMPED_FLOAT_TO_UBYTE macro; solves a color + clamping issue + - updated suno5-gcc configs + - glColor3 functions sometimes resulted in undefined alpha values + - fixed FP divide by zero error seen on VMS with xlockmore, others + - fixed vertex/fragment program debug problem (bug 873011) + - building on AIX with gcc works now + - glDeleteProgramsARB failed for ARB fragment programs (bug 876160) + - glDrawRangeElements tried to modify potentially read-only storage + - updated files for building on Windows + + +6.0.1 April 2, 2004 + New: + - upgraded glext.h to version 22 + - new build targets (Dan Schikore) + - new linux-x86-opteron build target (Heath Feather) + Bug fixes: + - glBindProgramARB didn't update all necessary state + - fixed build problems on OpenBSD + - omit CVS directories from tarballs + - glGetTexImage(GL_COLOR_INDEX) was broken + - fixed an infinite loop in t&l module + - silenced some valgrind warnings about using unitialized memory + - fixed some compilation/link glitches on IRIX (Mike Stephens) + - glBindProgram wasn't getting compiled into display lists + - GLX_FBCONFIG_ID wasn't recognized in glXChooseFBConfig() (bug 888079) + - two-sided lighting and vertex program didn't work (bug 887330) + - stores to program parameter registers in vertex state programs + didn't work. + - fixed glOrtho bug found with gcc 3.2.2 (RH9) + - glXCreateWindow() wasn't fully implemented (bug 890894) + - generic vertex attribute arrays didn't work in display lists + - vertex buffer objects' default usage and access fields were wrong + - glDrawArrays with start!=0 was broken + - fragment program PK2H, UP2H, UP4B and UP4UB instructions were broken + - linux-osmesa16-static config didn't work + - fixed a few color index rendering problems (bug 910687) + - glInterleavedArrays didn't respect GL_CLIENT_ACTIVE_TEXTURE + - OSMesa RGB and BGR modes were broken + - glProgramStringARB mistakenly required a null-terminated string + - fragment program XPD instruction was incorrect + - glGetMaterial() didn't work reliably + - ARB_fragment_program KIL instruction was incorrect + + +6.1 August 18, 2004 + New: + - Revamped Makefile system + - glXUseRotatedXFont() utility (see xdemos/xuserotfont.c) + - internal driver interface changes related to texture object + allocation, vertex/fragment programs, BlendEquationSeparate, etc. + - option to walk triangle edges with double-precision floats + (Justin Novosad of Discreet) (see config.h file) + - support for AUX buffers in software GLX driver + - updated glext.h to version 24 and glxext.h to version 6 + - new MESA_GLX_FORCE_ALPHA and MESA_GLX_DEPTH_BITS env vars + - updated BeOS support (Philippe Houdoin) + Changes: + - fragment fog interpolation is perspective corrected now + - new glTexImage code, much cleaner, may be a bit faster + Bug fixes: + - glArrayElement in display lists didn't handle generic vertex attribs + - glFogCoord didn't always work properly + - ARB_fragment_program fog options didn't work + - frag prog TEX instruction no longer incorrectly divides s,t,r by q + - ARB frag prog TEX and TEXP instructions now use LOD=0 + - glTexEnviv in display lists didn't work + - glRasterPos didn't do texgen or apply texture matrix + - GL_DOUBLE-valued vertex arrays were broken in some cases + - fixed texture rectangle edge/border sampling bugs + - sampling an incomplete texture in a fragment program would segfault + - glTexImage was missing a few error checks + - fixed some minor glGetTexParameter glitches + - GL_INTENSITY was mistakenly accepted as a to glTexImage + - fragment program writes to RC/HC register were broken + - fixed a few glitches in GL_HP_occlusion_test extension + - glBeginQueryARB and glEndQueryARB didn't work inside display lists + - vertex program state references were broken + - fixed triangle color interpolation bug on AIX (Shane Blackett) + - fixed a number of minor memory leaks (bug #1002030) + + +6.2 October 2, 2004 + New: + - enabled GL_ARB_texture_rectangle (same as GL_NV_texture_rectangle) + - updated Doxygen support (Jose Fonseca) + Changes: + - some GGI driver updates (Christoph Egger, bug 1025977) + Bug fixes: + - Omit GL_ARB_texture_non_power_of_two from list of OpenGL 1.5 features + - fixed a few compilation issues on IRIX + - fixed a matrix classification bug (reported by Wes Bethel) + - we weren't reseting the vertex/fragment program error state + before parsing (Dave Reveman) + - adjust texcoords for sampling texture rectangles (Dave Reveman) + - glGet*(GL_MAX_VERTEX_ATTRIBS_ARB) wasn't implemented + - repeated calls to glDeleteTexture(t) could lead to a crash + - fixed potential ref count bugs in VBOs and vertex/fragment programs + - spriteblast demo didn't handle window size changes correctly + - glTexSubImage didn't handle pixels=NULL correctly for PBOs + - fixed color index mode glDrawPixels bug (Karl Schultz) + + +6.2.1 December 9, 2004 + Bug fixes: + - don't apply regular fog or color sum when using a fragment program + - glProgramEnvParameter4fARB always generated an error on + GL_FRAGMENT_PROGRAM_ARB (fdo bug 1645) + - glVertexAttrib3svNV and glVertexAttrib3svARB were broken + - fixed width/height mix-up in glSeparableFilter2D() + - fixed regression in glCopyPixels + convolution + - glReadPixels from a clipped front color buffer didn't always work + - glTexImage didn't accept GL_RED/GREEN/BLUE as the format + - Attempting queries/accesses of VBO 0 weren't detected as errors + - paletted textures failed if the palette had fewer than 256 entries + Changes: + - fixed a bunch of compiler warnings found with gcc 3.4 + - bug reports should to go bugzilla.freedesktop.org + + +6.3 July 20, 2005 + New: + - GL_EXT_framebuffer_object extension + - GL_ARB_draw_buffers extension + - GL_ARB_pixel_buffer_object extension + - GL_OES_read_format extension (Ian Romanick) + - DirectFB driver (Claudio Ciccani) + - x86_64 vertex transformation code (Mikko T.) + - Updated GL/glext.h to version 29 + Changes: + - added -stereo option for glxgears demo (Jacek Rosik) + - updated the PBuffer demo code in xdemos/ directory + - glDeleteTextures/Programs/Buffers() now makes the object ID + available for immediate re-use + - assorted 64-bit clean-ups fixes (x86_64 and Win64) + - lots of internal changes for GL_EXT_framebuffer_object + Bug fixes: + - some functions didn't support PBO functionality + - glGetTexImage didn't convert color index images to RGBA as required + - fragment program texcoords were sometimes wrong for points and lines + - fixed problem with negative dot product in arbfplight, fplight demos + - fixed bug in perspective correction of antialiased, textured lines + - querying GL_POST_CONVOLUTION_ALPHA_BIAS_EXT returned wrong value + - fixed a couple per-pixel fog bugs (Soju Matsumoto) + - glGetBooleanv(GL_FRAGMENT_PROGRAM_BINDING_NV) was broken + - fixed float parsing bug in ARB frag/vert programs (bug 2520) + - XMesaGetDepthBuffer() returned incorrect value for bytesPerValue + - GL_COLOR_MATERIAL with glColor3 didn't properly set diffuse alpha + - glXChooseFBConfig() crashed if attribList pointer was NULL + - program state.light[n].spot.direction.w was wrong value (bug 3083) + - fragment program fog option required glEnable(GL_FOG) - wrong. + - glColorTable() could produce a Mesa implementation error (bug 3135) + - RasterPos could get corrupted by color index rendering path + - Removed bad XTranslateCoordinates call when rendering to Pixmaps + - glPopAttrib() didn't properly restore GL_TEXTURE_GEN enable state + - fixed a few Darwin compilation problems + + +6.3.1 + This was an intermediate release for X.org which wasn't otherwise released. + + +6.3.2 August 19, 2005 + New: + - The distribution now includes the DRI drivers and GLX code + Changes: + - Made the DRI "new" driver interface standard, remove old code + Bug fixes: + - GL_ARB_vertex/fragment_shader were mistakenly listed in the + extensions string + - negative relative addressing in vertex programs was broken + - update/fix SPARC assembly code for vertex transformation + - fixed memory leak when freeing GLX drawables/renderbuffers + - fixed display list memory leak + - the GL_PIXEL_MAP_I_TO_I table is now floating point, not integer + - wglGetProcAddress() didn't handle wgl-functions + - fixed glxext.h cross-compile issue (Colin Harrison) + - assorted DRI driver fixes + + +6.4 October 24, 2005 + New: + - Added a fast XOR line drawing function in Xlib driver + - Added support for GL_ARB_texture_mirrored_repeat to savage + driver (supported only on Savage4 hardware). + Changes: + - Mesa now packaged in three parts: Library, Demos and GLUT + Bug fixes: + - GLX_X_RENDERABLE token wasn't accepted by glXChooseFBConfig + - Some files were present multiple times in the 6.3.2 tarballs + - r200_vtxtmp_x86.S file was missing from 6.3.2 tarball (bug 4207) + - glxgears_fbconfig demo didn't work (bug 4237) + - fixed bug when bilinear sampling 2d textures with borders + - glXCreatePbuffer() could segfault instead of returning 0 (bug 4235) + - fixed undefined frexp and rand in X.org libGLcore.a (bug 4242) + - fixed a few problems with proxy color tables (bug 4270) + - fixed precision problem in Z clearing (bug 4395) + - glBitmap, glDraw/CopyPixels mistakenly generated selection hits + - fixed potential segfault caused by reading pixels outside + of renderbuffer bounds + - glGetTexLevelParameter didn't accept GL_TEXTURE_DEPTH_SIZE_ARB + - fixed memory corruption bug involving software alpha buffers + - glReadPixels clipped by window bounds was sometimes broken + - glDraw/CopyPixels of stencil data ignored the stencil write mask + - glReadPixels from a texture bound to a framebuffer object didn't work + - glIsRender/FramebufferEXT weren't totally correct + - fixed a number of point size attenuation/fade bugs + - fixed glFogCoord bug 4729 + - GLX encoding for transpose matrix functions was broken + - fixed broken fragment program KIL and SWZ instructions + - fragment programs that wrote result.depth.z didn't work + + +6.4.1 November 30, 2005 + Bug fixes: + - redefining a vertex program string didn't take effect in TNL module + - fixed occasional segfault upon vertex/fragment parsing error + - vertex program LIT instruction didn't handle 0^0=1 correctly + - fragment program fog option didn't work with glDrawPixels, glBitmap + - USE_MGL_NAMESPACE didn't work for x86-64 + - OSMesa demos were missing from previous release tarballs + - fixed problem with float->ushort conversion in glClear (bug 4992) + - popping of GL_EYE_PLANE texgen state was broken (bug 4996) + - popping of GL_SPOT_DIRECTION light state was broken (bug 5005) + - fixed occasional triangle color interpolation problem on VMS + - work around invalid free() call (bug 5131) + - fixed BSD X server compilation problem by including stdint.h + + +6.4.2 February 2, 2006 + New: + - added OSMesaColorClamp() function/feature + - added wglGetExtensionStringARB() function + Bug fixes: + - fixed some problems when building on Windows + - GLw header files weren't installed by installmesa script (bug 5396) + - GL/glfbdev.h file was missing from tarballs + - fixed TNL initialization bug which could lead to crash (bug 5791) + + +6.5 March 31, 2006 + New: + - OpenGL Shading Language support through GL_ARB_shader_objects, + GL_ARB_shading_language_100, GL_ARB_vertex_shader and + GL_ARB_fragment_shader (done by Michal Krol) + - GL_EXT_packed_depth_stencil extension + - GL_EXT_timer_query extension + - GL_EXT_framebuffer_blit extension + - GL_ARB_half_float_pixel + - reflect demo improved to support multiple windows + - singlebuffer demo (shows no/little-flicker single-buffered rendering) + - r200: enable GL_ARB_texture_env_crossbar, separate the texture + sampling unit bits from the texture env combine enable bits + - r200: add support for GL_ATI_fragment_shader + - added fast XOR-mode line drawing optimization + - radeon: add support for all 3 tmus, GL_ARB_texture_cube_map + and GL_EXT_fog_coord + - MESA_GLX_ALPHA_BITS env var for xlib driver + - many DRI driver updates (including screen rotation support + for the Intel DRI driver) + Changes: + - removed GL_HP_occlusion_test (use GL_ARB_occlusion_query instead) + - removed GL_SGIX/SGIS_pixel_texture extensions + Bug fixes: + - fixed glxcontextmodes.c datatype problem (bug 5835) + - fixed aix-gcc build/install bugs (bug 5874) + - fixed some bugs in texture env program generation + - glXCopyContext() didn't handle texture object bindings properly + - glXCopyContext() didn't copy all lighting state + - fixed FreeBSD config (Pedro Giffuni) + - fixed some minor framebuffer object bugs + - replaced dprintf() with _glu_printf() in GLU (bug 6244) + - fixed a number of thread safety bugs/regressions + - fixed a number of GLU tesselator bugs (John Shell, bug 6339) + - paletted texturing was broken w/ floating point palettes (K. Schultz) + - lots of assorted framebuffer object bug fixes + +6.5.1 August 31, 2006 + New: + - Intel i965 DRI driver + - GL_APPLE_vertex_array_object extension (Ian Romanick) + - GL_EXT_texture_sRGB extension + - GL_EXT_gpu_program_parameters (Ian Romanick) + - "engine" demo + - updated fbdev driver and GLUT for fbdev (Sean D'Epagnier) + - many updates to the DRI drivers + Changes: + - The glVertexAttribARB functions no longer alias the conventional + vertex attributes. + - glxinfo program prints more info with -l option + - GL_FRAGMENT_PROGRAM_NV and GL_FRAGMENT_PROGRAM_ARB are now + compatible, in terms of glBindProgramARB() + Bug fixes: + - fixed broken texture border handling for depth textures (bug 6498) + - removed the test for duplicated framebuffer attachments, per + version 117 of the GL_EXT_framebuffer_object specification + - fixed a few render-to-texture bugs, including render to depth texture + - clipping of lines against user-defined clip planes was broken (6512) + - assembly language dispatch for SPARC was broken (bug 6484) + - assorted compilation fixes on various Unix platforms (Dan Schikore) + - glPopAttrib could restore an invalid value for GL_DRAW_BUFFER + - assorted minor fixes for 16 and 32 bit/channel modes + - fixed assorted bugs in texture compression paths + - fixed indirect rendering vertex array crashes (bug 6863) + - glDrawPixels GL_INDEX_OFFSET didn't always work + - fixed convolution memory leak (bug 7077) + - rectangular depth textures didn't work + - invalid mode to glBegin didn't generate an error (bug 7142) + - 'normalized' parameter to glVertexAttribPointerARB didn't work + - disable bogus GLX_SGI_video_sync extension in xlib driver + - fixed R128 driver locking bug (Martijn van Oosterhout) + - using evaluators with vertex programs caused crashes (bug 7564) + - fragment.position wasn't set correctly for point/line primitives + - fixed parser bug for scalar sources for GL_NV_fragment_program + - max fragment program length was incorrectly 128, now 1024 + - writes to result.depth in fragment programs weren't clamped to [0,1] + - fixed potential dangling pointer bug in glBindProgram() + - fixed some memory leaks (and potential crashes) in Xlib driver --- mesa-glw-7.4.orig/docs/mesa.css +++ mesa-glw-7.4/docs/mesa.css @@ -0,0 +1,33 @@ +/* Mesa CSS */ +body { + background-color: #ffffff; + font: 14px 'Lucida Grande', Geneva, Arial, Verdana, sans-serif; + color: black; + link: #111188; +} + +h1 { + font: 24px 'Lucida Grande', Geneva, Arial, Verdana, sans-serif; + font-weight: bold; + color: black; +} + +h2 { + font: 18px 'Lucida Grande', Geneva, Arial, Verdana, sans-serif, bold; + font-weight: bold; + color: black; +} + +code { + font-family: monospace; + font-size: 10pt; + color: black; +} + + +pre { + /*font-family: monospace;*/ + font-size: 10pt; + /*color: black;*/ +} + --- mesa-glw-7.4.orig/debian/copyright +++ mesa-glw-7.4/debian/copyright @@ -0,0 +1,193 @@ +This package was debianized by James A. Treacy treacy@debian.org on Thu, +6 Jan 2000 01:11:34 -0500. It was newly debianized by Marcelo E. +Magallon on Sat, 25 Dec 2004 14:50:02 -0600. It was +again debianized by Thierry Reding on Sat, 14 Oct 2006 +02:01:12 +0200. + +It was downloaded from http://www.mesa3d.org/download.html + +For more information see: + + http://www.mesa3d.org/ + +Copyright: + +Upstream Author: Brian Paul + +License: + + License / Copyright Information + + The Mesa distribution consists of several components. Different + copyrights and licenses apply to different components. For + example, GLUT is copyrighted by Mark Kilgard, some demo programs + are copyrighted by SGI, some of the Mesa device drivers are + copyrighted by their authors. See below for a list of Mesa's + components and the copyright/license for each. + + The core Mesa library is licensed according to the terms of the + XFree86 copyright (an MIT-style license). This allows integration + with the XFree86/DRI project. Unless otherwise stated, the Mesa + source code and documentation is licensed as follows: + + Copyright (C) 1999-2003 Brian Paul All Rights Reserved. + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + Attention, Contributors + + When contributing to the Mesa project you must agree to relinquish + your work to the holder of the copyright for the particular + component you're contributing to. That is, you can't put your own + copyright on the code, unless it's a modular piece that can be + omitted from Mesa (like a new device driver). If for example, you + contribute a bug fix to Mesa's texture mapping code, your code + will become a part of the body of work which is copyrighted by + Brian Paul and licensed by the above terms. + +---------------------------------------------------------------------- + +Some files, as listed below, are made available under the SGI Free B +license. This license is as follows: + +SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + +Copyright (C) [dates of first publication] Silicon Graphics, Inc. All Rights +Reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: +The above copyright notice including the dates of first publication and either +this permission notice or a reference to http://oss.sgi.com/projects/FreeB/ +shall be included in all copies or substantial portions of the Software. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL SILICON GRAPHICS, INC. BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +Except as contained in this notice, the name of Silicon Graphics, Inc. shall +not be used in advertising or otherwise to promote the sale, use or other +dealings in this Software without prior written authorization from Silicon +Graphics, Inc. + +-------------------------------------------------------------------------- + +Some other files listed below are made available from Silicon Graphics, +Inc. under a more liberal, MIT-style license, as follows: + + Permission to use, copy, modify, and distribute this software for + any purpose and without fee is hereby granted, provided that the above + copyright notice appear in all copies and that both the copyright notice + and this permission notice appear in supporting documentation, and that + the name of Silicon Graphics, Inc. not be used in advertising + or publicity pertaining to distribution of the software without specific, + written prior permission. + + THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" + AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE + INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR + FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON + GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, + SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY + KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, + LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF + THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN + ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON + ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE + POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. + + US Government Users Restricted Rights + Use, duplication, or disclosure by the Government is subject to + restrictions set forth in FAR 52.227.19(c)(2) or subparagraph + (c)(1)(ii) of the Rights in Technical Data and Computer Software + clause at DFARS 252.227-7013 and/or in similar or successor + clauses in the FAR or the DOD or NASA FAR Supplement. + Unpublished-- rights reserved under the copyright laws of the + United States. Contractor/manufacturer is Silicon Graphics, + Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. + +-------------------------------------------------------------------------- + + Mesa Component Licenses: + + Component Files Primary Author License + ---------------------------------------------------------------------------- + core Mesa code src/*.[ch] Brian Paul Mesa + include/GL/gl.h + + GLX driver src/X/* Brian Paul Mesa + include/GL/glx.h + include/GL/xmesa.h + + OS/Mesa driver src/OSmesa/* Brian Paul Mesa + include/GL/osmesa.h + + 3Dfx driver src/FX/* David Bucciarelli Mesa + include/GL/fxmesa.h + + BeOS R4 driver mesa/drivers/beos/ Brian Paul Mesa + + MGL driver include/GL/mglmesa.h SciTech, Inc GNU LGPL + + Windows driver mesa/drivers/windows/ Li Wei GNU LGPL + include/GL/wmesa.h + + SVGA driver mesa/drivers/svga/ Brian Paul GNU LGPL + include/GL/svgamesa.h + + DOS driver mesa/drivers/dos/ Charlie Wallace GNU LGPL + include/GL/dosmesa.h + + GGI driver mesa/drivers/ggi/ Uwe Maurer GNU LGPL + include/GL/ggimesa.h + + GLUT src/glut/* Mark Kilgard Mark's copyright + include/GL/*glut*.h + + GLU library src/glu/* Brian Paul GNU LGPL + + SGI GLU library src/glu/sgi/* SGI SGI Free B + include/GL/glu.h + + Ext registry include/GL/glext.h SGI SGI Free B + include/GL/glxext.h + + demo programs progs/demos/* various see source files + + X demos progs/xdemos/* Brian Paul see source files + + SGI demos progs/samples/* SGI SGI MIT-style + + RedBook demos progs/redbook/* SGI SGI MIT-style + + +On Debian systems the full text of the GNU LGPL license is found in +/usr/share/common-licenses/LGPL. + +------------------------------------------------------------------------------ + +The Debian packaging is (C) 2006, Thierry Reding and +is licensed under the GPL, see `/usr/share/common-licenses/GPL'. + --- mesa-glw-7.4.orig/debian/mesa-utils.manpages +++ mesa-glw-7.4/debian/mesa-utils.manpages @@ -0,0 +1,4 @@ +debian/glxdemo.1 +debian/glxgears.1 +debian/glxheads.1 +debian/glxinfo.1 --- mesa-glw-7.4.orig/debian/libglw1-mesa.shlibs +++ mesa-glw-7.4/debian/libglw1-mesa.shlibs @@ -0,0 +1 @@ +libGLw 1 libglw1-mesa | libglw1 --- mesa-glw-7.4.orig/debian/mesa-utils.install +++ mesa-glw-7.4/debian/mesa-utils.install @@ -0,0 +1,4 @@ +usr/bin/glxdemo +usr/bin/glxgears +usr/bin/glxheads +usr/bin/glxinfo --- mesa-glw-7.4.orig/debian/control +++ mesa-glw-7.4/debian/control @@ -0,0 +1,50 @@ +Source: mesa-glw +Section: graphics +Priority: optional +Maintainer: Ubuntu MOTU Developers +XSBC-Original-Maintainer: Debian X Strike Force +Uploaders: Thierry Reding , Julien Cristau , David Nusinow , Brice Goglin +Standards-Version: 3.8.0 +Build-Depends: debhelper (>= 5), quilt (>= 0.40), pkg-config, + libdrm-dev (>= 2.4.4) [!hurd-i386], libx11-dev, xutils-dev, + x11proto-gl-dev (>= 1.4.8), libxxf86vm-dev, + libexpat1-dev, dpkg-dev (>= 1.13.19), libxfixes-dev, + libxdamage-dev, libxext-dev, autoconf, automake, x11proto-dri2-dev (>= 1.99.3) + , lesstif2-dev, libgl1-mesa-dev|libgl-dev +Vcs-Git: git://git.debian.org/git/pkg-xorg/lib/mesa +Vcs-Browser: http://git.debian.org/?p=pkg-xorg/lib/mesa.git +Homepage: http://mesa3d.sourceforge.net/ + +Package: libglw1-mesa +Section: libs +Architecture: any +Depends: ${shlibs:Depends} +Provides: libglw1 +Description: A free implementation of the OpenGL API -- runtime + Mesa is a 3-D graphics library with an API which is very similar to + that of OpenGL. To the extent that Mesa utilizes the OpenGL command + syntax or state machine, it is being used with authorization from + Silicon Graphics, Inc. However, the author makes no claim that Mesa + is in any way a compatible replacement for OpenGL or associated with + Silicon Graphics, Inc. + . + This package provides a simple widgets library, libGLw, which + allows Motif-based applications to embed an OpenGL drawing context. + . + On Linux, this library is also known as libGLw or libGLw.so.1. + +Package: libglw1-mesa-dev +Section: libdevel +Architecture: any +Depends: libglw1-mesa (= ${binary:Version}), libc6-dev, libx11-dev, libxext6, mesa-common-dev (>= 7.4~) +Provides: mesag3-widgets, mesag-widgets-dev, libglw-dev +Conflicts: libglw-dev, libgl1-mesa-swx11-dev (<< 6.5.2-4) +Replaces: libglw-dev +Description: A free implementation of the OpenGL API -- development files + This package provides the development environment required for + compiling programs with the Mesa widgets library, libGLw, which + allows Motif-based applications to embed an OpenGL drawing context. + The headers and static libraries for compiling programs that use this + library are included. + +# vim: tw=0 --- mesa-glw-7.4.orig/debian/glxgears.1 +++ mesa-glw-7.4/debian/glxgears.1 @@ -0,0 +1,29 @@ +.TH glxgears 1 "2006-11-29" +.SH NAME +glxgears \- ``gears'' demo for GLX +.SH SYNOPSIS +.B glxgears +.RI [ options ] +.SH DESCRIPTION +The \fIglxgears\fP program is a port of the ``gears'' demo to GLX. It displays +a set of rotating gears and prints out the frame rate at regular intervals. It +has become quite popular as basic benchmarking tool. +.SH OPTIONS +.TP 8 +.B \-display \fIdisplay\fP +Specify which X display to run on. +.TP 8 +.B \-info +Display OpenGL renderer information. +.TP 8 +.B \-stereo +Use a stereo enabled GLX visual. +.TP 8 +.B \-fullscreen +Run in fullscreen mode. +.SH AUTHOR +glxgears was written by Brian Paul . +.PP +This manual page was written by Thierry Reding , for the +Debian project (but may be used by others). + --- mesa-glw-7.4.orig/debian/libglu1-mesa.install +++ mesa-glw-7.4/debian/libglu1-mesa.install @@ -0,0 +1 @@ +usr/lib/libGLU.so.* --- mesa-glw-7.4.orig/debian/libgl1-mesa-swx11-dev.install +++ mesa-glw-7.4/debian/libgl1-mesa-swx11-dev.install @@ -0,0 +1,2 @@ +usr/lib/libGL.a +usr/lib/libGL.so --- mesa-glw-7.4.orig/debian/libgl1-mesa-glx.install +++ mesa-glw-7.4/debian/libgl1-mesa-glx.install @@ -0,0 +1 @@ +usr/lib/glx/libGL.so.* usr/lib --- mesa-glw-7.4.orig/debian/libosmesa6.shlibs +++ mesa-glw-7.4/debian/libosmesa6.shlibs @@ -0,0 +1,3 @@ +libOSMesa 6 libosmesa6 (>= 6.5.2-1) | libgl1-mesa-glide3 +libOSMesa16 6 libosmesa6 (>= 6.5.2-1) +libOSMesa32 6 libosmesa6 (>= 6.5.2-1) --- mesa-glw-7.4.orig/debian/libgl1-mesa-glx-i686.install +++ mesa-glw-7.4/debian/libgl1-mesa-glx-i686.install @@ -0,0 +1 @@ +usr/lib/glx/i686/cmov/libGL.so.* usr/lib/i686/cmov --- mesa-glw-7.4.orig/debian/libgl1-mesa-swx11-i686.install +++ mesa-glw-7.4/debian/libgl1-mesa-swx11-i686.install @@ -0,0 +1 @@ +usr/lib/i686/cmov/libGL.so.* --- mesa-glw-7.4.orig/debian/watch +++ mesa-glw-7.4/debian/watch @@ -0,0 +1,3 @@ +version=3 +opts="uversionmangle=s/-rc/~rc/" \ +http://sf.net/mesa3d/MesaLib-(.*)\.tar\.gz --- mesa-glw-7.4.orig/debian/libgl1-mesa-swx11.install +++ mesa-glw-7.4/debian/libgl1-mesa-swx11.install @@ -0,0 +1 @@ +usr/lib/libGL.so.* --- mesa-glw-7.4.orig/debian/glxheads.1 +++ mesa-glw-7.4/debian/glxheads.1 @@ -0,0 +1,30 @@ +.TH glxheads 1 "2006-11-29" +.SH NAME +glxheads \- exercise multiple GLX connections +.SH SYNOPSIS +.B glxheads +[\fIdisplay\fP ...] +.SH DESCRIPTION +The \fIglxheads\fP program will try to open GLX connections on multiple X +displays as specified on the command-line. If a connection can be made it will +try to create a direct GLX context (and fallback to using indirect contexts if +that fails) and open a window displaying a spinning green triangle. +.PP +If no display names are specified, \fIglxheads\fP will default to opening a +single local connection on display 0. +.SH EXAMPLE +To open a local connection on display 0 and two remote connections to the +hosts \fImars\fP (display 0) and \fIvenus\fP (display 1), run glxheads with +the following command-line: +.PP +.RS 3n +.nf +$ glxheads :0 mars:0 venus:1 +.fi +.RE +.SH AUTHOR +glxheads was written by Brian Paul . +.PP +This manual page was written by Thierry Reding for the +Debian project (but may be used by others). + --- mesa-glw-7.4.orig/debian/libosmesa6-dev.install +++ mesa-glw-7.4/debian/libosmesa6-dev.install @@ -0,0 +1,7 @@ +usr/include/GL/osmesa.h +usr/lib/libOSMesa.a +usr/lib/libOSMesa.so +usr/lib/libOSMesa16.a +usr/lib/libOSMesa16.so +usr/lib/libOSMesa32.a +usr/lib/libOSMesa32.so --- mesa-glw-7.4.orig/debian/libgl1-mesa-swx11-i686.shlibs +++ mesa-glw-7.4/debian/libgl1-mesa-swx11-i686.shlibs @@ -0,0 +1 @@ +libGL 1 libgl1-mesa-glx | libgl1 --- mesa-glw-7.4.orig/debian/libgl1-mesa-dev.install +++ mesa-glw-7.4/debian/libgl1-mesa-dev.install @@ -0,0 +1,2 @@ +usr/lib/libGL.so +usr/lib/pkgconfig/gl.pc --- mesa-glw-7.4.orig/debian/rules +++ mesa-glw-7.4/debian/rules @@ -0,0 +1,244 @@ +#!/usr/bin/make -f +# debian/rules for the Debian mesa package +# Copyright © 2006 Thierry Reding + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 +unexport LDFLAGS + +CFLAGS = -Wall -g +ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 +else + CFLAGS += -O2 +endif +ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) + NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) + MAKEFLAGS += -j$(NUMJOBS) +endif + +DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH) +DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH) +DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS) +DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) +DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) +DEB_HOST_GNU_CPU ?= $(shell dpkg-architecture -qDEB_HOST_GNU_CPU) +DEB_BUILD_DIR ?= $(CURDIR)/obj-$(DEB_BUILD_GNU_TYPE) +ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE)) + confflags += --build=$(DEB_HOST_GNU_TYPE) +else + confflags += --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE) +endif + +# choose which configurations to build +include debian/scripts/choose-configs + +# build the following configurations by default +CONFIGS = swx11+glu swx11+glu-static + +STAMP_DIR = debian/stamp +STAMP = $(STAMP_DIR)/$(DEB_BUILD_GNU_TYPE) +BUILD_STAMPS = $(addprefix $(STAMP)-build-, $(CONFIGS)) +INSTALL_TARGETS = $(addprefix install-, $(CONFIGS)) + +QUILT_STAMPFN = $(STAMP_DIR)/patch +include /usr/share/quilt/quilt.make + +confflags-common = \ + --disable-glu \ + --disable-glut \ + CFLAGS="$(CFLAGS)" + +DRI_DRIVERS = swrast + +# hurd doesn't do direct rendering +ifeq ($(DEB_HOST_ARCH_OS), hurd) + DIRECT_RENDERING = --disable-driglx-direct +else + DIRECT_RENDERING = --enable-driglx-direct + ifeq ($(DEB_HOST_ARCH), lpia) + DRI_DRIVERS += i915 i965 + else + DRI_DRIVERS += mach64 mga r128 r200 r300 radeon s3v savage tdfx trident + ifeq ($(DEB_HOST_GNU_CPU), i486) + DRI_DRIVERS += i810 i915 i965 sis unichrome + else ifeq ($(DEB_HOST_GNU_CPU), x86_64) + DRI_DRIVERS += i915 i965 sis unichrome + else ifeq ($(DEB_HOST_ARCH), sparc) + DRI_DRIVERS += ffb + endif + endif +endif + +confflags-dri = \ + --with-driver=dri \ + --with-dri-drivers="$(DRI_DRIVERS)" \ + --with-demos=xdemos \ + --libdir=/usr/lib/glx \ + --with-dri-driverdir=/usr/lib/dri \ + --enable-glx-tls \ + $(DIRECT_RENDERING) \ + $(confflags-common) + +confflags-osmesa = \ + --with-driver=osmesa \ + --with-demos= \ + $(confflags-common) + +confflags-osmesa-static = \ + --with-driver=osmesa \ + --enable-static \ + --with-demos= \ + $(confflags-common) + +confflags-osmesa16 = \ + --with-driver=osmesa \ + --with-osmesa-bits=16 \ + --with-demos= \ + $(confflags-common) + +confflags-osmesa16-static = \ + --with-driver=osmesa \ + --with-osmesa-bits=16 \ + --enable-static \ + --with-demos= \ + $(confflags-common) + +confflags-osmesa32 = \ + --with-driver=osmesa \ + --with-osmesa-bits=32 \ + --with-demos= \ + $(confflags-common) + +confflags-osmesa32-static = \ + --with-driver=osmesa \ + --with-osmesa-bits=32 \ + --enable-static \ + --with-demos= \ + $(confflags-common) + +confflags-swx11+glu = \ + --with-driver=xlib \ + --disable-gl-osmesa \ + --with-demos= \ + --disable-glut \ + CFLAGS="$(CFLAGS)" + +confflags-swx11+glu-static = \ + --with-driver=xlib \ + --disable-gl-osmesa \ + --enable-static \ + --with-demos= \ + --disable-glut \ + CFLAGS="$(CFLAGS)" + +confflags-swx11+glu-i386-i686 = \ + --with-driver=xlib \ + --disable-gl-osmesa \ + --with-demos= \ + --disable-glut \ + --disable-glw \ + --libdir=/usr/lib/i686/cmov \ + CFLAGS="$(CFLAGS) -march=i686" + +configure: $(QUILT_STAMPFN) configure.ac + autoreconf -vfi + +# list the configurations that will built +configs: + @echo Building the following configurations: $(CONFIGS) + +$(STAMP_DIR)/stamp: + dh_testdir + mkdir -p $(STAMP_DIR) + >$@ + +$(QUILT_STAMPFN): $(STAMP_DIR)/stamp + +build: $(BUILD_STAMPS) + +$(STAMP)-build-%: configure + dh_testdir + + mkdir -p $(DEB_BUILD_DIR)/$* + find $(CURDIR)/* -maxdepth 0 -not -path '$(DEB_BUILD_DIR)*' | \ + xargs cp -rlf -t $(DEB_BUILD_DIR)/$* + cd $(DEB_BUILD_DIR)/$* && \ + ../../configure --prefix=/usr --mandir=\$${prefix}/share/man \ + --infodir=\$${prefix}/share/info --sysconfdir=/etc \ + --localstatedir=/var $(confflags) $(confflags-$*) + cd $(DEB_BUILD_DIR)/$* && $(MAKE) + + touch $@ + +install: + # Add here commands to install the package into debian/tmp + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + $(MAKE) -f debian/rules $(INSTALL_TARGETS) + +install-%: $(STAMP)-build-% + cd $(DEB_BUILD_DIR)/$* && $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install + touch $@ + +clean: unpatch + dh_testdir + dh_testroot + rm -rf .pc + + rm -f config.cache config.log config.status + rm -f */config.cache */config.log */config.status + rm -f conftest* */conftest* + rm -rf autom4te.cache */autom4te.cache + rm -rf obj-* + rm -rf configure config.guess config.sub config.h.in + rm -rf $$(find -name Makefile.in) + rm -rf aclocal.m4 missing depcomp install-sh ltmain.sh + rm -rf $(STAMP_DIR) + + dh_clean + +# Build architecture-independent files here. +binary-indep: install +# dh_testdir +# dh_testroot +# dh_installchangelogs -i +# dh_installdocs -i +# dh_installexamples -i +# dh_install --sourcedir=debian/tmp --list-missing -i +# dh_installman -i +# dh_link -i +# dh_compress -i +# dh_fixperms -i +# dh_installdeb -i +# dh_gencontrol -i +# dh_md5sums -i +# dh_builddeb -i + +# Build architecture-dependent files here. +binary-arch: install + dh_testdir + dh_testroot + dh_installchangelogs -s + dh_installdocs -s + dh_installexamples -s + dh_install -s --sourcedir=debian/tmp + dh_installman -s + dh_link -s +# dh_strip -plibgl1-mesa-swx11 --dbg-package=libgl1-mesa-swx11-dbg +# dh_strip -plibgl1-mesa-glx --dbg-package=libgl1-mesa-glx-dbg +# dh_strip -plibgl1-mesa-dri --dbg-package=libgl1-mesa-dri-dbg + dh_strip -s + dh_compress -s + dh_fixperms -s + dh_makeshlibs -s + dh_installdeb -s + dh_shlibdeps -s + dh_gencontrol -s + dh_md5sums -s + dh_builddeb -s -- -Zlzma + +binary: binary-indep binary-arch +.PHONY: configs build clean binary-indep binary-arch binary install --- mesa-glw-7.4.orig/debian/libglu1-mesa.shlibs +++ mesa-glw-7.4/debian/libglu1-mesa.shlibs @@ -0,0 +1 @@ +libGLU 1 libglu1-mesa | libglu1 --- mesa-glw-7.4.orig/debian/libgl1-mesa-dri.install +++ mesa-glw-7.4/debian/libgl1-mesa-dri.install @@ -0,0 +1 @@ +usr/lib/dri/*.so --- mesa-glw-7.4.orig/debian/glxinfo.1 +++ mesa-glw-7.4/debian/glxinfo.1 @@ -0,0 +1,41 @@ +.TH glxinfo 1 "2006-11-29" +.SH NAME +glxinfo \- show information about the GLX implementation +.SH SYNOPSIS +.B glxinfo +.RI [ options ] +.SH DESCRIPTION +The \fIglxinfo\fP program shows information about the OpenGL and GLX +implementations running on a given X display. +.PP +The information includes details about the server- and client-side GLX +implementation, the OpenGL and GLU implementations as well as a list +of available GLX visuals. +.SH OPTIONS +.TP 8 +.B \-v +Print visuals info in verbose form. +.TP 8 +.B \-t +Print verbose table. +.TP 8 +.B \-display \fIdisplay\fP +Specify the X display to interrogate. +.TP 8 +.B \-h +Print usage information. +.TP 8 +.B \-i +Force an indirect rendering context. +.TP 8 +.B \-b +Find the "best" visual and print its number. +.TP 8 +.B \-l +Print interesting OpenGL limits. +.SH AUTHOR +glxinfo was written by Brian Paul . +.PP +This manual page was written by Thierry Reding , for the +Debian project (but may be used by others). + --- mesa-glw-7.4.orig/debian/libgl1-mesa-swx11.shlibs +++ mesa-glw-7.4/debian/libgl1-mesa-swx11.shlibs @@ -0,0 +1 @@ +libGL 1 libgl1-mesa-glx | libgl1 --- mesa-glw-7.4.orig/debian/libgl1-mesa-glx.shlibs +++ mesa-glw-7.4/debian/libgl1-mesa-glx.shlibs @@ -0,0 +1 @@ +libGL 1 libgl1-mesa-glx | libgl1 --- mesa-glw-7.4.orig/debian/compat +++ mesa-glw-7.4/debian/compat @@ -0,0 +1 @@ +5 --- mesa-glw-7.4.orig/debian/libglw1-mesa.install +++ mesa-glw-7.4/debian/libglw1-mesa.install @@ -0,0 +1 @@ +usr/lib/libGLw.so.* --- mesa-glw-7.4.orig/debian/mesa-common-dev.docs +++ mesa-glw-7.4/debian/mesa-common-dev.docs @@ -0,0 +1,8 @@ +docs/bugs.html +docs/debugging.html +docs/envvars.html +docs/faq.html +docs/osmesa.html +docs/RELNOTES-* +docs/relnotes* +docs/*.spec --- mesa-glw-7.4.orig/debian/glxdemo.1 +++ mesa-glw-7.4/debian/glxdemo.1 @@ -0,0 +1,15 @@ +.TH glxdemo 1 "2006-11-29" +.SH NAME +glxdemo \- a demonstration of the GLX functions +.SH SYNOPSIS +.B glxdemo +.SH DESCRIPTION +The \fIglxdemo\fP program shows how to use the GLX functions in order to +create an OpenGL program running on top of an X server. This program is most +useful when studied in its source code form. +.SH AUTHOR +glxdemo was written by Brian Paul . +.PP +This manual page was written by Thierry Reding , for the +Debian project (but may be used by others). + --- mesa-glw-7.4.orig/debian/libglu1-mesa-dev.install +++ mesa-glw-7.4/debian/libglu1-mesa-dev.install @@ -0,0 +1,4 @@ +usr/include/GL/glu.h +usr/include/GL/glu_mangle.h +usr/lib/libGLU.a +usr/lib/libGLU.so --- mesa-glw-7.4.orig/debian/libglw1-mesa-dev.install +++ mesa-glw-7.4/debian/libglw1-mesa-dev.install @@ -0,0 +1,3 @@ +usr/include/GL/GLw*A.h +usr/lib/libGLw.a +usr/lib/libGLw.so --- mesa-glw-7.4.orig/debian/libgl1-mesa-dri-i686.install +++ mesa-glw-7.4/debian/libgl1-mesa-dri-i686.install @@ -0,0 +1 @@ +usr/lib/dri/i686/cmov/*.so --- mesa-glw-7.4.orig/debian/changelog +++ mesa-glw-7.4/debian/changelog @@ -0,0 +1,1841 @@ +mesa-glw (7.4-0ubuntu2) jaunty; urgency=low + + * Fix versioned dependency on mesa-common-dev. + + -- Morten Kjeldgaard Sun, 05 Apr 2009 20:08:09 +0200 + +mesa-glw (7.4-0ubuntu1) jaunty; urgency=low + + * This is a special edition of the mesa package that + splits out the GLw packages for Universe, since these have + been removed from Ubuntu/main. Changes relative to + the native Debian mesa source package are the following: + * debian/control: + - Introduce new source package name: mesa-glw + - Delete all packages except libglw1-mesa and libglw1-mesa-dev + - Add dependency on libgl1-mesa-dev|libgl-dev + - Maintainer field ubuntufication + * debian/changelog: change name of source package + * debian/rules: not building any indep packages, so binary-indep + target is neutralized. Comment out dh_strip calls to build + debug packages. Do not check for missing files, because we know + there are lots, and it makes the build fail. Only build config targets + swx11+glu & swx11+glu-static. Remove --disable-glw from + confflags-swx11+glu and confflags-swx11+glu-static. + + * Closes LP: #332236, #355030. + + -- Morten Kjeldgaard Sun, 05 Apr 2009 11:42:26 +0200 + +mesa (7.4-0ubuntu1) jaunty; urgency=low + + * New upstream release, merge from debian-experimental + (LP: #330476, #347171, #349127) + * Drop 103_rs600_support.patch, included in this version. + * Drop 104_swrast_fbconfigs.patch, included in this version. + * Add 103_bump_965_texture_limit.diff. (LP: #146298) + * Add 104_fix_dri2_ext_tfp.diff. (LP: #324854) + + -- Timo Aaltonen Fri, 03 Apr 2009 12:42:06 +0300 + +mesa (7.4~rc1-1) experimental; urgency=low + + * New upstream release candidate. + * Fix watch file to make uscan not consider release candidates as newer than + actual releases. + * debian/control: add lpia to the Architecture field for + libgl1-mesa-dri{,-dbg} to match Ubuntu. + * debian/rules: on lpia, only build the i915 and i965 dri drivers (based on + Ubuntu changes). + * Build-depend on linux-libc-dev >= 2.6.29 on linux archs. + + -- Julien Cristau Wed, 25 Mar 2009 11:34:42 +0100 + +mesa (7.3-1ubuntu4) jaunty; urgency=low + + * Backport 104_swrast_fbconfigs.patch from mesa git. + - Properly assigns an fbconfig for the root visual. This fixes + issues with MythTV not being able to show fonts when using a software + rasterizer. (LP: #341898) + + -- Mario Limonciello Fri, 27 Mar 2009 02:50:13 -0500 + +mesa (7.3-1ubuntu3) jaunty; urgency=low + + * Add 103_rs600_support.patch: Adds support for the RS600 chip and sets + the number of gb pipes properly for r3xx/r5xx cards. + + -- Bryce Harrington Tue, 03 Mar 2009 00:26:59 -0800 + +mesa (7.3-1ubuntu2) jaunty; urgency=low + + [ Julien Cristau ] + * Drop CFLAGS mangling for lpia and armel from debian/rules, the issue has + been fixed upstream. + + [ Timo Aaltonen ] + * 102_dont_vblank.patch: Disable vblank again for intel, and revisit it + again during the next cycle. + + -- Timo Aaltonen Mon, 23 Feb 2009 16:48:56 +0200 + +mesa (7.3-1ubuntu1) jaunty; urgency=low + + * Merge with Debian experimental. + * Drop 102_remove_flip.diff, included in 7.3.. + + -- Timo Aaltonen Sat, 31 Jan 2009 12:38:44 +0200 + +mesa (7.3-1) experimental; urgency=low + + [ Timo Aaltonen ] + * New upstream release. + + [ Julien Cristau ] + * Try to make the diff a bit smaller by removing directories that are in + upstream git but not in tarballs. + + -- Julien Cristau Fri, 30 Jan 2009 20:00:34 +0100 + +mesa (7.3~rc3-1ubuntu2) jaunty; urgency=low + + * 102_remove_flip.diff: Add a patch from upstream which removes the + remaining bits of pageflipping support. (LP: #320690) + + -- Timo Aaltonen Sun, 25 Jan 2009 00:00:04 +0200 + +mesa (7.3~rc3-1ubuntu1) jaunty; urgency=low + + * Merge with Debian experimental. + * Drop 102_dont_vblank.patch, since the new drm code in the kernel + fixes the bugs that it worked around. + * Bump the build-dependency of libdrm to 2.4.4. It's the first version + with necessary changes to build this. + + -- Timo Aaltonen Fri, 23 Jan 2009 10:20:24 +0200 + +mesa (7.3~rc3-1) experimental; urgency=low + + [ Timo Aaltonen ] + * New upstream release candidate. + + [ Julien Cristau ] + * Refresh patches 03 and 04. + + -- Julien Cristau Wed, 21 Jan 2009 19:01:21 +0100 + +mesa (7.3~rc1-1) experimental; urgency=low + + * New upstream release candidate. + + provides DRI2 (closes: #411141). + + i915: fallback for cube map texture. Fixes GPU hang with scorched3d + (closes: #484049). + + [ Timo Aaltonen ] + * Remove debian/patches/01_disable-intel-classic-warn.diff, the + warning is gone now. + * debian/control: + - Build-depend on x11proto-dri2-dev (>= 1.99.3) + + [ Julien Cristau ] + * Require libdrm-dev 2.4.3. + * Merge packaging changes from unstable, from 7.0.3-5 to 7.0.3-7. + * Delete unused configs/debian-*, and install-source.sh script. We've + switched to using autoconf, and mesa-swx11-source is gone. + * Delete some now unused code from debian/rules. + + -- Julien Cristau Sat, 10 Jan 2009 22:14:55 +0100 + +mesa (7.2+git20081209.a0d5c3cf-0ubuntu4) jaunty; urgency=low + + * debian/rules: Add -D_GNU_SOURCE for lpia & armel (FTBFS). + + -- Timo Aaltonen Fri, 12 Dec 2008 02:15:40 +0200 + +mesa (7.2+git20081209.a0d5c3cf-0ubuntu3) jaunty; urgency=low + + * debian/rules (CFLAGS): Avoid recursive reference. + + -- Matthias Klose Thu, 11 Dec 2008 22:34:43 +0100 + +mesa (7.2+git20081209.a0d5c3cf-0ubuntu2) jaunty; urgency=low + + * debian/rules: Add -D_BSD_SOURCE to CFLAGS for lpia & armel (FTBFS). + * Drop the Xsession.d hook, not needed anymore. + + -- Timo Aaltonen Thu, 11 Dec 2008 23:20:47 +0200 + +mesa (7.2+git20081209.a0d5c3cf-0ubuntu1) jaunty; urgency=low + + * Merge from debian-experimental git branch. + * 103_fix-crash-in-i830_emit_state.dpatch: deleted, included + upstream. + + -- Timo Aaltonen Tue, 09 Dec 2008 21:54:28 +0200 + +mesa (7.2-1ubuntu2) intrepid; urgency=low + + * debian/patches/103_fix-crash-in-i830_emit_state.dpatch: + - Apply upstream commit to fix a crash in i830_emit_state + (LP: #277709) + + -- Chris Coulson Tue, 21 Oct 2008 17:55:10 +0100 + +mesa (7.2-1ubuntu1) intrepid; urgency=low + + * Merge from Debian experimental. + + -- Timo Aaltonen Wed, 24 Sep 2008 21:00:38 +0300 + +mesa (7.2-1) experimental; urgency=low + + [ Brice Goglin ] + * Fix grammar and punctuation in glxinfo(1), thanks Sam Hocevar, + closes: #498595. + + [ Timo Aaltonen ] + * New upstream release. + * Refresh patch 04_osmesa_version.diff + + [ Julien Cristau ] + * Remove the build-dep on dri2proto, DRI2 support has been removed. + * intel: don't warn about TTM init failure. + + -- Julien Cristau Wed, 24 Sep 2008 14:28:21 +0200 + +mesa (7.1-1ubuntu3) intrepid; urgency=low + + * debian/rules: Build i915 and i965 DRI drivers on lpia. (LP: #270106) + + -- Timo Aaltonen Tue, 16 Sep 2008 13:07:02 +0300 + +mesa (7.1-1ubuntu2) intrepid; urgency=low + + * 102_dont_vblank.patch + - Revert the commit which defaults to vblank on intel. It breaks + DPMS with compiz, resulting in a hang. (LP: 262605) + + -- Timo Aaltonen Fri, 12 Sep 2008 11:25:01 +0300 + +mesa (7.1-1ubuntu1) intrepid; urgency=low + + * Merge from debian experimental, remaining changes: + - debian/control + + Change maintainer address to Ubuntu. + + Drop lesstif-dev from Build-Depends since it's a universe component + that Ubuntu doesn't want in main due to security concerns about it + (it's a large codebase without active development - last release >2 + yrs ago). + + Comment out GLw libs since it depends on lesstif-dev. + + Add lpia to -dri and -dri-dbg package in. + + Add Pre-Depends: dpkg (>= 1.14.12ubuntu3) to ensure dpkg + support for lzma. + - debian/rules + + Unexport LDFLAGS (amd64 FTBFS). + + Add Xsession hook to disable ASM optimizations when running on + 64-but processors that don't support them + (LP: 87661, Deb: 484180, fdo: 8724) + + use --disable-glw for swx11 targets too. + + Build .debs with lzma compression. + - debian/patches + + Add 101_ubuntu_hidden_glname.patch. + + -- Timo Aaltonen Thu, 28 Aug 2008 01:18:35 +0300 + +mesa (7.1-1) experimental; urgency=low + + * Add parallel build support. + * New upstream development release + + libGLU now only exports its public interface (closes: #319388) + * Some more parallel build updates. + + -- Julien Cristau Wed, 27 Aug 2008 19:52:24 +0200 + +mesa (7.1~rc3-1ubuntu4) intrepid; urgency=low + + * debian/control: Add Pre-Depends: dpkg (>= 1.14.12ubuntu3) to ensure dpkg + support for lzma. + + -- Martin Pitt Sun, 11 May 2008 10:42:54 +0200 + +mesa (7.1~rc3-1ubuntu3) intrepid; urgency=low + + * Build .debs with lzma compression to reduce libgl1-mesa-dri from 13.2 to + 2.8 MB. + + -- Martin Pitt Tue, 12 Aug 2008 09:31:01 +0200 + +mesa (7.1~rc3-1ubuntu2) intrepid; urgency=low + + * 102_fix-fdo-14441.diff: fix tfp on i965. (LP: #245888) + + -- Timo Aaltonen Fri, 01 Aug 2008 16:08:01 +0300 + +mesa (7.1~rc3-1ubuntu1) intrepid; urgency=low + + * merged with debian-experimental + + -- Michael Vogt Tue, 15 Jul 2008 15:07:41 +0100 + +mesa (7.1~rc3-1) experimental; urgency=low + + [ Julien Cristau ] + * New upstream release candidate (updated to git commit 4fab47b1). + * Build against libdrm >= 2.3.1. + * 04_osmesa_version.diff: fix libOSMesa versioning, to revert accidental + SONAME bump. + + [ Timo Aaltonen ] + * Refresh patches, and drop obsolete 00_create-libdir.patch and + 01_fix-makefile.patch. + * Build-depend on x11proto-dri2-dev. + * Drop mesa-swx11-source. + * Add dri_interface.h to mesa-common-dev. + * Add gl.pc to libgl1-mesa-dev + * rules: Replace the old build system with the new autotools-based + system. + * Run autoreconf before building the various flavours.. + * Add automake & autoconf to build-deps. + * Use --enable-glx-tls for dri. + + -- Julien Cristau Sun, 13 Jul 2008 19:41:42 +0200 + +mesa (7.1~rc1-0ubuntu2) intrepid; urgency=low + + * Merge with debian git, fixes FTBFS on sparc/hppa/ia64. + + -- Timo Aaltonen Mon, 07 Jul 2008 11:12:26 +0300 + +mesa (7.1~rc1-0ubuntu1) intrepid; urgency=low + + [ Bryce Harrington ] + * Merge from git.debian.org, remaining changes: + - Change maintainer address to Ubuntu. + - Drop lesstif-dev from Build-Depends since it's a universe component + that Ubuntu doesn't want in main due to security concerns about it + (it's a large codebase without active development - last release >2 + yrs ago). + - Comment out GLw libs from control since it depends on lesstif-dev. + - Add lpia to -dri and -dri-dbg package in debian/control. + - Add Xsession hook to disable ASM optimizations when running on + 64-but processors that don't support them + (LP: 87661, Deb: 484180, fdo: 8724) + - Add 101_ubuntu_hidden_glname.patch. + + [ Timo Aaltonen ] + * Dropped patches + 102_ubuntu_no_glw.patch: + - the new build system handles this better + 103_dlopen_in_driveropen.diff and 104_fix_driveropen.diff: + - upstream + * debian/rules: use --disable-glw for swx11 targets too. + * Unexport LDFLAGS (amd64 FTBFS). + + -- Timo Aaltonen Fri, 04 Jul 2008 13:19:57 +0300 + +mesa (7.0.3-7) unstable; urgency=low + + * Cherry-pick patch from upstream: + Use 3Dnow! x86-64 routines only on processors that support 3Dnow! + (closes: #484180). + * Also build the x86-specific dri drivers on kfreebsd (closes: #492894). + + -- Julien Cristau Sun, 14 Dec 2008 07:34:58 +0530 + +mesa (7.0.3-6) unstable; urgency=high + + * Update debian/copyright to the SGI Free Software License B, version 2.0. + It now mirrors the free X11 license used by X.Org (closes: #368560). + http://www.sgi.com/company_info/newsroom/press_releases/2008/september/opengl.html + + -- Julien Cristau Sat, 20 Sep 2008 16:30:44 +0200 + +mesa (7.0.3-5) unstable; urgency=low + + * Disable the i915tex driver, it doesn't build against libdrm 2.3.1. + * Pull from mesa_7_0_branch (27425708). + + -- Julien Cristau Sat, 12 Jul 2008 18:56:19 +0200 + +mesa (7.0.3-4) unstable; urgency=low + + * Pull from mesa_7_0_branch (2ac4919d). + * Put back our configs/ changes into the .diff.gz since choose-configs + needs them before quilt is invoked. Put 04_cleanup-osmesa-configs.patch + there as well for #485161. + + -- Brice Goglin Wed, 18 Jun 2008 20:59:14 +0200 + +mesa (7.0.3-3ubuntu1) intrepid; urgency=low + + * Merge from debian unstable, remaining changes: + - Change maintainer address to Ubuntu. + - Drop lesstif-dev from Build-Depends since it's a universe component + that Ubuntu doesn't want in main due to security concerns about it + (it's a large codebase without active development - last release >2 + yrs ago). + - Comment out GLw libs from control since it depends on lesstif-dev. + - Add lpia to -dri and -dri-dbg package in debian/control. + - Add lpia to ARCH_X86 in configs/debian-dri-default. + - Add 101_ubuntu_hidden_glname.patch + - Add 102_ubuntu_no_glw.patch to remove lesstif build depends since + its a universe component. + - Add 103_dlopen_in_driveropen.diff and 104_fix_driveropen.diff from + upstream; "Always call dlopen in DriverOpen". + (LP: 189580, fdo: 13541) + - Add Xsession hook to disable ASM optimizations when running on + 64-but processors that don't support them + (LP: 87661, Deb: 484180, fdo: 8724) + + -- Bryce Harrington Tue, 17 Jun 2008 16:47:35 -0700 + +mesa (7.0.3-3) unstable; urgency=low + + * Pull from mesa_7_0_branch (718724de). + + Fix intel_batchbuffer_space on i965, closes: #455817. + + Fix busy error in i915_wait_irq for real now, closes: #467319. + * Move our configs/ changes from the .diff.gz into our quilt patches, + with 04_cleanup-osmesa-configs.patch renamed into 04_debian-configs.patch, + closes: #485161. + + -- Brice Goglin Tue, 17 Jun 2008 20:00:51 +0200 + +mesa (7.0.3-2) unstable; urgency=low + + * Pull from mesa_7_0_branch (03447de3). + * Set right cliprects for the current draw region on Intel, closes: #467319. + * Use BRW_TEXCOORDMODE_CLAMP instead of BRW_TEXCOORDMODE_CLAMP_BORDER + to implement GL_CLAMP on i965, closes: #478880. + * Fix segment fault with BASE_LEVEL set to 5 for MipMap on i915, + closes: #451339. + * Disable low impact fallback on r300 by default, closes: #440868. + + -- Brice Goglin Fri, 13 Jun 2008 06:53:29 +0200 + +mesa (7.0.3-1ubuntu2) intrepid; urgency=low + + * Add Xsession hook to disable ASM optimizations when running on + 64-but processors that don't support them (LP: #87661) + + -- Tormod Volden Thu, 05 Jun 2008 12:41:25 +0200 + +mesa (7.0.3-1ubuntu1) intrepid; urgency=low + + * Merge from debian unstable, remaining changes: + - Change maintainer address. + - Drop lesstif-dev from Build-Depends. + - Comment out GLw libs from control. + - Add lpia to -dri and -dri-dbg package in debian/control. + - Add lpia to ARCH_X86 in configs/debian-dri-default. + - Add 101_ubuntu_hidden_glname.patch + - Add 102_ubuntu_no_glw.patch + - Add 103_dlopen_in_driveropen.diff and 104_fix_driveropen.diff from + upstream; "Always call dlopen in DriverOpen". (LP: #189580) + + -- Timo Aaltonen Wed, 04 Jun 2008 18:38:43 +0300 + +mesa (7.0.3-1) unstable; urgency=low + + * New upstream release. + * Only call ProgramStringNotify if program parsing succeeded, + closes: #473551. + + -- Brice Goglin Fri, 11 Apr 2008 08:42:37 +0200 + +mesa-glw (7.0.3-0ubuntu1) intrepid; urgency=low + + * This is a special edition of the mesa package that + splits out the GLw packages for Universe, since these have + been removed from Ubuntu/main (LP: #227712). Changes relative to + the native Debian mesa source package are the following: + * debian/control: + - Introduce new source package name: mesa-glw + - Comment out all packages except libglw1-mesa and libglw1-mesa-dev + - Add dependency on libgl1-mesa-dev|libgl-dev + - Maintainer field ubuntufication + * debian/changelog: change name of source package + * debian/rules: not building any indep packages, so binary-indep + target is neutralized. Comment out dh_strip calls to build + debug packages. Do not check for missing files, because we know + there are lots, and it makes the build fail. + * debian/patches/102_ubuntu_only_glw.patch: build glw only. + + -- Morten Kjeldgaard Tue, 06 May 2008 16:19:15 +0200 + +mesa (7.0.3-1) unstable; urgency=low + + * New upstream release. + * Only call ProgramStringNotify if program parsing succeeded, + closes: #473551. + + -- Brice Goglin Fri, 11 Apr 2008 08:42:37 +0200 + +mesa (7.0.3~rc2-2) unstable; urgency=low + + * Pull from mesa_7_0_branch (1e83d70b). + * Fixes regression in the i965 dri driver (closes: #470984, #470084) + * Update 02_use-ieee-fp-on-s390-and-m68k.patch. + * Change libgl1-mesa-swx11-i686's pre-dependency on libgl1-mesa-swx11 to a + regular versioned dependency, and add ${shlibs:Depends}. + + -- Julien Cristau Mon, 31 Mar 2008 16:47:31 +0200 + +mesa (7.0.3~rc2-1ubuntu3) hardy; urgency=low + + * debian/patches/107_fix_-ve_rhw_regression.patch: Fixes regression + introduced upstream where a -ve rhw workaround is being applied only + for IGD systems, when it should be applied only for *non*-IGD systems. + This resulted in rendering issues in 3D games and drawing programs. + (LP: #199823, #206287) + + -- Bryce Harrington Fri, 04 Apr 2008 19:46:40 -0700 + +mesa (7.0.3~rc2-1ubuntu2) hardy; urgency=low + + [ Laurent Bigonville ] + * debian/patches/105_vblank_fix.patch: Fix "drmWaitVBlank returned -1" error + (LP: #186764) + + [ Timo Aaltonen ] + * Add 106_i965_wine_fix.diff from upstream, "Only call + ProgramStringNotify if program parsing succeeded". (LP: #178292) + + -- Timo Aaltonen Wed, 12 Mar 2008 12:33:41 +0200 + +mesa (7.0.3~rc2-1ubuntu1) hardy; urgency=low + + * Merge from debian unstable (LP: #189167), remaining changes: + - Change maintainer address. + - Drop lesstif-dev from Build-Depends. + - Comment out GLw libs from control. + - Add lpia to -dri and -dri-dbg package in debian/control. + - Add lpia to ARCH_X86 in configs/debian-dri-default. + - Add 101_ubuntu_hidden_glname.patch + - Add 102_ubuntu_no_glw.patch + * Drop patch 103_fix_rv410se.diff, applied upstream. + * Add 103_dlopen_in_driveropen.diff and 104_fix_driveropen.diff from + upstream; "Always call dlopen in DriverOpen". (LP: #189580) + + -- Timo Aaltonen Tue, 26 Feb 2008 13:07:45 +0200 + +mesa (7.0.3~rc2-1) unstable; urgency=low + + * New upstream release candidate. + + enable user-defined clip planes for R300 (closes: #408679) + + 03_optional-progs-and-install.patch: partly applied upstream, fixed up + * Stop building with -O0 on hppa. Bug #451047 should be fixed in recent gcc + versions. + + -- Julien Cristau Sun, 24 Feb 2008 10:22:54 +0100 + +mesa (7.0.2-4ubuntu2) hardy; urgency=low + + * 103_fix_rv410se.diff: + - patch from upstream; "Fix rendering on x700 SE chips." + (LP: #151974) + + -- Timo Aaltonen Wed, 30 Jan 2008 13:18:23 +0200 + +mesa (7.0.2-4ubuntu1) hardy; urgency=low + + * Merge from debian unstable (LP: #151974), remaining changes: + - Change maintainer address. + - Drop lesstif-dev from Build-Depends. + - Comment out GLw libs from control. + - Add lpia to -dri and -dri-dbg package in debian/control. + - Add lpia to ARCH_X86 in configs/debian-dri-default. + - Add 101_ubuntu_hidden_glname.patch + - Add 102_ubuntu_no_glw.patch + + -- Timo Aaltonen Tue, 29 Jan 2008 12:09:30 +0200 + +mesa (7.0.2-4) unstable; urgency=low + + * Update to mesa_7_0_branch head (commit 48ae5cf0). + * Add Vcs-Git, Vcs-Browser and Homepage fields in debian/control. + + -- Julien Cristau Thu, 17 Jan 2008 22:23:06 +0100 + +mesa (7.0.2-3ubuntu1) hardy; urgency=low + + * Merge from debian unstable, remaining changes: + - Change maintainer address. + - Drop lesstif-dev from Build-Depends. + - Comment out GLw libs from control. + - Add lpia to -dri and -dri-dbg package in debian/control. + - Add lpia to ARCH_X86 in configs/debian-dri-default. + - Add 101_ubuntu_hidden_glname.patch + - Add 102_ubuntu_no_glw.patch + * debian/control: Do not build-depend on gcc-3.4 anymore. + * Drop 110_ubuntu_use_gcc-3.4_for_i965.patch + + -- Timo Aaltonen Sat, 05 Jan 2008 00:45:31 +0200 + +mesa (7.0.2-3) unstable; urgency=low + + * Update to mesa_7_0_branch head (commit 0107acde). + * Bump Standards-Version to 3.7.3. + * Move libgl1-mesa-swx11-dbg, mesa-common-dev and libosmesa6-dev to section + libdevel. + * libgl1-mesa-swx11 conflicts with libgl1-mesa-glx. Move it and + libgl1-mesa-swx11-dev to priority extra. + * Fix typo in mesa-common-dev's long description. + + -- Julien Cristau Tue, 18 Dec 2007 19:13:18 +0100 + +mesa (7.0.2-2ubuntu1) hardy; urgency=low + + * Merge from debian unstable, remaining changes: + - Change maintainer address. + - Add gcc-3.4 as a build dependency for amd64, i386 and lpia. + - Drop lesstif-dev from Build-Depends. + - Comment out GLw libs from control. + - Add lpia to -dri and -dri-dbg package in debian/control. + - Add lpia to ARCH_X86 in configs/debian-dri-default. + - Add 101_ubuntu_hidden_glname.patch + - Add 102_ubuntu_no_glw.patch + - Add 110_ubuntu_use_gcc-3.4_for_i965.patch + + -- Timo Aaltonen Fri, 16 Nov 2007 09:00:24 +0200 + +mesa (7.0.2-2) unstable; urgency=low + + [ Julien Cristau ] + * Don't set -fno-strict-aliasing in configs/debian-default. It is set + upstream now. + * Workaround gcc ICE on hppa: build libOSMesa with -O0 (see bug#451047). + * Add build-dep on libxext-dev. Thanks, Timo Aaltonen! + + -- Brice Goglin Tue, 13 Nov 2007 21:43:40 +0100 + +mesa (7.0.2-1ubuntu2) hardy; urgency=low + + * Add libxext-dev to Build-Depends. + + -- Timo Aaltonen Mon, 12 Nov 2007 14:50:38 +0200 + +mesa (7.0.2-1ubuntu1) hardy; urgency=low + + * Merge from debian unstable, remaining changes: + - Change maintainer address. + - Add gcc-3.4 as a build dependency for amd64, i386 and lpia. + - Drop lesstif-dev from Build-Depends. + - Comment out GLw libs from control. + - Add lpia to -dri and -dri-dbg package in debian/control. + - Add lpia to ARCH_X86 in configs/debian-dri-default. + - Add 101_ubuntu_hidden_glname.patch + - Add 102_ubuntu_no_glw.patch + - Add 110_ubuntu_use_gcc-3.4_for_i965.patch + + -- Timo Aaltonen Mon, 12 Nov 2007 12:55:33 +0200 + +mesa (7.0.2-1) unstable; urgency=low + + * New upstream release. + + Fix Blender crash in triangle_twoside(), closes: #439668, #446315. + + Fix crash in _generic_read_RGBA_span_RGB565_MMX(), closes: #445313. + + Fix the new __gluInvertMatrix() function, closes: #440137 ,#441071. + + Refresh 03_optional-progs-and-install.patch since libGLU is not + built when building progs/xdemos. + + Refresh 04_cleanup-osmesa-configs.patch. + + Drop 05_static-nonpic.patch,, applied upstream. + + Remove DESTDIR from INSTALL_DIR in configs/debian-default since + the upstream Makefiles now support DESTDIR. + * Add myself to Uploaders. + + -- Brice Goglin Sun, 11 Nov 2007 11:53:26 +0100 + +mesa (7.0.1-2) unstable; urgency=low + + * Update to latest git (from mesa_7_0_branch) + + adds support for some new intel chipsets (i915 and i915_tex dri drivers) + (closes: #437333) + + broken inline asm in dri drivers fixed (closes: #423739) + + -- Julien Cristau Tue, 28 Aug 2007 12:11:30 +0200 + +mesa (7.0.1-1ubuntu3) gutsy; urgency=low + + * Add lpia to -dri and -dri-dbg package in debian/control. + * Add lpa top ARCH_X86 in configs/debian-dri-default. + + -- Tollef Fog Heen Fri, 12 Oct 2007 14:12:21 +0200 + +mesa (7.0.1-1ubuntu2) gutsy; urgency=low + + * Add fix-965-vblank.patch, pulled from upstream + b3fc9a1585f390274fa26b3e3f80bc6d16f4388a which fixes missed vbl + interrupts on Intel i965 hardware. + + -- Kyle McMartin Wed, 3 Oct 2007 11:11:22 -0400 + +mesa (7.0.1-1ubuntu1) gutsy; urgency=low + + * Merge from debian unstable, remaining changes: + - Change maintainer to Ubuntu + - Add gcc-3.4 as a build dependency for lpia. + - Add support for Intel 945GME, G33, Q33, Q35 + + 200_945gme.patch, upstream a74eec5af5397b612d60dd4b0d81666027f19bb0, + ad6351a994fd14af9d07da4f06837a7f9b9d0de4 + + 201_g33.patch, upstream 8331d9d7aa7cde7126d38d4e1eb5fe8a168077f3 + - Comment out GLw libs from control file + - Dropped Ubuntu addition of conflicts of libgl1-mesa-glx against + libgl1-mesa-swx11, since Debian has hadded a shlibs file for + libgl1-mesa-swx11-i686 + + -- Bryce Harrington Wed, 15 Aug 2007 15:08:32 -0700 + +mesa (7.0.1-1) unstable; urgency=low + + * New upstream release. + * Upload to unstable. + + -- Julien Cristau Thu, 09 Aug 2007 11:56:16 +0200 + +mesa (7.0.1~rc2-1) experimental; urgency=low + + [ David Nusinow ] + * New upstream release candidate + * Bite the bullet and add myself to uploaders + + [ Julien Cristau ] + * Modify the short descriptions of various packages so they fit in .changes + files without being cut off. Thanks, Marc 'HE' Brockschmidt! + * Add a shlibs file for libgl1-mesa-swx11-i686. + + -- Julien Cristau Fri, 27 Jul 2007 20:17:48 +0200 + +mesa (7.0.0-0ubuntu3) gutsy; urgency=low + + * Add gcc-3.4 as a build dependency for lpia. + + -- Matthias Klose Tue, 07 Aug 2007 17:15:37 +0000 + +mesa (7.0.0-0ubuntu2) gutsy; urgency=low + + [ Kyle McMartin ] + * Add support for Intel 945GME, G33, Q33, Q35 + - 200_945gme.patch, upstream a74eec5af5397b612d60dd4b0d81666027f19bb0, + ad6351a994fd14af9d07da4f06837a7f9b9d0de4 + - 201_g33.patch, upstream 8331d9d7aa7cde7126d38d4e1eb5fe8a168077f3 + + -- Kyle McMartin Tue, 03 Jul 2007 19:32:39 +0000 + +mesa (7.0.0-0ubuntu1) gutsy; urgency=low + + [ Bryce Harrington ] + * New upstream release + - Adds OpenGL 2.0 and 2.1 API support. + - Fixed a few fog-related bugs. + - Fixed broken GLSL mix() function. + - Fixed broken GLSL exp() functions. + - Fixed GLSL mod4(vec4, vec4) bug. + - Implemented GLSL asin(), acos(), atan() functions. + - Fixed an R300 driver bug that caused Xorg composite manager to + crash + - Fixed R300 vertex program/matrix bug (fdo# 10848) + - GLSL dFdx() and dFdy() work for fragment program inputs now + (texcoords) + - Fixed potential crash when specifying an invalid texture unit as a + sampler + - Fixed incorrect GLX protocol request for glXDestroyPBuffer() + (fdo# 10983) + - ARB vp state.light[n].half value was incorrect (fdo# 10987) + - Fixed a positional light source bug (fdo# 11009) + - Fixed point size attenuation problem (fdo# 11042) + - Fixed problem where glPopAttrib didn't restore texture object's + LOD bias (fdo# 11049) + - Fixed a TLS / TEXTREL problem (fdo# 7459) + - Some texture code consolidation and simplifiction + - R300 driver clean-ups. + + [ Sarah Hobbs ] + * Added a conflicts of libgl1-mesa-glx against libgl1-mesa-swx11, and vice + versa + + -- Sarah Hobbs Tue, 26 Jun 2007 15:32:00 +1000 + +mesa (6.5.3-1ubuntu1) gutsy; urgency=low + + * Update Maintainer for Ubuntu + + [ Kyle McMartin ] + * Merge with Debian experimental: + - Remove lesstif-dev from Build-Depends (Timo Aaltonen) + - Comment out GLw libs from control file + - Add 102_ubuntu_no_glw.patch to remove lesstif build depends + - Add libxext-dev to Build-Depends (Paul Sladen) + - Add gcc-3.4 [i386 amd64] to Build-Depends (Ben Collins) + - Add 110_ubuntu_use_gcc-3.4_for_i965.patch (Timo Aaltonen) + - Add 101_ubuntu_hidden_glname.patch + - Add 112_fedora-hush-synthetic-visual-warning.patch (Adam Jackson) + + * Dropped patches: + - 103_ubuntu_fd.org-9686-fog.patch merged upstream + - 104_r300_call_radeonsetcliprects.patch merged upstream + - 105_radeon_call_radeonsetcliprects.patch merged upstream + - 106_r200_call_radeonsetcliprects.patch merged upstream + - 107_r200_simplify_r200setcliprects.patch merged upstream + - 111_unichrome_remove_xdrawoffset.patch merged upstream + + -- Kyle McMartin Fri, 25 May 2007 16:43:31 +0000 + +mesa (6.5.3-1) experimental; urgency=low + + [ David Nusinow ] + * New upstream release + + [ Julien Cristau ] + * Cherry-pick commit 65faf023679988f93da82b4c7ebdc689f2094459 by Michel + Dänzer to fix r300 crash. + + -- Julien Cristau Mon, 21 May 2007 11:34:51 +0200 + +mesa (6.5.3~rc3-1) experimental; urgency=low + + [ Brice Goglin ] + * Split out libGLw libs and headers from libgl1-mesa-swx11 and ship both + static and shared libraries, creating libglw1-mesa and libglw1-mesa-dev + (closes: #374904). + + [ Julien Cristau ] + * New upstream release candidate. + + 06_fix_texture_data_corruption.patch, + 07_call_radeonSetCliprects_from_radeonMakeCurrent.patch, + 08_r300_update_window_state_when_bound_but_stamp_changed.patch, + 09_i915_always_enable_pixel_fog.patch: remove, included upstream. + + 01_fix-makefile.patch, 02_use-ieee-fp-on-s390-and-m68k.patch: refresh. + * Add build-dependencies on libxdamage-dev and libxfixes-dev. + * Resync debian/scripts/install-source.sh. + * Build mesa-swx11-source only in binary-indep. + * Update from upstream git (commit + dee1b0d5bbe91f83854813cbbcd3090327bcb5c2). + + -- Julien Cristau Wed, 25 Apr 2007 10:36:50 +0200 + +mesa (6.5.2-7) unstable; urgency=low + + [ Brice Goglin ] + * libgl1-mesa-dev does not need to depend on libgl1-mesa-dri, + libgl1-mesa-glx is enough (since their split in 6.4.1-0.1); + closes: #432081. Thanks, Samuel Thibault! + + [ Julien Cristau ] + * libgl1-mesa-dev Depends on libgl1-mesa-glx (>= ${source:Upstream-Version}) + instead of >= ${Source-Version}. This way it's still installable on + architectures where mesa isn't built yet when a minor revision is + uploaded. + + -- Julien Cristau Wed, 11 Jul 2007 05:50:45 +0200 + +mesa (6.5.2-6) unstable; urgency=low + + * libgl1-mesa-swx11 needs to depend on libosmesa6 (>= 6.5.2-1) because + it used to contain libOSMesa.so.6. This means that programs linked + against this lib got a dependency on -swx11 which was broken since + 6.5.2-1. + * Fix build on hurd-i386 (build libgl1-mesa-glx without dri support and + don't build the dri drivers); closes: #420403. Thanks, Samuel Thibault! + + -- Julien Cristau Thu, 05 Jul 2007 00:56:35 +0200 + +mesa (6.5.2-5) unstable; urgency=low + + [ Brice Goglin ] + * Add 07_call_radeonSetCliprects_from_radeonMakeCurrent.patch + (closes: #420164). Thanks to Christian Ohm. + * Add 08_r300_update_window_state_when_bound_but_stamp_changed.patch + * Add 09_i915_always_enable_pixel_fog.patch + + -- Julien Cristau Fri, 18 May 2007 13:36:25 +0200 + +mesa (6.5.2-4) unstable; urgency=low + + [ Julien Cristau ] + * debian/control: libgl1-mesa-dri now suggests libglide3, with an + explanation in the description (closes: #387339). + * Upload to unstable. + + [ Brice Goglin ] + * Add 06_fix_texture_data_corruption.patch (closes: #412346). + + -- Julien Cristau Fri, 20 Apr 2007 05:57:35 +0200 + +mesa (6.5.2-3) experimental; urgency=low + + * Set LIB_DIR and EXTRA_LIB_PATH in configs/debian-default to override + settings in configs/linux-x86-64. This fixes a FTBFS on amd64, thanks to + Marc 'HE' Brockschmidt for the report (closes: #410118). + + -- Julien Cristau Wed, 7 Feb 2007 23:04:28 +0100 + +mesa (6.5.2-2) experimental; urgency=low + + * Sync Section/Priority for all packages with the override. + * Build the arch:all debs in binary-indep, and use the debhelper -s option + for commands in binary-arch, to fix FTBFS on non-i386 archs, thanks to + Marc 'HE' Brockschmidt (closes: #409638). + * Add myself to Uploaders. + + -- Julien Cristau Sun, 4 Feb 2007 21:14:02 +0100 + +mesa (6.5.2-1) experimental; urgency=low + + [ Thierry Reding ] + * New upstream release. + * Set the Debian X Strike Force as maintainer. + * Add myself to uploaders. + * Build the i915tex DRI module on the i386 and amd64 architectures. + * Add patch 04_cleanup-osmesa-configs that makes the OSMesa configurations + behave as expected. + * Add patch 05_static-nonpic to build static libraries without -fPIC. + * Make debugging symbol packages depend on the corresponding binary package + and put them into the libdevel section. + * Bump shlibs file for the libosmesa6 package to account for added symbols. + Thanks Julien Cristau. + * Build the DRI modules with the default optimization flags. Thanks Julien + Cristau. + * mesa-common-dev now ships the GLX header files so it needs to replace + libgl1-mesa-swx11-dev and libgl1-mesa-dev. Thanks Julien Cristau. + * All OSMesa libraries were moved to the libosmesa6 and libosmesa6-dev + package, so have them replace libgl1-mesa-swx11, libgl1-mesa-swx11-dev and + mesa-common-dev respectively. Thanks Julien Cristau. + + [ Julien Cristau ] + * Drop obsolete depends on xlibs. + + -- Thierry Reding Thu, 11 Jan 2007 15:06:52 +0100 + +mesa (6.5.2~rc3-0.1) experimental; urgency=low + + * Non-maintainer upload. + * Update to latest upstream release candidate. + + -- Thierry Reding Fri, 1 Dec 2006 01:06:28 +0100 + +mesa (6.5.2~rc2-0.1) experimental; urgency=low + + * Non-maintainer upload. + * New upstream release candidate: + + Refresh 02_use-ieee-fp-on-s390-and-m68k.patch. + * Add manual pages for the glxdemo, glxgears, glxheads and glxinfo + utilities (Closes: #385463). + + -- Thierry Reding Wed, 22 Nov 2006 20:49:06 +0100 + +mesa (6.5.2~rc1-0.1) experimental; urgency=low + + * Non-maintainer upload. + * New upstream release candidate. + * Update patches: + + Drop hunk #2 of 01_fix-makefile.patch, applied upstream. + + Drop 03_handle-sync-and-dont-unlock-display.patch, applied upstream. + * Bump build-dependency on libdrm-dev (>= 2.2.0). + * Use the new upstream minstall utility to install files and directories. + Using /usr/bin/install would result in a symlink's target being copied + instead of the symlink. + + -- Thierry Reding Sat, 18 Nov 2006 22:23:04 +0100 + +mesa (6.5.1-0.6) experimental; urgency=low + + * Non-maintainer upload. + * Rewrote the debian/rules file to make it easier to understand. + * Provide i686 optimized versions in libgl1-mesa-swx11-i686 instead of in + libgl1-mesa-swx11. + * Statically link libOSMesa with the software rasterization code from libGL + so that it works independently of the installed libGL. (Closes: #387706) + * Make libosmesa6-dev depend on mesa-common-dev because it only needs the + gl.h header file and no libGL anymore. + * Move glx*.h headers from libgl1-mesa(-swx11)-dev into mesa-common-dev + because both packages provide identical files. + * Add debugging symbol packages for libgl1-mesa-swx11, libgl1-mesa-glx and + libgl1-mesa-dri. + * Repack the contents of the three Mesa tarballs (MesaDemos, MesaGLUT and + MesaLib) as the original source tarball. (Closes: #392715) + * Make mesa-common-dev depend on libx11-dev. + * Provide a new package: mesa-utils. These utilities are shipped in the + MesaDemos package so mesa is the right package to provide them. + + -- Thierry Reding Sat, 18 Nov 2006 18:50:07 +0100 + +mesa (6.5.1-0.5) unstable; urgency=low + + * Non-maintainer upload. + * Build with -fno-strict-aliasing to fix misbuild of i965_dri.so + (closes: #394311). Thanks to Michel Dänzer for the fix, and to Ryan + Richter for the report and testing. + + -- Julien Cristau Wed, 3 Jan 2007 13:48:20 +0100 + +mesa (6.5.1-0.4) unstable; urgency=medium + + * Non-maintainer upload (and brown paper bag release). + * _Depend_ on libx11-dev from libgl1-mesa-dev; revert previous change. + Fixes FTBFS in other packages. (Really Closes: #396498) + + -- Steinar H. Gunderson Sat, 11 Nov 2006 13:55:20 +0100 + +mesa (6.5.1-0.3) unstable; urgency=medium + + * Non-maintainer upload. + * Build-depend on libx11-dev; fixes FTBFS. (Closes: #396498) + + -- Steinar H. Gunderson Wed, 8 Nov 2006 20:58:40 +0100 + +mesa (6.5.1-0.2) unstable; urgency=low + + * Non-maintainer upload + * Disable generation of SSE instructions (closes: #390560) + * Remove duplicate and unused build configurations + * Remove extra source files left from CVS snapshots (closes: #389283) + * Enable i965 DRI driver on i386 and amd64. Thanks to Ryan Richter + for the patch. (closes: #392030) + * Enable Unichrome DRI driver on amd64 (closes: #391900) + * Enable FFB DRI driver on sparc, not i386 (closes: #388025) + * Consistently compile C sources as C99 (closes: #373623) + * Fix X display locking error in GLX. Thanks to Josh Triplett for + the patch. (closes: #391681) + + -- Ben Hutchings Fri, 13 Oct 2006 02:25:52 +0100 + +mesa (6.5.1-0.1) unstable; urgency=low + + * New upstream version + * Build-dep on x11proto-gl-dev >= 1.4.8 + * Stuff not in the upstream tarballs + + os2 glut stuff + + docs/gears.png + * Bump libdrm-dev build-dep to >= 2.0.2 + * Add libdrm cflags to the debian-dri config. This allows the build system + to find drm.h + * Make sure that libGl looks for the dri drivers in the proper location. Do + this by setting the appropriate variables in the debian config + * Re-add s390 and m68k to the USE_IEEE test in src/mesa/main/imports.h. This + package seriously needs to store patches somewhere that are easy to find + and re-apply. + * Add patch from Cyril Brulebois to allow package to build on HURD, which + lacks DRI and directfb. This includes not using lib-directfb in the + build-depends for hurd-i386. It also creates a new debian config, + debian-indirect, which is used when building for HURD. This config is + invoked in the debian-dri config on hurd-i386. Thanks to Cyril Brulebois + for the patch, Michael Banck, Michel Dänzer, and Samuel Thibault for + input on an appropriate fix. (closes: #358065) + + -- David Nusinow Mon, 25 Sep 2006 21:21:47 -0400 + +mesa (6.5.0.cvs.20060524-1.1) unstable; urgency=medium + + * Non-maintainer upload. + * Upload mesa 6.5 cvs to unstable, because we need it for Xorg 7.1. + * Upload with medium urgency instead of high, since this is a new + upstream that should get some testing in unstable in spite of the + multiple RC bugfixes. + * Update debian/copyright with the full text of the SGI Free B and SGI + MIT-style licenses in use in the package, and take a stab at + cleaning up the list of paths and licenses. + Closes: #368562. + * Make mesa-common-dev Replaces: xlibosmesa-dev from sarge. + Closes: #384057. + * Fix libgl1-mesa-glx to not Provides: libgl1-mesa-dri, since it + definitely doesn't provide DRI support and this Provides: breaks + upgrades from sarge. Closes: #384282. + * debian/libgl1-mesa-swx11.shlibs: create a static shlibs file, + because libOSMesa.so.6 is not provided by all implementations of + libGL and so needs a separate shlibs declaration. Also make + libgl1-mesa-glx the default alternative instead of libgl1-mesa-swx11 + for consistency even when building against libgl1-mesa-swx11, + because to the extent these are interchangeable (i.e., 99%...), + there should be no reason to prefer one over the other -- and to the + extent that they aren't interchangeable, it's wrong to list libgl1 + as an alternative dependency at all. Closes: #386185. + * Don't provide shlibs at all for libgl1-mesa-swx11-dbg; this is an + unnecessary duplication of the existing libgl1-mesa-swx11 shlibs + since packages should not really be linking against /usr/lib/debug/ + separately. + * src/mesa/tnl/t_vb_render.c: Drop a pointless printf() in the + RENDER_LINE macro, getting rid of copious debug output on console. + Closes: #369895. + * libgl1-mesa-swx11 has no reason to depend on libglu, anything that + wants libglu will have its own dependency on it; drop this + hard-coded dependency from debian/control. + * Have libglu1-mesa-dev Provides: xlibmesa-glu-dev, since it's the + successor to that package and xlibmesa-glu-dev is still referenced + in a number of places and this makes for more reliable builds than + depending on alternatives without requiring another dummy -dev + package from xorg. + * Replace references to Source-Version in debian/control with either + binary:Version or source:Version, depending on whether the + relationship references an arch: any or arch: all package, making + mesa binNMU-safe; add build-depends on dpkg-dev (>= 1.13.19) to + ensure these substvars are available. + + -- Steve Langasek Fri, 15 Sep 2006 15:51:16 -0700 + +mesa (6.5.0.cvs.20060524-1) experimental; urgency=low + + * The "-O666 -fwater-c00ling -DBE_F4ST" release + * New pull from CVS + * Merge back and forth with 6.4.2-1 + * configs/debian*_i386: disabled, optimized build fuxxored. + + -- Marcelo E. Magallon Wed, 24 May 2006 14:12:13 -0600 + +mesa (6.5.0.cvs.20060512-0.0.1) experimental; urgency=low + + * New upstream release (6.5.0) + * Pulled CVS as of 2006-05-12 + * debian/control: remove DirectFB packages + + -- Marcelo E. Magallon Fri, 12 May 2006 15:23:49 -0600 + +mesa (6.4.2-1) unstable; urgency=low + + * The "please, please, please don't hate me" release. + * New upstream release. + * Ack NMUs + * debian/control: mesa-common-dev Replaces xlibmesa-gl-dev (<< 1:7) + AGAINST MY BETTER JUDGEMENT. The problem here is gratuitous package + renames within a system that does not support them. (closes: + bug#362063) + * debian/control: hurd-i386 doesn't have drm. Doesn't fix #358065, + yet. + * bin/mklib: fix from Robert Millan to support hurd-i386 and + GNU/kFreeBSD. Thanks Robert. (closes: bug#358066) + * src/glx/x11/indirect_vertex_array.c, src/mesa/main/glheader.h, + src/mesa/drivers/dri/common/glcontextmodes.c: fix broken indirect + rendering on 64-bit platforms. Thanks Aaron M. Ucko. (closes: + bug#364228) + * debian/control: b-d on x11proto-gl-dev. Please don't hate me! + * debian/control: Standards-Version: 3.7.2 + * debian/rules: export DEB_HOST_ARCH + * configs/debian-dri: use DEB_HOST_ARCH to decide if certain DRI drivers + should be built or not. + + Built only for i386: i810 i830 sis. + Rationale: integrated chipsets available only for i386 processors. + + Built only for i386: ffb. + Rationale: Michel Dänzer said so, no idea why. + + Built only for i386, amd64: i915. + Rationale: Apparently this is available in the 64-bit Intel chipset. + Please file a bug report stating which drivers should be included/excluded + for which architectures. Positive lists are preferred. If possible state + why. + * debian/mesa-swx11-source.install: nuke this abomination. Dinamically + generate the list at build time. + * debian/drivers.map: add gl-debian-dri_i386 + * debian/README.build: updated, add big friendly letters in short sentences. + Perhaps I can read it myself this way... + * debian/rules, configs/debian, configs/debian-dri, configs/debian_i386, + configs/debian-dri_i386, debian/libdir.map, debian/drivers.map: hack in + support for variable driver's dir. If you want this for your pet + architecture please provide BOTH configs/debian_arch and + configs/debian-dri_arch. If you just want to include/exclude DRI drivers + on your architecture look in configs/debian-dri. + * configs/debian*_i386: disabled, optimized build fuxxored. + * debian/rules: remove misguided Perl construct, replace by something + simpler in shell. I actually meant to do something else with the Perl + thing, but got distracted and forgot about it. Thanks Aaron M. Ucko! + * debian/rules: make it work like debian/README.build says it works wrt to + building optimized targets. + + -- Marcelo E. Magallon Tue, 16 May 2006 18:07:53 -0600 + +mesa (6.4.1-0.4) unstable; urgency=low + + * NMU + * Add versioned conflict between libgl1-mesa-dri and xlibmesa-dri so that + the xlibmesa-dri transitional upgrade package works + + -- David Nusinow Mon, 6 Mar 2006 21:46:18 -0500 + +mesa (6.4.1-0.3) unstable; urgency=low + + * NMU + * Add s390 and m68k to the USE_IEEE test in src/mesa/main/imports.h. + (closes: #349437) + + -- David Nusinow Sat, 11 Feb 2006 17:59:26 -0500 + +mesa (6.4.1-0.2) unstable; urgency=low + + * NMU + * Re-add dh_installdirs call to binary-indep target so that we get + arch-specific dirs for the mesa-swx11-source package + * Remove makedepend from build-depends. Now we'll just build-dep on xutils + to get the app, which will translate over to our own xorg 7.0 plans. + + -- David Nusinow Tue, 31 Jan 2006 19:21:12 -0500 + +mesa (6.4.1-0.1) unstable; urgency=low + + [ Marcelo E. Magallon ] + * debian/control: build-depend on xutils + * include/GL/glx{int,proto,md,tokens}.h: missing upstream (closes: bug#326466) + * debian/libgl1-mesa-dri-dev.install: install GLX include files here, too. + * debian/rules: GLU and GLW don't have arch-specific targets. + + [ Daniel Stone ] + * New upstream version, incorporating changes from Ubuntu 6.3 packaging. + * Rename packages: + - mesag3 -> libgl1-mesa-swrast + - mesag-dev -> libgl1-mesa-swrast-dev + - libgl1-mesa-dri -> libgl1-mesa + - libgl1-mesa-dri-dev -> libgl1-mesa-dev + - libgl1-mesa-dri still exists, but now contains the DRI modules only. + * Drop dependency *from* mesa-common-dev on libgl1-mesa-dev and + libglu1-mesa-dev; it should be the other way around. (closes: #336565) + * Add Build-Depends on pkg-config to get flags from libdrm, and libexpat-dev + for DRI configuration. Break out xlibs-dev Build-Depends to the + individual libraries required. + * Bump libdrm-dev Build-Depends to >> 1.0.5, in order to get new + via_drm.h to build the unichrome DRI driver. + * Configs: pare DRI drivers down to a sensible set for each architecture. + * Remove completely broken Glide target, which caused FTBFS. + * Add mesa-swrast-source package, providing the source for the software + rasteriser for libGLcore in the X server. + * Drop tight libosmesa6 -> libgl1-mesa-swrast Depends, replace with + shlibs:Depends. + + [ David Nusinow ] + * New upstream version (6.4.1) (closes: #232665) + * Merge changes from Ubuntu version 6.4.1-0ubuntu1. + (closes: #341479, #340168, #334742) + + Add new files required by xorg-server GL build to mesa-swrast-source. + * NMU to begin getting Xorg 7.0 in to Debian + * Change libgl1-mesa-swrast Depends on libx11-6-dev to libx11-dev. + * Change libgl1-mesa-swrast to be named libgl1-mesa-swx11 + * Change libgl1-mesa to be named libgl1-mesa-glx + * mesa-swrast-src.install stop looking for the swx11 dir and look for swrast + + -- David Nusinow Sat, 21 Jan 2006 21:43:37 -0500 + +mesa (6.3.2-2.1) unstable; urgency=low + + * Non-maintainer upload. + * Adjust Build-Depends: + + xlibs transition (Closes: #347129). + + xutils, xlibmesa-gl-dev (Closes: #326466). + * mesag-dev: Depends: libx11-dev (Closes: #347205). + + -- Christoph Berg Fri, 20 Jan 2006 20:45:43 +0100 + +mesa (6.3.2-2) unstable; urgency=low + + * debian/rules: build only whatever needs to be build according to + debian/control. + * debian/libdir.map: it's usr/lib/debug not usr/lib/dbg + * debian/rules: select optimized targets for the current host architecture + only (thanks Michel!) + * debian/README.build: reword some of the directions, add more info. + * debian/control: forgot to add CPR relationships in the new packages + (thanks Michel!) + * debian/control: Set maintainer to pkg-mesa-devel, add myself as uploader + + -- Marcelo E. Magallon Sun, 28 Aug 2005 14:41:15 -0600 + +mesa (6.3.2-1) unstable; urgency=low + + * New upstream + * configs/debian-dri: new target + * debian/control: add build-depends on libdrm-dev + * debian/rules: pass SRC_DIRS instead of SUBDIRS on the command line. + This allows for configurations to override the command line in a + sane way. + * configs/debian-dri: override SRC_DIRS + * configs/debian: add -D_GNU_SOURCE (required by dri drivers) + * debian/control, debian/rules: drop glide out of this package, it + will be moved to the mesa-legacy package, forked from 6.2.1-7. + * debian/drivers.map, debian/rules: take into account that some + drivers have external components. + + To be fixed: debian/drivers.map hardcodes locations + * debian/control: libgl1-mesa-dri, libgl1-mesa-directfb: new drivers + * dh_makeshlibs for libgl1-mesa-dri and libgl1-mesa-directfb + * debian/control: priority is optional... again... + + -- Marcelo E. Magallon Sun, 21 Aug 2005 17:13:19 -0600 + +mesa (6.2.1-7) unstable; urgency=low + + * Previous upload got lost somewhere + + bin/mklib: add GNU/kFreeBSD, patch from Aurelien Jarno (closes: + bug#307154) + + recompile with newer g++ + + -- Marcelo E. Magallon Tue, 02 Aug 2005 06:47:20 -0600 + +mesa (6.2.1-6) unstable; urgency=low + + * bin/mklib: add GNU/kFreeBSD, patch from Aurelien Jarno (closes: + bug#307154) + * recompile with newer g++ + + -- Marcelo E. Magallon Sun, 24 Jul 2005 11:47:16 -0600 + +mesa (6.2.1-5) unstable; urgency=low + + * debian/rules: big mess up, files are not being moved to their proper + places. I naively assumed that command-line options to debhelper + commands would override DH_OPTIONS, that is, that having + DH_OPTIONS=-i (as suggested in the documentation) would mean + something like "use -i unless -p is passed on the command line". It + actually means "use -i in addition to -p passed on the command + line", which does not make any sense, but is consistent with the + wording in the documentation. (closes: bug#306499, bug#306918, + bug#307095) + + -- Marcelo E. Magallon Sun, 01 May 2005 09:45:12 -0600 + +mesa (6.2.1-4) unstable; urgency=low + + * debian/control: fix description to reflect the exact content and + purpose of package (libosmesa-dev, mesag-dev). + * debian/rules: DH_OPTIONS=-s added to binary-arch target. (closes: + bug#306091) + + -- Marcelo E. Magallon Sat, 26 Mar 2005 08:03:44 -0600 + +mesa (6.2.1-3) unstable; urgency=low + + * debian/control: try to match the override file. If mesa is "extra" + (for whatever reason), all the packages should be extra. + * debian/rules: quick workaround for left-over libGL.so in GLU -dev + package. + + -- Marcelo E. Magallon Thu, 24 Mar 2005 19:35:34 -0600 + +mesa (6.2.1-2) unstable; urgency=low + + * The "thank you so much, I'm still voting against you" release. + * debian/rules: correct artifact of me not having had a proper + pbuilder environment to build stuff on and the repackaging from the + previous release. The -glu- and -glw- targets now explicitly depend + on the matching -gl- target, and symlinks are placed in the build + directories in order to actually have a libGL.so to make ld happy + when creating the libraries. + * debian/rules: uncomment dh_install :-\ There was a reason why I had + commented that out... + * First change closes: bug#298922 + * Second change closes: bug#300302, bug#300284, bug#300430 + * debian/control: "An X", whatever, I've been corrected multiple times + in both ways (translators beware). (closes: bug#300012) + + -- Marcelo E. Magallon Sun, 20 Mar 2005 22:03:29 -0600 + +mesa (6.2.1-1) unstable; urgency=low + + * The "autobuilders, please please please don't hate me" release. + * New upstream. + * Repackage: + + Fall prey to debhelper + + Entries below this one preserved for historical reasons or + sentimental value, pick as many as you want. They bear NO + relation to the actual packages! + * configs/debian, configs/debian-debug, configs/debian-debug-i386, + configs/debian-glide, configs/debian-glide-i386, configs/debian-i386, + configs/debian-osmesa16, configs/debian-osmesa16-static, + configs/debian-osmesa32, configs/debian-osmesa32-static, + configs/debian-static, configs/debian-static-i386: new files. + * configs/debian-sparc: Dave Miller confirmed that the sparc assembly + files do work on Linux. I don't know where to install the optimized + libraries, so the file doesn't actually exist. Please read + debian/README.build if you want to have a sparc-optimized library. + * debian/control: GGI and glide2 are gone. glide is glide3. + * debian/rules: modify shlibs file for the glide3 target to require glide3 + and only glide3 because that library exports functions not available in + other libGLs. Rationale: if someone is compiling a Debian package and + uses the glide target either he doesn't know what he is doing or he knows + exactly what he is doing. In the first case the package should not be + installable and in the second case the package requires this particular + version. + * debian/control: libgl1-mesa-glide3-dev does NOT provide a proper OpenGL + development environment (see above). + * PCR is bound to be wrong... *sigh* + + -- Marcelo E. Magallon Sat, 25 Dec 2004 14:50:02 -0600 + +mesa (6.0.1-1) unstable; urgency=low + + * New upstream release. + * debian/rules: redid a bunch of stuff in order to support new build system + without autoconf and automake stuff. The next version is going to change + this _again_. + + -- Marcelo E. Magallon Sun, 11 Apr 2004 07:00:19 -0600 + +mesa (5.0.0-5.1) unstable; urgency=low + + * Non-Maintainer Upload. + * Rename "GGIMesa"-references in src/GGI/default/Makefile.am to + "MesaGGI", which makes the package build again with newer libtool. + (Closes: #213836) + + -- Steinar H. Gunderson Sun, 15 Feb 2004 17:37:08 +0100 + +mesa (5.0.0-5) unstable; urgency=low + + * debian/control: yank and put error? Remove hard-coded + nvidia-glx-dev from mesag-glide2-dev dependencies. + + -- Marcelo E. Magallon Sun, 09 Feb 2003 10:31:51 +0100 + +mesa (5.0.0-4) unstable; urgency=low + + * debian/rules: fix typo in definition of GLIDE_ARCHS. (closes: bug#179622) + + -- Marcelo E. Magallon Mon, 03 Feb 2003 20:19:12 +0100 + +mesa (5.0.0-3) unstable; urgency=low + + * The "it's amazing how people pick severities" release + * debian/control: mesa-common-dev conflicts with xlibmesa-dev. Actually put + dependency of mesa-common-dev on the mesa-*-dev packages to avoid having + to track other libgl-dev packages popping up. IMO this is less error + prone. You can't install mesa-common-dev without installing mesa-*-dev, + and those packages conflict with other libgl-dev packages. (closes: + bug#177996) + * Rename libglu1c102 to libglu1-mesa; the libglu1c102 is incorrent since + this library does not export C++ functions. Sorry about the mess. + * Rename libglu1-dev to libglu1-mesa-dev to be consistent + * debian/rules: use grep-dctrl to extract architectures from debian/control + * debian/control: add grep-dctrl to build-depends + * debian/shlibs.libglu: libglu1-mesa | libglu1 + * debian/rules: install include/GL/xmesa.h in /usr/include/GL/xmesa.h; I'm + not 100% sure this is the right thing to do, but it's a niche so I don't + think it will actually make trouble (closes: bug#148866) + * debian/rules: install include/GL/glx*.h in the common package. (closes: + bug#178562) + * debian/rules: nasty hack to work arround libtool's idea of how libraries + should be linked (closes: bug#178514) + * debian/rules: even nastier hack. Getting environment variables to + percolate thru all the make calls isn't getting anywhere. + * si-glu/Makefile.am: export only glu.* symbols + * si-glu/Makefile.am: add -lm to link line + * src/Makefile.am: god damm it. If you use libm link to it! + * debian/control: mesa-common-dev depends on libglu1-mesa-dev to satisfy + libgl-dev's requirements + + -- Marcelo E. Magallon Mon, 27 Jan 2003 17:15:25 +0100 + +mesa (5.0.0-2) unstable; urgency=low + + * debian/control: Not funny, I'm sure I put lesstif and xlibs-dev in the + build-depends. CVS says I didn't. (closes: bug#176730) + * debian/control, debian/rules: regenerate auto-stuff (closes: bug#176729) + * debian/control, debian/rules: GCC C++ 3.2 transition (libglu1c102 -- ugly!) + * remove Makefile.in from CVS control + * si-glu/libnurbs/interface/Makefile.am: fix INCLUDES macro + + -- Marcelo E. Magallon Sun, 19 Jan 2003 00:48:32 +0100 + +mesa (5.0.0-1) unstable; urgency=low + + * New upstream release, it looks like glide and GGI are in working + condition again. + * FX patches from previous releases gone. They'll be back later. + * debian/rules: some clean ups. + * debian/control: add libglu1 packages + * debian/control: Standards-Version: 3.5.8 + * debian/rules: Build Xt widgets (if you need this stuff, you need to depend + on mesag-dev, libgl-dev is not enough) + * debian/control, debian/rules: add mesa-common-dev package + * debian/control, debian/rules: add osmesa packages. + + -- Marcelo E. Magallon Sun, 15 Dec 2002 12:28:49 +0100 + +mesa (4.0.3-1) unstable; urgency=low + + * New (and long delayed) upstream version + * Redid a bunch of FX patches, probably broke. + + -- Marcelo E. Magallon Thu, 03 Oct 2002 11:27:29 +0200 + +mesa (3.5-1) unstable; urgency=low + + * New upstream version. + * Redid patches. + * Disabled building GGI target. Someone with a good understanding of GGI + needs to write a driver for mesa. The old version doesn't cut it + anymore. + * Most makefiles won't work. Copied them out of CVS. + * src/Makefile.am: add -lm to library list. (closes: bug#102717) + * configure.in: adjust GLU's version info to match previous release. + + -- Marcelo E. Magallon Mon, 25 Jun 2001 22:13:40 +0200 + +mesa3 (3.4.2.1-4) unstable; urgency=low + + * So, here's the deal: the 3Dfx backend is going nowhere in 4.x and 5.x is + just arround the corner. Same thing for the GGI stuff. In order to leave + the people who need this stuff with _something_ to work with, I'll compile + those targets out of the mesa3 source package and the mesa package will + stuck to plain old X. + * debian/control, debian/rules: strip out all the parts concerning to mesa3g + and mesa3g-dev + * debian/control: update GGI architectures, let's see what happens + * debian/rules: special case alpha for stripping options. Chris, did you + ever figure out what the problem actually is? (closes: bug#99284) + * debian/rules: hereby I decree that everything in etc is a conffile. Die + future bugs, die!. + * configure: fix ggi_libdir, ggi_confdir (closes: bug#139598) + + -- Marcelo E. Magallon Sun, 29 Sep 2002 11:21:00 +0200 + +mesa (3.4.2.1-3) unstable; urgency=low + + * Actually install widgets on the mesag-dev package (closes: bug#98988) + + -- Marcelo E. Magallon Sat, 9 Jun 2001 16:39:36 +0200 + +mesa (3.4.2.1-2) unstable; urgency=low + + * src/X/xmesa1.c: I knew it, I knew it. This was bound to break. Stupid + typo. Restored MESA_GLX_FX (got renamed to GLX_FX accidentally, if you + have to know) (closes: bug#94114) + + -- Marcelo E. Magallon Mon, 21 May 2001 08:52:07 +0200 + +mesa (3.4.2.1-1) unstable; urgency=low + + * Upstream released 3.4.2. + * Hmmm... thought about it on my way home. The code to parse 3dfx.conf + is wrong. Redid. Still not tested. (closes: bug#94114) + * debian/README.Debian: document 3dfx.conf + + -- Marcelo E. Magallon Sat, 19 May 2001 11:57:33 +0200 + +mesa (3.4.2-1) unstable; urgency=low + + * New upstream version. + * debian/config.guess, debian/config.sub: newest versions from + http://subversions.gnu.org/cgi-bin/cvsweb/config (closes: bug#95338) + * GAAAAAAARGGH! src/X/xmesa1.c: horrible hack to use /etc/mesa/3dfx.conf + if there's no MESA_GLX_FX environment variable defined. I. Hate. + This. I'll make a deal with you: you find another of these things, + and you send me a nice tested patch. I don't have a 3DFX card and I + *HATE* uploading stuff I can't fully test. (closes: bug#94114) + * debian/rules: use the new files + * debian/rules: s/TMPDIR/DTEMPDIR/g + * gl3DfxSetDitherModeEXT from Zephaniah (closes: bug#65860) + * Disable GL_EXT_shared_texture_palette per default. Patch looks funny, + but I'll blindly trust Zephaniah. + * Hmmm... I hope Zephaniah tested this, because it broke in a rather silly + way at compile time. + * Fancy what people regard as "pretty important". + + -- Marcelo E. Magallon Fri, 18 May 2001 09:23:49 +0200 + +mesa (3.4.1-3) unstable; urgency=low + + * PLEASE SUBMIT NMUs TO THE BTS, DAMN IT! + * debian/control: exclude m68k from libggi2-dev build-dependency. + + -- Marcelo E. Magallon Sat, 17 Mar 2001 19:45:09 +0100 + +mesa (3.4.1-2) unstable; urgency=low + + * debian/control: add missing dependency on xlibs-dev and corrected the + one for libglide2-dev + + -- Marcelo E. Magallon Wed, 14 Mar 2001 00:21:42 +0100 + +mesa (3.4.1-1) unstable; urgency=low + + * New upstream version. + * New maintainer. (closes: bug#81139) + * Some fixes to get it to compile. + * debian/rules: some reorganization happened to allow me test different + builds better. + * debian/control: nuked widgets package, if you miss it, you are doing + something wrong. + * debian/rules: -dev packages will be missing some garbage they used to + install. If you miss any of those files, I'm fairly confident you + are doing something wrong. + * configure, ltmain.sh, aclocal.m4, acinclude.m4, ...: vicious hacks to + allow the GGI version to compile. + * TODO: add the widgets to the packages + * TODO: make OSmesa packages + + -- Marcelo E. Magallon Sat, 10 Feb 2001 18:34:13 +0100 + +mesa (3.2.1-1) unstable; urgency=low + + * New upstream version. + + -- James A. Treacy Mon, 31 Jul 2000 15:13:34 -0400 + +mesa (3.2-2) frozen unstable; urgency=low + + * add MMX and 3Dnow opts for x86. + + -- James A. Treacy Fri, 7 Jul 2000 16:06:43 -0400 + +mesa (3.2-1) frozen unstable; urgency=low + + * New upstream version. + * Made minor changes to README.3DFX. Closes bug#56827 + * Added symlinks for mesa widget libraries. Closes bug#63115 + + -- James A. Treacy Wed, 28 Jun 2000 11:21:09 -0400 + +mesa (3.1-17) frozen unstable; urgency=low + + * Fixed Makefile for demos in mesag-widgets-dev. Closes bug#62674 + + -- James A. Treacy Fri, 19 May 2000 13:23:00 -0400 + +mesa (3.1-16) frozen unstable; urgency=low + + * Add --prefix=/usr to ggi build. Closes bug#61705, #61486 + + -- James A. Treacy Wed, 12 Apr 2000 15:12:48 -0400 + +mesa (3.1-15) frozen unstable; urgency=low + + * Remove ggi from the build on m68k. Closes bug#59273 + + -- James A. Treacy Mon, 6 Mar 2000 13:20:29 -0500 + +mesa (3.1-14) frozen unstable; urgency=low + + * Fixed hard-coded location of config file in library. This is release + critical, even though no bug was filed (relates to bug#58267). + + -- James A. Treacy Mon, 28 Feb 2000 10:58:34 -0500 + +mesa (3.1-13) frozen unstable; urgency=low + + * Add missing ggi libraries. Closes bug#58267, #57760 + + -- James A. Treacy Thu, 24 Feb 2000 00:59:30 -0500 + +mesa (3.1-12) frozen unstable; urgency=low + + * Dependencies are now computed in a more intelligent way. Closes: bug#55861 + + -- James A. Treacy Fri, 21 Jan 2000 16:26:40 -0500 + +mesa (3.1-11) frozen unstable; urgency=low + + * Remove svgalib support from the software only package of mesa + + -- James A. Treacy Sat, 22 Jan 2000 05:33:13 +0000 + +mesa (3.1-10) frozen unstable; urgency=low + + * Fix the mesag3-glide2 postinst. Closes bug#55462 + + -- James A. Treacy Sat, 22 Jan 2000 02:06:27 +0000 + +mesa (3.1-9) frozen unstable; urgency=low + + * The ggi based packages are now built with the other versions of mesa. Closes: bug#49218, #55221 + + -- James A. Treacy Sat, 15 Jan 2000 22:24:13 -0500 + +mesa (3.1-8) unstable; urgency=low + + * fixed the postinst and prerm for the glide packages + * added Provides: mesag-dev to the mesag-glide2-dev package to maintain + backwards compatability + + -- James A. Treacy Sat, 15 Jan 2000 01:01:58 -0500 + +mesa (3.1-7) unstable; urgency=low + + * Fix version number for soname in the shlib file. Closes: bug#54926 + + -- James A. Treacy Thu, 13 Jan 2000 01:37:03 -0500 + +mesa (3.1-6) unstable; urgency=low + + * Include docs/README.3DFX in mesag3-glide2 package. Closes: bug#54625 + * Remove Provides: libgl1 from mesag3-widgets. Closes: bug#54774 + * conflicts with older versions of mesa. Closes: bug#54831 + + -- James A. Treacy Mon, 10 Jan 2000 11:50:49 -0500 + +mesa (3.1-5) unstable; urgency=low + + * now Conflicts: libgl1 + * remove extra '.' in library name + + -- James A. Treacy Sun, 9 Jan 2000 20:47:31 -0500 + +mesa (3.1-4) unstable; urgency=low + + * Added links libGL.so.1 <- libMesaGL.so.3 so existing progs don't break + * Copyright changed for version 3.1 + + -- James A. Treacy Thu, 6 Jan 2000 17:11:11 -0500 + +mesa (3.1-3) unstable; urgency=low + + * copyright file now refers to /usr/share/common-license/LGPL. + + -- James A. Treacy Tue, 4 Jan 2000 11:50:45 -0500 + +mesa (3.1-2) unstable; urgency=low + + * Second try. Fixed shlibs file. + + -- James A. Treacy Tue, 4 Jan 2000 00:00:29 -0500 + +mesa (3.1-1) unstable; urgency=low + + * New upstream version. + * glide version of packages added, since glide is now under the GPL. + * mesa widget libraries are now in a separate package + * library names are changed to lib{GL,GLU}.* + + -- James A. Treacy Tue, 14 Dec 1999 10:06:14 -0500 + +mesa (3.0-2) unstable; urgency=low + + * added symlinks from libMesaGL* -> libGL*. Fixes bug #37160 + * added lines (commented out) for building a glide version of mesa. Fixes bug #39758 + + -- James A. Treacy Thu, 13 May 1999 01:02:42 -0400 + +mesa (3.0-1) unstable; urgency=low + + * mesa libs moved to /usr/lib. Fixes bug #26874 + * motif widget library libMesaGLwM added (compiled using headers from lesstif). Fixes bug #25380 + + -- James A. Treacy Thu, 6 Aug 1998 13:49:37 -0400 + +mesa (2.6-4) unstable; urgency=low + + * call to ldconfig in postinst put back in. Fixes bug #20552 + * changelog.Debian file created for the mesa-doc package. + * deleted miscellaneous files. Fixes bug #21481 + + -- James A. Treacy Sat, 23 May 1998 23:41:34 -0400 + +mesa (2.6-3) frozen unstable; urgency=low + + * No changes. Just trying (again) to get this back in the distribution + + -- James A. Treacy Tue, 24 Mar 1998 00:53:09 -0500 + +mesa (2.6-2) unstable frozen; urgency=low + + * point copyright to LPGL in /usr/doc/copyright. Fixes bug #19633 + + -- James A. Treacy Sun, 15 Mar 1998 14:00:33 -0500 + +mesa (2.6-1) unstable; urgency=low + + * New upstream Release + * strip static lib with --strip-debug and shared with strip--unneeded: Fixes bug#17301 + * create doc package in build-indep: Fixes bug#16090 + * added widgets-mesa library to package: Fixes bug#15729 + * created mesa-glide* packages + + -- James A. Treacy Mon, 19 Jan 1998 23:45:50 -0500 + +mesa (2.5-2) unstable; urgency=low + + * Corrected i386 specific debian/rules file: Fixes bug#15640 + + -- James A. Treacy Fri, 5 Nov 1997 11:46:13 -0500 + +mesa (2.5-1) unstable; urgency=low + + * New upstream release. + + -- James A. Treacy Sun, 23 Nov 1997 20:46:13 -0500 + +mesa (2.4-1) unstable; urgency=low + + * New upstream release. + * New maintainer. + * libc6 release. + + -- James A. Treacy Mon, 3 Nov 1997 01:11:34 -0500 + +mesa (2.2-2) unstable; urgency=low + + * debian/control: mesa-doc no longer depends on mesa (bug #8840). + + -- Karl Sackett Wed, 30 Apr 1997 10:25:25 -0500 + +mesa (2.2-1) unstable; urgency=low + + * New upstream release. + * Make-config: linux-elf libraries compiled with -D_REENTRANT. + + -- Karl Sackett Wed, 19 Mar 1997 09:10:22 -0600 + +mesa (2.1-4) unstable; urgency=low + + * debian/control: lib packages moved from 'graphics' to 'libs'. + * debian/rules: headers moved from /usr/include/mesa to /usr/include + (no more -I/usr/include/mesa). + + -- Karl Sackett Tue, 25 Feb 1997 09:30:23 -0600 + +mesa (2.1-3) unstable; urgency=low + + * debian/control: mesa2 provides mesa and conflicts with mesa + (bug #7394). + + -- Karl Sackett Mon, 17 Feb 1997 09:25:42 -0600 + +mesa (2.1-2) unstable; urgency=low + + * debian/rules: install gmesa.h, osmesa.h, FooMesa.h in mesa-dev + (bug #6864). + + -- Karl Sackett Tue, 28 Jan 1997 09:37:41 -0600 + +mesa (2.1-1) unstable; urgency=low + + * New upstream release. + * Added soname to mesa and mesa-widgets. + * Moved static libraries to mesa2-dbg. + * debian/postinst, postinst-widgets: call ldconfig without explicit + pathname (bugs #6176, 6180). + + -- Karl Sackett Mon, 6 Jan 1997 09:30:10 -0600 + +mesa (2.0-2) unstable; urgency=low + + * Created mesa-widgets and mesa-widgets-dev (Bug #5029). + + -- Karl Sackett Wed, 30 Oct 1996 08:44:19 -0600 + +mesa (2.0-1) unstable; urgency=low + + * src/draw.c: replaced with upstream patch. + * Make-config: linux-elf target builds libMesaGLw.so library, looks + for XLIBS in /usr/X11R6/lib, removed -mieee-mp from CFLAGS. + * widgets-sgi/Makefile: builds libMesaGlw.a library + * New upstream release. + * Converted to new package standard. + * Maintainer address changed. + + -- Karl Sackett Mon, 14 Oct 1996 15:37:19 -0500 + +1.2.8-3 + * Package split into runtime, development, and documentation + packages. + * widgets now made as a sharable library. + * GLUT removed. This will be released as a separate package. +1.2.8-2 + * Support files now architecture-independent +1.2.8-1 + * Upgrade to latest release + * Brought support files up to latest packaging requirements + * mondello/Makefile: fixed error in realclean target +1.2.7-2 + * debian.rules: clean all Makefiles out of widgets directory + * debian.postrm: remove /usr/lib/mesa entry from /etc/ld.so.config + (bug #2817) +1.2.7-1 + * Added Debian support files + * Included the GLUT OpenGL Utility Toolkit + * Makefile - disable building programs in demos, samples, and book + directories + * mklib.linux - disabled building *.a libraries + * widgets/Makefile.in - disabled building demo programs + --- mesa-glw-7.4.orig/debian/libosmesa6.install +++ mesa-glw-7.4/debian/libosmesa6.install @@ -0,0 +1,3 @@ +usr/lib/libOSMesa.so.* +usr/lib/libOSMesa16.so.* +usr/lib/libOSMesa32.so.* --- mesa-glw-7.4.orig/debian/mesa-common-dev.install +++ mesa-glw-7.4/debian/mesa-common-dev.install @@ -0,0 +1,5 @@ +usr/include/GL/gl.h +usr/include/GL/glext.h +usr/include/GL/gl_mangle.h +usr/include/GL/glx*.h +usr/include/GL/internal/dri_interface.h --- mesa-glw-7.4.orig/debian/patches/03_optional-progs-and-install.patch +++ mesa-glw-7.4/debian/patches/03_optional-progs-and-install.patch @@ -0,0 +1,55 @@ +Allow the programs that are to be built to be defined in the build +configuration. + +Provide an install target for installing the programs in $(INSTALL_DIR)/bin. + +This patch by Thierry Reding. +Not submitted to Mesa. +-- +Also remove references to GLU library since it is not required +and we don't actually build it at this point. + + +Index: mesa/progs/xdemos/Makefile +=================================================================== +--- mesa.orig/progs/xdemos/Makefile ++++ mesa/progs/xdemos/Makefile +@@ -10,7 +10,7 @@ + + LIBS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) $(APP_LIB_DEPS) + +-PROGS = \ ++PROGS ?= \ + corender \ + glsync \ + glthreads \ +@@ -61,6 +61,11 @@ + extra: $(EXTRA_PROGS) + + ++install: $(PROGS) ++ $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/bin ++ $(INSTALL) -m 755 $(PROGS) $(DESTDIR)$(INSTALL_DIR)/bin ++ ++ + clean: + -rm -f $(PROGS) $(EXTRA_PROGS) + -rm -f *.o *~ +Index: mesa/progs/Makefile +=================================================================== +--- mesa.orig/progs/Makefile ++++ mesa/progs/Makefile +@@ -21,8 +21,12 @@ + fi \ + done + +-# Dummy install target + install: ++ @for dir in $(SUBDIRS) ; do \ ++ if [ -d $$dir ] ; then \ ++ (cd $$dir ; $(MAKE) install) ; \ ++ fi \ ++ done + + clean: + -@for dir in $(SUBDIRS) tests ; do \ --- mesa-glw-7.4.orig/debian/patches/102_dont_vblank.diff +++ mesa-glw-7.4/debian/patches/102_dont_vblank.diff @@ -0,0 +1,14 @@ +diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c +index 5233e58..5dded4b 100644 +--- a/src/mesa/drivers/dri/intel/intel_screen.c ++++ b/src/mesa/drivers/dri/intel/intel_screen.c +@@ -55,7 +55,7 @@ PUBLIC const char __driConfigOptions[] = + DRI_CONF_BEGIN + DRI_CONF_SECTION_PERFORMANCE + DRI_CONF_FTHROTTLE_MODE(DRI_CONF_FTHROTTLE_IRQS) +- DRI_CONF_VBLANK_MODE(DRI_CONF_VBLANK_ALWAYS_SYNC) ++ DRI_CONF_VBLANK_MODE(DRI_CONF_VBLANK_DEF_INTERVAL_0) + /* Options correspond to DRI_CONF_BO_REUSE_DISABLED, + * DRI_CONF_BO_REUSE_ALL + */ + --- mesa-glw-7.4.orig/debian/patches/104_fix_dri2_ext_tfp.diff +++ mesa-glw-7.4/debian/patches/104_fix_dri2_ext_tfp.diff @@ -0,0 +1,337 @@ +Index: mesa/include/GL/internal/dri_interface.h +=================================================================== +--- mesa.orig/include/GL/internal/dri_interface.h 2009-01-25 17:28:10.000000000 +0200 ++++ mesa/include/GL/internal/dri_interface.h 2009-04-03 11:45:43.000000000 +0300 +@@ -230,7 +230,7 @@ + + + #define __DRI_TEX_BUFFER "DRI_TexBuffer" +-#define __DRI_TEX_BUFFER_VERSION 1 ++#define __DRI_TEX_BUFFER_VERSION 2 + struct __DRItexBufferExtensionRec { + __DRIextension base; + +@@ -238,11 +238,23 @@ + * Method to override base texture image with the contents of a + * __DRIdrawable. + * +- * For GLX_EXT_texture_from_pixmap with AIGLX. ++ * For GLX_EXT_texture_from_pixmap with AIGLX. Deprecated in favor of ++ * setTexBuffer2 in version 2 of this interface + */ + void (*setTexBuffer)(__DRIcontext *pDRICtx, + GLint target, + __DRIdrawable *pDraw); ++ ++ /** ++ * Method to override base texture image with the contents of a ++ * __DRIdrawable, including the required texture format attribute. ++ * ++ * For GLX_EXT_texture_from_pixmap with AIGLX. ++ */ ++ void (*setTexBuffer2)(__DRIcontext *pDRICtx, ++ GLint target, ++ GLint format, ++ __DRIdrawable *pDraw); + }; + + +Index: mesa/include/GL/internal/glcore.h +=================================================================== +--- mesa.orig/include/GL/internal/glcore.h 2009-01-16 21:37:10.000000000 +0200 ++++ mesa/include/GL/internal/glcore.h 2009-04-03 11:45:43.000000000 +0300 +@@ -176,4 +176,8 @@ + #define GLX_TEXTURE_2D_BIT_EXT 0x00000002 + #define GLX_TEXTURE_RECTANGLE_BIT_EXT 0x00000004 + ++#define GLX_TEXTURE_FORMAT_NONE_EXT 0x20D8 ++#define GLX_TEXTURE_FORMAT_RGB_EXT 0x20D9 ++#define GLX_TEXTURE_FORMAT_RGBA_EXT 0x20DA ++ + #endif /* __gl_core_h_ */ +Index: mesa/src/glx/x11/glx_pbuffer.c +=================================================================== +--- mesa.orig/src/glx/x11/glx_pbuffer.c 2009-01-16 23:12:40.000000000 +0200 ++++ mesa/src/glx/x11/glx_pbuffer.c 2009-04-03 11:45:43.000000000 +0300 +@@ -189,6 +189,21 @@ + + return target; + } ++ ++ ++static GLenum ++determineTextureFormat(const int *attribs, int numAttribs) ++{ ++ GLenum target = 0; ++ int i; ++ ++ for (i = 0; i < numAttribs; i++) { ++ if (attribs[2 * i] == GLX_TEXTURE_FORMAT_EXT) ++ return attribs[2 * i + 1]; ++ } ++ ++ return 0; ++} + #endif + + /** +@@ -294,6 +309,9 @@ + if (pdraw != NULL && !pdraw->textureTarget) + pdraw->textureTarget = + determineTextureTarget((const int *) data, num_attributes); ++ if (pdraw != NULL && !pdraw->textureFormat) ++ pdraw->textureFormat = ++ determineTextureFormat((const int *) data, num_attributes); + } + #endif + +@@ -374,6 +392,7 @@ + } + + pdraw->textureTarget = determineTextureTarget(attrib_list, i); ++ pdraw->textureFormat = determineTextureFormat(attrib_list, i); + } while (0); + #endif + +Index: mesa/src/glx/x11/glxclient.h +=================================================================== +--- mesa.orig/src/glx/x11/glxclient.h 2009-03-30 10:47:17.000000000 +0300 ++++ mesa/src/glx/x11/glxclient.h 2009-04-03 11:45:43.000000000 +0300 +@@ -161,6 +161,7 @@ + __GLXscreenConfigs *psc; + GLenum textureTarget; + __DRIdrawable *driDrawable; ++ GLenum textureFormat; /* EXT_texture_from_pixmap support */ + }; + + /* +Index: mesa/src/glx/x11/glxcmds.c +=================================================================== +--- mesa.orig/src/glx/x11/glxcmds.c 2009-03-30 10:34:15.000000000 +0300 ++++ mesa/src/glx/x11/glxcmds.c 2009-04-03 11:45:43.000000000 +0300 +@@ -2631,11 +2631,19 @@ + if (gc->driContext) { + __GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable, NULL); + +- if (pdraw != NULL) +- (*pdraw->psc->texBuffer->setTexBuffer)(gc->__driContext, +- pdraw->textureTarget, +- pdraw->driDrawable); +- ++ if (pdraw != NULL) { ++ if (pdraw->psc->texBuffer->base.version >= 2 && ++ pdraw->psc->texBuffer->setTexBuffer2 != NULL) { ++ (*pdraw->psc->texBuffer->setTexBuffer2)(gc->__driContext, ++ pdraw->textureTarget, ++ pdraw->textureFormat, ++ pdraw->driDrawable); ++ } else { ++ (*pdraw->psc->texBuffer->setTexBuffer)(gc->__driContext, ++ pdraw->textureTarget, ++ pdraw->driDrawable); ++ } ++ } + return; + } + #endif +Index: mesa/src/mesa/drivers/dri/i915/i830_texstate.c +=================================================================== +--- mesa.orig/src/mesa/drivers/dri/i915/i830_texstate.c 2009-01-16 21:37:10.000000000 +0200 ++++ mesa/src/mesa/drivers/dri/i915/i830_texstate.c 2009-04-03 11:45:43.000000000 +0300 +@@ -38,7 +38,7 @@ + + + static GLuint +-translate_texture_format(GLuint mesa_format) ++translate_texture_format(GLuint mesa_format, GLuint internal_format) + { + switch (mesa_format) { + case MESA_FORMAT_L8: +@@ -56,7 +56,10 @@ + case MESA_FORMAT_ARGB4444: + return MAPSURF_16BIT | MT_16BIT_ARGB4444; + case MESA_FORMAT_ARGB8888: +- return MAPSURF_32BIT | MT_32BIT_ARGB8888; ++ if (internal_format == GL_RGB) ++ return MAPSURF_32BIT | MT_32BIT_XRGB8888; ++ else ++ return MAPSURF_32BIT | MT_32BIT_ARGB8888; + case MESA_FORMAT_YCBCR_REV: + return (MAPSURF_422 | MT_422_YCRCB_NORMAL); + case MESA_FORMAT_YCBCR: +@@ -162,7 +165,8 @@ + 0, intelObj-> + firstLevel); + +- format = translate_texture_format(firstImage->TexFormat->MesaFormat); ++ format = translate_texture_format(firstImage->TexFormat->MesaFormat, ++ firstImage->InternalFormat); + pitch = intelObj->mt->pitch * intelObj->mt->cpp; + } + +Index: mesa/src/mesa/drivers/dri/i915/i915_texstate.c +=================================================================== +--- mesa.orig/src/mesa/drivers/dri/i915/i915_texstate.c 2009-01-16 21:40:22.000000000 +0200 ++++ mesa/src/mesa/drivers/dri/i915/i915_texstate.c 2009-04-03 11:45:43.000000000 +0300 +@@ -37,7 +37,8 @@ + + + static GLuint +-translate_texture_format(GLuint mesa_format, GLenum DepthMode) ++translate_texture_format(GLuint mesa_format, GLuint internal_format, ++ GLenum DepthMode) + { + switch (mesa_format) { + case MESA_FORMAT_L8: +@@ -55,7 +56,10 @@ + case MESA_FORMAT_ARGB4444: + return MAPSURF_16BIT | MT_16BIT_ARGB4444; + case MESA_FORMAT_ARGB8888: +- return MAPSURF_32BIT | MT_32BIT_ARGB8888; ++ if (internal_format == GL_RGB) ++ return MAPSURF_32BIT | MT_32BIT_XRGB8888; ++ else ++ return MAPSURF_32BIT | MT_32BIT_ARGB8888; + case MESA_FORMAT_YCBCR_REV: + return (MAPSURF_422 | MT_422_YCRCB_NORMAL); + case MESA_FORMAT_YCBCR: +@@ -173,7 +177,8 @@ + firstLevel); + + format = translate_texture_format(firstImage->TexFormat->MesaFormat, +- tObj->DepthMode); ++ firstImage->InternalFormat, ++ tObj->DepthMode); + pitch = intelObj->mt->pitch * intelObj->mt->cpp; + } + +Index: mesa/src/mesa/drivers/dri/i965/brw_wm_surface_state.c +=================================================================== +--- mesa.orig/src/mesa/drivers/dri/i965/brw_wm_surface_state.c 2009-03-30 10:34:15.000000000 +0300 ++++ mesa/src/mesa/drivers/dri/i965/brw_wm_surface_state.c 2009-04-03 11:45:43.000000000 +0300 +@@ -69,7 +69,8 @@ + } + + +-static GLuint translate_tex_format( GLuint mesa_format, GLenum depth_mode ) ++static GLuint translate_tex_format( GLuint mesa_format, GLenum internal_format, ++ GLenum depth_mode ) + { + switch( mesa_format ) { + case MESA_FORMAT_L8: +@@ -89,10 +90,16 @@ + return BRW_SURFACEFORMAT_R8G8B8_UNORM; + + case MESA_FORMAT_ARGB8888: +- return BRW_SURFACEFORMAT_B8G8R8A8_UNORM; ++ if (internal_format == GL_RGB) ++ return BRW_SURFACEFORMAT_B8G8R8X8_UNORM; ++ else ++ return BRW_SURFACEFORMAT_B8G8R8A8_UNORM; + + case MESA_FORMAT_RGBA8888_REV: +- return BRW_SURFACEFORMAT_R8G8B8A8_UNORM; ++ if (internal_format == GL_RGB) ++ return BRW_SURFACEFORMAT_R8G8B8X8_UNORM; ++ else ++ return BRW_SURFACEFORMAT_R8G8B8A8_UNORM; + + case MESA_FORMAT_RGB565: + return BRW_SURFACEFORMAT_B5G6R5_UNORM; +@@ -150,7 +157,7 @@ + struct brw_wm_surface_key { + GLenum target, depthmode; + dri_bo *bo; +- GLint format; ++ GLint format, internal_format; + GLint first_level, last_level; + GLint width, height, depth; + GLint pitch, cpp; +@@ -188,9 +195,11 @@ + + surf.ss0.mipmap_layout_mode = BRW_SURFACE_MIPMAPLAYOUT_BELOW; + surf.ss0.surface_type = translate_tex_target(key->target); +- +- if (key->bo) +- surf.ss0.surface_format = translate_tex_format(key->format, key->depthmode); ++ if (key->bo) { ++ surf.ss0.surface_format = translate_tex_format(key->format, ++ key->internal_format, ++ key->depthmode); ++ } + else { + switch (key->depth) { + case 32: +@@ -267,6 +276,7 @@ + key.offset = intelObj->textureOffset; + } else { + key.format = firstImage->TexFormat->MesaFormat; ++ key.internal_format = firstImage->InternalFormat; + key.pitch = intelObj->mt->pitch; + key.depth = firstImage->Depth; + key.bo = intelObj->mt->region->buffer; +Index: mesa/src/mesa/drivers/dri/intel/intel_screen.c +=================================================================== +--- mesa.orig/src/mesa/drivers/dri/intel/intel_screen.c 2009-04-03 11:45:43.000000000 +0300 ++++ mesa/src/mesa/drivers/dri/intel/intel_screen.c 2009-04-03 11:45:43.000000000 +0300 +@@ -210,6 +210,7 @@ + static const __DRItexBufferExtension intelTexBufferExtension = { + { __DRI_TEX_BUFFER, __DRI_TEX_BUFFER_VERSION }, + intelSetTexBuffer, ++ intelSetTexBuffer2, + }; + + static const __DRIextension *intelScreenExtensions[] = { +Index: mesa/src/mesa/drivers/dri/intel/intel_tex.h +=================================================================== +--- mesa.orig/src/mesa/drivers/dri/intel/intel_tex.h 2009-01-16 21:40:22.000000000 +0200 ++++ mesa/src/mesa/drivers/dri/intel/intel_tex.h 2009-04-03 11:45:43.000000000 +0300 +@@ -149,6 +149,8 @@ + unsigned long long offset, GLint depth, GLuint pitch); + void intelSetTexBuffer(__DRIcontext *pDRICtx, + GLint target, __DRIdrawable *pDraw); ++void intelSetTexBuffer2(__DRIcontext *pDRICtx, ++ GLint target, GLint format, __DRIdrawable *pDraw); + + GLuint intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit); + +Index: mesa/src/mesa/drivers/dri/intel/intel_tex_image.c +=================================================================== +--- mesa.orig/src/mesa/drivers/dri/intel/intel_tex_image.c 2009-03-30 10:34:15.000000000 +0300 ++++ mesa/src/mesa/drivers/dri/intel/intel_tex_image.c 2009-04-03 11:45:43.000000000 +0300 +@@ -712,7 +712,9 @@ + } + + void +-intelSetTexBuffer(__DRIcontext *pDRICtx, GLint target, __DRIdrawable *dPriv) ++intelSetTexBuffer2(__DRIcontext *pDRICtx, GLint target, ++ GLint glx_texture_format, ++ __DRIdrawable *dPriv) + { + struct intel_framebuffer *intel_fb = dPriv->driverPrivate; + struct intel_context *intel = pDRICtx->driverPrivate; +@@ -743,7 +745,10 @@ + + type = GL_BGRA; + format = GL_UNSIGNED_BYTE; +- internalFormat = (rb->region->cpp == 3 ? 3 : 4); ++ if (glx_texture_format == GLX_TEXTURE_FORMAT_RGB_EXT) ++ internalFormat = GL_RGB; ++ else ++ internalFormat = GL_RGBA; + + mt = intel_miptree_create_for_region(intel, target, + internalFormat, +@@ -783,3 +788,12 @@ + + _mesa_unlock_texture(&intel->ctx, texObj); + } ++ ++void ++intelSetTexBuffer(__DRIcontext *pDRICtx, GLint target, __DRIdrawable *dPriv) ++{ ++ /* The old interface didn't have the format argument, so copy our ++ * implementation's behavior at the time. ++ */ ++ intelSetTexBuffer2(pDRICtx, target, GLX_TEXTURE_FORMAT_RGBA_EXT, dPriv); ++} --- mesa-glw-7.4.orig/debian/patches/02_use-ieee-fp-on-s390-and-m68k.patch +++ mesa-glw-7.4/debian/patches/02_use-ieee-fp-on-s390-and-m68k.patch @@ -0,0 +1,19 @@ +Patch that fixes Debian bug #349437. + +This patch by David Nusinow. + +Index: mesa/src/mesa/main/imports.h +=================================================================== +--- mesa.orig/src/mesa/main/imports.h 2008-07-01 15:26:57.000000000 +0300 ++++ mesa/src/mesa/main/imports.h 2008-07-01 15:45:49.000000000 +0300 +@@ -158,8 +158,9 @@ + *** USE_IEEE: Determine if we're using IEEE floating point + ***/ + #if defined(__i386__) || defined(__386__) || defined(__sparc__) || \ +- defined(__s390x__) || defined(__powerpc__) || \ ++ defined(__s390__) || defined(__s390x__) || defined(__powerpc__) || \ + defined(__x86_64__) || \ ++ defined(__m68k__) || \ + defined(ia64) || defined(__ia64__) || \ + defined(__hppa__) || defined(hpux) || \ + defined(__mips) || defined(_MIPS_ARCH) || \ --- mesa-glw-7.4.orig/debian/patches/101_ubuntu_hidden_glname.patch +++ mesa-glw-7.4/debian/patches/101_ubuntu_hidden_glname.patch @@ -0,0 +1,12 @@ +Index: mesa-6.5.2/src/mesa/x86/glapi_x86.S +=================================================================== +--- mesa-6.5.2.orig/src/mesa/x86/glapi_x86.S 2006-11-04 01:44:40.000000000 +0200 ++++ mesa-6.5.2/src/mesa/x86/glapi_x86.S 2007-02-09 20:25:45.000000000 +0200 +@@ -139,7 +139,6 @@ + + ALIGNTEXT16 + GLOBL GLNAME(gl_dispatch_functions_start) +- HIDDEN(GLNAME(gl_dispatch_functions_start)) + GLNAME(gl_dispatch_functions_start): + + GL_STUB(NewList, _gloffset_NewList, NewList@8) --- mesa-glw-7.4.orig/debian/patches/04_osmesa_version.diff +++ mesa-glw-7.4/debian/patches/04_osmesa_version.diff @@ -0,0 +1,22 @@ +Index: mesa/src/mesa/drivers/osmesa/Makefile +=================================================================== +--- mesa.orig/src/mesa/drivers/osmesa/Makefile ++++ mesa/src/mesa/drivers/osmesa/Makefile +@@ -45,7 +45,7 @@ + + $(TOP)/$(LIB_DIR)/$(OSMESA_LIB_NAME): $(OBJECTS) + $(MKLIB) -o $(OSMESA_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \ +- -major $(MESA_MAJOR) -minor $(MESA_MINOR) -patch $(MESA_TINY) \ ++ -major 6 -minor 5 -patch 3 \ + -install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) \ + -id $(INSTALL_LIB_DIR)/lib$(OSMESA_LIB).$(MESA_MAJOR).dylib \ + $(OSMESA_LIB_DEPS) $(OBJECTS) +@@ -57,7 +57,7 @@ + # with all the other Mesa sources (compiled with -DCHAN_BITS=16/32 + osmesa16: $(OBJECTS) $(CORE_MESA) + $(MKLIB) -o $(OSMESA_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \ +- -major $(MESA_MAJOR) -minor $(MESA_MINOR) -patch $(MESA_TINY) \ ++ -major 6 -minor 5 -patch 3 \ + -install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) \ + -id $(INSTALL_LIB_DIR)/lib$(OSMESA_LIB).$(MESA_MAJOR).dylib \ + $(OSMESA_LIB_DEPS) $(OBJECTS) $(CORE_MESA) --- mesa-glw-7.4.orig/debian/patches/103_bump_965_texture_limit.diff +++ mesa-glw-7.4/debian/patches/103_bump_965_texture_limit.diff @@ -0,0 +1,33 @@ +commit 954dfba12986f578f2d8461818f9e9ac1f8f2b41 +Author: Keith Packard +Date: Fri Jan 30 21:51:32 2009 -0800 + + i965: bump texture limit to 4kx4k + + Rendering and textures are limited to 8kx8k, but mesa limits things to + 4kx4k, and magic guard band stuff may break on 8kx8k drawing. This is safe + though, and makes compiz work on bigger screens. + + Signed-off-by: Keith Packard + +diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c +index d7a2bd9..d66781f 100644 +--- a/src/mesa/drivers/dri/i965/brw_context.c ++++ b/src/mesa/drivers/dri/i965/brw_context.c +@@ -135,13 +135,12 @@ GLboolean brwCreateContext( const __GLcontextModes *mesaVis, + ctx->Const.MaxTextureImageUnits); + ctx->Const.MaxVertexTextureImageUnits = 0; /* no vertex shader textures */ + +- /* Advertise the full hardware capabilities. The new memory +- * manager should cope much better with overload situations: ++ /* Mesa limits textures to 4kx4k; it would be nice to fix that someday + */ +- ctx->Const.MaxTextureLevels = 12; ++ ctx->Const.MaxTextureLevels = 13; + ctx->Const.Max3DTextureLevels = 9; + ctx->Const.MaxCubeTextureLevels = 12; +- ctx->Const.MaxTextureRectSize = (1<<11); ++ ctx->Const.MaxTextureRectSize = (1<<12); + + /* if conformance mode is set, swrast can handle any size AA point */ + ctx->Const.MaxPointSizeAA = 255.0; --- mesa-glw-7.4.orig/debian/patches/series +++ mesa-glw-7.4/debian/patches/series @@ -0,0 +1,7 @@ +02_use-ieee-fp-on-s390-and-m68k.patch +03_optional-progs-and-install.patch +04_osmesa_version.diff +101_ubuntu_hidden_glname.patch +102_dont_vblank.diff +103_bump_965_texture_limit.diff +104_fix_dri2_ext_tfp.diff --- mesa-glw-7.4.orig/debian/scripts/choose-configs +++ mesa-glw-7.4/debian/scripts/choose-configs @@ -0,0 +1,58 @@ +# Script to choose which configurations are to be built depending on the value +# of the DEB_BUILD_ARCH variable. +# +# Copyright © 2006 Thierry Reding + +############################################################################## +## architecture-specific configurations ###################################### + +# choose an architecture-specific build of swx11 and GLU if a matching +# configuration exists +#ifneq ($(wildcard configs/debian-swx11+glu-$(DEB_BUILD_ARCH)),) +# SWX11_GLU_CONFIGS := debian-swx11+glu-$(DEB_BUILD_ARCH) +#else +# SWX11_GLU_CONFIGS := debian-swx11+glu-any +#endif + +# same for static builds +#ifneq ($(wildcard configs/debian-swx11+glu-static-$(DEB_BUILD_ARCH)),) +# SWX11_GLU_CONFIGS += debian-swx11+glu-static-$(DEB_BUILD_ARCH) +#else +# SWX11_GLU_CONFIGS += debian-swx11+glu-static-any +#endif + +SWX11_GLU_CONFIGS := swx11+glu swx11+glu-static + +# and for the GLX/DRI-enabled libGL +ifneq ($(wildcard configs/debian-indirect-$(DEB_BUILD_ARCH)),) + DRI_CONFIGS := debian-indirect-$(DEB_BUILD_ARCH) +else + ifneq ($(wildcard configs/debian-dri-$(DEB_BUILD_ARCH)),) + DRI_CONFIGS := debian-dri-$(DEB_BUILD_ARCH) + else + DRI_CONFIGS := debian-dri-any + endif +endif + +############################################################################## +## CPU-optimized configurations ############################################## + +ifeq ($(DEB_BUILD_ARCH), i386) + SWX11_GLU_CONFIGS += swx11+glu-i386-i686 +# DRI_CONFIGS += debian-dri-i386-i686 +endif + +#ifeq ($(DEB_BUILD_ARCH), alpha) +# SWX11_GLU_CONFIGS += debian-swx11+glu-alpha-ev5 +#endif + +#ifeq ($(DEB_BUILD_ARCH), powerpc) +# SWX11_GLU_CONFIGS += debian-swx11+glu-powerpc-603 +#endif + +#ifeq ($(DEB_BUILD_ARCH), sparc) +# SWX11_GLU_CONFIGS += debian-swx11+glu-sparc-ultrasparc +#endif + +# vim: ft=make + --- mesa-glw-7.4.orig/include/GL/glut_h.dja +++ mesa-glw-7.4/include/GL/glut_h.dja @@ -0,0 +1,340 @@ + +/* + * Mesa 3-D graphics library + * Version: 3.1 + * Copyright (C) 1995-1998 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +/* + * This header file is based on the REAL glut.h by Mark J. Kilgard. + * + * The DJGPP/ALLEGRO (DJA) GLUT implementation was written by + * Bernhard Tschirren (bernie-t@geocities.com) for the sole purpose + * of compiling all the sample programs (which use GLUT). Therefore, + * is NOT AT ALL a complete version of GLUT! + */ + + +#ifndef __AGLUT_H__ +#define __AGLUT_H__ + +#include +#include + +#define GLUTCALLBACK +#define APIENTRY +#define GLUTAPI extern + +#define GLUT_RGB 0 +#define GLUT_RGBA GLUT_RGB +#define GLUT_INDEX 1 +#define GLUT_SINGLE 0 +#define GLUT_DOUBLE 2 +#define GLUT_ACCUM 4 +#define GLUT_ALPHA 8 +#define GLUT_DEPTH 16 +#define GLUT_STENCIL 32 + +/* Mouse buttons. */ +#define GLUT_LEFT_BUTTON 0 +#define GLUT_MIDDLE_BUTTON 1 +#define GLUT_RIGHT_BUTTON 2 + +/* Mouse button state. */ +#define GLUT_DOWN 0 +#define GLUT_UP 1 + +/* function keys */ +#define GLUT_KEY_F1 1 +#define GLUT_KEY_F2 2 +#define GLUT_KEY_F3 3 +#define GLUT_KEY_F4 4 +#define GLUT_KEY_F5 5 +#define GLUT_KEY_F6 6 +#define GLUT_KEY_F7 7 +#define GLUT_KEY_F8 8 +#define GLUT_KEY_F9 9 +#define GLUT_KEY_F10 10 +#define GLUT_KEY_F11 11 +#define GLUT_KEY_F12 12 + +/* directional keys */ +#define GLUT_KEY_LEFT 100 +#define GLUT_KEY_UP 101 +#define GLUT_KEY_RIGHT 102 +#define GLUT_KEY_DOWN 103 +#define GLUT_KEY_PAGE_UP 104 +#define GLUT_KEY_PAGE_DOWN 105 +#define GLUT_KEY_HOME 106 +#define GLUT_KEY_END 107 +#define GLUT_KEY_INSERT 108 + +/* Entry/exit state. */ +#define GLUT_LEFT 0 +#define GLUT_ENTERED 1 + +/* Visibility state. */ +#define GLUT_NOT_VISIBLE 0 +#define GLUT_VISIBLE 1 + +/* Color index component selection values. */ +#define GLUT_RED 0 +#define GLUT_GREEN 1 +#define GLUT_BLUE 2 + +/* Layers for use. */ +#define GLUT_NORMAL 0 +#define GLUT_OVERLAY 1 + +/* Stroke font constants (use these in GLUT program). */ +#define GLUT_STROKE_ROMAN ((void*)0) +#define GLUT_STROKE_MONO_ROMAN ((void*)1) + +/* Bitmap font constants (use these in GLUT program). */ +#define GLUT_BITMAP_9_BY_15 ((void*)2) +#define GLUT_BITMAP_8_BY_13 ((void*)3) +#define GLUT_BITMAP_TIMES_ROMAN_10 ((void*)4) +#define GLUT_BITMAP_TIMES_ROMAN_24 ((void*)5) +#define GLUT_BITMAP_HELVETICA_10 ((void*)6) +#define GLUT_BITMAP_HELVETICA_12 ((void*)7) +#define GLUT_BITMAP_HELVETICA_18 ((void*)8) + +/* glutGet parameters. */ +#define GLUT_WINDOW_X 100 +#define GLUT_WINDOW_Y 101 +#define GLUT_WINDOW_WIDTH 102 +#define GLUT_WINDOW_HEIGHT 103 +#define GLUT_WINDOW_BUFFER_SIZE 104 +#define GLUT_WINDOW_STENCIL_SIZE 105 +#define GLUT_WINDOW_DEPTH_SIZE 106 +#define GLUT_WINDOW_RED_SIZE 107 +#define GLUT_WINDOW_GREEN_SIZE 108 +#define GLUT_WINDOW_BLUE_SIZE 109 +#define GLUT_WINDOW_ALPHA_SIZE 110 +#define GLUT_WINDOW_ACCUM_RED_SIZE 111 +#define GLUT_WINDOW_ACCUM_GREEN_SIZE 112 +#define GLUT_WINDOW_ACCUM_BLUE_SIZE 113 +#define GLUT_WINDOW_ACCUM_ALPHA_SIZE 114 +#define GLUT_WINDOW_DOUBLEBUFFER 115 +#define GLUT_WINDOW_RGBA 116 +#define GLUT_WINDOW_PARENT 117 +#define GLUT_WINDOW_NUM_CHILDREN 118 +#define GLUT_WINDOW_COLORMAP_SIZE 119 +#define GLUT_WINDOW_NUM_SAMPLES 120 +#define GLUT_WINDOW_STEREO 121 +#define GLUT_WINDOW_CURSOR 122 +#define GLUT_SCREEN_WIDTH 200 +#define GLUT_SCREEN_HEIGHT 201 +#define GLUT_SCREEN_WIDTH_MM 202 +#define GLUT_SCREEN_HEIGHT_MM 203 +#define GLUT_MENU_NUM_ITEMS 300 +#define GLUT_DISPLAY_MODE_POSSIBLE 400 +#define GLUT_INIT_WINDOW_X 500 +#define GLUT_INIT_WINDOW_Y 501 +#define GLUT_INIT_WINDOW_WIDTH 502 +#define GLUT_INIT_WINDOW_HEIGHT 503 +#define GLUT_INIT_DISPLAY_MODE 504 +#define GLUT_ELAPSED_TIME 700 +#define GLUT_WINDOW_FORMAT_ID 123 + +/* glutDeviceGet parameters. */ +#define GLUT_HAS_KEYBOARD 600 +#define GLUT_HAS_MOUSE 601 +#define GLUT_HAS_SPACEBALL 602 +#define GLUT_HAS_DIAL_AND_BUTTON_BOX 603 +#define GLUT_HAS_TABLET 604 +#define GLUT_NUM_MOUSE_BUTTONS 605 +#define GLUT_NUM_SPACEBALL_BUTTONS 606 +#define GLUT_NUM_BUTTON_BOX_BUTTONS 607 +#define GLUT_NUM_DIALS 608 +#define GLUT_NUM_TABLET_BUTTONS 609 +#define GLUT_DEVICE_IGNORE_KEY_REPEAT 610 +#define GLUT_DEVICE_KEY_REPEAT 611 +#define GLUT_HAS_JOYSTICK 612 +#define GLUT_OWNS_JOYSTICK 613 +#define GLUT_JOYSTICK_BUTTONS 614 +#define GLUT_JOYSTICK_AXES 615 +#define GLUT_JOYSTICK_POLL_RATE 616 + +/* glutLayerGet parameters. */ +#define GLUT_OVERLAY_POSSIBLE 800 +#define GLUT_LAYER_IN_USE 801 +#define GLUT_HAS_OVERLAY 802 +#define GLUT_TRANSPARENT_INDEX 803 +#define GLUT_NORMAL_DAMAGED 804 +#define GLUT_OVERLAY_DAMAGED 805 + +/* glutVideoResizeGet parameters. */ +#define GLUT_VIDEO_RESIZE_POSSIBLE 900 +#define GLUT_VIDEO_RESIZE_IN_USE 901 +#define GLUT_VIDEO_RESIZE_X_DELTA 902 +#define GLUT_VIDEO_RESIZE_Y_DELTA 903 +#define GLUT_VIDEO_RESIZE_WIDTH_DELTA 904 +#define GLUT_VIDEO_RESIZE_HEIGHT_DELTA 905 +#define GLUT_VIDEO_RESIZE_X 906 +#define GLUT_VIDEO_RESIZE_Y 907 +#define GLUT_VIDEO_RESIZE_WIDTH 908 +#define GLUT_VIDEO_RESIZE_HEIGHT 909 + +/* glutUseLayer parameters. */ +#define GLUT_NORMAL 0 +#define GLUT_OVERLAY 1 + +/* glutGetModifiers return mask. */ +#define GLUT_ACTIVE_SHIFT 1 +#define GLUT_ACTIVE_CTRL 2 +#define GLUT_ACTIVE_ALT 4 + +/* glutSetCursor parameters. */ +/* Basic arrows. */ +#define GLUT_CURSOR_RIGHT_ARROW 0 +#define GLUT_CURSOR_LEFT_ARROW 1 +/* Symbolic cursor shapes. */ +#define GLUT_CURSOR_INFO 2 +#define GLUT_CURSOR_DESTROY 3 +#define GLUT_CURSOR_HELP 4 +#define GLUT_CURSOR_CYCLE 5 +#define GLUT_CURSOR_SPRAY 6 +#define GLUT_CURSOR_WAIT 7 +#define GLUT_CURSOR_TEXT 8 +#define GLUT_CURSOR_CROSSHAIR 9 +/* Directional cursors. */ +#define GLUT_CURSOR_UP_DOWN 10 +#define GLUT_CURSOR_LEFT_RIGHT 11 +/* Sizing cursors. */ +#define GLUT_CURSOR_TOP_SIDE 12 +#define GLUT_CURSOR_BOTTOM_SIDE 13 +#define GLUT_CURSOR_LEFT_SIDE 14 +#define GLUT_CURSOR_RIGHT_SIDE 15 +#define GLUT_CURSOR_TOP_LEFT_CORNER 16 +#define GLUT_CURSOR_TOP_RIGHT_CORNER 17 +#define GLUT_CURSOR_BOTTOM_RIGHT_CORNER 18 +#define GLUT_CURSOR_BOTTOM_LEFT_CORNER 19 +/* Inherit from parent window. */ +#define GLUT_CURSOR_INHERIT 100 +/* Blank cursor. */ +#define GLUT_CURSOR_NONE 101 +/* Fullscreen crosshair (if available). */ +#define GLUT_CURSOR_FULL_CROSSHAIR 102 + +/* GLUT initialization sub-API. */ +GLUTAPI void APIENTRY glutInit(int *argcp, char **argv); +GLUTAPI void APIENTRY glutInitDisplayMode(unsigned int mode); +GLUTAPI void APIENTRY glutInitWindowPosition(int x, int y); +GLUTAPI void APIENTRY glutInitWindowSize(int width, int height); +GLUTAPI void APIENTRY glutMainLoop(void); + +/* GLUT window sub-API. */ +GLUTAPI int APIENTRY glutCreateWindow(const char *title); +GLUTAPI int APIENTRY glutCreateSubWindow(int win, int x, int y, int width, int height); +GLUTAPI void APIENTRY glutDestroyWindow(int win); +GLUTAPI void APIENTRY glutPostRedisplay(void); +GLUTAPI void APIENTRY glutSwapBuffers(void); +GLUTAPI int APIENTRY glutGetWindow(void); +GLUTAPI void APIENTRY glutSetWindow(int win); +GLUTAPI void APIENTRY glutSetWindowTitle(const char *title); +GLUTAPI void APIENTRY glutSetIconTitle(const char *title); +GLUTAPI void APIENTRY glutPositionWindow(int x, int y); +GLUTAPI void APIENTRY glutReshapeWindow(int width, int height); +GLUTAPI void APIENTRY glutPopWindow(void); +GLUTAPI void APIENTRY glutPushWindow(void); +GLUTAPI void APIENTRY glutIconifyWindow(void); +GLUTAPI void APIENTRY glutShowWindow(void); +GLUTAPI void APIENTRY glutHideWindow(void); + +/* GLUT overlay sub-API. */ +GLUTAPI void APIENTRY glutEstablishOverlay(void); +GLUTAPI void APIENTRY glutRemoveOverlay(void); +GLUTAPI void APIENTRY glutUseLayer(GLenum layer); +GLUTAPI void APIENTRY glutPostOverlayRedisplay(void); +GLUTAPI void APIENTRY glutShowOverlay(void); +GLUTAPI void APIENTRY glutHideOverlay(void); + +/* GLUT menu sub-API. */ +GLUTAPI int APIENTRY glutCreateMenu(void (GLUTCALLBACK *)(int)); +GLUTAPI void APIENTRY glutDestroyMenu(int menu); +GLUTAPI int APIENTRY glutGetMenu(void); +GLUTAPI void APIENTRY glutSetMenu(int menu); +GLUTAPI void APIENTRY glutAddMenuEntry(const char *label, int value); +GLUTAPI void APIENTRY glutAddSubMenu(const char *label, int submenu); +GLUTAPI void APIENTRY glutChangeToMenuEntry(int item, const char *label, int value); +GLUTAPI void APIENTRY glutChangeToSubMenu(int item, const char *label, int submenu); +GLUTAPI void APIENTRY glutRemoveMenuItem(int item); +GLUTAPI void APIENTRY glutAttachMenu(int button); +GLUTAPI void APIENTRY glutDetachMenu(int button); + +/* GLUT window callback sub-API. */ +GLUTAPI void APIENTRY glutDisplayFunc(void (GLUTCALLBACK * func)(void)); +GLUTAPI void APIENTRY glutReshapeFunc(void (GLUTCALLBACK * func)(int width, int height)); +GLUTAPI void APIENTRY glutKeyboardFunc(void (GLUTCALLBACK * func)(unsigned char key, int x, int y)); +GLUTAPI void APIENTRY glutMouseFunc(void (GLUTCALLBACK * func)(int button, int state, int x, int y)); +GLUTAPI void APIENTRY glutMotionFunc(void (GLUTCALLBACK * func)(int x, int y)); +GLUTAPI void APIENTRY glutPassiveMotionFunc(void (GLUTCALLBACK * func)(int x, int y)); +GLUTAPI void APIENTRY glutEntryFunc(void (GLUTCALLBACK * func)(int state)); +GLUTAPI void APIENTRY glutVisibilityFunc(void (GLUTCALLBACK * func)(int state)); +GLUTAPI void APIENTRY glutIdleFunc(void (GLUTCALLBACK * func)(void)); +GLUTAPI void APIENTRY glutTimerFunc(unsigned int millis, void (GLUTCALLBACK * func)(int value), int value); +GLUTAPI void APIENTRY glutMenuStateFunc(void (GLUTCALLBACK * func)(int state)); +GLUTAPI void APIENTRY glutSpecialFunc(void (GLUTCALLBACK * func)(int key, int x, int y)); +GLUTAPI void APIENTRY glutSpaceballMotionFunc(void (GLUTCALLBACK * func)(int x, int y, int z)); +GLUTAPI void APIENTRY glutSpaceballRotateFunc(void (GLUTCALLBACK * func)(int x, int y, int z)); +GLUTAPI void APIENTRY glutSpaceballButtonFunc(void (GLUTCALLBACK * func)(int button, int state)); +GLUTAPI void APIENTRY glutButtonBoxFunc(void (GLUTCALLBACK * func)(int button, int state)); +GLUTAPI void APIENTRY glutDialsFunc(void (GLUTCALLBACK * func)(int dial, int value)); +GLUTAPI void APIENTRY glutTabletMotionFunc(void (GLUTCALLBACK * func)(int x, int y)); +GLUTAPI void APIENTRY glutTabletButtonFunc(void (GLUTCALLBACK * func)(int button, int state, int x, int y)); +GLUTAPI void APIENTRY glutMenuStatusFunc(void (GLUTCALLBACK * func)(int status, int x, int y)); +GLUTAPI void APIENTRY glutOverlayDisplayFunc(void (GLUTCALLBACK * func)(void)); +GLUTAPI void APIENTRY glutWindowStatusFunc(void (GLUTCALLBACK * func)(int state)); + +/* GLUT color index sub-API. */ +GLUTAPI void APIENTRY glutSetColor(int, GLfloat red, GLfloat green, GLfloat blue); +GLUTAPI GLfloat APIENTRY glutGetColor(int ndx, int component); +GLUTAPI void APIENTRY glutCopyColormap(int win); + +/* GLUT state retrieval sub-API. */ +GLUTAPI int APIENTRY glutGet(GLenum type); +GLUTAPI int APIENTRY glutDeviceGet(GLenum type); + +/* GLUT font sub-API */ +GLUTAPI void APIENTRY glutBitmapCharacter(void *font, int character); +GLUTAPI int APIENTRY glutBitmapWidth(void *font, int character); +GLUTAPI void APIENTRY glutStrokeCharacter(void *font, int character); +GLUTAPI int APIENTRY glutStrokeWidth(void *font, int character); + +/* GLUT pre-built models sub-API */ +GLUTAPI void APIENTRY glutWireSphere(GLdouble radius, GLint slices, GLint stacks); +GLUTAPI void APIENTRY glutSolidSphere(GLdouble radius, GLint slices, GLint stacks); +GLUTAPI void APIENTRY glutWireCone(GLdouble base, GLdouble height, GLint slices, GLint stacks); +GLUTAPI void APIENTRY glutSolidCone(GLdouble base, GLdouble height, GLint slices, GLint stacks); +GLUTAPI void APIENTRY glutWireCube(GLdouble size); +GLUTAPI void APIENTRY glutSolidCube(GLdouble size); +GLUTAPI void APIENTRY glutWireTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings); +GLUTAPI void APIENTRY glutSolidTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings); +GLUTAPI void APIENTRY glutWireDodecahedron(void); +GLUTAPI void APIENTRY glutSolidDodecahedron(void); +GLUTAPI void APIENTRY glutWireTeapot(GLdouble size); +GLUTAPI void APIENTRY glutSolidTeapot(GLdouble size); +GLUTAPI void APIENTRY glutWireOctahedron(void); +GLUTAPI void APIENTRY glutSolidOctahedron(void); +GLUTAPI void APIENTRY glutWireTetrahedron(void); +GLUTAPI void APIENTRY glutSolidTetrahedron(void); +GLUTAPI void APIENTRY glutWireIcosahedron(void); +GLUTAPI void APIENTRY glutSolidIcosahedron(void); + +#endif /* __AGLUT_H__ */ --- mesa-glw-7.4.orig/include/GL/Makefile.am +++ mesa-glw-7.4/include/GL/Makefile.am @@ -0,0 +1,38 @@ +## Process this file with automake to produce Makefile.in + +GLincludedir = $(includedir)/GL + +INC_GGI = ggimesa.h +INC_OSMESA = osmesa.h +INC_SVGA = svgamesa.h +INC_X11 = glx.h glxext.h glx_mangle.h +INC_GLUT = glut.h glutf90.h + +if HAVE_GGI +sel_inc_ggi = $(INC_GGI) +endif + +if HAVE_OSMESA +sel_inc_osmesa = $(INC_OSMESA) +endif + +if HAVE_SVGA +sel_inc_svga = $(INC_SVGA) +endif + +if HAVE_X11 +sel_inc_x11 = $(INC_X11) +endif + +if NEED_GLUT +sel_inc_glut = $(INC_GLUT) +endif + +EXTRA_HEADERS = amesa.h dosmesa.h foomesa.h glut_h.dja mesa_wgl.h mglmesa.h \ + vms_x_fix.h wmesa.h \ + $(INC_GGI) $(INC_OSMESA) $(INC_SVGA) $(INC_X11) $(INC_GLUT) + +GLinclude_HEADERS = gl.h glext.h gl_mangle.h glu.h glu_mangle.h \ + $(sel_inc_ggi) $(sel_inc_osmesa) $(sel_inc_svga) \ + $(sel_inc_x11) $(sel_inc_glut) +include $(top_srcdir)/common_rules.make --- mesa-glw-7.4.orig/include/GL/directfbgl.h +++ mesa-glw-7.4/include/GL/directfbgl.h @@ -0,0 +1,89 @@ +/* + (c) Copyright 2001 convergence integrated media GmbH. + All rights reserved. + + Written by Denis Oliver Kropp and + Andreas Hundt . + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the + Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. +*/ + +#ifndef __DIRECTFBGL_H__ +#define __DIRECTFBGL_H__ + +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + + +typedef struct { + int buffer_size; + int depth_size; + int stencil_size; + int aux_buffers; + + int red_size; + int green_size; + int blue_size; + int alpha_size; + + int accum_red_size; + int accum_green_size; + int accum_blue_size; + int accum_alpha_size; + + DFBBoolean double_buffer; + DFBBoolean stereo; +} DFBGLAttributes; + + +DEFINE_INTERFACE( IDirectFBGL, + + /** Context handling **/ + + /* + * Acquire the hardware lock. + */ + DFBResult (*Lock) ( + IDirectFBGL *thiz + ); + + /* + * Release the lock. + */ + DFBResult (*Unlock) ( + IDirectFBGL *thiz + ); + + /* + * Query the OpenGL attributes. + */ + DFBResult (*GetAttributes) ( + IDirectFBGL *thiz, + DFBGLAttributes *attributes + ); +) + + +#ifdef __cplusplus +} +#endif + +#endif + --- mesa-glw-7.4.orig/include/GL/miniglx.h +++ mesa-glw-7.4/include/GL/miniglx.h @@ -0,0 +1,482 @@ +/* + * Mesa 3-D graphics library + * Version: 6.1 + * + * Copyright (C) 1999-2004 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 miniglx.h + * \brief Mini GLX interface functions. + * \author Brian Paul + * + * See comments miniglx.c for more information. + */ + +#ifndef MINIGLX_H +#define MINIGLX_H + +#include +#include + + +#ifdef __cplusplus +extern "C" { +#endif + + +/** + * \name Replacement Xlib/GLX types + */ +/*@{*/ +/** + * \brief Boolean type. + * + * It can have the values #True or #False. + */ +#ifndef MINIGLX_NO_XTYPES +typedef int Bool; +#endif +typedef int MINI_Bool; + +/** + * \brief Color map. + * + * Alias for private ::MiniGLXColormapRec structure. + */ +typedef struct MiniGLXColormapRec *MINI_Colormap; +#ifndef MINIGLX_NO_XTYPES +typedef struct MiniGLXColormapRec *Colormap; +#endif + +/** + * \brief Window attributes. + */ +typedef struct MiniGLXSetWindowAttributesRec { + int background_pixel; /**< \brief background pixel */ + int border_pixel; /**< \brief border pixel value */ + MINI_Colormap colormap; /**< \brief color map to be associated with window */ + int event_mask; /**< \brief set of events that should be saved */ +} XSetWindowAttributes; + +/** + * \brief Visual. + * + * Alias for the private ::MiniGLXVisualRec structure. + * + * \sa \ref datatypes. + */ +typedef struct MiniGLXVisualRec Visual; + +/** + * \brief Visual information. + * + * \sa \ref datatypes. + */ +#ifndef MINIGLX_NO_XTYPES +typedef unsigned long VisualID; +#endif +typedef unsigned long MINI_VisualID; +typedef struct MiniGLXXVisualInfoRec { + Visual *visual; /**< \brief pointer to the GLX Visual */ + MINI_VisualID visualid; /**< \brief visual ID */ + int screen; /**< \brief screen number */ + int depth; /**< \brief bit depth */ +#if defined(__cplusplus) || defined(c_plusplus) + int c_class; /**< \brief class */ +#else + int class; /**< \brief class */ +#endif + int bits_per_rgb; /**< \brief total bits per pixel */ +} XVisualInfo; + +/** + * \brief GLX Frame Buffer Configuration (for pbuffers) + * \sa \ref datatypes. + */ +typedef struct MiniGLXFBConfigRec { + XVisualInfo *visInfo; +} GLXFBConfig; + + +/** + * \brief Display handle. + * + * Alias for the private ::MiniGLXDisplayRec structure. + * + * \sa \ref datatypes. + */ +#ifndef MINIGLX_NO_XTYPES +typedef struct MiniGLXDisplayRec Display; +#endif +typedef struct MiniGLXDisplayRec MINI_Display; + +/** + * \brief Window handle. + * + * Alias for the private ::MiniGLXWindowRec structure. + * + * \sa \ref datatypes. + */ +#ifndef MINIGLX_NO_XTYPES +typedef struct MiniGLXWindowRec *Window; +#endif +typedef struct MiniGLXWindowRec *MINI_Window; + +/** + * \brief Drawable. + * + * Alias for the private ::MiniGLXWindowRec structure. + * + * For Mini GLX only the full-screen window can be used as source and + * destination in graphics operations. + * + * \sa \ref datatypes. + */ +#ifndef MINIGLX_NO_XTYPES +typedef struct MiniGLXWindowRec *Drawable; +#endif +typedef struct MiniGLXWindowRec *MINI_Drawable; + +/** + * \brief GLX drawable. + * + * Alias for the private ::MiniGLXWindowRec structure. + * + * Same as #Drawable. + * + * \sa \ref datatypes. + */ +typedef struct MiniGLXWindowRec *GLXDrawable; + +/** + * \brief GLX pbuffer. + * + * Alias for the private ::MiniGLXWindowRec structure. + * + * Same as #Drawable. + * + * \sa \ref datatypes. + */ +typedef struct MiniGLXWindowRec *GLXPbuffer; + +/** + * \brief GLX context. + * + * Alias for the private ::MiniGLXContext structure. + * + * \sa \ref datatypes. + */ +typedef struct MiniGLXContextRec *GLXContext; +/*@}*/ + + +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + MINI_Bool send_event; /* true if this came from a SendEvent request */ + MINI_Display *display; /* Display the event was read from */ + MINI_Window window; + int x, y; + int width, height; + int count; /* if non-zero, at least this many more */ +} XExposeEvent; + +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + MINI_Bool send_event; /* true if this came from a SendEvent request */ + MINI_Display *display; /* Display the event was read from */ + MINI_Window parent; /* parent of the window */ + MINI_Window window; /* window id of window created */ + int x, y; /* window location */ + int width, height; /* size of window */ + int border_width; /* border width */ + MINI_Bool override_redirect; /* creation should be overridden */ +} XCreateWindowEvent; + +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + MINI_Bool send_event; /* true if this came from a SendEvent request */ + MINI_Display *display; /* Display the event was read from */ + MINI_Window event; + MINI_Window window; +} XDestroyWindowEvent; + +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + MINI_Bool send_event; /* true if this came from a SendEvent request */ + MINI_Display *display; /* Display the event was read from */ + MINI_Window event; + MINI_Window window; + MINI_Bool from_configure; +} XUnmapEvent; + +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + MINI_Bool send_event; /* true if this came from a SendEvent request */ + MINI_Display *display; /* Display the event was read from */ + MINI_Window event; + MINI_Window window; + MINI_Bool override_redirect; /* boolean, is override set... */ +} XMapEvent; + + +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + MINI_Bool send_event; /* true if this came from a SendEvent request */ + MINI_Display *display; /* Display the event was read from */ + MINI_Window parent; + MINI_Window window; +} XMapRequestEvent; + +typedef union _XEvent { + int type; /* must not be changed; first element */ + XExposeEvent xexpose; + XCreateWindowEvent xcreatewindow; + XDestroyWindowEvent xdestroywindow; + XUnmapEvent xunmap; + XMapEvent xmap; + XMapRequestEvent xmaprequest; + long pad[24]; +} XEvent; + + +/** + * \name Xlib constants + */ +/*@{*/ +#define False 0 +#define True 1 +#define None 0 +#define AllocNone 0 +#define InputOutput 1 +#define ExposureMask (1L<<15) +#define StructureNotifyMask (1L<<17) +#define CWBackPixel (1L<<1) +#define CWBorderPixel (1L<<3) +#define CWEventMask (1L<<11) +#define CWColormap (1L<<13) +#define PseudoColor 3 +#define TrueColor 4 +#define VisualIDMask 0x1 +#define VisualScreenMask 0x2 +#define Expose 12 +#define CreateNotify 16 +#define DestroyNotify 17 +#define UnmapNotify 18 +#define MapNotify 19 +#define MapRequest 20 + +/*@}*/ + +/** + * \name Standard GLX tokens + */ +/*@{*/ +#define GLX_USE_GL 1 +#define GLX_BUFFER_SIZE 2 +#define GLX_LEVEL 3 +#define GLX_RGBA 4 +#define GLX_DOUBLEBUFFER 5 +#define GLX_STEREO 6 +#define GLX_AUX_BUFFERS 7 +#define GLX_RED_SIZE 8 +#define GLX_GREEN_SIZE 9 +#define GLX_BLUE_SIZE 10 +#define GLX_ALPHA_SIZE 11 +#define GLX_DEPTH_SIZE 12 +#define GLX_STENCIL_SIZE 13 +#define GLX_ACCUM_RED_SIZE 14 +#define GLX_ACCUM_GREEN_SIZE 15 +#define GLX_ACCUM_BLUE_SIZE 16 +#define GLX_ACCUM_ALPHA_SIZE 17 +#define GLX_BAD_ATTRIBUTE 1 +#define GLX_BAD_VISUAL 4 +/*@}*/ + + +/** + * \name Unique to Mini GLX + * + * At compile time, the Mini GLX interface version can be tested with the + * MINI_GLX_VERSION_1_x preprocessor tokens. + * + * \sa glXQueryVersion() + */ +/*@{*/ +/** \brief Defined if version 1.0 of Mini GLX is supported. */ +#define MINI_GLX_VERSION_1_0 1 +/** \brief Defined if version 1.1 of Mini GLX is supported. */ +#define MINI_GLX_VERSION_1_1 1 +/*@}*/ + + +/** + * \name Server-specific functions + */ +extern MINI_Display * +__miniglx_StartServer( const char *display_name ); + +extern int +__miniglx_Select( MINI_Display *dpy, int maxfd, + fd_set *rfds, fd_set *wfds, fd_set *xfds, + struct timeval *tv ); + + +/** + * \name Simulated Xlib functions + */ +/*@{*/ +extern MINI_Display * +XOpenDisplay( const char *dpy_name ); + + +extern void +XCloseDisplay( MINI_Display *display ); + +extern MINI_Window +XCreateWindow( MINI_Display *display, MINI_Window parent, int x, int y, + unsigned int width, unsigned int height, + unsigned int border_width, int depth, unsigned int winclass, + Visual *visual, unsigned long valuemask, + XSetWindowAttributes *attributes ); + +extern int +XNextEvent(MINI_Display *display, XEvent *event_return); + +extern MINI_Bool +XCheckMaskEvent( MINI_Display *dpy, long event_mask, XEvent *event_return ); + +/** + * \brief Return the root window. + * + * \param display the display handle. It is ignored by Mini GLX, but should be + * the value returned by XOpenDisplay(). + * \param screen the screen number on the host server. It is ignored by Mini + * GLX but should be zero. + * + * \return the root window. Always zero on Mini GLX. + */ +#define RootWindow(display, screen) 0 +#define DefaultScreen(dpy) 0 + +extern void +XDestroyWindow( MINI_Display *display, MINI_Window w ); + +extern void +XMapWindow( MINI_Display *display, MINI_Window w ); + +/* Should clients have access to this? + */ +extern void +XUnmapWindow( MINI_Display *display, MINI_Window w ); + +extern MINI_Colormap +XCreateColormap( MINI_Display *display, MINI_Window w, Visual *visual, int alloc ); + +extern void +XFreeColormap( MINI_Display *display, MINI_Colormap cmap ); + +extern void +XFree( void *data ); + +extern XVisualInfo * +XGetVisualInfo( MINI_Display *display, long vinfo_mask, + XVisualInfo *vinfo_template, int *nitems_return ); +/*@}*/ + + + +/** + * \name GLX functions + */ +/*@{*/ +extern XVisualInfo* +glXChooseVisual( MINI_Display *dpy, int screen, int *attribList ); + +extern int +glXGetConfig( MINI_Display *dpy, XVisualInfo *vis, int attrib, int *value ); + +extern GLXContext +glXCreateContext( MINI_Display *dpy, XVisualInfo *vis, + GLXContext shareList, MINI_Bool direct ); + +extern void +glXDestroyContext( MINI_Display *dpy, GLXContext ctx ); + +extern MINI_Bool +glXMakeCurrent( MINI_Display *dpy, GLXDrawable drawable, GLXContext ctx); + +extern void +glXSwapBuffers( MINI_Display *dpy, GLXDrawable drawable ); + +extern GLXContext +glXGetCurrentContext( void ); + +extern GLXDrawable +glXGetCurrentDrawable( void ); + +extern void +(*glXGetProcAddress(const GLubyte *procname))( void ); + +extern MINI_Bool +glXQueryVersion( MINI_Display *dpy, int *major, int *minor ); + +/* Added in MiniGLX 1.1 */ +extern GLXPbuffer +glXCreatePbuffer( MINI_Display *dpy, GLXFBConfig config, const int *attribList ); + +extern void +glXDestroyPbuffer( MINI_Display *dpy, GLXPbuffer pbuf ); + +extern GLXFBConfig * +glXChooseFBConfig( MINI_Display *dpy, int screen, const int *attribList, + int *nitems ); + +extern XVisualInfo * +glXGetVisualFromFBConfig( MINI_Display *dpy, GLXFBConfig config ); + +extern void *glXAllocateMemoryMESA(Display *dpy, int scrn, + size_t size, float readFreq, + float writeFreq, float priority); + +extern void glXFreeMemoryMESA(Display *dpy, int scrn, void *pointer); + +extern GLuint glXGetMemoryOffsetMESA( Display *dpy, int scrn, + const void *pointer ); +/*@}*/ + +extern void +__glXScrEnableExtension( void *, const char * name ); + +/*@}*/ + + +#ifdef __cplusplus +} +#endif + +#endif /* MINIGLX_H */ --- mesa-glw-7.4.orig/progs/demos/extfuncs.h +++ mesa-glw-7.4/progs/demos/extfuncs.h @@ -46,13 +46,6 @@ static PFNGLVERTEXATTRIB2FPROC glVertexAttrib2f_func = NULL; static PFNGLVERTEXATTRIB3FPROC glVertexAttrib3f_func = NULL; static PFNGLVERTEXATTRIB4FPROC glVertexAttrib4f_func = NULL; -static PFNGLVERTEXATTRIB1FVPROC glVertexAttrib1fv_func = NULL; -static PFNGLVERTEXATTRIB2FVPROC glVertexAttrib2fv_func = NULL; -static PFNGLVERTEXATTRIB3FVPROC glVertexAttrib3fv_func = NULL; -static PFNGLVERTEXATTRIB4FVPROC glVertexAttrib4fv_func = NULL; -static PFNGLVERTEXATTRIBPOINTERPROC glVertexAttribPointer_func = NULL; -static PFNGLENABLEVERTEXATTRIBARRAYPROC glEnableVertexAttribArray_func = NULL; -static PFNGLDISABLEVERTEXATTRIBARRAYPROC glDisableVertexAttribArray_func = NULL; /* OpenGL 2.1 */ static PFNGLUNIFORMMATRIX2X3FVPROC glUniformMatrix2x3fv_func = NULL; @@ -133,14 +126,6 @@ glVertexAttrib2f_func = (PFNGLVERTEXATTRIB2FPROC) glutGetProcAddress("glVertexAttrib2f"); glVertexAttrib3f_func = (PFNGLVERTEXATTRIB3FPROC) glutGetProcAddress("glVertexAttrib3f"); glVertexAttrib4f_func = (PFNGLVERTEXATTRIB4FPROC) glutGetProcAddress("glVertexAttrib4f"); - glVertexAttrib1fv_func = (PFNGLVERTEXATTRIB1FVPROC) glutGetProcAddress("glVertexAttrib1fv"); - glVertexAttrib2fv_func = (PFNGLVERTEXATTRIB2FVPROC) glutGetProcAddress("glVertexAttrib2fv"); - glVertexAttrib3fv_func = (PFNGLVERTEXATTRIB3FVPROC) glutGetProcAddress("glVertexAttrib3fv"); - glVertexAttrib4fv_func = (PFNGLVERTEXATTRIB4FVPROC) glutGetProcAddress("glVertexAttrib4fv"); - - glVertexAttribPointer_func = (PFNGLVERTEXATTRIBPOINTERPROC) glutGetProcAddress("glVertexAttribPointer"); - glEnableVertexAttribArray_func = (PFNGLENABLEVERTEXATTRIBARRAYPROC) glutGetProcAddress("glEnableVertexAttribArray"); - glDisableVertexAttribArray_func = (PFNGLDISABLEVERTEXATTRIBARRAYPROC) glutGetProcAddress("glDisableVertexAttribArray"); /* OpenGL 2.1 */ glUniformMatrix2x3fv_func = (PFNGLUNIFORMMATRIX2X3FVPROC) glutGetProcAddress("glUniformMatrix2x3fv"); --- mesa-glw-7.4.orig/progs/glsl/readtex.h +++ mesa-glw-7.4/progs/glsl/readtex.h @@ -0,0 +1,26 @@ +/* readtex.h */ + +#ifndef READTEX_H +#define READTEX_H + + +#include + + +extern GLboolean +LoadRGBMipmaps( const char *imageFile, GLint intFormat ); + + +extern GLboolean +LoadRGBMipmaps2( const char *imageFile, GLenum target, + GLint intFormat, GLint *width, GLint *height ); + + +extern GLubyte * +LoadRGBImage( const char *imageFile, + GLint *width, GLint *height, GLenum *format ); + +extern GLushort * +LoadYUVImage( const char *imageFile, GLint *width, GLint *height ); + +#endif --- mesa-glw-7.4.orig/progs/ggi/blat +++ mesa-glw-7.4/progs/ggi/blat @@ -0,0 +1,7 @@ +#!/bin/sh + +function foobar() { + echo "foo!" +} + +foobar --- mesa-glw-7.4.orig/progs/ggi/cone.asc +++ mesa-glw-7.4/progs/ggi/cone.asc @@ -0,0 +1,198 @@ +Ambient light color: Red=0.039216 Green=0.039216 Blue=0.039216 + +Named object: "Object01" +Tri-mesh, Vertices: 34 Faces: 64 +Vertex list: +Vertex 0: X: 60.167416 Y: -87.419525 Z: -53.3088 +Vertex 1: X: 76.70787 Y: -87.419518 Z: -29.84565 +Vertex 2: X: 83.0103 Y: -87.419518 Z: -1.838764 +Vertex 3: X: 78.115204 Y: -87.419518 Z: 26.448057 +Vertex 4: X: 62.767834 Y: -87.41951 Z: 50.708401 +Vertex 5: X: 39.304672 Y: -87.41951 Z: 67.248848 +Vertex 6: X: 11.297782 Y: -87.41951 Z: 73.551254 +Vertex 7: X: -16.989004 Y: -87.41951 Z: 68.656158 +Vertex 8: X: -41.249344 Y: -87.41951 Z: 53.308777 +Vertex 9: X: -57.789783 Y: -87.419518 Z: 29.845612 +Vertex 10: X: -64.092194 Y: -87.419518 Z: 1.838721 +Vertex 11: X: -59.197079 Y: -87.419518 Z: -26.448097 +Vertex 12: X: -43.849678 Y: -87.419525 Z: -50.708427 +Vertex 13: X: -20.386503 Y: -87.419525 Z: -67.248856 +Vertex 14: X: 7.62039 Y: -87.419525 Z: -73.551239 +Vertex 15: X: 35.907204 Y: -87.419525 Z: -68.656105 +Vertex 16: X: 101.684875 Y: 94.590591 Z: -96.955391 +Vertex 17: X: 131.767838 Y: 94.590591 Z: -54.281792 +Vertex 18: X: 143.230377 Y: 94.590599 Z: -3.344275 +Vertex 19: X: 134.327423 Y: 94.590607 Z: 48.102379 +Vertex 20: X: 106.414383 Y: 94.590607 Z: 92.225876 +Vertex 21: X: 63.740765 Y: 94.590607 Z: 122.3088 +Vertex 22: X: 12.803238 Y: 94.590614 Z: 133.771301 +Vertex 23: X: -38.643349 Y: 94.590607 Z: 124.868355 +Vertex 24: X: -82.766846 Y: 94.590607 Z: 96.955307 +Vertex 25: X: -112.849762 Y: 94.590607 Z: 54.281677 +Vertex 26: X: -124.312256 Y: 94.590599 Z: 3.344152 +Vertex 27: X: -115.409271 Y: 94.590591 Z: -48.102493 +Vertex 28: X: -87.496201 Y: 94.590591 Z: -92.225967 +Vertex 29: X: -44.822552 Y: 94.590591 Z: -122.308861 +Vertex 30: X: 6.114983 Y: 94.590584 Z: -133.771332 +Vertex 31: X: 57.561623 Y: 94.590591 Z: -124.868301 +Vertex 32: X: 9.459057 Y: -87.419518 Z: 0.000008 +Vertex 33: X: 9.459057 Y: 94.590599 Z: -0.000008 +Face list: +Face 0: A:0 B:1 C:32 AB:1 BC:0 CA:0 +Smoothing: 1 +Face 1: A:1 B:2 C:32 AB:1 BC:0 CA:0 +Smoothing: 1 +Face 2: A:2 B:3 C:32 AB:1 BC:0 CA:0 +Smoothing: 1 +Face 3: A:3 B:4 C:32 AB:1 BC:0 CA:0 +Smoothing: 1 +Face 4: A:4 B:5 C:32 AB:1 BC:0 CA:0 +Smoothing: 1 +Face 5: A:5 B:6 C:32 AB:1 BC:0 CA:0 +Smoothing: 1 +Face 6: A:6 B:7 C:32 AB:1 BC:0 CA:0 +Smoothing: 1 +Face 7: A:7 B:8 C:32 AB:1 BC:0 CA:0 +Smoothing: 1 +Face 8: A:8 B:9 C:32 AB:1 BC:0 CA:0 +Smoothing: 1 +Face 9: A:9 B:10 C:32 AB:1 BC:0 CA:0 +Smoothing: 1 +Face 10: A:10 B:11 C:32 AB:1 BC:0 CA:0 + + Page 1 + + + +Smoothing: 1 +Face 11: A:11 B:12 C:32 AB:1 BC:0 CA:0 +Smoothing: 1 +Face 12: A:12 B:13 C:32 AB:1 BC:0 CA:0 +Smoothing: 1 +Face 13: A:13 B:14 C:32 AB:1 BC:0 CA:0 +Smoothing: 1 +Face 14: A:14 B:15 C:32 AB:1 BC:0 CA:0 +Smoothing: 1 +Face 15: A:15 B:0 C:32 AB:1 BC:0 CA:0 +Smoothing: 1 +Face 16: A:0 B:16 C:17 AB:1 BC:1 CA:0 +Smoothing: 2 +Face 17: A:0 B:17 C:1 AB:0 BC:1 CA:1 +Smoothing: 2 +Face 18: A:1 B:17 C:18 AB:1 BC:1 CA:0 +Smoothing: 3 +Face 19: A:1 B:18 C:2 AB:0 BC:1 CA:1 +Smoothing: 3 +Face 20: A:2 B:18 C:19 AB:1 BC:1 CA:0 +Smoothing: 4 +Face 21: A:2 B:19 C:3 AB:0 BC:1 CA:1 +Smoothing: 4 +Face 22: A:3 B:19 C:20 AB:1 BC:1 CA:0 +Smoothing: 5 +Face 23: A:3 B:20 C:4 AB:0 BC:1 CA:1 +Smoothing: 5 +Face 24: A:4 B:20 C:21 AB:1 BC:1 CA:0 +Smoothing: 6 +Face 25: A:4 B:21 C:5 AB:0 BC:1 CA:1 +Smoothing: 6 +Face 26: A:5 B:21 C:22 AB:1 BC:1 CA:0 +Smoothing: 7 +Face 27: A:5 B:22 C:6 AB:0 BC:1 CA:1 +Smoothing: 7 +Face 28: A:6 B:22 C:23 AB:1 BC:1 CA:0 +Smoothing: 8 +Face 29: A:6 B:23 C:7 AB:0 BC:1 CA:1 +Smoothing: 8 +Face 30: A:7 B:23 C:24 AB:1 BC:1 CA:0 +Smoothing: 9 +Face 31: A:7 B:24 C:8 AB:0 BC:1 CA:1 +Smoothing: 9 +Face 32: A:8 B:24 C:25 AB:1 BC:1 CA:0 +Smoothing: 10 +Face 33: A:8 B:25 C:9 AB:0 BC:1 CA:1 +Smoothing: 10 +Face 34: A:9 B:25 C:26 AB:1 BC:1 CA:0 +Smoothing: 11 +Face 35: A:9 B:26 C:10 AB:0 BC:1 CA:1 +Smoothing: 11 +Face 36: A:10 B:26 C:27 AB:1 BC:1 CA:0 +Smoothing: 12 +Face 37: A:10 B:27 C:11 AB:0 BC:1 CA:1 +Smoothing: 12 +Face 38: A:11 B:27 C:28 AB:1 BC:1 CA:0 +Smoothing: 13 +Face 39: A:11 B:28 C:12 AB:0 BC:1 CA:1 +Smoothing: 13 +Face 40: A:12 B:28 C:29 AB:1 BC:1 CA:0 +Smoothing: 14 + + Page 2 + + + +Face 41: A:12 B:29 C:13 AB:0 BC:1 CA:1 +Smoothing: 14 +Face 42: A:13 B:29 C:30 AB:1 BC:1 CA:0 +Smoothing: 15 +Face 43: A:13 B:30 C:14 AB:0 BC:1 CA:1 +Smoothing: 15 +Face 44: A:14 B:30 C:31 AB:1 BC:1 CA:0 +Smoothing: 16 +Face 45: A:14 B:31 C:15 AB:0 BC:1 CA:1 +Smoothing: 16 +Face 46: A:15 B:31 C:16 AB:1 BC:1 CA:0 +Smoothing: 17 +Face 47: A:15 B:16 C:0 AB:0 BC:1 CA:1 +Smoothing: 17 +Face 48: A:16 B:33 C:17 AB:0 BC:0 CA:1 +Smoothing: 18 +Face 49: A:17 B:33 C:18 AB:0 BC:0 CA:1 +Smoothing: 18 +Face 50: A:18 B:33 C:19 AB:0 BC:0 CA:1 +Smoothing: 18 +Face 51: A:19 B:33 C:20 AB:0 BC:0 CA:1 +Smoothing: 18 +Face 52: A:20 B:33 C:21 AB:0 BC:0 CA:1 +Smoothing: 18 +Face 53: A:21 B:33 C:22 AB:0 BC:0 CA:1 +Smoothing: 18 +Face 54: A:22 B:33 C:23 AB:0 BC:0 CA:1 +Smoothing: 18 +Face 55: A:23 B:33 C:24 AB:0 BC:0 CA:1 +Smoothing: 18 +Face 56: A:24 B:33 C:25 AB:0 BC:0 CA:1 +Smoothing: 18 +Face 57: A:25 B:33 C:26 AB:0 BC:0 CA:1 +Smoothing: 18 +Face 58: A:26 B:33 C:27 AB:0 BC:0 CA:1 +Smoothing: 18 +Face 59: A:27 B:33 C:28 AB:0 BC:0 CA:1 +Smoothing: 18 +Face 60: A:28 B:33 C:29 AB:0 BC:0 CA:1 +Smoothing: 18 +Face 61: A:29 B:33 C:30 AB:0 BC:0 CA:1 +Smoothing: 18 +Face 62: A:30 B:33 C:31 AB:0 BC:0 CA:1 +Smoothing: 18 +Face 63: A:31 B:33 C:16 AB:0 BC:0 CA:1 +Smoothing: 18 + + + + + + + + + + + + + + + + + Page 3 + + + --- mesa-glw-7.4.orig/progs/ggi/torus.asc +++ mesa-glw-7.4/progs/ggi/torus.asc @@ -0,0 +1,264 @@ +Ambient light color: Red=0.039216 Green=0.039216 Blue=0.039216 + +Named object: "Object01" +Tri-mesh, Vertices: 40 Faces: 80 +Vertex list: +Vertex 0: X: -50.170624 Y: -0.000026 Z: -240.147842 +Vertex 1: X: -80.584503 Y: -63.958851 Z: -205.014572 +Vertex 2: X: -129.795166 Y: -39.528744 Z: -148.16774 +Vertex 3: X: -129.795166 Y: 39.528721 Z: -148.16774 +Vertex 4: X: -80.584503 Y: 63.958797 Z: -205.014572 +Vertex 5: X: 85.963654 Y: -0.000002 Z: 31.490465 +Vertex 6: X: 39.614838 Y: -63.958828 Z: 34.827602 +Vertex 7: X: -35.37915 Y: -39.528728 Z: 40.227196 +Vertex 8: X: -35.37912 Y: 39.528736 Z: 40.227188 +Vertex 9: X: 39.614838 Y: 63.95882 Z: 34.827595 +Vertex 10: X: -9.852051 Y: 0.000023 Z: 319.829254 +Vertex 11: X: -44.985352 Y: -63.958805 Z: 289.415405 +Vertex 12: X: -101.832199 Y: -39.528709 Z: 240.204758 +Vertex 13: X: -101.832184 Y: 39.528755 Z: 240.204773 +Vertex 14: X: -44.985352 Y: 63.958843 Z: 289.415405 +Vertex 15: X: -281.490326 Y: 0.000035 Z: 455.963654 +Vertex 16: X: -284.827484 Y: -63.958794 Z: 409.614868 +Vertex 17: X: -290.227112 Y: -39.528702 Z: 334.62085 +Vertex 18: X: -290.227112 Y: 39.528763 Z: 334.62088 +Vertex 19: X: -284.827484 Y: 63.958855 Z: 409.614838 +Vertex 20: X: -569.829163 Y: 0.000026 Z: 360.14798 +Vertex 21: X: -539.415344 Y: -63.958801 Z: 325.014709 +Vertex 22: X: -490.204712 Y: -39.528709 Z: 268.167847 +Vertex 23: X: -490.204712 Y: 39.528755 Z: 268.167847 +Vertex 24: X: -539.415344 Y: 63.958847 Z: 325.014679 +Vertex 25: X: -705.963684 Y: 0.000002 Z: 88.509598 +Vertex 26: X: -659.614807 Y: -63.958824 Z: 85.172462 +Vertex 27: X: -584.62085 Y: -39.528725 Z: 79.77285 +Vertex 28: X: -584.62085 Y: 39.52874 Z: 79.77285 +Vertex 29: X: -659.614868 Y: 63.958824 Z: 85.172447 +Vertex 30: X: -610.147827 Y: -0.000023 Z: -199.829361 +Vertex 31: X: -575.014587 Y: -63.958847 Z: -169.415497 +Vertex 32: X: -518.167725 Y: -39.528744 Z: -120.204819 +Vertex 33: X: -518.167725 Y: 39.528721 Z: -120.204834 +Vertex 34: X: -575.014587 Y: 63.958801 Z: -169.415497 +Vertex 35: X: -338.509338 Y: -0.000035 Z: -335.963745 +Vertex 36: X: -335.172241 Y: -63.958858 Z: -289.614868 +Vertex 37: X: -329.772675 Y: -39.528751 Z: -214.620865 +Vertex 38: X: -329.772675 Y: 39.528713 Z: -214.620865 +Vertex 39: X: -335.172241 Y: 63.95879 Z: -289.614899 +Face list: +Face 0: A:0 B:6 C:1 AB:0 BC:1 CA:1 +Smoothing: 1 +Face 1: A:0 B:5 C:6 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 2: A:1 B:7 C:2 AB:0 BC:1 CA:1 +Smoothing: 2 +Face 3: A:1 B:6 C:7 AB:1 BC:1 CA:0 +Smoothing: 2 +Face 4: A:2 B:8 C:3 AB:0 BC:1 CA:1 +Smoothing: 3 +Face 5: A:2 B:7 C:8 AB:1 BC:1 CA:0 +Smoothing: 3 +Face 6: A:3 B:9 C:4 AB:0 BC:1 CA:1 +Smoothing: 4 +Face 7: A:3 B:8 C:9 AB:1 BC:1 CA:0 + + Page 1 + + + +Smoothing: 4 +Face 8: A:4 B:5 C:0 AB:0 BC:1 CA:1 +Smoothing: 5 +Face 9: A:4 B:9 C:5 AB:1 BC:1 CA:0 +Smoothing: 5 +Face 10: A:5 B:11 C:6 AB:0 BC:1 CA:1 +Smoothing: 6 +Face 11: A:5 B:10 C:11 AB:1 BC:1 CA:0 +Smoothing: 6 +Face 12: A:6 B:12 C:7 AB:0 BC:1 CA:1 +Smoothing: 7 +Face 13: A:6 B:11 C:12 AB:1 BC:1 CA:0 +Smoothing: 7 +Face 14: A:7 B:13 C:8 AB:0 BC:1 CA:1 +Smoothing: 8 +Face 15: A:7 B:12 C:13 AB:1 BC:1 CA:0 +Smoothing: 8 +Face 16: A:8 B:14 C:9 AB:0 BC:1 CA:1 +Smoothing: 9 +Face 17: A:8 B:13 C:14 AB:1 BC:1 CA:0 +Smoothing: 9 +Face 18: A:9 B:10 C:5 AB:0 BC:1 CA:1 +Smoothing: 10 +Face 19: A:9 B:14 C:10 AB:1 BC:1 CA:0 +Smoothing: 10 +Face 20: A:10 B:16 C:11 AB:0 BC:1 CA:1 +Smoothing: 11 +Face 21: A:10 B:15 C:16 AB:1 BC:1 CA:0 +Smoothing: 11 +Face 22: A:11 B:17 C:12 AB:0 BC:1 CA:1 +Smoothing: 12 +Face 23: A:11 B:16 C:17 AB:1 BC:1 CA:0 +Smoothing: 12 +Face 24: A:12 B:18 C:13 AB:0 BC:1 CA:1 +Smoothing: 13 +Face 25: A:12 B:17 C:18 AB:1 BC:1 CA:0 +Smoothing: 13 +Face 26: A:13 B:19 C:14 AB:0 BC:1 CA:1 +Smoothing: 14 +Face 27: A:13 B:18 C:19 AB:1 BC:1 CA:0 +Smoothing: 14 +Face 28: A:14 B:15 C:10 AB:0 BC:1 CA:1 +Smoothing: 15 +Face 29: A:14 B:19 C:15 AB:1 BC:1 CA:0 +Smoothing: 15 +Face 30: A:15 B:21 C:16 AB:0 BC:1 CA:1 +Smoothing: 16 +Face 31: A:15 B:20 C:21 AB:1 BC:1 CA:0 +Smoothing: 16 +Face 32: A:16 B:22 C:17 AB:0 BC:1 CA:1 +Smoothing: 17 +Face 33: A:16 B:21 C:22 AB:1 BC:1 CA:0 +Smoothing: 17 +Face 34: A:17 B:23 C:18 AB:0 BC:1 CA:1 +Smoothing: 18 +Face 35: A:17 B:22 C:23 AB:1 BC:1 CA:0 +Smoothing: 18 +Face 36: A:18 B:24 C:19 AB:0 BC:1 CA:1 +Smoothing: 19 +Face 37: A:18 B:23 C:24 AB:1 BC:1 CA:0 +Smoothing: 19 + + Page 2 + + + +Face 38: A:19 B:20 C:15 AB:0 BC:1 CA:1 +Smoothing: 20 +Face 39: A:19 B:24 C:20 AB:1 BC:1 CA:0 +Smoothing: 20 +Face 40: A:20 B:26 C:21 AB:0 BC:1 CA:1 +Smoothing: 21 +Face 41: A:20 B:25 C:26 AB:1 BC:1 CA:0 +Smoothing: 21 +Face 42: A:21 B:27 C:22 AB:0 BC:1 CA:1 +Smoothing: 22 +Face 43: A:21 B:26 C:27 AB:1 BC:1 CA:0 +Smoothing: 22 +Face 44: A:22 B:28 C:23 AB:0 BC:1 CA:1 +Smoothing: 23 +Face 45: A:22 B:27 C:28 AB:1 BC:1 CA:0 +Smoothing: 23 +Face 46: A:23 B:29 C:24 AB:0 BC:1 CA:1 +Smoothing: 24 +Face 47: A:23 B:28 C:29 AB:1 BC:1 CA:0 +Smoothing: 24 +Face 48: A:24 B:25 C:20 AB:0 BC:1 CA:1 +Smoothing: 25 +Face 49: A:24 B:29 C:25 AB:1 BC:1 CA:0 +Smoothing: 25 +Face 50: A:25 B:31 C:26 AB:0 BC:1 CA:1 +Smoothing: 26 +Face 51: A:25 B:30 C:31 AB:1 BC:1 CA:0 +Smoothing: 26 +Face 52: A:26 B:32 C:27 AB:0 BC:1 CA:1 +Smoothing: 27 +Face 53: A:26 B:31 C:32 AB:1 BC:1 CA:0 +Smoothing: 27 +Face 54: A:27 B:33 C:28 AB:0 BC:1 CA:1 +Smoothing: 28 +Face 55: A:27 B:32 C:33 AB:1 BC:1 CA:0 +Smoothing: 28 +Face 56: A:28 B:34 C:29 AB:0 BC:1 CA:1 +Smoothing: 29 +Face 57: A:28 B:33 C:34 AB:1 BC:1 CA:0 +Smoothing: 29 +Face 58: A:29 B:30 C:25 AB:0 BC:1 CA:1 +Smoothing: 30 +Face 59: A:29 B:34 C:30 AB:1 BC:1 CA:0 +Smoothing: 30 +Face 60: A:30 B:36 C:31 AB:0 BC:1 CA:1 +Smoothing: 31 +Face 61: A:30 B:35 C:36 AB:1 BC:1 CA:0 +Smoothing: 31 +Face 62: A:31 B:37 C:32 AB:0 BC:1 CA:1 +Smoothing: 32 +Face 63: A:31 B:36 C:37 AB:1 BC:1 CA:0 +Smoothing: 32 +Face 64: A:32 B:38 C:33 AB:0 BC:1 CA:1 +Smoothing: 1 +Face 65: A:32 B:37 C:38 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 66: A:33 B:39 C:34 AB:0 BC:1 CA:1 +Smoothing: 2 +Face 67: A:33 B:38 C:39 AB:1 BC:1 CA:0 +Smoothing: 2 +Face 68: A:34 B:35 C:30 AB:0 BC:1 CA:1 + + Page 3 + + + +Smoothing: 3 +Face 69: A:34 B:39 C:35 AB:1 BC:1 CA:0 +Smoothing: 3 +Face 70: A:35 B:1 C:36 AB:0 BC:1 CA:1 +Smoothing: 4 +Face 71: A:35 B:0 C:1 AB:1 BC:1 CA:0 +Smoothing: 4 +Face 72: A:36 B:2 C:37 AB:0 BC:1 CA:1 +Smoothing: 5 +Face 73: A:36 B:1 C:2 AB:1 BC:1 CA:0 +Smoothing: 5 +Face 74: A:37 B:3 C:38 AB:0 BC:1 CA:1 +Smoothing: 6 +Face 75: A:37 B:2 C:3 AB:1 BC:1 CA:0 +Smoothing: 6 +Face 76: A:38 B:4 C:39 AB:0 BC:1 CA:1 +Smoothing: 7 +Face 77: A:38 B:3 C:4 AB:1 BC:1 CA:0 +Smoothing: 7 +Face 78: A:39 B:0 C:35 AB:0 BC:1 CA:1 +Smoothing: 8 +Face 79: A:39 B:4 C:0 AB:1 BC:1 CA:0 +Smoothing: 8 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Page 4 + + + --- mesa-glw-7.4.orig/progs/ggi/tube.asc +++ mesa-glw-7.4/progs/ggi/tube.asc @@ -0,0 +1,396 @@ +Ambient light color: Red=0.039216 Green=0.039216 Blue=0.039216 + +Named object: "Object01" +Tri-mesh, Vertices: 64 Faces: 128 +Vertex list: +Vertex 0: X: 61.483898 Y: 37.836231 Z: -70.94294 +Vertex 1: X: 82.867447 Y: 37.836235 Z: -41.288902 +Vertex 2: X: 91.275154 Y: 37.836239 Z: -5.70901 +Vertex 3: X: 85.427025 Y: 37.836243 Z: 30.380013 +Vertex 4: X: 66.213379 Y: 37.836243 Z: 61.483936 +Vertex 5: X: 36.559322 Y: 37.836246 Z: 82.86747 +Vertex 6: X: 0.979424 Y: 37.836246 Z: 91.275154 +Vertex 7: X: -35.109554 Y: 37.836246 Z: 85.42701 +Vertex 8: X: -66.213478 Y: 37.836246 Z: 66.213356 +Vertex 9: X: -87.597 Y: 37.836243 Z: 36.559303 +Vertex 10: X: -96.004677 Y: 37.836239 Z: 0.979406 +Vertex 11: X: -90.156517 Y: 37.836235 Z: -35.109615 +Vertex 12: X: -70.942848 Y: 37.836235 Z: -66.213516 +Vertex 13: X: -41.288776 Y: 37.836231 Z: -87.597023 +Vertex 14: X: -5.708872 Y: 37.836231 Z: -96.004692 +Vertex 15: X: 30.380142 Y: 37.836231 Z: -90.156502 +Vertex 16: X: 61.483898 Y: -38.14529 Z: -70.942932 +Vertex 17: X: 82.867447 Y: -38.145287 Z: -41.288895 +Vertex 18: X: 91.275154 Y: -38.145283 Z: -5.709003 +Vertex 19: X: 85.427025 Y: -38.145279 Z: 30.38002 +Vertex 20: X: 66.213379 Y: -38.145279 Z: 61.483944 +Vertex 21: X: 36.559322 Y: -38.145275 Z: 82.867477 +Vertex 22: X: 0.979424 Y: -38.145275 Z: 91.275162 +Vertex 23: X: -35.109554 Y: -38.145275 Z: 85.427017 +Vertex 24: X: -66.213478 Y: -38.145275 Z: 66.213364 +Vertex 25: X: -87.597 Y: -38.145279 Z: 36.559311 +Vertex 26: X: -96.004677 Y: -38.145283 Z: 0.979412 +Vertex 27: X: -90.156517 Y: -38.145287 Z: -35.109608 +Vertex 28: X: -70.942848 Y: -38.145287 Z: -66.213516 +Vertex 29: X: -41.288776 Y: -38.14529 Z: -87.597015 +Vertex 30: X: -5.708872 Y: -38.14529 Z: -96.004684 +Vertex 31: X: 30.380142 Y: -38.14529 Z: -90.156494 +Vertex 32: X: 29.53923 Y: 37.836235 Z: -36.632011 +Vertex 33: X: 40.224194 Y: 37.836239 Z: -21.814436 +Vertex 34: X: 44.425369 Y: 37.836239 Z: -4.035822 +Vertex 35: X: 41.503166 Y: 37.836239 Z: 13.997195 +Vertex 36: X: 31.902466 Y: 37.836243 Z: 29.539249 +Vertex 37: X: 17.084883 Y: 37.836243 Z: 40.224201 +Vertex 38: X: -0.693734 Y: 37.836243 Z: 44.425365 +Vertex 39: X: -18.726728 Y: 37.836243 Z: 41.503159 +Vertex 40: X: -34.26878 Y: 37.836243 Z: 31.902454 +Vertex 41: X: -44.953732 Y: 37.836239 Z: 17.084871 +Vertex 42: X: -49.154892 Y: 37.836239 Z: -0.693745 +Vertex 43: X: -46.232677 Y: 37.836239 Z: -18.726759 +Vertex 44: X: -36.631962 Y: 37.836235 Z: -34.268806 +Vertex 45: X: -21.814371 Y: 37.836235 Z: -44.953747 +Vertex 46: X: -4.035751 Y: 37.836235 Z: -49.1549 +Vertex 47: X: 13.997261 Y: 37.836235 Z: -46.23267 +Vertex 48: X: 29.53923 Y: -38.145287 Z: -36.632004 +Vertex 49: X: 40.224194 Y: -38.145283 Z: -21.814428 +Vertex 50: X: 44.425369 Y: -38.145283 Z: -4.035816 +Vertex 51: X: 41.503166 Y: -38.145283 Z: 13.997201 +Vertex 52: X: 31.902466 Y: -38.145279 Z: 29.539257 +Vertex 53: X: 17.084883 Y: -38.145279 Z: 40.224209 +Vertex 54: X: -0.693734 Y: -38.145279 Z: 44.425373 +Vertex 55: X: -18.726728 Y: -38.145279 Z: 41.503166 + + Page 1 + + + +Vertex 56: X: -34.26878 Y: -38.145279 Z: 31.902462 +Vertex 57: X: -44.953732 Y: -38.145283 Z: 17.084879 +Vertex 58: X: -49.154892 Y: -38.145283 Z: -0.693738 +Vertex 59: X: -46.232677 Y: -38.145283 Z: -18.726751 +Vertex 60: X: -36.631962 Y: -38.145287 Z: -34.268799 +Vertex 61: X: -21.814371 Y: -38.145287 Z: -44.953739 +Vertex 62: X: -4.035751 Y: -38.145287 Z: -49.154892 +Vertex 63: X: 13.997261 Y: -38.145287 Z: -46.232662 +Face list: +Face 0: A:0 B:1 C:17 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 1: A:0 B:17 C:16 AB:0 BC:1 CA:1 +Smoothing: 1 +Face 2: A:1 B:2 C:18 AB:1 BC:1 CA:0 +Smoothing: 2 +Face 3: A:1 B:18 C:17 AB:0 BC:1 CA:1 +Smoothing: 2 +Face 4: A:2 B:3 C:19 AB:1 BC:1 CA:0 +Smoothing: 3 +Face 5: A:2 B:19 C:18 AB:0 BC:1 CA:1 +Smoothing: 3 +Face 6: A:3 B:4 C:20 AB:1 BC:1 CA:0 +Smoothing: 4 +Face 7: A:3 B:20 C:19 AB:0 BC:1 CA:1 +Smoothing: 4 +Face 8: A:4 B:5 C:21 AB:1 BC:1 CA:0 +Smoothing: 5 +Face 9: A:4 B:21 C:20 AB:0 BC:1 CA:1 +Smoothing: 5 +Face 10: A:5 B:6 C:22 AB:1 BC:1 CA:0 +Smoothing: 6 +Face 11: A:5 B:22 C:21 AB:0 BC:1 CA:1 +Smoothing: 6 +Face 12: A:6 B:7 C:23 AB:1 BC:1 CA:0 +Smoothing: 7 +Face 13: A:6 B:23 C:22 AB:0 BC:1 CA:1 +Smoothing: 7 +Face 14: A:7 B:8 C:24 AB:1 BC:1 CA:0 +Smoothing: 8 +Face 15: A:7 B:24 C:23 AB:0 BC:1 CA:1 +Smoothing: 8 +Face 16: A:8 B:9 C:25 AB:1 BC:1 CA:0 +Smoothing: 9 +Face 17: A:8 B:25 C:24 AB:0 BC:1 CA:1 +Smoothing: 9 +Face 18: A:9 B:10 C:26 AB:1 BC:1 CA:0 +Smoothing: 10 +Face 19: A:9 B:26 C:25 AB:0 BC:1 CA:1 +Smoothing: 10 +Face 20: A:10 B:11 C:27 AB:1 BC:1 CA:0 +Smoothing: 11 +Face 21: A:10 B:27 C:26 AB:0 BC:1 CA:1 +Smoothing: 11 +Face 22: A:11 B:12 C:28 AB:1 BC:1 CA:0 +Smoothing: 12 +Face 23: A:11 B:28 C:27 AB:0 BC:1 CA:1 +Smoothing: 12 +Face 24: A:12 B:13 C:29 AB:1 BC:1 CA:0 +Smoothing: 13 +Face 25: A:12 B:29 C:28 AB:0 BC:1 CA:1 +Smoothing: 13 + + Page 2 + + + +Face 26: A:13 B:14 C:30 AB:1 BC:1 CA:0 +Smoothing: 14 +Face 27: A:13 B:30 C:29 AB:0 BC:1 CA:1 +Smoothing: 14 +Face 28: A:14 B:15 C:31 AB:1 BC:1 CA:0 +Smoothing: 15 +Face 29: A:14 B:31 C:30 AB:0 BC:1 CA:1 +Smoothing: 15 +Face 30: A:15 B:0 C:16 AB:1 BC:1 CA:0 +Smoothing: 16 +Face 31: A:15 B:16 C:31 AB:0 BC:1 CA:1 +Smoothing: 16 +Face 32: A:32 B:49 C:33 AB:0 BC:1 CA:1 +Smoothing: 17 +Face 33: A:32 B:48 C:49 AB:1 BC:1 CA:0 +Smoothing: 17 +Face 34: A:33 B:50 C:34 AB:0 BC:1 CA:1 +Smoothing: 18 +Face 35: A:33 B:49 C:50 AB:1 BC:1 CA:0 +Smoothing: 18 +Face 36: A:34 B:51 C:35 AB:0 BC:1 CA:1 +Smoothing: 19 +Face 37: A:34 B:50 C:51 AB:1 BC:1 CA:0 +Smoothing: 19 +Face 38: A:35 B:52 C:36 AB:0 BC:1 CA:1 +Smoothing: 20 +Face 39: A:35 B:51 C:52 AB:1 BC:1 CA:0 +Smoothing: 20 +Face 40: A:36 B:53 C:37 AB:0 BC:1 CA:1 +Smoothing: 21 +Face 41: A:36 B:52 C:53 AB:1 BC:1 CA:0 +Smoothing: 21 +Face 42: A:37 B:54 C:38 AB:0 BC:1 CA:1 +Smoothing: 22 +Face 43: A:37 B:53 C:54 AB:1 BC:1 CA:0 +Smoothing: 22 +Face 44: A:38 B:55 C:39 AB:0 BC:1 CA:1 +Smoothing: 23 +Face 45: A:38 B:54 C:55 AB:1 BC:1 CA:0 +Smoothing: 23 +Face 46: A:39 B:56 C:40 AB:0 BC:1 CA:1 +Smoothing: 24 +Face 47: A:39 B:55 C:56 AB:1 BC:1 CA:0 +Smoothing: 24 +Face 48: A:40 B:57 C:41 AB:0 BC:1 CA:1 +Smoothing: 25 +Face 49: A:40 B:56 C:57 AB:1 BC:1 CA:0 +Smoothing: 25 +Face 50: A:41 B:58 C:42 AB:0 BC:1 CA:1 +Smoothing: 26 +Face 51: A:41 B:57 C:58 AB:1 BC:1 CA:0 +Smoothing: 26 +Face 52: A:42 B:59 C:43 AB:0 BC:1 CA:1 +Smoothing: 27 +Face 53: A:42 B:58 C:59 AB:1 BC:1 CA:0 +Smoothing: 27 +Face 54: A:43 B:60 C:44 AB:0 BC:1 CA:1 +Smoothing: 28 +Face 55: A:43 B:59 C:60 AB:1 BC:1 CA:0 +Smoothing: 28 +Face 56: A:44 B:61 C:45 AB:0 BC:1 CA:1 + + Page 3 + + + +Smoothing: 29 +Face 57: A:44 B:60 C:61 AB:1 BC:1 CA:0 +Smoothing: 29 +Face 58: A:45 B:62 C:46 AB:0 BC:1 CA:1 +Smoothing: 30 +Face 59: A:45 B:61 C:62 AB:1 BC:1 CA:0 +Smoothing: 30 +Face 60: A:46 B:63 C:47 AB:0 BC:1 CA:1 +Smoothing: 31 +Face 61: A:46 B:62 C:63 AB:1 BC:1 CA:0 +Smoothing: 31 +Face 62: A:47 B:48 C:32 AB:0 BC:1 CA:1 +Smoothing: 32 +Face 63: A:47 B:63 C:48 AB:1 BC:1 CA:0 +Smoothing: 32 +Face 64: A:0 B:32 C:33 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 65: A:0 B:33 C:1 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 66: A:1 B:33 C:34 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 67: A:1 B:34 C:2 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 68: A:2 B:34 C:35 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 69: A:2 B:35 C:3 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 70: A:3 B:35 C:36 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 71: A:3 B:36 C:4 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 72: A:4 B:36 C:37 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 73: A:4 B:37 C:5 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 74: A:5 B:37 C:38 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 75: A:5 B:38 C:6 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 76: A:6 B:38 C:39 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 77: A:6 B:39 C:7 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 78: A:7 B:39 C:40 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 79: A:7 B:40 C:8 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 80: A:8 B:40 C:41 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 81: A:8 B:41 C:9 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 82: A:9 B:41 C:42 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 83: A:9 B:42 C:10 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 84: A:10 B:42 C:43 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 85: A:10 B:43 C:11 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 86: A:11 B:43 C:44 AB:0 BC:1 CA:0 +Smoothing: 1 + + Page 4 + + + +Face 87: A:11 B:44 C:12 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 88: A:12 B:44 C:45 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 89: A:12 B:45 C:13 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 90: A:13 B:45 C:46 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 91: A:13 B:46 C:14 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 92: A:14 B:46 C:47 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 93: A:14 B:47 C:15 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 94: A:15 B:47 C:32 AB:0 BC:1 CA:0 +Smoothing: 1 +Face 95: A:15 B:32 C:0 AB:0 BC:0 CA:1 +Smoothing: 1 +Face 96: A:16 B:17 C:49 AB:1 BC:0 CA:0 +Smoothing: 2 +Face 97: A:16 B:49 C:48 AB:0 BC:1 CA:0 +Smoothing: 2 +Face 98: A:17 B:18 C:50 AB:1 BC:0 CA:0 +Smoothing: 2 +Face 99: A:17 B:50 C:49 AB:0 BC:1 CA:0 +Smoothing: 2 +Face 100: A:18 B:19 C:51 AB:1 BC:0 CA:0 +Smoothing: 2 +Face 101: A:18 B:51 C:50 AB:0 BC:1 CA:0 +Smoothing: 2 +Face 102: A:19 B:20 C:52 AB:1 BC:0 CA:0 +Smoothing: 2 +Face 103: A:19 B:52 C:51 AB:0 BC:1 CA:0 +Smoothing: 2 +Face 104: A:20 B:21 C:53 AB:1 BC:0 CA:0 +Smoothing: 2 +Face 105: A:20 B:53 C:52 AB:0 BC:1 CA:0 +Smoothing: 2 +Face 106: A:21 B:22 C:54 AB:1 BC:0 CA:0 +Smoothing: 2 +Face 107: A:21 B:54 C:53 AB:0 BC:1 CA:0 +Smoothing: 2 +Face 108: A:22 B:23 C:55 AB:1 BC:0 CA:0 +Smoothing: 2 +Face 109: A:22 B:55 C:54 AB:0 BC:1 CA:0 +Smoothing: 2 +Face 110: A:23 B:24 C:56 AB:1 BC:0 CA:0 +Smoothing: 2 +Face 111: A:23 B:56 C:55 AB:0 BC:1 CA:0 +Smoothing: 2 +Face 112: A:24 B:25 C:57 AB:1 BC:0 CA:0 +Smoothing: 2 +Face 113: A:24 B:57 C:56 AB:0 BC:1 CA:0 +Smoothing: 2 +Face 114: A:25 B:26 C:58 AB:1 BC:0 CA:0 +Smoothing: 2 +Face 115: A:25 B:58 C:57 AB:0 BC:1 CA:0 +Smoothing: 2 +Face 116: A:26 B:27 C:59 AB:1 BC:0 CA:0 +Smoothing: 2 +Face 117: A:26 B:59 C:58 AB:0 BC:1 CA:0 + + Page 5 + + + +Smoothing: 2 +Face 118: A:27 B:28 C:60 AB:1 BC:0 CA:0 +Smoothing: 2 +Face 119: A:27 B:60 C:59 AB:0 BC:1 CA:0 +Smoothing: 2 +Face 120: A:28 B:29 C:61 AB:1 BC:0 CA:0 +Smoothing: 2 +Face 121: A:28 B:61 C:60 AB:0 BC:1 CA:0 +Smoothing: 2 +Face 122: A:29 B:30 C:62 AB:1 BC:0 CA:0 +Smoothing: 2 +Face 123: A:29 B:62 C:61 AB:0 BC:1 CA:0 +Smoothing: 2 +Face 124: A:30 B:31 C:63 AB:1 BC:0 CA:0 +Smoothing: 2 +Face 125: A:30 B:63 C:62 AB:0 BC:1 CA:0 +Smoothing: 2 +Face 126: A:31 B:16 C:48 AB:1 BC:0 CA:0 +Smoothing: 2 +Face 127: A:31 B:48 C:63 AB:0 BC:1 CA:0 +Smoothing: 2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Page 6 + + + --- mesa-glw-7.4.orig/progs/ggi/blah +++ mesa-glw-7.4/progs/ggi/blah @@ -0,0 +1,2 @@ +Terminating on signal 11 + --- mesa-glw-7.4.orig/progs/ggi/box.asc +++ mesa-glw-7.4/progs/ggi/box.asc @@ -0,0 +1,66 @@ +Ambient light color: Red=0.039216 Green=0.039216 Blue=0.039216 + +Named object: "Object01" +Tri-mesh, Vertices: 8 Faces: 12 +Vertex list: +Vertex 0: X: -20 Y: -19.999998 Z: 20.000002 +Vertex 1: X: 20 Y: -19.999998 Z: 20.000002 +Vertex 2: X: 20 Y: 20.000002 Z: 19.999998 +Vertex 3: X: -20 Y: 20.000002 Z: 19.999998 +Vertex 4: X: -20 Y: -20.000002 Z: -19.999998 +Vertex 5: X: 20 Y: -20.000002 Z: -19.999998 +Vertex 6: X: 20 Y: 19.999998 Z: -20.000002 +Vertex 7: X: -20 Y: 19.999998 Z: -20.000002 +Face list: +Face 0: A:0 B:1 C:2 AB:1 BC:1 CA:0 +Smoothing: 1 +Face 1: A:0 B:2 C:3 AB:0 BC:1 CA:1 +Smoothing: 1 +Face 2: A:0 B:4 C:5 AB:1 BC:1 CA:0 +Smoothing: 2 +Face 3: A:0 B:5 C:1 AB:0 BC:1 CA:1 +Smoothing: 2 +Face 4: A:1 B:5 C:6 AB:1 BC:1 CA:0 +Smoothing: 3 +Face 5: A:1 B:6 C:2 AB:0 BC:1 CA:1 +Smoothing: 3 +Face 6: A:2 B:6 C:7 AB:1 BC:1 CA:0 +Smoothing: 4 +Face 7: A:2 B:7 C:3 AB:0 BC:1 CA:1 +Smoothing: 4 +Face 8: A:3 B:7 C:4 AB:1 BC:1 CA:0 +Smoothing: 5 +Face 9: A:3 B:4 C:0 AB:0 BC:1 CA:1 +Smoothing: 5 +Face 10: A:4 B:7 C:6 AB:1 BC:1 CA:0 +Smoothing: 6 +Face 11: A:4 B:6 C:5 AB:0 BC:1 CA:1 +Smoothing: 6 + + + + + + + + + + + + + + + + + + + + + + + + + Page 1 + + + --- mesa-glw-7.4.orig/progs/ggi/sphere.asc +++ mesa-glw-7.4/progs/ggi/sphere.asc @@ -0,0 +1,132 @@ +Ambient light color: Red=0.039216 Green=0.039216 Blue=0.039216 + +Named object: "Object01" +Tri-mesh, Vertices: 20 Faces: 36 +Vertex list: +Vertex 0: X: -210 Y: -432.781738 Z: 180.000031 +Vertex 1: X: -610.810303 Y: 144.260559 Z: 103.580154 +Vertex 2: X: 56.586655 Y: 144.260544 Z: -128.902023 +Vertex 3: X: -75.776352 Y: 144.260605 Z: 565.321838 +Vertex 4: X: -462.815979 Y: -347.937683 Z: 131.797302 +Vertex 5: X: -616.506042 Y: -126.67173 Z: 102.494209 +Vertex 6: X: -41.847229 Y: -347.937683 Z: -14.843644 +Vertex 7: X: 60.375015 Y: -126.671753 Z: -133.291641 +Vertex 8: X: -125.336807 Y: -347.937653 Z: 423.046448 +Vertex 9: X: -73.868958 Y: -126.671692 Z: 570.797424 +Vertex 10: X: -448.353271 Y: 237.304672 Z: -92.34951 +Vertex 11: X: -192.440964 Y: 237.304672 Z: -181.494431 +Vertex 12: X: 145.038193 Y: 237.304672 Z: 109.754745 +Vertex 13: X: 94.283768 Y: 237.304688 Z: 375.953766 +Vertex 14: X: -326.684937 Y: 237.304733 Z: 522.594727 +Vertex 15: X: -531.842834 Y: 237.304718 Z: 345.540588 +Vertex 16: X: -331.419525 Y: -225.964966 Z: -168.564438 +Vertex 17: X: 152.575485 Y: -225.964935 Z: 249.129868 +Vertex 18: X: -451.155914 Y: -225.964905 Z: 459.434662 +Vertex 19: X: -298.413483 Y: 423.31897 Z: 163.142761 +Face list: +Face 0: A:0 B:4 C:6 AB:1 BC:1 CA:1 +Face 1: A:4 B:5 C:16 AB:1 BC:1 CA:1 +Face 2: A:4 B:16 C:6 AB:1 BC:1 CA:1 +Face 3: A:6 B:16 C:7 AB:1 BC:1 CA:1 +Face 4: A:5 B:1 C:10 AB:1 BC:1 CA:1 +Face 5: A:5 B:10 C:16 AB:1 BC:1 CA:1 +Face 6: A:16 B:10 C:11 AB:1 BC:1 CA:1 +Face 7: A:16 B:11 C:7 AB:1 BC:1 CA:1 +Face 8: A:7 B:11 C:2 AB:1 BC:1 CA:1 +Face 9: A:0 B:6 C:8 AB:1 BC:1 CA:1 +Face 10: A:6 B:7 C:17 AB:1 BC:1 CA:1 +Face 11: A:6 B:17 C:8 AB:1 BC:1 CA:1 +Face 12: A:8 B:17 C:9 AB:1 BC:1 CA:1 +Face 13: A:7 B:2 C:12 AB:1 BC:1 CA:1 +Face 14: A:7 B:12 C:17 AB:1 BC:1 CA:1 +Face 15: A:17 B:12 C:13 AB:1 BC:1 CA:1 +Face 16: A:17 B:13 C:9 AB:1 BC:1 CA:1 +Face 17: A:9 B:13 C:3 AB:1 BC:1 CA:1 +Face 18: A:0 B:8 C:4 AB:1 BC:1 CA:1 +Face 19: A:8 B:9 C:18 AB:1 BC:1 CA:1 +Face 20: A:8 B:18 C:4 AB:1 BC:1 CA:1 +Face 21: A:4 B:18 C:5 AB:1 BC:1 CA:1 +Face 22: A:9 B:3 C:14 AB:1 BC:1 CA:1 +Face 23: A:9 B:14 C:18 AB:1 BC:1 CA:1 +Face 24: A:18 B:14 C:15 AB:1 BC:1 CA:1 +Face 25: A:18 B:15 C:5 AB:1 BC:1 CA:1 +Face 26: A:5 B:15 C:1 AB:1 BC:1 CA:1 +Face 27: A:1 B:15 C:10 AB:1 BC:1 CA:1 +Face 28: A:15 B:14 C:19 AB:1 BC:1 CA:1 +Face 29: A:15 B:19 C:10 AB:1 BC:1 CA:1 +Face 30: A:10 B:19 C:11 AB:1 BC:1 CA:1 +Face 31: A:14 B:3 C:13 AB:1 BC:1 CA:1 +Face 32: A:14 B:13 C:19 AB:1 BC:1 CA:1 +Face 33: A:19 B:13 C:12 AB:1 BC:1 CA:1 +Face 34: A:19 B:12 C:11 AB:1 BC:1 CA:1 + + Page 1 + + + +Face 35: A:11 B:12 C:2 AB:1 BC:1 CA:1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Page 2 + + + --- mesa-glw-7.4.orig/progs/util/descrip.mms +++ mesa-glw-7.4/progs/util/descrip.mms @@ -0,0 +1,42 @@ +# Makefile for GLUT-based demo programs for VMS +# contributed by Jouk Jansen joukj@crys.chem.uva.nl + + +.first + define gl [--.include.gl] + +.include [--]mms-config. + +##### MACROS ##### + +INCDIR = ([--.include],[-.util]) +CFLAGS = /include=$(INCDIR)/prefix=all/name=(as_is,short)/float=ieee/ieee=denorm + +.ifdef SHARE +GL_LIBS = $(XLIBS) +LIB_DEP = [--.lib]$(GL_SHAR) [--.lib]$(GLU_SHAR) [--.lib]$(GLUT_SHAR) +.else +GL_LIBS = [--.lib]libGLUT/l,libMesaGLU/l,libMesaGL/l,$(XLIBS) +LIB_DEP = [--.lib]$(GL_LIB) [--.lib]$(GLU_LIB) [--.lib]$(GLUT_LIB) +.endif + + +OBJS =readtex.obj,showbuffer.obj + + +##### RULES ##### +.obj.exe : + cxxlink $(MMS$TARGET_NAME),$(GL_LIBS) + +##### TARGETS ##### +default : + $(MMS)$(MMSQUALIFIERS) $(OBJS) + +clean : + delete *.obj;* + +realclean : + delete *.obj;* + +readtex.obj : readtex.c +showbuffer.obj : showbuffer.c --- mesa-glw-7.4.orig/progs/util/imagesgi.cpp +++ mesa-glw-7.4/progs/util/imagesgi.cpp @@ -0,0 +1,369 @@ +/****************************************************************************** +** Filename : imageSgi.cpp +** UNCLASSIFIED +** +** Description : Utility to read SGI image format files. This code was +** originally a SGI image loading utility provided with the +** Mesa 3D library @ http://www.mesa3d.org by Brain Paul. +** This has been extended to read all SGI image formats +** (e.g. INT, INTA, RGB, RGBA). +** +** Revision History: +** Date Name Description +** 06/07/99 BRC Initial Release +** +** Note: +** +** The SGI Image Data (if not RLE) +** +** If the image is stored verbatim (without RLE), then image data directly +** follows the 512 byte header. The data for each scanline of the first +** channel is written first. If the image has more than 1 channel, all +** the data for the first channel is written, followed by the remaining +** channels. If the BPC value is 1, then each scanline is written as XSIZE +** bytes. If the BPC value is 2, then each scanline is written as XSIZE +** shorts. These shorts are stored in the byte order described above. +** +******************************************************************************/ +#define __IMAGESGI_CPP + +#include "imagesgi.h" + +#include +#include +#include +#include +#include + +struct sImageSgiRaw +{ + struct sImageSgiHeader header; + unsigned char *chan0; + unsigned char *chan1; + unsigned char *chan2; + unsigned char *chan3; + unsigned int *rowStart; + int *rowSize; +}; + +// Static routines +static struct sImageSgiRaw *ImageSgiRawOpen(char const * const fileName); +static void ImageSgiRawClose(struct sImageSgiRaw *raw); +static void ImageSgiRawGetRow(struct sImageSgiRaw *raw, unsigned char *buf, + int y, int z); +static void ImageSgiRawGetData(struct sImageSgiRaw *raw, struct sImageSgi +*final); +static void *SwitchEndian16(void *value); +static void *SwitchEndian32(void *value); + +// Static variables +FILE *mFp = NULL; +unsigned char *mChanTmp = NULL; + + +/*****************************************************************************/ +struct sImageSgi *ImageSgiOpen(char const * const fileName) +{ + struct sImageSgiRaw *raw = NULL; + struct sImageSgi *final = NULL; + + raw = ImageSgiRawOpen(fileName); + final = new struct sImageSgi; + + assert(final); + if(final) + { + final->header = raw->header; + final->data = NULL; + ImageSgiRawGetData(raw, final); + ImageSgiRawClose(raw); + } + + return final; +} // ImageSgiRawOpen + + +/*****************************************************************************/ +void ImageSgiClose(struct sImageSgi *image) +{ + + if(image) + { + if(image->data) + delete[] image->data; + image->data = NULL; + delete image; + } + image = NULL; + + return; +} // ImageSgiClose + + +/*****************************************************************************/ +static struct sImageSgiRaw *ImageSgiRawOpen(char const * const fileName) +{ + struct sImageSgiRaw *raw = NULL; + int x; + int i; + bool swapFlag = false; + union + { + int testWord; + char testByte[4]; + } endianTest; + endianTest.testWord = 1; + + // Determine endianess of platform. + if(endianTest.testByte[0] == 1) + swapFlag = true; + else + swapFlag = false; + + raw = new struct sImageSgiRaw; + + assert(raw); + if(raw) + { + raw->chan0 = NULL; + raw->chan1 = NULL; + raw->chan2 = NULL; + raw->chan3 = NULL; + raw->rowStart = NULL; + raw->rowSize = NULL; + mFp = fopen(fileName, "rb"); + assert(mFp); + + fread(&raw->header, sizeof(struct sImageSgiHeader), 1, mFp); + if(swapFlag == true) + { + SwitchEndian16(&raw->header.magic); + SwitchEndian16(&raw->header.type); + SwitchEndian16(&raw->header.dim); + SwitchEndian16(&raw->header.xsize); + SwitchEndian16(&raw->header.ysize); + SwitchEndian16(&raw->header.zsize); + } + + mChanTmp = new unsigned char[raw->header.xsize * raw->header.ysize]; + assert(mChanTmp); + switch(raw->header.zsize) + { + case 4: + raw->chan3 = new unsigned char[raw->header.xsize * +raw->header.ysize]; + assert(raw->chan3); + case 3: + raw->chan2 = new unsigned char[raw->header.xsize * +raw->header.ysize]; + assert(raw->chan2); + case 2: + raw->chan1 = new unsigned char[raw->header.xsize * +raw->header.ysize]; + assert(raw->chan1); + case 1: + raw->chan0 = new unsigned char[raw->header.xsize * +raw->header.ysize]; + assert(raw->chan0); + } + + if(raw->header.type == IMAGE_SGI_TYPE_RLE) + { + x = raw->header.ysize * raw->header.zsize * sizeof(unsigned int); + raw->rowStart = new unsigned int[x]; + raw->rowSize = new int[x]; + + fseek(mFp, sizeof(struct sImageSgiHeader), SEEK_SET); + fread(raw->rowStart, 1, x, mFp); + fread(raw->rowSize, 1, x, mFp); + + if(swapFlag == true) + { + for(i=0; irowStart[i]); + for(i=0; irowSize[i]); + } + + } + + } + + return raw; +} // ImageSgiRawOpen + + +/*****************************************************************************/ +static void ImageSgiRawClose(struct sImageSgiRaw *raw) +{ + + fclose(mFp); + mFp = NULL; + + if(mChanTmp) + delete[] mChanTmp; + mChanTmp = NULL; + + if(raw->chan0) + delete[] raw->chan0; + raw->chan0 = NULL; + + if(raw->chan1) + delete[] raw->chan1; + raw->chan1 = NULL; + + if(raw->chan2) + delete[] raw->chan2; + raw->chan2 = NULL; + + if(raw->chan3) + delete[] raw->chan3; + raw->chan3 = NULL; + + if(raw) + delete raw; + raw = NULL; + + return; +} // ImageSgiRawClose + + +/*****************************************************************************/ +static void ImageSgiRawGetRow(struct sImageSgiRaw *raw, unsigned char *buf, + int y, int z) +{ + unsigned char *iPtr = NULL; + unsigned char *oPtr = NULL; + unsigned char pixel; + int count; + + if((raw->header.type & 0xFF00) == 0x0100) + { + fseek(mFp, raw->rowStart[y+z*raw->header.ysize], SEEK_SET); + fread(mChanTmp, 1, (unsigned int)raw->rowSize[y+z*raw->header.ysize], +mFp); + iPtr = mChanTmp; + oPtr = buf; + while(1) + { + pixel = *iPtr++; + count = (int)(pixel & 0x7F); + if(!count) + { + return; + } + if (pixel & 0x80) + { + while (count--) + { + *oPtr++ = *iPtr++; + } + } + else + { + pixel = *iPtr++; + while (count--) + { + *oPtr++ = pixel; + } + } + } + } + else + { + fseek(mFp, + sizeof(struct sImageSgiHeader)+(y*raw->header.xsize) + + (z*raw->header.xsize*raw->header.ysize), + SEEK_SET); + fread(buf, 1, raw->header.xsize, mFp); + } + + return; +} // ImageSgiRawGetRow + + +/*****************************************************************************/ +static void ImageSgiRawGetData(struct sImageSgiRaw *raw, struct sImageSgi +*final) +{ + unsigned char *ptr = NULL; + int i, j; + + final->data = + new unsigned +char[raw->header.xsize*raw->header.ysize*raw->header.zsize]; + assert(final->data); + + ptr = final->data; + for(i=0; iheader.ysize; i++) + { + switch(raw->header.zsize) + { + case 1: + ImageSgiRawGetRow(raw, raw->chan0, i, 0); + for(j=0; jheader.xsize; j++) + *(ptr++) = raw->chan0[j]; + break; + case 2: + ImageSgiRawGetRow(raw, raw->chan0, i, 0); + ImageSgiRawGetRow(raw, raw->chan1, i, 1); + for(j=0; jheader.xsize; j++) + { + *(ptr++) = raw->chan0[j]; + *(ptr++) = raw->chan1[j]; + } + break; + case 3: + ImageSgiRawGetRow(raw, raw->chan0, i, 0); + ImageSgiRawGetRow(raw, raw->chan1, i, 1); + ImageSgiRawGetRow(raw, raw->chan2, i, 2); + for(j=0; jheader.xsize; j++) + { + *(ptr++) = raw->chan0[j]; + *(ptr++) = raw->chan1[j]; + *(ptr++) = raw->chan2[j]; + } + break; + case 4: + ImageSgiRawGetRow(raw, raw->chan0, i, 0); + ImageSgiRawGetRow(raw, raw->chan1, i, 1); + ImageSgiRawGetRow(raw, raw->chan2, i, 2); + ImageSgiRawGetRow(raw, raw->chan3, i, 3); + for(j=0; jheader.xsize; j++) + { + *(ptr++) = raw->chan0[j]; + *(ptr++) = raw->chan1[j]; + *(ptr++) = raw->chan2[j]; + *(ptr++) = raw->chan3[j]; + } + break; + } + } + + return; +} // ImageSgiRawGetData + + +/*****************************************************************************/ +static void *SwitchEndian16(void *value) +{ + short value16 = *(short *) value; + value16 = ((value16 & 0xff00) >> 8L) + + ((value16 & 0x00ff) << 8L); + *(short *)value = value16; + return value; +} // SwitchEndian16 + + +/*****************************************************************************/ +static void *SwitchEndian32(void *value) +{ + int value32 = *(int *) value; + value32 = ((value32 & 0xff000000) >> 24L) + + ((value32 & 0x00ff0000) >> 8) + + ((value32 & 0x0000ff00) << 8) + + ((value32 & 0x000000ff) << 24L); + *(int *)value = value32; + return value; +} // SwitchEndian32 + --- mesa-glw-7.4.orig/src/glut/mini/Makefile +++ mesa-glw-7.4/src/glut/mini/Makefile @@ -0,0 +1,101 @@ +# subset glut + +TOP = ../../.. +include $(TOP)/configs/current + +MARK = $(TOP)/src/glut/glx + +GLUT_MAJOR = 3 +GLUT_MINOR = 7 +GLUT_TINY = 1 + +INCLUDES = -I$(TOP)/include -I$(MARK) + +CORE_SOURCES = \ + bitmap.c \ + callback.c \ + color.c \ + globals.c \ + init.c \ + menu.c \ + models.c \ + overlay.c \ + state.c \ + teapot.c \ + window.c + + +MARK_SOURCES = \ + $(MARK)/glut_8x13.c \ + $(MARK)/glut_9x15.c \ + $(MARK)/glut_hel10.c \ + $(MARK)/glut_hel12.c \ + $(MARK)/glut_hel18.c \ + $(MARK)/glut_tr10.c \ + $(MARK)/glut_tr24.c + +SOURCES = $(CORE_SOURCES) $(MARK_SOURCES) + +OBJECTS = $(SOURCES:.c=.o) + + +##### RULES ##### + +.c.o: + $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ + +.S.o: + $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ + + +##### TARGETS ##### + +default: depend $(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME) + + +# Make the library +$(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) \ + $(GLUT_LIB_DEPS) -install $(TOP)/$(LIB_DIR) \ + $(MKLIB_OPTIONS) $(OBJECTS) + + +# Run 'make -f Makefile.solo dep' to update the dependencies if you change +# what's included by any source file. +depend: $(SOURCES) + touch depend + $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(SOURCES) > /dev/null + +# Emacs tags +tags: + etags `find . -name \*.[ch]` `find ../include` + + +# glut pkgconfig file +pcedit = sed \ + -e 's,@INSTALL_DIR@,$(INSTALL_DIR),' \ + -e 's,@INSTALL_LIB_DIR@,$(INSTALL_LIB_DIR),' \ + -e 's,@INSTALL_INC_DIR@,$(INSTALL_INC_DIR),' \ + -e 's,@VERSION@,$(GLUT_MAJOR).$(GLUT_MINOR).$(GLUT_TINY),' \ + -e 's,@GLUT_PC_REQ_PRIV@,$(GLUT_PC_REQ_PRIV),' \ + -e 's,@GLUT_PC_LIB_PRIV@,$(GLUT_PC_LIB_PRIV),' \ + -e 's,@GLUT_PC_CFLAGS@,$(GLUT_PC_CFLAGS),' +glut.pc: glut.pc.in + $(pcedit) $< > $@ + +install: glut.pc + $(INSTALL) -d $(DESTDIR)$(INSTALL_INC_DIR)/GL + $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR) + $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig + $(INSTALL) -m 644 $(TOP)/include/GL/glut.h $(DESTDIR)$(INSTALL_INC_DIR)/GL + $(INSTALL) $(TOP)/$(LIB_DIR)/libglut* $(DESTDIR)$(INSTALL_LIB_DIR) + $(INSTALL) -m 644 glut.pc $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig + + +# Remove .o and backup files +clean: depend + -rm -f depend depend.bak + -rm -f *.o *~ *.o *~ *.so *.pc libglut.so.3.7 + +include depend --- mesa-glw-7.4.orig/src/mesa/x86-64/calling_convention.txt +++ mesa-glw-7.4/src/mesa/x86-64/calling_convention.txt @@ -0,0 +1,50 @@ +Register Usage +rax temporary register; with variable arguments passes information + about the number of SSE registers used; 1st return register + +rbx* callee-saved register; optionally used as base pointer + +rcx used to pass 4th integer argument to functions + +rdx used to pass 3rd argument to functions 2nd return register + +rsp* stack pointer + +rbp* callee-saved register; optionally used as frame pointer + +rsi used to pass 2nd argument to functions + +rdi used to pass 1st argument to functions + +r8 used to pass 5th argument to functions + +r9 used to pass 6th argument to functions + +r10 temporary register, used for passing a function's static chain pointer + +r11 temporary register + +r12-15* callee-saved registers + +xmm0­1 used to pass and return floating point arguments + +xmm2­7 used to pass floating point arguments + +xmm8­15 temporary registers + +mmx0­7 temporary registers + +st0 temporary register; used to return long double arguments + +st1 temporary registers; used to return long double arguments + +st2­7 temporary registers + +fs Reserved for system use (as thread specific data register) + + + +*) must be preserved across function calls + +Integer arguments from list: rdi,rsi,rdx,rcx,r8,r9,stack +Floating point arguments from list: xmm0-xmm7 \ No newline at end of file --- mesa-glw-7.4.orig/src/mesa/swrast/NOTES +++ mesa-glw-7.4/src/mesa/swrast/NOTES @@ -0,0 +1,55 @@ +INTRODUCTION + +Mesa's native software rasterizer. This module provides the fallback +paths for rasterization operations and states that aren't accelerated +in hardware drivers, and as the full rasterization engine in software +drivers. + +The swrast module 'stands alone', relying only on interfaces to core +mesa and it's own driver interface. It knows nothing about the tnl or +other modules, allowing it to be used for fallback paths in future tnl +schemes without modification. + +As well as providing triangle/line/point rasterization functionality, +the module provides implementations of the pixel operations +(ReadPixels, etc), and texture operations (CopyTexSubImage) which may +be plugged in to the core Mesa driver interface where accelerated +versions of these operations are unavailable. + + +STATE + +To create and destroy the module: + + GLboolean _swrast_CreateContext( GLcontext *ctx ); + void _swrast_DestroyContext( GLcontext *ctx ); + +This module tracks state changes internally and maintains derived +values based on the current state. For this to work, the driver +ensure the following funciton is called whenever the state changes and +the swsetup module is 'awake': + + void _swrast_InvalidateState( GLcontext *ctx, GLuint new_state ); + +There is no explicit call to put the swrast module to sleep. + + +CUSTOMIZATION + + void (*choose_point)( GLcontext * ); + void (*choose_line)( GLcontext * ); + void (*choose_triangle)( GLcontext * ); + +Drivers may add additional triangle/line/point functions to swrast by +overriding these functions. It is necessary for the driver to be very +careful that it doesn't return an inappropriate function, eg a +rasterization function in feedback mode. See the X11 driver for +examples. + +DRIVER INTERFACE + +The swrast device driver provides swrast primarily with span- and +pixel- level interfaces to a framebuffer, with a few additional hooks +for locking and setting the read buffer. + +See the definition of struct swrast_device_driver in swrast.h. \ No newline at end of file --- mesa-glw-7.4.orig/src/mesa/glapi/gl_offsets.py +++ mesa-glw-7.4/src/mesa/glapi/gl_offsets.py @@ -0,0 +1,103 @@ +#!/usr/bin/env python + +# (C) Copyright IBM Corporation 2004, 2005 +# All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# on the rights to use, copy, modify, merge, publish, distribute, sub +# license, and/or sell copies of the Software, and to permit persons to whom +# the Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the next +# paragraph) shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL +# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# Authors: +# Ian Romanick + +import gl_XML +import license +import sys, getopt + +class PrintGlOffsets(gl_XML.gl_print_base): + def __init__(self): + gl_XML.gl_print_base.__init__(self) + + self.name = "gl_offsets.py (from Mesa)" + self.header_tag = '_GLAPI_OFFSETS_H_' + self.license = license.bsd_license_template % ( \ +"""Copyright (C) 1999-2001 Brian Paul All Rights Reserved. +(C) Copyright IBM Corporation 2004""", "BRIAN PAUL, IBM") + return + + def printBody(self, api): + abi = [ "1.0", "1.1", "1.2", "GL_ARB_multitexture" ] + + functions = [] + abi_functions = [] + count = 0 + for f in api.functionIterateByOffset(): + [category, num] = api.get_category_for_name( f.name ) + if category not in abi: + functions.append( [f, count] ) + count += 1 + else: + abi_functions.append( f ) + + + for f in abi_functions: + print '#define _gloffset_%s %d' % (f.name, f.offset) + last_static = f.offset + + print '' + print '#if !defined(IN_DRI_DRIVER)' + print '' + + for [f, index] in functions: + print '#define _gloffset_%s %d' % (f.name, f.offset) + + print '#define _gloffset_FIRST_DYNAMIC %d' % (api.next_offset) + + print '' + print '#else' + print '' + + for [f, index] in functions: + print '#define _gloffset_%s driDispatchRemapTable[%s_remap_index]' % (f.name, f.name) + + print '' + print '#endif /* !defined(IN_DRI_DRIVER) */' + + return + + +def show_usage(): + print "Usage: %s [-f input_file_name]" % sys.argv[0] + sys.exit(1) + +if __name__ == '__main__': + file_name = "gl_API.xml" + + try: + (args, trail) = getopt.getopt(sys.argv[1:], "f:") + except Exception,e: + show_usage() + + for (arg,val) in args: + if arg == "-f": + file_name = val + + api = gl_XML.parse_GL_API( file_name ) + + printer = PrintGlOffsets() + printer.Print( api ) --- mesa-glw-7.4.orig/src/mesa/glapi/glX_server_table.py +++ mesa-glw-7.4/src/mesa/glapi/glX_server_table.py @@ -0,0 +1,411 @@ +#!/bin/env python + +# (C) Copyright IBM Corporation 2005, 2006 +# All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# on the rights to use, copy, modify, merge, publish, distribute, sub +# license, and/or sell copies of the Software, and to permit persons to whom +# the Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the next +# paragraph) shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL +# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# Authors: +# Ian Romanick + +import gl_XML, glX_XML, glX_proto_common, license +import sys, getopt + + +def log2(value): + for i in range(0, 30): + p = 1 << i + if p >= value: + return i + + return -1 + + +def round_down_to_power_of_two(n): + """Returns the nearest power-of-two less than or equal to n.""" + + for i in range(30, 0, -1): + p = 1 << i + if p <= n: + return p + + return -1 + + +class function_table: + def __init__(self, name, do_size_check): + self.name_base = name + self.do_size_check = do_size_check + + + self.max_bits = 1 + self.next_opcode_threshold = (1 << self.max_bits) + self.max_opcode = 0 + + self.functions = {} + self.lookup_table = [] + + # Minimum number of opcodes in a leaf node. + self.min_op_bits = 3 + self.min_op_count = (1 << self.min_op_bits) + return + + + def append(self, opcode, func): + self.functions[opcode] = func + + if opcode > self.max_opcode: + self.max_opcode = opcode + + if opcode > self.next_opcode_threshold: + bits = log2(opcode) + if (1 << bits) <= opcode: + bits += 1 + + self.max_bits = bits + self.next_opcode_threshold = 1 << bits + return + + + def divide_group(self, min_opcode, total): + """Divide the group starting min_opcode into subgroups. + Returns a tuple containing the number of bits consumed by + the node, the list of the children's tuple, and the number + of entries in the final array used by this node and its + children, and the depth of the subtree rooted at the node.""" + + remaining_bits = self.max_bits - total + next_opcode = min_opcode + (1 << remaining_bits) + empty_children = 0 + + for M in range(0, remaining_bits): + op_count = 1 << (remaining_bits - M); + child_count = 1 << M; + + empty_children = 0 + full_children = 0 + for i in range(min_opcode, next_opcode, op_count): + used = 0 + empty = 0 + + for j in range(i, i + op_count): + if self.functions.has_key(j): + used += 1; + else: + empty += 1; + + + if empty == op_count: + empty_children += 1 + + if used == op_count: + full_children += 1 + + if (empty_children > 0) or (full_children == child_count) or (op_count <= self.min_op_count): + break + + + # If all the remaining bits are used by this node, as is the + # case when M is 0 or remaining_bits, the node is a leaf. + + if (M == 0) or (M == remaining_bits): + return [remaining_bits, [], 0, 0] + else: + children = [] + count = 1 + depth = 1 + all_children_are_nonempty_leaf_nodes = 1 + for i in range(min_opcode, next_opcode, op_count): + n = self.divide_group(i, total + M) + + if not (n[1] == [] and not self.is_empty_leaf(i, n[0])): + all_children_are_nonempty_leaf_nodes = 0 + + children.append(n) + count += n[2] + 1 + + if n[3] >= depth: + depth = n[3] + 1 + + # If all of the child nodes are non-empty leaf nodes, pull + # them up and make this node a leaf. + + if all_children_are_nonempty_leaf_nodes: + return [remaining_bits, [], 0, 0] + else: + return [M, children, count, depth] + + + def is_empty_leaf(self, base_opcode, M): + for op in range(base_opcode, base_opcode + (1 << M)): + if self.functions.has_key(op): + return 0 + break + + return 1 + + + def dump_tree(self, node, base_opcode, remaining_bits, base_entry, depth): + M = node[0] + children = node[1] + child_M = remaining_bits - M + + + # This actually an error condition. + if children == []: + return + + print ' /* [%u] -> opcode range [%u, %u], node depth %u */' % (base_entry, base_opcode, base_opcode + (1 << remaining_bits), depth) + print ' %u,' % (M) + + base_entry += (1 << M) + 1 + + child_index = base_entry + child_base_opcode = base_opcode + for child in children: + if child[1] == []: + if self.is_empty_leaf(child_base_opcode, child_M): + print ' EMPTY_LEAF,' + else: + # Emit the index of the next dispatch + # function. Then add all the + # dispatch functions for this leaf + # node to the dispatch function + # lookup table. + + print ' LEAF(%u),' % (len(self.lookup_table)) + + for op in range(child_base_opcode, child_base_opcode + (1 << child_M)): + if self.functions.has_key(op): + func = self.functions[op] + size = func.command_fixed_length() + + if func.glx_rop != 0: + size += 4 + + size = ((size + 3) & ~3) + + if func.has_variable_size_request(): + size_name = "__glX%sReqSize" % (func.name) + else: + size_name = "" + + if func.glx_vendorpriv == op: + func_name = func.glx_vendorpriv_names[0] + else: + func_name = func.name + + temp = [op, "__glXDisp_%s" % (func_name), "__glXDispSwap_%s" % (func_name), size, size_name] + else: + temp = [op, "NULL", "NULL", 0, ""] + + self.lookup_table.append(temp) + else: + print ' %u,' % (child_index) + child_index += child[2] + + child_base_opcode += 1 << child_M + + print '' + + child_index = base_entry + for child in children: + if child[1] != []: + self.dump_tree(child, base_opcode, remaining_bits - M, child_index, depth + 1) + child_index += child[2] + + base_opcode += 1 << (remaining_bits - M) + + + def Print(self): + # Each dispatch table consists of two data structures. + # + # The first structure is an N-way tree where the opcode for + # the function is the key. Each node switches on a range of + # bits from the opcode. M bits are extracted from the opcde + # and are used as an index to select one of the N, where + # N = 2^M, children. + # + # The tree is stored as a flat array. The first value is the + # number of bits, M, used by the node. For inner nodes, the + # following 2^M values are indexes into the array for the + # child nodes. For leaf nodes, the followign 2^M values are + # indexes into the second data structure. + # + # If an inner node's child index is 0, the child is an empty + # leaf node. That is, none of the opcodes selectable from + # that child exist. Since most of the possible opcode space + # is unused, this allows compact data storage. + # + # The second data structure is an array of pairs of function + # pointers. Each function contains a pointer to a protocol + # decode function and a pointer to a byte-swapped protocol + # decode function. Elements in this array are selected by the + # leaf nodes of the first data structure. + # + # As the tree is traversed, an accumulator is kept. This + # accumulator counts the bits of the opcode consumed by the + # traversal. When accumulator + M = B, where B is the + # maximum number of bits in an opcode, the traversal has + # reached a leaf node. The traversal starts with the most + # significant bits and works down to the least significant + # bits. + # + # Creation of the tree is the most complicated part. At + # each node the elements are divided into groups of 2^M + # elements. The value of M selected is the smallest possible + # value where all of the groups are either empty or full, or + # the groups are a preset minimum size. If all the children + # of a node are non-empty leaf nodes, the children are merged + # to create a single leaf node that replaces the parent. + + tree = self.divide_group(0, 0) + + print '/*****************************************************************/' + print '/* tree depth = %u */' % (tree[3]) + print 'static const int_fast16_t %s_dispatch_tree[%u] = {' % (self.name_base, tree[2]) + self.dump_tree(tree, 0, self.max_bits, 0, 1) + print '};\n' + + # After dumping the tree, dump the function lookup table. + + print 'static const void *%s_function_table[%u][2] = {' % (self.name_base, len(self.lookup_table)) + index = 0 + for func in self.lookup_table: + opcode = func[0] + name = func[1] + name_swap = func[2] + + print ' /* [% 3u] = %5u */ {%s, %s},' % (index, opcode, name, name_swap) + + index += 1 + + print '};\n' + + if self.do_size_check: + var_table = [] + + print 'static const int_fast16_t %s_size_table[%u][2] = {' % (self.name_base, len(self.lookup_table)) + index = 0 + var_table = [] + for func in self.lookup_table: + opcode = func[0] + fixed = func[3] + var = func[4] + + if var != "": + var_offset = "%2u" % (len(var_table)) + var_table.append(var) + else: + var_offset = "~0" + + print ' /* [%3u] = %5u */ {%3u, %s},' % (index, opcode, fixed, var_offset) + index += 1 + + + print '};\n' + + + print 'static const gl_proto_size_func %s_size_func_table[%u] = {' % (self.name_base, len(var_table)) + for func in var_table: + print ' %s,' % (func) + + print '};\n' + + + print 'const struct __glXDispatchInfo %s_dispatch_info = {' % (self.name_base) + print ' %u,' % (self.max_bits) + print ' %s_dispatch_tree,' % (self.name_base) + print ' %s_function_table,' % (self.name_base) + if self.do_size_check: + print ' %s_size_table,' % (self.name_base) + print ' %s_size_func_table' % (self.name_base) + else: + print ' NULL,' + print ' NULL' + print '};\n' + return + + +class PrintGlxDispatchTables(glX_proto_common.glx_print_proto): + def __init__(self): + gl_XML.gl_print_base.__init__(self) + self.name = "glX_server_table.py (from Mesa)" + self.license = license.bsd_license_template % ( "(C) Copyright IBM Corporation 2005, 2006", "IBM") + + self.rop_functions = function_table("Render", 1) + self.sop_functions = function_table("Single", 0) + self.vop_functions = function_table("VendorPriv", 0) + return + + + def printRealHeader(self): + print '#include ' + print '#include "glxserver.h"' + print '#include "glxext.h"' + print '#include "indirect_dispatch.h"' + print '#include "indirect_reqsize.h"' + print '#include "g_disptab.h"' + print '#include "indirect_table.h"' + print '' + return + + + def printBody(self, api): + for f in api.functionIterateAll(): + if not f.ignore and f.vectorequiv == None: + if f.glx_rop != 0: + self.rop_functions.append(f.glx_rop, f) + if f.glx_sop != 0: + self.sop_functions.append(f.glx_sop, f) + if f.glx_vendorpriv != 0: + self.vop_functions.append(f.glx_vendorpriv, f) + + self.sop_functions.Print() + self.rop_functions.Print() + self.vop_functions.Print() + return + + +if __name__ == '__main__': + file_name = "gl_API.xml" + + try: + (args, trail) = getopt.getopt(sys.argv[1:], "f:m") + except Exception,e: + show_usage() + + mode = "table_c" + for (arg,val) in args: + if arg == "-f": + file_name = val + elif arg == "-m": + mode = val + + if mode == "table_c": + printer = PrintGlxDispatchTables() + else: + show_usage() + + + api = gl_XML.parse_GL_API( file_name, glX_XML.glx_item_factory() ) + + + printer.Print( api ) --- mesa-glw-7.4.orig/src/mesa/glapi/extension_helper.py +++ mesa-glw-7.4/src/mesa/glapi/extension_helper.py @@ -0,0 +1,324 @@ +#!/usr/bin/env python + +# (C) Copyright IBM Corporation 2005 +# All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# on the rights to use, copy, modify, merge, publish, distribute, sub +# license, and/or sell copies of the Software, and to permit persons to whom +# the Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the next +# paragraph) shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL +# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# Authors: +# Ian Romanick + +import gl_XML +import license +import sys, getopt, string + +vtxfmt = [ + "ArrayElement", \ + "Color3f", \ + "Color3fv", \ + "Color4f", \ + "Color4fv", \ + "EdgeFlag", \ + "EdgeFlagv", \ + "EvalCoord1f", \ + "EvalCoord1fv", \ + "EvalCoord2f", \ + "EvalCoord2fv", \ + "EvalPoint1", \ + "EvalPoint2", \ + "FogCoordfEXT", \ + "FogCoordfvEXT", \ + "Indexf", \ + "Indexfv", \ + "Materialfv", \ + "MultiTexCoord1fARB", \ + "MultiTexCoord1fvARB", \ + "MultiTexCoord2fARB", \ + "MultiTexCoord2fvARB", \ + "MultiTexCoord3fARB", \ + "MultiTexCoord3fvARB", \ + "MultiTexCoord4fARB", \ + "MultiTexCoord4fvARB", \ + "Normal3f", \ + "Normal3fv", \ + "SecondaryColor3fEXT", \ + "SecondaryColor3fvEXT", \ + "TexCoord1f", \ + "TexCoord1fv", \ + "TexCoord2f", \ + "TexCoord2fv", \ + "TexCoord3f", \ + "TexCoord3fv", \ + "TexCoord4f", \ + "TexCoord4fv", \ + "Vertex2f", \ + "Vertex2fv", \ + "Vertex3f", \ + "Vertex3fv", \ + "Vertex4f", \ + "Vertex4fv", \ + "CallList", \ + "CallLists", \ + "Begin", \ + "End", \ + "VertexAttrib1fNV", \ + "VertexAttrib1fvNV", \ + "VertexAttrib2fNV", \ + "VertexAttrib2fvNV", \ + "VertexAttrib3fNV", \ + "VertexAttrib3fvNV", \ + "VertexAttrib4fNV", \ + "VertexAttrib4fvNV", \ + "VertexAttrib1fARB", \ + "VertexAttrib1fvARB", \ + "VertexAttrib2fARB", \ + "VertexAttrib2fvARB", \ + "VertexAttrib3fARB", \ + "VertexAttrib3fvARB", \ + "VertexAttrib4fARB", \ + "VertexAttrib4fvARB", \ + "Rectf", \ + "DrawArrays", \ + "DrawElements", \ + "DrawRangeElements", \ + "EvalMesh1", \ + "EvalMesh2", \ +] + +def all_entrypoints_in_abi(f, abi, api): + for n in f.entry_points: + [category, num] = api.get_category_for_name( n ) + if category not in abi: + return 0 + + return 1 + + +def any_entrypoints_in_abi(f, abi, api): + for n in f.entry_points: + [category, num] = api.get_category_for_name( n ) + if category in abi: + return 1 + + return 0 + + +def condition_for_function(f, abi, all_not_in_ABI): + """Create a C-preprocessor condition for the function. + + There are two modes of operation. If all_not_in_ABI is set, a + condition is only created is all of the entry-point names for f are + not in the selected ABI. If all_not_in_ABI is not set, a condition + is created if any entryp-point name is not in the selected ABI. + """ + + condition = [] + for n in f.entry_points: + [category, num] = api.get_category_for_name( n ) + if category not in abi: + condition.append( 'defined(need_%s)' % (gl_XML.real_category_name( category )) ) + elif all_not_in_ABI: + return [] + + return condition + + +class PrintGlExtensionGlue(gl_XML.gl_print_base): + def __init__(self): + gl_XML.gl_print_base.__init__(self) + + self.name = "extension_helper.py (from Mesa)" + self.license = license.bsd_license_template % ("(C) Copyright IBM Corporation 2005", "IBM") + return + + + def printRealHeader(self): + print '#include "utils.h"' + print '#include "glapi/dispatch.h"' + print '' + return + + + def printBody(self, api): + abi = [ "1.0", "1.1", "1.2", "GL_ARB_multitexture" ] + + category_list = {} + + print '#ifndef NULL' + print '# define NULL 0' + print '#endif' + print '' + + for f in api.functionIterateAll(): + condition = condition_for_function(f, abi, 0) + if len(condition): + print '#if %s' % (string.join(condition, " || ")) + print 'static const char %s_names[] = ' % (f.name) + + parameter_signature = '' + for p in f.parameterIterator(): + if p.is_padding: + continue + + # FIXME: This is a *really* ugly hack. :( + + tn = p.type_expr.get_base_type_node() + if p.is_pointer(): + parameter_signature += 'p' + elif tn.integer: + parameter_signature += 'i' + elif tn.size == 4: + parameter_signature += 'f' + else: + parameter_signature += 'd' + + print ' "%s\\0" /* Parameter signature */' % (parameter_signature) + + for n in f.entry_points: + print ' "gl%s\\0"' % (n) + + [category, num] = api.get_category_for_name( n ) + if category not in abi: + c = gl_XML.real_category_name(category) + if not category_list.has_key(c): + category_list[ c ] = [] + + category_list[ c ].append( f ) + + print ' "";' + print '#endif' + print '' + + keys = category_list.keys() + keys.sort() + + for category in keys: + print '#if defined(need_%s)' % (category) + print 'static const struct dri_extension_function %s_functions[] = {' % (category) + + for f in category_list[ category ]: + # A function either has an offset that is + # assigned by the ABI, or it has a remap + # index. + if any_entrypoints_in_abi(f, abi, api): + index_name = "-1" + offset = f.offset + else: + index_name = "%s_remap_index" % (f.name) + offset = -1 + + print ' { %s_names, %s, %d },' % (f.name, index_name, offset) + + + print ' { NULL, 0, 0 }' + print '};' + print '#endif' + print '' + + return + + +class PrintInitDispatch(gl_XML.gl_print_base): + def __init__(self): + gl_XML.gl_print_base.__init__(self) + + self.name = "extension_helper.py (from Mesa)" + self.license = license.bsd_license_template % ("(C) Copyright IBM Corporation 2005", "IBM") + return + + + def do_function_body(self, api, abi, vtxfmt_only): + last_condition_string = None + for f in api.functionIterateByOffset(): + if (f.name in vtxfmt) and not vtxfmt_only: + continue + + if (f.name not in vtxfmt) and vtxfmt_only: + continue + + condition = condition_for_function(f, abi, 1) + condition_string = string.join(condition, " || ") + + if condition_string != last_condition_string: + if last_condition_string: + print '#endif /* %s */' % (last_condition_string) + + if condition_string: + print '#if %s' % (condition_string) + + if vtxfmt_only: + print ' disp->%s = vfmt->%s;' % (f.name, f.name) + else: + print ' disp->%s = _mesa_%s;' % (f.name, f.name) + + last_condition_string = condition_string + + if last_condition_string: + print '#endif /* %s */' % (last_condition_string) + + + + def printBody(self, api): + abi = [ "1.0", "1.1", "1.2", "GL_ARB_multitexture" ] + + print 'void driver_init_exec_table(struct _glapi_table *disp)' + print '{' + self.do_function_body(api, abi, 0) + print '}' + print '' + print 'void driver_install_vtxfmt(struct _glapi_table *disp, const GLvertexformat *vfmt)' + print '{' + self.do_function_body(api, abi, 1) + print '}' + + return + + +def show_usage(): + print "Usage: %s [-f input_file_name] [-m output_mode]" % sys.argv[0] + print " -m output_mode Output mode can be one of 'extensions' or 'exec_init'." + sys.exit(1) + +if __name__ == '__main__': + file_name = "gl_API.xml" + + try: + (args, trail) = getopt.getopt(sys.argv[1:], "f:m:") + except Exception,e: + show_usage() + + mode = "extensions" + for (arg,val) in args: + if arg == "-f": + file_name = val + if arg == '-m': + mode = val + + + api = gl_XML.parse_GL_API( file_name ) + + if mode == "extensions": + printer = PrintGlExtensionGlue() + elif mode == "exec_init": + printer = PrintInitDispatch() + else: + show_usage() + + printer.Print( api ) --- mesa-glw-7.4.orig/src/mesa/glapi/gl_API.dtd +++ mesa-glw-7.4/src/mesa/glapi/gl_API.dtd @@ -0,0 +1,140 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + --- mesa-glw-7.4.orig/src/mesa/glapi/gl_and_glX_API.xml +++ mesa-glw-7.4/src/mesa/glapi/gl_and_glX_API.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file --- mesa-glw-7.4.orig/src/mesa/glapi/glX_API.xml +++ mesa-glw-7.4/src/mesa/glapi/glX_API.xml @@ -0,0 +1,220 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + --- mesa-glw-7.4.orig/src/mesa/glapi/glX_doc.py +++ mesa-glw-7.4/src/mesa/glapi/glX_doc.py @@ -0,0 +1,280 @@ +#!/usr/bin/env python + +# (C) Copyright IBM Corporation 2004, 2005 +# All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# on the rights to use, copy, modify, merge, publish, distribute, sub +# license, and/or sell copies of the Software, and to permit persons to whom +# the Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the next +# paragraph) shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL +# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# Authors: +# Ian Romanick + +import gl_XML, glX_XML, glX_proto_common, license +import sys, getopt + + +class glx_doc_item_factory(glX_proto_common.glx_proto_item_factory): + """Factory to create GLX protocol documentation oriented objects derived from glItem.""" + + def create_item(self, name, element, context): + if name == "parameter": + return glx_doc_parameter(element, context) + else: + return glX_proto_common.glx_proto_item_factory.create_item(self, name, element, context) + + +class glx_doc_parameter(gl_XML.gl_parameter): + def packet_type(self, type_dict): + """Get the type string for the packet header + + GLX protocol documentation uses type names like CARD32, + FLOAT64, LISTofCARD8, and ENUM. This function converts the + type of the parameter to one of these names.""" + + list_of = "" + if self.is_array(): + list_of = "LISTof" + + t_name = self.get_base_type_string() + if not type_dict.has_key( t_name ): + type_name = "CARD8" + else: + type_name = type_dict[ t_name ] + + return "%s%s" % (list_of, type_name) + + + def packet_size(self): + p = None + s = self.size() + if s == 0: + a_prod = "n" + b_prod = self.p_type.size + + if not self.count_parameter_list and self.counter: + a_prod = self.counter + elif self.count_parameter_list and not self.counter or self.is_output: + pass + elif self.count_parameter_list and self.counter: + b_prod = self.counter + else: + raise RuntimeError("Parameter '%s' to function '%s' has size 0." % (self.name, self.context.name)) + + ss = "%s*%s" % (a_prod, b_prod) + + return [ss, p] + else: + if s % 4 != 0: + p = "p" + + return [str(s), p] + +class PrintGlxProtoText(gl_XML.gl_print_base): + def __init__(self): + gl_XML.gl_print_base.__init__(self) + self.license = "" + + + def printHeader(self): + return + + + def body_size(self, f): + # At some point, refactor this function and + # glXFunction::command_payload_length. + + size = 0; + size_str = "" + pad_str = "" + plus = "" + for p in f.parameterIterateGlxSend(): + [s, pad] = p.packet_size() + try: + size += int(s) + except Exception,e: + size_str += "%s%s" % (plus, s) + plus = "+" + + if pad != None: + pad_str = pad + + return [size, size_str, pad_str] + + + def print_render_header(self, f): + [size, size_str, pad_str] = self.body_size(f) + size += 4; + + if size_str == "": + s = "%u" % ((size + 3) & ~3) + elif pad_str != "": + s = "%u+%s+%s" % (size, size_str, pad_str) + else: + s = "%u+%s" % (size, size_str) + + print ' 2 %-15s rendering command length' % (s) + print ' 2 %-4u rendering command opcode' % (f.glx_rop) + return + + + def print_single_header(self, f): + [size, size_str, pad_str] = self.body_size(f) + size = ((size + 3) / 4) + 2; + + if f.glx_vendorpriv != 0: + size += 1 + + print ' 1 CARD8 opcode (X assigned)' + print ' 1 %-4u GLX opcode (%s)' % (f.opcode_real_value(), f.opcode_real_name()) + + if size_str == "": + s = "%u" % (size) + elif pad_str != "": + s = "%u+((%s+%s)/4)" % (size, size_str, pad_str) + else: + s = "%u+((%s)/4)" % (size, size_str) + + print ' 2 %-15s request length' % (s) + + if f.glx_vendorpriv != 0: + print ' 4 %-4u vendor specific opcode' % (f.opcode_value()) + + print ' 4 GLX_CONTEXT_TAG context tag' + + return + + + def print_reply(self, f): + print ' =>' + print ' 1 1 reply' + print ' 1 unused' + print ' 2 CARD16 sequence number' + + if f.output == None: + print ' 4 0 reply length' + elif f.reply_always_array: + print ' 4 m reply length' + else: + print ' 4 m reply length, m = (n == 1 ? 0 : n)' + + + output = None + for x in f.parameterIterateOutputs(): + output = x + break + + + unused = 24 + if f.return_type != 'void': + print ' 4 %-15s return value' % (f.return_type) + unused -= 4 + elif output != None: + print ' 4 unused' + unused -= 4 + + if output != None: + print ' 4 CARD32 n' + unused -= 4 + + if output != None: + if not f.reply_always_array: + print '' + print ' if (n = 1) this follows:' + print '' + print ' 4 CARD32 %s' % (output.name) + print ' %-2u unused' % (unused - 4) + print '' + print ' otherwise this follows:' + print '' + + print ' %-2u unused' % (unused) + + [s, pad] = output.packet_size() + print ' %-8s %-15s %s' % (s, output.packet_type( self.type_map ), output.name) + if pad != None: + try: + bytes = int(s) + bytes = 4 - (bytes & 3) + print ' %-8u %-15s unused' % (bytes, "") + except Exception,e: + print ' %-8s %-15s unused, %s=pad(%s)' % (pad, "", pad, s) + else: + print ' %-2u unused' % (unused) + + + def print_body(self, f): + for p in f.parameterIterateGlxSend(): + [s, pad] = p.packet_size() + print ' %-8s %-15s %s' % (s, p.packet_type( self.type_map ), p.name) + if pad != None: + try: + bytes = int(s) + bytes = 4 - (bytes & 3) + print ' %-8u %-15s unused' % (bytes, "") + except Exception,e: + print ' %-8s %-15s unused, %s=pad(%s)' % (pad, "", pad, s) + + def printBody(self, api): + self.type_map = {} + for t in api.typeIterate(): + self.type_map[ "GL" + t.name ] = t.glx_name + + + # At some point this should be expanded to support pixel + # functions, but I'm not going to lose any sleep over it now. + + for f in api.functionIterateByOffset(): + if f.client_handcode or f.server_handcode or f.vectorequiv or len(f.get_images()): + continue + + + if f.glx_rop: + print ' %s' % (f.name) + self.print_render_header(f) + elif f.glx_sop or f.glx_vendorpriv: + print ' %s' % (f.name) + self.print_single_header(f) + else: + continue + + self.print_body(f) + + if f.needs_reply(): + self.print_reply(f) + + print '' + return + + +if __name__ == '__main__': + file_name = "gl_API.xml" + + try: + (args, trail) = getopt.getopt(sys.argv[1:], "f:") + except Exception,e: + show_usage() + + for (arg,val) in args: + if arg == "-f": + file_name = val + + api = gl_XML.parse_GL_API( file_name, glx_doc_item_factory() ) + + printer = PrintGlxProtoText() + printer.Print( api ) --- mesa-glw-7.4.orig/src/mesa/glapi/glX_proto_recv.py +++ mesa-glw-7.4/src/mesa/glapi/glX_proto_recv.py @@ -0,0 +1,554 @@ +#!/usr/bin/env python + +# (C) Copyright IBM Corporation 2005 +# All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# on the rights to use, copy, modify, merge, publish, distribute, sub +# license, and/or sell copies of the Software, and to permit persons to whom +# the Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the next +# paragraph) shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL +# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# Authors: +# Ian Romanick + +import gl_XML, glX_XML, glX_proto_common, license +import sys, getopt, string + + +class PrintGlxDispatch_h(gl_XML.gl_print_base): + def __init__(self): + gl_XML.gl_print_base.__init__(self) + + self.name = "glX_proto_recv.py (from Mesa)" + self.license = license.bsd_license_template % ( "(C) Copyright IBM Corporation 2005", "IBM") + + self.header_tag = "_INDIRECT_DISPATCH_H_" + return + + + def printRealHeader(self): + self.printVisibility( "HIDDEN", "hidden" ) + print 'struct __GLXclientStateRec;' + print '' + return + + + def printBody(self, api): + for func in api.functionIterateAll(): + if not func.ignore and not func.vectorequiv: + if func.glx_rop: + print 'extern HIDDEN void __glXDisp_%s(GLbyte * pc);' % (func.name) + print 'extern HIDDEN void __glXDispSwap_%s(GLbyte * pc);' % (func.name) + elif func.glx_sop or func.glx_vendorpriv: + print 'extern HIDDEN int __glXDisp_%s(struct __GLXclientStateRec *, GLbyte *);' % (func.name) + print 'extern HIDDEN int __glXDispSwap_%s(struct __GLXclientStateRec *, GLbyte *);' % (func.name) + + if func.glx_sop and func.glx_vendorpriv: + n = func.glx_vendorpriv_names[0] + print 'extern HIDDEN int __glXDisp_%s(struct __GLXclientStateRec *, GLbyte *);' % (n) + print 'extern HIDDEN int __glXDispSwap_%s(struct __GLXclientStateRec *, GLbyte *);' % (n) + + return + + +class PrintGlxDispatchFunctions(glX_proto_common.glx_print_proto): + def __init__(self, do_swap): + gl_XML.gl_print_base.__init__(self) + self.name = "glX_proto_recv.py (from Mesa)" + self.license = license.bsd_license_template % ( "(C) Copyright IBM Corporation 2005", "IBM") + + self.real_types = [ '', '', 'uint16_t', '', 'uint32_t', '', '', '', 'uint64_t' ] + self.do_swap = do_swap + return + + + def printRealHeader(self): + print '#include ' + print '#include ' + print '#include ' + + print '#include ' + print '#include "indirect_size.h"' + print '#include "indirect_size_get.h"' + print '#include "indirect_dispatch.h"' + print '#include "glxserver.h"' + print '#include "glxbyteorder.h"' + print '#include "indirect_util.h"' + print '#include "singlesize.h"' + print '#include "glapi.h"' + print '#include "glapitable.h"' + print '#include "glthread.h"' + print '#include "dispatch.h"' + print '' + print '#define __GLX_PAD(x) (((x) + 3) & ~3)' + print '' + print 'typedef struct {' + print ' __GLX_PIXEL_3D_HDR;' + print '} __GLXpixel3DHeader;' + print '' + print 'extern GLboolean __glXErrorOccured( void );' + print 'extern void __glXClearErrorOccured( void );' + print '' + print 'static const unsigned dummy_answer[2] = {0, 0};' + print '' + return + + + def printBody(self, api): + if self.do_swap: + self.emit_swap_wrappers(api) + + + for func in api.functionIterateByOffset(): + if not func.ignore and not func.server_handcode and not func.vectorequiv and (func.glx_rop or func.glx_sop or func.glx_vendorpriv): + self.printFunction(func, func.name) + if func.glx_sop and func.glx_vendorpriv: + self.printFunction(func, func.glx_vendorpriv_names[0]) + + + return + + + def printFunction(self, f, name): + if (f.glx_sop or f.glx_vendorpriv) and (len(f.get_images()) != 0): + return + + if not self.do_swap: + base = '__glXDisp' + else: + base = '__glXDispSwap' + + if f.glx_rop: + print 'void %s_%s(GLbyte * pc)' % (base, name) + else: + print 'int %s_%s(__GLXclientState *cl, GLbyte *pc)' % (base, name) + + print '{' + + if f.glx_rop or f.vectorequiv: + self.printRenderFunction(f) + elif f.glx_sop or f.glx_vendorpriv: + if len(f.get_images()) == 0: + self.printSingleFunction(f, name) + else: + print "/* Missing GLX protocol for %s. */" % (name) + + print '}' + print '' + return + + + def swap_name(self, bytes): + return 'bswap_%u_array' % (8 * bytes) + + + def emit_swap_wrappers(self, api): + self.type_map = {} + already_done = [ ] + + for t in api.typeIterate(): + te = t.get_type_expression() + t_size = te.get_element_size() + + if t_size > 1 and t.glx_name: + + t_name = "GL" + t.name + self.type_map[ t_name ] = t.glx_name + + if t.glx_name not in already_done: + real_name = self.real_types[t_size] + + print 'static %s' % (t_name) + print 'bswap_%s( const void * src )' % (t.glx_name) + print '{' + print ' union { %s dst; %s ret; } x;' % (real_name, t_name) + print ' x.dst = bswap_%u( *(%s *) src );' % (t_size * 8, real_name) + print ' return x.ret;' + print '}' + print '' + already_done.append( t.glx_name ) + + for bits in [16, 32, 64]: + print 'static void *' + print 'bswap_%u_array( uint%u_t * src, unsigned count )' % (bits, bits) + print '{' + print ' unsigned i;' + print '' + print ' for ( i = 0 ; i < count ; i++ ) {' + print ' uint%u_t temp = bswap_%u( src[i] );' % (bits, bits) + print ' src[i] = temp;' + print ' }' + print '' + print ' return src;' + print '}' + print '' + + + def fetch_param(self, param): + t = param.type_string() + o = param.offset + element_size = param.size() / param.get_element_count() + + if self.do_swap and (element_size != 1): + if param.is_array(): + real_name = self.real_types[ element_size ] + + swap_func = self.swap_name( element_size ) + return ' (%-8s)%s( (%s *) (pc + %2s), %s )' % (t, swap_func, real_name, o, param.count) + else: + t_name = param.get_base_type_string() + return ' (%-8s)bswap_%-7s( pc + %2s )' % (t, self.type_map[ t_name ], o) + else: + if param.is_array(): + return ' (%-8s)(pc + %2u)' % (t, o) + else: + return '*(%-8s *)(pc + %2u)' % (t, o) + + return None + + + def emit_function_call(self, f, retval_assign, indent): + list = [] + + for param in f.parameterIterator(): + if param.is_padding: + continue + + if param.is_counter or param.is_image() or param.is_output or param.name in f.count_parameter_list or len(param.count_parameter_list): + location = param.name + else: + location = self.fetch_param(param) + + list.append( '%s %s' % (indent, location) ) + + + if len( list ): + print '%s %sCALL_%s( GET_DISPATCH(), (' % (indent, retval_assign, f.name) + print string.join( list, ",\n" ) + print '%s ) );' % (indent) + else: + print '%s %sCALL_%s( GET_DISPATCH(), () );' % (indent, retval_assign, f.name) + return + + + def common_func_print_just_start(self, f, indent): + align64 = 0 + need_blank = 0 + + + f.calculate_offsets() + for param in f.parameterIterateGlxSend(): + # If any parameter has a 64-bit base type, then we + # have to do alignment magic for the while thing. + + if param.is_64_bit(): + align64 = 1 + + + # FIXME img_null_flag is over-loaded. In addition to + # FIXME being used for images, it is used to signify + # FIXME NULL data pointers for vertex buffer object + # FIXME related functions. Re-name it to null_data + # FIXME or something similar. + + if param.img_null_flag: + print '%s const CARD32 ptr_is_null = *(CARD32 *)(pc + %s);' % (indent, param.offset - 4) + cond = '(ptr_is_null != 0) ? NULL : ' + else: + cond = "" + + + type_string = param.type_string() + + if param.is_image(): + offset = f.offset_of( param.name ) + + print '%s %s const %s = (%s) %s(pc + %s);' % (indent, type_string, param.name, type_string, cond, offset) + + if param.depth: + print '%s __GLXpixel3DHeader * const hdr = (__GLXpixel3DHeader *)(pc);' % (indent) + else: + print '%s __GLXpixelHeader * const hdr = (__GLXpixelHeader *)(pc);' % (indent) + + need_blank = 1 + elif param.is_counter or param.name in f.count_parameter_list: + location = self.fetch_param(param) + print '%s const %s %s = %s;' % (indent, type_string, param.name, location) + need_blank = 1 + elif len(param.count_parameter_list): + if param.size() == 1 and not self.do_swap: + location = self.fetch_param(param) + print '%s %s %s = %s%s;' % (indent, type_string, param.name, cond, location) + else: + print '%s %s %s;' % (indent, type_string, param.name) + need_blank = 1 + + + + if need_blank: + print '' + + if align64: + print '#ifdef __GLX_ALIGN64' + + if f.has_variable_size_request(): + self.emit_packet_size_calculation(f, 4) + s = "cmdlen" + else: + s = str((f.command_fixed_length() + 3) & ~3) + + print ' if ((unsigned long)(pc) & 7) {' + print ' (void) memmove(pc-4, pc, %s);' % (s) + print ' pc -= 4;' + print ' }' + print '#endif' + print '' + + + need_blank = 0 + if self.do_swap: + for param in f.parameterIterateGlxSend(): + if param.count_parameter_list: + o = param.offset + count = param.get_element_count() + type_size = param.size() / count + + if param.counter: + count_name = param.counter + else: + count_name = str(count) + + # This is basically an ugly special- + # case for glCallLists. + + if type_size == 1: + x = [] + x.append( [1, ['BYTE', 'UNSIGNED_BYTE', '2_BYTES', '3_BYTES', '4_BYTES']] ) + x.append( [2, ['SHORT', 'UNSIGNED_SHORT']] ) + x.append( [4, ['INT', 'UNSIGNED_INT', 'FLOAT']] ) + + print ' switch(%s) {' % (param.count_parameter_list[0]) + for sub in x: + for t_name in sub[1]: + print ' case GL_%s:' % (t_name) + + if sub[0] == 1: + print ' %s = (%s) (pc + %s); break;' % (param.name, param.type_string(), o) + else: + swap_func = self.swap_name(sub[0]) + print ' %s = (%s) %s( (%s *) (pc + %s), %s ); break;' % (param.name, param.type_string(), swap_func, self.real_types[sub[0]], o, count_name) + print ' default:' + print ' return;' + print ' }' + else: + swap_func = self.swap_name(type_size) + compsize = self.size_call(f, 1) + print ' %s = (%s) %s( (%s *) (pc + %s), %s );' % (param.name, param.type_string(), swap_func, self.real_types[type_size], o, compsize) + + need_blank = 1 + + else: + for param in f.parameterIterateGlxSend(): + if param.count_parameter_list: + print '%s %s = (%s) (pc + %s);' % (indent, param.name, param.type_string(), param.offset) + need_blank = 1 + + + if need_blank: + print '' + + + return + + + def printSingleFunction(self, f, name): + if name not in f.glx_vendorpriv_names: + print ' xGLXSingleReq * const req = (xGLXSingleReq *) pc;' + else: + print ' xGLXVendorPrivateReq * const req = (xGLXVendorPrivateReq *) pc;' + + print ' int error;' + + if self.do_swap: + print ' __GLXcontext * const cx = __glXForceCurrent(cl, bswap_CARD32( &req->contextTag ), &error);' + else: + print ' __GLXcontext * const cx = __glXForceCurrent(cl, req->contextTag, &error);' + + print '' + if name not in f.glx_vendorpriv_names: + print ' pc += __GLX_SINGLE_HDR_SIZE;' + else: + print ' pc += __GLX_VENDPRIV_HDR_SIZE;' + + print ' if ( cx != NULL ) {' + self.common_func_print_just_start(f, " ") + + + if f.return_type != 'void': + print ' %s retval;' % (f.return_type) + retval_string = "retval" + retval_assign = "retval = " + else: + retval_string = "0" + retval_assign = "" + + + type_size = 0 + answer_string = "dummy_answer" + answer_count = "0" + is_array_string = "GL_FALSE" + + for param in f.parameterIterateOutputs(): + answer_type = param.get_base_type_string() + if answer_type == "GLvoid": + answer_type = "GLubyte" + + + c = param.get_element_count() + type_size = (param.size() / c) + if type_size == 1: + size_scale = "" + else: + size_scale = " * %u" % (type_size) + + + if param.count_parameter_list: + print ' const GLuint compsize = %s;' % (self.size_call(f, 1)) + print ' %s answerBuffer[200];' % (answer_type) + print ' %s %s = __glXGetAnswerBuffer(cl, compsize%s, answerBuffer, sizeof(answerBuffer), %u);' % (param.type_string(), param.name, size_scale, type_size ) + answer_string = param.name + answer_count = "compsize" + + print '' + print ' if (%s == NULL) return BadAlloc;' % (param.name) + print ' __glXClearErrorOccured();' + print '' + elif param.counter: + print ' %s answerBuffer[200];' % (answer_type) + print ' %s %s = __glXGetAnswerBuffer(cl, %s%s, answerBuffer, sizeof(answerBuffer), %u);' % (param.type_string(), param.name, param.counter, size_scale, type_size) + answer_string = param.name + answer_count = param.counter + elif c >= 1: + print ' %s %s[%u];' % (answer_type, param.name, c) + answer_string = param.name + answer_count = "%u" % (c) + + if f.reply_always_array: + is_array_string = "GL_TRUE" + + + self.emit_function_call(f, retval_assign, " ") + + + if f.needs_reply(): + if self.do_swap: + for param in f.parameterIterateOutputs(): + c = param.get_element_count() + type_size = (param.size() / c) + + if type_size > 1: + swap_name = self.swap_name( type_size ) + print ' (void) %s( (uint%u_t *) %s, %s );' % (swap_name, 8 * type_size, param.name, answer_count) + + + reply_func = '__glXSendReplySwap' + else: + reply_func = '__glXSendReply' + + print ' %s(cl->client, %s, %s, %u, %s, %s);' % (reply_func, answer_string, answer_count, type_size, is_array_string, retval_string) + #elif f.note_unflushed: + # print ' cx->hasUnflushedCommands = GL_TRUE;' + + print ' error = Success;' + print ' }' + print '' + print ' return error;' + return + + + def printRenderFunction(self, f): + # There are 4 distinct phases in a rendering dispatch function. + # In the first phase we compute the sizes and offsets of each + # element in the command. In the second phase we (optionally) + # re-align 64-bit data elements. In the third phase we + # (optionally) byte-swap array data. Finally, in the fourth + # phase we actually dispatch the function. + + self.common_func_print_just_start(f, "") + + images = f.get_images() + if len(images): + if self.do_swap: + pre = "bswap_CARD32( & " + post = " )" + else: + pre = "" + post = "" + + img = images[0] + + # swapBytes and lsbFirst are single byte fields, so + # the must NEVER be byte-swapped. + + if not (img.img_type == "GL_BITMAP" and img.img_format == "GL_COLOR_INDEX"): + print ' CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_SWAP_BYTES, hdr->swapBytes) );' + + print ' CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_LSB_FIRST, hdr->lsbFirst) );' + + print ' CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_ROW_LENGTH, (GLint) %shdr->rowLength%s) );' % (pre, post) + if img.depth: + print ' CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_IMAGE_HEIGHT, (GLint) %shdr->imageHeight%s) );' % (pre, post) + print ' CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_SKIP_ROWS, (GLint) %shdr->skipRows%s) );' % (pre, post) + if img.depth: + print ' CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_SKIP_IMAGES, (GLint) %shdr->skipImages%s) );' % (pre, post) + print ' CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_SKIP_PIXELS, (GLint) %shdr->skipPixels%s) );' % (pre, post) + print ' CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_ALIGNMENT, (GLint) %shdr->alignment%s) );' % (pre, post) + print '' + + + self.emit_function_call(f, "", "") + return + + +if __name__ == '__main__': + file_name = "gl_API.xml" + + try: + (args, trail) = getopt.getopt(sys.argv[1:], "f:m:s") + except Exception,e: + show_usage() + + mode = "dispatch_c" + do_swap = 0 + for (arg,val) in args: + if arg == "-f": + file_name = val + elif arg == "-m": + mode = val + elif arg == "-s": + do_swap = 1 + + if mode == "dispatch_c": + printer = PrintGlxDispatchFunctions(do_swap) + elif mode == "dispatch_h": + printer = PrintGlxDispatch_h() + else: + show_usage() + + api = gl_XML.parse_GL_API( file_name, glX_proto_common.glx_proto_item_factory() ) + + printer.Print( api ) --- mesa-glw-7.4.orig/src/mesa/glapi/gl_table.py +++ mesa-glw-7.4/src/mesa/glapi/gl_table.py @@ -0,0 +1,199 @@ +#!/usr/bin/python2 + +# (C) Copyright IBM Corporation 2004 +# All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# on the rights to use, copy, modify, merge, publish, distribute, sub +# license, and/or sell copies of the Software, and to permit persons to whom +# the Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the next +# paragraph) shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL +# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# Authors: +# Ian Romanick + +import gl_XML +import license +import sys, getopt + +class PrintGlTable(gl_XML.gl_print_base): + def __init__(self): + gl_XML.gl_print_base.__init__(self) + + self.header_tag = '_GLAPI_TABLE_H_' + self.name = "gl_table.py (from Mesa)" + self.license = license.bsd_license_template % ( \ +"""Copyright (C) 1999-2003 Brian Paul All Rights Reserved. +(C) Copyright IBM Corporation 2004""", "BRIAN PAUL, IBM") + return + + + def printBody(self, api): + for f in api.functionIterateByOffset(): + arg_string = f.get_parameter_string() + print ' %s (GLAPIENTRYP %s)(%s); /* %d */' % (f.return_type, f.name, arg_string, f.offset) + + + def printRealHeader(self): + print '#ifndef GLAPIENTRYP' + print '# ifndef GLAPIENTRY' + print '# define GLAPIENTRY' + print '# endif' + print '' + print '# define GLAPIENTRYP GLAPIENTRY *' + print '#endif' + print '' + print '' + print 'struct _glapi_table' + print '{' + return + + + def printRealFooter(self): + print '};' + return + + +class PrintRemapTable(gl_XML.gl_print_base): + def __init__(self): + gl_XML.gl_print_base.__init__(self) + + self.header_tag = '_DISPATCH_H_' + self.name = "gl_table.py (from Mesa)" + self.license = license.bsd_license_template % ("(C) Copyright IBM Corporation 2005", "IBM") + return + + + def printRealHeader(self): + print """ +#include "glapitable.h" +/** + * \\file dispatch.h + * Macros for handling GL dispatch tables. + * + * For each known GL function, there are 3 macros in this file. The first + * macro is named CALL_FuncName and is used to call that GL function using + * the specified dispatch table. The other 2 macros, called GET_FuncName + * can SET_FuncName, are used to get and set the dispatch pointer for the + * named function in the specified dispatch table. + */ +""" + + return + + def printBody(self, api): + print '#define CALL_by_offset(disp, cast, offset, parameters) \\' + print ' (*(cast (GET_by_offset(disp, offset)))) parameters' + print '#define GET_by_offset(disp, offset) \\' + print ' (offset >= 0) ? (((_glapi_proc *)(disp))[offset]) : NULL' + print '#define SET_by_offset(disp, offset, fn) \\' + print ' do { \\' + print ' if ( (offset) < 0 ) { \\' + print ' /* fprintf( stderr, "[%s:%u] SET_by_offset(%p, %d, %s)!\\n", */ \\' + print ' /* __func__, __LINE__, disp, offset, # fn); */ \\' + print ' /* abort(); */ \\' + print ' } \\' + print ' else { \\' + print ' ( (_glapi_proc *) (disp) )[offset] = (_glapi_proc) fn; \\' + print ' } \\' + print ' } while(0)' + print '' + + abi = [ "1.0", "1.1", "1.2", "GL_ARB_multitexture" ] + + functions = [] + abi_functions = [] + count = 0 + for f in api.functionIterateByOffset(): + [category, num] = api.get_category_for_name( f.name ) + if category not in abi: + functions.append( [f, count] ) + count += 1 + else: + abi_functions.append( f ) + + + for f in abi_functions: + print '#define CALL_%s(disp, parameters) (*((disp)->%s)) parameters' % (f.name, f.name) + print '#define GET_%s(disp) ((disp)->%s)' % (f.name, f.name) + print '#define SET_%s(disp, fn) ((disp)->%s = fn)' % (f.name, f.name) + + + print '' + print '#if !defined(IN_DRI_DRIVER)' + print '' + + for [f, index] in functions: + print '#define CALL_%s(disp, parameters) (*((disp)->%s)) parameters' % (f.name, f.name) + print '#define GET_%s(disp) ((disp)->%s)' % (f.name, f.name) + print '#define SET_%s(disp, fn) ((disp)->%s = fn)' % (f.name, f.name) + + print '' + print '#else' + print '' + print '#define driDispatchRemapTable_size %u' % (count) + print 'extern int driDispatchRemapTable[ driDispatchRemapTable_size ];' + print '' + + for [f, index] in functions: + print '#define %s_remap_index %u' % (f.name, index) + + print '' + + for [f, index] in functions: + arg_string = gl_XML.create_parameter_string( f.parameters, 0 ) + cast = '%s (GLAPIENTRYP)(%s)' % (f.return_type, arg_string) + + print '#define CALL_%s(disp, parameters) CALL_by_offset(disp, (%s), driDispatchRemapTable[%s_remap_index], parameters)' % (f.name, cast, f.name) + print '#define GET_%s(disp) GET_by_offset(disp, driDispatchRemapTable[%s_remap_index])' % (f.name, f.name) + print '#define SET_%s(disp, fn) SET_by_offset(disp, driDispatchRemapTable[%s_remap_index], fn)' % (f.name, f.name) + + + print '' + print '#endif /* !defined(IN_DRI_DRIVER) */' + return + + +def show_usage(): + print "Usage: %s [-f input_file_name] [-m mode]" % sys.argv[0] + print " -m mode Mode can be 'table' or 'remap_table'." + sys.exit(1) + +if __name__ == '__main__': + file_name = "gl_API.xml" + + try: + (args, trail) = getopt.getopt(sys.argv[1:], "f:m:") + except Exception,e: + show_usage() + + mode = "table" + for (arg,val) in args: + if arg == "-f": + file_name = val + elif arg == "-m": + mode = val + + if mode == "table": + printer = PrintGlTable() + elif mode == "remap_table": + printer = PrintRemapTable() + else: + show_usage() + + api = gl_XML.parse_GL_API( file_name ) + + printer.Print( api ) --- mesa-glw-7.4.orig/src/mesa/glapi/glX_proto_send.py +++ mesa-glw-7.4/src/mesa/glapi/glX_proto_send.py @@ -0,0 +1,1038 @@ +#!/usr/bin/env python + +# (C) Copyright IBM Corporation 2004, 2005 +# All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# on the rights to use, copy, modify, merge, publish, distribute, sub +# license, and/or sell copies of the Software, and to permit persons to whom +# the Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the next +# paragraph) shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL +# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# Authors: +# Ian Romanick +# Jeremy Kolb + +import gl_XML, glX_XML, glX_proto_common, license +import sys, getopt, copy, string + +def convertStringForXCB(str): + tmp = "" + special = [ "ARB" ] + i = 0 + while i < len(str): + if str[i:i+3] in special: + tmp = '%s_%s' % (tmp, string.lower(str[i:i+3])) + i = i + 2; + elif str[i].isupper(): + tmp = '%s_%s' % (tmp, string.lower(str[i])) + else: + tmp = '%s%s' % (tmp, str[i]) + i += 1 + return tmp + +def hash_pixel_function(func): + """Generate a 'unique' key for a pixel function. The key is based on + the parameters written in the command packet. This includes any + padding that might be added for the original function and the 'NULL + image' flag.""" + + + h = "" + hash_pre = "" + hash_suf = "" + for param in func.parameterIterateGlxSend(): + if param.is_image(): + [dim, junk, junk, junk, junk] = param.get_dimensions() + + d = (dim + 1) & ~1 + hash_pre = "%uD%uD_" % (d - 1, d) + + if param.img_null_flag: + hash_suf = "_NF" + + h += "%u" % (param.size()) + + if func.pad_after(param): + h += "4" + + + n = func.name.replace("%uD" % (dim), "") + n = "__glx_%s_%uD%uD" % (n, d - 1, d) + + h = hash_pre + h + hash_suf + return [h, n] + + +class glx_pixel_function_stub(glX_XML.glx_function): + """Dummy class used to generate pixel "utility" functions that are + shared by multiple dimension image functions. For example, these + objects are used to generate shared functions used to send GLX + protocol for TexImage1D and TexImage2D, TexSubImage1D and + TexSubImage2D, etc.""" + + def __init__(self, func, name): + # The parameters to the utility function are the same as the + # parameters to the real function except for the added "pad" + # parameters. + + self.name = name + self.images = [] + self.parameters = [] + self.parameters_by_name = {} + for _p in func.parameterIterator(): + p = copy.copy(_p) + self.parameters.append(p) + self.parameters_by_name[ p.name ] = p + + + if p.is_image(): + self.images.append(p) + p.height = "height" + + if p.img_yoff == None: + p.img_yoff = "yoffset" + + if p.depth: + if p.extent == None: + p.extent = "extent" + + if p.img_woff == None: + p.img_woff = "woffset" + + + pad_name = func.pad_after(p) + if pad_name: + pad = copy.copy(p) + pad.name = pad_name + self.parameters.append(pad) + self.parameters_by_name[ pad.name ] = pad + + + self.return_type = func.return_type + + self.glx_rop = ~0 + self.glx_sop = 0 + self.glx_vendorpriv = 0 + + self.glx_doubles_in_order = func.glx_doubles_in_order + + self.vectorequiv = None + self.output = None + self.can_be_large = func.can_be_large + self.reply_always_array = func.reply_always_array + self.dimensions_in_reply = func.dimensions_in_reply + self.img_reset = None + + self.server_handcode = 0 + self.client_handcode = 0 + self.ignore = 0 + + self.count_parameter_list = func.count_parameter_list + self.counter_list = func.counter_list + self.offsets_calculated = 0 + return + + +class PrintGlxProtoStubs(glX_proto_common.glx_print_proto): + def __init__(self): + glX_proto_common.glx_print_proto.__init__(self) + self.name = "glX_proto_send.py (from Mesa)" + self.license = license.bsd_license_template % ( "(C) Copyright IBM Corporation 2004, 2005", "IBM") + + + self.last_category = "" + self.generic_sizes = [3, 4, 6, 8, 12, 16, 24, 32] + self.pixel_stubs = {} + self.debug = 0 + return + + def printRealHeader(self): + print '' + print '#include ' + print '#include "indirect.h"' + print '#include "glxclient.h"' + print '#include "indirect_size.h"' + print '#include "dispatch.h"' + print '#include "glapi.h"' + print '#include "glthread.h"' + print '#include ' + print '#ifdef USE_XCB' + print '#include ' + print '#include ' + print '#include ' + print '#endif /* USE_XCB */' + + print '' + print '#define __GLX_PAD(n) (((n) + 3) & ~3)' + print '' + self.printFastcall() + self.printNoinline() + print '' + print '#if !defined __GNUC__ || __GNUC__ < 3' + print '# define __builtin_expect(x, y) x' + print '#endif' + print '' + print '/* If the size and opcode values are known at compile-time, this will, on' + print ' * x86 at least, emit them with a single instruction.' + print ' */' + print '#define emit_header(dest, op, size) \\' + print ' do { union { short s[2]; int i; } temp; \\' + print ' temp.s[0] = (size); temp.s[1] = (op); \\' + print ' *((int *)(dest)) = temp.i; } while(0)' + print '' + print """NOINLINE CARD32 +__glXReadReply( Display *dpy, size_t size, void * dest, GLboolean reply_is_always_array ) +{ + xGLXSingleReply reply; + + (void) _XReply(dpy, (xReply *) & reply, 0, False); + if (size != 0) { + if ((reply.length > 0) || reply_is_always_array) { + const GLint bytes = (reply_is_always_array) + ? (4 * reply.length) : (reply.size * size); + const GLint extra = 4 - (bytes & 3); + + _XRead(dpy, dest, bytes); + if ( extra < 4 ) { + _XEatData(dpy, extra); + } + } + else { + (void) memcpy( dest, &(reply.pad3), size); + } + } + + return reply.retval; +} + +NOINLINE void +__glXReadPixelReply( Display *dpy, __GLXcontext * gc, unsigned max_dim, + GLint width, GLint height, GLint depth, GLenum format, GLenum type, + void * dest, GLboolean dimensions_in_reply ) +{ + xGLXSingleReply reply; + GLint size; + + (void) _XReply(dpy, (xReply *) & reply, 0, False); + + if ( dimensions_in_reply ) { + width = reply.pad3; + height = reply.pad4; + depth = reply.pad5; + + if ((height == 0) || (max_dim < 2)) { height = 1; } + if ((depth == 0) || (max_dim < 3)) { depth = 1; } + } + + size = reply.length * 4; + if (size != 0) { + void * buf = Xmalloc( size ); + + if ( buf == NULL ) { + _XEatData(dpy, size); + __glXSetError(gc, GL_OUT_OF_MEMORY); + } + else { + const GLint extra = 4 - (size & 3); + + _XRead(dpy, buf, size); + if ( extra < 4 ) { + _XEatData(dpy, extra); + } + + __glEmptyImage(gc, 3, width, height, depth, format, type, + buf, dest); + Xfree(buf); + } + } +} + +#define X_GLXSingle 0 + +NOINLINE FASTCALL GLubyte * +__glXSetupSingleRequest( __GLXcontext * gc, GLint sop, GLint cmdlen ) +{ + xGLXSingleReq * req; + Display * const dpy = gc->currentDpy; + + (void) __glXFlushRenderBuffer(gc, gc->pc); + LockDisplay(dpy); + GetReqExtra(GLXSingle, cmdlen, req); + req->reqType = gc->majorOpcode; + req->contextTag = gc->currentContextTag; + req->glxCode = sop; + return (GLubyte *)(req) + sz_xGLXSingleReq; +} + +NOINLINE FASTCALL GLubyte * +__glXSetupVendorRequest( __GLXcontext * gc, GLint code, GLint vop, GLint cmdlen ) +{ + xGLXVendorPrivateReq * req; + Display * const dpy = gc->currentDpy; + + (void) __glXFlushRenderBuffer(gc, gc->pc); + LockDisplay(dpy); + GetReqExtra(GLXVendorPrivate, cmdlen, req); + req->reqType = gc->majorOpcode; + req->glxCode = code; + req->vendorCode = vop; + req->contextTag = gc->currentContextTag; + return (GLubyte *)(req) + sz_xGLXVendorPrivateReq; +} + +const GLuint __glXDefaultPixelStore[9] = { 0, 0, 0, 0, 0, 0, 0, 0, 1 }; + +#define zero (__glXDefaultPixelStore+0) +#define one (__glXDefaultPixelStore+8) +#define default_pixel_store_1D (__glXDefaultPixelStore+4) +#define default_pixel_store_1D_size 20 +#define default_pixel_store_2D (__glXDefaultPixelStore+4) +#define default_pixel_store_2D_size 20 +#define default_pixel_store_3D (__glXDefaultPixelStore+0) +#define default_pixel_store_3D_size 36 +#define default_pixel_store_4D (__glXDefaultPixelStore+0) +#define default_pixel_store_4D_size 36 +""" + + for size in self.generic_sizes: + self.print_generic_function(size) + return + + + def printBody(self, api): + + self.pixel_stubs = {} + generated_stubs = [] + + for func in api.functionIterateGlx(): + if func.client_handcode: continue + + # If the function is a pixel function with a certain + # GLX protocol signature, create a fake stub function + # for it. For example, create a single stub function + # that is used to implement both glTexImage1D and + # glTexImage2D. + + if func.glx_rop != 0: + do_it = 0 + for image in func.get_images(): + if image.img_pad_dimensions: + do_it = 1 + break + + + if do_it: + [h, n] = hash_pixel_function(func) + + + self.pixel_stubs[ func.name ] = n + if h not in generated_stubs: + generated_stubs.append(h) + + fake_func = glx_pixel_function_stub( func, n ) + self.printFunction(fake_func, fake_func.name) + + + self.printFunction(func, func.name) + if func.glx_sop and func.glx_vendorpriv: + self.printFunction(func, func.glx_vendorpriv_names[0]) + + return + + + def printFunction(self, func, name): + footer = '}\n' + if func.glx_rop == ~0: + print 'static %s' % (func.return_type) + print '%s( unsigned opcode, unsigned dim, %s )' % (func.name, func.get_parameter_string()) + print '{' + else: + if func.has_different_protocol(name): + if func.return_type == "void": + ret_string = '' + else: + ret_string = "return " + + func_name = func.static_glx_name(name) + print '#define %s %d' % (func.opcode_vendor_name(name), func.glx_vendorpriv) + print '%s gl%s(%s)' % (func.return_type, func_name, func.get_parameter_string()) + print '{' + print ' __GLXcontext * const gc = __glXGetCurrentContext();' + print '' + print ' if (gc->driContext) {' + print ' %sCALL_%s(GET_DISPATCH(), (%s));' % (ret_string, func.name, func.get_called_parameter_string()) + print ' } else {' + footer = '}\n}\n' + else: + print '#define %s %d' % (func.opcode_name(), func.opcode_value()) + + print '%s __indirect_gl%s(%s)' % (func.return_type, name, func.get_parameter_string()) + print '{' + + + if func.glx_rop != 0 or func.vectorequiv != None: + if len(func.images): + self.printPixelFunction(func) + else: + self.printRenderFunction(func) + elif func.glx_sop != 0 or func.glx_vendorpriv != 0: + self.printSingleFunction(func, name) + pass + else: + print "/* Missing GLX protocol for %s. */" % (name) + + print footer + return + + + def print_generic_function(self, n): + size = (n + 3) & ~3 + print """static FASTCALL NOINLINE void +generic_%u_byte( GLint rop, const void * ptr ) +{ + __GLXcontext * const gc = __glXGetCurrentContext(); + const GLuint cmdlen = %u; + + emit_header(gc->pc, rop, cmdlen); + (void) memcpy((void *)(gc->pc + 4), ptr, %u); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } +} +""" % (n, size + 4, size) + return + + + def common_emit_one_arg(self, p, pc, adjust, extra_offset): + if p.is_array(): + src_ptr = p.name + else: + src_ptr = "&" + p.name + + if p.is_padding: + print '(void) memset((void *)(%s + %u), 0, %s);' \ + % (pc, p.offset + adjust, p.size_string() ) + elif not extra_offset: + print '(void) memcpy((void *)(%s + %u), (void *)(%s), %s);' \ + % (pc, p.offset + adjust, src_ptr, p.size_string() ) + else: + print '(void) memcpy((void *)(%s + %u + %s), (void *)(%s), %s);' \ + % (pc, p.offset + adjust, extra_offset, src_ptr, p.size_string() ) + + def common_emit_args(self, f, pc, adjust, skip_vla): + extra_offset = None + + for p in f.parameterIterateGlxSend( not skip_vla ): + if p.name != f.img_reset: + self.common_emit_one_arg(p, pc, adjust, extra_offset) + + if p.is_variable_length(): + temp = p.size_string() + if extra_offset: + extra_offset += " + %s" % (temp) + else: + extra_offset = temp + + return + + + def pixel_emit_args(self, f, pc, large): + """Emit the arguments for a pixel function. This differs from + common_emit_args in that pixel functions may require padding + be inserted (i.e., for the missing width field for + TexImage1D), and they may also require a 'NULL image' flag + be inserted before the image data.""" + + if large: + adjust = 8 + else: + adjust = 4 + + for param in f.parameterIterateGlxSend(): + if not param.is_image(): + self.common_emit_one_arg(param, pc, adjust, None) + + if f.pad_after(param): + print '(void) memcpy((void *)(%s + %u), zero, 4);' % (pc, (param.offset + param.size()) + adjust) + + else: + [dim, width, height, depth, extent] = param.get_dimensions() + if f.glx_rop == ~0: + dim_str = "dim" + else: + dim_str = str(dim) + + if param.is_padding: + print '(void) memset((void *)(%s + %u), 0, %s);' \ + % (pc, (param.offset - 4) + adjust, param.size_string() ) + + if param.img_null_flag: + if large: + print '(void) memcpy((void *)(%s + %u), zero, 4);' % (pc, (param.offset - 4) + adjust) + else: + print '(void) memcpy((void *)(%s + %u), (void *)((%s == NULL) ? one : zero), 4);' % (pc, (param.offset - 4) + adjust, param.name) + + + pixHeaderPtr = "%s + %u" % (pc, adjust) + pcPtr = "%s + %u" % (pc, param.offset + adjust) + + if not large: + if param.img_send_null: + condition = '(compsize > 0) && (%s != NULL)' % (param.name) + else: + condition = 'compsize > 0' + + print 'if (%s) {' % (condition) + print ' (*gc->fillImage)(gc, %s, %s, %s, %s, %s, %s, %s, %s, %s);' % (dim_str, width, height, depth, param.img_format, param.img_type, param.name, pcPtr, pixHeaderPtr) + print '} else {' + print ' (void) memcpy( %s, default_pixel_store_%uD, default_pixel_store_%uD_size );' % (pixHeaderPtr, dim, dim) + print '}' + else: + print '__glXSendLargeImage(gc, compsize, %s, %s, %s, %s, %s, %s, %s, %s, %s);' % (dim_str, width, height, depth, param.img_format, param.img_type, param.name, pcPtr, pixHeaderPtr) + + return + + + def large_emit_begin(self, f, op_name = None): + if not op_name: + op_name = f.opcode_real_name() + + print 'const GLint op = %s;' % (op_name) + print 'const GLuint cmdlenLarge = cmdlen + 4;' + print 'GLubyte * const pc = __glXFlushRenderBuffer(gc, gc->pc);' + print '(void) memcpy((void *)(pc + 0), (void *)(&cmdlenLarge), 4);' + print '(void) memcpy((void *)(pc + 4), (void *)(&op), 4);' + return + + + def common_func_print_just_start(self, f, name): + print ' __GLXcontext * const gc = __glXGetCurrentContext();' + + # The only reason that single and vendor private commands need + # a variable called 'dpy' is becuase they use the SyncHandle + # macro. For whatever brain-dead reason, that macro is hard- + # coded to use a variable called 'dpy' instead of taking a + # parameter. + + # FIXME Simplify the logic related to skip_condition and + # FIXME condition_list in this function. Basically, remove + # FIXME skip_condition, and just append the "dpy != NULL" type + # FIXME condition to condition_list from the start. The only + # FIXME reason it's done in this confusing way now is to + # FIXME minimize the diffs in the generated code. + + if not f.glx_rop: + for p in f.parameterIterateOutputs(): + if p.is_image() and (p.img_format != "GL_COLOR_INDEX" or p.img_type != "GL_BITMAP"): + print ' const __GLXattribute * const state = gc->client_state_private;' + break + + print ' Display * const dpy = gc->currentDpy;' + skip_condition = "dpy != NULL" + elif f.can_be_large: + skip_condition = "gc->currentDpy != NULL" + else: + skip_condition = None + + + if f.return_type != 'void': + print ' %s retval = (%s) 0;' % (f.return_type, f.return_type) + + + if name != None and name not in f.glx_vendorpriv_names: + print '#ifndef USE_XCB' + self.emit_packet_size_calculation(f, 0) + if name != None and name not in f.glx_vendorpriv_names: + print '#endif' + + condition_list = [] + for p in f.parameterIterateCounters(): + condition_list.append( "%s >= 0" % (p.name) ) + # 'counter' parameters cannot be negative + print " if (%s < 0) {" % p.name + print " __glXSetError(gc, GL_INVALID_VALUE);" + if f.return_type != 'void': + print " return 0;" + else: + print " return;" + print " }" + + if skip_condition: + condition_list.append( skip_condition ) + + if len( condition_list ) > 0: + if len( condition_list ) > 1: + skip_condition = "(%s)" % (string.join( condition_list, ") && (" )) + else: + skip_condition = "%s" % (condition_list.pop(0)) + + print ' if (__builtin_expect(%s, 1)) {' % (skip_condition) + return 1 + else: + return 0 + + + def printSingleFunction(self, f, name): + self.common_func_print_just_start(f, name) + + if self.debug: + print ' printf( "Enter %%s...\\n", "gl%s" );' % (f.name) + + if name not in f.glx_vendorpriv_names: + + # XCB specific: + print '#ifdef USE_XCB' + if self.debug: + print ' printf("\\tUsing XCB.\\n");' + print ' xcb_connection_t *c = XGetXCBConnection(dpy);' + print ' (void) __glXFlushRenderBuffer(gc, gc->pc);' + xcb_name = 'xcb_glx%s' % convertStringForXCB(name) + + iparams=[] + extra_iparams = [] + output = None + for p in f.parameterIterator(): + if p.is_output: + output = p + + if p.is_image(): + if p.img_format != "GL_COLOR_INDEX" or p.img_type != "GL_BITMAP": + extra_iparams.append("state->storePack.swapEndian") + else: + extra_iparams.append("0") + + # Hardcode this in. lsb_first param (apparently always GL_FALSE) + # also present in GetPolygonStipple, but taken care of above. + if xcb_name == "xcb_glx_read_pixels": + extra_iparams.append("0") + else: + iparams.append(p.name) + + + xcb_request = '%s(%s)' % (xcb_name, ", ".join(["c", "gc->currentContextTag"] + iparams + extra_iparams)) + + if f.needs_reply(): + print ' %s_reply_t *reply = %s_reply(c, %s, NULL);' % (xcb_name, xcb_name, xcb_request) + if output and f.reply_always_array: + print ' (void)memcpy(%s, %s_data(reply), %s_data_length(reply) * sizeof(%s));' % (output.name, xcb_name, xcb_name, output.get_base_type_string()) + + elif output and not f.reply_always_array: + if not output.is_image(): + print ' if (%s_data_length(reply) == 0)' % (xcb_name) + print ' (void)memcpy(%s, &reply->datum, sizeof(reply->datum));' % (output.name) + print ' else' + print ' (void)memcpy(%s, %s_data(reply), %s_data_length(reply) * sizeof(%s));' % (output.name, xcb_name, xcb_name, output.get_base_type_string()) + + + if f.return_type != 'void': + print ' retval = reply->ret_val;' + print ' free(reply);' + else: + print ' ' + xcb_request + ';' + print '#else' + # End of XCB specific. + + + if f.parameters != []: + pc_decl = "GLubyte const * pc =" + else: + pc_decl = "(void)" + + if name in f.glx_vendorpriv_names: + print ' %s __glXSetupVendorRequest(gc, %s, %s, cmdlen);' % (pc_decl, f.opcode_real_name(), f.opcode_vendor_name(name)) + else: + print ' %s __glXSetupSingleRequest(gc, %s, cmdlen);' % (pc_decl, f.opcode_name()) + + self.common_emit_args(f, "pc", 0, 0) + + images = f.get_images() + + for img in images: + if img.is_output: + o = f.command_fixed_length() - 4 + print ' *(int32_t *)(pc + %u) = 0;' % (o) + if img.img_format != "GL_COLOR_INDEX" or img.img_type != "GL_BITMAP": + print ' * (int8_t *)(pc + %u) = state->storePack.swapEndian;' % (o) + + if f.img_reset: + print ' * (int8_t *)(pc + %u) = %s;' % (o + 1, f.img_reset) + + + return_name = '' + if f.needs_reply(): + if f.return_type != 'void': + return_name = " retval" + return_str = " retval = (%s)" % (f.return_type) + else: + return_str = " (void)" + + got_reply = 0 + + for p in f.parameterIterateOutputs(): + if p.is_image(): + [dim, w, h, d, junk] = p.get_dimensions() + if f.dimensions_in_reply: + print " __glXReadPixelReply(dpy, gc, %u, 0, 0, 0, %s, %s, %s, GL_TRUE);" % (dim, p.img_format, p.img_type, p.name) + else: + print " __glXReadPixelReply(dpy, gc, %u, %s, %s, %s, %s, %s, %s, GL_FALSE);" % (dim, w, h, d, p.img_format, p.img_type, p.name) + + got_reply = 1 + else: + if f.reply_always_array: + aa = "GL_TRUE" + else: + aa = "GL_FALSE" + + # gl_parameter.size() returns the size + # of the entire data item. If the + # item is a fixed-size array, this is + # the size of the whole array. This + # is not what __glXReadReply wants. It + # wants the size of a single data + # element in the reply packet. + # Dividing by the array size (1 for + # non-arrays) gives us this. + + s = p.size() / p.get_element_count() + print " %s __glXReadReply(dpy, %s, %s, %s);" % (return_str, s, p.name, aa) + got_reply = 1 + + + # If a reply wasn't read to fill an output parameter, + # read a NULL reply to get the return value. + + if not got_reply: + print " %s __glXReadReply(dpy, 0, NULL, GL_FALSE);" % (return_str) + + + elif self.debug: + # Only emit the extra glFinish call for functions + # that don't already require a reply from the server. + print ' __indirect_glFinish();' + + if self.debug: + print ' printf( "Exit %%s.\\n", "gl%s" );' % (name) + + + print ' UnlockDisplay(dpy); SyncHandle();' + + if name not in f.glx_vendorpriv_names: + print '#endif /* USE_XCB */' + + print ' }' + print ' return%s;' % (return_name) + return + + + def printPixelFunction(self, f): + if self.pixel_stubs.has_key( f.name ): + # Normally gl_function::get_parameter_string could be + # used. However, this call needs to have the missing + # dimensions (e.g., a fake height value for + # glTexImage1D) added in. + + p_string = "" + for param in f.parameterIterateGlxSend(): + if param.is_padding: + continue + + p_string += ", " + param.name + + if param.is_image(): + [dim, junk, junk, junk, junk] = param.get_dimensions() + + if f.pad_after(param): + p_string += ", 1" + + print ' %s(%s, %u%s );' % (self.pixel_stubs[f.name] , f.opcode_name(), dim, p_string) + return + + + if self.common_func_print_just_start(f, None): + trailer = " }" + else: + trailer = None + + + if f.can_be_large: + print 'if (cmdlen <= gc->maxSmallRenderCommandSize) {' + print ' if ( (gc->pc + cmdlen) > gc->bufEnd ) {' + print ' (void) __glXFlushRenderBuffer(gc, gc->pc);' + print ' }' + + if f.glx_rop == ~0: + opcode = "opcode" + else: + opcode = f.opcode_real_name() + + print 'emit_header(gc->pc, %s, cmdlen);' % (opcode) + + self.pixel_emit_args( f, "gc->pc", 0 ) + print 'gc->pc += cmdlen;' + print 'if (gc->pc > gc->limit) { (void) __glXFlushRenderBuffer(gc, gc->pc); }' + + if f.can_be_large: + print '}' + print 'else {' + + self.large_emit_begin(f, opcode) + self.pixel_emit_args(f, "pc", 1) + + print '}' + + if trailer: print trailer + return + + + def printRenderFunction(self, f): + # There is a class of GL functions that take a single pointer + # as a parameter. This pointer points to a fixed-size chunk + # of data, and the protocol for this functions is very + # regular. Since they are so regular and there are so many + # of them, special case them with generic functions. On + # x86, this saves about 26KB in the libGL.so binary. + + if f.variable_length_parameter() == None and len(f.parameters) == 1: + p = f.parameters[0] + if p.is_pointer(): + cmdlen = f.command_fixed_length() + if cmdlen in self.generic_sizes: + print ' generic_%u_byte( %s, %s );' % (cmdlen, f.opcode_real_name(), p.name) + return + + if self.common_func_print_just_start(f, None): + trailer = " }" + else: + trailer = None + + if self.debug: + print 'printf( "Enter %%s...\\n", "gl%s" );' % (f.name) + + if f.can_be_large: + print 'if (cmdlen <= gc->maxSmallRenderCommandSize) {' + print ' if ( (gc->pc + cmdlen) > gc->bufEnd ) {' + print ' (void) __glXFlushRenderBuffer(gc, gc->pc);' + print ' }' + + print 'emit_header(gc->pc, %s, cmdlen);' % (f.opcode_real_name()) + + self.common_emit_args(f, "gc->pc", 4, 0) + print 'gc->pc += cmdlen;' + print 'if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }' + + if f.can_be_large: + print '}' + print 'else {' + + self.large_emit_begin(f) + self.common_emit_args(f, "pc", 8, 1) + + p = f.variable_length_parameter() + print ' __glXSendLargeCommand(gc, pc, %u, %s, %s);' % (p.offset + 8, p.name, p.size_string()) + print '}' + + if self.debug: + print '__indirect_glFinish();' + print 'printf( "Exit %%s.\\n", "gl%s" );' % (f.name) + + if trailer: print trailer + return + + +class PrintGlxProtoInit_c(gl_XML.gl_print_base): + def __init__(self): + gl_XML.gl_print_base.__init__(self) + + self.name = "glX_proto_send.py (from Mesa)" + self.license = license.bsd_license_template % ( \ +"""Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. +(C) Copyright IBM Corporation 2004""", "PRECISION INSIGHT, IBM") + return + + + def printRealHeader(self): + print """/** + * \\file indirect_init.c + * Initialize indirect rendering dispatch table. + * + * \\author Kevin E. Martin + * \\author Brian Paul + * \\author Ian Romanick + */ + +#include "indirect_init.h" +#include "indirect.h" +#include "glapi.h" + + +/** + * No-op function used to initialize functions that have no GLX protocol + * support. + */ +static int NoOp(void) +{ + return 0; +} + +/** + * Create and initialize a new GL dispatch table. The table is initialized + * with GLX indirect rendering protocol functions. + */ +__GLapi * __glXNewIndirectAPI( void ) +{ + __GLapi *glAPI; + GLuint entries; + + entries = _glapi_get_dispatch_table_size(); + glAPI = (__GLapi *) Xmalloc(entries * sizeof(void *)); + + /* first, set all entries to point to no-op functions */ + { + int i; + void **dispatch = (void **) glAPI; + for (i = 0; i < entries; i++) { + dispatch[i] = (void *) NoOp; + } + } + + /* now, initialize the entries we understand */""" + + def printRealFooter(self): + print """ + return glAPI; +} +""" + return + + + def printBody(self, api): + for [name, number] in api.categoryIterate(): + if number != None: + preamble = '\n /* %3u. %s */\n\n' % (int(number), name) + else: + preamble = '\n /* %s */\n\n' % (name) + + for func in api.functionIterateByCategory(name): + if func.client_supported_for_indirect(): + print '%s glAPI->%s = __indirect_gl%s;' % (preamble, func.name, func.name) + preamble = '' + + return + + +class PrintGlxProtoInit_h(gl_XML.gl_print_base): + def __init__(self): + gl_XML.gl_print_base.__init__(self) + + self.name = "glX_proto_send.py (from Mesa)" + self.license = license.bsd_license_template % ( \ +"""Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. +(C) Copyright IBM Corporation 2004""", "PRECISION INSIGHT, IBM") + self.header_tag = "_INDIRECT_H_" + + self.last_category = "" + return + + + def printRealHeader(self): + print """/** + * \\file + * Prototypes for indirect rendering functions. + * + * \\author Kevin E. Martin + * \\author Ian Romanick + */ +""" + self.printVisibility( "HIDDEN", "hidden" ) + self.printFastcall() + self.printNoinline() + + print """ +#include "glxclient.h" + +extern HIDDEN NOINLINE CARD32 __glXReadReply( Display *dpy, size_t size, + void * dest, GLboolean reply_is_always_array ); + +extern HIDDEN NOINLINE void __glXReadPixelReply( Display *dpy, + __GLXcontext * gc, unsigned max_dim, GLint width, GLint height, + GLint depth, GLenum format, GLenum type, void * dest, + GLboolean dimensions_in_reply ); + +extern HIDDEN NOINLINE FASTCALL GLubyte * __glXSetupSingleRequest( + __GLXcontext * gc, GLint sop, GLint cmdlen ); + +extern HIDDEN NOINLINE FASTCALL GLubyte * __glXSetupVendorRequest( + __GLXcontext * gc, GLint code, GLint vop, GLint cmdlen ); +""" + + + def printBody(self, api): + for func in api.functionIterateGlx(): + params = func.get_parameter_string() + + print 'extern HIDDEN %s __indirect_gl%s(%s);' % (func.return_type, func.name, params) + + for n in func.entry_points: + if func.has_different_protocol(n): + asdf = func.static_glx_name(n) + if asdf not in func.static_entry_points: + print 'extern HIDDEN %s gl%s(%s);' % (func.return_type, asdf, params) + else: + print 'GLAPI %s GLAPIENTRY gl%s(%s);' % (func.return_type, asdf, params) + + break + + + +def show_usage(): + print "Usage: %s [-f input_file_name] [-m output_mode] [-d]" % sys.argv[0] + print " -m output_mode Output mode can be one of 'proto', 'init_c' or 'init_h'." + print " -d Enable extra debug information in the generated code." + sys.exit(1) + + +if __name__ == '__main__': + file_name = "gl_API.xml" + + try: + (args, trail) = getopt.getopt(sys.argv[1:], "f:m:d") + except Exception,e: + show_usage() + + debug = 0 + mode = "proto" + for (arg,val) in args: + if arg == "-f": + file_name = val + elif arg == "-m": + mode = val + elif arg == "-d": + debug = 1 + + if mode == "proto": + printer = PrintGlxProtoStubs() + elif mode == "init_c": + printer = PrintGlxProtoInit_c() + elif mode == "init_h": + printer = PrintGlxProtoInit_h() + else: + show_usage() + + + printer.debug = debug + api = gl_XML.parse_GL_API( file_name, glX_XML.glx_item_factory() ) + + printer.Print( api ) --- mesa-glw-7.4.orig/src/mesa/glapi/gl_x86-64_asm.py +++ mesa-glw-7.4/src/mesa/glapi/gl_x86-64_asm.py @@ -0,0 +1,334 @@ +#!/usr/bin/env python + +# (C) Copyright IBM Corporation 2005 +# All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# on the rights to use, copy, modify, merge, publish, distribute, sub +# license, and/or sell copies of the Software, and to permit persons to whom +# the Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the next +# paragraph) shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL +# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# Authors: +# Ian Romanick + +import license +import gl_XML, glX_XML +import sys, getopt, copy + +def should_use_push(registers): + for [reg, offset] in registers: + if reg[1:4] == "xmm": + return 0 + + N = len(registers) + return (N & 1) != 0 + + +def local_size(registers): + # The x86-64 ABI says "the value (%rsp - 8) is always a multiple of + # 16 when control is transfered to the function entry point." This + # means that the local stack usage must be (16*N)+8 for some value + # of N. (16*N)+8 = (8*(2N))+8 = 8*(2N+1). As long as N is odd, we + # meet this requirement. + + N = (len(registers) | 1) + return 8*N + + +def save_all_regs(registers): + adjust_stack = 0 + if not should_use_push(registers): + adjust_stack = local_size(registers) + print '\tsubq\t$%u, %%rsp' % (adjust_stack) + + for [reg, stack_offset] in registers: + save_reg( reg, stack_offset, adjust_stack ) + return + + +def restore_all_regs(registers): + adjust_stack = 0 + if not should_use_push(registers): + adjust_stack = local_size(registers) + + temp = copy.deepcopy(registers) + while len(temp): + [reg, stack_offset] = temp.pop() + restore_reg(reg, stack_offset, adjust_stack) + + if adjust_stack: + print '\taddq\t$%u, %%rsp' % (adjust_stack) + return + + +def save_reg(reg, offset, use_move): + if use_move: + if offset == 0: + print '\tmovq\t%s, (%%rsp)' % (reg) + else: + print '\tmovq\t%s, %u(%%rsp)' % (reg, offset) + else: + print '\tpushq\t%s' % (reg) + + return + + +def restore_reg(reg, offset, use_move): + if use_move: + if offset == 0: + print '\tmovq\t(%%rsp), %s' % (reg) + else: + print '\tmovq\t%u(%%rsp), %s' % (offset, reg) + else: + print '\tpopq\t%s' % (reg) + + return + + +class PrintGenericStubs(gl_XML.gl_print_base): + + def __init__(self): + gl_XML.gl_print_base.__init__(self) + + self.name = "gl_x86-64_asm.py (from Mesa)" + self.license = license.bsd_license_template % ("(C) Copyright IBM Corporation 2005", "IBM") + return + + + def get_stack_size(self, f): + size = 0 + for p in f.parameterIterator(): + size += p.get_stack_size() + + return size + + + def printRealHeader(self): + print "/* If we build with gcc's -fvisibility=hidden flag, we'll need to change" + print " * the symbol visibility mode to 'default'." + print ' */' + print '' + print '#include "../x86/assyntax.h"' + print '' + print '#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303' + print '# pragma GCC visibility push(default)' + print '# define HIDDEN(x) .hidden x' + print '#else' + print '# define HIDDEN(x)' + print '#endif' + print '' + print '# if defined(USE_MGL_NAMESPACE)' + print '# define GL_PREFIX(n) GLNAME(CONCAT(mgl,n))' + print '# define _glapi_Dispatch _mglapi_Dispatch' + print '# else' + print '# define GL_PREFIX(n) GLNAME(CONCAT(gl,n))' + print '# endif' + print '' + print '#if defined(PTHREADS) || defined(USE_XTHREADS) || defined(SOLARIS_THREADS) || defined(WIN32_THREADS) || defined(BEOS_THREADS)' + print '# define THREADS' + print '#endif' + print '' + print '\t.text' + print '' + print '#ifdef GLX_USE_TLS' + print '' + print '\t.globl _x86_64_get_get_dispatch; HIDDEN(_x86_64_get_get_dispatch)' + print '_x86_64_get_get_dispatch:' + print '\tlea\t_x86_64_get_dispatch(%rip), %rax' + print '\tret' + print '' + print '\t.p2align\t4,,15' + print '_x86_64_get_dispatch:' + print '\tmovq\t_glapi_tls_Dispatch@GOTTPOFF(%rip), %rax' + print '\tmovq\t%fs:(%rax), %rax' + print '\tret' + print '\t.size\t_x86_64_get_dispatch, .-_x86_64_get_dispatch' + print '' + print '#elif defined(PTHREADS)' + print '' + print '\t.extern\t_glapi_Dispatch' + print '\t.extern\t_gl_DispatchTSD' + print '\t.extern\tpthread_getspecific' + print '' + print '\t.p2align\t4,,15' + print '_x86_64_get_dispatch:' + print '\tmovq\t_gl_DispatchTSD(%rip), %rdi' + print '\tjmp\tpthread_getspecific@PLT' + print '' + print '#elif defined(THREADS)' + print '' + print '\t.extern\t_glapi_get_dispatch' + print '' + print '#endif' + print '' + return + + + def printRealFooter(self): + print '' + print '#if defined(GLX_USE_TLS) && defined(__linux__)' + print ' .section ".note.ABI-tag", "a"' + print ' .p2align 2' + print ' .long 1f - 0f /* name length */' + print ' .long 3f - 2f /* data length */' + print ' .long 1 /* note length */' + print '0: .asciz "GNU" /* vendor name */' + print '1: .p2align 2' + print '2: .long 0 /* note data: the ABI tag */' + print ' .long 2,4,20 /* Minimum kernel version w/TLS */' + print '3: .p2align 2 /* pad out section */' + print '#endif /* GLX_USE_TLS */' + print '' + print '#if defined (__ELF__) && defined (__linux__)' + print ' .section .note.GNU-stack,"",%progbits' + print '#endif' + return + + + def printFunction(self, f): + + # The x86-64 ABI divides function parameters into a couple + # classes. For the OpenGL interface, the only ones that are + # relevent are INTEGER and SSE. Basically, the first 8 + # GLfloat or GLdouble parameters are placed in %xmm0 - %xmm7, + # the first 6 non-GLfloat / non-GLdouble parameters are placed + # in registers listed in int_parameters. + # + # If more parameters than that are required, they are passed + # on the stack. Therefore, we just have to make sure that + # %esp hasn't changed when we jump to the actual function. + # Since we're jumping to the function (and not calling it), we + # have to make sure of that anyway! + + int_parameters = ["%rdi", "%rsi", "%rdx", "%rcx", "%r8", "%r9"] + + int_class = 0 + sse_class = 0 + stack_offset = 0 + registers = [] + for p in f.parameterIterator(): + type_name = p.get_base_type_string() + + if p.is_pointer() or (type_name != "GLfloat" and type_name != "GLdouble"): + if int_class < 6: + registers.append( [int_parameters[int_class], stack_offset] ) + int_class += 1 + stack_offset += 8 + else: + if sse_class < 8: + registers.append( ["%%xmm%u" % (sse_class), stack_offset] ) + sse_class += 1 + stack_offset += 8 + + if ((int_class & 1) == 0) and (sse_class == 0): + registers.append( ["%rbp", 0] ) + + + name = f.dispatch_name() + + print '\t.p2align\t4,,15' + print '\t.globl\tGL_PREFIX(%s)' % (name) + print '\t.type\tGL_PREFIX(%s), @function' % (name) + if not f.is_static_entry_point(f.name): + print '\tHIDDEN(GL_PREFIX(%s))' % (name) + print 'GL_PREFIX(%s):' % (name) + print '#if defined(GLX_USE_TLS)' + print '\tcall\t_x86_64_get_dispatch@PLT' + print '\tmovq\t%u(%%rax), %%r11' % (f.offset * 8) + print '\tjmp\t*%r11' + print '#elif defined(PTHREADS)' + + save_all_regs(registers) + print '\tcall\t_x86_64_get_dispatch@PLT' + restore_all_regs(registers) + + if f.offset == 0: + print '\tmovq\t(%rax), %r11' + else: + print '\tmovq\t%u(%%rax), %%r11' % (f.offset * 8) + + print '\tjmp\t*%r11' + + print '#else' + print '\tmovq\t_glapi_Dispatch(%rip), %rax' + print '\ttestq\t%rax, %rax' + print '\tje\t1f' + print '\tmovq\t%u(%%rax), %%r11' % (f.offset * 8) + print '\tjmp\t*%r11' + print '1:' + + save_all_regs(registers) + print '\tcall\t_glapi_get_dispatch' + restore_all_regs(registers) + + print '\tmovq\t%u(%%rax), %%r11' % (f.offset * 8) + print '\tjmp\t*%r11' + print '#endif /* defined(GLX_USE_TLS) */' + + print '\t.size\tGL_PREFIX(%s), .-GL_PREFIX(%s)' % (name, name) + print '' + return + + + def printBody(self, api): + for f in api.functionIterateByOffset(): + self.printFunction(f) + + + for f in api.functionIterateByOffset(): + dispatch = f.dispatch_name() + for n in f.entry_points: + if n != f.name: + if f.is_static_entry_point(n): + text = '\t.globl GL_PREFIX(%s) ; .set GL_PREFIX(%s), GL_PREFIX(%s)' % (n, n, dispatch) + + if f.has_different_protocol(n): + print '#ifndef GLX_INDIRECT_RENDERING' + print text + print '#endif' + else: + print text + + return + +def show_usage(): + print "Usage: %s [-f input_file_name] [-m output_mode]" % sys.argv[0] + sys.exit(1) + +if __name__ == '__main__': + file_name = "gl_API.xml" + mode = "generic" + + try: + (args, trail) = getopt.getopt(sys.argv[1:], "m:f:") + except Exception,e: + show_usage() + + for (arg,val) in args: + if arg == '-m': + mode = val + elif arg == "-f": + file_name = val + + if mode == "generic": + printer = PrintGenericStubs() + else: + print "ERROR: Invalid mode \"%s\" specified." % mode + show_usage() + + api = gl_XML.parse_GL_API(file_name, glX_XML.glx_item_factory()) + printer.Print(api) --- mesa-glw-7.4.orig/src/mesa/glapi/typeexpr.py +++ mesa-glw-7.4/src/mesa/glapi/typeexpr.py @@ -0,0 +1,292 @@ +#!/usr/bin/env python + +# (C) Copyright IBM Corporation 2005 +# All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# on the rights to use, copy, modify, merge, publish, distribute, sub +# license, and/or sell copies of the Software, and to permit persons to whom +# the Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the next +# paragraph) shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL +# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# Authors: +# Ian Romanick + +import string, copy + +class type_node: + def __init__(self): + self.pointer = 0 # bool + self.const = 0 # bool + self.signed = 1 # bool + self.integer = 1 # bool + + # If elements is set to non-zero, then field is an array. + self.elements = 0 + + self.name = None + self.size = 0 # type's size in bytes + return + + + def string(self): + """Return string representation of this type_node.""" + s = "" + + if self.pointer: + s = "* " + + if self.const: + s += "const " + + if not self.pointer: + if self.integer: + if self.signed: + s += "signed " + else: + s += "unsigned " + + if self.name: + s += "%s " % (self.name) + + return s + + +class type_table: + def __init__(self): + self.types_by_name = {} + return + + + def add_type(self, type_expr): + self.types_by_name[ type_expr.get_base_name() ] = type_expr + return + + + def find_type(self, name): + if name in self.types_by_name: + return self.types_by_name[ name ] + else: + return None + + +def create_initial_types(): + tt = type_table() + + basic_types = [ + ("char", 1, 1), + ("short", 2, 1), + ("int", 4, 1), + ("long", 4, 1), + ("float", 4, 0), + ("double", 8, 0), + ("enum", 4, 1) + ] + + for (type_name, type_size, integer) in basic_types: + te = type_expression(None) + tn = type_node() + tn.name = type_name + tn.size = type_size + tn.integer = integer + te.expr.append(tn) + tt.add_type( te ) + + type_expression.built_in_types = tt + return + + +class type_expression: + built_in_types = None + + def __init__(self, type_string, extra_types = None): + self.expr = [] + + if not type_string: + return + + self.original_string = type_string + + if not type_expression.built_in_types: + raise RuntimeError("create_initial_types must be called before creating type_expression objects.") + + # Replace '*' with ' * ' in type_string. Then, split the string + # into tokens, separated by spaces. + tokens = string.split( string.replace( type_string, "*", " * " ) ) + + const = 0 + t = None + signed = 0 + unsigned = 0 + + for i in tokens: + if i == "const": + if t and t.pointer: + t.const = 1 + else: + const = 1 + elif i == "signed": + signed = 1 + elif i == "unsigned": + unsigned = 1 + elif i == "*": + # This is a quirky special-case because of the + # way the C works for types. If 'unsigned' is + # specified all by itself, it is treated the + # same as "unsigned int". + + if unsigned: + self.set_base_type( "int", signed, unsigned, const, extra_types ) + const = 0 + signed = 0 + unsigned = 0 + + if not self.expr: + raise RuntimeError("Invalid type expression (dangling pointer)") + + if signed: + raise RuntimeError("Invalid type expression (signed / unsigned applied to pointer)") + + t = type_node() + t.pointer = 1 + self.expr.append( t ) + else: + if self.expr: + raise RuntimeError('Invalid type expression (garbage after pointer qualifier -> "%s")' % (self.original_string)) + + self.set_base_type( i, signed, unsigned, const, extra_types ) + const = 0 + signed = 0 + unsigned = 0 + + if signed and unsigned: + raise RuntimeError("Invalid type expression (both signed and unsigned specified)") + + + if const: + raise RuntimeError("Invalid type expression (dangling const)") + + if unsigned: + raise RuntimeError("Invalid type expression (dangling signed)") + + if signed: + raise RuntimeError("Invalid type expression (dangling unsigned)") + + return + + + def set_base_type(self, type_name, signed, unsigned, const, extra_types): + te = type_expression.built_in_types.find_type( type_name ) + if not te: + te = extra_types.find_type( type_name ) + + if not te: + raise RuntimeError('Unknown base type "%s".' % (type_name)) + + self.expr = copy.deepcopy(te.expr) + + t = self.expr[ len(self.expr) - 1 ] + t.const = const + if signed: + t.signed = 1 + elif unsigned: + t.signed = 0 + + + def set_base_type_node(self, tn): + self.expr = [tn] + return + + + def set_elements(self, count): + tn = self.expr[0] + + tn.elements = count + return + + + def string(self): + s = "" + for t in self.expr: + s += t.string() + + return s + + + def get_base_type_node(self): + return self.expr[0] + + + def get_base_name(self): + if len(self.expr): + return self.expr[0].name + else: + return None + + + def get_element_size(self): + tn = self.expr[0] + + if tn.elements: + return tn.elements * tn.size + else: + return tn.size + + + def get_element_count(self): + tn = self.expr[0] + return tn.elements + + + def get_stack_size(self): + tn = self.expr[ len(self.expr) - 1 ] + + if tn.elements or tn.pointer: + return 4 + elif not tn.integer: + return tn.size + else: + return 4 + + + def is_pointer(self): + tn = self.expr[ len(self.expr) - 1 ] + return tn.pointer + + + def format_string(self): + tn = self.expr[ len(self.expr) - 1 ] + if tn.pointer: + return "%p" + elif not tn.integer: + return "%f" + else: + return "%d" + + + +if __name__ == '__main__': + + types_to_try = [ "int", "int *", "const int *", "int * const", "const int * const", \ + "unsigned * const *", \ + "float", "const double", "double * const"] + + create_initial_types() + + for t in types_to_try: + print 'Trying "%s"...' % (t) + te = type_expression( t ) + print 'Got "%s" (%u, %u).' % (te.string(), te.get_stack_size(), te.get_element_size()) --- mesa-glw-7.4.orig/src/mesa/glapi/glX_XML.py +++ mesa-glw-7.4/src/mesa/glapi/glX_XML.py @@ -0,0 +1,570 @@ +#!/usr/bin/env python + +# (C) Copyright IBM Corporation 2004, 2005 +# All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# on the rights to use, copy, modify, merge, publish, distribute, sub +# license, and/or sell copies of the Software, and to permit persons to whom +# the Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the next +# paragraph) shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL +# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# Authors: +# Ian Romanick + +import gl_XML +import license +import sys, getopt, string + + +class glx_item_factory(gl_XML.gl_item_factory): + """Factory to create GLX protocol oriented objects derived from gl_item.""" + + def create_item(self, name, element, context): + if name == "function": + return glx_function(element, context) + elif name == "enum": + return glx_enum(element, context) + elif name == "api": + return glx_api(self) + else: + return gl_XML.gl_item_factory.create_item(self, name, element, context) + + +class glx_enum(gl_XML.gl_enum): + def __init__(self, element, context): + gl_XML.gl_enum.__init__(self, element, context) + + self.functions = {} + + child = element.children + while child: + if child.type == "element" and child.name == "size": + n = child.nsProp( "name", None ) + c = child.nsProp( "count", None ) + m = child.nsProp( "mode", None ) + + if not c: + c = self.default_count + else: + c = int(c) + + if m == "get": + mode = 0 + else: + mode = 1 + + if not self.functions.has_key(n): + self.functions[ n ] = [c, mode] + + child = child.next + + return + + +class glx_function(gl_XML.gl_function): + def __init__(self, element, context): + self.glx_rop = 0 + self.glx_sop = 0 + self.glx_vendorpriv = 0 + + self.glx_vendorpriv_names = [] + + # If this is set to true, it means that GLdouble parameters should be + # written to the GLX protocol packet in the order they appear in the + # prototype. This is different from the "classic" ordering. In the + # classic ordering GLdoubles are written to the protocol packet first, + # followed by non-doubles. NV_vertex_program was the first extension + # to break with this tradition. + + self.glx_doubles_in_order = 0 + + self.vectorequiv = None + self.output = None + self.can_be_large = 0 + self.reply_always_array = 0 + self.dimensions_in_reply = 0 + self.img_reset = None + + self.server_handcode = 0 + self.client_handcode = 0 + self.ignore = 0 + + self.count_parameter_list = [] + self.counter_list = [] + self.parameters_by_name = {} + self.offsets_calculated = 0 + + gl_XML.gl_function.__init__(self, element, context) + return + + + def process_element(self, element): + gl_XML.gl_function.process_element(self, element) + + # If the function already has a vector equivalent set, don't + # set it again. This can happen if an alias to a function + # appears after the function that it aliases. + + if not self.vectorequiv: + self.vectorequiv = element.nsProp("vectorequiv", None) + + + name = element.nsProp("name", None) + if name == self.name: + for param in self.parameters: + self.parameters_by_name[ param.name ] = param + + if len(param.count_parameter_list): + self.count_parameter_list.extend( param.count_parameter_list ) + + if param.counter and param.counter not in self.counter_list: + self.counter_list.append(param.counter) + + + child = element.children + while child: + if child.type == "element" and child.name == "glx": + rop = child.nsProp( 'rop', None ) + sop = child.nsProp( 'sop', None ) + vop = child.nsProp( 'vendorpriv', None ) + + if rop: + self.glx_rop = int(rop) + + if sop: + self.glx_sop = int(sop) + + if vop: + self.glx_vendorpriv = int(vop) + self.glx_vendorpriv_names.append(name) + + self.img_reset = child.nsProp( 'img_reset', None ) + + # The 'handcode' attribute can be one of 'true', + # 'false', 'client', or 'server'. + + handcode = child.nsProp( 'handcode', None ) + if handcode == "false": + self.server_handcode = 0 + self.client_handcode = 0 + elif handcode == "true": + self.server_handcode = 1 + self.client_handcode = 1 + elif handcode == "client": + self.server_handcode = 0 + self.client_handcode = 1 + elif handcode == "server": + self.server_handcode = 1 + self.client_handcode = 0 + else: + raise RuntimeError('Invalid handcode mode "%s" in function "%s".' % (handcode, self.name)) + + self.ignore = gl_XML.is_attr_true( child, 'ignore' ) + self.can_be_large = gl_XML.is_attr_true( child, 'large' ) + self.glx_doubles_in_order = gl_XML.is_attr_true( child, 'doubles_in_order' ) + self.reply_always_array = gl_XML.is_attr_true( child, 'always_array' ) + self.dimensions_in_reply = gl_XML.is_attr_true( child, 'dimensions_in_reply' ) + + child = child.next + + + # Do some validation of the GLX protocol information. As + # new tests are discovered, they should be added here. + + for param in self.parameters: + if param.is_output and self.glx_rop != 0: + raise RuntimeError("Render / RenderLarge commands cannot have outputs (%s)." % (self.name)) + + return + + + def has_variable_size_request(self): + """Determine if the GLX request packet is variable sized. + + The GLX request packet is variable sized in several common + situations. + + 1. The function has a non-output parameter that is counted + by another parameter (e.g., the 'textures' parameter of + glDeleteTextures). + + 2. The function has a non-output parameter whose count is + determined by another parameter that is an enum (e.g., the + 'params' parameter of glLightfv). + + 3. The function has a non-output parameter that is an + image. + + 4. The function must be hand-coded on the server. + """ + + if self.glx_rop == 0: + return 0 + + if self.server_handcode or self.images: + return 1 + + for param in self.parameters: + if not param.is_output: + if param.counter or len(param.count_parameter_list): + return 1 + + return 0 + + + def variable_length_parameter(self): + for param in self.parameters: + if not param.is_output: + if param.counter or len(param.count_parameter_list): + return param + + return None + + + def calculate_offsets(self): + if not self.offsets_calculated: + # Calculate the offset of the first function parameter + # in the GLX command packet. This byte offset is + # measured from the end of the Render / RenderLarge + # header. The offset for all non-pixel commends is + # zero. The offset for pixel commands depends on the + # number of dimensions of the pixel data. + + if len(self.images) and not self.images[0].is_output: + [dim, junk, junk, junk, junk] = self.images[0].get_dimensions() + + # The base size is the size of the pixel pack info + # header used by images with the specified number + # of dimensions. + + if dim <= 2: + offset = 20 + elif dim <= 4: + offset = 36 + else: + raise RuntimeError('Invalid number of dimensions %u for parameter "%s" in function "%s".' % (dim, self.image.name, self.name)) + else: + offset = 0 + + for param in self.parameterIterateGlxSend(): + if param.img_null_flag: + offset += 4 + + if param.name != self.img_reset: + param.offset = offset + if not param.is_variable_length() and not param.is_client_only: + offset += param.size() + + if self.pad_after( param ): + offset += 4 + + + self.offsets_calculated = 1 + return + + + def offset_of(self, param_name): + self.calculate_offsets() + return self.parameters_by_name[ param_name ].offset + + + def parameterIterateGlxSend(self, include_variable_parameters = 1): + """Create an iterator for parameters in GLX request order.""" + + # The parameter lists are usually quite short, so it's easier + # (i.e., less code) to just generate a new list with the + # required elements than it is to create a new iterator class. + + temp = [ [], [], [] ] + for param in self.parameters: + if param.is_output: continue + + if param.is_variable_length(): + temp[2].append( param ) + elif not self.glx_doubles_in_order and param.is_64_bit(): + temp[0].append( param ) + else: + temp[1].append( param ) + + parameters = temp[0] + parameters.extend( temp[1] ) + if include_variable_parameters: + parameters.extend( temp[2] ) + return parameters.__iter__() + + + def parameterIterateCounters(self): + temp = [] + for name in self.counter_list: + temp.append( self.parameters_by_name[ name ] ) + + return temp.__iter__() + + + def parameterIterateOutputs(self): + temp = [] + for p in self.parameters: + if p.is_output: + temp.append( p ) + + return temp + + + def command_fixed_length(self): + """Return the length, in bytes as an integer, of the + fixed-size portion of the command.""" + + if len(self.parameters) == 0: + return 0 + + self.calculate_offsets() + + size = 0 + for param in self.parameterIterateGlxSend(0): + if param.name != self.img_reset and not param.is_client_only: + if size == 0: + size = param.offset + param.size() + else: + size += param.size() + + if self.pad_after( param ): + size += 4 + + for param in self.images: + if param.img_null_flag or param.is_output: + size += 4 + + return size + + + def command_variable_length(self): + """Return the length, as a string, of the variable-sized + portion of the command.""" + + size_string = "" + for p in self.parameterIterateGlxSend(): + if (not p.is_output) and (p.is_variable_length() or p.is_image()): + # FIXME Replace the 1 in the size_string call + # FIXME w/0 to eliminate some un-needed parnes + # FIXME This would already be done, but it + # FIXME adds some extra diffs to the generated + # FIXME code. + + size_string = size_string + " + __GLX_PAD(%s)" % (p.size_string(1)) + + return size_string + + + def command_length(self): + size = self.command_fixed_length() + + if self.glx_rop != 0: + size += 4 + + size = ((size + 3) & ~3) + return "%u%s" % (size, self.command_variable_length()) + + + def opcode_real_value(self): + """Get the true numeric value of the GLX opcode + + Behaves similarly to opcode_value, except for + X_GLXVendorPrivate and X_GLXVendorPrivateWithReply commands. + In these cases the value for the GLX opcode field (i.e., + 16 for X_GLXVendorPrivate or 17 for + X_GLXVendorPrivateWithReply) is returned. For other 'single' + commands, the opcode for the command (e.g., 101 for + X_GLsop_NewList) is returned.""" + + if self.glx_vendorpriv != 0: + if self.needs_reply(): + return 17 + else: + return 16 + else: + return self.opcode_value() + + + def opcode_value(self): + """Get the unique protocol opcode for the glXFunction""" + + if (self.glx_rop == 0) and self.vectorequiv: + equiv = self.context.functions_by_name[ self.vectorequiv ] + self.glx_rop = equiv.glx_rop + + + if self.glx_rop != 0: + return self.glx_rop + elif self.glx_sop != 0: + return self.glx_sop + elif self.glx_vendorpriv != 0: + return self.glx_vendorpriv + else: + return -1 + + + def opcode_rop_basename(self): + """Return either the name to be used for GLX protocol enum. + + Returns either the name of the function or the name of the + name of the equivalent vector (e.g., glVertex3fv for + glVertex3f) function.""" + + if self.vectorequiv == None: + return self.name + else: + return self.vectorequiv + + + def opcode_name(self): + """Get the unique protocol enum name for the glXFunction""" + + if (self.glx_rop == 0) and self.vectorequiv: + equiv = self.context.functions_by_name[ self.vectorequiv ] + self.glx_rop = equiv.glx_rop + self.glx_doubles_in_order = equiv.glx_doubles_in_order + + + if self.glx_rop != 0: + return "X_GLrop_%s" % (self.opcode_rop_basename()) + elif self.glx_sop != 0: + return "X_GLsop_%s" % (self.name) + elif self.glx_vendorpriv != 0: + return "X_GLvop_%s" % (self.name) + else: + raise RuntimeError('Function "%s" has no opcode.' % (self.name)) + + + def opcode_vendor_name(self, name): + if name in self.glx_vendorpriv_names: + return "X_GLvop_%s" % (name) + else: + raise RuntimeError('Function "%s" has no VendorPrivate opcode.' % (name)) + + + def opcode_real_name(self): + """Get the true protocol enum name for the GLX opcode + + Behaves similarly to opcode_name, except for + X_GLXVendorPrivate and X_GLXVendorPrivateWithReply commands. + In these cases the string 'X_GLXVendorPrivate' or + 'X_GLXVendorPrivateWithReply' is returned. For other + single or render commands 'X_GLsop' or 'X_GLrop' plus the + name of the function returned.""" + + if self.glx_vendorpriv != 0: + if self.needs_reply(): + return "X_GLXVendorPrivateWithReply" + else: + return "X_GLXVendorPrivate" + else: + return self.opcode_name() + + + def needs_reply(self): + try: + x = self._needs_reply + except Exception, e: + x = 0 + if self.return_type != 'void': + x = 1 + + for param in self.parameters: + if param.is_output: + x = 1 + break + + self._needs_reply = x + + return x + + + def pad_after(self, p): + """Returns the name of the field inserted after the + specified field to pad out the command header.""" + + for image in self.images: + if image.img_pad_dimensions: + if not image.height: + if p.name == image.width: + return "height" + elif p.name == image.img_xoff: + return "yoffset" + elif not image.extent: + if p.name == image.depth: + # Should this be "size4d"? + return "extent" + elif p.name == image.img_zoff: + return "woffset" + + return None + + + def has_different_protocol(self, name): + """Returns true if the named version of the function uses different protocol from the other versions. + + Some functions, such as glDeleteTextures and + glDeleteTexturesEXT are functionally identical, but have + different protocol. This function returns true if the + named function is an alias name and that named version uses + different protocol from the function that is aliased. + """ + + return (name in self.glx_vendorpriv_names) and self.glx_sop + + + def static_glx_name(self, name): + if self.has_different_protocol(name): + for n in self.glx_vendorpriv_names: + if n in self.static_entry_points: + return n + + return self.static_name(name) + + + def client_supported_for_indirect(self): + """Returns true if the function is supported on the client + side for indirect rendering.""" + + return not self.ignore and (self.offset != -1) and (self.glx_rop or self.glx_sop or self.glx_vendorpriv or self.vectorequiv or self.client_handcode) + + +class glx_function_iterator: + """Class to iterate over a list of glXFunctions""" + + def __init__(self, context): + self.iterator = context.functionIterateByOffset() + return + + + def __iter__(self): + return self + + + def next(self): + f = self.iterator.next() + + if f.client_supported_for_indirect(): + return f + else: + return self.next() + + +class glx_api(gl_XML.gl_api): + def functionIterateGlx(self): + return glx_function_iterator(self) + --- mesa-glw-7.4.orig/src/mesa/glapi/next_available_offset.sh +++ mesa-glw-7.4/src/mesa/glapi/next_available_offset.sh @@ -0,0 +1,39 @@ +#!/usr/bin/env bash +# +# (C) Copyright IBM Corporation 2004 +# All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# on the rights to use, copy, modify, merge, publish, distribute, sub +# license, and/or sell copies of the Software, and to permit persons to whom +# the Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the next +# paragraph) shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL +# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# Authors: +# Ian Romanick + +# Trivial shell script to search the API definition file and print out the +# next numerically available API entry-point offset. This could probably +# be made smarter, but it would be better to use the existin Python +# framework to do that. This is just a quick-and-dirty hack. + +num=$(grep 'offset="' gl_API.xml |\ + sed 's/.\+ offset="//g;s/".*$//g' |\ + grep -v '?' |\ + sort -rn |\ + head -1) + +echo $((num + 1)) --- mesa-glw-7.4.orig/src/mesa/glapi/mesadef.py +++ mesa-glw-7.4/src/mesa/glapi/mesadef.py @@ -0,0 +1,222 @@ +#!/usr/bin/env python + + +# Mesa 3-D graphics library +# Version: 4.1 +# +# Copyright (C) 1999-2001 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. + + +# Generate the mesa.def file for Windows. +# +# Usage: +# mesadef.py >mesa.def +# Then copy to src/mesa/drivers/windows/gdi +# +# Dependencies: +# The apispec file must be in the current directory. + + + +import apiparser +import string + + +def PrintHead(): + print '; DO NOT EDIT - This file generated automatically by mesadef.py script' + print 'DESCRIPTION \'Mesa (OpenGL work-alike) for Win32\'' + print 'VERSION 6.0' + print ';' + print '; Module definition file for Mesa (OPENGL32.DLL)' + print ';' + print '; Note: The OpenGL functions use the STDCALL' + print '; function calling convention. Microsoft\'s' + print '; OPENGL32 uses this convention and so must the' + print '; Mesa OPENGL32 so that the Mesa DLL can be used' + print '; as a drop-in replacement.' + print ';' + print '; The linker exports STDCALL entry points with' + print '; \'decorated\' names; e.g., _glBegin@0, where the' + print '; trailing number is the number of bytes of ' + print '; parameter data pushed onto the stack. The' + print '; callee is responsible for popping this data' + print '; off the stack, usually via a RETF n instruction.' + print ';' + print '; However, the Microsoft OPENGL32.DLL does not export' + print '; the decorated names, even though the calling convention' + print '; is STDCALL. So, this module definition file is' + print '; needed to force the Mesa OPENGL32.DLL to export the' + print '; symbols in the same manner as the Microsoft DLL.' + print '; Were it not for this problem, this file would not' + print '; be needed (for the gl* functions) since the entry' + print '; points are compiled with dllexport declspec.' + print ';' + print '; However, this file is still needed to export "internal"' + print '; Mesa symbols for the benefit of the OSMESA32.DLL.' + print ';' + print 'EXPORTS' + return +#enddef + + +def PrintTail(): + print ';' + print '; WGL API' + print '\twglChoosePixelFormat' + print '\twglCopyContext' + print '\twglCreateContext' + print '\twglCreateLayerContext' + print '\twglDeleteContext' + print '\twglDescribeLayerPlane' + print '\twglDescribePixelFormat' + print '\twglGetCurrentContext' + print '\twglGetCurrentDC' + print '\twglGetExtensionsStringARB' + print '\twglGetLayerPaletteEntries' + print '\twglGetPixelFormat' + print '\twglGetProcAddress' + print '\twglMakeCurrent' + print '\twglRealizeLayerPalette' + print '\twglSetLayerPaletteEntries' + print '\twglSetPixelFormat' + print '\twglShareLists' + print '\twglSwapBuffers' + print '\twglSwapLayerBuffers' + print '\twglUseFontBitmapsA' + print '\twglUseFontBitmapsW' + print '\twglUseFontOutlinesA' + print '\twglUseFontOutlinesW' + print ';' + print '; Mesa internals - mostly for OSMESA' + print '\t_ac_CreateContext' + print '\t_ac_DestroyContext' + print '\t_ac_InvalidateState' + print '\t_glapi_get_context' + print '\t_glapi_get_proc_address' + print '\t_mesa_buffer_data' + print '\t_mesa_buffer_map' + print '\t_mesa_buffer_subdata' + print '\t_mesa_bzero' + print '\t_mesa_calloc' + print '\t_mesa_choose_tex_format' + print '\t_mesa_compressed_texture_size' + print '\t_mesa_create_framebuffer' + print '\t_mesa_create_visual' + print '\t_mesa_delete_buffer_object' + print '\t_mesa_delete_texture_object' + print '\t_mesa_destroy_framebuffer' + print '\t_mesa_destroy_visual' + print '\t_mesa_enable_1_3_extensions' + print '\t_mesa_enable_1_4_extensions' + print '\t_mesa_enable_1_5_extensions' + print '\t_mesa_enable_sw_extensions' + print '\t_mesa_error' + print '\t_mesa_free' + print '\t_mesa_free_context_data' + print '\t_mesa_get_current_context' + print '\t_mesa_init_default_imports' + print '\t_mesa_initialize_context' + print '\t_mesa_make_current' + print '\t_mesa_memcpy' + print '\t_mesa_memset' + print '\t_mesa_new_buffer_object' + print '\t_mesa_new_texture_object' + print '\t_mesa_problem' + print '\t_mesa_ResizeBuffersMESA' + print '\t_mesa_store_compressed_teximage1d' + print '\t_mesa_store_compressed_teximage2d' + print '\t_mesa_store_compressed_teximage3d' + print '\t_mesa_store_compressed_texsubimage1d' + print '\t_mesa_store_compressed_texsubimage2d' + print '\t_mesa_store_compressed_texsubimage3d' + print '\t_mesa_store_teximage1d' + print '\t_mesa_store_teximage2d' + print '\t_mesa_store_teximage3d' + print '\t_mesa_store_texsubimage1d' + print '\t_mesa_store_texsubimage2d' + print '\t_mesa_store_texsubimage3d' + print '\t_mesa_strcmp' + print '\t_mesa_test_proxy_teximage' + print '\t_mesa_Viewport' + print '\t_swrast_Accum' + print '\t_swrast_alloc_buffers' + print '\t_swrast_Bitmap' + print '\t_swrast_CopyPixels' + print '\t_swrast_DrawPixels' + print '\t_swrast_GetDeviceDriverReference' + print '\t_swrast_Clear' + print '\t_swrast_choose_line' + print '\t_swrast_choose_triangle' + print '\t_swrast_CopyColorSubTable' + print '\t_swrast_CopyColorTable' + print '\t_swrast_CopyConvolutionFilter1D' + print '\t_swrast_CopyConvolutionFilter2D' + print '\t_swrast_copy_teximage1d' + print '\t_swrast_copy_teximage2d' + print '\t_swrast_copy_texsubimage1d' + print '\t_swrast_copy_texsubimage2d' + print '\t_swrast_copy_texsubimage3d' + print '\t_swrast_CreateContext' + print '\t_swrast_DestroyContext' + print '\t_swrast_InvalidateState' + print '\t_swrast_ReadPixels' + print '\t_swrast_zbuffer_address' + print '\t_swsetup_Wakeup' + print '\t_swsetup_CreateContext' + print '\t_swsetup_DestroyContext' + print '\t_swsetup_InvalidateState' + print '\t_tnl_CreateContext' + print '\t_tnl_DestroyContext' + print '\t_tnl_InvalidateState' + print '\t_tnl_MakeCurrent' + print '\t_tnl_run_pipeline' +#enddef + + +records = [] + +def FindOffset(funcName): + for (name, alias, offset) in records: + if name == funcName: + return offset + #endif + #endfor + return -1 +#enddef + + +def EmitEntry(name, returnType, argTypeList, argNameList, alias, offset): + if alias == '': + dispatchName = name + else: + dispatchName = alias + if offset < 0: + offset = FindOffset(dispatchName) + if offset >= 0 and string.find(name, "unused") == -1: + print '\tgl%s' % (name) + # save this info in case we need to look up an alias later + records.append((name, dispatchName, offset)) + +#enddef + + +PrintHead() +apiparser.ProcessSpecFile("APIspec", EmitEntry) +PrintTail() --- mesa-glw-7.4.orig/src/mesa/glapi/EXT_framebuffer_object.xml +++ mesa-glw-7.4/src/mesa/glapi/EXT_framebuffer_object.xml @@ -0,0 +1,233 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + --- mesa-glw-7.4.orig/src/mesa/glapi/gl_apitemp.py +++ mesa-glw-7.4/src/mesa/glapi/gl_apitemp.py @@ -0,0 +1,253 @@ +#!/usr/bin/env python + +# (C) Copyright IBM Corporation 2004, 2005 +# All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# on the rights to use, copy, modify, merge, publish, distribute, sub +# license, and/or sell copies of the Software, and to permit persons to whom +# the Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the next +# paragraph) shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL +# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# Authors: +# Ian Romanick + +import gl_XML, glX_XML +import license +import sys, getopt + +class PrintGlOffsets(gl_XML.gl_print_base): + def __init__(self): + gl_XML.gl_print_base.__init__(self) + + self.name = "gl_apitemp.py (from Mesa)" + self.license = license.bsd_license_template % ( \ +"""Copyright (C) 1999-2001 Brian Paul All Rights Reserved. +(C) Copyright IBM Corporation 2004""", "BRIAN PAUL, IBM") + + self.undef_list.append( "KEYWORD1" ) + self.undef_list.append( "KEYWORD1_ALT" ) + self.undef_list.append( "KEYWORD2" ) + self.undef_list.append( "NAME" ) + self.undef_list.append( "DISPATCH" ) + self.undef_list.append( "RETURN_DISPATCH" ) + self.undef_list.append( "DISPATCH_TABLE_NAME" ) + self.undef_list.append( "UNUSED_TABLE_NAME" ) + self.undef_list.append( "TABLE_ENTRY" ) + + + def printFunction(self, f, name): + p_string = "" + o_string = "" + t_string = "" + comma = "" + + if f.is_static_entry_point(name): + keyword = "KEYWORD1" + else: + keyword = "KEYWORD1_ALT" + + n = f.static_name(name) + + for p in f.parameterIterator(): + if p.is_padding: + continue + + if p.is_pointer(): + cast = "(const void *) " + else: + cast = "" + + t_string = t_string + comma + p.format_string() + p_string = p_string + comma + p.name + o_string = o_string + comma + cast + p.name + comma = ", " + + + if f.return_type != 'void': + dispatch = "RETURN_DISPATCH" + else: + dispatch = "DISPATCH" + + if f.has_different_protocol(name): + print '#ifndef GLX_INDIRECT_RENDERING' + + if not f.is_static_entry_point(name): + print '%s %s KEYWORD2 NAME(%s)(%s);' % (keyword, f.return_type, n, f.get_parameter_string(name)) + print '' + + print '%s %s KEYWORD2 NAME(%s)(%s)' % (keyword, f.return_type, n, f.get_parameter_string(name)) + print '{' + if p_string == "": + print ' %s(%s, (), (F, "gl%s();\\n"));' \ + % (dispatch, f.name, name) + else: + print ' %s(%s, (%s), (F, "gl%s(%s);\\n", %s));' \ + % (dispatch, f.name, p_string, name, t_string, o_string) + print '}' + if f.has_different_protocol(name): + print '#endif /* GLX_INDIRECT_RENDERING */' + print '' + return + + def printRealHeader(self): + print '' + self.printVisibility( "HIDDEN", "hidden" ) + print """ +/* + * This file is a template which generates the OpenGL API entry point + * functions. It should be included by a .c file which first defines + * the following macros: + * KEYWORD1 - usually nothing, but might be __declspec(dllexport) on Win32 + * KEYWORD2 - usually nothing, but might be __stdcall on Win32 + * NAME(n) - builds the final function name (usually add "gl" prefix) + * DISPATCH(func, args, msg) - code to do dispatch of named function. + * msg is a printf-style debug message. + * RETURN_DISPATCH(func, args, msg) - code to do dispatch with a return value + * + * Here is an example which generates the usual OpenGL functions: + * #define KEYWORD1 + * #define KEYWORD2 + * #define NAME(func) gl##func + * #define DISPATCH(func, args, msg) \\ + * struct _glapi_table *dispatch = CurrentDispatch; \\ + * (*dispatch->func) args + * #define RETURN DISPATCH(func, args, msg) \\ + * struct _glapi_table *dispatch = CurrentDispatch; \\ + * return (*dispatch->func) args + * + */ + + +#if defined( NAME ) +#ifndef KEYWORD1 +#define KEYWORD1 +#endif + +#ifndef KEYWORD1_ALT +#define KEYWORD1_ALT HIDDEN +#endif + +#ifndef KEYWORD2 +#define KEYWORD2 +#endif + +#ifndef DISPATCH +#error DISPATCH must be defined +#endif + +#ifndef RETURN_DISPATCH +#error RETURN_DISPATCH must be defined +#endif + +""" + return + + + + def printInitDispatch(self, api): + print """ +#endif /* defined( NAME ) */ + +/* + * This is how a dispatch table can be initialized with all the functions + * we generated above. + */ +#ifdef DISPATCH_TABLE_NAME + +#ifndef TABLE_ENTRY +#error TABLE_ENTRY must be defined +#endif + +static _glapi_proc DISPATCH_TABLE_NAME[] = {""" + for f in api.functionIterateByOffset(): + print ' TABLE_ENTRY(%s),' % (f.dispatch_name()) + + print ' /* A whole bunch of no-op functions. These might be called' + print ' * when someone tries to call a dynamically-registered' + print ' * extension function without a current rendering context.' + print ' */' + for i in range(1, 100): + print ' TABLE_ENTRY(Unused),' + + print '};' + print '#endif /* DISPATCH_TABLE_NAME */' + print '' + return + + + def printAliasedTable(self, api): + print """ +/* + * This is just used to silence compiler warnings. + * We list the functions which are not otherwise used. + */ +#ifdef UNUSED_TABLE_NAME +static _glapi_proc UNUSED_TABLE_NAME[] = {""" + + for f in api.functionIterateByOffset(): + for n in f.entry_points: + if n != f.name: + if f.is_static_entry_point(n): + text = ' TABLE_ENTRY(%s),' % (n) + + if f.has_different_protocol(n): + print '#ifndef GLX_INDIRECT_RENDERING' + print text + print '#endif' + else: + print text + print '};' + print '#endif /*UNUSED_TABLE_NAME*/' + print '' + return + + + def printBody(self, api): + for func in api.functionIterateByOffset(): + got_stub = 0 + for n in func.entry_points: + if func.is_static_entry_point(n): + self.printFunction(func, n) + elif not got_stub: + self.printFunction(func, n) + got_stub = 1 + + self.printInitDispatch(api) + self.printAliasedTable(api) + return + + +def show_usage(): + print "Usage: %s [-f input_file_name]" % sys.argv[0] + sys.exit(1) + +if __name__ == '__main__': + file_name = "gl_API.xml" + + try: + (args, trail) = getopt.getopt(sys.argv[1:], "f:") + except Exception,e: + show_usage() + + for (arg,val) in args: + if arg == "-f": + file_name = val + + api = gl_XML.parse_GL_API(file_name, glX_XML.glx_item_factory()) + + printer = PrintGlOffsets() + printer.Print(api) --- mesa-glw-7.4.orig/src/mesa/glapi/gl_x86_asm.py +++ mesa-glw-7.4/src/mesa/glapi/gl_x86_asm.py @@ -0,0 +1,270 @@ +#!/usr/bin/env python + +# (C) Copyright IBM Corporation 2004, 2005 +# All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# on the rights to use, copy, modify, merge, publish, distribute, sub +# license, and/or sell copies of the Software, and to permit persons to whom +# the Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the next +# paragraph) shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL +# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# Authors: +# Ian Romanick + +import license +import gl_XML, glX_XML +import sys, getopt + +class PrintGenericStubs(gl_XML.gl_print_base): + + def __init__(self): + gl_XML.gl_print_base.__init__(self) + + self.name = "gl_x86_asm.py (from Mesa)" + self.license = license.bsd_license_template % ( \ +"""Copyright (C) 1999-2001 Brian Paul All Rights Reserved. +(C) Copyright IBM Corporation 2004, 2005""", "BRIAN PAUL, IBM") + return + + + def get_stack_size(self, f): + size = 0 + for p in f.parameterIterator(): + if p.is_padding: + continue + + size += p.get_stack_size() + + return size + + + def printRealHeader(self): + print '#include "assyntax.h"' + print '#include "glapi/glapioffsets.h"' + print '' + print '#if defined(STDCALL_API)' + print '# if defined(USE_MGL_NAMESPACE)' + print '# define GL_PREFIX(n,n2) GLNAME(CONCAT(mgl,n2))' + print '# else' + print '# define GL_PREFIX(n,n2) GLNAME(CONCAT(gl,n2))' + print '# endif' + print '#else' + print '# if defined(USE_MGL_NAMESPACE)' + print '# define GL_PREFIX(n,n2) GLNAME(CONCAT(mgl,n))' + print '# define _glapi_Dispatch _mglapi_Dispatch' + print '# else' + print '# define GL_PREFIX(n,n2) GLNAME(CONCAT(gl,n))' + print '# endif' + print '#endif' + print '' + print '#define GL_OFFSET(x) CODEPTR(REGOFF(4 * x, EAX))' + print '' + print '#if defined(GNU_ASSEMBLER) && !defined(__DJGPP__) && !defined(__MINGW32__)' + print '#define GLOBL_FN(x) GLOBL x ; .type x, function' + print '#else' + print '#define GLOBL_FN(x) GLOBL x' + print '#endif' + print '' + print '#if defined(PTHREADS) || defined(USE_XTHREADS) || defined(SOLARIS_THREADS) || defined(WIN32_THREADS) || defined(BEOS_THREADS)' + print '# define THREADS' + print '#endif' + print '' + print '#ifdef GLX_USE_TLS' + print '' + print '#ifdef GLX_X86_READONLY_TEXT' + print '# define CTX_INSNS MOV_L(GS:(EAX), EAX)' + print '#else' + print '# define CTX_INSNS NOP /* Pad for init_glapi_relocs() */' + print '#endif' + print '' + print '# define GL_STUB(fn,off,fn_alt)\t\t\t\\' + print 'ALIGNTEXT16;\t\t\t\t\t\t\\' + print 'GLOBL_FN(GL_PREFIX(fn, fn_alt));\t\t\t\\' + print 'GL_PREFIX(fn, fn_alt):\t\t\t\t\t\\' + print '\tCALL(_x86_get_dispatch) ;\t\t\t\\' + print '\tCTX_INSNS ; \\' + print '\tJMP(GL_OFFSET(off))' + print '' + print '#elif defined(PTHREADS)' + print '# define GL_STUB(fn,off,fn_alt)\t\t\t\\' + print 'ALIGNTEXT16;\t\t\t\t\t\t\\' + print 'GLOBL_FN(GL_PREFIX(fn, fn_alt));\t\t\t\\' + print 'GL_PREFIX(fn, fn_alt):\t\t\t\t\t\\' + print '\tMOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX) ;\t\\' + print '\tTEST_L(EAX, EAX) ;\t\t\t\t\\' + print '\tJE(1f) ;\t\t\t\t\t\\' + print '\tJMP(GL_OFFSET(off)) ;\t\t\t\t\\' + print '1:\tCALL(_x86_get_dispatch) ;\t\t\t\\' + print '\tJMP(GL_OFFSET(off))' + print '#elif defined(THREADS)' + print '# define GL_STUB(fn,off,fn_alt)\t\t\t\\' + print 'ALIGNTEXT16;\t\t\t\t\t\t\\' + print 'GLOBL_FN(GL_PREFIX(fn, fn_alt));\t\t\t\\' + print 'GL_PREFIX(fn, fn_alt):\t\t\t\t\t\\' + print '\tMOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX) ;\t\\' + print '\tTEST_L(EAX, EAX) ;\t\t\t\t\\' + print '\tJE(1f) ;\t\t\t\t\t\\' + print '\tJMP(GL_OFFSET(off)) ;\t\t\t\t\\' + print '1:\tCALL(_glapi_get_dispatch) ;\t\t\t\\' + print '\tJMP(GL_OFFSET(off))' + print '#else /* Non-threaded version. */' + print '# define GL_STUB(fn,off,fn_alt)\t\t\t\\' + print 'ALIGNTEXT16;\t\t\t\t\t\t\\' + print 'GLOBL_FN(GL_PREFIX(fn, fn_alt));\t\t\t\\' + print 'GL_PREFIX(fn, fn_alt):\t\t\t\t\t\\' + print '\tMOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX) ;\t\\' + print '\tJMP(GL_OFFSET(off))' + print '#endif' + print '' + print '#ifdef HAVE_ALIAS' + print '# define GL_STUB_ALIAS(fn,off,fn_alt,alias,alias_alt)\t\\' + print '\t.globl\tGL_PREFIX(fn, fn_alt) ;\t\t\t\\' + print '\t.set\tGL_PREFIX(fn, fn_alt), GL_PREFIX(alias, alias_alt)' + print '#else' + print '# define GL_STUB_ALIAS(fn,off,fn_alt,alias,alias_alt)\t\\' + print ' GL_STUB(fn, off, fn_alt)' + print '#endif' + print '' + print 'SEG_TEXT' + print '' + print '#ifdef GLX_USE_TLS' + print '' + print '\tGLOBL\tGLNAME(_x86_get_dispatch)' + print '\tHIDDEN(GLNAME(_x86_get_dispatch))' + print 'ALIGNTEXT16' + print 'GLNAME(_x86_get_dispatch):' + print '\tcall 1f' + print '1:\tpopl %eax' + print '\taddl $_GLOBAL_OFFSET_TABLE_+[.-1b], %eax' + print '\tmovl _glapi_tls_Dispatch@GOTNTPOFF(%eax), %eax' + print '\tret' + print '' + print '#elif defined(PTHREADS)' + print 'EXTERN GLNAME(_glapi_Dispatch)' + print 'EXTERN GLNAME(_gl_DispatchTSD)' + print 'EXTERN GLNAME(pthread_getspecific)' + print '' + print 'ALIGNTEXT16' + print 'GLNAME(_x86_get_dispatch):' + print '\tSUB_L(CONST(24), ESP)' + print '\tPUSH_L(GLNAME(_gl_DispatchTSD))' + print '\tCALL(GLNAME(pthread_getspecific))' + print '\tADD_L(CONST(28), ESP)' + print '\tRET' + print '#elif defined(THREADS)' + print 'EXTERN GLNAME(_glapi_get_dispatch)' + print '#endif' + print '' + + print '#if defined( GLX_USE_TLS ) && !defined( GLX_X86_READONLY_TEXT )' + print '\t\t.section\twtext, "awx", @progbits' + print '#endif /* defined( GLX_USE_TLS ) */' + + print '' + print '\t\tALIGNTEXT16' + print '\t\tGLOBL GLNAME(gl_dispatch_functions_start)' + print '\t\tHIDDEN(GLNAME(gl_dispatch_functions_start))' + print 'GLNAME(gl_dispatch_functions_start):' + print '' + return + + + def printRealFooter(self): + print '' + print '\t\tGLOBL\tGLNAME(gl_dispatch_functions_end)' + print '\t\tHIDDEN(GLNAME(gl_dispatch_functions_end))' + print '\t\tALIGNTEXT16' + print 'GLNAME(gl_dispatch_functions_end):' + print '' + print '#if defined(GLX_USE_TLS) && defined(__linux__)' + print ' .section ".note.ABI-tag", "a"' + print ' .p2align 2' + print ' .long 1f - 0f /* name length */' + print ' .long 3f - 2f /* data length */' + print ' .long 1 /* note length */' + print '0: .asciz "GNU" /* vendor name */' + print '1: .p2align 2' + print '2: .long 0 /* note data: the ABI tag */' + print ' .long 2,4,20 /* Minimum kernel version w/TLS */' + print '3: .p2align 2 /* pad out section */' + print '#endif /* GLX_USE_TLS */' + print '' + print '#if defined (__ELF__) && defined (__linux__)' + print ' .section .note.GNU-stack,"",%progbits' + print '#endif' + return + + + def printBody(self, api): + for f in api.functionIterateByOffset(): + name = f.dispatch_name() + stack = self.get_stack_size(f) + alt = "%s@%u" % (name, stack) + + print '\tGL_STUB(%s, _gloffset_%s, %s)' % (name, f.name, alt) + + if not f.is_static_entry_point(f.name): + print '\tHIDDEN(GL_PREFIX(%s, %s))' % (name, alt) + + + for f in api.functionIterateByOffset(): + name = f.dispatch_name() + stack = self.get_stack_size(f) + alt = "%s@%u" % (name, stack) + + if f.is_static_entry_point(f.name): + for n in f.entry_points: + if n != f.name: + alt2 = "%s@%u" % (n, stack) + text = '\tGL_STUB_ALIAS(%s, _gloffset_%s, %s, %s, %s)' % (n, f.name, alt2, f.name, alt) + + if f.has_different_protocol(n): + print '#ifndef GLX_INDIRECT_RENDERING' + print text + print '#endif' + else: + print text + + return + +def show_usage(): + print "Usage: %s [-f input_file_name] [-m output_mode]" % sys.argv[0] + sys.exit(1) + +if __name__ == '__main__': + file_name = "gl_API.xml" + mode = "generic" + + try: + (args, trail) = getopt.getopt(sys.argv[1:], "m:f:") + except Exception,e: + show_usage() + + for (arg,val) in args: + if arg == '-m': + mode = val + elif arg == "-f": + file_name = val + + if mode == "generic": + printer = PrintGenericStubs() + else: + print "ERROR: Invalid mode \"%s\" specified." % mode + show_usage() + + api = gl_XML.parse_GL_API(file_name, glX_XML.glx_item_factory()) + printer.Print(api) --- mesa-glw-7.4.orig/src/mesa/glapi/gl_procs.py +++ mesa-glw-7.4/src/mesa/glapi/gl_procs.py @@ -0,0 +1,189 @@ +#!/usr/bin/env python + +# (C) Copyright IBM Corporation 2004, 2005 +# All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# on the rights to use, copy, modify, merge, publish, distribute, sub +# license, and/or sell copies of the Software, and to permit persons to whom +# the Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the next +# paragraph) shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL +# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# Authors: +# Ian Romanick + +import license +import gl_XML, glX_XML +import sys, getopt + +class PrintGlProcs(gl_XML.gl_print_base): + def __init__(self, long_strings): + gl_XML.gl_print_base.__init__(self) + + self.long_strings = long_strings + self.name = "gl_procs.py (from Mesa)" + self.license = license.bsd_license_template % ( \ +"""Copyright (C) 1999-2001 Brian Paul All Rights Reserved. +(C) Copyright IBM Corporation 2004, 2006""", "BRIAN PAUL, IBM") + + + def printRealHeader(self): + print """ +/* This file is only included by glapi.c and is used for + * the GetProcAddress() function + */ + +typedef struct { + GLint Name_offset; +#if defined(NEED_FUNCTION_POINTER) || defined(GLX_INDIRECT_RENDERING) + _glapi_proc Address; +#endif + GLuint Offset; +} glprocs_table_t; + +#if !defined(NEED_FUNCTION_POINTER) && !defined(GLX_INDIRECT_RENDERING) +# define NAME_FUNC_OFFSET(n,f1,f2,f3,o) { n , o } +#elif defined(NEED_FUNCTION_POINTER) && !defined(GLX_INDIRECT_RENDERING) +# define NAME_FUNC_OFFSET(n,f1,f2,f3,o) { n , (_glapi_proc) f1 , o } +#elif defined(NEED_FUNCTION_POINTER) && defined(GLX_INDIRECT_RENDERING) +# define NAME_FUNC_OFFSET(n,f1,f2,f3,o) { n , (_glapi_proc) f2 , o } +#elif !defined(NEED_FUNCTION_POINTER) && defined(GLX_INDIRECT_RENDERING) +# define NAME_FUNC_OFFSET(n,f1,f2,f3,o) { n , (_glapi_proc) f3 , o } +#endif + +""" + return + + def printRealFooter(self): + print '' + print '#undef NAME_FUNC_OFFSET' + return + + def printFunctionString(self, name): + if self.long_strings: + print ' "gl%s\\0"' % (name) + else: + print " 'g','l',", + for c in name: + print "'%s'," % (c), + + print "'\\0'," + + + def printBody(self, api): + print '' + if self.long_strings: + print 'static const char gl_string_table[] =' + else: + print 'static const char gl_string_table[] = {' + + base_offset = 0 + table = [] + for func in api.functionIterateByOffset(): + name = func.dispatch_name() + self.printFunctionString(func.name) + table.append((base_offset, "gl" + name, "gl" + name, "NULL", func.name)) + + # The length of the function's name, plus 2 for "gl", + # plus 1 for the NUL. + + base_offset += len(func.name) + 3 + + + for func in api.functionIterateByOffset(): + for n in func.entry_points: + if n != func.name: + name = func.dispatch_name() + self.printFunctionString( n ) + + if func.has_different_protocol(n): + alt_name = "gl" + func.static_glx_name(n) + table.append((base_offset, "gl" + name, alt_name, alt_name, func.name)) + else: + table.append((base_offset, "gl" + name, "gl" + name, "NULL", func.name)) + + base_offset += len(n) + 3 + + + if self.long_strings: + print ' ;' + else: + print '};' + + print '' + print '' + print "#ifdef USE_MGL_NAMESPACE" + for func in api.functionIterateByOffset(): + for n in func.entry_points: + if (not func.is_static_entry_point(func.name)) or (func.has_different_protocol(n) and not func.is_static_entry_point(n)): + print '#define gl_dispatch_stub_%u mgl_dispatch_stub_%u' % (func.offset, func.offset) + break + print "#endif /* USE_MGL_NAMESPACE */" + print '' + print '' + print '/* FIXME: Having these (incorrect) prototypes here is ugly. */' + print '#if defined(NEED_FUNCTION_POINTER) || defined(GLX_INDIRECT_RENDERING)' + for func in api.functionIterateByOffset(): + for n in func.entry_points: + if (not func.is_static_entry_point(func.name)) or (func.has_different_protocol(n) and not func.is_static_entry_point(n)): + print 'extern void gl_dispatch_stub_%u(void);' % (func.offset) + break + + print '#endif /* defined(NEED_FUNCTION_POINTER) || defined(GLX_INDIRECT_RENDERING) */' + + print '' + print 'static const glprocs_table_t static_functions[] = {' + + for info in table: + print ' NAME_FUNC_OFFSET(%5u, %s, %s, %s, _gloffset_%s),' % info + + print ' NAME_FUNC_OFFSET(-1, NULL, NULL, NULL, 0)' + print '};' + return + + +def show_usage(): + print "Usage: %s [-f input_file_name] [-m mode]" % sys.argv[0] + print "mode can be one of:" + print " long - Create code for compilers that can handle very" + print " long string constants. (default)" + print " short - Create code for compilers that can only handle" + print " ANSI C89 string constants." + sys.exit(1) + +if __name__ == '__main__': + file_name = "gl_API.xml" + + try: + (args, trail) = getopt.getopt(sys.argv[1:], "f:m:") + except Exception,e: + show_usage() + + long_string = 1 + for (arg,val) in args: + if arg == "-f": + file_name = val + elif arg == "-m": + if val == "short": + long_string = 0 + elif val == "long": + long_string = 1 + else: + show_usage() + + api = gl_XML.parse_GL_API(file_name, glX_XML.glx_item_factory()) + printer = PrintGlProcs(long_string) + printer.Print(api) --- mesa-glw-7.4.orig/src/mesa/glapi/gl_SPARC_asm.py +++ mesa-glw-7.4/src/mesa/glapi/gl_SPARC_asm.py @@ -0,0 +1,153 @@ +#!/usr/bin/env python + +# (C) Copyright IBM Corporation 2004 +# All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# on the rights to use, copy, modify, merge, publish, distribute, sub +# license, and/or sell copies of the Software, and to permit persons to whom +# the Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the next +# paragraph) shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL +# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# Authors: +# Ian Romanick + +import license +import gl_XML, glX_XML +import sys, getopt + +class PrintGenericStubs(gl_XML.gl_print_base): + def __init__(self): + gl_XML.gl_print_base.__init__(self) + self.name = "gl_SPARC_asm.py (from Mesa)" + self.license = license.bsd_license_template % ( \ +"""Copyright (C) 1999-2003 Brian Paul All Rights Reserved. +(C) Copyright IBM Corporation 2004""", "BRIAN PAUL, IBM") + + + def printRealHeader(self): + print '#include "glapioffsets.h"' + print '' + print '#ifdef __arch64__' + print '# define GL_STUB(fn,off)\t\t\t\t\\' + print 'fn:\t\t\t\t\t\\' + print '\tsethi\t%hi(0xDEADBEEF), %g4 ;\t\t\t\\' + print '\tsethi\t%hi(0xDEADBEEF), %g1 ;\t\t\t\\' + print '\tor\t%g4, %lo(0xDEADBEEF), %g4 ;\t\t\\' + print '\tor\t%g1, %lo(0xDEADBEEF), %g1 ;\t\t\\' + print '\tsllx\t%g4, 32, %g4 ;\t\t\t\t\\' + print '\tldx\t[%g1 + %g4], %g1 ;\t\t\t\\' + print '\tsethi\t%hi(8 * off), %g4 ;\t\t\t\\' + print '\tor\t%g4, %lo(8 * off), %g4 ;\t\t\\' + print '\tldx\t[%g1 + %g4], %g5 ;\t\t\t\\' + print '\tjmpl\t%g5, %g0 ;\t\t\t\t\\' + print '\tnop' + print '#else' + print '# define GL_STUB(fn,off)\t\t\t\t\\' + print 'fn:\t\t\t\t\t\\' + print '\tsethi\t%hi(0xDEADBEEF), %g1 ;\t\t\t\\' + print '\tld\t[%g1 + %lo(0xDEADBEEF)], %g1 ;\t\t\\' + print '\tld\t[%g1 + (4 * off)], %g5 ;\t\t\\' + print '\tjmpl\t%g5, %g0 ;\t\t\t\t\\' + print '\tnop' + print '#endif' + print '' + print '#define GL_STUB_ALIAS(fn,alias) fn = alias' + print '' + print '.text' + print '.align 32' + print '\t\t.globl __glapi_sparc_icache_flush ; .type __glapi_sparc_icache_flush,#function' + print '__glapi_sparc_icache_flush: /* %o0 = insn_addr */' + print '\tflush\t%o0' + print '\tretl' + print '\tnop' + print '' + print '.data' + print '.align 64' + print '' + return + + + def printBody(self, api): + for f in api.functionIterateByOffset(): + if f.is_static_entry_point(f.name): + name = f.name + else: + name = "_dispatch_stub_%u" % (f.offset) + + print '\t\t.globl gl%s ; .type gl%s,#function' % (name, name) + + print '\t\t.globl _mesa_sparc_glapi_begin ; .type _mesa_sparc_glapi_begin,#function' + print '_mesa_sparc_glapi_begin:' + print '' + + for f in api.functionIterateByOffset(): + if f.is_static_entry_point(f.name): + name = f.name + else: + name = "_dispatch_stub_%u" % (f.offset) + + print '\tGL_STUB(gl%s, _gloffset_%s)' % (name, name) + + print '' + print '\t\t.globl _mesa_sparc_glapi_end ; .type _mesa_sparc_glapi_end,#function' + print '_mesa_sparc_glapi_end:' + print '' + + + for f in api.functionIterateByOffset(): + for n in f.entry_points: + if n != f.name: + if f.is_static_entry_point(n): + text = '\t.globl gl%s ; .type gl%s,#function ; gl%s = gl%s' % (n, n, n, f.name) + + if f.has_different_protocol(n): + print '#ifndef GLX_INDIRECT_RENDERING' + print text + print '#endif' + else: + print text + + return + + +def show_usage(): + print "Usage: %s [-f input_file_name] [-m output_mode]" % sys.argv[0] + sys.exit(1) + +if __name__ == '__main__': + file_name = "gl_API.xml" + mode = "generic" + + try: + (args, trail) = getopt.getopt(sys.argv[1:], "m:f:") + except Exception,e: + show_usage() + + for (arg,val) in args: + if arg == '-m': + mode = val + elif arg == "-f": + file_name = val + + if mode == "generic": + printer = PrintGenericStubs() + else: + print "ERROR: Invalid mode \"%s\" specified." % mode + show_usage() + + api = gl_XML.parse_GL_API(file_name, glX_XML.glx_item_factory()) + printer.Print(api) --- mesa-glw-7.4.orig/src/mesa/glapi/gl_API.xml +++ mesa-glw-7.4/src/mesa/glapi/gl_API.xml @@ -0,0 +1,12384 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + --- mesa-glw-7.4.orig/src/mesa/glapi/APPLE_vertex_array_object.xml +++ mesa-glw-7.4/src/mesa/glapi/APPLE_vertex_array_object.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + --- mesa-glw-7.4.orig/src/mesa/glapi/gl_XML.py +++ mesa-glw-7.4/src/mesa/glapi/gl_XML.py @@ -0,0 +1,964 @@ +#!/usr/bin/env python + +# (C) Copyright IBM Corporation 2004, 2005 +# All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# on the rights to use, copy, modify, merge, publish, distribute, sub +# license, and/or sell copies of the Software, and to permit persons to whom +# the Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the next +# paragraph) shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL +# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# Authors: +# Ian Romanick + +import libxml2 +import re, sys, string +import typeexpr + + +def parse_GL_API( file_name, factory = None ): + doc = libxml2.readFile( file_name, None, libxml2.XML_PARSE_XINCLUDE + libxml2.XML_PARSE_NOBLANKS + libxml2.XML_PARSE_DTDVALID + libxml2.XML_PARSE_DTDATTR + libxml2.XML_PARSE_DTDLOAD + libxml2.XML_PARSE_NOENT ) + ret = doc.xincludeProcess() + + if not factory: + factory = gl_item_factory() + + api = factory.create_item( "api", None, None ) + api.process_element( doc ) + + # After the XML has been processed, we need to go back and assign + # dispatch offsets to the functions that request that their offsets + # be assigned by the scripts. Typically this means all functions + # that are not part of the ABI. + + for func in api.functionIterateByCategory(): + if func.assign_offset: + func.offset = api.next_offset; + api.next_offset += 1 + + doc.freeDoc() + + return api + + +def is_attr_true( element, name ): + """Read a name value from an element's attributes. + + The value read from the attribute list must be either 'true' or + 'false'. If the value is 'false', zero will be returned. If the + value is 'true', non-zero will be returned. An exception will be + raised for any other value.""" + + value = element.nsProp( name, None ) + if value == "true": + return 1 + elif value == "false": + return 0 + else: + raise RuntimeError('Invalid value "%s" for boolean "%s".' % (value, name)) + + +class gl_print_base: + """Base class of all API pretty-printers. + + In the model-view-controller pattern, this is the view. Any derived + class will want to over-ride the printBody, printRealHader, and + printRealFooter methods. Some derived classes may want to over-ride + printHeader and printFooter, or even Print (though this is unlikely). + """ + + def __init__(self): + # Name of the script that is generating the output file. + # Every derived class should set this to the name of its + # source file. + + self.name = "a" + + + # License on the *generated* source file. This may differ + # from the license on the script that is generating the file. + # Every derived class should set this to some reasonable + # value. + # + # See license.py for an example of a reasonable value. + + self.license = "The license for this file is unspecified." + + + # The header_tag is the name of the C preprocessor define + # used to prevent multiple inclusion. Typically only + # generated C header files need this to be set. Setting it + # causes code to be generated automatically in printHeader + # and printFooter. + + self.header_tag = None + + + # List of file-private defines that must be undefined at the + # end of the file. This can be used in header files to define + # names for use in the file, then undefine them at the end of + # the header file. + + self.undef_list = [] + return + + + def Print(self, api): + self.printHeader() + self.printBody(api) + self.printFooter() + return + + + def printHeader(self): + """Print the header associated with all files and call the printRealHeader method.""" + + print '/* DO NOT EDIT - This file generated automatically by %s script */' \ + % (self.name) + print '' + print '/*' + print ' * ' + self.license.replace('\n', '\n * ') + print ' */' + print '' + if self.header_tag: + print '#if !defined( %s )' % (self.header_tag) + print '# define %s' % (self.header_tag) + print '' + self.printRealHeader(); + return + + + def printFooter(self): + """Print the header associated with all files and call the printRealFooter method.""" + + self.printRealFooter() + + if self.undef_list: + print '' + for u in self.undef_list: + print "# undef %s" % (u) + + if self.header_tag: + print '' + print '#endif /* !defined( %s ) */' % (self.header_tag) + + + def printRealHeader(self): + """Print the "real" header for the created file. + + In the base class, this function is empty. All derived + classes should over-ride this function.""" + return + + + def printRealFooter(self): + """Print the "real" footer for the created file. + + In the base class, this function is empty. All derived + classes should over-ride this function.""" + return + + + def printPure(self): + """Conditionally define `PURE' function attribute. + + Conditionally defines a preprocessor macro `PURE' that wraps + GCC's `pure' function attribute. The conditional code can be + easilly adapted to other compilers that support a similar + feature. + + The name is also added to the file's undef_list. + """ + self.undef_list.append("PURE") + print """# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) +# define PURE __attribute__((pure)) +# else +# define PURE +# endif""" + return + + + def printFastcall(self): + """Conditionally define `FASTCALL' function attribute. + + Conditionally defines a preprocessor macro `FASTCALL' that + wraps GCC's `fastcall' function attribute. The conditional + code can be easilly adapted to other compilers that support a + similar feature. + + The name is also added to the file's undef_list. + """ + + self.undef_list.append("FASTCALL") + print """# if defined(__i386__) && defined(__GNUC__) && !defined(__CYGWIN__) && !defined(__MINGW32__) +# define FASTCALL __attribute__((fastcall)) +# else +# define FASTCALL +# endif""" + return + + + def printVisibility(self, S, s): + """Conditionally define visibility function attribute. + + Conditionally defines a preprocessor macro name S that wraps + GCC's visibility function attribute. The visibility used is + the parameter s. The conditional code can be easilly adapted + to other compilers that support a similar feature. + + The name is also added to the file's undef_list. + """ + + self.undef_list.append(S) + print """# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(__ELF__) +# define %s __attribute__((visibility("%s"))) +# else +# define %s +# endif""" % (S, s, S) + return + + + def printNoinline(self): + """Conditionally define `NOINLINE' function attribute. + + Conditionally defines a preprocessor macro `NOINLINE' that + wraps GCC's `noinline' function attribute. The conditional + code can be easilly adapted to other compilers that support a + similar feature. + + The name is also added to the file's undef_list. + """ + + self.undef_list.append("NOINLINE") + print """# if defined(__GNUC__) +# define NOINLINE __attribute__((noinline)) +# else +# define NOINLINE +# endif""" + return + + +def real_function_name(element): + name = element.nsProp( "name", None ) + alias = element.nsProp( "alias", None ) + + if alias: + return alias + else: + return name + + +def real_category_name(c): + if re.compile("[1-9][0-9]*[.][0-9]+").match(c): + return "GL_VERSION_" + c.replace(".", "_") + else: + return c + + +def classify_category(name, number): + """Based on the category name and number, select a numerical class for it. + + Categories are divided into four classes numbered 0 through 3. The + classes are: + + 0. Core GL versions, sorted by version number. + 1. ARB extensions, sorted by extension number. + 2. Non-ARB extensions, sorted by extension number. + 3. Un-numbered extensions, sorted by extension name. + """ + + try: + core_version = float(name) + except Exception,e: + core_version = 0.0 + + if core_version > 0.0: + cat_type = 0 + key = name + elif name.startswith("GL_ARB_") or name.startswith("GLX_ARB_") or name.startswith("WGL_ARB_"): + cat_type = 1 + key = int(number) + else: + if number != None: + cat_type = 2 + key = int(number) + else: + cat_type = 3 + key = name + + + return [cat_type, key] + + +def create_parameter_string(parameters, include_names): + """Create a parameter string from a list of gl_parameters.""" + + list = [] + for p in parameters: + if p.is_padding: + continue + + if include_names: + list.append( p.string() ) + else: + list.append( p.type_string() ) + + if len(list) == 0: list = ["void"] + + return string.join(list, ", ") + + +class gl_item: + def __init__(self, element, context): + self.context = context + self.name = element.nsProp( "name", None ) + self.category = real_category_name( element.parent.nsProp( "name", None ) ) + return + + +class gl_type( gl_item ): + def __init__(self, element, context): + gl_item.__init__(self, element, context) + self.size = int( element.nsProp( "size", None ), 0 ) + + te = typeexpr.type_expression( None ) + tn = typeexpr.type_node() + tn.size = int( element.nsProp( "size", None ), 0 ) + tn.integer = not is_attr_true( element, "float" ) + tn.unsigned = is_attr_true( element, "unsigned" ) + tn.name = "GL" + self.name + te.set_base_type_node( tn ) + + self.type_expr = te + return + + + def get_type_expression(self): + return self.type_expr + + +class gl_enum( gl_item ): + def __init__(self, element, context): + gl_item.__init__(self, element, context) + self.value = int( element.nsProp( "value", None ), 0 ) + + temp = element.nsProp( "count", None ) + if not temp or temp == "?": + self.default_count = -1 + else: + try: + c = int(temp) + except Exception,e: + raise RuntimeError('Invalid count value "%s" for enum "%s" in function "%s" when an integer was expected.' % (temp, self.name, n)) + + self.default_count = c + + return + + + def priority(self): + """Calculate a 'priority' for this enum name. + + When an enum is looked up by number, there may be many + possible names, but only one is the 'prefered' name. The + priority is used to select which name is the 'best'. + + Highest precedence is given to core GL name. ARB extension + names have the next highest, followed by EXT extension names. + Vendor extension names are the lowest. + """ + + if self.name.endswith( "_BIT" ): + bias = 1 + else: + bias = 0 + + if self.category.startswith( "GL_VERSION_" ): + priority = 0 + elif self.category.startswith( "GL_ARB_" ): + priority = 2 + elif self.category.startswith( "GL_EXT_" ): + priority = 4 + else: + priority = 6 + + return priority + bias + + + +class gl_parameter: + def __init__(self, element, context): + self.name = element.nsProp( "name", None ) + + ts = element.nsProp( "type", None ) + self.type_expr = typeexpr.type_expression( ts, context ) + + temp = element.nsProp( "variable_param", None ) + if temp: + self.count_parameter_list = temp.split( ' ' ) + else: + self.count_parameter_list = [] + + # The count tag can be either a numeric string or the name of + # a variable. If it is the name of a variable, the int(c) + # statement will throw an exception, and the except block will + # take over. + + c = element.nsProp( "count", None ) + try: + count = int(c) + self.count = count + self.counter = None + except Exception,e: + count = 1 + self.count = 0 + self.counter = c + + self.count_scale = int(element.nsProp( "count_scale", None )) + + elements = (count * self.count_scale) + if elements == 1: + elements = 0 + + #if ts == "GLdouble": + # print '/* stack size -> %s = %u (before)*/' % (self.name, self.type_expr.get_stack_size()) + # print '/* # elements = %u */' % (elements) + self.type_expr.set_elements( elements ) + #if ts == "GLdouble": + # print '/* stack size -> %s = %u (after) */' % (self.name, self.type_expr.get_stack_size()) + + self.is_client_only = is_attr_true( element, 'client_only' ) + self.is_counter = is_attr_true( element, 'counter' ) + self.is_output = is_attr_true( element, 'output' ) + + + # Pixel data has special parameters. + + self.width = element.nsProp('img_width', None) + self.height = element.nsProp('img_height', None) + self.depth = element.nsProp('img_depth', None) + self.extent = element.nsProp('img_extent', None) + + self.img_xoff = element.nsProp('img_xoff', None) + self.img_yoff = element.nsProp('img_yoff', None) + self.img_zoff = element.nsProp('img_zoff', None) + self.img_woff = element.nsProp('img_woff', None) + + self.img_format = element.nsProp('img_format', None) + self.img_type = element.nsProp('img_type', None) + self.img_target = element.nsProp('img_target', None) + + self.img_pad_dimensions = is_attr_true( element, 'img_pad_dimensions' ) + self.img_null_flag = is_attr_true( element, 'img_null_flag' ) + self.img_send_null = is_attr_true( element, 'img_send_null' ) + + self.is_padding = is_attr_true( element, 'padding' ) + return + + + def compatible(self, other): + return 1 + + + def is_array(self): + return self.is_pointer() + + + def is_pointer(self): + return self.type_expr.is_pointer() + + + def is_image(self): + if self.width: + return 1 + else: + return 0 + + + def is_variable_length(self): + return len(self.count_parameter_list) or self.counter + + + def is_64_bit(self): + count = self.type_expr.get_element_count() + if count: + if (self.size() / count) == 8: + return 1 + else: + if self.size() == 8: + return 1 + + return 0 + + + def string(self): + return self.type_expr.original_string + " " + self.name + + + def type_string(self): + return self.type_expr.original_string + + + def get_base_type_string(self): + return self.type_expr.get_base_name() + + + def get_dimensions(self): + if not self.width: + return [ 0, "0", "0", "0", "0" ] + + dim = 1 + w = self.width + h = "1" + d = "1" + e = "1" + + if self.height: + dim = 2 + h = self.height + + if self.depth: + dim = 3 + d = self.depth + + if self.extent: + dim = 4 + e = self.extent + + return [ dim, w, h, d, e ] + + + def get_stack_size(self): + return self.type_expr.get_stack_size() + + + def size(self): + if self.is_image(): + return 0 + else: + return self.type_expr.get_element_size() + + + def get_element_count(self): + c = self.type_expr.get_element_count() + if c == 0: + return 1 + + return c + + + def size_string(self, use_parens = 1): + s = self.size() + if self.counter or self.count_parameter_list: + list = [ "compsize" ] + + if self.counter and self.count_parameter_list: + list.append( self.counter ) + elif self.counter: + list = [ self.counter ] + + if s > 1: + list.append( str(s) ) + + if len(list) > 1 and use_parens : + return "(%s)" % (string.join(list, " * ")) + else: + return string.join(list, " * ") + + elif self.is_image(): + return "compsize" + else: + return str(s) + + + def format_string(self): + if self.type_expr.original_string == "GLenum": + return "0x%x" + else: + return self.type_expr.format_string() + + + +class gl_function( gl_item ): + def __init__(self, element, context): + self.context = context + self.name = None + + self.entry_points = [] + self.return_type = "void" + self.parameters = [] + self.offset = -1 + self.initialized = 0 + self.images = [] + + self.assign_offset = 0 + + self.static_entry_points = [] + + # Track the parameter string (for the function prototype) + # for each entry-point. This is done because some functions + # change their prototype slightly when promoted from extension + # to ARB extension to core. glTexImage3DEXT and glTexImage3D + # are good examples of this. Scripts that need to generate + # code for these differing aliases need to real prototype + # for each entry-point. Otherwise, they may generate code + # that won't compile. + + self.parameter_strings = {} + + self.process_element( element ) + + return + + + def process_element(self, element): + name = element.nsProp( "name", None ) + alias = element.nsProp( "alias", None ) + + if is_attr_true(element, "static_dispatch"): + self.static_entry_points.append(name) + + self.entry_points.append( name ) + if alias: + true_name = alias + else: + true_name = name + + # Only try to set the offset when a non-alias + # entry-point is being processes. + + offset = element.nsProp( "offset", None ) + if offset: + try: + o = int( offset ) + self.offset = o + except Exception, e: + self.offset = -1 + if offset == "assign": + self.assign_offset = 1 + + + if not self.name: + self.name = true_name + elif self.name != true_name: + raise RuntimeError("Function true name redefined. Was %s, now %s." % (self.name, true_name)) + + + # There are two possible cases. The first time an entry-point + # with data is seen, self.initialized will be 0. On that + # pass, we just fill in the data. The next time an + # entry-point with data is seen, self.initialized will be 1. + # On that pass we have to make that the new values match the + # valuse from the previous entry-point. + + parameters = [] + return_type = "void" + child = element.children + while child: + if child.type == "element": + if child.name == "return": + return_type = child.nsProp( "type", None ) + elif child.name == "param": + param = self.context.factory.create_item( "parameter", child, self.context) + parameters.append( param ) + + child = child.next + + + if self.initialized: + if self.return_type != return_type: + raise RuntimeError( "Return type changed in %s. Was %s, now %s." % (name, self.return_type, return_type)) + + if len(parameters) != len(self.parameters): + raise RuntimeError( "Parameter count mismatch in %s. Was %d, now %d." % (name, len(self.parameters), len(parameters))) + + for j in range(0, len(parameters)): + p1 = parameters[j] + p2 = self.parameters[j] + if not p1.compatible( p2 ): + raise RuntimeError( 'Parameter type mismatch in %s. "%s" was "%s", now "%s".' % (name, p2.name, p2.type_expr.original_string, p1.type_expr.original_string)) + + + if true_name == name or not self.initialized: + self.return_type = return_type + self.parameters = parameters + + for param in self.parameters: + if param.is_image(): + self.images.append( param ) + + if element.children: + self.initialized = 1 + self.parameter_strings[name] = create_parameter_string(parameters, 1) + else: + self.parameter_strings[name] = None + + return + + + def get_images(self): + """Return potentially empty list of input images.""" + return self.images + + + def parameterIterator(self): + return self.parameters.__iter__(); + + + def get_parameter_string(self, entrypoint = None): + if entrypoint: + s = self.parameter_strings[ entrypoint ] + if s: + return s + + return create_parameter_string( self.parameters, 1 ) + + def get_called_parameter_string(self): + p_string = "" + comma = "" + + for p in self.parameterIterator(): + p_string = p_string + comma + p.name + comma = ", " + + return p_string + + + def is_static_entry_point(self, name): + return name in self.static_entry_points + + def dispatch_name(self): + if self.name in self.static_entry_points: + return self.name + else: + return "_dispatch_stub_%u" % (self.offset) + + def static_name(self, name): + if name in self.static_entry_points: + return name + else: + return "_dispatch_stub_%u" % (self.offset) + + +class gl_item_factory: + """Factory to create objects derived from gl_item.""" + + def create_item(self, item_name, element, context): + if item_name == "function": + return gl_function(element, context) + if item_name == "type": + return gl_type(element, context) + elif item_name == "enum": + return gl_enum(element, context) + elif item_name == "parameter": + return gl_parameter(element, context) + elif item_name == "api": + return gl_api(self) + else: + return None + + +class gl_api: + def __init__(self, factory): + self.functions_by_name = {} + self.enums_by_name = {} + self.types_by_name = {} + + self.category_dict = {} + self.categories = [{}, {}, {}, {}] + + self.factory = factory + + self.next_offset = 0 + + typeexpr.create_initial_types() + return + + + def process_element(self, doc): + element = doc.children + while element.type != "element" or element.name != "OpenGLAPI": + element = element.next + + if element: + self.process_OpenGLAPI(element) + return + + + def process_OpenGLAPI(self, element): + child = element.children + while child: + if child.type == "element": + if child.name == "category": + self.process_category( child ) + elif child.name == "OpenGLAPI": + self.process_OpenGLAPI( child ) + + child = child.next + + return + + + def process_category(self, cat): + cat_name = cat.nsProp( "name", None ) + cat_number = cat.nsProp( "number", None ) + + [cat_type, key] = classify_category(cat_name, cat_number) + self.categories[cat_type][key] = [cat_name, cat_number] + + child = cat.children + while child: + if child.type == "element": + if child.name == "function": + func_name = real_function_name( child ) + + temp_name = child.nsProp( "name", None ) + self.category_dict[ temp_name ] = [cat_name, cat_number] + + if self.functions_by_name.has_key( func_name ): + func = self.functions_by_name[ func_name ] + func.process_element( child ) + else: + func = self.factory.create_item( "function", child, self ) + self.functions_by_name[ func_name ] = func + + if func.offset >= self.next_offset: + self.next_offset = func.offset + 1 + + + elif child.name == "enum": + enum = self.factory.create_item( "enum", child, self ) + self.enums_by_name[ enum.name ] = enum + elif child.name == "type": + t = self.factory.create_item( "type", child, self ) + self.types_by_name[ "GL" + t.name ] = t + + + child = child.next + + return + + + def functionIterateByCategory(self, cat = None): + """Iterate over functions by category. + + If cat is None, all known functions are iterated in category + order. See classify_category for details of the ordering. + Within a category, functions are sorted by name. If cat is + not None, then only functions in that category are iterated. + """ + lists = [{}, {}, {}, {}] + + for func in self.functionIterateAll(): + [cat_name, cat_number] = self.category_dict[func.name] + + if (cat == None) or (cat == cat_name): + [func_cat_type, key] = classify_category(cat_name, cat_number) + + if not lists[func_cat_type].has_key(key): + lists[func_cat_type][key] = {} + + lists[func_cat_type][key][func.name] = func + + + functions = [] + for func_cat_type in range(0,4): + keys = lists[func_cat_type].keys() + keys.sort() + + for key in keys: + names = lists[func_cat_type][key].keys() + names.sort() + + for name in names: + functions.append(lists[func_cat_type][key][name]) + + return functions.__iter__() + + + def functionIterateByOffset(self): + max_offset = -1 + for func in self.functions_by_name.itervalues(): + if func.offset > max_offset: + max_offset = func.offset + + + temp = [None for i in range(0, max_offset + 1)] + for func in self.functions_by_name.itervalues(): + if func.offset != -1: + temp[ func.offset ] = func + + + list = [] + for i in range(0, max_offset + 1): + if temp[i]: + list.append(temp[i]) + + return list.__iter__(); + + + def functionIterateAll(self): + return self.functions_by_name.itervalues() + + + def enumIterateByName(self): + keys = self.enums_by_name.keys() + keys.sort() + + list = [] + for enum in keys: + list.append( self.enums_by_name[ enum ] ) + + return list.__iter__() + + + def categoryIterate(self): + """Iterate over categories. + + Iterate over all known categories in the order specified by + classify_category. Each iterated value is a tuple of the + name and number (which may be None) of the category. + """ + + list = [] + for cat_type in range(0,4): + keys = self.categories[cat_type].keys() + keys.sort() + + for key in keys: + list.append(self.categories[cat_type][key]) + + return list.__iter__() + + + def get_category_for_name( self, name ): + if self.category_dict.has_key(name): + return self.category_dict[name] + else: + return ["", None] + + + def typeIterate(self): + return self.types_by_name.itervalues() + + + def find_type( self, type_name ): + if type_name in self.types_by_name: + return self.types_by_name[ type_name ].type_expr + else: + print "Unable to find base type matching \"%s\"." % (type_name) + return None --- mesa-glw-7.4.orig/src/mesa/glapi/Makefile +++ mesa-glw-7.4/src/mesa/glapi/Makefile @@ -0,0 +1,145 @@ +# This file isn't used during a normal compilation since we don't want to +# require Python in order to compile Mesa. +# Instead, when the Mesa developers update/change the API interface it's +# up to him/her to re-run this makefile and check in the newly generated files. + + +TOP = ../../.. +include $(TOP)/configs/current + +OUTPUTS = glprocs.h glapitemp.h glapioffsets.h glapitable.h dispatch.h \ + ../main/enums.c \ + ../x86/glapi_x86.S \ + ../x86-64/glapi_x86-64.S \ + ../sparc/glapi_sparc.S \ + ../drivers/dri/common/extension_helper.h \ + ../../glx/x11/indirect.c \ + ../../glx/x11/indirect.h \ + ../../glx/x11/indirect_init.c \ + ../../glx/x11/indirect_size.h \ + ../../glx/x11/indirect_size.c + + +GLX_DIR = $(XORG_BASE)/glx + +SERVER_GLAPI_FILES = \ + $(GLX_DIR)/glapi.h \ + $(GLX_DIR)/glapi.c \ + $(GLX_DIR)/glthread.c \ + $(GLX_DIR)/glthread.h + +SERVER_OUTPUTS = \ + $(GLX_DIR)/indirect_dispatch.c \ + $(GLX_DIR)/indirect_dispatch_swap.c \ + $(GLX_DIR)/indirect_dispatch.h \ + $(GLX_DIR)/indirect_reqsize.c \ + $(GLX_DIR)/indirect_reqsize.h \ + $(GLX_DIR)/indirect_size.h \ + $(GLX_DIR)/indirect_size_get.c \ + $(GLX_DIR)/indirect_size_get.h \ + $(GLX_DIR)/indirect_table.c \ + $(GLX_DIR)/glapitemp.h \ + $(GLX_DIR)/glapitable.h \ + $(GLX_DIR)/glapioffsets.h \ + $(GLX_DIR)/glprocs.h \ + $(GLX_DIR)/dispatch.h \ + $(SERVER_GLAPI_FILES) + +API_XML = gl_API.xml \ + EXT_framebuffer_object.xml \ + APPLE_vertex_array_object.xml + +COMMON = gl_XML.py glX_XML.py license.py $(API_XML) typeexpr.py +COMMON_GLX = $(COMMON) glX_API.xml glX_XML.py glX_proto_common.py + +all: check-xorg-source $(OUTPUTS) $(SERVER_OUTPUTS) + +check-xorg-source: + @if ! test -d $(GLX_DIR); then \ + echo "ERROR: Must specify path to xserver checkout; set XORG_BASE."; \ + exit 1; \ + fi + +$(GLX_DIR)/%.c: %.c + cp $< $@ + +$(GLX_DIR)/%.h: %.h + cp $< $@ + +glprocs.h $(GLX_DIR)/glprocs.h: gl_procs.py $(COMMON) + $(PYTHON2) $(PYTHON_FLAGS) $< > $@ + +glapitemp.h $(GLX_DIR)/glapitemp.h: gl_apitemp.py $(COMMON) + $(PYTHON2) $(PYTHON_FLAGS) $< > $@ + +glapioffsets.h $(GLX_DIR)/glapioffsets.h: gl_offsets.py $(COMMON) + $(PYTHON2) $(PYTHON_FLAGS) $< > $@ + +glapitable.h $(GLX_DIR)/glapitable.h: gl_table.py $(COMMON) + $(PYTHON2) $(PYTHON_FLAGS) $< > $@ + +dispatch.h $(GLX_DIR)/dispatch.h: gl_table.py $(COMMON) + $(PYTHON2) $(PYTHON_FLAGS) $< -m remap_table > $@ + +../main/enums.c: gl_enums.py $(COMMON) + $(PYTHON2) $(PYTHON_FLAGS) $< > $@ + +../x86/glapi_x86.S: gl_x86_asm.py $(COMMON) + $(PYTHON2) $(PYTHON_FLAGS) $< > $@ + +../x86-64/glapi_x86-64.S: gl_x86-64_asm.py $(COMMON) + $(PYTHON2) $(PYTHON_FLAGS) $< > $@ + +../sparc/glapi_sparc.S: gl_SPARC_asm.py $(COMMON) + $(PYTHON2) $(PYTHON_FLAGS) $< > $@ + + +../drivers/dri/common/extension_helper.h: extension_helper.py $(COMMON) + $(PYTHON2) $(PYTHON_FLAGS) $< > $@ + +../../glx/x11/indirect.c: glX_proto_send.py $(COMMON_GLX) + $(PYTHON2) $(PYTHON_FLAGS) $< -m proto | $(INDENT) $(INDENT_FLAGS) > $@ + +../../glx/x11/indirect.h: glX_proto_send.py $(COMMON_GLX) + $(PYTHON2) $(PYTHON_FLAGS) $< -m init_h > $@ + +../../glx/x11/indirect_init.c: glX_proto_send.py $(COMMON_GLX) + $(PYTHON2) $(PYTHON_FLAGS) $< -m init_c > $@ + +../../glx/x11/indirect_size.h $(GLX_DIR)/indirect_size.h: glX_proto_size.py $(COMMON_GLX) + $(PYTHON2) $(PYTHON_FLAGS) $< -m size_h --only-set -h _INDIRECT_SIZE_H_ \ + | $(INDENT) $(INDENT_FLAGS) > $@ + +../../glx/x11/indirect_size.c: glX_proto_size.py $(COMMON_GLX) + $(PYTHON2) $(PYTHON_FLAGS) $< -m size_c --only-set \ + | $(INDENT) $(INDENT_FLAGS) > $@ + +$(GLX_DIR)/indirect_dispatch.c: glX_proto_recv.py $(COMMON_GLX) + $(PYTHON2) $(PYTHON_FLAGS) $< -m dispatch_c > $@ + +$(GLX_DIR)/indirect_dispatch_swap.c: glX_proto_recv.py $(COMMON_GLX) + $(PYTHON2) $(PYTHON_FLAGS) $< -m dispatch_c -s > $@ + +$(GLX_DIR)/indirect_dispatch.h: glX_proto_recv.py gl_and_glX_API.xml $(COMMON_GLX) + $(PYTHON2) $(PYTHON_FLAGS) $< -m dispatch_h -f gl_and_glX_API.xml -s > $@ + +$(GLX_DIR)/indirect_size_get.h: glX_proto_size.py $(COMMON_GLX) + $(PYTHON2) $(PYTHON_FLAGS) $< -m size_h --only-get -h '_INDIRECT_SIZE_GET_H_' \ + | $(INDENT) $(INDENT_FLAGS) > $@ + +$(GLX_DIR)/indirect_size_get.c: glX_proto_size.py $(COMMON_GLX) + $(PYTHON2) $(PYTHON_FLAGS) $< -m size_c | $(INDENT) $(INDENT_FLAGS) > $@ + +$(GLX_DIR)/indirect_reqsize.h: glX_proto_size.py $(COMMON_GLX) + $(PYTHON2) $(PYTHON_FLAGS) $< -m reqsize_h --only-get -h '_INDIRECT_SIZE_GET_H_' \ + | $(INDENT) $(INDENT_FLAGS) -l200 > $@ + +$(GLX_DIR)/indirect_reqsize.c: glX_proto_size.py $(COMMON_GLX) + $(PYTHON2) $(PYTHON_FLAGS) $< -m reqsize_c | $(INDENT) $(INDENT_FLAGS) > $@ + +$(GLX_DIR)/indirect_table.c: glX_server_table.py gl_and_glX_API.xml $(COMMON_GLX) + $(PYTHON2) $(PYTHON_FLAGS) $< -f gl_and_glX_API.xml > $@ + +clean: + -rm -f *~ *.pyo + -rm -f $(OUTPUTS) --- mesa-glw-7.4.orig/src/mesa/glapi/gl_enums.py +++ mesa-glw-7.4/src/mesa/glapi/gl_enums.py @@ -0,0 +1,221 @@ +#!/usr/bin/python2 +# -*- Mode: Python; py-indent-offset: 8 -*- + +# (C) Copyright Zack Rusin 2005 +# All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# on the rights to use, copy, modify, merge, publish, distribute, sub +# license, and/or sell copies of the Software, and to permit persons to whom +# the Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the next +# paragraph) shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL +# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# Authors: +# Zack Rusin + +import license +import gl_XML +import sys, getopt + +class PrintGlEnums(gl_XML.gl_print_base): + + def __init__(self): + gl_XML.gl_print_base.__init__(self) + + self.name = "gl_enums.py (from Mesa)" + self.license = license.bsd_license_template % ( \ +"""Copyright (C) 1999-2005 Brian Paul All Rights Reserved.""", "BRIAN PAUL") + self.enum_table = {} + + + def printRealHeader(self): + print '#include "glheader.h"' + print '#include "enums.h"' + print '#include "imports.h"' + print '' + print 'typedef struct {' + print ' size_t offset;' + print ' int n;' + print '} enum_elt;' + print '' + return + + def print_code(self): + print """ +#define Elements(x) sizeof(x)/sizeof(*x) + +typedef int (*cfunc)(const void *, const void *); + +/** + * Compare a key name to an element in the \c all_enums array. + * + * \c bsearch always passes the key as the first parameter and the pointer + * to the array element as the second parameter. We can elimiate some + * extra work by taking advantage of that fact. + * + * \param a Pointer to the desired enum name. + * \param b Pointer to an element of the \c all_enums array. + */ +static int compar_name( const char *a, const enum_elt *b ) +{ + return _mesa_strcmp( a, & enum_string_table[ b->offset ] ); +} + +/** + * Compare a key enum value to an element in the \c all_enums array. + * + * \c bsearch always passes the key as the first parameter and the pointer + * to the array element as the second parameter. We can elimiate some + * extra work by taking advantage of that fact. + * + * \param a Pointer to the desired enum name. + * \param b Pointer to an index into the \c all_enums array. + */ +static int compar_nr( const int *a, const unsigned *b ) +{ + return a[0] - all_enums[*b].n; +} + + +static char token_tmp[20]; + +const char *_mesa_lookup_enum_by_nr( int nr ) +{ + unsigned * i; + + 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 ]; + } + else { + /* this is not re-entrant safe, no big deal here */ + _mesa_sprintf(token_tmp, "0x%x", nr); + return token_tmp; + } +} + +int _mesa_lookup_enum_by_name( const char *symbol ) +{ + enum_elt * f = NULL; + + if ( symbol != NULL ) { + f = (enum_elt *) _mesa_bsearch(symbol, all_enums, + Elements(all_enums), + sizeof( enum_elt ), + (cfunc) compar_name); + } + + return (f != NULL) ? f->n : -1; +} + +""" + return + + + def printBody(self, api): + self.process_enums( api ) + + keys = self.enum_table.keys() + keys.sort() + + name_table = [] + enum_table = {} + + for enum in keys: + low_pri = 9 + for [name, pri] in self.enum_table[ enum ]: + name_table.append( [name, enum] ) + + if pri < low_pri: + low_pri = pri + enum_table[enum] = name + + + name_table.sort() + + string_offsets = {} + i = 0; + print 'LONGSTRING static const char enum_string_table[] = ' + for [name, enum] in name_table: + print ' "%s\\0"' % (name) + string_offsets[ name ] = i + i += len(name) + 1 + + print ' ;' + print '' + + + print 'static const enum_elt all_enums[%u] =' % (len(name_table)) + print '{' + for [name, enum] in name_table: + print ' { %5u, 0x%08X }, /* %s */' % (string_offsets[name], enum, name) + print '};' + print '' + + print 'static const unsigned reduced_enums[%u] =' % (len(keys)) + print '{' + for enum in keys: + name = enum_table[ enum ] + if [name, enum] not in name_table: + print ' /* Error! %s, 0x%04x */ 0,' % (name, enum) + else: + i = name_table.index( [name, enum] ) + + print ' %4u, /* %s */' % (i, name) + print '};' + + + self.print_code() + return + + + def process_enums(self, api): + self.enum_table = {} + + for obj in api.enumIterateByName(): + if obj.value not in self.enum_table: + self.enum_table[ obj.value ] = [] + + + name = "GL_" + obj.name + priority = obj.priority() + self.enum_table[ obj.value ].append( [name, priority] ) + + +def show_usage(): + print "Usage: %s [-f input_file_name]" % sys.argv[0] + sys.exit(1) + +if __name__ == '__main__': + file_name = "gl_API.xml" + + try: + (args, trail) = getopt.getopt(sys.argv[1:], "f:") + except Exception,e: + show_usage() + + for (arg,val) in args: + if arg == "-f": + file_name = val + + api = gl_XML.parse_GL_API( file_name ) + + printer = PrintGlEnums() + printer.Print( api ) --- mesa-glw-7.4.orig/src/mesa/glapi/license.py +++ mesa-glw-7.4/src/mesa/glapi/license.py @@ -0,0 +1,47 @@ +# (C) Copyright IBM Corporation 2004 +# All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# on the rights to use, copy, modify, merge, publish, distribute, sub +# license, and/or sell copies of the Software, and to permit persons to whom +# the Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the next +# paragraph) shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL +# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# Authors: +# Ian Romanick + +bsd_license_template = """%s +All 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 +%s, +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.""" --- mesa-glw-7.4.orig/src/mesa/glapi/glX_proto_size.py +++ mesa-glw-7.4/src/mesa/glapi/glX_proto_size.py @@ -0,0 +1,704 @@ +#!/usr/bin/env python + +# (C) Copyright IBM Corporation 2004, 2005 +# All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# on the rights to use, copy, modify, merge, publish, distribute, sub +# license, and/or sell copies of the Software, and to permit persons to whom +# the Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the next +# paragraph) shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL +# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# Authors: +# Ian Romanick + +import gl_XML, glX_XML +import license +import sys, getopt, copy, string + + +class glx_enum_function: + def __init__(self, func_name, enum_dict): + self.name = func_name + self.mode = 1 + self.sig = None + + # "enums" is a set of lists. The element in the set is the + # value of the enum. The list is the list of names for that + # value. For example, [0x8126] = {"POINT_SIZE_MIN", + # "POINT_SIZE_MIN_ARB", "POINT_SIZE_MIN_EXT", + # "POINT_SIZE_MIN_SGIS"}. + + self.enums = {} + + # "count" is indexed by count values. Each element of count + # is a list of index to "enums" that have that number of + # associated data elements. For example, [4] = + # {GL_AMBIENT, GL_DIFFUSE, GL_SPECULAR, GL_EMISSION, + # GL_AMBIENT_AND_DIFFUSE} (the enum names are used here, + # but the actual hexadecimal values would be in the array). + + self.count = {} + + + # Fill self.count and self.enums using the dictionary of enums + # that was passed in. The generic Get functions (e.g., + # GetBooleanv and friends) are handled specially here. In + # the data the generic Get functions are refered to as "Get". + + if func_name in ["GetIntegerv", "GetBooleanv", "GetFloatv", "GetDoublev"]: + match_name = "Get" + else: + match_name = func_name + + mode_set = 0 + for enum_name in enum_dict: + e = enum_dict[ enum_name ] + + if e.functions.has_key( match_name ): + [count, mode] = e.functions[ match_name ] + + if mode_set and mode != self.mode: + raise RuntimeError("Not all enums for %s have the same mode." % (func_name)) + + self.mode = mode + + if self.enums.has_key( e.value ): + if e.name not in self.enums[ e.value ]: + self.enums[ e.value ].append( e ) + else: + if not self.count.has_key( count ): + self.count[ count ] = [] + + self.enums[ e.value ] = [ e ] + self.count[ count ].append( e.value ) + + + return + + + def signature( self ): + if self.sig == None: + self.sig = "" + for i in self.count: + if i == None: + raise RuntimeError("i is None. WTF?") + + self.count[i].sort() + for e in self.count[i]: + self.sig += "%04x,%d," % (e, i) + + return self.sig + + + def is_set( self ): + return self.mode + + + def PrintUsingTable(self): + """Emit the body of the __gl*_size function using a pair + of look-up tables and a mask. The mask is calculated such + that (e & mask) is unique for all the valid values of e for + this function. The result of (e & mask) is used as an index + into the first look-up table. If it matches e, then the + same entry of the second table is returned. Otherwise zero + is returned. + + It seems like this should cause better code to be generated. + However, on x86 at least, the resulting .o file is about 20% + larger then the switch-statment version. I am leaving this + code in because the results may be different on other + platforms (e.g., PowerPC or x86-64).""" + + return 0 + count = 0 + for a in self.enums: + count += 1 + + if self.count.has_key(-1): + return 0 + + # Determine if there is some mask M, such that M = (2^N) - 1, + # that will generate unique values for all of the enums. + + mask = 0 + for i in [1, 2, 3, 4, 5, 6, 7, 8]: + mask = (1 << i) - 1 + + fail = 0; + for a in self.enums: + for b in self.enums: + if a != b: + if (a & mask) == (b & mask): + fail = 1; + + if not fail: + break; + else: + mask = 0 + + if (mask != 0) and (mask < (2 * count)): + masked_enums = {} + masked_count = {} + + for i in range(0, mask + 1): + masked_enums[i] = "0"; + masked_count[i] = 0; + + for c in self.count: + for e in self.count[c]: + i = e & mask + enum_obj = self.enums[e][0] + masked_enums[i] = '0x%04x /* %s */' % (e, enum_obj.name ) + masked_count[i] = c + + + print ' static const GLushort a[%u] = {' % (mask + 1) + for e in masked_enums: + print ' %s, ' % (masked_enums[e]) + print ' };' + + print ' static const GLubyte b[%u] = {' % (mask + 1) + for c in masked_count: + print ' %u, ' % (masked_count[c]) + print ' };' + + print ' const unsigned idx = (e & 0x%02xU);' % (mask) + print '' + print ' return (e == a[idx]) ? (GLint) b[idx] : 0;' + return 1; + else: + return 0; + + + def PrintUsingSwitch(self, name): + """Emit the body of the __gl*_size function using a + switch-statement.""" + + print ' switch( e ) {' + + for c in self.count: + for e in self.count[c]: + first = 1 + + # There may be multiple enums with the same + # value. This happens has extensions are + # promoted from vendor-specific or EXT to + # ARB and to the core. Emit the first one as + # a case label, and emit the others as + # commented-out case labels. + + list = {} + for enum_obj in self.enums[e]: + list[ enum_obj.priority() ] = enum_obj.name + + keys = list.keys() + keys.sort() + for k in keys: + j = list[k] + if first: + print ' case GL_%s:' % (j) + first = 0 + else: + print '/* case GL_%s:*/' % (j) + + if c == -1: + print ' return __gl%s_variable_size( e );' % (name) + else: + print ' return %u;' % (c) + + print ' default: return 0;' + print ' }' + + + def Print(self, name): + print 'INTERNAL PURE FASTCALL GLint' + print '__gl%s_size( GLenum e )' % (name) + print '{' + + if not self.PrintUsingTable(): + self.PrintUsingSwitch(name) + + print '}' + print '' + + +class glx_server_enum_function(glx_enum_function): + def __init__(self, func, enum_dict): + glx_enum_function.__init__(self, func.name, enum_dict) + + self.function = func + return + + + def signature( self ): + if self.sig == None: + sig = glx_enum_function.signature(self) + + p = self.function.variable_length_parameter() + if p: + sig += "%u" % (p.size()) + + self.sig = sig + + return self.sig; + + + def Print(self, name, printer): + f = self.function + printer.common_func_print_just_header( f ) + + fixup = [] + + foo = {} + for param_name in f.count_parameter_list: + o = f.offset_of( param_name ) + foo[o] = param_name + + for param_name in f.counter_list: + o = f.offset_of( param_name ) + foo[o] = param_name + + keys = foo.keys() + keys.sort() + for o in keys: + p = f.parameters_by_name[ foo[o] ] + + printer.common_emit_one_arg(p, "pc", 0) + fixup.append( p.name ) + + + print ' GLsizei compsize;' + print '' + + printer.common_emit_fixups(fixup) + + print '' + print ' compsize = __gl%s_size(%s);' % (f.name, string.join(f.count_parameter_list, ",")) + p = f.variable_length_parameter() + print ' return __GLX_PAD(%s);' % (p.size_string()) + + print '}' + print '' + + +class PrintGlxSizeStubs_common(gl_XML.gl_print_base): + do_get = (1 << 0) + do_set = (1 << 1) + + def __init__(self, which_functions): + gl_XML.gl_print_base.__init__(self) + + self.name = "glX_proto_size.py (from Mesa)" + self.license = license.bsd_license_template % ( "(C) Copyright IBM Corporation 2004", "IBM") + + self.emit_set = ((which_functions & PrintGlxSizeStubs_common.do_set) != 0) + self.emit_get = ((which_functions & PrintGlxSizeStubs_common.do_get) != 0) + return + + +class PrintGlxSizeStubs_c(PrintGlxSizeStubs_common): + def printRealHeader(self): + print '' + print '#include ' + if self.emit_get: + print '#include "indirect_size_get.h"' + print '#include "glxserver.h"' + print '#include "indirect_util.h"' + + print '#include "indirect_size.h"' + + print '' + self.printPure() + print '' + self.printFastcall() + print '' + self.printVisibility( "INTERNAL", "internal" ) + print '' + print '' + print '#if defined(__CYGWIN__) || defined(__MINGW32__) || defined(__APPLE__)' + print '# undef HAVE_ALIAS' + print '#endif' + print '#ifdef HAVE_ALIAS' + print '# define ALIAS2(from,to) \\' + print ' INTERNAL PURE FASTCALL GLint __gl ## from ## _size( GLenum e ) \\' + print ' __attribute__ ((alias( # to )));' + print '# define ALIAS(from,to) ALIAS2( from, __gl ## to ## _size )' + print '#else' + print '# define ALIAS(from,to) \\' + print ' INTERNAL PURE FASTCALL GLint __gl ## from ## _size( GLenum e ) \\' + print ' { return __gl ## to ## _size( e ); }' + print '#endif' + print '' + print '' + + + def printBody(self, api): + enum_sigs = {} + aliases = [] + + for func in api.functionIterateGlx(): + ef = glx_enum_function( func.name, api.enums_by_name ) + if len(ef.enums) == 0: + continue + + if (ef.is_set() and self.emit_set) or (not ef.is_set() and self.emit_get): + sig = ef.signature() + if enum_sigs.has_key( sig ): + aliases.append( [func.name, enum_sigs[ sig ]] ) + else: + enum_sigs[ sig ] = func.name + ef.Print( func.name ) + + + for [alias_name, real_name] in aliases: + print 'ALIAS( %s, %s )' % (alias_name, real_name) + + + +class PrintGlxSizeStubs_h(PrintGlxSizeStubs_common): + def printRealHeader(self): + print """/** + * \\file + * Prototypes for functions used to determine the number of data elements in + * various GLX protocol messages. + * + * \\author Ian Romanick + */ +""" + self.printPure(); + print '' + self.printFastcall(); + print '' + self.printVisibility( "INTERNAL", "internal" ); + print '' + + + def printBody(self, api): + for func in api.functionIterateGlx(): + ef = glx_enum_function( func.name, api.enums_by_name ) + if len(ef.enums) == 0: + continue + + if (ef.is_set() and self.emit_set) or (not ef.is_set() and self.emit_get): + print 'extern INTERNAL PURE FASTCALL GLint __gl%s_size(GLenum);' % (func.name) + + +class PrintGlxReqSize_common(gl_XML.gl_print_base): + """Common base class for PrintGlxSizeReq_h and PrintGlxSizeReq_h. + + The main purpose of this common base class is to provide the infrastructure + for the derrived classes to iterate over the same set of functions. + """ + + def __init__(self): + gl_XML.gl_print_base.__init__(self) + + self.name = "glX_proto_size.py (from Mesa)" + self.license = license.bsd_license_template % ( "(C) Copyright IBM Corporation 2005", "IBM") + + +class PrintGlxReqSize_h(PrintGlxReqSize_common): + def __init__(self): + PrintGlxReqSize_common.__init__(self) + self.header_tag = "_INDIRECT_REQSIZE_H_" + + + def printRealHeader(self): + self.printVisibility("HIDDEN", "hidden") + print '' + self.printPure() + print '' + + + def printBody(self, api): + for func in api.functionIterateGlx(): + if not func.ignore and func.has_variable_size_request(): + print 'extern PURE HIDDEN int __glX%sReqSize(const GLbyte *pc, Bool swap);' % (func.name) + + +class PrintGlxReqSize_c(PrintGlxReqSize_common): + """Create the server-side 'request size' functions. + + Create the server-side functions that are used to determine what the + size of a varible length command should be. The server then uses + this value to determine if the incoming command packed it malformed. + """ + + def __init__(self): + PrintGlxReqSize_common.__init__(self) + self.counter_sigs = {} + + + def printRealHeader(self): + print '' + print '#include ' + print '#include "glxserver.h"' + print '#include "glxbyteorder.h"' + print '#include "indirect_size.h"' + print '#include "indirect_reqsize.h"' + print '' + print '#define __GLX_PAD(x) (((x) + 3) & ~3)' + print '' + print '#if defined(__CYGWIN__) || defined(__MINGW32__)' + print '# undef HAVE_ALIAS' + print '#endif' + print '#ifdef HAVE_ALIAS' + print '# define ALIAS2(from,to) \\' + print ' GLint __glX ## from ## ReqSize( const GLbyte * pc, Bool swap ) \\' + print ' __attribute__ ((alias( # to )));' + print '# define ALIAS(from,to) ALIAS2( from, __glX ## to ## ReqSize )' + print '#else' + print '# define ALIAS(from,to) \\' + print ' GLint __glX ## from ## ReqSize( const GLbyte * pc, Bool swap ) \\' + print ' { return __glX ## to ## ReqSize( pc, swap ); }' + print '#endif' + print '' + print '' + + + def printBody(self, api): + aliases = [] + enum_functions = {} + enum_sigs = {} + + for func in api.functionIterateGlx(): + if not func.has_variable_size_request(): continue + + ef = glx_server_enum_function( func, api.enums_by_name ) + if len(ef.enums) == 0: continue + + sig = ef.signature() + + if not enum_functions.has_key(func.name): + enum_functions[ func.name ] = sig + + if not enum_sigs.has_key( sig ): + enum_sigs[ sig ] = ef + + + + for func in api.functionIterateGlx(): + # Even though server-handcode fuctions are on "the + # list", and prototypes are generated for them, there + # isn't enough information to generate a size + # function. If there was enough information, they + # probably wouldn't need to be handcoded in the first + # place! + + if func.server_handcode: continue + if not func.has_variable_size_request(): continue + + if enum_functions.has_key(func.name): + sig = enum_functions[func.name] + ef = enum_sigs[ sig ] + + if ef.name != func.name: + aliases.append( [func.name, ef.name] ) + else: + ef.Print( func.name, self ) + + elif func.images: + self.printPixelFunction(func) + elif func.has_variable_size_request(): + a = self.printCountedFunction(func) + if a: aliases.append(a) + + + for [alias_name, real_name] in aliases: + print 'ALIAS( %s, %s )' % (alias_name, real_name) + + return + + + def common_emit_fixups(self, fixup): + """Utility function to emit conditional byte-swaps.""" + + if fixup: + print ' if (swap) {' + for name in fixup: + print ' %s = bswap_32(%s);' % (name, name) + print ' }' + + return + + + def common_emit_one_arg(self, p, pc, adjust): + offset = p.offset + dst = p.string() + src = '(%s *)' % (p.type_string()) + print '%-18s = *%11s(%s + %u);' % (dst, src, pc, offset + adjust); + return + + + def common_func_print_just_header(self, f): + print 'int' + print '__glX%sReqSize( const GLbyte * pc, Bool swap )' % (f.name) + print '{' + + + def printPixelFunction(self, f): + self.common_func_print_just_header(f) + + f.offset_of( f.parameters[0].name ) + [dim, w, h, d, junk] = f.get_images()[0].get_dimensions() + + print ' GLint row_length = * (GLint *)(pc + 4);' + + if dim < 3: + fixup = ['row_length', 'skip_rows', 'alignment'] + print ' GLint image_height = 0;' + print ' GLint skip_images = 0;' + print ' GLint skip_rows = * (GLint *)(pc + 8);' + print ' GLint alignment = * (GLint *)(pc + 16);' + else: + fixup = ['row_length', 'image_height', 'skip_rows', 'skip_images', 'alignment'] + print ' GLint image_height = * (GLint *)(pc + 8);' + print ' GLint skip_rows = * (GLint *)(pc + 16);' + print ' GLint skip_images = * (GLint *)(pc + 20);' + print ' GLint alignment = * (GLint *)(pc + 32);' + + img = f.images[0] + for p in f.parameterIterateGlxSend(): + if p.name in [w, h, d, img.img_format, img.img_type, img.img_target]: + self.common_emit_one_arg(p, "pc", 0) + fixup.append( p.name ) + + print '' + + self.common_emit_fixups(fixup) + + if img.img_null_flag: + print '' + print ' if (*(CARD32 *) (pc + %s))' % (img.offset - 4) + print ' return 0;' + + print '' + print ' return __glXImageSize(%s, %s, %s, %s, %s, %s,' % (img.img_format, img.img_type, img.img_target, w, h, d ) + print ' image_height, row_length, skip_images,' + print ' skip_rows, alignment);' + print '}' + print '' + return + + + def printCountedFunction(self, f): + + sig = "" + offset = 0 + fixup = [] + params = [] + plus = '' + size = '' + param_offsets = {} + + # Calculate the offset of each counter parameter and the + # size string for the variable length parameter(s). While + # that is being done, calculate a unique signature for this + # function. + + for p in f.parameterIterateGlxSend(): + if p.is_counter: + fixup.append( p.name ) + params.append( p ) + elif p.counter: + s = p.size() + if s == 0: s = 1 + + sig += "(%u,%u)" % (f.offset_of(p.counter), s) + size += '%s%s' % (plus, p.size_string()) + plus = ' + ' + + + # If the calculated signature matches a function that has + # already be emitted, don't emit this function. Instead, add + # it to the list of function aliases. + + if self.counter_sigs.has_key(sig): + n = self.counter_sigs[sig]; + alias = [f.name, n] + else: + alias = None + self.counter_sigs[sig] = f.name + + self.common_func_print_just_header(f) + + for p in params: + self.common_emit_one_arg(p, "pc", 0) + + + print '' + self.common_emit_fixups(fixup) + print '' + + print ' return __GLX_PAD(%s);' % (size) + print '}' + print '' + + return alias + + +def show_usage(): + print "Usage: %s [-f input_file_name] -m output_mode [--only-get | --only-set] [--get-alias-set]" % sys.argv[0] + print " -m output_mode Output mode can be one of 'size_c' or 'size_h'." + print " --only-get Only emit 'get'-type functions." + print " --only-set Only emit 'set'-type functions." + print "" + print "By default, both 'get' and 'set'-type functions are emitted." + sys.exit(1) + + +if __name__ == '__main__': + file_name = "gl_API.xml" + + try: + (args, trail) = getopt.getopt(sys.argv[1:], "f:m:h:", ["only-get", "only-set", "header-tag"]) + except Exception,e: + show_usage() + + mode = None + header_tag = None + which_functions = PrintGlxSizeStubs_common.do_get | PrintGlxSizeStubs_common.do_set + + for (arg,val) in args: + if arg == "-f": + file_name = val + elif arg == "-m": + mode = val + elif arg == "--only-get": + which_functions = PrintGlxSizeStubs_common.do_get + elif arg == "--only-set": + which_functions = PrintGlxSizeStubs_common.do_set + elif (arg == '-h') or (arg == "--header-tag"): + header_tag = val + + if mode == "size_c": + printer = PrintGlxSizeStubs_c( which_functions ) + elif mode == "size_h": + printer = PrintGlxSizeStubs_h( which_functions ) + if header_tag: + printer.header_tag = header_tag + elif mode == "reqsize_c": + printer = PrintGlxReqSize_c() + elif mode == "reqsize_h": + printer = PrintGlxReqSize_h() + else: + show_usage() + + api = gl_XML.parse_GL_API( file_name, glX_XML.glx_item_factory() ) + + + printer.Print( api ) --- mesa-glw-7.4.orig/src/mesa/glapi/glX_proto_common.py +++ mesa-glw-7.4/src/mesa/glapi/glX_proto_common.py @@ -0,0 +1,95 @@ +#!/usr/bin/env python + +# (C) Copyright IBM Corporation 2004, 2005 +# All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# on the rights to use, copy, modify, merge, publish, distribute, sub +# license, and/or sell copies of the Software, and to permit persons to whom +# the Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the next +# paragraph) shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL +# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# Authors: +# Ian Romanick + +import gl_XML, glX_XML +import string + + +class glx_proto_item_factory(glX_XML.glx_item_factory): + """Factory to create GLX protocol oriented objects derived from gl_item.""" + + def create_item(self, name, element, context): + if name == "type": + return glx_proto_type(element, context) + else: + return glX_XML.glx_item_factory.create_item(self, name, element, context) + + +class glx_proto_type(gl_XML.gl_type): + def __init__(self, element, context): + gl_XML.gl_type.__init__(self, element, context) + + self.glx_name = element.nsProp( "glx_name", None ) + return + + +class glx_print_proto(gl_XML.gl_print_base): + def size_call(self, func, outputs_also = 0): + """Create C code to calculate 'compsize'. + + Creates code to calculate 'compsize'. If the function does + not need 'compsize' to be calculated, None will be + returned.""" + + compsize = None + + for param in func.parameterIterator(): + if outputs_also or not param.is_output: + if param.is_image(): + [dim, w, h, d, junk] = param.get_dimensions() + + compsize = '__glImageSize(%s, %s, %s, %s, %s, %s)' % (w, h, d, param.img_format, param.img_type, param.img_target) + if not param.img_send_null: + compsize = '(%s != NULL) ? %s : 0' % (param.name, compsize) + + return compsize + + elif len(param.count_parameter_list): + parameters = string.join( param.count_parameter_list, "," ) + compsize = "__gl%s_size(%s)" % (func.name, parameters) + + return compsize + + return None + + + def emit_packet_size_calculation(self, f, bias): + # compsize is only used in the command size calculation if + # the function has a non-output parameter that has a non-empty + # counter_parameter_list. + + compsize = self.size_call(f) + if compsize: + print ' const GLuint compsize = %s;' % (compsize) + + if bias: + print ' const GLuint cmdlen = %s - %u;' % (f.command_length(), bias) + else: + print ' const GLuint cmdlen = %s;' % (f.command_length()) + + #print '' + return compsize --- mesa-glw-7.4.orig/src/mesa/main/get_gen.py +++ mesa-glw-7.4/src/mesa/main/get_gen.py @@ -0,0 +1,1215 @@ +#!/usr/bin/env python + +# Mesa 3-D graphics library +# +# Copyright (C) 1999-2006 Brian Paul All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +# This script is used to generate the get.c file: +# python get_gen.py > get.c + + +import string + + +GLint = 1 +GLenum = 2 +GLfloat = 3 +GLdouble = 4 +GLboolean = 5 +GLfloatN = 6 # A normalized value, such as a color or depth range + + +TypeStrings = { + GLint : "GLint", + GLenum : "GLenum", + GLfloat : "GLfloat", + GLdouble : "GLdouble", + GLboolean : "GLboolean" +} + + +# Each entry is a tuple of: +# - 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. If present, "CONVERSION" will be +# replaced by ENUM_TO_FLOAT, INT_TO_FLOAT, etc. +# - optional extensions to check, or None +# +StateVars = [ + ( "GL_ACCUM_RED_BITS", GLint, ["ctx->DrawBuffer->Visual.accumRedBits"], + "", None ), + ( "GL_ACCUM_GREEN_BITS", GLint, ["ctx->DrawBuffer->Visual.accumGreenBits"], + "", None ), + ( "GL_ACCUM_BLUE_BITS", GLint, ["ctx->DrawBuffer->Visual.accumBlueBits"], + "", None ), + ( "GL_ACCUM_ALPHA_BITS", GLint, ["ctx->DrawBuffer->Visual.accumAlphaBits"], + "", None ), + ( "GL_ACCUM_CLEAR_VALUE", GLfloatN, + [ "ctx->Accum.ClearColor[0]", + "ctx->Accum.ClearColor[1]", + "ctx->Accum.ClearColor[2]", + "ctx->Accum.ClearColor[3]" ], + "", None ), + ( "GL_ALPHA_BIAS", GLfloat, ["ctx->Pixel.AlphaBias"], "", None ), + ( "GL_ALPHA_BITS", GLint, ["ctx->DrawBuffer->Visual.alphaBits"], + "", None ), + ( "GL_ALPHA_SCALE", GLfloat, ["ctx->Pixel.AlphaScale"], "", None ), + ( "GL_ALPHA_TEST", GLboolean, ["ctx->Color.AlphaEnabled"], "", None ), + ( "GL_ALPHA_TEST_FUNC", GLenum, ["ctx->Color.AlphaFunc"], "", None ), + ( "GL_ALPHA_TEST_REF", GLfloatN, ["ctx->Color.AlphaRef"], "", None ), + ( "GL_ATTRIB_STACK_DEPTH", GLint, ["ctx->AttribStackDepth"], "", None ), + ( "GL_AUTO_NORMAL", GLboolean, ["ctx->Eval.AutoNormal"], "", None ), + ( "GL_AUX_BUFFERS", GLint, ["ctx->DrawBuffer->Visual.numAuxBuffers"], + "", None ), + ( "GL_BLEND", GLboolean, ["ctx->Color.BlendEnabled"], "", None ), + ( "GL_BLEND_DST", GLenum, ["ctx->Color.BlendDstRGB"], "", None ), + ( "GL_BLEND_SRC", GLenum, ["ctx->Color.BlendSrcRGB"], "", None ), + ( "GL_BLEND_SRC_RGB_EXT", GLenum, ["ctx->Color.BlendSrcRGB"], "", None ), + ( "GL_BLEND_DST_RGB_EXT", GLenum, ["ctx->Color.BlendDstRGB"], "", None ), + ( "GL_BLEND_SRC_ALPHA_EXT", GLenum, ["ctx->Color.BlendSrcA"], "", None ), + ( "GL_BLEND_DST_ALPHA_EXT", GLenum, ["ctx->Color.BlendDstA"], "", None ), + ( "GL_BLEND_EQUATION", GLenum, ["ctx->Color.BlendEquationRGB "], "", None), + ( "GL_BLEND_EQUATION_ALPHA_EXT", GLenum, ["ctx->Color.BlendEquationA "], + "", None ), + ( "GL_BLEND_COLOR_EXT", GLfloatN, + [ "ctx->Color.BlendColor[0]", + "ctx->Color.BlendColor[1]", + "ctx->Color.BlendColor[2]", + "ctx->Color.BlendColor[3]"], "", None ), + ( "GL_BLUE_BIAS", GLfloat, ["ctx->Pixel.BlueBias"], "", None ), + ( "GL_BLUE_BITS", GLint, ["ctx->DrawBuffer->Visual.blueBits"], "", None ), + ( "GL_BLUE_SCALE", GLfloat, ["ctx->Pixel.BlueScale"], "", None ), + ( "GL_CLIENT_ATTRIB_STACK_DEPTH", GLint, + ["ctx->ClientAttribStackDepth"], "", None ), + ( "GL_CLIP_PLANE0", GLboolean, + [ "(ctx->Transform.ClipPlanesEnabled >> 0) & 1" ], "", None ), + ( "GL_CLIP_PLANE1", GLboolean, + [ "(ctx->Transform.ClipPlanesEnabled >> 1) & 1" ], "", None ), + ( "GL_CLIP_PLANE2", GLboolean, + [ "(ctx->Transform.ClipPlanesEnabled >> 2) & 1" ], "", None ), + ( "GL_CLIP_PLANE3", GLboolean, + [ "(ctx->Transform.ClipPlanesEnabled >> 3) & 1" ], "", None ), + ( "GL_CLIP_PLANE4", GLboolean, + [ "(ctx->Transform.ClipPlanesEnabled >> 4) & 1" ], "", None ), + ( "GL_CLIP_PLANE5", GLboolean, + [ "(ctx->Transform.ClipPlanesEnabled >> 5) & 1" ], "", None ), + ( "GL_COLOR_CLEAR_VALUE", GLfloatN, + [ "ctx->Color.ClearColor[0]", + "ctx->Color.ClearColor[1]", + "ctx->Color.ClearColor[2]", + "ctx->Color.ClearColor[3]" ], "", None ), + ( "GL_COLOR_MATERIAL", GLboolean, + ["ctx->Light.ColorMaterialEnabled"], "", None ), + ( "GL_COLOR_MATERIAL_FACE", GLenum, + ["ctx->Light.ColorMaterialFace"], "", None ), + ( "GL_COLOR_MATERIAL_PARAMETER", GLenum, + ["ctx->Light.ColorMaterialMode"], "", None ), + ( "GL_COLOR_WRITEMASK", GLint, + [ "ctx->Color.ColorMask[RCOMP] ? 1 : 0", + "ctx->Color.ColorMask[GCOMP] ? 1 : 0", + "ctx->Color.ColorMask[BCOMP] ? 1 : 0", + "ctx->Color.ColorMask[ACOMP] ? 1 : 0" ], "", None ), + ( "GL_CULL_FACE", GLboolean, ["ctx->Polygon.CullFlag"], "", None ), + ( "GL_CULL_FACE_MODE", GLenum, ["ctx->Polygon.CullFaceMode"], "", None ), + ( "GL_CURRENT_COLOR", GLfloatN, + [ "ctx->Current.Attrib[VERT_ATTRIB_COLOR0][0]", + "ctx->Current.Attrib[VERT_ATTRIB_COLOR0][1]", + "ctx->Current.Attrib[VERT_ATTRIB_COLOR0][2]", + "ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3]" ], + "FLUSH_CURRENT(ctx, 0);", None ), + ( "GL_CURRENT_INDEX", GLfloat, + [ "ctx->Current.Attrib[VERT_ATTRIB_COLOR_INDEX][0]" ], + "FLUSH_CURRENT(ctx, 0);", None ), + ( "GL_CURRENT_NORMAL", GLfloatN, + [ "ctx->Current.Attrib[VERT_ATTRIB_NORMAL][0]", + "ctx->Current.Attrib[VERT_ATTRIB_NORMAL][1]", + "ctx->Current.Attrib[VERT_ATTRIB_NORMAL][2]"], + "FLUSH_CURRENT(ctx, 0);", None ), + ( "GL_CURRENT_RASTER_COLOR", GLfloatN, + ["ctx->Current.RasterColor[0]", + "ctx->Current.RasterColor[1]", + "ctx->Current.RasterColor[2]", + "ctx->Current.RasterColor[3]"], "", None ), + ( "GL_CURRENT_RASTER_DISTANCE", GLfloat, + ["ctx->Current.RasterDistance"], "", None ), + ( "GL_CURRENT_RASTER_INDEX", GLfloat, + ["ctx->Current.RasterIndex"], "", None ), + ( "GL_CURRENT_RASTER_POSITION", GLfloat, + ["ctx->Current.RasterPos[0]", + "ctx->Current.RasterPos[1]", + "ctx->Current.RasterPos[2]", + "ctx->Current.RasterPos[3]"], "", None ), + ( "GL_CURRENT_RASTER_SECONDARY_COLOR", GLfloatN, + ["ctx->Current.RasterSecondaryColor[0]", + "ctx->Current.RasterSecondaryColor[1]", + "ctx->Current.RasterSecondaryColor[2]", + "ctx->Current.RasterSecondaryColor[3]"], "", None ), + ( "GL_CURRENT_RASTER_TEXTURE_COORDS", GLfloat, + ["ctx->Current.RasterTexCoords[texUnit][0]", + "ctx->Current.RasterTexCoords[texUnit][1]", + "ctx->Current.RasterTexCoords[texUnit][2]", + "ctx->Current.RasterTexCoords[texUnit][3]"], + "const GLuint texUnit = ctx->Texture.CurrentUnit;", None ), + ( "GL_CURRENT_RASTER_POSITION_VALID", GLboolean, + ["ctx->Current.RasterPosValid"], "", None ), + ( "GL_CURRENT_TEXTURE_COORDS", GLfloat, + ["ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][0]", + "ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][1]", + "ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][2]", + "ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][3]"], + "const GLuint texUnit = ctx->Texture.CurrentUnit;", None ), + ( "GL_DEPTH_BIAS", GLfloat, ["ctx->Pixel.DepthBias"], "", None ), + ( "GL_DEPTH_BITS", GLint, ["ctx->DrawBuffer->Visual.depthBits"], + "", None ), + ( "GL_DEPTH_CLEAR_VALUE", GLfloatN, ["((GLfloat) ctx->Depth.Clear)"], "", None ), + ( "GL_DEPTH_FUNC", GLenum, ["ctx->Depth.Func"], "", None ), + ( "GL_DEPTH_RANGE", GLfloatN, + [ "ctx->Viewport.Near", "ctx->Viewport.Far" ], "", None ), + ( "GL_DEPTH_SCALE", GLfloat, ["ctx->Pixel.DepthScale"], "", None ), + ( "GL_DEPTH_TEST", GLboolean, ["ctx->Depth.Test"], "", None ), + ( "GL_DEPTH_WRITEMASK", GLboolean, ["ctx->Depth.Mask"], "", None ), + ( "GL_DITHER", GLboolean, ["ctx->Color.DitherFlag"], "", None ), + ( "GL_DOUBLEBUFFER", GLboolean, + ["ctx->DrawBuffer->Visual.doubleBufferMode"], "", None ), + ( "GL_DRAW_BUFFER", GLenum, ["ctx->DrawBuffer->ColorDrawBuffer[0]"], "", None ), + ( "GL_EDGE_FLAG", GLboolean, ["(ctx->Current.Attrib[VERT_ATTRIB_EDGEFLAG][0] == 1.0)"], + "FLUSH_CURRENT(ctx, 0);", None ), + ( "GL_FEEDBACK_BUFFER_SIZE", GLint, ["ctx->Feedback.BufferSize"], "", None ), + ( "GL_FEEDBACK_BUFFER_TYPE", GLenum, ["ctx->Feedback.Type"], "", None ), + ( "GL_FOG", GLboolean, ["ctx->Fog.Enabled"], "", None ), + ( "GL_FOG_COLOR", GLfloatN, + [ "ctx->Fog.Color[0]", + "ctx->Fog.Color[1]", + "ctx->Fog.Color[2]", + "ctx->Fog.Color[3]" ], "", None ), + ( "GL_FOG_DENSITY", GLfloat, ["ctx->Fog.Density"], "", None ), + ( "GL_FOG_END", GLfloat, ["ctx->Fog.End"], "", None ), + ( "GL_FOG_HINT", GLenum, ["ctx->Hint.Fog"], "", None ), + ( "GL_FOG_INDEX", GLfloat, ["ctx->Fog.Index"], "", None ), + ( "GL_FOG_MODE", GLenum, ["ctx->Fog.Mode"], "", None ), + ( "GL_FOG_START", GLfloat, ["ctx->Fog.Start"], "", None ), + ( "GL_FRONT_FACE", GLenum, ["ctx->Polygon.FrontFace"], "", None ), + ( "GL_GREEN_BIAS", GLfloat, ["ctx->Pixel.GreenBias"], "", None ), + ( "GL_GREEN_BITS", GLint, ["ctx->DrawBuffer->Visual.greenBits"], + "", None ), + ( "GL_GREEN_SCALE", GLfloat, ["ctx->Pixel.GreenScale"], "", None ), + ( "GL_INDEX_BITS", GLint, ["ctx->DrawBuffer->Visual.indexBits"], + "", None ), + ( "GL_INDEX_CLEAR_VALUE", GLint, ["ctx->Color.ClearIndex"], "", None ), + ( "GL_INDEX_MODE", GLboolean, ["!ctx->DrawBuffer->Visual.rgbMode"], + "", None ), + ( "GL_INDEX_OFFSET", GLint, ["ctx->Pixel.IndexOffset"], "", None ), + ( "GL_INDEX_SHIFT", GLint, ["ctx->Pixel.IndexShift"], "", None ), + ( "GL_INDEX_WRITEMASK", GLint, ["ctx->Color.IndexMask"], "", None ), + ( "GL_LIGHT0", GLboolean, ["ctx->Light.Light[0].Enabled"], "", None ), + ( "GL_LIGHT1", GLboolean, ["ctx->Light.Light[1].Enabled"], "", None ), + ( "GL_LIGHT2", GLboolean, ["ctx->Light.Light[2].Enabled"], "", None ), + ( "GL_LIGHT3", GLboolean, ["ctx->Light.Light[3].Enabled"], "", None ), + ( "GL_LIGHT4", GLboolean, ["ctx->Light.Light[4].Enabled"], "", None ), + ( "GL_LIGHT5", GLboolean, ["ctx->Light.Light[5].Enabled"], "", None ), + ( "GL_LIGHT6", GLboolean, ["ctx->Light.Light[6].Enabled"], "", None ), + ( "GL_LIGHT7", GLboolean, ["ctx->Light.Light[7].Enabled"], "", None ), + ( "GL_LIGHTING", GLboolean, ["ctx->Light.Enabled"], "", None ), + ( "GL_LIGHT_MODEL_AMBIENT", GLfloatN, + ["ctx->Light.Model.Ambient[0]", + "ctx->Light.Model.Ambient[1]", + "ctx->Light.Model.Ambient[2]", + "ctx->Light.Model.Ambient[3]"], "", None ), + ( "GL_LIGHT_MODEL_COLOR_CONTROL", GLenum, + ["ctx->Light.Model.ColorControl"], "", None ), + ( "GL_LIGHT_MODEL_LOCAL_VIEWER", GLboolean, + ["ctx->Light.Model.LocalViewer"], "", None ), + ( "GL_LIGHT_MODEL_TWO_SIDE", GLboolean, ["ctx->Light.Model.TwoSide"], "", None ), + ( "GL_LINE_SMOOTH", GLboolean, ["ctx->Line.SmoothFlag"], "", None ), + ( "GL_LINE_SMOOTH_HINT", GLenum, ["ctx->Hint.LineSmooth"], "", None ), + ( "GL_LINE_STIPPLE", GLboolean, ["ctx->Line.StippleFlag"], "", None ), + ( "GL_LINE_STIPPLE_PATTERN", GLint, ["ctx->Line.StipplePattern"], "", None ), + ( "GL_LINE_STIPPLE_REPEAT", GLint, ["ctx->Line.StippleFactor"], "", None ), + ( "GL_LINE_WIDTH", GLfloat, ["ctx->Line.Width"], "", None ), + ( "GL_LINE_WIDTH_GRANULARITY", GLfloat, + ["ctx->Const.LineWidthGranularity"], "", None ), + ( "GL_LINE_WIDTH_RANGE", GLfloat, + ["ctx->Const.MinLineWidthAA", + "ctx->Const.MaxLineWidthAA"], "", None ), + ( "GL_ALIASED_LINE_WIDTH_RANGE", GLfloat, + ["ctx->Const.MinLineWidth", + "ctx->Const.MaxLineWidth"], "", None ), + ( "GL_LIST_BASE", GLint, ["ctx->List.ListBase"], "", None ), + ( "GL_LIST_INDEX", GLint, ["ctx->ListState.CurrentListNum"], "", None ), + ( "GL_LIST_MODE", GLenum, ["mode"], + """GLenum mode; + if (!ctx->CompileFlag) + mode = 0; + else if (ctx->ExecuteFlag) + mode = GL_COMPILE_AND_EXECUTE; + else + mode = GL_COMPILE;""", None ), + ( "GL_INDEX_LOGIC_OP", GLboolean, ["ctx->Color.IndexLogicOpEnabled"], "", None ), + ( "GL_COLOR_LOGIC_OP", GLboolean, ["ctx->Color.ColorLogicOpEnabled"], "", None ), + ( "GL_LOGIC_OP_MODE", GLenum, ["ctx->Color.LogicOp"], "", None ), + ( "GL_MAP1_COLOR_4", GLboolean, ["ctx->Eval.Map1Color4"], "", None ), + ( "GL_MAP1_GRID_DOMAIN", GLfloat, + ["ctx->Eval.MapGrid1u1", + "ctx->Eval.MapGrid1u2"], "", None ), + ( "GL_MAP1_GRID_SEGMENTS", GLint, ["ctx->Eval.MapGrid1un"], "", None ), + ( "GL_MAP1_INDEX", GLboolean, ["ctx->Eval.Map1Index"], "", None ), + ( "GL_MAP1_NORMAL", GLboolean, ["ctx->Eval.Map1Normal"], "", None ), + ( "GL_MAP1_TEXTURE_COORD_1", GLboolean, ["ctx->Eval.Map1TextureCoord1"], "", None ), + ( "GL_MAP1_TEXTURE_COORD_2", GLboolean, ["ctx->Eval.Map1TextureCoord2"], "", None ), + ( "GL_MAP1_TEXTURE_COORD_3", GLboolean, ["ctx->Eval.Map1TextureCoord3"], "", None ), + ( "GL_MAP1_TEXTURE_COORD_4", GLboolean, ["ctx->Eval.Map1TextureCoord4"], "", None ), + ( "GL_MAP1_VERTEX_3", GLboolean, ["ctx->Eval.Map1Vertex3"], "", None ), + ( "GL_MAP1_VERTEX_4", GLboolean, ["ctx->Eval.Map1Vertex4"], "", None ), + ( "GL_MAP2_COLOR_4", GLboolean, ["ctx->Eval.Map2Color4"], "", None ), + ( "GL_MAP2_GRID_DOMAIN", GLfloat, + ["ctx->Eval.MapGrid2u1", + "ctx->Eval.MapGrid2u2", + "ctx->Eval.MapGrid2v1", + "ctx->Eval.MapGrid2v2"], "", None ), + ( "GL_MAP2_GRID_SEGMENTS", GLint, + ["ctx->Eval.MapGrid2un", + "ctx->Eval.MapGrid2vn"], "", None ), + ( "GL_MAP2_INDEX", GLboolean, ["ctx->Eval.Map2Index"], "", None ), + ( "GL_MAP2_NORMAL", GLboolean, ["ctx->Eval.Map2Normal"], "", None ), + ( "GL_MAP2_TEXTURE_COORD_1", GLboolean, ["ctx->Eval.Map2TextureCoord1"], "", None ), + ( "GL_MAP2_TEXTURE_COORD_2", GLboolean, ["ctx->Eval.Map2TextureCoord2"], "", None ), + ( "GL_MAP2_TEXTURE_COORD_3", GLboolean, ["ctx->Eval.Map2TextureCoord3"], "", None ), + ( "GL_MAP2_TEXTURE_COORD_4", GLboolean, ["ctx->Eval.Map2TextureCoord4"], "", None ), + ( "GL_MAP2_VERTEX_3", GLboolean, ["ctx->Eval.Map2Vertex3"], "", None ), + ( "GL_MAP2_VERTEX_4", GLboolean, ["ctx->Eval.Map2Vertex4"], "", None ), + ( "GL_MAP_COLOR", GLboolean, ["ctx->Pixel.MapColorFlag"], "", None ), + ( "GL_MAP_STENCIL", GLboolean, ["ctx->Pixel.MapStencilFlag"], "", None ), + ( "GL_MATRIX_MODE", GLenum, ["ctx->Transform.MatrixMode"], "", None ), + + ( "GL_MAX_ATTRIB_STACK_DEPTH", GLint, ["MAX_ATTRIB_STACK_DEPTH"], "", None ), + ( "GL_MAX_CLIENT_ATTRIB_STACK_DEPTH", GLint, ["MAX_CLIENT_ATTRIB_STACK_DEPTH"], "", None ), + ( "GL_MAX_CLIP_PLANES", GLint, ["ctx->Const.MaxClipPlanes"], "", None ), + ( "GL_MAX_ELEMENTS_VERTICES", GLint, ["ctx->Const.MaxArrayLockSize"], "", None ), + ( "GL_MAX_ELEMENTS_INDICES", GLint, ["ctx->Const.MaxArrayLockSize"], "", None ), + ( "GL_MAX_EVAL_ORDER", GLint, ["MAX_EVAL_ORDER"], "", None ), + ( "GL_MAX_LIGHTS", GLint, ["ctx->Const.MaxLights"], "", None ), + ( "GL_MAX_LIST_NESTING", GLint, ["MAX_LIST_NESTING"], "", None ), + ( "GL_MAX_MODELVIEW_STACK_DEPTH", GLint, ["MAX_MODELVIEW_STACK_DEPTH"], "", None ), + ( "GL_MAX_NAME_STACK_DEPTH", GLint, ["MAX_NAME_STACK_DEPTH"], "", None ), + ( "GL_MAX_PIXEL_MAP_TABLE", GLint, ["MAX_PIXEL_MAP_TABLE"], "", None ), + ( "GL_MAX_PROJECTION_STACK_DEPTH", GLint, ["MAX_PROJECTION_STACK_DEPTH"], "", None ), + ( "GL_MAX_TEXTURE_SIZE", GLint, ["1 << (ctx->Const.MaxTextureLevels - 1)"], "", None ), + ( "GL_MAX_3D_TEXTURE_SIZE", GLint, ["1 << (ctx->Const.Max3DTextureLevels - 1)"], "", None ), + ( "GL_MAX_TEXTURE_STACK_DEPTH", GLint, ["MAX_TEXTURE_STACK_DEPTH"], "", None ), + ( "GL_MAX_VIEWPORT_DIMS", GLint, + ["ctx->Const.MaxViewportWidth", "ctx->Const.MaxViewportHeight"], + "", None ), + ( "GL_MODELVIEW_MATRIX", GLfloat, + [ "matrix[0]", "matrix[1]", "matrix[2]", "matrix[3]", + "matrix[4]", "matrix[5]", "matrix[6]", "matrix[7]", + "matrix[8]", "matrix[9]", "matrix[10]", "matrix[11]", + "matrix[12]", "matrix[13]", "matrix[14]", "matrix[15]" ], + "const GLfloat *matrix = ctx->ModelviewMatrixStack.Top->m;", None ), + ( "GL_MODELVIEW_STACK_DEPTH", GLint, ["ctx->ModelviewMatrixStack.Depth + 1"], "", None ), + ( "GL_NAME_STACK_DEPTH", GLint, ["ctx->Select.NameStackDepth"], "", None ), + ( "GL_NORMALIZE", GLboolean, ["ctx->Transform.Normalize"], "", None ), + ( "GL_PACK_ALIGNMENT", GLint, ["ctx->Pack.Alignment"], "", None ), + ( "GL_PACK_LSB_FIRST", GLboolean, ["ctx->Pack.LsbFirst"], "", None ), + ( "GL_PACK_ROW_LENGTH", GLint, ["ctx->Pack.RowLength"], "", None ), + ( "GL_PACK_SKIP_PIXELS", GLint, ["ctx->Pack.SkipPixels"], "", None ), + ( "GL_PACK_SKIP_ROWS", GLint, ["ctx->Pack.SkipRows"], "", None ), + ( "GL_PACK_SWAP_BYTES", GLboolean, ["ctx->Pack.SwapBytes"], "", None ), + ( "GL_PACK_SKIP_IMAGES_EXT", GLint, ["ctx->Pack.SkipImages"], "", None ), + ( "GL_PACK_IMAGE_HEIGHT_EXT", GLint, ["ctx->Pack.ImageHeight"], "", None ), + ( "GL_PACK_INVERT_MESA", GLboolean, ["ctx->Pack.Invert"], "", None ), + ( "GL_PERSPECTIVE_CORRECTION_HINT", GLenum, + ["ctx->Hint.PerspectiveCorrection"], "", None ), + ( "GL_PIXEL_MAP_A_TO_A_SIZE", GLint, ["ctx->PixelMaps.AtoA.Size"], "", None ), + ( "GL_PIXEL_MAP_B_TO_B_SIZE", GLint, ["ctx->PixelMaps.BtoB.Size"], "", None ), + ( "GL_PIXEL_MAP_G_TO_G_SIZE", GLint, ["ctx->PixelMaps.GtoG.Size"], "", None ), + ( "GL_PIXEL_MAP_I_TO_A_SIZE", GLint, ["ctx->PixelMaps.ItoA.Size"], "", None ), + ( "GL_PIXEL_MAP_I_TO_B_SIZE", GLint, ["ctx->PixelMaps.ItoB.Size"], "", None ), + ( "GL_PIXEL_MAP_I_TO_G_SIZE", GLint, ["ctx->PixelMaps.ItoG.Size"], "", None ), + ( "GL_PIXEL_MAP_I_TO_I_SIZE", GLint, ["ctx->PixelMaps.ItoI.Size"], "", None ), + ( "GL_PIXEL_MAP_I_TO_R_SIZE", GLint, ["ctx->PixelMaps.ItoR.Size"], "", None ), + ( "GL_PIXEL_MAP_R_TO_R_SIZE", GLint, ["ctx->PixelMaps.RtoR.Size"], "", None ), + ( "GL_PIXEL_MAP_S_TO_S_SIZE", GLint, ["ctx->PixelMaps.StoS.Size"], "", None ), + ( "GL_POINT_SIZE", GLfloat, ["ctx->Point.Size"], "", None ), + ( "GL_POINT_SIZE_GRANULARITY", GLfloat, + ["ctx->Const.PointSizeGranularity"], "", None ), + ( "GL_POINT_SIZE_RANGE", GLfloat, + ["ctx->Const.MinPointSizeAA", + "ctx->Const.MaxPointSizeAA"], "", None ), + ( "GL_ALIASED_POINT_SIZE_RANGE", GLfloat, + ["ctx->Const.MinPointSize", + "ctx->Const.MaxPointSize"], "", None ), + ( "GL_POINT_SMOOTH", GLboolean, ["ctx->Point.SmoothFlag"], "", None ), + ( "GL_POINT_SMOOTH_HINT", GLenum, ["ctx->Hint.PointSmooth"], "", None ), + ( "GL_POINT_SIZE_MIN_EXT", GLfloat, ["ctx->Point.MinSize"], "", None ), + ( "GL_POINT_SIZE_MAX_EXT", GLfloat, ["ctx->Point.MaxSize"], "", None ), + ( "GL_POINT_FADE_THRESHOLD_SIZE_EXT", GLfloat, + ["ctx->Point.Threshold"], "", None ), + ( "GL_DISTANCE_ATTENUATION_EXT", GLfloat, + ["ctx->Point.Params[0]", + "ctx->Point.Params[1]", + "ctx->Point.Params[2]"], "", None ), + ( "GL_POLYGON_MODE", GLenum, + ["ctx->Polygon.FrontMode", + "ctx->Polygon.BackMode"], "", None ), + ( "GL_POLYGON_OFFSET_BIAS_EXT", GLfloat, ["ctx->Polygon.OffsetUnits"], "", None ), + ( "GL_POLYGON_OFFSET_FACTOR", GLfloat, ["ctx->Polygon.OffsetFactor "], "", None ), + ( "GL_POLYGON_OFFSET_UNITS", GLfloat, ["ctx->Polygon.OffsetUnits "], "", None ), + ( "GL_POLYGON_OFFSET_POINT", GLboolean, ["ctx->Polygon.OffsetPoint"], "", None ), + ( "GL_POLYGON_OFFSET_LINE", GLboolean, ["ctx->Polygon.OffsetLine"], "", None ), + ( "GL_POLYGON_OFFSET_FILL", GLboolean, ["ctx->Polygon.OffsetFill"], "", None ), + ( "GL_POLYGON_SMOOTH", GLboolean, ["ctx->Polygon.SmoothFlag"], "", None ), + ( "GL_POLYGON_SMOOTH_HINT", GLenum, ["ctx->Hint.PolygonSmooth"], "", None ), + ( "GL_POLYGON_STIPPLE", GLboolean, ["ctx->Polygon.StippleFlag"], "", None ), + ( "GL_PROJECTION_MATRIX", GLfloat, + [ "matrix[0]", "matrix[1]", "matrix[2]", "matrix[3]", + "matrix[4]", "matrix[5]", "matrix[6]", "matrix[7]", + "matrix[8]", "matrix[9]", "matrix[10]", "matrix[11]", + "matrix[12]", "matrix[13]", "matrix[14]", "matrix[15]" ], + "const GLfloat *matrix = ctx->ProjectionMatrixStack.Top->m;", None ), + ( "GL_PROJECTION_STACK_DEPTH", GLint, + ["ctx->ProjectionMatrixStack.Depth + 1"], "", None ), + ( "GL_READ_BUFFER", GLenum, ["ctx->ReadBuffer->ColorReadBuffer"], "", None ), + ( "GL_RED_BIAS", GLfloat, ["ctx->Pixel.RedBias"], "", None ), + ( "GL_RED_BITS", GLint, ["ctx->DrawBuffer->Visual.redBits"], "", None ), + ( "GL_RED_SCALE", GLfloat, ["ctx->Pixel.RedScale"], "", None ), + ( "GL_RENDER_MODE", GLenum, ["ctx->RenderMode"], "", None ), + ( "GL_RESCALE_NORMAL", GLboolean, + ["ctx->Transform.RescaleNormals"], "", None ), + ( "GL_RGBA_MODE", GLboolean, ["ctx->DrawBuffer->Visual.rgbMode"], + "", None ), + ( "GL_SCISSOR_BOX", GLint, + ["ctx->Scissor.X", + "ctx->Scissor.Y", + "ctx->Scissor.Width", + "ctx->Scissor.Height"], "", None ), + ( "GL_SCISSOR_TEST", GLboolean, ["ctx->Scissor.Enabled"], "", None ), + ( "GL_SELECTION_BUFFER_SIZE", GLint, ["ctx->Select.BufferSize"], "", None ), + ( "GL_SHADE_MODEL", GLenum, ["ctx->Light.ShadeModel"], "", None ), + ( "GL_SHARED_TEXTURE_PALETTE_EXT", GLboolean, + ["ctx->Texture.SharedPalette"], "", None ), + ( "GL_STENCIL_BITS", GLint, ["ctx->DrawBuffer->Visual.stencilBits"], "", None ), + ( "GL_STENCIL_CLEAR_VALUE", GLint, ["ctx->Stencil.Clear"], "", None ), + ( "GL_STENCIL_FAIL", GLenum, + ["ctx->Stencil.FailFunc[ctx->Stencil.ActiveFace]"], "", None ), + ( "GL_STENCIL_FUNC", GLenum, + ["ctx->Stencil.Function[ctx->Stencil.ActiveFace]"], "", None ), + ( "GL_STENCIL_PASS_DEPTH_FAIL", GLenum, + ["ctx->Stencil.ZFailFunc[ctx->Stencil.ActiveFace]"], "", None ), + ( "GL_STENCIL_PASS_DEPTH_PASS", GLenum, + ["ctx->Stencil.ZPassFunc[ctx->Stencil.ActiveFace]"], "", None ), + ( "GL_STENCIL_REF", GLint, + ["ctx->Stencil.Ref[ctx->Stencil.ActiveFace]"], "", None ), + ( "GL_STENCIL_TEST", GLboolean, ["ctx->Stencil.Enabled"], "", None ), + ( "GL_STENCIL_VALUE_MASK", GLint, + ["ctx->Stencil.ValueMask[ctx->Stencil.ActiveFace]"], "", None ), + ( "GL_STENCIL_WRITEMASK", GLint, + ["ctx->Stencil.WriteMask[ctx->Stencil.ActiveFace]"], "", None ), + ( "GL_STEREO", GLboolean, ["ctx->DrawBuffer->Visual.stereoMode"], + "", None ), + ( "GL_SUBPIXEL_BITS", GLint, ["ctx->Const.SubPixelBits"], "", None ), + ( "GL_TEXTURE_1D", GLboolean, ["_mesa_IsEnabled(GL_TEXTURE_1D)"], "", None ), + ( "GL_TEXTURE_2D", GLboolean, ["_mesa_IsEnabled(GL_TEXTURE_2D)"], "", None ), + ( "GL_TEXTURE_3D", GLboolean, ["_mesa_IsEnabled(GL_TEXTURE_3D)"], "", None ), + ( "GL_TEXTURE_1D_ARRAY_EXT", GLboolean, ["_mesa_IsEnabled(GL_TEXTURE_1D_ARRAY_EXT)"], "", ["MESA_texture_array"] ), + ( "GL_TEXTURE_2D_ARRAY_EXT", GLboolean, ["_mesa_IsEnabled(GL_TEXTURE_2D_ARRAY_EXT)"], "", ["MESA_texture_array"] ), + ( "GL_TEXTURE_BINDING_1D", GLint, + ["ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_1D_INDEX]->Name"], "", None ), + ( "GL_TEXTURE_BINDING_2D", GLint, + ["ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_2D_INDEX]->Name"], "", None ), + ( "GL_TEXTURE_BINDING_3D", GLint, + ["ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_3D_INDEX]->Name"], "", None ), + ( "GL_TEXTURE_BINDING_1D_ARRAY_EXT", GLint, + ["ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_1D_ARRAY_INDEX]->Name"], "", ["MESA_texture_array"] ), + ( "GL_TEXTURE_BINDING_2D_ARRAY_EXT", GLint, + ["ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_2D_ARRAY_INDEX]->Name"], "", ["MESA_texture_array"] ), + ( "GL_TEXTURE_GEN_S", GLboolean, + ["((ctx->Texture.Unit[ctx->Texture.CurrentUnit].TexGenEnabled & S_BIT) ? 1 : 0)"], "", None ), + ( "GL_TEXTURE_GEN_T", GLboolean, + ["((ctx->Texture.Unit[ctx->Texture.CurrentUnit].TexGenEnabled & T_BIT) ? 1 : 0)"], "", None ), + ( "GL_TEXTURE_GEN_R", GLboolean, + ["((ctx->Texture.Unit[ctx->Texture.CurrentUnit].TexGenEnabled & R_BIT) ? 1 : 0)"], "", None ), + ( "GL_TEXTURE_GEN_Q", GLboolean, + ["((ctx->Texture.Unit[ctx->Texture.CurrentUnit].TexGenEnabled & Q_BIT) ? 1 : 0)"], "", None ), + ( "GL_TEXTURE_MATRIX", GLfloat, + ["matrix[0]", "matrix[1]", "matrix[2]", "matrix[3]", + "matrix[4]", "matrix[5]", "matrix[6]", "matrix[7]", + "matrix[8]", "matrix[9]", "matrix[10]", "matrix[11]", + "matrix[12]", "matrix[13]", "matrix[14]", "matrix[15]" ], + "const GLfloat *matrix = ctx->TextureMatrixStack[ctx->Texture.CurrentUnit].Top->m;", None ), + ( "GL_TEXTURE_STACK_DEPTH", GLint, + ["ctx->TextureMatrixStack[ctx->Texture.CurrentUnit].Depth + 1"], "", None ), + ( "GL_UNPACK_ALIGNMENT", GLint, ["ctx->Unpack.Alignment"], "", None ), + ( "GL_UNPACK_LSB_FIRST", GLboolean, ["ctx->Unpack.LsbFirst"], "", None ), + ( "GL_UNPACK_ROW_LENGTH", GLint, ["ctx->Unpack.RowLength"], "", None ), + ( "GL_UNPACK_SKIP_PIXELS", GLint, ["ctx->Unpack.SkipPixels"], "", None ), + ( "GL_UNPACK_SKIP_ROWS", GLint, ["ctx->Unpack.SkipRows"], "", None ), + ( "GL_UNPACK_SWAP_BYTES", GLboolean, ["ctx->Unpack.SwapBytes"], "", None ), + ( "GL_UNPACK_SKIP_IMAGES_EXT", GLint, ["ctx->Unpack.SkipImages"], "", None ), + ( "GL_UNPACK_IMAGE_HEIGHT_EXT", GLint, ["ctx->Unpack.ImageHeight"], "", None ), + ( "GL_UNPACK_CLIENT_STORAGE_APPLE", GLboolean, ["ctx->Unpack.ClientStorage"], "", None ), + ( "GL_VIEWPORT", GLint, [ "ctx->Viewport.X", "ctx->Viewport.Y", + "ctx->Viewport.Width", "ctx->Viewport.Height" ], "", None ), + ( "GL_ZOOM_X", GLfloat, ["ctx->Pixel.ZoomX"], "", None ), + ( "GL_ZOOM_Y", GLfloat, ["ctx->Pixel.ZoomY"], "", None ), + + # Vertex arrays + ( "GL_VERTEX_ARRAY", GLboolean, ["ctx->Array.ArrayObj->Vertex.Enabled"], "", None ), + ( "GL_VERTEX_ARRAY_SIZE", GLint, ["ctx->Array.ArrayObj->Vertex.Size"], "", None ), + ( "GL_VERTEX_ARRAY_TYPE", GLenum, ["ctx->Array.ArrayObj->Vertex.Type"], "", None ), + ( "GL_VERTEX_ARRAY_STRIDE", GLint, ["ctx->Array.ArrayObj->Vertex.Stride"], "", None ), + ( "GL_VERTEX_ARRAY_COUNT_EXT", GLint, ["0"], "", None ), + ( "GL_NORMAL_ARRAY", GLenum, ["ctx->Array.ArrayObj->Normal.Enabled"], "", None ), + ( "GL_NORMAL_ARRAY_TYPE", GLenum, ["ctx->Array.ArrayObj->Normal.Type"], "", None ), + ( "GL_NORMAL_ARRAY_STRIDE", GLint, ["ctx->Array.ArrayObj->Normal.Stride"], "", None ), + ( "GL_NORMAL_ARRAY_COUNT_EXT", GLint, ["0"], "", None ), + ( "GL_COLOR_ARRAY", GLboolean, ["ctx->Array.ArrayObj->Color.Enabled"], "", None ), + ( "GL_COLOR_ARRAY_SIZE", GLint, ["ctx->Array.ArrayObj->Color.Size"], "", None ), + ( "GL_COLOR_ARRAY_TYPE", GLenum, ["ctx->Array.ArrayObj->Color.Type"], "", None ), + ( "GL_COLOR_ARRAY_STRIDE", GLint, ["ctx->Array.ArrayObj->Color.Stride"], "", None ), + ( "GL_COLOR_ARRAY_COUNT_EXT", GLint, ["0"], "", None ), + ( "GL_INDEX_ARRAY", GLboolean, ["ctx->Array.ArrayObj->Index.Enabled"], "", None ), + ( "GL_INDEX_ARRAY_TYPE", GLenum, ["ctx->Array.ArrayObj->Index.Type"], "", None ), + ( "GL_INDEX_ARRAY_STRIDE", GLint, ["ctx->Array.ArrayObj->Index.Stride"], "", None ), + ( "GL_INDEX_ARRAY_COUNT_EXT", GLint, ["0"], "", None ), + ( "GL_TEXTURE_COORD_ARRAY", GLboolean, + ["ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Enabled"], "", None ), + ( "GL_TEXTURE_COORD_ARRAY_SIZE", GLint, + ["ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Size"], "", None ), + ( "GL_TEXTURE_COORD_ARRAY_TYPE", GLenum, + ["ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Type"], "", None ), + ( "GL_TEXTURE_COORD_ARRAY_STRIDE", GLint, + ["ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Stride"], "", None ), + ( "GL_TEXTURE_COORD_ARRAY_COUNT_EXT", GLint, ["0"], "", None ), + ( "GL_EDGE_FLAG_ARRAY", GLboolean, ["ctx->Array.ArrayObj->EdgeFlag.Enabled"], "", None ), + ( "GL_EDGE_FLAG_ARRAY_STRIDE", GLint, ["ctx->Array.ArrayObj->EdgeFlag.Stride"], "", None ), + ( "GL_EDGE_FLAG_ARRAY_COUNT_EXT", GLint, ["0"], "", None ), + + # GL_ARB_multitexture + ( "GL_MAX_TEXTURE_UNITS_ARB", GLint, + ["ctx->Const.MaxTextureUnits"], "", ["ARB_multitexture"] ), + ( "GL_ACTIVE_TEXTURE_ARB", GLint, + [ "GL_TEXTURE0_ARB + ctx->Texture.CurrentUnit"], "", ["ARB_multitexture"] ), + ( "GL_CLIENT_ACTIVE_TEXTURE_ARB", GLint, + ["GL_TEXTURE0_ARB + ctx->Array.ActiveTexture"], "", ["ARB_multitexture"] ), + + # GL_ARB_texture_cube_map + ( "GL_TEXTURE_CUBE_MAP_ARB", GLboolean, + ["_mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB)"], "", ["ARB_texture_cube_map"] ), + ( "GL_TEXTURE_BINDING_CUBE_MAP_ARB", GLint, + ["ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_CUBE_INDEX]->Name"], + "", ["ARB_texture_cube_map"] ), + ( "GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB", GLint, + ["(1 << (ctx->Const.MaxCubeTextureLevels - 1))"], + "", ["ARB_texture_cube_map"]), + + # GL_ARB_texture_compression */ + ( "GL_TEXTURE_COMPRESSION_HINT_ARB", GLint, + ["ctx->Hint.TextureCompression"], "", ["ARB_texture_compression"] ), + ( "GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB", GLint, + ["_mesa_get_compressed_formats(ctx, NULL, GL_FALSE)"], + "", ["ARB_texture_compression"] ), + ( "GL_COMPRESSED_TEXTURE_FORMATS_ARB", GLenum, + [], + """GLint formats[100]; + GLuint i, n = _mesa_get_compressed_formats(ctx, formats, GL_FALSE); + ASSERT(n <= 100); + for (i = 0; i < n; i++) + params[i] = CONVERSION(formats[i]);""", + ["ARB_texture_compression"] ), + + # GL_EXT_compiled_vertex_array + ( "GL_ARRAY_ELEMENT_LOCK_FIRST_EXT", GLint, ["ctx->Array.LockFirst"], + "", ["EXT_compiled_vertex_array"] ), + ( "GL_ARRAY_ELEMENT_LOCK_COUNT_EXT", GLint, ["ctx->Array.LockCount"], + "", ["EXT_compiled_vertex_array"] ), + + # GL_ARB_transpose_matrix + ( "GL_TRANSPOSE_COLOR_MATRIX_ARB", GLfloat, + ["matrix[0]", "matrix[4]", "matrix[8]", "matrix[12]", + "matrix[1]", "matrix[5]", "matrix[9]", "matrix[13]", + "matrix[2]", "matrix[6]", "matrix[10]", "matrix[14]", + "matrix[3]", "matrix[7]", "matrix[11]", "matrix[15]"], + "const GLfloat *matrix = ctx->ColorMatrixStack.Top->m;", None ), + ( "GL_TRANSPOSE_MODELVIEW_MATRIX_ARB", GLfloat, + ["matrix[0]", "matrix[4]", "matrix[8]", "matrix[12]", + "matrix[1]", "matrix[5]", "matrix[9]", "matrix[13]", + "matrix[2]", "matrix[6]", "matrix[10]", "matrix[14]", + "matrix[3]", "matrix[7]", "matrix[11]", "matrix[15]"], + "const GLfloat *matrix = ctx->ModelviewMatrixStack.Top->m;", None ), + ( "GL_TRANSPOSE_PROJECTION_MATRIX_ARB", GLfloat, + ["matrix[0]", "matrix[4]", "matrix[8]", "matrix[12]", + "matrix[1]", "matrix[5]", "matrix[9]", "matrix[13]", + "matrix[2]", "matrix[6]", "matrix[10]", "matrix[14]", + "matrix[3]", "matrix[7]", "matrix[11]", "matrix[15]"], + "const GLfloat *matrix = ctx->ProjectionMatrixStack.Top->m;", None ), + ( "GL_TRANSPOSE_TEXTURE_MATRIX_ARB", GLfloat, + ["matrix[0]", "matrix[4]", "matrix[8]", "matrix[12]", + "matrix[1]", "matrix[5]", "matrix[9]", "matrix[13]", + "matrix[2]", "matrix[6]", "matrix[10]", "matrix[14]", + "matrix[3]", "matrix[7]", "matrix[11]", "matrix[15]"], + "const GLfloat *matrix = ctx->TextureMatrixStack[ctx->Texture.CurrentUnit].Top->m;", None ), + + # GL_SGI_color_matrix (also in 1.2 imaging) + ( "GL_COLOR_MATRIX_SGI", GLfloat, + ["matrix[0]", "matrix[1]", "matrix[2]", "matrix[3]", + "matrix[4]", "matrix[5]", "matrix[6]", "matrix[7]", + "matrix[8]", "matrix[9]", "matrix[10]", "matrix[11]", + "matrix[12]", "matrix[13]", "matrix[14]", "matrix[15]" ], + "const GLfloat *matrix = ctx->ColorMatrixStack.Top->m;", None ), + ( "GL_COLOR_MATRIX_STACK_DEPTH_SGI", GLint, + ["ctx->ColorMatrixStack.Depth + 1"], "", None ), + ( "GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI", GLint, + ["MAX_COLOR_STACK_DEPTH"], "", None ), + ( "GL_POST_COLOR_MATRIX_RED_SCALE_SGI", GLfloat, + ["ctx->Pixel.PostColorMatrixScale[0]"], "", None ), + ( "GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI", GLfloat, + ["ctx->Pixel.PostColorMatrixScale[1]"], "", None ), + ( "GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI", GLfloat, + ["ctx->Pixel.PostColorMatrixScale[2]"], "", None ), + ( "GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI", GLfloat, + ["ctx->Pixel.PostColorMatrixScale[3]"], "", None ), + ( "GL_POST_COLOR_MATRIX_RED_BIAS_SGI", GLfloat, + ["ctx->Pixel.PostColorMatrixBias[0]"], "", None ), + ( "GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI", GLfloat, + ["ctx->Pixel.PostColorMatrixBias[1]"], "", None ), + ( "GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI", GLfloat, + ["ctx->Pixel.PostColorMatrixBias[2]"], "", None ), + ( "GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI", GLfloat, + ["ctx->Pixel.PostColorMatrixBias[3]"], "", None ), + + # GL_EXT_convolution (also in 1.2 imaging) + ( "GL_CONVOLUTION_1D_EXT", GLboolean, + ["ctx->Pixel.Convolution1DEnabled"], "", ["EXT_convolution"] ), + ( "GL_CONVOLUTION_2D_EXT", GLboolean, + ["ctx->Pixel.Convolution2DEnabled"], "", ["EXT_convolution"] ), + ( "GL_SEPARABLE_2D_EXT", GLboolean, + ["ctx->Pixel.Separable2DEnabled"], "", ["EXT_convolution"] ), + ( "GL_POST_CONVOLUTION_RED_SCALE_EXT", GLfloat, + ["ctx->Pixel.PostConvolutionScale[0]"], "", ["EXT_convolution"] ), + ( "GL_POST_CONVOLUTION_GREEN_SCALE_EXT", GLfloat, + ["ctx->Pixel.PostConvolutionScale[1]"], "", ["EXT_convolution"] ), + ( "GL_POST_CONVOLUTION_BLUE_SCALE_EXT", GLfloat, + ["ctx->Pixel.PostConvolutionScale[2]"], "", ["EXT_convolution"] ), + ( "GL_POST_CONVOLUTION_ALPHA_SCALE_EXT", GLfloat, + ["ctx->Pixel.PostConvolutionScale[3]"], "", ["EXT_convolution"] ), + ( "GL_POST_CONVOLUTION_RED_BIAS_EXT", GLfloat, + ["ctx->Pixel.PostConvolutionBias[0]"], "", ["EXT_convolution"] ), + ( "GL_POST_CONVOLUTION_GREEN_BIAS_EXT", GLfloat, + ["ctx->Pixel.PostConvolutionBias[1]"], "", ["EXT_convolution"] ), + ( "GL_POST_CONVOLUTION_BLUE_BIAS_EXT", GLfloat, + ["ctx->Pixel.PostConvolutionBias[2]"], "", ["EXT_convolution"] ), + ( "GL_POST_CONVOLUTION_ALPHA_BIAS_EXT", GLfloat, + ["ctx->Pixel.PostConvolutionBias[3]"], "", ["EXT_convolution"] ), + + # GL_EXT_histogram / GL_ARB_imaging + ( "GL_HISTOGRAM", GLboolean, + [ "ctx->Pixel.HistogramEnabled" ], "", ["EXT_histogram"] ), + ( "GL_MINMAX", GLboolean, + [ "ctx->Pixel.MinMaxEnabled" ], "", ["EXT_histogram"] ), + + # GL_SGI_color_table / GL_ARB_imaging + ( "GL_COLOR_TABLE_SGI", GLboolean, + ["ctx->Pixel.ColorTableEnabled[COLORTABLE_PRECONVOLUTION]"], "", ["SGI_color_table"] ), + ( "GL_POST_CONVOLUTION_COLOR_TABLE_SGI", GLboolean, + ["ctx->Pixel.ColorTableEnabled[COLORTABLE_POSTCONVOLUTION]"], "", ["SGI_color_table"] ), + ( "GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI", GLboolean, + ["ctx->Pixel.ColorTableEnabled[COLORTABLE_POSTCOLORMATRIX]"], "", ["SGI_color_table"] ), + + # GL_SGI_texture_color_table + ( "GL_TEXTURE_COLOR_TABLE_SGI", GLboolean, + ["ctx->Texture.Unit[ctx->Texture.CurrentUnit].ColorTableEnabled"], + "", ["SGI_texture_color_table"] ), + + # GL_EXT_secondary_color + ( "GL_COLOR_SUM_EXT", GLboolean, + ["ctx->Fog.ColorSumEnabled"], "", + ["EXT_secondary_color", "ARB_vertex_program"] ), + ( "GL_CURRENT_SECONDARY_COLOR_EXT", GLfloatN, + ["ctx->Current.Attrib[VERT_ATTRIB_COLOR1][0]", + "ctx->Current.Attrib[VERT_ATTRIB_COLOR1][1]", + "ctx->Current.Attrib[VERT_ATTRIB_COLOR1][2]", + "ctx->Current.Attrib[VERT_ATTRIB_COLOR1][3]"], + "FLUSH_CURRENT(ctx, 0);", ["EXT_secondary_color"] ), + ( "GL_SECONDARY_COLOR_ARRAY_EXT", GLboolean, + ["ctx->Array.ArrayObj->SecondaryColor.Enabled"], "", ["EXT_secondary_color"] ), + ( "GL_SECONDARY_COLOR_ARRAY_TYPE_EXT", GLenum, + ["ctx->Array.ArrayObj->SecondaryColor.Type"], "", ["EXT_secondary_color"] ), + ( "GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT", GLint, + ["ctx->Array.ArrayObj->SecondaryColor.Stride"], "", ["EXT_secondary_color"] ), + ( "GL_SECONDARY_COLOR_ARRAY_SIZE_EXT", GLint, + ["ctx->Array.ArrayObj->SecondaryColor.Size"], "", ["EXT_secondary_color"] ), + + # GL_EXT_fog_coord + ( "GL_CURRENT_FOG_COORDINATE_EXT", GLfloat, + ["ctx->Current.Attrib[VERT_ATTRIB_FOG][0]"], + "FLUSH_CURRENT(ctx, 0);", ["EXT_fog_coord"] ), + ( "GL_FOG_COORDINATE_ARRAY_EXT", GLboolean, ["ctx->Array.ArrayObj->FogCoord.Enabled"], + "", ["EXT_fog_coord"] ), + ( "GL_FOG_COORDINATE_ARRAY_TYPE_EXT", GLenum, ["ctx->Array.ArrayObj->FogCoord.Type"], + "", ["EXT_fog_coord"] ), + ( "GL_FOG_COORDINATE_ARRAY_STRIDE_EXT", GLint, ["ctx->Array.ArrayObj->FogCoord.Stride"], + "", ["EXT_fog_coord"] ), + ( "GL_FOG_COORDINATE_SOURCE_EXT", GLenum, ["ctx->Fog.FogCoordinateSource"], + "", ["EXT_fog_coord"] ), + + # GL_EXT_texture_lod_bias + ( "GL_MAX_TEXTURE_LOD_BIAS_EXT", GLfloat, + ["ctx->Const.MaxTextureLodBias"], "", ["EXT_texture_lod_bias"]), + + # GL_EXT_texture_filter_anisotropic + ( "GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT", GLfloat, + ["ctx->Const.MaxTextureMaxAnisotropy"], "", ["EXT_texture_filter_anisotropic"]), + + # GL_ARB_multisample + ( "GL_MULTISAMPLE_ARB", GLboolean, + ["ctx->Multisample.Enabled"], "", ["ARB_multisample"] ), + ( "GL_SAMPLE_ALPHA_TO_COVERAGE_ARB", GLboolean, + ["ctx->Multisample.SampleAlphaToCoverage"], "", ["ARB_multisample"] ), + ( "GL_SAMPLE_ALPHA_TO_ONE_ARB", GLboolean, + ["ctx->Multisample.SampleAlphaToOne"], "", ["ARB_multisample"] ), + ( "GL_SAMPLE_COVERAGE_ARB", GLboolean, + ["ctx->Multisample.SampleCoverage"], "", ["ARB_multisample"] ), + ( "GL_SAMPLE_COVERAGE_VALUE_ARB", GLfloat, + ["ctx->Multisample.SampleCoverageValue"], "", ["ARB_multisample"] ), + ( "GL_SAMPLE_COVERAGE_INVERT_ARB", GLboolean, + ["ctx->Multisample.SampleCoverageInvert"], "", ["ARB_multisample"] ), + ( "GL_SAMPLE_BUFFERS_ARB", GLint, + ["ctx->DrawBuffer->Visual.sampleBuffers"], "", ["ARB_multisample"] ), + ( "GL_SAMPLES_ARB", GLint, + ["ctx->DrawBuffer->Visual.samples"], "", ["ARB_multisample"] ), + + # GL_IBM_rasterpos_clip + ( "GL_RASTER_POSITION_UNCLIPPED_IBM", GLboolean, + ["ctx->Transform.RasterPositionUnclipped"], "", ["IBM_rasterpos_clip"] ), + + # GL_NV_point_sprite + ( "GL_POINT_SPRITE_NV", GLboolean, ["ctx->Point.PointSprite"], # == GL_POINT_SPRITE_ARB + "", ["NV_point_sprite", "ARB_point_sprite"] ), + ( "GL_POINT_SPRITE_R_MODE_NV", GLenum, ["ctx->Point.SpriteRMode"], + "", ["NV_point_sprite"] ), + ( "GL_POINT_SPRITE_COORD_ORIGIN", GLenum, ["ctx->Point.SpriteOrigin"], + "", ["NV_point_sprite", "ARB_point_sprite"] ), + + # GL_SGIS_generate_mipmap + ( "GL_GENERATE_MIPMAP_HINT_SGIS", GLenum, ["ctx->Hint.GenerateMipmap"], + "", ["SGIS_generate_mipmap"] ), + + # GL_NV_vertex_program + ( "GL_VERTEX_PROGRAM_BINDING_NV", GLint, + ["(ctx->VertexProgram.Current ? ctx->VertexProgram.Current->Base.Id : 0)"], + "", ["NV_vertex_program"] ), + ( "GL_VERTEX_ATTRIB_ARRAY0_NV", GLboolean, + ["ctx->Array.ArrayObj->VertexAttrib[0].Enabled"], "", ["NV_vertex_program"] ), + ( "GL_VERTEX_ATTRIB_ARRAY1_NV", GLboolean, + ["ctx->Array.ArrayObj->VertexAttrib[1].Enabled"], "", ["NV_vertex_program"] ), + ( "GL_VERTEX_ATTRIB_ARRAY2_NV", GLboolean, + ["ctx->Array.ArrayObj->VertexAttrib[2].Enabled"], "", ["NV_vertex_program"] ), + ( "GL_VERTEX_ATTRIB_ARRAY3_NV", GLboolean, + ["ctx->Array.ArrayObj->VertexAttrib[3].Enabled"], "", ["NV_vertex_program"] ), + ( "GL_VERTEX_ATTRIB_ARRAY4_NV", GLboolean, + ["ctx->Array.ArrayObj->VertexAttrib[4].Enabled"], "", ["NV_vertex_program"] ), + ( "GL_VERTEX_ATTRIB_ARRAY5_NV", GLboolean, + ["ctx->Array.ArrayObj->VertexAttrib[5].Enabled"], "", ["NV_vertex_program"] ), + ( "GL_VERTEX_ATTRIB_ARRAY6_NV", GLboolean, + ["ctx->Array.ArrayObj->VertexAttrib[6].Enabled"], "", ["NV_vertex_program"] ), + ( "GL_VERTEX_ATTRIB_ARRAY7_NV", GLboolean, + ["ctx->Array.ArrayObj->VertexAttrib[7].Enabled"], "", ["NV_vertex_program"] ), + ( "GL_VERTEX_ATTRIB_ARRAY8_NV", GLboolean, + ["ctx->Array.ArrayObj->VertexAttrib[8].Enabled"], "", ["NV_vertex_program"] ), + ( "GL_VERTEX_ATTRIB_ARRAY9_NV", GLboolean, + ["ctx->Array.ArrayObj->VertexAttrib[9].Enabled"], "", ["NV_vertex_program"] ), + ( "GL_VERTEX_ATTRIB_ARRAY10_NV", GLboolean, + ["ctx->Array.ArrayObj->VertexAttrib[10].Enabled"], "", ["NV_vertex_program"] ), + ( "GL_VERTEX_ATTRIB_ARRAY11_NV", GLboolean, + ["ctx->Array.ArrayObj->VertexAttrib[11].Enabled"], "", ["NV_vertex_program"] ), + ( "GL_VERTEX_ATTRIB_ARRAY12_NV", GLboolean, + ["ctx->Array.ArrayObj->VertexAttrib[12].Enabled"], "", ["NV_vertex_program"] ), + ( "GL_VERTEX_ATTRIB_ARRAY13_NV", GLboolean, + ["ctx->Array.ArrayObj->VertexAttrib[13].Enabled"], "", ["NV_vertex_program"] ), + ( "GL_VERTEX_ATTRIB_ARRAY14_NV", GLboolean, + ["ctx->Array.ArrayObj->VertexAttrib[14].Enabled"], "", ["NV_vertex_program"] ), + ( "GL_VERTEX_ATTRIB_ARRAY15_NV", GLboolean, + ["ctx->Array.ArrayObj->VertexAttrib[15].Enabled"], "", ["NV_vertex_program"] ), + ( "GL_MAP1_VERTEX_ATTRIB0_4_NV", GLboolean, + ["ctx->Eval.Map1Attrib[0]"], "", ["NV_vertex_program"] ), + ( "GL_MAP1_VERTEX_ATTRIB1_4_NV", GLboolean, + ["ctx->Eval.Map1Attrib[1]"], "", ["NV_vertex_program"] ), + ( "GL_MAP1_VERTEX_ATTRIB2_4_NV", GLboolean, + ["ctx->Eval.Map1Attrib[2]"], "", ["NV_vertex_program"] ), + ( "GL_MAP1_VERTEX_ATTRIB3_4_NV", GLboolean, + ["ctx->Eval.Map1Attrib[3]"], "", ["NV_vertex_program"] ), + ( "GL_MAP1_VERTEX_ATTRIB4_4_NV", GLboolean, + ["ctx->Eval.Map1Attrib[4]"], "", ["NV_vertex_program"] ), + ( "GL_MAP1_VERTEX_ATTRIB5_4_NV", GLboolean, + ["ctx->Eval.Map1Attrib[5]"], "", ["NV_vertex_program"] ), + ( "GL_MAP1_VERTEX_ATTRIB6_4_NV", GLboolean, + ["ctx->Eval.Map1Attrib[6]"], "", ["NV_vertex_program"] ), + ( "GL_MAP1_VERTEX_ATTRIB7_4_NV", GLboolean, + ["ctx->Eval.Map1Attrib[7]"], "", ["NV_vertex_program"] ), + ( "GL_MAP1_VERTEX_ATTRIB8_4_NV", GLboolean, + ["ctx->Eval.Map1Attrib[8]"], "", ["NV_vertex_program"] ), + ( "GL_MAP1_VERTEX_ATTRIB9_4_NV", GLboolean, + ["ctx->Eval.Map1Attrib[9]"], "", ["NV_vertex_program"] ), + ( "GL_MAP1_VERTEX_ATTRIB10_4_NV", GLboolean, + ["ctx->Eval.Map1Attrib[10]"], "", ["NV_vertex_program"] ), + ( "GL_MAP1_VERTEX_ATTRIB11_4_NV", GLboolean, + ["ctx->Eval.Map1Attrib[11]"], "", ["NV_vertex_program"] ), + ( "GL_MAP1_VERTEX_ATTRIB12_4_NV", GLboolean, + ["ctx->Eval.Map1Attrib[12]"], "", ["NV_vertex_program"] ), + ( "GL_MAP1_VERTEX_ATTRIB13_4_NV", GLboolean, + ["ctx->Eval.Map1Attrib[13]"], "", ["NV_vertex_program"] ), + ( "GL_MAP1_VERTEX_ATTRIB14_4_NV", GLboolean, + ["ctx->Eval.Map1Attrib[14]"], "", ["NV_vertex_program"] ), + ( "GL_MAP1_VERTEX_ATTRIB15_4_NV", GLboolean, + ["ctx->Eval.Map1Attrib[15]"], "", ["NV_vertex_program"] ), + + # GL_NV_fragment_program + ( "GL_FRAGMENT_PROGRAM_NV", GLboolean, + ["ctx->FragmentProgram.Enabled"], "", ["NV_fragment_program"] ), + ( "GL_FRAGMENT_PROGRAM_BINDING_NV", GLint, + ["ctx->FragmentProgram.Current ? ctx->FragmentProgram.Current->Base.Id : 0"], + "", ["NV_fragment_program"] ), + ( "GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV", GLint, + ["MAX_NV_FRAGMENT_PROGRAM_PARAMS"], "", ["NV_fragment_program"] ), + + # GL_NV_texture_rectangle + ( "GL_TEXTURE_RECTANGLE_NV", GLboolean, + ["_mesa_IsEnabled(GL_TEXTURE_RECTANGLE_NV)"], "", ["NV_texture_rectangle"] ), + ( "GL_TEXTURE_BINDING_RECTANGLE_NV", GLint, + ["ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_RECT_INDEX]->Name"], + "", ["NV_texture_rectangle"] ), + ( "GL_MAX_RECTANGLE_TEXTURE_SIZE_NV", GLint, + ["ctx->Const.MaxTextureRectSize"], "", ["NV_texture_rectangle"] ), + + # GL_EXT_stencil_two_side + ( "GL_STENCIL_TEST_TWO_SIDE_EXT", GLboolean, + ["ctx->Stencil.TestTwoSide"], "", ["EXT_stencil_two_side"] ), + ( "GL_ACTIVE_STENCIL_FACE_EXT", GLenum, + ["ctx->Stencil.ActiveFace ? GL_BACK : GL_FRONT"], + "", ["EXT_stencil_two_side"] ), + + # GL_NV_light_max_exponent + ( "GL_MAX_SHININESS_NV", GLfloat, + ["ctx->Const.MaxShininess"], "", ["NV_light_max_exponent"] ), + ( "GL_MAX_SPOT_EXPONENT_NV", GLfloat, + ["ctx->Const.MaxSpotExponent"], "", ["NV_light_max_exponent"] ), + + # GL_ARB_vertex_buffer_object + ( "GL_ARRAY_BUFFER_BINDING_ARB", GLint, + ["ctx->Array.ArrayBufferObj->Name"], "", ["ARB_vertex_buffer_object"] ), + ( "GL_VERTEX_ARRAY_BUFFER_BINDING_ARB", GLint, + ["ctx->Array.ArrayObj->Vertex.BufferObj->Name"], "", ["ARB_vertex_buffer_object"] ), + ( "GL_NORMAL_ARRAY_BUFFER_BINDING_ARB", GLint, + ["ctx->Array.ArrayObj->Normal.BufferObj->Name"], "", ["ARB_vertex_buffer_object"] ), + ( "GL_COLOR_ARRAY_BUFFER_BINDING_ARB", GLint, + ["ctx->Array.ArrayObj->Color.BufferObj->Name"], "", ["ARB_vertex_buffer_object"] ), + ( "GL_INDEX_ARRAY_BUFFER_BINDING_ARB", GLint, + ["ctx->Array.ArrayObj->Index.BufferObj->Name"], "", ["ARB_vertex_buffer_object"] ), + ( "GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB", GLint, + ["ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].BufferObj->Name"], + "", ["ARB_vertex_buffer_object"] ), + ( "GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB", GLint, + ["ctx->Array.ArrayObj->EdgeFlag.BufferObj->Name"], "", ["ARB_vertex_buffer_object"] ), + ( "GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB", GLint, + ["ctx->Array.ArrayObj->SecondaryColor.BufferObj->Name"], + "", ["ARB_vertex_buffer_object"] ), + ( "GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB", GLint, + ["ctx->Array.ArrayObj->FogCoord.BufferObj->Name"], + "", ["ARB_vertex_buffer_object"] ), + # GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB - not supported + ( "GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB", GLint, + ["ctx->Array.ElementArrayBufferObj->Name"], + "", ["ARB_vertex_buffer_object"] ), + + # GL_EXT_pixel_buffer_object + ( "GL_PIXEL_PACK_BUFFER_BINDING_EXT", GLint, + ["ctx->Pack.BufferObj->Name"], "", ["EXT_pixel_buffer_object"] ), + ( "GL_PIXEL_UNPACK_BUFFER_BINDING_EXT", GLint, + ["ctx->Unpack.BufferObj->Name"], "", ["EXT_pixel_buffer_object"] ), + + # GL_ARB_vertex_program + ( "GL_VERTEX_PROGRAM_ARB", GLboolean, # == GL_VERTEX_PROGRAM_NV + ["ctx->VertexProgram.Enabled"], "", + ["ARB_vertex_program", "NV_vertex_program"] ), + ( "GL_VERTEX_PROGRAM_POINT_SIZE_ARB", GLboolean, # == GL_VERTEX_PROGRAM_POINT_SIZE_NV + ["ctx->VertexProgram.PointSizeEnabled"], "", + ["ARB_vertex_program", "NV_vertex_program"] ), + ( "GL_VERTEX_PROGRAM_TWO_SIDE_ARB", GLboolean, # == GL_VERTEX_PROGRAM_TWO_SIDE_NV + ["ctx->VertexProgram.TwoSideEnabled"], "", + ["ARB_vertex_program", "NV_vertex_program"] ), + ( "GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB", GLint, # == GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV + ["ctx->Const.MaxProgramMatrixStackDepth"], "", + ["ARB_vertex_program", "ARB_fragment_program", "NV_vertex_program"] ), + ( "GL_MAX_PROGRAM_MATRICES_ARB", GLint, # == GL_MAX_TRACK_MATRICES_NV + ["ctx->Const.MaxProgramMatrices"], "", + ["ARB_vertex_program", "ARB_fragment_program", "NV_vertex_program"] ), + ( "GL_CURRENT_MATRIX_STACK_DEPTH_ARB", GLboolean, # == GL_CURRENT_MATRIX_STACK_DEPTH_NV + ["ctx->CurrentStack->Depth + 1"], "", + ["ARB_vertex_program", "ARB_fragment_program", "NV_vertex_program"] ), + ( "GL_CURRENT_MATRIX_ARB", GLfloat, # == GL_CURRENT_MATRIX_NV + ["matrix[0]", "matrix[1]", "matrix[2]", "matrix[3]", + "matrix[4]", "matrix[5]", "matrix[6]", "matrix[7]", + "matrix[8]", "matrix[9]", "matrix[10]", "matrix[11]", + "matrix[12]", "matrix[13]", "matrix[14]", "matrix[15]" ], + "const GLfloat *matrix = ctx->CurrentStack->Top->m;", + ["ARB_vertex_program", "ARB_fragment_program", "NV_fragment_program"] ), + ( "GL_TRANSPOSE_CURRENT_MATRIX_ARB", GLfloat, + ["matrix[0]", "matrix[4]", "matrix[8]", "matrix[12]", + "matrix[1]", "matrix[5]", "matrix[9]", "matrix[13]", + "matrix[2]", "matrix[6]", "matrix[10]", "matrix[14]", + "matrix[3]", "matrix[7]", "matrix[11]", "matrix[15]"], + "const GLfloat *matrix = ctx->CurrentStack->Top->m;", + ["ARB_vertex_program", "ARB_fragment_program"] ), + ( "GL_MAX_VERTEX_ATTRIBS_ARB", GLint, + ["ctx->Const.VertexProgram.MaxAttribs"], "", ["ARB_vertex_program"] ), + ( "GL_PROGRAM_ERROR_POSITION_ARB", GLint, # == GL_PROGRAM_ERROR_POSITION_NV + ["ctx->Program.ErrorPos"], "", ["NV_vertex_program", + "ARB_vertex_program", "NV_fragment_program", "ARB_fragment_program"] ), + + # GL_ARB_fragment_program + ( "GL_FRAGMENT_PROGRAM_ARB", GLboolean, + ["ctx->FragmentProgram.Enabled"], "", ["ARB_fragment_program"] ), + ( "GL_MAX_TEXTURE_COORDS_ARB", GLint, # == GL_MAX_TEXTURE_COORDS_NV + ["ctx->Const.MaxTextureCoordUnits"], "", + ["ARB_fragment_program", "NV_fragment_program"] ), + ( "GL_MAX_TEXTURE_IMAGE_UNITS_ARB", GLint, # == GL_MAX_TEXTURE_IMAGE_UNITS_NV + ["ctx->Const.MaxTextureImageUnits"], "", + ["ARB_fragment_program", "NV_fragment_program"] ), + + # GL_EXT_depth_bounds_test + ( "GL_DEPTH_BOUNDS_TEST_EXT", GLboolean, + ["ctx->Depth.BoundsTest"], "", ["EXT_depth_bounds_test"] ), + ( "GL_DEPTH_BOUNDS_EXT", GLfloat, + ["ctx->Depth.BoundsMin", "ctx->Depth.BoundsMax"], + "", ["EXT_depth_bounds_test"] ), + + # GL_MESA_program_debug + ( "GL_FRAGMENT_PROGRAM_CALLBACK_MESA", GLboolean, + ["ctx->FragmentProgram.CallbackEnabled"], "", ["MESA_program_debug"] ), + ( "GL_VERTEX_PROGRAM_CALLBACK_MESA", GLboolean, + ["ctx->VertexProgram.CallbackEnabled"], "", ["MESA_program_debug"] ), + ( "GL_FRAGMENT_PROGRAM_POSITION_MESA", GLint, + ["ctx->FragmentProgram.CurrentPosition"], "", ["MESA_program_debug"] ), + ( "GL_VERTEX_PROGRAM_POSITION_MESA", GLint, + ["ctx->VertexProgram.CurrentPosition"], "", ["MESA_program_debug"] ), + + # GL_ARB_draw_buffers + ( "GL_MAX_DRAW_BUFFERS_ARB", GLint, + ["ctx->Const.MaxDrawBuffers"], "", ["ARB_draw_buffers"] ), + ( "GL_DRAW_BUFFER0_ARB", GLenum, + ["ctx->DrawBuffer->ColorDrawBuffer[0]"], "", ["ARB_draw_buffers"] ), + ( "GL_DRAW_BUFFER1_ARB", GLenum, + ["buffer"], + """GLenum buffer; + if (pname - GL_DRAW_BUFFER0_ARB >= ctx->Const.MaxDrawBuffers) { + _mesa_error(ctx, GL_INVALID_ENUM, "glGet(GL_DRAW_BUFFERx_ARB)"); + return; + } + buffer = ctx->DrawBuffer->ColorDrawBuffer[1];""", ["ARB_draw_buffers"] ), + ( "GL_DRAW_BUFFER2_ARB", GLenum, + ["buffer"], + """GLenum buffer; + if (pname - GL_DRAW_BUFFER0_ARB >= ctx->Const.MaxDrawBuffers) { + _mesa_error(ctx, GL_INVALID_ENUM, "glGet(GL_DRAW_BUFFERx_ARB)"); + return; + } + buffer = ctx->DrawBuffer->ColorDrawBuffer[2];""", ["ARB_draw_buffers"] ), + ( "GL_DRAW_BUFFER3_ARB", GLenum, + ["buffer"], + """GLenum buffer; + if (pname - GL_DRAW_BUFFER0_ARB >= ctx->Const.MaxDrawBuffers) { + _mesa_error(ctx, GL_INVALID_ENUM, "glGet(GL_DRAW_BUFFERx_ARB)"); + return; + } + buffer = ctx->DrawBuffer->ColorDrawBuffer[3];""", ["ARB_draw_buffers"] ), + # XXX Add more GL_DRAW_BUFFERn_ARB entries as needed in the future + + # GL_OES_read_format + ( "GL_IMPLEMENTATION_COLOR_READ_TYPE_OES", GLint, + ["ctx->Const.ColorReadType"], "", ["OES_read_format"] ), + ( "GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES", GLint, + ["ctx->Const.ColorReadFormat"], "", ["OES_read_format"] ), + + # GL_ATI_fragment_shader + ( "GL_NUM_FRAGMENT_REGISTERS_ATI", GLint, ["6"], "", ["ATI_fragment_shader"] ), + ( "GL_NUM_FRAGMENT_CONSTANTS_ATI", GLint, ["8"], "", ["ATI_fragment_shader"] ), + ( "GL_NUM_PASSES_ATI", GLint, ["2"], "", ["ATI_fragment_shader"] ), + ( "GL_NUM_INSTRUCTIONS_PER_PASS_ATI", GLint, ["8"], "", ["ATI_fragment_shader"] ), + ( "GL_NUM_INSTRUCTIONS_TOTAL_ATI", GLint, ["16"], "", ["ATI_fragment_shader"] ), + ( "GL_COLOR_ALPHA_PAIRING_ATI", GLboolean, ["GL_TRUE"], "", ["ATI_fragment_shader"] ), + ( "GL_NUM_LOOPBACK_COMPONENTS_ATI", GLint, ["3"], "", ["ATI_fragment_shader"] ), + ( "GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI", GLint, ["3"], "", ["ATI_fragment_shader"] ), + + # OpenGL 2.0 + ( "GL_STENCIL_BACK_FUNC", GLenum, ["ctx->Stencil.Function[1]"], "", None ), + ( "GL_STENCIL_BACK_VALUE_MASK", GLint, ["ctx->Stencil.ValueMask[1]"], "", None ), + ( "GL_STENCIL_BACK_WRITEMASK", GLint, ["ctx->Stencil.WriteMask[1]"], "", None ), + ( "GL_STENCIL_BACK_REF", GLint, ["ctx->Stencil.Ref[1]"], "", None ), + ( "GL_STENCIL_BACK_FAIL", GLenum, ["ctx->Stencil.FailFunc[1]"], "", None ), + ( "GL_STENCIL_BACK_PASS_DEPTH_FAIL", GLenum, ["ctx->Stencil.ZFailFunc[1]"], "", None ), + ( "GL_STENCIL_BACK_PASS_DEPTH_PASS", GLenum, ["ctx->Stencil.ZPassFunc[1]"], "", None ), + + # GL_EXT_framebuffer_object + ( "GL_FRAMEBUFFER_BINDING_EXT", GLint, ["ctx->DrawBuffer->Name"], "", + ["EXT_framebuffer_object"] ), + ( "GL_RENDERBUFFER_BINDING_EXT", GLint, + ["ctx->CurrentRenderbuffer ? ctx->CurrentRenderbuffer->Name : 0"], "", + ["EXT_framebuffer_object"] ), + ( "GL_MAX_COLOR_ATTACHMENTS_EXT", GLint, + ["ctx->Const.MaxColorAttachments"], "", + ["EXT_framebuffer_object"] ), + ( "GL_MAX_RENDERBUFFER_SIZE_EXT", GLint, + ["ctx->Const.MaxRenderbufferSize"], "", + ["EXT_framebuffer_object"] ), + + # GL_EXT_framebuffer_blit + # NOTE: GL_DRAW_FRAMEBUFFER_BINDING_EXT == GL_FRAMEBUFFER_BINDING_EXT + ( "GL_READ_FRAMEBUFFER_BINDING_EXT", GLint, ["ctx->ReadBuffer->Name"], "", + ["EXT_framebuffer_blit"] ), + + # GL_ARB_fragment_shader + ( "GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB", GLint, + ["ctx->Const.FragmentProgram.MaxUniformComponents"], "", + ["ARB_fragment_shader"] ), + ( "GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB", GLenum, + ["ctx->Hint.FragmentShaderDerivative"], "", ["ARB_fragment_shader"] ), + + # GL_ARB_vertex_shader + ( "GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB", GLint, + ["ctx->Const.VertexProgram.MaxUniformComponents"], "", + ["ARB_vertex_shader"] ), + ( "GL_MAX_VARYING_FLOATS_ARB", GLint, + ["ctx->Const.MaxVarying * 4"], "", ["ARB_vertex_shader"] ), + ( "GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB", GLint, + ["ctx->Const.MaxVertexTextureImageUnits"], "", ["ARB_vertex_shader"] ), + ( "GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB", GLint, + ["MAX_COMBINED_TEXTURE_IMAGE_UNITS"], "", ["ARB_vertex_shader"] ), + + # GL_ARB_shader_objects + # Actually, this token isn't part of GL_ARB_shader_objects, but is + # close enough for now. + ( "GL_CURRENT_PROGRAM", GLint, + ["ctx->Shader.CurrentProgram ? ctx->Shader.CurrentProgram->Name : 0"], + "", ["ARB_shader_objects"] ) +] + + +def ConversionFunc(fromType, toType): + """Return the name of the macro to convert between two data types.""" + if fromType == toType: + return "" + elif fromType == GLfloat and toType == GLint: + return "IROUND" + elif fromType == GLfloatN and toType == GLfloat: + return "" + elif fromType == GLint and toType == GLfloat: # but not GLfloatN! + return "(GLfloat)" + else: + if fromType == GLfloatN: + fromType = GLfloat + fromStr = TypeStrings[fromType] + fromStr = string.upper(fromStr[2:]) + toStr = TypeStrings[toType] + toStr = string.upper(toStr[2:]) + return fromStr + "_TO_" + toStr + + +def EmitGetFunction(stateVars, returnType): + """Emit the code to implement glGetBooleanv, glGetIntegerv or glGetFloatv.""" + assert (returnType == GLboolean or + returnType == GLint or + returnType == GLfloat) + + strType = TypeStrings[returnType] + # Capitalize first letter of return type + if returnType == GLint: + function = "GetIntegerv" + elif returnType == GLboolean: + function = "GetBooleanv" + elif returnType == GLfloat: + function = "GetFloatv" + else: + abort() + + print "void GLAPIENTRY" + print "_mesa_%s( GLenum pname, %s *params )" % (function, strType) + print "{" + print " GET_CURRENT_CONTEXT(ctx);" + print " ASSERT_OUTSIDE_BEGIN_END(ctx);" + print "" + print " if (!params)" + print " return;" + print "" + print " if (ctx->NewState)" + print " _mesa_update_state(ctx);" + print "" + print " if (ctx->Driver.%s &&" % function + print " ctx->Driver.%s(ctx, pname, params))" % function + print " return;" + print "" + print " switch (pname) {" + + for (name, varType, state, optionalCode, extensions) in stateVars: + print " case " + name + ":" + if extensions: + if len(extensions) == 1: + print (' CHECK_EXT1(%s, "%s");' % + (extensions[0], function)) + elif len(extensions) == 2: + print (' CHECK_EXT2(%s, %s, "%s");' % + (extensions[0], extensions[1], function)) + elif len(extensions) == 3: + print (' CHECK_EXT3(%s, %s, %s, "%s");' % + (extensions[0], extensions[1], extensions[2], function)) + else: + 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 + n = len(state) + for i in range(n): + if conversion: + print " params[%d] = %s(%s);" % (i, conversion, state[i]) + else: + print " params[%d] = %s;" % (i, state[i]) + if optionalCode: + print " }" + print " break;" + + print " default:" + print ' _mesa_error(ctx, GL_INVALID_ENUM, "gl%s(pname=0x%%x)", pname);' % function + print " }" + print "}" + print "" + return + + + +def EmitHeader(): + """Print the get.c file header.""" + print """ +/*** + *** NOTE!!! DO NOT EDIT THIS FILE!!! IT IS GENERATED BY get_gen.py + ***/ + +#include "glheader.h" +#include "context.h" +#include "enable.h" +#include "extensions.h" +#include "fbobject.h" +#include "get.h" +#include "macros.h" +#include "mtypes.h" +#include "state.h" +#include "texcompress.h" + + +#define FLOAT_TO_BOOLEAN(X) ( (X) ? GL_TRUE : GL_FALSE ) + +#define INT_TO_BOOLEAN(I) ( (I) ? GL_TRUE : GL_FALSE ) + +#define BOOLEAN_TO_INT(B) ( (GLint) (B) ) +#define BOOLEAN_TO_FLOAT(B) ( (B) ? 1.0F : 0.0F ) + + +/* + * Check if named extension is enabled, if not generate error and return. + */ +#define CHECK_EXT1(EXT1, FUNC) \\ + if (!ctx->Extensions.EXT1) { \\ + _mesa_error(ctx, GL_INVALID_ENUM, FUNC "(0x%x)", (int) pname); \\ + return; \\ + } + +/* + * Check if either of two extensions is enabled. + */ +#define CHECK_EXT2(EXT1, EXT2, FUNC) \\ + if (!ctx->Extensions.EXT1 && !ctx->Extensions.EXT2) { \\ + _mesa_error(ctx, GL_INVALID_ENUM, FUNC "(0x%x)", (int) pname); \\ + return; \\ + } + +/* + * Check if either of three extensions is enabled. + */ +#define CHECK_EXT3(EXT1, EXT2, EXT3, FUNC) \\ + if (!ctx->Extensions.EXT1 && !ctx->Extensions.EXT2 && \\ + !ctx->Extensions.EXT3) { \\ + _mesa_error(ctx, GL_INVALID_ENUM, FUNC "(0x%x)", (int) pname); \\ + return; \\ + } + +/* + * Check if either of four extensions is enabled. + */ +#define CHECK_EXT4(EXT1, EXT2, EXT3, EXT4, FUNC) \\ + if (!ctx->Extensions.EXT1 && !ctx->Extensions.EXT2 && \\ + !ctx->Extensions.EXT3 && !ctx->Extensions.EXT4) { \\ + _mesa_error(ctx, GL_INVALID_ENUM, FUNC "(0x%x)", (int) pname); \\ + return; \\ + } + +""" + return + + + +def EmitGetDoublev(): + print """ +void GLAPIENTRY +_mesa_GetDoublev( GLenum pname, GLdouble *params ) +{ + const GLfloat magic = -1234.5F; + GLfloat values[16]; + GLuint i; + + if (!params) + return; + + /* Init temp array to magic numbers so we can figure out how many values + * are returned by the GetFloatv() call. + */ + for (i = 0; i < 16; i++) + values[i] = magic; + + _mesa_GetFloatv(pname, values); + + for (i = 0; i < 16 && values[i] != magic; i++) + params[i] = (GLdouble) values[i]; +} +""" + + + + +EmitHeader() +# XXX Maybe sort the StateVars list +EmitGetFunction(StateVars, GLboolean) +EmitGetFunction(StateVars, GLfloat) +EmitGetFunction(StateVars, GLint) +EmitGetDoublev() + --- mesa-glw-7.4.orig/src/mesa/main/sources +++ mesa-glw-7.4/src/mesa/main/sources @@ -0,0 +1,158 @@ +# 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 \ +dlopen.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 \ +dlopen.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 --- mesa-glw-7.4.orig/src/mesa/main/Makefile.win +++ mesa-glw-7.4/src/mesa/main/Makefile.win @@ -0,0 +1,208 @@ +# Makefile for Win32 +# +# NOTE: the install target may overwrite important files in the system dirs +# Check first, before making the install target. +# +# This builds both the osmesa and Windows drivers. +# + +!include + +TOP = .. +SUBDIRS = osmesa.dir + +CORE_SRCS = \ + api_loopback.c \ + api_noop.c \ + api_validate.c \ + accum.c \ + arbprogram.c \ + attrib.c \ + blend.c \ + bufferobj.c \ + buffers.c \ + clip.c \ + colortab.c \ + context.c \ + convolve.c \ + debug.c \ + depth.c \ + dispatch.c \ + dlist.c \ + drawpix.c \ + enable.c \ + enums.c \ + eval.c \ + extensions.c \ + feedback.c \ + fog.c \ + get.c \ + glapi.c \ + glthread.c \ + hash.c \ + hint.c \ + histogram.c \ + image.c \ + imports.c \ + light.c \ + lines.c \ + matrix.c \ + nvprogram.c \ + nvfragparse.c \ + nvvertexec.c \ + nvvertparse.c \ + pixel.c \ + points.c \ + polygon.c \ + rastpos.c \ + state.c \ + stencil.c \ + texcompress.c \ + texcompress_fxt1.c \ + texcompress_s3tc.c \ + teximage.c \ + texformat.c \ + texobj.c \ + texstate.c \ + texstore.c \ + varray.c \ + vtxfmt.c \ +# X86\x86.c \ +# X86\common_x86.c \ +# X86\3dnow.c \ +# X86\sse.c \ + math\m_debug_norm.c \ + math\m_debug_xform.c \ + math\m_eval.c \ + math\m_matrix.c \ + math\m_translate.c \ + math\m_vector.c \ + math\m_xform.c \ + array_cache\ac_context.c \ + array_cache\ac_import.c \ + swrast\s_aaline.c \ + swrast\s_aatriangle.c \ + swrast\s_accum.c \ + swrast\s_alpha.c \ + swrast\s_alphabuf.c \ + swrast\s_bitmap.c \ + swrast\s_blend.c \ + swrast\s_buffers.c \ + swrast\s_copypix.c \ + swrast\s_context.c \ + swrast\s_depth.c \ + swrast\s_drawpix.c \ + swrast\s_feedback.c \ + swrast\s_fog.c \ + swrast\s_imaging.c \ + swrast\s_lines.c \ + swrast\s_logic.c \ + swrast\s_masking.c \ + swrast\s_nvfragprog.c \ + swrast\s_pixeltex.c \ + swrast\s_points.c \ + swrast\s_readpix.c \ + swrast\s_span.c \ + swrast\s_stencil.c \ + swrast\s_texstore.c \ + swrast\s_texture.c \ + swrast\s_triangle.c \ + swrast\s_zoom.c \ + swrast_setup\ss_context.c \ + swrast_setup\ss_triangle.c \ + swrast_setup\ss_vb.c \ + tnl\t_array_api.c \ + tnl\t_array_import.c \ + tnl\t_context.c \ + tnl\t_eval_api.c \ + tnl\t_imm_alloc.c \ + tnl\t_imm_api.c \ + tnl\t_imm_debug.c \ + tnl\t_imm_dlist.c \ + tnl\t_imm_elt.c \ + tnl\t_imm_eval.c \ + tnl\t_imm_exec.c \ + tnl\t_imm_fixup.c \ + tnl\t_pipeline.c \ + tnl\t_vb_fog.c \ + tnl\t_vb_light.c \ + tnl\t_vb_normals.c \ + tnl\t_vb_points.c \ + tnl\t_vb_program.c \ + tnl\t_vb_render.c \ + tnl\t_vb_texgen.c \ + tnl\t_vb_texmat.c \ + tnl\t_vb_vertex.c + +DRIVER_SRCS = \ + Trace\tr_context.c \ + Trace\tr_control.c \ + Trace\tr_error.c \ + Trace\tr_support.c \ + Trace\tr_wrapper.c \ + Trace\tr_write.c \ + Windows\wgl.c \ + Windows\wmesa.c + +ASM_SRCS = + +SRCS = $(CORE_SRCS) $(DRIVER_SRCS) + +all : mesadll $(SUBDIRS) + +!include "$(TOP)/mesawin32.mak" + +mesadll : $(MESADLL) + +CFLAGS = $(cvarsdll) $(CFLAGS) -D_OPENGL32_ -DBUILD_GL32 -DNO_PARALLEL -DNO_STEREO +!IFNDEF NODEBUG +CFLAGS = $(CFLAGS) -DMESA_DEBUG +!ENDIF +LFLAGS = $(dlllflags) $(lcommon) $(LFLAGS) + +OBJS = $(ASM_SRCS:.S=.obj) $(CORE_SRCS:.c=.obj) $(DRIVER_SRCS:.c=.obj) +LIBS = winmm.lib $(guilibsdll) + +$(MESADLL) : $(OBJS) mesa.def + $(link) $(LFLAGS) -out:$(MESADLL) -def:mesa.def $(OBJS) $(LIBS) + @echo "copying Mesa dynamic link library to lib directory..." + -copy $(MESADLL) ..\lib + @echo "copying Mesa import library to lib directory..." + -copy $(MESALIB) ..\lib + +$(SUBDIRS) : + @echo. + @echo Making in $* directory + @cd $* + @nmake -f Makefile.win -nologo + @cd .. + +install : $(MESADLL) + @echo. + @echo "copying Mesa dynamic link library to system directory..." + -copy $(MESADLL) $(DLLINSTALL) + @echo "copying Mesa header files to include directory..." + -copy ..\..\include\GL\gl.h $(INCLUDEINSTALL) + -copy ..\..\include\GL\glext.h $(INCLUDEINSTALL) + @echo "copying Mesa import library to library directory..." + -copy $(MESALIB) $(LIBINSTALL) + +clean :: + @del /f tnl\*.obj + @del /f swrast_setup\*.obj + @del /f math\*.obj + @del /f array_cache\*.obj + @del /f swrast\*.obj + @del /f Trace\*.obj + @del /f osmesa\*.obj + @del /f Windows\*.obj + +clobber :: + @del /f OSmesa\*.lib + @del /f OSmesa\*.exp + @del /f OSmesa\*.dll + +# override default inference rule with one that writes the object to +# the same subdir that the c file is in. +.c.obj : + $(cc) $(CFLAGS) -I. $< /Fo$*.obj --- mesa-glw-7.4.orig/src/mesa/main/Makefile.ugl +++ mesa-glw-7.4/src/mesa/main/Makefile.ugl @@ -0,0 +1,364 @@ +# Mesa 3-D graphics library +# Version: 4.1 +# +# Copyright (C) 2001 Wind River Systems, Inc + +# The MIT License +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. + +# Makefile for core library + +# This makefile can moved all objects files in MESA_OBJ for use with +# ld in windShell or create a library from objects files in their +# associated .c folder. +# +# For an easy inclusion of lib$(CPU)$(TOOL)GL.a in vxworks image, this +# makefile collects together all .o in an only file +# (obj$(CPU)$(TOOL)GL.o). This operation is unnecessary for +# lib$(CPU)$(TOOL)OSMesa.a and lib$(CPU)$(TOOL)UglMesa.a because they +# already contain only one file. +# +##### MACROS ##### +MESA_MAJOR=4 +MESA_MINOR=1 +MESA_TINY=0 +VERSION=$(MESA_MAJOR).$(MESA_MINOR) + +GL_MAJOR = 1 +GL_MINOR = 2 +GL_TINY = 0$(MESA_MAJOR)0$(MESA_MINOR)0$(MESA_TINY) + +##### RULES ##### + +include ..\rules.windml + +#### GL ##### + +GL_SOURCES = \ + api_arrayelt.c \ + api_loopback.c \ + api_noop.c \ + api_validate.c \ + accum.c \ + arbprogram.c \ + attrib.c \ + blend.c \ + bufferobj.c \ + buffers.c \ + clip.c \ + colortab.c \ + context.c \ + convolve.c \ + debug.c \ + depth.c \ + dispatch.c \ + dlist.c \ + drawpix.c \ + enable.c \ + enums.c \ + eval.c \ + extensions.c \ + feedback.c \ + fog.c \ + get.c \ + glapi.c \ + glthread.c \ + hash.c \ + hint.c \ + histogram.c \ + image.c \ + imports.c \ + light.c \ + lines.c \ + matrix.c \ + pixel.c \ + points.c \ + polygon.c \ + rastpos.c \ + state.c \ + stencil.c \ + texcompress.c \ + texformat.c \ + teximage.c \ + texobj.c \ + texstate.c \ + texstore.c \ + texutil.c \ + varray.c \ + vtxfmt.c \ + X86/x86.c \ + X86/common_x86.c \ + X86/3dnow.c \ + X86/sse.c \ + math/m_debug_clip.c \ + math/m_debug_norm.c \ + math/m_debug_vertex.c \ + math/m_debug_xform.c \ + math/m_eval.c \ + math/m_matrix.c \ + math/m_translate.c \ + math/m_vector.c \ + math/m_vertices.c \ + math/m_xform.c \ + array_cache/ac_context.c \ + array_cache/ac_import.c \ + swrast/s_aaline.c \ + swrast/s_aatriangle.c \ + swrast/s_accum.c \ + swrast/s_alpha.c \ + swrast/s_alphabuf.c \ + swrast/s_bitmap.c \ + swrast/s_blend.c \ + swrast/s_buffers.c \ + swrast/s_copypix.c \ + swrast/s_context.c \ + swrast/s_depth.c \ + swrast/s_drawpix.c \ + swrast/s_feedback.c \ + swrast/s_fog.c \ + swrast/s_imaging.c \ + swrast/s_lines.c \ + swrast/s_logic.c \ + swrast/s_masking.c \ + swrast/s_pixeltex.c \ + swrast/s_points.c \ + swrast/s_readpix.c \ + swrast/s_span.c \ + swrast/s_stencil.c \ + swrast/s_texture.c \ + swrast/s_texstore.c \ + swrast/s_triangle.c \ + swrast/s_zoom.c \ + swrast_setup/ss_context.c \ + swrast_setup/ss_triangle.c \ + swrast_setup/ss_vb.c \ + tnl/t_array_api.c \ + tnl/t_array_import.c \ + tnl/t_context.c \ + tnl/t_eval_api.c \ + tnl/t_imm_alloc.c \ + tnl/t_imm_api.c \ + tnl/t_imm_debug.c \ + tnl/t_imm_dlist.c \ + tnl/t_imm_elt.c \ + tnl/t_imm_eval.c \ + tnl/t_imm_exec.c \ + tnl/t_imm_fixup.c \ + tnl/t_pipeline.c \ + tnl/t_vb_fog.c \ + tnl/t_vb_light.c \ + tnl/t_vb_normals.c \ + tnl/t_vb_points.c \ + tnl/t_vb_render.c \ + tnl/t_vb_texgen.c \ + tnl/t_vb_texmat.c \ + tnl/t_vb_vertex.c + +GL_OBJECTS = $(GL_SOURCES:.c=.o) +GL_OBJNAME = $(MESA_LIBDIR)/objMesaGL.o + +#### X86 ##### + +x86_files = \ + X86/common_x86_asm.S \ + X86/glapi_x86.S \ + X86/x86_cliptest.S \ + X86/x86_vertex.S \ + X86/x86_xform2.S \ + X86/x86_xform3.S \ + X86/x86_xform4.S \ + +x3dnow_files = \ + X86/3dnow_normal.S \ + X86/3dnow_vertex.S \ + X86/3dnow_xform1.S \ + X86/3dnow_xform2.S \ + X86/3dnow_xform3.S \ + X86/3dnow_xform4.S + +sse_files = \ + X86/sse_normal.S \ + X86/sse_vertex.S \ + X86/sse_xform1.S \ + X86/sse_xform2.S \ + X86/sse_xform3.S \ + X86/sse_xform4.S + +mmx_files = X86/mmx_blend.S + +X86_OBJNAME = $(MESA_LIBDIR)/objMesaX86.o + +##### UGL ##### + +UGL_SOURCES = \ + windml/ugl_api.c \ + windml/ugl_dd.c \ + windml/ugl_span.c \ + windml/ugl_line.c \ + windml/ugl_tri.c \ + windml/tornado/torMesaUGLInit.c + +UGL_OBJECTS = $(UGL_SOURCES:.c=.o) +UGL_OBJNAME = $(MESA_LIBDIR)/objMesaUGL.o + +##### OS ##### + +OS_SOURCES = OSmesa/osmesa.c windml/tornado/torMesaOSInit.c +OS_OBJECTS = $(OS_SOURCES:.c=.o) +OS_OBJNAME = $(MESA_LIBDIR)/objMesaOS.o + +##### GLUTSHAPES ##### + +GLUTSHAPES_SOURCES = \ + windml/ugl_glutshapes.c \ + windml/tornado/torGLUTShapesInit.c + +GLUTSHAPES_OBJECTS = $(GLUTSHAPES_SOURCES:.c=.o) +GLUTSHAPES_OBJNAME = $(MESA_LIBDIR)/objGLUTShapes.o + +SOURCES = $(GL_SOURCES) $(UGL_SOURCES) $(OS_SOURCES) \ + $(GLUTSHAPES_SOURCES) + +##### TARGETS ##### + +all: depend.$(CPU)$(TOOL) cfgX86 $(X86_OBJNAME) $(GL_OBJNAME)\ +$(UGL_OBJNAME) $(OS_OBJNAME) $(GLUTSHAPES_OBJNAME) + +#histogram.o: +# $(CC) $(CFLAGS) -O1 $(OPTION_OBJECT_ONLY) $(OPTION_OBJECT_NAME)$@ $< + +#image.o: +# $(CC) $(CFLAGS) -O1 $(OPTION_OBJECT_ONLY) $(OPTION_OBJECT_NAME)$@ $< + +cfgX86: +ifdef HAVE_3DNOW +x3dnow_sources = $(x3dnow_files) +CFLAGS_3DNOW = -DUSE_3DNOW_ASM +HAVE_X86 = 1 +endif +ifdef HAVE_SSE +sse_sources = $(sse_files) +CFLAGS_SSE = -DUSE_SSE_ASM +HAVE_X86 = 1 +endif +ifdef HAVE_MMX +mmx_sources = $(mmx_files) +CFLAGS_MMX = -DUSE_MMX_ASM +HAVE_X86 = 1 +endif +ifdef HAVE_X86 +x86_sources = $(x86_files) +CFLAGS_X86 = -DUSE_X86_ASM +endif +X86_SOURCES = $(x86_sources) $(mmx_sources) \ + $(x3dnow_sources) $(sse_sources) +X86_OBJECTS = $(X86_SOURCES:.S=.o) +CFLAGS_USE_X86 = $(CFLAGS_3DNOW) $(CFLAGS_SSE) $(CFLAGS_MMX) $(CFLAGS_X86) + +#X86/matypes.h: mtypes.h tnl/t_context.h X86/gen_matypes.c +# $(CC) -I ./ X86/gen_matypes.c -o X86/gen_matypes +# ./X86/gen_matypes > X86/matypes.h +# $(RM) X86/gen_matypes +# $(RM) X86/gen_matypes.o + +# Make the Mesax86 library +$(X86_OBJNAME): $(X86_OBJECTS) +ifdef HAVE_X86 +# $(LD) -r $(X86_OBJECTS) -o $(MESA_OBJNAME) + $(LD) -r $(X86_OBJECTS) -o $(X86_OBJNAME) +# $(AR) rus $(MESA_LIBNAME) $(X86_OBJNAME) +# $(RM) $(X86_OBJNAME) +endif + +# Make the GL library +$(GL_OBJNAME): $(GL_OBJECTS) +# $(LD) -r $(GL_OBJECTS) -o $(MESA_OBJNAME) + $(LD) -r $(GL_OBJECTS) -o $(GL_OBJNAME) +# $(AR) rus $(MESA_LIBNAME) $(GL_OBJNAME) +# $(AR) rus $(VX_LIBNAME) $(GL_OBJNAME) +# $(RM) $(GL_OBJNAME) + +# Make the UGLMesa library +$(UGL_OBJNAME): $(UGL_OBJECTS) +# $(LD) -r $(UGL_OBJECTS) -o $(MESA_OBJNAME) + $(LD) -r $(UGL_OBJECTS) -o $(UGL_OBJNAME) +# $(AR) rus $(MESA_LIBNAME) $(UGL_OBJNAME) +# $(AR) rus $(VX_LIBNAME) $(UGL_OBJNAME) +# $(RM) $(UGL_OBJNAME) + +# Make the OSMesa library +$(OS_OBJNAME): $(OS_OBJECTS) +# $(LD) -r $(OS_OBJECTS) -o $(MESA_OBJNAME) + $(LD) -r $(OS_OBJECTS) -o $(OS_OBJNAME) +# $(AR) rus $(MESA_LIBNAME) $(OS_OBJNAME) +# $(AR) rus $(VX_LIBNAME) $(OS_OBJNAME) +# $(RM) $(OS_OBJNAME) + +# Make the GLUT Shapes library +$(GLUTSHAPES_OBJNAME): $(GLUTSHAPES_OBJECTS) +# $(LD) -r $(GLUTSHAPES_OBJECTS) -o $(MESA_OBJNAME) + $(LD) -r $(GLUTSHAPES_OBJECTS) -o $(GLUTSHAPES_OBJNAME) +# $(AR) rus $(MESA_LIBNAME) $(GLUTSHAPES_OBJNAME) +# $(AR) rus $(VX_LIBNAME) $(GLUTSHAPES_OBJNAME) +# $(RM) $(GLUTSHAPES_OBJNAME) + +depend.$(CPU)$(TOOL): +ifeq ($(WIND_HOST_TYPE),x86-win32) + @ $(RM) $@ + @ $(ECHO) Creating depend.$(CPU)$(TOOL) +ifneq ($(SOURCES),) + @ for %f in ($(SOURCES)) do \ + $(CC) -MM $(CFLAGS) %f >>$@ +endif +else +Makefile + @ $(RM) $@ + @ $(ECHO) "Creating depend.$(CPU)$(TOOL)" +ifneq ($(SOURCES),) + @ for FILE in $(filter-out $(NODEPENDOBJS), $(SOURCES)); \ + do \ + $(CC) -MM $(CFLAGS) $$FILE \ + | $(TCL) $(BIN_DIR)/depend.tcl $(TGT_DIR) >>$@; \ + done +endif +endif + +.PHONY = clean + +clean: +# $(AR) d $(MESA_LIBNAME) $(GL_OBJNAME) +# $(AR) d $(MESA_LIBNAME) $(UGL_OBJNAME) +# $(AR) d $(MESA_LIBNAME) $(OS_OBJNAME) +# $(AR) d $(MESA_LIBNAME) $(GLUTSHAPES_OBJNAME) +# $(AR) d $(VX_LIBNAME) $(GL_OBJNAME) +# $(AR) d $(VX_LIBNAME) $(UGL_OBJNAME) +# $(AR) d $(VX_LIBNAME) $(OS_OBJNAME) +# $(AR) d $(VX_LIBNAME) $(GLUTSHAPES_OBJNAME) + $(RM) $(GL_OBJECTS) + $(RM) $(UGL_OBJECTS) + $(RM) $(OS_OBJECTS) + $(RM) $(GLUTSHAPES_OBJECTS) + $(RM) $(GL_OBJNAME) + $(RM) $(UGL_OBJNAME) + $(RM) $(OS_OBJNAME) + $(RM) $(GLUTSHAPES_OBJNAME) + $(RM) depend.$(CPU)$(TOOL) + +include depend.$(CPU)$(TOOL) + --- mesa-glw-7.4.orig/src/mesa/drivers/dri/r300/Lindent +++ mesa-glw-7.4/src/mesa/drivers/dri/r300/Lindent @@ -0,0 +1,2 @@ +#!/bin/sh +indent -npro -kr -i8 -ts8 -sob -l80 -ss -ncs "$@" --- mesa-glw-7.4.orig/src/mesa/drivers/dri/mga/README +++ mesa-glw-7.4/src/mesa/drivers/dri/mga/README @@ -0,0 +1,26 @@ +MGA DRI driver ported from XF86DRI to FBDRI +by Denis Oliver Kropp + + +INFO + +This driver has been ported from the head branch of XFree86 to +the embedded-1-branch of Mesa. + + +STATUS + +Already working very well as far as I've tested it (16/32 bit). +glxgears runs at 935 fps (G550 32MB AGP 4x, Athlon 1.33) vs 744 fps with XFree. +Other demos (terrain, fire, etc.) have been successfully tested as well. + + +TODO + +- mgaEngineShutdown +- mgaEngineRestore +- SGRAM detection +- remove some unused bits from server/* +- subset driver support +- mgaWaitForVBlank +- deinitialization (from MGADRICloseScreen) a la radeonDestroyScreen --- mesa-glw-7.4.orig/src/mesa/drivers/dri/common/xmlpool/Makefile +++ mesa-glw-7.4/src/mesa/drivers/dri/common/xmlpool/Makefile @@ -0,0 +1,96 @@ +# Convenient makefile for managing translations. + +# Prerequisites: +# - GNU gettext +# - Python + +# Adding new translations +# ----------------------- + +# To start working on a new translation edit the POS=... line +# below. If you want to add for example a french translation, add +# fr.po. + +# Then run "make po" to generate a fresh .po file from translatable +# strings in t_options.h. Now you can edit the new .po file (fr.po in +# the example above) to translate the strings. Please make sure that +# your editor encodes the file in UTF-8. + +# Updating existing translations +# ------------------------------ + +# Run "make po" to update .po files with new translatable strings from +# t_options.h. Now you can edit the .po files you're interested +# in. Please make sure that your editor encodes the file in UTF-8. + +# Updating options.h +# ------------------ + +# Finally run "make" to generate options.h from t_options.h with all +# translations. Now you can rebuild the drivers. Any common options +# used by the drivers will have option descriptions with the latest +# translations. + +# Publishing translations +# ----------------------- + +# To get your translation(s) into Mesa CVS, please send me your +# .po file. + +# More information: +# - info gettext + +# The set of supported languages. Add languages as needed. +POS=de.po es.po nl.po fr.po sv.po + +# +# Don't change anything below, unless you know what you're doing. +# +LANGS=$(POS:%.po=%) +MOS=$(POS:%.po=%/LC_MESSAGES/options.mo) +POT=xmlpool.pot + +.PHONY: all clean pot po mo + +all: options.h + +# Only intermediate files are cleaned up. options.h is not deleted because +# it's in CVS. +clean: + -rm -f $(POT) *~ + -rm -rf $(LANGS) + +# Default target options.h +options.h: t_options.h mo + python gen_xmlpool.py $(LANGS) > options.h + +# Update .mo files from the corresponding .po files. +mo: + @for mo in $(MOS); do \ + lang=$${mo%%/*}; \ + echo "Updating $$mo from $$lang.po."; \ + mkdir -p $${mo%/*}; \ + msgfmt -o $$mo $$lang.po; \ + done + +# Use this target to create or update .po files with new messages in +# driconf.py. +po: $(POS) + +pot: $(POT) + +# Extract message catalog from driconf.py. +$(POT): t_options.h + xgettext -L C --from-code utf-8 -o $(POT) t_options.h + +# Create or update a .po file for a specific language. +%.po: $(POT) + @if [ -f $@ ]; then \ + echo "Merging new strings from $(POT) into $@."; \ + mv $@ $@~; \ + msgmerge -o $@ $@~ $(POT); \ + else \ + echo "Initializing $@ from $(POT)."; \ + msginit -i $(POT) -o $@~ --locale=$*; \ + sed -e 's/charset=.*\\n/charset=UTF-8\\n/' $@~ > $@; \ + fi --- mesa-glw-7.4.orig/src/mesa/drivers/dri/common/xmlpool/gen_xmlpool.py +++ mesa-glw-7.4/src/mesa/drivers/dri/common/xmlpool/gen_xmlpool.py @@ -0,0 +1,191 @@ +#!/usr/bin/python + +import sys +import gettext +import re + +# List of supported languages +languages = sys.argv[1:] + +# Escape special characters in C strings +def escapeCString (s): + escapeSeqs = {'\a' : '\\a', '\b' : '\\b', '\f' : '\\f', '\n' : '\\n', + '\r' : '\\r', '\t' : '\\t', '\v' : '\\v', '\\' : '\\\\'} + # " -> '' is a hack. Quotes (") aren't possible in XML attributes. + # Better use Unicode characters for typographic quotes in option + # descriptions and translations. + i = 0 + r = '' + while i < len(s): + # Special case: escape double quote with \u201c or \u201d, depending + # on whether it's an open or close quote. This is needed because plain + # double quotes are not possible in XML attributes. + if s[i] == '"': + if i == len(s)-1 or s[i+1].isspace(): + # close quote + q = u'\u201c' + else: + # open quote + q = u'\u201d' + r = r + q + elif escapeSeqs.has_key(s[i]): + r = r + escapeSeqs[s[i]] + else: + r = r + s[i] + i = i + 1 + return r + +# Expand escape sequences in C strings (needed for gettext lookup) +def expandCString (s): + escapeSeqs = {'a' : '\a', 'b' : '\b', 'f' : '\f', 'n' : '\n', + 'r' : '\r', 't' : '\t', 'v' : '\v', + '"' : '"', '\\' : '\\'} + i = 0 + escape = False + hexa = False + octa = False + num = 0 + digits = 0 + r = '' + while i < len(s): + if not escape: + if s[i] == '\\': + escape = True + else: + r = r + s[i] + elif hexa: + if (s[i] >= '0' and s[i] <= '9') or \ + (s[i] >= 'a' and s[i] <= 'f') or \ + (s[i] >= 'A' and s[i] <= 'F'): + num = num * 16 + int(s[i],16) + digits = digits + 1 + else: + digits = 2 + if digits >= 2: + hexa = False + escape = False + r = r + chr(num) + elif octa: + if s[i] >= '0' and s[i] <= '7': + num = num * 8 + int(s[i],8) + digits = digits + 1 + else: + digits = 3 + if digits >= 3: + octa = False + escape = False + r = r + chr(num) + else: + if escapeSeqs.has_key(s[i]): + r = r + escapeSeqs[s[i]] + escape = False + elif s[i] >= '0' and s[i] <= '7': + octa = True + num = int(s[i],8) + if num <= 3: + digits = 1 + else: + digits = 2 + elif s[i] == 'x' or s[i] == 'X': + hexa = True + num = 0 + digits = 0 + else: + r = r + s[i] + escape = False + i = i + 1 + return r + +# Expand matches. The first match is always a DESC or DESC_BEGIN match. +# Subsequent matches are ENUM matches. +# +# DESC, DESC_BEGIN format: \1 \2= \3 \4=gettext(" \5= \6=") \7 +# ENUM format: \1 \2=gettext(" \3= \4=") \5 +def expandMatches (matches, translations, end=None): + assert len(matches) > 0 + nTranslations = len(translations) + i = 0 + # Expand the description+enums for all translations + for lang,trans in translations: + i = i + 1 + # Make sure that all but the last line of a simple description + # are extended with a backslash. + suffix = '' + if len(matches) == 1 and i < len(translations) and \ + not matches[0].expand (r'\7').endswith('\\'): + suffix = ' \\' + # Expand the description line. Need to use ugettext in order to allow + # non-ascii unicode chars in the original English descriptions. + text = escapeCString (trans.ugettext (unicode (expandCString ( + matches[0].expand (r'\5')), "utf-8"))).encode("utf-8") + print matches[0].expand (r'\1' + lang + r'\3"' + text + r'"\7') + suffix + # Expand any subsequent enum lines + for match in matches[1:]: + text = escapeCString (trans.ugettext (unicode (expandCString ( + match.expand (r'\3')), "utf-8"))).encode("utf-8") + print match.expand (r'\1"' + text + r'"\5') + + # Expand description end + if end: + print end, + +# Compile a list of translation classes to all supported languages. +# The first translation is always a NullTranslations. +translations = [("en", gettext.NullTranslations())] +for lang in languages: + try: + trans = gettext.translation ("options", ".", [lang]) + except IOError: + sys.stderr.write ("Warning: language '%s' not found.\n" % lang) + continue + translations.append ((lang, trans)) + +# Regular expressions: +reLibintl_h = re.compile (r'#\s*include\s*') +reDESC = re.compile (r'(\s*DRI_CONF_DESC\s*\(\s*)([a-z]+)(\s*,\s*)(gettext\s*\(\s*")(.*)("\s*\))(\s*\)[ \t]*\\?)$') +reDESC_BEGIN = re.compile (r'(\s*DRI_CONF_DESC_BEGIN\s*\(\s*)([a-z]+)(\s*,\s*)(gettext\s*\(\s*")(.*)("\s*\))(\s*\)[ \t]*\\?)$') +reENUM = re.compile (r'(\s*DRI_CONF_ENUM\s*\([^,]+,\s*)(gettext\s*\(\s*")(.*)("\s*\))(\s*\)[ \t]*\\?)$') +reDESC_END = re.compile (r'\s*DRI_CONF_DESC_END') + +# Print a header +print \ +"/***********************************************************************\n" \ +" *** THIS FILE IS GENERATED AUTOMATICALLY. DON'T EDIT! ***\n" \ +" ***********************************************************************/" + +# Process the options template and generate options.h with all +# translations. +template = file ("t_options.h", "r") +descMatches = [] +for line in template: + if len(descMatches) > 0: + matchENUM = reENUM .match (line) + matchDESC_END = reDESC_END.match (line) + if matchENUM: + descMatches.append (matchENUM) + elif matchDESC_END: + expandMatches (descMatches, translations, line) + descMatches = [] + else: + sys.stderr.write ( + "Warning: unexpected line inside description dropped:\n%s\n" \ + % line) + continue + if reLibintl_h.search (line): + # Ignore (comment out) #include + print "/* %s * commented out by gen_xmlpool.py */" % line + continue + matchDESC = reDESC .match (line) + matchDESC_BEGIN = reDESC_BEGIN.match (line) + if matchDESC: + assert len(descMatches) == 0 + expandMatches ([matchDESC], translations) + elif matchDESC_BEGIN: + assert len(descMatches) == 0 + descMatches = [matchDESC_BEGIN] + else: + print line, + +if len(descMatches) > 0: + sys.stderr.write ("Warning: unterminated description at end of file.\n") + expandMatches (descMatches, translations) --- mesa-glw-7.4.orig/src/mesa/drivers/dri/tdfx/BUGS +++ mesa-glw-7.4/src/mesa/drivers/dri/tdfx/BUGS @@ -0,0 +1,64 @@ +REMOVE THIS FILE BEFORE MERGING WITH TRUNK +------------------------------------------ + +OUTSTANDING BUGS + +demos/reflect - reading back Z on Voodoo3, image offset to right + Fixed in latest Glide. + +Q3 - some polygons drawn as vertical strips, similar to bug that was + seen in demos/fire. Voodoo3 only. May be related to glDepthMask + or glColorMask. + +book/fog - not fogging + Fog in orthograph mode still not implemented. Checking with + 3dfx engineers for ideas. + +Q3 demo crashes after changing display settings + but the full Q3 game version seems OK. + + + +MORE OUTSTANDING BUGS + +private context was NULL! causing immediate failure of any glx prog. cant +reproduce after restarting the X server. putting it down as halluc. + +texture object image was NULL, causing segmentation failure. happens with +prboom. ive put a check in tdfx_texstate.c but this isn't a fix. + +prboom, wall textures near first chainsaw aren't bound properly. sideways +movements causes the wall textures to move with you. prboom busted? + +16bpp mode, quake3, windowed, q3dm1, floor under rocketlauncher bands. it +looks like multitexturing gone wrong. i'll disable a tmu and test. + +sof, polygons appear at wrong x,y,z positions, intermittent, have not yet +found reliable way of reproducing. culling? sometimes polys disappear. + +descent3 is all black in 16bpp mode - FIXED (palette problems) + +smeared pixels in quake3 - FIXED (texture memory overlapped FB) + + + +PERFORMANCE COMPARISON (Brian / Alan) + + V3/16 is Voodoo3 in 16bpp on a P3/500 + V5/16 is Voodoo5 in 16bpp on a P3/600 + V5/32 is Voodoo5 in 32bpp on a P3/600 + V5A/16 is Voodoo5 in 16bpp on an Alpha AXP/600 + V5A/32 is Voodoo5 in 32bpp on an Alpha AXP/600 + + tdfx-2-1-branch tdfx-3-0-0-branch +demo V3/16 V5/16 V5/32 V3/16 V5/16 V5/32 V5A/16 V5A/32 +------------------------------------------------------------------------ +gloss 257 183 174 320 308 177 313 167 +fire 42 39 52 41 +fire (no help) 98 80 50 106 113 73 124 80 +tunnel 61 50 70 58 +tunnel (no help) 167 142 57 138 152 113 171 122 +gears 663 554 540 881 1232 776 1484 830 +teapot 20 21 37 36 +teapot (no help) 22 14 14 24 30 30 43 42 + --- mesa-glw-7.4.orig/src/mesa/drivers/dri/tdfx/X86/fx_3dnow_fastpath.S +++ mesa-glw-7.4/src/mesa/drivers/dri/tdfx/X86/fx_3dnow_fastpath.S @@ -0,0 +1,83 @@ + +#include "../../X86/assyntax.h" + +#define SETUP_RGBA 0x1 +#define SETUP_TMU0 0x2 +#define SETUP_TMU1 0x4 + + +/* Pack either rgba or texture into the remaining half of a 32 byte vertex. + */ +#define CLIP_R 24 +#define CLIP_G 16 +#define CLIP_B 20 +#define CLIP_A 28 /* defined inf fxdrv.h */ + +#define CLIP_S0 16 +#define CLIP_T0 20 +#define CLIP_S1 24 +#define CLIP_T1 28 + +#define SIZE 4 +#define TYPE (0) +#define TAG(x) x +#include "fx_3dnow_fasttmp.h" + +#define SIZE 8 +#define TYPE (SETUP_RGBA) +#define TAG(x) x##_RGBA +#include "fx_3dnow_fasttmp.h" + +#define SIZE 6 +#define TYPE (SETUP_TMU0) +#define TAG(x) x##_TMU0 +#include "fx_3dnow_fasttmp.h" + +#define SIZE 8 +#define TYPE (SETUP_TMU0|SETUP_TMU1) +#define TAG(x) x##_TMU0_TMU1 +#include "fx_3dnow_fasttmp.h" + +#undef CLIP_S1 +#undef CLIP_T1 +#define CLIP_S1 16 +#define CLIP_T1 20 + +#define SIZE 6 +#define TYPE (SETUP_TMU1) +#define TAG(x) x##_TMU1 +#include "fx_3dnow_fasttmp.h" + +/* These three need to use a full 64 byte clip-space vertex. + */ +#undef CLIP_S0 +#undef CLIP_T0 +#undef CLIP_S1 +#undef CLIP_T1 + +#define CLIP_S0 32 +#define CLIP_T0 36 +#define CLIP_S1 40 +#define CLIP_T1 44 + +#define SIZE 10 +#define TYPE (SETUP_RGBA|SETUP_TMU0) +#define TAG(x) x##_RGBA_TMU0 +#include "fx_3dnow_fasttmp.h" + +#define SIZE 12 +#define TYPE (SETUP_RGBA|SETUP_TMU0|SETUP_TMU1) +#define TAG(x) x##_RGBA_TMU0_TMU1 +#include "fx_3dnow_fasttmp.h" + +#undef CLIP_S1 +#undef CLIP_T1 +#define CLIP_S1 32 +#define CLIP_T1 36 + +#define SIZE 10 +#define TYPE (SETUP_RGBA|SETUP_TMU1) +#define TAG(x) x##_RGBA_TMU1 +#include "fx_3dnow_fasttmp.h" + + --- mesa-glw-7.4.orig/src/mesa/drivers/dri/tdfx/X86/fx_3dnow_fasttmp.h +++ mesa-glw-7.4/src/mesa/drivers/dri/tdfx/X86/fx_3dnow_fasttmp.h @@ -0,0 +1,313 @@ + +#if !defined(NASM_ASSEMBLER) && !defined(MASM_ASSEMBLER) +#define TAGLLBL(a) TAG(.L##a) +#else +#define TAGLLBL(a) TAG(a) +#endif + +#if !GLIDE3 + +#define GR_VERTEX_X_OFFSET 0 +#define GR_VERTEX_Y_OFFSET 4 +#define GR_VERTEX_Z_OFFSET 8 +#define GR_VERTEX_R_OFFSET 12 +#define GR_VERTEX_G_OFFSET 16 +#define GR_VERTEX_B_OFFSET 20 +#define GR_VERTEX_OOZ_OFFSET 24 +#define GR_VERTEX_A_OFFSET 28 +#define GR_VERTEX_OOW_OFFSET 32 + +#else /* GLIDE3 */ + +#define GR_VERTEX_X_OFFSET 0 +#define GR_VERTEX_Y_OFFSET 4 +#define GR_VERTEX_OOZ_OFFSET 8 +#define GR_VERTEX_OOW_OFFSET 12 +#define GR_VERTEX_R_OFFSET 16 +#define GR_VERTEX_G_OFFSET 20 +#define GR_VERTEX_B_OFFSET 24 +#define GR_VERTEX_A_OFFSET 28 +#define GR_VERTEX_Z_OFFSET 32 + +#endif /* GLIDE3 */ + +#define GR_VERTEX_SOW_TMU0_OFFSET 36 +#define GR_VERTEX_TOW_TMU0_OFFSET 40 +#define GR_VERTEX_OOW_TMU0_OFFSET 44 +#define GR_VERTEX_SOW_TMU1_OFFSET 48 +#define GR_VERTEX_TOW_TMU1_OFFSET 52 +#define GR_VERTEX_OOW_TMU1_OFFSET 56 + + + + +/*#define MAT_SX 0 /* accessed by REGIND !! */ +#define MAT_SY 20 +#define MAT_SZ 40 +#define MAT_TX 48 +#define MAT_TY 52 +#define MAT_TZ 56 + + + + +/* Do viewport map, device scale and perspective projection. + * + * void project_verts( GLfloat *first, + * GLfloat *last, + * const GLfloat *m, + * GLuint stride ) + * + * + * Rearrange fxVertices to look like grVertices. + */ + +GLOBL GLNAME( TAG(fx_3dnow_project_vertices) ) +GLNAME( TAG(fx_3dnow_project_vertices) ): + + PUSH_L ( EBP ) + + MOV_L ( REGOFF(8, ESP), ECX ) /* first_vert */ + MOV_L ( REGOFF(12, ESP), EDX ) /* last_vert */ + + CMP_L ( ECX, EDX ) + JE ( TAGLLBL(FXPV_end) ) + + FEMMS + + PREFETCH ( REGIND(ECX) ) /* fetch the first vertex */ + + MOV_L ( REGOFF(16, ESP), EBP ) /* matrix */ + MOV_L ( REGOFF(20, ESP), EAX ) /* stride */ + + MOVD ( REGOFF(MAT_TX, EBP), MM6 ) /* | tx */ + PUNPCKLDQ ( REGOFF(MAT_TY, EBP), MM6 ) /* ty | tx */ + +#if !defined(FX_V2) + MOV_L ( CONST(0x49400000), REGOFF(-8, ESP) ) /* snapper */ + MOV_L ( CONST(0x49400000), REGOFF(-4, ESP) ) /* snapper */ +#endif + + MOVQ ( REGOFF(-8, ESP), MM4 ) /* snapper | snapper */ + PFADD ( MM4, MM6 ) /* ty+snapper | tx+snapper */ + + MOVD ( REGIND(EBP), MM5 ) + PUNPCKLDQ ( REGOFF(MAT_SY, EBP), MM5 ) /* vsy | vsx */ + + MOVD ( REGOFF(MAT_SZ, EBP), MM1 ) /* | vsz */ + + +ALIGNTEXT32 +TAGLLBL(FXPV_loop_start): + + PREFETCH ( REGOFF(64, ECX) ) /* fetch the next-ish vertex */ + + + MOVD ( REGOFF(12, ECX), MM0 ) /* | f[3] */ + PFRCP ( MM0, MM0 ) /* oow = 1/f[3] */ + + MOVD ( REGOFF(12, ECX), MM7 ) /* | f[3] */ + PFRCPIT1 ( MM0, MM7 ) + PFRCPIT2 ( MM0, MM7 ) /* oow | oow */ + + PUNPCKLDQ ( MM7, MM7 ) + + +#if (TYPE & SETUP_RGBA) + MOVD ( REGOFF(CLIP_R, ECX ), MM0 ) /* f[RCOORD] = f[CLIP_R]; */ + MOVD ( MM0, REGOFF(GR_VERTEX_R_OFFSET, ECX) ) +#endif + +#if (TYPE & SETUP_TMU1) + MOVQ ( REGOFF(CLIP_S1, ECX), MM0 ) /* f[S1COORD] = f[CLIP_S1] * oow */ + PFMUL ( MM7, MM0 ) /* f[T1COORD] = f[CLIP_T1] * oow */ + MOVQ ( MM0, REGOFF(GR_VERTEX_SOW_TMU1_OFFSET, ECX) ) +#endif + + +#if (TYPE & SETUP_TMU0) + MOVQ ( REGOFF(CLIP_S0, ECX), MM0 ) /* f[S0COORD] = f[CLIP_S0] * oow */ + PFMUL ( MM7, MM0 ) /* f[T0COORD] = f[CLIP_T0] * oow */ + MOVQ ( MM0, REGOFF(GR_VERTEX_SOW_TMU0_OFFSET, ECX) ) +#endif + + + + + +/* DO_SETUP_XYZ */ + + MOVQ ( REGIND(ECX), MM2 ) /* f[1] | f[0] */ + PFMUL ( MM7, MM2 ) /* f[1] * oow | f[0] * oow */ + + MOVD ( REGOFF(8, ECX), MM3 ) /* | f[2] */ + PFMUL ( MM7, MM3 ) /* | f[2] * oow */ + + MOVD ( REGOFF(MAT_TZ, EBP), MM0 ) /* | vtz */ + PFMUL ( MM1, MM3 ) /* | f[2] *= vsz */ + + PFADD ( MM0, MM3 ) /* | f[2] += vtz */ + PFMUL ( MM5, MM2 ) /* f[1] *= vsy | f[0] *= vsx */ + + PFADD ( MM6, MM2 ) /* f[1] += vty | f[0] += vtx */ + +#if !defined(FX_V2) + PFSUB ( MM4, MM2 ) /* f[0,1] -= snapper */ +#endif + + MOVQ ( MM2, REGOFF(GR_VERTEX_X_OFFSET, ECX) ) + MOVD ( MM3, REGOFF(GR_VERTEX_OOZ_OFFSET, ECX) ) + + +/* end of DO_SETUP_XYZ */ + + MOVD ( MM7, REGOFF(GR_VERTEX_OOW_OFFSET, ECX) ) /* f[OOWCOORD] = oow */ + ADD_L ( EAX, ECX ) /* f += stride */ + + CMP_L ( ECX, EDX ) /* stall??? */ + JA ( TAGLLBL(FXPV_loop_start) ) + +TAGLLBL(FXPV_end): + FEMMS + POP_L ( EBP ) + RET + + + + + + + +/* void project_verts( GLfloat *first, + * GLfloat *last, + * const GLfloat *m, + * GLuint stride, + * const GLubyte *mask ) + * + */ + +GLOBL GLNAME( TAG(fx_3dnow_project_clipped_vertices) ) +GLNAME( TAG(fx_3dnow_project_clipped_vertices) ): + + PUSH_L ( EBP ) + + MOV_L ( REGOFF(8, ESP), ECX ) /* first FXDRIVER(VB)->verts*/ + MOV_L ( REGOFF(12, ESP), EDX ) /* last FXDRIVER(VB)->last_vert */ + + FEMMS + + PUSH_L ( EDI ) + PUSH_L ( ESI ) + + PREFETCH ( REGIND(ECX) ) /* fetch the first vertex */ + + MOV_L ( REGOFF(24, ESP), EBP ) /* mat ctx->Viewport.WindowMap.M */ + MOV_L ( REGOFF(28, ESP), EAX ) /* stride */ + MOV_L ( REGOFF(32, ESP), ESI ) /* VB->ClipMask */ + + MOVD ( REGOFF(MAT_TX, EBP), MM6 ) /* | tx */ + PUNPCKLDQ ( REGOFF(MAT_TY, EBP), MM6 ) /* ty | tx */ + +#if !defined(FX_V2) + MOV_L ( CONST(0x49400000), REGOFF(-8, ESP) ) /* snapper */ + MOV_L ( CONST(0x49400000), REGOFF(-4, ESP) ) /* snapper */ +#endif + + MOVQ ( REGOFF(-8, ESP), MM4 ) /* snapper | snapper */ + PFADD ( MM4, MM6 ) /* ty+snapper | tx+snapper */ + + MOVD ( REGIND(EBP), MM5 ) + PUNPCKLDQ ( REGOFF(MAT_SY, EBP), MM5 ) /* vsy | vsx */ + + MOVD ( REGOFF(MAT_SZ, EBP), MM1 ) /* | vsz */ + + + +ALIGNTEXT32 +TAGLLBL(FXPCV_loop_start): + + PREFETCH ( REGOFF(64, ECX) ) /* fetch the next-ish vertex */ + + CMP_B ( CONST(0), REGIND(ESI) ) + JNE ( TAGLLBL(FXPCV_skip) ) + + MOVD ( REGOFF(12, ECX), MM0) /* | f[3] */ + PFRCP ( MM0, MM0 ) /* oow = 1/f[3] */ + + MOVD ( REGOFF(12, ECX), MM7) /* | f[3] */ + PFRCPIT1 ( MM0, MM7 ) + PFRCPIT2 ( MM0, MM7 ) /* oow | oow */ + + PUNPCKLDQ ( MM7, MM7 ) + + +#if (TYPE & SETUP_RGBA) + MOVD ( REGOFF(CLIP_R, ECX ), MM0 ) /* f[RCOORD] = f[CLIP_R]; */ + MOVD ( MM0, REGOFF(GR_VERTEX_R_OFFSET, ECX) ) +#endif + +#if (TYPE & SETUP_TMU1) + MOVQ ( REGOFF(CLIP_S1, ECX), MM0 ) /* f[S1COORD] = f[CLIP_S1] * oow */ + PFMUL ( MM7, MM0 ) /* f[T1COORD] = f[CLIP_T1] * oow */ + MOVQ ( MM0, REGOFF(GR_VERTEX_SOW_TMU1_OFFSET, ECX) ) +#endif + + +#if (TYPE & SETUP_TMU0) + MOVQ ( REGOFF(CLIP_S0, ECX), MM0 ) /* f[S0COORD] = f[CLIP_S0] * oow */ + PFMUL ( MM7, MM0 ) /* f[T0COORD] = f[CLIP_T0] * oow */ + MOVQ ( MM0, REGOFF(GR_VERTEX_SOW_TMU0_OFFSET, ECX) ) +#endif + + + + +/* DO_SETUP_XYZ */ + + MOVQ ( REGIND(ECX), MM2 ) /* f[1] | f[0] */ + PFMUL ( MM7, MM2 ) /* f[1] * oow | f[0] * oow */ + + MOVD ( REGOFF(8, ECX), MM3 ) /* | f[2] */ + PFMUL ( MM7, MM3 ) /* | f[2] * oow */ + + MOVD ( REGOFF(MAT_TZ, EBP), MM0 ) /* | vtz */ + PFMUL ( MM1, MM3 ) /* | f[2] *= vsz */ + + PFADD ( MM0, MM3 ) /* | f[2] += vtz */ + PFMUL ( MM5, MM2 ) /* f[1] *= vsy | f[0] *= vsx */ + + PFADD ( MM6, MM2 ) /* f[1] += vty | f[0] += vtx */ + +#if !defined(FX_V2) + PFSUB ( MM4, MM2 ) /* f[0,1] -= snapper */ +#endif + + MOVQ ( MM2, REGOFF(GR_VERTEX_X_OFFSET, ECX) ) + MOVD ( MM3, REGOFF(GR_VERTEX_OOZ_OFFSET, ECX) ) + + +/* end of DO_SETUP_XYZ */ + + MOVD ( MM7, REGOFF(GR_VERTEX_OOW_OFFSET, ECX) ) /* f[OOWCOORD] = oow */ + +TAGLLBL(FXPCV_skip): + ADD_L ( EAX, ECX ) /* f += stride */ + + INC_L ( ESI ) /* next ClipMask */ + CMP_L ( ECX, EDX ) + JA ( TAGLLBL(FXPCV_loop_start) ) + + POP_L ( ESI ) + POP_L ( EDI ) + +TAGLLBL(FXPCV_end): + FEMMS + POP_L ( EBP ) + RET + + + +#undef TYPE +#undef TAG +#undef SIZE + --- mesa-glw-7.4.orig/src/mesa/drivers/ggi/default/genkgi.h +++ mesa-glw-7.4/src/mesa/drivers/ggi/default/genkgi.h @@ -0,0 +1,76 @@ +/* +****************************************************************************** + + GGIMesa - KGIcon specific overrides for fbcon-mesa + API header + + Copyright (C) 1999 Jon Taylor [taylorj@ggi-project.org] + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +****************************************************************************** +*/ + +#ifndef _GENKGI_MESA_H +#define _GENKGI_MESA_H + +#undef KGI_USE_PPBUFS + +#include +#include + +#include +#include +#include + +#ifndef MAP_FAILED +#define MAP_FAILED ((void *)-1) +#endif + +/* FIXME: LibGGI needs to export its genkgi.h */ +struct genkgi_priv +{ + ggi_gc *mapped_gc; + unsigned int gc_size; + ggifunc_drawline *drawline; + ggifunc_drawbox *drawbox; + ggifunc_fillscreen *fillscreen; + int fd_gc; + int close_gc; + int fd_kgicommand; + uint8 *mapped_kgicommand; + uint8 *kgicommand_ptr; + unsigned int kgicommand_buffersize; +}; + +#define GENKGI_PRIV(vis) ((struct genkgi_priv *)FBDEV_PRIV(vis)->accelpriv) + +extern ggifunc_getapi GGIMesa_genkgi_getapi; +extern ggifunc_flush GGIMesa_genkgi_flush; + +struct genkgi_priv_mesa +{ + char accel[100]; + int have_accel; + void *accelpriv; /* Private data of subdrivers */ + struct genkgi_priv *oldpriv; /* LibGGI's private data */ +}; + +#define GENKGI_PRIV_MESA(vis) ((struct genkgi_priv_mesa *)FBDEV_PRIV_MESA(vis)->accelpriv) + +#endif /* _GENKHI_MESA_H */ --- mesa-glw-7.4.orig/src/mesa/drivers/windows/fx/fx.rc +++ mesa-glw-7.4/src/mesa/drivers/windows/fx/fx.rc @@ -0,0 +1,39 @@ +#include + +#define PRODNAME "Mesa 6.x" +#define CONTACTSTR "http://www.mesa3d.org" +#define HWSTR "3dfx Voodoo Graphics, Voodoo Rush, Voodoo^2, Voodoo Banshee, Velocity 100/200, Voodoo3, Voodoo4, Voodoo5" +#define COPYRIGHTSTR "Copyright \251 Brian E. Paul" + +#define VERSIONSTR "6.3.0.1" +#define MANVERSION 6 +#define MANREVISION 3 +#define BUILD_NUMBER 1 + +VS_VERSION_INFO VERSIONINFO + FILEVERSION MANVERSION, MANREVISION, 0, BUILD_NUMBER + PRODUCTVERSION MANVERSION, MANREVISION, 0, BUILD_NUMBER + FILEFLAGSMASK 0x0030003FL + + FILEOS VOS_DOS_WINDOWS32 + FILETYPE VFT_DRV + FILESUBTYPE VFT2_DRV_INSTALLABLE +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904E4" + BEGIN + VALUE "FileDescription", PRODNAME + VALUE "FileVersion", VERSIONSTR + VALUE "LegalCopyright", COPYRIGHTSTR + VALUE "ProductName", PRODNAME + VALUE "Graphics Subsystem", HWSTR + VALUE "Contact", CONTACTSTR + END + END + BLOCK "VarFileInfo" + BEGIN + /* the following line should be extended for localized versions */ + VALUE "Translation", 0x409, 1252 + END +END --- mesa-glw-7.4.orig/src/mesa/drivers/windows/gldirect/opengl32.ref +++ mesa-glw-7.4/src/mesa/drivers/windows/gldirect/opengl32.ref @@ -0,0 +1,495 @@ +;**************************************************************************** +;* +;* Mesa 3-D graphics library +;* Direct3D Driver Interface +;* +;* ======================================================================== +;* +;* Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved. +;* +;* Permission is hereby granted, free of charge, to any person obtaining a +;* copy of this software and associated documentation files (the "Software"), +;* to deal in the Software without restriction, including without limitation +;* the rights to use, copy, modify, merge, publish, distribute, sublicense, +;* and/or sell copies of the Software, and to permit persons to whom the +;* Software is furnished to do so, subject to the following conditions: +;* +;* The above copyright notice and this permission notice shall be included +;* in all copies or substantial portions of the Software. +;* +;* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +;* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +;* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +;* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +;* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF +;* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +;* SOFTWARE. +;* +;* ====================================================================== +;* +;* Language: ANSI C +;* Environment: Windows 9x/2000/XP/XBox (Win32) +;* +;* Description: DLL Module definition file +;* +;****************************************************************************/ + +DESCRIPTION 'GLDirect' + +VERSION 3.0 + +EXPORTS + glAccum + glAlphaFunc + glAreTexturesResident + glArrayElement + glBegin + glBindTexture + glBitmap + glBlendFunc + glCallList + glCallLists + glClear + glClearAccum + glClearIndex + glClearColor + glClearDepth + glClearStencil + glClipPlane + glColor3b + glColor3d + glColor3f + glColor3i + glColor3s + glColor3ub + glColor3ui + glColor3us + glColor4b + glColor4d + glColor4f + glColor4i + glColor4s + glColor4ub + glColor4ui + glColor4us + glColor3bv + glColor3dv + glColor3fv + glColor3iv + glColor3sv + glColor3ubv + glColor3uiv + glColor3usv + glColor4bv + glColor4dv + glColor4fv + glColor4iv + glColor4sv + glColor4ubv + glColor4uiv + glColor4usv + glColorMask + glColorMaterial + glColorPointer + glColorTableEXT + glColorSubTableEXT + glCopyPixels + glCopyTexImage1D + glCopyTexImage2D + glCopyTexSubImage1D + glCopyTexSubImage2D + glCullFace + glDepthFunc + glDepthMask + glDepthRange + glDeleteLists + glDeleteTextures + glDisable + glDisableClientState + glDrawArrays + glDrawBuffer + glDrawElements + glDrawPixels + glEnable + glEnableClientState + glEnd + glEndList + glEvalCoord1d + glEvalCoord1f + glEvalCoord1dv + glEvalCoord1fv + glEvalCoord2d + glEvalCoord2f + glEvalCoord2dv + glEvalCoord2fv + glEvalPoint1 + glEvalPoint2 + glEvalMesh1 + glEdgeFlag + glEdgeFlagv + glEdgeFlagPointer + glEvalMesh2 + glFeedbackBuffer + glFinish + glFlush + glFogf + glFogi + glFogfv + glFogiv + glFrontFace + glFrustum + glGenLists + glGenTextures + glGetBooleanv + glGetClipPlane + glGetColorTableEXT + glGetColorTableParameterivEXT + glGetColorTableParameterfvEXT + glGetDoublev + glGetError + glGetFloatv + glGetIntegerv + glGetLightfv + glGetLightiv + glGetMapdv + glGetMapfv + glGetMapiv + glGetMaterialfv + glGetMaterialiv + glGetPixelMapfv + glGetPixelMapuiv + glGetPixelMapusv + glGetPointerv + glGetPolygonStipple + glGetString + glGetTexEnvfv + glGetTexEnviv + glGetTexGeniv + glGetTexGendv + glGetTexGenfv + glGetTexImage + glGetTexLevelParameterfv + glGetTexLevelParameteriv + glGetTexParameterfv + glGetTexParameteriv + glHint + glIndexd + glIndexf + glIndexi + glIndexs + glIndexub + glIndexdv + glIndexfv + glIndexiv + glIndexsv + glIndexubv + glIndexMask + glIndexPointer + glInterleavedArrays + glInitNames + glIsList + glIsTexture + glLightf + glLighti + glLightfv + glLightiv + glLightModelf + glLightModeli + glLightModelfv + glLightModeliv + glLineWidth + glLineStipple + glListBase + glLoadIdentity + glLoadMatrixd + glLoadMatrixf + glLoadName + glLogicOp + glMap1d + glMap1f + glMap2d + glMap2f + glMapGrid1d + glMapGrid1f + glMapGrid2d + glMapGrid2f + glMaterialf + glMateriali + glMaterialfv + glMaterialiv + glMatrixMode + glMultMatrixd + glMultMatrixf + glNewList + glNormal3b + glNormal3d + glNormal3f + glNormal3i + glNormal3s + glNormal3bv + glNormal3dv + glNormal3fv + glNormal3iv + glNormal3sv + glNormalPointer + glOrtho + glPassThrough + glPixelMapfv + glPixelMapuiv + glPixelMapusv + glPixelStoref + glPixelStorei + glPixelTransferf + glPixelTransferi + glPixelZoom + glPointSize + glPolygonMode + glPolygonOffset + glPolygonOffsetEXT + glPolygonStipple + glPopAttrib + glPopClientAttrib + glPopMatrix + glPopName + glPrioritizeTextures + glPushMatrix + glRasterPos2d + glRasterPos2f + glRasterPos2i + glRasterPos2s + glRasterPos3d + glRasterPos3f + glRasterPos3i + glRasterPos3s + glRasterPos4d + glRasterPos4f + glRasterPos4i + glRasterPos4s + glRasterPos2dv + glRasterPos2fv + glRasterPos2iv + glRasterPos2sv + glRasterPos3dv + glRasterPos3fv + glRasterPos3iv + glRasterPos3sv + glRasterPos4dv + glRasterPos4fv + glRasterPos4iv + glRasterPos4sv + glReadBuffer + glReadPixels + glRectd + glRectf + glRecti + glRects + glRectdv + glRectfv + glRectiv + glRectsv + glScissor + glIsEnabled + glPushAttrib + glPushClientAttrib + glPushName + glRenderMode + glRotated + glRotatef + glSelectBuffer + glScaled + glScalef + glShadeModel + glStencilFunc + glStencilMask + glStencilOp + glTexCoord1d + glTexCoord1f + glTexCoord1i + glTexCoord1s + glTexCoord2d + glTexCoord2f + glTexCoord2i + glTexCoord2s + glTexCoord3d + glTexCoord3f + glTexCoord3i + glTexCoord3s + glTexCoord4d + glTexCoord4f + glTexCoord4i + glTexCoord4s + glTexCoord1dv + glTexCoord1fv + glTexCoord1iv + glTexCoord1sv + glTexCoord2dv + glTexCoord2fv + glTexCoord2iv + glTexCoord2sv + glTexCoord3dv + glTexCoord3fv + glTexCoord3iv + glTexCoord3sv + glTexCoord4dv + glTexCoord4fv + glTexCoord4iv + glTexCoord4sv + glTexCoordPointer + glTexGend + glTexGenf + glTexGeni + glTexGendv + glTexGeniv + glTexGenfv + glTexEnvf + glTexEnvi + glTexEnvfv + glTexEnviv + glTexImage1D + glTexImage2D + glTexParameterf + glTexParameteri + glTexParameterfv + glTexParameteriv + glTexSubImage1D + glTexSubImage2D + glTranslated + glTranslatef + glVertex2d + glVertex2f + glVertex2i + glVertex2s + glVertex3d + glVertex3f + glVertex3i + glVertex3s + glVertex4d + glVertex4f + glVertex4i + glVertex4s + glVertex2dv + glVertex2fv + glVertex2iv + glVertex2sv + glVertex3dv + glVertex3fv + glVertex3iv + glVertex3sv + glVertex4dv + glVertex4fv + glVertex4iv + glVertex4sv + glVertexPointer + glViewport + + glBlendEquationEXT + glBlendColorEXT + glVertexPointerEXT + glNormalPointerEXT + glColorPointerEXT + glIndexPointerEXT + glTexCoordPointerEXT + glEdgeFlagPointerEXT + glGetPointervEXT + glArrayElementEXT + glDrawArraysEXT + glBindTextureEXT + glDeleteTexturesEXT + glGenTexturesEXT + glPrioritizeTexturesEXT + glCopyTexSubImage3DEXT + glTexImage3DEXT + glTexSubImage3DEXT + + glWindowPos4fMESA + glWindowPos2iMESA + glWindowPos2sMESA + glWindowPos2fMESA + glWindowPos2dMESA + glWindowPos2ivMESA + glWindowPos2svMESA + glWindowPos2fvMESA + glWindowPos2dvMESA + glWindowPos3iMESA + glWindowPos3sMESA + glWindowPos3fMESA + glWindowPos3dMESA + glWindowPos3ivMESA + glWindowPos3svMESA + glWindowPos3fvMESA + glWindowPos3dvMESA + glWindowPos4iMESA + glWindowPos4sMESA + glWindowPos4dMESA + glWindowPos4ivMESA + glWindowPos4svMESA + glWindowPos4fvMESA + glWindowPos4dvMESA + glResizeBuffersMESA + + wglCopyContext + wglCreateContext + wglCreateLayerContext + wglDeleteContext + wglDescribeLayerPlane + wglGetCurrentContext + wglGetCurrentDC + wglGetLayerPaletteEntries + wglGetProcAddress + wglMakeCurrent + wglRealizeLayerPalette + wglSetLayerPaletteEntries + wglShareLists + wglSwapLayerBuffers + wglUseFontBitmapsA + wglUseFontBitmapsW + wglUseFontOutlinesA + wglUseFontOutlinesW + +;These functions are identical and therefore share the same addresses + ChoosePixelFormat = wglChoosePixelFormat + DescribePixelFormat = wglDescribePixelFormat + GetPixelFormat = wglGetPixelFormat + SetPixelFormat = wglSetPixelFormat + SwapBuffers = wglSwapBuffers + + wglChoosePixelFormat + wglDescribePixelFormat + wglGetPixelFormat + wglSetPixelFormat + wglSwapBuffers + + glActiveTextureARB + glClientActiveTextureARB + glMultiTexCoord1dARB + glMultiTexCoord1dvARB + glMultiTexCoord1fARB + glMultiTexCoord1fvARB + glMultiTexCoord1iARB + glMultiTexCoord1ivARB + glMultiTexCoord1sARB + glMultiTexCoord1svARB + glMultiTexCoord2dARB + glMultiTexCoord2dvARB + glMultiTexCoord2fARB + glMultiTexCoord2fvARB + glMultiTexCoord2iARB + glMultiTexCoord2ivARB + glMultiTexCoord2sARB + glMultiTexCoord2svARB + glMultiTexCoord3dARB + glMultiTexCoord3dvARB + glMultiTexCoord3fARB + glMultiTexCoord3fvARB + glMultiTexCoord3iARB + glMultiTexCoord3ivARB + glMultiTexCoord3sARB + glMultiTexCoord3svARB + glMultiTexCoord4dARB + glMultiTexCoord4dvARB + glMultiTexCoord4fARB + glMultiTexCoord4fvARB + glMultiTexCoord4iARB + glMultiTexCoord4ivARB + glMultiTexCoord4sARB + glMultiTexCoord4svARB --- mesa-glw-7.4.orig/src/mesa/drivers/windows/gldirect/gldirect.rc +++ mesa-glw-7.4/src/mesa/drivers/windows/gldirect/gldirect.rc @@ -0,0 +1,43 @@ +/**************************************************************************** +* +* Mesa 3-D graphics library +* Direct3D Driver Interface +* +* ======================================================================== +* +* Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved. +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included +* in all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF +* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +* SOFTWARE. +* +* ====================================================================== +* +* Language: Windows Resource Compiler +* Environment: Windows 95 +* +****************************************************************************/ + +#ifndef WORKSHOP_INVOKED + #include +#endif + +#define FILE_DESCRIPTION "SciTech GLDirect" +#define ORIG_FILENAME "opengl32.dll" +#define FILE_TYPE VFT_DLL + +#include "gldirect/gldver.ver" --- mesa-glw-7.4.orig/src/mesa/drivers/windows/gldirect/mesasw/colors.h +++ mesa-glw-7.4/src/mesa/drivers/windows/gldirect/mesasw/colors.h @@ -0,0 +1,520 @@ +/* File name : colors.h + * Version : 2.3 + * + * Header file for display driver for Mesa 2.3 under + * Windows95 and WindowsNT + * This file defines macros and global variables needed + * for converting color format + * + * Copyright (C) 1996- Li Wei + * Address : Institute of Artificial Intelligence + * : & Robotics + * : Xi'an Jiaotong University + * Email : liwei@aiar.xjtu.edu.cn + * Web page : http://sun.aiar.xjtu.edu.cn + * + * This file and its associations are partially based on the + * Windows NT driver for Mesa, written by Mark Leaming + * (mark@rsinc.com). + */ + +/* + * Macros for pixel format defined + */ + +/* + * Revision 1.1 2004/04/20 11:13:11 alanh + * add SciTech's GLDirect driver for Windows. + * + * This code is donated to Mesa which allows the usage of + * a Direct3D layer (DX7, DX8, DX9 or complete software fallback). + * + * No build system exists for this code yet, that will come..... + * + * Revision 1.1.1.1 1999/08/19 00:55:42 jtg + * Imported sources + * + * Revision 1.2 1999/01/03 03:08:57 brianp + * Ted Jump's changes + * + * Revision 1.1 1999/01/03 03:08:12 brianp + * Initial revision + * + * Revision 2.0.2 1997/4/30 15:58:00 CST by Li Wei(liwei@aiar.xjtu.edu.cn) + * Add LUTs need for dithering + */ + +/* + * Revision 1.1 2004/04/20 11:13:11 alanh + * add SciTech's GLDirect driver for Windows. + * + * This code is donated to Mesa which allows the usage of + * a Direct3D layer (DX7, DX8, DX9 or complete software fallback). + * + * No build system exists for this code yet, that will come..... + * + * Revision 1.1.1.1 1999/08/19 00:55:42 jtg + * Imported sources + * + * Revision 1.2 1999/01/03 03:08:57 brianp + * Ted Jump's changes + * + * Revision 1.1 1999/01/03 03:08:12 brianp + * Initial revision + * + * Revision 2.0.1 1997/4/29 15:52:00 CST by Li Wei(liwei@aiar.xjtu.edu.cn) + * Add BGR8 Macro + */ + +/* + * Revision 1.1 2004/04/20 11:13:11 alanh + * add SciTech's GLDirect driver for Windows. + * + * This code is donated to Mesa which allows the usage of + * a Direct3D layer (DX7, DX8, DX9 or complete software fallback). + * + * No build system exists for this code yet, that will come..... + * + * Revision 1.1.1.1 1999/08/19 00:55:42 jtg + * Imported sources + * + * Revision 1.2 1999/01/03 03:08:57 brianp + * Ted Jump's changes + * + * Revision 1.1 1999/01/03 03:08:12 brianp + * Initial revision + * + * Revision 2.0 1996/11/15 10:55:00 CST by Li Wei(liwei@aiar.xjtu.edu.cn) + * Initial revision + */ +/* Values for wmesa->pixelformat: */ + +#define PF_8A8B8G8R 3 /* 32-bit TrueColor: 8-A, 8-B, 8-G, 8-R */ +#define PF_8R8G8B 4 /* 32-bit TrueColor: 8-R, 8-G, 8-B */ +#define PF_5R6G5B 5 /* 16-bit TrueColor: 5-R, 6-G, 5-B bits */ +#define PF_DITHER8 6 /* Dithered RGB using a lookup table */ +#define PF_LOOKUP 7 /* Undithered RGB using a lookup table */ +#define PF_GRAYSCALE 10 /* Grayscale or StaticGray */ +#define PF_BADFORMAT 11 +#define PF_INDEX8 12 + +char ColorMap16[] = { +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, +0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, +0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05, +0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06, +0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07, +0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08, +0x09,0x09,0x09,0x09,0x09,0x09,0x09,0x09, +0x0A,0x0A,0x0A,0x0A,0x0A,0x0A,0x0A,0x0A, +0x0B,0x0B,0x0B,0x0B,0x0B,0x0B,0x0B,0x0B, +0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C, +0x0D,0x0D,0x0D,0x0D,0x0D,0x0D,0x0D,0x0D, +0x0E,0x0E,0x0E,0x0E,0x0E,0x0E,0x0E,0x0E, +0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F, +0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11, +0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, +0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13, +0x14,0x14,0x14,0x14,0x14,0x14,0x14,0x14, +0x15,0x15,0x15,0x15,0x15,0x15,0x15,0x15, +0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16, +0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17, +0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, +0x19,0x19,0x19,0x19,0x19,0x19,0x19,0x19, +0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A, +0x1B,0x1B,0x1B,0x1B,0x1B,0x1B,0x1B,0x1B, +0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C, +0x1D,0x1D,0x1D,0x1D,0x1D,0x1D,0x1D,0x1D, +0x1E,0x1E,0x1E,0x1E,0x1E,0x1E,0x1E,0x1E, +0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F}; + +#define BGR8(r,g,b) (unsigned)(((BYTE)(b & 0xc0 | (g & 0xe0)>>2 | (r & 0xe0)>>5))) +#ifdef DDRAW +#define BGR16(r,g,b) ((WORD)(((BYTE)(ColorMap16[b]) | ((BYTE)(g&0xfc) << 3)) | (((WORD)(BYTE)(ColorMap16[r])) << 11))) +#else +#define BGR16(r,g,b) ((WORD)(((BYTE)(ColorMap16[b]) | ((BYTE)(ColorMap16[g]) << 5)) | (((WORD)(BYTE)(ColorMap16[r])) << 10))) +#endif +#define BGR24(r,g,b) (unsigned long)(((DWORD)(((BYTE)(b)|((WORD)((BYTE)(g))<<8))|(((DWORD)(BYTE)(r))<<16))) << 8) +#define BGR32(r,g,b) (unsigned long)((DWORD)(((BYTE)(b)|((WORD)((BYTE)(g))<<8))|(((DWORD)(BYTE)(r))<<16))) + + + +/* + * If pixelformat==PF_8A8B8G8R: + */ +#define PACK_8A8B8G8R( R, G, B, A ) \ + ( ((A) << 24) | ((B) << 16) | ((G) << 8) | (R) ) + + +/* + * If pixelformat==PF_8R8G8B: + */ +#define PACK_8R8G8B( R, G, B) ( ((R) << 16) | ((G) << 8) | (B) ) + + +/* + * If pixelformat==PF_5R6G5B: + */ + + +#ifdef DDRAW +#define PACK_5R6G5B( R, G, B) ((WORD)(((BYTE)(ColorMap16[B]) | ((BYTE)(G&0xfc) << 3)) | (((WORD)(BYTE)(ColorMap16[R])) << 11))) +#else +#define PACK_5R6G5B( R, G, B) ((WORD)(((BYTE)(ColorMap16[B]) | ((BYTE)(ColorMap16[G]) << 5)) | (((WORD)(BYTE)(ColorMap16[R])) << 10))) +#endif +/*---------------------------------------------------------------------------- + +Division lookup tables. These tables compute 0-255 divided by 51 and +modulo 51. These tables could approximate gamma correction. + +*/ + +char unsigned const aDividedBy51Rounded[256] = +{ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, +}; + +char unsigned const aDividedBy51[256] = +{ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, +}; + +char unsigned const aModulo51[256] = +{ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 0, 1, 2, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 0, 1, 2, 3, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 0, +}; + +/*---------------------------------------------------------------------------- + +Multiplication LUTs. These compute 0-5 times 6 and 36. + +*/ + +char unsigned const aTimes6[6] = +{ + 0, 6, 12, 18, 24, 30 +}; + +char unsigned const aTimes36[6] = +{ + 0, 36, 72, 108, 144, 180 +}; + + +/*---------------------------------------------------------------------------- + +Dither matrices for 8 bit to 2.6 bit halftones. + +*/ + +char unsigned const aHalftone16x16[256] = +{ + 0, 44, 9, 41, 3, 46, 12, 43, 1, 44, 10, 41, 3, 46, 12, 43, + 34, 16, 25, 19, 37, 18, 28, 21, 35, 16, 26, 19, 37, 18, 28, 21, + 38, 6, 47, 3, 40, 9, 50, 6, 38, 7, 47, 4, 40, 9, 49, 6, + 22, 28, 13, 31, 25, 31, 15, 34, 22, 29, 13, 32, 24, 31, 15, 34, + 2, 46, 12, 43, 1, 45, 10, 42, 2, 45, 11, 42, 1, 45, 11, 42, + 37, 18, 27, 21, 35, 17, 26, 20, 36, 17, 27, 20, 36, 17, 26, 20, + 40, 8, 49, 5, 38, 7, 48, 4, 39, 8, 48, 5, 39, 7, 48, 4, + 24, 30, 15, 33, 23, 29, 13, 32, 23, 30, 14, 33, 23, 29, 14, 32, + 2, 46, 12, 43, 0, 44, 10, 41, 3, 47, 12, 44, 0, 44, 10, 41, + 37, 18, 27, 21, 35, 16, 25, 19, 37, 19, 28, 22, 35, 16, 25, 19, + 40, 9, 49, 5, 38, 7, 47, 4, 40, 9, 50, 6, 38, 6, 47, 3, + 24, 30, 15, 34, 22, 29, 13, 32, 25, 31, 15, 34, 22, 28, 13, 31, + 1, 45, 11, 42, 2, 46, 11, 42, 1, 45, 10, 41, 2, 46, 11, 43, + 36, 17, 26, 20, 36, 17, 27, 21, 35, 16, 26, 20, 36, 18, 27, 21, + 39, 8, 48, 4, 39, 8, 49, 5, 38, 7, 48, 4, 39, 8, 49, 5, + 23, 29, 14, 33, 24, 30, 14, 33, 23, 29, 13, 32, 24, 30, 14, 33, +}; + +char unsigned const aHalftone8x8[64] = +{ + 0, 38, 9, 47, 2, 40, 11, 50, + 25, 12, 35, 22, 27, 15, 37, 24, + 6, 44, 3, 41, 8, 47, 5, 43, + 31, 19, 28, 15, 34, 21, 31, 18, + 1, 39, 11, 49, 0, 39, 10, 48, + 27, 14, 36, 23, 26, 13, 35, 23, + 7, 46, 4, 43, 7, 45, 3, 42, + 33, 20, 30, 17, 32, 19, 29, 16, +}; + +char unsigned const aHalftone4x4_1[16] = +{ + 0, 25, 6, 31, + 38, 12, 44, 19, + 9, 35, 3, 28, + 47, 22, 41, 15 +}; + +char unsigned const aHalftone4x4_2[16] = +{ + 41, 3, 9, 28, + 35, 15, 22, 47, + 6, 25, 38, 0, + 19, 44, 31, 12 +}; + +/*************************************************************************** + aWinGHalftoneTranslation + + Translates a 2.6 bit-per-pixel halftoned representation into the + slightly rearranged WinG Halftone Palette. +*/ + +char unsigned const aWinGHalftoneTranslation[216] = +{ + 0, + 29, + 30, + 31, + 32, + 249, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 250, + 250, + 57, + 58, + 59, + 251, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 82, + 83, + 84, + 85, + 86, + 87, + 88, + 89, + 250, + 90, + 91, + 92, + 93, + 94, + 95, + 96, + 97, + 98, + 99, + 100, + 101, + 102, + 103, + 104, + 105, + 106, + 107, + 108, + 109, + 110, + 111, + 227, + 112, + 113, + 114, + 115, + 116, + 117, + 118, + 119, + 151, + 120, + 121, + 122, + 123, + 124, + 228, + 125, + 126, + 229, + 133, + 162, + 135, + 131, + 132, + 137, + 166, + 134, + 140, + 130, + 136, + 143, + 138, + 139, + 174, + 141, + 142, + 177, + 129, + 144, + 145, + 146, + 147, + 148, + 149, + 150, + 157, + 152, + 153, + 154, + 155, + 156, + 192, + 158, + 159, + 160, + 161, + 196, + 163, + 164, + 165, + 127, + 199, + 167, + 168, + 169, + 170, + 171, + 172, + 173, + 207, + 175, + 176, + 210, + 178, + 179, + 180, + 181, + 182, + 183, + 184, + 185, + 186, + 187, + 188, + 189, + 190, + 191, + 224, + 193, + 194, + 195, + 252, + 252, + 197, + 198, + 128, + 253, + 252, + 200, + 201, + 202, + 203, + 204, + 205, + 206, + 230, + 208, + 209, + 231, + 211, + 212, + 213, + 214, + 215, + 216, + 217, + 218, + 219, + 220, + 221, + 222, + 254, + 223, + 232, + 225, + 226, + 255, +}; --- mesa-glw-7.4.orig/src/mesa/drivers/windows/gldirect/mesasw/gld_wgl_mesasw.c +++ mesa-glw-7.4/src/mesa/drivers/windows/gldirect/mesasw/gld_wgl_mesasw.c @@ -0,0 +1,1719 @@ +/**************************************************************************** +* +* Mesa 3-D graphics library +* Direct3D Driver Interface +* +* ======================================================================== +* +* Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved. +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included +* in all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF +* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +* SOFTWARE. +* +* ====================================================================== +* +* Language: ANSI C +* Environment: Windows 9x/2000/XP/XBox (Win32) +* +* Description: Mesa Software WGL (WindowsGL) +* +****************************************************************************/ + +#include +#define GL_GLEXT_PROTOTYPES +#include +#include + +#include "glheader.h" +#include "colors.h" +#include "context.h" +#include "colormac.h" +#include "dd.h" +#include "depth.h" +#include "extensions.h" +#include "macros.h" +#include "matrix.h" +// #include "mem.h" +//#include "mmath.h" +#include "mtypes.h" +#include "texformat.h" +#include "texstore.h" +#include "teximage.h" +#include "vbo/vbo.h" +#include "swrast/swrast.h" +#include "swrast_setup/swrast_setup.h" +#include "swrast/s_context.h" +#include "swrast/s_depth.h" +#include "swrast/s_lines.h" +#include "swrast/s_triangle.h" +#include "swrast/s_trispan.h" +#include "tnl/tnl.h" +#include "tnl/t_context.h" +#include "tnl/t_pipeline.h" + +#include "dglcontext.h" +#include "gld_driver.h" + +//--------------------------------------------------------------------------- +//--------------------------------------------------------------------------- + +DGL_pixelFormat pfTemplateMesaSW = +{ + { + sizeof(PIXELFORMATDESCRIPTOR), // Size of the data structure + 1, // Structure version - should be 1 + // Flags: + PFD_DRAW_TO_WINDOW | // The buffer can draw to a window or device surface. + PFD_DRAW_TO_BITMAP | // The buffer can draw to a bitmap. (DaveM) + PFD_SUPPORT_GDI | // The buffer supports GDI drawing. (DaveM) + PFD_SUPPORT_OPENGL | // The buffer supports OpenGL drawing. + PFD_DOUBLEBUFFER | // The buffer is double-buffered. + 0, // Placeholder for easy commenting of above flags + PFD_TYPE_RGBA, // Pixel type RGBA. + 32, // Total colour bitplanes (excluding alpha bitplanes) + 8, 0, // Red bits, shift + 8, 8, // Green bits, shift + 8, 16, // Blue bits, shift + 8, 24, // Alpha bits, shift (destination alpha) + 64, // Accumulator bits (total) + 16, 16, 16, 16, // Accumulator bits: Red, Green, Blue, Alpha + 16, // Depth bits + 8, // Stencil bits + 0, // Number of auxiliary buffers + 0, // Layer type + 0, // Specifies the number of overlay and underlay planes. + 0, // Layer mask + 0, // Specifies the transparent color or index of an underlay plane. + 0 // Damage mask + }, + 0, // Unused +}; + +//--------------------------------------------------------------------------- +// Extensions +//--------------------------------------------------------------------------- + +typedef struct { + PROC proc; + char *name; +} GLD_extension; + +static GLD_extension GLD_extList[] = { +#ifdef GL_EXT_polygon_offset + { (PROC)glPolygonOffsetEXT, "glPolygonOffsetEXT" }, +#endif + { (PROC)glBlendEquationEXT, "glBlendEquationEXT" }, + { (PROC)glBlendColorEXT, "glBlendColorExt" }, + { (PROC)glVertexPointerEXT, "glVertexPointerEXT" }, + { (PROC)glNormalPointerEXT, "glNormalPointerEXT" }, + { (PROC)glColorPointerEXT, "glColorPointerEXT" }, + { (PROC)glIndexPointerEXT, "glIndexPointerEXT" }, + { (PROC)glTexCoordPointerEXT, "glTexCoordPointer" }, + { (PROC)glEdgeFlagPointerEXT, "glEdgeFlagPointerEXT" }, + { (PROC)glGetPointervEXT, "glGetPointervEXT" }, + { (PROC)glArrayElementEXT, "glArrayElementEXT" }, + { (PROC)glDrawArraysEXT, "glDrawArrayEXT" }, + { (PROC)glAreTexturesResidentEXT, "glAreTexturesResidentEXT" }, + { (PROC)glBindTextureEXT, "glBindTextureEXT" }, + { (PROC)glDeleteTexturesEXT, "glDeleteTexturesEXT" }, + { (PROC)glGenTexturesEXT, "glGenTexturesEXT" }, + { (PROC)glIsTextureEXT, "glIsTextureEXT" }, + { (PROC)glPrioritizeTexturesEXT, "glPrioritizeTexturesEXT" }, + { (PROC)glCopyTexSubImage3DEXT, "glCopyTexSubImage3DEXT" }, + { (PROC)glTexImage3DEXT, "glTexImage3DEXT" }, + { (PROC)glTexSubImage3DEXT, "glTexSubImage3DEXT" }, + { (PROC)glPointParameterfEXT, "glPointParameterfEXT" }, + { (PROC)glPointParameterfvEXT, "glPointParameterfvEXT" }, + { (PROC)glLockArraysEXT, "glLockArraysEXT" }, + { (PROC)glUnlockArraysEXT, "glUnlockArraysEXT" }, + { NULL, "\0" } +}; + +//--------------------------------------------------------------------------- +// WMesa Internal Functions +//--------------------------------------------------------------------------- + +#define PAGE_FILE 0xffffffff + +#define REDBITS 0x03 +#define REDSHIFT 0x00 +#define GREENBITS 0x03 +#define GREENSHIFT 0x03 +#define BLUEBITS 0x02 +#define BLUESHIFT 0x06 + +typedef struct _dibSection { + HDC hDC; + HANDLE hFileMap; + BOOL fFlushed; + LPVOID base; +} WMDIBSECTION, *PWMDIBSECTION; + +typedef struct wmesa_context { + HWND Window; + HDC hDC; + HPALETTE hPalette; + HPALETTE hOldPalette; + HPEN hPen; + HPEN hOldPen; + HCURSOR hOldCursor; + COLORREF crColor; + // 3D projection stuff + RECT drawRect; + UINT uiDIBoffset; + // OpenGL stuff + HPALETTE hGLPalette; + GLuint width; + GLuint height; + GLuint ScanWidth; + GLboolean db_flag; //* double buffered? + GLboolean rgb_flag; //* RGB mode? + GLboolean dither_flag; //* use dither when 256 color mode for RGB? + GLuint depth; //* bits per pixel (1, 8, 24, etc) + ULONG pixel; // current color index or RGBA pixel value + ULONG clearpixel; //* pixel for clearing the color buffers + PBYTE ScreenMem; // WinG memory + BITMAPINFO *IndexFormat; + HPALETTE hPal; // Current Palette + HPALETTE hPalHalfTone; + + + WMDIBSECTION dib; + BITMAPINFO bmi; + HBITMAP hbmDIB; + HBITMAP hOldBitmap; + HBITMAP Old_Compat_BM; + HBITMAP Compat_BM; // Bitmap for double buffering + PBYTE pbPixels; + int nColors; + BYTE cColorBits; + int pixelformat; + + RECT rectOffScreen; + RECT rectSurface; +// HWND hwnd; + DWORD pitch; + PBYTE addrOffScreen; + + // We always double-buffer, for performance reasons, but + // we need to know which of SwapBuffers() or glFlush() to + // handle. If we're emulating, then we update on Flush(), + // otherwise we update on SwapBufers(). KeithH + BOOL bEmulateSingleBuffer; +} WMesaContext, *PWMC; + +#define GLD_GET_WMESA_DRIVER(c) (WMesaContext*)(c)->glPriv + +// TODO: +GLint stereo_flag = 0 ; + +/* If we are double-buffering, we want to get the DC for the + * off-screen DIB, otherwise the DC for the window. + */ +#define DD_GETDC ((Current->db_flag) ? Current->dib.hDC : Current->hDC ) +#define DD_RELEASEDC + +#define FLIP(Y) (Current->height-(Y)-1) + +struct DISPLAY_OPTIONS { + int stereo; + int fullScreen; + int mode; + int bpp; +}; + +struct DISPLAY_OPTIONS displayOptions; + +//--------------------------------------------------------------------------- + +static unsigned char threeto8[8] = { + 0, 0111>>1, 0222>>1, 0333>>1, 0444>>1, 0555>>1, 0666>>1, 0377 +}; + +static unsigned char twoto8[4] = { + 0, 0x55, 0xaa, 0xff +}; + +static unsigned char oneto8[2] = { + 0, 255 +}; + +//--------------------------------------------------------------------------- + +BYTE DITHER_RGB_2_8BIT( int red, int green, int blue, int pixel, int scanline) +{ + char unsigned redtemp, greentemp, bluetemp, paletteindex; + + //*** now, look up each value in the halftone matrix + //*** using an 8x8 ordered dither. + redtemp = aDividedBy51[red] + + (aModulo51[red] > aHalftone8x8[(pixel%8)*8 + + scanline%8]); + greentemp = aDividedBy51[(char unsigned)green] + + (aModulo51[green] > aHalftone8x8[ + (pixel%8)*8 + scanline%8]); + bluetemp = aDividedBy51[(char unsigned)blue] + + (aModulo51[blue] > aHalftone8x8[ + (pixel%8)*8 +scanline%8]); + + //*** recombine the halftoned rgb values into a palette index + paletteindex = + redtemp + aTimes6[greentemp] + aTimes36[bluetemp]; + + //*** and translate through the wing halftone palette + //*** translation vector to give the correct value. + return aWinGHalftoneTranslation[paletteindex]; +} + +//--------------------------------------------------------------------------- + +static unsigned char componentFromIndex(UCHAR i, UINT nbits, UINT shift) +{ + unsigned char val; + + val = i >> shift; + switch (nbits) { + + case 1: + val &= 0x1; + return oneto8[val]; + + case 2: + val &= 0x3; + return twoto8[val]; + + case 3: + val &= 0x7; + return threeto8[val]; + + default: + return 0; + } +} + +//--------------------------------------------------------------------------- + + +void wmSetPixel(PWMC pwc, int iScanLine, int iPixel, BYTE r, BYTE g, BYTE b) +{ + WMesaContext *Current = pwc; + + // Test for invalid scanline parameter. KeithH + if ((iScanLine < 0) || (iScanLine >= pwc->height)) + return; + + if (Current->db_flag) { + LPBYTE lpb = pwc->pbPixels; + UINT nBypp = pwc->cColorBits >> 3; + UINT nOffset = iPixel % nBypp; + + lpb += pwc->ScanWidth * iScanLine; + lpb += iPixel * nBypp; + + if(nBypp == 1){ + if(pwc->dither_flag) + *lpb = DITHER_RGB_2_8BIT(r,g,b,iScanLine,iPixel); + else + *lpb = BGR8(r,g,b); + } + else if(nBypp == 2) + *((LPWORD)lpb) = BGR16(r,g,b); + else if (nBypp == 3) + *((LPDWORD)lpb) = BGR24(r,g,b); + else if (nBypp == 4) + *((LPDWORD)lpb) = BGR32(r,g,b); + } + else{ + SetPixel(Current->hDC, iPixel, iScanLine, RGB(r,g,b)); + } +} + +//--------------------------------------------------------------------------- + +void wmCreateDIBSection( + HDC hDC, + PWMC pwc, // handle of device context + CONST BITMAPINFO *pbmi, // bitmap size, format, and color data + UINT iUsage // color data type indicator: RGB values or palette indices + ) +{ + DWORD dwSize = 0; + DWORD dwScanWidth; + UINT nBypp = pwc->cColorBits / 8; + HDC hic; + + dwScanWidth = (((pwc->ScanWidth * nBypp)+ 3) & ~3); + + pwc->ScanWidth =pwc->pitch = dwScanWidth; + + if (stereo_flag) + pwc->ScanWidth = 2* pwc->pitch; + + dwSize = sizeof(BITMAPINFO) + (dwScanWidth * pwc->height); + + pwc->dib.hFileMap = CreateFileMapping((HANDLE)PAGE_FILE, + NULL, + PAGE_READWRITE | SEC_COMMIT, + 0, + dwSize, + NULL); + + if (!pwc->dib.hFileMap) + return; + + pwc->dib.base = MapViewOfFile(pwc->dib.hFileMap, + FILE_MAP_ALL_ACCESS, + 0, + 0, + 0); + + if(!pwc->dib.base){ + CloseHandle(pwc->dib.hFileMap); + return; + } + + + CopyMemory(pwc->dib.base, pbmi, sizeof(BITMAPINFO)); + + hic = CreateIC("display", NULL, NULL, NULL); + pwc->dib.hDC = CreateCompatibleDC(hic); + + + pwc->hbmDIB = CreateDIBSection(hic, + &(pwc->bmi), + (iUsage ? DIB_PAL_COLORS : DIB_RGB_COLORS), + &(pwc->pbPixels), + pwc->dib.hFileMap, + 0); + pwc->ScreenMem = pwc->addrOffScreen = pwc->pbPixels; + pwc->hOldBitmap = SelectObject(pwc->dib.hDC, pwc->hbmDIB); + + DeleteDC(hic); + + return; + +} + +//--------------------------------------------------------------------------- + +void wmCreatePalette( PWMC pwdc ) +{ + /* Create a compressed and re-expanded 3:3:2 palette */ + int i; + LOGPALETTE *pPal; + BYTE rb, rs, gb, gs, bb, bs; + + pwdc->nColors = 0x100; + + pPal = (PLOGPALETTE)malloc(sizeof(LOGPALETTE) + + pwdc->nColors * sizeof(PALETTEENTRY)); + memset( pPal, 0, sizeof(LOGPALETTE) + pwdc->nColors * sizeof(PALETTEENTRY) ); + + pPal->palVersion = 0x300; + + rb = REDBITS; + rs = REDSHIFT; + gb = GREENBITS; + gs = GREENSHIFT; + bb = BLUEBITS; + bs = BLUESHIFT; + + if (pwdc->db_flag) { + + /* Need to make two palettes: one for the screen DC and one for the DIB. */ + pPal->palNumEntries = pwdc->nColors; + for (i = 0; i < pwdc->nColors; i++) { + pPal->palPalEntry[i].peRed = componentFromIndex( i, rb, rs ); + pPal->palPalEntry[i].peGreen = componentFromIndex( i, gb, gs ); + pPal->palPalEntry[i].peBlue = componentFromIndex( i, bb, bs ); + pPal->palPalEntry[i].peFlags = 0; + } + pwdc->hGLPalette = CreatePalette( pPal ); + pwdc->hPalette = CreatePalette( pPal ); + } + + else { + pPal->palNumEntries = pwdc->nColors; + for (i = 0; i < pwdc->nColors; i++) { + pPal->palPalEntry[i].peRed = componentFromIndex( i, rb, rs ); + pPal->palPalEntry[i].peGreen = componentFromIndex( i, gb, gs ); + pPal->palPalEntry[i].peBlue = componentFromIndex( i, bb, bs ); + pPal->palPalEntry[i].peFlags = 0; + } + pwdc->hGLPalette = CreatePalette( pPal ); + } + + free(pPal); + +} + +//--------------------------------------------------------------------------- + +/* This function sets the color table of a DIB section + * to match that of the destination DC + */ +BOOL wmSetDibColors(PWMC pwc) +{ + RGBQUAD *pColTab, *pRGB; + PALETTEENTRY *pPal, *pPE; + int i, nColors; + BOOL bRet=TRUE; + DWORD dwErr=0; + + /* Build a color table in the DIB that maps to the + * selected palette in the DC. + */ + nColors = 1 << pwc->cColorBits; + pPal = (PALETTEENTRY *)malloc( nColors * sizeof(PALETTEENTRY)); + memset( pPal, 0, nColors * sizeof(PALETTEENTRY) ); + GetPaletteEntries( pwc->hGLPalette, 0, nColors, pPal ); + pColTab = (RGBQUAD *)malloc( nColors * sizeof(RGBQUAD)); + for (i = 0, pRGB = pColTab, pPE = pPal; i < nColors; i++, pRGB++, pPE++) { + pRGB->rgbRed = pPE->peRed; + pRGB->rgbGreen = pPE->peGreen; + pRGB->rgbBlue = pPE->peBlue; + } + if(pwc->db_flag) + bRet = SetDIBColorTable(pwc->dib.hDC, 0, nColors, pColTab ); + + if(!bRet) + dwErr = GetLastError(); + + free( pColTab ); + free( pPal ); + + return bRet; +} + +//--------------------------------------------------------------------------- + +static void wmSetPixelFormat( PWMC wc, HDC hDC) +{ + if(wc->rgb_flag) + wc->cColorBits = GetDeviceCaps(hDC, BITSPIXEL); + else + wc->cColorBits = 8; + switch(wc->cColorBits){ + case 8: + if(wc->dither_flag != GL_TRUE) + wc->pixelformat = PF_INDEX8; + else + wc->pixelformat = PF_DITHER8; + break; + case 16: + wc->pixelformat = PF_5R6G5B; + break; + case 32: + wc->pixelformat = PF_8R8G8B; + break; + default: + wc->pixelformat = PF_BADFORMAT; + } +} + +//--------------------------------------------------------------------------- + +/* + * This function creates the DIB section that is used for combined + * GL and GDI calls + */ +BOOL wmCreateBackingStore(PWMC pwc, long lxSize, long lySize) +{ + HDC hdc = pwc->hDC; + LPBITMAPINFO pbmi = &(pwc->bmi); + int iUsage; + + pbmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + pbmi->bmiHeader.biWidth = lxSize; + pbmi->bmiHeader.biHeight= -lySize; + pbmi->bmiHeader.biPlanes = 1; + if(pwc->rgb_flag) + pbmi->bmiHeader.biBitCount = GetDeviceCaps(pwc->hDC, BITSPIXEL); + else + pbmi->bmiHeader.biBitCount = 8; + pbmi->bmiHeader.biCompression = BI_RGB; + pbmi->bmiHeader.biSizeImage = 0; + pbmi->bmiHeader.biXPelsPerMeter = 0; + pbmi->bmiHeader.biYPelsPerMeter = 0; + pbmi->bmiHeader.biClrUsed = 0; + pbmi->bmiHeader.biClrImportant = 0; + + iUsage = (pbmi->bmiHeader.biBitCount <= 8) ? DIB_PAL_COLORS : DIB_RGB_COLORS; + + pwc->cColorBits = pbmi->bmiHeader.biBitCount; + pwc->ScanWidth = pwc->pitch = lxSize; + pwc->width = lxSize; + pwc->height = lySize; + + wmCreateDIBSection(hdc, pwc, pbmi, iUsage); + + if ((iUsage == DIB_PAL_COLORS) && !(pwc->hGLPalette)) { + wmCreatePalette( pwc ); + wmSetDibColors( pwc ); + } + wmSetPixelFormat(pwc, pwc->hDC); + return TRUE; +} + +//--------------------------------------------------------------------------- + +/* + * Free up the dib section that was created + */ +BOOL wmDeleteBackingStore(PWMC pwc) +{ + SelectObject(pwc->dib.hDC, pwc->hOldBitmap); + DeleteDC(pwc->dib.hDC); + DeleteObject(pwc->hbmDIB); + UnmapViewOfFile(pwc->dib.base); + CloseHandle(pwc->dib.hFileMap); + return TRUE; +} + +//--------------------------------------------------------------------------- + +/* + * Blit memory DC to screen DC + */ +BOOL wmFlush(PWMC pwc, HDC hDC) +{ + BOOL bRet = 0; + DWORD dwErr = 0; + +// Now using bEmulateSingleBuffer in the calling function. KeithH + +// if(pwc->db_flag){ + bRet = BitBlt(hDC, 0, 0, pwc->width, pwc->height, + pwc->dib.hDC, 0, 0, SRCCOPY); +// } + + return bRet; + +} + +//--------------------------------------------------------------------------- +// Support Functions +//--------------------------------------------------------------------------- + +static void flush(GLcontext* ctx) +{ + GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); + WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx); +/* + if((Current->rgb_flag &&!(Current->db_flag)) + ||(!Current->rgb_flag)) + { + wmFlush(Current, Current->hDC); + } +*/ + // Only flush if we're not in double-buffer mode. KeithH + // The demo fractal.c calls glutSwapBuffers() then glFlush()! + if (Current->bEmulateSingleBuffer) { + wmFlush(Current, Current->hDC); + } +} + + +//--------------------------------------------------------------------------- + + +/* + * Set the color index used to clear the color buffer. + */ +static void clear_index(GLcontext* ctx, GLuint index) +{ + GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); + WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx); + Current->clearpixel = index; +} + + + +//--------------------------------------------------------------------------- + +/* + * Set the color used to clear the color buffer. + */ +//static void clear_color( GLcontext* ctx, const GLchan color[4] ) +// Changed for Mesa 5.x. KeithH +static void clear_color( + GLcontext* ctx, + const GLfloat color[4]) +{ + GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); + WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx); + GLubyte col[4]; + CLAMPED_FLOAT_TO_UBYTE(col[0], color[0]); + CLAMPED_FLOAT_TO_UBYTE(col[1], color[1]); + CLAMPED_FLOAT_TO_UBYTE(col[2], color[2]); + Current->clearpixel = RGB(col[0], col[1], col[2]); +} + + +//--------------------------------------------------------------------------- + + +/* + * Clear the specified region of the color buffer using the clear color + * or index as specified by one of the two functions above. + * + * This procedure clears either the front and/or the back COLOR buffers. + * Only the "left" buffer is cleared since we are not stereo. + * Clearing of the other non-color buffers is left to the swrast. + * We also only clear the color buffers if the color masks are all 1's. + * Otherwise, we let swrast do it. + */ + +static clear(GLcontext* ctx, GLbitfield mask, + GLboolean all, GLint x, GLint y, GLint width, GLint height) +{ + GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); + WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx); + DWORD dwColor; + WORD wColor; + BYTE bColor; + LPDWORD lpdw = (LPDWORD)Current->pbPixels; + LPWORD lpw = (LPWORD)Current->pbPixels; + LPBYTE lpb = Current->pbPixels; + int lines; + const GLuint *colorMask = (GLuint *) &ctx->Color.ColorMask; + + if (all){ + x=y=0; + width=Current->width; + height=Current->height; + } + + + /* sanity check - can't have right(stereo) buffers */ + assert((mask & (DD_FRONT_RIGHT_BIT | DD_BACK_RIGHT_BIT)) == 0); + + /* clear alpha */ + if ((mask & (DD_FRONT_LEFT_BIT | DD_BACK_RIGHT_BIT)) && + ctx->DrawBuffer->UseSoftwareAlphaBuffers && + ctx->Color.ColorMask[ACOMP]) { + _swrast_clear_alpha_buffers( ctx ); + } + + if (*colorMask == 0xffffffff && ctx->Color.IndexMask == 0xffffffff) { + if (mask & DD_BACK_LEFT_BIT) { + /* Double-buffering - clear back buffer */ + UINT nBypp = Current->cColorBits / 8; + int i = 0; + int iSize = 0; + + assert(Current->db_flag==GL_TRUE); /* we'd better be double buffer */ + if(nBypp ==1 ){ + iSize = Current->width/4; + bColor = BGR8(GetRValue(Current->clearpixel), + GetGValue(Current->clearpixel), + GetBValue(Current->clearpixel)); + wColor = MAKEWORD(bColor,bColor); + dwColor = MAKELONG(wColor, wColor); + } + if(nBypp == 2){ + iSize = Current->width / 2; + wColor = BGR16(GetRValue(Current->clearpixel), + GetGValue(Current->clearpixel), + GetBValue(Current->clearpixel)); + dwColor = MAKELONG(wColor, wColor); + } + else if(nBypp == 4){ + iSize = Current->width; + dwColor = BGR32(GetRValue(Current->clearpixel), + GetGValue(Current->clearpixel), + GetBValue(Current->clearpixel)); + } + + /* clear a line */ + while(i < iSize){ + *lpdw = dwColor; + lpdw++; + i++; + } + + /* This is the 24bit case */ + if (nBypp == 3) { + iSize = Current->width *3/4; + dwColor = BGR24(GetRValue(Current->clearpixel), + GetGValue(Current->clearpixel), + GetBValue(Current->clearpixel)); + while(i < iSize){ + *lpdw = dwColor; + lpb += nBypp; + lpdw = (LPDWORD)lpb; + i++; + } + } + + i = 0; + if (stereo_flag) + lines = height /2; + else + lines = height; + /* copy cleared line to other lines in buffer */ + do { + memcpy(lpb, Current->pbPixels, iSize*4); + lpb += Current->ScanWidth; + i++; + } + while (iclearpixel); + HBRUSH Brush=CreateSolidBrush(Current->clearpixel); + HPEN Old_Pen=SelectObject(DC,Pen); + HBRUSH Old_Brush=SelectObject(DC,Brush); + Rectangle(DC,x,y,x+width,y+height); + SelectObject(DC,Old_Pen); + SelectObject(DC,Old_Brush); + DeleteObject(Pen); + DeleteObject(Brush); + DD_RELEASEDC; + mask &= ~DD_FRONT_LEFT_BIT; + } /* single-buffer */ + } /* if masks are all 1's */ + + /* Call swrast if there is anything left to clear (like DEPTH) */ + if (mask) + _swrast_Clear( ctx, mask, all, x, y, width, height ); +} + + +//--------------------------------------------------------------------------- + + +static void enable( GLcontext* ctx, GLenum pname, GLboolean enable ) +{ + GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); + WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx); + + if (!Current) + return; + + if (pname == GL_DITHER) { + if(enable == GL_FALSE){ + Current->dither_flag = GL_FALSE; + if(Current->cColorBits == 8) + Current->pixelformat = PF_INDEX8; + } + else{ + if (Current->rgb_flag && Current->cColorBits == 8){ + Current->pixelformat = PF_DITHER8; + Current->dither_flag = GL_TRUE; + } + else + Current->dither_flag = GL_FALSE; + } + } +} + +//--------------------------------------------------------------------------- + +static GLboolean set_draw_buffer( GLcontext* ctx, GLenum mode ) +{ + /* TODO: this could be better */ + if (mode==GL_FRONT_LEFT || mode==GL_BACK_LEFT) { + return GL_TRUE; + } + else { + return GL_FALSE; + } +} + +//--------------------------------------------------------------------------- + + +static void set_read_buffer(GLcontext *ctx, GLframebuffer *colorBuffer, + GLenum buffer ) +{ + /* XXX todo */ + return; +} + + +//--------------------------------------------------------------------------- + + +/* Return characteristics of the output buffer. */ +//static void buffer_size( GLcontext* ctx, GLuint *width, GLuint *height ) +// Altered for Mesa 5.x. KeithH +static void buffer_size( + GLframebuffer *buffer, + GLuint *width, + GLuint *height) +{ + // For some reason the context is not passed into this function. + // Therefore we have to explicitly retrieve it. + GET_CURRENT_CONTEXT(ctx); + + GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); + WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx); + int New_Size; + RECT CR; + + GetClientRect(Current->Window,&CR); + + *width=CR.right; + *height=CR.bottom; + + New_Size=((*width)!=Current->width) || ((*height)!=Current->height); + + if (New_Size){ + Current->width=*width; + Current->height=*height; + Current->ScanWidth=Current->width; + if ((Current->ScanWidth%sizeof(long))!=0) + Current->ScanWidth+=(sizeof(long)-(Current->ScanWidth%sizeof(long))); + + if (Current->db_flag){ + if (Current->rgb_flag==GL_TRUE && Current->dither_flag!=GL_TRUE){ + wmDeleteBackingStore(Current); + wmCreateBackingStore(Current, Current->width, Current->height); + } + } + + } +} + + + +/**********************************************************************/ +/***** Accelerated point, line, polygon rendering *****/ +/**********************************************************************/ + +/* Accelerated routines are not implemented in 4.0. See OSMesa for ideas. */ + +static void fast_rgb_points( GLcontext* ctx, GLuint first, GLuint last ) +{ +} + +//--------------------------------------------------------------------------- + +/* Return pointer to accelerated points function */ +extern tnl_points_func choose_points_function( GLcontext* ctx ) +{ + return NULL; +} + +//--------------------------------------------------------------------------- + +static void fast_flat_rgb_line( GLcontext* ctx, GLuint v0, + GLuint v1, GLuint pv ) +{ +} + +//--------------------------------------------------------------------------- + +static tnl_line_func choose_line_function( GLcontext* ctx ) +{ +} + + +/**********************************************************************/ +/***** Span-based pixel drawing *****/ +/**********************************************************************/ + + +/* Write a horizontal span of 32-bit color-index pixels with a boolean mask. */ +static void write_ci32_span( const GLcontext* ctx, + GLuint n, GLint x, GLint y, + const GLuint index[], + const GLubyte mask[] ) +{ + GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); + WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx); + GLuint i; + PBYTE Mem=Current->ScreenMem+FLIP(y)*Current->ScanWidth+x; + assert(Current->rgb_flag==GL_FALSE); + for (i=0; iScreenMem+FLIP(y)*Current->ScanWidth+x; + assert(Current->rgb_flag==GL_FALSE); + for (i=0; iScreenMem+FLIP(y)*Current->ScanWidth+x; + assert(Current->rgb_flag==GL_FALSE); + for (i=0; irgb_flag==GL_TRUE) + { + GLuint i; + HDC DC=DD_GETDC; + y=FLIP(y); + if (mask) { + for (i=0; iScreenMem+y*Current->ScanWidth+x; + y = FLIP(y); + if (mask) { + for (i=0; ihPal, + RGB(rgba[i][RCOMP], + rgba[i][GCOMP], + rgba[i][BCOMP])); + } + else { + for (i=0; ihPal, + RGB(rgba[i][RCOMP], + rgba[i][GCOMP], + rgba[i][BCOMP])); + } + } +} + +//--------------------------------------------------------------------------- + +/* Write a horizontal span of RGB color pixels with a boolean mask. */ +static void write_rgb_span( const GLcontext* ctx, + GLuint n, GLint x, GLint y, + const GLubyte rgb[][3], const GLubyte mask[] ) +{ + GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); + WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx); + PWMC pwc = Current; + + if (pwc->rgb_flag==GL_TRUE) + { + GLuint i; + HDC DC=DD_GETDC; + y=FLIP(y); + if (mask) { + for (i=0; iScreenMem+y*Current->ScanWidth+x; + y = FLIP(y); + if (mask) { + for (i=0; ihPal, + RGB(rgb[i][RCOMP], + rgb[i][GCOMP], + rgb[i][BCOMP])); + } + else { + for (i=0; ihPal, + RGB(rgb[i][RCOMP], + rgb[i][GCOMP], + rgb[i][BCOMP])); + } + } +} + +//--------------------------------------------------------------------------- + +/* + * Write a horizontal span of pixels with a boolean mask. The current color + * is used for all pixels. + */ +static void write_mono_rgba_span( const GLcontext* ctx, + GLuint n, GLint x, GLint y, + const GLchan color[4], const GLubyte mask[]) +{ + GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); + WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx); + ULONG pixel = RGB( color[RCOMP], color[GCOMP], color[BCOMP] ); + GLuint i; + HDC DC=DD_GETDC; + PWMC pwc = Current; + assert(Current->rgb_flag==GL_TRUE); + y=FLIP(y); + if(Current->rgb_flag==GL_TRUE){ + for (i=0; irgb_flag==GL_FALSE); + for (i=0; iScreenMem+FLIP(y[i])*Current->ScanWidth+x[i]; + *Mem = index[i]; + } + } +} + + +//--------------------------------------------------------------------------- + + +/* + * Write an array of pixels with a boolean mask. The current color + * index is used for all pixels. + */ +static void write_mono_ci_pixels( const GLcontext* ctx, + GLuint n, + const GLint x[], const GLint y[], + GLuint colorIndex, const GLubyte mask[] ) +{ + GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); + WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx); + GLuint i; + assert(Current->rgb_flag==GL_FALSE); + for (i=0; iScreenMem+FLIP(y[i])*Current->ScanWidth+x[i]; + *Mem = colorIndex; + } + } +} + + +//--------------------------------------------------------------------------- + + +/* Write an array of RGBA pixels with a boolean mask. */ +static void write_rgba_pixels( const GLcontext* ctx, + GLuint n, const GLint x[], const GLint y[], + const GLubyte rgba[][4], const GLubyte mask[] ) +{ + GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); + WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx); + GLuint i; + PWMC pwc = Current; + HDC DC=DD_GETDC; + assert(Current->rgb_flag==GL_TRUE); + for (i=0; irgb_flag==GL_TRUE); + for (i=0; iScreenMem+FLIP(y)*Current->ScanWidth+x; + assert(Current->rgb_flag==GL_FALSE); + for (i=0; irgb_flag==GL_FALSE); + for (i=0; iScreenMem+FLIP(y[i])*Current->ScanWidth+x[i]); + } + } +} + +//--------------------------------------------------------------------------- + +/* Read a horizontal span of color pixels. */ +static void read_rgba_span( const GLcontext* ctx, + GLuint n, GLint x, GLint y, + GLubyte rgba[][4] ) +{ + GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); + WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx); + UINT i; + COLORREF Color; + HDC DC=DD_GETDC; + assert(Current->rgb_flag==GL_TRUE); + y = Current->height - y - 1; + for (i=0; irgb_flag==GL_TRUE); + for (i=0; iheight - y[i] - 1; + Color=GetPixel(DC,x[i],y2); + rgba[i][RCOMP] = GetRValue(Color); + rgba[i][GCOMP] = GetGValue(Color); + rgba[i][BCOMP] = GetBValue(Color); + rgba[i][ACOMP] = 255; + } + } + DD_RELEASEDC; +} + +//--------------------------------------------------------------------------- + +static void wmesa_update_state( + GLcontext *ctx, + GLuint new_state) +{ + _swrast_InvalidateState( ctx, new_state ); + _swsetup_InvalidateState( ctx, new_state ); + _vbo_InvalidateState( ctx, new_state ); + _tnl_InvalidateState( ctx, new_state ); +} + +//--------------------------------------------------------------------------- + +static void wmesa_viewport( + GLcontext *ctx, + GLint x, + GLint y, + GLsizei w, + GLsizei h) +{ +// ctx->Driver.ResizeBuffersMESA(ctx); +} + +//--------------------------------------------------------------------------- + +static void wmesa_update_state_first_time( + GLcontext *ctx, + GLuint new_state) +{ + struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference( ctx ); + TNLcontext *tnl = TNL_CONTEXT(ctx); + + /* + * XXX these function pointers could be initialized just once during + * context creation since they don't depend on any state changes. + * kws - This is true - this function gets called a lot and it + * would be good to minimize setting all this when not needed. + */ + // Good idea, so I'll do it. KeithH. :-) + + ctx->Driver.GetString = _gldGetStringGeneric; + ctx->Driver.UpdateState = wmesa_update_state; + ctx->Driver.DrawBuffer = set_draw_buffer; + ctx->Driver.ResizeBuffers = _swrast_alloc_buffers; + ctx->Driver.GetBufferSize = buffer_size; + + ctx->Driver.Viewport = wmesa_viewport; + + ctx->Driver.Accum = _swrast_Accum; + ctx->Driver.Bitmap = _swrast_Bitmap; + ctx->Driver.Clear = clear; + + ctx->Driver.Flush = flush; + ctx->Driver.ClearIndex = clear_index; + ctx->Driver.ClearColor = clear_color; + ctx->Driver.Enable = enable; + + ctx->Driver.CopyPixels = _swrast_CopyPixels; + ctx->Driver.DrawPixels = _swrast_DrawPixels; + ctx->Driver.ReadPixels = _swrast_ReadPixels; + + ctx->Driver.ChooseTextureFormat = _mesa_choose_tex_format; + ctx->Driver.TexImage1D = _mesa_store_teximage1d; + ctx->Driver.TexImage2D = _mesa_store_teximage2d; + ctx->Driver.TexImage3D = _mesa_store_teximage3d; + ctx->Driver.TexSubImage1D = _mesa_store_texsubimage1d; + ctx->Driver.TexSubImage2D = _mesa_store_texsubimage2d; + ctx->Driver.TexSubImage3D = _mesa_store_texsubimage3d; + ctx->Driver.TestProxyTexImage = _mesa_test_proxy_teximage; + + ctx->Driver.CopyTexImage1D = _swrast_copy_teximage1d; + ctx->Driver.CopyTexImage2D = _swrast_copy_teximage2d; + ctx->Driver.CopyTexSubImage1D = _swrast_copy_texsubimage1d; + ctx->Driver.CopyTexSubImage2D = _swrast_copy_texsubimage2d; + ctx->Driver.CopyTexSubImage3D = _swrast_copy_texsubimage3d; + ctx->Driver.CopyColorTable = _swrast_CopyColorTable; + ctx->Driver.CopyColorSubTable = _swrast_CopyColorSubTable; + ctx->Driver.CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D; + ctx->Driver.CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D; + + // Does not apply for Mesa 5.x + //ctx->Driver.BaseCompressedTexFormat = _mesa_base_compressed_texformat; + //ctx->Driver.CompressedTextureSize = _mesa_compressed_texture_size; + //ctx->Driver.GetCompressedTexImage = _mesa_get_compressed_teximage; + + swdd->SetBuffer = set_read_buffer; + + + /* Pixel/span writing functions: */ + swdd->WriteRGBASpan = write_rgba_span; + swdd->WriteRGBSpan = write_rgb_span; + swdd->WriteMonoRGBASpan = write_mono_rgba_span; + swdd->WriteRGBAPixels = write_rgba_pixels; + swdd->WriteMonoRGBAPixels = write_mono_rgba_pixels; + swdd->WriteCI32Span = write_ci32_span; + swdd->WriteCI8Span = write_ci8_span; + swdd->WriteMonoCISpan = write_mono_ci_span; + swdd->WriteCI32Pixels = write_ci32_pixels; + swdd->WriteMonoCIPixels = write_mono_ci_pixels; + + swdd->ReadCI32Span = read_ci32_span; + swdd->ReadRGBASpan = read_rgba_span; + swdd->ReadCI32Pixels = read_ci32_pixels; + swdd->ReadRGBAPixels = read_rgba_pixels; + + + tnl->Driver.RunPipeline = _tnl_run_pipeline; + + wmesa_update_state(ctx, new_state); +} + +//--------------------------------------------------------------------------- +// Driver interface functions +//--------------------------------------------------------------------------- + +BOOL gldCreateDrawable_MesaSW( + DGL_ctx *pCtx, + BOOL bPersistantInterface, + BOOL bPersistantBuffers) +{ + WMesaContext *c; + GLboolean true_color_flag; + GLboolean rgb_flag = GL_TRUE; + GLboolean db_flag = GL_TRUE; + + if (pCtx == NULL) + return FALSE; + + c = (struct wmesa_context * ) calloc(1,sizeof(struct wmesa_context)); + if (!c) + return FALSE; + + pCtx->glPriv = c; + + c->hDC = pCtx->hDC; + c->Window = pCtx->hWnd; + + true_color_flag = GetDeviceCaps(pCtx->hDC, BITSPIXEL) > 8; + + +#ifdef DITHER + if ((true_color_flag==GL_FALSE) && (rgb_flag == GL_TRUE)){ + c->dither_flag = GL_TRUE; + c->hPalHalfTone = WinGCreateHalftonePalette(); + } + else + c->dither_flag = GL_FALSE; +#else + c->dither_flag = GL_FALSE; +#endif + + + if (rgb_flag==GL_FALSE) + { + c->rgb_flag = GL_FALSE; +#if 0 + /* Old WinG stuff???? */ + c->db_flag = db_flag =GL_TRUE; /* WinG requires double buffering */ + printf("Single buffer is not supported in color index mode, ", + "setting to double buffer.\n"); +#endif + } + else + { + c->rgb_flag = GL_TRUE; + } + +// db_flag = pCtx->lpPF->pfd.dwFlags & PFD_DOUBLEBUFFER ? GL_TRUE : GL_FALSE; + db_flag = GL_TRUE; // Force double-buffer + if (db_flag) { + c->db_flag = 1; + /* Double buffered */ + { + wmCreateBackingStore(c, pCtx->dwWidth, pCtx->dwHeight); + + } + } else { + /* Single Buffered */ + if (c->rgb_flag) + c->db_flag = 0; + } + + c->bEmulateSingleBuffer = (pCtx->lpPF->pfd.dwFlags & PFD_DOUBLEBUFFER) + ? FALSE : TRUE; + + return TRUE; +} + +//--------------------------------------------------------------------------- + +BOOL gldResizeDrawable_MesaSW( + DGL_ctx *ctx, + BOOL bDefaultDriver, + BOOL bPersistantInterface, + BOOL bPersistantBuffers) +{ + WMesaContext *c; + + if (ctx == NULL) + return FALSE; + + c = ctx->glPriv; + if (c == NULL) + return FALSE; + + c->hDC = ctx->hDC; + c->Window = ctx->hWnd; +// c->width = ctx->dwWidth; +// c->height = ctx->dwHeight; + + if (c->db_flag) { + wmDeleteBackingStore(c); + wmCreateBackingStore(c, ctx->dwWidth, ctx->dwHeight); + } + + return TRUE; +} + +//--------------------------------------------------------------------------- + +BOOL gldDestroyDrawable_MesaSW( + DGL_ctx *ctx) +{ + WMesaContext *c; + + if (ctx == NULL) + return FALSE; + + c = ctx->glPriv; + if (c == NULL) + return FALSE; + + if (c->hPalHalfTone != NULL) + DeleteObject(c->hPalHalfTone); + + if (c->db_flag) + wmDeleteBackingStore(c); + + free(c); + + ctx->glPriv = NULL; + + return TRUE; +} + +//--------------------------------------------------------------------------- + +BOOL gldCreatePrivateGlobals_MesaSW(void) +{ + // Mesa Software driver needs no private globals + return TRUE; +} + +//--------------------------------------------------------------------------- + +BOOL gldDestroyPrivateGlobals_MesaSW(void) +{ + // Mesa Software driver needs no private globals + return TRUE; +} + +//--------------------------------------------------------------------------- + +BOOL gldBuildPixelformatList_MesaSW(void) +{ + // Release any existing pixelformat list + if (glb.lpPF) { + free(glb.lpPF); + } + + glb.nPixelFormatCount = 0; + glb.lpPF = NULL; + + glb.lpPF = (DGL_pixelFormat *)calloc(2, sizeof(DGL_pixelFormat)); + if (glb.lpPF == NULL) + return FALSE; + // Single-buffered + memcpy(&glb.lpPF[0], &pfTemplateMesaSW, sizeof(DGL_pixelFormat)); + glb.lpPF[0].pfd.dwFlags &= ~PFD_DOUBLEBUFFER; // Remove doublebuffer flag + // Double-buffered + memcpy(&glb.lpPF[1], &pfTemplateMesaSW, sizeof(DGL_pixelFormat)); + glb.nPixelFormatCount = 2; + + // Mark list as 'current' + glb.bPixelformatsDirty = FALSE; + + return TRUE; +} + +//--------------------------------------------------------------------------- + +BOOL gldInitialiseMesa_MesaSW( + DGL_ctx *gld) +{ + GLcontext *ctx; + + if (gld == NULL) + return FALSE; + + ctx = gld->glCtx; + + // Set max texture size to 256 + ctx->Const.MaxTextureLevels = 8; + + // Multitexture enable/disable + ctx->Const.MaxTextureUnits = (glb.bMultitexture) ? MAX_TEXTURE_UNITS : 1; + + /* Initialize the software rasterizer and helper modules.*/ + + // Added this to force max texture diminsion to 256. KeithH + ctx->Const.MaxTextureLevels = 8; + + _mesa_enable_sw_extensions(ctx); + _mesa_enable_imaging_extensions(ctx); + _mesa_enable_1_3_extensions(ctx); + +// _swrast_CreateContext( ctx ); +// _vbo_CreateContext( ctx ); +// _tnl_CreateContext( ctx ); +// _swsetup_CreateContext( ctx ); + + _swsetup_Wakeup( ctx ); + + wmesa_update_state_first_time(ctx, ~0); + + return TRUE; +} + +//--------------------------------------------------------------------------- + +BOOL gldSwapBuffers_MesaSW( + DGL_ctx *ctx, + HDC hDC, + HWND hWnd) +{ + WMesaContext *c; + + if (ctx == NULL) + return FALSE; + + c = ctx->glPriv; + if (c == NULL) + return FALSE; + + /* If we're swapping the buffer associated with the current context + * we have to flush any pending rendering commands first. + */ + + // Altered to respect bEmulateSingleBuffer. KeithH +// if (c->db_flag) + if (!c->bEmulateSingleBuffer) + wmFlush(c, hDC); + + return TRUE; +} + +//--------------------------------------------------------------------------- + +PROC gldGetProcAddress_MesaSW( + LPCSTR a) +{ + int i; + PROC proc = NULL; + + for (i=0; GLD_extList[i].proc; i++) { + if (!strcmp(a, GLD_extList[i].name)) { + proc = GLD_extList[i].proc; + break; + } + } + + gldLogPrintf(GLDLOG_INFO, "GetProcAddress: %s (%s)", a, proc ? "OK" : "Failed"); + + return proc; +} + +//--------------------------------------------------------------------------- + +BOOL gldGetDisplayMode_MesaSW( + DGL_ctx *ctx, + GLD_displayMode *glddm) +{ + HDC hdcDesktop; + + if (glddm == NULL) + return FALSE; + + // + // A bit hacky... KeithH + // + + hdcDesktop = GetDC(NULL); + glddm->Width = GetDeviceCaps(hdcDesktop, HORZRES); + glddm->Height = GetDeviceCaps(hdcDesktop, VERTRES); + glddm->BPP = GetDeviceCaps(hdcDesktop, BITSPIXEL); + glddm->Refresh = 0; + ReleaseDC(0, hdcDesktop); + + return TRUE; +} + +//--------------------------------------------------------------------------- + --- mesa-glw-7.4.orig/src/mesa/drivers/windows/gdi/InitCritSections.cpp +++ mesa-glw-7.4/src/mesa/drivers/windows/gdi/InitCritSections.cpp @@ -0,0 +1,32 @@ +#include "glapi.h" +#include "glThread.h" + +#ifdef WIN32_THREADS +extern "C" _glthread_Mutex OneTimeLock; +extern "C" _glthread_Mutex GenTexturesLock; + +extern "C" void FreeAllTSD(void); + +class _CriticalSectionInit +{ +public: + static _CriticalSectionInit m_inst; + + _CriticalSectionInit() + { + _glthread_INIT_MUTEX(OneTimeLock); + _glthread_INIT_MUTEX(GenTexturesLock); + } + + ~_CriticalSectionInit() + { + _glthread_DESTROY_MUTEX(OneTimeLock); + _glthread_DESTROY_MUTEX(GenTexturesLock); + FreeAllTSD(); + } +}; + +_CriticalSectionInit _CriticalSectionInit::m_inst; + + +#endif --- mesa-glw-7.4.orig/src/mesa/shader/arbprogram.syn +++ mesa-glw-7.4/src/mesa/shader/arbprogram.syn @@ -0,0 +1,2824 @@ +/* + * Mesa 3-D graphics library + * Version: 6.2 + * + * Copyright (C) 1999-2004 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 arbprogram.syn + * ARB_fragment/vertex_program syntax + * \author Michal Krol + */ + +.syntax program; + +/* + This value must be incremented every time emit code values or structure of the production + array changes. This value is placed at the beginning of the production array. The loader + compares the value with its REVISION value. If they do not match, the loader is not up + to date. +*/ +.emtcode REVISION 0x0a + +/* program type */ +.emtcode FRAGMENT_PROGRAM 0x01 +.emtcode VERTEX_PROGRAM 0x02 + +/* program section */ +.emtcode OPTION 0x01 +.emtcode INSTRUCTION 0x02 +.emtcode DECLARATION 0x03 +.emtcode END 0x04 + +/* GL_ARB_fragment_program option */ +.emtcode ARB_PRECISION_HINT_FASTEST 0x00 +.emtcode ARB_PRECISION_HINT_NICEST 0x01 +.emtcode ARB_FOG_EXP 0x02 +.emtcode ARB_FOG_EXP2 0x03 +.emtcode ARB_FOG_LINEAR 0x04 + +/* GL_ARB_vertex_program option */ +.emtcode ARB_POSITION_INVARIANT 0x05 + +/* GL_ARB_fragment_program_shadow option */ +.emtcode ARB_FRAGMENT_PROGRAM_SHADOW 0x06 + +/* GL_ARB_draw_buffers option */ +.emtcode ARB_DRAW_BUFFERS 0x07 + +/* GL_MESA_texture_array option */ +.emtcode MESA_TEXTURE_ARRAY 0x08 + +/* GL_ARB_fragment_program instruction class */ +.emtcode OP_ALU_INST 0x00 +.emtcode OP_TEX_INST 0x01 + +/* GL_ARB_vertex_program instruction class */ +/* OP_ALU_INST */ + +/* GL_ARB_fragment_program instruction type */ +.emtcode OP_ALU_VECTOR 0x00 +.emtcode OP_ALU_SCALAR 0x01 +.emtcode OP_ALU_BINSC 0x02 +.emtcode OP_ALU_BIN 0x03 +.emtcode OP_ALU_TRI 0x04 +.emtcode OP_ALU_SWZ 0x05 +.emtcode OP_TEX_SAMPLE 0x06 +.emtcode OP_TEX_KIL 0x07 + +/* GL_ARB_vertex_program instruction type */ +.emtcode OP_ALU_ARL 0x08 +/* OP_ALU_VECTOR */ +/* OP_ALU_SCALAR */ +/* OP_ALU_BINSC */ +/* OP_ALU_BIN */ +/* OP_ALU_TRI */ +/* OP_ALU_SWZ */ + +/* GL_ARB_fragment_program instruction code */ +.emtcode OP_ABS 0x00 +.emtcode OP_ABS_SAT 0x1B +.emtcode OP_FLR 0x09 +.emtcode OP_FLR_SAT 0x26 +.emtcode OP_FRC 0x0A +.emtcode OP_FRC_SAT 0x27 +.emtcode OP_LIT 0x0C +.emtcode OP_LIT_SAT 0x2A +.emtcode OP_MOV 0x11 +.emtcode OP_MOV_SAT 0x30 +.emtcode OP_COS 0x1F +.emtcode OP_COS_SAT 0x20 +.emtcode OP_EX2 0x07 +.emtcode OP_EX2_SAT 0x25 +.emtcode OP_LG2 0x0B +.emtcode OP_LG2_SAT 0x29 +.emtcode OP_RCP 0x14 +.emtcode OP_RCP_SAT 0x33 +.emtcode OP_RSQ 0x15 +.emtcode OP_RSQ_SAT 0x34 +.emtcode OP_SIN 0x38 +.emtcode OP_SIN_SAT 0x39 +.emtcode OP_SCS 0x35 +.emtcode OP_SCS_SAT 0x36 +.emtcode OP_POW 0x13 +.emtcode OP_POW_SAT 0x32 +.emtcode OP_ADD 0x01 +.emtcode OP_ADD_SAT 0x1C +.emtcode OP_DP3 0x03 +.emtcode OP_DP3_SAT 0x21 +.emtcode OP_DP4 0x04 +.emtcode OP_DP4_SAT 0x22 +.emtcode OP_DPH 0x05 +.emtcode OP_DPH_SAT 0x23 +.emtcode OP_DST 0x06 +.emtcode OP_DST_SAT 0x24 +.emtcode OP_MAX 0x0F +.emtcode OP_MAX_SAT 0x2E +.emtcode OP_MIN 0x10 +.emtcode OP_MIN_SAT 0x2F +.emtcode OP_MUL 0x12 +.emtcode OP_MUL_SAT 0x31 +.emtcode OP_SGE 0x16 +.emtcode OP_SGE_SAT 0x37 +.emtcode OP_SLT 0x17 +.emtcode OP_SLT_SAT 0x3A +.emtcode OP_SUB 0x18 +.emtcode OP_SUB_SAT 0x3B +.emtcode OP_XPD 0x1A +.emtcode OP_XPD_SAT 0x43 +.emtcode OP_CMP 0x1D +.emtcode OP_CMP_SAT 0x1E +.emtcode OP_LRP 0x2B +.emtcode OP_LRP_SAT 0x2C +.emtcode OP_MAD 0x0E +.emtcode OP_MAD_SAT 0x2D +.emtcode OP_SWZ 0x19 +.emtcode OP_SWZ_SAT 0x3C +.emtcode OP_TEX 0x3D +.emtcode OP_TEX_SAT 0x3E +.emtcode OP_TXB 0x3F +.emtcode OP_TXB_SAT 0x40 +.emtcode OP_TXP 0x41 +.emtcode OP_TXP_SAT 0x42 +.emtcode OP_KIL 0x28 + +/* GL_ARB_vertex_program instruction code */ +.emtcode OP_ARL 0x02 +/* OP_ABS */ +/* OP_FLR */ +/* OP_FRC */ +/* OP_LIT */ +/* OP_MOV */ +/* OP_EX2 */ +.emtcode OP_EXP 0x08 +/* OP_LG2 */ +.emtcode OP_LOG 0x0D +/* OP_RCP */ +/* OP_RSQ */ +/* OP_POW */ +/* OP_ADD */ +/* OP_DP3 */ +/* OP_DP4 */ +/* OP_DPH */ +/* OP_DST */ +/* OP_MAX */ +/* OP_MIN */ +/* OP_MUL */ +/* OP_SGE */ +/* OP_SLT */ +/* OP_SUB */ +/* OP_XPD */ +/* OP_MAD */ +/* OP_SWZ */ + +/* fragment attribute binding */ +.emtcode FRAGMENT_ATTRIB_COLOR 0x01 +.emtcode FRAGMENT_ATTRIB_TEXCOORD 0x02 +.emtcode FRAGMENT_ATTRIB_FOGCOORD 0x03 +.emtcode FRAGMENT_ATTRIB_POSITION 0x04 + +/* vertex attribute binding */ +.emtcode VERTEX_ATTRIB_POSITION 0x01 +.emtcode VERTEX_ATTRIB_WEIGHT 0x02 +.emtcode VERTEX_ATTRIB_NORMAL 0x03 +.emtcode VERTEX_ATTRIB_COLOR 0x04 +.emtcode VERTEX_ATTRIB_FOGCOORD 0x05 +.emtcode VERTEX_ATTRIB_TEXCOORD 0x06 +.emtcode VERTEX_ATTRIB_MATRIXINDEX 0x07 +.emtcode VERTEX_ATTRIB_GENERIC 0x08 + +/* fragment result binding */ +.emtcode FRAGMENT_RESULT_COLOR 0x01 +.emtcode FRAGMENT_RESULT_DEPTH 0x02 + +/* vertex result binding */ +.emtcode VERTEX_RESULT_POSITION 0x01 +.emtcode VERTEX_RESULT_COLOR 0x02 +.emtcode VERTEX_RESULT_FOGCOORD 0x03 +.emtcode VERTEX_RESULT_POINTSIZE 0x04 +.emtcode VERTEX_RESULT_TEXCOORD 0x05 + +/* texture target */ +.emtcode TEXTARGET_1D 0x01 +.emtcode TEXTARGET_2D 0x02 +.emtcode TEXTARGET_3D 0x03 +.emtcode TEXTARGET_RECT 0x04 +.emtcode TEXTARGET_CUBE 0x05 +/* GL_ARB_fragment_program_shadow */ +.emtcode TEXTARGET_SHADOW1D 0x06 +.emtcode TEXTARGET_SHADOW2D 0x07 +.emtcode TEXTARGET_SHADOWRECT 0x08 +/* GL_MESA_texture_array */ +.emtcode TEXTARGET_1D_ARRAY 0x09 +.emtcode TEXTARGET_2D_ARRAY 0x0a +.emtcode TEXTARGET_SHADOW1D_ARRAY 0x0b +.emtcode TEXTARGET_SHADOW2D_ARRAY 0x0c + +/* face type */ +.emtcode FACE_FRONT 0x00 +.emtcode FACE_BACK 0x01 + +/* color type */ +.emtcode COLOR_PRIMARY 0x00 +.emtcode COLOR_SECONDARY 0x01 + +/* component */ +.emtcode COMPONENT_X 0x00 +.emtcode COMPONENT_Y 0x01 +.emtcode COMPONENT_Z 0x02 +.emtcode COMPONENT_W 0x03 +.emtcode COMPONENT_0 0x04 +.emtcode COMPONENT_1 0x05 + +/* array index type */ +.emtcode ARRAY_INDEX_ABSOLUTE 0x00 +.emtcode ARRAY_INDEX_RELATIVE 0x01 + +/* matrix name */ +.emtcode MATRIX_MODELVIEW 0x01 +.emtcode MATRIX_PROJECTION 0x02 +.emtcode MATRIX_MVP 0x03 +.emtcode MATRIX_TEXTURE 0x04 +.emtcode MATRIX_PALETTE 0x05 +.emtcode MATRIX_PROGRAM 0x06 + +/* matrix modifier */ +.emtcode MATRIX_MODIFIER_IDENTITY 0x00 +.emtcode MATRIX_MODIFIER_INVERSE 0x01 +.emtcode MATRIX_MODIFIER_TRANSPOSE 0x02 +.emtcode MATRIX_MODIFIER_INVTRANS 0x03 + +/* constant type */ +.emtcode CONSTANT_SCALAR 0x01 +.emtcode CONSTANT_VECTOR 0x02 + +/* program param type */ +.emtcode PROGRAM_PARAM_ENV 0x01 +.emtcode PROGRAM_PARAM_LOCAL 0x02 + +/* register type */ +.emtcode REGISTER_ATTRIB 0x01 +.emtcode REGISTER_PARAM 0x02 +.emtcode REGISTER_RESULT 0x03 +.emtcode REGISTER_ESTABLISHED_NAME 0x04 + +/* param binding */ +.emtcode PARAM_NULL 0x00 +.emtcode PARAM_ARRAY_ELEMENT 0x01 +.emtcode PARAM_STATE_ELEMENT 0x02 +.emtcode PARAM_PROGRAM_ELEMENT 0x03 +.emtcode PARAM_PROGRAM_ELEMENTS 0x04 +.emtcode PARAM_CONSTANT 0x05 + +/* param state property */ +.emtcode STATE_MATERIAL 0x01 +.emtcode STATE_LIGHT 0x02 +.emtcode STATE_LIGHT_MODEL 0x03 +.emtcode STATE_LIGHT_PROD 0x04 +.emtcode STATE_FOG 0x05 +.emtcode STATE_MATRIX_ROWS 0x06 +/* GL_ARB_fragment_program */ +.emtcode STATE_TEX_ENV 0x07 +.emtcode STATE_DEPTH 0x08 +/* GL_ARB_vertex_program */ +.emtcode STATE_TEX_GEN 0x09 +.emtcode STATE_CLIP_PLANE 0x0A +.emtcode STATE_POINT 0x0B + +/* state material property */ +.emtcode MATERIAL_AMBIENT 0x01 +.emtcode MATERIAL_DIFFUSE 0x02 +.emtcode MATERIAL_SPECULAR 0x03 +.emtcode MATERIAL_EMISSION 0x04 +.emtcode MATERIAL_SHININESS 0x05 + +/* state light property */ +.emtcode LIGHT_AMBIENT 0x01 +.emtcode LIGHT_DIFFUSE 0x02 +.emtcode LIGHT_SPECULAR 0x03 +.emtcode LIGHT_POSITION 0x04 +.emtcode LIGHT_ATTENUATION 0x05 +.emtcode LIGHT_HALF 0x06 +.emtcode LIGHT_SPOT_DIRECTION 0x07 + +/* state light model property */ +.emtcode LIGHT_MODEL_AMBIENT 0x01 +.emtcode LIGHT_MODEL_SCENECOLOR 0x02 + +/* state light product property */ +.emtcode LIGHT_PROD_AMBIENT 0x01 +.emtcode LIGHT_PROD_DIFFUSE 0x02 +.emtcode LIGHT_PROD_SPECULAR 0x03 + +/* state texture environment property */ +.emtcode TEX_ENV_COLOR 0x01 + +/* state texture generation coord property */ +.emtcode TEX_GEN_EYE 0x01 +.emtcode TEX_GEN_OBJECT 0x02 + +/* state fog property */ +.emtcode FOG_COLOR 0x01 +.emtcode FOG_PARAMS 0x02 + +/* state depth property */ +.emtcode DEPTH_RANGE 0x01 + +/* state point parameters property */ +.emtcode POINT_SIZE 0x01 +.emtcode POINT_ATTENUATION 0x02 + +/* declaration */ +.emtcode ATTRIB 0x01 +.emtcode PARAM 0x02 +.emtcode TEMP 0x03 +.emtcode OUTPUT 0x04 +.emtcode ALIAS 0x05 +/* GL_ARB_vertex_program */ +.emtcode ADDRESS 0x06 + +/* error messages */ +.errtext UNKNOWN_PROGRAM_SIGNATURE "1001: '$e_signature$': unknown program signature" +.errtext MISSING_END_OR_INVALID_STATEMENT "1002: '$e_statement$': invalid statement" +.errtext CODE_AFTER_END "1003: '$e_statement$': code after 'END' keyword" +.errtext INVALID_PROGRAM_OPTION "1004: '$e_identifier$': invalid program option" +.errtext EXT_SWIZ_COMP_EXPECTED "1005: extended swizzle component expected but '$e_token$' found" +.errtext TEX_TARGET_EXPECTED "1006: texture target expected but '$e_token$' found" +.errtext TEXTURE_EXPECTED "1007: 'texture' expected but '$e_identifier$' found" +.errtext SOURCE_REGISTER_EXPECTED "1008: source register expected but '$e_token$' found" +.errtext DESTINATION_REGISTER_EXPECTED "1009: destination register expected but '$e_token$' found" +.errtext INVALID_ADDRESS_COMPONENT "1010: '$e_identifier$': invalid address component" +.errtext INVALID_ADDRESS_WRITEMASK "1011: '$e_identifier$': invalid address writemask" +.errtext INVALID_COMPONENT "1012: '$e_charordigit$': invalid component" +.errtext INVALID_SUFFIX "1013: '$e_identifier$': invalid suffix" +.errtext INVALID_WRITEMASK "1014: '$e_identifier$': invalid writemask" +.errtext FRAGMENT_EXPECTED "1015: 'fragment' expected but '$e_identifier$' found" +.errtext VERTEX_EXPECTED "1016: 'vertex' expected but '$e_identifier$' found" +.errtext INVALID_FRAGMENT_PROPERTY "1017: '$e_identifier$': invalid fragment property" +.errtext INVALID_VERTEX_PROPERTY "1018: '$e_identifier$': invalid vertex property" +.errtext INVALID_STATE_PROPERTY "1019: '$e_identifier$': invalid state property" +.errtext INVALID_MATERIAL_PROPERTY "1020: '$e_identifier$': invalid material property" +.errtext INVALID_LIGHT_PROPERTY "1021: '$e_identifier$': invalid light property" +.errtext INVALID_SPOT_PROPERTY "1022: '$e_identifier$': invalid spot property" +.errtext INVALID_LIGHTMODEL_PROPERTY "1023: '$e_identifier$': invalid light model property" +.errtext INVALID_LIGHTPROD_PROPERTY "1024: '$e_identifier$': invalid light product property" +.errtext INVALID_TEXENV_PROPERTY "1025: '$e_identifier$': invalid texture environment property" +.errtext INVALID_TEXGEN_PROPERTY "1026: '$e_identifier$': invalid texture generating property" +.errtext INVALID_TEXGEN_COORD "1027: '$e_identifier$': invalid texture generating coord" +.errtext INVALID_FOG_PROPERTY "1028: '$e_identifier$': invalid fog property" +.errtext INVALID_DEPTH_PROPERTY "1029: '$e_identifier$': invalid depth property" +.errtext INVALID_CLIPPLANE_PROPERTY "1030: '$e_identifier$': invalid clip plane property" +.errtext INVALID_POINT_PROPERTY "1031: '$e_identifier$': invalid point property" +.errtext MATRIX_ROW_SELECTOR_OR_MODIFIER_EXPECTED "1032: matrix row selector or modifier expected but '$e_token$' found" +.errtext INVALID_MATRIX_NAME "1033: '$e_identifier$': invalid matrix name" +.errtext INVALID_PROGRAM_PROPERTY "1034: '$e_identifier$': invalid program property" +.errtext RESULT_EXPECTED "1035: 'result' expected but '$e_token$' found" +.errtext INVALID_RESULT_PROPERTY "1036: '$e_identifier$': invalid result property" +.errtext INVALID_FACE_PROPERTY "1037: '$e_identifier$': invalid face property" +.errtext INVALID_COLOR_PROPERTY "1038: '$e_identifier$': invalid color property" +.errtext IDENTIFIER_EXPECTED "1039: identifier expected but '$e_token$' found" +.errtext RESERVED_KEYWORD "1040: use of reserved keyword as an identifier" +.errtext INTEGER_EXPECTED "1041: integer value expected but '$e_token$' found" +.errtext MISSING_SEMICOLON "1042: ';' expected but '$e_token$' found" +.errtext MISSING_COMMA "1043: ',' expected but '$e_token$' found" +.errtext MISSING_LBRACKET "1044: '[' expected but '$e_token$' found" +.errtext MISSING_RBRACKET "1045: ']' expected but '$e_token$' found" +.errtext MISSING_DOT "1046: '.' expected but '$e_token$' found" +.errtext MISSING_EQUAL "1047: '=' expected but '$e_token$' found" +.errtext MISSING_LBRACE "1048: '{' expected but '$e_token$' found" +.errtext MISSING_RBRACE "1049: '}' expected but '$e_token$' found" +.errtext MISSING_DOTDOT "1050: '..' expected but '$e_token$' found" +.errtext MISSING_FRACTION_OR_EXPONENT "1051: missing fraction part or exponent" +.errtext MISSING_DOT_OR_EXPONENT "1052: missing '.' or exponent" +.errtext EXPONENT_VALUE_EXPECTED "1053: exponent value expected" +.errtext INTEGER_OUT_OF_RANGE "1054: integer value out of range" +.errtext OPERATION_NEEDS_DESTINATION_VARIABLE "1055: operation needs destination variable" +.errtext OPERATION_NEEDS_SOURCE_VARIABLE "1056: operation needs source variable" +.errtext ADDRESS_REGISTER_EXPECTED "1057: address register expected but '$e_token$' found" +.errtext ADDRESS_REGISTER_OR_INTEGER_EXPECTED "1058: address register or integer literal expected but '$e_token$' found" + +/* extension presence condition registers */ + +/* GL_ARB_vertex_blend */ +/* GL_EXT_vertex_weighting */ +.regbyte vertex_blend 0x00 + +/* GL_ARB_matrix_palette */ +.regbyte matrix_palette 0x00 + +/* GL_ARB_point_parameters */ +/* GL_EXT_point_parameters */ +.regbyte point_parameters 0x00 + +/* GL_EXT_secondary_color */ +.regbyte secondary_color 0x00 + +/* GL_EXT_fog_coord */ +.regbyte fog_coord 0x00 + +/* GL_EXT_texture_rectangle */ +/* GL_NV_texture_rectangle */ +.regbyte texture_rectangle 0x00 + +/* GL_ARB_fragment_program_shadow */ +.regbyte fragment_program_shadow 0x00 + +/* GL_ARB_draw_buffers */ +.regbyte draw_buffers 0x00 + +/* GL_MESA_texture_array */ +.regbyte texture_array 0x00 + +/* option presence condition registers */ +/* they are all initially set to zero - when a particular OPTION is encountered, the appropriate */ +/* register is set to 1 to indicate that the OPTION was specified. */ + +/* GL_ARB_fragment_program */ +.regbyte ARB_precision_hint_fastest 0x00 +.regbyte ARB_precision_hint_nicest 0x00 +.regbyte ARB_fog_exp 0x00 +.regbyte ARB_fog_exp2 0x00 +.regbyte ARB_fog_linear 0x00 + +/* GL_ARB_vertex_program */ +.regbyte ARB_position_invariant 0x00 + +/* GL_ARB_fragment_program_shadow */ +.regbyte ARB_fragment_program_shadow 0x00 + +/* GL_ARB_draw_buffers */ +.regbyte ARB_draw_buffers 0x00 + +/* GL_MESA_texture_array */ +.regbyte MESA_texture_array 0x00 + +/* program target condition register */ +/* this syntax script deals with two program targets - VERTEX_PROGRAM and FRAGMENT_PROGRAM. */ +/* to distinguish between them we need a register that will store for us the current target. */ +/* the client will typically set the register to apropriate value before parsing a particular */ +/* program. the mapping between program targets and their values is listed below. */ +/* */ +/* program target register value */ +/* ---------------------------------------------- */ +/* FRAGMENT_PROGRAM 0x10 */ +/* VERTEX_PROGRAM 0x20 */ +/* */ +/* the initial value of the register is 0 to catch potential errors with not setting the register */ +/* with the proper value. */ +.regbyte program_target 0x00 + +/* + ::= "END" +*/ +program + programs .error UNKNOWN_PROGRAM_SIGNATURE .emit REVISION; +programs + .if (program_target == 0x10) frag_program_1_0 .emit FRAGMENT_PROGRAM .emit 0x01 .emit 0x00 .or + .if (program_target == 0x20) vert_program_1_0 .emit VERTEX_PROGRAM .emit 0x01 .emit 0x00; +frag_program_1_0 + '!' .and '!' .and 'A' .and 'R' .and 'B' .and 'f' .and 'p' .and '1' .and '.' .and '0' .and + optional_space .and fp_optionSequence .and fp_statementSequence .and + "END" .error MISSING_END_OR_INVALID_STATEMENT .emit END .and optional_space .and + '\0' .error CODE_AFTER_END; +vert_program_1_0 + '!' .and '!' .and 'A' .and 'R' .and 'B' .and 'v' .and 'p' .and '1' .and '.' .and '0' .and + optional_space .and vp_optionSequence .and vp_statementSequence .and + "END" .error MISSING_END_OR_INVALID_STATEMENT .emit END .and optional_space .and + '\0' .error CODE_AFTER_END; + +/* + ::=